@igne-agency/react-web-ui 0.3.0 → 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 (292) 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.css +4 -3
  113. package/dist/components/fieldset/fieldset.js +1 -1
  114. package/dist/components/fieldset/fieldset.module.js +2 -2
  115. package/dist/components/file-field/file-field.css +19 -15
  116. package/dist/components/file-field/file-field.d.ts +10 -1
  117. package/dist/components/file-field/file-field.js +130 -109
  118. package/dist/components/file-field/file-field.module.js +6 -4
  119. package/dist/components/file-field/file-input.d.ts +32 -9
  120. package/dist/components/file-field/file-input.js +94 -74
  121. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  122. package/dist/components/filter-bar/filter-bar.js +552 -216
  123. package/dist/components/form/form.d.ts +4 -6
  124. package/dist/components/form/form.js +6 -8
  125. package/dist/components/icon/icon.d.ts +5 -10
  126. package/dist/components/icon/icon.js +4 -6
  127. package/dist/components/link/link.js +1 -1
  128. package/dist/components/link-button/link-button.d.ts +1 -2
  129. package/dist/components/link-button/link-button.js +12 -22
  130. package/dist/components/loading-message/loading-message.d.ts +2 -2
  131. package/dist/components/loading-message/loading-message.js +1 -1
  132. package/dist/components/locale-provider/locale-provider.js +1 -1
  133. package/dist/components/menu/menu.d.ts +40 -22
  134. package/dist/components/menu/menu.js +100 -40
  135. package/dist/components/nav/nav-context.d.ts +0 -1
  136. package/dist/components/nav/nav-context.js +1 -2
  137. package/dist/components/nav/nav-item-view.d.ts +7 -7
  138. package/dist/components/nav/nav-item-view.js +27 -51
  139. package/dist/components/nav/nav.css +72 -60
  140. package/dist/components/nav/nav.d.ts +15 -8
  141. package/dist/components/nav/nav.js +105 -52
  142. package/dist/components/nav/nav.module.js +14 -14
  143. package/dist/components/number-field/number-field.d.ts +7 -1
  144. package/dist/components/number-field/number-field.js +98 -82
  145. package/dist/components/number-field/number-input.d.ts +53 -4
  146. package/dist/components/number-field/number-input.js +68 -21
  147. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  148. package/dist/components/number-field/tsf-number-field.js +1 -1
  149. package/dist/components/otp-field/otp-input.d.ts +25 -0
  150. package/dist/components/otp-field/otp-input.js +26 -1
  151. package/dist/components/pagination/pagination.d.ts +82 -23
  152. package/dist/components/pagination/pagination.js +656 -229
  153. package/dist/components/password-field/password-field.d.ts +7 -1
  154. package/dist/components/password-field/password-field.js +117 -126
  155. package/dist/components/password-field/password-strength.js +1 -1
  156. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  157. package/dist/components/password-field/tsf-password-field.js +1 -1
  158. package/dist/components/photo-field/photo-field.d.ts +17 -3
  159. package/dist/components/photo-field/photo-field.js +168 -89
  160. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  161. package/dist/components/photo-field/photo-input-context.js +14 -0
  162. package/dist/components/photo-field/photo-input.d.ts +58 -23
  163. package/dist/components/photo-field/photo-input.js +459 -261
  164. package/dist/components/popover/popover.d.ts +55 -23
  165. package/dist/components/popover/popover.js +205 -61
  166. package/dist/components/radio-group-field/radio-group.js +1 -1
  167. package/dist/components/search-field/search-field.d.ts +7 -5
  168. package/dist/components/search-field/search-field.js +4 -6
  169. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  170. package/dist/components/search-field/tsf-search-field.js +1 -1
  171. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  172. package/dist/components/select-field/select-field.d.ts +7 -1
  173. package/dist/components/select-field/select-field.js +151 -139
  174. package/dist/components/select-field/select.d.ts +28 -6
  175. package/dist/components/select-field/select.js +234 -149
  176. package/dist/components/skeleton/skeleton.js +1 -1
  177. package/dist/components/spinner/spinner.css +47 -1
  178. package/dist/components/spinner/spinner.js +28 -11
  179. package/dist/components/spinner/spinner.module.js +18 -3
  180. package/dist/components/stale/stale.d.ts +17 -21
  181. package/dist/components/stale/stale.js +307 -129
  182. package/dist/components/status-message/status-message.css +22 -21
  183. package/dist/components/status-message/status-message.d.ts +10 -5
  184. package/dist/components/status-message/status-message.js +20 -24
  185. package/dist/components/status-message/status-message.module.js +6 -6
  186. package/dist/components/status-message/status-preset.d.ts +4 -5
  187. package/dist/components/status-message/status-preset.js +3 -3
  188. package/dist/components/switch-field/switch.js +1 -1
  189. package/dist/components/tabs/tabs.d.ts +51 -28
  190. package/dist/components/tabs/tabs.js +219 -144
  191. package/dist/components/tag/tag.css +23 -21
  192. package/dist/components/tag/tag.d.ts +17 -15
  193. package/dist/components/tag/tag.js +140 -65
  194. package/dist/components/tag/tag.module.js +3 -3
  195. package/dist/components/tag-group/tag-group.css +30 -27
  196. package/dist/components/tag-group/tag-group.d.ts +10 -4
  197. package/dist/components/tag-group/tag-group.js +47 -35
  198. package/dist/components/tag-group/tag-group.module.js +4 -4
  199. package/dist/components/text-field/text-field.d.ts +14 -3
  200. package/dist/components/text-field/text-field.js +154 -133
  201. package/dist/components/text-field/text-input.d.ts +89 -3
  202. package/dist/components/text-field/text-input.js +184 -70
  203. package/dist/components/textarea-field/textarea.js +1 -1
  204. package/dist/components/time-field/time-input.d.ts +6 -0
  205. package/dist/components/time-field/time-input.js +6 -0
  206. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  207. package/dist/components/toast/index.js +2 -2
  208. package/dist/components/toast/toast-provider.css +38 -34
  209. package/dist/components/toast/toast-provider.d.ts +65 -3
  210. package/dist/components/toast/toast-provider.js +313 -148
  211. package/dist/components/toast/toast-provider.module.js +11 -17
  212. package/dist/components/toast/toast.d.ts +5 -1
  213. package/dist/components/toast/toast.js +2 -1
  214. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  215. package/dist/components/tooltip/tooltip.d.ts +6 -6
  216. package/dist/components/tooltip/tooltip.js +7 -7
  217. package/dist/data-table/data-table-content.d.ts +18 -10
  218. package/dist/data-table/data-table-content.js +145 -290
  219. package/dist/data-table/data-table-context.d.ts +4 -2
  220. package/dist/data-table/data-table-context.js +1 -1
  221. package/dist/data-table/data-table-parts.d.ts +99 -0
  222. package/dist/data-table/data-table-parts.js +1182 -0
  223. package/dist/data-table/data-table-selection.d.ts +7 -3
  224. package/dist/data-table/data-table-selection.js +62 -37
  225. package/dist/data-table/data-table.css +100 -95
  226. package/dist/data-table/data-table.d.ts +49 -25
  227. package/dist/data-table/data-table.js +95 -83
  228. package/dist/data-table/data-table.module.js +34 -34
  229. package/dist/data-table/index.d.ts +2 -1
  230. package/dist/data-table/index.js +2 -1
  231. package/dist/data-view/use-data-view.d.ts +2 -2
  232. package/dist/data-view/use-data-view.js +2 -2
  233. package/dist/index.js +7 -8
  234. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  235. package/dist/lib/calendar/calendar-navigation.js +72 -73
  236. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  237. package/dist/lib/calendar/calendar-year.js +137 -156
  238. package/dist/lib/calendar/temporal.d.ts +18 -12
  239. package/dist/lib/calendar/temporal.js +191 -147
  240. package/dist/lib/table-storage.d.ts +2 -2
  241. package/dist/lib/table-storage.js +2 -2
  242. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  243. package/dist/terrazzo/index.d.ts +16 -0
  244. package/dist/terrazzo/index.js +94 -2
  245. package/dist/tokens.css +71 -69
  246. package/package.json +3 -2
  247. package/tokens/ref.tokens.json +0 -30
  248. package/tokens/sys.tokens.json +0 -7
  249. package/dist/assets/spinner.js +0 -28
  250. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  251. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  252. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  253. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  254. package/dist/components/conversation/conversation.context.js +0 -4
  255. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  291. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  292. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,16 +1,18 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { FieldBlurHandler, FieldProps } from "../field/index.ts";
