@swisspost/design-system-components 8.1.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 (221) 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-fd539ea9.js → package-f9a656fd.js} +1 -1
  6. package/dist/cjs/{post-accordion-bebb0498.js → post-accordion-30216884.js} +2 -2
  7. package/dist/cjs/{post-accordion-item-b15bcbb9.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-4a1ab7e3.js → post-alert-e305480e.js} +3 -3
  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-b82b368e.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-36f7a65e.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-eb936464.js → post-popover-3f14dab4.js} +3 -3
  22. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  23. package/dist/cjs/{post-popovercontainer-ba97a4b4.js → post-popovercontainer-5f1717be.js} +4 -4
  24. package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
  25. package/dist/cjs/{post-rating-1df2edf5.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-52ce1af4.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-e94c9c58.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-af38f271.js → post-tabs-d3233bc8.js} +28 -7
  32. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  33. package/dist/cjs/{post-tag-1dcddcae.js → post-tag-534251e7.js} +4 -4
  34. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  35. package/dist/cjs/{post-tooltip-1e8d5f4e.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-card-control/post-card-control.css +1 -1
  39. package/dist/collection/components/post-card-control/post-card-control.js +23 -25
  40. package/dist/collection/components/post-logo/post-logo.css +1 -0
  41. package/dist/collection/components/post-logo/post-logo.js +73 -0
  42. package/dist/collection/components/post-popover/post-popover.js +1 -1
  43. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +2 -2
  44. package/dist/collection/components/post-rating/post-rating.js +1 -1
  45. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  46. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  47. package/dist/collection/components/post-tabs/post-tabs.js +6 -5
  48. package/dist/collection/components/post-tag/post-tag.css +1 -1
  49. package/dist/collection/components/post-tag/post-tag.js +1 -1
  50. package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
  51. package/dist/collection/index.js +1 -0
  52. package/dist/collection/utils/component-on-ready.js +20 -0
  53. package/dist/collection/utils/index.js +1 -0
  54. package/dist/collection/utils/property-checkers/check-url.js +10 -0
  55. package/dist/collection/utils/property-checkers/index.js +3 -0
  56. package/dist/components/index.js +1 -0
  57. package/dist/components/index2.js +13 -1
  58. package/dist/components/package.js +1 -1
  59. package/dist/components/post-card-control2.js +21 -64
  60. package/dist/components/post-logo.d.ts +11 -0
  61. package/dist/components/post-logo.js +6 -0
  62. package/dist/components/post-logo2.js +56 -0
  63. package/dist/components/post-popover2.js +1 -1
  64. package/dist/components/post-popovercontainer2.js +2 -2
  65. package/dist/components/post-rating2.js +1 -1
  66. package/dist/components/post-tab-header2.js +1 -1
  67. package/dist/components/post-tab-panel2.js +1 -1
  68. package/dist/components/post-tabs2.js +26 -5
  69. package/dist/components/post-tag2.js +2 -2
  70. package/dist/components/post-tooltip2.js +1 -1
  71. package/dist/docs.json +64 -5
  72. package/dist/esm/{index-189d3985.js → index-0b56fc28.js} +43 -5
  73. package/dist/esm/{index-d1eba94c.js → index-f41b763f.js} +13 -1
  74. package/dist/esm/index.js +18 -17
  75. package/dist/esm/loader.js +3 -3
  76. package/dist/esm/{package-8c58ace7.js → package-f02beabb.js} +1 -1
  77. package/dist/esm/{post-accordion-6b2f2b73.js → post-accordion-f850422a.js} +2 -2
  78. package/dist/esm/{post-accordion-item-c8614cda.js → post-accordion-item-c2eaeaa7.js} +3 -3
  79. package/dist/esm/post-accordion-item.entry.js +4 -4
  80. package/dist/esm/post-accordion.entry.js +3 -3
  81. package/dist/esm/{post-alert-de5e60d3.js → post-alert-f17886df.js} +3 -3
  82. package/dist/esm/post-alert.entry.js +4 -4
  83. package/dist/esm/post-card-control-25bbcb80.js +270 -0
  84. package/dist/esm/post-card-control.entry.js +3 -3
  85. package/dist/esm/{post-collapsible-trigger-221d58c1.js → post-collapsible-trigger-49da97d7.js} +3 -3
  86. package/dist/esm/post-collapsible_2.entry.js +4 -4
  87. package/dist/esm/post-components.js +3 -3
  88. package/dist/esm/{post-icon-0f2f4f9b.js → post-icon-168d95b5.js} +3 -3
  89. package/dist/esm/post-icon.entry.js +4 -4
  90. package/dist/esm/post-logo-47744c24.js +37 -0
  91. package/dist/esm/post-logo.entry.js +6 -0
  92. package/dist/esm/{post-popover-2e6ada87.js → post-popover-594e9965.js} +3 -3
  93. package/dist/esm/post-popover.entry.js +3 -3
  94. package/dist/esm/{post-popovercontainer-0c396235.js → post-popovercontainer-89cee0fe.js} +4 -4
  95. package/dist/esm/post-popovercontainer.entry.js +3 -3
  96. package/dist/esm/{post-rating-fcf19507.js → post-rating-b87dfbdc.js} +3 -3
  97. package/dist/esm/post-rating.entry.js +3 -3
  98. package/dist/esm/{post-tab-header-75337bbc.js → post-tab-header-2c59fd6e.js} +3 -3
  99. package/dist/esm/post-tab-header.entry.js +3 -3
  100. package/dist/esm/{post-tab-panel-1ca4f5c9.js → post-tab-panel-40bf9d2d.js} +3 -3
  101. package/dist/esm/post-tab-panel.entry.js +3 -3
  102. package/dist/esm/{post-tabs-77ac9eee.js → post-tabs-264e5871.js} +28 -7
  103. package/dist/esm/post-tabs.entry.js +3 -3
  104. package/dist/esm/{post-tag-9741c642.js → post-tag-a7c63782.js} +4 -4
  105. package/dist/esm/post-tag.entry.js +3 -3
  106. package/dist/esm/{post-tooltip-c69b7162.js → post-tooltip-5d2d9e1f.js} +4 -4
  107. package/dist/esm/post-tooltip.entry.js +4 -4
  108. package/dist/post-components/index.esm.js +1 -1
  109. package/dist/post-components/p-04cb82f1.entry.js +1 -0
  110. package/dist/post-components/{p-ed2b2d33.js → p-057d7d3a.js} +1 -1
  111. package/dist/post-components/{p-38abadc5.js → p-0cca56a8.js} +2 -2
  112. package/dist/post-components/p-12f3ce0c.entry.js +1 -0
  113. package/dist/post-components/p-176b59a8.entry.js +1 -0
  114. package/dist/post-components/p-1800787b.js +1 -0
  115. package/dist/post-components/{p-d2753c4a.js → p-300eb394.js} +1 -1
  116. package/dist/post-components/{p-88fc0fa3.js → p-517f2648.js} +1 -1
  117. package/dist/post-components/p-53eb6ca5.entry.js +1 -0
  118. package/dist/post-components/p-5607b941.js +1 -0
  119. package/dist/post-components/p-5b918e0f.entry.js +1 -0
  120. package/dist/post-components/p-6069d96e.entry.js +1 -0
  121. package/dist/post-components/p-6b8378bf.js +1 -0
  122. package/dist/post-components/p-71b8ba91.entry.js +1 -0
  123. package/dist/post-components/p-78806458.entry.js +1 -0
  124. package/dist/post-components/p-851ef572.entry.js +1 -0
  125. package/dist/post-components/{p-2c424cd4.js → p-8b28c907.js} +1 -1
  126. package/dist/post-components/{p-e4acf838.js → p-90eec417.js} +1 -1
  127. package/dist/post-components/p-9f2fc85c.js +1 -0
  128. package/dist/post-components/{p-1e374a42.js → p-ac5a88be.js} +1 -1
  129. package/dist/post-components/{p-8a781b6e.js → p-aca6ea02.js} +1 -1
  130. package/dist/post-components/p-b08e169f.entry.js +1 -0
  131. package/dist/post-components/p-b6b61f13.js +1 -0
  132. package/dist/post-components/{p-32713474.js → p-b8c5020d.js} +1 -1
  133. package/dist/post-components/p-be553212.entry.js +1 -0
  134. package/dist/post-components/p-bf357eb3.entry.js +1 -0
  135. package/dist/post-components/{p-d36a5db5.js → p-c76880ff.js} +1 -1
  136. package/dist/post-components/p-d2f9de94.js +2 -0
  137. package/dist/post-components/p-d4163064.js +1 -0
  138. package/dist/post-components/p-ddab4c09.entry.js +1 -0
  139. package/dist/post-components/p-deb4131c.js +1 -0
  140. package/dist/post-components/p-e597a879.entry.js +1 -0
  141. package/dist/post-components/p-eafc65f6.entry.js +1 -0
  142. package/dist/post-components/post-components.esm.js +1 -1
  143. package/dist/types/components/post-card-control/post-card-control.d.ts +5 -7
  144. package/dist/types/components/post-logo/post-logo.d.ts +14 -0
  145. package/dist/types/components.d.ts +29 -8
  146. package/dist/types/index.d.ts +1 -0
  147. package/dist/types/utils/component-on-ready.d.ts +6 -0
  148. package/dist/types/utils/index.d.ts +1 -0
  149. package/dist/types/utils/property-checkers/check-url.d.ts +1 -0
  150. package/dist/types/utils/property-checkers/index.d.ts +2 -0
  151. package/loaders/attribute-observer.js +25 -0
  152. package/loaders/check-non-empty.js +9 -0
  153. package/loaders/check-one-of.js +6 -0
  154. package/loaders/check-type.js +14 -0
  155. package/loaders/constants.js +3 -0
  156. package/loaders/fade.js +7 -0
  157. package/loaders/heading-levels.js +3 -0
  158. package/loaders/index.d.ts +68 -0
  159. package/loaders/index.js +18 -0
  160. package/loaders/index2.js +34 -0
  161. package/loaders/package.js +3 -0
  162. package/loaders/post-accordion-item.d.ts +11 -0
  163. package/loaders/post-accordion-item.js +86 -0
  164. package/loaders/post-accordion.d.ts +11 -0
  165. package/loaders/post-accordion.js +128 -0
  166. package/loaders/post-alert.d.ts +11 -0
  167. package/loaders/post-alert.js +139 -0
  168. package/loaders/post-card-control.d.ts +11 -0
  169. package/loaders/post-card-control.js +306 -0
  170. package/loaders/post-collapsible-trigger.d.ts +11 -0
  171. package/loaders/post-collapsible-trigger.js +6 -0
  172. package/loaders/post-collapsible-trigger2.js +144 -0
  173. package/loaders/post-collapsible.d.ts +11 -0
  174. package/loaders/post-collapsible.js +6 -0
  175. package/loaders/post-collapsible2.js +103 -0
  176. package/loaders/post-icon.d.ts +11 -0
  177. package/loaders/post-icon.js +6 -0
  178. package/loaders/post-icon2.js +136 -0
  179. package/loaders/post-logo.d.ts +11 -0
  180. package/loaders/post-logo.js +59 -0
  181. package/loaders/post-popover.d.ts +11 -0
  182. package/loaders/post-popover.js +133 -0
  183. package/loaders/post-popovercontainer.d.ts +11 -0
  184. package/loaders/post-popovercontainer.js +6 -0
  185. package/loaders/post-popovercontainer2.js +2204 -0
  186. package/loaders/post-rating.d.ts +11 -0
  187. package/loaders/post-rating.js +116 -0
  188. package/loaders/post-tab-header.d.ts +11 -0
  189. package/loaders/post-tab-header.js +53 -0
  190. package/loaders/post-tab-panel.d.ts +11 -0
  191. package/loaders/post-tab-panel.js +45 -0
  192. package/loaders/post-tabs.d.ts +11 -0
  193. package/loaders/post-tabs.js +192 -0
  194. package/loaders/post-tag.d.ts +11 -0
  195. package/loaders/post-tag.js +77 -0
  196. package/loaders/post-tooltip.d.ts +11 -0
  197. package/loaders/post-tooltip.js +5000 -0
  198. package/package.json +12 -11
  199. package/dist/cjs/post-card-control-c363c793.js +0 -315
  200. package/dist/esm/post-card-control-38a302fe.js +0 -313
  201. package/dist/post-components/p-02d1f275.js +0 -1
  202. package/dist/post-components/p-28e17fd1.entry.js +0 -1
  203. package/dist/post-components/p-6dd5d5ba.entry.js +0 -1
  204. package/dist/post-components/p-726fec57.js +0 -1
  205. package/dist/post-components/p-7301b124.entry.js +0 -1
  206. package/dist/post-components/p-7bdec425.js +0 -1
  207. package/dist/post-components/p-7fc15b07.entry.js +0 -1
  208. package/dist/post-components/p-80f33a98.js +0 -1
  209. package/dist/post-components/p-8126cca3.entry.js +0 -1
  210. package/dist/post-components/p-8b86cde6.entry.js +0 -1
  211. package/dist/post-components/p-95b7403d.entry.js +0 -1
  212. package/dist/post-components/p-a0187d40.entry.js +0 -1
  213. package/dist/post-components/p-a5c8a3de.js +0 -1
  214. package/dist/post-components/p-a931e3c6.entry.js +0 -1
  215. package/dist/post-components/p-b5f7d9e5.entry.js +0 -1
  216. package/dist/post-components/p-b9176139.entry.js +0 -1
  217. package/dist/post-components/p-c0f265c8.js +0 -2
  218. package/dist/post-components/p-c88f169d.entry.js +0 -1
  219. package/dist/post-components/p-e6bc1a0c.entry.js +0 -1
  220. package/dist/post-components/p-ea2954f3.entry.js +0 -1
  221. package/dist/post-components/p-f91c0e1b.js +0 -1
@@ -0,0 +1,73 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { version } from "../../../../package";
3
+ import { checkEmptyOrUrl } from "../../utils/index";
4
+ /**
5
+ * @slot default - Slot for placing hidden descriptive text. If `url` is set, this text will serve as the accessible name of the link; otherwise, it will be used as the title of the SVG.
6
+ */
7
+ export class PostLogo {
8
+ constructor() {
9
+ this.url = undefined;
10
+ }
11
+ validateUrl() {
12
+ checkEmptyOrUrl(this.url, 'The "url" property of the post-logo is invalid');
13
+ }
14
+ connectedCallback() {
15
+ this.validateUrl();
16
+ this.checkDescription();
17
+ }
18
+ checkDescription() {
19
+ if (!this.host.textContent) {
20
+ console.warn('Be sure to add descriptive text in the post-logo to ensure good accessibility of the component.');
21
+ }
22
+ }
23
+ render() {
24
+ const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
25
+ const LogoTag = logoLink ? 'a' : 'span';
26
+ return (h(Host, { key: 'c1d583f828a1f35ed482f1d1894354a503d8010e', "data-version": version }, h(LogoTag, Object.assign({ key: '61886ad3e388a6286e86b49a8ab150774e9e3d19', class: "logo" }, (logoLink ? { href: logoLink } : {})), h("span", { key: '88c01bbd0e146157ff2897300199717e8da1b2f0', class: "description" }, h("slot", { key: 'dccdd781dd6b6c78d9c8775a3f91765c6c4a8449', onSlotchange: () => this.checkDescription() })), h("svg", { key: '3f66dab4ca898d245759249828508adfa0ac92ea', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'bb5bb34aa56362a8805f6f97562825448d4ffac7', id: "Logo" }, h("rect", { key: '8bbee198611c558653cac3b31683beb9bc17c196', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '2ca797bd9ad0861b81b953e04626abb2d5cb7323', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'eefa701f5f04ba0f0c04eb51748e62209e33ff06', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
27
+ }
28
+ static get is() { return "post-logo"; }
29
+ static get encapsulation() { return "shadow"; }
30
+ static get originalStyleUrls() {
31
+ return {
32
+ "$": ["post-logo.scss"]
33
+ };
34
+ }
35
+ static get styleUrls() {
36
+ return {
37
+ "$": ["post-logo.css"]
38
+ };
39
+ }
40
+ static get properties() {
41
+ return {
42
+ "url": {
43
+ "type": "string",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "string | URL",
47
+ "resolved": "URL | string",
48
+ "references": {
49
+ "URL": {
50
+ "location": "global",
51
+ "id": "global::URL"
52
+ }
53
+ }
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": "The URL to which the user is redirected upon clicking the logo."
60
+ },
61
+ "attribute": "url",
62
+ "reflect": false
63
+ }
64
+ };
65
+ }
66
+ static get elementRef() { return "host"; }
67
+ static get watchers() {
68
+ return [{
69
+ "propName": "url",
70
+ "methodName": "validateUrl"
71
+ }];
72
+ }
73
+ }
@@ -88,7 +88,7 @@ export class PostPopover {
88
88
  this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
89
89
  }
90
90
  render() {
91
- return (h(Host, { key: '97db4a92db81f3a84ca272af8f79981cf181024d', "data-version": version }, h("post-popovercontainer", { key: '291247845dc11572a5722aa949c1dfa74e521edd', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '92137bf8c92633c8578c89c7b0c8252b0b59e2fa', class: "popover-container" }, h("div", { key: '06f79f59e90ca439b552380af0e151084adadf03', class: "popover-content" }, h("slot", { key: 'c37c742ac7cf24f9440ac3b862761fcd937f7658' })), h("button", { key: '0e6f316574720e0f901af56e0dbb99f86e36c5b4', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '77c41e8e8df74649ce9ca21740c77e78336905e6', class: "visually-hidden" }, this.closeButtonCaption))))));
91
+ return (h(Host, { key: '6fe379d071ec88a76f99cc10f0fdce0b2f079fbd', "data-version": version }, h("post-popovercontainer", { key: '3a5e2896e87e3f2d32c0ad9b1d80327cc585f289', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '46834ef6a3893fe8823776d8feb20a2fb328e3bc', class: "popover-container" }, h("div", { key: '9d61b678c2613e84efc0df805cbb67fbe3d06991', class: "popover-content" }, h("slot", { key: '1cfef5daaea3f6370869a3ae648ff36e2dddd82a' })), h("button", { key: 'c7a2e12ece46ee63d8004d99427c8c6febc2dc17', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '1aee8ffe06b5c4c9bade0185a8832328410fbe4a', class: "visually-hidden" }, this.closeButtonCaption))))));
92
92
  }
93
93
  static get is() { return "post-popover"; }
94
94
  static get encapsulation() { return "shadow"; }
@@ -135,9 +135,9 @@ export class PostPopovercontainer {
135
135
  }
136
136
  }
137
137
  render() {
138
- return (h(Host, { key: 'd157ffbb6acb382add7b003f7865eb7c7d77a2b5', "data-version": version }, this.arrow && (h("span", { key: 'cc47843bc00d401c0679474e41661b6b1dcbae01', class: "arrow", ref: el => {
138
+ return (h(Host, { key: 'daf21d119057a14c2c2f68b8068901ab698beae3', "data-version": version }, this.arrow && (h("span", { key: '4f5cfb1422217f9ef71732cdfc0c97b6b29e4809', class: "arrow", ref: el => {
139
139
  this.arrowRef = el;
140
- } })), h("slot", { key: '75eb62cf77965fa96fbb3dabcf264c2daff3e2f4' })));
140
+ } })), h("slot", { key: 'f6e4beefb8e365dbf20a0a5019cceaac4ecb73a4' })));
141
141
  }
142
142
  static get is() { return "post-popovercontainer"; }
143
143
  static get originalStyleUrls() {
@@ -64,7 +64,7 @@ export class PostRating {
64
64
  }
65
65
  }
66
66
  render() {
67
- return (h(Host, { key: 'ae0484c022555a4a5ed0343cc060b7076a1c581e', "data-version": version }, h("div", { key: '3765eaaccec1dd709b28d8a63b54fc0ed69b4c15', 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: {
67
+ 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: {
68
68
  'star': true,
69
69
  'before-hover': i < this.hoveredIndex,
70
70
  'active': i < Math.round(this.currentRating),
@@ -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: 'ba101bdcdf05591293e07ab35aadb812862d8cc0', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '276d95c72fc7014f8002f249f2bbab591ee8754d' })));
19
+ 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' })));
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: 'bd31fce17f303414e7d077fbc001b543d05e362c', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '746b85fa6378312abb2f1e92cb4fffceafac1fc7' })));
16
+ return (h(Host, { key: '2d01a8e7f06e45b4750e63584a3c52232dee4dd5', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: 'b51e2f112791ac22df43ebb537208c65aebe3d03' })));
17
17
  }
