@aurodesignsystem/auro-formkit 5.9.0 → 5.9.2

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 (136) hide show
  1. package/CHANGELOG.md +13 -4
  2. package/README.md +4 -4
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +2 -2
  5. package/components/bibtemplate/dist/registered.js +2 -2
  6. package/components/checkbox/README.md +62 -62
  7. package/components/checkbox/demo/api.js +1 -1
  8. package/components/checkbox/demo/api.md +127 -84
  9. package/components/checkbox/demo/api.min.js +125 -42
  10. package/components/checkbox/demo/index.md +9 -281
  11. package/components/checkbox/demo/index.min.js +125 -42
  12. package/components/checkbox/demo/readme.html +3 -4
  13. package/components/checkbox/demo/readme.md +62 -62
  14. package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
  15. package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
  16. package/components/checkbox/dist/index.js +125 -42
  17. package/components/checkbox/dist/registered.js +125 -42
  18. package/components/combobox/README.md +76 -74
  19. package/components/combobox/demo/api.html +1 -0
  20. package/components/combobox/demo/api.js +11 -12
  21. package/components/combobox/demo/api.md +1302 -875
  22. package/components/combobox/demo/api.min.js +416 -492
  23. package/components/combobox/demo/index.html +1 -7
  24. package/components/combobox/demo/index.js +0 -19
  25. package/components/combobox/demo/index.md +43 -723
  26. package/components/combobox/demo/index.min.js +369 -302
  27. package/components/combobox/demo/readme.html +3 -4
  28. package/components/combobox/demo/readme.md +76 -74
  29. package/components/combobox/dist/auro-combobox.d.ts +42 -42
  30. package/components/combobox/dist/index.js +204 -210
  31. package/components/combobox/dist/registered.js +204 -210
  32. package/components/counter/README.md +81 -66
  33. package/components/counter/demo/api.html +1 -2
  34. package/components/counter/demo/api.js +2 -2
  35. package/components/counter/demo/api.md +777 -259
  36. package/components/counter/demo/api.min.js +119 -171
  37. package/components/counter/demo/index.html +0 -2
  38. package/components/counter/demo/index.md +20 -329
  39. package/components/counter/demo/index.min.js +117 -152
  40. package/components/counter/demo/readme.html +3 -4
  41. package/components/counter/demo/readme.md +81 -66
  42. package/components/counter/dist/auro-counter-group.d.ts +21 -36
  43. package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
  44. package/components/counter/dist/auro-counter.d.ts +5 -8
  45. package/components/counter/dist/index.js +117 -152
  46. package/components/counter/dist/registered.js +117 -152
  47. package/components/datepicker/README.md +57 -61
  48. package/components/datepicker/demo/api.js +8 -8
  49. package/components/datepicker/demo/api.md +720 -561
  50. package/components/datepicker/demo/api.min.js +678 -2769
  51. package/components/datepicker/demo/index.md +65 -117
  52. package/components/datepicker/demo/index.min.js +678 -2769
  53. package/components/datepicker/demo/readme.html +3 -4
  54. package/components/datepicker/demo/readme.md +57 -61
  55. package/components/datepicker/dist/auro-calendar.d.ts +60 -34
  56. package/components/datepicker/dist/auro-datepicker.d.ts +32 -32
  57. package/components/datepicker/dist/iconVersion.d.ts +1 -1
  58. package/components/datepicker/dist/index.js +505 -2596
  59. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  60. package/components/datepicker/dist/registered.js +505 -2596
  61. package/components/dropdown/README.md +78 -62
  62. package/components/dropdown/demo/api.js +4 -4
  63. package/components/dropdown/demo/api.md +520 -478
  64. package/components/dropdown/demo/api.min.js +80 -95
  65. package/components/dropdown/demo/index.md +65 -119
  66. package/components/dropdown/demo/index.min.js +70 -85
  67. package/components/dropdown/demo/readme.html +3 -4
  68. package/components/dropdown/demo/readme.md +78 -62
  69. package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
  70. package/components/dropdown/dist/iconVersion.d.ts +1 -1
  71. package/components/dropdown/dist/index.js +70 -85
  72. package/components/dropdown/dist/registered.js +70 -85
  73. package/components/form/README.md +16 -58
  74. package/components/form/demo/api.md +16 -21
  75. package/components/form/demo/api.min.js +13 -8
  76. package/components/form/demo/index.md +38 -39
  77. package/components/form/demo/index.min.js +13 -8
  78. package/components/form/demo/readme.md +16 -58
  79. package/components/form/demo/working.html +1 -1
  80. package/components/form/dist/auro-form.d.ts +15 -3
  81. package/components/form/dist/index.js +13 -8
  82. package/components/form/dist/registered.js +13 -8
  83. package/components/input/README.md +55 -60
  84. package/components/input/demo/api.js +3 -5
  85. package/components/input/demo/api.md +558 -537
  86. package/components/input/demo/api.min.js +102 -115
  87. package/components/input/demo/index.js +0 -1
  88. package/components/input/demo/index.md +90 -203
  89. package/components/input/demo/index.min.js +87 -99
  90. package/components/input/demo/readme.html +3 -4
  91. package/components/input/demo/readme.md +55 -60
  92. package/components/input/dist/auro-input.d.ts +6 -5
  93. package/components/input/dist/base-input.d.ts +68 -69
  94. package/components/input/dist/iconVersion.d.ts +1 -1
  95. package/components/input/dist/index.js +87 -82
  96. package/components/input/dist/registered.js +87 -82
  97. package/components/menu/README.md +61 -61
  98. package/components/menu/demo/api.js +6 -8
  99. package/components/menu/demo/api.md +520 -577
  100. package/components/menu/demo/api.min.js +199 -97
  101. package/components/menu/demo/index.js +0 -5
  102. package/components/menu/demo/index.md +36 -119
  103. package/components/menu/demo/index.min.js +164 -101
  104. package/components/menu/demo/readme.html +3 -4
  105. package/components/menu/demo/readme.md +61 -61
  106. package/components/menu/dist/auro-menu.context.d.ts +5 -0
  107. package/components/menu/dist/auro-menu.d.ts +75 -37
  108. package/components/menu/dist/auro-menuoption.d.ts +38 -13
  109. package/components/menu/dist/index.js +164 -50
  110. package/components/menu/dist/registered.js +164 -50
  111. package/components/radio/README.md +61 -57
  112. package/components/radio/demo/api.js +2 -2
  113. package/components/radio/demo/api.md +241 -170
  114. package/components/radio/demo/api.min.js +154 -77
  115. package/components/radio/demo/index.md +22 -99
  116. package/components/radio/demo/index.min.js +145 -68
  117. package/components/radio/demo/readme.html +3 -4
  118. package/components/radio/demo/readme.md +61 -57
  119. package/components/radio/dist/auro-radio-group.d.ts +67 -35
  120. package/components/radio/dist/auro-radio.d.ts +56 -33
  121. package/components/radio/dist/index.js +145 -68
  122. package/components/radio/dist/registered.js +145 -68
  123. package/components/select/README.md +68 -65
  124. package/components/select/demo/api.html +1 -0
  125. package/components/select/demo/api.js +7 -7
  126. package/components/select/demo/api.md +1305 -625
  127. package/components/select/demo/api.min.js +357 -262
  128. package/components/select/demo/index.html +0 -2
  129. package/components/select/demo/index.md +25 -833
  130. package/components/select/demo/index.min.js +356 -230
  131. package/components/select/demo/readme.html +3 -4
  132. package/components/select/demo/readme.md +68 -65
  133. package/components/select/dist/auro-select.d.ts +99 -90
  134. package/components/select/dist/index.js +192 -180
  135. package/components/select/dist/registered.js +192 -180
  136. package/package.json +9 -4
