@medusajs/ui 4.0.5-snapshot-20250127145424 → 4.0.5-snapshot-20250203091247
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":"progress-tabs.js","sourceRoot":"","sources":["../../../../src/components/progress-tabs/progress-tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,
|
1
|
+
{"version":3,"file":"progress-tabs.js","sourceRoot":"","sources":["../../../../src/components/progress-tabs/progress-tabs.tsx"],"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/icons\"\nimport { Tabs as RadixTabs } from \"radix-ui\"\nimport * as React from \"react\"\n\nimport { ProgressStatus } from \"@/types\"\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 *\n * @excludeExternal\n */\nconst ProgressTabsRoot = (props: RadixTabs.TabsProps) => {\n return <RadixTabs.Root {...props} />\n}\nProgressTabsRoot.displayName = \"ProgressTabs\"\n\ninterface IndicatorProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"children\"> {\n /**\n * The current status.\n */\n status?: ProgressStatus\n}\n\nconst ProgressIndicator = ({ status, className, ...props }: IndicatorProps) => {\n const Icon = React.useMemo(() => {\n switch (status) {\n case \"not-started\":\n return CircleDottedLine\n case \"in-progress\":\n return CircleHalfSolid\n case \"completed\":\n return CheckCircleSolid\n default:\n return CircleDottedLine\n }\n }, [status])\n\n return (\n <span\n className={clx(\n \"text-ui-fg-muted group-data-[state=active]/trigger:text-ui-fg-interactive\",\n className\n )}\n {...props}\n >\n <Icon />\n </span>\n )\n}\nProgressIndicator.displayName = \"ProgressTabs.ProgressIndicator\"\n\ninterface ProgressTabsTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof RadixTabs.Trigger>,\n \"asChild\"\n > {\n status?: ProgressStatus\n}\n\nconst ProgressTabsTrigger = React.forwardRef<\n React.ElementRef<typeof RadixTabs.Trigger>,\n ProgressTabsTriggerProps\n>(\n (\n {\n className,\n children,\n status = \"not-started\",\n ...props\n }: ProgressTabsTriggerProps,\n ref\n ) => (\n <RadixTabs.Trigger\n ref={ref}\n className={clx(\n \"txt-compact-small-plus transition-fg text-ui-fg-muted bg-ui-bg-subtle border-r-ui-border-base inline-flex h-[52px] w-full max-w-[200px] flex-1 items-center gap-x-2 border-r px-4 text-left outline-none\",\n \"group/trigger overflow-hidden text-ellipsis whitespace-nowrap\",\n \"disabled:bg-ui-bg-disabled disabled:text-ui-fg-muted\",\n \"hover:bg-ui-bg-subtle-hover\",\n \"focus-visible:bg-ui-bg-base focus:z-[1]\",\n \"data-[state=active]:text-ui-fg-base data-[state=active]:bg-ui-bg-base\",\n className\n )}\n {...props}\n >\n <ProgressIndicator status={status} />\n {children}\n </RadixTabs.Trigger>\n )\n)\nProgressTabsTrigger.displayName = \"ProgressTabs.Trigger\"\n\nconst ProgressTabsList = 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\", className)}\n {...props}\n />\n))\nProgressTabsList.displayName = \"ProgressTabs.List\"\n\nconst ProgressTabsContent = React.forwardRef<\n React.ElementRef<typeof RadixTabs.Content>,\n React.ComponentPropsWithoutRef<typeof RadixTabs.Content>\n>(({ className, ...props }, ref) => {\n return (\n <RadixTabs.Content\n ref={ref}\n className={clx(\"outline-none\", className)}\n {...props}\n />\n )\n})\nProgressTabsContent.displayName = \"ProgressTabs.Content\"\n\nconst ProgressTabs = Object.assign(ProgressTabsRoot, {\n Trigger: ProgressTabsTrigger,\n List: ProgressTabsList,\n Content: ProgressTabsContent,\n})\n\nexport { ProgressTabs }\n"]}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import
|
1
|
+
import { AlertDialog as RadixAlertDialog } from "radix-ui";
|
2
2
|
import * as React from "react";
|
3
3
|
type PromptVariant = "danger" | "confirmation";
|
4
4
|
declare const Prompt: {
|
5
|
-
({ variant, ...props }: React.ComponentPropsWithoutRef<typeof
|
5
|
+
({ variant, ...props }: React.ComponentPropsWithoutRef<typeof RadixAlertDialog.Root> & {
|
6
6
|
variant?: PromptVariant;
|
7
7
|
}): React.JSX.Element;
|
8
8
|
displayName: string;
|
9
9
|
} & {
|
10
|
-
Trigger: React.ForwardRefExoticComponent<
|
11
|
-
Content: React.ForwardRefExoticComponent<Omit<
|
12
|
-
Title: React.ForwardRefExoticComponent<Omit<Omit<
|
13
|
-
Description: React.ForwardRefExoticComponent<Omit<
|
14
|
-
Action: React.ForwardRefExoticComponent<Omit<Omit<
|
15
|
-
Cancel: React.ForwardRefExoticComponent<Omit<Omit<
|
10
|
+
Trigger: React.ForwardRefExoticComponent<RadixAlertDialog.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
11
|
+
Content: React.ForwardRefExoticComponent<Omit<RadixAlertDialog.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
Title: React.ForwardRefExoticComponent<Omit<Omit<RadixAlertDialog.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref">, "asChild"> & React.RefAttributes<HTMLHeadingElement>>;
|
13
|
+
Description: React.ForwardRefExoticComponent<Omit<RadixAlertDialog.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
14
|
+
Action: React.ForwardRefExoticComponent<Omit<Omit<RadixAlertDialog.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref">, "asChild"> & React.RefAttributes<HTMLButtonElement>>;
|
15
|
+
Cancel: React.ForwardRefExoticComponent<Omit<Omit<RadixAlertDialog.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref">, "asChild"> & React.RefAttributes<HTMLButtonElement>>;
|
16
16
|
Header: {
|
17
17
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
18
18
|
displayName: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/prompt.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../../src/components/prompt/prompt.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,KAAK,aAAa,GAAG,QAAQ,GAAG,cAAc,CAAA;AA2L9C,QAAA,MAAM,MAAM;4BAxJT,MAAM,wBAAwB,CAAC,OAAO,iBAAiB,IAAI,CAAC,GAAG;QAChE,OAAO,CAAC,EAAE,aAAa,CAAA;KACxB;;;;;;;;;;kCA4HE,MAAM,cAAc,CAAC,cAAc,CAAC;;;;kCAgBpC,MAAM,cAAc,CAAC,cAAc,CAAC;;;CAmBrC,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
-
import
|
2
|
+
import { AlertDialog as RadixAlertDialog } from "radix-ui";
|
3
3
|
import * as React from "react";
|
4
4
|
import { Button } from "../button";
|
5
5
|
import { Heading } from "../heading";
|
@@ -26,42 +26,42 @@ const Root = ({
|
|
26
26
|
*/
|
27
27
|
variant = "danger", ...props }) => {
|
28
28
|
return (React.createElement(PromptProvider, { variant: variant },
|
29
|
-
React.createElement(
|
29
|
+
React.createElement(RadixAlertDialog.Root, { ...props })));
|
30
30
|
};
|
31
31
|
Root.displayName = "Prompt";
|
32
|
-
const Trigger =
|
32
|
+
const Trigger = RadixAlertDialog.Trigger;
|
33
33
|
Trigger.displayName = "Prompt.Trigger";
|
34
34
|
const Portal = (props) => {
|
35
|
-
return React.createElement(
|
35
|
+
return React.createElement(RadixAlertDialog.AlertDialogPortal, { ...props });
|
36
36
|
};
|
37
37
|
Portal.displayName = "Prompt.Portal";
|
38
38
|
const Overlay = React.forwardRef(({ className, ...props }, ref) => {
|
39
|
-
return (React.createElement(
|
39
|
+
return (React.createElement(RadixAlertDialog.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 }));
|
40
40
|
});
|
41
41
|
Overlay.displayName = "Prompt.Overlay";
|
42
42
|
const Title = React.forwardRef(({ className, children, ...props }, ref) => {
|
43
|
-
return (React.createElement(
|
43
|
+
return (React.createElement(RadixAlertDialog.Title, { ref: ref, className: clx(className), ...props, asChild: true },
|
44
44
|
React.createElement(Heading, { level: "h2", className: "text-ui-fg-base" }, children)));
|
45
45
|
});
|
46
46
|
Title.displayName = "Prompt.Title";
|
47
47
|
const Content = React.forwardRef(({ className, ...props }, ref) => {
|
48
48
|
return (React.createElement(Portal, null,
|
49
49
|
React.createElement(Overlay, null),
|
50
|
-
React.createElement(
|
50
|
+
React.createElement(RadixAlertDialog.Content, { ref: ref, className: clx("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", "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", className), ...props })));
|
51
51
|
});
|
52
52
|
Content.displayName = "Prompt.Content";
|
53
53
|
const Description = React.forwardRef(({ className, ...props }, ref) => {
|
54
|
-
return (React.createElement(
|
54
|
+
return (React.createElement(RadixAlertDialog.Description, { ref: ref, className: clx("text-ui-fg-subtle txt-compact-medium", className), ...props }));
|
55
55
|
});
|
56
56
|
Description.displayName = "Prompt.Description";
|
57
57
|
const Action = React.forwardRef(({ className, children, type, ...props }, ref) => {
|
58
58
|
const { variant } = usePromptContext();
|
59
|
-
return (React.createElement(
|
59
|
+
return (React.createElement(RadixAlertDialog.Action, { ref: ref, className: className, ...props, asChild: true },
|
60
60
|
React.createElement(Button, { size: "small", type: type, variant: variant === "danger" ? "danger" : "primary" }, children)));
|
61
61
|
});
|
62
62
|
Action.displayName = "Prompt.Action";
|
63
63
|
const Cancel = React.forwardRef(({ className, children, ...props }, ref) => {
|
64
|
-
return (React.createElement(
|
64
|
+
return (React.createElement(RadixAlertDialog.Cancel, { ref: ref, className: clx(className), ...props, asChild: true },
|
65
65
|
React.createElement(Button, { size: "small", variant: "secondary" }, children)));
|
66
66
|
});
|
67
67
|
Cancel.displayName = "Prompt.Cancel";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/components/prompt/prompt.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;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,cA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,WAAW,GAAG,eAAe,CAAA;AAEpC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3C,OAAO,CACL,oBAAC,UAAU,CAAC,MAAM,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAAM,KAAK,EAAE,OAAO;QACxE,oBAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAC,WAAW,IACrC,QAAQ,CACF,CACS,CACrB,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,GAAG,CAAC,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,GAAG,CAAC,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","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,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAIjC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAA6B;IACpE,OAAO,EAAE,QAAQ;CAClB,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,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AA;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,GAAG,CAAC,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","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"}
|
@@ -1,23 +1,23 @@
|
|
1
1
|
"use client";
|
2
|
-
import
|
2
|
+
import { RadioGroup as RadixRadioGroup } from "radix-ui";
|
3
3
|
import * as React from "react";
|
4
|
-
import { clx } from "../../utils/clx";
|
5
4
|
import { Hint } from "../hint";
|
6
5
|
import { Label } from "../label";
|
6
|
+
import { clx } from "../../utils/clx";
|
7
7
|
/**
|
8
8
|
* This component is based on the [Radix UI Radio Group](https://www.radix-ui.com/primitives/docs/components/radio-group) primitives.
|
9
9
|
*/
|
10
10
|
const Root = React.forwardRef(({ className, ...props }, ref) => {
|
11
|
-
return (React.createElement(
|
11
|
+
return (React.createElement(RadixRadioGroup.Root, { className: clx("grid gap-2", className), ...props, ref: ref }));
|
12
12
|
});
|
13
13
|
Root.displayName = "RadioGroup";
|
14
14
|
const Indicator = React.forwardRef(({ className, ...props }, ref) => {
|
15
|
-
return (React.createElement(
|
15
|
+
return (React.createElement(RadixRadioGroup.Indicator, { ref: ref, className: clx("flex items-center justify-center", className), ...props },
|
16
16
|
React.createElement("div", { className: clx("bg-ui-bg-base shadow-details-contrast-on-bg-interactive h-1.5 w-1.5 rounded-full") })));
|
17
17
|
});
|
18
18
|
Indicator.displayName = "RadioGroup.Indicator";
|
19
19
|
const Item = React.forwardRef(({ className, ...props }, ref) => {
|
20
|
-
return (React.createElement(
|
20
|
+
return (React.createElement(RadixRadioGroup.Item, { ref: ref, className: clx("group relative flex h-5 w-5 items-center justify-center outline-none", className), ...props },
|
21
21
|
React.createElement("div", { className: 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") },
|
22
22
|
React.createElement(Indicator, null))));
|
23
23
|
});
|
@@ -28,7 +28,7 @@ const ChoiceBox = React.forwardRef(({ className, id, label, description, ...prop
|
|
28
28
|
id = generatedId;
|
29
29
|
}
|
30
30
|
const descriptionId = `${id}-description`;
|
31
|
-
return (React.createElement(
|
31
|
+
return (React.createElement(RadixRadioGroup.Item, { ref: ref, className: 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 },
|
32
32
|
React.createElement("div", { className: "flex h-5 w-5 items-center justify-center" },
|
33
33
|
React.createElement("div", { className: 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") },
|
34
34
|
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,OAAO,
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio-group/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,O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AAS,EAAE,CAAC,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,CAAA","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"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Check, TrianglesMini } from "@medusajs/icons";
|
3
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
4
3
|
import { cva } from "cva";
|
4
|
+
import { Select as RadixSelect } from "radix-ui";
|
5
5
|
import * as React from "react";
|
6
6
|
import { clx } from "../../utils/clx";
|
7
7
|
const SelectContext = React.createContext(null);
|
@@ -22,19 +22,19 @@ const Root = ({ children,
|
|
22
22
|
*/
|
23
23
|
size = "base", ...props }) => {
|
24
24
|
return (React.createElement(SelectContext.Provider, { value: React.useMemo(() => ({ size }), [size]) },
|
25
|
-
React.createElement(
|
25
|
+
React.createElement(RadixSelect.Root, { ...props }, children)));
|
26
26
|
};
|
27
27
|
Root.displayName = "Select";
|
28
28
|
/**
|
29
29
|
* Groups multiple items together.
|
30
30
|
*/
|
31
|
-
const Group =
|
31
|
+
const Group = RadixSelect.Group;
|
32
32
|
Group.displayName = "Select.Group";
|
33
33
|
/**
|
34
34
|
* Displays the selected value, or a placeholder if no value is selected.
|
35
35
|
* It's based on [Radix UI Select Value](https://www.radix-ui.com/primitives/docs/components/select#value).
|
36
36
|
*/
|
37
|
-
const Value =
|
37
|
+
const Value = RadixSelect.Value;
|
38
38
|
Value.displayName = "Select.Value";
|
39
39
|
const triggerVariants = cva({
|
40
40
|
base: 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"),
|
@@ -51,9 +51,9 @@ const triggerVariants = cva({
|
|
51
51
|
*/
|
52
52
|
const Trigger = React.forwardRef(({ className, children, ...props }, ref) => {
|
53
53
|
const { size } = useSelectContext();
|
54
|
-
return (React.createElement(
|
54
|
+
return (React.createElement(RadixSelect.Trigger, { ref: ref, className: clx(triggerVariants({ size }), className), ...props },
|
55
55
|
children,
|
56
|
-
React.createElement(
|
56
|
+
React.createElement(RadixSelect.Icon, { asChild: true },
|
57
57
|
React.createElement(TrianglesMini, { className: "text-ui-fg-muted group-disabled/trigger:text-ui-fg-disabled" }))));
|
58
58
|
});
|
59
59
|
Trigger.displayName = "Select.Trigger";
|
@@ -73,32 +73,32 @@ sideOffset = 8,
|
|
73
73
|
/**
|
74
74
|
* The distance in pixels from the boundary edges where collision detection should occur. Only available when position is set to popper.
|
75
75
|
*/
|
76
|
-
collisionPadding = 24, ...props }, ref) => (React.createElement(
|
77
|
-
React.createElement(
|
76
|
+
collisionPadding = 24, ...props }, ref) => (React.createElement(RadixSelect.Portal, null,
|
77
|
+
React.createElement(RadixSelect.Content, { ref: ref, className: 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", {
|
78
78
|
"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",
|
79
79
|
}, className), position: position, sideOffset: sideOffset, collisionPadding: collisionPadding, ...props },
|
80
|
-
React.createElement(
|
80
|
+
React.createElement(RadixSelect.Viewport, { className: clx("p-1", position === "popper" &&
|
81
81
|
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]") }, children)))));
|
82
82
|
Content.displayName = "Select.Content";
|
83
83
|
/**
|
84
84
|
* Used to label a group of items.
|
85
85
|
* It's based on [Radix UI Select Label](https://www.radix-ui.com/primitives/docs/components/select#label).
|
86
86
|
*/
|
87
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
87
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (React.createElement(RadixSelect.Label, { ref: ref, className: clx("txt-compact-xsmall-plus text-ui-fg-muted px-2 py-1.5", className), ...props })));
|
88
88
|
Label.displayName = "Select.Label";
|
89
89
|
/**
|
90
90
|
* An item in the select. It's based on [Radix UI Select Item](https://www.radix-ui.com/primitives/docs/components/select#item)
|
91
91
|
* and accepts its props.
|
92
92
|
*/
|
93
93
|
const Item = React.forwardRef(({ className, children, ...props }, ref) => {
|
94
|
-
return (React.createElement(
|
94
|
+
return (React.createElement(RadixSelect.Item, { ref: ref, className: 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 },
|
95
95
|
React.createElement("span", { className: "flex h-[15px] w-[15px] items-center justify-center" },
|
96
|
-
React.createElement(
|
96
|
+
React.createElement(RadixSelect.ItemIndicator, { className: "flex items-center justify-center" },
|
97
97
|
React.createElement(Check, null))),
|
98
|
-
React.createElement(
|
98
|
+
React.createElement(RadixSelect.ItemText, { className: "flex-1 truncate" }, children)));
|
99
99
|
});
|
100
100
|
Item.displayName = "Select.Item";
|
101
|
-
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(
|
101
|
+
const Separator = React.forwardRef(({ className, ...props }, ref) => (React.createElement(RadixSelect.Separator, { ref: ref, 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), ...props })));
|
102
102
|
Separator.displayName = "Select.Separator";
|
103
103
|
const Select = Object.assign(Root, {
|
104
104
|
Group,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;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C,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","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,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,C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AAA;AAEhC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,WAAW,CAAC,SAAS,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CAAC,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;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA","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"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { clx } from "../../utils/clx";
|
2
1
|
import * as React from "react";
|
2
|
+
import { clx } from "../../utils/clx";
|
3
3
|
function Skeleton({ className, ...props }) {
|
4
4
|
return (React.createElement("div", { className: clx("bg-ui-bg-component animate-pulse rounded-md", className), ...props }));
|
5
5
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"skeleton.js","sourceRoot":"","sources":["../../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC6B;IACrC,OAAO,CACL,6BACE,SAAS,EAAE,GAAG,CAAC,6CAA6C,EAAE,SAAS,CAAC,KACpE,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA","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"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
|
-
import * as Primitives from "@radix-ui/react-switch";
|
3
2
|
import { cva } from "cva";
|
3
|
+
import { Switch as RadixSwitch } from "radix-ui";
|
4
4
|
import * as React from "react";
|
5
5
|
import { clx } from "../../utils/clx";
|
6
6
|
const switchVariants = cva({
|
@@ -34,8 +34,8 @@ const Switch = React.forwardRef(({ className,
|
|
34
34
|
/**
|
35
35
|
* The switch's size.
|
36
36
|
*/
|
37
|
-
size = "base", ...props }, ref) => (React.createElement(
|
38
|
-
React.createElement(
|
37
|
+
size = "base", ...props }, ref) => (React.createElement(RadixSwitch.Root, { className: clx(switchVariants({ size }), className), ...props, ref: ref },
|
38
|
+
React.createElement(RadixSwitch.Thumb, { className: clx(thumbVariants({ size })) }))));
|
39
39
|
Switch.displayName = "Switch";
|
40
40
|
export { Switch };
|
41
41
|
//# 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,OAAO,
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAgB,GAAG,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,cAAc,GAAG,GAAG,CAAC;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,GAAG,CAAC;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,WAAW,CAAC,IAAI,IACf,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAC/C,KAAK,EACT,GAAG,EAAE,GAAG;IAER,oBAAC,WAAW,CAAC,KAAK,IAAC,SAAS,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAI,CAC7C,CACpB,CACF,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,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"]}
|