18
18
  static get is() { return "post-tab-panel"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
3
  import { fadeIn, fadeOut } from "../../animations/index";
4
+ import { componentOnReady } from "../../utils/index";
4
5
  /**
5
6
  * @slot tabs - Slot for placing tab headers. Each tab header should be a <post-tab-header> element.
6
7
  * @slot default - Slot for placing tab panels. Each tab panel should be a <post-tab-panel> element.
@@ -66,7 +67,7 @@ export class PostTabs {
66
67
  if (!this.tabs)
67
68
  return;
68
69
  this.tabs.forEach(async (tab) => {
69
- await tab.componentOnReady();
70
+ await componentOnReady(tab);
70
71
  // if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
71
72
  if (tab.getAttribute('aria-controls'))
72
73
  return;
@@ -82,9 +83,9 @@ export class PostTabs {
82
83
  void this.show(tab.panel);
83
84
  }
84
85
  });
85
- tab.addEventListener('keydown', ({ key }) => {
86
- if (key === 'ArrowRight' || key === 'ArrowLeft')
87
- this.navigateTabs(tab, key);
86
+ tab.addEventListener('keydown', (e) => {
87
+ if (e.key === 'ArrowRight' || e.key === 'ArrowLeft')
88
+ this.navigateTabs(tab, e.key);
88
89
  });
89
90
  });
90
91
  // if the currently active tab was removed from the DOM then select the first one
@@ -141,7 +142,7 @@ export class PostTabs {
141
142
  nextTab.focus();
142
143
  }
143
144
  render() {
144
- return (h(Host, { key: 'd0f37718e538b9dd4b5e0eed0dde161576725e25', "data-version": version }, h("div", { key: '1d3380b6317cad0bde525136854e93ee20e3bfbf', class: "tabs-wrapper", part: "tabs" }, h("div", { key: 'bc5cf13c94629e2938eb4ea85deb5ebd6c2b2dac', class: "tabs", role: "tablist" }, h("slot", { key: '4fde604e204df192946080b652d60c27d7ff6cee', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '755b7153a2a8c683abf15d33a0d9180e8aa29db0', class: "tab-content", part: "content" }, h("slot", { key: '23263344474597c54a7d8cc355d22919cb8685f1', onSlotchange: () => this.moveMisplacedTabs() }))));
145
+ 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() }))));
145
146
  }
146
147
  static get is() { return "post-tabs"; }
147
148
  static get encapsulation() { return "shadow"; }
@@ -28,4 +28,4 @@
28
28
  * THE SOFTWARE.
29
29
  *//*!
30
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}
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: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}
@@ -30,7 +30,7 @@ export class PostTag {
30
30
  this.setClasses();
31
31
  }
32
32
  render() {
33
- return (h(Host, { key: '5b29f617d1f9dbba914664263ccace77e18fdd10', "data-version": version }, h("div", { key: '25d9431e746f0d677704c97dc9bd27023a502efb', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: 'e13004f14169d4abccd3df8d0245bc2f361f0b81', class: "tag-text" }, h("slot", { key: '567d61fae24d649c64c9ea53685a627f7e45fde1' })))));
33
+ 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' })))));
34
34
  }
35
35
  static get is() { return "post-tag"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -179,7 +179,7 @@ export class PostTooltip {
179
179
  }
180
180
  render() {
181
181
  const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
182
- return (h(Host, { key: '939e17d222f1102dbfe3532d1cfe11b2777e4373', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: 'fe5388550554ebb39c8f5b59668b86483b5cb141', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '90275f38a63f5d6f18b915718b738f29246b2843' }))));
182
+ return (h(Host, { key: 'f543fa8f63cc6b65e1a86e34b1a59b4ca0bb9e47', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: 'e920d62462d209ff25593f7989ca16f6177b7292', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '607d7357cb201c7e6e62f9a241392bd5ef1f156e' }))));
183
183
  }
184
184
  static get is() { return "post-tooltip"; }
185
185
  static get encapsulation() { return "shadow"; }
@@ -6,6 +6,7 @@ export { PostCardControl } from './components/post-card-control/post-card-contro
6
6
  export { PostCollapsible } from './components/post-collapsible/post-collapsible';
7
7
  export { PostCollapsibleTrigger } from './components/post-collapsible-trigger/post-collapsible-trigger';
8
8
  export { PostIcon } from './components/post-icon/post-icon';
9
+ export { PostLogo } from './components/post-logo/post-logo';
9
10
  export { PostPopover } from './components/post-popover/post-popover';
10
11
  export { PostPopovercontainer } from './components/post-popovercontainer/post-popovercontainer';
11
12
  export { PostRating } from './components/post-rating/post-rating';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Invoke the `componentOnReady` method if it is available, simulate it otherwise
3
+ * @see https://stenciljs.com/docs/api#componentonready
4
+ */
5
+ export const componentOnReady = (el) => {
6
+ if (typeof el.componentOnReady === 'function') {
7
+ return el.componentOnReady();
8
+ }
9
+ else {
10
+ return new Promise(resolve => customOnReady(() => {
11
+ resolve(el);
12
+ }));
13
+ }
14
+ };
15
+ const customOnReady = (callback) => {
16
+ if (typeof requestAnimationFrame === 'function') {
17
+ return requestAnimationFrame(callback);
18
+ }
19
+ return setTimeout(callback);
20
+ };
@@ -1,3 +1,4 @@
1
+ export * from './component-on-ready';
1
2
  export * from './property-checkers';
2
3
  export * from './debounce';
3
4
  export * from './get-root';
@@ -0,0 +1,10 @@
1
+ export function checkUrl(value, error) {
2
+ if (typeof value !== 'string' && !(value instanceof URL))
3
+ throw new Error(error);
4
+ try {
5
+ new URL(value);
6
+ }
7
+ catch (e) {
8
+ throw new Error(error);
9
+ }
10
+ }
@@ -2,10 +2,13 @@ import { emptyOr } from "./empty-or";
2
2
  import { checkOneOf } from "./check-one-of";
3
3
  import { checkPattern } from "./check-pattern";
4
4
  import { checkType } from "./check-type";
5
+ import { checkUrl } from "./check-url";
5
6
  export const checkEmptyOrOneOf = emptyOr(checkOneOf);
6
7
  export const checkEmptyOrPattern = emptyOr(checkPattern);
7
8
  export const checkEmptyOrType = emptyOr(checkType);
9
+ export const checkEmptyOrUrl = emptyOr(checkUrl);
8
10
  export * from './check-non-empty';
9
11
  export * from './check-one-of';
10
12
  export * from './check-pattern';
11
13
  export * from './check-type';
14
+ export * from './check-url';
@@ -6,6 +6,7 @@ export { P as PostCardControl } from './post-card-control2.js';
6
6
  export { P as PostCollapsible } from './post-collapsible2.js';
7
7
  export { P as PostCollapsibleTrigger } from './post-collapsible-trigger2.js';
8
8
  export { P as PostIcon } from './post-icon2.js';
9
+ export { P as PostLogo } from './post-logo2.js';
9
10
  export { P as PostPopover } from './post-popover2.js';
10
11
  export { P as PostPopovercontainer } from './post-popovercontainer2.js';
11
12
  export { P as PostRating } from './post-rating2.js';
@@ -15,8 +15,20 @@ function checkPattern(value, pattern, errorMessage) {
15
15
  throw new Error(errorMessage);
16
16
  }
17
17
 
18
+ function checkUrl(value, error) {
19
+ if (typeof value !== 'string' && !(value instanceof URL))
20
+ throw new Error(error);
21
+ try {
22
+ new URL(value);
23
+ }
24
+ catch (e) {
25
+ throw new Error(error);
26
+ }
27
+ }
28
+
18
29
  const checkEmptyOrOneOf = emptyOr(checkOneOf);
19
30
  const checkEmptyOrPattern = emptyOr(checkPattern);
20
31
  const checkEmptyOrType = emptyOr(checkType);
32
+ const checkEmptyOrUrl = emptyOr(checkUrl);
21
33
 
22
- export { checkEmptyOrPattern as a, checkEmptyOrType as b, checkEmptyOrOneOf as c };
34
+ export { checkEmptyOrPattern as a, checkEmptyOrType as b, checkEmptyOrOneOf as c, checkEmptyOrUrl as d };
@@ -1,3 +1,3 @@
1
- const version = "8.1.0";
1
+ const version = "8.2.0";
2
2
 
3
3
  export { version as v };