@swisspost/design-system-components 1.6.2 → 1.7.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 (317) hide show
  1. package/dist/cjs/{check-non-empty-ae713942.js → check-non-empty-eeaa8f77.js} +4 -4
  2. package/dist/cjs/check-non-empty-eeaa8f77.js.map +1 -0
  3. package/dist/cjs/index-8c288b1a.js +45 -0
  4. package/dist/cjs/index-8c288b1a.js.map +1 -0
  5. package/dist/cjs/{index-e7618bb3.js → index-c07c0cdb.js} +79 -59
  6. package/dist/cjs/index-c07c0cdb.js.map +1 -0
  7. package/dist/cjs/index.cjs.js +17 -12
  8. package/dist/cjs/index.cjs.js.map +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/package-cd0e9960.js +7 -0
  11. package/dist/cjs/package-cd0e9960.js.map +1 -0
  12. package/dist/cjs/post-accordion-f2e00198.js +87 -0
  13. package/dist/cjs/post-accordion-f2e00198.js.map +1 -0
  14. package/dist/cjs/post-accordion.cjs.entry.js +4 -80
  15. package/dist/cjs/post-accordion.cjs.entry.js.map +1 -1
  16. package/dist/cjs/post-alert-6d0b5e58.js +101 -0
  17. package/dist/cjs/{post-alert-1fb90f2d.js.map → post-alert-6d0b5e58.js.map} +1 -1
  18. package/dist/cjs/post-alert.cjs.entry.js +5 -6
  19. package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
  20. package/dist/cjs/post-collapsible-0b8dce97.js +93 -0
  21. package/dist/cjs/post-collapsible-0b8dce97.js.map +1 -0
  22. package/dist/cjs/post-collapsible.cjs.entry.js +4 -5
  23. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  24. package/dist/cjs/post-components.cjs.js +3 -3
  25. package/dist/cjs/post-components.cjs.js.map +1 -1
  26. package/dist/cjs/post-icon-3dbb7728.js +105 -0
  27. package/dist/cjs/post-icon-3dbb7728.js.map +1 -0
  28. package/dist/cjs/post-icon.cjs.entry.js +5 -6
  29. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  30. package/dist/cjs/post-popover-ea22d235.js +118 -0
  31. package/dist/cjs/post-popover-ea22d235.js.map +1 -0
  32. package/dist/cjs/post-popover.cjs.entry.js +13 -0
  33. package/dist/cjs/post-popover.cjs.entry.js.map +1 -0
  34. package/dist/cjs/post-popovercontainer-42e4ab15.js +1878 -0
  35. package/dist/cjs/post-popovercontainer-42e4ab15.js.map +1 -0
  36. package/dist/cjs/post-popovercontainer.cjs.entry.js +13 -0
  37. package/dist/cjs/post-popovercontainer.cjs.entry.js.map +1 -0
  38. package/dist/cjs/post-tab-header-09074905.js +33 -0
  39. package/dist/cjs/{post-tab-header-a3845fe5.js.map → post-tab-header-09074905.js.map} +1 -1
  40. package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
  41. package/dist/cjs/post-tab-panel-9547b9ac.js +27 -0
  42. package/dist/cjs/{post-tab-panel-b7326ff8.js.map → post-tab-panel-9547b9ac.js.map} +1 -1
  43. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  44. package/dist/cjs/post-tabs-2ec2778e.js +153 -0
  45. package/dist/cjs/post-tabs-2ec2778e.js.map +1 -0
  46. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  47. package/dist/cjs/{post-tooltip-2becc97a.js → post-tooltip-c802c51f.js} +78 -1754
  48. package/dist/cjs/post-tooltip-c802c51f.js.map +1 -0
  49. package/dist/cjs/post-tooltip.cjs.entry.js +3 -4
  50. package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
  51. package/dist/collection/animations/collapse.js +5 -5
  52. package/dist/collection/animations/collapse.js.map +1 -1
  53. package/dist/collection/collection-manifest.json +5 -3
  54. package/dist/collection/components/post-accordion/post-accordion.js +167 -166
  55. package/dist/collection/components/post-accordion/post-accordion.js.map +1 -1
  56. package/dist/collection/components/post-alert/post-alert.css +2 -2
  57. package/dist/collection/components/post-alert/post-alert.js +246 -246
  58. package/dist/collection/components/post-alert/post-alert.js.map +1 -1
  59. package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
  60. package/dist/collection/components/post-collapsible/post-collapsible.js +170 -169
  61. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  62. package/dist/collection/components/post-icon/post-icon.css +1 -1
  63. package/dist/collection/components/post-icon/post-icon.js +250 -250
  64. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  65. package/dist/collection/components/post-popover/post-popover.css +3 -0
  66. package/dist/collection/components/post-popover/post-popover.js +267 -0
  67. package/dist/collection/components/post-popover/post-popover.js.map +1 -0
  68. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -0
  69. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +288 -0
  70. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js.map +1 -0
  71. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  72. package/dist/collection/components/post-tab-header/post-tab-header.js +62 -62
  73. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
  74. package/dist/collection/components/post-tab-panel/post-tab-panel.js +50 -50
  75. package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -1
  76. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  77. package/dist/collection/components/post-tabs/post-tabs.js +224 -223
  78. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
  79. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  80. package/dist/collection/components/post-tooltip/post-tooltip.js +192 -325
  81. package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
  82. package/dist/collection/index.js +3 -0
  83. package/dist/collection/index.js.map +1 -1
  84. package/dist/collection/utils/is-motion-reduced.js +1 -1
  85. package/dist/collection/utils/is-motion-reduced.js.map +1 -1
  86. package/dist/collection/utils/property-checkers/check-non-empty.js +3 -3
  87. package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -1
  88. package/dist/collection/utils/property-checkers/check-one-of.js +2 -2
  89. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
  90. package/dist/collection/utils/property-checkers/check-pattern.js +2 -2
  91. package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -1
  92. package/dist/collection/utils/property-checkers/check-type.js +10 -10
  93. package/dist/collection/utils/property-checkers/check-type.js.map +1 -1
  94. package/dist/collection/utils/property-checkers/empty-or.js +5 -5
  95. package/dist/collection/utils/property-checkers/empty-or.js.map +1 -1
  96. package/dist/components/check-non-empty.js +3 -3
  97. package/dist/components/check-non-empty.js.map +1 -1
  98. package/dist/components/index.js +3 -0
  99. package/dist/components/index.js.map +1 -1
  100. package/dist/components/index2.js +22 -18
  101. package/dist/components/index2.js.map +1 -1
  102. package/dist/components/package.js +1 -1
  103. package/dist/components/post-accordion.d.ts +2 -2
  104. package/dist/components/post-accordion.js +1 -101
  105. package/dist/components/post-accordion.js.map +1 -1
  106. package/dist/components/post-accordion2.js +105 -0
  107. package/dist/components/post-accordion2.js.map +1 -0
  108. package/dist/components/post-alert.d.ts +2 -2
  109. package/dist/components/post-alert2.js +119 -119
  110. package/dist/components/post-alert2.js.map +1 -1
  111. package/dist/components/post-collapsible.d.ts +2 -2
  112. package/dist/components/post-collapsible2.js +91 -91
  113. package/dist/components/post-collapsible2.js.map +1 -1
  114. package/dist/components/post-icon.d.ts +2 -2
  115. package/dist/components/post-icon2.js +118 -118
  116. package/dist/components/post-icon2.js.map +1 -1
  117. package/dist/components/post-popover.d.ts +11 -0
  118. package/dist/components/post-popover.js +8 -0
  119. package/dist/components/post-popover.js.map +1 -0
  120. package/dist/components/post-popover2.js +144 -0
  121. package/dist/components/post-popover2.js.map +1 -0
  122. package/dist/components/post-popovercontainer.d.ts +11 -0
  123. package/dist/components/post-popovercontainer.js +8 -0
  124. package/dist/components/post-popovercontainer.js.map +1 -0
  125. package/dist/components/post-popovercontainer2.js +1897 -0
  126. package/dist/components/post-popovercontainer2.js.map +1 -0
  127. package/dist/components/post-tab-header.d.ts +2 -2
  128. package/dist/components/post-tab-header2.js +38 -38
  129. package/dist/components/post-tab-header2.js.map +1 -1
  130. package/dist/components/post-tab-panel.d.ts +2 -2
  131. package/dist/components/post-tab-panel2.js +30 -30
  132. package/dist/components/post-tab-panel2.js.map +1 -1
  133. package/dist/components/post-tabs.d.ts +2 -2
  134. package/dist/components/post-tabs2.js +147 -147
  135. package/dist/components/post-tabs2.js.map +1 -1
  136. package/dist/components/post-tooltip.d.ts +2 -2
  137. package/dist/components/post-tooltip2.js +100 -1774
  138. package/dist/components/post-tooltip2.js.map +1 -1
  139. package/dist/docs.d.ts +1 -21
  140. package/dist/docs.json +610 -78
  141. package/dist/esm/check-non-empty-58bd6b17.js +11 -0
  142. package/dist/esm/{check-non-empty-09c39561.js.map → check-non-empty-58bd6b17.js.map} +1 -1
  143. package/dist/esm/index-1427953c.js +40 -0
  144. package/dist/esm/index-1427953c.js.map +1 -0
  145. package/dist/esm/{index-08d62a75.js → index-35998e08.js} +79 -59
  146. package/dist/esm/index-35998e08.js.map +1 -0
  147. package/dist/esm/index.js +14 -12
  148. package/dist/esm/index.js.map +1 -1
  149. package/dist/esm/loader.js +3 -3
  150. package/dist/esm/package-337354c3.js +5 -0
  151. package/dist/esm/package-337354c3.js.map +1 -0
  152. package/dist/esm/post-accordion-c2013bb3.js +85 -0
  153. package/dist/esm/post-accordion-c2013bb3.js.map +1 -0
  154. package/dist/esm/post-accordion.entry.js +3 -83
  155. package/dist/esm/post-accordion.entry.js.map +1 -1
  156. package/dist/esm/post-alert-7254a70f.js +99 -0
  157. package/dist/esm/{post-alert-46926902.js.map → post-alert-7254a70f.js.map} +1 -1
  158. package/dist/esm/post-alert.entry.js +5 -6
  159. package/dist/esm/post-alert.entry.js.map +1 -1
  160. package/dist/esm/post-collapsible-4464cc98.js +91 -0
  161. package/dist/esm/post-collapsible-4464cc98.js.map +1 -0
  162. package/dist/esm/post-collapsible.entry.js +4 -5
  163. package/dist/esm/post-collapsible.entry.js.map +1 -1
  164. package/dist/esm/post-components.js +4 -4
  165. package/dist/esm/post-components.js.map +1 -1
  166. package/dist/esm/post-icon-e0bbf0f5.js +103 -0
  167. package/dist/esm/post-icon-e0bbf0f5.js.map +1 -0
  168. package/dist/esm/post-icon.entry.js +5 -6
  169. package/dist/esm/post-icon.entry.js.map +1 -1
  170. package/dist/esm/post-popover-25eb3f76.js +116 -0
  171. package/dist/esm/post-popover-25eb3f76.js.map +1 -0
  172. package/dist/esm/post-popover.entry.js +5 -0
  173. package/dist/esm/post-popover.entry.js.map +1 -0
  174. package/dist/esm/post-popovercontainer-54117eea.js +1876 -0
  175. package/dist/esm/post-popovercontainer-54117eea.js.map +1 -0
  176. package/dist/esm/post-popovercontainer.entry.js +5 -0
  177. package/dist/esm/post-popovercontainer.entry.js.map +1 -0
  178. package/dist/esm/post-tab-header-1684b507.js +31 -0
  179. package/dist/esm/{post-tab-header-84b12382.js.map → post-tab-header-1684b507.js.map} +1 -1
  180. package/dist/esm/post-tab-header.entry.js +4 -4
  181. package/dist/esm/post-tab-panel-add26fe5.js +25 -0
  182. package/dist/esm/{post-tab-panel-216c0b6e.js.map → post-tab-panel-add26fe5.js.map} +1 -1
  183. package/dist/esm/post-tab-panel.entry.js +3 -3
  184. package/dist/esm/post-tabs-d738e61f.js +151 -0
  185. package/dist/esm/post-tabs-d738e61f.js.map +1 -0
  186. package/dist/esm/post-tabs.entry.js +3 -3
  187. package/dist/esm/{post-tooltip-47f2146d.js → post-tooltip-57928808.js} +78 -1754
  188. package/dist/esm/post-tooltip-57928808.js.map +1 -0
  189. package/dist/esm/post-tooltip.entry.js +3 -4
  190. package/dist/esm/post-tooltip.entry.js.map +1 -1
  191. package/dist/post-components/index.esm.js +1 -1
  192. package/dist/post-components/p-05e85f2b.entry.js +2 -0
  193. package/dist/post-components/p-08abd53e.entry.js +2 -0
  194. package/dist/post-components/p-09892ad1.js +2 -0
  195. package/dist/post-components/{p-57b48dff.js.map → p-09892ad1.js.map} +1 -1
  196. package/dist/post-components/p-1e9ec4a9.entry.js +2 -0
  197. package/dist/post-components/p-1f55663e.js +2 -0
  198. package/dist/post-components/p-1f55663e.js.map +1 -0
  199. package/dist/post-components/p-30c60b6c.entry.js +2 -0
  200. package/dist/post-components/p-38d97f62.entry.js +2 -0
  201. package/dist/post-components/p-4c188911.entry.js +2 -0
  202. package/dist/post-components/p-568bb469.entry.js +2 -0
  203. package/dist/post-components/p-65c8bd5c.entry.js +2 -0
  204. package/dist/post-components/p-6e3158e8.js +2 -0
  205. package/dist/post-components/{p-21549a50.js.map → p-6e3158e8.js.map} +1 -1
  206. package/dist/post-components/p-7d32dfb7.js +2 -0
  207. package/dist/post-components/{p-57fdeeab.js.map → p-7d32dfb7.js.map} +1 -1
  208. package/dist/post-components/p-81591ad0.js +3 -0
  209. package/dist/post-components/p-81591ad0.js.map +1 -0
  210. package/dist/post-components/p-96f4ebc4.js +2 -0
  211. package/dist/post-components/p-96f4ebc4.js.map +1 -0
  212. package/dist/post-components/p-9bd5f824.js +2 -0
  213. package/dist/post-components/p-9bd5f824.js.map +1 -0
  214. package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
  215. package/dist/post-components/p-b4b4f59a.js +2 -0
  216. package/dist/post-components/p-bd032124.js +2 -0
  217. package/dist/post-components/p-bd032124.js.map +1 -0
  218. package/dist/post-components/p-c5858d52.entry.js +2 -0
  219. package/dist/post-components/p-c5858d52.entry.js.map +1 -0
  220. package/dist/post-components/{p-ce907090.entry.js → p-dbd07f20.js} +2 -2
  221. package/dist/post-components/p-de493e36.js +2 -0
  222. package/dist/post-components/p-de493e36.js.map +1 -0
  223. package/dist/post-components/p-eaddd6cc.js +2 -0
  224. package/dist/post-components/p-eaddd6cc.js.map +1 -0
  225. package/dist/post-components/p-ed73d4c0.entry.js +2 -0
  226. package/dist/post-components/p-ed73d4c0.entry.js.map +1 -0
  227. package/dist/post-components/p-f994dce8.js +9 -0
  228. package/dist/post-components/p-f994dce8.js.map +1 -0
  229. package/dist/post-components/post-components.esm.js +1 -1
  230. package/dist/post-components/post-components.esm.js.map +1 -1
  231. package/dist/types/components/post-accordion/post-accordion.d.ts +26 -26
  232. package/dist/types/components/post-alert/post-alert.d.ts +45 -45
  233. package/dist/types/components/post-collapsible/post-collapsible.d.ts +31 -31
  234. package/dist/types/components/post-icon/post-icon.d.ts +43 -43
  235. package/dist/types/components/post-popover/post-popover.d.ts +53 -0
  236. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +62 -0
  237. package/dist/types/components/post-tab-header/post-tab-header.d.ts +9 -9
  238. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +8 -8
  239. package/dist/types/components/post-tabs/post-tabs.d.ts +32 -32
  240. package/dist/types/components/post-tooltip/post-tooltip.d.ts +35 -62
  241. package/dist/types/components.d.ts +115 -10
  242. package/dist/types/index.d.ts +3 -0
  243. package/dist/types/stencil-public-runtime.d.ts +8 -0
  244. package/package.json +16 -14
  245. package/dist/cjs/check-non-empty-ae713942.js.map +0 -1
  246. package/dist/cjs/check-one-of-27ad3154.js +0 -10
  247. package/dist/cjs/check-one-of-27ad3154.js.map +0 -1
  248. package/dist/cjs/index-b38a23e0.js +0 -41
  249. package/dist/cjs/index-b38a23e0.js.map +0 -1
  250. package/dist/cjs/index-e7618bb3.js.map +0 -1
  251. package/dist/cjs/package-041a8597.js +0 -7
  252. package/dist/cjs/package-041a8597.js.map +0 -1
  253. package/dist/cjs/post-alert-1fb90f2d.js +0 -101
  254. package/dist/cjs/post-collapsible-e46002bb.js +0 -93
  255. package/dist/cjs/post-collapsible-e46002bb.js.map +0 -1
  256. package/dist/cjs/post-icon-91f6603a.js +0 -105
  257. package/dist/cjs/post-icon-91f6603a.js.map +0 -1
  258. package/dist/cjs/post-tab-header-a3845fe5.js +0 -33
  259. package/dist/cjs/post-tab-panel-b7326ff8.js +0 -27
  260. package/dist/cjs/post-tabs-384a1fab.js +0 -153
  261. package/dist/cjs/post-tabs-384a1fab.js.map +0 -1
  262. package/dist/cjs/post-tooltip-2becc97a.js.map +0 -1
  263. package/dist/components/check-one-of.js +0 -8
  264. package/dist/components/check-one-of.js.map +0 -1
  265. package/dist/esm/check-non-empty-09c39561.js +0 -11
  266. package/dist/esm/check-one-of-74750af9.js +0 -8
  267. package/dist/esm/check-one-of-74750af9.js.map +0 -1
  268. package/dist/esm/index-08d62a75.js.map +0 -1
  269. package/dist/esm/index-35921354.js +0 -36
  270. package/dist/esm/index-35921354.js.map +0 -1
  271. package/dist/esm/package-a962a93d.js +0 -5
  272. package/dist/esm/package-a962a93d.js.map +0 -1
  273. package/dist/esm/post-alert-46926902.js +0 -99
  274. package/dist/esm/post-collapsible-f1b6592d.js +0 -91
  275. package/dist/esm/post-collapsible-f1b6592d.js.map +0 -1
  276. package/dist/esm/post-icon-fb627697.js +0 -103
  277. package/dist/esm/post-icon-fb627697.js.map +0 -1
  278. package/dist/esm/post-tab-header-84b12382.js +0 -31
  279. package/dist/esm/post-tab-panel-216c0b6e.js +0 -25
  280. package/dist/esm/post-tabs-e235d663.js +0 -151
  281. package/dist/esm/post-tabs-e235d663.js.map +0 -1
  282. package/dist/esm/post-tooltip-47f2146d.js.map +0 -1
  283. package/dist/post-components/p-03fe58da.js +0 -2
  284. package/dist/post-components/p-03fe58da.js.map +0 -1
  285. package/dist/post-components/p-1339f8cd.js +0 -2
  286. package/dist/post-components/p-1339f8cd.js.map +0 -1
  287. package/dist/post-components/p-151b55c0.entry.js +0 -2
  288. package/dist/post-components/p-21549a50.js +0 -2
  289. package/dist/post-components/p-4cb18ddf.js +0 -9
  290. package/dist/post-components/p-4cb18ddf.js.map +0 -1
  291. package/dist/post-components/p-4e24f13b.entry.js +0 -2
  292. package/dist/post-components/p-57b48dff.js +0 -2
  293. package/dist/post-components/p-57fdeeab.js +0 -2
  294. package/dist/post-components/p-58cc7b5a.entry.js +0 -2
  295. package/dist/post-components/p-6cafa644.entry.js +0 -2
  296. package/dist/post-components/p-7f370d77.entry.js +0 -2
  297. package/dist/post-components/p-7f4eba57.js +0 -2
  298. package/dist/post-components/p-8c006e7d.js +0 -3
  299. package/dist/post-components/p-8c006e7d.js.map +0 -1
  300. package/dist/post-components/p-aee47e1a.entry.js +0 -2
  301. package/dist/post-components/p-b5e1fd89.js +0 -2
  302. package/dist/post-components/p-b5e1fd89.js.map +0 -1
  303. package/dist/post-components/p-d13111f2.js +0 -2
  304. package/dist/post-components/p-dfe29f7f.js +0 -2
  305. package/dist/post-components/p-dfe29f7f.js.map +0 -1
  306. package/dist/post-components/p-f35c2075.entry.js +0 -2
  307. /package/dist/post-components/{p-151b55c0.entry.js.map → p-05e85f2b.entry.js.map} +0 -0
  308. /package/dist/post-components/{p-4e24f13b.entry.js.map → p-08abd53e.entry.js.map} +0 -0
  309. /package/dist/post-components/{p-58cc7b5a.entry.js.map → p-1e9ec4a9.entry.js.map} +0 -0
  310. /package/dist/post-components/{p-6cafa644.entry.js.map → p-30c60b6c.entry.js.map} +0 -0
  311. /package/dist/post-components/{p-7f370d77.entry.js.map → p-38d97f62.entry.js.map} +0 -0
  312. /package/dist/post-components/{p-aee47e1a.entry.js.map → p-4c188911.entry.js.map} +0 -0
  313. /package/dist/post-components/{p-d13111f2.js.map → p-568bb469.entry.js.map} +0 -0
  314. /package/dist/post-components/{p-f35c2075.entry.js.map → p-65c8bd5c.entry.js.map} +0 -0
  315. /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
  316. /package/dist/post-components/{p-7f4eba57.js.map → p-b4b4f59a.js.map} +0 -0
  317. /package/dist/post-components/{p-ce907090.entry.js.map → p-dbd07f20.js.map} +0 -0
