@aurodesignsystem-dev/auro-formkit 0.0.0-pr1628.1 → 0.0.0-pr1628.11

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 (158) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +1 -1
  2. package/components/bibtemplate/dist/index.js +1 -1
  3. package/components/bibtemplate/dist/registered.js +1 -1
  4. package/components/checkbox/README.md +1 -1
  5. package/components/checkbox/demo/accessibility.md +2 -2
  6. package/components/checkbox/demo/api.md +17 -17
  7. package/components/checkbox/demo/customize.md +16 -16
  8. package/components/checkbox/demo/customize.min.js +4 -4
  9. package/components/checkbox/demo/design.md +24 -24
  10. package/components/checkbox/demo/getting-started.md +33 -27
  11. package/components/checkbox/demo/getting-started.min.js +4 -4
  12. package/components/checkbox/demo/index.md +17 -17
  13. package/components/checkbox/demo/index.min.js +4 -4
  14. package/components/checkbox/demo/readme.md +1 -1
  15. package/components/checkbox/dist/auro-checkbox-group.d.ts +2 -2
  16. package/components/checkbox/dist/index.js +4 -4
  17. package/components/checkbox/dist/registered.js +4 -4
  18. package/components/combobox/demo/api.md +3 -3
  19. package/components/combobox/demo/css-only.md +3 -3
  20. package/components/combobox/demo/customize.md +12 -12
  21. package/components/combobox/demo/customize.min.js +53 -35
  22. package/components/combobox/demo/getting-started.min.js +53 -35
  23. package/components/combobox/demo/index.md +1 -1
  24. package/components/combobox/demo/index.min.js +53 -35
  25. package/components/combobox/dist/auro-combobox.d.ts +6 -4
  26. package/components/combobox/dist/index.js +42 -25
  27. package/components/combobox/dist/registered.js +42 -25
  28. package/components/counter/demo/accessibility.md +1 -1
  29. package/components/counter/demo/api.md +18 -18
  30. package/components/counter/demo/css-only.md +1 -1
  31. package/components/counter/demo/customize.md +2 -2
  32. package/components/counter/demo/customize.min.js +30 -30
  33. package/components/counter/demo/design.md +1 -1
  34. package/components/counter/demo/getting-started.md +29 -2
  35. package/components/counter/demo/getting-started.min.js +30 -30
  36. package/components/counter/demo/index.min.js +30 -30
  37. package/components/counter/demo/why-counter.md +3 -3
  38. package/components/counter/dist/auro-counter-group.d.ts +13 -14
  39. package/components/counter/dist/auro-counter.d.ts +1 -1
  40. package/components/counter/dist/index.js +30 -30
  41. package/components/counter/dist/registered.js +30 -30
  42. package/components/datepicker/README.md +1 -1
  43. package/components/datepicker/demo/accessibility.md +5 -5
  44. package/components/datepicker/demo/api.md +3 -3
  45. package/components/datepicker/demo/css-only.md +4 -4
  46. package/components/datepicker/demo/customize.md +12 -12
  47. package/components/datepicker/demo/customize.min.js +189 -135
  48. package/components/datepicker/demo/design.md +11 -11
  49. package/components/datepicker/demo/getting-started.md +4 -4
  50. package/components/datepicker/demo/getting-started.min.js +189 -135
  51. package/components/datepicker/demo/index.md +5 -5
  52. package/components/datepicker/demo/index.min.js +189 -135
  53. package/components/datepicker/demo/keyboard-behavior.md +1 -1
  54. package/components/datepicker/demo/readme.md +1 -1
  55. package/components/datepicker/demo/voiceover.md +4 -4
  56. package/components/datepicker/demo/why-datepicker.md +3 -3
  57. package/components/datepicker/dist/auro-calendar-cell.d.ts +32 -33
  58. package/components/datepicker/dist/auro-calendar-month.d.ts +8 -8
  59. package/components/datepicker/dist/auro-calendar.d.ts +44 -43
  60. package/components/datepicker/dist/auro-datepicker.d.ts +12 -10
  61. package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +3 -0
  62. package/components/datepicker/dist/index.js +189 -135
  63. package/components/datepicker/dist/registered.js +189 -135
  64. package/components/datepicker/dist/utilities.d.ts +4 -1
  65. package/components/datepicker/dist/utilitiesCalendar.d.ts +12 -4
  66. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +12 -6
  67. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +4 -4
  68. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +7 -7
  69. package/components/dropdown/demo/api.md +7 -7
  70. package/components/dropdown/demo/css-only.md +2 -2
  71. package/components/dropdown/demo/customize.md +1 -1
  72. package/components/dropdown/demo/customize.min.js +11 -10
  73. package/components/dropdown/demo/design.md +4 -4
  74. package/components/dropdown/demo/getting-started.min.js +33 -18
  75. package/components/dropdown/demo/index.min.js +11 -10
  76. package/components/dropdown/demo/voiceover.md +1 -1
  77. package/components/dropdown/demo/why-dropdown.md +1 -1
  78. package/components/dropdown/dist/auro-dropdown.d.ts +9 -8
  79. package/components/dropdown/dist/index.js +11 -10
  80. package/components/dropdown/dist/registered.js +11 -10
  81. package/components/form/README.md +1 -1
  82. package/components/form/demo/api.md +7 -7
  83. package/components/form/demo/css-only.md +1 -1
  84. package/components/form/demo/customize.md +2 -0
  85. package/components/form/demo/customize.min.js +329 -243
  86. package/components/form/demo/getting-started.md +2 -0
  87. package/components/form/demo/getting-started.min.js +329 -243
  88. package/components/form/demo/index.md +2 -2
  89. package/components/form/demo/index.min.js +329 -243
  90. package/components/form/demo/keyboard-behavior.md +1 -1
  91. package/components/form/demo/readme.md +1 -1
  92. package/components/form/demo/registerDemoDeps.min.js +327 -241
  93. package/components/form/demo/voiceover.md +3 -3
  94. package/components/form/demo/why-form.md +1 -1
  95. package/components/form/dist/auro-form.d.ts +2 -2
  96. package/components/form/dist/index.js +2 -2
  97. package/components/form/dist/registered.js +2 -2
  98. package/components/helptext/dist/auro-helptext.d.ts +1 -1
  99. package/components/helptext/dist/index.js +1 -1
  100. package/components/helptext/dist/registered.js +1 -1
  101. package/components/input/demo/api.md +58 -58
  102. package/components/input/demo/css-only.md +4 -4
  103. package/components/input/demo/customize.md +11 -11
  104. package/components/input/demo/customize.min.js +22 -8
  105. package/components/input/demo/design.md +2 -2
  106. package/components/input/demo/getting-started.md +5 -5
  107. package/components/input/demo/getting-started.min.js +22 -8
  108. package/components/input/demo/index.md +1 -1
  109. package/components/input/demo/index.min.js +22 -8
  110. package/components/input/demo/why-input.md +3 -3
  111. package/components/input/dist/auro-input.d.ts +1 -1
  112. package/components/input/dist/base-input.d.ts +6 -5
  113. package/components/input/dist/index.js +22 -8
  114. package/components/input/dist/registered.js +22 -8
  115. package/components/input/dist/utilities.d.ts +11 -0
  116. package/components/menu/demo/accessibility.md +1 -1
  117. package/components/menu/demo/api.md +1 -1
  118. package/components/menu/demo/css-only.md +4 -4
  119. package/components/menu/demo/customize.md +1 -1
  120. package/components/menu/demo/design.md +1 -1
  121. package/components/menu/demo/getting-started.md +3 -3
  122. package/components/menu/demo/index.min.js +11 -10
  123. package/components/menu/demo/keyboard-behavior.md +1 -1
  124. package/components/menu/demo/voiceover.md +1 -1
  125. package/components/menu/demo/why-menu.md +3 -3
  126. package/components/menu/dist/auro-menu.d.ts +10 -9
  127. package/components/menu/dist/auro-menuoption.d.ts +1 -1
  128. package/components/menu/dist/index.js +11 -10
  129. package/components/menu/dist/registered.js +11 -10
  130. package/components/radio/demo/accessibility.md +1 -1
  131. package/components/radio/demo/api.md +10 -10
  132. package/components/radio/demo/customize.md +15 -5
  133. package/components/radio/demo/customize.min.js +11 -13
  134. package/components/radio/demo/design.md +1 -1
  135. package/components/radio/demo/getting-started.md +6 -6
  136. package/components/radio/demo/getting-started.min.js +11 -13
  137. package/components/radio/demo/index.md +1 -1
  138. package/components/radio/demo/index.min.js +11 -13
  139. package/components/radio/demo/keyboard-behavior.md +1 -1
  140. package/components/radio/demo/voiceover.md +1 -1
  141. package/components/radio/demo/why-radio.md +1 -1
  142. package/components/radio/dist/auro-radio-group.d.ts +6 -8
  143. package/components/radio/dist/auro-radio.d.ts +3 -3
  144. package/components/radio/dist/index.js +11 -13
  145. package/components/radio/dist/registered.js +11 -13
  146. package/components/select/demo/api.md +1 -1
  147. package/components/select/demo/css-only.md +1 -1
  148. package/components/select/demo/customize.md +1 -1
  149. package/components/select/demo/customize.min.js +29 -26
  150. package/components/select/demo/getting-started.min.js +29 -26
  151. package/components/select/demo/index.md +1 -1
  152. package/components/select/demo/index.min.js +29 -26
  153. package/components/select/demo/voiceover.md +1 -1
  154. package/components/select/dist/auro-select.d.ts +4 -3
  155. package/components/select/dist/index.js +18 -16
  156. package/components/select/dist/registered.js +18 -16
  157. package/custom-elements.json +149 -133
  158. package/package.json +1 -1
