@swisspost/design-system-components 7.4.1 → 7.4.2

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 (118) hide show
  1. package/dist/cjs/index.cjs.js +16 -16
  2. package/dist/cjs/{package-71dcbbc9.js → package-5113c92f.js} +1 -1
  3. package/dist/cjs/{post-accordion-2e943f0a.js → post-accordion-59af7fde.js} +1 -1
  4. package/dist/cjs/{post-accordion-item-d1fcd3f9.js → post-accordion-item-fada2164.js} +1 -1
  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-966b3652.js → post-alert-5b7f997f.js} +1 -1
  8. package/dist/cjs/post-alert.cjs.entry.js +2 -2
  9. package/dist/cjs/{post-card-control-e2cf1596.js → post-card-control-6f478acd.js} +1 -1
  10. package/dist/cjs/post-card-control.cjs.entry.js +2 -2
  11. package/dist/cjs/{post-collapsible-cff3bb05.js → post-collapsible-a91113c0.js} +1 -1
  12. package/dist/cjs/{post-collapsible-trigger-e5616d29.js → post-collapsible-trigger-f40101fa.js} +1 -1
  13. package/dist/cjs/post-collapsible-trigger.cjs.entry.js +2 -2
  14. package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
  15. package/dist/cjs/{post-icon-6985373c.js → post-icon-0def31ec.js} +1 -1
  16. package/dist/cjs/post-icon.cjs.entry.js +2 -2
  17. package/dist/cjs/{post-popover-1282c9b2.js → post-popover-be69c26e.js} +1 -1
  18. package/dist/cjs/post-popover.cjs.entry.js +2 -2
  19. package/dist/cjs/{post-popovercontainer-776f4985.js → post-popovercontainer-84f11eb0.js} +1 -1
  20. package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
  21. package/dist/cjs/{post-rating-98917b60.js → post-rating-41203973.js} +1 -1
  22. package/dist/cjs/post-rating.cjs.entry.js +2 -2
  23. package/dist/cjs/{post-tab-header-63ea6bb6.js → post-tab-header-c72b203a.js} +1 -1
  24. package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
  25. package/dist/cjs/{post-tab-panel-01d55249.js → post-tab-panel-90b73d39.js} +1 -1
  26. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  27. package/dist/cjs/{post-tabs-7ec0c376.js → post-tabs-d0792a69.js} +1 -1
  28. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  29. package/dist/cjs/{post-tag-92eaefd1.js → post-tag-24479b84.js} +2 -2
  30. package/dist/cjs/post-tag.cjs.entry.js +2 -2
  31. package/dist/cjs/{post-tooltip-69ba6116.js → post-tooltip-27257d27.js} +1 -1
  32. package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
  33. package/dist/collection/components/post-tag/post-tag.css +1 -1
  34. package/dist/components/package.js +1 -1
  35. package/dist/components/post-tag2.js +1 -1
  36. package/dist/docs.json +1 -1
  37. package/dist/esm/index.js +16 -16
  38. package/dist/esm/{package-130b6199.js → package-4ebb684c.js} +1 -1
  39. package/dist/esm/{post-accordion-01612666.js → post-accordion-e137e18d.js} +1 -1
  40. package/dist/esm/{post-accordion-item-e2e83306.js → post-accordion-item-f501f922.js} +1 -1
  41. package/dist/esm/post-accordion-item.entry.js +2 -2
  42. package/dist/esm/post-accordion.entry.js +2 -2
  43. package/dist/esm/{post-alert-e7b70927.js → post-alert-3848b25b.js} +1 -1
  44. package/dist/esm/post-alert.entry.js +2 -2
  45. package/dist/esm/{post-card-control-262467c4.js → post-card-control-f050bdb2.js} +1 -1
  46. package/dist/esm/post-card-control.entry.js +2 -2
  47. package/dist/esm/{post-collapsible-301ba5ad.js → post-collapsible-f94c17be.js} +1 -1
  48. package/dist/esm/{post-collapsible-trigger-964d5490.js → post-collapsible-trigger-c5d72506.js} +1 -1
  49. package/dist/esm/post-collapsible-trigger.entry.js +2 -2
  50. package/dist/esm/post-collapsible.entry.js +2 -2
  51. package/dist/esm/{post-icon-46602aa6.js → post-icon-020a3368.js} +1 -1
  52. package/dist/esm/post-icon.entry.js +2 -2
  53. package/dist/esm/{post-popover-927903a2.js → post-popover-286651d5.js} +1 -1
  54. package/dist/esm/post-popover.entry.js +2 -2
  55. package/dist/esm/{post-popovercontainer-348970cd.js → post-popovercontainer-7c524ae4.js} +1 -1
  56. package/dist/esm/post-popovercontainer.entry.js +2 -2
  57. package/dist/esm/{post-rating-a1832399.js → post-rating-cb5405d4.js} +1 -1
  58. package/dist/esm/post-rating.entry.js +2 -2
  59. package/dist/esm/{post-tab-header-9d6e4d52.js → post-tab-header-52a77cbb.js} +1 -1
  60. package/dist/esm/post-tab-header.entry.js +2 -2
  61. package/dist/esm/{post-tab-panel-0870e77c.js → post-tab-panel-78e67b03.js} +1 -1
  62. package/dist/esm/post-tab-panel.entry.js +2 -2
  63. package/dist/esm/{post-tabs-3b8719a9.js → post-tabs-ee13f6a6.js} +1 -1
  64. package/dist/esm/post-tabs.entry.js +2 -2
  65. package/dist/esm/{post-tag-695a9337.js → post-tag-12786e7a.js} +2 -2
  66. package/dist/esm/post-tag.entry.js +2 -2
  67. package/dist/esm/{post-tooltip-8486e928.js → post-tooltip-5bd9f7a5.js} +1 -1
  68. package/dist/esm/post-tooltip.entry.js +2 -2
  69. package/dist/post-components/index.esm.js +1 -1
  70. package/dist/post-components/p-14d08ad2.entry.js +1 -0
  71. package/dist/post-components/p-181b2e1d.entry.js +1 -0
  72. package/dist/post-components/p-280e70ba.entry.js +1 -0
  73. package/dist/post-components/p-31fb25df.entry.js +1 -0
  74. package/dist/post-components/{p-b91ff66f.js → p-332d13dd.js} +1 -1
  75. package/dist/post-components/{p-627e0231.js → p-46c46fc2.js} +1 -1
  76. package/dist/post-components/{p-acec5895.js → p-4cda601e.js} +1 -1
  77. package/dist/post-components/p-5e973a71.entry.js +1 -0
  78. package/dist/post-components/p-640d2005.entry.js +1 -0
  79. package/dist/post-components/{p-9828b437.js → p-64293798.js} +1 -1
  80. package/dist/post-components/{p-458d8198.js → p-6a544450.js} +1 -1
  81. package/dist/post-components/{p-0026e697.js → p-6fff6514.js} +1 -1
  82. package/dist/post-components/{p-50fdd908.js → p-75372e01.js} +1 -1
  83. package/dist/post-components/p-7edb781c.entry.js +1 -0
  84. package/dist/post-components/{p-c6e4522d.js → p-88b699bc.js} +1 -1
  85. package/dist/post-components/p-8a051cbb.entry.js +1 -0
  86. package/dist/post-components/p-9564622e.js +1 -0
  87. package/dist/post-components/{p-33dd9887.js → p-a2c37208.js} +1 -1
  88. package/dist/post-components/{p-811910a2.js → p-a832ad75.js} +1 -1
  89. package/dist/post-components/p-b2cdd6ad.entry.js +1 -0
  90. package/dist/post-components/p-b5e45a29.entry.js +1 -0
  91. package/dist/post-components/p-bcde3d69.entry.js +1 -0
  92. package/dist/post-components/p-c8630095.entry.js +1 -0
  93. package/dist/post-components/{p-3d1fd819.js → p-c921c283.js} +1 -1
  94. package/dist/post-components/p-db424922.entry.js +1 -0
  95. package/dist/post-components/p-e1c2d238.entry.js +1 -0
  96. package/dist/post-components/{p-feb6ff21.js → p-efdb344e.js} +1 -1
  97. package/dist/post-components/{p-49100c44.js → p-f17db01a.js} +1 -1
  98. package/dist/post-components/{p-a747b0b7.js → p-fa558703.js} +1 -1
  99. package/dist/post-components/{p-48fcde73.js → p-fd5a4c91.js} +1 -1
  100. package/dist/post-components/p-feef0573.entry.js +1 -0
  101. package/dist/post-components/post-components.esm.js +1 -1
  102. package/package.json +2 -2
  103. package/dist/post-components/p-4806190f.entry.js +0 -1
  104. package/dist/post-components/p-51bb8d8c.entry.js +0 -1
  105. package/dist/post-components/p-5bfe2065.entry.js +0 -1
  106. package/dist/post-components/p-5cdfdfed.entry.js +0 -1
  107. package/dist/post-components/p-6cac6cc0.entry.js +0 -1
  108. package/dist/post-components/p-6f325f35.entry.js +0 -1
  109. package/dist/post-components/p-7755c753.entry.js +0 -1
  110. package/dist/post-components/p-8386ab9c.js +0 -1
  111. package/dist/post-components/p-8dc5e169.entry.js +0 -1
  112. package/dist/post-components/p-b1b2f9ee.entry.js +0 -1
  113. package/dist/post-components/p-bb764dd3.entry.js +0 -1
  114. package/dist/post-components/p-bdc9668f.entry.js +0 -1
  115. package/dist/post-components/p-c860a676.entry.js +0 -1
  116. package/dist/post-components/p-e1456b01.entry.js +0 -1
  117. package/dist/post-components/p-f31d7fcb.entry.js +0 -1
  118. package/dist/post-components/p-f52a3908.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as a,c as r,h as t,H as o,g as s}from"./p-8c7f0075.js";import{v as e}from"./p-8386ab9c.js";import{f as b,a as c}from"./p-2737eaf5.js";const i=class{constructor(t){a(this,t),this.postChange=r(this,"postChange",7),this.isLoaded=!1,this.activePanel=void 0}get tabs(){return this.host.querySelectorAll("post-tab-header")}componentDidLoad(){this.moveMisplacedTabs(),this.enableTabs();const a=this.activePanel||this.tabs.item(0).panel;this.show(a),this.isLoaded=!0}async show(a){var r;if(a===(null===(r=this.activeTab)||void 0===r?void 0:r.panel))return;const t=this.activeTab,o=this.host.querySelector(`post-tab-header[panel=${a}]`);this.activateTab(o),this.showing&&(this.showing.effect.target.style.display="none",this.showing.finish()),!t||this.showing||this.hiding||this.hidePanel(t.panel),this.hiding&&await this.hiding.finished,this.showSelectedPanel(),this.showing&&await this.showing.finished,this.isLoaded&&this.postChange.emit(this.activeTab.panel)}moveMisplacedTabs(){this.tabs&&this.tabs.forEach((a=>{"tabs"!==a.getAttribute("slot")&&a.setAttribute("slot","tabs")}))}enableTabs(){this.tabs&&(this.tabs.forEach((async a=>{if(await a.componentOnReady(),a.getAttribute("aria-controls"))return;const r=this.getPanel(a.panel);a.setAttribute("aria-controls",r.id),r.setAttribute("aria-labelledby",a.id),a.addEventListener("click",(()=>{this.show(a.panel)})),a.addEventListener("keydown",(r=>{"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),this.show(a.panel))})),a.addEventListener("keydown",(({key:r})=>{"ArrowRight"!==r&&"ArrowLeft"!==r||this.navigateTabs(a,r)}))})),this.activeTab&&!this.activeTab.isConnected&&this.show(this.tabs.item(0).panel))}activateTab(a){this.activeTab&&(this.activeTab.setAttribute("aria-selected","false"),this.activeTab.setAttribute("tabindex","-1"),this.activeTab.classList.remove("active")),a.setAttribute("aria-selected","true"),a.setAttribute("tabindex","0"),a.classList.add("active"),this.activeTab=a}hidePanel(a){const r=this.getPanel(a);r&&(this.hiding=b(r),this.hiding.onfinish=()=>{r.style.display="none",this.hiding=null})}showSelectedPanel(){const a=this.getPanel(this.activeTab.panel);a.style.display="block",this.isLoaded&&(this.showing=c(a),this.showing.onfinish=()=>{this.showing=null})}getPanel(a){return this.host.querySelector(`post-tab-panel[name=${a}]`)}navigateTabs(a,r){const t=Array.from(this.tabs).indexOf(a);let o;o="ArrowRight"===r?this.tabs[t+1]||this.tabs[0]:this.tabs[t-1]||this.tabs[this.tabs.length-1],o&&o.focus()}render(){return t(o,{key:"365b2794cfb46631277341ea23afb2070c9d3ad1","data-version":e},t("div",{key:"70df13385ecc9c067527b80e2dd7b3a9b245e745",class:"tabs-wrapper",part:"tabs"},t("div",{key:"cae4d18aff0c890e0e8d76c1b8e321322abbeccd",class:"tabs",role:"tablist"},t("slot",{key:"2b6ca3e01e45e541950ddc2c1cdc680b28ea96b9",name:"tabs",onSlotchange:()=>this.enableTabs()}))),t("div",{key:"7352582d9c738af9b8bf3b71e0a153132fd23dcd",class:"tab-content",part:"content"},t("slot",{key:"4845c39bf9b9cbc42aa8689c7ae99cc2e75d7907",onSlotchange:()=>this.moveMisplacedTabs()})))}get host(){return s(this)}};i.style='.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}';export{i as P}
1
+ import{r as a,c as r,h as t,H as o,g as s}from"./p-8c7f0075.js";import{v as e}from"./p-9564622e.js";import{f as b,a as c}from"./p-2737eaf5.js";const i=class{constructor(t){a(this,t),this.postChange=r(this,"postChange",7),this.isLoaded=!1,this.activePanel=void 0}get tabs(){return this.host.querySelectorAll("post-tab-header")}componentDidLoad(){this.moveMisplacedTabs(),this.enableTabs();const a=this.activePanel||this.tabs.item(0).panel;this.show(a),this.isLoaded=!0}async show(a){var r;if(a===(null===(r=this.activeTab)||void 0===r?void 0:r.panel))return;const t=this.activeTab,o=this.host.querySelector(`post-tab-header[panel=${a}]`);this.activateTab(o),this.showing&&(this.showing.effect.target.style.display="none",this.showing.finish()),!t||this.showing||this.hiding||this.hidePanel(t.panel),this.hiding&&await this.hiding.finished,this.showSelectedPanel(),this.showing&&await this.showing.finished,this.isLoaded&&this.postChange.emit(this.activeTab.panel)}moveMisplacedTabs(){this.tabs&&this.tabs.forEach((a=>{"tabs"!==a.getAttribute("slot")&&a.setAttribute("slot","tabs")}))}enableTabs(){this.tabs&&(this.tabs.forEach((async a=>{if(await a.componentOnReady(),a.getAttribute("aria-controls"))return;const r=this.getPanel(a.panel);a.setAttribute("aria-controls",r.id),r.setAttribute("aria-labelledby",a.id),a.addEventListener("click",(()=>{this.show(a.panel)})),a.addEventListener("keydown",(r=>{"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),this.show(a.panel))})),a.addEventListener("keydown",(({key:r})=>{"ArrowRight"!==r&&"ArrowLeft"!==r||this.navigateTabs(a,r)}))})),this.activeTab&&!this.activeTab.isConnected&&this.show(this.tabs.item(0).panel))}activateTab(a){this.activeTab&&(this.activeTab.setAttribute("aria-selected","false"),this.activeTab.setAttribute("tabindex","-1"),this.activeTab.classList.remove("active")),a.setAttribute("aria-selected","true"),a.setAttribute("tabindex","0"),a.classList.add("active"),this.activeTab=a}hidePanel(a){const r=this.getPanel(a);r&&(this.hiding=b(r),this.hiding.onfinish=()=>{r.style.display="none",this.hiding=null})}showSelectedPanel(){const a=this.getPanel(this.activeTab.panel);a.style.display="block",this.isLoaded&&(this.showing=c(a),this.showing.onfinish=()=>{this.showing=null})}getPanel(a){return this.host.querySelector(`post-tab-panel[name=${a}]`)}navigateTabs(a,r){const t=Array.from(this.tabs).indexOf(a);let o;o="ArrowRight"===r?this.tabs[t+1]||this.tabs[0]:this.tabs[t-1]||this.tabs[this.tabs.length-1],o&&o.focus()}render(){return t(o,{key:"365b2794cfb46631277341ea23afb2070c9d3ad1","data-version":e},t("div",{key:"70df13385ecc9c067527b80e2dd7b3a9b245e745",class:"tabs-wrapper",part:"tabs"},t("div",{key:"cae4d18aff0c890e0e8d76c1b8e321322abbeccd",class:"tabs",role:"tablist"},t("slot",{key:"2b6ca3e01e45e541950ddc2c1cdc680b28ea96b9",name:"tabs",onSlotchange:()=>this.enableTabs()}))),t("div",{key:"7352582d9c738af9b8bf3b71e0a153132fd23dcd",class:"tab-content",part:"content"},t("slot",{key:"4845c39bf9b9cbc42aa8689c7ae99cc2e75d7907",onSlotchange:()=>this.moveMisplacedTabs()})))}get host(){return s(this)}};i.style='.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}';export{i as P}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as r,g as a}from"./p-8c7f0075.js";import{v as e}from"./p-8386ab9c.js";const o=class{constructor(i){t(this,i),this.postInput=s(this,"postInput",7),this.postChange=s(this,"postChange",7),this.hasChanged=!1,this.hoveredIndex=void 0,this.label="Rating",this.stars=5,this.currentRating=0,this.readonly=!1,this.keydownHandler=this.keydownHandler.bind(this),this.blurHandler=this.blurHandler.bind(this),this.hoverHandler=this.hoverHandler.bind(this)}update(t){this.readonly||t<0||t>this.stars||(this.currentRating=this.currentRating!==t?t:0,this.postInput.emit({value:this.currentRating}),this.hasChanged=!0)}keydownHandler(t){switch(t.key){case"ArrowDown":case"ArrowLeft":t.preventDefault(),this.update(this.currentRating-1);break;case"ArrowUp":case"ArrowRight":t.preventDefault(),this.update(this.currentRating+1);break;case"Home":t.preventDefault(),this.update(0);break;case"End":t.preventDefault(),this.update(this.stars);break;case"Enter":case" ":this.blurHandler();break;default:return}}blurHandler(){this.hasChanged&&(this.postChange.emit({value:this.currentRating}),this.hasChanged=!1)}hoverHandler(t,s){this.readonly||("mouseenter"===s.type?this.hoveredIndex=t:"mouseleave"===s.type&&(this.hoveredIndex=void 0))}render(){return i(r,{key:"b175b250377f4bf9be92ad05fb14f7e4a8f7c12f","data-version":e},i("div",{key:"b12eb5ff191d5a4ac5270845f120360f61e0fce0",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(((t,s)=>i("div",{key:`star-${t}`,"aria-hidden":"true",class:{star:!0,"before-hover":s<this.hoveredIndex,active:s<Math.round(this.currentRating),hover:s===this.hoveredIndex,"after-active":s>this.hoveredIndex&&s<this.currentRating},onClick:()=>this.update(s+1),onMouseEnter:t=>this.hoverHandler(s,t),onMouseLeave:t=>this.hoverHandler(s,t)},i("post-icon",{name:"2062",class:"stroke"}),i("post-icon",{name:"2574",class:"fill"}))))))}get host(){return a(this)}};o.style='/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}';export{o as P}
1
+ import{r as t,c as s,h as i,H as r,g as a}from"./p-8c7f0075.js";import{v as e}from"./p-9564622e.js";const o=class{constructor(i){t(this,i),this.postInput=s(this,"postInput",7),this.postChange=s(this,"postChange",7),this.hasChanged=!1,this.hoveredIndex=void 0,this.label="Rating",this.stars=5,this.currentRating=0,this.readonly=!1,this.keydownHandler=this.keydownHandler.bind(this),this.blurHandler=this.blurHandler.bind(this),this.hoverHandler=this.hoverHandler.bind(this)}update(t){this.readonly||t<0||t>this.stars||(this.currentRating=this.currentRating!==t?t:0,this.postInput.emit({value:this.currentRating}),this.hasChanged=!0)}keydownHandler(t){switch(t.key){case"ArrowDown":case"ArrowLeft":t.preventDefault(),this.update(this.currentRating-1);break;case"ArrowUp":case"ArrowRight":t.preventDefault(),this.update(this.currentRating+1);break;case"Home":t.preventDefault(),this.update(0);break;case"End":t.preventDefault(),this.update(this.stars);break;case"Enter":case" ":this.blurHandler();break;default:return}}blurHandler(){this.hasChanged&&(this.postChange.emit({value:this.currentRating}),this.hasChanged=!1)}hoverHandler(t,s){this.readonly||("mouseenter"===s.type?this.hoveredIndex=t:"mouseleave"===s.type&&(this.hoveredIndex=void 0))}render(){return i(r,{key:"b175b250377f4bf9be92ad05fb14f7e4a8f7c12f","data-version":e},i("div",{key:"b12eb5ff191d5a4ac5270845f120360f61e0fce0",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(((t,s)=>i("div",{key:`star-${t}`,"aria-hidden":"true",class:{star:!0,"before-hover":s<this.hoveredIndex,active:s<Math.round(this.currentRating),hover:s===this.hoveredIndex,"after-active":s>this.hoveredIndex&&s<this.currentRating},onClick:()=>this.update(s+1),onMouseEnter:t=>this.hoverHandler(s,t),onMouseLeave:t=>this.hoverHandler(s,t)},i("post-icon",{name:"2062",class:"stroke"}),i("post-icon",{name:"2574",class:"fill"}))))))}get host(){return a(this)}};o.style='/*!\n * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)\n * Copyright 2011-2021 The Bootstrap Authors\n * Copyright 2011-2021 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n\n * The MIT License (MIT)\n\n * Copyright (c) 2011-2020 Twitter, Inc.\n * Copyright (c) 2011-2020 The Bootstrap Authors\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *//*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 -0.25rem;border-radius:4px}.rating .star{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.active{--post-rating-star-stroke:hsl(0, 0%, 20%);--post-rating-star-fill:#fc0}.rating .star.hover{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:#fc0}.rating .star.after-active{--post-rating-star-stroke:hsl(0, 0%, 40%);--post-rating-star-fill:hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:2px;outline:2px solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:#fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke:hsl(0, 0%, 60%);--post-rating-star-fill:hsl(0, 0%, 90%)}';export{o as P}
@@ -0,0 +1 @@
1
+ export{P as post_icon}from"./p-c921c283.js";import"./p-8c7f0075.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";import"./p-9564622e.js";import"./p-b095519d.js";
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-8c7f0075.js";export{s as setNonce}from"./p-8c7f0075.js";import{g as l}from"./p-e1255160.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-b1b2f9ee",[[1,"post-accordion-item",{collapsed:[1028],headingLevel:[2,"heading-level"],id:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]],{headingLevel:["validateHeadingLevel"]}]]],["p-5bfe2065",[[1,"post-alert",{dismissible:[4],dismissLabel:[1,"dismiss-label"],fixed:[4],icon:[1],type:[1],alertId:[32],classes:[32],hasActions:[32],hasHeading:[32],onDismissButtonClick:[32],dismiss:[64]},null,{dismissible:["validateDismissible"],dismissLabel:["validateDismissLabel"],fixed:["validateFixed"],icon:["validateIcon"],type:["validateType"]}]]],["p-e1456b01",[[65,"post-card-control",{label:[1],description:[1],type:[1],name:[1],value:[1],checked:[1028],disabled:[1028],validity:[1025],icon:[1],focused:[32],reset:[64],groupReset:[64]},null,{label:["validateControlLabel"],type:["validateControlType"],checked:["updateControlChecked"],disabled:["updateControlDisbled"]}]]],["p-6cac6cc0",[[4,"post-popovercontainer",{placement:[1],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-51bb8d8c",[[1,"post-popover",{placement:[1],closeButtonCaption:[1,"close-button-caption"],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-4806190f",[[1,"post-rating",{label:[1],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]]],["p-f31d7fcb",[[1,"post-tag",{variant:[1],size:[1],icon:[1],classes:[32]},null,{variant:["variantChanged"],size:["sizeChanged"]}]]],["p-c860a676",[[1,"post-tooltip",{placement:[1],arrow:[4],delayed:[4],show:[64],hide:[64],toggle:[64]},null,{delayed:["validateDelayed"]}]]],["p-bdc9668f",[[1,"post-accordion",{headingLevel:[2,"heading-level"],multiple:[4],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:["validateHeadingLevel"]}]]],["p-6f325f35",[[0,"post-collapsible-trigger",{for:[1],update:[64]},[[4,"postToggle","setAriaExpanded"]],{for:["setAriaAttributes"]}]]],["p-8dc5e169",[[1,"post-tab-header",{panel:[1],tabId:[32]},null,{panel:["validateFor"]}]]],["p-7755c753",[[1,"post-tab-panel",{name:[1],panelId:[32]}]]],["p-f52a3908",[[1,"post-tabs",{activePanel:[1,"active-panel"],show:[64]}]]],["p-bb764dd3",[[1,"post-collapsible",{collapsed:[1028],toggle:[64]},null,{collapsed:["collapsedChange"]}]]],["p-5cdfdfed",[[1,"post-icon",{animation:[1],base:[1],flipH:[4,"flip-h"],flipV:[4,"flip-v"],name:[1],rotate:[2],scale:[2],svgStyles:[32],svgOutput:[32]},null,{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}]]]],e))));
1
+ import{p as e,b as a}from"./p-8c7f0075.js";export{s as setNonce}from"./p-8c7f0075.js";import{g as l}from"./p-e1255160.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await l(),a([["p-bcde3d69",[[1,"post-accordion-item",{collapsed:[1028],headingLevel:[2,"heading-level"],id:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]],{headingLevel:["validateHeadingLevel"]}]]],["p-7edb781c",[[1,"post-alert",{dismissible:[4],dismissLabel:[1,"dismiss-label"],fixed:[4],icon:[1],type:[1],alertId:[32],classes:[32],hasActions:[32],hasHeading:[32],onDismissButtonClick:[32],dismiss:[64]},null,{dismissible:["validateDismissible"],dismissLabel:["validateDismissLabel"],fixed:["validateFixed"],icon:["validateIcon"],type:["validateType"]}]]],["p-280e70ba",[[65,"post-card-control",{label:[1],description:[1],type:[1],name:[1],value:[1],checked:[1028],disabled:[1028],validity:[1025],icon:[1],focused:[32],reset:[64],groupReset:[64]},null,{label:["validateControlLabel"],type:["validateControlType"],checked:["updateControlChecked"],disabled:["updateControlDisbled"]}]]],["p-31fb25df",[[4,"post-popovercontainer",{placement:[1],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-e1c2d238",[[1,"post-popover",{placement:[1],closeButtonCaption:[1,"close-button-caption"],arrow:[4],show:[64],hide:[64],toggle:[64]}]]],["p-14d08ad2",[[1,"post-rating",{label:[1],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]]],["p-b2cdd6ad",[[1,"post-tag",{variant:[1],size:[1],icon:[1],classes:[32]},null,{variant:["variantChanged"],size:["sizeChanged"]}]]],["p-8a051cbb",[[1,"post-tooltip",{placement:[1],arrow:[4],delayed:[4],show:[64],hide:[64],toggle:[64]},null,{delayed:["validateDelayed"]}]]],["p-5e973a71",[[1,"post-accordion",{headingLevel:[2,"heading-level"],multiple:[4],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:["validateHeadingLevel"]}]]],["p-db424922",[[0,"post-collapsible-trigger",{for:[1],update:[64]},[[4,"postToggle","setAriaExpanded"]],{for:["setAriaAttributes"]}]]],["p-b5e45a29",[[1,"post-tab-header",{panel:[1],tabId:[32]},null,{panel:["validateFor"]}]]],["p-640d2005",[[1,"post-tab-panel",{name:[1],panelId:[32]}]]],["p-c8630095",[[1,"post-tabs",{activePanel:[1,"active-panel"],show:[64]}]]],["p-181b2e1d",[[1,"post-collapsible",{collapsed:[1028],toggle:[64]},null,{collapsed:["collapsedChange"]}]]],["p-feef0573",[[1,"post-icon",{animation:[1],base:[1],flipH:[4,"flip-h"],flipV:[4,"flip-v"],name:[1],rotate:[2],scale:[2],svgStyles:[32],svgOutput:[32]},null,{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}]]]],e))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "7.4.1",
3
+ "version": "7.4.2",
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",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@floating-ui/dom": "1.6.7",
27
27
  "@oddbird/popover-polyfill": "0.3.7",
28
- "@swisspost/design-system-styles": "7.4.1",
28
+ "@swisspost/design-system-styles": "7.4.2",
29
29
  "ally.js": "1.4.1",
30
30
  "long-press-event": "2.5.0"
31
31
  },
@@ -1 +0,0 @@
1
- export{P as post_rating}from"./p-48fcde73.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";
@@ -1 +0,0 @@
1
- export{P as post_popover}from"./p-b91ff66f.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-6adeaa6c.js";
@@ -1 +0,0 @@
1
- export{P as post_alert}from"./p-50fdd908.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-2737eaf5.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";import"./p-b095519d.js";
@@ -1 +0,0 @@
1
- export{P as post_icon}from"./p-3d1fd819.js";import"./p-8c7f0075.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";import"./p-8386ab9c.js";import"./p-b095519d.js";
@@ -1 +0,0 @@
1
- export{P as post_popovercontainer}from"./p-811910a2.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";
@@ -1 +0,0 @@
1
- export{P as post_collapsible_trigger}from"./p-627e0231.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-4a3f67ab.js";import"./p-b095519d.js";import"./p-440193f4.js";
@@ -1 +0,0 @@
1
- export{P as post_tab_panel}from"./p-9828b437.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";
@@ -1 +0,0 @@
1
- const o="7.4.1";export{o as v}
@@ -1 +0,0 @@
1
- export{P as post_tab_header}from"./p-c6e4522d.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-b095519d.js";import"./p-440193f4.js";
@@ -1 +0,0 @@
1
- export{P as post_accordion_item}from"./p-49100c44.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-247a1668.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";
@@ -1 +0,0 @@
1
- export{P as post_collapsible}from"./p-0026e697.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";
@@ -1 +0,0 @@
1
- export{P as post_accordion}from"./p-feb6ff21.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-247a1668.js";import"./p-611b3c41.js";
@@ -1 +0,0 @@
1
- export{P as post_tooltip}from"./p-458d8198.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-6adeaa6c.js";import"./p-ac500761.js";import"./p-440193f4.js";import"./p-611b3c41.js";import"./p-4a3f67ab.js";
@@ -1 +0,0 @@
1
- export{P as post_card_control}from"./p-acec5895.js";import"./p-8c7f0075.js";import"./p-611b3c41.js";import"./p-b095519d.js";import"./p-440193f4.js";import"./p-8386ab9c.js";
@@ -1 +0,0 @@
1
- export{P as post_tag}from"./p-33dd9887.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";
@@ -1 +0,0 @@
1
- export{P as post_tabs}from"./p-a747b0b7.js";import"./p-8c7f0075.js";import"./p-8386ab9c.js";import"./p-2737eaf5.js";