@igne-agency/react-web-ui 0.3.1 → 0.4.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 (290) hide show
  1. package/README.md +32 -1
  2. package/dist/components/accordion/accordion.css +24 -19
  3. package/dist/components/accordion/accordion.d.ts +19 -3
  4. package/dist/components/accordion/accordion.js +86 -32
  5. package/dist/components/accordion/accordion.module.js +8 -8
  6. package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
  7. package/dist/components/active-filters/active-filter-describers.js +1 -1
  8. package/dist/components/active-filters/active-filters.d.ts +35 -2
  9. package/dist/components/active-filters/active-filters.js +57 -52
  10. package/dist/components/active-filters/index.js +2 -2
  11. package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
  12. package/dist/components/attachment-tile/attachment-preview.js +102 -68
  13. package/dist/components/attachment-tile/attachment-tile.css +22 -13
  14. package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
  15. package/dist/components/attachment-tile/attachment-tile.js +209 -85
  16. package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
  17. package/dist/components/attachment-tile/index.d.ts +1 -1
  18. package/dist/components/attachment-tile/index.js +2 -2
  19. package/dist/components/avatar/avatar.d.ts +5 -5
  20. package/dist/components/avatar/avatar.js +64 -37
  21. package/dist/components/avatar-group/avatar-group.js +2 -2
  22. package/dist/components/badge/badge.js +1 -1
  23. package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
  24. package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
  25. package/dist/components/button/button.d.ts +2 -3
  26. package/dist/components/button/button.js +58 -77
  27. package/dist/components/button/close-button.d.ts +4 -2
  28. package/dist/components/button/close-button.js +9 -9
  29. package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
  30. package/dist/components/checkbox-field/checkbox-field.js +108 -131
  31. package/dist/components/checkbox-field/checkbox.css +26 -34
  32. package/dist/components/checkbox-field/checkbox.d.ts +51 -8
  33. package/dist/components/checkbox-field/checkbox.js +221 -57
  34. package/dist/components/checkbox-field/checkbox.module.js +6 -8
  35. package/dist/components/checkbox-field/index.d.ts +0 -1
  36. package/dist/components/checkbox-field/index.js +1 -2
  37. package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
  38. package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
  39. package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
  40. package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
  41. package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
  42. package/dist/components/collapsible/collapsible.css +23 -18
  43. package/dist/components/collapsible/collapsible.d.ts +18 -3
  44. package/dist/components/collapsible/collapsible.js +85 -32
  45. package/dist/components/collapsible/collapsible.module.js +7 -7
  46. package/dist/components/combobox-field/combobox-field.d.ts +9 -1
  47. package/dist/components/combobox-field/combobox-field.js +195 -175
  48. package/dist/components/combobox-field/combobox-items.d.ts +2 -2
  49. package/dist/components/combobox-field/combobox-items.js +4 -4
  50. package/dist/components/combobox-field/combobox.css +99 -96
  51. package/dist/components/combobox-field/combobox.d.ts +94 -15
  52. package/dist/components/combobox-field/combobox.js +484 -159
  53. package/dist/components/combobox-field/combobox.module.js +21 -21
  54. package/dist/components/combobox-field/index.d.ts +0 -1
  55. package/dist/components/combobox-field/selection.d.ts +4 -1
  56. package/dist/components/combobox-field/value-state-view.css +7 -3
  57. package/dist/components/combobox-field/value-state-view.d.ts +4 -2
  58. package/dist/components/combobox-field/value-state-view.js +15 -15
  59. package/dist/components/combobox-field/value-state-view.module.js +6 -4
  60. package/dist/components/composer/composer-attachments.d.ts +11 -3
  61. package/dist/components/composer/composer-attachments.js +61 -47
  62. package/dist/components/composer/composer-editor.d.ts +2 -1
  63. package/dist/components/composer/composer-editor.js +79 -71
  64. package/dist/components/composer/composer-mentions.js +2 -2
  65. package/dist/components/composer/composer.d.ts +42 -21
  66. package/dist/components/composer/composer.js +201 -58
  67. package/dist/components/composer/mention-text.js +3 -3
  68. package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
  69. package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
  70. package/dist/components/conversation/conversation.context.d.ts +0 -5
  71. package/dist/components/conversation/conversation.d.ts +63 -29
  72. package/dist/components/conversation/conversation.js +193 -82
  73. package/dist/components/conversation/index.d.ts +1 -1
  74. package/dist/components/date-field/date-field.d.ts +10 -4
  75. package/dist/components/date-field/date-field.js +57 -43
  76. package/dist/components/date-field/date-input.d.ts +20 -3
  77. package/dist/components/date-field/date-input.js +28 -13
  78. package/dist/components/date-field/index.d.ts +1 -1
  79. package/dist/components/date-field/tsf-date-field.d.ts +1 -1
  80. package/dist/components/date-field/tsf-date-field.js +1 -1
  81. package/dist/components/date-range-field/date-range-field.d.ts +8 -4
  82. package/dist/components/date-range-field/date-range-field.js +57 -45
  83. package/dist/components/date-range-field/date-range-input.d.ts +20 -3
  84. package/dist/components/date-range-field/date-range-input.js +27 -12
  85. package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
  86. package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
  87. package/dist/components/detail-list/detail-list.d.ts +28 -27
  88. package/dist/components/detail-list/detail-list.js +177 -121
  89. package/dist/components/dialog/dialog.d.ts +47 -27
  90. package/dist/components/dialog/dialog.js +101 -38
  91. package/dist/components/divider/divider.js +1 -1
  92. package/dist/components/drawer/drawer.d.ts +48 -30
  93. package/dist/components/drawer/drawer.js +113 -41
  94. package/dist/components/email-field/email-field.d.ts +5 -3
  95. package/dist/components/email-field/email-field.js +1 -3
  96. package/dist/components/email-field/tsf-email-field.d.ts +3 -2
  97. package/dist/components/empty-message/empty-message.d.ts +3 -3
  98. package/dist/components/empty-message/empty-message.js +3 -3
  99. package/dist/components/error-boundary/error-boundary.d.ts +5 -2
  100. package/dist/components/error-boundary/error-boundary.js +2 -3
  101. package/dist/components/error-message/error-message.d.ts +1 -1
  102. package/dist/components/error-message/error-message.js +1 -1
  103. package/dist/components/error-text/error-text.js +3 -3
  104. package/dist/components/field/field.d.ts +5 -5
  105. package/dist/components/field/field.js +9 -9
  106. package/dist/components/field/index.js +2 -2
  107. package/dist/components/field/input-parts.js +1 -1
  108. package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
  109. package/dist/components/field-placeholder/field-placeholder.js +41 -26
  110. package/dist/components/fieldset/field-group.js +1 -1
  111. package/dist/components/fieldset/fieldset-root.js +1 -1
  112. package/dist/components/fieldset/fieldset.js +1 -1
  113. package/dist/components/file-field/file-field.css +19 -15
  114. package/dist/components/file-field/file-field.d.ts +10 -1
  115. package/dist/components/file-field/file-field.js +130 -109
  116. package/dist/components/file-field/file-field.module.js +6 -4
  117. package/dist/components/file-field/file-input.d.ts +32 -9
  118. package/dist/components/file-field/file-input.js +94 -74
  119. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  120. package/dist/components/filter-bar/filter-bar.js +552 -216
  121. package/dist/components/form/form.d.ts +4 -6
  122. package/dist/components/form/form.js +6 -8
  123. package/dist/components/icon/icon.d.ts +5 -10
  124. package/dist/components/icon/icon.js +4 -6
  125. package/dist/components/link/link.js +1 -1
  126. package/dist/components/link-button/link-button.d.ts +1 -2
  127. package/dist/components/link-button/link-button.js +12 -22
  128. package/dist/components/loading-message/loading-message.d.ts +2 -2
  129. package/dist/components/loading-message/loading-message.js +1 -1
  130. package/dist/components/locale-provider/locale-provider.js +1 -1
  131. package/dist/components/menu/menu.d.ts +40 -22
  132. package/dist/components/menu/menu.js +100 -40
  133. package/dist/components/nav/nav-context.d.ts +0 -1
  134. package/dist/components/nav/nav-context.js +1 -2
  135. package/dist/components/nav/nav-item-view.d.ts +7 -7
  136. package/dist/components/nav/nav-item-view.js +27 -51
  137. package/dist/components/nav/nav.css +72 -60
  138. package/dist/components/nav/nav.d.ts +15 -8
  139. package/dist/components/nav/nav.js +105 -52
  140. package/dist/components/nav/nav.module.js +14 -14
  141. package/dist/components/number-field/number-field.d.ts +7 -1
  142. package/dist/components/number-field/number-field.js +98 -82
  143. package/dist/components/number-field/number-input.d.ts +53 -4
  144. package/dist/components/number-field/number-input.js +68 -21
  145. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  146. package/dist/components/number-field/tsf-number-field.js +1 -1
  147. package/dist/components/otp-field/otp-input.d.ts +25 -0
  148. package/dist/components/otp-field/otp-input.js +26 -1
  149. package/dist/components/pagination/pagination.d.ts +82 -23
  150. package/dist/components/pagination/pagination.js +656 -229
  151. package/dist/components/password-field/password-field.d.ts +7 -1
  152. package/dist/components/password-field/password-field.js +117 -126
  153. package/dist/components/password-field/password-strength.js +1 -1
  154. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  155. package/dist/components/password-field/tsf-password-field.js +1 -1
  156. package/dist/components/photo-field/photo-field.d.ts +17 -3
  157. package/dist/components/photo-field/photo-field.js +168 -89
  158. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  159. package/dist/components/photo-field/photo-input-context.js +14 -0
  160. package/dist/components/photo-field/photo-input.d.ts +58 -23
  161. package/dist/components/photo-field/photo-input.js +459 -261
  162. package/dist/components/popover/popover.d.ts +55 -23
  163. package/dist/components/popover/popover.js +205 -61
  164. package/dist/components/radio-group-field/radio-group.js +1 -1
  165. package/dist/components/search-field/search-field.d.ts +7 -5
  166. package/dist/components/search-field/search-field.js +4 -6
  167. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  168. package/dist/components/search-field/tsf-search-field.js +1 -1
  169. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  170. package/dist/components/select-field/select-field.d.ts +7 -1
  171. package/dist/components/select-field/select-field.js +151 -139
  172. package/dist/components/select-field/select.d.ts +28 -6
  173. package/dist/components/select-field/select.js +234 -149
  174. package/dist/components/skeleton/skeleton.js +1 -1
  175. package/dist/components/spinner/spinner.css +47 -1
  176. package/dist/components/spinner/spinner.js +28 -11
  177. package/dist/components/spinner/spinner.module.js +18 -3
  178. package/dist/components/stale/stale.d.ts +17 -21
  179. package/dist/components/stale/stale.js +307 -129
  180. package/dist/components/status-message/status-message.css +22 -21
  181. package/dist/components/status-message/status-message.d.ts +10 -5
  182. package/dist/components/status-message/status-message.js +20 -24
  183. package/dist/components/status-message/status-message.module.js +6 -6
  184. package/dist/components/status-message/status-preset.d.ts +4 -5
  185. package/dist/components/status-message/status-preset.js +3 -3
  186. package/dist/components/switch-field/switch.js +1 -1
  187. package/dist/components/tabs/tabs.d.ts +51 -28
  188. package/dist/components/tabs/tabs.js +219 -144
  189. package/dist/components/tag/tag.css +23 -21
  190. package/dist/components/tag/tag.d.ts +17 -15
  191. package/dist/components/tag/tag.js +140 -65
  192. package/dist/components/tag/tag.module.js +3 -3
  193. package/dist/components/tag-group/tag-group.css +30 -27
  194. package/dist/components/tag-group/tag-group.d.ts +10 -4
  195. package/dist/components/tag-group/tag-group.js +47 -35
  196. package/dist/components/tag-group/tag-group.module.js +4 -4
  197. package/dist/components/text-field/text-field.d.ts +14 -3
  198. package/dist/components/text-field/text-field.js +154 -133
  199. package/dist/components/text-field/text-input.d.ts +89 -3
  200. package/dist/components/text-field/text-input.js +184 -70
  201. package/dist/components/textarea-field/textarea.js +1 -1
  202. package/dist/components/time-field/time-input.d.ts +6 -0
  203. package/dist/components/time-field/time-input.js +6 -0
  204. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  205. package/dist/components/toast/index.js +2 -2
  206. package/dist/components/toast/toast-provider.css +38 -34
  207. package/dist/components/toast/toast-provider.d.ts +65 -3
  208. package/dist/components/toast/toast-provider.js +313 -148
  209. package/dist/components/toast/toast-provider.module.js +11 -17
  210. package/dist/components/toast/toast.d.ts +5 -1
  211. package/dist/components/toast/toast.js +2 -1
  212. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  213. package/dist/components/tooltip/tooltip.d.ts +6 -6
  214. package/dist/components/tooltip/tooltip.js +7 -7
  215. package/dist/data-table/data-table-content.d.ts +18 -10
  216. package/dist/data-table/data-table-content.js +145 -290
  217. package/dist/data-table/data-table-context.d.ts +4 -2
  218. package/dist/data-table/data-table-context.js +1 -1
  219. package/dist/data-table/data-table-parts.d.ts +99 -0
  220. package/dist/data-table/data-table-parts.js +1182 -0
  221. package/dist/data-table/data-table-selection.d.ts +7 -3
  222. package/dist/data-table/data-table-selection.js +62 -37
  223. package/dist/data-table/data-table.css +100 -95
  224. package/dist/data-table/data-table.d.ts +49 -25
  225. package/dist/data-table/data-table.js +95 -83
  226. package/dist/data-table/data-table.module.js +34 -34
  227. package/dist/data-table/index.d.ts +2 -1
  228. package/dist/data-table/index.js +2 -1
  229. package/dist/data-view/use-data-view.d.ts +2 -2
  230. package/dist/data-view/use-data-view.js +2 -2
  231. package/dist/index.js +7 -8
  232. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  233. package/dist/lib/calendar/calendar-navigation.js +72 -73
  234. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  235. package/dist/lib/calendar/calendar-year.js +137 -156
  236. package/dist/lib/calendar/temporal.d.ts +18 -12
  237. package/dist/lib/calendar/temporal.js +191 -147
  238. package/dist/lib/table-storage.d.ts +2 -2
  239. package/dist/lib/table-storage.js +2 -2
  240. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  241. package/dist/terrazzo/index.d.ts +16 -0
  242. package/dist/terrazzo/index.js +94 -2
  243. package/dist/tokens.css +71 -69
  244. package/package.json +3 -2
  245. package/tokens/ref.tokens.json +0 -30
  246. package/tokens/sys.tokens.json +0 -7
  247. package/dist/assets/spinner.js +0 -28
  248. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  249. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  250. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  251. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  252. package/dist/components/conversation/conversation.context.js +0 -4
  253. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  254. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  255. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,17 +1,15 @@