@@ -1,11 +1,11 @@
1
1
  <!--
2
- The demo.md file is a compiled document. No edits should be made directly to this file.
3
- README.md is created by running `npm run build:docs`.
4
- This file is generated based on a template fetched from `./docs/partials/demo.md`
2
+ THIS PAGE'S CONTENT SHOULD BE KEPT MINIMAL.
3
+ ONLY ADD EXAMPLES THAT ARE TRULY NECESSARY FOR THE INDEX PAGE — THE BASIC EXAMPLE IS USUALLY ENOUGH.
4
+ ALL OTHER EXAMPLES SHOULD GO IN THE API DOCUMENTATION.
5
5
  -->
6
6
 
7
- # Menu
8
-
7
+ # Menu
8
+
9
9
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
10
10
  <!-- The below content is automatically added from ./../docs/partials/description.md -->
11
11
  The `<auro-menu>` element provides a list of options for a user to select from.
@@ -15,8 +15,8 @@ A list of options is created within the `<slot>` of the `<auro-menu>` element by
15
15
  The `<auro-menu>` element is designed for contextual menus, e.g. a dropdown menus. They are not intended to be used for navigation menus which have a different semantic meaning. The `<auro-menu>` element does not support hide/show functionality within its scope. This functionality will be managed by a wrapping element such as a drop-down menu composite element.
