@aurodesignsystem-dev/auro-formkit 0.0.0-pr1001.0

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