@redvars/peacock 4.5.0 → 4.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 (252) hide show
  1. package/dist/{BaseField-BbOj212R.js → BaseField-DOCmylob.js} +16 -3
  2. package/dist/BaseField-DOCmylob.js.map +1 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/activation-gate-D4IpmwyD.js +23 -0
  5. package/dist/activation-gate-D4IpmwyD.js.map +1 -0
  6. package/dist/avatar-group.js +2 -1
  7. package/dist/avatar-group.js.map +1 -1
  8. package/dist/avatar.js +3 -0
  9. package/dist/avatar.js.map +1 -1
  10. package/dist/{base-button-BJMGMcMv.js → base-button-9tGu5RSC.js} +30 -10
  11. package/dist/base-button-9tGu5RSC.js.map +1 -0
  12. package/dist/button-group.js +5 -3
  13. package/dist/button-group.js.map +1 -1
  14. package/dist/button.js +12 -16
  15. package/dist/button.js.map +1 -1
  16. package/dist/calendar-column-view.js +4 -4
  17. package/dist/{calendar-drag-IXMPZrTN.js → calendar-drag-DdJwSpEz.js} +2 -2
  18. package/dist/{calendar-drag-IXMPZrTN.js.map → calendar-drag-DdJwSpEz.js.map} +1 -1
  19. package/dist/{calendar-event-BQChlMXy.js → calendar-event-BvbYZHx1.js} +2 -2
  20. package/dist/{calendar-event-BQChlMXy.js.map → calendar-event-BvbYZHx1.js.map} +1 -1
  21. package/dist/calendar-month-view.js +65 -14
  22. package/dist/calendar-month-view.js.map +1 -1
  23. package/dist/calendar-timeline.js +13 -8
  24. package/dist/calendar-timeline.js.map +1 -1
  25. package/dist/calendar.js +21 -6
  26. package/dist/calendar.js.map +1 -1
  27. package/dist/card.js +29 -16
  28. package/dist/card.js.map +1 -1
  29. package/dist/chart-doughnut.js +3 -1
  30. package/dist/chart-doughnut.js.map +1 -1
  31. package/dist/chart-pie.js +9 -1
  32. package/dist/chart-pie.js.map +1 -1
  33. package/dist/chip-set.js +1 -1
  34. package/dist/chip.js +10 -19
  35. package/dist/chip.js.map +1 -1
  36. package/dist/color-field.js +4 -1
  37. package/dist/color-field.js.map +1 -1
  38. package/dist/currency-field.js +4 -1
  39. package/dist/currency-field.js.map +1 -1
  40. package/dist/custom-elements-jsdocs.json +26 -20
  41. package/dist/custom-elements.json +755 -90
  42. package/dist/{datasource-OwvH7SVq.js → datasource-DxEA6jHW.js} +6 -4
  43. package/dist/datasource-DxEA6jHW.js.map +1 -0
  44. package/dist/{date-cfPx3alz.js → date-DPQOY8Zd.js} +2 -2
  45. package/dist/{date-cfPx3alz.js.map → date-DPQOY8Zd.js.map} +1 -1
  46. package/dist/date-field.js +8 -5
  47. package/dist/date-field.js.map +1 -1
  48. package/dist/date-picker.js +2 -2
  49. package/dist/date-range-field.js +8 -5
  50. package/dist/date-range-field.js.map +1 -1
  51. package/dist/datetime-field.js +7 -4
  52. package/dist/datetime-field.js.map +1 -1
  53. package/dist/diagram-controls.js +1 -1
  54. package/dist/{throttle-SQ9t-HL7.js → dispatch-event-utils-DfgqVBK8.js} +2 -24
  55. package/dist/dispatch-event-utils-DfgqVBK8.js.map +1 -0
  56. package/dist/{form-submitter-beG1CXAn.js → dispatch-hooks-J_godlHh.js} +2 -87
  57. package/dist/dispatch-hooks-J_godlHh.js.map +1 -0
  58. package/dist/dropdown-button.js +11 -7
  59. package/dist/dropdown-button.js.map +1 -1
  60. package/dist/{event-manager-KGMT2x2Q.js → event-manager-DYfeN3VE.js} +3 -3
  61. package/dist/{event-manager-KGMT2x2Q.js.map → event-manager-DYfeN3VE.js.map} +1 -1
  62. package/dist/fab.js +15 -19
  63. package/dist/fab.js.map +1 -1
  64. package/dist/filter-bar.js +3 -3
  65. package/dist/form-submission-h40coUI8.js +13 -0
  66. package/dist/form-submission-h40coUI8.js.map +1 -0
  67. package/dist/form-submitter-BIFqZ0wq.js +88 -0
  68. package/dist/form-submitter-BIFqZ0wq.js.map +1 -0
  69. package/dist/form.js +1 -9
  70. package/dist/form.js.map +1 -1
  71. package/dist/icon-button.js +15 -19
  72. package/dist/icon-button.js.map +1 -1
  73. package/dist/icon.js +1 -1
  74. package/dist/implicit-submission-ChLdbxaR.js +100 -0
  75. package/dist/implicit-submission-ChLdbxaR.js.map +1 -0
  76. package/dist/index.js +20 -15
  77. package/dist/index.js.map +1 -1
  78. package/dist/{indicator-navigation-item-CmyhsOmy.js → indicator-navigation-item-BsQE3kUr.js} +2 -2
  79. package/dist/{indicator-navigation-item-CmyhsOmy.js.map → indicator-navigation-item-BsQE3kUr.js.map} +1 -1
  80. package/dist/input.js +13 -4
  81. package/dist/input.js.map +1 -1
  82. package/dist/json-viewer.js +1 -1
  83. package/dist/kanban.js +8 -7
  84. package/dist/kanban.js.map +1 -1
  85. package/dist/link-button.js +13 -14
  86. package/dist/link-button.js.map +1 -1
  87. package/dist/list-item.js +52 -16
  88. package/dist/list-item.js.map +1 -1
  89. package/dist/list.js +5 -3
  90. package/dist/list.js.map +1 -1
  91. package/dist/listbox.js +1 -1
  92. package/dist/loader-full.js +17 -12
  93. package/dist/loader-full.js.map +1 -1
  94. package/dist/loader.js +17 -12
  95. package/dist/loader.js.map +1 -1
  96. package/dist/locale-DEsJZCQG.js.map +1 -1
  97. package/dist/mention-input.js +8 -1
  98. package/dist/mention-input.js.map +1 -1
  99. package/dist/menu-item.js +12 -12
  100. package/dist/menu-item.js.map +1 -1
  101. package/dist/menu.js +7 -3
  102. package/dist/menu.js.map +1 -1
  103. package/dist/navigation-bar-item.js +4 -3
  104. package/dist/navigation-bar-item.js.map +1 -1
  105. package/dist/navigation-bar.js +4 -3
  106. package/dist/navigation-bar.js.map +1 -1
  107. package/dist/navigation-drawer-item.js +3 -2
  108. package/dist/navigation-drawer-item.js.map +1 -1
  109. package/dist/navigation-drawer.js +3 -2
  110. package/dist/navigation-drawer.js.map +1 -1
  111. package/dist/{navigation-item-base-kUrvJgCx.js → navigation-item-base-5ljwtLG_.js} +3 -2
  112. package/dist/{navigation-item-base-kUrvJgCx.js.map → navigation-item-base-5ljwtLG_.js.map} +1 -1
  113. package/dist/navigation-rail-item.js +4 -3
  114. package/dist/navigation-rail-item.js.map +1 -1
  115. package/dist/navigation-rail.js +6 -5
  116. package/dist/navigation-rail.js.map +1 -1
  117. package/dist/number-field.js +4 -1
  118. package/dist/number-field.js.map +1 -1
  119. package/dist/option.js +3 -2
  120. package/dist/option.js.map +1 -1
  121. package/dist/password-field.js +11 -4
  122. package/dist/password-field.js.map +1 -1
  123. package/dist/phone-field.js +4 -1
  124. package/dist/phone-field.js.map +1 -1
  125. package/dist/{picker-field-DmXYPvbF.js → picker-field-BiM3iXAQ.js} +2 -2
  126. package/dist/{picker-field-DmXYPvbF.js.map → picker-field-BiM3iXAQ.js.map} +1 -1
  127. package/dist/pin-input.js +4 -1
  128. package/dist/pin-input.js.map +1 -1
  129. package/dist/{range-utils-DZe96GnO.js → range-utils-vgG1SJ2o.js} +2 -2
  130. package/dist/{range-utils-DZe96GnO.js.map → range-utils-vgG1SJ2o.js.map} +1 -1
  131. package/dist/{roving-focus-controller-fm95JkZJ.js → roving-focus-controller-YtNbxH95.js} +30 -7
  132. package/dist/roving-focus-controller-YtNbxH95.js.map +1 -0
  133. package/dist/search.js +12 -6
  134. package/dist/search.js.map +1 -1
  135. package/dist/select.js +11 -3
  136. package/dist/select.js.map +1 -1
  137. package/dist/shipped-icons.js +1 -1
  138. package/dist/split-button.js +9 -1
  139. package/dist/split-button.js.map +1 -1
  140. package/dist/src/__internal/controllers/roving-focus-controller.d.ts +14 -2
  141. package/dist/src/__internal/implicit-submission.d.ts +25 -0
  142. package/dist/src/__internal/utils/activation-gate.d.ts +8 -0
  143. package/dist/src/__internal/utils/form-submission.d.ts +2 -0
  144. package/dist/src/avatar-group/avatar-group.d.ts +1 -1
  145. package/dist/src/button/base-button/base-button.d.ts +1 -1
  146. package/dist/src/button/button/button.d.ts +2 -1
  147. package/dist/src/button/fab/fab.d.ts +2 -1
  148. package/dist/src/button/icon-button/icon-button.d.ts +2 -1
  149. package/dist/src/button/link-button/link-button.d.ts +5 -1
  150. package/dist/src/calendar/calendar-month-view.d.ts +5 -1
  151. package/dist/src/calendar/calendar.d.ts +6 -1
  152. package/dist/src/card/card.d.ts +19 -9
  153. package/dist/src/chart-pie/chart-pie.d.ts +5 -0
  154. package/dist/src/chip/chip/chip.d.ts +4 -4
  155. package/dist/src/dropdown-button/dropdown-button.d.ts +5 -1
  156. package/dist/src/input/BaseField.d.ts +7 -0
  157. package/dist/src/input/input.d.ts +5 -1
  158. package/dist/src/list/list-item.d.ts +2 -1
  159. package/dist/src/mention-input/mention-input.d.ts +2 -0
  160. package/dist/src/menu/menu-item/menu-item.d.ts +6 -4
  161. package/dist/src/password-field/password-field.d.ts +3 -1
  162. package/dist/src/search/search.d.ts +1 -0
  163. package/dist/src/select/select.d.ts +2 -0
  164. package/dist/src/split-button/split-button.d.ts +6 -1
  165. package/dist/src/stepper/step.d.ts +3 -1
  166. package/dist/src/tabs/tab.d.ts +12 -2
  167. package/dist/src/textarea/textarea.d.ts +2 -0
  168. package/dist/src/toolbar/toolbar.d.ts +13 -2
  169. package/dist/step.js +7 -1
  170. package/dist/step.js.map +1 -1
  171. package/dist/stepper.js +10 -1
  172. package/dist/stepper.js.map +1 -1
  173. package/dist/sub-menu.js +3 -2
  174. package/dist/sub-menu.js.map +1 -1
  175. package/dist/svg.js +1 -1
  176. package/dist/tab-group.js +3 -2
  177. package/dist/tab-group.js.map +1 -1
  178. package/dist/tab.js +17 -12
  179. package/dist/tab.js.map +1 -1
  180. package/dist/tabs.js +3 -2
  181. package/dist/tabs.js.map +1 -1
  182. package/dist/test/accessible-name.test.d.ts +1 -0
  183. package/dist/test/helpers/count-activations.d.ts +9 -0
  184. package/dist/test/navigation-rail.test.d.ts +1 -0
  185. package/dist/test/throttle-delay.test.d.ts +1 -0
  186. package/dist/textarea.js +8 -1
  187. package/dist/textarea.js.map +1 -1
  188. package/dist/throttle-C7ZAPqtu.js +24 -0
  189. package/dist/throttle-C7ZAPqtu.js.map +1 -0
  190. package/dist/time-field.js +7 -4
  191. package/dist/time-field.js.map +1 -1
  192. package/dist/time-picker.js +2 -2
  193. package/dist/toolbar.js +25 -8
  194. package/dist/toolbar.js.map +1 -1
  195. package/dist/tree.js +1 -1
  196. package/dist/tsconfig.tsbuildinfo +1 -1
  197. package/dist/url-field.js +4 -1
  198. package/dist/url-field.js.map +1 -1
  199. package/dist/{utils-DcvLgexs.js → utils-CQzycr9J.js} +2 -1
  200. package/dist/utils-CQzycr9J.js.map +1 -0
  201. package/package.json +2 -1
  202. package/src/__internal/controllers/roving-focus-controller.ts +35 -7
  203. package/src/__internal/i18n/locale.ts +1 -1
  204. package/src/__internal/implicit-submission.ts +102 -0
  205. package/src/__internal/utils/activation-gate.ts +20 -0
  206. package/src/__internal/utils/cache-fetch.ts +6 -3
  207. package/src/__internal/utils/form-submission.ts +11 -0
  208. package/src/avatar/avatar.scss +5 -0
  209. package/src/avatar-group/avatar-group.scss +3 -0
  210. package/src/avatar-group/avatar-group.ts +1 -1
  211. package/src/button/base-button/base-button.ts +41 -16
  212. package/src/button/button/button.ts +5 -16
  213. package/src/button/fab/fab.ts +7 -18
  214. package/src/button/icon-button/icon-button.ts +7 -18
  215. package/src/button/link-button/link-button.ts +8 -15
  216. package/src/calendar/_calendar-header.scss +7 -1
  217. package/src/calendar/calendar-month-view.scss +36 -2
  218. package/src/calendar/calendar-month-view.ts +33 -8
  219. package/src/calendar/calendar.ts +17 -2
  220. package/src/calendar/utils.ts +1 -0
  221. package/src/calendar-timeline/calendar-timeline.scss +15 -5
  222. package/src/card/card.ts +27 -16
  223. package/src/chart-doughnut/chart-doughnut.ts +6 -1
  224. package/src/chart-pie/chart-pie.ts +10 -1
  225. package/src/chip/chip/chip.ts +6 -26
  226. package/src/dropdown-button/dropdown-button.ts +7 -2
  227. package/src/form/form.ts +1 -9
  228. package/src/input/BaseField.ts +17 -0
  229. package/src/input/input.ts +13 -1
  230. package/src/kanban/kanban.scss +11 -7
  231. package/src/list/list-item.scss +5 -0
  232. package/src/list/list-item.ts +44 -16
  233. package/src/mention-input/mention-input.ts +5 -0
  234. package/src/menu/menu/menu.ts +4 -1
  235. package/src/menu/menu-item/menu-item.ts +9 -14
  236. package/src/navigation-rail/navigation-rail.scss +3 -2
  237. package/src/password-field/password-field.ts +11 -1
  238. package/src/search/search.ts +9 -0
  239. package/src/select/select.ts +5 -0
  240. package/src/split-button/split-button.ts +10 -1
  241. package/src/stepper/step.ts +7 -1
  242. package/src/stepper/stepper.scss +13 -0
  243. package/src/tabs/tab.ts +21 -17
  244. package/src/textarea/textarea.ts +5 -0
  245. package/src/toolbar/toolbar.ts +26 -7
  246. package/dist/BaseField-BbOj212R.js.map +0 -1
  247. package/dist/base-button-BJMGMcMv.js.map +0 -1
  248. package/dist/datasource-OwvH7SVq.js.map +0 -1
  249. package/dist/form-submitter-beG1CXAn.js.map +0 -1
  250. package/dist/roving-focus-controller-fm95JkZJ.js.map +0 -1
  251. package/dist/throttle-SQ9t-HL7.js.map +0 -1
  252. package/dist/utils-DcvLgexs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"currency-field.js","sources":["../../src/currency-field/amount.ts","../../src/currency-field/currency-field.ts"],"sourcesContent":["/**\n * Money amounts as decimal strings (`-1234.50`), never floats, so nothing is rounded by binary\n * floating point. Reading uses the locale's digits and separators; formatting hands the string to\n * `Intl.NumberFormat`, which formats decimal strings exactly.\n */\n\n/** A plain decimal string: optional minus, digits, optional fraction. */\nconst PLAIN_DECIMAL = /^-?\\d+(\\.\\d+)?$/;\n\n/** How a currency is shown in a locale. */\nexport interface CurrencyInfo {\n /** Whether `Intl` knows the currency code. */\n known: boolean;\n /** Digits after the decimal separator: JPY 0, USD 2, KWD 3. */\n digits: number;\n /** The symbol the locale uses, such as `€` or `US$`. */\n symbol: string;\n /** Whether the locale puts the symbol before or after the number. */\n placement: 'start' | 'end';\n}\n\n/** What typed text is, read as an amount. */\nexport type ParsedAmount =\n | { status: 'empty' }\n | { status: 'invalid' }\n /** Has more decimals than the currency allows. */\n | { status: 'decimals' }\n | { status: 'ok'; value: string };\n\n/** `Intl.NumberFormat#format` takes decimal strings (Intl.NumberFormat v3); the DOM lib lags. */\ntype DecimalFormat = (value: string) => string;\ntype DecimalFormatToParts = (value: string) => Intl.NumberFormatPart[];\n\nfunction formatDecimal(formatter: Intl.NumberFormat, value: string): string {\n return (formatter.format as unknown as DecimalFormat)(value);\n}\n\nfunction formatDecimalToParts(\n formatter: Intl.NumberFormat,\n value: string,\n): Intl.NumberFormatPart[] {\n return (formatter.formatToParts as unknown as DecimalFormatToParts)(value);\n}\n\nfunction currencyFormatter(\n locale: string,\n currency: string,\n display: 'symbol' | 'narrowSymbol' | 'code' = 'symbol',\n): Intl.NumberFormat | undefined {\n if (!/^[A-Za-z]{3}$/.test(currency)) return undefined;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n currencyDisplay: display,\n });\n } catch {\n return undefined;\n }\n}\n\n/** The digits, symbol and symbol placement of `currency` in `locale`. */\nexport function currencyInfo(locale: string, currency: string): CurrencyInfo {\n const formatter = currencyFormatter(locale, currency);\n if (!formatter) {\n return { known: false, digits: 2, symbol: '', placement: 'start' };\n }\n const parts = formatter.formatToParts(1);\n const symbolIndex = parts.findIndex(part => part.type === 'currency');\n const numberIndex = parts.findIndex(part => part.type === 'integer');\n return {\n known: true,\n digits: formatter.resolvedOptions().maximumFractionDigits ?? 2,\n symbol: parts[symbolIndex]?.value ?? currency,\n placement: symbolIndex > numberIndex ? 'end' : 'start',\n };\n}\n\n/** The currency's name in `locale` (`Euro`), or the code where Intl cannot name it. */\nexport function currencyName(locale: string, currency: string): string {\n try {\n return (\n new Intl.DisplayNames(locale, { type: 'currency' }).of(currency) ??\n currency\n );\n } catch {\n return currency;\n }\n}\n\n/** Trims or pads the fraction of a plain decimal to `digits`; `undefined` when it has more. */\nexport function normalizeAmount(\n value: string,\n digits: number,\n): string | undefined {\n if (!PLAIN_DECIMAL.test(value)) return undefined;\n const negative = value.startsWith('-');\n const [integer, fraction = ''] = value.replace('-', '').split('.');\n const trimmed = fraction.length > digits ? fraction.replace(/0+$/, '') : '';\n if (trimmed.length > digits) return undefined;\n const padded = (fraction.length > digits ? trimmed : fraction).padEnd(\n digits,\n '0',\n );\n const whole = integer.replace(/^0+(?=\\d)/, '');\n const zero = /^0*$/.test(whole + padded);\n const sign = negative && !zero ? '-' : '';\n return `${sign}${whole}${digits ? `.${padded}` : ''}`;\n}\n\n/** Compares two plain decimal strings exactly: negative, zero or positive like `a - b`. */\nexport function compareAmounts(a: string, b: string): number {\n const negativeA = a.startsWith('-');\n const negativeB = b.startsWith('-');\n if (negativeA !== negativeB) return negativeA ? -1 : 1;\n const [intA, fracA = ''] = a.replace('-', '').split('.');\n const [intB, fracB = ''] = b.replace('-', '').split('.');\n const wholeA = intA.replace(/^0+(?=\\d)/, '');\n const wholeB = intB.replace(/^0+(?=\\d)/, '');\n const length = Math.max(fracA.length, fracB.length);\n let result = wholeA.length - wholeB.length;\n if (result === 0) {\n const left = wholeA + fracA.padEnd(length, '0');\n const right = wholeB + fracB.padEnd(length, '0');\n if (left !== right) result = left < right ? -1 : 1;\n }\n return negativeA ? -result : result;\n}\n\n/** Whether `value` is a plain decimal string such as `-12.5`. */\nexport function isPlainDecimal(value: string): boolean {\n return PLAIN_DECIMAL.test(value);\n}\n\n/** The locale's decimal and group separators and its digits, for reading typed text. */\nfunction localeNumberSymbols(locale: string) {\n let parts: Intl.NumberFormatPart[] = [];\n let digits = '0123456789';\n try {\n parts = new Intl.NumberFormat(locale).formatToParts(12345.6);\n // `9876543210` in the locale's own digits, so `٩` reads as 9.\n digits = [\n ...new Intl.NumberFormat(locale, { useGrouping: false }).format(\n 9876543210,\n ),\n ]\n .reverse()\n .join('');\n } catch {\n // An invalid locale: read Latin digits with `.` and `,`.\n }\n return {\n decimal: parts.find(part => part.type === 'decimal')?.value ?? '.',\n group: parts.find(part => part.type === 'group')?.value ?? ',',\n digits: [...digits],\n };\n}\n\n/** Whether the integer part's groups look like grouping: later groups of 2 or 3, the last of 3. */\nfunction validGrouping(groups: string[]): boolean {\n if (groups.some(group => !/^\\d+$/.test(group))) return false;\n if (groups.length === 1) return true;\n if (groups[0].length > 3) return false;\n const rest = groups.slice(1);\n return (\n rest.every(group => group.length === 2 || group.length === 3) &&\n rest[rest.length - 1].length === 3\n );\n}\n\n/**\n * Reads an amount typed or pasted in `locale`: the locale's digits and decimal separator, with or\n * without grouping, currency symbols and codes, a minus sign or accounting brackets. When `.` and\n * `,` both appear, the last one is the decimal separator, so `€1,234.50` reads in any locale. A\n * lone separator that is the locale's group separator must group digits by three (`1,234`); one\n * that is neither the locale's decimal nor group separator is a decimal point (`12.50` in French).\n */\nexport function parseAmount(\n text: string,\n locale: string,\n currency: string,\n digits: number,\n): ParsedAmount {\n const symbols = localeNumberSymbols(locale);\n let rest = text;\n // Currency symbols and codes, in every display the locale has.\n const marks = new Set<string>([currency.toUpperCase()]);\n for (const display of ['symbol', 'narrowSymbol', 'code'] as const) {\n const part = currencyFormatter(locale, currency, display)\n ?.formatToParts(1)\n .find(item => item.type === 'currency');\n if (part) marks.add(part.value);\n }\n for (const mark of [...marks].sort((a, b) => b.length - a.length)) {\n rest = rest.split(mark).join('');\n }\n rest = rest\n .replace(/\\p{Sc}/gu, '')\n .replace(/[\\s'’]/g, '')\n .replace(/\\p{Nd}/gu, char => {\n const index = symbols.digits.indexOf(char);\n return index >= 0 ? String(index) : char;\n });\n if (!rest) return { status: 'empty' };\n\n let negative = false;\n const brackets = /^\\((.*)\\)$/.exec(rest);\n if (brackets) {\n negative = true;\n [, rest] = brackets;\n } else if (/^[-−]/.test(rest)) {\n negative = true;\n rest = rest.slice(1);\n } else if (/[-−]$/.test(rest)) {\n negative = true;\n rest = rest.slice(0, -1);\n }\n\n // Separators other than `.` and `,` (such as Arabic `٫` and `٬`) become `D` and nothing.\n if (symbols.decimal !== '.' && symbols.decimal !== ',') {\n rest = rest.split(symbols.decimal).join('D');\n }\n if (symbols.group !== '.' && symbols.group !== ',') {\n rest = rest.split(symbols.group).join('');\n }\n if (!/^[\\d.,D]+$/.test(rest)) return { status: 'invalid' };\n\n let decimalMark = '';\n let groupMark = '';\n const hasDot = rest.includes('.');\n const hasComma = rest.includes(',');\n if (rest.includes('D')) {\n decimalMark = 'D';\n groupMark = hasDot ? '.' : ',';\n } else if (hasDot && hasComma) {\n decimalMark = rest.lastIndexOf('.') > rest.lastIndexOf(',') ? '.' : ',';\n groupMark = decimalMark === '.' ? ',' : '.';\n } else if (hasDot || hasComma) {\n const mark = hasDot ? '.' : ',';\n const count = rest.split(mark).length - 1;\n if (mark === symbols.decimal || (mark !== symbols.group && count === 1)) {\n decimalMark = mark;\n } else {\n groupMark = mark;\n }\n }\n\n const pieces = decimalMark ? rest.split(decimalMark) : [rest];\n if (pieces.length > 2) return { status: 'invalid' };\n const [integerText, fraction = ''] = pieces;\n if (/[^\\d]/.test(fraction)) return { status: 'invalid' };\n const groups = groupMark ? integerText.split(groupMark) : [integerText];\n if (groupMark && !validGrouping(groups)) return { status: 'invalid' };\n const integer = groups.join('');\n if (!/^\\d*$/.test(integer) || (!integer && !fraction)) {\n return { status: 'invalid' };\n }\n\n const plain = `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n const value = normalizeAmount(plain, digits);\n return value === undefined ? { status: 'decimals' } : { status: 'ok', value };\n}\n\n/** The amount as the locale writes it with grouping, without the currency symbol. */\nexport function formatAmount(\n value: string,\n locale: string,\n currency: string,\n digits: number,\n): string {\n const formatter =\n currencyFormatter(locale, currency) ??\n new Intl.NumberFormat(locale, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n const parts = formatDecimalToParts(formatter, value);\n const index = parts.findIndex(part => part.type === 'currency');\n if (index < 0) return parts.map(part => part.value).join('');\n // Drop the symbol and the space that joins it to the number.\n const isSpace = (part?: Intl.NumberFormatPart) =>\n part?.type === 'literal' && /^\\s+$/.test(part.value);\n const skip = new Set([index]);\n if (isSpace(parts[index - 1])) skip.add(index - 1);\n if (isSpace(parts[index + 1])) skip.add(index + 1);\n return parts\n .filter((_, position) => !skip.has(position))\n .map(part => part.value)\n .join('')\n .trim();\n}\n\n/** The amount as the person edits it: the locale's digits and decimal separator, no grouping. */\nexport function editableAmount(\n value: string,\n locale: string,\n digits: number,\n): string {\n try {\n const formatter = new Intl.NumberFormat(locale, {\n useGrouping: false,\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n return formatDecimal(formatter, value);\n } catch {\n return value;\n }\n}\n\n/** The amount with its currency, for messages such as \"Enter €10.00 or more\". */\nexport function formatWithCurrency(\n value: string,\n locale: string,\n currency: string,\n): string {\n const formatter = currencyFormatter(locale, currency);\n return formatter ? formatDecimal(formatter, value) : value;\n}\n","import { html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { warnOnce } from '@/__internal/utils/warn-once.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\nimport BaseField from '../input/BaseField.js';\nimport type { ControlValidity } from '../input/BaseInput.js';\nimport {\n compareAmounts,\n currencyInfo,\n currencyName,\n type CurrencyInfo,\n editableAmount,\n formatAmount,\n formatWithCurrency,\n isPlainDecimal,\n normalizeAmount,\n type ParsedAmount,\n parseAmount,\n} from './amount.js';\nimport styles from './currency-field.scss';\n\n/** What `input` and `change` carry. */\nexport interface CurrencyFieldEventDetail {\n /** The amount as a decimal string with the currency's decimals (`1234.50`), or ''. */\n value: string;\n /** The currency, ISO 4217, such as `EUR`. */\n currency: string;\n}\n\nlet currencyFieldCount = 0;\n\n/**\n * @label Currency Field\n * @tag wc-currency-field\n * @rawTag currency-field\n *\n * @summary A field for an amount of money, kept as an exact decimal string in a given currency.\n * @overview\n * <p>Currency field takes an amount of money in <code>currency</code> (ISO 4217, such as\n * <code>EUR</code>). Its <code>value</code> is a decimal <strong>string</strong> with exactly the\n * currency's decimals (<code>\"1234.50\"</code> for EUR, <code>\"1234\"</code> for JPY,\n * <code>\"1.250\"</code> for KWD), or '' while empty, so an amount is never rounded by binary\n * floating point on its way to the server. Inside a <code>&lt;form&gt;</code> that string is\n * submitted under its <code>name</code>.</p>\n * <p>The currency symbol sits before or after the amount, wherever the locale (the nearest\n * <code>lang</code>, else the browser's) puts it. While the field is not focused the amount shows\n * with grouping (<code>1,234.50</code>); while editing it is plain (<code>1234.50</code>). Typing\n * takes the locale's decimal separator, and pasted amounts such as <code>€1,234.50</code>,\n * <code>1.234,50 €</code> or <code>(12.00)</code> are read too.</p>\n * <p>More decimals than the currency has are <strong>rejected, not rounded</strong>:\n * <code>1.255</code> in euros shows \"Enter an amount with at most 2 decimal places\" and leaves\n * <code>value</code> empty until it is fixed, because silently rounding money changes it. Trailing\n * zeros are fine (<code>1.250</code> is <code>1.25</code>). <code>min</code> and <code>max</code>\n * (decimal strings) are compared exactly; with <code>required</code> and text that does not read\n * as an amount they block form submission.</p>\n * <p>Set <code>currencies</code> to let the person choose the currency: the symbol becomes a\n * currency selector and <code>currency</code> follows it. Every event carries\n * <code>detail.currency</code>.</p>\n * <p><strong>Currency field or number field?</strong> Use <code>wc-number-field</code> with\n * <code>format='{\"style\":\"currency\",\"currency\":\"EUR\"}'</code> when a number that happens to be\n * shown as money is enough: its <code>value</code> is a JavaScript number, it has\n * <code>step</code> and stepper buttons, and the symbol only shows while not editing. Use\n * <code>wc-currency-field</code> for real money: an exact decimal string, decimals that follow the\n * currency, the symbol always in view, pasted formatted amounts, or a currency the person\n * chooses.</p>\n *\n * @fires {CustomEvent<{value: string, currency: string}>} input - Dispatched as the user types or picks a currency.\n * @fires {CustomEvent<{value: string, currency: string}>} change - Dispatched when the amount or the currency is committed.\n *\n * @cssprop --currency-field-symbol-color - Color of the currency symbol.\n *\n * @example\n * ```html\n * <wc-currency-field label=\"Price\" currency=\"EUR\" value=\"1234.50\"></wc-currency-field>\n * ```\n * @example\n * ```html\n * <wc-currency-field\n * label=\"Amount\"\n * currency=\"USD\"\n * currencies='[\"USD\", \"EUR\", \"GBP\", \"JPY\"]'\n * min=\"0\"\n * required\n * ></wc-currency-field>\n * ```\n * @tags input, form\n */\n@IndividualComponent\nexport class CurrencyField extends BaseField {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** The amount as a decimal string with the currency's decimals (`\"1234.50\"`), or ''. */\n @property({ type: String })\n value = '';\n\n /** The currency, ISO 4217 (`EUR`). Sets the symbol and the number of decimals. Required. */\n @property({ type: String, reflect: true })\n currency = '';\n\n /** Currencies the person can choose from; the symbol becomes a selector when set. */\n @property({ type: Array })\n currencies?: string[];\n\n /** Smallest amount allowed, as a decimal string (`\"0\"`). */\n @property({ type: String })\n min?: string;\n\n /** Largest amount allowed, as a decimal string (`\"10000\"`). */\n @property({ type: String })\n max?: string;\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** What the person typed, or the value in its editable form. */\n @state()\n private text = '';\n\n /** Whether the input has focus, so it shows the plain amount to edit. */\n @state()\n private editing = false;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.input-element')\n private inputElement?: HTMLInputElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Peacock's strings for the selector's name and the validation messages. */\n private readonly i18n = new I18nController(this);\n\n /** The last value the field produced itself, so `willUpdate` can tell a consumer's value apart. */\n private __ownValue = '';\n\n /** The currency the field started with; `form.reset()` returns to it. */\n private __defaultCurrency?: string;\n\n /** Id of the hidden currency name the input points at. */\n private readonly __currencyId = `wc-currency-field-currency-${(currencyFieldCount += 1)}`;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n this.__defaultCurrency ??= this.currency;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('currency') && !this.__info().known) {\n warnOnce(\n `wc-currency-field:currency:${this.currency}`,\n `[peacock] wc-currency-field needs a valid ISO 4217 currency; got \"${this.currency}\".`,\n );\n }\n if (changed.has('value') && this.value !== this.__ownValue) {\n this.__syncFromValue();\n } else if (changed.has('currency') && this.text) {\n // Another currency has other decimals: read the same text again.\n this.__applyText(this.text);\n }\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n const anchor = this.inputElement;\n if (this.disabled) return { flags: {}, message: '' };\n const parsed = this.__parse(this.text);\n if (parsed.status === 'invalid') {\n return {\n flags: { badInput: true },\n message: this.i18n.t('currencyInvalid'),\n anchor,\n };\n }\n if (parsed.status === 'decimals') {\n return {\n flags: { stepMismatch: true },\n message: this.i18n.t('currencyTooManyDecimals')(this.__info().digits),\n anchor,\n };\n }\n if (this.value && isPlainDecimal(this.value)) {\n const { locale } = this.i18n;\n if (\n this.min &&\n isPlainDecimal(this.min) &&\n compareAmounts(this.value, this.min) < 0\n ) {\n return {\n flags: { rangeUnderflow: true },\n message: this.i18n.t('currencyTooLow')(\n formatWithCurrency(this.min, locale, this.currency),\n ),\n anchor,\n };\n }\n if (\n this.max &&\n isPlainDecimal(this.max) &&\n compareAmounts(this.value, this.max) > 0\n ) {\n return {\n flags: { rangeOverflow: true },\n message: this.i18n.t('currencyTooHigh')(\n formatWithCurrency(this.max, locale, this.currency),\n ),\n anchor,\n };\n }\n }\n return { ...super.computeValidity(), anchor };\n }\n\n protected override validityAnchor() {\n // `@query` gives null before the first render.\n return this.inputElement ?? undefined;\n }\n\n protected override clearValue() {\n this.text = '';\n this.__setValue('');\n this.__emit('input');\n this.__emit('change');\n }\n\n override formResetCallback() {\n super.formResetCallback();\n if (this.__defaultCurrency !== undefined) {\n this.currency = this.__defaultCurrency;\n }\n this.__syncFromValue();\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private __info(): CurrencyInfo {\n return currencyInfo(this.i18n.locale, this.currency);\n }\n\n private __parse(text: string): ParsedAmount {\n return parseAmount(\n text,\n this.i18n.locale,\n this.currency,\n this.__info().digits,\n );\n }\n\n /** Shows a consumer's `value`: normalized to the currency's decimals when it is a plain decimal. */\n private __syncFromValue() {\n this.__ownValue = this.value;\n const { digits } = this.__info();\n const normalized = normalizeAmount(this.value, digits);\n if (normalized === undefined) {\n // Not a plain decimal with the currency's decimals: show it so the field reports it.\n this.text = this.value;\n return;\n }\n this.text = editableAmount(normalized, this.i18n.locale, digits);\n this.__setValue(normalized);\n }\n\n /** Reads typed text into `value`, or '' while it is not an amount. */\n private __applyText(text: string) {\n this.text = text;\n const parsed = this.__parse(text);\n this.__setValue(parsed.status === 'ok' ? parsed.value : '');\n }\n\n private __setValue(value: string) {\n this.__ownValue = value;\n this.value = value;\n }\n\n private __emit(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent<CurrencyFieldEventDetail>(type, {\n detail: { value: this.value, currency: this.currency },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private __handleInput(event: Event) {\n // Replace the native event, which escapes the shadow root, with the field's own.\n event.stopPropagation();\n this.__applyText((event.target as HTMLInputElement).value);\n this.__emit('input');\n }\n\n private __handleChange(event: Event) {\n event.stopPropagation();\n this.__emit('change');\n }\n\n private __handleFocus(event: FocusEvent) {\n this.handleFieldFocus(event);\n this.editing = event.type === 'focus';\n if (this.editing && this.value && isPlainDecimal(this.value)) {\n // Edit the plain amount, as the locale writes it without grouping.\n this.text = editableAmount(\n this.value,\n this.i18n.locale,\n this.__info().digits,\n );\n }\n }\n\n private __handleCurrencyChange(event: Event) {\n event.stopPropagation();\n this.currency = (event.target as HTMLSelectElement).value;\n this.__applyText(this.text);\n this.__emit('input');\n this.__emit('change');\n }\n\n private __stopEvent(event: Event) {\n // The select's native `input` escapes the shadow root; clicks would focus the amount input.\n event.stopPropagation();\n }\n\n /** What the input shows: grouped while not editing a valid amount, else the text. */\n private __displayText(): string {\n if (this.editing || !this.value || !isPlainDecimal(this.value)) {\n return this.text;\n }\n if (this.__parse(this.text).status !== 'ok') return this.text;\n return formatAmount(\n this.value,\n this.i18n.locale,\n this.currency,\n this.__info().digits,\n );\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderSymbol(info: CurrencyInfo) {\n const slot = info.placement === 'end' ? 'field-end' : 'field-start';\n const choices = (this.currencies ?? []).map(code => code.toUpperCase());\n if (!choices.length) {\n if (!info.symbol) return nothing;\n return html`<span class=\"symbol\" slot=${slot} aria-hidden=\"true\"\n >${info.symbol}</span\n >`;\n }\n if (!choices.includes(this.currency.toUpperCase()) && this.currency) {\n choices.unshift(this.currency.toUpperCase());\n }\n const { locale } = this.i18n;\n // A transparent native select lies over the symbol: it opens the platform's list (with\n // typeahead on the names) and screen readers announce it as a combobox.\n return html`<span class=\"symbol picker\" slot=${slot}>\n <span aria-hidden=\"true\">${info.symbol || this.currency}</span>\n <wc-icon\n class=\"arrow\"\n name=\"arrow_drop_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n <select\n class=\"currency-select\"\n aria-label=${this.i18n.t('currencyPicker')}\n autocomplete=\"transaction-currency\"\n .value=${this.currency.toUpperCase()}\n ?disabled=${this.disabled || this.readonly}\n @change=${this.__handleCurrencyChange}\n @input=${this.__stopEvent}\n @click=${this.__stopEvent}\n @focus=${this.handleFieldFocus}\n @blur=${this.handleFieldFocus}\n >\n ${choices.map(\n code =>\n html`<option\n value=${code}\n ?selected=${code === this.currency.toUpperCase()}\n >\n ${currencyName(locale, code)} (${code})\n </option>`,\n )}\n </select>\n </span>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const info = this.__info();\n const aria = this.fieldAria();\n const describedBy = [aria['aria-describedby'], this.__currencyId]\n .filter(Boolean)\n .join(' ');\n const symbol = this.renderSymbol(info);\n const field = this.renderField(\n html`<input\n class=\"input input-element\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"transaction-amount\"\n spellcheck=\"false\"\n placeholder=${this.placeholder}\n .value=${this.__displayText()}\n ?readonly=${this.readonly}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @input=${this.__handleInput}\n @change=${this.__handleChange}\n @focus=${this.__handleFocus}\n @blur=${this.__handleFocus}\n ${spread({ ...aria, 'aria-describedby': describedBy })}\n />`,\n {\n populated: !!this.text,\n start: info.placement === 'start' ? symbol : nothing,\n end: info.placement === 'end' ? symbol : nothing,\n },\n );\n return html`${field}\n <span id=${this.__currencyId} hidden\n >${this.currency\n ? currencyName(this.i18n.locale, this.currency)\n : ''}</span\n >`;\n }\n}\n"],"names":["nothing","html","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;AAIG;AAEH;AACA,MAAM,aAAa,GAAG,iBAAiB;AA0BvC,SAAS,aAAa,CAAC,SAA4B,EAAE,KAAa,EAAA;AAChE,IAAA,OAAQ,SAAS,CAAC,MAAmC,CAAC,KAAK,CAAC;AAC9D;AAEA,SAAS,oBAAoB,CAC3B,SAA4B,EAC5B,KAAa,EAAA;AAEb,IAAA,OAAQ,SAAS,CAAC,aAAiD,CAAC,KAAK,CAAC;AAC5E;AAEA,SAAS,iBAAiB,CACxB,MAAc,EACd,QAAgB,EAChB,UAA8C,QAAQ,EAAA;AAEtD,IAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;AAAE,QAAA,OAAO,SAAS;AACrD,IAAA,IAAI;AACF,QAAA,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;AACnC,YAAA,KAAK,EAAE,UAAU;YACjB,QAAQ;AACR,YAAA,eAAe,EAAE,OAAO;AACzB,SAAA,CAAC;IACJ;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF;AAEA;AACM,SAAU,YAAY,CAAC,MAAc,EAAE,QAAgB,EAAA;IAC3D,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC;IACr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AAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAItB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACb,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AAIb,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACb,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AAML,UAAA,CAAA;AADP,IAAAC,CAAK;AACY,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIV,UAAA,CAAA;AADP,IAAAA,CAAK;AACkB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAKhB,UAAA,CAAA;IADPC,CAAK,CAAC,gBAAgB;AACiB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAxC7B,aAAa,GAAA,UAAA,CAAA;IADzB;AACY,CAAA,EAAA,aAAa,CAiWzB;;;;"}
