@haiilo/catalyst 0.3.2 → 0.5.1

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 (365) hide show
  1. package/dist/catalyst/app-globals-23d8c4a8.js +948 -0
  2. package/dist/catalyst/app-globals-23d8c4a8.js.map +1 -0
  3. package/dist/catalyst/app-globals-3dd6a26b.js +948 -0
  4. package/dist/catalyst/app-globals-3dd6a26b.js.map +1 -0
  5. package/dist/catalyst/app-globals-42ce39cc.js +948 -0
  6. package/dist/catalyst/app-globals-42ce39cc.js.map +1 -0
  7. package/dist/catalyst/app-globals-5cf43b57.js +949 -0
  8. package/dist/catalyst/app-globals-5cf43b57.js.map +1 -0
  9. package/dist/catalyst/app-globals-8598c768.js +948 -0
  10. package/dist/catalyst/app-globals-8598c768.js.map +1 -0
  11. package/dist/catalyst/app-globals-a41af143.js +948 -0
  12. package/dist/catalyst/app-globals-a41af143.js.map +1 -0
  13. package/dist/catalyst/app-globals-c6a8b994.js +949 -0
  14. package/dist/catalyst/app-globals-c6a8b994.js.map +1 -0
  15. package/dist/catalyst/cat-alert.entry.js +33 -0
  16. package/dist/catalyst/cat-alert.entry.js.map +1 -0
  17. package/dist/catalyst/cat-badge.entry.js +44 -0
  18. package/dist/catalyst/cat-badge.entry.js.map +1 -0
  19. package/dist/catalyst/cat-button.entry.js +298 -0
  20. package/dist/catalyst/cat-button.entry.js.map +1 -0
  21. package/dist/catalyst/cat-card.entry.js +17 -0
  22. package/dist/catalyst/cat-card.entry.js.map +1 -0
  23. package/dist/catalyst/cat-checkbox.entry.js +75 -0
  24. package/dist/catalyst/cat-checkbox.entry.js.map +1 -0
  25. package/dist/catalyst/cat-i18n-registry-2a6187c9.js +75 -0
  26. package/dist/catalyst/cat-i18n-registry-2a6187c9.js.map +1 -0
  27. package/dist/catalyst/cat-i18n-registry-330db605.js +74 -0
  28. package/dist/catalyst/cat-i18n-registry-330db605.js.map +1 -0
  29. package/dist/catalyst/cat-i18n-registry-83d20604.js +74 -0
  30. package/dist/catalyst/cat-i18n-registry-83d20604.js.map +1 -0
  31. package/dist/catalyst/cat-i18n-registry-dd55821d.js +73 -0
  32. package/dist/catalyst/cat-i18n-registry-dd55821d.js.map +1 -0
  33. package/dist/catalyst/cat-i18n-registry-f6560651.js +75 -0
  34. package/dist/catalyst/cat-i18n-registry-f6560651.js.map +1 -0
  35. package/dist/{esm/cat-icon-registry-59da2e37.js → catalyst/cat-icon-registry-2dcfc9fb.js} +16 -2
  36. package/dist/catalyst/cat-icon-registry-2dcfc9fb.js.map +1 -0
  37. package/dist/catalyst/cat-icon.entry.js +31 -0
  38. package/dist/catalyst/cat-icon.entry.js.map +1 -0
  39. package/dist/catalyst/cat-input.entry.js +111 -0
  40. package/dist/catalyst/cat-input.entry.js.map +1 -0
  41. package/dist/catalyst/cat-menu.entry.js +850 -0
  42. package/dist/catalyst/cat-menu.entry.js.map +1 -0
  43. package/dist/catalyst/cat-radio.entry.js +66 -0
  44. package/dist/catalyst/cat-radio.entry.js.map +1 -0
  45. package/dist/catalyst/cat-scrollable.entry.js +4522 -0
  46. package/dist/catalyst/cat-scrollable.entry.js.map +1 -0
  47. package/dist/catalyst/cat-skeleton.entry.js +55 -0
  48. package/dist/catalyst/cat-skeleton.entry.js.map +1 -0
  49. package/dist/catalyst/cat-spinner.entry.js +23 -0
  50. package/dist/catalyst/cat-spinner.entry.js.map +1 -0
  51. package/dist/catalyst/cat-textarea.entry.js +87 -0
  52. package/dist/catalyst/cat-textarea.entry.js.map +1 -0
  53. package/dist/catalyst/cat-toggle.entry.js +66 -0
  54. package/dist/catalyst/cat-toggle.entry.js.map +1 -0
  55. package/dist/catalyst/cat-tooltip.entry.js +129 -0
  56. package/dist/catalyst/cat-tooltip.entry.js.map +1 -0
  57. package/dist/catalyst/catalyst.css +2033 -1
  58. package/dist/catalyst/catalyst.esm.js +133 -1
  59. package/dist/catalyst/catalyst.esm.js.map +1 -1
  60. package/dist/catalyst/css-shim-e6dd2538.js +6 -0
  61. package/dist/catalyst/css-shim-e6dd2538.js.map +1 -0
  62. package/dist/catalyst/dom-7fc649b0.js +75 -0
  63. package/dist/catalyst/dom-7fc649b0.js.map +1 -0
  64. package/dist/catalyst/first-tabbable-2d9f9e9a.js +2123 -0
  65. package/dist/catalyst/first-tabbable-2d9f9e9a.js.map +1 -0
  66. package/dist/catalyst/index-471d4e05.js +3059 -0
  67. package/dist/catalyst/index-471d4e05.js.map +1 -0
  68. package/dist/catalyst/index-bbb694f5.js +3059 -0
  69. package/dist/catalyst/index-bbb694f5.js.map +1 -0
  70. package/dist/catalyst/index.esm.js +4 -1
  71. package/dist/catalyst/index.esm.js.map +1 -1
  72. package/dist/catalyst/loglevel-7f0f71af.js +346 -0
  73. package/dist/catalyst/loglevel-7f0f71af.js.map +1 -0
  74. package/dist/catalyst/shadow-css-4d56fa31.js +390 -0
  75. package/dist/catalyst/shadow-css-4d56fa31.js.map +1 -0
  76. package/dist/cjs/app-globals-aaefc070.js +950 -0
  77. package/dist/cjs/app-globals-aaefc070.js.map +1 -0
  78. package/dist/cjs/cat-alert.cjs.entry.js +37 -0
  79. package/dist/cjs/cat-alert.cjs.entry.js.map +1 -0
  80. package/dist/cjs/cat-badge.cjs.entry.js +48 -0
  81. package/dist/cjs/cat-badge.cjs.entry.js.map +1 -0
  82. package/dist/cjs/cat-button.cjs.entry.js +302 -0
  83. package/dist/cjs/cat-button.cjs.entry.js.map +1 -0
  84. package/dist/cjs/cat-card.cjs.entry.js +21 -0
  85. package/dist/cjs/cat-card.cjs.entry.js.map +1 -0
  86. package/dist/cjs/cat-checkbox.cjs.entry.js +79 -0
  87. package/dist/cjs/cat-checkbox.cjs.entry.js.map +1 -0
  88. package/dist/cjs/cat-i18n-registry-a1379d1e.js +76 -0
  89. package/dist/cjs/cat-i18n-registry-a1379d1e.js.map +1 -0
  90. package/dist/cjs/{cat-icon-registry-850c538c.js → cat-icon-registry-74247389.js} +16 -2
  91. package/dist/cjs/cat-icon-registry-74247389.js.map +1 -0
  92. package/dist/cjs/cat-icon.cjs.entry.js +35 -0
  93. package/dist/cjs/cat-icon.cjs.entry.js.map +1 -0
  94. package/dist/cjs/cat-input.cjs.entry.js +115 -0
  95. package/dist/cjs/cat-input.cjs.entry.js.map +1 -0
  96. package/dist/cjs/cat-menu.cjs.entry.js +854 -0
  97. package/dist/cjs/cat-menu.cjs.entry.js.map +1 -0
  98. package/dist/cjs/cat-radio.cjs.entry.js +70 -0
  99. package/dist/cjs/cat-radio.cjs.entry.js.map +1 -0
  100. package/dist/cjs/cat-scrollable.cjs.entry.js +4526 -0
  101. package/dist/cjs/cat-scrollable.cjs.entry.js.map +1 -0
  102. package/dist/cjs/cat-skeleton.cjs.entry.js +59 -0
  103. package/dist/cjs/cat-skeleton.cjs.entry.js.map +1 -0
  104. package/dist/cjs/cat-spinner.cjs.entry.js +27 -0
  105. package/dist/cjs/cat-spinner.cjs.entry.js.map +1 -0
  106. package/dist/cjs/cat-textarea.cjs.entry.js +91 -0
  107. package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -0
  108. package/dist/cjs/cat-toggle.cjs.entry.js +70 -0
  109. package/dist/cjs/cat-toggle.cjs.entry.js.map +1 -0
  110. package/dist/cjs/cat-tooltip.cjs.entry.js +133 -0
  111. package/dist/cjs/cat-tooltip.cjs.entry.js.map +1 -0
  112. package/dist/cjs/catalyst.cjs.js +118 -6
  113. package/dist/cjs/catalyst.cjs.js.map +1 -1
  114. package/dist/cjs/css-shim-6ca600c2.js +8 -0
  115. package/dist/cjs/css-shim-6ca600c2.js.map +1 -0
  116. package/dist/cjs/dom-8d415461.js +77 -0
  117. package/dist/cjs/dom-8d415461.js.map +1 -0
  118. package/dist/cjs/first-tabbable-2068dcc6.js +2133 -0
  119. package/dist/cjs/first-tabbable-2068dcc6.js.map +1 -0
  120. package/dist/cjs/index-abcb3941.js +3094 -0
  121. package/dist/cjs/index-abcb3941.js.map +1 -0
  122. package/dist/cjs/index.cjs.js +4 -1
  123. package/dist/cjs/index.cjs.js.map +1 -1
  124. package/dist/cjs/loader.cjs.js +20 -4
  125. package/dist/cjs/loader.cjs.js.map +1 -1
  126. package/dist/cjs/loglevel-24040e9d.js +348 -0
  127. package/dist/cjs/loglevel-24040e9d.js.map +1 -0
  128. package/dist/cjs/shadow-css-78860e39.js +392 -0
  129. package/dist/cjs/shadow-css-78860e39.js.map +1 -0
  130. package/dist/collection/collection-manifest.json +8 -1
  131. package/dist/collection/components/cat-alert/cat-alert.css +11 -6
  132. package/dist/collection/components/cat-alert/cat-alert.js +19 -8
  133. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  134. package/dist/collection/components/cat-badge/cat-badge.css +17 -17
  135. package/dist/collection/components/cat-badge/cat-badge.js +9 -8
  136. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  137. package/dist/collection/components/cat-button/cat-button.css +18 -8
  138. package/dist/collection/components/cat-button/cat-button.js +32 -8
  139. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  140. package/dist/collection/components/cat-card/cat-card.css +25 -0
  141. package/dist/collection/components/cat-card/cat-card.js +20 -0
  142. package/dist/collection/components/cat-card/cat-card.js.map +1 -0
  143. package/dist/collection/components/cat-checkbox/cat-checkbox.css +105 -0
  144. package/dist/collection/components/cat-checkbox/cat-checkbox.js +314 -0
  145. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -0
  146. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +70 -0
  147. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -0
  148. package/dist/collection/components/cat-icon/cat-icon-registry.js +14 -1
  149. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  150. package/dist/collection/components/cat-icon/cat-icon.css +5 -5
  151. package/dist/collection/components/cat-icon/cat-icon.js +3 -2
  152. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  153. package/dist/collection/components/cat-input/cat-input.css +131 -0
  154. package/dist/collection/components/cat-input/cat-input.js +606 -0
  155. package/dist/collection/components/cat-input/cat-input.js.map +1 -0
  156. package/dist/collection/components/cat-menu/cat-menu.css +2 -1
  157. package/dist/collection/components/cat-menu/cat-menu.js +3 -5
  158. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
  159. package/dist/collection/components/cat-radio/cat-radio.css +84 -0
  160. package/dist/collection/components/cat-radio/cat-radio.js +283 -0
  161. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -0
  162. package/dist/collection/components/cat-scrollable/cat-scrollable.js +4 -2
  163. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  164. package/dist/collection/components/cat-skeleton/cat-skeleton.css +30 -30
  165. package/dist/collection/components/cat-skeleton/cat-skeleton.js +4 -4
  166. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  167. package/dist/collection/components/cat-spinner/cat-spinner.css +7 -7
  168. package/dist/collection/components/cat-spinner/cat-spinner.js +1 -1
  169. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  170. package/dist/collection/components/cat-textarea/cat-textarea.css +74 -0
  171. package/dist/collection/components/cat-textarea/cat-textarea.js +393 -0
  172. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -0
  173. package/dist/collection/components/cat-toggle/cat-toggle.css +93 -0
  174. package/dist/collection/components/cat-toggle/cat-toggle.js +283 -0
  175. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -0
  176. package/dist/collection/components/cat-tooltip/cat-tooltip.css +41 -0
  177. package/dist/collection/components/cat-tooltip/cat-tooltip.js +254 -0
  178. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -0
  179. package/dist/collection/index.js +1 -0
  180. package/dist/collection/index.js.map +1 -1
  181. package/dist/collection/init.js +9 -1
  182. package/dist/collection/init.js.map +1 -1
  183. package/dist/collection/utils/first-tabbable.js +6 -0
  184. package/dist/collection/utils/first-tabbable.js.map +1 -0
  185. package/dist/collection/utils/is-touch-screen.js +3 -0
  186. package/dist/collection/utils/is-touch-screen.js.map +1 -0
  187. package/dist/components/cat-alert.js +15 -6
  188. package/dist/components/cat-alert.js.map +1 -1
  189. package/dist/components/cat-badge.js +7 -7
  190. package/dist/components/cat-badge.js.map +1 -1
  191. package/dist/components/cat-button.js +1 -647
  192. package/dist/components/cat-button.js.map +1 -1
  193. package/dist/components/cat-button2.js +346 -0
  194. package/dist/components/cat-button2.js.map +1 -0
  195. package/dist/components/cat-card.d.ts +11 -0
  196. package/dist/components/cat-card.js +35 -0
  197. package/dist/components/cat-card.js.map +1 -0
  198. package/dist/components/cat-checkbox.d.ts +11 -0
  199. package/dist/components/cat-checkbox.js +103 -0
  200. package/dist/components/cat-checkbox.js.map +1 -0
  201. package/dist/components/cat-i18n-registry.js +74 -0
  202. package/dist/components/cat-i18n-registry.js.map +1 -0
  203. package/dist/components/cat-icon-registry.js +15 -1
  204. package/dist/components/cat-icon-registry.js.map +1 -1
  205. package/dist/components/cat-icon2.js +3 -2
  206. package/dist/components/cat-icon2.js.map +1 -1
  207. package/dist/components/cat-input.d.ts +11 -0
  208. package/dist/components/cat-input.js +172 -0
  209. package/dist/components/cat-input.js.map +1 -0
  210. package/dist/components/cat-menu.js +12 -1520
  211. package/dist/components/cat-menu.js.map +1 -1
  212. package/dist/components/cat-radio.d.ts +11 -0
  213. package/dist/components/cat-radio.js +93 -0
  214. package/dist/components/cat-radio.js.map +1 -0
  215. package/dist/components/cat-scrollable.js +3210 -25
  216. package/dist/components/cat-scrollable.js.map +1 -1
  217. package/dist/components/cat-skeleton.js +5 -5
  218. package/dist/components/cat-skeleton.js.map +1 -1
  219. package/dist/components/cat-spinner2.js +2 -2
  220. package/dist/components/cat-spinner2.js.map +1 -1
  221. package/dist/components/cat-textarea.d.ts +11 -0
  222. package/dist/components/cat-textarea.js +119 -0
  223. package/dist/components/cat-textarea.js.map +1 -0
  224. package/dist/components/cat-toggle.d.ts +11 -0
  225. package/dist/components/cat-toggle.js +93 -0
  226. package/dist/components/cat-toggle.js.map +1 -0
  227. package/dist/components/cat-tooltip.d.ts +11 -0
  228. package/dist/components/cat-tooltip.js +154 -0
  229. package/dist/components/cat-tooltip.js.map +1 -0
  230. package/dist/components/first-tabbable.js +2123 -0
  231. package/dist/components/first-tabbable.js.map +1 -0
  232. package/dist/components/index.js +778 -0
  233. package/dist/components/index.js.map +1 -1
  234. package/dist/components/loglevel.js +346 -0
  235. package/dist/components/loglevel.js.map +1 -0
  236. package/dist/esm/app-globals-3dd6a26b.js +948 -0
  237. package/dist/esm/app-globals-3dd6a26b.js.map +1 -0
  238. package/dist/esm/cat-alert.entry.js +33 -0
  239. package/dist/esm/cat-alert.entry.js.map +1 -0
  240. package/dist/esm/cat-badge.entry.js +44 -0
  241. package/dist/esm/cat-badge.entry.js.map +1 -0
  242. package/dist/esm/cat-button.entry.js +298 -0
  243. package/dist/esm/cat-button.entry.js.map +1 -0
  244. package/dist/esm/cat-card.entry.js +17 -0
  245. package/dist/esm/cat-card.entry.js.map +1 -0
  246. package/dist/esm/cat-checkbox.entry.js +75 -0
  247. package/dist/esm/cat-checkbox.entry.js.map +1 -0
  248. package/dist/esm/cat-i18n-registry-83d20604.js +74 -0
  249. package/dist/esm/cat-i18n-registry-83d20604.js.map +1 -0
  250. package/dist/esm/cat-icon-registry-2dcfc9fb.js +59 -0
  251. package/dist/esm/cat-icon-registry-2dcfc9fb.js.map +1 -0
  252. package/dist/esm/cat-icon.entry.js +31 -0
  253. package/dist/esm/cat-icon.entry.js.map +1 -0
  254. package/dist/esm/cat-input.entry.js +111 -0
  255. package/dist/esm/cat-input.entry.js.map +1 -0
  256. package/dist/esm/cat-menu.entry.js +850 -0
  257. package/dist/esm/cat-menu.entry.js.map +1 -0
  258. package/dist/esm/cat-radio.entry.js +66 -0
  259. package/dist/esm/cat-radio.entry.js.map +1 -0
  260. package/dist/esm/cat-scrollable.entry.js +4522 -0
  261. package/dist/esm/cat-scrollable.entry.js.map +1 -0
  262. package/dist/esm/cat-skeleton.entry.js +55 -0
  263. package/dist/esm/cat-skeleton.entry.js.map +1 -0
  264. package/dist/esm/cat-spinner.entry.js +23 -0
  265. package/dist/esm/cat-spinner.entry.js.map +1 -0
  266. package/dist/esm/cat-textarea.entry.js +87 -0
  267. package/dist/esm/cat-textarea.entry.js.map +1 -0
  268. package/dist/esm/cat-toggle.entry.js +66 -0
  269. package/dist/esm/cat-toggle.entry.js.map +1 -0
  270. package/dist/esm/cat-tooltip.entry.js +129 -0
  271. package/dist/esm/cat-tooltip.entry.js.map +1 -0
  272. package/dist/esm/catalyst.js +118 -6
  273. package/dist/esm/catalyst.js.map +1 -1
  274. package/dist/esm/css-shim-e6dd2538.js +6 -0
  275. package/dist/esm/css-shim-e6dd2538.js.map +1 -0
  276. package/dist/esm/dom-7fc649b0.js +75 -0
  277. package/dist/esm/dom-7fc649b0.js.map +1 -0
  278. package/dist/esm/first-tabbable-2d9f9e9a.js +2123 -0
  279. package/dist/esm/first-tabbable-2d9f9e9a.js.map +1 -0
  280. package/dist/esm/index-471d4e05.js +3059 -0
  281. package/dist/esm/index-471d4e05.js.map +1 -0
  282. package/dist/esm/index.js +3 -1
  283. package/dist/esm/index.js.map +1 -1
  284. package/dist/esm/loader.js +20 -4
  285. package/dist/esm/loader.js.map +1 -1
  286. package/dist/esm/loglevel-7f0f71af.js +346 -0
  287. package/dist/esm/loglevel-7f0f71af.js.map +1 -0
  288. package/dist/esm/shadow-css-4d56fa31.js +390 -0
  289. package/dist/esm/shadow-css-4d56fa31.js.map +1 -0
  290. package/dist/types/components/cat-alert/cat-alert.d.ts +4 -2
  291. package/dist/types/components/cat-alert/cat-alert.e2e.d.ts +1 -0
  292. package/dist/types/components/cat-alert/cat-alert.spec.d.ts +1 -0
  293. package/dist/types/components/cat-badge/cat-badge.d.ts +3 -2
  294. package/dist/types/components/cat-badge/cat-badge.e2e.d.ts +1 -0
  295. package/dist/types/components/cat-badge/cat-badge.spec.d.ts +1 -0
  296. package/dist/types/components/cat-button/cat-button.d.ts +8 -3
  297. package/dist/types/components/cat-button/cat-button.e2e.d.ts +1 -0
  298. package/dist/types/components/cat-button/cat-button.spec.d.ts +1 -0
  299. package/dist/types/components/cat-card/cat-card.d.ts +7 -0
  300. package/dist/types/components/cat-card/cat-card.e2e.d.ts +1 -0
  301. package/dist/types/components/cat-card/cat-card.spec.d.ts +1 -0
  302. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +69 -0
  303. package/dist/types/components/cat-checkbox/cat-checkbox.e2e.d.ts +1 -0
  304. package/dist/types/components/cat-checkbox/cat-checkbox.spec.d.ts +1 -0
  305. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +18 -0
  306. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +4 -4
  307. package/dist/types/components/cat-icon/cat-icon.d.ts +1 -1
  308. package/dist/types/components/cat-icon/cat-icon.e2e.d.ts +1 -0
  309. package/dist/types/components/cat-icon/cat-icon.spec.d.ts +1 -0
  310. package/dist/types/components/cat-input/cat-input.d.ts +130 -0
  311. package/dist/types/components/cat-input/cat-input.e2e.d.ts +1 -0
  312. package/dist/types/components/cat-input/cat-input.spec.d.ts +1 -0
  313. package/dist/types/components/cat-menu/cat-menu.d.ts +0 -1
  314. package/dist/types/components/cat-menu/cat-menu.e2e.d.ts +1 -0
  315. package/dist/types/components/cat-menu/cat-menu.spec.d.ts +1 -0
  316. package/dist/types/components/cat-radio/cat-radio.d.ts +63 -0
  317. package/dist/types/components/cat-radio/cat-radio.e2e.d.ts +1 -0
  318. package/dist/types/components/cat-radio/cat-radio.spec.d.ts +1 -0
  319. package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +3 -1
  320. package/dist/types/components/cat-scrollable/cat-scrollable.e2e.d.ts +1 -0
  321. package/dist/types/components/cat-scrollable/cat-scrollable.spec.d.ts +1 -0
  322. package/dist/types/components/cat-skeleton/cat-skeleton.e2e.d.ts +1 -0
  323. package/dist/types/components/cat-skeleton/cat-skeleton.spec.d.ts +1 -0
  324. package/dist/types/components/cat-spinner/cat-spinner.e2e.d.ts +1 -0
  325. package/dist/types/components/cat-spinner/cat-spinner.spec.d.ts +1 -0
  326. package/dist/types/components/cat-textarea/cat-textarea.d.ts +85 -0
  327. package/dist/types/components/cat-textarea/cat-textarea.e2e.d.ts +1 -0
  328. package/dist/types/components/cat-textarea/cat-textarea.spec.d.ts +1 -0
  329. package/dist/types/components/cat-toggle/cat-toggle.d.ts +64 -0
  330. package/dist/types/components/cat-toggle/cat-toggle.e2e.d.ts +1 -0
  331. package/dist/types/components/cat-toggle/cat-toggle.spec.d.ts +1 -0
  332. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +46 -0
  333. package/dist/types/components/cat-tooltip/cat-tooltip.e2e.d.ts +1 -0
  334. package/dist/types/components/cat-tooltip/cat-tooltip.spec.d.ts +1 -0
  335. package/dist/types/components.d.ts +680 -4
  336. package/dist/types/index.d.ts +1 -0
  337. package/dist/types/utils/first-tabbable.d.ts +4 -0
  338. package/dist/types/utils/is-touch-screen.d.ts +2 -0
  339. package/dist/types/utils/media-matcher.spec.d.ts +1 -0
  340. package/package.json +9 -7
  341. package/dist/catalyst/p-31b500c7.entry.js +0 -10
  342. package/dist/catalyst/p-31b500c7.entry.js.map +0 -1
  343. package/dist/catalyst/p-ed826597.js +0 -2
  344. package/dist/catalyst/p-ed826597.js.map +0 -1
  345. package/dist/catalyst/p-ef0a8ae9.js +0 -2
  346. package/dist/catalyst/p-ef0a8ae9.js.map +0 -1
  347. package/dist/catalyst/p-f151cb13.js +0 -2
  348. package/dist/catalyst/p-f151cb13.js.map +0 -1
  349. package/dist/cjs/app-globals-7f2b1f8e.js +0 -173
  350. package/dist/cjs/app-globals-7f2b1f8e.js.map +0 -1
  351. package/dist/cjs/cat-alert_8.cjs.entry.js +0 -4450
  352. package/dist/cjs/cat-alert_8.cjs.entry.js.map +0 -1
  353. package/dist/cjs/cat-icon-registry-850c538c.js.map +0 -1
  354. package/dist/cjs/index-c0881ae0.js +0 -1348
  355. package/dist/cjs/index-c0881ae0.js.map +0 -1
  356. package/dist/collection/utils/utils.js +0 -4
  357. package/dist/collection/utils/utils.js.map +0 -1
  358. package/dist/esm/app-globals-8af9b2cf.js +0 -171
  359. package/dist/esm/app-globals-8af9b2cf.js.map +0 -1
  360. package/dist/esm/cat-alert_8.entry.js +0 -4439
  361. package/dist/esm/cat-alert_8.entry.js.map +0 -1
  362. package/dist/esm/cat-icon-registry-59da2e37.js.map +0 -1
  363. package/dist/esm/index-0ff35bca.js +0 -1320
  364. package/dist/esm/index-0ff35bca.js.map +0 -1
  365. package/dist/types/utils/utils.d.ts +0 -1
