Skip to content

Commit

Permalink
Merge branch 'beta' into refactor/typography-components-in-design-system
Browse files Browse the repository at this point in the history
  • Loading branch information
babblebey authored Aug 3, 2023
2 parents 9be3000 + 9563116 commit 1df8154
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 27 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@

> All notable changes to this project will be documented in this file
## [1.58.0-beta.5](https://github.com/open-sauced/insights/compare/v1.58.0-beta.4...v1.58.0-beta.5) (2023-08-02)


### 🍕 Features

* update redirect to feed page for unauthenticated users ([#1464](https://github.com/open-sauced/insights/issues/1464)) ([6d8505f](https://github.com/open-sauced/insights/commit/6d8505facf6d12c49714ec94b8790e5c13313e77))


### 🐛 Bug Fixes

* add checkbox id name if not available based on label ([#1466](https://github.com/open-sauced/insights/issues/1466)) ([68f66a7](https://github.com/open-sauced/insights/commit/68f66a70bef124ceecb3f2ee0952b366e208578b))

## [1.58.0-beta.4](https://github.com/open-sauced/insights/compare/v1.58.0-beta.3...v1.58.0-beta.4) (2023-08-01)


Expand Down
51 changes: 27 additions & 24 deletions components/atoms/Checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,34 @@ interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPr
}

const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
({ className, label, id = "checkbox", ...props }, ref) => (
<div className="flex items-center">
<CheckboxPrimitive.Root
ref={ref}
className={clsx(
"peer h-4 w-4 shrink-0 rounded-[4px] cursor-pointer bg-white border border-light-slate-8 hover:border-orange-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-orange-500 data-[state=checked]:bg-orange-500",
className
)}
{...props}
id={id}
>
<CheckboxPrimitive.Indicator className={clsx("flex items-center justify-center text-white")}>
<FiCheck className="w-full h-full" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
{label && (
<label
htmlFor={id}
className="ml-3 text-sm font-medium leading-none cursor-pointer text-light-slate-12 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
({ className, label, id, ...props }, ref) => {
const getId = () => (id ? id : label?.replaceAll(" ", "_").toLowerCase());
return (
<div className="flex items-center">
<CheckboxPrimitive.Root
ref={ref}
className={clsx(
"peer h-4 w-4 shrink-0 rounded cursor-pointer bg-white border border-light-slate-8 hover:border-orange-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-orange-500 data-[state=checked]:bg-orange-500",
className
)}
{...props}
id={getId()}
>
{label}
</label>
)}
</div>
)
<CheckboxPrimitive.Indicator className={clsx("flex items-center justify-center text-white")}>
<FiCheck className="w-full h-full" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
{label && (
<label
htmlFor={getId()}
className="ml-3 text-sm font-medium leading-none cursor-pointer text-light-slate-12 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
{label}
</label>
)}
</div>
);
}
);
Checkbox.displayName = CheckboxPrimitive.Root.displayName;

Expand Down
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@open-sauced/insights",
"description": "🍕The dashboard for open source discovery.",
"keywords": [],
"version": "1.58.0-beta.4",
"version": "1.58.0-beta.5",
"author": "Brian Douglas <[email protected]>",
"private": true,
"license": "Apache 2.0",
Expand Down

0 comments on commit 1df8154

Please sign in to comment.