@medusajs/ui 4.0.5-snapshot-20250127145424 → 4.0.5-snapshot-20250203171629
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/blocks/data-table/components/data-table-action-cell.d.ts.map +1 -1
- package/dist/cjs/blocks/data-table/components/data-table-action-cell.js +1 -1
- package/dist/cjs/blocks/data-table/components/data-table-action-cell.js.map +1 -1
- package/dist/cjs/blocks/data-table/components/data-table-select-cell.d.ts.map +1 -1
- package/dist/cjs/blocks/data-table/components/data-table-select-cell.js.map +1 -1
- package/dist/cjs/components/avatar/avatar.d.ts +2 -2
- package/dist/cjs/components/avatar/avatar.d.ts.map +1 -1
- package/dist/cjs/components/avatar/avatar.js +4 -4
- package/dist/cjs/components/avatar/avatar.js.map +1 -1
- package/dist/cjs/components/badge/badge.d.ts.map +1 -1
- package/dist/cjs/components/badge/badge.js +2 -2
- package/dist/cjs/components/badge/badge.js.map +1 -1
- package/dist/cjs/components/button/button.d.ts.map +1 -1
- package/dist/cjs/components/button/button.js +2 -2
- package/dist/cjs/components/button/button.js.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.d.ts +2 -2
- package/dist/cjs/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.js +3 -3
- package/dist/cjs/components/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/components/checkbox/types.d.ts +2 -2
- package/dist/cjs/components/checkbox/types.d.ts.map +1 -1
- package/dist/cjs/components/checkbox/types.js.map +1 -1
- package/dist/cjs/components/command-bar/command-bar.d.ts.map +1 -1
- package/dist/cjs/components/command-bar/command-bar.js +6 -7
- package/dist/cjs/components/command-bar/command-bar.js.map +1 -1
- package/dist/cjs/components/copy/copy.js +2 -2
- package/dist/cjs/components/copy/copy.js.map +1 -1
- package/dist/cjs/components/drawer/drawer.d.ts +9 -9
- package/dist/cjs/components/drawer/drawer.d.ts.map +1 -1
- package/dist/cjs/components/drawer/drawer.js +10 -10
- package/dist/cjs/components/drawer/drawer.js.map +1 -1
- package/dist/cjs/components/dropdown-menu/dropdown-menu.d.ts +14 -14
- package/dist/cjs/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu/dropdown-menu.js +18 -18
- package/dist/cjs/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/cjs/components/focus-modal/focus-modal.d.ts +9 -9
- package/dist/cjs/components/focus-modal/focus-modal.d.ts.map +1 -1
- package/dist/cjs/components/focus-modal/focus-modal.js +10 -10
- package/dist/cjs/components/focus-modal/focus-modal.js.map +1 -1
- package/dist/cjs/components/hint/hint.js.map +1 -1
- package/dist/cjs/components/icon-badge/icon-badge.d.ts.map +1 -1
- package/dist/cjs/components/icon-badge/icon-badge.js +2 -2
- package/dist/cjs/components/icon-badge/icon-badge.js.map +1 -1
- package/dist/cjs/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/cjs/components/icon-button/icon-button.js +2 -2
- package/dist/cjs/components/icon-button/icon-button.js.map +1 -1
- package/dist/cjs/components/label/label.d.ts.map +1 -1
- package/dist/cjs/components/label/label.js +2 -2
- package/dist/cjs/components/label/label.js.map +1 -1
- package/dist/cjs/components/popover/popover.d.ts +6 -6
- package/dist/cjs/components/popover/popover.d.ts.map +1 -1
- package/dist/cjs/components/popover/popover.js +7 -7
- package/dist/cjs/components/popover/popover.js.map +1 -1
- package/dist/cjs/components/progress-accordion/progress-accordion.d.ts +5 -5
- package/dist/cjs/components/progress-accordion/progress-accordion.d.ts.map +1 -1
- package/dist/cjs/components/progress-accordion/progress-accordion.js +6 -6
- package/dist/cjs/components/progress-accordion/progress-accordion.js.map +1 -1
- package/dist/cjs/components/progress-tabs/progress-tabs.d.ts +5 -5
- package/dist/cjs/components/progress-tabs/progress-tabs.d.ts.map +1 -1
- package/dist/cjs/components/progress-tabs/progress-tabs.js +5 -5
- package/dist/cjs/components/progress-tabs/progress-tabs.js.map +1 -1
- package/dist/cjs/components/prompt/prompt.d.ts +8 -8
- package/dist/cjs/components/prompt/prompt.d.ts.map +1 -1
- package/dist/cjs/components/prompt/prompt.js +10 -10
- package/dist/cjs/components/prompt/prompt.js.map +1 -1
- package/dist/cjs/components/radio-group/radio-group.d.ts +4 -4
- package/dist/cjs/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/cjs/components/radio-group/radio-group.js +6 -6
- package/dist/cjs/components/radio-group/radio-group.js.map +1 -1
- package/dist/cjs/components/select/select.d.ts +9 -9
- package/dist/cjs/components/select/select.d.ts.map +1 -1
- package/dist/cjs/components/select/select.js +14 -14
- package/dist/cjs/components/select/select.js.map +1 -1
- package/dist/cjs/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/cjs/components/skeleton/skeleton.js +1 -1
- package/dist/cjs/components/skeleton/skeleton.js.map +1 -1
- package/dist/cjs/components/switch/switch.d.ts +2 -2
- package/dist/cjs/components/switch/switch.d.ts.map +1 -1
- package/dist/cjs/components/switch/switch.js +3 -3
- package/dist/cjs/components/switch/switch.js.map +1 -1
- package/dist/cjs/components/tabs/tabs.d.ts +5 -5
- package/dist/cjs/components/tabs/tabs.d.ts.map +1 -1
- package/dist/cjs/components/tabs/tabs.js +5 -5
- package/dist/cjs/components/tabs/tabs.js.map +1 -1
- package/dist/cjs/components/text/text.d.ts.map +1 -1
- package/dist/cjs/components/text/text.js +2 -2
- package/dist/cjs/components/text/text.js.map +1 -1
- package/dist/cjs/components/textarea/textarea.js +1 -1
- package/dist/cjs/components/textarea/textarea.js.map +1 -1
- package/dist/cjs/components/toast/toast.d.ts.map +1 -1
- package/dist/cjs/components/toast/toast.js +1 -1
- package/dist/cjs/components/toast/toast.js.map +1 -1
- package/dist/cjs/components/tooltip/tooltip.d.ts +3 -3
- package/dist/cjs/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/cjs/components/tooltip/tooltip.js +6 -6
- package/dist/cjs/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/blocks/data-table/components/data-table-action-cell.d.ts.map +1 -1
- package/dist/esm/blocks/data-table/components/data-table-action-cell.js +1 -1
- package/dist/esm/blocks/data-table/components/data-table-action-cell.js.map +1 -1
- package/dist/esm/blocks/data-table/components/data-table-select-cell.d.ts.map +1 -1
- package/dist/esm/blocks/data-table/components/data-table-select-cell.js.map +1 -1
- package/dist/esm/components/avatar/avatar.d.ts +2 -2
- package/dist/esm/components/avatar/avatar.d.ts.map +1 -1
- package/dist/esm/components/avatar/avatar.js +4 -4
- package/dist/esm/components/avatar/avatar.js.map +1 -1
- package/dist/esm/components/badge/badge.d.ts.map +1 -1
- package/dist/esm/components/badge/badge.js +2 -2
- package/dist/esm/components/badge/badge.js.map +1 -1
- package/dist/esm/components/button/button.d.ts.map +1 -1
- package/dist/esm/components/button/button.js +2 -2
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.d.ts +2 -2
- package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js +3 -3
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/checkbox/types.d.ts +2 -2
- package/dist/esm/components/checkbox/types.d.ts.map +1 -1
- package/dist/esm/components/checkbox/types.js.map +1 -1
- package/dist/esm/components/command-bar/command-bar.d.ts.map +1 -1
- package/dist/esm/components/command-bar/command-bar.js +1 -2
- package/dist/esm/components/command-bar/command-bar.js.map +1 -1
- package/dist/esm/components/copy/copy.js +2 -2
- package/dist/esm/components/copy/copy.js.map +1 -1
- package/dist/esm/components/drawer/drawer.d.ts +9 -9
- package/dist/esm/components/drawer/drawer.d.ts.map +1 -1
- package/dist/esm/components/drawer/drawer.js +10 -10
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/dropdown-menu/dropdown-menu.d.ts +14 -14
- package/dist/esm/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu/dropdown-menu.js +18 -18
- package/dist/esm/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/esm/components/focus-modal/focus-modal.d.ts +9 -9
- package/dist/esm/components/focus-modal/focus-modal.d.ts.map +1 -1
- package/dist/esm/components/focus-modal/focus-modal.js +10 -10
- package/dist/esm/components/focus-modal/focus-modal.js.map +1 -1
- package/dist/esm/components/hint/hint.js.map +1 -1
- package/dist/esm/components/icon-badge/icon-badge.d.ts.map +1 -1
- package/dist/esm/components/icon-badge/icon-badge.js +2 -2
- package/dist/esm/components/icon-badge/icon-badge.js.map +1 -1
- package/dist/esm/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/esm/components/icon-button/icon-button.js +2 -2
- package/dist/esm/components/icon-button/icon-button.js.map +1 -1
- package/dist/esm/components/label/label.d.ts.map +1 -1
- package/dist/esm/components/label/label.js +2 -2
- package/dist/esm/components/label/label.js.map +1 -1
- package/dist/esm/components/popover/popover.d.ts +6 -6
- package/dist/esm/components/popover/popover.d.ts.map +1 -1
- package/dist/esm/components/popover/popover.js +7 -7
- package/dist/esm/components/popover/popover.js.map +1 -1
- package/dist/esm/components/progress-accordion/progress-accordion.d.ts +5 -5
- package/dist/esm/components/progress-accordion/progress-accordion.d.ts.map +1 -1
- package/dist/esm/components/progress-accordion/progress-accordion.js +6 -6
- package/dist/esm/components/progress-accordion/progress-accordion.js.map +1 -1
- package/dist/esm/components/progress-tabs/progress-tabs.d.ts +5 -5
- package/dist/esm/components/progress-tabs/progress-tabs.d.ts.map +1 -1
- package/dist/esm/components/progress-tabs/progress-tabs.js +5 -5
- package/dist/esm/components/progress-tabs/progress-tabs.js.map +1 -1
- package/dist/esm/components/prompt/prompt.d.ts +8 -8
- package/dist/esm/components/prompt/prompt.d.ts.map +1 -1
- package/dist/esm/components/prompt/prompt.js +10 -10
- package/dist/esm/components/prompt/prompt.js.map +1 -1
- package/dist/esm/components/radio-group/radio-group.d.ts +4 -4
- package/dist/esm/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/esm/components/radio-group/radio-group.js +6 -6
- package/dist/esm/components/radio-group/radio-group.js.map +1 -1
- package/dist/esm/components/select/select.d.ts +9 -9
- package/dist/esm/components/select/select.d.ts.map +1 -1
- package/dist/esm/components/select/select.js +14 -14
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/skeleton/skeleton.d.ts.map +1 -1
- package/dist/esm/components/skeleton/skeleton.js +1 -1
- package/dist/esm/components/skeleton/skeleton.js.map +1 -1
- package/dist/esm/components/switch/switch.d.ts +2 -2
- package/dist/esm/components/switch/switch.d.ts.map +1 -1
- package/dist/esm/components/switch/switch.js +3 -3
- package/dist/esm/components/switch/switch.js.map +1 -1
- package/dist/esm/components/tabs/tabs.d.ts +5 -5
- package/dist/esm/components/tabs/tabs.d.ts.map +1 -1
- package/dist/esm/components/tabs/tabs.js +5 -5
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/text/text.d.ts.map +1 -1
- package/dist/esm/components/text/text.js +2 -2
- package/dist/esm/components/text/text.js.map +1 -1
- package/dist/esm/components/textarea/textarea.js +1 -1
- package/dist/esm/components/textarea/textarea.js.map +1 -1
- package/dist/esm/components/toast/toast.d.ts.map +1 -1
- package/dist/esm/components/toast/toast.js +1 -1
- package/dist/esm/components/toast/toast.js.map +1 -1
- package/dist/esm/components/tooltip/tooltip.d.ts +3 -3
- package/dist/esm/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js +6 -6
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/package.json +4 -18
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/components/prompt/prompt.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,iFAA0D;AAC1D,qDAA8B;AAE9B,gDAA4C;AAC5C,kDAA8C;AAC9C,qCAAiC;AAIjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA6B;IACpE,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAA;AAEF,MAA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C,KACxD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EAAC,2CAA2C,EAAE,SAAS,CAAC,KAClE,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,OAAO;IACP,OAAO;IACP,KAAK;IACL,WAAW;IACX,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport * as Primitives from \"@radix-ui/react-alert-dialog\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/button\"\nimport { Heading } from \"@/components/heading\"\nimport { clx } from \"@/utils/clx\"\n\ntype PromptVariant = \"danger\" | \"confirmation\"\n\nconst PromptContext = React.createContext<{ variant: PromptVariant }>({\n variant: \"danger\",\n})\n\nconst usePromptContext = () => {\n const context = React.useContext(PromptContext)\n if (!context) {\n throw new Error(\"usePromptContext must be used within a PromptProvider\")\n }\n return context\n}\n\ntype PromptProviderProps = React.PropsWithChildren<{\n variant: PromptVariant\n}>\n\nconst PromptProvider = ({ variant, children }: PromptProviderProps) => {\n return (\n <PromptContext.Provider value={{ variant }}>\n {children}\n </PromptContext.Provider>\n )\n}\n\n/**\n * This component is based on the [Radix UI Alert Dialog](https://www.radix-ui.com/primitives/docs/components/alert-dialog) primitives.\n */\nconst Root = ({\n /**\n * The variant of the prompt.\n */\n variant = \"danger\",\n ...props\n}: React.ComponentPropsWithoutRef<typeof Primitives.Root> & {\n variant?: PromptVariant\n}) => {\n return (\n <PromptProvider variant={variant}>\n <Primitives.Root {...props} />\n </PromptProvider>\n )\n}\nRoot.displayName = \"Prompt\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"Prompt.Trigger\"\n\nconst Portal = (props: Primitives.AlertDialogPortalProps) => {\n return <Primitives.AlertDialogPortal {...props} />\n}\nPortal.displayName = \"Prompt.Portal\"\n\nconst Overlay = React.forwardRef<\n React.ElementRef<typeof Primitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof Primitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Overlay\n ref={ref}\n className={clx(\n \"bg-ui-bg-overlay fixed inset-0\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n})\nOverlay.displayName = \"Prompt.Overlay\"\n\nconst Title = React.forwardRef<\n React.ElementRef<typeof Primitives.Title>,\n Omit<React.ComponentPropsWithoutRef<typeof Primitives.Title>, \"asChild\">\n>(({ className, children, ...props }, ref) => {\n return (\n <Primitives.Title ref={ref} className={clx(className)} {...props} asChild>\n <Heading level=\"h2\" className=\"text-ui-fg-base\">\n {children}\n </Heading>\n </Primitives.Title>\n )\n})\nTitle.displayName = \"Prompt.Title\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <Portal>\n <Overlay />\n <Primitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-flyout fixed left-[50%] top-[50%] flex w-full max-w-[400px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border focus-visible:outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] duration-200\",\n className\n )}\n {...props}\n />\n </Portal>\n )\n})\nContent.displayName = \"Prompt.Content\"\n\nconst Description = React.forwardRef<\n React.ElementRef<typeof Primitives.Description>,\n React.ComponentPropsWithoutRef<typeof Primitives.Description>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Description\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-medium\", className)}\n {...props}\n />\n )\n})\nDescription.displayName = \"Prompt.Description\"\n\nconst Action = React.forwardRef<\n React.ElementRef<typeof Primitives.Action>,\n Omit<React.ComponentPropsWithoutRef<typeof Primitives.Action>, \"asChild\">\n>(({ className, children, type, ...props }, ref) => {\n const { variant } = usePromptContext()\n\n return (\n <Primitives.Action ref={ref} className={className} {...props} asChild>\n <Button\n size=\"small\"\n type={type}\n variant={variant === \"danger\" ? \"danger\" : \"primary\"}\n >\n {children}\n </Button>\n </Primitives.Action>\n )\n})\nAction.displayName = \"Prompt.Action\"\n\nconst Cancel = React.forwardRef<\n React.ElementRef<typeof Primitives.Cancel>,\n Omit<React.ComponentPropsWithoutRef<typeof Primitives.Cancel>, \"asChild\">\n>(({ className, children, ...props }, ref) => {\n return (\n <Primitives.Cancel ref={ref} className={clx(className)} {...props} asChild>\n <Button size=\"small\" variant=\"secondary\">\n {children}\n </Button>\n </Primitives.Cancel>\n )\n})\nCancel.displayName = \"Prompt.Cancel\"\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Header = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\"flex flex-col gap-y-1 px-6 pt-6\", className)}\n {...props}\n />\n )\n}\nHeader.displayName = \"Prompt.Header\"\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Footer = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\"flex items-center justify-end gap-x-2 p-6\", className)}\n {...props}\n />\n )\n}\nFooter.displayName = \"Prompt.Footer\"\n\nconst Prompt = Object.assign(Root, {\n Trigger,\n Content,\n Title,\n Description,\n Action,\n Cancel,\n Header,\n Footer,\n})\n\nexport { Prompt }\n"]}
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/components/prompt/prompt.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,uCAA0D;AAC1D,qDAA8B;AAE9B,gDAA4C;AAC5C,kDAA8C;AAC9C,qCAAiC;AAIjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA6B;IACpE,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAMD,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAuB,EAAE,EAAE;IACpE,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,IACvC,QAAQ,CACc,CAC1B,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,IAAI,GAAG,CAAC;AACZ;;GAEG;AACH,OAAO,GAAG,QAAQ,EAClB,GAAG,KAAK,EAGT,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,cAAc,IAAC,OAAO,EAAE,OAAO;QAC9B,oBAAC,sBAAgB,CAAC,IAAI,OAAK,KAAK,GAAI,CACrB,CAClB,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE3B,MAAM,OAAO,GAAG,sBAAgB,CAAC,OAAO,CAAA;AACxC,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAEtC,MAAM,M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,GAAG,EAAE,SAAS,EAAE,IAAA,SAAG,EAAC,SAAS,CAAC,KAAM,KAAK,EAAE,OAAO;QAC9E,oBAAC,eAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,WAAW,IACrC,QAAQ,CACF,CACe,CAC3B,CAAA;AACH,CAAC,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EAAC,iCAAiC,EAAE,SAAS,CAAC,KACxD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC;;GAEG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EAAC,2CAA2C,EAAE,SAAS,CAAC,KAClE,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,OAAO;IACP,OAAO;IACP,KAAK;IACL,WAAW;IACX,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { AlertDialog as RadixAlertDialog } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/button\"\nimport { Heading } from \"@/components/heading\"\nimport { clx } from \"@/utils/clx\"\n\ntype PromptVariant = \"danger\" | \"confirmation\"\n\nconst PromptContext = React.createContext<{ variant: PromptVariant }>({\n variant: \"danger\",\n})\n\nconst usePromptContext = () => {\n const context = React.useContext(PromptContext)\n if (!context) {\n throw new Error(\"usePromptContext must be used within a PromptProvider\")\n }\n return context\n}\n\ntype PromptProviderProps = React.PropsWithChildren<{\n variant: PromptVariant\n}>\n\nconst PromptProvider = ({ variant, children }: PromptProviderProps) => {\n return (\n <PromptContext.Provider value={{ variant }}>\n {children}\n </PromptContext.Provider>\n )\n}\n\n/**\n * This component is based on the [Radix UI Alert Dialog](https://www.radix-ui.com/primitives/docs/components/alert-dialog) primitives.\n */\nconst Root = ({\n /**\n * The variant of the prompt.\n */\n variant = \"danger\",\n ...props\n}: React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Root> & {\n variant?: PromptVariant\n}) => {\n return (\n <PromptProvider variant={variant}>\n <RadixAlertDialog.Root {...props} />\n </PromptProvider>\n )\n}\nRoot.displayName = \"Prompt\"\n\nconst Trigger = RadixAlertDialog.Trigger\nTrigger.displayName = \"Prompt.Trigger\"\n\nconst Portal = (props: RadixAlertDialog.AlertDialogPortalProps) => {\n return <RadixAlertDialog.AlertDialogPortal {...props} />\n}\nPortal.displayName = \"Prompt.Portal\"\n\nconst Overlay = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Overlay>,\n React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <RadixAlertDialog.Overlay\n ref={ref}\n className={clx(\n \"bg-ui-bg-overlay fixed inset-0\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n})\nOverlay.displayName = \"Prompt.Overlay\"\n\nconst Title = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Title>,\n Omit<React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Title>, \"asChild\">\n>(({ className, children, ...props }, ref) => {\n return (\n <RadixAlertDialog.Title ref={ref} className={clx(className)} {...props} asChild>\n <Heading level=\"h2\" className=\"text-ui-fg-base\">\n {children}\n </Heading>\n </RadixAlertDialog.Title>\n )\n})\nTitle.displayName = \"Prompt.Title\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Content>,\n React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Content>\n>(({ className, ...props }, ref) => {\n return (\n <Portal>\n <Overlay />\n <RadixAlertDialog.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-flyout fixed left-[50%] top-[50%] flex w-full max-w-[400px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border focus-visible:outline-none\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] duration-200\",\n className\n )}\n {...props}\n />\n </Portal>\n )\n})\nContent.displayName = \"Prompt.Content\"\n\nconst Description = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Description>,\n React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Description>\n>(({ className, ...props }, ref) => {\n return (\n <RadixAlertDialog.Description\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-medium\", className)}\n {...props}\n />\n )\n})\nDescription.displayName = \"Prompt.Description\"\n\nconst Action = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Action>,\n Omit<React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Action>, \"asChild\">\n>(({ className, children, type, ...props }, ref) => {\n const { variant } = usePromptContext()\n\n return (\n <RadixAlertDialog.Action ref={ref} className={className} {...props} asChild>\n <Button\n size=\"small\"\n type={type}\n variant={variant === \"danger\" ? \"danger\" : \"primary\"}\n >\n {children}\n </Button>\n </RadixAlertDialog.Action>\n )\n})\nAction.displayName = \"Prompt.Action\"\n\nconst Cancel = React.forwardRef<\n React.ElementRef<typeof RadixAlertDialog.Cancel>,\n Omit<React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Cancel>, \"asChild\">\n>(({ className, children, ...props }, ref) => {\n return (\n <RadixAlertDialog.Cancel ref={ref} className={clx(className)} {...props} asChild>\n <Button size=\"small\" variant=\"secondary\">\n {children}\n </Button>\n </RadixAlertDialog.Cancel>\n )\n})\nCancel.displayName = \"Prompt.Cancel\"\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Header = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\"flex flex-col gap-y-1 px-6 pt-6\", className)}\n {...props}\n />\n )\n}\nHeader.displayName = \"Prompt.Header\"\n\n/**\n * This component is based on the `div` element and supports all of its props\n */\nconst Footer = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\"flex items-center justify-end gap-x-2 p-6\", className)}\n {...props}\n />\n )\n}\nFooter.displayName = \"Prompt.Footer\"\n\nconst Prompt = Object.assign(Root, {\n Trigger,\n Content,\n Title,\n Description,\n Action,\n Cancel,\n Header,\n Footer,\n})\n\nexport { Prompt }\n"]}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import
|
1
|
+
import { RadioGroup as RadixRadioGroup } from "radix-ui";
|
2
2
|
import * as React from "react";
|
3
|
-
interface ChoiceBoxProps extends React.ComponentPropsWithoutRef<typeof
|
3
|
+
interface ChoiceBoxProps extends React.ComponentPropsWithoutRef<typeof RadixRadioGroup.Item> {
|
4
4
|
label: string;
|
5
5
|
description: string;
|
6
6
|
}
|
7
|
-
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<
|
8
|
-
Item: React.ForwardRefExoticComponent<Omit<
|
7
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadixRadioGroup.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
|
8
|
+
Item: React.ForwardRefExoticComponent<Omit<RadixRadioGroup.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
9
9
|
ChoiceBox: React.ForwardRefExoticComponent<ChoiceBoxProps & React.RefAttributes<HTMLButtonElement>>;
|
10
10
|
};
|
11
11
|
export { RadioGroup };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAwE9B,UAAU,cACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB;AA2DD,QAAA,MAAM,UAAU;;;CAA2C,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
@@ -3,25 +3,25 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.RadioGroup = void 0;
|
5
5
|
const tslib_1 = require("tslib");
|
6
|
-
const
|
6
|
+
const radix_ui_1 = require("radix-ui");
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
8
|
-
const clx_1 = require("../../utils/clx");
|
9
8
|
const hint_1 = require("../hint");
|
10
9
|
const label_1 = require("../label");
|
10
|
+
const clx_1 = require("../../utils/clx");
|
11
11
|
/**
|
12
12
|
* This component is based on the [Radix UI Radio Group](https://www.radix-ui.com/primitives/docs/components/radio-group) primitives.
|
13
13
|
*/
|
14
14
|
const Root = React.forwardRef(({ className, ...props }, ref) => {
|
15
|
-
return (React.createElement(
|
15
|
+
return (React.createElement(radix_ui_1.RadioGroup.Root, { className: (0, clx_1.clx)("grid gap-2", className), ...props, ref: ref }));
|
16
16
|
});
|
17
17
|
Root.displayName = "RadioGroup";
|
18
18
|
const Indicator = React.forwardRef(({ className, ...props }, ref) => {
|
19
|
-
return (React.createElement(
|
19
|
+
return (React.createElement(radix_ui_1.RadioGroup.Indicator, { ref: ref, className: (0, clx_1.clx)("flex items-center justify-center", className), ...props },
|
20
20
|
React.createElement("div", { className: (0, clx_1.clx)("bg-ui-bg-base shadow-details-contrast-on-bg-interactive h-1.5 w-1.5 rounded-full") })));
|
21
21
|
});
|
22
22
|
Indicator.displayName = "RadioGroup.Indicator";
|
23
23
|
const Item = React.forwardRef(({ className, ...props }, ref) => {
|
24
|
-
return (React.createElement(
|
24
|
+
return (React.createElement(radix_ui_1.RadioGroup.Item, { ref: ref, className: (0, clx_1.clx)("group relative flex h-5 w-5 items-center justify-center outline-none", className), ...props },
|
25
25
|
React.createElement("div", { className: (0, clx_1.clx)("shadow-borders-base bg-ui-bg-base transition-fg flex h-[14px] w-[14px] items-center justify-center rounded-full", "group-hover:group-enabled:group-data-[state=unchecked]:bg-ui-bg-base-hover", "group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow", "group-focus-visible:!shadow-borders-interactive-with-focus", "group-disabled:cursor-not-allowed group-disabled:opacity-50") },
|
26
26
|
React.createElement(Indicator, null))));
|
27
27
|
});
|
@@ -32,7 +32,7 @@ const ChoiceBox = React.forwardRef(({ className, id, label, description, ...prop
|
|
32
32
|
id = generatedId;
|
33
33
|
}
|
34
34
|
const descriptionId = `${id}-description`;
|
35
|
-
return (React.createElement(
|
35
|
+
return (React.createElement(radix_ui_1.RadioGroup.Item, { ref: ref, className: (0, clx_1.clx)("shadow-borders-base bg-ui-bg-base focus-visible:shadow-borders-interactive-with-focus transition-fg group flex items-start gap-x-2 rounded-lg p-3 outline-none", "hover:enabled:bg-ui-bg-base-hover", "data-[state=checked]:shadow-borders-interactive-with-shadow", "group-disabled:cursor-not-allowed group-disabled:opacity-50", className), ...props, id: id, "aria-describedby": descriptionId },
|
36
36
|
React.createElement("div", { className: "flex h-5 w-5 items-center justify-center" },
|
37
37
|
React.createElement("div", { className: (0, clx_1.clx)("shadow-borders-base bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow transition-fg flex h-3.5 w-3.5 items-center justify-center rounded-full", "group-hover:group-enabled:group-data-[state=unchecked]:bg-ui-bg-base-hover") },
|
38
38
|
React.createElement(Indicator, null))),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,uCAAwD;AACxD,qDAA8B;AAE9B,4CAAwC;AACxC,8CAA0C;AAC1C,qCAAiC;AAEjC;;GAEG;AACH,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAG3B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,qBAAe,CAAC,IAAI,IACnB,SAAS,EAAE,IAAA,SAAG,EAAC,YAAY,EAAE,SAAS,CAAC,KACnC,KAAK,EACT,GAAG,EAAE,GAAG,GACR,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,YAAY,CAAA;AAE/B,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,qBAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,kCAAkC,EAAE,SAAS,CAAC,KACzD,KAAK;QAET,6BACE,SAA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SAAG,EACZ,6NAA6N,EAC7N,4EAA4E,CAC7E;gBAED,oBAAC,SAAS,OAAG,CACT,CACF;QACN,6BAAK,SAAS,EAAC,2BAA2B;YACxC,oBAAC,aAAK,IACJ,OAAO,EAAE,EAAE,EACX,IAAI,EAAC,OAAO,EACZ,MAAM,EAAC,MAAM,EACb,SAAS,EAAC,qFAAqF,IAE9F,KAAK,CACA;YACR,oBAAC,WAAI,IACH,SAAS,EAAC,0EAA0E,EACpF,EAAE,EAAE,aAAa,IAEhB,WAAW,CACP,CACH,CACe,CACxB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE9C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAElD,gCAAU","sourcesContent":["\"use client\"\n\nimport { RadioGroup as RadixRadioGroup } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { Hint } from \"@/components/hint\"\nimport { Label } from \"@/components/label\"\nimport { clx } from \"@/utils/clx\"\n\n/**\n * This component is based on the [Radix UI Radio Group](https://www.radix-ui.com/primitives/docs/components/radio-group) primitives.\n */\nconst Root = React.forwardRef<\n React.ElementRef<typeof RadixRadioGroup.Root>,\n React.ComponentPropsWithoutRef<typeof RadixRadioGroup.Root>\n>(({ className, ...props }, ref) => {\n return (\n <RadixRadioGroup.Root\n className={clx(\"grid gap-2\", className)}\n {...props}\n ref={ref}\n />\n )\n})\nRoot.displayName = \"RadioGroup\"\n\nconst Indicator = React.forwardRef<\n React.ElementRef<typeof RadixRadioGroup.Indicator>,\n React.ComponentPropsWithoutRef<typeof RadixRadioGroup.Indicator>\n>(({ className, ...props }, ref) => {\n return (\n <RadixRadioGroup.Indicator\n ref={ref}\n className={clx(\"flex items-center justify-center\", className)}\n {...props}\n >\n <div\n className={clx(\n \"bg-ui-bg-base shadow-details-contrast-on-bg-interactive h-1.5 w-1.5 rounded-full\"\n )}\n />\n </RadixRadioGroup.Indicator>\n )\n})\nIndicator.displayName = \"RadioGroup.Indicator\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof RadixRadioGroup.Item>,\n React.ComponentPropsWithoutRef<typeof RadixRadioGroup.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadixRadioGroup.Item\n ref={ref}\n className={clx(\n \"group relative flex h-5 w-5 items-center justify-center outline-none\",\n className\n )}\n {...props}\n >\n <div\n className={clx(\n \"shadow-borders-base bg-ui-bg-base transition-fg flex h-[14px] w-[14px] items-center justify-center rounded-full\",\n \"group-hover:group-enabled:group-data-[state=unchecked]:bg-ui-bg-base-hover\",\n \"group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow\",\n \"group-focus-visible:!shadow-borders-interactive-with-focus\",\n \"group-disabled:cursor-not-allowed group-disabled:opacity-50\"\n )}\n >\n <Indicator />\n </div>\n </RadixRadioGroup.Item>\n )\n})\nItem.displayName = \"RadioGroup.Item\"\n\ninterface ChoiceBoxProps\n extends React.ComponentPropsWithoutRef<typeof RadixRadioGroup.Item> {\n label: string\n description: string\n}\n\nconst ChoiceBox = React.forwardRef<\n React.ElementRef<typeof RadixRadioGroup.Item>,\n ChoiceBoxProps\n>(({ className, id, label, description, ...props }, ref) => {\n const generatedId = React.useId()\n\n if (!id) {\n id = generatedId\n }\n\n const descriptionId = `${id}-description`\n\n return (\n <RadixRadioGroup.Item\n ref={ref}\n className={clx(\n \"shadow-borders-base bg-ui-bg-base focus-visible:shadow-borders-interactive-with-focus transition-fg group flex items-start gap-x-2 rounded-lg p-3 outline-none\",\n \"hover:enabled:bg-ui-bg-base-hover\",\n \"data-[state=checked]:shadow-borders-interactive-with-shadow\",\n \"group-disabled:cursor-not-allowed group-disabled:opacity-50\",\n className\n )}\n {...props}\n id={id}\n aria-describedby={descriptionId}\n >\n <div className=\"flex h-5 w-5 items-center justify-center\">\n <div\n className={clx(\n \"shadow-borders-base bg-ui-bg-base group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive-with-shadow transition-fg flex h-3.5 w-3.5 items-center justify-center rounded-full\",\n \"group-hover:group-enabled:group-data-[state=unchecked]:bg-ui-bg-base-hover\"\n )}\n >\n <Indicator />\n </div>\n </div>\n <div className=\"flex flex-col items-start\">\n <Label\n htmlFor={id}\n size=\"small\"\n weight=\"plus\"\n className=\"group-disabled:text-ui-fg-disabled cursor-pointer group-disabled:cursor-not-allowed\"\n >\n {label}\n </Label>\n <Hint\n className=\"txt-small text-ui-fg-subtle group-disabled:text-ui-fg-disabled text-left\"\n id={descriptionId}\n >\n {description}\n </Hint>\n </div>\n </RadixRadioGroup.Item>\n )\n})\nChoiceBox.displayName = \"RadioGroup.ChoiceBox\"\n\nconst RadioGroup = Object.assign(Root, { Item, ChoiceBox })\n\nexport { RadioGroup }\n"]}
|
@@ -1,21 +1,21 @@
|
|
1
|
-
import
|
1
|
+
import { Select as RadixSelect } from "radix-ui";
|
2
2
|
import * as React from "react";
|
3
|
-
interface SelectProps extends React.ComponentPropsWithoutRef<typeof
|
3
|
+
interface SelectProps extends React.ComponentPropsWithoutRef<typeof RadixSelect.Root> {
|
4
4
|
size?: "base" | "small";
|
5
5
|
}
|
6
|
-
interface SelectContentProps extends React.ComponentPropsWithoutRef<typeof
|
6
|
+
interface SelectContentProps extends React.ComponentPropsWithoutRef<typeof RadixSelect.Content> {
|
7
7
|
}
|
8
8
|
declare const Select: {
|
9
9
|
({ children, size, ...props }: SelectProps): React.JSX.Element;
|
10
10
|
displayName: string;
|
11
11
|
} & {
|
12
|
-
Group: React.ForwardRefExoticComponent<
|
13
|
-
Value: React.ForwardRefExoticComponent<
|
14
|
-
Trigger: React.ForwardRefExoticComponent<Omit<
|
12
|
+
Group: React.ForwardRefExoticComponent<RadixSelect.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
Value: React.ForwardRefExoticComponent<RadixSelect.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
14
|
+
Trigger: React.ForwardRefExoticComponent<Omit<RadixSelect.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
15
15
|
Content: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
16
|
-
Label: React.ForwardRefExoticComponent<Omit<
|
17
|
-
Item: React.ForwardRefExoticComponent<Omit<
|
18
|
-
Separator: React.ForwardRefExoticComponent<Omit<
|
16
|
+
Label: React.ForwardRefExoticComponent<Omit<RadixSelect.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
Item: React.ForwardRefExoticComponent<Omit<RadixSelect.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
Separator: React.ForwardRefExoticComponent<Omit<RadixSelect.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
19
|
};
|
20
20
|
export { Select };
|
21
21
|
//# sourceMappingURL=select.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,UAAU,WACR,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AA+FD,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC;CAC9F;AAiID,QAAA,MAAM,MAAM;mCApMT,WAAW;;;;;;;;;;CA4MZ,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Select = void 0;
|
5
5
|
const tslib_1 = require("tslib");
|
6
6
|
const icons_1 = require("@medusajs/icons");
|
7
|
-
const SelectPrimitive = tslib_1.__importStar(require("@radix-ui/react-select"));
|
8
7
|
const cva_1 = require("cva");
|
8
|
+
const radix_ui_1 = require("radix-ui");
|
9
9
|
const React = tslib_1.__importStar(require("react"));
|
10
10
|
const clx_1 = require("../../utils/clx");
|
11
11
|
const SelectContext = React.createContext(null);
|
@@ -26,19 +26,19 @@ const Root = ({ children,
|
|
26
26
|
*/
|
27
27
|
size = "base", ...props }) => {
|
28
28
|
return (React.createElement(SelectContext.Provider, { value: React.useMemo(() => ({ size }), [size]) },
|
29
|
-
React.createElement(
|
29
|
+
React.createElement(radix_ui_1.Select.Root, { ...props }, children)));
|
30
30
|
};
|
31
31
|
Root.displayName = "Select";
|
32
32
|
/**
|
33
33
|
* Groups multiple items together.
|
34
34
|
*/
|
35
|
-
const Group =
|
35
|
+
const Group = radix_ui_1.Select.Group;
|
36
36
|
Group.displayName = "Select.Group";
|
37
37
|
/**
|
38
38
|
* Displays the selected value, or a placeholder if no value is selected.
|
39
39
|
* It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).
|
40
40
|
*/
|
41
|
-
const Value =
|
41
|
+
const Value = radix_ui_1.Select.Value;
|
42
42
|
Value.displayName = "Select.Value";
|
43
43
|
const triggerVariants = (0, cva_1.cva)({
|
44
44
|
base: (0, clx_1.clx)("bg-ui-bg-field shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none", "data-[placeholder]:text-ui-fg-muted text-ui-fg-base", "hover:bg-ui-bg-field-hover", "focus-visible:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active", "aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error", "invalid:border-ui-border-error invalid:shadow-borders-error", "disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled", "group/trigger"),
|
@@ -55,9 +55,9 @@ const triggerVariants = (0, cva_1.cva)({
|
|
55
55
|
*/
|
56
56
|
const Trigger = React.forwardRef(({ className, children, ...props }, ref) => {
|
57
57
|
const { size } = useSelectContext();
|
58
|
-
return (React.createElement(
|
58
|
+
return (React.createElement(radix_ui_1.Select.Trigger, { ref: ref, className: (0, clx_1.clx)(triggerVariants({ size }), className), ...props },
|
59
59
|
children,
|
60
|
-
React.createElement(
|
60
|
+
React.createElement(radix_ui_1.Select.Icon, { asChild: true },
|
61
61
|
React.createElement(icons_1.TrianglesMini, { className: "text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled" }))));
|
62
62
|
});
|
63
63
|
Trigger.displayName = "Select.Trigger";
|
@@ -77,32 +77,32 @@ sideOffset = 8,
|
|
77
77
|
/**
|
78
78
|
* The distance in pixels from the boundary edges where collision detection should occur. Only available when position is set to popper.
|
79
79
|
*/
|
80
|
-
collisionPadding = 24, ...props }, ref) => (React.createElement(
|
81
|
-
React.createElement(
|
80
|
+
collisionPadding = 24, ...props }, ref) => (React.createElement(radix_ui_1.Select.Portal, null,
|
81
|
+
React.createElement(radix_ui_1.Select.Content, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", {
|
82
82
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1": position === "popper",
|
83
83
|
}, className), position: position, sideOffset: sideOffset, collisionPadding: collisionPadding, ...props },
|
84
|
-
React.createElement(
|
84
|
+
React.createElement(radix_ui_1.Select.Viewport, { className: (0, clx_1.clx)("p-1", position === "popper" &&
|
85
85
|
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]") }, children)))));
|
86
86
|
Content.displayName = "Select.Content";
|
87
87
|
/**
|
88
88
|
* Used to label a group of items.
|
89
89
|
* It's based on [Radix UI Select Label](https://www.radix-ui.com/primitives/docs/components/select#label).
|
90
90
|
*/
|
91
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
91
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(radix_ui_1.Select.Label, { ref: ref, className: (0, clx_1.clx)("txt-compact-xsmall-plus text-ui-fg-muted px-2 py-1.5", className), ...props })));
|
92
92
|
Label.displayName = "Select.Label";
|
93
93
|
/**
|
94
94
|
* An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)
|
95
95
|
* and accepts its props.
|
96
96
|
*/
|
97
97
|
const Item = React.forwardRef(({ className, children, ...props }, ref) => {
|
98
|
-
return (React.createElement(
|
98
|
+
return (React.createElement(radix_ui_1.Select.Item, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-component grid cursor-pointer grid-cols-[15px_1fr] gap-x-2 rounded-[4px] px-2 py-1.5 outline-none transition-colors txt-compact-small items-center", "focus-visible:bg-ui-bg-component-hover", "active:bg-ui-bg-component-pressed", "data-[state=checked]:txt-compact-small-plus", "disabled:text-ui-fg-disabled", className), ...props },
|
99
99
|
React.createElement("span", { className: "flex h-[15px] w-[15px] items-center justify-center" },
|
100
|
-
React.createElement(
|
100
|
+
React.createElement(radix_ui_1.Select.ItemIndicator, { className: "flex items-center justify-center" },
|
101
101
|
React.createElement(icons_1.Check, null))),
|
102
|
-
React.createElement(
|
102
|
+
React.createElement(radix_ui_1.Select.ItemText, { className: "flex-1 truncate" }, children)));
|
103
103
|
});
|
104
104
|
Item.displayName = "Select.Item";
|
105
|
-
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
105
|
+
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(radix_ui_1.Select.Separator, { ref: ref, className: (0, clx_1.clx)("bg-ui-border-component -mx-1 my-1 h-0.5 border-t border-t-ui-border-menu-top border-b border-b-ui-border-menu-bot", className), ...props })));
|
106
106
|
Separator.displayName = "Select.Separator";
|
107
107
|
const Select = Object.assign(Root, {
|
108
108
|
Group,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAsD;AACtD,gFAAyD;AACzD,6BAAyB;AACzB,qDAA8B;AAE9B,qCAAiC;AAWjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI,CAAC,CAAA;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QACpE,oBAAC,eAAe,CAAC,IAAI,OAAK,KAAK,IAAG,QAAQ,CA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Ae,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,6JAA6J,EAC7J,wCAAwC,EACxC,mCAAmC,EACnC,6CAA6C,EAC7C,8BAA8B,EAC9B,SAAS,CACV,KACG,KAAK;QAET,8BAAM,SAAS,EAAC,oDAAoD;YAClE,oBAAC,eAAe,CAAC,aAAa,IAAC,SAAS,EAAC,kCAAkC;gBACzE,oBAAC,aAAK,OAAG,CACqB,CAC3B;QACP,oBAAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,IAClD,QAAQ,CACgB,CACN,CACxB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,aAAa,CAAA;AAEhC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mHAAmH,EAAE,SAAS,CAAC,KAC1I,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE1C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,SAAS;CACV,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { Check, TrianglesMini } from \"@medusajs/icons\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { cva } from \"cva\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <SelectPrimitive.Root {...props}>{children}</SelectPrimitive.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = SelectPrimitive.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = SelectPrimitive.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus-visible:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid:border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\n * It's based on [Radix UI Select Trigger](https://www.radix-ui.com/primitives/docs/components/select#trigger).\n */\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\n\ninterface SelectContentProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n}\n\n/**\n * The content that appears when the select is open.\n * It's based on [Radix UI Select Content](https://www.radix-ui.com/primitives/docs/components/select#content).\n */\nconst Content = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n /**\n * Whether to show the select items below (`popper`) or over (`item-aligned`) the select input.\n */\n position = \"popper\",\n /**\n * The distance of the content pop-up in pixels from the select input. Only available when position is set to popper.\n */\n sideOffset = 8,\n /**\n * The distance in pixels from the boundary edges where collision detection should occur. Only available when position is set to popper.\n */\n collisionPadding = 24,\n ...props\n }: SelectContentProps,\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n)\nContent.displayName = \"Select.Content\"\n\n/**\n * Used to label a group of items.\n * It's based on [Radix UI Select Label](https://www.radix-ui.com/primitives/docs/components/select#label).\n */\nconst Label = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-muted px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\n */\nconst Item = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-component grid cursor-pointer grid-cols-[15px_1fr] gap-x-2 rounded-[4px] px-2 py-1.5 outline-none transition-colors txt-compact-small items-center\",\n \"focus-visible:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-pressed\",\n \"data-[state=checked]:txt-compact-small-plus\",\n \"disabled:text-ui-fg-disabled\",\n className\n )}\n {...props}\n >\n <span className=\"flex h-[15px] w-[15px] items-center justify-center\">\n <SelectPrimitive.ItemIndicator className=\"flex items-center justify-center\">\n <Check />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n})\nItem.displayName = \"Select.Item\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={clx(\"bg-ui-border-component -mx-1 my-1 h-0.5 border-t border-t-ui-border-menu-top border-b border-b-ui-border-menu-bot\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"Select.Separator\"\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAsD;AACtD,6BAAyB;AACzB,uCAAgD;AAChD,qDAA8B;AAE9B,qCAAiC;AAWjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI,CAAC,CAAA;AAE1E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE/C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,QAAQ;AACR;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EAAE,EAAE;IAChB,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QACpE,oBAAC,iBAAW,CAAC,IAAI,OAAK,KAAK,IAAG,QAAQ,CAA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C,iBAAW,CAAC,IAAI,IACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,6JAA6J,EAC7J,wCAAwC,EACxC,mCAAmC,EACnC,6CAA6C,EAC7C,8BAA8B,EAC9B,SAAS,CACV,KACG,KAAK;QAET,8BAAM,SAAS,EAAC,oDAAoD;YAClE,oBAAC,iBAAW,CAAC,aAAa,IAAC,SAAS,EAAC,kCAAkC;gBACrE,oBAAC,aAAK,OAAG,CACiB,CACvB;QACP,oBAAC,iBAAW,CAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,IAC9C,QAAQ,CACY,CACN,CACpB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,aAAa,CAAA;AAEhC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,iBAAW,CAAC,SAAS,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mHAAmH,EAAE,SAAS,CAAC,KAC1I,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAE1C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACjC,KAAK;IACL,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,SAAS;CACV,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { Check, TrianglesMini } from \"@medusajs/icons\"\nimport { cva } from \"cva\"\nimport { Select as RadixSelect } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\ninterface SelectProps\n extends React.ComponentPropsWithoutRef<typeof RadixSelect.Root> {\n size?: \"base\" | \"small\"\n}\n\ntype SelectContextValue = {\n size: \"base\" | \"small\"\n}\n\nconst SelectContext = React.createContext<SelectContextValue | null>(null)\n\nconst useSelectContext = () => {\n const context = React.useContext(SelectContext)\n\n if (context === null) {\n throw new Error(\"useSelectContext must be used within a SelectProvider\")\n }\n\n return context\n}\n\n/**\n * This component is based on [Radix UI Select](https://www.radix-ui.com/primitives/docs/components/select).\n * It also accepts all props of the HTML `select` component.\n */\nconst Root = ({\n children,\n /**\n * The select's size.\n */\n size = \"base\",\n ...props\n}: SelectProps) => {\n return (\n <SelectContext.Provider value={React.useMemo(() => ({ size }), [size])}>\n <RadixSelect.Root {...props}>{children}</RadixSelect.Root>\n </SelectContext.Provider>\n )\n}\nRoot.displayName = \"Select\"\n\n/**\n * Groups multiple items together.\n */\nconst Group = RadixSelect.Group\nGroup.displayName = \"Select.Group\"\n\n/**\n * Displays the selected value, or a placeholder if no value is selected.\n * It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).\n */\nconst Value = RadixSelect.Value\nValue.displayName = \"Select.Value\"\n\nconst triggerVariants = cva({\n base: clx(\n \"bg-ui-bg-field shadow-buttons-neutral transition-fg flex w-full select-none items-center justify-between rounded-md outline-none\",\n \"data-[placeholder]:text-ui-fg-muted text-ui-fg-base\",\n \"hover:bg-ui-bg-field-hover\",\n \"focus-visible:shadow-borders-interactive-with-active data-[state=open]:!shadow-borders-interactive-with-active\",\n \"aria-[invalid=true]:border-ui-border-error aria-[invalid=true]:shadow-borders-error\",\n \"invalid:border-ui-border-error invalid:shadow-borders-error\",\n \"disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"group/trigger\"\n ),\n variants: {\n size: {\n base: \"h-8 px-2 py-1.5 txt-compact-small\",\n small: \"h-7 px-2 py-1 txt-compact-small\",\n },\n },\n})\n\n/**\n * The trigger that toggles the select.\n * It's based on [Radix UI Select Trigger](https://www.radix-ui.com/primitives/docs/components/select#trigger).\n */\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof RadixSelect.Trigger>,\n React.ComponentPropsWithoutRef<typeof RadixSelect.Trigger>\n>(({ className, children, ...props }, ref) => {\n const { size } = useSelectContext()\n\n return (\n <RadixSelect.Trigger\n ref={ref}\n className={clx(triggerVariants({ size }), className)}\n {...props}\n >\n {children}\n <RadixSelect.Icon asChild>\n <TrianglesMini className=\"text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled\" />\n </RadixSelect.Icon>\n </RadixSelect.Trigger>\n )\n})\nTrigger.displayName = \"Select.Trigger\"\n\ninterface SelectContentProps extends React.ComponentPropsWithoutRef<typeof RadixSelect.Content> {\n}\n\n/**\n * The content that appears when the select is open.\n * It's based on [Radix UI Select Content](https://www.radix-ui.com/primitives/docs/components/select#content).\n */\nconst Content = React.forwardRef<\n React.ElementRef<typeof RadixSelect.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n /**\n * Whether to show the select items below (`popper`) or over (`item-aligned`) the select input.\n */\n position = \"popper\",\n /**\n * The distance of the content pop-up in pixels from the select input. Only available when position is set to popper.\n */\n sideOffset = 8,\n /**\n * The distance in pixels from the boundary edges where collision detection should occur. Only available when position is set to popper.\n */\n collisionPadding = 24,\n ...props\n }: SelectContentProps,\n ref\n ) => (\n <RadixSelect.Portal>\n <RadixSelect.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout relative max-h-[200px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n {\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\":\n position === \"popper\",\n },\n className\n )}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n {...props}\n >\n <RadixSelect.Viewport\n className={clx(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </RadixSelect.Viewport>\n </RadixSelect.Content>\n </RadixSelect.Portal>\n )\n)\nContent.displayName = \"Select.Content\"\n\n/**\n * Used to label a group of items.\n * It's based on [Radix UI Select Label](https://www.radix-ui.com/primitives/docs/components/select#label).\n */\nconst Label = React.forwardRef<\n React.ElementRef<typeof RadixSelect.Label>,\n React.ComponentPropsWithoutRef<typeof RadixSelect.Label>\n>(({ className, ...props }, ref) => (\n <RadixSelect.Label\n ref={ref}\n className={clx(\n \"txt-compact-xsmall-plus text-ui-fg-muted px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"Select.Label\"\n\n/**\n * An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)\n * and accepts its props.\n */\nconst Item = React.forwardRef<\n React.ElementRef<typeof RadixSelect.Item>,\n React.ComponentPropsWithoutRef<typeof RadixSelect.Item>\n>(({ className, children, ...props }, ref) => {\n return (\n <RadixSelect.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-component grid cursor-pointer grid-cols-[15px_1fr] gap-x-2 rounded-[4px] px-2 py-1.5 outline-none transition-colors txt-compact-small items-center\",\n \"focus-visible:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-pressed\",\n \"data-[state=checked]:txt-compact-small-plus\",\n \"disabled:text-ui-fg-disabled\",\n className\n )}\n {...props}\n >\n <span className=\"flex h-[15px] w-[15px] items-center justify-center\">\n <RadixSelect.ItemIndicator className=\"flex items-center justify-center\">\n <Check />\n </RadixSelect.ItemIndicator>\n </span>\n <RadixSelect.ItemText className=\"flex-1 truncate\">\n {children}\n </RadixSelect.ItemText>\n </RadixSelect.Item>\n )\n})\nItem.displayName = \"Select.Item\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof RadixSelect.Separator>,\n React.ComponentPropsWithoutRef<typeof RadixSelect.Separator>\n>(({ className, ...props }, ref) => (\n <RadixSelect.Separator\n ref={ref}\n className={clx(\"bg-ui-border-component -mx-1 my-1 h-0.5 border-t border-t-ui-border-menu-top border-b border-b-ui-border-menu-bot\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"Select.Separator\"\n\nconst Select = Object.assign(Root, {\n Group,\n Value,\n Trigger,\n Content,\n Label,\n Item,\n Separator,\n})\n\nexport { Select }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,qBAOtC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.Skeleton = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const clx_1 = require("../../utils/clx");
|
6
5
|
const React = tslib_1.__importStar(require("react"));
|
6
|
+
const clx_1 = require("../../utils/clx");
|
7
7
|
function Skeleton({ className, ...props }) {
|
8
8
|
return (React.createElement("div", { className: (0, clx_1.clx)("bg-ui-bg-component animate-pulse rounded-md", className), ...props }));
|
9
9
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":";;;;AAAA,
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":";;;;AAAA,qDAA8B;AAE9B,qCAAiC;AAEjC,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC6B;IACrC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EAAC,6CAA6C,EAAE,SAAS,CAAC,KACpE,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAEQ,4BAAQ","sourcesContent":["import * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={clx(\"bg-ui-bg-component animate-pulse rounded-md\", className)}\n {...props}\n />\n )\n}\n\nexport { Skeleton }\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as Primitives from "@radix-ui/react-switch";
|
2
1
|
import { VariantProps } from "cva";
|
2
|
+
import { Switch as RadixSwitch } from "radix-ui";
|
3
3
|
import * as React from "react";
|
4
4
|
declare const switchVariants: (props?: ({
|
5
5
|
size?: "small" | "base" | undefined;
|
@@ -58,7 +58,7 @@ declare const switchVariants: (props?: ({
|
|
58
58
|
[x: string]: any;
|
59
59
|
} | null | undefined;
|
60
60
|
})) | undefined) => string;
|
61
|
-
interface SwitchProps extends Omit<React.ComponentPropsWithoutRef<typeof
|
61
|
+
interface SwitchProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixSwitch.Root>, "asChild">, VariantProps<typeof switchVariants> {
|
62
62
|
}
|
63
63
|
/**
|
64
64
|
* This component is based on the [Radix UI Switch](https://www.radix-ui.com/primitives/docs/components/switch) primitive.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAO,MAAM,KAAK,CAAA;AACvC,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAWlB,CAAA;AAgBF,UAAU,WACR,SAAQ,IAAI,CACR,KAAK,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,EACvD,SAAS,CACV,EACD,YAAY,CAAC,OAAO,cAAc,CAAC;CAAG;AAE1C;;GAEG;AACH,QAAA,MAAM,MAAM,uFAuBX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
@@ -3,8 +3,8 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.Switch = void 0;
|
5
5
|
const tslib_1 = require("tslib");
|
6
|
-
const Primitives = tslib_1.__importStar(require("@radix-ui/react-switch"));
|
7
6
|
const cva_1 = require("cva");
|
7
|
+
const radix_ui_1 = require("radix-ui");
|
8
8
|
const React = tslib_1.__importStar(require("react"));
|
9
9
|
const clx_1 = require("../../utils/clx");
|
10
10
|
const switchVariants = (0, cva_1.cva)({
|
@@ -38,8 +38,8 @@ const Switch = React.forwardRef(({ className,
|
|
38
38
|
/**
|
39
39
|
* The switch's size.
|
40
40
|
*/
|
41
|
-
size = "base", ...props }, ref) => (React.createElement(
|
42
|
-
React.createElement(
|
41
|
+
size = "base", ...props }, ref) => (React.createElement(radix_ui_1.Switch.Root, { className: (0, clx_1.clx)(switchVariants({ size }), className), ...props, ref: ref },
|
42
|
+
React.createElement(radix_ui_1.Switch.Thumb, { className: (0, clx_1.clx)(thumbVariants({ size })) }))));
|
43
43
|
exports.Switch = Switch;
|
44
44
|
Switch.displayName = "Switch";
|
45
45
|
//# sourceMappingURL=switch.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,6BAAuC;AACvC,uCAAgD;AAChD,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,cAAc,GAAG,IAAA,SAAG,EAAC;IACzB,IAAI,EAAE,ugBAAugB;IAC7gB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAG,IAAA,SAAG,EAAC;IACxB,IAAI,EAAE,kHAAkH;IACxH,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,KAAK,EACH,+FAA+F;YACjG,IAAI,EAAE,kHAAkH;SACzH;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAA;AASF;;GAEG;AACH,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAI7B,CACE,EACE,SAAS;AACT;;GAEG;AACH,IAAI,GAAG,MAAM,EACb,GAAG,KAAK,EACI,EACd,GAAG,EACH,EAAE,CAAC,CACH,oBAAC,iBAAW,CAAC,IAAI,IACf,SAAS,EAAE,IAAA,SAAG,EAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/C,KAAK,EACT,GAAG,EAAE,GAAG;IAER,oBAAC,iBAAW,CAAC,KAAK,IAAC,SAAS,EAAE,IAAA,SAAG,EAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAI,CAC7C,CACpB,CACF,CAAA;AAGQ,wBAAM;AAFf,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA","sourcesContent":["\"use client\"\n\nimport { VariantProps, cva } from \"cva\"\nimport { Switch as RadixSwitch } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst switchVariants = cva({\n base: \"bg-ui-bg-switch-off hover:bg-ui-bg-switch-off-hover data-[state=unchecked]:hover:after:bg-switch-off-hover-gradient before:shadow-details-switch-background focus-visible:shadow-details-switch-background-focus data-[state=checked]:bg-ui-bg-interactive disabled:opacity-50 group relative inline-flex items-center rounded-full outline-none transition-all before:absolute before:inset-0 before:rounded-full before:content-[''] after:absolute after:inset-0 after:rounded-full after:content-[''] disabled:cursor-not-allowed\",\n variants: {\n size: {\n small: \"h-[16px] w-[28px]\",\n base: \"h-[18px] w-[32px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n})\n\nconst thumbVariants = cva({\n base: \"bg-ui-fg-on-color shadow-details-switch-handle pointer-events-none h-[14px] w-[14px] rounded-full transition-all\",\n variants: {\n size: {\n small:\n \"h-[12px] w-[12px] data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0.5\",\n base: \"h-[14px] w-[14px] transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n})\n\ninterface SwitchProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof RadixSwitch.Root>,\n \"asChild\"\n >,\n VariantProps<typeof switchVariants> {}\n\n/**\n * This component is based on the [Radix UI Switch](https://www.radix-ui.com/primitives/docs/components/switch) primitive.\n */\nconst Switch = React.forwardRef<\n React.ElementRef<typeof RadixSwitch.Root>,\n SwitchProps\n>(\n (\n {\n className,\n /**\n * The switch's size.\n */\n size = \"base\",\n ...props\n }: SwitchProps,\n ref\n ) => (\n <RadixSwitch.Root\n className={clx(switchVariants({ size }), className)}\n {...props}\n ref={ref}\n >\n <RadixSwitch.Thumb className={clx(thumbVariants({ size }))} />\n </RadixSwitch.Root>\n )\n)\nSwitch.displayName = \"Switch\"\n\nexport { Switch }\n"]}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import { Tabs as RadixTabs } from "radix-ui";
|
2
2
|
import * as React from "react";
|
3
3
|
declare const Tabs: {
|
4
|
-
(props: React.ComponentPropsWithoutRef<typeof
|
4
|
+
(props: React.ComponentPropsWithoutRef<typeof RadixTabs.Root>): React.JSX.Element;
|
5
5
|
displayName: string;
|
6
6
|
} & {
|
7
|
-
Trigger: React.ForwardRefExoticComponent<Omit<
|
8
|
-
List: React.ForwardRefExoticComponent<Omit<
|
9
|
-
Content: React.ForwardRefExoticComponent<Omit<
|
7
|
+
Trigger: React.ForwardRefExoticComponent<Omit<RadixTabs.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
8
|
+
List: React.ForwardRefExoticComponent<Omit<RadixTabs.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
Content: React.ForwardRefExoticComponent<Omit<RadixTabs.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
10
10
|
};
|
11
11
|
export { Tabs };
|
12
12
|
//# sourceMappingURL=tabs.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA0D9B,QAAA,MAAM,IAAI;YAlDD,MAAM,wBAAwB,CAAC,OAAO,UAAU,IAAI,CAAC;;;;;;CAsD5D,CAAA;AAEF,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -3,21 +3,21 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.Tabs = void 0;
|
5
5
|
const tslib_1 = require("tslib");
|
6
|
-
const
|
6
|
+
const radix_ui_1 = require("radix-ui");
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
8
8
|
const clx_1 = require("../../utils/clx");
|
9
9
|
/**
|
10
10
|
* This component is based on the [Radix UI Tabs](https://radix-ui.com/primitives/docs/components/tabs) primitves
|
11
11
|
*/
|
12
12
|
const TabsRoot = (props) => {
|
13
|
-
return React.createElement(
|
13
|
+
return React.createElement(radix_ui_1.Tabs.Root, { ...props });
|
14
14
|
};
|
15
15
|
TabsRoot.displayName = "Tabs";
|
16
|
-
const TabsTrigger = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(
|
16
|
+
const TabsTrigger = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(radix_ui_1.Tabs.Trigger, { ref: ref, className: (0, clx_1.clx)("txt-compact-small-plus transition-fg text-ui-fg-subtle inline-flex items-center justify-center rounded-full border border-transparent bg-transparent px-2.5 py-1 outline-none", "hover:text-ui-fg-base", "focus-visible:border-ui-border-interactive focus-visible:!shadow-borders-focus focus-visible:bg-ui-bg-base", "data-[state=active]:text-ui-fg-base data-[state=active]:bg-ui-bg-base data-[state=active]:shadow-elevation-card-rest", className), ...props }, children)));
|
17
17
|
TabsTrigger.displayName = "Tabs.Trigger";
|
18
|
-
const TabsList = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
18
|
+
const TabsList = React.forwardRef(({ className, ...props }, ref) => (React.createElement(radix_ui_1.Tabs.List, { ref: ref, className: (0, clx_1.clx)("flex items-center gap-2", className), ...props })));
|
19
19
|
TabsList.displayName = "Tabs.List";
|
20
|
-
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
20
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (React.createElement(radix_ui_1.Tabs.Content, { ref: ref, className: (0, clx_1.clx)("outline-none", className), ...props })));
|
21
21
|
TabsContent.displayName = "Tabs.Content";
|
22
22
|
const Tabs = Object.assign(TabsRoot, {
|
23
23
|
Trigger: TabsTrigger,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,uCAA4C;AAC5C,qDAA8B;AAE9B,qCAAiC;AAEjC;;GAEG;AACH,MAAM,QAAQ,GAAG,CACf,KAA4D,EAC5D,EAAE;IACF,OAAO,oBAAC,eAAS,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AACtC,CAAC,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,MAAM,CAAA;AAE7B,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,eAAS,CAAC,OAAO,IAChB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,+KAA+K,EAC/K,uBAAuB,EACvB,4GAA4G,EAC5G,sHAAsH,EACtH,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACS,CACrB,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,cAAc,CAAA;AAExC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,eAAS,CAAC,IAAI,IACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,yBAAyB,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAA;AACF,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAA;AAElC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,eAAS,CAAC,OAAO,IAChB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,cAAc,EAAE,SAAS,CAAC,KACrC,KAAK,GACT,CACH,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,cAAc,CAAA;AAExC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,WAAW;CACrB,CAAC,CAAA;AAEO,oBAAI","sourcesContent":["\"use client\"\n\nimport { Tabs as RadixTabs } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\n/**\n * This component is based on the [Radix UI Tabs](https://radix-ui.com/primitives/docs/components/tabs) primitves\n */\nconst TabsRoot = (\n props: React.ComponentPropsWithoutRef<typeof RadixTabs.Root>\n) => {\n return <RadixTabs.Root {...props} />\n}\nTabsRoot.displayName = \"Tabs\"\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof RadixTabs.Trigger>,\n React.ComponentPropsWithoutRef<typeof RadixTabs.Trigger>\n>(({ className, children, ...props }, ref) => (\n <RadixTabs.Trigger\n ref={ref}\n className={clx(\n \"txt-compact-small-plus transition-fg text-ui-fg-subtle inline-flex items-center justify-center rounded-full border border-transparent bg-transparent px-2.5 py-1 outline-none\",\n \"hover:text-ui-fg-base\",\n \"focus-visible:border-ui-border-interactive focus-visible:!shadow-borders-focus focus-visible:bg-ui-bg-base\",\n \"data-[state=active]:text-ui-fg-base data-[state=active]:bg-ui-bg-base data-[state=active]:shadow-elevation-card-rest\",\n className\n )}\n {...props}\n >\n {children}\n </RadixTabs.Trigger>\n))\nTabsTrigger.displayName = \"Tabs.Trigger\"\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof RadixTabs.List>,\n React.ComponentPropsWithoutRef<typeof RadixTabs.List>\n>(({ className, ...props }, ref) => (\n <RadixTabs.List\n ref={ref}\n className={clx(\"flex items-center gap-2\", className)}\n {...props}\n />\n))\nTabsList.displayName = \"Tabs.List\"\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof RadixTabs.Content>,\n React.ComponentPropsWithoutRef<typeof RadixTabs.Content>\n>(({ className, ...props }, ref) => (\n <RadixTabs.Content\n ref={ref}\n className={clx(\"outline-none\", className)}\n {...props}\n />\n))\nTabsContent.displayName = \"Tabs.Content\"\n\nconst Tabs = Object.assign(TabsRoot, {\n Trigger: TabsTrigger,\n List: TabsList,\n Content: TabsContent,\n})\n\nexport { Tabs }\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAO,MAAM,KAAK,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgFhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EACzC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,EAAE,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,KAAK,CAAA;CAC1B;AAED;;GAEG;AACH,QAAA,MAAM,IAAI,wFAiDT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.Text = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
|
-
const react_slot_1 = require("@radix-ui/react-slot");
|
6
5
|
const cva_1 = require("cva");
|
6
|
+
const radix_ui_1 = require("radix-ui");
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
8
8
|
const clx_1 = require("../../utils/clx");
|
9
9
|
const textVariants = (0, cva_1.cva)({
|
@@ -116,7 +116,7 @@ family = "sans",
|
|
116
116
|
* The text's line height.
|
117
117
|
*/
|
118
118
|
leading = "normal", children, ...props }, ref) => {
|
119
|
-
const Component = asChild ?
|
119
|
+
const Component = asChild ? radix_ui_1.Slot.Root : as;
|
120
120
|
return (React.createElement(Component, { ref: ref, className: (0, clx_1.clx)(textVariants({ size, weight, family, leading }), className), ...props }, children));
|
121
121
|
});
|
122
122
|
exports.Text = Text;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":";;;;AAAA,
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/components/text/text.tsx"],"names":[],"mappings":";;;;AAAA,6BAAuC;AACvC,uCAA+B;AAC/B,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,YAAY,GAAG,IAAA,SAAG,EAAC;IACvB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,MAAM,EAAE;YACN,OAAO,EAAE,aAAa;YACtB,IAAI,EAAE,aAAa;SACpB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,WAAW;SAClB;QACD,OAAO,EAAE;YACP,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,EAAE;SACZ;KACF;IACD,eAAe,EAAE;QACf,MAAM,EA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,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,GAAG,KAAK,EACE,EACZ,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,eAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IAE1C,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAC/C,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AAGQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA","sourcesContent":["import { VariantProps, cva } from \"cva\"\nimport { Slot } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst textVariants = cva({\n variants: {\n size: {\n xsmall: \"\",\n small: \"\",\n base: \"\",\n large: \"\",\n xlarge: \"\",\n },\n weight: {\n regular: \"font-normal\",\n plus: \"font-medium\",\n },\n family: {\n sans: \"font-sans\",\n mono: \"font-mono\",\n },\n leading: {\n normal: \"\",\n compact: \"\",\n },\n },\n defaultVariants: {\n family: \"sans\",\n size: \"base\",\n weight: \"regular\",\n leading: \"normal\",\n },\n compoundVariants: [\n {\n size: \"xsmall\",\n leading: \"normal\",\n className: \"txt-xsmall\",\n },\n {\n size: \"xsmall\",\n leading: \"compact\",\n className: \"txt-compact-xsmall\",\n },\n {\n size: \"small\",\n leading: \"normal\",\n className: \"txt-small\",\n },\n {\n size: \"small\",\n leading: \"compact\",\n className: \"txt-compact-small\",\n },\n {\n size: \"base\",\n leading: \"normal\",\n className: \"txt-medium\",\n },\n {\n size: \"base\",\n leading: \"compact\",\n className: \"txt-compact-medium\",\n },\n {\n size: \"large\",\n leading: \"normal\",\n className: \"txt-large\",\n },\n {\n size: \"large\",\n leading: \"compact\",\n className: \"txt-compact-large\",\n },\n {\n size: \"xlarge\",\n leading: \"normal\",\n className: \"txt-xlarge\",\n },\n {\n size: \"xlarge\",\n leading: \"compact\",\n className: \"txt-compact-xlarge\",\n },\n ],\n})\n\nexport interface TextProps\n extends React.ComponentPropsWithoutRef<\"p\">,\n VariantProps<typeof textVariants> {\n asChild?: boolean\n as?: \"p\" | \"span\" | \"div\"\n}\n\n/**\n * This component is based on the `p` element and supports all of its props\n */\nconst Text = React.forwardRef<HTMLParagraphElement, TextProps>(\n (\n {\n className,\n /**\n * Whether to remove the wrapper `button` element and use the\n * passed child element instead.\n */\n asChild = false,\n /**\n * The wrapper element to use when `asChild` is disabled.\n */\n as = \"p\",\n /**\n * The text's size.\n */\n size = \"base\",\n /**\n * The text's font weight.\n */\n weight = \"regular\",\n /**\n * The text's font family.\n */\n family = \"sans\",\n /**\n * The text's line height.\n */\n leading = \"normal\",\n children,\n ...props\n }: TextProps,\n ref\n ) => {\n const Component = asChild ? Slot.Root : as\n\n return (\n <Component\n ref={ref}\n className={clx(\n textVariants({ size, weight, family, leading }),\n className\n )}\n {...props}\n >\n {children}\n </Component>\n )\n }\n)\nText.displayName = \"Text\"\n\nexport { Text }\n"]}
|