@eifi1/ui-kit 0.21.0 → 0.23.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 (320) hide show
  1. package/README.md +42 -25
  2. package/dist/chart.d.ts +19 -14
  3. package/dist/components/account-chips.d.ts +10 -3
  4. package/dist/components/account-chips.js +5 -2
  5. package/dist/components/account-chips.js.map +1 -1
  6. package/dist/components/account-settings.d.ts +33 -2
  7. package/dist/components/account-settings.js +43 -21
  8. package/dist/components/account-settings.js.map +1 -1
  9. package/dist/components/amount-input.d.ts +53 -14
  10. package/dist/components/amount-input.js +17 -28
  11. package/dist/components/amount-input.js.map +1 -1
  12. package/dist/components/autocomplete.d.ts +29 -0
  13. package/dist/components/autocomplete.js +134 -104
  14. package/dist/components/autocomplete.js.map +1 -1
  15. package/dist/components/button-group.d.ts +19 -14
  16. package/dist/components/calculator.d.ts +19 -14
  17. package/dist/components/checkbox-group.d.ts +104 -0
  18. package/dist/components/checkbox-group.js +111 -0
  19. package/dist/components/checkbox-group.js.map +1 -0
  20. package/dist/components/checkbox.d.ts +19 -0
  21. package/dist/components/checkbox.js +30 -7
  22. package/dist/components/checkbox.js.map +1 -1
  23. package/dist/components/chip.d.ts +18 -0
  24. package/dist/components/chip.js +47 -10
  25. package/dist/components/chip.js.map +1 -1
  26. package/dist/components/column-mapper.d.ts +182 -0
  27. package/dist/components/column-mapper.js +375 -0
  28. package/dist/components/column-mapper.js.map +1 -0
  29. package/dist/components/combobox-core.d.ts +39 -2
  30. package/dist/components/combobox-core.js +29 -6
  31. package/dist/components/combobox-core.js.map +1 -1
  32. package/dist/components/combobox.d.ts +91 -2
  33. package/dist/components/combobox.js +454 -308
  34. package/dist/components/combobox.js.map +1 -1
  35. package/dist/components/confirm-dialog.d.ts +69 -161
  36. package/dist/components/confirm-dialog.js +7 -8
  37. package/dist/components/confirm-dialog.js.map +1 -1
  38. package/dist/components/copy-button.d.ts +16 -11
  39. package/dist/components/country-select.d.ts +167 -0
  40. package/dist/components/country-select.js +293 -0
  41. package/dist/components/country-select.js.map +1 -0
  42. package/dist/components/currency-select.d.ts +17 -1
  43. package/dist/components/currency-select.js +56 -23
  44. package/dist/components/currency-select.js.map +1 -1
  45. package/dist/components/danger-confirm.d.ts +69 -166
  46. package/dist/components/danger-confirm.js +144 -50
  47. package/dist/components/danger-confirm.js.map +1 -1
  48. package/dist/components/data-table-cells.d.ts +1 -2
  49. package/dist/components/data-table-filter-popover.d.ts +1 -2
  50. package/dist/components/data-table-filters.d.ts +1 -2
  51. package/dist/components/data-table-labels.d.ts +4 -97
  52. package/dist/components/data-table-labels.js +9 -1
  53. package/dist/components/data-table-labels.js.map +1 -1
  54. package/dist/components/data-table-pagination.d.ts +3 -1
  55. package/dist/components/data-table.d.ts +1 -2
  56. package/dist/components/data-table.js +98 -3
  57. package/dist/components/data-table.js.map +1 -1
  58. package/dist/components/date-picker.d.ts +66 -5
  59. package/dist/components/date-picker.js +378 -66
  60. package/dist/components/date-picker.js.map +1 -1
  61. package/dist/components/entity-combobox.d.ts +42 -1
  62. package/dist/components/entity-combobox.js +154 -113
  63. package/dist/components/entity-combobox.js.map +1 -1
  64. package/dist/components/facing-pair.d.ts +19 -14
  65. package/dist/components/field-parts.d.ts +224 -0
  66. package/dist/components/field-parts.js +156 -0
  67. package/dist/components/field-parts.js.map +1 -0
  68. package/dist/components/field-strip.d.ts +105 -0
  69. package/dist/components/field-strip.js +46 -0
  70. package/dist/components/field-strip.js.map +1 -0
  71. package/dist/components/file-button.d.ts +19 -14
  72. package/dist/components/file-button.js +13 -3
  73. package/dist/components/file-button.js.map +1 -1
  74. package/dist/components/file-dropzone.d.ts +41 -15
  75. package/dist/components/file-dropzone.js +57 -34
  76. package/dist/components/file-dropzone.js.map +1 -1
  77. package/dist/components/form-actions.d.ts +18 -13
  78. package/dist/components/form-actions.js +69 -5
  79. package/dist/components/form-actions.js.map +1 -1
  80. package/dist/components/iban-input.d.ts +69 -0
  81. package/dist/components/iban-input.js +125 -0
  82. package/dist/components/iban-input.js.map +1 -0
  83. package/dist/components/icon-picker.d.ts +21 -2
  84. package/dist/components/icon-picker.js +19 -4
  85. package/dist/components/icon-picker.js.map +1 -1
  86. package/dist/components/inline-edit-field.d.ts +167 -0
  87. package/dist/components/inline-edit-field.js +293 -0
  88. package/dist/components/inline-edit-field.js.map +1 -0
  89. package/dist/components/language-select.d.ts +130 -0
  90. package/dist/components/language-select.js +18 -0
  91. package/dist/components/language-select.js.map +1 -0
  92. package/dist/components/line-items.d.ts +25 -3
  93. package/dist/components/line-items.js +55 -46
  94. package/dist/components/line-items.js.map +1 -1
  95. package/dist/components/list.d.ts +25 -0
  96. package/dist/components/list.js +16 -5
  97. package/dist/components/list.js.map +1 -1
  98. package/dist/components/money-field.d.ts +32 -14
  99. package/dist/components/money-field.js.map +1 -1
  100. package/dist/components/month-picker.d.ts +52 -4
  101. package/dist/components/month-picker.js +291 -86
  102. package/dist/components/month-picker.js.map +1 -1
  103. package/dist/components/multi-entity-combobox.d.ts +26 -1
  104. package/dist/components/multi-entity-combobox.js +143 -102
  105. package/dist/components/multi-entity-combobox.js.map +1 -1
  106. package/dist/components/multi-select.d.ts +8 -1
  107. package/dist/components/multi-select.js +9 -4
  108. package/dist/components/multi-select.js.map +1 -1
  109. package/dist/components/number-field.d.ts +34 -19
  110. package/dist/components/number-field.js +6 -20
  111. package/dist/components/number-field.js.map +1 -1
  112. package/dist/components/number-input.d.ts +79 -19
  113. package/dist/components/number-input.js +90 -38
  114. package/dist/components/number-input.js.map +1 -1
  115. package/dist/components/numpad-sheet.d.ts +19 -14
  116. package/dist/components/one-time-code-input.d.ts +100 -0
  117. package/dist/components/one-time-code-input.js +137 -0
  118. package/dist/components/one-time-code-input.js.map +1 -0
  119. package/dist/components/phone-input.d.ts +69 -0
  120. package/dist/components/phone-input.js +171 -0
  121. package/dist/components/phone-input.js.map +1 -0
  122. package/dist/components/reauth-dialog.d.ts +2 -2
  123. package/dist/components/reauth-dialog.js +6 -8
  124. package/dist/components/reauth-dialog.js.map +1 -1
  125. package/dist/components/series-chart.d.ts +19 -14
  126. package/dist/components/settings-fields.d.ts +19 -14
  127. package/dist/components/share-card.d.ts +16 -11
  128. package/dist/components/sign-chip.d.ts +66 -0
  129. package/dist/components/sign-chip.js +39 -0
  130. package/dist/components/sign-chip.js.map +1 -0
  131. package/dist/components/swatch-picker.d.ts +43 -2
  132. package/dist/components/swatch-picker.js +80 -32
  133. package/dist/components/swatch-picker.js.map +1 -1
  134. package/dist/components/switch.d.ts +19 -0
  135. package/dist/components/switch.js +24 -6
  136. package/dist/components/switch.js.map +1 -1
  137. package/dist/components/text-link.d.ts +18 -13
  138. package/dist/components/tile-radio.d.ts +88 -13
  139. package/dist/components/tile-radio.js +28 -11
  140. package/dist/components/tile-radio.js.map +1 -1
  141. package/dist/components/time-input.d.ts +24 -15
  142. package/dist/components/time-input.js.map +1 -1
  143. package/dist/components/toggle-group.d.ts +47 -1
  144. package/dist/components/toggle-group.js +110 -69
  145. package/dist/components/toggle-group.js.map +1 -1
  146. package/dist/components/trigger-aria.d.ts +3 -0
  147. package/dist/components/trigger-aria.js +3 -1
  148. package/dist/components/trigger-aria.js.map +1 -1
  149. package/dist/components/ui.d.ts +16 -11
  150. package/dist/components/ui.js +284 -88
  151. package/dist/components/ui.js.map +1 -1
  152. package/dist/components/use-table-state.d.ts +1 -2
  153. package/dist/{data-table-3mi2R3so.d.ts → data-table-labels-B7OdnM0S.d.ts} +140 -3
  154. package/dist/data-table.d.ts +1 -2
  155. package/dist/data-table.js +2 -1
  156. package/dist/data-table.js.map +1 -1
  157. package/dist/feedback/feedback-attachment.d.ts +1 -1
  158. package/dist/feedback/feedback-attachment.js +348 -41
  159. package/dist/feedback/feedback-attachment.js.map +1 -1
  160. package/dist/feedback/feedback-dialog.d.ts +1 -1
  161. package/dist/feedback/feedback-dialog.js.map +1 -1
  162. package/dist/feedback/feedback-inbox.d.ts +3 -2
  163. package/dist/feedback/feedback-inbox.js.map +1 -1
  164. package/dist/feedback/feedback-thread.d.ts +68 -253
  165. package/dist/feedback/feedback-thread.js +46 -10
  166. package/dist/feedback/feedback-thread.js.map +1 -1
  167. package/dist/{kit-labels-D1J2_jyD.d.ts → feedback-BxeQVzwq.d.ts} +1206 -20
  168. package/dist/{feedback-attachment-WFiXJ8We.d.ts → feedback-attachment-fGAzZPf0.d.ts} +178 -11
  169. package/dist/feedback.d.ts +66 -2
  170. package/dist/hooks/use-file-drop.d.ts +19 -14
  171. package/dist/i18n/defaults.d.ts +19 -14
  172. package/dist/i18n/defaults.js +19 -2
  173. package/dist/i18n/defaults.js.map +1 -1
  174. package/dist/i18n/german.d.ts +19 -14
  175. package/dist/i18n/german.js +84 -5
  176. package/dist/i18n/german.js.map +1 -1
  177. package/dist/i18n/kit-labels.d.ts +15 -10
  178. package/dist/i18n/kit-labels.js +8 -2
  179. package/dist/i18n/kit-labels.js.map +1 -1
  180. package/dist/i18n/languages.d.ts +19 -14
  181. package/dist/i18n/locales/de-CH.d.ts +19 -14
  182. package/dist/i18n/locales/en.d.ts +19 -14
  183. package/dist/i18n/locales/en.js +16 -0
  184. package/dist/i18n/locales/en.js.map +1 -1
  185. package/dist/i18n/locales/es.d.ts +19 -14
  186. package/dist/i18n/locales/es.js +83 -5
  187. package/dist/i18n/locales/es.js.map +1 -1
  188. package/dist/i18n/locales/fr.d.ts +19 -14
  189. package/dist/i18n/locales/fr.js +82 -5
  190. package/dist/i18n/locales/fr.js.map +1 -1
  191. package/dist/i18n/locales/hu.d.ts +19 -14
  192. package/dist/i18n/locales/hu.js +85 -5
  193. package/dist/i18n/locales/hu.js.map +1 -1
  194. package/dist/i18n/locales/it.d.ts +19 -14
  195. package/dist/i18n/locales/it.js +84 -5
  196. package/dist/i18n/locales/it.js.map +1 -1
  197. package/dist/i18n/locales/zh.d.ts +19 -14
  198. package/dist/i18n/locales/zh.js +80 -5
  199. package/dist/i18n/locales/zh.js.map +1 -1
  200. package/dist/i18n/review.d.ts +19 -14
  201. package/dist/i18n/review.js +27 -1
  202. package/dist/i18n/review.js.map +1 -1
  203. package/dist/index.d.ts +21 -10
  204. package/dist/index.js +73 -2
  205. package/dist/index.js.map +1 -1
  206. package/dist/lib/column-mapping.d.ts +81 -0
  207. package/dist/lib/column-mapping.js +108 -0
  208. package/dist/lib/column-mapping.js.map +1 -0
  209. package/dist/lib/countries.d.ts +43 -0
  210. package/dist/lib/countries.js +39 -0
  211. package/dist/lib/countries.js.map +1 -0
  212. package/dist/lib/decimal-marks.d.ts +46 -0
  213. package/dist/lib/decimal-marks.js +40 -0
  214. package/dist/lib/decimal-marks.js.map +1 -0
  215. package/dist/lib/iban.d.ts +98 -0
  216. package/dist/lib/iban.js +154 -0
  217. package/dist/lib/iban.js.map +1 -0
  218. package/dist/lib/isin.d.ts +30 -0
  219. package/dist/lib/isin.js +36 -0
  220. package/dist/lib/isin.js.map +1 -0
  221. package/dist/lib/phone.d.ts +69 -0
  222. package/dist/lib/phone.js +121 -0
  223. package/dist/lib/phone.js.map +1 -0
  224. package/dist/lib/table-text.d.ts +109 -1
  225. package/dist/lib/table-text.js +122 -1
  226. package/dist/lib/table-text.js.map +1 -1
  227. package/dist/rhf/fields.d.ts +233 -18
  228. package/dist/rhf/fields.js +456 -3
  229. package/dist/rhf/fields.js.map +1 -1
  230. package/dist/rhf/form.d.ts +19 -14
  231. package/dist/rhf.d.ts +22 -15
  232. package/dist/rhf.js.map +1 -1
  233. package/dist/shell/app-shell.d.ts +18 -13
  234. package/dist/shell/top-bar-brand.d.ts +19 -14
  235. package/dist/shell/topbar-action-menu.d.ts +36 -3
  236. package/dist/shell/topbar-action-menu.js +74 -33
  237. package/dist/shell/topbar-action-menu.js.map +1 -1
  238. package/dist/shell.d.ts +18 -13
  239. package/dist/table-text.d.ts +1 -1
  240. package/dist/tour/tour.js +20 -24
  241. package/dist/tour/tour.js.map +1 -1
  242. package/dist/wizard/stepper-nav.d.ts +49 -16
  243. package/dist/wizard/stepper-nav.js +4 -0
  244. package/dist/wizard/stepper-nav.js.map +1 -1
  245. package/dist/wizard.d.ts +19 -14
  246. package/package.json +1 -1
  247. package/src/components/account-chips.tsx +17 -3
  248. package/src/components/account-settings.tsx +92 -26
  249. package/src/components/amount-input.tsx +68 -56
  250. package/src/components/autocomplete.tsx +198 -114
  251. package/src/components/checkbox-group.tsx +229 -0
  252. package/src/components/checkbox.tsx +72 -8
  253. package/src/components/chip.tsx +80 -10
  254. package/src/components/column-mapper.tsx +666 -0
  255. package/src/components/combobox-core.tsx +82 -9
  256. package/src/components/combobox.tsx +661 -340
  257. package/src/components/confirm-dialog.tsx +12 -8
  258. package/src/components/country-select.tsx +556 -0
  259. package/src/components/currency-select.tsx +109 -33
  260. package/src/components/danger-confirm.tsx +429 -82
  261. package/src/components/data-table-labels.ts +16 -1
  262. package/src/components/data-table.tsx +175 -6
  263. package/src/components/date-picker.tsx +595 -71
  264. package/src/components/entity-combobox.tsx +235 -124
  265. package/src/components/field-parts.tsx +403 -0
  266. package/src/components/field-strip.tsx +149 -0
  267. package/src/components/file-button.tsx +36 -3
  268. package/src/components/file-dropzone.tsx +106 -38
  269. package/src/components/form-actions.tsx +147 -6
  270. package/src/components/iban-input.tsx +231 -0
  271. package/src/components/icon-picker.tsx +47 -6
  272. package/src/components/inline-edit-field.tsx +533 -0
  273. package/src/components/language-select.tsx +78 -0
  274. package/src/components/line-items.tsx +35 -2
  275. package/src/components/list.tsx +55 -6
  276. package/src/components/money-field.tsx +13 -0
  277. package/src/components/month-picker.tsx +400 -63
  278. package/src/components/multi-entity-combobox.tsx +207 -120
  279. package/src/components/multi-select.tsx +80 -58
  280. package/src/components/number-field.tsx +28 -46
  281. package/src/components/number-input.tsx +210 -43
  282. package/src/components/one-time-code-input.tsx +288 -0
  283. package/src/components/phone-input.tsx +299 -0
  284. package/src/components/reauth-dialog.tsx +17 -18
  285. package/src/components/sign-chip.tsx +103 -0
  286. package/src/components/swatch-picker.tsx +143 -31
  287. package/src/components/switch.tsx +58 -7
  288. package/src/components/tile-radio.tsx +145 -29
  289. package/src/components/time-input.tsx +8 -1
  290. package/src/components/toggle-group.tsx +206 -73
  291. package/src/components/trigger-aria.ts +5 -0
  292. package/src/components/ui.tsx +479 -138
  293. package/src/data-table.ts +2 -1
  294. package/src/feedback/feedback-attachment.tsx +597 -46
  295. package/src/feedback/feedback-dialog.tsx +9 -3
  296. package/src/feedback/feedback-inbox.tsx +3 -2
  297. package/src/feedback/feedback-thread.tsx +113 -9
  298. package/src/i18n/defaults.ts +18 -1
  299. package/src/i18n/german.ts +89 -0
  300. package/src/i18n/kit-labels.tsx +82 -2
  301. package/src/i18n/locales/en.ts +36 -4
  302. package/src/i18n/locales/es.ts +87 -0
  303. package/src/i18n/locales/fr.ts +87 -0
  304. package/src/i18n/locales/hu.ts +83 -0
  305. package/src/i18n/locales/it.ts +88 -0
  306. package/src/i18n/locales/zh.ts +76 -0
  307. package/src/i18n/review.ts +26 -0
  308. package/src/index.ts +71 -3
  309. package/src/lib/column-mapping.ts +234 -0
  310. package/src/lib/countries.ts +91 -0
  311. package/src/lib/decimal-marks.ts +99 -0
  312. package/src/lib/iban.ts +171 -0
  313. package/src/lib/isin.ts +62 -0
  314. package/src/lib/phone.ts +211 -0
  315. package/src/lib/table-text.ts +271 -0
  316. package/src/rhf/fields.tsx +860 -9
  317. package/src/rhf.ts +3 -1
  318. package/src/shell/topbar-action-menu.tsx +134 -38
  319. package/src/tour/tour.tsx +66 -28
  320. package/src/wizard/stepper-nav.tsx +35 -1
