@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
@@ -241,7 +241,7 @@ class AuroDependencyVersioning {
241
241
  }
242
242
  }
243
243
 
244
- 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 LitElement{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=css`: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}
244
+ 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 LitElement{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=css`: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}
245
245
  `;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;}}}css`.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}
246
246
  `;var y=css`: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)}
247
247
  `;var k=css`: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)}
@@ -298,12 +298,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
298
298
 
299
299
 
300
300
  /**
301
- * The auro-menu element provides users a way to define a menu option.
301
+ * The `auro-menuoption` element provides users a way to define a menu option.
302
+ * @customElement auro-menuoption
302
303
  *
303
- * @attr {String} value - Specifies the value to be sent to a server.
304
- * @attr {String} noCheckmark - When true, selected option will not show the checkmark.
305
- * @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
306
- * @attr {Boolean} selected - Specifies that an option is selected.
307
304
  * @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
308
305
  * @slot - Specifies text for an option, but is not the value.
309
306
  */
@@ -311,7 +308,7 @@ class AuroMenuOption extends AuroElement {
311
308
 
312
309
  /**
313
310
  * This will register this element with the browser.
314
- * @param {string} [name="auro-menuoption"] - The name of element that you want to register to.
311
+ * @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
315
312
  *
316
313
  * @example
317
314
  * AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
@@ -354,7 +351,7 @@ class AuroMenuOption extends AuroElement {
354
351
  this.iconTag = versioning.generateTag('auro-formkit-menuoption-icon', iconVersion, x);
355
352
 
356
353
  this.selected = false;
357
- this.nocheckmark = false;
354
+ this.noCheckmark = false;
358
355
  this.disabled = false;
359
356
 
360
357
  /**
@@ -375,38 +372,81 @@ class AuroMenuOption extends AuroElement {
375
372
  static get properties() {
376
373
  return {
377
374
  ...super.properties,
375
+
376
+ /**
377
+ * When true, disables the menu option.
378
+ */
378
379
  disabled: {
379
380
  type: Boolean,
380
381
  reflect: true
381
382
  },
383
+
384
+ /**
385
+ * @private
386
+ */
382
387
  event: {
383
388
  type: String,
384
389
  reflect: true
385
390
  },
391
+
392
+ /**
393
+ * @private
394
+ */
395
+ layout: {
396
+ type: String
397
+ },
398
+
399
+ /**
400
+ * 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.
401
+ */
386
402
  key: {
387
403
  type: String,
388
404
  reflect: true
389
405
  },
406
+
407
+ /**
408
+ * @private
409
+ */
390
410
  menuService: {
391
411
  type: Object,
392
412
  state: true
393
413
  },
414
+
415
+ /**
416
+ * @private
417
+ */
394
418
  matchWord: {
395
419
  type: String,
396
420
  state: true
397
421
  },
398
- nocheckmark: {
422
+
423
+ /**
424
+ * @private
425
+ */
426
+ noCheckmark: {
399
427
  type: Boolean,
400
428
  reflect: true
401
429
  },
430
+
431
+ /**
432
+ * Specifies that an option is selected.
433
+ */
402
434
  selected: {
403
435
  type: Boolean,
404
436
  reflect: true
405
437
  },
438
+
439
+ /**
440
+ * Specifies the tab index of the menu option.
441
+ */
406
442
  tabIndex: {
407
443
  type: Number,
408
444
  reflect: true
409
445
  },
446
+
447
+ /**
448
+ * Specifies the value to be sent to a server.
449
+ */
410
450
  value: {
411
451
  type: String,
412
452
  reflect: true
@@ -730,7 +770,7 @@ class AuroMenuOption extends AuroElement {
730
770
 
731
771
  return html$1`
732
772
  <div class="${classes}">
733
- ${this.selected && !this.nocheckmark
773
+ ${this.selected && !this.noCheckmark
734
774
  ? this.generateIconHtml(checkmarkIcon.svg)
735
775
  : undefined}
736
776
  <slot></slot>
@@ -772,6 +812,15 @@ class MenuService {
772
812
  return this.multiSelect ? values : values[0];
773
813
  }
774
814
 
815
+ /**
816
+ * Gets the label(s) of the currently selected option(s).
817
+ * @returns {string}
818
+ */
819
+ get currentLabel() {
820
+ const labels = (this.selectedOptions || []).map(option => option.textContent);
821
+ return this.multiSelect ? labels.join(", ") : labels[0] || '';
822
+ }
823
+
775
824
  /**
776
825
  * Gets the string representation of the current value(s).
777
826
  * For multi-select, this is a JSON stringified array.
@@ -1203,7 +1252,8 @@ class MenuService {
1203
1252
  value: this.currentValue,
1204
1253
  stringValue: this.stringValue,
1205
1254
  keys: this.currentKeys,
1206
- options: this.selectedOptions
1255
+ options: this.selectedOptions,
1256
+ label: this.currentLabel
1207
1257
  };
1208
1258
 
1209
1259
  // If only one option is selected, include its index
@@ -1347,19 +1397,9 @@ const MenuContext = createContext('menu-context');
1347
1397
 
1348
1398
 
1349
1399
  /**
1350
- * The auro-menu element provides users a way to select from a list of options.
1351
- * @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.
1352
- * @attr {object} optionactive - Specifies the current active menuOption.
1353
- * @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
1354
- * @attr {boolean} disabled - When true, the entire menu and all options are disabled;
1355
- * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
1356
- * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1357
- * @attr {boolean} multiselect - When true, the selected option can be multiple options.
1358
- * @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1359
- * @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1360
- * @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
1361
- * @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
1362
- * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1400
+ * The `auro-menu` element provides users a way to select from a list of options.
1401
+ * @customElement auro-menu
1402
+ *
1363
1403
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
1364
1404
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
1365
1405
  * @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
@@ -1450,58 +1490,87 @@ class AuroMenu extends AuroElement {
1450
1490
  type: Boolean,
1451
1491
  reflect: true,
1452
1492
  },
1453
- noCheckmark: {
1454
- type: Boolean,
1455
- reflect: true,
1456
- attribute: 'nocheckmark'
1457
- },
1493
+
1494
+ /**
1495
+ * When true, the entire menu and all options are disabled.
1496
+ */
1458
1497
  disabled: {
1459
1498
  type: Boolean,
1460
1499
  reflect: true
1461
1500
  },
1501
+
1502
+ /**
1503
+ * Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
1504
+ */
1505
+ hasLoadingPlaceholder: {
1506
+ type: Boolean
1507
+ },
1508
+
1509
+ /**
1510
+ * @private
1511
+ */
1512
+ layout: {
1513
+ type: String
1514
+ },
1515
+
1516
+ /**
1517
+ * Indent level for submenus.
1518
+ * @private
1519
+ */
1520
+ level: {
1521
+ type: Number,
1522
+ reflect: false,
1523
+ attribute: false
1524
+ },
1525
+
1526
+ /**
1527
+ * When true, displays a loading state using the loadingIcon and loadingText slots if provided.
1528
+ */
1462
1529
  loading: {
1463
1530
  type: Boolean,
1464
1531
  reflect: true
1465
1532
  },
1466
- optionSelected: {
1467
- // Allow HTMLElement, HTMLElement[] arrays and undefined
1468
- type: Object
1469
- },
1470
- optionActive: {
1471
- type: Object,
1472
- attribute: 'optionactive'
1473
- },
1533
+
1534
+ /**
1535
+ * Specifies a string used to highlight matched string parts in options.
1536
+ */
1474
1537
  matchWord: {
1475
1538
  type: String,
1476
1539
  attribute: 'matchword'
1477
1540
  },
1541
+
1542
+ /**
1543
+ * When true, the selected option can be multiple options.
1544
+ */
1478
1545
  multiSelect: {
1479
1546
  type: Boolean,
1480
1547
  reflect: true,
1481
1548
  attribute: 'multiselect'
1482
1549
  },
1483
- selectAllMatchingOptions: {
1550
+
1551
+ /**
1552
+ * When true, selected option will not show the checkmark.
1553
+ */
1554
+ noCheckmark: {
1484
1555
  type: Boolean,
1485
1556
  reflect: true,
1557
+ attribute: 'nocheckmark'
1486
1558
  },
1487
1559
 
1488
1560
  /**
1489
- * Value selected for the component.
1561
+ * Specifies the current active menuOption.
1490
1562
  */
1491
- value: {
1492
- type: String,
1493
- reflect: true,
1494
- attribute: 'value'
1563
+ optionActive: {
1564
+ type: Object,
1565
+ attribute: 'optionactive'
1495
1566
  },
1496
1567
 
1497
1568
  /**
1498
- * Indent level for submenus.
1499
- * @private
1569
+ * An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
1500
1570
  */
1501
- level: {
1502
- type: Number,
1503
- reflect: false,
1504
- attribute: false
1571
+ optionSelected: {
1572
+ // Allow HTMLElement, HTMLElement[] arrays and undefined
1573
+ type: Object
1505
1574
  },
1506
1575
 
1507
1576
  /**
@@ -1512,6 +1581,43 @@ class AuroMenu extends AuroElement {
1512
1581
  type: Array,
1513
1582
  reflect: false,
1514
1583
  attribute: false
1584
+ },
1585
+
1586
+ /**
1587
+ * Sets the size of the menu.
1588
+ * @type {'sm' | 'md'}
1589
+ * @default 'sm'
1590
+ */
1591
+ size: {
1592
+ type: String,
1593
+ reflect: true
1594
+ },
1595
+
1596
+ /**
1597
+ * When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
1598
+ */
1599
+ selectAllMatchingOptions: {
1600
+ type: Boolean,
1601
+ reflect: true,
1602
+ },
1603
+
1604
+ /**
1605
+ * Sets the shape of the menu.
1606
+ * @type {'box' | 'round'}
1607
+ * @default 'box'
1608
+ */
1609
+ shape: {
1610
+ type: String,
1611
+ reflect: true
1612
+ },
1613
+
1614
+ /**
1615
+ * The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
1616
+ */
1617
+ value: {
1618
+ type: String,
1619
+ reflect: true,
1620
+ attribute: 'value'
1515
1621
  }
1516
1622
  };
1517
1623
  }
@@ -1524,6 +1630,14 @@ class AuroMenu extends AuroElement {
1524
1630
  ];
1525
1631
  }
1526
1632
 
1633
+ /**
1634
+ * @readonly
1635
+ * @returns {string} - Returns the label of the currently selected option(s).
1636
+ */
1637
+ get currentLabel() {
1638
+ return this.menuService.currentLabel;
1639
+ };
1640
+
1527
1641
  /**
1528
1642
  * @readonly
1529
1643
  * @returns {Array<HTMLElement>} - Returns the array of available menu options.
@@ -1549,7 +1663,7 @@ class AuroMenu extends AuroElement {
1549
1663
 
1550
1664
  /**
1551
1665
  * This will register this element with the browser.
1552
- * @param {string} [name="auro-menu"] - The name of element that you want to register to.
1666
+ * @param {string} [name="auro-menu"] - The name of the element that you want to register.
1553
1667
  *
1554
1668
  * @example
1555
1669
  * AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
@@ -18,6 +18,7 @@ The following sections are editable by making changes to the following files:
18
18
  -->
19
19
 
20
20
  # Radio
21
+
21
22
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
22
23
  <!-- The below content is automatically added from ./docs/partials/description.md -->
23
24
  `<auro-radio>` is a [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) that is rendered as a small circle, which is filled or highlighted when selected. Only one `<auro-radio>` component in a given `<auro-radio-group>` can be selected at the same time.
@@ -27,7 +28,19 @@ The following sections are editable by making changes to the following files:
27
28
  <!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
28
29
  <!-- AURO-GENERATED-CONTENT:END -->
29
30
 
31
+ ## Radio Use Cases
32
+
33
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
34
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
35
+ The `<auro-radio>` element is designed to be a single component for the use of creating an input `type="radio"` with an associated `<label>` that meets all use case and accessibility standards.
36
+
37
+ The following examples illustrate fully functional `<auro-radio>` elements wrapped with the `<auro-radio-group>` element. The `<auro-radio-group>` element is REQUIRED in order to mantain the relationship between individual `<auro-radio>` elements for functional radio button actions.
38
+
39
+ **Note**: The `<auro-radio>` element is only for to for use as a set of two or more `<auro-radio>` elements within an `<auro-radio-group>` element.
40
+ <!-- AURO-GENERATED-CONTENT:END -->
41
+
30
42
  ## Getting Started
43
+
31
44
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/componentInstall.md) -->
32
45
  <!-- The below content is automatically added from ../../docs/templates/componentInstall.md -->
33
46
 
@@ -40,30 +53,7 @@ $ npm i @aurodesignsystem/auro-formkit
40
53
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/gettingStarted.md) -->
41
54
  <!-- The below content is automatically added from ../../docs/templates/gettingStarted.md -->
42
55
 
43
- ### Import Options
44
-
45
- #### Automatic Registration
46
-
47
- For automatic registration, simply import the component:
48
-
49
- ```javascript
50
- // Registers <auro-radio> automatically
51
- import '@aurodesignsystem/auro-formkit/auro-radio';
52
- ```
53
-
54
- #### Custom Registration
55
-
56
- To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our static `AuroRadio.register('custom-radio')` method on the component class and pass in a unique name.
57
-
58
- ```javascript
59
- // Import the class only
60
- import { AuroRadio } from '@aurodesignsystem/auro-formkit/auro-radio/class';
61
-
62
- // Register with a custom name if desired
63
- AuroRadio.register('custom-radio');
64
- ```
65
-
66
- #### TypeScript Module Resolution
56
+ ### TypeScript Module Resolution
67
57
 
68
58
  When using TypeScript set `moduleResolution` to `bundler`, add the following to your `tsconfig.json`:
69
59
 
@@ -76,25 +66,10 @@ When using TypeScript set `moduleResolution` to `bundler`, add the following to
76
66
  ```
77
67
 
78
68
  This configuration enables proper module resolution for the component's TypeScript files.
79
- <!-- AURO-GENERATED-CONTENT:END -->
80
- **Reference component in HTML**
81
-
82
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
83
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
84
-
85
- ```html
86
- <auro-radio id="basicRadio1" label="Yes" name="radioDemo" value="yes"></auro-radio>
87
- ```
88
- <!-- AURO-GENERATED-CONTENT:END -->
89
-
90
- ### Design Token CSS Custom Property dependency
91
-
92
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/designTokens.md) -->
93
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
94
-
95
69
  <!-- AURO-GENERATED-CONTENT:END -->
96
70
 
97
71
  ## Install from CDN
72
+
98
73
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/bundleInstallDescription.md) -->
99
74
  <!-- The below content is automatically added from ../../docs/templates/bundleInstallDescription.md -->
100
75
  In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
@@ -104,23 +79,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
104
79
  ```
105
80
  <!-- AURO-GENERATED-CONTENT:END -->
106
81
 
107
- ## UI development browser support
108
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/browserSupport.md) -->
109
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
110
-
111
- <!-- AURO-GENERATED-CONTENT:END -->
112
-
113
- ## auro-radio use cases
114
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
115
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
116
- The `<auro-radio>` element is designed to be a single component for the use of creating an input `type="radio"` with an associated `<label>` that meets all use case and accessibility standards.
117
-
118
- The following examples illustrate fully functional `<auro-radio>` elements wrapped with the `<auro-radio-group>` element. The `<auro-radio-group>` element is REQUIRED in order to mantain the relationship between individual `<auro-radio>` elements for functional radio button actions.
119
-
120
- **Note**: The `<auro-radio>` element is only for to for use as a set of two or more `<auro-radio>` elements within an `<auro-radio-group>` element.
121
- <!-- AURO-GENERATED-CONTENT:END -->
122
-
123
- ## Formkit development
82
+ ## Formkit Development
124
83
 
125
84
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/partials/developmentDescription.md) -->
126
85
  <!-- The below content is automatically added from ../../docs/partials/developmentDescription.md -->
@@ -134,4 +93,49 @@ To only develop a single component, use the `--filter` flag:
134
93
  ```shell
135
94
  npx turbo dev --filter=@aurodesignsystem/auro-input
136
95
  ```
96
+ <!-- AURO-GENERATED-CONTENT:END -->
97
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
98
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
99
+
100
+ ## Custom Component Registration for Version Management
101
+
102
+ There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition. The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
103
+
104
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
105
+
106
+ However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
107
+
108
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
109
+
110
+ ```js
111
+ // Import the class only
112
+ import { AuroRadio, AuroRadioGroup } from '@aurodesignsystem/auro-formkit/auro-radio/class';
113
+
114
+ // Register with a custom name if desired
115
+ AuroRadio.register('custom-radio');
116
+ AuroRadioGroup.register('custom-radio-group');
117
+ ```
118
+
119
+ This will create a new custom element `<custom-radio>` and `<custom-radio-group>` that behaves exactly like `<auro-radio>` and `<auro-radio-group>`, allowing both to coexist on the same page without interfering with each other.
120
+
121
+ <div class="exampleWrapper exampleWrapper--flex">
122
+ <custom-radio-group>
123
+ <span slot="legend">Form label goes here</span>
124
+ <custom-radio id="customRadio1" label="Yes" name="radioDemo" value="yes"></custom-radio>
125
+ <custom-radio id="customRadio2" label="No" name="radioDemo" value="no"></custom-radio>
126
+ <custom-radio id="customRadio3" label="Maybe" name="radioDemo" value="maybe"></custom-radio>
127
+ </custom-radio-group>
128
+ </div>
129
+ <auro-accordion alignRight>
130
+ <span slot="trigger">See code</span>
131
+
132
+ ```html
133
+ <custom-radio-group>
134
+ <span slot="legend">Form label goes here</span>
135
+ <custom-radio id="customRadio1" label="Yes" name="radioDemo" value="yes"></custom-radio>
136
+ <custom-radio id="customRadio2" label="No" name="radioDemo" value="no"></custom-radio>
137
+ <custom-radio id="customRadio3" label="Maybe" name="radioDemo" value="maybe"></custom-radio>
138
+ </custom-radio-group>
139
+ ```
140
+ </auro-accordion>
137
141
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -1,13 +1,13 @@
1
+ import { resetStateExample } from "../apiExamples/reset-state";
1
2
  import { dynamicExample } from "../apiExamples/dynamic";
2
- import { resetStateExample } from "../apiExamples/resetState";
3
3
  import './index.js';
4
4
 
5
5
  export function initExamples(initCount) {
6
6
  initCount = initCount || 0;
7
7
 
8
8
  try {
9
- dynamicExample();
10
9
  resetStateExample();
10
+ dynamicExample();
11
11
  } catch (error) {
12
12
  if (initCount <= 20) {
13
13
  // setTimeout handles issue where content is sometimes loaded after the functions get called