@igne-agency/react-web-ui 0.4.0 → 0.6.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 (257) hide show
  1. package/dist/base.css +3 -0
  2. package/dist/components/accordion/accordion.css +21 -21
  3. package/dist/components/accordion/accordion.d.ts +17 -4
  4. package/dist/components/accordion/accordion.js +83 -36
  5. package/dist/components/accordion/accordion.module.js +6 -6
  6. package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
  7. package/dist/components/attachment-tile/attachment-preview.js +388 -119
  8. package/dist/components/attachment-tile/attachment-tile.css +31 -25
  9. package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
  10. package/dist/components/attachment-tile/attachment-tile.js +160 -43
  11. package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
  12. package/dist/components/attachment-tile/index.d.ts +1 -1
  13. package/dist/components/avatar/avatar.css +9 -9
  14. package/dist/components/avatar/avatar.d.ts +50 -5
  15. package/dist/components/avatar/avatar.js +178 -64
  16. package/dist/components/avatar/avatar.module.js +3 -3
  17. package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
  18. package/dist/components/avatar-group/avatar-group-context.js +2 -2
  19. package/dist/components/avatar-group/avatar-group.css +26 -20
  20. package/dist/components/avatar-group/avatar-group.d.ts +85 -27
  21. package/dist/components/avatar-group/avatar-group.js +400 -246
  22. package/dist/components/avatar-group/avatar-group.module.js +8 -8
  23. package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
  25. package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
  26. package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
  27. package/dist/components/button/button.css +29 -31
  28. package/dist/components/button/button.d.ts +20 -16
  29. package/dist/components/button/button.js +140 -145
  30. package/dist/components/button/button.module.js +1 -1
  31. package/dist/components/button/index.js +1 -1
  32. package/dist/components/checkbox-field/checkbox-field.js +63 -49
  33. package/dist/components/checkbox-field/checkbox.css +105 -56
  34. package/dist/components/checkbox-field/checkbox.d.ts +3 -2
  35. package/dist/components/checkbox-field/checkbox.js +12 -9
  36. package/dist/components/checkbox-field/checkbox.module.js +4 -4
  37. package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
  38. package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
  39. package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
  40. package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
  41. package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
  42. package/dist/components/collapsible/collapsible.css +20 -20
  43. package/dist/components/collapsible/collapsible.d.ts +17 -4
  44. package/dist/components/collapsible/collapsible.js +83 -36
  45. package/dist/components/collapsible/collapsible.module.js +5 -5
  46. package/dist/components/combobox-field/combobox-field.js +206 -158
  47. package/dist/components/combobox-field/combobox.css +492 -277
  48. package/dist/components/combobox-field/combobox.d.ts +148 -39
  49. package/dist/components/combobox-field/combobox.js +506 -206
  50. package/dist/components/combobox-field/combobox.module.js +21 -21
  51. package/dist/components/combobox-field/value-state-view.css +5 -5
  52. package/dist/components/combobox-field/value-state-view.module.js +4 -4
  53. package/dist/components/composer/composer-attachments.d.ts +30 -11
  54. package/dist/components/composer/composer-attachments.js +45 -40
  55. package/dist/components/composer/composer-editor.css +40 -35
  56. package/dist/components/composer/composer-editor.d.ts +14 -4
  57. package/dist/components/composer/composer-editor.js +134 -44
  58. package/dist/components/composer/composer-editor.module.js +5 -5
  59. package/dist/components/composer/composer.css +22 -22
  60. package/dist/components/composer/composer.d.ts +13 -2
  61. package/dist/components/composer/composer.js +78 -63
  62. package/dist/components/composer/composer.module.js +5 -5
  63. package/dist/components/composer/index.d.ts +2 -2
  64. package/dist/components/composer/mention-text.css +5 -5
  65. package/dist/components/composer/mention-text.module.js +1 -1
  66. package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
  67. package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
  68. package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
  69. package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
  70. package/dist/components/conversation/conversation.css +52 -52
  71. package/dist/components/conversation/conversation.d.ts +43 -18
  72. package/dist/components/conversation/conversation.js +120 -78
  73. package/dist/components/conversation/conversation.module.js +15 -15
  74. package/dist/components/date-field/date-field.d.ts +1 -1
  75. package/dist/components/date-field/date-field.js +202 -100
  76. package/dist/components/date-field/date-input.d.ts +73 -37
  77. package/dist/components/date-field/date-input.js +72 -45
  78. package/dist/components/date-field/index.d.ts +1 -1
  79. package/dist/components/date-range-field/date-range-field.d.ts +1 -1
  80. package/dist/components/date-range-field/date-range-field.js +219 -107
  81. package/dist/components/date-range-field/date-range-input.d.ts +84 -40
  82. package/dist/components/date-range-field/date-range-input.js +83 -48
  83. package/dist/components/dialog/dialog.css +32 -32
  84. package/dist/components/dialog/dialog.d.ts +8 -7
  85. package/dist/components/dialog/dialog.js +8 -26
  86. package/dist/components/dialog/dialog.module.js +6 -6
  87. package/dist/components/divider/divider.css +6 -6
  88. package/dist/components/divider/divider.d.ts +36 -2
  89. package/dist/components/divider/divider.js +195 -29
  90. package/dist/components/divider/divider.module.js +3 -3
  91. package/dist/components/drawer/drawer.css +55 -56
  92. package/dist/components/drawer/drawer.d.ts +8 -7
  93. package/dist/components/drawer/drawer.js +8 -26
  94. package/dist/components/drawer/drawer.module.js +6 -6
  95. package/dist/components/field/field.css +34 -24
  96. package/dist/components/field/field.d.ts +60 -37
  97. package/dist/components/field/field.js +242 -157
  98. package/dist/components/field/field.module.js +12 -10
  99. package/dist/components/field/input-parts.d.ts +11 -13
  100. package/dist/components/field/input-parts.js +23 -42
  101. package/dist/components/field-placeholder/field-placeholder.css +6 -6
  102. package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
  103. package/dist/components/fieldset/field-group.d.ts +1 -1
  104. package/dist/components/fieldset/field-group.js +48 -42
  105. package/dist/components/fieldset/fieldset-root.d.ts +1 -1
  106. package/dist/components/fieldset/fieldset-root.js +19 -17
  107. package/dist/components/fieldset/fieldset.d.ts +2 -2
  108. package/dist/components/fieldset/fieldset.js +2 -2
  109. package/dist/components/file-field/file-field.css +126 -60
  110. package/dist/components/file-field/file-field.js +201 -109
  111. package/dist/components/file-field/file-field.module.js +4 -4
  112. package/dist/components/file-field/file-input.d.ts +66 -40
  113. package/dist/components/file-field/file-input.js +188 -132
  114. package/dist/components/filter-bar/filter-bar.css +8 -8
  115. package/dist/components/filter-bar/filter-bar.d.ts +12 -3
  116. package/dist/components/filter-bar/filter-bar.js +23 -25
  117. package/dist/components/filter-bar/filter-bar.module.js +5 -5
  118. package/dist/components/form/form.d.ts +19 -7
  119. package/dist/components/form/form.js +80 -29
  120. package/dist/components/icon/icon.css +2 -2
  121. package/dist/components/icon/icon.module.js +1 -1
  122. package/dist/components/link/link.css +6 -5
  123. package/dist/components/link/link.module.js +1 -1
  124. package/dist/components/menu/menu.css +52 -47
  125. package/dist/components/menu/menu.d.ts +32 -25
  126. package/dist/components/menu/menu.js +75 -124
  127. package/dist/components/menu/menu.module.js +8 -8
  128. package/dist/components/nav/nav-context.d.ts +1 -1
  129. package/dist/components/nav/nav-item-view.d.ts +10 -13
  130. package/dist/components/nav/nav-item-view.js +42 -54
  131. package/dist/components/nav/nav.css +150 -119
  132. package/dist/components/nav/nav.d.ts +61 -17
  133. package/dist/components/nav/nav.js +271 -176
  134. package/dist/components/nav/nav.module.js +17 -15
  135. package/dist/components/number-field/number-field.css +153 -64
  136. package/dist/components/number-field/number-field.d.ts +2 -2
  137. package/dist/components/number-field/number-field.js +112 -91
  138. package/dist/components/number-field/number-field.module.js +6 -6
  139. package/dist/components/number-field/number-input.d.ts +43 -23
  140. package/dist/components/number-field/number-input.js +179 -125
  141. package/dist/components/otp-field/otp-field.css +153 -60
  142. package/dist/components/otp-field/otp-field.d.ts +2 -2
  143. package/dist/components/otp-field/otp-field.js +62 -46
  144. package/dist/components/otp-field/otp-field.module.js +4 -4
  145. package/dist/components/otp-field/otp-input.d.ts +8 -6
  146. package/dist/components/otp-field/otp-input.js +92 -92
  147. package/dist/components/pagination/pagination.d.ts +46 -15
  148. package/dist/components/pagination/pagination.js +217 -224
  149. package/dist/components/password-field/password-field.css +23 -23
  150. package/dist/components/password-field/password-field.js +107 -85
  151. package/dist/components/password-field/password-field.module.js +8 -8
  152. package/dist/components/password-field/password-strength.d.ts +107 -3
  153. package/dist/components/password-field/password-strength.js +569 -92
  154. package/dist/components/photo-field/photo-field.js +137 -112
  155. package/dist/components/photo-field/photo-input.css +67 -44
  156. package/dist/components/photo-field/photo-input.d.ts +59 -15
  157. package/dist/components/photo-field/photo-input.js +173 -86
  158. package/dist/components/photo-field/photo-input.module.js +10 -8
  159. package/dist/components/popover/popover.css +41 -41
  160. package/dist/components/popover/popover.d.ts +66 -25
  161. package/dist/components/popover/popover.js +332 -217
  162. package/dist/components/popover/popover.module.js +15 -19
  163. package/dist/components/radio-group-field/radio-group-field.js +80 -71
  164. package/dist/components/radio-group-field/radio-group.css +112 -60
  165. package/dist/components/radio-group-field/radio-group.d.ts +19 -3
  166. package/dist/components/radio-group-field/radio-group.js +66 -23
  167. package/dist/components/radio-group-field/radio-group.module.js +4 -4
  168. package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
  169. package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
  170. package/dist/components/segmented-control-field/segmented-control.css +132 -79
  171. package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
  172. package/dist/components/segmented-control-field/segmented-control.js +124 -41
  173. package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
  174. package/dist/components/select-field/select.css +214 -101
  175. package/dist/components/select-field/select.d.ts +43 -11
  176. package/dist/components/select-field/select.js +194 -109
  177. package/dist/components/select-field/select.module.js +14 -14
  178. package/dist/components/skeleton/skeleton.css +4 -4
  179. package/dist/components/skeleton/skeleton.module.js +3 -3
  180. package/dist/components/stale/stale.css +15 -15
  181. package/dist/components/stale/stale.d.ts +27 -3
  182. package/dist/components/stale/stale.js +147 -66
  183. package/dist/components/stale/stale.module.js +6 -6
  184. package/dist/components/status-message/status-message.css +22 -22
  185. package/dist/components/status-message/status-message.module.js +6 -6
  186. package/dist/components/switch-field/switch-field.js +77 -57
  187. package/dist/components/switch-field/switch.css +112 -63
  188. package/dist/components/switch-field/switch.d.ts +20 -3
  189. package/dist/components/switch-field/switch.js +70 -27
  190. package/dist/components/switch-field/switch.module.js +4 -4
  191. package/dist/components/tabs/tabs.css +32 -32
  192. package/dist/components/tabs/tabs.d.ts +21 -7
  193. package/dist/components/tabs/tabs.js +73 -14
  194. package/dist/components/tabs/tabs.module.js +7 -7
  195. package/dist/components/tag/tag.css +84 -84
  196. package/dist/components/tag/tag.module.js +3 -3
  197. package/dist/components/tag-group/tag-group.css +94 -94
  198. package/dist/components/tag-group/tag-group.module.js +4 -4
  199. package/dist/components/text-field/text-field.css +159 -82
  200. package/dist/components/text-field/text-field.d.ts +1 -1
  201. package/dist/components/text-field/text-field.js +139 -110
  202. package/dist/components/text-field/text-field.module.js +9 -9
  203. package/dist/components/text-field/text-input.d.ts +81 -45
  204. package/dist/components/text-field/text-input.js +366 -217
  205. package/dist/components/textarea-field/textarea-field.css +7 -2
  206. package/dist/components/textarea-field/textarea-field.js +72 -56
  207. package/dist/components/textarea-field/textarea-field.module.js +2 -2
  208. package/dist/components/time-field/time-field.js +153 -60
  209. package/dist/components/time-field/time-input.d.ts +21 -10
  210. package/dist/components/time-field/time-input.js +22 -11
  211. package/dist/components/toast/toast-provider.css +34 -31
  212. package/dist/components/toast/toast-provider.d.ts +63 -14
  213. package/dist/components/toast/toast-provider.js +174 -111
  214. package/dist/components/toast/toast-provider.module.js +7 -7
  215. package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
  216. package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
  217. package/dist/components/toggle-group-field/toggle-group.css +117 -67
  218. package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
  219. package/dist/components/toggle-group-field/toggle-group.js +2 -2
  220. package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
  221. package/dist/components/tooltip/tooltip.css +4 -4
  222. package/dist/components/tooltip/tooltip.module.js +1 -1
  223. package/dist/data-table/data-table-content.js +6 -5
  224. package/dist/data-table/data-table-parts.d.ts +41 -13
  225. package/dist/data-table/data-table-parts.js +213 -172
  226. package/dist/data-table/data-table-selection.d.ts +105 -3
  227. package/dist/data-table/data-table-selection.js +654 -145
  228. package/dist/data-table/data-table.css +125 -128
  229. package/dist/data-table/data-table.d.ts +21 -26
  230. package/dist/data-table/data-table.js +20 -23
  231. package/dist/data-table/data-table.module.js +32 -34
  232. package/dist/data-table/index.d.ts +2 -2
  233. package/dist/index.js +3 -3
  234. package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
  235. package/dist/lib/calendar/calendar-navigation.js +185 -118
  236. package/dist/lib/calendar/calendar-parts.d.ts +143 -0
  237. package/dist/lib/calendar/calendar-parts.js +540 -0
  238. package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
  239. package/dist/lib/calendar/calendar-prefab.js +311 -0
  240. package/dist/lib/calendar/calendar-year.d.ts +3 -1
  241. package/dist/lib/calendar/calendar-year.js +139 -131
  242. package/dist/lib/calendar/temporal.css +325 -232
  243. package/dist/lib/calendar/temporal.d.ts +67 -82
  244. package/dist/lib/calendar/temporal.js +258 -569
  245. package/dist/lib/calendar/temporal.module.js +38 -38
  246. package/dist/lib/forms/use-connected-field.d.ts +1 -1
  247. package/dist/lib/forms/use-connected-field.js +1 -1
  248. package/dist/lib/render-as.d.ts +13 -0
  249. package/dist/lib/render-as.js +46 -0
  250. package/dist/terrazzo/index.d.ts +4 -3
  251. package/dist/terrazzo/index.js +17 -6
  252. package/dist/tokens.css +28 -4
  253. package/package.json +2 -2
  254. package/tokens/dark.tokens.json +6 -0
  255. package/tokens/sys.tokens.json +7 -0
  256. package/dist/components/button/close-button.d.ts +0 -16
  257. package/dist/components/button/close-button.js +0 -30
