diff --git a/docs/components/example/index.json b/docs/components/example/index.json index ba24453ad..f76cbdec3 100644 --- a/docs/components/example/index.json +++ b/docs/components/example/index.json @@ -176,15 +176,14 @@ "text-field-disabled": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldDisabled() {\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n}", "text-field-enabled": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldEnabled() {\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n}", "text-field-grapheme-count": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldGraphemeCount() {\n return (\n \n \n \n );\n}", + "text-field-indicator": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldIndicator() {\n return (\n \n \n \n );\n}", "text-field-large": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldLarge() {\n return (\n \n \n \n );\n}", "text-field-medium": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldMedium() {\n return (\n \n \n \n );\n}", "text-field-number-formatting": "import { useMemo, useState } from \"react\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldNumberFormatting() {\n const [value, setValue] = useState(\"1000\");\n\n const formattedValue = useMemo(() => {\n if (value === \"\") return value;\n\n const number = Number(value.replace(/,/g, \"\"));\n if (Number.isNaN(number)) return \"\";\n\n return number.toLocaleString();\n }, [value]);\n\n return (\n setValue(value)}\n >\n \n \n );\n}", - "text-field-optional": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldOptional() {\n return (\n \n \n \n );\n}", "text-field-prefix": "import { IconMagnifyingglassLine } from \"@daangn/react-monochrome-icon\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldPrefix() {\n return (\n
\n \n \n \n }\n >\n \n \n
\n );\n}", "text-field-preview": "import { useState } from \"react\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldPreview() {\n const [value, setValue] = useState(\"\");\n\n return (\n
\n setValue(value)}>\n \n \n

현재 값: {value}