1
- import SvgAttachFile from "../../vendor/@material-design-icons/svg/outlined/attach_file.js";
2
- import SvgUploadFile from "../../vendor/@material-design-icons/svg/outlined/upload_file.js";
3
1
  import { AttachmentTile } from "../attachment-tile/attachment-tile.js";
4
2
  import { Button as Button$1 } from "../button/button.js";
5
3
  import { Field } from "../field/field.js";
6
4
  import { fieldStateAttributes } from "../field/field-state.js";
7
- import { Icon } from "../icon/icon.js";
8
5
  import file_field_module_default from "./file-field.module.js";
9
6
  import { c } from "react/compiler-runtime";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
7
  import { clsx } from "clsx";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
12
9
  import { Button, DropZone, FileTrigger, TagGroup, TagList } from "react-aria-components";
13
10
  import { Fieldset } from "@base-ui/react/fieldset";
14
11
  // src/components/file-field/file-input.tsx
12
+ /** The fieldset around the file input, which projects its state as `data-*` attributes. */
15
13
  var FileInputRoot = (t0) => {
16
14
  const $ = c(15);
17
15
  let disabled;
@@ -62,6 +60,7 @@ var FileInputRoot = (t0) => {
62
60
  } else t4 = $[14];
63
61
  return t4;
64
62
  };
