@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.0 → 0.0.0-pr1422.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 (231) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +66 -0
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  3. package/components/bibtemplate/dist/headerVersion.d.ts +2 -0
  4. package/components/bibtemplate/dist/iconVersion.d.ts +2 -0
  5. package/components/bibtemplate/dist/index.d.ts +2 -0
  6. package/components/bibtemplate/dist/index.js +395 -0
  7. package/components/bibtemplate/dist/registered.js +395 -0
  8. package/components/bibtemplate/dist/styles/color-css.d.ts +2 -0
  9. package/components/bibtemplate/dist/styles/style-css.d.ts +2 -0
  10. package/components/bibtemplate/dist/styles/tokens-css.d.ts +2 -0
  11. package/components/checkbox/demo/api.md +489 -0
  12. package/components/checkbox/demo/api.min.js +2133 -0
  13. package/components/checkbox/demo/index.md +55 -0
  14. package/components/checkbox/demo/index.min.js +2108 -0
  15. package/components/checkbox/demo/keyboardBehavior.md +0 -0
  16. package/components/checkbox/demo/readme.md +142 -0
  17. package/components/checkbox/dist/auro-checkbox-group.d.ts +176 -0
  18. package/components/checkbox/dist/auro-checkbox.d.ts +209 -0
  19. package/components/checkbox/dist/index.d.ts +3 -0
  20. package/components/checkbox/dist/index.js +2057 -0
  21. package/components/checkbox/dist/registered.js +2058 -0
  22. package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +2 -0
  23. package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +2 -0
  24. package/components/checkbox/dist/styles/color-css.d.ts +2 -0
  25. package/components/checkbox/dist/styles/colorGroup-css.d.ts +2 -0
  26. package/components/checkbox/dist/styles/tokens-css.d.ts +2 -0
  27. package/components/combobox/demo/api.md +2287 -0
  28. package/components/combobox/demo/api.min.js +18025 -0
  29. package/components/combobox/demo/index.md +196 -0
  30. package/components/combobox/demo/index.min.js +17930 -0
  31. package/components/combobox/demo/keyboardBehavior.md +281 -0
  32. package/components/combobox/demo/readme.md +158 -0
  33. package/components/combobox/dist/auro-combobox.d.ts +578 -0
  34. package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +9 -0
  35. package/components/combobox/dist/index.d.ts +2 -0
  36. package/components/combobox/dist/index.js +15845 -0
  37. package/components/combobox/dist/registered.js +15847 -0
  38. package/components/combobox/dist/styles/emphasized/style-css.d.ts +2 -0
  39. package/components/combobox/dist/styles/snowflake/style-css.d.ts +2 -0
  40. package/components/combobox/dist/styles/style-css.d.ts +2 -0
  41. package/components/counter/demo/api.md +1285 -0
  42. package/components/counter/demo/api.min.js +8237 -0
  43. package/components/counter/demo/index.md +92 -0
  44. package/components/counter/demo/index.min.js +8218 -0
  45. package/components/counter/demo/keyboardBehavior.md +127 -0
  46. package/components/counter/demo/readme.md +161 -0
  47. package/components/counter/dist/auro-counter-button.d.ts +14 -0
  48. package/components/counter/dist/auro-counter-group.d.ts +390 -0
  49. package/components/counter/dist/auro-counter-wrapper.d.ts +17 -0
  50. package/components/counter/dist/auro-counter.d.ts +136 -0
  51. package/components/counter/dist/buttonVersion.d.ts +2 -0
  52. package/components/counter/dist/iconVersion.d.ts +2 -0
  53. package/components/counter/dist/index.d.ts +3 -0
  54. package/components/counter/dist/index.js +8140 -0
  55. package/components/counter/dist/keyboardStrategy.d.ts +4 -0
  56. package/components/counter/dist/registered.js +8141 -0
  57. package/components/counter/dist/styles/color-css.d.ts +2 -0
  58. package/components/counter/dist/styles/counter-button-color-css.d.ts +2 -0
  59. package/components/counter/dist/styles/counter-button-css.d.ts +2 -0
  60. package/components/counter/dist/styles/counter-group-css.d.ts +2 -0
  61. package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +2 -0
  62. package/components/counter/dist/styles/counter-wrapper-css.d.ts +2 -0
  63. package/components/counter/dist/styles/shapeSize-css.d.ts +2 -0
  64. package/components/counter/dist/styles/style-css.d.ts +2 -0
  65. package/components/counter/dist/styles/tokens-css.d.ts +2 -0
  66. package/components/datepicker/demo/api.md +1824 -0
  67. package/components/datepicker/demo/api.min.js +24654 -0
  68. package/components/datepicker/demo/index.md +158 -0
  69. package/components/datepicker/demo/index.min.js +24375 -0
  70. package/components/datepicker/demo/keyboardBehavior.md +19 -0
  71. package/components/datepicker/demo/readme.md +137 -0
  72. package/components/datepicker/dist/auro-calendar-cell.d.ts +169 -0
  73. package/components/datepicker/dist/auro-calendar-month.d.ts +20 -0
  74. package/components/datepicker/dist/auro-calendar.d.ts +173 -0
  75. package/components/datepicker/dist/auro-datepicker.d.ts +716 -0
  76. package/components/datepicker/dist/buttonVersion.d.ts +2 -0
  77. package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +1 -0
  78. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  79. package/components/datepicker/dist/index.d.ts +2 -0
  80. package/components/datepicker/dist/index.js +24290 -0
  81. package/components/datepicker/dist/popoverVersion.d.ts +2 -0
  82. package/components/datepicker/dist/registered.js +24290 -0
  83. package/components/datepicker/dist/styles/classic/color-css.d.ts +2 -0
  84. package/components/datepicker/dist/styles/classic/style-css.d.ts +2 -0
  85. package/components/datepicker/dist/styles/color-calendar-css.d.ts +2 -0
  86. package/components/datepicker/dist/styles/color-cell-css.d.ts +2 -0
  87. package/components/datepicker/dist/styles/color-css.d.ts +2 -0
  88. package/components/datepicker/dist/styles/color-month-css.d.ts +2 -0
  89. package/components/datepicker/dist/styles/shapeSize-css.d.ts +2 -0
  90. package/components/datepicker/dist/styles/snowflake/color-css.d.ts +2 -0
  91. package/components/datepicker/dist/styles/snowflake/style-css.d.ts +2 -0
  92. package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +2 -0
  93. package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +2 -0
  94. package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +2 -0
  95. package/components/datepicker/dist/styles/style-css.d.ts +2 -0
  96. package/components/datepicker/dist/styles/tokens-css.d.ts +2 -0
  97. package/components/datepicker/dist/utilities.d.ts +78 -0
  98. package/components/datepicker/dist/utilitiesCalendar.d.ts +38 -0
  99. package/components/datepicker/dist/utilitiesCalendarRender.d.ts +50 -0
  100. package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +5 -0
  101. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +60 -0
  102. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +1 -0
  103. package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +57 -0
  104. package/components/dropdown/demo/api.md +1358 -0
  105. package/components/dropdown/demo/api.min.js +5019 -0
  106. package/components/dropdown/demo/index.md +283 -0
  107. package/components/dropdown/demo/index.min.js +4954 -0
  108. package/components/dropdown/demo/keyboardBehavior.md +77 -0
  109. package/components/dropdown/demo/readme.md +160 -0
  110. package/components/dropdown/dist/auro-dropdown.d.ts +482 -0
  111. package/components/dropdown/dist/auro-dropdownBib.d.ts +128 -0
  112. package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +7 -0
  113. package/components/dropdown/dist/iconVersion.d.ts +2 -0
  114. package/components/dropdown/dist/index.d.ts +2 -0
  115. package/components/dropdown/dist/index.js +4847 -0
  116. package/components/dropdown/dist/registered.js +4847 -0
  117. package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +2 -0
  118. package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +2 -0
  119. package/components/dropdown/dist/styles/classic/color-css.d.ts +2 -0
  120. package/components/dropdown/dist/styles/classic/style-css.d.ts +2 -0
  121. package/components/dropdown/dist/styles/color-css.d.ts +2 -0
  122. package/components/dropdown/dist/styles/emphasized/style-css.d.ts +2 -0
  123. package/components/dropdown/dist/styles/shapeSize-css.d.ts +2 -0
  124. package/components/dropdown/dist/styles/snowflake/style-css.d.ts +2 -0
  125. package/components/dropdown/dist/styles/style-css.d.ts +2 -0
  126. package/components/dropdown/dist/styles/tokens-css.d.ts +2 -0
  127. package/components/form/demo/api.md +319 -0
  128. package/components/form/demo/api.min.js +71170 -0
  129. package/components/form/demo/index.md +128 -0
  130. package/components/form/demo/index.min.js +71170 -0
  131. package/components/form/demo/keyboardBehavior.md +0 -0
  132. package/components/form/demo/readme.md +145 -0
  133. package/components/form/dist/auro-form.d.ts +280 -0
  134. package/components/form/dist/index.d.ts +2 -0
  135. package/components/form/dist/index.js +718 -0
  136. package/components/form/dist/registered.d.ts +1 -0
  137. package/components/form/dist/registered.js +718 -0
  138. package/components/form/dist/styles/style-css.d.ts +2 -0
  139. package/components/helptext/dist/auro-helptext.d.ts +69 -0
  140. package/components/helptext/dist/index.d.ts +2 -0
  141. package/components/helptext/dist/index.js +231 -0
  142. package/components/helptext/dist/registered.js +231 -0
  143. package/components/helptext/dist/styles/color-css.d.ts +2 -0
  144. package/components/helptext/dist/styles/style-css.d.ts +2 -0
  145. package/components/helptext/dist/styles/tokens-css.d.ts +2 -0
  146. package/components/input/demo/api.md +1397 -0
  147. package/components/input/demo/api.min.js +7473 -0
  148. package/components/input/demo/index.md +161 -0
  149. package/components/input/demo/index.min.js +7393 -0
  150. package/components/input/demo/keyboardBehavior.md +0 -0
  151. package/components/input/demo/readme.md +134 -0
  152. package/components/input/dist/auro-input.d.ts +207 -0
  153. package/components/input/dist/base-input.d.ts +628 -0
  154. package/components/input/dist/buttonVersion.d.ts +2 -0
  155. package/components/input/dist/i18n.d.ts +18 -0
  156. package/components/input/dist/iconVersion.d.ts +2 -0
  157. package/components/input/dist/index.d.ts +2 -0
  158. package/components/input/dist/index.js +7305 -0
  159. package/components/input/dist/registered.js +7305 -0
  160. package/components/input/dist/styles/classic/color-css.d.ts +2 -0
  161. package/components/input/dist/styles/classic/style-css.d.ts +2 -0
  162. package/components/input/dist/styles/color-css.d.ts +2 -0
  163. package/components/input/dist/styles/default/borders-css.d.ts +2 -0
  164. package/components/input/dist/styles/default/color-css.d.ts +2 -0
  165. package/components/input/dist/styles/default/mixins-css.d.ts +2 -0
  166. package/components/input/dist/styles/default/notificationIcons-css.d.ts +2 -0
  167. package/components/input/dist/styles/default/style-css.d.ts +2 -0
  168. package/components/input/dist/styles/emphasized/color-css.d.ts +2 -0
  169. package/components/input/dist/styles/emphasized/style-css.d.ts +2 -0
  170. package/components/input/dist/styles/mixins-css.d.ts +2 -0
  171. package/components/input/dist/styles/shapeSize-css.d.ts +2 -0
  172. package/components/input/dist/styles/snowflake/style-css.d.ts +2 -0
  173. package/components/input/dist/styles/style-css.d.ts +2 -0
  174. package/components/input/dist/styles/tokens-css.d.ts +2 -0
  175. package/components/input/dist/utilities.d.ts +25 -0
  176. package/components/layoutElement/dist/auroElement.d.ts +40 -0
  177. package/components/layoutElement/dist/index.d.ts +2 -0
  178. package/components/layoutElement/dist/index.js +107 -0
  179. package/components/layoutElement/dist/registered.js +107 -0
  180. package/components/menu/demo/api.md +1201 -0
  181. package/components/menu/demo/api.min.js +2397 -0
  182. package/components/menu/demo/index.md +72 -0
  183. package/components/menu/demo/index.min.js +2290 -0
  184. package/components/menu/demo/keyboardBehavior.md +0 -0
  185. package/components/menu/demo/readme.md +145 -0
  186. package/components/menu/dist/auro-menu-utils.d.ts +34 -0
  187. package/components/menu/dist/auro-menu.context.d.ts +239 -0
  188. package/components/menu/dist/auro-menu.d.ts +317 -0
  189. package/components/menu/dist/auro-menuoption.d.ts +210 -0
  190. package/components/menu/dist/iconVersion.d.ts +2 -0
  191. package/components/menu/dist/index.d.ts +4 -0
  192. package/components/menu/dist/index.js +2253 -0
  193. package/components/menu/dist/registered.js +2201 -0
  194. package/components/menu/dist/styles/default/color-menu-css.d.ts +2 -0
  195. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
  196. package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
  197. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  198. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  199. package/components/radio/demo/api.md +675 -0
  200. package/components/radio/demo/api.min.js +2210 -0
  201. package/components/radio/demo/index.md +73 -0
  202. package/components/radio/demo/index.min.js +2167 -0
  203. package/components/radio/demo/keyboardBehavior.md +0 -0
  204. package/components/radio/demo/readme.md +141 -0
  205. package/components/radio/dist/auro-radio-group.d.ts +250 -0
  206. package/components/radio/dist/auro-radio.d.ts +180 -0
  207. package/components/radio/dist/index.d.ts +3 -0
  208. package/components/radio/dist/index.js +2116 -0
  209. package/components/radio/dist/registered.js +2117 -0
  210. package/components/radio/dist/styles/auro-radio-group-css.d.ts +2 -0
  211. package/components/radio/dist/styles/color-css.d.ts +2 -0
  212. package/components/radio/dist/styles/groupColor-css.d.ts +2 -0
  213. package/components/radio/dist/styles/style-css.d.ts +2 -0
  214. package/components/radio/dist/styles/tokens-css.d.ts +2 -0
  215. package/components/select/demo/api.md +2378 -0
  216. package/components/select/demo/api.min.js +10542 -0
  217. package/components/select/demo/index.md +355 -0
  218. package/components/select/demo/index.min.js +10449 -0
  219. package/components/select/demo/keyboardBehavior.md +245 -0
  220. package/components/select/demo/readme.md +148 -0
  221. package/components/select/dist/auro-select.d.ts +553 -0
  222. package/components/select/dist/index.d.ts +2 -0
  223. package/components/select/dist/index.js +8376 -0
  224. package/components/select/dist/registered.js +8376 -0
  225. package/components/select/dist/selectKeyboardStrategy.d.ts +11 -0
  226. package/components/select/dist/styles/emphasized/color-css.d.ts +2 -0
  227. package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
  228. package/components/select/dist/styles/style-css.d.ts +2 -0
  229. package/components/select/dist/styles/tokens-css.d.ts +2 -0
  230. package/custom-elements.json +18806 -0
  231. package/package.json +2 -2
