@content-blocks/js 0.7.6 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +111 -3
  3. package/THIRD-PARTY-NOTICES.md +21 -0
  4. package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -2
  5. package/dist/cjs/content-accordion.cjs.entry.js +87 -0
  6. package/dist/cjs/content-blocks.cjs.js +35 -11
  7. package/dist/cjs/content-button.cjs.entry.js +113 -0
  8. package/dist/cjs/content-carousel.cjs.entry.js +153 -47
  9. package/dist/cjs/content-grid-formatter.cjs.entry.js +102 -0
  10. package/dist/cjs/content-hero-block.cjs.entry.js +45 -0
  11. package/dist/cjs/content-image.cjs.entry.js +153 -0
  12. package/dist/cjs/content-line.cjs.entry.js +61 -0
  13. package/dist/cjs/content-navigation-block.cjs.entry.js +51 -34
  14. package/dist/cjs/content-overlay.cjs.entry.js +641 -0
  15. package/dist/cjs/content-spacer.cjs.entry.js +75 -0
  16. package/dist/cjs/content-split-block.cjs.entry.js +22 -19
  17. package/dist/cjs/content-tabs.cjs.entry.js +38 -21
  18. package/dist/cjs/content-text-block.cjs.entry.js +63 -0
  19. package/dist/cjs/content-tout-block.cjs.entry.js +34 -0
  20. package/dist/cjs/{content-accordion_11.cjs.entry.js → content-video.cjs.entry.js} +14560 -12927
  21. package/dist/cjs/{focus-trap.esm-7bc384a0.js → focus-trap.esm-ZwN-anf1.js} +484 -190
  22. package/dist/cjs/{index-2e0ce692.js → index-B1U6Gweq.js} +348 -246
  23. package/dist/cjs/index-ClnpH9XB.js +2170 -0
  24. package/dist/cjs/index-CyalvZJn.js +1719 -0
  25. package/dist/cjs/index-DUvWvBDN.js +290 -0
  26. package/dist/cjs/index-voGY4Tkl.js +4705 -0
  27. package/dist/cjs/index.cjs.js +2 -5
  28. package/dist/cjs/loader.cjs.js +3 -8
  29. package/dist/cjs/responsive-component-C5eJS82z.js +171 -0
  30. package/dist/cjs/responsive-component-DMdnQIPV.js +171 -0
  31. package/dist/cjs/swiper-KLYbvU1K.js +3931 -0
  32. package/dist/cjs/{swiper-8221f4e8.js → swiper-_Z8Y4IJI.js} +269 -236
  33. package/dist/cjs/utils-BCHaRGm_.js +462 -0
  34. package/dist/cjs/{utils-df044337.js → utils-C3gXIS2t.js} +51 -49
  35. package/dist/cjs/utils-DUvWvBDN.js +290 -0
  36. package/dist/collection/blocks/content-hero-block/content-hero-block.css +1 -1
  37. package/dist/collection/blocks/content-hero-block/content-hero-block.js +33 -48
  38. package/dist/collection/blocks/content-split-block/content-split-block.css +16 -5
  39. package/dist/collection/blocks/content-split-block/content-split-block.js +29 -48
  40. package/dist/collection/blocks/content-text-block/content-text-block.js +65 -59
  41. package/dist/collection/blocks/content-tout-block/content-tout-block.css +3 -0
  42. package/dist/collection/blocks/content-tout-block/content-tout-block.js +22 -47
  43. package/dist/collection/collection-manifest.json +8 -5
  44. package/dist/collection/components/content-accordion/content-accordion.css +20 -1
  45. package/dist/collection/components/content-accordion/content-accordion.js +67 -33
  46. package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +0 -1
  47. package/dist/collection/components/content-carousel/content-carousel.css +60 -4
  48. package/dist/collection/components/content-carousel/content-carousel.js +294 -44
  49. package/dist/collection/components/content-navigation-block/content-navigation-block.css +15 -1
  50. package/dist/collection/components/content-navigation-block/content-navigation-block.js +86 -42
  51. package/dist/collection/components/content-overlay/content-overlay.css +36 -5
  52. package/dist/collection/components/content-overlay/content-overlay.js +181 -120
  53. package/dist/collection/components/content-overlay/libraries/aria-dialog.js +0 -1
  54. package/dist/collection/components/content-overlay/libraries/aria-utilities.js +0 -1
  55. package/dist/collection/components/content-tabs/content-tabs.js +7 -49
  56. package/dist/collection/components/content-tabs/libraries/w3_tabs.js +0 -1
  57. package/dist/collection/elements/content-button/content-button.css +8 -7
  58. package/dist/collection/elements/content-button/content-button.js +103 -84
  59. package/dist/collection/elements/content-image/content-image.css +3 -1
  60. package/dist/collection/elements/content-image/content-image.js +176 -95
  61. package/dist/collection/elements/content-line/content-line.js +63 -54
  62. package/dist/collection/elements/content-video/content-video.css +1 -1
  63. package/dist/collection/elements/content-video/content-video.js +165 -92
  64. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +8 -2
  65. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +167 -89
  66. package/dist/collection/formatters/content-spacer/content-spacer.js +86 -209
  67. package/dist/collection/global/content-blocks-reset.css +77 -0
  68. package/dist/collection/index.js +1 -1
  69. package/dist/collection/sass/_mixins.scss +21 -5
  70. package/dist/collection/sass/_variables.scss +15 -15
  71. package/dist/collection/setupFiles.js +0 -1
  72. package/dist/collection/site/site.js +67 -0
  73. package/dist/collection/utils/breakpoints.js +162 -0
  74. package/dist/collection/utils/responsive-component.js +249 -0
  75. package/dist/collection/utils/utils.js +32 -42
  76. package/dist/components/content-accordion.js +65 -44
  77. package/dist/components/content-button.js +89 -43
  78. package/dist/components/content-carousel.js +172 -55
  79. package/dist/components/content-grid-formatter.js +127 -3
  80. package/dist/components/content-hero-block.js +33 -26
  81. package/dist/components/content-image.js +127 -71
  82. package/dist/components/content-line.js +56 -35
  83. package/dist/components/content-navigation-block.js +62 -39
  84. package/dist/components/content-overlay.js +128 -67
  85. package/dist/components/content-spacer.js +70 -54
  86. package/dist/components/content-split-block.js +33 -32
  87. package/dist/components/content-tabs.js +46 -25
  88. package/dist/components/content-text-block.js +55 -35
  89. package/dist/components/content-tout-block.js +29 -27
  90. package/dist/components/content-video.js +14624 -11972
  91. package/dist/{esm/focus-trap.esm-8fb54175.js → components/focus-trap.esm.js} +484 -190
  92. package/dist/components/index.d.ts +2 -0
  93. package/dist/components/index.js +3 -3
  94. package/dist/components/{p-5a91aa1b.js → index2.js} +348 -246
  95. package/dist/components/p-BWRCeMvO.js +1 -0
  96. package/dist/components/p-CYF5GU_q.js +1 -0
  97. package/dist/components/p-DXUoPIwl.js +10 -0
  98. package/dist/components/p-D_Ll4QNj.js +1 -0
  99. package/dist/components/p-DhIoW7H3.js +1 -0
  100. package/dist/components/responsive-component.js +168 -0
  101. package/dist/components/{p-e5dc4ea4.js → swiper.js} +268 -235
  102. package/dist/components/utils.js +4969 -0
  103. package/dist/{esm/utils-1c9f0ec1.js → components/utils2.js} +51 -50
  104. package/dist/content-blocks/content-accordion.entry.js +85 -0
  105. package/dist/content-blocks/content-blocks.esm.js +47 -2
  106. package/dist/content-blocks/content-button.entry.js +111 -0
  107. package/dist/content-blocks/content-carousel.entry.js +188 -0
  108. package/dist/content-blocks/content-grid-formatter.entry.js +100 -0
  109. package/dist/content-blocks/content-hero-block.entry.js +43 -0
  110. package/dist/content-blocks/content-image.entry.js +151 -0
  111. package/dist/content-blocks/content-line.entry.js +59 -0
  112. package/dist/content-blocks/content-navigation-block.entry.js +105 -0
  113. package/dist/content-blocks/content-overlay.entry.js +639 -0
  114. package/dist/content-blocks/content-spacer.entry.js +73 -0
  115. package/dist/content-blocks/content-split-block.entry.js +34 -0
  116. package/dist/content-blocks/content-tabs.entry.js +245 -0
  117. package/dist/content-blocks/content-text-block.entry.js +61 -0
  118. package/dist/content-blocks/content-tout-block.entry.js +32 -0
  119. package/dist/{esm/content-accordion_11.entry.js → content-blocks/content-video.entry.js} +14535 -12890
  120. package/dist/{components/p-a2fedf8a.js → content-blocks/focus-trap.esm-DXUoPIwl.js} +484 -190
  121. package/dist/content-blocks/global/content-blocks-reset.css +77 -0
  122. package/dist/content-blocks/index-BFDJMblF.js +4690 -0
  123. package/dist/{esm/index-f45a9c45.js → content-blocks/index-P1YnSd-O.js} +348 -246
  124. package/dist/content-blocks/index.esm.js +1 -2
  125. package/dist/content-blocks/p-008457f0.entry.js +1 -0
  126. package/dist/content-blocks/p-052692f1.entry.js +1 -0
  127. package/dist/content-blocks/p-0f71bd32.entry.js +1 -0
  128. package/dist/content-blocks/p-1f154617.entry.js +1 -0
  129. package/dist/content-blocks/p-2554ebd8.entry.js +1 -0
  130. package/dist/content-blocks/p-4afd6511.entry.js +1 -0
  131. package/dist/content-blocks/p-78d5de9f.entry.js +1 -0
  132. package/dist/content-blocks/p-7bcf7e7e.entry.js +1 -0
  133. package/dist/content-blocks/p-9058031c.entry.js +1 -0
  134. package/dist/content-blocks/p-9c41ac23.entry.js +17 -0
  135. package/dist/content-blocks/p-CLwOzPEO.js +3 -0
  136. package/dist/content-blocks/p-CYF5GU_q.js +1 -0
  137. package/dist/content-blocks/p-CjR_4mPu.js +1 -0
  138. package/dist/content-blocks/p-DQuL1Twl.js +1 -0
  139. package/dist/content-blocks/p-DXUoPIwl.js +10 -0
  140. package/dist/content-blocks/p-D_Ll4QNj.js +1 -0
  141. package/dist/content-blocks/p-DhIoW7H3.js +1 -0
  142. package/dist/content-blocks/p-DzYwy_62.js +1 -0
  143. package/dist/content-blocks/p-b2e6358a.entry.js +1 -0
  144. package/dist/content-blocks/p-c783bc68.entry.js +1 -0
  145. package/dist/content-blocks/p-e3d81e15.entry.js +1 -0
  146. package/dist/content-blocks/p-f23b4aae.entry.js +1 -0
  147. package/dist/content-blocks/p-f75c9094.entry.js +1 -0
  148. package/dist/content-blocks/responsive-component-BsLrcKbS.js +169 -0
  149. package/dist/content-blocks/sass/_mixins.scss +21 -5
  150. package/dist/content-blocks/sass/_variables.scss +15 -15
  151. package/dist/{esm/swiper-e9621adb.js → content-blocks/swiper-nBv069TB.js} +268 -235
  152. package/dist/{components/p-b85cfa86.js → content-blocks/utils--SDsQnWS.js} +51 -50
  153. package/dist/content-blocks/utils-Bak__24s.js +280 -0
  154. package/dist/docs.d.ts +480 -0
  155. package/dist/docs.json +5312 -0
  156. package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -2
  157. package/dist/esm/content-accordion.entry.js +85 -0
  158. package/dist/esm/content-blocks.js +33 -8
  159. package/dist/esm/content-button.entry.js +111 -0
  160. package/dist/esm/content-carousel.entry.js +153 -45
  161. package/dist/esm/content-grid-formatter.entry.js +100 -0
  162. package/dist/esm/content-hero-block.entry.js +43 -0
  163. package/dist/esm/content-image.entry.js +151 -0
  164. package/dist/esm/content-line.entry.js +59 -0
  165. package/dist/esm/content-navigation-block.entry.js +51 -32
  166. package/dist/esm/content-overlay.entry.js +639 -0
  167. package/dist/esm/content-spacer.entry.js +73 -0
  168. package/dist/esm/content-split-block.entry.js +22 -17
  169. package/dist/esm/content-tabs.entry.js +38 -19
  170. package/dist/esm/content-text-block.entry.js +61 -0
  171. package/dist/esm/content-tout-block.entry.js +32 -0
  172. package/dist/esm/content-video.entry.js +72033 -0
  173. package/dist/esm/focus-trap.esm-DXUoPIwl.js +1801 -0
  174. package/dist/esm/index-BASCLGuP.js +1713 -0
  175. package/dist/esm/index-BFDJMblF.js +4690 -0
  176. package/dist/esm/index-CLwOzPEO.js +2161 -0
  177. package/dist/esm/index-CjR_4mPu.js +280 -0
  178. package/dist/esm/index-P1YnSd-O.js +5397 -0
  179. package/dist/esm/index.js +1 -3
  180. package/dist/esm/loader.js +3 -6
  181. package/dist/esm/responsive-component-BsLrcKbS.js +169 -0
  182. package/dist/esm/responsive-component-D7dJHMp0.js +169 -0
  183. package/dist/esm/swiper-CtypHPwF.js +3928 -0
  184. package/dist/esm/swiper-nBv069TB.js +3941 -0
  185. package/dist/esm/utils--SDsQnWS.js +460 -0
  186. package/dist/esm/utils-Bak__24s.js +280 -0
  187. package/dist/esm/utils-CYF5GU_q.js +438 -0
  188. package/dist/node_modules/video.js/dist/video-js.min.css +1 -0
  189. package/dist/test/axe.js +60 -0
  190. package/dist/types/Users/shahrukceo/Developer/content-blocks/packages/js/.stencil/test/axe.d.ts +16 -0
  191. package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +7 -11
  192. package/dist/types/blocks/content-split-block/content-split-block.d.ts +5 -9
  193. package/dist/types/blocks/content-text-block/content-text-block.d.ts +4 -9
  194. package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +5 -10
  195. package/dist/types/components/content-accordion/content-accordion.d.ts +4 -3
  196. package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +0 -1
  197. package/dist/types/components/content-carousel/content-carousel.d.ts +44 -7
  198. package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +14 -8
  199. package/dist/types/components/content-overlay/content-overlay.d.ts +15 -16
  200. package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +0 -1
  201. package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +0 -1
  202. package/dist/types/components/content-tabs/content-tabs.d.ts +4 -10
  203. package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +0 -1
  204. package/dist/types/components.d.ts +900 -196
  205. package/dist/types/elements/content-button/content-button.d.ts +8 -13
  206. package/dist/types/elements/content-image/content-image.d.ts +15 -9
  207. package/dist/types/elements/content-line/content-line.d.ts +5 -12
  208. package/dist/types/elements/content-video/content-video.d.ts +12 -11
  209. package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +14 -9
  210. package/dist/types/formatters/content-spacer/content-spacer.d.ts +4 -36
  211. package/dist/types/index.d.ts +3 -1
  212. package/dist/types/setupFiles.d.ts +0 -1
  213. package/dist/types/stencil-public-runtime.d.ts +265 -60
  214. package/dist/types/typings.d.ts +10 -0
  215. package/dist/types/utils/breakpoints.d.ts +57 -0
  216. package/dist/types/utils/responsive-component.d.ts +49 -0
  217. package/dist/types/utils/utils.d.ts +11 -8
  218. package/loader/cdn.js +1 -0
  219. package/loader/index.cjs.js +1 -0
  220. package/loader/index.d.ts +24 -0
  221. package/loader/index.es2017.js +1 -0
  222. package/loader/index.js +2 -0
  223. package/package.json +75 -65
  224. package/dist/cjs/BehaviorSubject-12116537.js +0 -655
  225. package/dist/cjs/BehaviorSubject-12116537.js.map +0 -1
  226. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  227. package/dist/cjs/content-accordion_11.cjs.entry.js.map +0 -1
  228. package/dist/cjs/content-blocks.cjs.js.map +0 -1
  229. package/dist/cjs/content-carousel.cjs.entry.js.map +0 -1
  230. package/dist/cjs/content-navigation-block.cjs.entry.js.map +0 -1
  231. package/dist/cjs/content-split-block.cjs.entry.js.map +0 -1
  232. package/dist/cjs/content-tabs.cjs.entry.js.map +0 -1
  233. package/dist/cjs/focus-trap.esm-7bc384a0.js.map +0 -1
  234. package/dist/cjs/index-2e0ce692.js.map +0 -1
  235. package/dist/cjs/index-8af2820a.js +0 -1650
  236. package/dist/cjs/index-8af2820a.js.map +0 -1
  237. package/dist/cjs/index.cjs.js.map +0 -1
  238. package/dist/cjs/loader.cjs.js.map +0 -1
  239. package/dist/cjs/swiper-8221f4e8.js.map +0 -1
  240. package/dist/cjs/utils-df044337.js.map +0 -1
  241. package/dist/cjs/utils-f8ccab0a.js +0 -126
  242. package/dist/cjs/utils-f8ccab0a.js.map +0 -1
  243. package/dist/cjs/window-resize-service-65a5a370.js +0 -37
  244. package/dist/cjs/window-resize-service-65a5a370.js.map +0 -1
  245. package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +0 -1
  246. package/dist/collection/blocks/content-split-block/content-split-block.js.map +0 -1
  247. package/dist/collection/blocks/content-text-block/content-text-block.js.map +0 -1
  248. package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +0 -1
  249. package/dist/collection/components/content-accordion/content-accordion.js.map +0 -1
  250. package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +0 -1
  251. package/dist/collection/components/content-carousel/content-carousel.js.map +0 -1
  252. package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +0 -1
  253. package/dist/collection/components/content-overlay/content-overlay.js.map +0 -1
  254. package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +0 -1
  255. package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +0 -1
  256. package/dist/collection/components/content-tabs/content-tabs.js.map +0 -1
  257. package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +0 -1
  258. package/dist/collection/elements/content-button/content-button.js.map +0 -1
  259. package/dist/collection/elements/content-image/content-image.js.map +0 -1
  260. package/dist/collection/elements/content-line/content-line.js.map +0 -1
  261. package/dist/collection/elements/content-video/content-video.js.map +0 -1
  262. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +0 -1
  263. package/dist/collection/formatters/content-spacer/content-spacer.js.map +0 -1
  264. package/dist/collection/globalScript.js +0 -15
  265. package/dist/collection/globalScript.js.map +0 -1
  266. package/dist/collection/index.js.map +0 -1
  267. package/dist/collection/services/content-events-service.js +0 -23
  268. package/dist/collection/services/content-events-service.js.map +0 -1
  269. package/dist/collection/services/window-resize-service.js +0 -31
  270. package/dist/collection/services/window-resize-service.js.map +0 -1
  271. package/dist/collection/setupFiles.js.map +0 -1
  272. package/dist/collection/stories/ContentHeroBlock.stories.js +0 -51
  273. package/dist/collection/stories/ContentHeroBlock.stories.js.map +0 -1
  274. package/dist/collection/stories/ContentNavigationBlock.stories.js +0 -33
  275. package/dist/collection/stories/ContentNavigationBlock.stories.js.map +0 -1
  276. package/dist/collection/stories/ContentSpacer.stories.js +0 -20
  277. package/dist/collection/stories/ContentSpacer.stories.js.map +0 -1
  278. package/dist/collection/stories/ContentTextBlock.stories.js +0 -17
  279. package/dist/collection/stories/ContentTextBlock.stories.js.map +0 -1
  280. package/dist/collection/stories/ContentToutBlock.stories.js +0 -17
  281. package/dist/collection/stories/ContentToutBlock.stories.js.map +0 -1
  282. package/dist/collection/stories/FullPageExample.stories.js +0 -432
  283. package/dist/collection/stories/FullPageExample.stories.js.map +0 -1
  284. package/dist/collection/stories/assets/accessibility.svg +0 -5
  285. package/dist/collection/stories/assets/discord.svg +0 -15
  286. package/dist/collection/stories/assets/github.svg +0 -3
  287. package/dist/collection/stories/assets/tutorials.svg +0 -12
  288. package/dist/collection/stories/assets/youtube.svg +0 -4
  289. package/dist/collection/utils/utils.js.map +0 -1
  290. package/dist/components/content-accordion.js.map +0 -1
  291. package/dist/components/content-button.js.map +0 -1
  292. package/dist/components/content-carousel.js.map +0 -1
  293. package/dist/components/content-grid-formatter.js.map +0 -1
  294. package/dist/components/content-hero-block.js.map +0 -1
  295. package/dist/components/content-image.js.map +0 -1
  296. package/dist/components/content-line.js.map +0 -1
  297. package/dist/components/content-navigation-block.js.map +0 -1
  298. package/dist/components/content-overlay.js.map +0 -1
  299. package/dist/components/content-spacer.js.map +0 -1
  300. package/dist/components/content-split-block.js.map +0 -1
  301. package/dist/components/content-tabs.js.map +0 -1
  302. package/dist/components/content-text-block.js.map +0 -1
  303. package/dist/components/content-tout-block.js.map +0 -1
  304. package/dist/components/content-video.js.map +0 -1
  305. package/dist/components/index.js.map +0 -1
  306. package/dist/components/p-26483b46.js +0 -35
  307. package/dist/components/p-26483b46.js.map +0 -1
  308. package/dist/components/p-5a91aa1b.js.map +0 -1
  309. package/dist/components/p-74be971f.js +0 -652
  310. package/dist/components/p-74be971f.js.map +0 -1
  311. package/dist/components/p-7a436263.js +0 -122
  312. package/dist/components/p-7a436263.js.map +0 -1
  313. package/dist/components/p-a2fedf8a.js.map +0 -1
  314. package/dist/components/p-b85cfa86.js.map +0 -1
  315. package/dist/components/p-e28db040.js +0 -1452
  316. package/dist/components/p-e28db040.js.map +0 -1
  317. package/dist/components/p-e5dc4ea4.js.map +0 -1
  318. package/dist/components/p-e9bce2ab.js +0 -88
  319. package/dist/components/p-e9bce2ab.js.map +0 -1
  320. package/dist/content-blocks/content-blocks.esm.js.map +0 -1
  321. package/dist/content-blocks/index.esm.js.map +0 -1
  322. package/dist/content-blocks/p-13c3cc4f.js +0 -3
  323. package/dist/content-blocks/p-13c3cc4f.js.map +0 -1
  324. package/dist/content-blocks/p-5422c25b.entry.js +0 -2
  325. package/dist/content-blocks/p-5422c25b.entry.js.map +0 -1
  326. package/dist/content-blocks/p-5a91aa1b.js +0 -2
  327. package/dist/content-blocks/p-5a91aa1b.js.map +0 -1
  328. package/dist/content-blocks/p-650d1757.js +0 -2
  329. package/dist/content-blocks/p-650d1757.js.map +0 -1
  330. package/dist/content-blocks/p-74be971f.js +0 -2
  331. package/dist/content-blocks/p-74be971f.js.map +0 -1
  332. package/dist/content-blocks/p-8deb755c.entry.js +0 -26
  333. package/dist/content-blocks/p-8deb755c.entry.js.map +0 -1
  334. package/dist/content-blocks/p-a2fedf8a.js +0 -10
  335. package/dist/content-blocks/p-a2fedf8a.js.map +0 -1
  336. package/dist/content-blocks/p-b305392e.entry.js +0 -2
  337. package/dist/content-blocks/p-b305392e.entry.js.map +0 -1
  338. package/dist/content-blocks/p-b85cfa86.js +0 -2
  339. package/dist/content-blocks/p-b85cfa86.js.map +0 -1
  340. package/dist/content-blocks/p-cc7397cf.js +0 -2
  341. package/dist/content-blocks/p-cc7397cf.js.map +0 -1
  342. package/dist/content-blocks/p-d62775d7.entry.js +0 -2
  343. package/dist/content-blocks/p-d62775d7.entry.js.map +0 -1
  344. package/dist/content-blocks/p-e1255160.js +0 -2
  345. package/dist/content-blocks/p-e1255160.js.map +0 -1
  346. package/dist/content-blocks/p-e5dc4ea4.js +0 -2
  347. package/dist/content-blocks/p-e5dc4ea4.js.map +0 -1
  348. package/dist/content-blocks/p-f73f934a.entry.js +0 -2
  349. package/dist/content-blocks/p-f73f934a.entry.js.map +0 -1
  350. package/dist/esm/BehaviorSubject-f7a12fd8.js +0 -652
  351. package/dist/esm/BehaviorSubject-f7a12fd8.js.map +0 -1
  352. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  353. package/dist/esm/content-accordion_11.entry.js.map +0 -1
  354. package/dist/esm/content-blocks.js.map +0 -1
  355. package/dist/esm/content-carousel.entry.js.map +0 -1
  356. package/dist/esm/content-navigation-block.entry.js.map +0 -1
  357. package/dist/esm/content-split-block.entry.js.map +0 -1
  358. package/dist/esm/content-tabs.entry.js.map +0 -1
  359. package/dist/esm/focus-trap.esm-8fb54175.js.map +0 -1
  360. package/dist/esm/index-ec24af7a.js +0 -1621
  361. package/dist/esm/index-ec24af7a.js.map +0 -1
  362. package/dist/esm/index-f45a9c45.js.map +0 -1
  363. package/dist/esm/index.js.map +0 -1
  364. package/dist/esm/loader.js.map +0 -1
  365. package/dist/esm/swiper-e9621adb.js.map +0 -1
  366. package/dist/esm/utils-1c9f0ec1.js.map +0 -1
  367. package/dist/esm/utils-9a901aa9.js +0 -122
  368. package/dist/esm/utils-9a901aa9.js.map +0 -1
  369. package/dist/esm/window-resize-service-354f2ac5.js +0 -35
  370. package/dist/esm/window-resize-service-354f2ac5.js.map +0 -1
  371. package/dist/types/globalScript.d.ts +0 -1
  372. package/dist/types/old-components.d.ts +0 -1239
  373. package/dist/types/services/content-events-service.d.ts +0 -11
  374. package/dist/types/services/window-resize-service.d.ts +0 -11
  375. package/dist/types/stories/ContentHeroBlock.stories.d.ts +0 -11
  376. package/dist/types/stories/ContentNavigationBlock.stories.d.ts +0 -9
  377. package/dist/types/stories/ContentSpacer.stories.d.ts +0 -15
  378. package/dist/types/stories/ContentTextBlock.stories.d.ts +0 -9
  379. package/dist/types/stories/ContentToutBlock.stories.d.ts +0 -9
  380. package/dist/types/stories/FullPageExample.stories.d.ts +0 -10
