@medusajs/ui 4.0.5-preview-20250211104335 → 4.0.5-snapshot-20250127145424
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/blocks/data-table/components/data-table-table.js +4 -4
- package/dist/cjs/blocks/data-table/components/data-table-table.js.map +1 -1
- package/dist/cjs/blocks/data-table/index.d.ts +1 -1
- package/dist/cjs/blocks/data-table/index.d.ts.map +1 -1
- package/dist/cjs/blocks/data-table/index.js.map +1 -1
- package/dist/cjs/blocks/data-table/types.d.ts +1 -2
- package/dist/cjs/blocks/data-table/types.d.ts.map +1 -1
- package/dist/cjs/blocks/data-table/types.js.map +1 -1
- package/dist/cjs/blocks/data-table/use-data-table.d.ts +1 -2
- package/dist/cjs/blocks/data-table/use-data-table.d.ts.map +1 -1
- package/dist/cjs/blocks/data-table/use-data-table.js +1 -2
- package/dist/cjs/blocks/data-table/use-data-table.js.map +1 -1
- package/dist/cjs/components/alert/alert.d.ts.map +1 -1
- package/dist/cjs/components/alert/alert.js +0 -1
- package/dist/cjs/components/alert/alert.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/calender/calendar.d.ts.map +1 -1
- package/dist/cjs/components/calender/calendar.js +0 -1
- package/dist/cjs/components/calender/calendar.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 +7 -10
- 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/cjs/index.d.ts +0 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -3
- package/dist/cjs/index.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/blocks/data-table/components/data-table-table.js +4 -4
- package/dist/esm/blocks/data-table/components/data-table-table.js.map +1 -1
- package/dist/esm/blocks/data-table/index.d.ts +1 -1
- package/dist/esm/blocks/data-table/index.d.ts.map +1 -1
- package/dist/esm/blocks/data-table/index.js.map +1 -1
- package/dist/esm/blocks/data-table/types.d.ts +1 -2
- package/dist/esm/blocks/data-table/types.d.ts.map +1 -1
- package/dist/esm/blocks/data-table/types.js.map +1 -1
- package/dist/esm/blocks/data-table/use-data-table.d.ts +1 -2
- package/dist/esm/blocks/data-table/use-data-table.d.ts.map +1 -1
- package/dist/esm/blocks/data-table/use-data-table.js +1 -2
- package/dist/esm/blocks/data-table/use-data-table.js.map +1 -1
- package/dist/esm/components/alert/alert.d.ts.map +1 -1
- package/dist/esm/components/alert/alert.js +0 -1
- package/dist/esm/components/alert/alert.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/calender/calendar.d.ts.map +1 -1
- package/dist/esm/components/calender/calendar.js +0 -1
- package/dist/esm/components/calender/calendar.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 +2 -5
- 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/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +20 -6
- package/dist/cjs/components/divider/divider.d.ts +0 -8
- package/dist/cjs/components/divider/divider.d.ts.map +0 -1
- package/dist/cjs/components/divider/divider.js +0 -17
- package/dist/cjs/components/divider/divider.js.map +0 -1
- package/dist/cjs/components/divider/index.d.ts +0 -2
- package/dist/cjs/components/divider/index.d.ts.map +0 -1
- package/dist/cjs/components/divider/index.js +0 -5
- package/dist/cjs/components/divider/index.js.map +0 -1
- package/dist/cjs/utils/is-input-element.d.ts +0 -3
- package/dist/cjs/utils/is-input-element.d.ts.map +0 -1
- package/dist/cjs/utils/is-input-element.js +0 -12
- package/dist/cjs/utils/is-input-element.js.map +0 -1
- package/dist/esm/components/divider/divider.d.ts +0 -8
- package/dist/esm/components/divider/divider.d.ts.map +0 -1
- package/dist/esm/components/divider/divider.js +0 -12
- package/dist/esm/components/divider/divider.js.map +0 -1
- package/dist/esm/components/divider/index.d.ts +0 -2
- package/dist/esm/components/divider/index.d.ts.map +0 -1
- package/dist/esm/components/divider/index.js +0 -2
- package/dist/esm/components/divider/index.js.map +0 -1
- package/dist/esm/utils/is-input-element.d.ts +0 -3
- package/dist/esm/utils/is-input-element.d.ts.map +0 -1
- package/dist/esm/utils/is-input-element.js +0 -9
- package/dist/esm/utils/is-input-element.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-bar.js","sourceRoot":"","sources":["../../../../src/components/command-bar/command-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,
|
1
|
+
{"version":3,"file":"command-bar.js","sourceRoot":"","sources":["../../../../src/components/command-bar/command-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AASjC;;GAE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ACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;QACxD,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEhC,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,4IAA4I,EAC5I,mRAAmR,EACnR,sCAAsC,EACtC,SAAS,CACV,EACD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,KACX,KAAK;QAET,kCAAO,KAAK,CAAQ;QACpB,oBAAC,GAAG,IAAC,SAAS,EAAC,uFAAuF,IACnG,QAAQ,CAAC,WAAW,EAAE,CACnB,CACC,CACV,CAAA;AACH,CAAC,CACF,CAAA;AACD,OAAO,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACrC,OAAO;IACP,KAAK;IACL,GAAG;IACH,SAAS;CACV,CAAC,CAAA;AAEF,OAAO,EAAE,UAAU,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport * as Popover from \"@radix-ui/react-popover\"\nimport * as Portal from \"@radix-ui/react-portal\"\nimport * as React from \"react\"\n\nimport { Kbd } from \"@/components/kbd\"\nimport { clx } from \"@/utils/clx\"\n\ninterface CommandBarProps extends React.PropsWithChildren {\n open?: boolean\n onOpenChange?: (open: boolean) => void\n defaultOpen?: boolean\n disableAutoFocus?: boolean\n}\n\n/**\n * The root component of the command bar. This component manages the state of the command bar.\n */\nconst Root = ({\n /**\n * Whether to open (show) the command bar.\n */\n open = false,\n /**\n * Specify a function to handle the change of `open`'s value.\n */\n onOpenChange,\n /**\n * Whether the command bar is open by default.\n */\n defaultOpen = false,\n /**\n * Whether to disable focusing automatically on the command bar when it's opened.\n */\n disableAutoFocus = true,\n children,\n}: CommandBarProps) => {\n return (\n <Popover.Root\n open={open}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\n >\n <Portal.Root>\n <Popover.Anchor\n className={clx(\"fixed bottom-8 left-1/2 h-px w-px -translate-x-1/2\")}\n />\n </Portal.Root>\n <Popover.Portal>\n <Popover.Content\n side=\"top\"\n sideOffset={0}\n onOpenAutoFocus={(e) => {\n if (disableAutoFocus) {\n e.preventDefault()\n }\n }}\n className={clx(\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-[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 >\n {children}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n )\n}\nRoot.displayName = \"CommandBar\"\n\n/**\n * The value component of the command bar. This component is used to display a value,\n * such as the number of selected items which the commands will act on.\n */\nconst Value = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\n \"txt-compact-small-plus text-ui-contrast-fg-secondary px-3 py-2.5\",\n className\n )}\n {...props}\n />\n )\n})\nValue.displayName = \"CommandBar.Value\"\n\n/**\n * The bar component of the command bar. This component is used to display the commands.\n */\nconst Bar = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\n \"bg-ui-contrast-bg-base relative flex items-center overflow-hidden rounded-full px-1\",\n \"after:shadow-elevation-flyout after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:content-['']\",\n className\n )}\n {...props}\n />\n )\n})\nBar.displayName = \"CommandBar.Bar\"\n\n/**\n * The seperator component of the command bar. This component is used to display a seperator between commands.\n */\nconst Seperator = React.forwardRef<\n HTMLDivElement,\n Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\"bg-ui-contrast-border-base h-10 w-px\", className)}\n {...props}\n />\n )\n})\nSeperator.displayName = \"CommandBar.Seperator\"\n\ninterface CommandProps\n extends Omit<\n React.ComponentPropsWithoutRef<\"button\">,\n \"children\" | \"onClick\"\n > {\n action: () => void | Promise<void>\n label: string\n shortcut: string\n}\n\n/**\n * The command component of the command bar. This component is used to display a command, as well as registering the keyboad shortcut.\n */\nconst Command = React.forwardRef<HTMLButtonElement, CommandProps>(\n (\n {\n className,\n /**\n * @ignore\n */\n type = \"button\",\n /**\n * The command's label.\n */\n label,\n /**\n * The function to execute when the command is triggered.\n */\n action,\n /**\n * The command's shortcut\n */\n shortcut,\n disabled,\n ...props\n }: CommandProps,\n ref\n ) => {\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() === shortcut.toLowerCase()) {\n event.preventDefault()\n event.stopPropagation()\n action()\n }\n }\n\n if (!disabled) {\n document.addEventListener(\"keydown\", handleKeyDown)\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown)\n }\n }, [action, shortcut, disabled])\n\n return (\n <button\n ref={ref}\n className={clx(\n \"bg-ui-contrast-bg-base txt-compact-small-plus transition-fg text-ui-contrast-fg-primary flex items-center gap-x-2 px-3 py-2.5 outline-none\",\n \"focus-visible:bg-ui-contrast-bg-highlight focus-visible:hover:bg-ui-contrast-bg-base-hover hover:bg-ui-contrast-bg-base-hover active:bg-ui-contrast-bg-base-pressed focus-visible:active:bg-ui-contrast-bg-base-pressed disabled:!bg-ui-bg-disabled disabled:!text-ui-fg-disabled\",\n \"last-of-type:-mr-1 last-of-type:pr-4\",\n className\n )}\n type={type}\n onClick={action}\n {...props}\n >\n <span>{label}</span>\n <Kbd className=\"bg-ui-contrast-bg-subtle border-ui-contrast-border-base text-ui-contrast-fg-secondary\">\n {shortcut.toUpperCase()}\n </Kbd>\n </button>\n )\n }\n)\nCommand.displayName = \"CommandBar.Command\"\n\nconst CommandBar = Object.assign(Root, {\n Command,\n Value,\n Bar,\n Seperator,\n})\n\nexport { CommandBar }\n"]}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import { Tooltip } from "../tooltip";
|
3
3
|
import { clx } from "../../utils/clx";
|
4
4
|
import { CheckCircleMiniSolid, CheckCircleSolid, SquareTwoStack, SquareTwoStackMini, } from "@medusajs/icons";
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
5
6
|
import copy from "copy-to-clipboard";
|
6
|
-
import { Slot } from "radix-ui";
|
7
7
|
import React, { useState } from "react";
|
8
8
|
/**
|
9
9
|
* This component is based on the `button` element and supports all of its props
|
@@ -46,7 +46,7 @@ asChild = false, ...props }, ref) => {
|
|
46
46
|
return variant === "default";
|
47
47
|
};
|
48
48
|
const isDefault = isDefaultVariant(variant);
|
49
|
-
const Component = asChild ? Slot
|
49
|
+
const Component = asChild ? Slot : "button";
|
50
50
|
return (React.createElement(Tooltip, { content: text, open: done || open, onOpenChange: setOpen },
|
51
51
|
React.createElement(Component, { ref: ref, "aria-label": "Copy code snippet", type: "button", className: clx("h-fit w-fit", className), onClick: copyToClipboard, ...props }, children ? (children) : done ? (isDefault ? (React.createElement(CheckCircleSolid, { className: "text-ui-fg-subtle" })) : (React.createElement(CheckCircleMiniSolid, { className: "text-ui-fg-subtle" }))) : isDefault ? (React.createElement(SquareTwoStack, { className: "text-ui-fg-subtle" })) : (React.createElement(SquareTwoStackMini, { className: "text-ui-fg-subtle" })))));
|
52
52
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/components/copy/copy.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,iBA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ACS,CACJ,CACX,CAAA;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { Tooltip } from \"@/components/tooltip\"\nimport { clx } from \"@/utils/clx\"\nimport {\n CheckCircleMiniSolid,\n CheckCircleSolid,\n SquareTwoStack,\n SquareTwoStackMini,\n} from \"@medusajs/icons\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport copy from \"copy-to-clipboard\"\nimport React, { useState } from \"react\"\n\ntype CopyProps = React.HTMLAttributes<HTMLButtonElement> & {\n content: string\n variant?: \"mini\" | \"default\" | null\n asChild?: boolean\n}\n\n/**\n * This component is based on the `button` element and supports all of its props\n */\nconst Copy = React.forwardRef<HTMLButtonElement, CopyProps>(\n (\n {\n children,\n className,\n /**\n * The content to copy.\n */\n content,\n /**\n * The variant of the copy button.\n */\n variant = \"default\",\n /**\n * Whether to remove the wrapper `button` element and use the\n * passed child element instead.\n */\n asChild = false,\n ...props\n }: CopyProps,\n ref\n ) => {\n const [done, setDone] = useState(false)\n const [open, setOpen] = useState(false)\n const [text, setText] = useState(\"Copy\")\n\n const copyToClipboard = (\n e:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => {\n e.stopPropagation()\n\n setDone(true)\n copy(content)\n\n setTimeout(() => {\n setDone(false)\n }, 2000)\n }\n\n React.useEffect(() => {\n if (done) {\n setText(\"Copied\")\n return\n }\n\n setTimeout(() => {\n setText(\"Copy\")\n }, 500)\n }, [done])\n\n const isDefaultVariant = (\n variant?: string | null\n ): variant is \"default\" => {\n return variant === \"default\"\n }\n\n const isDefault = isDefaultVariant(variant)\n\n const Component = asChild ? Slot : \"button\"\n\n return (\n <Tooltip content={text} open={done || open} onOpenChange={setOpen}>\n <Component\n ref={ref}\n aria-label=\"Copy code snippet\"\n type=\"button\"\n className={clx(\n \"h-fit w-fit\",\n className\n )}\n onClick={copyToClipboard}\n {...props}\n >\n {children ? (\n children\n ) : done ? (\n isDefault ? (\n <CheckCircleSolid className=\"text-ui-fg-subtle\" />\n ) : (\n <CheckCircleMiniSolid className=\"text-ui-fg-subtle\" />\n )\n ) : isDefault ? (\n <SquareTwoStack className=\"text-ui-fg-subtle\" />\n ) : (\n <SquareTwoStackMini className=\"text-ui-fg-subtle\" />\n )}\n </Component>\n </Tooltip>\n )\n }\n)\nCopy.displayName = \"Copy\"\n\nexport { Copy }\n"]}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import * as DrawerPrimitives from "@radix-ui/react-dialog";
|
2
2
|
import * as React from "react";
|
3
|
-
interface DrawerRootProps extends React.ComponentPropsWithoutRef<typeof
|
3
|
+
interface DrawerRootProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Root> {
|
4
4
|
}
|
5
|
-
interface DrawerTriggerProps extends React.ComponentPropsWithoutRef<typeof
|
5
|
+
interface DrawerTriggerProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Trigger> {
|
6
6
|
}
|
7
|
-
interface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof
|
7
|
+
interface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Close> {
|
8
8
|
}
|
9
|
-
interface DrawerPortalProps extends
|
9
|
+
interface DrawerPortalProps extends DrawerPrimitives.DialogPortalProps {
|
10
10
|
}
|
11
11
|
/**
|
12
12
|
* The `Drawer.Content` component uses this component to wrap the drawer content.
|
@@ -16,14 +16,14 @@ declare const DrawerPortal: {
|
|
16
16
|
(props: DrawerPortalProps): React.JSX.Element;
|
17
17
|
displayName: string;
|
18
18
|
};
|
19
|
-
interface DrawerOverlayProps extends React.ComponentPropsWithoutRef<typeof
|
19
|
+
interface DrawerOverlayProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Overlay> {
|
20
20
|
}
|
21
21
|
/**
|
22
22
|
* This component is used to create the overlay for the drawer.
|
23
23
|
* It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.
|
24
24
|
*/
|
25
25
|
declare const DrawerOverlay: React.ForwardRefExoticComponent<DrawerOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
26
|
-
interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeof
|
26
|
+
interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Content> {
|
27
27
|
/**
|
28
28
|
* Props for the overlay component.
|
29
29
|
* It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.
|
@@ -41,7 +41,7 @@ interface DrawerBodyProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
41
41
|
}
|
42
42
|
interface DrawerFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
43
43
|
}
|
44
|
-
interface DrawerDescriptionProps extends React.ComponentPropsWithoutRef<typeof
|
44
|
+
interface DrawerDescriptionProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Description> {
|
45
45
|
}
|
46
46
|
declare const Drawer: {
|
47
47
|
(props: DrawerRootProps): React.JSX.Element;
|
@@ -56,7 +56,7 @@ declare const Drawer: {
|
|
56
56
|
displayName: string;
|
57
57
|
};
|
58
58
|
Header: React.ForwardRefExoticComponent<DrawerHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
59
|
-
Title: React.ForwardRefExoticComponent<
|
59
|
+
Title: React.ForwardRefExoticComponent<DrawerPrimitives.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
60
60
|
Trigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
61
61
|
};
|
62
62
|
export { Drawer };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../src/components/drawer/drawer.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
1
|
+
{"version":3,"file":"draw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C,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,WAAW,CAAC;CAAG;AAqB/G,QAAA,MAAM,MAAM;YA/MH,eAAe;;;;;;;;kCAsKrB,iBAAiB;;;;;;CAkDlB,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { XMark } from "@medusajs/icons";
|
3
|
-
import
|
3
|
+
import * as DrawerPrimitives from "@radix-ui/react-dialog";
|
4
4
|
import * as React from "react";
|
5
5
|
import { IconButton } from "../icon-button";
|
6
6
|
import { Kbd } from "../kbd";
|
@@ -10,7 +10,7 @@ import { clx } from "../../utils/clx";
|
|
10
10
|
* This component is based on the [Radix UI Dialog](https://www.radix-ui.com/primitives/docs/components/dialog) primitives.
|
11
11
|
*/
|
12
12
|
const DrawerRoot = (props) => {
|
13
|
-
return React.createElement(
|
13
|
+
return React.createElement(DrawerPrimitives.Root, { ...props });
|
14
14
|
};
|
15
15
|
DrawerRoot.displayName = "Drawer";
|
16
16
|
/**
|
@@ -18,7 +18,7 @@ DrawerRoot.displayName = "Drawer";
|
|
18
18
|
* It accepts props from the [Radix UI Dialog Trigger](https://www.radix-ui.com/primitives/docs/components/dialog#trigger) component.
|
19
19
|
*/
|
20
20
|
const DrawerTrigger = React.forwardRef(({ className, ...props }, ref) => {
|
21
|
-
return (React.createElement(
|
21
|
+
return (React.createElement(DrawerPrimitives.Trigger, { ref: ref, className: clx(className), ...props }));
|
22
22
|
});
|
23
23
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
24
24
|
/**
|
@@ -26,7 +26,7 @@ DrawerTrigger.displayName = "Drawer.Trigger";
|
|
26
26
|
* It accepts props from the [Radix UI Dialog Close](https://www.radix-ui.com/primitives/docs/components/dialog#close) component.
|
27
27
|
*/
|
28
28
|
const DrawerClose = React.forwardRef(({ className, ...props }, ref) => {
|
29
|
-
return (React.createElement(
|
29
|
+
return (React.createElement(DrawerPrimitives.Close, { ref: ref, className: clx(className), ...props }));
|
30
30
|
});
|
31
31
|
DrawerClose.displayName = "Drawer.Close";
|
32
32
|
/**
|
@@ -34,7 +34,7 @@ DrawerClose.displayName = "Drawer.Close";
|
|
34
34
|
* It accepts props from the [Radix UI Dialog Portal](https://www.radix-ui.com/primitives/docs/components/dialog#portal) component.
|
35
35
|
*/
|
36
36
|
const DrawerPortal = (props) => {
|
37
|
-
return React.createElement(
|
37
|
+
return React.createElement(DrawerPrimitives.DialogPortal, { ...props });
|
38
38
|
};
|
39
39
|
DrawerPortal.displayName = "Drawer.Portal";
|
40
40
|
/**
|
@@ -42,7 +42,7 @@ DrawerPortal.displayName = "Drawer.Portal";
|
|
42
42
|
* It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.
|
43
43
|
*/
|
44
44
|
const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => {
|
45
|
-
return (React.createElement(
|
45
|
+
return (React.createElement(DrawerPrimitives.Overlay, { ref: ref, className: clx("bg-ui-bg-overlay fixed inset-0", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props }));
|
46
46
|
});
|
47
47
|
DrawerOverlay.displayName = "Drawer.Overlay";
|
48
48
|
/**
|
@@ -52,7 +52,7 @@ DrawerOverlay.displayName = "Drawer.Overlay";
|
|
52
52
|
const DrawerContent = React.forwardRef(({ className, overlayProps, portalProps, ...props }, ref) => {
|
53
53
|
return (React.createElement(DrawerPortal, { ...portalProps },
|
54
54
|
React.createElement(DrawerOverlay, { ...overlayProps }),
|
55
|
-
React.createElement(
|
55
|
+
React.createElement(DrawerPrimitives.Content, { ref: ref, className: clx("bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 flex w-full flex-1 flex-col rounded-lg border outline-none max-sm:inset-x-2 max-sm:w-[calc(100%-16px)] sm:right-2 sm:max-w-[560px]", "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]:slide-out-to-right-1/2 data-[state=open]:slide-in-from-right-1/2 duration-200", className), ...props })));
|
56
56
|
});
|
57
57
|
DrawerContent.displayName = "Drawer.Content";
|
58
58
|
/**
|
@@ -64,7 +64,7 @@ const DrawerHeader = React.forwardRef(({ children, className, ...props }, ref) =
|
|
64
64
|
React.createElement("div", { className: clx("flex flex-col gap-y-1", className) }, children),
|
65
65
|
React.createElement("div", { className: "flex items-center gap-x-2" },
|
66
66
|
React.createElement(Kbd, null, "esc"),
|
67
|
-
React.createElement(
|
67
|
+
React.createElement(DrawerPrimitives.Close, { asChild: true },
|
68
68
|
React.createElement(IconButton, { size: "small", type: "button", variant: "transparent" },
|
69
69
|
React.createElement(XMark, null))))));
|
70
70
|
});
|
@@ -89,13 +89,13 @@ DrawerFooter.displayName = "Drawer.Footer";
|
|
89
89
|
* This component adds an accessible title to the drawer.
|
90
90
|
* It accepts props from the [Radix UI Dialog Title](https://www.radix-ui.com/primitives/docs/components/dialog#title) component.
|
91
91
|
*/
|
92
|
-
const DrawerTitle =
|
92
|
+
const DrawerTitle = DrawerPrimitives.Title;
|
93
93
|
DrawerTitle.displayName = "Drawer.Title";
|
94
94
|
/**
|
95
95
|
* This component adds accessible description to the drawer.
|
96
96
|
* It accepts props from the [Radix UI Dialog Description](https://www.radix-ui.com/primitives/docs/components/dialog#description) component.
|
97
97
|
*/
|
98
|
-
const DrawerDescription = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(
|
98
|
+
const DrawerDescription = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DrawerPrimitives.Description, { ref: ref, className: clx(className), asChild: true, ...props },
|
99
99
|
React.createElement(Text, null, children))));
|
100
100
|
DrawerDescription.displayName = "Drawer.Description";
|
101
101
|
const Drawer = Object.assign(DrawerRoot, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer.tsx"],"names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oBAAC,WAAW,CAAC,WAAW,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,EACzB,OAAO,WACH,KAAK;IAET,oBAAC,IAAI,QAAE,QAAQ,CAAQ,CACC,CAC3B,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAEpD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;IACvC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,iBAAiB;IAC9B,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;CACvB,CAAC,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport { Dialog as RadixDialog } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { IconButton } from \"@/components/icon-button\"\nimport { Kbd } from \"@/components/kbd\"\nimport { Text } from \"@/components/text\"\nimport { clx } from \"@/utils/clx\"\n\ninterface DrawerRootProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Root> {}\n\n/**\n * This component is based on the [Radix UI Dialog](https://www.radix-ui.com/primitives/docs/components/dialog) primitives.\n */\nconst DrawerRoot = (\n props: DrawerRootProps\n) => {\n return <RadixDialog.Root {...props} />\n}\nDrawerRoot.displayName = \"Drawer\"\n\ninterface DrawerTriggerProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Trigger> {}\n\n/**\n * This component is used to create the trigger button that opens the drawer.\n * It accepts props from the [Radix UI Dialog Trigger](https://www.radix-ui.com/primitives/docs/components/dialog#trigger) component.\n */\nconst DrawerTrigger = React.forwardRef<\n React.ElementRef<typeof RadixDialog.Trigger>,\n DrawerTriggerProps\n>(({ className, ...props }: DrawerTriggerProps, ref) => {\n return (\n <RadixDialog.Trigger ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerTrigger.displayName = \"Drawer.Trigger\"\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Close> {}\n\n/**\n * This component is used to create the close button for the drawer.\n * It accepts props from the [Radix UI Dialog Close](https://www.radix-ui.com/primitives/docs/components/dialog#close) component.\n */\nconst DrawerClose = React.forwardRef<\n React.ElementRef<typeof RadixDialog.Close>,\n DrawerCloseProps\n>(({ className, ...props }: DrawerCloseProps, ref) => {\n return (\n <RadixDialog.Close ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerClose.displayName = \"Drawer.Close\"\n\ninterface DrawerPortalProps extends RadixDialog.DialogPortalProps {}\n\n/**\n * The `Drawer.Content` component uses this component to wrap the drawer content.\n * It accepts props from the [Radix UI Dialog Portal](https://www.radix-ui.com/primitives/docs/components/dialog#portal) component.\n */\nconst DrawerPortal = (props: DrawerPortalProps) => {\n return <RadixDialog.DialogPortal {...props} />\n}\nDrawerPortal.displayName = \"Drawer.Portal\"\n\ninterface DrawerOverlayProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Overlay> {}\n\n/**\n * This component is used to create the overlay for the drawer.\n * It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.\n */\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof RadixDialog.Overlay>,\n DrawerOverlayProps\n>(({ className, ...props }: DrawerOverlayProps, ref) => {\n return (\n <RadixDialog.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})\nDrawerOverlay.displayName = \"Drawer.Overlay\"\n\ninterface DrawerContentProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Content> {\n /**\n * Props for the overlay component.\n * It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.\n */\n overlayProps?: React.ComponentPropsWithoutRef<typeof DrawerOverlay>\n /**\n * Props for the portal component that wraps the drawer content.\n * It accepts props from the [Radix UI Dialog Portal](https://www.radix-ui.com/primitives/docs/components/dialog#portal) component.\n */\n portalProps?: React.ComponentPropsWithoutRef<typeof DrawerPortal>\n}\n\n/**\n * This component wraps the content of the drawer.\n * It accepts props from the [Radix UI Dialog Content](https://www.radix-ui.com/primitives/docs/components/dialog#content) component.\n */\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof RadixDialog.Content>,\n DrawerContentProps\n>(({ className, overlayProps, portalProps, ...props }: DrawerContentProps, ref) => {\n return (\n <DrawerPortal {...portalProps}>\n <DrawerOverlay {...overlayProps} />\n <RadixDialog.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 flex w-full flex-1 flex-col rounded-lg border outline-none max-sm:inset-x-2 max-sm:w-[calc(100%-16px)] sm:right-2 sm:max-w-[560px]\",\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]:slide-out-to-right-1/2 data-[state=open]:slide-in-from-right-1/2 duration-200\",\n className\n )}\n {...props}\n />\n </DrawerPortal>\n )\n})\nDrawerContent.displayName = \"Drawer.Content\"\n\ninterface DrawerHeaderProps extends React.ComponentPropsWithoutRef<\"div\"> {}\n\n/**\n * This component is used to wrap the header content of the drawer.\n * This component is based on the `div` element and supports all of its props.\n */\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n DrawerHeaderProps\n>(({ children, className, ...props }: DrawerHeaderProps, ref) => {\n return (\n <div\n ref={ref}\n className=\"border-ui-border-base flex items-start justify-between gap-x-4 border-b px-6 py-4\"\n {...props}\n >\n <div className={clx(\"flex flex-col gap-y-1\", className)}>{children}</div>\n <div className=\"flex items-center gap-x-2\">\n <Kbd>esc</Kbd>\n <RadixDialog.Close asChild>\n <IconButton size=\"small\" type=\"button\" variant=\"transparent\">\n <XMark />\n </IconButton>\n </RadixDialog.Close>\n </div>\n </div>\n )\n})\nDrawerHeader.displayName = \"Drawer.Header\"\n\ninterface DrawerBodyProps extends React.ComponentPropsWithoutRef<\"div\"> {}\n\n/**\n * This component is used to wrap the body content of the drawer.\n * This component is based on the `div` element and supports all of its props\n */\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n DrawerBodyProps\n>(({ className, ...props }: DrawerBodyProps, ref) => {\n return (\n <div ref={ref} className={clx(\"flex-1 px-6 py-4\", className)} {...props} />\n )\n})\nDrawerBody.displayName = \"Drawer.Body\"\n\ninterface DrawerFooterProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * This component is used to wrap the footer content of the drawer.\n * This component is based on the `div` element and supports all of its props.\n */\nconst DrawerFooter = ({\n className,\n ...props\n}: DrawerFooterProps) => {\n return (\n <div\n className={clx(\n \"border-ui-border-base flex items-center justify-end space-x-2 overflow-y-auto border-t px-6 py-4\",\n className\n )}\n {...props}\n />\n )\n}\nDrawerFooter.displayName = \"Drawer.Footer\"\n\n/**\n * This component adds an accessible title to the drawer.\n * It accepts props from the [Radix UI Dialog Title](https://www.radix-ui.com/primitives/docs/components/dialog#title) component.\n */\nconst DrawerTitle = RadixDialog.Title\nDrawerTitle.displayName = \"Drawer.Title\"\n\ninterface DrawerDescriptionProps extends React.ComponentPropsWithoutRef<typeof RadixDialog.Description> {}\n\n/**\n * This component adds accessible description to the drawer.\n * It accepts props from the [Radix UI Dialog Description](https://www.radix-ui.com/primitives/docs/components/dialog#description) component.\n */\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof RadixDialog.Description>,\n DrawerDescriptionProps\n>(({ className, children, ...props }: DrawerDescriptionProps, ref) => (\n <RadixDialog.Description\n ref={ref}\n className={clx(className)}\n asChild\n {...props}\n >\n <Text>{children}</Text>\n </RadixDialog.Description>\n))\nDrawerDescription.displayName = \"Drawer.Description\"\n\nconst Drawer = Object.assign(DrawerRoot, {\n Body: DrawerBody,\n Close: DrawerClose,\n Content: DrawerContent,\n Description: DrawerDescription,\n Footer: DrawerFooter,\n Header: DrawerHeader,\n Title: DrawerTitle,\n Trigger: DrawerTrigger,\n})\n\nexport { Drawer }\n"]}
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAIjC;;GAEG;AACH,MAAM,UAAU,GAAG,CACjB,KAAsB,EACtB,EAAE;IACF,OAAO,oBAAC,gBAAgB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AAC7C,CAAC,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,QAAQ,CAAA;AAIjC;;;GAGG;AACH,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsB,EAAE,GAAG,EAAE,EAAE;IACrD,OAAO,CACL,oBAAC,gBAAgB,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAAM,KAAK,GAAI,CAC7E,CAAA;AACH,CAAC,CAAC,CAAA;AACF,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAI5C;;;GAGG;AACH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,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;;GAGG;AACH,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAA;AAC1C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAA;AAIxC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA0B,EAAE,GAAG,EAAE,EAAE,CAAC,CACpE,oBAAC,gBAAgB,CAAC,WAAW,IAC3B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,EACzB,OAAO,WACH,KAAK;IAET,oBAAC,IAAI,QAAE,QAAQ,CAAQ,CACM,CAChC,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAEpD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;IACvC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,iBAAiB;IAC9B,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;CACvB,CAAC,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as DrawerPrimitives from \"@radix-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { IconButton } from \"@/components/icon-button\"\nimport { Kbd } from \"@/components/kbd\"\nimport { Text } from \"@/components/text\"\nimport { clx } from \"@/utils/clx\"\n\ninterface DrawerRootProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Root> {}\n\n/**\n * This component is based on the [Radix UI Dialog](https://www.radix-ui.com/primitives/docs/components/dialog) primitives.\n */\nconst DrawerRoot = (\n props: DrawerRootProps\n) => {\n return <DrawerPrimitives.Root {...props} />\n}\nDrawerRoot.displayName = \"Drawer\"\n\ninterface DrawerTriggerProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Trigger> {}\n\n/**\n * This component is used to create the trigger button that opens the drawer.\n * It accepts props from the [Radix UI Dialog Trigger](https://www.radix-ui.com/primitives/docs/components/dialog#trigger) component.\n */\nconst DrawerTrigger = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Trigger>,\n DrawerTriggerProps\n>(({ className, ...props }: DrawerTriggerProps, ref) => {\n return (\n <DrawerPrimitives.Trigger ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerTrigger.displayName = \"Drawer.Trigger\"\n\ninterface DrawerCloseProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Close> {}\n\n/**\n * This component is used to create the close button for the drawer.\n * It accepts props from the [Radix UI Dialog Close](https://www.radix-ui.com/primitives/docs/components/dialog#close) component.\n */\nconst DrawerClose = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Close>,\n DrawerCloseProps\n>(({ className, ...props }: DrawerCloseProps, ref) => {\n return (\n <DrawerPrimitives.Close ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerClose.displayName = \"Drawer.Close\"\n\ninterface DrawerPortalProps extends DrawerPrimitives.DialogPortalProps {}\n\n/**\n * The `Drawer.Content` component uses this component to wrap the drawer content.\n * It accepts props from the [Radix UI Dialog Portal](https://www.radix-ui.com/primitives/docs/components/dialog#portal) component.\n */\nconst DrawerPortal = (props: DrawerPortalProps) => {\n return <DrawerPrimitives.DialogPortal {...props} />\n}\nDrawerPortal.displayName = \"Drawer.Portal\"\n\ninterface DrawerOverlayProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Overlay> {}\n\n/**\n * This component is used to create the overlay for the drawer.\n * It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.\n */\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Overlay>,\n DrawerOverlayProps\n>(({ className, ...props }: DrawerOverlayProps, ref) => {\n return (\n <DrawerPrimitives.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})\nDrawerOverlay.displayName = \"Drawer.Overlay\"\n\ninterface DrawerContentProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Content> {\n /**\n * Props for the overlay component.\n * It accepts props from the [Radix UI Dialog Overlay](https://www.radix-ui.com/primitives/docs/components/dialog#overlay) component.\n */\n overlayProps?: React.ComponentPropsWithoutRef<typeof DrawerOverlay>\n /**\n * Props for the portal component that wraps the drawer content.\n * It accepts props from the [Radix UI Dialog Portal](https://www.radix-ui.com/primitives/docs/components/dialog#portal) component.\n */\n portalProps?: React.ComponentPropsWithoutRef<typeof DrawerPortal>\n}\n\n/**\n * This component wraps the content of the drawer.\n * It accepts props from the [Radix UI Dialog Content](https://www.radix-ui.com/primitives/docs/components/dialog#content) component.\n */\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Content>,\n DrawerContentProps\n>(({ className, overlayProps, portalProps, ...props }: DrawerContentProps, ref) => {\n return (\n <DrawerPortal {...portalProps}>\n <DrawerOverlay {...overlayProps} />\n <DrawerPrimitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 flex w-full flex-1 flex-col rounded-lg border outline-none max-sm:inset-x-2 max-sm:w-[calc(100%-16px)] sm:right-2 sm:max-w-[560px]\",\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]:slide-out-to-right-1/2 data-[state=open]:slide-in-from-right-1/2 duration-200\",\n className\n )}\n {...props}\n />\n </DrawerPortal>\n )\n})\nDrawerContent.displayName = \"Drawer.Content\"\n\ninterface DrawerHeaderProps extends React.ComponentPropsWithoutRef<\"div\"> {}\n\n/**\n * This component is used to wrap the header content of the drawer.\n * This component is based on the `div` element and supports all of its props.\n */\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n DrawerHeaderProps\n>(({ children, className, ...props }: DrawerHeaderProps, ref) => {\n return (\n <div\n ref={ref}\n className=\"border-ui-border-base flex items-start justify-between gap-x-4 border-b px-6 py-4\"\n {...props}\n >\n <div className={clx(\"flex flex-col gap-y-1\", className)}>{children}</div>\n <div className=\"flex items-center gap-x-2\">\n <Kbd>esc</Kbd>\n <DrawerPrimitives.Close asChild>\n <IconButton size=\"small\" type=\"button\" variant=\"transparent\">\n <XMark />\n </IconButton>\n </DrawerPrimitives.Close>\n </div>\n </div>\n )\n})\nDrawerHeader.displayName = \"Drawer.Header\"\n\ninterface DrawerBodyProps extends React.ComponentPropsWithoutRef<\"div\"> {}\n\n/**\n * This component is used to wrap the body content of the drawer.\n * This component is based on the `div` element and supports all of its props\n */\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n DrawerBodyProps\n>(({ className, ...props }: DrawerBodyProps, ref) => {\n return (\n <div ref={ref} className={clx(\"flex-1 px-6 py-4\", className)} {...props} />\n )\n})\nDrawerBody.displayName = \"Drawer.Body\"\n\ninterface DrawerFooterProps extends React.HTMLAttributes<HTMLDivElement> {}\n\n/**\n * This component is used to wrap the footer content of the drawer.\n * This component is based on the `div` element and supports all of its props.\n */\nconst DrawerFooter = ({\n className,\n ...props\n}: DrawerFooterProps) => {\n return (\n <div\n className={clx(\n \"border-ui-border-base flex items-center justify-end space-x-2 overflow-y-auto border-t px-6 py-4\",\n className\n )}\n {...props}\n />\n )\n}\nDrawerFooter.displayName = \"Drawer.Footer\"\n\n/**\n * This component adds an accessible title to the drawer.\n * It accepts props from the [Radix UI Dialog Title](https://www.radix-ui.com/primitives/docs/components/dialog#title) component.\n */\nconst DrawerTitle = DrawerPrimitives.Title\nDrawerTitle.displayName = \"Drawer.Title\"\n\ninterface DrawerDescriptionProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Description> {}\n\n/**\n * This component adds accessible description to the drawer.\n * It accepts props from the [Radix UI Dialog Description](https://www.radix-ui.com/primitives/docs/components/dialog#description) component.\n */\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Description>,\n DrawerDescriptionProps\n>(({ className, children, ...props }: DrawerDescriptionProps, ref) => (\n <DrawerPrimitives.Description\n ref={ref}\n className={clx(className)}\n asChild\n {...props}\n >\n <Text>{children}</Text>\n </DrawerPrimitives.Description>\n))\nDrawerDescription.displayName = \"Drawer.Description\"\n\nconst Drawer = Object.assign(DrawerRoot, {\n Body: DrawerBody,\n Close: DrawerClose,\n Content: DrawerContent,\n Description: DrawerDescription,\n Footer: DrawerFooter,\n Header: DrawerHeader,\n Title: DrawerTitle,\n Trigger: DrawerTrigger,\n})\n\nexport { Drawer }\n"]}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import
|
1
|
+
import * as Primitives from "@radix-ui/react-dropdown-menu";
|
2
2
|
import * as React from "react";
|
3
|
-
declare const DropdownMenu: React.FC<
|
4
|
-
Trigger: React.ForwardRefExoticComponent<
|
5
|
-
Group: React.ForwardRefExoticComponent<
|
6
|
-
SubMenu: React.FC<
|
7
|
-
SubMenuContent: React.ForwardRefExoticComponent<Omit<
|
8
|
-
SubMenuTrigger: React.ForwardRefExoticComponent<Omit<
|
9
|
-
Content: React.ForwardRefExoticComponent<Omit<
|
10
|
-
Item: React.ForwardRefExoticComponent<Omit<
|
11
|
-
CheckboxItem: React.ForwardRefExoticComponent<Omit<
|
12
|
-
RadioGroup: React.ForwardRefExoticComponent<
|
13
|
-
RadioItem: React.ForwardRefExoticComponent<Omit<
|
14
|
-
Label: React.ForwardRefExoticComponent<Omit<
|
15
|
-
Separator: React.ForwardRefExoticComponent<Omit<
|
3
|
+
declare const DropdownMenu: React.FC<Primitives.DropdownMenuProps> & {
|
4
|
+
Trigger: React.ForwardRefExoticComponent<Primitives.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
5
|
+
Group: React.ForwardRefExoticComponent<Primitives.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
SubMenu: React.FC<Primitives.DropdownMenuSubProps>;
|
7
|
+
SubMenuContent: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
SubMenuTrigger: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
Content: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
10
|
+
Item: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
11
|
+
CheckboxItem: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
RadioGroup: React.ForwardRefExoticComponent<Primitives.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
RadioItem: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
Label: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
15
|
+
Separator: React.ForwardRefExoticComponent<Omit<Primitives.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
16
16
|
Shortcut: {
|
17
17
|
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
18
18
|
displayName: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA2Q9B,QAAA,MAAM,YAAY;;;;;;;;;;;;;;kCAhCf,MAAM,cAAc,CAAC,eAAe,CAAC;;;;kCAmBrC,MAAM,cAAc,CAAC,eAAe,CAAC;;;CA4BtC,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
@@ -1,84 +1,84 @@
|
|
1
1
|
"use client";
|
2
2
|
import { CheckMini, ChevronRightMini, EllipseMiniSolid } from "@medusajs/icons";
|
3
|
-
import
|
3
|
+
import * as Primitives from "@radix-ui/react-dropdown-menu";
|
4
4
|
import * as React from "react";
|
5
5
|
import { clx } from "../../utils/clx";
|
6
6
|
/**
|
7
7
|
* This component is based on the [Radix UI Dropdown Menu](https://www.radix-ui.com/primitives/docs/components/dropdown-menu) primitive.
|
8
8
|
*/
|
9
|
-
const Root =
|
9
|
+
const Root = Primitives.Root;
|
10
10
|
Root.displayName = "DropdownMenu";
|
11
11
|
/**
|
12
12
|
* This component is based on the [Radix UI Dropdown Menu Trigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#trigger) primitive.
|
13
13
|
*/
|
14
|
-
const Trigger =
|
14
|
+
const Trigger = Primitives.Trigger;
|
15
15
|
Trigger.displayName = "DropdownMenu.Trigger";
|
16
16
|
/**
|
17
17
|
* This component is based on the [Radix UI Dropdown Menu Group](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#group) primitive.
|
18
18
|
*/
|
19
|
-
const Group =
|
19
|
+
const Group = Primitives.Group;
|
20
20
|
Group.displayName = "DropdownMenu.Group";
|
21
21
|
/**
|
22
22
|
* This component is based on the [Radix UI Dropdown Menu Sub](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#sub) primitive.
|
23
23
|
*/
|
24
|
-
const SubMenu =
|
24
|
+
const SubMenu = Primitives.Sub;
|
25
25
|
SubMenu.displayName = "DropdownMenu.SubMenu";
|
26
26
|
/**
|
27
27
|
* This component is based on the [Radix UI Dropdown Menu RadioGroup](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radiogroup) primitive.
|
28
28
|
*/
|
29
|
-
const RadioGroup =
|
29
|
+
const RadioGroup = Primitives.RadioGroup;
|
30
30
|
RadioGroup.displayName = "DropdownMenu.RadioGroup";
|
31
31
|
/**
|
32
32
|
* This component is based on the [Radix UI Dropdown Menu SubTrigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subtrigger) primitive.
|
33
33
|
*/
|
34
|
-
const SubMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(
|
34
|
+
const SubMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.SubTrigger, { ref: ref, className: clx("bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors", "focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover", "active:bg-ui-bg-component-hover", "data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none", "data-[state=open]:!bg-ui-bg-component-hover", className), ...props },
|
35
35
|
children,
|
36
36
|
React.createElement(ChevronRightMini, { className: "text-ui-fg-muted ml-auto" }))));
|
37
37
|
SubMenuTrigger.displayName = "DropdownMenu.SubMenuTrigger";
|
38
38
|
/**
|
39
39
|
* This component is based on the [Radix UI Dropdown Menu SubContent](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subcontent) primitive.
|
40
40
|
*/
|
41
|
-
const SubMenuContent = React.forwardRef(({ className, collisionPadding = 8, ...props }, ref) => (React.createElement(
|
42
|
-
React.createElement(
|
41
|
+
const SubMenuContent = React.forwardRef(({ className, collisionPadding = 8, ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
42
|
+
React.createElement(Primitives.SubContent, { ref: ref, collisionPadding: collisionPadding, className: clx("bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1", "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-[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", className), ...props }))));
|
43
43
|
SubMenuContent.displayName = "DropdownMenu.SubMenuContent";
|
44
44
|
/**
|
45
45
|
* This component is based on the [Radix UI Dropdown Menu Content](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content) primitive.
|
46
46
|
*/
|
47
|
-
const Content = React.forwardRef(({ className, sideOffset = 8, collisionPadding = 8, align = "center", ...props }, ref) => (React.createElement(
|
48
|
-
React.createElement(
|
47
|
+
const Content = React.forwardRef(({ className, sideOffset = 8, collisionPadding = 8, align = "center", ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
48
|
+
React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, align: align, collisionPadding: collisionPadding, className: clx("bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1", "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-[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", className), ...props }))));
|
49
49
|
Content.displayName = "DropdownMenu.Content";
|
50
50
|
/**
|
51
51
|
* This component is based on the [Radix UI Dropdown Menu Item](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#item) primitive.
|
52
52
|
*/
|
53
|
-
const Item = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
53
|
+
const Item = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Item, { ref: ref, className: clx("bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors", "focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover", "active:bg-ui-bg-component-hover", "data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none", className), ...props })));
|
54
54
|
Item.displayName = "DropdownMenu.Item";
|
55
55
|
/**
|
56
56
|
* This component is based on the [Radix UI Dropdown Menu CheckboxItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#checkboxitem) primitive.
|
57
57
|
*/
|
58
|
-
const CheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (React.createElement(
|
58
|
+
const CheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (React.createElement(Primitives.CheckboxItem, { ref: ref, className: clx("bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors", "focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover", "active:bg-ui-bg-component-hover", "data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none", "data-[state=checked]:txt-compact-small-plus", className), checked: checked, ...props },
|
59
59
|
React.createElement("span", { className: "absolute left-2 flex size-[15px] items-center justify-center" },
|
60
|
-
React.createElement(
|
60
|
+
React.createElement(Primitives.ItemIndicator, null,
|
61
61
|
React.createElement(CheckMini, null))),
|
62
62
|
children)));
|
63
63
|
CheckboxItem.displayName = "DropdownMenu.CheckboxItem";
|
64
64
|
/**
|
65
65
|
* This component is based on the [Radix UI Dropdown Menu RadioItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radioitem) primitive.
|
66
66
|
*/
|
67
|
-
const RadioItem = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(
|
67
|
+
const RadioItem = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.RadioItem, { ref: ref, className: clx("bg-ui-bg-component txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors", "focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover", "active:bg-ui-bg-component-hover", "data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none", "data-[state=checked]:txt-compact-small-plus", className), ...props },
|
68
68
|
React.createElement("span", { className: "absolute left-2 flex size-[15px] items-center justify-center" },
|
69
|
-
React.createElement(
|
69
|
+
React.createElement(Primitives.ItemIndicator, null,
|
70
70
|
React.createElement(EllipseMiniSolid, { className: "text-ui-fg-base" }))),
|
71
71
|
children)));
|
72
72
|
RadioItem.displayName = "DropdownMenu.RadioItem";
|
73
73
|
/**
|
74
74
|
* This component is based on the [Radix UI Dropdown Menu Label](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#label) primitive.
|
75
75
|
*/
|
76
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
76
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Label, { ref: ref, className: clx("text-ui-fg-subtle txt-compact-xsmall-plus", className), ...props })));
|
77
77
|
Label.displayName = "DropdownMenu.Label";
|
78
78
|
/**
|
79
79
|
* This component is based on the [Radix UI Dropdown Menu Separator](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#separator) primitive.
|
80
80
|
*/
|
81
|
-
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
81
|
+
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Separator, { ref: ref, className: clx("bg-ui-border-component border-t-ui-border-menu-top border-b-ui-border-menu-bot -mx-1 my-1 h-0.5 border-b border-t", className), ...props })));
|
82
82
|
Separator.displayName = "DropdownMenu.Separator";
|
83
83
|
/**
|
84
84
|
* This component is based on the `span` element and supports all of its props
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC;;GAEG;AACH,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAA;AACnC,IAAI,CAAC,WAAW,GAAG,cAAc,CAAA;AAEjC;;GAEG;AACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAA;AACzC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C;;GAEG;AACH,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAA;AACrC,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC;;GAEG;AACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAA;AACrC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C;;GAEG;AACH,MAAM,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAA;AAC/C,UAAU,CAAC,WAAW,GAAG,yBAAyB,CAAA;AAElD;;GAEG;AACH,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAGrC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,iBAAiB,CAAC,UAAU,IAC3B,GAAG,EA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1C,OAAO,CACL,8BACE,SAAS,EAAE,GAAG,CACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACvC,OAAO;IACP,KAAK;IACL,OAAO;IACP,cAAc;IACd,cAAc;IACd,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { CheckMini, ChevronRightMini, EllipseMiniSolid } from \"@medusajs/icons\"\nimport { DropdownMenu as RadixDropdownMenu } 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 Dropdown Menu](https://www.radix-ui.com/primitives/docs/components/dropdown-menu) primitive.\n */\nconst Root = RadixDropdownMenu.Root\nRoot.displayName = \"DropdownMenu\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Trigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#trigger) primitive.\n */\nconst Trigger = RadixDropdownMenu.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Group](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#group) primitive.\n */\nconst Group = RadixDropdownMenu.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Sub](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#sub) primitive.\n */\nconst SubMenu = RadixDropdownMenu.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu RadioGroup](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radiogroup) primitive.\n */\nconst RadioGroup = RadixDropdownMenu.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu SubTrigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subtrigger) primitive.\n */\nconst SubMenuTrigger = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <RadixDropdownMenu.SubTrigger\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=open]:!bg-ui-bg-component-hover\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"text-ui-fg-muted ml-auto\" />\n </RadixDropdownMenu.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu SubContent](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subcontent) primitive.\n */\nconst SubMenuContent = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.SubContent>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.SubContent>\n>(({ className, collisionPadding = 8, ...props }, ref) => (\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.SubContent\n ref={ref}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\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-[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 className\n )}\n {...props}\n />\n </RadixDropdownMenu.Portal>\n))\nSubMenuContent.displayName = \"DropdownMenu.SubMenuContent\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Content](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content) primitive.\n */\nconst Content = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.Content>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Content>\n>(\n (\n {\n className,\n sideOffset = 8,\n collisionPadding = 8,\n align = \"center\",\n ...props\n },\n ref\n ) => (\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\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-[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 className\n )}\n {...props}\n />\n </RadixDropdownMenu.Portal>\n )\n)\nContent.displayName = \"DropdownMenu.Content\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Item](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#item) primitive.\n */\nconst Item = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.Item>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Item>\n>(({ className, ...props }, ref) => (\n <RadixDropdownMenu.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu CheckboxItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#checkboxitem) primitive.\n */\nconst CheckboxItem = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <RadixDropdownMenu.CheckboxItem\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=checked]:txt-compact-small-plus\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-[15px] items-center justify-center\">\n <RadixDropdownMenu.ItemIndicator>\n <CheckMini />\n </RadixDropdownMenu.ItemIndicator>\n </span>\n {children}\n </RadixDropdownMenu.CheckboxItem>\n))\nCheckboxItem.displayName = \"DropdownMenu.CheckboxItem\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu RadioItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radioitem) primitive.\n */\nconst RadioItem = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.RadioItem>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <RadixDropdownMenu.RadioItem\n ref={ref}\n className={clx(\n \"bg-ui-bg-component txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=checked]:txt-compact-small-plus\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-[15px] items-center justify-center\">\n <RadixDropdownMenu.ItemIndicator>\n <EllipseMiniSolid className=\"text-ui-fg-base\" />\n </RadixDropdownMenu.ItemIndicator>\n </span>\n {children}\n </RadixDropdownMenu.RadioItem>\n))\nRadioItem.displayName = \"DropdownMenu.RadioItem\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Label](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#label) primitive.\n */\nconst Label = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.Label>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Label>\n>(({ className, ...props }, ref) => (\n <RadixDropdownMenu.Label\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-xsmall-plus\", className)}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Separator](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#separator) primitive.\n */\nconst Separator = React.forwardRef<\n React.ElementRef<typeof RadixDropdownMenu.Separator>,\n React.ComponentPropsWithoutRef<typeof RadixDropdownMenu.Separator>\n>(({ className, ...props }, ref) => (\n <RadixDropdownMenu.Separator\n ref={ref}\n className={clx(\n \"bg-ui-border-component border-t-ui-border-menu-top border-b-ui-border-menu-bot -mx-1 my-1 h-0.5 border-b border-t\",\n className\n )}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\n\n/**\n * This component is based on the `span` element and supports all of its props\n */\nconst Shortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nShortcut.displayName = \"DropdownMenu.Shortcut\"\n\n/**\n * This component is based on the `span` element and supports all of its props\n */\nconst Hint = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nHint.displayName = \"DropdownMenu.Hint\"\n\nconst DropdownMenu = Object.assign(Root, {\n Trigger,\n Group,\n SubMenu,\n SubMenuContent,\n SubMenuTrigger,\n Content,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n Label,\n Separator,\n Shortcut,\n Hint,\n})\n\nexport { DropdownMenu }\n"]}
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC;;GAEG;AACH,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,cAAc,CAAA;AAEjC;;GAEG;AACH,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C;;GAEG;AACH,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC;;GAEG;AACH,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAA;AAC9B,OAAO,CAA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KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,GAAG,CACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,uBAAuB,CAAA;AAE9C;;GAEG;AACH,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,GAAG,CACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACvC,OAAO;IACP,KAAK;IACL,OAAO;IACP,cAAc;IACd,cAAc;IACd,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { CheckMini, ChevronRightMini, EllipseMiniSolid } from \"@medusajs/icons\"\nimport * as Primitives from \"@radix-ui/react-dropdown-menu\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu](https://www.radix-ui.com/primitives/docs/components/dropdown-menu) primitive.\n */\nconst Root = Primitives.Root\nRoot.displayName = \"DropdownMenu\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Trigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#trigger) primitive.\n */\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Group](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#group) primitive.\n */\nconst Group = Primitives.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Sub](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#sub) primitive.\n */\nconst SubMenu = Primitives.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu RadioGroup](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radiogroup) primitive.\n */\nconst RadioGroup = Primitives.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu SubTrigger](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subtrigger) primitive.\n */\nconst SubMenuTrigger = React.forwardRef<\n React.ElementRef<typeof Primitives.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubTrigger>\n>(({ className, children, ...props }, ref) => (\n <Primitives.SubTrigger\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=open]:!bg-ui-bg-component-hover\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"text-ui-fg-muted ml-auto\" />\n </Primitives.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu SubContent](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#subcontent) primitive.\n */\nconst SubMenuContent = React.forwardRef<\n React.ElementRef<typeof Primitives.SubContent>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubContent>\n>(({ className, collisionPadding = 8, ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.SubContent\n ref={ref}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\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-[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 className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nSubMenuContent.displayName = \"DropdownMenu.SubMenuContent\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Content](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#content) primitive.\n */\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(\n (\n {\n className,\n sideOffset = 8,\n collisionPadding = 8,\n align = \"center\",\n ...props\n },\n ref\n ) => (\n <Primitives.Portal>\n <Primitives.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n collisionPadding={collisionPadding}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[220px] overflow-hidden rounded-lg p-1\",\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-[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 className\n )}\n {...props}\n />\n </Primitives.Portal>\n )\n)\nContent.displayName = \"DropdownMenu.Content\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Item](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#item) primitive.\n */\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitives.Item>,\n React.ComponentPropsWithoutRef<typeof Primitives.Item>\n>(({ className, ...props }, ref) => (\n <Primitives.Item\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu CheckboxItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#checkboxitem) primitive.\n */\nconst CheckboxItem = React.forwardRef<\n React.ElementRef<typeof Primitives.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <Primitives.CheckboxItem\n ref={ref}\n className={clx(\n \"bg-ui-bg-component text-ui-fg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=checked]:txt-compact-small-plus\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-[15px] items-center justify-center\">\n <Primitives.ItemIndicator>\n <CheckMini />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.CheckboxItem>\n))\nCheckboxItem.displayName = \"DropdownMenu.CheckboxItem\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu RadioItem](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#radioitem) primitive.\n */\nconst RadioItem = React.forwardRef<\n React.ElementRef<typeof Primitives.RadioItem>,\n React.ComponentPropsWithoutRef<typeof Primitives.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <Primitives.RadioItem\n ref={ref}\n className={clx(\n \"bg-ui-bg-component txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-1.5 pl-[31px] pr-2 outline-none transition-colors\",\n \"focus-visible:bg-ui-bg-component-hover focus:bg-ui-bg-component-hover\",\n \"active:bg-ui-bg-component-hover\",\n \"data-[disabled]:text-ui-fg-disabled data-[disabled]:pointer-events-none\",\n \"data-[state=checked]:txt-compact-small-plus\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-[15px] items-center justify-center\">\n <Primitives.ItemIndicator>\n <EllipseMiniSolid className=\"text-ui-fg-base\" />\n </Primitives.ItemIndicator>\n </span>\n {children}\n </Primitives.RadioItem>\n))\nRadioItem.displayName = \"DropdownMenu.RadioItem\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Label](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#label) primitive.\n */\nconst Label = React.forwardRef<\n React.ElementRef<typeof Primitives.Label>,\n React.ComponentPropsWithoutRef<typeof Primitives.Label>\n>(({ className, ...props }, ref) => (\n <Primitives.Label\n ref={ref}\n className={clx(\"text-ui-fg-subtle txt-compact-xsmall-plus\", className)}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\n\n/**\n * This component is based on the [Radix UI Dropdown Menu Separator](https://www.radix-ui.com/primitives/docs/components/dropdown-menu#separator) primitive.\n */\nconst Separator = React.forwardRef<\n React.ElementRef<typeof Primitives.Separator>,\n React.ComponentPropsWithoutRef<typeof Primitives.Separator>\n>(({ className, ...props }, ref) => (\n <Primitives.Separator\n ref={ref}\n className={clx(\n \"bg-ui-border-component border-t-ui-border-menu-top border-b-ui-border-menu-bot -mx-1 my-1 h-0.5 border-b border-t\",\n className\n )}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\n\n/**\n * This component is based on the `span` element and supports all of its props\n */\nconst Shortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nShortcut.displayName = \"DropdownMenu.Shortcut\"\n\n/**\n * This component is based on the `span` element and supports all of its props\n */\nconst Hint = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={clx(\n \"text-ui-fg-subtle txt-compact-small ml-auto tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\nHint.displayName = \"DropdownMenu.Hint\"\n\nconst DropdownMenu = Object.assign(Root, {\n Trigger,\n Group,\n SubMenu,\n SubMenuContent,\n SubMenuTrigger,\n Content,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n Label,\n Separator,\n Shortcut,\n Hint,\n})\n\nexport { DropdownMenu }\n"]}
|