@@ -0,0 +1,2117 @@
1
+ import { css, LitElement, html } from 'lit';
2
+ import { classMap } from 'lit/directives/class-map.js';
3
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
+ import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
5
+
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
7
+
8
+ var styleCss$2 = css`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-75, 0.375rem)}.rdoGroup:has(:enabled) .label:hover{cursor:pointer}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:after{position:absolute;z-index:1;top:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
9
+
10
+ var colorCss$2 = css`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]),:host([appearance=inverse][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]),:host([appearance=inverse][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]),:host([appearance=inverse][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]),:host([appearance=inverse][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible),:host([appearance=inverse].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
11
+
12
+ var tokenCss = css`:host{--ds-auro-radio-group-label-color: inherit;--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-radio-btn-fill-color: transparent;--ds-auro-radio-btn-inset-color: transparent;--ds-auro-radio-label-color: inherit;--ds-auro-radio-tap-color: transparent}`;
13
+
14
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
15
+ // See LICENSE in the project root for license information.
16
+
17
+ // ---------------------------------------------------------------------
18
+
19
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
20
+
21
+ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
22
+
23
+ /* eslint-disable jsdoc/require-param */
24
+
25
+ /**
26
+ * This will register a new custom element with the browser.
27
+ * @param {String} name - The name of the custom element.
28
+ * @param {Object} componentClass - The class to register as a custom element.
29
+ * @returns {void}
30
+ */
31
+ registerComponent(name, componentClass) {
32
+ if (!customElements.get(name)) {
33
+ customElements.define(name, class extends componentClass {});
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Finds and returns the closest HTML Element based on a selector.
39
+ * @returns {void}
40
+ */
41
+ closestElement(
42
+ selector, // selector like in .closest()
43
+ base = this, // extra functionality to skip a parent
44
+ __Closest = (el, found = el && el.closest(selector)) =>
45
+ !el || el === document || el === window
46
+ ? null // standard .closest() returns null for non-found selectors also
47
+ : found
48
+ ? found // found a selector INside this element
49
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
50
+ ) {
51
+ return __Closest(base);
52
+ }
53
+ /* eslint-enable jsdoc/require-param */
54
+
55
+ /**
56
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
57
+ * @param {Object} elem - The element to check.
58
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
59
+ * @returns {void}
60
+ */
61
+ handleComponentTagRename(elem, tagName) {
62
+ const tag = tagName.toLowerCase();
63
+ const elemTag = elem.tagName.toLowerCase();
64
+
65
+ if (elemTag !== tag) {
66
+ elem.setAttribute(tag, true);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Validates if an element is a specific Auro component.
72
+ * @param {Object} elem - The element to validate.
73
+ * @param {String} tagName - The name of the Auro component to check against.
74
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
75
+ */
76
+ elementMatch(elem, tagName) {
77
+ const tag = tagName.toLowerCase();
78
+ const elemTag = elem.tagName.toLowerCase();
79
+
80
+ return elemTag === tag || elem.hasAttribute(tag);
81
+ }
82
+
83
+ /**
84
+ * Gets the text content of a named slot.
85
+ * @returns {String}
86
+ * @private
87
+ */
88
+ getSlotText(elem, name) {
89
+ const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
90
+ const nodes = slot?.assignedNodes({ flatten: true }) || [];
91
+ const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
92
+
93
+ return text || null;
94
+ }
95
+ };
96
+
97
+ /* eslint-disable max-lines, no-underscore-dangle */
98
+ // Copyright (c) 2026 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
99
+ // See LICENSE in the project root for license information.
100
+
101
+
102
+ /**
103
+ * The `auro-radio` element is used to a button that allows the user to select one option from a set.
104
+ * @customElement auro-radio
105
+ *
106
+ * @event toggleSelected - Notifies that the component has toggled the checked/selected state.
107
+ * @event {CustomEvent<any>} change - (Deprecated) Notifies when checked value is changed.
108
+ * @event {InputEvent} input - Notifies when when checked value is changed by user's interface.
109
+ * @event focusSelected - Notifies that the component has gained focus.
110
+ * @event auroRadio-blur - Notifies that the component has lost focus.
111
+ * @event resetRadio - Notifies that the component has reset the checked/selected state.
112
+ * @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
113
+ *
114
+ * @csspart radio - apply css to a specific checkbox.
115
+ * @csspart radio-input - apply css to a specific checkbox's input.
116
+ * @csspart radio-label - apply css to a specific checkbox's label.
117
+ */
118
+ class AuroRadio extends LitElement {
119
+ constructor() {
120
+ super();
121
+
122
+ this._initializeDefaults();
123
+ }
124
+
125
+ _initializeDefaults() {
126
+ this.appearance = "default";
127
+ this.checked = false;
128
+ this.disabled = false;
129
+ this.required = false;
130
+ this.error = false;
131
+ this.onDark = false;
132
+ this.touched = false;
133
+ this.role = 'radio';
134
+
135
+ /**
136
+ * @private
137
+ */
138
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
139
+ }
140
+
141
+ static get styles() {
142
+ return [
143
+ styleCss$2,
144
+ colorCss$2,
145
+ tokenCss
146
+ ];
147
+ }
148
+
149
+ // function to define props used within the scope of this component
150
+ static get properties() {
151
+ return {
152
+
153
+ /**
154
+ * Defines whether the component will be on lighter or darker backgrounds.
155
+ * @type {'default' | 'inverse'}
156
+ * @default 'default'
157
+ */
158
+ appearance: {
159
+ type: String,
160
+ reflect: true
161
+ },
162
+
163
+ /**
164
+ * If set to true, the radio button will be filled.
165
+ */
166
+ checked: {
167
+ type: Boolean,
168
+ reflect: true
169
+ },
170
+
171
+ /**
172
+ * If set to true, the radio button will be non-clickable.
173
+ */
174
+ disabled: {
175
+ type: Boolean,
176
+ reflect: true
177
+ },
178
+
179
+ /**
180
+ * If set to true, sets an error state on the radio button.
181
+ */
182
+ error: {
183
+ type: Boolean,
184
+ reflect: true
185
+ },
186
+
187
+ /**
188
+ * The id global attribute defines an identifier (ID) which must be unique in the whole document.
189
+ */
190
+ id: {
191
+ type: String,
192
+ reflect: true
193
+ },
194
+
195
+ /**
196
+ * ID for input node.
197
+ * @private
198
+ */
199
+ inputId: {
200
+ type: String,
201
+ reflect: false,
202
+ attribute: false
203
+ },
204
+
205
+ /**
206
+ * Label for the radio button.
207
+ */
208
+ label: { type: String },
209
+
210
+ /**
211
+ * Name for the radio button group.
212
+ */
213
+ name: { type: String },
214
+
215
+ /**
216
+ * DEPRECATED - use `appearance="inverse"` instead.
217
+ */
218
+ onDark: {
219
+ type: Boolean,
220
+ reflect: true
221
+ },
222
+
223
+ /**
224
+ * Defines element as required.
225
+ */
226
+ required: {
227
+ type: Boolean,
228
+ reflect: true
229
+ },
230
+
231
+ /**
232
+ * Don't add to api.md since changing of this can easily break a11y.
233
+ * @private
234
+ */
235
+ role: {
236
+ type: String,
237
+ reflect: true
238
+ },
239
+
240
+ /**
241
+ * Whether or not the radio button has been touched by the user.
242
+ * @private
243
+ */
244
+ touched: {
245
+ type: Boolean,
246
+ reflect: true,
247
+ attribute: false
248
+ },
249
+
250
+ /**
251
+ * The value of the radio button.
252
+ */
253
+ value: { type: String }
254
+ };
255
+ }
256
+
257
+ /**
258
+ * This will register this element with the browser.
259
+ * @param {string} [name="auro-radio"] - The name of the element that you want to register.
260
+ *
261
+ * @example
262
+ * AuroRadio.register("custom-radio") // This will resgiter this element to <custom-radio/>
263
+ *
264
+ */
265
+ static register(name = "auro-radio") {
266
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadio);
267
+ }
268
+
269
+ /**
270
+ * Method for handling content when change event is fired.
271
+ * @private
272
+ * @param {Event} event - The trigger event tied to this function.
273
+ * @returns {void}
274
+ */
275
+ handleChange(event) {
276
+ this.checked = event.target.checked;
277
+ const customEvent = new CustomEvent(event.type, event);
278
+ this.dispatchEvent(customEvent);
279
+ }
280
+
281
+ /**
282
+ * Method for handling content when input event is fired.
283
+ * @private
284
+ * @param {Event} event - The trigger event tied to this function.
285
+ * @returns {void}
286
+ */
287
+ handleInput(event) {
288
+ this.checked = event.target.checked;
289
+ this.dispatchEvent(new CustomEvent('toggleSelected', {
290
+ bubbles: true,
291
+ composed: true,
292
+ target: this
293
+ }));
294
+ }
295
+
296
+ /**
297
+ * Method for handling focus event.
298
+ * @private
299
+ * @param {Event} event - The trigger event tied to this function.
300
+ * @returns {void}
301
+ */
302
+ handleFocus(event) {
303
+ this.touched = true;
304
+ this.dispatchEvent(new CustomEvent('focusSelected', {
305
+ bubbles: true,
306
+ composed: true,
307
+ target: event.target
308
+ }));
309
+ }
310
+
311
+ /**
312
+ * Method for handling blur event.
313
+ * @private
314
+ * @param {Event} event - The trigger event tied to this function.
315
+ * @returns {void}
316
+ */
317
+ handleBlur(event) {
318
+ this.dispatchEvent(new CustomEvent('auroRadio-blur', {
319
+ bubbles: true,
320
+ composed: true,
321
+ target: event.target
322
+ }));
323
+ }
324
+
325
+ /**
326
+ * Resets component to initial state.
327
+ * @returns {void}
328
+ */
329
+ reset() {
330
+ this.touched = false;
331
+ this.checked = false;
332
+ this.error = false;
333
+ }
334
+
335
+ updated(changedProperties) {
336
+ if (changedProperties.has('required')) {
337
+ this.setAttribute('aria-required', this.isRequired(this.required));
338
+ }
339
+
340
+ if (changedProperties.has('disabled')) {
341
+ if (this.disabled) {
342
+ this.setAttribute('aria-disabled', '');
343
+ } else {
344
+ this.removeAttribute('aria-disabled');
345
+ }
346
+ }
347
+
348
+ if (changedProperties.has('checked')) {
349
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
350
+ // eslint-disable-next-line no-magic-numbers
351
+ this.setAttribute('tabindex', this.checked ? 0 : -1);
352
+
353
+ this.dispatchEvent(new CustomEvent('resetRadio', {
354
+ bubbles: true,
355
+ composed: true
356
+ }));
357
+
358
+ if (this.checked) {
359
+ this.dispatchEvent(new CustomEvent('auroRadio-selected', {
360
+ bubbles: true,
361
+ composed: true
362
+ }));
363
+ }
364
+ }
365
+ }
366
+
367
+ /**
368
+ * Method for handling passing the required status to aria.
369
+ * @private
370
+ * @param {Boolean} required - The element's required attribute.
371
+ * @returns {void}
372
+ */
373
+ isRequired(required) {
374
+ if (required) {
375
+ return 'true';
376
+ }
377
+
378
+ return 'false';
379
+ }
380
+
381
+ firstUpdated() {
382
+ // Add the tag name as an attribute if it is different than the component name
383
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio');
384
+
385
+ this.addEventListener('focus', this.handleFocus);
386
+ this.addEventListener('blur', this.handleBlur);
387
+
388
+ this.input = this.shadowRoot.querySelector('input');
389
+
390
+ this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
391
+
392
+ this.addEventListener('click', () => {
393
+ this.input.click();
394
+ });
395
+ }
396
+
397
+ // function that renders the HTML and CSS into the scope of the component
398
+ render() {
399
+ const labelClasses = {
400
+ 'ods-inputLabel': true,
401
+ 'ods-inputLabel--radio': true,
402
+ 'label': true,
403
+ 'label--rdo': true,
404
+ 'errorBorder': this.error
405
+ };
406
+
407
+ return html`
408
+ <div class="ods-inputGroup rdoGroup body-default" part="radio">
409
+ <input
410
+ class="util_displayHidden ods-inputOption rdo--input"
411
+ part="radio-input"
412
+ @input="${this.handleInput}"
413
+ @change="${this.handleChange}"
414
+ ?disabled="${this.disabled}"
415
+ .checked="${this.checked}"
416
+ id="${this.inputId}"
417
+ name="${ifDefined(this.name)}"
418
+ type="radio"
419
+ .value="${this.value}"
420
+ aria-hidden="true"
421
+ tabindex="-1"
422
+ />
423
+
424
+ <label for="${this.inputId}" class="${classMap(labelClasses)}" part="radio-label">
425
+ <slot>${this.label}</slot>
426
+ </label>
427
+ </div>
428
+ <slot name="content" class="slotContent"></slot>
429
+ `;
430
+ }
431
+ }
432
+
433
+ var styleCss$1 = css`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}.hidden{display:none}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
434
+
435
+ var colorCss$1 = css`:host legend{color:var(--ds-auro-radio-group-label-color)}:host([disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
436
+
437
+ class DateFormatter {
438
+
439
+ constructor() {
440
+
441
+ /**
442
+ * @description Parses a date string into its components.
443
+ * @param {string} dateStr - Date string to parse.
444
+ * @param {string} format - Date format to parse.
445
+ * @returns {Object<key["month" | "day" | "year"]: number>|undefined}
446
+ */
447
+ this.parseDate = (dateStr, format = 'mm/dd/yyyy') => {
448
+
449
+ // Guard Clause: Date string is defined
450
+ if (!dateStr) {
451
+ return undefined;
452
+ }
453
+
454
+ // Assume the separator is a "/" a defined in our code base
455
+ const separator = '/';
456
+
457
+ // Get the parts of the date and format
458
+ const valueParts = dateStr.split(separator);
459
+ const formatParts = format.split(separator);
460
+
461
+ // Check if the value and format have the correct number of parts
462
+ if (valueParts.length !== formatParts.length) {
463
+ throw new Error('AuroDatepickerUtilities | parseDate: Date string and format length do not match');
464
+ }
465
+
466
+ // Holds the result to be returned
467
+ const result = formatParts.reduce((acc, part, index) => {
468
+ const value = valueParts[index];
469
+
470
+ if ((/m/iu).test(part)) {
471
+ acc.month = value;
472
+ } else if ((/d/iu).test(part)) {
473
+ acc.day = value;
474
+ } else if ((/y/iu).test(part)) {
475
+ acc.year = value;
476
+ }
477
+
478
+ return acc;
479
+ }, {});
480
+
481
+ // If we found all the parts, return the result
482
+ if (result.month && result.year) {
483
+ return result;
484
+ }
485
+
486
+ // Throw an error to let the dev know we were unable to parse the date string
487
+ throw new Error('AuroDatepickerUtilities | parseDate: Unable to parse date string');
488
+ };
489
+
490
+ /**
491
+ * Convert a date object to string format.
492
+ * @param {Object} date - Date to convert to string.
493
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
494
+ * @returns {String} Returns the date as a string.
495
+ */
496
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
497
+ year: "numeric",
498
+ month: "2-digit",
499
+ day: "2-digit",
500
+ });
501
+
502
+ /**
503
+ * Converts a date string to a North American date format.
504
+ * @param {String} dateStr - Date to validate.
505
+ * @param {String} format - Date format to validate against.
506
+ * @returns {Boolean}
507
+ */
508
+ this.toNorthAmericanFormat = (dateStr, format) => {
509
+
510
+ if (format === 'mm/dd/yyyy') {
511
+ return dateStr;
512
+ }
513
+
514
+ const parsedDate = this.parseDate(dateStr, format);
515
+
516
+ if (!parsedDate) {
517
+ throw new Error('AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string');
518
+ }
519
+
520
+ const { month, day, year } = parsedDate;
521
+
522
+ const dateParts = [];
523
+ if (month) {
524
+ dateParts.push(month);
525
+ }
526
+
527
+ if (day) {
528
+ dateParts.push(day);
529
+ }
530
+
531
+ if (year) {
532
+ dateParts.push(year);
533
+ }
534
+
535
+ return dateParts.join('/');
536
+ };
537
+ }
538
+ }
539
+ const dateFormatter = new DateFormatter();
540
+
541
+ // filepath: dateConstraints.mjs
542
+ const DATE_UTIL_CONSTRAINTS = {
543
+ maxDay: 31,
544
+ maxMonth: 12,
545
+ maxYear: 2400,
546
+ minDay: 1,
547
+ minMonth: 1,
548
+ minYear: 1900,
549
+ };
550
+
551
+ class AuroDateUtilitiesBase {
552
+
553
+ /**
554
+ * @description The maximum day value allowed by the various utilities in this class.
555
+ * @readonly
556
+ * @type {Number}
557
+ */
558
+ get maxDay() {
559
+ return DATE_UTIL_CONSTRAINTS.maxDay;
560
+ }
561
+
562
+ /**
563
+ * @description The maximum month value allowed by the various utilities in this class.
564
+ * @readonly
565
+ * @type {Number}
566
+ */
567
+ get maxMonth() {
568
+ return DATE_UTIL_CONSTRAINTS.maxMonth;
569
+ }
570
+
571
+ /**
572
+ * @description The maximum year value allowed by the various utilities in this class.
573
+ * @readonly
574
+ * @type {Number}
575
+ */
576
+ get maxYear() {
577
+ return DATE_UTIL_CONSTRAINTS.maxYear;
578
+ }
579
+
580
+ /**
581
+ * @description The minimum day value allowed by the various utilities in this class.
582
+ * @readonly
583
+ * @type {Number}
584
+ */
585
+ get minDay() {
586
+ return DATE_UTIL_CONSTRAINTS.minDay;
587
+ }
588
+
589
+ /**
590
+ * @description The minimum month value allowed by the various utilities in this class.
591
+ * @readonly
592
+ * @type {Number}
593
+ */
594
+ get minMonth() {
595
+ return DATE_UTIL_CONSTRAINTS.minMonth;
596
+ }
597
+
598
+ /**
599
+ * @description The minimum year value allowed by the various utilities in this class.
600
+ * @readonly
601
+ * @type {Number}
602
+ */
603
+ get minYear() {
604
+ return DATE_UTIL_CONSTRAINTS.minYear;
605
+ }
606
+ }
607
+
608
+ /* eslint-disable no-magic-numbers */
609
+
610
+ class AuroDateUtilities extends AuroDateUtilitiesBase {
611
+
612
+ /**
613
+ * Returns the current century.
614
+ * @returns {String} The current century.
615
+ */
616
+ getCentury () {
617
+ return String(new Date().getFullYear()).slice(0, 2);
618
+ }
619
+
620
+ /**
621
+ * Returns a four digit year.
622
+ * @param {String} year - The year to convert to four digits.
623
+ * @returns {String} The four digit year.
624
+ */
625
+ getFourDigitYear (year) {
626
+
627
+ const strYear = String(year).trim();
628
+ return strYear.length <= 2 ? this.getCentury() + strYear : strYear;
629
+ }
630
+
631
+ constructor() {
632
+
633
+ super();
634
+
635
+ /**
636
+ * Compares two dates to see if they match.
637
+ * @param {Object} date1 - First date to compare.
638
+ * @param {Object} date2 - Second date to compare.
639
+ * @returns {Boolean} Returns true if the dates match.
640
+ */
641
+ this.datesMatch = (date1, date2) => new Date(date1).getTime() === new Date(date2).getTime();
642
+
643
+ /**
644
+ * Returns true if value passed in is a valid date.
645
+ * @param {String} date - Date to validate.
646
+ * @param {String} format - Date format to validate against.
647
+ * @returns {Boolean}
648
+ */
649
+ this.validDateStr = (date, format) => {
650
+
651
+ // The length we expect the date string to be
652
+ const dateStrLength = format.length;
653
+
654
+ // Guard Clause: Date and format are defined
655
+ if (typeof date === "undefined" || typeof format === "undefined") {
656
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date and format are required');
657
+ }
658
+
659
+ // Guard Clause: Date should be of type string
660
+ if (typeof date !== "string") {
661
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Date must be a string');
662
+ }
663
+
664
+ // Guard Clause: Format should be of type string
665
+ if (typeof format !== "string") {
666
+ throw new Error('AuroDatepickerUtilities | validateDateStr: Format must be a string');
667
+ }
668
+
669
+ // Guard Clause: Length is what we expect it to be
670
+ if (date.length !== dateStrLength) {
671
+ return false;
672
+ }
673
+ // Get a formatted date string and parse it
674
+ const dateParts = dateFormatter.parseDate(date, format);
675
+
676
+ // Guard Clause: Date parse succeeded
677
+ if (!dateParts) {
678
+ return false;
679
+ }
680
+
681
+ // Create the expected date string based on the date parts
682
+ const expectedDateStr = `${dateParts.month}/${dateParts.day || "01"}/${this.getFourDigitYear(dateParts.year)}`;
683
+
684
+ // Generate a date object that we will extract a string date from to compare to the passed in date string
685
+ const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
686
+
687
+ // Get the date string of the date object we created from the string date
688
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
689
+
690
+ // Guard Clause: Generated date matches date string input
691
+ if (expectedDateStr !== actualDateStr) {
692
+ return false;
693
+ }
694
+
695
+ // If we passed all other checks, we can assume the date is valid
696
+ return true;
697
+ };
698
+
699
+ /**
700
+ * Determines if a string date value matches the format provided.
701
+ * @param {string} value = The date string value.
702
+ * @param { string} format = The date format to match against.
703
+ * @returns {boolean}
704
+ */
705
+ this.dateAndFormatMatch = (value, format) => {
706
+
707
+ // Ensure we have both values we need to do the comparison
708
+ if (!value || !format) {
709
+ throw new Error('AuroFormValidation | dateFormatMatch: value and format are required');
710
+ }
711
+
712
+ // If the lengths are different, they cannot match
713
+ if (value.length !== format.length) {
714
+ return false;
715
+ }
716
+
717
+ // Get the parts of the date
718
+ const dateParts = dateFormatter.parseDate(value, format);
719
+
720
+ // Validator for day
721
+ const dayValueIsValid = (day) => {
722
+
723
+ // Guard clause: if there is no day in the dateParts, we can ignore this check.
724
+ if (!dateParts.day) {
725
+ return true;
726
+ }
727
+
728
+ // Guard clause: ensure day exists.
729
+ if (!day) {
730
+ return false;
731
+ }
732
+
733
+ // Convert day to number
734
+ const numDay = Number.parseInt(day, 10);
735
+
736
+ // Guard clause: ensure day is a valid integer
737
+ if (Number.isNaN(numDay)) {
738
+ throw new Error('AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer');
739
+ }
740
+
741
+ // Guard clause: ensure day is within the valid range
742
+ if (numDay < this.minDay || numDay > this.maxDay) {
743
+ return false;
744
+ }
745
+
746
+ // Default return
747
+ return true;
748
+ };
749
+
750
+ // Validator for month
751
+ const monthValueIsValid = (month) => {
752
+
753
+ // Guard clause: ensure month exists.
754
+ if (!month) {
755
+ return false;
756
+ }
757
+
758
+ // Convert month to number
759
+ const numMonth = Number.parseInt(month, 10);
760
+
761
+ // Guard clause: ensure month is a valid integer
762
+ if (Number.isNaN(numMonth)) {
763
+ throw new Error('AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer');
764
+ }
765
+
766
+ // Guard clause: ensure month is within the valid range
767
+ if (numMonth < this.minMonth || numMonth > this.maxMonth) {
768
+ return false;
769
+ }
770
+
771
+ // Default return
772
+ return true;
773
+ };
774
+
775
+ // Validator for year
776
+ const yearIsValid = (_year) => {
777
+
778
+ // Guard clause: ensure year exists.
779
+ if (!_year) {
780
+ return false;
781
+ }
782
+
783
+ // Get the full year
784
+ const year = this.getFourDigitYear(_year);
785
+
786
+ // Convert year to number
787
+ const numYear = Number.parseInt(year, 10);
788
+
789
+ // Guard clause: ensure year is a valid integer
790
+ if (Number.isNaN(numYear)) {
791
+ throw new Error('AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer');
792
+ }
793
+
794
+ // Guard clause: ensure year is within the valid range
795
+ if (numYear < this.minYear || numYear > this.maxYear) {
796
+ return false;
797
+ }
798
+
799
+ // Default return
800
+ return true;
801
+ };
802
+
803
+ // Self-contained checks for month, day, and year
804
+ const checks = [
805
+ monthValueIsValid(dateParts.month),
806
+ dayValueIsValid(dateParts.day),
807
+ yearIsValid(dateParts.year)
808
+ ];
809
+
810
+ // If any of the checks failed, the date format does not match and the result is invalid
811
+ const isValid = checks.every((check) => check === true);
812
+
813
+ // If the check is invalid, return false
814
+ if (!isValid) {
815
+ return false;
816
+ }
817
+
818
+ // Default case
819
+ return true;
820
+ };
821
+ }
822
+ }
823
+
824
+ // Export a class instance
825
+ const dateUtilities = new AuroDateUtilities();
826
+
827
+ // Export the class instance methods individually
828
+ const {
829
+ datesMatch,
830
+ validDateStr,
831
+ dateAndFormatMatch,
832
+ minDay,
833
+ minMonth,
834
+ minYear,
835
+ maxDay,
836
+ maxMonth,
837
+ maxYear
838
+ } = dateUtilities;
839
+
840
+ const {
841
+ toNorthAmericanFormat,
842
+ parseDate,
843
+ getDateAsString
844
+ } = dateFormatter;
845
+
846
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
847
+ // See LICENSE in the project root for license information.
848
+
849
+
850
+ class AuroFormValidation {
851
+
852
+ constructor() {
853
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
854
+ }
855
+
856
+ /**
857
+ * Resets the element to its initial state.
858
+ * @private
859
+ * @param {object} elem - HTML element to reset.
860
+ * @returns {void}
861
+ */
862
+ reset(elem) {
863
+ elem.validity = undefined;
864
+ elem.value = undefined;
865
+ elem.touched = false;
866
+
867
+ // Resets the second value of the datepicker in range state
868
+ if (elem.valueEnd) {
869
+ elem.valueEnd = undefined;
870
+ }
871
+
872
+ // Resets selected option of element
873
+ if (elem.optionSelected) {
874
+ elem.optionSelected = undefined;
875
+ }
876
+
877
+ // Runs validation to handle error attribute
878
+ this.validate(elem);
879
+ }
880
+
881
+ /**
882
+ * Validates the attributes of a given element based on predefined validation rules.
883
+ *
884
+ * @param {HTMLElement} elem - The element to be validated.
885
+ * @returns {void}
886
+ *
887
+ * @example
888
+ * // Assuming `inputElement` is a reference to an input element in the DOM
889
+ * validateElementAttributes(inputElement);
890
+ *
891
+ * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
892
+ * If a validation rule is violated, it sets the element's validity state and error message accordingly.
893
+ *
894
+ * Validation rules:
895
+ * - input:
896
+ * - length:
897
+ * - tooShort: Checks if the value length is less than the minimum length.
898
+ * - tooLong: Checks if the value length exceeds the maximum length.
899
+ * - pattern:
900
+ * - patternMismatch: Checks if the value does not match the specified pattern.
901
+ * - counter:
902
+ * - range:
903
+ * - rangeOverflow: Checks if the value exceeds the maximum value.
904
+ * - rangeUnderflow: Checks if the value is less than the minimum value.
905
+ */
906
+ validateElementAttributes(elem) {
907
+ const validationRules = {
908
+ input: {
909
+ length: [
910
+ {
911
+ check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
912
+ validity: 'tooShort',
913
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
914
+ },
915
+ {
916
+ check: (e) => e.value?.length > e.maxLength,
917
+ validity: 'tooLong',
918
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
919
+ }
920
+ ],
921
+ pattern: [
922
+ {
923
+ check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
924
+ validity: 'patternMismatch',
925
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
926
+ }
927
+ ]
928
+ },
929
+ counter: {
930
+ range: [
931
+ {
932
+ check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
933
+ validity: 'rangeOverflow',
934
+ message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
935
+ },
936
+ {
937
+ check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
938
+ validity: 'rangeUnderflow',
939
+ message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
940
+ }
941
+ ]
942
+ },
943
+ combobox: {
944
+ filter: [
945
+ {
946
+ check: (e) => {
947
+
948
+ // Guard Clause: If the behavior is not 'filter', skip this validation
949
+ if (e.behavior !== 'filter') return false;
950
+
951
+ // Get the current input value
952
+ const currentInputValue = e.input.value;
953
+
954
+ // Skip validation if the input has no value
955
+ if (!currentInputValue) return false;
956
+
957
+ /**
958
+ * Let's check if the option selected and combobox value match.
959
+ */
960
+
961
+ // Guard Clause: If there is no option selected fail the validation
962
+ if (!e.optionSelected) return true;
963
+
964
+ // Guard Clause: If there is no value fail the validation
965
+ if (!e.value) return true;
966
+
967
+ // Guard Clause: If the selected option's value doesn't match the input value fail the validation
968
+ if (e.optionSelected.value !== e.value) return true;
969
+
970
+ /**
971
+ * Now let's make sure the user hasn't change the value in the input after selecting an option.
972
+ * This is to make sure there's no user confusion if they select an option but then change the value to something else.
973
+ */
974
+
975
+ // Guard Clause: If the current input value doesn't match the option selected value fail the validation
976
+ if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
977
+
978
+ // Guard Clause: If the current input value doesn't match the combobox value fail the validation
979
+ if (currentInputValue && currentInputValue !== e.value) return true;
980
+
981
+ // If all the checks passed the validation passes
982
+ return false;
983
+ },
984
+ validity: 'valueMissing',
985
+ message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
986
+ }
987
+ ]
988
+ }
989
+ };
990
+
991
+ let elementType;
992
+ if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
993
+ elementType = 'input';
994
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
995
+ elementType = 'counter';
996
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
997
+ elementType = 'combobox';
998
+ }
999
+
1000
+ if (elementType) {
1001
+ const rules = validationRules[elementType];
1002
+
1003
+ if (rules) {
1004
+ Object.values(rules).flat().forEach(rule => {
1005
+ if (rule.check(elem)) {
1006
+ elem.validity = rule.validity;
1007
+ elem.errorMessage = rule.message(elem);
1008
+ }
1009
+ });
1010
+ }
1011
+ }
1012
+ }
1013
+
1014
+ /**
1015
+ * Determines the validity state of the element based on the type attribute.
1016
+ * @private
1017
+ * @param {object} elem - HTML element to validate.
1018
+ * @returns {void}
1019
+ */
1020
+ validateType(elem) {
1021
+ if (elem.hasAttribute('type')) {
1022
+ if (elem.type === 'email') {
1023
+ const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
1024
+
1025
+ if (!elem.value.match(emailRegex)) {
1026
+ elem.validity = 'patternMismatch';
1027
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1028
+ return;
1029
+ }
1030
+ } else if (elem.type === 'credit-card') {
1031
+ if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
1032
+ elem.validity = 'tooShort';
1033
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1034
+ return;
1035
+ }
1036
+ } else if (elem.type === 'number') {
1037
+ if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
1038
+ elem.validity = 'rangeOverflow';
1039
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1040
+ return;
1041
+ }
1042
+
1043
+ if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
1044
+ elem.validity = 'rangeUnderflow';
1045
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1046
+ return;
1047
+ }
1048
+ } else if (elem.type === 'date' && elem.value?.length > 0) {
1049
+
1050
+ // Guard Clause: if the value is too short
1051
+ if (elem.value?.length < elem.lengthForType) {
1052
+
1053
+ elem.validity = 'tooShort';
1054
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1055
+ return;
1056
+ }
1057
+
1058
+ // Guard Clause: If the value is too long for the type
1059
+ if (elem.value?.length > elem.lengthForType) {
1060
+
1061
+ elem.validity = 'tooLong';
1062
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1063
+ return;
1064
+ }
1065
+
1066
+ // Validate that the date passed was the correct format
1067
+ if (!dateAndFormatMatch(elem.value, elem.format)) {
1068
+ elem.validity = 'patternMismatch';
1069
+ elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || 'Invalid Date Format Entered';
1070
+ return;
1071
+ }
1072
+
1073
+ // Validate that the date passed was a valid date
1074
+ if (!validDateStr(elem.value, elem.format)) {
1075
+ elem.validity = 'invalidDate';
1076
+ elem.errorMessage = elem.setCustomValidityInvalidDate || elem.setCustomValidity || 'Invalid Date Entered';
1077
+ return;
1078
+ }
1079
+
1080
+ // Perform the rest of the validation
1081
+ const formattedValue = toNorthAmericanFormat(elem.value, elem.format);
1082
+ const valueDate = new Date(formattedValue);
1083
+
1084
+ // // Validate max date
1085
+ if (elem.max?.length === elem.lengthForType) {
1086
+
1087
+ const maxDate = new Date(toNorthAmericanFormat(elem.max, elem.format));
1088
+
1089
+ if (valueDate > maxDate) {
1090
+ elem.validity = 'rangeOverflow';
1091
+ elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1092
+ return;
1093
+ }
1094
+ }
1095
+
1096
+ // Validate min date
1097
+ if (elem.min?.length === elem.lengthForType) {
1098
+ const minDate = new Date(toNorthAmericanFormat(elem.min, elem.format));
1099
+
1100
+ if (valueDate < minDate) {
1101
+ elem.validity = 'rangeUnderflow';
1102
+ elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1103
+ return;
1104
+ }
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+
1110
+ /**
1111
+ * Determines the validity state of the element.
1112
+ * @param {object} elem - HTML element to validate.
1113
+ * @param {boolean} force - Boolean that forces validation to run.
1114
+ * @returns {void}
1115
+ */
1116
+ validate(elem, force) {
1117
+ this.getInputElements(elem);
1118
+ this.getAuroInputs(elem);
1119
+
1120
+ // Check if validation should run
1121
+ let validationShouldRun =
1122
+
1123
+ // If the validation was forced
1124
+ force ||
1125
+
1126
+ // If the validation should run on input
1127
+ elem.validateOnInput ||
1128
+
1129
+ // State-based checks
1130
+ (
1131
+ // Element is not currently focused
1132
+ !elem.contains(document.activeElement) && // native input is not focused directly
1133
+ !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
1134
+
1135
+ // And element has been touched or is untouched but has a value
1136
+ ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
1137
+ );
1138
+
1139
+ if (elem.hasAttribute('error')) {
1140
+ elem.validity = 'customError';
1141
+ elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
1142
+ validationShouldRun = false;
1143
+ } else if (validationShouldRun) {
1144
+ elem.validity = 'valid';
1145
+ elem.errorMessage = '';
1146
+
1147
+ /**
1148
+ * Only validate once we interact with the datepicker
1149
+ * elem.value === undefined is the initial state pre-interaction.
1150
+ *
1151
+ * The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
1152
+ */
1153
+
1154
+ let hasValue = false;
1155
+
1156
+ // Check string for having a value
1157
+ if (typeof elem.value === "string") {
1158
+ hasValue = elem.value && elem.value.length > 0;
1159
+ }
1160
+
1161
+ if (typeof elem.value === "boolean") {
1162
+ hasValue = elem.value || elem.value === false;
1163
+ }
1164
+
1165
+ if (typeof elem.value === "number") {
1166
+ hasValue = !isNaN(elem.value) && elem.value !== null;
1167
+ }
1168
+
1169
+ // Check array value types for having a value
1170
+ if (Array.isArray(elem.value)) {
1171
+ hasValue = Boolean(
1172
+ elem.value.length > 0 &&
1173
+ elem.value.some((value) => typeof value === "string" && value.length > 0)
1174
+ );
1175
+ }
1176
+
1177
+ // If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
1178
+ if (this.auroInputElements?.length === 2) {
1179
+ if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
1180
+ hasValue = false;
1181
+ }
1182
+ }
1183
+
1184
+ const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
1185
+
1186
+ if (isCombobox) {
1187
+
1188
+ if (!elem.persistInput || elem.behavior === "filter") {
1189
+ hasValue = elem.input.value?.length > 0;
1190
+ }
1191
+ }
1192
+
1193
+ if (!hasValue && elem.required && (force || elem.touched)) {
1194
+ elem.validity = 'valueMissing';
1195
+ elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
1196
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1197
+ this.validateType(elem);
1198
+ this.validateElementAttributes(elem);
1199
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
1200
+ this.validateElementAttributes(elem);
1201
+ } else if (isCombobox) {
1202
+ this.validateElementAttributes(elem);
1203
+
1204
+ // Don't run extra validation for cases where the combobox is not being used as a filter
1205
+ validationShouldRun = elem.behavior !== 'filter';
1206
+ }
1207
+ }
1208
+
1209
+ if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing" && elem.validity !== "customError") {
1210
+
1211
+ const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
1212
+
1213
+ // Don't reset combobox validity if persistInput is set since we can't use the input value to validate
1214
+ if (!isCombobox || isCombobox && !elem.persistInput) {
1215
+
1216
+ // run validation on all inputs since we're going to use them to set the validity of this component
1217
+ this.auroInputElements.forEach(input => input.validate(force));
1218
+
1219
+ // Reset element validity to the validity of the input
1220
+ elem.validity = this.auroInputElements[0].validity;
1221
+ elem.errorMessage = this.auroInputElements[0].errorMessage;
1222
+ }
1223
+
1224
+ // multiple input in one components (datepicker)
1225
+ // combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
1226
+ if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
1227
+ elem.validity = this.auroInputElements[1].validity;
1228
+ elem.errorMessage = this.auroInputElements[1].errorMessage;
1229
+ }
1230
+ }
1231
+
1232
+ if (validationShouldRun || elem.hasAttribute('error')) {
1233
+ // Use the validity message override if it is declared
1234
+ if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
1235
+ elem.errorMessage = elem.ValidityMessageOverride;
1236
+ }
1237
+
1238
+ this.getErrorMessage(elem);
1239
+ }
1240
+
1241
+ elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1242
+ bubbles: true,
1243
+ composed: true,
1244
+ detail: {
1245
+ validity: elem.validity,
1246
+ message: elem.errorMessage
1247
+ }
1248
+ }));
1249
+ }
1250
+
1251
+ /**
1252
+ * Gets all the HTML5 `inputs` in the element shadow DOM.
1253
+ * @private
1254
+ * @param {object} elem - HTML element to validate.
1255
+ * @returns {void}
1256
+ */
1257
+ getInputElements(elem) {
1258
+ this.inputElements = elem.renderRoot.querySelectorAll('input');
1259
+ }
1260
+
1261
+ /**
1262
+ * Gets all the `auro-inputs` in the element shadow DOM.
1263
+ * @private
1264
+ * @param {object} elem - HTML element to validate.
1265
+ * @returns {void}
1266
+ */
1267
+ getAuroInputs(elem) {
1268
+ this.auroInputElements = elem.shadowRoot.querySelectorAll('auro-input, [auro-input]');
1269
+ }
1270
+
1271
+ /**
1272
+ * Return appropriate error message.
1273
+ * @private
1274
+ * @param {object} elem - HTML element to validate.
1275
+ * @returns {void}
1276
+ */
1277
+ getErrorMessage(elem) {
1278
+ if (elem.validity !== 'valid') {
1279
+ if (elem.setCustomValidity) {
1280
+ elem.errorMessage = elem.setCustomValidity;
1281
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
1282
+ const input = elem.renderRoot.querySelector('input');
1283
+
1284
+ if (input.validationMessage.length > 0) {
1285
+ elem.errorMessage = input.validationMessage;
1286
+ }
1287
+ } else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
1288
+ elem.errorMessage = elem.input?.inputElement?.validationMessage;
1289
+ } else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
1290
+ const firstInput = this.inputElements[0];
1291
+
1292
+ if (firstInput.validationMessage.length > 0) {
1293
+ elem.errorMessage = firstInput.validationMessage;
1294
+ } else if (this.inputElements?.length === 2) {
1295
+ const secondInput = this.inputElements[1];
1296
+
1297
+ if (secondInput.validationMessage.length > 0) {
1298
+ elem.errorMessage = secondInput.validationMessage;
1299
+ }
1300
+ }
1301
+ }
1302
+ } else {
1303
+ elem.errorMessage = '';
1304
+ }
1305
+ }
1306
+ }
1307
+
1308
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1309
+ // See LICENSE in the project root for license information.
1310
+
1311
+
1312
+ class AuroDependencyVersioning {
1313
+
1314
+ /**
1315
+ * Generates a unique string to be used for child auro element naming.
1316
+ * @private
1317
+ * @param {string} baseName - Defines the first part of the unique element name.
1318
+ * @param {string} version - Version of the component that will be appended to the baseName.
1319
+ * @returns {string} - Unique string to be used for naming.
1320
+ */
1321
+ generateElementName(baseName, version) {
1322
+ let result = baseName;
1323
+
1324
+ result += '-';
1325
+ result += version.replace(/[.]/g, '_');
1326
+
1327
+ return result;
1328
+ }
1329
+
1330
+ /**
1331
+ * Generates a unique string to be used for child auro element naming.
1332
+ * @param {string} baseName - Defines the first part of the unique element name.
1333
+ * @param {string} version - Version of the component that will be appended to the baseName.
1334
+ * @returns {string} - Unique string to be used for naming.
1335
+ */
1336
+ generateTag(baseName, version, tagClass) {
1337
+ const elementName = this.generateElementName(baseName, version);
1338
+ const tag = literal`${unsafeStatic(elementName)}`;
1339
+
1340
+ if (!customElements.get(elementName)) {
1341
+ customElements.define(elementName, class extends tagClass {});
1342
+ }
1343
+
1344
+ return tag;
1345
+ }
1346
+ }
1347
+
1348
+ var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]),:host([appearance=inverse]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]),:host([appearance=inverse][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1349
+
1350
+ var styleCss = css`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);line-height:var(--wcss-body-xs-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-weight, 450);letter-spacing:var(--wcss-body-letter-spacing, 0);line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 450);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 450);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1351
+
1352
+ var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
1353
+
1354
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1355
+ // See LICENSE in the project root for license information.
1356
+
1357
+ // ---------------------------------------------------------------------
1358
+
1359
+ /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1360
+
1361
+ class AuroLibraryRuntimeUtils {
1362
+
1363
+ /* eslint-disable jsdoc/require-param */
1364
+
1365
+ /**
1366
+ * This will register a new custom element with the browser.
1367
+ * @param {String} name - The name of the custom element.
1368
+ * @param {Object} componentClass - The class to register as a custom element.
1369
+ * @returns {void}
1370
+ */
1371
+ registerComponent(name, componentClass) {
1372
+ if (!customElements.get(name)) {
1373
+ customElements.define(name, class extends componentClass {});
1374
+ }
1375
+ }
1376
+
1377
+ /**
1378
+ * Finds and returns the closest HTML Element based on a selector.
1379
+ * @returns {void}
1380
+ */
1381
+ closestElement(
1382
+ selector, // selector like in .closest()
1383
+ base = this, // extra functionality to skip a parent
1384
+ __Closest = (el, found = el && el.closest(selector)) =>
1385
+ !el || el === document || el === window
1386
+ ? null // standard .closest() returns null for non-found selectors also
1387
+ : found
1388
+ ? found // found a selector INside this element
1389
+ : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1390
+ ) {
1391
+ return __Closest(base);
1392
+ }
1393
+ /* eslint-enable jsdoc/require-param */
1394
+
1395
+ /**
1396
+ * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
1397
+ * @param {Object} elem - The element to check.
1398
+ * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1399
+ * @returns {void}
1400
+ */
1401
+ handleComponentTagRename(elem, tagName) {
1402
+ const tag = tagName.toLowerCase();
1403
+ const elemTag = elem.tagName.toLowerCase();
1404
+
1405
+ if (elemTag !== tag) {
1406
+ elem.setAttribute(tag, true);
1407
+ }
1408
+ }
1409
+
1410
+ /**
1411
+ * Validates if an element is a specific Auro component.
1412
+ * @param {Object} elem - The element to validate.
1413
+ * @param {String} tagName - The name of the Auro component to check against.
1414
+ * @returns {Boolean} - Returns true if the element is the specified Auro component.
1415
+ */
1416
+ elementMatch(elem, tagName) {
1417
+ const tag = tagName.toLowerCase();
1418
+ const elemTag = elem.tagName.toLowerCase();
1419
+
1420
+ return elemTag === tag || elem.hasAttribute(tag);
1421
+ }
1422
+
1423
+ /**
1424
+ * Gets the text content of a named slot.
1425
+ * @returns {String}
1426
+ * @private
1427
+ */
1428
+ getSlotText(elem, name) {
1429
+ const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
1430
+ const nodes = slot?.assignedNodes({ flatten: true }) || [];
1431
+ const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
1432
+
1433
+ return text || null;
1434
+ }
1435
+ }
1436
+
1437
+ // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1438
+ // See LICENSE in the project root for license information.
1439
+
1440
+
1441
+ /**
1442
+ * Displays help text or error messages within form elements - Internal Use Only.
1443
+ */
1444
+ class AuroHelpText extends LitElement {
1445
+
1446
+ constructor() {
1447
+ super();
1448
+
1449
+ this.error = false;
1450
+ this.appearance = "default";
1451
+ this.onDark = false;
1452
+ this.hasTextContent = false;
1453
+
1454
+ AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
1455
+ }
1456
+
1457
+ static get styles() {
1458
+ return [
1459
+ colorCss,
1460
+ styleCss,
1461
+ tokensCss
1462
+ ];
1463
+ }
1464
+
1465
+ // function to define props used within the scope of this component
1466
+ static get properties() {
1467
+ return {
1468
+
1469
+ /**
1470
+ * Defines whether the component will be on lighter or darker backgrounds.
1471
+ * @property {'default', 'inverse'} - The appearance of the help text, either default (for light backgrounds) or inverse (for dark backgrounds).
1472
+ * @default 'default'
1473
+ */
1474
+ appearance: {
1475
+ type: String,
1476
+ reflect: true
1477
+ },
1478
+
1479
+ /**
1480
+ * @private
1481
+ */
1482
+ slotNodes: {
1483
+ type: Boolean,
1484
+ },
1485
+
1486
+ /**
1487
+ * @private
1488
+ */
1489
+ hasTextContent: {
1490
+ type: Boolean,
1491
+ },
1492
+
1493
+ /**
1494
+ * If declared, make font color red.
1495
+ */
1496
+ error: {
1497
+ type: Boolean,
1498
+ reflect: true,
1499
+ },
1500
+
1501
+ /**
1502
+ * DEPRECATED - use `appearance` instead.
1503
+ */
1504
+ onDark: {
1505
+ type: Boolean,
1506
+ reflect: true
1507
+ }
1508
+ };
1509
+ }
1510
+
1511
+ /**
1512
+ * This will register this element with the browser.
1513
+ * @param {string} [name="auro-helptext"] - The name of element that you want to register to.
1514
+ *
1515
+ * @example
1516
+ * AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
1517
+ *
1518
+ */
1519
+ static register(name = "auro-helptext") {
1520
+ AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
1521
+ }
1522
+
1523
+ updated() {
1524
+ this.handleSlotChange();
1525
+ }
1526
+
1527
+ handleSlotChange(event) {
1528
+ if (event) {
1529
+ this.slotNodes = event.target.assignedNodes();
1530
+ }
1531
+
1532
+ this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
1533
+ }
1534
+
1535
+ /**
1536
+ * Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
1537
+ *
1538
+ * @param {NodeList|Array} nodes - The list of nodes to check for content.
1539
+ * @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
1540
+ * @private
1541
+ */
1542
+ checkSlotsForContent(nodes) {
1543
+ if (!nodes) {
1544
+ return false;
1545
+ }
1546
+
1547
+ return nodes.some((node) => {
1548
+ if (node.textContent.trim()) {
1549
+ return true;
1550
+ }
1551
+
1552
+ if (!node.querySelector) {
1553
+ return false;
1554
+ }
1555
+
1556
+ const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
1557
+ if (!nestedSlot) {
1558
+ return false;
1559
+ }
1560
+
1561
+ const nestedSlotNodes = nestedSlot.assignedNodes();
1562
+ return this.checkSlotsForContent(nestedSlotNodes);
1563
+ });
1564
+ }
1565
+
1566
+ // function that renders the HTML and CSS into the scope of the component
1567
+ render() {
1568
+ return html`
1569
+ <div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
1570
+ <slot @slotchange=${this.handleSlotChange}></slot>
1571
+ </div>
1572
+ `;
1573
+ }
1574
+ }
1575
+
1576
+ var formkitVersion = '202604071818';
1577
+
1578
+ // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1579
+ // See LICENSE in the project root for license information.
1580
+ // ---------------------------------------------------------------------
1581
+
1582
+
1583
+ /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, -1] }] */
1584
+ /* eslint-disable max-lines, lit/binding-positions, lit/no-invalid-html, no-underscore-dangle */
1585
+
1586
+ /**
1587
+ * The `auro-radio-group` element is used to group a set `auro-radio` elements.
1588
+ * @customElement auro-radio-group
1589
+ *
1590
+ * @csspart radio-group - Apply css to the fieldset element in the shadow DOM
1591
+ * @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
1592
+ * @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
1593
+ * @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
1594
+ * @event auroFormElement-validated - Notifies that the element has been validated.
1595
+ * @event input - Notifies every time the value prop of the element is changed.
1596
+ */
1597
+
1598
+ class AuroRadioGroup extends LitElement {
1599
+ constructor() {
1600
+ super();
1601
+
1602
+ this._initializeDefaults();
1603
+ }
1604
+
1605
+ _initializeDefaults() {
1606
+ this.appearance = "default";
1607
+ this.disabled = false;
1608
+ this.horizontal = false;
1609
+ this.required = false;
1610
+ this.validity = undefined;
1611
+ this.value = undefined;
1612
+ this.optionSelected = undefined;
1613
+ this.onDark = false;
1614
+ this.touched = false;
1615
+ this.hasLegend = false;
1616
+
1617
+ /**
1618
+ * @private
1619
+ */
1620
+ this.validation = new AuroFormValidation();
1621
+
1622
+ /**
1623
+ * @private
1624
+ */
1625
+ this.index = 0;
1626
+
1627
+ /**
1628
+ * @private
1629
+ */
1630
+ this.max = 3;
1631
+
1632
+ /**
1633
+ * @private
1634
+ */
1635
+ this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1636
+
1637
+ /**
1638
+ * Generate unique names for dependency components.
1639
+ */
1640
+ const versioning = new AuroDependencyVersioning();
1641
+
1642
+ /**
1643
+ * @private
1644
+ */
1645
+ this.helpTextTag = versioning.generateTag('auro-formkit-radio-helptext', formkitVersion, AuroHelpText);
1646
+ }
1647
+
1648
+ static get styles() {
1649
+ return [
1650
+ styleCss$1,
1651
+ colorCss$1,
1652
+ tokenCss
1653
+ ];
1654
+ }
1655
+
1656
+ static get properties() {
1657
+ return {
1658
+
1659
+ /**
1660
+ * Defines whether the component will be on lighter or darker backgrounds.
1661
+ * @type {'default' | 'inverse'}
1662
+ * @default 'default'
1663
+ */
1664
+ appearance: {
1665
+ type: String,
1666
+ reflect: true
1667
+ },
1668
+
1669
+ /**
1670
+ * If true, all radio buttons will be disabled.
1671
+ */
1672
+ disabled: {
1673
+ type: Boolean,
1674
+ reflect: true
1675
+ },
1676
+
1677
+ /**
1678
+ * If true, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
1679
+ */
1680
+ error: {
1681
+ type: String,
1682
+ reflect: true
1683
+ },
1684
+
1685
+ /**
1686
+ * Indicates whether the legend slot is set or not.
1687
+ * @private
1688
+ */
1689
+ hasLegend: {
1690
+ type: Boolean,
1691
+ reflect: false,
1692
+ attribute: false
1693
+ },
1694
+
1695
+ /**
1696
+ * If true, displays radio buttons horizontally.
1697
+ */
1698
+ horizontal: { type: Boolean },
1699
+
1700
+ /**
1701
+ * If true, disables auto-validation on blur.
1702
+ */
1703
+ noValidate: {
1704
+ type: Boolean,
1705
+ reflect: true
1706
+ },
1707
+
1708
+ /**
1709
+ * DEPRECATED - use `appearance="inverse"` instead.
1710
+ */
1711
+ onDark: {
1712
+ type: Boolean,
1713
+ reflect: true
1714
+ },
1715
+
1716
+ /**
1717
+ * Specifies the current selected radio button.
1718
+ */
1719
+ optionSelected: {
1720
+ type: Object
1721
+ },
1722
+
1723
+ /**
1724
+ * Populates the `required` attribute on the element. Used for client-side validation.
1725
+ */
1726
+ required: {
1727
+ type: Boolean,
1728
+ reflect: true
1729
+ },
1730
+
1731
+ /**
1732
+ * Sets a custom help text message to display for all validityStates.
1733
+ */
1734
+ setCustomValidity: {
1735
+ type: String
1736
+ },
1737
+
1738
+ /**
1739
+ * Custom help text message to display when validity = `customError`.
1740
+ */
1741
+ setCustomValidityCustomError: {
1742
+ type: String
1743
+ },
1744
+
1745
+ /**
1746
+ * Custom help text message to display when validity = `valueMissing`.
1747
+ */
1748
+ setCustomValidityValueMissing: {
1749
+ type: String
1750
+ },
1751
+
1752
+ /**
1753
+ * Indicates whether the radio group is in a dirty state (has been interacted with).
1754
+ * @private
1755
+ */
1756
+ touched: {
1757
+ type: Boolean,
1758
+ reflect: true,
1759
+ attribute: false
1760
+ },
1761
+
1762
+ /**
1763
+ * Specifies the `validityState` this element is in.
1764
+ */
1765
+ validity: {
1766
+ type: String,
1767
+ reflect: true
1768
+ },
1769
+
1770
+ /**
1771
+ * Specifies the current value of the selected radio button.
1772
+ */
1773
+ value: {
1774
+ type: String
1775
+ }
1776
+ };
1777
+ }
1778
+
1779
+ /**
1780
+ * This will register this element with the browser.
1781
+ * @param {string} [name="auro-radio-group"] - The name of the element that you want to register.
1782
+ *
1783
+ * @example
1784
+ * AuroRadioGroup.register("custom-radio-group") // This will register this element to <custom-radio-group/>
1785
+ *
1786
+ */
1787
+ static register(name = "auro-radio-group") {
1788
+ AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadioGroup);
1789
+ }
1790
+
1791
+ connectedCallback() {
1792
+ super.connectedCallback();
1793
+ this.handleItems();
1794
+ this.addEventListener('toggleSelected', this.handleToggleSelected);
1795
+ this.addEventListener('keydown', this.handleKeyDown);
1796
+ this.addEventListener('resetRadio', this.resetRadio);
1797
+ this.addEventListener('auroRadio-blur', this.handleRadioBlur);
1798
+ this.addEventListener('auroRadio-selected', this.handleSelection);
1799
+ }
1800
+
1801
+ firstUpdated() {
1802
+ // Add the tag name as an attribute if it is different than the component name
1803
+ this.runtimeUtils.handleComponentTagRename(this, 'auro-radio-group');
1804
+ }
1805
+
1806
+ /**
1807
+ * Method for handling of selection of a radio element.
1808
+ * @private
1809
+ * @param {Event} event - The trigger event tied to this function.
1810
+ * @returns {void}
1811
+ */
1812
+ handleSelection(event) {
1813
+ // specifically check null and undefined in case if the value is false or 0
1814
+ if (event.target.value !== null && event.target.value !== undefined) {
1815
+ this.value = event.target.value;
1816
+ } else {
1817
+ this.value = '';
1818
+ }
1819
+
1820
+ this.optionSelected = event.target;
1821
+
1822
+ this.validation.validate(this, this.optionSelected !== undefined);
1823
+ }
1824
+
1825
+ /**
1826
+ * Method handles radio element blur.
1827
+ * @private
1828
+ * @returns {void}
1829
+ */
1830
+ handleRadioBlur() {
1831
+ this.touched = true;
1832
+ this.validation.validate(this);
1833
+ }
1834
+
1835
+ /**
1836
+ * LitElement lifecycle method. Called after the DOM has been updated.
1837
+ * @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
1838
+ * @returns {void}
1839
+ */
1840
+ updated(changedProperties) {
1841
+ if (changedProperties.has('disabled')) {
1842
+ // only change the children if we are making everything disabled, or if we are making everything enabled and there are no individually-disabled radio buttons
1843
+ if (this.disabled || this.items.every((el) => el.disabled)) {
1844
+ this.items.forEach((el) => {
1845
+ el.disabled = this.disabled;
1846
+ });
1847
+ }
1848
+ }
1849
+
1850
+ if (changedProperties.has('value')) {
1851
+ this.dispatchEvent(new CustomEvent('input', {
1852
+ bubbles: true,
1853
+ cancelable: true,
1854
+ composed: true,
1855
+ }));
1856
+ }
1857
+
1858
+ if (changedProperties.has('required')) {
1859
+ this.items.forEach((el) => {
1860
+ el.required = this.required;
1861
+ });
1862
+ }
1863
+
1864
+ if (changedProperties.has('onDark')) {
1865
+ this.items.forEach((el) => {
1866
+ el.onDark = this.onDark;
1867
+ });
1868
+ }
1869
+
1870
+ if (changedProperties.has('appearance')) {
1871
+ this.items.forEach((el) => {
1872
+ el.appearance = this.appearance;
1873
+ });
1874
+ }
1875
+
1876
+ if (changedProperties.has('error')) {
1877
+ this.validate(true);
1878
+ }
1879
+
1880
+ if (changedProperties.has('validity')) {
1881
+ if (this.validity && this.validity !== 'valid') {
1882
+ this.setAttribute('aria-invalid', 'true');
1883
+
1884
+ this.items.forEach((el) => {
1885
+ el.setAttribute('error', true);
1886
+ });
1887
+ } else {
1888
+ this.removeAttribute('aria-invalid');
1889
+
1890
+ this.items.forEach((el) => {
1891
+ el.removeAttribute('error');
1892
+ });
1893
+ }
1894
+ }
1895
+ }
1896
+
1897
+ /**
1898
+ * Resets component to initial state.
1899
+ * @returns {void}
1900
+ */
1901
+ reset() {
1902
+ // Sets first radio button to receive focus during keyboard navigation
1903
+ this.index = 0;
1904
+
1905
+ const buttons = this.querySelectorAll('auro-radio, [auro-radio]');
1906
+
1907
+ buttons.forEach((button) => {
1908
+ button.reset();
1909
+ });
1910
+
1911
+ this.validation.reset(this);
1912
+ }
1913
+
1914
+ /**
1915
+ * Validates value.
1916
+ * @param {boolean} [force=false] - Whether to force validation.
1917
+ */
1918
+ validate(force = false) {
1919
+ this.validation.validate(this, force);
1920
+ }
1921
+
1922
+ /**
1923
+ * Method handles the reset event from a radio element.
1924
+ * @private
1925
+ * @returns {void}
1926
+ */
1927
+ resetRadio() {
1928
+ if (this.items.length === 0) {
1929
+ this.handleItems();
1930
+ }
1931
+ }
1932
+
1933
+ /**
1934
+ * Method for handling the attributes of each radio input.
1935
+ * @private
1936
+ * @returns {void}
1937
+ */
1938
+ handleItems() {
1939
+ this.items = [...this.querySelectorAll(':scope auro-radio, :scope [auro-radio]')];
1940
+ this.initializeIndex();
1941
+
1942
+ if (this.disabled) {
1943
+ this.items.forEach((el) => {
1944
+ el.disabled = this.disabled;
1945
+ });
1946
+ }
1947
+
1948
+ this.items.forEach((el) => {
1949
+ el.required = this.required;
1950
+ el.error = Boolean(this.error);
1951
+ });
1952
+ }
1953
+
1954
+ /**
1955
+ * Method for handling slot content changes.
1956
+ * @private
1957
+ * @returns {void}
1958
+ */
1959
+ handleSlotChange() {
1960
+ this.handleItems();
1961
+ }
1962
+
1963
+ /**
1964
+ * Method for handling legend slot changes.
1965
+ * @private
1966
+ * @returns {void}
1967
+ */
1968
+ handleLegendSlotChange() {
1969
+ const slot = this.shadowRoot.querySelector('slot[name="legend"]');
1970
+ if (slot) {
1971
+ this.hasLegend = slot.assignedNodes().length > 0;
1972
+ }
1973
+ }
1974
+
1975
+ /**
1976
+ * Method for initializing the tab index of the checked radio input.
1977
+ * @private
1978
+ * @returns {void}
1979
+ */
1980
+ initializeIndex() {
1981
+ if (!this.disabled && this.items && this.items.length > 0) {
1982
+ const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
1983
+ const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1984
+
1985
+ this.index = index >= 0 ? index : nextEnabledIndex;
1986
+
1987
+ if (this.items[this.index]) {
1988
+ this.items[this.index].setAttribute('tabindex', 0);
1989
+ } }
1990
+ }
1991
+
1992
+ /**
1993
+ * Method for handling a newly selected radio input.
1994
+ * @private
1995
+ * @param {Event} event - The trigger event tied to this function.
1996
+ * @returns {void}
1997
+ */
1998
+ handleToggleSelected(event) {
1999
+ this.index = this.items.indexOf(event.target);
2000
+
2001
+ this.items.forEach((item) => {
2002
+ item.checked = item === event.target;
2003
+ });
2004
+
2005
+ this.value = event.target.value;
2006
+ this.optionSelected = event.target;
2007
+
2008
+ this.validation.validate(this);
2009
+ }
2010
+
2011
+ /**
2012
+ * Method for selecting a radio input.
2013
+ * @private
2014
+ * @param {Number} index - The value of the element's index attribute.
2015
+ * @returns {void}
2016
+ */
2017
+ selectItem(index) {
2018
+ const sdItem = this.items[index];
2019
+
2020
+ sdItem.click();
2021
+ sdItem.focus();
2022
+ this.index = index;
2023
+ }
2024
+
2025
+ /**
2026
+ * Method for selecting the next radio input.
2027
+ * @private
2028
+ * @param {Number} index - The value of the element's index attribute.
2029
+ * @param {String} moveDirection - Arrow key pressed by user.
2030
+ * @returns {void}
2031
+ */
2032
+ selectNextItem(index, moveDirection) {
2033
+ let currIndex = index;
2034
+
2035
+ for (currIndex; currIndex < this.items.length; moveDirection === "Down" ? currIndex += 1 : currIndex -= 1) {
2036
+ currIndex = currIndex === -1 ? this.items.length - 1 : currIndex;
2037
+ const sdItem = this.items[currIndex];
2038
+ if (sdItem) {
2039
+ if (this.disabled || this.items.every((item) => item.disabled === true)) {
2040
+ sdItem.focus();
2041
+ break;
2042
+ }
2043
+ if (!sdItem.disabled) {
2044
+ sdItem.click();
2045
+ sdItem.focus();
2046
+ this.index = currIndex;
2047
+ break;
2048
+ }
2049
+ }
2050
+ }
2051
+ }
2052
+
2053
+ /**
2054
+ * Method for handling a keydown event.
2055
+ * @private
2056
+ * @param {Event} event - The trigger event tied to this function.
2057
+ * @returns {void}
2058
+ */
2059
+ handleKeyDown(event) {
2060
+ switch (event.key) {
2061
+ case " ":
2062
+ event.preventDefault();
2063
+ this.selectItem(this.index);
2064
+ break;
2065
+
2066
+ case "Down":
2067
+ case "ArrowDown":
2068
+ case "Right":
2069
+ case "ArrowRight":
2070
+ event.preventDefault();
2071
+ this.selectNextItem(this.index === this.items.length - 1 ? 0 : this.index + 1, "Down");
2072
+ break;
2073
+
2074
+ case "Up":
2075
+ case "ArrowUp":
2076
+ case "Left":
2077
+ case "ArrowLeft":
2078
+ event.preventDefault();
2079
+ this.selectNextItem(this.index === 0 ? this.items.length - 1 : this.index - 1, "Up");
2080
+ break;
2081
+ }
2082
+ }
2083
+
2084
+ // function that renders the HTML and CSS into the scope of the component
2085
+ render() {
2086
+ const groupClasses = {
2087
+ 'displayFlex': this.horizontal && this.items.length <= this.max
2088
+ };
2089
+ const legendClasses = {
2090
+ 'hidden': !this.hasLegend && this.required
2091
+ };
2092
+
2093
+ return html$1`
2094
+ <fieldset class="${classMap(groupClasses)}" part="radio-group" role="radiogroup">
2095
+ <legend class="${classMap(legendClasses)}">
2096
+ <slot name="legend" @slotchange=${this.handleLegendSlotChange}></slot>
2097
+ ${this.required ? undefined : html$1`<slot name="optionalLabel"> (optional)</slot>`}
2098
+ </legend>
2099
+ <slot @slotchange=${this.handleSlotChange}></slot>
2100
+ </fieldset>
2101
+
2102
+ ${!this.validity || this.validity === undefined || this.validity === 'valid'
2103
+ ? html$1`
2104
+ <${this.helpTextTag} appearance="${this.onDark ? 'inverse' : this.appearance}" part="helpText">
2105
+ <slot name="helpText"></slot>
2106
+ </${this.helpTextTag}>`
2107
+ : html$1`
2108
+ <${this.helpTextTag} appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" error aria-live="assertive" part="helpText">
2109
+ ${this.errorMessage}
2110
+ </${this.helpTextTag}>`
2111
+ }
2112
+ `;
2113
+ }
2114
+ }
2115
+
2116
+ AuroRadio.register();
2117
+ AuroRadioGroup.register();