@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,4 +1,6 @@
1
+ import { Field } from "../field/field.js";
1
2
  import { OtpInput } from "./otp-input.js";
3
+ import { Spinner } from "../spinner/spinner.js";
2
4
  import { c } from "react/compiler-runtime";
3
5
  import { jsx, jsxs } from "react/jsx-runtime";
4
6
  // src/components/otp-field/otp-field.tsx
@@ -17,75 +19,89 @@ import { jsx, jsxs } from "react/jsx-runtime";
17
19
  * />
18
20
  */
19
21
  var OtpField = (t0) => {
20
- const $ = c(20);
22
+ const $ = c(24);
21
23
  let description;
22
24
  let label;
25
+ let optionalLabel;
23
26
  let rootProps;
24
27
  let slotLabel;
25
28
  if ($[0] !== t0) {
26
- ({label, description, slotLabel, ...rootProps} = t0);
29
+ ({label, description, slotLabel, optionalLabel, ...rootProps} = t0);
27
30
  $[0] = t0;
28
31
  $[1] = description;
29
32
  $[2] = label;
30
- $[3] = rootProps;
31
- $[4] = slotLabel;
33
+ $[3] = optionalLabel;
34
+ $[4] = rootProps;
35
+ $[5] = slotLabel;
32
36
  } else {
33
37
  description = $[1];
34
38
  label = $[2];
35
- rootProps = $[3];
36
- slotLabel = $[4];
39
+ optionalLabel = $[3];
40
+ rootProps = $[4];
41
+ slotLabel = $[5];
37
42
  }
38
43
  let t1;
39
- if ($[5] !== label) {
40
- t1 = /* @__PURE__ */ jsx(OtpInput.Label, { children: label });
41
- $[5] = label;
42
- $[6] = t1;
43
- } else t1 = $[6];
44
+ if ($[6] !== optionalLabel) {
45
+ t1 = /* @__PURE__ */ jsx(Field.Requiredness, { optionalLabel });
46
+ $[6] = optionalLabel;
47
+ $[7] = t1;
48
+ } else t1 = $[7];
44
49
  let t2;
45
- if ($[7] !== slotLabel) {
46
- t2 = /* @__PURE__ */ jsx(OtpInput.Slots, { slotLabel });
47
- $[7] = slotLabel;
48
- $[8] = t2;
49
- } else t2 = $[8];
50
+ if ($[8] !== label || $[9] !== t1) {
51
+ t2 = /* @__PURE__ */ jsxs(OtpInput.Label, { children: [
52
+ label,
53
+ " ",
54
+ t1
55
+ ] });
56
+ $[8] = label;
57
+ $[9] = t1;
58
+ $[10] = t2;
59
+ } else t2 = $[10];
50
60
  let t3;
51
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
52
- t3 = /* @__PURE__ */ jsx(OtpInput.Pending, {});
53
- $[9] = t3;
54
- } else t3 = $[9];
61
+ if ($[11] !== slotLabel) {
62
+ t3 = /* @__PURE__ */ jsx(OtpInput.Slots, { slotLabel });
63
+ $[11] = slotLabel;
64
+ $[12] = t3;
65
+ } else t3 = $[12];
55
66
  let t4;
56
- if ($[10] !== t2) {
57
- t4 = /* @__PURE__ */ jsxs(OtpInput.Group, { children: [t2, t3] });
58
- $[10] = t2;
59
- $[11] = t4;
60
- } else t4 = $[11];
67
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
68
+ t4 = /* @__PURE__ */ jsx(OtpInput.Pending, { children: /* @__PURE__ */ jsx(Spinner, { size: 1 }) });
69
+ $[13] = t4;
70
+ } else t4 = $[13];
61
71
  let t5;
62
- if ($[12] !== description) {
63
- t5 = /* @__PURE__ */ jsx(OtpInput.Description, { children: description });
64
- $[12] = description;
65
- $[13] = t5;
66
- } else t5 = $[13];
72
+ if ($[14] !== t3) {
73
+ t5 = /* @__PURE__ */ jsxs(OtpInput.Group, { children: [t3, t4] });
74
+ $[14] = t3;
75
+ $[15] = t5;
76
+ } else t5 = $[15];
67
77
  let t6;
