jenosize-ui 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +10 -7
  2. package/dist/Cartesian-ZIKPEYWP.d.ts +26 -0
  3. package/dist/area-chart.d.ts +53 -0
  4. package/dist/area-chart.js +8 -0
  5. package/dist/avatar.d.ts +19 -0
  6. package/dist/avatar.js +12 -7
  7. package/dist/badge.js +5 -5
  8. package/dist/bar-chart.d.ts +31 -0
  9. package/dist/bar-chart.js +8 -0
  10. package/dist/breadcrumb.js +3 -3
  11. package/dist/button.d.ts +11 -1
  12. package/dist/button.js +9 -8
  13. package/dist/calendar.js +14 -12
  14. package/dist/callout.js +10 -9
  15. package/dist/card.d.ts +52 -2
  16. package/dist/card.js +6 -2
  17. package/dist/checkbox.js +6 -5
  18. package/dist/chunk-34J5AANZ.js +605 -0
  19. package/dist/{chunk-D6TPWNRK.js → chunk-3GT43XPK.js} +5 -5
  20. package/dist/{chunk-3Y5X7B5C.js → chunk-3Z3SDKIA.js} +6 -11
  21. package/dist/{chunk-MQGD2OUF.js → chunk-42FCPC77.js} +3 -3
  22. package/dist/{chunk-Z3ETJN5G.js → chunk-4BRMM3I5.js} +6 -11
  23. package/dist/{chunk-WZQFC7ZN.js → chunk-4HKDD3PR.js} +55 -16
  24. package/dist/chunk-4K6V6NNK.js +169 -0
  25. package/dist/{chunk-ZZA2LUTL.js → chunk-4R7WDDCW.js} +41 -16
  26. package/dist/{chunk-BJUZVYQC.js → chunk-4W6AYGLR.js} +12 -12
  27. package/dist/{chunk-4OLULPQG.js → chunk-54S5CUY6.js} +8 -5
  28. package/dist/{chunk-GRLSUQQE.js → chunk-5JRM3OES.js} +4 -4
  29. package/dist/chunk-5ZPUAGOP.js +19 -0
  30. package/dist/{chunk-W5GGOUUI.js → chunk-6HJA7NPL.js} +3 -3
  31. package/dist/{chunk-CME4DIML.js → chunk-6IUTVDNI.js} +22 -3
  32. package/dist/chunk-6UBYHSBX.js +147 -0
  33. package/dist/{chunk-HMUZE6EK.js → chunk-74HPBSVY.js} +3 -3
  34. package/dist/chunk-75M43ELV.js +366 -0
  35. package/dist/chunk-763VS2FY.js +10 -0
  36. package/dist/chunk-7HV6EIGZ.js +26 -0
  37. package/dist/chunk-7VLYQR4D.js +44 -0
  38. package/dist/{chunk-D5BTFSL7.js → chunk-A46ED5JQ.js} +3 -3
  39. package/dist/{chunk-W46K56XU.js → chunk-A5WQLN4B.js} +8 -24
  40. package/dist/chunk-AC6ZWKRN.js +23 -0
  41. package/dist/{chunk-E7ZSWBAK.js → chunk-BD5YKFRA.js} +4 -4
  42. package/dist/chunk-BLIZ3CL3.js +49 -0
  43. package/dist/{chunk-DRZCJCBO.js → chunk-BNIWT6CW.js} +4 -4
  44. package/dist/{chunk-JVJRHBTD.js → chunk-C6OTOTKI.js} +21 -8
  45. package/dist/chunk-CTENRS34.js +60 -0
  46. package/dist/{chunk-7IU5TMFL.js → chunk-CWMFEF6R.js} +75 -27
  47. package/dist/{chunk-JTNFJLIY.js → chunk-DCGTB7P7.js} +13 -13
  48. package/dist/{chunk-GFOAJVW5.js → chunk-DJYWPJZ3.js} +3 -3
  49. package/dist/{chunk-MUFHLP4S.js → chunk-DTMYD63D.js} +11 -22
  50. package/dist/{chunk-KDLPXXD2.js → chunk-EDOUI2BG.js} +4 -4
  51. package/dist/{chunk-R6RGJF4L.js → chunk-EDT5J5WK.js} +4 -4
  52. package/dist/{chunk-PWKWNDBS.js → chunk-EX374YWB.js} +6 -6
  53. package/dist/{chunk-F2K7VJUV.js → chunk-FFTRB2UU.js} +4 -4
  54. package/dist/chunk-FIGBJGH2.js +1474 -0
  55. package/dist/chunk-FKVPAEJ6.js +57 -0
  56. package/dist/{chunk-J7ZQQFPT.js → chunk-FZBZGA3P.js} +17 -17
  57. package/dist/{chunk-T7FCG7XV.js → chunk-GAFGIT4Q.js} +10 -10
  58. package/dist/chunk-HSVBTIP2.js +482 -0
  59. package/dist/{chunk-FHHAPGCR.js → chunk-ILICYNK7.js} +3 -3
  60. package/dist/{chunk-WFY7DKQD.js → chunk-JAVNGTOE.js} +9 -14
  61. package/dist/{chunk-7HOIZ3UO.js → chunk-JMWYCT63.js} +6 -6
  62. package/dist/{chunk-QA74ITR4.js → chunk-JUWDRRD6.js} +45 -17
  63. package/dist/{chunk-BVJWBYIG.js → chunk-JXHZHUB3.js} +4 -4
  64. package/dist/{chunk-VWC72TR3.js → chunk-JYBGO6GY.js} +7 -7
  65. package/dist/{chunk-J36M3KRX.js → chunk-L53Y7KUV.js} +13 -11
  66. package/dist/chunk-LBYCCLVI.js +33 -0
  67. package/dist/chunk-LCG34A5T.js +98 -0
  68. package/dist/chunk-M5TVCASC.js +75 -0
  69. package/dist/chunk-MCUASLZH.js +10 -0
  70. package/dist/{chunk-5RAPA22E.js → chunk-MD4AR43X.js} +4 -4
  71. package/dist/{chunk-JP26LPCY.js → chunk-MYQ3FD4Y.js} +25 -11
  72. package/dist/chunk-NA35YZRD.js +252 -0
  73. package/dist/chunk-NKDW6C7K.js +10 -0
  74. package/dist/{chunk-5NOBSXJN.js → chunk-NMERLWT7.js} +6 -6
  75. package/dist/{chunk-KMSYEE23.js → chunk-P6CON2R2.js} +25 -11
  76. package/dist/{chunk-LME57Z6J.js → chunk-P7DH62UY.js} +6 -6
  77. package/dist/chunk-PO2TYK3C.js +17 -0
  78. package/dist/{chunk-5FATN5YD.js → chunk-PXEJ5RKO.js} +4 -4
  79. package/dist/{chunk-JYGR44ZC.js → chunk-QBHQOX23.js} +6 -6
  80. package/dist/{chunk-GCVA3OIV.js → chunk-QDYE5LVT.js} +13 -3
  81. package/dist/{chunk-J2BCKBHC.js → chunk-QKDEQFOQ.js} +4 -4
  82. package/dist/{chunk-ZOOX3TUB.js → chunk-RIXEUAPY.js} +5 -5
  83. package/dist/{chunk-THC2ISYP.js → chunk-RNXRZGXN.js} +4 -4
  84. package/dist/{chunk-7EWQKTNQ.js → chunk-T2WAD4QP.js} +15 -13
  85. package/dist/{chunk-KNYKWUYX.js → chunk-TBN644IN.js} +3 -3
  86. package/dist/{chunk-MKC5HNA7.js → chunk-USL3TDZM.js} +101 -90
  87. package/dist/{chunk-CYPPEUX5.js → chunk-VEOYCAJP.js} +4 -9
  88. package/dist/{chunk-WEUJYDCV.js → chunk-VH35QHD4.js} +6 -6
  89. package/dist/chunk-VWGAMOSE.js +188 -0
  90. package/dist/{chunk-SV56BSUQ.js → chunk-WKWAUU64.js} +4 -4
  91. package/dist/chunk-X2X7Q7NW.js +17 -0
  92. package/dist/{chunk-I7WU4GTY.js → chunk-YLEHYDXC.js} +5 -5
  93. package/dist/combobox.js +12 -10
  94. package/dist/control-size-CaxQhkKh.d.ts +3 -0
  95. package/dist/date-input.js +9 -8
  96. package/dist/date-picker.js +20 -17
  97. package/dist/dialog.d.ts +16 -4
  98. package/dist/dialog.js +8 -6
  99. package/dist/drawer.d.ts +9 -2
  100. package/dist/drawer.js +7 -5
  101. package/dist/dropdown-menu.d.ts +14 -2
  102. package/dist/dropdown-menu.js +7 -3
  103. package/dist/dropzone.d.ts +34 -0
  104. package/dist/dropzone.js +22 -0
  105. package/dist/form.d.ts +78 -0
  106. package/dist/form.js +176 -32
  107. package/dist/header-navigation.d.ts +15 -4
  108. package/dist/header-navigation.js +19 -14
  109. package/dist/index.d.ts +26 -4
  110. package/dist/index.js +76 -56
  111. package/dist/indicator.js +4 -4
  112. package/dist/input.js +8 -7
  113. package/dist/kanban-board.d.ts +549 -0
  114. package/dist/kanban-board.js +23 -0
  115. package/dist/line-chart.d.ts +35 -0
  116. package/dist/line-chart.js +8 -0
  117. package/dist/{nav-Bla0o_-1.d.ts → nav-DcCyt00p.d.ts} +8 -11
  118. package/dist/number-input.js +8 -7
  119. package/dist/pagination.js +12 -9
  120. package/dist/panel-El4oI68p.d.ts +9 -0
  121. package/dist/payment-input.js +8 -7
  122. package/dist/pie-chart.d.ts +60 -0
  123. package/dist/pie-chart.js +8 -0
  124. package/dist/popover.d.ts +9 -3
  125. package/dist/popover.js +7 -5
  126. package/dist/progress-steps.d.ts +275 -0
  127. package/dist/progress-steps.js +8 -0
  128. package/dist/progress.js +2 -2
  129. package/dist/radar-chart.d.ts +73 -0
  130. package/dist/radar-chart.js +8 -0
  131. package/dist/radial-chart.d.ts +69 -0
  132. package/dist/radial-chart.js +8 -0
  133. package/dist/radio.js +6 -5
  134. package/dist/rule-BqzaIwJy.d.ts +80 -0
  135. package/dist/scroll-area.d.ts +62 -0
  136. package/dist/scroll-area.js +7 -0
  137. package/dist/select.d.ts +1 -2
  138. package/dist/select.js +15 -13
  139. package/dist/separator.d.ts +114 -0
  140. package/dist/separator.js +5 -0
  141. package/dist/sidebar-navigation.d.ts +54 -7
  142. package/dist/sidebar-navigation.js +15 -8
  143. package/dist/skeleton.d.ts +61 -0
  144. package/dist/skeleton.js +5 -0
  145. package/dist/styles.css +1 -1
  146. package/dist/surface-DFyDnrTJ.d.ts +34 -0
  147. package/dist/switch.js +2 -2
  148. package/dist/table.d.ts +94 -38
  149. package/dist/table.js +32 -28
  150. package/dist/tabs.js +2 -2
  151. package/dist/tag-input.js +11 -10
  152. package/dist/tag.js +3 -3
  153. package/dist/textarea.js +6 -5
  154. package/dist/theme.css +82 -0
  155. package/dist/theme.js +10 -9
  156. package/dist/toast.js +10 -9
  157. package/dist/tooltip-surface-Dmvb8v5K.d.ts +35 -0
  158. package/dist/tooltip.d.ts +15 -1
  159. package/dist/tooltip.js +3 -2
  160. package/dist/tree.js +6 -5
  161. package/dist/types-6kvYwtRH.d.ts +156 -0
  162. package/dist/use-uploads-ButS4dGe.d.ts +473 -0
  163. package/dist/verification-code-input.d.ts +84 -0
  164. package/dist/verification-code-input.js +13 -0
  165. package/package.json +59 -9
  166. package/dist/card-nWicloNi.d.ts +0 -80
  167. package/dist/chunk-24TO7E32.js +0 -42
  168. package/dist/chunk-FXIBGTS5.js +0 -14
  169. package/dist/chunk-ZZT2E5VT.js +0 -24