@@ -6,6 +6,7 @@ function splitTriggerAria(props) {
6
6
  "aria-labelledby": labelledBy,
7
7
  "aria-describedby": describedBy,
8
8
  "aria-invalid": invalid,
9
+ "aria-required": required,
9
10
  ...rest
10
11
  } = props;
11
12
  return [
@@ -14,7 +15,8 @@ function splitTriggerAria(props) {
14
15
  "aria-label": label,
15
16
  "aria-labelledby": labelledBy,
16
17
  "aria-describedby": describedBy,
17
- "aria-invalid": invalid
18
+ "aria-invalid": invalid,
19
+ "aria-required": required
18
20
  },
19
21
  rest
20
22
  ];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/trigger-aria.ts"],"sourcesContent":["// Internal — not re-exported from the barrel. Shared by the pickers whose trigger is\n// a `role=\"combobox\"` button inside a wrapper: DatePicker, DateRangePicker, MonthPicker.\n\n/**\n * The attributes that NAME or DESCRIBE a field, which belong on its trigger — the\n * element a `<label htmlFor>`, a form library's control slot or an error message has\n * to reach. They used to land on the wrapper `<div>` with the rest of the caller's\n * props, so an external label named nothing and a form library's `aria-describedby`\n * pointed a screen reader at an element with no role (kastlan, 0.5.0).\n */\nexport interface TriggerAria {\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\";\n}\n\n/** Split a field's props into what its trigger takes and what its wrapper takes. */\nexport function splitTriggerAria<T extends TriggerAria>(\n props: T,\n): [TriggerAria, Omit<T, keyof TriggerAria>] {\n const {\n id,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n ...rest\n } = props;\n return [\n {\n id,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n },\n rest,\n ];\n}\n\n"],"mappings":";AAmBO,SAAS,iBACd,OAC2C;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,GAAG;AAAA,EACL,IAAI;AACJ,SAAO;AAAA,IACL;AAAA,MACE;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,gBAAgB;AAAA,IAClB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/components/trigger-aria.ts"],"sourcesContent":["// Internal — not re-exported from the barrel. Shared by the pickers whose trigger is\n// a `role=\"combobox\"` button inside a wrapper: DatePicker, DateRangePicker, MonthPicker.\n\n/**\n * The attributes that NAME or DESCRIBE a field, which belong on its trigger — the\n * element a `<label htmlFor>`, a form library's control slot or an error message has\n * to reach. They used to land on the wrapper `<div>` with the rest of the caller's\n * props, so an external label named nothing and a form library's `aria-describedby`\n * pointed a screen reader at an element with no role (kastlan, 0.5.0).\n */\nexport interface TriggerAria {\n id?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\";\n /** 0.23.0: a form library's `required` (RhfMonthPicker) is announced on the trigger,\n * not lost on the wrapper. */\n \"aria-required\"?: boolean | \"true\" | \"false\";\n}\n\n/** Split a field's props into what its trigger takes and what its wrapper takes. */\nexport function splitTriggerAria<T extends TriggerAria>(\n props: T,\n): [TriggerAria, Omit<T, keyof TriggerAria>] {\n const {\n id,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n \"aria-required\": required,\n ...rest\n } = props;\n return [\n {\n id,\n \"aria-label\": label,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n \"aria-required\": required,\n },\n rest,\n ];\n}\n\n"],"mappings":";AAsBO,SAAS,iBACd,OAC2C;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,GAAG;AAAA,EACL,IAAI;AACJ,SAAO;AAAA,IACL;AAAA,MACE;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,14 +1,19 @@
