@florid-kit/components 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/icon-button.d.ts +1 -1
- package/index.js +48 -9
- package/index.mjs +70 -31
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
|
|
3
|
-
type bgstyle = "background-light" | "background-contrast" | "ghost-light" | "ghost-contrast";
|
|
3
|
+
type bgstyle = "background-light" | "background-contrast" | "ghost-light" | "ghost-contrast" | "none";
|
|
4
4
|
type size = "small" | "medium" | "large";
|
|
5
5
|
type status = "empty" | "filled";
|
|
6
6
|
export declare class OccitaneIconButton extends LitElement {
|
package/index.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const I=globalThis,Q=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),rt=new WeakMap;let
|
|
5
|
+
*/const I=globalThis,Q=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),rt=new WeakMap;let gt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Q&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=rt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&rt.set(e,t))}return t}toString(){return this.cssText}};const ft=i=>new gt(typeof i=="string"?i:i+"",void 0,X),R=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new gt(e,i,X)},St=(i,t)=>{if(Q)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=I.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},it=Q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return ft(e)})(i):i;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:xt,defineProperty:Et,getOwnPropertyDescriptor:Pt,getOwnPropertyNames:Ct,getOwnPropertySymbols:Ot,getPrototypeOf:Ut}=Object,v=globalThis,ot=v.trustedTypes,Tt=ot?ot.emptyScript:"",W=v.reactiveElementPolyfillSupport,U=(i,t)=>i,L={toAttribute(i,t){switch(t){case Boolean:i=i?Tt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},Y=(i,t)=>!xt(i,t),nt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:Y};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=nt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Et(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=Pt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const l=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??nt}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=Ut(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const e=this.properties,s=[...Ct(e),...Ot(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(it(r))}else t!==void 0&&e.push(it(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var n;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:L).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:L;this._$Em=r,this[r]=l.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??Y)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[U("elementProperties")]=new Map,E[U("finalized")]=new Map,W==null||W({ReactiveElement:E}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const T=globalThis,D=T.trustedTypes,at=D?D.createPolicy("lit-html",{createHTML:i=>i}):void 0,$t="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,vt="?"+$,kt=`<${vt}>`,w=document,H=()=>w.createComment(""),M=i=>i===null||typeof i!="object"&&typeof i!="function",tt=Array.isArray,Ht=i=>tt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",q=`[
|
|
14
14
|
\f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,ht=/>/g,y=RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,_t=/^(?:script|style|textarea|title)$/i,Mt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),k=Mt(1),S=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ut=new WeakMap,m=w.createTreeWalker(w,129);function yt(i,t){if(!tt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}const Nt=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=O;for(let l=0;l<e;l++){const a=i[l];let d,u,h=-1,
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,dt=/"/g,_t=/^(?:script|style|textarea|title)$/i,Mt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),k=Mt(1),S=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),ut=new WeakMap,m=w.createTreeWalker(w,129);function yt(i,t){if(!tt(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return at!==void 0?at.createHTML(t):t}const Nt=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":t===3?"<math>":"",o=O;for(let l=0;l<e;l++){const a=i[l];let d,u,h=-1,g=0;for(;g<a.length&&(o.lastIndex=g,u=o.exec(a),u!==null);)g=o.lastIndex,o===O?u[1]==="!--"?o=lt:u[1]!==void 0?o=ht:u[2]!==void 0?(_t.test(u[2])&&(r=RegExp("</"+u[2],"g")),o=y):u[3]!==void 0&&(o=y):o===y?u[0]===">"?(o=r??O,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?y:u[3]==='"'?dt:ct):o===dt||o===ct?o=y:o===lt||o===ht?o=O:(o=y,r=void 0);const f=o===y&&i[l+1].startsWith("/>")?" ":"";n+=o===O?a+kt:h>=0?(s.push(d),a.slice(0,h)+$t+a.slice(h)+$+f):a+$+(h===-2?l:f)}return[yt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const l=t.length-1,a=this.parts,[d,u]=Nt(t,e);if(this.el=N.createElement(d,s),m.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=m.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const h of r.getAttributeNames())if(h.endsWith($t)){const g=u[o++],f=r.getAttribute(h).split($),z=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:z[2],strings:f,ctor:z[1]==="."?jt:z[1]==="?"?zt:z[1]==="@"?It:V}),r.removeAttribute(h)}else h.startsWith($)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(_t.test(r.tagName)){const h=r.textContent.split($),g=h.length-1;if(g>0){r.textContent=D?D.emptyScript:"";for(let f=0;f<g;f++)r.append(h[f],H()),m.nextNode(),a.push({type:2,index:++n});r.append(h[g],H())}}}else if(r.nodeType===8)if(r.data===vt)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf($,h+1))!==-1;)a.push({type:7,index:n}),h+=$.length-1}n++}}static createElement(t,e){const s=w.createElement("template");return s.innerHTML=t,s}}function P(i,t,e=i,s){var o,l;if(t===S)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=M(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((l=r==null?void 0:r._$AO)==null||l.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=P(i,r._$AS(i,t.values),r,s)),t}class Rt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=((t==null?void 0:t.creationScope)??w).importNode(e,!0);m.currentNode=r;let n=m.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new j(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Lt(n,this,t)),this._$AV.push(d),a=s[++l]}o!==(a==null?void 0:a.index)&&(n=m.nextNode(),o++)}return m.currentNode=w,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class j{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),M(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ht(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==c&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(yt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Rt(r,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=ut.get(t.strings);return e===void 0&&ut.set(t.strings,e=new N(t)),e}k(t){tt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new j(this.O(H()),this.O(H()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=c}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=P(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const l=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=P(this,l[s+a],e,a),d===S&&(d=this._$AH[a]),o||(o=!M(d)||d!==this._$AH[a]),d===c?t=c:t!==c&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}o&&!r&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class jt extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class zt extends V{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class It extends V{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??c)===S)return;const s=this._$AH,r=t===c&&s!==c||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==c&&(s===c||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Lt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const F=T.litHtmlPolyfillSupport;F==null||F(N,j),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.2.1");const Dt=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new j(t.insertBefore(H(),n),n,void 0,e??{})}return r._$AI(i),r};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let A=class extends
|
|
19
|
+
*/let A=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Dt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}};var bt;A._$litElement$=!0,A.finalized=!0,(bt=globalThis.litElementHydrateSupport)==null||bt.call(globalThis,{LitElement:A});const Z=globalThis.litElementPolyfillSupport;Z==null||Z({LitElement:A});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2023 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: Apache-2.0
|
|
43
|
-
*/function Ft(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[st]:n}=e,{form:o}=n;if(!(!o||r==="button")&&(await new Promise(l=>{setTimeout(l)}),!s.defaultPrevented)){if(r==="reset"){o.reset();return}o.addEventListener("submit",l=>{Object.defineProperty(l,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),n.setFormValue(e.value),o.requestSubmit()}})})}var Zt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,
|
|
43
|
+
*/function Ft(i){i.addInitializer(t=>{const e=t;e.addEventListener("click",async s=>{const{type:r,[st]:n}=e,{form:o}=n;if(!(!o||r==="button")&&(await new Promise(l=>{setTimeout(l)}),!s.defaultPrevented)){if(r==="reset"){o.reset();return}o.addEventListener("submit",l=>{Object.defineProperty(l,"submitter",{configurable:!0,enumerable:!0,get:()=>e})},{capture:!0,once:!0}),n.setFormValue(e.value),o.requestSubmit()}})})}var Zt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,x=(i,t,e,s)=>{for(var r=s>1?void 0:s?Jt(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&Zt(t,e,r),r};const Kt=qt(A),pt=i=>{const t=`
|
|
44
44
|
--button-bg-disabled: var(--color-container-disabled);
|
|
45
45
|
--button-bg-pressed: var(--color-container-action-${i}-pressed);
|
|
46
46
|
--button-bg-hover: var(--color-container-action-${i}-hover);
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
--button-text-disabled: var(--color-content-disabled);
|
|
54
54
|
--button-text-hover: var(--color-content-action-${i});
|
|
55
55
|
--button-text: var(--color-content-action-${i});
|
|
56
|
-
`;return
|
|
56
|
+
`;return ft(t)},Gt=["primary","secondary"];let b=class extends Kt{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.disabled=!1,this.href="",this.target=""}get name(){return this.getAttribute("name")??""}set name(i){this.setAttribute("name",i)}get form(){return this[st].form}willUpdate(){const i=getComputedStyle(this).getPropertyValue("--button-variant");i&&Gt.some(t=>t===i)&&(this.variant=i)}render(){const i=this.href?this.renderLink():this.renderButton();return k`${i}`}renderLink(){return k`<a href=${this.href} target=${this.target||c} class="button" ?disabled=${this.disabled}>
|
|
57
57
|
<slot />
|
|
58
58
|
</a>`}renderButton(){return k`<button class="button" ?disabled=${this.disabled}>
|
|
59
59
|
<slot />
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
.button:focus-visible {
|
|
130
130
|
${Wt};
|
|
131
131
|
}
|
|
132
|
-
`;
|
|
132
|
+
`;x([p()],b.prototype,"type",2);x([p({reflect:!0})],b.prototype,"value",2);x([p({reflect:!0})],b.prototype,"variant",2);x([p({converter:{fromAttribute:i=>i===""||i==="true"}})],b.prototype,"disabled",2);x([p()],b.prototype,"href",2);x([p()],b.prototype,"target",2);b=x([et("o-button")],b);/**
|
|
133
133
|
* @license
|
|
134
134
|
* Copyright 2017 Google LLC
|
|
135
135
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -246,6 +246,45 @@
|
|
|
246
246
|
height: 40px;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
.icon-button.none-light, .icon-button.none-contrast {
|
|
250
|
+
background-color: transparent;
|
|
251
|
+
width: auto;
|
|
252
|
+
height: auto;
|
|
253
|
+
|
|
254
|
+
&.small {
|
|
255
|
+
svg {
|
|
256
|
+
width: 8px;
|
|
257
|
+
height: 8px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&.medium {
|
|
262
|
+
svg {
|
|
263
|
+
width: 16px;
|
|
264
|
+
height: 16px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&.large {
|
|
269
|
+
svg {
|
|
270
|
+
width: 24px;
|
|
271
|
+
height: 24px;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&:disabled {
|
|
276
|
+
background-color: transparent;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.icon-button.none-light {
|
|
281
|
+
svg {
|
|
282
|
+
path {
|
|
283
|
+
stroke: var(--color-content-action-primary);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
249
288
|
.icon-button.background-light {
|
|
250
289
|
background-color: var(--color-alpha-light-strong);
|
|
251
290
|
|
|
@@ -272,11 +311,11 @@
|
|
|
272
311
|
|
|
273
312
|
.icon-button.ghost-light {
|
|
274
313
|
background-color: transparent;
|
|
275
|
-
&.filled {
|
|
314
|
+
/* &.filled {
|
|
276
315
|
svg {
|
|
277
316
|
fill: var(--color-content-action-primary);
|
|
278
317
|
}
|
|
279
|
-
}
|
|
318
|
+
} */
|
|
280
319
|
|
|
281
320
|
svg {
|
|
282
321
|
path {
|
package/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
6
|
const I = globalThis, Q = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), rt = /* @__PURE__ */ new WeakMap();
|
|
7
|
-
let
|
|
7
|
+
let gt = class {
|
|
8
8
|
constructor(t, e, s) {
|
|
9
9
|
if (this._$cssResult$ = !0, s !== X) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = t, this.t = e;
|
|
@@ -22,13 +22,13 @@ let ft = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const ft = (i) => new gt(typeof i == "string" ? i : i + "", void 0, X), R = (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
|
|
31
|
+
return new gt(e, i, X);
|
|
32
32
|
}, St = (i, t) => {
|
|
33
33
|
if (Q) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
34
|
else for (const e of t) {
|
|
@@ -38,14 +38,14 @@ const gt = (i) => new ft(typeof i == "string" ? i : i + "", void 0, X), R = (i,
|
|
|
38
38
|
}, it = Q ? (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 ft(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:
|
|
48
|
+
const { is: xt, defineProperty: Et, getOwnPropertyDescriptor: Pt, getOwnPropertyNames: Ct, getOwnPropertySymbols: Ot, getPrototypeOf: Ut } = Object, v = globalThis, ot = v.trustedTypes, Tt = ot ? ot.emptyScript : "", W = v.reactiveElementPolyfillSupport, U = (i, t) => i, L = { toAttribute(i, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
i = i ? Tt : null;
|
|
@@ -73,9 +73,9 @@ const { is: Et, defineProperty: xt, getOwnPropertyDescriptor: Pt, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
|
-
} }, Y = (i, t) => !
|
|
76
|
+
} }, Y = (i, t) => !xt(i, t), nt = { attribute: !0, type: String, converter: L, reflect: !1, hasChanged: Y };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
class
|
|
78
|
+
class E extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
@@ -85,7 +85,7 @@ class x extends HTMLElement {
|
|
|
85
85
|
static createProperty(t, e = nt) {
|
|
86
86
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
87
87
|
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
88
|
-
r !== void 0 &&
|
|
88
|
+
r !== void 0 && Et(this.prototype, t, r);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(t, e, s) {
|
|
@@ -273,7 +273,7 @@ class x extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[U("elementProperties")] = /* @__PURE__ */ new Map(), E[U("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: E }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
@@ -291,10 +291,10 @@ const Nt = (i, t) => {
|
|
|
291
291
|
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = O;
|
|
292
292
|
for (let l = 0; l < e; l++) {
|
|
293
293
|
const a = i[l];
|
|
294
|
-
let d, u, h = -1,
|
|
295
|
-
for (;
|
|
296
|
-
const
|
|
297
|
-
n += o === O ? a + kt : h >= 0 ? (s.push(d), a.slice(0, h) + $t + a.slice(h) + $ +
|
|
294
|
+
let d, u, h = -1, g = 0;
|
|
295
|
+
for (; g < a.length && (o.lastIndex = g, u = o.exec(a), u !== null); ) g = o.lastIndex, o === O ? u[1] === "!--" ? o = lt : u[1] !== void 0 ? o = ht : u[2] !== void 0 ? (_t.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = y) : u[3] !== void 0 && (o = y) : o === y ? u[0] === ">" ? (o = r ?? O, h = -1) : u[1] === void 0 ? h = -2 : (h = o.lastIndex - u[2].length, d = u[1], o = u[3] === void 0 ? y : u[3] === '"' ? dt : ct) : o === dt || o === ct ? o = y : o === lt || o === ht ? o = O : (o = y, r = void 0);
|
|
296
|
+
const f = o === y && i[l + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
n += o === O ? a + kt : h >= 0 ? (s.push(d), a.slice(0, h) + $t + a.slice(h) + $ + f) : a + $ + (h === -2 ? l : f);
|
|
298
298
|
}
|
|
299
299
|
return [yt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
300
300
|
};
|
|
@@ -311,15 +311,15 @@ class N {
|
|
|
311
311
|
for (; (r = m.nextNode()) !== null && a.length < l; ) {
|
|
312
312
|
if (r.nodeType === 1) {
|
|
313
313
|
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith($t)) {
|
|
314
|
-
const
|
|
315
|
-
a.push({ type: 1, index: n, name: z[2], strings:
|
|
314
|
+
const g = u[o++], f = r.getAttribute(h).split($), z = /([.?@])?(.*)/.exec(g);
|
|
315
|
+
a.push({ type: 1, index: n, name: z[2], strings: f, ctor: z[1] === "." ? jt : z[1] === "?" ? zt : z[1] === "@" ? It : V }), r.removeAttribute(h);
|
|
316
316
|
} else h.startsWith($) && (a.push({ type: 6, index: n }), r.removeAttribute(h));
|
|
317
317
|
if (_t.test(r.tagName)) {
|
|
318
|
-
const h = r.textContent.split($),
|
|
319
|
-
if (
|
|
318
|
+
const h = r.textContent.split($), g = h.length - 1;
|
|
319
|
+
if (g > 0) {
|
|
320
320
|
r.textContent = D ? D.emptyScript : "";
|
|
321
|
-
for (let
|
|
322
|
-
r.append(h[
|
|
321
|
+
for (let f = 0; f < g; f++) r.append(h[f], H()), m.nextNode(), a.push({ type: 2, index: ++n });
|
|
322
|
+
r.append(h[g], H());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
} else if (r.nodeType === 8) if (r.data === vt) a.push({ type: 2, index: n });
|
|
@@ -515,7 +515,7 @@ const Dt = (i, t, e) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
let A = class extends
|
|
518
|
+
let A = class extends E {
|
|
519
519
|
constructor() {
|
|
520
520
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
521
521
|
}
|
|
@@ -644,7 +644,7 @@ function Ft(i) {
|
|
|
644
644
|
});
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
|
-
var Zt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor,
|
|
647
|
+
var Zt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, x = (i, t, e, s) => {
|
|
648
648
|
for (var r = s > 1 ? void 0 : s ? Jt(t, e) : t, n = i.length - 1, o; n >= 0; n--)
|
|
649
649
|
(o = i[n]) && (r = (s ? o(t, e, r) : o(r)) || r);
|
|
650
650
|
return s && r && Zt(t, e, r), r;
|
|
@@ -664,7 +664,7 @@ const Kt = qt(A), pt = (i) => {
|
|
|
664
664
|
--button-text-hover: var(--color-content-action-${i});
|
|
665
665
|
--button-text: var(--color-content-action-${i});
|
|
666
666
|
`;
|
|
667
|
-
return
|
|
667
|
+
return ft(t);
|
|
668
668
|
}, Gt = ["primary", "secondary"];
|
|
669
669
|
let b = class extends Kt {
|
|
670
670
|
constructor() {
|
|
@@ -778,29 +778,29 @@ b.styles = R`
|
|
|
778
778
|
${Wt};
|
|
779
779
|
}
|
|
780
780
|
`;
|
|
781
|
-
|
|
781
|
+
x([
|
|
782
782
|
p()
|
|
783
783
|
], b.prototype, "type", 2);
|
|
784
|
-
|
|
784
|
+
x([
|
|
785
785
|
p({ reflect: !0 })
|
|
786
786
|
], b.prototype, "value", 2);
|
|
787
|
-
|
|
787
|
+
x([
|
|
788
788
|
p({ reflect: !0 })
|
|
789
789
|
], b.prototype, "variant", 2);
|
|
790
|
-
|
|
790
|
+
x([
|
|
791
791
|
p({
|
|
792
792
|
converter: {
|
|
793
793
|
fromAttribute: (i) => i === "" || i === "true"
|
|
794
794
|
}
|
|
795
795
|
})
|
|
796
796
|
], b.prototype, "disabled", 2);
|
|
797
|
-
|
|
797
|
+
x([
|
|
798
798
|
p()
|
|
799
799
|
], b.prototype, "href", 2);
|
|
800
|
-
|
|
800
|
+
x([
|
|
801
801
|
p()
|
|
802
802
|
], b.prototype, "target", 2);
|
|
803
|
-
b =
|
|
803
|
+
b = x([
|
|
804
804
|
et("o-button")
|
|
805
805
|
], b);
|
|
806
806
|
/**
|
|
@@ -1008,6 +1008,45 @@ _.styles = R`
|
|
|
1008
1008
|
height: 40px;
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
|
+
.icon-button.none-light, .icon-button.none-contrast {
|
|
1012
|
+
background-color: transparent;
|
|
1013
|
+
width: auto;
|
|
1014
|
+
height: auto;
|
|
1015
|
+
|
|
1016
|
+
&.small {
|
|
1017
|
+
svg {
|
|
1018
|
+
width: 8px;
|
|
1019
|
+
height: 8px;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
&.medium {
|
|
1024
|
+
svg {
|
|
1025
|
+
width: 16px;
|
|
1026
|
+
height: 16px;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
&.large {
|
|
1031
|
+
svg {
|
|
1032
|
+
width: 24px;
|
|
1033
|
+
height: 24px;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
&:disabled {
|
|
1038
|
+
background-color: transparent;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.icon-button.none-light {
|
|
1043
|
+
svg {
|
|
1044
|
+
path {
|
|
1045
|
+
stroke: var(--color-content-action-primary);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1011
1050
|
.icon-button.background-light {
|
|
1012
1051
|
background-color: var(--color-alpha-light-strong);
|
|
1013
1052
|
|
|
@@ -1034,11 +1073,11 @@ _.styles = R`
|
|
|
1034
1073
|
|
|
1035
1074
|
.icon-button.ghost-light {
|
|
1036
1075
|
background-color: transparent;
|
|
1037
|
-
&.filled {
|
|
1076
|
+
/* &.filled {
|
|
1038
1077
|
svg {
|
|
1039
1078
|
fill: var(--color-content-action-primary);
|
|
1040
1079
|
}
|
|
1041
|
-
}
|
|
1080
|
+
} */
|
|
1042
1081
|
|
|
1043
1082
|
svg {
|
|
1044
1083
|
path {
|