@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.48

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 (255) hide show
  1. package/dist/cjs/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
  2. package/dist/cjs/index-CpDyH7Ww.js +4 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-wsZ6ig4j.js → package-CZyXYkIN.js} +1 -1
  5. package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
  6. package/dist/cjs/post-avatar.cjs.entry.js +91 -54
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
  8. package/dist/cjs/post-banner.cjs.entry.js +3 -3
  9. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/post-card-control.cjs.entry.js +1 -1
  12. package/dist/cjs/post-closebutton_15.cjs.entry.js +4 -5
  13. package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
  14. package/dist/cjs/post-components.cjs.js +1 -1
  15. package/dist/cjs/post-footer.cjs.entry.js +1 -1
  16. package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
  17. package/dist/cjs/post-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/post-rating.cjs.entry.js +1 -1
  19. package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
  20. package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
  21. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  22. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
  23. package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
  24. package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
  25. package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
  26. package/dist/collection/components/post-avatar/post-avatar.js +90 -57
  27. package/dist/collection/components/post-banner/post-banner.js +2 -2
  28. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
  29. package/dist/collection/components/post-menu/post-menu.js +4 -1
  30. package/dist/collection/components/post-tabs/post-tabs.js +3 -3
  31. package/dist/collection/utils/event-from.js +2 -2
  32. package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
  33. package/dist/components/get-root.js +15 -0
  34. package/dist/components/index.d.ts +73 -0
  35. package/dist/components/index.js +36 -2315
  36. package/dist/components/package.js +3 -0
  37. package/dist/components/post-accordion-item.js +1 -1
  38. package/dist/components/post-accordion-item2.js +113 -0
  39. package/dist/components/post-accordion.js +1 -1
  40. package/dist/components/post-accordion2.js +138 -0
  41. package/dist/components/post-avatar.js +99 -62
  42. package/dist/components/post-back-to-top.js +6 -7
  43. package/dist/components/post-banner.js +10 -11
  44. package/dist/components/post-breadcrumb-item.js +1 -1
  45. package/dist/components/post-breadcrumb-item2.js +79 -0
  46. package/dist/components/post-breadcrumbs.js +13 -14
  47. package/dist/components/post-card-control.js +8 -9
  48. package/dist/components/post-closebutton.js +5 -7
  49. package/dist/components/post-collapsible-trigger.js +1 -1
  50. package/dist/components/post-collapsible-trigger2.js +135 -0
  51. package/dist/components/post-collapsible.js +1 -1
  52. package/dist/components/post-collapsible2.js +110 -0
  53. package/dist/components/post-footer.js +10 -11
  54. package/dist/components/post-header.js +6 -7
  55. package/dist/components/post-icon.js +1 -1
  56. package/dist/components/post-icon2.js +153 -0
  57. package/dist/components/post-language-option.js +8 -9
  58. package/dist/components/post-language-switch.js +12 -13
  59. package/dist/components/post-linkarea.js +3 -4
  60. package/dist/components/post-list-item.js +3 -4
  61. package/dist/components/post-list.js +4 -5
  62. package/dist/components/post-logo.js +5 -6
  63. package/dist/components/post-mainnavigation.js +4 -5
  64. package/dist/components/post-megadropdown-trigger.js +6 -7
  65. package/dist/components/post-megadropdown.js +7 -8
  66. package/dist/components/post-menu-item.js +1 -1
  67. package/dist/components/post-menu-item2.js +30 -0
  68. package/dist/components/post-menu-trigger.js +1 -1
  69. package/dist/components/post-menu-trigger2.js +110 -0
  70. package/dist/components/post-menu.js +1 -1
  71. package/dist/components/post-menu2.js +222 -0
  72. package/dist/components/post-popover.js +6 -7
  73. package/dist/components/post-popovercontainer.js +1 -1
  74. package/dist/components/post-popovercontainer2.js +3018 -0
  75. package/dist/components/post-rating.js +8 -9
  76. package/dist/components/post-tab-header.js +6 -7
  77. package/dist/components/post-tab-panel.js +6 -7
  78. package/dist/components/post-tabs.js +7 -8
  79. package/dist/components/post-togglebutton.js +3 -4
  80. package/dist/components/post-tooltip-trigger.js +6 -7
  81. package/dist/components/post-tooltip.js +6 -7
  82. package/dist/components/react/index.d.ts +33 -0
  83. package/dist/components/react/index.js +2315 -0
  84. package/dist/components/react/p-0Ltezq5O.js +3 -0
  85. package/dist/components/{p-i0-mizzM.js → react/p-38PqL5iD.js} +1 -1
  86. package/dist/components/react/p-BLchVpF6.js +14 -0
  87. package/dist/components/react/p-C35MCWIp.js +35 -0
  88. package/dist/components/{p-336Lbkey.js → react/p-CGsAj6ij.js} +1 -1
  89. package/dist/components/react/p-CJ80BZ06.js +178 -0
  90. package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
  91. package/dist/components/react/p-C_2k3G1c.js +264 -0
  92. package/dist/components/{p-DP5pj8mq.js → react/p-Ce7jgYmK.js} +1 -1
  93. package/dist/components/{p-BSvy4uym.js → react/p-CiYSngKM.js} +7 -7
  94. package/dist/components/{p-Cxrx7SXz.js → react/p-Da5wbVP8.js} +1 -1
  95. package/dist/components/{p-DVGX_JCp.js → react/p-Dq9F2i7n.js} +2 -2
  96. package/dist/components/{p-DEi5TIMq.js → react/p-DzYquz3e.js} +2 -2
  97. package/dist/components/{p-pHxypsHK.js → react/p-JHuJA2Lv.js} +4 -4
  98. package/dist/components/react/p-SbIC4aZX.js +11 -0
  99. package/dist/components/{p-C0H2ohSv.js → react/p-Tg0GNTZM.js} +2 -2
  100. package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
  101. package/dist/components/{p-BM8mtEfS.js → react/p-q8Fvf8A0.js} +1 -1
  102. package/dist/components/react/p-r4txK0AC.js +3 -0
  103. package/dist/components/react/post-accordion-item.d.ts +11 -0
  104. package/dist/components/react/post-accordion-item.js +6 -0
  105. package/dist/components/react/post-accordion.d.ts +11 -0
  106. package/dist/components/react/post-accordion.js +6 -0
  107. package/dist/components/react/post-avatar.d.ts +11 -0
  108. package/dist/components/react/post-avatar.js +226 -0
  109. package/dist/components/react/post-back-to-top.d.ts +11 -0
  110. package/dist/components/react/post-back-to-top.js +145 -0
  111. package/dist/components/react/post-banner.d.ts +11 -0
  112. package/dist/components/react/post-banner.js +99 -0
  113. package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
  114. package/dist/components/react/post-breadcrumb-item.js +6 -0
  115. package/dist/components/react/post-breadcrumbs.d.ts +11 -0
  116. package/dist/components/react/post-breadcrumbs.js +187 -0
  117. package/dist/components/react/post-card-control.d.ts +11 -0
  118. package/dist/components/react/post-card-control.js +327 -0
  119. package/dist/components/react/post-closebutton.d.ts +11 -0
  120. package/dist/components/react/post-closebutton.js +50 -0
  121. package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
  122. package/dist/components/react/post-collapsible-trigger.js +6 -0
  123. package/dist/components/react/post-collapsible.d.ts +11 -0
  124. package/dist/components/react/post-collapsible.js +6 -0
  125. package/dist/components/react/post-footer.d.ts +11 -0
  126. package/dist/components/react/post-footer.js +117 -0
  127. package/dist/components/react/post-header.d.ts +11 -0
  128. package/dist/components/react/post-header.js +333 -0
  129. package/dist/components/react/post-icon.d.ts +11 -0
  130. package/dist/components/react/post-icon.js +6 -0
  131. package/dist/components/react/post-language-option.d.ts +11 -0
  132. package/dist/components/react/post-language-option.js +101 -0
  133. package/dist/components/react/post-language-switch.d.ts +11 -0
  134. package/dist/components/react/post-language-switch.js +159 -0
  135. package/dist/components/react/post-linkarea.d.ts +11 -0
  136. package/dist/components/react/post-linkarea.js +46 -0
  137. package/dist/components/react/post-list-item.d.ts +11 -0
  138. package/dist/components/react/post-list-item.js +39 -0
  139. package/dist/components/react/post-list.d.ts +11 -0
  140. package/dist/components/react/post-list.js +62 -0
  141. package/dist/components/react/post-logo.d.ts +11 -0
  142. package/dist/components/react/post-logo.js +59 -0
  143. package/dist/components/react/post-mainnavigation.d.ts +11 -0
  144. package/dist/components/react/post-mainnavigation.js +181 -0
  145. package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
  146. package/dist/components/react/post-megadropdown-trigger.js +137 -0
  147. package/dist/components/react/post-megadropdown.d.ts +11 -0
  148. package/dist/components/react/post-megadropdown.js +197 -0
  149. package/dist/components/react/post-menu-item.d.ts +11 -0
  150. package/dist/components/react/post-menu-item.js +6 -0
  151. package/dist/components/react/post-menu-trigger.d.ts +11 -0
  152. package/dist/components/react/post-menu-trigger.js +6 -0
  153. package/dist/components/react/post-menu.d.ts +11 -0
  154. package/dist/components/react/post-menu.js +6 -0
  155. package/dist/components/react/post-popover.d.ts +11 -0
  156. package/dist/components/react/post-popover.js +189 -0
  157. package/dist/components/react/post-popovercontainer.d.ts +11 -0
  158. package/dist/components/react/post-popovercontainer.js +6 -0
  159. package/dist/components/react/post-rating.d.ts +11 -0
  160. package/dist/components/react/post-rating.js +153 -0
  161. package/dist/components/react/post-tab-header.d.ts +11 -0
  162. package/dist/components/react/post-tab-header.js +53 -0
  163. package/dist/components/react/post-tab-panel.d.ts +11 -0
  164. package/dist/components/react/post-tab-panel.js +55 -0
  165. package/dist/components/react/post-tabs.d.ts +11 -0
  166. package/dist/components/react/post-tabs.js +197 -0
  167. package/dist/components/react/post-togglebutton.d.ts +11 -0
  168. package/dist/components/react/post-togglebutton.js +57 -0
  169. package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
  170. package/dist/components/react/post-tooltip-trigger.js +5223 -0
  171. package/dist/components/react/post-tooltip.d.ts +11 -0
  172. package/dist/components/react/post-tooltip.js +115 -0
  173. package/dist/components/switch-variants.js +3 -0
  174. package/dist/docs.json +20 -30
  175. package/dist/esm/event-from-kraHE1r3.js +105 -0
  176. package/dist/esm/index-C8a0ddDa.js +4 -4
  177. package/dist/esm/index-VmK3ABCB.js +88 -0
  178. package/dist/esm/loader.js +1 -1
  179. package/dist/esm/package-0Ltezq5O.js +3 -0
  180. package/dist/esm/post-accordion_2.entry.js +5 -5
  181. package/dist/esm/post-avatar.entry.js +92 -55
  182. package/dist/esm/post-back-to-top.entry.js +2 -2
  183. package/dist/esm/post-banner.entry.js +4 -4
  184. package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
  185. package/dist/esm/post-breadcrumbs.entry.js +2 -2
  186. package/dist/esm/post-card-control.entry.js +2 -2
  187. package/dist/esm/post-closebutton_15.entry.js +6 -7
  188. package/dist/esm/post-collapsible_2.entry.js +3 -3
  189. package/dist/esm/post-components.js +1 -1
  190. package/dist/esm/post-footer.entry.js +2 -2
  191. package/dist/esm/post-linkarea.entry.js +1 -1
  192. package/dist/esm/post-popover.entry.js +2 -2
  193. package/dist/esm/post-rating.entry.js +2 -2
  194. package/dist/esm/post-tab-header.entry.js +2 -2
  195. package/dist/esm/post-tab-panel.entry.js +2 -2
  196. package/dist/esm/post-tabs.entry.js +2 -2
  197. package/dist/esm/post-tooltip-trigger.entry.js +2 -2
  198. package/dist/esm/post-tooltip.entry.js +2 -2
  199. package/dist/loader/cdn.js +1 -0
  200. package/dist/loader/index.cjs.js +1 -0
  201. package/{loader → dist/loader}/index.d.ts +1 -1
  202. package/dist/loader/index.es2017.js +1 -0
  203. package/{loader → dist/loader}/index.js +1 -1
  204. package/dist/post-components/p-0Ltezq5O.js +1 -0
  205. package/dist/post-components/{p-bbe02ba3.entry.js → p-16772417.entry.js} +1 -1
  206. package/dist/post-components/{p-45007aac.entry.js → p-38d3d441.entry.js} +1 -1
  207. package/dist/post-components/{p-f67b616a.entry.js → p-3c71f590.entry.js} +1 -1
  208. package/dist/post-components/{p-a2fa5ce4.entry.js → p-40f21542.entry.js} +1 -1
  209. package/dist/post-components/{p-031f7489.entry.js → p-4243cdd1.entry.js} +1 -1
  210. package/dist/post-components/p-4c18cb8c.entry.js +1 -0
  211. package/dist/post-components/{p-c1cf39cb.entry.js → p-51dc7647.entry.js} +1 -1
  212. package/dist/post-components/{p-e9802b56.entry.js → p-6777e505.entry.js} +1 -1
  213. package/dist/post-components/{p-2f698af4.entry.js → p-6add880f.entry.js} +1 -1
  214. package/dist/post-components/{p-2ca196d6.entry.js → p-8363fedb.entry.js} +1 -1
  215. package/dist/post-components/p-83998038.entry.js +1 -0
  216. package/dist/post-components/{p-d0d92071.entry.js → p-85bb1b5e.entry.js} +1 -1
  217. package/dist/post-components/{p-3adbdda7.entry.js → p-8f4d8685.entry.js} +1 -1
  218. package/dist/post-components/{p-1e6a068a.entry.js → p-95ad536d.entry.js} +1 -1
  219. package/dist/post-components/{p-9428231b.entry.js → p-9d806e89.entry.js} +1 -1
  220. package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
  221. package/dist/post-components/{p-57703aee.entry.js → p-aad86320.entry.js} +1 -1
  222. package/dist/post-components/p-c3e38acf.entry.js +1 -0
  223. package/dist/post-components/{p-ab8017bb.entry.js → p-d61bb2ff.entry.js} +1 -1
  224. package/dist/post-components/p-kraHE1r3.js +1 -0
  225. package/dist/post-components/post-components.esm.js +1 -1
  226. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
  227. package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
  228. package/dist/types/components/post-avatar/post-avatar.d.ts +13 -10
  229. package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
  230. package/dist/types/components/post-menu/post-menu.d.ts +3 -0
  231. package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
  232. package/dist/types/components.d.ts +0 -19
  233. package/dist/types/utils/component-on-ready.d.ts +2 -2
  234. package/hydrate/index.js +110 -70
  235. package/hydrate/index.mjs +110 -70
  236. package/package.json +19 -9
  237. package/dist/components/p-Z01QMrov.js +0 -3
  238. package/dist/esm/package-Z01QMrov.js +0 -3
  239. package/dist/post-components/p-7b8ab026.entry.js +0 -1
  240. package/dist/post-components/p-8U5GFtQP.js +0 -1
  241. package/dist/post-components/p-Z01QMrov.js +0 -1
  242. package/dist/post-components/p-ac73ab00.entry.js +0 -1
  243. package/dist/post-components/p-e96239c4.entry.js +0 -1
  244. package/loader/cdn.js +0 -1
  245. package/loader/index.cjs.js +0 -1
  246. package/loader/index.es2017.js +0 -1
  247. /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
  248. /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
  249. /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
  250. /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
  251. /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
  252. /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
  253. /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
  254. /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
  255. /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
