diff --git a/component-docs/metadatas/component.ts b/component-docs/metadatas/component.ts index b3e9a1fe2..2b932fab2 100644 --- a/component-docs/metadatas/component.ts +++ b/component-docs/metadatas/component.ts @@ -13,6 +13,18 @@ export const componentMetadatas: ComponentMetadataSchema[] = [ dependencies: ["@radix-ui/react-slot"], snippets: ["component/action-button.tsx"], }, + { + name: "action-chip", + type: "component", + dependencies: ["@radix-ui/react-slot"], + snippets: ["component/action-chip.tsx"], + }, + { + name: "control-chip", + type: "component", + dependencies: ["@radix-ui/react-slot"], + snippets: ["component/control-chip.tsx"], + }, { name: "checkbox", type: "component", diff --git a/component-docs/public/__mdx__/component/action-chip.mdx b/component-docs/public/__mdx__/component/action-chip.mdx new file mode 100644 index 000000000..08792730f --- /dev/null +++ b/component-docs/public/__mdx__/component/action-chip.mdx @@ -0,0 +1,46 @@ +```tsx copy filename="action-chip.tsx" +import { Slot } from "@radix-ui/react-slot"; +import { actionChip, type ActionChipVariantProps } from "@seed-design/recipe/actionChip"; +import clsx from "clsx"; +import * as React from "react"; + +import "@seed-design/stylesheet/actionChip.css"; + +export interface ActionChipProps + extends React.ButtonHTMLAttributes, + ActionChipVariantProps { + prefixIcon?: React.ReactNode; + + suffixIcon?: React.ReactNode; +} + +export const ActionChip = React.forwardRef( + ( + { + className, + size = "medium", + layout = "withText", + children, + prefixIcon, + suffixIcon, + ...otherProps + }, + ref, + ) => { + const classNames = actionChip({ size, layout }); + return ( + + ); + }, +); +ActionChip.displayName = "ActionChip"; + +``` diff --git a/component-docs/public/__mdx__/component/control-chip.mdx b/component-docs/public/__mdx__/component/control-chip.mdx new file mode 100644 index 000000000..b42582a2e --- /dev/null +++ b/component-docs/public/__mdx__/component/control-chip.mdx @@ -0,0 +1,62 @@ +```tsx copy filename="control-chip.tsx" +import { Slot } from "@radix-ui/react-slot"; +import { controlChip, type ControlChipVariantProps } from "@seed-design/recipe/controlChip"; +import clsx from "clsx"; +import * as React from "react"; + +import "@seed-design/stylesheet/controlChip.css"; +import { UseCheckboxProps, useCheckbox } from "@seed-design/react-checkbox"; +import { visuallyHidden } from "../util/visuallyHidden"; + +export interface ControlChipToggleProps + extends Omit, "size">, + UseCheckboxProps, + ControlChipVariantProps { + prefixIcon?: React.ReactNode; + + suffixIcon?: React.ReactNode; +} + +const ControlChipToggle = React.forwardRef( + ( + { + className, + size = "medium", + layout = "withText", + children, + prefixIcon, + suffixIcon, + ...otherProps + }, + ref, + ) => { + const classNames = controlChip({ size, layout }); + const { rootProps, hiddenInputProps, restProps } = useCheckbox(otherProps); + return ( + + ); + }, +); +ControlChipToggle.displayName = "ControlChip.Toggle"; + +export const ControlChip = Object.assign( + () => { + console.warn( + "ControlChip is a base component and should not be rendered. Use ControlChip.Toggle or ControlChip.Radio instead.", + ); + }, + { + Toggle: ControlChipToggle, + }, +); + +``` diff --git a/component-docs/public/__mdx__/react/action-chip-icon-only.mdx b/component-docs/public/__mdx__/react/action-chip-icon-only.mdx new file mode 100644 index 000000000..33f4086dd --- /dev/null +++ b/component-docs/public/__mdx__/react/action-chip-icon-only.mdx @@ -0,0 +1,13 @@ +```tsx copy +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipIconOnly() { + return ( + + + + ); +} + +``` diff --git a/component-docs/public/__mdx__/react/action-chip-medium.mdx b/component-docs/public/__mdx__/react/action-chip-medium.mdx new file mode 100644 index 000000000..52001497a --- /dev/null +++ b/component-docs/public/__mdx__/react/action-chip-medium.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipMedium() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/action-chip-prefix-icon.mdx b/component-docs/public/__mdx__/react/action-chip-prefix-icon.mdx new file mode 100644 index 000000000..a64a909de --- /dev/null +++ b/component-docs/public/__mdx__/react/action-chip-prefix-icon.mdx @@ -0,0 +1,9 @@ +```tsx copy +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipPrefixIcon() { + return }>라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/action-chip-preview.mdx b/component-docs/public/__mdx__/react/action-chip-preview.mdx new file mode 100644 index 000000000..7a8b94278 --- /dev/null +++ b/component-docs/public/__mdx__/react/action-chip-preview.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipPreview() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/action-chip-small.mdx b/component-docs/public/__mdx__/react/action-chip-small.mdx new file mode 100644 index 000000000..35fcae153 --- /dev/null +++ b/component-docs/public/__mdx__/react/action-chip-small.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipSmall() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/control-chip-icon-only.mdx b/component-docs/public/__mdx__/react/control-chip-icon-only.mdx new file mode 100644 index 000000000..4154e3c16 --- /dev/null +++ b/component-docs/public/__mdx__/react/control-chip-icon-only.mdx @@ -0,0 +1,13 @@ +```tsx copy +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipIconOnly() { + return ( + + + + ); +} + +``` diff --git a/component-docs/public/__mdx__/react/control-chip-medium.mdx b/component-docs/public/__mdx__/react/control-chip-medium.mdx new file mode 100644 index 000000000..27a39ca06 --- /dev/null +++ b/component-docs/public/__mdx__/react/control-chip-medium.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ActionChipMedium() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/control-chip-prefix-icon.mdx b/component-docs/public/__mdx__/react/control-chip-prefix-icon.mdx new file mode 100644 index 000000000..c27c8f06c --- /dev/null +++ b/component-docs/public/__mdx__/react/control-chip-prefix-icon.mdx @@ -0,0 +1,9 @@ +```tsx copy +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipPrefixIcon() { + return }>라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/control-chip-preview.mdx b/component-docs/public/__mdx__/react/control-chip-preview.mdx new file mode 100644 index 000000000..3b86fe5ec --- /dev/null +++ b/component-docs/public/__mdx__/react/control-chip-preview.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipPreview() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/control-chip-small.mdx b/component-docs/public/__mdx__/react/control-chip-small.mdx new file mode 100644 index 000000000..f84588611 --- /dev/null +++ b/component-docs/public/__mdx__/react/control-chip-small.mdx @@ -0,0 +1,8 @@ +```tsx copy +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ActionChipSmall() { + return 라벨; +} + +``` diff --git a/component-docs/public/__mdx__/react/tabs-layout-fill.mdx b/component-docs/public/__mdx__/react/tabs-layout-fill.mdx index 3dad3fb5e..22aaadeaf 100644 --- a/component-docs/public/__mdx__/react/tabs-layout-fill.mdx +++ b/component-docs/public/__mdx__/react/tabs-layout-fill.mdx @@ -3,26 +3,24 @@ import { Tabs, TabContent, TabContentList, TabTrigger, TabTriggerList } from "se export default function TabsLayoutFill() { return ( -
- - - 라벨1 - 라벨2 - 라벨3 - - - -
Content 1
-
- -
Content 2
-
- -
Content 3
-
-
-
-
+ + + 라벨1 + 라벨2 + 라벨3 + + + +
Content 1
+
+ +
Content 2
+
+ +
Content 3
+
+
+
); } diff --git a/component-docs/public/__mdx__/react/tabs-layout-hug.mdx b/component-docs/public/__mdx__/react/tabs-layout-hug.mdx index fb41e2735..53b3bc3e0 100644 --- a/component-docs/public/__mdx__/react/tabs-layout-hug.mdx +++ b/component-docs/public/__mdx__/react/tabs-layout-hug.mdx @@ -3,26 +3,24 @@ import { Tabs, TabContent, TabContentList, TabTrigger, TabTriggerList } from "se export default function TabsLayoutHug() { return ( -
- - - 라벨1 - 라벨2 - 라벨3 - - - -
Content 1
-
- -
Content 2
-
- -
Content 3
-
-
-
-
+ + + 라벨1 + 라벨2 + 라벨3 + + + +
Content 1
+
+ +
Content 2
+
+ +
Content 3
+
+
+
); } diff --git a/component-docs/public/__mdx__/react/tabs-size-medium.mdx b/component-docs/public/__mdx__/react/tabs-size-medium.mdx index 61518f54d..d9bc9a8f6 100644 --- a/component-docs/public/__mdx__/react/tabs-size-medium.mdx +++ b/component-docs/public/__mdx__/react/tabs-size-medium.mdx @@ -3,26 +3,24 @@ import { Tabs, TabContent, TabContentList, TabTrigger, TabTriggerList } from "se export default function TabsSizeMedium() { return ( -
- - - 라벨1 - 라벨2 - 라벨3 - - - -
Content 1
-
- -
Content 2
-
- -
Content 3
-
-
-
-
+ + + 라벨1 + 라벨2 + 라벨3 + + + +
Content 1
+
+ +
Content 2
+
+ +
Content 3
+
+
+
); } diff --git a/component-docs/public/__mdx__/react/tabs-size-small.mdx b/component-docs/public/__mdx__/react/tabs-size-small.mdx index 57d7b8f72..18dcc9404 100644 --- a/component-docs/public/__mdx__/react/tabs-size-small.mdx +++ b/component-docs/public/__mdx__/react/tabs-size-small.mdx @@ -3,28 +3,24 @@ import { Tabs, TabContent, TabContentList, TabTrigger, TabTriggerList } from "se export default function TabsSizeSmall() { return ( -
- - - 라벨1 - 라벨2 - 라벨3 - - - -
- Content 1 -
-
- -
Content 2
-
- -
Content 3
-
-
-
-
+ + + 라벨1 + 라벨2 + 라벨3 + + + +
Content 1
+
+ +
Content 2
+
+ +
Content 3
+
+
+
); } diff --git a/component-docs/public/__registry__/component/action-chip.json b/component-docs/public/__registry__/component/action-chip.json new file mode 100644 index 000000000..e9aba2e31 --- /dev/null +++ b/component-docs/public/__registry__/component/action-chip.json @@ -0,0 +1,13 @@ +{ + "name": "action-chip", + "dependencies": [ + "@radix-ui/react-slot" + ], + "registries": [ + { + "name": "action-chip.tsx", + "content": "import { Slot } from \"@radix-ui/react-slot\";\nimport { actionChip, type ActionChipVariantProps } from \"@seed-design/recipe/actionChip\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\nimport \"@seed-design/stylesheet/actionChip.css\";\n\nexport interface ActionChipProps\n extends React.ButtonHTMLAttributes,\n ActionChipVariantProps {\n prefixIcon?: React.ReactNode;\n\n suffixIcon?: React.ReactNode;\n}\n\nexport const ActionChip = React.forwardRef(\n (\n {\n className,\n size = \"medium\",\n layout = \"withText\",\n children,\n prefixIcon,\n suffixIcon,\n ...otherProps\n },\n ref,\n ) => {\n const classNames = actionChip({ size, layout });\n return (\n \n );\n },\n);\nActionChip.displayName = \"ActionChip\";\n" + } + ], + "type": "component" +} \ No newline at end of file diff --git a/component-docs/public/__registry__/component/control-chip.json b/component-docs/public/__registry__/component/control-chip.json new file mode 100644 index 000000000..1151315a8 --- /dev/null +++ b/component-docs/public/__registry__/component/control-chip.json @@ -0,0 +1,13 @@ +{ + "name": "control-chip", + "dependencies": [ + "@radix-ui/react-slot" + ], + "registries": [ + { + "name": "control-chip.tsx", + "content": "import { Slot } from \"@radix-ui/react-slot\";\nimport { controlChip, type ControlChipVariantProps } from \"@seed-design/recipe/controlChip\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\nimport \"@seed-design/stylesheet/controlChip.css\";\nimport { UseCheckboxProps, useCheckbox } from \"@seed-design/react-checkbox\";\nimport { visuallyHidden } from \"../util/visuallyHidden\";\n\nexport interface ControlChipToggleProps\n extends Omit, \"size\">,\n UseCheckboxProps,\n ControlChipVariantProps {\n prefixIcon?: React.ReactNode;\n\n suffixIcon?: React.ReactNode;\n}\n\nconst ControlChipToggle = React.forwardRef(\n (\n {\n className,\n size = \"medium\",\n layout = \"withText\",\n children,\n prefixIcon,\n suffixIcon,\n ...otherProps\n },\n ref,\n ) => {\n const classNames = controlChip({ size, layout });\n const { rootProps, hiddenInputProps, restProps } = useCheckbox(otherProps);\n return (\n \n );\n },\n);\nControlChipToggle.displayName = \"ControlChip.Toggle\";\n\nexport const ControlChip = Object.assign(\n () => {\n console.warn(\n \"ControlChip is a base component and should not be rendered. Use ControlChip.Toggle or ControlChip.Radio instead.\",\n );\n },\n {\n Toggle: ControlChipToggle,\n },\n);\n" + } + ], + "type": "component" +} \ No newline at end of file diff --git a/component-docs/public/__registry__/component/index.json b/component-docs/public/__registry__/component/index.json index 16e9ac082..e2eca36b0 100644 --- a/component-docs/public/__registry__/component/index.json +++ b/component-docs/public/__registry__/component/index.json @@ -19,6 +19,26 @@ "component/action-button.tsx" ] }, + { + "name": "action-chip", + "type": "component", + "dependencies": [ + "@radix-ui/react-slot" + ], + "snippets": [ + "component/action-chip.tsx" + ] + }, + { + "name": "control-chip", + "type": "component", + "dependencies": [ + "@radix-ui/react-slot" + ], + "snippets": [ + "component/control-chip.tsx" + ] + }, { "name": "checkbox", "type": "component", diff --git a/component-docs/snippets/component/action-chip.tsx b/component-docs/snippets/component/action-chip.tsx new file mode 100644 index 000000000..167b0465a --- /dev/null +++ b/component-docs/snippets/component/action-chip.tsx @@ -0,0 +1,43 @@ +import { Slot } from "@radix-ui/react-slot"; +import { actionChip, type ActionChipVariantProps } from "@seed-design/recipe/actionChip"; +import clsx from "clsx"; +import * as React from "react"; + +import "@seed-design/stylesheet/actionChip.css"; + +export interface ActionChipProps + extends React.ButtonHTMLAttributes, + ActionChipVariantProps { + prefixIcon?: React.ReactNode; + + suffixIcon?: React.ReactNode; +} + +export const ActionChip = React.forwardRef( + ( + { + className, + size = "medium", + layout = "withText", + children, + prefixIcon, + suffixIcon, + ...otherProps + }, + ref, + ) => { + const classNames = actionChip({ size, layout }); + return ( + + ); + }, +); +ActionChip.displayName = "ActionChip"; diff --git a/component-docs/snippets/component/control-chip.tsx b/component-docs/snippets/component/control-chip.tsx new file mode 100644 index 000000000..3d9af213d --- /dev/null +++ b/component-docs/snippets/component/control-chip.tsx @@ -0,0 +1,71 @@ +import { Slot } from "@radix-ui/react-slot"; +import { controlChip, type ControlChipVariantProps } from "@seed-design/recipe/controlChip"; +import clsx from "clsx"; +import * as React from "react"; + +import "@seed-design/stylesheet/controlChip.css"; +import { UseCheckboxProps, useCheckbox } from "@seed-design/react-checkbox"; +import { visuallyHidden } from "../util/visuallyHidden"; + +export interface ControlChipToggleProps + extends Omit, "size">, + UseCheckboxProps, + ControlChipVariantProps { + prefixIcon?: React.ReactNode; + + suffixIcon?: React.ReactNode; +} + +const ControlChipToggle = React.forwardRef( + ( + { + className, + size = "medium", + layout = "withText", + children, + prefixIcon, + suffixIcon, + ...otherProps + }, + ref, + ) => { + const classNames = controlChip({ size, layout }); + const { rootProps, hiddenInputProps, stateProps, restProps } = useCheckbox(otherProps); + return ( + + ); + }, +); +ControlChipToggle.displayName = "ControlChip.Toggle"; + +export const ControlChip = Object.assign( + () => { + console.warn( + "ControlChip is a base component and should not be rendered. Use ControlChip.Toggle or ControlChip.Radio instead.", + ); + }, + { + Toggle: ControlChipToggle, + }, +); diff --git a/component-docs/snippets/example/react/action-chip-icon-only.tsx b/component-docs/snippets/example/react/action-chip-icon-only.tsx new file mode 100644 index 000000000..b4ad6b04c --- /dev/null +++ b/component-docs/snippets/example/react/action-chip-icon-only.tsx @@ -0,0 +1,10 @@ +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipIconOnly() { + return ( + + + + ); +} diff --git a/component-docs/snippets/example/react/action-chip-medium.tsx b/component-docs/snippets/example/react/action-chip-medium.tsx new file mode 100644 index 000000000..166e2ad9a --- /dev/null +++ b/component-docs/snippets/example/react/action-chip-medium.tsx @@ -0,0 +1,5 @@ +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipMedium() { + return 라벨; +} diff --git a/component-docs/snippets/example/react/action-chip-prefix-icon.tsx b/component-docs/snippets/example/react/action-chip-prefix-icon.tsx new file mode 100644 index 000000000..9cb12f86c --- /dev/null +++ b/component-docs/snippets/example/react/action-chip-prefix-icon.tsx @@ -0,0 +1,6 @@ +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipPrefixIcon() { + return }>라벨; +} diff --git a/component-docs/snippets/example/react/action-chip-preview.tsx b/component-docs/snippets/example/react/action-chip-preview.tsx new file mode 100644 index 000000000..6e3b029ce --- /dev/null +++ b/component-docs/snippets/example/react/action-chip-preview.tsx @@ -0,0 +1,5 @@ +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipPreview() { + return 라벨; +} diff --git a/component-docs/snippets/example/react/action-chip-small.tsx b/component-docs/snippets/example/react/action-chip-small.tsx new file mode 100644 index 000000000..0cfaee18c --- /dev/null +++ b/component-docs/snippets/example/react/action-chip-small.tsx @@ -0,0 +1,5 @@ +import { ActionChip } from "seed-design/ui/action-chip"; + +export default function ActionChipSmall() { + return 라벨; +} diff --git a/component-docs/snippets/example/react/control-chip-icon-only.tsx b/component-docs/snippets/example/react/control-chip-icon-only.tsx new file mode 100644 index 000000000..70c7ec9c4 --- /dev/null +++ b/component-docs/snippets/example/react/control-chip-icon-only.tsx @@ -0,0 +1,10 @@ +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipIconOnly() { + return ( + + + + ); +} diff --git a/component-docs/snippets/example/react/control-chip-medium.tsx b/component-docs/snippets/example/react/control-chip-medium.tsx new file mode 100644 index 000000000..757bb9465 --- /dev/null +++ b/component-docs/snippets/example/react/control-chip-medium.tsx @@ -0,0 +1,5 @@ +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ActionChipMedium() { + return 라벨; +} diff --git a/component-docs/snippets/example/react/control-chip-prefix-icon.tsx b/component-docs/snippets/example/react/control-chip-prefix-icon.tsx new file mode 100644 index 000000000..b234b09cc --- /dev/null +++ b/component-docs/snippets/example/react/control-chip-prefix-icon.tsx @@ -0,0 +1,6 @@ +import IconAddFill from "@seed-design/icon/IconAddFill"; +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipPrefixIcon() { + return }>라벨; +} diff --git a/component-docs/snippets/example/react/control-chip-preview.tsx b/component-docs/snippets/example/react/control-chip-preview.tsx new file mode 100644 index 000000000..7714c4e9b --- /dev/null +++ b/component-docs/snippets/example/react/control-chip-preview.tsx @@ -0,0 +1,5 @@ +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ControlChipPreview() { + return 라벨; +} diff --git a/component-docs/snippets/example/react/control-chip-small.tsx b/component-docs/snippets/example/react/control-chip-small.tsx new file mode 100644 index 000000000..dc8540815 --- /dev/null +++ b/component-docs/snippets/example/react/control-chip-small.tsx @@ -0,0 +1,5 @@ +import { ControlChip } from "seed-design/ui/control-chip"; + +export default function ActionChipSmall() { + return 라벨; +} diff --git a/component-docs/src/pages/components/action-chip.mdx b/component-docs/src/pages/components/action-chip.mdx new file mode 100644 index 000000000..b7b3d4a9f --- /dev/null +++ b/component-docs/src/pages/components/action-chip.mdx @@ -0,0 +1,25 @@ +# Action Chip + + + +## 설치 + + + +## 예제 + +### Medium + + + +### Small + + + +### Icon Only + + + +### Prefix Icon + + \ No newline at end of file diff --git a/component-docs/src/pages/components/control-chip.mdx b/component-docs/src/pages/components/control-chip.mdx new file mode 100644 index 000000000..92c1b2654 --- /dev/null +++ b/component-docs/src/pages/components/control-chip.mdx @@ -0,0 +1,25 @@ +# Control Chip + + + +## 설치 + + + +## 예제 + +### Medium + + + +### Small + + + +### Icon Only + + + +### Prefix Icon + + \ No newline at end of file diff --git a/examples/stackflow-spa/src/design-system/components/ActionChip.tsx b/examples/stackflow-spa/src/design-system/components/ActionChip.tsx index 76184ef18..167b0465a 100644 --- a/examples/stackflow-spa/src/design-system/components/ActionChip.tsx +++ b/examples/stackflow-spa/src/design-system/components/ActionChip.tsx @@ -18,7 +18,7 @@ export const ActionChip = React.forwardRef( { className, size = "medium", - layout = "text", + layout = "withText", children, prefixIcon, suffixIcon, @@ -30,7 +30,7 @@ export const ActionChip = React.forwardRef( return (