@medusajs/ui 1.0.0 → 2.0.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.
Files changed (199) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -2
  3. package/dist/cjs/components/badge/badge.d.ts +16 -5
  4. package/dist/cjs/components/badge/badge.js +20 -31
  5. package/dist/cjs/components/badge/badge.js.map +1 -1
  6. package/dist/cjs/components/button/button.d.ts +1 -2
  7. package/dist/cjs/components/button/button.js +9 -37
  8. package/dist/cjs/components/button/button.js.map +1 -1
  9. package/dist/cjs/components/calendar/calendar.js +4 -4
  10. package/dist/cjs/components/calendar/calendar.js.map +1 -1
  11. package/dist/cjs/components/code-block/code-block.d.ts +3 -5
  12. package/dist/cjs/components/code-block/code-block.js +19 -19
  13. package/dist/cjs/components/code-block/code-block.js.map +1 -1
  14. package/dist/cjs/components/command-bar/command-bar.d.ts +22 -0
  15. package/dist/cjs/components/command-bar/command-bar.js +63 -0
  16. package/dist/cjs/components/command-bar/command-bar.js.map +1 -0
  17. package/dist/cjs/components/command-bar/index.d.ts +1 -0
  18. package/dist/cjs/components/command-bar/index.js +5 -0
  19. package/dist/cjs/components/command-bar/index.js.map +1 -0
  20. package/dist/cjs/components/container/container.d.ts +1 -1
  21. package/dist/cjs/components/container/container.js.map +1 -1
  22. package/dist/cjs/components/currency-input/currency-input.d.ts +21 -0
  23. package/dist/cjs/components/currency-input/currency-input.js +54 -0
  24. package/dist/cjs/components/currency-input/currency-input.js.map +1 -0
  25. package/dist/cjs/components/currency-input/index.d.ts +1 -0
  26. package/dist/cjs/components/currency-input/index.js +5 -0
  27. package/dist/cjs/components/currency-input/index.js.map +1 -0
  28. package/dist/cjs/components/date-picker/date-picker.d.ts +1 -1
  29. package/dist/cjs/components/date-picker/date-picker.js +42 -28
  30. package/dist/cjs/components/date-picker/date-picker.js.map +1 -1
  31. package/dist/cjs/components/drawer/drawer.d.ts +13 -15
  32. package/dist/cjs/components/drawer/drawer.js +53 -44
  33. package/dist/cjs/components/drawer/drawer.js.map +1 -1
  34. package/dist/cjs/components/dropdown-menu/dropdown-menu.js +2 -2
  35. package/dist/cjs/components/dropdown-menu/dropdown-menu.js.map +1 -1
  36. package/dist/cjs/components/focus-modal/focus-modal.d.ts +9 -12
  37. package/dist/cjs/components/focus-modal/focus-modal.js +39 -35
  38. package/dist/cjs/components/focus-modal/focus-modal.js.map +1 -1
  39. package/dist/cjs/components/heading/heading.js +3 -3
  40. package/dist/cjs/components/heading/heading.js.map +1 -1
  41. package/dist/cjs/components/hint/hint.d.ts +1 -1
  42. package/dist/cjs/components/icon-badge/icon-badge.d.ts +20 -0
  43. package/dist/cjs/components/icon-badge/icon-badge.js +24 -0
  44. package/dist/cjs/components/icon-badge/icon-badge.js.map +1 -0
  45. package/dist/cjs/components/icon-badge/index.d.ts +1 -0
  46. package/dist/cjs/components/icon-badge/index.js +5 -0
  47. package/dist/cjs/components/icon-badge/index.js.map +1 -0
  48. package/dist/cjs/components/icon-button/icon-button.d.ts +21 -0
  49. package/dist/cjs/components/icon-button/icon-button.js +48 -0
  50. package/dist/cjs/components/icon-button/icon-button.js.map +1 -0
  51. package/dist/cjs/components/icon-button/index.d.ts +1 -0
  52. package/dist/cjs/components/icon-button/index.js +5 -0
  53. package/dist/cjs/components/icon-button/index.js.map +1 -0
  54. package/dist/cjs/components/input/input.js +5 -5
  55. package/dist/cjs/components/input/input.js.map +1 -1
  56. package/dist/cjs/components/kbd/kbd.d.ts +1 -1
  57. package/dist/cjs/components/kbd/kbd.js +4 -3
  58. package/dist/cjs/components/kbd/kbd.js.map +1 -1
  59. package/dist/cjs/components/progress-accordion/index.d.ts +1 -0
  60. package/dist/cjs/components/progress-accordion/index.js +5 -0
  61. package/dist/cjs/components/progress-accordion/index.js.map +1 -0
  62. package/dist/cjs/components/progress-accordion/progress-accordion.d.ts +19 -0
  63. package/dist/cjs/components/progress-accordion/progress-accordion.js +54 -0
  64. package/dist/cjs/components/progress-accordion/progress-accordion.js.map +1 -0
  65. package/dist/cjs/components/progress-tabs/index.d.ts +1 -0
  66. package/dist/cjs/components/progress-tabs/index.js +5 -0
  67. package/dist/cjs/components/progress-tabs/index.js.map +1 -0
  68. package/dist/cjs/components/progress-tabs/progress-tabs.d.ts +15 -0
  69. package/dist/cjs/components/progress-tabs/progress-tabs.js +46 -0
  70. package/dist/cjs/components/progress-tabs/progress-tabs.js.map +1 -0
  71. package/dist/cjs/components/prompt/prompt.js +3 -3
  72. package/dist/cjs/components/prompt/prompt.js.map +1 -1
  73. package/dist/cjs/components/select/select.js +1 -1
  74. package/dist/cjs/components/select/select.js.map +1 -1
  75. package/dist/cjs/components/status-badge/index.d.ts +1 -0
  76. package/dist/cjs/components/status-badge/index.js +5 -0
  77. package/dist/cjs/components/status-badge/index.js.map +1 -0
  78. package/dist/cjs/components/status-badge/status-badge.d.ts +6 -0
  79. package/dist/cjs/components/status-badge/status-badge.js +23 -0
  80. package/dist/cjs/components/status-badge/status-badge.js.map +1 -0
  81. package/dist/cjs/components/switch/switch.js +1 -1
  82. package/dist/cjs/components/switch/switch.js.map +1 -1
  83. package/dist/cjs/components/table/table.js +3 -3
  84. package/dist/cjs/components/table/table.js.map +1 -1
  85. package/dist/cjs/components/tabs/index.d.ts +1 -0
  86. package/dist/cjs/components/tabs/index.js +5 -0
  87. package/dist/cjs/components/tabs/index.js.map +1 -0
  88. package/dist/cjs/components/tabs/tabs.d.ts +11 -0
  89. package/dist/cjs/components/tabs/tabs.js +25 -0
  90. package/dist/cjs/components/tabs/tabs.js.map +1 -0
  91. package/dist/cjs/components/toast/toast.js +1 -1
  92. package/dist/cjs/components/toast/toast.js.map +1 -1
  93. package/dist/cjs/components/tooltip/tooltip.js +1 -1
  94. package/dist/cjs/components/tooltip/tooltip.js.map +1 -1
  95. package/dist/cjs/index.d.ts +9 -0
  96. package/dist/cjs/index.js +20 -1
  97. package/dist/cjs/index.js.map +1 -1
  98. package/dist/cjs/types.d.ts +5 -0
  99. package/dist/cjs/types.js +3 -0
  100. package/dist/cjs/types.js.map +1 -0
  101. package/dist/esm/components/badge/badge.d.ts +16 -5
  102. package/dist/esm/components/badge/badge.js +19 -31
  103. package/dist/esm/components/badge/badge.js.map +1 -1
  104. package/dist/esm/components/button/button.d.ts +1 -2
  105. package/dist/esm/components/button/button.js +9 -37
  106. package/dist/esm/components/button/button.js.map +1 -1
  107. package/dist/esm/components/calendar/calendar.js +4 -4
  108. package/dist/esm/components/calendar/calendar.js.map +1 -1
  109. package/dist/esm/components/code-block/code-block.d.ts +3 -5
  110. package/dist/esm/components/code-block/code-block.js +7 -7
  111. package/dist/esm/components/code-block/code-block.js.map +1 -1
  112. package/dist/esm/components/command-bar/command-bar.d.ts +22 -0
  113. package/dist/esm/components/command-bar/command-bar.js +59 -0
  114. package/dist/esm/components/command-bar/command-bar.js.map +1 -0
  115. package/dist/esm/components/command-bar/index.d.ts +1 -0
  116. package/dist/esm/components/command-bar/index.js +2 -0
  117. package/dist/esm/components/command-bar/index.js.map +1 -0
  118. package/dist/esm/components/container/container.d.ts +1 -1
  119. package/dist/esm/components/container/container.js.map +1 -1
  120. package/dist/esm/components/currency-input/currency-input.d.ts +21 -0
  121. package/dist/esm/components/currency-input/currency-input.js +50 -0
  122. package/dist/esm/components/currency-input/currency-input.js.map +1 -0
  123. package/dist/esm/components/currency-input/index.d.ts +1 -0
  124. package/dist/esm/components/currency-input/index.js +2 -0
  125. package/dist/esm/components/currency-input/index.js.map +1 -0
  126. package/dist/esm/components/date-picker/date-picker.d.ts +1 -1
  127. package/dist/esm/components/date-picker/date-picker.js +44 -30
  128. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  129. package/dist/esm/components/drawer/drawer.d.ts +13 -15
  130. package/dist/esm/components/drawer/drawer.js +53 -44
  131. package/dist/esm/components/drawer/drawer.js.map +1 -1
  132. package/dist/esm/components/dropdown-menu/dropdown-menu.js +2 -2
  133. package/dist/esm/components/dropdown-menu/dropdown-menu.js.map +1 -1
  134. package/dist/esm/components/focus-modal/focus-modal.d.ts +9 -12
  135. package/dist/esm/components/focus-modal/focus-modal.js +39 -35
  136. package/dist/esm/components/focus-modal/focus-modal.js.map +1 -1
  137. package/dist/esm/components/heading/heading.js +3 -3
  138. package/dist/esm/components/heading/heading.js.map +1 -1
  139. package/dist/esm/components/hint/hint.d.ts +1 -1
  140. package/dist/esm/components/icon-badge/icon-badge.d.ts +20 -0
  141. package/dist/esm/components/icon-badge/icon-badge.js +20 -0
  142. package/dist/esm/components/icon-badge/icon-badge.js.map +1 -0
  143. package/dist/esm/components/icon-badge/index.d.ts +1 -0
  144. package/dist/esm/components/icon-badge/index.js +2 -0
  145. package/dist/esm/components/icon-badge/index.js.map +1 -0
  146. package/dist/esm/components/icon-button/icon-button.d.ts +21 -0
  147. package/dist/esm/components/icon-button/icon-button.js +43 -0
  148. package/dist/esm/components/icon-button/icon-button.js.map +1 -0
  149. package/dist/esm/components/icon-button/index.d.ts +1 -0
  150. package/dist/esm/components/icon-button/index.js +2 -0
  151. package/dist/esm/components/icon-button/index.js.map +1 -0
  152. package/dist/esm/components/input/input.js +5 -5
  153. package/dist/esm/components/input/input.js.map +1 -1
  154. package/dist/esm/components/kbd/kbd.d.ts +1 -1
  155. package/dist/esm/components/kbd/kbd.js +4 -3
  156. package/dist/esm/components/kbd/kbd.js.map +1 -1
  157. package/dist/esm/components/progress-accordion/index.d.ts +1 -0
  158. package/dist/esm/components/progress-accordion/index.js +2 -0
  159. package/dist/esm/components/progress-accordion/index.js.map +1 -0
  160. package/dist/esm/components/progress-accordion/progress-accordion.d.ts +19 -0
  161. package/dist/esm/components/progress-accordion/progress-accordion.js +50 -0
  162. package/dist/esm/components/progress-accordion/progress-accordion.js.map +1 -0
  163. package/dist/esm/components/progress-tabs/index.d.ts +1 -0
  164. package/dist/esm/components/progress-tabs/index.js +2 -0
  165. package/dist/esm/components/progress-tabs/index.js.map +1 -0
  166. package/dist/esm/components/progress-tabs/progress-tabs.d.ts +15 -0
  167. package/dist/esm/components/progress-tabs/progress-tabs.js +42 -0
  168. package/dist/esm/components/progress-tabs/progress-tabs.js.map +1 -0
  169. package/dist/esm/components/prompt/prompt.js +3 -3
  170. package/dist/esm/components/prompt/prompt.js.map +1 -1
  171. package/dist/esm/components/select/select.js +1 -1
  172. package/dist/esm/components/select/select.js.map +1 -1
  173. package/dist/esm/components/status-badge/index.d.ts +1 -0
  174. package/dist/esm/components/status-badge/index.js +2 -0
  175. package/dist/esm/components/status-badge/index.js.map +1 -0
  176. package/dist/esm/components/status-badge/status-badge.d.ts +6 -0
  177. package/dist/esm/components/status-badge/status-badge.js +19 -0
  178. package/dist/esm/components/status-badge/status-badge.js.map +1 -0
  179. package/dist/esm/components/switch/switch.js +1 -1
  180. package/dist/esm/components/switch/switch.js.map +1 -1
  181. package/dist/esm/components/table/table.js +3 -3
  182. package/dist/esm/components/table/table.js.map +1 -1
  183. package/dist/esm/components/tabs/index.d.ts +1 -0
  184. package/dist/esm/components/tabs/index.js +2 -0
  185. package/dist/esm/components/tabs/index.js.map +1 -0
  186. package/dist/esm/components/tabs/tabs.d.ts +11 -0
  187. package/dist/esm/components/tabs/tabs.js +21 -0
  188. package/dist/esm/components/tabs/tabs.js.map +1 -0
  189. package/dist/esm/components/toast/toast.js +1 -1
  190. package/dist/esm/components/toast/toast.js.map +1 -1
  191. package/dist/esm/components/tooltip/tooltip.js +1 -1
  192. package/dist/esm/components/tooltip/tooltip.js.map +1 -1
  193. package/dist/esm/index.d.ts +9 -0
  194. package/dist/esm/index.js +10 -0
  195. package/dist/esm/index.js.map +1 -1
  196. package/dist/esm/types.d.ts +5 -0
  197. package/dist/esm/types.js +2 -0
  198. package/dist/esm/types.js.map +1 -0
  199. package/package.json +12 -5