@@ -57,10 +57,10 @@
57
57
  <p><code>auro-menu</code> tracks the active option internally (via an <code>active</code> CSS class on the current <code>auro-menuoption</code>) rather than moving DOM focus between options. In typical integrations (<code>&lt;auro-select&gt;</code>, <code>&lt;auro-combobox&gt;</code>), focus remains on the parent trigger/input and <code>aria-activedescendant</code> points at the active option; if you make <code>&lt;auro-menu&gt;</code> focusable (for example, <code>tabindex="0"</code>), the same active-option model applies while focus is on the menu host. With plain HTML, you must pick one focus model, either roving <code>tabindex="0"</code>/<code>tabindex="-1"</code> or <code>aria-activedescendant</code> on the container, and wire up the DOM writes yourself on every key event.</p>
58
58
  <auro-header level="3">Arrow-key navigation</auro-header>
59
59
  <p><code>auro-menu</code> handles <code>ArrowUp</code>, <code>ArrowDown</code>, <code>Enter</code>, and <code>Tab</code> to move the highlight and commit selections. Native <code>&lt;ul&gt;</code> elements have no built-in keyboard model: you must wire up <code>keydown</code> listeners, track the highlighted index, and prevent default browser scrolling on the arrow keys yourself.</p>
60
- <auro-header level="3">matchWord highlighting</auro-header>
60
+ <auro-header level="3"><code>matchWord</code> highlighting</auro-header>
61
61
  <p><code>auro-menu</code> supports a <code>matchword</code> attribute (the <code>matchWord</code> property) that highlights matched substrings within option labels. <code>auro-combobox</code> uses it to visually mark the user's typed input inside each filtered option. Plain HTML provides no equivalent; you must walk each option and wrap matched substrings yourself.</p>