3
- import { type SvgComponent } from "../icon/index.ts";
4
3
  import { type TextInputInputProps, type TextInputRootProps } from "./text-input.tsx";
5
4
  /** The clear button: off, or on with its accessible name. */
6
5
  export type TextFieldClearProps = Readonly<{
7
6
  clearable?: false;
8
7
  clearLabel?: undefined;
8
+ clearIcon?: undefined;
9
9
  }> | Readonly<{
10
10
  /** Adds the clear button once the field holds a value. */
11
11
  clearable: true;
12
12
  /** The clear button's accessible name and tooltip, such as "Clear". */
13
13
  clearLabel: string;
14
+ /** The clear button's icon. */
15
+ clearIcon: ReactNode;
14
16
  }>;
15
17
  /** The copy-to-clipboard button: off, or on with the copy it shows. */
16
18
  export type TextFieldCopyProps = Readonly<{
@@ -18,6 +20,9 @@ export type TextFieldCopyProps = Readonly<{
18
20
  copyLabel?: undefined;
19
21
  copiedLabel?: undefined;
20
22
  copyFailedLabel?: undefined;
23
+ copyIcon?: undefined;
24
+ copiedIcon?: undefined;
25
+ copyFailedIcon?: undefined;
21
26
  }> | Readonly<{
22
27
  /** Adds a copy-to-clipboard button once the field holds a value. */
23
28
  copyable: true;
@@ -27,6 +32,12 @@ export type TextFieldCopyProps = Readonly<{
27
32
  copiedLabel: string;
28
33
  /** Announced when copying failed and the text is selected instead. */
29
34
  copyFailedLabel: string;
35
+ /** The copy button's icon. */
36
+ copyIcon: ReactNode;
37
+ /** The copy button's icon once the value is on the clipboard. Left out, it keeps `copyIcon`. */
38
+ copiedIcon?: ReactNode;
39
+ /** The copy button's icon once copying failed. Left out, it keeps `copyIcon`. */
40
+ copyFailedIcon?: ReactNode;
30
41
  }>;
31
42
  /** Every `TextField` prop but the optional clear and copy buttons. */
32
43
  export type TextFieldBaseProps = FieldProps & Omit<TextInputRootProps, keyof FieldProps | "children"> & Pick<TextInputInputProps, "type" | "placeholder" | "name" | "id" | "autoComplete" | "autoCapitalize" | "inputMode" | "enterKeyHint" | "spellCheck" | "onFocus"> & Readonly<{
@@ -34,7 +45,7 @@ export type TextFieldBaseProps = FieldProps & Omit<TextInputRootProps, keyof Fie
34
45
  /** Keeps the label in the accessibility tree but out of view. */
35
46
  labelHidden?: boolean;
36
47
  /** Decorative leading icon inside the group. */
37
- icon?: SvgComponent;
48
+ icon?: ReactNode;
38
49
  /** Static leading text, such as a currency sign. */
39
50
  prefix?: ReactNode;
40
51
  /** Static trailing text, such as a unit. */
@@ -54,4 +65,4 @@ export type TextFieldProps = TextFieldBaseProps & TextFieldClearProps & TextFiel
54
65
  * onValueChange={setName}
55
66
  * />
56
67
  */
57
- export declare const TextField: ({ label, labelHidden, description, errors, requiredness, optionalLabel, icon, prefix, suffix, clearable, clearLabel, copyable, copyLabel, copiedLabel, copyFailedLabel, value, onValueChange, disabled, readOnly, dirty, touched, pending, maxLength, state, className, ...inputProps }: TextFieldProps) => ReactNode;
68
+ export declare const TextField: ({ label, labelHidden, description, errors, requiredness, optionalLabel, icon, prefix, suffix, clearable, clearLabel, clearIcon, copyable, copyLabel, copiedLabel, copyFailedLabel, copyIcon, copiedIcon, copyFailedIcon, value, onValueChange, disabled, readOnly, dirty, touched, pending, maxLength, state, className, ...inputProps }: TextFieldProps) => ReactNode;
@@ -1,4 +1,3 @@
1
- import { Icon } from "../icon/icon.js";
2
1
  import { TextInput } from "./text-input.js";
3
2
  import text_field_module_default from "./text-field.module.js";
4
3
  import { c } from "react/compiler-runtime";
@@ -18,12 +17,16 @@ import { jsx, jsxs } from "react/jsx-runtime";
18
17
  * />
19
18
  */
20
19
  var TextField = (t0) => {
21
- const $ = c(75);
20
+ const $ = c(83);
22
21
  let className;
22
+ let clearIcon;
23
23
  let clearLabel;
24
24
  let clearable;
25
+ let copiedIcon;
25
26
  let copiedLabel;
27
+ let copyFailedIcon;
26
28
  let copyFailedLabel;
29
+ let copyIcon;
27
30
  let copyLabel;
28
31
  let copyable;
29
32
  let description;
@@ -46,127 +49,145 @@ var TextField = (t0) => {
46
49
  let touched;
47
50
  let value;
48
51
  if ($[0] !== t0) {
49
- ({label, labelHidden: t1, description, errors, requiredness, optionalLabel, icon, prefix, suffix, clearable, clearLabel, copyable, copyLabel, copiedLabel, copyFailedLabel, value, onValueChange, disabled, readOnly, dirty, touched, pending, maxLength, state, className, ...inputProps} = t0);
52
+ ({label, labelHidden: t1, description, errors, requiredness, optionalLabel, icon, prefix, suffix, clearable, clearLabel, clearIcon, copyable, copyLabel, copiedLabel, copyFailedLabel, copyIcon, copiedIcon, copyFailedIcon, value, onValueChange, disabled, readOnly, dirty, touched, pending, maxLength, state, className, ...inputProps} = t0);
50
53
  $[0] = t0;
51
54
  $[1] = className;
52
- $[2] = clearLabel;
53
- $[3] = clearable;
54
- $[4] = copiedLabel;
55
- $[5] = copyFailedLabel;
56
- $[6] = copyLabel;
57
- $[7] = copyable;
58
- $[8] = description;
59
- $[9] = dirty;
60
- $[10] = disabled;
61
- $[11] = errors;
62
- $[12] = icon;
63
- $[13] = inputProps;
64
- $[14] = label;
65
- $[15] = maxLength;
66
- $[16] = onValueChange;
67
- $[17] = optionalLabel;
68
- $[18] = pending;
69
- $[19] = prefix;
70
- $[20] = readOnly;
71
- $[21] = requiredness;
72
- $[22] = state;
73
- $[23] = suffix;
74
- $[24] = t1;
75
- $[25] = touched;
76
- $[26] = value;
55
+ $[2] = clearIcon;
56
+ $[3] = clearLabel;
57
+ $[4] = clearable;
58
+ $[5] = copiedIcon;
59
+ $[6] = copiedLabel;
60
+ $[7] = copyFailedIcon;
61
+ $[8] = copyFailedLabel;
62
+ $[9] = copyIcon;
63
+ $[10] = copyLabel;
64
+ $[11] = copyable;
65
+ $[12] = description;
66
+ $[13] = dirty;
67
+ $[14] = disabled;
68
+ $[15] = errors;
69
+ $[16] = icon;
70
+ $[17] = inputProps;
71
+ $[18] = label;
72
+ $[19] = maxLength;
73
+ $[20] = onValueChange;
74
+ $[21] = optionalLabel;
75
+ $[22] = pending;
76
+ $[23] = prefix;
77
+ $[24] = readOnly;
78
+ $[25] = requiredness;
79
+ $[26] = state;
80
+ $[27] = suffix;
81
+ $[28] = t1;
82
+ $[29] = touched;
83
+ $[30] = value;
77
84
  } else {
78
85
  className = $[1];
79
- clearLabel = $[2];
80
- clearable = $[3];
81
- copiedLabel = $[4];
82
- copyFailedLabel = $[5];
83
- copyLabel = $[6];
84
- copyable = $[7];
85
- description = $[8];
86
- dirty = $[9];
87
- disabled = $[10];
88
- errors = $[11];
89
- icon = $[12];
90
- inputProps = $[13];
91
- label = $[14];
92
- maxLength = $[15];
93
- onValueChange = $[16];
94
- optionalLabel = $[17];
95
- pending = $[18];
96
- prefix = $[19];
97
- readOnly = $[20];
98
- requiredness = $[21];
99
- state = $[22];
100
- suffix = $[23];
101
- t1 = $[24];
102
- touched = $[25];
103
- value = $[26];
86
+ clearIcon = $[2];
87
+ clearLabel = $[3];
88
+ clearable = $[4];
89
+ copiedIcon = $[5];
90
+ copiedLabel = $[6];
91
+ copyFailedIcon = $[7];
92
+ copyFailedLabel = $[8];
93
+ copyIcon = $[9];
94
+ copyLabel = $[10];
95
+ copyable = $[11];
96
+ description = $[12];
97
+ dirty = $[13];
98
+ disabled = $[14];
99
+ errors = $[15];
100
+ icon = $[16];
101
+ inputProps = $[17];
102
+ label = $[18];
103
+ maxLength = $[19];
104
+ onValueChange = $[20];
105
+ optionalLabel = $[21];
106
+ pending = $[22];
107
+ prefix = $[23];
108
+ readOnly = $[24];
109
+ requiredness = $[25];
110
+ state = $[26];
111
+ suffix = $[27];
112
+ t1 = $[28];
113
+ touched = $[29];
114
+ value = $[30];
104
115
  }
105
116
  const t2 = (t1 === void 0 ? false : t1) ? text_field_module_default.visuallyHidden : void 0;
106
117
  let t3;
107
- if ($[27] !== label || $[28] !== t2) {
118
+ if ($[31] !== label || $[32] !== t2) {
108
119
  t3 = /* @__PURE__ */ jsx(TextInput.Label, {
109
120
  className: t2,
110
121
  children: label
111
122
  });
112
- $[27] = label;
113
- $[28] = t2;
114
- $[29] = t3;
115
- } else t3 = $[29];
123
+ $[31] = label;
124
+ $[32] = t2;
125
+ $[33] = t3;
126
+ } else t3 = $[33];
116
127
  let t4;
117
- if ($[30] !== icon) {
118
- t4 = icon !== void 0 && /* @__PURE__ */ jsx(TextInput.Inlay, { children: /* @__PURE__ */ jsx(Icon, {
119
- svg: icon,
120
- label: ""
121
- }) });
122
- $[30] = icon;
123
- $[31] = t4;
124
- } else t4 = $[31];
128
+ if ($[34] !== icon) {
129
+ t4 = icon !== void 0 && /* @__PURE__ */ jsx(TextInput.Inlay, {
130
+ "aria-hidden": "true",
131
+ children: icon
132
+ });
133
+ $[34] = icon;
134
+ $[35] = t4;
135
+ } else t4 = $[35];
125
136
  let t5;
126
- if ($[32] !== prefix) {
137
+ if ($[36] !== prefix) {
127
138
  t5 = prefix !== void 0 && /* @__PURE__ */ jsx(TextInput.Affix, { children: prefix });
128
- $[32] = prefix;
129
- $[33] = t5;
130
- } else t5 = $[33];
139
+ $[36] = prefix;
140
+ $[37] = t5;
141
+ } else t5 = $[37];
131
142
  let t6;
132
- if ($[34] !== inputProps) {
143
+ if ($[38] !== inputProps) {
133
144
  t6 = /* @__PURE__ */ jsx(TextInput.Input, { ...inputProps });
134
- $[34] = inputProps;
135
- $[35] = t6;
136
- } else t6 = $[35];
145
+ $[38] = inputProps;
146
+ $[39] = t6;
147
+ } else t6 = $[39];
137
148
  let t7;
138
- if ($[36] !== suffix) {
149
+ if ($[40] !== suffix) {
139
150
  t7 = suffix !== void 0 && /* @__PURE__ */ jsx(TextInput.Affix, { children: suffix });
140
- $[36] = suffix;
141
- $[37] = t7;
142
- } else t7 = $[37];
151
+ $[40] = suffix;
152
+ $[41] = t7;
153
+ } else t7 = $[41];
143
154
  let t8;
144
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
155
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
145
156
  t8 = /* @__PURE__ */ jsx(TextInput.Pending, {});
146
- $[38] = t8;
147
- } else t8 = $[38];
157
+ $[42] = t8;
158
+ } else t8 = $[42];
148
159
  let t9;
149
- if ($[39] !== clearLabel || $[40] !== clearable) {
150
- t9 = clearable === true && /* @__PURE__ */ jsx(TextInput.Clear, { label: clearLabel });
151
- $[39] = clearLabel;
152
- $[40] = clearable;
153
- $[41] = t9;
154
- } else t9 = $[41];
160
+ if ($[43] !== clearIcon || $[44] !== clearLabel || $[45] !== clearable) {
161
+ t9 = clearable === true && /* @__PURE__ */ jsx(TextInput.Clear, {
162
+ label: clearLabel,
163
+ children: clearIcon
164
+ });
165
+ $[43] = clearIcon;
166
+ $[44] = clearLabel;
167
+ $[45] = clearable;
168
+ $[46] = t9;
169
+ } else t9 = $[46];
155
170
  let t10;
156
- if ($[42] !== copiedLabel || $[43] !== copyFailedLabel || $[44] !== copyLabel || $[45] !== copyable) {
171
+ if ($[47] !== copiedIcon || $[48] !== copiedLabel || $[49] !== copyFailedIcon || $[50] !== copyFailedLabel || $[51] !== copyIcon || $[52] !== copyLabel || $[53] !== copyable) {
157
172
  t10 = copyable === true && /* @__PURE__ */ jsx(TextInput.Copy, {
158
173
  label: copyLabel,
159
174
  copiedLabel,
160
- failedLabel: copyFailedLabel
175
+ failedLabel: copyFailedLabel,
176
+ copiedIcon,
177
+ failedIcon: copyFailedIcon,
178
+ children: copyIcon
161
179
  });
162
- $[42] = copiedLabel;
163
- $[43] = copyFailedLabel;
164
- $[44] = copyLabel;
165
- $[45] = copyable;
166
- $[46] = t10;
167
- } else t10 = $[46];
180
+ $[47] = copiedIcon;
181
+ $[48] = copiedLabel;
182
+ $[49] = copyFailedIcon;
183
+ $[50] = copyFailedLabel;
184
+ $[51] = copyIcon;
185
+ $[52] = copyLabel;
186
+ $[53] = copyable;
187
+ $[54] = t10;
188
+ } else t10 = $[54];
168
189
  let t11;
169
- if ($[47] !== t10 || $[48] !== t4 || $[49] !== t5 || $[50] !== t6 || $[51] !== t7 || $[52] !== t9) {
190
+ if ($[55] !== t10 || $[56] !== t4 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7 || $[60] !== t9) {
170
191
  t11 = /* @__PURE__ */ jsxs(TextInput.Group, { children: [
171
192
  t4,
172
193
  t5,
@@ -176,32 +197,32 @@ var TextField = (t0) => {
176
197
  t9,
177
198
  t10
178
199
  ] });
179
- $[47] = t10;
180
- $[48] = t4;
181
- $[49] = t5;
182
- $[50] = t6;
183
- $[51] = t7;
184
- $[52] = t9;
185
- $[53] = t11;
186
- } else t11 = $[53];
200
+ $[55] = t10;
201
+ $[56] = t4;
202
+ $[57] = t5;
203
+ $[58] = t6;
204
+ $[59] = t7;
205
+ $[60] = t9;
206
+ $[61] = t11;
207
+ } else t11 = $[61];
187
208
  let t12;
188
- if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
209
+ if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
189
210
  t12 = /* @__PURE__ */ jsx(TextInput.Counter, {});
190
- $[54] = t12;
191
- } else t12 = $[54];
211
+ $[62] = t12;
212
+ } else t12 = $[62];
192
213
  let t13;
193
- if ($[55] !== description) {
214
+ if ($[63] !== description) {
194
215
  t13 = /* @__PURE__ */ jsx(TextInput.Description, { children: description });
195
- $[55] = description;
196
- $[56] = t13;
197
- } else t13 = $[56];
216
+ $[63] = description;
217
+ $[64] = t13;
218
+ } else t13 = $[64];
198
219
  let t14;
199
- if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
220
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
200
221
  t14 = /* @__PURE__ */ jsx(TextInput.Error, {});
201
- $[57] = t14;
202
- } else t14 = $[57];
222
+ $[65] = t14;
223
+ } else t14 = $[65];
203
224
  let t15;