68
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
69
- t6 = /* @__PURE__ */ jsx(OtpInput.Error, {});
70
- $[14] = t6;
71
- } else t6 = $[14];
78
+ if ($[16] !== description) {
79
+ t6 = /* @__PURE__ */ jsx(OtpInput.Description, { children: description });
80
+ $[16] = description;
81
+ $[17] = t6;
82
+ } else t6 = $[17];
72
83
  let t7;
73
- if ($[15] !== rootProps || $[16] !== t1 || $[17] !== t4 || $[18] !== t5) {
74
- t7 = /* @__PURE__ */ jsxs(OtpInput.Root, {
84
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
85
+ t7 = /* @__PURE__ */ jsx(OtpInput.Error, {});
86
+ $[18] = t7;
87
+ } else t7 = $[18];
88
+ let t8;
89
+ if ($[19] !== rootProps || $[20] !== t2 || $[21] !== t5 || $[22] !== t6) {
90
+ t8 = /* @__PURE__ */ jsxs(OtpInput.Root, {
75
91
  ...rootProps,
76
92
  children: [
77
- t1,
78
- t4,
93
+ t2,
79
94
  t5,
80
- t6
95
+ t6,
96
+ t7
81
97
  ]
82
98
  });
83
- $[15] = rootProps;
84
- $[16] = t1;
85
- $[17] = t4;
86
- $[18] = t5;
87
- $[19] = t7;
88
- } else t7 = $[19];
89
- return t7;
99
+ $[19] = rootProps;
100
+ $[20] = t2;
101
+ $[21] = t5;
102
+ $[22] = t6;
103
+ $[23] = t8;
104
+ } else t8 = $[23];
105
+ return t8;
90
106
  };
91
107
  export { OtpField };
@@ -1,8 +1,8 @@
1
1
  import './otp-field.css';// src/components/otp-field/otp-field.module.scss