62
62
  <auro-header level="3">Type-ahead navigation</auro-header>
63
- <p>Type-ahead, which moves the active option to whichever entry starts with the letters the user typed, <strong>isn't</strong> handled by <code>auro-menu</code> itself. It's provided by the parent selection component (<code>auro-select</code>, <code>auro-combobox</code>) which captures printable characters on its trigger and calls back into the menu. A plain-HTML listbox has no such wiring and would need a bespoke keydown handler that tracks a rolling character buffer and resolves it against the option list.</p>
63
+ <p>Type-ahead, which moves the active option to an option that starts with the letters someone types, <strong>isn't</strong> handled by <code>auro-menu</code> itself. <code>auro-select</code> provides it: it captures typed characters on its trigger and calls the menu's <code>updateActiveOption()</code> method. <code>auro-combobox</code> doesn't use type-ahead, because typing goes into its input. A plain-HTML listbox has no such wiring and would need a bespoke <code>keydown</code> handler that tracks a rolling character buffer and resolves it against the option list.</p>
64
64
  <auro-header level="3">Nested submenu support</auro-header>
65
65
  <p><code>auro-menu</code> detects nested <code>auro-menu</code> elements, applies the correct <code>role="group"</code>, and computes indentation per level. The root menu treats all descendant options as a single flat list, so selecting an option inside a nested menu updates the root menu's <code>value</code> and <code>optionSelected</code>. The root always owns the selection state. With plain HTML, you must apply nested ARIA roles and indentation manually.</p>
66
66
  <auro-header level="3">Selection state coordination</auro-header>
@@ -76,7 +76,7 @@
76
76
  <auro-header level="3">Select-by-value and reset</auro-header>
77
77
  <p><code>auro-menu</code> exposes a <code>value</code> attribute that drives selection programmatically (accepting a JSON-stringified array in multi-select mode) and a single <code>reset()</code> method that clears the selection and the active option. With plain HTML, you must walk the list to find a matching option, set its state, and write your own reset routine.</p>
78
78
  <auro-header level="3">Loading state</auro-header>
79
- <p><code>auro-menu</code> renders a built-in loading placeholder via <code>loadingIcon</code> and <code>loadingText</code> slots, sets <code>aria-busy</code>, and emits <code>auroMenu-loadingChange</code> when the loading attribute toggles. With plain HTML, you must render a placeholder, manage <code>aria-busy</code>, and signal loading transitions yourself.</p>
79
+ <p><code>auro-menu</code> renders a built-in loading placeholder via <code>loadingIcon</code> and <code>loadingText</code> slots, sets <code>aria-busy</code>, and emits <code>auroMenu-loadingChange</code> when the <code>loading</code> attribute toggles. With plain HTML, you must render a placeholder, manage <code>aria-busy</code>, and signal loading transitions yourself.</p>
80
80
  <auro-header level="3">Shape and size variants</auro-header>
81
81
  <p><code>auro-menu</code> supports <code>shape</code> (<code>box</code>, <code>pill</code>, <code>snowflake</code>) and <code>size</code> (<code>xs</code>–<code>xl</code>) variants that adjust spacing and corner radii consistently across the menu and its options. A CSS-only listbox must reauthor each variant by hand.</p>
82
82
  <auro-header level="3">Multi-brand theming</auro-header>
@@ -114,7 +114,7 @@
114
114
  <tr>
115
115
  <td>Type-ahead navigation</td>
116
116
  <td>Not supported</td>
117
- <td>Provided by parent <code>auro-select</code> / <code>auro-combobox</code></td>
117
+ <td>Provided by parent <code>auro-select</code></td>
118
118
  </tr>
119
119
  <tr>
120
120
  <td>Nested submenus</td>
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Menu - Customize</auro-header>
1
+ <auro-header level="1" id="overview">Menu: Customize</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <nav>
4
4
  <auro-nav anchorNavContent=".scrollWrapper">
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Menu - Design</auro-header>
1
+ <auro-header level="1" id="overview">Menu: Design</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <div class="mainContent">
4
4
  <div class="scrollWrapper">
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Menu - Getting started</auro-header>
1
+ <auro-header level="1" id="overview">Menu: Getting started</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <nav>
4
4
  <auro-nav anchorNavContent=".scrollWrapper">
@@ -370,7 +370,7 @@ Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript c
370
370
  </section>
371
371
  <section>
372
372
  <auro-header level="2" id="events">Events</auro-header>
373
- <p>The <code>&lt;auro-menu&gt;</code> element dispatches custom events that consumers can subscribe to via <code>addEventListener</code>. The example below listens for the selection, active-option, options, reset, and failure events and logs each one.</p>
373
+ <p>Listen for these custom events from <code>&lt;auro-menu&gt;</code> with <code>addEventListener</code>. The example below listens for the selection, active-option, options, reset, and failure events and logs each one.</p>
374
374
  <auro-header level="3" id="eventList">Event list</auro-header>
375
375
  <ul>
376
376
  <li><code>auroMenu-selectedOption</code>: the selection changed, including when an option is deselected or the selection is cleared. In single-select mode, it also fires when the already-selected option is chosen again.</li>
@@ -378,7 +378,7 @@ Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript c
378
378
  <li><code>auroMenu-optionsChange</code>: the set of available options was updated, such as after a slot change.</li>
379
379
  <li><code>auroMenu-selectValueReset</code>: the menu's <code>value</code> was reset with <code>reset()</code>.</li>
