@igne-agency/react-web-ui 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/dist/components/accordion/accordion.css +21 -21
  2. package/dist/components/accordion/accordion.d.ts +17 -4
  3. package/dist/components/accordion/accordion.js +83 -36
  4. package/dist/components/accordion/accordion.module.js +6 -6
  5. package/dist/components/attachment-tile/attachment-preview.d.ts +56 -13
  6. package/dist/components/attachment-tile/attachment-preview.js +388 -119
  7. package/dist/components/attachment-tile/attachment-tile.css +31 -25
  8. package/dist/components/attachment-tile/attachment-tile.d.ts +32 -10
  9. package/dist/components/attachment-tile/attachment-tile.js +160 -43
  10. package/dist/components/attachment-tile/attachment-tile.module.js +8 -8
  11. package/dist/components/attachment-tile/index.d.ts +1 -1
  12. package/dist/components/avatar/avatar.css +9 -9
  13. package/dist/components/avatar/avatar.d.ts +50 -5
  14. package/dist/components/avatar/avatar.js +178 -64
  15. package/dist/components/avatar/avatar.module.js +3 -3
  16. package/dist/components/avatar-group/avatar-group-context.d.ts +2 -4
  17. package/dist/components/avatar-group/avatar-group-context.js +2 -2
  18. package/dist/components/avatar-group/avatar-group.css +26 -20
  19. package/dist/components/avatar-group/avatar-group.d.ts +85 -27
  20. package/dist/components/avatar-group/avatar-group.js +400 -246
  21. package/dist/components/avatar-group/avatar-group.module.js +8 -8
  22. package/dist/components/breadcrumbs/breadcrumbs.css +12 -12
  23. package/dist/components/breadcrumbs/breadcrumbs.d.ts +69 -23
  24. package/dist/components/breadcrumbs/breadcrumbs.js +299 -248
  25. package/dist/components/breadcrumbs/breadcrumbs.module.js +8 -8
  26. package/dist/components/button/button.css +29 -31
  27. package/dist/components/button/button.d.ts +20 -16
  28. package/dist/components/button/button.js +140 -145
  29. package/dist/components/button/button.module.js +1 -1
  30. package/dist/components/button/index.js +1 -1
  31. package/dist/components/checkbox-field/checkbox-field.js +63 -49
  32. package/dist/components/checkbox-field/checkbox.css +105 -56
  33. package/dist/components/checkbox-field/checkbox.d.ts +3 -2
  34. package/dist/components/checkbox-field/checkbox.js +12 -9
  35. package/dist/components/checkbox-field/checkbox.module.js +4 -4
  36. package/dist/components/checkbox-group-field/checkbox-group-field.js +78 -72
  37. package/dist/components/checkbox-group-field/checkbox-group.css +14 -10
  38. package/dist/components/checkbox-group-field/checkbox-group.d.ts +2 -2
  39. package/dist/components/checkbox-group-field/checkbox-group.js +2 -2
  40. package/dist/components/checkbox-group-field/checkbox-group.module.js +2 -2
  41. package/dist/components/collapsible/collapsible.css +20 -20
  42. package/dist/components/collapsible/collapsible.d.ts +17 -4
  43. package/dist/components/collapsible/collapsible.js +83 -36
  44. package/dist/components/collapsible/collapsible.module.js +5 -5
  45. package/dist/components/combobox-field/combobox-field.js +206 -158
  46. package/dist/components/combobox-field/combobox.css +492 -277
  47. package/dist/components/combobox-field/combobox.d.ts +148 -39
  48. package/dist/components/combobox-field/combobox.js +506 -206
  49. package/dist/components/combobox-field/combobox.module.js +21 -21
  50. package/dist/components/combobox-field/value-state-view.css +5 -5
  51. package/dist/components/combobox-field/value-state-view.module.js +4 -4
  52. package/dist/components/composer/composer-attachments.d.ts +30 -11
  53. package/dist/components/composer/composer-attachments.js +45 -40
  54. package/dist/components/composer/composer-editor.css +40 -35
  55. package/dist/components/composer/composer-editor.d.ts +14 -4
  56. package/dist/components/composer/composer-editor.js +134 -44
  57. package/dist/components/composer/composer-editor.module.js +5 -5
  58. package/dist/components/composer/composer.css +22 -22
  59. package/dist/components/composer/composer.d.ts +13 -2
  60. package/dist/components/composer/composer.js +78 -63
  61. package/dist/components/composer/composer.module.js +5 -5
  62. package/dist/components/composer/index.d.ts +2 -2
  63. package/dist/components/composer/mention-text.css +5 -5
  64. package/dist/components/composer/mention-text.module.js +1 -1
  65. package/dist/components/confirm-dialog/confirm-dialog.css +29 -29
  66. package/dist/components/confirm-dialog/confirm-dialog.d.ts +57 -3
  67. package/dist/components/confirm-dialog/confirm-dialog.js +266 -108
  68. package/dist/components/confirm-dialog/confirm-dialog.module.js +5 -5
  69. package/dist/components/conversation/conversation.css +52 -52
  70. package/dist/components/conversation/conversation.d.ts +43 -18
  71. package/dist/components/conversation/conversation.js +120 -78
  72. package/dist/components/conversation/conversation.module.js +15 -15
  73. package/dist/components/date-field/date-field.d.ts +1 -1
  74. package/dist/components/date-field/date-field.js +202 -100
  75. package/dist/components/date-field/date-input.d.ts +73 -37
  76. package/dist/components/date-field/date-input.js +72 -45
  77. package/dist/components/date-field/index.d.ts +1 -1
  78. package/dist/components/date-range-field/date-range-field.d.ts +1 -1
  79. package/dist/components/date-range-field/date-range-field.js +219 -107
  80. package/dist/components/date-range-field/date-range-input.d.ts +84 -40
  81. package/dist/components/date-range-field/date-range-input.js +83 -48
  82. package/dist/components/dialog/dialog.css +32 -32
  83. package/dist/components/dialog/dialog.d.ts +8 -7
  84. package/dist/components/dialog/dialog.js +8 -26
  85. package/dist/components/dialog/dialog.module.js +6 -6
  86. package/dist/components/divider/divider.css +6 -6
  87. package/dist/components/divider/divider.d.ts +36 -2
  88. package/dist/components/divider/divider.js +195 -29
  89. package/dist/components/divider/divider.module.js +3 -3
  90. package/dist/components/drawer/drawer.css +55 -56
  91. package/dist/components/drawer/drawer.d.ts +8 -7
  92. package/dist/components/drawer/drawer.js +8 -26
  93. package/dist/components/drawer/drawer.module.js +6 -6
  94. package/dist/components/field/field.css +34 -24
  95. package/dist/components/field/field.d.ts +60 -37
  96. package/dist/components/field/field.js +242 -157
  97. package/dist/components/field/field.module.js +12 -10
  98. package/dist/components/field/input-parts.d.ts +11 -13
  99. package/dist/components/field/input-parts.js +23 -42
  100. package/dist/components/field-placeholder/field-placeholder.css +6 -6
  101. package/dist/components/field-placeholder/field-placeholder.module.js +4 -4
  102. package/dist/components/fieldset/field-group.d.ts +1 -1
  103. package/dist/components/fieldset/field-group.js +48 -42
  104. package/dist/components/fieldset/fieldset-root.d.ts +1 -1
  105. package/dist/components/fieldset/fieldset-root.js +19 -17
  106. package/dist/components/fieldset/fieldset.d.ts +2 -2
  107. package/dist/components/fieldset/fieldset.js +2 -2
  108. package/dist/components/file-field/file-field.css +126 -60
  109. package/dist/components/file-field/file-field.js +201 -109
  110. package/dist/components/file-field/file-field.module.js +4 -4
  111. package/dist/components/file-field/file-input.d.ts +66 -40
  112. package/dist/components/file-field/file-input.js +188 -132
  113. package/dist/components/filter-bar/filter-bar.css +8 -8
  114. package/dist/components/filter-bar/filter-bar.d.ts +12 -3
  115. package/dist/components/filter-bar/filter-bar.js +23 -25
  116. package/dist/components/filter-bar/filter-bar.module.js +5 -5
  117. package/dist/components/form/form.d.ts +19 -7
  118. package/dist/components/form/form.js +80 -29
  119. package/dist/components/icon/icon.css +2 -2
  120. package/dist/components/icon/icon.module.js +1 -1
  121. package/dist/components/link/link.css +6 -5
  122. package/dist/components/link/link.module.js +1 -1
  123. package/dist/components/menu/menu.css +52 -47
  124. package/dist/components/menu/menu.d.ts +32 -25
  125. package/dist/components/menu/menu.js +75 -124
  126. package/dist/components/menu/menu.module.js +8 -8
  127. package/dist/components/nav/nav-context.d.ts +1 -1
  128. package/dist/components/nav/nav-item-view.d.ts +10 -13
  129. package/dist/components/nav/nav-item-view.js +42 -54
  130. package/dist/components/nav/nav.css +150 -119
  131. package/dist/components/nav/nav.d.ts +61 -17
  132. package/dist/components/nav/nav.js +271 -176
  133. package/dist/components/nav/nav.module.js +17 -15
  134. package/dist/components/number-field/number-field.css +153 -64
  135. package/dist/components/number-field/number-field.d.ts +2 -2
  136. package/dist/components/number-field/number-field.js +112 -91
  137. package/dist/components/number-field/number-field.module.js +6 -6
  138. package/dist/components/number-field/number-input.d.ts +43 -23
  139. package/dist/components/number-field/number-input.js +179 -125
  140. package/dist/components/otp-field/otp-field.css +153 -60
  141. package/dist/components/otp-field/otp-field.d.ts +2 -2
  142. package/dist/components/otp-field/otp-field.js +62 -46
  143. package/dist/components/otp-field/otp-field.module.js +4 -4
  144. package/dist/components/otp-field/otp-input.d.ts +8 -6
  145. package/dist/components/otp-field/otp-input.js +92 -92
  146. package/dist/components/pagination/pagination.d.ts +46 -15
  147. package/dist/components/pagination/pagination.js +217 -224
  148. package/dist/components/password-field/password-field.css +23 -23
  149. package/dist/components/password-field/password-field.js +107 -85
  150. package/dist/components/password-field/password-field.module.js +8 -8
  151. package/dist/components/password-field/password-strength.d.ts +107 -3
  152. package/dist/components/password-field/password-strength.js +569 -92
  153. package/dist/components/photo-field/photo-field.js +137 -112
  154. package/dist/components/photo-field/photo-input.css +67 -44
  155. package/dist/components/photo-field/photo-input.d.ts +59 -15
  156. package/dist/components/photo-field/photo-input.js +173 -86
  157. package/dist/components/photo-field/photo-input.module.js +10 -8
  158. package/dist/components/popover/popover.css +41 -41
  159. package/dist/components/popover/popover.d.ts +66 -25
  160. package/dist/components/popover/popover.js +332 -217
  161. package/dist/components/popover/popover.module.js +15 -19
  162. package/dist/components/radio-group-field/radio-group-field.js +80 -71
  163. package/dist/components/radio-group-field/radio-group.css +112 -60
  164. package/dist/components/radio-group-field/radio-group.d.ts +19 -3
  165. package/dist/components/radio-group-field/radio-group.js +66 -23
  166. package/dist/components/radio-group-field/radio-group.module.js +4 -4
  167. package/dist/components/segmented-control-field/segmented-control-field.d.ts +1 -1
  168. package/dist/components/segmented-control-field/segmented-control-field.js +111 -96
  169. package/dist/components/segmented-control-field/segmented-control.css +132 -79
  170. package/dist/components/segmented-control-field/segmented-control.d.ts +39 -15
  171. package/dist/components/segmented-control-field/segmented-control.js +124 -41
  172. package/dist/components/segmented-control-field/segmented-control.module.js +4 -4
  173. package/dist/components/select-field/select.css +214 -101
  174. package/dist/components/select-field/select.d.ts +43 -11
  175. package/dist/components/select-field/select.js +194 -109
  176. package/dist/components/select-field/select.module.js +14 -14
  177. package/dist/components/skeleton/skeleton.css +4 -4
  178. package/dist/components/skeleton/skeleton.module.js +3 -3
  179. package/dist/components/stale/stale.css +15 -15
  180. package/dist/components/stale/stale.d.ts +27 -3
  181. package/dist/components/stale/stale.js +147 -66
  182. package/dist/components/stale/stale.module.js +6 -6
  183. package/dist/components/status-message/status-message.css +22 -22
  184. package/dist/components/status-message/status-message.module.js +6 -6
  185. package/dist/components/switch-field/switch-field.js +77 -57
  186. package/dist/components/switch-field/switch.css +112 -63
  187. package/dist/components/switch-field/switch.d.ts +20 -3
  188. package/dist/components/switch-field/switch.js +70 -27
  189. package/dist/components/switch-field/switch.module.js +4 -4
  190. package/dist/components/tabs/tabs.css +32 -32
  191. package/dist/components/tabs/tabs.d.ts +21 -7
  192. package/dist/components/tabs/tabs.js +73 -14
  193. package/dist/components/tabs/tabs.module.js +7 -7
  194. package/dist/components/tag/tag.css +84 -84
  195. package/dist/components/tag/tag.module.js +3 -3
  196. package/dist/components/tag-group/tag-group.css +94 -94
  197. package/dist/components/tag-group/tag-group.module.js +4 -4
  198. package/dist/components/text-field/text-field.css +159 -82
  199. package/dist/components/text-field/text-field.d.ts +1 -1
  200. package/dist/components/text-field/text-field.js +139 -110
  201. package/dist/components/text-field/text-field.module.js +9 -9
  202. package/dist/components/text-field/text-input.d.ts +81 -45
  203. package/dist/components/text-field/text-input.js +366 -217
  204. package/dist/components/textarea-field/textarea-field.css +7 -2
  205. package/dist/components/textarea-field/textarea-field.js +72 -56
  206. package/dist/components/textarea-field/textarea-field.module.js +2 -2
  207. package/dist/components/time-field/time-field.js +153 -60
  208. package/dist/components/time-field/time-input.d.ts +21 -10
  209. package/dist/components/time-field/time-input.js +22 -11
  210. package/dist/components/toast/toast-provider.css +34 -31
  211. package/dist/components/toast/toast-provider.d.ts +63 -14
  212. package/dist/components/toast/toast-provider.js +174 -111
  213. package/dist/components/toast/toast-provider.module.js +7 -7
  214. package/dist/components/toggle-group-field/toggle-group-field.d.ts +1 -1
  215. package/dist/components/toggle-group-field/toggle-group-field.js +95 -89
  216. package/dist/components/toggle-group-field/toggle-group.css +117 -67
  217. package/dist/components/toggle-group-field/toggle-group.d.ts +2 -2
  218. package/dist/components/toggle-group-field/toggle-group.js +2 -2
  219. package/dist/components/toggle-group-field/toggle-group.module.js +2 -2
  220. package/dist/components/tooltip/tooltip.css +4 -4
  221. package/dist/components/tooltip/tooltip.module.js +1 -1
  222. package/dist/data-table/data-table-content.js +6 -5
  223. package/dist/data-table/data-table-parts.d.ts +41 -13
  224. package/dist/data-table/data-table-parts.js +213 -172
  225. package/dist/data-table/data-table-selection.d.ts +105 -3
  226. package/dist/data-table/data-table-selection.js +654 -145
  227. package/dist/data-table/data-table.css +125 -128
  228. package/dist/data-table/data-table.d.ts +21 -26
  229. package/dist/data-table/data-table.js +20 -23
  230. package/dist/data-table/data-table.module.js +32 -34
  231. package/dist/data-table/index.d.ts +2 -2
  232. package/dist/index.js +3 -3
  233. package/dist/lib/calendar/calendar-navigation.d.ts +39 -5
  234. package/dist/lib/calendar/calendar-navigation.js +185 -118
  235. package/dist/lib/calendar/calendar-parts.d.ts +143 -0
  236. package/dist/lib/calendar/calendar-parts.js +540 -0
  237. package/dist/lib/calendar/calendar-prefab.d.ts +52 -0
  238. package/dist/lib/calendar/calendar-prefab.js +311 -0
  239. package/dist/lib/calendar/calendar-year.d.ts +3 -1
  240. package/dist/lib/calendar/calendar-year.js +139 -131
  241. package/dist/lib/calendar/temporal.css +325 -232
  242. package/dist/lib/calendar/temporal.d.ts +67 -82
  243. package/dist/lib/calendar/temporal.js +258 -569
  244. package/dist/lib/calendar/temporal.module.js +38 -38
  245. package/dist/lib/forms/use-connected-field.d.ts +1 -1
  246. package/dist/lib/forms/use-connected-field.js +1 -1
  247. package/dist/lib/render-as.d.ts +13 -0
  248. package/dist/lib/render-as.js +46 -0
  249. package/dist/tokens.css +6 -3
  250. package/package.json +1 -1
  251. package/tokens/dark.tokens.json +6 -0
  252. package/tokens/sys.tokens.json +7 -0
  253. package/dist/components/button/close-button.d.ts +0 -16
  254. package/dist/components/button/close-button.js +0 -30
