@raydenui/ui 0.9.7 → 0.10.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 (308) hide show
  1. package/dist/Table-DCNSxua1.d.cts +31 -0
  2. package/dist/Table-DCNSxua1.d.ts +31 -0
  3. package/dist/blocks/ApplicationShellBlock.cjs +157 -0
  4. package/dist/blocks/ApplicationShellBlock.js +154 -0
  5. package/dist/blocks/CheckoutReviewBlock.cjs +16 -0
  6. package/dist/blocks/CheckoutReviewBlock.js +13 -0
  7. package/dist/blocks/CommandPaletteBlock.cjs +334 -0
  8. package/dist/blocks/CommandPaletteBlock.js +331 -0
  9. package/dist/blocks/CreateAccountBlock.cjs +147 -0
  10. package/dist/blocks/CreateAccountBlock.js +143 -0
  11. package/dist/blocks/EmptyStateBlock.cjs +19 -0
  12. package/dist/blocks/EmptyStateBlock.js +16 -0
  13. package/dist/blocks/FeatureOverviewBlock.cjs +54 -0
  14. package/dist/blocks/FeatureOverviewBlock.js +51 -0
  15. package/dist/blocks/HeaderBlock.cjs +230 -0
  16. package/dist/blocks/HeaderBlock.js +227 -0
  17. package/dist/blocks/KpiOverviewBlock.cjs +63 -0
  18. package/dist/blocks/KpiOverviewBlock.js +60 -0
  19. package/dist/blocks/LoginBlock.cjs +66 -0
  20. package/dist/blocks/LoginBlock.js +63 -0
  21. package/dist/blocks/NotificationsBlock.cjs +17 -0
  22. package/dist/blocks/NotificationsBlock.js +14 -0
  23. package/dist/blocks/PageHeaderBlock.cjs +121 -0
  24. package/dist/blocks/PageHeaderBlock.js +118 -0
  25. package/dist/blocks/PricingPlansBlock.cjs +146 -0
  26. package/dist/blocks/PricingPlansBlock.js +143 -0
  27. package/dist/blocks/ProductCollectionBlock.cjs +37 -0
  28. package/dist/blocks/ProductCollectionBlock.js +34 -0
  29. package/dist/blocks/ProductDetailBlock.cjs +30 -0
  30. package/dist/blocks/ProductDetailBlock.js +27 -0
  31. package/dist/blocks/ProductHeroBlock.cjs +83 -0
  32. package/dist/blocks/ProductHeroBlock.js +80 -0
  33. package/dist/blocks/ProfileSettingsBlock.cjs +130 -0
  34. package/dist/blocks/ProfileSettingsBlock.js +126 -0
  35. package/dist/blocks/QuickSendBlock.cjs +11 -0
  36. package/dist/blocks/QuickSendBlock.js +8 -0
  37. package/dist/blocks/RecentTransactionsBlock.cjs +13 -0
  38. package/dist/blocks/RecentTransactionsBlock.js +10 -0
  39. package/dist/blocks/SearchableTableBlock.cjs +91 -0
  40. package/dist/blocks/SearchableTableBlock.js +88 -0
  41. package/dist/blocks/ShoppingCartBlock.cjs +16 -0
  42. package/dist/blocks/ShoppingCartBlock.js +13 -0
  43. package/dist/blocks/SiteFooterBlock.cjs +69 -0
  44. package/dist/blocks/SiteFooterBlock.js +66 -0
  45. package/dist/blocks/TableBlock.cjs +20 -0
  46. package/dist/blocks/TableBlock.js +17 -0
  47. package/dist/blocks/TaskListBlock.cjs +198 -0
  48. package/dist/blocks/TaskListBlock.js +195 -0
  49. package/dist/blocks/WorkspaceSwitcherBlock.cjs +291 -0
  50. package/dist/blocks/WorkspaceSwitcherBlock.js +288 -0
  51. package/dist/blocks/commerce.cjs +44 -0
  52. package/dist/blocks/commerce.js +35 -0
  53. package/dist/blocks/index.cjs +53 -0
  54. package/dist/blocks/index.js +24 -0
  55. package/dist/blocks.d.cts +1820 -0
  56. package/dist/blocks.d.ts +1820 -0
  57. package/dist/chart.cjs +13 -0
  58. package/dist/chart.d.cts +59 -0
  59. package/dist/chart.d.ts +59 -0
  60. package/dist/chart.js +5 -0
  61. package/dist/components/Accordion/Accordion.cjs +94 -0
  62. package/dist/components/Accordion/Accordion.js +91 -0
  63. package/dist/components/Accordion/index.cjs +8 -0
  64. package/dist/components/Accordion/index.js +1 -0
  65. package/dist/components/ActivityFeed/ActivityContent.cjs +40 -0
  66. package/dist/components/ActivityFeed/ActivityContent.js +37 -0
  67. package/dist/components/ActivityFeed/ActivityItem.cjs +19 -0
  68. package/dist/components/ActivityFeed/ActivityItem.js +16 -0
  69. package/dist/components/ActivityFeed/index.cjs +7 -0
  70. package/dist/components/ActivityFeed/index.js +2 -0
  71. package/dist/components/Alert/Alert.cjs +42 -0
  72. package/dist/components/Alert/Alert.js +39 -0
  73. package/dist/components/Alert/index.cjs +5 -0
  74. package/dist/components/Alert/index.js +1 -0
  75. package/dist/components/Avatar/Avatar.cjs +101 -0
  76. package/dist/components/Avatar/Avatar.js +98 -0
  77. package/dist/components/Avatar/index.cjs +6 -0
  78. package/dist/components/Avatar/index.js +1 -0
  79. package/dist/components/Badge/Badge.cjs +53 -0
  80. package/dist/components/Badge/Badge.js +50 -0
  81. package/dist/components/Badge/index.cjs +5 -0
  82. package/dist/components/Badge/index.js +1 -0
  83. package/dist/components/Banner/Banner.cjs +83 -0
  84. package/dist/components/Banner/Banner.js +80 -0
  85. package/dist/components/Banner/index.cjs +5 -0
  86. package/dist/components/Banner/index.js +1 -0
  87. package/dist/components/Breadcrumb/Breadcrumb.cjs +31 -0
  88. package/dist/components/Breadcrumb/Breadcrumb.js +28 -0
  89. package/dist/components/Breadcrumb/index.cjs +5 -0
  90. package/dist/components/Breadcrumb/index.js +1 -0
  91. package/dist/components/Button/Button.cjs +88 -0
  92. package/dist/components/Button/Button.js +85 -0
  93. package/dist/components/Button/index.cjs +5 -0
  94. package/dist/components/Button/index.js +1 -0
  95. package/dist/components/ButtonGroup/ButtonGroup.cjs +8 -0
  96. package/dist/components/ButtonGroup/ButtonGroup.js +5 -0
  97. package/dist/components/ButtonGroup/ButtonGroupItem.cjs +15 -0
  98. package/dist/components/ButtonGroup/ButtonGroupItem.js +12 -0
  99. package/dist/components/ButtonGroup/index.cjs +7 -0
  100. package/dist/components/ButtonGroup/index.js +2 -0
  101. package/dist/components/Card/Card.cjs +94 -0
  102. package/dist/components/Card/Card.js +91 -0
  103. package/dist/components/Card/index.cjs +9 -0
  104. package/dist/components/Card/index.js +1 -0
  105. package/dist/components/Chart/Chart.cjs +160 -0
  106. package/dist/components/Chart/Chart.js +153 -0
  107. package/dist/components/Chart/index.cjs +10 -0
  108. package/dist/components/Chart/index.js +2 -0
  109. package/dist/components/Chart/theme.cjs +67 -0
  110. package/dist/components/Chart/theme.js +62 -0
  111. package/dist/components/Chip/Chip.cjs +18 -0
  112. package/dist/components/Chip/Chip.js +15 -0
  113. package/dist/components/Chip/index.cjs +5 -0
  114. package/dist/components/Chip/index.js +1 -0
  115. package/dist/components/Counter/Counter.cjs +74 -0
  116. package/dist/components/Counter/Counter.js +71 -0
  117. package/dist/components/Counter/index.cjs +6 -0
  118. package/dist/components/Counter/index.js +1 -0
  119. package/dist/components/DatePicker/DatePicker.cjs +343 -0
  120. package/dist/components/DatePicker/DatePicker.js +340 -0
  121. package/dist/components/DatePicker/index.cjs +5 -0
  122. package/dist/components/DatePicker/index.js +1 -0
  123. package/dist/components/Divider/Divider.cjs +31 -0
  124. package/dist/components/Divider/Divider.js +28 -0
  125. package/dist/components/Divider/index.cjs +5 -0
  126. package/dist/components/Divider/index.js +1 -0
  127. package/dist/components/DropdownMenu/DropdownMenu.cjs +108 -0
  128. package/dist/components/DropdownMenu/DropdownMenu.js +105 -0
  129. package/dist/components/DropdownMenu/index.cjs +11 -0
  130. package/dist/components/DropdownMenu/index.js +1 -0
  131. package/dist/components/EmptyStateIllustration/EmptyStateIllustration.cjs +42 -0
  132. package/dist/components/EmptyStateIllustration/EmptyStateIllustration.js +39 -0
  133. package/dist/components/EmptyStateIllustration/illustrations.cjs +3322 -0
  134. package/dist/components/EmptyStateIllustration/illustrations.js +3319 -0
  135. package/dist/components/EmptyStateIllustration/index.cjs +7 -0
  136. package/dist/components/EmptyStateIllustration/index.js +2 -0
  137. package/dist/components/FileUpload/FileUpload.cjs +116 -0
  138. package/dist/components/FileUpload/FileUpload.js +113 -0
  139. package/dist/components/FileUpload/FileUploadDropZone.cjs +58 -0
  140. package/dist/components/FileUpload/FileUploadDropZone.js +55 -0
  141. package/dist/components/FileUpload/FileUploadIcons.cjs +55 -0
  142. package/dist/components/FileUpload/FileUploadIcons.js +50 -0
  143. package/dist/components/FileUpload/FileUploadItem.cjs +34 -0
  144. package/dist/components/FileUpload/FileUploadItem.js +31 -0
  145. package/dist/components/FileUpload/index.cjs +9 -0
  146. package/dist/components/FileUpload/index.js +3 -0
  147. package/dist/components/FormControl/Checkbox.cjs +27 -0
  148. package/dist/components/FormControl/Checkbox.js +24 -0
  149. package/dist/components/FormControl/Radio.cjs +15 -0
  150. package/dist/components/FormControl/Radio.js +12 -0
  151. package/dist/components/FormControl/Toggle.cjs +15 -0
  152. package/dist/components/FormControl/Toggle.js +12 -0
  153. package/dist/components/FormControl/index.cjs +9 -0
  154. package/dist/components/FormControl/index.js +3 -0
  155. package/dist/components/Icon/Icon.cjs +70 -0
  156. package/dist/components/Icon/Icon.js +34 -0
  157. package/dist/components/Icon/catalog.cjs +1672 -0
  158. package/dist/components/Icon/catalog.js +1669 -0
  159. package/dist/components/Icon/icons.cjs +5621 -0
  160. package/dist/components/Icon/icons.js +5610 -0
  161. package/dist/components/Icon/index.cjs +8 -0
  162. package/dist/components/Icon/index.js +2 -0
  163. package/dist/components/Input/Input.cjs +64 -0
  164. package/dist/components/Input/Input.js +61 -0
  165. package/dist/components/Input/index.cjs +5 -0
  166. package/dist/components/Input/index.js +1 -0
  167. package/dist/components/MetricsCard/MetricsCard.cjs +107 -0
  168. package/dist/components/MetricsCard/MetricsCard.js +104 -0
  169. package/dist/components/MetricsCard/index.cjs +5 -0
  170. package/dist/components/MetricsCard/index.js +1 -0
  171. package/dist/components/Modal/Modal.cjs +126 -0
  172. package/dist/components/Modal/Modal.js +123 -0
  173. package/dist/components/Modal/index.cjs +5 -0
  174. package/dist/components/Modal/index.js +1 -0
  175. package/dist/components/Pagination/Pagination.cjs +42 -0
  176. package/dist/components/Pagination/Pagination.js +39 -0
  177. package/dist/components/Pagination/index.cjs +5 -0
  178. package/dist/components/Pagination/index.js +1 -0
  179. package/dist/components/ProgressBar/ProgressBar.cjs +34 -0
  180. package/dist/components/ProgressBar/ProgressBar.js +31 -0
  181. package/dist/components/ProgressBar/index.cjs +5 -0
  182. package/dist/components/ProgressBar/index.js +1 -0
  183. package/dist/components/ProgressCircle/ProgressCircle.cjs +34 -0
  184. package/dist/components/ProgressCircle/ProgressCircle.js +31 -0
  185. package/dist/components/ProgressCircle/index.cjs +5 -0
  186. package/dist/components/ProgressCircle/index.js +1 -0
  187. package/dist/components/Select/Select.cjs +84 -0
  188. package/dist/components/Select/Select.js +80 -0
  189. package/dist/components/Select/SelectOption.cjs +26 -0
  190. package/dist/components/Select/SelectOption.js +23 -0
  191. package/dist/components/Select/index.cjs +7 -0
  192. package/dist/components/Select/index.js +2 -0
  193. package/dist/components/SidebarMenu/SidebarMenu.cjs +85 -0
  194. package/dist/components/SidebarMenu/SidebarMenu.js +81 -0
  195. package/dist/components/SidebarMenu/SidebarMenuItem.cjs +126 -0
  196. package/dist/components/SidebarMenu/SidebarMenuItem.js +122 -0
  197. package/dist/components/SidebarMenu/SidebarMenuSection.cjs +14 -0
  198. package/dist/components/SidebarMenu/SidebarMenuSection.js +11 -0
  199. package/dist/components/SidebarMenu/index.cjs +12 -0
  200. package/dist/components/SidebarMenu/index.js +4 -0
  201. package/dist/components/Slider/Slider.cjs +161 -0
  202. package/dist/components/Slider/Slider.js +158 -0
  203. package/dist/components/Slider/index.cjs +6 -0
  204. package/dist/components/Slider/index.js +1 -0
  205. package/dist/components/Spinner/Spinner.cjs +93 -0
  206. package/dist/components/Spinner/Spinner.js +90 -0
  207. package/dist/components/Spinner/index.cjs +5 -0
  208. package/dist/components/Spinner/index.js +1 -0
  209. package/dist/components/Stepper/Stepper.cjs +82 -0
  210. package/dist/components/Stepper/Stepper.js +79 -0
  211. package/dist/components/Stepper/index.cjs +7 -0
  212. package/dist/components/Stepper/index.js +1 -0
  213. package/dist/components/Table/Table.cjs +25 -0
  214. package/dist/components/Table/Table.js +22 -0
  215. package/dist/components/Table/index.cjs +10 -0
  216. package/dist/components/Table/index.js +1 -0
  217. package/dist/components/Table/useTableSelection.cjs +60 -0
  218. package/dist/components/Table/useTableSelection.js +57 -0
  219. package/dist/components/Tabs/Tab.cjs +70 -0
  220. package/dist/components/Tabs/Tab.js +67 -0
  221. package/dist/components/Tabs/Tabs.cjs +133 -0
  222. package/dist/components/Tabs/Tabs.js +129 -0
  223. package/dist/components/Tabs/index.cjs +7 -0
  224. package/dist/components/Tabs/index.js +2 -0
  225. package/dist/components/Tooltip/Tooltip.cjs +101 -0
  226. package/dist/components/Tooltip/Tooltip.js +98 -0
  227. package/dist/components/Tooltip/index.cjs +5 -0
  228. package/dist/components/Tooltip/index.js +1 -0
  229. package/dist/context/ThemeContext.cjs +97 -0
  230. package/dist/context/ThemeContext.js +92 -0
  231. package/dist/fonts/README.md +13 -0
  232. package/dist/fonts/hanken-grotesk-cyrillic-ext-italic.woff2 +0 -0
  233. package/dist/fonts/hanken-grotesk-cyrillic-ext-normal.woff2 +0 -0
  234. package/dist/fonts/hanken-grotesk-latin-ext-italic.woff2 +0 -0
  235. package/dist/fonts/hanken-grotesk-latin-ext-normal.woff2 +0 -0
  236. package/dist/fonts/hanken-grotesk-latin-italic.woff2 +0 -0
  237. package/dist/fonts/hanken-grotesk-latin-normal.woff2 +0 -0
  238. package/dist/fonts/hanken-grotesk-vietnamese-italic.woff2 +0 -0
  239. package/dist/fonts/hanken-grotesk-vietnamese-normal.woff2 +0 -0
  240. package/dist/fonts/hankengrotesk-LICENSE.txt +94 -0
  241. package/dist/fonts/manrope-LICENSE.txt +93 -0
  242. package/dist/fonts/manrope-cyrillic-ext-normal.woff2 +0 -0
  243. package/dist/fonts/manrope-cyrillic-normal.woff2 +0 -0
  244. package/dist/fonts/manrope-greek-normal.woff2 +0 -0
  245. package/dist/fonts/manrope-latin-ext-normal.woff2 +0 -0
  246. package/dist/fonts/manrope-latin-normal.woff2 +0 -0
  247. package/dist/fonts/manrope-vietnamese-normal.woff2 +0 -0
  248. package/dist/fonts.css +148 -0
  249. package/dist/hooks/form/index.cjs +11 -0
  250. package/dist/hooks/form/index.js +3 -0
  251. package/dist/hooks/form/useRaydenFormControl.cjs +81 -0
  252. package/dist/hooks/form/useRaydenFormControl.js +76 -0
  253. package/dist/hooks/form/useRaydenInput.cjs +38 -0
  254. package/dist/hooks/form/useRaydenInput.js +35 -0
  255. package/dist/hooks/form/useRaydenSelect.cjs +45 -0
  256. package/dist/hooks/form/useRaydenSelect.js +42 -0
  257. package/dist/hooks/index.cjs +17 -0
  258. package/dist/hooks/index.js +1 -0
  259. package/dist/hooks/useBodyScrollLock.cjs +24 -0
  260. package/dist/hooks/useBodyScrollLock.js +21 -0
  261. package/dist/hooks/useCollisionAwareSide.cjs +72 -0
  262. package/dist/hooks/useCollisionAwareSide.js +69 -0
  263. package/dist/hooks/useControllableValue.cjs +16 -0
  264. package/dist/hooks/useControllableValue.js +13 -0
  265. package/dist/hooks/useDismissableLayer.cjs +100 -0
  266. package/dist/hooks/useDismissableLayer.js +97 -0
  267. package/dist/hooks/usePopupList.cjs +101 -0
  268. package/dist/hooks/usePopupList.js +98 -0
  269. package/dist/icons-8yD7I5jO.d.cts +430 -0
  270. package/dist/icons-8yD7I5jO.d.ts +430 -0
  271. package/dist/icons.cjs +2111 -418
  272. package/dist/icons.d.cts +1256 -429
  273. package/dist/icons.d.ts +1256 -429
  274. package/dist/icons.js +2089 -1
  275. package/dist/index.cjs +128 -15046
  276. package/dist/index.d.cts +697 -662
  277. package/dist/index.d.ts +697 -662
  278. package/dist/index.js +43 -14962
  279. package/dist/motion/Collapse.cjs +28 -0
  280. package/dist/motion/Collapse.js +25 -0
  281. package/dist/motion/MotionProvider.cjs +43 -0
  282. package/dist/motion/MotionProvider.js +38 -0
  283. package/dist/motion/Pressable.cjs +46 -0
  284. package/dist/motion/Pressable.js +43 -0
  285. package/dist/motion/Reveal.cjs +19 -0
  286. package/dist/motion/Reveal.js +16 -0
  287. package/dist/motion/SharedLayout.cjs +46 -0
  288. package/dist/motion/SharedLayout.js +43 -0
  289. package/dist/motion/index.cjs +19 -0
  290. package/dist/motion/index.js +6 -0
  291. package/dist/motion/presence.cjs +58 -0
  292. package/dist/motion/presence.js +55 -0
  293. package/dist/motion/presets.cjs +88 -0
  294. package/dist/motion/presets.js +84 -0
  295. package/dist/motion.d.cts +51 -0
  296. package/dist/motion.d.ts +51 -0
  297. package/dist/preset.cjs +356 -195
  298. package/dist/preset.d.cts +111 -32
  299. package/dist/preset.d.ts +111 -32
  300. package/dist/preset.js +353 -187
  301. package/dist/presets-Ba5QndHg.d.cts +144 -0
  302. package/dist/presets-Ba5QndHg.d.ts +144 -0
  303. package/dist/styles.css +1 -1
  304. package/dist/utils/cn.cjs +38 -0
  305. package/dist/utils/cn.js +35 -0
  306. package/dist/utils/resolveIcon.cjs +18 -0
  307. package/dist/utils/resolveIcon.js +15 -0
  308. package/package.json +79 -21
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.iconNames = exports.iconCatalog = exports.Icon = void 0;
4
+ var Icon_1 = require("./Icon.cjs");
5
+ Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return Icon_1.Icon; } });
6
+ var catalog_1 = require("./catalog.cjs");
7
+ Object.defineProperty(exports, "iconCatalog", { enumerable: true, get: function () { return catalog_1.iconCatalog; } });
8
+ Object.defineProperty(exports, "iconNames", { enumerable: true, get: function () { return catalog_1.iconNames; } });
@@ -0,0 +1,2 @@
1
+ export { Icon } from "./Icon.js";
2
+ export { iconCatalog, iconNames } from "./catalog.js";
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Input = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const cn_1 = require("../../utils/cn.cjs");
7
+ const resolveIcon_1 = require("../../utils/resolveIcon.cjs");
8
+ const inputFrameSize = {
9
+ xs: "px-2.5 py-2 gap-2",
10
+ sm: "p-3 gap-3",
11
+ md: "px-4 py-3 gap-3",
12
+ lg: "px-4 py-3 gap-3",
13
+ };
14
+ const addonHeight = {
15
+ xs: "",
16
+ sm: "h-10",
17
+ md: "h-12",
18
+ lg: "h-14",
19
+ };
20
+ exports.Input = (0, react_1.forwardRef)(({ size = "sm", label, helperText, error, success, leadingIcon, trailingIcon, addonRight, leadingAddon, trailingAddon, trailingAction, readOnly, disabled, className, wrapperClassName, id, required, ...rest }, ref) => {
21
+ const generatedId = (0, react_1.useId)();
22
+ const inputId = id || generatedId;
23
+ const hasError = !!error;
24
+ const hasSuccess = !!success;
25
+ const hasAddon = !!leadingAddon || !!trailingAddon;
26
+ const bottomText = hasError
27
+ ? typeof error === "string"
28
+ ? error
29
+ : undefined
30
+ : hasSuccess
31
+ ? typeof success === "string"
32
+ ? success
33
+ : undefined
34
+ : helperText;
35
+ const descriptionId = bottomText ? `${inputId}-description` : undefined;
36
+ const borderColor = hasError
37
+ ? "border-error-400 focus-within:border-error-400"
38
+ : hasSuccess
39
+ ? "border-success-400 focus-within:border-success-400"
40
+ : "border-control-border hover:border-primary-100 focus-within:border-primary-400";
41
+ const inputBg = readOnly ? "bg-grey-100" : disabled ? "bg-grey-50" : "bg-surface";
42
+ // When addons are present, the container is a flex row with no border — addons and input have their own borders
43
+ if (hasAddon) {
44
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-col gap-1 w-full", wrapperClassName), children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: inputId, className: "text-sm font-medium text-on-surface leading-[1.45]", children: label })), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex items-stretch", addonHeight[size]), children: [leadingAddon && ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("flex items-center gap-1 px-3 py-2 bg-grey-50 border border-r-0 border-control-border rounded-l-lg overflow-hidden shrink-0", "text-sm font-medium text-grey-700"), children: leadingAddon })), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-1 items-center border overflow-hidden transition-colors", inputFrameSize[size], inputBg, borderColor, !leadingAddon && !trailingAddon && "rounded-lg", leadingAddon && !trailingAddon && "rounded-r-lg", !leadingAddon && trailingAddon && "rounded-l-lg", leadingAddon && trailingAddon && "", disabled && "cursor-not-allowed"), children: [leadingIcon && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: (0, resolveIcon_1.resolveIcon)(leadingIcon, "md") })), (0, jsx_runtime_1.jsx)("input", { ref: ref, id: inputId, readOnly: readOnly, disabled: disabled, required: required, "aria-invalid": hasError || undefined, "aria-required": required || undefined, "aria-describedby": descriptionId, className: (0, cn_1.cn)("flex-1 min-w-0 bg-transparent text-sm text-on-surface placeholder:text-on-surface-muted outline-none disabled:cursor-not-allowed", className), ...rest }), addonRight && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 text-sm text-on-surface-muted", children: addonRight })), trailingIcon && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: (0, resolveIcon_1.resolveIcon)(trailingIcon, "md") })), trailingAction && (0, jsx_runtime_1.jsx)("span", { className: "shrink-0", children: trailingAction })] }), trailingAddon && ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("flex items-center gap-1 px-3 py-2 bg-grey-50 border border-l-0 border-control-border rounded-r-lg overflow-hidden shrink-0", "text-sm font-medium text-grey-700"), children: trailingAddon }))] }), bottomText && ((0, jsx_runtime_1.jsx)("p", { id: descriptionId, className: (0, cn_1.cn)("text-sm leading-[1.45]", hasError
45
+ ? "text-feedback-error"
46
+ : hasSuccess
47
+ ? "text-feedback-success"
48
+ : "text-on-surface-muted"), children: bottomText }))] }));
49
+ }
50
+ // Standard input (no addons)
51
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-col gap-1 w-full", wrapperClassName), children: [label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: inputId, className: "text-sm font-medium text-on-surface leading-[1.45]", children: label })), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex items-center border rounded-lg overflow-hidden transition-colors", inputFrameSize[size], addonHeight[size], readOnly
52
+ ? // A read-only input stays in the tab order, but this branch dropped
53
+ // focus-within styling while the native input keeps outline-none, so
54
+ // focus became invisible. The addon branch always kept it.
55
+ "bg-grey-100 border-control-border focus-within:border-primary-400"
56
+ : disabled
57
+ ? "bg-grey-50 border-grey-200 cursor-not-allowed"
58
+ : (0, cn_1.cn)("bg-surface", borderColor)), children: [leadingIcon && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: (0, resolveIcon_1.resolveIcon)(leadingIcon, "md") })), (0, jsx_runtime_1.jsx)("input", { ref: ref, id: inputId, readOnly: readOnly, disabled: disabled, required: required, "aria-invalid": hasError || undefined, "aria-required": required || undefined, "aria-describedby": descriptionId, className: (0, cn_1.cn)("flex-1 min-w-0 bg-transparent text-sm text-on-surface placeholder:text-on-surface-muted outline-none disabled:cursor-not-allowed", className), ...rest }), addonRight && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 text-sm text-on-surface-muted", children: addonRight })), trailingIcon && ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: (0, resolveIcon_1.resolveIcon)(trailingIcon, "md") })), trailingAction && (0, jsx_runtime_1.jsx)("span", { className: "shrink-0", children: trailingAction })] }), bottomText && ((0, jsx_runtime_1.jsx)("p", { id: descriptionId, className: (0, cn_1.cn)("text-sm leading-[1.45]", hasError
59
+ ? "text-feedback-error"
60
+ : hasSuccess
61
+ ? "text-feedback-success"
62
+ : "text-on-surface-muted"), children: bottomText }))] }));
63
+ });
64
+ exports.Input.displayName = "Input";
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useId } from "react";
3
+ import { cn } from "../../utils/cn.js";
4
+ import { resolveIcon } from "../../utils/resolveIcon.js";
5
+ const inputFrameSize = {
6
+ xs: "px-2.5 py-2 gap-2",
7
+ sm: "p-3 gap-3",
8
+ md: "px-4 py-3 gap-3",
9
+ lg: "px-4 py-3 gap-3",
10
+ };
11
+ const addonHeight = {
12
+ xs: "",
13
+ sm: "h-10",
14
+ md: "h-12",
15
+ lg: "h-14",
16
+ };
17
+ export const Input = forwardRef(({ size = "sm", label, helperText, error, success, leadingIcon, trailingIcon, addonRight, leadingAddon, trailingAddon, trailingAction, readOnly, disabled, className, wrapperClassName, id, required, ...rest }, ref) => {
18
+ const generatedId = useId();
19
+ const inputId = id || generatedId;
20
+ const hasError = !!error;
21
+ const hasSuccess = !!success;
22
+ const hasAddon = !!leadingAddon || !!trailingAddon;
23
+ const bottomText = hasError
24
+ ? typeof error === "string"
25
+ ? error
26
+ : undefined
27
+ : hasSuccess
28
+ ? typeof success === "string"
29
+ ? success
30
+ : undefined
31
+ : helperText;
32
+ const descriptionId = bottomText ? `${inputId}-description` : undefined;
33
+ const borderColor = hasError
34
+ ? "border-error-400 focus-within:border-error-400"
35
+ : hasSuccess
36
+ ? "border-success-400 focus-within:border-success-400"
37
+ : "border-control-border hover:border-primary-100 focus-within:border-primary-400";
38
+ const inputBg = readOnly ? "bg-grey-100" : disabled ? "bg-grey-50" : "bg-surface";
39
+ // When addons are present, the container is a flex row with no border — addons and input have their own borders
40
+ if (hasAddon) {
41
+ return (_jsxs("div", { className: cn("flex flex-col gap-1 w-full", wrapperClassName), children: [label && (_jsx("label", { htmlFor: inputId, className: "text-sm font-medium text-on-surface leading-[1.45]", children: label })), _jsxs("div", { className: cn("flex items-stretch", addonHeight[size]), children: [leadingAddon && (_jsx("div", { className: cn("flex items-center gap-1 px-3 py-2 bg-grey-50 border border-r-0 border-control-border rounded-l-lg overflow-hidden shrink-0", "text-sm font-medium text-grey-700"), children: leadingAddon })), _jsxs("div", { className: cn("flex flex-1 items-center border overflow-hidden transition-colors", inputFrameSize[size], inputBg, borderColor, !leadingAddon && !trailingAddon && "rounded-lg", leadingAddon && !trailingAddon && "rounded-r-lg", !leadingAddon && trailingAddon && "rounded-l-lg", leadingAddon && trailingAddon && "", disabled && "cursor-not-allowed"), children: [leadingIcon && (_jsx("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: resolveIcon(leadingIcon, "md") })), _jsx("input", { ref: ref, id: inputId, readOnly: readOnly, disabled: disabled, required: required, "aria-invalid": hasError || undefined, "aria-required": required || undefined, "aria-describedby": descriptionId, className: cn("flex-1 min-w-0 bg-transparent text-sm text-on-surface placeholder:text-on-surface-muted outline-none disabled:cursor-not-allowed", className), ...rest }), addonRight && (_jsx("span", { className: "shrink-0 text-sm text-on-surface-muted", children: addonRight })), trailingIcon && (_jsx("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: resolveIcon(trailingIcon, "md") })), trailingAction && _jsx("span", { className: "shrink-0", children: trailingAction })] }), trailingAddon && (_jsx("div", { className: cn("flex items-center gap-1 px-3 py-2 bg-grey-50 border border-l-0 border-control-border rounded-r-lg overflow-hidden shrink-0", "text-sm font-medium text-grey-700"), children: trailingAddon }))] }), bottomText && (_jsx("p", { id: descriptionId, className: cn("text-sm leading-[1.45]", hasError
42
+ ? "text-feedback-error"
43
+ : hasSuccess
44
+ ? "text-feedback-success"
45
+ : "text-on-surface-muted"), children: bottomText }))] }));
46
+ }
47
+ // Standard input (no addons)
48
+ return (_jsxs("div", { className: cn("flex flex-col gap-1 w-full", wrapperClassName), children: [label && (_jsx("label", { htmlFor: inputId, className: "text-sm font-medium text-on-surface leading-[1.45]", children: label })), _jsxs("div", { className: cn("flex items-center border rounded-lg overflow-hidden transition-colors", inputFrameSize[size], addonHeight[size], readOnly
49
+ ? // A read-only input stays in the tab order, but this branch dropped
50
+ // focus-within styling while the native input keeps outline-none, so
51
+ // focus became invisible. The addon branch always kept it.
52
+ "bg-grey-100 border-control-border focus-within:border-primary-400"
53
+ : disabled
54
+ ? "bg-grey-50 border-grey-200 cursor-not-allowed"
55
+ : cn("bg-surface", borderColor)), children: [leadingIcon && (_jsx("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: resolveIcon(leadingIcon, "md") })), _jsx("input", { ref: ref, id: inputId, readOnly: readOnly, disabled: disabled, required: required, "aria-invalid": hasError || undefined, "aria-required": required || undefined, "aria-describedby": descriptionId, className: cn("flex-1 min-w-0 bg-transparent text-sm text-on-surface placeholder:text-on-surface-muted outline-none disabled:cursor-not-allowed", className), ...rest }), addonRight && (_jsx("span", { className: "shrink-0 text-sm text-on-surface-muted", children: addonRight })), trailingIcon && (_jsx("span", { className: "shrink-0 size-6 text-on-surface-muted", "aria-hidden": "true", children: resolveIcon(trailingIcon, "md") })), trailingAction && _jsx("span", { className: "shrink-0", children: trailingAction })] }), bottomText && (_jsx("p", { id: descriptionId, className: cn("text-sm leading-[1.45]", hasError
56
+ ? "text-feedback-error"
57
+ : hasSuccess
58
+ ? "text-feedback-success"
59
+ : "text-on-surface-muted"), children: bottomText }))] }));
60
+ });
61
+ Input.displayName = "Input";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Input = void 0;
4
+ var Input_1 = require("./Input.cjs");
5
+ Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return Input_1.Input; } });
@@ -0,0 +1 @@
1
+ export { Input } from "./Input.js";
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetricsCard = MetricsCard;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cn_1 = require("../../utils/cn.cjs");
6
+ const resolveIcon_1 = require("../../utils/resolveIcon.cjs");
7
+ const Icon_1 = require("../Icon/index.cjs");
8
+ // ─── Sub-components ──────────────────────────────────────────────
9
+ const sentimentStyles = {
10
+ // Identical to the former `up` / `down` styles so the defaults render unchanged.
11
+ positive: "bg-primary-50 text-primary-700",
12
+ negative: "bg-error-50 text-error-700",
13
+ neutral: "bg-grey-100 text-grey-700",
14
+ };
15
+ const statusStyles = {
16
+ success: "bg-success-50 text-success-700",
17
+ error: "bg-error-50 text-error-700",
18
+ warning: "bg-warning-50 text-warning-700",
19
+ info: "bg-secondary-50 text-secondary-700",
20
+ };
21
+ function TrendBadge({ badge }) {
22
+ const trend = badge.trend ?? "up";
23
+ const sentiment = badge.sentiment ?? (trend === "down" ? "negative" : "positive");
24
+ return ((0, jsx_runtime_1.jsxs)("span", { className: (0, cn_1.cn)("inline-flex items-center gap-1 rounded-xl px-1 text-body-xs font-medium", sentimentStyles[sentiment]), children: [(0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: trend === "down" ? "arrow-down" : "arrow-up", size: "xs" }), badge.label] }));
25
+ }
26
+ function StatusBadge({ badge }) {
27
+ return ((0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)("inline-flex items-center gap-0.5 rounded-xl px-3 py-0.5 text-body-sm font-medium", statusStyles[badge.variant ?? "success"]), children: badge.label }));
28
+ }
29
+ /** Small bordered icon container (32×32) used in v2, v3, v6 */
30
+ function SmallIcon({ icon }) {
31
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-grey-200 bg-surface", children: (0, jsx_runtime_1.jsx)("span", { className: "size-4", children: (0, resolveIcon_1.resolveIcon)(icon, "sm") }) }));
32
+ }
33
+ /** Large tinted icon container (48×48) used in v4 */
34
+ function LargeIcon({ icon }) {
35
+ return ((0, jsx_runtime_1.jsx)("div", { className: "flex size-12 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-action-primary-text", children: (0, jsx_runtime_1.jsx)("span", { className: "size-6", children: (0, resolveIcon_1.resolveIcon)(icon, "lg") }) }));
36
+ }
37
+ /** CTA footer bar — grey bg strip at bottom with link text */
38
+ function CtaFooter({ cta, centered = false }) {
39
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("flex items-center border-t border-grey-100 bg-grey-50 p-4", centered ? "justify-center" : "justify-between"), children: (0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: cta.onClick, className: "inline-flex items-center gap-1 text-body-xs font-medium text-primary-600 cursor-pointer hover:text-primary-400", children: [cta.label, cta.icon && (0, jsx_runtime_1.jsx)("span", { className: "size-5", children: (0, resolveIcon_1.resolveIcon)(cta.icon, "md") })] }) }));
40
+ }
41
+ /** Inline CTA text link (no footer bar) — used in v1, v5 */
42
+ function CtaInline({ cta }) {
43
+ return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: cta.onClick, className: "inline-flex items-center text-body-xs font-medium text-primary-600 cursor-pointer hover:text-primary-400", children: cta.label }));
44
+ }
45
+ // ─── Variation Layouts ───────────────────────────────────────────
46
+ /**
47
+ * Variation 1: Horizontal — label+value+CTA left, date+status right
48
+ */
49
+ function Variation1({ label, value, secondaryText, statusBadge, cta }) {
50
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-start justify-between p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-8 items-start", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2 items-start", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-h3 font-semibold text-grey-800", style: { fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1" }, children: value }), cta && (0, jsx_runtime_1.jsx)(CtaInline, { cta: cta })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end justify-between self-stretch", children: [secondaryText && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-sm font-medium text-on-surface-muted", children: secondaryText })), statusBadge && (0, jsx_runtime_1.jsx)(StatusBadge, { badge: statusBadge })] })] }));
51
+ }
52
+ /**
53
+ * Variation 2: Vertical — icon+label → value → badge+desc → CTA footer
54
+ */
55
+ function Variation2({ label, value, icon, trendBadge, description, cta }) {
56
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col items-start p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-8 w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [icon && (0, jsx_runtime_1.jsx)(SmallIcon, { icon: icon }), (0, jsx_runtime_1.jsx)("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-3", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-h3 font-semibold text-grey-800", style: {
57
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
58
+ }, children: value }), (trendBadge || description) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [trendBadge && (0, jsx_runtime_1.jsx)(TrendBadge, { badge: trendBadge }), description && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }) }), cta && (0, jsx_runtime_1.jsx)(CtaFooter, { cta: cta })] }));
59
+ }
60
+ /**
61
+ * Variation 3: Vertical reversed — icon+label → badge+desc → value → CTA footer
62
+ */
63
+ function Variation3({ label, value, icon, trendBadge, description, cta }) {
64
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col items-start p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-3 w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [icon && (0, jsx_runtime_1.jsx)(SmallIcon, { icon: icon }), (0, jsx_runtime_1.jsx)("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label })] }), (trendBadge || description) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [trendBadge && (0, jsx_runtime_1.jsx)(TrendBadge, { badge: trendBadge }), description && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] })), (0, jsx_runtime_1.jsx)("span", { className: "text-h3 font-semibold text-grey-800", style: {
65
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
66
+ }, children: value })] }) }), cta && (0, jsx_runtime_1.jsx)(CtaFooter, { cta: cta })] }));
67
+ }
68
+ /**
69
+ * Variation 4: Horizontal body with large icon on right — label+value+badge left, big icon right → CTA footer
70
+ */
71
+ function Variation4({ label, value, icon, trendBadge, description, cta }) {
72
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-start justify-between p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-2 opacity-80", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-h3 font-semibold text-grey-800", style: {
73
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
74
+ }, children: value }), (trendBadge || description) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1", children: [trendBadge && (0, jsx_runtime_1.jsx)(TrendBadge, { badge: trendBadge }), description && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }), icon && (0, jsx_runtime_1.jsx)(LargeIcon, { icon: icon })] }), cta && (0, jsx_runtime_1.jsx)(CtaFooter, { cta: cta })] }));
75
+ }
76
+ /**
77
+ * Variation 5: Compact horizontal — label+value+desc left, badge+CTA right
78
+ */
79
+ function Variation5({ label, value, trendBadge, description, cta }) {
80
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex w-full items-start justify-between p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label }), (0, jsx_runtime_1.jsx)("span", { className: "text-h3 font-semibold text-grey-800", style: {
81
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
82
+ }, children: value }), description && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end justify-between self-stretch gap-2", children: [trendBadge && (0, jsx_runtime_1.jsx)(TrendBadge, { badge: trendBadge }), cta && (0, jsx_runtime_1.jsx)(CtaInline, { cta: cta })] })] }));
83
+ }
84
+ /**
85
+ * Variation 6: Centered vertical — icon → label → value(28px) → badge+desc → CTA footer
86
+ */
87
+ function Variation6({ label, value, icon, trendBadge, description, cta }) {
88
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col items-center justify-center gap-4 p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [icon && (0, jsx_runtime_1.jsx)(SmallIcon, { icon: icon }), (0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted text-center", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-h4 font-semibold text-grey-800", style: {
89
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
90
+ }, children: value }), (trendBadge || description) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 justify-center", children: [trendBadge && (0, jsx_runtime_1.jsx)(TrendBadge, { badge: trendBadge }), description && ((0, jsx_runtime_1.jsx)("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }), cta && (0, jsx_runtime_1.jsx)(CtaFooter, { cta: cta, centered: true })] }));
91
+ }
92
+ // ─── Main Component ──────────────────────────────────────────────
93
+ function MetricsCard({ variation = "2", className,
94
+ // Destructure component-specific props to prevent them from being spread to DOM
95
+ label, value, icon, trendBadge, statusBadge, description, secondaryText, cta, ...rest }) {
96
+ const componentProps = {
97
+ label,
98
+ value,
99
+ icon,
100
+ trendBadge,
101
+ statusBadge,
102
+ description,
103
+ secondaryText,
104
+ cta,
105
+ };
106
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex flex-col overflow-clip rounded-xl border border-grey-200 bg-surface shadow-soft-xxs", className), ...rest, children: [variation === "1" && (0, jsx_runtime_1.jsx)(Variation1, { ...componentProps }), variation === "2" && (0, jsx_runtime_1.jsx)(Variation2, { ...componentProps }), variation === "3" && (0, jsx_runtime_1.jsx)(Variation3, { ...componentProps }), variation === "4" && (0, jsx_runtime_1.jsx)(Variation4, { ...componentProps }), variation === "5" && (0, jsx_runtime_1.jsx)(Variation5, { ...componentProps }), variation === "6" && (0, jsx_runtime_1.jsx)(Variation6, { ...componentProps })] }));
107
+ }
@@ -0,0 +1,104 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ import { resolveIcon } from "../../utils/resolveIcon.js";
4
+ import { Icon } from "../Icon/index.js";
5
+ // ─── Sub-components ──────────────────────────────────────────────
6
+ const sentimentStyles = {
7
+ // Identical to the former `up` / `down` styles so the defaults render unchanged.
8
+ positive: "bg-primary-50 text-primary-700",
9
+ negative: "bg-error-50 text-error-700",
10
+ neutral: "bg-grey-100 text-grey-700",
11
+ };
12
+ const statusStyles = {
13
+ success: "bg-success-50 text-success-700",
14
+ error: "bg-error-50 text-error-700",
15
+ warning: "bg-warning-50 text-warning-700",
16
+ info: "bg-secondary-50 text-secondary-700",
17
+ };
18
+ function TrendBadge({ badge }) {
19
+ const trend = badge.trend ?? "up";
20
+ const sentiment = badge.sentiment ?? (trend === "down" ? "negative" : "positive");
21
+ return (_jsxs("span", { className: cn("inline-flex items-center gap-1 rounded-xl px-1 text-body-xs font-medium", sentimentStyles[sentiment]), children: [_jsx(Icon, { name: trend === "down" ? "arrow-down" : "arrow-up", size: "xs" }), badge.label] }));
22
+ }
23
+ function StatusBadge({ badge }) {
24
+ return (_jsx("span", { className: cn("inline-flex items-center gap-0.5 rounded-xl px-3 py-0.5 text-body-sm font-medium", statusStyles[badge.variant ?? "success"]), children: badge.label }));
25
+ }
26
+ /** Small bordered icon container (32×32) used in v2, v3, v6 */
27
+ function SmallIcon({ icon }) {
28
+ return (_jsx("div", { className: "flex size-8 shrink-0 items-center justify-center rounded-lg border border-grey-200 bg-surface", children: _jsx("span", { className: "size-4", children: resolveIcon(icon, "sm") }) }));
29
+ }
30
+ /** Large tinted icon container (48×48) used in v4 */
31
+ function LargeIcon({ icon }) {
32
+ return (_jsx("div", { className: "flex size-12 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-action-primary-text", children: _jsx("span", { className: "size-6", children: resolveIcon(icon, "lg") }) }));
33
+ }
34
+ /** CTA footer bar — grey bg strip at bottom with link text */
35
+ function CtaFooter({ cta, centered = false }) {
36
+ return (_jsx("div", { className: cn("flex items-center border-t border-grey-100 bg-grey-50 p-4", centered ? "justify-center" : "justify-between"), children: _jsxs("button", { type: "button", onClick: cta.onClick, className: "inline-flex items-center gap-1 text-body-xs font-medium text-primary-600 cursor-pointer hover:text-primary-400", children: [cta.label, cta.icon && _jsx("span", { className: "size-5", children: resolveIcon(cta.icon, "md") })] }) }));
37
+ }
38
+ /** Inline CTA text link (no footer bar) — used in v1, v5 */
39
+ function CtaInline({ cta }) {
40
+ return (_jsx("button", { type: "button", onClick: cta.onClick, className: "inline-flex items-center text-body-xs font-medium text-primary-600 cursor-pointer hover:text-primary-400", children: cta.label }));
41
+ }
42
+ // ─── Variation Layouts ───────────────────────────────────────────
43
+ /**
44
+ * Variation 1: Horizontal — label+value+CTA left, date+status right
45
+ */
46
+ function Variation1({ label, value, secondaryText, statusBadge, cta }) {
47
+ return (_jsxs("div", { className: "flex w-full items-start justify-between p-4", children: [_jsxs("div", { className: "flex flex-col gap-8 items-start", children: [_jsx("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label }), _jsxs("div", { className: "flex flex-col gap-2 items-start", children: [_jsx("span", { className: "text-h3 font-semibold text-grey-800", style: { fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1" }, children: value }), cta && _jsx(CtaInline, { cta: cta })] })] }), _jsxs("div", { className: "flex flex-col items-end justify-between self-stretch", children: [secondaryText && (_jsx("span", { className: "text-body-sm font-medium text-on-surface-muted", children: secondaryText })), statusBadge && _jsx(StatusBadge, { badge: statusBadge })] })] }));
48
+ }
49
+ /**
50
+ * Variation 2: Vertical — icon+label → value → badge+desc → CTA footer
51
+ */
52
+ function Variation2({ label, value, icon, trendBadge, description, cta }) {
53
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex w-full flex-col items-start p-4", children: _jsxs("div", { className: "flex flex-col items-start gap-8 w-full", children: [_jsxs("div", { className: "flex items-center gap-3", children: [icon && _jsx(SmallIcon, { icon: icon }), _jsx("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label })] }), _jsxs("div", { className: "flex flex-col items-start gap-3", children: [_jsx("span", { className: "text-h3 font-semibold text-grey-800", style: {
54
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
55
+ }, children: value }), (trendBadge || description) && (_jsxs("div", { className: "flex items-center gap-1", children: [trendBadge && _jsx(TrendBadge, { badge: trendBadge }), description && (_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }) }), cta && _jsx(CtaFooter, { cta: cta })] }));
56
+ }
57
+ /**
58
+ * Variation 3: Vertical reversed — icon+label → badge+desc → value → CTA footer
59
+ */
60
+ function Variation3({ label, value, icon, trendBadge, description, cta }) {
61
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex w-full flex-col items-start p-4", children: _jsxs("div", { className: "flex flex-col items-start gap-3 w-full", children: [_jsxs("div", { className: "flex items-center gap-3", children: [icon && _jsx(SmallIcon, { icon: icon }), _jsx("span", { className: "text-body-sm font-medium text-on-surface-muted", children: label })] }), (trendBadge || description) && (_jsxs("div", { className: "flex items-center gap-1", children: [trendBadge && _jsx(TrendBadge, { badge: trendBadge }), description && (_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] })), _jsx("span", { className: "text-h3 font-semibold text-grey-800", style: {
62
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
63
+ }, children: value })] }) }), cta && _jsx(CtaFooter, { cta: cta })] }));
64
+ }
65
+ /**
66
+ * Variation 4: Horizontal body with large icon on right — label+value+badge left, big icon right → CTA footer
67
+ */
68
+ function Variation4({ label, value, icon, trendBadge, description, cta }) {
69
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full items-start justify-between p-4", children: [_jsxs("div", { className: "flex flex-col items-start gap-4", children: [_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label }), _jsxs("div", { className: "flex flex-col items-start gap-2 opacity-80", children: [_jsx("span", { className: "text-h3 font-semibold text-grey-800", style: {
70
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
71
+ }, children: value }), (trendBadge || description) && (_jsxs("div", { className: "flex items-center gap-1", children: [trendBadge && _jsx(TrendBadge, { badge: trendBadge }), description && (_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }), icon && _jsx(LargeIcon, { icon: icon })] }), cta && _jsx(CtaFooter, { cta: cta })] }));
72
+ }
73
+ /**
74
+ * Variation 5: Compact horizontal — label+value+desc left, badge+CTA right
75
+ */
76
+ function Variation5({ label, value, trendBadge, description, cta }) {
77
+ return (_jsxs("div", { className: "flex w-full items-start justify-between p-4", children: [_jsxs("div", { className: "flex flex-col items-start gap-1", children: [_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label }), _jsx("span", { className: "text-h3 font-semibold text-grey-800", style: {
78
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
79
+ }, children: value }), description && (_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }), _jsxs("div", { className: "flex flex-col items-end justify-between self-stretch gap-2", children: [trendBadge && _jsx(TrendBadge, { badge: trendBadge }), cta && _jsx(CtaInline, { cta: cta })] })] }));
80
+ }
81
+ /**
82
+ * Variation 6: Centered vertical — icon → label → value(28px) → badge+desc → CTA footer
83
+ */
84
+ function Variation6({ label, value, icon, trendBadge, description, cta }) {
85
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full flex-col items-center justify-center gap-4 p-4", children: [_jsxs("div", { className: "flex flex-col items-center gap-2", children: [icon && _jsx(SmallIcon, { icon: icon }), _jsx("span", { className: "text-body-xs font-medium text-on-surface-muted text-center", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: label })] }), _jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx("span", { className: "text-h4 font-semibold text-grey-800", style: {
86
+ fontFeatureSettings: "'cv01' 1, 'cv03' 1, 'cv04' 1",
87
+ }, children: value }), (trendBadge || description) && (_jsxs("div", { className: "flex items-center gap-1 justify-center", children: [trendBadge && _jsx(TrendBadge, { badge: trendBadge }), description && (_jsx("span", { className: "text-body-xs font-medium text-on-surface-muted", style: { fontFeatureSettings: "'cv03' 1, 'cv04' 1" }, children: description }))] }))] })] }), cta && _jsx(CtaFooter, { cta: cta, centered: true })] }));
88
+ }
89
+ // ─── Main Component ──────────────────────────────────────────────
90
+ export function MetricsCard({ variation = "2", className,
91
+ // Destructure component-specific props to prevent them from being spread to DOM
92
+ label, value, icon, trendBadge, statusBadge, description, secondaryText, cta, ...rest }) {
93
+ const componentProps = {
94
+ label,
95
+ value,
96
+ icon,
97
+ trendBadge,
98
+ statusBadge,
99
+ description,
100
+ secondaryText,
101
+ cta,
102
+ };
103
+ return (_jsxs("div", { className: cn("flex flex-col overflow-clip rounded-xl border border-grey-200 bg-surface shadow-soft-xxs", className), ...rest, children: [variation === "1" && _jsx(Variation1, { ...componentProps }), variation === "2" && _jsx(Variation2, { ...componentProps }), variation === "3" && _jsx(Variation3, { ...componentProps }), variation === "4" && _jsx(Variation4, { ...componentProps }), variation === "5" && _jsx(Variation5, { ...componentProps }), variation === "6" && _jsx(Variation6, { ...componentProps })] }));
104
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetricsCard = void 0;
4
+ var MetricsCard_1 = require("./MetricsCard.cjs");
5
+ Object.defineProperty(exports, "MetricsCard", { enumerable: true, get: function () { return MetricsCard_1.MetricsCard; } });
@@ -0,0 +1 @@
1
+ export { MetricsCard } from "./MetricsCard.js";
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Modal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const useBodyScrollLock_1 = require("../../hooks/useBodyScrollLock.cjs");
6
+ const react_1 = require("react");
7
+ const react_dom_1 = require("react-dom");
8
+ const cn_1 = require("../../utils/cn.cjs");
9
+ const resolveIcon_1 = require("../../utils/resolveIcon.cjs");
10
+ const Button_1 = require("../Button/index.cjs");
11
+ const presence_1 = require("../../motion/presence.cjs");
12
+ const useBrowserLayoutEffect = typeof window === "undefined" ? react_1.useEffect : react_1.useLayoutEffect;
13
+ /* ─── Icons ────────────────────────────────────────────────────────────── */
14
+ function CloseIcon({ className }) {
15
+ return ((0, jsx_runtime_1.jsx)("svg", { className: className, viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M9 3L3 9M3 3l6 6" }) }));
16
+ }
17
+ function BoxIcon({ className }) {
18
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.2, strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.67 4.67L8 7.33l5.33-2.66M8 14V7.33" }), (0, jsx_runtime_1.jsx)("path", { d: "M13.33 10.67V5.33a1.33 1.33 0 00-.66-1.15L8.67 2a1.33 1.33 0 00-1.34 0L3.33 4.18A1.33 1.33 0 002.67 5.33v5.34a1.33 1.33 0 00.66 1.15L7.33 14a1.33 1.33 0 001.34 0l4-2.18a1.33 1.33 0 00.66-1.15z" })] }));
19
+ }
20
+ /* ─── Size Config ──────────────────────────────────────────────────────── */
21
+ const sizeClasses = {
22
+ sm: "w-full max-w-[400px]",
23
+ md: "w-full max-w-[500px]",
24
+ lg: "w-full max-w-[640px]",
25
+ };
26
+ /* ─── Modal ────────────────────────────────────────────────────────────── */
27
+ exports.Modal = (0, react_1.forwardRef)(({ open, motion = false, onClose, size = "sm", title, description, icon, showClose = true,
28
+ // Defaulted only when there is something for it to do; an inert "Save"
29
+ // used to render whenever the footer appeared.
30
+ primaryLabel: primaryLabelProp, onPrimaryClick, secondaryLabel, onSecondaryClick, footerOrientation = "horizontal", closeOnOverlay = true, closeOnEscape = true, blur = true, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...rest }, ref) => {
31
+ const overlayRef = (0, react_1.useRef)(null);
32
+ const anchorRef = (0, react_1.useRef)(null);
33
+ const panelRef = (0, react_1.useRef)(null);
34
+ const titleId = (0, react_1.useId)();
35
+ const descriptionId = (0, react_1.useId)();
36
+ // The portal target only exists in a browser; defer it so an initially
37
+ // open modal can be server-rendered without touching document.
38
+ const [mounted, setMounted] = (0, react_1.useState)(false);
39
+ (0, react_1.useEffect)(() => setMounted(true), []);
40
+ const { present, preset } = (0, presence_1.useMotionPresence)(open, panelRef, motion, "overlay.pop", mounted);
41
+ // Native modal dialogs contain focus and make the background inert.
42
+ useBrowserLayoutEffect(() => {
43
+ const dialog = overlayRef.current;
44
+ if (!present || !dialog)
45
+ return;
46
+ const trigger = document.activeElement instanceof HTMLElement ? document.activeElement : null;
47
+ dialog.showModal();
48
+ return () => {
49
+ dialog.close();
50
+ if (trigger?.isConnected)
51
+ trigger.focus({ preventScroll: true });
52
+ };
53
+ }, [present, mounted]);
54
+ // ── #30: the portal escapes the provider, so its theme class is copied in.
55
+ // Copying once on open left an open dialog stuck in the old theme when the
56
+ // app switched; observe the source element and re-sync on every change.
57
+ useBrowserLayoutEffect(() => {
58
+ const dialog = overlayRef.current;
59
+ if (!present || !dialog)
60
+ return;
61
+ const source = anchorRef.current?.closest(".rayden-light, .dark");
62
+ if (!source)
63
+ return;
64
+ const sync = () => {
65
+ const isLight = source.classList.contains("rayden-light");
66
+ dialog.classList.toggle("rayden-light", isLight);
67
+ dialog.classList.toggle("dark", !isLight);
68
+ };
69
+ sync();
70
+ const observer = new MutationObserver(sync);
71
+ observer.observe(source, { attributes: true, attributeFilter: ["class"] });
72
+ // The theme may also move to a different ancestor, e.g. the documentElement.
73
+ if (source !== document.documentElement)
74
+ observer.observe(document.documentElement, {
75
+ attributes: true,
76
+ attributeFilter: ["class"],
77
+ });
78
+ return () => observer.disconnect();
79
+ }, [present, mounted]);
80
+ (0, useBodyScrollLock_1.useBodyScrollLock)(present && mounted);
81
+ const handleOverlayClick = (0, react_1.useCallback)((e) => {
82
+ if (open && closeOnOverlay && e.target === overlayRef.current)
83
+ onClose();
84
+ }, [open, closeOnOverlay, onClose]);
85
+ if (!present || !mounted)
86
+ return null;
87
+ const primaryLabel = primaryLabelProp ?? (onPrimaryClick ? "Save" : undefined);
88
+ const showPrimary = !!primaryLabel;
89
+ const showSecondary = !!secondaryLabel;
90
+ const isVertical = footerOrientation === "vertical";
91
+ const modal = ((0, jsx_runtime_1.jsx)("dialog", { ref: overlayRef, "data-rayden-motion": motion ? preset : undefined, "data-state": open ? "open" : "closed", "aria-label": ariaLabel ?? (!title && !ariaLabelledBy ? "Dialog" : undefined), "aria-labelledby": ariaLabelledBy ?? (title ? titleId : undefined), "aria-describedby": ariaDescribedBy ?? (description ? descriptionId : undefined), className: (0, cn_1.cn)("fixed inset-0 m-0 h-dvh w-screen max-h-none max-w-none border-0 bg-transparent p-4 open:flex items-center justify-center backdrop:bg-black/60", blur && "backdrop:backdrop-blur-md"), onCancel: (event) => {
92
+ event.preventDefault();
93
+ if (open && closeOnEscape)
94
+ onClose();
95
+ }, onKeyDown: (event) => {
96
+ if (event.key !== "Tab")
97
+ return;
98
+ const dialog = event.currentTarget;
99
+ const focusable = Array.from(dialog.querySelectorAll('a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]')).filter((element) => element.tabIndex >= 0 &&
100
+ !element.matches(":disabled") &&
101
+ !element.closest("[inert]") &&
102
+ element.getClientRects().length > 0 &&
103
+ getComputedStyle(element).visibility !== "hidden");
104
+ const first = focusable[0];
105
+ const last = focusable[focusable.length - 1];
106
+ if (!first || !last) {
107
+ event.preventDefault();
108
+ dialog.firstElementChild?.focus();
109
+ }
110
+ else if (!focusable.includes(document.activeElement) ||
111
+ (event.shiftKey ? document.activeElement === first : document.activeElement === last)) {
112
+ event.preventDefault();
113
+ (event.shiftKey ? last : first).focus();
114
+ }
115
+ }, onClick: handleOverlayClick, children: (0, jsx_runtime_1.jsxs)("div", { ref: (element) => {
116
+ panelRef.current = element;
117
+ if (typeof ref === "function")
118
+ ref(element);
119
+ else if (ref)
120
+ ref.current = element;
121
+ }, tabIndex: -1, className: (0, cn_1.cn)("relative flex max-h-[calc(100dvh-2rem)] flex-col bg-surface rounded-xl shadow-soft-xl overflow-hidden", sizeClasses[size], className), ...rest, children: [(title || showClose) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 pt-5 pb-2 px-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 gap-4 items-start min-w-0", children: [icon !== undefined ? ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 flex items-center justify-center p-2.5 bg-primary-50 rounded-[20px]", children: (0, jsx_runtime_1.jsx)("span", { className: "size-4", children: (0, resolveIcon_1.resolveIcon)(icon, "sm") }) })) : title ? ((0, jsx_runtime_1.jsx)("span", { className: "shrink-0 flex items-center justify-center p-2.5 bg-primary-50 rounded-[20px]", children: (0, jsx_runtime_1.jsx)(BoxIcon, { className: "size-4 text-primary-400" }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", children: [title && ((0, jsx_runtime_1.jsx)("h2", { id: titleId, className: "text-xl font-semibold text-on-surface-body leading-[1.2] tracking-[-0.4px]", children: title })), description && !!(title || showClose) && ((0, jsx_runtime_1.jsx)("p", { id: descriptionId, className: "text-sm text-on-surface-muted leading-[1.45]", children: description }))] })] }), showClose && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, "aria-label": "Close modal", className: "shrink-0 flex items-center justify-center p-2 bg-grey-75 text-grey-700 rounded-xl hover:bg-grey-200 transition-colors cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-action-primary-text", children: (0, jsx_runtime_1.jsx)(CloseIcon, { className: "size-3" }) }))] })), description && !title && !showClose && ((0, jsx_runtime_1.jsx)("p", { id: descriptionId, className: "px-4 pt-5 text-sm text-on-surface-muted leading-[1.45]", children: description })), children && (0, jsx_runtime_1.jsx)("div", { className: "min-h-0 flex-1 px-4 py-4 overflow-y-auto", children: children }), (showPrimary || showSecondary) && ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("py-5", isVertical
122
+ ? "flex flex-col gap-5 items-center px-4"
123
+ : "flex items-center justify-end gap-3 px-4"), children: [showSecondary && !isVertical && ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "secondary", onClick: onSecondaryClick ?? onClose, type: "button", children: secondaryLabel })), showPrimary && ((0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: onPrimaryClick, className: isVertical ? "w-full" : undefined, children: primaryLabel })), showSecondary && isVertical && ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "secondary", onClick: onSecondaryClick ?? onClose, type: "button", className: "w-full", children: secondaryLabel }))] }))] }) }));
124
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { ref: anchorRef, hidden: true }), (0, react_dom_1.createPortal)(modal, document.body)] }));
125
+ });
126
+ exports.Modal.displayName = "Modal";