@chefuicore/core 0.1.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/dist/components/chef-button.d.ts +22 -0
- package/dist/components/chef-icon.d.ts +19 -0
- package/dist/icons/alert.d.ts +4 -0
- package/dist/icons/arrow-left.d.ts +4 -0
- package/dist/icons/arrow-right.d.ts +4 -0
- package/dist/icons/check.d.ts +4 -0
- package/dist/icons/edit.d.ts +4 -0
- package/dist/icons/info.d.ts +4 -0
- package/dist/icons/lock.d.ts +4 -0
- package/dist/icons/plus.d.ts +4 -0
- package/dist/icons/save.d.ts +4 -0
- package/dist/icons/search.d.ts +4 -0
- package/dist/icons/trash.d.ts +4 -0
- package/dist/icons/x.d.ts +4 -0
- package/dist/index.cjs +150 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +150 -0
- package/dist/utils/icon-resolver.d.ts +15 -0
- package/package.json +48 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import './chef-icon';
|
|
3
|
+
import type { IconName } from '../utils/icon-resolver';
|
|
4
|
+
export declare class ChefButton extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
variant: 'solid' | 'outline';
|
|
8
|
+
type: 'button' | 'submit' | 'reset';
|
|
9
|
+
name?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
form?: string;
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
private findAssociatedForm;
|
|
14
|
+
private handleClick;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'chef-button': ChefButton;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=chef-button.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { type IconName, type IconStyle } from '../utils/icon-resolver';
|
|
3
|
+
export declare class ChefIcon extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult;
|
|
5
|
+
name: IconName;
|
|
6
|
+
styleVariant: IconStyle;
|
|
7
|
+
size?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
ariaLabel: string | null;
|
|
10
|
+
updated(): void;
|
|
11
|
+
private renderPath;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'chef-icon': ChefIcon;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=chef-icon.d.ts.map
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";function t(t,e,s,i){var o,r=arguments.length,n=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(n=(r<3?o(n):r>3?o(e,s,n):o(e,s))||n);return r>3&&n&&Object.defineProperty(e,s,n),n}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
const e=globalThis,s=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let r=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)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(s&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&o.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1],t[0]);return new r(s,t,i)},h=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,i))(e)})(t):t,{is:a,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,v=f.trustedTypes,$=v?v.emptyScript:"",g=f.reactiveElementPolyfillSupport,m=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>!a(t,e),b={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:_};
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2017 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&l(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=i?.call(this);o?.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}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 t of s)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.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((t,i)=>{if(s)t.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of i){const i=document.createElement("style"),o=e.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=s.cssText,t.appendChild(i)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const o=(void 0!==s.converter?.toAttribute?s.converter:y).toAttribute(e,s.type);this._$Em=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=i;const r=o.fromAttribute(e,t.type);this[i]=r??this._$Ej?.get(i)??r,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??_)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==o||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[m("elementProperties")]=new Map,A[m("finalized")]=new Map,g?.({ReactiveElement:A}),(f.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
|
18
|
+
const E=globalThis,x=E.trustedTypes,S=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,M="?"+C,P=`<${M}>`,H=document,U=()=>H.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,T="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,N=/>/g,L=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,I=/"/g,j=/^(?:script|style|textarea|title)$/i,V=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),D=V(1),Z=V(2),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),F=new WeakMap,J=H.createTreeWalker(H,129);function K(t,e){if(!k(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,i=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=R;for(let e=0;e<s;e++){const s=t[e];let h,a,l=-1,c=0;for(;c<s.length&&(n.lastIndex=c,a=n.exec(s),null!==a);)c=n.lastIndex,n===R?"!--"===a[1]?n=z:void 0!==a[1]?n=N:void 0!==a[2]?(j.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=L):void 0!==a[3]&&(n=L):n===L?">"===a[0]?(n=o??R,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,h=a[1],n=void 0===a[3]?L:'"'===a[3]?I:B):n===I||n===B?n=L:n===z||n===N?n=R:(n=L,o=void 0);const d=n===L&&t[e+1].startsWith("/>")?" ":"";r+=n===R?s+P:l>=0?(i.push(h),s.slice(0,l)+w+s.slice(l)+C+d):s+C+(-2===l?e:d)}return[K(t,r+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class G{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,r=0;const n=t.length-1,h=this.parts,[a,l]=Y(t,e);if(this.el=G.createElement(a,s),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&h.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(w)){const e=l[r++],s=i.getAttribute(t).split(C),n=/([.?@])?(.*)/.exec(e);h.push({type:1,index:o,name:n[2],strings:s,ctor:"."===n[1]?st:"?"===n[1]?it:"@"===n[1]?ot:et}),i.removeAttribute(t)}else t.startsWith(C)&&(h.push({type:6,index:o}),i.removeAttribute(t));if(j.test(i.tagName)){const t=i.textContent.split(C),e=t.length-1;if(e>0){i.textContent=x?x.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],U()),J.nextNode(),h.push({type:2,index:++o});i.append(t[e],U())}}}else if(8===i.nodeType)if(i.data===M)h.push({type:2,index:o});else{let t=-1;for(;-1!==(t=i.data.indexOf(C,t+1));)h.push({type:7,index:o}),t+=C.length-1}o++}}static createElement(t,e){const s=H.createElement("template");return s.innerHTML=t,s}}function Q(t,e,s=t,i){if(e===q)return e;let o=void 0!==i?s._$Co?.[i]:s._$Cl;const r=O(e)?void 0:e._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(t),o._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=o:s._$Cl=o),void 0!==o&&(e=Q(t,o._$AS(t,e.values),o,i)),e}class X{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?.creationScope??H).importNode(e,!0);J.currentNode=i;let o=J.nextNode(),r=0,n=0,h=s[0];for(;void 0!==h;){if(r===h.index){let e;2===h.type?e=new tt(o,o.nextSibling,this,t):1===h.type?e=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(e=new rt(o,this,t)),this._$AV.push(e),h=s[++n]}r!==h?.index&&(o=J.nextNode(),r++)}return J.currentNode=H,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),O(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof t?.[Symbol.iterator])(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!==W&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(H.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=G.createElement(K(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new X(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new G(t)),e}k(t){k(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 tt(this.O(U()),this.O(U()),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){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=W,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=W}_$AI(t,e=this,s,i){const o=this.strings;let r=!1;if(void 0===o)t=Q(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==q,r&&(this._$AH=t);else{const i=t;let n,h;for(t=o[0],n=0;n<o.length-1;n++)h=Q(this,i[s+n],e,n),h===q&&(h=this._$AH[n]),r||=!O(h)||h!==this._$AH[n],h===W?t=W:t!==W&&(t+=(h??"")+o[n+1]),this._$AH[n]=h}r&&!i&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class st extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class it extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class ot extends et{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??W)===q)return;const s=this._$AH,i=t===W&&s!==W||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==W&&(s===W||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class rt{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){Q(this,t)}}const nt=E.litHtmlPolyfillSupport;nt?.(G,tt),(E.litHtmlVersions??=[]).push("3.3.1");const ht=globalThis;
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/class at extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=s?.renderBefore??e;let o=i._$litPart$;if(void 0===o){const t=s?.renderBefore??null;i._$litPart$=o=new tt(e.insertBefore(U(),t),t,void 0,s??{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}at._$litElement$=!0,at.finalized=!0,ht.litElementHydrateSupport?.({LitElement:at});const lt=ht.litElementPolyfillSupport;lt?.({LitElement:at}),(ht.litElementVersions??=[]).push("4.2.1");
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
const ct=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},pt=(t=dt,e,s)=>{const{kind:i,metadata:o}=s;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const o=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,o,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const o=this[i];e.call(this,s),this.requestUpdate(i,o,t)}}throw Error("Unsupported decorator location: "+i)};
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright 2017 Google LLC
|
|
33
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
+
*/function ut(t){return(e,s)=>"object"==typeof s?pt(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}class ft{constructor(){this.registry=new Map}register(t,e){this.registry.set(t,e)}resolve(t){return this.registry.get(t)}has(t){return this.registry.has(t)}list(){return Array.from(this.registry.keys()).sort()}}const vt=new ft;vt.register("plus",{outline:"M12 4v16M4 12h16",solid:"M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"}),vt.register("check",{outline:"m5 13 4 4L19 7",solid:"M10 15.172 5.414 10.586 4 12l6 6L20 8l-1.414-1.414z"}),vt.register("x",{outline:"M6 6l12 12M6 18L18 6",solid:"M6 6l12 12M6 18L18 6"}),vt.register("trash",{outline:"M3 6h18M8 6V4h8v2m-1 0v12a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10Z",solid:"M7 6h10v11a3 3 0 0 1-3 3H10a3 3 0 0 1-3-3V6Zm2-4h6v2H9z"}),vt.register("lock",{outline:"M7 10V7a5 5 0 0 1 10 0v3m-9 0h8a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Z",solid:"M12 1a6 6 0 0 1 6 6v3h1a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2h1V7a6 6 0 0 1 6-6Z"}),vt.register("alert",{outline:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",solid:"M11 7h2v6h-2zm0 8h2v2h-2z"}),vt.register("info",{outline:"M12 8h.01M11 12h2v6h-2zm9 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",solid:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1 8h2V7h-2v3Zm0 7h2v-6h-2v6Z"}),vt.register("edit",{outline:"M4 21h4l11-11a2.828 2.828 0 1 0-4-4L4 17v4Z",solid:"M3 17.25 16.06 4.19l3.75 3.75L6.75 21H3v-3.75Z"}),vt.register("search",{outline:"m21 21-4.35-4.35M10 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z",solid:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79L20 21.5 21.5 20 15.5 14z"}),vt.register("save",{outline:"M5 5h10l4 4v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5zm8 0v6H7V5",solid:"M17 3H5a2 2 0 0 0-2 2v16l4-4h10a2 2 0 0 0 2-2V7l-4-4z"}),vt.register("arrow-right",{outline:"M5 12h14M13 5l7 7-7 7",solid:"M10 5l7 7-7 7V5z"}),vt.register("arrow-left",{outline:"M19 12H5m6 7-7-7 7-7",solid:"M14 19l-7-7 7-7v14z"}),exports.ChefIcon=class extends at{constructor(){super(...arguments),this.name="info",this.styleVariant="outline",this.ariaLabel=null}updated(){this.size&&this.style.setProperty("--chefui-icon-size",this.size),this.color&&this.style.setProperty("--chefui-icon-color",this.color)}renderPath(){const t=vt.resolve(this.name);if(!t)return null;const e="solid"===this.styleVariant&&!!t.solid?t.solid:t.outline;return Z`<path d="${e}" />`}render(){const t=vt.resolve(this.name),e="solid"===this.styleVariant&&!!t?.solid;return D`
|
|
35
|
+
<svg
|
|
36
|
+
part="icon"
|
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
+
viewBox="0 0 24 24"
|
|
39
|
+
fill=${e?"var(--chefui-icon-color)":"none"}
|
|
40
|
+
stroke=${e?"none":"var(--chefui-icon-color)"}
|
|
41
|
+
stroke-width=${e?"0":"2"}
|
|
42
|
+
role="img"
|
|
43
|
+
aria-label=${this.ariaLabel||this.name}
|
|
44
|
+
>
|
|
45
|
+
${this.renderPath()}
|
|
46
|
+
</svg>
|
|
47
|
+
`}},exports.ChefIcon.styles=n`
|
|
48
|
+
:host {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
--chefui-icon-size: 1.1em;
|
|
51
|
+
--chefui-icon-color: currentColor;
|
|
52
|
+
line-height: 0;
|
|
53
|
+
}
|
|
54
|
+
svg { width: var(--chefui-icon-size); height: var(--chefui-icon-size); stroke-linecap: round; stroke-linejoin: round; }
|
|
55
|
+
`,t([ut({type:String,reflect:!0})],exports.ChefIcon.prototype,"name",void 0),t([ut({type:String,reflect:!0})],exports.ChefIcon.prototype,"styleVariant",void 0),t([ut({type:String,reflect:!0})],exports.ChefIcon.prototype,"size",void 0),t([ut({type:String,reflect:!0})],exports.ChefIcon.prototype,"color",void 0),t([ut({type:String,attribute:"aria-label"})],exports.ChefIcon.prototype,"ariaLabel",void 0),exports.ChefIcon=t([ct("chef-icon")],exports.ChefIcon),exports.ChefButton=class extends at{constructor(){super(...arguments),this.disabled=!1,this.variant="solid",this.type="button"}findAssociatedForm(){if(this.form){const t=this.ownerDocument.getElementById(this.form);if(t&&t instanceof HTMLFormElement)return t}return this.closest("form")}handleClick(t){if(this.disabled)return t.stopImmediatePropagation(),void t.preventDefault();this.dispatchEvent(new CustomEvent("chef-click",{bubbles:!0,composed:!0}));const e=this.findAssociatedForm();if(e)if("submit"===this.type){const t=document.createElement("button");t.type="submit",this.name&&(t.name=this.name),null!=this.value&&(t.value=this.value),t.hidden=!0,e.appendChild(t),t.click(),e.removeChild(t)}else"reset"===this.type&&e.reset()}render(){return D`
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
?disabled=${this.disabled}
|
|
59
|
+
aria-disabled=${this.disabled?"true":"false"}
|
|
60
|
+
aria-busy="false"
|
|
61
|
+
@click=${this.handleClick}
|
|
62
|
+
part="button"
|
|
63
|
+
>
|
|
64
|
+
<slot name="icon">
|
|
65
|
+
${this.icon?D`<chef-icon class="icon-fallback" name=${this.icon}></chef-icon>`:null}
|
|
66
|
+
</slot>
|
|
67
|
+
<slot></slot>
|
|
68
|
+
</button>
|
|
69
|
+
`}},exports.ChefButton.styles=n`
|
|
70
|
+
:host {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
--chefui-color: #1976d2;
|
|
73
|
+
--chefui-color-contrast: #ffffff;
|
|
74
|
+
--chefui-color-hover: #1565c0;
|
|
75
|
+
--chefui-color-active: #0d47a1;
|
|
76
|
+
--chefui-outline: color-mix(in srgb, var(--chefui-color) 16%, transparent);
|
|
77
|
+
--chefui-radius: 8px;
|
|
78
|
+
--chefui-padding: 10px 14px;
|
|
79
|
+
--chefui-font-weight: 600;
|
|
80
|
+
--chefui-focus-ring: 0 0 0 3px color-mix(in srgb, var(--chefui-color) 35%, transparent);
|
|
81
|
+
--chefui-transition: 140ms ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
button {
|
|
85
|
+
all: unset;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
gap: 8px;
|
|
90
|
+
padding: var(--chefui-padding);
|
|
91
|
+
border-radius: var(--chefui-radius);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
user-select: none;
|
|
94
|
+
font: inherit;
|
|
95
|
+
font-weight: var(--chefui-font-weight);
|
|
96
|
+
line-height: 1;
|
|
97
|
+
transition: background-color var(--chefui-transition), color var(--chefui-transition), box-shadow var(--chefui-transition), border-color var(--chefui-transition), transform var(--chefui-transition);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host(:not([variant])) button,
|
|
101
|
+
:host([variant="solid"]) button {
|
|
102
|
+
background: var(--chefui-color);
|
|
103
|
+
color: var(--chefui-color-contrast);
|
|
104
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.06);
|
|
105
|
+
}
|
|
106
|
+
:host(:not([variant])) button:hover,
|
|
107
|
+
:host([variant="solid"]) button:hover { background: var(--chefui-color-hover); }
|
|
108
|
+
:host(:not([variant])) button:active,
|
|
109
|
+
:host([variant="solid"]) button:active { background: var(--chefui-color-active); transform: translateY(0.5px); }
|
|
110
|
+
|
|
111
|
+
:host([variant="outline"]) button {
|
|
112
|
+
background: transparent;
|
|
113
|
+
color: var(--chefui-color);
|
|
114
|
+
border: 1.5px solid var(--chefui-outline);
|
|
115
|
+
}
|
|
116
|
+
:host([variant="outline"]) button:hover {
|
|
117
|
+
background: color-mix(in srgb, var(--chefui-color) 10%, transparent);
|
|
118
|
+
border-color: color-mix(in srgb, var(--chefui-color) 30%, transparent);
|
|
119
|
+
}
|
|
120
|
+
:host([variant="outline"]) button:active {
|
|
121
|
+
background: color-mix(in srgb, var(--chefui-color) 16%, transparent);
|
|
122
|
+
transform: translateY(0.5px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
button:focus-visible {
|
|
126
|
+
outline: none;
|
|
127
|
+
box-shadow: var(--chefui-focus-ring);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([disabled]) button,
|
|
131
|
+
button:disabled {
|
|
132
|
+
opacity: 0.55;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
box-shadow: none;
|
|
135
|
+
transform: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
::slotted([slot="icon"]) {
|
|
139
|
+
width: 1.1em;
|
|
140
|
+
height: 1.1em;
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.icon-fallback {
|
|
145
|
+
width: 1.1em;
|
|
146
|
+
height: 1.1em;
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
}
|
|
149
|
+
`,t([ut({type:Boolean,reflect:!0})],exports.ChefButton.prototype,"disabled",void 0),t([ut({type:String,reflect:!0})],exports.ChefButton.prototype,"variant",void 0),t([ut({type:String,reflect:!0})],exports.ChefButton.prototype,"type",void 0),t([ut({type:String})],exports.ChefButton.prototype,"name",void 0),t([ut({type:String})],exports.ChefButton.prototype,"value",void 0),t([ut({type:String,reflect:!0})],exports.ChefButton.prototype,"form",void 0),t([ut({type:String,reflect:!0})],exports.ChefButton.prototype,"icon",void 0),exports.ChefButton=t([ct("chef-button")],exports.ChefButton),exports.IconResolver=ft,exports.iconResolver=vt;
|
|
150
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
function t(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var h=t.length-1;h>=0;h--)(r=t[h])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),r=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new o(i,t,s)},h=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:a,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,v=f.trustedTypes,$=v?v.emptyScript:"",g=f.reactiveElementPolyfillSupport,m=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},_=(t,e)=>!a(t,e),b={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:_};
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2017 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&l(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);r?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,s)=>{if(i)t.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of s){const s=document.createElement("style"),r=e.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=i.cssText,t.appendChild(s)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=s;const o=r.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,r=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??_)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==r||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[m("elementProperties")]=new Map,A[m("finalized")]=new Map,g?.({ReactiveElement:A}),(f.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
|
18
|
+
const E=globalThis,S=E.trustedTypes,w=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,x="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+M,P=`<${C}>`,H=document,U=()=>H.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,T="[ \t\n\f\r]",z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,R=/-->/g,N=/>/g,L=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,V=/"/g,D=/^(?:script|style|textarea|title)$/i,B=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),I=B(1),Z=B(2),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),F=new WeakMap,J=H.createTreeWalker(H,129);function K(t,e){if(!k(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==w?w.createHTML(e):e}const Y=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"<svg>":3===e?"<math>":"",n=z;for(let e=0;e<i;e++){const i=t[e];let h,a,l=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===z?"!--"===a[1]?n=R:void 0!==a[1]?n=N:void 0!==a[2]?(D.test(a[2])&&(r=RegExp("</"+a[2],"g")),n=L):void 0!==a[3]&&(n=L):n===L?">"===a[0]?(n=r??z,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,h=a[1],n=void 0===a[3]?L:'"'===a[3]?V:j):n===V||n===j?n=L:n===R||n===N?n=z:(n=L,r=void 0);const d=n===L&&t[e+1].startsWith("/>")?" ":"";o+=n===z?i+P:l>=0?(s.push(h),i.slice(0,l)+x+i.slice(l)+M+d):i+M+(-2===l?e:d)}return[K(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class G{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,h=this.parts,[a,l]=Y(t,e);if(this.el=G.createElement(a,i),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=J.nextNode())&&h.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(x)){const e=l[o++],i=s.getAttribute(t).split(M),n=/([.?@])?(.*)/.exec(e);h.push({type:1,index:r,name:n[2],strings:i,ctor:"."===n[1]?it:"?"===n[1]?st:"@"===n[1]?rt:et}),s.removeAttribute(t)}else t.startsWith(M)&&(h.push({type:6,index:r}),s.removeAttribute(t));if(D.test(s.tagName)){const t=s.textContent.split(M),e=t.length-1;if(e>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],U()),J.nextNode(),h.push({type:2,index:++r});s.append(t[e],U())}}}else if(8===s.nodeType)if(s.data===C)h.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(M,t+1));)h.push({type:7,index:r}),t+=M.length-1}r++}}static createElement(t,e){const i=H.createElement("template");return i.innerHTML=t,i}}function Q(t,e,i=t,s){if(e===q)return e;let r=void 0!==s?i._$Co?.[s]:i._$Cl;const o=O(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=r:i._$Cl=r),void 0!==r&&(e=Q(t,r._$AS(t,e.values),r,s)),e}class X{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:i}=this._$AD,s=(t?.creationScope??H).importNode(e,!0);J.currentNode=s;let r=J.nextNode(),o=0,n=0,h=i[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new tt(r,r.nextSibling,this,t):1===h.type?e=new h.ctor(r,h.name,h.strings,this,t):6===h.type&&(e=new ot(r,this,t)),this._$AV.push(e),h=i[++n]}o!==h?.index&&(r=J.nextNode(),o++)}return J.currentNode=H,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),O(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof t?.[Symbol.iterator])(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!==W&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(H.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new X(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=F.get(t.strings);return void 0===e&&F.set(t.strings,e=new G(t)),e}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new tt(this.O(U()),this.O(U()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=Q(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==q,o&&(this._$AH=t);else{const s=t;let n,h;for(t=r[0],n=0;n<r.length-1;n++)h=Q(this,s[i+n],e,n),h===q&&(h=this._$AH[n]),o||=!O(h)||h!==this._$AH[n],h===W?t=W:t!==W&&(t+=(h??"")+r[n+1]),this._$AH[n]=h}o&&!s&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class st extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class rt extends et{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??W)===q)return;const i=this._$AH,s=t===W&&i!==W||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==W&&(i===W||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const nt=E.litHtmlPolyfillSupport;nt?.(G,tt),(E.litHtmlVersions??=[]).push("3.3.1");const ht=globalThis;
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/class at extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const s=i?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=i?.renderBefore??null;s._$litPart$=r=new tt(e.insertBefore(U(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}}at._$litElement$=!0,at.finalized=!0,ht.litElementHydrateSupport?.({LitElement:at});const lt=ht.litElementPolyfillSupport;lt?.({LitElement:at}),(ht.litElementVersions??=[]).push("4.2.1");
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
const ct=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:_},pt=(t=dt,e,i)=>{const{kind:s,metadata:r}=i;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,r,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const r=this[s];e.call(this,i),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+s)};
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright 2017 Google LLC
|
|
33
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
+
*/function ut(t){return(e,i)=>"object"==typeof i?pt(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}class ft{constructor(){this.registry=new Map}register(t,e){this.registry.set(t,e)}resolve(t){return this.registry.get(t)}has(t){return this.registry.has(t)}list(){return Array.from(this.registry.keys()).sort()}}const vt=new ft;vt.register("plus",{outline:"M12 4v16M4 12h16",solid:"M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z"}),vt.register("check",{outline:"m5 13 4 4L19 7",solid:"M10 15.172 5.414 10.586 4 12l6 6L20 8l-1.414-1.414z"}),vt.register("x",{outline:"M6 6l12 12M6 18L18 6",solid:"M6 6l12 12M6 18L18 6"}),vt.register("trash",{outline:"M3 6h18M8 6V4h8v2m-1 0v12a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V6h10Z",solid:"M7 6h10v11a3 3 0 0 1-3 3H10a3 3 0 0 1-3-3V6Zm2-4h6v2H9z"}),vt.register("lock",{outline:"M7 10V7a5 5 0 0 1 10 0v3m-9 0h8a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Z",solid:"M12 1a6 6 0 0 1 6 6v3h1a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2h1V7a6 6 0 0 1 6-6Z"}),vt.register("alert",{outline:"M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",solid:"M11 7h2v6h-2zm0 8h2v2h-2z"}),vt.register("info",{outline:"M12 8h.01M11 12h2v6h-2zm9 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",solid:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1 8h2V7h-2v3Zm0 7h2v-6h-2v6Z"}),vt.register("edit",{outline:"M4 21h4l11-11a2.828 2.828 0 1 0-4-4L4 17v4Z",solid:"M3 17.25 16.06 4.19l3.75 3.75L6.75 21H3v-3.75Z"}),vt.register("search",{outline:"m21 21-4.35-4.35M10 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z",solid:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79L20 21.5 21.5 20 15.5 14z"}),vt.register("save",{outline:"M5 5h10l4 4v10a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5zm8 0v6H7V5",solid:"M17 3H5a2 2 0 0 0-2 2v16l4-4h10a2 2 0 0 0 2-2V7l-4-4z"}),vt.register("arrow-right",{outline:"M5 12h14M13 5l7 7-7 7",solid:"M10 5l7 7-7 7V5z"}),vt.register("arrow-left",{outline:"M19 12H5m6 7-7-7 7-7",solid:"M14 19l-7-7 7-7v14z"});let $t=class extends at{constructor(){super(...arguments),this.name="info",this.styleVariant="outline",this.ariaLabel=null}updated(){this.size&&this.style.setProperty("--chefui-icon-size",this.size),this.color&&this.style.setProperty("--chefui-icon-color",this.color)}renderPath(){const t=vt.resolve(this.name);if(!t)return null;const e="solid"===this.styleVariant&&!!t.solid?t.solid:t.outline;return Z`<path d="${e}" />`}render(){const t=vt.resolve(this.name),e="solid"===this.styleVariant&&!!t?.solid;return I`
|
|
35
|
+
<svg
|
|
36
|
+
part="icon"
|
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
+
viewBox="0 0 24 24"
|
|
39
|
+
fill=${e?"var(--chefui-icon-color)":"none"}
|
|
40
|
+
stroke=${e?"none":"var(--chefui-icon-color)"}
|
|
41
|
+
stroke-width=${e?"0":"2"}
|
|
42
|
+
role="img"
|
|
43
|
+
aria-label=${this.ariaLabel||this.name}
|
|
44
|
+
>
|
|
45
|
+
${this.renderPath()}
|
|
46
|
+
</svg>
|
|
47
|
+
`}};$t.styles=n`
|
|
48
|
+
:host {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
--chefui-icon-size: 1.1em;
|
|
51
|
+
--chefui-icon-color: currentColor;
|
|
52
|
+
line-height: 0;
|
|
53
|
+
}
|
|
54
|
+
svg { width: var(--chefui-icon-size); height: var(--chefui-icon-size); stroke-linecap: round; stroke-linejoin: round; }
|
|
55
|
+
`,t([ut({type:String,reflect:!0})],$t.prototype,"name",void 0),t([ut({type:String,reflect:!0})],$t.prototype,"styleVariant",void 0),t([ut({type:String,reflect:!0})],$t.prototype,"size",void 0),t([ut({type:String,reflect:!0})],$t.prototype,"color",void 0),t([ut({type:String,attribute:"aria-label"})],$t.prototype,"ariaLabel",void 0),$t=t([ct("chef-icon")],$t);let gt=class extends at{constructor(){super(...arguments),this.disabled=!1,this.variant="solid",this.type="button"}findAssociatedForm(){if(this.form){const t=this.ownerDocument.getElementById(this.form);if(t&&t instanceof HTMLFormElement)return t}return this.closest("form")}handleClick(t){if(this.disabled)return t.stopImmediatePropagation(),void t.preventDefault();this.dispatchEvent(new CustomEvent("chef-click",{bubbles:!0,composed:!0}));const e=this.findAssociatedForm();if(e)if("submit"===this.type){const t=document.createElement("button");t.type="submit",this.name&&(t.name=this.name),null!=this.value&&(t.value=this.value),t.hidden=!0,e.appendChild(t),t.click(),e.removeChild(t)}else"reset"===this.type&&e.reset()}render(){return I`
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
?disabled=${this.disabled}
|
|
59
|
+
aria-disabled=${this.disabled?"true":"false"}
|
|
60
|
+
aria-busy="false"
|
|
61
|
+
@click=${this.handleClick}
|
|
62
|
+
part="button"
|
|
63
|
+
>
|
|
64
|
+
<slot name="icon">
|
|
65
|
+
${this.icon?I`<chef-icon class="icon-fallback" name=${this.icon}></chef-icon>`:null}
|
|
66
|
+
</slot>
|
|
67
|
+
<slot></slot>
|
|
68
|
+
</button>
|
|
69
|
+
`}};gt.styles=n`
|
|
70
|
+
:host {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
--chefui-color: #1976d2;
|
|
73
|
+
--chefui-color-contrast: #ffffff;
|
|
74
|
+
--chefui-color-hover: #1565c0;
|
|
75
|
+
--chefui-color-active: #0d47a1;
|
|
76
|
+
--chefui-outline: color-mix(in srgb, var(--chefui-color) 16%, transparent);
|
|
77
|
+
--chefui-radius: 8px;
|
|
78
|
+
--chefui-padding: 10px 14px;
|
|
79
|
+
--chefui-font-weight: 600;
|
|
80
|
+
--chefui-focus-ring: 0 0 0 3px color-mix(in srgb, var(--chefui-color) 35%, transparent);
|
|
81
|
+
--chefui-transition: 140ms ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
button {
|
|
85
|
+
all: unset;
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
gap: 8px;
|
|
90
|
+
padding: var(--chefui-padding);
|
|
91
|
+
border-radius: var(--chefui-radius);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
user-select: none;
|
|
94
|
+
font: inherit;
|
|
95
|
+
font-weight: var(--chefui-font-weight);
|
|
96
|
+
line-height: 1;
|
|
97
|
+
transition: background-color var(--chefui-transition), color var(--chefui-transition), box-shadow var(--chefui-transition), border-color var(--chefui-transition), transform var(--chefui-transition);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host(:not([variant])) button,
|
|
101
|
+
:host([variant="solid"]) button {
|
|
102
|
+
background: var(--chefui-color);
|
|
103
|
+
color: var(--chefui-color-contrast);
|
|
104
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.06);
|
|
105
|
+
}
|
|
106
|
+
:host(:not([variant])) button:hover,
|
|
107
|
+
:host([variant="solid"]) button:hover { background: var(--chefui-color-hover); }
|
|
108
|
+
:host(:not([variant])) button:active,
|
|
109
|
+
:host([variant="solid"]) button:active { background: var(--chefui-color-active); transform: translateY(0.5px); }
|
|
110
|
+
|
|
111
|
+
:host([variant="outline"]) button {
|
|
112
|
+
background: transparent;
|
|
113
|
+
color: var(--chefui-color);
|
|
114
|
+
border: 1.5px solid var(--chefui-outline);
|
|
115
|
+
}
|
|
116
|
+
:host([variant="outline"]) button:hover {
|
|
117
|
+
background: color-mix(in srgb, var(--chefui-color) 10%, transparent);
|
|
118
|
+
border-color: color-mix(in srgb, var(--chefui-color) 30%, transparent);
|
|
119
|
+
}
|
|
120
|
+
:host([variant="outline"]) button:active {
|
|
121
|
+
background: color-mix(in srgb, var(--chefui-color) 16%, transparent);
|
|
122
|
+
transform: translateY(0.5px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
button:focus-visible {
|
|
126
|
+
outline: none;
|
|
127
|
+
box-shadow: var(--chefui-focus-ring);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([disabled]) button,
|
|
131
|
+
button:disabled {
|
|
132
|
+
opacity: 0.55;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
box-shadow: none;
|
|
135
|
+
transform: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
::slotted([slot="icon"]) {
|
|
139
|
+
width: 1.1em;
|
|
140
|
+
height: 1.1em;
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.icon-fallback {
|
|
145
|
+
width: 1.1em;
|
|
146
|
+
height: 1.1em;
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
}
|
|
149
|
+
`,t([ut({type:Boolean,reflect:!0})],gt.prototype,"disabled",void 0),t([ut({type:String,reflect:!0})],gt.prototype,"variant",void 0),t([ut({type:String,reflect:!0})],gt.prototype,"type",void 0),t([ut({type:String})],gt.prototype,"name",void 0),t([ut({type:String})],gt.prototype,"value",void 0),t([ut({type:String,reflect:!0})],gt.prototype,"form",void 0),t([ut({type:String,reflect:!0})],gt.prototype,"icon",void 0),gt=t([ct("chef-button")],gt);export{gt as ChefButton,$t as ChefIcon,ft as IconResolver,vt as iconResolver};
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type IconDef = {
|
|
2
|
+
outline: string;
|
|
3
|
+
solid?: string;
|
|
4
|
+
};
|
|
5
|
+
export type IconStyle = 'outline' | 'solid';
|
|
6
|
+
export type IconName = 'plus' | 'check' | 'x' | 'trash' | 'lock' | 'alert' | 'info' | 'edit' | 'search' | 'save' | 'arrow-right' | 'arrow-left';
|
|
7
|
+
export declare class IconResolver {
|
|
8
|
+
private registry;
|
|
9
|
+
register(name: string, def: IconDef): void;
|
|
10
|
+
resolve(name: string): IconDef | undefined;
|
|
11
|
+
has(name: string): boolean;
|
|
12
|
+
list(): string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const iconResolver: IconResolver;
|
|
15
|
+
//# sourceMappingURL=icon-resolver.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chefuicore/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Cross-framework UI components built with Lit - works with React, Vue, Angular, and vanilla JS",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rollup -c",
|
|
19
|
+
"clean": "rimraf dist",
|
|
20
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/yourusername/chefui.git",
|
|
25
|
+
"directory": "packages/core"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"web-components",
|
|
29
|
+
"lit",
|
|
30
|
+
"ui-components",
|
|
31
|
+
"cross-framework",
|
|
32
|
+
"react",
|
|
33
|
+
"vue",
|
|
34
|
+
"angular",
|
|
35
|
+
"components"
|
|
36
|
+
],
|
|
37
|
+
"author": "Your Name",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"lit": "3.3.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
44
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
45
|
+
"rollup": "^4.24.0",
|
|
46
|
+
"rollup-plugin-terser": "^7.0.2"
|
|
47
|
+
}
|
|
48
|
+
}
|