@florid-kit/components 0.10.11 → 0.10.12
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 +46 -11
- package/index.mjs +76 -38
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const Lt=globalThis,
|
|
5
|
+
*/const Lt=globalThis,Vt=Lt.ShadowRoot&&(Lt.ShadyCSS===void 0||Lt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Zt=Symbol(),le=new WeakMap;let xe=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Zt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Vt&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=le.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&le.set(e,t))}return t}toString(){return this.cssText}};const Ae=o=>new xe(typeof o=="string"?o:o+"",void 0,Zt),f=(o,...t)=>{const e=o.length===1?o[0]:t.reduce((r,i,n)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1],o[0]);return new xe(e,o,Zt)},Le=(o,t)=>{if(Vt)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const r=document.createElement("style"),i=Lt.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=e.cssText,o.appendChild(r)}},ce=Vt?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return Ae(e)})(o):o;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const gt=globalThis,Bt=gt.trustedTypes,pe=Bt?Bt.createPolicy("lit-html",{createHTML:o=>o}):void 0,we="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,$e="?"+J,Te=`<${$e}>`,st=document,yt=()=>st.createComment(""),mt=o=>o===null||typeof o!="object"&&typeof o!="function",Wt=Array.isArray,Me=o=>Wt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Tt=`[
|
|
14
14
|
\f\r]`,ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ue=/-->/g,fe=/>/g,it=RegExp(`>|${Tt}(?:([^\\s"'>=/]+)(${Tt}*=${Tt}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ve=/'/g,ge=/"/g,ke=/^(?:script|style|textarea|title)$/i,je=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),l=je(1),tt=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),be=new WeakMap,rt=st.createTreeWalker(st,129);function _e(o,t){if(!Wt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return pe!==void 0?pe.createHTML(t):t}const Fe=(o,t)=>{const e=o.length-1,r=[];let i,n=t===2?"<svg>":t===3?"<math>":"",s=ft;for(let c=0;c<e;c++){const h=o[c];let w,_,v=-1,
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ve=/'/g,ge=/"/g,ke=/^(?:script|style|textarea|title)$/i,je=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),l=je(1),tt=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),be=new WeakMap,rt=st.createTreeWalker(st,129);function _e(o,t){if(!Wt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return pe!==void 0?pe.createHTML(t):t}const Fe=(o,t)=>{const e=o.length-1,r=[];let i,n=t===2?"<svg>":t===3?"<math>":"",s=ft;for(let c=0;c<e;c++){const h=o[c];let w,_,v=-1,V=0;for(;V<h.length&&(s.lastIndex=V,_=s.exec(h),_!==null);)V=s.lastIndex,s===ft?_[1]==="!--"?s=ue:_[1]!==void 0?s=fe:_[2]!==void 0?(ke.test(_[2])&&(i=RegExp("</"+_[2],"g")),s=it):_[3]!==void 0&&(s=it):s===it?_[0]===">"?(s=i??ft,v=-1):_[1]===void 0?v=-2:(v=s.lastIndex-_[2].length,w=_[1],s=_[3]===void 0?it:_[3]==='"'?ge:ve):s===ge||s===ve?s=it:s===ue||s===fe?s=ft:(s=it,i=void 0);const Y=s===it&&o[c+1].startsWith("/>")?" ":"";n+=s===ft?h+Te:v>=0?(r.push(w),h.slice(0,v)+we+h.slice(v)+J+Y):h+J+(v===-2?c:Y)}return[_e(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class xt{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let n=0,s=0;const c=t.length-1,h=this.parts,[w,_]=Fe(t,e);if(this.el=xt.createElement(w,r),rt.currentNode=this.el.content,e===2||e===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(i=rt.nextNode())!==null&&h.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const v of i.getAttributeNames())if(v.endsWith(we)){const V=_[s++],Y=i.getAttribute(v).split(J),At=/([.?@])?(.*)/.exec(V);h.push({type:1,index:n,name:At[2],strings:Y,ctor:At[1]==="."?Ue:At[1]==="?"?Ne:At[1]==="@"?qe:Ot}),i.removeAttribute(v)}else v.startsWith(J)&&(h.push({type:6,index:n}),i.removeAttribute(v));if(ke.test(i.tagName)){const v=i.textContent.split(J),V=v.length-1;if(V>0){i.textContent=Bt?Bt.emptyScript:"";for(let Y=0;Y<V;Y++)i.append(v[Y],yt()),rt.nextNode(),h.push({type:2,index:++n});i.append(v[V],yt())}}}else if(i.nodeType===8)if(i.data===$e)h.push({type:2,index:n});else{let v=-1;for(;(v=i.data.indexOf(J,v+1))!==-1;)h.push({type:7,index:n}),v+=J.length-1}n++}}static createElement(t,e){const r=st.createElement("template");return r.innerHTML=t,r}}function ht(o,t,e=o,r){var s,c;if(t===tt)return t;let i=r!==void 0?(s=e._$Co)==null?void 0:s[r]:e._$Cl;const n=mt(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((c=i==null?void 0:i._$AO)==null||c.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=ht(o,i._$AS(o,t.values),i,r)),t}class Re{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??st).importNode(e,!0);rt.currentNode=i;let n=rt.nextNode(),s=0,c=0,h=r[0];for(;h!==void 0;){if(s===h.index){let w;h.type===2?w=new Et(n,n.nextSibling,this,t):h.type===1?w=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(w=new Ve(n,this,t)),this._$AV.push(w),h=r[++c]}s!==(h==null?void 0:h.index)&&(n=rt.nextNode(),s++)}return rt.currentNode=st,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Et{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ht(this,t,e),mt(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==tt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Me(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&mt(this._$AH)?this._$AA.nextSibling.data=t:this.T(st.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=xt.createElement(_e(r.h,r.h[0]),this.options)),r);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const s=new Re(i,this),c=s.u(this.options);s.p(e),this.T(c),this._$AH=s}}_$AC(t){let e=be.get(t.strings);return e===void 0&&be.set(t.strings,e=new xt(t)),e}k(t){Wt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const n of t)i===e.length?e.push(r=new Et(this.O(yt()),this.O(yt()),this,this.options)):r=e[i],r._$AI(n),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(t,e=this,r,i){const n=this.strings;let s=!1;if(n===void 0)t=ht(this,t,e,0),s=!mt(t)||t!==this._$AH&&t!==tt,s&&(this._$AH=t);else{const c=t;let h,w;for(t=n[0],h=0;h<n.length-1;h++)w=ht(this,c[r+h],e,h),w===tt&&(w=this._$AH[h]),s||(s=!mt(w)||w!==this._$AH[h]),w===d?t=d:t!==d&&(t+=(w??"")+n[h+1]),this._$AH[h]=w}s&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ue extends Ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Ne extends Ot{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class qe extends Ot{constructor(t,e,r,i,n){super(t,e,r,i,n),this.type=5}_$AI(t,e=this){if((t=ht(this,t,e,0)??d)===tt)return;const r=this._$AH,i=t===d&&r!==d||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,n=t!==d&&(r===d||i);i&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Ve{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){ht(this,t)}}const Mt=gt.litHtmlPolyfillSupport;Mt==null||Mt(xt,Et),(gt.litHtmlVersions??(gt.litHtmlVersions=[])).push("3.3.0");const Ze=(o,t,e)=>{const r=(e==null?void 0:e.renderBefore)??t;let i=r._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;r._$litPart$=i=new Et(t.insertBefore(yt(),n),n,void 0,e??{})}return i._$AI(o),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
.sr-only {
|
|
404
404
|
display: none;
|
|
405
405
|
}
|
|
406
|
-
`;F([a({type:String,reflect:!0})],B.prototype,"bgstyle",2);F([a({type:String,reflect:!0})],B.prototype,"size",2);F([a({type:String,reflect:!0})],B.prototype,"status",2);F([a({type:String,reflect:!0})],B.prototype,"type",2);F([a({type:String})],B.prototype,"strokewidth",2);F([a({type:String})],B.prototype,"icon",2);F([a({type:Boolean,reflect:!0})],B.prototype,"disabled",2);F([a({type:Boolean})],B.prototype,"showSrLabel",2);F([a({type:String})],B.prototype,"srLabel",2);B=F([g("o-icon-button")],B);var Ro=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,b=(o,t,e,r)=>{for(var i=r>1?void 0:r?Uo(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Ro(t,e,i),i};let u=class extends p{constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.showHeaderStartIcon=!1,this.headerTitle="",this.headerTitleClassName="panel-title",this.labelDialog="",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,r;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=(r=this.shadowRoot)==null?void 0:r.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 r=this.renderRoot.querySelector(".content"),i=async()=>{this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1,await this.updateComplete,this._restoreFocusToOrigin()};if(r){this.showHeaderStartIcon=!1;const n=()=>{this.showDetail=!1,this.isHidingDetail=!1,r.removeEventListener("animationend",n),i()};r.addEventListener("animationend",n)}else this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1;return}this.closePanel()}}focusFirstInPanel(){var t,e,r;(r=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||r.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,n,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=((n=t.shadowRoot)==null?void 0:n.querySelector("button"))??t)==null?void 0:s.focus)==null||c.call(s,{preventScroll:!0});const r=(h=this.shadowRoot)==null?void 0:h.querySelector('.panel[role="dialog"]');r&&r.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){if(o.key!=="Tab")return;const t=this.getDeepActiveElement(),e=this.renderRoot.querySelector(".close-btn");if(!o.shiftKey&&e&&e.contains(t)){o.preventDefault();const r=this.renderRoot.querySelector(".o-whats-inside--content p");r==null||r.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 n=[i.matches(u.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);n.push(...c,...h)}return n.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 t,e;if(this.showHeader){const r=(t=this.shadowRoot)==null?void 0:t.querySelector(".panel .close-btn"),i=this.resolveFocusable(r);(e=i==null?void 0:i.focus)==null||e.call(i,{preventScroll:!0})}else this.focusFirstInPanel()}),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))}closePanel(){var t,e,r,i,n;this.open=!1,this.showDetail=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),((t=this.previousFocusedElement)==null?void 0:t.tagName.toLowerCase())==="o-button"?(i=(r=(e=this.previousFocusedElement.shadowRoot)==null?void 0:e.querySelector(".button"))==null?void 0:r.focus)==null||i.call(r):(n=this.previousFocusedElement)==null||n.focus();const o=this.renderRoot.querySelector(".panel");o&&o.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`
|
|
406
|
+
`;F([a({type:String,reflect:!0})],B.prototype,"bgstyle",2);F([a({type:String,reflect:!0})],B.prototype,"size",2);F([a({type:String,reflect:!0})],B.prototype,"status",2);F([a({type:String,reflect:!0})],B.prototype,"type",2);F([a({type:String})],B.prototype,"strokewidth",2);F([a({type:String})],B.prototype,"icon",2);F([a({type:Boolean,reflect:!0})],B.prototype,"disabled",2);F([a({type:Boolean})],B.prototype,"showSrLabel",2);F([a({type:String})],B.prototype,"srLabel",2);B=F([g("o-icon-button")],B);var Ro=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,b=(o,t,e,r)=>{for(var i=r>1?void 0:r?Uo(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Ro(t,e,i),i};let u=class extends p{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,r;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=(r=this.shadowRoot)==null?void 0:r.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 r=this.renderRoot.querySelector(".content"),i=async()=>{this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1,await this.updateComplete,this._restoreFocusToOrigin()};if(r){this.showHeaderStartIcon=!1;const n=()=>{this.showDetail=!1,this.isHidingDetail=!1,r.removeEventListener("animationend",n),i()};r.addEventListener("animationend",n)}else this.showDetail=!1,this.isHidingDetail=!1,this.showHeaderStartIcon=!1;return}this.closePanel()}}focusFirstInPanel(){var t,e,r;(r=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||r.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,n,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=((n=t.shadowRoot)==null?void 0:n.querySelector("button"))??t)==null?void 0:s.focus)==null||c.call(s,{preventScroll:!0});const r=(h=this.shadowRoot)==null?void 0:h.querySelector('.panel[role="dialog"]');r&&r.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){if(o.key!=="Tab")return;const t=this.getDeepActiveElement(),e=this.renderRoot.querySelector(".close-btn");if(!o.shiftKey&&e&&e.contains(t)){o.preventDefault();const r=this.renderRoot.querySelector(".o-whats-inside--content p");r==null||r.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 n=[i.matches(u.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);n.push(...c,...h)}return n.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 t,e;if(this.showHeader){const r=(t=this.shadowRoot)==null?void 0:t.querySelector(".panel .close-btn"),i=this.resolveFocusable(r);(e=i==null?void 0:i.focus)==null||e.call(i,{preventScroll:!0})}else this.focusFirstInPanel()}),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))}closePanel(){var t,e,r,i,n;this.open=!1,this.showDetail=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),((t=this.previousFocusedElement)==null?void 0:t.tagName.toLowerCase())==="o-button"?(i=(r=(e=this.previousFocusedElement.shadowRoot)==null?void 0:e.querySelector(".button"))==null?void 0:r.focus)==null||i.call(r):(n=this.previousFocusedElement)==null||n.focus();const o=this.renderRoot.querySelector(".panel");o&&o.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`
|
|
407
407
|
<div tabindex="-1" class="header ${this.showDetail?"detail-view-header":""}">
|
|
408
408
|
${this.showHeaderStartIcon?l`
|
|
409
409
|
<o-icon-button
|
|
@@ -418,9 +418,12 @@
|
|
|
418
418
|
showsrlabel="true"
|
|
419
419
|
></o-icon-button>
|
|
420
420
|
`:null}
|
|
421
|
+
<div class="header-title-container" >
|
|
421
422
|
<p role="heading" aria-level="1" id="panel-title" class="${this.headerTitleClassName}">
|
|
422
423
|
${this.headerTitle}
|
|
423
424
|
</p>
|
|
425
|
+
${this.addToBagProductCount?l`<span class="a-quantity">${this.addToBagProductCount}</span>`:null}
|
|
426
|
+
</div>
|
|
424
427
|
<o-icon-button
|
|
425
428
|
icon="cross"
|
|
426
429
|
size="small"
|
|
@@ -429,7 +432,7 @@
|
|
|
429
432
|
@click=${this.handleClosePanel}
|
|
430
433
|
@keydown=${this.handleClosePanel}
|
|
431
434
|
srlabel="${this.closeButtonLabel}"
|
|
432
|
-
showsrlabel
|
|
435
|
+
?showsrlabel=${!0}
|
|
433
436
|
></o-icon-button>
|
|
434
437
|
</div>
|
|
435
438
|
`:null;return l`
|
|
@@ -553,10 +556,20 @@
|
|
|
553
556
|
.header {
|
|
554
557
|
flex: 0 0 auto;
|
|
555
558
|
display: flex;
|
|
556
|
-
|
|
559
|
+
align-items: center;
|
|
560
|
+
gap: 8px;
|
|
557
561
|
padding: 20px 16px;
|
|
558
562
|
border-bottom: var(--border-050) solid var(--color-border-tertiary);
|
|
559
563
|
|
|
564
|
+
.header-title-container {
|
|
565
|
+
display: flex;
|
|
566
|
+
flex-direction: row;
|
|
567
|
+
align-items: center;
|
|
568
|
+
column-gap: 8px;
|
|
569
|
+
flex: 1 1 auto;
|
|
570
|
+
min-width: 0;
|
|
571
|
+
}
|
|
572
|
+
|
|
560
573
|
.panel-title {
|
|
561
574
|
font-family: var(--font-family-loccitane-serif);
|
|
562
575
|
font-size: var(--font-size);
|
|
@@ -570,8 +583,29 @@
|
|
|
570
583
|
margin-top: auto;
|
|
571
584
|
margin-bottom: auto;
|
|
572
585
|
overflow: hidden;
|
|
573
|
-
|
|
586
|
+
padding-right: 6px;
|
|
574
587
|
color: var(--color-content-heading);
|
|
588
|
+
flex: 0 1 auto;
|
|
589
|
+
max-width: 100%;
|
|
590
|
+
min-width: 0;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.a-quantity {
|
|
594
|
+
border-radius: var(--radius-full, 999px);
|
|
595
|
+
border: var(--border-s, 0.5px) solid var(--color-border-primary, #3F2B2E);
|
|
596
|
+
background: var(--color-container-brand-accent, #FFC700);
|
|
597
|
+
overflow: hidden;
|
|
598
|
+
color: var(--color-content-body, #3F2B2E);
|
|
599
|
+
text-align: center;
|
|
600
|
+
text-overflow: ellipsis;
|
|
601
|
+
font-family: var(--font-family-loccitane-sans);
|
|
602
|
+
font-size: var(--font-size-100, 12px);
|
|
603
|
+
font-weight: var(--font-weight-400, 400);
|
|
604
|
+
line-height: var(--line-height-160, 16px);
|
|
605
|
+
letter-spacing: var(--letter-spacing-000, 0);
|
|
606
|
+
width: 16px;
|
|
607
|
+
height: 16px;
|
|
608
|
+
flex-shrink: 0;
|
|
575
609
|
}
|
|
576
610
|
|
|
577
611
|
.close-btn {
|
|
@@ -579,6 +613,7 @@
|
|
|
579
613
|
margin-top: 0;
|
|
580
614
|
flex-direction: column;
|
|
581
615
|
justify-content: start;
|
|
616
|
+
margin-left: auto;
|
|
582
617
|
}
|
|
583
618
|
|
|
584
619
|
.return-btn {
|
|
@@ -693,7 +728,7 @@
|
|
|
693
728
|
overflow: auto;
|
|
694
729
|
box-sizing: border-box;
|
|
695
730
|
}
|
|
696
|
-
`;u.focusablesSelector='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';u.focusablesCustomElementsSelector="o-icon-button, o-button";u.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};b([a({type:Boolean,reflect:!0})],u.prototype,"open",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showHeader",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showFooter",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showHeaderStartIcon",2);b([a({type:String,reflect:!0})],u.prototype,"headerTitle",2);b([a({type:String,reflect:!0})],u.prototype,"headerTitleClassName",2);b([a({type:String,reflect:!0})],u.prototype,"labelDialog",2);b([a({type:String,reflect:!0})],u.prototype,"closeButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"goBackButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"firstButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"firstButtonVariant",2);b([a({type:Object,reflect:!0})],u.prototype,"firstButtonProps",2);b([a({type:Boolean,reflect:!0})],u.prototype,"onFirstButtonClickClose",2);b([a({type:String,reflect:!0})],u.prototype,"secondButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"secondButtonVariant",2);b([a({type:Object,reflect:!0})],u.prototype,"secondButtonProps",2);b([a({type:Boolean,reflect:!0})],u.prototype,"onSecondButtonClickClose",2);b([a({type:Boolean,reflect:!0})],u.prototype,"disablePortal",2);b([a({type:Number,reflect:!0})],u.prototype,"zIndex",2);b([a({type:Boolean,reflect:!0})],u.prototype,"initialized",2);b([a({type:Boolean})],u.prototype,"showDetail",2);b([a({type:Boolean})],u.prototype,"isHidingDetail",2);u=b([g("o-side-panel")],u);var No=Object.defineProperty,
|
|
731
|
+
`;u.focusablesSelector='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';u.focusablesCustomElementsSelector="o-icon-button, o-button";u.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};b([a({type:Boolean,reflect:!0})],u.prototype,"open",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showHeader",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showFooter",2);b([a({type:Boolean,reflect:!0})],u.prototype,"showHeaderStartIcon",2);b([a({type:String,reflect:!0})],u.prototype,"headerTitle",2);b([a({type:String,reflect:!0})],u.prototype,"headerTitleClassName",2);b([a({type:String,reflect:!0})],u.prototype,"labelDialog",2);b([a({type:String,reflect:!0})],u.prototype,"addToBagProductCount",2);b([a({type:String,reflect:!0})],u.prototype,"closeButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"goBackButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"firstButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"firstButtonVariant",2);b([a({type:Object,reflect:!0})],u.prototype,"firstButtonProps",2);b([a({type:Boolean,reflect:!0})],u.prototype,"onFirstButtonClickClose",2);b([a({type:String,reflect:!0})],u.prototype,"secondButtonLabel",2);b([a({type:String,reflect:!0})],u.prototype,"secondButtonVariant",2);b([a({type:Object,reflect:!0})],u.prototype,"secondButtonProps",2);b([a({type:Boolean,reflect:!0})],u.prototype,"onSecondButtonClickClose",2);b([a({type:Boolean,reflect:!0})],u.prototype,"disablePortal",2);b([a({type:Number,reflect:!0})],u.prototype,"zIndex",2);b([a({type:Boolean,reflect:!0})],u.prototype,"initialized",2);b([a({type:Boolean})],u.prototype,"showDetail",2);b([a({type:Boolean})],u.prototype,"isHidingDetail",2);u=b([g("o-side-panel")],u);var No=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,k=(o,t,e,r)=>{for(var i=r>1?void 0:r?qo(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&No(t,e,i),i};const Vo=Xt(p);let y=class extends Vo{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.text="",this.textsecond="",this.fullwidth=!1,this.disabled=!1,this.startIconModel="",this.endIconModel="",this.startIcon=!1,this.endIcon=!1,this.panelTarget="",this.href="",this.target="",this.underlined=!1,this.withbadge=!1}get name(){return this.getAttribute("name")??""}set name(o){this.setAttribute("name",o)}get form(){return this[Gt].form}handleClick(o){if(!(o instanceof KeyboardEvent&&!["Enter"," "].includes(o.key))&&this.panelTarget){const t=document.getElementById(this.panelTarget);t instanceof u&&(t!=null&&t.openPanel)&&typeof t.openPanel=="function"?(o.preventDefault(),t.openPanel()):console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`)}}render(){return this.href?this.renderLink():this.renderButton()}renderIcon(o){const t=o==="start"?this.startIconModel:this.endIconModel;if(!t)return d;const e=Z[t].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return l`<span class="${o==="start"?"icon-start":"icon-end"}">${S(e)}</span>`}renderButton(){const o=this.text||this.textsecond;return l`
|
|
697
732
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}>
|
|
698
733
|
${this.startIcon?this.renderIcon("start"):d}
|
|
699
734
|
${o?l`
|
|
@@ -2653,7 +2688,7 @@
|
|
|
2653
2688
|
svg path {
|
|
2654
2689
|
stroke: var(--color-border-white);
|
|
2655
2690
|
}
|
|
2656
|
-
`;M([a({type:Boolean,reflect:!0})],L.prototype,"checked",2);M([a({type:Boolean,reflect:!0})],L.prototype,"indeterminate",2);M([a({type:Boolean,reflect:!0})],L.prototype,"disabled",2);M([a({type:String,reflect:!0})],L.prototype,"size",2);M([a({type:Boolean})],L.prototype,"showLabel",2);M([a({type:String})],L.prototype,"label",2);M([a({type:String})],L.prototype,"name",2);M([a({type:String})],L.prototype,"value",2);M([a({type:String,reflect:!0})],L.prototype,"inputId",2);M([Ce("input")],L.prototype,"inputEl",2);L=M([g("o-checkbox")],L);var Pi=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor,
|
|
2691
|
+
`;M([a({type:Boolean,reflect:!0})],L.prototype,"checked",2);M([a({type:Boolean,reflect:!0})],L.prototype,"indeterminate",2);M([a({type:Boolean,reflect:!0})],L.prototype,"disabled",2);M([a({type:String,reflect:!0})],L.prototype,"size",2);M([a({type:Boolean})],L.prototype,"showLabel",2);M([a({type:String})],L.prototype,"label",2);M([a({type:String})],L.prototype,"name",2);M([a({type:String})],L.prototype,"value",2);M([a({type:String,reflect:!0})],L.prototype,"inputId",2);M([Ce("input")],L.prototype,"inputEl",2);L=M([g("o-checkbox")],L);var Pi=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor,q=(o,t,e,r)=>{for(var i=r>1?void 0:r?Bi(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Pi(t,e,i),i};let zi=0,D=class extends p{constructor(){super(),this.checked=!1,this.disabled=!1,this.size="S",this.showLabel=!0,this.label="Radio button",this.name="",this.value="on",this.inputId="",this.inputId||(this.inputId=`o-radio-${++zi}`)}handleClick(){this.disabled||this.checked||(this.checked=!0,this.syncInput(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}syncInput(){this.inputEl&&(this.inputEl.checked=this.checked)}updated(o){if(o.has("checked")&&this.checked){const t=this.parentElement;t&&Array.from(t.querySelectorAll(`o-radio[name="${this.name}"]`)).forEach(r=>{r!==this&&(r.checked=!1)})}this.syncInput()}handleKeyDown(o){this.disabled||(o.key===" "||o.key==="Enter")&&(o.preventDefault(),this.handleClick())}render(){return l`
|
|
2657
2692
|
<input type="radio" id=${this.inputId} ?checked=${this.checked} ?disabled=${this.disabled} name=${this.name} value=${this.value} />
|
|
2658
2693
|
|
|
2659
2694
|
<div class="box" role="radio" tabindex=${this.disabled?-1:0} aria-checked=${String(this.checked)} aria-disabled=${String(this.disabled)} @click=${this.handleClick} @keydown=${this.handleKeyDown}>
|
|
@@ -2750,13 +2785,13 @@
|
|
|
2750
2785
|
width: 0;
|
|
2751
2786
|
height: 0;
|
|
2752
2787
|
}
|
|
2753
|
-
`;
|
|
2788
|
+
`;q([a({type:Boolean,reflect:!0})],D.prototype,"checked",2);q([a({type:Boolean,reflect:!0})],D.prototype,"disabled",2);q([a({type:String,reflect:!0})],D.prototype,"size",2);q([a({type:Boolean})],D.prototype,"showLabel",2);q([a({type:String})],D.prototype,"label",2);q([a({type:String})],D.prototype,"name",2);q([a({type:String})],D.prototype,"value",2);q([a({type:String,reflect:!0})],D.prototype,"inputId",2);q([Ce("input")],D.prototype,"inputEl",2);D=q([g("o-radio")],D);var Oi=Object.getOwnPropertyDescriptor,Ii=(o,t,e,r)=>{for(var i=r>1?void 0:r?Oi(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=s(i)||i);return i};let qt=class extends p{render(){return l`
|
|
2754
2789
|
<nav aria-label="Breadcrumbs">
|
|
2755
2790
|
<ul>
|
|
2756
2791
|
<slot></slot>
|
|
2757
2792
|
</ul>
|
|
2758
2793
|
</nav>
|
|
2759
|
-
`}};
|
|
2794
|
+
`}};qt.styles=f`
|
|
2760
2795
|
nav {
|
|
2761
2796
|
max-width: 144rem;
|
|
2762
2797
|
margin: auto;
|
|
@@ -2767,7 +2802,7 @@
|
|
|
2767
2802
|
margin: var(--spacing-4-xs);
|
|
2768
2803
|
padding: var(--spacing-4-xs);
|
|
2769
2804
|
}
|
|
2770
|
-
`;
|
|
2805
|
+
`;qt=Ii([g("o-breadcrumbs")],qt);var Di=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,ne=(o,t,e,r)=>{for(var i=r>1?void 0:r?Hi(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&Di(t,e,i),i};let St=class extends p{constructor(){super(...arguments),this.href="",this.active=!1}_handleClick(o){(!this.href||this.href==="#")&&o.preventDefault()}render(){return this.active?l`<span aria-current="page"><slot></slot></span>`:l`
|
|
2771
2806
|
<li>
|
|
2772
2807
|
<a
|
|
2773
2808
|
href="${this.href}"
|
package/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const Lt = globalThis,
|
|
6
|
+
const Lt = globalThis, Vt = Lt.ShadowRoot && (Lt.ShadyCSS === void 0 || Lt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Zt = Symbol(), le = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let xe = class {
|
|
8
8
|
constructor(t, e, r) {
|
|
9
9
|
if (this._$cssResult$ = !0, r !== Zt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -12,7 +12,7 @@ let xe = class {
|
|
|
12
12
|
get styleSheet() {
|
|
13
13
|
let t = this.o;
|
|
14
14
|
const e = this.t;
|
|
15
|
-
if (
|
|
15
|
+
if (Vt && t === void 0) {
|
|
16
16
|
const r = e !== void 0 && e.length === 1;
|
|
17
17
|
r && (t = le.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && le.set(e, t));
|
|
18
18
|
}
|
|
@@ -30,12 +30,12 @@ const Ae = (o) => new xe(typeof o == "string" ? o : o + "", void 0, Zt), f = (o,
|
|
|
30
30
|
})(i) + o[n + 1], o[0]);
|
|
31
31
|
return new xe(e, o, Zt);
|
|
32
32
|
}, Le = (o, t) => {
|
|
33
|
-
if (
|
|
33
|
+
if (Vt) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
34
|
else for (const e of t) {
|
|
35
35
|
const r = document.createElement("style"), i = Lt.litNonce;
|
|
36
36
|
i !== void 0 && r.setAttribute("nonce", i), r.textContent = e.cssText, o.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
}, ce =
|
|
38
|
+
}, ce = Vt ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let e = "";
|
|
40
40
|
for (const r of t.cssRules) e += r.cssText;
|
|
41
41
|
return Ae(e);
|
|
@@ -294,8 +294,8 @@ const Fe = (o, t) => {
|
|
|
294
294
|
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", s = ft;
|
|
295
295
|
for (let c = 0; c < e; c++) {
|
|
296
296
|
const h = o[c];
|
|
297
|
-
let w, _, v = -1,
|
|
298
|
-
for (;
|
|
297
|
+
let w, _, v = -1, V = 0;
|
|
298
|
+
for (; V < h.length && (s.lastIndex = V, _ = s.exec(h), _ !== null); ) V = s.lastIndex, s === ft ? _[1] === "!--" ? s = ue : _[1] !== void 0 ? s = fe : _[2] !== void 0 ? (ke.test(_[2]) && (i = RegExp("</" + _[2], "g")), s = it) : _[3] !== void 0 && (s = it) : s === it ? _[0] === ">" ? (s = i ?? ft, v = -1) : _[1] === void 0 ? v = -2 : (v = s.lastIndex - _[2].length, w = _[1], s = _[3] === void 0 ? it : _[3] === '"' ? ge : ve) : s === ge || s === ve ? s = it : s === ue || s === fe ? s = ft : (s = it, i = void 0);
|
|
299
299
|
const Y = s === it && o[c + 1].startsWith("/>") ? " " : "";
|
|
300
300
|
n += s === ft ? h + Te : v >= 0 ? (r.push(w), h.slice(0, v) + we + h.slice(v) + J + Y) : h + J + (v === -2 ? c : Y);
|
|
301
301
|
}
|
|
@@ -314,15 +314,15 @@ class xt {
|
|
|
314
314
|
for (; (i = rt.nextNode()) !== null && h.length < c; ) {
|
|
315
315
|
if (i.nodeType === 1) {
|
|
316
316
|
if (i.hasAttributes()) for (const v of i.getAttributeNames()) if (v.endsWith(we)) {
|
|
317
|
-
const
|
|
318
|
-
h.push({ type: 1, index: n, name: At[2], strings: Y, ctor: At[1] === "." ? Ue : At[1] === "?" ? Ne : At[1] === "@" ?
|
|
317
|
+
const V = _[s++], Y = i.getAttribute(v).split(J), At = /([.?@])?(.*)/.exec(V);
|
|
318
|
+
h.push({ type: 1, index: n, name: At[2], strings: Y, ctor: At[1] === "." ? Ue : At[1] === "?" ? Ne : At[1] === "@" ? qe : Ot }), i.removeAttribute(v);
|
|
319
319
|
} else v.startsWith(J) && (h.push({ type: 6, index: n }), i.removeAttribute(v));
|
|
320
320
|
if (ke.test(i.tagName)) {
|
|
321
|
-
const v = i.textContent.split(J),
|
|
322
|
-
if (
|
|
321
|
+
const v = i.textContent.split(J), V = v.length - 1;
|
|
322
|
+
if (V > 0) {
|
|
323
323
|
i.textContent = Bt ? Bt.emptyScript : "";
|
|
324
|
-
for (let Y = 0; Y <
|
|
325
|
-
i.append(v[
|
|
324
|
+
for (let Y = 0; Y < V; Y++) i.append(v[Y], yt()), rt.nextNode(), h.push({ type: 2, index: ++n });
|
|
325
|
+
i.append(v[V], yt());
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
} else if (i.nodeType === 8) if (i.data === $e) h.push({ type: 2, index: n });
|
|
@@ -362,7 +362,7 @@ class Re {
|
|
|
362
362
|
for (; h !== void 0; ) {
|
|
363
363
|
if (s === h.index) {
|
|
364
364
|
let w;
|
|
365
|
-
h.type === 2 ? w = new Et(n, n.nextSibling, this, t) : h.type === 1 ? w = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (w = new
|
|
365
|
+
h.type === 2 ? w = new Et(n, n.nextSibling, this, t) : h.type === 1 ? w = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (w = new Ve(n, this, t)), this._$AV.push(w), h = r[++c];
|
|
366
366
|
}
|
|
367
367
|
s !== (h == null ? void 0 : h.index) && (n = rt.nextNode(), s++);
|
|
368
368
|
}
|
|
@@ -477,7 +477,7 @@ class Ne extends Ot {
|
|
|
477
477
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
class
|
|
480
|
+
class qe extends Ot {
|
|
481
481
|
constructor(t, e, r, i, n) {
|
|
482
482
|
super(t, e, r, i, n), this.type = 5;
|
|
483
483
|
}
|
|
@@ -491,7 +491,7 @@ class Ve extends Ot {
|
|
|
491
491
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
class
|
|
494
|
+
class Ve {
|
|
495
495
|
constructor(t, e, r) {
|
|
496
496
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
|
|
497
497
|
}
|
|
@@ -1339,7 +1339,7 @@ var Ro = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, b = (o, t,
|
|
|
1339
1339
|
};
|
|
1340
1340
|
let u = class extends p {
|
|
1341
1341
|
constructor() {
|
|
1342
|
-
super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", 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) => {
|
|
1342
|
+
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) => {
|
|
1343
1343
|
var e, r;
|
|
1344
1344
|
const t = ((e = o.detail) == null ? void 0 : e.origin) ?? document.activeElement;
|
|
1345
1345
|
if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
|
|
@@ -1522,9 +1522,12 @@ let u = class extends p {
|
|
|
1522
1522
|
showsrlabel="true"
|
|
1523
1523
|
></o-icon-button>
|
|
1524
1524
|
` : null}
|
|
1525
|
+
<div class="header-title-container" >
|
|
1525
1526
|
<p role="heading" aria-level="1" id="panel-title" class="${this.headerTitleClassName}">
|
|
1526
1527
|
${this.headerTitle}
|
|
1527
1528
|
</p>
|
|
1529
|
+
${this.addToBagProductCount ? l`<span class="a-quantity">${this.addToBagProductCount}</span>` : null}
|
|
1530
|
+
</div>
|
|
1528
1531
|
<o-icon-button
|
|
1529
1532
|
icon="cross"
|
|
1530
1533
|
size="small"
|
|
@@ -1533,7 +1536,7 @@ let u = class extends p {
|
|
|
1533
1536
|
@click=${this.handleClosePanel}
|
|
1534
1537
|
@keydown=${this.handleClosePanel}
|
|
1535
1538
|
srlabel="${this.closeButtonLabel}"
|
|
1536
|
-
showsrlabel
|
|
1539
|
+
?showsrlabel=${!0}
|
|
1537
1540
|
></o-icon-button>
|
|
1538
1541
|
</div>
|
|
1539
1542
|
` : null;
|
|
@@ -1661,10 +1664,20 @@ u.styles = f`
|
|
|
1661
1664
|
.header {
|
|
1662
1665
|
flex: 0 0 auto;
|
|
1663
1666
|
display: flex;
|
|
1664
|
-
|
|
1667
|
+
align-items: center;
|
|
1668
|
+
gap: 8px;
|
|
1665
1669
|
padding: 20px 16px;
|
|
1666
1670
|
border-bottom: var(--border-050) solid var(--color-border-tertiary);
|
|
1667
1671
|
|
|
1672
|
+
.header-title-container {
|
|
1673
|
+
display: flex;
|
|
1674
|
+
flex-direction: row;
|
|
1675
|
+
align-items: center;
|
|
1676
|
+
column-gap: 8px;
|
|
1677
|
+
flex: 1 1 auto;
|
|
1678
|
+
min-width: 0;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1668
1681
|
.panel-title {
|
|
1669
1682
|
font-family: var(--font-family-loccitane-serif);
|
|
1670
1683
|
font-size: var(--font-size);
|
|
@@ -1678,8 +1691,29 @@ u.styles = f`
|
|
|
1678
1691
|
margin-top: auto;
|
|
1679
1692
|
margin-bottom: auto;
|
|
1680
1693
|
overflow: hidden;
|
|
1681
|
-
|
|
1694
|
+
padding-right: 6px;
|
|
1682
1695
|
color: var(--color-content-heading);
|
|
1696
|
+
flex: 0 1 auto;
|
|
1697
|
+
max-width: 100%;
|
|
1698
|
+
min-width: 0;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
.a-quantity {
|
|
1702
|
+
border-radius: var(--radius-full, 999px);
|
|
1703
|
+
border: var(--border-s, 0.5px) solid var(--color-border-primary, #3F2B2E);
|
|
1704
|
+
background: var(--color-container-brand-accent, #FFC700);
|
|
1705
|
+
overflow: hidden;
|
|
1706
|
+
color: var(--color-content-body, #3F2B2E);
|
|
1707
|
+
text-align: center;
|
|
1708
|
+
text-overflow: ellipsis;
|
|
1709
|
+
font-family: var(--font-family-loccitane-sans);
|
|
1710
|
+
font-size: var(--font-size-100, 12px);
|
|
1711
|
+
font-weight: var(--font-weight-400, 400);
|
|
1712
|
+
line-height: var(--line-height-160, 16px);
|
|
1713
|
+
letter-spacing: var(--letter-spacing-000, 0);
|
|
1714
|
+
width: 16px;
|
|
1715
|
+
height: 16px;
|
|
1716
|
+
flex-shrink: 0;
|
|
1683
1717
|
}
|
|
1684
1718
|
|
|
1685
1719
|
.close-btn {
|
|
@@ -1687,6 +1721,7 @@ u.styles = f`
|
|
|
1687
1721
|
margin-top: 0;
|
|
1688
1722
|
flex-direction: column;
|
|
1689
1723
|
justify-content: start;
|
|
1724
|
+
margin-left: auto;
|
|
1690
1725
|
}
|
|
1691
1726
|
|
|
1692
1727
|
.return-btn {
|
|
@@ -1830,6 +1865,9 @@ b([
|
|
|
1830
1865
|
b([
|
|
1831
1866
|
a({ type: String, reflect: !0 })
|
|
1832
1867
|
], u.prototype, "labelDialog", 2);
|
|
1868
|
+
b([
|
|
1869
|
+
a({ type: String, reflect: !0 })
|
|
1870
|
+
], u.prototype, "addToBagProductCount", 2);
|
|
1833
1871
|
b([
|
|
1834
1872
|
a({ type: String, reflect: !0 })
|
|
1835
1873
|
], u.prototype, "closeButtonLabel", 2);
|
|
@@ -1878,13 +1916,13 @@ b([
|
|
|
1878
1916
|
u = b([
|
|
1879
1917
|
g("o-side-panel")
|
|
1880
1918
|
], u);
|
|
1881
|
-
var No = Object.defineProperty,
|
|
1882
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
1919
|
+
var No = Object.defineProperty, qo = Object.getOwnPropertyDescriptor, k = (o, t, e, r) => {
|
|
1920
|
+
for (var i = r > 1 ? void 0 : r ? qo(t, e) : t, n = o.length - 1, s; n >= 0; n--)
|
|
1883
1921
|
(s = o[n]) && (i = (r ? s(t, e, i) : s(i)) || i);
|
|
1884
1922
|
return r && i && No(t, e, i), i;
|
|
1885
1923
|
};
|
|
1886
|
-
const
|
|
1887
|
-
let y = class extends
|
|
1924
|
+
const Vo = Xt(p);
|
|
1925
|
+
let y = class extends Vo {
|
|
1888
1926
|
constructor() {
|
|
1889
1927
|
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1;
|
|
1890
1928
|
}
|
|
@@ -4869,7 +4907,7 @@ M([
|
|
|
4869
4907
|
L = M([
|
|
4870
4908
|
g("o-checkbox")
|
|
4871
4909
|
], L);
|
|
4872
|
-
var Pi = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor,
|
|
4910
|
+
var Pi = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, q = (o, t, e, r) => {
|
|
4873
4911
|
for (var i = r > 1 ? void 0 : r ? Bi(t, e) : t, n = o.length - 1, s; n >= 0; n--)
|
|
4874
4912
|
(s = o[n]) && (i = (r ? s(t, e, i) : s(i)) || i);
|
|
4875
4913
|
return r && i && Pi(t, e, i), i;
|
|
@@ -4998,34 +5036,34 @@ D.styles = f`
|
|
|
4998
5036
|
height: 0;
|
|
4999
5037
|
}
|
|
5000
5038
|
`;
|
|
5001
|
-
|
|
5039
|
+
q([
|
|
5002
5040
|
a({ type: Boolean, reflect: !0 })
|
|
5003
5041
|
], D.prototype, "checked", 2);
|
|
5004
|
-
|
|
5042
|
+
q([
|
|
5005
5043
|
a({ type: Boolean, reflect: !0 })
|
|
5006
5044
|
], D.prototype, "disabled", 2);
|
|
5007
|
-
|
|
5045
|
+
q([
|
|
5008
5046
|
a({ type: String, reflect: !0 })
|
|
5009
5047
|
], D.prototype, "size", 2);
|
|
5010
|
-
|
|
5048
|
+
q([
|
|
5011
5049
|
a({ type: Boolean })
|
|
5012
5050
|
], D.prototype, "showLabel", 2);
|
|
5013
|
-
|
|
5051
|
+
q([
|
|
5014
5052
|
a({ type: String })
|
|
5015
5053
|
], D.prototype, "label", 2);
|
|
5016
|
-
|
|
5054
|
+
q([
|
|
5017
5055
|
a({ type: String })
|
|
5018
5056
|
], D.prototype, "name", 2);
|
|
5019
|
-
|
|
5057
|
+
q([
|
|
5020
5058
|
a({ type: String })
|
|
5021
5059
|
], D.prototype, "value", 2);
|
|
5022
|
-
|
|
5060
|
+
q([
|
|
5023
5061
|
a({ type: String, reflect: !0 })
|
|
5024
5062
|
], D.prototype, "inputId", 2);
|
|
5025
|
-
|
|
5063
|
+
q([
|
|
5026
5064
|
Ce("input")
|
|
5027
5065
|
], D.prototype, "inputEl", 2);
|
|
5028
|
-
D =
|
|
5066
|
+
D = q([
|
|
5029
5067
|
g("o-radio")
|
|
5030
5068
|
], D);
|
|
5031
5069
|
var Oi = Object.getOwnPropertyDescriptor, Ii = (o, t, e, r) => {
|
|
@@ -5033,7 +5071,7 @@ var Oi = Object.getOwnPropertyDescriptor, Ii = (o, t, e, r) => {
|
|
|
5033
5071
|
(s = o[n]) && (i = s(i) || i);
|
|
5034
5072
|
return i;
|
|
5035
5073
|
};
|
|
5036
|
-
let
|
|
5074
|
+
let qt = class extends p {
|
|
5037
5075
|
render() {
|
|
5038
5076
|
return l`
|
|
5039
5077
|
<nav aria-label="Breadcrumbs">
|
|
@@ -5044,7 +5082,7 @@ let Vt = class extends p {
|
|
|
5044
5082
|
`;
|
|
5045
5083
|
}
|
|
5046
5084
|
};
|
|
5047
|
-
|
|
5085
|
+
qt.styles = f`
|
|
5048
5086
|
nav {
|
|
5049
5087
|
max-width: 144rem;
|
|
5050
5088
|
margin: auto;
|
|
@@ -5056,9 +5094,9 @@ Vt.styles = f`
|
|
|
5056
5094
|
padding: var(--spacing-4-xs);
|
|
5057
5095
|
}
|
|
5058
5096
|
`;
|
|
5059
|
-
|
|
5097
|
+
qt = Ii([
|
|
5060
5098
|
g("o-breadcrumbs")
|
|
5061
|
-
],
|
|
5099
|
+
], qt);
|
|
5062
5100
|
var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, ne = (o, t, e, r) => {
|
|
5063
5101
|
for (var i = r > 1 ? void 0 : r ? Hi(t, e) : t, n = o.length - 1, s; n >= 0; n--)
|
|
5064
5102
|
(s = o[n]) && (i = (r ? s(t, e, i) : s(i)) || i);
|