@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,7 +1,3 @@
1
- import SvgCheck from "../../vendor/@material-design-icons/svg/outlined/check.js";
2
- import SvgClose from "../../vendor/@material-design-icons/svg/outlined/close.js";
3
- import SvgContentCopy from "../../vendor/@material-design-icons/svg/outlined/content_copy.js";
4
- import SvgErrorOutline from "../../vendor/@material-design-icons/svg/outlined/error_outline.js";
5
1
  import { lengthTone } from "../../lib/text-length.js";
6
2
  import { Button } from "../button/button.js";
7
3
  import { Field } from "../field/field.js";
@@ -13,12 +9,19 @@ import { focusControlOnRim } from "../field/rim-focus.js";
13
9
  import { TextInputContext, useTextInputContext } from "./text-input-context.js";
14
10
  import text_field_module_default from "./text-field.module.js";
15
11
  import { c } from "react/compiler-runtime";
16
- import { useRef, useState } from "react";
17
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
18
12
  import { clsx } from "clsx";
13
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
+ import { useRef, useState } from "react";
19
15
  import { Input } from "@base-ui/react/input";
20
16
  // src/components/text-field/text-input.tsx
21
17
  var COPIED_FEEDBACK_MS = 2e3;
18
+ /**
19
+ * The field frame around a text input, holding its value and projecting its
20
+ * state onto every part.
21
+ *
22
+ * @example
23
+ * <TextInput.Root value={value} onValueChange={setValue} optionalLabel="optional">…</TextInput.Root>
24
+ */
22
25
  var TextInputRoot = (t0) => {
23
26
  const $ = c(41);
24
27
  const { value, onValueChange, disabled, readOnly, requiredness, optionalLabel, errors, dirty, touched, pending: t1, maxLength, state, className, children } = t0;
@@ -157,6 +160,12 @@ var TextInputRoot = (t0) => {
157
160
  } else t15 = $[40];
158
161
  return t15;
159
162
  };
163
+ /**
164
+ * The bordered box holding the control and its inlays.
165
+ *
166
+ * @example
167
+ * <TextInput.Group><TextInput.Input /></TextInput.Group>
168
+ */
160
169
  var TextInputGroup = (t0) => {
161
170
  const $ = c(15);
162
171
  let children;
@@ -207,6 +216,12 @@ var TextInputGroup = (t0) => {
207
216
  } else t3 = $[14];
208
217
  return t3;
209
218
  };
219
+ /**
220
+ * A strip of inlays along the bottom edge of the group.
221
+ *
222
+ * @example
223
+ * <TextInput.Bar><TextInput.Counter /></TextInput.Bar>
224
+ */
210
225
  var TextInputBar = (t0) => {
211
226
  const $ = c(8);
212
227
  let className;
@@ -238,6 +253,12 @@ var TextInputBar = (t0) => {
238
253
  } else t2 = $[7];
239
254
  return t2;
240
255
  };
256
+ /**
257
+ * A slot beside the control inside the group, such as an icon.
258
+ *
259
+ * @example
260
+ * <TextInput.Inlay aria-hidden="true"><SearchIcon /></TextInput.Inlay>
261
+ */
241
262
  var TextInputInlay = (t0) => {
242
263
  const $ = c(8);
243
264
  let className;
@@ -269,6 +290,12 @@ var TextInputInlay = (t0) => {
269
290
  } else t2 = $[7];
270
291
  return t2;
271
292
  };
293
+ /**
294
+ * Static text beside the control, such as a unit. Decoration only.
295
+ *
296
+ * @example
297
+ * <TextInput.Affix>kg</TextInput.Affix>
298
+ */
272
299
  var TextInputAffix = (t0) => {
273
300
  const $ = c(8);
274
301
  let className;
@@ -301,6 +328,12 @@ var TextInputAffix = (t0) => {
301
328
  } else t2 = $[7];
302
329
  return t2;
303
330
  };
331
+ /**
332
+ * The bare control, bound to `Root`'s value.
333
+ *
334
+ * @example
335
+ * <TextInput.Input type="email" />
336
+ */
304
337
  var TextInputInput = (t0) => {
305
338
  const $ = c(18);
306
339
  let className;
@@ -362,9 +395,15 @@ var TextInputInput = (t0) => {
362
395
  } else t7 = $[17];
363
396
  return t7;
364
397
  };
