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