63
+ /** The legend that names the fieldset. */
65
64
  var FileInputLegend = (props) => {
66
65
  const $ = c(3);
67
66
  let t0;
@@ -81,6 +80,7 @@ var FileInputLegend = (props) => {
81
80
  } else t1 = $[2];
82
81
  return t1;
83
82
  };
83
+ /** The area files are dropped on, holding the hint, the picker button and the staged files. */
84
84
  var FileInputDropTarget = (t0) => {
85
85
  const $ = c(14);
86
86
  let className;
@@ -129,120 +129,132 @@ var FileInputDropTarget = (t0) => {
129
129
  } else t4 = $[13];
130
130
  return t4;
131
131
  };
132
+ /** The prompt inside the drop target, with an optional `icon` above it. */
132
133
  var FileInputHint = (t0) => {
133
- const $ = c(11);
134
+ const $ = c(14);
134
135
  let children;
135
136
  let className;
137
+ let icon;
136
138
  let props;
137
139
  if ($[0] !== t0) {
138
- ({className, children, ...props} = t0);
140
+ ({className, icon, children, ...props} = t0);
139
141
  $[0] = t0;
140
142
  $[1] = children;
141
143
  $[2] = className;
142
- $[3] = props;
144
+ $[3] = icon;
145
+ $[4] = props;
143
146
  } else {
144
147
  children = $[1];
145
148
  className = $[2];
146
- props = $[3];
149
+ icon = $[3];
150
+ props = $[4];
147
151
  }
148
152
  let t1;
149
- if ($[4] !== className) {
153
+ if ($[5] !== className) {
150
154
  t1 = clsx(file_field_module_default.hint, className);
151
- $[4] = className;
152
- $[5] = t1;
153
- } else t1 = $[5];
155
+ $[5] = className;
156
+ $[6] = t1;
157
+ } else t1 = $[6];
154
158
  let t2;
155
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
156
- t2 = /* @__PURE__ */ jsx(Icon, {
157
- svg: SvgUploadFile,
158
- label: "",
159
- size: 1.5
159
+ if ($[7] !== icon) {
160
+ t2 = icon === void 0 ? null : /* @__PURE__ */ jsx("span", {
161
+ "aria-hidden": "true",
162
+ className: file_field_module_default.hintIcon,
163
+ children: icon
160
164
  });
161
- $[6] = t2;
162
- } else t2 = $[6];
165
+ $[7] = icon;
166
+ $[8] = t2;
167
+ } else t2 = $[8];
163
168
  let t3;
164
- if ($[7] !== children || $[8] !== props || $[9] !== t1) {
169
+ if ($[9] !== children || $[10] !== props || $[11] !== t1 || $[12] !== t2) {
165
170
  t3 = /* @__PURE__ */ jsxs("p", {
166
171
  className: t1,
167
172
  ...props,
168
173
  children: [t2, children]
169
174
  });
170
- $[7] = children;
171
- $[8] = props;
172
- $[9] = t1;
173
- $[10] = t3;
174
- } else t3 = $[10];
175
+ $[9] = children;
176
+ $[10] = props;
177
+ $[11] = t1;
178
+ $[12] = t2;
179
+ $[13] = t3;
180
+ } else t3 = $[13];
175
181
  return t3;
176
182
  };
183
+ /** The button that opens the file dialog. */
177
184
  var FileInputTrigger = (t0) => {
178
- const $ = c(20);
185
+ const $ = c(22);
179
186
  let buttonRef;
180
187
  let describedBy;
181
188
  let disabled;
189
+ let icon;
182
190
  let invalid;
183
191
  let label;
184
192
  let props;
185
193
  if ($[0] !== t0) {
186
- ({label, disabled, describedBy, buttonRef, invalid, ...props} = t0);
194
+ ({label, disabled, describedBy, buttonRef, invalid, icon, ...props} = t0);
187
195
  $[0] = t0;
188
196
  $[1] = buttonRef;
189
197
  $[2] = describedBy;
190
198
  $[3] = disabled;
191
- $[4] = invalid;
192
- $[5] = label;
193
- $[6] = props;
199
+ $[4] = icon;
200
+ $[5] = invalid;
201
+ $[6] = label;
202
+ $[7] = props;
194
203
  } else {
195
204
  buttonRef = $[1];
196
205
  describedBy = $[2];
197
206
  disabled = $[3];
198
- invalid = $[4];
199
- label = $[5];
200
- props = $[6];
207
+ icon = $[4];
208
+ invalid = $[5];
209
+ label = $[6];
210
+ props = $[7];
201
211
  }
202
212
  const t1 = invalid === true ? "invalid" : void 0;
203
213
  let t2;
204
- if ($[7] !== t1) {
214
+ if ($[8] !== t1) {
205
215
  t2 = fieldStateAttributes({ validity: t1 });
206
- $[7] = t1;
207
- $[8] = t2;
208
- } else t2 = $[8];
216
+ $[8] = t1;
217
+ $[9] = t2;
218
+ } else t2 = $[9];
209
219
  let t3;
210
- if ($[9] !== disabled) {
220
+ if ($[10] !== disabled) {
211
221
  t3 = /* @__PURE__ */ jsx(Button, { isDisabled: disabled });
212
- $[9] = disabled;
213
- $[10] = t3;
214
- } else t3 = $[10];
222
+ $[10] = disabled;
223
+ $[11] = t3;
224
+ } else t3 = $[11];
215
225
  let t4;
216
- if ($[11] !== buttonRef || $[12] !== describedBy || $[13] !== label || $[14] !== t2 || $[15] !== t3) {
226
+ if ($[12] !== buttonRef || $[13] !== describedBy || $[14] !== icon || $[15] !== label || $[16] !== t2 || $[17] !== t3) {
217
227
  t4 = /* @__PURE__ */ jsx(Button$1, {
218
228
  variant: "secondary",
219
229
  size: "sm",
220
- icon: SvgAttachFile,
230
+ icon,
221
231
  ref: buttonRef,
222
232
  "aria-describedby": describedBy,
223
233
  ...t2,
224
234
  render: t3,
225
235
  children: label
226
236
  });
227
- $[11] = buttonRef;
228
- $[12] = describedBy;
229
- $[13] = label;
230
- $[14] = t2;
231
- $[15] = t3;
232
- $[16] = t4;
233
- } else t4 = $[16];
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];
234
245
  let t5;
235
- if ($[17] !== props || $[18] !== t4) {
246
+ if ($[19] !== props || $[20] !== t4) {
236
247
  t5 = /* @__PURE__ */ jsx(FileTrigger, {
237
248
  ...props,
238
249
  children: t4
239
250
  });
240
- $[17] = props;
241
- $[18] = t4;
242
- $[19] = t5;
243
- } else t5 = $[19];
251
+ $[19] = props;
252
+ $[20] = t4;
253
+ $[21] = t5;
254
+ } else t5 = $[21];
244
255
  return t5;
245
256
  };
257
+ /** The staged files, as a group of removable tiles. */
246
258
  var FileInputList = (t0) => {
247
259
  const $ = c(9);
248
260
  const { label, onRemove, children, className } = t0;
@@ -276,29 +288,37 @@ var FileInputList = (t0) => {
276
288
  } else t3 = $[8];
277
289
  return t3;
278
290
  };
291
+ /** One staged file as an `AttachmentTile`. */
279
292
  var FileInputItem = (t0) => {
280
- const $ = c(7);
281
- const { id, file, hint, invalid: t1, disabled: t2, removeLabel } = t0;
293
+ const $ = c(8);
294
+ let props;
295
+ let t1;
296
+ let t2;
297
+ if ($[0] !== t0) {
298
+ ({invalid: t1, disabled: t2, ...props} = t0);
299
+ $[0] = t0;
300
+ $[1] = props;
301
+ $[2] = t1;
302
+ $[3] = t2;
303
+ } else {
304
+ props = $[1];
305
+ t1 = $[2];
306
+ t2 = $[3];
307
+ }
282
308
  const invalid = t1 === void 0 ? false : t1;
283
309
  const disabled = t2 === void 0 ? false : t2;
284
310
  let t3;
285
- if ($[0] !== disabled || $[1] !== file || $[2] !== hint || $[3] !== id || $[4] !== invalid || $[5] !== removeLabel) {
311
+ if ($[4] !== disabled || $[5] !== invalid || $[6] !== props) {
286
312
  t3 = /* @__PURE__ */ jsx(AttachmentTile, {
287
- id,
288
- file,
289
- hint,
290
- removeLabel,
291
313
  invalid,
292
- disabled
314
+ disabled,
315
+ ...props
293
316
  });
294
- $[0] = disabled;
295
- $[1] = file;
296
- $[2] = hint;
297
- $[3] = id;
298
- $[4] = invalid;
299
- $[5] = removeLabel;
300
- $[6] = t3;
301
- } else t3 = $[6];
317
+ $[4] = disabled;
318
+ $[5] = invalid;
319
+ $[6] = props;
320
+ $[7] = t3;
321
+ } else t3 = $[7];
302
322
  return t3;
303
323
  };
304
324
  /**
@@ -311,10 +331,10 @@ var FileInputItem = (t0) => {
311
331
  * <FileInput.Root state={{ requiredness: "optional" }}>
312
332
  * <FileInput.Legend optionalLabel="optional">Attachments</FileInput.Legend>
313
333
  * <FileInput.DropTarget aria-label="Drop zone for attachments" onDrop={onDrop}>
314
- * <FileInput.Hint>Drag files here</FileInput.Hint>
315
- * <FileInput.Trigger label="Choose files" onSelect={onSelect} />
334
+ * <FileInput.Hint icon={<UploadFileIcon />}>Drag files here</FileInput.Hint>
335
+ * <FileInput.Trigger label="Choose files" icon={<AttachFileIcon />} onSelect={onSelect} />
316
336
  * <FileInput.List label="Files for attachments" onRemove={onRemove}>
317
- * <FileInput.Item id={id} file={file} hint="invoice.pdf (12 kB)" removeLabel="Remove" />
337
+ * <FileInput.Item id={id} file={file} hint="invoice.pdf (12 kB)" removeLabel="Remove" removeIcon={<CloseIcon />} />
318
338
  * </FileInput.List>
319
339
  * </FileInput.DropTarget>
320
340
  * </FileInput.Root>
@@ -1,85 +1,113 @@
1
- import { type ReactNode } from "react";
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
3
+ import { type BadgeProps } from "../badge/badge.tsx";
4
+ import { type SearchFieldProps } from "../search-field/search-field.tsx";
2
5
  import type { FilterView } from "./use-filter-view.ts";
3
- export type FilterBarRootProps<TFilters extends object> = Readonly<{
6
+ export type FilterBarRootProps<TFilters extends object> = useRender.ComponentProps<"search"> & Readonly<{
4
7
  filters: FilterView<TFilters>;
5
8
  children: ReactNode;
6
- className?: string;
7
- }>;
8
- declare const Root: <TFilters extends object>({ filters, children, className, }: FilterBarRootProps<TFilters>) => ReactNode;
9
- export type FilterBarSearchProps = Readonly<{
10
- /** Names the field and fills its placeholder, such as "Search clients". */
11
- label: string;
12
- /** The clear button's name and tooltip, such as "Clear search". */
13
- clearLabel: string;
14
- /** The word an optional field's label trails, such as "optional", which every field takes. */
15
- optionalLabel: string;
16
- className?: string;
17
9
  }>;