204
- if ($[58] !== className || $[59] !== dirty || $[60] !== disabled || $[61] !== errors || $[62] !== maxLength || $[63] !== onValueChange || $[64] !== optionalLabel || $[65] !== pending || $[66] !== readOnly || $[67] !== requiredness || $[68] !== state || $[69] !== t11 || $[70] !== t13 || $[71] !== t3 || $[72] !== touched || $[73] !== value) {
225
+ if ($[66] !== className || $[67] !== dirty || $[68] !== disabled || $[69] !== errors || $[70] !== maxLength || $[71] !== onValueChange || $[72] !== optionalLabel || $[73] !== pending || $[74] !== readOnly || $[75] !== requiredness || $[76] !== state || $[77] !== t11 || $[78] !== t13 || $[79] !== t3 || $[80] !== touched || $[81] !== value) {
205
226
  t15 = /* @__PURE__ */ jsxs(TextInput.Root, {
206
227
  value,
207
228
  onValueChange,
@@ -224,24 +245,24 @@ var TextField = (t0) => {
224
245
  t14
225
246
  ]
226
247
  });
227
- $[58] = className;
228
- $[59] = dirty;
229
- $[60] = disabled;
230
- $[61] = errors;
231
- $[62] = maxLength;
232
- $[63] = onValueChange;
233
- $[64] = optionalLabel;
234
- $[65] = pending;
235
- $[66] = readOnly;
236
- $[67] = requiredness;
237
- $[68] = state;
238
- $[69] = t11;
239
- $[70] = t13;
240
- $[71] = t3;
241
- $[72] = touched;
242
- $[73] = value;
243
- $[74] = t15;
244
- } else t15 = $[74];
248
+ $[66] = className;
249
+ $[67] = dirty;
250
+ $[68] = disabled;
251
+ $[69] = errors;
252
+ $[70] = maxLength;
253
+ $[71] = onValueChange;
254
+ $[72] = optionalLabel;
255
+ $[73] = pending;
256
+ $[74] = readOnly;
257
+ $[75] = requiredness;
258
+ $[76] = state;
259
+ $[77] = t11;
260
+ $[78] = t13;
261
+ $[79] = t3;
262
+ $[80] = touched;
263
+ $[81] = value;
264
+ $[82] = t15;
265
+ } else t15 = $[82];
245
266
  return t15;