1
1
  import 'react';
2
2
  import './tooltip.js';
3
- export { B as Button, a as ButtonClassesOptions, b as ButtonLinkProps, c as ButtonProps, d as ButtonSize, e as ButtonTone, f as ButtonVariant, g as Card, h as CardAction, i as CardActionProps, j as CardContent, k as CardContentProps, l as CardDensity, m as CardDescription, n as CardDescriptionProps, o as CardFooter, p as CardFooterProps, q as CardHeader, r as CardHeaderProps, s as CardProps, t as CardTitle, u as CardTitleLevel, v as CardTitleProps, w as CardTone, S as DEFAULT_PASSWORD_REVEAL_LABELS, W as DEFAULT_TABS_LABELS, Z as EmptyState, _ as EmptyStateProps, $ as FIELD_BASE, a0 as FIELD_DISPLAY, a1 as FIELD_FLOATING_PAD, a2 as FIELD_INVALID, a3 as FIELD_TRIGGER, a4 as FIELD_WRITABLE_LOOK, a5 as FLOATING_INPUT_CLASS, a6 as FLOATING_LABEL_CLASS, a7 as FLOATING_LABEL_STATIC, a8 as FieldChevron, a9 as FieldChevronProps, aa as FieldHint, ab as FieldHintProps, ac as FieldLabel, ad as FieldLabelProps, al as FloatingField, am as FloatingFieldProps, av as IconButton, aw as IconButtonGlyphSize, ax as IconButtonLinkProps, ay as IconButtonProps, az as IconButtonSize, aA as IconButtonTone, aB as IconButtonToneColor, aC as IconButtonVariant, aD as Input, aE as InputProps, aH as Label, aJ as LabelProps, aL as PHONE_QUERY, aM as PasswordRevealLabels, aP as Select, aQ as SelectProps, b1 as Spinner, b2 as SpinnerProps, b4 as TabItem, b5 as Tabs, b6 as TabsLabels, b7 as TabsProps, b8 as Textarea, b9 as TextareaProps, bh as buttonClasses, bl as resolvePasswordRevealLabels } from '../kit-labels-D1J2_jyD.js';
3
+ export { B as Button, a as ButtonClassesOptions, b as ButtonLinkProps, c as ButtonProps, d as ButtonSize, e as ButtonTone, f as ButtonVariant, g as Card, h as CardAction, i as CardActionProps, j as CardContent, k as CardContentProps, l as CardDensity, m as CardDescription, n as CardDescriptionProps, o as CardFooter, p as CardFooterProps, q as CardHeader, r as CardHeaderProps, s as CardProps, t as CardTitle, u as CardTitleLevel, v as CardTitleProps, w as CardTone, x as CharacterCountLabels, X as DEFAULT_CHARACTER_COUNT_LABELS, aa as DEFAULT_PASSWORD_REVEAL_LABELS, af as DEFAULT_TABS_LABELS, an as EmptyState, ao as EmptyStateProps, ap as FIELD_BASE, aq as FIELD_DISPLAY, ar as FIELD_FLOATING_PAD, as as FIELD_INVALID, at as FIELD_TRIGGER, au as FIELD_WRITABLE_LOOK, av as FLOATING_INPUT_CLASS, aw as FLOATING_LABEL_CLASS, aJ as FieldChevron, aK as FieldChevronProps, aL as FieldHint, aM as FieldHintProps, aU as FloatingField, aV as FloatingFieldProps, b6 as IconButton, b7 as IconButtonGlyphSize, b8 as IconButtonLinkProps, b9 as IconButtonProps, ba as IconButtonSize, bb as IconButtonTone, bc as IconButtonToneColor, bd as IconButtonVariant, be as Input, bf as InputProps, bk as Label, bm as LabelProps, bo as PHONE_QUERY, bp as PasswordRevealLabels, bv as Select, bw as SelectProps, bJ as Spinner, bK as SpinnerProps, bM as TabItem, bN as Tabs, bO as TabsLabels, bP as TabsProps, bQ as Textarea, bR as TextareaProps, c1 as buttonClasses, c5 as resolvePasswordRevealLabels } from '../feedback-BxeQVzwq.js';
4
+ export { FLOATING_LABEL_STATIC, FieldLabel, FieldLabelProps } from './field-parts.js';
4
5
  import '../hooks/use-anchored-rect.js';