16
16
  <!-- AURO-GENERATED-CONTENT:END -->
17
17
 
18
- ## auro-menu use cases
19
-
18
+ ## Use Cases
19
+
20
20
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
21
21
  <!-- The below content is automatically added from ./../docs/partials/useCases.md -->
22
22
  The `<auro-menu>` element should be used in situations where users may:
@@ -26,130 +26,47 @@ The `<auro-menu>` element should be used in situations where users may:
26
26
 
27
27
  ## Example(s)
28
28
 
29
- ### Default
30
-
31
- A basic `auro-menu` element with nested `auro-menuoption` elements to generate a list.
32
-
29
+ ### Basic
30
+
33
31
  <div class="exampleWrapper">
34
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
35
- <!-- The below content is automatically added from ./../apiExamples/basic.html -->
32
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/preselect.html) -->
33
+ <!-- The below content is automatically added from ./../apiExamples/preselect.html -->
36
34
  <auro-menu>
37
- <auro-menuoption value="stops">Stops</auro-menuoption>
38
- <auro-menuoption value="price">Price</auro-menuoption>
39
- <auro-menuoption value="duration">Duration</auro-menuoption>
40
- <auro-menuoption value="departure">Departure</auro-menuoption>
41
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
35
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
36
+ <auro-menuoption value="new window" selected>New window</auro-menuoption>
37
+ <auro-menuoption value="open file">Open file</auro-menuoption>
38
+ <auro-menuoption value="open location">Open location</auro-menuoption>
39
+ <hr>
40
+ <auro-menuoption value="close window">Close window</auro-menuoption>
41
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
42
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
43
+ <hr>
44
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
45
+ <hr>
46
+ <auro-menuoption value="print">Print</auro-menuoption>
42
47
  </auro-menu>
43
48
  <!-- AURO-GENERATED-CONTENT:END -->
44
49
  </div>
45
50
  <auro-accordion alignRight>
46
51
  <span slot="trigger">See code</span>
47
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
48
- <!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
52
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/preselect.html) -->
53
+ <!-- The below code snippet is automatically added from ./../apiExamples/preselect.html -->
49
54
 
