@aurodesignsystem-dev/auro-formkit 0.0.0-pr1422.0 → 0.0.0-pr1422.2

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