246
267
  };
247
268
  export { TextField };
@@ -14,20 +14,65 @@ export type TextInputRootProps = Omit<FieldProps, "label" | "description"> & Rea
14
14
  className?: string;
15
15
  children?: ReactNode;
16
16
  }>;
17
+ /**
18
+ * The field frame around a text input, holding its value and projecting its
19
+ * state onto every part.
20
+ *
21
+ * @example
22
+ * <TextInput.Root value={value} onValueChange={setValue} optionalLabel="optional">…</TextInput.Root>
23
+ */
17
24
  declare const TextInputRoot: ({ value, onValueChange, disabled, readOnly, requiredness, optionalLabel, errors, dirty, touched, pending, maxLength, state, className, children, }: TextInputRootProps) => ReactNode;
18
25
  export type TextInputLabelProps = InputLabelProps;
26
+ /**
27
+ * The bordered box holding the control and its inlays.
28
+ *
29
+ * @example
30
+ * <TextInput.Group><TextInput.Input /></TextInput.Group>
31
+ */
19
32
  declare const TextInputGroup: ({ className, children, ...props }: ComponentProps<"div">) => ReactNode;
33
+ /**
34
+ * A strip of inlays along the bottom edge of the group.
35
+ *
36
+ * @example
37
+ * <TextInput.Bar><TextInput.Counter /></TextInput.Bar>
38
+ */
20
39
  declare const TextInputBar: ({ className, ...props }: ComponentProps<"div">) => ReactNode;