10
+ /** The `<search>` landmark holding a `useFilterView` for the parts inside it. */
11
+ declare const Root: <TFilters extends object>({ filters, render, className, ref, ...props }: FilterBarRootProps<TFilters>) => ReactNode;
12
+ export type FilterBarSearchProps = Omit<SearchFieldProps, "value" | "onValueChange">;
18
13
  /**
19
- * The live search input. Search is not part of the Apply/Cancel bargain: it
20
- * narrows as you type, debounced by the view. Its label is hidden; the glyph
21
- * and the placeholder carry it for anyone who can see them.
14
+ * The live search input, a `SearchField` bound to the view's search. Search is
15
+ * not part of the Apply/Cancel bargain: it narrows as you type, debounced by
16
+ * the view. Its label is hidden and fills the placeholder unless told otherwise.
22
17
  */
23
- declare const Search: ({ label, clearLabel, optionalLabel, className, }: FilterBarSearchProps) => ReactNode;
18
+ declare const Search: ({ label, labelHidden, placeholder, className, ...props }: FilterBarSearchProps) => ReactNode;
24
19
  export type FilterBarDrawerProps = Readonly<{
25
- /** The filter controls, bound to the view's `draft`. */
20
+ /** The trigger and the drawer's content: `FilterBar.Trigger` and `FilterBar.Content`. */
26
21
  children: ReactNode;
27
22
  /**
28
23
  * Where the drawer comes from: `"right"` for a side panel, `"down"` for a
29
24
  * bottom sheet, for example from the app's own viewport query.
30
25
  */
31
26
  swipeDirection: "right" | "down";
32
- /** The trigger's label, such as "Filters". */
33
- triggerLabel: string;
34
- /** The drawer's title, such as "Filter clients". */
35
- title: string;
36
- /** The close button's name and tooltip, such as "Close". */
37
- closeLabel: string;
38
- /** The button that restores the initial filters, such as "Reset". */
39
- resetLabel: string;
40
- /** The button that commits the draft, such as "Apply". */
41
- applyLabel: string;
42
- className?: string;
43
27
  }>;