5
6
  import '../lib/clipping.js';
6
- import './data-table-labels.js';
7
+ import '../feedback-attachment-fGAzZPf0.js';
8
+ import '../feedback/feedback-inbox.js';
9
+ import 'lucide-react';
10
+ import '../data-table-labels-B7OdnM0S.js';
11
+ import './data-table-sort.js';
12
+ import './swipeable-row.js';
7
13
  import './mini-calendar.js';
8
14
  import './calendar-heatmap.js';
9
15
  import './popover.js';
10
16
  import './chip.js';
11
- import 'lucide-react';
12
17
  import './field-sync.js';
13
18
  import '../wizard/types.js';
14
19
  import '../tour/tour.js';
@@ -23,7 +28,6 @@ import './sparkline.js';
23
28
  import './stat-tile.js';
24
29
  import './signature-pad.js';
25
30
  import './password-strength.js';
26
- import './danger-confirm.js';
27
31
  import './swatch-picker.js';
28
32
  import './tile-radio.js';
29
33
  import './icon-picker.js';
@@ -31,11 +35,7 @@ import './dialog-frame.js';
31
35
  import './modal.js';
32
36
  import '../hooks/use-search-param-state.js';
33
37
  import './measured-grid.js';
34
- import '../feedback-attachment-WFiXJ8We.js';
35
- import '../feedback/feedback-thread.js';
36
- import '../feedback/feedback-inbox.js';
37
38
  import './account-settings-labels.js';