@@ -0,0 +1,854 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-abcb3941.js');
6
+ const firstTabbable = require('./first-tabbable-2068dcc6.js');
7
+
8
+ /*!
9
+ * focus-trap 6.8.1
10
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
11
+ */
12
+
13
+ function ownKeys(object, enumerableOnly) {
14
+ var keys = Object.keys(object);
15
+
16
+ if (Object.getOwnPropertySymbols) {
17
+ var symbols = Object.getOwnPropertySymbols(object);
18
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
19
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
+ })), keys.push.apply(keys, symbols);
21
+ }
22
+
23
+ return keys;
24
+ }
25
+
26
+ function _objectSpread2(target) {
27
+ for (var i = 1; i < arguments.length; i++) {
28
+ var source = null != arguments[i] ? arguments[i] : {};
29
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
30
+ _defineProperty(target, key, source[key]);
31
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
32
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
33
+ });
34
+ }
35
+
36
+ return target;
37
+ }
38
+
39
+ function _defineProperty(obj, key, value) {
40
+ if (key in obj) {
41
+ Object.defineProperty(obj, key, {
42
+ value: value,
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true
46
+ });
47
+ } else {
48
+ obj[key] = value;
49
+ }
50
+
51
+ return obj;
52
+ }
53
+
54
+ var activeFocusTraps = function () {
55
+ var trapQueue = [];
56
+ return {
57
+ activateTrap: function activateTrap(trap) {
58
+ if (trapQueue.length > 0) {
59
+ var activeTrap = trapQueue[trapQueue.length - 1];
60
+
61
+ if (activeTrap !== trap) {
62
+ activeTrap.pause();
63
+ }
64
+ }
65
+
66
+ var trapIndex = trapQueue.indexOf(trap);
67
+
68
+ if (trapIndex === -1) {
69
+ trapQueue.push(trap);
70
+ } else {
71
+ // move this existing trap to the front of the queue
72
+ trapQueue.splice(trapIndex, 1);
73
+ trapQueue.push(trap);
74
+ }
75
+ },
76
+ deactivateTrap: function deactivateTrap(trap) {
77
+ var trapIndex = trapQueue.indexOf(trap);
78
+
79
+ if (trapIndex !== -1) {
80
+ trapQueue.splice(trapIndex, 1);
81
+ }
82
+
83
+ if (trapQueue.length > 0) {
84
+ trapQueue[trapQueue.length - 1].unpause();
85
+ }
86
+ }
87
+ };
88
+ }();
89
+
90
+ var isSelectableInput = function isSelectableInput(node) {
91
+ return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
92
+ };
93
+
94
+ var isEscapeEvent = function isEscapeEvent(e) {
95
+ return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
96
+ };
97
+
98
+ var isTabEvent = function isTabEvent(e) {
99
+ return e.key === 'Tab' || e.keyCode === 9;
100
+ };
101
+
102
+ var delay = function delay(fn) {
103
+ return setTimeout(fn, 0);
104
+ }; // Array.find/findIndex() are not supported on IE; this replicates enough
105
+ // of Array.findIndex() for our needs
106
+
107
+
108
+ var findIndex = function findIndex(arr, fn) {
109
+ var idx = -1;
110
+ arr.every(function (value, i) {
111
+ if (fn(value)) {
112
+ idx = i;
113
+ return false; // break
114
+ }
115
+
116
+ return true; // next
117
+ });
118
+ return idx;
119
+ };
120
+ /**
121
+ * Get an option's value when it could be a plain value, or a handler that provides
122
+ * the value.
123
+ * @param {*} value Option's value to check.
124
+ * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
125
+ * @returns {*} The `value`, or the handler's returned value.
126
+ */
127
+
128
+
129
+ var valueOrHandler = function valueOrHandler(value) {
130
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
131
+ params[_key - 1] = arguments[_key];
132
+ }
133
+
134
+ return typeof value === 'function' ? value.apply(void 0, params) : value;
135
+ };
136
+
137
+ var getActualTarget = function getActualTarget(event) {
138
+ // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
139
+ // shadow host. However, event.target.composedPath() will be an array of
140
+ // nodes "clicked" from inner-most (the actual element inside the shadow) to
141
+ // outer-most (the host HTML document). If we have access to composedPath(),
142
+ // then use its first element; otherwise, fall back to event.target (and
143
+ // this only works for an _open_ shadow DOM; otherwise,
144
+ // composedPath()[0] === event.target always).
145
+ return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
146
+ };
147
+
148
+ var createFocusTrap = function createFocusTrap(elements, userOptions) {
149
+ // SSR: a live trap shouldn't be created in this type of environment so this
150
+ // should be safe code to execute if the `document` option isn't specified
151
+ var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
152
+
153
+ var config = _objectSpread2({
154
+ returnFocusOnDeactivate: true,
155
+ escapeDeactivates: true,
156
+ delayInitialFocus: true
157
+ }, userOptions);
158
+
159
+ var state = {
160
+ // containers given to createFocusTrap()
161
+ // @type {Array<HTMLElement>}
162
+ containers: [],
163
+ // list of objects identifying tabbable nodes in `containers` in the trap
164
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
165
+ // is active, but the trap should never get to a state where there isn't at least one group
166
+ // with at least one tabbable node in it (that would lead to an error condition that would
167
+ // result in an error being thrown)
168
+ // @type {Array<{
169
+ // container: HTMLElement,
170
+ // tabbableNodes: Array<HTMLElement>, // empty if none
171
+ // focusableNodes: Array<HTMLElement>, // empty if none
172
+ // firstTabbableNode: HTMLElement|null,
173
+ // lastTabbableNode: HTMLElement|null,
174
+ // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
175
+ // }>}
176
+ containerGroups: [],
177
+ // same order/length as `containers` list
178
+ // references to objects in `containerGroups`, but only those that actually have
179
+ // tabbable nodes in them
180
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
181
+ // the same length
182
+ tabbableGroups: [],
183
+ nodeFocusedBeforeActivation: null,
184
+ mostRecentlyFocusedNode: null,
185
+ active: false,
186
+ paused: false,
187
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
188
+ // has been delayed during activation
189
+ delayInitialFocusTimer: undefined
190
+ };
191
+ 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
192
+
193
+ /**
194
+ * Gets a configuration option value.
195
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
196
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
197
+ * @param {string} optionName Name of the option whose value is sought.
198
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
199
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
200
+ */
201
+
202
+ var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
203
+ return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
204
+ };
205
+ /**
206
+ * Finds the index of the container that contains the element.
207
+ * @param {HTMLElement} element
208
+ * @returns {number} Index of the container in either `state.containers` or
209
+ * `state.containerGroups` (the order/length of these lists are the same); -1
210
+ * if the element isn't found.
211
+ */
212
+
213
+
214
+ var findContainerIndex = function findContainerIndex(element) {
215
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
216
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
217
+ // and we still need to find the element in there
218
+ return state.containerGroups.findIndex(function (_ref) {
219
+ var container = _ref.container,
220
+ tabbableNodes = _ref.tabbableNodes;
221
+ return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
222
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
223
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
224
+ // look inside web components even if open)
225
+ tabbableNodes.find(function (node) {
226
+ return node === element;
227
+ });
228
+ });
229
+ };
230
+ /**
231
+ * Gets the node for the given option, which is expected to be an option that
232
+ * can be either a DOM node, a string that is a selector to get a node, `false`
233
+ * (if a node is explicitly NOT given), or a function that returns any of these
234
+ * values.
235
+ * @param {string} optionName
236
+ * @returns {undefined | false | HTMLElement | SVGElement} Returns
237
+ * `undefined` if the option is not specified; `false` if the option
238
+ * resolved to `false` (node explicitly not given); otherwise, the resolved
239
+ * DOM node.
240
+ * @throws {Error} If the option is set, not `false`, and is not, or does not
241
+ * resolve to a node.
242
+ */
243
+
244
+
245
+ var getNodeForOption = function getNodeForOption(optionName) {
246
+ var optionValue = config[optionName];
247
+
248
+ if (typeof optionValue === 'function') {
249
+ for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
250
+ params[_key2 - 1] = arguments[_key2];
251
+ }
252
+
253
+ optionValue = optionValue.apply(void 0, params);
254
+ }
255
+
256
+ if (!optionValue) {
257
+ if (optionValue === undefined || optionValue === false) {
258
+ return optionValue;
259
+ } // else, empty string (invalid), null (invalid), 0 (invalid)
260
+
261
+
262
+ throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
263
+ }
264
+
265
+ var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
266
+
267
+ if (typeof optionValue === 'string') {
268
+ node = doc.querySelector(optionValue); // resolve to node, or null if fails
269
+
270
+ if (!node) {
271
+ throw new Error("`".concat(optionName, "` as selector refers to no known node"));
272
+ }
273
+ }
274
+
275
+ return node;
276
+ };
277
+
278
+ var getInitialFocusNode = function getInitialFocusNode() {
279
+ var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
280
+
281
+ if (node === false) {
282
+ return false;
283
+ }
284
+
285
+ if (node === undefined) {
286
+ // option not specified: use fallback options
287
+ if (findContainerIndex(doc.activeElement) >= 0) {
288
+ node = doc.activeElement;
289
+ } else {
290
+ var firstTabbableGroup = state.tabbableGroups[0];
291
+ var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
292
+
293
+ node = firstTabbableNode || getNodeForOption('fallbackFocus');
294
+ }
295
+ }
296
+
297
+ if (!node) {
298
+ throw new Error('Your focus-trap needs to have at least one focusable element');
299
+ }
300
+
301
+ return node;
302
+ };
303
+
304
+ var updateTabbableNodes = function updateTabbableNodes() {
305
+ state.containerGroups = state.containers.map(function (container) {
306
+ var tabbableNodes = firstTabbable.tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
307
+ // are a superset of tabbable nodes
308
+
309
+ var focusableNodes = firstTabbable.focusable(container, config.tabbableOptions);
310
+ return {
311
+ container: container,
312
+ tabbableNodes: tabbableNodes,
313
+ focusableNodes: focusableNodes,
314
+ firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
315
+ lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
316
+
317
+ /**
318
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
319
+ * in this container, if any.
320
+ * @param {HTMLElement} node
321
+ * @param {boolean} [forward] True if going in forward tab order; false if going
322
+ * in reverse.
323
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
324
+ */
325
+ nextTabbableNode: function nextTabbableNode(node) {
326
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
327
+ // NOTE: If tabindex is positive (in order to manipulate the tab order separate
328
+ // from the DOM order), this __will not work__ because the list of focusableNodes,
329
+ // while it contains tabbable nodes, does not sort its nodes in any order other
330
+ // than DOM order, because it can't: Where would you place focusable (but not
331
+ // tabbable) nodes in that order? They have no order, because they aren't tabbale...
332
+ // Support for positive tabindex is already broken and hard to manage (possibly
333
+ // not supportable, TBD), so this isn't going to make things worse than they
334
+ // already are, and at least makes things better for the majority of cases where
335
+ // tabindex is either 0/unset or negative.
336
+ // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
337
+ var nodeIdx = focusableNodes.findIndex(function (n) {
338
+ return n === node;
339
+ });
340
+
341
+ if (nodeIdx < 0) {
342
+ return undefined;
343
+ }
344
+
345
+ if (forward) {
346
+ return focusableNodes.slice(nodeIdx + 1).find(function (n) {
347
+ return firstTabbable.isTabbable(n, config.tabbableOptions);
348
+ });
349
+ }
350
+
351
+ return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
352
+ return firstTabbable.isTabbable(n, config.tabbableOptions);
353
+ });
354
+ }
355
+ };
356
+ });
357
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
358
+ return group.tabbableNodes.length > 0;
359
+ }); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
360
+
361
+ if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
362
+ ) {
363
+ throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
364
+ }
365
+ };
366
+
367
+ var tryFocus = function tryFocus(node) {
368
+ if (node === false) {
369
+ return;
370
+ }
371
+
372
+ if (node === doc.activeElement) {
373
+ return;
374
+ }
375
+
376
+ if (!node || !node.focus) {
377
+ tryFocus(getInitialFocusNode());
378
+ return;
379
+ }
380
+
381
+ node.focus({
382
+ preventScroll: !!config.preventScroll
383
+ });
384
+ state.mostRecentlyFocusedNode = node;
385
+
386
+ if (isSelectableInput(node)) {
387
+ node.select();
388
+ }
389
+ };
390
+
391
+ var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
392
+ var node = getNodeForOption('setReturnFocus', previousActiveElement);
393
+ return node ? node : node === false ? false : previousActiveElement;
394
+ }; // This needs to be done on mousedown and touchstart instead of click
395
+ // so that it precedes the focus event.
396
+
397
+
398
+ var checkPointerDown = function checkPointerDown(e) {
399
+ var target = getActualTarget(e);
400
+
401
+ if (findContainerIndex(target) >= 0) {
402
+ // allow the click since it ocurred inside the trap
403
+ return;
404
+ }
405
+
406
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
407
+ // immediately deactivate the trap
408
+ trap.deactivate({
409
+ // if, on deactivation, we should return focus to the node originally-focused
410
+ // when the trap was activated (or the configured `setReturnFocus` node),
411
+ // then assume it's also OK to return focus to the outside node that was
412
+ // just clicked, causing deactivation, as long as that node is focusable;
413
+ // if it isn't focusable, then return focus to the original node focused
414
+ // on activation (or the configured `setReturnFocus` node)
415
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
416
+ // which will result in the outside click setting focus to the node
417
+ // that was clicked, whether it's focusable or not; by setting
418
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
419
+ // on activation (or the configured `setReturnFocus` node)
420
+ returnFocus: config.returnFocusOnDeactivate && !firstTabbable.isFocusable(target, config.tabbableOptions)
421
+ });
422
+ return;
423
+ } // This is needed for mobile devices.
424
+ // (If we'll only let `click` events through,
425
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
426
+
427
+
428
+ if (valueOrHandler(config.allowOutsideClick, e)) {
429
+ // allow the click outside the trap to take place
430
+ return;
431
+ } // otherwise, prevent the click
432
+
433
+
434
+ e.preventDefault();
435
+ }; // In case focus escapes the trap for some strange reason, pull it back in.
436
+
437
+
438
+ var checkFocusIn = function checkFocusIn(e) {
439
+ var target = getActualTarget(e);
440
+ var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
441
+
442
+ if (targetContained || target instanceof Document) {
443
+ if (targetContained) {
444
+ state.mostRecentlyFocusedNode = target;
445
+ }
446
+ } else {
447
+ // escaped! pull it back in to where it just left
448
+ e.stopImmediatePropagation();
449
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
450
+ }
451
+ }; // Hijack Tab events on the first and last focusable nodes of the trap,
452
+ // in order to prevent focus from escaping. If it escapes for even a
453
+ // moment it can end up scrolling the page and causing confusion so we
454
+ // kind of need to capture the action at the keydown phase.
455
+
456
+
457
+ var checkTab = function checkTab(e) {
458
+ var target = getActualTarget(e);
459
+ updateTabbableNodes();
460
+ var destinationNode = null;
461
+
462
+ if (state.tabbableGroups.length > 0) {
463
+ // make sure the target is actually contained in a group
464
+ // NOTE: the target may also be the container itself if it's focusable
465
+ // with tabIndex='-1' and was given initial focus
466
+ var containerIndex = findContainerIndex(target);
467
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
468
+
469
+ if (containerIndex < 0) {
470
+ // target not found in any group: quite possible focus has escaped the trap,
471
+ // so bring it back in to...
472
+ if (e.shiftKey) {
473
+ // ...the last node in the last group
474
+ destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
475
+ } else {
476
+ // ...the first node in the first group
477
+ destinationNode = state.tabbableGroups[0].firstTabbableNode;
478
+ }
479
+ } else if (e.shiftKey) {
480
+ // REVERSE
481
+ // is the target the first tabbable node in a group?
482
+ var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
483
+ var firstTabbableNode = _ref2.firstTabbableNode;
484
+ return target === firstTabbableNode;
485
+ });
486
+
487
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || firstTabbable.isFocusable(target, config.tabbableOptions) && !firstTabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
488
+ // an exception case where the target is either the container itself, or
489
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
490
+ // and user clicked on it or node was programmatically given focus)
491
+ // and is not followed by any other tabbable node, in which
492
+ // case, we should handle shift+tab as if focus were on the container's
493
+ // first tabbable node, and go to the last tabbable node of the LAST group
494
+ startOfGroupIndex = containerIndex;
495
+ }
496
+
497
+ if (startOfGroupIndex >= 0) {
498
+ // YES: then shift+tab should go to the last tabbable node in the
499
+ // previous group (and wrap around to the last tabbable node of
500
+ // the LAST group if it's the first tabbable node of the FIRST group)
501
+ var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
502
+ var destinationGroup = state.tabbableGroups[destinationGroupIndex];
503
+ destinationNode = destinationGroup.lastTabbableNode;
504
+ }
505
+ } else {
506
+ // FORWARD
507
+ // is the target the last tabbable node in a group?
508
+ var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
509
+ var lastTabbableNode = _ref3.lastTabbableNode;
510
+ return target === lastTabbableNode;
511
+ });
512
+
513
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || firstTabbable.isFocusable(target, config.tabbableOptions) && !firstTabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
514
+ // an exception case where the target is the container itself, or
515
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
516
+ // and user clicked on it or node was programmatically given focus)
517
+ // and is not followed by any other tabbable node, in which
518
+ // case, we should handle tab as if focus were on the container's
519
+ // last tabbable node, and go to the first tabbable node of the FIRST group
520
+ lastOfGroupIndex = containerIndex;
521
+ }
522
+
523
+ if (lastOfGroupIndex >= 0) {
524
+ // YES: then tab should go to the first tabbable node in the next
525
+ // group (and wrap around to the first tabbable node of the FIRST
526
+ // group if it's the last tabbable node of the LAST group)
527
+ var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
528
+
529
+ var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
530
+ destinationNode = _destinationGroup.firstTabbableNode;
531
+ }
532
+ }
533
+ } else {
534
+ // NOTE: the fallbackFocus option does not support returning false to opt-out
535
+ destinationNode = getNodeForOption('fallbackFocus');
536
+ }
537
+
538
+ if (destinationNode) {
539
+ e.preventDefault();
540
+ tryFocus(destinationNode);
541
+ } // else, let the browser take care of [shift+]tab and move the focus
542
+
543
+ };
544
+
545
+ var checkKey = function checkKey(e) {
546
+ if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates, e) !== false) {
547
+ e.preventDefault();
548
+ trap.deactivate();
549
+ return;
550
+ }
551
+
552
+ if (isTabEvent(e)) {
553
+ checkTab(e);
554
+ return;
555
+ }
556
+ };
557
+
558
+ var checkClick = function checkClick(e) {
559
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
560
+ return;
561
+ }
562
+
563
+ var target = getActualTarget(e);
564
+
565
+ if (findContainerIndex(target) >= 0) {
566
+ return;
567
+ }
568
+
569
+ if (valueOrHandler(config.allowOutsideClick, e)) {
570
+ return;
571
+ }
572
+
573
+ e.preventDefault();
574
+ e.stopImmediatePropagation();
575
+ }; //
576
+ // EVENT LISTENERS
577
+ //
578
+
579
+
580
+ var addListeners = function addListeners() {
581
+ if (!state.active) {
582
+ return;
583
+ } // There can be only one listening focus trap at a time
584
+
585
+
586
+ activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
587
+ // that caused the focus trap activation.
588
+
589
+ state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
590
+ tryFocus(getInitialFocusNode());
591
+ }) : tryFocus(getInitialFocusNode());
592
+ doc.addEventListener('focusin', checkFocusIn, true);
593
+ doc.addEventListener('mousedown', checkPointerDown, {
594
+ capture: true,
595
+ passive: false
596
+ });
597
+ doc.addEventListener('touchstart', checkPointerDown, {
598
+ capture: true,
599
+ passive: false
600
+ });
601
+ doc.addEventListener('click', checkClick, {
602
+ capture: true,
603
+ passive: false
604
+ });
605
+ doc.addEventListener('keydown', checkKey, {
606
+ capture: true,
607
+ passive: false
608
+ });
609
+ return trap;
610
+ };
611
+
612
+ var removeListeners = function removeListeners() {
613
+ if (!state.active) {
614
+ return;
615
+ }
616
+
617
+ doc.removeEventListener('focusin', checkFocusIn, true);
618
+ doc.removeEventListener('mousedown', checkPointerDown, true);
619
+ doc.removeEventListener('touchstart', checkPointerDown, true);
620
+ doc.removeEventListener('click', checkClick, true);
621
+ doc.removeEventListener('keydown', checkKey, true);
622
+ return trap;
623
+ }; //
624
+ // TRAP DEFINITION
625
+ //
626
+
627
+
628
+ trap = {
629
+ activate: function activate(activateOptions) {
630
+ if (state.active) {
631
+ return this;
632
+ }
633
+
634
+ var onActivate = getOption(activateOptions, 'onActivate');
635
+ var onPostActivate = getOption(activateOptions, 'onPostActivate');
636
+ var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
637
+
638
+ if (!checkCanFocusTrap) {
639
+ updateTabbableNodes();
640
+ }
641
+
642
+ state.active = true;
643
+ state.paused = false;
644
+ state.nodeFocusedBeforeActivation = doc.activeElement;
645
+
646
+ if (onActivate) {
647
+ onActivate();
648
+ }
649
+
650
+ var finishActivation = function finishActivation() {
651
+ if (checkCanFocusTrap) {
652
+ updateTabbableNodes();
653
+ }
654
+
655
+ addListeners();
656
+
657
+ if (onPostActivate) {
658
+ onPostActivate();
659
+ }
660
+ };
661
+
662
+ if (checkCanFocusTrap) {
663
+ checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
664
+ return this;
665
+ }
666
+
667
+ finishActivation();
668
+ return this;
669
+ },
670
+ deactivate: function deactivate(deactivateOptions) {
671
+ if (!state.active) {
672
+ return this;
673
+ }
674
+
675
+ clearTimeout(state.delayInitialFocusTimer); // noop if undefined
676
+
677
+ state.delayInitialFocusTimer = undefined;
678
+ removeListeners();
679
+ state.active = false;
680
+ state.paused = false;
681
+ activeFocusTraps.deactivateTrap(trap);
682
+ var onDeactivate = getOption(deactivateOptions, 'onDeactivate');
683
+ var onPostDeactivate = getOption(deactivateOptions, 'onPostDeactivate');
684
+ var checkCanReturnFocus = getOption(deactivateOptions, 'checkCanReturnFocus');
685
+
686
+ if (onDeactivate) {
687
+ onDeactivate();
688
+ }
689
+
690
+ var returnFocus = getOption(deactivateOptions, 'returnFocus', 'returnFocusOnDeactivate');
691
+
692
+ var finishDeactivation = function finishDeactivation() {
693
+ delay(function () {
694
+ if (returnFocus) {
695
+ tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
696
+ }
697
+
698
+ if (onPostDeactivate) {
699
+ onPostDeactivate();
700
+ }
701
+ });
702
+ };
703
+
704
+ if (returnFocus && checkCanReturnFocus) {
705
+ checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
706
+ return this;
707
+ }
708
+
709
+ finishDeactivation();
710
+ return this;
711
+ },
712
+ pause: function pause() {
713
+ if (state.paused || !state.active) {
714
+ return this;
715
+ }
716
+
717
+ state.paused = true;
718
+ removeListeners();
719
+ return this;
720
+ },
721
+ unpause: function unpause() {
722
+ if (!state.paused || !state.active) {
723
+ return this;
724
+ }
725
+
726
+ state.paused = false;
727
+ updateTabbableNodes();
728
+ addListeners();
729
+ return this;
730
+ },
731
+ updateContainerElements: function updateContainerElements(containerElements) {
732
+ var elementsAsArray = [].concat(containerElements).filter(Boolean);
733
+ state.containers = elementsAsArray.map(function (element) {
734
+ return typeof element === 'string' ? doc.querySelector(element) : element;
735
+ });
736
+
737
+ if (state.active) {
738
+ updateTabbableNodes();
739
+ }
740
+
741
+ return this;
742
+ }
743
+ }; // initialize container elements
744
+
745
+ trap.updateContainerElements(elements);
746
+ return trap;
747
+ };
748
+
749
+ const catMenuCss = ":host{display:contents}:host([hidden]){display:none}.content{padding-top:0.5rem;padding-bottom:0.5rem;position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-width:8rem;max-width:16rem;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:0.25rem;z-index:100}";
750
+
751
+ let nextUniqueId = 0;
752
+ const CatMenu = class {
753
+ constructor(hostRef) {
754
+ index.registerInstance(this, hostRef);
755
+ this.catOpen = index.createEvent(this, "catOpen", 7);
756
+ this.catClose = index.createEvent(this, "catClose", 7);
757
+ this.id = nextUniqueId++;
758
+ /**
759
+ * The placement of the menu.
760
+ */
761
+ this.placement = 'bottom-start';
762
+ }
763
+ clickHandler(event) {
764
+ var _a;
765
+ // hide menu on button click
766
+ if (this.content && event.composedPath().includes(this.content)) {
767
+ (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
768
+ this.hide();
769
+ }
770
+ }
771
+ componentDidLoad() {
772
+ var _a, _b, _c, _d, _e;
773
+ this.trigger = firstTabbable.firstTabbable(this.triggerSlot);
774
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-haspopup', 'true');
775
+ (_b = this.trigger) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'false');
776
+ (_c = this.trigger) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-controls', this.contentId);
777
+ (_d = this.content) === null || _d === void 0 ? void 0 : _d.setAttribute('id', this.contentId);
778
+ if (this.trigger && this.content) {
779
+ (_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => this.show());
780
+ firstTabbable.autoUpdate(this.trigger, this.content, () => this.update());
781
+ }
782
+ this.keyListener = event => {
783
+ if (this.content && ['ArrowDown', 'ArrowUp'].includes(event.key)) {
784
+ const targetElements = firstTabbable.tabbable(this.content, { includeContainer: false, getShadowRoot: true });
785
+ const activeElement = firstTabbable.firstTabbable(document.activeElement);
786
+ const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;
787
+ const activeOff = event.key === 'ArrowDown' ? 1 : -1;
788
+ const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
789
+ targetElements[targetIdx].focus();
790
+ event.preventDefault();
791
+ }
792
+ };
793
+ document.addEventListener('keydown', this.keyListener);
794
+ }
795
+ disconnectedCallback() {
796
+ if (this.keyListener) {
797
+ document.removeEventListener('keydown', this.keyListener);
798
+ }
799
+ }
800
+ render() {
801
+ return (index.h(index.Host, null, index.h("slot", { name: "trigger", ref: el => (this.triggerSlot = el) }), index.h("div", { class: "content", ref: el => (this.content = el) }, index.h("slot", { name: "content" }))));
802
+ }
803
+ get contentId() {
804
+ return `cat-menu-${this.id}`;
805
+ }
806
+ show() {
807
+ var _a;
808
+ if (this.content) {
809
+ this.content.style.display = 'block';
810
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'true');
811
+ this.catOpen.emit();
812
+ this.trap = this.trap
813
+ ? this.trap.updateContainerElements(this.content)
814
+ : createFocusTrap(this.content, {
815
+ tabbableOptions: {
816
+ getShadowRoot: true
817
+ },
818
+ allowOutsideClick: true,
819
+ clickOutsideDeactivates: event => !this.content || !event.composedPath().includes(this.content),
820
+ onPostDeactivate: () => this.hide()
821
+ });
822
+ this.trap.activate();
823
+ }
824
+ }
825
+ hide() {
826
+ var _a;
827
+ if (this.content) {
828
+ this.content.style.display = '';
829
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'false');
830
+ this.catClose.emit();
831
+ }
832
+ }
833
+ update() {
834
+ if (this.trigger && this.content) {
835
+ firstTabbable.computePosition(this.trigger, this.content, {
836
+ placement: this.placement,
837
+ middleware: [firstTabbable.offset(CatMenu.OFFSET), firstTabbable.flip()]
838
+ }).then(({ x, y }) => {
839
+ if (this.content) {
840
+ Object.assign(this.content.style, {
841
+ left: `${x}px`,
842
+ top: `${y}px`
843
+ });
844
+ }
845
+ });
846
+ }
847
+ }
848
+ };
849
+ CatMenu.OFFSET = 4;
850
+ CatMenu.style = catMenuCss;
851
+
852
+ exports.cat_menu = CatMenu;
853
+
854
+ //# sourceMappingURL=cat-menu.cjs.entry.js.map