@@ -0,0 +1,605 @@
1
+ import { RULE_TONE, RULE_PAINT, RULE_TEXTURE } from './chunk-LCG34A5T.js';
2
+ import { SOLID, SOLID_BOX, SOLID_GLOSS, BOXED_BOX, BOX_RING } from './chunk-6IUTVDNI.js';
3
+ import { overflowClasses } from './chunk-DWKILXHE.js';
4
+ import { CheckIcon, XIcon, MinusIcon } from './chunk-BLIZ3CL3.js';
5
+ import { cn } from './chunk-ZSNJ6UA3.js';
6
+ import * as React3 from 'react';
7
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
+
9
+ // src/components/progress-steps/shared.ts
10
+ var STEP_SIZE = {
11
+ sm: { marker: "size-5", featured: "size-8", glyph: "size-2.5", featuredGlyph: "size-4", dot: "size-1.5", text: "text-xs", number: "text-xs", gap: "gap-2" },
12
+ md: { marker: "size-6", featured: "size-10", glyph: "size-3", featuredGlyph: "size-5", dot: "size-2", text: "text-sm", number: "text-xs", gap: "gap-3" },
13
+ lg: { marker: "size-8", featured: "size-12", glyph: "size-4", featuredGlyph: "size-6", dot: "size-2.5", text: "text-md", number: "text-sm", gap: "gap-3.5" }
14
+ };
15
+ var LIST = {
16
+ horizontal: "flex w-full flex-row items-start",
17
+ vertical: "flex flex-col"
18
+ };
19
+ var LIST_MINIMAL = {
20
+ horizontal: "flex w-full flex-row items-center justify-center",
21
+ vertical: "flex flex-col items-start"
22
+ };
23
+ var LIST_MINIMAL_GAP = "gap-3";
24
+ var LIST_BAR = "gap-4";
25
+ var ITEM = {
26
+ horizontal: "relative flex min-w-0 flex-1 basis-0 flex-col",
27
+ // `pb` is the connector's runway: the bar lives INSIDE the row (a full-bleed row cannot keep a
28
+ // guide drawn between rows), so the row must be tall enough to hold it.
29
+ vertical: "relative flex flex-row pb-6 last:pb-0"
30
+ };
31
+ var ITEM_MINIMAL = {
32
+ horizontal: "relative flex shrink-0 flex-row items-center",
33
+ vertical: "relative flex shrink-0 flex-row pb-6 last:pb-0"
34
+ };
35
+ var MARKER_BASE = "relative flex shrink-0 items-center justify-center rounded-full transition-colors";
36
+ var MARKER_STATUS = {
37
+ // Measured: white surface, `inset 0 0 0 1.5px` neutral-300, inner dot neutral-400.
38
+ incomplete: {
39
+ box: "bg-primary ring-[1.5px] ring-inset ring-primary",
40
+ glyph: "text-fg-quaternary",
41
+ label: "text-secondary",
42
+ description: "text-tertiary"
43
+ },
44
+ // The fill is the brand solid; the dot/glyph go white. The HALO is added separately (MARKER_HALO)
45
+ // so it can also ride a marker whose status resolved to `complete`.
46
+ current: {
47
+ box: "bg-brand-solid ring-0",
48
+ glyph: "text-fg-white",
49
+ label: "text-brand-secondary",
50
+ // brand-600 in light; our token deliberately relaxes to neutral-400 in dark (see 02-measure
51
+ // delta 5 — the token as designed, not a component-local exception).
52
+ description: "text-brand-tertiary"
53
+ },
54
+ complete: {
55
+ box: "bg-brand-solid ring-0",
56
+ glyph: "text-fg-white",
57
+ label: "text-secondary",
58
+ description: "text-tertiary"
59
+ },
60
+ // Not in the reference — the house error tone from `lib/color.ts`'s SOLID axis, so a failed step
61
+ // reads the same as every other error surface in the library.
62
+ error: {
63
+ box: "bg-error-solid ring-0",
64
+ glyph: "text-fg-white",
65
+ label: "text-error-primary",
66
+ description: "text-error-primary"
67
+ },
68
+ // Muted all the way down: a skipped step is present but inert, so it must not compete with the
69
+ // incomplete steps the user still has to do.
70
+ skipped: {
71
+ box: "bg-secondary ring-[1.5px] ring-inset ring-secondary",
72
+ glyph: "text-fg-disabled",
73
+ label: "text-quaternary",
74
+ description: "text-quaternary"
75
+ }
76
+ };
77
+ var MARKER_HALO = "shadow-[0_0_0_2px_var(--color-bg-primary),0_0_0_4px_var(--color-fg-brand-secondary)]";
78
+ var FEATURED_BASE = "relative flex shrink-0 items-center justify-center rounded-lg transition-colors";
79
+ var FEATURED_BOX = {
80
+ incomplete: cn(BOXED_BOX, BOX_RING.neutral),
81
+ current: cn(SOLID.brand, SOLID_BOX, SOLID_GLOSS),
82
+ complete: cn(SOLID.brand, SOLID_BOX, SOLID_GLOSS),
83
+ error: cn(SOLID.error, SOLID_BOX, SOLID_GLOSS),
84
+ // No `shadow-*` at all — the rail is read-only, and a skipped step is the one status that should not
85
+ // read as a control even in the variant whose whole point is looking like one.
86
+ skipped: "bg-secondary ring-1 ring-inset ring-secondary"
87
+ };
88
+ var FEATURED_HALO = "shadow-[0_1px_2px_0_oklch(0_0_0/0.05),inset_0_0_0_1px_oklch(0_0_0/0.18),inset_0_-2px_0_0_oklch(0_0_0/0.05),0_0_0_2px_var(--color-bg-primary),0_0_0_4px_var(--color-fg-brand-secondary)]";
89
+ var BAR = {
90
+ horizontal: "pointer-events-none absolute inset-x-0 top-0 h-1",
91
+ vertical: "pointer-events-none absolute inset-y-0 left-0 w-1"
92
+ };
93
+ var ITEM_BAR = {
94
+ horizontal: "relative flex min-w-0 flex-1 basis-0 flex-col",
95
+ vertical: "relative flex flex-row"
96
+ };
97
+ var BAR_ALONE = {
98
+ horizontal: { sm: "min-h-1", md: "min-h-1", lg: "min-h-1" },
99
+ vertical: { sm: "min-h-5", md: "min-h-6", lg: "min-h-8" }
100
+ };
101
+ var BAR_STATUS = {
102
+ incomplete: "bg-quaternary",
103
+ current: "bg-brand-solid",
104
+ complete: "bg-brand-solid",
105
+ error: "bg-error-solid",
106
+ skipped: "bg-tertiary"
107
+ };
108
+ var BAR_BODY = {
109
+ horizontal: "flex-col items-start pt-3 text-left",
110
+ vertical: "flex-col items-start pl-3 text-left"
111
+ };
112
+ var CONNECTOR_BASE = "pointer-events-none absolute z-0 rounded-sm";
113
+ var CONNECTOR = {
114
+ // marker 20 / 24 / 32 → radius 10 / 12 / 16.
115
+ horizontal: {
116
+ sm: "top-[9px] left-[50%] right-[-50%]",
117
+ md: "top-[11px] left-[50%] right-[-50%]",
118
+ lg: "top-[15px] left-[50%] right-[-50%]"
119
+ },
120
+ // Runs down the marker column, from this marker's centre to the next row's marker centre.
121
+ vertical: {
122
+ sm: "left-[9px] top-[10px] bottom-[-10px]",
123
+ md: "left-[11px] top-[12px] bottom-[-12px]",
124
+ lg: "left-[15px] top-[16px] bottom-[-16px]"
125
+ }
126
+ };
127
+ var CONNECTOR_FEATURED = {
128
+ horizontal: {
129
+ sm: "top-[15px] left-[50%] right-[-50%]",
130
+ md: "top-[19px] left-[50%] right-[-50%]",
131
+ lg: "top-[23px] left-[50%] right-[-50%]"
132
+ },
133
+ vertical: {
134
+ sm: "left-[15px] top-[16px] bottom-[-16px]",
135
+ md: "left-[19px] top-[20px] bottom-[-20px]",
136
+ lg: "left-[23px] top-[24px] bottom-[-24px]"
137
+ }
138
+ };
139
+ var CONNECTOR_WEIGHT = {
140
+ line: { horizontal: "h-0.5", vertical: "w-0.5" },
141
+ dot: { horizontal: "h-[3px]", vertical: "w-[3px]" },
142
+ dashed: { horizontal: "h-0.5", vertical: "w-0.5" }
143
+ };
144
+ var CONNECTOR_MINIMAL = {
145
+ sm: "relative w-16",
146
+ md: "relative w-20",
147
+ lg: "relative w-24"
148
+ };
149
+ var CONNECTOR_TONE = {
150
+ done: "[--rule:var(--color-fg-brand-secondary)]",
151
+ todo: RULE_TONE.default
152
+ };
153
+ var STEP_DISABLED = "[&_[data-step-glyph]]:opacity-50 [&_[data-step-text]]:opacity-50";
154
+ var stepLabelId = (baseId, value) => `${baseId}-label-${value}`;
155
+ var STATUS_WORD = {
156
+ incomplete: "",
157
+ current: "current step",
158
+ complete: "completed",
159
+ error: "error",
160
+ skipped: "skipped"
161
+ };
162
+ function statusGlyph(status, className) {
163
+ if (status === "complete") return /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": true, className });
164
+ if (status === "error") return /* @__PURE__ */ jsx(XIcon, { "aria-hidden": true, className });
165
+ if (status === "skipped") return /* @__PURE__ */ jsx(MinusIcon, { "aria-hidden": true, className });
166
+ return null;
167
+ }
168
+ function Step(props) {
169
+ const { item, index, total, status, isCurrent, error, baseId, marker, labels, size, orientation } = props;
170
+ const geo = STEP_SIZE[size];
171
+ const tone = MARKER_STATUS[status];
172
+ const featured = marker === "featured";
173
+ const bar = marker === "bar";
174
+ const horizontal = orientation === "horizontal";
175
+ const centered = horizontal && !bar;
176
+ const overflow = overflowClasses(horizontal ? "truncate" : "wrap", { shrinkRoot: false });
177
+ const number = index + 1;
178
+ const statusWord = STATUS_WORD[status];
179
+ const name = [item.label, `step ${number} of ${total}`, statusWord, status === "error" ? error : null].filter(Boolean).join(", ");
180
+ const glyphTone = tone.glyph;
181
+ const glyphSize = featured ? geo.featuredGlyph : geo.glyph;
182
+ const glyph = statusGlyph(status, cn(glyphSize, glyphTone));
183
+ const inner = (() => {
184
+ if (glyph) return glyph;
185
+ if (marker === "dot") return /* @__PURE__ */ jsx("span", { className: cn(geo.dot, "rounded-full bg-current", glyphTone) });
186
+ if ((marker === "icon" || featured) && item.icon != null)
187
+ return /* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", glyphSize, glyphTone, "[&>svg]:size-full"), children: item.icon });
188
+ return /* @__PURE__ */ jsx("span", { className: cn("font-semibold tabular-nums", geo.number, glyphTone), children: number });
189
+ })();
190
+ const markerNode = bar ? null : /* @__PURE__ */ jsx(
191
+ "span",
192
+ {
193
+ "aria-hidden": true,
194
+ "data-step-glyph": true,
195
+ className: cn(
196
+ featured ? FEATURED_BASE : MARKER_BASE,
197
+ featured ? geo.featured : geo.marker,
198
+ // The FILL and the HALO are the same decision for both shapes; only the box LAYERS differ,
199
+ // because `featured` wears the button box (`FEATURED_BOX` maps each status onto the Button
200
+ // variant it corresponds to) while a round marker wears a bare fill.
201
+ featured ? FEATURED_BOX[status] : tone.box,
202
+ isCurrent && (featured ? FEATURED_HALO : MARKER_HALO)
203
+ ),
204
+ children: inner
205
+ }
206
+ );
207
+ const text = !labels ? null : /* @__PURE__ */ jsxs("span", { "data-step-text": true, className: cn("flex min-w-0 flex-col", centered ? "w-full items-center" : "items-start", bar && "w-full"), children: [
208
+ /* @__PURE__ */ jsx("span", { id: stepLabelId(baseId, item.value), className: cn("max-w-full font-semibold", geo.text, tone.label, overflow.label), children: item.label }),
209
+ item.description == null ? null : /* @__PURE__ */ jsx("span", { className: cn("max-w-full", geo.text, tone.description, overflow.label, horizontal && "hidden md:block"), children: item.description })
210
+ ] });
211
+ const body = /* @__PURE__ */ jsxs(
212
+ "span",
213
+ {
214
+ className: cn(
215
+ "relative z-1 flex",
216
+ // With no text there is nothing to fill, and a `w-full` inside a shrink-to-fit cell is a
217
+ // width resolving against its own content.
218
+ labels && "w-full",
219
+ bar ? BAR_BODY[orientation] : centered ? "flex-col items-center text-center" : "flex-row items-start text-left",
220
+ !bar && geo.gap,
221
+ overflow.root
222
+ ),
223
+ children: [
224
+ markerNode,
225
+ text
226
+ ]
227
+ }
228
+ );
229
+ const shell = cn("-my-1 flex rounded-md py-1", centered || bar ? "px-0" : "-mx-1 px-1", labels && "w-full", item.disabled && STEP_DISABLED, item.className);
230
+ return /* @__PURE__ */ jsxs("span", { "aria-current": isCurrent ? "step" : void 0, className: shell, children: [
231
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: name }),
232
+ body
233
+ ] });
234
+ }
235
+ function ProgressSteps(props) {
236
+ const { steps, marker = "number", labels = true, connector = "line", orientation = "horizontal", size = "md", className } = props;
237
+ const ariaLabel = props["aria-label"] ?? "Progress";
238
+ const { items, current, statusOf, errors, id: baseId } = steps;
239
+ const total = items.length;
240
+ const featured = marker === "featured";
241
+ const horizontal = orientation === "horizontal";
242
+ const bar = marker === "bar";
243
+ const drawConnector = !bar && connector !== "none";
244
+ const connectorTable = featured ? CONNECTOR_FEATURED : CONNECTOR;
245
+ const minimal = !labels && !bar;
246
+ const minimalRow = minimal && horizontal;
247
+ const axis = orientation === "vertical" ? "x" : "y";
248
+ const connectorPaint = drawConnector ? cn(RULE_PAINT[axis], RULE_TEXTURE[connector][axis]) : "";
249
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", className), children: [
250
+ /* @__PURE__ */ jsx(
251
+ "ol",
252
+ {
253
+ "aria-label": ariaLabel,
254
+ "data-orientation": orientation,
255
+ "data-size": size,
256
+ className: cn(
257
+ minimal ? LIST_MINIMAL[orientation] : LIST[orientation],
258
+ // The bars tile the rail, so their gap is the rail's; every other layout leaves that space
259
+ // to the connector, and a flex gap on top of a line reads as a break in it.
260
+ bar && LIST_BAR,
261
+ minimalRow && !drawConnector && LIST_MINIMAL_GAP
262
+ ),
263
+ children: items.map((item, i) => {
264
+ const status = statusOf(item.value);
265
+ const isCurrent = item.value === current;
266
+ const last = i === total - 1;
267
+ const done = status === "complete";
268
+ return /* @__PURE__ */ jsxs(
269
+ "li",
270
+ {
271
+ "data-status": status,
272
+ className: cn(
273
+ bar ? ITEM_BAR[orientation] : minimal ? ITEM_MINIMAL[orientation] : ITEM[orientation],
274
+ bar && !labels && BAR_ALONE[orientation][size],
275
+ // A featured box is 16px taller than a round marker, so a vertical row needs that
276
+ // much more runway before the next one starts.
277
+ featured && orientation === "vertical" && "pb-8"
278
+ ),
279
+ children: [
280
+ bar ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-step-connector": true, className: cn(BAR[orientation], BAR_STATUS[status]) }) : null,
281
+ /* @__PURE__ */ jsx(
282
+ Step,
283
+ {
284
+ item,
285
+ index: i,
286
+ total,
287
+ status,
288
+ isCurrent,
289
+ error: errors.get(item.value),
290
+ baseId,
291
+ marker,
292
+ labels,
293
+ size,
294
+ orientation
295
+ }
296
+ ),
297
+ last || !drawConnector ? null : /* @__PURE__ */ jsx(
298
+ "span",
299
+ {
300
+ "aria-hidden": true,
301
+ "data-step-connector": true,
302
+ className: cn(
303
+ minimalRow ? CONNECTOR_MINIMAL[size] : cn(CONNECTOR_BASE, connectorTable[orientation][size]),
304
+ // Thickness is the TEXTURE's, not the size's: `dot` needs a px more than its own
305
+ // diameter to survive device-pixel snapping (`src/lib/rule.ts`).
306
+ CONNECTOR_WEIGHT[connector][orientation],
307
+ connectorPaint,
308
+ done ? CONNECTOR_TONE.done : CONNECTOR_TONE.todo
309
+ )
310
+ }
311
+ )
312
+ ]
313
+ },
314
+ item.value
315
+ );
316
+ })
317
+ }
318
+ ),
319
+ /* @__PURE__ */ jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: errors.get(current) ?? "" })
320
+ ] });
321
+ }
322
+ ProgressSteps.displayName = "ProgressSteps";
323
+ function LazyContent({ render }) {
324
+ const cached = React3.useRef(null);
325
+ if (cached.current === null) cached.current = { node: render() };
326
+ return /* @__PURE__ */ jsx(Fragment, { children: cached.current.node });
327
+ }
328
+ function resolveContent(item) {
329
+ if (typeof item.content === "function") return /* @__PURE__ */ jsx(LazyContent, { render: item.content });
330
+ return item.content;
331
+ }
332
+ function StepPanel(props) {
333
+ const { steps, mount = "visited", className } = props;
334
+ const { items, current, visited, id: baseId } = steps;
335
+ const shouldMount = (value) => {
336
+ if (mount === "all") return true;
337
+ if (mount === "current") return value === current;
338
+ return visited.has(value);
339
+ };
340
+ return (
341
+ // `min-w-0` because a panel beside a VERTICAL rail is a flex item, and its automatic minimum
342
+ // size would otherwise floor it at its content's min-content width and squeeze the rail.
343
+ /* @__PURE__ */ jsx("div", { className: cn("min-w-0", className), children: items.map((item) => {
344
+ if (!shouldMount(item.value)) return null;
345
+ const active = item.value === current;
346
+ return /* @__PURE__ */ jsx(
347
+ "div",
348
+ {
349
+ role: "region",
350
+ "aria-labelledby": stepLabelId(baseId, item.value),
351
+ hidden: !active,
352
+ "data-step": item.value,
353
+ children: resolveContent(item)
354
+ },
355
+ item.value
356
+ );
357
+ }) })
358
+ );
359
+ }
360
+ StepPanel.displayName = "StepPanel";
361
+
362
+ // src/components/progress-steps/steps.ts
363
+ function resolveStepStatus(args) {
364
+ const { value, current, completed, errors, override } = args;
365
+ if (errors.has(value)) return "error";
366
+ if (override) return override;
367
+ if (completed.has(value)) return "complete";
368
+ if (value === current) return "current";
369
+ return "incomplete";
370
+ }
371
+ function buildStepMap(items) {
372
+ const map = /* @__PURE__ */ new Map();
373
+ for (const item of items) map.set(item.value, item);
374
+ return map;
375
+ }
376
+ function firstEnabledStep(items) {
377
+ return (items.find((it) => !it.disabled) ?? items[0])?.value;
378
+ }
379
+ var EMPTY_SET = /* @__PURE__ */ new Set();
380
+ var EMPTY_MAP = /* @__PURE__ */ new Map();
381
+ var emptySet = () => EMPTY_SET;
382
+ var emptyMap = () => EMPTY_MAP;
383
+ var toSet = (v) => v === void 0 ? void 0 : v instanceof Set ? v : new Set(v);
384
+ function useSteps(options) {
385
+ const { items, onValueChange, onCompletedChange } = options;
386
+ const id = React3.useId();
387
+ const stepMap = React3.useMemo(() => buildStepMap(items), [items]);
388
+ const [valueState, setValueState] = React3.useState(() => options.defaultValue ?? firstEnabledStep(items) ?? "");
389
+ const requested = options.value ?? valueState;
390
+ const current = stepMap.has(requested) ? requested : firstEnabledStep(items) ?? requested;
391
+ const controlledCompleted = toSet(options.completed);
392
+ const [completedState, setCompletedState] = React3.useState(() => toSet(options.defaultCompleted) ?? emptySet());
393
+ const completed = controlledCompleted ?? completedState;
394
+ const [errors, setErrors] = React3.useState(() => emptyMap());
395
+ const [validating, setValidating] = React3.useState(false);
396
+ const latestValue = React3.useRef(current);
397
+ latestValue.current = current;
398
+ const latestCompleted = React3.useRef(completed);
399
+ latestCompleted.current = completed;
400
+ const latestErrors = React3.useRef(errors);
401
+ latestErrors.current = errors;
402
+ const stepMapRef = React3.useRef(stepMap);
403
+ stepMapRef.current = stepMap;
404
+ const busy = React3.useRef(false);
405
+ const mounted = React3.useRef(true);
406
+ React3.useEffect(() => {
407
+ mounted.current = true;
408
+ return () => {
409
+ mounted.current = false;
410
+ };
411
+ }, []);
412
+ const commitValue = React3.useCallback(
413
+ (next2) => {
414
+ latestValue.current = next2;
415
+ if (options.value === void 0) setValueState(next2);
416
+ onValueChange?.(next2);
417
+ },
418
+ [onValueChange, options.value]
419
+ );
420
+ const commitCompleted = React3.useCallback(
421
+ (next2) => {
422
+ let pruned = next2;
423
+ for (const v of next2) {
424
+ if (!stepMapRef.current.has(v)) {
425
+ pruned = new Set([...next2].filter((candidate) => stepMapRef.current.has(candidate)));
426
+ break;
427
+ }
428
+ }
429
+ latestCompleted.current = pruned;
430
+ if (controlledCompleted === void 0) setCompletedState(pruned);
431
+ onCompletedChange?.(pruned);
432
+ },
433
+ [controlledCompleted, onCompletedChange]
434
+ );
435
+ const commitErrors = React3.useCallback((next2) => {
436
+ let pruned = next2;
437
+ for (const v of next2.keys()) {
438
+ if (!stepMapRef.current.has(v)) {
439
+ pruned = new Map([...next2].filter(([candidate]) => stepMapRef.current.has(candidate)));
440
+ break;
441
+ }
442
+ }
443
+ latestErrors.current = pruned;
444
+ setErrors(pruned);
445
+ }, []);
446
+ React3.useEffect(() => {
447
+ const done = latestCompleted.current;
448
+ if ([...done].some((v) => !stepMap.has(v))) commitCompleted(done);
449
+ const errs = latestErrors.current;
450
+ if ([...errs.keys()].some((v) => !stepMap.has(v))) commitErrors(errs);
451
+ }, [stepMap, commitCompleted, commitErrors]);
452
+ const [visitedState, setVisitedState] = React3.useState(() => new Set(current ? [current] : []));
453
+ const visited = React3.useMemo(
454
+ () => visitedState.has(current) ? visitedState : /* @__PURE__ */ new Set([...visitedState, current]),
455
+ [visitedState, current]
456
+ );
457
+ React3.useEffect(() => {
458
+ if (visitedState !== visited) setVisitedState(visited);
459
+ }, [visited, visitedState]);
460
+ const attempt = React3.useCallback(
461
+ async (value) => {
462
+ const fn = stepMapRef.current.get(value)?.validate;
463
+ const pass = () => {
464
+ const base2 = latestCompleted.current;
465
+ if (!base2.has(value)) commitCompleted(new Set(base2).add(value));
466
+ const errs = latestErrors.current;
467
+ if (errs.has(value)) {
468
+ const next2 = new Map(errs);
469
+ next2.delete(value);
470
+ commitErrors(next2);
471
+ }
472
+ };
473
+ if (!fn) {
474
+ pass();
475
+ return true;
476
+ }
477
+ let message;
478
+ setValidating(true);
479
+ try {
480
+ message = await fn();
481
+ } finally {
482
+ if (mounted.current) setValidating(false);
483
+ }
484
+ if (!mounted.current) return false;
485
+ if (message == null || message === "") {
486
+ pass();
487
+ return true;
488
+ }
489
+ const base = latestCompleted.current;
490
+ if (base.has(value)) {
491
+ const next2 = new Set(base);
492
+ next2.delete(value);
493
+ commitCompleted(next2);
494
+ }
495
+ commitErrors(new Map(latestErrors.current).set(value, message));
496
+ return false;
497
+ },
498
+ [commitCompleted, commitErrors]
499
+ );
500
+ const enabledAfter = React3.useCallback(
501
+ (value) => {
502
+ const idx = items.findIndex((it) => it.value === value);
503
+ if (idx === -1) return void 0;
504
+ return items.slice(idx + 1).find((it) => !it.disabled)?.value;
505
+ },
506
+ [items]
507
+ );
508
+ const enabledBefore = React3.useCallback(
509
+ (value) => {
510
+ const idx = items.findIndex((it) => it.value === value);
511
+ if (idx === -1) return void 0;
512
+ for (let i = idx - 1; i >= 0; i--) {
513
+ const candidate = items[i];
514
+ if (candidate && !candidate.disabled) return candidate.value;
515
+ }
516
+ return void 0;
517
+ },
518
+ [items]
519
+ );
520
+ const next = React3.useCallback(async () => {
521
+ if (busy.current) return false;
522
+ const from = latestValue.current;
523
+ const target = enabledAfter(from);
524
+ if (target === void 0) return false;
525
+ busy.current = true;
526
+ try {
527
+ const ok = await attempt(from);
528
+ if (!ok) return false;
529
+ if (latestValue.current !== from) return false;
530
+ commitValue(target);
531
+ return true;
532
+ } finally {
533
+ busy.current = false;
534
+ }
535
+ }, [attempt, commitValue, enabledAfter]);
536
+ const back = React3.useCallback(() => {
537
+ const prev = enabledBefore(latestValue.current);
538
+ if (prev === void 0) return;
539
+ commitValue(prev);
540
+ }, [commitValue, enabledBefore]);
541
+ const goTo = React3.useCallback(
542
+ async (value) => {
543
+ if (busy.current) return false;
544
+ const from = latestValue.current;
545
+ if (value === from) return true;
546
+ if (stepMap.get(value)?.disabled) return false;
547
+ const fromIdx = items.findIndex((it) => it.value === from);
548
+ const toIdx = items.findIndex((it) => it.value === value);
549
+ if (toIdx > fromIdx && fromIdx !== -1) {
550
+ busy.current = true;
551
+ try {
552
+ for (let i = fromIdx; i < toIdx; i++) {
553
+ const step = items[i];
554
+ if (!step || step.disabled) continue;
555
+ const ok = await attempt(step.value);
556
+ if (!ok) {
557
+ if (latestValue.current === from) commitValue(step.value);
558
+ return false;
559
+ }
560
+ if (latestValue.current !== from) return false;
561
+ }
562
+ commitValue(value);
563
+ return true;
564
+ } finally {
565
+ busy.current = false;
566
+ }
567
+ }
568
+ commitValue(value);
569
+ return true;
570
+ },
571
+ [attempt, commitValue, items, stepMap]
572
+ );
573
+ const reset = React3.useCallback(() => {
574
+ commitValue(options.defaultValue ?? firstEnabledStep(items) ?? "");
575
+ commitCompleted(emptySet());
576
+ commitErrors(emptyMap());
577
+ }, [commitCompleted, commitErrors, commitValue, items, options.defaultValue]);
578
+ const statusOf = React3.useCallback(
579
+ (value) => resolveStepStatus({ value, current, completed, errors, override: stepMap.get(value)?.status }),
580
+ [completed, current, errors, stepMap]
581
+ );
582
+ const currentIndex = items.findIndex((it) => it.value === current);
583
+ return {
584
+ items,
585
+ id,
586
+ current,
587
+ currentIndex,
588
+ currentItem: stepMap.get(current),
589
+ completed,
590
+ errors,
591
+ isFirst: enabledBefore(current) === void 0,
592
+ isLast: enabledAfter(current) === void 0,
593
+ validating,
594
+ visited,
595
+ statusOf,
596
+ next,
597
+ back,
598
+ goTo,
599
+ reset
600
+ };
601
+ }
602
+
603
+ export { ProgressSteps, StepPanel, buildStepMap, firstEnabledStep, resolveStepStatus, useSteps };
604
+ //# sourceMappingURL=chunk-34J5AANZ.js.map
605
+ //# sourceMappingURL=chunk-34J5AANZ.js.map
@@ -1,7 +1,7 @@
1
1
  import { useControlScrollFade } from './chunk-7EUAMHMU.js';