@@ -1,17 +1,17 @@
1
+ import { renderAs } from "../../lib/render-as.js";
1
2
  import { AttachmentTile } from "../attachment-tile/attachment-tile.js";
2
- import { Button as Button$1 } from "../button/button.js";
3
3
  import { Field } from "../field/field.js";
4
4
  import { fieldStateAttributes } from "../field/field-state.js";
5
5
  import file_field_module_default from "./file-field.module.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { clsx } from "clsx";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- import { Button, DropZone, FileTrigger, TagGroup, TagList } from "react-aria-components";
8
+ import { jsx } from "react/jsx-runtime";
9
+ import { Button, DropZone, FileTrigger, Tag, TagGroup, TagList } from "react-aria-components";
10
10
  import { Fieldset } from "@base-ui/react/fieldset";
11
11
  // src/components/file-field/file-input.tsx
12
12
  /** The fieldset around the file input, which projects its state as `data-*` attributes. */
13
13
  var FileInputRoot = (t0) => {
14
- const $ = c(15);
14
+ const $ = c(16);
15
15
  let disabled;
16
16
  let props;
17
17
  let state;
@@ -32,33 +32,36 @@ var FileInputRoot = (t0) => {
32
32
  $[4] = disabled;
33
33
  $[5] = t1;
34
34
  } else t1 = $[5];
35
- let t2;
35
+ const t2 = state?.requiredness;
36
+ let t3;
36
37
  if ($[6] !== state) {
37
- t2 = state ?? {};
38
+ t3 = state ?? {};
38
39
  $[6] = state;
39
- $[7] = t2;
40
- } else t2 = $[7];
41
- let t3;
42
- if ($[8] !== t2) {
43
- t3 = fieldStateAttributes(t2);
44
- $[8] = t2;
45
- $[9] = t3;
46
- } else t3 = $[9];
40
+ $[7] = t3;
41
+ } else t3 = $[7];
47
42
  let t4;