2
- var root = "_root_8k2z3_3";
3
- var group = "_group_8k2z3_6";
4
- var slot = "_slot_8k2z3_12";
5
- var separator = "_separator_8k2z3_92";
2
+ var root = "_root_1dlq9_3";
3
+ var group = "_group_1dlq9_6";
4
+ var slot = "_slot_1dlq9_12";
5
+ var separator = "_separator_1dlq9_185";
6
6
  var otp_field_module_default = {
7
7
  root,
8
8
  group,
@@ -4,7 +4,7 @@ import { Field, type FieldProps, type FieldState } from "../field/index.ts";
4
4
  import { InputError, type InputErrorProps, InputLabel, type InputLabelProps, InputPending, type InputPendingProps } from "../field/input-parts.tsx";
5
5
  import { type OtpInputBaseProps } from "./otp-input-context.ts";
6
6
  export type { OtpInputBaseProps };
7
- export type OtpInputRootProps = Omit<FieldProps, "label" | "description"> & OtpInputBaseProps & Readonly<{
7
+ export type OtpInputRootProps = Omit<FieldProps, "label" | "description" | "optionalLabel"> & OtpInputBaseProps & Readonly<{
8
8
  value: string;
9
9
  onValueChange: (value: string) => void;
10
10
  /** Number of character slots. @default 6 */
@@ -19,9 +19,9 @@ export type OtpInputRootProps = Omit<FieldProps, "label" | "description"> & OtpI
19
19
  * projecting its state onto every part.
20
20
  *
21
21
  * @example
22
- * <OtpInput.Root value={code} onValueChange={setCode} optionalLabel="optional">…</OtpInput.Root>
22
+ * <OtpInput.Root value={code} onValueChange={setCode}>…</OtpInput.Root>
23
23
  */
24
- declare const OtpInputRoot: ({ length, requiredness, optionalLabel, errors, dirty, touched, pending, state, className, children, ...base }: OtpInputRootProps) => ReactNode;
24
+ declare const OtpInputRoot: ({ length, requiredness, errors, dirty, touched, pending, state, className, children, ...base }: OtpInputRootProps) => ReactNode;
25
25
  export type OtpInputLabelProps = InputLabelProps;
26
26
  export type OtpInputGroupProps = Omit<BaseOTPField.Root.Props, keyof OtpInputBaseProps | "className" | "value" | "defaultValue" | "onValueChange" | "length"> & Readonly<{
27
27
  className?: string;
@@ -89,11 +89,13 @@ export type OtpInputParts = Readonly<{
89
89
  * given.
90
90
  *
91
91
  * @example
92
- * <OtpInput.Root value={code} onValueChange={setCode} optionalLabel="optional">
93
- * <OtpInput.Label>Verification code</OtpInput.Label>
92
+ * <OtpInput.Root value={code} onValueChange={setCode} requiredness="optional">
93
+ * <OtpInput.Label>Verification code <Field.Requiredness optionalLabel="optional" /></OtpInput.Label>
94
94
  * <OtpInput.Group>
95
95
  * <OtpInput.Slots slotLabel={(index, total) => `character ${index} of ${total}`} />
96
- * <OtpInput.Pending />
96
+ * <OtpInput.Pending>
97
+ * <Spinner size={1} />
98
+ * </OtpInput.Pending>
97
99
  * </OtpInput.Group>
98
100
  * <OtpInput.Error />
99
101
  * </OtpInput.Root>
@@ -16,53 +16,50 @@ var DEFAULT_LENGTH = 6;
16
16
  * projecting its state onto every part.
17
17
  *
18
18
  * @example
19
- * <OtpInput.Root value={code} onValueChange={setCode} optionalLabel="optional">…</OtpInput.Root>
19
+ * <OtpInput.Root value={code} onValueChange={setCode}>…</OtpInput.Root>
20
20
  */
21
21
  var OtpInputRoot = (t0) => {
22
- const $ = c(53);
22
+ const $ = c(52);
23
23
  let base;
24
24
  let children;
25
25
  let className;
26
26
  let dirty;
27
27
  let errors;
28
- let optionalLabel;
29
28
  let requiredness;
30
29
  let state;
31
30
  let t1;
32
31
  let t2;
33
32
  let touched;
34
33
  if ($[0] !== t0) {
35
- ({length: t1, requiredness, optionalLabel, errors, dirty, touched, pending: t2, state, className, children, ...base} = t0);
34
+ ({length: t1, requiredness, errors, dirty, touched, pending: t2, state, className, children, ...base} = t0);
36
35
  $[0] = t0;
37
36
  $[1] = base;
38
37
  $[2] = children;
39
38
  $[3] = className;
40
39
  $[4] = dirty;
41
40
  $[5] = errors;
42
- $[6] = optionalLabel;
43
- $[7] = requiredness;
44
- $[8] = state;
45
- $[9] = t1;
46
- $[10] = t2;
47
- $[11] = touched;
41
+ $[6] = requiredness;
42
+ $[7] = state;
43
+ $[8] = t1;
44
+ $[9] = t2;
45
+ $[10] = touched;
48
46
  } else {
49
47
  base = $[1];
50
48
  children = $[2];
51
49
  className = $[3];
52
50
  dirty = $[4];
53
51
  errors = $[5];
54
- optionalLabel = $[6];
55
- requiredness = $[7];
56
- state = $[8];
57
- t1 = $[9];
58
- t2 = $[10];
59
- touched = $[11];
52
+ requiredness = $[6];
53
+ state = $[7];
54
+ t1 = $[8];
55
+ t2 = $[9];
56
+ touched = $[10];
60
57
  }
61
58
  const length = t1 === void 0 ? DEFAULT_LENGTH : t1;
62
59
  const pending = t2 === void 0 ? false : t2;
63
60
  const t3 = base.value !== "";
64
61
  let t4;
65
- if ($[12] !== base.disabled || $[13] !== base.readOnly || $[14] !== dirty || $[15] !== errors || $[16] !== pending || $[17] !== requiredness || $[18] !== state || $[19] !== t3 || $[20] !== touched) {
62
+ if ($[11] !== base.disabled || $[12] !== base.readOnly || $[13] !== dirty || $[14] !== errors || $[15] !== pending || $[16] !== requiredness || $[17] !== state || $[18] !== t3 || $[19] !== touched) {
66
63
  t4 = {
67
64
  errors,
68
65
  requiredness,
@@ -74,111 +71,112 @@ var OtpInputRoot = (t0) => {
74
71
  filled: t3,
75
72
  state
76
73
  };
77
- $[12] = base.disabled;
78
- $[13] = base.readOnly;
79
- $[14] = dirty;
80
- $[15] = errors;
81
- $[16] = pending;
82
- $[17] = requiredness;
83
- $[18] = state;
84
- $[19] = t3;
85
- $[20] = touched;
86
- $[21] = t4;
87
- } else t4 = $[21];
74
+ $[11] = base.disabled;
75
+ $[12] = base.readOnly;
76
+ $[13] = dirty;
77
+ $[14] = errors;
78
+ $[15] = pending;
79
+ $[16] = requiredness;
80
+ $[17] = state;
81
+ $[18] = t3;
82
+ $[19] = touched;
83
+ $[20] = t4;
84
+ } else t4 = $[20];
88
85
  const field = useFieldState(t4);
89
86
  let t5;
90
- if ($[22] !== errors || $[23] !== field.phase || $[24] !== field.state || $[25] !== optionalLabel) {
87
+ if ($[21] !== errors || $[22] !== field.phase || $[23] !== field.state) {
91
88
  t5 = {
92
89
  state: field.state,
93
90
  errors,
94
- optionalLabel,
95
91
  phase: field.phase
96
92
  };
97
- $[22] = errors;
98
- $[23] = field.phase;
99
- $[24] = field.state;
100
- $[25] = optionalLabel;
101
- $[26] = t5;
102
- } else t5 = $[26];
93
+ $[21] = errors;
94
+ $[22] = field.phase;
95
+ $[23] = field.state;
96
+ $[24] = t5;
97
+ } else t5 = $[24];
103
98
  let t6;
104
- if ($[27] !== base || $[28] !== field.disabled || $[29] !== length) {
99
+ if ($[25] !== base || $[26] !== field.disabled || $[27] !== length) {
105
100
  t6 = {
106
101
  ...base,
107
102
  disabled: field.disabled,
108
103
  length
109
104
  };
110
- $[27] = base;
111
- $[28] = field.disabled;
112
- $[29] = length;
113
- $[30] = t6;
114
- } else t6 = $[30];
105
+ $[25] = base;
106
+ $[26] = field.disabled;
107
+ $[27] = length;
108
+ $[28] = t6;
109
+ } else t6 = $[28];
115
110
  let t7;
116
- if ($[31] !== field.state || $[32] !== length || $[33] !== t6) {
111
+ if ($[29] !== field.state || $[30] !== length || $[31] !== t6) {
117
112
  t7 = {
118
113
  state: field.state,
119
114
  length,
120
115
  base: t6
121
116
  };
122
- $[31] = field.state;
123
- $[32] = length;
124
- $[33] = t6;
125
- $[34] = t7;
126
- } else t7 = $[34];
117
+ $[29] = field.state;
118
+ $[30] = length;
119
+ $[31] = t6;
120
+ $[32] = t7;
121
+ } else t7 = $[32];
127
122
  const t8 = field.disabled;
128
123
  const t9 = field.invalid;
129
- let t10;
130
- if ($[35] !== className) {
131
- t10 = clsx(otp_field_module_default.root, className);
132
- $[35] = className;
133
- $[36] = t10;
134
- } else t10 = $[36];
124
+ const t10 = field.state.requiredness;
135
125
  let t11;
136
- if ($[37] !== field.state) {
137
- t11 = fieldStateAttributes(field.state);
138
- $[37] = field.state;
139
- $[38] = t11;
140
- } else t11 = $[38];
126
+ if ($[33] !== className) {
127
+ t11 = clsx(otp_field_module_default.root, className);
128
+ $[33] = className;
129
+ $[34] = t11;
130
+ } else t11 = $[34];
141
131
  let t12;
142
- if ($[39] !== children || $[40] !== dirty || $[41] !== field.disabled || $[42] !== field.invalid || $[43] !== t10 || $[44] !== t11 || $[45] !== touched) {
143
- t12 = /* @__PURE__ */ jsx(Field.Root, {
132
+ if ($[35] !== field.state) {
133
+ t12 = fieldStateAttributes(field.state);
134
+ $[35] = field.state;
135
+ $[36] = t12;
136
+ } else t12 = $[36];
137
+ let t13;
138
+ if ($[37] !== children || $[38] !== dirty || $[39] !== field.disabled || $[40] !== field.invalid || $[41] !== field.state.requiredness || $[42] !== t11 || $[43] !== t12 || $[44] !== touched) {
139
+ t13 = /* @__PURE__ */ jsx(Field.Root, {
144
140
  disabled: t8,
145
141
  invalid: t9,
142
+ requiredness: t10,
146
143
  dirty,
147
144
  touched,
148
- className: t10,
149
- ...t11,
145
+ className: t11,
146
+ ...t12,
150
147
  children
151
148
  });
152
- $[39] = children;
153
- $[40] = dirty;
154
- $[41] = field.disabled;
155
- $[42] = field.invalid;
156
- $[43] = t10;
157
- $[44] = t11;
158
- $[45] = touched;
159
- $[46] = t12;
160
- } else t12 = $[46];
161
- let t13;
162
- if ($[47] !== t12 || $[48] !== t7) {
163
- t13 = /* @__PURE__ */ jsx(OtpInputContext, {
149
+ $[37] = children;
150
+ $[38] = dirty;
151
+ $[39] = field.disabled;
152
+ $[40] = field.invalid;
153
+ $[41] = field.state.requiredness;
154
+ $[42] = t11;
155
+ $[43] = t12;
156
+ $[44] = touched;
157
+ $[45] = t13;
158
+ } else t13 = $[45];
159
+ let t14;
160
+ if ($[46] !== t13 || $[47] !== t7) {
161
+ t14 = /* @__PURE__ */ jsx(OtpInputContext, {
164
162
  value: t7,
165
- children: t12
163
+ children: t13
166
164
  });
167
- $[47] = t12;
168
- $[48] = t7;
169
- $[49] = t13;
170
- } else t13 = $[49];
171
- let t14;
172
- if ($[50] !== t13 || $[51] !== t5) {
173
- t14 = /* @__PURE__ */ jsx(InputPartsContext, {
165
+ $[46] = t13;
166
+ $[47] = t7;
167
+ $[48] = t14;
168
+ } else t14 = $[48];
169
+ let t15;
170
+ if ($[49] !== t14 || $[50] !== t5) {
171
+ t15 = /* @__PURE__ */ jsx(InputPartsContext, {
174
172
  value: t5,
175
- children: t13
173
+ children: t14
176
174
  });
177
- $[50] = t13;
178
- $[51] = t5;
179
- $[52] = t14;
180
- } else t14 = $[52];
181
- return t14;
175
+ $[49] = t14;
176
+ $[50] = t5;
177
+ $[51] = t15;
178
+ } else t15 = $[51];
179
+ return t15;
182
180
  };
183
181
  /**
184
182
  * The row of character slots, bound to `Root`'s value.
@@ -343,11 +341,13 @@ var OtpInputSlots = (t0) => {
343
341
  * given.
344
342
  *
345
343
  * @example
346
- * <OtpInput.Root value={code} onValueChange={setCode} optionalLabel="optional">
347
- * <OtpInput.Label>Verification code</OtpInput.Label>
344
+ * <OtpInput.Root value={code} onValueChange={setCode} requiredness="optional">
345
+ * <OtpInput.Label>Verification code <Field.Requiredness optionalLabel="optional" /></OtpInput.Label>
348
346
  * <OtpInput.Group>
349
347
  * <OtpInput.Slots slotLabel={(index, total) => `character ${index} of ${total}`} />
350
- * <OtpInput.Pending />
348
+ * <OtpInput.Pending>
349
+ * <Spinner size={1} />
350
+ * </OtpInput.Pending>
351
351
  * </OtpInput.Group>
352
352
  * <OtpInput.Error />
353
353
  * </OtpInput.Root>
@@ -1,5 +1,5 @@
1
1
  import { useRender } from "@base-ui/react/use-render";
2
- import type { ComponentProps, ReactElement, ReactNode } from "react";
2
+ import type { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
3
3
  import { type PaginationPage } from "./pagination-context.ts";
4
4
  export type { PaginationPage };
5
5
  export type PaginationRootProps = useRender.ComponentProps<"div"> & PaginationPage & Readonly<{
@@ -27,19 +27,41 @@ export type PaginationIndexProps = Omit<useRender.ComponentProps<"span">, "child
27
27
  }>;
28
28
  /** Which page is on screen, as a polite live region. */
29
29
  declare const PaginationIndex: ({ label, render, className, ref, ...props }: PaginationIndexProps) => ReactElement;
30
- export type PaginationStepProps = Omit<ComponentProps<"button">, "ref" | "children"> & Readonly<{
31
- /** The button's name and tooltip, such as "Next page". */
32
- label: string;
33
- /** The glyph, such as a chevron. */
34
- children: ReactNode;
30
+ export type PaginationStepProps = Omit<ComponentPropsWithRef<"button">, "children"> & Readonly<{
31
+ /** The button to render, such as `<IconButton label="Next page" variant="tertiary"><ChevronRightIcon /></IconButton>`. */
32
+ render: useRender.RenderProp;
35
33
  }>;
36
- /** Goes to the first page; marked `aria-disabled`, and kept in the tab order, on the first page. */
34
+ /**
35
+ * Goes to the first page; marked `aria-disabled`, and kept in the tab order, on
36
+ * the first page. It renders whichever button it is given.
37
+ *
38
+ * @example
39
+ * <Pagination.First render={<IconButton label="First page" variant="tertiary"><FirstPageIcon /></IconButton>} />
40
+ */
37
41
  declare const PaginationFirst: (props: PaginationStepProps) => ReactNode;
38
- /** Goes back a page; marked `aria-disabled`, and kept in the tab order, on the first page. */
42
+ /**
43
+ * Goes back a page; marked `aria-disabled`, and kept in the tab order, on the
44
+ * first page. It renders whichever button it is given.
45
+ *
46
+ * @example
47
+ * <Pagination.Previous render={<IconButton label="Previous page" variant="tertiary"><ChevronLeftIcon /></IconButton>} />
48
+ */
39
49
  declare const PaginationPrevious: (props: PaginationStepProps) => ReactNode;
40
- /** Goes on a page; marked `aria-disabled`, and kept in the tab order, on the last page. */
50
+ /**
51
+ * Goes on a page; marked `aria-disabled`, and kept in the tab order, on the
52
+ * last page. It renders whichever button it is given.
53
+ *
54
+ * @example
55
+ * <Pagination.Next render={<IconButton label="Next page" variant="tertiary"><ChevronRightIcon /></IconButton>} />
56
+ */
41
57
  declare const PaginationNext: (props: PaginationStepProps) => ReactNode;
42
- /** Goes to the last page; marked `aria-disabled`, and kept in the tab order, on the last page. */
58
+ /**
59
+ * Goes to the last page; marked `aria-disabled`, and kept in the tab order, on
60
+ * the last page. It renders whichever button it is given.
61
+ *
62
+ * @example
63
+ * <Pagination.Last render={<IconButton label="Last page" variant="tertiary"><LastPageIcon /></IconButton>} />
64
+ */
43
65
  declare const PaginationLast: (props: PaginationStepProps) => ReactNode;
44
66
  /** The step buttons' names and glyphs. */
45
67
  export type PaginationStepLabels = Readonly<{
@@ -60,9 +82,17 @@ export type PaginationStepLabels = Readonly<{
60
82
  /** The last-page button's glyph. */
61
83
  lastIcon: ReactNode;
62
84
  }>;
63
- export type PaginationControlsProps = Omit<useRender.ComponentProps<"div">, "children"> & PaginationStepLabels;
64
- /** `First`, `Previous`, `Next` and `Last` in a row. */
65
- declare const PaginationControls: ({ firstLabel, previousLabel, nextLabel, lastLabel, firstIcon, previousIcon, nextIcon, lastIcon, render, className, ref, ...props }: PaginationControlsProps) => ReactElement;
85
+ export type PaginationControlsProps = useRender.ComponentProps<"div">;
86
+ /**
87
+ * The step buttons it is given, `First`, `Previous`, `Next` and `Last`, in a row.
88
+ *
89
+ * @example
90
+ * <Pagination.Controls>
91
+ * <Pagination.Previous render={previousButton} />
92
+ * <Pagination.Next render={nextButton} />
93
+ * </Pagination.Controls>
94
+ */
95
+ declare const PaginationControls: ({ render, className, ref, ...props }: PaginationControlsProps) => ReactElement;
66
96
  /** What the ready-made pager says and shows, besides where the list stands. */
67
97
  export type PaginationContentProps = PaginationStepLabels & Readonly<{
68
98
  /** The page-size field's label, such as "Rows per page". */
@@ -92,8 +122,9 @@ export type PaginationParts = typeof Prefab & Readonly<{
92
122
  * The pager for a paged list, over any source: the page size, which page is on
93
123
  * screen, and buttons to the first, previous, next and last page. Its parts
94
124
  * compose another pager: `Root` holds where the list stands, `PageSize` picks
95
- * rows per page, `Index` says which page is on screen, and `Controls`, or
96
- * `First`, `Previous`, `Next` and `Last` on their own, step through the pages.
125
+ * rows per page, `Index` says which page is on screen, and `First`, `Previous`,
126
+ * `Next` and `Last`, each rendering the button it is given, step through the
127
+ * pages, in a `Controls` row or on their own.
97
128
  *
98
129
  * @example
99
130
  * <Pagination