40
+ /**
41
+ * A slot beside the control inside the group, such as an icon.
42
+ *
43
+ * @example
44
+ * <TextInput.Inlay aria-hidden="true"><SearchIcon /></TextInput.Inlay>
45
+ */
21
46
  declare const TextInputInlay: ({ className, ...props }: ComponentProps<"span">) => ReactNode;
47
+ /**
48
+ * Static text beside the control, such as a unit. Decoration only.
49
+ *
50
+ * @example
51
+ * <TextInput.Affix>kg</TextInput.Affix>
52
+ */
22
53
  declare const TextInputAffix: ({ className, ...props }: ComponentProps<"span">) => ReactNode;
23
54
  export type TextInputInputProps = Omit<BaseInputProps, "value" | "defaultValue" | "onValueChange">;
55
+ /**
56
+ * The bare control, bound to `Root`'s value.
57
+ *
58
+ * @example
59
+ * <TextInput.Input type="email" />
60
+ */
24
61
  declare const TextInputInput: ({ type, className, ...props }: TextInputInputProps) => ReactNode;
25
62
  export type TextInputClearProps = Readonly<{
26
63
  /** Accessible name and tooltip hint, such as "Clear". */
27
64
  label: string;
28
65
  className?: string;
66
+ /** The icon the button shows. */
67
+ children: ReactNode;
29
68
  }>;
