@epilot/spark-ui 0.20.2 → 0.20.3

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 (262) hide show
  1. package/dist/components/accordion.cjs +5 -5
  2. package/dist/components/accordion.cjs.map +1 -1
  3. package/dist/components/alert-dialog.cjs +9 -9
  4. package/dist/components/alert-dialog.cjs.map +1 -1
  5. package/dist/components/attachment.cjs +10 -10
  6. package/dist/components/attachment.cjs.map +1 -1
  7. package/dist/components/autocomplete.cjs +12 -12
  8. package/dist/components/autocomplete.cjs.map +1 -1
  9. package/dist/components/avatar.cjs +2 -2
  10. package/dist/components/avatar.cjs.map +1 -1
  11. package/dist/components/avatar.js +1 -1
  12. package/dist/components/badge.cjs +2 -2
  13. package/dist/components/badge.cjs.map +1 -1
  14. package/dist/components/badge.js +2 -2
  15. package/dist/components/badge.js.map +1 -1
  16. package/dist/components/bar-chart.cjs +4 -4
  17. package/dist/components/bar-chart.cjs.map +1 -1
  18. package/dist/components/bar-chart.js +2 -2
  19. package/dist/components/bar-chart.js.map +1 -1
  20. package/dist/components/box.cjs +2 -2
  21. package/dist/components/box.cjs.map +1 -1
  22. package/dist/components/box.js +1 -1
  23. package/dist/components/breadcrumbs.cjs +7 -7
  24. package/dist/components/breadcrumbs.cjs.map +1 -1
  25. package/dist/components/bubble.cjs +5 -5
  26. package/dist/components/bubble.cjs.map +1 -1
  27. package/dist/components/bubble.d.cts +1 -1
  28. package/dist/components/bubble.d.ts +1 -1
  29. package/dist/components/button-group.cjs +5 -5
  30. package/dist/components/button-group.cjs.map +1 -1
  31. package/dist/components/button-group.js +1 -1
  32. package/dist/components/button.cjs +2 -2
  33. package/dist/components/button.cjs.map +1 -1
  34. package/dist/components/button.d.cts +2 -2
  35. package/dist/components/button.d.ts +2 -2
  36. package/dist/components/button.js +1 -1
  37. package/dist/components/button.js.map +1 -1
  38. package/dist/components/calendar.cjs +10 -11
  39. package/dist/components/calendar.cjs.map +1 -1
  40. package/dist/components/calendar.js +3 -4
  41. package/dist/components/calendar.js.map +1 -1
  42. package/dist/components/callout.cjs +7 -7
  43. package/dist/components/callout.cjs.map +1 -1
  44. package/dist/components/callout.d.cts +1 -1
  45. package/dist/components/callout.d.ts +1 -1
  46. package/dist/components/card.cjs +16 -16
  47. package/dist/components/card.cjs.map +1 -1
  48. package/dist/components/card.js +2 -2
  49. package/dist/components/card.js.map +1 -1
  50. package/dist/components/chart.cjs +2 -2
  51. package/dist/components/chart.cjs.map +1 -1
  52. package/dist/components/checkbox.cjs +2 -2
  53. package/dist/components/checkbox.cjs.map +1 -1
  54. package/dist/components/checkbox.js +1 -1
  55. package/dist/components/checkbox.js.map +1 -1
  56. package/dist/components/circular-gauge.cjs +3 -3
  57. package/dist/components/circular-gauge.cjs.map +1 -1
  58. package/dist/components/circular-gauge.js +1 -1
  59. package/dist/components/circular-gauge.js.map +1 -1
  60. package/dist/components/day-of-week-picker.cjs +4 -4
  61. package/dist/components/day-of-week-picker.cjs.map +1 -1
  62. package/dist/components/dialog.cjs +8 -8
  63. package/dist/components/dialog.cjs.map +1 -1
  64. package/dist/components/donut-chart.cjs.map +1 -1
  65. package/dist/components/donut-chart.js.map +1 -1
  66. package/dist/components/drawer.cjs +8 -8
  67. package/dist/components/drawer.cjs.map +1 -1
  68. package/dist/components/drawer.js +2 -2
  69. package/dist/components/drawer.js.map +1 -1
  70. package/dist/components/dropdown-menu.cjs +10 -10
  71. package/dist/components/dropdown-menu.cjs.map +1 -1
  72. package/dist/components/energy-breakdown.cjs +1 -1
  73. package/dist/components/energy-breakdown.cjs.map +1 -1
  74. package/dist/components/energy-breakdown.js +1 -1
  75. package/dist/components/energy-breakdown.js.map +1 -1
  76. package/dist/components/entity-card.cjs +11 -11
  77. package/dist/components/entity-card.cjs.map +1 -1
  78. package/dist/components/field.cjs +16 -16
  79. package/dist/components/field.cjs.map +1 -1
  80. package/dist/components/field.js +1 -1
  81. package/dist/components/field.js.map +1 -1
  82. package/dist/components/hero-metric.cjs +4 -4
  83. package/dist/components/hero-metric.cjs.map +1 -1
  84. package/dist/components/icon.cjs +6 -6
  85. package/dist/components/icon.cjs.map +1 -1
  86. package/dist/components/icon.js +5 -5
  87. package/dist/components/icon.js.map +1 -1
  88. package/dist/components/info-block.cjs +9 -9
  89. package/dist/components/info-block.cjs.map +1 -1
  90. package/dist/components/input-date.cjs +3 -4
  91. package/dist/components/input-date.cjs.map +1 -1
  92. package/dist/components/input-date.d.cts +1 -3
  93. package/dist/components/input-date.d.ts +1 -3
  94. package/dist/components/input-date.js +1 -2
  95. package/dist/components/input-date.js.map +1 -1
  96. package/dist/components/input-group.cjs +5 -5
  97. package/dist/components/input-group.cjs.map +1 -1
  98. package/dist/components/input-otp.cjs +2 -2
  99. package/dist/components/input-otp.cjs.map +1 -1
  100. package/dist/components/input.cjs +2 -2
  101. package/dist/components/input.cjs.map +1 -1
  102. package/dist/components/label.cjs +2 -2
  103. package/dist/components/label.cjs.map +1 -1
  104. package/dist/components/layout.cjs +2 -2
  105. package/dist/components/layout.cjs.map +1 -1
  106. package/dist/components/line-chart.cjs +7 -7
  107. package/dist/components/line-chart.cjs.map +1 -1
  108. package/dist/components/line-chart.js +5 -5
  109. package/dist/components/line-chart.js.map +1 -1
  110. package/dist/components/list.cjs +11 -11
  111. package/dist/components/list.cjs.map +1 -1
  112. package/dist/components/list.d.cts +2 -7
  113. package/dist/components/list.d.ts +2 -7
  114. package/dist/components/list.js +2 -2
  115. package/dist/components/list.js.map +1 -1
  116. package/dist/components/marker.cjs +4 -4
  117. package/dist/components/marker.cjs.map +1 -1
  118. package/dist/components/marker.d.cts +1 -1
  119. package/dist/components/marker.d.ts +1 -1
  120. package/dist/components/message-scroller.cjs +6 -6
  121. package/dist/components/message-scroller.cjs.map +1 -1
  122. package/dist/components/message-scroller.js +2 -2
  123. package/dist/components/message-scroller.js.map +1 -1
  124. package/dist/components/message.cjs +7 -7
  125. package/dist/components/message.cjs.map +1 -1
  126. package/dist/components/page-header.cjs +5 -5
  127. package/dist/components/page-header.cjs.map +1 -1
  128. package/dist/components/period-tabs.cjs +6 -6
  129. package/dist/components/period-tabs.cjs.map +1 -1
  130. package/dist/components/pill.cjs +3 -3
  131. package/dist/components/pill.cjs.map +1 -1
  132. package/dist/components/pill.js +3 -3
  133. package/dist/components/pill.js.map +1 -1
  134. package/dist/components/popover.cjs +2 -2
  135. package/dist/components/popover.cjs.map +1 -1
  136. package/dist/components/power-history-chart.cjs +4 -4
  137. package/dist/components/power-history-chart.cjs.map +1 -1
  138. package/dist/components/power-history-chart.js +3 -3
  139. package/dist/components/power-history-chart.js.map +1 -1
  140. package/dist/components/power-network.cjs +9 -9
  141. package/dist/components/power-network.cjs.map +1 -1
  142. package/dist/components/power-network.js +1 -1
  143. package/dist/components/progress.cjs +3 -3
  144. package/dist/components/progress.cjs.map +1 -1
  145. package/dist/components/progress.js +1 -1
  146. package/dist/components/progress.js.map +1 -1
  147. package/dist/components/radio-card-group.cjs +3 -3
  148. package/dist/components/radio-card-group.cjs.map +1 -1
  149. package/dist/components/radio.cjs +3 -3
  150. package/dist/components/radio.cjs.map +1 -1
  151. package/dist/components/radio.js +1 -1
  152. package/dist/components/sankey-chart.cjs +4 -4
  153. package/dist/components/sankey-chart.cjs.map +1 -1
  154. package/dist/components/sankey-chart.js +2 -2
  155. package/dist/components/sankey-chart.js.map +1 -1
  156. package/dist/components/schedule-editor.cjs +9 -9
  157. package/dist/components/schedule-editor.cjs.map +1 -1
  158. package/dist/components/schedule-list.cjs +10 -10
  159. package/dist/components/schedule-list.cjs.map +1 -1
  160. package/dist/components/scroll-area.cjs +3 -3
  161. package/dist/components/scroll-area.cjs.map +1 -1
  162. package/dist/components/segmented-control.cjs +8 -8
  163. package/dist/components/segmented-control.cjs.map +1 -1
  164. package/dist/components/segmented-control.d.cts +16 -2
  165. package/dist/components/segmented-control.d.ts +16 -2
  166. package/dist/components/segmented-control.js +5 -5
  167. package/dist/components/segmented-control.js.map +1 -1
  168. package/dist/components/select.cjs +11 -11
  169. package/dist/components/select.cjs.map +1 -1
  170. package/dist/components/separator.cjs +3 -3
  171. package/dist/components/separator.cjs.map +1 -1
  172. package/dist/components/series-legend.cjs +4 -4
  173. package/dist/components/series-legend.cjs.map +1 -1
  174. package/dist/components/sheet.cjs +8 -8
  175. package/dist/components/sheet.cjs.map +1 -1
  176. package/dist/components/skeleton.cjs +3 -3
  177. package/dist/components/skeleton.cjs.map +1 -1
  178. package/dist/components/slider.cjs +11 -11
  179. package/dist/components/slider.cjs.map +1 -1
  180. package/dist/components/slider.js.map +1 -1
  181. package/dist/components/solar-forecast-chart.cjs +2 -2
  182. package/dist/components/solar-forecast-chart.cjs.map +1 -1
  183. package/dist/components/solar-forecast-chart.js +1 -1
  184. package/dist/components/sortable-list.cjs +3 -3
  185. package/dist/components/sortable-list.cjs.map +1 -1
  186. package/dist/components/spinner.cjs +2 -2
  187. package/dist/components/spinner.cjs.map +1 -1
  188. package/dist/components/stat-card.cjs +8 -8
  189. package/dist/components/stat-card.cjs.map +1 -1
  190. package/dist/components/stepper.cjs +2 -2
  191. package/dist/components/stepper.cjs.map +1 -1
  192. package/dist/components/switch.cjs +3 -3
  193. package/dist/components/switch.cjs.map +1 -1
  194. package/dist/components/switch.js +2 -2
  195. package/dist/components/switch.js.map +1 -1
  196. package/dist/components/table.cjs +8 -8
  197. package/dist/components/table.cjs.map +1 -1
  198. package/dist/components/tabs.cjs +9 -9
  199. package/dist/components/tabs.cjs.map +1 -1
  200. package/dist/components/tabs.d.cts +8 -1
  201. package/dist/components/tabs.d.ts +8 -1
  202. package/dist/components/tabs.js +2 -2
  203. package/dist/components/tabs.js.map +1 -1
  204. package/dist/components/textarea.cjs +2 -2
  205. package/dist/components/textarea.cjs.map +1 -1
  206. package/dist/components/theme.cjs +2 -2
  207. package/dist/components/theme.cjs.map +1 -1
  208. package/dist/components/theme.js +1 -1
  209. package/dist/components/thumbnail.cjs +3 -3
  210. package/dist/components/thumbnail.cjs.map +1 -1
  211. package/dist/components/time-picker.cjs +3 -3
  212. package/dist/components/time-picker.cjs.map +1 -1
  213. package/dist/components/toast.cjs +14 -39
  214. package/dist/components/toast.cjs.map +1 -1
  215. package/dist/components/toast.d.cts +2 -15
  216. package/dist/components/toast.d.ts +2 -15
  217. package/dist/components/toast.js +7 -32
  218. package/dist/components/toast.js.map +1 -1
  219. package/dist/components/tooltip.cjs +3 -3
  220. package/dist/components/tooltip.cjs.map +1 -1
  221. package/dist/components/tooltip.js +1 -1
  222. package/dist/components/tooltip.js.map +1 -1
  223. package/dist/components/typography.cjs +6 -6
  224. package/dist/components/typography.cjs.map +1 -1
  225. package/dist/components/wizard-layout.cjs +8 -8
  226. package/dist/components/wizard-layout.cjs.map +1 -1
  227. package/dist/lib/generate-radix-colors.cjs +1 -1
  228. package/dist/lib/generate-radix-colors.cjs.map +1 -1
  229. package/dist/lib/generate-radix-colors.js +1 -1
  230. package/dist/lib/generate-radix-colors.js.map +1 -1
  231. package/dist/lib/input-box-variants.cjs +9 -9
  232. package/dist/lib/input-box-variants.cjs.map +1 -1
  233. package/dist/styles/spark-default.css +0 -11
  234. package/dist/utils/cn.cjs +2 -2
  235. package/dist/utils/cn.d.cts +1 -1
  236. package/dist/utils/cn.d.ts +1 -1
  237. package/dist/utils/cn.js +1 -1
  238. package/dist/utils/format.cjs +0 -1
  239. package/dist/utils/format.cjs.map +1 -1
  240. package/dist/utils/format.d.cts +1 -2
  241. package/dist/utils/format.d.ts +1 -2
  242. package/dist/utils/format.js +1 -1
  243. package/dist/utils/format.js.map +1 -1
  244. package/package.json +1 -1
  245. package/dist/components/toggle-group.cjs +0 -40
  246. package/dist/components/toggle-group.cjs.map +0 -1
  247. package/dist/components/toggle-group.d.cts +0 -28
  248. package/dist/components/toggle-group.d.ts +0 -28
  249. package/dist/components/toggle-group.js +0 -37
  250. package/dist/components/toggle-group.js.map +0 -1
  251. package/dist/components/toggle.cjs +0 -69
  252. package/dist/components/toggle.cjs.map +0 -1
  253. package/dist/components/toggle.d.cts +0 -23
  254. package/dist/components/toggle.d.ts +0 -23
  255. package/dist/components/toggle.js +0 -66
  256. package/dist/components/toggle.js.map +0 -1
  257. package/dist/lib/toggle-group-context.cjs +0 -12
  258. package/dist/lib/toggle-group-context.cjs.map +0 -1
  259. package/dist/lib/toggle-group-context.d.cts +0 -17
  260. package/dist/lib/toggle-group-context.d.ts +0 -17
  261. package/dist/lib/toggle-group-context.js +0 -9
  262. package/dist/lib/toggle-group-context.js.map +0 -1
