@florid-kit/components 0.3.4 → 0.3.5
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/wishlist-button.d.ts +4 -0
- package/index.js +47 -30
- package/index.mjs +162 -133
- package/package.json +2 -2
|
@@ -4,9 +4,13 @@ type Status = "empty" | "filled";
|
|
|
4
4
|
export declare class OccitaneWishlistButton extends LitElement {
|
|
5
5
|
static styles: import('lit').CSSResult;
|
|
6
6
|
status: Status;
|
|
7
|
+
ariaDescribedBy: string;
|
|
8
|
+
label: string;
|
|
7
9
|
protected render(): import('lit').TemplateResult<1>;
|
|
8
10
|
private toggleStatus;
|
|
9
11
|
setStatus(status: Status): void;
|
|
12
|
+
setAriaDescribedBy(ariaDescribedBy: string): void;
|
|
13
|
+
setLabel(label: string): void;
|
|
10
14
|
}
|
|
11
15
|
declare global {
|
|
12
16
|
interface HTMLElementTagNameMap {
|
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 z=globalThis,tt=z.ShadowRoot&&(z.ShadyCSS===void 0||z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,et=Symbol(),nt=new WeakMap;let vt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==et)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(tt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&nt.set(e,t))}return t}toString(){return this.cssText}};const yt=i=>new vt(typeof i=="string"?i:i+"",void 0,et),B=(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 vt(e,i,et)},Et=(i,t)=>{if(tt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=z.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},at=tt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return yt(e)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:xt,defineProperty:Ct,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ot,getOwnPropertySymbols:
|
|
9
|
+
*/const{is:xt,defineProperty:Ct,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ot,getOwnPropertySymbols:Ut,getPrototypeOf:kt}=Object,y=globalThis,lt=y.trustedTypes,Mt=lt?lt.emptyScript:"",F=y.reactiveElementPolyfillSupport,T=(i,t)=>i,I={toAttribute(i,t){switch(t){case Boolean:i=i?Mt: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}},st=(i,t)=>!xt(i,t),ht={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:st};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),y.litPropertyMetadata??(y.litPropertyMetadata=new WeakMap);let O=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=ht){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&&Ct(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: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)??ht}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Ot(e),...Ut(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(at(r))}else t!==void 0&&e.push(at(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 Et(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:I).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:I;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??st)(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){}};O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[T("elementProperties")]=new Map,O[T("finalized")]=new Map,F==null||F({ReactiveElement:O}),(y.reactiveElementVersions??(y.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 H=globalThis,V=H.trustedTypes,ct=V?V.createPolicy("lit-html",{createHTML:i=>i}):void 0,mt="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,_t="?"+v,Tt=`<${_t}>`,x=document,N=()=>x.createComment(""),D=i=>i===null||typeof i!="object"&&typeof i!="function",rt=Array.isArray,Ht=i=>rt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Z=`[
|
|
14
|
+
\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dt=/-->/g,ut=/>/g,_=RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,bt=/"/g,At=/^(?:script|style|textarea|title)$/i,Nt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),w=Nt(1),C=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),gt=new WeakMap,A=x.createTreeWalker(x,129);function wt(i,t){if(!rt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ct!==void 0?ct.createHTML(t):t}const Dt=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=M;for(let l=0;l<e;l++){const a=i[l];let d,u,h=-1,$=0;for(;$<a.length&&(o.lastIndex=$,u=o.exec(a),u!==null);)$=o.lastIndex,o===M?u[1]==="!--"?o=dt:u[1]!==void 0?o=ut:u[2]!==void 0?(At.test(u[2])&&(r=RegExp("</"+u[2],"g")),o=_):u[3]!==void 0&&(o=_):o===_?u[0]===">"?(o=r??M,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?_:u[3]==='"'?bt:pt):o===bt||o===pt?o=_:o===dt||o===ut?o=M:(o=_,r=void 0);const f=o===_&&i[l+1].startsWith("/>")?" ":"";n+=o===M?a+Tt:h>=0?(s.push(d),a.slice(0,h)+mt+a.slice(h)+v+f):a+v+(h===-2?l:f)}return[wt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class R{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]=Dt(t,e);if(this.el=R.createElement(d,s),A.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=A.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith(mt)){const $=u[o++],f=r.getAttribute(h).split(v),L=/([.?@])?(.*)/.exec($);a.push({type:1,index:n,name:L[2],strings:f,ctor:L[1]==="."?Bt:L[1]==="?"?jt:L[1]==="@"?Lt:q}),r.removeAttribute(h)}else h.startsWith(v)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(At.test(r.tagName)){const h=r.textContent.split(v),$=h.length-1;if($>0){r.textContent=V?V.emptyScript:"";for(let f=0;f<$;f++)r.append(h[f],N()),A.nextNode(),a.push({type:2,index:++n});r.append(h[$],N())}}}else if(r.nodeType===8)if(r.data===_t)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(v,h+1))!==-1;)a.push({type:7,index:n}),h+=v.length-1}n++}}static createElement(t,e){const s=x.createElement("template");return s.innerHTML=t,s}}function U(i,t,e=i,s){var o,l;if(t===C)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=D(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=U(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)??x).importNode(e,!0);A.currentNode=r;let n=A.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 zt(n,this,t)),this._$AV.push(d),a=s[++l]}o!==(a==null?void 0:a.index)&&(n=A.nextNode(),o++)}return A.currentNode=x,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=U(this,t,e),D(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==C&&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&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(x.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=R.createElement(wt(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=gt.get(t.strings);return e===void 0&>.set(t.strings,e=new R(t)),e}k(t){rt(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(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 q{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=U(this,t,e,0),o=!D(t)||t!==this._$AH&&t!==C,o&&(this._$AH=t);else{const l=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=U(this,l[s+a],e,a),d===C&&(d=this._$AH[a]),o||(o=!D(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 Bt extends q{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class jt extends q{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class Lt extends q{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??c)===C)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 zt{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){U(this,t)}}const J=H.litHtmlPolyfillSupport;J==null||J(R,j),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.3.0");const It=(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(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
|
|
19
|
+
*/const S=globalThis;let E=class extends O{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=It(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 C}};var ft;E._$litElement$=!0,E.finalized=!0,(ft=S.litElementHydrateSupport)==null||ft.call(S,{LitElement:E});const K=S.litElementPolyfillSupport;K==null||K({LitElement:E});(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 it=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 Vt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:
|
|
27
|
+
*/const Vt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:st},qt=(i=Vt,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 p(i){return(t,e)=>typeof e=="object"?qt(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 Wt=B`
|
|
28
28
|
outline: 1px dashed var(--button-border-color);
|
|
29
29
|
outline-offset: 2px;
|
|
30
30
|
outline: dashed black;
|
|
31
|
-
`;
|
|
31
|
+
`;B`
|
|
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 ot=Symbol("internals"),G=Symbol("privateInternals");function Ft(i){var t;class e extends i{get[(t=ot,t)](){return this[G]||(this[G]=this.attachInternals()),this[G]}}return e}/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2023 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/function Zt(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[
|
|
43
|
+
*/function Zt(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[ot]: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 Jt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,P=(i,t,e,s)=>{for(var r=s>1?void 0:s?Kt(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&&Jt(t,e,r),r};const Gt=Ft(E),$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,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 yt(t)},Qt=["primary","secondary"];let b=class extends Gt{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[ot].form}willUpdate(){const i=getComputedStyle(this).getPropertyValue("--button-variant");i&&Qt.some(t=>t===i)&&(this.variant=i)}render(){const i=this.href?this.renderLink():this.renderButton();return w`${i}`}renderLink(){return w`<a href=${this.href} target=${this.target||c} class="button" ?disabled=${this.disabled}>
|
|
57
57
|
<slot />
|
|
58
58
|
</a>`}renderButton(){return w`<button class="button" ?disabled=${this.disabled}>
|
|
59
59
|
<slot />
|
|
60
|
-
</button>`}};Zt(b);b.formAssociated=!0;b.styles=
|
|
60
|
+
</button>`}};Zt(b);b.formAssociated=!0;b.styles=B`
|
|
61
61
|
:host {
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
cursor: pointer;
|
|
64
|
-
${
|
|
64
|
+
${$t("primary")};
|
|
65
65
|
--button-border: transparent;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
:host([variant="secondary"]) {
|
|
69
|
-
${
|
|
69
|
+
${$t("secondary")};
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
:host([disabled]) {
|
|
@@ -127,9 +127,9 @@
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.button:focus-visible {
|
|
130
|
-
${
|
|
130
|
+
${Wt};
|
|
131
131
|
}
|
|
132
|
-
`;P([p()],b.prototype,"type",2);P([p({reflect:!0})],b.prototype,"value",2);P([p({reflect:!0})],b.prototype,"variant",2);P([p({converter:{fromAttribute:i=>i===""||i==="true"}})],b.prototype,"disabled",2);P([p()],b.prototype,"href",2);P([p()],b.prototype,"target",2);b=P([
|
|
132
|
+
`;P([p()],b.prototype,"type",2);P([p({reflect:!0})],b.prototype,"value",2);P([p({reflect:!0})],b.prototype,"variant",2);P([p({converter:{fromAttribute:i=>i===""||i==="true"}})],b.prototype,"disabled",2);P([p()],b.prototype,"href",2);P([p()],b.prototype,"target",2);b=P([it("o-button")],b);/**
|
|
133
133
|
* @license
|
|
134
134
|
* Copyright 2017 Google LLC
|
|
135
135
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -137,27 +137,29 @@
|
|
|
137
137
|
* @license
|
|
138
138
|
* Copyright 2017 Google LLC
|
|
139
139
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
140
|
-
*/class
|
|
140
|
+
*/class Q extends te{constructor(t){if(super(t),this.it=c,t.type!==Xt.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===C)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:[]}}}Q.directiveName="unsafeHTML",Q.resultType=1;/**
|
|
141
141
|
* @license
|
|
142
142
|
* Copyright 2017 Google LLC
|
|
143
143
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
144
|
-
*/class
|
|
144
|
+
*/class X extends Q{}X.directiveName="unsafeSVG",X.resultType=2;const Y=Yt(X),ee=`<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
|
`,se=`<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
|
+
`,St={wishlist:ee,playerv:se};var re=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,W=(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 k=class extends E{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 w`
|
|
151
151
|
<button
|
|
152
152
|
type="button"
|
|
153
|
-
aria-label="
|
|
153
|
+
aria-label="${this.label}"
|
|
154
|
+
aria-describedby="${this.ariaDescribedBy}"
|
|
154
155
|
aria-pressed="${this.status=="filled"?"true":"false"}"
|
|
155
156
|
class="wishlist-button"
|
|
156
157
|
@click="${this.toggleStatus}"
|
|
157
158
|
>
|
|
158
|
-
|
|
159
|
+
<span class="sr-only">${this.label}</span>
|
|
160
|
+
${Y(i)}
|
|
159
161
|
</button>
|
|
160
|
-
`}toggleStatus(){this.status=this.status=="empty"?"filled":"empty"}setStatus(i){this.status=i,this.requestUpdate()}};
|
|
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()}};k.styles=B`
|
|
161
163
|
:host {
|
|
162
164
|
display: inline-flex;
|
|
163
165
|
justify-content: center;
|
|
@@ -169,14 +171,29 @@
|
|
|
169
171
|
display: flex;
|
|
170
172
|
justify-content: center;
|
|
171
173
|
align-items: center;
|
|
172
|
-
width:
|
|
173
|
-
height:
|
|
174
|
+
width: 40px;
|
|
175
|
+
height: 40px;
|
|
174
176
|
border: transparent;
|
|
175
177
|
border-radius: var(--radius-full);
|
|
176
178
|
background-color: var(--color-alpha-light-strong);
|
|
177
179
|
position: relative;
|
|
180
|
+
cursor: pointer;
|
|
178
181
|
}
|
|
179
182
|
|
|
183
|
+
.sr-only {
|
|
184
|
+
border: 0 !important;
|
|
185
|
+
clip: rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;
|
|
186
|
+
-webkit-clip-path: inset(50%) !important;
|
|
187
|
+
clip-path: inset(50%) !important;
|
|
188
|
+
height: 0.1rem !important;
|
|
189
|
+
margin: -0.1rem !important;
|
|
190
|
+
overflow: hidden !important;
|
|
191
|
+
padding: 0 !important;
|
|
192
|
+
position: absolute !important;
|
|
193
|
+
width: 0.1rem !important;
|
|
194
|
+
white-space: nowrap !important;
|
|
195
|
+
}
|
|
196
|
+
|
|
180
197
|
.wishlist-button:hover {
|
|
181
198
|
background-color: var(--color-alpha-light-stronger);
|
|
182
199
|
}
|
|
@@ -196,10 +213,10 @@
|
|
|
196
213
|
:host([status="filled"]) .wishlist-button:hover svg path {
|
|
197
214
|
fill: var(--color-alpha-light-strong);
|
|
198
215
|
}
|
|
199
|
-
`;
|
|
216
|
+
`;W([p({type:String,reflect:!0})],k.prototype,"status",2);W([p({type:String,reflect:!0})],k.prototype,"ariaDescribedBy",2);W([p({type:String,reflect:!0})],k.prototype,"label",2);k=W([it("o-wishlist-button")],k);var oe=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,m=(i,t,e,s)=>{for(var r=s>1?void 0:s?ne(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&&oe(t,e,r),r};let g=class extends E{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 t=(St[this.icon]??"").replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return w`
|
|
200
217
|
${this.type==="span"?w`
|
|
201
218
|
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status}" ?disabled="${this.disabled}">
|
|
202
|
-
${
|
|
219
|
+
${Y(t)}
|
|
203
220
|
</span>
|
|
204
221
|
`:w`
|
|
205
222
|
<button
|
|
@@ -208,10 +225,10 @@
|
|
|
208
225
|
class="icon-button ${this.size} ${this.bgstyle} ${this.status}"
|
|
209
226
|
?disabled="${this.disabled}"
|
|
210
227
|
>
|
|
211
|
-
${
|
|
228
|
+
${Y(t)}
|
|
212
229
|
</button>
|
|
213
230
|
`}
|
|
214
|
-
`}};g.styles=
|
|
231
|
+
`}};g.styles=B`
|
|
215
232
|
:host {
|
|
216
233
|
display: inline-flex;
|
|
217
234
|
justify-content: center;
|
|
@@ -363,4 +380,4 @@
|
|
|
363
380
|
}
|
|
364
381
|
|
|
365
382
|
}
|
|
366
|
-
`;
|
|
383
|
+
`;m([p({type:String,reflect:!0})],g.prototype,"bgstyle",2);m([p({type:String,reflect:!0})],g.prototype,"size",2);m([p({type:String,reflect:!0})],g.prototype,"status",2);m([p({type:String,reflect:!0})],g.prototype,"type",2);m([p({type:String})],g.prototype,"strokewidth",2);m([p({type:String})],g.prototype,"icon",2);m([p({type:Boolean,reflect:!0})],g.prototype,"disabled",2);g=m([it("o-icon-button")],g);
|
package/index.mjs
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
7
|
-
let
|
|
6
|
+
const z = globalThis, tt = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, et = Symbol(), nt = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let vt = class {
|
|
8
8
|
constructor(t, e, s) {
|
|
9
|
-
if (this._$cssResult$ = !0, s !==
|
|
9
|
+
if (this._$cssResult$ = !0, s !== et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = t, this.t = e;
|
|
11
11
|
}
|
|
12
12
|
get styleSheet() {
|
|
13
13
|
let t = this.o;
|
|
14
14
|
const e = this.t;
|
|
15
|
-
if (
|
|
15
|
+
if (tt && t === void 0) {
|
|
16
16
|
const s = e !== void 0 && e.length === 1;
|
|
17
|
-
s && (t =
|
|
17
|
+
s && (t = nt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && nt.set(e, t));
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
@@ -22,30 +22,30 @@ let ft = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const yt = (i) => new vt(typeof i == "string" ? i : i + "", void 0, et), B = (i, ...t) => {
|
|
26
26
|
const e = i.length === 1 ? i[0] : t.reduce((s, r, n) => s + ((o) => {
|
|
27
27
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
28
28
|
if (typeof o == "number") return o;
|
|
29
29
|
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.");
|
|
30
30
|
})(r) + i[n + 1], i[0]);
|
|
31
|
-
return new
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
31
|
+
return new vt(e, i, et);
|
|
32
|
+
}, Et = (i, t) => {
|
|
33
|
+
if (tt) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
34
|
else for (const e of t) {
|
|
35
|
-
const s = document.createElement("style"), r =
|
|
35
|
+
const s = document.createElement("style"), r = z.litNonce;
|
|
36
36
|
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, at = tt ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let e = "";
|
|
40
40
|
for (const s of t.cssRules) e += s.cssText;
|
|
41
|
-
return
|
|
41
|
+
return yt(e);
|
|
42
42
|
})(i) : i;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is: xt, defineProperty: Ct, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ot, getOwnPropertySymbols:
|
|
48
|
+
const { is: xt, defineProperty: Ct, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ot, getOwnPropertySymbols: Ut, getPrototypeOf: kt } = Object, y = globalThis, lt = y.trustedTypes, Mt = lt ? lt.emptyScript : "", F = y.reactiveElementPolyfillSupport, T = (i, t) => i, I = { toAttribute(i, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
i = i ? Mt : null;
|
|
@@ -73,7 +73,7 @@ const { is: xt, defineProperty: Ct, getOwnPropertyDescriptor: Pt, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
|
-
} },
|
|
76
|
+
} }, st = (i, t) => !xt(i, t), ht = { attribute: !0, type: String, converter: I, reflect: !1, useDefault: !1, hasChanged: st };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), y.litPropertyMetadata ?? (y.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
let O = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
@@ -82,7 +82,7 @@ let O = class extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t, e =
|
|
85
|
+
static createProperty(t, e = ht) {
|
|
86
86
|
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) {
|
|
87
87
|
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
88
88
|
r !== void 0 && Ct(this.prototype, t, r);
|
|
@@ -100,17 +100,17 @@ let O = class extends HTMLElement {
|
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
102
|
static getPropertyOptions(t) {
|
|
103
|
-
return this.elementProperties.get(t) ??
|
|
103
|
+
return this.elementProperties.get(t) ?? ht;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(
|
|
107
|
-
const t =
|
|
106
|
+
if (this.hasOwnProperty(T("elementProperties"))) return;
|
|
107
|
+
const t = kt(this);
|
|
108
108
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
109
109
|
}
|
|
110
110
|
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(
|
|
112
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
113
|
-
const e = this.properties, s = [...Ot(e), ...
|
|
111
|
+
if (this.hasOwnProperty(T("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
|
|
113
|
+
const e = this.properties, s = [...Ot(e), ...Ut(e)];
|
|
114
114
|
for (const r of s) this.createProperty(r, e[r]);
|
|
115
115
|
}
|
|
116
116
|
const t = this[Symbol.metadata];
|
|
@@ -129,8 +129,8 @@ let O = class extends HTMLElement {
|
|
|
129
129
|
const e = [];
|
|
130
130
|
if (Array.isArray(t)) {
|
|
131
131
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
132
|
-
for (const r of s) e.unshift(
|
|
133
|
-
} else t !== void 0 && e.push(
|
|
132
|
+
for (const r of s) e.unshift(at(r));
|
|
133
|
+
} else t !== void 0 && e.push(at(t));
|
|
134
134
|
return e;
|
|
135
135
|
}
|
|
136
136
|
static _$Eu(t, e) {
|
|
@@ -159,7 +159,7 @@ let O = class extends HTMLElement {
|
|
|
159
159
|
}
|
|
160
160
|
createRenderRoot() {
|
|
161
161
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
162
|
-
return
|
|
162
|
+
return Et(t, this.constructor.elementStyles), t;
|
|
163
163
|
}
|
|
164
164
|
connectedCallback() {
|
|
165
165
|
var t;
|
|
@@ -200,7 +200,7 @@ let O = class extends HTMLElement {
|
|
|
200
200
|
var r;
|
|
201
201
|
if (t !== void 0) {
|
|
202
202
|
const n = this.constructor, o = this[t];
|
|
203
|
-
if (s ?? (s = n.getPropertyOptions(t)), !((s.hasChanged ??
|
|
203
|
+
if (s ?? (s = n.getPropertyOptions(t)), !((s.hasChanged ?? st)(o, e) || s.useDefault && s.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(t)) && !this.hasAttribute(n._$Eu(t, s)))) return;
|
|
204
204
|
this.C(t, e, s);
|
|
205
205
|
}
|
|
206
206
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -276,53 +276,53 @@ let O = class extends HTMLElement {
|
|
|
276
276
|
firstUpdated(t) {
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
|
-
O.elementStyles = [], O.shadowRootOptions = { mode: "open" }, O[
|
|
279
|
+
O.elementStyles = [], O.shadowRootOptions = { mode: "open" }, O[T("elementProperties")] = /* @__PURE__ */ new Map(), O[T("finalized")] = /* @__PURE__ */ new Map(), F == null || F({ ReactiveElement: O }), (y.reactiveElementVersions ?? (y.reactiveElementVersions = [])).push("2.1.0");
|
|
280
280
|
/**
|
|
281
281
|
* @license
|
|
282
282
|
* Copyright 2017 Google LLC
|
|
283
283
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
284
284
|
*/
|
|
285
|
-
const
|
|
286
|
-
\f\r]`,
|
|
287
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
288
|
-
function
|
|
289
|
-
if (!
|
|
290
|
-
return
|
|
285
|
+
const H = globalThis, V = H.trustedTypes, ct = V ? V.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, mt = "$lit$", v = `lit$${Math.random().toFixed(9).slice(2)}$`, _t = "?" + v, Tt = `<${_t}>`, x = document, N = () => x.createComment(""), D = (i) => i === null || typeof i != "object" && typeof i != "function", rt = Array.isArray, Ht = (i) => rt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", Z = `[
|
|
286
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, dt = /-->/g, ut = />/g, _ = RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^
|
|
287
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, bt = /"/g, At = /^(?:script|style|textarea|title)$/i, Nt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), w = Nt(1), C = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), A = x.createTreeWalker(x, 129);
|
|
288
|
+
function wt(i, t) {
|
|
289
|
+
if (!rt(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
290
|
+
return ct !== void 0 ? ct.createHTML(t) : t;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
292
|
+
const Dt = (i, t) => {
|
|
293
293
|
const e = i.length - 1, s = [];
|
|
294
|
-
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
294
|
+
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = M;
|
|
295
295
|
for (let l = 0; l < e; l++) {
|
|
296
296
|
const a = i[l];
|
|
297
297
|
let d, u, h = -1, $ = 0;
|
|
298
|
-
for (; $ < a.length && (o.lastIndex = $, u = o.exec(a), u !== null); ) $ = o.lastIndex, o ===
|
|
299
|
-
const f = o ===
|
|
300
|
-
n += o ===
|
|
298
|
+
for (; $ < a.length && (o.lastIndex = $, u = o.exec(a), u !== null); ) $ = o.lastIndex, o === M ? u[1] === "!--" ? o = dt : u[1] !== void 0 ? o = ut : u[2] !== void 0 ? (At.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = _) : u[3] !== void 0 && (o = _) : o === _ ? u[0] === ">" ? (o = r ?? M, h = -1) : u[1] === void 0 ? h = -2 : (h = o.lastIndex - u[2].length, d = u[1], o = u[3] === void 0 ? _ : u[3] === '"' ? bt : pt) : o === bt || o === pt ? o = _ : o === dt || o === ut ? o = M : (o = _, r = void 0);
|
|
299
|
+
const f = o === _ && i[l + 1].startsWith("/>") ? " " : "";
|
|
300
|
+
n += o === M ? a + Tt : h >= 0 ? (s.push(d), a.slice(0, h) + mt + a.slice(h) + v + f) : a + v + (h === -2 ? l : f);
|
|
301
301
|
}
|
|
302
|
-
return [
|
|
302
|
+
return [wt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
303
303
|
};
|
|
304
304
|
class R {
|
|
305
305
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
306
306
|
let r;
|
|
307
307
|
this.parts = [];
|
|
308
308
|
let n = 0, o = 0;
|
|
309
|
-
const l = t.length - 1, a = this.parts, [d, u] =
|
|
309
|
+
const l = t.length - 1, a = this.parts, [d, u] = Dt(t, e);
|
|
310
310
|
if (this.el = R.createElement(d, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
311
311
|
const h = this.el.content.firstChild;
|
|
312
312
|
h.replaceWith(...h.childNodes);
|
|
313
313
|
}
|
|
314
314
|
for (; (r = A.nextNode()) !== null && a.length < l; ) {
|
|
315
315
|
if (r.nodeType === 1) {
|
|
316
|
-
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(
|
|
317
|
-
const $ = u[o++], f = r.getAttribute(h).split(v),
|
|
318
|
-
a.push({ type: 1, index: n, name:
|
|
316
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(mt)) {
|
|
317
|
+
const $ = u[o++], f = r.getAttribute(h).split(v), L = /([.?@])?(.*)/.exec($);
|
|
318
|
+
a.push({ type: 1, index: n, name: L[2], strings: f, ctor: L[1] === "." ? Bt : L[1] === "?" ? jt : L[1] === "@" ? Lt : q }), r.removeAttribute(h);
|
|
319
319
|
} else h.startsWith(v) && (a.push({ type: 6, index: n }), r.removeAttribute(h));
|
|
320
|
-
if (
|
|
320
|
+
if (At.test(r.tagName)) {
|
|
321
321
|
const h = r.textContent.split(v), $ = h.length - 1;
|
|
322
322
|
if ($ > 0) {
|
|
323
|
-
r.textContent =
|
|
324
|
-
for (let f = 0; f < $; f++) r.append(h[f],
|
|
325
|
-
r.append(h[$],
|
|
323
|
+
r.textContent = V ? V.emptyScript : "";
|
|
324
|
+
for (let f = 0; f < $; f++) r.append(h[f], N()), A.nextNode(), a.push({ type: 2, index: ++n });
|
|
325
|
+
r.append(h[$], N());
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
} else if (r.nodeType === 8) if (r.data === _t) a.push({ type: 2, index: n });
|
|
@@ -338,14 +338,14 @@ class R {
|
|
|
338
338
|
return s.innerHTML = t, s;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function U(i, t, e = i, s) {
|
|
342
342
|
var o, l;
|
|
343
343
|
if (t === C) return t;
|
|
344
344
|
let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
|
345
|
-
const n =
|
|
346
|
-
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 =
|
|
345
|
+
const n = D(t) ? void 0 : t._$litDirective$;
|
|
346
|
+
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 = U(i, r._$AS(i, t.values), r, s)), t;
|
|
347
347
|
}
|
|
348
|
-
class
|
|
348
|
+
class Rt {
|
|
349
349
|
constructor(t, e) {
|
|
350
350
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
351
351
|
}
|
|
@@ -362,7 +362,7 @@ class jt {
|
|
|
362
362
|
for (; a !== void 0; ) {
|
|
363
363
|
if (o === a.index) {
|
|
364
364
|
let d;
|
|
365
|
-
a.type === 2 ? d = new
|
|
365
|
+
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 zt(n, this, t)), this._$AV.push(d), a = s[++l];
|
|
366
366
|
}
|
|
367
367
|
o !== (a == null ? void 0 : a.index) && (n = A.nextNode(), o++);
|
|
368
368
|
}
|
|
@@ -373,7 +373,7 @@ class jt {
|
|
|
373
373
|
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++;
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
class
|
|
376
|
+
class j {
|
|
377
377
|
get _$AU() {
|
|
378
378
|
var t;
|
|
379
379
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
@@ -393,7 +393,7 @@ class z {
|
|
|
393
393
|
return this._$AB;
|
|
394
394
|
}
|
|
395
395
|
_$AI(t, e = this) {
|
|
396
|
-
t =
|
|
396
|
+
t = U(this, t, e), D(t) ? t === c || t == null || t === "" ? (this._$AH !== c && this._$AR(), this._$AH = c) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ht(t) ? this.k(t) : this._(t);
|
|
397
397
|
}
|
|
398
398
|
O(t) {
|
|
399
399
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -402,26 +402,26 @@ class z {
|
|
|
402
402
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
403
403
|
}
|
|
404
404
|
_(t) {
|
|
405
|
-
this._$AH !== c &&
|
|
405
|
+
this._$AH !== c && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
|
|
406
406
|
}
|
|
407
407
|
$(t) {
|
|
408
408
|
var n;
|
|
409
|
-
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = R.createElement(
|
|
409
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = R.createElement(wt(s.h, s.h[0]), this.options)), s);
|
|
410
410
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === r) this._$AH.p(e);
|
|
411
411
|
else {
|
|
412
|
-
const o = new
|
|
412
|
+
const o = new Rt(r, this), l = o.u(this.options);
|
|
413
413
|
o.p(e), this.T(l), this._$AH = o;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
_$AC(t) {
|
|
417
|
-
let e =
|
|
418
|
-
return e === void 0 &&
|
|
417
|
+
let e = gt.get(t.strings);
|
|
418
|
+
return e === void 0 && gt.set(t.strings, e = new R(t)), e;
|
|
419
419
|
}
|
|
420
420
|
k(t) {
|
|
421
|
-
|
|
421
|
+
rt(this._$AH) || (this._$AH = [], this._$AR());
|
|
422
422
|
const e = this._$AH;
|
|
423
423
|
let s, r = 0;
|
|
424
|
-
for (const n of t) r === e.length ? e.push(s = new
|
|
424
|
+
for (const n of t) r === e.length ? e.push(s = new j(this.O(N()), this.O(N()), this, this.options)) : s = e[r], s._$AI(n), r++;
|
|
425
425
|
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
426
426
|
}
|
|
427
427
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -436,7 +436,7 @@ class z {
|
|
|
436
436
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
class
|
|
439
|
+
class q {
|
|
440
440
|
get tagName() {
|
|
441
441
|
return this.element.tagName;
|
|
442
442
|
}
|
|
@@ -449,11 +449,11 @@ class W {
|
|
|
449
449
|
_$AI(t, e = this, s, r) {
|
|
450
450
|
const n = this.strings;
|
|
451
451
|
let o = !1;
|
|
452
|
-
if (n === void 0) t =
|
|
452
|
+
if (n === void 0) t = U(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== C, o && (this._$AH = t);
|
|
453
453
|
else {
|
|
454
454
|
const l = t;
|
|
455
455
|
let a, d;
|
|
456
|
-
for (t = n[0], a = 0; a < n.length - 1; a++) d =
|
|
456
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) d = U(this, l[s + a], e, a), d === C && (d = this._$AH[a]), o || (o = !D(d) || d !== this._$AH[a]), d === c ? t = c : t !== c && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
|
|
457
457
|
}
|
|
458
458
|
o && !r && this.j(t);
|
|
459
459
|
}
|
|
@@ -461,7 +461,7 @@ class W {
|
|
|
461
461
|
t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
class
|
|
464
|
+
class Bt extends q {
|
|
465
465
|
constructor() {
|
|
466
466
|
super(...arguments), this.type = 3;
|
|
467
467
|
}
|
|
@@ -469,7 +469,7 @@ class zt extends W {
|
|
|
469
469
|
this.element[this.name] = t === c ? void 0 : t;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
class
|
|
472
|
+
class jt extends q {
|
|
473
473
|
constructor() {
|
|
474
474
|
super(...arguments), this.type = 4;
|
|
475
475
|
}
|
|
@@ -477,12 +477,12 @@ class Dt extends W {
|
|
|
477
477
|
this.element.toggleAttribute(this.name, !!t && t !== c);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
class Lt extends
|
|
480
|
+
class Lt extends q {
|
|
481
481
|
constructor(t, e, s, r, n) {
|
|
482
482
|
super(t, e, s, r, n), this.type = 5;
|
|
483
483
|
}
|
|
484
484
|
_$AI(t, e = this) {
|
|
485
|
-
if ((t =
|
|
485
|
+
if ((t = U(this, t, e, 0) ?? c) === C) return;
|
|
486
486
|
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);
|
|
487
487
|
r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
488
488
|
}
|
|
@@ -491,7 +491,7 @@ class Lt extends W {
|
|
|
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 zt {
|
|
495
495
|
constructor(t, e, s) {
|
|
496
496
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
497
497
|
}
|
|
@@ -499,17 +499,17 @@ class It {
|
|
|
499
499
|
return this._$AM._$AU;
|
|
500
500
|
}
|
|
501
501
|
_$AI(t) {
|
|
502
|
-
|
|
502
|
+
U(this, t);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
const
|
|
505
|
+
const J = H.litHtmlPolyfillSupport;
|
|
506
|
+
J == null || J(R, j), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.3.0");
|
|
507
|
+
const It = (i, t, e) => {
|
|
508
508
|
const s = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
509
509
|
let r = s._$litPart$;
|
|
510
510
|
if (r === void 0) {
|
|
511
511
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
512
|
-
s._$litPart$ = r = new
|
|
512
|
+
s._$litPart$ = r = new j(t.insertBefore(N(), n), n, void 0, e ?? {});
|
|
513
513
|
}
|
|
514
514
|
return r._$AI(i), r;
|
|
515
515
|
};
|
|
@@ -518,8 +518,8 @@ const Bt = (i, t, e) => {
|
|
|
518
518
|
* Copyright 2017 Google LLC
|
|
519
519
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
520
520
|
*/
|
|
521
|
-
const
|
|
522
|
-
let
|
|
521
|
+
const S = globalThis;
|
|
522
|
+
let E = class extends O {
|
|
523
523
|
constructor() {
|
|
524
524
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
525
525
|
}
|
|
@@ -530,7 +530,7 @@ let S = class extends O {
|
|
|
530
530
|
}
|
|
531
531
|
update(t) {
|
|
532
532
|
const e = this.render();
|
|
533
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
533
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = It(e, this.renderRoot, this.renderOptions);
|
|
534
534
|
}
|
|
535
535
|
connectedCallback() {
|
|
536
536
|
var t;
|
|
@@ -544,17 +544,17 @@ let S = class extends O {
|
|
|
544
544
|
return C;
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
var
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
(
|
|
547
|
+
var ft;
|
|
548
|
+
E._$litElement$ = !0, E.finalized = !0, (ft = S.litElementHydrateSupport) == null || ft.call(S, { LitElement: E });
|
|
549
|
+
const K = S.litElementPolyfillSupport;
|
|
550
|
+
K == null || K({ LitElement: E });
|
|
551
|
+
(S.litElementVersions ?? (S.litElementVersions = [])).push("4.2.0");
|
|
552
552
|
/**
|
|
553
553
|
* @license
|
|
554
554
|
* Copyright 2017 Google LLC
|
|
555
555
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
556
556
|
*/
|
|
557
|
-
const
|
|
557
|
+
const it = (i) => (t, e) => {
|
|
558
558
|
e !== void 0 ? e.addInitializer(() => {
|
|
559
559
|
customElements.define(i, t);
|
|
560
560
|
}) : customElements.define(i, t);
|
|
@@ -564,7 +564,7 @@ const rt = (i) => (t, e) => {
|
|
|
564
564
|
* Copyright 2017 Google LLC
|
|
565
565
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
566
566
|
*/
|
|
567
|
-
const Vt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged:
|
|
567
|
+
const Vt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: st }, qt = (i = Vt, t, e) => {
|
|
568
568
|
const { kind: s, metadata: r } = e;
|
|
569
569
|
let n = globalThis.litPropertyMetadata.get(r);
|
|
570
570
|
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), s === "accessor") {
|
|
@@ -586,17 +586,17 @@ const Vt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged:
|
|
|
586
586
|
throw Error("Unsupported decorator location: " + s);
|
|
587
587
|
};
|
|
588
588
|
function p(i) {
|
|
589
|
-
return (t, e) => typeof e == "object" ?
|
|
589
|
+
return (t, e) => typeof e == "object" ? qt(i, t, e) : ((s, r, n) => {
|
|
590
590
|
const o = r.hasOwnProperty(n);
|
|
591
591
|
return r.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
592
592
|
})(i, t, e);
|
|
593
593
|
}
|
|
594
|
-
const
|
|
594
|
+
const Wt = B`
|
|
595
595
|
outline: 1px dashed var(--button-border-color);
|
|
596
596
|
outline-offset: 2px;
|
|
597
597
|
outline: dashed black;
|
|
598
598
|
`;
|
|
599
|
-
|
|
599
|
+
B`
|
|
600
600
|
:host * {
|
|
601
601
|
box-sizing: border-box;
|
|
602
602
|
}
|
|
@@ -606,12 +606,12 @@ j`
|
|
|
606
606
|
* Copyright 2023 Google LLC
|
|
607
607
|
* SPDX-License-Identifier: Apache-2.0
|
|
608
608
|
*/
|
|
609
|
-
const
|
|
609
|
+
const ot = Symbol("internals"), G = Symbol("privateInternals");
|
|
610
610
|
function Ft(i) {
|
|
611
611
|
var t;
|
|
612
612
|
class e extends i {
|
|
613
|
-
get [(t =
|
|
614
|
-
return this[
|
|
613
|
+
get [(t = ot, t)]() {
|
|
614
|
+
return this[G] || (this[G] = this.attachInternals()), this[G];
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
return e;
|
|
@@ -625,7 +625,7 @@ function Zt(i) {
|
|
|
625
625
|
i.addInitializer((t) => {
|
|
626
626
|
const e = t;
|
|
627
627
|
e.addEventListener("click", async (s) => {
|
|
628
|
-
const { type: r, [
|
|
628
|
+
const { type: r, [ot]: n } = e, { form: o } = n;
|
|
629
629
|
if (!(!o || r === "button") && (await new Promise((l) => {
|
|
630
630
|
setTimeout(l);
|
|
631
631
|
}), !s.defaultPrevented)) {
|
|
@@ -653,7 +653,7 @@ var Jt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, P = (i, t,
|
|
|
653
653
|
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
|
|
654
654
|
return s && r && Jt(t, e, r), r;
|
|
655
655
|
};
|
|
656
|
-
const Gt = Ft(
|
|
656
|
+
const Gt = Ft(E), $t = (i) => {
|
|
657
657
|
const t = `
|
|
658
658
|
--button-bg-disabled: var(--color-container-disabled);
|
|
659
659
|
--button-bg-pressed: var(--color-container-action-${i}-pressed);
|
|
@@ -668,7 +668,7 @@ const Gt = Ft(S), gt = (i) => {
|
|
|
668
668
|
--button-text-hover: var(--color-content-action-${i});
|
|
669
669
|
--button-text: var(--color-content-action-${i});
|
|
670
670
|
`;
|
|
671
|
-
return
|
|
671
|
+
return yt(t);
|
|
672
672
|
}, Qt = ["primary", "secondary"];
|
|
673
673
|
let b = class extends Gt {
|
|
674
674
|
constructor() {
|
|
@@ -684,7 +684,7 @@ let b = class extends Gt {
|
|
|
684
684
|
* The associated form element with which this element's value will submit.
|
|
685
685
|
*/
|
|
686
686
|
get form() {
|
|
687
|
-
return this[
|
|
687
|
+
return this[ot].form;
|
|
688
688
|
}
|
|
689
689
|
// TODO: Add aria attributes support
|
|
690
690
|
// Adapt from: https://github.dev/material-components/material-web
|
|
@@ -709,16 +709,16 @@ let b = class extends Gt {
|
|
|
709
709
|
};
|
|
710
710
|
Zt(b);
|
|
711
711
|
b.formAssociated = !0;
|
|
712
|
-
b.styles =
|
|
712
|
+
b.styles = B`
|
|
713
713
|
:host {
|
|
714
714
|
display: inline-flex;
|
|
715
715
|
cursor: pointer;
|
|
716
|
-
${
|
|
716
|
+
${$t("primary")};
|
|
717
717
|
--button-border: transparent;
|
|
718
718
|
}
|
|
719
719
|
|
|
720
720
|
:host([variant="secondary"]) {
|
|
721
|
-
${
|
|
721
|
+
${$t("secondary")};
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
:host([disabled]) {
|
|
@@ -779,7 +779,7 @@ b.styles = j`
|
|
|
779
779
|
}
|
|
780
780
|
|
|
781
781
|
.button:focus-visible {
|
|
782
|
-
${
|
|
782
|
+
${Wt};
|
|
783
783
|
}
|
|
784
784
|
`;
|
|
785
785
|
P([
|
|
@@ -805,7 +805,7 @@ P([
|
|
|
805
805
|
p()
|
|
806
806
|
], b.prototype, "target", 2);
|
|
807
807
|
b = P([
|
|
808
|
-
|
|
808
|
+
it("o-button")
|
|
809
809
|
], b);
|
|
810
810
|
/**
|
|
811
811
|
* @license
|
|
@@ -834,7 +834,7 @@ class te {
|
|
|
834
834
|
* Copyright 2017 Google LLC
|
|
835
835
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
836
836
|
*/
|
|
837
|
-
class
|
|
837
|
+
class Q extends te {
|
|
838
838
|
constructor(t) {
|
|
839
839
|
if (super(t), this.it = c, t.type !== Xt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
840
840
|
}
|
|
@@ -848,48 +848,50 @@ class G extends te {
|
|
|
848
848
|
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
|
|
851
|
+
Q.directiveName = "unsafeHTML", Q.resultType = 1;
|
|
852
852
|
/**
|
|
853
853
|
* @license
|
|
854
854
|
* Copyright 2017 Google LLC
|
|
855
855
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
856
856
|
*/
|
|
857
|
-
class
|
|
857
|
+
class X extends Q {
|
|
858
858
|
}
|
|
859
|
-
|
|
860
|
-
const
|
|
859
|
+
X.directiveName = "unsafeSVG", X.resultType = 2;
|
|
860
|
+
const Y = Yt(X), ee = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
861
861
|
<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"/>
|
|
862
862
|
</svg>
|
|
863
863
|
`, se = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
864
864
|
<path d="M16 8L4 0V16L16 8Z" fill="#3F2B2E"/>
|
|
865
865
|
</svg>
|
|
866
|
-
`,
|
|
866
|
+
`, St = {
|
|
867
867
|
wishlist: ee,
|
|
868
868
|
playerv: se
|
|
869
869
|
};
|
|
870
|
-
var re = Object.defineProperty, ie = Object.getOwnPropertyDescriptor,
|
|
870
|
+
var re = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, W = (i, t, e, s) => {
|
|
871
871
|
for (var r = s > 1 ? void 0 : s ? ie(t, e) : t, n = i.length - 1, o; n >= 0; n--)
|
|
872
872
|
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
|
|
873
873
|
return s && r && re(t, e, r), r;
|
|
874
874
|
};
|
|
875
|
-
let
|
|
875
|
+
let k = class extends E {
|
|
876
876
|
constructor() {
|
|
877
|
-
super(...arguments), this.status = "empty";
|
|
877
|
+
super(...arguments), this.status = "empty", this.ariaDescribedBy = "a-product-name", this.label = "Add to wishlist";
|
|
878
878
|
}
|
|
879
879
|
render() {
|
|
880
|
-
const i =
|
|
880
|
+
const i = St.wishlist.replace(
|
|
881
881
|
"<svg",
|
|
882
882
|
'<svg aria-hidden="true" focusable="false" part="svg"'
|
|
883
883
|
);
|
|
884
884
|
return w`
|
|
885
885
|
<button
|
|
886
886
|
type="button"
|
|
887
|
-
aria-label="
|
|
887
|
+
aria-label="${this.label}"
|
|
888
|
+
aria-describedby="${this.ariaDescribedBy}"
|
|
888
889
|
aria-pressed="${this.status == "filled" ? "true" : "false"}"
|
|
889
890
|
class="wishlist-button"
|
|
890
891
|
@click="${this.toggleStatus}"
|
|
891
892
|
>
|
|
892
|
-
|
|
893
|
+
<span class="sr-only">${this.label}</span>
|
|
894
|
+
${Y(i)}
|
|
893
895
|
</button>
|
|
894
896
|
`;
|
|
895
897
|
}
|
|
@@ -899,8 +901,14 @@ let V = class extends S {
|
|
|
899
901
|
setStatus(i) {
|
|
900
902
|
this.status = i, this.requestUpdate();
|
|
901
903
|
}
|
|
904
|
+
setAriaDescribedBy(i) {
|
|
905
|
+
this.ariaDescribedBy = i, this.requestUpdate();
|
|
906
|
+
}
|
|
907
|
+
setLabel(i) {
|
|
908
|
+
this.label = i, this.requestUpdate();
|
|
909
|
+
}
|
|
902
910
|
};
|
|
903
|
-
|
|
911
|
+
k.styles = B`
|
|
904
912
|
:host {
|
|
905
913
|
display: inline-flex;
|
|
906
914
|
justify-content: center;
|
|
@@ -912,14 +920,29 @@ V.styles = j`
|
|
|
912
920
|
display: flex;
|
|
913
921
|
justify-content: center;
|
|
914
922
|
align-items: center;
|
|
915
|
-
width:
|
|
916
|
-
height:
|
|
923
|
+
width: 40px;
|
|
924
|
+
height: 40px;
|
|
917
925
|
border: transparent;
|
|
918
926
|
border-radius: var(--radius-full);
|
|
919
927
|
background-color: var(--color-alpha-light-strong);
|
|
920
928
|
position: relative;
|
|
929
|
+
cursor: pointer;
|
|
921
930
|
}
|
|
922
931
|
|
|
932
|
+
.sr-only {
|
|
933
|
+
border: 0 !important;
|
|
934
|
+
clip: rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;
|
|
935
|
+
-webkit-clip-path: inset(50%) !important;
|
|
936
|
+
clip-path: inset(50%) !important;
|
|
937
|
+
height: 0.1rem !important;
|
|
938
|
+
margin: -0.1rem !important;
|
|
939
|
+
overflow: hidden !important;
|
|
940
|
+
padding: 0 !important;
|
|
941
|
+
position: absolute !important;
|
|
942
|
+
width: 0.1rem !important;
|
|
943
|
+
white-space: nowrap !important;
|
|
944
|
+
}
|
|
945
|
+
|
|
923
946
|
.wishlist-button:hover {
|
|
924
947
|
background-color: var(--color-alpha-light-stronger);
|
|
925
948
|
}
|
|
@@ -940,18 +963,24 @@ V.styles = j`
|
|
|
940
963
|
fill: var(--color-alpha-light-strong);
|
|
941
964
|
}
|
|
942
965
|
`;
|
|
943
|
-
|
|
966
|
+
W([
|
|
967
|
+
p({ type: String, reflect: !0 })
|
|
968
|
+
], k.prototype, "status", 2);
|
|
969
|
+
W([
|
|
970
|
+
p({ type: String, reflect: !0 })
|
|
971
|
+
], k.prototype, "ariaDescribedBy", 2);
|
|
972
|
+
W([
|
|
944
973
|
p({ type: String, reflect: !0 })
|
|
945
|
-
],
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
var oe = Object.defineProperty, ne = Object.getOwnPropertyDescriptor,
|
|
974
|
+
], k.prototype, "label", 2);
|
|
975
|
+
k = W([
|
|
976
|
+
it("o-wishlist-button")
|
|
977
|
+
], k);
|
|
978
|
+
var oe = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, m = (i, t, e, s) => {
|
|
950
979
|
for (var r = s > 1 ? void 0 : s ? ne(t, e) : t, n = i.length - 1, o; n >= 0; n--)
|
|
951
980
|
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
|
|
952
981
|
return s && r && oe(t, e, r), r;
|
|
953
982
|
};
|
|
954
|
-
let g = class extends
|
|
983
|
+
let g = class extends E {
|
|
955
984
|
constructor() {
|
|
956
985
|
super(...arguments), this.bgstyle = "background-light", this.size = "medium", this.status = "empty", this.type = "button", this.strokewidth = "1", this.icon = "wishlist", this.disabled = !1;
|
|
957
986
|
}
|
|
@@ -959,14 +988,14 @@ let g = class extends S {
|
|
|
959
988
|
super.updated(i), this.style.setProperty("--icon-stroke-width", this.strokewidth);
|
|
960
989
|
}
|
|
961
990
|
render() {
|
|
962
|
-
const t = (
|
|
991
|
+
const t = (St[this.icon] ?? "").replace(
|
|
963
992
|
"<svg",
|
|
964
993
|
'<svg aria-hidden="true" focusable="false" part="svg"'
|
|
965
994
|
);
|
|
966
995
|
return w`
|
|
967
996
|
${this.type === "span" ? w`
|
|
968
997
|
<span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status}" ?disabled="${this.disabled}">
|
|
969
|
-
${
|
|
998
|
+
${Y(t)}
|
|
970
999
|
</span>
|
|
971
1000
|
` : w`
|
|
972
1001
|
<button
|
|
@@ -975,13 +1004,13 @@ let g = class extends S {
|
|
|
975
1004
|
class="icon-button ${this.size} ${this.bgstyle} ${this.status}"
|
|
976
1005
|
?disabled="${this.disabled}"
|
|
977
1006
|
>
|
|
978
|
-
${
|
|
1007
|
+
${Y(t)}
|
|
979
1008
|
</button>
|
|
980
1009
|
`}
|
|
981
1010
|
`;
|
|
982
1011
|
}
|
|
983
1012
|
};
|
|
984
|
-
g.styles =
|
|
1013
|
+
g.styles = B`
|
|
985
1014
|
:host {
|
|
986
1015
|
display: inline-flex;
|
|
987
1016
|
justify-content: center;
|
|
@@ -1134,27 +1163,27 @@ g.styles = j`
|
|
|
1134
1163
|
|
|
1135
1164
|
}
|
|
1136
1165
|
`;
|
|
1137
|
-
|
|
1166
|
+
m([
|
|
1138
1167
|
p({ type: String, reflect: !0 })
|
|
1139
1168
|
], g.prototype, "bgstyle", 2);
|
|
1140
|
-
|
|
1169
|
+
m([
|
|
1141
1170
|
p({ type: String, reflect: !0 })
|
|
1142
1171
|
], g.prototype, "size", 2);
|
|
1143
|
-
|
|
1172
|
+
m([
|
|
1144
1173
|
p({ type: String, reflect: !0 })
|
|
1145
1174
|
], g.prototype, "status", 2);
|
|
1146
|
-
|
|
1175
|
+
m([
|
|
1147
1176
|
p({ type: String, reflect: !0 })
|
|
1148
1177
|
], g.prototype, "type", 2);
|
|
1149
|
-
|
|
1178
|
+
m([
|
|
1150
1179
|
p({ type: String })
|
|
1151
1180
|
], g.prototype, "strokewidth", 2);
|
|
1152
|
-
|
|
1181
|
+
m([
|
|
1153
1182
|
p({ type: String })
|
|
1154
1183
|
], g.prototype, "icon", 2);
|
|
1155
|
-
|
|
1184
|
+
m([
|
|
1156
1185
|
p({ type: Boolean, reflect: !0 })
|
|
1157
1186
|
], g.prototype, "disabled", 2);
|
|
1158
|
-
g =
|
|
1159
|
-
|
|
1187
|
+
g = m([
|
|
1188
|
+
it("o-icon-button")
|
|
1160
1189
|
], g);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@florid-kit/components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "index.mjs",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"description": "This library was generated with [Nx](https://nx.dev).",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@florid-kit/tokens": "^0.1.
|
|
9
|
+
"@florid-kit/tokens": "^0.1.4"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@storybook/addon-essentials": "^8.1.5",
|