1
+ {"version":3,"file":"currency-field.js","sources":["../../src/currency-field/amount.ts","../../src/currency-field/currency-field.ts"],"sourcesContent":["/**\n * Money amounts as decimal strings (`-1234.50`), never floats, so nothing is rounded by binary\n * floating point. Reading uses the locale's digits and separators; formatting hands the string to\n * `Intl.NumberFormat`, which formats decimal strings exactly.\n */\n\n/** A plain decimal string: optional minus, digits, optional fraction. */\nconst PLAIN_DECIMAL = /^-?\\d+(\\.\\d+)?$/;\n\n/** How a currency is shown in a locale. */\nexport interface CurrencyInfo {\n /** Whether `Intl` knows the currency code. */\n known: boolean;\n /** Digits after the decimal separator: JPY 0, USD 2, KWD 3. */\n digits: number;\n /** The symbol the locale uses, such as `€` or `US$`. */\n symbol: string;\n /** Whether the locale puts the symbol before or after the number. */\n placement: 'start' | 'end';\n}\n\n/** What typed text is, read as an amount. */\nexport type ParsedAmount =\n | { status: 'empty' }\n | { status: 'invalid' }\n /** Has more decimals than the currency allows. */\n | { status: 'decimals' }\n | { status: 'ok'; value: string };\n\n/** `Intl.NumberFormat#format` takes decimal strings (Intl.NumberFormat v3); the DOM lib lags. */\ntype DecimalFormat = (value: string) => string;\ntype DecimalFormatToParts = (value: string) => Intl.NumberFormatPart[];\n\nfunction formatDecimal(formatter: Intl.NumberFormat, value: string): string {\n return (formatter.format as unknown as DecimalFormat)(value);\n}\n\nfunction formatDecimalToParts(\n formatter: Intl.NumberFormat,\n value: string,\n): Intl.NumberFormatPart[] {\n return (formatter.formatToParts as unknown as DecimalFormatToParts)(value);\n}\n\nfunction currencyFormatter(\n locale: string,\n currency: string,\n display: 'symbol' | 'narrowSymbol' | 'code' = 'symbol',\n): Intl.NumberFormat | undefined {\n if (!/^[A-Za-z]{3}$/.test(currency)) return undefined;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n currencyDisplay: display,\n });\n } catch {\n return undefined;\n }\n}\n\n/** The digits, symbol and symbol placement of `currency` in `locale`. */\nexport function currencyInfo(locale: string, currency: string): CurrencyInfo {\n const formatter = currencyFormatter(locale, currency);\n if (!formatter) {\n return { known: false, digits: 2, symbol: '', placement: 'start' };\n }\n const parts = formatter.formatToParts(1);\n const symbolIndex = parts.findIndex(part => part.type === 'currency');\n const numberIndex = parts.findIndex(part => part.type === 'integer');\n return {\n known: true,\n digits: formatter.resolvedOptions().maximumFractionDigits ?? 2,\n symbol: parts[symbolIndex]?.value ?? currency,\n placement: symbolIndex > numberIndex ? 'end' : 'start',\n };\n}\n\n/** The currency's name in `locale` (`Euro`), or the code where Intl cannot name it. */\nexport function currencyName(locale: string, currency: string): string {\n try {\n return (\n new Intl.DisplayNames(locale, { type: 'currency' }).of(currency) ??\n currency\n );\n } catch {\n return currency;\n }\n}\n\n/** Trims or pads the fraction of a plain decimal to `digits`; `undefined` when it has more. */\nexport function normalizeAmount(\n value: string,\n digits: number,\n): string | undefined {\n if (!PLAIN_DECIMAL.test(value)) return undefined;\n const negative = value.startsWith('-');\n const [integer, fraction = ''] = value.replace('-', '').split('.');\n const trimmed = fraction.length > digits ? fraction.replace(/0+$/, '') : '';\n if (trimmed.length > digits) return undefined;\n const padded = (fraction.length > digits ? trimmed : fraction).padEnd(\n digits,\n '0',\n );\n const whole = integer.replace(/^0+(?=\\d)/, '');\n const zero = /^0*$/.test(whole + padded);\n const sign = negative && !zero ? '-' : '';\n return `${sign}${whole}${digits ? `.${padded}` : ''}`;\n}\n\n/** Compares two plain decimal strings exactly: negative, zero or positive like `a - b`. */\nexport function compareAmounts(a: string, b: string): number {\n const negativeA = a.startsWith('-');\n const negativeB = b.startsWith('-');\n if (negativeA !== negativeB) return negativeA ? -1 : 1;\n const [intA, fracA = ''] = a.replace('-', '').split('.');\n const [intB, fracB = ''] = b.replace('-', '').split('.');\n const wholeA = intA.replace(/^0+(?=\\d)/, '');\n const wholeB = intB.replace(/^0+(?=\\d)/, '');\n const length = Math.max(fracA.length, fracB.length);\n let result = wholeA.length - wholeB.length;\n if (result === 0) {\n const left = wholeA + fracA.padEnd(length, '0');\n const right = wholeB + fracB.padEnd(length, '0');\n if (left !== right) result = left < right ? -1 : 1;\n }\n return negativeA ? -result : result;\n}\n\n/** Whether `value` is a plain decimal string such as `-12.5`. */\nexport function isPlainDecimal(value: string): boolean {\n return PLAIN_DECIMAL.test(value);\n}\n\n/** The locale's decimal and group separators and its digits, for reading typed text. */\nfunction localeNumberSymbols(locale: string) {\n let parts: Intl.NumberFormatPart[] = [];\n let digits = '0123456789';\n try {\n parts = new Intl.NumberFormat(locale).formatToParts(12345.6);\n // `9876543210` in the locale's own digits, so `٩` reads as 9.\n digits = [\n ...new Intl.NumberFormat(locale, { useGrouping: false }).format(\n 9876543210,\n ),\n ]\n .reverse()\n .join('');\n } catch {\n // An invalid locale: read Latin digits with `.` and `,`.\n }\n return {\n decimal: parts.find(part => part.type === 'decimal')?.value ?? '.',\n group: parts.find(part => part.type === 'group')?.value ?? ',',\n digits: [...digits],\n };\n}\n\n/** Whether the integer part's groups look like grouping: later groups of 2 or 3, the last of 3. */\nfunction validGrouping(groups: string[]): boolean {\n if (groups.some(group => !/^\\d+$/.test(group))) return false;\n if (groups.length === 1) return true;\n if (groups[0].length > 3) return false;\n const rest = groups.slice(1);\n return (\n rest.every(group => group.length === 2 || group.length === 3) &&\n rest[rest.length - 1].length === 3\n );\n}\n\n/**\n * Reads an amount typed or pasted in `locale`: the locale's digits and decimal separator, with or\n * without grouping, currency symbols and codes, a minus sign or accounting brackets. When `.` and\n * `,` both appear, the last one is the decimal separator, so `€1,234.50` reads in any locale. A\n * lone separator that is the locale's group separator must group digits by three (`1,234`); one\n * that is neither the locale's decimal nor group separator is a decimal point (`12.50` in French).\n */\nexport function parseAmount(\n text: string,\n locale: string,\n currency: string,\n digits: number,\n): ParsedAmount {\n const symbols = localeNumberSymbols(locale);\n let rest = text;\n // Currency symbols and codes, in every display the locale has.\n const marks = new Set<string>([currency.toUpperCase()]);\n for (const display of ['symbol', 'narrowSymbol', 'code'] as const) {\n const part = currencyFormatter(locale, currency, display)\n ?.formatToParts(1)\n .find(item => item.type === 'currency');\n if (part) marks.add(part.value);\n }\n for (const mark of [...marks].sort((a, b) => b.length - a.length)) {\n rest = rest.split(mark).join('');\n }\n rest = rest\n .replace(/\\p{Sc}/gu, '')\n .replace(/[\\s'’]/g, '')\n .replace(/\\p{Nd}/gu, char => {\n const index = symbols.digits.indexOf(char);\n return index >= 0 ? String(index) : char;\n });\n if (!rest) return { status: 'empty' };\n\n let negative = false;\n const brackets = /^\\((.*)\\)$/.exec(rest);\n if (brackets) {\n negative = true;\n [, rest] = brackets;\n } else if (/^[-−]/.test(rest)) {\n negative = true;\n rest = rest.slice(1);\n } else if (/[-−]$/.test(rest)) {\n negative = true;\n rest = rest.slice(0, -1);\n }\n\n // Separators other than `.` and `,` (such as Arabic `٫` and `٬`) become `D` and nothing.\n if (symbols.decimal !== '.' && symbols.decimal !== ',') {\n rest = rest.split(symbols.decimal).join('D');\n }\n if (symbols.group !== '.' && symbols.group !== ',') {\n rest = rest.split(symbols.group).join('');\n }\n if (!/^[\\d.,D]+$/.test(rest)) return { status: 'invalid' };\n\n let decimalMark = '';\n let groupMark = '';\n const hasDot = rest.includes('.');\n const hasComma = rest.includes(',');\n if (rest.includes('D')) {\n decimalMark = 'D';\n groupMark = hasDot ? '.' : ',';\n } else if (hasDot && hasComma) {\n decimalMark = rest.lastIndexOf('.') > rest.lastIndexOf(',') ? '.' : ',';\n groupMark = decimalMark === '.' ? ',' : '.';\n } else if (hasDot || hasComma) {\n const mark = hasDot ? '.' : ',';\n const count = rest.split(mark).length - 1;\n if (mark === symbols.decimal || (mark !== symbols.group && count === 1)) {\n decimalMark = mark;\n } else {\n groupMark = mark;\n }\n }\n\n const pieces = decimalMark ? rest.split(decimalMark) : [rest];\n if (pieces.length > 2) return { status: 'invalid' };\n const [integerText, fraction = ''] = pieces;\n if (/[^\\d]/.test(fraction)) return { status: 'invalid' };\n const groups = groupMark ? integerText.split(groupMark) : [integerText];\n if (groupMark && !validGrouping(groups)) return { status: 'invalid' };\n const integer = groups.join('');\n if (!/^\\d*$/.test(integer) || (!integer && !fraction)) {\n return { status: 'invalid' };\n }\n\n const plain = `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n const value = normalizeAmount(plain, digits);\n return value === undefined ? { status: 'decimals' } : { status: 'ok', value };\n}\n\n/** The amount as the locale writes it with grouping, without the currency symbol. */\nexport function formatAmount(\n value: string,\n locale: string,\n currency: string,\n digits: number,\n): string {\n const formatter =\n currencyFormatter(locale, currency) ??\n new Intl.NumberFormat(locale, {\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n const parts = formatDecimalToParts(formatter, value);\n const index = parts.findIndex(part => part.type === 'currency');\n if (index < 0) return parts.map(part => part.value).join('');\n // Drop the symbol and the space that joins it to the number.\n const isSpace = (part?: Intl.NumberFormatPart) =>\n part?.type === 'literal' && /^\\s+$/.test(part.value);\n const skip = new Set([index]);\n if (isSpace(parts[index - 1])) skip.add(index - 1);\n if (isSpace(parts[index + 1])) skip.add(index + 1);\n return parts\n .filter((_, position) => !skip.has(position))\n .map(part => part.value)\n .join('')\n .trim();\n}\n\n/** The amount as the person edits it: the locale's digits and decimal separator, no grouping. */\nexport function editableAmount(\n value: string,\n locale: string,\n digits: number,\n): string {\n try {\n const formatter = new Intl.NumberFormat(locale, {\n useGrouping: false,\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n return formatDecimal(formatter, value);\n } catch {\n return value;\n }\n}\n\n/** The amount with its currency, for messages such as \"Enter €10.00 or more\". */\nexport function formatWithCurrency(\n value: string,\n locale: string,\n currency: string,\n): string {\n const formatter = currencyFormatter(locale, currency);\n return formatter ? formatDecimal(formatter, value) : value;\n}\n","import { html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\n\nimport { spread } from '@/__internal/directive/spread.js';\nimport { I18nController } from '@/__internal/i18n/i18n-controller.js';\nimport { warnOnce } from '@/__internal/utils/warn-once.js';\nimport IndividualComponent from '@/IndividualComponent.js';\n\nimport BaseField from '../input/BaseField.js';\nimport type { ControlValidity } from '../input/BaseInput.js';\nimport {\n compareAmounts,\n currencyInfo,\n currencyName,\n type CurrencyInfo,\n editableAmount,\n formatAmount,\n formatWithCurrency,\n isPlainDecimal,\n normalizeAmount,\n type ParsedAmount,\n parseAmount,\n} from './amount.js';\nimport styles from './currency-field.scss';\n\n/** What `input` and `change` carry. */\nexport interface CurrencyFieldEventDetail {\n /** The amount as a decimal string with the currency's decimals (`1234.50`), or ''. */\n value: string;\n /** The currency, ISO 4217, such as `EUR`. */\n currency: string;\n}\n\nlet currencyFieldCount = 0;\n\n/**\n * @label Currency Field\n * @tag wc-currency-field\n * @rawTag currency-field\n *\n * @summary A field for an amount of money, kept as an exact decimal string in a given currency.\n * @overview\n * <p>Currency field takes an amount of money in <code>currency</code> (ISO 4217, such as\n * <code>EUR</code>). Its <code>value</code> is a decimal <strong>string</strong> with exactly the\n * currency's decimals (<code>\"1234.50\"</code> for EUR, <code>\"1234\"</code> for JPY,\n * <code>\"1.250\"</code> for KWD), or '' while empty, so an amount is never rounded by binary\n * floating point on its way to the server. Inside a <code>&lt;form&gt;</code> that string is\n * submitted under its <code>name</code>.</p>\n * <p>The currency symbol sits before or after the amount, wherever the locale (the nearest\n * <code>lang</code>, else the browser's) puts it. While the field is not focused the amount shows\n * with grouping (<code>1,234.50</code>); while editing it is plain (<code>1234.50</code>). Typing\n * takes the locale's decimal separator, and pasted amounts such as <code>€1,234.50</code>,\n * <code>1.234,50 €</code> or <code>(12.00)</code> are read too.</p>\n * <p>More decimals than the currency has are <strong>rejected, not rounded</strong>:\n * <code>1.255</code> in euros shows \"Enter an amount with at most 2 decimal places\" and leaves\n * <code>value</code> empty until it is fixed, because silently rounding money changes it. Trailing\n * zeros are fine (<code>1.250</code> is <code>1.25</code>). <code>min</code> and <code>max</code>\n * (decimal strings) are compared exactly; with <code>required</code> and text that does not read\n * as an amount they block form submission.</p>\n * <p>Set <code>currencies</code> to let the person choose the currency: the symbol becomes a\n * currency selector and <code>currency</code> follows it. Every event carries\n * <code>detail.currency</code>.</p>\n * <p><strong>Currency field or number field?</strong> Use <code>wc-number-field</code> with\n * <code>format='{\"style\":\"currency\",\"currency\":\"EUR\"}'</code> when a number that happens to be\n * shown as money is enough: its <code>value</code> is a JavaScript number, it has\n * <code>step</code> and stepper buttons, and the symbol only shows while not editing. Use\n * <code>wc-currency-field</code> for real money: an exact decimal string, decimals that follow the\n * currency, the symbol always in view, pasted formatted amounts, or a currency the person\n * chooses.</p>\n *\n * @fires {CustomEvent<{value: string, currency: string}>} input - Dispatched as the user types or picks a currency.\n * @fires {CustomEvent<{value: string, currency: string}>} change - Dispatched when the amount or the currency is committed.\n *\n * @cssprop --currency-field-symbol-color - Color of the currency symbol.\n *\n * @example\n * ```html\n * <wc-currency-field label=\"Price\" currency=\"EUR\" value=\"1234.50\"></wc-currency-field>\n * ```\n * @example\n * ```html\n * <wc-currency-field\n * label=\"Amount\"\n * currency=\"USD\"\n * currencies='[\"USD\", \"EUR\", \"GBP\", \"JPY\"]'\n * min=\"0\"\n * required\n * ></wc-currency-field>\n * ```\n * @tags input, form\n */\n@IndividualComponent\nexport class CurrencyField extends BaseField {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n\n /** The amount as a decimal string with the currency's decimals (`\"1234.50\"`), or ''. */\n @property({ type: String })\n value = '';\n\n /** The currency, ISO 4217 (`EUR`). Sets the symbol and the number of decimals. Required. */\n @property({ type: String, reflect: true })\n currency = '';\n\n /** Currencies the person can choose from; the symbol becomes a selector when set. */\n @property({ type: Array })\n currencies?: string[];\n\n /** Smallest amount allowed, as a decimal string (`\"0\"`). */\n @property({ type: String })\n min?: string;\n\n /** Largest amount allowed, as a decimal string (`\"10000\"`). */\n @property({ type: String })\n max?: string;\n\n // ── State ────────────────────────────────────────────────────────────────\n\n /** What the person typed, or the value in its editable form. */\n @state()\n private text = '';\n\n /** Whether the input has focus, so it shows the plain amount to edit. */\n @state()\n private editing = false;\n\n // ── Queries ──────────────────────────────────────────────────────────────\n\n @query('.input-element')\n private inputElement?: HTMLInputElement;\n\n // ── Private fields ───────────────────────────────────────────────────────\n\n /** Peacock's strings for the selector's name and the validation messages. */\n private readonly i18n = new I18nController(this);\n\n /** The last value the field produced itself, so `willUpdate` can tell a consumer's value apart. */\n private __ownValue = '';\n\n /** The currency the field started with; `form.reset()` returns to it. */\n private __defaultCurrency?: string;\n\n /** Id of the hidden currency name the input points at. */\n private readonly __currencyId = `wc-currency-field-currency-${(currencyFieldCount += 1)}`;\n\n // ── Lifecycle ────────────────────────────────────────────────────────────\n\n override connectedCallback() {\n super.connectedCallback();\n this.__defaultCurrency ??= this.currency;\n }\n\n protected override willUpdate(changed: PropertyValues<this>) {\n super.willUpdate(changed);\n if (changed.has('currency') && !this.__info().known) {\n warnOnce(\n `wc-currency-field:currency:${this.currency}`,\n `[peacock] wc-currency-field needs a valid ISO 4217 currency; got \"${this.currency}\".`,\n );\n }\n if (changed.has('value') && this.value !== this.__ownValue) {\n this.__syncFromValue();\n } else if (changed.has('currency') && this.text) {\n // Another currency has other decimals: read the same text again.\n this.__applyText(this.text);\n }\n }\n\n // ── Public methods ───────────────────────────────────────────────────────\n\n override focus() {\n this.inputElement?.focus();\n }\n\n override blur() {\n this.inputElement?.blur();\n }\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override computeValidity(): ControlValidity {\n const anchor = this.inputElement;\n if (this.disabled) return { flags: {}, message: '' };\n const parsed = this.__parse(this.text);\n if (parsed.status === 'invalid') {\n return {\n flags: { badInput: true },\n message: this.i18n.t('currencyInvalid'),\n anchor,\n };\n }\n if (parsed.status === 'decimals') {\n return {\n flags: { stepMismatch: true },\n message: this.i18n.t('currencyTooManyDecimals')(this.__info().digits),\n anchor,\n };\n }\n if (this.value && isPlainDecimal(this.value)) {\n const { locale } = this.i18n;\n if (\n this.min &&\n isPlainDecimal(this.min) &&\n compareAmounts(this.value, this.min) < 0\n ) {\n return {\n flags: { rangeUnderflow: true },\n message: this.i18n.t('currencyTooLow')(\n formatWithCurrency(this.min, locale, this.currency),\n ),\n anchor,\n };\n }\n if (\n this.max &&\n isPlainDecimal(this.max) &&\n compareAmounts(this.value, this.max) > 0\n ) {\n return {\n flags: { rangeOverflow: true },\n message: this.i18n.t('currencyTooHigh')(\n formatWithCurrency(this.max, locale, this.currency),\n ),\n anchor,\n };\n }\n }\n return { ...super.computeValidity(), anchor };\n }\n\n protected override validityAnchor() {\n // `@query` gives null before the first render.\n return this.inputElement ?? undefined;\n }\n\n protected override clearValue() {\n this.text = '';\n this.__setValue('');\n this.__emit('input');\n this.__emit('change');\n }\n\n override formResetCallback() {\n super.formResetCallback();\n if (this.__defaultCurrency !== undefined) {\n this.currency = this.__defaultCurrency;\n }\n this.__syncFromValue();\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private __info(): CurrencyInfo {\n return currencyInfo(this.i18n.locale, this.currency);\n }\n\n private __parse(text: string): ParsedAmount {\n return parseAmount(\n text,\n this.i18n.locale,\n this.currency,\n this.__info().digits,\n );\n }\n\n /** Shows a consumer's `value`: normalized to the currency's decimals when it is a plain decimal. */\n private __syncFromValue() {\n this.__ownValue = this.value;\n const { digits } = this.__info();\n const normalized = normalizeAmount(this.value, digits);\n if (normalized === undefined) {\n // Not a plain decimal with the currency's decimals: show it so the field reports it.\n this.text = this.value;\n return;\n }\n this.text = editableAmount(normalized, this.i18n.locale, digits);\n this.__setValue(normalized);\n }\n\n /** Reads typed text into `value`, or '' while it is not an amount. */\n private __applyText(text: string) {\n this.text = text;\n const parsed = this.__parse(text);\n this.__setValue(parsed.status === 'ok' ? parsed.value : '');\n }\n\n private __setValue(value: string) {\n this.__ownValue = value;\n this.value = value;\n }\n\n private __emit(type: 'input' | 'change') {\n this.dispatchEvent(\n new CustomEvent<CurrencyFieldEventDetail>(type, {\n detail: { value: this.value, currency: this.currency },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private __handleInput(event: Event) {\n // Replace the native event, which escapes the shadow root, with the field's own.\n event.stopPropagation();\n this.__applyText((event.target as HTMLInputElement).value);\n this.__emit('input');\n }\n\n private __handleChange(event: Event) {\n event.stopPropagation();\n this.__emit('change');\n }\n\n private __handleFocus(event: FocusEvent) {\n this.handleFieldFocus(event);\n this.editing = event.type === 'focus';\n if (this.editing && this.value && isPlainDecimal(this.value)) {\n // Edit the plain amount, as the locale writes it without grouping.\n this.text = editableAmount(\n this.value,\n this.i18n.locale,\n this.__info().digits,\n );\n }\n }\n\n private __handleCurrencyChange(event: Event) {\n event.stopPropagation();\n this.currency = (event.target as HTMLSelectElement).value;\n this.__applyText(this.text);\n this.__emit('input');\n this.__emit('change');\n }\n\n private __stopEvent(event: Event) {\n // The select's native `input` escapes the shadow root; clicks would focus the amount input.\n event.stopPropagation();\n }\n\n /** What the input shows: grouped while not editing a valid amount, else the text. */\n private __displayText(): string {\n if (this.editing || !this.value || !isPlainDecimal(this.value)) {\n return this.text;\n }\n if (this.__parse(this.text).status !== 'ok') return this.text;\n return formatAmount(\n this.value,\n this.i18n.locale,\n this.currency,\n this.__info().digits,\n );\n }\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderSymbol(info: CurrencyInfo) {\n const slot = info.placement === 'end' ? 'field-end' : 'field-start';\n const choices = (this.currencies ?? []).map(code => code.toUpperCase());\n if (!choices.length) {\n if (!info.symbol) return nothing;\n return html`<span class=\"symbol\" slot=${slot} aria-hidden=\"true\"\n >${info.symbol}</span\n >`;\n }\n if (!choices.includes(this.currency.toUpperCase()) && this.currency) {\n choices.unshift(this.currency.toUpperCase());\n }\n const { locale } = this.i18n;\n // A transparent native select lies over the symbol: it opens the platform's list (with\n // typeahead on the names) and screen readers announce it as a combobox.\n return html`<span class=\"symbol picker\" slot=${slot}>\n <span aria-hidden=\"true\">${info.symbol || this.currency}</span>\n <wc-icon\n class=\"arrow\"\n name=\"arrow_drop_down\"\n aria-hidden=\"true\"\n ></wc-icon>\n <select\n class=\"currency-select\"\n aria-label=${this.i18n.t('currencyPicker')}\n autocomplete=\"transaction-currency\"\n .value=${this.currency.toUpperCase()}\n ?disabled=${this.disabled || this.readonly}\n @change=${this.__handleCurrencyChange}\n @input=${this.__stopEvent}\n @click=${this.__stopEvent}\n @focus=${this.handleFieldFocus}\n @blur=${this.handleFieldFocus}\n >\n ${choices.map(\n code =>\n html`<option\n value=${code}\n ?selected=${code === this.currency.toUpperCase()}\n >\n ${currencyName(locale, code)} (${code})\n </option>`,\n )}\n </select>\n </span>`;\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const info = this.__info();\n const aria = this.fieldAria();\n const describedBy = [aria['aria-describedby'], this.__currencyId]\n .filter(Boolean)\n .join(' ');\n const symbol = this.renderSymbol(info);\n const field = this.renderField(\n html`<input\n class=\"input input-element\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"transaction-amount\"\n spellcheck=\"false\"\n placeholder=${this.placeholder}\n .value=${this.__displayText()}\n ?readonly=${this.readonly}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @input=${this.__handleInput}\n @change=${this.__handleChange}\n @focus=${this.__handleFocus}\n @blur=${this.__handleFocus}\n ${spread({ ...aria, 'aria-describedby': describedBy })}\n />`,\n {\n populated: !!this.text,\n start: info.placement === 'start' ? symbol : nothing,\n end: info.placement === 'end' ? symbol : nothing,\n },\n );\n return html`${field}\n <span id=${this.__currencyId} hidden\n >${this.currency\n ? currencyName(this.i18n.locale, this.currency)\n : ''}</span\n >`;\n }\n}\n"],"names":["nothing","html","styles","property","state","query"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAIG;AAEH;AACA,MAAM,aAAa,GAAG,iBAAiB;AA0BvC,SAAS,aAAa,CAAC,SAA4B,EAAE,KAAa,EAAA;AAChE,IAAA,OAAQ,SAAS,CAAC,MAAmC,CAAC,KAAK,CAAC;AAC9D;AAEA,SAAS,oBAAoB,CAC3B,SAA4B,EAC5B,KAAa,EAAA;AAEb,IAAA,OAAQ,SAAS,CAAC,aAAiD,CAAC,KAAK,CAAC;AAC5E;AAEA,SAAS,iBAAiB,CACxB,MAAc,EACd,QAAgB,EAChB,UAA8C,QAAQ,EAAA;AAEtD,IAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC;AAAE,QAAA,OAAO,SAAS;AACrD,IAAA,IAAI;AACF,QAAA,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;AACnC,YAAA,KAAK,EAAE,UAAU;YACjB,QAAQ;AACR,YAAA,eAAe,EAAE,OAAO;AACzB,SAAA,CAAC;IACJ;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF;AAEA;AACM,SAAU,YAAY,CAAC,MAAc,EAAE,QAAgB,EAAA;IAC3D,MAAM,SAAS,GA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AAE,KAAK,EAAE;AACH,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAItB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACb,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AAIb,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AACb,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,KAAA,EAAA,MAAA,CAAA;AAML,UAAA,CAAA;AADP,IAAAC,CAAK;AACY,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIV,UAAA,CAAA;AADP,IAAAA,CAAK;AACkB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAKhB,UAAA,CAAA;IADPC,CAAK,CAAC,gBAAgB;AACiB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,cAAA,EAAA,MAAA,CAAA;AAxC7B,aAAa,GAAA,UAAA,CAAA;IADzB;AACY,CAAA,EAAA,aAAa,CAiWzB;;;;"}
@@ -1122,7 +1122,7 @@
1122
1122
  "description": "",
1123
1123
  "cssProperties": [
1124
1124
  {
1125
- "description": "How far each avatar slides under the previous one. Defaults to a quarter of the avatar size.",
1125
+ "description": "How far each avatar slides under the previous one. Defaults to a quarter of the avatar size, a tenth at `size=\"sm\"`.",
1126
1126
  "name": "--avatar-group-overlap"
1127
1127
  },
1128
1128
  {
@@ -1758,7 +1758,7 @@
1758
1758
  "type": {
1759
1759
  "text": "number | undefined"
1760
1760
  },
1761
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
1761
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
1762
1762
  "fieldName": "throttleDelay",
1763
1763
  "inheritedFrom": {
1764
1764
  "name": "mixinBaseButton",
@@ -1909,7 +1909,7 @@
1909
1909
  "tag": "wc-calendar",
1910
1910
  "rawTag": "calendar",
1911
1911
  "summary": "A calendar that shows events by day, week or month, with controls to move between periods.",
1912
- "overview": "<p>Pass events as the <code>events</code> property; each has a <code>start</code>,\n<code>end</code>, <code>title</code> and optional palette <code>color</code>. <code>end</code> is\nexclusive: an all-day event on November 4 runs from midnight on the 4th to midnight on the 5th.\nThe day and week views lay timed events out in a column per day, with events lasting a day or\nmore in a row above; the month view shows six weeks. <code>available-views</code> sets the views\noffered in the header's segmented buttons, and <code>view</code> the one shown.</p>\n<p>The header has a Today button, previous and next buttons and the current date, which is a\npolite live region. <code>previous()</code>, <code>next()</code> and <code>today()</code> do the\nsame from code; each fires <code>date-change</code>. The date shown is <code>date</code> (an ISO\nstring) or <code>contextDate</code> (a <code>Date</code>), kept in step. Choosing a day number\nin a column view switches to the day view and fires <code>view-change</code> and\n<code>date-change</code>.</p>\n<p>Events are buttons, chosen with a click, Enter or Space, which fire <code>event-click</code>.\nWith <code>events-readonly</code> they are shown but cannot be focused or clicked.\n<code>loading</code> shows a progress bar and marks the calendar busy. <code>first-day</code>\nsets the week start (else the locale's), <code>timezone</code> the zone the current time is\nshown in, and <code>locale</code> the language of names and times.</p>\n<p>With <code>editable</code>, people drag events to move them and drag their edges to change\nwhen they start or end: timed events in steps of <code>minute-step</code> minutes, all-day events\nand every event in the month view by whole days. Each drop fires the cancelable\n<code>event-change</code>; unless it is canceled, the calendar replaces <code>events</code> with\na new array holding a copy of the event with its new times. To confirm a change with a server\nfirst, cancel the event and apply it later with <code>applyCalendarChange()</code>. An event with\n<code>editable: false</code> stays put, and <code>events-readonly</code> turns editing off. On\ntouch screens, hold an event briefly before dragging it. Escape cancels a drag.</p>\n<p>With <code>addable</code>, dragging across empty time, or clicking it, fires\n<code>event-add</code> with the range: a click gives <code>default-duration</code> minutes, and\nthe all-day row and the month view give whole days. The calendar does not add the event itself.\nIt marks the range as a new event until <code>events</code> changes, the person presses Escape\nor starts another drag, or <code>clearPlaceholder()</code> is called, for example when a dialog\nasking for the event's title is canceled. Each change is announced to screen readers. Dragging\nneeds a pointer, so offer another way to change an event's time too, such as the dialog that\n<code>event-click</code> opens.</p>",
1912
+ "overview": "<p>Pass events as the <code>events</code> property; each has a <code>start</code>,\n<code>end</code>, <code>title</code> and optional palette <code>color</code>. <code>end</code> is\nexclusive: an all-day event on November 4 runs from midnight on the 4th to midnight on the 5th.\nThe day and week views lay timed events out in a column per day, with events lasting a day or\nmore in a row above; the month view shows six weeks. <code>available-views</code> sets the views\noffered in the header's segmented buttons, and <code>view</code> the one shown.</p>\n<p>The header has a Today button, previous and next buttons and the current date, which is a\npolite live region. <code>previous()</code>, <code>next()</code> and <code>today()</code> do the\nsame from code; each fires <code>date-change</code>. The date shown is <code>date</code> (an ISO\nstring) or <code>contextDate</code> (a <code>Date</code>), kept in step. Choosing a day number\nin a column view switches to the day view and fires <code>view-change</code> and\n<code>date-change</code>. In the month view, choosing a day number selects that day (it is\nhighlighted and becomes <code>contextDate</code>) and fires <code>date-change</code>, staying on\nthe month. The header shows the month and year in the month view and the full date otherwise,\nand wraps onto two lines when the calendar is narrow.</p>\n<p>Events are buttons, chosen with a click, Enter or Space, which fire <code>event-click</code>.\nWith <code>events-readonly</code> they are shown but cannot be focused or clicked.\n<code>loading</code> shows a progress bar and marks the calendar busy. <code>first-day</code>\nsets the week start (else the locale's), <code>timezone</code> the zone the current time is\nshown in, and <code>locale</code> the language of names and times.</p>\n<p>With <code>editable</code>, people drag events to move them and drag their edges to change\nwhen they start or end: timed events in steps of <code>minute-step</code> minutes, all-day events\nand every event in the month view by whole days. Each drop fires the cancelable\n<code>event-change</code>; unless it is canceled, the calendar replaces <code>events</code> with\na new array holding a copy of the event with its new times. To confirm a change with a server\nfirst, cancel the event and apply it later with <code>applyCalendarChange()</code>. An event with\n<code>editable: false</code> stays put, and <code>events-readonly</code> turns editing off. On\ntouch screens, hold an event briefly before dragging it. Escape cancels a drag.</p>\n<p>With <code>addable</code>, dragging across empty time, or clicking it, fires\n<code>event-add</code> with the range: a click gives <code>default-duration</code> minutes, and\nthe all-day row and the month view give whole days. The calendar does not add the event itself.\nIt marks the range as a new event until <code>events</code> changes, the person presses Escape\nor starts another drag, or <code>clearPlaceholder()</code> is called, for example when a dialog\nasking for the event's title is canceled. Each change is announced to screen readers. Dragging\nneeds a pointer, so offer another way to change an event's time too, such as the dialog that\n<code>event-click</code> opens.</p>",
1913
1913
  "cssprop": "--calendar-event-border-color - Left border color for calendar events.",
1914
1914
  "fires": "event-add - Empty time was dragged across or clicked. Detail contains `{ start, end, allDay }`. Only with `addable`.",
1915
1915
  "example": "```html\n<wc-calendar id=\"planner\" view=\"week\" editable addable style=\"height: 600px\"></wc-calendar>\n<script>\n const planner = document.getElementById('planner');\n planner.events = [\n { id: 1, title: 'Standup', start: new Date(2026, 10, 4, 9), end: new Date(2026, 10, 4, 9, 30) },\n ];\n planner.addEventListener('event-change', event => console.log(event.detail));\n planner.addEventListener('event-add', ({ detail }) => {\n planner.events = [...planner.events, { id: Date.now(), title: 'New event', ...detail }];\n });\n</script>\n```",
@@ -1950,7 +1950,7 @@
1950
1950
  "tag": "wc-calendar-month-view",
1951
1951
  "rawTag": "calendar-month-view",
1952
1952
  "summary": "The calendar's month view, six weeks of days with the events on each.",
1953
- "overview": "<p>Rendered by <code>wc-calendar</code>; not meant to be used on its own.</p>\n<p>The month is a read-only ARIA grid labelled with the month and year: one row per week, one\ngridcell per day labelled with its full date. Each event is owned (<code>aria-owns</code>) by the\ncell of the day it starts on in that week. Events are buttons labelled with their title and\ntime, or notes that cannot be focused when <code>events-readonly</code> is set.</p>\n<p>With <code>editable</code>, events are dragged to other days and all-day events resized by\ntheir edges; with <code>addable</code>, dragging across days or clicking one asks for an\nall-day event. The days a drag covers are highlighted.</p>",
1953
+ "overview": "<p>Rendered by <code>wc-calendar</code>; not meant to be used on its own.</p>\n<p>The month is a read-only ARIA grid labelled with the month and year: one row per week, one\ngridcell per day labelled with its full date. Each event is owned (<code>aria-owns</code>) by the\ncell of the day it starts on in that week. Events are buttons labelled with their title and\ntime, or notes that cannot be focused when <code>events-readonly</code> is set. Each day number is\na button that fires <code>date-click</code>; the day of <code>contextDate</code> is marked\nselected. Pressing a day number never starts a drag or adds an event.</p>\n<p>With <code>editable</code>, events are dragged to other days and all-day events resized by\ntheir edges; with <code>addable</code>, dragging across days or clicking one asks for an\nall-day event. The days a drag covers are highlighted.</p>",
1954
1954
  "fires": "event-add - Internal, does not bubble; days were drawn across or a day clicked. `wc-calendar` re-fires it."
1955
1955
  },
1956
1956
  {
@@ -1991,7 +1991,7 @@
1991
1991
  "tag": "wc-card",
1992
1992
  "rawTag": "card",
1993
1993
  "summary": "A surface that groups content and actions about one subject.",
1994
- "overview": "<p>A card is <code>elevated</code> (the default), <code>filled</code> or <code>outlined</code>.\nIt adds no padding of its own: put text in <code>wc-card-content</code>, which can sit next to\nedge-to-edge media.</p>\n<p>Set <code>actionable</code> to make the whole card a single button that fires\n<code>click</code>, or <code>href</code> (with <code>target</code>, <code>rel</code> and\n<code>download</code>) to make it a link. The content of an actionable or link card is inert, so\ndon't put buttons or links inside one; use a plain card with its own actions instead.\n<code>throttle-delay</code> throttles activation.</p>\n<p><code>disabled</code> dims the card and makes its content inert; an actionable or link card\nalso stops responding to clicks and leaves the tab order. With <code>disabled-reason</code> it\nstays focusable and screen readers read the reason with it.</p>",
1994
+ "overview": "<p>A card is <code>elevated</code> (the default), <code>filled</code> or <code>outlined</code>.\nIt adds no padding of its own: put text in <code>wc-card-content</code>, which can sit next to\nedge-to-edge media.</p>\n<p>Set <code>actionable</code> to make the whole card a single button that fires\n<code>click</code>, or <code>href</code> (with <code>target</code>, <code>rel</code> and\n<code>download</code>) to make it a link. The content of an actionable or link card names the\nbutton or link, and anything focusable or clickable inside it stops responding, so don't put\nbuttons or links inside one; use a plain card with its own actions instead.\n<code>throttle-delay</code> throttles activation.</p>\n<p><code>disabled</code> dims the card. A static card's content becomes inert; an actionable or\nlink card stops responding to clicks and leaves the tab order. With <code>disabled-reason</code> it\nstays focusable and screen readers read the reason with it.</p>",
1995
1995
  "cssprop": "--card-gap - Gap between the card's children. Defaults to 0.",
1996
1996
  "example": "```html\n<wc-card variant=\"outlined\">\n <wc-card-content>\n <h3 class=\"text-title-large\">Title</h3>\n <p class=\"text-body-medium\">Supporting text</p>\n </wc-card-content>\n</wc-card>\n```",
1997
1997
  "customElement": {
@@ -2030,7 +2030,7 @@
2030
2030
  "text": "boolean"
2031
2031
  },
2032
2032
  "default": "false",
2033
- "description": "Dims the card and makes its content inert. An actionable or link card also stops responding\nto clicks and leaves the tab order, unless `disabled-reason` is set.",
2033
+ "description": "Dims the card. A static card's content becomes inert. An actionable or link card stops\nresponding to clicks and leaves the tab order, unless `disabled-reason` is set.",
2034
2034
  "fieldName": "disabled"
2035
2035
  },
2036
2036
  {
@@ -2039,7 +2039,7 @@
2039
2039
  "text": "boolean"
2040
2040
  },
2041
2041
  "default": "false",
2042
- "description": "Makes the whole card a single button that fires `click`. Its content becomes inert, so don't\nput buttons or links inside an actionable card.",
2042
+ "description": "Makes the whole card a single button that fires `click`. Its content names the button, and\nanything focusable or clickable inside it stops responding, so don't put buttons or links\ninside an actionable card.",
2043
2043
  "fieldName": "actionable"
2044
2044
  },
2045
2045
  {
@@ -10921,7 +10921,7 @@
10921
10921
  "tag": "wc-dropdown-button",
10922
10922
  "rawTag": "dropdown-button",
10923
10923
  "summary": "A button that opens a menu of actions or options.",
10924
- "overview": "<p>Clicking the button opens its menu, and clicking it again closes it.</p>",
10924
+ "overview": "<p>Clicking the button opens its menu, and clicking it again closes it.</p>\n<p>An <code>aria-label</code> on the dropdown button names its button. Give one to a dropdown\nbutton that shows only an icon.</p>",
10925
10925
  "cssprop": "--dropdown-button-container-shape: Defines the border radius of the dropdown button container shape.",
10926
10926
  "fires": "close - Dispatched after the menu closes: an item pick is `action`, Escape `escape`, a press outside or Tab `light-dismiss`, `close()` `api`.",
10927
10927
  "example": "```html\n<wc-dropdown-button>\n Actions\n <wc-menu-item slot=\"menu\">Edit</wc-menu-item>\n <wc-menu-item slot=\"menu\">Delete</wc-menu-item>\n</wc-dropdown-button>\n```",
@@ -11019,6 +11019,12 @@
11019
11019
  }
11020
11020
  }
11021
11021
  ],
11022
+ "mixins": [
11023
+ {
11024
+ "name": "mixinDelegatesAria",
11025
+ "package": "@/__internal/aria/delegate.js"
11026
+ }
11027
+ ],
11022
11028
  "superclass": {
11023
11029
  "name": "LitElement",
11024
11030
  "package": "lit"
@@ -11544,7 +11550,7 @@
11544
11550
  "type": {
11545
11551
  "text": "number | undefined"
11546
11552
  },
11547
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
11553
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
11548
11554
  "fieldName": "throttleDelay",
11549
11555
  "inheritedFrom": {
11550
11556
  "name": "mixinBaseButton",
@@ -13202,7 +13208,7 @@
13202
13208
  "type": {
13203
13209
  "text": "number | undefined"
13204
13210
  },
13205
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
13211
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
13206
13212
  "fieldName": "throttleDelay",
13207
13213
  "inheritedFrom": {
13208
13214
  "name": "mixinBaseButton",
@@ -13657,7 +13663,7 @@
13657
13663
  "tag": "wc-input",
13658
13664
  "rawTag": "input",
13659
13665
  "summary": "A single-line text field for plain text, an email address or a phone number.",
13660
- "overview": "<p>Input is form-associated: inside a <code>&lt;form&gt;</code> its <code>value</code> is submitted\nunder its <code>name</code>, and <code>form.reset()</code> restores the starting value.</p>\n<p>It validates like a native input: <code>required</code> and an invalid <code>type=\"email\"</code>\nblock form submission, and the message shows under the field once the value is committed or the\nform is submitted. <code>checkValidity()</code>, <code>reportValidity()</code> and\n<code>setCustomValidity()</code> work as on <code>&lt;input&gt;</code>, and so do\n<code>minlength</code>, <code>maxlength</code> and <code>pattern</code>. With\n<code>maxlength</code> a character counter shows under the field.</p>\n<p>For a password, use <code>wc-password-field</code>.</p>",
13666
+ "overview": "<p>Input is form-associated: inside a <code>&lt;form&gt;</code> its <code>value</code> is submitted\nunder its <code>name</code>, and <code>form.reset()</code> restores the starting value. Enter\nsubmits the form as in a native text input: it clicks the form's first submit button, or,\nwithout one, submits a form that has no other text field. A disabled default button blocks it,\nand <code>preventDefault()</code> on the <code>keydown</code> stops it.</p>\n<p>It validates like a native input: <code>required</code> and an invalid <code>type=\"email\"</code>\nblock form submission, and the message shows under the field once the value is committed or the\nform is submitted. <code>checkValidity()</code>, <code>reportValidity()</code> and\n<code>setCustomValidity()</code> work as on <code>&lt;input&gt;</code>, and so do\n<code>minlength</code>, <code>maxlength</code> and <code>pattern</code>. With\n<code>maxlength</code> a character counter shows under the field.</p>\n<p>For a password, use <code>wc-password-field</code>.</p>",
13661
13667
  "fires": "change - Dispatched when the value is committed.",
13662
13668
  "example": "```html\n<wc-input label=\"Name\" required placeholder=\"Enter your name\"></wc-input>\n```",
13663
13669
  "tags": "input, form",
@@ -14594,7 +14600,7 @@
14594
14600
  "type": {
14595
14601
  "text": "number | undefined"
14596
14602
  },
14597
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
14603
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
14598
14604
  "fieldName": "throttleDelay",
14599
14605
  "inheritedFrom": {
14600
14606
  "name": "mixinBaseButton",
@@ -15173,7 +15179,7 @@
15173
15179
  "type": {
15174
15180
  "text": "number | undefined"
15175
15181
  },
15176
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
15182
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
15177
15183
  "fieldName": "throttleDelay",
15178
15184
  "inheritedFrom": {
15179
15185
  "name": "mixinBaseButton",
@@ -16514,7 +16520,7 @@
16514
16520
  "type": {
16515
16521
  "text": "number | undefined"
16516
16522
  },
16517
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
16523
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
16518
16524
  "fieldName": "throttleDelay",
16519
16525
  "inheritedFrom": {
16520
16526
  "name": "mixinBaseButton",
@@ -18392,7 +18398,7 @@
18392
18398
  "tag": "wc-password-field",
18393
18399
  "rawTag": "password-field",
18394
18400
  "summary": "A text field for a password, with a button that shows or hides what was typed.",
18395
- "overview": "<p>Password field hides what is typed until the person presses the show button; pressing it\nagain hides the text. Set <code>autocomplete=\"new-password\"</code> on sign-up and\nchange-password forms so password managers offer to generate one; the default,\n<code>current-password</code>, suits sign-in forms.</p>\n<p>It validates like a native password input: <code>required</code>, <code>minlength</code>,\n<code>maxlength</code> and <code>pattern</code> block form submission, and the message shows under\nthe field once the value is committed or the form is submitted. Inside a <code>&lt;form&gt;</code>\nits <code>value</code> is submitted under its <code>name</code>.</p>",
18401
+ "overview": "<p>Password field hides what is typed until the person presses the show button; pressing it\nagain hides the text. Set <code>autocomplete=\"new-password\"</code> on sign-up and\nchange-password forms so password managers offer to generate one; the default,\n<code>current-password</code>, suits sign-in forms.</p>\n<p>It validates like a native password input: <code>required</code>, <code>minlength</code>,\n<code>maxlength</code> and <code>pattern</code> block form submission, and the message shows under\nthe field once the value is committed or the form is submitted. Inside a <code>&lt;form&gt;</code>\nits <code>value</code> is submitted under its <code>name</code>, and Enter submits the form as in\na native input (see <code>wc-input</code>).</p>",
18396
18402
  "fires": "change - Dispatched when the value is committed.",
18397
18403
  "example": "```html\n<wc-password-field\n label=\"New password\"\n autocomplete=\"new-password\"\n minlength=\"12\"\n helper-text=\"At least 12 characters\"\n></wc-password-field>\n```",
18398
18404
  "tags": "input, form",
@@ -22121,7 +22127,7 @@
22121
22127
  "type": {
22122
22128
  "text": "number | undefined"
22123
22129
  },
22124
- "description": "Sets the delay for throttle in milliseconds. When undefined (default), no throttle is applied.",
22130
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed (no `click` listeners, no form submit, no toggle). When undefined (default), no\nthrottle is applied.",
22125
22131
  "fieldName": "throttleDelay",
22126
22132
  "inheritedFrom": {
22127
22133
  "name": "MenuItem",
@@ -23627,7 +23633,7 @@
23627
23633
  "type": {
23628
23634
  "text": "MouseEvent"
23629
23635
  },
23630
- "description": "Dispatched when the primary action button is clicked.",
23636
+ "description": "Dispatched when the primary action button is clicked, and only then: a menu item's click does not bubble past the split button. Listen on the item, or for the `menu-item-activate` event (`detail.item`) that the menu fires through the split button.",
23631
23637
  "name": "click"
23632
23638
  },
23633
23639
  {
@@ -24013,7 +24019,7 @@
24013
24019
  "tag": "wc-step",
24014
24020
  "rawTag": "step",
24015
24021
  "summary": "One step of a stepper, shown as complete, current or upcoming from its position.",
24016
- "overview": "<p>Step is one entry in a <code>wc-stepper</code>. Its state comes from its position: steps\nbefore the stepper's <code>current</code> step are complete (a check), the current one has\n<code>aria-current=\"step\"</code>, and later ones are upcoming (their number). <code>error</code>\nmarks it with a warning icon and <code>error-text</code>, <code>disabled</code> takes it out of\nnavigation, and <code>optional</code> adds an \"Optional\" caption.</p>\n<p>A screen reader reads each step as its position, label and state, for example\n\"Step 2 of 4, Shipping, Completed\".</p>",
24022
+ "overview": "<p>Step is one entry in a <code>wc-stepper</code>. Its state comes from its position: steps\nbefore the stepper's <code>current</code> step are complete (a check), the current one has\n<code>aria-current=\"step\"</code>, and later ones are upcoming (their number). <code>error</code>\nmarks it with a warning icon and <code>error-text</code>, <code>disabled</code> takes it out of\nnavigation, and <code>optional</code> adds an \"Optional\" caption. The step reflects its state\nas a read-only <code>status</code> attribute (<code>complete</code>, <code>current</code> or\n<code>upcoming</code>) for styling, for example <code>wc-step[status='current']</code>.</p>\n<p>A screen reader reads each step as its position, label and state, for example\n\"Step 2 of 4, Shipping, Completed\".</p>",
24017
24023
  "slot": "icon - An icon shown instead of the step number while the step is current or upcoming.",
24018
24024
  "example": "```html\n<wc-step value=\"shipping\" label=\"Shipping\" description=\"Address and delivery\"></wc-step>\n```",
24019
24025
  "tags": "navigation",
@@ -24633,7 +24639,7 @@
24633
24639
  "type": {
24634
24640
  "text": "number | undefined"
24635
24641
  },
24636
- "description": "Sets the delay for throttle in milliseconds. When unset (default), no throttle is applied.",
24642
+ "description": "Throttles activation by this many milliseconds: after a click, every click inside the delay\nis swallowed, so neither `click` listeners nor `wc-tabs` see it. When unset (default), no\nthrottle is applied.",
24637
24643
  "fieldName": "throttleDelay"
24638
24644
  }
24639
24645
  ],
@@ -26219,7 +26225,7 @@
26219
26225
  "tag": "wc-toolbar",
26220
26226
  "rawTag": "toolbar",
26221
26227
  "summary": "A group of related actions, such as editor formatting controls.",
26222
- "overview": "<p>The toolbar groups related actions into one control. The <code>floating</code> variant\n(default) is an elevated pill that sits over content, such as a canvas or a selection. The\n<code>flat</code> variant has no container of its own, for embedding in existing chrome like a\ncard or editor header. Both variants lay their actions out horizontally or vertically.</p>\n\n<p>Render actions directly as children. Use a <code>wc-divider</code> to separate groups of\nactions; in a horizontal toolbar give it <code>orientation=\"vertical\"</code>.</p>\n\n<p>The toolbar follows the WAI-ARIA toolbar pattern: it is a single tab stop, and the arrow\nkeys along its orientation move focus between actions (Home and End jump to the first and last).\nDisabled actions and dividers are skipped. Give the toolbar an <code>aria-label</code>.</p>",
26228
+ "overview": "<p>The toolbar groups related actions into one control. The <code>floating</code> variant\n(default) is an elevated pill that sits over content, such as a canvas or a selection. The\n<code>flat</code> variant has no container of its own, for embedding in existing chrome like a\ncard or editor header. Both variants lay their actions out horizontally or vertically.</p>\n\n<p>Render actions directly as children. Use a <code>wc-divider</code> to separate groups of\nactions; in a horizontal toolbar give it <code>orientation=\"vertical\"</code>.</p>\n\n<p>The toolbar follows the WAI-ARIA toolbar pattern: it is a single tab stop, and the arrow\nkeys along its orientation move focus between actions (Home and End jump to the first and last).\nDisabled actions and dividers are skipped, and when the action that holds the tab stop becomes\ndisabled or hidden, the next enabled action (else the previous one) takes it over. Give the\ntoolbar an <code>aria-label</code>.</p>",
26223
26229
  "cssprop": "--toolbar-wrap - `wrap` lets actions flow onto more lines when the toolbar is narrow. Defaults to `nowrap`.",
26224
26230
  "example": "```html\n<!-- Flat toolbar inside existing chrome -->\n<wc-toolbar variant=\"flat\" aria-label=\"Row actions\">\n <wc-icon-button variant=\"text\" color=\"surface\" aria-label=\"Edit\"><wc-icon name=\"edit\"></wc-icon></wc-icon-button>\n <wc-icon-button variant=\"text\" color=\"surface\" aria-label=\"Delete\"><wc-icon name=\"delete\"></wc-icon></wc-icon-button>\n</wc-toolbar>\n```",
26225
26231
  "tags": "display",