@raydenui/ui 0.9.7 → 0.10.1

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 (309) hide show
  1. package/README.md +124 -49
  2. package/dist/Table-DCNSxua1.d.cts +31 -0
  3. package/dist/Table-DCNSxua1.d.ts +31 -0
  4. package/dist/blocks/ApplicationShellBlock.cjs +157 -0
  5. package/dist/blocks/ApplicationShellBlock.js +154 -0
  6. package/dist/blocks/CheckoutReviewBlock.cjs +16 -0
  7. package/dist/blocks/CheckoutReviewBlock.js +13 -0
  8. package/dist/blocks/CommandPaletteBlock.cjs +334 -0
  9. package/dist/blocks/CommandPaletteBlock.js +331 -0
  10. package/dist/blocks/CreateAccountBlock.cjs +147 -0
  11. package/dist/blocks/CreateAccountBlock.js +143 -0
  12. package/dist/blocks/EmptyStateBlock.cjs +19 -0
  13. package/dist/blocks/EmptyStateBlock.js +16 -0
  14. package/dist/blocks/FeatureOverviewBlock.cjs +54 -0
  15. package/dist/blocks/FeatureOverviewBlock.js +51 -0
  16. package/dist/blocks/HeaderBlock.cjs +230 -0
  17. package/dist/blocks/HeaderBlock.js +227 -0
  18. package/dist/blocks/KpiOverviewBlock.cjs +63 -0
  19. package/dist/blocks/KpiOverviewBlock.js +60 -0
  20. package/dist/blocks/LoginBlock.cjs +66 -0
  21. package/dist/blocks/LoginBlock.js +63 -0
  22. package/dist/blocks/NotificationsBlock.cjs +17 -0
  23. package/dist/blocks/NotificationsBlock.js +14 -0
  24. package/dist/blocks/PageHeaderBlock.cjs +121 -0
  25. package/dist/blocks/PageHeaderBlock.js +118 -0
  26. package/dist/blocks/PricingPlansBlock.cjs +146 -0
  27. package/dist/blocks/PricingPlansBlock.js +143 -0
  28. package/dist/blocks/ProductCollectionBlock.cjs +37 -0
  29. package/dist/blocks/ProductCollectionBlock.js +34 -0
  30. package/dist/blocks/ProductDetailBlock.cjs +30 -0
  31. package/dist/blocks/ProductDetailBlock.js +27 -0
  32. package/dist/blocks/ProductHeroBlock.cjs +83 -0
  33. package/dist/blocks/ProductHeroBlock.js +80 -0
  34. package/dist/blocks/ProfileSettingsBlock.cjs +130 -0
  35. package/dist/blocks/ProfileSettingsBlock.js +126 -0
  36. package/dist/blocks/QuickSendBlock.cjs +11 -0
  37. package/dist/blocks/QuickSendBlock.js +8 -0
  38. package/dist/blocks/RecentTransactionsBlock.cjs +13 -0
  39. package/dist/blocks/RecentTransactionsBlock.js +10 -0
  40. package/dist/blocks/SearchableTableBlock.cjs +91 -0
  41. package/dist/blocks/SearchableTableBlock.js +88 -0
  42. package/dist/blocks/ShoppingCartBlock.cjs +16 -0
  43. package/dist/blocks/ShoppingCartBlock.js +13 -0
  44. package/dist/blocks/SiteFooterBlock.cjs +69 -0
  45. package/dist/blocks/SiteFooterBlock.js +66 -0
  46. package/dist/blocks/TableBlock.cjs +20 -0
  47. package/dist/blocks/TableBlock.js +17 -0
  48. package/dist/blocks/TaskListBlock.cjs +198 -0
  49. package/dist/blocks/TaskListBlock.js +195 -0
  50. package/dist/blocks/WorkspaceSwitcherBlock.cjs +291 -0
  51. package/dist/blocks/WorkspaceSwitcherBlock.js +288 -0
  52. package/dist/blocks/commerce.cjs +44 -0
  53. package/dist/blocks/commerce.js +35 -0
  54. package/dist/blocks/index.cjs +53 -0
  55. package/dist/blocks/index.js +24 -0
  56. package/dist/blocks.d.cts +1820 -0
  57. package/dist/blocks.d.ts +1820 -0
  58. package/dist/chart.cjs +13 -0
  59. package/dist/chart.d.cts +59 -0
  60. package/dist/chart.d.ts +59 -0
  61. package/dist/chart.js +5 -0
  62. package/dist/components/Accordion/Accordion.cjs +94 -0
  63. package/dist/components/Accordion/Accordion.js +91 -0
  64. package/dist/components/Accordion/index.cjs +8 -0
  65. package/dist/components/Accordion/index.js +1 -0
  66. package/dist/components/ActivityFeed/ActivityContent.cjs +40 -0
  67. package/dist/components/ActivityFeed/ActivityContent.js +37 -0
  68. package/dist/components/ActivityFeed/ActivityItem.cjs +19 -0
  69. package/dist/components/ActivityFeed/ActivityItem.js +16 -0
  70. package/dist/components/ActivityFeed/index.cjs +7 -0
  71. package/dist/components/ActivityFeed/index.js +2 -0
  72. package/dist/components/Alert/Alert.cjs +42 -0
  73. package/dist/components/Alert/Alert.js +39 -0
  74. package/dist/components/Alert/index.cjs +5 -0
  75. package/dist/components/Alert/index.js +1 -0
  76. package/dist/components/Avatar/Avatar.cjs +101 -0
  77. package/dist/components/Avatar/Avatar.js +98 -0
  78. package/dist/components/Avatar/index.cjs +6 -0
  79. package/dist/components/Avatar/index.js +1 -0
  80. package/dist/components/Badge/Badge.cjs +53 -0
  81. package/dist/components/Badge/Badge.js +50 -0
  82. package/dist/components/Badge/index.cjs +5 -0
  83. package/dist/components/Badge/index.js +1 -0
  84. package/dist/components/Banner/Banner.cjs +83 -0
  85. package/dist/components/Banner/Banner.js +80 -0
  86. package/dist/components/Banner/index.cjs +5 -0
  87. package/dist/components/Banner/index.js +1 -0
  88. package/dist/components/Breadcrumb/Breadcrumb.cjs +31 -0
  89. package/dist/components/Breadcrumb/Breadcrumb.js +28 -0
  90. package/dist/components/Breadcrumb/index.cjs +5 -0
  91. package/dist/components/Breadcrumb/index.js +1 -0
  92. package/dist/components/Button/Button.cjs +88 -0
  93. package/dist/components/Button/Button.js +85 -0
  94. package/dist/components/Button/index.cjs +5 -0
  95. package/dist/components/Button/index.js +1 -0
  96. package/dist/components/ButtonGroup/ButtonGroup.cjs +8 -0
  97. package/dist/components/ButtonGroup/ButtonGroup.js +5 -0
  98. package/dist/components/ButtonGroup/ButtonGroupItem.cjs +15 -0
  99. package/dist/components/ButtonGroup/ButtonGroupItem.js +12 -0
  100. package/dist/components/ButtonGroup/index.cjs +7 -0
  101. package/dist/components/ButtonGroup/index.js +2 -0
  102. package/dist/components/Card/Card.cjs +94 -0
  103. package/dist/components/Card/Card.js +91 -0
  104. package/dist/components/Card/index.cjs +9 -0
  105. package/dist/components/Card/index.js +1 -0
  106. package/dist/components/Chart/Chart.cjs +160 -0
  107. package/dist/components/Chart/Chart.js +153 -0
  108. package/dist/components/Chart/index.cjs +10 -0
  109. package/dist/components/Chart/index.js +2 -0
  110. package/dist/components/Chart/theme.cjs +67 -0
  111. package/dist/components/Chart/theme.js +62 -0
  112. package/dist/components/Chip/Chip.cjs +18 -0
  113. package/dist/components/Chip/Chip.js +15 -0
  114. package/dist/components/Chip/index.cjs +5 -0
  115. package/dist/components/Chip/index.js +1 -0
  116. package/dist/components/Counter/Counter.cjs +74 -0
  117. package/dist/components/Counter/Counter.js +71 -0
  118. package/dist/components/Counter/index.cjs +6 -0
  119. package/dist/components/Counter/index.js +1 -0
  120. package/dist/components/DatePicker/DatePicker.cjs +343 -0
  121. package/dist/components/DatePicker/DatePicker.js +340 -0
  122. package/dist/components/DatePicker/index.cjs +5 -0
  123. package/dist/components/DatePicker/index.js +1 -0
  124. package/dist/components/Divider/Divider.cjs +31 -0
  125. package/dist/components/Divider/Divider.js +28 -0
  126. package/dist/components/Divider/index.cjs +5 -0
  127. package/dist/components/Divider/index.js +1 -0
  128. package/dist/components/DropdownMenu/DropdownMenu.cjs +108 -0
  129. package/dist/components/DropdownMenu/DropdownMenu.js +105 -0
  130. package/dist/components/DropdownMenu/index.cjs +11 -0
  131. package/dist/components/DropdownMenu/index.js +1 -0
  132. package/dist/components/EmptyStateIllustration/EmptyStateIllustration.cjs +42 -0
  133. package/dist/components/EmptyStateIllustration/EmptyStateIllustration.js +39 -0
  134. package/dist/components/EmptyStateIllustration/illustrations.cjs +3322 -0
  135. package/dist/components/EmptyStateIllustration/illustrations.js +3319 -0
  136. package/dist/components/EmptyStateIllustration/index.cjs +7 -0
  137. package/dist/components/EmptyStateIllustration/index.js +2 -0
  138. package/dist/components/FileUpload/FileUpload.cjs +116 -0
  139. package/dist/components/FileUpload/FileUpload.js +113 -0
  140. package/dist/components/FileUpload/FileUploadDropZone.cjs +58 -0
  141. package/dist/components/FileUpload/FileUploadDropZone.js +55 -0
  142. package/dist/components/FileUpload/FileUploadIcons.cjs +55 -0
  143. package/dist/components/FileUpload/FileUploadIcons.js +50 -0
  144. package/dist/components/FileUpload/FileUploadItem.cjs +34 -0
  145. package/dist/components/FileUpload/FileUploadItem.js +31 -0
  146. package/dist/components/FileUpload/index.cjs +9 -0
  147. package/dist/components/FileUpload/index.js +3 -0
  148. package/dist/components/FormControl/Checkbox.cjs +27 -0
  149. package/dist/components/FormControl/Checkbox.js +24 -0
  150. package/dist/components/FormControl/Radio.cjs +15 -0
  151. package/dist/components/FormControl/Radio.js +12 -0
  152. package/dist/components/FormControl/Toggle.cjs +15 -0
  153. package/dist/components/FormControl/Toggle.js +12 -0
  154. package/dist/components/FormControl/index.cjs +9 -0
  155. package/dist/components/FormControl/index.js +3 -0
  156. package/dist/components/Icon/Icon.cjs +70 -0
  157. package/dist/components/Icon/Icon.js +34 -0
  158. package/dist/components/Icon/catalog.cjs +1672 -0
  159. package/dist/components/Icon/catalog.js +1669 -0
  160. package/dist/components/Icon/icons.cjs +5621 -0
  161. package/dist/components/Icon/icons.js +5610 -0
  162. package/dist/components/Icon/index.cjs +8 -0
  163. package/dist/components/Icon/index.js +2 -0
  164. package/dist/components/Input/Input.cjs +64 -0
  165. package/dist/components/Input/Input.js +61 -0
  166. package/dist/components/Input/index.cjs +5 -0
  167. package/dist/components/Input/index.js +1 -0
  168. package/dist/components/MetricsCard/MetricsCard.cjs +107 -0
  169. package/dist/components/MetricsCard/MetricsCard.js +104 -0
  170. package/dist/components/MetricsCard/index.cjs +5 -0
  171. package/dist/components/MetricsCard/index.js +1 -0
  172. package/dist/components/Modal/Modal.cjs +126 -0
  173. package/dist/components/Modal/Modal.js +123 -0
  174. package/dist/components/Modal/index.cjs +5 -0
  175. package/dist/components/Modal/index.js +1 -0
  176. package/dist/components/Pagination/Pagination.cjs +42 -0
  177. package/dist/components/Pagination/Pagination.js +39 -0
  178. package/dist/components/Pagination/index.cjs +5 -0
  179. package/dist/components/Pagination/index.js +1 -0
  180. package/dist/components/ProgressBar/ProgressBar.cjs +34 -0
  181. package/dist/components/ProgressBar/ProgressBar.js +31 -0
  182. package/dist/components/ProgressBar/index.cjs +5 -0
  183. package/dist/components/ProgressBar/index.js +1 -0
  184. package/dist/components/ProgressCircle/ProgressCircle.cjs +34 -0
  185. package/dist/components/ProgressCircle/ProgressCircle.js +31 -0
  186. package/dist/components/ProgressCircle/index.cjs +5 -0
  187. package/dist/components/ProgressCircle/index.js +1 -0
  188. package/dist/components/Select/Select.cjs +84 -0
  189. package/dist/components/Select/Select.js +80 -0
  190. package/dist/components/Select/SelectOption.cjs +26 -0
  191. package/dist/components/Select/SelectOption.js +23 -0
  192. package/dist/components/Select/index.cjs +7 -0
  193. package/dist/components/Select/index.js +2 -0
  194. package/dist/components/SidebarMenu/SidebarMenu.cjs +85 -0
  195. package/dist/components/SidebarMenu/SidebarMenu.js +81 -0
  196. package/dist/components/SidebarMenu/SidebarMenuItem.cjs +126 -0
  197. package/dist/components/SidebarMenu/SidebarMenuItem.js +122 -0
  198. package/dist/components/SidebarMenu/SidebarMenuSection.cjs +14 -0
  199. package/dist/components/SidebarMenu/SidebarMenuSection.js +11 -0
  200. package/dist/components/SidebarMenu/index.cjs +12 -0
  201. package/dist/components/SidebarMenu/index.js +4 -0
  202. package/dist/components/Slider/Slider.cjs +161 -0
  203. package/dist/components/Slider/Slider.js +158 -0
  204. package/dist/components/Slider/index.cjs +6 -0
  205. package/dist/components/Slider/index.js +1 -0
  206. package/dist/components/Spinner/Spinner.cjs +93 -0
  207. package/dist/components/Spinner/Spinner.js +90 -0
  208. package/dist/components/Spinner/index.cjs +5 -0
  209. package/dist/components/Spinner/index.js +1 -0
  210. package/dist/components/Stepper/Stepper.cjs +82 -0
  211. package/dist/components/Stepper/Stepper.js +79 -0
  212. package/dist/components/Stepper/index.cjs +7 -0
  213. package/dist/components/Stepper/index.js +1 -0
  214. package/dist/components/Table/Table.cjs +25 -0
  215. package/dist/components/Table/Table.js +22 -0
  216. package/dist/components/Table/index.cjs +10 -0
  217. package/dist/components/Table/index.js +1 -0
  218. package/dist/components/Table/useTableSelection.cjs +60 -0
  219. package/dist/components/Table/useTableSelection.js +57 -0
  220. package/dist/components/Tabs/Tab.cjs +70 -0
  221. package/dist/components/Tabs/Tab.js +67 -0
  222. package/dist/components/Tabs/Tabs.cjs +133 -0
  223. package/dist/components/Tabs/Tabs.js +129 -0
  224. package/dist/components/Tabs/index.cjs +7 -0
  225. package/dist/components/Tabs/index.js +2 -0
  226. package/dist/components/Tooltip/Tooltip.cjs +101 -0
  227. package/dist/components/Tooltip/Tooltip.js +98 -0
  228. package/dist/components/Tooltip/index.cjs +5 -0
  229. package/dist/components/Tooltip/index.js +1 -0
  230. package/dist/context/ThemeContext.cjs +97 -0
  231. package/dist/context/ThemeContext.js +92 -0
  232. package/dist/fonts/README.md +13 -0
  233. package/dist/fonts/hanken-grotesk-cyrillic-ext-italic.woff2 +0 -0
  234. package/dist/fonts/hanken-grotesk-cyrillic-ext-normal.woff2 +0 -0
  235. package/dist/fonts/hanken-grotesk-latin-ext-italic.woff2 +0 -0
  236. package/dist/fonts/hanken-grotesk-latin-ext-normal.woff2 +0 -0
  237. package/dist/fonts/hanken-grotesk-latin-italic.woff2 +0 -0
  238. package/dist/fonts/hanken-grotesk-latin-normal.woff2 +0 -0
  239. package/dist/fonts/hanken-grotesk-vietnamese-italic.woff2 +0 -0
  240. package/dist/fonts/hanken-grotesk-vietnamese-normal.woff2 +0 -0
  241. package/dist/fonts/hankengrotesk-LICENSE.txt +94 -0
  242. package/dist/fonts/manrope-LICENSE.txt +93 -0
  243. package/dist/fonts/manrope-cyrillic-ext-normal.woff2 +0 -0
  244. package/dist/fonts/manrope-cyrillic-normal.woff2 +0 -0
  245. package/dist/fonts/manrope-greek-normal.woff2 +0 -0
  246. package/dist/fonts/manrope-latin-ext-normal.woff2 +0 -0
  247. package/dist/fonts/manrope-latin-normal.woff2 +0 -0
  248. package/dist/fonts/manrope-vietnamese-normal.woff2 +0 -0
  249. package/dist/fonts.css +148 -0
  250. package/dist/hooks/form/index.cjs +11 -0
  251. package/dist/hooks/form/index.js +3 -0
  252. package/dist/hooks/form/useRaydenFormControl.cjs +81 -0
  253. package/dist/hooks/form/useRaydenFormControl.js +76 -0
  254. package/dist/hooks/form/useRaydenInput.cjs +38 -0
  255. package/dist/hooks/form/useRaydenInput.js +35 -0
  256. package/dist/hooks/form/useRaydenSelect.cjs +45 -0
  257. package/dist/hooks/form/useRaydenSelect.js +42 -0
  258. package/dist/hooks/index.cjs +17 -0
  259. package/dist/hooks/index.js +1 -0
  260. package/dist/hooks/useBodyScrollLock.cjs +24 -0
  261. package/dist/hooks/useBodyScrollLock.js +21 -0
  262. package/dist/hooks/useCollisionAwareSide.cjs +72 -0
  263. package/dist/hooks/useCollisionAwareSide.js +69 -0
  264. package/dist/hooks/useControllableValue.cjs +16 -0
  265. package/dist/hooks/useControllableValue.js +13 -0
  266. package/dist/hooks/useDismissableLayer.cjs +100 -0
  267. package/dist/hooks/useDismissableLayer.js +97 -0
  268. package/dist/hooks/usePopupList.cjs +101 -0
  269. package/dist/hooks/usePopupList.js +98 -0
  270. package/dist/icons-8yD7I5jO.d.cts +430 -0
  271. package/dist/icons-8yD7I5jO.d.ts +430 -0
  272. package/dist/icons.cjs +2111 -418
  273. package/dist/icons.d.cts +1256 -429
  274. package/dist/icons.d.ts +1256 -429
  275. package/dist/icons.js +2089 -1
  276. package/dist/index.cjs +128 -15046
  277. package/dist/index.d.cts +697 -662
  278. package/dist/index.d.ts +697 -662
  279. package/dist/index.js +43 -14962
  280. package/dist/motion/Collapse.cjs +28 -0
  281. package/dist/motion/Collapse.js +25 -0
  282. package/dist/motion/MotionProvider.cjs +43 -0
  283. package/dist/motion/MotionProvider.js +38 -0
  284. package/dist/motion/Pressable.cjs +46 -0
  285. package/dist/motion/Pressable.js +43 -0
  286. package/dist/motion/Reveal.cjs +19 -0
  287. package/dist/motion/Reveal.js +16 -0
  288. package/dist/motion/SharedLayout.cjs +46 -0
  289. package/dist/motion/SharedLayout.js +43 -0
  290. package/dist/motion/index.cjs +19 -0
  291. package/dist/motion/index.js +6 -0
  292. package/dist/motion/presence.cjs +58 -0
  293. package/dist/motion/presence.js +55 -0
  294. package/dist/motion/presets.cjs +88 -0
  295. package/dist/motion/presets.js +84 -0
  296. package/dist/motion.d.cts +51 -0
  297. package/dist/motion.d.ts +51 -0
  298. package/dist/preset.cjs +356 -195
  299. package/dist/preset.d.cts +111 -32
  300. package/dist/preset.d.ts +111 -32
  301. package/dist/preset.js +353 -187
  302. package/dist/presets-Ba5QndHg.d.cts +144 -0
  303. package/dist/presets-Ba5QndHg.d.ts +144 -0
  304. package/dist/styles.css +1 -1
  305. package/dist/utils/cn.cjs +38 -0
  306. package/dist/utils/cn.js +35 -0
  307. package/dist/utils/resolveIcon.cjs +18 -0
  308. package/dist/utils/resolveIcon.js +15 -0
  309. package/package.json +79 -21
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ import { cn } from "../utils/cn.js";
4
+ export const commerceControl = "cursor-pointer min-h-11 rounded-lg border border-surface-border-strong bg-surface px-3 py-2 text-base text-grey-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-action-primary motion-safe:transition-colors motion-safe:duration-150 hover:border-grey-500 disabled:cursor-not-allowed disabled:opacity-50";
5
+ export const commerceAction = "inline-flex min-h-11 items-center justify-center rounded-lg bg-action-primary px-5 py-2.5 text-center text-sm font-semibold text-white hover:bg-action-primary-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-action-primary disabled:cursor-not-allowed disabled:opacity-50";
6
+ export function formatCommerceMoney(amount, currency = "GBP", locale = "en-GB") {
7
+ const format = new Intl.NumberFormat(locale, { style: "currency", currency });
8
+ const digits = format.resolvedOptions().maximumFractionDigits ?? 2;
9
+ return format.format(amount / 10 ** digits);
10
+ }
11
+ export function CommerceHeading({ title, description, headingLevel: Heading = "h2", id, }) {
12
+ return (_jsxs("header", { className: "space-y-3", children: [_jsx(Heading, { id: id, className: "max-w-[20ch] text-[clamp(1.75rem,4cqi,2.75rem)] leading-[1.12] font-semibold tracking-[-0.035em]", children: title }), description && (_jsx("p", { className: "max-w-[56ch] text-base leading-relaxed text-grey-600", children: description }))] }));
13
+ }
14
+ export function CommerceFrame({ title, description, headingLevel, className, children, busy, }) {
15
+ const id = useId();
16
+ return (_jsxs("section", { "aria-labelledby": id, "aria-busy": busy || undefined, className: cn("@container min-w-0 w-full bg-surface text-grey-900 [overflow-wrap:anywhere]", className), children: [_jsx("div", { className: "mb-8 @min-[760px]:mb-10", children: _jsx(CommerceHeading, { id: id, title: title, description: description, headingLevel: headingLevel }) }), children] }));
17
+ }
18
+ export function CommercePhoto({ image, className, priority = false, }) {
19
+ return image ? (_jsx("img", { src: image.src, alt: image.alt, loading: priority ? "eager" : "lazy", width: 640, height: 640, className: cn("aspect-square w-full rounded-lg bg-surface-muted object-cover", className) })) : (_jsx("div", { role: "img", "aria-label": "Product image unavailable", className: cn("flex aspect-square items-center justify-center rounded-xl bg-surface-muted p-4 text-center text-sm text-grey-600", className), children: "Image unavailable" }));
20
+ }
21
+ export function CommerceQuantity({ name, quantity, max, disabled, onChange, }) {
22
+ return (_jsxs("div", { role: "group", "aria-label": `Quantity for ${name}`, className: "inline-flex shrink-0 items-center rounded-lg border border-surface-border-strong bg-surface", children: [_jsx("button", { type: "button", "aria-label": `Decrease quantity for ${name}`, disabled: disabled || quantity <= 1, className: cn(commerceControl, "w-11 border-0 bg-transparent px-0 hover:bg-surface-muted"), onClick: () => onChange(quantity - 1), children: "\u2212" }), _jsx("output", { "aria-label": `Quantity for ${name}`, className: "min-w-7 px-1 text-center tabular-nums", children: quantity }), _jsx("button", { type: "button", "aria-label": `Increase quantity for ${name}`, disabled: disabled || quantity >= (max ?? 99), className: cn(commerceControl, "w-11 border-0 bg-transparent px-0 hover:bg-surface-muted"), onClick: () => onChange(quantity + 1), children: "+" })] }));
23
+ }
24
+ export function CommerceTotals({ items, shipping = 0, tax = 0, discount = 0, currency, locale, }) {
25
+ const subtotal = items.reduce((sum, item) => sum + item.price * item.quantity, 0);
26
+ const total = Math.max(0, subtotal + shipping + tax - discount);
27
+ const rows = [
28
+ ["Subtotal", subtotal],
29
+ ["Delivery", shipping],
30
+ ["Tax", tax],
31
+ ...(discount ? [["Discount", -discount]] : []),
32
+ ["Total", total],
33
+ ];
34
+ return (_jsx("dl", { className: "space-y-3 text-sm", children: rows.map(([label, amount]) => (_jsxs("div", { className: cn("flex items-baseline justify-between gap-4", label === "Total" && "border-t border-surface-border-strong pt-5 text-xl font-semibold"), children: [_jsx("dt", { children: label }), _jsx("dd", { className: "text-right tabular-nums", children: formatCommerceMoney(amount, currency, locale) })] }, label))) }));
35
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandPaletteBlock = exports.WorkspaceSwitcherBlock = exports.PageHeaderBlock = exports.ApplicationShellBlock = exports.TaskListBlock = exports.TableBlock = exports.SiteFooterBlock = exports.ShoppingCartBlock = exports.SearchableTableBlock = exports.RecentTransactionsBlock = exports.QuickSendBlock = exports.ProfileSettingsBlock = exports.defaultProfileTimeZones = exports.ProductHeroBlock = exports.ProductDetailBlock = exports.ProductCollectionBlock = exports.PricingPlansBlock = exports.NotificationsBlock = exports.LoginBlock = exports.KpiOverviewBlock = exports.HeaderBlock = exports.FeatureOverviewBlock = exports.EmptyStateBlock = exports.CreateAccountBlock = exports.defaultCreateAccountPasswordRules = exports.CheckoutReviewBlock = void 0;
4
+ var CheckoutReviewBlock_1 = require("./CheckoutReviewBlock.cjs");
5
+ Object.defineProperty(exports, "CheckoutReviewBlock", { enumerable: true, get: function () { return CheckoutReviewBlock_1.CheckoutReviewBlock; } });
6
+ var CreateAccountBlock_1 = require("./CreateAccountBlock.cjs");
7
+ Object.defineProperty(exports, "defaultCreateAccountPasswordRules", { enumerable: true, get: function () { return CreateAccountBlock_1.defaultCreateAccountPasswordRules; } });
8
+ Object.defineProperty(exports, "CreateAccountBlock", { enumerable: true, get: function () { return CreateAccountBlock_1.CreateAccountBlock; } });
9
+ var EmptyStateBlock_1 = require("./EmptyStateBlock.cjs");
10
+ Object.defineProperty(exports, "EmptyStateBlock", { enumerable: true, get: function () { return EmptyStateBlock_1.EmptyStateBlock; } });
11
+ var FeatureOverviewBlock_1 = require("./FeatureOverviewBlock.cjs");
12
+ Object.defineProperty(exports, "FeatureOverviewBlock", { enumerable: true, get: function () { return FeatureOverviewBlock_1.FeatureOverviewBlock; } });
13
+ var HeaderBlock_1 = require("./HeaderBlock.cjs");
14
+ Object.defineProperty(exports, "HeaderBlock", { enumerable: true, get: function () { return HeaderBlock_1.HeaderBlock; } });
15
+ var KpiOverviewBlock_1 = require("./KpiOverviewBlock.cjs");
16
+ Object.defineProperty(exports, "KpiOverviewBlock", { enumerable: true, get: function () { return KpiOverviewBlock_1.KpiOverviewBlock; } });
17
+ var LoginBlock_1 = require("./LoginBlock.cjs");
18
+ Object.defineProperty(exports, "LoginBlock", { enumerable: true, get: function () { return LoginBlock_1.LoginBlock; } });
19
+ var NotificationsBlock_1 = require("./NotificationsBlock.cjs");
20
+ Object.defineProperty(exports, "NotificationsBlock", { enumerable: true, get: function () { return NotificationsBlock_1.NotificationsBlock; } });
21
+ var PricingPlansBlock_1 = require("./PricingPlansBlock.cjs");
22
+ Object.defineProperty(exports, "PricingPlansBlock", { enumerable: true, get: function () { return PricingPlansBlock_1.PricingPlansBlock; } });
23
+ var ProductCollectionBlock_1 = require("./ProductCollectionBlock.cjs");
24
+ Object.defineProperty(exports, "ProductCollectionBlock", { enumerable: true, get: function () { return ProductCollectionBlock_1.ProductCollectionBlock; } });
25
+ var ProductDetailBlock_1 = require("./ProductDetailBlock.cjs");
26
+ Object.defineProperty(exports, "ProductDetailBlock", { enumerable: true, get: function () { return ProductDetailBlock_1.ProductDetailBlock; } });
27
+ var ProductHeroBlock_1 = require("./ProductHeroBlock.cjs");
28
+ Object.defineProperty(exports, "ProductHeroBlock", { enumerable: true, get: function () { return ProductHeroBlock_1.ProductHeroBlock; } });
29
+ var ProfileSettingsBlock_1 = require("./ProfileSettingsBlock.cjs");
30
+ Object.defineProperty(exports, "defaultProfileTimeZones", { enumerable: true, get: function () { return ProfileSettingsBlock_1.defaultProfileTimeZones; } });
31
+ Object.defineProperty(exports, "ProfileSettingsBlock", { enumerable: true, get: function () { return ProfileSettingsBlock_1.ProfileSettingsBlock; } });
32
+ var QuickSendBlock_1 = require("./QuickSendBlock.cjs");
33
+ Object.defineProperty(exports, "QuickSendBlock", { enumerable: true, get: function () { return QuickSendBlock_1.QuickSendBlock; } });
34
+ var RecentTransactionsBlock_1 = require("./RecentTransactionsBlock.cjs");
35
+ Object.defineProperty(exports, "RecentTransactionsBlock", { enumerable: true, get: function () { return RecentTransactionsBlock_1.RecentTransactionsBlock; } });
36
+ var SearchableTableBlock_1 = require("./SearchableTableBlock.cjs");
37
+ Object.defineProperty(exports, "SearchableTableBlock", { enumerable: true, get: function () { return SearchableTableBlock_1.SearchableTableBlock; } });
38
+ var ShoppingCartBlock_1 = require("./ShoppingCartBlock.cjs");
39
+ Object.defineProperty(exports, "ShoppingCartBlock", { enumerable: true, get: function () { return ShoppingCartBlock_1.ShoppingCartBlock; } });
40
+ var SiteFooterBlock_1 = require("./SiteFooterBlock.cjs");
41
+ Object.defineProperty(exports, "SiteFooterBlock", { enumerable: true, get: function () { return SiteFooterBlock_1.SiteFooterBlock; } });
42
+ var TableBlock_1 = require("./TableBlock.cjs");
43
+ Object.defineProperty(exports, "TableBlock", { enumerable: true, get: function () { return TableBlock_1.TableBlock; } });
44
+ var TaskListBlock_1 = require("./TaskListBlock.cjs");
45
+ Object.defineProperty(exports, "TaskListBlock", { enumerable: true, get: function () { return TaskListBlock_1.TaskListBlock; } });
46
+ var ApplicationShellBlock_1 = require("./ApplicationShellBlock.cjs");
47
+ Object.defineProperty(exports, "ApplicationShellBlock", { enumerable: true, get: function () { return ApplicationShellBlock_1.ApplicationShellBlock; } });
48
+ var PageHeaderBlock_1 = require("./PageHeaderBlock.cjs");
49
+ Object.defineProperty(exports, "PageHeaderBlock", { enumerable: true, get: function () { return PageHeaderBlock_1.PageHeaderBlock; } });
50
+ var WorkspaceSwitcherBlock_1 = require("./WorkspaceSwitcherBlock.cjs");
51
+ Object.defineProperty(exports, "WorkspaceSwitcherBlock", { enumerable: true, get: function () { return WorkspaceSwitcherBlock_1.WorkspaceSwitcherBlock; } });
52
+ var CommandPaletteBlock_1 = require("./CommandPaletteBlock.cjs");
53
+ Object.defineProperty(exports, "CommandPaletteBlock", { enumerable: true, get: function () { return CommandPaletteBlock_1.CommandPaletteBlock; } });
@@ -0,0 +1,24 @@
1
+ export { CheckoutReviewBlock } from "./CheckoutReviewBlock.js";
2
+ export { defaultCreateAccountPasswordRules, CreateAccountBlock } from "./CreateAccountBlock.js";
3
+ export { EmptyStateBlock } from "./EmptyStateBlock.js";
4
+ export { FeatureOverviewBlock } from "./FeatureOverviewBlock.js";
5
+ export { HeaderBlock } from "./HeaderBlock.js";
6
+ export { KpiOverviewBlock } from "./KpiOverviewBlock.js";
7
+ export { LoginBlock } from "./LoginBlock.js";
8
+ export { NotificationsBlock } from "./NotificationsBlock.js";
9
+ export { PricingPlansBlock } from "./PricingPlansBlock.js";
10
+ export { ProductCollectionBlock } from "./ProductCollectionBlock.js";
11
+ export { ProductDetailBlock } from "./ProductDetailBlock.js";
12
+ export { ProductHeroBlock } from "./ProductHeroBlock.js";
13
+ export { defaultProfileTimeZones, ProfileSettingsBlock } from "./ProfileSettingsBlock.js";
14
+ export { QuickSendBlock } from "./QuickSendBlock.js";
15
+ export { RecentTransactionsBlock } from "./RecentTransactionsBlock.js";
16
+ export { SearchableTableBlock } from "./SearchableTableBlock.js";
17
+ export { ShoppingCartBlock } from "./ShoppingCartBlock.js";
18
+ export { SiteFooterBlock } from "./SiteFooterBlock.js";
19
+ export { TableBlock } from "./TableBlock.js";
20
+ export { TaskListBlock } from "./TaskListBlock.js";
21
+ export { ApplicationShellBlock } from "./ApplicationShellBlock.js";
22
+ export { PageHeaderBlock } from "./PageHeaderBlock.js";
23
+ export { WorkspaceSwitcherBlock } from "./WorkspaceSwitcherBlock.js";
24
+ export { CommandPaletteBlock } from "./CommandPaletteBlock.js";