@baloise/ds-core 20.0.0-next.4 → 20.0.0-next.6

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 (988) hide show
  1. package/LICENSE +9 -0
  2. package/components/all.d.ts +56 -0
  3. package/components/all.js +84 -0
  4. package/components/ds-accordion.js +1 -1
  5. package/components/ds-alert-container.js +1 -1
  6. package/components/ds-app.js +1 -1
  7. package/components/ds-badge.js +1 -1
  8. package/components/ds-button-group.js +1 -1
  9. package/components/ds-button.js +1 -1
  10. package/components/ds-card-actions.js +1 -1
  11. package/components/ds-card-content.js +1 -1
  12. package/components/ds-card-header.js +1 -1
  13. package/components/ds-card-subtitle.js +1 -1
  14. package/components/ds-card-title.js +1 -1
  15. package/components/ds-card.js +1 -1
  16. package/components/ds-carousel-item.d.ts +11 -0
  17. package/components/ds-carousel-item.js +4 -0
  18. package/components/ds-carousel.d.ts +11 -0
  19. package/components/ds-carousel.js +4 -0
  20. package/components/ds-checkbox-group.js +1 -1
  21. package/components/ds-checkbox.js +1 -1
  22. package/components/ds-close.js +1 -1
  23. package/components/ds-content.js +1 -1
  24. package/components/ds-data-item.d.ts +11 -0
  25. package/components/ds-data-item.js +4 -0
  26. package/components/ds-data-label.d.ts +11 -0
  27. package/components/ds-data-label.js +4 -0
  28. package/components/ds-data-value.d.ts +11 -0
  29. package/components/ds-data-value.js +4 -0
  30. package/components/ds-data.d.ts +11 -0
  31. package/components/ds-data.js +4 -0
  32. package/components/ds-date.d.ts +11 -0
  33. package/components/ds-date.js +4 -0
  34. package/components/ds-divider.js +1 -1
  35. package/components/ds-drawer.d.ts +11 -0
  36. package/components/ds-drawer.js +4 -0
  37. package/components/ds-file-upload.d.ts +11 -0
  38. package/components/ds-file-upload.js +4 -0
  39. package/components/ds-footer.d.ts +11 -0
  40. package/components/ds-footer.js +4 -0
  41. package/components/ds-heading.js +1 -1
  42. package/components/ds-hint-text.d.ts +11 -0
  43. package/components/ds-hint-text.js +4 -0
  44. package/components/ds-hint-title.d.ts +11 -0
  45. package/components/ds-hint-title.js +4 -0
  46. package/components/ds-hint.d.ts +11 -0
  47. package/components/ds-hint.js +4 -0
  48. package/components/ds-icon.js +1 -1
  49. package/components/ds-input.js +1 -1
  50. package/components/ds-item.js +1 -1
  51. package/components/ds-label.js +1 -1
  52. package/components/ds-list.js +1 -1
  53. package/components/ds-logo.js +1 -1
  54. package/components/ds-modal-body.d.ts +11 -0
  55. package/components/ds-modal-body.js +4 -0
  56. package/components/ds-modal-header.d.ts +11 -0
  57. package/components/ds-modal-header.js +4 -0
  58. package/components/ds-modal.d.ts +11 -0
  59. package/components/ds-modal.js +4 -0
  60. package/components/ds-navbar.d.ts +11 -0
  61. package/components/ds-navbar.js +4 -0
  62. package/components/ds-notification.js +1 -1
  63. package/components/ds-number-input.js +1 -1
  64. package/components/ds-pagination.js +1 -1
  65. package/components/ds-popup.d.ts +11 -0
  66. package/components/ds-popup.js +4 -0
  67. package/components/ds-progress-bar.js +1 -1
  68. package/components/ds-radio-group.js +1 -1
  69. package/components/ds-radio.js +1 -1
  70. package/components/ds-segment-item.js +1 -1
  71. package/components/ds-segment.js +1 -1
  72. package/components/ds-select-optgroup.d.ts +11 -0
  73. package/components/ds-select-optgroup.js +4 -0
  74. package/components/ds-select-option.d.ts +11 -0
  75. package/components/ds-select-option.js +4 -0
  76. package/components/ds-select.d.ts +11 -0
  77. package/components/ds-select.js +4 -0
  78. package/components/ds-shape.js +1 -1
  79. package/components/ds-snackbar.js +1 -1
  80. package/components/ds-spinner.js +1 -1
  81. package/components/ds-stack.js +1 -1
  82. package/components/ds-step-panel.d.ts +11 -0
  83. package/components/ds-step-panel.js +4 -0
  84. package/components/ds-step.d.ts +11 -0
  85. package/components/ds-step.js +4 -0
  86. package/components/ds-steps.d.ts +11 -0
  87. package/components/ds-steps.js +4 -0
  88. package/components/ds-tab-panel.d.ts +11 -0
  89. package/components/ds-tab-panel.js +4 -0
  90. package/components/ds-tab.d.ts +11 -0
  91. package/components/ds-tab.js +4 -0
  92. package/components/ds-tabs.d.ts +11 -0
  93. package/components/ds-tabs.js +4 -0
  94. package/components/ds-tag-group.js +1 -1
  95. package/components/ds-tag.js +1 -1
  96. package/components/ds-text.js +1 -1
  97. package/components/ds-textarea.js +1 -1
  98. package/components/ds-toast.js +1 -1
  99. package/components/ds-toggle.js +1 -1
  100. package/components/ds-tooltip.d.ts +11 -0
  101. package/components/ds-tooltip.js +4 -0
  102. package/components/index.js +1 -1
  103. package/components/p-3Mi9vpmB.js +4 -0
  104. package/components/p-B-en4B17.js +4 -0
  105. package/components/p-B1gnrQ9b.js +4 -0
  106. package/components/p-BU0dY8pq.js +4 -0
  107. package/components/p-BfXZJ1Fe.js +4 -0
  108. package/components/p-BgzU1loG.js +4 -0
  109. package/components/p-BhbWmCTu.js +4 -0
  110. package/components/p-BqY0KzJC.js +4 -0
  111. package/components/p-BrIcCcce.js +4 -0
  112. package/components/p-BrJFPhMA.js +4 -0
  113. package/components/p-Btdh3fq7.js +4 -0
  114. package/components/{p-Urcs7-vS.js → p-BwfAXfmz.js} +1 -1
  115. package/components/p-ByX1_7SF.js +4 -0
  116. package/components/p-C1jqbZdf.js +4 -0
  117. package/{dist/design-system/p-15bc012833.entry.js → components/p-CA7G72wZ.js} +1 -1
  118. package/components/p-CQHwI4iD.js +4 -0
  119. package/components/p-CYWn3X22.js +4 -0
  120. package/components/p-CjIxf5zy.js +4 -0
  121. package/components/p-Ctnm_MBD.js +4 -0
  122. package/components/p-CvaNxQtw.js +4 -0
  123. package/components/p-D9ILiUgm.js +4 -0
  124. package/components/{p-BATOumsf.js → p-D9YYP2SG.js} +1 -1
  125. package/components/p-DAYd9ty0.js +4 -0
  126. package/components/p-DIK6Zkg6.js +4 -0
  127. package/{dist/design-system/p-BkESlUMc.js → components/p-DQBzmbR6.js} +1 -1
  128. package/components/{p-z1jJgtep.js → p-DU7t9H9h.js} +1 -1
  129. package/components/p-DYTOWDAA.js +4 -0
  130. package/components/p-DYlqkAWn.js +4 -0
  131. package/components/p-DbM7ALm9.js +14 -0
  132. package/{dist/design-system/p-D2tr7015.js → components/p-DbY6Pfeh.js} +1 -1
  133. package/components/{p-DZqqelPH.js → p-DcSNuA8W.js} +1 -1
  134. package/components/p-DenZRIeA.js +4 -0
  135. package/components/p-DokkRjWC.js +4 -0
  136. package/{dist/design-system/p-BwrOVItb.js → components/p-Dr4MUfss.js} +1 -1
  137. package/components/p-DsvYY32v.js +4 -0
  138. package/components/p-Du7QOHtz.js +5 -0
  139. package/components/{p-E8U6M5ii.js → p-FBQaJyH0.js} +1 -1
  140. package/components/{p-Dr4dquer.js → p-J0mxIuTt.js} +1 -1
  141. package/{dist/design-system/p-DJxr2Dcd.js → components/p-UCeQ1JCs.js} +1 -1
  142. package/components/p-Uy_dVz21.js +4 -0
  143. package/components/p-WO0X5Vmy.js +4 -0
  144. package/components/p-bGV2P6rT.js +4 -0
  145. package/components/{p-Bt20CEww.js → p-n3_2KEz0.js} +1 -1
  146. package/dist/cjs/array-CioNm_V1.js +1985 -0
  147. package/dist/cjs/{breakpoints.decorator-qaoHOU6Q.js → breakpoints.decorator-C-Qm21UK.js} +1 -1
  148. package/dist/cjs/{breakpoints.subject-DhAN_ZAn.js → breakpoints.subject-XNcGwhzh.js} +3 -3
  149. package/dist/cjs/{button.interfaces-BueDWsuH.js → button.interfaces-CqlUGR-N.js} +1 -1
  150. package/dist/cjs/carousel.interfaces-BFQpUNrw.js +12 -0
  151. package/dist/cjs/{config.decorator-Qmrq4ZYj.js → config.decorator-ThGLtT-3.js} +1 -1
  152. package/dist/cjs/{config.utils-Cv4cx_Xa.js → config.utils-MhZvq4Qm.js} +1 -1
  153. package/dist/cjs/create-validator-decorator-BIgFqrMJ.js +212 -0
  154. package/dist/cjs/design-system.cjs.js +3 -3
  155. package/dist/cjs/{device-CptgCtVc.js → device-BnjBOLnP.js} +1 -1
  156. package/dist/cjs/ds-accordion.cjs.entry.js +30 -34
  157. package/dist/cjs/ds-alert-container.cjs.entry.js +12 -15
  158. package/dist/cjs/ds-app.cjs.entry.js +16 -6
  159. package/dist/cjs/ds-badge.cjs.entry.js +32 -25
  160. package/dist/cjs/ds-button-group.cjs.entry.js +14 -17
  161. package/dist/cjs/ds-button_2.cjs.entry.js +58 -73
  162. package/dist/cjs/ds-card-actions.cjs.entry.js +6 -8
  163. package/dist/cjs/ds-card-content.cjs.entry.js +2 -2
  164. package/dist/cjs/ds-card-header.cjs.entry.js +8 -5
  165. package/dist/cjs/ds-card-subtitle.cjs.entry.js +13 -13
  166. package/dist/cjs/ds-card-title.cjs.entry.js +11 -7
  167. package/dist/cjs/ds-card.cjs.entry.js +30 -42
  168. package/dist/cjs/ds-carousel-item.cjs.entry.js +128 -0
  169. package/dist/cjs/ds-carousel.cjs.entry.js +473 -0
  170. package/dist/cjs/ds-checkbox-group.cjs.entry.js +41 -2012
  171. package/dist/cjs/ds-checkbox.cjs.entry.js +23 -19
  172. package/dist/cjs/ds-content_2.cjs.entry.js +330 -0
  173. package/dist/cjs/ds-data-item.cjs.entry.js +146 -0
  174. package/dist/cjs/ds-data-label.cjs.entry.js +41 -0
  175. package/dist/cjs/ds-data-value.cjs.entry.js +31 -0
  176. package/dist/cjs/ds-data.cjs.entry.js +43 -0
  177. package/dist/cjs/ds-date.cjs.entry.js +5334 -0
  178. package/dist/cjs/{ds-logo.cjs.entry.js → ds-divider_2.cjs.entry.js} +130 -25
  179. package/dist/cjs/ds-drawer_2.cjs.entry.js +602 -0
  180. package/dist/cjs/ds-file-upload.cjs.entry.js +515 -0
  181. package/dist/cjs/ds-footer.cjs.entry.js +159 -0
  182. package/dist/cjs/ds-heading.cjs.entry.js +21 -19
  183. package/dist/cjs/ds-hint-text.cjs.entry.js +28 -0
  184. package/dist/cjs/ds-hint-title.cjs.entry.js +31 -0
  185. package/dist/cjs/ds-hint.cjs.entry.js +243 -0
  186. package/dist/cjs/ds-icon_2.cjs.entry.js +78 -70
  187. package/dist/cjs/ds-input.cjs.entry.js +45 -43
  188. package/dist/cjs/ds-item.cjs.entry.js +29 -34
  189. package/dist/cjs/ds-label.cjs.entry.js +22 -30
  190. package/dist/cjs/ds-list.cjs.entry.js +6 -12
  191. package/dist/cjs/ds-modal-body.cjs.entry.js +34 -0
  192. package/dist/cjs/ds-modal-header.cjs.entry.js +31 -0
  193. package/dist/cjs/ds-modal.cjs.entry.js +201 -0
  194. package/dist/cjs/ds-navbar.cjs.entry.js +359 -0
  195. package/dist/cjs/ds-notification.cjs.entry.js +19 -27
  196. package/dist/cjs/ds-number-input.cjs.entry.js +128 -45
  197. package/dist/cjs/ds-pagination.cjs.entry.js +41 -37
  198. package/dist/cjs/ds-progress-bar.cjs.entry.js +25 -29
  199. package/dist/cjs/ds-radio-group.cjs.entry.js +30 -29
  200. package/dist/cjs/ds-radio.cjs.entry.js +26 -33
  201. package/dist/cjs/ds-segment-item.cjs.entry.js +9 -9
  202. package/dist/cjs/ds-segment.cjs.entry.js +29 -117
  203. package/dist/cjs/ds-select-optgroup.cjs.entry.js +49 -0
  204. package/dist/cjs/ds-select-option.cjs.entry.js +57 -0
  205. package/dist/cjs/ds-select.cjs.entry.js +2772 -0
  206. package/dist/cjs/ds-shape.cjs.entry.js +10 -16
  207. package/dist/cjs/ds-snackbar.cjs.entry.js +40 -57
  208. package/dist/cjs/ds-step-panel.cjs.entry.js +55 -0
  209. package/dist/cjs/ds-step.cjs.entry.js +170 -0
  210. package/dist/cjs/ds-steps.cjs.entry.js +227 -0
  211. package/dist/cjs/ds-tab-panel.cjs.entry.js +55 -0
  212. package/dist/cjs/ds-tab.cjs.entry.js +120 -0
  213. package/dist/cjs/ds-tabs.cjs.entry.js +364 -0
  214. package/dist/cjs/ds-tag-group.cjs.entry.js +3 -3
  215. package/dist/cjs/ds-tag.cjs.entry.js +19 -26
  216. package/dist/cjs/ds-text.cjs.entry.js +28 -32
  217. package/dist/cjs/ds-textarea.cjs.entry.js +32 -31
  218. package/dist/cjs/ds-toast.cjs.entry.js +40 -54
  219. package/dist/cjs/ds-toggle.cjs.entry.js +22 -21
  220. package/dist/cjs/ds-tooltip.cjs.entry.js +182 -0
  221. package/dist/cjs/{field.util-RjuvTLNZ.js → field.util-L-DkeMVk.js} +1 -1
  222. package/dist/cjs/floating-ui.dom-Cu3dZdFD.js +1628 -0
  223. package/dist/cjs/focus-D3VVgpM7.js +1958 -0
  224. package/dist/cjs/footer.i18n-CpGxizgm.js +162 -0
  225. package/dist/cjs/{form-control-Bno2tBGf.js → form-control-CtMcJUuC.js} +2 -2
  226. package/dist/cjs/has-value-DK0oRqXI.js +12 -0
  227. package/dist/cjs/{index-CdD-TT_n.js → index-sC3JnTlJ.js} +497 -175
  228. package/dist/cjs/index.cjs.js +26 -8283
  229. package/dist/cjs/keyboard-C7y0jXYb.js +23 -0
  230. package/dist/cjs/{listener-DgVWqfa1.js → listener-BwB_xent.js} +1 -1
  231. package/dist/cjs/loader.cjs.js +2 -2
  232. package/dist/cjs/luxon-q23LOWrr.js +8137 -0
  233. package/dist/cjs/one-of-BZGRIMtQ.js +30 -0
  234. package/dist/cjs/popup.interfaces-B-mwd9rh.js +23 -0
  235. package/dist/cjs/required-COz3Unzu.js +38 -0
  236. package/dist/cjs/resize.decorator-DWM_fQgv.js +98 -0
  237. package/dist/cjs/scroll-CUuEh4xd.js +89 -0
  238. package/dist/cjs/svg-D9RbiR8R.js +2443 -0
  239. package/dist/cjs/{tslib.es6-BTi-SLnA.js → tslib.es6-CxyosZMg.js} +1 -1
  240. package/dist/cjs/type-hmc4CJcO.js +33 -0
  241. package/dist/collection/collection-manifest.json +30 -2
  242. package/dist/collection/components/accordion/accordion.host.css +1 -1
  243. package/dist/collection/components/accordion/accordion.js +22 -29
  244. package/dist/collection/components/alert/alert-container.js +8 -14
  245. package/dist/collection/components/alert/alert.controller.js +1 -1
  246. package/dist/collection/components/alert/snackbar/snackbar.js +30 -53
  247. package/dist/collection/components/alert/toast/toast.js +32 -53
  248. package/dist/collection/components/app/app.js +11 -3
  249. package/dist/collection/components/badge/badge.interfaces.js +1 -1
  250. package/dist/collection/components/badge/badge.js +28 -25
  251. package/dist/collection/components/button/button-group/button-group.js +8 -14
  252. package/dist/collection/components/button/button.host.css +1 -1
  253. package/dist/collection/components/button/button.interfaces.js +1 -1
  254. package/dist/collection/components/button/button.js +44 -54
  255. package/dist/collection/components/card/card-actions/card-actions.js +3 -6
  256. package/dist/collection/components/card/card-header/card-header.js +4 -3
  257. package/dist/collection/components/card/card-subtitle/card-subtitle.js +8 -11
  258. package/dist/collection/components/card/card-title/card-title.js +6 -5
  259. package/dist/collection/components/card/card.host.css +1 -1
  260. package/dist/collection/components/card/card.js +25 -38
  261. package/dist/collection/components/carousel/carousel/carousel.host.css +1 -0
  262. package/dist/collection/components/carousel/carousel/carousel.i18n.js +65 -0
  263. package/dist/collection/components/carousel/carousel/carousel.js +631 -0
  264. package/dist/collection/components/carousel/carousel-item/carousel-item.host.css +1 -0
  265. package/dist/collection/components/carousel/carousel-item/carousel-item.js +313 -0
  266. package/dist/collection/components/carousel/carousel.interfaces.js +6 -0
  267. package/dist/collection/components/carousel/test/carousel.a11y.play.js +34 -0
  268. package/dist/collection/components/carousel/test/carousel.component.play.js +57 -0
  269. package/dist/collection/components/carousel/test/carousel.visual.play.js +24 -0
  270. package/dist/collection/components/checkbox/checkbox-group/checkbox-group.host.css +1 -1
  271. package/dist/collection/components/checkbox/checkbox-group/checkbox-group.js +25 -26
  272. package/dist/collection/components/checkbox/checkbox.js +18 -18
  273. package/dist/collection/components/close/close.js +10 -21
  274. package/dist/collection/components/content/content.js +38 -52
  275. package/dist/collection/components/data/data-item.host.css +1 -0
  276. package/dist/collection/components/data/data-item.i18n.js +35 -0
  277. package/dist/collection/components/data/data-item.js +244 -0
  278. package/dist/collection/components/data/data-label.host.css +1 -0
  279. package/dist/collection/components/data/data-label.js +72 -0
  280. package/dist/collection/components/data/data-value.host.css +1 -0
  281. package/dist/collection/components/data/data-value.js +38 -0
  282. package/dist/collection/components/data/data.host.css +1 -0
  283. package/dist/collection/components/data/data.js +75 -0
  284. package/dist/collection/components/data/test/data.a11y.play.js +31 -0
  285. package/dist/collection/components/data/test/data.component.play.js +104 -0
  286. package/dist/collection/components/data/test/data.visual.play.js +25 -0
  287. package/dist/collection/components/date/date.host.css +1 -0
  288. package/dist/collection/components/date/date.i18n.js +105 -0
  289. package/dist/collection/components/date/date.interfaces.js +4 -0
  290. package/dist/collection/components/date/date.js +1241 -0
  291. package/dist/collection/components/date/date.mask.js +189 -0
  292. package/dist/collection/components/date/date.picker.js +536 -0
  293. package/dist/collection/components/date/test/date.a11y.play.js +27 -0
  294. package/dist/collection/components/date/test/date.component.play.js +69 -0
  295. package/dist/collection/components/date/test/date.visual.play.js +43 -0
  296. package/dist/collection/components/divider/divider.host.css +1 -1
  297. package/dist/collection/components/divider/divider.js +11 -24
  298. package/dist/collection/components/drawer/drawer.host.css +1 -0
  299. package/dist/collection/{utils/property-checkers/constants.js → components/drawer/drawer.interfaces.js} +1 -1
  300. package/dist/collection/components/drawer/drawer.js +492 -0
  301. package/dist/collection/components/drawer/test/drawer.a11y.play.js +39 -0
  302. package/dist/collection/components/drawer/test/drawer.component.play.js +131 -0
  303. package/dist/collection/components/drawer/test/drawer.visual.play.js +31 -0
  304. package/dist/collection/components/file-upload/file-upload.host.css +1 -0
  305. package/dist/collection/components/file-upload/file-upload.i18n.js +55 -0
  306. package/dist/collection/components/file-upload/file-upload.interfaces.js +10 -0
  307. package/dist/collection/components/file-upload/file-upload.js +1030 -0
  308. package/dist/collection/components/file-upload/test/file-upload.a11y.play.js +52 -0
  309. package/dist/collection/components/file-upload/test/file-upload.component.play.js +124 -0
  310. package/dist/collection/components/file-upload/test/file-upload.visual.play.js +18 -0
  311. package/dist/collection/components/file-upload/utils/file-list.util.js +13 -0
  312. package/dist/collection/components/file-upload/utils/file-size.util.js +10 -0
  313. package/dist/collection/components/file-upload/utils/file-validation.util.js +48 -0
  314. package/dist/collection/components/footer/footer.host.css +1 -0
  315. package/dist/collection/components/footer/footer.i18n.js +155 -0
  316. package/dist/collection/components/footer/footer.interfaces.js +4 -0
  317. package/dist/collection/components/footer/footer.js +350 -0
  318. package/dist/collection/components/footer/test/footer.a11y.play.js +17 -0
  319. package/dist/collection/components/footer/test/footer.component.play.js +74 -0
  320. package/dist/collection/components/footer/test/footer.visual.play.js +16 -0
  321. package/dist/collection/components/form/test/form.visual.play.js +13 -1
  322. package/dist/collection/components/heading/heading.js +16 -17
  323. package/dist/collection/components/hint/hint-text/hint-text.js +28 -0
  324. package/dist/collection/components/hint/hint-title/hint-title.js +31 -0
  325. package/dist/collection/components/hint/hint.host.css +1 -0
  326. package/dist/collection/components/hint/hint.i18n.js +35 -0
  327. package/dist/collection/components/hint/hint.interfaces.js +1 -0
  328. package/dist/collection/components/hint/hint.js +410 -0
  329. package/dist/collection/components/hint/test/hint.a11y.play.js +41 -0
  330. package/dist/collection/components/hint/test/hint.component.play.js +110 -0
  331. package/dist/collection/components/hint/test/hint.visual.play.js +39 -0
  332. package/dist/collection/components/icon/icon.host.css +1 -1
  333. package/dist/collection/components/icon/icon.interfaces.js +1 -0
  334. package/dist/collection/components/icon/icon.js +73 -42
  335. package/dist/collection/components/icon/test/icon.component.play.js +23 -1
  336. package/dist/collection/components/input/clear-button.i18n.js +35 -0
  337. package/dist/collection/components/input/clear-button.util.js +11 -0
  338. package/dist/collection/components/input/input.host.css +1 -1
  339. package/dist/collection/components/input/input.js +36 -37
  340. package/dist/collection/components/input/test/input.component.play.js +1 -1
  341. package/dist/collection/components/input/trigger-button.i18n.js +45 -0
  342. package/dist/collection/components/label/label.js +16 -28
  343. package/dist/collection/components/list/item/item.host.css +1 -1
  344. package/dist/collection/components/list/item/item.interfaces.js +1 -1
  345. package/dist/collection/components/list/item/item.js +27 -34
  346. package/dist/collection/components/list/list.js +3 -10
  347. package/dist/collection/components/list/test/list.visual.play.js +30 -0
  348. package/dist/collection/components/logo/logo.js +11 -18
  349. package/dist/collection/components/modal/modal-body/modal-body.host.css +1 -0
  350. package/dist/collection/components/modal/modal-body/modal-body.js +41 -0
  351. package/dist/collection/components/modal/modal-header/modal-header.js +32 -0
  352. package/dist/collection/components/modal/modal.controller.js +31 -0
  353. package/dist/collection/components/modal/modal.host.css +1 -0
  354. package/dist/collection/components/modal/modal.interfaces.js +1 -0
  355. package/dist/collection/components/modal/modal.js +461 -0
  356. package/dist/collection/components/modal/test/modal.a11y.play.js +59 -0
  357. package/dist/collection/components/modal/test/modal.component.play.js +196 -0
  358. package/dist/collection/components/modal/test/modal.visual.play.js +36 -0
  359. package/dist/collection/components/navbar/navbar.host.css +1 -0
  360. package/dist/collection/components/navbar/navbar.i18n.js +65 -0
  361. package/dist/collection/components/navbar/navbar.interfaces.js +6 -0
  362. package/dist/collection/components/navbar/navbar.js +544 -0
  363. package/dist/collection/components/navbar/test/navbar.a11y.play.js +26 -0
  364. package/dist/collection/components/navbar/test/navbar.component.play.js +76 -0
  365. package/dist/collection/components/navbar/test/navbar.visual.play.js +14 -0
  366. package/dist/collection/components/notification/notification.js +14 -26
  367. package/dist/collection/components/number-input/number-input.host.css +1 -1
  368. package/dist/collection/components/number-input/number-input.js +23 -24
  369. package/dist/collection/components/pagination/pagination.host.css +1 -1
  370. package/dist/collection/components/pagination/pagination.js +29 -28
  371. package/dist/collection/components/popup/popup.host.css +1 -0
  372. package/dist/collection/components/popup/popup.interfaces.js +18 -0
  373. package/dist/collection/components/popup/popup.js +869 -0
  374. package/dist/collection/components/popup/test/popup.a11y.play.js +50 -0
  375. package/dist/collection/components/popup/test/popup.component.play.js +168 -0
  376. package/dist/collection/components/popup/test/popup.visual.play.js +33 -0
  377. package/dist/collection/components/progress-bar/progress-bar.host.css +1 -1
  378. package/dist/collection/components/progress-bar/progress-bar.js +13 -20
  379. package/dist/collection/components/radio/radio-group/radio-group.host.css +1 -1
  380. package/dist/collection/components/radio/radio-group/radio-group.js +22 -23
  381. package/dist/collection/components/radio/radio.js +19 -20
  382. package/dist/collection/components/segment/segment/segment.host.css +1 -1
  383. package/dist/collection/components/segment/segment/segment.js +19 -20
  384. package/dist/collection/components/segment/segment-item.js +6 -7
  385. package/dist/collection/components/select/select-optgroup.host.css +1 -0
  386. package/dist/collection/components/select/select-optgroup.js +82 -0
  387. package/dist/collection/components/select/select-option.host.css +1 -0
  388. package/dist/collection/components/select/select-option.js +112 -0
  389. package/dist/collection/components/select/select.host.css +1 -0
  390. package/dist/collection/components/select/select.i18n.js +45 -0
  391. package/dist/collection/components/select/select.interfaces.js +4 -0
  392. package/dist/collection/components/select/select.js +1024 -0
  393. package/dist/collection/components/select/select.picker.js +276 -0
  394. package/dist/collection/components/select/test/select.a11y.play.js +81 -0
  395. package/dist/collection/components/select/test/select.component.play.js +184 -0
  396. package/dist/collection/components/select/test/select.visual.play.js +70 -0
  397. package/dist/collection/components/shape/shape.js +7 -14
  398. package/dist/collection/components/spinner/spinner.js +18 -26
  399. package/dist/collection/components/stack/stack.host.css +1 -1
  400. package/dist/collection/components/stack/stack.js +41 -153
  401. package/dist/collection/components/steps/step/step.host.css +1 -0
  402. package/dist/collection/components/steps/step/step.js +431 -0
  403. package/dist/collection/components/steps/step-panel/step-panel.host.css +1 -0
  404. package/dist/collection/components/steps/step-panel/step-panel.js +104 -0
  405. package/dist/collection/components/steps/steps/steps.host.css +1 -0
  406. package/dist/collection/components/steps/steps/steps.js +356 -0
  407. package/dist/collection/components/steps/steps.interfaces.js +4 -0
  408. package/dist/collection/components/steps/test/steps.a11y.play.js +73 -0
  409. package/dist/collection/components/steps/test/steps.component.play.js +182 -0
  410. package/dist/collection/components/steps/test/steps.visual.play.js +18 -0
  411. package/dist/collection/components/tabs/tab/tab.host.css +1 -0
  412. package/dist/collection/components/tabs/tab/tab.js +278 -0
  413. package/dist/collection/components/tabs/tab-panel/tab-panel.host.css +1 -0
  414. package/dist/collection/components/tabs/tab-panel/tab-panel.js +104 -0
  415. package/dist/collection/components/tabs/tabs/tabs.host.css +1 -0
  416. package/dist/collection/components/tabs/tabs/tabs.i18n.js +45 -0
  417. package/dist/collection/components/tabs/tabs/tabs.js +552 -0
  418. package/dist/collection/components/tabs/tabs.interfaces.js +12 -0
  419. package/dist/collection/components/tabs/test/tabs.a11y.play.js +60 -0
  420. package/dist/collection/components/tabs/test/tabs.component.play.js +129 -0
  421. package/dist/collection/components/tabs/test/tabs.visual.play.js +31 -0
  422. package/dist/collection/components/tag/tag-group/tag-group.js +1 -1
  423. package/dist/collection/components/tag/tag.js +15 -26
  424. package/dist/collection/components/text/text.js +23 -30
  425. package/dist/collection/components/textarea/textarea.host.css +1 -1
  426. package/dist/collection/components/textarea/textarea.js +24 -25
  427. package/dist/collection/components/time-input/test/time-input.visual.play.js +18 -0
  428. package/dist/collection/components/toggle/toggle.js +19 -20
  429. package/dist/collection/components/tooltip/test/tooltip.a11y.play.js +32 -0
  430. package/dist/collection/components/tooltip/test/tooltip.component.play.js +51 -0
  431. package/dist/collection/components/tooltip/test/tooltip.visual.play.js +16 -0
  432. package/dist/collection/components/tooltip/tooltip.host.css +1 -0
  433. package/dist/collection/components/tooltip/tooltip.interfaces.js +4 -0
  434. package/dist/collection/components/tooltip/tooltip.js +407 -0
  435. package/dist/collection/foundation/colors.visual.play.js +18 -0
  436. package/dist/collection/global/config/config.const.js +11 -0
  437. package/dist/collection/global/config/config.default.js +92 -42
  438. package/dist/collection/global/config/config.js +1 -1
  439. package/dist/collection/global/config/config.meta.js +27 -0
  440. package/dist/collection/global/config/index.js +1 -0
  441. package/dist/collection/global/config/initialize.js +2 -1
  442. package/dist/collection/global/constants/tags.constant.js +29 -1
  443. package/dist/collection/global/constants/version.constant.js +1 -1
  444. package/dist/collection/global/index.js +0 -1
  445. package/dist/collection/global/initialize.js +2 -0
  446. package/dist/collection/index.js +5 -20
  447. package/dist/collection/utils/attributes.js +0 -15
  448. package/dist/collection/utils/focus.js +72 -0
  449. package/dist/collection/utils/form-control.js +1 -1
  450. package/dist/collection/utils/has-value.js +7 -0
  451. package/dist/collection/utils/helpers.js +14 -74
  452. package/dist/collection/utils/index.js +7 -5
  453. package/dist/collection/utils/{property-checkers/is-value-empty.js → is-value-empty.js} +1 -1
  454. package/dist/collection/utils/number.js +6 -25
  455. package/dist/collection/utils/property-decorators/array-of.js +25 -0
  456. package/dist/collection/utils/property-decorators/bound.js +79 -0
  457. package/dist/collection/utils/property-decorators/create-validator-decorator.js +212 -0
  458. package/dist/collection/utils/property-decorators/date.js +24 -0
  459. package/dist/collection/utils/property-decorators/index.js +12 -0
  460. package/dist/collection/utils/property-decorators/iso-date.js +24 -0
  461. package/dist/collection/utils/property-decorators/one-of.js +25 -0
  462. package/dist/collection/utils/property-decorators/pattern.js +25 -0
  463. package/dist/collection/utils/property-decorators/required.js +44 -0
  464. package/dist/collection/utils/property-decorators/type.js +28 -0
  465. package/dist/collection/utils/property-decorators/url.js +32 -0
  466. package/dist/collection/utils/property-types.js +1 -0
  467. package/dist/collection/utils/svg.js +19 -0
  468. package/dist/design-system/design-system.esm.js +1 -1
  469. package/dist/design-system/index.esm.js +1 -1
  470. package/dist/design-system/p-01430d5c28.entry.js +4 -0
  471. package/dist/design-system/p-014d464627.entry.js +4 -0
  472. package/dist/design-system/p-0663d7c0f1.entry.js +4 -0
  473. package/dist/design-system/p-0bd2ce2da3.entry.js +4 -0
  474. package/dist/design-system/p-0ff0be5b83.entry.js +4 -0
  475. package/dist/design-system/p-10c136d00d.entry.js +4 -0
  476. package/dist/design-system/p-11f34d0c7d.entry.js +4 -0
  477. package/dist/design-system/p-13d1ce3158.entry.js +4 -0
  478. package/dist/design-system/p-163d606781.entry.js +4 -0
  479. package/dist/design-system/p-1VXOIrN2.js +4 -0
  480. package/dist/design-system/p-202ecb8f01.entry.js +4 -0
  481. package/dist/design-system/p-27d181c5ac.entry.js +4 -0
  482. package/dist/design-system/p-2a35e0b9b0.entry.js +4 -0
  483. package/dist/design-system/p-2f51e1d39b.entry.js +4 -0
  484. package/dist/design-system/p-3134821ac6.entry.js +4 -0
  485. package/dist/design-system/p-3292ae6a05.entry.js +4 -0
  486. package/dist/design-system/p-372bf379f9.entry.js +4 -0
  487. package/dist/design-system/p-3895178b39.entry.js +4 -0
  488. package/dist/design-system/p-3c6b7a2967.entry.js +4 -0
  489. package/dist/design-system/p-3ef4bd1c59.entry.js +4 -0
  490. package/dist/design-system/p-493b18cc46.entry.js +4 -0
  491. package/dist/design-system/p-4a99464dae.entry.js +4 -0
  492. package/dist/design-system/p-4e6638d14e.entry.js +4 -0
  493. package/dist/design-system/p-53dda5d400.entry.js +4 -0
  494. package/dist/design-system/p-5d17209d91.entry.js +4 -0
  495. package/dist/design-system/p-5e51fa8df4.entry.js +4 -0
  496. package/dist/design-system/p-60d29d8b8e.entry.js +4 -0
  497. package/dist/design-system/p-62cb503015.entry.js +4 -0
  498. package/dist/design-system/p-650289138a.entry.js +4 -0
  499. package/dist/design-system/p-65c221261c.entry.js +4 -0
  500. package/dist/design-system/p-68c9f4f630.entry.js +4 -0
  501. package/dist/design-system/p-68ebed7eee.entry.js +4 -0
  502. package/dist/design-system/p-6b6531379b.entry.js +4 -0
  503. package/dist/design-system/p-6d168ba9ad.entry.js +4 -0
  504. package/dist/design-system/p-6ef31a3c07.entry.js +4 -0
  505. package/dist/design-system/p-774b89ed0b.entry.js +4 -0
  506. package/dist/design-system/p-787bd92bcc.entry.js +4 -0
  507. package/{components/p-E1SnOz0L.js → dist/design-system/p-78NZc8PM.js} +1 -1
  508. package/dist/design-system/p-7c353652a9.entry.js +4 -0
  509. package/dist/design-system/p-7c8bf0f33e.entry.js +4 -0
  510. package/dist/design-system/p-7e702193fc.entry.js +4 -0
  511. package/dist/design-system/p-8353961d39.entry.js +4 -0
  512. package/dist/design-system/{p-1d312498a6.entry.js → p-8406f6faf1.entry.js} +1 -1
  513. package/dist/design-system/p-9f2dd0b55b.entry.js +4 -0
  514. package/dist/design-system/p-B-en4B17.js +4 -0
  515. package/dist/design-system/p-B1e0kNRJ.js +14 -0
  516. package/dist/design-system/p-B8KVoKrH.js +5 -0
  517. package/dist/design-system/p-BAY6Z8bT.js +4 -0
  518. package/dist/design-system/p-BLGVE-7Z.js +4 -0
  519. package/dist/design-system/{p-C7EnKCpl.js → p-BMM6Nxeh.js} +1 -1
  520. package/{components/p-Diz11uvt.js → dist/design-system/p-BPGfTrrM.js} +1 -1
  521. package/dist/design-system/p-BhdSNuGP.js +4 -0
  522. package/dist/design-system/p-BkTv_bQR.js +4 -0
  523. package/dist/design-system/p-BqY0KzJC.js +4 -0
  524. package/dist/design-system/p-BrJFPhMA.js +4 -0
  525. package/dist/design-system/p-BvEM6oCl.js +4 -0
  526. package/dist/design-system/p-C1jqbZdf.js +4 -0
  527. package/dist/design-system/p-C6MVahkC.js +5 -0
  528. package/dist/design-system/{p-DCf2fJmI.js → p-C7i6xLTJ.js} +1 -1
  529. package/dist/design-system/p-CvTcEsXg.js +4 -0
  530. package/dist/design-system/p-CwCAiaMq.js +4 -0
  531. package/{components/p-5Sp1eJOt.js → dist/design-system/p-DTxLRTYr.js} +1 -1
  532. package/dist/design-system/{p-Dnjznncd.js → p-DgVaaZT_.js} +1 -1
  533. package/dist/design-system/{p-CAcwu8uP.js → p-Dm2lqE3-.js} +1 -1
  534. package/dist/design-system/p-HwbqEzpk.js +4 -0
  535. package/dist/design-system/p-LCY5n5tq.js +4 -0
  536. package/dist/design-system/p-Uy_dVz21.js +4 -0
  537. package/dist/design-system/p-a465c1acce.entry.js +4 -0
  538. package/dist/design-system/p-a62b7985a0.entry.js +4 -0
  539. package/dist/design-system/p-a8de98dd7b.entry.js +4 -0
  540. package/dist/design-system/p-ad2b17b0a0.entry.js +4 -0
  541. package/dist/design-system/p-afd8bbe699.entry.js +4 -0
  542. package/dist/design-system/{p-7e6ed497e7.entry.js → p-b68bc14064.entry.js} +1 -1
  543. package/dist/design-system/p-b955a93959.entry.js +4 -0
  544. package/dist/design-system/p-c37f266740.entry.js +4 -0
  545. package/dist/design-system/p-caad93b943.entry.js +4 -0
  546. package/dist/design-system/p-cca79bfeb1.entry.js +4 -0
  547. package/dist/design-system/p-d5f8d8f5e1.entry.js +4 -0
  548. package/dist/design-system/p-dcb749efc7.entry.js +4 -0
  549. package/dist/design-system/p-dd38f8f206.entry.js +4 -0
  550. package/dist/design-system/p-ddf2a7dfee.entry.js +4 -0
  551. package/dist/design-system/p-df5899b930.entry.js +4 -0
  552. package/dist/design-system/p-e7472337ed.entry.js +4 -0
  553. package/dist/design-system/p-e85c92ca1a.entry.js +4 -0
  554. package/dist/design-system/p-f0119fe693.entry.js +4 -0
  555. package/dist/design-system/p-f4958b9e97.entry.js +4 -0
  556. package/dist/design-system/p-f62643c33d.entry.js +4 -0
  557. package/dist/design-system/p-fa9568abce.entry.js +4 -0
  558. package/dist/design-system/p-fcd98f22b7.entry.js +4 -0
  559. package/dist/design-system/p-feeef4a8cb.entry.js +4 -0
  560. package/dist/design-system/{p-BLPSziW-.js → p-hLAmwHiq.js} +1 -1
  561. package/dist/design-system/p-ij4OEkzJ.js +4 -0
  562. package/dist/design-system/p-tl_BegdE.js +4 -0
  563. package/dist/esm/array-dJH4dfMr.js +1983 -0
  564. package/dist/esm/{breakpoints.decorator-L2xeP46f.js → breakpoints.decorator-DZ0xN4Np.js} +1 -1
  565. package/dist/esm/{breakpoints.subject-BhbzG-rl.js → breakpoints.subject-BNnXcKMw.js} +3 -3
  566. package/dist/esm/{button.interfaces-BkESlUMc.js → button.interfaces-BPGfTrrM.js} +1 -1
  567. package/dist/esm/carousel.interfaces-B-en4B17.js +8 -0
  568. package/dist/esm/{config.decorator-BQNIja4k.js → config.decorator-ZQ0_Zx5y.js} +1 -1
  569. package/dist/esm/{config.utils-COlKFRlV.js → config.utils-D9o7rffC.js} +1 -1
  570. package/dist/esm/create-validator-decorator-DovxquEu.js +208 -0
  571. package/dist/esm/design-system.js +4 -4
  572. package/dist/esm/{device-Dhwt3m7W.js → device-CRuIJzXR.js} +1 -1
  573. package/dist/esm/ds-accordion.entry.js +30 -34
  574. package/dist/esm/ds-alert-container.entry.js +12 -15
  575. package/dist/esm/ds-app.entry.js +16 -6
  576. package/dist/esm/ds-badge.entry.js +32 -25
  577. package/dist/esm/ds-button-group.entry.js +14 -17
  578. package/dist/esm/ds-button_2.entry.js +58 -73
  579. package/dist/esm/ds-card-actions.entry.js +6 -8
  580. package/dist/esm/ds-card-content.entry.js +2 -2
  581. package/dist/esm/ds-card-header.entry.js +8 -5
  582. package/dist/esm/ds-card-subtitle.entry.js +13 -13
  583. package/dist/esm/ds-card-title.entry.js +11 -7
  584. package/dist/esm/ds-card.entry.js +30 -42
  585. package/dist/esm/ds-carousel-item.entry.js +126 -0
  586. package/dist/esm/ds-carousel.entry.js +471 -0
  587. package/dist/esm/ds-checkbox-group.entry.js +40 -2011
  588. package/dist/esm/ds-checkbox.entry.js +23 -19
  589. package/dist/esm/ds-content_2.entry.js +327 -0
  590. package/dist/esm/ds-data-item.entry.js +144 -0
  591. package/dist/esm/ds-data-label.entry.js +39 -0
  592. package/dist/esm/ds-data-value.entry.js +29 -0
  593. package/dist/esm/ds-data.entry.js +41 -0
  594. package/dist/esm/ds-date.entry.js +5332 -0
  595. package/dist/esm/{ds-logo.entry.js → ds-divider_2.entry.js} +130 -26
  596. package/dist/esm/ds-drawer_2.entry.js +599 -0
  597. package/dist/esm/ds-file-upload.entry.js +513 -0
  598. package/dist/esm/ds-footer.entry.js +157 -0
  599. package/dist/esm/ds-heading.entry.js +21 -19
  600. package/dist/esm/ds-hint-text.entry.js +26 -0
  601. package/dist/esm/ds-hint-title.entry.js +29 -0
  602. package/dist/esm/ds-hint.entry.js +241 -0
  603. package/dist/esm/ds-icon_2.entry.js +78 -70
  604. package/dist/esm/ds-input.entry.js +46 -44
  605. package/dist/esm/ds-item.entry.js +29 -34
  606. package/dist/esm/ds-label.entry.js +22 -30
  607. package/dist/esm/ds-list.entry.js +6 -12
  608. package/dist/esm/ds-modal-body.entry.js +32 -0
  609. package/dist/esm/ds-modal-header.entry.js +29 -0
  610. package/dist/esm/ds-modal.entry.js +199 -0
  611. package/dist/esm/ds-navbar.entry.js +357 -0
  612. package/dist/esm/ds-notification.entry.js +19 -27
  613. package/dist/esm/ds-number-input.entry.js +129 -46
  614. package/dist/esm/ds-pagination.entry.js +41 -37
  615. package/dist/esm/ds-progress-bar.entry.js +25 -29
  616. package/dist/esm/ds-radio-group.entry.js +31 -30
  617. package/dist/esm/ds-radio.entry.js +25 -32
  618. package/dist/esm/ds-segment-item.entry.js +9 -9
  619. package/dist/esm/ds-segment.entry.js +28 -116
  620. package/dist/esm/ds-select-optgroup.entry.js +47 -0
  621. package/dist/esm/ds-select-option.entry.js +55 -0
  622. package/dist/esm/ds-select.entry.js +2770 -0
  623. package/dist/esm/ds-shape.entry.js +10 -16
  624. package/dist/esm/ds-snackbar.entry.js +40 -57
  625. package/dist/esm/ds-step-panel.entry.js +53 -0
  626. package/dist/esm/ds-step.entry.js +168 -0
  627. package/dist/esm/ds-steps.entry.js +225 -0
  628. package/dist/esm/ds-tab-panel.entry.js +53 -0
  629. package/dist/esm/ds-tab.entry.js +118 -0
  630. package/dist/esm/ds-tabs.entry.js +362 -0
  631. package/dist/esm/ds-tag-group.entry.js +3 -3
  632. package/dist/esm/ds-tag.entry.js +19 -26
  633. package/dist/esm/ds-text.entry.js +28 -32
  634. package/dist/esm/ds-textarea.entry.js +33 -32
  635. package/dist/esm/ds-toast.entry.js +40 -54
  636. package/dist/esm/ds-toggle.entry.js +22 -21
  637. package/dist/esm/ds-tooltip.entry.js +180 -0
  638. package/dist/esm/{field.util-BXxRO7CD.js → field.util-BjZzAi09.js} +1 -1
  639. package/dist/esm/floating-ui.dom-BqY0KzJC.js +1621 -0
  640. package/dist/esm/focus-ZxHImoOj.js +1956 -0
  641. package/dist/esm/footer.i18n-BrJFPhMA.js +159 -0
  642. package/dist/esm/{form-control-D2O-sb65.js → form-control-DvJo0GKN.js} +2 -2
  643. package/dist/esm/has-value-DU9L2JaI.js +10 -0
  644. package/dist/esm/{index-CuwLeg-T.js → index-C6MVahkC.js} +496 -175
  645. package/dist/esm/index.js +13 -8273
  646. package/dist/esm/{input.interfaces-C7EnKCpl.js → input.interfaces-BMM6Nxeh.js} +1 -1
  647. package/dist/esm/keyboard-Uy_dVz21.js +20 -0
  648. package/dist/esm/{listener-C_kjUVTE.js → listener-DHP2OPMZ.js} +1 -1
  649. package/dist/esm/loader.js +3 -3
  650. package/dist/esm/luxon-C1jqbZdf.js +8133 -0
  651. package/dist/esm/one-of-CKPv0Nqm.js +28 -0
  652. package/dist/esm/popup.interfaces-BAY6Z8bT.js +20 -0
  653. package/dist/esm/required-Dqsbx5fH.js +36 -0
  654. package/dist/esm/resize.decorator-B8h8D676.js +96 -0
  655. package/dist/esm/scroll-CsH7NHo5.js +87 -0
  656. package/dist/esm/svg-B8KVoKrH.js +2440 -0
  657. package/dist/esm/{tslib.es6-tdchDLyb.js → tslib.es6-C9GKXw-5.js} +1 -1
  658. package/dist/esm/type-DzkhLOG_.js +31 -0
  659. package/dist/types/components/accordion/accordion.d.ts +0 -5
  660. package/dist/types/components/alert/alert-container.d.ts +0 -5
  661. package/dist/types/components/alert/snackbar/snackbar.d.ts +0 -5
  662. package/dist/types/components/alert/toast/toast.d.ts +0 -5
  663. package/dist/types/components/badge/badge.d.ts +1 -3
  664. package/dist/types/components/badge/badge.interfaces.d.ts +1 -1
  665. package/dist/types/components/button/button-group/button-group.d.ts +0 -5
  666. package/dist/types/components/button/button.d.ts +1 -3
  667. package/dist/types/components/button/button.interfaces.d.ts +1 -1
  668. package/dist/types/components/card/card-actions/card-actions.d.ts +0 -1
  669. package/dist/types/components/card/card-subtitle/card-subtitle.d.ts +0 -1
  670. package/dist/types/components/card/card.d.ts +1 -3
  671. package/dist/types/components/carousel/carousel/carousel.d.ts +114 -0
  672. package/dist/types/components/carousel/carousel/carousel.i18n.d.ts +9 -0
  673. package/dist/types/components/carousel/carousel-item/carousel-item.d.ts +70 -0
  674. package/dist/types/components/carousel/carousel.interfaces.d.ts +14 -0
  675. package/dist/types/components/carousel/test/carousel.a11y.play.d.ts +1 -0
  676. package/dist/types/components/carousel/test/carousel.component.play.d.ts +1 -0
  677. package/dist/types/components/carousel/test/carousel.visual.play.d.ts +1 -0
  678. package/dist/types/components/close/close.d.ts +1 -3
  679. package/dist/types/components/content/content.d.ts +2 -5
  680. package/dist/types/components/data/data-item.d.ts +43 -0
  681. package/dist/types/components/data/data-item.i18n.d.ts +6 -0
  682. package/dist/types/components/data/data-item.interfaces.d.ts +4 -0
  683. package/dist/types/components/data/data-label.d.ts +19 -0
  684. package/dist/types/components/data/data-label.interfaces.d.ts +3 -0
  685. package/dist/types/components/data/data-value.d.ts +15 -0
  686. package/dist/types/components/data/data-value.interfaces.d.ts +5 -0
  687. package/dist/types/components/data/data.d.ts +19 -0
  688. package/dist/types/components/data/data.interfaces.d.ts +4 -0
  689. package/dist/types/components/data/test/data.a11y.play.d.ts +1 -0
  690. package/dist/types/components/data/test/data.component.play.d.ts +1 -0
  691. package/dist/types/components/data/test/data.visual.play.d.ts +1 -0
  692. package/dist/types/components/date/date.d.ts +214 -0
  693. package/dist/types/components/date/date.i18n.d.ts +13 -0
  694. package/dist/types/components/date/date.interfaces.d.ts +18 -0
  695. package/dist/types/components/date/date.mask.d.ts +29 -0
  696. package/dist/types/components/date/date.picker.d.ts +67 -0
  697. package/dist/types/components/date/test/date.a11y.play.d.ts +1 -0
  698. package/dist/types/components/date/test/date.component.play.d.ts +1 -0
  699. package/dist/types/components/date/test/date.visual.play.d.ts +1 -0
  700. package/dist/types/components/divider/divider.d.ts +1 -3
  701. package/dist/types/components/drawer/drawer.d.ts +102 -0
  702. package/dist/types/components/drawer/drawer.interfaces.d.ts +8 -0
  703. package/dist/types/components/drawer/test/drawer.a11y.play.d.ts +1 -0
  704. package/dist/types/components/drawer/test/drawer.component.play.d.ts +1 -0
  705. package/dist/types/components/drawer/test/drawer.visual.play.d.ts +1 -0
  706. package/dist/types/components/file-upload/file-upload.d.ts +192 -0
  707. package/dist/types/components/file-upload/file-upload.i18n.d.ts +8 -0
  708. package/dist/types/components/file-upload/file-upload.interfaces.d.ts +24 -0
  709. package/dist/types/components/file-upload/test/file-upload.a11y.play.d.ts +1 -0
  710. package/dist/types/components/file-upload/test/file-upload.component.play.d.ts +1 -0
  711. package/dist/types/components/file-upload/test/file-upload.visual.play.d.ts +1 -0
  712. package/dist/types/components/file-upload/utils/file-list.util.d.ts +2 -0
  713. package/dist/types/components/file-upload/utils/file-size.util.d.ts +1 -0
  714. package/dist/types/components/file-upload/utils/file-validation.util.d.ts +13 -0
  715. package/dist/types/components/footer/footer.d.ts +68 -0
  716. package/dist/types/components/footer/footer.i18n.d.ts +7 -0
  717. package/dist/types/components/footer/footer.interfaces.d.ts +19 -0
  718. package/dist/types/components/footer/test/footer.a11y.play.d.ts +1 -0
  719. package/dist/types/components/footer/test/footer.component.play.d.ts +1 -0
  720. package/dist/types/components/footer/test/footer.visual.play.d.ts +1 -0
  721. package/dist/types/components/hint/hint-text/hint-text.d.ts +15 -0
  722. package/dist/types/components/hint/hint-title/hint-title.d.ts +16 -0
  723. package/dist/types/components/hint/hint.d.ts +87 -0
  724. package/dist/types/components/hint/hint.i18n.d.ts +6 -0
  725. package/dist/types/components/hint/hint.interfaces.d.ts +4 -0
  726. package/dist/types/components/hint/test/hint.a11y.play.d.ts +1 -0
  727. package/dist/types/components/hint/test/hint.component.play.d.ts +1 -0
  728. package/dist/types/components/hint/test/hint.visual.play.d.ts +1 -0
  729. package/dist/types/components/icon/icon.d.ts +7 -3
  730. package/dist/types/components/icon/icon.interfaces.d.ts +1 -1
  731. package/dist/types/components/input/clear-button.i18n.d.ts +6 -0
  732. package/dist/types/components/input/clear-button.util.d.ts +10 -0
  733. package/dist/types/components/input/trigger-button.i18n.d.ts +7 -0
  734. package/dist/types/components/label/label.d.ts +3 -5
  735. package/dist/types/components/list/item/item.d.ts +0 -5
  736. package/dist/types/components/list/item/item.interfaces.d.ts +1 -1
  737. package/dist/types/components/list/list.d.ts +0 -5
  738. package/dist/types/components/list/test/list.visual.play.d.ts +1 -0
  739. package/dist/types/components/logo/logo.d.ts +1 -2
  740. package/dist/types/components/modal/modal-body/modal-body.d.ts +15 -0
  741. package/dist/types/components/modal/modal-header/modal-header.d.ts +17 -0
  742. package/dist/types/components/modal/modal.controller.d.ts +3 -0
  743. package/dist/types/components/modal/modal.d.ts +97 -0
  744. package/dist/types/components/modal/modal.interfaces.d.ts +15 -0
  745. package/dist/types/components/modal/test/modal.a11y.play.d.ts +1 -0
  746. package/dist/types/components/modal/test/modal.component.play.d.ts +1 -0
  747. package/dist/types/components/modal/test/modal.visual.play.d.ts +1 -0
  748. package/dist/types/components/navbar/navbar.d.ts +128 -0
  749. package/dist/types/components/navbar/navbar.i18n.d.ts +9 -0
  750. package/dist/types/components/navbar/navbar.interfaces.d.ts +10 -0
  751. package/dist/types/components/navbar/test/navbar.a11y.play.d.ts +1 -0
  752. package/dist/types/components/navbar/test/navbar.component.play.d.ts +1 -0
  753. package/dist/types/components/navbar/test/navbar.visual.play.d.ts +1 -0
  754. package/dist/types/components/notification/notification.d.ts +1 -3
  755. package/dist/types/components/pagination/pagination.d.ts +0 -5
  756. package/dist/types/components/popup/popup.d.ts +152 -0
  757. package/dist/types/components/popup/popup.interfaces.d.ts +14 -0
  758. package/dist/types/components/popup/test/popup.a11y.play.d.ts +1 -0
  759. package/dist/types/components/popup/test/popup.component.play.d.ts +1 -0
  760. package/dist/types/components/popup/test/popup.visual.play.d.ts +1 -0
  761. package/dist/types/components/progress-bar/progress-bar.d.ts +0 -5
  762. package/dist/types/components/select/select-optgroup.d.ts +28 -0
  763. package/dist/types/components/select/select-option.d.ts +34 -0
  764. package/dist/types/components/select/select.d.ts +193 -0
  765. package/dist/types/components/select/select.i18n.d.ts +7 -0
  766. package/dist/types/components/select/select.interfaces.d.ts +16 -0
  767. package/dist/types/components/select/select.picker.d.ts +57 -0
  768. package/dist/types/components/select/test/select.a11y.play.d.ts +1 -0
  769. package/dist/types/components/select/test/select.component.play.d.ts +1 -0
  770. package/dist/types/components/select/test/select.visual.play.d.ts +1 -0
  771. package/dist/types/components/shape/shape.d.ts +2 -7
  772. package/dist/types/components/spinner/spinner.d.ts +0 -2
  773. package/dist/types/components/stack/stack.d.ts +7 -19
  774. package/dist/types/components/steps/step/step.d.ts +89 -0
  775. package/dist/types/components/steps/step-panel/step-panel.d.ts +34 -0
  776. package/dist/types/components/steps/steps/steps.d.ts +77 -0
  777. package/dist/types/components/steps/steps.interfaces.d.ts +10 -0
  778. package/dist/types/components/steps/test/steps.a11y.play.d.ts +1 -0
  779. package/dist/types/components/steps/test/steps.component.play.d.ts +1 -0
  780. package/dist/types/components/steps/test/steps.visual.play.d.ts +1 -0
  781. package/dist/types/components/tabs/tab/tab.d.ts +67 -0
  782. package/dist/types/components/tabs/tab-panel/tab-panel.d.ts +34 -0
  783. package/dist/types/components/tabs/tabs/tabs.d.ts +97 -0
  784. package/dist/types/components/tabs/tabs/tabs.i18n.d.ts +7 -0
  785. package/dist/types/components/tabs/tabs.interfaces.d.ts +12 -0
  786. package/dist/types/components/tabs/test/tabs.a11y.play.d.ts +1 -0
  787. package/dist/types/components/tabs/test/tabs.component.play.d.ts +1 -0
  788. package/dist/types/components/tabs/test/tabs.visual.play.d.ts +1 -0
  789. package/dist/types/components/tag/tag.d.ts +1 -3
  790. package/dist/types/components/text/text.d.ts +2 -7
  791. package/dist/types/components/time-input/test/time-input.visual.play.d.ts +1 -0
  792. package/dist/types/components/tooltip/test/tooltip.a11y.play.d.ts +1 -0
  793. package/dist/types/components/tooltip/test/tooltip.component.play.d.ts +1 -0
  794. package/dist/types/components/tooltip/test/tooltip.visual.play.d.ts +1 -0
  795. package/dist/types/components/tooltip/tooltip.d.ts +85 -0
  796. package/dist/types/components/tooltip/tooltip.interfaces.d.ts +10 -0
  797. package/dist/types/components.d.ts +4913 -1926
  798. package/dist/types/foundation/colors.visual.play.d.ts +1 -0
  799. package/dist/types/global/config/config.const.d.ts +3 -0
  800. package/dist/types/global/config/config.default.d.ts +0 -40
  801. package/dist/types/global/config/config.meta.d.ts +2 -0
  802. package/dist/types/global/config/config.types.d.ts +27 -0
  803. package/dist/types/global/config/index.d.ts +1 -0
  804. package/dist/types/global/index.d.ts +0 -1
  805. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/carousel.po.d.ts +12 -0
  806. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/data-item.po.d.ts +16 -0
  807. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/data.po.d.ts +12 -0
  808. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/date.po.d.ts +15 -0
  809. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/drawer.po.d.ts +11 -0
  810. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/file-upload.po.d.ts +16 -0
  811. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/footer.po.d.ts +16 -0
  812. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/hint.po.d.ts +10 -0
  813. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/index.d.ts +15 -0
  814. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/modal.po.d.ts +15 -0
  815. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/navbar.po.d.ts +13 -0
  816. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/popup.po.d.ts +11 -0
  817. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/select.po.d.ts +24 -0
  818. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/steps.po.d.ts +13 -0
  819. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/tabs.po.d.ts +13 -0
  820. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/components/tooltip.po.d.ts +6 -0
  821. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/playwright/src/lib/page/utils/goto.d.ts +1 -1
  822. package/dist/types/index.d.ts +4 -1
  823. package/dist/types/stencil-public-runtime.d.ts +1 -0
  824. package/dist/types/utils/attributes.d.ts +0 -8
  825. package/dist/types/utils/focus.d.ts +18 -0
  826. package/dist/types/utils/form-control.d.ts +2 -2
  827. package/dist/types/utils/has-value.d.ts +1 -0
  828. package/dist/types/utils/index.d.ts +7 -5
  829. package/dist/types/utils/number.d.ts +0 -3
  830. package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
  831. package/dist/types/utils/property-decorators/bound.d.ts +36 -0
  832. package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +48 -0
  833. package/dist/types/utils/property-decorators/date.d.ts +6 -0
  834. package/dist/types/utils/property-decorators/index.d.ts +9 -0
  835. package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
  836. package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
  837. package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
  838. package/dist/types/utils/property-decorators/required.d.ts +17 -0
  839. package/dist/types/utils/property-decorators/type.d.ts +9 -0
  840. package/dist/types/utils/property-decorators/url.d.ts +6 -0
  841. package/dist/types/utils/svg.d.ts +2 -0
  842. package/docs/cem.json +17659 -0
  843. package/docs/components.json +38767 -17409
  844. package/docs/html.html-data.json +1529 -147
  845. package/docs/tags.json +29 -1
  846. package/package.json +45 -38
  847. package/sbom.cdx.json +54391 -0
  848. package/README.md +0 -33
  849. package/components/p-82RSSk25.js +0 -4
  850. package/components/p-BEngECpF.js +0 -4
  851. package/components/p-BMBthpLd.js +0 -4
  852. package/components/p-BNY3JzuV.js +0 -4
  853. package/components/p-BOTkpyFe.js +0 -5
  854. package/components/p-BOgMmRCt.js +0 -4
  855. package/components/p-CDYlUuhB.js +0 -4
  856. package/components/p-Cb75Rr6o.js +0 -4
  857. package/components/p-CojUmpFm.js +0 -4
  858. package/components/p-DHeVI6dR.js +0 -4
  859. package/components/p-DTPbL3uY.js +0 -4
  860. package/components/p-DnnGnukM.js +0 -4
  861. package/components/p-DtuTnY5l.js +0 -4
  862. package/components/p-JZ1uDtZv.js +0 -4
  863. package/components/p-cSbDziZm.js +0 -4
  864. package/components/p-gA-94RPS.js +0 -4
  865. package/components/p-xDEngwqW.js +0 -4
  866. package/dist/cjs/contact-SPfz2A_q.js +0 -1647
  867. package/dist/cjs/ds-content.cjs.entry.js +0 -154
  868. package/dist/cjs/ds-divider.cjs.entry.js +0 -131
  869. package/dist/cjs/ds-stack.cjs.entry.js +0 -224
  870. package/dist/cjs/isEmpty-BmKp4bH4.js +0 -99
  871. package/dist/cjs/stack.interfaces-6vlKvBmb.js +0 -68
  872. package/dist/cjs/svg-D7Mwbcvp.js +0 -1482
  873. package/dist/cjs/validate.decorator-C9-9HA0Y.js +0 -115
  874. package/dist/collection/global/constants/icons.constant.js +0 -42
  875. package/dist/collection/utils/element-states/element-states.decorator.js +0 -23
  876. package/dist/collection/utils/element-states/element-states.listener.js +0 -55
  877. package/dist/collection/utils/element-states/element-states.subject.js +0 -24
  878. package/dist/collection/utils/element-states/index.js +0 -5
  879. package/dist/collection/utils/keyboard/index.js +0 -6
  880. package/dist/collection/utils/keyboard/keyboard.decorator.js +0 -23
  881. package/dist/collection/utils/keyboard/keyboard.listener.js +0 -34
  882. package/dist/collection/utils/keyboard/keyboard.subject.js +0 -24
  883. package/dist/collection/utils/property-checkers/check-array-of.js +0 -13
  884. package/dist/collection/utils/property-checkers/check-date.js +0 -18
  885. package/dist/collection/utils/property-checkers/check-iso-date.js +0 -14
  886. package/dist/collection/utils/property-checkers/check-one-of.js +0 -13
  887. package/dist/collection/utils/property-checkers/check-pattern.js +0 -13
  888. package/dist/collection/utils/property-checkers/check-type.js +0 -20
  889. package/dist/collection/utils/property-checkers/check-url.js +0 -20
  890. package/dist/collection/utils/property-checkers/empty-or.js +0 -15
  891. package/dist/collection/utils/property-checkers/index.js +0 -57
  892. package/dist/collection/utils/property-checkers/required-and.js +0 -20
  893. package/dist/collection/utils/swipe/index.js +0 -6
  894. package/dist/collection/utils/swipe/swipe.decorator.js +0 -23
  895. package/dist/collection/utils/swipe/swipe.listener.js +0 -33
  896. package/dist/collection/utils/swipe/swipe.subject.js +0 -28
  897. package/dist/collection/utils/validate.decorator.js +0 -203
  898. package/dist/design-system/p-03bbcdf9de.entry.js +0 -4
  899. package/dist/design-system/p-1154323457.entry.js +0 -4
  900. package/dist/design-system/p-1f0601a4f4.entry.js +0 -4
  901. package/dist/design-system/p-21b080a49a.entry.js +0 -4
  902. package/dist/design-system/p-27c34c4e5f.entry.js +0 -4
  903. package/dist/design-system/p-2b91de302f.entry.js +0 -4
  904. package/dist/design-system/p-31c1235ac5.entry.js +0 -4
  905. package/dist/design-system/p-3259acaa64.entry.js +0 -4
  906. package/dist/design-system/p-339d85cca0.entry.js +0 -4
  907. package/dist/design-system/p-35e63b52e7.entry.js +0 -4
  908. package/dist/design-system/p-363f3a7ab4.entry.js +0 -4
  909. package/dist/design-system/p-3d901720f7.entry.js +0 -4
  910. package/dist/design-system/p-40ba8b9812.entry.js +0 -4
  911. package/dist/design-system/p-432430e14f.entry.js +0 -4
  912. package/dist/design-system/p-487807f228.entry.js +0 -4
  913. package/dist/design-system/p-4a049d1b7f.entry.js +0 -4
  914. package/dist/design-system/p-4f4cce8ce4.entry.js +0 -4
  915. package/dist/design-system/p-5a901a9b8e.entry.js +0 -4
  916. package/dist/design-system/p-5d3330bf93.entry.js +0 -4
  917. package/dist/design-system/p-640223834c.entry.js +0 -4
  918. package/dist/design-system/p-6b9aab417f.entry.js +0 -4
  919. package/dist/design-system/p-799705af3a.entry.js +0 -4
  920. package/dist/design-system/p-82RSSk25.js +0 -4
  921. package/dist/design-system/p-8e0872fef0.entry.js +0 -4
  922. package/dist/design-system/p-9617d56181.entry.js +0 -4
  923. package/dist/design-system/p-BaIoYrFa.js +0 -5
  924. package/dist/design-system/p-Cb75Rr6o.js +0 -4
  925. package/dist/design-system/p-CqZ6YSy9.js +0 -4
  926. package/dist/design-system/p-CqzM3doy.js +0 -4
  927. package/dist/design-system/p-CuwLeg-T.js +0 -5
  928. package/dist/design-system/p-DTPbL3uY.js +0 -4
  929. package/dist/design-system/p-aff68865ee.entry.js +0 -4
  930. package/dist/design-system/p-b3c6327744.entry.js +0 -4
  931. package/dist/design-system/p-be9023a38b.entry.js +0 -4
  932. package/dist/design-system/p-c031d1dce5.entry.js +0 -4
  933. package/dist/design-system/p-c3ae96e220.entry.js +0 -4
  934. package/dist/design-system/p-d430812a57.entry.js +0 -4
  935. package/dist/design-system/p-de1354f022.entry.js +0 -4
  936. package/dist/design-system/p-e3d0c82e2a.entry.js +0 -4
  937. package/dist/design-system/p-ea1a5e1f75.entry.js +0 -4
  938. package/dist/design-system/p-ea7169501c.entry.js +0 -4
  939. package/dist/design-system/p-eab397e041.entry.js +0 -4
  940. package/dist/design-system/p-ecba4deb9a.entry.js +0 -4
  941. package/dist/design-system/p-fe0dbd4b03.entry.js +0 -4
  942. package/dist/design-system/p-ng5ZzTOj.js +0 -4
  943. package/dist/esm/contact-Cb75Rr6o.js +0 -1636
  944. package/dist/esm/ds-content.entry.js +0 -152
  945. package/dist/esm/ds-divider.entry.js +0 -129
  946. package/dist/esm/ds-stack.entry.js +0 -222
  947. package/dist/esm/isEmpty-DmZYZqE9.js +0 -97
  948. package/dist/esm/stack.interfaces-ng5ZzTOj.js +0 -62
  949. package/dist/esm/svg-BaIoYrFa.js +0 -1480
  950. package/dist/esm/validate.decorator-82RSSk25.js +0 -110
  951. package/dist/types/global/constants/icons.constant.d.ts +0 -38
  952. package/dist/types/utils/element-states/element-states.decorator.d.ts +0 -3
  953. package/dist/types/utils/element-states/element-states.interfaces.d.ts +0 -10
  954. package/dist/types/utils/element-states/element-states.listener.d.ts +0 -15
  955. package/dist/types/utils/element-states/element-states.subject.d.ts +0 -8
  956. package/dist/types/utils/element-states/index.d.ts +0 -2
  957. package/dist/types/utils/keyboard/index.d.ts +0 -3
  958. package/dist/types/utils/keyboard/keyboard.decorator.d.ts +0 -3
  959. package/dist/types/utils/keyboard/keyboard.interfaces.d.ts +0 -8
  960. package/dist/types/utils/keyboard/keyboard.listener.d.ts +0 -9
  961. package/dist/types/utils/keyboard/keyboard.subject.d.ts +0 -8
  962. package/dist/types/utils/property-checkers/check-array-of.d.ts +0 -2
  963. package/dist/types/utils/property-checkers/check-date.d.ts +0 -1
  964. package/dist/types/utils/property-checkers/check-iso-date.d.ts +0 -1
  965. package/dist/types/utils/property-checkers/check-one-of.d.ts +0 -1
  966. package/dist/types/utils/property-checkers/check-pattern.d.ts +0 -1
  967. package/dist/types/utils/property-checkers/check-type.d.ts +0 -2
  968. package/dist/types/utils/property-checkers/check-url.d.ts +0 -1
  969. package/dist/types/utils/property-checkers/constants.d.ts +0 -1
  970. package/dist/types/utils/property-checkers/empty-or.d.ts +0 -1
  971. package/dist/types/utils/property-checkers/index.d.ts +0 -19
  972. package/dist/types/utils/property-checkers/required-and.d.ts +0 -1
  973. package/dist/types/utils/swipe/index.d.ts +0 -3
  974. package/dist/types/utils/swipe/swipe.decorator.d.ts +0 -5
  975. package/dist/types/utils/swipe/swipe.interfaces.d.ts +0 -10
  976. package/dist/types/utils/swipe/swipe.listener.d.ts +0 -10
  977. package/dist/types/utils/swipe/swipe.subject.d.ts +0 -11
  978. package/dist/types/utils/validate.decorator.d.ts +0 -114
  979. /package/dist/collection/{utils/element-states/element-states.interfaces.js → components/data/data-item.interfaces.js} +0 -0
  980. /package/dist/collection/{utils/keyboard/keyboard.interfaces.js → components/data/data-label.interfaces.js} +0 -0
  981. /package/dist/collection/{utils/property-checkers/property-types.js → components/data/data-value.interfaces.js} +0 -0
  982. /package/dist/collection/{utils/swipe/swipe.interfaces.js → components/data/data.interfaces.js} +0 -0
  983. /package/dist/collection/utils/{property-checkers/is-iso-date.js → is-iso-date.js} +0 -0
  984. /package/dist/collection/utils/{keyboard/keyboard.helpers.js → keyboard.js} +0 -0
  985. /package/dist/types/utils/{property-checkers/is-iso-date.d.ts → is-iso-date.d.ts} +0 -0
  986. /package/dist/types/utils/{property-checkers/is-value-empty.d.ts → is-value-empty.d.ts} +0 -0
  987. /package/dist/types/utils/{keyboard/keyboard.helpers.d.ts → keyboard.d.ts} +0 -0
  988. /package/dist/types/utils/{property-checkers/property-types.d.ts → property-types.d.ts} +0 -0