48
- if ($[10] !== disabled || $[11] !== props || $[12] !== t1 || $[13] !== t3) {
49
- t4 = /* @__PURE__ */ jsx(Field.Root, {
43
+ if ($[8] !== t3) {
44
+ t4 = fieldStateAttributes(t3);
45
+ $[8] = t3;
46
+ $[9] = t4;
47
+ } else t4 = $[9];
48
+ let t5;
49
+ if ($[10] !== disabled || $[11] !== props || $[12] !== t1 || $[13] !== t2 || $[14] !== t4) {
50
+ t5 = /* @__PURE__ */ jsx(Field.Root, {
50
51
  render: t1,
51
52
  disabled,
52
- ...t3,
53
+ requiredness: t2,
54
+ ...t4,
53
55
  ...props
54
56
  });
55
57
  $[10] = disabled;
56
58
  $[11] = props;
57
59
  $[12] = t1;
58
- $[13] = t3;
60
+ $[13] = t2;
59
61
  $[14] = t4;
60
- } else t4 = $[14];
61
- return t4;
62
+ $[15] = t5;
63
+ } else t5 = $[15];
64
+ return t5;
62
65
  };
63
66
  /** The legend that names the fieldset. */
64
67
  var FileInputLegend = (props) => {
@@ -129,130 +132,152 @@ var FileInputDropTarget = (t0) => {
129
132
  } else t4 = $[13];
130
133
  return t4;
131
134
  };
132
- /** The prompt inside the drop target, with an optional `icon` above it. */
135
+ /**
136
+ * The prompt inside the drop target, holding its text and an optional
137
+ * `HintIcon` above it.
138
+ *
139
+ * @example
140
+ * <FileInput.Hint>
141
+ * <FileInput.HintIcon><UploadFileIcon /></FileInput.HintIcon>
142
+ * Drag files here
143
+ * </FileInput.Hint>
144
+ */
133
145
  var FileInputHint = (t0) => {
134
- const $ = c(14);
146
+ const $ = c(8);
147
+ let className;
148
+ let props;
149
+ if ($[0] !== t0) {
150
+ ({className, ...props} = t0);
151
+ $[0] = t0;
152
+ $[1] = className;
153
+ $[2] = props;
154
+ } else {
155
+ className = $[1];
156
+ props = $[2];
157
+ }
158
+ let t1;
159
+ if ($[3] !== className) {
160
+ t1 = clsx(file_field_module_default.hint, className);
161
+ $[3] = className;
162
+ $[4] = t1;
163
+ } else t1 = $[4];
164
+ let t2;
165
+ if ($[5] !== props || $[6] !== t1) {
166
+ t2 = /* @__PURE__ */ jsx("p", {
167
+ className: t1,
168
+ ...props
169
+ });
170
+ $[5] = props;
171
+ $[6] = t1;
172
+ $[7] = t2;
173
+ } else t2 = $[7];
174
+ return t2;
175
+ };
176
+ /**
177
+ * The glyph above the prompt, such as an upload icon. Renders nothing without
178
+ * children.
179
+ *
180
+ * @example
181
+ * <FileInput.HintIcon><UploadFileIcon /></FileInput.HintIcon>
182
+ */
183
+ var FileInputHintIcon = (t0) => {
184
+ const $ = c(8);
135
185
  let children;
136
186
  let className;
137
- let icon;
138
187
  let props;
139
188
  if ($[0] !== t0) {
140
- ({className, icon, children, ...props} = t0);
189
+ ({className, children, ...props} = t0);
141
190
  $[0] = t0;
142
191
  $[1] = children;
143
192
  $[2] = className;
144
- $[3] = icon;
145
- $[4] = props;
193
+ $[3] = props;
146
194
  } else {
147
195
  children = $[1];
148
196
  className = $[2];
149
- icon = $[3];
150
- props = $[4];
197
+ props = $[3];
151
198
  }
152
199
  let t1;
153
- if ($[5] !== className) {
154
- t1 = clsx(file_field_module_default.hint, className);
155
- $[5] = className;
156
- $[6] = t1;
157
- } else t1 = $[6];
158
- let t2;
159
- if ($[7] !== icon) {
160
- t2 = icon === void 0 ? null : /* @__PURE__ */ jsx("span", {
200
+ if ($[4] !== children || $[5] !== className || $[6] !== props) {
201
+ t1 = children === void 0 || children === null || children === false ? null : /* @__PURE__ */ jsx("span", {
161
202
  "aria-hidden": "true",
162
- className: file_field_module_default.hintIcon,
163
- children: icon
164
- });
165
- $[7] = icon;
166
- $[8] = t2;
167
- } else t2 = $[8];
168
- let t3;
169
- if ($[9] !== children || $[10] !== props || $[11] !== t1 || $[12] !== t2) {
170
- t3 = /* @__PURE__ */ jsxs("p", {
171
- className: t1,
203
+ className: clsx(file_field_module_default.hintIcon, className),
172
204
  ...props,
173
- children: [t2, children]
205
+ children
174
206
  });
175
- $[9] = children;
176
- $[10] = props;
177
- $[11] = t1;
178
- $[12] = t2;
179
- $[13] = t3;
180
- } else t3 = $[13];
181
- return t3;
207
+ $[4] = children;
208
+ $[5] = className;
209
+ $[6] = props;
210
+ $[7] = t1;
211
+ } else t1 = $[7];
212
+ return t1;
182
213
  };
183
- /** The button that opens the file dialog. */
214
+ /**
215
+ * The button that opens the file dialog. It renders whichever button it is
216
+ * given.
217
+ *
218
+ * @example
219
+ * <FileInput.Trigger
220
+ * onSelect={onSelect}
221
+ * render={<Button variant="secondary" size="sm" icon={<AttachFileIcon />}>Choose files</Button>}
222
+ * />
223
+ */
184
224
  var FileInputTrigger = (t0) => {
185
- const $ = c(22);
225
+ const $ = c(18);
186
226
  let buttonRef;
187
227
  let describedBy;
188
228
  let disabled;
189
- let icon;
190
229
  let invalid;
191
- let label;
192
230
  let props;
231
+ let render;
193
232
  if ($[0] !== t0) {
194
- ({label, disabled, describedBy, buttonRef, invalid, icon, ...props} = t0);
233
+ ({render, disabled, describedBy, buttonRef, invalid, ...props} = t0);
195
234
  $[0] = t0;
196
235
  $[1] = buttonRef;
197
236
  $[2] = describedBy;
198
237
  $[3] = disabled;
199
- $[4] = icon;
200
- $[5] = invalid;
201
- $[6] = label;
202
- $[7] = props;
238
+ $[4] = invalid;
239
+ $[5] = props;
240
+ $[6] = render;
203
241
  } else {
204
242
  buttonRef = $[1];
205
243
  describedBy = $[2];
206
244
  disabled = $[3];
207
- icon = $[4];
208
- invalid = $[5];
209
- label = $[6];
210
- props = $[7];
245
+ invalid = $[4];
246
+ props = $[5];
247
+ render = $[6];
211
248
  }
212
- const t1 = invalid === true ? "invalid" : void 0;
249
+ let t1;
250
+ if ($[7] !== invalid || $[8] !== render) {
251
+ t1 = renderAs(render, { ...fieldStateAttributes({ validity: invalid === true ? "invalid" : void 0 }) });
252
+ $[7] = invalid;
253
+ $[8] = render;
254
+ $[9] = t1;
255
+ } else t1 = $[9];
213
256
  let t2;
214
- if ($[8] !== t1) {
215
- t2 = fieldStateAttributes({ validity: t1 });
216
- $[8] = t1;
217
- $[9] = t2;
218
- } else t2 = $[9];
219
- let t3;
220
- if ($[10] !== disabled) {
221
- t3 = /* @__PURE__ */ jsx(Button, { isDisabled: disabled });
222
- $[10] = disabled;
223
- $[11] = t3;
224
- } else t3 = $[11];
225
- let t4;
226
- if ($[12] !== buttonRef || $[13] !== describedBy || $[14] !== icon || $[15] !== label || $[16] !== t2 || $[17] !== t3) {
227
- t4 = /* @__PURE__ */ jsx(Button$1, {
228
- variant: "secondary",
229
- size: "sm",
230
- icon,
257
+ if ($[10] !== buttonRef || $[11] !== describedBy || $[12] !== disabled || $[13] !== t1) {
258
+ t2 = /* @__PURE__ */ jsx(Button, {
231
259
  ref: buttonRef,
260
+ isDisabled: disabled,
232
261
  "aria-describedby": describedBy,
233
- ...t2,
234
- render: t3,
235
- children: label
262
+ render: t1
236
263
  });
237
- $[12] = buttonRef;
238
- $[13] = describedBy;
239
- $[14] = icon;
240
- $[15] = label;
241
- $[16] = t2;
242
- $[17] = t3;
243
- $[18] = t4;
244
- } else t4 = $[18];
245
- let t5;
246
- if ($[19] !== props || $[20] !== t4) {
247
- t5 = /* @__PURE__ */ jsx(FileTrigger, {
264
+ $[10] = buttonRef;
265
+ $[11] = describedBy;
266
+ $[12] = disabled;
267
+ $[13] = t1;
268
+ $[14] = t2;
269
+ } else t2 = $[14];
270
+ let t3;
271
+ if ($[15] !== props || $[16] !== t2) {
272
+ t3 = /* @__PURE__ */ jsx(FileTrigger, {
248
273
  ...props,
249
- children: t4
274
+ children: t2
250
275
  });
251
- $[19] = props;
252
- $[20] = t4;
253
- $[21] = t5;
254
- } else t5 = $[21];
255
- return t5;
276
+ $[15] = props;
277
+ $[16] = t2;
278
+ $[17] = t3;
279
+ } else t3 = $[17];
280
+ return t3;
256
281
  };
257
282
  /** The staged files, as a group of removable tiles. */
258
283
  var FileInputList = (t0) => {
@@ -288,53 +313,83 @@ var FileInputList = (t0) => {
288
313
  } else t3 = $[8];
289
314
  return t3;
290
315
  };
291
- /** One staged file as an `AttachmentTile`. */
316
+ /**
317
+ * One staged file's tile in the `List`, holding `AttachmentTile`'s parts.
318
+ *
319
+ * @example
320
+ * <FileInput.Item id={id} textValue={file.name}>
321
+ * <AttachmentTile.Preview name={file.name} src={src}>…</AttachmentTile.Preview>
322
+ * </FileInput.Item>
323
+ */
292
324
  var FileInputItem = (t0) => {
293
- const $ = c(8);
325
+ const $ = c(12);
326
+ let id;
294
327
  let props;
295
328
  let t1;
296
- let t2;
329
+ let textValue;
297
330
  if ($[0] !== t0) {
298
- ({invalid: t1, disabled: t2, ...props} = t0);
331
+ ({id, textValue, disabled: t1, ...props} = t0);
299
332
  $[0] = t0;
300
- $[1] = props;
301
- $[2] = t1;
302
- $[3] = t2;
333
+ $[1] = id;
334
+ $[2] = props;
335
+ $[3] = t1;
336
+ $[4] = textValue;
303
337
  } else {
304
- props = $[1];
305
- t1 = $[2];
306
- t2 = $[3];
338
+ id = $[1];
339
+ props = $[2];
340
+ t1 = $[3];
341
+ textValue = $[4];
307
342
  }
308
- const invalid = t1 === void 0 ? false : t1;
309
- const disabled = t2 === void 0 ? false : t2;
343
+ const disabled = t1 === void 0 ? false : t1;
344
+ let t2;
345
+ if ($[5] !== disabled || $[6] !== id || $[7] !== textValue) {
346
+ t2 = /* @__PURE__ */ jsx(Tag, {
347
+ id,
348
+ textValue,
349
+ isDisabled: disabled
350
+ });
351
+ $[5] = disabled;
352
+ $[6] = id;
353
+ $[7] = textValue;
354
+ $[8] = t2;
355
+ } else t2 = $[8];
310
356
  let t3;
311
- if ($[4] !== disabled || $[5] !== invalid || $[6] !== props) {
312
- t3 = /* @__PURE__ */ jsx(AttachmentTile, {
313
- invalid,
314
- disabled,
357
+ if ($[9] !== props || $[10] !== t2) {
358
+ t3 = /* @__PURE__ */ jsx(AttachmentTile.Root, {
359
+ render: t2,
315
360
  ...props
316
361
  });
317
- $[4] = disabled;
318
- $[5] = invalid;
319
- $[6] = props;
320
- $[7] = t3;
321
- } else t3 = $[7];
362
+ $[9] = props;
363
+ $[10] = t2;
364
+ $[11] = t3;
365
+ } else t3 = $[11];
322
366
  return t3;
323
367
  };
324
368
  /**
325
369
  * The styled parts of a file input: the field frame around react-aria's
326
- * `DropZone` and `FileTrigger`, plus the staged files as removable
327
- * `AttachmentTile`s. The `Root` is a fieldset named by its `Legend`. For the
370
+ * `DropZone` and `FileTrigger`, plus the staged files as removable tiles built
371
+ * from `AttachmentTile`'s parts. The `Root` is a fieldset named by its `Legend`. For the
328
372
  * ordinary case, use `FileField`.
329
373
  *
330
374
  * @example
331
375
  * <FileInput.Root state={{ requiredness: "optional" }}>
332
- * <FileInput.Legend optionalLabel="optional">Attachments</FileInput.Legend>
376
+ * <FileInput.Legend>Attachments <Field.Requiredness optionalLabel="optional" /></FileInput.Legend>
333
377
  * <FileInput.DropTarget aria-label="Drop zone for attachments" onDrop={onDrop}>
334
- * <FileInput.Hint icon={<UploadFileIcon />}>Drag files here</FileInput.Hint>
335
- * <FileInput.Trigger label="Choose files" icon={<AttachFileIcon />} onSelect={onSelect} />
378
+ * <FileInput.Hint>
379
+ * <FileInput.HintIcon><UploadFileIcon /></FileInput.HintIcon>
380
+ * Drag files here
381
+ * </FileInput.Hint>
382
+ * <FileInput.Trigger
383
+ * onSelect={onSelect}
384
+ * render={<Button variant="secondary" size="sm" icon={<AttachFileIcon />}>Choose files</Button>}
385
+ * />
336
386
  * <FileInput.List label="Files for attachments" onRemove={onRemove}>
337
- * <FileInput.Item id={id} file={file} hint="invoice.pdf (12 kB)" removeLabel="Remove" removeIcon={<CloseIcon />} />
387
+ * <FileInput.Item id={id} textValue={file.name}>
388
+ * <AttachmentTile.Preview name={file.name} src={undefined}>
389
+ * <AttachmentTile.Extension />
390
+ * <AttachmentTile.Name />
391
+ * </AttachmentTile.Preview>
392
+ * </FileInput.Item>
338
393
  * </FileInput.List>
339
394
  * </FileInput.DropTarget>
340
395
  * </FileInput.Root>
@@ -344,6 +399,7 @@ var FileInput = {
344
399
  Legend: FileInputLegend,
345
400
  DropTarget: FileInputDropTarget,
346
401
  Hint: FileInputHint,
402
+ HintIcon: FileInputHintIcon,
347
403
  Trigger: FileInputTrigger,
348
404
  Pending: Field.Pending,
349
405
  List: FileInputList,
@@ -1,34 +1,34 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._bar_1j1i8_3 {
3
+ ._bar_lt3dt_3 {
4
4
  display: flex;
5
5
  flex-shrink: 0;
6
6
  flex-wrap: wrap;
7
7
  align-items: center;
8
8
  gap: var(--filter-bar-gap, var(--sys-unit-8));
9
9
  }
10
- ._search_1j1i8_10 {
10
+ ._search_lt3dt_10 {
11
11
  flex: 1 1 var(--filter-bar-search-basis, var(--sys-unit-64));
12
12
  min-inline-size: 0;
13
13
  }
14
- ._active_1j1i8_14 {
14
+ ._active_lt3dt_14 {
15
15
  display: flex;
16
16
  flex: 1 0 100%;
17
17
  flex-wrap: wrap;
18
18
  align-items: center;
19
19
  gap: var(--filter-bar-active-gap, var(--sys-unit-4));
20
20
  }
21
- ._fields_1j1i8_21 {
21
+ ._fields_lt3dt_21 {
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  gap: var(--filter-bar-fields-gap, var(--sys-unit-12));
25
- margin-block-start: var(--sys-unit-12);
25
+ margin-block-start: var(--filter-bar-fields-space, var(--sys-unit-12));
26
26
  }
27
- ._footer_1j1i8_27 {
27
+ ._footer_lt3dt_27 {
28
28
  display: flex;
29
29
  align-items: center;
30
30
  justify-content: flex-end;
31
- gap: var(--sys-unit-8);
32
- margin-block-start: var(--sys-unit-16);
31
+ gap: var(--filter-bar-footer-gap, var(--sys-unit-8));
32
+ margin-block-start: var(--filter-bar-footer-space, var(--sys-unit-16));
33
33
  }
34
34
  }
@@ -47,7 +47,16 @@ export type FilterBarContentProps = Readonly<{
47
47
  children: ReactNode;
48
48
  className?: string;
49
49
  }>;
50
- /** The drawer itself: its portal, backdrop, viewport and popup, around the content. */
50
+ /**
51
+ * The drawer itself, a `Drawer.Sheet`: its portal, backdrop, viewport and popup,
52
+ * around the content. For a drawer without the backdrop, compose `Drawer.Portal`,
53
+ * `Drawer.Viewport`, `Drawer.Popup` and `Drawer.Content` in its place.
54
+ *
55
+ * @example
56
+ * <FilterBar.Content>
57
+ * <FilterBar.Fields>…</FilterBar.Fields>
58
+ * </FilterBar.Content>
59
+ */
51
60
  declare const Content: ({ children, className, }: FilterBarContentProps) => ReactNode;
52
61
  export type FilterBarFieldsProps = useRender.ComponentProps<"div">;
53
62
  /** The filter controls, bound to the view's `draft`, in a column. */
@@ -86,7 +95,7 @@ type FilterBarParts = Readonly<{
86
95
  * Composite filter surface. `Root` holds a `useFilterView` in context: `Search`
87
96
  * and the `Drawer` share the leading row, and `Active`, the applied-filter row,
88
97
  * takes a line of its own. The drawer's header is the `Drawer` component's own
89
- * `Drawer.Header`, `Drawer.Title` and `Drawer.CloseButton`.
98
+ * `Drawer.Header`, `Drawer.Title` and `Drawer.Close`.
90
99
  *
91
100
  * @example
92
101
  * <FilterBar.Root filters={filters}>
@@ -96,7 +105,7 @@ type FilterBarParts = Readonly<{
96
105
  * <FilterBar.Content>
97
106
  * <Drawer.Header>
98
107
  * <Drawer.Title>Filter clients</Drawer.Title>
99
- * <Drawer.CloseButton closeLabel="Close" icon={<CloseIcon />} />
108
+ * <Drawer.Close render={<IconButton label="Close" variant="tertiary"><CloseIcon /></IconButton>} />
100
109
  * </Drawer.Header>
101
110
  * <FilterBar.Fields><ClientFilterFields filters={filters} /></FilterBar.Fields>
102
111
  * <FilterBar.Footer>
@@ -7,7 +7,7 @@ import filter_bar_module_default from "./filter-bar.module.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import { useRender } from "@base-ui/react/use-render";
9
9
  import { clsx } from "clsx";
10
- import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { jsx } from "react/jsx-runtime";
11
11
  import { createContext, useRef, useState } from "react";
12
12
  // src/components/filter-bar/filter-bar.tsx
13
13
  var FilterBarContext = createContext(null);
@@ -270,32 +270,30 @@ var FilterBadge = (t0) => {
270
270
  } else t3 = $[8];
271
271
  return t3;
272
272
  };
273
- /** The drawer itself: its portal, backdrop, viewport and popup, around the content. */
273
+ /**
274
+ * The drawer itself, a `Drawer.Sheet`: its portal, backdrop, viewport and popup,
275
+ * around the content. For a drawer without the backdrop, compose `Drawer.Portal`,
276
+ * `Drawer.Viewport`, `Drawer.Popup` and `Drawer.Content` in its place.
277
+ *
278
+ * @example
279
+ * <FilterBar.Content>
280
+ * <FilterBar.Fields>…</FilterBar.Fields>
281
+ * </FilterBar.Content>
282
+ */
274
283
  var Content = (t0) => {
275
- const $ = c(6);
284
+ const $ = c(3);
276
285
  const { children, className } = t0;
277
286
  let t1;
278
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
279
- t1 = /* @__PURE__ */ jsx(Drawer.Backdrop, {});
280
- $[0] = t1;
281
- } else t1 = $[0];
282
- let t2;
283
- if ($[1] !== children) {
284
- t2 = /* @__PURE__ */ jsx(Drawer.Content, { children });
285
- $[1] = children;
286
- $[2] = t2;
287
- } else t2 = $[2];
288
- let t3;
289
- if ($[3] !== className || $[4] !== t2) {
290
- t3 = /* @__PURE__ */ jsxs(Drawer.Portal, { children: [t1, /* @__PURE__ */ jsx(Drawer.Viewport, { children: /* @__PURE__ */ jsx(Drawer.Popup, {
287
+ if ($[0] !== children || $[1] !== className) {
288
+ t1 = /* @__PURE__ */ jsx(Drawer.Sheet, {
291
289
  className,
292
- children: t2
293
- }) })] });
294
- $[3] = className;
295
- $[4] = t2;
296
- $[5] = t3;
297
- } else t3 = $[5];
298
- return t3;
290
+ children
291
+ });
292
+ $[0] = children;
293
+ $[1] = className;
294
+ $[2] = t1;
295
+ } else t1 = $[2];
296
+ return t1;
299
297
  };
300
298
  /** The filter controls, bound to the view's `draft`, in a column. */
301
299
  var Fields = (t0) => {
@@ -605,7 +603,7 @@ var ClearAll = (t0) => {
605
603
  * Composite filter surface. `Root` holds a `useFilterView` in context: `Search`
606
604
  * and the `Drawer` share the leading row, and `Active`, the applied-filter row,
607
605
  * takes a line of its own. The drawer's header is the `Drawer` component's own
608
- * `Drawer.Header`, `Drawer.Title` and `Drawer.CloseButton`.
606
+ * `Drawer.Header`, `Drawer.Title` and `Drawer.Close`.
609
607
  *
610
608
  * @example
611
609
  * <FilterBar.Root filters={filters}>
@@ -615,7 +613,7 @@ var ClearAll = (t0) => {
615
613
  * <FilterBar.Content>
616
614
  * <Drawer.Header>
617
615
  * <Drawer.Title>Filter clients</Drawer.Title>
618
- * <Drawer.CloseButton closeLabel="Close" icon={<CloseIcon />} />
616
+ * <Drawer.Close render={<IconButton label="Close" variant="tertiary"><CloseIcon /></IconButton>} />
619
617
  * </Drawer.Header>
620
618
  * <FilterBar.Fields><ClientFilterFields filters={filters} /></FilterBar.Fields>
621
619
  * <FilterBar.Footer>
@@ -1,9 +1,9 @@
1
1
  import './filter-bar.css';// src/components/filter-bar/filter-bar.module.scss
2
- var bar = "_bar_1j1i8_3";
3
- var search = "_search_1j1i8_10";
4
- var active = "_active_1j1i8_14";
5
- var fields = "_fields_1j1i8_21";
6
- var footer = "_footer_1j1i8_27";
2
+ var bar = "_bar_lt3dt_3";
3
+ var search = "_search_lt3dt_10";
4
+ var active = "_active_lt3dt_14";
5
+ var fields = "_fields_lt3dt_21";
6
+ var footer = "_footer_lt3dt_27";
7
7
  var filter_bar_module_default = {
8
8
  bar,
9
9
  search,
@@ -1,5 +1,6 @@
1
+ import { useRender } from "@base-ui/react/use-render";
1
2
  import { type AnyFormApi } from "@tanstack/react-form";
2
- import { type ComponentPropsWithRef, type ReactNode } from "react";
3
+ import { type ComponentPropsWithRef, type ReactElement, type ReactNode } from "react";
3
4
  import { type LeaveGuardPolicy } from "../../lib/unsaved-changes/policy.ts";
4
5
  import { type ButtonProps } from "../button/index.ts";
5
6
  export type FormRootProps = Omit<ComponentPropsWithRef<"form">, "onSubmit" | "children"> & Readonly<{
@@ -31,15 +32,24 @@ export type FormErrorsProps = Readonly<{
31
32
  * <Form.Errors />
32
33
  */
33
34
  declare const FormErrors: ({ className, }: FormErrorsProps) => ReactNode;
34
- export type FormSubmitProps = Omit<Extract<ButtonProps, Readonly<{
35
- iconOnly?: false;
36
- }>>, "type" | "iconOnly"> & Readonly<{
35
+ export type FormPendingProps = useRender.ComponentProps<"span">;
36
+ /**
37
+ * What the form shows while its wait is worth showing, such as a spinner: it
38
+ * renders once the form has been busy for 150 ms, and stays at least 200 ms.
39
+ * It is decoration; `Form.Submit` announces the wait.
40
+ *
41
+ * @example
42
+ * <Form.Pending render={<Spinner size={1} />} />
43
+ */
44
+ declare const FormPending: ({ render, ref, ...props }: FormPendingProps) => ReactElement | null;
45
+ export type FormSubmitProps = Omit<ButtonProps, "type"> & Readonly<{
37
46
  /** What a wait is announced as once it has lasted, such as "Saving". */
38
47
  busyLabel: string;
39
48
  }>;
40
49
  /**
41
- * The form's submit button. A wait that lasts 150 ms shows a spinner, is
42
- * announced as `busyLabel`, and stays shown at least 200 ms.
50
+ * The form's submit button. A wait that lasts 150 ms shows a `Form.Pending`
51
+ * spinner in place of its icon, is announced as `busyLabel`, and stays shown
52
+ * at least 200 ms.
43
53
  *
44
54
  * @example
45
55
  * <Form.Submit busyLabel="Saving">Save</Form.Submit>
@@ -49,11 +59,13 @@ declare const FormSubmit: ({ busyLabel, variant, icon, children, ...props }: For
49
59
  export type FormParts = Readonly<{
50
60
  Root: typeof FormRoot;
51
61
  Errors: typeof FormErrors;
62
+ Pending: typeof FormPending;
52
63
  Submit: typeof FormSubmit;
53
64
  }>;
54
65
  /**
55
66
  * A form over a TanStack Form instance: `Root` is the `<form>`, `Errors` its
56
- * form-level errors and `Submit` its submit button.
67
+ * form-level errors, `Submit` its submit button and `Pending` what shows while
68
+ * it waits.
57
69
  *
58
70
  * @example
59
71
  * <Form.Root form={form}>