@optimum-intelligence/opti-ui 0.0.0-stage → 0.3.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 (193) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +244 -2
  3. package/dist/components/accordion/Accordion.d.ts +17 -0
  4. package/dist/components/accordion/Accordion.js +204 -0
  5. package/dist/components/accordion/Accordion.js.map +1 -0
  6. package/dist/components/alert/Alert.d.ts +18 -0
  7. package/dist/components/alert/Alert.js +164 -0
  8. package/dist/components/alert/Alert.js.map +1 -0
  9. package/dist/components/app-shell/AppShell.d.ts +97 -0
  10. package/dist/components/app-shell/AppShell.js +689 -0
  11. package/dist/components/app-shell/AppShell.js.map +1 -0
  12. package/dist/components/avatar/Avatar.d.ts +21 -0
  13. package/dist/components/avatar/Avatar.js +190 -0
  14. package/dist/components/avatar/Avatar.js.map +1 -0
  15. package/dist/components/badge/Badge.d.ts +16 -0
  16. package/dist/components/badge/Badge.js +94 -0
  17. package/dist/components/badge/Badge.js.map +1 -0
  18. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +18 -0
  19. package/dist/components/breadcrumbs/Breadcrumbs.js +154 -0
  20. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -0
  21. package/dist/components/button/Button.d.ts +23 -0
  22. package/dist/components/button/Button.js +159 -0
  23. package/dist/components/button/Button.js.map +1 -0
  24. package/dist/components/calendar/Calendar.d.ts +59 -0
  25. package/dist/components/calendar/Calendar.js +709 -0
  26. package/dist/components/calendar/Calendar.js.map +1 -0
  27. package/dist/components/calendar/date-utils.d.ts +32 -0
  28. package/dist/components/calendar/date-utils.js +112 -0
  29. package/dist/components/calendar/date-utils.js.map +1 -0
  30. package/dist/components/card/Card.d.ts +42 -0
  31. package/dist/components/card/Card.js +82 -0
  32. package/dist/components/card/Card.js.map +1 -0
  33. package/dist/components/choice/Choice.d.ts +32 -0
  34. package/dist/components/choice/Choice.js +371 -0
  35. package/dist/components/choice/Choice.js.map +1 -0
  36. package/dist/components/collapsible/Collapsible.d.ts +15 -0
  37. package/dist/components/collapsible/Collapsible.js +155 -0
  38. package/dist/components/collapsible/Collapsible.js.map +1 -0
  39. package/dist/components/combobox/Combobox.d.ts +68 -0
  40. package/dist/components/combobox/Combobox.js +752 -0
  41. package/dist/components/combobox/Combobox.js.map +1 -0
  42. package/dist/components/command-palette/CommandPalette.d.ts +52 -0
  43. package/dist/components/command-palette/CommandPalette.js +328 -0
  44. package/dist/components/command-palette/CommandPalette.js.map +1 -0
  45. package/dist/components/data-table/DataTable.d.ts +73 -0
  46. package/dist/components/data-table/DataTable.js +478 -0
  47. package/dist/components/data-table/DataTable.js.map +1 -0
  48. package/dist/components/data-table/DataTableContent.d.ts +35 -0
  49. package/dist/components/data-table/DataTableContent.js +550 -0
  50. package/dist/components/data-table/DataTableContent.js.map +1 -0
  51. package/dist/components/data-table/DataTableFilters.d.ts +15 -0
  52. package/dist/components/data-table/DataTableFilters.js +284 -0
  53. package/dist/components/data-table/DataTableFilters.js.map +1 -0
  54. package/dist/components/data-table/DataTableRow.d.ts +33 -0
  55. package/dist/components/data-table/DataTableRow.js +552 -0
  56. package/dist/components/data-table/DataTableRow.js.map +1 -0
  57. package/dist/components/data-table/context.d.ts +5 -0
  58. package/dist/components/data-table/context.js +14 -0
  59. package/dist/components/data-table/context.js.map +1 -0
  60. package/dist/components/data-table/layout.d.ts +60 -0
  61. package/dist/components/data-table/layout.js +272 -0
  62. package/dist/components/data-table/layout.js.map +1 -0
  63. package/dist/components/data-table/types.d.ts +319 -0
  64. package/dist/components/data-table/useDataTable.d.ts +9 -0
  65. package/dist/components/data-table/useDataTable.js +666 -0
  66. package/dist/components/data-table/useDataTable.js.map +1 -0
  67. package/dist/components/date-picker/DatePicker.d.ts +50 -0
  68. package/dist/components/date-picker/DatePicker.js +485 -0
  69. package/dist/components/date-picker/DatePicker.js.map +1 -0
  70. package/dist/components/date-picker/DateRangePicker.d.ts +39 -0
  71. package/dist/components/date-picker/DateRangePicker.js +339 -0
  72. package/dist/components/date-picker/DateRangePicker.js.map +1 -0
  73. package/dist/components/date-picker/PickerField.d.ts +38 -0
  74. package/dist/components/date-picker/PickerField.js +238 -0
  75. package/dist/components/date-picker/PickerField.js.map +1 -0
  76. package/dist/components/dialog/Dialog.d.ts +70 -0
  77. package/dist/components/dialog/Dialog.js +354 -0
  78. package/dist/components/dialog/Dialog.js.map +1 -0
  79. package/dist/components/drawer/Drawer.d.ts +39 -0
  80. package/dist/components/drawer/Drawer.js +225 -0
  81. package/dist/components/drawer/Drawer.js.map +1 -0
  82. package/dist/components/empty-state/EmptyState.d.ts +12 -0
  83. package/dist/components/empty-state/EmptyState.js +116 -0
  84. package/dist/components/empty-state/EmptyState.js.map +1 -0
  85. package/dist/components/field/Field.d.ts +36 -0
  86. package/dist/components/field/Field.js +337 -0
  87. package/dist/components/field/Field.js.map +1 -0
  88. package/dist/components/file-upload/FileUpload.d.ts +91 -0
  89. package/dist/components/file-upload/FileUpload.js +714 -0
  90. package/dist/components/file-upload/FileUpload.js.map +1 -0
  91. package/dist/components/input/Input.d.ts +49 -0
  92. package/dist/components/input/Input.js +538 -0
  93. package/dist/components/input/Input.js.map +1 -0
  94. package/dist/components/link/Link.d.ts +17 -0
  95. package/dist/components/link/Link.js +91 -0
  96. package/dist/components/link/Link.js.map +1 -0
  97. package/dist/components/menu/Menu.d.ts +79 -0
  98. package/dist/components/menu/Menu.js +615 -0
  99. package/dist/components/menu/Menu.js.map +1 -0
  100. package/dist/components/number-field/NumberField.d.ts +16 -0
  101. package/dist/components/number-field/NumberField.js +188 -0
  102. package/dist/components/number-field/NumberField.js.map +1 -0
  103. package/dist/components/pagination/Pagination.d.ts +34 -0
  104. package/dist/components/pagination/Pagination.js +244 -0
  105. package/dist/components/pagination/Pagination.js.map +1 -0
  106. package/dist/components/popover/Popover.d.ts +22 -0
  107. package/dist/components/popover/Popover.js +186 -0
  108. package/dist/components/popover/Popover.js.map +1 -0
  109. package/dist/components/preview-card/PreviewCard.d.ts +20 -0
  110. package/dist/components/preview-card/PreviewCard.js +114 -0
  111. package/dist/components/preview-card/PreviewCard.js.map +1 -0
  112. package/dist/components/progress/Progress.d.ts +20 -0
  113. package/dist/components/progress/Progress.js +169 -0
  114. package/dist/components/progress/Progress.js.map +1 -0
  115. package/dist/components/scroll-area/ScrollArea.d.ts +8 -0
  116. package/dist/components/scroll-area/ScrollArea.js +112 -0
  117. package/dist/components/scroll-area/ScrollArea.js.map +1 -0
  118. package/dist/components/search-input/SearchInput.d.ts +14 -0
  119. package/dist/components/search-input/SearchInput.js +114 -0
  120. package/dist/components/search-input/SearchInput.js.map +1 -0
  121. package/dist/components/select/Select.d.ts +66 -0
  122. package/dist/components/select/Select.js +601 -0
  123. package/dist/components/select/Select.js.map +1 -0
  124. package/dist/components/separator/Separator.d.ts +4 -0
  125. package/dist/components/separator/Separator.js +46 -0
  126. package/dist/components/separator/Separator.js.map +1 -0
  127. package/dist/components/skeleton/Skeleton.d.ts +16 -0
  128. package/dist/components/skeleton/Skeleton.js +135 -0
  129. package/dist/components/skeleton/Skeleton.js.map +1 -0
  130. package/dist/components/slider/Slider.d.ts +11 -0
  131. package/dist/components/slider/Slider.js +107 -0
  132. package/dist/components/slider/Slider.js.map +1 -0
  133. package/dist/components/spinner/Spinner.d.ts +9 -0
  134. package/dist/components/spinner/Spinner.js +78 -0
  135. package/dist/components/spinner/Spinner.js.map +1 -0
  136. package/dist/components/stack/Stack.d.ts +23 -0
  137. package/dist/components/stack/Stack.js +79 -0
  138. package/dist/components/stack/Stack.js.map +1 -0
  139. package/dist/components/stat-card/StatCard.d.ts +22 -0
  140. package/dist/components/stat-card/StatCard.js +153 -0
  141. package/dist/components/stat-card/StatCard.js.map +1 -0
  142. package/dist/components/stepper/Stepper.d.ts +30 -0
  143. package/dist/components/stepper/Stepper.js +131 -0
  144. package/dist/components/stepper/Stepper.js.map +1 -0
  145. package/dist/components/table/Table.d.ts +53 -0
  146. package/dist/components/table/Table.js +221 -0
  147. package/dist/components/table/Table.js.map +1 -0
  148. package/dist/components/tabs/Tabs.d.ts +19 -0
  149. package/dist/components/tabs/Tabs.js +183 -0
  150. package/dist/components/tabs/Tabs.js.map +1 -0
  151. package/dist/components/tag/Tag.d.ts +22 -0
  152. package/dist/components/tag/Tag.js +121 -0
  153. package/dist/components/tag/Tag.js.map +1 -0
  154. package/dist/components/toast/Toast.d.ts +34 -0
  155. package/dist/components/toast/Toast.js +187 -0
  156. package/dist/components/toast/Toast.js.map +1 -0
  157. package/dist/components/toggle/Toggle.d.ts +31 -0
  158. package/dist/components/toggle/Toggle.js +197 -0
  159. package/dist/components/toggle/Toggle.js.map +1 -0
  160. package/dist/components/toolbar/Toolbar.d.ts +21 -0
  161. package/dist/components/toolbar/Toolbar.js +239 -0
  162. package/dist/components/toolbar/Toolbar.js.map +1 -0
  163. package/dist/components/tooltip/Tooltip.d.ts +33 -0
  164. package/dist/components/tooltip/Tooltip.js +182 -0
  165. package/dist/components/tooltip/Tooltip.js.map +1 -0
  166. package/dist/components/typography/Typography.d.ts +32 -0
  167. package/dist/components/typography/Typography.js +183 -0
  168. package/dist/components/typography/Typography.js.map +1 -0
  169. package/dist/fonts.css +3 -0
  170. package/dist/icons/index.d.ts +133 -0
  171. package/dist/icons/index.js +182 -0
  172. package/dist/icons/index.js.map +1 -0
  173. package/dist/index.d.ts +55 -0
  174. package/dist/index.js +58 -0
  175. package/dist/opti-ui.css +5692 -0
  176. package/dist/theme/ThemeProvider.d.ts +22 -0
  177. package/dist/theme/ThemeProvider.js +115 -0
  178. package/dist/theme/ThemeProvider.js.map +1 -0
  179. package/dist/theme/index.d.ts +2 -0
  180. package/dist/utils/cx.d.ts +10 -0
  181. package/dist/utils/cx.js +18 -0
  182. package/dist/utils/cx.js.map +1 -0
  183. package/dist/utils/index.d.ts +2 -0
  184. package/dist/utils/portal.d.ts +8 -0
  185. package/dist/utils/portal.js +16 -0
  186. package/dist/utils/portal.js.map +1 -0
  187. package/dist/utils/primitive.d.ts +13 -0
  188. package/dist/utils/primitive.js +61 -0
  189. package/dist/utils/primitive.js.map +1 -0
  190. package/dist/utils/search.d.ts +4 -0
  191. package/dist/utils/search.js +15 -0
  192. package/dist/utils/search.js.map +1 -0
  193. package/package.json +71 -4