@@ -0,0 +1,641 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-voGY4Tkl.js');
4
+ var responsiveComponent = require('./responsive-component-C5eJS82z.js');
5
+ var focusTrap_esm = require('./focus-trap.esm-ZwN-anf1.js');
6
+ require('./utils-DUvWvBDN.js');
7
+
8
+ /**
9
+ * @namespace aria
10
+ */
11
+ var aria$1 = aria$1 || {};
12
+ aria$1.Utils = aria$1.Utils || {};
13
+ // Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
14
+ aria$1.Utils.matches = function (element, selector) {
15
+ return element.matches(selector);
16
+ };
17
+ aria$1.Utils.remove = function (item) {
18
+ if (item.remove && typeof item.remove === 'function') {
19
+ return item.remove();
20
+ }
21
+ if (item.parentNode &&
22
+ item.parentNode.removeChild &&
23
+ typeof item.parentNode.removeChild === 'function') {
24
+ return item.parentNode.removeChild(item);
25
+ }
26
+ return false;
27
+ };
28
+ aria$1.Utils.isFocusable = function (element) {
29
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
30
+ return true;
31
+ }
32
+ if (element.disabled) {
33
+ return false;
34
+ }
35
+ switch (element.nodeName) {
36
+ case 'A':
37
+ return !!element.href && element.rel != 'ignore';
38
+ case 'INPUT':
39
+ return element.type != 'hidden' && element.type != 'file';
40
+ case 'BUTTON':
41
+ case 'SELECT':
42
+ case 'TEXTAREA':
43
+ return true;
44
+ default:
45
+ return false;
46
+ }
47
+ };
48
+ aria$1.Utils.getAncestorBySelector = function (element, selector) {
49
+ if (!aria$1.Utils.matches(element, selector + ' ' + element.tagName)) {
50
+ // Element is not inside an element that matches selector
51
+ return null;
52
+ }
53
+ // Move up the DOM tree until a parent matching the selector is found
54
+ var currentNode = element;
55
+ var ancestor = null;
56
+ while (ancestor === null) {
57
+ if (aria$1.Utils.matches(currentNode.parentNode, selector)) {
58
+ ancestor = currentNode.parentNode;
59
+ }
60
+ else {
61
+ currentNode = currentNode.parentNode;
62
+ }
63
+ }
64
+ return ancestor;
65
+ };
66
+ aria$1.Utils.hasClass = function (element, className) {
67
+ return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
68
+ };
69
+ aria$1.Utils.addClass = function (element, className) {
70
+ if (!aria$1.Utils.hasClass(element, className)) {
71
+ element.className += ' ' + className;
72
+ }
73
+ };
74
+ aria$1.Utils.removeClass = function (element, className) {
75
+ var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
76
+ element.className = element.className.replace(classRegex, ' ').trim();
77
+ };
78
+ aria$1.Utils.bindMethods = function (object) {
79
+ var methodNames = Array.prototype.slice.call(arguments, 1);
80
+ methodNames.forEach(function (method) {
81
+ object[method] = object[method].bind(object);
82
+ });
83
+ };
84
+ window.aria = aria$1;
85
+
86
+ /*
87
+ * This content is licensed according to the W3C Software License at
88
+ * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
89
+ */
90
+ /**
91
+ * @namespace aria
92
+ */
93
+ var aria = aria || {};
94
+ aria.Utils = aria.Utils || {};
95
+ // Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
96
+ aria.Utils.matches = function (element, selector) {
97
+ return element.matches(selector);
98
+ };
99
+ aria.Utils.remove = function (item) {
100
+ if (item.remove && typeof item.remove === 'function') {
101
+ return item.remove();
102
+ }
103
+ if (item.parentNode &&
104
+ item.parentNode.removeChild &&
105
+ typeof item.parentNode.removeChild === 'function') {
106
+ return item.parentNode.removeChild(item);
107
+ }
108
+ return false;
109
+ };
110
+ aria.Utils.isFocusable = function (element) {
111
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
112
+ return true;
113
+ }
114
+ if (element.disabled) {
115
+ return false;
116
+ }
117
+ switch (element.nodeName) {
118
+ case 'A':
119
+ return !!element.href && element.rel != 'ignore';
120
+ case 'INPUT':
121
+ return element.type != 'hidden' && element.type != 'file';
122
+ case 'BUTTON':
123
+ case 'SELECT':
124
+ case 'TEXTAREA':
125
+ return true;
126
+ default:
127
+ return false;
128
+ }
129
+ };
130
+ aria.Utils.getAncestorBySelector = function (element, selector) {
131
+ if (!aria.Utils.matches(element, selector + ' ' + element.tagName)) {
132
+ // Element is not inside an element that matches selector
133
+ return null;
134
+ }
135
+ // Move up the DOM tree until a parent matching the selector is found
136
+ var currentNode = element;
137
+ var ancestor = null;
138
+ while (ancestor === null) {
139
+ if (aria.Utils.matches(currentNode.parentNode, selector)) {
140
+ ancestor = currentNode.parentNode;
141
+ }
142
+ else {
143
+ currentNode = currentNode.parentNode;
144
+ }
145
+ }
146
+ return ancestor;
147
+ };
148
+ aria.Utils.hasClass = function (element, className) {
149
+ return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
150
+ };
151
+ aria.Utils.addClass = function (element, className) {
152
+ if (!aria.Utils.hasClass(element, className)) {
153
+ element.className += ' ' + className;
154
+ }
155
+ };
156
+ aria.Utils.removeClass = function (element, className) {
157
+ var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
158
+ element.className = element.className.replace(classRegex, ' ').trim();
159
+ };
160
+ aria.Utils.bindMethods = function (object) {
161
+ var methodNames = Array.prototype.slice.call(arguments, 1);
162
+ methodNames.forEach(function (method) {
163
+ object[method] = object[method].bind(object);
164
+ });
165
+ };
166
+ /*
167
+ * When util functions move focus around, set this true so the focus listener
168
+ * can ignore the events.
169
+ */
170
+ aria.Utils.IgnoreUtilFocusChanges = false;
171
+ aria.Utils.dialogOpenClass = 'has-dialog';
172
+ /**
173
+ * @desc Set focus on descendant nodes until the first focusable element is
174
+ * found.
175
+ * @param element
176
+ * DOM node for which to find the first focusable descendant.
177
+ * @returns
178
+ * true if a focusable element is found and focus is set.
179
+ */
180
+ aria.Utils.focusFirstDescendant = function (element) {
181
+ for (var i = 0; i < element.childNodes.length; i++) {
182
+ var child = element.childNodes[i];
183
+ if (aria.Utils.attemptFocus(child) ||
184
+ aria.Utils.focusFirstDescendant(child)) {
185
+ return true;
186
+ }
187
+ }
188
+ return false;
189
+ }; // end focusFirstDescendant
190
+ /**
191
+ * @desc Find the last descendant node that is focusable.
192
+ * @param element
193
+ * DOM node for which to find the last focusable descendant.
194
+ * @returns
195
+ * true if a focusable element is found and focus is set.
196
+ */
197
+ aria.Utils.focusLastDescendant = function (element) {
198
+ for (var i = element.childNodes.length - 1; i >= 0; i--) {
199
+ var child = element.childNodes[i];
200
+ if (aria.Utils.attemptFocus(child) ||
201
+ aria.Utils.focusLastDescendant(child)) {
202
+ return true;
203
+ }
204
+ }
205
+ return false;
206
+ }; // end focusLastDescendant
207
+ /**
208
+ * @desc Set Attempt to set focus on the current node.
209
+ * @param element
210
+ * The node to attempt to focus on.
211
+ * @returns
212
+ * true if element is focused.
213
+ */
214
+ aria.Utils.attemptFocus = function (element) {
215
+ if (!aria.Utils.isFocusable(element)) {
216
+ return false;
217
+ }
218
+ aria.Utils.IgnoreUtilFocusChanges = true;
219
+ try {
220
+ element.focus();
221
+ }
222
+ catch (e) {
223
+ }
224
+ aria.Utils.IgnoreUtilFocusChanges = false;
225
+ return (document.activeElement === element);
226
+ }; // end attemptFocus
227
+ /* Modals can open modals. Keep track of them with this array. */
228
+ aria.OpenDialogList = aria.OpenDialogList || new Array(0);
229
+ /**
230
+ * @returns the last opened dialog (the current dialog)
231
+ */
232
+ aria.getCurrentDialog = function () {
233
+ if (aria.OpenDialogList && aria.OpenDialogList.length) {
234
+ return aria.OpenDialogList[aria.OpenDialogList.length - 1];
235
+ }
236
+ };
237
+ aria.closeCurrentDialog = function () {
238
+ var currentDialog = aria.getCurrentDialog();
239
+ if (currentDialog) {
240
+ currentDialog.close();
241
+ return true;
242
+ }
243
+ return false;
244
+ };
245
+ aria.handleEscape = function (event) {
246
+ if (event.key === 'Escape' && aria.closeCurrentDialog()) {
247
+ event.stopPropagation();
248
+ }
249
+ };
250
+ document.addEventListener('keyup', aria.handleEscape);
251
+ /**
252
+ * @constructor
253
+ * @desc Dialog object providing modal focus management.
254
+ *
255
+ * Assumptions: The element serving as the dialog container is present in the
256
+ * DOM and hidden. The dialog container has role='dialog'.
257
+ *
258
+ * @param dialogNode
259
+ * The element serving as the dialog container.
260
+ * @param focusAfterClosed
261
+ * Either the DOM node or the ID of the DOM node to focus when the
262
+ * dialog closes.
263
+ * @param focusFirst
264
+ * Optional parameter containing either the DOM node or the ID of the
265
+ * DOM node to focus when the dialog opens. If not specified, the
266
+ * first focusable element in the dialog will receive focus.
267
+ */
268
+ aria.Dialog = function (dialogNode, focusAfterClosed, focusFirst, isFullScreen) {
269
+ this.dialogNode = dialogNode;
270
+ if (this.dialogNode === null) {
271
+ throw new Error('No element found');
272
+ }
273
+ var validRoles = ['dialog', 'alertdialog'];
274
+ var isDialog = (this.dialogNode.getAttribute('role') || '')
275
+ .trim()
276
+ .split(/\s+/g)
277
+ .some(function (token) {
278
+ return validRoles.some(function (role) {
279
+ return token === role;
280
+ });
281
+ });
282
+ if (!isDialog) {
283
+ throw new Error('Dialog() requires a DOM element with ARIA role of dialog or alertdialog.');
284
+ }
285
+ // Wrap in an individual backdrop element if one doesn't exist
286
+ // Native <dialog> elements use the ::backdrop pseudo-element, which
287
+ // works similarly.
288
+ var backdropClass = 'content-overlay-background';
289
+ if (this.dialogNode.parentNode.classList.contains(backdropClass)) {
290
+ this.backdropNode = this.dialogNode.parentNode;
291
+ }
292
+ else {
293
+ this.backdropNode = document.createElement('div');
294
+ this.backdropNode.className = backdropClass;
295
+ this.dialogNode.parentNode.insertBefore(this.backdropNode, this.dialogNode);
296
+ this.backdropNode.appendChild(this.dialogNode);
297
+ }
298
+ this.backdropNode.classList.add('active');
299
+ setTimeout(() => {
300
+ this.backdropNode.classList.add('transition');
301
+ }, 1);
302
+ // Disable scroll on the body element
303
+ this.isFullscreen = isFullScreen;
304
+ if (isFullScreen) {
305
+ document.body.classList.add(aria.Utils.dialogOpenClass);
306
+ }
307
+ if (typeof focusAfterClosed === 'string') {
308
+ this.focusAfterClosed = document.getElementById(focusAfterClosed);
309
+ }
310
+ else if (typeof focusAfterClosed === 'object') {
311
+ this.focusAfterClosed = focusAfterClosed;
312
+ }
313
+ else {
314
+ throw new Error('the focusAfterClosed parameter is required for the aria.Dialog constructor.');
315
+ }
316
+ if (typeof focusFirst === 'string') {
317
+ this.focusFirst = document.getElementById(focusFirst);
318
+ }
319
+ else if (typeof focusFirst === 'object') {
320
+ this.focusFirst = focusFirst;
321
+ }
322
+ else {
323
+ this.focusFirst = null;
324
+ }
325
+ // Bracket the dialog node with two invisible, focusable nodes.
326
+ // While this dialog is open, we use these to make sure that focus never
327
+ // leaves the document even if dialogNode is the first or last node.
328
+ var preDiv = document.createElement('div');
329
+ this.preNode = this.dialogNode.parentNode.insertBefore(preDiv, this.dialogNode);
330
+ this.preNode.tabIndex = 0;
331
+ var postDiv = document.createElement('div');
332
+ this.postNode = this.dialogNode.parentNode.insertBefore(postDiv, this.dialogNode.nextSibling);
333
+ this.postNode.tabIndex = 0;
334
+ // If this modal is opening on top of one that is already open,
335
+ // get rid of the document focus listener of the open dialog.
336
+ if (aria.OpenDialogList.length > 0) {
337
+ aria.getCurrentDialog().removeListeners();
338
+ }
339
+ if (isFullScreen) {
340
+ this.addListeners();
341
+ }
342
+ aria.OpenDialogList.push(this);
343
+ this.dialogNode.className = 'content-overlay-dialog'; // make visible
344
+ if (this.focusFirst) {
345
+ this.focusFirst.focus();
346
+ }
347
+ else {
348
+ aria.Utils.focusFirstDescendant(this.dialogNode);
349
+ }
350
+ this.lastFocus = document.activeElement;
351
+ }; // end Dialog constructor
352
+ /**
353
+ * @desc
354
+ * Hides the current top dialog,
355
+ * removes listeners of the top dialog,
356
+ * restore listeners of a parent dialog if one was open under the one that just closed,
357
+ * and sets focus on the element specified for focusAfterClosed.
358
+ */
359
+ aria.Dialog.prototype.close = function () {
360
+ aria.OpenDialogList.pop();
361
+ this.removeListeners();
362
+ aria.Utils.remove(this.preNode);
363
+ aria.Utils.remove(this.postNode);
364
+ this.dialogNode.className = 'hidden';
365
+ this.backdropNode.classList.remove('active');
366
+ this.backdropNode.classList.remove('transition');
367
+ this.focusAfterClosed.focus();
368
+ // If a dialog was open underneath this one, restore its listeners.
369
+ if (aria.OpenDialogList.length > 0 && aria.OpenDialogList.filter(dialog => dialog.isFullscreen === true).length) {
370
+ aria.getCurrentDialog().addListeners();
371
+ }
372
+ else {
373
+ document.body.classList.remove(aria.Utils.dialogOpenClass);
374
+ }
375
+ this.dialogNode.dispatchEvent(new CustomEvent("ariaDialog.closed", {
376
+ bubbles: true,
377
+ "detail": {}
378
+ }));
379
+ }; // end close
380
+ /**
381
+ * @desc
382
+ * Hides the current dialog and replaces it with another.
383
+ *
384
+ * @param newDialogId
385
+ * ID of the dialog that will replace the currently open top dialog.
386
+ * @param newFocusAfterClosed
387
+ * Optional ID or DOM node specifying where to place focus when the new dialog closes.
388
+ * If not specified, focus will be placed on the element specified by the dialog being replaced.
389
+ * @param newFocusFirst
390
+ * Optional ID or DOM node specifying where to place focus in the new dialog when it opens.
391
+ * If not specified, the first focusable element will receive focus.
392
+ */
393
+ aria.Dialog.prototype.replace = function (newDialogId, newFocusAfterClosed, newFocusFirst) {
394
+ // var closedDialog = aria.getCurrentDialog();
395
+ aria.OpenDialogList.pop();
396
+ this.removeListeners();
397
+ aria.Utils.remove(this.preNode);
398
+ aria.Utils.remove(this.postNode);
399
+ this.dialogNode.className = 'hidden';
400
+ this.backdropNode.classList.remove('active');
401
+ this.backdropNode.classList.remove('transition');
402
+ var focusAfterClosed = newFocusAfterClosed || this.focusAfterClosed;
403
+ new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
404
+ // var dialog = new aria.Dialog(newDialogId, focusAfterClosed, newFocusFirst);
405
+ }; // end replace
406
+ aria.Dialog.prototype.addListeners = function () {
407
+ document.addEventListener('focus', this.trapFocus, true);
408
+ }; // end addListeners
409
+ aria.Dialog.prototype.removeListeners = function () {
410
+ document.removeEventListener('focus', this.trapFocus, true);
411
+ }; // end removeListeners
412
+ aria.Dialog.prototype.trapFocus = function (event) {
413
+ if (aria.Utils.IgnoreUtilFocusChanges) {
414
+ return;
415
+ }
416
+ var currentDialog = aria.getCurrentDialog();
417
+ if (currentDialog.dialogNode.contains(event.target)) {
418
+ currentDialog.lastFocus = event.target;
419
+ }
420
+ else {
421
+ aria.Utils.focusFirstDescendant(currentDialog.dialogNode);
422
+ if (currentDialog.lastFocus == document.activeElement) {
423
+ aria.Utils.focusLastDescendant(currentDialog.dialogNode);
424
+ }
425
+ currentDialog.lastFocus = document.activeElement;
426
+ }
427
+ }; // end trapFocus
428
+ aria.closeDialog = function (closeButton) {
429
+ var topDialog = aria.getCurrentDialog();
430
+ if (topDialog.dialogNode.contains(closeButton)) {
431
+ topDialog.close();
432
+ }
433
+ }; // end closeDialog
434
+ aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst) {
435
+ var topDialog = aria.getCurrentDialog();
436
+ if (topDialog.dialogNode.contains(document.activeElement)) {
437
+ topDialog.replace(newDialogId, newFocusAfterClosed, newFocusFirst);
438
+ }
439
+ }; // end replaceDialog
440
+ window.aria = aria;
441
+
442
+ const contentOverlayCss = () => `*{box-sizing:border-box}.content-overlay-open--fixed{overflow:hidden}.content-block-overlay-container{position:relative;display:block;width:100%;height:100%}content-overlay{display:none;position:relative;flex:0}content-overlay[size=mini] .content-overlay-background.active{display:flex;align-items:center;justify-content:center}content-overlay .content-overlay__content>*[slot=content]{height:100%;overflow:auto}content-overlay.content-overlay-active{display:flex}content-overlay[vertical=left]{align-items:flex-start}content-overlay[vertical=center]{align-items:center}content-overlay[vertical=right]{align-items:flex-end}content-overlay[vertical=top]{justify-content:flex-start;top:0}content-overlay[vertical=center]{justify-content:center}content-overlay[vertical=bottom]{justify-content:flex-end;bottom:0}content-overlay .content-overlay-background{background:var(--content-overlay-backdrop, rgba(255, 255, 255, 0.6));bottom:0;display:none;top:0;z-index:100000;right:0;left:0;width:100%}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay:not([size=mini]) .content-overlay__header--floating{position:absolute;top:0;right:0;z-index:2}content-overlay [role=dialog]{position:relative}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none;min-width:40px;color:inherit}content-overlay[data-position=fixed] .content-overlay-background{position:fixed}content-overlay[data-position=absolute]{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;top:0;left:0}content-overlay[data-position=absolute] .content-overlay-background{position:static}content-overlay[data-position=absolute] .content-overlay__content,content-overlay[data-position=fixed] .content-overlay__content{flex:1;overflow:auto}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}content-overlay[full-screen=true]{height:100%}content-overlay[full-screen=true] .content-overlay-background{height:100%}content-overlay:where([size=mini]) .content-overlay-background.active{padding:1rem;background:var(--content-overlay-backdrop, rgba(0, 0, 0, 0.7))}content-overlay:where([size=mini]) [role=dialog]{width:100%;height:auto;max-width:var(--content-overlay-max-width, 640px);max-height:100%;padding:var(--content-overlay-padding, 1.5rem);overflow:auto;background:var(--content-overlay-background, #fff);border-radius:var(--content-overlay-radius, 4px)}body.has-dialog{overflow:hidden}`;
443
+
444
+ let overlayCount = 0;
445
+ const ContentOverlay = class extends responsiveComponent.ResponsiveComponent {
446
+ constructor(hostRef) {
447
+ super();
448
+ index.registerInstance(this, hostRef);
449
+ this.contentOverlayActivated = index.createEvent(this, "contentOverlayActivated", 7);
450
+ this.contentOverlayDeactivated = index.createEvent(this, "contentOverlayDeactivated", 7);
451
+ }
452
+ get hostElement() { return index.getElement(this); }
453
+ /**
454
+ * What the overlay covers. "body", the default, covers the whole screen. A CSS selector, such as "#hero",
455
+ * covers that element instead: the overlay moves into it when it opens. Use pipes to cover the screen on
456
+ * phones and an element on wider screens: fill="body|#hero".
457
+ * @type String
458
+ * @responsive
459
+ */
460
+ fill = 'body';
461
+ /**
462
+ * @type Boolean
463
+ * @responsive
464
+ */
465
+ open = 'false';
466
+ /**
467
+ * @type Boolean
468
+ * @responsive
469
+ */
470
+ fullScreen = 'true';
471
+ /**
472
+ * A pipe delimited setting for horizontal alignment. This only applies when fullscreen mode is activated.
473
+ * @type Select
474
+ * @options default
475
+ * @options left
476
+ * @options center
477
+ * @options right
478
+ * @responsive
479
+ */
480
+ horizontal = 'center';
481
+ /**
482
+ * A pipe delimited setting for vertical alignment. This only applies when fullscreen mode is activated.
483
+ * @type Select
484
+ * @options top
485
+ * @options center
486
+ * @options bottom
487
+ */
488
+ vertical = 'center';
489
+ /**
490
+ * Title attribute value for the close button.
491
+ * @type String
492
+ */
493
+ closeTitle = 'Close Overlay';
494
+ /**
495
+ * The accessible name of the dialog. Only needed when there is no header slot, which names it otherwise.
496
+ * @type String
497
+ */
498
+ label;
499
+ headerId;
500
+ // Worked out from fill: fixed over the screen, or absolute inside the element it fills.
501
+ position = 'fixed';
502
+ // The body class added when it opened, so closing removes that one even if the breakpoint changed since.
503
+ openClass;
504
+ isActive = false;
505
+ activeClass = '';
506
+ contentOverlayActivated;
507
+ contentOverlayDeactivated;
508
+ contentSlot;
509
+ dialogElement;
510
+ contentElement;
511
+ isFullScreen = false;
512
+ hasCloseButton = false;
513
+ originalMarkup;
514
+ ariaDialog;
515
+ focusTrap;
516
+ onContentBlockToggle(event) {
517
+ if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
518
+ event.preventDefault();
519
+ if (!this.isActive) {
520
+ this.openOverlay();
521
+ }
522
+ else {
523
+ this.closeOverlay();
524
+ }
525
+ }
526
+ }
527
+ onContentBlockActivated(event) {
528
+ if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
529
+ event.preventDefault();
530
+ this.openOverlay();
531
+ }
532
+ }
533
+ onContentBlockDeactivated(event) {
534
+ if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
535
+ event.preventDefault();
536
+ this.closeOverlay();
537
+ }
538
+ }
539
+ async openOverlay() {
540
+ this.isActive = true;
541
+ if (this.openClass)
542
+ document.body.classList.remove(this.openClass);
543
+ this.openClass = `content-overlay-open--${this.position}`;
544
+ document.body.classList.add(`content-overlay-open`, this.openClass);
545
+ document.body.classList.remove('content-overlay-close');
546
+ if (!this.originalMarkup) {
547
+ this.originalMarkup = this.contentSlot.innerHTML;
548
+ }
549
+ // Filling an element: move into it, so it is what the absolute overlay is placed against.
550
+ if (this.position === 'absolute') {
551
+ const fillElement = document.querySelector(this.fill);
552
+ if (fillElement) {
553
+ fillElement.classList.add('content-block-overlay-container');
554
+ if (this.hostElement.parentElement !== fillElement)
555
+ fillElement.appendChild(this.hostElement);
556
+ }
557
+ }
558
+ if (this.originalMarkup.length) {
559
+ // this.contentSlot.appendChild(this.contentSlot);
560
+ if (this.contentSlot.children[0] === this.contentSlot.querySelector('script[slot="content"][type="text/template"]')) {
561
+ this.contentSlot.innerHTML = this.contentSlot.children[0].innerHTML;
562
+ }
563
+ this.setComputedActiveClass();
564
+ this.focusTrap = focusTrap_esm.createFocusTrap(this.hostElement, {
565
+ fallbackFocus: this.hostElement,
566
+ allowOutsideClick: true,
567
+ clickOutsideDeactivates: true,
568
+ onDeactivate: () => {
569
+ this.closeOverlay();
570
+ // this.contentSlot.innerHTML = '';
571
+ },
572
+ });
573
+ }
574
+ this.contentOverlayActivated.emit(this.hostElement);
575
+ }
576
+ async closeOverlay() {
577
+ this.open = 'false';
578
+ this.isActive = false;
579
+ document.body.classList.add('content-overlay-close');
580
+ document.body.classList.remove(`content-overlay-open`);
581
+ if (this.openClass)
582
+ document.body.classList.remove(this.openClass);
583
+ this.openClass = undefined;
584
+ this.activeClass = '';
585
+ this.setComputedActiveClass();
586
+ this.contentOverlayDeactivated.emit(this.hostElement);
587
+ if (this.focusTrap) {
588
+ try {
589
+ this.focusTrap.deactivate();
590
+ }
591
+ catch (e) {
592
+ console.log(e);
593
+ }
594
+ }
595
+ }
596
+ setComputedActiveClass() {
597
+ this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${this.position}`;
598
+ }
599
+ componentWillLoad() {
600
+ this.responsive({
601
+ fill: value => (this.position = !value || value === 'body' ? 'fixed' : 'absolute'),
602
+ horizontal: true,
603
+ vertical: true,
604
+ fullScreen: value => (this.isFullScreen = value === 'true'),
605
+ open: true,
606
+ });
607
+ this.hasCloseButton = !!this.hostElement.querySelector('[slot="closeButton"]');
608
+ // A dialog needs an accessible name. Use the header when there is one.
609
+ const header = this.hostElement.querySelector('[slot="header"]');
610
+ if (header) {
611
+ if (!header.id)
612
+ header.id = `${this.hostElement.id || 'content-overlay'}-header-${++overlayCount}`;
613
+ this.headerId = header.id;
614
+ }
615
+ }
616
+ closeOverlayButtonClicked(event) {
617
+ event.preventDefault();
618
+ this.closeOverlay();
619
+ }
620
+ render() {
621
+ return (index.h(index.Host, { key: '5583180cde2dc429eb16f061b7ee27127b5a5fdc', class: `${this.activeClass} ${this.classes ?? ''}`, "data-position": this.position }, index.h("div", { key: '0c3f8c4d3cdfb2e5b9760f35cda0cedc323cc613', class: "content-block-overlay-container" }, index.h("div", { key: 'afc077dc0358c21f6dd5598de7c52a6736974d4a', class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, index.h("div", { key: '3ea4cc41fc92ba137773ac47876298aa67301714', ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", "aria-labelledby": this.label ? null : this.headerId, "aria-label": this.label, class: this.isActive ? 'active' : 'hidden' }, index.h("div", { key: 'bb6c54519e56db042dd105383ab101ceb574b65c', class: `content-overlay__header ${this.headerId ? '' : 'content-overlay__header--floating'}` }, index.h("button", { key: 'a61445e4018523b78c736cec722e012c300decbf', onClick: e => {
622
+ this.closeOverlayButtonClicked(e);
623
+ }, class: "content-overlay__close", title: this.closeTitle }, !this.hasCloseButton && (index.h("svg", { key: 'e8200f0bed44bde0f2cee06461b9a265cfdd8a32', xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, index.h("path", { key: '53eaa272b533de926676af3e6c5b80db34b950a4', "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }))), index.h("slot", { key: '476576100dac59d8add01d0e1ea87f793931acaf', name: "closeButton" })), index.h("slot", { key: '5f78cb80a79591c7769c14986f9f5b8bef85dda1', name: "header" })), index.h("div", { key: 'f3119738fa6d2d15b60194d544a401217d95ec14', class: "content-overlay__content", ref: (el) => (this.contentSlot = el) }, index.h("slot", { key: 'd94ffcf5050c24b447f6515d4085f499103d0dbf', name: "content" }), index.h("slot", { key: '6509e134526d04be323399f4ae8559bb3a52dfbd' })))))));
624
+ }
625
+ componentDidRender() {
626
+ if (this.open === 'true') {
627
+ this.openOverlay();
628
+ }
629
+ if (this.isActive && this.focusTrap && !this.focusTrap.active) {
630
+ try {
631
+ this.focusTrap.activate();
632
+ }
633
+ catch (e) {
634
+ console.log(e);
635
+ }
636
+ }
637
+ }
638
+ };
639
+ ContentOverlay.style = contentOverlayCss();
640
+
641
+ exports.content_overlay = ContentOverlay;