38
- import './confirm-dialog.js';
39
39
  import './floating-panel.js';
40
40
  import './bulk-action-bar.js';
41
41
  import './list.js';
@@ -54,11 +54,16 @@ import './write-lock.js';
54
54
  import './legal.js';
55
55
  import './account-chips.js';
56
56
  import '../lib/format.js';
57
- import '../data-table-3mi2R3so.js';
58
- import './data-table-sort.js';
59
- import './swipeable-row.js';
60
57
  import './reauth-dialog.js';
61
58
  import './server-wake.js';
62
59
  import '../lib/server-wake.js';
63
60
  import './translation-review-labels.js';
64
61
  import '../lib/translation-review.js';
62
+ import './country-select.js';
63
+ import './inline-edit-field.js';
64
+ import '../lib/iban.js';
65
+ import '../lib/phone.js';
66
+ import './sign-chip.js';
67
+ import './column-mapper.js';
68
+ import '../lib/column-mapping.js';
69
+ import '../lib/table-text.js';
@@ -10,6 +10,17 @@ import { Tooltip } from "./tooltip.js";
10
10
  import { DEFAULT_COMMON_LABELS, useKitLabels, useKitLink } from "../i18n/kit-labels.js";
11
11
  import { pickLinkRenderer, replacingClick, routerLinkNavigation } from "./text-link.js";
12
12
  import { useCommitReason } from "./write-lock.js";
13
+ import { mergeDescribedBy } from "./choice-parts.js";
14
+ import {
15
+ EndHintRow,
16
+ FieldCaption,
17
+ LockedReason,
18
+ useFieldHint,
19
+ useLockReason,
20
+ FLOATING_LABEL_STATIC,
21
+ STATIC_LABEL_TYPE
22
+ } from "./field-parts.js";
23
+ import { FieldLabel, FLOATING_LABEL_STATIC as FLOATING_LABEL_STATIC2 } from "./field-parts.js";
13
24
  const BUTTON_BASE = "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 disabled:opacity-50 disabled:cursor-not-allowed";
14
25
  const BUTTON_SIZES = {
15
26
  md: "gap-2 px-3 py-2 text-sm",
@@ -640,12 +651,6 @@ const FLOATING_ROW_CLASS = cn(
640
651
  "peer-[:not(:placeholder-shown)]:top-1 peer-[:not(:placeholder-shown)]:text-[11px] peer-[:not(:placeholder-shown)]:leading-tight peer-[:not(:placeholder-shown)]:text-[var(--text-secondary)]",
641
652
  "peer-disabled:opacity-50"
642
653
  );
643
- const STATIC_LABEL_TYPE = "text-[11px] leading-tight text-[var(--text-muted)] peer-disabled:opacity-50";
644
- const FLOATING_LABEL_STATIC = cn(
645
- "pointer-events-none absolute start-3 top-1",
646
- STATIC_LABEL_TYPE,
647
- "max-w-[calc(100%-1.5rem)] truncate"
648
- );
649
654
  function FloatingField({
650
655
  className,
651
656
  htmlFor,
@@ -715,9 +720,6 @@ function FieldHint({
715
720
  }
716
721
  ) });
717
722
  }
