jenosize-ui 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +13 -10
  2. package/dist/Cartesian-ZIKPEYWP.d.ts +26 -0
  3. package/dist/{PaymentInput-CKPIPNWH.d.ts → PaymentInput-Dn5WVQVy.d.ts} +4 -0
  4. package/dist/{Select-CVbEQ2Ep.d.ts → Select-Dt5ARIH8.d.ts} +4 -0
  5. package/dist/{TagInput-CTJYOB4J.d.ts → TagInput-BaBeve6L.d.ts} +4 -0
  6. package/dist/area-chart.d.ts +54 -0
  7. package/dist/area-chart.js +9 -0
  8. package/dist/avatar.d.ts +24 -0
  9. package/dist/avatar.js +13 -7
  10. package/dist/badge.d.ts +4 -0
  11. package/dist/badge.js +6 -5
  12. package/dist/bar-chart.d.ts +32 -0
  13. package/dist/bar-chart.js +9 -0
  14. package/dist/breadcrumb.d.ts +4 -0
  15. package/dist/breadcrumb.js +5 -3
  16. package/dist/button.d.ts +16 -1
  17. package/dist/button.js +10 -8
  18. package/dist/calendar.d.ts +5 -0
  19. package/dist/calendar.js +18 -14
  20. package/dist/callout.d.ts +6 -6
  21. package/dist/callout.js +12 -9
  22. package/dist/card-D56VxyAe.d.ts +123 -0
  23. package/dist/card.d.ts +3 -1
  24. package/dist/card.js +7 -3
  25. package/dist/checkbox.js +9 -7
  26. package/dist/chunk-22M75A3N.js +396 -0
  27. package/dist/{chunk-D5BTFSL7.js → chunk-33TOK7ES.js} +7 -5
  28. package/dist/{chunk-THC2ISYP.js → chunk-3H444OJA.js} +6 -4
  29. package/dist/{chunk-GFOAJVW5.js → chunk-3QXLIZIX.js} +4 -13
  30. package/dist/chunk-3ZEEGXYF.js +8 -0
  31. package/dist/chunk-45Y2ZGNK.js +34 -0
  32. package/dist/{chunk-FHHAPGCR.js → chunk-4RBIWI2Q.js} +3 -3
  33. package/dist/chunk-4VGEJG4M.js +1510 -0
  34. package/dist/{chunk-PWKWNDBS.js → chunk-54SIZR63.js} +16 -8
  35. package/dist/chunk-5AZKP4KZ.js +49 -0
  36. package/dist/chunk-5DP7W5HX.js +254 -0
  37. package/dist/{chunk-J2BCKBHC.js → chunk-5KSD4WKN.js} +14 -5
  38. package/dist/{chunk-ZOOX3TUB.js → chunk-5XPMY2LF.js} +6 -6
  39. package/dist/chunk-5ZEUTSCV.js +147 -0
  40. package/dist/chunk-5ZPUAGOP.js +19 -0
  41. package/dist/{chunk-JTNFJLIY.js → chunk-667ZHY3T.js} +114 -42
  42. package/dist/{chunk-JP26LPCY.js → chunk-6B6BWTXC.js} +30 -13
  43. package/dist/{chunk-W5GGOUUI.js → chunk-6H4LNWQ7.js} +3 -3
  44. package/dist/{chunk-WFY7DKQD.js → chunk-6MMBQVRO.js} +61 -51
  45. package/dist/{chunk-7HOIZ3UO.js → chunk-7GUPNTAH.js} +15 -7
  46. package/dist/chunk-7VLYQR4D.js +44 -0
  47. package/dist/{chunk-KNYKWUYX.js → chunk-7ZM7SNCZ.js} +3 -3
  48. package/dist/{chunk-E7ZSWBAK.js → chunk-A323V6AI.js} +6 -4
  49. package/dist/chunk-AFYXSZGW.js +23 -0
  50. package/dist/chunk-AIARANKE.js +33 -0
  51. package/dist/{chunk-4OLULPQG.js → chunk-AIGYMTCU.js} +10 -6
  52. package/dist/{chunk-JVJRHBTD.js → chunk-AZ7DKRBY.js} +21 -8
  53. package/dist/{chunk-JYGR44ZC.js → chunk-BBKE4W3B.js} +19 -11
  54. package/dist/{chunk-Z3ETJN5G.js → chunk-BFVJHH7S.js} +8 -12
  55. package/dist/chunk-BLIZ3CL3.js +49 -0
  56. package/dist/{chunk-F2K7VJUV.js → chunk-CFFWYXDW.js} +19 -7
  57. package/dist/{chunk-MQGD2OUF.js → chunk-CGHYXWTT.js} +11 -5
  58. package/dist/{chunk-CYPPEUX5.js → chunk-CKMWBVRR.js} +27 -12
  59. package/dist/{chunk-GTHJWR3Q.js → chunk-D7EE5GWU.js} +21 -22
  60. package/dist/{chunk-5NOBSXJN.js → chunk-E2YZ7IMT.js} +24 -8
  61. package/dist/{chunk-T7FCG7XV.js → chunk-FFMTYQXE.js} +31 -11
  62. package/dist/{chunk-J36M3KRX.js → chunk-FH7Z7SGQ.js} +67 -32
  63. package/dist/chunk-FKVPAEJ6.js +57 -0
  64. package/dist/{chunk-GRLSUQQE.js → chunk-FNQJJO63.js} +4 -4
  65. package/dist/{chunk-5RAPA22E.js → chunk-FWRHBMWT.js} +4 -4
  66. package/dist/chunk-GLKFFA7N.js +171 -0
  67. package/dist/{chunk-KDLPXXD2.js → chunk-GQRSABRN.js} +4 -4
  68. package/dist/{chunk-DRZCJCBO.js → chunk-GZMDZF2V.js} +8 -7
  69. package/dist/chunk-HHYEAFCL.js +525 -0
  70. package/dist/{chunk-LME57Z6J.js → chunk-I6WMNXC7.js} +6 -6
  71. package/dist/chunk-IQNVSQRK.js +605 -0
  72. package/dist/chunk-KHGW72BM.js +10 -0
  73. package/dist/{chunk-ZZA2LUTL.js → chunk-KZP6B6B3.js} +41 -16
  74. package/dist/chunk-LCG34A5T.js +98 -0
  75. package/dist/chunk-LLPWQDF7.js +26 -0
  76. package/dist/{chunk-J7ZQQFPT.js → chunk-LO22VQL5.js} +18 -18
  77. package/dist/{chunk-BVJWBYIG.js → chunk-LQURV7HQ.js} +9 -7
  78. package/dist/{chunk-R6RGJF4L.js → chunk-LYXPJERB.js} +15 -5
  79. package/dist/{chunk-CME4DIML.js → chunk-MCQG4H6T.js} +54 -3
  80. package/dist/{chunk-VWC72TR3.js → chunk-MVG5MABV.js} +11 -8
  81. package/dist/{chunk-5FATN5YD.js → chunk-N3RVMBPX.js} +6 -9
  82. package/dist/chunk-NKG4N6HA.js +188 -0
  83. package/dist/{chunk-W46K56XU.js → chunk-OACWA4TC.js} +15 -69
  84. package/dist/chunk-OLLD2BZN.js +33 -0
  85. package/dist/{chunk-KMSYEE23.js → chunk-P6CON2R2.js} +25 -11
  86. package/dist/chunk-PO2TYK3C.js +17 -0
  87. package/dist/{chunk-7EWQKTNQ.js → chunk-POQTE7JI.js} +66 -25
  88. package/dist/{chunk-HMUZE6EK.js → chunk-QDKETK7D.js} +4 -4
  89. package/dist/{chunk-GCVA3OIV.js → chunk-QDYE5LVT.js} +13 -3
  90. package/dist/{chunk-WEUJYDCV.js → chunk-QHH6AUR3.js} +16 -8
  91. package/dist/chunk-RJTVCA62.js +42 -0
  92. package/dist/{chunk-MUFHLP4S.js → chunk-S5TEWPWW.js} +50 -41
  93. package/dist/{chunk-D6TPWNRK.js → chunk-SB3DG572.js} +15 -8
  94. package/dist/chunk-SKRR3ZMP.js +10 -0
  95. package/dist/chunk-T4ZFZTY6.js +62 -0
  96. package/dist/{chunk-I7WU4GTY.js → chunk-T5574MXM.js} +34 -46
  97. package/dist/{chunk-MKC5HNA7.js → chunk-U4WSJAYK.js} +374 -147
  98. package/dist/{chunk-BJUZVYQC.js → chunk-UGKELBNC.js} +60 -44
  99. package/dist/chunk-ULGCGKOE.js +77 -0
  100. package/dist/{chunk-QA74ITR4.js → chunk-X2VMIBK5.js} +45 -17
  101. package/dist/chunk-X2X7Q7NW.js +17 -0
  102. package/dist/chunk-YHBI52P2.js +10 -0
  103. package/dist/chunk-YIHKQ63K.js +13 -0
  104. package/dist/{chunk-3Y5X7B5C.js → chunk-YQYVGWIC.js} +6 -11
  105. package/dist/{chunk-WZQFC7ZN.js → chunk-ZHAT2XZ4.js} +139 -66
  106. package/dist/{chunk-7IU5TMFL.js → chunk-ZMFY7WAY.js} +124 -40
  107. package/dist/{chunk-SV56BSUQ.js → chunk-ZZSNTCCL.js} +6 -5
  108. package/dist/combobox.d.ts +5 -0
  109. package/dist/combobox.js +15 -12
  110. package/dist/control-size-CaxQhkKh.d.ts +3 -0
  111. package/dist/date-input.d.ts +4 -0
  112. package/dist/date-input.js +12 -9
  113. package/dist/date-picker.d.ts +6 -0
  114. package/dist/date-picker.js +25 -20
  115. package/dist/dialog.d.ts +37 -5
  116. package/dist/dialog.js +12 -8
  117. package/dist/drawer.d.ts +20 -3
  118. package/dist/drawer.js +11 -7
  119. package/dist/dropdown-menu.d.ts +26 -2
  120. package/dist/dropdown-menu.js +9 -4
  121. package/dist/dropzone.d.ts +35 -0
  122. package/dist/dropzone.js +23 -0
  123. package/dist/form.d.ts +82 -3
  124. package/dist/form.js +205 -45
  125. package/dist/header-navigation.d.ts +19 -4
  126. package/dist/header-navigation.js +23 -16
  127. package/dist/helper.d.ts +36 -0
  128. package/dist/helper.js +3 -0
  129. package/dist/index.d.ts +32 -8
  130. package/dist/index.js +87 -62
  131. package/dist/indicator.js +4 -4
  132. package/dist/input.d.ts +4 -0
  133. package/dist/input.js +10 -8
  134. package/dist/kanban-board.d.ts +489 -0
  135. package/dist/kanban-board.js +25 -0
  136. package/dist/labels-DPrh0se9.d.ts +627 -0
  137. package/dist/line-chart.d.ts +36 -0
  138. package/dist/line-chart.js +9 -0
  139. package/dist/{nav-Bla0o_-1.d.ts → nav-CKKqjBs6.d.ts} +18 -11
  140. package/dist/number-input.d.ts +4 -0
  141. package/dist/number-input.js +10 -8
  142. package/dist/pagination.d.ts +7 -1
  143. package/dist/pagination.js +14 -10
  144. package/dist/panel-El4oI68p.d.ts +9 -0
  145. package/dist/payment-input.d.ts +3 -2
  146. package/dist/payment-input.js +10 -8
  147. package/dist/pie-chart.d.ts +64 -0
  148. package/dist/pie-chart.js +9 -0
  149. package/dist/popover.d.ts +9 -3
  150. package/dist/popover.js +11 -7
  151. package/dist/progress-steps.d.ts +275 -0
  152. package/dist/progress-steps.js +8 -0
  153. package/dist/progress.d.ts +21 -1
  154. package/dist/progress.js +3 -2
  155. package/dist/provider.d.ts +212 -0
  156. package/dist/provider.js +7 -0
  157. package/dist/radar-chart.d.ts +77 -0
  158. package/dist/radar-chart.js +9 -0
  159. package/dist/radial-chart.d.ts +73 -0
  160. package/dist/radial-chart.js +9 -0
  161. package/dist/radio.js +9 -7
  162. package/dist/rule-BqzaIwJy.d.ts +80 -0
  163. package/dist/scroll-area.d.ts +62 -0
  164. package/dist/scroll-area.js +7 -0
  165. package/dist/select.d.ts +3 -3
  166. package/dist/select.js +17 -14
  167. package/dist/separator.d.ts +114 -0
  168. package/dist/separator.js +5 -0
  169. package/dist/shared-CxAedkiy.d.ts +68 -0
  170. package/dist/sidebar-navigation.d.ts +80 -12
  171. package/dist/sidebar-navigation.js +18 -9
  172. package/dist/skeleton.d.ts +61 -0
  173. package/dist/skeleton.js +5 -0
  174. package/dist/styles.css +1 -1
  175. package/dist/switch.js +4 -4
  176. package/dist/table.d.ts +148 -42
  177. package/dist/table.js +39 -33
  178. package/dist/tabs.d.ts +22 -0
  179. package/dist/tabs.js +3 -3
  180. package/dist/tag-input.d.ts +3 -2
  181. package/dist/tag-input.js +13 -11
  182. package/dist/tag.d.ts +4 -0
  183. package/dist/tag.js +4 -3
  184. package/dist/textarea.js +7 -5
  185. package/dist/theme.css +151 -6
  186. package/dist/theme.js +11 -9
  187. package/dist/toast.d.ts +11 -2
  188. package/dist/toast.js +12 -9
  189. package/dist/tooltip-surface-C2I9o2QM.d.ts +35 -0
  190. package/dist/tooltip.d.ts +15 -1
  191. package/dist/tooltip.js +3 -2
  192. package/dist/tree.d.ts +5 -0
  193. package/dist/tree.js +8 -6
  194. package/dist/types-DR9rAEy1.d.ts +188 -0
  195. package/dist/use-uploads-KaPqDklo.d.ts +482 -0
  196. package/dist/verification-code-input.d.ts +84 -0
  197. package/dist/verification-code-input.js +14 -0
  198. package/package.json +70 -9
  199. package/dist/card-nWicloNi.d.ts +0 -80
  200. package/dist/chunk-24TO7E32.js +0 -42
  201. package/dist/chunk-FXIBGTS5.js +0 -14
  202. package/dist/chunk-MFJP5FA7.js +0 -20
  203. package/dist/chunk-ZZT2E5VT.js +0 -24
  204. package/dist/shared-BNXAdgh2.d.ts +0 -9