@@ -0,0 +1,337 @@
1
+ "use client";
2
+ import { withClass } from "../../utils/cx.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Field } from "@base-ui/react/field";
6
+ import { Fieldset } from "@base-ui/react/fieldset";
7
+ import { Form } from "@base-ui/react/form";
8
+ //#region src/components/field/Field.tsx
9
+ function FieldRoot(t0) {
10
+ const $ = c(10);
11
+ let className;
12
+ let props;
13
+ let ref;
14
+ if ($[0] !== t0) {
15
+ ({className, ref, ...props} = t0);
16
+ $[0] = t0;
17
+ $[1] = className;
18
+ $[2] = props;
19
+ $[3] = ref;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ ref = $[3];
24
+ }
25
+ let t1;
26
+ if ($[4] !== className) {
27
+ t1 = withClass("oui-field", className);
28
+ $[4] = className;
29
+ $[5] = t1;
30
+ } else t1 = $[5];
31
+ let t2;
32
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
33
+ t2 = /* @__PURE__ */ jsx(Field.Root, {
34
+ ref,
35
+ className: t1,
36
+ ...props
37
+ });
38
+ $[6] = props;
39
+ $[7] = ref;
40
+ $[8] = t1;
41
+ $[9] = t2;
42
+ } else t2 = $[9];
43
+ return t2;
44
+ }
45
+ function FieldLabel(t0) {
46
+ const $ = c(16);
47
+ let children;
48
+ let className;
49
+ let props;
50
+ let ref;
51
+ let required;
52
+ if ($[0] !== t0) {
53
+ ({className, required, children, ref, ...props} = t0);
54
+ $[0] = t0;
55
+ $[1] = children;
56
+ $[2] = className;
57
+ $[3] = props;
58
+ $[4] = ref;
59
+ $[5] = required;
60
+ } else {
61
+ children = $[1];
62
+ className = $[2];
63
+ props = $[3];
64
+ ref = $[4];
65
+ required = $[5];
66
+ }
67
+ let t1;
68
+ if ($[6] !== className) {
69
+ t1 = withClass("oui-field__label", className);
70
+ $[6] = className;
71
+ $[7] = t1;
72
+ } else t1 = $[7];
73
+ let t2;
74
+ if ($[8] !== required) {
75
+ t2 = required && /* @__PURE__ */ jsx("span", {
76
+ className: "oui-field__required",
77
+ "aria-hidden": true,
78
+ children: "*"
79
+ });
80
+ $[8] = required;
81
+ $[9] = t2;
82
+ } else t2 = $[9];
83
+ let t3;
84
+ if ($[10] !== children || $[11] !== props || $[12] !== ref || $[13] !== t1 || $[14] !== t2) {
85
+ t3 = /* @__PURE__ */ jsxs(Field.Label, {
86
+ ref,
87
+ className: t1,
88
+ ...props,
89
+ children: [children, t2]
90
+ });
91
+ $[10] = children;
92
+ $[11] = props;
93
+ $[12] = ref;
94
+ $[13] = t1;
95
+ $[14] = t2;
96
+ $[15] = t3;
97
+ } else t3 = $[15];
98
+ return t3;
99
+ }
100
+ function FieldDescription(t0) {
101
+ const $ = c(10);
102
+ let className;
103
+ let props;
104
+ let ref;
105
+ if ($[0] !== t0) {
106
+ ({className, ref, ...props} = t0);
107
+ $[0] = t0;
108
+ $[1] = className;
109
+ $[2] = props;
110
+ $[3] = ref;
111
+ } else {
112
+ className = $[1];
113
+ props = $[2];
114
+ ref = $[3];
115
+ }
116
+ let t1;
117
+ if ($[4] !== className) {
118
+ t1 = withClass("oui-field__description", className);
119
+ $[4] = className;
120
+ $[5] = t1;
121
+ } else t1 = $[5];
122
+ let t2;
123
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
124
+ t2 = /* @__PURE__ */ jsx(Field.Description, {
125
+ ref,
126
+ className: t1,
127
+ ...props
128
+ });
129
+ $[6] = props;
130
+ $[7] = ref;
131
+ $[8] = t1;
132
+ $[9] = t2;
133
+ } else t2 = $[9];
134
+ return t2;
135
+ }
136
+ function FieldError(t0) {
137
+ const $ = c(10);
138
+ let className;
139
+ let props;
140
+ let ref;
141
+ if ($[0] !== t0) {
142
+ ({className, ref, ...props} = t0);
143
+ $[0] = t0;
144
+ $[1] = className;
145
+ $[2] = props;
146
+ $[3] = ref;
147
+ } else {
148
+ className = $[1];
149
+ props = $[2];
150
+ ref = $[3];
151
+ }
152
+ let t1;
153
+ if ($[4] !== className) {
154
+ t1 = withClass("oui-field__error", className);
155
+ $[4] = className;
156
+ $[5] = t1;
157
+ } else t1 = $[5];
158
+ let t2;
159
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
160
+ t2 = /* @__PURE__ */ jsx(Field.Error, {
161
+ ref,
162
+ className: t1,
163
+ ...props
164
+ });
165
+ $[6] = props;
166
+ $[7] = ref;
167
+ $[8] = t1;
168
+ $[9] = t2;
169
+ } else t2 = $[9];
170
+ return t2;
171
+ }
172
+ function FieldItem(t0) {
173
+ const $ = c(10);
174
+ let className;
175
+ let props;
176
+ let ref;
177
+ if ($[0] !== t0) {
178
+ ({className, ref, ...props} = t0);
179
+ $[0] = t0;
180
+ $[1] = className;
181
+ $[2] = props;
182
+ $[3] = ref;
183
+ } else {
184
+ className = $[1];
185
+ props = $[2];
186
+ ref = $[3];
187
+ }
188
+ let t1;
189
+ if ($[4] !== className) {
190
+ t1 = withClass("oui-field__item", className);
191
+ $[4] = className;
192
+ $[5] = t1;
193
+ } else t1 = $[5];
194
+ let t2;
195
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
196
+ t2 = /* @__PURE__ */ jsx(Field.Item, {
197
+ ref,
198
+ className: t1,
199
+ ...props
200
+ });
201
+ $[6] = props;
202
+ $[7] = ref;
203
+ $[8] = t1;
204
+ $[9] = t2;
205
+ } else t2 = $[9];
206
+ return t2;
207
+ }
208
+ /**
209
+ * Field parts wire up labels, descriptions and validation for any control
210
+ * inside (Input, Select, Checkbox, Switch, NumberField…).
211
+ */
212
+ var Field$1 = {
213
+ Root: FieldRoot,
214
+ Label: FieldLabel,
215
+ Description: FieldDescription,
216
+ Error: FieldError,
217
+ Item: FieldItem,
218
+ Validity: Field.Validity
219
+ };
220
+ function FieldsetRoot(t0) {
221
+ const $ = c(10);
222
+ let className;
223
+ let props;
224
+ let ref;
225
+ if ($[0] !== t0) {
226
+ ({className, ref, ...props} = t0);
227
+ $[0] = t0;
228
+ $[1] = className;
229
+ $[2] = props;
230
+ $[3] = ref;
231
+ } else {
232
+ className = $[1];
233
+ props = $[2];
234
+ ref = $[3];
235
+ }
236
+ let t1;
237
+ if ($[4] !== className) {
238
+ t1 = withClass("oui-fieldset", className);
239
+ $[4] = className;
240
+ $[5] = t1;
241
+ } else t1 = $[5];
242
+ let t2;
243
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
244
+ t2 = /* @__PURE__ */ jsx(Fieldset.Root, {
245
+ ref,
246
+ className: t1,
247
+ ...props
248
+ });
249
+ $[6] = props;
250
+ $[7] = ref;
251
+ $[8] = t1;
252
+ $[9] = t2;
253
+ } else t2 = $[9];
254
+ return t2;
255
+ }
256
+ function FieldsetLegend(t0) {
257
+ const $ = c(10);
258
+ let className;
259
+ let props;
260
+ let ref;
261
+ if ($[0] !== t0) {
262
+ ({className, ref, ...props} = t0);
263
+ $[0] = t0;
264
+ $[1] = className;
265
+ $[2] = props;
266
+ $[3] = ref;
267
+ } else {
268
+ className = $[1];
269
+ props = $[2];
270
+ ref = $[3];
271
+ }
272
+ let t1;
273
+ if ($[4] !== className) {
274
+ t1 = withClass("oui-fieldset__legend", className);
275
+ $[4] = className;
276
+ $[5] = t1;
277
+ } else t1 = $[5];
278
+ let t2;
279
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
280
+ t2 = /* @__PURE__ */ jsx(Fieldset.Legend, {
281
+ ref,
282
+ className: t1,
283
+ ...props
284
+ });
285
+ $[6] = props;
286
+ $[7] = ref;
287
+ $[8] = t1;
288
+ $[9] = t2;
289
+ } else t2 = $[9];
290
+ return t2;
291
+ }
292
+ /** Groups related fields under a legend. */
293
+ var Fieldset$1 = {
294
+ Root: FieldsetRoot,
295
+ Legend: FieldsetLegend
296
+ };
297
+ /** Form with Base UI validation wiring and vertical field spacing. */
298
+ function Form$1(t0) {
299
+ const $ = c(10);
300
+ let className;
301
+ let props;
302
+ let ref;
303
+ if ($[0] !== t0) {
304
+ ({className, ref, ...props} = t0);
305
+ $[0] = t0;
306
+ $[1] = className;
307
+ $[2] = props;
308
+ $[3] = ref;
309
+ } else {
310
+ className = $[1];
311
+ props = $[2];
312
+ ref = $[3];
313
+ }
314
+ let t1;
315
+ if ($[4] !== className) {
316
+ t1 = withClass("oui-form", className);
317
+ $[4] = className;
318
+ $[5] = t1;
319
+ } else t1 = $[5];
320
+ let t2;
321
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
322
+ t2 = /* @__PURE__ */ jsx(Form, {
323
+ ref,
324
+ className: t1,
325
+ ...props
326
+ });
327
+ $[6] = props;
328
+ $[7] = ref;
329
+ $[8] = t1;
330
+ $[9] = t2;
331
+ } else t2 = $[9];
332
+ return t2;
333
+ }
334
+ //#endregion
335
+ export { Field$1 as Field, Fieldset$1 as Fieldset, Form$1 as Form };
336
+
337
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","names":["Field","BaseField","Fieldset","BaseFieldset","Form","BaseForm","withClass","FieldRoot","t0","$","_c","className","props","ref","t1","t2","FieldLabelProps","Label","Props","required","FieldLabel","children","t3","FieldDescription","FieldError","FieldItem","Root","Description","Error","Item","Validity","FieldsetRoot","FieldsetLegend","Legend","FormProps","_c","BaseField","Field","BaseFieldset","Fieldset","Form","BaseForm"],"sources":["../../../src/components/field/Field.tsx"],"sourcesContent":["import { Field as BaseField } from '@base-ui/react/field';\nimport { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';\nimport { Form as BaseForm } from '@base-ui/react/form';\nimport { withClass } from '../../utils/cx';\n\nfunction FieldRoot({ className, ref, ...props }: BaseField.Root.Props) {\n return <BaseField.Root ref={ref} className={withClass('oui-field', className)} {...props} />;\n}\n\nexport interface FieldLabelProps extends BaseField.Label.Props {\n /** Appends a required marker. */\n required?: boolean;\n}\n\nfunction FieldLabel({ className, required, children, ref, ...props }: FieldLabelProps) {\n return (\n <BaseField.Label ref={ref} className={withClass('oui-field__label', className)} {...props}>\n {children}\n {required && (\n <span className=\"oui-field__required\" aria-hidden>\n *\n </span>\n )}\n </BaseField.Label>\n );\n}\n\nfunction FieldDescription({ className, ref, ...props }: BaseField.Description.Props) {\n return <BaseField.Description ref={ref} className={withClass('oui-field__description', className)} {...props} />;\n}\n\nfunction FieldError({ className, ref, ...props }: BaseField.Error.Props) {\n return <BaseField.Error ref={ref} className={withClass('oui-field__error', className)} {...props} />;\n}\n\nfunction FieldItem({ className, ref, ...props }: BaseField.Item.Props) {\n return <BaseField.Item ref={ref} className={withClass('oui-field__item', className)} {...props} />;\n}\n\n/**\n * Field parts wire up labels, descriptions and validation for any control\n * inside (Input, Select, Checkbox, Switch, NumberField…).\n */\nexport const Field = {\n Root: FieldRoot,\n Label: FieldLabel,\n Description: FieldDescription,\n Error: FieldError,\n Item: FieldItem,\n Validity: BaseField.Validity,\n};\n\nfunction FieldsetRoot({ className, ref, ...props }: BaseFieldset.Root.Props) {\n return <BaseFieldset.Root ref={ref} className={withClass('oui-fieldset', className)} {...props} />;\n}\n\nfunction FieldsetLegend({ className, ref, ...props }: BaseFieldset.Legend.Props) {\n return <BaseFieldset.Legend ref={ref} className={withClass('oui-fieldset__legend', className)} {...props} />;\n}\n\n/** Groups related fields under a legend. */\nexport const Fieldset = { Root: FieldsetRoot, Legend: FieldsetLegend };\n\nexport interface FormProps extends BaseForm.Props {}\n\n/** Form with Base UI validation wiring and vertical field spacing. */\nexport function Form({ className, ref, ...props }: FormProps) {\n return <BaseForm ref={ref} className={withClass('oui-form', className)} {...props} />;\n}\n"],"mappings":";;;;;;;;AAKA,SAAAO,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,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;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAAG,WAAAE,KAAA,GAAAD,SAAAJ;EAAuCC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,MAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,WAAA;EACpBG,KAAAR,UAAU,YAAYK,SAAS;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAG,SAAAH,EAAA,OAAAI,OAAAJ,EAAA,OAAAK,IAAA;EAA/DC,KAAA,oBAAC0B,MAAD;GAAe5B;GAAgB,WAAAC;GAAgC,GAAMF;EAAK,CAAA;EAAIH,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA9EM;AAA8E"}
@@ -0,0 +1,91 @@
1
+ import * as React from 'react';
2
+ export interface FileRejection {
3
+ file: File;
4
+ /** `type`: not matched by `accept`. `size`: larger than `maxSize`. `count`: over the file limit. */
5
+ reason: 'type' | 'size' | 'count';
6
+ }
7
+ /** `1536` → `"1.5 KB"`. */
8
+ export declare function formatFileSize(bytes: number, locale?: string): string;
9
+ export interface DropzoneProps extends Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'title'> {
10
+ ref?: React.Ref<HTMLLabelElement>;
11
+ /** Called with the picked or dropped files that pass `accept` and `maxSize`. */
12
+ onFiles?: (files: File[]) => void;
13
+ /** Called with the files that were turned away, and why. */
14
+ onReject?: (rejections: FileRejection[]) => void;
15
+ /** Allowed types, as for `<input accept>`: `".pdf,image/*"`. */
16
+ accept?: string;
17
+ multiple?: boolean;
18
+ /** Largest allowed file, in bytes. */
19
+ maxSize?: number;
20
+ /**
21
+ * The current selection. It is kept in the native input, so the files submit
22
+ * with a form and `required` validates. Without it the input is emptied after each pick.
23
+ */
24
+ files?: File[];
25
+ disabled?: boolean;
26
+ invalid?: boolean;
27
+ /** `sm` is a single compact row. */
28
+ size?: 'sm' | 'md';
29
+ icon?: React.ReactNode;
30
+ title?: React.ReactNode;
31
+ /** Secondary line, e.g. the allowed types and size. */
32
+ hint?: React.ReactNode;
33
+ /** Props for the file input (name, id, required, aria-*…). */
34
+ inputProps?: Omit<React.ComponentProps<'input'>, 'ref' | 'type'>;
35
+ }
36
+ /** Drop target that also opens the file browser on click, Enter or Space. */
37
+ export declare function Dropzone({ onFiles, onReject, accept, multiple, maxSize, files, disabled, invalid, size, icon, title, hint, inputProps, className, children, ref, ...props }: DropzoneProps): React.JSX.Element;
38
+ export type FileItemStatus = 'idle' | 'uploading' | 'success' | 'error';
39
+ export interface FileItemProps extends React.HTMLAttributes<HTMLDivElement> {
40
+ ref?: React.Ref<HTMLDivElement>;
41
+ name: string;
42
+ /** Size in bytes. */
43
+ size?: number;
44
+ icon?: React.ReactNode;
45
+ status?: FileItemStatus;
46
+ /** Upload progress from 0 to 100, shown while `uploading`. `null` is indeterminate. */
47
+ progress?: number | null;
48
+ /** Message shown in place of the size when `status` is `error`. */
49
+ error?: React.ReactNode;
50
+ /** Adds the remove button. */
51
+ onRemove?: () => void;
52
+ removeLabel?: string;
53
+ /** Extra controls before the remove button (download, preview…). */
54
+ actions?: React.ReactNode;
55
+ /** BCP 47 locale for the size. */
56
+ locale?: string;
57
+ }
58
+ /** One file in a list: name, size, upload progress or error, and a remove button. */
59
+ export declare function FileItem({ name, size, icon, status, progress, error, onRemove, removeLabel, actions, locale, className, ref, ...props }: FileItemProps): React.JSX.Element;
60
+ export interface FileUploadLabels {
61
+ remove: (name: string) => string;
62
+ }
63
+ export interface FileUploadProps extends Pick<DropzoneProps, 'accept' | 'multiple' | 'maxSize' | 'onReject' | 'size' | 'icon' | 'title' | 'hint'> {
64
+ ref?: React.Ref<HTMLLabelElement>;
65
+ value?: File[];
66
+ defaultValue?: File[];
67
+ onValueChange?: (files: File[]) => void;
68
+ /** Most files allowed when `multiple`. */
69
+ maxFiles?: number;
70
+ /** Upload state of a file, for showing progress and errors in the list. */
71
+ fileState?: (file: File) => Pick<FileItemProps, 'status' | 'progress' | 'error'> | undefined;
72
+ label?: React.ReactNode;
73
+ description?: React.ReactNode;
74
+ /** Error message. When set, the field is marked invalid. */
75
+ error?: React.ReactNode;
76
+ required?: boolean;
77
+ disabled?: boolean;
78
+ /** Submits the files with a form under this name. */
79
+ name?: string;
80
+ id?: string;
81
+ className?: string;
82
+ /** BCP 47 locale for file sizes. */
83
+ locale?: string;
84
+ /** Override texts for localisation. */
85
+ labels?: Partial<FileUploadLabels>;
86
+ }
87
+ /**
88
+ * File field: a dropzone plus the list of chosen files. It only collects
89
+ * `File` objects; upload them yourself and report progress through `fileState`.
90
+ */
91
+ export declare function FileUpload({ value, defaultValue, onValueChange, accept, multiple, maxSize, maxFiles, onReject, fileState, size, icon, title, hint, label, description, error, required, disabled, name, id: idProp, className, locale, labels, ref, }: FileUploadProps): React.JSX.Element;