@florid-kit/components 0.2.1 → 0.3.0
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/assets/icons/icons.d.ts +1 -0
- package/components/icon-button.d.ts +20 -0
- package/components/wishlist-button.d.ts +16 -0
- package/index.js +245 -18
- package/index.mjs +552 -218
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const iconsMap: Record<string, string>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
type bgstyle = "background-light" | "background-contrast" | "ghost-light" | "ghost-contrast" | "none";
|
|
4
|
+
type size = "small" | "medium" | "large";
|
|
5
|
+
type status = "empty" | "filled";
|
|
6
|
+
export declare class OccitaneIconButton extends LitElement {
|
|
7
|
+
static styles: import('lit').CSSResult;
|
|
8
|
+
bgstyle: bgstyle;
|
|
9
|
+
size: size;
|
|
10
|
+
status: status;
|
|
11
|
+
icon: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
"o-icon-button": OccitaneIconButton;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
type Status = "empty" | "filled";
|
|
4
|
+
export declare class OccitaneWishlistButton extends LitElement {
|
|
5
|
+
static styles: import('lit').CSSResult;
|
|
6
|
+
status: Status;
|
|
7
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
8
|
+
private toggleStatus;
|
|
9
|
+
setStatus(status: Status): void;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
"o-wishlist-button": OccitaneWishlistButton;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
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 I=globalThis,Q=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),rt=new WeakMap;let gt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)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(Q&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=rt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&rt.set(e,t))}return t}toString(){return this.cssText}};const ft=i=>new gt(typeof i=="string"?i:i+"",void 0,X),R=(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 gt(e,i,X)},St=(i,t)=>{if(Q)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=I.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},it=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ft(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:xt,defineProperty:Et,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ct,getOwnPropertySymbols:Ot,getPrototypeOf:Ut}=Object,v=globalThis,ot=v.trustedTypes,Tt=ot?ot.emptyScript:"",W=v.reactiveElementPolyfillSupport,U=(i,t)=>i,L={toAttribute(i,t){switch(t){case Boolean:i=i?Tt: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}},Y=(i,t)=>!xt(i,t),nt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Y};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);class E 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=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Et(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=Pt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const l=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=Ut(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const e=this.properties,s=[...Ct(e),...Ot(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(it(r))}else t!==void 0&&e.push(it(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 St(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)}_$EC(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:L).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:L;this._$Em=r,this[r]=l.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??Y)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){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)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}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._$EU()}catch(r){throw t=!1,this._$EU(),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)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[U("elementProperties")]=new Map,E[U("finalized")]=new Map,W==null||W({ReactiveElement:E}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.0.4");/**
|
|
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 T=globalThis,D=T.trustedTypes,at=D?D.createPolicy("lit-html",{createHTML:i=>i}):void 0,$t="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,vt="?"+$,kt=`<${vt}>`,w=document,H=()=>w.createComment(""),M=i=>i===null||typeof i!="object"&&typeof i!="function",tt=Array.isArray,Ht=i=>tt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",q=`[
|
|
14
|
+
\f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,y=RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,_t=/^(?:script|style|textarea|title)$/i,Mt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),k=Mt(1),S=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ut=new WeakMap,m=w.createTreeWalker(w,129);function yt(i,t){if(!tt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}const Nt=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=O;for(let l=0;l<e;l++){const a=i[l];let d,u,h=-1,g=0;for(;g<a.length&&(o.lastIndex=g,u=o.exec(a),u!==null);)g=o.lastIndex,o===O?u[1]==="!--"?o=lt:u[1]!==void 0?o=ht:u[2]!==void 0?(_t.test(u[2])&&(r=RegExp("</"+u[2],"g")),o=y):u[3]!==void 0&&(o=y):o===y?u[0]===">"?(o=r??O,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?y:u[3]==='"'?dt:ct):o===dt||o===ct?o=y:o===lt||o===ht?o=O:(o=y,r=void 0);const f=o===y&&i[l+1].startsWith("/>")?" ":"";n+=o===O?a+kt:h>=0?(s.push(d),a.slice(0,h)+$t+a.slice(h)+$+f):a+$+(h===-2?l:f)}return[yt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const l=t.length-1,a=this.parts,[d,u]=Nt(t,e);if(this.el=N.createElement(d,s),m.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=m.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith($t)){const g=u[o++],f=r.getAttribute(h).split($),z=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:z[2],strings:f,ctor:z[1]==="."?jt:z[1]==="?"?zt:z[1]==="@"?It:V}),r.removeAttribute(h)}else h.startsWith($)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(_t.test(r.tagName)){const h=r.textContent.split($),g=h.length-1;if(g>0){r.textContent=D?D.emptyScript:"";for(let f=0;f<g;f++)r.append(h[f],H()),m.nextNode(),a.push({type:2,index:++n});r.append(h[g],H())}}}else if(r.nodeType===8)if(r.data===vt)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf($,h+1))!==-1;)a.push({type:7,index:n}),h+=$.length-1}n++}}static createElement(t,e){const s=w.createElement("template");return s.innerHTML=t,s}}function P(i,t,e=i,s){var o,l;if(t===S)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=M(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=P(i,r._$AS(i,t.values),r,s)),t}class Rt{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)??w).importNode(e,!0);m.currentNode=r;let n=m.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new j(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Lt(n,this,t)),this._$AV.push(d),a=s[++l]}o!==(a==null?void 0:a.index)&&(n=m.nextNode(),o++)}return m.currentNode=w,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 j{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=c,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=P(this,t,e),M(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ht(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!==c&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.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=N.createElement(yt(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 Rt(r,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=ut.get(t.strings);return e===void 0&&ut.set(t.strings,e=new N(t)),e}k(t){tt(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 j(this.O(H()),this.O(H()),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 V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=c,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=c}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=P(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const l=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=P(this,l[s+a],e,a),d===S&&(d=this._$AH[a]),o||(o=!M(d)||d!==this._$AH[a]),d===c?t=c:t!==c&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}o&&!r&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class jt extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class zt extends V{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class It extends V{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??c)===S)return;const s=this._$AH,r=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==c&&(s===c||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 Lt{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){P(this,t)}}const F=T.litHtmlPolyfillSupport;F==null||F(N,j),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.2.1");const Dt=(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 j(t.insertBefore(H(),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
|
-
*/let
|
|
19
|
+
*/let A=class extends E{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=Dt(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 S}};var bt;A._$litElement$=!0,A.finalized=!0,(bt=globalThis.litElementHydrateSupport)==null||bt.call(globalThis,{LitElement:A});const Z=globalThis.litElementPolyfillSupport;Z==null||Z({LitElement:A});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const et=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 Bt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Y},Vt=(i=Bt,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),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.P(o,void 0,i),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 p(i){return(t,e)=>typeof e=="object"?Vt(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}const Wt=R`
|
|
28
28
|
outline: 1px dashed var(--button-border-color);
|
|
29
29
|
outline-offset: 2px;
|
|
30
30
|
outline: dashed black;
|
|
31
|
-
`;
|
|
31
|
+
`;R`
|
|
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 st=Symbol("internals"),J=Symbol("privateInternals");function qt(i){var t;class e extends i{get[(t=st,t)](){return this[J]||(this[J]=this.attachInternals()),this[J]}}return e}/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2023 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/function
|
|
43
|
+
*/function Ft(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[st]: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 Zt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,x=(i,t,e,s)=>{for(var r=s>1?void 0:s?Jt(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&&Zt(t,e,r),r};const Kt=qt(A),pt=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,20 +53,20 @@
|
|
|
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 ft(t)},Gt=["primary","secondary"];let b=class extends Kt{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[st].form}willUpdate(){const i=getComputedStyle(this).getPropertyValue("--button-variant");i&&Gt.some(t=>t===i)&&(this.variant=i)}render(){const i=this.href?this.renderLink():this.renderButton();return k`${i}`}renderLink(){return k`<a href=${this.href} target=${this.target||c} class="button" ?disabled=${this.disabled}>
|
|
57
57
|
<slot />
|
|
58
|
-
</a>`}renderButton(){return
|
|
58
|
+
</a>`}renderButton(){return k`<button class="button" ?disabled=${this.disabled}>
|
|
59
59
|
<slot />
|
|
60
|
-
</button>`}};
|
|
60
|
+
</button>`}};Ft(b);b.formAssociated=!0;b.styles=R`
|
|
61
61
|
:host {
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
cursor: pointer;
|
|
64
|
-
${
|
|
64
|
+
${pt("primary")};
|
|
65
65
|
--button-border: transparent;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
:host([variant="secondary"]) {
|
|
69
|
-
${
|
|
69
|
+
${pt("secondary")};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
:host([disabled]) {
|
|
@@ -127,6 +127,233 @@
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.button:focus-visible {
|
|
130
|
-
${
|
|
130
|
+
${Wt};
|
|
131
131
|
}
|
|
132
|
-
`;
|
|
132
|
+
`;x([p()],b.prototype,"type",2);x([p({reflect:!0})],b.prototype,"value",2);x([p({reflect:!0})],b.prototype,"variant",2);x([p({converter:{fromAttribute:i=>i===""||i==="true"}})],b.prototype,"disabled",2);x([p()],b.prototype,"href",2);x([p()],b.prototype,"target",2);b=x([et("o-button")],b);/**
|
|
133
|
+
* @license
|
|
134
|
+
* Copyright 2017 Google LLC
|
|
135
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
136
|
+
*/const Qt={CHILD:2},Xt=i=>(...t)=>({_$litDirective$:i,values:t});class Yt{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
|
+
* @license
|
|
138
|
+
* Copyright 2017 Google LLC
|
|
139
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
140
|
+
*/class K extends Yt{constructor(t){if(super(t),this.it=c,t.type!==Qt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===c||t==null)return this._t=void 0,this.it=t;if(t===S)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:[]}}}K.directiveName="unsafeHTML",K.resultType=1;/**
|
|
141
|
+
* @license
|
|
142
|
+
* Copyright 2017 Google LLC
|
|
143
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
144
|
+
*/class G extends K{}G.directiveName="unsafeSVG",G.resultType=2;const mt=Xt(G),te=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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
|
+
</svg>
|
|
147
|
+
`,At={wishlist:te};var ee=Object.defineProperty,se=Object.getOwnPropertyDescriptor,wt=(i,t,e,s)=>{for(var r=s>1?void 0:s?se(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&&ee(t,e,r),r};let B=class extends A{constructor(){super(...arguments),this.status="empty"}render(){const i=At.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return k`
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
aria-label="Add to wishlist"
|
|
151
|
+
aria-pressed="${this.status=="filled"?"true":"false"}"
|
|
152
|
+
class="wishlist-button"
|
|
153
|
+
@click="${this.toggleStatus}"
|
|
154
|
+
>
|
|
155
|
+
${mt(i)}
|
|
156
|
+
</button>
|
|
157
|
+
`}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}};B.styles=R`
|
|
158
|
+
:host {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
align-items: center;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.wishlist-button {
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
align-items: center;
|
|
169
|
+
width: 32px;
|
|
170
|
+
height: 32px;
|
|
171
|
+
border: transparent;
|
|
172
|
+
border-radius: var(--radius-full);
|
|
173
|
+
background-color: var(--color-alpha-light-strong);
|
|
174
|
+
position: relative;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.wishlist-button:hover {
|
|
178
|
+
background-color: var(--color-alpha-light-stronger);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([status="filled"]) .wishlist-button {
|
|
182
|
+
background-color: var(--color-alpha-light-strongest);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.wishlist-button:hover svg path {
|
|
186
|
+
fill: var(--color-content-action-secondary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:host([status="filled"]) .wishlist-button svg path {
|
|
190
|
+
fill: var(--color-content-action-secondary);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([status="filled"]) .wishlist-button:hover svg path {
|
|
194
|
+
fill: var(--color-alpha-light-strong);
|
|
195
|
+
}
|
|
196
|
+
`;wt([p({type:String,reflect:!0})],B.prototype,"status",2);B=wt([et("o-wishlist-button")],B);var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,C=(i,t,e,s)=>{for(var r=s>1?void 0:s?ie(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&&re(t,e,r),r};let _=class extends A{constructor(){super(...arguments),this.bgstyle="background-light",this.size="medium",this.status="empty",this.icon="wishlist",this.disabled=!1}render(){const t=(At[this.icon]??"").replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return k`
|
|
197
|
+
<button
|
|
198
|
+
type="button"
|
|
199
|
+
aria-label="icon"
|
|
200
|
+
class="icon-button ${this.size} ${this.bgstyle} ${this.status}"
|
|
201
|
+
?disabled="${this.disabled}"
|
|
202
|
+
>
|
|
203
|
+
${mt(t)}
|
|
204
|
+
</button>
|
|
205
|
+
`}};_.styles=R`
|
|
206
|
+
:host {
|
|
207
|
+
display: inline-flex;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
align-items: center;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.icon-button {
|
|
213
|
+
display: flex;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
align-items: center;
|
|
216
|
+
width: 32px;
|
|
217
|
+
height: 32px;
|
|
218
|
+
border: transparent;
|
|
219
|
+
border-radius: var(--radius-full);
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
position: relative;
|
|
222
|
+
|
|
223
|
+
svg {
|
|
224
|
+
path {
|
|
225
|
+
stroke: var(--color-content-action-secondary);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.icon-button.filled svg {
|
|
231
|
+
fill: var(--color-content-action-secondary);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.icon-button.small {
|
|
235
|
+
width: 20px;
|
|
236
|
+
height: 20px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.icon-button.medium {
|
|
240
|
+
width: 32px;
|
|
241
|
+
height: 32px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.icon-button.large {
|
|
245
|
+
width: 40px;
|
|
246
|
+
height: 40px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.icon-button.none-light, .icon-button.none-contrast {
|
|
250
|
+
background-color: transparent;
|
|
251
|
+
width: auto;
|
|
252
|
+
height: auto;
|
|
253
|
+
|
|
254
|
+
&.small {
|
|
255
|
+
svg {
|
|
256
|
+
width: 8px;
|
|
257
|
+
height: 8px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&.medium {
|
|
262
|
+
svg {
|
|
263
|
+
width: 16px;
|
|
264
|
+
height: 16px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&.large {
|
|
269
|
+
svg {
|
|
270
|
+
width: 24px;
|
|
271
|
+
height: 24px;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&:disabled {
|
|
276
|
+
background-color: transparent;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.icon-button.none-light {
|
|
281
|
+
svg {
|
|
282
|
+
path {
|
|
283
|
+
stroke: var(--color-content-action-primary);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.icon-button.background-light {
|
|
289
|
+
background-color: var(--color-alpha-light-strong);
|
|
290
|
+
|
|
291
|
+
&:hover:not(:disabled) {
|
|
292
|
+
background-color: var(--color-alpha-light-stronger);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&:active:not(:disabled) {
|
|
296
|
+
background-color: var(--color-alpha-light-strongest);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.icon-button.background-contrast {
|
|
301
|
+
background-color: var(--color-container-action-tertiary-default);
|
|
302
|
+
|
|
303
|
+
&:hover:not(:disabled) {
|
|
304
|
+
background-color: var(--color-container-action-tertiary-hover);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
&:active:not(:disabled) {
|
|
308
|
+
background-color: var(--color-container-action-tertiary-pressed);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.icon-button.ghost-light {
|
|
313
|
+
background-color: transparent;
|
|
314
|
+
/* &.filled {
|
|
315
|
+
svg {
|
|
316
|
+
fill: var(--color-content-action-primary);
|
|
317
|
+
}
|
|
318
|
+
} */
|
|
319
|
+
|
|
320
|
+
svg {
|
|
321
|
+
path {
|
|
322
|
+
stroke: var(--color-content-action-primary);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&:hover:not(:disabled) {
|
|
327
|
+
background-color: var(--color-alpha-light-lightest);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&:active:not(:disabled) {
|
|
331
|
+
background-color: var(--color-alpha-light-light);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.icon-button.ghost-contrast {
|
|
336
|
+
background-color: transparent;
|
|
337
|
+
|
|
338
|
+
&:hover:not(:disabled) {
|
|
339
|
+
background-color: var(--color-alpha-light-medium);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&:active:not(:disabled) {
|
|
343
|
+
background-color: var(--color-alpha-light-strongest);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.icon-button:disabled {
|
|
348
|
+
background-color: var(--color-container-disabled);
|
|
349
|
+
|
|
350
|
+
svg {
|
|
351
|
+
fill: var(--color-content-disabled);
|
|
352
|
+
|
|
353
|
+
path {
|
|
354
|
+
stroke: var(--color-content-disabled);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
}
|
|
359
|
+
`;C([p({type:String,reflect:!0})],_.prototype,"bgstyle",2);C([p({type:String,reflect:!0})],_.prototype,"size",2);C([p({type:String,reflect:!0})],_.prototype,"status",2);C([p({type:String})],_.prototype,"icon",2);C([p({type:Boolean,reflect:!0})],_.prototype,"disabled",2);_=C([et("o-icon-button")],_);
|