@swisspost/design-system-components 2.0.3 → 7.0.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 (209) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/check-one-of-f4f5d0c0.js +8 -0
  4. package/dist/cjs/{index-f243643b.js → index-3b732d59.js} +89 -25
  5. package/dist/cjs/{index-8c288b1a.js → index-a1440961.js} +2 -6
  6. package/dist/cjs/index.cjs.js +21 -14
  7. package/dist/cjs/loader.cjs.js +5 -3
  8. package/dist/cjs/{package-628f6e9c.js → package-45af106a.js} +1 -1
  9. package/dist/cjs/{post-accordion-da546aa2.js → post-accordion-7507f838.js} +22 -20
  10. package/dist/cjs/post-accordion-item-5bf4d98b.js +53 -0
  11. package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
  12. package/dist/cjs/post-accordion.cjs.entry.js +3 -3
  13. package/dist/cjs/post-alert-9c39c854.js +98 -0
  14. package/dist/cjs/post-alert.cjs.entry.js +5 -4
  15. package/dist/cjs/post-card-control-4a16b3d7.js +311 -0
  16. package/dist/cjs/post-card-control.cjs.entry.js +14 -0
  17. package/dist/cjs/{post-collapsible-278b2a71.js → post-collapsible-00319f1f.js} +7 -7
  18. package/dist/cjs/post-collapsible.cjs.entry.js +5 -4
  19. package/dist/cjs/post-components.cjs.js +6 -4
  20. package/dist/cjs/{post-icon-fd09bc54.js → post-icon-09845341.js} +5 -5
  21. package/dist/cjs/post-icon.cjs.entry.js +5 -4
  22. package/dist/cjs/post-popover-3b6aaeae.js +104 -0
  23. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  24. package/dist/cjs/{post-popovercontainer-5e355de3.js → post-popovercontainer-0b8343ac.js} +26 -45
  25. package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
  26. package/dist/cjs/post-rating-285f966e.js +88 -0
  27. package/dist/cjs/post-rating.cjs.entry.js +11 -0
  28. package/dist/cjs/post-tab-header-f1c16656.js +32 -0
  29. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  30. package/dist/cjs/{post-tab-panel-67ba226d.js → post-tab-panel-9c20a84e.js} +3 -3
  31. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  32. package/dist/cjs/{post-tabs-71510ced.js → post-tabs-75e71078.js} +23 -21
  33. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  34. package/dist/cjs/post-tag-942085fd.js +43 -0
  35. package/dist/cjs/post-tag.cjs.entry.js +11 -0
  36. package/dist/cjs/{post-tooltip-b6bbb3e4.js → post-tooltip-94d4f21f.js} +12 -9
  37. package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
  38. package/dist/collection/collection-manifest.json +6 -3
  39. package/dist/collection/components/post-accordion/post-accordion.js +22 -20
  40. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  41. package/dist/collection/components/post-accordion-item/post-accordion-item.js +7 -5
  42. package/dist/collection/components/post-alert/alert-types.js +1 -1
  43. package/dist/collection/components/post-alert/post-alert.css +2 -2
  44. package/dist/collection/components/post-alert/post-alert.js +6 -6
  45. package/dist/collection/components/post-card-control/post-card-control.css +31 -0
  46. package/dist/collection/components/post-card-control/post-card-control.js +520 -0
  47. package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
  48. package/dist/collection/components/post-collapsible/post-collapsible.js +4 -4
  49. package/dist/collection/components/post-icon/post-icon.js +2 -2
  50. package/dist/collection/components/post-popover/post-popover.css +29 -1
  51. package/dist/collection/components/post-popover/post-popover.js +2 -2
  52. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +6 -6
  53. package/dist/collection/components/post-rating/post-rating.css +31 -0
  54. package/dist/collection/components/post-rating/post-rating.js +202 -0
  55. package/dist/collection/components/post-tab-header/post-tab-header.css +29 -1
  56. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  57. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  58. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  59. package/dist/collection/components/post-tabs/post-tabs.js +21 -19
  60. package/dist/collection/components/post-tag/post-tag.css +31 -0
  61. package/dist/collection/components/post-tag/post-tag.js +115 -0
  62. package/dist/collection/components/post-tooltip/post-tooltip.js +11 -8
  63. package/dist/collection/index.js +3 -0
  64. package/dist/collection/utils/index.js +1 -0
  65. package/dist/collection/utils/sass-export.js +16 -0
  66. package/dist/components/index.js +3 -0
  67. package/dist/components/index2.js +1 -1
  68. package/dist/components/package.js +1 -1
  69. package/dist/components/post-accordion-item2.js +7 -5
  70. package/dist/components/post-accordion2.js +21 -19
  71. package/dist/components/post-alert2.js +7 -7
  72. package/dist/components/post-card-control.d.ts +11 -0
  73. package/dist/components/post-card-control.js +6 -0
  74. package/dist/components/post-card-control2.js +342 -0
  75. package/dist/components/post-collapsible2.js +5 -5
  76. package/dist/components/post-icon2.js +3 -3
  77. package/dist/components/post-popover2.js +2 -2
  78. package/dist/components/post-popovercontainer2.js +24 -43
  79. package/dist/components/post-rating.d.ts +11 -0
  80. package/dist/components/post-rating.js +6 -0
  81. package/dist/components/post-rating2.js +113 -0
  82. package/dist/components/post-tab-header2.js +2 -2
  83. package/dist/components/post-tab-panel2.js +1 -1
  84. package/dist/components/post-tabs2.js +21 -19
  85. package/dist/components/post-tag.d.ts +11 -0
  86. package/dist/components/post-tag.js +6 -0
  87. package/dist/components/post-tag2.js +70 -0
  88. package/dist/components/post-tooltip2.js +10 -7
  89. package/dist/docs.json +622 -16
  90. package/dist/esm/app-globals-0f993ce5.js +3 -0
  91. package/dist/esm/check-one-of-6b3ef8eb.js +6 -0
  92. package/dist/esm/{index-1708db56.js → index-961099d2.js} +89 -25
  93. package/dist/esm/{index-b444db27.js → index-d1eba94c.js} +1 -5
  94. package/dist/esm/index.js +18 -14
  95. package/dist/esm/loader.js +6 -4
  96. package/dist/esm/{package-15929f57.js → package-1242b80d.js} +1 -1
  97. package/dist/esm/{post-accordion-be080240.js → post-accordion-bfd058bc.js} +22 -20
  98. package/dist/esm/post-accordion-item-4fa44842.js +51 -0
  99. package/dist/esm/post-accordion-item.entry.js +5 -4
  100. package/dist/esm/post-accordion.entry.js +3 -3
  101. package/dist/esm/post-alert-192d0176.js +96 -0
  102. package/dist/esm/post-alert.entry.js +5 -4
  103. package/dist/esm/post-card-control-b23e1e6f.js +309 -0
  104. package/dist/esm/post-card-control.entry.js +6 -0
  105. package/dist/esm/{post-collapsible-967bb191.js → post-collapsible-d848eb2a.js} +7 -7
  106. package/dist/esm/post-collapsible.entry.js +5 -4
  107. package/dist/esm/post-components.js +7 -5
  108. package/dist/esm/{post-icon-ba163099.js → post-icon-811654f7.js} +5 -5
  109. package/dist/esm/post-icon.entry.js +5 -4
  110. package/dist/esm/post-popover-b48a9d7c.js +102 -0
  111. package/dist/esm/post-popover.entry.js +3 -3
  112. package/dist/esm/{post-popovercontainer-da870ff0.js → post-popovercontainer-7413bb41.js} +26 -45
  113. package/dist/esm/post-popovercontainer.entry.js +3 -3
  114. package/dist/esm/post-rating-806de800.js +86 -0
  115. package/dist/esm/post-rating.entry.js +3 -0
  116. package/dist/esm/post-tab-header-95f0dc6a.js +30 -0
  117. package/dist/esm/post-tab-header.entry.js +3 -3
  118. package/dist/esm/{post-tab-panel-d89c4c50.js → post-tab-panel-d7145a70.js} +3 -3
  119. package/dist/esm/post-tab-panel.entry.js +3 -3
  120. package/dist/esm/{post-tabs-e995886a.js → post-tabs-f130a7d8.js} +23 -21
  121. package/dist/esm/post-tabs.entry.js +3 -3
  122. package/dist/esm/post-tag-7c329d6c.js +41 -0
  123. package/dist/esm/post-tag.entry.js +3 -0
  124. package/dist/esm/{post-tooltip-0ec6a388.js → post-tooltip-942bd014.js} +12 -9
  125. package/dist/esm/post-tooltip.entry.js +3 -3
  126. package/dist/post-components/index.esm.js +1 -1
  127. package/dist/post-components/p-0d4e50a9.js +1 -0
  128. package/dist/post-components/p-1c780bac.entry.js +1 -0
  129. package/dist/post-components/p-2524b6b9.entry.js +1 -0
  130. package/dist/post-components/p-2ee23269.entry.js +1 -0
  131. package/dist/post-components/p-416426cc.js +1 -0
  132. package/dist/post-components/p-41c9c59f.js +1 -0
  133. package/dist/post-components/p-46cea7ee.js +1 -0
  134. package/dist/post-components/p-4aa14704.js +1 -0
  135. package/dist/post-components/p-579f55af.js +1 -0
  136. package/dist/post-components/p-5b2cdcf0.js +2 -0
  137. package/dist/post-components/p-60b02cbb.entry.js +1 -0
  138. package/dist/post-components/p-611b3c41.js +1 -0
  139. package/dist/post-components/p-62407836.entry.js +1 -0
  140. package/dist/post-components/p-6308fd47.js +1 -0
  141. package/dist/post-components/p-6fba8cb2.entry.js +1 -0
  142. package/dist/post-components/p-86acda91.entry.js +1 -0
  143. package/dist/post-components/{p-94256868.js → p-93ba2827.js} +3 -3
  144. package/dist/post-components/p-94b5c41e.entry.js +1 -0
  145. package/dist/post-components/p-a3b54b5f.js +1 -0
  146. package/dist/post-components/p-a4b6b950.js +1 -0
  147. package/dist/post-components/p-b4abbb28.js +1 -0
  148. package/dist/post-components/p-c0f8e385.entry.js +1 -0
  149. package/dist/post-components/p-c4fe5052.entry.js +1 -0
  150. package/dist/post-components/p-c9004503.js +1 -0
  151. package/dist/post-components/p-cd9c10dd.entry.js +1 -0
  152. package/dist/post-components/p-d4cd7bb0.js +1 -0
  153. package/dist/post-components/p-d8d76dd1.entry.js +1 -0
  154. package/dist/post-components/p-e1255160.js +1 -0
  155. package/dist/post-components/p-e819d5fb.entry.js +1 -0
  156. package/dist/post-components/p-f44c172a.js +1 -0
  157. package/dist/post-components/p-f91c0e1b.js +1 -0
  158. package/dist/post-components/p-f9e58309.js +1 -0
  159. package/dist/post-components/p-ffb9a651.entry.js +1 -0
  160. package/dist/post-components/post-components.esm.js +1 -1
  161. package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
  162. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +1 -1
  163. package/dist/types/components/post-alert/alert-types.d.ts +2 -2
  164. package/dist/types/components/post-alert/post-alert.d.ts +2 -2
  165. package/dist/types/components/post-card-control/post-card-control.d.ts +109 -0
  166. package/dist/types/components/post-collapsible/post-collapsible.d.ts +1 -1
  167. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
  168. package/dist/types/components/post-rating/post-rating.d.ts +43 -0
  169. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  170. package/dist/types/components/post-tag/post-tag.d.ts +27 -0
  171. package/dist/types/components.d.ts +243 -8
  172. package/dist/types/css-modules.js +0 -0
  173. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/css-modules.d.ts +6 -0
  174. package/dist/types/index.d.ts +3 -0
  175. package/dist/types/utils/index.d.ts +1 -0
  176. package/dist/types/utils/sass-export.d.ts +2 -0
  177. package/package.json +18 -18
  178. package/dist/cjs/post-accordion-item-33d5593a.js +0 -51
  179. package/dist/cjs/post-alert-26c1bcda.js +0 -98
  180. package/dist/cjs/post-popover-1e454296.js +0 -104
  181. package/dist/cjs/post-tab-header-5c8b9a0d.js +0 -32
  182. package/dist/esm/post-accordion-item-7b3c726b.js +0 -49
  183. package/dist/esm/post-alert-37f853eb.js +0 -96
  184. package/dist/esm/post-popover-69694fa6.js +0 -102
  185. package/dist/esm/post-tab-header-14ed99cd.js +0 -30
  186. package/dist/post-components/p-00ab91d9.entry.js +0 -1
  187. package/dist/post-components/p-04f47e54.entry.js +0 -1
  188. package/dist/post-components/p-10b4cf7a.js +0 -2
  189. package/dist/post-components/p-1f284e66.js +0 -1
  190. package/dist/post-components/p-209e33a5.js +0 -1
  191. package/dist/post-components/p-282e21c2.entry.js +0 -1
  192. package/dist/post-components/p-34a772e3.entry.js +0 -1
  193. package/dist/post-components/p-46c47aa4.entry.js +0 -1
  194. package/dist/post-components/p-51fe19e0.js +0 -1
  195. package/dist/post-components/p-557f0f10.entry.js +0 -1
  196. package/dist/post-components/p-5ecceba0.js +0 -1
  197. package/dist/post-components/p-61d98756.js +0 -1
  198. package/dist/post-components/p-6b3ba10a.js +0 -1
  199. package/dist/post-components/p-82f4f464.entry.js +0 -1
  200. package/dist/post-components/p-98cb0bbd.entry.js +0 -1
  201. package/dist/post-components/p-9ee95668.entry.js +0 -1
  202. package/dist/post-components/p-a0d342e4.entry.js +0 -1
  203. package/dist/post-components/p-a9d59b04.js +0 -1
  204. package/dist/post-components/p-ac7b779e.js +0 -1
  205. package/dist/post-components/p-d9c9ed63.js +0 -1
  206. package/dist/post-components/p-e1bf894f.entry.js +0 -1
  207. package/dist/post-components/p-e8d17225.js +0 -1
  208. package/dist/post-components/p-f0e82e63.js +0 -1
  209. package/dist/post-components/p-f47b0207.js +0 -1
