@medusajs/ui 1.0.0 → 2.1.0
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/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/cjs/components/badge/badge.d.ts +16 -5
- package/dist/cjs/components/badge/badge.js +20 -31
- package/dist/cjs/components/badge/badge.js.map +1 -1
- package/dist/cjs/components/button/button.d.ts +1 -2
- package/dist/cjs/components/button/button.js +12 -40
- package/dist/cjs/components/button/button.js.map +1 -1
- package/dist/cjs/components/calendar/calendar.js +5 -5
- package/dist/cjs/components/calendar/calendar.js.map +1 -1
- package/dist/cjs/components/checkbox/checkbox.js +1 -1
- package/dist/cjs/components/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/components/code-block/code-block.d.ts +3 -5
- package/dist/cjs/components/code-block/code-block.js +19 -19
- package/dist/cjs/components/code-block/code-block.js.map +1 -1
- package/dist/cjs/components/command-bar/command-bar.d.ts +22 -0
- package/dist/cjs/components/command-bar/command-bar.js +63 -0
- package/dist/cjs/components/command-bar/command-bar.js.map +1 -0
- package/dist/cjs/components/command-bar/index.d.ts +1 -0
- package/dist/cjs/components/command-bar/index.js +5 -0
- package/dist/cjs/components/command-bar/index.js.map +1 -0
- package/dist/cjs/components/container/container.d.ts +1 -1
- package/dist/cjs/components/container/container.js.map +1 -1
- package/dist/cjs/components/currency-input/currency-input.d.ts +21 -0
- package/dist/cjs/components/currency-input/currency-input.js +58 -0
- package/dist/cjs/components/currency-input/currency-input.js.map +1 -0
- package/dist/cjs/components/currency-input/index.d.ts +1 -0
- package/dist/cjs/components/currency-input/index.js +5 -0
- package/dist/cjs/components/currency-input/index.js.map +1 -0
- package/dist/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/dist/cjs/components/date-picker/date-picker.js +138 -52
- package/dist/cjs/components/date-picker/date-picker.js.map +1 -1
- package/dist/cjs/components/drawer/drawer.d.ts +13 -15
- package/dist/cjs/components/drawer/drawer.js +53 -44
- package/dist/cjs/components/drawer/drawer.js.map +1 -1
- package/dist/cjs/components/dropdown-menu/dropdown-menu.js +7 -7
- package/dist/cjs/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/cjs/components/focus-modal/focus-modal.d.ts +9 -12
- package/dist/cjs/components/focus-modal/focus-modal.js +39 -35
- package/dist/cjs/components/focus-modal/focus-modal.js.map +1 -1
- package/dist/cjs/components/heading/heading.js +3 -3
- package/dist/cjs/components/heading/heading.js.map +1 -1
- package/dist/cjs/components/hint/hint.d.ts +1 -1
- package/dist/cjs/components/icon-badge/icon-badge.d.ts +20 -0
- package/dist/cjs/components/icon-badge/icon-badge.js +24 -0
- package/dist/cjs/components/icon-badge/icon-badge.js.map +1 -0
- package/dist/cjs/components/icon-badge/index.d.ts +1 -0
- package/dist/cjs/components/icon-badge/index.js +5 -0
- package/dist/cjs/components/icon-badge/index.js.map +1 -0
- package/dist/cjs/components/icon-button/icon-button.d.ts +21 -0
- package/dist/cjs/components/icon-button/icon-button.js +48 -0
- package/dist/cjs/components/icon-button/icon-button.js.map +1 -0
- package/dist/cjs/components/icon-button/index.d.ts +1 -0
- package/dist/cjs/components/icon-button/index.js +5 -0
- package/dist/cjs/components/icon-button/index.js.map +1 -0
- package/dist/cjs/components/input/input.js +6 -6
- package/dist/cjs/components/input/input.js.map +1 -1
- package/dist/cjs/components/kbd/kbd.d.ts +1 -1
- package/dist/cjs/components/kbd/kbd.js +4 -3
- package/dist/cjs/components/kbd/kbd.js.map +1 -1
- package/dist/cjs/components/progress-accordion/index.d.ts +1 -0
- package/dist/cjs/components/progress-accordion/index.js +5 -0
- package/dist/cjs/components/progress-accordion/index.js.map +1 -0
- package/dist/cjs/components/progress-accordion/progress-accordion.d.ts +19 -0
- package/dist/cjs/components/progress-accordion/progress-accordion.js +54 -0
- package/dist/cjs/components/progress-accordion/progress-accordion.js.map +1 -0
- package/dist/cjs/components/progress-tabs/index.d.ts +1 -0
- package/dist/cjs/components/progress-tabs/index.js +5 -0
- package/dist/cjs/components/progress-tabs/index.js.map +1 -0
- package/dist/cjs/components/progress-tabs/progress-tabs.d.ts +15 -0
- package/dist/cjs/components/progress-tabs/progress-tabs.js +46 -0
- package/dist/cjs/components/progress-tabs/progress-tabs.js.map +1 -0
- package/dist/cjs/components/prompt/prompt.js +3 -3
- package/dist/cjs/components/prompt/prompt.js.map +1 -1
- package/dist/cjs/components/radio-group/radio-group.d.ts +5 -0
- package/dist/cjs/components/radio-group/radio-group.js +25 -4
- package/dist/cjs/components/radio-group/radio-group.js.map +1 -1
- package/dist/cjs/components/select/select.js +4 -8
- package/dist/cjs/components/select/select.js.map +1 -1
- package/dist/cjs/components/status-badge/index.d.ts +1 -0
- package/dist/cjs/components/status-badge/index.js +5 -0
- package/dist/cjs/components/status-badge/index.js.map +1 -0
- package/dist/cjs/components/status-badge/status-badge.d.ts +6 -0
- package/dist/cjs/components/status-badge/status-badge.js +23 -0
- package/dist/cjs/components/status-badge/status-badge.js.map +1 -0
- package/dist/cjs/components/switch/switch.js +1 -1
- package/dist/cjs/components/switch/switch.js.map +1 -1
- package/dist/cjs/components/table/table.js +6 -7
- package/dist/cjs/components/table/table.js.map +1 -1
- package/dist/cjs/components/tabs/index.d.ts +1 -0
- package/dist/cjs/components/tabs/index.js +5 -0
- package/dist/cjs/components/tabs/index.js.map +1 -0
- package/dist/cjs/components/tabs/tabs.d.ts +11 -0
- package/dist/cjs/components/tabs/tabs.js +25 -0
- package/dist/cjs/components/tabs/tabs.js.map +1 -0
- package/dist/cjs/components/text/text.d.ts +1 -0
- package/dist/cjs/components/text/text.js +64 -7
- 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/time-input/time-input.js +1 -1
- package/dist/cjs/components/time-input/time-input.js.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.js +1 -1
- package/dist/cjs/components/tooltip/tooltip.js.map +1 -1
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +20 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types.d.ts +5 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/components/badge/badge.d.ts +16 -5
- package/dist/esm/components/badge/badge.js +19 -31
- package/dist/esm/components/badge/badge.js.map +1 -1
- package/dist/esm/components/button/button.d.ts +1 -2
- package/dist/esm/components/button/button.js +12 -40
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/calendar/calendar.js +5 -5
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js +1 -1
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/code-block/code-block.d.ts +3 -5
- package/dist/esm/components/code-block/code-block.js +7 -7
- package/dist/esm/components/code-block/code-block.js.map +1 -1
- package/dist/esm/components/command-bar/command-bar.d.ts +22 -0
- package/dist/esm/components/command-bar/command-bar.js +59 -0
- package/dist/esm/components/command-bar/command-bar.js.map +1 -0
- package/dist/esm/components/command-bar/index.d.ts +1 -0
- package/dist/esm/components/command-bar/index.js +2 -0
- package/dist/esm/components/command-bar/index.js.map +1 -0
- package/dist/esm/components/container/container.d.ts +1 -1
- package/dist/esm/components/container/container.js.map +1 -1
- package/dist/esm/components/currency-input/currency-input.d.ts +21 -0
- package/dist/esm/components/currency-input/currency-input.js +54 -0
- package/dist/esm/components/currency-input/currency-input.js.map +1 -0
- package/dist/esm/components/currency-input/index.d.ts +1 -0
- package/dist/esm/components/currency-input/index.js +2 -0
- package/dist/esm/components/currency-input/index.js.map +1 -0
- package/dist/esm/components/date-picker/date-picker.d.ts +1 -1
- package/dist/esm/components/date-picker/date-picker.js +139 -53
- package/dist/esm/components/date-picker/date-picker.js.map +1 -1
- package/dist/esm/components/drawer/drawer.d.ts +13 -15
- package/dist/esm/components/drawer/drawer.js +53 -44
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/dropdown-menu/dropdown-menu.js +7 -7
- package/dist/esm/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/esm/components/focus-modal/focus-modal.d.ts +9 -12
- package/dist/esm/components/focus-modal/focus-modal.js +39 -35
- package/dist/esm/components/focus-modal/focus-modal.js.map +1 -1
- package/dist/esm/components/heading/heading.js +3 -3
- package/dist/esm/components/heading/heading.js.map +1 -1
- package/dist/esm/components/hint/hint.d.ts +1 -1
- package/dist/esm/components/icon-badge/icon-badge.d.ts +20 -0
- package/dist/esm/components/icon-badge/icon-badge.js +20 -0
- package/dist/esm/components/icon-badge/icon-badge.js.map +1 -0
- package/dist/esm/components/icon-badge/index.d.ts +1 -0
- package/dist/esm/components/icon-badge/index.js +2 -0
- package/dist/esm/components/icon-badge/index.js.map +1 -0
- package/dist/esm/components/icon-button/icon-button.d.ts +21 -0
- package/dist/esm/components/icon-button/icon-button.js +43 -0
- package/dist/esm/components/icon-button/icon-button.js.map +1 -0
- package/dist/esm/components/icon-button/index.d.ts +1 -0
- package/dist/esm/components/icon-button/index.js +2 -0
- package/dist/esm/components/icon-button/index.js.map +1 -0
- package/dist/esm/components/input/input.js +6 -6
- package/dist/esm/components/input/input.js.map +1 -1
- package/dist/esm/components/kbd/kbd.d.ts +1 -1
- package/dist/esm/components/kbd/kbd.js +4 -3
- package/dist/esm/components/kbd/kbd.js.map +1 -1
- package/dist/esm/components/progress-accordion/index.d.ts +1 -0
- package/dist/esm/components/progress-accordion/index.js +2 -0
- package/dist/esm/components/progress-accordion/index.js.map +1 -0
- package/dist/esm/components/progress-accordion/progress-accordion.d.ts +19 -0
- package/dist/esm/components/progress-accordion/progress-accordion.js +50 -0
- package/dist/esm/components/progress-accordion/progress-accordion.js.map +1 -0
- package/dist/esm/components/progress-tabs/index.d.ts +1 -0
- package/dist/esm/components/progress-tabs/index.js +2 -0
- package/dist/esm/components/progress-tabs/index.js.map +1 -0
- package/dist/esm/components/progress-tabs/progress-tabs.d.ts +15 -0
- package/dist/esm/components/progress-tabs/progress-tabs.js +42 -0
- package/dist/esm/components/progress-tabs/progress-tabs.js.map +1 -0
- package/dist/esm/components/prompt/prompt.js +3 -3
- package/dist/esm/components/prompt/prompt.js.map +1 -1
- package/dist/esm/components/radio-group/radio-group.d.ts +5 -0
- package/dist/esm/components/radio-group/radio-group.js +25 -4
- package/dist/esm/components/radio-group/radio-group.js.map +1 -1
- package/dist/esm/components/select/select.js +5 -9
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/status-badge/index.d.ts +1 -0
- package/dist/esm/components/status-badge/index.js +2 -0
- package/dist/esm/components/status-badge/index.js.map +1 -0
- package/dist/esm/components/status-badge/status-badge.d.ts +6 -0
- package/dist/esm/components/status-badge/status-badge.js +19 -0
- package/dist/esm/components/status-badge/status-badge.js.map +1 -0
- package/dist/esm/components/switch/switch.js +1 -1
- package/dist/esm/components/switch/switch.js.map +1 -1
- package/dist/esm/components/table/table.js +6 -7
- package/dist/esm/components/table/table.js.map +1 -1
- package/dist/esm/components/tabs/index.d.ts +1 -0
- package/dist/esm/components/tabs/index.js +2 -0
- package/dist/esm/components/tabs/index.js.map +1 -0
- package/dist/esm/components/tabs/tabs.d.ts +11 -0
- package/dist/esm/components/tabs/tabs.js +21 -0
- package/dist/esm/components/tabs/tabs.js.map +1 -0
- package/dist/esm/components/text/text.d.ts +1 -0
- package/dist/esm/components/text/text.js +64 -7
- 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/time-input/time-input.js +1 -1
- package/dist/esm/components/time-input/time-input.js.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.js +1 -1
- package/dist/esm/components/tooltip/tooltip.js.map +1 -1
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.d.ts +5 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/package.json +13 -6
|
@@ -1,64 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { XMark } from "@medusajs/icons";
|
|
3
|
-
import * as
|
|
3
|
+
import * as DrawerPrimitives from "@radix-ui/react-dialog";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { Button } from "../button";
|
|
6
5
|
import { Heading } from "../heading";
|
|
7
|
-
import {
|
|
6
|
+
import { IconButton } from "../icon-button";
|
|
8
7
|
import { Kbd } from "../kbd";
|
|
9
8
|
import { Text } from "../text";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { clx } from "../../utils/clx";
|
|
10
|
+
const DrawerRoot = (props) => {
|
|
11
|
+
return React.createElement(DrawerPrimitives.Root, { ...props });
|
|
12
|
+
};
|
|
13
|
+
DrawerRoot.displayName = "Drawer.Root";
|
|
14
|
+
const DrawerTrigger = React.forwardRef(({ className, ...props }, ref) => {
|
|
15
|
+
return (React.createElement(DrawerPrimitives.Trigger, { ref: ref, className: clx(className), ...props }));
|
|
16
|
+
});
|
|
17
|
+
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
18
|
+
const DrawerClose = React.forwardRef(({ className, ...props }, ref) => {
|
|
19
|
+
return (React.createElement(DrawerPrimitives.Close, { ref: ref, className: clx(className), ...props }));
|
|
20
|
+
});
|
|
21
|
+
DrawerClose.displayName = "Drawer.Close";
|
|
22
|
+
const DrawerPortal = (props) => {
|
|
23
|
+
return React.createElement(DrawerPrimitives.DialogPortal, { ...props });
|
|
24
|
+
};
|
|
25
|
+
DrawerPortal.displayName = "Drawer.Portal";
|
|
26
|
+
const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => {
|
|
27
|
+
return (React.createElement(DrawerPrimitives.Overlay, { ref: ref, className: clx("bg-ui-bg-overlay fixed inset-0", className), ...props }));
|
|
20
28
|
});
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
return (React.createElement(
|
|
24
|
-
React.createElement(
|
|
25
|
-
React.createElement(
|
|
29
|
+
DrawerOverlay.displayName = "Drawer.Overlay";
|
|
30
|
+
const DrawerContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
31
|
+
return (React.createElement(DrawerPortal, null,
|
|
32
|
+
React.createElement(DrawerOverlay, null),
|
|
33
|
+
React.createElement(DrawerPrimitives.Content, { ref: ref, className: clx("bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 right-2 flex w-full max-w-[560px] flex-1 flex-col rounded-lg border focus:outline-none",
|
|
26
34
|
// "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",
|
|
27
35
|
className), ...props })));
|
|
28
36
|
});
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
return (React.createElement("div", { className: "border-ui-border-base flex items-start justify-between gap-x-4 border-b px-8 py-6", ...props },
|
|
37
|
+
DrawerContent.displayName = "Drawer.Content";
|
|
38
|
+
const DrawerHeader = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
39
|
+
return (React.createElement("div", { ref: ref, className: "border-ui-border-base flex items-start justify-between gap-x-4 border-b px-8 py-6", ...props },
|
|
32
40
|
React.createElement("div", { className: clx("flex flex-col gap-y-1", className) }, children),
|
|
33
41
|
React.createElement("div", { className: "flex items-center gap-x-2" },
|
|
34
42
|
React.createElement(Kbd, null, "esc"),
|
|
35
|
-
React.createElement(Close, { asChild: true },
|
|
36
|
-
React.createElement(
|
|
43
|
+
React.createElement(DrawerPrimitives.Close, { asChild: true },
|
|
44
|
+
React.createElement(IconButton, { variant: "transparent" },
|
|
37
45
|
React.createElement(XMark, null))))));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
return React.createElement("div", { className: clx("flex-1 px-8 pb-16 pt-6", className), ...props });
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const
|
|
46
|
+
});
|
|
47
|
+
DrawerHeader.displayName = "Drawer.Header";
|
|
48
|
+
const DrawerBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
49
|
+
return (React.createElement("div", { ref: ref, className: clx("flex-1 px-8 pb-16 pt-6", className), ...props }));
|
|
50
|
+
});
|
|
51
|
+
DrawerBody.displayName = "Drawer.Body";
|
|
52
|
+
const DrawerFooter = ({ className, ...props }) => {
|
|
45
53
|
return (React.createElement("div", { className: clx("border-ui-border-base flex items-center justify-end space-x-2 overflow-y-scroll border-t px-8 pb-6 pt-4", className), ...props }));
|
|
46
54
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
55
|
+
DrawerFooter.displayName = "Drawer.Footer";
|
|
56
|
+
const DrawerTitle = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DrawerPrimitives.Title, { ref: ref, className: clx(className), asChild: true, ...props },
|
|
49
57
|
React.createElement(Heading, { level: "h1" }, children))));
|
|
50
|
-
|
|
51
|
-
const
|
|
58
|
+
DrawerTitle.displayName = "Drawer.Title";
|
|
59
|
+
const DrawerDescription = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DrawerPrimitives.Description, { ref: ref, className: clx(className), asChild: true, ...props },
|
|
52
60
|
React.createElement(Text, null, children))));
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Body,
|
|
56
|
-
Close,
|
|
57
|
-
Content,
|
|
58
|
-
Description,
|
|
59
|
-
Footer,
|
|
60
|
-
Header,
|
|
61
|
-
Title,
|
|
62
|
-
Trigger,
|
|
61
|
+
DrawerDescription.displayName = "Drawer.Description";
|
|
62
|
+
const Drawer = Object.assign(DrawerRoot, {
|
|
63
|
+
Body: DrawerBody,
|
|
64
|
+
Close: DrawerClose,
|
|
65
|
+
Content: DrawerContent,
|
|
66
|
+
Description: DrawerDescription,
|
|
67
|
+
Footer: DrawerFooter,
|
|
68
|
+
Header: DrawerHeader,
|
|
69
|
+
Title: DrawerTitle,
|
|
70
|
+
Trigger: DrawerTrigger,
|
|
63
71
|
});
|
|
72
|
+
export { Drawer };
|
|
64
73
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,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;AAEjC,MAAM,UAAU,GAAG,CACjB,KAAmE,EACnE,EAAE;IACF,OAAO,oBAAC,gBAAgB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AAC7C,CAAC,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAA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-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { Heading } from \"@/components/heading\"\nimport { IconButton } from \"@/components/icon-button\"\nimport { Kbd } from \"@/components/kbd\"\nimport { Text } from \"@/components/text\"\nimport { clx } from \"@/utils/clx\"\n\nconst DrawerRoot = (\n props: React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Root>\n) => {\n return <DrawerPrimitives.Root {...props} />\n}\nDrawerRoot.displayName = \"Drawer.Root\"\n\nconst DrawerTrigger = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Trigger>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Trigger>\n>(({ className, ...props }, ref) => {\n return (\n <DrawerPrimitives.Trigger ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerTrigger.displayName = \"Drawer.Trigger\"\n\nconst DrawerClose = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Close>\n>(({ className, ...props }, ref) => {\n return (\n <DrawerPrimitives.Close ref={ref} className={clx(className)} {...props} />\n )\n})\nDrawerClose.displayName = \"Drawer.Close\"\n\nconst DrawerPortal = (props: DrawerPrimitives.DialogPortalProps) => {\n return <DrawerPrimitives.DialogPortal {...props} />\n}\nDrawerPortal.displayName = \"Drawer.Portal\"\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <DrawerPrimitives.Overlay\n ref={ref}\n className={clx(\"bg-ui-bg-overlay fixed inset-0\", className)}\n {...props}\n />\n )\n})\nDrawerOverlay.displayName = \"Drawer.Overlay\"\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <DrawerPortal>\n <DrawerOverlay />\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 right-2 flex w-full max-w-[560px] flex-1 flex-col rounded-lg border focus: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]: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\nconst DrawerHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ children, className, ...props }, 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-8 py-6\"\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 variant=\"transparent\">\n <XMark />\n </IconButton>\n </DrawerPrimitives.Close>\n </div>\n </div>\n )\n})\nDrawerHeader.displayName = \"Drawer.Header\"\n\nconst DrawerBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\"flex-1 px-8 pb-16 pt-6\", className)}\n {...props}\n />\n )\n})\nDrawerBody.displayName = \"Drawer.Body\"\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\n \"border-ui-border-base flex items-center justify-end space-x-2 overflow-y-scroll border-t px-8 pb-6 pt-4\",\n className\n )}\n {...props}\n />\n )\n}\nDrawerFooter.displayName = \"Drawer.Footer\"\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Title>\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitives.Title\n ref={ref}\n className={clx(className)}\n asChild\n {...props}\n >\n <Heading level=\"h1\">{children}</Heading>\n </DrawerPrimitives.Title>\n))\nDrawerTitle.displayName = \"Drawer.Title\"\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitives.Description>\n>(({ className, children, ...props }, 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"]}
|
|
@@ -17,21 +17,21 @@ const SubMenuTrigger = React.forwardRef(({ className, children, ...props }, ref)
|
|
|
17
17
|
children,
|
|
18
18
|
React.createElement(ChevronRightMini, { className: "ml-auto" }))));
|
|
19
19
|
SubMenuTrigger.displayName = "DropdownMenu.SubMenuTrigger";
|
|
20
|
-
const SubMenuContent = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
|
21
|
-
React.createElement(Primitives.SubContent, { ref: ref, className: clx("bg-ui-bg-base text-ui-fg-base 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
|
|
20
|
+
const SubMenuContent = React.forwardRef(({ className, collisionPadding = 8, ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
|
21
|
+
React.createElement(Primitives.SubContent, { ref: ref, collisionPadding: collisionPadding, className: clx("bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[8rem] overflow-hidden rounded-lg border 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 }))));
|
|
22
22
|
SubMenuContent.displayName = "DropdownMenu.SubMenuContent";
|
|
23
|
-
const Content = React.forwardRef(({ className, sideOffset = 8, align = "start", ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
|
24
|
-
React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, align: align, className: clx("bg-ui-bg-base text-ui-fg-base 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
|
|
23
|
+
const Content = React.forwardRef(({ className, sideOffset = 8, collisionPadding = 8, align = "start", ...props }, ref) => (React.createElement(Primitives.Portal, null,
|
|
24
|
+
React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, align: align, collisionPadding: collisionPadding, className: clx("bg-ui-bg-base 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 }))));
|
|
25
25
|
Content.displayName = "DropdownMenu.Content";
|
|
26
|
-
const Item = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Item, { ref: ref, className: clx("bg-ui-bg-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-
|
|
26
|
+
const Item = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Item, { ref: ref, className: clx("bg-ui-bg-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none", className), ...props })));
|
|
27
27
|
Item.displayName = "DropdownMenu.Item";
|
|
28
|
-
const CheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (React.createElement(Primitives.CheckboxItem, { ref: ref, className: clx("focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-
|
|
28
|
+
const CheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (React.createElement(Primitives.CheckboxItem, { ref: ref, className: clx("focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none", className), checked: checked, ...props },
|
|
29
29
|
React.createElement("span", { className: "absolute left-3 flex h-5 w-5 items-center justify-center" },
|
|
30
30
|
React.createElement(Primitives.ItemIndicator, null,
|
|
31
31
|
React.createElement(CheckMini, null))),
|
|
32
32
|
children)));
|
|
33
33
|
CheckboxItem.displayName = "DropdownMenu.CheckboxItem";
|
|
34
|
-
const RadioItem = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.RadioItem, { ref: ref, className: clx("focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-
|
|
34
|
+
const RadioItem = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.RadioItem, { ref: ref, className: clx("focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[state=checked]:font-medium data-[disabled]:opacity-50", className), ...props },
|
|
35
35
|
React.createElement("span", { className: "absolute left-3 flex h-5 w-5 items-center justify-center" },
|
|
36
36
|
React.createElement(Primitives.ItemIndicator, null,
|
|
37
37
|
React.createElement(EllipseMiniSolid, { className: "text-ui-fg-base" }))),
|
|
@@ -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,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAA;AAC9B,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;AACxC,UAAU,CAAC,WAAW,GAAG,yBAAyB,CAAA;AAElD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CA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I;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\nconst Root = Primitives.Root\nRoot.displayName = \"DropdownMenu.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\nconst Group = Primitives.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\nconst SubMenu = Primitives.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\nconst RadioGroup = Primitives.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\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 \"focus:bg-ui-bg-base-pressed data-[state=open]:bg-ui-bg-base-pressed txt-compact-small flex cursor-default select-none items-center rounded-sm px-3 py-2 outline-none\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"ml-auto\" />\n </Primitives.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\n\nconst SubMenuContent = React.forwardRef<\n React.ElementRef<typeof Primitives.SubContent>,\n React.ComponentPropsWithoutRef<typeof Primitives.SubContent>\n>(({ className, ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.SubContent\n ref={ref}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base 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 shadow-elevation-flyout z-50 min-w-[8rem] overflow-hidden rounded-lg border p-1\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nSubMenuContent.displayName = \"DropdownMenu.SubMenuContent\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(({ className, sideOffset = 8, align = \"start\", ...props }, ref) => (\n <Primitives.Portal>\n <Primitives.Content\n ref={ref}\n sideOffset={sideOffset}\n align={align}\n className={clx(\n \"bg-ui-bg-base text-ui-fg-base 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 shadow-elevation-flyout z-50 min-w-[300px] overflow-hidden rounded-lg p-1\",\n className\n )}\n {...props}\n />\n </Primitives.Portal>\n))\nContent.displayName = \"DropdownMenu.Content\"\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-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-default select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\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 \"focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-default select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 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\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 \"focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-default select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[state=checked]:font-medium data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 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\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(\n \"text-ui-fg-subtle txt-compact-xsmall-plus px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\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(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\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\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,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAA;AAC9B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S,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\nconst Root = Primitives.Root\nRoot.displayName = \"DropdownMenu.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"DropdownMenu.Trigger\"\n\nconst Group = Primitives.Group\nGroup.displayName = \"DropdownMenu.Group\"\n\nconst SubMenu = Primitives.Sub\nSubMenu.displayName = \"DropdownMenu.SubMenu\"\n\nconst RadioGroup = Primitives.RadioGroup\nRadioGroup.displayName = \"DropdownMenu.RadioGroup\"\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 \"focus:bg-ui-bg-base-pressed data-[state=open]:bg-ui-bg-base-pressed txt-compact-small flex cursor-default select-none items-center rounded-sm px-3 py-2 outline-none\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightMini className=\"ml-auto\" />\n </Primitives.SubTrigger>\n))\nSubMenuTrigger.displayName = \"DropdownMenu.SubMenuTrigger\"\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-base text-ui-fg-base shadow-elevation-flyout max-h-[var(--radix-popper-available-height)] min-w-[8rem] overflow-hidden rounded-lg border 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\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 = \"start\",\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-base 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\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-base focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled txt-compact-small relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n {...props}\n />\n))\nItem.displayName = \"DropdownMenu.Item\"\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 \"focus:bg-ui-bg-base-pressed text-ui-fg-base data-[disabled]:text-ui-fg-disabled relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 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\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 \"focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base txt-compact-small relative flex cursor-pointer select-none items-center rounded-md py-2 pl-10 pr-3 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[state=checked]:font-medium data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-3 flex h-5 w-5 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\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(\n \"text-ui-fg-subtle txt-compact-xsmall-plus px-2 py-1.5\",\n className\n )}\n {...props}\n />\n))\nLabel.displayName = \"DropdownMenu.Label\"\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(\"bg-ui-border-base -mx-1 my-1 h-px\", className)}\n {...props}\n />\n))\nSeparator.displayName = \"DropdownMenu.Separator\"\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\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,15 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as FocusModalPrimitives from "@radix-ui/react-dialog";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
declare const FocusModal:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Body:
|
|
11
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
3
|
+
declare const FocusModal: {
|
|
4
|
+
(props: React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Root>): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
Trigger: React.ForwardRefExoticComponent<Omit<FocusModalPrimitives.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
Content: React.ForwardRefExoticComponent<Omit<FocusModalPrimitives.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
Header: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Body: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
11
|
};
|
|
15
12
|
export { FocusModal };
|
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { XMark } from "@medusajs/icons";
|
|
3
|
-
import * as
|
|
3
|
+
import * as FocusModalPrimitives from "@radix-ui/react-dialog";
|
|
4
4
|
import * as React from "react";
|
|
5
|
+
import { IconButton } from "../icon-button";
|
|
5
6
|
import { Kbd } from "../kbd";
|
|
6
7
|
import { clx } from "../../utils/clx";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Root.displayName = "FocusModal.Root";
|
|
10
|
-
const Trigger = Primitives.Trigger;
|
|
11
|
-
Trigger.displayName = "FocusModal.Trigger";
|
|
12
|
-
const Portal = ({ className, ...props }) => {
|
|
13
|
-
return React.createElement(Primitives.DialogPortal, { className: clx(className), ...props });
|
|
8
|
+
const FocusModalRoot = (props) => {
|
|
9
|
+
return React.createElement(FocusModalPrimitives.Root, { ...props });
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
11
|
+
FocusModalRoot.displayName = "FocusModal";
|
|
12
|
+
const FocusModalTrigger = React.forwardRef((props, ref) => {
|
|
13
|
+
return React.createElement(FocusModalPrimitives.Trigger, { ref: ref, ...props });
|
|
14
|
+
});
|
|
15
|
+
FocusModalTrigger.displayName = "FocusModal.Trigger";
|
|
16
|
+
const FocusModalPortal = ({ className, ...props }) => {
|
|
17
|
+
return (React.createElement(FocusModalPrimitives.DialogPortal, { className: clx(className), ...props }));
|
|
18
|
+
};
|
|
19
|
+
FocusModalPortal.displayName = "FocusModal.Portal";
|
|
20
|
+
const FocusModalOverlay = React.forwardRef(({ className, ...props }, ref) => {
|
|
21
|
+
return (React.createElement(FocusModalPrimitives.Overlay, { ref: ref, className: clx("bg-ui-bg-overlay fixed inset-0",
|
|
22
|
+
// "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
19
23
|
className), ...props }));
|
|
20
24
|
});
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
return (React.createElement(
|
|
24
|
-
React.createElement(
|
|
25
|
-
React.createElement(
|
|
26
|
-
// "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 duration-200",
|
|
25
|
+
FocusModalOverlay.displayName = "FocusModal.Overlay";
|
|
26
|
+
const FocusModalContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
27
|
+
return (React.createElement(FocusModalPortal, null,
|
|
28
|
+
React.createElement(FocusModalOverlay, null),
|
|
29
|
+
React.createElement(FocusModalPrimitives.Content, { ref: ref, className: clx("bg-ui-bg-base shadow-elevation-modal fixed inset-2 flex flex-col overflow-hidden rounded-lg border focus:outline-none",
|
|
30
|
+
// "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 duration-200",
|
|
27
31
|
className), ...props })));
|
|
28
32
|
});
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
return (React.createElement("div", { className: clx("border-ui-border-base flex items-
|
|
33
|
+
FocusModalContent.displayName = "FocusModal.Content";
|
|
34
|
+
const FocusModalHeader = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
35
|
+
return (React.createElement("div", { ref: ref, className: clx("border-ui-border-base flex items-center justify-between gap-x-4 border-b px-4 py-2", className), ...props },
|
|
32
36
|
React.createElement("div", { className: "flex items-center gap-x-2" },
|
|
33
|
-
React.createElement(
|
|
34
|
-
React.createElement(
|
|
37
|
+
React.createElement(FocusModalPrimitives.Close, { asChild: true },
|
|
38
|
+
React.createElement(IconButton, { variant: "transparent" },
|
|
35
39
|
React.createElement(XMark, null))),
|
|
36
40
|
React.createElement(Kbd, null, "esc")),
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
return React.createElement("div", { className: clx("flex-1", className), ...props });
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const FocusModal = Object.assign(
|
|
45
|
-
Trigger,
|
|
46
|
-
Content,
|
|
47
|
-
Header,
|
|
48
|
-
Body,
|
|
41
|
+
children));
|
|
42
|
+
});
|
|
43
|
+
FocusModalHeader.displayName = "FocusModal.Header";
|
|
44
|
+
const FocusModalBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
45
|
+
return React.createElement("div", { ref: ref, className: clx("flex-1", className), ...props });
|
|
46
|
+
});
|
|
47
|
+
FocusModalBody.displayName = "FocusModal.Body";
|
|
48
|
+
const FocusModal = Object.assign(FocusModalRoot, {
|
|
49
|
+
Trigger: FocusModalTrigger,
|
|
50
|
+
Content: FocusModalContent,
|
|
51
|
+
Header: FocusModalHeader,
|
|
52
|
+
Body: FocusModalBody,
|
|
49
53
|
});
|
|
50
54
|
export { FocusModal };
|
|
51
55
|
//# sourceMappingURL=focus-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-modal.js","sourceRoot":"","sources":["../../../../src/components/focus-modal/focus-modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"focus-modal.js","sourceRoot":"","sources":["../../../../src/components/focus-modal/focus-modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAA;AAC9D,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,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,cAAc,GAAG,CACrB,KAAuE,EACvE,EAAE;IACF,OAAO,oBAAC,oBAAoB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AACjD,CAAC,CAAA;AACD,cAAc,CAAC,WAAW,GAAG,YAAY,CAAA;AAEzC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,OAAO,oBAAC,oBAAoB,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAA;AAC9D,CAAC,CAAC,CAAA;AACF,iBAAiB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAEpD,MAAM,gBAAgB,GAAG,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EAC+B,EAAE,EAAE;IAC3C,OAA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AK,IAAC,OAAO;gBACjC,oBAAC,UAAU,IAAC,OAAO,EAAC,aAAa;oBAC/B,oBAAC,KAAK,OAAG,CACE,CACc;YAC7B,oBAAC,GAAG,cAAU,CACV;QACL,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AACF,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAElD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAGrC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAA;AAC1E,CAAC,CAAC,CAAA;AACF,cAAc,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAE9C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE;IAC/C,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,gBAAgB;IACxB,IAAI,EAAE,cAAc;CACrB,CAAC,CAAA;AAEF,OAAO,EAAE,UAAU,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as FocusModalPrimitives from \"@radix-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { IconButton } from \"@/components/icon-button\"\nimport { Kbd } from \"@/components/kbd\"\nimport { clx } from \"@/utils/clx\"\n\nconst FocusModalRoot = (\n props: React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Root>\n) => {\n return <FocusModalPrimitives.Root {...props} />\n}\nFocusModalRoot.displayName = \"FocusModal\"\n\nconst FocusModalTrigger = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Trigger>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Trigger>\n>((props, ref) => {\n return <FocusModalPrimitives.Trigger ref={ref} {...props} />\n})\nFocusModalTrigger.displayName = \"FocusModal.Trigger\"\n\nconst FocusModalPortal = ({\n className,\n ...props\n}: FocusModalPrimitives.DialogPortalProps) => {\n return (\n <FocusModalPrimitives.DialogPortal className={clx(className)} {...props} />\n )\n}\nFocusModalPortal.displayName = \"FocusModal.Portal\"\n\nconst FocusModalOverlay = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <FocusModalPrimitives.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})\nFocusModalOverlay.displayName = \"FocusModal.Overlay\"\n\nconst FocusModalContent = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Content>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <FocusModalPortal>\n <FocusModalOverlay />\n <FocusModalPrimitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal fixed inset-2 flex flex-col overflow-hidden rounded-lg border focus: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 duration-200\",\n className\n )}\n {...props}\n />\n </FocusModalPortal>\n )\n})\nFocusModalContent.displayName = \"FocusModal.Content\"\n\nconst FocusModalHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\n \"border-ui-border-base flex items-center justify-between gap-x-4 border-b px-4 py-2\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-x-2\">\n <FocusModalPrimitives.Close asChild>\n <IconButton variant=\"transparent\">\n <XMark />\n </IconButton>\n </FocusModalPrimitives.Close>\n <Kbd>esc</Kbd>\n </div>\n {children}\n </div>\n )\n})\nFocusModalHeader.displayName = \"FocusModal.Header\"\n\nconst FocusModalBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return <div ref={ref} className={clx(\"flex-1\", className)} {...props} />\n})\nFocusModalBody.displayName = \"FocusModal.Body\"\n\nconst FocusModal = Object.assign(FocusModalRoot, {\n Trigger: FocusModalTrigger,\n Content: FocusModalContent,\n Header: FocusModalHeader,\n Body: FocusModalBody,\n})\n\nexport { FocusModal }\n"]}
|
|
@@ -4,9 +4,9 @@ import { clx } from "../../utils/clx";
|
|
|
4
4
|
const headingVariants = cva("font-sans font-medium", {
|
|
5
5
|
variants: {
|
|
6
6
|
level: {
|
|
7
|
-
h1: "
|
|
8
|
-
h2: "
|
|
9
|
-
h3: "
|
|
7
|
+
h1: "h1-core",
|
|
8
|
+
h2: "h2-core",
|
|
9
|
+
h3: "h3-core",
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../../src/components/heading/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../../src/components/heading/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;SACd;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAA;AAKF,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC/D,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAEtC,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst headingVariants = cva(\"font-sans font-medium\", {\n variants: {\n level: {\n h1: \"h1-core\",\n h2: \"h2-core\",\n h3: \"h3-core\",\n },\n },\n defaultVariants: {\n level: \"h1\",\n },\n})\n\ntype HeadingProps = VariantProps<typeof headingVariants> &\n React.HTMLAttributes<HTMLHeadingElement>\n\nconst Heading = ({ level, className, ...props }: HeadingProps) => {\n const Component = level ? level : \"h1\"\n\n return (\n <Component\n className={clx(headingVariants({ level }), className)}\n {...props}\n />\n )\n}\n\nexport { Heading, headingVariants }\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const Hint: React.ForwardRefExoticComponent<VariantProps<(props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "error" | "info" | null | undefined;
|
|
5
5
|
} & ({
|
|
6
6
|
class: import("clsx").ClassValue;
|
|
7
7
|
className?: undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { badgeColorVariants } from "../badge";
|
|
4
|
+
declare const iconBadgeVariants: (props?: ({
|
|
5
|
+
size?: "base" | "large" | null | undefined;
|
|
6
|
+
} & ({
|
|
7
|
+
class: import("clsx").ClassValue;
|
|
8
|
+
className?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
class?: undefined;
|
|
11
|
+
className: import("clsx").ClassValue;
|
|
12
|
+
} | {
|
|
13
|
+
class?: undefined;
|
|
14
|
+
className?: undefined;
|
|
15
|
+
})) | undefined) => string;
|
|
16
|
+
interface IconBadgeProps extends Omit<React.ComponentPropsWithoutRef<"span">, "color">, VariantProps<typeof badgeColorVariants>, VariantProps<typeof iconBadgeVariants> {
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const IconBadge: React.ForwardRefExoticComponent<IconBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
20
|
+
export { IconBadge };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { badgeColorVariants } from "../badge";
|
|
5
|
+
import { clx } from "../../utils/clx";
|
|
6
|
+
const iconBadgeVariants = cva("flex items-center justify-center overflow-hidden rounded-md border", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
base: "h-6 w-6",
|
|
10
|
+
large: "h-7 w-7",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const IconBadge = React.forwardRef(({ children, className, color = "grey", size = "base", asChild = false, ...props }, ref) => {
|
|
15
|
+
const Component = asChild ? Slot : "span";
|
|
16
|
+
return (React.createElement(Component, { ref: ref, className: clx(badgeColorVariants({ color }), iconBadgeVariants({ size }), className), ...props }, children));
|
|
17
|
+
});
|
|
18
|
+
IconBadge.displayName = "IconBadge";
|
|
19
|
+
export { IconBadge };
|
|
20
|
+
//# sourceMappingURL=icon-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-badge.js","sourceRoot":"","sources":["../../../../src/components/icon-badge/icon-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,iBAAiB,GAAG,GAAG,CAC3B,oEAAoE,EACpE;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SACjB;KACF;CACF,CACF,CAAA;AASD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,EACE,QAAQ,EACR,SAAS,EACT,KAAK,GAAG,MAAM,EACd,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAA;IAEzC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAC7B,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,EAC3B,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAA","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { badgeColorVariants } from \"@/components/badge\"\nimport { clx } from \"@/utils/clx\"\n\nconst iconBadgeVariants = cva(\n \"flex items-center justify-center overflow-hidden rounded-md border\",\n {\n variants: {\n size: {\n base: \"h-6 w-6\",\n large: \"h-7 w-7\",\n },\n },\n }\n)\n\ninterface IconBadgeProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\">,\n VariantProps<typeof badgeColorVariants>,\n VariantProps<typeof iconBadgeVariants> {\n asChild?: boolean\n}\n\nconst IconBadge = React.forwardRef<HTMLSpanElement, IconBadgeProps>(\n (\n {\n children,\n className,\n color = \"grey\",\n size = \"base\",\n asChild = false,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : \"span\"\n\n return (\n <Component\n ref={ref}\n className={clx(\n badgeColorVariants({ color }),\n iconBadgeVariants({ size }),\n className\n )}\n {...props}\n >\n {children}\n </Component>\n )\n }\n)\nIconBadge.displayName = \"IconBadge\"\n\nexport { IconBadge }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./icon-badge";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icon-badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA","sourcesContent":["export * from \"./icon-badge\"\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const iconButtonVariants: (props?: ({
|
|
4
|
+
variant?: "primary" | "transparent" | null | undefined;
|
|
5
|
+
size?: "base" | "large" | "xlarge" | null | undefined;
|
|
6
|
+
} & ({
|
|
7
|
+
class: import("clsx").ClassValue;
|
|
8
|
+
className?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
class?: undefined;
|
|
11
|
+
className: import("clsx").ClassValue;
|
|
12
|
+
} | {
|
|
13
|
+
class?: undefined;
|
|
14
|
+
className?: undefined;
|
|
15
|
+
})) | undefined) => string;
|
|
16
|
+
interface IconButtonProps extends React.ComponentPropsWithoutRef<"button">, VariantProps<typeof iconButtonVariants> {
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
export { IconButton, iconButtonVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Spinner } from "@medusajs/icons";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { clx } from "../../utils/clx";
|
|
6
|
+
const iconButtonVariants = cva(clx("transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none", "disabled:bg-ui-bg-disabled disabled:shadow-buttons-neutral disabled:text-ui-fg-disabled disabled:after:hidden"), {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
primary: clx("shadow-buttons-neutral text-ui-fg-subtle bg-ui-button-neutral after:button-neutral-gradient", "hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient", "active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient", "focus:shadow-buttons-neutral-focus", "after:absolute after:inset-0 after:content-['']"),
|
|
10
|
+
transparent: clx("text-ui-fg-subtle bg-ui-button-transparent", "hover:bg-ui-button-transparent-hover", "active:bg-ui-button-transparent-pressed", "focus:shadow-buttons-neutral-focus focus:bg-ui-bg-base", "disabled:!bg-transparent disabled:!shadow-none"),
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
base: "h-8 w-8 p-1.5",
|
|
14
|
+
large: "h-10 w-10 p-2.5",
|
|
15
|
+
xlarge: "h-12 w-12 p-3.5",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "primary",
|
|
20
|
+
size: "base",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const IconButton = React.forwardRef(({ variant = "primary", size = "base", asChild = false, className, children, isLoading = false, disabled, ...props }, ref) => {
|
|
24
|
+
const Component = asChild ? Slot : "button";
|
|
25
|
+
/**
|
|
26
|
+
* In the case of a button where asChild is true, and isLoading is true, we ensure that
|
|
27
|
+
* only on element is passed as a child to the Slot component. This is because the Slot
|
|
28
|
+
* component only accepts a single child.
|
|
29
|
+
*/
|
|
30
|
+
const renderInner = () => {
|
|
31
|
+
if (isLoading) {
|
|
32
|
+
return (React.createElement("span", { className: "pointer-events-none" },
|
|
33
|
+
React.createElement("div", { className: clx("bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md") },
|
|
34
|
+
React.createElement(Spinner, { className: "animate-spin" })),
|
|
35
|
+
children));
|
|
36
|
+
}
|
|
37
|
+
return children;
|
|
38
|
+
};
|
|
39
|
+
return (React.createElement(Component, { ref: ref, ...props, className: clx(iconButtonVariants({ variant, size }), className), disabled: disabled || isLoading }, renderInner()));
|
|
40
|
+
});
|
|
41
|
+
IconButton.displayName = "IconButton";
|
|
42
|
+
export { IconButton, iconButtonVariants };
|
|
43
|
+
//# sourceMappingURL=icon-button.js.map
|