@@ -1,5 +1,4 @@
1
1
  import { lengthTone } from "../../lib/text-length.js";
2
- import { Button } from "../button/button.js";
3
2
  import { Field } from "../field/field.js";
4
3
  import { fieldStateAttributes } from "../field/field-state.js";
5
4
  import { useFieldFocus, withFieldFocus } from "../field/use-field-focus.js";
@@ -9,6 +8,7 @@ import { focusControlOnRim } from "../field/rim-focus.js";
9
8
  import { TextInputContext, useTextInputContext } from "./text-input-context.js";
10
9
  import text_field_module_default from "./text-field.module.js";
11
10
  import { c } from "react/compiler-runtime";
11
+ import { useRender } from "@base-ui/react/use-render";
12
12
  import { clsx } from "clsx";
13
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useRef, useState } from "react";
@@ -20,11 +20,11 @@ var COPIED_FEEDBACK_MS = 2e3;
20
20
  * state onto every part.
21
21
  *
22
22
  * @example
23
- * <TextInput.Root value={value} onValueChange={setValue} optionalLabel="optional">…</TextInput.Root>
23
+ * <TextInput.Root value={value} onValueChange={setValue}>…</TextInput.Root>
24
24
  */
25
25
  var TextInputRoot = (t0) => {
26
26
  const $ = c(41);
27
- const { value, onValueChange, disabled, readOnly, requiredness, optionalLabel, errors, dirty, touched, pending: t1, maxLength, state, className, children } = t0;
27
+ const { value, onValueChange, disabled, readOnly, requiredness, errors, dirty, touched, pending: t1, maxLength, state, className, children } = t0;
28
28
  const pending = t1 === void 0 ? false : t1;
29
29
  const controlRef = useRef(null);
30
30
  const t2 = value !== "";
@@ -54,23 +54,21 @@ var TextInputRoot = (t0) => {
54
54
  } else t3 = $[9];
55
55
  const field = useFieldState(t3);
56
56
  let t4;
57
- if ($[10] !== errors || $[11] !== field.phase || $[12] !== field.state || $[13] !== optionalLabel) {
57
+ if ($[10] !== errors || $[11] !== field.phase || $[12] !== field.state) {
58
58
  t4 = {
59
59
  state: field.state,
60
60
  errors,
61
- optionalLabel,
62
61
  phase: field.phase
63
62
  };
64
63
  $[10] = errors;
65
64
  $[11] = field.phase;
66
65
  $[12] = field.state;
67
- $[13] = optionalLabel;
68
- $[14] = t4;
69
- } else t4 = $[14];
66
+ $[13] = t4;
67
+ } else t4 = $[13];
70
68
  let t5;
71
69
  let t6;
72
70
  let t7;
73
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
71
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
74
72
  t5 = (control) => {
75
73
  controlRef.current = control;
76
74
  };
@@ -79,16 +77,16 @@ var TextInputRoot = (t0) => {
79
77
  controlRef.current?.focus();
80
78
  controlRef.current?.select();
81
79
  };
82
- $[15] = t5;
83
- $[16] = t6;
84
- $[17] = t7;
80
+ $[14] = t5;
81
+ $[15] = t6;
82
+ $[16] = t7;
85
83
  } else {
86
- t5 = $[15];
87
- t6 = $[16];
88
- t7 = $[17];
84
+ t5 = $[14];
85
+ t6 = $[15];
86
+ t7 = $[16];
89
87
  }
