Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix checkbox props
Browse files Browse the repository at this point in the history
  • Loading branch information
zwgnr committed Feb 15, 2023
1 parent ac9f5f9 commit c7c5765
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nine-maps-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cakepop/react": minor
---

Pass radix checkbox props to react component
21 changes: 20 additions & 1 deletion packages/cakepop-react/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,32 @@ export type CBProps = Props &
CheckboxProps;

export const Checkbox = forwardRef<Ref, CBProps>((props, forwardedRef) => {
const { sx = {}, children, variant, size } = props;
const {
sx = {},
children,
variant,
size,
defaultChecked,
checked,
onCheckedChange,
disabled,
required,
name,
value,
} = props;
let { className, style } = pop(sx!);
let ref = useObjectRef(forwardedRef);
return (
<form>
<Flex style={{ alignItems: 'center' }}>
<RadixCheckbox.Root
defaultChecked={defaultChecked}
checked={checked}
onCheckedChange={onCheckedChange}
disabled={disabled}
required={required}
name={name}
value={value}
style={style}
className={clsx(!!sx && className, cbRootRecipe({ size }))}
id='c1'>
Expand Down

0 comments on commit c7c5765

Please sign in to comment.