718
- function FieldLabel({ children, className, ...rest }) {
719
- return /* @__PURE__ */ jsx("span", { ...rest, className: cn(FLOATING_LABEL_STATIC, "z-10", className), children });
720
- }
721
723
  function Label({ required, size = "md", disabled, className, children, ...rest }) {
722
724
  return /* @__PURE__ */ jsxs(
723
725
  "label",
@@ -766,7 +768,77 @@ function resolvePasswordRevealLabels(partial) {
766
768
  if (!partial) return DEFAULT_PASSWORD_REVEAL_LABELS;
767
769
  return { ...DEFAULT_PASSWORD_REVEAL_LABELS, ...partial };
768
770
  }
771
+ const DEFAULT_CHARACTER_COUNT_LABELS = {
772
+ count: (used, max) => `${used} of ${max} characters`,
773
+ remaining: (left) => left === 1 ? "1 character left" : `${left} characters left`,
774
+ limitReached: "Character limit reached"
775
+ };
776
+ function textLength(value) {
777
+ return value === void 0 || value === null ? 0 : String(value).length;
778
+ }
779
+ function useTypedLength(value, defaultValue) {
780
+ const [typed, setTyped] = useState(() => textLength(defaultValue));
781
+ return { used: value !== void 0 ? textLength(value) : typed, track: (text) => setTyped(text.length) };
782
+ }
783
+ function nearLimitAt(max) {
784
+ return Math.min(20, Math.max(1, Math.ceil(max * 0.1)));
785
+ }
786
+ function countZone(used, max) {
787
+ if (used >= max) return "limit";
788
+ return max - used <= nearLimitAt(max) ? "near" : "ok";
789
+ }
790
+ function CharacterCount({
791
+ id,
792
+ used,
793
+ max,
794
+ labels,
795
+ caption
796
+ }) {
797
+ const zone = countZone(used, max);
798
+ const [said, setSaid] = useState({ zone, text: "" });
799
+ if (said.zone !== zone) {
800
+ setSaid({
801
+ zone,
802
+ text: zone === "near" ? labels.remaining(max - used) : zone === "limit" ? labels.limitReached : ""
803
+ });
804
+ }
805
+ return (
806
+ // `relative` holds the sr-only region (see sr-only-containment.test).
807
+ /* @__PURE__ */ jsxs("div", { className: "relative mt-1 flex items-start gap-2", children: [
808
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: caption }),
809
+ /* @__PURE__ */ jsxs(
810
+ "span",
811
+ {
812
+ "aria-hidden": true,
813
+ className: cn(
814
+ "shrink-0 text-[11px] leading-tight tabular-nums",
815
+ zone === "limit" ? "text-[var(--danger)]" : zone === "near" ? "text-[var(--warning)]" : "text-[var(--text-muted)]"
816
+ ),
817
+ children: [
818
+ used,
819
+ "/",
820
+ max
821
+ ]
822
+ }
823
+ ),
824
+ /* @__PURE__ */ jsx("span", { id, hidden: true, children: labels.count(used, max) }),
825
+ /* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: said.text })
826
+ ] })
827
+ );
828
+ }
829
+ function fieldBelow(hint, counter, errorEl) {
830
+ if (counter === null && hint.captionText === void 0 && errorEl === null) return null;
831
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
832
+ counter ?? /* @__PURE__ */ jsx(FieldCaption, { parts: hint }),
833
+ errorEl
834
+ ] });
835
+ }
836
+ const FLOATING_PLACEHOLDER_ON_FOCUS = "focus:placeholder:text-[var(--text-placeholder)]";
837
+ const hasPlaceholderText = (placeholder) => placeholder !== void 0 && placeholder.trim() !== "";
769
838
  const PICKER_TYPES = /* @__PURE__ */ new Set(["date", "datetime-local", "month", "time", "week"]);
839
+ function useCharacterCountLabels(prop) {
840
+ return useKitLabels("characterCount", DEFAULT_CHARACTER_COUNT_LABELS, prop);
841
+ }
770
842
  const Input = forwardRef(function Input2(props, ref) {
771
843
  const {
772
844
  className,
@@ -778,18 +850,43 @@ const Input = forwardRef(function Input2(props, ref) {
778
850
  variant = "field",
779
851
  invalid,
780
852
  error,
853
+ hint,
854
+ showCount,
855
+ countLabels,
781
856
  passwordLabels,
782
857
  ...rest
783
858
  } = props;
784
- const reserve = "error" in props;
859
+ const reserve = "error" in props || "hint" in props || "showCount" in props;
785
860
  const generated = useId();
786
861
  const fieldId = id ?? generated;
862
+ const countId = useId();
863
+ const hintParts = useFieldHint(hint, rest["aria-describedby"]);
864
+ const maxLength = rest.maxLength;
865
+ const counting = Boolean(showCount) && typeof maxLength === "number" && maxLength > 0;
866
+ const length = useTypedLength(rest.value, rest.defaultValue);
867
+ const countText = useCharacterCountLabels(countLabels);
787
868
  const { isInvalid, describedBy, errorEl } = useFieldError(
788
869
  error,
789
870
  invalid,
790
- rest["aria-describedby"],
871
+ // Caller's, caption, count — then the error, appended by the hook.
872
+ mergeDescribedBy(hintParts.describedBy, counting && countId),
791
873
  rest["aria-invalid"]
792
874
  );
875
+ const counter = counting ? /* @__PURE__ */ jsx(
876
+ CharacterCount,
877
+ {
878
+ id: countId,
879
+ used: length.used,
880
+ max: maxLength,
881
+ labels: countText,
882
+ caption: /* @__PURE__ */ jsx(FieldCaption, { parts: hintParts, className: "mt-0" })
883
+ }
884
+ ) : null;
885
+ const below = fieldBelow(hintParts, counter, errorEl);
886
+ const onChange = counting ? (e) => {
887
+ length.track(e.target.value);
888
+ rest.onChange?.(e);
889
+ } : rest.onChange;
793
890
  const asDisplay = useMediaQuery(PHONE_QUERY, false) && variant === "display";
794
891
  const isPassword = type === "password";
795
892
  const [revealed, setRevealed] = useState(false);
@@ -815,8 +912,10 @@ const Input = forwardRef(function Input2(props, ref) {
815
912
  }
816
913
  ) : null;
817
914
  if (label === void 0) {
915
+ const endHint = hintParts.labelHint;
916
+ const ownClass = endHint === void 0 ? className : void 0;
818
917
  if (!isPassword) {
819
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(
918
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsx(EndHintRow, { hint: endHint, className, children: /* @__PURE__ */ jsx(
820
919
  "input",
821
920
  {
822
921
  ref,
@@ -827,11 +926,12 @@ const Input = forwardRef(function Input2(props, ref) {
827
926
  "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
828
927
  "aria-describedby": describedBy,
829
928
  onClick: handleClick,
830
- className: cn(FIELD_BASE, className, inputClassName, isInvalid && FIELD_INVALID)
929
+ onChange,
930
+ className: cn(FIELD_BASE, ownClass, inputClassName, isInvalid && FIELD_INVALID)
831
931
  }
832
- ) });
932
+ ) }) });
833
933
  }
834
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
934
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsx(EndHintRow, { hint: endHint, className, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", ownClass), children: [
835
935
  /* @__PURE__ */ jsx(
836
936
  "input",
837
937
  {
@@ -842,41 +942,74 @@ const Input = forwardRef(function Input2(props, ref) {
842
942
  ...rest,
843
943
  "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
844
944
  "aria-describedby": describedBy,
945
+ onChange,
845
946
  className: cn(FIELD_BASE, "pe-9", inputClassName, isInvalid && FIELD_INVALID)
846
947
  }
847
948
  ),
848
949
  revealToggle
849
- ] }) });
950
+ ] }) }) });
850
951
  }
851
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, srOnlyLabel: asDisplay, children: [
852
- /* @__PURE__ */ jsx(
853
- "input",
854
- {
855
- ref,
856
- id: fieldId,
857
- type: effectiveType,
858
- placeholder: asDisplay ? placeholder ?? (typeof label === "string" ? label : " ") : " ",
859
- ...rest,
860
- "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
861
- "aria-describedby": describedBy,
862
- onClick: handleClick,
863
- className: cn(
864
- asDisplay ? cn(FIELD_DISPLAY, "text-xl font-semibold leading-snug") : FLOATING_INPUT_CLASS,
865
- isPassword && "pe-9",
866
- inputClassName,
867
- isInvalid && FIELD_INVALID
868
- )
869
- }
870
- ),
871
- revealToggle
872
- ] }) });
952
+ const ownPlaceholder = hasPlaceholderText(placeholder);
953
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs(
954
+ FloatingField,
955
+ {
956
+ className,
957
+ htmlFor: fieldId,
958
+ label,
959
+ srOnlyLabel: asDisplay,
960
+ hint: hintParts.labelHint,
961
+ children: [
962
+ /* @__PURE__ */ jsx(
963
+ "input",
964
+ {
965
+ ref,
966
+ id: fieldId,
967
+ type: effectiveType,
968
+ placeholder: asDisplay ? placeholder ?? (typeof label === "string" ? label : " ") : ownPlaceholder ? placeholder : " ",
969
+ ...rest,
970
+ "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
971
+ "aria-describedby": describedBy,
972
+ onClick: handleClick,
973
+ onChange,
974
+ className: cn(
975
+ asDisplay ? cn(FIELD_DISPLAY, "text-xl font-semibold leading-snug") : cn(FLOATING_INPUT_CLASS, ownPlaceholder && FLOATING_PLACEHOLDER_ON_FOCUS),
976
+ isPassword && "pe-9",
977
+ inputClassName,
978
+ isInvalid && FIELD_INVALID
979
+ )
980
+ }
981
+ ),
982
+ revealToggle
983
+ ]
984
+ }
985
+ ) });
873
986
  });