@@ -5,7 +5,7 @@ let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
7
  let class_variance_authority = require("class-variance-authority");
8
- let cn = require("cn");
8
+ let cnfast = require("cnfast");
9
9
  //#region src/components/info-block.tsx
10
10
  const infoBlockVariants = (0, class_variance_authority.cva)("flex items-center gap-3", {
11
11
  variants: { variant: {
@@ -15,49 +15,49 @@ const infoBlockVariants = (0, class_variance_authority.cva)("flex items-center g
15
15
  defaultVariants: { variant: "default" }
16
16
  });
17
17
  const InfoBlock = react.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18
- className: (0, cn.cn)(infoBlockVariants({ variant }), className),
18
+ className: (0, cnfast.cn)(infoBlockVariants({ variant }), className),
19
19
  ref,
20
20
  ...props
21
21
  }));
22
22
  InfoBlock.displayName = "InfoBlock";
23
23
  const InfoBlockIcon = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
24
- className: (0, cn.cn)("flex size-10 shrink-0 items-center justify-center rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))]", className),
24
+ className: (0, cnfast.cn)("flex size-10 shrink-0 items-center justify-center rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))]", className),
25
25
  ref,
26
26
  ...props
27
27
  }));
28
28
  InfoBlockIcon.displayName = "InfoBlockIcon";
29
29
  const InfoBlockContent = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
30
- className: (0, cn.cn)("flex min-w-0 flex-1 flex-col gap-2", className),
30
+ className: (0, cnfast.cn)("flex min-w-0 flex-1 flex-col gap-2", className),
31
31
  ref,
32
32
  ...props
33
33
  }));
34
34
  InfoBlockContent.displayName = "InfoBlockContent";
35
35
  const InfoBlockHeader = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
36
- className: (0, cn.cn)("flex items-center justify-between gap-2", className),
36
+ className: (0, cnfast.cn)("flex items-center justify-between gap-2", className),
37
37
  ref,
38
38
  ...props
39
39
  }));
40
40
  InfoBlockHeader.displayName = "InfoBlockHeader";
41
41
  const InfoBlockTitle = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
42
- className: (0, cn.cn)("text-sm font-medium text-gray", className),
42
+ className: (0, cnfast.cn)("text-sm font-medium text-gray", className),
43
43
  ref,
44
44
  ...props
45
45
  }));
46
46
  InfoBlockTitle.displayName = "InfoBlockTitle";
47
47
  const InfoBlockLabel = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
48
- className: (0, cn.cn)("text-xs font-medium text-gray-light", className),
48
+ className: (0, cnfast.cn)("text-xs font-medium text-gray-light", className),
49
49
  ref,
50
50
  ...props
51
51
  }));
52
52
  InfoBlockLabel.displayName = "InfoBlockLabel";
53
53
  const InfoBlockDescription = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
54
- className: (0, cn.cn)("text-xs text-gray-light", className),
54
+ className: (0, cnfast.cn)("text-xs text-gray-light", className),
55
55
  ref,
56
56
  ...props
57
57
  }));
58
58
  InfoBlockDescription.displayName = "InfoBlockDescription";
59
59
  const InfoBlockValue = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
60
- className: (0, cn.cn)("text-lg font-bold text-gray tabular-nums", className),
60
+ className: (0, cnfast.cn)("text-lg font-bold text-gray tabular-nums", className),
61
61
  ref,
62
62
  ...props
63
63
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"info-block.cjs","names":["React"],"sources":["../../src/components/info-block.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\nconst infoBlockVariants = cva('flex items-center gap-3', {\n variants: {\n variant: {\n default: 'rounded-lg border border-gray p-4',\n bare: 'rounded-none border-none',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n})\n\nconst InfoBlock = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof infoBlockVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n className={cn(infoBlockVariants({ variant }), className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlock.displayName = 'InfoBlock'\n\nconst InfoBlockIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n // max() pill escape (matches Icon): a tile stays rounded-md at low Roundness but\n // becomes a circle at large/full, same as it did pre-harmonization via clamping.\n 'flex size-10 shrink-0 items-center justify-center rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))]',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockIcon.displayName = 'InfoBlockIcon'\n\nconst InfoBlockContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex min-w-0 flex-1 flex-col gap-2', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockContent.displayName = 'InfoBlockContent'\n\nconst InfoBlockHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockHeader.displayName = 'InfoBlockHeader'\n\nconst InfoBlockTitle = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-sm font-medium text-gray', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockTitle.displayName = 'InfoBlockTitle'\n\nconst InfoBlockLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-xs font-medium text-gray-light', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockLabel.displayName = 'InfoBlockLabel'\n\nconst InfoBlockDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-xs text-gray-light', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockDescription.displayName = 'InfoBlockDescription'\n\nconst InfoBlockValue = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-lg font-bold text-gray tabular-nums', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockValue.displayName = 'InfoBlockValue'\n\nexport {\n InfoBlock,\n InfoBlockContent,\n InfoBlockDescription,\n InfoBlockHeader,\n InfoBlockIcon,\n InfoBlockLabel,\n InfoBlockTitle,\n InfoBlockValue,\n}\n"],"mappings":";;;;;;;;;AAIA,MAAM,qBAAA,GAAA,yBAAA,KAAwB,2BAA2B;CACvD,UAAU,EACR,SAAS;EACP,SAAS;EACT,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AAED,MAAM,YAAYA,MAAM,YAGrB,EAAE,WAAW,SAAS,GAAG,SAAS,QACnC,iBAAA,GAAA,kBAAA,KAAC,OAAD;CACE,YAAA,GAAA,GAAA,IAAc,kBAAkB,EAAE,QAAQ,CAAC,GAA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AAiBA,MAAM,YAG1B,EAAE,WAAW,GAAG,SAAS,QAC1B,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,YAAA,GAAA,GAAA,IAAc,4CAA4C,SAAS;CAC9D;CACL,GAAI;AACL,CAAA,CACF;AAED,eAAe,cAAc"}
1
+ {"version":3,"file":"info-block.cjs","names":["React"],"sources":["../../src/components/info-block.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\n\nconst infoBlockVariants = cva('flex items-center gap-3', {\n variants: {\n variant: {\n default: 'rounded-lg border border-gray p-4',\n bare: 'rounded-none border-none',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n})\n\nconst InfoBlock = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof infoBlockVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n className={cn(infoBlockVariants({ variant }), className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlock.displayName = 'InfoBlock'\n\nconst InfoBlockIcon = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn(\n // max() pill escape (matches Icon): a tile stays rounded-md at low Roundness but\n // becomes a circle at large/full, same as it did pre-harmonization via clamping.\n 'flex size-10 shrink-0 items-center justify-center rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))]',\n className,\n )}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockIcon.displayName = 'InfoBlockIcon'\n\nconst InfoBlockContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex min-w-0 flex-1 flex-col gap-2', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockContent.displayName = 'InfoBlockContent'\n\nconst InfoBlockHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockHeader.displayName = 'InfoBlockHeader'\n\nconst InfoBlockTitle = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-sm font-medium text-gray', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockTitle.displayName = 'InfoBlockTitle'\n\nconst InfoBlockLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-xs font-medium text-gray-light', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockLabel.displayName = 'InfoBlockLabel'\n\nconst InfoBlockDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-xs text-gray-light', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockDescription.displayName = 'InfoBlockDescription'\n\nconst InfoBlockValue = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n className={cn('text-lg font-bold text-gray tabular-nums', className)}\n ref={ref}\n {...props}\n />\n))\n\nInfoBlockValue.displayName = 'InfoBlockValue'\n\nexport {\n InfoBlock,\n InfoBlockContent,\n InfoBlockDescription,\n InfoBlockHeader,\n InfoBlockIcon,\n InfoBlockLabel,\n InfoBlockTitle,\n InfoBlockValue,\n}\n"],"mappings":";;;;;;;;;AAIA,MAAM,qBAAA,GAAA,yBAAA,KAAwB,2BAA2B;CACvD,UAAU,EACR,SAAS;EACP,SAAS;EACT,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AAED,MAAM,YAAYA,MAAM,YAGrB,EAAE,WAAW,SAAS,GAAG,SAAS,QACnC,iBAAA,GAAA,kBAAA,KAAC,OAAD;C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L,GAAI;AACL,CAAA,CACF;AAED,qBAAqB,cAAc;AAEnC,MAAM,iBAAiBA,MAAM,YAG1B,EAAE,WAAW,GAAG,SAAS,QAC1B,iBAAA,GAAA,kBAAA,KAAC,QAAD;CACE,YAAA,GAAA,OAAA,IAAc,4CAA4C,SAAS;CAC9D;CACL,GAAI;AACL,CAAA,CACF;AAED,eAAe,cAAc"}
@@ -11,7 +11,7 @@ react = require_chunk.__toESM(react);
11
11
  let _epilot_spark_icons = require("@epilot/spark-icons");
12
12
  let react_jsx_runtime = require("react/jsx-runtime");
13
13
  let ictus = require("ictus");
14
- let cn = require("cn");
14
+ let cnfast = require("cnfast");
15
15
  //#region src/components/input-date.tsx