@@ -78,7 +78,7 @@ export class PostPopovercontainer {
78
78
  if (typeof this.clearAutoUpdate === 'function')
79
79
  this.clearAutoUpdate();
80
80
  }
81
- this.postPopoverToggled.emit(isOpen);
81
+ this.postToggle.emit(isOpen);
82
82
  }
83
83
  /**
84
84
  * Start listening for DOM updates, scroll events etc. that have
@@ -137,9 +137,9 @@ export class PostPopovercontainer {
137
137
  }
138
138
  }
139
139
  render() {
140
- return (h(Host, { key: '8049387a5ba6eefb3165e84c098ba4ae5b8f443f', "data-version": version }, h("div", { key: '63d3095a7992baf46fbc74b5c595654cbdeaba66', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
140
+ return (h(Host, { key: '885b256b85ee57c3114243c980db51bb4c7eef92', "data-version": version }, h("div", { key: 'e3ae342b6c0bb6b241141c5ee0d2a95ab0ba169e', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
141
141
  this.arrowRef = el;
142
- } })), h("slot", { key: '74b1746bf48f8aa915c443721c1c2af1c1a3df5d' }))));
142
+ } })), h("slot", { key: 'bc8d1e026b248c4c3cafa28c8cbdabe3610604e7' }))));
143
143
  }
144
144
  static get is() { return "post-popovercontainer"; }
145
145
  static get encapsulation() { return "shadow"; }
@@ -165,7 +165,7 @@ export class PostPopovercontainer {
165
165
  "Placement": {
166
166
  "location": "import",
167
167
  "path": "@floating-ui/dom",
168
- "id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.1/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
168
+ "id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
169
169
  }
170
170
  }
171
171
  },
@@ -201,8 +201,8 @@ export class PostPopovercontainer {
201
201
  }
202
202
  static get events() {
203
203
  return [{
204
- "method": "postPopoverToggled",
205
- "name": "postPopoverToggled",
204
+ "method": "postToggle",
205
+ "name": "postToggle",
206
206
  "bubbles": true,
207
207
  "cancelable": true,
208
208
  "composed": true,
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
+
7
+ * The MIT License (MIT)
8
+
9
+ * Copyright (c) 2011-2020 Twitter, Inc.
10
+ * Copyright (c) 2011-2020 The Bootstrap Authors
11
+
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+
19
+ * The above copyright notice and this permission notice shall be included in
20
+ * all copies or substantial portions of the Software.
21
+
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ * THE SOFTWARE.
29
+ *//*!
30
+ * Copyright 2021 by Swiss Post, Information Technology
31
+ */: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%)}
@@ -0,0 +1,202 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { version } from "../../../package.json";
3
+ export class PostRating {
4
+ constructor() {
5
+ this.hasChanged = false;
6
+ this.hoveredIndex = undefined;
7
+ this.label = 'Rating';
8
+ this.stars = 5;
9
+ this.currentRating = 0;
10
+ this.readonly = false;
11
+ this.keydownHandler = this.keydownHandler.bind(this);
12
+ this.blurHandler = this.blurHandler.bind(this);
13
+ this.hoverHandler = this.hoverHandler.bind(this);
14
+ }
15
+ update(value) {
16
+ if (this.readonly || value < 0 || value > this.stars)
17
+ return;
18
+ this.currentRating = this.currentRating !== value ? value : 0; // If a star is clicked the second time, the rating gets set to 0.
19
+ this.postInput.emit({ value: this.currentRating });
20
+ this.hasChanged = true;
21
+ }
22
+ keydownHandler(e) {
23
+ switch (e.key) {
24
+ case 'ArrowDown':
25
+ case 'ArrowLeft':
26
+ e.preventDefault();
27
+ this.update(this.currentRating - 1);
28
+ break;
29
+ case 'ArrowUp':
30
+ case 'ArrowRight':
31
+ e.preventDefault();
32
+ this.update(this.currentRating + 1);
33
+ break;
34
+ case 'Home':
35
+ e.preventDefault();
36
+ this.update(0);
37
+ break;
38
+ case 'End':
39
+ e.preventDefault();
40
+ this.update(this.stars);
41
+ break;
42
+ case 'Enter':
43
+ case ' ':
44
+ this.blurHandler();
45
+ break;
46
+ default:
47
+ return;
48
+ }
49
+ }
50
+ blurHandler() {
51
+ if (this.hasChanged) {
52
+ this.postChange.emit({ value: this.currentRating });
53
+ this.hasChanged = false;
54
+ }
55
+ }
56
+ hoverHandler(index, e) {
57
+ if (this.readonly)
58
+ return;
59
+ if (e.type === 'mouseenter') {
60
+ this.hoveredIndex = index;
61
+ }
62
+ else if (e.type === 'mouseleave') {
63
+ this.hoveredIndex = undefined;
64
+ }
65
+ }
66
+ render() {
67
+ return (h(Host, { key: '9423629ce4f05cacb20fb3476d036dc175d21f98', "data-version": version }, h("div", { key: '99efcd3cad667d24ea27a4c592d5c3b202191ed4', 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: {
68
+ 'star': true,
69
+ 'before-hover': i < this.hoveredIndex,
70
+ 'active': i < Math.round(this.currentRating),
71
+ 'hover': i === this.hoveredIndex,
72
+ 'after-active': i > this.hoveredIndex && i < this.currentRating,
73
+ }, 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" })))))));
74
+ }
75
+ static get is() { return "post-rating"; }
76
+ static get encapsulation() { return "shadow"; }
77
+ static get originalStyleUrls() {
78
+ return {
79
+ "$": ["post-rating.scss"]
80
+ };
81
+ }
82
+ static get styleUrls() {
83
+ return {
84
+ "$": ["post-rating.css"]
85
+ };
86
+ }
87
+ static get properties() {
88
+ return {
89
+ "label": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "string",
94
+ "resolved": "string",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": false,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Defines a hidden label for the component."
102
+ },
103
+ "attribute": "label",
104
+ "reflect": false,
105
+ "defaultValue": "'Rating'"
106
+ },
107
+ "stars": {
108
+ "type": "number",
109
+ "mutable": false,
110
+ "complexType": {
111
+ "original": "number",
112
+ "resolved": "number",
113
+ "references": {}
114
+ },
115
+ "required": false,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Defines the total amount of stars rendered in the component."
120
+ },
121
+ "attribute": "stars",
122
+ "reflect": false,
123
+ "defaultValue": "5"
124
+ },
125
+ "currentRating": {
126
+ "type": "number",
127
+ "mutable": true,
128
+ "complexType": {
129
+ "original": "number",
130
+ "resolved": "number",
131
+ "references": {}
132
+ },
133
+ "required": false,
134
+ "optional": false,
135
+ "docs": {
136
+ "tags": [],
137
+ "text": "Defines the rating that the component should show."
138
+ },
139
+ "attribute": "current-rating",
140
+ "reflect": false,
141
+ "defaultValue": "0"
142
+ },
143
+ "readonly": {
144
+ "type": "boolean",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "boolean",
148
+ "resolved": "boolean",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": "Defines if the component is readonly or not.\nThis usually should be used together with the `currentRating` property."
156
+ },
157
+ "attribute": "readonly",
158
+ "reflect": false,
159
+ "defaultValue": "false"
160
+ }
161
+ };
162
+ }
163
+ static get states() {
164
+ return {
165
+ "hoveredIndex": {}
166
+ };
167
+ }
168
+ static get events() {
169
+ return [{
170
+ "method": "postInput",
171
+ "name": "postInput",
172
+ "bubbles": true,
173
+ "cancelable": true,
174
+ "composed": true,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": "An event emitted whenever the component's value has changed (on input).\nThe event payload can be used like so: `event.detail.value`."
178
+ },
179
+ "complexType": {
180
+ "original": "{ value: number }",
181
+ "resolved": "{ value: number; }",
182
+ "references": {}
183
+ }
184
+ }, {
185
+ "method": "postChange",
186
+ "name": "postChange",
187
+ "bubbles": true,
188
+ "cancelable": true,
189
+ "composed": true,
190
+ "docs": {
191
+ "tags": [],
192
+ "text": "An event emitted whenever the component's value has changed (on blur).\nThe event payload can be used like so: `event.detail.value`."
193
+ },
194
+ "complexType": {
195
+ "original": "{ value: number }",
196
+ "resolved": "{ value: number; }",
197
+ "references": {}
198
+ }
199
+ }];
200
+ }
201
+ static get elementRef() { return "host"; }
202
+ }
@@ -1,3 +1,31 @@
1
- .tab-title[role=tab]{display:inline-block;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}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color:#fff;color:var(--post-contrast-color)}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:#fff;color:var(--post-contrast-color);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:#fff;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}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-success-green,.bg-error-red) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-success-green,.bg-error-red) .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-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-primary .tab-title{background-color:#333}.bg-primary .tab-title.active{background-color:#333}.bg-primary .nav-item{background-color:#333}.bg-white .tab-title{background-color:#fff}.bg-white .tab-title.active{background-color:#fff}.bg-white .nav-item{background-color:#fff}.bg-black .tab-title{background-color:#000}.bg-black .tab-title.active{background-color:#000}.bg-black .nav-item{background-color:#000}.bg-info .tab-title{background-color:#cce4ee}.bg-info .tab-title.active{background-color:#cce4ee}.bg-info .nav-item{background-color:#cce4ee}.bg-success .tab-title{background-color:#2c911c}.bg-success .tab-title.active{background-color:#2c911c}.bg-success .nav-item{background-color:#2c911c}.bg-warning .tab-title{background-color:#f49e00}.bg-warning .tab-title.active{background-color:#f49e00}.bg-warning .nav-item{background-color:#f49e00}.bg-danger .tab-title{background-color:#a51728}.bg-danger .tab-title.active{background-color:#a51728}.bg-danger .nav-item{background-color:#a51728}.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}.bg-success-green .tab-title{background-color:#2c871d}.bg-success-green .tab-title.active{background-color:#2c871d}.bg-success-green .nav-item{background-color:#2c871d}.bg-error-red .tab-title{background-color:#a51728}.bg-error-red .tab-title.active{background-color:#a51728}.bg-error-red .nav-item{background-color:#a51728}.bg-warning-orange .tab-title{background-color:#f49e00}.bg-warning-orange .tab-title.active{background-color:#f49e00}.bg-warning-orange .nav-item{background-color:#f49e00}.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-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-warning-background .tab-title{background-color:#fce2b2}.bg-warning-background .tab-title.active{background-color:#fce2b2}.bg-warning-background .nav-item{background-color:#fce2b2}[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)}}/*!
1
+ .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:var(--post-contrast-color-inverted)}.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}:is(.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)}:is(.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)}}/*!
2
+ * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
+
7
+ * The MIT License (MIT)
8
+
9
+ * Copyright (c) 2011-2020 Twitter, Inc.
10
+ * Copyright (c) 2011-2020 The Bootstrap Authors
11
+
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+
19
+ * The above copyright notice and this permission notice shall be included in
20
+ * all copies or substantial portions of the Software.
21
+
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ * THE SOFTWARE.
29
+ *//*!
2
30
  * Copyright 2021 by Swiss Post, Information Technology
3
31
  */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button}