398
+ /**
399
+ * The icon-only button that empties the control, shown once it holds a value.
400
+ *
401
+ * @example
402
+ * <TextInput.Clear label="Clear"><CloseIcon /></TextInput.Clear>
403
+ */
365
404
  var TextInputClear = (t0) => {
366
- const $ = c(9);
367
- const { label, className } = t0;
405
+ const $ = c(10);
406
+ const { label, className, children } = t0;
368
407
  const { value, setValue, state, focusControl } = useTextInputContext();
369
408
  if (value === "" || state.disabled === true || state.readonly === true) return null;
370
409
  let t1;
@@ -384,28 +423,24 @@ var TextInputClear = (t0) => {
384
423
  $[4] = t2;
385
424
  } else t2 = $[4];
386
425
  let t3;
387
- if ($[5] !== label || $[6] !== t1 || $[7] !== t2) {
426
+ if ($[5] !== children || $[6] !== label || $[7] !== t1 || $[8] !== t2) {
388
427
  t3 = /* @__PURE__ */ jsx(Button, {
389
428
  iconOnly: true,
390
- icon: SvgClose,
429
+ icon: children,
391
430
  label,
392
431
  variant: "tertiary",
393
432
  size: "sm",
394
433
  className: t1,
395
434
  onClick: t2
396
435
  });
397
- $[5] = label;
398
- $[6] = t1;
399
- $[7] = t2;
400
- $[8] = t3;
401
- } else t3 = $[8];
436
+ $[5] = children;
437
+ $[6] = label;
438
+ $[7] = t1;
439
+ $[8] = t2;
440
+ $[9] = t3;
441
+ } else t3 = $[9];
402
442
  return t3;
403
443
  };
404
- var COPY_ICON = {
405
- idle: SvgContentCopy,
406
- copied: SvgCheck,
407
- failed: SvgErrorOutline
408
- };
409
444
  /**
410
445
  * Writes text to the clipboard, rejecting where there is no clipboard as well
411
446
  * as where the browser refuses.
@@ -414,9 +449,16 @@ var COPY_ICON = {
414
449
  * void writeClipboard("NL91ABNA0417164300").catch(selectByHand);
415
450
  */
416
451
  var writeClipboard = async (text) => navigator.clipboard.writeText(text);