90
88
  let t8;
91
- if ($[18] !== field.state || $[19] !== maxLength || $[20] !== onValueChange || $[21] !== value) {
89
+ if ($[17] !== field.state || $[18] !== maxLength || $[19] !== onValueChange || $[20] !== value) {
92
90
  t8 = {
93
91
  state: field.state,
94
92
  value,
@@ -98,67 +96,70 @@ var TextInputRoot = (t0) => {
98
96
  selectControl: t7,
99
97
  maxLength
100
98
  };
101
- $[18] = field.state;
102
- $[19] = maxLength;
103
- $[20] = onValueChange;
104
- $[21] = value;
105
- $[22] = t8;
106
- } else t8 = $[22];
99
+ $[17] = field.state;
100
+ $[18] = maxLength;
101
+ $[19] = onValueChange;
102
+ $[20] = value;
103
+ $[21] = t8;
104
+ } else t8 = $[21];
107
105
  const t9 = field.disabled;
108
106
  const t10 = field.invalid;
109
- let t11;
110
- if ($[23] !== className) {
111
- t11 = clsx(text_field_module_default.root, className);
112
- $[23] = className;
113
- $[24] = t11;
114
- } else t11 = $[24];
107
+ const t11 = field.state.requiredness;
115
108
  let t12;
116
- if ($[25] !== field.state) {
117
- t12 = fieldStateAttributes(field.state);
118
- $[25] = field.state;
119
- $[26] = t12;
120
- } else t12 = $[26];
109
+ if ($[22] !== className) {
110
+ t12 = clsx(text_field_module_default.root, className);
111
+ $[22] = className;
112
+ $[23] = t12;
113
+ } else t12 = $[23];
121
114
  let t13;
122
- if ($[27] !== children || $[28] !== dirty || $[29] !== field.disabled || $[30] !== field.invalid || $[31] !== t11 || $[32] !== t12 || $[33] !== touched) {
123
- t13 = /* @__PURE__ */ jsx(Field.Root, {
115
+ if ($[24] !== field.state) {
116
+ t13 = fieldStateAttributes(field.state);
117
+ $[24] = field.state;
118
+ $[25] = t13;
119
+ } else t13 = $[25];
120
+ let t14;
121
+ if ($[26] !== children || $[27] !== dirty || $[28] !== field.disabled || $[29] !== field.invalid || $[30] !== field.state.requiredness || $[31] !== t12 || $[32] !== t13 || $[33] !== touched) {
122
+ t14 = /* @__PURE__ */ jsx(Field.Root, {
124
123
  disabled: t9,
125
124
  invalid: t10,
125
+ requiredness: t11,
126
126
  dirty,
127
127
  touched,
128
- className: t11,
129
- ...t12,
128
+ className: t12,
129
+ ...t13,
130
130
  children
131
131
  });
132
- $[27] = children;
133
- $[28] = dirty;
134
- $[29] = field.disabled;
135
- $[30] = field.invalid;
136
- $[31] = t11;
137
- $[32] = t12;
132
+ $[26] = children;
133
+ $[27] = dirty;
134
+ $[28] = field.disabled;
135
+ $[29] = field.invalid;
136
+ $[30] = field.state.requiredness;
137
+ $[31] = t12;
138
+ $[32] = t13;
138
139
  $[33] = touched;
139
- $[34] = t13;
140
- } else t13 = $[34];
141
- let t14;
142
- if ($[35] !== t13 || $[36] !== t8) {
143
- t14 = /* @__PURE__ */ jsx(TextInputContext, {
140
+ $[34] = t14;
141
+ } else t14 = $[34];
142
+ let t15;
143
+ if ($[35] !== t14 || $[36] !== t8) {
144
+ t15 = /* @__PURE__ */ jsx(TextInputContext, {
144
145
  value: t8,
145
- children: t13
146
+ children: t14
146
147
  });
147
- $[35] = t13;
148
+ $[35] = t14;
148
149
  $[36] = t8;
149
- $[37] = t14;
150
- } else t14 = $[37];
151
- let t15;
152
- if ($[38] !== t14 || $[39] !== t4) {
153
- t15 = /* @__PURE__ */ jsx(InputPartsContext, {
150
+ $[37] = t15;
151
+ } else t15 = $[37];
152
+ let t16;
153
+ if ($[38] !== t15 || $[39] !== t4) {
154
+ t16 = /* @__PURE__ */ jsx(InputPartsContext, {
154
155
  value: t4,
155
- children: t14
156
+ children: t15
156
157
  });
157
- $[38] = t14;
158
+ $[38] = t15;
158
159
  $[39] = t4;
159
- $[40] = t15;
160
- } else t15 = $[40];
161
- return t15;
160
+ $[40] = t16;
161
+ } else t16 = $[40];
162
+ return t16;
162
163
  };
163
164
  /**
164
165
  * The bordered box holding the control and its inlays.
@@ -396,50 +397,129 @@ var TextInputInput = (t0) => {
396
397
  return t7;
397
398
  };
398
399
  /**
399
- * The icon-only button that empties the control, shown once it holds a value.
400
+ * The button that empties the control, shown once it holds a value. It renders
401
+ * whichever button it is given.
400
402
  *
401
403
  * @example
402
- * <TextInput.Clear label="Clear"><CloseIcon /></TextInput.Clear>
404
+ * <TextInput.Clear render={<IconButton label="Clear" variant="tertiary" size="sm"><CloseIcon /></IconButton>} />
403
405
  */
404
406
  var TextInputClear = (t0) => {
405
- const $ = c(10);
406
- const { label, className, children } = t0;
407
+ const $ = c(17);
408
+ let className;
409
+ let props;
410
+ let render;
411
+ if ($[0] !== t0) {
412
+ ({render, className, ...props} = t0);
413
+ $[0] = t0;
414
+ $[1] = className;
415
+ $[2] = props;
416
+ $[3] = render;
417
+ } else {
418
+ className = $[1];
419
+ props = $[2];
420
+ render = $[3];
421
+ }
407
422
  const { value, setValue, state, focusControl } = useTextInputContext();
408
- if (value === "" || state.disabled === true || state.readonly === true) return null;
409
- let t1;
410
- if ($[0] !== className) {
411
- t1 = clsx(text_field_module_default.action, className);
412
- $[0] = className;
413
- $[1] = t1;
414
- } else t1 = $[1];
423
+ const t1 = value !== "" && state.disabled !== true && state.readonly !== true;
415
424
  let t2;
416
- if ($[2] !== focusControl || $[3] !== setValue) {
417
- t2 = () => {
425
+ if ($[4] !== className) {
426
+ t2 = clsx(text_field_module_default.action, className);
427
+ $[4] = className;
428
+ $[5] = t2;
429
+ } else t2 = $[5];
430
+ let t3;
431
+ if ($[6] !== focusControl || $[7] !== setValue) {
432
+ t3 = () => {
418
433
  setValue("");
419
434
  focusControl();
420
435
  };
421
- $[2] = focusControl;
422
- $[3] = setValue;
423
- $[4] = t2;
424
- } else t2 = $[4];
436
+ $[6] = focusControl;
437
+ $[7] = setValue;
438
+ $[8] = t3;
439
+ } else t3 = $[8];
440
+ let t4;
441
+ if ($[9] !== props || $[10] !== t2 || $[11] !== t3) {
442
+ t4 = {
443
+ ...props,
444
+ type: "button",
445
+ className: t2,
446
+ onClick: t3
447
+ };
448
+ $[9] = props;
449
+ $[10] = t2;
450
+ $[11] = t3;
451
+ $[12] = t4;
452
+ } else t4 = $[12];
453
+ let t5;
454
+ if ($[13] !== render || $[14] !== t1 || $[15] !== t4) {
455
+ t5 = {
456
+ render,
457
+ enabled: t1,
458
+ props: t4
459
+ };
460
+ $[13] = render;
461
+ $[14] = t1;
462
+ $[15] = t4;
463
+ $[16] = t5;
464
+ } else t5 = $[16];
465
+ return useRender(t5);
466
+ };
467
+ /**
468
+ * Any button inside the group, in the place an inlay that acts takes, such as
469
+ * a search field's trailing "Search" button. It renders whichever button it is
470
+ * given, disabled while the field is.
471
+ *
472
+ * @example
473
+ * <TextInput.Action render={<Button variant="tertiary" size="sm" type="submit">Search</Button>} />
474
+ */
475
+ var TextInputAction = (t0) => {
476
+ const $ = c(13);
477
+ let className;
478
+ let props;
479
+ let render;
480
+ if ($[0] !== t0) {
481
+ ({render, className, ...props} = t0);
482
+ $[0] = t0;
483
+ $[1] = className;
484
+ $[2] = props;
485
+ $[3] = render;
486
+ } else {
487
+ className = $[1];
488
+ props = $[2];
489
+ render = $[3];
490
+ }
491
+ const { state } = useTextInputContext();
492
+ const t1 = state.disabled;
493
+ let t2;
494
+ if ($[4] !== className) {
495
+ t2 = clsx(text_field_module_default.action, className);
496
+ $[4] = className;
497
+ $[5] = t2;
498
+ } else t2 = $[5];
425
499
  let t3;
426
- if ($[5] !== children || $[6] !== label || $[7] !== t1 || $[8] !== t2) {
427
- t3 = /* @__PURE__ */ jsx(Button, {
428
- iconOnly: true,
429
- icon: children,
430
- label,
431
- variant: "tertiary",
432
- size: "sm",
433
- className: t1,
434
- onClick: t2
435
- });
436
- $[5] = children;
437
- $[6] = label;
438
- $[7] = t1;
500
+ if ($[6] !== props || $[7] !== state.disabled || $[8] !== t2) {
501
+ t3 = {
502
+ type: "button",
503
+ disabled: t1,
504
+ ...props,
505
+ className: t2
506
+ };
507
+ $[6] = props;
508
+ $[7] = state.disabled;
439
509
  $[8] = t2;
440
510
  $[9] = t3;
441
511
  } else t3 = $[9];
442
- return t3;
512
+ let t4;
513
+ if ($[10] !== render || $[11] !== t3) {
514
+ t4 = {
515
+ render,
516
+ props: t3
517
+ };
518
+ $[10] = render;
519
+ $[11] = t3;
520
+ $[12] = t4;
521
+ } else t4 = $[12];
522
+ return useRender(t4);
443
523
  };
444
524
  /**
445
525
  * Writes text to the clipboard, rejecting where there is no clipboard as well
@@ -450,66 +530,70 @@ var TextInputClear = (t0) => {
450
530
  */
451
531
  var writeClipboard = async (text) => navigator.clipboard.writeText(text);
452
532
  /**
453
- * The icon-only button that copies the value to the clipboard, shown once it
454
- * holds one, and announces whether the copy landed.
533
+ * The button that copies the value to the clipboard, shown once it holds one,
534
+ * and announces whether the copy landed. It renders whichever button it is
535
+ * given, and a render function can follow the outcome.
455
536
  *
456
537
  * @example
457
- * <TextInput.Copy label="Copy" copiedLabel="Copied" failedLabel="Copy failed, text selected"><CopyIcon /></TextInput.Copy>
538
+ * <TextInput.Copy
539
+ * copiedLabel="Copied"
540
+ * failedLabel="Copy failed, text selected"
541
+ * render={(props, { outcome }) => (
542
+ * <IconButton {...props} label="Copy" variant="tertiary" size="sm">
543
+ * {outcome === "copied" ? <CheckIcon /> : <CopyIcon />}
544
+ * </IconButton>
545
+ * )}
546
+ * />
458
547
  */
459
548
  var TextInputCopy = (t0) => {
460
- const $ = c(25);
461
- const { label, copiedLabel, failedLabel, copiedIcon, failedIcon, className, children } = t0;
549
+ const $ = c(31);
550
+ let className;
551
+ let copiedLabel;
552
+ let failedLabel;
553
+ let props;
554
+ let render;
555
+ if ($[0] !== t0) {
556
+ ({copiedLabel, failedLabel, render, className, ...props} = t0);
557
+ $[0] = t0;
558
+ $[1] = className;
559
+ $[2] = copiedLabel;
560
+ $[3] = failedLabel;
561
+ $[4] = props;
562
+ $[5] = render;
563
+ } else {
564
+ className = $[1];
565
+ copiedLabel = $[2];
566
+ failedLabel = $[3];
567
+ props = $[4];
568
+ render = $[5];
569
+ }
462
570
  const { value, state, selectControl } = useTextInputContext();
463
571
  const [outcome, setOutcome] = useState("idle");
464
- if (value === "" || state.disabled === true) return null;
572
+ const shown = value !== "" && state.disabled !== true;
465
573
  let t1;
466
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
574
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
467
575
  t1 = (next) => {
468
576
  setOutcome(next);
469
577
  setTimeout(() => setOutcome("idle"), COPIED_FEEDBACK_MS);
470
578
  };
471
- $[0] = t1;
472
- } else t1 = $[0];
579
+ $[6] = t1;
580
+ } else t1 = $[6];
473
581
  const settle = t1;
474
582
  let t2;
475
- if ($[1] !== copiedLabel || $[2] !== failedLabel || $[3] !== label) {
476
- t2 = {
477
- idle: label,
478
- copied: copiedLabel,
479
- failed: failedLabel
480
- };
481
- $[1] = copiedLabel;
482
- $[2] = failedLabel;
483
- $[3] = label;
484
- $[4] = t2;
485
- } else t2 = $[4];
486
- const labels = t2;
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;
583
+ if ($[7] !== outcome) {
584
+ t2 = { outcome };
585
+ $[7] = outcome;
586
+ $[8] = t2;
587
+ } else t2 = $[8];
588
+ let t3;
505
589
  if ($[9] !== className) {
506
- t9 = clsx(text_field_module_default.action, className);
590
+ t3 = clsx(text_field_module_default.action, className);
507
591
  $[9] = className;
508
- $[10] = t9;
509
- } else t9 = $[10];
510
- let t10;
592
+ $[10] = t3;
593
+ } else t3 = $[10];
594
+ let t4;
511
595
  if ($[11] !== selectControl || $[12] !== value) {
512
- t10 = () => {
596
+ t4 = () => {
513
597
  writeClipboard(value).then(() => settle("copied"), () => {
514
598
  selectControl();
515
599
  settle("failed");
@@ -517,94 +601,153 @@ var TextInputCopy = (t0) => {
517
601
  };
518
602
  $[11] = selectControl;
519
603
  $[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, {
525
- iconOnly: true,
526
- icon: t6,
527
- label: t7,
528
- tone: t8,
529
- variant: "tertiary",
530
- size: "sm",
531
- className: t9,
532
- onClick: t10
533
- });
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", {
604
+ $[13] = t4;
605
+ } else t4 = $[13];
606
+ let t5;
607
+ if ($[14] !== props || $[15] !== t3 || $[16] !== t4) {
608
+ t5 = {
609
+ ...props,
610
+ type: "button",
611
+ className: t3,
612
+ onClick: t4
613
+ };
614
+ $[14] = props;
615
+ $[15] = t3;
616
+ $[16] = t4;
617
+ $[17] = t5;
618
+ } else t5 = $[17];
619
+ let t6;
620
+ if ($[18] !== render || $[19] !== shown || $[20] !== t2 || $[21] !== t5) {
621
+ t6 = {
622
+ render,
623
+ enabled: shown,
624
+ state: t2,
625
+ props: t5
626
+ };
627
+ $[18] = render;
628
+ $[19] = shown;
629
+ $[20] = t2;
630
+ $[21] = t5;
631
+ $[22] = t6;
632
+ } else t6 = $[22];
633
+ const button = useRender(t6);
634
+ if (!shown) return null;
635
+ let t7;
636
+ if ($[23] !== copiedLabel || $[24] !== failedLabel) {
637
+ t7 = {
638
+ idle: "",
639
+ copied: copiedLabel,
640
+ failed: failedLabel
641
+ };
642
+ $[23] = copiedLabel;
643
+ $[24] = failedLabel;
644
+ $[25] = t7;
645
+ } else t7 = $[25];
646
+ const t8 = t7[outcome];
647
+ let t9;
648
+ if ($[26] !== t8) {
649
+ t9 = /* @__PURE__ */ jsx("span", {
545
650
  role: "status",
546
651
  className: text_field_module_default.copyStatus,
547
- children: t12
652
+ children: t8
548
653
  });
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;
654
+ $[26] = t8;
655
+ $[27] = t9;
656
+ } else t9 = $[27];
657
+ let t10;
658
+ if ($[28] !== button || $[29] !== t9) {
659
+ t10 = /* @__PURE__ */ jsxs(Fragment, { children: [button, t9] });
660
+ $[28] = button;
661
+ $[29] = t9;
662
+ $[30] = t10;
663
+ } else t10 = $[30];
664
+ return t10;
560
665
  };
561
666
  /**
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`.
667
+ * The toggle that shows a concealed value, such as a password, as text. The
668
+ * caller switches the `Input`'s `type` with `revealed`, and names the button for
669
+ * what a press will do.
564
670
  *
565
671
  * @example
566
- * <TextInput.Reveal revealed={revealed} onRevealedChange={setRevealed} label="Show password"><VisibilityIcon /></TextInput.Reveal>
672
+ * <TextInput.Reveal
673
+ * revealed={revealed}
674
+ * onRevealedChange={setRevealed}
675
+ * render={
676
+ * <Button variant="tertiary" size="sm">{revealed ? "Hide" : "Show"}</Button>
677
+ * }
678
+ * />
567
679
  */
568
680
  var TextInputReveal = (t0) => {
569
- const $ = c(12);
570
- const { revealed, onRevealedChange, label, className, children } = t0;
681
+ const $ = c(22);
682
+ let className;
683
+ let onRevealedChange;
684
+ let props;
685
+ let render;
686
+ let revealed;
687
+ if ($[0] !== t0) {
688
+ ({revealed, onRevealedChange, render, className, ...props} = t0);
689
+ $[0] = t0;
690
+ $[1] = className;
691
+ $[2] = onRevealedChange;
692
+ $[3] = props;
693
+ $[4] = render;
694
+ $[5] = revealed;
695
+ } else {
696
+ className = $[1];
697
+ onRevealedChange = $[2];
698
+ props = $[3];
699
+ render = $[4];
700
+ revealed = $[5];
701
+ }
571
702
  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];
703
+ let t1;
704
+ if ($[6] !== revealed) {
705
+ t1 = { revealed };
706
+ $[6] = revealed;
707
+ $[7] = t1;
708
+ } else t1 = $[7];
709
+ const t2 = state.disabled;
579
710
  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];
711
+ if ($[8] !== className) {
712
+ t3 = clsx(text_field_module_default.action, className);
713
+ $[8] = className;
714
+ $[9] = t3;
715
+ } else t3 = $[9];
586
716
  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;
717
+ if ($[10] !== onRevealedChange || $[11] !== revealed) {
718
+ t4 = () => onRevealedChange(!revealed);
719
+ $[10] = onRevealedChange;
720
+ $[11] = revealed;
721
+ $[12] = t4;
722
+ } else t4 = $[12];
723
+ let t5;
724
+ if ($[13] !== props || $[14] !== state.disabled || $[15] !== t3 || $[16] !== t4) {
725
+ t5 = {
726
+ ...props,
727
+ type: "button",
728
+ disabled: t2,
729
+ className: t3,
730
+ onClick: t4
731
+ };
732
+ $[13] = props;
733
+ $[14] = state.disabled;
734
+ $[15] = t3;
735
+ $[16] = t4;
736
+ $[17] = t5;
737
+ } else t5 = $[17];
738
+ let t6;
739
+ if ($[18] !== render || $[19] !== t1 || $[20] !== t5) {
740
+ t6 = {
741
+ render,
742
+ state: t1,
743
+ props: t5
744
+ };
745
+ $[18] = render;
746
+ $[19] = t1;
747
+ $[20] = t5;
748
+ $[21] = t6;
749
+ } else t6 = $[21];
750
+ return useRender(t6);
608
751
  };
609
752
  /**
610
753
  * The value's length against `Root`'s `maxLength`, toned as it nears the limit.
@@ -666,19 +809,24 @@ var TextInputCounter = (t0) => {
666
809
  /**
667
810
  * The parts of a text input: the field frame, a group carrying the border and
668
811
  * its inlays, and the bare control inside it. A `Bar` is a strip of inlays along
669
- * the bottom edge of the group, for a control the inlays cannot sit beside. For
812
+ * the bottom edge of the group, for a control the inlays cannot sit beside, and
813
+ * an `Action` is any button placed in the group. For
670
814
  * the ordinary case, use the `TextField` shorthand, which is assembled from
671
815
  * exactly these parts. An `Affix` is decoration, so its meaning belongs in the
672
816
  * label or description too. `Error` renders the errors `Root` was given.
673
817
  *
674
818
  * @example
675
- * <TextInput.Root value={value} onValueChange={setValue} errors={errors} optionalLabel="optional">
676
- * <TextInput.Label>Email</TextInput.Label>
819
+ * <TextInput.Root value={value} onValueChange={setValue} errors={errors} requiredness="optional">
820
+ * <TextInput.Label>Email <Field.Requiredness optionalLabel="optional" /></TextInput.Label>
677
821
  * <TextInput.Group>
678
822
  * <TextInput.Input type="email" />
679
- * <TextInput.Clear label="Clear">
680
- * <CloseIcon />
681
- * </TextInput.Clear>
823
+ * <TextInput.Clear
824
+ * render={
825
+ * <IconButton label="Clear" variant="tertiary" size="sm">
826
+ * <CloseIcon />
827
+ * </IconButton>
828
+ * }
829
+ * />
682
830
  * </TextInput.Group>
683
831
  * <TextInput.Error />
684
832
  * </TextInput.Root>
@@ -691,6 +839,7 @@ var TextInput = {
691
839
  Inlay: TextInputInlay,
692
840
  Affix: TextInputAffix,
693
841
  Input: TextInputInput,
842
+ Action: TextInputAction,
694
843
  Clear: TextInputClear,
695
844
  Copy: TextInputCopy,
696
845
  Reveal: TextInputReveal,