@florid-kit/components 0.3.5 → 0.3.7
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/link.d.ts +17 -0
- package/index.js +162 -32
- package/index.mjs +396 -229
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
type Template = "standard" | "discret" | "review";
|
|
4
|
+
type Inverse = true | false;
|
|
5
|
+
type endIcon = true | false;
|
|
6
|
+
type reverseEndIcon = true | false;
|
|
7
|
+
export declare class OccitaneLink extends LitElement {
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
9
|
+
href: string;
|
|
10
|
+
target: "_blank" | "_parent" | "_self" | "_top" | "";
|
|
11
|
+
template: Template;
|
|
12
|
+
inverse: Inverse;
|
|
13
|
+
endIcon: endIcon;
|
|
14
|
+
reverseEndIcon: reverseEndIcon;
|
|
15
|
+
render(): import('lit').TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/index.js
CHANGED
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const V=globalThis,rt=V.ShadowRoot&&(V.ShadyCSS===void 0||V.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,it=Symbol(),lt=new WeakMap;let mt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==it)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(rt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=lt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&<.set(e,t))}return t}toString(){return this.cssText}};const _t=i=>new mt(typeof i=="string"?i:i+"",void 0,it),I=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new mt(e,i,it)},Ct=(i,t)=>{if(rt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=V.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},ht=rt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return _t(e)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:Pt,defineProperty:Ot,getOwnPropertyDescriptor:kt,getOwnPropertyNames:Ut,getOwnPropertySymbols:Mt,getPrototypeOf:Tt}=Object,_=globalThis,ct=_.trustedTypes,It=ct?ct.emptyScript:"",K=_.reactiveElementPolyfillSupport,z=(i,t)=>i,q={toAttribute(i,t){switch(t){case Boolean:i=i?It:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ot=(i,t)=>!Pt(i,t),dt={attribute:!0,type:String,converter:q,reflect:!1,useDefault:!1,hasChanged:ot};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);let U=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=dt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Ot(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=kt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){const l=r==null?void 0:r.call(this);n==null||n.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??dt}static _$Ei(){if(this.hasOwnProperty(z("elementProperties")))return;const t=Tt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(z("properties"))){const e=this.properties,s=[...Ut(e),...Mt(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(ht(r))}else t!==void 0&&e.push(ht(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ct(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:q).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n,o;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const l=s.getPropertyOptions(r),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:q;this._$Em=r,this[r]=a.fromAttribute(e,l.type)??((o=this._$Ej)==null?void 0:o.get(r))??null,this._$Em=null}}requestUpdate(t,e,s){var r;if(t!==void 0){const n=this.constructor,o=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??ot)(o,e)||s.useDefault&&s.reflect&&o===((r=this._$Ej)==null?void 0:r.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:n},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r){const{wrapped:l}=o,a=this[n];l!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,o,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};U.elementStyles=[],U.shadowRootOptions={mode:"open"},U[z("elementProperties")]=new Map,U[z("finalized")]=new Map,K==null||K({ReactiveElement:U}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const B=globalThis,W=B.trustedTypes,ut=W?W.createPolicy("lit-html",{createHTML:i=>i}):void 0,wt="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+m,Ht=`<${At}>`,C=document,N=()=>C.createComment(""),L=i=>i===null||typeof i!="object"&&typeof i!="function",nt=Array.isArray,zt=i=>nt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",X=`[
|
|
14
|
+
\f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pt=/-->/g,ft=/>/g,x=RegExp(`>|${X}(?:([^\\s"'>=/]+)(${X}*=${X}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),gt=/'/g,bt=/"/g,xt=/^(?:script|style|textarea|title)$/i,Bt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),g=Bt(1),P=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),vt=new WeakMap,E=C.createTreeWalker(C,129);function Et(i,t){if(!nt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ut!==void 0?ut.createHTML(t):t}const Nt=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=H;for(let l=0;l<e;l++){const a=i[l];let u,p,h=-1,v=0;for(;v<a.length&&(o.lastIndex=v,p=o.exec(a),p!==null);)v=o.lastIndex,o===H?p[1]==="!--"?o=pt:p[1]!==void 0?o=ft:p[2]!==void 0?(xt.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=x):p[3]!==void 0&&(o=x):o===x?p[0]===">"?(o=r??H,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,u=p[1],o=p[3]===void 0?x:p[3]==='"'?bt:gt):o===bt||o===gt?o=x:o===pt||o===ft?o=H:(o=x,r=void 0);const y=o===x&&i[l+1].startsWith("/>")?" ":"";n+=o===H?a+Ht:h>=0?(s.push(u),a.slice(0,h)+wt+a.slice(h)+m+y):a+m+(h===-2?l:y)}return[Et(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class D{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const l=t.length-1,a=this.parts,[u,p]=Nt(t,e);if(this.el=D.createElement(u,s),E.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=E.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(wt)){const v=p[o++],y=r.getAttribute(h).split(m),j=/([.?@])?(.*)/.exec(v);a.push({type:1,index:n,name:j[2],strings:y,ctor:j[1]==="."?Dt:j[1]==="?"?Rt:j[1]==="@"?jt:F}),r.removeAttribute(h)}else h.startsWith(m)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(xt.test(r.tagName)){const h=r.textContent.split(m),v=h.length-1;if(v>0){r.textContent=W?W.emptyScript:"";for(let y=0;y<v;y++)r.append(h[y],N()),E.nextNode(),a.push({type:2,index:++n});r.append(h[v],N())}}}else if(r.nodeType===8)if(r.data===At)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(m,h+1))!==-1;)a.push({type:7,index:n}),h+=m.length-1}n++}}static createElement(t,e){const s=C.createElement("template");return s.innerHTML=t,s}}function M(i,t,e=i,s){var o,l;if(t===P)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=L(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((l=r==null?void 0:r._$AO)==null||l.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=M(i,r._$AS(i,t.values),r,s)),t}class Lt{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:s}=this._$AD,r=((t==null?void 0:t.creationScope)??C).importNode(e,!0);E.currentNode=r;let n=E.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let u;a.type===2?u=new R(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new Vt(n,this,t)),this._$AV.push(u),a=s[++l]}o!==(a==null?void 0:a.index)&&(n=E.nextNode(),o++)}return E.currentNode=C,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class R{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.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=M(this,t,e),L(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):zt(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&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(C.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=D.createElement(Et(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Lt(r,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=vt.get(t.strings);return e===void 0&&vt.set(t.strings,e=new D(t)),e}k(t){nt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new R(this.O(N()),this.O(N()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class F{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=M(this,t,e,0),o=!L(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const l=t;let a,u;for(t=n[0],a=0;a<n.length-1;a++)u=M(this,l[s+a],e,a),u===P&&(u=this._$AH[a]),o||(o=!L(u)||u!==this._$AH[a]),u===d?t=d:t!==d&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}o&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Dt extends F{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Rt extends F{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class jt extends F{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=M(this,t,e,0)??d)===P)return;const s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),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 Vt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const G=B.litHtmlPolyfillSupport;G==null||G(D,R),(B.litHtmlVersions??(B.litHtmlVersions=[])).push("3.3.0");const qt=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new R(t.insertBefore(N(),n),n,void 0,e??{})}return r._$AI(i),r};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const S=globalThis;let
|
|
19
|
+
*/const S=globalThis;let w=class extends U{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=qt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return P}};var yt;w._$litElement$=!0,w.finalized=!0,(yt=S.litElementHydrateSupport)==null||yt.call(S,{LitElement:w});const Q=S.litElementPolyfillSupport;Q==null||Q({LitElement:w});(S.litElementVersions??(S.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const Z=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const Wt={attribute:!0,type:String,converter:q,reflect:!1,hasChanged:ot},Ft=(i=Wt,t,e)=>{const{kind:s,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),s==="setter"&&((i=Object.create(i)).wrapped=!0),n.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,a,i)},init(l){return l!==void 0&&this.C(o,void 0,i,l),l}}}if(s==="setter"){const{name:o}=e;return function(l){const a=this[o];t.call(this,l),this.requestUpdate(o,a,i)}}throw Error("Unsupported decorator location: "+s)};function c(i){return(t,e)=>typeof e=="object"?Ft(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}const Zt=I`
|
|
28
28
|
outline: 1px dashed var(--button-border-color);
|
|
29
29
|
outline-offset: 2px;
|
|
30
30
|
outline: dashed black;
|
|
31
|
-
`;
|
|
31
|
+
`;I`
|
|
32
32
|
:host * {
|
|
33
33
|
box-sizing: border-box;
|
|
34
34
|
}
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2023 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: Apache-2.0
|
|
39
|
-
*/const
|
|
39
|
+
*/const at=Symbol("internals"),Y=Symbol("privateInternals");function Jt(i){var t;class e extends i{get[(t=at,t)](){return this[Y]||(this[Y]=this.attachInternals()),this[Y]}}return e}/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2023 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/function
|
|
43
|
+
*/function Kt(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[at]:n}=e,{form:o}=n;if(!(!o||r==="button")&&(await new Promise(l=>{setTimeout(l)}),!s.defaultPrevented)){if(r==="reset"){o.reset();return}o.addEventListener("submit",l=>{Object.defineProperty(l,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),n.setFormValue(e.value),o.requestSubmit()}})})}var Xt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,O=(i,t,e,s)=>{for(var r=s>1?void 0:s?Gt(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&Xt(t,e,r),r};const Qt=Jt(w),$t=i=>{const t=`
|
|
44
44
|
--button-bg-disabled: var(--color-container-disabled);
|
|
45
45
|
--button-bg-pressed: var(--color-container-action-${i}-pressed);
|
|
46
46
|
--button-bg-hover: var(--color-container-action-${i}-hover);
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
--button-text-disabled: var(--color-content-disabled);
|
|
54
54
|
--button-text-hover: var(--color-content-action-${i});
|
|
55
55
|
--button-text: var(--color-content-action-${i});
|
|
56
|
-
`;return
|
|
56
|
+
`;return _t(t)},Yt=["primary","secondary"];let f=class extends Qt{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.disabled=!1,this.href="",this.target=""}get name(){return this.getAttribute("name")??""}set name(i){this.setAttribute("name",i)}get form(){return this[at].form}willUpdate(){const i=getComputedStyle(this).getPropertyValue("--button-variant");i&&Yt.some(t=>t===i)&&(this.variant=i)}render(){const i=this.href?this.renderLink():this.renderButton();return g`${i}`}renderLink(){return g`<a href=${this.href} target=${this.target||d} class="button" ?disabled=${this.disabled}>
|
|
57
57
|
<slot />
|
|
58
|
-
</a>`}renderButton(){return
|
|
58
|
+
</a>`}renderButton(){return g`<button class="button" ?disabled=${this.disabled}>
|
|
59
59
|
<slot />
|
|
60
|
-
</button>`}};
|
|
60
|
+
</button>`}};Kt(f);f.formAssociated=!0;f.styles=I`
|
|
61
61
|
:host {
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
cursor: pointer;
|
|
@@ -127,27 +127,33 @@
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.button:focus-visible {
|
|
130
|
-
${
|
|
130
|
+
${Zt};
|
|
131
131
|
}
|
|
132
|
-
`;
|
|
132
|
+
`;O([c()],f.prototype,"type",2);O([c({reflect:!0})],f.prototype,"value",2);O([c({reflect:!0})],f.prototype,"variant",2);O([c({converter:{fromAttribute:i=>i===""||i==="true"}})],f.prototype,"disabled",2);O([c()],f.prototype,"href",2);O([c()],f.prototype,"target",2);f=O([Z("o-button")],f);/**
|
|
133
133
|
* @license
|
|
134
134
|
* Copyright 2017 Google LLC
|
|
135
135
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
136
|
-
*/const
|
|
136
|
+
*/const te={CHILD:2},ee=i=>(...t)=>({_$litDirective$:i,values:t});class se{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
137
137
|
* @license
|
|
138
138
|
* Copyright 2017 Google LLC
|
|
139
139
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
140
|
-
*/class
|
|
140
|
+
*/class tt extends se{constructor(t){if(super(t),this.it=d,t.type!==te.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this._t=void 0,this.it=t;if(t===P)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}tt.directiveName="unsafeHTML",tt.resultType=1;/**
|
|
141
141
|
* @license
|
|
142
142
|
* Copyright 2017 Google LLC
|
|
143
143
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
144
|
-
*/class
|
|
144
|
+
*/class et extends tt{}et.directiveName="unsafeSVG",et.resultType=2;const st=ee(et),re=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
145
145
|
<path d="M8 3.6275C7.06799 0.971489 3.25399 -0.0226278 1.67414 2.30983C0.0877404 4.65197 1.67414 6.99412 2.62598 8.33249C3.0147 8.87905 8 14 8 14C8 14 12.9853 8.87905 13.374 8.33249C14.3259 6.99412 15.9123 4.65197 14.3259 2.30983C12.746 -0.0226277 8.97167 0.971489 8 3.6275Z" stroke="#3F2B2E" stroke-linecap="round"/>
|
|
146
146
|
</svg>
|
|
147
|
-
`,
|
|
147
|
+
`,ie=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
148
148
|
<path d="M16 8L4 0V16L16 8Z" fill="#3F2B2E"/>
|
|
149
149
|
</svg>
|
|
150
|
-
`,
|
|
150
|
+
`,oe=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
151
|
+
<path d="M12.2266 8.16162C11.0953 9.26599 8.72489 11.8788 5.11546 16L4.63062 15.7172C5.78886 13.4007 7.17607 10.8283 8.79223 8C7.17607 5.17172 5.78886 2.59933 4.63062 0.282827L5.11546 0C8.72489 4.12121 11.0953 6.73401 12.2266 7.83838V8.16162Z" fill="#3F2B2E"/>
|
|
152
|
+
</svg>
|
|
153
|
+
`,ne=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
154
|
+
<path d="M5 7.83838C6.02128 6.73401 8.16109 4.12121 11.4195 0L11.8571 0.282829C10.8116 2.59933 9.55927 5.17172 8.1003 8C9.55927 10.8283 10.8115 13.4007 11.8571 15.7172L11.4195 16C8.16109 11.8788 6.02128 9.266 5 8.16162L5 7.83838Z" fill="#3F2B2E"/>
|
|
155
|
+
</svg>
|
|
156
|
+
`,St={wishlist:re,playerv:ie,chevronRight:oe,chevronLeft:ne};var ae=Object.defineProperty,le=Object.getOwnPropertyDescriptor,J=(i,t,e,s)=>{for(var r=s>1?void 0:s?le(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&ae(t,e,r),r};let T=class extends w{constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist"}render(){const i=St.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return g`
|
|
151
157
|
<button
|
|
152
158
|
type="button"
|
|
153
159
|
aria-label="${this.label}"
|
|
@@ -157,9 +163,9 @@
|
|
|
157
163
|
@click="${this.toggleStatus}"
|
|
158
164
|
>
|
|
159
165
|
<span class="sr-only">${this.label}</span>
|
|
160
|
-
${
|
|
166
|
+
${st(i)}
|
|
161
167
|
</button>
|
|
162
|
-
`}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}setAriaDescribedBy(i){this.ariaDescribedBy=i,this.requestUpdate()}setLabel(i){this.label=i,this.requestUpdate()}};
|
|
168
|
+
`}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}setAriaDescribedBy(i){this.ariaDescribedBy=i,this.requestUpdate()}setLabel(i){this.label=i,this.requestUpdate()}};T.styles=I`
|
|
163
169
|
:host {
|
|
164
170
|
display: inline-flex;
|
|
165
171
|
justify-content: center;
|
|
@@ -213,22 +219,22 @@
|
|
|
213
219
|
:host([status="filled"]) .wishlist-button:hover svg path {
|
|
214
220
|
fill: var(--color-alpha-light-strong);
|
|
215
221
|
}
|
|
216
|
-
`;
|
|
217
|
-
${this.type==="span"?
|
|
218
|
-
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status}" ?disabled="${this.disabled}">
|
|
219
|
-
${
|
|
222
|
+
`;J([c({type:String,reflect:!0})],T.prototype,"status",2);J([c({type:String,reflect:!0})],T.prototype,"ariaDescribedBy",2);J([c({type:String,reflect:!0})],T.prototype,"label",2);T=J([Z("o-wishlist-button")],T);var he=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,A=(i,t,e,s)=>{for(var r=s>1?void 0:s?ce(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&he(t,e,r),r};let b=class extends w{constructor(){super(...arguments),this.bgstyle="background-light",this.size="medium",this.status="empty",this.type="button",this.strokewidth="1",this.icon="wishlist",this.disabled=!1}updated(i){super.updated(i),this.style.setProperty("--icon-stroke-width",this.strokewidth)}render(){const i=St[this.icon]??"",t=`icon-${this.icon}`,e=i.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return g`
|
|
223
|
+
${this.type==="span"?g`
|
|
224
|
+
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
|
|
225
|
+
${st(e)}
|
|
220
226
|
</span>
|
|
221
|
-
`:
|
|
227
|
+
`:g`
|
|
222
228
|
<button
|
|
223
229
|
type="button"
|
|
224
230
|
aria-label="icon"
|
|
225
|
-
class="icon-button ${this.size} ${this.bgstyle} ${this.status}"
|
|
231
|
+
class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}"
|
|
226
232
|
?disabled="${this.disabled}"
|
|
227
233
|
>
|
|
228
|
-
${
|
|
234
|
+
${st(e)}
|
|
229
235
|
</button>
|
|
230
236
|
`}
|
|
231
|
-
`}};
|
|
237
|
+
`}};b.styles=I`
|
|
232
238
|
:host {
|
|
233
239
|
display: inline-flex;
|
|
234
240
|
justify-content: center;
|
|
@@ -308,10 +314,15 @@
|
|
|
308
314
|
svg {
|
|
309
315
|
path {
|
|
310
316
|
stroke: var(--color-content-action-primary);
|
|
317
|
+
fill: var(--color-content-action-primary);
|
|
311
318
|
}
|
|
312
319
|
}
|
|
313
320
|
}
|
|
314
321
|
|
|
322
|
+
.icon-button.none-light.icon-wishlist svg path {
|
|
323
|
+
fill: none;
|
|
324
|
+
}
|
|
325
|
+
|
|
315
326
|
.icon-button.background-light {
|
|
316
327
|
background-color: var(--color-alpha-light-strong);
|
|
317
328
|
|
|
@@ -380,4 +391,123 @@
|
|
|
380
391
|
}
|
|
381
392
|
|
|
382
393
|
}
|
|
383
|
-
`;
|
|
394
|
+
`;A([c({type:String,reflect:!0})],b.prototype,"bgstyle",2);A([c({type:String,reflect:!0})],b.prototype,"size",2);A([c({type:String,reflect:!0})],b.prototype,"status",2);A([c({type:String,reflect:!0})],b.prototype,"type",2);A([c({type:String})],b.prototype,"strokewidth",2);A([c({type:String})],b.prototype,"icon",2);A([c({type:Boolean,reflect:!0})],b.prototype,"disabled",2);b=A([Z("o-icon-button")],b);var de=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,k=(i,t,e,s)=>{for(var r=s>1?void 0:s?ue(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&de(t,e,r),r};let $=class extends w{constructor(){super(...arguments),this.href="",this.target="",this.template="standard",this.inverse=!1,this.endIcon=!1,this.reverseEndIcon=!1}render(){return g`
|
|
395
|
+
<a href="${this.href}" target="${this.target}">
|
|
396
|
+
${this.endIcon&&this.reverseEndIcon?g`
|
|
397
|
+
<o-icon-button
|
|
398
|
+
icon="chevronLeft"
|
|
399
|
+
bgstyle="${this.inverse?"none-light":"none-contrast"}"
|
|
400
|
+
size="small"
|
|
401
|
+
aria-hidden="true"
|
|
402
|
+
type="span"
|
|
403
|
+
></o-icon-button>
|
|
404
|
+
`:null}
|
|
405
|
+
<span class="link-text"><slot></slot></span>
|
|
406
|
+
${this.endIcon&&!this.reverseEndIcon?g`
|
|
407
|
+
<o-icon-button
|
|
408
|
+
icon="chevronRight"
|
|
409
|
+
bgstyle="${this.inverse?"none-light":"none-contrast"}"
|
|
410
|
+
size="small"
|
|
411
|
+
aria-hidden="true"
|
|
412
|
+
type="span"
|
|
413
|
+
></o-icon-button>
|
|
414
|
+
`:null}
|
|
415
|
+
</a>
|
|
416
|
+
`}};$.styles=I`
|
|
417
|
+
:host([template="standard"]) a {
|
|
418
|
+
color: var(--color-content-action-secondary);
|
|
419
|
+
font-size: var(--font-size-200);
|
|
420
|
+
font-weight: var(--font-weight-400);
|
|
421
|
+
line-height: var(--line-height-240);
|
|
422
|
+
letter-spacing: var(--letter-spacing-400);
|
|
423
|
+
font-family: var(--font-family-loccitane-serif);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:host([template="discret"]) a {
|
|
427
|
+
color: var(--color-content-action-secondary);
|
|
428
|
+
font-size: var(--font-size-100);
|
|
429
|
+
font-weight: var(--font-weight-400);
|
|
430
|
+
line-height: var(--line-height-160);
|
|
431
|
+
letter-spacing: var(--letter-spacing-400);
|
|
432
|
+
font-family: var(--font-family-loccitane-sans);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
:host([template="review"]) a {
|
|
436
|
+
color: var(--color-content-action-secondary);
|
|
437
|
+
font-size: var(--font-size-100);
|
|
438
|
+
font-weight: var(--font-weight-500);
|
|
439
|
+
line-height: var(--line-height-160);
|
|
440
|
+
letter-spacing: var(--letter-spacing-400);
|
|
441
|
+
font-family: var(--font-family-loccitane-sans);
|
|
442
|
+
text-transform: uppercase;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
:host([inverse]) a {
|
|
446
|
+
color: var(--color-container-action-tertiary-default);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
:host([endIcon]) a o-icon-button {
|
|
450
|
+
margin-left: 2px;
|
|
451
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
:host([endIcon][reverseEndIcon]) a o-icon-button {
|
|
455
|
+
margin-right: 2px;
|
|
456
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
:host([endIcon]) a {
|
|
460
|
+
&:hover {
|
|
461
|
+
o-icon-button {
|
|
462
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
463
|
+
:host(:not([reverseEndIcon])) & {
|
|
464
|
+
transform: translateX(4px);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
:host([reverseEndIcon]) & {
|
|
468
|
+
transform: translateX(-4px);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/*Underline effect */
|
|
475
|
+
:host a {
|
|
476
|
+
position: relative;
|
|
477
|
+
text-decoration: none;
|
|
478
|
+
color: inherit;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.link-text {
|
|
482
|
+
position: relative;
|
|
483
|
+
display: inline-block;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.link-text::after {
|
|
487
|
+
content: "";
|
|
488
|
+
position: absolute;
|
|
489
|
+
left: 0;
|
|
490
|
+
bottom: 0;
|
|
491
|
+
width: 100%;
|
|
492
|
+
height: 1px;
|
|
493
|
+
background-color: currentColor;
|
|
494
|
+
opacity: 0;
|
|
495
|
+
transition: opacity 0.3s ease, height 0.3s ease;
|
|
496
|
+
pointer-events: none;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
:host a:hover .link-text::after {
|
|
500
|
+
opacity: 1;
|
|
501
|
+
height: 1px;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
:host(:not([endIcon])) .link-text::after {
|
|
505
|
+
opacity: 1;
|
|
506
|
+
height: 1px;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
:host(:not([endIcon])) a:hover .link-text::after {
|
|
510
|
+
opacity: 0;
|
|
511
|
+
}
|
|
512
|
+
/* End of underline effect */
|
|
513
|
+
`;k([c({type:String})],$.prototype,"href",2);k([c({type:String})],$.prototype,"target",2);k([c({type:String,reflect:!0})],$.prototype,"template",2);k([c({type:Boolean,reflect:!0})],$.prototype,"inverse",2);k([c({type:Boolean,reflect:!0})],$.prototype,"endIcon",2);k([c({type:Boolean,reflect:!0})],$.prototype,"reverseEndIcon",2);$=k([Z("o-link")],$);
|