380
380
  <li><code>auroMenu-selectValueFailure</code>: a value selection (through <code>selectByValue()</code>, the <code>value</code> attribute, or setting the <code>value</code> property) found no matching selectable option. This includes values that match an option marked <code>disabled</code> or <code>static</code>, which are never selectable. It also fires in multi-select mode when someone chooses an option with no <code>value</code>.</li>
381
- <li><code>auroMenu-loadingChange</code>: the <code>loading</code> attribute changed.</li>
381
+ <li><code>auroMenu-loadingChange</code>: the <code>loading</code> attribute changed. It also fires once when the menu first renders.</li>
382
382
  <li><code>auroMenu-customEventFired</code>: the menu fired the event named in an option's <code>event</code> attribute. See <a href="#eventAttribute">Option event attribute</a>.</li>
383
383
  </ul>
384
384
  <div class="exampleWrapper">
@@ -487,7 +487,7 @@ let menuInstanceIdCounter = 0;
487
487
  *
488
488
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Fires when an option becomes the active (highlighted) option, through the arrow keys, hover, or `updateActiveOption()`. The option is in `detail`.
489
489
  * @event {CustomEvent<any>} auroMenu-customEventFired - Fires right after the menu fires the event named in an option's `event` attribute. The option is in `detail.option`.
490
- * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes.
490
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes, and once when the menu first renders.
491
491
  * @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Fires when the set of options in the menu changes.
492
492
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Fires when a value doesn't match any option that can be selected, or when someone chooses an option with no `value` in multi-select mode.
493
493
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Fires when `reset()` clears the menu.
@@ -632,7 +632,7 @@ class AuroMenu extends AuroElement {
632
632
  },
633
633
 
634
634
  /**
635
- * Indent level for submenus.
635
+ * Holds how deeply a nested menu is indented, which sets how many spacers its options get.
636
636
  * @private
637
637
  */