@@ -1,178 +1,179 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
2
  import { version } from "../../../package.json";
3
3
  import { collapse, expand } from "../../animations/collapse";
4
4
  import { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from "../../utils";
5
5
  import { HEADING_LEVELS } from "./heading-levels";
6
6
  export class PostCollapsible {
7
- constructor() {
8
- this.isLoaded = false;
9
- this.id = undefined;
10
- this.isOpen = true;
11
- this.hasHeader = undefined;
12
- this.headingTag = undefined;
13
- this.collapsed = false;
14
- this.headingLevel = 2;
15
- }
16
- validateCollapsed(newValue = this.collapsed) {
17
- checkEmptyOrType(newValue, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');
18
- }
19
- validateHeadingLevel(newValue = this.headingLevel) {
20
- checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.');
21
- }
22
- connectedCallback() {
23
- this.validateCollapsed();
24
- this.validateHeadingLevel();
25
- }
26
- componentWillRender() {
27
- var _a;
28
- this.id = this.host.id || `c${crypto.randomUUID()}`;
29
- this.hasHeader = this.host.querySelectorAll('[slot="header"]').length > 0;
30
- this.headingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
31
- }
32
- componentDidLoad() {
33
- if (this.collapsed)
34
- void this.toggle(false);
35
- this.isLoaded = true;
36
- }
37
- /**
38
- * Triggers the collapse programmatically.
39
- *
40
- * If there is a collapsing transition running already, it will be reversed.
41
- */
42
- async toggle(open = !this.isOpen) {
43
- if (open === this.isOpen)
44
- return open;
45
- this.isOpen = !this.isOpen;
46
- if (this.isLoaded)
47
- this.collapseChange.emit();
48
- const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
49
- if (!this.isLoaded || isMotionReduced())
50
- animation.finish();
51
- await animation.finished;
52
- animation.commitStyles();
53
- return this.isOpen;
54
- }
55
- render() {
56
- const collapse = (h("div", { "aria-labelledby": this.hasHeader ? `${this.id}--header` : undefined, class: `collapse${this.hasHeader ? ' accordion-collapse' : ''}`, id: `${this.id}--collapse`, ref: el => this.collapsible = el }, this.hasHeader ? (h("div", { class: "accordion-body" }, h("slot", null))) : (h("slot", null))));
57
- return (h(Host, { id: this.id, "data-version": version }, this.hasHeader ? (h("div", { class: "accordion-item" }, h(this.headingTag, { class: "accordion-header", id: `${this.id}--header` }, h("button", { "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, h("slot", { name: "header" }))), collapse)) : collapse));
58
- }
59
- static get is() { return "post-collapsible"; }
60
- static get encapsulation() { return "shadow"; }
61
- static get originalStyleUrls() {
62
- return {
63
- "$": ["post-collapsible.scss"]
64
- };
65
- }
66
- static get styleUrls() {
67
- return {
68
- "$": ["post-collapsible.css"]
69
- };
70
- }
71
- static get properties() {
72
- return {
73
- "collapsed": {
74
- "type": "boolean",
75
- "mutable": false,
76
- "complexType": {
77
- "original": "boolean",
78
- "resolved": "boolean",
79
- "references": {}
80
- },
81
- "required": false,
82
- "optional": true,
83
- "docs": {
84
- "tags": [],
85
- "text": "If `true`, the element is initially collapsed otherwise it is displayed."
86
- },
87
- "attribute": "collapsed",
88
- "reflect": false,
89
- "defaultValue": "false"
90
- },
91
- "headingLevel": {
92
- "type": "number",
93
- "mutable": false,
94
- "complexType": {
95
- "original": "HeadingLevel",
96
- "resolved": "1 | 2 | 3 | 4 | 5 | 6",
97
- "references": {
98
- "HeadingLevel": {
99
- "location": "import",
100
- "path": "./heading-levels",
101
- "id": "src/components/post-collapsible/heading-levels.ts::HeadingLevel"
7
+ constructor() {
8
+ this.isLoaded = false;
9
+ this.id = undefined;
10
+ this.isOpen = true;
11
+ this.hasHeader = undefined;
12
+ this.headingTag = undefined;
13
+ this.collapsed = false;
14
+ this.headingLevel = 2;
15
+ }
16
+ validateCollapsed(newValue = this.collapsed) {
17
+ checkEmptyOrType(newValue, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');
18
+ }
19
+ validateHeadingLevel(newValue = this.headingLevel) {
20
+ checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.');
21
+ }
22
+ connectedCallback() {
23
+ this.validateCollapsed();
24
+ this.validateHeadingLevel();
25
+ }
26
+ componentWillRender() {
27
+ var _a;
28
+ this.id = this.host.id || `c${crypto.randomUUID()}`;
29
+ this.hasHeader = this.host.querySelectorAll('[slot="header"]').length > 0;
30
+ this.headingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
31
+ }
32
+ componentDidLoad() {
33
+ if (this.collapsed)
34
+ void this.toggle(false);
35
+ this.isLoaded = true;
36
+ }
37
+ /**
38
+ * Triggers the collapse programmatically.
39
+ *
40
+ * If there is a collapsing transition running already, it will be reversed.
41
+ */
42
+ async toggle(open = !this.isOpen) {
43
+ if (open === this.isOpen)
44
+ return open;
45
+ this.isOpen = !this.isOpen;
46
+ if (this.isLoaded)
47
+ this.collapseChange.emit();
48
+ const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
49
+ if (!this.isLoaded || isMotionReduced())
50
+ animation.finish();
51
+ await animation.finished;
52
+ animation.commitStyles();
53
+ return this.isOpen;
54
+ }
55
+ render() {
56
+ const collapse = (h("div", { "aria-labelledby": this.hasHeader ? `${this.id}--header` : undefined, class: `collapse${this.hasHeader ? ' accordion-collapse' : ''}`, id: `${this.id}--collapse`, ref: el => (this.collapsible = el) }, this.hasHeader ? (h("div", { class: "accordion-body" }, h("slot", null))) : (h("slot", null))));
57
+ return (h(Host, { id: this.id, "data-version": version }, this.hasHeader ? (h("div", { part: "accordion-item", class: "accordion-item" }, h(this.headingTag, { class: "accordion-header", id: `${this.id}--header` }, h("button", { "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, h("slot", { name: "header" }))), collapse)) : (collapse)));
58
+ }
59
+ static get is() { return "post-collapsible"; }
60
+ static get encapsulation() { return "shadow"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["post-collapsible.scss"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["post-collapsible.css"]
69
+ };
70
+ }
71
+ static get properties() {
72
+ return {
73
+ "collapsed": {
74
+ "type": "boolean",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "boolean",
78
+ "resolved": "boolean",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": true,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "If `true`, the element is initially collapsed otherwise it is displayed."
86
+ },
87
+ "attribute": "collapsed",
88
+ "reflect": false,
89
+ "defaultValue": "false"
90
+ },
91
+ "headingLevel": {
92
+ "type": "number",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "HeadingLevel",
96
+ "resolved": "1 | 2 | 3 | 4 | 5 | 6",
97
+ "references": {
98
+ "HeadingLevel": {
99
+ "location": "import",
100
+ "path": "./heading-levels",
101
+ "id": "src/components/post-collapsible/heading-levels.ts::HeadingLevel"
102
+ }
103
+ }
104
+ },
105
+ "required": false,
106
+ "optional": true,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": "Defines the hierarchical level of the collapsible header within the headings structure."
110
+ },
111
+ "attribute": "heading-level",
112
+ "reflect": false,
113
+ "defaultValue": "2"
102
114
  }
103
- }
104
- },
105
- "required": false,
106
- "optional": true,
107
- "docs": {
108
- "tags": [],
109
- "text": "Defines the hierarchical level of the collapsible header within the headings structure."
110
- },
111
- "attribute": "heading-level",
112
- "reflect": false,
113
- "defaultValue": "2"
114
- }
115
- };
116
- }
117
- static get states() {
118
- return {
119
- "id": {},
120
- "isOpen": {},
121
- "hasHeader": {},
122
- "headingTag": {}
123
- };
124
- }
125
- static get events() {
126
- return [{
127
- "method": "collapseChange",
128
- "name": "collapseChange",
129
- "bubbles": true,
130
- "cancelable": true,
131
- "composed": true,
132
- "docs": {
133
- "tags": [],
134
- "text": "An event emitted when the collapse element is shown or hidden, before the transition. It has no payload."
135
- },
136
- "complexType": {
137
- "original": "void",
138
- "resolved": "void",
139
- "references": {}
140
- }
141
- }];
142
- }
143
- static get methods() {
144
- return {
145
- "toggle": {
146
- "complexType": {
147
- "signature": "(open?: boolean) => Promise<boolean>",
148
- "parameters": [{
149
- "tags": [],
150
- "text": ""
151
- }],
152
- "references": {
153
- "Promise": {
154
- "location": "global",
155
- "id": "global::Promise"
115
+ };
116
+ }
117
+ static get states() {
118
+ return {
119
+ "id": {},
120
+ "isOpen": {},
121
+ "hasHeader": {},
122
+ "headingTag": {}
123
+ };
124
+ }
125
+ static get events() {
126
+ return [{
127
+ "method": "collapseChange",
128
+ "name": "collapseChange",
129
+ "bubbles": true,
130
+ "cancelable": true,
131
+ "composed": true,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "An event emitted when the collapse element is shown or hidden, before the transition. It has no payload."
135
+ },
136
+ "complexType": {
137
+ "original": "void",
138
+ "resolved": "void",
139
+ "references": {}
140
+ }
141
+ }];
142
+ }
143
+ static get methods() {
144
+ return {
145
+ "toggle": {
146
+ "complexType": {
147
+ "signature": "(open?: boolean) => Promise<boolean>",
148
+ "parameters": [{
149
+ "name": "open",
150
+ "type": "boolean",
151
+ "docs": ""
152
+ }],
153
+ "references": {
154
+ "Promise": {
155
+ "location": "global",
156
+ "id": "global::Promise"
157
+ }
158
+ },
159
+ "return": "Promise<boolean>"
160
+ },
161
+ "docs": {
162
+ "text": "Triggers the collapse programmatically.\n\nIf there is a collapsing transition running already, it will be reversed.",
163
+ "tags": []
164
+ }
156
165
  }
157
- },
158
- "return": "Promise<boolean>"
159
- },
160
- "docs": {
161
- "text": "Triggers the collapse programmatically.\n\nIf there is a collapsing transition running already, it will be reversed.",
162
- "tags": []
163
- }
164
- }
165
- };
166
- }
167
- static get elementRef() { return "host"; }
168
- static get watchers() {
169
- return [{
170
- "propName": "collapsed",
171
- "methodName": "validateCollapsed"
172
- }, {
173
- "propName": "headingLevel",
174
- "methodName": "validateHeadingLevel"
175
- }];
176
- }
166
+ };
167
+ }
168
+ static get elementRef() { return "host"; }
169
+ static get watchers() {
170
+ return [{
171
+ "propName": "collapsed",
172
+ "methodName": "validateCollapsed"
173
+ }, {
174
+ "propName": "headingLevel",
175
+ "methodName": "validateHeadingLevel"
176
+ }];
177
+ }
177
178
  }
178
179
  //# sourceMappingURL=post-collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post-collapsible.js","sourceRoot":"","sources":["../../../../src/components/post-collapsible/post-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAOhE,MAAM,OAAO,eAAe;;IAClB,aAAQ,GAAG,KAAK,CAAC;;kBAMP,IAAI;;;qBAOiB,KAAK;wBAUG,CAAC;;EAPhD,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS;IACzC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,uEAAuE,CAAC,CAAC;EACjH,CAAC;EAQD,oBAAoB,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY;IAC/C,iBAAiB,CAAC,QAAQ,EAAE,cAAc,EAAE,yFAAyF,CAAC,CAAC;EACzI,CAAC;EAOD,iBAAiB;IACf,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,oBAAoB,EAAE,CAAC;EAC9B,CAAC;EAED,mBAAmB;;IACjB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;IACpD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1E,IAAI,CA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WAAW,GAAG,EAAE,IAE/B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAChB,WAAK,KAAK,EAAC,gBAAgB;MACzB,eAAO,CACH,CACP,CAAC,CAAC,CAAC,CACF,eAAO,CACR,CACG,CACP,CAAC;IAEF,OAAO,CACL,EAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,EAAE,kBAAgB,OAAO,IACrC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAChB,WAAK,KAAK,EAAC,gBAAgB;MACzB,EAAC,IAAI,CAAC,UAAU,IAAC,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,UAAU;QAChE,+BACiB,GAAG,IAAI,CAAC,EAAE,YAAY,mBACtB,GAAG,IAAI,CAAC,MAAM,EAAE,EAC/B,KAAK,EAAE,mBAAmB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC5B,IAAI,EAAC,QAAQ;UAEb,YAAM,IAAI,EAAC,QAAQ,GAAE,CACd,CACO;MAEjB,QAAQ,CACL,CACP,CAAC,CAAC,CAAC,QAAQ,CACP,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { collapse, expand } from '../../animations/collapse';\nimport { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from '../../utils';\nimport { HEADING_LEVELS, HeadingLevel } from './heading-levels';\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private isLoaded = false;\n private collapsible: HTMLElement;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() id: string;\n @State() isOpen = true;\n @State() hasHeader: boolean;\n @State() headingTag: string;\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkEmptyOrType(newValue, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: HeadingLevel = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.');\n }\n\n /**\n * An event emitted when the collapse element is shown or hidden, before the transition. It has no payload.\n */\n @Event() collapseChange: EventEmitter<void>;\n\n connectedCallback() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n }\n\n componentWillRender() {\n this.id = this.host.id || `c${crypto.randomUUID()}`;\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n this.headingTag = `h${this.headingLevel ?? 2}`;\n }\n\n componentDidLoad() {\n if (this.collapsed) void this.toggle(false);\n this.isLoaded = true;\n }\n\n /**\n * Triggers the collapse programmatically.\n *\n * If there is a collapsing transition running already, it will be reversed.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open === this.isOpen) return open;\n\n this.isOpen = !this.isOpen;\n if (this.isLoaded) this.collapseChange.emit();\n\n const animation = open ? expand(this.collapsible): collapse(this.collapsible);\n\n if (!this.isLoaded || isMotionReduced()) animation.finish();\n\n await animation.finished;\n\n animation.commitStyles();\n\n return this.isOpen;\n }\n\n render() {\n const collapse = (\n <div\n aria-labelledby={this.hasHeader ? `${this.id}--header` : undefined}\n class={`collapse${this.hasHeader ? ' accordion-collapse' : ''}`}\n id={`${this.id}--collapse`}\n ref={el => this.collapsible = el}\n >\n {this.hasHeader ? (\n <div class=\"accordion-body\">\n <slot/>\n </div>\n ) : (\n <slot/>\n )}\n </div>\n );\n\n return (\n <Host id={this.id} data-version={version}>\n {this.hasHeader ? (\n <div class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.id}--header`}>\n <button\n aria-controls={`${this.id}--collapse`}\n aria-expanded={`${this.isOpen}`}\n class={`accordion-button${this.isOpen ? '' : ' collapsed'}`}\n onClick={() => this.toggle()}\n type=\"button\"\n >\n <slot name=\"header\"/>\n </button>\n </this.headingTag>\n\n {collapse}\n </div>\n ) : collapse}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"post-collapsible.js","sourceRoot":"","sources":["../../../../src/components/post-collapsible/post-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAOhE,MAAM,OAAO,eAAe;;QAClB,aAAQ,GAAG,KAAK,CAAC;;sBAMP,IAAI;;;yBAOiB,KAAK;4BAcG,CAAC;;IAXhD,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS;QACzC,gBAAgB,CACd,QAAQ,EACR,SAAS,EACT,uEAAuE,CACxE,CAAC;IACJ,CAAC;IAQD,oBAAoB,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY;QAC/C,iBAAiB,CACf,QAAQ,EACR,cAAc,EACd,yFAAyF,CAC1F,CAAC;IACJ,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { collapse, expand } from '../../animations/collapse';\nimport { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from '../../utils';\nimport { HEADING_LEVELS, HeadingLevel } from './heading-levels';\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private isLoaded = false;\n private collapsible: HTMLElement;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() id: string;\n @State() isOpen = true;\n @State() hasHeader: boolean;\n @State() headingTag: string;\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkEmptyOrType(\n newValue,\n 'boolean',\n 'The `collapsed` property of the `post-collapsible` must be a boolean.',\n );\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: HeadingLevel = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkEmptyOrOneOf(\n newValue,\n HEADING_LEVELS,\n 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.',\n );\n }\n\n /**\n * An event emitted when the collapse element is shown or hidden, before the transition. It has no payload.\n */\n @Event() collapseChange: EventEmitter<void>;\n\n connectedCallback() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n }\n\n componentWillRender() {\n this.id = this.host.id || `c${crypto.randomUUID()}`;\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n this.headingTag = `h${this.headingLevel ?? 2}`;\n }\n\n componentDidLoad() {\n if (this.collapsed) void this.toggle(false);\n this.isLoaded = true;\n }\n\n /**\n * Triggers the collapse programmatically.\n *\n * If there is a collapsing transition running already, it will be reversed.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open === this.isOpen) return open;\n\n this.isOpen = !this.isOpen;\n if (this.isLoaded) this.collapseChange.emit();\n\n const animation = open ? expand(this.collapsible) : collapse(this.collapsible);\n\n if (!this.isLoaded || isMotionReduced()) animation.finish();\n\n await animation.finished;\n\n animation.commitStyles();\n\n return this.isOpen;\n }\n\n render() {\n const collapse = (\n <div\n aria-labelledby={this.hasHeader ? `${this.id}--header` : undefined}\n class={`collapse${this.hasHeader ? ' accordion-collapse' : ''}`}\n id={`${this.id}--collapse`}\n ref={el => (this.collapsible = el)}\n >\n {this.hasHeader ? (\n <div class=\"accordion-body\">\n <slot />\n </div>\n ) : (\n <slot />\n )}\n </div>\n );\n\n return (\n <Host id={this.id} data-version={version}>\n {this.hasHeader ? (\n <div part=\"accordion-item\" class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.id}--header`}>\n <button\n aria-controls={`${this.id}--collapse`}\n aria-expanded={`${this.isOpen}`}\n class={`accordion-button${this.isOpen ? '' : ' collapsed'}`}\n onClick={() => this.toggle()}\n type=\"button\"\n >\n <slot name=\"header\" />\n </button>\n </this.headingTag>\n\n {collapse}\n </div>\n ) : (\n collapse\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- :host{display:inline-block;width:1em;vertical-align:-0.15em}svg{display:block;width:100%;height:100%;fill:currentColor;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}
1
+ :host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}