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
@@ -0,0 +1,188 @@
1
+ import { C as ChartLabels } from './labels-DPrh0se9.js';
2
+ import { T as TooltipTone } from './tooltip-surface-C2I9o2QM.js';
3
+
4
+ /**
5
+ * The public type surface for the chart family. No JSX, no recharts — `primitives.ts` alone names
6
+ * the engine, and nothing in here leaks its vocabulary.
7
+ *
8
+ * **This surface is frozen at phase 1.** The six components consume it; they do not extend it. If a
9
+ * component needs a field that is not here, it comes back to this file and the change is deliberate.
10
+ */
11
+
12
+ /**
13
+ * A mark's colour — **any CSS colour value**.
14
+ *
15
+ * ```tsx
16
+ * "#e11d48" · "oklch(62% .21 25)" · "var(--color-utility-blue-600)" · token("utility-blue-600")
17
+ * ```
18
+ *
19
+ * This used to be a closed union over the six hues `theme.css` declares, and the reason was
20
+ * mechanical rather than aesthetic: the colour travelled as a Tailwind CLASS
21
+ * (`text-utility-blue-600`) resolved by `fill="currentColor"`, Tailwind scans source text, and an
22
+ * undeclared or computed class emits nothing at all — no warning, no error, no gate, just an
23
+ * unpainted mark. So the vocabulary had to be closed, and `data` being an arbitrary-length array
24
+ * while `palette` held exactly six hues was the direct consequence.
25
+ *
26
+ * The colour now travels as a `style={{ color }}` VALUE instead (`src/components/chart/palette.ts`),
27
+ * so nothing has to be legible to a static scanner and the ceiling is gone. What is lost with the
28
+ * union is the compile-time guarantee, and it is bought back in two places rather than one:
29
+ * **`token()`** (`src/lib/token.ts`) is a closed generated union for every house colour, and a
30
+ * dev-mode tripwire warns on a value that is not a CSS colour at all. Neither can catch a
31
+ * misspelled `var(--nope)` — that is always valid CSS — which is exactly why `token()` exists.
32
+ *
33
+ * One migration hazard worth knowing: the old hue NAMES are gone, and three of them (`"green"`,
34
+ * `"red"`, `"blue"`) are valid CSS colours, so they would now paint the CSS colour rather than the
35
+ * house token. The dev warning names each of the six explicitly.
36
+ */
37
+ type ChartColor = string;
38
+ /**
39
+ * The colours that series with no explicit `color` cycle through, **in order**.
40
+ *
41
+ * ```tsx
42
+ * palette={[token("utility-blue-600"), token("utility-green-600"), "#e11d48"]}
43
+ * ```
44
+ *
45
+ * As long as you like. Past the list's length it cycles, and `useSeriesColors` emits one dev
46
+ * warning per mount naming the count — the same rule as before, now keyed on YOUR length rather
47
+ * than on a constant six.
48
+ *
49
+ * `[]` — the default — is the house **brand ramp**: six steps of one hue, looping. That is right
50
+ * for ORDINAL series (this year / last year / forecast), where a hue would imply a category that
51
+ * isn't there; a three-series revenue trend rendered green/amber/red reads as *semantic state* when
52
+ * it isn't. For series that genuinely are separate categories, pass distinct hues.
53
+ *
54
+ * @default []
55
+ */
56
+ type ChartPalette = readonly ChartColor[];
57
+ /**
58
+ * One plotted series.
59
+ *
60
+ * `key` must name a column of `data` — the generic is threaded from the sibling `data` prop with
61
+ * `NoInfer`, the same guarantee `value`↔`options` gives every list control. A widened annotation on
62
+ * `data` degrades `key` to `string`; that is what `Chart.test-d.tsx` pins.
63
+ */
64
+ interface ChartSeries<T> {
65
+ /** The column of `data` this series plots. */
66
+ key: keyof T & string;
67
+ /** The name shown in the legend, the tooltip and the screen-reader table. */
68
+ label: string;
69
+ /** Overrides `palette` for this series only. */
70
+ color?: ChartColor;
71
+ }
72
+ /** A single-value datum — the POLAR channel (Pie / Radial), which has no x-axis to key against. */
73
+ interface ChartDatum {
74
+ label: string;
75
+ value: number;
76
+ color?: ChartColor;
77
+ }
78
+ /**
79
+ * Legend placement. ONE union, never a `showLegend` + `legendPosition` pair.
80
+ *
81
+ * **Every member names where the legend actually goes**, which was not true of the first cut: it
82
+ * shipped `"top"` for the reference's desktop layout, a VERTICAL stack pinned to the RIGHT. A member
83
+ * that lies about its own side is the §4 failure exactly — the name is the vocabulary we own, so it
84
+ * has to describe the thing. `"right"` is that layout under its real name, and it is the cartesian
85
+ * default, so the pixels did not move; `"top"` now means a horizontal row ABOVE the plot.
86
+ *
87
+ * `top`/`bottom` are horizontal rows, centred. `left`/`right` are vertical stacks. `none` is the off
88
+ * switch and stays inside the union — a `legend={false}` + `legendPosition` pair could express the
89
+ * contradiction `{ legend: false, legendPosition: "top" }`, and policing that with a dev-warn is a
90
+ * warning for a state the type invented.
91
+ */
92
+ type ChartLegendPlacement = "top" | "right" | "bottom" | "left" | "none";
93
+ /** Interpolation between points. @default "monotone" (the reference's choice on all four demos) */
94
+ type ChartCurve = "monotone" | "linear" | "step";
95
+ /** The POLAR radius ladder. Cartesian charts size by `height`, not by this. */
96
+ type ChartSize = "xs" | "sm" | "md" | "lg";
97
+ /**
98
+ * A pie's centre: how fat the ring is, or `false` for a solid disc.
99
+ *
100
+ * ONE union rather than a `donut: boolean` + `thickness` pair — the pair can spell
101
+ * `{ donut: false, thickness: "thick" }`, a state whose only possible fix is a dev-warn policing
102
+ * something the type invented (§4). The off switch stays inside the union for the same reason
103
+ * `ChartLegendPlacement` keeps `"none"`, and it keeps the existing `donut={false}` call sites
104
+ * compiling unchanged.
105
+ *
106
+ * The members are spelled `thin`/`regular`/`thick` and NOT the `sm`/`md`/`lg` ladder on purpose:
107
+ * `size` already owns that vocabulary here, and `<PieChart size="sm" donut="md">` would read as two
108
+ * size scales fighting. This is a weight axis, so it takes weight words.
109
+ *
110
+ * @default "regular"
111
+ */
112
+ type PieDonut = false | "thin" | "regular" | "thick";
113
+ /**
114
+ * Everything the three cartesian charts share.
115
+ *
116
+ * @internal — Area/Bar/Line each re-declare their own public interface extending this, so a caller
117
+ * reading `AreaChartProps` sees one list rather than chasing a base.
118
+ */
119
+ interface CartesianChartBaseProps<T extends object> {
120
+ /** One row per x-value, with a column per series. */
121
+ data: readonly T[];
122
+ /** The category-axis column. */
123
+ x: keyof T & string;
124
+ /**
125
+ * A SECOND column that groups adjacent categories into bands — a two-tier category axis.
126
+ *
127
+ * Bands are **runs in data order**, never a re-sort: two non-adjacent runs sharing a label render
128
+ * as two bands, because that is what the data says. Nests ONE level, matching Table's banded
129
+ * headers.
130
+ *
131
+ * It is a key rather than a nested `{ label, categories }` shape because the grouping already
132
+ * lives in a column of these wide rows — a nested prop would be a second copy of the same fact,
133
+ * able to disagree with the data. And it is **not** `groupBy`: nothing is aggregated here, the
134
+ * chart plots the rows it is given.
135
+ */
136
+ xGroup?: keyof T & string;
137
+ /** ORDER drives colour order — deterministic, unlike a keyed record. */
138
+ series: readonly ChartSeries<NoInfer<T>>[];
139
+ /** @default [] — the house brand ramp, looping. */
140
+ palette?: ChartPalette;
141
+ /** Plot height in px. @default 240 — the reference's `h-60`. */
142
+ height?: number;
143
+ /** @default "right" */
144
+ legend?: ChartLegendPlacement;
145
+ /** Horizontal rules only, matching the reference. @default true */
146
+ grid?: boolean;
147
+ /** Axis title under the category axis. */
148
+ xLabel?: string;
149
+ /** Axis title beside the value axis. */
150
+ yLabel?: string;
151
+ /** Formats the category tick, the tooltip title and the screen-reader table's row headers. */
152
+ formatX?: (value: T[keyof T]) => string;
153
+ /**
154
+ * Formats the value ticks, the tooltip rows AND the screen-reader table, from ONE prop — a
155
+ * tooltip showing `1204` beside an axis showing `1.2k` is the drift this prevents.
156
+ *
157
+ * @default (v) => v.toLocaleString()
158
+ */
159
+ formatValue?: (value: number) => string;
160
+ /** @default true */
161
+ tooltip?: boolean;
162
+ /**
163
+ * The hover tooltip's surface — the same union `<Tooltip>` takes, so a chart tooltip and a real
164
+ * tooltip on the same page are one object. **Both members are correct in both themes**; this is
165
+ * not a theme switch, the light/dark split already lives in the tokens.
166
+ *
167
+ * - `surface` — a raised panel (default), like every other floating readout in the library.
168
+ * - `inverse` — the always-dark chip. For a chart on a dark stage or over imagery.
169
+ *
170
+ * Dead when `tooltip` is `false`, which is the one seam here worth naming: §11 would fold a switch
171
+ * and its settings into one prop (`tooltip?: false | { tone }`). Kept flat deliberately — see
172
+ * `docs/components/chart.md`.
173
+ *
174
+ * @default "surface"
175
+ */
176
+ tooltipTone?: TooltipTone;
177
+ /** Shown instead of the plot when `data` is empty. @default "No data to display" */
178
+ emptyMessage?: string;
179
+ /** Override the chart family's own copy — what `emptyMessage` defaults to. One scope for all six
180
+ * charts. Merges under `<JenosizeUIProvider labels={{ chart }}>`; see `docs/i18n-policy.md`. */
181
+ labels?: ChartLabels;
182
+ /** Names the figure and captions the screen-reader data table. */
183
+ "aria-label"?: string;
184
+ /** **Layout/spacing only**, merged via `cn()`. Never restyles an axis, a mark or the tooltip. */
185
+ className?: string;
186
+ }
187
+
188
+ export type { CartesianChartBaseProps as C, PieDonut as P, ChartColor as a, ChartCurve as b, ChartDatum as c, ChartLegendPlacement as d, ChartPalette as e, ChartSeries as f, ChartSize as g };
@@ -0,0 +1,482 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import * as React from 'react';
3
+ import { f as DropzoneLabels, g as FileListLabels } from './labels-DPrh0se9.js';
4
+ import { S as SemanticColor } from './color-CtSxc1Rh.js';
5
+
6
+ interface DropFileEntry {
7
+ isFile: true;
8
+ isDirectory?: false;
9
+ name: string;
10
+ file: (onSuccess: (file: File) => void, onError?: (error: unknown) => void) => void;
11
+ }
12
+ interface DropDirectoryEntry {
13
+ isFile?: false;
14
+ isDirectory: true;
15
+ name: string;
16
+ createReader: () => {
17
+ readEntries: (onSuccess: (entries: DropEntry[]) => void, onError?: (error: unknown) => void) => void;
18
+ };
19
+ }
20
+ type DropEntry = DropFileEntry | DropDirectoryEntry;
21
+ /** Reads the filesystem entry behind one dragged item, or `null` where the platform has no such API. */
22
+ type EntryReader = (item: DataTransferItem) => DropEntry | null;
23
+
24
+ /**
25
+ * Where a file is in its upload.
26
+ *
27
+ * There is no `"queued"`: a file the caller has not started is simply not in `files` yet, and a
28
+ * fourth member would invent a state with no visual. A closed set, so every behaviour derived from
29
+ * it lives in ONE table (`STATUS` in `FileList.tsx`) — never re-derived from `progress === 100`,
30
+ * which is the reference's own bug (a file at 100% that the server then rejects renders as both).
31
+ */
32
+ type UploadStatus = "uploading" | "complete" | "failed";
33
+ /**
34
+ * ONE row of a {@link FileList}.
35
+ *
36
+ * Scalar `name`/`size`/`type` rather than a wrapped `File`, deliberately: a row must be able to
37
+ * describe an attachment fetched from an API after a reload, where no `File` object exists —
38
+ * wrapping one would force `new File([], name)` with a lying `size` for that case.
39
+ * {@link toUploadFile} covers the fresh-pick path in one `.map()`.
40
+ */
41
+ interface UploadFile {
42
+ /** Stable identity. REQUIRED — it is the React key, and every callback hands this row back. */
43
+ id: string;
44
+ /** File name as displayed. Truncates at the row's width. */
45
+ name: string;
46
+ /** Size in bytes. Rendered through {@link formatFileSize}. */
47
+ size: number;
48
+ /** Which of the three states this row is in. Drives the affordance from one table. */
49
+ status: UploadStatus;
50
+ /** 0–100. Meaningful only while `status === "uploading"`; ignored otherwise. */
51
+ progress?: number;
52
+ /** MIME type (`"application/pdf"`) or a bare extension (`"pdf"`). Both are accepted — the
53
+ * reference's own demos pass each. Drives the glyph only. */
54
+ type?: string;
55
+ /** Shown in place of the size line while `status === "failed"`. Free text. */
56
+ error?: string;
57
+ }
58
+ /**
59
+ * Why a dropped file did not make it through.
60
+ *
61
+ * A closed set, so a future rule is a new MEMBER — never a fourth callback. (The reference ships
62
+ * three separate drop callbacks, all of which can fire from ONE drop.)
63
+ */
64
+ type FileRejectReason = "type" | "size" | "count" | "directory";
65
+ interface FileRejection {
66
+ /** The file that was refused. A directory rejection carries a zero-byte stand-in named after it. */
67
+ file: File;
68
+ /** The ONE reason it was refused. A file never appears twice. */
69
+ reason: FileRejectReason;
70
+ }
71
+ /** What {@link bucketFiles} decides against. Mirrors the `Dropzone` props of the same names. */
72
+ interface FileRules {
73
+ /** HTML `accept` grammar — `"image/*"`, `".pdf,image/*"`. Absent/empty accepts everything. */
74
+ accept?: string;
75
+ /** @default true */
76
+ multiple?: boolean;
77
+ /** Bytes. */
78
+ maxSize?: number;
79
+ /** Total files allowed, counting {@link existingCount}. */
80
+ maxFiles?: number;
81
+ /** How many are already accepted — `maxFiles` counts the whole list, not one drop. @default 0 */
82
+ existingCount?: number;
83
+ }
84
+ /**
85
+ * Bytes → a short human string.
86
+ *
87
+ * Diverges from the reference's `getReadableFileSize` in exactly two places, both of which are bugs
88
+ * there rather than house style:
89
+ * · it TRUNCATES (`Math.floor`), so 1,992,294 prints `"1 MB"` — we round to 1 decimal above KB
90
+ * and print `"1.9 MB"`;
91
+ * · zero returns `"0 KB"` — we return `"0 B"`, because zero bytes is not zero kilobytes.
92
+ *
93
+ * A negative or non-finite input also returns `"0 B"`; the reference returns `"NaN undefined"`.
94
+ *
95
+ * Public, because a caller rendering their own row must be able to match ours exactly.
96
+ */
97
+ declare function formatFileSize(bytes: number): string;
98
+ /**
99
+ * `File` → a fresh {@link UploadFile} in the `"uploading"` state at 0%.
100
+ *
101
+ * `id` uses `crypto.randomUUID()` where available and a monotonic counter otherwise, so two files
102
+ * with the SAME name still get distinct rows.
103
+ */
104
+ declare function toUploadFile(file: File): UploadFile;
105
+ /**
106
+ * Does `file` satisfy an HTML `accept` grammar?
107
+ *
108
+ * Three forms, per the platform: a leading-dot extension (`.pdf`), a `type/*` wildcard
109
+ * (`image/*`), and an exact MIME (`application/pdf`). Case-insensitive throughout. An absent or
110
+ * empty `accept` accepts everything.
111
+ */
112
+ declare function isFileTypeAccepted(file: File, accept?: string): boolean;
113
+ /** Every `accept` entry that can never match anything — a dev-warn feeds on this. `"pdf"` (no dot,
114
+ * no slash) is the one everybody writes, and it silently accepts nothing at all. */
115
+ declare function invalidAcceptEntries(accept: string): string[];
116
+ interface BucketResult {
117
+ accepted: File[];
118
+ rejections: FileRejection[];
119
+ }
120
+ /**
121
+ * Split a drop into what passes and what does not, in ONE pass.
122
+ *
123
+ * Order matters and is the reference's: **size is checked before type**, so an oversized `.exe`
124
+ * against `accept=".pdf"` rejects as `"size"`. Every file appears exactly once, with exactly one
125
+ * reason.
126
+ *
127
+ * `multiple: false` accepts the first file and rejects the rest as `"count"`; `maxFiles` bounds the
128
+ * whole LIST, so it counts `existingCount` as already spent.
129
+ */
130
+ declare function bucketFiles(files: readonly File[], rules?: FileRules): BucketResult;
131
+ /**
132
+ * The bare extension, lowercased, from a file name OR a MIME string.
133
+ *
134
+ * `"report.PDF"` → `"pdf"`, `"application/pdf"` → `"pdf"`, `"image/svg+xml"` → `"svg"`.
135
+ * A name with no dot and no slash is already an extension (`"pdf"` → `"pdf"`); a name with neither
136
+ * an extension nor a type returns `""`.
137
+ */
138
+ declare function fileExtension(nameOrType: string): string;
139
+ /**
140
+ * ONE table. A file type decides its tone here and nowhere else.
141
+ *
142
+ * Six buckets for the six {@link SemanticColor} members — no new hue vocabulary, because
143
+ * `src/lib/color.ts` already owns the AA-proven fill+white-label recipe. Anything unlisted, and any
144
+ * file with no type at all, is `neutral`.
145
+ *
146
+ * Exported so the Icons page can enumerate the real map rather than a hand-kept copy that goes stale.
147
+ *
148
+ * `as const satisfies` rather than an annotation, because the two do opposite things to the KEYS:
149
+ * `Record<string, SemanticColor>` widens them to `string`, so `keyof typeof FILE_TONE` was `string`
150
+ * and the 27 members this table owns were invisible to the type system — a caller could not tell
151
+ * `"xlsx"` from a typo, and neither could we. `satisfies` still proves every value is a real
152
+ * {@link SemanticColor}, so a bad tone is caught exactly as before.
153
+ */
154
+ declare const FILE_TONE: {
155
+ readonly pdf: "error";
156
+ readonly doc: "info";
157
+ readonly docx: "info";
158
+ readonly txt: "info";
159
+ readonly rtf: "info";
160
+ readonly md: "info";
161
+ readonly pages: "info";
162
+ readonly xls: "success";
163
+ readonly xlsx: "success";
164
+ readonly csv: "success";
165
+ readonly numbers: "success";
166
+ readonly png: "brand";
167
+ readonly jpg: "brand";
168
+ readonly jpeg: "brand";
169
+ readonly gif: "brand";
170
+ readonly svg: "brand";
171
+ readonly webp: "brand";
172
+ readonly avif: "brand";
173
+ readonly heic: "brand";
174
+ readonly zip: "warning";
175
+ readonly rar: "warning";
176
+ readonly "7z": "warning";
177
+ readonly tar: "warning";
178
+ readonly gz: "warning";
179
+ };
180
+ /**
181
+ * The extensions {@link FILE_TONE} actually names — the STRICT half of {@link FileExtension}.
182
+ *
183
+ * Annotate a literal with it (`const ext: KnownFileExtension = "xlsx"`) and a typo becomes a compile
184
+ * error instead of a silently neutral chip. `FileTypeGlyph.extension` is the half-open union rather
185
+ * than this one, because a real filesystem produces extensions no table can enumerate: anything
186
+ * outside this set still renders — as `neutral`, by design — so widening the table is never a
187
+ * breaking change for a caller who did not opt in.
188
+ */
189
+ type KnownFileExtension = keyof typeof FILE_TONE;
190
+ /**
191
+ * What `FileTypeGlyph.extension` accepts: a known member, or any other extension.
192
+ *
193
+ * The `(string & {})` half is the standard trick for a **half-open** set: `KnownFileExtension` alone
194
+ * would refuse the `.parquet` a user can genuinely drop, while a plain `string` would absorb the
195
+ * literal members and stop them autocompleting.
196
+ *
197
+ * **Be honest about what that buys.** `string & {}` is structurally IDENTICAL to `string`, so this
198
+ * type accepts exactly what `string` accepts and rejects nothing a `string` would not — a typo like
199
+ * `"xlxs"` still compiles. The intersection is an EDITOR affordance (TypeScript keeps the 27 members
200
+ * in the completion list rather than collapsing them), not a guarantee, and no type-level probe can
201
+ * assert it; `Dropzone.test-d.tsx` says so where a reader would otherwise assume the opposite. The
202
+ * enforceable half is {@link KnownFileExtension}, which a caller opts into on a literal.
203
+ */
204
+ type FileExtension = KnownFileExtension | (string & {});
205
+ /**
206
+ * The tone for an extension already parsed out — the lookup {@link fileTone} performs, exposed on
207
+ * its own because `FileTypeGlyph` takes the extension directly and must not re-parse a name.
208
+ *
209
+ * The cast widens the table's literal keys back to a string index on purpose: the keys are literals
210
+ * so that {@link KnownFileExtension} exists, but the ARGUMENT here is half-open, and a
211
+ * `KnownFileExtension`-keyed read would reject exactly the unlisted extensions this exists to answer
212
+ * `"neutral"` for. `noUncheckedIndexedAccess` keeps the `??` load-bearing.
213
+ */
214
+ declare function extensionTone(extension: FileExtension): SemanticColor;
215
+ /** The tone buckets in render order, for the Icons-page reference grid. */
216
+ declare const FILE_TONE_BUCKETS: readonly {
217
+ tone: SemanticColor;
218
+ label: string;
219
+ extensions: readonly string[];
220
+ }[];
221
+ /** The tone for a whole file name or MIME string — parse, then look up. Never `undefined`.
222
+ *
223
+ * Kept as the one-call convenience for a caller holding a name; `FileTypeGlyph` itself does NOT use
224
+ * it, because its prop is already the extension. Both routes end in {@link extensionTone}, so there
225
+ * is still exactly one table and one answer. */
226
+ declare function fileTone(nameOrType: string | undefined): SemanticColor;
227
+ /**
228
+ * Which string the glyph should read for a row: the MIME when it names a type a reader recognises,
229
+ * and the file NAME otherwise.
230
+ *
231
+ * The `type` alone is not enough, and this is not a corner case — `application/vnd.ms-excel` is what
232
+ * every browser reports for an `.xlsx`, and reading it literally printed a `VND.` chip in the neutral
233
+ * tone. The NAME still says `xlsx`. The name alone is not enough either: an API-supplied attachment
234
+ * may carry a MIME and no extension at all.
235
+ */
236
+ declare function fileGlyphSource(file: {
237
+ name: string;
238
+ type?: string;
239
+ }): string;
240
+ /** The 40px tile both the dropzone hero and the file glyph sit in — one recipe, one place. */
241
+ declare const GLYPH_BOX = "relative size-10 shrink-0";
242
+
243
+ interface DropzoneProps extends Omit<useRender.ComponentProps<"button">, "children" | "onChange" | "color"> {
244
+ /**
245
+ * HTML `accept` grammar — `"image/*"`, `".pdf,image/*"`, `"application/pdf"`.
246
+ *
247
+ * Filters the picker dialog AND is re-checked on drop, because a drop bypasses the dialog
248
+ * entirely. Dev-warns on an entry that can never match (`"pdf"` with no dot and no slash is the
249
+ * one everybody writes).
250
+ */
251
+ accept?: string;
252
+ /** Allow more than one file per drop/pick. @default true */
253
+ multiple?: boolean;
254
+ /** Largest accepted file, in bytes. Anything over rejects with reason `"size"`. */
255
+ maxSize?: number;
256
+ /** Total files allowed, counting the {@link fileCount} the caller already holds. */
257
+ maxFiles?: number;
258
+ /** How many files are already accepted, so {@link maxFiles} bounds the LIST and not one drop.
259
+ * @default 0 */
260
+ fileCount?: number;
261
+ /** Walk a dropped folder recursively. Pairs with `FileTrigger.acceptDirectory` for the picker
262
+ * path. With it off, a dropped folder rejects as `"directory"` rather than vanishing.
263
+ * @default false */
264
+ acceptDirectory?: boolean;
265
+ /** Files that passed every rule. Named after the sibling `FileTrigger.onFilesChange`. */
266
+ onFilesChange?: (files: File[]) => void;
267
+ /** Everything that did not, each with exactly ONE reason. Fires with a non-empty array or not at
268
+ * all — never with `[]`. */
269
+ onReject?: (rejections: readonly FileRejection[]) => void;
270
+ /** Visible label (`Field.Label`), auto-associated with the surface. */
271
+ label?: React.ReactNode;
272
+ /** Help-circle tooltip after the label (title line). @see tooltipDescription */
273
+ tooltip?: string;
274
+ /** Optional secondary line under {@link tooltip} in the tooltip surface. */
275
+ tooltipDescription?: string;
276
+ /** Helper text UNDER the surface (`Field.Description`) — "SVG, PNG, JPG or GIF (max 800×400px)".
277
+ * Hidden while an `error` shows. Placed under the field, not inside the box, so it sits exactly
278
+ * where every sibling Field control puts its hint. */
279
+ hint?: React.ReactNode;
280
+ /** Append a required `*` after the label. @default false */
281
+ required?: boolean;
282
+ /** Suppress the visual `*` while keeping `required` semantics. @default false */
283
+ hideRequiredIndicator?: boolean;
284
+ /** Error state: red edge and `aria-invalid`. A non-empty {@link error} implies it. @default false */
285
+ invalid?: boolean;
286
+ /** Error message (`Field.Error`). A non-empty value also implies {@link invalid}. */
287
+ error?: string;
288
+ /** Blocks click, keyboard AND drop, and reaches `Field.Root`. @default false */
289
+ disabled?: boolean;
290
+ /** Whether the field column takes `w-full`. Only OBSERVABLE where the parent would otherwise let
291
+ * the column shrink-to-fit (a flex row / grid cell). Bound it with a width in `className`.
292
+ * @default true */
293
+ fullWidth?: boolean;
294
+ /** Override the component's own copy — the upload prompt and the required suffix. `prompt` is the
295
+ * whole sentence, for a language that cannot keep the action first. Merges under
296
+ * `<JenosizeUIProvider labels={{ dropzone }}>`; see `docs/i18n-policy.md`. */
297
+ labels?: DropzoneLabels;
298
+ /** Layout/spacing only, merged via `cn()` onto the field column. Never restyles the surface. */
299
+ className?: string;
300
+ }
301
+ /** INTERNAL escape hatch for the tests: swap the `webkitGetAsEntry` reader for a fake tree. Not a
302
+ * prop — a public seam here would be a second data channel into the same drop. */
303
+ interface InternalProps {
304
+ _readEntry?: EntryReader;
305
+ }
306
+ declare function Dropzone(props: DropzoneProps & InternalProps): React.JSX.Element;
307
+
308
+ /** Which row treatment. The same prop name `Table` already uses for the same kind of choice. */
309
+ type FileListTreatment = "bar" | "fill";
310
+ interface FileListProps extends Omit<React.ComponentPropsWithoutRef<"ul">, "children"> {
311
+ /** **Required.** The rows. The ONLY data channel — there is no self-managed mode. */
312
+ files: readonly UploadFile[];
313
+ /** `bar` puts a `<Progress>` under the meta line; `fill` washes the whole row and reads a bare
314
+ * percentage. @default "bar" */
315
+ treatment?: FileListTreatment;
316
+ /** Remove the row. Offered on every status EXCEPT `"uploading"`, where {@link onCancel} takes
317
+ * over. Omit it and the affordance is absent — never a disabled ghost. */
318
+ onRemove?: (file: UploadFile) => void;
319
+ /** Stop an upload in flight. Offered only while `status === "uploading"`. The `AbortController`
320
+ * stays the caller's — this only gives the act its own affordance. */
321
+ onCancel?: (file: UploadFile) => void;
322
+ /** Retry. Offered only while `status === "failed"`, as a "Try again" link under the row. */
323
+ onRetry?: (file: UploadFile) => void;
324
+ /** Override the 40px glyph. A function of DATA → NODE, the same category `TabItem.content` and
325
+ * `Table`'s `cell` occupy — it chooses what a glyph SAYS, never how the row is built. Its return
326
+ * is never `aria-hidden`-wrapped: that is the caller's node and the caller owns its semantics. */
327
+ fileIcon?: (file: UploadFile) => React.ReactNode;
328
+ /** Layout/spacing only, merged via `cn()` onto the `<ul>`. Never reaches a row. */
329
+ className?: string;
330
+ /** Override the component's own copy — the three status words, the row affordance verbs, the
331
+ * retry link and the fallback failure line. Merges under
332
+ * `<JenosizeUIProvider labels={{ fileList }}>`; see `docs/i18n-policy.md`. */
333
+ labels?: FileListLabels;
334
+ }
335
+ /**
336
+ * The rows an upload produces — one `<li>` per file, in whichever treatment the host picks.
337
+ *
338
+ * An EMPTY list renders **nothing at all**: no `<ul>`, no placeholder. The `<Dropzone>` above it is
339
+ * already the empty state, and `Callout` is a full-panel block by its own spec — which is why there
340
+ * is no `empty` / `emptyMessage` prop to pass.
341
+ */
342
+ declare function FileList(props: FileListProps): React.JSX.Element | null;
343
+
344
+ /**
345
+ * What happened to one row.
346
+ *
347
+ * A closed set, so a future transition is a new MEMBER rather than a second callback, and every
348
+ * behaviour derived from it lives in ONE table ({@link reduceUpload}).
349
+ *
350
+ * There is no `"remove"` member on purpose: removing a row is a LIST operation, not a transition of
351
+ * a row, and `rows.filter(…)` is already its correct and obvious spelling.
352
+ */
353
+ type UploadEvent = {
354
+ type: "progress";
355
+ percent: number;
356
+ } | {
357
+ type: "complete";
358
+ } | {
359
+ type: "failed";
360
+ error: string;
361
+ } | {
362
+ type: "retry";
363
+ };
364
+ /**
365
+ * Apply one {@link UploadEvent} to one row. The ONLY correct way to move an {@link UploadFile}
366
+ * between states.
367
+ *
368
+ * Four invariants a hand-written `.map()` keeps getting wrong:
369
+ * · `progress` NEVER touches `status` — a batch that reaches 100% has not been accepted yet, and
370
+ * deriving `"complete"` from the percentage is the reference's own bug;
371
+ * · `complete` pins `progress` to 100, so a row that finished on a `lengthComputable: false`
372
+ * stream does not render a stalled bar next to the word "Complete";
373
+ * · `failed` KEEPS the progress it reached (the bar is hidden at that status anyway) and sets the
374
+ * message the row shows in place of its size;
375
+ * · `retry` clears `error` — forget it and a retrying row shows a stale failure under a moving bar.
376
+ *
377
+ * Returns the same array identity when nothing changed (unknown `id`, or a `progress` event that
378
+ * repeats the percent already stored), so a `setFiles(reduceUpload(…))` cannot spin a render loop
379
+ * on a transport that reports the same integer twice.
380
+ *
381
+ * Exported one layer below {@link useUploads}, for the caller whose rows live somewhere the hook
382
+ * cannot own them — a `useForm` field, a store, or a list fetched from the server on page load.
383
+ */
384
+ declare function reduceUpload(rows: readonly UploadFile[], id: string, event: UploadEvent): UploadFile[];
385
+ /**
386
+ * One batch byte count → a percent per file, by multipart write order.
387
+ *
388
+ * A request carrying M files reports ONE `loaded` for the whole body, so per-file progress has to be
389
+ * attributed rather than measured. Multipart writes its parts sequentially in the order they were
390
+ * appended, so the cumulative byte count maps onto the prefix sums of the sizes: everything before
391
+ * the write head is 100, the part straddling it is partial, everything after is 0.
392
+ *
393
+ * Part headers and boundary delimiters are ignored — they are tens of bytes against a payload
394
+ * measured in megabytes, and counting them would require knowing the boundary string, which belongs
395
+ * to the caller's transport.
396
+ *
397
+ * A zero-byte file reads 100 as soon as the head reaches it: it has no bytes left to send.
398
+ */
399
+ declare function splitBatchProgress(sizes: readonly number[], loaded: number): number[];
400
+ /** What a transport is handed. `onProgress` takes 0–100 for the whole request. */
401
+ interface UploadContext {
402
+ /** Aborted by `listProps.onCancel`, by {@link UseUploadsResult.clear}, and on unmount. */
403
+ signal: AbortSignal;
404
+ /**
405
+ * Report the request's progress, 0–100.
406
+ *
407
+ * With `batchSize: 1` this IS the row's percentage. Above 1 it is split across the batch's rows by
408
+ * size, via {@link splitBatchProgress} — pass the whole request's percentage and the hook
409
+ * attributes it. Pass `fileIndex` to address one file of the batch directly instead.
410
+ */
411
+ onProgress: (percent: number, fileIndex?: number) => void;
412
+ }
413
+ /**
414
+ * The caller's wire, and the ONLY thing {@link useUploads} cannot supply.
415
+ *
416
+ * Receives exactly `batchSize` files (one by default) and resolves with **one result per file, in
417
+ * the same order** — that array is what {@link UseUploadsResult.results} is keyed from, and it is
418
+ * what a form actually submits. Reject to fail the request; reject with an `AbortError` (which
419
+ * `AbortController` and `fetch` both produce) and the hook treats it as a cancel rather than a
420
+ * failure, so no red row is left behind.
421
+ */
422
+ type UploadTransport<T = unknown> = (files: File[], ctx: UploadContext) => Promise<readonly T[]>;
423
+ interface UseUploadsOptions<T = unknown> {
424
+ /** **Required.** Your wire. @see UploadTransport */
425
+ transport: UploadTransport<T>;
426
+ /**
427
+ * Files per request.
428
+ *
429
+ * Leave it at 1 unless the payloads are tiny and numerous — a batch endpoint costs you the three
430
+ * per-row affordances `<FileList>` renders. Above 1, `listProps.onCancel` is **withheld** (one
431
+ * request cannot cancel one of its files, and a button that kills the siblings would be lying),
432
+ * a rejected request fails **every** row it carried, and a retry re-sends that ONE file alone
433
+ * rather than re-uploading its healthy siblings. @default 1
434
+ */
435
+ batchSize?: number;
436
+ /**
437
+ * Requests in flight at once; the rest queue.
438
+ *
439
+ * Unlimited is worse than it looks. HTTP/1.1 browsers cap ~6 connections per origin, so anything
440
+ * above that only queues where you cannot see it; on HTTP/2 they all multiplex over one connection
441
+ * and share the same uplink, so twenty uploads each run at a twentieth of the speed and *all
442
+ * twenty* finish late, where three lets seventeen finish early. @default 3
443
+ */
444
+ concurrency?: number;
445
+ }
446
+ interface UseUploadsResult<T = unknown> {
447
+ /** The rows, in pick order. */
448
+ files: UploadFile[];
449
+ /**
450
+ * Spread onto `<FileList>`.
451
+ *
452
+ * A nested bag rather than the top level, because spreading the whole result would push `add` and
453
+ * `clear` onto the `<ul>` as unknown DOM attributes. Override any member after the spread
454
+ * (`<FileList {...uploads.listProps} onRemove={mine} />`) to add your own side-effect.
455
+ */
456
+ listProps: Pick<FileListProps, "files" | "onCancel" | "onRemove" | "onRetry">;
457
+ /** Hand this straight to `<Dropzone onFilesChange>` — the signatures match. */
458
+ add: (files: File[]) => void;
459
+ /** Abort everything in flight and empty the list. */
460
+ clear: () => void;
461
+ /** Rows still uploading, queued ones included. `> 0` is the disable condition for a Save button. */
462
+ activeCount: number;
463
+ /** What your transport resolved with, per completed row. Keyed by `UploadFile.id`. */
464
+ results: ReadonlyMap<string, T>;
465
+ }
466
+ /**
467
+ * Own an upload list: rows, progress, cancel, retry, a concurrency queue, and the results your
468
+ * transport resolved with.
469
+ *
470
+ * ```tsx
471
+ * const uploads = useUploads({
472
+ * transport: ([file], { signal, onProgress }) =>
473
+ * xhrUpload(file, { url: "/api/attachments", signal, onProgress }).then((r) => [r]),
474
+ * });
475
+ *
476
+ * <Dropzone accept="image/*" fileCount={uploads.files.length} onFilesChange={uploads.add} />
477
+ * <FileList {...uploads.listProps} />
478
+ * ```
479
+ */
480
+ declare function useUploads<T = unknown>({ transport, batchSize, concurrency }: UseUploadsOptions<T>): UseUploadsResult<T>;
481
+
482
+ export { useUploads as A, type BucketResult as B, Dropzone as D, FILE_TONE as F, GLYPH_BOX as G, type KnownFileExtension as K, type UploadContext as U, type DropzoneProps as a, FILE_TONE_BUCKETS as b, type FileExtension as c, FileList as d, type FileListProps as e, type FileListTreatment as f, type FileRejectReason as g, type FileRejection as h, type FileRules as i, type UploadEvent as j, type UploadFile as k, type UploadStatus as l, type UploadTransport as m, type UseUploadsOptions as n, type UseUploadsResult as o, bucketFiles as p, extensionTone as q, fileExtension as r, fileGlyphSource as s, fileTone as t, formatFileSize as u, invalidAcceptEntries as v, isFileTypeAccepted as w, reduceUpload as x, splitBatchProgress as y, toUploadFile as z };