452
+ /**
453
+ * The icon-only button that copies the value to the clipboard, shown once it
454
+ * holds one, and announces whether the copy landed.
455
+ *
456
+ * @example
457
+ * <TextInput.Copy label="Copy" copiedLabel="Copied" failedLabel="Copy failed, text selected"><CopyIcon /></TextInput.Copy>
458
+ */
417
459
  var TextInputCopy = (t0) => {
418
- const $ = c(21);
419
- const { label, copiedLabel, failedLabel, className } = t0;
460
+ const $ = c(25);
461
+ const { label, copiedLabel, failedLabel, copiedIcon, failedIcon, className, children } = t0;
420
462
  const { value, state, selectControl } = useTextInputContext();
421
463
  const [outcome, setOutcome] = useState("idle");
422
464
  if (value === "" || state.disabled === true) return null;
@@ -442,66 +484,135 @@ var TextInputCopy = (t0) => {
442
484
  $[4] = t2;
443
485
  } else t2 = $[4];
444
486
  const labels = t2;
445
- const t3 = COPY_ICON[outcome];
446
- const t4 = labels[outcome];
447
- const t5 = outcome === "failed" ? "danger" : "brand";
448
- let t6;
449
- if ($[5] !== className) {
450
- t6 = clsx(text_field_module_default.action, className);
451
- $[5] = className;
452
- $[6] = t6;
453
- } else t6 = $[6];
454
- let t7;
455
- if ($[7] !== selectControl || $[8] !== value) {
456
- t7 = () => {
487
+ const t3 = copiedIcon ?? children;
488
+ const t4 = failedIcon ?? children;
489
+ let t5;
490
+ if ($[5] !== children || $[6] !== t3 || $[7] !== t4) {
491
+ t5 = {
492
+ idle: children,
493
+ copied: t3,
494
+ failed: t4
495
+ };
496
+ $[5] = children;
497
+ $[6] = t3;
498
+ $[7] = t4;
499
+ $[8] = t5;
500
+ } else t5 = $[8];
501
+ const t6 = t5[outcome];
502
+ const t7 = labels[outcome];
503
+ const t8 = outcome === "failed" ? "danger" : "brand";
504
+ let t9;
505
+ if ($[9] !== className) {
506
+ t9 = clsx(text_field_module_default.action, className);
507
+ $[9] = className;
508
+ $[10] = t9;
509
+ } else t9 = $[10];
510
+ let t10;
511
+ if ($[11] !== selectControl || $[12] !== value) {
512
+ t10 = () => {
457
513
  writeClipboard(value).then(() => settle("copied"), () => {
458
514
  selectControl();
459
515
  settle("failed");
460
516
  });
461
517
  };
462
- $[7] = selectControl;
463
- $[8] = value;
464
- $[9] = t7;
465
- } else t7 = $[9];
466
- let t8;
467
- if ($[10] !== t3 || $[11] !== t4 || $[12] !== t5 || $[13] !== t6 || $[14] !== t7) {
468
- t8 = /* @__PURE__ */ jsx(Button, {
518
+ $[11] = selectControl;
519
+ $[12] = value;
520
+ $[13] = t10;
521
+ } else t10 = $[13];
522
+ let t11;
523
+ if ($[14] !== t10 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== t9) {
524
+ t11 = /* @__PURE__ */ jsx(Button, {
469
525
  iconOnly: true,
470
- icon: t3,
471
- label: t4,
472
- tone: t5,
526
+ icon: t6,
527
+ label: t7,
528
+ tone: t8,
473
529
  variant: "tertiary",
474
530
  size: "sm",
475
- className: t6,
476
- onClick: t7
531
+ className: t9,
532
+ onClick: t10
477
533
  });
478
- $[10] = t3;
479
- $[11] = t4;
480
- $[12] = t5;
481
- $[13] = t6;
482
- $[14] = t7;
483
- $[15] = t8;
484
- } else t8 = $[15];
485
- const t9 = outcome === "idle" ? "" : labels[outcome];
486
- let t10;
487
- if ($[16] !== t9) {
488
- t10 = /* @__PURE__ */ jsx("span", {
534
+ $[14] = t10;
535
+ $[15] = t6;
536
+ $[16] = t7;
537
+ $[17] = t8;
538
+ $[18] = t9;
539
+ $[19] = t11;
540
+ } else t11 = $[19];
541
+ const t12 = outcome === "idle" ? "" : labels[outcome];
542
+ let t13;
543
+ if ($[20] !== t12) {
544
+ t13 = /* @__PURE__ */ jsx("span", {
489
545
  role: "status",
490
546
  className: text_field_module_default.copyStatus,
491
- children: t9
547
+ children: t12
492
548
  });
493
- $[16] = t9;
494
- $[17] = t10;
495
- } else t10 = $[17];
496
- let t11;
497
- if ($[18] !== t10 || $[19] !== t8) {
498
- t11 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t8, t10] });
499
- $[18] = t10;
500
- $[19] = t8;
501
- $[20] = t11;
502
- } else t11 = $[20];
503
- return t11;
549
+ $[20] = t12;
550
+ $[21] = t13;
551
+ } else t13 = $[21];
552
+ let t14;
553
+ if ($[22] !== t11 || $[23] !== t13) {
554
+ t14 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t13] });
555
+ $[22] = t11;
556
+ $[23] = t13;
557
+ $[24] = t14;
558
+ } else t14 = $[24];
559
+ return t14;
504
560
  };