44
28
  /**
45
- * The apply-gated half: a trigger badged with the applied-filter count, and a
46
- * drawer of filter fields over Apply, which commits the draft. Dismissing the
47
- * drawer discards the draft, and Reset puts it back to the initial filters
48
- * without closing.
29
+ * The apply-gated half: a `Drawer.Root` whose draft `FilterBar.Apply` commits.
30
+ * Dismissing the drawer any other way discards the draft.
49
31
  */
50
- declare const FilterDrawer: ({ children, swipeDirection, triggerLabel, title, closeLabel, resetLabel, applyLabel, className, }: FilterBarDrawerProps) => ReactNode;
51
- export type FilterBarActiveProps = Readonly<{
52
- /** The chips for the committed filters, i.e. an `<ActiveFilters>`. */
53
- children?: ReactNode;
54
- /** The button that clears every filter and the search, such as "Clear filters". */
55
- clearAllLabel: string;
32
+ declare const FilterDrawer: ({ children, swipeDirection, }: FilterBarDrawerProps) => ReactNode;
33
+ /** What the action buttons of a filter bar take. */
34
+ export type FilterBarButtonProps = Omit<ComponentProps<"button">, "ref" | "children"> & Readonly<{
35
+ /** The glyph leading the label. */
36
+ icon?: ReactNode;
37
+ /** The button's label. */
38
+ children: ReactNode;
39
+ }>;
40
+ /** The button that opens the drawer, such as "Filters" with a `FilterBar.Badge`. */
41
+ declare const Trigger: ({ icon, children, ...props }: FilterBarButtonProps) => ReactNode;
42
+ export type FilterBarBadgeProps = Omit<BadgeProps, "children">;
43
+ /** How many filters are applied, for the trigger. Renders nothing while none are. */
44
+ declare const FilterBadge: ({ tone, variant, ...props }: FilterBarBadgeProps) => ReactNode;
45
+ export type FilterBarContentProps = Readonly<{
46
+ /** The drawer's header, its `FilterBar.Fields` and its `FilterBar.Footer`. */
47
+ children: ReactNode;
56
48
  className?: string;
57
49
  }>;
50
+ /** The drawer itself: its portal, backdrop, viewport and popup, around the content. */
51
+ declare const Content: ({ children, className, }: FilterBarContentProps) => ReactNode;
52
+ export type FilterBarFieldsProps = useRender.ComponentProps<"div">;
53
+ /** The filter controls, bound to the view's `draft`, in a column. */
54
+ declare const Fields: ({ render, className, ref, ...props }: FilterBarFieldsProps) => ReactElement;
55
+ export type FilterBarFooterProps = useRender.ComponentProps<"div">;
56
+ /** The drawer's actions, `FilterBar.Reset` and `FilterBar.Apply`, at its end. */
57
+ declare const Footer: ({ render, className, ref, ...props }: FilterBarFooterProps) => ReactElement;
58
+ /** Puts the draft back to the initial filters, without closing the drawer. */
59
+ declare const Reset: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
60
+ /** Commits the draft and closes the drawer. */
61
+ declare const Apply: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
62
+ export type FilterBarActiveProps = useRender.ComponentProps<"div">;
58
63
  /**
59
- * The applied-filter row: the chips for what is narrowing the list, with the
60
- * clear-everything control inline at their end. That control clears the search
61
- * as well as the committed filters.
64
+ * The applied-filter row, on a line of its own: the chips for what is
65
+ * narrowing the list, such as an `ActiveFilters`, and `FilterBar.ClearAll`.
66
+ * Renders nothing while nothing narrows the list.
62
67
  */
63
- declare const Active: ({ children, clearAllLabel, className, }: FilterBarActiveProps) => ReactNode;
68
+ declare const Active: ({ render, className, ref, ...props }: FilterBarActiveProps) => ReactElement | null;
69
+ /** Clears every committed filter and the search. */
70
+ declare const ClearAll: ({ icon, children, onClick, ...props }: FilterBarButtonProps) => ReactNode;
64
71
  type FilterBarParts = Readonly<{
65
72
  Root: typeof Root;
66
73
  Search: typeof Search;
67
74
  Drawer: typeof FilterDrawer;
75
+ Trigger: typeof Trigger;
76
+ Badge: typeof FilterBadge;
77
+ Content: typeof Content;
78
+ Fields: typeof Fields;
79
+ Footer: typeof Footer;
80
+ Reset: typeof Reset;
81
+ Apply: typeof Apply;
68
82
  Active: typeof Active;
83
+ ClearAll: typeof ClearAll;
69
84
  }>;
70
85
  /**
71
- * Composite filter surface. `Root` holds a `useFilterView` in context and lays
72
- * out the parts: `Search` and `Drawer` share the leading row, and `Active`, the
73
- * applied-filter row, takes a line of its own.
86
+ * Composite filter surface. `Root` holds a `useFilterView` in context: `Search`
87
+ * and the `Drawer` share the leading row, and `Active`, the applied-filter row,
88
+ * takes a line of its own. The drawer's header is the `Drawer` component's own
89
+ * `Drawer.Header`, `Drawer.Title` and `Drawer.CloseButton`.
74
90
  *
75
91
  * @example
76
92
  * <FilterBar.Root filters={filters}>
77
- * <FilterBar.Search label="Search clients" clearLabel="Clear search" optionalLabel="optional" />
78
- * <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"} triggerLabel="Filters" title="Filter clients" closeLabel="Close" resetLabel="Reset" applyLabel="Apply">
79
- * <ClientFilterFields filters={filters} />
93
+ * <FilterBar.Search label="Search clients" clearLabel="Clear search" clearIcon={<CloseIcon />} icon={<SearchIcon />} optionalLabel="optional" />
94
+ * <FilterBar.Drawer swipeDirection={narrow ? "down" : "right"}>
95
+ * <FilterBar.Trigger icon={<FilterIcon />}>Filters<FilterBar.Badge /></FilterBar.Trigger>
96
+ * <FilterBar.Content>
97
+ * <Drawer.Header>
98
+ * <Drawer.Title>Filter clients</Drawer.Title>
99
+ * <Drawer.CloseButton closeLabel="Close" icon={<CloseIcon />} />
100
+ * </Drawer.Header>
101
+ * <FilterBar.Fields><ClientFilterFields filters={filters} /></FilterBar.Fields>
102
+ * <FilterBar.Footer>
103
+ * <FilterBar.Reset>Reset</FilterBar.Reset>
104
+ * <FilterBar.Apply>Apply</FilterBar.Apply>
105
+ * </FilterBar.Footer>
106
+ * </FilterBar.Content>
80
107
  * </FilterBar.Drawer>
81
- * <FilterBar.Active clearAllLabel="Clear filters">
82
- * <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" />
108
+ * <FilterBar.Active>
109
+ * <ActiveFilters filters={filters} describe={describers} label="Active filters" removeLabel="Remove" removeIcon={<CloseIcon />} />
110
+ * <FilterBar.ClearAll>Clear filters</FilterBar.ClearAll>
83
111
  * </FilterBar.Active>
84
112
  * </FilterBar.Root>
85
113
  */