@@ -0,0 +1,197 @@
1
+ import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
2
+ import { v as version } from './p-0Ltezq5O.js';
3
+ import { f as fadeOut, a as fadeIn } from './p-SbIC4aZX.js';
4
+ import './p-CJ80BZ06.js';
5
+
6
+ /**
7
+ * Invoke the `componentOnReady` method if it is available, simulate it otherwise
8
+ * @see https://stenciljs.com/docs/api#componentonready
9
+ */
10
+ function componentOnReady(el) {
11
+ if (typeof el.componentOnReady === 'function') {
12
+ return el.componentOnReady();
13
+ }
14
+ else {
15
+ return new Promise(resolve => customOnReady(() => {
16
+ resolve(el);
17
+ }));
18
+ }
19
+ }
20
+ function customOnReady(callback) {
21
+ if (typeof requestAnimationFrame === 'function') {
22
+ return requestAnimationFrame(callback);
23
+ }
24
+ return setTimeout(callback);
25
+ }
26
+
27
+ const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(0,0,0,.02)}.tabs-wrapper::after{content:\"\";position:absolute;bottom:0;width:100%;height:1px;background-color:#ccc}.tabs-wrapper .tabs{background-color:rgba(0,0,0,0) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}.tabs::after{content:\"\";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}:host{display:block}:host([full-width=true]) .tabs-wrapper{margin-inline:calc(-1*var(--post-container-offset))}:host([full-width=true]) .tabs-wrapper .tabs{padding-inline:var(--post-container-offset)}";
28
+
29
+ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends H {
30
+ constructor() {
31
+ super();
32
+ this.__registerHost();
33
+ this.__attachShadow();
34
+ this.postChange = createEvent(this, "postChange");
35
+ this.isLoaded = false;
36
+ /**
37
+ * When set to true, this property allows the tabs container to span the
38
+ * full width of the screen, from edge to edge.
39
+ */
40
+ this.fullWidth = false;
41
+ }
42
+ get tabs() {
43
+ return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab => tab.closest('post-tabs') === this.host);
44
+ }
45
+ componentDidLoad() {
46
+ this.moveMisplacedTabs();
47
+ this.enableTabs();
48
+ const initiallyActivePanel = this.activePanel || this.tabs[0]?.panel;
49
+ void this.show(initiallyActivePanel);
50
+ this.isLoaded = true;
51
+ }
52
+ /**
53
+ * Shows the panel with the given name and selects its associated tab.
54
+ * Any other panel that was previously shown becomes hidden and its associated tab is unselected.
55
+ */
56
+ async show(panelName) {
57
+ // do nothing if the tab is already active
58
+ if (panelName === this.activeTab?.panel) {
59
+ return;
60
+ }
61
+ const previousTab = this.activeTab;
62
+ const newTab = this.host.querySelector(`post-tab-header[panel=${panelName}]`);
63
+ this.activateTab(newTab);
64
+ // if a panel is currently being displayed, remove it from the view and complete the associated animation
65
+ if (this.showing) {
66
+ this.showing.effect['target'].style.display = 'none';
67
+ this.showing.finish();
68
+ }
69
+ // hide the currently visible panel only if no other animation is running
70
+ if (previousTab && !this.showing && !this.hiding)
71
+ this.hidePanel(previousTab.panel);
72
+ // wait for any hiding animation to complete before showing the selected tab
73
+ if (this.hiding)
74
+ await this.hiding.finished;
75
+ this.showSelectedPanel();
76
+ // wait for any display animation to complete for the returned promise to fully resolve
77
+ if (this.showing)
78
+ await this.showing.finished;
79
+ if (this.isLoaded)
80
+ this.postChange.emit(this.activeTab.panel);
81
+ }
82
+ moveMisplacedTabs() {
83
+ if (!this.tabs)
84
+ return;
85
+ this.tabs.forEach(tab => {
86
+ if (tab.getAttribute('slot') === 'tabs')
87
+ return;
88
+ tab.setAttribute('slot', 'tabs');
89
+ });
90
+ }
91
+ enableTabs() {
92
+ if (!this.tabs)
93
+ return;
94
+ this.tabs.forEach(async (tab) => {
95
+ await componentOnReady(tab);
96
+ // if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
97
+ if (tab.getAttribute('aria-controls'))
98
+ return;
99
+ const tabPanel = this.getPanel(tab.panel);
100
+ tab.setAttribute('aria-controls', tabPanel.id);
101
+ tabPanel.setAttribute('aria-labelledby', tab.id);
102
+ tab.addEventListener('click', () => {
103
+ void this.show(tab.panel);
104
+ });
105
+ tab.addEventListener('keydown', (e) => {
106
+ if (e.key === 'Enter' || e.key === ' ') {
107
+ e.preventDefault();
108
+ void this.show(tab.panel);
109
+ }
110
+ });
111
+ tab.addEventListener('keydown', (e) => {
112
+ if (e.key === 'ArrowRight' || e.key === 'ArrowLeft')
113
+ this.navigateTabs(tab, e.key);
114
+ });
115
+ });
116
+ // if the currently active tab was removed from the DOM then select the first one
117
+ if (this.activeTab && !this.activeTab.isConnected) {
118
+ void this.show(this.tabs[0]?.panel);
119
+ }
120
+ }
121
+ activateTab(tab) {
122
+ if (this.activeTab) {
123
+ this.activeTab.setAttribute('aria-selected', 'false');
124
+ this.activeTab.setAttribute('tabindex', '-1');
125
+ this.activeTab.classList.remove('active');
126
+ }
127
+ tab.setAttribute('aria-selected', 'true');
128
+ tab.setAttribute('tabindex', '0');
129
+ tab.classList.add('active');
130
+ this.activeTab = tab;
131
+ }
132
+ hidePanel(panelName) {
133
+ const previousPanel = this.getPanel(panelName);
134
+ if (!previousPanel)
135
+ return;
136
+ this.hiding = fadeOut(previousPanel);
137
+ this.hiding.onfinish = () => {
138
+ previousPanel.style.display = 'none';
139
+ this.hiding = null;
140
+ };
141
+ }
142
+ showSelectedPanel() {
143
+ const panel = this.getPanel(this.activeTab.panel);
144
+ panel.style.display = 'block';
145
+ // prevent the initially selected panel from fading in
146
+ if (!this.isLoaded)
147
+ return;
148
+ this.showing = fadeIn(panel);
149
+ this.showing.onfinish = () => {
150
+ this.showing = null;
151
+ };
152
+ }
153
+ getPanel(name) {
154
+ return this.host.querySelector(`post-tab-panel[name=${name}]`);
155
+ }
156
+ navigateTabs(tab, key) {
157
+ const activeTabIndex = Array.from(this.tabs).indexOf(tab);
158
+ let nextTab;
159
+ if (key === 'ArrowRight') {
160
+ nextTab = this.tabs[activeTabIndex + 1] || this.tabs[0];
161
+ }
162
+ else {
163
+ nextTab = this.tabs[activeTabIndex - 1] || this.tabs[this.tabs.length - 1];
164
+ }
165
+ if (!nextTab)
166
+ return;
167
+ nextTab.focus();
168
+ }
169
+ render() {
170
+ return (h(Host, { key: 'dc7228c840d65e3546e0d13e5bcaa78819b5aeb9', "data-version": version }, h("div", { key: '377d592f7c00f3ec0c7aba2a4a8ca2b88cd37927', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '6e79f33d6cd82d55ba9fad2f09f6163ce7e0a372', class: "tabs", role: "tablist" }, h("slot", { key: '65fbf3cb6525f2f2ae97eb60dad313811db4c585', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '675a59a27e79bad06ea2b70c4fc7b0a6f4b020ff', class: "tab-content", part: "content" }, h("slot", { key: 'b559af0fa652e352673fbabb6829a62a5630e809', onSlotchange: () => this.moveMisplacedTabs() }))));
171
+ }
172
+ get host() { return this; }
173
+ static get style() { return postTabsCss; }
174
+ }, [1, "post-tabs", {
175
+ "activePanel": [1, "active-panel"],
176
+ "fullWidth": [516, "full-width"],
177
+ "show": [64]
178
+ }]);
179
+ function defineCustomElement$1() {
180
+ if (typeof customElements === "undefined") {
181
+ return;
182
+ }
183
+ const components = ["post-tabs"];
184
+ components.forEach(tagName => { switch (tagName) {
185
+ case "post-tabs":
186
+ if (!customElements.get(tagName)) {
187
+ customElements.define(tagName, PostTabs$1);
188
+ }
189
+ break;
190
+ } });
191
+ }
192
+ defineCustomElement$1();
193
+
194
+ const PostTabs = PostTabs$1;
195
+ const defineCustomElement = defineCustomElement$1;
196
+
197
+ export { PostTabs, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../../types/components";
2
+
3
+ interface PostTogglebutton extends Components.PostTogglebutton, HTMLElement {}
4
+ export const PostTogglebutton: {
5
+ prototype: PostTogglebutton;
6
+ new (): PostTogglebutton;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,57 @@
1
+ import { p as proxyCustomElement, H, h, a as Host } from './index.js';
2
+ import { v as version } from './p-0Ltezq5O.js';
3
+
4
+ const postTogglebuttonCss = ":host{cursor:pointer;outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}";
5
+
6
+ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutton extends H {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.__attachShadow();
11
+ /**
12
+ * If `true`, the button is in the "on" state, otherwise it is in the "off" state.
13
+ */
14
+ this.toggled = false;
15
+ this.handleClick = () => {
16
+ this.toggled = !this.toggled;
17
+ };
18
+ this.handleKeydown = (event) => {
19
+ // perform a click when enter or spaced are pressed to mimic the button behavior
20
+ if (event.key === 'Enter' || event.key === ' ') {
21
+ event.preventDefault(); // prevents the page from scrolling when space is pressed
22
+ this.host.click();
23
+ }
24
+ };
25
+ }
26
+ componentWillLoad() {
27
+ // add event listener to not override listener that might be set on the host
28
+ this.host.addEventListener('click', () => this.handleClick());
29
+ this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
30
+ }
31
+ render() {
32
+ return (h(Host, { key: '1cebe1d1314e2c89f141869e07521e7f30e58617', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '8b8c33befde8e93eca73a6239170c3786e2cf2f2' })));
33
+ }
34
+ get host() { return this; }
35
+ static get style() { return postTogglebuttonCss; }
36
+ }, [1, "post-togglebutton", {
37
+ "toggled": [1028]
38
+ }]);
39
+ function defineCustomElement$1() {
40
+ if (typeof customElements === "undefined") {
41
+ return;
42
+ }
43
+ const components = ["post-togglebutton"];
44
+ components.forEach(tagName => { switch (tagName) {
45
+ case "post-togglebutton":
46
+ if (!customElements.get(tagName)) {
47
+ customElements.define(tagName, PostTogglebutton$1);
48
+ }
49
+ break;
50
+ } });
51
+ }
52
+ defineCustomElement$1();
53
+
54
+ const PostTogglebutton = PostTogglebutton$1;
55
+ const defineCustomElement = defineCustomElement$1;
56
+
57
+ export { PostTogglebutton, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../../types/components";
2
+
3
+ interface PostTooltipTrigger extends Components.PostTooltipTrigger, HTMLElement {}
4
+ export const PostTooltipTrigger: {
5
+ prototype: PostTooltipTrigger;
6
+ new (): PostTooltipTrigger;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;