2
- import { FieldShell } from './chunk-QA74ITR4.js';
3
- import { useFieldValidity, FieldFrame } from './chunk-J2BCKBHC.js';
4
- import { warnPositiveInt } from './chunk-GCVA3OIV.js';
2
+ import { FieldShell } from './chunk-JUWDRRD6.js';
3
+ import { useFieldValidity, FieldFrame } from './chunk-QKDEQFOQ.js';
4
+ import { warnPositiveInt } from './chunk-QDYE5LVT.js';
5
5
  import { cn } from './chunk-ZSNJ6UA3.js';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { Field } from '@base-ui/react/field';
@@ -383,5 +383,5 @@ function PaymentInput(props) {
383
383
  }
384
384
 
385
385
  export { CARD_ICON, DEFAULT_MAX_DIGITS, PaymentInput, applyCardNumberEdit, detectCardType, formatCardNumber, hasChecksumError, isCompleteCardNumber, isLengthSettled, luhnValid, onlyDigits };
386
- //# sourceMappingURL=chunk-D6TPWNRK.js.map
387
- //# sourceMappingURL=chunk-D6TPWNRK.js.map
386
+ //# sourceMappingURL=chunk-3GT43XPK.js.map
387
+ //# sourceMappingURL=chunk-3GT43XPK.js.map
@@ -1,8 +1,7 @@
1
- import { useControllableOpen } from './chunk-CYPPEUX5.js';
2
- import { PanelChrome } from './chunk-J7ZQQFPT.js';
3
- import { CloseButton } from './chunk-MQGD2OUF.js';
1
+ import { useControllableOpen } from './chunk-VEOYCAJP.js';
2
+ import { PanelChrome } from './chunk-FZBZGA3P.js';
3
+ import { CloseButton } from './chunk-42FCPC77.js';
4
4
  import { EXPLICIT_CLOSE, NO_RETURN_FOCUS } from './chunk-S7NNXWIN.js';