@@ -16,7 +16,7 @@ export class PostTabHeader {
16
16
  this.tabId = `tab-${this.host.id || crypto.randomUUID()}`;
17
17
  }
18
18
  render() {
19
- return (h(Host, { key: '5685ea424c0e59351a7df7e6b990740067f7e986', "data-version": version }, h("button", { key: 'f32ebddafa7450b081c88e44405f59396a0e6b97', "aria-selected": "false", class: "tab-title", id: this.tabId, role: "tab", tabindex: "-1", type: "button" }, h("slot", { key: '95022af953bbbaf41b5eac4594bf00dc4b12fb37' }))));
19
+ return (h(Host, { key: '7574d4ab05fae64a57f718e8c185c3aec1690e0f', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title" }, h("slot", { key: 'c8af8275935433eba2d673fe283412a2a9266340' })));
20
20
  }
21
21
  static get is() { return "post-tab-header"; }
22
22
  static get encapsulation() { return "shadow"; }
@@ -13,7 +13,7 @@ export class PostTabPanel {
13
13
  this.panelId = `panel-${this.host.id || crypto.randomUUID()}`;
14
14
  }
15
15
  render() {
16
- return (h(Host, { key: '95b6c12c52ef3aa66235d9c10e9c00730e1eb438', "data-version": version }, h("div", { key: '57dac4559c79ac5db11d6b945273b7126564f2d5', class: "tab-pane", id: this.panelId, role: "tabpanel" }, h("slot", { key: 'ee9c6c82a6e9cadb56d914c483bae83907709a17' }))));
16
+ return (h(Host, { key: '3833b2f565d457ea6f8c35273f0fe310b56b2d00', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '299c354b73a8d04ebab94ad7bc10cb703127ee65' })));
17
17
  }
18
18
  static get is() { return "post-tab-panel"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- .tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:#faf9f8}.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{margin-block:1rem}.bg-yellow .tabs-wrapper{background-color:#fc0}.bg-light .tabs-wrapper{background-color:#faf9f8}.bg-gray .tabs-wrapper{background-color:#f4f3f1}.bg-dark .tabs-wrapper{background-color:#333}.bg-primary .tabs-wrapper{background-color:#333}.bg-white .tabs-wrapper{background-color:#fff}.bg-black .tabs-wrapper{background-color:#000}.bg-info .tabs-wrapper{background-color:#cce4ee}.bg-success .tabs-wrapper{background-color:#2c911c}.bg-warning .tabs-wrapper{background-color:#f49e00}.bg-danger .tabs-wrapper{background-color:#a51728}.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}.bg-success-green .tabs-wrapper{background-color:#2c871d}.bg-error-red .tabs-wrapper{background-color:#a51728}.bg-warning-orange .tabs-wrapper{background-color:#f49e00}.bg-success-background .tabs-wrapper{background-color:#c0debb}.bg-error-background .tabs-wrapper{background-color:#ffdade}.bg-warning-background .tabs-wrapper{background-color:#fce2b2}:host{display:block}
1
+ .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}
@@ -51,7 +51,7 @@ export class PostTabs {
51
51
  if (this.showing) {
52
52
  await this.showing.finished;
53
53
  }
54
- this.tabChange.emit(this.activeTab.panel);
54
+ this.postChange.emit(this.activeTab.panel);
55
55
  }
56
56
  moveMisplacedTabs() {
57
57
  if (!this.tabs)
@@ -67,16 +67,21 @@ export class PostTabs {
67
67
  return;
68
68
  this.tabs.forEach(async (tab) => {
69
69
  await tab.componentOnReady();
70
- const tabTitle = tab.shadowRoot.querySelector('.tab-title');
71
70
  // if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
72
- if (tabTitle.getAttribute('aria-controls'))
71
+ if (tab.getAttribute('aria-controls'))
73
72
  return;
74
- const tabPanel = this.getPanel(tab.panel).shadowRoot.querySelector('.tab-pane');
75
- tabTitle.setAttribute('aria-controls', tabPanel.id);
76
- tabPanel.setAttribute('aria-labelledby', tabTitle.id);
73
+ const tabPanel = this.getPanel(tab.panel);
74
+ tab.setAttribute('aria-controls', tabPanel.id);
75
+ tabPanel.setAttribute('aria-labelledby', tab.id);
77
76
  tab.addEventListener('click', () => {
78
77
  void this.show(tab.panel);
79
78
  });
79
+ tab.addEventListener('keydown', (e) => {
80
+ if (e.key === 'Enter' || e.key === ' ') {
81
+ e.preventDefault();
82
+ void this.show(tab.panel);
83
+ }
84
+ });
80
85
  tab.addEventListener('keydown', ({ key }) => {
81
86
  if (key === 'ArrowRight' || key === 'ArrowLeft')
82
87
  this.navigateTabs(tab, key);
@@ -89,15 +94,13 @@ export class PostTabs {
89
94
  }
90
95
  activateTab(tab) {
91
96
  if (this.activeTab) {
92
- const tabTitle = this.activeTab.shadowRoot.querySelector('.tab-title');
93
- tabTitle.setAttribute('aria-selected', 'false');
94
- tabTitle.setAttribute('tabindex', '-1');
95
- tabTitle.classList.remove('active');
97
+ this.activeTab.setAttribute('aria-selected', 'false');
98
+ this.activeTab.setAttribute('tabindex', '-1');
99
+ this.activeTab.classList.remove('active');
96
100
  }
97
- const tabTitle = tab.shadowRoot.querySelector('.tab-title');
98
- tabTitle.setAttribute('aria-selected', 'true');
99
- tabTitle.removeAttribute('tabindex');
100
- tabTitle.classList.add('active');
101
+ tab.setAttribute('aria-selected', 'true');
102
+ tab.setAttribute('tabindex', '0');
103
+ tab.classList.add('active');
101
104
  this.activeTab = tab;
102
105
  }
103
106
  hidePanel(panelName) {
@@ -135,11 +138,10 @@ export class PostTabs {
135
138
  }
136
139
  if (!nextTab)
137
140
  return;
138
- const nextTabTitle = nextTab.shadowRoot.querySelector('.tab-title');
139
- nextTabTitle.focus();
141
+ nextTab.focus();
140
142
  }
141
143
  render() {
142
- return (h(Host, { key: '9acb49f74c51e2d446dce1fcaef76049bcbaf97d', "data-version": version }, h("div", { key: 'dad67c5c56b0c158326cfd6d248bb3273398d93b', class: "tabs-wrapper" }, h("div", { key: '6110e4fd09185f7853503c1c399e16b8226ff032', class: "tabs", role: "tablist" }, h("slot", { key: '85028464cfdbd75d3fbfc27d672acef5acb68a49', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: 'abc56a3bc8a6f08066f0fe88048ed4281e05c30d', class: "tab-content" }, h("slot", { key: 'ecbbc08080d4a967448e620bdc9500162f6e6215', onSlotchange: () => this.moveMisplacedTabs() }))));
144
+ return (h(Host, { key: '3af6b715a2ff43314fbc6c436a7693345baabbdb', "data-version": version }, h("div", { key: 'a63850f142b198057a11039101c9ca3c3793f564', class: "tabs-wrapper" }, h("div", { key: '3c3592ea6241f07d672bc4cc049e7f582ba35fef', class: "tabs", role: "tablist" }, h("slot", { key: 'da38ec0fc7cd43588b151f6675458eb0f34b911e', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '451cc4a29b77f3055f469ff18081c5292e21bf36', class: "tab-content" }, h("slot", { key: '32902b5e314c29e74bf4f6c5f02e22c301a47f6f', onSlotchange: () => this.moveMisplacedTabs() }))));
143
145
  }
144
146
  static get is() { return "post-tabs"; }
145
147
  static get encapsulation() { return "shadow"; }
@@ -181,8 +183,8 @@ export class PostTabs {
181
183
  }
182
184
  static get events() {
183
185
  return [{
184
- "method": "tabChange",
185
- "name": "tabChange",
186
+ "method": "postChange",
187
+ "name": "postChange",
186
188
  "bubbles": true,
187
189
  "cancelable": true,
188
190
  "composed": true,
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
+
7
+ * The MIT License (MIT)
8
+
9
+ * Copyright (c) 2011-2020 Twitter, Inc.
10
+ * Copyright (c) 2011-2020 The Bootstrap Authors
11
+
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+
19
+ * The above copyright notice and this permission notice shall be included in
20
+ * all copies or substantial portions of the Software.
21
+
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ * THE SOFTWARE.
29
+ *//*!
30
+ * Copyright 2021 by Swiss Post, Information Technology
31
+ */.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:18.5rem;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}
@@ -0,0 +1,115 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { version } from "../../../package.json";
3
+ /**
4
+ * @slot default - Content to place in the `default` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content" target="_blank">inline content</a>.</p>
5
+ */
6
+ export class PostTag {
7
+ constructor() {
8
+ this.classes = undefined;
9
+ this.variant = undefined;
10
+ this.size = null;
11
+ this.icon = null;
12
+ this.setClasses = this.setClasses.bind(this);
13
+ }
14
+ variantChanged() {
15
+ this.setClasses();
16
+ }
17
+ sizeChanged() {
18
+ this.setClasses();
19
+ }
20
+ setClasses() {
21
+ this.classes = ['tag', this.size ? `tag-${this.size}` : null, this.variant ? `tag-${this.variant}` : null]
22
+ .filter(c => c !== null)
23
+ .join(' ');
24
+ }
25
+ connectedCallback() {
26
+ this.setClasses();
27
+ }
28
+ render() {
29
+ return (h(Host, { key: '2b5b8cf859417949329040bad1f03d94b090fcaa', "data-version": version }, h("div", { key: 'b3e8e5b78959b3036e708faa209d57c75c570e60', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '152f8db8aa831d05545ae3f5555083299132ad2f', class: "tag-text" }, h("slot", { key: '043aa0a1f6bceb3757c1bc7a528fb29eaa1b6b22' })))));
30
+ }
31
+ static get is() { return "post-tag"; }
32
+ static get encapsulation() { return "shadow"; }
33
+ static get originalStyleUrls() {
34
+ return {
35
+ "$": ["post-tag.scss"]
36
+ };
37
+ }
38
+ static get styleUrls() {
39
+ return {
40
+ "$": ["post-tag.css"]
41
+ };
42
+ }
43
+ static get properties() {
44
+ return {
45
+ "variant": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "'white' | 'info' | 'success' | 'error' | 'warning' | 'yellow'",
50
+ "resolved": "\"error\" | \"info\" | \"success\" | \"warning\" | \"white\" | \"yellow\"",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": false,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": "Defines the color variant of the component."
58
+ },
59
+ "attribute": "variant",
60
+ "reflect": false
61
+ },
62
+ "size": {
63
+ "type": "string",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "null | 'sm'",
67
+ "resolved": "\"sm\"",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": "Defines the size of the component."
75
+ },
76
+ "attribute": "size",
77
+ "reflect": false,
78
+ "defaultValue": "null"
79
+ },
80
+ "icon": {
81
+ "type": "string",
82
+ "mutable": false,
83
+ "complexType": {
84
+ "original": "null | string",
85
+ "resolved": "string",
86
+ "references": {}
87
+ },
88
+ "required": false,
89
+ "optional": false,
90
+ "docs": {
91
+ "tags": [],
92
+ "text": "Defines the icon `name` inside of the component.\n<span className=\"alert alert-sm alert-info\">If not set the icon will not show up.</span>\nTo learn which icons are available, please visit our <a href=\"/?path=/docs/5704bdc4-c5b5-45e6-b123-c54d01fce2f1--docs\" target=\"_blank\">icon library</a>."
93
+ },
94
+ "attribute": "icon",
95
+ "reflect": false,
96
+ "defaultValue": "null"
97
+ }
98
+ };
99
+ }
100
+ static get states() {
101
+ return {
102
+ "classes": {}
103
+ };
104
+ }
105
+ static get elementRef() { return "host"; }
106
+ static get watchers() {
107
+ return [{
108
+ "propName": "variant",
109
+ "methodName": "variantChanged"
110
+ }, {
111
+ "propName": "size",
112
+ "methodName": "sizeChanged"
113
+ }];
114
+ }
115
+ }