@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,8 @@
1
+ import { IconButton } from "../button/button.js";
2
+ import { Field } from "../field/field.js";
1
3
  import { TextInput } from "../text-field/text-input.js";
2
4
  import { PasswordStrength } from "./password-strength.js";
5
+ import { Spinner } from "../spinner/spinner.js";
3
6
  import { c } from "react/compiler-runtime";
4
7
  import { jsx, jsxs } from "react/jsx-runtime";
5
8
  import { useState } from "react";
@@ -22,7 +25,7 @@ import { useState } from "react";
22
25
  * />
23
26
  */
24
27
  var PasswordField = (t0) => {
25
- const $ = c(63);
28
+ const $ = c(67);
26
29
  let className;
27
30
  let description;
28
31
  let dirty;
@@ -99,88 +102,108 @@ var PasswordField = (t0) => {
99
102
  }
100
103
  const [revealed, setRevealed] = useState(false);
101
104
  let t1;
102
- if ($[24] !== label) {
103
- t1 = /* @__PURE__ */ jsx(TextInput.Label, { children: label });
104
- $[24] = label;
105
+ if ($[24] !== optionalLabel) {
106
+ t1 = /* @__PURE__ */ jsx(Field.Requiredness, { optionalLabel });
107
+ $[24] = optionalLabel;
105
108
  $[25] = t1;
106
109
  } else t1 = $[25];
107
- const t2 = revealed ? "text" : "password";
108
- let t3;
109
- if ($[26] !== inputProps || $[27] !== t2) {
110
- t3 = /* @__PURE__ */ jsx(TextInput.Input, {
110
+ let t2;
111
+ if ($[26] !== label || $[27] !== t1) {
112
+ t2 = /* @__PURE__ */ jsxs(TextInput.Label, { children: [
113
+ label,
114
+ " ",
115
+ t1
116
+ ] });
117
+ $[26] = label;
118
+ $[27] = t1;
119
+ $[28] = t2;
120
+ } else t2 = $[28];
121
+ const t3 = revealed ? "text" : "password";
122
+ let t4;
123
+ if ($[29] !== inputProps || $[30] !== t3) {
124
+ t4 = /* @__PURE__ */ jsx(TextInput.Input, {
111
125
  ...inputProps,
112
- type: t2
126
+ type: t3
113
127
  });
114
- $[26] = inputProps;
115
- $[27] = t2;
116
- $[28] = t3;
117
- } else t3 = $[28];
118
- let t4;
119
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
120
- t4 = /* @__PURE__ */ jsx(TextInput.Pending, {});
121
- $[29] = t4;
122
- } else t4 = $[29];
123
- const t5 = revealed ? hidePasswordLabel : showPasswordLabel;
124
- const t6 = revealed ? hidePasswordIcon : showPasswordIcon;
125
- let t7;
126
- if ($[30] !== revealed || $[31] !== t5 || $[32] !== t6) {
127
- t7 = /* @__PURE__ */ jsx(TextInput.Reveal, {
128
+ $[29] = inputProps;
129
+ $[30] = t3;
130
+ $[31] = t4;
131
+ } else t4 = $[31];
132
+ let t5;
133
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
134
+ t5 = /* @__PURE__ */ jsx(TextInput.Pending, { children: /* @__PURE__ */ jsx(Spinner, { size: 1 }) });
135
+ $[32] = t5;
136
+ } else t5 = $[32];
137
+ const t6 = revealed ? hidePasswordLabel : showPasswordLabel;
138
+ const t7 = revealed ? hidePasswordIcon : showPasswordIcon;
139
+ let t8;
140
+ if ($[33] !== t6 || $[34] !== t7) {
141
+ t8 = /* @__PURE__ */ jsx(IconButton, {
142
+ label: t6,
143
+ variant: "tertiary",
144
+ size: "sm",
145
+ children: t7
146
+ });
147
+ $[33] = t6;
148
+ $[34] = t7;
149
+ $[35] = t8;
150
+ } else t8 = $[35];
151
+ let t9;
152
+ if ($[36] !== revealed || $[37] !== t8) {
153
+ t9 = /* @__PURE__ */ jsx(TextInput.Reveal, {
128
154
  revealed,
129
155
  onRevealedChange: setRevealed,
130
- label: t5,
131
- children: t6
156
+ render: t8
132
157
  });
133
- $[30] = revealed;
134
- $[31] = t5;
135
- $[32] = t6;
136
- $[33] = t7;
137
- } else t7 = $[33];
138
- let t8;
139
- if ($[34] !== t3 || $[35] !== t7) {
140
- t8 = /* @__PURE__ */ jsxs(TextInput.Group, { children: [
141
- t3,
158
+ $[36] = revealed;
159
+ $[37] = t8;
160
+ $[38] = t9;
161
+ } else t9 = $[38];
162
+ let t10;
163
+ if ($[39] !== t4 || $[40] !== t9) {
164
+ t10 = /* @__PURE__ */ jsxs(TextInput.Group, { children: [
142
165
  t4,
143
- t7
166
+ t5,
167
+ t9
144
168
  ] });
145
- $[34] = t3;
146
- $[35] = t7;
147
- $[36] = t8;
148
- } else t8 = $[36];
149
- let t9;
150
- if ($[37] !== languages || $[38] !== scoreLabels || $[39] !== strength || $[40] !== strengthLabel || $[41] !== value) {
151
- t9 = strength === true && /* @__PURE__ */ jsx(PasswordStrength, {
169
+ $[39] = t4;
170
+ $[40] = t9;
171
+ $[41] = t10;
172
+ } else t10 = $[41];
173
+ let t11;
174
+ if ($[42] !== languages || $[43] !== scoreLabels || $[44] !== strength || $[45] !== strengthLabel || $[46] !== value) {
175
+ t11 = strength === true && /* @__PURE__ */ jsx(PasswordStrength, {
152
176
  password: value,
153
177
  label: strengthLabel,
154
178
  scoreLabels,
155
179
  languages
156
180
  });
157
- $[37] = languages;
158
- $[38] = scoreLabels;
159
- $[39] = strength;
160
- $[40] = strengthLabel;
161
- $[41] = value;
162
- $[42] = t9;
163
- } else t9 = $[42];
164
- let t10;
165
- if ($[43] !== description) {
166
- t10 = /* @__PURE__ */ jsx(TextInput.Description, { children: description });
167
- $[43] = description;
168
- $[44] = t10;
169
- } else t10 = $[44];
170
- let t11;
171
- if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
172
- t11 = /* @__PURE__ */ jsx(TextInput.Error, {});
173
- $[45] = t11;
174
- } else t11 = $[45];
181
+ $[42] = languages;
182
+ $[43] = scoreLabels;
183
+ $[44] = strength;
184
+ $[45] = strengthLabel;
185
+ $[46] = value;
186
+ $[47] = t11;
187
+ } else t11 = $[47];
175
188
  let t12;
176
- if ($[46] !== className || $[47] !== dirty || $[48] !== disabled || $[49] !== errors || $[50] !== onValueChange || $[51] !== optionalLabel || $[52] !== pending || $[53] !== readOnly || $[54] !== requiredness || $[55] !== state || $[56] !== t1 || $[57] !== t10 || $[58] !== t8 || $[59] !== t9 || $[60] !== touched || $[61] !== value) {
177
- t12 = /* @__PURE__ */ jsxs(TextInput.Root, {
189
+ if ($[48] !== description) {
190
+ t12 = /* @__PURE__ */ jsx(TextInput.Description, { children: description });
191
+ $[48] = description;
192
+ $[49] = t12;
193
+ } else t12 = $[49];
194
+ let t13;
195
+ if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
196
+ t13 = /* @__PURE__ */ jsx(TextInput.Error, {});
197
+ $[50] = t13;
198
+ } else t13 = $[50];
199
+ let t14;
200
+ if ($[51] !== className || $[52] !== dirty || $[53] !== disabled || $[54] !== errors || $[55] !== onValueChange || $[56] !== pending || $[57] !== readOnly || $[58] !== requiredness || $[59] !== state || $[60] !== t10 || $[61] !== t11 || $[62] !== t12 || $[63] !== t2 || $[64] !== touched || $[65] !== value) {
201
+ t14 = /* @__PURE__ */ jsxs(TextInput.Root, {
178
202
  value,
179
203
  onValueChange,
180
204
  disabled,
181
205
  readOnly,
182
206
  requiredness,
183
- optionalLabel,
184
207
  errors,
185
208
  dirty,
186
209
  touched,
@@ -188,31 +211,30 @@ var PasswordField = (t0) => {
188
211
  state,
189
212
  className,
190
213
  children: [
191
- t1,
192
- t8,
193
- t9,
214
+ t2,
194
215
  t10,
195
- t11
216
+ t11,
217
+ t12,
218
+ t13
196
219
  ]
197
220
  });
198
- $[46] = className;
199
- $[47] = dirty;
200
- $[48] = disabled;
201
- $[49] = errors;
202
- $[50] = onValueChange;
203
- $[51] = optionalLabel;
204
- $[52] = pending;
205
- $[53] = readOnly;
206
- $[54] = requiredness;
207
- $[55] = state;
208
- $[56] = t1;
209
- $[57] = t10;
210
- $[58] = t8;
211
- $[59] = t9;
212
- $[60] = touched;
213
- $[61] = value;
221
+ $[51] = className;
222
+ $[52] = dirty;
223
+ $[53] = disabled;
224
+ $[54] = errors;
225
+ $[55] = onValueChange;
226
+ $[56] = pending;
227
+ $[57] = readOnly;
228
+ $[58] = requiredness;
229
+ $[59] = state;
230
+ $[60] = t10;
231
+ $[61] = t11;
214
232
  $[62] = t12;
215
- } else t12 = $[62];
216
- return t12;
233
+ $[63] = t2;
234
+ $[64] = touched;
235
+ $[65] = value;
236
+ $[66] = t14;
237
+ } else t14 = $[66];
238
+ return t14;
217
239
  };
218
240
  export { PasswordField };
@@ -1,12 +1,12 @@
1
1
  import './password-field.css';// src/components/password-field/password-field.module.scss
2
- var strength = "_strength_1dakz_3";
3
- var meter = "_meter_1dakz_8";
4
- var meterLabel = "_meterLabel_1dakz_30";
5
- var meterValue = "_meterValue_1dakz_35";
6
- var meterTrack = "_meterTrack_1dakz_40";
7
- var meterIndicator = "_meterIndicator_1dakz_47";
8
- var feedback = "_feedback_1dakz_56";
9
- var suggestions = "_suggestions_1dakz_60";
2
+ var strength = "_strength_1q8qt_3";
3
+ var meter = "_meter_1q8qt_8";
4
+ var meterLabel = "_meterLabel_1q8qt_30";
5
+ var meterValue = "_meterValue_1q8qt_35";
6
+ var meterTrack = "_meterTrack_1q8qt_40";
7
+ var meterIndicator = "_meterIndicator_1q8qt_47";
8
+ var feedback = "_feedback_1q8qt_56";
9
+ var suggestions = "_suggestions_1q8qt_60";
10
10
  var password_field_module_default = {
11
11
  strength,
12
12
  meter,
@@ -1,8 +1,97 @@
1
+ import { Meter } from "@base-ui/react/meter";
2
+ import { useRender } from "@base-ui/react/use-render";
1
3
  import type { Score } from "@zxcvbn-ts/core";
2
- import type { ReactNode } from "react";
4
+ import { type ReactElement, type ReactNode } from "react";
3
5
  import { type ZxcvbnLanguages } from "../../lib/password-strength/password-strength.ts";
4
6
  /** The name of each strength band, from 0 (weakest) to 4 (strongest). */
5
7
  export type PasswordScoreLabels = Readonly<Record<Score, string>>;
8
+ export type PasswordStrengthRootProps = useRender.ComponentProps<"div"> & Readonly<{
9
+ password: string;
10
+ /**
11
+ * zxcvbn language packs beside the kit's English and Dutch ones, by lowercase
12
+ * language tag: `{ de: () => import("@zxcvbn-ts/language-de") }`.
13
+ */
14
+ languages?: ZxcvbnLanguages;
15
+ }>;
16
+ /**
17
+ * Judges `password` with zxcvbn in the locale's language and hands the result
18
+ * to the parts inside it. It suspends while that language's dictionaries load,
19
+ * and renders nothing for an empty password.
20
+ *
21
+ * @example
22
+ * <PasswordStrength.Root password={password}>…</PasswordStrength.Root>
23
+ */
24
+ declare const Root: ({ password, languages, className, render, ref, ...props }: PasswordStrengthRootProps) => ReactNode;
25
+ export type PasswordStrengthMeterProps = Omit<Meter.Root.Props, "value" | "max" | "getAriaValueText"> & Readonly<{
26
+ /** The name of each band, such as "Very weak" for 0. */
27
+ scoreLabels: PasswordScoreLabels;
28
+ }>;
29
+ /**
30
+ * The strength band as a meter, read as the band's name. It sets `data-score`,
31
+ * which the `Value` and `Indicator` inside it colour by.
32
+ *
33
+ * @example
34
+ * <PasswordStrength.Meter scoreLabels={SCORE_LABELS}>…</PasswordStrength.Meter>
35
+ */
36
+ declare const StrengthMeter: ({ scoreLabels, className, ...props }: PasswordStrengthMeterProps) => ReactNode;
37
+ /**
38
+ * The meter's label, such as "Password strength".
39
+ *
40
+ * @example
41
+ * <PasswordStrength.Label>Password strength</PasswordStrength.Label>
42
+ */
43
+ declare const Label: ({ className, ...props }: Meter.Label.Props) => ReactNode;
44
+ export type PasswordStrengthValueProps = Omit<Meter.Value.Props, "children">;
45
+ /**
46
+ * The band's name, such as "Fair", from the meter's `scoreLabels`.
47
+ *
48
+ * @example
49
+ * <PasswordStrength.Value />
50
+ */
51
+ declare const Value: ({ className, ...props }: PasswordStrengthValueProps) => ReactNode;
52
+ /**
53
+ * The bar the indicator fills.
54
+ *
55
+ * @example
56
+ * <PasswordStrength.Track><PasswordStrength.Indicator /></PasswordStrength.Track>
57
+ */
58
+ declare const Track: ({ className, ...props }: Meter.Track.Props) => ReactNode;
59
+ /**
60
+ * The fill of the track, as far as the band reaches and in its colour.
61
+ *
62
+ * @example
63
+ * <PasswordStrength.Indicator />
64
+ */
65
+ declare const Indicator: ({ className, ...props }: Meter.Indicator.Props) => ReactNode;
66
+ export type PasswordStrengthFeedbackProps = Omit<useRender.ComponentProps<"p">, "children">;
67
+ /**
68
+ * zxcvbn's own warning, in the locale's language. Renders nothing without one.
69
+ *
70
+ * @example
71
+ * <PasswordStrength.Feedback />
72
+ */
73
+ declare const Feedback: ({ className, render, ref, ...props }: PasswordStrengthFeedbackProps) => ReactElement | null;
74
+ export type PasswordStrengthSuggestionsProps = Omit<useRender.ComponentProps<"ul">, "children"> & Readonly<{
75
+ /** Renders one of zxcvbn's suggestions, such as a `Suggestion`. */
76
+ children: (suggestion: string) => ReactNode;
77
+ }>;
78
+ /**
79
+ * zxcvbn's own suggestions, in the locale's language, as a list. Renders
80
+ * nothing without any.
81
+ *
82
+ * @example
83
+ * <PasswordStrength.Suggestions>
84
+ * {suggestion => <PasswordStrength.Suggestion key={suggestion}>{suggestion}</PasswordStrength.Suggestion>}
85
+ * </PasswordStrength.Suggestions>
86
+ */
87
+ declare const Suggestions: ({ className, render, ref, children, ...props }: PasswordStrengthSuggestionsProps) => ReactElement | null;
88
+ /**
89
+ * One of zxcvbn's suggestions.
90
+ *
91
+ * @example
92
+ * <PasswordStrength.Suggestion>{suggestion}</PasswordStrength.Suggestion>
93
+ */
94
+ declare const Suggestion: ({ className, render, ref, ...props }: useRender.ComponentProps<"li">) => ReactElement;
6
95
  export type PasswordStrengthProps = Readonly<{
7
96
  password: string;
8
97
  /** The meter's label, such as "Password strength". */
@@ -16,12 +105,27 @@ export type PasswordStrengthProps = Readonly<{
16
105
  languages?: ZxcvbnLanguages;
17
106
  className?: string;
18
107
  }>;
108
+ declare const Prefab: ({ password, label, scoreLabels, languages, className, }: PasswordStrengthProps) => ReactNode;
109
+ /** The parts of a password strength meter, hanging off its prefab. */
110
+ export type PasswordStrengthParts = typeof Prefab & Readonly<{
111
+ Root: typeof Root;
112
+ Meter: typeof StrengthMeter;
113
+ Label: typeof Label;
114
+ Value: typeof Value;
115
+ Track: typeof Track;
116
+ Indicator: typeof Indicator;
117
+ Feedback: typeof Feedback;
118
+ Suggestions: typeof Suggestions;
119
+ Suggestion: typeof Suggestion;
120
+ }>;
19
121
  /**
20
122
  * The strength band of a password as a labelled meter, followed by zxcvbn's own
21
123
  * warning and suggestions in the locale's language. It suspends while that
22
- * language's dictionaries load, and renders nothing for an empty password.
124
+ * language's dictionaries load, and renders nothing for an empty password. The
125
+ * parts hanging off it compose a meter by hand.
23
126
  *
24
127
  * @example
25
128
  * <PasswordStrength password={password} label="Password strength" scoreLabels={SCORE_LABELS} />
26
129
  */
27
- export declare const PasswordStrength: ({ password, label, scoreLabels, languages, className, }: PasswordStrengthProps) => ReactNode;
130
+ export declare const PasswordStrength: PasswordStrengthParts;
131
+ export {};