5
- import { useScrollFade } from './chunk-O2LG3PNI.js';
6
5
  import { POPUP_MOTION } from './chunk-O4GRKO3I.js';
7
6
  import { cn } from './chunk-ZSNJ6UA3.js';
8
7
  import { Popover as Popover$1 } from '@base-ui/react/popover';
@@ -37,8 +36,6 @@ function PopoverSurface(props) {
37
36
  closeReasonRef
38
37
  } = props;
39
38
  const ariaLabel = props["aria-label"];
40
- const bodyRef = React2.useRef(null);
41
- const { maskImage } = useScrollFade(bodyRef, { axis: "vertical" });
42
39
  return /* @__PURE__ */ jsx(Popover$1.Portal, { keepMounted, children: /* @__PURE__ */ jsx(Popover$1.Positioner, { side, align, sideOffset, alignOffset, className: "z-50 outline-none", children: /* @__PURE__ */ jsx(
43
40
  PanelChrome,
44
41
  {
@@ -54,8 +51,6 @@ function PopoverSurface(props) {
54
51
  titleScale: "md",
55
52
  footerAlign: "end",
56
53
  scrollBody: true,
57
- bodyRef,
58
- bodyMask: maskImage,
59
54
  dividers,
60
55
  title,
61
56
  description,
@@ -81,7 +76,7 @@ function Popover(props) {
81
76
  alignOffset = 0,
82
77
  size = "md",
83
78
  showClose = false,
84
- dividers = false,
79
+ dividers = "none",
85
80
  modal = false,
86
81
  keepMounted = false,
87
82
  dismissible = true,
@@ -142,5 +137,5 @@ function Popover(props) {
142
137
  Popover.displayName = "Popover";
143
138
 
144
139
  export { Popover };
145
- //# sourceMappingURL=chunk-3Y5X7B5C.js.map
146
- //# sourceMappingURL=chunk-3Y5X7B5C.js.map
140
+ //# sourceMappingURL=chunk-3Z3SDKIA.js.map
141
+ //# sourceMappingURL=chunk-3Z3SDKIA.js.map
@@ -1,4 +1,4 @@
1
- import { XIcon } from './chunk-24TO7E32.js';
1
+ import { XIcon } from './chunk-BLIZ3CL3.js';
2
2
  import { cn } from './chunk-ZSNJ6UA3.js';
3
3
  import { mergeProps } from '@base-ui/react/merge-props';
4
4
  import { useRender } from '@base-ui/react/use-render';
@@ -35,5 +35,5 @@ function CloseButton(props) {
35
35
  }
36
36
 
37
37
  export { CloseButton };
38
- //# sourceMappingURL=chunk-MQGD2OUF.js.map
39
- //# sourceMappingURL=chunk-MQGD2OUF.js.map
38
+ //# sourceMappingURL=chunk-42FCPC77.js.map
39
+ //# sourceMappingURL=chunk-42FCPC77.js.map