@@ -0,0 +1,1956 @@
1
+ /*!
2
+ * (C) Helvetia Design System https://design.baloise.dev/ - Apache License 2.0
3
+ */
4
+ import { d as dsBrowser } from './index-C6MVahkC.js';
5
+
6
+ /*!
7
+ * tabbable 6.5.0
8
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
9
+ */
10
+ // NOTE: separate `:not()` selectors has broader browser support than the newer
11
+ // `:not([inert], [inert] *)` (Feb 2023)
12
+ var candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'area[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];
13
+ var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
14
+ var NoElement = typeof Element === 'undefined';
15
+ var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
16
+ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
17
+ var _element$getRootNode;
18
+ return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
19
+ } : function (element) {
20
+ return element === null || element === void 0 ? void 0 : element.ownerDocument;
21
+ };
22
+
23
+ /**
24
+ * Determines if a node is inert or in an inert ancestor.
25
+ * @param {Node} [node]
26
+ * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to
27
+ * see if any of them are inert. If false, only `node` itself is considered.
28
+ * @returns {boolean} True if inert itself or by way of being in an inert ancestor.
29
+ * False if `node` is falsy.
30
+ */
31
+ var _isInert = function isInert(node, lookUp) {
32
+ var _node$getAttribute;
33
+ if (lookUp === void 0) {
34
+ lookUp = true;
35
+ }
36
+ // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
37
+ // JS API property; we have to check the attribute, which can either be empty or 'true';
38
+ // if it's `null` (not specified) or 'false', it's an active element
39
+ var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
40
+ var inert = inertAtt === '' || inertAtt === 'true';
41
+
42
+ // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
43
+ // if it weren't for `matches()` not being a function on shadow roots; the following
44
+ // code works for any kind of node
45
+ var result = inert || lookUp && node && (
46
+ // closest does not exist on shadow roots, so we fall back to a manual
47
+ // lookup upward, in case it is not defined.
48
+ typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));
49
+ return result;
50
+ };
51
+
52
+ /**
53
+ * Determines if a node's content is editable.
54
+ * @param {Element} [node]
55
+ * @returns True if it's content-editable; false if it's not or `node` is falsy.
56
+ */
57
+ var isContentEditable = function isContentEditable(node) {
58
+ var _node$getAttribute2;
59
+ // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
60
+ // to use the attribute directly to check for this, which can either be empty or 'true';
61
+ // if it's `null` (not specified) or 'false', it's a non-editable element
62
+ var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
63
+ return attValue === '' || attValue === 'true';
64
+ };
65
+
66
+ /**
67
+ * @param {Element} el container to check in
68
+ * @param {boolean} includeContainer add container to check
69
+ * @param {(node: Element) => boolean} filter filter candidates
70
+ * @returns {Element[]}
71
+ */
72
+ var getCandidates = function getCandidates(el, includeContainer, filter) {
73
+ // even if `includeContainer=false`, we still have to check it for inertness because
74
+ // if it's inert (either by itself or via its parent), then all its children are inert
75
+ if (_isInert(el)) {
76
+ return [];
77
+ }
78
+ var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
79
+ if (includeContainer && matches.call(el, candidateSelector)) {
80
+ candidates.unshift(el);
81
+ }
82
+ candidates = candidates.filter(filter);
83
+ return candidates;
84
+ };
85
+
86
+ /**
87
+ * @callback GetShadowRoot
88
+ * @param {Element} element to check for shadow root
89
+ * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
90
+ */
91
+
92
+ /**
93
+ * @callback ShadowRootFilter
94
+ * @param {Element} shadowHostNode the element which contains shadow content
95
+ * @returns {boolean} true if a shadow root could potentially contain valid candidates.
96
+ */
97
+
98
+ /**
99
+ * @typedef {Object} CandidateScope
100
+ * @property {Element} scopeParent contains inner candidates
101
+ * @property {Element[]} candidates list of candidates found in the scope parent
102
+ */
103
+
104
+ /**
105
+ * @typedef {Object} IterativeOptions
106
+ * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
107
+ * if a function, implies shadow support is enabled and either returns the shadow root of an element
108
+ * or a boolean stating if it has an undisclosed shadow root
109
+ * @property {(node: Element) => boolean} filter filter candidates
110
+ * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
111
+ * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
112
+ */
113
+
114
+ /**
115
+ * @param {Element[]} elements list of element containers to match candidates from
116
+ * @param {boolean} includeContainer add container list to check
117
+ * @param {IterativeOptions} options
118
+ * @returns {Array.<Element|CandidateScope>}
119
+ */
120
+ var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
121
+ var candidates = [];
122
+ var elementsToCheck = Array.from(elements);
123
+ while (elementsToCheck.length) {
124
+ var element = elementsToCheck.shift();
125
+ if (_isInert(element, false)) {
126
+ // no need to look up since we're drilling down
127
+ // anything inside this container will also be inert
128
+ continue;
129
+ }
130
+ if (element.tagName === 'SLOT') {
131
+ // add shadow dom slot scope (slot itself cannot be focusable)
132
+ var assigned = element.assignedElements();
133
+ var content = assigned.length ? assigned : element.children;
134
+ var nestedCandidates = _getCandidatesIteratively(content, true, options);
135
+ if (options.flatten) {
136
+ candidates.push.apply(candidates, nestedCandidates);
137
+ } else {
138
+ candidates.push({
139
+ scopeParent: element,
140
+ candidates: nestedCandidates
141
+ });
142
+ }
143
+ } else {
144
+ // check candidate element
145
+ var validCandidate = matches.call(element, candidateSelector);
146
+ if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
147
+ candidates.push(element);
148
+ }
149
+
150
+ // iterate over shadow content if possible
151
+ var shadowRoot = element.shadowRoot ||
152
+ // check for an undisclosed shadow
153
+ typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
154
+
155
+ // no inert look up because we're already drilling down and checking for inertness
156
+ // on the way down, so all containers to this root node should have already been
157
+ // vetted as non-inert
158
+ var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
159
+ if (shadowRoot && validShadowRoot) {
160
+ // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
161
+ // shadow exists, so look at light dom children as fallback BUT create a scope for any
162
+ // child candidates found because they're likely slotted elements (elements that are
163
+ // children of the web component element (which has the shadow), in the light dom, but
164
+ // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
165
+ // _after_ we return from this recursive call
166
+ var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
167
+ if (options.flatten) {
168
+ candidates.push.apply(candidates, _nestedCandidates);
169
+ } else {
170
+ candidates.push({
171
+ scopeParent: element,
172
+ candidates: _nestedCandidates
173
+ });
174
+ }
175
+ } else {
176
+ // there's not shadow so just dig into the element's (light dom) children
177
+ // __without__ giving the element special scope treatment
178
+ elementsToCheck.unshift.apply(elementsToCheck, element.children);
179
+ }
180
+ }
181
+ }
182
+ return candidates;
183
+ };
184
+
185
+ /**
186
+ * @private
187
+ * Determines if the node has an explicitly specified `tabindex` attribute.
188
+ * @param {HTMLElement} node
189
+ * @returns {boolean} True if so; false if not.
190
+ */
191
+ var hasTabIndex = function hasTabIndex(node) {
192
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
193
+ };
194
+
195
+ /**
196
+ * Determine the tab index of a given node.
197
+ * @param {HTMLElement} node
198
+ * @returns {number} Tab order (negative, 0, or positive number).
199
+ * @throws {Error} If `node` is falsy.
200
+ */
201
+ var getTabIndex = function getTabIndex(node) {
202
+ if (!node) {
203
+ throw new Error('No node provided');
204
+ }
205
+ if (node.tabIndex < 0) {
206
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
207
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
208
+ // yet they are still part of the regular tab order; in FF, they get a default
209
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
210
+ // order, consider their tab index to be 0.
211
+ // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
212
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
213
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
214
+ return 0;
215
+ }
216
+ }
217
+ return node.tabIndex;
218
+ };
219
+
220
+ /**
221
+ * Determine the tab index of a given node __for sort order purposes__.
222
+ * @param {HTMLElement} node
223
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
224
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
225
+ * inserted into the correct sort position.
226
+ * @returns {number} Tab order (negative, 0, or positive number).
227
+ */
228
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
229
+ var tabIndex = getTabIndex(node);
230
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
231
+ return 0;
232
+ }
233
+ return tabIndex;
234
+ };
235
+ var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
236
+ return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
237
+ };
238
+ var isInput = function isInput(node) {
239
+ return node.tagName === 'INPUT';
240
+ };
241
+ var isHiddenInput = function isHiddenInput(node) {
242
+ return isInput(node) && node.type === 'hidden';
243
+ };
244
+ var isDetailsWithSummary = function isDetailsWithSummary(node) {
245
+ var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
246
+ return child.tagName === 'SUMMARY';
247
+ });
248
+ return r;
249
+ };
250
+ var getCheckedRadio = function getCheckedRadio(nodes, form) {
251
+ for (var i = 0; i < nodes.length; i++) {
252
+ if (nodes[i].checked && nodes[i].form === form) {
253
+ return nodes[i];
254
+ }
255
+ }
256
+ };
257
+ var isTabbableRadio = function isTabbableRadio(node) {
258
+ if (!node.name) {
259
+ return true;
260
+ }
261
+ var radioScope = node.form || getRootNode(node);
262
+ var queryRadios = function queryRadios(name) {
263
+ return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
264
+ };
265
+ var radioSet;
266
+ if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
267
+ radioSet = queryRadios(window.CSS.escape(node.name));
268
+ } else {
269
+ try {
270
+ radioSet = queryRadios(node.name);
271
+ } catch (err) {
272
+ // eslint-disable-next-line no-console
273
+ console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
274
+ return false;
275
+ }
276
+ }
277
+ var checked = getCheckedRadio(radioSet, node.form);
278
+ return !checked || checked === node;
279
+ };
280
+ var isRadio = function isRadio(node) {
281
+ return isInput(node) && node.type === 'radio';
282
+ };
283
+ var isNonTabbableRadio = function isNonTabbableRadio(node) {
284
+ return isRadio(node) && !isTabbableRadio(node);
285
+ };
286
+
287
+ // determines if a node is ultimately attached to the window's document
288
+ var isNodeAttached = function isNodeAttached(node) {
289
+ var _nodeRoot;
290
+ // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
291
+ // (but NOT _the_ document; see second 'If' comment below for more).
292
+ // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
293
+ // is attached, and the one we need to check if it's in the document or not (because the
294
+ // shadow, and all nodes it contains, is never considered in the document since shadows
295
+ // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
296
+ // is hidden, or is not in the document itself but is detached, it will affect the shadow's
297
+ // visibility, including all the nodes it contains). The host could be any normal node,
298
+ // or a custom element (i.e. web component). Either way, that's the one that is considered
299
+ // part of the document, not the shadow root, nor any of its children (i.e. the node being
300
+ // tested).
301
+ // To further complicate things, we have to look all the way up until we find a shadow HOST
302
+ // that is attached (or find none) because the node might be in nested shadows...
303
+ // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
304
+ // document (per the docs) and while it's a Document-type object, that document does not
305
+ // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
306
+ // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
307
+ // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
308
+ // node is actually detached.
309
+ // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible
310
+ // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed
311
+ // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
312
+ // `ownerDocument` will be `null`, hence the optional chaining on it.
313
+ var nodeRoot = node && getRootNode(node);
314
+ var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
315
+
316
+ // in some cases, a detached node will return itself as the root instead of a document or
317
+ // shadow root object, in which case, we shouldn't try to look further up the host chain
318
+ var attached = false;
319
+ if (nodeRoot && nodeRoot !== node) {
320
+ var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
321
+ attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
322
+ while (!attached && nodeRootHost) {
323
+ var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
324
+ // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
325
+ // which means we need to get the host's host and check if that parent host is contained
326
+ // in (i.e. attached to) the document
327
+ nodeRoot = getRootNode(nodeRootHost);
328
+ nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
329
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
330
+ }
331
+ }
332
+ return attached;
333
+ };
334
+ var isZeroArea = function isZeroArea(node) {
335
+ var _node$getBoundingClie = node.getBoundingClientRect(),
336
+ width = _node$getBoundingClie.width,
337
+ height = _node$getBoundingClie.height;
338
+ return width === 0 && height === 0;
339
+ };
340
+ var isHidden = function isHidden(node, _ref) {
341
+ var displayCheck = _ref.displayCheck,
342
+ getShadowRoot = _ref.getShadowRoot;
343
+ if (displayCheck === 'full-native') {
344
+ if ('checkVisibility' in node) {
345
+ // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
346
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
347
+ var visible = node.checkVisibility({
348
+ // Checking opacity might be desirable for some use cases, but natively,
349
+ // opacity zero elements _are_ focusable and tabbable.
350
+ checkOpacity: false,
351
+ opacityProperty: false,
352
+ contentVisibilityAuto: true,
353
+ visibilityProperty: true,
354
+ // This is an alias for `visibilityProperty`. Contemporary browsers
355
+ // support both. However, this alias has wider browser support (Chrome
356
+ // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
357
+ // we include it anyway.
358
+ checkVisibilityCSS: true
359
+ });
360
+ return !visible;
361
+ }
362
+ // Fall through to manual visibility checks
363
+ }
364
+
365
+ // NOTE: visibility will be `undefined` if node is detached from the document
366
+ // (see notes about this further down), which means we will consider it visible
367
+ // (this is legacy behavior from a very long way back)
368
+ // NOTE: we check this regardless of `displayCheck="none"` because this is a
369
+ // _visibility_ check, not a _display_ check
370
+ var _getComputedStyle = getComputedStyle(node),
371
+ visibility = _getComputedStyle.visibility;
372
+ if (visibility === 'hidden' || visibility === 'collapse') {
373
+ return true;
374
+ }
375
+ var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
376
+ var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
377
+ if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
378
+ return true;
379
+ }
380
+ if (!displayCheck || displayCheck === 'full' ||
381
+ // full-native can run this branch when it falls through in case
382
+ // Element#checkVisibility is unsupported
383
+ displayCheck === 'full-native' || displayCheck === 'legacy-full') {
384
+ if (typeof getShadowRoot === 'function') {
385
+ // figure out if we should consider the node to be in an undisclosed shadow and use the
386
+ // 'non-zero-area' fallback
387
+ var originalNode = node;
388
+ while (node) {
389
+ var parentElement = node.parentElement;
390
+ var rootNode = getRootNode(node);
391
+ if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
392
+ ) {
393
+ // node has an undisclosed shadow which means we can only treat it as a black box, so we
394
+ // fall back to a non-zero-area test
395
+ return isZeroArea(node);
396
+ } else if (node.assignedSlot) {
397
+ // iterate up slot
398
+ node = node.assignedSlot;
399
+ } else if (!parentElement && rootNode !== node.ownerDocument) {
400
+ // cross shadow boundary
401
+ node = rootNode.host;
402
+ } else {
403
+ // iterate up normal dom
404
+ node = parentElement;
405
+ }
406
+ }
407
+ node = originalNode;
408
+ }
409
+ // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
410
+ // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
411
+ // it might be a falsy value, which means shadow DOM support is disabled
412
+
413
+ // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
414
+ // now we can just test to see if it would normally be visible or not, provided it's
415
+ // attached to the main document.
416
+ // NOTE: We must consider case where node is inside a shadow DOM and given directly to
417
+ // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
418
+
419
+ if (isNodeAttached(node)) {
420
+ // this works wherever the node is: if there's at least one client rect, it's
421
+ // somehow displayed; it also covers the CSS 'display: contents' case where the
422
+ // node itself is hidden in place of its contents; and there's no need to search
423
+ // up the hierarchy either
424
+ return !node.getClientRects().length;
425
+ }
426
+
427
+ // Else, the node isn't attached to the document, which means the `getClientRects()`
428
+ // API will __always__ return zero rects (this can happen, for example, if React
429
+ // is used to render nodes onto a detached tree, as confirmed in this thread:
430
+ // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
431
+ //
432
+ // It also means that even window.getComputedStyle(node).display will return `undefined`
433
+ // because styles are only computed for nodes that are in the document.
434
+ //
435
+ // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
436
+ // somehow. Though it was never stated officially, anyone who has ever used tabbable
437
+ // APIs on nodes in detached containers has actually implicitly used tabbable in what
438
+ // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
439
+ // considering __everything__ to be visible because of the innability to determine styles.
440
+ //
441
+ // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
442
+ // nodes as visible with the 'none' fallback.__
443
+ if (displayCheck !== 'legacy-full') {
444
+ return true; // hidden
445
+ }
446
+ // else, fallback to 'none' mode and consider the node visible
447
+ } else if (displayCheck === 'non-zero-area') {
448
+ // NOTE: Even though this tests that the node's client rect is non-zero to determine
449
+ // whether it's displayed, and that a detached node will __always__ have a zero-area
450
+ // client rect, we don't special-case for whether the node is attached or not. In
451
+ // this mode, we do want to consider nodes that have a zero area to be hidden at all
452
+ // times, and that includes attached or not.
453
+ return isZeroArea(node);
454
+ }
455
+
456
+ // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
457
+ // it's visible
458
+ return false;
459
+ };
460
+
461
+ // form fields (nested) inside a disabled fieldset are not focusable/tabbable
462
+ // unless they are in the _first_ <legend> element of the top-most disabled
463
+ // fieldset
464
+ var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
465
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
466
+ var parentNode = node.parentElement;
467
+ // check if `node` is contained in a disabled <fieldset>
468
+ while (parentNode) {
469
+ if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
470
+ // look for the first <legend> among the children of the disabled <fieldset>
471
+ for (var i = 0; i < parentNode.children.length; i++) {
472
+ var child = parentNode.children.item(i);
473
+ // when the first <legend> (in document order) is found
474
+ if (child.tagName === 'LEGEND') {
475
+ // if its parent <fieldset> is not nested in another disabled <fieldset>,
476
+ // return whether `node` is a descendant of its first <legend>
477
+ return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
478
+ }
479
+ }
480
+ // the disabled <fieldset> containing `node` has no <legend>
481
+ return true;
482
+ }
483
+ parentNode = parentNode.parentElement;
484
+ }
485
+ }
486
+
487
+ // else, node's tabbable/focusable state should not be affected by a fieldset's
488
+ // enabled/disabled state
489
+ return false;
490
+ };
491
+ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
492
+ if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||
493
+ // For a details element with a summary, the summary element gets the focus
494
+ isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
495
+ return false;
496
+ }
497
+ return true;
498
+ };
499
+ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
500
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
501
+ return false;
502
+ }
503
+ return true;
504
+ };
505
+ var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {
506
+ var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
507
+ if (isNaN(tabIndex) || tabIndex >= 0) {
508
+ return true;
509
+ }
510
+ // If a custom element has an explicit negative tabindex,
511
+ // browsers will not allow tab targeting said element's children.
512
+ return false;
513
+ };
514
+
515
+ /**
516
+ * @param {Array.<Element|CandidateScope>} candidates
517
+ * @returns Element[]
518
+ */
519
+ var _sortByOrder = function sortByOrder(candidates) {
520
+ var regularTabbables = [];
521
+ var orderedTabbables = [];
522
+ candidates.forEach(function (item, i) {
523
+ var isScope = !!item.scopeParent;
524
+ var element = isScope ? item.scopeParent : item;
525
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
526
+ var elements = isScope ? _sortByOrder(item.candidates) : element;
527
+ if (candidateTabindex === 0) {
528
+ isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
529
+ } else {
530
+ orderedTabbables.push({
531
+ documentOrder: i,
532
+ tabIndex: candidateTabindex,
533
+ item: item,
534
+ isScope: isScope,
535
+ content: elements
536
+ });
537
+ }
538
+ });
539
+ return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
540
+ sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
541
+ return acc;
542
+ }, []).concat(regularTabbables);
543
+ };
544
+ var tabbable = function tabbable(container, options) {
545
+ options = options || {};
546
+ var candidates;
547
+ if (options.getShadowRoot) {
548
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
549
+ filter: isNodeMatchingSelectorTabbable.bind(null, options),
550
+ flatten: false,
551
+ getShadowRoot: options.getShadowRoot,
552
+ shadowRootFilter: isShadowRootTabbable
553
+ });
554
+ } else {
555
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
556
+ }
557
+ return _sortByOrder(candidates);
558
+ };
559
+ var focusable = function focusable(container, options) {
560
+ options = options || {};
561
+ var candidates;
562
+ if (options.getShadowRoot) {
563
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
564
+ filter: isNodeMatchingSelectorFocusable.bind(null, options),
565
+ flatten: true,
566
+ getShadowRoot: options.getShadowRoot
567
+ });
568
+ } else {
569
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
570
+ }
571
+ return candidates;
572
+ };
573
+ var isTabbable = function isTabbable(node, options) {
574
+ options = options || {};
575
+ if (!node) {
576
+ throw new Error('No node provided');
577
+ }
578
+ if (matches.call(node, candidateSelector) === false) {
579
+ return false;
580
+ }
581
+ return isNodeMatchingSelectorTabbable(options, node);
582
+ };
583
+ var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe:not([inert]):not([inert] *)').join(',');
584
+ var isFocusable = function isFocusable(node, options) {
585
+ options = options || {};
586
+ if (!node) {
587
+ throw new Error('No node provided');
588
+ }
589
+ if (matches.call(node, focusableCandidateSelector) === false) {
590
+ return false;
591
+ }
592
+ return isNodeMatchingSelectorFocusable(options, node);
593
+ };
594
+
595
+ /*!
596
+ * focus-trap 8.2.2
597
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
598
+ */
599
+
600
+ function _arrayLikeToArray(r, a) {
601
+ (null == a || a > r.length) && (a = r.length);
602
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
603
+ return n;
604
+ }
605
+ function _arrayWithoutHoles(r) {
606
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
607
+ }
608
+ function _createForOfIteratorHelper(r, e) {
609
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
610
+ if (!t) {
611
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
612
+ t && (r = t);
613
+ var n = 0,
614
+ F = function () {};
615
+ return {
616
+ s: F,
617
+ n: function () {
618
+ return n >= r.length ? {
619
+ done: true
620
+ } : {
621
+ done: false,
622
+ value: r[n++]
623
+ };
624
+ },
625
+ e: function (r) {
626
+ throw r;
627
+ },
628
+ f: F
629
+ };
630
+ }
631
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
632
+ }
633
+ var o,
634
+ a = true,
635
+ u = false;
636
+ return {
637
+ s: function () {
638
+ t = t.call(r);
639
+ },
640
+ n: function () {
641
+ var r = t.next();
642
+ return a = r.done, r;
643
+ },
644
+ e: function (r) {
645
+ u = true, o = r;
646
+ },
647
+ f: function () {
648
+ try {
649
+ a || null == t.return || t.return();
650
+ } finally {
651
+ if (u) throw o;
652
+ }
653
+ }
654
+ };
655
+ }
656
+ function _defineProperty(e, r, t) {
657
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
658
+ value: t,
659
+ enumerable: true,
660
+ configurable: true,
661
+ writable: true
662
+ }) : e[r] = t, e;
663
+ }
664
+ function _iterableToArray(r) {
665
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
666
+ }
667
+ function _nonIterableSpread() {
668
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
669
+ }
670
+ function ownKeys(e, r) {
671
+ var t = Object.keys(e);
672
+ if (Object.getOwnPropertySymbols) {
673
+ var o = Object.getOwnPropertySymbols(e);
674
+ r && (o = o.filter(function (r) {
675
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
676
+ })), t.push.apply(t, o);
677
+ }
678
+ return t;
679
+ }
680
+ function _objectSpread2(e) {
681
+ for (var r = 1; r < arguments.length; r++) {
682
+ var t = null != arguments[r] ? arguments[r] : {};
683
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
684
+ _defineProperty(e, r, t[r]);
685
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
686
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
687
+ });
688
+ }
689
+ return e;
690
+ }
691
+ function _toConsumableArray(r) {
692
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
693
+ }
694
+ function _toPrimitive(t, r) {
695
+ if ("object" != typeof t || !t) return t;
696
+ var e = t[Symbol.toPrimitive];
697
+ if (void 0 !== e) {
698
+ var i = e.call(t, r);
699
+ if ("object" != typeof i) return i;
700
+ throw new TypeError("@@toPrimitive must return a primitive value.");
701
+ }
702
+ return ("string" === r ? String : Number)(t);
703
+ }
704
+ function _toPropertyKey(t) {
705
+ var i = _toPrimitive(t, "string");
706
+ return "symbol" == typeof i ? i : i + "";
707
+ }
708
+ function _unsupportedIterableToArray(r, a) {
709
+ if (r) {
710
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
711
+ var t = {}.toString.call(r).slice(8, -1);
712
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
713
+ }
714
+ }
715
+
716
+ var activeFocusTraps = {
717
+ // Returns the trap from the top of the stack.
718
+ getActiveTrap: function getActiveTrap(trapStack) {
719
+ if ((trapStack === null || trapStack === void 0 ? void 0 : trapStack.length) > 0) {
720
+ return trapStack[trapStack.length - 1];
721
+ }
722
+ return null;
723
+ },
724
+ // Pauses the currently active trap, then adds a new trap to the stack.
725
+ activateTrap: function activateTrap(trapStack, trap) {
726
+ var activeTrap = activeFocusTraps.getActiveTrap(trapStack);
727
+ if (trap !== activeTrap) {
728
+ activeFocusTraps.pauseTrap(trapStack);
729
+ }
730
+ var trapIndex = trapStack.indexOf(trap);
731
+ if (trapIndex === -1) {
732
+ trapStack.push(trap);
733
+ } else {
734
+ // move this existing trap to the front of the queue
735
+ trapStack.splice(trapIndex, 1);
736
+ trapStack.push(trap);
737
+ }
738
+ },
739
+ // Removes the trap from the top of the stack, then unpauses the next trap down.
740
+ deactivateTrap: function deactivateTrap(trapStack, trap) {
741
+ var trapIndex = trapStack.indexOf(trap);
742
+ if (trapIndex !== -1) {
743
+ trapStack.splice(trapIndex, 1);
744
+ }
745
+ activeFocusTraps.unpauseTrap(trapStack);
746
+ },
747
+ // Pauses the trap at the top of the stack.
748
+ pauseTrap: function pauseTrap(trapStack) {
749
+ var activeTrap = activeFocusTraps.getActiveTrap(trapStack);
750
+ activeTrap === null || activeTrap === void 0 || activeTrap._setPausedState(true);
751
+ },
752
+ // Unpauses the trap at the top of the stack.
753
+ unpauseTrap: function unpauseTrap(trapStack) {
754
+ var activeTrap = activeFocusTraps.getActiveTrap(trapStack);
755
+ if (activeTrap && !activeTrap._isManuallyPaused()) {
756
+ activeTrap._setPausedState(false);
757
+ }
758
+ }
759
+ };
760
+ var isSelectableInput = function isSelectableInput(node) {
761
+ return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
762
+ };
763
+ var isEscapeEvent = function isEscapeEvent(e) {
764
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
765
+ };
766
+ var isTabEvent = function isTabEvent(e) {
767
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
768
+ };
769
+
770
+ // checks for TAB by default
771
+ var isKeyForward = function isKeyForward(e) {
772
+ return isTabEvent(e) && !e.shiftKey;
773
+ };
774
+
775
+ // checks for SHIFT+TAB by default
776
+ var isKeyBackward = function isKeyBackward(e) {
777
+ return isTabEvent(e) && e.shiftKey;
778
+ };
779
+ var delay = function delay(fn) {
780
+ return setTimeout(fn, 0);
781
+ };
782
+
783
+ /**
784
+ * Get an option's value when it could be a plain value, or a handler that provides
785
+ * the value.
786
+ * @param {*} value Option's value to check.
787
+ * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
788
+ * @returns {*} The `value`, or the handler's returned value.
789
+ */
790
+ var valueOrHandler = function valueOrHandler(value) {
791
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
792
+ params[_key - 1] = arguments[_key];
793
+ }
794
+ return typeof value === 'function' ? value.apply(void 0, params) : value;
795
+ };
796
+ var getActualTarget = function getActualTarget(event) {
797
+ // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
798
+ // shadow host. However, event.target.composedPath() will be an array of
799
+ // nodes "clicked" from inner-most (the actual element inside the shadow) to
800
+ // outer-most (the host HTML document). If we have access to composedPath(),
801
+ // then use its first element; otherwise, fall back to event.target (and
802
+ // this only works for an _open_ shadow DOM; otherwise,
803
+ // composedPath()[0] === event.target always).
804
+ return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
805
+ };
806
+
807
+ // NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this
808
+ // current instance use the same stack if `userOptions.trapStack` isn't specified
809
+ var internalTrapStack = [];
810
+ var createFocusTrap = function createFocusTrap(elements, userOptions) {
811
+ // SSR: a live trap shouldn't be created in this type of environment so this
812
+ // should be safe code to execute if the `document` option isn't specified
813
+ var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
814
+ var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
815
+ var config = _objectSpread2({
816
+ returnFocusOnDeactivate: true,
817
+ escapeDeactivates: true,
818
+ delayInitialFocus: true,
819
+ delayReturnFocus: true,
820
+ isolateSubtrees: false,
821
+ isKeyForward: isKeyForward,
822
+ isKeyBackward: isKeyBackward
823
+ }, userOptions);
824
+ var state = {
825
+ // containers given to createFocusTrap()
826
+ /** @type {Array<HTMLElement>} */
827
+ containers: [],
828
+ // list of objects identifying tabbable nodes in `containers` in the trap
829
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
830
+ // is active, but the trap should never get to a state where there isn't at least one group
831
+ // with at least one tabbable node in it (that would lead to an error condition that would
832
+ // result in an error being thrown)
833
+ /** @type {Array<{
834
+ * container: HTMLElement,
835
+ * tabbableNodes: Array<HTMLElement>, // empty if none
836
+ * focusableNodes: Array<HTMLElement>, // empty if none
837
+ * posTabIndexesFound: boolean,
838
+ * firstTabbableNode: HTMLElement|undefined,
839
+ * lastTabbableNode: HTMLElement|undefined,
840
+ * firstDomTabbableNode: HTMLElement|undefined,
841
+ * lastDomTabbableNode: HTMLElement|undefined,
842
+ * nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
843
+ * }>}
844
+ */
845
+ containerGroups: [],
846
+ // same order/length as `containers` list
847
+
848
+ // references to objects in `containerGroups`, but only those that actually have
849
+ // tabbable nodes in them
850
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
851
+ // the same length
852
+ tabbableGroups: [],
853
+ // references to nodes that are siblings to the ancestors of this trap's containers.
854
+ /** @type {Set<HTMLElement>} */
855
+ adjacentElements: new Set(),
856
+ // references to nodes that were inert or aria-hidden before the trap was activated.
857
+ /** @type {Set<HTMLElement>} */
858
+ alreadySilent: new Set(),
859
+ nodeFocusedBeforeActivation: null,
860
+ mostRecentlyFocusedNode: null,
861
+ active: false,
862
+ paused: false,
863
+ manuallyPaused: false,
864
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
865
+ // has been delayed during activation
866
+ delayInitialFocusTimer: undefined,
867
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
868
+ recentNavEvent: undefined
869
+ };
870
+ var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
871
+
872
+ /**
873
+ * Gets a configuration option value.
874
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
875
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
876
+ * @param {string} optionName Name of the option whose value is sought.
877
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
878
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
879
+ */
880
+ var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
881
+ return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
882
+ };
883
+
884
+ /**
885
+ * Finds the index of the container that contains the element.
886
+ * @param {HTMLElement} element
887
+ * @param {Event} [event] If available, and `element` isn't directly found in any container,
888
+ * the event's composed path is used to see if includes any known trap containers in the
889
+ * case where the element is inside a Shadow DOM.
890
+ * @returns {number} Index of the container in either `state.containers` or
891
+ * `state.containerGroups` (the order/length of these lists are the same); -1
892
+ * if the element isn't found.
893
+ */
894
+ var findContainerIndex = function findContainerIndex(element, event) {
895
+ var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === 'function' ? event.composedPath() : undefined;
896
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
897
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
898
+ // and we still need to find the element in there
899
+ return state.containerGroups.findIndex(function (_ref) {
900
+ var container = _ref.container,
901
+ tabbableNodes = _ref.tabbableNodes;
902
+ return container.contains(element) || (// fall back to explicit tabbable search which will take into consideration any
903
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
904
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
905
+ // look inside web components even if open)
906
+ composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function (node) {
907
+ return node === element;
908
+ });
909
+ });
910
+ };
911
+
912
+ /**
913
+ * Gets the node for the given option, which is expected to be an option that
914
+ * can be either a DOM node, a string that is a selector to get a node, `false`
915
+ * (if a node is explicitly NOT given), or a function that returns any of these
916
+ * values.
917
+ * @param {string} optionName
918
+ * @param {Object} options
919
+ * @param {boolean} [options.hasFallback] True if the option could be a selector string
920
+ * and the option allows for a fallback scenario in the case where the selector is
921
+ * valid but does not match a node (i.e. the queried node doesn't exist in the DOM).
922
+ * @param {Array} [options.params] Params to pass to the option if it's a function.
923
+ * @returns {undefined | null | false | HTMLElement | SVGElement} Returns
924
+ * `undefined` if the option is not specified; `null` if the option didn't resolve
925
+ * to a node but `options.hasFallback=true`, `false` if the option resolved to `false`
926
+ * (node explicitly not given); otherwise, the resolved DOM node.
927
+ * @throws {Error} If the option is set, not `false`, and is not, or does not
928
+ * resolve to a node, unless the option is a selector string and `options.hasFallback=true`.
929
+ */
930
+ var getNodeForOption = function getNodeForOption(optionName) {
931
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
932
+ _ref2$hasFallback = _ref2.hasFallback,
933
+ hasFallback = _ref2$hasFallback === void 0 ? false : _ref2$hasFallback,
934
+ _ref2$params = _ref2.params,
935
+ params = _ref2$params === void 0 ? [] : _ref2$params;
936
+ var optionValue = config[optionName];
937
+ if (typeof optionValue === 'function') {
938
+ optionValue = optionValue.apply(void 0, _toConsumableArray(params));
939
+ }
940
+ if (optionValue === true) {
941
+ optionValue = undefined; // use default value
942
+ }
943
+ if (!optionValue) {
944
+ if (optionValue === undefined || optionValue === false) {
945
+ return optionValue;
946
+ }
947
+ // else, empty string (invalid), null (invalid), 0 (invalid)
948
+
949
+ throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
950
+ }
951
+ var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
952
+
953
+ if (typeof optionValue === 'string') {
954
+ try {
955
+ node = doc.querySelector(optionValue); // resolve to node, or null if fails
956
+ } catch (err) {
957
+ throw new Error("`".concat(optionName, "` appears to be an invalid selector; error=\"").concat(err.message, "\""));
958
+ }
959
+ if (!node) {
960
+ if (!hasFallback) {
961
+ throw new Error("`".concat(optionName, "` as selector refers to no known node"));
962
+ }
963
+ // else, `node` MUST be `null` because that's what `Document.querySelector()` returns
964
+ // if the selector is valid but doesn't match anything
965
+ }
966
+ }
967
+ return node;
968
+ };
969
+
970
+ /**
971
+ * Gets the current activeElement. If it's a web-component and has open shadow-root
972
+ * it will recursively search inside shadow roots for the "true" activeElement.
973
+ *
974
+ * @param {Document | ShadowRoot} el
975
+ *
976
+ * @returns {HTMLElement|null} The element that currently has the focus. `null` if a focused element isn't found.
977
+ **/
978
+ var _getActiveElement = function getActiveElement(el) {
979
+ var activeElement = el.activeElement;
980
+ if (!activeElement) {
981
+ return null;
982
+ }
983
+ if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) {
984
+ return _getActiveElement(activeElement.shadowRoot);
985
+ }
986
+ return activeElement;
987
+ };
988
+ var getInitialFocusNode = function getInitialFocusNode() {
989
+ var node = getNodeForOption('initialFocus', {
990
+ hasFallback: true
991
+ });
992
+
993
+ // false explicitly indicates we want no initialFocus at all
994
+ if (node === false) {
995
+ return false;
996
+ }
997
+ if (node === undefined || node && !isFocusable(node, config.tabbableOptions)) {
998
+ var activeElement = _getActiveElement(doc);
999
+
1000
+ // option not specified nor focusable: use fallback options
1001
+ if (findContainerIndex(activeElement) >= 0) {
1002
+ node = activeElement;
1003
+ } else {
1004
+ var firstTabbableGroup = state.tabbableGroups[0];
1005
+ var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
1006
+
1007
+ // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
1008
+ node = firstTabbableNode || getNodeForOption('fallbackFocus');
1009
+ }
1010
+ } else if (node === null) {
1011
+ // option is a VALID selector string that doesn't yield a node: use the `fallbackFocus`
1012
+ // option instead of the default behavior when the option isn't specified at all
1013
+ node = getNodeForOption('fallbackFocus');
1014
+ }
1015
+ if (!node) {
1016
+ throw new Error('Your focus-trap needs to have at least one focusable element');
1017
+ }
1018
+ return node;
1019
+ };
1020
+ var updateTabbableNodes = function updateTabbableNodes() {
1021
+ state.containerGroups = state.containers.map(function (container) {
1022
+ var tabbableNodes = tabbable(container, config.tabbableOptions);
1023
+
1024
+ // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
1025
+ // are a superset of tabbable nodes since nodes with negative `tabindex` attributes
1026
+ // are focusable but not tabbable
1027
+ var focusableNodes = focusable(container, config.tabbableOptions);
1028
+ var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
1029
+ var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
1030
+ var firstDomTabbableNode = focusableNodes.find(function (node) {
1031
+ return isTabbable(node);
1032
+ });
1033
+ var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
1034
+ return isTabbable(node);
1035
+ });
1036
+ var posTabIndexesFound = !!tabbableNodes.find(function (node) {
1037
+ return getTabIndex(node) > 0;
1038
+ });
1039
+ return {
1040
+ container: container,
1041
+ tabbableNodes: tabbableNodes,
1042
+ focusableNodes: focusableNodes,
1043
+ /** True if at least one node with positive `tabindex` was found in this container. */
1044
+ posTabIndexesFound: posTabIndexesFound,
1045
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
1046
+ firstTabbableNode: firstTabbableNode,
1047
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
1048
+ lastTabbableNode: lastTabbableNode,
1049
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
1050
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
1051
+ // because that API doesn't work with Shadow DOM as well as it should (@see
1052
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
1053
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
1054
+ // "close enough most of the time" alternative for positive tabindexes which should generally
1055
+ // be avoided anyway...
1056
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
1057
+ firstDomTabbableNode: firstDomTabbableNode,
1058
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
1059
+ lastDomTabbableNode: lastDomTabbableNode,
1060
+ /**
1061
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
1062
+ * in this container, if any.
1063
+ * @param {HTMLElement} node
1064
+ * @param {boolean} [forward] True if going in forward tab order; false if going
1065
+ * in reverse.
1066
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
1067
+ */
1068
+ nextTabbableNode: function nextTabbableNode(node) {
1069
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1070
+ var nodeIdx = tabbableNodes.indexOf(node);
1071
+ if (nodeIdx < 0) {
1072
+ // either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
1073
+ // since `node` should at least have been focusable, we assume that's the case and mimic
1074
+ // what browsers do, which is set focus to the next node in __document position order__,
1075
+ // regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
1076
+ // above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
1077
+ // basic DOM order
1078
+ if (forward) {
1079
+ return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
1080
+ return isTabbable(el);
1081
+ });
1082
+ }
1083
+ return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
1084
+ return isTabbable(el);
1085
+ });
1086
+ }
1087
+ return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
1088
+ }
1089
+ };
1090
+ });
1091
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
1092
+ return group.tabbableNodes.length > 0;
1093
+ });
1094
+
1095
+ // throw if no groups have tabbable nodes and we don't have a fallback focus node either
1096
+ if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
1097
+ ) {
1098
+ throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
1099
+ }
1100
+
1101
+ // NOTE: Positive tabindexes are only properly supported in single-container traps because
1102
+ // doing it across multiple containers where tabindexes could be all over the place
1103
+ // would require Tabbable to support multiple containers, would require additional
1104
+ // specialized Shadow DOM support, and would require Tabbable's multi-container support
1105
+ // to look at those containers in document position order rather than user-provided
1106
+ // order (as they are treated in Focus-trap, for legacy reasons). See discussion on
1107
+ // https://github.com/focus-trap/focus-trap/issues/375 for more details.
1108
+ if (state.containerGroups.find(function (g) {
1109
+ return g.posTabIndexesFound;
1110
+ }) && state.containerGroups.length > 1) {
1111
+ throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
1112
+ }
1113
+ };
1114
+ var _tryFocus = function tryFocus(node) {
1115
+ if (node === false) {
1116
+ return;
1117
+ }
1118
+ if (node === _getActiveElement(document)) {
1119
+ return;
1120
+ }
1121
+ if (!node || !node.focus) {
1122
+ _tryFocus(getInitialFocusNode());
1123
+ return;
1124
+ }
1125
+ node.focus({
1126
+ preventScroll: !!config.preventScroll
1127
+ });
1128
+ // NOTE: focus() API does not trigger focusIn event so set MRU node manually
1129
+ state.mostRecentlyFocusedNode = node;
1130
+ if (isSelectableInput(node)) {
1131
+ node.select();
1132
+ }
1133
+ };
1134
+ var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
1135
+ var node = getNodeForOption('setReturnFocus', {
1136
+ params: [previousActiveElement]
1137
+ });
1138
+ return node ? node : node === false ? false : previousActiveElement;
1139
+ };
1140
+
1141
+ /**
1142
+ * Finds the next node (in either direction) where focus should move according to a
1143
+ * keyboard focus-in event.
1144
+ * @param {Object} params
1145
+ * @param {Node} [params.target] Known target __from which__ to navigate, if any.
1146
+ * @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
1147
+ * will be used to determine the `target`). Ignored if `target` is specified.
1148
+ * @param {boolean} [params.isBackward] True if focus should move backward.
1149
+ * @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
1150
+ * determined given the current state of the trap.
1151
+ */
1152
+ var findNextNavNode = function findNextNavNode(_ref3) {
1153
+ var target = _ref3.target,
1154
+ event = _ref3.event,
1155
+ _ref3$isBackward = _ref3.isBackward,
1156
+ isBackward = _ref3$isBackward === void 0 ? false : _ref3$isBackward;
1157
+ target = target || getActualTarget(event);
1158
+ updateTabbableNodes();
1159
+ var destinationNode = null;
1160
+ if (state.tabbableGroups.length > 0) {
1161
+ // make sure the target is actually contained in a group
1162
+ // NOTE: the target may also be the container itself if it's focusable
1163
+ // with tabIndex='-1' and was given initial focus
1164
+ var containerIndex = findContainerIndex(target, event);
1165
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
1166
+ if (containerIndex < 0) {
1167
+ // target not found in any group: quite possible focus has escaped the trap,
1168
+ // so bring it back into...
1169
+ if (isBackward) {
1170
+ // ...the last node in the last group
1171
+ destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
1172
+ } else {
1173
+ // ...the first node in the first group
1174
+ destinationNode = state.tabbableGroups[0].firstTabbableNode;
1175
+ }
1176
+ } else if (isBackward) {
1177
+ // REVERSE
1178
+
1179
+ // is the target the first tabbable node in a group?
1180
+ var startOfGroupIndex = state.tabbableGroups.findIndex(function (_ref4) {
1181
+ var firstTabbableNode = _ref4.firstTabbableNode;
1182
+ return target === firstTabbableNode;
1183
+ });
1184
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
1185
+ // an exception case where the target is either the container itself, or
1186
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
1187
+ // and user clicked on it or node was programmatically given focus)
1188
+ // and is not followed by any other tabbable node, in which
1189
+ // case, we should handle shift+tab as if focus were on the container's
1190
+ // first tabbable node, and go to the last tabbable node of the LAST group
1191
+ startOfGroupIndex = containerIndex;
1192
+ }
1193
+ if (startOfGroupIndex >= 0) {
1194
+ // YES: then shift+tab should go to the last tabbable node in the
1195
+ // previous group (and wrap around to the last tabbable node of
1196
+ // the LAST group if it's the first tabbable node of the FIRST group)
1197
+ var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
1198
+ var destinationGroup = state.tabbableGroups[destinationGroupIndex];
1199
+ destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
1200
+ } else if (!isTabEvent(event)) {
1201
+ // user must have customized the nav keys so we have to move focus manually _within_
1202
+ // the active group: do this based on the order determined by tabbable()
1203
+ destinationNode = containerGroup.nextTabbableNode(target, false);
1204
+ }
1205
+ } else {
1206
+ // FORWARD
1207
+
1208
+ // is the target the last tabbable node in a group?
1209
+ var lastOfGroupIndex = state.tabbableGroups.findIndex(function (_ref5) {
1210
+ var lastTabbableNode = _ref5.lastTabbableNode;
1211
+ return target === lastTabbableNode;
1212
+ });
1213
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
1214
+ // an exception case where the target is the container itself, or
1215
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
1216
+ // and user clicked on it or node was programmatically given focus)
1217
+ // and is not followed by any other tabbable node, in which
1218
+ // case, we should handle tab as if focus were on the container's
1219
+ // last tabbable node, and go to the first tabbable node of the FIRST group
1220
+ lastOfGroupIndex = containerIndex;
1221
+ }
1222
+ if (lastOfGroupIndex >= 0) {
1223
+ // YES: then tab should go to the first tabbable node in the next
1224
+ // group (and wrap around to the first tabbable node of the FIRST
1225
+ // group if it's the last tabbable node of the LAST group)
1226
+ var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
1227
+ var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
1228
+ destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
1229
+ } else if (!isTabEvent(event)) {
1230
+ // user must have customized the nav keys so we have to move focus manually _within_
1231
+ // the active group: do this based on the order determined by tabbable()
1232
+ destinationNode = containerGroup.nextTabbableNode(target);
1233
+ }
1234
+ }
1235
+ } else {
1236
+ // no groups available
1237
+ // NOTE: the fallbackFocus option does not support returning false to opt-out
1238
+ destinationNode = getNodeForOption('fallbackFocus');
1239
+ }
1240
+ return destinationNode;
1241
+ };
1242
+
1243
+ // This needs to be done on mousedown and touchstart instead of click
1244
+ // so that it precedes the focus event.
1245
+ var checkPointerDown = function checkPointerDown(e) {
1246
+ var target = getActualTarget(e);
1247
+ if (findContainerIndex(target, e) >= 0) {
1248
+ // allow the click since it occurred inside the trap
1249
+ return;
1250
+ }
1251
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
1252
+ // immediately deactivate the trap
1253
+ trap.deactivate({
1254
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
1255
+ // which will result in the outside click setting focus to the node
1256
+ // that was clicked (and if not focusable, to "nothing"); by setting
1257
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
1258
+ // on activation (or the configured `setReturnFocus` node), whether the
1259
+ // outside click was on a focusable node or not
1260
+ returnFocus: config.returnFocusOnDeactivate
1261
+ });
1262
+ return;
1263
+ }
1264
+
1265
+ // This is needed for mobile devices.
1266
+ // (If we'll only let `click` events through,
1267
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
1268
+ if (valueOrHandler(config.allowOutsideClick, e)) {
1269
+ // allow the click outside the trap to take place
1270
+ return;
1271
+ }
1272
+
1273
+ // otherwise, prevent the click
1274
+ e.preventDefault();
1275
+ };
1276
+
1277
+ // In case focus escapes the trap for some strange reason, pull it back in.
1278
+ // NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
1279
+ // scrolling if the node that got focused was out of view; there's nothing we can do to
1280
+ // prevent that from happening by the time we discover that focus escaped
1281
+ var checkFocusIn = function checkFocusIn(event) {
1282
+ var target = getActualTarget(event);
1283
+ var targetContained = findContainerIndex(target, event) >= 0;
1284
+
1285
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
1286
+ if (targetContained || target instanceof Document) {
1287
+ if (targetContained) {
1288
+ state.mostRecentlyFocusedNode = target;
1289
+ }
1290
+ } else {
1291
+ // escaped! pull it back in to where it just left
1292
+ event.stopImmediatePropagation();
1293
+
1294
+ // focus will escape if the MRU node had a positive tab index and user tried to nav forward;
1295
+ // it will also escape if the MRU node had a 0 tab index and user tried to nav backward
1296
+ // toward a node with a positive tab index
1297
+ var nextNode; // next node to focus, if we find one
1298
+ var navAcrossContainers = true;
1299
+ if (state.mostRecentlyFocusedNode) {
1300
+ if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
1301
+ // MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
1302
+ var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
1303
+ // there MAY not be any tabbable nodes in the container if there are at least 2 containers
1304
+ // and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
1305
+ // with at least one tabbable node in order to function, so this could be the other container
1306
+ // with nothing tabbable in it)
1307
+ var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
1308
+ if (tabbableNodes.length > 0) {
1309
+ // MRU tab index MAY not be found if the MRU node is focusable but not tabbable
1310
+ var mruTabIdx = tabbableNodes.findIndex(function (node) {
1311
+ return node === state.mostRecentlyFocusedNode;
1312
+ });
1313
+ if (mruTabIdx >= 0) {
1314
+ if (config.isKeyForward(state.recentNavEvent)) {
1315
+ if (mruTabIdx + 1 < tabbableNodes.length) {
1316
+ nextNode = tabbableNodes[mruTabIdx + 1];
1317
+ navAcrossContainers = false;
1318
+ }
1319
+ // else, don't wrap within the container as focus should move to next/previous
1320
+ // container
1321
+ } else {
1322
+ if (mruTabIdx - 1 >= 0) {
1323
+ nextNode = tabbableNodes[mruTabIdx - 1];
1324
+ navAcrossContainers = false;
1325
+ }
1326
+ // else, don't wrap within the container as focus should move to next/previous
1327
+ // container
1328
+ }
1329
+ // else, don't find in container order without considering direction too
1330
+ }
1331
+ }
1332
+ // else, no tabbable nodes in that container (which means we must have at least one other
1333
+ // container with at least one tabbable node in it, otherwise focus-trap would've thrown
1334
+ // an error the last time updateTabbableNodes() was run): find next node among all known
1335
+ // containers
1336
+ } else {
1337
+ // check to see if there's at least one tabbable node with a positive tab index inside
1338
+ // the trap because focus seems to escape when navigating backward from a tabbable node
1339
+ // with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
1340
+ // the greatest positive tab index like it should)
1341
+ if (!state.containerGroups.some(function (g) {
1342
+ return g.tabbableNodes.some(function (n) {
1343
+ return getTabIndex(n) > 0;
1344
+ });
1345
+ })) {
1346
+ // no containers with tabbable nodes with positive tab indexes which means the focus
1347
+ // escaped for some other reason and we should just execute the fallback to the
1348
+ // MRU node or initial focus node, if any
1349
+ navAcrossContainers = false;
1350
+ }
1351
+ }
1352
+ } else {
1353
+ // no MRU node means we're likely in some initial condition when the trap has just
1354
+ // been activated and initial focus hasn't been given yet, in which case we should
1355
+ // fall through to trying to focus the initial focus node, which is what should
1356
+ // happen below at this point in the logic
1357
+ navAcrossContainers = false;
1358
+ }
1359
+ if (navAcrossContainers) {
1360
+ nextNode = findNextNavNode({
1361
+ // move FROM the MRU node, not event-related node (which will be the node that is
1362
+ // outside the trap causing the focus escape we're trying to fix)
1363
+ target: state.mostRecentlyFocusedNode,
1364
+ isBackward: config.isKeyBackward(state.recentNavEvent)
1365
+ });
1366
+ }
1367
+ if (nextNode) {
1368
+ _tryFocus(nextNode);
1369
+ } else {
1370
+ _tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
1371
+ }
1372
+ }
1373
+ state.recentNavEvent = undefined; // clear
1374
+ };
1375
+
1376
+ // Hijack key nav events on the first and last focusable nodes of the trap,
1377
+ // in order to prevent focus from escaping. If it escapes for even a
1378
+ // moment it can end up scrolling the page and causing confusion so we
1379
+ // kind of need to capture the action at the keydown phase.
1380
+ var checkKeyNav = function checkKeyNav(event) {
1381
+ var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1382
+ state.recentNavEvent = event;
1383
+ var destinationNode = findNextNavNode({
1384
+ event: event,
1385
+ isBackward: isBackward
1386
+ });
1387
+ if (destinationNode) {
1388
+ if (isTabEvent(event)) {
1389
+ // since tab natively moves focus, we wouldn't have a destination node unless we
1390
+ // were on the edge of a container and had to move to the next/previous edge, in
1391
+ // which case we want to prevent default to keep the browser from moving focus
1392
+ // to where it normally would
1393
+ event.preventDefault();
1394
+ }
1395
+ _tryFocus(destinationNode);
1396
+ }
1397
+ // else, let the browser take care of [shift+]tab and move the focus
1398
+ };
1399
+ var checkTabKey = function checkTabKey(event) {
1400
+ if (config.isKeyForward(event) || config.isKeyBackward(event)) {
1401
+ checkKeyNav(event, config.isKeyBackward(event));
1402
+ }
1403
+ };
1404
+
1405
+ // we use a different event phase for the Escape key to allow canceling the event and checking for this in escapeDeactivates
1406
+ var checkEscapeKey = function checkEscapeKey(event) {
1407
+ if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) {
1408
+ event.preventDefault();
1409
+ trap.deactivate();
1410
+ }
1411
+ };
1412
+ var checkClick = function checkClick(e) {
1413
+ var target = getActualTarget(e);
1414
+ if (findContainerIndex(target, e) >= 0) {
1415
+ return;
1416
+ }
1417
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
1418
+ return;
1419
+ }
1420
+ if (valueOrHandler(config.allowOutsideClick, e)) {
1421
+ return;
1422
+ }
1423
+ e.preventDefault();
1424
+ e.stopImmediatePropagation();
1425
+ };
1426
+
1427
+ //
1428
+ // EVENT LISTENERS
1429
+ //
1430
+
1431
+ /**
1432
+ * Adds listeners to the document necessary for trapping focus and attempts to set focus
1433
+ * to the configured initial focus node. Does nothing if the trap isn't active.
1434
+ * @returns {Promise<void> | undefined} A promise resolved once the initial focus node has
1435
+ * been focused when `delayInitialFocus=true`; `undefined` when focus is set synchronously
1436
+ * or the trap isn't active.
1437
+ */
1438
+ var addListeners = function addListeners() {
1439
+ if (!state.active) {
1440
+ return;
1441
+ }
1442
+
1443
+ // There can be only one listening focus trap at a time
1444
+ activeFocusTraps.activateTrap(trapStack, trap);
1445
+
1446
+ // Delay ensures that the focused element doesn't capture the event
1447
+ // that caused the focus trap activation.
1448
+ /** @type {Promise<void> | undefined} */
1449
+ var promise;
1450
+ if (config.delayInitialFocus) {
1451
+ // NOTE: Promise constructor callback is called synchronously, which is what we want
1452
+ // since we need to capture the timer ID immediately
1453
+ promise = new Promise(function (resolve) {
1454
+ state.delayInitialFocusTimer = delay(function () {
1455
+ _tryFocus(getInitialFocusNode());
1456
+ resolve();
1457
+ });
1458
+ });
1459
+ } else {
1460
+ _tryFocus(getInitialFocusNode());
1461
+ }
1462
+ doc.addEventListener('focusin', checkFocusIn, true);
1463
+ doc.addEventListener('mousedown', checkPointerDown, {
1464
+ capture: true,
1465
+ passive: false
1466
+ });
1467
+ doc.addEventListener('touchstart', checkPointerDown, {
1468
+ capture: true,
1469
+ passive: false
1470
+ });
1471
+ doc.addEventListener('click', checkClick, {
1472
+ capture: true,
1473
+ passive: false
1474
+ });
1475
+ doc.addEventListener('keydown', checkTabKey, {
1476
+ capture: true,
1477
+ passive: false
1478
+ });
1479
+ doc.addEventListener('keydown', checkEscapeKey);
1480
+ return promise;
1481
+ };
1482
+
1483
+ /**
1484
+ * Traverses up the DOM from each of `containers`, collecting references to
1485
+ * the elements that are siblings to `container` or an ancestor of `container`.
1486
+ * @param {Array<HTMLElement>} containers
1487
+ */
1488
+ var collectAdjacentElements = function collectAdjacentElements(containers) {
1489
+ // Re-activate all adjacent elements & clear previous collection.
1490
+ if (state.active && !state.paused) {
1491
+ trap._setSubtreeIsolation(false);
1492
+ }
1493
+ state.adjacentElements.clear();
1494
+ state.alreadySilent.clear();
1495
+
1496
+ // Collect all ancestors of all containers to avoid redundant processing.
1497
+ var containerAncestors = new Set();
1498
+ var adjacentElements = new Set();
1499
+
1500
+ // Compile all elements adjacent to the focus trap containers & lineage.
1501
+ var _iterator = _createForOfIteratorHelper(containers),
1502
+ _step;
1503
+ try {
1504
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1505
+ var container = _step.value;
1506
+ containerAncestors.add(container);
1507
+ var insideShadowRoot = typeof ShadowRoot !== 'undefined' && container.getRootNode() instanceof ShadowRoot;
1508
+ var current = container;
1509
+ while (current) {
1510
+ containerAncestors.add(current);
1511
+ var parent = current.parentElement;
1512
+ var siblings = [];
1513
+ if (parent) {
1514
+ siblings = parent.children;
1515
+ } else if (!parent && insideShadowRoot) {
1516
+ siblings = current.getRootNode().children;
1517
+ parent = current.getRootNode().host;
1518
+ insideShadowRoot = typeof ShadowRoot !== 'undefined' && parent.getRootNode() instanceof ShadowRoot;
1519
+ }
1520
+
1521
+ // Add all the children, we'll remove container lineage later.
1522
+ var _iterator2 = _createForOfIteratorHelper(siblings),
1523
+ _step2;
1524
+ try {
1525
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1526
+ var child = _step2.value;
1527
+ adjacentElements.add(child);
1528
+ }
1529
+ } catch (err) {
1530
+ _iterator2.e(err);
1531
+ } finally {
1532
+ _iterator2.f();
1533
+ }
1534
+ current = parent;
1535
+ }
1536
+ }
1537
+
1538
+ // Multi-container traps may overlap.
1539
+ // Remove elements within container lineages.
1540
+ } catch (err) {
1541
+ _iterator.e(err);
1542
+ } finally {
1543
+ _iterator.f();
1544
+ }
1545
+ containerAncestors.forEach(function (el) {
1546
+ adjacentElements["delete"](el);
1547
+ });
1548
+ state.adjacentElements = adjacentElements;
1549
+ };
1550
+ var removeListeners = function removeListeners() {
1551
+ if (!state.active) {
1552
+ return;
1553
+ }
1554
+ doc.removeEventListener('focusin', checkFocusIn, true);
1555
+ doc.removeEventListener('mousedown', checkPointerDown, true);
1556
+ doc.removeEventListener('touchstart', checkPointerDown, true);
1557
+ doc.removeEventListener('click', checkClick, true);
1558
+ doc.removeEventListener('keydown', checkTabKey, true);
1559
+ doc.removeEventListener('keydown', checkEscapeKey);
1560
+ return trap;
1561
+ };
1562
+
1563
+ //
1564
+ // MUTATION OBSERVER
1565
+ //
1566
+
1567
+ var checkDomRemoval = function checkDomRemoval(mutations) {
1568
+ var focusedNode = state.mostRecentlyFocusedNode;
1569
+ if (!focusedNode) {
1570
+ return;
1571
+ }
1572
+ var isFocusedNodeRemoved = mutations.some(function (mutation) {
1573
+ var removedNodes = Array.from(mutation.removedNodes);
1574
+ return removedNodes.some(function (node) {
1575
+ return node === focusedNode || typeof node.contains === 'function' && node.contains(focusedNode);
1576
+ });
1577
+ });
1578
+
1579
+ // If the currently focused node is removed then browsers will move focus to the
1580
+ // <body> element. If this happens, try to move focus back into the trap.
1581
+ if (isFocusedNodeRemoved && state.containers.some(function (container) {
1582
+ return container === null || container === void 0 ? void 0 : container.isConnected;
1583
+ })) {
1584
+ // Refresh tabbable state before resolving initial focus because
1585
+ // getInitialFocusNode() may fall back to the first tabbable node in the trap.
1586
+ updateTabbableNodes();
1587
+ var initialFocusNode = getInitialFocusNode();
1588
+ _tryFocus(initialFocusNode);
1589
+ }
1590
+ };
1591
+
1592
+ // Use MutationObserver - if supported - to detect if focused node is removed
1593
+ // from the DOM.
1594
+ var mutationObserver = typeof window !== 'undefined' && 'MutationObserver' in window ? new MutationObserver(checkDomRemoval) : undefined;
1595
+ var updateObservedNodes = function updateObservedNodes() {
1596
+ if (!mutationObserver) {
1597
+ return;
1598
+ }
1599
+ mutationObserver.disconnect();
1600
+ if (state.active && !state.paused) {
1601
+ state.containers.map(function (container) {
1602
+ mutationObserver.observe(container, {
1603
+ subtree: true,
1604
+ childList: true
1605
+ });
1606
+ });
1607
+ }
1608
+ };
1609
+
1610
+ //
1611
+ // TRAP DEFINITION
1612
+ //
1613
+
1614
+ trap = {
1615
+ get active() {
1616
+ return state.active;
1617
+ },
1618
+ get paused() {
1619
+ return state.paused;
1620
+ },
1621
+ activate: function activate(activateOptions) {
1622
+ if (state.active) {
1623
+ return this;
1624
+ }
1625
+ var onActivate = getOption(activateOptions, 'onActivate');
1626
+ var onPostActivate = getOption(activateOptions, 'onPostActivate');
1627
+ var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
1628
+
1629
+ // If a currently-active trap is isolating its subtree, we need to remove
1630
+ // that isolation to allow the new trap to find tabbable nodes.
1631
+ var preexistingTrap = activeFocusTraps.getActiveTrap(trapStack);
1632
+ var revertState = false;
1633
+ if (preexistingTrap && !preexistingTrap.paused) {
1634
+ var _preexistingTrap$_set;
1635
+ // [#1729] method MAY not exist if using `trapStack` option to share stack with older
1636
+ // versions of Focus-trap in the same DOM so use optional chaining here just in case
1637
+ // since this is a trap we may not have created from this instance of the library
1638
+ (_preexistingTrap$_set = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set === void 0 || _preexistingTrap$_set.call(preexistingTrap, false);
1639
+ revertState = true;
1640
+ }
1641
+ try {
1642
+ if (!checkCanFocusTrap) {
1643
+ updateTabbableNodes();
1644
+ }
1645
+ state.active = true;
1646
+ state.paused = false;
1647
+ state.nodeFocusedBeforeActivation = _getActiveElement(doc);
1648
+ onActivate === null || onActivate === void 0 || onActivate({
1649
+ trap: trap
1650
+ });
1651
+ var finishActivation = function finishActivation() {
1652
+ if (checkCanFocusTrap) {
1653
+ updateTabbableNodes();
1654
+ }
1655
+ var afterListeners = function afterListeners() {
1656
+ trap._setSubtreeIsolation(true);
1657
+ updateObservedNodes();
1658
+ onPostActivate === null || onPostActivate === void 0 || onPostActivate({
1659
+ trap: trap
1660
+ });
1661
+ };
1662
+
1663
+ // NOTE: wait for initial focus node to get focused (whether activation is fully,
1664
+ // partially, or not asynchronous) before we potentially isolate the subtrees
1665
+ // with aria-hidden while focus is still in some other subtree and not yet in
1666
+ // the trap, resulting in some browsers (e.g. Chrome) logging to the console that
1667
+ // they, "Blocked aria-hidden on an element because its descendant retained focus..."
1668
+ var listenersPromise = addListeners();
1669
+ if (listenersPromise) {
1670
+ listenersPromise.then(afterListeners);
1671
+ } else {
1672
+ afterListeners();
1673
+ }
1674
+ };
1675
+ if (checkCanFocusTrap) {
1676
+ checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
1677
+ return this;
1678
+ }
1679
+ finishActivation();
1680
+ } catch (error) {
1681
+ // If our activation throws an exception and the stack hasn't changed,
1682
+ // we need to re-enable the prior trap's subtree isolation.
1683
+ if (preexistingTrap === activeFocusTraps.getActiveTrap(trapStack) && revertState) {
1684
+ var _preexistingTrap$_set2;
1685
+ // [#1729] method MAY not exist if using `trapStack` option to share stack with older
1686
+ // versions of Focus-trap in the same DOM so use optional chaining here just in case
1687
+ // since this is a trap we may not have created from this instance of the library
1688
+ (_preexistingTrap$_set2 = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set2 === void 0 || _preexistingTrap$_set2.call(preexistingTrap, true);
1689
+ }
1690
+ throw error;
1691
+ }
1692
+ return this;
1693
+ },
1694
+ deactivate: function deactivate(deactivateOptions) {
1695
+ if (!state.active) {
1696
+ return this;
1697
+ }
1698
+ var options = _objectSpread2({
1699
+ onDeactivate: config.onDeactivate,
1700
+ onPostDeactivate: config.onPostDeactivate,
1701
+ checkCanReturnFocus: config.checkCanReturnFocus
1702
+ }, deactivateOptions);
1703
+ clearTimeout(state.delayInitialFocusTimer); // noop if undefined
1704
+ state.delayInitialFocusTimer = undefined;
1705
+
1706
+ // Prior to removing this trap from the trapStack, we need to remove any applications of `inert`.
1707
+ // This allows the next trap down to update its tabbable nodes properly.
1708
+ //
1709
+ // If this trap is not top of the stack, don't change any current isolation.
1710
+ if (!state.paused) {
1711
+ trap._setSubtreeIsolation(false);
1712
+ }
1713
+ state.alreadySilent.clear();
1714
+ removeListeners();
1715
+ state.active = false;
1716
+ state.paused = false;
1717
+ updateObservedNodes();
1718
+ activeFocusTraps.deactivateTrap(trapStack, trap);
1719
+ var onDeactivate = getOption(options, 'onDeactivate');
1720
+ var onPostDeactivate = getOption(options, 'onPostDeactivate');
1721
+ var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
1722
+ var delayReturnFocus = getOption(options, 'delayReturnFocus');
1723
+ var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
1724
+ onDeactivate === null || onDeactivate === void 0 || onDeactivate({
1725
+ trap: trap
1726
+ });
1727
+ var completeDeactivation = function completeDeactivation() {
1728
+ if (returnFocus) {
1729
+ _tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
1730
+ }
1731
+ onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate({
1732
+ trap: trap
1733
+ });
1734
+ };
1735
+ var finishDeactivation = function finishDeactivation() {
1736
+ if (delayReturnFocus && returnFocus) {
1737
+ delay(completeDeactivation);
1738
+ } else {
1739
+ completeDeactivation();
1740
+ }
1741
+ };
1742
+ if (returnFocus && checkCanReturnFocus) {
1743
+ checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
1744
+ return this;
1745
+ }
1746
+ finishDeactivation();
1747
+ return this;
1748
+ },
1749
+ pause: function pause(pauseOptions) {
1750
+ if (!state.active) {
1751
+ return this;
1752
+ }
1753
+ state.manuallyPaused = true;
1754
+ return this._setPausedState(true, pauseOptions);
1755
+ },
1756
+ unpause: function unpause(unpauseOptions) {
1757
+ if (!state.active) {
1758
+ return this;
1759
+ }
1760
+ state.manuallyPaused = false;
1761
+ if (trapStack[trapStack.length - 1] !== this) {
1762
+ return this;
1763
+ }
1764
+ return this._setPausedState(false, unpauseOptions);
1765
+ },
1766
+ updateContainerElements: function updateContainerElements(containerElements) {
1767
+ var elementsAsArray = [].concat(containerElements).filter(Boolean);
1768
+ state.containers = elementsAsArray.map(function (element) {
1769
+ return typeof element === 'string' ? doc.querySelector(element) : element;
1770
+ });
1771
+ if (config.isolateSubtrees) {
1772
+ collectAdjacentElements(state.containers);
1773
+ }
1774
+ if (state.active) {
1775
+ updateTabbableNodes();
1776
+ if (!state.paused) {
1777
+ trap._setSubtreeIsolation(true);
1778
+ }
1779
+ }
1780
+ updateObservedNodes();
1781
+ return this;
1782
+ }
1783
+ };
1784
+ Object.defineProperties(trap, {
1785
+ _isManuallyPaused: {
1786
+ value: function value() {
1787
+ return state.manuallyPaused;
1788
+ }
1789
+ },
1790
+ _setPausedState: {
1791
+ value: function value(paused, options) {
1792
+ if (state.paused === paused) {
1793
+ return this;
1794
+ }
1795
+ state.paused = paused;
1796
+ if (paused) {
1797
+ var onPause = getOption(options, 'onPause');
1798
+ var onPostPause = getOption(options, 'onPostPause');
1799
+ onPause === null || onPause === void 0 || onPause({
1800
+ trap: trap
1801
+ });
1802
+ removeListeners();
1803
+ trap._setSubtreeIsolation(false);
1804
+ updateObservedNodes();
1805
+ onPostPause === null || onPostPause === void 0 || onPostPause({
1806
+ trap: trap
1807
+ });
1808
+ } else {
1809
+ var onUnpause = getOption(options, 'onUnpause');
1810
+ var onPostUnpause = getOption(options, 'onPostUnpause');
1811
+ onUnpause === null || onUnpause === void 0 || onUnpause({
1812
+ trap: trap
1813
+ });
1814
+ var finishUnpause = function finishUnpause() {
1815
+ updateTabbableNodes();
1816
+ var afterListeners = function afterListeners() {
1817
+ trap._setSubtreeIsolation(true);
1818
+ updateObservedNodes();
1819
+ onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause({
1820
+ trap: trap
1821
+ });
1822
+ };
1823
+
1824
+ // NOTE: wait for initial focus node to get focused (whether activation is fully,
1825
+ // partially, or not asynchronous) before we potentially isolate the subtrees
1826
+ // with aria-hidden while focus is still in some other subtree and not yet in
1827
+ // the trap, resulting in some browsers (e.g. Chrome) logging to the console that
1828
+ // they, "Blocked aria-hidden on an element because its descendant retained focus..."
1829
+ var listenersPromise = addListeners();
1830
+ if (listenersPromise) {
1831
+ listenersPromise.then(afterListeners);
1832
+ } else {
1833
+ afterListeners();
1834
+ }
1835
+ };
1836
+ finishUnpause();
1837
+ }
1838
+ return this;
1839
+ }
1840
+ },
1841
+ _setSubtreeIsolation: {
1842
+ value: function value(isEnabled) {
1843
+ if (config.isolateSubtrees) {
1844
+ state.adjacentElements.forEach(function (el) {
1845
+ var _el$getAttribute;
1846
+ if (isEnabled) {
1847
+ switch (config.isolateSubtrees) {
1848
+ case 'aria-hidden':
1849
+ // check both attribute and property to ensure initial state is captured
1850
+ // correctly across different browsers and test environments (like JSDOM)
1851
+ if (el.ariaHidden === 'true' || ((_el$getAttribute = el.getAttribute('aria-hidden')) === null || _el$getAttribute === void 0 ? void 0 : _el$getAttribute.toLowerCase()) === 'true') {
1852
+ state.alreadySilent.add(el);
1853
+ }
1854
+ el.setAttribute('aria-hidden', 'true');
1855
+ break;
1856
+ default:
1857
+ // check both attribute and property to ensure initial state is captured
1858
+ // correctly across different browsers and test environments (like JSDOM)
1859
+ if (el.inert || el.hasAttribute('inert')) {
1860
+ state.alreadySilent.add(el);
1861
+ }
1862
+ el.setAttribute('inert', true);
1863
+ break;
1864
+ }
1865
+ } else {
1866
+ if (state.alreadySilent.has(el)) ; else {
1867
+ switch (config.isolateSubtrees) {
1868
+ case 'aria-hidden':
1869
+ el.removeAttribute('aria-hidden');
1870
+ break;
1871
+ default:
1872
+ el.removeAttribute('inert');
1873
+ break;
1874
+ }
1875
+ }
1876
+ }
1877
+ });
1878
+ }
1879
+ }
1880
+ }
1881
+ });
1882
+
1883
+ // initialize container elements
1884
+ trap.updateContainerElements(elements);
1885
+ return trap;
1886
+ };
1887
+
1888
+ class FocusHandler {
1889
+ constructor() {
1890
+ this.focusTrap = null;
1891
+ this.disabled = false;
1892
+ this.previousFocusedElement = null;
1893
+ this.restoreElement = null;
1894
+ }
1895
+ connect() { }
1896
+ disconnect() {
1897
+ if (!this.disabled) {
1898
+ this.disable();
1899
+ }
1900
+ this.target = undefined;
1901
+ this.focusTrap = null;
1902
+ this.previousFocusedElement = null;
1903
+ this.restoreElement = null;
1904
+ }
1905
+ isDisabled() {
1906
+ return this.disabled;
1907
+ }
1908
+ enable(options) {
1909
+ if (options === null || options === void 0 ? void 0 : options.target) {
1910
+ this.target = options.target;
1911
+ }
1912
+ if (this.target) {
1913
+ if (options === null || options === void 0 ? void 0 : options.restoreElement) {
1914
+ this.restoreElement = options.restoreElement;
1915
+ }
1916
+ this.initializeFocusTrap();
1917
+ this.disabled = false;
1918
+ }
1919
+ }
1920
+ disable() {
1921
+ if (!this.disabled && this.target) {
1922
+ this.deactivateFocusTrap();
1923
+ this.disabled = true;
1924
+ }
1925
+ }
1926
+ initializeFocusTrap() {
1927
+ if (!this.target)
1928
+ return;
1929
+ if (dsBrowser.hasDocument && dsBrowser.hasWindow) {
1930
+ this.previousFocusedElement = document.activeElement;
1931
+ }
1932
+ this.focusTrap = createFocusTrap(this.target, {
1933
+ escapeDeactivates: false,
1934
+ initialFocus: false,
1935
+ fallbackFocus: this.target,
1936
+ tabbableOptions: {
1937
+ getShadowRoot: true,
1938
+ },
1939
+ });
1940
+ this.focusTrap.activate();
1941
+ }
1942
+ deactivateFocusTrap() {
1943
+ if (this.focusTrap) {
1944
+ this.focusTrap.deactivate();
1945
+ this.focusTrap = null;
1946
+ }
1947
+ }
1948
+ restoreFocus(el) {
1949
+ const focusTarget = el || this.restoreElement || this.previousFocusedElement;
1950
+ if (focusTarget && dsBrowser.hasDocument) {
1951
+ focusTarget.focus();
1952
+ }
1953
+ }
1954
+ }
1955
+
1956
+ export { FocusHandler as F };