@@ -1,10 +1,11 @@
1
- import { ACCENT, DISMISS, SOLID, OUTLINE, SUBTLE } from './chunk-CME4DIML.js';
1
+ import { ACCENT, DISMISS, SOLID, OUTLINE, SUBTLE } from './chunk-MCQG4H6T.js';
2
2
  import { overflowClasses, overflowBounded } from './chunk-DWKILXHE.js';
3
- import { SEAMLESS_COLOR, SEAMLESS_CHIP_PX, SEAMLESS_CHIP_NUM, SEAMLESS_CHIP } from './chunk-KNYKWUYX.js';
3
+ import { SEAMLESS_COLOR, SEAMLESS_CHIP_PX, SEAMLESS_CHIP_NUM, SEAMLESS_CHIP } from './chunk-7ZM7SNCZ.js';
4
4
  import { Slot } from './chunk-52IFGFTL.js';
5
- import { ArrowRightIcon, XIcon } from './chunk-24TO7E32.js';
6
- import { devWarn } from './chunk-GCVA3OIV.js';
5
+ import { ArrowRightIcon, XIcon } from './chunk-BLIZ3CL3.js';
7
6
  import { cn } from './chunk-ZSNJ6UA3.js';
7
+ import { useLabels } from './chunk-RJTVCA62.js';
8
+ import { devWarn } from './chunk-QDYE5LVT.js';
8
9
  import 'react';