@@ -4,65 +4,74 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Drawer = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const icons_1 = require("@medusajs/icons");
7
- const Primitives = tslib_1.__importStar(require("@radix-ui/react-dialog"));
7
+ const DrawerPrimitives = tslib_1.__importStar(require("@radix-ui/react-dialog"));
8
8
  const React = tslib_1.__importStar(require("react"));
9
- const button_1 = require("../button");
10
9
  const heading_1 = require("../heading");
11
- const clx_1 = require("../../utils/clx");
10
+ const icon_button_1 = require("../icon-button");
12
11
  const kbd_1 = require("../kbd");
13
12
  const text_1 = require("../text");
14
- const Root = Primitives.Root;
15
- Root.displayName = "Drawer.Root";
16
- const Trigger = Primitives.Trigger;
17
- Trigger.displayName = "Drawer.Trigger";
18
- const Close = Primitives.Close;
19
- Close.displayName = "Drawer.Close";
20
- const Portal = Primitives.Portal;
21
- Portal.displayName = "Drawer.Portal";
22
- const Overlay = React.forwardRef(({ className, ...props }, ref) => {
23
- return (React.createElement(Primitives.Overlay, { ref: ref, className: (0, clx_1.clx)("fixed inset-0 z-50", className), ...props }));
13
+ const clx_1 = require("../../utils/clx");
14
+ const DrawerRoot = (props) => {
15
+ return React.createElement(DrawerPrimitives.Root, { ...props });
16
+ };
17
+ DrawerRoot.displayName = "Drawer.Root";
18
+ const DrawerTrigger = React.forwardRef(({ className, ...props }, ref) => {
19
+ return (React.createElement(DrawerPrimitives.Trigger, { ref: ref, className: (0, clx_1.clx)(className), ...props }));
20
+ });
21
+ DrawerTrigger.displayName = "Drawer.Trigger";
22
+ const DrawerClose = React.forwardRef(({ className, ...props }, ref) => {
23
+ return (React.createElement(DrawerPrimitives.Close, { ref: ref, className: (0, clx_1.clx)(className), ...props }));
24
+ });
25
+ DrawerClose.displayName = "Drawer.Close";
26
+ const DrawerPortal = (props) => {
27
+ return React.createElement(DrawerPrimitives.DialogPortal, { ...props });
28
+ };
29
+ DrawerPortal.displayName = "Drawer.Portal";
30
+ const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => {
31
+ return (React.createElement(DrawerPrimitives.Overlay, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-overlay fixed inset-0", className), ...props }));
24
32
  });
25
- Overlay.displayName = "Drawer.Overlay";
26
- const Content = React.forwardRef(({ className, ...props }, ref) => {
27
- return (React.createElement(Portal, null,
28
- React.createElement(Overlay, null),
29
- React.createElement(Primitives.Content, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 right-2 z-50 flex w-full max-w-[560px] flex-1 flex-col rounded-lg border focus:outline-none",
33
+ DrawerOverlay.displayName = "Drawer.Overlay";
34
+ const DrawerContent = React.forwardRef(({ className, ...props }, ref) => {
35
+ return (React.createElement(DrawerPortal, null,
36
+ React.createElement(DrawerOverlay, null),
37
+ React.createElement(DrawerPrimitives.Content, { ref: ref, className: (0, clx_1.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",
30
38
  // "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",
31
39
  className), ...props })));
32
40
  });
33
- Content.displayName = "Drawer.Content";
34
- const Header = ({ children, className, ...props }) => {
35
- return (React.createElement("div", { className: "border-ui-border-base flex items-start justify-between gap-x-4 border-b px-8 py-6", ...props },
41
+ DrawerContent.displayName = "Drawer.Content";
42
+ const DrawerHeader = React.forwardRef(({ children, className, ...props }, ref) => {
43
+ 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 },
36
44
  React.createElement("div", { className: (0, clx_1.clx)("flex flex-col gap-y-1", className) }, children),
37
45
  React.createElement("div", { className: "flex items-center gap-x-2" },
38
46
  React.createElement(kbd_1.Kbd, null, "esc"),
39
- React.createElement(Close, { asChild: true },
40
- React.createElement(button_1.Button, { variant: "transparent", size: "small", format: "icon" },
47
+ React.createElement(DrawerPrimitives.Close, { asChild: true },
48
+ React.createElement(icon_button_1.IconButton, { variant: "transparent" },
41
49
  React.createElement(icons_1.XMark, null))))));
42
- };
43
- Header.displayName = "Drawer.Header";
44
- const Body = ({ className, ...props }) => {
45
- return React.createElement("div", { className: (0, clx_1.clx)("flex-1 px-8 pb-16 pt-6", className), ...props });
46
- };
47
- Body.displayName = "Drawer.Body";
48
- const Footer = ({ className, ...props }) => {
50
+ });
51
+ DrawerHeader.displayName = "Drawer.Header";
52
+ const DrawerBody = React.forwardRef(({ className, ...props }, ref) => {
53
+ return (React.createElement("div", { ref: ref, className: (0, clx_1.clx)("flex-1 px-8 pb-16 pt-6", className), ...props }));
54
+ });
55
+ DrawerBody.displayName = "Drawer.Body";
56
+ const DrawerFooter = ({ className, ...props }) => {
49
57
  return (React.createElement("div", { className: (0, clx_1.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 }));
50
58
  };
51
- Footer.displayName = "Drawer.Footer";
52
- const Title = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.Title, { ref: ref, className: (0, clx_1.clx)(className), asChild: true, ...props },
59
+ DrawerFooter.displayName = "Drawer.Footer";
60
+ const DrawerTitle = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DrawerPrimitives.Title, { ref: ref, className: (0, clx_1.clx)(className), asChild: true, ...props },
53
61
  React.createElement(heading_1.Heading, { level: "h1" }, children))));
54
- Title.displayName = "Drawer.Title";
55
- const Description = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(Primitives.Description, { ref: ref, className: (0, clx_1.clx)(className), asChild: true, ...props },
62
+ DrawerTitle.displayName = "Drawer.Title";
63
+ const DrawerDescription = React.forwardRef(({ className, children, ...props }, ref) => (React.createElement(DrawerPrimitives.Description, { ref: ref, className: (0, clx_1.clx)(className), asChild: true, ...props },
56
64
  React.createElement(text_1.Text, null, children))));
57
- Description.displayName = "Drawer.Description";
58
- exports.Drawer = Object.assign(Root, {
59
- Body,
60
- Close,
61
- Content,
62
- Description,
63
- Footer,
64
- Header,
65
- Title,
66
- Trigger,
65
+ DrawerDescription.displayName = "Drawer.Description";
66
+ const Drawer = Object.assign(DrawerRoot, {
67
+ Body: DrawerBody,
68
+ Close: DrawerClose,
69
+ Content: DrawerContent,
70
+ Description: DrawerDescription,
71
+ Footer: DrawerFooter,
72
+ Header: DrawerHeader,
73
+ Title: DrawerTitle,
74
+ Trigger: DrawerTrigger,
67
75
  });
76
+ exports.Drawer = Drawer;
68
77
  //# 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,2CAAuC;AACvC,2EAAoD;AACpD,qDAA8B;AAE9B,gDAA4C;AAC5C,kDAA8C;AAC9C,qCAAiC;AACjC,gCAA4B;AAC5B,kCAA8B;AAE9B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,aAAa,CAAA;AAEhC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAEtC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;AAC9B,KAAK,CAAC,WAAW,GAAG,cAAc,CAAA;AAElC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;AAChC,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAG9B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,UAAU,CAAC,OAAO,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,oBAAoB,EAAE,SAAS,CAAC,KAC3C,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAEtC,MAAM,OA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zC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,yGAAyG,EACzG,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;AAEpC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAG5B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,UAAU,CAAC,KAAK,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,SAAG,EAAC,SAAS,CAAC,EAAE,OAAO,WAAK,KAAK;IACtE,oBAAC,iBAAO,IAAC,KAAK,EAAC,IAAI,IAAE,QAAQ,CAAW,CACvB,CACpB,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,cAAc,CAAA;AAElC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,UAAU,CAAC,WAAW,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,SAAS,CAAC,EACzB,OAAO,WACH,KAAK;IAET,oBAAC,WAAI,QAAE,QAAQ,CAAQ,CACA,CAC1B,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAEjC,QAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACxC,IAAI;IACJ,KAAK;IACL,OAAO;IACP,WAAW;IACX,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;CACR,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as Primitives from \"@radix-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/button\"\nimport { Heading } from \"@/components/heading\"\nimport { clx } from \"@/utils/clx\"\nimport { Kbd } from \"../kbd\"\nimport { Text } from \"../text\"\n\nconst Root = Primitives.Root\nRoot.displayName = \"Drawer.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"Drawer.Trigger\"\n\nconst Close = Primitives.Close\nClose.displayName = \"Drawer.Close\"\n\nconst Portal = Primitives.Portal\nPortal.displayName = \"Drawer.Portal\"\n\nconst Overlay = React.forwardRef<\n React.ElementRef<typeof Primitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof Primitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Overlay\n ref={ref}\n className={clx(\"fixed inset-0 z-50\", className)}\n {...props}\n />\n )\n})\nOverlay.displayName = \"Drawer.Overlay\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <Portal>\n <Overlay />\n <Primitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal border-ui-border-base fixed inset-y-2 right-2 z-50 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 </Portal>\n )\n})\nContent.displayName = \"Drawer.Content\"\n\nconst Header = ({\n children,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\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 <Close asChild>\n <Button variant=\"transparent\" size={\"small\"} format={\"icon\"}>\n <XMark />\n </Button>\n </Close>\n </div>\n </div>\n )\n}\nHeader.displayName = \"Drawer.Header\"\n\nconst Body = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return <div className={clx(\"flex-1 px-8 pb-16 pt-6\", className)} {...props} />\n}\nBody.displayName = \"Drawer.Body\"\n\nconst Footer = ({\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}\nFooter.displayName = \"Drawer.Footer\"\n\nconst Title = React.forwardRef<\n React.ElementRef<typeof Primitives.Title>,\n React.ComponentPropsWithoutRef<typeof Primitives.Title>\n>(({ className, children, ...props }, ref) => (\n <Primitives.Title ref={ref} className={clx(className)} asChild {...props}>\n <Heading level=\"h1\">{children}</Heading>\n </Primitives.Title>\n))\nTitle.displayName = \"Drawer.Title\"\n\nconst Description = React.forwardRef<\n React.ElementRef<typeof Primitives.Description>,\n React.ComponentPropsWithoutRef<typeof Primitives.Description>\n>(({ className, children, ...props }, ref) => (\n <Primitives.Description\n ref={ref}\n className={clx(className)}\n asChild\n {...props}\n >\n <Text>{children}</Text>\n </Primitives.Description>\n))\nDescription.displayName = \"Drawer.Description\"\n\nexport const Drawer = Object.assign(Root, {\n Body,\n Close,\n Content,\n Description,\n Footer,\n Header,\n Title,\n Trigger,\n})\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../../../src/components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAuC;AACvC,iFAA0D;AAC1D,qDAA8B;AAE9B,kDAA8C;AAC9C,0DAAqD;AACrD,0CAAsC;AACtC,4CAAwC;AACxC,qCAAiC;AAEjC,MAAM,UAAU,GAAG,CACjB,KAAmE,EACnE,EAAE;IACF,OAAO,oBAAC,gBAAgB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AAC7C,CAAC,CAAA;AACD,UAAU,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AE,YAAY;IACpB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,aAAa;CACvB,CAAC,CAAA;AAEO,wBAAM","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as DrawerPrimitives from \"@radix-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"]}
@@ -22,10 +22,10 @@ const SubMenuTrigger = React.forwardRef(({ className, children, ...props }, ref)
22
22
  React.createElement(icons_1.ChevronRightMini, { className: "ml-auto" }))));
23
23
  SubMenuTrigger.displayName = "DropdownMenu.SubMenuTrigger";
24
24
  const SubMenuContent = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Portal, null,
25
- React.createElement(Primitives.SubContent, { ref: ref, className: (0, clx_1.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), ...props }))));
25
+ React.createElement(Primitives.SubContent, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout 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 }))));
26
26
  SubMenuContent.displayName = "DropdownMenu.SubMenuContent";
27
27
  const Content = React.forwardRef(({ className, sideOffset = 8, align = "start", ...props }, ref) => (React.createElement(Primitives.Portal, null,
28
- React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, align: align, className: (0, clx_1.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), ...props }))));
28
+ React.createElement(Primitives.Content, { ref: ref, sideOffset: sideOffset, align: align, className: (0, clx_1.clx)("bg-ui-bg-base text-ui-fg-base shadow-elevation-flyout min-w-[300px] 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 }))));
29
29
  Content.displayName = "DropdownMenu.Content";
30
30
  const Item = React.forwardRef(({ className, ...props }, ref) => (React.createElement(Primitives.Item, { ref: ref, className: (0, clx_1.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-default select-none items-center rounded-md px-3 py-2 outline-none transition-colors data-[disabled]:pointer-events-none", className), ...props })));
31
31
  Item.displayName = "DropdownMenu.Item";
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAA+E;AAC/E,kFAA2D;AAC3D,qDAA8B;AAE9B,qCAAiC;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,CAGrC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,UAAU,CAAC,UAAU,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,sKAAsK,EACtK,SAAS,CACV,KACG,KAAK;IAER,QAAQ;IACT,oBAAC,wBAAgB,IAAC,SAAS,EAAC,SA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,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,UAAU,CAAC,SAAS,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,wBAAwB,CAAA;AAEhD,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,IAAA,SAAG,EACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,uBAAuB,CAAA;AAE9C,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,IAAA,SAAG,EACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACvC,OAAO;IACP,KAAK;IACL,OAAO;IACP,cAAc;IACd,cAAc;IACd,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEO,oCAAY","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,2CAA+E;AAC/E,kFAA2D;AAC3D,qDAA8B;AAE9B,qCAAiC;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,CAGrC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,oBAAC,UAAU,CAAC,UAAU,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,sKAAsK,EACtK,SAAS,CACV,KACG,KA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CACV,KACG,KAAK,GACT,CACH,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGhC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,oBAAC,UAAU,CAAC,SAAS,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EAAC,mCAAmC,EAAE,SAAS,CAAC,KAC1D,KAAK,GACT,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,wBAAwB,CAAA;AAEhD,MAAM,QAAQ,GAAG,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,IAAA,SAAG,EACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,uBAAuB,CAAA;AAE9C,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,8BACE,SAAS,EAAE,IAAA,SAAG,EACZ,6DAA6D,EAC7D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEtC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACvC,OAAO;IACP,KAAK;IACL,OAAO;IACP,cAAc;IACd,cAAc;IACd,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;IACL,SAAS;IACT,QAAQ;IACR,IAAI;CACL,CAAC,CAAA;AAEO,oCAAY","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 shadow-elevation-flyout 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>(({ 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 shadow-elevation-flyout min-w-[300px] 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))\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,15 +1,12 @@
1
- import * as Primitives from "@radix-ui/react-dialog";
1
+ import * as FocusModalPrimitives from "@radix-ui/react-dialog";
2
2
  import * as React from "react";
3
- declare const FocusModal: React.FC<Primitives.DialogProps> & {
4
- Trigger: React.ForwardRefExoticComponent<Primitives.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- Content: React.ForwardRefExoticComponent<Omit<Primitives.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
- Header: {
7
- ({ children, className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
8
- displayName: string;
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 };
@@ -4,52 +4,56 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.FocusModal = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const icons_1 = require("@medusajs/icons");
7
- const Primitives = tslib_1.__importStar(require("@radix-ui/react-dialog"));
7
+ const FocusModalPrimitives = tslib_1.__importStar(require("@radix-ui/react-dialog"));
8
8
  const React = tslib_1.__importStar(require("react"));
9
+ const icon_button_1 = require("../icon-button");
9
10
  const kbd_1 = require("../kbd");
10
11
  const clx_1 = require("../../utils/clx");
11
- const button_1 = require("../button");
12
- const Root = Primitives.Root;
13
- Root.displayName = "FocusModal.Root";
14
- const Trigger = Primitives.Trigger;
15
- Trigger.displayName = "FocusModal.Trigger";
16
- const Portal = ({ className, ...props }) => {
17
- return React.createElement(Primitives.DialogPortal, { className: (0, clx_1.clx)(className), ...props });
12
+ const FocusModalRoot = (props) => {
13
+ return React.createElement(FocusModalPrimitives.Root, { ...props });
18
14
  };
19
- Portal.displayName = "FocusModal.Portal";
20
- const Overlay = React.forwardRef(({ className, ...props }, ref) => {
21
- return (React.createElement(Primitives.Overlay, { ref: ref, className: (0, clx_1.clx)("fixed inset-0 z-50",
22
- // "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
15
+ FocusModalRoot.displayName = "FocusModal";
16
+ const FocusModalTrigger = React.forwardRef((props, ref) => {
17
+ return React.createElement(FocusModalPrimitives.Trigger, { ref: ref, ...props });
18
+ });
19
+ FocusModalTrigger.displayName = "FocusModal.Trigger";
20
+ const FocusModalPortal = ({ className, ...props }) => {
21
+ return (React.createElement(FocusModalPrimitives.DialogPortal, { className: (0, clx_1.clx)(className), ...props }));
22
+ };
23
+ FocusModalPortal.displayName = "FocusModal.Portal";
24
+ const FocusModalOverlay = React.forwardRef(({ className, ...props }, ref) => {
25
+ return (React.createElement(FocusModalPrimitives.Overlay, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-overlay fixed inset-0",
26
+ // "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23
27
  className), ...props }));
24
28
  });
25
- Overlay.displayName = "FocusModal.Overlay";
26
- const Content = React.forwardRef(({ className, ...props }, ref) => {
27
- return (React.createElement(Portal, null,
28
- React.createElement(Overlay, null),
29
- React.createElement(Primitives.Content, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base shadow-elevation-modal fixed inset-2 z-50 flex flex-col 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", // Re-enable when Admin UI has been cleaned up
29
+ FocusModalOverlay.displayName = "FocusModal.Overlay";
30
+ const FocusModalContent = React.forwardRef(({ className, ...props }, ref) => {
31
+ return (React.createElement(FocusModalPortal, null,
32
+ React.createElement(FocusModalOverlay, null),
33
+ React.createElement(FocusModalPrimitives.Content, { ref: ref, className: (0, clx_1.clx)("bg-ui-bg-base shadow-elevation-modal fixed inset-2 flex flex-col overflow-hidden rounded-lg border focus:outline-none",
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]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200",
31
35
  className), ...props })));
32
36
  });
33
- Content.displayName = "FocusModal.Content";
34
- const Header = ({ children, className, ...props }) => {
35
- return (React.createElement("div", { className: (0, clx_1.clx)("border-ui-border-base flex items-start justify-between gap-x-4 border-b p-4", className), ...props },
37
+ FocusModalContent.displayName = "FocusModal.Content";
38
+ const FocusModalHeader = React.forwardRef(({ children, className, ...props }, ref) => {
39
+ return (React.createElement("div", { ref: ref, className: (0, clx_1.clx)("border-ui-border-base flex items-center justify-between gap-x-4 border-b px-4 py-2", className), ...props },
36
40
  React.createElement("div", { className: "flex items-center gap-x-2" },
37
- React.createElement(Primitives.Close, { asChild: true },
38
- React.createElement(button_1.Button, { variant: "transparent", size: "small", format: "icon" },
41
+ React.createElement(FocusModalPrimitives.Close, { asChild: true },
42
+ React.createElement(icon_button_1.IconButton, { variant: "transparent" },
39
43
  React.createElement(icons_1.XMark, null))),
40
44
  React.createElement(kbd_1.Kbd, null, "esc")),
41
- React.createElement("div", null, children)));
42
- };
43
- Header.displayName = "FocusModal.Header";
44
- const Body = ({ className, ...props }) => {
45
- return React.createElement("div", { className: (0, clx_1.clx)("flex-1", className), ...props });
46
- };
47
- Body.displayName = "FocusModal.Body";
48
- const FocusModal = Object.assign(Root, {
49
- Trigger,
50
- Content,
51
- Header,
52
- Body,
45
+ children));
46
+ });
47
+ FocusModalHeader.displayName = "FocusModal.Header";
48
+ const FocusModalBody = React.forwardRef(({ className, ...props }, ref) => {
49
+ return React.createElement("div", { ref: ref, className: (0, clx_1.clx)("flex-1", className), ...props });
50
+ });
51
+ FocusModalBody.displayName = "FocusModal.Body";
52
+ const FocusModal = Object.assign(FocusModalRoot, {
53
+ Trigger: FocusModalTrigger,
54
+ Content: FocusModalContent,
55
+ Header: FocusModalHeader,
56
+ Body: FocusModalBody,
53
57
  });
54
58
  exports.FocusModal = FocusModal;
55
59
  //# 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,2CAAuC;AACvC,2EAAoD;AACpD,qDAA8B;AAE9B,0CAAsC;AAC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M,GAAG,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,CACL,6BACE,SAAS,EAAE,IAAA,SAAG,EACZ,6EAA6E,EAC7E,SAAS,CACV,KACG,KAAK;QAET,6BAAK,SAAS,EAAC,2BAA2B;YACxC,oBAAC,UAAU,CAAC,KAAK,IAAC,OAAO;gBACvB,oBAAC,eAAM,IAAC,OAAO,EAAC,aAAa,EAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;oBACzD,oBAAC,aAAK,OAAG,CACF,CACQ;YACnB,oBAAC,SAAG,cAAU,CACV;QACN,iCAAM,QAAQ,CAAO,CACjB,CACP,CAAA;AACH,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAExC,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,6BAAK,SAAS,EAAE,IAAA,SAAG,EAAC,QAAQ,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAA;AAChE,CAAC,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IACrC,OAAO;IACP,OAAO;IACP,MAAM;IACN,IAAI;CACL,CAAC,CAAA;AAEO,gCAAU","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as Primitives from \"@radix-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { Kbd } from \"@/components/kbd\"\nimport { clx } from \"@/utils/clx\"\nimport { Button } from \"../button\"\n\nconst Root = Primitives.Root\nRoot.displayName = \"FocusModal.Root\"\n\nconst Trigger = Primitives.Trigger\nTrigger.displayName = \"FocusModal.Trigger\"\n\nconst Portal = ({ className, ...props }: Primitives.DialogPortalProps) => {\n return <Primitives.DialogPortal className={clx(className)} {...props} />\n}\nPortal.displayName = \"FocusModal.Portal\"\n\nconst Overlay = React.forwardRef<\n React.ElementRef<typeof Primitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof Primitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <Primitives.Overlay\n ref={ref}\n className={clx(\n \"fixed inset-0 z-50\",\n // \"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\n className\n )}\n {...props}\n />\n )\n})\nOverlay.displayName = \"FocusModal.Overlay\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitives.Content>,\n React.ComponentPropsWithoutRef<typeof Primitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <Portal>\n <Overlay />\n <Primitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal fixed inset-2 z-50 flex 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]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200\", // Re-enable when Admin UI has been cleaned up\n className\n )}\n {...props}\n />\n </Portal>\n )\n})\nContent.displayName = \"FocusModal.Content\"\n\nconst Header = ({\n children,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className={clx(\n \"border-ui-border-base flex items-start justify-between gap-x-4 border-b p-4\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-x-2\">\n <Primitives.Close asChild>\n <Button variant=\"transparent\" size={\"small\"} format={\"icon\"}>\n <XMark />\n </Button>\n </Primitives.Close>\n <Kbd>esc</Kbd>\n </div>\n <div>{children}</div>\n </div>\n )\n}\nHeader.displayName = \"FocusModal.Header\"\n\nconst Body = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n return <div className={clx(\"flex-1\", className)} {...props} />\n}\nBody.displayName = \"FocusModal.Body\"\n\nconst FocusModal = Object.assign(Root, {\n Trigger,\n Content,\n Header,\n Body,\n})\n\nexport { FocusModal }\n"]}
1
+ {"version":3,"file":"focus-modal.js","sourceRoot":"","sources":["../../../../src/components/focus-modal/focus-modal.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;AAEZ,2CAAuC;AACvC,qFAA8D;AAC9D,qDAA8B;AAE9B,0DAAqD;AACrD,0CAAsC;AACtC,qCAAiC;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,OAAO,CACL,oBAAC,oBAAoB,CAAC,YAAY,IAAC,SAAS,EAAE,IAAA,SAAG,EAAC,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5E,CAAA;AACH,CAAC,CAAA;AACD,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAElD,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAGxC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,oBAAoB,CAAC,OAAO,IAC3B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,gCAAgC;QAChC,6HAA6H;QAC7H,SAAS,CACV,KACG,KAAK,GACT,CACH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AAC,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;AAEO,gCAAU","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"]}
@@ -8,9 +8,9 @@ const clx_1 = require("../../utils/clx");
8
8
  const headingVariants = (0, class_variance_authority_1.cva)("font-sans font-medium", {
9
9
  variants: {
10
10
  level: {
11
- h1: "text-xl leading-8",
12
- h2: "text-base leading-6",
13
- h3: "text-sm leading-5",
11
+ h1: "h1-core",
12
+ h2: "h2-core",
13
+ h3: "h3-core",
14
14
  },
15
15
  },
16
16
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../../src/components/heading/heading.tsx"],"names":[],"mappings":";;;;AAAA,uEAAiE;AACjE,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,eAAe,GAAG,IAAA,8BAAG,EAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAE,mBAAmB;YACvB,EAAE,EAAE,qBAAqB;YACzB,EAAE,EAAE,mBAAmB;SACxB;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAA;AAgBgB,0CAAe;AAXjC,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,IAAA,SAAG,EAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAEQ,0BAAO","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: \"text-xl leading-8\",\n h2: \"text-base leading-6\",\n h3: \"text-sm leading-5\",\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
+ {"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../../src/components/heading/heading.tsx"],"names":[],"mappings":";;;;AAAA,uEAAiE;AACjE,qDAA8B;AAE9B,qCAAiC;AAEjC,MAAM,eAAe,GAAG,IAAA,8BAAG,EAAC,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;AAgBgB,0CAAe;AAXjC,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,IAAA,SAAG,EAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAEQ,0BAAO","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?: "info" | "error" | null | undefined;
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,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IconBadge = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_slot_1 = require("@radix-ui/react-slot");
6
+ const class_variance_authority_1 = require("class-variance-authority");
7
+ const React = tslib_1.__importStar(require("react"));
8
+ const badge_1 = require("../badge");
9
+ const clx_1 = require("../../utils/clx");
10
+ const iconBadgeVariants = (0, class_variance_authority_1.cva)("flex items-center justify-center overflow-hidden rounded-md border", {
11
+ variants: {
12
+ size: {
13
+ base: "h-6 w-6",
14
+ large: "h-7 w-7",
15
+ },
16
+ },
17
+ });
18
+ const IconBadge = React.forwardRef(({ children, className, color = "grey", size = "base", asChild = false, ...props }, ref) => {
19
+ const Component = asChild ? react_slot_1.Slot : "span";
20
+ return (React.createElement(Component, { ref: ref, className: (0, clx_1.clx)((0, badge_1.badgeColorVariants)({ color }), iconBadgeVariants({ size }), className), ...props }, children));
21
+ });
22
+ exports.IconBadge = IconBadge;
23
+ IconBadge.displayName = "IconBadge";
24
+ //# 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,qDAA2C;AAC3C,uEAAiE;AACjE,qDAA8B;AAE9B,8CAAuD;AACvD,qCAAiC;AAEjC,MAAM,iBAAiB,GAAG,IAAA,8BAAG,EAC3B,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,iBAAI,CAAC,CAAC,CAAC,MAAM,CAAA;IAEzC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,SAAG,EACZ,IAAA,0BAAkB,EAAC,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;AAGQ,8BAAS;AAFlB,SAAS,CAAC,WAAW,GAAG,WAAW,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,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./icon-badge"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icon-badge/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B","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,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iconButtonVariants = exports.IconButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_variance_authority_1 = require("class-variance-authority");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const clx_1 = require("../../utils/clx");
8
+ const icons_1 = require("@medusajs/icons");
9
+ const react_slot_1 = require("@radix-ui/react-slot");
10
+ const iconButtonVariants = (0, class_variance_authority_1.cva)((0, clx_1.clx)("transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md border outline-none", "disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:!shadow-none disabled:after:hidden", "after:absolute after:inset-0 after:content-['']"), {
11
+ variants: {
12
+ variant: {
13
+ primary: (0, clx_1.clx)("shadow-buttons-neutral text-ui-fg-base border-ui-border-base 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"),
14
+ transparent: (0, clx_1.clx)("text-ui-fg-base border-ui-border-transparent bg-ui-button-transparent", "hover:bg-ui-button-transparent-hover", "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", "disabled:!border-none disabled:!bg-transparent disabled:!shadow-none"),
15
+ },
16
+ size: {
17
+ base: "h-8 w-8 p-[5px]",
18
+ large: "h-10 w-10 p-[9px]",
19
+ xlarge: "h-12 w-12 p-[13px]",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: "primary",
24
+ size: "base",
25
+ },
26
+ });
27
+ exports.iconButtonVariants = iconButtonVariants;
28
+ const IconButton = React.forwardRef(({ variant = "primary", size = "base", asChild = false, className, children, isLoading = false, disabled, ...props }, ref) => {
29
+ const Component = asChild ? react_slot_1.Slot : "button";
30
+ /**
31
+ * In the case of a button where asChild is true, and isLoading is true, we ensure that
32
+ * only on element is passed as a child to the Slot component. This is because the Slot
33
+ * component only accepts a single child.
34
+ */
35
+ const renderInner = () => {
36
+ if (isLoading) {
37
+ return (React.createElement("span", { className: "pointer-events-none" },
38
+ React.createElement("div", { className: (0, clx_1.clx)("bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md") },
39
+ React.createElement(icons_1.Spinner, { className: "animate-spin" })),
40
+ children));
41
+ }
42
+ return children;
43
+ };
44
+ return (React.createElement(Component, { ref: ref, ...props, className: (0, clx_1.clx)(iconButtonVariants({ variant, size }), className), disabled: disabled || isLoading }, renderInner()));
45
+ });
46
+ exports.IconButton = IconButton;
47
+ IconButton.displayName = "IconButton";
48
+ //# sourceMappingURL=icon-button.js.map