638
638
  level: {
@@ -804,8 +804,8 @@ class AuroMenu extends AuroElement {
804
804
  }
805
805
 
806
806
  /**
807
- * Formatted value based on `multiSelect` state.
808
- * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
807
+ * Gets `value` in the shape the menu works with: the string itself, or, in multi-select mode,
808
+ * an array of values parsed from the JSON array string.
809
809
  * @private
810
810
  * @returns {String|Array<String>}
811
811
  */
@@ -1615,7 +1615,7 @@ class AuroMenu extends AuroElement {
1615
1615
  }
1616
1616
 
1617
1617
  /**
1618
- * Handles keyboard navigation and selection.
1618
+ * Called when a key is pressed in the menu. The arrow keys move the active option, and Enter and Tab select it.
1619
1619
  * @private
1620
1620
  * @param {KeyboardEvent} event - The keydown event.
1621
1621
  */
@@ -1641,7 +1641,7 @@ class AuroMenu extends AuroElement {
1641
1641
  }
1642
1642
 
1643
1643
  /**
1644
- * Handles option selection via click events from menuoptions.
1644
+ * Called when an option fires `auroMenuOption-click`. Selects the clicked option, unless the menu is disabled or nested in another menu.
1645
1645
  * @private
1646
1646
  * @param {CustomEvent} event - The auroMenuOption-click event.
1647
1647
  */
@@ -1661,7 +1661,7 @@ class AuroMenu extends AuroElement {
1661
1661
  }
1662
1662
 
1663
1663
  /**
1664
- * Handles option hover events.
1664
+ * Called when the pointer moves over an option. Makes it the active option, unless it can't be highlighted.
1665
1665
  * @private
1666
1666
  * @param {CustomEvent} event - The `auroMenuOption-mouseover` event.
1667
1667
  */
@@ -1685,7 +1685,7 @@ class AuroMenu extends AuroElement {
1685
1685
  }
1686
1686
 
1687
1687
  /**
1688
- * Handles slot change events.
1688
+ * Called when the menu's content changes. Sets the menu up again, and re-applies a `value` that was set before the options arrived.
1689
1689
  * @private
1690
1690
  */
1691
1691
  handleSlotChange() {
@@ -1781,7 +1781,7 @@ class AuroMenu extends AuroElement {
1781
1781
  }
1782
1782
 
1783
1783
  /**
1784
- * Handles custom events defined on options.
1784
+ * Fires the event named in the option's `event` attribute, then `auroMenu-customEventFired`, with the option in `detail.option`.
1785
1785
  * @private
1786
1786
  * @param {HTMLElement} option - Option with custom event.
1787
1787
  */
@@ -1801,6 +1801,7 @@ class AuroMenu extends AuroElement {
1801
1801
  }
1802
1802
 
1803
1803
  /**
1804
+ * Checks whether two selections hold the same options, in any order.
1804
1805
  * @private
1805
1806
  * @param {any} current - The current selection.
1806
1807
  * @param {any} next - The new selection to compare.
@@ -2283,7 +2284,7 @@ class AuroMenuOption extends AuroElement {
2283
2284
  }
2284
2285
 
2285
2286
  /**
2286
- * Handles click events on the menu option.
2287
+ * Called when the option is clicked. Fires `auroMenuOption-click`, unless the option or a menu containing it is disabled.
2287
2288
  * @private
2288
2289
  */
2289
2290
  handleClick() {
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Menu - Keyboard behavior</auro-header>
1
+ <auro-header level="1" id="overview">Menu: Keyboard behavior</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <div class="mainContent">
4
4
  <div class="scrollWrapper">
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Menu - VoiceOver behavior</auro-header>
1
+ <auro-header level="1" id="overview">Menu: VoiceOver behavior</auro-header>
2
2
  <p>This page documents the VoiceOver experience when using the <code>&lt;auro-menu&gt;</code> component. It covers announcements and interactions for menu navigation and option selection.</p>
3
3
  <div class="note"><strong>Note:</strong> In the standard integrations (<code>&lt;auro-select&gt;</code>, <code>&lt;auro-combobox&gt;</code>), keyboard focus stays on the parent trigger or input and <strong>doesn't</strong> move into the menu. The parent captures keys and drives the menu, and the active option is announced via <code>aria-activedescendant</code> on the trigger rather than by moving DOM focus between options. The focus-on-the-menu behavior described alongside the standalone case below only applies when an author makes <code>&lt;auro-menu&gt;</code> itself focusable (for example, <code>tabindex="0"</code>).</p>
4
4
  <auro-header level="2" id="voiceOverInteractiveAnnouncements">Interactive announcements</auro-header>
@@ -7,7 +7,7 @@
7
7
  <li><strong>Keyboard navigation:</strong> Arrow Up/Down move the active option; Enter selects it; Tab selects and moves focus out of the menu.</li>
8
8
  <li><strong>Active option tracking:</strong> The menu tracks the highlighted option, so parent components, such as <code>auro-select</code> and <code>auro-combobox</code>, can point <code>aria-activedescendant</code> at it.</li>
9
9
  <li><strong>Multi-select semantics:</strong> When <code>multiSelect</code> is on, the menu sets <code>aria-multiselectable</code>.</li>
10
- <li><strong>Loading state:</strong> The menu sets <code>aria-busy</code> while loading, and the <code>loadingIcon</code> and <code>loadingText</code> slots let you customize the loading indicator.</li>
10
+ <li><strong>Loading state:</strong> The menu sets <code>aria-busy</code> while loading, and shows the content of the <code>loadingIcon</code> and <code>loadingText</code> slots in place of the options.</li>
11
11
  </ul>
12
12
  <auro-header level="2" id="richOptionContent">Rich option content</auro-header>
13
13
  <p><code>&lt;option&gt;</code> elements accept only plain text. Native HTML has no way to add icons, descriptions, or nested structure to options.</p>
@@ -39,8 +39,8 @@
39
39
  <p>Native selects have no loading pattern. When options load asynchronously, native HTML has no standard way to tell people they're still loading.</p>
40
40
  <p><code>auro-menu</code> provides:</p>
41
41
  <ul>
42
- <li>A <code>loading</code> attribute that displays a loading indicator</li>
43
- <li><code>loadingIcon</code> and <code>loadingText</code> slots for custom loading UI</li>
42
+ <li>A <code>loading</code> attribute that replaces the options with a loading placeholder</li>
43
+ <li><code>loadingIcon</code> and <code>loadingText</code> slots for the icon and text the placeholder shows</li>
44
44
  <li><code>auroMenu-loadingChange</code> event when the loading state changes</li>
45
45
  </ul>
46
46
  <auro-header level="2" id="composability">Composability</auro-header>
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Fires when an option becomes the active (highlighted) option, through the arrow keys, hover, or `updateActiveOption()`. The option is in `detail`.
22
22
  * @event {CustomEvent<any>} auroMenu-customEventFired - Fires right after the menu fires the event named in an option's `event` attribute. The option is in `detail.option`.
23
- * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes.
23
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes, and once when the menu first renders.
24
24
  * @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Fires when the set of options in the menu changes.
25
25
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Fires when a value doesn't match any option that can be selected, or when someone chooses an option with no `value` in multi-select mode.
26
26
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Fires when `reset()` clears the menu.
@@ -63,7 +63,7 @@ export class AuroMenu extends AuroElement {
63
63
  reflect: boolean;
64
64
  };
65
65
  /**
66
- * Indent level for submenus.
66
+ * Holds how deeply a nested menu is indented, which sets how many spacers its options get.
67
67
  * @private
68
68
  */
69
69
  level: {
@@ -135,25 +135,25 @@ export class AuroMenu extends AuroElement {
135
135
  loading: boolean;
136
136
  multiSelect: boolean;
137
137
  /**
138
- * Handles keyboard navigation and selection.
138
+ * Called when a key is pressed in the menu. The arrow keys move the active option, and Enter and Tab select it.
139
139
  * @private
140
140
  * @param {KeyboardEvent} event - The keydown event.
141
141
  */
142
142
  private handleKeyDown;
143
143
  /**
144
- * Handles option selection via click events from menuoptions.
144
+ * Called when an option fires `auroMenuOption-click`. Selects the clicked option, unless the menu is disabled or nested in another menu.
145
145
  * @private
146
146
  * @param {CustomEvent} event - The auroMenuOption-click event.
147
147
  */
148
148
  private handleMouseSelect;
149
149
  /**
150
- * Handles option hover events.
150
+ * Called when the pointer moves over an option. Makes it the active option, unless it can't be highlighted.
151
151
  * @private
152
152
  * @param {CustomEvent} event - The `auroMenuOption-mouseover` event.
153
153
  */
154
154
  private handleOptionHover;
155
155
  /**
156
- * Handles slot change events.
156
+ * Called when the menu's content changes. Sets the menu up again, and re-applies a `value` that was set before the options arrived.
157
157
  * @private
158
158
  */
159
159
  private handleSlotChange;
@@ -203,8 +203,8 @@ export class AuroMenu extends AuroElement {
203
203
  */
204
204
  readonly get currentLabel(): string;
205
205
  /**
206
- * Formatted value based on `multiSelect` state.
207
- * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
206
+ * Gets `value` in the shape the menu works with: the string itself, or, in multi-select mode,
207
+ * an array of values parsed from the JSON array string.
208
208
  * @private
209
209
  * @returns {String|Array<String>}
210
210
  */
@@ -316,7 +316,7 @@ export class AuroMenu extends AuroElement {
316
316
  */
317
317
  updateActiveOption(indexOrOption: number | HTMLElement): void;
318
318
  /**
319
- * Handles custom events defined on options.
319
+ * Fires the event named in the option's `event` attribute, then `auroMenu-customEventFired`, with the option in `detail.option`.
320
320
  * @private
321
321
  * @param {HTMLElement} option - Option with custom event.
322
322
  */
@@ -328,6 +328,7 @@ export class AuroMenu extends AuroElement {
328
328
  */
329
329
  private notifySelectionChange;
330
330
  /**
331
+ * Checks whether two selections hold the same options, in any order.
331
332
  * @private
332
333
  * @param {any} current - The current selection.
333
334
  * @param {any} next - The new selection to compare.
@@ -175,7 +175,7 @@ export class AuroMenuOption extends AuroElement {
175
175
  */
176
176
  attachTo(): void;
177
177
  /**
178
- * Handles click events on the menu option.
178
+ * Called when the option is clicked. Fires `auroMenuOption-click`, unless the option or a menu containing it is disabled.
179
179
  * @private
180
180
  */
181
181
  private handleClick;
@@ -492,7 +492,7 @@ let menuInstanceIdCounter = 0;
492
492
  *
493
493
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Fires when an option becomes the active (highlighted) option, through the arrow keys, hover, or `updateActiveOption()`. The option is in `detail`.
494
494
  * @event {CustomEvent<any>} auroMenu-customEventFired - Fires right after the menu fires the event named in an option's `event` attribute. The option is in `detail.option`.
495
- * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes.
495
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes, and once when the menu first renders.
496
496
  * @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Fires when the set of options in the menu changes.
497
497
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Fires when a value doesn't match any option that can be selected, or when someone chooses an option with no `value` in multi-select mode.
498
498
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Fires when `reset()` clears the menu.
@@ -637,7 +637,7 @@ class AuroMenu extends AuroElement {
637
637
  },
638
638
 
639
639
  /**
640
- * Indent level for submenus.
640
+ * Holds how deeply a nested menu is indented, which sets how many spacers its options get.
641
641
  * @private
642
642
  */
643
643
  level: {
@@ -809,8 +809,8 @@ class AuroMenu extends AuroElement {
809
809
  }
810
810
 
811
811
  /**
812
- * Formatted value based on `multiSelect` state.
813
- * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
812
+ * Gets `value` in the shape the menu works with: the string itself, or, in multi-select mode,
813
+ * an array of values parsed from the JSON array string.
814
814
  * @private
815
815
  * @returns {String|Array<String>}
816
816
  */
@@ -1620,7 +1620,7 @@ class AuroMenu extends AuroElement {
1620
1620
  }
1621
1621
 
1622
1622
  /**
1623
- * Handles keyboard navigation and selection.
1623
+ * Called when a key is pressed in the menu. The arrow keys move the active option, and Enter and Tab select it.
1624
1624
  * @private
1625
1625
  * @param {KeyboardEvent} event - The keydown event.
1626
1626
  */
@@ -1646,7 +1646,7 @@ class AuroMenu extends AuroElement {
1646
1646
  }
1647
1647
 
1648
1648
  /**
1649
- * Handles option selection via click events from menuoptions.
1649
+ * Called when an option fires `auroMenuOption-click`. Selects the clicked option, unless the menu is disabled or nested in another menu.
1650
1650
  * @private
1651
1651
  * @param {CustomEvent} event - The auroMenuOption-click event.
1652
1652
  */
@@ -1666,7 +1666,7 @@ class AuroMenu extends AuroElement {
1666
1666
  }
1667
1667
 
1668
1668
  /**
1669
- * Handles option hover events.
1669
+ * Called when the pointer moves over an option. Makes it the active option, unless it can't be highlighted.
1670
1670
  * @private
1671
1671
  * @param {CustomEvent} event - The `auroMenuOption-mouseover` event.
1672
1672
  */
@@ -1690,7 +1690,7 @@ class AuroMenu extends AuroElement {
1690
1690
  }
1691
1691
 
1692
1692
  /**
1693
- * Handles slot change events.
1693
+ * Called when the menu's content changes. Sets the menu up again, and re-applies a `value` that was set before the options arrived.
1694
1694
  * @private
1695
1695
  */
1696
1696
  handleSlotChange() {
@@ -1786,7 +1786,7 @@ class AuroMenu extends AuroElement {
1786
1786
  }
1787
1787
 
1788
1788
  /**
1789
- * Handles custom events defined on options.
1789
+ * Fires the event named in the option's `event` attribute, then `auroMenu-customEventFired`, with the option in `detail.option`.
1790
1790
  * @private
1791
1791
  * @param {HTMLElement} option - Option with custom event.
1792
1792
  */
@@ -1806,6 +1806,7 @@ class AuroMenu extends AuroElement {
1806
1806
  }
1807
1807
 
1808
1808
  /**
1809
+ * Checks whether two selections hold the same options, in any order.
1809
1810
  * @private
1810
1811
  * @param {any} current - The current selection.
1811
1812
  * @param {any} next - The new selection to compare.
@@ -2275,7 +2276,7 @@ class AuroMenuOption extends AuroElement {
2275
2276
  }
2276
2277
 
2277
2278
  /**
2278
- * Handles click events on the menu option.
2279
+ * Called when the option is clicked. Fires `auroMenuOption-click`, unless the option or a menu containing it is disabled.
2279
2280
  * @private
2280
2281
  */
2281
2282
  handleClick() {
@@ -453,7 +453,7 @@ let menuInstanceIdCounter = 0;
453
453
  *
454
454
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Fires when an option becomes the active (highlighted) option, through the arrow keys, hover, or `updateActiveOption()`. The option is in `detail`.
455
455
  * @event {CustomEvent<any>} auroMenu-customEventFired - Fires right after the menu fires the event named in an option's `event` attribute. The option is in `detail.option`.
456
- * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes.
456
+ * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Fires when `loading` changes, and once when the menu first renders.
457
457
  * @event {CustomEvent<{ options: Array<HTMLElement> }>} auroMenu-optionsChange - Fires when the set of options in the menu changes.
458
458
  * @event {CustomEvent<any>} auroMenu-selectValueFailure - Fires when a value doesn't match any option that can be selected, or when someone chooses an option with no `value` in multi-select mode.
459
459
  * @event {CustomEvent<any>} auroMenu-selectValueReset - Fires when `reset()` clears the menu.
@@ -598,7 +598,7 @@ class AuroMenu extends AuroElement {
598
598
  },
599
599
 
600
600
  /**
601
- * Indent level for submenus.
601
+ * Holds how deeply a nested menu is indented, which sets how many spacers its options get.
602
602
  * @private
603
603
  */
604
604
  level: {
@@ -770,8 +770,8 @@ class AuroMenu extends AuroElement {
770
770
  }
771
771
 
772
772
  /**
773
- * Formatted value based on `multiSelect` state.
774
- * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
773
+ * Gets `value` in the shape the menu works with: the string itself, or, in multi-select mode,
774
+ * an array of values parsed from the JSON array string.
775
775
  * @private
776
776
  * @returns {String|Array<String>}
777
777
  */
@@ -1581,7 +1581,7 @@ class AuroMenu extends AuroElement {
1581
1581
  }
1582
1582
 
1583
1583
  /**
1584
- * Handles keyboard navigation and selection.
1584
+ * Called when a key is pressed in the menu. The arrow keys move the active option, and Enter and Tab select it.
1585
1585
  * @private
1586
1586
  * @param {KeyboardEvent} event - The keydown event.
1587
1587
  */
@@ -1607,7 +1607,7 @@ class AuroMenu extends AuroElement {
1607
1607
  }
1608
1608
 
1609
1609
  /**
1610
- * Handles option selection via click events from menuoptions.
1610
+ * Called when an option fires `auroMenuOption-click`. Selects the clicked option, unless the menu is disabled or nested in another menu.
1611
1611
  * @private
1612
1612
  * @param {CustomEvent} event - The auroMenuOption-click event.
1613
1613
  */
@@ -1627,7 +1627,7 @@ class AuroMenu extends AuroElement {
1627
1627
  }
1628
1628
 
1629
1629
  /**
1630
- * Handles option hover events.
1630
+ * Called when the pointer moves over an option. Makes it the active option, unless it can't be highlighted.
1631
1631
  * @private
1632
1632
  * @param {CustomEvent} event - The `auroMenuOption-mouseover` event.
1633
1633
  */
@@ -1651,7 +1651,7 @@ class AuroMenu extends AuroElement {
1651
1651
  }
1652
1652
 
1653
1653
  /**
1654
- * Handles slot change events.
1654
+ * Called when the menu's content changes. Sets the menu up again, and re-applies a `value` that was set before the options arrived.
1655
1655
  * @private
1656
1656
  */
1657
1657
  handleSlotChange() {
@@ -1747,7 +1747,7 @@ class AuroMenu extends AuroElement {
1747
1747
  }
1748
1748
 
1749
1749
  /**
1750
- * Handles custom events defined on options.
1750
+ * Fires the event named in the option's `event` attribute, then `auroMenu-customEventFired`, with the option in `detail.option`.
1751
1751
  * @private
1752
1752
  * @param {HTMLElement} option - Option with custom event.
1753
1753
  */
@@ -1767,6 +1767,7 @@ class AuroMenu extends AuroElement {
1767
1767
  }
1768
1768
 
1769
1769
  /**
1770
+ * Checks whether two selections hold the same options, in any order.
1770
1771
  * @private
1771
1772
  * @param {any} current - The current selection.
1772
1773
  * @param {any} next - The new selection to compare.
@@ -2236,7 +2237,7 @@ class AuroMenuOption extends AuroElement {
2236
2237
  }
2237
2238
 
2238
2239
  /**
2239
- * Handles click events on the menu option.
2240
+ * Called when the option is clicked. Fires `auroMenuOption-click`, unless the option or a menu containing it is disabled.
2240
2241
  * @private
2241
2242
  */
2242
2243
  handleClick() {
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Radio - Accessibility</auro-header>
1
+ <auro-header level="1" id="overview">Radio: Accessibility</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <div class="mainContent">
4
4
  <div class="scrollWrapper">
@@ -98,10 +98,10 @@ A group of radio buttons with a shared label that lets people choose exactly one
98
98
  | error | error | | string | | behavior | | Shows the group in its error state with this message, such as "Select an option".<br>The error stays until you remove the attribute. When set, `setCustomValidityCustomError` or `setCustomValidity` replaces the message. |
99
99
  | noValidate | novalidate | | boolean | | behavior | | Stops the group from validating automatically when focus leaves it or the selection changes.<br>To validate the group yourself, call `validate()`. The `error` attribute still applies. |
100
100
  | optionSelected | | | HTMLElement | | behavior | | Gets the selected `auro-radio` element, or `undefined` when nothing is selected. |
101
- | required | required | | boolean | | behavior | `!noValidate` | Requires a selection in the group and hides the "(optional)" text after the legend.<br>When nothing is selected, the group shows an error after focus leaves it. |
102
- | setCustomValidity | setcustomvalidity | | string | | behavior | `!noValidate` | Sets one error message for every kind of error, such as "Choose an option".<br>It replaces the `error` text and the `setCustomValidityValueMissing` and `setCustomValidityCustomError` messages. |
103
- | setCustomValidityCustomError | setcustomvaliditycustomerror | | string | | behavior | `!noValidate` | Sets the error message shown while the `error` attribute is set, in place of the attribute's own text.<br>`setCustomValidity` takes priority when both are set. |
104
- | setCustomValidityValueMissing | setcustomvalidityvaluemissing | | string | | behavior | `!noValidate` | Sets the error message shown when the group is `required` and nothing is selected, such as "Select an option".<br>The group has no default message, so set this or `setCustomValidity` to show one. `setCustomValidity` takes priority when both are set. |
101
+ | required | required | | boolean | | behavior | | Requires a selection in the group and hides the "(optional)" text after the legend.<br>Unless `noValidate` is set, the group shows an error when focus leaves it with nothing selected. |
102
+ | setCustomValidity | setcustomvalidity | | string | | behavior | | Sets one error message for every kind of error, such as "Choose an option".<br>It replaces the `error` text and the `setCustomValidityValueMissing` and `setCustomValidityCustomError` messages. |
103
+ | setCustomValidityCustomError | setcustomvaliditycustomerror | | string | | behavior | `error` | Sets the error message shown while the `error` attribute is set, in place of the attribute's own text.<br>`setCustomValidity` takes priority when both are set. |
104
+ | setCustomValidityValueMissing | setcustomvalidityvaluemissing | | string | | behavior | `required` | Sets the error message shown when the group is `required` and nothing is selected, such as "Select an option".<br>The group has no default message, so set this or `setCustomValidity` to show one. `setCustomValidity` takes priority when both are set. |
105
105
  | validity | validity | readonly | string | | behavior | | Gets the group's current validation state: `valid`, `valueMissing`, or `customError`.<br>It's `undefined` until the group is first validated. |
106
106
  | value | value | | string | | behavior | | Gets the `value` of the selected radio button, such as `window`.<br>Setting it doesn't select a radio button; set `checked` on the radio button instead. |
107
107
 
@@ -122,12 +122,12 @@ A group of radio buttons with a shared label that lets people choose exactly one
122
122
 
123
123
  ### Slots
124
124
 
125
- | Name | Category | Required | Relevant when | Description |
126
- | ------------- | -------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------- |
127
- | helpText | ui | | | Help text shown below the group, such as "Choose one". While the group shows an error, the error message replaces it. |
128
- | legend | ui | Yes | | Label for the group, such as "Seat preference". Screen readers announce it as the group's name. |
129
- | optionalLabel | ui | | `!required` | Text shown after the legend when the group isn't `required`, such as "- optional". Defaults to "(optional)". |
130
- | default | | | | The `auro-radio` elements in the group. |
125
+ | Name | Category | Required | Relevant when | Description |
126
+ | ------------- | -------- | -------- | ------------- | ------------------------------------------------------------------------------------------------------------------------- |
127
+ | helpText | ui | | | Help text shown below the group, such as "Choose one". While the group shows an error, the error message replaces it. |
128
+ | legend | ui | Yes | | Label for the group, such as "Seat preference". Screen readers announce it as the group's name. |
129
+ | optionalLabel | ui | | `!required` | Text shown after the legend when the group isn't `required`, such as a translated "(optional)". Defaults to "(optional)". |
130
+ | default | | | | The `auro-radio` elements in the group. |
131
131
 
132
132
  ### CSS shadow parts
133
133
 
@@ -1,4 +1,4 @@
1
- <auro-header level="1" id="overview">Radio - Customize</auro-header>
1
+ <auro-header level="1" id="overview">Radio: Customize</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <nav>
4
4
  <auro-nav anchorNavContent=".scrollWrapper">
@@ -116,11 +116,17 @@
116
116
  <!-- The below content is automatically added from ./../apiExamples/custom-tokens.html -->
117
117
  <style>
118
118
  #customTokenRadioGroup {
119
+ --ds-auro-radio-group-label-color: purple;
120
+ }
121
+
122
+ #customTokenRadioGroup auro-radio {
119
123
  --ds-auro-radio-btn-border-color: purple;
124
+ --ds-auro-radio-label-color: purple;
125
+ }
126
+
127
+ #customTokenRadioGroup auro-radio[checked] {
120
128
  --ds-auro-radio-btn-fill-color: lavender;
121
129
  --ds-auro-radio-btn-inset-color: purple;
122
- --ds-auro-radio-label-color: purple;
123
- --ds-auro-radio-group-label-color: purple;
124
130
  }
125
131
  </style>
126
132
  <auro-radio-group id="customTokenRadioGroup">
@@ -137,11 +143,15 @@
137
143
  <!-- The below code snippet is automatically added from ./../apiExamples/custom-tokens.html -->
138
144
  <pre class="language-html"><code class="language-html">&lt;style&gt;
139
145
  #customTokenRadioGroup {
146
+ --ds-auro-radio-group-label-color: purple;
147
+ }
148
+ &#10; #customTokenRadioGroup auro-radio {
140
149
  --ds-auro-radio-btn-border-color: purple;
150
+ --ds-auro-radio-label-color: purple;
151
+ }
152
+ &#10; #customTokenRadioGroup auro-radio[checked] {
141
153
  --ds-auro-radio-btn-fill-color: lavender;
142
154
  --ds-auro-radio-btn-inset-color: purple;
143
- --ds-auro-radio-label-color: purple;
144
- --ds-auro-radio-group-label-color: purple;
145
155
  }
146
156
  &lt;/style&gt;
147
157
  &lt;auro-radio-group id="customTokenRadioGroup"&gt;