9
10
  import { jsx, jsxs } from 'react/jsx-runtime';
10
11
 
@@ -101,6 +102,11 @@ function BadgeGroup(props) {
101
102
  iconNode
102
103
  ] });
103
104
  }
105
+
106
+ // src/components/badge/labels.ts
107
+ var BADGE_LABELS = {
108
+ dismiss: "Dismiss"
109
+ };
104
110
  var BASE = "inline-flex items-center justify-center align-middle select-none font-medium";
105
111
  function shapeClasses(shape, size) {
106
112
  if (shape === "pill") return "rounded-full";
@@ -178,11 +184,13 @@ function Badge(props) {
178
184
  overflow = "visible",
179
185
  seamless = false,
180
186
  onDismiss,
181
- dismissLabel = "Dismiss",
187
+ dismissLabel,
188
+ labels,
182
189
  className,
183
190
  children,
184
191
  ...rest
185
192
  } = props;
193
+ const t = useLabels("badge", BADGE_LABELS, labels);
186
194
  if (seamless && (props.color !== void 0 || props.variant !== void 0)) {
187
195
  devWarn("<Badge seamless> takes its color from the host \u2014 `color`/`variant` are ignored.");
188
196
  }
@@ -219,7 +227,7 @@ function Badge(props) {
219
227
  "button",
220
228
  {
221
229
  type: "button",
222
- "aria-label": dismissLabel,
230
+ "aria-label": dismissLabel ?? t.dismiss,
223
231
  onClick: onDismiss,
224
232
  className: cn(
225
233
  "inline-flex shrink-0 cursor-pointer items-center justify-center p-0.5",
@@ -239,5 +247,5 @@ function Badge(props) {
239
247
  }
240
248
 
241
249
  export { Badge, BadgeGroup };
242
- //# sourceMappingURL=chunk-PWKWNDBS.js.map
243
- //# sourceMappingURL=chunk-PWKWNDBS.js.map
250
+ //# sourceMappingURL=chunk-54SIZR63.js.map
251
+ //# sourceMappingURL=chunk-54SIZR63.js.map
@@ -0,0 +1,49 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import * as React from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/lib/link.tsx
6
+ var LinkContext = React.createContext(void 0);
7
+ if (process.env.NODE_ENV !== "production") LinkContext.displayName = "JenosizeUILinkContext";
8
+ var plainAnchor = (href) => /* @__PURE__ */ jsx("a", { href });
9
+ var NOT_A_ROUTE = /^([a-z][a-z\d+.-]*:|\/\/|\\\\|#)/i;
10
+ function routerOwns(href, options) {
11
+ if (options?.target != null && options.target !== "_self") return false;
12
+ return !NOT_A_ROUTE.test(href.trim());
13
+ }
14
+ function useLinkResolver() {
15
+ const Link = React.useContext(LinkContext);
16
+ return React.useMemo(
17
+ /* `!href`, not `href == null` — an EMPTY string is not a destination either. It was the one
18
+ * question this layer exists to centralise that four call sites still answered for themselves,
19
+ * and they disagreed: `href: ""` was a `<button>` in a Callout, a non-interactive lockup in a
20
+ * header, and an `<a href="">` — a link that silently reloads the current page — in a sidebar
21
+ * brand, every nav row and every crumb. Answering it here means a caller can pass `href`
22
+ * straight through and get one behaviour. */
23
+ () => (href, options) => href ? Link && routerOwns(href, options) ? React.createElement(Link, { href }) : plainAnchor(href) : void 0,
24
+ [Link]
25
+ );
26
+ }
27
+ function useLinkElement(href, options) {
28
+ return useLinkResolver()(href, options);
29
+ }
30
+ function LinkOrButton({ render, className, ariaCurrent, ariaLabel, onClick, children }) {
31
+ return useRender({
32
+ defaultTagName: "button",
33
+ render,
34
+ props: {
35
+ className,
36
+ "aria-current": ariaCurrent ? "page" : void 0,
37
+ "aria-label": ariaLabel,
38
+ onClick,
39
+ children,
40
+ // `type` belongs only on the default <button> form — putting it in the shared object would
41
+ // leak a bogus attribute onto an <a> or a router <Link>. (Breadcrumb's Crumb, verbatim.)
42
+ ...render == null && { type: "button" }
43
+ }
44
+ });
45
+ }
46
+
47
+ export { LinkContext, LinkOrButton, useLinkElement, useLinkResolver };
48
+ //# sourceMappingURL=chunk-5AZKP4KZ.js.map
49
+ //# sourceMappingURL=chunk-5AZKP4KZ.js.map
@@ -0,0 +1,254 @@
1
+ import { useCartesianColors, DEFAULT_PALETTE, BarChart, LineChart, AreaChart, MARGIN, ChartDataTable, formatNumber, ChartFrame, BAR_LAYOUT, CHART_ROOT, AREA_GRADIENT_STOPS, CartesianGrid, GRID, XAxis, X_AXIS_PADDING, AXIS_TICK, AXIS, Label, AXIS_LABEL, YAxis, ReferenceLine, ZERO_LINE, Tooltip, TOOLTIP_CURSOR, NO_ANIMATION, ChartTooltipContent, Area, AREA_FILL_OPACITY, AREA_SOLID_OPACITY, AREA_BAND, ACTIVE_DOT, Line, LINE_DASH, DOT, Bar, BAR_RADIUS_HORIZONTAL, BAR_RADIUS, MAX_BAR_SIZE, ChartLegendContent, BAND_SEPARATOR } from './chunk-22M75A3N.js';
2
+ import * as React from 'react';
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+
5
+ function toBands(groupValues) {
6
+ const bands = [];
7
+ for (const [index, label] of groupValues.entries()) {
8
+ const last = bands.at(-1);
9
+ if (last && last.label === label && last.endIndex === index - 1) {
10
+ last.endIndex = index;
11
+ } else {
12
+ bands.push({ label, startIndex: index, endIndex: index });
13
+ }
14
+ }
15
+ return bands;
16
+ }
17
+ function BandTick({ x = 0, y = 0, width = 0, height = 0, index = 0, visibleTicksCount = 1, bands = [], vertical = false }) {
18
+ const band = bands.find((b) => b.startIndex === index);
19
+ if (!band) return null;
20
+ const span = vertical ? height : width;
21
+ const bandSize = visibleTicksCount > 0 ? span / visibleTicksCount : 0;
22
+ const shift = (band.endIndex - band.startIndex) / 2 * bandSize;
23
+ const separator = band.startIndex > 0 ? bandSize / 2 : null;
24
+ if (vertical) {
25
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ separator === null ? null : /* @__PURE__ */ jsx("line", { x1: x - 6, x2: x + 6, y1: y - separator, y2: y - separator, stroke: "currentColor", className: BAND_SEPARATOR }),
27
+ /* @__PURE__ */ jsx("text", { x, y: y + shift, textAnchor: "end", dominantBaseline: "middle", fill: "currentColor", className: AXIS_TICK, children: band.label })
28
+ ] });
29
+ }
30
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ separator === null ? null : /* @__PURE__ */ jsx("line", { x1: x - separator, x2: x - separator, y1: y - 4, y2: y + 12, stroke: "currentColor", className: BAND_SEPARATOR }),
32
+ /* @__PURE__ */ jsx("text", { x: x + shift, y: y + 12, textAnchor: "middle", fill: "currentColor", className: AXIS_TICK, children: band.label })
33
+ ] });
34
+ }
35
+ var ROOT_BY_KIND = {
36
+ area: AreaChart,
37
+ line: LineChart,
38
+ bar: BarChart
39
+ };
40
+ function Cartesian({
41
+ data,
42
+ x,
43
+ xGroup,
44
+ series,
45
+ mark,
46
+ component,
47
+ palette = DEFAULT_PALETTE,
48
+ height = 240,
49
+ legend = "right",
50
+ grid = true,
51
+ xLabel,
52
+ yLabel,
53
+ formatX,
54
+ formatValue = formatNumber,
55
+ tooltip = true,
56
+ tooltipTone = "surface",
57
+ emptyMessage,
58
+ labels,
59
+ className,
60
+ "aria-label": ariaLabel
61
+ }) {
62
+ const colors = useCartesianColors(component, series, palette);
63
+ const { colorMap, labelMap } = React.useMemo(() => {
64
+ const colorMap2 = {};
65
+ const labelMap2 = {};
66
+ for (const [i, s] of series.entries()) {
67
+ colorMap2[s.key] = colors[i] ?? "";
68
+ labelMap2[s.key] = s.label;
69
+ }
70
+ return { colorMap: colorMap2, labelMap: labelMap2 };
71
+ }, [series, colors]);
72
+ const legendItems = React.useMemo(() => series.map((s, i) => ({ label: s.label, color: colors[i] ?? "" })), [series, colors]);
73
+ const formatCategory = React.useCallback((value) => formatX ? formatX(value) : String(value ?? ""), [formatX]);
74
+ const crossesZero = React.useMemo(() => {
75
+ let min = Infinity;
76
+ let max = -Infinity;
77
+ for (const row of data) {
78
+ for (const s of series) {
79
+ const v = row[s.key];
80
+ if (typeof v === "number" && Number.isFinite(v)) {
81
+ if (v < min) min = v;
82
+ if (v > max) max = v;
83
+ }
84
+ }
85
+ }
86
+ return min < 0 && max > 0;
87
+ }, [data, series]);
88
+ const isHorizontal = mark.kind === "bar" && mark.layout === "bars";
89
+ const Root = ROOT_BY_KIND[mark.kind];
90
+ const margin = mark.kind === "bar" ? isHorizontal ? MARGIN.barsLayout : MARGIN.bar : MARGIN.line;
91
+ const xKey = x;
92
+ const bands = React.useMemo(() => xGroup ? toBands(data.map((row) => String(row[xGroup] ?? ""))) : null, [data, xGroup]);
93
+ const table = /* @__PURE__ */ jsx(
94
+ ChartDataTable,
95
+ {
96
+ caption: ariaLabel,
97
+ rowHeader: xLabel ?? x,
98
+ columns: [...xGroup ? [xGroup] : [], ...series.map((s) => s.label)],
99
+ rows: data.map((row) => [
100
+ formatCategory(row[x]),
101
+ ...xGroup ? [String(row[xGroup] ?? "")] : [],
102
+ ...series.map((s) => {
103
+ const v = row[s.key];
104
+ return typeof v === "number" ? formatValue(v) : String(v ?? "");
105
+ })
106
+ ])
107
+ }
108
+ );
109
+ return /* @__PURE__ */ jsx(
110
+ ChartFrame,
111
+ {
112
+ component,
113
+ ariaLabel,
114
+ height,
115
+ isEmpty: data.length === 0,
116
+ emptyMessage,
117
+ labels,
118
+ className,
119
+ table,
120
+ legendAlign: "start",
121
+ legendPlacement: legend === "none" ? void 0 : legend,
122
+ legend: legend === "none" ? void 0 : /* @__PURE__ */ jsx(ChartLegendContent, { items: legendItems, placement: legend }),
123
+ children: (gid) => /* @__PURE__ */ jsxs(Root, { data, className: CHART_ROOT, margin, layout: mark.kind === "bar" ? BAR_LAYOUT[mark.layout] : void 0, children: [
124
+ mark.kind === "area" && mark.fill === "gradient" ? /* @__PURE__ */ jsx("defs", { children: series.map((s, i) => /* @__PURE__ */ jsxs("linearGradient", { id: `${gid}-${i}`, x1: "0", y1: "0", x2: "0", y2: "1", style: { color: colors[i] }, children: [
125
+ /* @__PURE__ */ jsx("stop", { offset: AREA_GRADIENT_STOPS.fromOffset, stopColor: "currentColor", stopOpacity: AREA_GRADIENT_STOPS.from }),
126
+ /* @__PURE__ */ jsx("stop", { offset: AREA_GRADIENT_STOPS.toOffset, stopColor: "currentColor", stopOpacity: AREA_GRADIENT_STOPS.to })
127
+ ] }, s.key)) }) : null,
128
+ grid ? /* @__PURE__ */ jsx(CartesianGrid, { vertical: isHorizontal, horizontal: !isHorizontal, stroke: "currentColor", className: GRID }) : null,
129
+ /* @__PURE__ */ jsx(
130
+ XAxis,
131
+ {
132
+ ...AXIS,
133
+ type: isHorizontal ? "number" : "category",
134
+ dataKey: isHorizontal ? void 0 : xKey,
135
+ tick: { className: AXIS_TICK, fill: "currentColor" },
136
+ tickFormatter: isHorizontal ? (v) => formatValue(Number(v)) : formatCategory,
137
+ padding: mark.kind === "bar" ? void 0 : X_AXIS_PADDING,
138
+ tickMargin: mark.kind === "bar" ? 11 : void 0,
139
+ children: xLabel ? /* @__PURE__ */ jsx(Label, { value: xLabel, fill: "currentColor", className: AXIS_LABEL, position: "bottom" }) : null
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsx(
143
+ YAxis,
144
+ {
145
+ ...AXIS,
146
+ type: isHorizontal ? "category" : "number",
147
+ dataKey: isHorizontal ? xKey : void 0,
148
+ tick: { className: AXIS_TICK, fill: "currentColor" },
149
+ tickFormatter: isHorizontal ? formatCategory : (v) => formatValue(Number(v)),
150
+ children: yLabel ? /* @__PURE__ */ jsx(Label, { value: yLabel, fill: "currentColor", className: AXIS_LABEL, style: { textAnchor: "middle" }, angle: -90, position: "insideLeft" }) : null
151
+ }
152
+ ),
153
+ bands ? isHorizontal ? /* @__PURE__ */ jsx(
154
+ YAxis,
155
+ {
156
+ yAxisId: "jz-band",
157
+ type: "category",
158
+ dataKey: xKey,
159
+ orientation: "left",
160
+ interval: 0,
161
+ axisLine: false,
162
+ tickLine: false,
163
+ width: 72,
164
+ tick: /* @__PURE__ */ jsx(BandTick, { bands, vertical: true })
165
+ }
166
+ ) : /* @__PURE__ */ jsx(
167
+ XAxis,
168
+ {
169
+ xAxisId: "jz-band",
170
+ type: "category",
171
+ dataKey: xKey,
172
+ orientation: "bottom",
173
+ interval: 0,
174
+ axisLine: false,
175
+ tickLine: false,
176
+ height: 28,
177
+ tick: /* @__PURE__ */ jsx(BandTick, { bands })
178
+ }
179
+ ) : null,
180
+ crossesZero ? /* @__PURE__ */ jsx(ReferenceLine, { ...isHorizontal ? { x: 0 } : { y: 0 }, stroke: "currentColor", className: ZERO_LINE, strokeWidth: 1 }) : null,
181
+ tooltip ? /* @__PURE__ */ jsx(
182
+ Tooltip,
183
+ {
184
+ ...NO_ANIMATION,
185
+ cursor: mark.kind === "bar" ? TOOLTIP_CURSOR.bar : TOOLTIP_CURSOR.line,
186
+ content: /* @__PURE__ */ jsx(ChartTooltipContent, { colors: colorMap, labels: labelMap, formatValue, formatLabel: formatCategory, tone: tooltipTone })
187
+ }
188
+ ) : null,
189
+ series.map((s, i) => {
190
+ const color = colors[i];
191
+ const last = i === series.length - 1;
192
+ const key = s.key;
193
+ if (mark.kind === "area") {
194
+ return /* @__PURE__ */ jsx(
195
+ Area,
196
+ {
197
+ ...NO_ANIMATION,
198
+ className: AREA_BAND[mark.band],
199
+ style: { color },
200
+ dataKey: key,
201
+ name: s.label,
202
+ type: mark.curve,
203
+ stroke: "currentColor",
204
+ strokeWidth: 2,
205
+ fill: mark.fill === "none" ? "none" : mark.fill === "gradient" ? `url(#${gid}-${i})` : "currentColor",
206
+ fillOpacity: mark.fill === "gradient" ? AREA_FILL_OPACITY : mark.fill === "solid" ? AREA_SOLID_OPACITY : 0,
207
+ stackId: mark.stacked ? "a" : void 0,
208
+ activeDot: ACTIVE_DOT(color)
209
+ },
210
+ s.key
211
+ );
212
+ }
213
+ if (mark.kind === "line") {
214
+ return /* @__PURE__ */ jsx(
215
+ Line,
216
+ {
217
+ ...NO_ANIMATION,
218
+ style: { color },
219
+ dataKey: key,
220
+ name: s.label,
221
+ type: mark.curve,
222
+ stroke: "currentColor",
223
+ strokeWidth: 2,
224
+ ...mark.dashed ? LINE_DASH : null,
225
+ dot: mark.dots ? DOT(color) : false,
226
+ activeDot: ACTIVE_DOT(color)
227
+ },
228
+ s.key
229
+ );
230
+ }
231
+ const radius = isHorizontal ? BAR_RADIUS_HORIZONTAL : BAR_RADIUS;
232
+ return /* @__PURE__ */ jsx(
233
+ Bar,
234
+ {
235
+ ...NO_ANIMATION,
236
+ style: { color },
237
+ dataKey: key,
238
+ name: s.label,
239
+ fill: "currentColor",
240
+ maxBarSize: MAX_BAR_SIZE,
241
+ stackId: mark.stacked ? "a" : void 0,
242
+ radius: mark.stacked && !last ? void 0 : [...radius]
243
+ },
244
+ s.key
245
+ );
246
+ })
247
+ ] })
248
+ }
249
+ );
250
+ }
251
+
252
+ export { Cartesian };
253
+ //# sourceMappingURL=chunk-5DP7W5HX.js.map
254
+ //# sourceMappingURL=chunk-5DP7W5HX.js.map
@@ -1,6 +1,7 @@
1
- import { CircleHelpIcon } from './chunk-24TO7E32.js';
2
- import { TooltipExport } from './chunk-ZZA2LUTL.js';
1
+ import { TooltipExport } from './chunk-KZP6B6B3.js';
2
+ import { CircleHelpIcon } from './chunk-BLIZ3CL3.js';
3
3
  import { cn } from './chunk-ZSNJ6UA3.js';
4
+ import { useLabels } from './chunk-RJTVCA62.js';
4
5
  import { Field } from '@base-ui/react/field';
5
6
  import 'react';
6
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -43,6 +44,13 @@ var SHELL_SIZE = {
43
44
  lg: `min-h-11 ${BAR_PX.lg} gap-2 ${CONTROL_TEXT.lg} ${CONTROL_RADIUS}`
44
45
  };
45
46
  var LISTBOX_PX_SM = "pl-3 pr-2.5";
47
+
48
+ // src/components/field/labels.ts
49
+ var FIELD_LABELS = {
50
+ /** Appended to a required control's accessible name, visually hidden. Leading comma included:
51
+ * it is a name FRAGMENT ("Email, required"), not a sentence. */
52
+ required: ", required"
53
+ };
46
54
  function useFieldValidity(invalid = false, error) {
47
55
  const showError = error != null && error !== "";
48
56
  return { isInvalid: invalid || showError, showError };
@@ -126,6 +134,7 @@ function FieldGroupFrame(props) {
126
134
  announceRequired = false,
127
135
  children
128
136
  } = props;
137
+ const t = useLabels("field", FIELD_LABELS, void 0);
129
138
  return /* @__PURE__ */ jsxs(Field.Root, { name, disabled, invalid: isInvalid, className: cn("flex flex-col gap-1.5", fullWidth ? "w-full" : "w-auto", className), children: [
130
139
  label ? /* @__PURE__ */ jsxs("span", { id: labelId, className: FIELD_LABEL_CLASS, children: [
131
140
  /* @__PURE__ */ jsx(
@@ -139,7 +148,7 @@ function FieldGroupFrame(props) {
139
148
  tooltipDescription
140
149
  }
141
150
  ),
142
- required && announceRequired ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: ", required" }) : null
151
+ required && announceRequired ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: t.required }) : null
143
152
  ] }) : null,
144
153
  children,
145
154
  /* @__PURE__ */ jsx(FieldMessages, { hint, error, showError, size })
@@ -147,5 +156,5 @@ function FieldGroupFrame(props) {
147
156
  }
148
157
 
149
158
  export { BAR_SIZE, CONTROL_ICON, CONTROL_RADIUS, CONTROL_TEXT, FIELD_LABEL_CLASS, FieldFrame, FieldGroupFrame, LISTBOX_PX_SM, SHELL_SIZE, SLOT_ICON, useFieldValidity };
150
- //# sourceMappingURL=chunk-J2BCKBHC.js.map
151
- //# sourceMappingURL=chunk-J2BCKBHC.js.map
159
+ //# sourceMappingURL=chunk-5KSD4WKN.js.map
160
+ //# sourceMappingURL=chunk-5KSD4WKN.js.map
@@ -1,8 +1,8 @@
1
- import { OptionRow } from './chunk-GTHJWR3Q.js';
2
- import { useFieldValidity, FieldGroupFrame } from './chunk-J2BCKBHC.js';
3
- import { MinusIcon, CheckIcon } from './chunk-24TO7E32.js';
4
- import { devWarn, warnNeedsName } from './chunk-GCVA3OIV.js';
1
+ import { OptionRow } from './chunk-D7EE5GWU.js';
2
+ import { useFieldValidity, FieldGroupFrame } from './chunk-5KSD4WKN.js';
3
+ import { MinusIcon, CheckIcon } from './chunk-BLIZ3CL3.js';
5
4
  import { cn } from './chunk-ZSNJ6UA3.js';
5
+ import { devWarn, warnNeedsName } from './chunk-QDYE5LVT.js';
6
6
  import { CheckboxGroup as CheckboxGroup$1 } from '@base-ui/react/checkbox-group';
7
7
  import * as React3 from 'react';
8
8
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
@@ -188,5 +188,5 @@ function CheckboxGroup(props) {
188
188
  CheckboxGroup.displayName = "CheckboxGroup";
189
189
 
190
190
  export { Checkbox, CheckboxGroup };
191
- //# sourceMappingURL=chunk-ZOOX3TUB.js.map
192
- //# sourceMappingURL=chunk-ZOOX3TUB.js.map
191
+ //# sourceMappingURL=chunk-5XPMY2LF.js.map
192
+ //# sourceMappingURL=chunk-5XPMY2LF.js.map
@@ -0,0 +1,147 @@
1
+ import { controlBoxClasses } from './chunk-X2VMIBK5.js';
2
+ import { useFieldValidity, FieldFrame, CONTROL_TEXT } from './chunk-5KSD4WKN.js';
3
+ import { CircleIcon, AsteriskIcon } from './chunk-BLIZ3CL3.js';
4
+ import { cn } from './chunk-ZSNJ6UA3.js';
5
+ import { warnPositiveInt } from './chunk-QDYE5LVT.js';
6
+ import { OTPField } from '@base-ui/react/otp-field';
7
+ import * as React from 'react';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
9
+
10
+ var BOX_SIZE = { sm: "size-9", md: "size-10", lg: "size-11" };
11
+ var BOX_GAP = { sm: "gap-1.5", md: "gap-2", lg: "gap-2" };
12
+ var MASK_GLYPH_SIZE = {
13
+ dot: { sm: "size-1.5", md: "size-2", lg: "size-2.5" },
14
+ star: { sm: "size-3.5", md: "size-4", lg: "size-4.5" }
15
+ };
16
+ function VerificationCodeInput(props) {
17
+ const {
18
+ length,
19
+ size = "md",
20
+ value,
21
+ defaultValue,
22
+ onValueChange,
23
+ onComplete,
24
+ validationType = "numeric",
25
+ mask = false,
26
+ autoSubmit = false,
27
+ readOnly = false,
28
+ label,
29
+ tooltip,
30
+ tooltipDescription,
31
+ hint,
32
+ required = false,
33
+ hideRequiredIndicator = false,
34
+ invalid = false,
35
+ error,
36
+ disabled = false,
37
+ fullWidth = true,
38
+ name,
39
+ id,
40
+ className,
41
+ ...rest
42
+ } = props;
43
+ const groups = React.useMemo(() => typeof length === "number" ? [length] : length, [length]);
44
+ const total = React.useMemo(() => groups.reduce((n, g) => n + g, 0), [groups]);
45
+ for (const g of groups) warnPositiveInt("VerificationCodeInput", "length", g);
46
+ const { isInvalid, showError } = useFieldValidity(invalid, error);
47
+ const slotClass = cn(
48
+ controlBoxClasses({ size, invalid: isInvalid, disabled, focus: "self" }),
49
+ BOX_SIZE[size],
50
+ // `shrink-0` is what keeps a slot SQUARE — without it the row's flex children compress and the
51
+ // boxes turn into rectangles in any narrow parent. It also raises the row's min-content to
52
+ // (total × box + gaps): measured 280px for a 6-slot md row.
53
+ //
54
+ // What that buys, MEASURED in a 200px flex row rather than assumed, because the two halves of
55
+ // `fullWidth` behave differently and only one of them is the "floor" story:
56
+ // · `fullWidth={false}` (`w-auto`) — the column floors at 280px. `min-width: auto` resolves to
57
+ // the content-based minimum, which is exactly what `shrink-0` raised.
58
+ // · `fullWidth` (default, `w-full`) — the column is 200px and the ROW overflows it. A definite
59
+ // `width` caps the flex item's automatic minimum at the specified-size suggestion, so the
60
+ // column cannot floor. The boxes still measure 40px, which is the guarantee that matters.
61
+ // NEVER a flat `min-w-*` on the column either way: an explicit min-width REPLACES `min-width:
62
+ // auto` and LOWERS the floor (measured on Input: 205 → 112). See control-size.ts's BAR_MIN_W note.
63
+ "shrink-0 appearance-none",
64
+ // A deliberate deviation from <Input>'s left-aligned normal-weight value, documented in the
65
+ // spec: a lone digit centred in a 40px square reads thin at normal weight, and `tabular-nums`
66
+ // is load-bearing — without it `1` and `0` have different advance widths and the digits
67
+ // visibly jitter box to box.
68
+ "text-center font-medium tabular-nums",
69
+ // Masked: the slot is still `type="password"` (so the character is unreadable and uncopyable),
70
+ // but its bullets are painted out and OUR glyph is drawn over the box — a browser gives no way
71
+ // to choose that glyph, and picks a different one per platform. `caret-*` is load-bearing:
72
+ // the caret defaults to `currentColor`, which `text-transparent` would otherwise erase.
73
+ mask !== false && "text-transparent caret-text-primary"
74
+ );
75
+ const maskedSlot = mask === false ? void 0 : (inputProps, state) => /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex shrink-0", BOX_SIZE[size]), children: [
76
+ /* @__PURE__ */ jsx("input", { ...inputProps }),
77
+ state.filled ? (
78
+ // The component's OWN fixed glyph, not a caller slot: it stays `aria-hidden` (the
79
+ // value is announced by the input itself) and never goes through `<Slot>`.
80
+ // `opacity-50` is repeated here because `controlBoxClasses`'s disabled fade lands on
81
+ // the <input>, and this span is its SIBLING.
82
+ /* @__PURE__ */ jsx(
83
+ "span",
84
+ {
85
+ "aria-hidden": "true",
86
+ className: cn("pointer-events-none absolute inset-0 flex items-center justify-center text-primary", disabled && "opacity-50"),
87
+ children: mask === "dot" ? /* @__PURE__ */ jsx(CircleIcon, { className: cn(MASK_GLYPH_SIZE.dot[size], "fill-current") }) : /* @__PURE__ */ jsx(AsteriskIcon, { className: MASK_GLYPH_SIZE.star[size] })
88
+ }
89
+ )
90
+ ) : null
91
+ ] });
92
+ let slot = 0;
93
+ return /* @__PURE__ */ jsx(
94
+ FieldFrame,
95
+ {
96
+ label,
97
+ tooltip,
98
+ tooltipDescription,
99
+ hint,
100
+ error,
101
+ isInvalid,
102
+ showError,
103
+ required,
104
+ hideRequiredIndicator,
105
+ size,
106
+ disabled,
107
+ fullWidth,
108
+ className,
109
+ children: /* @__PURE__ */ jsx(
110
+ OTPField.Root,
111
+ {
112
+ length: total,
113
+ value,
114
+ defaultValue,
115
+ onValueChange: (next) => onValueChange?.(next),
116
+ onValueComplete: (next) => onComplete?.(next),
117
+ validationType,
118
+ mask: mask !== false,
119
+ autoSubmit,
120
+ readOnly,
121
+ required,
122
+ disabled,
123
+ name,
124
+ id,
125
+ className: cn("flex items-center", BOX_GAP[size]),
126
+ ...rest,
127
+ children: groups.map((count, g) => (
128
+ // The index IS the identity here — a group is defined by its position in `length`.
129
+ /* @__PURE__ */ jsxs(React.Fragment, { children: [
130
+ g > 0 ? (
131
+ // Decorative: a dash between digit groups adds nothing for a screen reader, and the
132
+ // value it separates is already announced per slot. Base UI re-exports a `Separator`
133
+ // with `role="separator"`; this is the same shape DateInput's segment separator uses.
134
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("px-0.5 text-fg-quaternary", CONTROL_TEXT[size]), children: "\u2013" })
135
+ ) : null,
136
+ Array.from({ length: count }, () => /* @__PURE__ */ jsx(OTPField.Input, { className: slotClass, render: maskedSlot }, slot++))
137
+ ] }, g)
138
+ ))
139
+ }
140
+ )
141
+ }
142
+ );
143
+ }
144
+
145
+ export { VerificationCodeInput };
146
+ //# sourceMappingURL=chunk-5ZEUTSCV.js.map
147
+ //# sourceMappingURL=chunk-5ZEUTSCV.js.map
@@ -0,0 +1,19 @@
1
+ // src/lib/drag-ghost.ts
2
+ var GHOST_OFFSET = 12;
3
+ var DRAG_GHOST = "pointer-events-none fixed z-50 rounded-lg bg-primary_alt shadow-lg ring-1 ring-secondary ring-inset";
4
+ var dragGhostProps = { "aria-hidden": true, "data-drag-ghost": "" };
5
+ function ghostPosition(point, width, height = GHOST_OFFSET * 4) {
6
+ if (globalThis.window === void 0) return { left: point.x + GHOST_OFFSET, top: point.y + GHOST_OFFSET };
7
+ const left = Math.min(point.x + GHOST_OFFSET, globalThis.innerWidth - width - GHOST_OFFSET);
8
+ const top = Math.min(point.y + GHOST_OFFSET, globalThis.innerHeight - height);
9
+ return { left: Math.max(GHOST_OFFSET, left), top: Math.max(GHOST_OFFSET, top) };
10
+ }
11
+
12
+ // src/lib/drop-line.ts
13
+ var DROP_LINE = "pointer-events-none rounded-full bg-brand-solid";
14
+ var DROP_LINE_Y = "h-0.5";
15
+ var DROP_LINE_X = "w-0.5";
16
+
17
+ export { DRAG_GHOST, DROP_LINE, DROP_LINE_X, DROP_LINE_Y, dragGhostProps, ghostPosition };
18
+ //# sourceMappingURL=chunk-5ZPUAGOP.js.map
19
+ //# sourceMappingURL=chunk-5ZPUAGOP.js.map