@florid-kit/components 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. package/index.js +89 -88
  2. package/index.mjs +214 -213
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -2,17 +2,17 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const R=globalThis,q=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),Q=new WeakMap;let lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==F)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=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Q.set(e,t))}return t}toString(){return this.cssText}};const ct=r=>new lt(typeof r=="string"?r:r+"",void 0,F),J=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new lt(e,r,F)},ft=(r,t)=>{if(q)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},X=q?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ct(e)})(r):r;/**
5
+ */const R=globalThis,q=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),Q=new WeakMap;let lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==F)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=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Q.set(e,t))}return t}toString(){return this.cssText}};const ct=i=>new lt(typeof i=="string"?i:i+"",void 0,F),J=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new lt(e,i,F)},ft=(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=R.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},X=q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ct(e)})(i):i;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:bt,defineProperty:_t,getOwnPropertyDescriptor:mt,getOwnPropertyNames:gt,getOwnPropertySymbols:vt,getPrototypeOf:yt}=Object,_=globalThis,Y=_.trustedTypes,At=Y?Y.emptyScript:"",L=_.reactiveElementPolyfillSupport,P=(r,t)=>r,k={toAttribute(r,t){switch(t){case Boolean:r=r?At:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},K=(r,t)=>!bt(r,t),tt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class A 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=tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&_t(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const h=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=yt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...gt(e),...vt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,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 i of s)e.unshift(X(i))}else t!==void 0&&e.push(X(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 ft(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 o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:k).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:k;this._$Em=i,this[i]=h.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??K)(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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.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){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[P("elementProperties")]=new Map,A[P("finalized")]=new Map,L==null||L({ReactiveElement:A}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:bt,defineProperty:_t,getOwnPropertyDescriptor:mt,getOwnPropertyNames:gt,getOwnPropertySymbols:vt,getPrototypeOf:yt}=Object,_=globalThis,Y=_.trustedTypes,At=Y?Y.emptyScript:"",L=_.reactiveElementPolyfillSupport,P=(i,t)=>i,k={toAttribute(i,t){switch(t){case Boolean:i=i?At: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}},K=(i,t)=>!bt(i,t),tt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class A 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=tt){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&&_t(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return r==null?void 0:r.call(this)},set(n){const h=r==null?void 0:r.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=yt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...gt(e),...vt(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(X(r))}else t!==void 0&&e.push(X(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 ft(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 o;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:k).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=s.getPropertyOptions(r),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:k;this._$Em=r,this[r]=h.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??K)(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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,n]of r)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.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){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[P("elementProperties")]=new Map,A[P("finalized")]=new Map,L==null||L({ReactiveElement:A}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const C=globalThis,z=C.trustedTypes,et=z?z.createPolicy("lit-html",{createHTML:r=>r}):void 0,dt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,ut="?"+b,Et=`<${ut}>`,v=document,O=()=>v.createComment(""),T=r=>r===null||typeof r!="object"&&typeof r!="function",Z=Array.isArray,St=r=>Z(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",j=`[
14
- \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,nt=/"/g,pt=/^(?:script|style|textarea|title)$/i,wt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),B=wt(1),E=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ot=new WeakMap,g=v.createTreeWalker(v,129);function $t(r,t){if(!Z(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const xt=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=x;for(let h=0;h<e;h++){const a=r[h];let d,u,l=-1,$=0;for(;$<a.length&&(n.lastIndex=$,u=n.exec(a),u!==null);)$=n.lastIndex,n===x?u[1]==="!--"?n=st:u[1]!==void 0?n=it:u[2]!==void 0?(pt.test(u[2])&&(i=RegExp("</"+u[2],"g")),n=m):u[3]!==void 0&&(n=m):n===m?u[0]===">"?(n=i??x,l=-1):u[1]===void 0?l=-2:(l=n.lastIndex-u[2].length,d=u[1],n=u[3]===void 0?m:u[3]==='"'?nt:rt):n===nt||n===rt?n=m:n===st||n===it?n=x:(n=m,i=void 0);const f=n===m&&r[h+1].startsWith("/>")?" ":"";o+=n===x?a+Et:l>=0?(s.push(d),a.slice(0,l)+dt+a.slice(l)+b+f):a+b+(l===-2?h:f)}return[$t(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const h=t.length-1,a=this.parts,[d,u]=xt(t,e);if(this.el=H.createElement(d,s),g.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=g.nextNode())!==null&&a.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(dt)){const $=u[n++],f=i.getAttribute(l).split(b),N=/([.?@])?(.*)/.exec($);a.push({type:1,index:o,name:N[2],strings:f,ctor:N[1]==="."?Ct:N[1]==="?"?Ut:N[1]==="@"?Ot:I}),i.removeAttribute(l)}else l.startsWith(b)&&(a.push({type:6,index:o}),i.removeAttribute(l));if(pt.test(i.tagName)){const l=i.textContent.split(b),$=l.length-1;if($>0){i.textContent=z?z.emptyScript:"";for(let f=0;f<$;f++)i.append(l[f],O()),g.nextNode(),a.push({type:2,index:++o});i.append(l[$],O())}}}else if(i.nodeType===8)if(i.data===ut)a.push({type:2,index:o});else{let l=-1;for(;(l=i.data.indexOf(b,l+1))!==-1;)a.push({type:7,index:o}),l+=b.length-1}o++}}static createElement(t,e){const s=v.createElement("template");return s.innerHTML=t,s}}function S(r,t,e=r,s){var n,h;if(t===E)return t;let i=s!==void 0?(n=e._$Co)==null?void 0:n[s]:e._$Cl;const o=T(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((h=i==null?void 0:i._$AO)==null||h.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=S(r,i._$AS(r,t.values),i,s)),t}class Pt{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,i=((t==null?void 0:t.creationScope)??v).importNode(e,!0);g.currentNode=i;let o=g.nextNode(),n=0,h=0,a=s[0];for(;a!==void 0;){if(n===a.index){let d;a.type===2?d=new M(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new Tt(o,this,t)),this._$AV.push(d),a=s[++h]}n!==(a==null?void 0:a.index)&&(o=g.nextNode(),n++)}return g.currentNode=v,i}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 M{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),T(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):St(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&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(v.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement($t(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new Pt(i,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=ot.get(t.strings);return e===void 0&&ot.set(t.strings,e=new H(t)),e}k(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new M(this.O(O()),this.O(O()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$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 i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,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,i){const o=this.strings;let n=!1;if(o===void 0)t=S(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else{const h=t;let a,d;for(t=o[0],a=0;a<o.length-1;a++)d=S(this,h[s+a],e,a),d===E&&(d=this._$AH[a]),n||(n=!T(d)||d!==this._$AH[a]),d===c?t=c:t!==c&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}n&&!i&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class Ut extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class Ot extends I{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??c)===E)return;const s=this._$AH,i=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==c&&(s===c||i);i&&this.element.removeEventListener(this.name,this,s),o&&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 Tt{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){S(this,t)}}const D=C.litHtmlPolyfillSupport;D==null||D(H,M),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.2.1");const Ht=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new M(t.insertBefore(O(),o),o,void 0,e??{})}return i._$AI(r),i};/**
13
+ */const C=globalThis,z=C.trustedTypes,et=z?z.createPolicy("lit-html",{createHTML:i=>i}):void 0,dt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,ut="?"+b,Et=`<${ut}>`,v=document,O=()=>v.createComment(""),T=i=>i===null||typeof i!="object"&&typeof i!="function",Z=Array.isArray,St=i=>Z(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",j=`[
14
+ \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,rt=/>/g,m=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,nt=/"/g,pt=/^(?:script|style|textarea|title)$/i,wt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),B=wt(1),E=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ot=new WeakMap,g=v.createTreeWalker(v,129);function $t(i,t){if(!Z(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const xt=(i,t)=>{const e=i.length-1,s=[];let r,o=t===2?"<svg>":t===3?"<math>":"",n=x;for(let h=0;h<e;h++){const a=i[h];let d,u,l=-1,$=0;for(;$<a.length&&(n.lastIndex=$,u=n.exec(a),u!==null);)$=n.lastIndex,n===x?u[1]==="!--"?n=st:u[1]!==void 0?n=rt:u[2]!==void 0?(pt.test(u[2])&&(r=RegExp("</"+u[2],"g")),n=m):u[3]!==void 0&&(n=m):n===m?u[0]===">"?(n=r??x,l=-1):u[1]===void 0?l=-2:(l=n.lastIndex-u[2].length,d=u[1],n=u[3]===void 0?m:u[3]==='"'?nt:it):n===nt||n===it?n=m:n===st||n===rt?n=x:(n=m,r=void 0);const f=n===m&&i[h+1].startsWith("/>")?" ":"";o+=n===x?a+Et:l>=0?(s.push(d),a.slice(0,l)+dt+a.slice(l)+b+f):a+b+(l===-2?h:f)}return[$t(i,o+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let o=0,n=0;const h=t.length-1,a=this.parts,[d,u]=xt(t,e);if(this.el=H.createElement(d,s),g.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=g.nextNode())!==null&&a.length<h;){if(r.nodeType===1){if(r.hasAttributes())for(const l of r.getAttributeNames())if(l.endsWith(dt)){const $=u[n++],f=r.getAttribute(l).split(b),N=/([.?@])?(.*)/.exec($);a.push({type:1,index:o,name:N[2],strings:f,ctor:N[1]==="."?Ct:N[1]==="?"?Ut:N[1]==="@"?Ot:I}),r.removeAttribute(l)}else l.startsWith(b)&&(a.push({type:6,index:o}),r.removeAttribute(l));if(pt.test(r.tagName)){const l=r.textContent.split(b),$=l.length-1;if($>0){r.textContent=z?z.emptyScript:"";for(let f=0;f<$;f++)r.append(l[f],O()),g.nextNode(),a.push({type:2,index:++o});r.append(l[$],O())}}}else if(r.nodeType===8)if(r.data===ut)a.push({type:2,index:o});else{let l=-1;for(;(l=r.data.indexOf(b,l+1))!==-1;)a.push({type:7,index:o}),l+=b.length-1}o++}}static createElement(t,e){const s=v.createElement("template");return s.innerHTML=t,s}}function S(i,t,e=i,s){var n,h;if(t===E)return t;let r=s!==void 0?(n=e._$Co)==null?void 0:n[s]:e._$Cl;const o=T(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==o&&((h=r==null?void 0:r._$AO)==null||h.call(r,!1),o===void 0?r=void 0:(r=new o(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=S(i,r._$AS(i,t.values),r,s)),t}class Pt{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)??v).importNode(e,!0);g.currentNode=r;let o=g.nextNode(),n=0,h=0,a=s[0];for(;a!==void 0;){if(n===a.index){let d;a.type===2?d=new M(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new Tt(o,this,t)),this._$AV.push(d),a=s[++h]}n!==(a==null?void 0:a.index)&&(o=g.nextNode(),n++)}return g.currentNode=v,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 M{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=S(this,t,e),T(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):St(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&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(v.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement($t(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===r)this._$AH.p(e);else{const n=new Pt(r,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=ot.get(t.strings);return e===void 0&&ot.set(t.strings,e=new H(t)),e}k(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const o of t)r===e.length?e.push(s=new M(this.O(O()),this.O(O()),this,this.options)):s=e[r],s._$AI(o),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 I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,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 o=this.strings;let n=!1;if(o===void 0)t=S(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==E,n&&(this._$AH=t);else{const h=t;let a,d;for(t=o[0],a=0;a<o.length-1;a++)d=S(this,h[s+a],e,a),d===E&&(d=this._$AH[a]),n||(n=!T(d)||d!==this._$AH[a]),d===c?t=c:t!==c&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}n&&!r&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class Ut extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class Ot extends I{constructor(t,e,s,r,o){super(t,e,s,r,o),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??c)===E)return;const s=this._$AH,r=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==c&&(s===c||r);r&&this.element.removeEventListener(this.name,this,s),o&&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 Tt{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){S(this,t)}}const D=C.litHtmlPolyfillSupport;D==null||D(H,M),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.2.1");const Ht=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new M(t.insertBefore(O(),o),o,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
@@ -20,11 +20,11 @@
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const Mt=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};/**
23
+ */const Mt=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 Nt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:K},Rt=(r=Nt,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){const{name:n}=e;return{set(h){const a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){const{name:n}=e;return function(h){const a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function w(r){return(t,e)=>typeof e=="object"?Rt(r,t,e):((s,i,o)=>{const n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}const kt=J`
27
+ */const Nt={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:K},Rt=(i=Nt,t,e)=>{const{kind:s,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(e.name,i),s==="accessor"){const{name:n}=e;return{set(h){const a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,i)},init(h){return h!==void 0&&this.P(n,void 0,i),h}}}if(s==="setter"){const{name:n}=e;return function(h){const a=this[n];t.call(this,h),this.requestUpdate(n,a,i)}}throw Error("Unsupported decorator location: "+s)};function w(i){return(t,e)=>typeof e=="object"?Rt(i,t,e):((s,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(r,o):void 0})(i,t,e)}const kt=J`
28
28
  outline: 1px dashed var(--button-border-color);
29
29
  outline-offset: 2px;
30
30
  outline: dashed black;
@@ -36,95 +36,96 @@
36
36
  * @license
37
37
  * Copyright 2023 Google LLC
38
38
  * SPDX-License-Identifier: Apache-2.0
39
- */const G=Symbol("internals"),W=Symbol("privateInternals");function zt(r){var t;class e extends r{get[(t=G,t)](){return this[W]||(this[W]=this.attachInternals()),this[W]}}return e}/**
39
+ */const G=Symbol("internals"),W=Symbol("privateInternals");function zt(i){var t;class e extends i{get[(t=G,t)](){return this[W]||(this[W]=this.attachInternals()),this[W]}}return e}/**
40
40
  * @license
41
41
  * Copyright 2023 Google LLC
42
42
  * SPDX-License-Identifier: Apache-2.0
43
- */function It(r){r.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:i,[G]:o}=e,{form:n}=o;if(!(!n||i==="button")&&(await new Promise(h=>{setTimeout(h)}),!s.defaultPrevented)){if(i==="reset"){n.reset();return}n.addEventListener("submit",h=>{Object.defineProperty(h,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),o.setFormValue(e.value),n.requestSubmit()}})})}var Lt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,y=(r,t,e,s)=>{for(var i=s>1?void 0:s?jt(t,e):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Lt(t,e,i),i};const Bt=zt(U),at=r=>{const t=`
44
- --button-bg-disabled: var(--color-content-disabled);
45
- --button-bg-hover: var(--color-container-action-${r}-hover);
46
- --button-bg: var(--color-container-action-${r}-default);
47
- --button-border-disabled: var(--color-border-${r});
48
- --button-border-hover: var(--color-border-${r});
49
- --button-border-width-disabled: var(--button-${r}-border-width-disabled);
50
- --button-border-width: var(--button-${r}-border-width-default, 1px);
51
- --button-border: var(--button-${r}-border-default);
52
- --button-text-disabled: var(--color-content-action-${r}-disabled);
53
- --button-text-hover: var(--color-content-action-${r}-hover);
54
- --button-text: var(--color-content-action-${r}-default);
55
- `;return ct(t)},Dt=["primary","secondary"];let p=class extends Bt{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(r){this.setAttribute("name",r)}get form(){return this[G].form}willUpdate(){const r=getComputedStyle(this).getPropertyValue("--button-variant");r&&Dt.some(t=>t===r)&&(this.variant=r)}render(){const r=this.href?this.renderLink():this.renderButton();return B`${r}`}renderLink(){return B`<a
56
- href=${this.href}
57
- target=${this.target||c}
58
- class="button"
59
- ?disabled=${this.disabled}
60
- >
61
- <slot />
62
- </a>`}renderButton(){return B`<button class="button" ?disabled=${this.disabled}>
63
- <slot />
64
- </button>`}};It(p);p.formAssociated=!0;p.styles=J`
65
- :host {
66
- display: inline-flex;
67
- cursor: pointer;
68
- ${at("primary")}
69
- }
43
+ */function It(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[G]:o}=e,{form:n}=o;if(!(!n||r==="button")&&(await new Promise(h=>{setTimeout(h)}),!s.defaultPrevented)){if(r==="reset"){n.reset();return}n.addEventListener("submit",h=>{Object.defineProperty(h,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),o.setFormValue(e.value),n.requestSubmit()}})})}var Lt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,y=(i,t,e,s)=>{for(var r=s>1?void 0:s?jt(t,e):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(r=(s?n(t,e,r):n(r))||r);return s&&r&&Lt(t,e,r),r};const Bt=zt(U),at=i=>{const t=`
44
+ --button-bg-disabled: var(--color-container-disabled);
45
+ --button-bg-pressed: var(--color-container-action-${i}-pressed);
46
+ --button-bg-hover: var(--color-container-action-${i}-hover);
47
+ --button-bg: var(--color-container-action-${i}-default);
48
+ --button-border-disabled: var(--color-border-${i});
49
+ --button-border-hover: var(--color-border-${i});
50
+ --button-border-width-disabled: var(--border-m);
51
+ --button-border-width: var(--border-m);
52
+ --button-border: var(--color-border-${i});
53
+ --button-text-disabled: var(--color-content-disabled);
54
+ --button-text-hover: var(--color-content-action-${i});
55
+ --button-text: var(--color-content-action-${i});
56
+ `;return ct(t)},Dt=["primary","secondary"];let p=class extends Bt{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[G].form}willUpdate(){const i=getComputedStyle(this).getPropertyValue("--button-variant");i&&Dt.some(t=>t===i)&&(this.variant=i)}render(){const i=this.href?this.renderLink():this.renderButton();return B`${i}`}renderLink(){return B`<a href=${this.href} target=${this.target||c} class="button" ?disabled=${this.disabled}>
57
+ <slot />
58
+ </a>`}renderButton(){return B`<button class="button" ?disabled=${this.disabled}>
59
+ <slot />
60
+ </button>`}};It(p);p.formAssociated=!0;p.styles=J`
61
+ :host {
62
+ display: inline-flex;
63
+ cursor: pointer;
64
+ ${at("primary")}
65
+ }
70
66
 
71
- :host([variant="secondary"]) {
72
- ${at("secondary")}
73
- }
67
+ :host([variant="secondary"]) {
68
+ ${at("secondary")}
69
+ }
74
70
 
75
- :host([disabled]) {
76
- --button-bg: var(--button-bg-disabled);
77
- --button-text: var(--button-text-disabled);
78
- --button-border: var(--button-border-disabled);
79
- }
71
+ :host([disabled]) {
72
+ --button-bg: var(--button-bg-disabled);
73
+ --button-text: var(--button-text-disabled);
74
+ --button-border: transparent;
75
+ }
80
76
 
81
- .button {
82
- -webkit-appearance: none;
83
- align-items: center;
84
- background-color: var(--button-bg);
85
- border-color: var(--button-border);
86
- border-radius: var(--radius-full);
87
- border-width: var(--spacing-m);
88
- border-style: solid;
89
- box-sizing: border-box;
90
- color: var(--button-text);
91
- cursor: inherit;
92
- display: inline-flex;
93
- font-family: var(--font-family-sans);
94
- font-size: var(--font-size-ui);
95
- font-weight: var(--font-weight-ui);
96
- gap: inherit;
97
- height: 100%;
98
- justify-content: center;
99
- line-height: var(--font-line-height-ui);
100
- min-width: 64px;
101
- outline: none;
102
- padding: 0;
103
- padding: var(--button-padding-block) var(--button-padding-inline);
104
- text-decoration: none;
105
- vertical-align: middle;
106
- width: 100%;
77
+ :host([disabled][variant="secondary"]) {
78
+ --button-bg: var(--button-bg-disabled);
79
+ --button-text: var(--button-text-disabled);
80
+ --button-border: var(--button-border);
81
+ }
107
82
 
108
- &::-moz-focus-inner {
109
- padding: 0;
110
- border: 0;
111
- }
112
- }
83
+ .button {
84
+ -webkit-appearance: none;
85
+ align-items: center;
86
+ background-color: var(--button-bg);
87
+ border-color: var(--button-border);
88
+ border-radius: var(--radius-m);
89
+ border-width: var(--border-m);
90
+ border-style: solid;
91
+ box-sizing: border-box;
92
+ color: var(--button-text);
93
+ cursor: inherit;
94
+ display: inline-flex;
95
+ font-family: var(--font-family-loccitane-sans);
96
+ font-size: var(--font-size-150);
97
+ font-weight: var(--font-weight-400);
98
+ gap: var(--spacing-s, 8px);
99
+ height: 100%;
100
+ justify-content: center;
101
+ line-height: var(--line-height-140);
102
+ min-width: 64px;
103
+ outline: none;
104
+ padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
105
+ text-decoration: none;
106
+ vertical-align: middle;
107
+ width: 100%;
113
108
 
114
- .button:disabled {
115
- cursor: initial;
116
- }
109
+ &::-moz-focus-inner {
110
+ padding: 0;
111
+ border: 0;
112
+ }
113
+ }
117
114
 
118
- .button:hover:not([disabled]) {
119
- background-color: var(--button-bg-hover);
120
- color: var(--button-text-hover);
121
- }
115
+ .button:disabled {
116
+ cursor: initial;
117
+ }
122
118
 
123
- .button:focus-visible {
124
- ${kt}
125
- }
119
+ .button:hover:not([disabled]) {
120
+ background-color: var(--button-bg-hover);
121
+ color: var(--button-text-hover);
122
+ }
126
123
 
127
- .button:active:not([disabled]) {
128
- filter: brightness(95%);
129
- }
130
- `;y([w()],p.prototype,"type",2);y([w({reflect:!0})],p.prototype,"value",2);y([w({reflect:!0})],p.prototype,"variant",2);y([w({converter:{fromAttribute:r=>r===""||r==="true"}})],p.prototype,"disabled",2);y([w()],p.prototype,"href",2);y([w()],p.prototype,"target",2);p=y([Mt("o-button")],p);
124
+ .button:active:not([disabled]) {
125
+ background-color: var(--button-bg-pressed);
126
+ }
127
+
128
+ .button:focus-visible {
129
+ ${kt}
130
+ }
131
+ `;y([w()],p.prototype,"type",2);y([w({reflect:!0})],p.prototype,"value",2);y([w({reflect:!0})],p.prototype,"variant",2);y([w({converter:{fromAttribute:i=>i===""||i==="true"}})],p.prototype,"disabled",2);y([w()],p.prototype,"href",2);y([w()],p.prototype,"target",2);p=y([Mt("o-button")],p);
package/index.mjs CHANGED
@@ -22,58 +22,58 @@ let lt = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const ct = (r) => new lt(typeof r == "string" ? r : r + "", void 0, F), J = (r, ...t) => {
26
- const e = r.length === 1 ? r[0] : t.reduce((s, i, o) => s + ((n) => {
25
+ const ct = (i) => new lt(typeof i == "string" ? i : i + "", void 0, F), J = (i, ...t) => {
26
+ const e = i.length === 1 ? i[0] : t.reduce((s, r, o) => s + ((n) => {
27
27
  if (n._$cssResult$ === !0) return n.cssText;
28
28
  if (typeof n == "number") return n;
29
29
  throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
- })(i) + r[o + 1], r[0]);
31
- return new lt(e, r, F);
32
- }, ft = (r, t) => {
33
- if (q) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
30
+ })(r) + i[o + 1], i[0]);
31
+ return new lt(e, i, F);
32
+ }, ft = (i, t) => {
33
+ if (q) 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"), i = R.litNonce;
36
- i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
35
+ const s = document.createElement("style"), r = R.litNonce;
36
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
37
37
  }
38
- }, X = q ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
38
+ }, X = q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
39
39
  let e = "";
40
40
  for (const s of t.cssRules) e += s.cssText;
41
41
  return ct(e);
42
- })(r) : r;
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: bt, defineProperty: _t, getOwnPropertyDescriptor: mt, getOwnPropertyNames: gt, getOwnPropertySymbols: vt, getPrototypeOf: yt } = Object, _ = globalThis, Y = _.trustedTypes, At = Y ? Y.emptyScript : "", L = _.reactiveElementPolyfillSupport, P = (r, t) => r, k = { toAttribute(r, t) {
48
+ const { is: bt, defineProperty: _t, getOwnPropertyDescriptor: mt, getOwnPropertyNames: gt, getOwnPropertySymbols: vt, getPrototypeOf: yt } = Object, _ = globalThis, Y = _.trustedTypes, At = Y ? Y.emptyScript : "", L = _.reactiveElementPolyfillSupport, P = (i, t) => i, k = { toAttribute(i, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
- r = r ? At : null;
51
+ i = i ? At : null;
52
52
  break;
53
53
  case Object:
54
54
  case Array:
55
- r = r == null ? r : JSON.stringify(r);
55
+ i = i == null ? i : JSON.stringify(i);
56
56
  }
57
- return r;
58
- }, fromAttribute(r, t) {
59
- let e = r;
57
+ return i;
58
+ }, fromAttribute(i, t) {
59
+ let e = i;
60
60
  switch (t) {
61
61
  case Boolean:
62
- e = r !== null;
62
+ e = i !== null;
63
63
  break;
64
64
  case Number:
65
- e = r === null ? null : Number(r);
65
+ e = i === null ? null : Number(i);
66
66
  break;
67
67
  case Object:
68
68
  case Array:
69
69
  try {
70
- e = JSON.parse(r);
70
+ e = JSON.parse(i);
71
71
  } catch {
72
72
  e = null;
73
73
  }
74
74
  }
75
75
  return e;
76
- } }, K = (r, t) => !bt(r, t), tt = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: K };
76
+ } }, K = (i, t) => !bt(i, t), tt = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: K };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
78
  class A extends HTMLElement {
79
79
  static addInitializer(t) {
@@ -84,20 +84,20 @@ class A extends HTMLElement {
84
84
  }
85
85
  static createProperty(t, e = tt) {
86
86
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
87
- const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
88
- i !== void 0 && _t(this.prototype, t, i);
87
+ const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
88
+ r !== void 0 && _t(this.prototype, t, r);
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, e, s) {
92
- const { get: i, set: o } = mt(this.prototype, t) ?? { get() {
92
+ const { get: r, set: o } = mt(this.prototype, t) ?? { get() {
93
93
  return this[e];
94
94
  }, set(n) {
95
95
  this[e] = n;
96
96
  } };
97
97
  return { get() {
98
- return i == null ? void 0 : i.call(this);
98
+ return r == null ? void 0 : r.call(this);
99
99
  }, set(n) {
100
- const h = i == null ? void 0 : i.call(this);
100
+ const h = r == null ? void 0 : r.call(this);
101
101
  o.call(this, n), this.requestUpdate(t, h, s);
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
@@ -113,17 +113,17 @@ class A extends HTMLElement {
113
113
  if (this.hasOwnProperty(P("finalized"))) return;
114
114
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
115
115
  const e = this.properties, s = [...gt(e), ...vt(e)];
116
- for (const i of s) this.createProperty(i, e[i]);
116
+ for (const r of s) this.createProperty(r, e[r]);
117
117
  }
118
118
  const t = this[Symbol.metadata];
119
119
  if (t !== null) {
120
120
  const e = litPropertyMetadata.get(t);
121
- if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
121
+ if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
122
122
  }
123
123
  this._$Eh = /* @__PURE__ */ new Map();
124
124
  for (const [e, s] of this.elementProperties) {
125
- const i = this._$Eu(e, s);
126
- i !== void 0 && this._$Eh.set(i, e);
125
+ const r = this._$Eu(e, s);
126
+ r !== void 0 && this._$Eh.set(r, e);
127
127
  }
128
128
  this.elementStyles = this.finalizeStyles(this.styles);
129
129
  }
@@ -131,7 +131,7 @@ class A extends HTMLElement {
131
131
  const e = [];
132
132
  if (Array.isArray(t)) {
133
133
  const s = new Set(t.flat(1 / 0).reverse());
134
- for (const i of s) e.unshift(X(i));
134
+ for (const r of s) e.unshift(X(r));
135
135
  } else t !== void 0 && e.push(X(t));
136
136
  return e;
137
137
  }
@@ -184,18 +184,18 @@ class A extends HTMLElement {
184
184
  }
185
185
  _$EC(t, e) {
186
186
  var o;
187
- const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
188
- if (i !== void 0 && s.reflect === !0) {
187
+ const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
188
+ if (r !== void 0 && s.reflect === !0) {
189
189
  const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : k).toAttribute(e, s.type);
190
- this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
190
+ this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
191
191
  }
192
192
  }
193
193
  _$AK(t, e) {
194
194
  var o;
195
- const s = this.constructor, i = s._$Eh.get(t);
196
- if (i !== void 0 && this._$Em !== i) {
197
- const n = s.getPropertyOptions(i), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : k;
198
- this._$Em = i, this[i] = h.fromAttribute(e, n.type), this._$Em = null;
195
+ const s = this.constructor, r = s._$Eh.get(t);
196
+ if (r !== void 0 && this._$Em !== r) {
197
+ const n = s.getPropertyOptions(r), h = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : k;
198
+ this._$Em = r, this[r] = h.fromAttribute(e, n.type), this._$Em = null;
199
199
  }
200
200
  }
201
201
  requestUpdate(t, e, s) {
@@ -229,18 +229,18 @@ class A extends HTMLElement {
229
229
  for (const [o, n] of this._$Ep) this[o] = n;
230
230
  this._$Ep = void 0;
231
231
  }
232
- const i = this.constructor.elementProperties;
233
- if (i.size > 0) for (const [o, n] of i) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n);
232
+ const r = this.constructor.elementProperties;
233
+ if (r.size > 0) for (const [o, n] of r) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n);
234
234
  }
235
235
  let t = !1;
236
236
  const e = this._$AL;
237
237
  try {
238
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
238
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((r) => {
239
239
  var o;
240
- return (o = i.hostUpdate) == null ? void 0 : o.call(i);
240
+ return (o = r.hostUpdate) == null ? void 0 : o.call(r);
241
241
  }), this.update(e)) : this._$EU();
242
- } catch (i) {
243
- throw t = !1, this._$EU(), i;
242
+ } catch (r) {
243
+ throw t = !1, this._$EU(), r;
244
244
  }
245
245
  t && this._$AE(e);
246
246
  }
@@ -249,8 +249,8 @@ class A extends HTMLElement {
249
249
  _$AE(t) {
250
250
  var e;
251
251
  (e = this._$EO) == null || e.forEach((s) => {
252
- var i;
253
- return (i = s.hostUpdated) == null ? void 0 : i.call(s);
252
+ var r;
253
+ return (r = s.hostUpdated) == null ? void 0 : r.call(s);
254
254
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
255
255
  }
256
256
  _$EU() {
@@ -279,28 +279,28 @@ A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[P("elementProper
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const C = globalThis, z = C.trustedTypes, et = z ? z.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, dt = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + b, Et = `<${ut}>`, v = document, O = () => v.createComment(""), T = (r) => r === null || typeof r != "object" && typeof r != "function", Z = Array.isArray, St = (r) => Z(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", j = `[
283
- \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, m = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, nt = /"/g, pt = /^(?:script|style|textarea|title)$/i, wt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), B = wt(1), E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), g = v.createTreeWalker(v, 129);
285
- function $t(r, t) {
286
- if (!Z(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
282
+ const C = globalThis, z = C.trustedTypes, et = z ? z.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, dt = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + b, Et = `<${ut}>`, v = document, O = () => v.createComment(""), T = (i) => i === null || typeof i != "object" && typeof i != "function", Z = Array.isArray, St = (i) => Z(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", j = `[
283
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, rt = />/g, m = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, nt = /"/g, pt = /^(?:script|style|textarea|title)$/i, wt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), B = wt(1), E = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), g = v.createTreeWalker(v, 129);
285
+ function $t(i, t) {
286
+ if (!Z(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
287
  return et !== void 0 ? et.createHTML(t) : t;
288
288
  }
289
- const xt = (r, t) => {
290
- const e = r.length - 1, s = [];
291
- let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = x;
289
+ const xt = (i, t) => {
290
+ const e = i.length - 1, s = [];
291
+ let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = x;
292
292
  for (let h = 0; h < e; h++) {
293
- const a = r[h];
293
+ const a = i[h];
294
294
  let d, u, l = -1, $ = 0;
295
- for (; $ < a.length && (n.lastIndex = $, u = n.exec(a), u !== null); ) $ = n.lastIndex, n === x ? u[1] === "!--" ? n = st : u[1] !== void 0 ? n = it : u[2] !== void 0 ? (pt.test(u[2]) && (i = RegExp("</" + u[2], "g")), n = m) : u[3] !== void 0 && (n = m) : n === m ? u[0] === ">" ? (n = i ?? x, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, d = u[1], n = u[3] === void 0 ? m : u[3] === '"' ? nt : rt) : n === nt || n === rt ? n = m : n === st || n === it ? n = x : (n = m, i = void 0);
296
- const f = n === m && r[h + 1].startsWith("/>") ? " " : "";
295
+ for (; $ < a.length && (n.lastIndex = $, u = n.exec(a), u !== null); ) $ = n.lastIndex, n === x ? u[1] === "!--" ? n = st : u[1] !== void 0 ? n = rt : u[2] !== void 0 ? (pt.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = m) : u[3] !== void 0 && (n = m) : n === m ? u[0] === ">" ? (n = r ?? x, l = -1) : u[1] === void 0 ? l = -2 : (l = n.lastIndex - u[2].length, d = u[1], n = u[3] === void 0 ? m : u[3] === '"' ? nt : it) : n === nt || n === it ? n = m : n === st || n === rt ? n = x : (n = m, r = void 0);
296
+ const f = n === m && i[h + 1].startsWith("/>") ? " " : "";
297
297
  o += n === x ? a + Et : l >= 0 ? (s.push(d), a.slice(0, l) + dt + a.slice(l) + b + f) : a + b + (l === -2 ? h : f);
298
298
  }
299
- return [$t(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
299
+ return [$t(i, o + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
300
300
  };
301
301
  class H {
302
302
  constructor({ strings: t, _$litType$: e }, s) {
303
- let i;
303
+ let r;
304
304
  this.parts = [];
305
305
  let o = 0, n = 0;
306
306
  const h = t.length - 1, a = this.parts, [d, u] = xt(t, e);
@@ -308,24 +308,24 @@ class H {
308
308
  const l = this.el.content.firstChild;
309
309
  l.replaceWith(...l.childNodes);
310
310
  }
311
- for (; (i = g.nextNode()) !== null && a.length < h; ) {
312
- if (i.nodeType === 1) {
313
- if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(dt)) {
314
- const $ = u[n++], f = i.getAttribute(l).split(b), N = /([.?@])?(.*)/.exec($);
315
- a.push({ type: 1, index: o, name: N[2], strings: f, ctor: N[1] === "." ? Ct : N[1] === "?" ? Ut : N[1] === "@" ? Ot : I }), i.removeAttribute(l);
316
- } else l.startsWith(b) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
317
- if (pt.test(i.tagName)) {
318
- const l = i.textContent.split(b), $ = l.length - 1;
311
+ for (; (r = g.nextNode()) !== null && a.length < h; ) {
312
+ if (r.nodeType === 1) {
313
+ if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(dt)) {
314
+ const $ = u[n++], f = r.getAttribute(l).split(b), N = /([.?@])?(.*)/.exec($);
315
+ a.push({ type: 1, index: o, name: N[2], strings: f, ctor: N[1] === "." ? Ct : N[1] === "?" ? Ut : N[1] === "@" ? Ot : I }), r.removeAttribute(l);
316
+ } else l.startsWith(b) && (a.push({ type: 6, index: o }), r.removeAttribute(l));
317
+ if (pt.test(r.tagName)) {
318
+ const l = r.textContent.split(b), $ = l.length - 1;
319
319
  if ($ > 0) {
320
- i.textContent = z ? z.emptyScript : "";
321
- for (let f = 0; f < $; f++) i.append(l[f], O()), g.nextNode(), a.push({ type: 2, index: ++o });
322
- i.append(l[$], O());
320
+ r.textContent = z ? z.emptyScript : "";
321
+ for (let f = 0; f < $; f++) r.append(l[f], O()), g.nextNode(), a.push({ type: 2, index: ++o });
322
+ r.append(l[$], O());
323
323
  }
324
324
  }
325
- } else if (i.nodeType === 8) if (i.data === ut) a.push({ type: 2, index: o });
325
+ } else if (r.nodeType === 8) if (r.data === ut) a.push({ type: 2, index: o });
326
326
  else {
327
327
  let l = -1;
328
- for (; (l = i.data.indexOf(b, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += b.length - 1;
328
+ for (; (l = r.data.indexOf(b, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += b.length - 1;
329
329
  }
330
330
  o++;
331
331
  }
@@ -335,12 +335,12 @@ class H {
335
335
  return s.innerHTML = t, s;
336
336
  }
337
337
  }
338
- function S(r, t, e = r, s) {
338
+ function S(i, t, e = i, s) {
339
339
  var n, h;
340
340
  if (t === E) return t;
341
- let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
341
+ let r = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
342
342
  const o = T(t) ? void 0 : t._$litDirective$;
343
- return (i == null ? void 0 : i.constructor) !== o && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = S(r, i._$AS(r, t.values), i, s)), t;
343
+ return (r == null ? void 0 : r.constructor) !== o && ((h = r == null ? void 0 : r._$AO) == null || h.call(r, !1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = S(i, r._$AS(i, t.values), r, s)), t;
344
344
  }
345
345
  class Pt {
346
346
  constructor(t, e) {
@@ -353,8 +353,8 @@ class Pt {
353
353
  return this._$AM._$AU;
354
354
  }
355
355
  u(t) {
356
- const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? v).importNode(e, !0);
357
- g.currentNode = i;
356
+ const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? v).importNode(e, !0);
357
+ g.currentNode = r;
358
358
  let o = g.nextNode(), n = 0, h = 0, a = s[0];
359
359
  for (; a !== void 0; ) {
360
360
  if (n === a.index) {
@@ -363,7 +363,7 @@ class Pt {
363
363
  }
364
364
  n !== (a == null ? void 0 : a.index) && (o = g.nextNode(), n++);
365
365
  }
366
- return g.currentNode = v, i;
366
+ return g.currentNode = v, r;
367
367
  }
368
368
  p(t) {
369
369
  let e = 0;
@@ -375,8 +375,8 @@ class M {
375
375
  var t;
376
376
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
377
377
  }
378
- constructor(t, e, s, i) {
379
- this.type = 2, this._$AH = c, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
378
+ constructor(t, e, s, r) {
379
+ 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;
380
380
  }
381
381
  get parentNode() {
382
382
  let t = this._$AA.parentNode;
@@ -403,10 +403,10 @@ class M {
403
403
  }
404
404
  $(t) {
405
405
  var o;
406
- const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = H.createElement($t(s.h, s.h[0]), this.options)), s);
407
- if (((o = this._$AH) == null ? void 0 : o._$AD) === i) this._$AH.p(e);
406
+ const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = H.createElement($t(s.h, s.h[0]), this.options)), s);
407
+ if (((o = this._$AH) == null ? void 0 : o._$AD) === r) this._$AH.p(e);
408
408
  else {
409
- const n = new Pt(i, this), h = n.u(this.options);
409
+ const n = new Pt(r, this), h = n.u(this.options);
410
410
  n.p(e), this.T(h), this._$AH = n;
411
411
  }
412
412
  }
@@ -417,15 +417,15 @@ class M {
417
417
  k(t) {
418
418
  Z(this._$AH) || (this._$AH = [], this._$AR());
419
419
  const e = this._$AH;
420
- let s, i = 0;
421
- for (const o of t) i === e.length ? e.push(s = new M(this.O(O()), this.O(O()), this, this.options)) : s = e[i], s._$AI(o), i++;
422
- i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
420
+ let s, r = 0;
421
+ for (const o of t) r === e.length ? e.push(s = new M(this.O(O()), this.O(O()), this, this.options)) : s = e[r], s._$AI(o), r++;
422
+ r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
423
423
  }
424
424
  _$AR(t = this._$AA.nextSibling, e) {
425
425
  var s;
426
426
  for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
427
- const i = t.nextSibling;
428
- t.remove(), t = i;
427
+ const r = t.nextSibling;
428
+ t.remove(), t = r;
429
429
  }
430
430
  }
431
431
  setConnected(t) {
@@ -440,10 +440,10 @@ class I {
440
440
  get _$AU() {
441
441
  return this._$AM._$AU;
442
442
  }
443
- constructor(t, e, s, i, o) {
444
- this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
443
+ constructor(t, e, s, r, o) {
444
+ this.type = 1, this._$AH = c, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = c;
445
445
  }
446
- _$AI(t, e = this, s, i) {
446
+ _$AI(t, e = this, s, r) {
447
447
  const o = this.strings;
448
448
  let n = !1;
449
449
  if (o === void 0) t = S(this, t, e, 0), n = !T(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
@@ -452,7 +452,7 @@ class I {
452
452
  let a, d;
453
453
  for (t = o[0], a = 0; a < o.length - 1; a++) d = S(this, h[s + a], e, a), d === E && (d = this._$AH[a]), n || (n = !T(d) || d !== this._$AH[a]), d === c ? t = c : t !== c && (t += (d ?? "") + o[a + 1]), this._$AH[a] = d;
454
454
  }
455
- n && !i && this.j(t);
455
+ n && !r && this.j(t);
456
456
  }
457
457
  j(t) {
458
458
  t === c ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
@@ -475,13 +475,13 @@ class Ut extends I {
475
475
  }
476
476
  }
477
477
  class Ot extends I {
478
- constructor(t, e, s, i, o) {
479
- super(t, e, s, i, o), this.type = 5;
478
+ constructor(t, e, s, r, o) {
479
+ super(t, e, s, r, o), this.type = 5;
480
480
  }
481
481
  _$AI(t, e = this) {
482
482
  if ((t = S(this, t, e, 0) ?? c) === E) return;
483
- const s = this._$AH, i = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== c && (s === c || i);
484
- i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
483
+ const s = this._$AH, r = t === c && s !== c || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== c && (s === c || r);
484
+ r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
485
  }
486
486
  handleEvent(t) {
487
487
  var e;
@@ -501,14 +501,14 @@ class Tt {
501
501
  }
502
502
  const D = C.litHtmlPolyfillSupport;
503
503
  D == null || D(H, M), (C.litHtmlVersions ?? (C.litHtmlVersions = [])).push("3.2.1");
504
- const Ht = (r, t, e) => {
504
+ const Ht = (i, t, e) => {
505
505
  const s = (e == null ? void 0 : e.renderBefore) ?? t;
506
- let i = s._$litPart$;
507
- if (i === void 0) {
506
+ let r = s._$litPart$;
507
+ if (r === void 0) {
508
508
  const o = (e == null ? void 0 : e.renderBefore) ?? null;
509
- s._$litPart$ = i = new M(t.insertBefore(O(), o), o, void 0, e ?? {});
509
+ s._$litPart$ = r = new M(t.insertBefore(O(), o), o, void 0, e ?? {});
510
510
  }
511
- return i._$AI(r), i;
511
+ return r._$AI(i), r;
512
512
  };
513
513
  /**
514
514
  * @license
@@ -550,42 +550,42 @@ V == null || V({ LitElement: U });
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- const Mt = (r) => (t, e) => {
553
+ const Mt = (i) => (t, e) => {
554
554
  e !== void 0 ? e.addInitializer(() => {
555
- customElements.define(r, t);
556
- }) : customElements.define(r, t);
555
+ customElements.define(i, t);
556
+ }) : customElements.define(i, t);
557
557
  };
558
558
  /**
559
559
  * @license
560
560
  * Copyright 2017 Google LLC
561
561
  * SPDX-License-Identifier: BSD-3-Clause
562
562
  */
563
- const Nt = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: K }, Rt = (r = Nt, t, e) => {
564
- const { kind: s, metadata: i } = e;
565
- let o = globalThis.litPropertyMetadata.get(i);
566
- if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") {
563
+ const Nt = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: K }, Rt = (i = Nt, t, e) => {
564
+ const { kind: s, metadata: r } = e;
565
+ let o = globalThis.litPropertyMetadata.get(r);
566
+ if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), o.set(e.name, i), s === "accessor") {
567
567
  const { name: n } = e;
568
568
  return { set(h) {
569
569
  const a = t.get.call(this);
570
- t.set.call(this, h), this.requestUpdate(n, a, r);
570
+ t.set.call(this, h), this.requestUpdate(n, a, i);
571
571
  }, init(h) {
572
- return h !== void 0 && this.P(n, void 0, r), h;
572
+ return h !== void 0 && this.P(n, void 0, i), h;
573
573
  } };
574
574
  }
575
575
  if (s === "setter") {
576
576
  const { name: n } = e;
577
577
  return function(h) {
578
578
  const a = this[n];
579
- t.call(this, h), this.requestUpdate(n, a, r);
579
+ t.call(this, h), this.requestUpdate(n, a, i);
580
580
  };
581
581
  }
582
582
  throw Error("Unsupported decorator location: " + s);
583
583
  };
584
- function w(r) {
585
- return (t, e) => typeof e == "object" ? Rt(r, t, e) : ((s, i, o) => {
586
- const n = i.hasOwnProperty(o);
587
- return i.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
588
- })(r, t, e);
584
+ function w(i) {
585
+ return (t, e) => typeof e == "object" ? Rt(i, t, e) : ((s, r, o) => {
586
+ const n = r.hasOwnProperty(o);
587
+ return r.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
588
+ })(i, t, e);
589
589
  }
590
590
  const kt = J`
591
591
  outline: 1px dashed var(--button-border-color);
@@ -603,9 +603,9 @@ J`
603
603
  * SPDX-License-Identifier: Apache-2.0
604
604
  */
605
605
  const G = Symbol("internals"), W = Symbol("privateInternals");
606
- function zt(r) {
606
+ function zt(i) {
607
607
  var t;
608
- class e extends r {
608
+ class e extends i {
609
609
  get [(t = G, t)]() {
610
610
  return this[W] || (this[W] = this.attachInternals()), this[W];
611
611
  }
@@ -617,15 +617,15 @@ function zt(r) {
617
617
  * Copyright 2023 Google LLC
618
618
  * SPDX-License-Identifier: Apache-2.0
619
619
  */
620
- function It(r) {
621
- r.addInitializer((t) => {
620
+ function It(i) {
621
+ i.addInitializer((t) => {
622
622
  const e = t;
623
623
  e.addEventListener("click", async (s) => {
624
- const { type: i, [G]: o } = e, { form: n } = o;
625
- if (!(!n || i === "button") && (await new Promise((h) => {
624
+ const { type: r, [G]: o } = e, { form: n } = o;
625
+ if (!(!n || r === "button") && (await new Promise((h) => {
626
626
  setTimeout(h);
627
627
  }), !s.defaultPrevented)) {
628
- if (i === "reset") {
628
+ if (r === "reset") {
629
629
  n.reset();
630
630
  return;
631
631
  }
@@ -644,24 +644,25 @@ function It(r) {
644
644
  });
645
645
  });
646
646
  }
647
- var Lt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, y = (r, t, e, s) => {
648
- for (var i = s > 1 ? void 0 : s ? jt(t, e) : t, o = r.length - 1, n; o >= 0; o--)
649
- (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
650
- return s && i && Lt(t, e, i), i;
647
+ var Lt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, y = (i, t, e, s) => {
648
+ for (var r = s > 1 ? void 0 : s ? jt(t, e) : t, o = i.length - 1, n; o >= 0; o--)
649
+ (n = i[o]) && (r = (s ? n(t, e, r) : n(r)) || r);
650
+ return s && r && Lt(t, e, r), r;
651
651
  };
652
- const Bt = zt(U), at = (r) => {
652
+ const Bt = zt(U), at = (i) => {
653
653
  const t = `
654
- --button-bg-disabled: var(--color-content-disabled);
655
- --button-bg-hover: var(--color-container-action-${r}-hover);
656
- --button-bg: var(--color-container-action-${r}-default);
657
- --button-border-disabled: var(--color-border-${r});
658
- --button-border-hover: var(--color-border-${r});
659
- --button-border-width-disabled: var(--button-${r}-border-width-disabled);
660
- --button-border-width: var(--button-${r}-border-width-default, 1px);
661
- --button-border: var(--button-${r}-border-default);
662
- --button-text-disabled: var(--color-content-action-${r}-disabled);
663
- --button-text-hover: var(--color-content-action-${r}-hover);
664
- --button-text: var(--color-content-action-${r}-default);
654
+ --button-bg-disabled: var(--color-container-disabled);
655
+ --button-bg-pressed: var(--color-container-action-${i}-pressed);
656
+ --button-bg-hover: var(--color-container-action-${i}-hover);
657
+ --button-bg: var(--color-container-action-${i}-default);
658
+ --button-border-disabled: var(--color-border-${i});
659
+ --button-border-hover: var(--color-border-${i});
660
+ --button-border-width-disabled: var(--border-m);
661
+ --button-border-width: var(--border-m);
662
+ --button-border: var(--color-border-${i});
663
+ --button-text-disabled: var(--color-content-disabled);
664
+ --button-text-hover: var(--color-content-action-${i});
665
+ --button-text: var(--color-content-action-${i});
665
666
  `;
666
667
  return ct(t);
667
668
  }, Dt = ["primary", "secondary"];
@@ -672,8 +673,8 @@ let p = class extends Bt {
672
673
  get name() {
673
674
  return this.getAttribute("name") ?? "";
674
675
  }
675
- set name(r) {
676
- this.setAttribute("name", r);
676
+ set name(i) {
677
+ this.setAttribute("name", i);
677
678
  }
678
679
  /**
679
680
  * The associated form element with which this element's value will submit.
@@ -684,98 +685,98 @@ let p = class extends Bt {
684
685
  // TODO: Add aria attributes support
685
686
  // Adapt from: https://github.dev/material-components/material-web
686
687
  willUpdate() {
687
- const r = getComputedStyle(this).getPropertyValue("--button-variant");
688
- r && Dt.some((t) => t === r) && (this.variant = r);
688
+ const i = getComputedStyle(this).getPropertyValue("--button-variant");
689
+ i && Dt.some((t) => t === i) && (this.variant = i);
689
690
  }
690
691
  render() {
691
- const r = this.href ? this.renderLink() : this.renderButton();
692
- return B`${r}`;
692
+ const i = this.href ? this.renderLink() : this.renderButton();
693
+ return B`${i}`;
693
694
  }
694
695
  renderLink() {
695
- return B`<a
696
- href=${this.href}
697
- target=${this.target || c}
698
- class="button"
699
- ?disabled=${this.disabled}
700
- >
701
- <slot />
702
- </a>`;
696
+ return B`<a href=${this.href} target=${this.target || c} class="button" ?disabled=${this.disabled}>
697
+ <slot />
698
+ </a>`;
703
699
  }
704
700
  renderButton() {
705
701
  return B`<button class="button" ?disabled=${this.disabled}>
706
- <slot />
707
- </button>`;
702
+ <slot />
703
+ </button>`;
708
704
  }
709
705
  };
710
706
  It(p);
711
707
  p.formAssociated = !0;
712
708
  p.styles = J`
713
- :host {
714
- display: inline-flex;
715
- cursor: pointer;
716
- ${at("primary")}
717
- }
709
+ :host {
710
+ display: inline-flex;
711
+ cursor: pointer;
712
+ ${at("primary")}
713
+ }
714
+
715
+ :host([variant="secondary"]) {
716
+ ${at("secondary")}
717
+ }
718
718
 
719
- :host([variant="secondary"]) {
720
- ${at("secondary")}
721
- }
719
+ :host([disabled]) {
720
+ --button-bg: var(--button-bg-disabled);
721
+ --button-text: var(--button-text-disabled);
722
+ --button-border: transparent;
723
+ }
722
724
 
723
- :host([disabled]) {
724
- --button-bg: var(--button-bg-disabled);
725
- --button-text: var(--button-text-disabled);
726
- --button-border: var(--button-border-disabled);
727
- }
725
+ :host([disabled][variant="secondary"]) {
726
+ --button-bg: var(--button-bg-disabled);
727
+ --button-text: var(--button-text-disabled);
728
+ --button-border: var(--button-border);
729
+ }
728
730
 
729
- .button {
730
- -webkit-appearance: none;
731
- align-items: center;
732
- background-color: var(--button-bg);
733
- border-color: var(--button-border);
734
- border-radius: var(--radius-full);
735
- border-width: var(--spacing-m);
736
- border-style: solid;
737
- box-sizing: border-box;
738
- color: var(--button-text);
739
- cursor: inherit;
740
- display: inline-flex;
741
- font-family: var(--font-family-sans);
742
- font-size: var(--font-size-ui);
743
- font-weight: var(--font-weight-ui);
744
- gap: inherit;
745
- height: 100%;
746
- justify-content: center;
747
- line-height: var(--font-line-height-ui);
748
- min-width: 64px;
749
- outline: none;
750
- padding: 0;
751
- padding: var(--button-padding-block) var(--button-padding-inline);
752
- text-decoration: none;
753
- vertical-align: middle;
754
- width: 100%;
731
+ .button {
732
+ -webkit-appearance: none;
733
+ align-items: center;
734
+ background-color: var(--button-bg);
735
+ border-color: var(--button-border);
736
+ border-radius: var(--radius-m);
737
+ border-width: var(--border-m);
738
+ border-style: solid;
739
+ box-sizing: border-box;
740
+ color: var(--button-text);
741
+ cursor: inherit;
742
+ display: inline-flex;
743
+ font-family: var(--font-family-loccitane-sans);
744
+ font-size: var(--font-size-150);
745
+ font-weight: var(--font-weight-400);
746
+ gap: var(--spacing-s, 8px);
747
+ height: 100%;
748
+ justify-content: center;
749
+ line-height: var(--line-height-140);
750
+ min-width: 64px;
751
+ outline: none;
752
+ padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
753
+ text-decoration: none;
754
+ vertical-align: middle;
755
+ width: 100%;
755
756
 
756
- &::-moz-focus-inner {
757
- padding: 0;
758
- border: 0;
759
- }
760
- }
757
+ &::-moz-focus-inner {
758
+ padding: 0;
759
+ border: 0;
760
+ }
761
+ }
761
762
 
762
- .button:disabled {
763
- cursor: initial;
764
- }
763
+ .button:disabled {
764
+ cursor: initial;
765
+ }
765
766
 
766
- .button:hover:not([disabled]) {
767
- background-color: var(--button-bg-hover);
768
- color: var(--button-text-hover);
769
- }
767
+ .button:hover:not([disabled]) {
768
+ background-color: var(--button-bg-hover);
769
+ color: var(--button-text-hover);
770
+ }
770
771
 
771
- .button:focus-visible {
772
- ${kt}
773
- }
772
+ .button:active:not([disabled]) {
773
+ background-color: var(--button-bg-pressed);
774
+ }
774
775
 
775
- .button:active:not([disabled]) {
776
- filter: brightness(95%);
777
- }
778
- `;
776
+ .button:focus-visible {
777
+ ${kt}
778
+ }
779
+ `;
779
780
  y([
780
781
  w()
781
782
  ], p.prototype, "type", 2);
@@ -788,7 +789,7 @@ y([
788
789
  y([
789
790
  w({
790
791
  converter: {
791
- fromAttribute: (r) => r === "" || r === "true"
792
+ fromAttribute: (i) => i === "" || i === "true"
792
793
  }
793
794
  })
794
795
  ], p.prototype, "disabled", 2);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
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.0.0"
9
+ "@florid-kit/tokens": "^0.1.0"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@storybook/addon-essentials": "^8.1.5",