561
+ /**
562
+ * The icon-only toggle that shows a concealed value, such as a password, as
563
+ * text. The caller switches the `Input`'s `type` with `revealed`.
564
+ *
565
+ * @example
566
+ * <TextInput.Reveal revealed={revealed} onRevealedChange={setRevealed} label="Show password"><VisibilityIcon /></TextInput.Reveal>
567
+ */
568
+ var TextInputReveal = (t0) => {
569
+ const $ = c(12);
570
+ const { revealed, onRevealedChange, label, className, children } = t0;
571
+ const { state } = useTextInputContext();
572
+ const t1 = state.disabled;
573
+ let t2;
574
+ if ($[0] !== className) {
575
+ t2 = clsx(text_field_module_default.action, className);
576
+ $[0] = className;
577
+ $[1] = t2;
578
+ } else t2 = $[1];
579
+ let t3;
580
+ if ($[2] !== onRevealedChange || $[3] !== revealed) {
581
+ t3 = () => onRevealedChange(!revealed);
582
+ $[2] = onRevealedChange;
583
+ $[3] = revealed;
584
+ $[4] = t3;
585
+ } else t3 = $[4];
586
+ let t4;
587
+ if ($[5] !== children || $[6] !== label || $[7] !== revealed || $[8] !== state.disabled || $[9] !== t2 || $[10] !== t3) {
588
+ t4 = /* @__PURE__ */ jsx(Button, {
589
+ iconOnly: true,
590
+ icon: children,
591
+ label,
592
+ variant: "tertiary",
593
+ size: "sm",
594
+ "aria-pressed": revealed,
595
+ disabled: t1,
596
+ className: t2,
597
+ onClick: t3
598
+ });
599
+ $[5] = children;
600
+ $[6] = label;
601
+ $[7] = revealed;
602
+ $[8] = state.disabled;
603
+ $[9] = t2;
604
+ $[10] = t3;
605
+ $[11] = t4;
606
+ } else t4 = $[11];
607
+ return t4;
608
+ };
609
+ /**
610
+ * The value's length against `Root`'s `maxLength`, toned as it nears the limit.
611
+ * Renders nothing without a `maxLength`.
612
+ *
613
+ * @example
614
+ * <TextInput.Counter />
615
+ */
505
616
  var TextInputCounter = (t0) => {
506
617
  const $ = c(14);
507
618
  let className;
@@ -565,7 +676,9 @@ var TextInputCounter = (t0) => {
565
676
  * <TextInput.Label>Email</TextInput.Label>
566
677
  * <TextInput.Group>
567
678
  * <TextInput.Input type="email" />
568
- * <TextInput.Clear label="Clear" />
679
+ * <TextInput.Clear label="Clear">
680
+ * <CloseIcon />
681
+ * </TextInput.Clear>
569
682
  * </TextInput.Group>
570
683
  * <TextInput.Error />
571
684
  * </TextInput.Root>
@@ -580,6 +693,7 @@ var TextInput = {
580
693
  Input: TextInputInput,
581
694
  Clear: TextInputClear,
582
695
  Copy: TextInputCopy,
696
+ Reveal: TextInputReveal,
583
697
  Counter: TextInputCounter,
584
698
  Pending: InputPending,
585
699
  Description: Field.Description,
@@ -4,8 +4,8 @@ import text_field_module_default from "../text-field/text-field.module.js";
4
4
  import { useAutosize } from "./use-autosize.js";
5
5
  import textarea_field_module_default from "./textarea-field.module.js";
6
6
  import { c } from "react/compiler-runtime";
7
- import { jsx } from "react/jsx-runtime";
8
7
  import { clsx } from "clsx";
8
+ import { jsx } from "react/jsx-runtime";
9
9
  // src/components/textarea-field/textarea.tsx
10
10
  var MIN_ROWS = 2;
11
11
  /**
@@ -4,6 +4,12 @@ import { type TimeFieldProps as AriaTimeFieldProps } from "react-aria-components
4
4
  import { TemporalFrame, TemporalGroup, TemporalInput, TemporalSegment, type TemporalStateProps } from "../../lib/calendar/temporal.tsx";
5
5
  import { Field } from "../field/index.ts";
6
6
  export type TimeInputRootProps = AriaTimeFieldProps<Time> & TemporalStateProps;
7
+ /**
8
+ * A react-aria `TimeField` holding the value.
9
+ *
10
+ * @example
11
+ * <TimeInput.Root aria-labelledby={labelId}>…</TimeInput.Root>
12
+ */
7
13
  declare const TimeInputRoot: ({ state, ...props }: TimeInputRootProps) => ReactNode;
8
14
  /** The parts of a time input. */
9
15
  export type TimeInputParts = Readonly<{
@@ -5,6 +5,12 @@ import { c } from "react/compiler-runtime";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import { TimeField } from "react-aria-components";
7
7
  // src/components/time-field/time-input.tsx
8
+ /**
9
+ * A react-aria `TimeField` holding the value.
10
+ *
11
+ * @example
12
+ * <TimeInput.Root aria-labelledby={labelId}>…</TimeInput.Root>
13
+ */
8
14
  var TimeInputRoot = (t0) => {
9
15
  const $ = c(10);
10
16
  let props;
@@ -1,7 +1,7 @@
1
1
  import { useRequiredContext } from "../../lib/use-required-context.js";
2
2
  import { c } from "react/compiler-runtime";
3
- import { createContext } from "react";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { createContext } from "react";
5
5
  // src/components/time-zone-provider/time-zone-provider.tsx
6
6
  var TimeZoneContext = createContext(void 0);
7
7
  /**
@@ -1,3 +1,3 @@
1
1
  import { toast, toastManager } from "./toast.js";
2
- import { ToastProvider } from "./toast-provider.js";
3
- export { ToastProvider, toast, toastManager };
2
+ import { Toast, ToastProvider } from "./toast-provider.js";
3
+ export { Toast, ToastProvider, toast, toastManager };
@@ -1,6 +1,6 @@
1
1
  @layer kit.reset, kit.base, kit.components;
2
2
  @layer kit.components {
3
- ._viewport_r09x9_3 {
3
+ ._viewport_x67qw_3 {
4
4
  position: fixed;
5
5
  inset-block: auto var(--toast-viewport-inset, var(--sys-unit-16));
6
6
  inset-inline: auto var(--toast-viewport-inset, var(--sys-unit-16));
@@ -9,16 +9,20 @@
9
9
  gap: var(--sys-unit-8);
10
10
  inline-size: var(--toast-width, min(24rem, 100vw - 2rem));
11
11
  }
12
- ._viewport_r09x9_3 {
12
+ ._viewport_x67qw_3 {
13
13
  outline: 0 solid var(--sys-color-focus-ring);
14
14
  outline-offset: var(--sys-focus-ring-offset);
15
15
  }
16
- ._viewport_r09x9_3:focus-visible {
16
+ ._viewport_x67qw_3:focus-visible {
17
17
  outline-width: var(--sys-focus-ring-width);
18
18
  }
19
- ._toast_r09x9_19 {
19
+ ._toast_x67qw_19 {
20
20
  --_toast-fg: var(--sys-color-text);
21
21
  --_toast-bg: var(--sys-color-surface-overlay-high);
22
+ display: grid;
23
+ grid-template-columns: auto minmax(0, 1fr) auto;
24
+ align-items: center;
25
+ row-gap: var(--sys-unit-6);
22
26
  box-sizing: border-box;
23
27
  border-radius: var(--toast-radius, var(--sys-radius-md));
24
28
  background: var(--toast-bg, var(--_toast-bg));
@@ -28,72 +32,72 @@
28
32
  font: var(--sys-font-body-medium);
29
33
  }
30
34
  @media not (prefers-reduced-motion) {
31
- ._toast_r09x9_19 {
35
+ ._toast_x67qw_19 {
32
36
  transition: opacity var(--sys-motion-short) var(--sys-motion-standard), scale var(--sys-motion-short) var(--sys-motion-emphasized);
33
37
  }
34
38
  }
35
- ._toast_r09x9_19[data-starting-style], ._toast_r09x9_19[data-ending-style] {
39
+ ._toast_x67qw_19[data-starting-style], ._toast_x67qw_19[data-ending-style] {
36
40
  opacity: 0;
37
41
  scale: 0.8;
38
42
  }
39
- ._toast_r09x9_19[data-tone=success] {
43
+ ._toast_x67qw_19[data-tone=success] {
40
44
  --_toast-fg: var(--sys-color-success-fg);
41
45
  --_toast-bg: var(--sys-color-success-bg);
42
46
  }
43
- ._toast_r09x9_19[data-tone=error] {
47
+ ._toast_x67qw_19[data-tone=error] {
44
48
  --_toast-fg: var(--sys-color-error-fg);
45
49
  --_toast-bg: var(--sys-color-error-bg);
46
50
  }
47
- ._toast_r09x9_19[data-tone=warning] {
51
+ ._toast_x67qw_19[data-tone=warning] {
48
52
  --_toast-fg: var(--sys-color-warning-fg);
49
53
  --_toast-bg: var(--sys-color-warning-bg);
50
54
  }
51
- ._toast_r09x9_19[data-tone=info] {
55
+ ._toast_x67qw_19[data-tone=info] {
52
56
  --_toast-fg: var(--sys-color-info-fg);
53
57
  --_toast-bg: var(--sys-color-info-bg);
54
58
  }
55
- ._content_r09x9_55 {
56
- display: flex;
57
- flex-direction: column;
58
- gap: var(--sys-unit-6);
59
+ ._icon_x67qw_59 {
60
+ display: inline-flex;
61
+ flex-shrink: 0;
62
+ grid-area: 1/1;
63
+ margin-inline-end: var(--sys-unit-4);
64
+ font-size: var(--toast-icon-size, 1.2em);
59
65
  }
60
- ._header_r09x9_60 {
61
- display: flex;
62
- align-items: center;
63
- gap: var(--sys-unit-6);
66
+ ._icon_x67qw_59 > svg {
67
+ inline-size: 1em;
68
+ block-size: 1em;
69
+ fill: currentcolor;
64
70
  }
65
- ._headingMain_r09x9_65 {
66
- display: flex;
67
- flex: 1;
68
- align-items: center;
69
- gap: var(--sys-unit-4);
71
+ ._title_x67qw_71 {
72
+ grid-area: 1/2;
70
73
  min-inline-size: 0;
71
- }
72
- ._title_r09x9_72 {
73
74
  font: var(--sys-font-label-medium);
74
75
  }
75
- ._description_r09x9_75 {
76
+ ._close_x67qw_76 {
77
+ --btn-fg: var(--toast-fg, var(--_toast-fg));
78
+ grid-area: 1/3;
79
+ margin-inline-start: var(--sys-unit-6);
80
+ }
81
+ ._description_x67qw_81 {
82
+ grid-column: 1/-1;
76
83
  font: var(--sys-font-body-medium);
77
84
  text-wrap: pretty;
78
85
  }
79
- ._actions_r09x9_79 {
86
+ ._actions_x67qw_86 {
80
87
  display: flex;
88
+ grid-column: 1/-1;
81
89
  gap: var(--sys-unit-4);
82
90
  margin-block-start: var(--sys-unit-2);
83
91
  }
84
- ._closeButton_r09x9_84 {
85
- --btn-fg: var(--toast-fg, var(--_toast-fg));
86
- flex-shrink: 0;
87
- }
88
- ._action_r09x9_79[data-variant=primary] {
92
+ ._actions_x67qw_86 > [data-variant=primary] {
89
93
  --btn-bg: var(--toast-fg, var(--_toast-fg));
90
94
  --btn-fg: var(--toast-bg, var(--_toast-bg));
91
95
  }
92
- ._action_r09x9_79[data-variant=secondary] {
96
+ ._actions_x67qw_86 > [data-variant=secondary] {
93
97
  --btn-bg: var(--sys-color-surface-overlay-high);
94
98
  --btn-fg: var(--toast-fg, var(--_toast-fg));
95
99
  }
96
- ._action_r09x9_79[data-variant=tertiary] {
100
+ ._actions_x67qw_86 > [data-variant=tertiary] {
97
101
  --btn-fg: var(--toast-fg, var(--_toast-fg));
98
102
  }
99
103
  }
@@ -1,9 +1,70 @@
1
- import { type ReactNode } from "react";
1
+ import { Toast as BaseToast, type ToastRootToastObject } from "@base-ui/react/toast";
2
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
3
+ import { type ToastData } from "./toast.ts";
4
+ /** One toast in the viewport, as `ToastProvider` hands it to `renderToast`. */
5
+ export type ToastObject = ToastRootToastObject<ToastData>;
6
+ export type ToastRootProps = Omit<BaseToast.Root.Props, "toast" | "className"> & Readonly<{
7
+ /** The toast this frame shows, as `renderToast` received it. */
8
+ toast: ToastObject;
9
+ className?: string;
10
+ }>;
11
+ /** A toast's frame, in its tone: a dialog that holds the other parts. */
12
+ declare const Root: ({ toast, className, ...props }: ToastRootProps) => ReactNode;
13
+ export type ToastIconProps = ComponentPropsWithRef<"span">;
14
+ /** The caller's glyph before the title, sized and coloured by the toast. Renders nothing without children. */
15
+ declare const Icon: ({ className, children, ...props }: ToastIconProps) => ReactNode;
16
+ export type ToastTitleProps = Omit<BaseToast.Title.Props, "className"> & Readonly<{
17
+ className?: string;
18
+ }>;
19
+ /** The toast's heading, which names its dialog. */
20
+ declare const Title: ({ className, ...props }: ToastTitleProps) => ReactNode;
21
+ export type ToastDescriptionProps = Omit<BaseToast.Description.Props, "className"> & Readonly<{
22
+ className?: string;
23
+ }>;
24
+ /** The text under the title, which describes its dialog. */
25
+ declare const Description: ({ className, ...props }: ToastDescriptionProps) => ReactNode;
26
+ export type ToastActionsProps = ComponentPropsWithRef<"div">;
27
+ /** The row of buttons under the text, re-coloured for the toast's tone. */
28
+ declare const Actions: ({ className, ...props }: ToastActionsProps) => ReactNode;
29
+ export type ToastCloseProps = Readonly<{
30
+ /** Accessible name, such as "Close", surfaced as the tooltip hint and the `aria-label`. */
31
+ label: string;
32
+ /** The close glyph. */
33
+ children: ReactNode;
34
+ className?: string;
35
+ }>;
36
+ /** The icon-only button that closes the toast, named for every input. */
37
+ declare const Close: ({ label, children, className, }: ToastCloseProps) => ReactNode;
38
+ /** The parts of a toast, for `ToastProvider`'s `renderToast`. */
39
+ export type ToastParts = Readonly<{
40
+ Root: typeof Root;
41
+ Icon: typeof Icon;
42
+ Title: typeof Title;
43
+ Description: typeof Description;
44
+ Actions: typeof Actions;
45
+ Close: typeof Close;
46
+ }>;
47
+ /**
48
+ * The parts of one toast: the `Root` frame in its tone, the `Icon`, `Title`,
49
+ * `Description` and `Actions`, and the `Close` button.
50
+ *
51
+ * @example
52
+ * <Toast.Root toast={toast}>
53
+ * <Toast.Title>{toast.data?.body}</Toast.Title>
54
+ * <Toast.Close label="Close"><CloseIcon /></Toast.Close>
55
+ * </Toast.Root>
56
+ */
57
+ export declare const Toast: ToastParts;
2
58
  export type ToastProviderProps = Readonly<{
3
59
  /** Accessible name of each toast's close button, also its tooltip. */
4
60
  closeLabel: string;
61
+ /** The close button's glyph. */
62
+ closeIcon: ReactNode;
5
63
  /** Accessible name of the region the toasts appear in, reached with F6. */
6
64
  viewportLabel: string;
65
+ /** Draws each toast from the `Toast` parts, in place of the default. */
66
+ renderToast?: (toast: ToastObject) => ReactNode;
67
+ /** The app, which the viewport renders beside. */
7
68
  children: ReactNode;
8
69
  }>;
9
70
  /**
@@ -11,8 +72,9 @@ export type ToastProviderProps = Readonly<{
11
72
  * {@link toastManager} to base-ui and renders the viewport alongside the app.
12
73
  *
13
74
  * @example
14
- * <ToastProvider closeLabel="Close" viewportLabel="Notifications">
75
+ * <ToastProvider closeLabel="Close" closeIcon={<CloseIcon />} viewportLabel="Notifications">
15
76
  * <App />
16
77
  * </ToastProvider>
17
78
  */
18
- export declare const ToastProvider: ({ closeLabel, viewportLabel, children, }: ToastProviderProps) => ReactNode;
79
+ export declare const ToastProvider: ({ closeLabel, closeIcon, viewportLabel, renderToast, children, }: ToastProviderProps) => ReactNode;
80
+ export {};