16
16
  function useControllableState({ defaultProp, onChange, prop }) {
17
17
  const [uncontrolled, setUncontrolled] = react.useState(defaultProp);
@@ -21,7 +21,7 @@ function useControllableState({ defaultProp, onChange, prop }) {
21
21
  onChange?.(next);
22
22
  }, [isControlled, onChange])];
23
23
  }
24
- const InputDate = react.forwardRef(function InputDate({ calendarLabel, calendarProps, className, container, defaultOpen = false, defaultValue = "", disabled, id, onDateChange, onKeyDown, onOpenChange, onValueChange, open: openProp, pickerOnly = false, placeholder, separator = ".", value: valueProp, ...props }, ref) {
24
+ const InputDate = react.forwardRef(function InputDate({ calendarLabel, calendarProps, className, defaultOpen = false, defaultValue = "", disabled, id, onDateChange, onKeyDown, onOpenChange, onValueChange, open: openProp, pickerOnly = false, placeholder, separator = ".", value: valueProp, ...props }, ref) {
25
25
  const inputRef = react.useRef(null);
26
26
  const [text, setText] = useControllableState({
27
27
  defaultProp: defaultValue,
@@ -65,7 +65,7 @@ const InputDate = react.forwardRef(function InputDate({ calendarLabel, calendarP
65
65
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_input_group.InputGroupInput, {
66
66
  autoComplete: "off",
67
67
  ...props,
68
- className: (0, cn.cn)(pickerOnly && "cursor-pointer"),
68
+ className: (0, cnfast.cn)(pickerOnly && "cursor-pointer"),
69
69
  disabled,
70
70
  id,
71
71
  inputMode: pickerOnly ? void 0 : "numeric",
@@ -118,7 +118,6 @@ const InputDate = react.forwardRef(function InputDate({ calendarLabel, calendarP
118
118
  align: "start",
119
119
  "aria-label": calendarLabel,
120
120
  className: "w-auto p-0",
121
- container,
122
121
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_calendar.Calendar, {
123
122
  ...calendarProps,
124
123
  mode: "single",
@@ -1 +1 @@
1
- {"version":3,"file":"input-date.cjs","names":["React","Popover","PopoverAnchor","InputGroup","InputGroupInput","InputGroupAddon","PopoverTrigger","Button","CalendarMonth","PopoverContent","Calendar"],"sources":["../../src/components/input-date.tsx"],"sourcesContent":["'use client'\n\nimport { CalendarMonth } from '@epilot/spark-icons'\nimport { apply, formatDate, isDateMaskKey, parseDate } from 'ictus'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\nimport { Calendar, type CalendarProps } from './calendar'\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group'\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './popover'\n\nfunction useControllableState<T>({\n defaultProp,\n onChange,\n prop,\n}: {\n defaultProp: T\n onChange?: (value: T) => void\n prop?: T\n}) {\n const [uncontrolled, setUncontrolled] = React.useState(defaultProp)\n const isControlled = prop !== undefined\n const value = isControlled ? prop : uncontrolled\n\n const setValue = React.useCallback(\n (next: T) => {\n if (!isControlled) setUncontrolled(next)\n onChange?.(next)\n },\n [isControlled, onChange],\n )\n\n return [value, setValue] as const\n}\n\nexport type InputDateProps = Omit<\n React.ComponentProps<'input'>,\n 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'\n> & {\n calendarLabel: string\n calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>\n /** Element the calendar popup mounts into, e.g. the drawer it sits in. */\n container?: React.ComponentProps<typeof PopoverContent>['container']\n defaultOpen?: boolean\n defaultValue?: string\n onDateChange?: (date: Date | undefined) => void\n onOpenChange?: (open: boolean) => void\n onValueChange?: (value: string) => void\n open?: boolean\n pickerOnly?: boolean\n separator?: string\n value?: string\n}\n\nconst InputDate = React.forwardRef<HTMLInputElement, InputDateProps>(\n function InputDate(\n {\n calendarLabel,\n calendarProps,\n className,\n container,\n defaultOpen = false,\n defaultValue = '',\n disabled,\n id,\n onDateChange,\n onKeyDown,\n onOpenChange,\n onValueChange,\n open: openProp,\n pickerOnly = false,\n placeholder,\n separator = '.',\n value: valueProp,\n ...props\n },\n ref,\n ) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n const [text, setText] = useControllableState({\n defaultProp: defaultValue,\n onChange: onValueChange,\n prop: valueProp,\n })\n const [open, setOpenState] = useControllableState({\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n prop: openProp,\n })\n const selected = parseDate(text)\n const [month, setMonth] = React.useState<Date | undefined>(\n () => selected ?? calendarProps?.month,\n )\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (next && calendarProps?.month === undefined) {\n setMonth(parseDate(text) ?? new Date())\n }\n setOpenState(next)\n },\n [calendarProps?.month, setOpenState, text],\n )\n\n const commit = React.useCallback(\n (next: string) => {\n if (next === text) return\n setText(next)\n onDateChange?.(parseDate(next))\n },\n [onDateChange, setText, text],\n )\n\n const setInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n return (\n <Popover onOpenChange={setOpen} open={open}>\n <PopoverAnchor render={<InputGroup className={className} />}>\n <InputGroupInput\n autoComplete=\"off\"\n {...props}\n className={cn(pickerOnly && 'cursor-pointer')}\n disabled={disabled}\n id={id}\n inputMode={pickerOnly ? undefined : 'numeric'}\n onChange={() => {}}\n onClick={\n pickerOnly && !disabled\n ? (event) => {\n props.onClick?.(event)\n if (!event.defaultPrevented) setOpen(true)\n }\n : props.onClick\n }\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setOpen(true)\n return\n }\n if (pickerOnly || !isDateMaskKey(event.key)) return\n event.preventDefault()\n const next = apply({\n caret: event.currentTarget.selectionStart ?? 0,\n key: event.key,\n selectionEnd: event.currentTarget.selectionEnd ?? undefined,\n separator,\n value: event.currentTarget.value,\n })\n commit(next.value)\n const caret = next.caret\n const input = inputRef.current\n requestAnimationFrame(() => {\n input?.setSelectionRange(caret, caret)\n })\n }}\n placeholder={placeholder ?? `DD${separator}MM${separator}YYYY`}\n readOnly={pickerOnly}\n ref={setInputRef}\n spellCheck={false}\n value={text}\n />\n <InputGroupAddon align=\"inline-end\">\n <PopoverTrigger\n render={\n <Button\n aria-label={calendarLabel}\n color=\"neutral\"\n disabled={disabled}\n size=\"icon-small\"\n styleVariant=\"ghost\"\n >\n <CalendarMonth />\n </Button>\n }\n />\n </InputGroupAddon>\n </PopoverAnchor>\n <PopoverContent\n align=\"start\"\n aria-label={calendarLabel}\n className=\"w-auto p-0\"\n container={container}\n >\n <Calendar\n {...calendarProps}\n mode=\"single\"\n month={calendarProps?.month ?? month}\n onMonthChange={(next) => {\n calendarProps?.onMonthChange?.(next)\n if (calendarProps?.month === undefined) setMonth(next)\n }}\n onSelect={(next) => {\n commit(next ? formatDate(next, separator) : '')\n setOpen(false)\n }}\n selected={selected}\n />\n </PopoverContent>\n </Popover>\n )\n },\n)\n\nexport { InputDate }\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAAS,qBAAwB,EAC/B,aACA,UACA,QAKC;CACD,MAAM,CAAC,cAAc,mBAAmBA,MAAM,SAAS,WAAW;CAClE,MAAM,eAAe,SAAS,KAAA;CAW9B,OAAO,CAVO,eAAe,OAAO,cAEnBA,MAAM,aACpB,SAAY;EACX,IAAI,CAAC,cAAc,gBAAgB,IAAI;EACvC,WAAW,IAAI;CACjB,GACA,CAAC,cAAc,QAAQ,CAGH,CAAC;AACzB;AAqBA,MAAM,YAAYA,M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C,2BAAAA,gBAAD;GACE,OAAM;GACN,cAAY;GACZ,WAAU;GACC;aAEX,iBAAA,GAAA,kBAAA,KAACC,4BAAAA,UAAD;IACE,GAAI;IACJ,MAAK;IACL,OAAO,eAAe,SAAS;IAC/B,gBAAgB,SAAS;KACvB,eAAe,gBAAgB,IAAI;KACnC,IAAI,eAAe,UAAU,KAAA,GAAW,SAAS,IAAI;IACvD;IACA,WAAW,SAAS;KAClB,OAAO,QAAA,GAAA,MAAA,YAAkB,MAAM,SAAS,IAAI,EAAE;KAC9C,QAAQ,KAAK;IACf;IACU;GACX,CAAA;EACa,CAAA,CACT;;AAEb,CACF"}
1
+ {"version":3,"file":"input-date.cjs","names":["React","Popover","PopoverAnchor","InputGroup","InputGroupInput","InputGroupAddon","PopoverTrigger","Button","CalendarMonth","PopoverContent","Calendar"],"sources":["../../src/components/input-date.tsx"],"sourcesContent":["'use client'\n\nimport { CalendarMonth } from '@epilot/spark-icons'\nimport { apply, formatDate, isDateMaskKey, parseDate } from 'ictus'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\nimport { Calendar, type CalendarProps } from './calendar'\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group'\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './popover'\n\nfunction useControllableState<T>({\n defaultProp,\n onChange,\n prop,\n}: {\n defaultProp: T\n onChange?: (value: T) => void\n prop?: T\n}) {\n const [uncontrolled, setUncontrolled] = React.useState(defaultProp)\n const isControlled = prop !== undefined\n const value = isControlled ? prop : uncontrolled\n\n const setValue = React.useCallback(\n (next: T) => {\n if (!isControlled) setUncontrolled(next)\n onChange?.(next)\n },\n [isControlled, onChange],\n )\n\n return [value, setValue] as const\n}\n\nexport type InputDateProps = Omit<\n React.ComponentProps<'input'>,\n 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'\n> & {\n calendarLabel: string\n calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>\n defaultOpen?: boolean\n defaultValue?: string\n onDateChange?: (date: Date | undefined) => void\n onOpenChange?: (open: boolean) => void\n onValueChange?: (value: string) => void\n open?: boolean\n pickerOnly?: boolean\n separator?: string\n value?: string\n}\n\nconst InputDate = React.forwardRef<HTMLInputElement, InputDateProps>(\n function InputDate(\n {\n calendarLabel,\n calendarProps,\n className,\n defaultOpen = false,\n defaultValue = '',\n disabled,\n id,\n onDateChange,\n onKeyDown,\n onOpenChange,\n onValueChange,\n open: openProp,\n pickerOnly = false,\n placeholder,\n separator = '.',\n value: valueProp,\n ...props\n },\n ref,\n ) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n const [text, setText] = useControllableState({\n defaultProp: defaultValue,\n onChange: onValueChange,\n prop: valueProp,\n })\n const [open, setOpenState] = useControllableState({\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n prop: openProp,\n })\n const selected = parseDate(text)\n const [month, setMonth] = React.useState<Date | undefined>(\n () => selected ?? calendarProps?.month,\n )\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (next && calendarProps?.month === undefined) {\n setMonth(parseDate(text) ?? new Date())\n }\n setOpenState(next)\n },\n [calendarProps?.month, setOpenState, text],\n )\n\n const commit = React.useCallback(\n (next: string) => {\n if (next === text) return\n setText(next)\n onDateChange?.(parseDate(next))\n },\n [onDateChange, setText, text],\n )\n\n const setInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n return (\n <Popover onOpenChange={setOpen} open={open}>\n <PopoverAnchor render={<InputGroup className={className} />}>\n <InputGroupInput\n autoComplete=\"off\"\n {...props}\n className={cn(pickerOnly && 'cursor-pointer')}\n disabled={disabled}\n id={id}\n inputMode={pickerOnly ? undefined : 'numeric'}\n onChange={() => {}}\n onClick={\n pickerOnly && !disabled\n ? (event) => {\n props.onClick?.(event)\n if (!event.defaultPrevented) setOpen(true)\n }\n : props.onClick\n }\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setOpen(true)\n return\n }\n if (pickerOnly || !isDateMaskKey(event.key)) return\n event.preventDefault()\n const next = apply({\n caret: event.currentTarget.selectionStart ?? 0,\n key: event.key,\n selectionEnd: event.currentTarget.selectionEnd ?? undefined,\n separator,\n value: event.currentTarget.value,\n })\n commit(next.value)\n const caret = next.caret\n const input = inputRef.current\n requestAnimationFrame(() => {\n input?.setSelectionRange(caret, caret)\n })\n }}\n placeholder={placeholder ?? `DD${separator}MM${separator}YYYY`}\n readOnly={pickerOnly}\n ref={setInputRef}\n spellCheck={false}\n value={text}\n />\n <InputGroupAddon align=\"inline-end\">\n <PopoverTrigger\n render={\n <Button\n aria-label={calendarLabel}\n color=\"neutral\"\n disabled={disabled}\n size=\"icon-small\"\n styleVariant=\"ghost\"\n >\n <CalendarMonth />\n </Button>\n }\n />\n </InputGroupAddon>\n </PopoverAnchor>\n <PopoverContent\n align=\"start\"\n aria-label={calendarLabel}\n className=\"w-auto p-0\"\n >\n <Calendar\n {...calendarProps}\n mode=\"single\"\n month={calendarProps?.month ?? month}\n onMonthChange={(next) => {\n calendarProps?.onMonthChange?.(next)\n if (calendarProps?.month === undefined) setMonth(next)\n }}\n onSelect={(next) => {\n commit(next ? formatDate(next, separator) : '')\n setOpen(false)\n }}\n selected={selected}\n />\n </PopoverContent>\n </Popover>\n )\n },\n)\n\nexport { InputDate }\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAAS,qBAAwB,EAC/B,aACA,UACA,QAKC;CACD,MAAM,CAAC,cAAc,mBAAmBA,MAAM,SAAS,WAAW;CAClE,MAAM,eAAe,SAAS,KAAA;CAW9B,OAAO,CAVO,eAAe,OAAO,cAEnBA,MAAM,aACpB,SAAY;EACX,IAAI,CAAC,cAAc,gBAAgB,IAAI;EACvC,WAAW,IAAI;CACjB,GACA,CAAC,cAAc,QAAQ,CAGH,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MACf,iBAAA,GAAA,kBAAA,KAACC,2BAAAA,gBAAD;GACE,OAAM;GACN,cAAY;GACZ,WAAU;aAEV,iBAAA,GAAA,kBAAA,KAACC,4BAAAA,UAAD;IACE,GAAI;IACJ,MAAK;IACL,OAAO,eAAe,SAAS;IAC/B,gBAAgB,SAAS;KACvB,eAAe,gBAAgB,IAAI;KACnC,IAAI,eAAe,UAAU,KAAA,GAAW,SAAS,IAAI;IACvD;IACA,WAAW,SAAS;KAClB,OAAO,QAAA,GAAA,MAAA,YAAkB,MAAM,SAAS,IAAI,EAAE;KAC9C,QAAQ,KAAK;IACf;IACU;GACX,CAAA;EACa,CAAA,CACT;;AAEb,CACF"}
@@ -1,14 +1,12 @@
1
1
  "use client";
2
2
 
3
3
  import { CalendarProps } from "./calendar.cjs";
4
- import { PopoverContent } from "./popover.cjs";
5
4
  import * as React$1 from "react";
6
5
 
7
6
  //#region src/components/input-date.d.ts
8
7
  type InputDateProps = Omit<React$1.ComponentProps<'input'>, 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'> & {
9
8
  calendarLabel: string;
10
- calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>; /** Element the calendar popup mounts into, e.g. the drawer it sits in. */
11
- container?: React$1.ComponentProps<typeof PopoverContent>['container'];
9
+ calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>;
12
10
  defaultOpen?: boolean;
13
11
  defaultValue?: string;
14
12
  onDateChange?: (date: Date | undefined) => void;
@@ -1,14 +1,12 @@
1
1
  "use client";
2
2
 
3
3
  import { CalendarProps } from "./calendar.js";
4
- import { PopoverContent } from "./popover.js";
5
4
  import * as React$1 from "react";
6
5
 
7
6
  //#region src/components/input-date.d.ts
8
7
  type InputDateProps = Omit<React$1.ComponentProps<'input'>, 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'> & {
9
8
  calendarLabel: string;
10
- calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>; /** Element the calendar popup mounts into, e.g. the drawer it sits in. */
11
- container?: React$1.ComponentProps<typeof PopoverContent>['container'];
9
+ calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>;
12
10
  defaultOpen?: boolean;
13
11
  defaultValue?: string;
14
12
  onDateChange?: (date: Date | undefined) => void;
@@ -18,7 +18,7 @@ function useControllableState({ defaultProp, onChange, prop }) {
18
18
  onChange?.(next);
19
19
  }, [isControlled, onChange])];
20
20
  }
21
- const InputDate = React$1.forwardRef(function InputDate({ calendarLabel, calendarProps, className, container, defaultOpen = false, defaultValue = "", disabled, id, onDateChange, onKeyDown, onOpenChange, onValueChange, open: openProp, pickerOnly = false, placeholder, separator = ".", value: valueProp, ...props }, ref) {
21
+ const InputDate = React$1.forwardRef(function InputDate({ calendarLabel, calendarProps, className, defaultOpen = false, defaultValue = "", disabled, id, onDateChange, onKeyDown, onOpenChange, onValueChange, open: openProp, pickerOnly = false, placeholder, separator = ".", value: valueProp, ...props }, ref) {
22
22
  const inputRef = React$1.useRef(null);
23
23
  const [text, setText] = useControllableState({
24
24
  defaultProp: defaultValue,
@@ -115,7 +115,6 @@ const InputDate = React$1.forwardRef(function InputDate({ calendarLabel, calenda
115
115
  align: "start",
116
116
  "aria-label": calendarLabel,
117
117
  className: "w-auto p-0",
118
- container,
119
118
  children: /* @__PURE__ */ jsx(Calendar, {
120
119
  ...calendarProps,
121
120
  mode: "single",
@@ -1 +1 @@
1
- {"version":3,"file":"input-date.js","names":["React"],"sources":["../../src/components/input-date.tsx"],"sourcesContent":["'use client'\n\nimport { CalendarMonth } from '@epilot/spark-icons'\nimport { apply, formatDate, isDateMaskKey, parseDate } from 'ictus'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\nimport { Calendar, type CalendarProps } from './calendar'\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group'\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './popover'\n\nfunction useControllableState<T>({\n defaultProp,\n onChange,\n prop,\n}: {\n defaultProp: T\n onChange?: (value: T) => void\n prop?: T\n}) {\n const [uncontrolled, setUncontrolled] = React.useState(defaultProp)\n const isControlled = prop !== undefined\n const value = isControlled ? prop : uncontrolled\n\n const setValue = React.useCallback(\n (next: T) => {\n if (!isControlled) setUncontrolled(next)\n onChange?.(next)\n },\n [isControlled, onChange],\n )\n\n return [value, setValue] as const\n}\n\nexport type InputDateProps = Omit<\n React.ComponentProps<'input'>,\n 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'\n> & {\n calendarLabel: string\n calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>\n /** Element the calendar popup mounts into, e.g. the drawer it sits in. */\n container?: React.ComponentProps<typeof PopoverContent>['container']\n defaultOpen?: boolean\n defaultValue?: string\n onDateChange?: (date: Date | undefined) => void\n onOpenChange?: (open: boolean) => void\n onValueChange?: (value: string) => void\n open?: boolean\n pickerOnly?: boolean\n separator?: string\n value?: string\n}\n\nconst InputDate = React.forwardRef<HTMLInputElement, InputDateProps>(\n function InputDate(\n {\n calendarLabel,\n calendarProps,\n className,\n container,\n defaultOpen = false,\n defaultValue = '',\n disabled,\n id,\n onDateChange,\n onKeyDown,\n onOpenChange,\n onValueChange,\n open: openProp,\n pickerOnly = false,\n placeholder,\n separator = '.',\n value: valueProp,\n ...props\n },\n ref,\n ) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n const [text, setText] = useControllableState({\n defaultProp: defaultValue,\n onChange: onValueChange,\n prop: valueProp,\n })\n const [open, setOpenState] = useControllableState({\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n prop: openProp,\n })\n const selected = parseDate(text)\n const [month, setMonth] = React.useState<Date | undefined>(\n () => selected ?? calendarProps?.month,\n )\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (next && calendarProps?.month === undefined) {\n setMonth(parseDate(text) ?? new Date())\n }\n setOpenState(next)\n },\n [calendarProps?.month, setOpenState, text],\n )\n\n const commit = React.useCallback(\n (next: string) => {\n if (next === text) return\n setText(next)\n onDateChange?.(parseDate(next))\n },\n [onDateChange, setText, text],\n )\n\n const setInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n return (\n <Popover onOpenChange={setOpen} open={open}>\n <PopoverAnchor render={<InputGroup className={className} />}>\n <InputGroupInput\n autoComplete=\"off\"\n {...props}\n className={cn(pickerOnly && 'cursor-pointer')}\n disabled={disabled}\n id={id}\n inputMode={pickerOnly ? undefined : 'numeric'}\n onChange={() => {}}\n onClick={\n pickerOnly && !disabled\n ? (event) => {\n props.onClick?.(event)\n if (!event.defaultPrevented) setOpen(true)\n }\n : props.onClick\n }\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setOpen(true)\n return\n }\n if (pickerOnly || !isDateMaskKey(event.key)) return\n event.preventDefault()\n const next = apply({\n caret: event.currentTarget.selectionStart ?? 0,\n key: event.key,\n selectionEnd: event.currentTarget.selectionEnd ?? undefined,\n separator,\n value: event.currentTarget.value,\n })\n commit(next.value)\n const caret = next.caret\n const input = inputRef.current\n requestAnimationFrame(() => {\n input?.setSelectionRange(caret, caret)\n })\n }}\n placeholder={placeholder ?? `DD${separator}MM${separator}YYYY`}\n readOnly={pickerOnly}\n ref={setInputRef}\n spellCheck={false}\n value={text}\n />\n <InputGroupAddon align=\"inline-end\">\n <PopoverTrigger\n render={\n <Button\n aria-label={calendarLabel}\n color=\"neutral\"\n disabled={disabled}\n size=\"icon-small\"\n styleVariant=\"ghost\"\n >\n <CalendarMonth />\n </Button>\n }\n />\n </InputGroupAddon>\n </PopoverAnchor>\n <PopoverContent\n align=\"start\"\n aria-label={calendarLabel}\n className=\"w-auto p-0\"\n container={container}\n >\n <Calendar\n {...calendarProps}\n mode=\"single\"\n month={calendarProps?.month ?? month}\n onMonthChange={(next) => {\n calendarProps?.onMonthChange?.(next)\n if (calendarProps?.month === undefined) setMonth(next)\n }}\n onSelect={(next) => {\n commit(next ? formatDate(next, separator) : '')\n setOpen(false)\n }}\n selected={selected}\n />\n </PopoverContent>\n </Popover>\n )\n },\n)\n\nexport { InputDate }\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,qBAAwB,EAC/B,aACA,UACA,QAKC;CACD,MAAM,CAAC,cAAc,mBAAmBA,QAAM,SAAS,WAAW;CAClE,MAAM,eAAe,SAAS,KAAA;CAW9B,OAAO,CAVO,eAAe,OAAO,cAEnBA,QAAM,aACpB,SAAY;EACX,IAAI,CAAC,cAAc,gBAAgB,IAAI;EACvC,WAAW,IAAI;CACjB,GACA,CAAC,cAAc,QAAQ,CAGH,CAAC;AACzB;AAqBA,MAAM,YAAYA,QAAM,WACtB,SAAS,UACP,EACE,eACA,eACA,WACA,WACA,cAAc,OACd,eAAe,IACf,UACA,IACA,cACA,WACA,cACA,eACA,MAAM,UACN,aAAa,OACb,aACA,YAAY,KACZ,OAAO,WACP,GAAG,SAEL,KACA;CACA,MAAM,WAAWA,QAAM,OAAyB,IAAI;CACpD,MAAM,CAAC,MAAM,WAAW,qBAAqB;EAC3C,aAAa;EACb,UAAU;EACV,MAAM;CACR,CAAC;CACD,MAAM,CAAC,MAAM,gBAAgB,qBAAqB;EAChD,aAAa;EACb,UAAU;EACV,MAAM;CACR,CAAC;CACD,MAAM,WAAW,UAAU,IAAI;CAC/B,MAAM,CAAC,OAAO,YAAYA,QAAM,eACxB,YAAY,eAAe,KACnC;CACA,MAAM,UAAUA,QAAM,aACnB,SAAkB;EACjB,IAAI,QAAQ,eAAe,UAAU,KAAA,GACnC,SAAS,UAAU,IAAI,qBAAK,IAAI,KAAK,CAAC;EAExC,aAAa,IAAI;CACnB,GACA;EAAC,eAAe;EAAO;EAAc;CAAI,CAC3C;CAEA,MAAM,SAASA,QAAM,aAClB,SAAiB;EAChB,IAAI,SAAS,M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,GACD,oBAAC,iBAAD;IAAiB,OAAM;cACrB,oBAAC,gBAAD,EACE,QACE,oBAAC,QAAD;KACE,cAAY;KACZ,OAAM;KACI;KACV,MAAK;KACL,cAAa;eAEb,oBAAC,eAAD,CAAgB,CAAA;IACV,CAAA,EAEX,CAAA;GACc,CAAA,CACJ;MACf,oBAAC,gBAAD;GACE,OAAM;GACN,cAAY;GACZ,WAAU;GACC;aAEX,oBAAC,UAAD;IACE,GAAI;IACJ,MAAK;IACL,OAAO,eAAe,SAAS;IAC/B,gBAAgB,SAAS;KACvB,eAAe,gBAAgB,IAAI;KACnC,IAAI,eAAe,UAAU,KAAA,GAAW,SAAS,IAAI;IACvD;IACA,WAAW,SAAS;KAClB,OAAO,OAAO,WAAW,MAAM,SAAS,IAAI,EAAE;KAC9C,QAAQ,KAAK;IACf;IACU;GACX,CAAA;EACa,CAAA,CACT;;AAEb,CACF"}
1
+ {"version":3,"file":"input-date.js","names":["React"],"sources":["../../src/components/input-date.tsx"],"sourcesContent":["'use client'\n\nimport { CalendarMonth } from '@epilot/spark-icons'\nimport { apply, formatDate, isDateMaskKey, parseDate } from 'ictus'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { Button } from './button'\nimport { Calendar, type CalendarProps } from './calendar'\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group'\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from './popover'\n\nfunction useControllableState<T>({\n defaultProp,\n onChange,\n prop,\n}: {\n defaultProp: T\n onChange?: (value: T) => void\n prop?: T\n}) {\n const [uncontrolled, setUncontrolled] = React.useState(defaultProp)\n const isControlled = prop !== undefined\n const value = isControlled ? prop : uncontrolled\n\n const setValue = React.useCallback(\n (next: T) => {\n if (!isControlled) setUncontrolled(next)\n onChange?.(next)\n },\n [isControlled, onChange],\n )\n\n return [value, setValue] as const\n}\n\nexport type InputDateProps = Omit<\n React.ComponentProps<'input'>,\n 'children' | 'defaultValue' | 'onChange' | 'readOnly' | 'type' | 'value'\n> & {\n calendarLabel: string\n calendarProps?: Omit<CalendarProps, 'mode' | 'onSelect' | 'selected'>\n defaultOpen?: boolean\n defaultValue?: string\n onDateChange?: (date: Date | undefined) => void\n onOpenChange?: (open: boolean) => void\n onValueChange?: (value: string) => void\n open?: boolean\n pickerOnly?: boolean\n separator?: string\n value?: string\n}\n\nconst InputDate = React.forwardRef<HTMLInputElement, InputDateProps>(\n function InputDate(\n {\n calendarLabel,\n calendarProps,\n className,\n defaultOpen = false,\n defaultValue = '',\n disabled,\n id,\n onDateChange,\n onKeyDown,\n onOpenChange,\n onValueChange,\n open: openProp,\n pickerOnly = false,\n placeholder,\n separator = '.',\n value: valueProp,\n ...props\n },\n ref,\n ) {\n const inputRef = React.useRef<HTMLInputElement>(null)\n const [text, setText] = useControllableState({\n defaultProp: defaultValue,\n onChange: onValueChange,\n prop: valueProp,\n })\n const [open, setOpenState] = useControllableState({\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n prop: openProp,\n })\n const selected = parseDate(text)\n const [month, setMonth] = React.useState<Date | undefined>(\n () => selected ?? calendarProps?.month,\n )\n const setOpen = React.useCallback(\n (next: boolean) => {\n if (next && calendarProps?.month === undefined) {\n setMonth(parseDate(text) ?? new Date())\n }\n setOpenState(next)\n },\n [calendarProps?.month, setOpenState, text],\n )\n\n const commit = React.useCallback(\n (next: string) => {\n if (next === text) return\n setText(next)\n onDateChange?.(parseDate(next))\n },\n [onDateChange, setText, text],\n )\n\n const setInputRef = React.useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n return (\n <Popover onOpenChange={setOpen} open={open}>\n <PopoverAnchor render={<InputGroup className={className} />}>\n <InputGroupInput\n autoComplete=\"off\"\n {...props}\n className={cn(pickerOnly && 'cursor-pointer')}\n disabled={disabled}\n id={id}\n inputMode={pickerOnly ? undefined : 'numeric'}\n onChange={() => {}}\n onClick={\n pickerOnly && !disabled\n ? (event) => {\n props.onClick?.(event)\n if (!event.defaultPrevented) setOpen(true)\n }\n : props.onClick\n }\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.defaultPrevented) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setOpen(true)\n return\n }\n if (pickerOnly || !isDateMaskKey(event.key)) return\n event.preventDefault()\n const next = apply({\n caret: event.currentTarget.selectionStart ?? 0,\n key: event.key,\n selectionEnd: event.currentTarget.selectionEnd ?? undefined,\n separator,\n value: event.currentTarget.value,\n })\n commit(next.value)\n const caret = next.caret\n const input = inputRef.current\n requestAnimationFrame(() => {\n input?.setSelectionRange(caret, caret)\n })\n }}\n placeholder={placeholder ?? `DD${separator}MM${separator}YYYY`}\n readOnly={pickerOnly}\n ref={setInputRef}\n spellCheck={false}\n value={text}\n />\n <InputGroupAddon align=\"inline-end\">\n <PopoverTrigger\n render={\n <Button\n aria-label={calendarLabel}\n color=\"neutral\"\n disabled={disabled}\n size=\"icon-small\"\n styleVariant=\"ghost\"\n >\n <CalendarMonth />\n </Button>\n }\n />\n </InputGroupAddon>\n </PopoverAnchor>\n <PopoverContent\n align=\"start\"\n aria-label={calendarLabel}\n className=\"w-auto p-0\"\n >\n <Calendar\n {...calendarProps}\n mode=\"single\"\n month={calendarProps?.month ?? month}\n onMonthChange={(next) => {\n calendarProps?.onMonthChange?.(next)\n if (calendarProps?.month === undefined) setMonth(next)\n }}\n onSelect={(next) => {\n commit(next ? formatDate(next, separator) : '')\n setOpen(false)\n }}\n selected={selected}\n />\n </PopoverContent>\n </Popover>\n )\n },\n)\n\nexport { InputDate }\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,qBAAwB,EAC/B,aACA,UACA,QAKC;CACD,MAAM,CAAC,cAAc,mBAAmBA,QAAM,SAAS,WAAW;CAClE,MAAM,eAAe,SAAS,KAAA;CAW9B,OAAO,CAVO,eAAe,OAAO,cAEnBA,QAAM,aACpB,SAAY;EACX,IAAI,CAAC,cAA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AW,SAAS;KAClB,OAAO,OAAO,WAAW,MAAM,SAAS,IAAI,EAAE;KAC9C,QAAQ,KAAK;IACf;IACU;GACX,CAAA;EACa,CAAA,CACT;;AAEb,CACF"}
@@ -9,7 +9,7 @@ let react = require("react");
9
9
  react = require_chunk.__toESM(react);
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  let class_variance_authority = require("class-variance-authority");
12
- let cn = require("cn");
12
+ let cnfast = require("cnfast");
13
13
  //#region src/components/input-group.tsx
14
14
  const GHOST = "rounded-none border-0 border-b-2 px-0 focus-within:border-b-input-active has-[[data-slot=input][aria-invalid=true]]:border-b-input-invalid has-[[data-slot=input][aria-invalid=true]]:focus-within:border-b-red-a8! group-data-[invalid=true]/field:border-b-input-invalid! group-data-[invalid=true]/field:focus-within:border-b-red-a8!";
15
15
  const inputGroupVariants = (0, class_variance_authority.cva)("group/input-group relative flex h-10 w-full min-w-0 items-center gap-2 bg-transparent transition-[color,border-color] outline-none motion-reduce:transition-none", {
@@ -113,7 +113,7 @@ function InputGroup({ className, ...props }) {
113
113
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
114
114
  "data-slot": "input-group",
115
115
  role: "group",
116
- className: (0, cn.cn)(inputGroupVariants({
116
+ className: (0, cnfast.cn)(inputGroupVariants({
117
117
  chrome: field?.labelPosition === "inset" ? "inset" : "box",
118
118
  inputStyle,
119
119
  inputColor
@@ -133,7 +133,7 @@ function InputGroupAddon({ className, align = "inline-start", ...props }) {
133
133
  role: "presentation",
134
134
  "data-slot": "input-group-addon",
135
135
  "data-align": align,
136
- className: (0, cn.cn)(inputGroupAddonVariants({ align }), className),
136
+ className: (0, cnfast.cn)(inputGroupAddonVariants({ align }), className),
137
137
  onClick: (event) => {
138
138
  if (event.target.closest("button")) return;
139
139
  event.currentTarget.parentElement?.querySelector("input")?.focus();
@@ -143,7 +143,7 @@ function InputGroupAddon({ className, align = "inline-start", ...props }) {
143
143
  }
144
144
  function InputGroupText({ className, ...props }) {
145
145
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
146
- className: (0, cn.cn)("flex items-center gap-2 text-xs text-gray-light [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4", className),
146
+ className: (0, cnfast.cn)("flex items-center gap-2 text-xs text-gray-light [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4", className),
147
147
  ...props
148
148
  });
149
149
  }
@@ -151,7 +151,7 @@ const InputGroupInput = react.forwardRef(function InputGroupInput({ className, .
151
151
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_input.Input, {
152
152
  "data-slot": "input",
153
153
  variant: "none",
154
- className: (0, cn.cn)("flex-1", className),
154
+ className: (0, cnfast.cn)("flex-1", className),
155
155
  ref,
156
156
  ...props
157
157
  });
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.cjs","names":["useFieldContext","useTheme","React","Input"],"sources":["../../src/components/input-group.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { useFieldContext } from './field'\nimport { Input, type InputProps } from './input'\nimport { useTheme } from './theme'\n\nconst GHOST =\n 'rounded-none border-0 border-b-2 px-0 focus-within:border-b-input-active has-[[data-slot=input][aria-invalid=true]]:border-b-input-invalid has-[[data-slot=input][aria-invalid=true]]:focus-within:border-b-red-a8! group-data-[invalid=true]/field:border-b-input-invalid! group-data-[invalid=true]/field:focus-within:border-b-red-a8!'\n\nconst inputGroupVariants = cva(\n 'group/input-group relative flex h-10 w-full min-w-0 items-center gap-2 bg-transparent transition-[color,border-color] outline-none motion-reduce:transition-none',\n {\n variants: {\n chrome: {\n // inside an inset field the shell is the box; the group keeps the\n // classic underline (inputs inside stay chrome-less)\n inset: GHOST,\n // h-11 matches the standalone Input box\n box: 'h-11 rounded-md px-3 transition-all motion-reduce:transition-none',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n // invalid hover deepens the error tint instead of the accent hover\n class:\n 'group-data-[invalid=true]/field:bg-base-error-soft focus-within:ring-2 focus-within:ring-offset-2 group-data-[invalid=true]/field:focus-within:ring-red-a8 has-[[data-slot=input][aria-invalid=true]]:bg-base-error-soft has-[[data-slot=input][aria-invalid=true]]:focus-within:ring-red-a8 has-[[data-slot=input][aria-invalid=true]:not(:disabled)]:hover:bg-red-a4 group-data-[invalid=true]/field:has-[input:not(:disabled)]:hover:bg-red-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class:\n 'bg-input-base focus-within:ring-input-active has-[input:not(:disabled)]:hover:bg-input-base-hover',\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class:\n 'bg-base-gray-soft focus-within:ring-gray-a8 has-[input:not(:disabled)]:hover:bg-gray-a4',\n },\n {\n chrome: 'box',\n inputStyle: ['surface', 'outlined'],\n class:\n 'border group-data-[invalid=true]/field:border-input-invalid focus-within:ring-1 group-data-[invalid=true]/field:focus-within:border-input-invalid! group-data-[invalid=true]/field:focus-within:ring-red-a4! has-[[data-slot=input][aria-invalid=true]]:border-input-invalid has-[[data-slot=input][aria-invalid=true]]:focus-within:border-input-invalid! has-[[data-slot=input][aria-invalid=true]]:focus-within:ring-red-a4!',\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class:\n 'border-input bg-base-accent-surface focus-within:border-input-active focus-within:ring-spark-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class:\n 'border-input-gray bg-base-gray-surface focus-within:border-gray-a8 focus-within:ring-gray-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class:\n 'border-input focus-within:border-input-active focus-within:ring-spark-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class:\n 'border-input-gray focus-within:border-gray-a8 focus-within:ring-gray-a4',\n },\n { chrome: 'box', inputStyle: 'ghost', class: GHOST },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: 'border-b-input',\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: 'border-b-input-gray',\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\n// The group carries the box + focus/invalid states; inputs inside are\n// chrome-less (variant=\"none\"). Style follows the enclosing Field's knobs,\n// else the <Theme> input-style/input-color knobs.\nfunction InputGroup({ className, ...props }: React.ComponentProps<'div'>) {\n const field = useFieldContext()\n const theme = useTheme()\n const inputStyle = field?.inputStyle ?? theme.inputStyle ?? 'soft'\n const inputColor = field?.inputColor ?? theme.inputColor ?? 'brand'\n const chrome = field?.labelPosition === 'inset' ? 'inset' : 'box'\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n inputGroupVariants({ chrome, inputStyle, inputColor }),\n className,\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n 'flex h-auto cursor-text items-center justify-center gap-2 py-2 text-sm font-medium text-gray-light select-none [&_svg:not([class*=size-])]:size-4',\n {\n variants: {\n align: {\n // button addons bring their own inner padding — pull them halfway\n // into the group's px so the visual gap matches the text side\n 'inline-start': 'order-first has-[>button]:-ml-2',\n 'inline-end': 'order-last has-[>button]:-mr-2',\n },\n },\n defaultVariants: {\n align: 'inline-start',\n },\n },\n)\n\nfunction InputGroupAddon({\n className,\n align = 'inline-start',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n // chrome, not a control: the click only forwards focus to the input the\n // way a label would, and Tab already reaches that input directly\n role=\"presentation\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(event) => {\n if ((event.target as HTMLElement).closest('button')) return\n event.currentTarget.parentElement?.querySelector('input')?.focus()\n }}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n className={cn(\n 'flex items-center gap-2 text-xs text-gray-light [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst InputGroupInput = React.forwardRef<HTMLInputElement, InputProps>(\n function InputGroupInput({ className, ...props }, ref) {\n return (\n <Input\n data-slot=\"input\"\n variant=\"none\"\n className={cn('flex-1', className)}\n ref={ref}\n {...props}\n />\n )\n },\n)\n\nexport { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText }\n"],"mappings":";;;;;;;;;;;;;AASA,MAAM,QACJ;AAEF,MAAM,sBAAA,GAAA,yBAAA,KACJ,oKACA;CACE,UAAU;EACR,QAAQ;GAGN,OAAO;GAEP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GAEZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY,CAAC,WAAW,UAAU;GAClC,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GAAE,QAAQ;GAAO,YAAY;GAAS,OAAO;EAAM;EACnD;GACE,QAAQ;GACR,YAAY;GACZ,YAAY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AAA;AAEL;AAEA,MAAM,kBAAkBC,MAAM,WAC5B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACC,yBAAAA,OAAD;EACE,aAAU;EACV,SAAQ;EACR,YAAA,GAAA,GAAA,IAAc,UAAU,SAAS;EAC5B;EACL,GAAI;CACL,CAAA;AAEL,CACF"}
1
+ {"version":3,"file":"input-group.cjs","names":["useFieldContext","useTheme","React","Input"],"sources":["../../src/components/input-group.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\nimport { cn } from '../utils/cn'\nimport { useFieldContext } from './field'\nimport { Input, type InputProps } from './input'\nimport { useTheme } from './theme'\n\nconst GHOST =\n 'rounded-none border-0 border-b-2 px-0 focus-within:border-b-input-active has-[[data-slot=input][aria-invalid=true]]:border-b-input-invalid has-[[data-slot=input][aria-invalid=true]]:focus-within:border-b-red-a8! group-data-[invalid=true]/field:border-b-input-invalid! group-data-[invalid=true]/field:focus-within:border-b-red-a8!'\n\nconst inputGroupVariants = cva(\n 'group/input-group relative flex h-10 w-full min-w-0 items-center gap-2 bg-transparent transition-[color,border-color] outline-none motion-reduce:transition-none',\n {\n variants: {\n chrome: {\n // inside an inset field the shell is the box; the group keeps the\n // classic underline (inputs inside stay chrome-less)\n inset: GHOST,\n // h-11 matches the standalone Input box\n box: 'h-11 rounded-md px-3 transition-all motion-reduce:transition-none',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n // invalid hover deepens the error tint instead of the accent hover\n class:\n 'group-data-[invalid=true]/field:bg-base-error-soft focus-within:ring-2 focus-within:ring-offset-2 group-data-[invalid=true]/field:focus-within:ring-red-a8 has-[[data-slot=input][aria-invalid=true]]:bg-base-error-soft has-[[data-slot=input][aria-invalid=true]]:focus-within:ring-red-a8 has-[[data-slot=input][aria-invalid=true]:not(:disabled)]:hover:bg-red-a4 group-data-[invalid=true]/field:has-[input:not(:disabled)]:hover:bg-red-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class:\n 'bg-input-base focus-within:ring-input-active has-[input:not(:disabled)]:hover:bg-input-base-hover',\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class:\n 'bg-base-gray-soft focus-within:ring-gray-a8 has-[input:not(:disabled)]:hover:bg-gray-a4',\n },\n {\n chrome: 'box',\n inputStyle: ['surface', 'outlined'],\n class:\n 'border group-data-[invalid=true]/field:border-input-invalid focus-within:ring-1 group-data-[invalid=true]/field:focus-within:border-input-invalid! group-data-[invalid=true]/field:focus-within:ring-red-a4! has-[[data-slot=input][aria-invalid=true]]:border-input-invalid has-[[data-slot=input][aria-invalid=true]]:focus-within:border-input-invalid! has-[[data-slot=input][aria-invalid=true]]:focus-within:ring-red-a4!',\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class:\n 'border-input bg-base-accent-surface focus-within:border-input-active focus-within:ring-spark-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class:\n 'border-input-gray bg-base-gray-surface focus-within:border-gray-a8 focus-within:ring-gray-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class:\n 'border-input focus-within:border-input-active focus-within:ring-spark-a4',\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class:\n 'border-input-gray focus-within:border-gray-a8 focus-within:ring-gray-a4',\n },\n { chrome: 'box', inputStyle: 'ghost', class: GHOST },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: 'border-b-input',\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: 'border-b-input-gray',\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\n// The group carries the box + focus/invalid states; inputs inside are\n// chrome-less (variant=\"none\"). Style follows the enclosing Field's knobs,\n// else the <Theme> input-style/input-color knobs.\nfunction InputGroup({ className, ...props }: React.ComponentProps<'div'>) {\n const field = useFieldContext()\n const theme = useTheme()\n const inputStyle = field?.inputStyle ?? theme.inputStyle ?? 'soft'\n const inputColor = field?.inputColor ?? theme.inputColor ?? 'brand'\n const chrome = field?.labelPosition === 'inset' ? 'inset' : 'box'\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n inputGroupVariants({ chrome, inputStyle, inputColor }),\n className,\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n 'flex h-auto cursor-text items-center justify-center gap-2 py-2 text-sm font-medium text-gray-light select-none [&_svg:not([class*=size-])]:size-4',\n {\n variants: {\n align: {\n // button addons bring their own inner padding — pull them halfway\n // into the group's px so the visual gap matches the text side\n 'inline-start': 'order-first has-[>button]:-ml-2',\n 'inline-end': 'order-last has-[>button]:-mr-2',\n },\n },\n defaultVariants: {\n align: 'inline-start',\n },\n },\n)\n\nfunction InputGroupAddon({\n className,\n align = 'inline-start',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n // chrome, not a control: the click only forwards focus to the input the\n // way a label would, and Tab already reaches that input directly\n role=\"presentation\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(event) => {\n if ((event.target as HTMLElement).closest('button')) return\n event.currentTarget.parentElement?.querySelector('input')?.focus()\n }}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n className={cn(\n 'flex items-center gap-2 text-xs text-gray-light [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n )\n}\n\nconst InputGroupInput = React.forwardRef<HTMLInputElement, InputProps>(\n function InputGroupInput({ className, ...props }, ref) {\n return (\n <Input\n data-slot=\"input\"\n variant=\"none\"\n className={cn('flex-1', className)}\n ref={ref}\n {...props}\n />\n )\n },\n)\n\nexport { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText }\n"],"mappings":";;;;;;;;;;;;;AASA,MAAM,QACJ;AAEF,MAAM,sBAAA,GAAA,yBAAA,KACJ,oKACA;CACE,UAAU;EACR,QAAQ;GAGN,OAAO;GAEP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GAEZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY,CAAC,WAAW,UAAU;GAClC,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OACE;EACJ;EACA;GAAE,QAAQ;GAAO,YAAY;GAAS,OAAO;EAAM;EACnD;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAO;EACT;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAO;EACT;EACA;GAAE,QAAQ;GAAS,YAAY;GAAS,OAAO;EAAiB;EAChE;GAAE,QAAQ;GAAS,YAAY;GAAQ,OAAO;EAAsB;CACtE;AACF,CACF;AAKA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,MAAM,QAAQ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-5,7 +5,7 @@ const require_components_field = require("./field.cjs");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
  let class_variance_authority = require("class-variance-authority");
7
7
  let _base_ui_react_otp_field = require("@base-ui/react/otp-field");
8
- let cn = require("cn");
8
+ let cnfast = require("cnfast");
9
9
  //#region src/components/input-otp.tsx
10
10
  const slotVariants = (0, class_variance_authority.cva)("flex w-11 min-w-0 items-center justify-center bg-transparent text-center text-base font-medium text-gray tabular-nums outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none", {
11
11
  variants: {
@@ -94,7 +94,7 @@ function InputOtp({ length = 6, className, id: idProp, onComplete, slotAriaLabel
94
94
  id,
95
95
  validationType,
96
96
  onValueComplete: onComplete,
97
- className: (0, cn.cn)("flex items-center gap-2", className),
97
+ className: (0, cnfast.cn)("flex items-center gap-2", className),
98
98
  ...props,
99
99
  children: Array.from({ length }, (_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_otp_field.OTPField.Input, {
100
100
  "aria-label": index === 0 ? void 0 : slotAriaLabel(index),
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp.cjs","names":["GHOST_UNDERLINE","boxChrome","useFieldControl","OTPField"],"sources":["../../src/components/input-otp.tsx"],"sourcesContent":["import { OTPField, type OTPFieldRootProps } from '@base-ui/react/otp-field'\nimport { cva } from 'class-variance-authority'\nimport { boxChrome, GHOST_UNDERLINE } from '../lib/input-box-variants'\nimport { cn } from '../utils/cn'\nimport { useFieldControl } from './field'\n\n// One code box per slot. Mirrors Input's box/underline carrier model so the\n// slots read like the rest of the input family across every style/color knob.\nconst slotVariants = cva(\n 'flex w-11 min-w-0 items-center justify-center bg-transparent text-center text-base font-medium text-gray tabular-nums outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none',\n {\n variants: {\n chrome: {\n // inside an inset field the shell is the box; slots keep the classic\n // underline (the pre-knob default look)\n inset: GHOST_UNDERLINE,\n box: 'h-11 rounded-md',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class: boxChrome.soft.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class: boxChrome.soft.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class: boxChrome.surface.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class: boxChrome.surface.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class: boxChrome.outlined.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class: boxChrome.outlined.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: boxChrome.ghost.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: boxChrome.ghost.gray,\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\ninterface InputOtpProps extends Pick<\n OTPFieldRootProps,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'disabled'\n | 'className'\n | 'id'\n | 'validationType'\n> {\n /** Number of code slots. */\n length?: number\n /** Fired when every slot is filled. */\n onComplete?: OTPFieldRootProps['onValueComplete']\n /** Accessible name per slot (for localization). */\n slotAriaLabel?: (index: number) => string\n}\n\nfunction InputOtp({\n length = 6,\n className,\n id: idProp,\n onComplete,\n slotAriaLabel = (index) => `Character ${index + 1}`,\n validationType = 'alphanumeric',\n ...props\n}: InputOtpProps) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({ id: idProp })\n const chrome = field?.labelPosition === 'inset' ? 'inset' : 'box'\n\n return (\n <OTPField.Root\n data-slot=\"input-otp\"\n length={length}\n id={id}\n validationType={validationType}\n onValueComplete={onComplete}\n className={cn('flex items-center gap-2', className)}\n {...props}\n >\n {Array.from({ length }, (_, index) => (\n <OTPField.Input\n key={index}\n // the first slot is named by the Field label (Base UI ignores\n // aria-label there); the rest get a positional name for a11y\n aria-label={index === 0 ? undefined : slotAriaLabel(index)}\n aria-describedby={index === 0 ? ariaDescribedBy : undefined}\n aria-invalid={index === 0 ? ariaInvalid : undefined}\n className={slotVariants({ chrome, inputStyle, inputColor })}\n />\n ))}\n </OTPField.Root>\n )\n}\n\nexport { InputOtp }\nexport type { InputOtpProps }\n"],"mappings":";;;;;;;;;AAQA,MAAM,gBAAA,GAAA,yBAAA,KACJ,0XACA;CACE,UAAU;EACR,QAAQ;GAGN,OAAOA,+BAAAA;GACP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOC,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GAAE,QAAQ;GAAS,YAAY;GAAS,OAAO;EAAiB;EAChE;GAAE,QAAQ;GAAS,YAAY;GAAQ,OAAO;EAAsB;CACtE;AACF,CACF;AAoBA,SAAS,SAAS,EAChB,SAAS,GACT,WACA,IAAI,QACJ,YACA,iBAAiB,UAAU,aAAa,QAAQ,KAChD,iBAAiB,gBACjB,GAAG,SACa;CAChB,MAAM,EAAE,OAAO,IAAI,iBAAiB,aAAa,YAAY,eAC3DC,yBAAAA,gBAAgB,EAAE,IAAI,OAAO,CAAC;CAChC,MAAM,SAAS,OAAO,kBAAkB,UAAU,UAAU;CAE5D,OACE,iBAAA,GAAA,kBAAA,KAACC,yBAAAA,SAAS,MAAV;EACE,aAAU;EACF;EACJ;EACY;EAChB,iBAAiB;EACjB,YAAA,GAAA,GAAA,IAAc,2BAA2B,SAAS;EAClD,GAAI;YAEH,MAAM,KAAK,EAAE,OAAO,IAAI,GAAG,UAC1B,iBAAA,GAAA,kBAAA,KAACA,yBAAAA,SAAS,OAAV;GAIE,cAAY,UAAU,IAAI,KAAA,IAAY,cAAc,KAAK;GACzD,oBAAkB,UAAU,IAAI,kBAAkB,KAAA;GAClD,gBAAc,UAAU,IAAI,cAAc,KAAA;GAC1C,WAAW,aAAa;IAAE;IAAQ;IAAY;GAAW,CAAC;EAC3D,GAPM,KAON,CACF;CACY,CAAA;AAEnB"}
1
+ {"version":3,"file":"input-otp.cjs","names":["GHOST_UNDERLINE","boxChrome","useFieldControl","OTPField"],"sources":["../../src/components/input-otp.tsx"],"sourcesContent":["import { OTPField, type OTPFieldRootProps } from '@base-ui/react/otp-field'\nimport { cva } from 'class-variance-authority'\nimport { boxChrome, GHOST_UNDERLINE } from '../lib/input-box-variants'\nimport { cn } from '../utils/cn'\nimport { useFieldControl } from './field'\n\n// One code box per slot. Mirrors Input's box/underline carrier model so the\n// slots read like the rest of the input family across every style/color knob.\nconst slotVariants = cva(\n 'flex w-11 min-w-0 items-center justify-center bg-transparent text-center text-base font-medium text-gray tabular-nums outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none',\n {\n variants: {\n chrome: {\n // inside an inset field the shell is the box; slots keep the classic\n // underline (the pre-knob default look)\n inset: GHOST_UNDERLINE,\n box: 'h-11 rounded-md',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class: boxChrome.soft.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class: boxChrome.soft.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class: boxChrome.surface.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class: boxChrome.surface.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class: boxChrome.outlined.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class: boxChrome.outlined.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: boxChrome.ghost.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: boxChrome.ghost.gray,\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\ninterface InputOtpProps extends Pick<\n OTPFieldRootProps,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'disabled'\n | 'className'\n | 'id'\n | 'validationType'\n> {\n /** Number of code slots. */\n length?: number\n /** Fired when every slot is filled. */\n onComplete?: OTPFieldRootProps['onValueComplete']\n /** Accessible name per slot (for localization). */\n slotAriaLabel?: (index: number) => string\n}\n\nfunction InputOtp({\n length = 6,\n className,\n id: idProp,\n onComplete,\n slotAriaLabel = (index) => `Character ${index + 1}`,\n validationType = 'alphanumeric',\n ...props\n}: InputOtpProps) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({ id: idProp })\n const chrome = field?.labelPosition === 'inset' ? 'inset' : 'box'\n\n return (\n <OTPField.Root\n data-slot=\"input-otp\"\n length={length}\n id={id}\n validationType={validationType}\n onValueComplete={onComplete}\n className={cn('flex items-center gap-2', className)}\n {...props}\n >\n {Array.from({ length }, (_, index) => (\n <OTPField.Input\n key={index}\n // the first slot is named by the Field label (Base UI ignores\n // aria-label there); the rest get a positional name for a11y\n aria-label={index === 0 ? undefined : slotAriaLabel(index)}\n aria-describedby={index === 0 ? ariaDescribedBy : undefined}\n aria-invalid={index === 0 ? ariaInvalid : undefined}\n className={slotVariants({ chrome, inputStyle, inputColor })}\n />\n ))}\n </OTPField.Root>\n )\n}\n\nexport { InputOtp }\nexport type { InputOtpProps }\n"],"mappings":";;;;;;;;;AAQA,MAAM,gBAAA,GAAA,yBAAA,KACJ,0XACA;CACE,UAAU;EACR,QAAQ;GAGN,OAAOA,+BAAAA;GACP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOC,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,KAAK;EACxB;EACA;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AAA;GAC1C,WAAW,aAAa;IAAE;IAAQ;IAAY;GAAW,CAAC;EAC3D,GAPM,KAON,CACF;CACY,CAAA;AAEnB"}
@@ -7,7 +7,7 @@ let react = require("react");
7
7
  react = require_chunk.__toESM(react);
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let class_variance_authority = require("class-variance-authority");
10
- let cn = require("cn");
10
+ let cnfast = require("cnfast");
11
11
  //#region src/components/input.tsx
12
12
  const inputVariants = (0, class_variance_authority.cva)("flex h-10 w-full min-w-0 [appearance:textfield] bg-transparent text-gray outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", {
13
13
  variants: {
@@ -96,7 +96,7 @@ const Input = react.forwardRef(function Input({ variant, className, id: idProp,
96
96
  });
97
97
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
98
98
  "data-slot": "input",
99
- className: (0, cn.cn)(inputVariants({
99
+ className: (0, cnfast.cn)(inputVariants({
100
100
  chrome: variant === "none" ? "none" : !variant && field?.labelPosition === "inset" ? "inset" : "box",
101
101
  inputStyle,
102
102
  inputColor
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","names":["GHOST_UNDERLINE","boxChrome","React","useFieldControl"],"sources":["../../src/components/input.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport { boxChrome, GHOST_UNDERLINE } from '../lib/input-box-variants'\nimport type { SparkInputStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { useFieldControl } from './field'\n\ntype InputVariant = SparkInputStyle | 'none'\n\nconst inputVariants = cva(\n 'flex h-10 w-full min-w-0 [appearance:textfield] bg-transparent text-gray outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n {\n variants: {\n chrome: {\n none: 'border-0 px-0',\n // inside an inset field the shell is the box; the input keeps the\n // classic underline (the pre-knob default look)\n inset: GHOST_UNDERLINE,\n box: 'h-11 rounded-md px-3 py-1 text-base transition-all motion-reduce:transition-none',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class: boxChrome.soft.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class: boxChrome.soft.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class: boxChrome.surface.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class: boxChrome.surface.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class: boxChrome.outlined.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class: boxChrome.outlined.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: boxChrome.ghost.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: boxChrome.ghost.gray,\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\ninterface InputProps extends React.ComponentProps<'input'> {\n variant?: InputVariant\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n variant,\n className,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n },\n ref,\n) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({\n id: idProp,\n ariaDescribedBy: ariaDescribedByProp,\n variant: variant !== 'none' ? variant : undefined,\n })\n // an explicit variant prop keeps the box even inside an inset field\n const chrome =\n variant === 'none'\n ? 'none'\n : !variant && field?.labelPosition === 'inset'\n ? 'inset'\n : 'box'\n\n return (\n <input\n data-slot=\"input\"\n className={cn(\n inputVariants({ chrome, inputStyle, inputColor }),\n className,\n )}\n id={id}\n ref={ref}\n aria-invalid={ariaInvalid}\n {...props}\n aria-describedby={ariaDescribedBy}\n />\n )\n})\n\nexport { Input }\nexport type { InputProps, InputVariant }\n"],"mappings":";;;;;;;;;;;AASA,MAAM,iBAAA,GAAA,yBAAA,KACJ,2aACA;CACE,UAAU;EACR,QAAQ;GACN,MAAM;GAGN,OAAOA,+BAAAA;GACP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOC,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GAAE,QAAQ;GAAS,YAAY;GAAS,OAAO;EAAiB;EAChE;GAAE,QAAQ;GAAS,YAAY;GAAQ,OAAO;EAAsB;CACtE;AACF,CACF;AAOA,MAAM,QAAQC,MAAM,WAAyC,SAAS,MACpE,EACE,SACA,WACA,IAAI,QACJ,oBAAoB,qBACpB,GAAG,SAEL,KACA;CACA,MAAM,EAAE,OAAO,IAAI,iBAAiB,aAAa,YAAY,eAC3DC,yBAAAA,gBAAgB;EACd,IAAI;EACJ,iBAAiB;EACjB,SAAS,YAAY,SAAS,UAAU,KAAA;CAC1C,CAAC;CASH,OACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EACE,aAAU;EACV,YAAA,GAAA,GAAA,IACE,cAAc;GAAE,QAVpB,YAAY,SACR,SACA,CAAC,WAAW,OAAO,kBAAkB,UACnC,UACA;GAMsB;GAAY;EAAW,CAAC,GAChD,SACF;EACI;EACC;EACL,gBAAc;EACd,GAAI;EACJ,oBAAkB;CACnB,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"input.cjs","names":["GHOST_UNDERLINE","boxChrome","React","useFieldControl"],"sources":["../../src/components/input.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport * as React from 'react'\nimport { boxChrome, GHOST_UNDERLINE } from '../lib/input-box-variants'\nimport type { SparkInputStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\nimport { useFieldControl } from './field'\n\ntype InputVariant = SparkInputStyle | 'none'\n\nconst inputVariants = cva(\n 'flex h-10 w-full min-w-0 [appearance:textfield] bg-transparent text-gray outline-hidden transition-all group-data-[invalid=true]/field:text-error placeholder:text-gray-placeholder disabled:cursor-not-allowed disabled:text-gray-disabled disabled:placeholder:text-gray-disabled aria-invalid:text-error motion-reduce:transition-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n {\n variants: {\n chrome: {\n none: 'border-0 px-0',\n // inside an inset field the shell is the box; the input keeps the\n // classic underline (the pre-knob default look)\n inset: GHOST_UNDERLINE,\n box: 'h-11 rounded-md px-3 py-1 text-base transition-all motion-reduce:transition-none',\n },\n inputStyle: { soft: '', surface: '', outlined: '', ghost: '' },\n inputColor: { brand: '', gray: '' },\n },\n compoundVariants: [\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'brand',\n class: boxChrome.soft.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'soft',\n inputColor: 'gray',\n class: boxChrome.soft.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'brand',\n class: boxChrome.surface.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'surface',\n inputColor: 'gray',\n class: boxChrome.surface.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'brand',\n class: boxChrome.outlined.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'outlined',\n inputColor: 'gray',\n class: boxChrome.outlined.gray,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'brand',\n class: boxChrome.ghost.brand,\n },\n {\n chrome: 'box',\n inputStyle: 'ghost',\n inputColor: 'gray',\n class: boxChrome.ghost.gray,\n },\n { chrome: 'inset', inputColor: 'brand', class: 'border-b-input' },\n { chrome: 'inset', inputColor: 'gray', class: 'border-b-input-gray' },\n ],\n },\n)\n\ninterface InputProps extends React.ComponentProps<'input'> {\n variant?: InputVariant\n}\n\n// forwardRef keeps refs working for React 18 consumers (ref-as-prop is 19-only)\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n variant,\n className,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n },\n ref,\n) {\n const { field, id, ariaDescribedBy, ariaInvalid, inputStyle, inputColor } =\n useFieldControl({\n id: idProp,\n ariaDescribedBy: ariaDescribedByProp,\n variant: variant !== 'none' ? variant : undefined,\n })\n // an explicit variant prop keeps the box even inside an inset field\n const chrome =\n variant === 'none'\n ? 'none'\n : !variant && field?.labelPosition === 'inset'\n ? 'inset'\n : 'box'\n\n return (\n <input\n data-slot=\"input\"\n className={cn(\n inputVariants({ chrome, inputStyle, inputColor }),\n className,\n )}\n id={id}\n ref={ref}\n aria-invalid={ariaInvalid}\n {...props}\n aria-describedby={ariaDescribedBy}\n />\n )\n})\n\nexport { Input }\nexport type { InputProps, InputVariant }\n"],"mappings":";;;;;;;;;;;AASA,MAAM,iBAAA,GAAA,yBAAA,KACJ,2aACA;CACE,UAAU;EACR,QAAQ;GACN,MAAM;GAGN,OAAOA,+BAAAA;GACP,KAAK;EACP;EACA,YAAY;GAAE,MAAM;GAAI,SAAS;GAAI,UAAU;GAAI,OAAO;EAAG;EAC7D,YAAY;GAAE,OAAO;GAAI,MAAM;EAAG;CACpC;CACA,kBAAkB;EAChB;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOC,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,KAAK;EACxB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,QAAQ;EAC3B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,SAAS;EAC5B;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GACE,QAAQ;GACR,YAAY;GACZ,YAAY;GACZ,OAAOA,+BAAAA,UAAU,MAAM;EACzB;EACA;GAAE,QAAQ;GAAS,YAAY;GAAS,OAAO;EAAiB;EAChE;GAAE,QAAQ;GAAS,YAAY;GAAQ,OAAO;EAAsB;CACtE;AACF,CACF;AAOA,MAAM,QAAQC,MAAM,WAAyC,SAAS,MACpE,EACE,SACA,WACA,IAAI,QACJ,oBAAoB,qBACpB,GAAG,SAEL,KACA;CACA,MAAM,EAAE,OAAO,IAAI,iBAAiB,aAAa,YAAY,eAC3DC,yBAAAA,gBAAgB;EACd,IAAI;EACJ,iBAAiB;EACjB,SAAS,YAAY,SAAS,UAAU,KAAA;CAC1C,CAAC;CASH,OACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EACE,aAAU;EACV,YAAA,GAAA,OAAA,IACE,cAAc;GAAE,QAVpB,YAAY,SACR,SACA,CAAC,WAAW,OAAO,kBAAkB,UACnC,UACA;GAMsB;GAAY;EAAW,CAAC,GAChD,SACF;EACI;EACC;EACL,gBAAc;EACd,GAAI;EACJ,oBAAkB;CACnB,CAAA;AAEL,CAAC"}
@@ -4,10 +4,10 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  let react = require("react");
5
5
  react = require_chunk.__toESM(react);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let cn = require("cn");
7
+ let cnfast = require("cnfast");
8
8
  //#region src/components/label.tsx
9
9
  const Label = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
10
- className: (0, cn.cn)("text-sm leading-5 font-normal text-gray", className),
10
+ className: (0, cnfast.cn)("text-sm leading-5 font-normal text-gray", className),
11
11
  ref,
12
12
  ...props
13
13
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"label.cjs","names":["React"],"sources":["../../src/components/label.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n className={cn('text-sm leading-5 font-normal text-gray', className)}\n ref={ref}\n {...props}\n />\n ),\n)\n\nLabel.displayName = 'Label'\n\nexport { Label }\nexport type { LabelProps }\n"],"mappings":";;;;;;;;AAKA,MAAM,QAAQA,MAAM,YACjB,EAAE,WAAW,GAAG,SAAS,QACxB,iBAAA,GAAA,kBAAA,KAAC,SAAD;CACE,YAAA,GAAA,GAAA,IAAc,2CAA2C,SAAS;CAC7D;CACL,GAAI;AACL,CAAA,CAEL;AAEA,MAAM,cAAc"}
1
+ {"version":3,"file":"label.cjs","names":["React"],"sources":["../../src/components/label.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n className={cn('text-sm leading-5 font-normal text-gray', className)}\n ref={ref}\n {...props}\n />\n ),\n)\n\nLabel.displayName = 'Label'\n\nexport { Label }\nexport type { LabelProps }\n"],"mappings":";;;;;;;;AAKA,MAAM,QAAQA,MAAM,YACjB,EAAE,WAAW,GAAG,SAAS,QACxB,iBAAA,GAAA,kBAAA,KAAC,SAAD;CACE,YAAA,GAAA,OAAA,IAAc,2CAA2C,SAAS;CAC7D;CACL,GAAI;AACL,CAAA,CAEL;AAEA,MAAM,cAAc"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  let react_jsx_runtime = require("react/jsx-runtime");
3
- let cn = require("cn");
3
+ let cnfast = require("cnfast");
4
4
  //#region src/components/layout.tsx
5
5
  const PageContainer = ({ className, gap = 4, style, ...rest }) => {
6
6
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7
- className: (0, cn.cn)("mx-auto flex w-full flex-col gap-[calc(var(--spark-layout-gap)*var(--page-container-gap-steps,4))] md:max-w-152", className),
7
+ className: (0, cnfast.cn)("mx-auto flex w-full flex-col gap-[calc(var(--spark-layout-gap)*var(--page-container-gap-steps,4))] md:max-w-152", className),
8
8
  style: {
9
9
  "--page-container-gap-steps": gap,
10
10
  ...style
@@ -1 +1 @@
1
- {"version":3,"file":"layout.cjs","names":[],"sources":["../../src/components/layout.tsx"],"sourcesContent":["import type React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface PageContainerProps extends React.ComponentProps<'div'> {\n /** How many `--spark-layout-gap` units apart each section sits. */\n gap?: number\n}\n\nconst PageContainer = ({\n className,\n gap = 4,\n style,\n ...rest\n}: PageContainerProps) => {\n return (\n <div\n className={cn(\n 'mx-auto flex w-full flex-col gap-[calc(var(--spark-layout-gap)*var(--page-container-gap-steps,4))] md:max-w-152',\n className,\n )}\n style={\n {\n '--page-container-gap-steps': gap,\n ...style,\n } as React.CSSProperties\n }\n {...rest}\n />\n )\n}\n\nexport default PageContainer\nexport type { PageContainerProps }\n"],"mappings":";;;;AAQA,MAAM,iBAAiB,EACrB,WACA,MAAM,GACN,OACA,GAAG,WACqB;CACxB,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,GAAA,IACE,mHACA,SACF;EACA,OACE;GACE,8BAA8B;GAC9B,GAAG;EACL;EAEF,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"layout.cjs","names":[],"sources":["../../src/components/layout.tsx"],"sourcesContent":["import type React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface PageContainerProps extends React.ComponentProps<'div'> {\n /** How many `--spark-layout-gap` units apart each section sits. */\n gap?: number\n}\n\nconst PageContainer = ({\n className,\n gap = 4,\n style,\n ...rest\n}: PageContainerProps) => {\n return (\n <div\n className={cn(\n 'mx-auto flex w-full flex-col gap-[calc(var(--spark-layout-gap)*var(--page-container-gap-steps,4))] md:max-w-152',\n className,\n )}\n style={\n {\n '--page-container-gap-steps': gap,\n ...style,\n } as React.CSSProperties\n }\n {...rest}\n />\n )\n}\n\nexport default PageContainer\nexport type { PageContainerProps }\n"],"mappings":";;;;AAQA,MAAM,iBAAiB,EACrB,WACA,MAAM,GACN,OACA,GAAG,WACqB;CACxB,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,YAAA,GAAA,OAAA,IACE,mHACA,SACF;EACA,OACE;GACE,8BAA8B;GAC9B,GAAG;EACL;EAEF,GAAI;CACL,CAAA;AAEL"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
- const require_hooks_use_chart_zoom = require("../hooks/use-chart-zoom.cjs");
5
- const require_hooks_use_reduced_motion = require("../hooks/use-reduced-motion.cjs");
6
4
  const require_utils_format = require("../utils/format.cjs");
7
5
  const require_utils_chart_scale = require("../utils/chart-scale.cjs");
8
6
  const require_utils_chart_time_ticks = require("../utils/chart-time-ticks.cjs");
7
+ const require_hooks_use_chart_zoom = require("../hooks/use-chart-zoom.cjs");
8
+ const require_hooks_use_reduced_motion = require("../hooks/use-reduced-motion.cjs");
9
9
  const require_components_chart = require("./chart.cjs");
10
10
  let react = require("react");
11
11
  react = require_chunk.__toESM(react);
@@ -17,7 +17,7 @@ let _visx_shape = require("@visx/shape");
17
17
  let _visx_curve = require("@visx/curve");
18
18
  let _visx_tooltip = require("@visx/tooltip");
19
19
  let _visx_vendor_d3_array = require("@visx/vendor/d3-array");
20
- let cn = require("cn");
20
+ let cnfast = require("cnfast");
21
21
  //#region src/components/line-chart.tsx
22
22
  const DEFAULT_MARGIN = {
23
23
  top: 16,
@@ -69,7 +69,7 @@ function nearestDatum(data, date) {
69
69
  if (!d1) return d0;
70
70
  return date.valueOf() - d0.date.valueOf() > d1.date.valueOf() - date.valueOf() ? d1 : d0;
71
71
  }
72
- const defaultFormatDate = (date) => date.toLocaleDateString(require_utils_format.getDocumentLang(), {
72
+ const defaultFormatDate = (date) => date.toLocaleDateString(void 0, {
73
73
  month: "short",
74
74
  day: "numeric"
75
75
  });
@@ -241,7 +241,7 @@ const LineChart = ({ series, width, height, margin = DEFAULT_MARGIN, curve: defa
241
241
  });
242
242
  if (width < 10 || height < 10) return null;
243
243
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
244
- className: (0, cn.cn)("relative", className),
244
+ className: (0, cnfast.cn)("relative", className),
245
245
  children: [
246
246
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
247
247
  className: "block",
@@ -346,7 +346,7 @@ const LineChart = ({ series, width, height, margin = DEFAULT_MARGIN, curve: defa
346
346
  clipPath: `url(#${plotClipId})`,
347
347
  "data-testid": "chart-plot-clip",
348
348
  children: series.map((s, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_visx_shape.LinePath, {
349
- className: (0, cn.cn)(LINE_COLORS[i % LINE_COLORS.length], s.className),
349
+ className: (0, cnfast.cn)(LINE_COLORS[i % LINE_COLORS.length], s.className),
350
350
  curve: resolveCurve(s.curve ?? defaultCurve),
351
351
  data: s.data,
352
352
  fill: "none",
@@ -477,7 +477,7 @@ const LineChart = ({ series, width, height, margin = DEFAULT_MARGIN, curve: defa
477
477
  const d = nearestDatum(s.data, tooltipData.date);
478
478
  if (!d || !withinDomain(s.data, tooltipData.date)) return null;
479
479
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
480
- className: s.color ? void 0 : (0, cn.cn)(DOT_COLORS[i % DOT_COLORS.length]),
480
+ className: s.color ? void 0 : (0, cnfast.cn)(DOT_COLORS[i % DOT_COLORS.length]),
481
481
  cx: xScale(d.date),
482
482
  cy: yScale(d.value),
483
483
  fill: s.color,