-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
184 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
docs/components/example/select-box-check-group-preview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SelectBoxCheck, SelectBoxCheckGroup } from "@/registry/ui/select-box-check-group"; | ||
|
||
export default function SelectBoxCheckGroupPreview() { | ||
return ( | ||
<SelectBoxCheckGroup> | ||
<SelectBoxCheck value="culpa" label="Culpa" defaultChecked /> | ||
<SelectBoxCheck | ||
value="voluptate" | ||
label="Voluptate" | ||
description="Elit cupidatat dolore fugiat enim veniam culpa." | ||
/> | ||
<SelectBoxCheck value="eiusmod" label="Eiusmod" /> | ||
</SelectBoxCheckGroup> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
docs/content/docs/react/components/select-boxes/select-box-check-group.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Select Box Check Group | ||
--- | ||
|
||
<ComponentExample name="select-box-check-group-preview" /> | ||
|
||
## 설치 | ||
|
||
<Installation name="select-box-check-group" /> | ||
|
||
## Props | ||
|
||
### `SelectBoxCheckGroup` | ||
|
||
`SelectBoxCheckGroup`은 받는 prop이 없어요. `SelectBoxCheck` 간 간격을 설정하는 목적으로만 사용돼요. | ||
|
||
### `SelectBoxCheck` | ||
|
||
<AutoTypeTable | ||
path="./registry/ui/select-box-check-group.tsx" | ||
name="SelectBoxCheckProps" | ||
/> |
16 changes: 0 additions & 16 deletions
16
docs/content/docs/react/components/select-boxes/select-box-check.mdx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "select-box-check-group", | ||
"dependencies": [ | ||
"@seed-design/react-checkbox", | ||
"@daangn/react-monochrome-icon" | ||
], | ||
"registries": [ | ||
{ | ||
"name": "select-box-check-group.tsx", | ||
"type": "ui", | ||
"content": "\"use client\";\n\nimport {\n type UseCheckboxProps,\n useCheckbox,\n} from \"@seed-design/react-checkbox\";\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from \"@seed-design/recipe/checkbox\";\nimport {\n type SelectBoxVariantProps,\n selectBox,\n} from \"@seed-design/recipe/selectBox\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\nimport type { Assign } from \"../util/types\";\nimport { visuallyHidden } from \"../util/visuallyHidden\";\n\nimport \"@seed-design/stylesheet/checkbox.css\";\nimport \"@seed-design/stylesheet/selectBox.css\";\nimport {\n IconCheckmarkFatFill,\n IconMinusFatFill,\n} from \"@daangn/react-monochrome-icon\";\n\nexport const SelectBoxCheckGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...otherProps }, ref) => {\n const classNames = selectBox();\n\n return (\n <div ref={ref} {...otherProps} className={clsx(classNames.root, className)}>\n {children}\n </div>\n );\n});\nSelectBoxCheckGroup.displayName = \"SelectBoxCheckGroup\";\n\nexport interface SelectBoxCheckProps\n extends SelectBoxVariantProps,\n Pick<CheckboxVariantProps, \"indeterminate\">,\n Omit<UseCheckboxProps, \"disabled\" | \"invalid\"> {\n label: string;\n description?: string;\n}\n\ntype ReactSelectBoxCheck = Assign<\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"children\">,\n SelectBoxCheckProps\n>;\n\nexport const SelectBoxCheck = React.forwardRef<\n HTMLInputElement,\n ReactSelectBoxCheck\n>(({ className, label, description, indeterminate, ...otherProps }, ref) => {\n const { rootProps, restProps, hiddenInputProps, controlProps, stateProps } =\n useCheckbox(otherProps);\n\n const checkClassNames = checkbox({\n size: \"large\",\n variant: \"square\",\n indeterminate,\n });\n const selectBoxClassNames = selectBox();\n\n return (\n <label\n className={clsx(selectBoxClassNames.box, className)}\n {...rootProps}\n {...restProps}\n >\n <input ref={ref} {...hiddenInputProps} style={visuallyHidden} />\n <div className={selectBoxClassNames.content}>\n <span className={selectBoxClassNames.label}>{label}</span>\n {description && (\n <span className={selectBoxClassNames.description}>{description}</span>\n )}\n </div>\n <div\n {...controlProps}\n className={clsx(selectBoxClassNames.control, checkClassNames.control)}\n >\n {!indeterminate ? (\n <IconCheckmarkFatFill\n aria-hidden\n {...stateProps}\n className={checkClassNames.icon}\n />\n ) : (\n <IconMinusFatFill\n aria-hidden\n {...stateProps}\n className={checkClassNames.icon}\n />\n )}\n </div>\n </label>\n );\n});\nSelectBoxCheck.displayName = \"SelectBoxCheck\";\n" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.