50
55
  ```html
51
56
  <auro-menu>
52
- <auro-menuoption value="stops">Stops</auro-menuoption>
53
- <auro-menuoption value="price">Price</auro-menuoption>
54
- <auro-menuoption value="duration">Duration</auro-menuoption>
55
- <auro-menuoption value="departure">Departure</auro-menuoption>
56
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
57
- </auro-menu>
58
- ```
59
- <!-- AURO-GENERATED-CONTENT:END -->
60
- </auro-accordion>
61
-
62
- ### Using Keys
63
-
64
- When setting the `value` property, matches are actually performed on the value of the `key` property of the `auro-menuoption` and not the `value` property. By default, the value of `key` is equal to the value of the `value` property. However, for advanced use cases, the `key` value can be overriden to allow for more specific matches.
65
-
66
- In the below example, there is a list of "popular" options at the top, with the same values repeated underneath. To allow more specific selections, we can add a `key` attribute to the top options to allow them to be more specifically selected, or to prevent them from interfering with matches on the lower options.
67
-
68
- In the below example, setting the value of the menu `'stops'` will select the bottom-most option with the value `'stops'`, and setting the value of menu to `'stops-top'` will select the top-most option with the value `'stops'` since the key now differs from the value. In either case, the resulting value of the menu will be `'stops'` because the resulting value of the menu is based on the `value` property and not the `key` property.
69
-
70
- Due to a limitation with Lit change detection to the `value` property, if multiple options with the same exist and one is selected, you must first clear the current value before attempting to select another option with the same value, even if the keys are unique. See code example below.
71
-
72
- _Note: Since the value passed to the `value` property when programmatically setting it is overwritten with the proper derived value once the menu has updated, note that it will take one lifecycle before the `value` property is updated to the value that represents the actual menu state._
73
-
74
- <div class="exampleWrapper">
75
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/keys.html) -->
76
- <!-- The below content is automatically added from ./../apiExamples/keys.html -->
77
- <auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
78
- <auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
79
- <auro-menu id="keys-menu">
80
- <auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
81
- <auro-menuoption value="price" key="price-top">Price</auro-menuoption>
57
+ <auro-menuoption value="new tab">New tab</auro-menuoption>
58
+ <auro-menuoption value="new window" selected>New window</auro-menuoption>
59
+ <auro-menuoption value="open file">Open file</auro-menuoption>
60
+ <auro-menuoption value="open location">Open location</auro-menuoption>
82
61
  <hr>
83
- <auro-menuoption value="duration">Duration</auro-menuoption>
84
- <auro-menuoption value="departure">Departure</auro-menuoption>
85
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
86
- <auro-menuoption value="stops">Stops</auro-menuoption>
87
- <auro-menuoption value="price">Price</auro-menuoption>
88
- </auro-menu>
89
- <p id="output" class="body-sm"></p>
90
- <!-- AURO-GENERATED-CONTENT:END -->
91
- </div>
92
- <auro-accordion alignRight>
93
- <span slot="trigger">See code</span>
94
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/keys.html) -->
95
- <!-- The below code snippet is automatically added from ./../apiExamples/keys.html -->
96
-
97
- ```html
98
- <auro-button id="stopsTopButton">Call `menu.value = 'stops-top'`</auro-button>
99
- <auro-button id="stopsButton">Call `menu.value = 'stops'`</auro-button>
100
- <auro-menu id="keys-menu">
101
- <auro-menuoption value="stops" key="stops-top">Stops</auro-menuoption>
102
- <auro-menuoption value="price" key="price-top">Price</auro-menuoption>
62
+ <auro-menuoption value="close window">Close window</auro-menuoption>
63
+ <auro-menuoption value="close tab" disabled>Close tab</auro-menuoption>
64
+ <auro-menuoption value="save page as...">Save page as...</auro-menuoption>
103
65
  <hr>
104
- <auro-menuoption value="duration">Duration</auro-menuoption>
105
- <auro-menuoption value="departure">Departure</auro-menuoption>
106
- <auro-menuoption value="arrival">Arrival</auro-menuoption>
107
- <auro-menuoption value="stops">Stops</auro-menuoption>
108
- <auro-menuoption value="price">Price</auro-menuoption>
66
+ <auro-menuoption value="share" disabled>Share</auro-menuoption>
67
+ <hr>
68
+ <auro-menuoption value="print">Print</auro-menuoption>
109
69
  </auro-menu>
110
- <p id="output" class="body-sm"></p>
111
70
  ```
112
71
  <!-- AURO-GENERATED-CONTENT:END -->
