@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
@@ -1,51 +1,55 @@
1
1
  "use client";
2
2
  import { XMark } from "@medusajs/icons";
3
- import * as Primitives from "@radix-ui/react-dialog";
3
+ import * as FocusModalPrimitives from "@radix-ui/react-dialog";
4
4
  import * as React from "react";
5
+ import { IconButton } from "../icon-button";
5
6
  import { Kbd } from "../kbd";
6
7
  import { clx } from "../../utils/clx";
7
- import { Button } from "../button";
8
- const Root = Primitives.Root;
9
- Root.displayName = "FocusModal.Root";
10
- const Trigger = Primitives.Trigger;
11
- Trigger.displayName = "FocusModal.Trigger";
12
- const Portal = ({ className, ...props }) => {
13
- return React.createElement(Primitives.DialogPortal, { className: clx(className), ...props });
8
+ const FocusModalRoot = (props) => {
9
+ return React.createElement(FocusModalPrimitives.Root, { ...props });
14
10
  };
15
- Portal.displayName = "FocusModal.Portal";
16
- const Overlay = React.forwardRef(({ className, ...props }, ref) => {
17
- return (React.createElement(Primitives.Overlay, { ref: ref, className: clx("fixed inset-0 z-50",
18
- // "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
11
+ FocusModalRoot.displayName = "FocusModal";
12
+ const FocusModalTrigger = React.forwardRef((props, ref) => {
13
+ return React.createElement(FocusModalPrimitives.Trigger, { ref: ref, ...props });
14
+ });
15
+ FocusModalTrigger.displayName = "FocusModal.Trigger";
16
+ const FocusModalPortal = ({ className, ...props }) => {
17
+ return (React.createElement(FocusModalPrimitives.DialogPortal, { className: clx(className), ...props }));
18
+ };
19
+ FocusModalPortal.displayName = "FocusModal.Portal";
20
+ const FocusModalOverlay = React.forwardRef(({ className, ...props }, ref) => {
21
+ return (React.createElement(FocusModalPrimitives.Overlay, { ref: ref, className: clx("bg-ui-bg-overlay fixed inset-0",
22
+ // "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
19
23
  className), ...props }));
20
24
  });
21
- Overlay.displayName = "FocusModal.Overlay";
22
- const Content = React.forwardRef(({ className, ...props }, ref) => {
23
- return (React.createElement(Portal, null,
24
- React.createElement(Overlay, null),
25
- React.createElement(Primitives.Content, { ref: ref, className: clx("bg-ui-bg-base shadow-elevation-modal fixed inset-2 z-50 flex flex-col rounded-lg border focus:outline-none",
26
- // "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200", // Re-enable when Admin UI has been cleaned up
25
+ FocusModalOverlay.displayName = "FocusModal.Overlay";
26
+ const FocusModalContent = React.forwardRef(({ className, ...props }, ref) => {
27
+ return (React.createElement(FocusModalPortal, null,
28
+ React.createElement(FocusModalOverlay, null),
29
+ React.createElement(FocusModalPrimitives.Content, { ref: ref, className: clx("bg-ui-bg-base shadow-elevation-modal fixed inset-2 flex flex-col overflow-hidden rounded-lg border focus:outline-none",
30
+ // "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200",
27
31
  className), ...props })));
28
32
  });
29
- Content.displayName = "FocusModal.Content";
30
- const Header = ({ children, className, ...props }) => {
31
- return (React.createElement("div", { className: clx("border-ui-border-base flex items-start justify-between gap-x-4 border-b p-4", className), ...props },
33
+ FocusModalContent.displayName = "FocusModal.Content";
34
+ const FocusModalHeader = React.forwardRef(({ children, className, ...props }, ref) => {
35
+ return (React.createElement("div", { ref: ref, className: clx("border-ui-border-base flex items-center justify-between gap-x-4 border-b px-4 py-2", className), ...props },
32
36
  React.createElement("div", { className: "flex items-center gap-x-2" },
33
- React.createElement(Primitives.Close, { asChild: true },
34
- React.createElement(Button, { variant: "transparent", size: "small", format: "icon" },
37
+ React.createElement(FocusModalPrimitives.Close, { asChild: true },
38
+ React.createElement(IconButton, { variant: "transparent" },
35
39
  React.createElement(XMark, null))),
36
40
  React.createElement(Kbd, null, "esc")),
37
- React.createElement("div", null, children)));
38
- };
39
- Header.displayName = "FocusModal.Header";
40
- const Body = ({ className, ...props }) => {
41
- return React.createElement("div", { className: clx("flex-1", className), ...props });
42
- };
43
- Body.displayName = "FocusModal.Body";
44
- const FocusModal = Object.assign(Root, {
45
- Trigger,
46
- Content,
47
- Header,
48
- Body,
41
+ children));
42
+ });
43
+ FocusModalHeader.displayName = "FocusModal.Header";
44
+ const FocusModalBody = React.forwardRef(({ className, ...props }, ref) => {
45
+ return React.createElement("div", { ref: ref, className: clx("flex-1", className), ...props });
46
+ });
47
+ FocusModalBody.displayName = "FocusModal.Body";
48
+ const FocusModal = Object.assign(FocusModalRoot, {
49
+ Trigger: FocusModalTrigger,
50
+ Content: FocusModalContent,
51
+ Header: FocusModalHeader,
52
+ Body: FocusModalBody,
49
53
  });
50
54
  export { FocusModal };
51
55
  //# sourceMappingURL=focus-modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focus-modal.js","sourceRoot":"","sources":["../../../../src/components/focus-modal/focus-modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;AAC5B,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAEpC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,OAAO,CAAC,WAAW,GAAG,oBAAoB,CAAA;AAE1C,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC,EAAE,EAAE;IACvE,OAAO,oBAAC,UAAU,CAAC,YAAY,IAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,KAAM,KAAK,GAAI,CAAA;AAC1E,CAAC,CAAA;AACD,MAAM,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAExC,MAA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,CAAA;AAExC,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EAC6B,EAAE,EAAE;IACzC,OAAO,6BAAK,SAAS,EAAE,GAAG,CAAC,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;AAEF,OAAO,EAAE,UAAU,EAAE,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 { 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,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,cAAc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AE,CAAA","sourcesContent":["\"use client\"\n\nimport { XMark } from \"@medusajs/icons\"\nimport * as FocusModalPrimitives from \"@radix-ui/react-dialog\"\nimport * as React from \"react\"\n\nimport { IconButton } from \"@/components/icon-button\"\nimport { Kbd } from \"@/components/kbd\"\nimport { clx } from \"@/utils/clx\"\n\nconst FocusModalRoot = (\n props: React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Root>\n) => {\n return <FocusModalPrimitives.Root {...props} />\n}\nFocusModalRoot.displayName = \"FocusModal\"\n\nconst FocusModalTrigger = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Trigger>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Trigger>\n>((props, ref) => {\n return <FocusModalPrimitives.Trigger ref={ref} {...props} />\n})\nFocusModalTrigger.displayName = \"FocusModal.Trigger\"\n\nconst FocusModalPortal = ({\n className,\n ...props\n}: FocusModalPrimitives.DialogPortalProps) => {\n return (\n <FocusModalPrimitives.DialogPortal className={clx(className)} {...props} />\n )\n}\nFocusModalPortal.displayName = \"FocusModal.Portal\"\n\nconst FocusModalOverlay = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Overlay>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Overlay>\n>(({ className, ...props }, ref) => {\n return (\n <FocusModalPrimitives.Overlay\n ref={ref}\n className={clx(\n \"bg-ui-bg-overlay fixed inset-0\",\n // \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n})\nFocusModalOverlay.displayName = \"FocusModal.Overlay\"\n\nconst FocusModalContent = React.forwardRef<\n React.ElementRef<typeof FocusModalPrimitives.Content>,\n React.ComponentPropsWithoutRef<typeof FocusModalPrimitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <FocusModalPortal>\n <FocusModalOverlay />\n <FocusModalPrimitives.Content\n ref={ref}\n className={clx(\n \"bg-ui-bg-base shadow-elevation-modal fixed inset-2 flex flex-col overflow-hidden rounded-lg border focus:outline-none\",\n // \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 duration-200\",\n className\n )}\n {...props}\n />\n </FocusModalPortal>\n )\n})\nFocusModalContent.displayName = \"FocusModal.Content\"\n\nconst FocusModalHeader = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={clx(\n \"border-ui-border-base flex items-center justify-between gap-x-4 border-b px-4 py-2\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-x-2\">\n <FocusModalPrimitives.Close asChild>\n <IconButton variant=\"transparent\">\n <XMark />\n </IconButton>\n </FocusModalPrimitives.Close>\n <Kbd>esc</Kbd>\n </div>\n {children}\n </div>\n )\n})\nFocusModalHeader.displayName = \"FocusModal.Header\"\n\nconst FocusModalBody = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => {\n return <div ref={ref} className={clx(\"flex-1\", className)} {...props} />\n})\nFocusModalBody.displayName = \"FocusModal.Body\"\n\nconst FocusModal = Object.assign(FocusModalRoot, {\n Trigger: FocusModalTrigger,\n Content: FocusModalContent,\n Header: FocusModalHeader,\n Body: FocusModalBody,\n})\n\nexport { FocusModal }\n"]}
@@ -4,9 +4,9 @@ import { clx } from "../../utils/clx";
4
4
  const headingVariants = cva("font-sans font-medium", {
5
5
  variants: {
6
6
  level: {
7
- h1: "text-xl leading-8",
8
- h2: "text-base leading-6",
9
- h3: "text-sm leading-5",
7
+ h1: "h1-core",
8
+ h2: "h2-core",
9
+ h3: "h3-core",
10
10
  },
11
11
  },
12
12
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../../src/components/heading/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAE,mBAAmB;YACvB,EAAE,EAAE,qBAAqB;YACzB,EAAE,EAAE,mBAAmB;SACxB;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAA;AAKF,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC/D,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAEtC,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst headingVariants = cva(\"font-sans font-medium\", {\n variants: {\n level: {\n h1: \"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,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE;IACnD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;SACd;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,IAAI;KACZ;CACF,CAAC,CAAA;AAKF,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC/D,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAEtC,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACjD,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst headingVariants = cva(\"font-sans font-medium\", {\n variants: {\n level: {\n h1: \"h1-core\",\n h2: \"h2-core\",\n h3: \"h3-core\",\n },\n },\n defaultVariants: {\n level: \"h1\",\n },\n})\n\ntype HeadingProps = VariantProps<typeof headingVariants> &\n React.HTMLAttributes<HTMLHeadingElement>\n\nconst Heading = ({ level, className, ...props }: HeadingProps) => {\n const Component = level ? level : \"h1\"\n\n return (\n <Component\n className={clx(headingVariants({ level }), className)}\n {...props}\n />\n )\n}\n\nexport { Heading, headingVariants }\n"]}
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  import * as React from "react";
3
3
  declare const Hint: React.ForwardRefExoticComponent<VariantProps<(props?: ({
4
- variant?: "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,20 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { cva } from "class-variance-authority";
3
+ import * as React from "react";
4
+ import { badgeColorVariants } from "../badge";
5
+ import { clx } from "../../utils/clx";
6
+ const iconBadgeVariants = cva("flex items-center justify-center overflow-hidden rounded-md border", {
7
+ variants: {
8
+ size: {
9
+ base: "h-6 w-6",
10
+ large: "h-7 w-7",
11
+ },
12
+ },
13
+ });
14
+ const IconBadge = React.forwardRef(({ children, className, color = "grey", size = "base", asChild = false, ...props }, ref) => {
15
+ const Component = asChild ? Slot : "span";
16
+ return (React.createElement(Component, { ref: ref, className: clx(badgeColorVariants({ color }), iconBadgeVariants({ size }), className), ...props }, children));
17
+ });
18
+ IconBadge.displayName = "IconBadge";
19
+ export { IconBadge };
20
+ //# sourceMappingURL=icon-badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-badge.js","sourceRoot":"","sources":["../../../../src/components/icon-badge/icon-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,iBAAiB,GAAG,GAAG,CAC3B,oEAAoE,EACpE;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SACjB;KACF;CACF,CACF,CAAA;AASD,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,EACE,QAAQ,EACR,SAAS,EACT,KAAK,GAAG,MAAM,EACd,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAA;IAEzC,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAC7B,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,EAC3B,SAAS,CACV,KACG,KAAK,IAER,QAAQ,CACC,CACb,CAAA;AACH,CAAC,CACF,CAAA;AACD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAA","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { badgeColorVariants } from \"@/components/badge\"\nimport { clx } from \"@/utils/clx\"\n\nconst iconBadgeVariants = cva(\n \"flex items-center justify-center overflow-hidden rounded-md border\",\n {\n variants: {\n size: {\n base: \"h-6 w-6\",\n large: \"h-7 w-7\",\n },\n },\n }\n)\n\ninterface IconBadgeProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\">,\n VariantProps<typeof badgeColorVariants>,\n VariantProps<typeof iconBadgeVariants> {\n asChild?: boolean\n}\n\nconst IconBadge = React.forwardRef<HTMLSpanElement, IconBadgeProps>(\n (\n {\n children,\n className,\n color = \"grey\",\n size = \"base\",\n asChild = false,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : \"span\"\n\n return (\n <Component\n ref={ref}\n className={clx(\n badgeColorVariants({ color }),\n iconBadgeVariants({ size }),\n className\n )}\n {...props}\n >\n {children}\n </Component>\n )\n }\n)\nIconBadge.displayName = \"IconBadge\"\n\nexport { IconBadge }\n"]}
@@ -0,0 +1 @@
1
+ export * from "./icon-badge";
@@ -0,0 +1,2 @@
1
+ export * from "./icon-badge";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icon-badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA","sourcesContent":["export * from \"./icon-badge\"\n"]}
@@ -0,0 +1,21 @@
1
+ import { VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const iconButtonVariants: (props?: ({
4
+ variant?: "primary" | "transparent" | null | undefined;
5
+ size?: "base" | "large" | "xlarge" | null | undefined;
6
+ } & ({
7
+ class: import("clsx").ClassValue;
8
+ className?: undefined;
9
+ } | {
10
+ class?: undefined;
11
+ className: import("clsx").ClassValue;
12
+ } | {
13
+ class?: undefined;
14
+ className?: undefined;
15
+ })) | undefined) => string;
16
+ interface IconButtonProps extends React.ComponentPropsWithoutRef<"button">, VariantProps<typeof iconButtonVariants> {
17
+ asChild?: boolean;
18
+ isLoading?: boolean;
19
+ }
20
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
21
+ export { IconButton, iconButtonVariants };
@@ -0,0 +1,43 @@
1
+ import { cva } from "class-variance-authority";
2
+ import * as React from "react";
3
+ import { clx } from "../../utils/clx";
4
+ import { Spinner } from "@medusajs/icons";
5
+ import { Slot } from "@radix-ui/react-slot";
6
+ const iconButtonVariants = cva(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-['']"), {
7
+ variants: {
8
+ variant: {
9
+ primary: 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"),
10
+ transparent: 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"),
11
+ },
12
+ size: {
13
+ base: "h-8 w-8 p-[5px]",
14
+ large: "h-10 w-10 p-[9px]",
15
+ xlarge: "h-12 w-12 p-[13px]",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ variant: "primary",
20
+ size: "base",
21
+ },
22
+ });
23
+ const IconButton = React.forwardRef(({ variant = "primary", size = "base", asChild = false, className, children, isLoading = false, disabled, ...props }, ref) => {
24
+ const Component = asChild ? Slot : "button";
25
+ /**
26
+ * In the case of a button where asChild is true, and isLoading is true, we ensure that
27
+ * only on element is passed as a child to the Slot component. This is because the Slot
28
+ * component only accepts a single child.
29
+ */
30
+ const renderInner = () => {
31
+ if (isLoading) {
32
+ return (React.createElement("span", { className: "pointer-events-none" },
33
+ React.createElement("div", { className: clx("bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md") },
34
+ React.createElement(Spinner, { className: "animate-spin" })),
35
+ children));
36
+ }
37
+ return children;
38
+ };
39
+ return (React.createElement(Component, { ref: ref, ...props, className: clx(iconButtonVariants({ variant, size }), className), disabled: disabled || isLoading }, renderInner()));
40
+ });
41
+ IconButton.displayName = "IconButton";
42
+ export { IconButton, iconButtonVariants };
43
+ //# sourceMappingURL=icon-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,MAAM,kBAAkB,GAAG,GAAG,CAC5B,GAAG,CACD,qHAAqH,EACrH,oIAAoI,EACpI,iDAAiD,CAClD,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,GAAG,CACV,iHAAiH,EACjH,4EAA4E,EAC5E,kFAAkF,EAClF,oCAAoC,CACrC;YACD,WAAW,EAAE,GAAG,CACd,uEAAuE,EACvE,sCAAsC,EACtC,sEAAsE,EACtE,4EAA4E,EAC5E,sEAAsE,CACvE;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,oBAAoB;SAC7B;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AASD,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,CACE,EACE,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,MAAM,EACb,OAAO,GAAG,KAAK,EACf,SAAS,EACT,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C;;;;OAIG;IACH,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,SAAS,EAAE;YACb,OAAO,CACL,8BAAM,SAAS,EAAC,qBAAqB;gBACnC,6BACE,SAAS,EAAE,GAAG,CACZ,gFAAgF,CACjF;oBAED,oBAAC,OAAO,IAAC,SAAS,EAAC,cAAc,GAAG,CAChC;gBACL,QAAQ,CACJ,CACR,CAAA;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,KACJ,KAAK,EACT,SAAS,EAAE,GAAG,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,EAChE,QAAQ,EAAE,QAAQ,IAAI,SAAS,IAE9B,WAAW,EAAE,CACJ,CACb,CAAA;AACH,CAAC,CACF,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA","sourcesContent":["import { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\nimport { Spinner } from \"@medusajs/icons\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\nconst iconButtonVariants = cva(\n clx(\n \"transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md border outline-none\",\n \"disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:!shadow-none disabled:after:hidden\",\n \"after:absolute after:inset-0 after:content-['']\"\n ),\n {\n variants: {\n variant: {\n primary: clx(\n \"shadow-buttons-neutral text-ui-fg-base border-ui-border-base bg-ui-button-neutral after:button-neutral-gradient\",\n \"hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient\",\n \"active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient\",\n \"focus:shadow-buttons-neutral-focus\"\n ),\n transparent: clx(\n \"text-ui-fg-base border-ui-border-transparent bg-ui-button-transparent\",\n \"hover:bg-ui-button-transparent-hover\",\n \"active:bg-ui-button-transparent-pressed active:border-ui-border-base\",\n \"focus:shadow-borders-focus focus:bg-ui-bg-base focus:border-ui-border-base\",\n \"disabled:!border-none disabled:!bg-transparent disabled:!shadow-none\"\n ),\n },\n size: {\n base: \"h-8 w-8 p-[5px]\",\n large: \"h-10 w-10 p-[9px]\",\n xlarge: \"h-12 w-12 p-[13px]\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"base\",\n },\n }\n)\n\ninterface IconButtonProps\n extends React.ComponentPropsWithoutRef<\"button\">,\n VariantProps<typeof iconButtonVariants> {\n asChild?: boolean\n isLoading?: boolean\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n variant = \"primary\",\n size = \"base\",\n asChild = false,\n className,\n children,\n isLoading = false,\n disabled,\n ...props\n },\n ref\n ) => {\n const Component = asChild ? Slot : \"button\"\n\n /**\n * In the case of a button where asChild is true, and isLoading is true, we ensure that\n * only on element is passed as a child to the Slot component. This is because the Slot\n * component only accepts a single child.\n */\n const renderInner = () => {\n if (isLoading) {\n return (\n <span className=\"pointer-events-none\">\n <div\n className={clx(\n \"bg-ui-bg-disabled absolute inset-0 flex items-center justify-center rounded-md\"\n )}\n >\n <Spinner className=\"animate-spin\" />\n </div>\n {children}\n </span>\n )\n }\n\n return children\n }\n\n return (\n <Component\n ref={ref}\n {...props}\n className={clx(iconButtonVariants({ variant, size }), className)}\n disabled={disabled || isLoading}\n >\n {renderInner()}\n </Component>\n )\n }\n)\nIconButton.displayName = \"IconButton\"\n\nexport { IconButton, iconButtonVariants }\n"]}
@@ -0,0 +1 @@
1
+ export * from "./icon-button";
@@ -0,0 +1,2 @@
1
+ export * from "./icon-button";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icon-button/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA","sourcesContent":["export * from \"./icon-button\"\n"]}
@@ -20,17 +20,17 @@ const Input = React.forwardRef(({ className, type, size = "base", ...props }, re
20
20
  const isPassword = type === "password";
21
21
  const isSearch = type === "search";
22
22
  return (React.createElement("div", { className: "relative" },
23
- isSearch && (React.createElement("div", { className: clx("text-ui-fg-muted absolute bottom-0 left-0 z-10 flex items-center justify-center", {
24
- "h-10 w-11": size === "base",
25
- "h-8 w-9": size === "small",
26
- }), role: "img" },
27
- React.createElement(MagnifyingGlassMini, null))),
28
23
  React.createElement("input", { ref: ref, type: isPassword ? typeState : type, className: clx(inputVariants({ size: size }), {
29
24
  "pr-11": isPassword && size === "base",
30
25
  "pl-11": isSearch && size === "base",
31
26
  "pr-9": isPassword && size === "small",
32
27
  "pl-9": isSearch && size === "small",
33
28
  }, className), ...props }),
29
+ isSearch && (React.createElement("div", { className: clx("text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center", {
30
+ "h-10 w-11": size === "base",
31
+ "h-8 w-9": size === "small",
32
+ }), role: "img" },
33
+ React.createElement(MagnifyingGlassMini, null))),
34
34
  isPassword && (React.createElement("div", { className: clx("absolute bottom-0 right-0 flex w-11 items-center justify-center", {
35
35
  "h-10 w-11": size === "base",
36
36
  "h-8 w-9": size === "small",
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,mBAAmB,EA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,CACZ,aAAa,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAC7B;gBACE,OAAO,EAAE,UAAU,IAAI,IAAI,KAAK,MAAM;gBACtC,OAAO,EAAE,QAAQ,IAAI,IAAI,KAAK,MAAM;gBACpC,MAAM,EAAE,UAAU,IAAI,IAAI,KAAK,OAAO;gBACtC,MAAM,EAAE,QAAQ,IAAI,IAAI,KAAK,OAAO;aACrC,EACD,SAAS,CACV,KACG,KAAK,GACT;QACD,UAAU,IAAI,CACb,6BACE,SAAS,EAAE,GAAG,CACZ,iEAAiE,EACjE;gBACE,WAAW,EAAE,IAAI,KAAK,MAAM;gBAC5B,SAAS,EAAE,IAAI,KAAK,OAAO;aAC5B,CACF;YAED,gCACE,SAAS,EAAC,iLAAiL,EAC3L,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;oBACZ,YAAY,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;gBAC9D,CAAC;gBAED,8BAAM,SAAS,EAAC,SAAS,IACtB,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CACxD;gBACN,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAC,GAAG,OAAG,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG,CAC3C,CACL,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover border-ui-border-base shadow-buttons-neutral placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md border outline-none\",\n \"focus:border-ui-border-interactive focus:shadow-borders-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:!border-ui-border-base disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed disabled:!shadow-none\",\n \"aria-[invalid=true]:!border-ui-border-error aria-[invalid=true]:focus:!shadow-borders-error invalid:!border-ui-border-error invalid:focus:!shadow-borders-error\"\n)\n\nconst inputVariants = cva(\n clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n {\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 z-10 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAgB,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,eAAe,GAAG,GAAG,CACzB,8NAA8N,EAC9N,gEAAgE,EAChE,gLAAgL,EAChL,iKAAiK,CAClK,CAAA;AAED,MAAM,aAAa,GAAG,GAAG,CACvB,GAAG,CACD,eAAe,EACf,0HAA0H,CAC3H,EACD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,qCAAqC;SAC7C;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,MAAM;KACb;CACF,CACF,CAAA;AAED,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAI5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACtD,MAAM,CAAC,SAAS,EAAE,YAA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,KAAK,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CACxD;gBACN,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAC,GAAG,OAAG,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG,CAC3C,CACL,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { Eye, EyeSlash, MagnifyingGlassMini } from \"@medusajs/icons\"\nimport { VariantProps, cva } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst inputBaseStyles = clx(\n \"caret-ui-fg-base bg-ui-bg-field hover:bg-ui-bg-field-hover border-ui-border-base shadow-buttons-neutral placeholder-ui-fg-muted text-ui-fg-base transition-fg relative w-full appearance-none rounded-md border outline-none\",\n \"focus:border-ui-border-interactive focus:shadow-borders-active\",\n \"disabled:text-ui-fg-disabled disabled:!bg-ui-bg-disabled disabled:!border-ui-border-base disabled:placeholder-ui-fg-disabled disabled:cursor-not-allowed disabled:!shadow-none\",\n \"aria-[invalid=true]:!border-ui-border-error aria-[invalid=true]:focus:!shadow-borders-error invalid:!border-ui-border-error invalid:focus:!shadow-borders-error\"\n)\n\nconst inputVariants = cva(\n clx(\n inputBaseStyles,\n \"[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden\"\n ),\n {\n variants: {\n size: {\n base: \"txt-compact-medium h-10 px-3 py-[9px]\",\n small: \"txt-compact-small h-8 px-2 py-[5px]\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n }\n)\n\nconst Input = React.forwardRef<\n HTMLInputElement,\n VariantProps<typeof inputVariants> &\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">\n>(({ className, type, size = \"base\", ...props }, ref) => {\n const [typeState, setTypeState] = React.useState(type)\n\n const isPassword = type === \"password\"\n const isSearch = type === \"search\"\n\n return (\n <div className=\"relative\">\n <input\n ref={ref}\n type={isPassword ? typeState : type}\n className={clx(\n inputVariants({ size: size }),\n {\n \"pr-11\": isPassword && size === \"base\",\n \"pl-11\": isSearch && size === \"base\",\n \"pr-9\": isPassword && size === \"small\",\n \"pl-9\": isSearch && size === \"small\",\n },\n className\n )}\n {...props}\n />\n {isSearch && (\n <div\n className={clx(\n \"text-ui-fg-muted absolute bottom-0 left-0 flex items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n role=\"img\"\n >\n <MagnifyingGlassMini />\n </div>\n )}\n {isPassword && (\n <div\n className={clx(\n \"absolute bottom-0 right-0 flex w-11 items-center justify-center\",\n {\n \"h-10 w-11\": size === \"base\",\n \"h-8 w-9\": size === \"small\",\n }\n )}\n >\n <button\n className=\"text-ui-fg-muted hover:text-ui-fg-base focus:text-ui-fg-base focus:shadow-borders-interactive-w-focus active:text-ui-fg-base h-fit w-fit rounded-sm outline-none transition-all\"\n type=\"button\"\n onClick={() => {\n setTypeState(typeState === \"password\" ? \"text\" : \"password\")\n }}\n >\n <span className=\"sr-only\">\n {typeState === \"password\" ? \"Show password\" : \"Hide password\"}\n </span>\n {typeState === \"password\" ? <Eye /> : <EyeSlash />}\n </button>\n </div>\n )}\n </div>\n )\n})\nInput.displayName = \"Input\"\n\nexport { Input, inputBaseStyles }\n"]}
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
- declare const Kbd: ({ children, className, ...props }: React.ComponentPropsWithoutRef<"kbd">) => React.JSX.Element;
2
+ declare const Kbd: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
3
3
  export { Kbd };
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { clx } from "../../utils/clx";
3
- const Kbd = ({ children, className, ...props }) => {
4
- return (React.createElement("kbd", { ...props, className: clx("bg-ui-tag-neutral-bg text-ui-tag-neutral-text border-ui-tag-neutral-border min-w-5 inline-flex h-5 w-fit items-center justify-center rounded-md border px-1", "txt-compact-xsmall-plus", className) }, children));
5
- };
3
+ const Kbd = React.forwardRef(({ children, className, ...props }, ref) => {
4
+ return (React.createElement("kbd", { ...props, ref: ref, className: clx("bg-ui-tag-neutral-bg text-ui-tag-neutral-text border-ui-tag-neutral-border inline-flex h-5 w-fit min-w-[20px] items-center justify-center rounded-md border px-1", "txt-compact-xsmall-plus", className) }, children));
5
+ });
6
+ Kbd.displayName = "Kbd";
6
7
  export { Kbd };
7
8
  //# sourceMappingURL=kbd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kbd.js","sourceRoot":"","sources":["../../../../src/components/kbd/kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,GAAG,GAAG,CAAC,EACX,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE;IAC1C,OAAO,CACL,gCACM,KAAK,EACT,SAAS,EAAE,GAAG,CACZ,6JAA6J,EAC7J,yBAAyB,EACzB,SAAS,CACV,IAEA,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,GAAG,EAAE,CAAA","sourcesContent":["import * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Kbd = ({\n children,\n className,\n ...props\n}: React.ComponentPropsWithoutRef<\"kbd\">) => {\n return (\n <kbd\n {...props}\n className={clx(\n \"bg-ui-tag-neutral-bg text-ui-tag-neutral-text border-ui-tag-neutral-border min-w-5 inline-flex h-5 w-fit items-center justify-center rounded-md border px-1\",\n \"txt-compact-xsmall-plus\",\n className\n )}\n >\n {children}\n </kbd>\n )\n}\n\nexport { Kbd }\n"]}
1
+ {"version":3,"file":"kbd.js","sourceRoot":"","sources":["../../../../src/components/kbd/kbd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAG1B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3C,OAAO,CACL,gCACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,kKAAkK,EAClK,yBAAyB,EACzB,SAAS,CACV,IAEA,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AACF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;AAEvB,OAAO,EAAE,GAAG,EAAE,CAAA","sourcesContent":["import * as React from \"react\"\n\nimport { clx } from \"@/utils/clx\"\n\nconst Kbd = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"kbd\">\n>(({ children, className, ...props }, ref) => {\n return (\n <kbd\n {...props}\n ref={ref}\n className={clx(\n \"bg-ui-tag-neutral-bg text-ui-tag-neutral-text border-ui-tag-neutral-border inline-flex h-5 w-fit min-w-[20px] items-center justify-center rounded-md border px-1\",\n \"txt-compact-xsmall-plus\",\n className\n )}\n >\n {children}\n </kbd>\n )\n})\nKbd.displayName = \"Kbd\"\n\nexport { Kbd }\n"]}
@@ -0,0 +1 @@
1
+ export * from "./progress-accordion";
@@ -0,0 +1,2 @@
1
+ export * from "./progress-accordion";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/progress-accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA","sourcesContent":["export * from \"./progress-accordion\"\n"]}
@@ -0,0 +1,19 @@
1
+ import * as Primitves from "@radix-ui/react-accordion";
2
+ import * as React from "react";
3
+ import { ProgressStatus } from "../../types";
4
+ declare const Root: {
5
+ (props: React.ComponentPropsWithoutRef<typeof Primitves.Root>): React.JSX.Element;
6
+ displayName: string;
7
+ };
8
+ interface HeaderProps extends React.ComponentPropsWithoutRef<typeof Primitves.Header> {
9
+ status?: ProgressStatus;
10
+ }
11
+ declare const ProgressAccordion: {
12
+ (props: React.ComponentPropsWithoutRef<typeof Primitves.Root>): React.JSX.Element;
13
+ displayName: string;
14
+ } & {
15
+ Item: React.ForwardRefExoticComponent<Omit<Primitves.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
+ Header: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLHeadingElement>>;
17
+ Content: React.ForwardRefExoticComponent<Omit<Primitves.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ };
19
+ export { ProgressAccordion };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { CheckCircleSolid, CircleDottedLine, CircleHalfSolid, Plus, } from "@medusajs/icons";
3
+ import * as Primitves from "@radix-ui/react-accordion";
4
+ import * as React from "react";
5
+ import { clx } from "../../utils/clx";
6
+ import { IconButton } from "../icon-button";
7
+ const Root = (props) => {
8
+ return React.createElement(Primitves.Root, { ...props });
9
+ };
10
+ Root.displayName = "ProgressAccordion";
11
+ const Item = React.forwardRef(({ className, ...props }, ref) => {
12
+ return (React.createElement(Primitves.Item, { ref: ref, className: clx("border-ui-border-base border-b last-of-type:border-b-0", className), ...props }));
13
+ });
14
+ Item.displayName = "ProgressAccordion.Item";
15
+ const ProgressIndicator = ({ status, ...props }) => {
16
+ const Icon = React.useMemo(() => {
17
+ switch (status) {
18
+ case "not-started":
19
+ return CircleDottedLine;
20
+ case "in-progress":
21
+ return CircleHalfSolid;
22
+ case "completed":
23
+ return CheckCircleSolid;
24
+ default:
25
+ return CircleDottedLine;
26
+ }
27
+ }, [status]);
28
+ return (React.createElement("span", { className: "text-ui-fg-muted group-data-[state=open]:text-ui-fg-interactive flex h-12 w-12 items-center justify-center", ...props },
29
+ React.createElement(Icon, null)));
30
+ };
31
+ const Header = React.forwardRef(({ className, status = "not-started", children, ...props }, ref) => {
32
+ return (React.createElement(Primitves.Header, { ref: ref, className: clx("h3-core text-ui-fg-base group flex w-full flex-1 items-center gap-4 px-8", className), ...props },
33
+ React.createElement(ProgressIndicator, { status: status }),
34
+ children,
35
+ React.createElement(Primitves.Trigger, { asChild: true, className: "ml-auto" },
36
+ React.createElement(IconButton, { variant: "transparent" },
37
+ React.createElement(Plus, { className: "transform transition-transform group-data-[state=open]:rotate-45" })))));
38
+ });
39
+ Header.displayName = "ProgressAccordion.Header";
40
+ const Content = React.forwardRef(({ className, ...props }, ref) => {
41
+ return (React.createElement(Primitves.Content, { ref: ref, className: clx("overflow-hidden", "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down pl-24 pr-8", className), ...props }));
42
+ });
43
+ Content.displayName = "ProgressAccordion.Content";
44
+ const ProgressAccordion = Object.assign(Root, {
45
+ Item,
46
+ Header,
47
+ Content,
48
+ });
49
+ export { ProgressAccordion };
50
+ //# sourceMappingURL=progress-accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-accordion.js","sourceRoot":"","sources":["../../../../src/components/progress-accordion/progress-accordion.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,IAAI,GACL,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,IAAI,GAAG,CAAC,KAA4D,EAAE,EAAE;IAC5E,OAAO,oBA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iBAAiB,IAAC,MAAM,EAAE,MAAM,GAAI;QACpC,QAAQ;QACT,oBAAC,SAAS,CAAC,OAAO,IAAC,OAAO,QAAC,SAAS,EAAC,SAAS;YAC5C,oBAAC,UAAU,IAAC,OAAO,EAAC,aAAa;gBAC/B,oBAAC,IAAI,IAAC,SAAS,EAAC,kEAAkE,GAAG,CAC1E,CACK,CACH,CACpB,CAAA;AACH,CAAC,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,0BAA0B,CAAA;AAE/C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAG9B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,oBAAC,SAAS,CAAC,OAAO,IAChB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,GAAG,CACZ,iBAAiB,EACjB,8FAA8F,EAC9F,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AACF,OAAO,CAAC,WAAW,GAAG,2BAA2B,CAAA;AAEjD,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAC5C,IAAI;IACJ,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport {\n CheckCircleSolid,\n CircleDottedLine,\n CircleHalfSolid,\n Plus,\n} from \"@medusajs/icons\"\nimport * as Primitves from \"@radix-ui/react-accordion\"\nimport * as React from \"react\"\n\nimport { ProgressStatus } from \"@/types\"\nimport { clx } from \"@/utils/clx\"\nimport { IconButton } from \"../icon-button\"\n\nconst Root = (props: React.ComponentPropsWithoutRef<typeof Primitves.Root>) => {\n return <Primitves.Root {...props} />\n}\nRoot.displayName = \"ProgressAccordion\"\n\nconst Item = React.forwardRef<\n React.ElementRef<typeof Primitves.Item>,\n React.ComponentPropsWithoutRef<typeof Primitves.Item>\n>(({ className, ...props }, ref) => {\n return (\n <Primitves.Item\n ref={ref}\n className={clx(\n \"border-ui-border-base border-b last-of-type:border-b-0\",\n className\n )}\n {...props}\n />\n )\n})\nItem.displayName = \"ProgressAccordion.Item\"\n\ninterface HeaderProps\n extends React.ComponentPropsWithoutRef<typeof Primitves.Header> {\n status?: ProgressStatus\n}\n\ninterface StatusIndicatorProps extends React.ComponentPropsWithoutRef<\"span\"> {\n status: ProgressStatus\n}\n\nconst ProgressIndicator = ({ status, ...props }: StatusIndicatorProps) => {\n const Icon = React.useMemo(() => {\n switch (status) {\n case \"not-started\":\n return CircleDottedLine\n case \"in-progress\":\n return CircleHalfSolid\n case \"completed\":\n return CheckCircleSolid\n default:\n return CircleDottedLine\n }\n }, [status])\n\n return (\n <span\n className=\"text-ui-fg-muted group-data-[state=open]:text-ui-fg-interactive flex h-12 w-12 items-center justify-center\"\n {...props}\n >\n <Icon />\n </span>\n )\n}\n\nconst Header = React.forwardRef<\n React.ElementRef<typeof Primitves.Header>,\n HeaderProps\n>(({ className, status = \"not-started\", children, ...props }, ref) => {\n return (\n <Primitves.Header\n ref={ref}\n className={clx(\n \"h3-core text-ui-fg-base group flex w-full flex-1 items-center gap-4 px-8\",\n className\n )}\n {...props}\n >\n <ProgressIndicator status={status} />\n {children}\n <Primitves.Trigger asChild className=\"ml-auto\">\n <IconButton variant=\"transparent\">\n <Plus className=\"transform transition-transform group-data-[state=open]:rotate-45\" />\n </IconButton>\n </Primitves.Trigger>\n </Primitves.Header>\n )\n})\nHeader.displayName = \"ProgressAccordion.Header\"\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof Primitves.Content>,\n React.ComponentPropsWithoutRef<typeof Primitves.Content>\n>(({ className, ...props }, ref) => {\n return (\n <Primitves.Content\n ref={ref}\n className={clx(\n \"overflow-hidden\",\n \"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down pl-24 pr-8\",\n className\n )}\n {...props}\n />\n )\n})\nContent.displayName = \"ProgressAccordion.Content\"\n\nconst ProgressAccordion = Object.assign(Root, {\n Item,\n Header,\n Content,\n})\n\nexport { ProgressAccordion }\n"]}
@@ -0,0 +1 @@
1
+ export * from "./progress-tabs";
@@ -0,0 +1,2 @@
1
+ export * from "./progress-tabs";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/progress-tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA","sourcesContent":["export * from \"./progress-tabs\"\n"]}
@@ -0,0 +1,15 @@
1
+ import * as ProgressTabsPrimitives from "@radix-ui/react-tabs";
2
+ import * as React from "react";
3
+ import { ProgressStatus } from "../../types";
4
+ interface ProgressTabsTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof ProgressTabsPrimitives.Trigger>, "asChild"> {
5
+ status?: ProgressStatus;
6
+ }
7
+ declare const ProgressTabs: {
8
+ (props: ProgressTabsPrimitives.TabsProps): React.JSX.Element;
9
+ displayName: string;
10
+ } & {
11
+ Trigger: React.ForwardRefExoticComponent<ProgressTabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
12
+ List: React.ForwardRefExoticComponent<Omit<ProgressTabsPrimitives.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ Content: React.ForwardRefExoticComponent<Omit<ProgressTabsPrimitives.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ };
15
+ export { ProgressTabs };
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { CheckCircleSolid, CircleDottedLine, CircleHalfSolid, } from "@medusajs/icons";
3
+ import * as ProgressTabsPrimitives from "@radix-ui/react-tabs";
4
+ import * as React from "react";
5
+ import { clx } from "../../utils/clx";
6
+ const ProgressTabsRoot = (props) => {
7
+ return React.createElement(ProgressTabsPrimitives.Root, { ...props });
8
+ };
9
+ ProgressTabsRoot.displayName = "ProgressTabs";
10
+ const ProgressIndicator = ({ status, className, ...props }) => {
11
+ const Icon = React.useMemo(() => {
12
+ switch (status) {
13
+ case "not-started":
14
+ return CircleDottedLine;
15
+ case "in-progress":
16
+ return CircleHalfSolid;
17
+ case "completed":
18
+ return CheckCircleSolid;
19
+ default:
20
+ return CircleDottedLine;
21
+ }
22
+ }, [status]);
23
+ return (React.createElement("span", { className: clx("text-ui-fg-muted group-data-[state=active]/trigger:text-ui-fg-interactive", className), ...props },
24
+ React.createElement(Icon, null)));
25
+ };
26
+ const ProgressTabsTrigger = React.forwardRef(({ className, children, status = "not-started", ...props }, ref) => (React.createElement(ProgressTabsPrimitives.Trigger, { ref: ref, className: clx("txt-compact-small-plus transition-fg text-ui-fg-muted bg-ui-bg-subtle border-r-ui-border-base inline-flex h-14 w-full max-w-[200px] flex-1 items-center gap-x-2 border-r px-4 text-left outline-none", "group/trigger overflow-hidden text-ellipsis whitespace-nowrap", "disabled:bg-ui-bg-disabled disabled:text-ui-fg-muted", "hover:bg-ui-bg-subtle-hover", "focus:bg-ui-bg-base focus:z-[1]", "data-[state=active]:text-ui-fg-base data-[state=active]:bg-ui-bg-base", className), ...props },
27
+ React.createElement(ProgressIndicator, { status: status }),
28
+ children)));
29
+ ProgressTabsTrigger.displayName = "ProgressTabs.Trigger";
30
+ const ProgressTabsList = React.forwardRef(({ className, ...props }, ref) => (React.createElement(ProgressTabsPrimitives.List, { ref: ref, className: clx("flex items-center", className), ...props })));
31
+ ProgressTabsList.displayName = "ProgressTabs.List";
32
+ const ProgressTabsContent = React.forwardRef(({ className, ...props }, ref) => {
33
+ return (React.createElement(ProgressTabsPrimitives.Content, { ref: ref, className: clx("outline-none", className), ...props }));
34
+ });
35
+ ProgressTabsContent.displayName = "ProgressTabs.Content";
36
+ const ProgressTabs = Object.assign(ProgressTabsRoot, {
37
+ Trigger: ProgressTabsTrigger,
38
+ List: ProgressTabsList,
39
+ Content: ProgressTabsContent,
40
+ });
41
+ export { ProgressTabs };
42
+ //# sourceMappingURL=progress-tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-tabs.js","sourceRoot":"","sources":["../../../../src/components/progress-tabs/progress-tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,sBAAsB,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,MAAM,gBAAgB,GAAG,CAAC,KAAuC,EAAE,EAAE;IACnE,OAAO,oBAAC,sBAAsB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAA;AACnD,CAAC,CAAA;AACD,gBAAgB,CAAC,WAAW,GAAG,cAAc,CAAA;AAO7C,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB,EAAE,EAAE;IAC5E,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC9B,QAAQ,MAAM,EAAE;YACd,KAAK,aAAa;gBAChB,OAAO,gBAAgB,CAAA;YACzB,KAAK,aAAa;gBAChB,OAAO,eAAe,CAAA;YACxB,KAAK,WAAW;gBACd,OAAO,gBAAgB,CAAA;YACzB;gBACE,OAAO,gBAAgB,CAAA;SAC1B;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,CACL,8BACE,SAAS,EAAE,GAAG,CACZ,2EAA2E,EAC3E,SAAS,CACV,KACG,KAAK;QAET,oBAAC,IAAI,OAAG,CACH,CACR,CAAA;AACH,CAAC,CAAA;AAUD,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAG1C,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC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edLine,\n CircleHalfSolid,\n} from \"@medusajs/icons\"\nimport * as ProgressTabsPrimitives from \"@radix-ui/react-tabs\"\nimport * as React from \"react\"\n\nimport { ProgressStatus } from \"@/types\"\nimport { clx } from \"@/utils/clx\"\n\nconst ProgressTabsRoot = (props: ProgressTabsPrimitives.TabsProps) => {\n return <ProgressTabsPrimitives.Root {...props} />\n}\nProgressTabsRoot.displayName = \"ProgressTabs\"\n\ninterface IndicatorProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"children\"> {\n status?: ProgressStatus\n}\n\nconst ProgressIndicator = ({ status, className, ...props }: IndicatorProps) => {\n const Icon = React.useMemo(() => {\n switch (status) {\n case \"not-started\":\n return CircleDottedLine\n case \"in-progress\":\n return CircleHalfSolid\n case \"completed\":\n return CheckCircleSolid\n default:\n return CircleDottedLine\n }\n }, [status])\n\n return (\n <span\n className={clx(\n \"text-ui-fg-muted group-data-[state=active]/trigger:text-ui-fg-interactive\",\n className\n )}\n {...props}\n >\n <Icon />\n </span>\n )\n}\n\ninterface ProgressTabsTriggerProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof ProgressTabsPrimitives.Trigger>,\n \"asChild\"\n > {\n status?: ProgressStatus\n}\n\nconst ProgressTabsTrigger = React.forwardRef<\n React.ElementRef<typeof ProgressTabsPrimitives.Trigger>,\n ProgressTabsTriggerProps\n>(({ className, children, status = \"not-started\", ...props }, ref) => (\n <ProgressTabsPrimitives.Trigger\n ref={ref}\n className={clx(\n \"txt-compact-small-plus transition-fg text-ui-fg-muted bg-ui-bg-subtle border-r-ui-border-base inline-flex h-14 w-full max-w-[200px] flex-1 items-center gap-x-2 border-r px-4 text-left outline-none\",\n \"group/trigger overflow-hidden text-ellipsis whitespace-nowrap\",\n \"disabled:bg-ui-bg-disabled disabled:text-ui-fg-muted\",\n \"hover:bg-ui-bg-subtle-hover\",\n \"focus:bg-ui-bg-base focus:z-[1]\",\n \"data-[state=active]:text-ui-fg-base data-[state=active]:bg-ui-bg-base\",\n className\n )}\n {...props}\n >\n <ProgressIndicator status={status} />\n {children}\n </ProgressTabsPrimitives.Trigger>\n))\nProgressTabsTrigger.displayName = \"ProgressTabs.Trigger\"\n\nconst ProgressTabsList = React.forwardRef<\n React.ElementRef<typeof ProgressTabsPrimitives.List>,\n React.ComponentPropsWithoutRef<typeof ProgressTabsPrimitives.List>\n>(({ className, ...props }, ref) => (\n <ProgressTabsPrimitives.List\n ref={ref}\n className={clx(\"flex items-center\", className)}\n {...props}\n />\n))\nProgressTabsList.displayName = \"ProgressTabs.List\"\n\nconst ProgressTabsContent = React.forwardRef<\n React.ElementRef<typeof ProgressTabsPrimitives.Content>,\n React.ComponentPropsWithoutRef<typeof ProgressTabsPrimitives.Content>\n>(({ className, ...props }, ref) => {\n return (\n <ProgressTabsPrimitives.Content\n ref={ref}\n className={clx(\"outline-none\", className)}\n {...props}\n />\n )\n})\nProgressTabsContent.displayName = \"ProgressTabs.Content\"\n\nconst ProgressTabs = Object.assign(ProgressTabsRoot, {\n Trigger: ProgressTabsTrigger,\n List: ProgressTabsList,\n Content: ProgressTabsContent,\n})\n\nexport { ProgressTabs }\n"]}