@swisspost/design-system-components 8.0.0 → 8.2.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 (223) hide show
  1. package/dist/cjs/{index-a1440961.js → index-01f30442.js} +13 -0
  2. package/dist/cjs/{index-baad16da.js → index-c15bd800.js} +43 -5
  3. package/dist/cjs/index.cjs.js +19 -17
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{package-28cba29c.js → package-f9a656fd.js} +1 -1
  6. package/dist/cjs/{post-accordion-fc746a6f.js → post-accordion-30216884.js} +2 -2
  7. package/dist/cjs/{post-accordion-item-c0492b73.js → post-accordion-item-4eba14e6.js} +3 -3
  8. package/dist/cjs/post-accordion-item.cjs.entry.js +4 -4
  9. package/dist/cjs/post-accordion.cjs.entry.js +3 -3
  10. package/dist/cjs/{post-alert-0612ad51.js → post-alert-e305480e.js} +4 -4
  11. package/dist/cjs/post-alert.cjs.entry.js +4 -4
  12. package/dist/cjs/post-card-control-e63582f3.js +272 -0
  13. package/dist/cjs/post-card-control.cjs.entry.js +3 -3
  14. package/dist/cjs/{post-collapsible-trigger-8d39196e.js → post-collapsible-trigger-5d8b9047.js} +3 -3
  15. package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -4
  16. package/dist/cjs/post-components.cjs.js +2 -2
  17. package/dist/cjs/{post-icon-bd260560.js → post-icon-8ab009d4.js} +3 -3
  18. package/dist/cjs/post-icon.cjs.entry.js +4 -4
  19. package/dist/cjs/post-logo-9f4c551c.js +39 -0
  20. package/dist/cjs/post-logo.cjs.entry.js +14 -0
  21. package/dist/cjs/{post-popover-303e76ef.js → post-popover-3f14dab4.js} +3 -3
  22. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  23. package/dist/cjs/{post-popovercontainer-c64bde39.js → post-popovercontainer-5f1717be.js} +4 -4
  24. package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
  25. package/dist/cjs/{post-rating-dc7bd246.js → post-rating-b6ebb2d7.js} +3 -3
  26. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  27. package/dist/cjs/{post-tab-header-06c40218.js → post-tab-header-ebd691dd.js} +3 -3
  28. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  29. package/dist/cjs/{post-tab-panel-54fbdb66.js → post-tab-panel-a15af8bb.js} +3 -3
  30. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  31. package/dist/cjs/{post-tabs-52b9d638.js → post-tabs-d3233bc8.js} +28 -7
  32. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  33. package/dist/cjs/{post-tag-4aba2155.js → post-tag-534251e7.js} +4 -4
  34. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  35. package/dist/cjs/{post-tooltip-3c695f60.js → post-tooltip-a8399659.js} +4 -4
  36. package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
  37. package/dist/collection/collection-manifest.json +1 -0
  38. package/dist/collection/components/post-alert/post-alert.css +1 -1
  39. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  40. package/dist/collection/components/post-card-control/post-card-control.js +23 -25
  41. package/dist/collection/components/post-logo/post-logo.css +1 -0
  42. package/dist/collection/components/post-logo/post-logo.js +73 -0
  43. package/dist/collection/components/post-popover/post-popover.js +1 -1
  44. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +2 -2
  45. package/dist/collection/components/post-rating/post-rating.js +1 -1
  46. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  47. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  48. package/dist/collection/components/post-tabs/post-tabs.js +6 -5
  49. package/dist/collection/components/post-tag/post-tag.css +1 -1
  50. package/dist/collection/components/post-tag/post-tag.js +1 -1
  51. package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
  52. package/dist/collection/index.js +1 -0
  53. package/dist/collection/utils/component-on-ready.js +20 -0
  54. package/dist/collection/utils/index.js +1 -0
  55. package/dist/collection/utils/property-checkers/check-url.js +10 -0
  56. package/dist/collection/utils/property-checkers/index.js +3 -0
  57. package/dist/components/index.js +1 -0
  58. package/dist/components/index2.js +13 -1
  59. package/dist/components/package.js +1 -1
  60. package/dist/components/post-alert2.js +1 -1
  61. package/dist/components/post-card-control2.js +21 -64
  62. package/dist/components/post-logo.d.ts +11 -0
  63. package/dist/components/post-logo.js +6 -0
  64. package/dist/components/post-logo2.js +56 -0
  65. package/dist/components/post-popover2.js +1 -1
  66. package/dist/components/post-popovercontainer2.js +2 -2
  67. package/dist/components/post-rating2.js +1 -1
  68. package/dist/components/post-tab-header2.js +1 -1
  69. package/dist/components/post-tab-panel2.js +1 -1
  70. package/dist/components/post-tabs2.js +26 -5
  71. package/dist/components/post-tag2.js +2 -2
  72. package/dist/components/post-tooltip2.js +1 -1
  73. package/dist/docs.json +64 -5
  74. package/dist/esm/{index-189d3985.js → index-0b56fc28.js} +43 -5
  75. package/dist/esm/{index-d1eba94c.js → index-f41b763f.js} +13 -1
  76. package/dist/esm/index.js +18 -17
  77. package/dist/esm/loader.js +3 -3
  78. package/dist/esm/{package-3e4546f5.js → package-f02beabb.js} +1 -1
  79. package/dist/esm/{post-accordion-1cbd089a.js → post-accordion-f850422a.js} +2 -2
  80. package/dist/esm/{post-accordion-item-316ee985.js → post-accordion-item-c2eaeaa7.js} +3 -3
  81. package/dist/esm/post-accordion-item.entry.js +4 -4
  82. package/dist/esm/post-accordion.entry.js +3 -3
  83. package/dist/esm/{post-alert-6fa442b9.js → post-alert-f17886df.js} +4 -4
  84. package/dist/esm/post-alert.entry.js +4 -4
  85. package/dist/esm/post-card-control-25bbcb80.js +270 -0
  86. package/dist/esm/post-card-control.entry.js +3 -3
  87. package/dist/esm/{post-collapsible-trigger-6f4ba350.js → post-collapsible-trigger-49da97d7.js} +3 -3
  88. package/dist/esm/post-collapsible_2.entry.js +4 -4
  89. package/dist/esm/post-components.js +3 -3
  90. package/dist/esm/{post-icon-fe467f6a.js → post-icon-168d95b5.js} +3 -3
  91. package/dist/esm/post-icon.entry.js +4 -4
  92. package/dist/esm/post-logo-47744c24.js +37 -0
  93. package/dist/esm/post-logo.entry.js +6 -0
  94. package/dist/esm/{post-popover-c9998136.js → post-popover-594e9965.js} +3 -3
  95. package/dist/esm/post-popover.entry.js +3 -3
  96. package/dist/esm/{post-popovercontainer-62ced3d7.js → post-popovercontainer-89cee0fe.js} +4 -4
  97. package/dist/esm/post-popovercontainer.entry.js +3 -3
  98. package/dist/esm/{post-rating-49ace0e9.js → post-rating-b87dfbdc.js} +3 -3
  99. package/dist/esm/post-rating.entry.js +3 -3
  100. package/dist/esm/{post-tab-header-696a7aae.js → post-tab-header-2c59fd6e.js} +3 -3
  101. package/dist/esm/post-tab-header.entry.js +3 -3
  102. package/dist/esm/{post-tab-panel-c00910fb.js → post-tab-panel-40bf9d2d.js} +3 -3
  103. package/dist/esm/post-tab-panel.entry.js +3 -3
  104. package/dist/esm/{post-tabs-a7990c9e.js → post-tabs-264e5871.js} +28 -7
  105. package/dist/esm/post-tabs.entry.js +3 -3
  106. package/dist/esm/{post-tag-d9650103.js → post-tag-a7c63782.js} +4 -4
  107. package/dist/esm/post-tag.entry.js +3 -3
  108. package/dist/esm/{post-tooltip-cf07e816.js → post-tooltip-5d2d9e1f.js} +4 -4
  109. package/dist/esm/post-tooltip.entry.js +4 -4
  110. package/dist/post-components/index.esm.js +1 -1
  111. package/dist/post-components/p-04cb82f1.entry.js +1 -0
  112. package/dist/post-components/{p-69145fd2.js → p-057d7d3a.js} +1 -1
  113. package/dist/post-components/{p-5c4773cb.js → p-0cca56a8.js} +2 -2
  114. package/dist/post-components/p-12f3ce0c.entry.js +1 -0
  115. package/dist/post-components/p-176b59a8.entry.js +1 -0
  116. package/dist/post-components/p-1800787b.js +1 -0
  117. package/dist/post-components/{p-f732d73c.js → p-300eb394.js} +1 -1
  118. package/dist/post-components/{p-6c701d9f.js → p-517f2648.js} +1 -1
  119. package/dist/post-components/p-53eb6ca5.entry.js +1 -0
  120. package/dist/post-components/p-5607b941.js +1 -0
  121. package/dist/post-components/p-5b918e0f.entry.js +1 -0
  122. package/dist/post-components/p-6069d96e.entry.js +1 -0
  123. package/dist/post-components/p-6b8378bf.js +1 -0
  124. package/dist/post-components/p-71b8ba91.entry.js +1 -0
  125. package/dist/post-components/p-78806458.entry.js +1 -0
  126. package/dist/post-components/p-851ef572.entry.js +1 -0
  127. package/dist/post-components/{p-783e67bc.js → p-8b28c907.js} +1 -1
  128. package/dist/post-components/{p-660ecc23.js → p-90eec417.js} +1 -1
  129. package/dist/post-components/p-9f2fc85c.js +1 -0
  130. package/dist/post-components/{p-ab26873d.js → p-ac5a88be.js} +1 -1
  131. package/dist/post-components/{p-266adbdd.js → p-aca6ea02.js} +1 -1
  132. package/dist/post-components/p-b08e169f.entry.js +1 -0
  133. package/dist/post-components/p-b6b61f13.js +1 -0
  134. package/dist/post-components/{p-a4794190.js → p-b8c5020d.js} +1 -1
  135. package/dist/post-components/p-be553212.entry.js +1 -0
  136. package/dist/post-components/p-bf357eb3.entry.js +1 -0
  137. package/dist/post-components/{p-7095990e.js → p-c76880ff.js} +1 -1
  138. package/dist/post-components/p-d2f9de94.js +2 -0
  139. package/dist/post-components/p-d4163064.js +1 -0
  140. package/dist/post-components/p-ddab4c09.entry.js +1 -0
  141. package/dist/post-components/p-deb4131c.js +1 -0
  142. package/dist/post-components/p-e597a879.entry.js +1 -0
  143. package/dist/post-components/p-eafc65f6.entry.js +1 -0
  144. package/dist/post-components/post-components.esm.js +1 -1
  145. package/dist/types/components/post-card-control/post-card-control.d.ts +5 -7
  146. package/dist/types/components/post-logo/post-logo.d.ts +14 -0
  147. package/dist/types/components.d.ts +29 -8
  148. package/dist/types/index.d.ts +1 -0
  149. package/dist/types/utils/component-on-ready.d.ts +6 -0
  150. package/dist/types/utils/index.d.ts +1 -0
  151. package/dist/types/utils/property-checkers/check-url.d.ts +1 -0
  152. package/dist/types/utils/property-checkers/index.d.ts +2 -0
  153. package/loaders/attribute-observer.js +25 -0
  154. package/loaders/check-non-empty.js +9 -0
  155. package/loaders/check-one-of.js +6 -0
  156. package/loaders/check-type.js +14 -0
  157. package/loaders/constants.js +3 -0
  158. package/loaders/fade.js +7 -0
  159. package/loaders/heading-levels.js +3 -0
  160. package/loaders/index.d.ts +68 -0
  161. package/loaders/index.js +18 -0
  162. package/loaders/index2.js +34 -0
  163. package/loaders/package.js +3 -0
  164. package/loaders/post-accordion-item.d.ts +11 -0
  165. package/loaders/post-accordion-item.js +86 -0
  166. package/loaders/post-accordion.d.ts +11 -0
  167. package/loaders/post-accordion.js +128 -0
  168. package/loaders/post-alert.d.ts +11 -0
  169. package/loaders/post-alert.js +139 -0
  170. package/loaders/post-card-control.d.ts +11 -0
  171. package/loaders/post-card-control.js +306 -0
  172. package/loaders/post-collapsible-trigger.d.ts +11 -0
  173. package/loaders/post-collapsible-trigger.js +6 -0
  174. package/loaders/post-collapsible-trigger2.js +144 -0
  175. package/loaders/post-collapsible.d.ts +11 -0
  176. package/loaders/post-collapsible.js +6 -0
  177. package/loaders/post-collapsible2.js +103 -0
  178. package/loaders/post-icon.d.ts +11 -0
  179. package/loaders/post-icon.js +6 -0
  180. package/loaders/post-icon2.js +136 -0
  181. package/loaders/post-logo.d.ts +11 -0
  182. package/loaders/post-logo.js +59 -0
  183. package/loaders/post-popover.d.ts +11 -0
  184. package/loaders/post-popover.js +133 -0
  185. package/loaders/post-popovercontainer.d.ts +11 -0
  186. package/loaders/post-popovercontainer.js +6 -0
  187. package/loaders/post-popovercontainer2.js +2204 -0
  188. package/loaders/post-rating.d.ts +11 -0
  189. package/loaders/post-rating.js +116 -0
  190. package/loaders/post-tab-header.d.ts +11 -0
  191. package/loaders/post-tab-header.js +53 -0
  192. package/loaders/post-tab-panel.d.ts +11 -0
  193. package/loaders/post-tab-panel.js +45 -0
  194. package/loaders/post-tabs.d.ts +11 -0
  195. package/loaders/post-tabs.js +192 -0
  196. package/loaders/post-tag.d.ts +11 -0
  197. package/loaders/post-tag.js +77 -0
  198. package/loaders/post-tooltip.d.ts +11 -0
  199. package/loaders/post-tooltip.js +5000 -0
  200. package/package.json +13 -12
  201. package/dist/cjs/post-card-control-2fd18624.js +0 -315
  202. package/dist/esm/post-card-control-41356aa4.js +0 -313
  203. package/dist/post-components/p-0aee269b.entry.js +0 -1
  204. package/dist/post-components/p-2240981f.entry.js +0 -1
  205. package/dist/post-components/p-27cb2e60.entry.js +0 -1
  206. package/dist/post-components/p-2c9277b1.entry.js +0 -1
  207. package/dist/post-components/p-3764a23a.entry.js +0 -1
  208. package/dist/post-components/p-382f85c4.js +0 -1
  209. package/dist/post-components/p-48ed21f0.entry.js +0 -1
  210. package/dist/post-components/p-496cee95.entry.js +0 -1
  211. package/dist/post-components/p-4ce46830.entry.js +0 -1
  212. package/dist/post-components/p-5135c965.entry.js +0 -1
  213. package/dist/post-components/p-6af42a67.entry.js +0 -1
  214. package/dist/post-components/p-7481e37a.entry.js +0 -1
  215. package/dist/post-components/p-8f0ee57c.entry.js +0 -1
  216. package/dist/post-components/p-90479234.js +0 -1
  217. package/dist/post-components/p-a4e13e9c.js +0 -1
  218. package/dist/post-components/p-b08aca79.entry.js +0 -1
  219. package/dist/post-components/p-beb27e06.js +0 -1
  220. package/dist/post-components/p-c0f265c8.js +0 -2
  221. package/dist/post-components/p-e024aa18.js +0 -1
  222. package/dist/post-components/p-ea063aae.entry.js +0 -1
  223. package/dist/post-components/p-f91c0e1b.js +0 -1
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostRating extends Components.PostRating, HTMLElement {}
4
+ export const PostRating: {
5
+ prototype: PostRating;
6
+ new (): PostRating;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,116 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { v as version } from './package.js';
3
+ import { d as defineCustomElement$2 } from './post-icon2.js';
4
+
5
+ const postRatingCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}";
6
+ const PostRatingStyle0 = postRatingCss;
7
+
8
+ const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.postInput = createEvent(this, "postInput", 7);
14
+ this.postChange = createEvent(this, "postChange", 7);
15
+ this.hasChanged = false;
16
+ this.hoveredIndex = undefined;
17
+ this.label = 'Rating';
18
+ this.stars = 5;
19
+ this.currentRating = 0;
20
+ this.readonly = false;
21
+ this.keydownHandler = this.keydownHandler.bind(this);
22
+ this.blurHandler = this.blurHandler.bind(this);
23
+ this.hoverHandler = this.hoverHandler.bind(this);
24
+ }
25
+ update(value) {
26
+ if (this.readonly || value < 0 || value > this.stars)
27
+ return;
28
+ this.currentRating = this.currentRating !== value ? value : 0; // If a star is clicked the second time, the rating gets set to 0.
29
+ this.postInput.emit({ value: this.currentRating });
30
+ this.hasChanged = true;
31
+ }
32
+ keydownHandler(e) {
33
+ switch (e.key) {
34
+ case 'ArrowDown':
35
+ case 'ArrowLeft':
36
+ e.preventDefault();
37
+ this.update(this.currentRating - 1);
38
+ break;
39
+ case 'ArrowUp':
40
+ case 'ArrowRight':
41
+ e.preventDefault();
42
+ this.update(this.currentRating + 1);
43
+ break;
44
+ case 'Home':
45
+ e.preventDefault();
46
+ this.update(0);
47
+ break;
48
+ case 'End':
49
+ e.preventDefault();
50
+ this.update(this.stars);
51
+ break;
52
+ case 'Enter':
53
+ case ' ':
54
+ this.blurHandler();
55
+ break;
56
+ default:
57
+ return;
58
+ }
59
+ }
60
+ blurHandler() {
61
+ if (this.hasChanged) {
62
+ this.postChange.emit({ value: this.currentRating });
63
+ this.hasChanged = false;
64
+ }
65
+ }
66
+ hoverHandler(index, e) {
67
+ if (this.readonly)
68
+ return;
69
+ if (e.type === 'mouseenter') {
70
+ this.hoveredIndex = index;
71
+ }
72
+ else if (e.type === 'mouseleave') {
73
+ this.hoveredIndex = undefined;
74
+ }
75
+ }
76
+ render() {
77
+ return (h(Host, { key: '0a4972eeedcda4d4f772db0407ba2a6279f5d797', "data-version": version }, h("div", { key: 'a9ab9daaa3f9e1e421f28267057b99a1a2e235ee', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
78
+ 'star': true,
79
+ 'before-hover': i < this.hoveredIndex,
80
+ 'active': i < Math.round(this.currentRating),
81
+ 'hover': i === this.hoveredIndex,
82
+ 'after-active': i > this.hoveredIndex && i < this.currentRating,
83
+ }, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "2062", class: "stroke" }), h("post-icon", { name: "2574", class: "fill" })))))));
84
+ }
85
+ get host() { return this; }
86
+ static get style() { return PostRatingStyle0; }
87
+ }, [1, "post-rating", {
88
+ "label": [1],
89
+ "stars": [2],
90
+ "currentRating": [1026, "current-rating"],
91
+ "readonly": [4],
92
+ "hoveredIndex": [32]
93
+ }]);
94
+ function defineCustomElement$1() {
95
+ if (typeof customElements === "undefined") {
96
+ return;
97
+ }
98
+ const components = ["post-rating", "post-icon"];
99
+ components.forEach(tagName => { switch (tagName) {
100
+ case "post-rating":
101
+ if (!customElements.get(tagName)) {
102
+ customElements.define(tagName, PostRating$1);
103
+ }
104
+ break;
105
+ case "post-icon":
106
+ if (!customElements.get(tagName)) {
107
+ defineCustomElement$2();
108
+ }
109
+ break;
110
+ } });
111
+ }
112
+
113
+ const PostRating = PostRating$1;
114
+ const defineCustomElement = defineCustomElement$1;
115
+
116
+ export { PostRating, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostTabHeader extends Components.PostTabHeader, HTMLElement {}
4
+ export const PostTabHeader: {
5
+ prototype: PostTabHeader;
6
+ new (): PostTabHeader;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,53 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { v as version } from './package.js';
3
+ import { c as checkNonEmpty } from './check-non-empty.js';
4
+
5
+ const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:var(--post-contrast-color);text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(var(--post-contrast-color-rgb), 0.6);color:var(--post-contrast-color-inverted)}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(var(--post-contrast-color-rgb), 0.6);color:var(--post-contrast-color-inverted);box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:\"\";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:var(--post-contrast-color-inverted);color:var(--post-contrast-color);font-weight:700}.tab-title[role=tab].active::before{content:\"\";display:block;position:absolute;top:0;right:-1px;left:-1px;height:.25rem;background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.alert-primary,post-alert[type=primary],.alert-success,post-alert[type=success],.alert-danger,post-alert[type=danger],.alert-notification,post-alert[type=notification],.alert-error,post-alert[type=error]) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.alert-primary,post-alert[type=primary],.alert-success,post-alert[type=success],.alert-danger,post-alert[type=danger],.alert-notification,post-alert[type=notification],.alert-error,post-alert[type=error]) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:2px solid Highlight;outline-offset:-0.25rem}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}.bg-yellow .tab-title{background-color:#fc0}.bg-yellow .tab-title.active{background-color:#fc0}.bg-yellow .nav-item{background-color:#fc0}.bg-white .tab-title{background-color:#fff}.bg-white .tab-title.active{background-color:#fff}.bg-white .nav-item{background-color:#fff}.bg-light .tab-title{background-color:#faf9f8}.bg-light .tab-title.active{background-color:#faf9f8}.bg-light .nav-item{background-color:#faf9f8}.bg-gray .tab-title{background-color:#f4f3f1}.bg-gray .tab-title.active{background-color:#f4f3f1}.bg-gray .nav-item{background-color:#f4f3f1}.bg-dark .tab-title{background-color:#333}.bg-dark .tab-title.active{background-color:#333}.bg-dark .nav-item{background-color:#333}.bg-black .tab-title{background-color:#000}.bg-black .tab-title.active{background-color:#000}.bg-black .nav-item{background-color:#000}.bg-primary .tab-title{background-color:#333}.bg-primary .tab-title.active{background-color:#333}.bg-primary .nav-item{background-color:#333}.bg-secondary .tab-title{background-color:#666}.bg-secondary .tab-title.active{background-color:#666}.bg-secondary .nav-item{background-color:#666}.bg-success .tab-title{background-color:#2c871d}.bg-success .tab-title.active{background-color:#2c871d}.bg-success .nav-item{background-color:#2c871d}.bg-warning .tab-title{background-color:#f49e00}.bg-warning .tab-title.active{background-color:#f49e00}.bg-warning .nav-item{background-color:#f49e00}.bg-error .tab-title{background-color:#a51728}.bg-error .tab-title.active{background-color:#a51728}.bg-error .nav-item{background-color:#a51728}.bg-info .tab-title{background-color:#cce4ee}.bg-info .tab-title.active{background-color:#cce4ee}.bg-info .nav-item{background-color:#cce4ee}.bg-success-background .tab-title{background-color:#c0debb}.bg-success-background .tab-title.active{background-color:#c0debb}.bg-success-background .nav-item{background-color:#c0debb}.bg-warning-background .tab-title{background-color:#fce2b2}.bg-warning-background .tab-title.active{background-color:#fce2b2}.bg-warning-background .nav-item{background-color:#fce2b2}.bg-error-background .tab-title{background-color:#ffdade}.bg-error-background .tab-title.active{background-color:#ffdade}.bg-error-background .nav-item{background-color:#ffdade}.bg-nightblue .tab-title{background-color:#004976}.bg-nightblue .tab-title.active{background-color:#004976}.bg-nightblue .nav-item{background-color:#004976}.bg-nightblue-bright .tab-title{background-color:#0076a8}.bg-nightblue-bright .tab-title.active{background-color:#0076a8}.bg-nightblue-bright .nav-item{background-color:#0076a8}.bg-petrol .tab-title{background-color:#006d68}.bg-petrol .tab-title.active{background-color:#006d68}.bg-petrol .nav-item{background-color:#006d68}.bg-petrol-bright .tab-title{background-color:#00968f}.bg-petrol-bright .tab-title.active{background-color:#00968f}.bg-petrol-bright .nav-item{background-color:#00968f}.bg-coral .tab-title{background-color:#9e2a2f}.bg-coral .tab-title.active{background-color:#9e2a2f}.bg-coral .nav-item{background-color:#9e2a2f}.bg-coral-bright .tab-title{background-color:#e03c31}.bg-coral-bright .tab-title.active{background-color:#e03c31}.bg-coral-bright .nav-item{background-color:#e03c31}.bg-olive .tab-title{background-color:#716135}.bg-olive .tab-title.active{background-color:#716135}.bg-olive .nav-item{background-color:#716135}.bg-olive-bright .tab-title{background-color:#aa9d2e}.bg-olive-bright .tab-title.active{background-color:#aa9d2e}.bg-olive-bright .nav-item{background-color:#aa9d2e}.bg-purple .tab-title{background-color:#80276c}.bg-purple .tab-title.active{background-color:#80276c}.bg-purple .nav-item{background-color:#80276c}.bg-purple-bright .tab-title{background-color:#c5299b}.bg-purple-bright .tab-title.active{background-color:#c5299b}.bg-purple-bright .nav-item{background-color:#c5299b}.bg-aubergine .tab-title{background-color:#523178}.bg-aubergine .tab-title.active{background-color:#523178}.bg-aubergine .nav-item{background-color:#523178}.bg-aubergine-bright .tab-title{background-color:#7566a0}.bg-aubergine-bright .tab-title.active{background-color:#7566a0}.bg-aubergine-bright .nav-item{background-color:#7566a0}[class*=bg-] .tab-title.active:focus::after{background-color:rgba(255,255,255,.2)}@supports selector(*:focus-visible){[class*=bg-] .tab-title.active:focus::after{background-color:unset}[class*=bg-] .tab-title.active:focus-visible::after{background-color:rgba(255,255,255,.2)}}/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button}";
6
+ const PostTabHeaderStyle0 = postTabHeaderCss;
7
+
8
+ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.tabId = undefined;
14
+ this.panel = undefined;
15
+ }
16
+ validateFor(newValue) {
17
+ checkNonEmpty(newValue, 'The "panel" prop is required for the post-tab-header.');
18
+ }
19
+ componentWillLoad() {
20
+ this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;
21
+ }
22
+ render() {
23
+ return (h(Host, { key: '35077e5514ffd19a4fb27bc3a4c1d9d19072768b', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '67b09864a209c00c677e1c279240d9b4ca289faa' })));
24
+ }
25
+ get host() { return this; }
26
+ static get watchers() { return {
27
+ "panel": ["validateFor"]
28
+ }; }
29
+ static get style() { return PostTabHeaderStyle0; }
30
+ }, [1, "post-tab-header", {
31
+ "panel": [1],
32
+ "tabId": [32]
33
+ }, undefined, {
34
+ "panel": ["validateFor"]
35
+ }]);
36
+ function defineCustomElement$1() {
37
+ if (typeof customElements === "undefined") {
38
+ return;
39
+ }
40
+ const components = ["post-tab-header"];
41
+ components.forEach(tagName => { switch (tagName) {
42
+ case "post-tab-header":
43
+ if (!customElements.get(tagName)) {
44
+ customElements.define(tagName, PostTabHeader$1);
45
+ }
46
+ break;
47
+ } });
48
+ }
49
+
50
+ const PostTabHeader = PostTabHeader$1;
51
+ const defineCustomElement = defineCustomElement$1;
52
+
53
+ export { PostTabHeader, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostTabPanel extends Components.PostTabPanel, HTMLElement {}
4
+ export const PostTabPanel: {
5
+ prototype: PostTabPanel;
6
+ new (): PostTabPanel;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,45 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { v as version } from './package.js';
3
+
4
+ const postTabPanelCss = ":host{display:none}";
5
+ const PostTabPanelStyle0 = postTabPanelCss;
6
+
7
+ const PostTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class PostTabPanel extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.__attachShadow();
12
+ this.panelId = undefined;
13
+ this.name = undefined;
14
+ }
15
+ componentWillLoad() {
16
+ // get the id set on the host element or use a random id by default
17
+ this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;
18
+ }
19
+ render() {
20
+ return (h(Host, { key: '2d01a8e7f06e45b4750e63584a3c52232dee4dd5', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: 'b51e2f112791ac22df43ebb537208c65aebe3d03' })));
21
+ }
22
+ get host() { return this; }
23
+ static get style() { return PostTabPanelStyle0; }
24
+ }, [1, "post-tab-panel", {
25
+ "name": [1],
26
+ "panelId": [32]
27
+ }]);
28
+ function defineCustomElement$1() {
29
+ if (typeof customElements === "undefined") {
30
+ return;
31
+ }
32
+ const components = ["post-tab-panel"];
33
+ components.forEach(tagName => { switch (tagName) {
34
+ case "post-tab-panel":
35
+ if (!customElements.get(tagName)) {
36
+ customElements.define(tagName, PostTabPanel$1);
37
+ }
38
+ break;
39
+ } });
40
+ }
41
+
42
+ const PostTabPanel = PostTabPanel$1;
43
+ const defineCustomElement = defineCustomElement$1;
44
+
45
+ export { PostTabPanel, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostTabs extends Components.PostTabs, HTMLElement {}
4
+ export const PostTabs: {
5
+ prototype: PostTabs;
6
+ new (): PostTabs;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,192 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { v as version } from './package.js';
3
+ import { f as fadeOut, a as fadeIn } from './fade.js';
4
+
5
+ /**
6
+ * Invoke the `componentOnReady` method if it is available, simulate it otherwise
7
+ * @see https://stenciljs.com/docs/api#componentonready
8
+ */
9
+ const componentOnReady = (el) => {
10
+ if (typeof el.componentOnReady === 'function') {
11
+ return el.componentOnReady();
12
+ }
13
+ else {
14
+ return new Promise(resolve => customOnReady(() => {
15
+ resolve(el);
16
+ }));
17
+ }
18
+ };
19
+ const customOnReady = (callback) => {
20
+ if (typeof requestAnimationFrame === 'function') {
21
+ return requestAnimationFrame(callback);
22
+ }
23
+ return setTimeout(callback);
24
+ };
25
+
26
+ const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(var(--post-contrast-color-rgb), 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{margin:0;padding:0;list-style:none;display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap}.tabs::after{content:\"\";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}.bg-yellow .tabs-wrapper{background-color:#fc0}.bg-white .tabs-wrapper{background-color:#fff}.bg-light .tabs-wrapper{background-color:#faf9f8}.bg-gray .tabs-wrapper{background-color:#f4f3f1}.bg-dark .tabs-wrapper{background-color:#333}.bg-black .tabs-wrapper{background-color:#000}.bg-primary .tabs-wrapper{background-color:#333}.bg-secondary .tabs-wrapper{background-color:#666}.bg-success .tabs-wrapper{background-color:#2c871d}.bg-warning .tabs-wrapper{background-color:#f49e00}.bg-error .tabs-wrapper{background-color:#a51728}.bg-info .tabs-wrapper{background-color:#cce4ee}.bg-success-background .tabs-wrapper{background-color:#c0debb}.bg-warning-background .tabs-wrapper{background-color:#fce2b2}.bg-error-background .tabs-wrapper{background-color:#ffdade}.bg-nightblue .tabs-wrapper{background-color:#004976}.bg-nightblue-bright .tabs-wrapper{background-color:#0076a8}.bg-petrol .tabs-wrapper{background-color:#006d68}.bg-petrol-bright .tabs-wrapper{background-color:#00968f}.bg-coral .tabs-wrapper{background-color:#9e2a2f}.bg-coral-bright .tabs-wrapper{background-color:#e03c31}.bg-olive .tabs-wrapper{background-color:#716135}.bg-olive-bright .tabs-wrapper{background-color:#aa9d2e}.bg-purple .tabs-wrapper{background-color:#80276c}.bg-purple-bright .tabs-wrapper{background-color:#c5299b}.bg-aubergine .tabs-wrapper{background-color:#523178}.bg-aubergine-bright .tabs-wrapper{background-color:#7566a0}:host{display:block}";
27
+ const PostTabsStyle0 = postTabsCss;
28
+
29
+ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLElement {
30
+ constructor() {
31
+ super();
32
+ this.__registerHost();
33
+ this.__attachShadow();
34
+ this.postChange = createEvent(this, "postChange", 7);
35
+ this.isLoaded = false;
36
+ this.activePanel = undefined;
37
+ }
38
+ get tabs() {
39
+ return this.host.querySelectorAll('post-tab-header');
40
+ }
41
+ componentDidLoad() {
42
+ this.moveMisplacedTabs();
43
+ this.enableTabs();
44
+ const initiallyActivePanel = this.activePanel || this.tabs.item(0).panel;
45
+ void this.show(initiallyActivePanel);
46
+ this.isLoaded = true;
47
+ }
48
+ /**
49
+ * Shows the panel with the given name and selects its associated tab.
50
+ * Any other panel that was previously shown becomes hidden and its associated tab is unselected.
51
+ */
52
+ async show(panelName) {
53
+ var _a;
54
+ // do nothing if the tab is already active
55
+ if (panelName === ((_a = this.activeTab) === null || _a === void 0 ? void 0 : _a.panel)) {
56
+ return;
57
+ }
58
+ const previousTab = this.activeTab;
59
+ const newTab = this.host.querySelector(`post-tab-header[panel=${panelName}]`);
60
+ this.activateTab(newTab);
61
+ // if a panel is currently being displayed, remove it from the view and complete the associated animation
62
+ if (this.showing) {
63
+ this.showing.effect['target'].style.display = 'none';
64
+ this.showing.finish();
65
+ }
66
+ // hide the currently visible panel only if no other animation is running
67
+ if (previousTab && !this.showing && !this.hiding)
68
+ this.hidePanel(previousTab.panel);
69
+ // wait for any hiding animation to complete before showing the selected tab
70
+ if (this.hiding)
71
+ await this.hiding.finished;
72
+ this.showSelectedPanel();
73
+ // wait for any display animation to complete for the returned promise to fully resolve
74
+ if (this.showing)
75
+ await this.showing.finished;
76
+ if (this.isLoaded)
77
+ this.postChange.emit(this.activeTab.panel);
78
+ }
79
+ moveMisplacedTabs() {
80
+ if (!this.tabs)
81
+ return;
82
+ this.tabs.forEach(tab => {
83
+ if (tab.getAttribute('slot') === 'tabs')
84
+ return;
85
+ tab.setAttribute('slot', 'tabs');
86
+ });
87
+ }
88
+ enableTabs() {
89
+ if (!this.tabs)
90
+ return;
91
+ this.tabs.forEach(async (tab) => {
92
+ await componentOnReady(tab);
93
+ // if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
94
+ if (tab.getAttribute('aria-controls'))
95
+ return;
96
+ const tabPanel = this.getPanel(tab.panel);
97
+ tab.setAttribute('aria-controls', tabPanel.id);
98
+ tabPanel.setAttribute('aria-labelledby', tab.id);
99
+ tab.addEventListener('click', () => {
100
+ void this.show(tab.panel);
101
+ });
102
+ tab.addEventListener('keydown', (e) => {
103
+ if (e.key === 'Enter' || e.key === ' ') {
104
+ e.preventDefault();
105
+ void this.show(tab.panel);
106
+ }
107
+ });
108
+ tab.addEventListener('keydown', (e) => {
109
+ if (e.key === 'ArrowRight' || e.key === 'ArrowLeft')
110
+ this.navigateTabs(tab, e.key);
111
+ });
112
+ });
113
+ // if the currently active tab was removed from the DOM then select the first one
114
+ if (this.activeTab && !this.activeTab.isConnected) {
115
+ void this.show(this.tabs.item(0).panel);
116
+ }
117
+ }
118
+ activateTab(tab) {
119
+ if (this.activeTab) {
120
+ this.activeTab.setAttribute('aria-selected', 'false');
121
+ this.activeTab.setAttribute('tabindex', '-1');
122
+ this.activeTab.classList.remove('active');
123
+ }
124
+ tab.setAttribute('aria-selected', 'true');
125
+ tab.setAttribute('tabindex', '0');
126
+ tab.classList.add('active');
127
+ this.activeTab = tab;
128
+ }
129
+ hidePanel(panelName) {
130
+ const previousPanel = this.getPanel(panelName);
131
+ if (!previousPanel)
132
+ return;
133
+ this.hiding = fadeOut(previousPanel);
134
+ this.hiding.onfinish = () => {
135
+ previousPanel.style.display = 'none';
136
+ this.hiding = null;
137
+ };
138
+ }
139
+ showSelectedPanel() {
140
+ const panel = this.getPanel(this.activeTab.panel);
141
+ panel.style.display = 'block';
142
+ // prevent the initially selected panel from fading in
143
+ if (!this.isLoaded)
144
+ return;
145
+ this.showing = fadeIn(panel);
146
+ this.showing.onfinish = () => {
147
+ this.showing = null;
148
+ };
149
+ }
150
+ getPanel(name) {
151
+ return this.host.querySelector(`post-tab-panel[name=${name}]`);
152
+ }
153
+ navigateTabs(tab, key) {
154
+ const activeTabIndex = Array.from(this.tabs).indexOf(tab);
155
+ let nextTab;
156
+ if (key === 'ArrowRight') {
157
+ nextTab = this.tabs[activeTabIndex + 1] || this.tabs[0];
158
+ }
159
+ else {
160
+ nextTab = this.tabs[activeTabIndex - 1] || this.tabs[this.tabs.length - 1];
161
+ }
162
+ if (!nextTab)
163
+ return;
164
+ nextTab.focus();
165
+ }
166
+ render() {
167
+ return (h(Host, { key: '6a3e84a92b03d462dbff1b8fc638f7ebf8ea9d23', "data-version": version }, h("div", { key: 'e73b58f1524e70401089830b1b9b47a2c85b828a', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '9da5ce2d30d37c74dee92f2e871e56e96d07d429', class: "tabs", role: "tablist" }, h("slot", { key: '944e209f2f23b9a3469bc6b5167a0939da4c9631', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '93caabfd1a0be19df3e8be64f0965de488159526', class: "tab-content", part: "content" }, h("slot", { key: '92465fa749afad52130631cb3957fefeb40b8e9a', onSlotchange: () => this.moveMisplacedTabs() }))));
168
+ }
169
+ get host() { return this; }
170
+ static get style() { return PostTabsStyle0; }
171
+ }, [1, "post-tabs", {
172
+ "activePanel": [1, "active-panel"],
173
+ "show": [64]
174
+ }]);
175
+ function defineCustomElement$1() {
176
+ if (typeof customElements === "undefined") {
177
+ return;
178
+ }
179
+ const components = ["post-tabs"];
180
+ components.forEach(tagName => { switch (tagName) {
181
+ case "post-tabs":
182
+ if (!customElements.get(tagName)) {
183
+ customElements.define(tagName, PostTabs$1);
184
+ }
185
+ break;
186
+ } });
187
+ }
188
+
189
+ const PostTabs = PostTabs$1;
190
+ const defineCustomElement = defineCustomElement$1;
191
+
192
+ export { PostTabs, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostTag extends Components.PostTag, HTMLElement {}
4
+ export const PostTag: {
5
+ prototype: PostTag;
6
+ new (): PostTag;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,77 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { v as version } from './package.js';
3
+ import { d as defineCustomElement$2 } from './post-icon2.js';
4
+
5
+ const postTagCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:.25rem;padding:0 .5rem;max-width:100%;background-color:var(--post-tag-bg);border:1px solid rgba(0,0,0,0);border-radius:.25rem;font-size:1rem;line-height:1.875rem;white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:1.5rem}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:var(--post-contrast-color)}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}";
6
+ const PostTagStyle0 = postTagCss;
7
+
8
+ const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.classes = undefined;
14
+ this.variant = undefined;
15
+ this.size = null;
16
+ this.icon = null;
17
+ this.setClasses = this.setClasses.bind(this);
18
+ }
19
+ variantChanged() {
20
+ this.setClasses();
21
+ }
22
+ sizeChanged() {
23
+ this.setClasses();
24
+ }
25
+ setClasses() {
26
+ this.classes = [
27
+ 'tag',
28
+ this.size ? `tag-${this.size}` : null,
29
+ this.variant ? `tag-${this.variant}` : null,
30
+ ]
31
+ .filter(c => c !== null)
32
+ .join(' ');
33
+ }
34
+ connectedCallback() {
35
+ this.setClasses();
36
+ }
37
+ render() {
38
+ return (h(Host, { key: '7426002d3008de53e92edc8ec2fc759569b191bf', "data-version": version }, h("div", { key: '1cde8f5c3d2db66f45aaa64091a1b76f1d1468ee', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: 'cc63b7277ba4f4076a46f5038b24699f6818c81b', class: "tag-text" }, h("slot", { key: '37b57632add7f7c093e42302e44defef63ccc29f' })))));
39
+ }
40
+ get host() { return this; }
41
+ static get watchers() { return {
42
+ "variant": ["variantChanged"],
43
+ "size": ["sizeChanged"]
44
+ }; }
45
+ static get style() { return PostTagStyle0; }
46
+ }, [1, "post-tag", {
47
+ "variant": [1],
48
+ "size": [1],
49
+ "icon": [1],
50
+ "classes": [32]
51
+ }, undefined, {
52
+ "variant": ["variantChanged"],
53
+ "size": ["sizeChanged"]
54
+ }]);
55
+ function defineCustomElement$1() {
56
+ if (typeof customElements === "undefined") {
57
+ return;
58
+ }
59
+ const components = ["post-tag", "post-icon"];
60
+ components.forEach(tagName => { switch (tagName) {
61
+ case "post-tag":
62
+ if (!customElements.get(tagName)) {
63
+ customElements.define(tagName, PostTag$1);
64
+ }
65
+ break;
66
+ case "post-icon":
67
+ if (!customElements.get(tagName)) {
68
+ defineCustomElement$2();
69
+ }
70
+ break;
71
+ } });
72
+ }
73
+
74
+ const PostTag = PostTag$1;
75
+ const defineCustomElement = defineCustomElement$1;
76
+
77
+ export { PostTag, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PostTooltip extends Components.PostTooltip, HTMLElement {}
4
+ export const PostTooltip: {
5
+ prototype: PostTooltip;
6
+ new (): PostTooltip;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;