\n
\n );\n}", "text-field-react-hook-form": "import { ActionButton } from \"seed-design/ui/action-button\";\nimport { IconHouseLine } from \"@daangn/react-monochrome-icon\";\nimport { useForm } from \"react-hook-form\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\ninterface FormValues {\n name: string;\n address: string;\n}\n\nexport default function TextFieldReactHookForm() {\n const {\n register,\n handleSubmit,\n clearErrors,\n formState: { errors },\n } = useForm();\n\n const onValid = (data: FormValues) => {\n window.alert(JSON.stringify(data, null, 2));\n };\n\n return (\n
\n \n \n \n }\n >\n \n \n
\n \n 제출\n \n clearErrors([\"name\", \"address\"])}\n variant=\"neutralWeak\"\n >\n 초기화\n \n
\n \n );\n}", "text-field-read-only": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldReadOnly() {\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n}", - "text-field-required": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldRequired() {\n return (\n \n \n \n );\n}", "text-field-slicing": "import { useState } from \"react\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldSlicing() {\n const [value, setValue] = useState(\"\");\n\n return (\n setValue(slicedValue)}\n >\n \n \n );\n}", "text-field-suffix": "import { IconWonLine } from \"@daangn/react-monochrome-icon\";\nimport { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldSuffix() {\n return (\n
\n \n \n \n }>\n \n \n
\n );\n}", "text-field-xlarge": "import { TextField, TextFieldInput } from \"seed-design/ui/text-field\";\n\nexport default function TextFieldXlarge() {\n return (\n \n \n \n );\n}", diff --git a/docs/public/__registry__/ui/select-box.json b/docs/public/__registry__/ui/select-box.json index 085c836e2..095a5d9be 100644 --- a/docs/public/__registry__/ui/select-box.json +++ b/docs/public/__registry__/ui/select-box.json @@ -8,7 +8,7 @@ { "name": "select-box.tsx", "type": "ui", - "content": "\"use client\";\n\nimport { IconCheckmarkFatFill } from \"@daangn/react-monochrome-icon\";\nimport {\n SelectBoxCheck as SeedSelectBoxCheck,\n SelectBoxRadio as SeedSelectBoxRadio,\n} from \"@seed-design/react\";\nimport * as React from \"react\";\n\nimport \"@seed-design/stylesheet/selectBox.css\";\nimport \"@seed-design/stylesheet/selectBoxGroup.css\";\n\nexport interface SelectBoxRadioGroupProps\n extends SeedSelectBoxRadio.GroupProps {}\n\nexport const SelectBoxRadioGroup = SeedSelectBoxRadio.Group;\n\nexport interface SelectBoxRadioProps extends SeedSelectBoxRadio.RootProps {\n label: string;\n\n description?: string;\n\n inputProps?: React.InputHTMLAttributes;\n\n rootRef?: React.Ref;\n}\n\nexport const SelectBoxRadio = React.forwardRef<\n HTMLInputElement,\n SelectBoxRadioProps\n>(({ label, description, inputProps, rootRef, ...otherProps }, ref) => {\n if (!otherProps[\"aria-label\"] && !otherProps[\"aria-labelledby\"]) {\n console.warn(\n \"SelectBoxRadio component requires either an `aria-label` or `aria-labelledby` attribute.\",\n );\n }\n\n return (\n \n \n \n {label}\n {description && (\n \n {description}\n \n )}\n \n \n \n \n \n }\n />\n \n \n );\n});\nSelectBoxRadio.displayName = \"SelectBoxRadio\";\n\nexport interface SelectBoxCheckGroupProps\n extends SeedSelectBoxCheck.GroupProps {}\n\nexport const SelectBoxCheckGroup = SeedSelectBoxCheck.Group;\n\nexport interface SelectBoxCheckProps extends SeedSelectBoxCheck.RootProps {\n label: string;\n\n description?: string;\n\n inputProps?: React.InputHTMLAttributes;\n\n rootRef?: React.Ref;\n}\n\nexport const SelectBoxCheck = React.forwardRef<\n HTMLInputElement,\n SelectBoxCheckProps\n>(({ label, description, inputProps, rootRef, ...otherProps }, ref) => {\n return (\n \n \n \n {label}\n {description && (\n \n {description}\n \n )}\n \n \n } />\n \n \n );\n});\nSelectBoxCheck.displayName = \"SelectBoxCheck\";\n" + "content": "\"use client\";\n\nimport { IconCheckmarkFatFill } from \"@daangn/react-monochrome-icon\";\nimport {\n SelectBoxCheck as SeedSelectBoxCheck,\n SelectBoxRadio as SeedSelectBoxRadio,\n} from \"@seed-design/react\";\nimport * as React from \"react\";\n\nimport \"@seed-design/stylesheet/selectBox.css\";\nimport \"@seed-design/stylesheet/selectBoxGroup.css\";\n\nexport interface SelectBoxRadioGroupProps\n extends SeedSelectBoxRadio.GroupProps {}\n\nexport const SelectBoxRadioGroup = React.forwardRef<\n HTMLDivElement,\n SelectBoxRadioGroupProps\n>((props, ref) => {\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"]) {\n console.warn(\n \"SelectBoxRadioGroup component requires either an `aria-label` or `aria-labelledby` attribute.\",\n );\n }\n\n return ;\n});\n\nexport interface SelectBoxRadioProps extends SeedSelectBoxRadio.RootProps {\n label: string;\n\n description?: string;\n\n inputProps?: React.InputHTMLAttributes;\n\n rootRef?: React.Ref;\n}\n\nexport const SelectBoxRadio = React.forwardRef<\n HTMLInputElement,\n SelectBoxRadioProps\n>(({ label, description, inputProps, rootRef, ...otherProps }, ref) => {\n return (\n \n \n \n {label}\n {description && (\n \n {description}\n \n )}\n \n \n \n \n \n }\n />\n \n \n );\n});\nSelectBoxRadio.displayName = \"SelectBoxRadio\";\n\nexport interface SelectBoxCheckGroupProps\n extends SeedSelectBoxCheck.GroupProps {}\n\nexport const SelectBoxCheckGroup = SeedSelectBoxCheck.Group;\n\nexport interface SelectBoxCheckProps extends SeedSelectBoxCheck.RootProps {\n label: string;\n\n description?: string;\n\n inputProps?: React.InputHTMLAttributes;\n\n rootRef?: React.Ref;\n}\n\nexport const SelectBoxCheck = React.forwardRef<\n HTMLInputElement,\n SelectBoxCheckProps\n>(({ label, description, inputProps, rootRef, ...otherProps }, ref) => {\n return (\n \n \n \n {label}\n {description && (\n \n {description}\n \n )}\n \n \n } />\n \n \n );\n});\nSelectBoxCheck.displayName = \"SelectBoxCheck\";\n" } ] } \ No newline at end of file diff --git a/docs/registry/ui/select-box.tsx b/docs/registry/ui/select-box.tsx index eb7255fea..c0b573079 100644 --- a/docs/registry/ui/select-box.tsx +++ b/docs/registry/ui/select-box.tsx @@ -13,7 +13,18 @@ import "@seed-design/stylesheet/selectBoxGroup.css"; export interface SelectBoxRadioGroupProps extends SeedSelectBoxRadio.GroupProps {} -export const SelectBoxRadioGroup = SeedSelectBoxRadio.Group; +export const SelectBoxRadioGroup = React.forwardRef< + HTMLDivElement, + SelectBoxRadioGroupProps +>((props, ref) => { + if (!props["aria-label"] && !props["aria-labelledby"]) { + console.warn( + "SelectBoxRadioGroup component requires either an `aria-label` or `aria-labelledby` attribute.", + ); + } + + return ; +}); export interface SelectBoxRadioProps extends SeedSelectBoxRadio.RootProps { label: string; @@ -29,12 +40,6 @@ export const SelectBoxRadio = React.forwardRef< HTMLInputElement, SelectBoxRadioProps >(({ label, description, inputProps, rootRef, ...otherProps }, ref) => { - if (!otherProps["aria-label"] && !otherProps["aria-labelledby"]) { - console.warn( - "SelectBoxRadio component requires either an `aria-label` or `aria-labelledby` attribute.", - ); - } - return (