874
987
  Input.displayName = "Input";
875
988
  const SELECT_SM = "h-7 py-0 ps-2 pe-7 text-xs";
989
+ const LOCKED_SELECT_KEYS = /* @__PURE__ */ new Set(["Tab", "Escape", "Shift"]);
990
+ const FIELD_LOCKED = "cursor-not-allowed bg-[var(--bg-surface-2)] text-[var(--text-muted)]";
876
991
  const Select = forwardRef(function Select2(props, ref) {
877
- const { className, label, id, children, invalid, error, hint, size, selectClassName, ...rest } = props;
878
- const reserve = "error" in props;
992
+ const {
993
+ className,
994
+ label,
995
+ id,
996
+ children,
997
+ invalid,
998
+ error,
999
+ hint,
1000
+ size,
1001
+ selectClassName,
1002
+ disabledReason,
1003
+ commit,
1004
+ onMouseDown,
1005
+ onKeyDown,
1006
+ onChange,
1007
+ ...rest
1008
+ } = props;
1009
+ const reserve = "error" in props || "hint" in props || "showCount" in props;
879
1010
  const generated = useId();
1011
+ const lock = useLockReason(commit, disabledReason);
1012
+ const locked = lock.locked;
880
1013
  const nativeSize = typeof size === "number" ? size : void 0;
881
1014
  const listBox = nativeSize !== void 0 && nativeSize > 1 || Boolean(rest.multiple);
882
1015
  const small = size === "sm" && label === void 0;
@@ -887,16 +1020,29 @@ const Select = forwardRef(function Select2(props, ref) {
887
1020
  error,
888
1021
  invalid,
889
1022
  // The caption goes in BEFORE the error — the standing advice first, the news
890
- // second, the order useFieldError keeps for a caller's own description.
891
- textHint ? rest["aria-describedby"] ? `${rest["aria-describedby"]} ${hintId}` : hintId : rest["aria-describedby"],
1023
+ // second, the order useFieldError keeps for a caller's own description. A lock's
1024
+ // reason sits between the two.
1025
+ mergeDescribedBy(rest["aria-describedby"], textHint && hintId, locked && lock.reasonId),
892
1026
  rest["aria-invalid"]
893
1027
  );
894
1028
  const below = textHint || errorEl !== null ? /* @__PURE__ */ jsxs(Fragment, { children: [
895
1029
  textHint && /* @__PURE__ */ jsx("p", { id: hintId, className: "mt-1 text-[11px] leading-tight text-[var(--text-muted)]", children: hint }),
896
1030
  errorEl
897
1031
  ] }) : null;
898
- const chevron = rest.disabled || listBox ? null : /* @__PURE__ */ jsx(FieldChevron, { className: small ? "end-1.5 size-3.5" : void 0 });
1032
+ const chevron = rest.disabled || listBox || locked ? null : /* @__PURE__ */ jsx(FieldChevron, { className: small ? "end-1.5 size-3.5" : void 0 });
899
1033
  const dress = listBox ? "overflow-y-auto [&_option]:py-1" : "appearance-none pe-9";
1034
+ const interaction = locked ? {
1035
+ disabled: void 0,
1036
+ "aria-disabled": true,
1037
+ onMouseDown: (e) => e.preventDefault(),
1038
+ onKeyDown: (e) => {
1039
+ if (!LOCKED_SELECT_KEYS.has(e.key) && !e.ctrlKey && !e.metaKey) e.preventDefault();
1040
+ },
1041
+ onChange: () => {
1042
+ }
1043
+ } : { onMouseDown, onKeyDown, onChange };
1044
+ const boxClass = locked ? void 0 : className;
1045
+ const withReason = (box) => locked ? /* @__PURE__ */ jsx(LockedReason, { lock, className: cn("block", className), children: box }) : box;
900
1046
  if (label === void 0) {
901
1047
  const select = /* @__PURE__ */ jsx(
902
1048
  "select",
@@ -905,6 +1051,7 @@ const Select = forwardRef(function Select2(props, ref) {
905
1051
  id,
906
1052
  size: nativeSize,
907
1053
  ...rest,
1054
+ ...interaction,
908
1055
  "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
909
1056
  "aria-describedby": describedBy,
910
1057
  className: cn(
@@ -912,6 +1059,7 @@ const Select = forwardRef(function Select2(props, ref) {
912
1059
  dress,
913
1060
  listBox && "py-0",
914
1061
  small && SELECT_SM,
1062
+ locked && FIELD_LOCKED,
915
1063
  selectClassName,
916
1064
  isInvalid && FIELD_INVALID
917
1065
  ),
@@ -919,60 +1067,100 @@ const Select = forwardRef(function Select2(props, ref) {
919
1067
  }
920
1068
  );
921
1069
  if (hasContent(hint) && !textHint) {
922
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1.5", className), children: [
923
- /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
924
- select,
925
- chevron
926
- ] }),
927
- /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: hint })
928
- ] }) });
1070
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: withReason(
1071
+ /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1.5", boxClass), children: [
1072
+ /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
1073
+ select,
1074
+ chevron
1075
+ ] }),
1076
+ /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: hint })
1077
+ ] })
1078
+ ) });
929
1079
  }
930
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
931
- select,
932
- chevron
933
- ] }) });
1080
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: withReason(
1081
+ /* @__PURE__ */ jsxs("div", { className: cn("relative", boxClass), children: [
1082
+ select,
1083
+ chevron
1084
+ ] })
1085
+ ) });
934
1086
  }
