@swisspost/design-system-components 8.2.1 → 9.0.0-next.1

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 (162) hide show
  1. package/dist/cjs/index.cjs.js +16 -16
  2. package/dist/cjs/{package-69bba137.js → package-c7d01968.js} +1 -1
  3. package/dist/cjs/{post-accordion-3da9563f.js → post-accordion-e29956c4.js} +11 -9
  4. package/dist/cjs/{post-accordion-item-57046b20.js → post-accordion-item-dc4d1801.js} +4 -4
  5. package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
  6. package/dist/cjs/post-accordion.cjs.entry.js +2 -2
  7. package/dist/cjs/post-alert-106c34ac.js +98 -0
  8. package/dist/cjs/post-alert.cjs.entry.js +2 -2
  9. package/dist/cjs/post-card-control-69769d1a.js +272 -0
  10. package/dist/cjs/post-card-control.cjs.entry.js +2 -2
  11. package/dist/cjs/{post-collapsible-trigger-68e20fe1.js → post-collapsible-trigger-32549d33.js} +1 -1
  12. package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
  13. package/dist/cjs/{post-icon-0fb3e3a5.js → post-icon-221d976f.js} +1 -1
  14. package/dist/cjs/post-icon.cjs.entry.js +2 -2
  15. package/dist/cjs/{post-logo-f4c77b1a.js → post-logo-e6cb079f.js} +1 -1
  16. package/dist/cjs/post-logo.cjs.entry.js +2 -2
  17. package/dist/cjs/post-popover-cfc1b31b.js +104 -0
  18. package/dist/cjs/post-popover.cjs.entry.js +2 -2
  19. package/dist/cjs/{post-popovercontainer-d462f01b.js → post-popovercontainer-c0b86b11.js} +1 -1
  20. package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
  21. package/dist/cjs/{post-rating-49248453.js → post-rating-b9b8b6f3.js} +2 -2
  22. package/dist/cjs/post-rating.cjs.entry.js +2 -2
  23. package/dist/cjs/{post-tab-header-01d91e1c.js → post-tab-header-43310d08.js} +2 -2
  24. package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
  25. package/dist/cjs/{post-tab-panel-9f29af4a.js → post-tab-panel-300a0618.js} +1 -1
  26. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  27. package/dist/cjs/{post-tabs-0952f6c0.js → post-tabs-b06f799b.js} +1 -1
  28. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  29. package/dist/cjs/post-tag-d7ac3cbb.js +47 -0
  30. package/dist/cjs/post-tag.cjs.entry.js +2 -2
  31. package/dist/cjs/{post-tooltip-2c85c40a.js → post-tooltip-8d7e64f6.js} +23 -4
  32. package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
  33. package/dist/collection/components/post-accordion/post-accordion.js +12 -10
  34. package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -5
  35. package/dist/collection/components/post-alert/post-alert.css +1 -29
  36. package/dist/collection/components/post-card-control/post-card-control.css +0 -28
  37. package/dist/collection/components/post-popover/post-popover.css +0 -28
  38. package/dist/collection/components/post-rating/post-rating.css +0 -28
  39. package/dist/collection/components/post-tab-header/post-tab-header.css +0 -28
  40. package/dist/collection/components/post-tag/post-tag.css +0 -28
  41. package/dist/collection/components/post-tooltip/post-tooltip.js +30 -4
  42. package/dist/components/package.js +1 -1
  43. package/dist/components/post-accordion-item2.js +3 -3
  44. package/dist/components/post-accordion2.js +10 -8
  45. package/dist/components/post-alert2.js +1 -1
  46. package/dist/components/post-card-control2.js +1 -1
  47. package/dist/components/post-popover2.js +1 -1
  48. package/dist/components/post-rating2.js +1 -1
  49. package/dist/components/post-tab-header2.js +1 -1
  50. package/dist/components/post-tag2.js +1 -1
  51. package/dist/components/post-tooltip2.js +22 -3
  52. package/dist/docs.json +19 -6
  53. package/dist/esm/index.js +16 -16
  54. package/dist/esm/package-bc6404e2.js +3 -0
  55. package/dist/esm/{post-accordion-0997a59a.js → post-accordion-3a7b3f3c.js} +11 -9
  56. package/dist/esm/{post-accordion-item-6ed597ee.js → post-accordion-item-55d1e771.js} +4 -4
  57. package/dist/esm/post-accordion-item.entry.js +2 -2
  58. package/dist/esm/post-accordion.entry.js +2 -2
  59. package/dist/esm/post-alert-6c908130.js +96 -0
  60. package/dist/esm/post-alert.entry.js +2 -2
  61. package/dist/esm/post-card-control-9fff6efc.js +270 -0
  62. package/dist/esm/post-card-control.entry.js +2 -2
  63. package/dist/esm/{post-collapsible-trigger-ee4b6850.js → post-collapsible-trigger-8d7e027b.js} +1 -1
  64. package/dist/esm/post-collapsible_2.entry.js +2 -2
  65. package/dist/esm/{post-icon-91683e26.js → post-icon-d59ad345.js} +1 -1
  66. package/dist/esm/post-icon.entry.js +2 -2
  67. package/dist/esm/{post-logo-3f8cf707.js → post-logo-a1487634.js} +1 -1
  68. package/dist/esm/post-logo.entry.js +2 -2
  69. package/dist/esm/post-popover-972c5ea7.js +102 -0
  70. package/dist/esm/post-popover.entry.js +2 -2
  71. package/dist/esm/{post-popovercontainer-23860260.js → post-popovercontainer-2485b7d9.js} +1 -1
  72. package/dist/esm/post-popovercontainer.entry.js +2 -2
  73. package/dist/esm/{post-rating-dfd43afc.js → post-rating-cca784ae.js} +2 -2
  74. package/dist/esm/post-rating.entry.js +2 -2
  75. package/dist/esm/{post-tab-header-42bfc542.js → post-tab-header-dd2cb68e.js} +2 -2
  76. package/dist/esm/post-tab-header.entry.js +2 -2
  77. package/dist/esm/{post-tab-panel-233c4dc3.js → post-tab-panel-633a5e6b.js} +1 -1
  78. package/dist/esm/post-tab-panel.entry.js +2 -2
  79. package/dist/esm/{post-tabs-fdea9439.js → post-tabs-74ded897.js} +1 -1
  80. package/dist/esm/post-tabs.entry.js +2 -2
  81. package/dist/esm/post-tag-f60a71fd.js +45 -0
  82. package/dist/esm/post-tag.entry.js +2 -2
  83. package/dist/esm/{post-tooltip-f46b5e51.js → post-tooltip-0457467f.js} +23 -4
  84. package/dist/esm/post-tooltip.entry.js +2 -2
  85. package/dist/post-components/index.esm.js +1 -1
  86. package/dist/post-components/{p-968de7fe.js → p-01a8fe6a.js} +3 -3
  87. package/dist/post-components/p-0e0c11f9.entry.js +1 -0
  88. package/dist/post-components/{p-18c01d62.js → p-124fe6c8.js} +1 -1
  89. package/dist/post-components/p-15c6739e.entry.js +1 -0
  90. package/dist/post-components/p-2180e02d.entry.js +1 -0
  91. package/dist/post-components/p-22ec06ae.entry.js +1 -0
  92. package/dist/post-components/p-26bbd8e5.entry.js +1 -0
  93. package/dist/post-components/p-2b43665d.js +1 -0
  94. package/dist/post-components/p-2d1f85f4.js +1 -0
  95. package/dist/post-components/p-41094063.js +1 -0
  96. package/dist/post-components/p-464ce10a.entry.js +1 -0
  97. package/dist/post-components/{p-50bc322d.js → p-51eff367.js} +1 -1
  98. package/dist/post-components/p-586f7f53.entry.js +1 -0
  99. package/dist/post-components/p-65031b20.entry.js +1 -0
  100. package/dist/post-components/p-6d9c46f4.js +1 -0
  101. package/dist/post-components/{p-35f06c3d.js → p-6f12f3e5.js} +1 -1
  102. package/dist/post-components/p-718eb560.js +1 -0
  103. package/dist/post-components/p-78407640.entry.js +1 -0
  104. package/dist/post-components/p-79a40235.entry.js +1 -0
  105. package/dist/post-components/{p-f04634da.js → p-7ab513fc.js} +1 -1
  106. package/dist/post-components/p-9cba7d2f.js +1 -0
  107. package/dist/post-components/p-9eb27378.entry.js +1 -0
  108. package/dist/post-components/{p-bd339c2c.js → p-a528acc4.js} +1 -1
  109. package/dist/post-components/{p-660594c0.js → p-aa8e43c3.js} +1 -1
  110. package/dist/post-components/p-b68c86a7.js +1 -0
  111. package/dist/post-components/p-b8db0e0a.entry.js +1 -0
  112. package/dist/post-components/p-bcd5843c.entry.js +1 -0
  113. package/dist/post-components/p-c21b810d.js +1 -0
  114. package/dist/post-components/{p-4aef4c0b.js → p-c386219b.js} +1 -1
  115. package/dist/post-components/p-e7c67ff0.entry.js +1 -0
  116. package/dist/post-components/{p-b5fa3ba0.entry.js → p-f10e2bb1.entry.js} +1 -1
  117. package/dist/post-components/post-components.esm.js +1 -1
  118. package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
  119. package/dist/types/components/post-tooltip/post-tooltip.d.ts +4 -1
  120. package/dist/types/components.d.ts +4 -3
  121. package/loaders/package.js +1 -1
  122. package/loaders/post-accordion-item.js +3 -3
  123. package/loaders/post-accordion.js +10 -8
  124. package/loaders/post-alert.js +1 -1
  125. package/loaders/post-card-control.js +1 -1
  126. package/loaders/post-popover.js +1 -1
  127. package/loaders/post-rating.js +1 -1
  128. package/loaders/post-tab-header.js +1 -1
  129. package/loaders/post-tag.js +1 -1
  130. package/loaders/post-tooltip.js +22 -3
  131. package/package.json +3 -3
  132. package/dist/cjs/post-alert-54b0ed5d.js +0 -98
  133. package/dist/cjs/post-card-control-407e03b7.js +0 -272
  134. package/dist/cjs/post-popover-01193d5f.js +0 -104
  135. package/dist/cjs/post-tag-7afb5956.js +0 -47
  136. package/dist/esm/package-cc8df0dd.js +0 -3
  137. package/dist/esm/post-alert-a0eeba8b.js +0 -96
  138. package/dist/esm/post-card-control-453166e5.js +0 -270
  139. package/dist/esm/post-popover-b44d91a2.js +0 -102
  140. package/dist/esm/post-tag-98651c1c.js +0 -45
  141. package/dist/post-components/p-0e04f44b.entry.js +0 -1
  142. package/dist/post-components/p-17b8b241.js +0 -1
  143. package/dist/post-components/p-1a4ef000.js +0 -1
  144. package/dist/post-components/p-213cfa52.js +0 -1
  145. package/dist/post-components/p-30af6382.entry.js +0 -1
  146. package/dist/post-components/p-326709cb.js +0 -1
  147. package/dist/post-components/p-3749f35b.entry.js +0 -1
  148. package/dist/post-components/p-444824a1.entry.js +0 -1
  149. package/dist/post-components/p-4c229386.js +0 -1
  150. package/dist/post-components/p-605b64b4.entry.js +0 -1
  151. package/dist/post-components/p-60cc57a5.entry.js +0 -1
  152. package/dist/post-components/p-7bf744e9.entry.js +0 -1
  153. package/dist/post-components/p-94d8f3d2.entry.js +0 -1
  154. package/dist/post-components/p-b41129e7.entry.js +0 -1
  155. package/dist/post-components/p-b545df93.entry.js +0 -1
  156. package/dist/post-components/p-b96c35d4.js +0 -1
  157. package/dist/post-components/p-c0aa6d02.js +0 -1
  158. package/dist/post-components/p-c4f5fa27.entry.js +0 -1
  159. package/dist/post-components/p-c998fdc9.entry.js +0 -1
  160. package/dist/post-components/p-cb757310.js +0 -1
  161. package/dist/post-components/p-d2912c01.entry.js +0 -1
  162. package/dist/post-components/p-e00b4f0d.entry.js +0 -1
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
  import { v as version } from './package.js';
