Skip to content

Commit

Permalink
chore: remove specific version in ui registry & generate all
Browse files Browse the repository at this point in the history
  • Loading branch information
junghyeonsu committed Feb 9, 2025
1 parent 209e661 commit 1ffa8db
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 31 deletions.
16 changes: 8 additions & 8 deletions docs/components/example/index.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/public/__registry__/ui/chip-tabs.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "chip-tabs",
"dependencies": [
"@seed-design/react-tabs@0.0.0-alpha-20241209060641"
"@seed-design/react-tabs"
],
"registries": [
{
"name": "chip-tabs.tsx",
"type": "ui",
"content": "\"use client\";\n\nimport {\n useLazyContents,\n useTabs,\n type ContentProps,\n type TriggerProps,\n type UseLazyContentsProps,\n type UseTabsProps,\n} from \"@seed-design/react-tabs\";\nimport { chipTab } from \"@seed-design/recipe/chipTab\";\nimport { type ChipTabsVariant, chipTabs } from \"@seed-design/recipe/chipTabs\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\n\ntype Assign<T, U> = Omit<T, keyof U> & U;\n\ninterface ChipTabsContextValue {\n api: ReturnType<typeof useTabs>;\n classNames: ReturnType<typeof chipTabs>;\n shouldRender: (value: string) => boolean;\n variant: ChipTabsVariant[\"variant\"];\n}\n\nconst ChipTabsContext = React.createContext<ChipTabsContextValue | null>(null);\n\nconst useChipTabsContext = () => {\n const context = React.useContext(ChipTabsContext);\n if (!context) {\n throw new Error(\"Tabs cannot be rendered outside the Tabs\");\n }\n return context;\n};\n\nexport interface ChipTabsProps\n extends Assign<\n React.HTMLAttributes<HTMLDivElement>,\n Omit<UseTabsProps, \"layout\">\n >,\n ChipTabsVariant,\n Omit<UseLazyContentsProps, \"currentValue\"> {}\n\nexport const ChipTabs = React.forwardRef<HTMLDivElement, ChipTabsProps>(\n (props, ref) => {\n const { className, lazyMode, isLazy, variant } = props;\n const api = useTabs(props);\n const classNames = chipTabs({\n variant,\n });\n const { rootProps, value, restProps } = api;\n const { shouldRender } = useLazyContents({\n currentValue: value,\n lazyMode,\n isLazy,\n });\n\n return (\n <div\n ref={ref}\n {...rootProps}\n {...restProps}\n className={clsx(classNames.root, className)}\n >\n <ChipTabsContext.Provider\n value={{\n api,\n classNames,\n shouldRender,\n variant,\n }}\n >\n {props.children}\n </ChipTabsContext.Provider>\n </div>\n );\n },\n);\nChipTabs.displayName = \"ChipTabs\";\n\nexport const ChipTabTriggerList = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...otherProps }, ref) => {\n const { api, classNames } = useChipTabsContext();\n const { tabTriggerListProps, triggerSize } = api;\n const { left } = triggerSize;\n const { triggerList } = classNames;\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(ref, () => containerRef.current as HTMLDivElement);\n\n React.useEffect(() => {\n if (containerRef.current) {\n containerRef.current?.scrollTo({\n // NOTE: 27px is half of tab's min-width\n left: left - 27,\n behavior: \"smooth\",\n });\n }\n }, [left]);\n\n return (\n <div\n ref={containerRef}\n {...tabTriggerListProps}\n className={clsx(triggerList, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n});\nChipTabTriggerList.displayName = \"ChipTabTriggerList\";\n\nexport interface ChipTabTriggerProps\n extends Assign<React.HTMLAttributes<HTMLButtonElement>, TriggerProps> {}\n\nexport const ChipTabTrigger = React.forwardRef<\n HTMLButtonElement,\n ChipTabTriggerProps\n>(({ className, children, value, isDisabled, ...otherProps }, ref) => {\n const { api, variant } = useChipTabsContext();\n const { getTabTriggerProps } = api;\n const { label, root } = chipTab({\n variant,\n });\n const { rootProps, labelProps } = getTabTriggerProps({ value, isDisabled });\n\n return (\n <button\n ref={ref}\n {...rootProps}\n className={clsx(root, className)}\n {...otherProps}\n >\n <span className={label} {...labelProps}>\n {children}\n </span>\n </button>\n );\n});\nChipTabTrigger.displayName = \"ChipTabTrigger\";\n\nexport const ChipTabContent = React.forwardRef<\n HTMLDivElement,\n Assign<React.HTMLAttributes<HTMLDivElement>, ContentProps>\n>(({ className, children, value, ...otherProps }, ref) => {\n const { api, classNames, shouldRender } = useChipTabsContext();\n const { getTabContentProps } = api;\n const { content } = classNames;\n const tabContentProps = getTabContentProps({ value });\n const isRender = shouldRender(value);\n\n return (\n <div\n ref={ref}\n {...tabContentProps}\n className={clsx(content, className)}\n {...otherProps}\n >\n {isRender && children}\n </div>\n );\n});\nChipTabContent.displayName = \"ChipTabContent\";\n"
"content": "\"use client\";\n\nimport {\n useLazyContents,\n useTabs,\n type ContentProps,\n type TriggerProps,\n type UseLazyContentsProps,\n type UseTabsProps,\n} from \"@seed-design/react-tabs\";\nimport { chipTab } from \"@seed-design/recipe/chipTab\";\nimport { type ChipTabsVariant, chipTabs } from \"@seed-design/recipe/chipTabs\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\ntype Assign<T, U> = Omit<T, keyof U> & U;\n\ninterface ChipTabsContextValue {\n api: ReturnType<typeof useTabs>;\n classNames: ReturnType<typeof chipTabs>;\n shouldRender: (value: string) => boolean;\n variant: ChipTabsVariant[\"variant\"];\n}\n\nconst ChipTabsContext = React.createContext<ChipTabsContextValue | null>(null);\n\nconst useChipTabsContext = () => {\n const context = React.useContext(ChipTabsContext);\n if (!context) {\n throw new Error(\"Tabs cannot be rendered outside the Tabs\");\n }\n return context;\n};\n\nexport interface ChipTabsProps\n extends Assign<\n React.HTMLAttributes<HTMLDivElement>,\n Omit<UseTabsProps, \"layout\">\n >,\n ChipTabsVariant,\n Omit<UseLazyContentsProps, \"currentValue\"> {}\n\nexport const ChipTabs = React.forwardRef<HTMLDivElement, ChipTabsProps>(\n (props, ref) => {\n const { className, lazyMode, isLazy, variant } = props;\n const api = useTabs(props);\n const classNames = chipTabs({\n variant,\n });\n const { rootProps, value, restProps } = api;\n const { shouldRender } = useLazyContents({\n currentValue: value ?? \"\",\n lazyMode,\n isLazy,\n });\n\n return (\n <div\n ref={ref}\n {...rootProps}\n {...restProps}\n className={clsx(classNames.root, className)}\n >\n <ChipTabsContext.Provider\n value={{\n api,\n classNames,\n shouldRender,\n variant,\n }}\n >\n {props.children}\n </ChipTabsContext.Provider>\n </div>\n );\n },\n);\nChipTabs.displayName = \"ChipTabs\";\n\nexport const ChipTabTriggerList = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...otherProps }, ref) => {\n const { api, classNames } = useChipTabsContext();\n const { tabTriggerListProps, triggerSize } = api;\n const { left } = triggerSize;\n const { triggerList } = classNames;\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(ref, () => containerRef.current as HTMLDivElement);\n\n React.useEffect(() => {\n if (containerRef.current) {\n containerRef.current?.scrollTo({\n // NOTE: 27px is half of tab's min-width\n left: left - 27,\n behavior: \"smooth\",\n });\n }\n }, [left]);\n\n return (\n <div\n ref={containerRef}\n {...tabTriggerListProps}\n className={clsx(triggerList, className)}\n {...otherProps}\n >\n {children}\n </div>\n );\n});\nChipTabTriggerList.displayName = \"ChipTabTriggerList\";\n\nexport interface ChipTabTriggerProps\n extends Assign<React.HTMLAttributes<HTMLButtonElement>, TriggerProps> {}\n\nexport const ChipTabTrigger = React.forwardRef<\n HTMLButtonElement,\n ChipTabTriggerProps\n>(({ className, children, value, isDisabled, ...otherProps }, ref) => {\n const { api, variant } = useChipTabsContext();\n const { getTabTriggerProps } = api;\n const { label, root } = chipTab({\n variant,\n });\n const { rootProps, labelProps } = getTabTriggerProps({ value, isDisabled });\n\n return (\n <button\n ref={ref}\n {...rootProps}\n className={clsx(root, className)}\n {...otherProps}\n >\n <span className={label} {...labelProps}>\n {children}\n </span>\n </button>\n );\n});\nChipTabTrigger.displayName = \"ChipTabTrigger\";\n\nexport const ChipTabContent = React.forwardRef<\n HTMLDivElement,\n Assign<React.HTMLAttributes<HTMLDivElement>, ContentProps>\n>(({ className, children, value, ...otherProps }, ref) => {\n const { api, classNames, shouldRender } = useChipTabsContext();\n const { getTabContentProps } = api;\n const { content } = classNames;\n const tabContentProps = getTabContentProps({ value });\n const isRender = shouldRender(value);\n\n return (\n <div\n ref={ref}\n {...tabContentProps}\n className={clsx(content, className)}\n {...otherProps}\n >\n {isRender && children}\n </div>\n );\n});\nChipTabContent.displayName = \"ChipTabContent\";\n"
}
]
}
2 changes: 1 addition & 1 deletion docs/public/__registry__/ui/help-bubble.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "help-bubble",
"dependencies": [
"@seed-design/react-popover@0.0.0-alpha-20241030023710",
"@seed-design/react-popover",
"@radix-ui/react-slot"
],
"registries": [
Expand Down
2 changes: 1 addition & 1 deletion docs/public/__registry__/ui/identity-placeholder.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "identity-placeholder.tsx",
"type": "ui",
"content": "\"use client\";\n\nimport {\n identityPlaceholder,\n type IdentityPlaceholderVariantProps,\n} from \"@seed-design/recipe/identityPlaceholder\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\n\nexport interface IdentityPlaceholderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n IdentityPlaceholderVariantProps {}\n\nexport const IdentityPlaceholder = React.forwardRef<\n HTMLDivElement,\n IdentityPlaceholderProps\n>(({ className, identity = \"person\", ...otherProps }, ref) => {\n const classNames = identityPlaceholder({ identity });\n return (\n <div ref={ref} className={clsx(classNames.root, className)} {...otherProps}>\n <svg\n className={classNames.image}\n viewBox=\"0 0 640 640\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M481 301c0 56-29 106-72 135a264 264 0 0 1 175 248c0 18-118 38-264 38S56 702 56 684c0-114 73-211 174-248a162 162 0 1 1 251-135Zm-203-1c8 0 14-9 14-20s-6-20-14-20-15 9-15 20 7 20 15 20Zm83 0c8 0 15-9 15-20s-7-20-15-20-15 9-15 20 7 20 15 20Zm-88 25c4-2 9-1 11 4 4 7 15 19 36 19s32-12 36-19a8 8 0 1 1 15 8c-7 12-23 27-51 27s-44-15-50-27c-3-5-1-10 3-12Z\"\n />\n </svg>\n </div>\n );\n});\nIdentityPlaceholder.displayName = \"IdentityPlaceholder\";\n"
"content": "\"use client\";\n\nimport {\n identityPlaceholder,\n type IdentityPlaceholderVariantProps,\n} from \"@seed-design/recipe/identityPlaceholder\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\n\nexport interface IdentityPlaceholderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n IdentityPlaceholderVariantProps {}\n\nexport const IdentityPlaceholder = React.forwardRef<\n HTMLDivElement,\n IdentityPlaceholderProps\n>(({ className, identity = \"person\", ...otherProps }, ref) => {\n const classNames = identityPlaceholder({ identity });\n return (\n <div ref={ref} className={clsx(classNames.root, className)} {...otherProps}>\n <svg\n className={classNames.image}\n viewBox=\"0 0 640 640\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-label=\"Identity placeholder\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M481 301c0 56-29 106-72 135a264 264 0 0 1 175 248c0 18-118 38-264 38S56 702 56 684c0-114 73-211 174-248a162 162 0 1 1 251-135Zm-203-1c8 0 14-9 14-20s-6-20-14-20-15 9-15 20 7 20 15 20Zm83 0c8 0 15-9 15-20s-7-20-15-20-15 9-15 20 7 20 15 20Zm-88 25c4-2 9-1 11 4 4 7 15 19 36 19s32-12 36-19a8 8 0 1 1 15 8c-7 12-23 27-51 27s-44-15-50-27c-3-5-1-10 3-12Z\"\n />\n </svg>\n </div>\n );\n});\nIdentityPlaceholder.displayName = \"IdentityPlaceholder\";\n"
}
]
}
8 changes: 4 additions & 4 deletions docs/public/__registry__/ui/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
{
"name": "help-bubble",
"dependencies": [
"@seed-design/react-popover@0.0.0-alpha-20241030023710",
"@seed-design/react-popover",
"@radix-ui/react-slot"
],
"files": [
Expand All @@ -235,7 +235,7 @@
{
"name": "tabs",
"dependencies": [
"@seed-design/react-tabs@0.0.0-alpha-20241209060641"
"@seed-design/react-tabs"
],
"files": [
"ui:tabs.tsx"
Expand All @@ -244,7 +244,7 @@
{
"name": "chip-tabs",
"dependencies": [
"@seed-design/react-tabs@0.0.0-alpha-20241209060641"
"@seed-design/react-tabs"
],
"files": [
"ui:chip-tabs.tsx"
Expand Down Expand Up @@ -308,7 +308,7 @@
{
"name": "text-field",
"dependencies": [
"@seed-design/react-text-field@0.0.0-alpha-20241030023710",
"@seed-design/react-text-field",
"@daangn/react-monochrome-icon",
"@radix-ui/react-slot"
],
Expand Down
2 changes: 1 addition & 1 deletion docs/public/__registry__/ui/segmented-control.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "segmented-control.tsx",
"type": "ui",
"content": "\"use client\";\n\nimport { SegmentedControl as SeedSegmentedControl } from \"@seed-design/react\";\nimport * as React from \"react\";\n\nexport interface SegmentedControlProps extends SeedSegmentedControl.RootProps {}\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(({ children, ...otherProps }, ref) => {\n if (!otherProps[\"aria-label\"] && !otherProps[\"aria-labelledby\"]) {\n console.warn(\n \"SegmentedControl component requires either an `aria-label` or `aria-labelledby` attribute.\",\n );\n }\n\n if (otherProps.value === undefined && otherProps.defaultValue === undefined) {\n console.warn(\n \"SegmentedControl component requires either a `value` or `defaultValue` attribute.\",\n );\n }\n\n return (\n <SeedSegmentedControl.Root ref={ref} {...otherProps}>\n {children}\n <SeedSegmentedControl.Indicator />\n </SeedSegmentedControl.Root>\n );\n});\nSegmentedControl.displayName = \"SegmentedControl\";\n\nexport interface SegmentedControlSegmentProps\n extends SeedSegmentedControl.SegmentProps {\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n\n rootRef?: React.Ref<HTMLLabelElement>;\n}\n\nexport const SegmentedControlSegment = React.forwardRef<\n HTMLInputElement,\n SegmentedControlSegmentProps\n>(({ children, inputProps, rootRef, ...otherProps }, ref) => {\n return (\n <SeedSegmentedControl.Segment ref={rootRef} {...otherProps}>\n <SeedSegmentedControl.SegmentHiddenInput ref={ref} {...inputProps} />\n <SeedSegmentedControl.SegmentLabel>\n {children}\n </SeedSegmentedControl.SegmentLabel>\n <SeedSegmentedControl.SegmentLabelPlaceholder aria-hidden>\n {children}\n </SeedSegmentedControl.SegmentLabelPlaceholder>\n </SeedSegmentedControl.Segment>\n );\n});\nSegmentedControlSegment.displayName = \"SegmentedControlSegment\";\n"
"content": "\"use client\";\n\nimport { SegmentedControl as SeedSegmentedControl } from \"@seed-design/react\";\nimport * as React from \"react\";\n\nexport interface SegmentedControlProps extends SeedSegmentedControl.RootProps {}\n\nexport const SegmentedControl = React.forwardRef<\n HTMLDivElement,\n SegmentedControlProps\n>(({ children, ...otherProps }, ref) => {\n if (!otherProps[\"aria-label\"] && !otherProps[\"aria-labelledby\"]) {\n console.warn(\n \"SegmentedControl component requires either an `aria-label` or `aria-labelledby` attribute.\",\n );\n }\n\n if (otherProps.value === undefined && otherProps.defaultValue === undefined) {\n console.warn(\n \"SegmentedControl component requires either a `value` or `defaultValue` attribute.\",\n );\n }\n\n return (\n <SeedSegmentedControl.Root ref={ref} {...otherProps}>\n {children}\n <SeedSegmentedControl.Indicator />\n </SeedSegmentedControl.Root>\n );\n});\nSegmentedControl.displayName = \"SegmentedControl\";\n\nexport interface SegmentedControlItemProps\n extends SeedSegmentedControl.ItemProps {\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n\n rootRef?: React.Ref<HTMLLabelElement>;\n}\n\nexport const SegmentedControlItem = React.forwardRef<\n HTMLInputElement,\n SegmentedControlItemProps\n>(({ children, inputProps, rootRef, ...otherProps }, ref) => {\n return (\n <SeedSegmentedControl.Item ref={rootRef} {...otherProps}>\n <SeedSegmentedControl.SegmentHiddenInput ref={ref} {...inputProps} />\n <SeedSegmentedControl.SegmentLabel>\n {children}\n </SeedSegmentedControl.SegmentLabel>\n </SeedSegmentedControl.Item>\n );\n});\nSegmentedControlItem.displayName = \"SegmentedControlItem\";\n"
}
]
}
Loading

0 comments on commit 1ffa8db

Please sign in to comment.