935
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsxs(FloatingField, { className, htmlFor: fieldId, label, staticLabel: true, hint: textHint ? void 0 : hint, children: [
936
- /* @__PURE__ */ jsx(
937
- "select",
1087
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: withReason(
1088
+ /* @__PURE__ */ jsxs(
1089
+ FloatingField,
938
1090
  {
939
- ref,
940
- id: fieldId,
941
- size: nativeSize,
942
- ...rest,
943
- "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
944
- "aria-describedby": describedBy,
945
- className: cn(
946
- FIELD_BASE,
947
- // The floated label takes the top strip of a list box too, so its first
948
- // row starts under the label rather than behind it. No bottom padding — see
949
- // `dress`.
950
- listBox ? "pt-5 pb-0" : FIELD_FLOATING_PAD,
951
- "peer",
952
- dress,
953
- selectClassName,
954
- isInvalid && FIELD_INVALID
955
- ),
956
- children
1091
+ className: boxClass,
1092
+ htmlFor: fieldId,
1093
+ label,
1094
+ staticLabel: true,
1095
+ hint: textHint ? void 0 : hint,
1096
+ children: [
1097
+ /* @__PURE__ */ jsx(
1098
+ "select",
1099
+ {
1100
+ ref,
1101
+ id: fieldId,
1102
+ size: nativeSize,
1103
+ ...rest,
1104
+ ...interaction,
1105
+ "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
1106
+ "aria-describedby": describedBy,
1107
+ className: cn(
1108
+ FIELD_BASE,
1109
+ // The floated label takes the top strip of a list box too, so its first
1110
+ // row starts under the label rather than behind it. No bottom padding — see
1111
+ // `dress`.
1112
+ listBox ? "pt-5 pb-0" : FIELD_FLOATING_PAD,
1113
+ "peer",
1114
+ dress,
1115
+ locked && FIELD_LOCKED,
1116
+ selectClassName,
1117
+ isInvalid && FIELD_INVALID
1118
+ ),
1119
+ children
1120
+ }
1121
+ ),
1122
+ chevron
1123
+ ]
957
1124
  }
958
- ),
959
- chevron
960
- ] }) });
1125
+ )
1126
+ ) });
961
1127
  });
962
1128
  Select.displayName = "Select";
963
1129
  const Textarea = forwardRef(function Textarea2(props, ref) {
964
- const { className, label, id, placeholder, invalid, error, ...rest } = props;
965
- const reserve = "error" in props;
1130
+ const { className, label, id, placeholder, invalid, error, hint, showCount, countLabels, ...rest } = props;
1131
+ const reserve = "error" in props || "hint" in props || "showCount" in props;
966
1132
  const generated = useId();
967
1133
  const fieldId = id ?? generated;
1134
+ const countId = useId();
1135
+ const hintParts = useFieldHint(hint, rest["aria-describedby"]);
1136
+ const maxLength = rest.maxLength;
1137
+ const counting = Boolean(showCount) && typeof maxLength === "number" && maxLength > 0;
1138
+ const length = useTypedLength(rest.value, rest.defaultValue);
1139
+ const countText = useCharacterCountLabels(countLabels);
968
1140
  const { isInvalid, describedBy, errorEl } = useFieldError(
969
1141
  error,
970
1142
  invalid,
971
- rest["aria-describedby"],
1143
+ mergeDescribedBy(hintParts.describedBy, counting && countId),
972
1144
  rest["aria-invalid"]
973
1145
  );
1146
+ const counter = counting ? /* @__PURE__ */ jsx(
1147
+ CharacterCount,
1148
+ {
1149
+ id: countId,
1150
+ used: length.used,
1151
+ max: maxLength,
1152
+ labels: countText,
1153
+ caption: /* @__PURE__ */ jsx(FieldCaption, { parts: hintParts, className: "mt-0" })
1154
+ }
1155
+ ) : null;
1156
+ const below = fieldBelow(hintParts, counter, errorEl);
1157
+ const onChange = counting ? (e) => {
1158
+ length.track(e.target.value);
1159
+ rest.onChange?.(e);
1160
+ } : rest.onChange;
974
1161
  if (label === void 0) {
975
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(
1162
+ const endHint = hintParts.labelHint;
1163
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsx(EndHintRow, { hint: endHint, className, children: /* @__PURE__ */ jsx(
976
1164
  "textarea",
977
1165
  {
978
1166
  ref,
@@ -981,20 +1169,27 @@ const Textarea = forwardRef(function Textarea2(props, ref) {
981
1169
  ...rest,
982
1170
  "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
983
1171
  "aria-describedby": describedBy,
984
- className: cn(FIELD_BASE, className, isInvalid && FIELD_INVALID)
1172
+ onChange,
1173
+ className: cn(FIELD_BASE, endHint === void 0 && className, isInvalid && FIELD_INVALID)
985
1174
  }
986
- ) });
1175
+ ) }) });
987
1176
  }
988
- return /* @__PURE__ */ jsx(FieldGroup, { errorEl, reserve, children: /* @__PURE__ */ jsx(FloatingField, { className, htmlFor: fieldId, label, children: /* @__PURE__ */ jsx(
1177
+ const ownPlaceholder = hasPlaceholderText(placeholder);
1178
+ return /* @__PURE__ */ jsx(FieldGroup, { errorEl: below, reserve, children: /* @__PURE__ */ jsx(FloatingField, { className, htmlFor: fieldId, label, hint: hintParts.labelHint, children: /* @__PURE__ */ jsx(
989
1179
  "textarea",
990
1180
  {
991
1181
  ref,
992
1182
  id: fieldId,
993
- placeholder: " ",
1183
+ placeholder: ownPlaceholder ? placeholder : " ",
994
1184
  ...rest,
995
1185
  "aria-invalid": isInvalid || rest["aria-invalid"] || void 0,
996
1186
  "aria-describedby": describedBy,
997
- className: cn(FLOATING_INPUT_CLASS, isInvalid && FIELD_INVALID)
1187
+ onChange,
1188
+ className: cn(
1189
+ FLOATING_INPUT_CLASS,
1190
+ ownPlaceholder && FLOATING_PLACEHOLDER_ON_FOCUS,
1191
+ isInvalid && FIELD_INVALID
1192
+ )
998
1193
  }
999
1194
  ) }) });
1000
1195
  });
@@ -1546,6 +1741,7 @@ export {
1546
1741
  CardFooter,
1547
1742
  CardHeader,
1548
1743
  CardTitle,
1744
+ DEFAULT_CHARACTER_COUNT_LABELS,
1549
1745
  DEFAULT_PASSWORD_REVEAL_LABELS,
1550
1746
  DEFAULT_TABS_LABELS,
1551
1747
  EmptyState,
@@ -1557,7 +1753,7 @@ export {
1557
1753
  FIELD_WRITABLE_LOOK,
1558
1754
  FLOATING_INPUT_CLASS,
1559
1755
  FLOATING_LABEL_CLASS,
1560
- FLOATING_LABEL_STATIC,
1756
+ FLOATING_LABEL_STATIC2 as FLOATING_LABEL_STATIC,
1561
1757
  FieldChevron,
1562
1758
  FieldHint,
1563
1759
  FieldLabel,