3
3
  import { d as defineCustomElement$2 } from './post-icon2.js';
4
4
 
5
- const postTagCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:.25rem;padding:0 .5rem;max-width:100%;background-color:var(--post-tag-bg);border:1px solid rgba(0,0,0,0);border-radius:.25rem;font-size:1rem;line-height:1.875rem;white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:1.5rem}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:var(--post-contrast-color)}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}";
5
+ const postTagCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:.25rem;padding:0 .5rem;max-width:100%;background-color:var(--post-tag-bg);border:1px solid rgba(0,0,0,0);border-radius:.25rem;font-size:1rem;line-height:1.875rem;white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:1.5rem}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:var(--post-contrast-color)}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}";
6
6
  const PostTagStyle0 = postTagCss;
7
7
 
8
8
  const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLElement {
@@ -4794,6 +4794,10 @@ const tooltipTargetAttributeSelector = `[${tooltipTargetAttribute}]`;
4794
4794
  /**
4795
4795
  * Global event listener to show tooltips. This is globalized so that triggers that are rendered
4796
4796
  * async will still work without the need to set listeners on the element itself
4797
+ *
4798
+ * This handler manages both pointer and focus events to properly trigger tooltips.
4799
+ * If the event is a focus event (e.g., keyboard navigation), pointer events are ignored to avoid
4800
+ * interference with tooltip behavior.
4797
4801
  * @param e Event
4798
4802
  * @returns
4799
4803
  */
@@ -4805,7 +4809,9 @@ const globalInterestHandler = (e) => {
4805
4809
  if (!tooltipTarget || tooltipTarget === '')
4806
4810
  return;
4807
4811
  const tooltip = document.getElementById(tooltipTarget);
4808
- void (tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(targetElement));
4812
+ // Determine if the tooltip was triggered by a focus event
4813
+ const triggeredByFocus = e.type === 'focusin';
4814
+ void (tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(targetElement, triggeredByFocus));
4809
4815
  if (hideTooltipTimeout) {
4810
4816
  window.clearTimeout(hideTooltipTimeout);
4811
4817
  hideTooltipTimeout = null;
@@ -4862,6 +4868,7 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
4862
4868
  super();
4863
4869
  this.__registerHost();
4864
4870
  this.__attachShadow();
4871
+ this.wasOpenedByFocus = false;
4865
4872
  this.placement = 'top';
4866
4873
  this.arrow = true;
4867
4874
  this.delayed = false;
@@ -4921,10 +4928,20 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
4921
4928
  /**
4922
4929
  * Programmatically display the tooltip
4923
4930
  * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
4931
+ * @param triggeredByFocus A boolean indicating if the tooltip was triggered by a focus event.
4924
4932
  */
4925
- async show(target) {
4933
+ async show(target, triggeredByFocus = false) {
4926
4934
  if (this.delayed)
4927
4935
  await timeout(OPEN_DELAY);
4936
+ // Determine if the tooltip was opened by a focus event
4937
+ this.wasOpenedByFocus = triggeredByFocus;
4938
+ // Disable pointer events if triggered by focus, otherwise enable them
4939
+ if (this.wasOpenedByFocus) {
4940
+ this.host.style.pointerEvents = 'none';
4941
+ }
4942
+ else {
4943
+ this.host.style.pointerEvents = 'auto';
4944
+ }
4928
4945
  this.popoverRef.show(target);
4929
4946
  }
4930
4947
  /**
@@ -4952,13 +4969,15 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
4952
4969
  }
4953
4970
  /**
4954
4971
  * Pointer or focus left the tooltip, initiate the hiding process
4972
+ * Re-enable pointer events when the tooltip is no longer in focus or hovered
4955
4973
  */
4956
4974
  handleInterestLost() {
4957
4975
  globalHideTooltip(this);
4976
+ this.host.style.pointerEvents = 'auto';
4958
4977
  }
4959
4978
  render() {
4960
4979
  const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
4961
- return (h(Host, { key: 'f543fa8f63cc6b65e1a86e34b1a59b4ca0bb9e47', "data-version": version$1, 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' }))));
4980
+ return (h(Host, { key: '6d5e454da6fb46fb4446d8ed1deb8c6a9f2f2e0f', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '7b626cd4699e4178fbd8506b88fae64c94ab1631', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'ae5721af16313dc3737947d2ae130e0514ef2dd8' }))));
4962
4981
  }
4963
4982
  get host() { return this; }
4964
4983
  static get watchers() { return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "8.2.1",
3
+ "version": "9.0.0-next.1",
4
4
  "description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.cjs.js",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@floating-ui/dom": "1.6.8",
28
28
  "@oddbird/popover-polyfill": "0.3.7",
29
- "@swisspost/design-system-styles": "8.2.1",
29
+ "@swisspost/design-system-styles": "9.0.0-next.1",
30
30
  "ally.js": "1.4.1",
31
31
  "long-press-event": "2.5.0"
32
32
  },
@@ -50,7 +50,7 @@
50
50
  "eslint-plugin-react": "7.35.0",
51
51
  "rimraf": "6.0.1",
52
52
  "rollup-plugin-postcss": "4.0.2",
53
- "sass": "1.77.8",
53
+ "sass": "1.78.0",
54
54
  "ts-jest": "29.2.4",
55
55
  "typescript": "5.5.4"
56
56
  },
@@ -1,98 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-c15bd800.js');
4
- const _package = require('./package-69bba137.js');
5
- const fade = require('./fade-35a3633a.js');
6
- const index$1 = require('./index-01f30442.js');
7
- const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
8
-
9
- const ALERT_TYPES = ['primary', 'success', 'warning', 'danger', 'info', 'gray'];
10
-
11
- const postAlertCss = "/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */.alert-primary,.alert-success,.alert-warning,.alert-danger,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-warning,.alert-info,.alert-gray{--post-contrast-color:#000;--post-focus-color:#1976c8;--post-contrast-color-inverted:#fff;--post-gray-10:hsl(0, 0%, 90%);--post-gray-20:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-60:hsl(0, 0%, 40%);--post-gray-80:hsl(0, 0%, 20%);--post-yellow:#fc0;--post-white:#fff;--post-light:#faf9f8;--post-gray:#f4f3f1;--post-dark:hsl(0, 0%, 20%);--post-black:#000;--post-primary:hsl(0, 0%, 20%);--post-secondary:hsl(0, 0%, 40%);--post-success:#2c871d;--post-warning:#f49e00;--post-error:#a51728;--post-info:#cce4ee;--post-success-background:#c0debb;--post-warning-background:#fce2b2;--post-error-background:#ffdade;--post-nightblue:#004976;--post-nightblue-bright:#0076a8;--post-petrol:#006d68;--post-petrol-bright:#00968f;--post-coral:#9e2a2f;--post-coral-bright:#e03c31;--post-olive:#716135;--post-olive-bright:#aa9d2e;--post-purple:#80276c;--post-purple-bright:#c5299b;--post-aubergine:#523178;--post-aubergine-bright:#7566a0;--post-contrast-color-rgb:0, 0, 0;--post-contrast-color-inverted-rgb:255, 255, 255;--post-gray-10-rgb:230, 230, 230;--post-gray-20-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-60-rgb:102, 102, 102;--post-gray-80-rgb:51, 51, 51;--post-black-alpha-10-rgba:rgba(0, 0, 0, 0.1);--post-black-alpha-20-rgba:rgba(0, 0, 0, 0.2);--post-black-alpha-40-rgba:rgba(0, 0, 0, 0.4);--post-black-alpha-60-rgba:rgba(0, 0, 0, 0.6);--post-black-alpha-80-rgba:rgba(0, 0, 0, 0.8);--post-white-alpha-10-rgba:rgba(255, 255, 255, 0.1);--post-white-alpha-20-rgba:rgba(255, 255, 255, 0.2);--post-white-alpha-40-rgba:rgba(255, 255, 255, 0.4);--post-white-alpha-60-rgba:rgba(255, 255, 255, 0.6);--post-white-alpha-80-rgba:rgba(255, 255, 255, 0.8);--post-yellow-rgb:255, 204, 0;--post-white-rgb:255, 255, 255;--post-light-rgb:250, 249, 248;--post-gray-rgb:244, 243, 241;--post-dark-rgb:51, 51, 51;--post-black-rgb:0, 0, 0;--post-primary-rgb:51, 51, 51;--post-secondary-rgb:102, 102, 102;--post-success-rgb:44, 135, 29;--post-warning-rgb:244, 158, 0;--post-error-rgb:165, 23, 40;--post-info-rgb:204, 228, 238;--post-success-background-rgb:192, 222, 187;--post-warning-background-rgb:252, 226, 178;--post-error-background-rgb:255, 218, 222;--post-nightblue-rgb:0, 73, 118;--post-nightblue-bright-rgb:0, 118, 168;--post-petrol-rgb:0, 109, 104;--post-petrol-bright-rgb:0, 150, 143;--post-coral-rgb:158, 42, 47;--post-coral-bright-rgb:224, 60, 49;--post-olive-rgb:113, 97, 53;--post-olive-bright-rgb:170, 157, 46;--post-purple-rgb:128, 39, 108;--post-purple-bright-rgb:197, 41, 155;--post-aubergine-rgb:82, 49, 120;--post-aubergine-bright-rgb:117, 102, 160}.alert-primary,.alert-success,.alert-danger,.alert-notification,.alert-error{--post-contrast-color:#fff;--post-focus-color:#fff;--post-contrast-color-inverted:#000;--post-dark:#faf9f8;--post-light:hsl(0, 0%, 20%);--post-gray-80:hsl(0, 0%, 90%);--post-gray-60:hsl(0, 0%, 80%);--post-gray-40:hsl(0, 0%, 60%);--post-gray-20:hsl(0, 0%, 40%);--post-gray-10:hsl(0, 0%, 20%);--post-contrast-color-rgb:255, 255, 255;--post-contrast-color-inverted-rgb:0, 0, 0;--post-dark-rgb:250, 249, 248;--post-light-rgb:51, 51, 51;--post-gray-80-rgb:230, 230, 230;--post-gray-60-rgb:204, 204, 204;--post-gray-40-rgb:153, 153, 153;--post-gray-20-rgb:102, 102, 102;--post-gray-10-rgb:51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:400}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=\" pi-\"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=\" pi-\"].no-icon{background-image:none}.alert::before{content:\"\";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=\" pi-\"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=\" pi-\"]>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;border:2px solid CanvasText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media (min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media (max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action.no-icon>.alert-content{padding-inline-start:0}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn,.alert-action>.alert-buttons>::slotted(.btn){flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child,.alert-action>.alert-buttons>::slotted(.btn:first-child){margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media (min-width: 1440px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem);padding-inline-start:calc(\n (100% - 1439px) / 2 + 120px + 1.25rem + 3rem + 1.25rem\n );background-position-x:calc((100% - 1439px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(\n (100% - 1439px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem\n )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb:51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb:44, 135, 29}.alert-success:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c871d}.alert-warning{--post-bg-rgb:244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-danger{--post-bg-rgb:165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-info{--post-bg-rgb:204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb:244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb:51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb:165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=\" pi-\"])::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{outline-style:none !important;outline-offset:2px !important;outline-width:2px !important;outline-color:var(--post-focus-color) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:solid !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:solid !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:1.5rem;width:1.5rem}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.alert-primary,post-alert[type=primary],.alert-success,post-alert[type=success],.alert-danger,post-alert[type=danger],.alert-notification,post-alert[type=notification],.alert-error,post-alert[type=error]) .btn-close{color:var(--post-contrast-color)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption){position:absolute !important}.alert-heading>::slotted(h1){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h2){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h3){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h4){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h5){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h6){font-size:inherit !important;font-weight:inherit !important}";
12
- const PostAlertStyle0 = postAlertCss;
13
-
14
- const PostAlert = class {
15
- constructor(hostRef) {
16
- index.registerInstance(this, hostRef);
17
- this.postDismissed = index.createEvent(this, "postDismissed", 7);
18
- this.alertId = crypto.randomUUID();
19
- this.classes = undefined;
20
- this.hasActions = undefined;
21
- this.hasHeading = undefined;
22
- this.onDismissButtonClick = () => this.dismiss();
23
- this.dismissible = false;
24
- this.dismissLabel = undefined;
25
- this.fixed = false;
26
- this.icon = undefined;
27
- this.type = 'primary';
28
- }
29
- validateDismissible(isDismissible = this.dismissible) {
30
- index$1.checkType(isDismissible, 'boolean', 'The post-alert "dismissible" prop should be a boolean.');
31
- setTimeout(() => this.validateDismissLabel());
32
- }
33
- validateDismissLabel(dismissLabel = this.dismissLabel) {
34
- if (this.dismissible) {
35
- checkNonEmpty.checkNonEmpty(dismissLabel, 'Dismissible post-alert\'s require a "dismiss-label" prop.');
36
- }
37
- }
38
- validateFixed(isFixed = this.fixed) {
39
- index$1.checkType(isFixed, 'boolean', 'The post-alert "fixed" prop should be a boolean.');
40
- }
41
- validateIcon(icon = this.icon) {
42
- index$1.checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-alert "icon" prop should be a 4-digits string.');
43
- }
44
- validateType(type = this.type) {
45
- index$1.checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);
46
- }
47
- connectedCallback() {
48
- this.validateDismissible();
49
- this.validateFixed();
50
- this.validateIcon();
51
- this.validateType();
52
- }
53
- componentWillRender() {
54
- var _a;
55
- this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
56
- this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
57
- this.classes = `alert alert-${(_a = this.type) !== null && _a !== void 0 ? _a : 'primary'}`;
58
- if (this.dismissible)
59
- this.classes += ' alert-dismissible';
60
- if (this.hasActions)
61
- this.classes += ' alert-action';
62
- if (this.fixed)
63
- this.classes += ' alert-fixed-bottom';
64
- if (this.icon === 'none')
65
- this.classes += ' no-icon';
66
- }
67
- /**
68
- * Triggers alert dismissal programmatically (same as clicking on the close button (×)).
69
- */
70
- async dismiss() {
71
- const dismissal = fade.fadeOut(this.host);
72
- await dismissal.finished;
73
- this.host.remove();
74
- this.postDismissed.emit();
75
- }
76
- render() {
77
- const defaultAlertContent = [
78
- this.hasHeading && (index.h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, index.h("slot", { key: '928eeaedc9a897394ef064a218b43a780dc10f0d', name: "heading" }))),
79
- index.h("slot", { key: `${this.alertId}-message` }),
80
- ];
81
- const actionAlertContent = [
82
- index.h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
83
- index.h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, index.h("slot", { key: '67bcd576fb17374be6e0f9b3633a19aaff884b6a', name: "actions" })),
84
- ];
85
- return (index.h(index.Host, { key: 'df4452a660ba217ad57d5ad69ee224a686f5537e', "data-version": _package.version }, index.h("div", { key: 'f1d346826fee4629356c9e722ac619d9c7a34c17', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (index.h("button", { key: '0deb48cddffd2288dd4e2999f291179ca6cdc6b5', class: "btn-close", onClick: this.onDismissButtonClick }, index.h("span", { key: 'd252736e70ee4213d7c36e622181b640a8b3c4cb', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (index.h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions ? actionAlertContent : defaultAlertContent)));
86
- }
87
- get host() { return index.getElement(this); }
88
- static get watchers() { return {
89
- "dismissible": ["validateDismissible"],
90
- "dismissLabel": ["validateDismissLabel"],
91
- "fixed": ["validateFixed"],
92
- "icon": ["validateIcon"],
93
- "type": ["validateType"]
94
- }; }
95
- };
96
- PostAlert.style = PostAlertStyle0;
97
-
98
- exports.PostAlert = PostAlert;