@florid-kit/components 0.10.21 → 0.10.23
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.
- package/components/side-panel.d.ts +1 -0
- package/index.js +9 -5
- package/index.mjs +20 -13
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@ export declare class OccitaneSidePanel extends LitElement {
|
|
|
33
33
|
showDetail: boolean;
|
|
34
34
|
isHidingDetail: boolean;
|
|
35
35
|
private previousFocusedElement;
|
|
36
|
+
private previousFocusedSelector;
|
|
36
37
|
static styles: import('lit').CSSResult;
|
|
37
38
|
static focusablesSelector: string;
|
|
38
39
|
static focusablesCustomElementsSelector: string;
|
package/index.js
CHANGED
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
.sr-only {
|
|
375
375
|
display: none;
|
|
376
376
|
}
|
|
377
|
-
`;R([a({type:String,reflect:!0})],B.prototype,"bgstyle",2);R([a({type:String,reflect:!0})],B.prototype,"size",2);R([a({type:String,reflect:!0})],B.prototype,"status",2);R([a({type:String,reflect:!0})],B.prototype,"type",2);R([a({type:String})],B.prototype,"strokewidth",2);R([a({type:String})],B.prototype,"icon",2);R([a({type:Boolean,reflect:!0})],B.prototype,"disabled",2);R([a({type:Boolean})],B.prototype,"showSrLabel",2);R([a({type:String})],B.prototype,"srLabel",2);B=R([b("o-icon-button")],B);var Ro=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,y=(o,t,e,n)=>{for(var i=n>1?void 0:n?Uo(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Ro(t,e,i),i};let p=class extends u{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!1,this.headerTitle="",this.headerTitleClassName="panel-title",this.labelDialog="",this.addToBagProductCount="",this.closeButtonLabel="Close the modal",this.goBackButtonLabel="Go back to",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.firstButtonProps={},this.onFirstButtonClickClose=!1,this.secondButtonLabel="",this.secondButtonVariant="secondary",this.secondButtonProps={},this.onSecondButtonClickClose=!1,this.disablePortal=!1,this.zIndex=99,this.initialized=!1,this.showDetail=!1,this.isHidingDetail=!1,this.previousFocusedElement=null,this._onOpenDetail=async o=>{var e,n;const t=((e=o.detail)==null?void 0:e.origin)??document.activeElement;if(this._detailOriginEl=t,this._detailOriginClass=(t==null?void 0:t.className)??"",this.showDetail=!0,this.showHeaderStartIcon=!0,await this.updateComplete,this._detailOriginClass){const i=(n=this.shadowRoot)==null?void 0:n.querySelector(".detail-view");i&&i.setAttribute("fromelement",this._detailOriginClass)}await this.focusDetailReturnBtn()},this._detailOriginEl=null,this._detailOriginClass="",this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))},this.handleClosePanel=o=>{if(o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" ")return;o.preventDefault(),o.stopPropagation();const t=o.currentTarget,e=(t==null?void 0:t.getAttribute("data-role"))==="back";if(this.showDetail&&e){this.isHidingDetail=!0;const n=this.renderRoot.querySelector(".content"),i=async()=>{this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1,await this.updateComplete,this._restoreFocusToOrigin()};if(n){this.showHeaderStartIcon=!1;const r=()=>{this.showDetail=!1,this.isHidingDetail=!1,n.removeEventListener("animationend",r),i()};n.addEventListener("animationend",r)}else this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1;return}this.closePanel()}}focusFirstInPanel(){var t,e,n;(n=this.getFocusableElements().map(i=>this.resolveFocusable(i)).filter(i=>!!i&&!i.hasAttribute("disabled"))[0]??((t=this.shadowRoot)==null?void 0:t.querySelector(".close-btn"))??((e=this.shadowRoot)==null?void 0:e.querySelector(".panel")))==null||n.focus({preventScroll:!0})}resolveFocusable(o){var e;const t=o.tagName.toLowerCase();return t==="o-icon-button"||t==="o-button"?((e=o.shadowRoot)==null?void 0:e.querySelector("button, .button"))??o:o}connectedCallback(){super.connectedCallback(),!this.disablePortal&&this.parentElement!==document.body&&document.body.appendChild(this),this.addEventListener("keydown",this.handleKeyDown),this.updateComplete.then(()=>{this.initialized=!0}),this.addEventListener("open-detail",this._onOpenDetail),this.addEventListener("focusin",o=>{o.composedPath()[0]===this&&this.focusFirstInPanel()})}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),this.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback(),this.removeEventListener("open-detail",this._onOpenDetail)}async focusDetailReturnBtn(){var i,r,s,c,h;await this.updateComplete;const o=this.getDeepActiveElement(document);if(o&&o!==document.body)try{o.blur()}catch{}await new Promise(requestAnimationFrame);const t=(i=this.shadowRoot)==null?void 0:i.querySelector(".detail-view .return-btn");if(!t)return;t.updateComplete&&await t.updateComplete,(c=(s=((r=t.shadowRoot)==null?void 0:r.querySelector("button"))??t)==null?void 0:s.focus)==null||c.call(s,{preventScroll:!0});const n=(h=this.shadowRoot)==null?void 0:h.querySelector('.panel[role="dialog"]');n&&n.setAttribute("aria-label",this.headerTitle)}_restoreFocusToOrigin(){var t,e;const o=this._detailOriginEl;!o||!document.contains(o)||((e=(t=document.activeElement)==null?void 0:t.blur)==null||e.call(t),requestAnimationFrame(()=>{var i;o.classList.add("a--tabfocus"),(((i=o.shadowRoot)==null?void 0:i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])'))??null??o).focus({preventScroll:!0})}))}getDeepActiveElement(o=this.shadowRoot){let t=o.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}trapFocus(o){var r;if(o.key!=="Tab")return;const t=this.shadowRoot;if(!t)return;const e=this.getDeepActiveElement();if(this.showDetail){const s=t.querySelector(".detail-view .return-btn"),c=t.querySelector(".detail-view .close-btn"),h=s?this.resolveFocusable(s):null,f=c?this.resolveFocusable(c):null;if(o.shiftKey&&h&&e===h&&f){o.preventDefault(),o.stopPropagation(),f.focus({preventScroll:!0});return}if(!o.shiftKey&&f&&e===f){o.preventDefault(),o.stopPropagation(),(((r=t.querySelector(".detail-scroller"))==null?void 0:r.querySelector(p.focusablesSelector))??h??f).focus({preventScroll:!0});return}}if(document.querySelector("#refineandsortpopin")){const s=t.querySelector(".close-btn"),c=s?this.resolveFocusable(s):null,h=t.querySelector(".js-clear-refinements"),f=h?this.resolveFocusable(h):null,x=g=>{o.preventDefault(),o.stopPropagation(),g.focus({preventScroll:!0})};if(c&&f){if(!o.shiftKey&&e===f)return x(c);if(o.shiftKey&&e===c)return x(f)}}const i=this.renderRoot.querySelector(".close-btn");if(!o.shiftKey&&i&&i.contains(e)){o.preventDefault();const s=this.renderRoot.querySelector(".o-whats-inside--content p");s==null||s.focus()}}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");if(!o)return[];function t(i){return!(i.disabled||i.hasAttribute("disabled")||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")==="-1")}function e(i){var s;const r=[i.matches(p.focusablesSelector)?i:[]];if(!["o-icon-button","o-button"].includes(i.tagName.toLowerCase())){const c=Array.from(i instanceof HTMLSlotElement?i.assignedElements({flatten:!0}):[]).filter(t).flatMap(e),h=Array.from(((s=i.shadowRoot)==null?void 0:s.querySelectorAll("*"))||[]).filter(t).flatMap(e);r.push(...c,...h)}return r.flat()}return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e)}openPanel(){this.removeAttribute("hidden"),this.getBoundingClientRect(),this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open");const o=this.renderRoot.querySelector(".panel");o&&o.setAttribute("aria-modal","true"),this.updateComplete.then(()=>{var
|
|
377
|
+
`;R([a({type:String,reflect:!0})],B.prototype,"bgstyle",2);R([a({type:String,reflect:!0})],B.prototype,"size",2);R([a({type:String,reflect:!0})],B.prototype,"status",2);R([a({type:String,reflect:!0})],B.prototype,"type",2);R([a({type:String})],B.prototype,"strokewidth",2);R([a({type:String})],B.prototype,"icon",2);R([a({type:Boolean,reflect:!0})],B.prototype,"disabled",2);R([a({type:Boolean})],B.prototype,"showSrLabel",2);R([a({type:String})],B.prototype,"srLabel",2);B=R([b("o-icon-button")],B);var Ro=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,y=(o,t,e,n)=>{for(var i=n>1?void 0:n?Uo(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Ro(t,e,i),i};let p=class extends u{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!1,this.headerTitle="",this.headerTitleClassName="panel-title",this.labelDialog="",this.addToBagProductCount="",this.closeButtonLabel="Close the modal",this.goBackButtonLabel="Go back to",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.firstButtonProps={},this.onFirstButtonClickClose=!1,this.secondButtonLabel="",this.secondButtonVariant="secondary",this.secondButtonProps={},this.onSecondButtonClickClose=!1,this.disablePortal=!1,this.zIndex=99,this.initialized=!1,this.showDetail=!1,this.isHidingDetail=!1,this.previousFocusedElement=null,this.previousFocusedSelector=null,this._onOpenDetail=async o=>{var e,n;const t=((e=o.detail)==null?void 0:e.origin)??document.activeElement;if(this._detailOriginEl=t,this._detailOriginClass=(t==null?void 0:t.className)??"",this.showDetail=!0,this.showHeaderStartIcon=!0,await this.updateComplete,this._detailOriginClass){const i=(n=this.shadowRoot)==null?void 0:n.querySelector(".detail-view");i&&i.setAttribute("fromelement",this._detailOriginClass)}await this.focusDetailReturnBtn()},this._detailOriginEl=null,this._detailOriginClass="",this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))},this.handleClosePanel=o=>{if(o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" ")return;o.preventDefault(),o.stopPropagation();const t=o.currentTarget,e=(t==null?void 0:t.getAttribute("data-role"))==="back";if(this.showDetail&&e){this.isHidingDetail=!0;const n=this.renderRoot.querySelector(".content"),i=async()=>{this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1,await this.updateComplete,this._restoreFocusToOrigin()};if(n){this.showHeaderStartIcon=!1;const r=()=>{this.showDetail=!1,this.isHidingDetail=!1,n.removeEventListener("animationend",r),i()};n.addEventListener("animationend",r)}else this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1;return}this.closePanel()}}focusFirstInPanel(){var t,e,n;(n=this.getFocusableElements().map(i=>this.resolveFocusable(i)).filter(i=>!!i&&!i.hasAttribute("disabled"))[0]??((t=this.shadowRoot)==null?void 0:t.querySelector(".close-btn"))??((e=this.shadowRoot)==null?void 0:e.querySelector(".panel")))==null||n.focus({preventScroll:!0})}resolveFocusable(o){var e;const t=o.tagName.toLowerCase();return t==="o-icon-button"||t==="o-button"?((e=o.shadowRoot)==null?void 0:e.querySelector("button, .button"))??o:o}connectedCallback(){super.connectedCallback(),!this.disablePortal&&this.parentElement!==document.body&&document.body.appendChild(this),this.addEventListener("keydown",this.handleKeyDown),this.updateComplete.then(()=>{this.initialized=!0}),this.addEventListener("open-detail",this._onOpenDetail),this.addEventListener("focusin",o=>{o.composedPath()[0]===this&&this.focusFirstInPanel()})}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),this.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback(),this.removeEventListener("open-detail",this._onOpenDetail)}async focusDetailReturnBtn(){var i,r,s,c,h;await this.updateComplete;const o=this.getDeepActiveElement(document);if(o&&o!==document.body)try{o.blur()}catch{}await new Promise(requestAnimationFrame);const t=(i=this.shadowRoot)==null?void 0:i.querySelector(".detail-view .return-btn");if(!t)return;t.updateComplete&&await t.updateComplete,(c=(s=((r=t.shadowRoot)==null?void 0:r.querySelector("button"))??t)==null?void 0:s.focus)==null||c.call(s,{preventScroll:!0});const n=(h=this.shadowRoot)==null?void 0:h.querySelector('.panel[role="dialog"]');n&&n.setAttribute("aria-label",this.headerTitle)}_restoreFocusToOrigin(){var t,e;const o=this._detailOriginEl;!o||!document.contains(o)||((e=(t=document.activeElement)==null?void 0:t.blur)==null||e.call(t),requestAnimationFrame(()=>{var i;o.classList.add("a--tabfocus"),(((i=o.shadowRoot)==null?void 0:i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])'))??null??o).focus({preventScroll:!0})}))}getDeepActiveElement(o=this.shadowRoot){let t=o.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}trapFocus(o){var r;if(o.key!=="Tab")return;const t=this.shadowRoot;if(!t)return;const e=this.getDeepActiveElement();if(this.showDetail){const s=t.querySelector(".detail-view .return-btn"),c=t.querySelector(".detail-view .close-btn"),h=s?this.resolveFocusable(s):null,f=c?this.resolveFocusable(c):null;if(o.shiftKey&&h&&e===h&&f){o.preventDefault(),o.stopPropagation(),f.focus({preventScroll:!0});return}if(!o.shiftKey&&f&&e===f){o.preventDefault(),o.stopPropagation(),(((r=t.querySelector(".detail-scroller"))==null?void 0:r.querySelector(p.focusablesSelector))??h??f).focus({preventScroll:!0});return}}if(document.querySelector("#refineandsortpopin")){const s=t.querySelector(".close-btn"),c=s?this.resolveFocusable(s):null,h=t.querySelector(".js-clear-refinements"),f=h?this.resolveFocusable(h):null,x=g=>{o.preventDefault(),o.stopPropagation(),g.focus({preventScroll:!0})};if(c&&f){if(!o.shiftKey&&e===f)return x(c);if(o.shiftKey&&e===c)return x(f)}}const i=this.renderRoot.querySelector(".close-btn");if(!o.shiftKey&&i&&i.contains(e)){o.preventDefault();const s=this.renderRoot.querySelector(".o-whats-inside--content p");s==null||s.focus()}}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");if(!o)return[];function t(i){return!(i.disabled||i.hasAttribute("disabled")||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")==="-1")}function e(i){var s;const r=[i.matches(p.focusablesSelector)?i:[]];if(!["o-icon-button","o-button"].includes(i.tagName.toLowerCase())){const c=Array.from(i instanceof HTMLSlotElement?i.assignedElements({flatten:!0}):[]).filter(t).flatMap(e),h=Array.from(((s=i.shadowRoot)==null?void 0:s.querySelectorAll("*"))||[]).filter(t).flatMap(e);r.push(...c,...h)}return r.flat()}return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e)}openPanel(){var t;this.removeAttribute("hidden"),this.getBoundingClientRect(),this.previousFocusedElement=document.activeElement,this.previousFocusedSelector=(t=this.previousFocusedElement)==null?void 0:t.getAttribute("paneltarget"),this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open");const o=this.renderRoot.querySelector(".panel");o&&o.setAttribute("aria-modal","true"),this.updateComplete.then(()=>{var e,n;if(this.showHeader){const i=(e=this.shadowRoot)==null?void 0:e.querySelector(".panel .close-btn"),r=this.resolveFocusable(i);(n=r==null?void 0:r.focus)==null||n.call(r,{preventScroll:!0})}else this.focusFirstInPanel()}),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))}closePanel(){var e,n,i;this.open=!1,this.showDetail=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel");let o=this.previousFocusedElement;o!=null&&o.isConnected||(o=document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)),(o==null?void 0:o.tagName.toLowerCase())==="o-button"?(i=(n=(e=o.shadowRoot)==null?void 0:e.querySelector(".button"))==null?void 0:n.focus)==null||i.call(n):o==null||o.focus();const t=this.renderRoot.querySelector(".panel");t&&t.removeAttribute("aria-modal"),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(o){o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),o.stopPropagation(),this.onFirstButtonClickClose&&this.closePanel(),this.dispatchEvent(new CustomEvent("firstbuttonclick",{bubbles:!0,composed:!0,cancelable:!0,detail:{button:"first",target:o.target}})))}handleSecondClick(o){o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),o.stopPropagation(),this.onSecondButtonClickClose&&this.closePanel(),this.dispatchEvent(new CustomEvent("secondbuttonclick",{bubbles:!0,composed:!0,cancelable:!0,detail:{button:"second",target:o.target}})))}updated(){this.style.setProperty("--z-overlay",`${this.zIndex||99}`),this.style.setProperty("--z-panel",`${this.zIndex?this.zIndex+1:99}`),this.open||setTimeout(()=>{this.setAttribute("hidden","hidden")},500)}render(){const o=this.showHeader?l`
|
|
378
378
|
<div tabindex="-1" class="header ${this.showDetail?"detail-view-header":""}">
|
|
379
379
|
${this.showHeaderStartIcon?l`
|
|
380
380
|
<o-icon-button
|
|
@@ -1280,7 +1280,7 @@
|
|
|
1280
1280
|
width: 0;
|
|
1281
1281
|
}
|
|
1282
1282
|
`;ot([a({type:Array})],F.prototype,"thumbnails",2);ot([a({type:Number})],F.prototype,"activeIndex",2);ot([a({type:Array})],F.prototype,"disabledIndexes",2);ot([a({type:String})],F.prototype,"maxWidth",2);ot([a({type:String})],F.prototype,"altressource",2);ot([a({type:Object})],F.prototype,"swiperInstance",2);ot([W()],F.prototype,"focusedIndex",2);F=ot([b("thumbnail-navigation")],F);var ti=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,te=(o,t,e,n)=>{for(var i=n>1?void 0:n?ei(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&ti(t,e,i),i};let wt=class extends u{constructor(){super(...arguments),this.type="",this.bgstyle="background-white"}render(){return l`
|
|
1283
|
-
<
|
|
1283
|
+
<p class="tag ${this.bgstyle}"><slot></slot></p>
|
|
1284
1284
|
`}};wt.styles=v`
|
|
1285
1285
|
.tag {
|
|
1286
1286
|
display: inline-block;
|
|
@@ -1306,6 +1306,7 @@
|
|
|
1306
1306
|
|
|
1307
1307
|
:host([type$="stock"]) .tag {
|
|
1308
1308
|
padding-left: var(--spacing-2-xl);
|
|
1309
|
+
margin: var(--spacing-4-xs);
|
|
1309
1310
|
}
|
|
1310
1311
|
|
|
1311
1312
|
:host([type$="stock"]) .tag::before {
|
|
@@ -1334,6 +1335,7 @@
|
|
|
1334
1335
|
overflow: hidden;
|
|
1335
1336
|
white-space: nowrap;
|
|
1336
1337
|
text-overflow: ellipsis;
|
|
1338
|
+
margin: var(--spacing-4-xs);
|
|
1337
1339
|
|
|
1338
1340
|
&::first-letter {
|
|
1339
1341
|
text-transform: uppercase;
|
|
@@ -2764,7 +2766,7 @@
|
|
|
2764
2766
|
margin: var(--spacing-4-xs);
|
|
2765
2767
|
padding: var(--spacing-4-xs);
|
|
2766
2768
|
}
|
|
2767
|
-
`;qt=Ii([b("o-breadcrumbs")],qt);var Di=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,re=(o,t,e,n)=>{for(var i=n>1?void 0:n?Hi(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Di(t,e,i),i};let St=class extends u{constructor(){super(...arguments),this.href="",this.active=!1}_handleClick(o){(!this.href||this.href==="#")&&o.preventDefault()}render(){return this.active?l`<
|
|
2769
|
+
`;qt=Ii([b("o-breadcrumbs")],qt);var Di=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,re=(o,t,e,n)=>{for(var i=n>1?void 0:n?Hi(t,e):t,r=o.length-1,s;r>=0;r--)(s=o[r])&&(i=(n?s(t,e,i):s(i))||i);return n&&i&&Di(t,e,i),i};let St=class extends u{constructor(){super(...arguments),this.href="",this.active=!1}_handleClick(o){(!this.href||this.href==="#")&&o.preventDefault()}render(){return this.active?l`<p aria-current="page"><slot></slot></p>`:l`
|
|
2768
2770
|
<li>
|
|
2769
2771
|
<a
|
|
2770
2772
|
href="${this.href}"
|
|
@@ -2782,8 +2784,10 @@
|
|
|
2782
2784
|
}
|
|
2783
2785
|
|
|
2784
2786
|
:host([active]) {
|
|
2785
|
-
|
|
2787
|
+
p {
|
|
2786
2788
|
color: var(--color-content-body);
|
|
2789
|
+
margin: var(--spacing-4-xs);
|
|
2790
|
+
display: inline-block;
|
|
2787
2791
|
}
|
|
2788
2792
|
}
|
|
2789
2793
|
|
|
@@ -2791,7 +2795,7 @@
|
|
|
2791
2795
|
display: inline-block;
|
|
2792
2796
|
}
|
|
2793
2797
|
|
|
2794
|
-
a,
|
|
2798
|
+
a, p {
|
|
2795
2799
|
color: var(--color-content-description);
|
|
2796
2800
|
font-family: var(--font-family-loccitane-sans);
|
|
2797
2801
|
font-size: var(--font-size-100);
|
package/index.mjs
CHANGED
|
@@ -1310,7 +1310,7 @@ var Ro = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, y = (o, t,
|
|
|
1310
1310
|
};
|
|
1311
1311
|
let p = class extends u {
|
|
1312
1312
|
constructor() {
|
|
1313
|
-
super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this._onOpenDetail = async (o) => {
|
|
1313
|
+
super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._onOpenDetail = async (o) => {
|
|
1314
1314
|
var e, n;
|
|
1315
1315
|
const t = ((e = o.detail) == null ? void 0 : e.origin) ?? document.activeElement;
|
|
1316
1316
|
if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
|
|
@@ -1451,13 +1451,14 @@ let p = class extends u {
|
|
|
1451
1451
|
return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e);
|
|
1452
1452
|
}
|
|
1453
1453
|
openPanel() {
|
|
1454
|
-
|
|
1454
|
+
var t;
|
|
1455
|
+
this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (t = this.previousFocusedElement) == null ? void 0 : t.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
|
|
1455
1456
|
const o = this.renderRoot.querySelector(".panel");
|
|
1456
1457
|
o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(() => {
|
|
1457
|
-
var
|
|
1458
|
+
var e, n;
|
|
1458
1459
|
if (this.showHeader) {
|
|
1459
|
-
const
|
|
1460
|
-
(
|
|
1460
|
+
const i = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".panel .close-btn"), r = this.resolveFocusable(i);
|
|
1461
|
+
(n = r == null ? void 0 : r.focus) == null || n.call(r, { preventScroll: !0 });
|
|
1461
1462
|
} else
|
|
1462
1463
|
this.focusFirstInPanel();
|
|
1463
1464
|
}), this.dispatchEvent(
|
|
@@ -1465,10 +1466,12 @@ let p = class extends u {
|
|
|
1465
1466
|
);
|
|
1466
1467
|
}
|
|
1467
1468
|
closePanel() {
|
|
1468
|
-
var
|
|
1469
|
-
this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel")
|
|
1470
|
-
|
|
1471
|
-
o && o.
|
|
1469
|
+
var e, n, i;
|
|
1470
|
+
this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
|
|
1471
|
+
let o = this.previousFocusedElement;
|
|
1472
|
+
o != null && o.isConnected || (o = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (o == null ? void 0 : o.tagName.toLowerCase()) === "o-button" ? (i = (n = (e = o.shadowRoot) == null ? void 0 : e.querySelector(".button")) == null ? void 0 : n.focus) == null || i.call(n) : o == null || o.focus();
|
|
1473
|
+
const t = this.renderRoot.querySelector(".panel");
|
|
1474
|
+
t && t.removeAttribute("aria-modal"), this.dispatchEvent(
|
|
1472
1475
|
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
1473
1476
|
);
|
|
1474
1477
|
}
|
|
@@ -2827,7 +2830,7 @@ let wt = class extends u {
|
|
|
2827
2830
|
}
|
|
2828
2831
|
render() {
|
|
2829
2832
|
return l`
|
|
2830
|
-
<
|
|
2833
|
+
<p class="tag ${this.bgstyle}"><slot></slot></p>
|
|
2831
2834
|
`;
|
|
2832
2835
|
}
|
|
2833
2836
|
};
|
|
@@ -2856,6 +2859,7 @@ wt.styles = v`
|
|
|
2856
2859
|
|
|
2857
2860
|
:host([type$="stock"]) .tag {
|
|
2858
2861
|
padding-left: var(--spacing-2-xl);
|
|
2862
|
+
margin: var(--spacing-4-xs);
|
|
2859
2863
|
}
|
|
2860
2864
|
|
|
2861
2865
|
:host([type$="stock"]) .tag::before {
|
|
@@ -2884,6 +2888,7 @@ wt.styles = v`
|
|
|
2884
2888
|
overflow: hidden;
|
|
2885
2889
|
white-space: nowrap;
|
|
2886
2890
|
text-overflow: ellipsis;
|
|
2891
|
+
margin: var(--spacing-4-xs);
|
|
2887
2892
|
|
|
2888
2893
|
&::first-letter {
|
|
2889
2894
|
text-transform: uppercase;
|
|
@@ -5111,7 +5116,7 @@ let St = class extends u {
|
|
|
5111
5116
|
(!this.href || this.href === "#") && o.preventDefault();
|
|
5112
5117
|
}
|
|
5113
5118
|
render() {
|
|
5114
|
-
return this.active ? l`<
|
|
5119
|
+
return this.active ? l`<p aria-current="page"><slot></slot></p>` : l`
|
|
5115
5120
|
<li>
|
|
5116
5121
|
<a
|
|
5117
5122
|
href="${this.href}"
|
|
@@ -5132,8 +5137,10 @@ St.styles = v`
|
|
|
5132
5137
|
}
|
|
5133
5138
|
|
|
5134
5139
|
:host([active]) {
|
|
5135
|
-
|
|
5140
|
+
p {
|
|
5136
5141
|
color: var(--color-content-body);
|
|
5142
|
+
margin: var(--spacing-4-xs);
|
|
5143
|
+
display: inline-block;
|
|
5137
5144
|
}
|
|
5138
5145
|
}
|
|
5139
5146
|
|
|
@@ -5141,7 +5148,7 @@ St.styles = v`
|
|
|
5141
5148
|
display: inline-block;
|
|
5142
5149
|
}
|
|
5143
5150
|
|
|
5144
|
-
a,
|
|
5151
|
+
a, p {
|
|
5145
5152
|
color: var(--color-content-description);
|
|
5146
5153
|
font-family: var(--font-family-loccitane-sans);
|
|
5147
5154
|
font-size: var(--font-size-100);
|