@medusajs/ui 0.0.0-alpha-20230713141422
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/README.md +3 -0
- package/build/cjs/components/alert-dialog/alert-dialog.js +151 -0
- package/build/cjs/components/avatar/avatar.js +97 -0
- package/build/cjs/components/badge/badge.js +98 -0
- package/build/cjs/components/button/button.js +104 -0
- package/build/cjs/components/checkbox/checkbox.js +45 -0
- package/build/cjs/components/container/container.js +36 -0
- package/build/cjs/components/drawer/drawer.js +136 -0
- package/build/cjs/components/dropdown-menu/dropdown-menu.js +168 -0
- package/build/cjs/components/focus-modal/focus-modal.js +102 -0
- package/build/cjs/components/heading/heading.js +52 -0
- package/build/cjs/components/input/input.js +50 -0
- package/build/cjs/components/kbd/kbd.js +39 -0
- package/build/cjs/components/label/label.js +63 -0
- package/build/cjs/components/radio-group/radio-group.js +60 -0
- package/build/cjs/components/switch/switch.js +67 -0
- package/build/cjs/components/text/text.js +71 -0
- package/build/cjs/components/textarea/textarea.js +39 -0
- package/build/cjs/components/toast/toast.js +130 -0
- package/build/cjs/components/toaster/toaster.js +42 -0
- package/build/cjs/components/tooltip/tooltip.js +68 -0
- package/build/cjs/hooks/use-alert-dialog/dialog.js +97 -0
- package/build/cjs/hooks/use-alert-dialog/use-alert-dialog.js +54 -0
- package/build/cjs/hooks/use-toast/use-toast.js +163 -0
- package/build/cjs/hooks/use-toggle-state/use-toggle-state.js +43 -0
- package/build/cjs/index.js +53 -0
- package/build/cjs/utils/clx.js +10 -0
- package/build/esm/components/alert-dialog/alert-dialog.js +129 -0
- package/build/esm/components/avatar/avatar.js +75 -0
- package/build/esm/components/badge/badge.js +77 -0
- package/build/esm/components/button/button.js +83 -0
- package/build/esm/components/checkbox/checkbox.js +23 -0
- package/build/esm/components/container/container.js +15 -0
- package/build/esm/components/drawer/drawer.js +114 -0
- package/build/esm/components/dropdown-menu/dropdown-menu.js +146 -0
- package/build/esm/components/focus-modal/focus-modal.js +80 -0
- package/build/esm/components/heading/heading.js +30 -0
- package/build/esm/components/input/input.js +29 -0
- package/build/esm/components/kbd/kbd.js +18 -0
- package/build/esm/components/label/label.js +40 -0
- package/build/esm/components/radio-group/radio-group.js +38 -0
- package/build/esm/components/switch/switch.js +45 -0
- package/build/esm/components/text/text.js +49 -0
- package/build/esm/components/textarea/textarea.js +18 -0
- package/build/esm/components/toast/toast.js +106 -0
- package/build/esm/components/toaster/toaster.js +21 -0
- package/build/esm/components/tooltip/tooltip.js +46 -0
- package/build/esm/hooks/use-alert-dialog/dialog.js +74 -0
- package/build/esm/hooks/use-alert-dialog/use-alert-dialog.js +33 -0
- package/build/esm/hooks/use-toast/use-toast.js +140 -0
- package/build/esm/hooks/use-toggle-state/use-toggle-state.js +22 -0
- package/build/esm/index.js +24 -0
- package/build/esm/utils/clx.js +8 -0
- package/build/types/src/components/alert-dialog/alert-dialog.d.ts +14 -0
- package/build/types/src/components/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/build/types/src/components/alert-dialog/index.d.ts +2 -0
- package/build/types/src/components/alert-dialog/index.d.ts.map +1 -0
- package/build/types/src/components/avatar/avatar.d.ts +14 -0
- package/build/types/src/components/avatar/avatar.d.ts.map +1 -0
- package/build/types/src/components/avatar/index.d.ts +2 -0
- package/build/types/src/components/avatar/index.d.ts.map +1 -0
- package/build/types/src/components/badge/badge.d.ts +13 -0
- package/build/types/src/components/badge/badge.d.ts.map +1 -0
- package/build/types/src/components/badge/index.d.ts +2 -0
- package/build/types/src/components/badge/index.d.ts.map +1 -0
- package/build/types/src/components/button/button.d.ts +14 -0
- package/build/types/src/components/button/button.d.ts.map +1 -0
- package/build/types/src/components/button/index.d.ts +2 -0
- package/build/types/src/components/button/index.d.ts.map +1 -0
- package/build/types/src/components/checkbox/checkbox.d.ts +5 -0
- package/build/types/src/components/checkbox/checkbox.d.ts.map +1 -0
- package/build/types/src/components/checkbox/index.d.ts +2 -0
- package/build/types/src/components/checkbox/index.d.ts.map +1 -0
- package/build/types/src/components/container/container.d.ts +4 -0
- package/build/types/src/components/container/container.d.ts.map +1 -0
- package/build/types/src/components/container/index.d.ts +2 -0
- package/build/types/src/components/container/index.d.ts.map +1 -0
- package/build/types/src/components/drawer/drawer.d.ts +22 -0
- package/build/types/src/components/drawer/drawer.d.ts.map +1 -0
- package/build/types/src/components/drawer/index.d.ts +2 -0
- package/build/types/src/components/drawer/index.d.ts.map +1 -0
- package/build/types/src/components/dropdown-menu/dropdown-menu.d.ts +26 -0
- package/build/types/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/build/types/src/components/dropdown-menu/index.d.ts +2 -0
- package/build/types/src/components/dropdown-menu/index.d.ts.map +1 -0
- package/build/types/src/components/focus-modal/focus-modal.d.ts +16 -0
- package/build/types/src/components/focus-modal/focus-modal.d.ts.map +1 -0
- package/build/types/src/components/focus-modal/index.d.ts +2 -0
- package/build/types/src/components/focus-modal/index.d.ts.map +1 -0
- package/build/types/src/components/heading/heading.d.ts +9 -0
- package/build/types/src/components/heading/heading.d.ts.map +1 -0
- package/build/types/src/components/heading/index.d.ts +2 -0
- package/build/types/src/components/heading/index.d.ts.map +1 -0
- package/build/types/src/components/input/index.d.ts +2 -0
- package/build/types/src/components/input/index.d.ts.map +1 -0
- package/build/types/src/components/input/input.d.ts +4 -0
- package/build/types/src/components/input/input.d.ts.map +1 -0
- package/build/types/src/components/kbd/index.d.ts +2 -0
- package/build/types/src/components/kbd/index.d.ts.map +1 -0
- package/build/types/src/components/kbd/kbd.d.ts +4 -0
- package/build/types/src/components/kbd/kbd.d.ts.map +1 -0
- package/build/types/src/components/label/index.d.ts +2 -0
- package/build/types/src/components/label/index.d.ts.map +1 -0
- package/build/types/src/components/label/label.d.ts +11 -0
- package/build/types/src/components/label/label.d.ts.map +1 -0
- package/build/types/src/components/radio-group/index.d.ts +2 -0
- package/build/types/src/components/radio-group/index.d.ts.map +1 -0
- package/build/types/src/components/radio-group/radio-group.d.ts +7 -0
- package/build/types/src/components/radio-group/radio-group.d.ts.map +1 -0
- package/build/types/src/components/switch/index.d.ts +2 -0
- package/build/types/src/components/switch/index.d.ts.map +1 -0
- package/build/types/src/components/switch/switch.d.ts +11 -0
- package/build/types/src/components/switch/switch.d.ts.map +1 -0
- package/build/types/src/components/text/index.d.ts +2 -0
- package/build/types/src/components/text/index.d.ts.map +1 -0
- package/build/types/src/components/text/text.d.ts +13 -0
- package/build/types/src/components/text/text.d.ts.map +1 -0
- package/build/types/src/components/textarea/index.d.ts +2 -0
- package/build/types/src/components/textarea/index.d.ts.map +1 -0
- package/build/types/src/components/textarea/textarea.d.ts +4 -0
- package/build/types/src/components/textarea/textarea.d.ts.map +1 -0
- package/build/types/src/components/toast/index.d.ts +2 -0
- package/build/types/src/components/toast/index.d.ts.map +1 -0
- package/build/types/src/components/toast/toast.d.ts +20 -0
- package/build/types/src/components/toast/toast.d.ts.map +1 -0
- package/build/types/src/components/toaster/index.d.ts +2 -0
- package/build/types/src/components/toaster/index.d.ts.map +1 -0
- package/build/types/src/components/toaster/toaster.d.ts +4 -0
- package/build/types/src/components/toaster/toaster.d.ts.map +1 -0
- package/build/types/src/components/tooltip/index.d.ts +2 -0
- package/build/types/src/components/tooltip/index.d.ts.map +1 -0
- package/build/types/src/components/tooltip/tooltip.d.ts +11 -0
- package/build/types/src/components/tooltip/tooltip.d.ts.map +1 -0
- package/build/types/src/hooks/use-alert-dialog/dialog.d.ts +14 -0
- package/build/types/src/hooks/use-alert-dialog/dialog.d.ts.map +1 -0
- package/build/types/src/hooks/use-alert-dialog/index.d.ts +2 -0
- package/build/types/src/hooks/use-alert-dialog/index.d.ts.map +1 -0
- package/build/types/src/hooks/use-alert-dialog/use-alert-dialog.d.ts +5 -0
- package/build/types/src/hooks/use-alert-dialog/use-alert-dialog.d.ts.map +1 -0
- package/build/types/src/hooks/use-toast/index.d.ts +2 -0
- package/build/types/src/hooks/use-toast/index.d.ts.map +1 -0
- package/build/types/src/hooks/use-toast/use-toast.d.ts +45 -0
- package/build/types/src/hooks/use-toast/use-toast.d.ts.map +1 -0
- package/build/types/src/hooks/use-toggle-state/index.d.ts +2 -0
- package/build/types/src/hooks/use-toggle-state/index.d.ts.map +1 -0
- package/build/types/src/hooks/use-toggle-state/use-toggle-state.d.ts +9 -0
- package/build/types/src/hooks/use-toggle-state/use-toggle-state.d.ts.map +1 -0
- package/build/types/src/index.d.ts +25 -0
- package/build/types/src/index.d.ts.map +1 -0
- package/build/types/src/utils/clx.d.ts +3 -0
- package/build/types/src/utils/clx.d.ts.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as Primitives from '@radix-ui/react-alert-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { clx } from '../../utils/clx.js';
|
|
4
|
+
import { Heading } from '../heading/heading.js';
|
|
5
|
+
import { Button } from '../button/button.js';
|
|
6
|
+
import { labelVariants } from '../label/label.js';
|
|
7
|
+
|
|
8
|
+
const Root = Primitives.Root;
|
|
9
|
+
Root.displayName = "AlertDialog.Root";
|
|
10
|
+
const Trigger = Primitives.Trigger;
|
|
11
|
+
Trigger.displayName = "AlertDialog.Trigger";
|
|
12
|
+
const Portal = ({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/React.createElement(Primitives.AlertDialogPortal, Object.assign({
|
|
17
|
+
className: clx(className)
|
|
18
|
+
}, props));
|
|
19
|
+
};
|
|
20
|
+
Portal.displayName = "AlertDialog.Portal";
|
|
21
|
+
const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Primitives.Overlay, Object.assign({
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: clx("bg-ui-bg-overlay fixed inset-0 z-50 backdrop-blur-sm",
|
|
28
|
+
// "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", // Re-enable when Admin UI has been cleaned up
|
|
29
|
+
className)
|
|
30
|
+
}, props));
|
|
31
|
+
});
|
|
32
|
+
Overlay.displayName = "AlertDialog.Overlay";
|
|
33
|
+
const Title = /*#__PURE__*/React.forwardRef(({
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
return /*#__PURE__*/React.createElement(Primitives.Title, Object.assign({
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: clx(className)
|
|
41
|
+
}, props, {
|
|
42
|
+
asChild: true
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Heading, {
|
|
44
|
+
level: "h2"
|
|
45
|
+
}, children));
|
|
46
|
+
});
|
|
47
|
+
Title.displayName = "AlertDialog.Title";
|
|
48
|
+
const Content = /*#__PURE__*/React.forwardRef(({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}, ref) => {
|
|
52
|
+
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Overlay, null), /*#__PURE__*/React.createElement(Primitives.Content, Object.assign({
|
|
53
|
+
ref: ref,
|
|
54
|
+
className: clx("bg-ui-bg-base shadow-elevation-flyout fixed left-[50%] top-[50%] z-50 flex w-full max-w-[400px] translate-x-[-50%] translate-y-[-50%] flex-col rounded-lg border focus:outline-none",
|
|
55
|
+
// "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", // Re-enable when Admin UI has been cleaned up
|
|
56
|
+
className)
|
|
57
|
+
}, props)));
|
|
58
|
+
});
|
|
59
|
+
Content.displayName = "AlertDialog.Content";
|
|
60
|
+
const Description = /*#__PURE__*/React.forwardRef(({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}, ref) => {
|
|
64
|
+
return /*#__PURE__*/React.createElement(Primitives.Description, Object.assign({
|
|
65
|
+
ref: ref,
|
|
66
|
+
className: clx("text-subtle", labelVariants({
|
|
67
|
+
size: "base"
|
|
68
|
+
}), className)
|
|
69
|
+
}, props));
|
|
70
|
+
});
|
|
71
|
+
Description.displayName = "AlertDialog.Description";
|
|
72
|
+
const Action = /*#__PURE__*/React.forwardRef(({
|
|
73
|
+
className,
|
|
74
|
+
children,
|
|
75
|
+
...props
|
|
76
|
+
}, ref) => {
|
|
77
|
+
return /*#__PURE__*/React.createElement(Primitives.Action, Object.assign({
|
|
78
|
+
ref: ref,
|
|
79
|
+
className: clx("", className)
|
|
80
|
+
}, props, {
|
|
81
|
+
asChild: true
|
|
82
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
variant: "danger"
|
|
84
|
+
}, children));
|
|
85
|
+
});
|
|
86
|
+
Action.displayName = "AlertDialog.Action";
|
|
87
|
+
const Cancel = /*#__PURE__*/React.forwardRef(({
|
|
88
|
+
className,
|
|
89
|
+
children,
|
|
90
|
+
...props
|
|
91
|
+
}, ref) => {
|
|
92
|
+
return /*#__PURE__*/React.createElement(Primitives.Cancel, Object.assign({
|
|
93
|
+
ref: ref,
|
|
94
|
+
className: clx(className)
|
|
95
|
+
}, props, {
|
|
96
|
+
asChild: true
|
|
97
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
98
|
+
variant: "secondary"
|
|
99
|
+
}, children));
|
|
100
|
+
});
|
|
101
|
+
Cancel.displayName = "AlertDialog.Cancel";
|
|
102
|
+
const Header = ({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}) => {
|
|
106
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
107
|
+
className: clx("flex flex-col gap-y-1 px-6 pt-6", className)
|
|
108
|
+
}, props));
|
|
109
|
+
};
|
|
110
|
+
const Footer = ({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}) => {
|
|
114
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
115
|
+
className: clx("flex items-center justify-end gap-x-2 p-6", className)
|
|
116
|
+
}, props));
|
|
117
|
+
};
|
|
118
|
+
const AlertDialog = Object.assign(Root, {
|
|
119
|
+
Trigger,
|
|
120
|
+
Content,
|
|
121
|
+
Title,
|
|
122
|
+
Description,
|
|
123
|
+
Action,
|
|
124
|
+
Cancel,
|
|
125
|
+
Header,
|
|
126
|
+
Footer
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export { AlertDialog };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as Primitives from '@radix-ui/react-avatar';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
import { labelVariants } from '../label/label.js';
|
|
6
|
+
|
|
7
|
+
const avatarVariants = cva("border-ui-border-strong flex shrink-0 items-center justify-center overflow-hidden border", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
squared: "rounded-lg",
|
|
11
|
+
rounded: "rounded-full"
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
base: "h-8 w-8",
|
|
15
|
+
large: "h-10 w-10"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "rounded",
|
|
20
|
+
size: "base"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const innerVariants = cva("aspect-square object-cover object-center", {
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
squared: "rounded-lg",
|
|
27
|
+
rounded: "rounded-full"
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
base: clx(labelVariants({
|
|
31
|
+
size: "small",
|
|
32
|
+
weight: "plus"
|
|
33
|
+
}), "h-6 w-6"),
|
|
34
|
+
large: clx(labelVariants({
|
|
35
|
+
size: "base",
|
|
36
|
+
weight: "plus"
|
|
37
|
+
}), "h-8 w-8")
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "rounded",
|
|
42
|
+
size: "base"
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const Avatar = /*#__PURE__*/React.forwardRef(({
|
|
46
|
+
src,
|
|
47
|
+
fallback,
|
|
48
|
+
variant = "rounded",
|
|
49
|
+
size = "base",
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}, ref) => {
|
|
53
|
+
return /*#__PURE__*/React.createElement(Primitives.Root, Object.assign({
|
|
54
|
+
ref: ref
|
|
55
|
+
}, props, {
|
|
56
|
+
className: clx(avatarVariants({
|
|
57
|
+
variant,
|
|
58
|
+
size
|
|
59
|
+
}), className)
|
|
60
|
+
}), src && /*#__PURE__*/React.createElement(Primitives.Image, {
|
|
61
|
+
src: src,
|
|
62
|
+
className: innerVariants({
|
|
63
|
+
variant,
|
|
64
|
+
size
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/React.createElement(Primitives.Fallback, {
|
|
67
|
+
className: clx(innerVariants({
|
|
68
|
+
variant,
|
|
69
|
+
size
|
|
70
|
+
}), "bg-ui-bg-component text-ui-fg-subtle pointer-events-none flex select-none items-center justify-center")
|
|
71
|
+
}, fallback));
|
|
72
|
+
});
|
|
73
|
+
Avatar.displayName = "Avatar";
|
|
74
|
+
|
|
75
|
+
export { Avatar };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
import { labelVariants } from '../label/label.js';
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva("inline-flex items-center gap-x-0.5 border", {
|
|
8
|
+
variants: {
|
|
9
|
+
type: {
|
|
10
|
+
default: "rounded-md",
|
|
11
|
+
rounded: "rounded-full",
|
|
12
|
+
icon: "rounded-md"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
sm: clx("px-1.5", labelVariants({
|
|
16
|
+
size: "xsmall",
|
|
17
|
+
weight: "plus"
|
|
18
|
+
})),
|
|
19
|
+
md: clx("px-2 py-0.5", labelVariants({
|
|
20
|
+
size: "small",
|
|
21
|
+
weight: "plus"
|
|
22
|
+
})),
|
|
23
|
+
lg: clx("px-2.5 py-1", labelVariants({
|
|
24
|
+
size: "base",
|
|
25
|
+
weight: "plus"
|
|
26
|
+
}))
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
green: "bg-ui-tag-green-bg text-ui-tag-green-text [&_svg]:text-ui-tag-green-icon border-ui-tag-green-border",
|
|
30
|
+
red: "bg-ui-tag-red-bg text-ui-tag-red-text [&_svg]:text-ui-tag-red-icon border-ui-tag-red-border",
|
|
31
|
+
blue: "bg-ui-tag-blue-bg text-ui-tag-blue-text [&_svg]:text-ui-tag-blue-icon border-ui-tag-blue-border",
|
|
32
|
+
orange: "bg-ui-tag-orange-bg text-ui-tag-orange-text [&_svg]:text-ui-tag-orange-icon border-ui-tag-orange-border",
|
|
33
|
+
grey: "bg-ui-tag-neutral-bg text-ui-tag-neutral-text [&_svg]:text-ui-tag-neutral-icon border-ui-tag-neutral-border",
|
|
34
|
+
purple: "bg-ui-tag-purple-bg text-ui-tag-purple-text [&_svg]:text-ui-tag-purple-icon border-ui-tag-purple-border"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [{
|
|
38
|
+
type: "icon",
|
|
39
|
+
size: "lg",
|
|
40
|
+
className: "p-1"
|
|
41
|
+
}, {
|
|
42
|
+
type: "icon",
|
|
43
|
+
size: "md",
|
|
44
|
+
className: "p-0.5"
|
|
45
|
+
}, {
|
|
46
|
+
type: "icon",
|
|
47
|
+
size: "sm",
|
|
48
|
+
className: "p-0.5" // Icon does not get any smaller than `md`
|
|
49
|
+
}],
|
|
50
|
+
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
size: "md",
|
|
53
|
+
type: "default",
|
|
54
|
+
color: "grey"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const Badge = /*#__PURE__*/React.forwardRef(({
|
|
58
|
+
className,
|
|
59
|
+
size,
|
|
60
|
+
type,
|
|
61
|
+
color,
|
|
62
|
+
asChild = false,
|
|
63
|
+
...props
|
|
64
|
+
}, ref) => {
|
|
65
|
+
const Component = asChild ? Slot : "span";
|
|
66
|
+
return /*#__PURE__*/React.createElement(Component, Object.assign({
|
|
67
|
+
ref: ref,
|
|
68
|
+
className: clx(badgeVariants({
|
|
69
|
+
size,
|
|
70
|
+
type,
|
|
71
|
+
color
|
|
72
|
+
}), className)
|
|
73
|
+
}, props));
|
|
74
|
+
});
|
|
75
|
+
Badge.displayName = "Badge";
|
|
76
|
+
|
|
77
|
+
export { Badge };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
import { labelVariants } from '../label/label.js';
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva("disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled relative inline-flex w-fit items-center overflow-hidden rounded-lg border outline-none transition-all after:absolute after:inset-0 after:content-[''] disabled:!shadow-none", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
primary: "shadow-buttons-primary text-ui-fg-on-inverted border-ui-border-loud bg-ui-button-inverted after:button-inverted-gradient hover:bg-ui-button-inverted-hover hover:after:button-inverted-hover-gradient active:bg-ui-button-inverted-pressed active:after:button-inverted-pressed-gradient focus:shadow-buttons-primary-focus",
|
|
11
|
+
secondary: "shadow-buttons-secondary text-ui-fg-base border-ui-border-loud-muted 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-secondary-focus bg-clip-padding",
|
|
12
|
+
transparent: "text-ui-fg-base border-ui-border-loud-transparent bg-ui-button-transparent hover:bg-ui-button-transparent-hover hover:border-ui-border-loud-muted active:bg-ui-button-transparent-pressed active:border-ui-border-base focus:shadow-borders-focus focus:bg-ui-bg-base focus:border-ui-border-base",
|
|
13
|
+
danger: "shadow-buttons-danger text-ui-fg-on-inverted border-ui-border-danger bg-ui-button-danger after:button-danger-gradient hover:bg-ui-button-danger-hover hover:after:button-danger-hover-gradient active:bg-ui-button-danger-pressed active:after:button-danger-pressed-gradient focus:shadow-buttons-danger-focus"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: clx("gap-x-0.5 px-[7px] py-[1px]", labelVariants({
|
|
17
|
+
size: "xsmall",
|
|
18
|
+
weight: "plus"
|
|
19
|
+
})),
|
|
20
|
+
md: clx("gap-x-1.5 px-[11px] py-[5px]", labelVariants({
|
|
21
|
+
size: "small",
|
|
22
|
+
weight: "plus"
|
|
23
|
+
})),
|
|
24
|
+
lg: clx("gap-x-2 px-[15px] py-[9px]", labelVariants({
|
|
25
|
+
size: "base",
|
|
26
|
+
weight: "plus"
|
|
27
|
+
})),
|
|
28
|
+
xl: clx("gap-x-2 px-[19px] py-[13px]", labelVariants({
|
|
29
|
+
size: "large",
|
|
30
|
+
weight: "plus"
|
|
31
|
+
}))
|
|
32
|
+
},
|
|
33
|
+
format: {
|
|
34
|
+
default: "",
|
|
35
|
+
icon: ""
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: "primary",
|
|
40
|
+
size: "md",
|
|
41
|
+
format: "default"
|
|
42
|
+
},
|
|
43
|
+
compoundVariants: [{
|
|
44
|
+
size: "sm",
|
|
45
|
+
format: "icon",
|
|
46
|
+
className: "px-px py-px"
|
|
47
|
+
}, {
|
|
48
|
+
size: "md",
|
|
49
|
+
format: "icon",
|
|
50
|
+
className: "px-[5px] py-[5px]"
|
|
51
|
+
}, {
|
|
52
|
+
size: "lg",
|
|
53
|
+
format: "icon",
|
|
54
|
+
className: "px-[9px] py-[9px]"
|
|
55
|
+
}, {
|
|
56
|
+
size: "xl",
|
|
57
|
+
format: "icon",
|
|
58
|
+
className: "px-[13px] py-[13px]"
|
|
59
|
+
}]
|
|
60
|
+
});
|
|
61
|
+
const Button = /*#__PURE__*/React.forwardRef(({
|
|
62
|
+
size,
|
|
63
|
+
variant,
|
|
64
|
+
format,
|
|
65
|
+
className,
|
|
66
|
+
asChild = false,
|
|
67
|
+
children,
|
|
68
|
+
...props
|
|
69
|
+
}, ref) => {
|
|
70
|
+
const Component = asChild ? Slot : "button";
|
|
71
|
+
return /*#__PURE__*/React.createElement(Component, Object.assign({
|
|
72
|
+
ref: ref
|
|
73
|
+
}, props, {
|
|
74
|
+
className: clx(buttonVariants({
|
|
75
|
+
variant,
|
|
76
|
+
size,
|
|
77
|
+
format
|
|
78
|
+
}), className)
|
|
79
|
+
}), children);
|
|
80
|
+
});
|
|
81
|
+
Button.displayName = "Button";
|
|
82
|
+
|
|
83
|
+
export { Button };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MinusMini, CheckMini } from '@medusajs/icons';
|
|
2
|
+
import * as Primitives from '@radix-ui/react-checkbox';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
|
|
6
|
+
const Checkbox = /*#__PURE__*/React.forwardRef(({
|
|
7
|
+
className,
|
|
8
|
+
checked,
|
|
9
|
+
...props
|
|
10
|
+
}, ref) => {
|
|
11
|
+
return /*#__PURE__*/React.createElement(Primitives.Root, Object.assign({}, props, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
checked: checked,
|
|
14
|
+
className: clx("group relative inline-flex h-5 w-5 items-center justify-center outline-none ", className)
|
|
15
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "text-ui-fg-on-color bg-ui-bg-base shadow-borders-base-w-shadow group-hover:shadow-borders-strong-w-shadow group-focus:!shadow-borders-interactive-w-focus group-data-[state=checked]:bg-ui-bg-interactive group-data-[state=checked]:shadow-borders-interactive group-data-[state=indeterminate]:bg-ui-bg-interactive group-data-[state=indeterminate]:shadow-borders-interactive [&_path]:shadow-details-contrast-on-bg-interactive group-disabled:text-ui-fg-disabled group-disabled:!bg-ui-bg-disabled group-disabled:!shadow-borders-base h-[14px] w-[14px] rounded-[3px] transition-all"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Primitives.Indicator, {
|
|
18
|
+
className: "absolute inset-0"
|
|
19
|
+
}, checked === "indeterminate" ? /*#__PURE__*/React.createElement(MinusMini, null) : /*#__PURE__*/React.createElement(CheckMini, null))));
|
|
20
|
+
});
|
|
21
|
+
Checkbox.displayName = "Checkbox";
|
|
22
|
+
|
|
23
|
+
export { Checkbox };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { clx } from '../../utils/clx.js';
|
|
3
|
+
|
|
4
|
+
const Container = /*#__PURE__*/React.forwardRef(({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}, ref) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
9
|
+
ref: ref,
|
|
10
|
+
className: clx("shadow-elevation-card-rest bg-ui-bg-base w-full rounded-lg px-8 pb-8 pt-6", className)
|
|
11
|
+
}, props));
|
|
12
|
+
});
|
|
13
|
+
Container.displayName = "Container";
|
|
14
|
+
|
|
15
|
+
export { Container };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { XMark } from '@medusajs/icons';
|
|
2
|
+
import * as Primitives from '@radix-ui/react-dialog';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
import { Badge } from '../badge/badge.js';
|
|
6
|
+
import { Text } from '../text/text.js';
|
|
7
|
+
import { Button } from '../button/button.js';
|
|
8
|
+
import { Heading } from '../heading/heading.js';
|
|
9
|
+
|
|
10
|
+
const Root = Primitives.Root;
|
|
11
|
+
Root.displayName = "Drawer.Root";
|
|
12
|
+
const Trigger = Primitives.Trigger;
|
|
13
|
+
Trigger.displayName = "Drawer.Trigger";
|
|
14
|
+
const Close = Primitives.Close;
|
|
15
|
+
Close.displayName = "Drawer.Close";
|
|
16
|
+
const Portal = Primitives.Portal;
|
|
17
|
+
Portal.displayName = "Drawer.Portal";
|
|
18
|
+
const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
19
|
+
className,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
22
|
+
return /*#__PURE__*/React.createElement(Primitives.Overlay, Object.assign({
|
|
23
|
+
ref: ref,
|
|
24
|
+
className: clx("fixed inset-0 z-50", className)
|
|
25
|
+
}, props));
|
|
26
|
+
});
|
|
27
|
+
Overlay.displayName = "Drawer.Overlay";
|
|
28
|
+
const Content = /*#__PURE__*/React.forwardRef(({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}, ref) => {
|
|
32
|
+
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Overlay, null), /*#__PURE__*/React.createElement(Primitives.Content, Object.assign({
|
|
33
|
+
ref: ref,
|
|
34
|
+
className: clx("bg-ui-bg-base shadow-elevation-modal fixed inset-y-2 right-2 z-50 flex w-full max-w-[560px] flex-1 flex-col rounded-lg border focus:outline-none",
|
|
35
|
+
// "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", // Re-enable when Admin UI has been cleaned up
|
|
36
|
+
className)
|
|
37
|
+
}, props)));
|
|
38
|
+
});
|
|
39
|
+
Content.displayName = "Drawer.Content";
|
|
40
|
+
const Header = ({
|
|
41
|
+
children,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) => {
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
46
|
+
className: "border-ui-border-base flex items-start justify-between gap-x-4 border-b px-8 py-6"
|
|
47
|
+
}, props), /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: clx("flex flex-col gap-y-1", className)
|
|
49
|
+
}, children), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: "flex items-center gap-x-2"
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Badge, {
|
|
52
|
+
size: "sm",
|
|
53
|
+
color: "grey"
|
|
54
|
+
}, "esc"), /*#__PURE__*/React.createElement(Close, {
|
|
55
|
+
asChild: true
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
57
|
+
variant: "transparent",
|
|
58
|
+
size: "sm",
|
|
59
|
+
format: "icon"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(XMark, null)))));
|
|
61
|
+
};
|
|
62
|
+
Header.displayName = "Drawer.Header";
|
|
63
|
+
const Body = ({
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}) => {
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
68
|
+
className: clx("flex-1 px-8 pb-16 pt-6", className)
|
|
69
|
+
}, props));
|
|
70
|
+
};
|
|
71
|
+
Body.displayName = "Drawer.Body";
|
|
72
|
+
const Footer = ({
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}) => {
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
77
|
+
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)
|
|
78
|
+
}, props));
|
|
79
|
+
};
|
|
80
|
+
Footer.displayName = "Drawer.Footer";
|
|
81
|
+
const Title = /*#__PURE__*/React.forwardRef(({
|
|
82
|
+
className,
|
|
83
|
+
children,
|
|
84
|
+
...props
|
|
85
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Title, Object.assign({
|
|
86
|
+
ref: ref,
|
|
87
|
+
className: clx(className),
|
|
88
|
+
asChild: true
|
|
89
|
+
}, props), /*#__PURE__*/React.createElement(Heading, {
|
|
90
|
+
level: "h1"
|
|
91
|
+
}, children)));
|
|
92
|
+
Title.displayName = "Drawer.Title";
|
|
93
|
+
const Description = /*#__PURE__*/React.forwardRef(({
|
|
94
|
+
className,
|
|
95
|
+
children,
|
|
96
|
+
...props
|
|
97
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Description, Object.assign({
|
|
98
|
+
ref: ref,
|
|
99
|
+
className: clx(className),
|
|
100
|
+
asChild: true
|
|
101
|
+
}, props), /*#__PURE__*/React.createElement(Text, null, children)));
|
|
102
|
+
Description.displayName = "Drawer.Description";
|
|
103
|
+
const Drawer = Object.assign(Root, {
|
|
104
|
+
Body,
|
|
105
|
+
Close,
|
|
106
|
+
Content,
|
|
107
|
+
Description,
|
|
108
|
+
Footer,
|
|
109
|
+
Header,
|
|
110
|
+
Title,
|
|
111
|
+
Trigger
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { Drawer };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { ChevronRightMini, CheckMini, EllipseMiniSolid } from '@medusajs/icons';
|
|
2
|
+
import * as Primitives from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clx } from '../../utils/clx.js';
|
|
5
|
+
import { labelVariants } from '../label/label.js';
|
|
6
|
+
|
|
7
|
+
const Root = Primitives.Root;
|
|
8
|
+
Root.displayName = "DropdownMenu.Root";
|
|
9
|
+
const Trigger = Primitives.Trigger;
|
|
10
|
+
Trigger.displayName = "DropdownMenu.Trigger";
|
|
11
|
+
const Group = Primitives.Group;
|
|
12
|
+
Group.displayName = "DropdownMenu.Group";
|
|
13
|
+
const SubMenu = Primitives.Sub;
|
|
14
|
+
SubMenu.displayName = "DropdownMenu.SubMenu";
|
|
15
|
+
const RadioGroup = Primitives.RadioGroup;
|
|
16
|
+
RadioGroup.displayName = "DropdownMenu.RadioGroup";
|
|
17
|
+
const SubMenuTrigger = /*#__PURE__*/React.forwardRef(({
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.SubTrigger, Object.assign({
|
|
22
|
+
ref: ref,
|
|
23
|
+
className: clx("focus:bg-ui-bg-base-pressed data-[state=open]:bg-ui-bg-base-pressed flex cursor-default select-none items-center rounded-sm px-3 py-2 outline-none", labelVariants({
|
|
24
|
+
size: "small"
|
|
25
|
+
}), className)
|
|
26
|
+
}, props), children, /*#__PURE__*/React.createElement(ChevronRightMini, {
|
|
27
|
+
className: "ml-auto"
|
|
28
|
+
})));
|
|
29
|
+
SubMenuTrigger.displayName = "DropdownMenu.SubMenuTrigger";
|
|
30
|
+
const SubMenuContent = /*#__PURE__*/React.forwardRef(({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Portal, null, /*#__PURE__*/React.createElement(Primitives.SubContent, Object.assign({
|
|
34
|
+
ref: ref,
|
|
35
|
+
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 shadow-elevation-flyout z-50 min-w-[8rem] overflow-hidden rounded-lg border p-1", className)
|
|
36
|
+
}, props))));
|
|
37
|
+
SubMenuContent.displayName = "DropdownMenu.SubMenuContent";
|
|
38
|
+
const Content = /*#__PURE__*/React.forwardRef(({
|
|
39
|
+
className,
|
|
40
|
+
sideOffset = 4,
|
|
41
|
+
align = "start",
|
|
42
|
+
...props
|
|
43
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Portal, null, /*#__PURE__*/React.createElement(Primitives.Content, Object.assign({
|
|
44
|
+
ref: ref,
|
|
45
|
+
sideOffset: sideOffset,
|
|
46
|
+
align: align,
|
|
47
|
+
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 shadow-elevation-flyout z-50 min-w-[300px] overflow-hidden rounded-lg p-1", className)
|
|
48
|
+
}, props))));
|
|
49
|
+
Content.displayName = "DropdownMenu.Content";
|
|
50
|
+
const Item = /*#__PURE__*/React.forwardRef(({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Item, Object.assign({
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: clx("bg-ui-bg-base 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 px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none", labelVariants({
|
|
56
|
+
size: "small"
|
|
57
|
+
}), className)
|
|
58
|
+
}, props)));
|
|
59
|
+
Item.displayName = "DropdownMenu.Item";
|
|
60
|
+
const CheckboxItem = /*#__PURE__*/React.forwardRef(({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
checked,
|
|
64
|
+
...props
|
|
65
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.CheckboxItem, Object.assign({
|
|
66
|
+
ref: ref,
|
|
67
|
+
className: clx("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", className),
|
|
68
|
+
checked: checked
|
|
69
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
className: "absolute left-3 flex h-5 w-5 items-center justify-center"
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Primitives.ItemIndicator, null, /*#__PURE__*/React.createElement(CheckMini, null))), children));
|
|
72
|
+
CheckboxItem.displayName = "DropdownMenu.CheckboxItem";
|
|
73
|
+
const RadioItem = /*#__PURE__*/React.forwardRef(({
|
|
74
|
+
className,
|
|
75
|
+
children,
|
|
76
|
+
...props
|
|
77
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.RadioItem, Object.assign({
|
|
78
|
+
ref: ref,
|
|
79
|
+
className: clx("focus:bg-ui-bg-base-pressed hover:bg-ui-base-hover bg-ui-bg-base 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", labelVariants({
|
|
80
|
+
size: "small"
|
|
81
|
+
}), className)
|
|
82
|
+
}, props), /*#__PURE__*/React.createElement("span", {
|
|
83
|
+
className: "absolute left-3 flex h-5 w-5 items-center justify-center"
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Primitives.ItemIndicator, null, /*#__PURE__*/React.createElement(EllipseMiniSolid, {
|
|
85
|
+
className: "text-ui-fg-base"
|
|
86
|
+
}))), children));
|
|
87
|
+
RadioItem.displayName = "DropdownMenu.RadioItem";
|
|
88
|
+
const Label = /*#__PURE__*/React.forwardRef(({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Label, Object.assign({
|
|
92
|
+
ref: ref,
|
|
93
|
+
className: clx("text-ui-fg-subtle px-2 py-1.5", labelVariants({
|
|
94
|
+
size: "xsmall",
|
|
95
|
+
weight: "plus"
|
|
96
|
+
}), className)
|
|
97
|
+
}, props)));
|
|
98
|
+
Label.displayName = "DropdownMenu.Label";
|
|
99
|
+
const Separator = /*#__PURE__*/React.forwardRef(({
|
|
100
|
+
className,
|
|
101
|
+
...props
|
|
102
|
+
}, ref) => /*#__PURE__*/React.createElement(Primitives.Separator, Object.assign({
|
|
103
|
+
ref: ref,
|
|
104
|
+
className: clx("bg-ui-border-base -mx-1 my-1 h-px", className)
|
|
105
|
+
}, props)));
|
|
106
|
+
Separator.displayName = "DropdownMenu.Separator";
|
|
107
|
+
const Shortcut = ({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}) => {
|
|
111
|
+
return /*#__PURE__*/React.createElement("span", Object.assign({
|
|
112
|
+
className: clx("text-ui-fg-subtle ml-auto tracking-widest", labelVariants({
|
|
113
|
+
size: "small"
|
|
114
|
+
}), className)
|
|
115
|
+
}, props));
|
|
116
|
+
};
|
|
117
|
+
Shortcut.displayName = "DropdownMenu.Shortcut";
|
|
118
|
+
const Hint = ({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}) => {
|
|
122
|
+
return /*#__PURE__*/React.createElement("span", Object.assign({
|
|
123
|
+
className: clx("text-ui-fg-subtle ml-auto tracking-widest", labelVariants({
|
|
124
|
+
size: "small"
|
|
125
|
+
}), className)
|
|
126
|
+
}, props));
|
|
127
|
+
};
|
|
128
|
+
Hint.displayName = "DropdownMenu.Hint";
|
|
129
|
+
const DropdownMenu = Object.assign(Root, {
|
|
130
|
+
Trigger,
|
|
131
|
+
Group,
|
|
132
|
+
SubMenu,
|
|
133
|
+
SubMenuContent,
|
|
134
|
+
SubMenuTrigger,
|
|
135
|
+
Content,
|
|
136
|
+
Item,
|
|
137
|
+
CheckboxItem,
|
|
138
|
+
RadioGroup,
|
|
139
|
+
RadioItem,
|
|
140
|
+
Label,
|
|
141
|
+
Separator,
|
|
142
|
+
Shortcut,
|
|
143
|
+
Hint
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export { DropdownMenu };
|