113
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/keys.js) -->
114
- <!-- The below code snippet is automatically added from ./../apiExamples/keys.js -->
115
-
116
- ```js
117
- export function initKeysExample() {
118
- const menu = document.getElementById('keys-menu');
119
- const stopsButton = document.getElementById('stopsButton');
120
- const stopsTopButton = document.getElementById('stopsTopButton');
121
- const output = document.getElementById('output');
122
-
123
- const createConsoleEntry = (message) => {
124
- const node = document.createElement('span');
125
- node.innerHTML = message;
126
- output.appendChild(node);
127
- output.appendChild(document.createElement('br'));
128
- };
129
-
130
- const resetConsole = () => {
131
- output.innerHTML = '';
132
- };
133
-
134
- const updateMenuValue = (value) => {
135
- resetConsole();
136
- createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
137
- menu.value = '';
138
- menu.value = value;
139
- createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
140
- setTimeout(() => {
141
- createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
142
- });
143
- };
144
-
145
- stopsButton.addEventListener('click', () => {
146
- updateMenuValue('stops');
147
- });
148
-
149
- stopsTopButton.addEventListener('click', () => {
150
- updateMenuValue('stops-top');
151
- });
152
- };
153
- ```
154
- <!-- AURO-GENERATED-CONTENT:END -->
155
- </auro-accordion>
72
+ </auro-accordion>
@@ -320,7 +320,7 @@ const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{cons
320
320
  * SPDX-License-Identifier: BSD-3-Clause
321
321
  */const o=o=>o??E;
322
322
 
323
- class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i$3{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$6`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;line-height:1;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.labelWrapper{margin-left:var(--ds-size-50, .25rem);line-height:1.8}
323
+ class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,class extends a{});}closestElement(t,a=this,e=(a,s=a&&a.closest(t))=>a&&a!==document&&a!==window?s||e(a.getRootNode().host):null){return e(a)}handleComponentTagRename(t,a){const e=a.toLowerCase();t.tagName.toLowerCase()!==e&&t.setAttribute(e,true);}elementMatch(t,a){const e=a.toLowerCase();return t.tagName.toLowerCase()===e||t.hasAttribute(e)}}var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>';class m extends i$3{static get properties(){return {hidden:{type:Boolean,reflect:true},hiddenVisually:{type:Boolean,reflect:true},hiddenAudible:{type:Boolean,reflect:true}}}hideAudible(t){return t?"true":"false"}}const g=new Map,f=(t,a={})=>{const e=a.responseParser||(t=>t.text());return g.has(t)||g.set(t,fetch(t).then(e)),g.get(t)};var w=i$6`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
324
324
  `;class z extends m{constructor(){super(),this.onDark=false,this.appearance="default";}static get properties(){return {...m.properties,onDark:{type:Boolean,reflect:true},appearance:{type:String,reflect:true},svg:{attribute:false,reflect:true}}}static get styles(){return w}async fetchIcon(t,a){let e="";e="logos"===t?await f(`${this.uri}/${t}/${a}.svg`):await f(`${this.uri}/icons/${t}/${a}.svg`);return (new DOMParser).parseFromString(e,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString(u,"text/html");this.svg=t.body.firstChild;}}}catch(t){this.svg=void 0;}}}i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
325
325
  `;var y=i$6`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
326
326
  `;var k=i$6`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
@@ -377,12 +377,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
377
377
 
378
378
 
379
379
  /**
380
- * The auro-menu element provides users a way to define a menu option.
380
+ * The `auro-menuoption` element provides users a way to define a menu option.
381
+ * @customElement auro-menuoption
381
382
  *
382
- * @attr {String} value - Specifies the value to be sent to a server.
383
- * @attr {String} noCheckmark - When true, selected option will not show the checkmark.
384
- * @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
385
- * @attr {Boolean} selected - Specifies that an option is selected.
386
383
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
387
384
  * @slot - Specifies text for an option, but is not the value.
388
385
  */
@@ -390,7 +387,7 @@ class AuroMenuOption extends AuroElement {
390
387
 
391
388
  /**
392
389
  * This will register this element with the browser.
393
- * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
390
+ * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
394
391
  *
395
392
  * @example
396
393
  * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
@@ -433,7 +430,7 @@ class AuroMenuOption extends AuroElement {
433
430
  this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
434
431
 
435
432
  this.selected = false;
436
- this.nocheckmark = false;
433
+ this.noCheckmark = false;
437
434
  this.disabled = false;
438
435
 
439
436
  /**
@@ -454,38 +451,81 @@ class AuroMenuOption extends AuroElement {
454
451
  static get properties() {
455
452
  return {
456
453
  ...super.properties,
454
+
455
+ /**
456
+ * When true, disables the menu option.
457
+ */
457
458
  disabled: {
458
459
  type: Boolean,
459
460
  reflect: true
460
461
  },
462
+
463
+ /**
464
+ * @private
465
+ */
461
466
  event: {
462
467
  type: String,
463
468
  reflect: true
464
469
  },
470
+
471
+ /**
472
+ * @private
473
+ */
474
+ layout: {
475
+ type: String
476
+ },
477
+
478
+ /**
479
+ * Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used.
480
+ */
465
481
  key: {
466
482
  type: String,
467
483
  reflect: true
468
484
  },
485
+
486
+ /**
487
+ * @private
488
+ */
469
489
  menuService: {
470
490
  type: Object,
471
491
  state: true
472
492
  },
493
+
494
+ /**
495
+ * @private
496
+ */
473
497
  matchWord: {
474
498
  type: String,
475
499
  state: true
476
500
  },
477
- nocheckmark: {
501
+
502
+ /**
503
+ * @private
504
+ */
505
+ noCheckmark: {
478
506
  type: Boolean,
479
507
  reflect: true
480
508
  },
509
+
510
+ /**
511
+ * Specifies that an option is selected.
512
+ */
481
513
  selected: {
482
514
  type: Boolean,
483
515
  reflect: true
484
516
  },
517
+
518
+ /**
519
+ * Specifies the tab index of the menu option.
520
+ */
485
521
  tabIndex: {
486
522
  type: Number,
487
523
  reflect: true
488
524
  },
525
+
526
+ /**
527
+ * Specifies the value to be sent to a server.
528
+ */
489
529
  value: {
490
530
  type: String,
491
531
  reflect: true
@@ -809,7 +849,7 @@ class AuroMenuOption extends AuroElement {
809
849
 
810
850
  return u$1`
811
851
  <div class="${classes}">
812
- ${this.selected && !this.nocheckmark
852
+ ${this.selected && !this.noCheckmark
813
853
  ? this.generateIconHtml(checkmarkIcon.svg)
814
854
  : undefined}
815
855
  <slot></slot>
@@ -851,6 +891,15 @@ class MenuService {
851
891
  return this.multiSelect ? values : values[0];
852
892
  }
853
893
 
894
+ /**
895
+ * Gets the label(s) of the currently selected option(s).
896
+ * @returns {string}
897
+ */
898
+ get currentLabel() {
899
+ const labels = (this.selectedOptions || []).map(option => option.textContent);
900
+ return this.multiSelect ? labels.join(", ") : labels[0] || '';
901
+ }
902
+
854
903
  /**
855
904
  * Gets the string representation of the current value(s).
856
905
  * For multi-select, this is a JSON stringified array.
@@ -1282,7 +1331,8 @@ class MenuService {
1282
1331
  value: this.currentValue,
1283
1332
  stringValue: this.stringValue,
1284
1333
  keys: this.currentKeys,
1285
- options: this.selectedOptions
1334
+ options: this.selectedOptions,
1335
+ label: this.currentLabel
1286
1336
  };
1287
1337
 
1288
1338
  // If only one option is selected, include its index
@@ -1426,19 +1476,9 @@ const MenuContext = n$1('menu-context');
1426
1476
 
1427
1477
 
1428
1478
  /**
1429
- * The auro-menu element provides users a way to select from a list of options.
1430
- * @attr {HTMLElement|Array<HTMLElement>} optionSelected - An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1431
- * @attr {object} optionactive - Specifies the current active menuOption.
1432
- * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
1433
- * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
1434
- * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
1435
- * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1436
- * @attr {boolean} multiselect - When true, the selected option can be multiple options.
1437
- * @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1438
- * @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1439
- * @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
1440
- * @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
1441
- * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1479
+ * The `auro-menu` element provides users a way to select from a list of options.
1480
+ * @customElement auro-menu
1481
+ *
1442
1482
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
1443
1483
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
1444
1484
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
@@ -1529,58 +1569,87 @@ class AuroMenu extends AuroElement {
1529
1569
  type: Boolean,
1530
1570
  reflect: true,
1531
1571
  },
1532
- noCheckmark: {
1533
- type: Boolean,
1534
- reflect: true,
1535
- attribute: 'nocheckmark'
1536
- },
1572
+
1573
+ /**
1574
+ * When true, the entire menu and all options are disabled.
1575
+ */
1537
1576
  disabled: {
1538
1577
  type: Boolean,
1539
1578
  reflect: true
1540
1579
  },
1580
+
1581
+ /**
1582
+ * Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1583
+ */
1584
+ hasLoadingPlaceholder: {
1585
+ type: Boolean
1586
+ },
1587
+
1588
+ /**
1589
+ * @private
1590
+ */
1591
+ layout: {
1592
+ type: String
1593
+ },
1594
+
1595
+ /**
1596
+ * Indent level for submenus.
1597
+ * @private
1598
+ */
1599
+ level: {
1600
+ type: Number,
1601
+ reflect: false,
1602
+ attribute: false
1603
+ },
1604
+
1605
+ /**
1606
+ * When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1607
+ */
1541
1608
  loading: {
1542
1609
  type: Boolean,
1543
1610
  reflect: true
1544
1611
  },
1545
- optionSelected: {
1546
- // Allow HTMLElement, HTMLElement[] arrays and undefined
1547
- type: Object
1548
- },
1549
- optionActive: {
1550
- type: Object,
1551
- attribute: 'optionactive'
1552
- },
1612
+
1613
+ /**
1614
+ * Specifies a string used to highlight matched string parts in options.
1615
+ */
1553
1616
  matchWord: {
1554
1617
  type: String,
1555
1618
  attribute: 'matchword'
1556
1619
  },
1620
+
1621
+ /**
1622
+ * When true, the selected option can be multiple options.
1623
+ */
1557
1624
  multiSelect: {
1558
1625
  type: Boolean,
1559
1626
  reflect: true,
1560
1627
  attribute: 'multiselect'
1561
1628
  },
1562
- selectAllMatchingOptions: {
1629
+
1630
+ /**
1631
+ * When true, selected option will not show the checkmark.
1632
+ */
1633
+ noCheckmark: {
1563
1634
  type: Boolean,
1564
1635
  reflect: true,
1636
+ attribute: 'nocheckmark'
1565
1637
  },
1566
1638
 
1567
1639
  /**
1568
- * Value selected for the component.
1640
+ * Specifies the current active menuOption.
1569
1641
  */
1570
- value: {
1571
- type: String,
1572
- reflect: true,
1573
- attribute: 'value'
1642
+ optionActive: {
1643
+ type: Object,
1644
+ attribute: 'optionactive'
1574
1645
  },
1575
1646
 
1576
1647
  /**
1577
- * Indent level for submenus.
1578
- * @private
1648
+ * An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1579
1649
  */
1580
- level: {
1581
- type: Number,
1582
- reflect: false,
1583
- attribute: false
1650
+ optionSelected: {
1651
+ // Allow HTMLElement, HTMLElement[] arrays and undefined
1652
+ type: Object
1584
1653
  },
1585
1654
 
1586
1655
  /**
@@ -1591,6 +1660,43 @@ class AuroMenu extends AuroElement {
1591
1660
  type: Array,
1592
1661
  reflect: false,
1593
1662
  attribute: false
1663
+ },
1664
+
1665
+ /**
1666
+ * Sets the size of the menu.
1667
+ * @type {'sm' | 'md'}
1668
+ * @default 'sm'
1669
+ */
1670
+ size: {
1671
+ type: String,
1672
+ reflect: true
1673
+ },
1674
+
1675
+ /**
1676
+ * When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1677
+ */
1678
+ selectAllMatchingOptions: {
1679
+ type: Boolean,
1680
+ reflect: true,
1681
+ },
1682
+
1683
+ /**
1684
+ * Sets the shape of the menu.
1685
+ * @type {'box' | 'round'}
1686
+ * @default 'box'
1687
+ */
1688
+ shape: {
1689
+ type: String,
1690
+ reflect: true
1691
+ },
1692
+
1693
+ /**
1694
+ * The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1695
+ */
1696
+ value: {
1697
+ type: String,
1698
+ reflect: true,
1699
+ attribute: 'value'
1594
1700
  }
1595
1701
  };
1596
1702
  }
@@ -1603,6 +1709,14 @@ class AuroMenu extends AuroElement {
1603
1709
  ];
1604
1710
  }
1605
1711
 
1712
+ /**
1713
+ * @readonly
1714
+ * @returns {string} - Returns the label of the currently selected option(s).
1715
+ */
1716
+ get currentLabel() {
1717
+ return this.menuService.currentLabel;
1718
+ };
1719
+
1606
1720
  /**
1607
1721
  * @readonly
1608
1722
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
@@ -1628,7 +1742,7 @@ class AuroMenu extends AuroElement {
1628
1742
 
1629
1743
  /**
1630
1744
  * This will register this element with the browser.
1631
- * @param {string} [name="auro-menu"] - The name of element that you want to register to.
1745
+ * @param {string} [name="auro-menu"] - The name of the element that you want to register.
1632
1746
  *
1633
1747
  * @example
1634
1748
  * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
@@ -2035,43 +2149,6 @@ class AuroMenu extends AuroElement {
2035
2149
  }
2036
2150
  }
2037
2151
 
2038
- function initKeysExample() {
2039
- const menu = document.getElementById('keys-menu');
2040
- const stopsButton = document.getElementById('stopsButton');
2041
- const stopsTopButton = document.getElementById('stopsTopButton');
2042
- const output = document.getElementById('output');
2043
-
2044
- const createConsoleEntry = (message) => {
2045
- const node = document.createElement('span');
2046
- node.innerHTML = message;
2047
- output.appendChild(node);
2048
- output.appendChild(document.createElement('br'));
2049
- };
2050
-
2051
- const resetConsole = () => {
2052
- output.innerHTML = '';
2053
- };
2054
-
2055
- const updateMenuValue = (value) => {
2056
- resetConsole();
2057
- createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
2058
- menu.value = '';
2059
- menu.value = value;
2060
- createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
2061
- setTimeout(() => {
2062
- createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
2063
- });
2064
- };
2065
-
2066
- stopsButton.addEventListener('click', () => {
2067
- updateMenuValue('stops');
2068
- });
2069
-
2070
- stopsTopButton.addEventListener('click', () => {
2071
- updateMenuValue('stops-top');
2072
- });
2073
- }
2074
-
2075
2152
  /* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
2076
2153
 
2077
2154
 
@@ -2081,20 +2158,6 @@ AuroMenu.register('custom-menu');
2081
2158
  AuroMenuOption.register('custom-menuoption');
2082
2159
 
2083
2160
  function initExamples(initCount) {
2084
- initCount = initCount || 0;
2085
-
2086
- try {
2087
- // javascript example function calls to be added here upon creation to test examples
2088
- // auroMenuResetExample();
2089
- initKeysExample();
2090
- } catch (err) {
2091
- if (initCount <= 20) {
2092
- // setTimeout handles issue where content is sometimes loaded after the functions get called
2093
- setTimeout(() => {
2094
- initExamples(initCount + 1);
2095
- }, 100);
2096
- }
2097
- }
2098
2161
  }
2099
2162
 
2100
2163
  export { initExamples };
@@ -48,10 +48,9 @@
48
48
  Prism.highlightAll();
49
49
  })
50
50
  </script>
51
- <script type="module">
52
- import { initExamples } from "./index.min.js";
51
+ <script src="./index.min.js" data-demo-script="true" type="module"></script>
53
52
 
54
- initExamples();
55
- </script>
53
+ <!-- If additional elements are needed for the demo, add them here. -->
54
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
56
55
  </body>
57
56
  </html>