30
- declare const TextInputClear: ({ label, className, }: TextInputClearProps) => ReactNode;
69
+ /**
70
+ * The icon-only button that empties the control, shown once it holds a value.
71
+ *
72
+ * @example
73
+ * <TextInput.Clear label="Clear"><CloseIcon /></TextInput.Clear>
74
+ */
75
+ declare const TextInputClear: ({ label, className, children, }: TextInputClearProps) => ReactNode;
31
76
  export type TextInputCopyProps = Readonly<{
32
77
  /** Accessible name and tooltip hint, such as "Copy". */
33
78
  label: string;
@@ -35,9 +80,47 @@ export type TextInputCopyProps = Readonly<{
35
80
  copiedLabel: string;
36
81
  /** Accessible name and announcement once copying failed and the text is selected instead. */
37
82
  failedLabel: string;
83
+ /** The icon while the confirmation shows. Left out, the button keeps its own. */
84
+ copiedIcon?: ReactNode;
85
+ /** The icon once copying failed. Left out, the button keeps its own. */
86
+ failedIcon?: ReactNode;
38
87
  className?: string;
88
+ /** The icon the button shows. */
89
+ children: ReactNode;
39
90
  }>;
40
- declare const TextInputCopy: ({ label, copiedLabel, failedLabel, className, }: TextInputCopyProps) => ReactNode;
91
+ /**
92
+ * The icon-only button that copies the value to the clipboard, shown once it
93
+ * holds one, and announces whether the copy landed.
94
+ *
95
+ * @example
96
+ * <TextInput.Copy label="Copy" copiedLabel="Copied" failedLabel="Copy failed, text selected"><CopyIcon /></TextInput.Copy>
97
+ */
98
+ declare const TextInputCopy: ({ label, copiedLabel, failedLabel, copiedIcon, failedIcon, className, children, }: TextInputCopyProps) => ReactNode;
99
+ export type TextInputRevealProps = Readonly<{
100
+ /** Whether the concealed value shows as text. */
101
+ revealed: boolean;
102
+ onRevealedChange: (revealed: boolean) => void;
103
+ /** Accessible name and tooltip hint, such as "Show password". */
104
+ label: string;
105
+ className?: string;
106
+ /** The icon the button shows. */
107
+ children: ReactNode;
108
+ }>;
109
+ /**
110
+ * The icon-only toggle that shows a concealed value, such as a password, as
111
+ * text. The caller switches the `Input`'s `type` with `revealed`.
112
+ *
113
+ * @example
114
+ * <TextInput.Reveal revealed={revealed} onRevealedChange={setRevealed} label="Show password"><VisibilityIcon /></TextInput.Reveal>
115
+ */
116
+ declare const TextInputReveal: ({ revealed, onRevealedChange, label, className, children, }: TextInputRevealProps) => ReactNode;
117
+ /**
118
+ * The value's length against `Root`'s `maxLength`, toned as it nears the limit.
119
+ * Renders nothing without a `maxLength`.
120
+ *
121
+ * @example
122
+ * <TextInput.Counter />
123
+ */
41
124
  declare const TextInputCounter: ({ className, ...props }: ComponentProps<"span">) => ReactNode;
42
125
  export type TextInputPendingProps = InputPendingProps;
43
126
  export type TextInputErrorProps = InputErrorProps;
@@ -52,6 +135,7 @@ export type TextInputParts = Readonly<{
52
135
  Input: typeof TextInputInput;
53
136
  Clear: typeof TextInputClear;
54
137
  Copy: typeof TextInputCopy;
138
+ Reveal: typeof TextInputReveal;
55
139
  Counter: typeof TextInputCounter;
56
140
  Pending: typeof InputPending;
57
141
  Description: typeof Field.Description;
@@ -70,7 +154,9 @@ export type TextInputParts = Readonly<{
70
154
  * <TextInput.Label>Email</TextInput.Label>
71
155
  * <TextInput.Group>
72
156
  * <TextInput.Input type="email" />
73
- * <TextInput.Clear label="Clear" />
157
+ * <TextInput.Clear label="Clear">
158
+ * <CloseIcon />
159
+ * </TextInput.Clear>
74
160
  * </TextInput.Group>
75
161
  * <TextInput.Error />
76
162
  * </TextInput.Root>