@kodaris/krubble-components 1.0.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/custom-elements.json +2156 -0
- package/dist/accordion/accordion.d.ts +35 -0
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +120 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/alert.d.ts +35 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +204 -0
- package/dist/alert.js.map +1 -0
- package/dist/button/button.d.ts +30 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +133 -0
- package/dist/button/button.js.map +1 -0
- package/dist/code-demo/code-demo.d.ts +44 -0
- package/dist/code-demo/code-demo.d.ts.map +1 -0
- package/dist/code-demo/code-demo.js +277 -0
- package/dist/code-demo/code-demo.js.map +1 -0
- package/dist/context-menu/context-menu.d.ts +54 -0
- package/dist/context-menu/context-menu.d.ts.map +1 -0
- package/dist/context-menu/context-menu.js +179 -0
- package/dist/context-menu/context-menu.js.map +1 -0
- package/dist/dialog/dialog.d.ts +58 -0
- package/dist/dialog/dialog.d.ts.map +1 -0
- package/dist/dialog/dialog.js +142 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +3 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/text-field/text-field.d.ts +91 -0
- package/dist/form/text-field/text-field.d.ts.map +1 -0
- package/dist/form/text-field/text-field.js +281 -0
- package/dist/form/text-field/text-field.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/krubble.bundled.js +1402 -0
- package/dist/krubble.bundled.js.map +1 -0
- package/dist/krubble.bundled.min.js +739 -0
- package/dist/krubble.bundled.min.js.map +1 -0
- package/dist/krubble.umd.js +1411 -0
- package/dist/krubble.umd.js.map +1 -0
- package/dist/krubble.umd.min.js +739 -0
- package/dist/krubble.umd.min.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let s=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==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 i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=o.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(i,t))}return t}toString(){return this.cssText}};const r=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,i,o)=>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[o+1]),t[0]);return new s(o,t,i)},n=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,i))(e)})(t):t
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/,{is:a,defineProperty:l,getOwnPropertyDescriptor:d,getOwnPropertyNames:c,getOwnPropertySymbols:h,getPrototypeOf:p}=Object,u=globalThis,f=u.trustedTypes,g=f?f.emptyScript:"",b=u.reactiveElementPolyfillSupport,v=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?g: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}},m=(t,e)=>!a(t,e),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:m};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let $=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=_){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(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&l(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:s}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const r=o?.call(this);s?.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...c(t),...h(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(n(t))}else void 0!==t&&e.push(n(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 i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((i,o)=>{if(e)i.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=e.cssText,i.appendChild(o)}})(i,this.constructor.elementStyles),i}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),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:y).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:y;this._$Em=o;const r=s.fromAttribute(e,t.type);this[o]=r??this._$Ej?.get(o)??r,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,s=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??m)(s,e)||i.useDefault&&i.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==s||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&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,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}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){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[v("elementProperties")]=new Map,$[v("finalized")]=new Map,b?.({ReactiveElement:$}),(u.reactiveElementVersions??=[]).push("2.1.1");
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*/
|
|
17
|
+
const x=globalThis,w=x.trustedTypes,k=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,A="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+E,C=`<${S}>`,P=document,O=()=>P.createComment(""),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,H="[ \t\n\f\r]",T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,U=/>/g,z=RegExp(`>|${H}(?:([^\\s"'>=/]+)(${H}*=${H}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,N=/"/g,L=/^(?:script|style|textarea|title)$/i,B=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),V=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),I=new WeakMap,K=P.createTreeWalker(P,129);function F(t,e){if(!M(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==k?k.createHTML(e):e}const W=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"<svg>":3===e?"<math>":"",n=T;for(let e=0;e<i;e++){const i=t[e];let a,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===T?"!--"===l[1]?n=j:void 0!==l[1]?n=U:void 0!==l[2]?(L.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=z):void 0!==l[3]&&(n=z):n===z?">"===l[0]?(n=s??T,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?z:'"'===l[3]?N:D):n===N||n===D?n=z:n===j||n===U?n=T:(n=z,s=void 0);const h=n===z&&t[e+1].startsWith("/>")?" ":"";r+=n===T?i+C:d>=0?(o.push(a),i.slice(0,d)+A+i.slice(d)+E+h):i+E+(-2===d?e:h)}return[F(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,a=this.parts,[l,d]=W(t,e);if(this.el=J.createElement(l,i),K.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=K.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(A)){const e=d[r++],i=o.getAttribute(t).split(E),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?Y:"?"===n[1]?tt:"@"===n[1]?et:X}),o.removeAttribute(t)}else t.startsWith(E)&&(a.push({type:6,index:s}),o.removeAttribute(t));if(L.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=w?w.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],O()),K.nextNode(),a.push({type:2,index:++s});o.append(t[e],O())}}}else if(8===o.nodeType)if(o.data===S)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)a.push({type:7,index:s}),t+=E.length-1}s++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,o){if(e===V)return e;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=R(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(t),s._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(e=Z(t,s._$AS(t,e.values),s,o)),e}class G{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,o=(t?.creationScope??P).importNode(e,!0);K.currentNode=o;let s=K.nextNode(),r=0,n=0,a=i[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new Q(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new it(s,this,t)),this._$AV.push(e),a=i[++n]}r!==a?.index&&(s=K.nextNode(),r++)}return K.currentNode=P,o}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 Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.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=Z(this,t,e),R(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>M(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!==q&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=J.createElement(F(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new G(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=I.get(t.strings);return void 0===e&&I.set(t.strings,e=new J(t)),e}k(t){M(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new Q(this.O(O()),this.O(O()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$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 X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,s){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=Z(this,t,e,0),r=!R(t)||t!==this._$AH&&t!==V,r&&(this._$AH=t);else{const o=t;let n,a;for(t=s[0],n=0;n<s.length-1;n++)a=Z(this,o[i+n],e,n),a===V&&(a=this._$AH[n]),r||=!R(a)||a!==this._$AH[n],a===q?t=q:t!==q&&(t+=(a??"")+s[n+1]),this._$AH[n]=a}r&&!o&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Y extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class tt extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class et extends X{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??q)===V)return;const i=this._$AH,o=t===q&&i!==q||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==q&&(i===q||o);o&&this.element.removeEventListener(this.name,this,i),s&&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 it{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){Z(this,t)}}const ot=x.litHtmlPolyfillSupport;ot?.(J,Q),(x.litHtmlVersions??=[]).push("3.3.1");const st=globalThis;
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/let rt=class extends ${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 o=i?.renderBefore??e;let s=o._$litPart$;if(void 0===s){const t=i?.renderBefore??null;o._$litPart$=s=new Q(e.insertBefore(O(),t),t,void 0,i??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};rt._$litElement$=!0,rt.finalized=!0,st.litElementHydrateSupport?.({LitElement:rt});const nt=st.litElementPolyfillSupport;nt?.({LitElement:rt}),(st.litElementVersions??=[]).push("4.2.1");
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/
|
|
28
|
+
const at=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
|
|
29
|
+
/**
|
|
30
|
+
* @license
|
|
31
|
+
* Copyright 2017 Google LLC
|
|
32
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
+
*/,lt={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:m},dt=(t=lt,e,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,s,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];e.call(this,i),this.requestUpdate(o,s,t)}}throw Error("Unsupported decorator location: "+o)};function ct(t){return(e,i)=>"object"==typeof i?dt(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright 2017 Google LLC
|
|
37
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
+
*/}function ht(t){return ct({...t,state:!0,attribute:!1})}
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/var pt=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let ut=class extends rt{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return B`
|
|
44
|
+
<div class="header" @click=${this.toggle}>
|
|
45
|
+
<span class="header__title">${this.header}</span>
|
|
46
|
+
<svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
47
|
+
<path d="M6 9l6 6 6-6"/>
|
|
48
|
+
</svg>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="content">
|
|
51
|
+
<div class="content__inner">
|
|
52
|
+
<div class="content__body">
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
`}};ut.styles=r`
|
|
58
|
+
:host {
|
|
59
|
+
display: block;
|
|
60
|
+
margin-bottom: 16px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.header {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
padding: 12px 16px;
|
|
68
|
+
background: #f7f8f9;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.header__title {
|
|
75
|
+
font-size: 15px;
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
color: #111827;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.header__icon {
|
|
81
|
+
width: 20px;
|
|
82
|
+
height: 20px;
|
|
83
|
+
color: #9ca3af;
|
|
84
|
+
transition: transform 0.2s ease;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([expanded]) .header__icon {
|
|
89
|
+
transform: rotate(180deg);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.content {
|
|
93
|
+
display: grid;
|
|
94
|
+
grid-template-rows: 0fr;
|
|
95
|
+
transition: grid-template-rows 0.2s ease;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host([expanded]) .content {
|
|
99
|
+
grid-template-rows: 1fr;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.content__inner {
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.content__body {
|
|
107
|
+
padding: 16px 16px 8px 16px;
|
|
108
|
+
}
|
|
109
|
+
`,pt([ct({type:String})],ut.prototype,"header",void 0),pt([ct({type:Boolean,reflect:!0})],ut.prototype,"expanded",void 0),ut=pt([at("kr-accordion")],ut);
|
|
110
|
+
/**
|
|
111
|
+
* @license
|
|
112
|
+
* Copyright 2017 Google LLC
|
|
113
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
+
*/
|
|
115
|
+
const ft=1,gt=2,bt=3,vt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class mt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
116
|
+
/**
|
|
117
|
+
* @license
|
|
118
|
+
* Copyright 2018 Google LLC
|
|
119
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
+
*/const _t=yt(class extends mt{constructor(t){if(super(t),t.type!==ft||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const o=!!e[t];o===this.st.has(t)||this.nt?.has(t)||(o?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return V}});var $t=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let xt=class extends rt{constructor(){super(...arguments),this.type="info",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}render(){const t={info:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>`,success:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>`,warning:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>`,error:B`<svg class="icon" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>`};return B`
|
|
121
|
+
<div
|
|
122
|
+
class=${_t({alert:!0,["alert--"+this.type]:!0,"alert--hidden":!this.visible})}
|
|
123
|
+
role="alert"
|
|
124
|
+
>
|
|
125
|
+
${t[this.type]}
|
|
126
|
+
<div class="content">
|
|
127
|
+
${this.header?B`<h4 class="header">${this.header}</h4>`:q}
|
|
128
|
+
<div class="message">
|
|
129
|
+
<slot></slot>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
${this.dismissible?B`
|
|
133
|
+
<button
|
|
134
|
+
class="dismiss"
|
|
135
|
+
type="button"
|
|
136
|
+
aria-label="Dismiss alert"
|
|
137
|
+
@click=${this._handleDismiss}
|
|
138
|
+
>
|
|
139
|
+
<svg viewBox="0 0 20 20" fill="currentColor" width="16" height="16">
|
|
140
|
+
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
141
|
+
</svg>
|
|
142
|
+
</button>
|
|
143
|
+
`:q}
|
|
144
|
+
</div>
|
|
145
|
+
`}};xt.styles=r`
|
|
146
|
+
:host {
|
|
147
|
+
display: block;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.alert {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 12px;
|
|
154
|
+
padding: 12px 16px;
|
|
155
|
+
border-radius: 8px;
|
|
156
|
+
border-left: 4px solid;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.alert--hidden {
|
|
160
|
+
display: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Variants */
|
|
164
|
+
.alert--info {
|
|
165
|
+
background-color: #eff6ff;
|
|
166
|
+
border-left-color: #3b82f6;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.alert--info .icon {
|
|
170
|
+
color: #2563eb;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.alert--success {
|
|
174
|
+
background-color: #f0fdf4;
|
|
175
|
+
border-left-color: #22c55e;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.alert--success .icon {
|
|
179
|
+
color: #16a34a;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.alert--warning {
|
|
183
|
+
background-color: #fffbeb;
|
|
184
|
+
border-left-color: #f59e0b;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.alert--warning .icon {
|
|
188
|
+
color: #d97706;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.alert--error {
|
|
192
|
+
background-color: #fef2f2;
|
|
193
|
+
border-left-color: #ef4444;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.alert--error .icon {
|
|
197
|
+
color: #dc2626;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.icon {
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
width: 20px;
|
|
203
|
+
height: 20px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.content {
|
|
207
|
+
flex: 1;
|
|
208
|
+
min-width: 0;
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
gap: 6px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.header {
|
|
215
|
+
font-size: 14px;
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
color: #111827;
|
|
218
|
+
margin: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.message {
|
|
222
|
+
font-size: 14px;
|
|
223
|
+
color: #374151;
|
|
224
|
+
margin: 0;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.dismiss {
|
|
228
|
+
flex-shrink: 0;
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
width: 24px;
|
|
233
|
+
height: 24px;
|
|
234
|
+
padding: 0;
|
|
235
|
+
background: none;
|
|
236
|
+
border: none;
|
|
237
|
+
border-radius: 4px;
|
|
238
|
+
color: #6b7280;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.dismiss:hover {
|
|
244
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
245
|
+
color: #374151;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.dismiss:focus-visible {
|
|
249
|
+
outline: 2px solid #3b82f6;
|
|
250
|
+
outline-offset: 2px;
|
|
251
|
+
}
|
|
252
|
+
`,$t([ct({type:String})],xt.prototype,"type",void 0),$t([ct({type:String})],xt.prototype,"header",void 0),$t([ct({type:Boolean})],xt.prototype,"dismissible",void 0),$t([ct({type:Boolean})],xt.prototype,"visible",void 0),xt=$t([at("kr-alert")],xt);var wt=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let kt=class extends rt{constructor(){super(...arguments),this.variant="primary",this.size="medium",this.disabled=!1}render(){const t="medium"!==this.size?this.size:"";return B`
|
|
253
|
+
<button
|
|
254
|
+
part="button"
|
|
255
|
+
class="${this.variant} ${t}"
|
|
256
|
+
?disabled=${this.disabled}
|
|
257
|
+
>
|
|
258
|
+
<slot></slot>
|
|
259
|
+
</button>
|
|
260
|
+
`}};kt.styles=r`
|
|
261
|
+
:host {
|
|
262
|
+
display: inline-block;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
button {
|
|
266
|
+
font-family: inherit;
|
|
267
|
+
font-size: 14px;
|
|
268
|
+
font-weight: 400;
|
|
269
|
+
letter-spacing: 0.01em;
|
|
270
|
+
padding: 0 22px;
|
|
271
|
+
height: 36px;
|
|
272
|
+
line-height: 36px;
|
|
273
|
+
border: none;
|
|
274
|
+
border-radius: 20px;
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
transition: background 0.15s ease;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
button:active:not(:disabled) {
|
|
280
|
+
transform: scale(0.98);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
button:disabled {
|
|
284
|
+
opacity: 0.5;
|
|
285
|
+
cursor: not-allowed;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* Variants */
|
|
289
|
+
button.primary {
|
|
290
|
+
background: #163052;
|
|
291
|
+
color: white;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
button.primary:hover:not(:disabled) {
|
|
295
|
+
background: #0e1f35;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
button.secondary {
|
|
299
|
+
background: #f3f4f6;
|
|
300
|
+
color: #374151;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
button.secondary:hover:not(:disabled) {
|
|
304
|
+
background: #e5e7eb;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
button.outline {
|
|
308
|
+
background: transparent;
|
|
309
|
+
border: 1px solid #d1d5db;
|
|
310
|
+
color: #374151;
|
|
311
|
+
box-shadow: none;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
button.outline:hover:not(:disabled) {
|
|
315
|
+
background: #f9fafb;
|
|
316
|
+
border-color: #9ca3af;
|
|
317
|
+
box-shadow: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Sizes */
|
|
321
|
+
button.small {
|
|
322
|
+
font-size: 0.75rem;
|
|
323
|
+
height: 28px;
|
|
324
|
+
line-height: 28px;
|
|
325
|
+
padding: 0 10px;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
button.large {
|
|
329
|
+
font-size: 1rem;
|
|
330
|
+
height: 44px;
|
|
331
|
+
line-height: 44px;
|
|
332
|
+
padding: 0 24px;
|
|
333
|
+
}
|
|
334
|
+
`,wt([ct({type:String})],kt.prototype,"variant",void 0),wt([ct({type:String})],kt.prototype,"size",void 0),wt([ct({type:Boolean})],kt.prototype,"disabled",void 0),kt=wt([at("kr-button")],kt);
|
|
335
|
+
/**
|
|
336
|
+
* @license
|
|
337
|
+
* Copyright 2017 Google LLC
|
|
338
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
339
|
+
*/
|
|
340
|
+
class At extends mt{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===q||null==t)return this._t=void 0,this.it=t;if(t===V)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}At.directiveName="unsafeHTML",At.resultType=1;const Et=yt(At);var St=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ct=class extends rt{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1}setTab(t){this.activeTab=t}getHighlightedCode(){return this.code?window.Prism&&window.Prism.languages[this.language]?window.Prism.highlight(this.code,window.Prism.languages[this.language],this.language):this.escapeHtml(this.code):""}escapeHtml(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}async copyCode(){if(this.code)try{await navigator.clipboard.writeText(this.code),this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}catch(t){console.error("Failed to copy code:",t)}}render(){return B`
|
|
341
|
+
<div class="tabs">
|
|
342
|
+
<button
|
|
343
|
+
class=${_t({tab:!0,"tab--active":"preview"===this.activeTab})}
|
|
344
|
+
@click=${()=>this.setTab("preview")}
|
|
345
|
+
>
|
|
346
|
+
Preview
|
|
347
|
+
</button>
|
|
348
|
+
<button
|
|
349
|
+
class=${_t({tab:!0,"tab--active":"code"===this.activeTab})}
|
|
350
|
+
@click=${()=>this.setTab("code")}
|
|
351
|
+
>
|
|
352
|
+
Code
|
|
353
|
+
</button>
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
<div class=${_t({panel:!0,"panel--active":"preview"===this.activeTab,preview:!0})}>
|
|
357
|
+
<slot name="preview"></slot>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class=${_t({panel:!0,"panel--active":"code"===this.activeTab,"code-container":!0})}>
|
|
361
|
+
<button
|
|
362
|
+
class=${_t({"copy-btn":!0,"copy-btn--copied":this.copied})}
|
|
363
|
+
@click=${this.copyCode}
|
|
364
|
+
>
|
|
365
|
+
${this.copied?"Copied!":"Copy"}
|
|
366
|
+
</button>
|
|
367
|
+
<pre class="code"><code>${Et(this.getHighlightedCode())}</code></pre>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
`}};Ct.styles=r`
|
|
371
|
+
:host {
|
|
372
|
+
display: block;
|
|
373
|
+
border: 1px solid #e9ecef;
|
|
374
|
+
border-radius: 8px;
|
|
375
|
+
overflow: hidden;
|
|
376
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.tabs {
|
|
380
|
+
display: flex;
|
|
381
|
+
background: #f8f9fa;
|
|
382
|
+
border-bottom: 1px solid #e9ecef;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.tab {
|
|
386
|
+
padding: 10px 20px;
|
|
387
|
+
background: none;
|
|
388
|
+
border: none;
|
|
389
|
+
color: #6c757d;
|
|
390
|
+
font-size: 14px;
|
|
391
|
+
font-weight: 500;
|
|
392
|
+
font-family: inherit;
|
|
393
|
+
cursor: pointer;
|
|
394
|
+
position: relative;
|
|
395
|
+
transition: color 0.15s;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.tab:hover {
|
|
399
|
+
color: #495057;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.tab--active {
|
|
403
|
+
color: #1a1a2e;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.tab--active::after {
|
|
407
|
+
content: '';
|
|
408
|
+
position: absolute;
|
|
409
|
+
bottom: -1px;
|
|
410
|
+
left: 0;
|
|
411
|
+
right: 0;
|
|
412
|
+
height: 2px;
|
|
413
|
+
background: #4f46e5;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.panel {
|
|
417
|
+
display: none;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.panel--active {
|
|
421
|
+
display: block;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.preview {
|
|
425
|
+
padding: 24px;
|
|
426
|
+
background: #ffffff;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.code-container {
|
|
430
|
+
position: relative;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.code {
|
|
434
|
+
margin: 0;
|
|
435
|
+
padding: 20px;
|
|
436
|
+
background: #1e1e2e;
|
|
437
|
+
overflow-x: auto;
|
|
438
|
+
font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
|
|
439
|
+
font-size: 13px;
|
|
440
|
+
line-height: 1.6;
|
|
441
|
+
color: #cdd6f4;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.code code {
|
|
445
|
+
font-family: inherit;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.copy-btn {
|
|
449
|
+
position: absolute;
|
|
450
|
+
top: 12px;
|
|
451
|
+
right: 12px;
|
|
452
|
+
padding: 6px 12px;
|
|
453
|
+
background: rgba(255, 255, 255, 0.1);
|
|
454
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
455
|
+
border-radius: 6px;
|
|
456
|
+
color: rgba(255, 255, 255, 0.7);
|
|
457
|
+
font-size: 12px;
|
|
458
|
+
font-family: inherit;
|
|
459
|
+
cursor: pointer;
|
|
460
|
+
transition: background 0.15s, color 0.15s;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.copy-btn:hover {
|
|
464
|
+
background: rgba(255, 255, 255, 0.15);
|
|
465
|
+
color: white;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.copy-btn--copied {
|
|
469
|
+
background: rgba(34, 197, 94, 0.2);
|
|
470
|
+
border-color: rgba(34, 197, 94, 0.3);
|
|
471
|
+
color: #4ade80;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/* Prism.js theme overrides for dark mode */
|
|
475
|
+
.code .token.comment,
|
|
476
|
+
.code .token.prolog,
|
|
477
|
+
.code .token.doctype,
|
|
478
|
+
.code .token.cdata {
|
|
479
|
+
color: #6c7086;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.code .token.punctuation {
|
|
483
|
+
color: #9399b2;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.code .token.property,
|
|
487
|
+
.code .token.tag,
|
|
488
|
+
.code .token.boolean,
|
|
489
|
+
.code .token.number,
|
|
490
|
+
.code .token.constant,
|
|
491
|
+
.code .token.symbol,
|
|
492
|
+
.code .token.deleted {
|
|
493
|
+
color: #f38ba8;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.code .token.selector,
|
|
497
|
+
.code .token.attr-name,
|
|
498
|
+
.code .token.string,
|
|
499
|
+
.code .token.char,
|
|
500
|
+
.code .token.builtin,
|
|
501
|
+
.code .token.inserted {
|
|
502
|
+
color: #a6e3a1;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.code .token.operator,
|
|
506
|
+
.code .token.entity,
|
|
507
|
+
.code .token.url,
|
|
508
|
+
.code .language-css .token.string,
|
|
509
|
+
.code .style .token.string {
|
|
510
|
+
color: #94e2d5;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.code .token.atrule,
|
|
514
|
+
.code .token.attr-value,
|
|
515
|
+
.code .token.keyword {
|
|
516
|
+
color: #cba6f7;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.code .token.function,
|
|
520
|
+
.code .token.class-name {
|
|
521
|
+
color: #89b4fa;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.code .token.regex,
|
|
525
|
+
.code .token.important,
|
|
526
|
+
.code .token.variable {
|
|
527
|
+
color: #fab387;
|
|
528
|
+
}
|
|
529
|
+
`,St([ct({type:String})],Ct.prototype,"language",void 0),St([ct({type:String})],Ct.prototype,"code",void 0),St([ht()],Ct.prototype,"activeTab",void 0),St([ht()],Ct.prototype,"copied",void 0),Ct=St([at("kr-code-demo")],Ct);var Pt=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Ot=class extends rt{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(t){const e=document.querySelector("kr-context-menu");e&&e.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(t)}async show(t){this.items=t.items,this.style.left=`${t.x}px`,this.style.top=`${t.y}px`,await this.updateComplete;const e=this.getBoundingClientRect();return e.right>window.innerWidth&&(this.style.left=t.x-e.width+"px"),e.bottom>window.innerHeight&&(this.style.top=t.y-e.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((t=>{this.resolvePromise=t}))}handleOutsideClick(t){this.contains(t.target)||this.close(null)}handleKeyDown(t){"Escape"===t.key&&this.close(null)}handleItemClick(t){t.disabled||t.divider||this.close(t)}close(t){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(t),this.resolvePromise=null),this.remove()}render(){return B`
|
|
530
|
+
<div class="menu">
|
|
531
|
+
${this.items.map((t=>t.divider?B`<div class="menu__divider"></div>`:B`
|
|
532
|
+
<button
|
|
533
|
+
class="menu__item"
|
|
534
|
+
?disabled=${t.disabled}
|
|
535
|
+
@click=${()=>this.handleItemClick(t)}
|
|
536
|
+
>
|
|
537
|
+
${t.icon?B`<span class="menu__item-icon">${t.icon}</span>`:null}
|
|
538
|
+
${t.label}
|
|
539
|
+
</button>
|
|
540
|
+
`))}
|
|
541
|
+
</div>
|
|
542
|
+
`}};Ot.styles=r`
|
|
543
|
+
:host {
|
|
544
|
+
position: fixed;
|
|
545
|
+
z-index: 10000;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.menu {
|
|
549
|
+
background: #1a1a2e;
|
|
550
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
551
|
+
border-radius: 8px;
|
|
552
|
+
padding: 4px;
|
|
553
|
+
min-width: 180px;
|
|
554
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.menu__item {
|
|
558
|
+
display: flex;
|
|
559
|
+
align-items: center;
|
|
560
|
+
gap: 12px;
|
|
561
|
+
width: 100%;
|
|
562
|
+
padding: 10px 12px;
|
|
563
|
+
background: none;
|
|
564
|
+
border: none;
|
|
565
|
+
color: rgba(255, 255, 255, 0.8);
|
|
566
|
+
font-size: 13px;
|
|
567
|
+
font-family: inherit;
|
|
568
|
+
text-align: left;
|
|
569
|
+
cursor: pointer;
|
|
570
|
+
border-radius: 6px;
|
|
571
|
+
transition: background 0.15s ease;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.menu__item:hover:not(:disabled) {
|
|
575
|
+
background: rgba(255, 255, 255, 0.05);
|
|
576
|
+
color: #ffffff;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.menu__item:disabled {
|
|
580
|
+
opacity: 0.5;
|
|
581
|
+
cursor: not-allowed;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.menu__item-icon {
|
|
585
|
+
width: 16px;
|
|
586
|
+
height: 16px;
|
|
587
|
+
display: flex;
|
|
588
|
+
align-items: center;
|
|
589
|
+
justify-content: center;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.menu__divider {
|
|
593
|
+
height: 1px;
|
|
594
|
+
background: rgba(255, 255, 255, 0.1);
|
|
595
|
+
margin: 4px 0;
|
|
596
|
+
}
|
|
597
|
+
`,Pt([ht()],Ot.prototype,"items",void 0),Ot=Pt([at("kr-context-menu")],Ot);var Rt=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Mt{constructor(){this.resolvePromise=null,this.dialogElement=null,this.promise=new Promise((t=>{this.resolvePromise=t}))}setDialogElement(t){this.dialogElement=t}close(t){this.resolvePromise&&(this.resolvePromise(t),this.resolvePromise=null),this.dialogElement?.remove()}afterClosed(){return this.promise}}let Ht=class extends rt{constructor(){super(...arguments),this.contentElement=null,this.dialogRef=null,this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static open(t,e){const i=document.querySelector("kr-dialog");i&&i.remove();const o=new Mt,s=document.createElement("kr-dialog");o.setDialogElement(s),s.dialogRef=o;const r=new t;return r.dialogRef=o,e?.data&&(r.data=e.data),s.contentElement=r,document.body.appendChild(s),document.addEventListener("keydown",s.boundHandleKeyDown),o}handleKeyDown(t){"Escape"===t.key&&this.dialogRef?.close(void 0)}handleBackdropClick(t){t.target.classList.contains("backdrop")&&this.dialogRef?.close(void 0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.boundHandleKeyDown)}render(){return B`
|
|
598
|
+
<div class="backdrop" @click=${this.handleBackdropClick}></div>
|
|
599
|
+
<div class="dialog">
|
|
600
|
+
${this.contentElement}
|
|
601
|
+
</div>
|
|
602
|
+
`}};Ht.styles=r`
|
|
603
|
+
:host {
|
|
604
|
+
position: fixed;
|
|
605
|
+
inset: 0;
|
|
606
|
+
z-index: 10000;
|
|
607
|
+
display: flex;
|
|
608
|
+
align-items: center;
|
|
609
|
+
justify-content: center;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.backdrop {
|
|
613
|
+
position: absolute;
|
|
614
|
+
inset: 0;
|
|
615
|
+
background: rgba(0, 0, 0, 0.5);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.dialog {
|
|
619
|
+
position: relative;
|
|
620
|
+
background: #1a1a2e;
|
|
621
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
622
|
+
border-radius: 12px;
|
|
623
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
|
|
624
|
+
max-height: 90vh;
|
|
625
|
+
overflow: auto;
|
|
626
|
+
}
|
|
627
|
+
`,Rt([ht()],Ht.prototype,"contentElement",void 0),Ht=Rt([at("kr-dialog")],Ht);
|
|
628
|
+
/**
|
|
629
|
+
* @license
|
|
630
|
+
* Copyright 2020 Google LLC
|
|
631
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
632
|
+
*/
|
|
633
|
+
const Tt={},jt=yt(class extends mt{constructor(t){if(super(t),t.type!==bt&&t.type!==ft&&t.type!==vt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===V||e===q)return e;const i=t.element,o=t.name;if(t.type===bt){if(e===i[o])return V}else if(t.type===vt){if(!!e===i.hasAttribute(o))return V}else if(t.type===ft&&i.getAttribute(o)===e+"")return V;return((t,e=Tt)=>{t._$AH=e;
|
|
634
|
+
/**
|
|
635
|
+
* @license
|
|
636
|
+
* Copyright 2020 Google LLC
|
|
637
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
638
|
+
*/})(t),e}});var Ut=function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let zt=class extends rt{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="",this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete="",this.hint="",this._touched=!1,this._dirty=!1,this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value="",this._touched=!1,this._dirty=!1,this._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(t){this.value=t}_handleInput(t){this.value=t.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}_handleChange(t){this.value=t.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}render(){let t="";return this._touched&&this._input&&!this._input.validity.valid&&(t=this._input.validationMessage),B`
|
|
639
|
+
<div class="wrapper">
|
|
640
|
+
${this.label?B`
|
|
641
|
+
<label for="input">
|
|
642
|
+
${this.label}
|
|
643
|
+
${this.required?B`<span class="required" aria-hidden="true">*</span>`:""}
|
|
644
|
+
</label>
|
|
645
|
+
`:""}
|
|
646
|
+
<input
|
|
647
|
+
id="input"
|
|
648
|
+
type=${this.type}
|
|
649
|
+
name=${this.name}
|
|
650
|
+
.value=${jt(this.value)}
|
|
651
|
+
placeholder=${this.placeholder}
|
|
652
|
+
?required=${this.required}
|
|
653
|
+
?disabled=${this.disabled}
|
|
654
|
+
?readonly=${this.readonly}
|
|
655
|
+
minlength=${this.minlength??""}
|
|
656
|
+
maxlength=${this.maxlength??""}
|
|
657
|
+
pattern=${this.pattern??""}
|
|
658
|
+
autocomplete=${this.autocomplete}
|
|
659
|
+
@input=${this._handleInput}
|
|
660
|
+
@change=${this._handleChange}
|
|
661
|
+
@blur=${this._handleBlur}
|
|
662
|
+
/>
|
|
663
|
+
${t?B`<div class="validation-message">${t}</div>`:this.hint?B`<div class="hint">${this.hint}</div>`:""}
|
|
664
|
+
</div>
|
|
665
|
+
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}};zt.styles=r`
|
|
666
|
+
:host {
|
|
667
|
+
display: block;
|
|
668
|
+
font-family: inherit;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.wrapper {
|
|
672
|
+
display: flex;
|
|
673
|
+
flex-direction: column;
|
|
674
|
+
gap: 0.25rem;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
label {
|
|
678
|
+
font-size: 13px;
|
|
679
|
+
font-weight: 500;
|
|
680
|
+
color: var(--kr-text-field-label-color, #374151);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.required {
|
|
684
|
+
color: var(--kr-text-field-required-color, #ef4444);
|
|
685
|
+
margin-left: 0.125rem;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
input {
|
|
689
|
+
font-family: inherit;
|
|
690
|
+
font-size: 14px;
|
|
691
|
+
padding: 0.5rem 0.75rem;
|
|
692
|
+
border: 1px solid var(--kr-text-field-border-color, #d1d5db);
|
|
693
|
+
border-radius: 4px;
|
|
694
|
+
background-color: var(--kr-text-field-bg, #fff);
|
|
695
|
+
color: var(--kr-text-field-color, #111827);
|
|
696
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
input:focus {
|
|
700
|
+
outline: none;
|
|
701
|
+
border-color: var(--kr-text-field-focus-border-color, #2563eb);
|
|
702
|
+
box-shadow: 0 0 0 3px var(--kr-text-field-focus-ring-color, rgba(37, 99, 235, 0.1));
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
input:disabled {
|
|
706
|
+
background-color: var(--kr-text-field-disabled-bg, #f3f4f6);
|
|
707
|
+
color: var(--kr-text-field-disabled-color, #9ca3af);
|
|
708
|
+
cursor: not-allowed;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
input::placeholder {
|
|
712
|
+
color: var(--kr-text-field-placeholder-color, #9ca3af);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
:host(:invalid) input {
|
|
716
|
+
border-color: var(--kr-text-field-error-border-color, #ef4444);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
:host(:invalid) input:focus {
|
|
720
|
+
box-shadow: 0 0 0 3px var(--kr-text-field-error-ring-color, rgba(239, 68, 68, 0.1));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.validation-message {
|
|
724
|
+
font-size: 0.75rem;
|
|
725
|
+
color: var(--kr-text-field-error-color, #ef4444);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.hint {
|
|
729
|
+
font-size: 0.75rem;
|
|
730
|
+
color: var(--kr-text-field-helper-color, #6b7280);
|
|
731
|
+
}
|
|
732
|
+
`,zt.formAssociated=!0,Ut([ct({type:String})],zt.prototype,"label",void 0),Ut([ct({type:String})],zt.prototype,"name",void 0),Ut([ct({type:String})],zt.prototype,"value",void 0),Ut([ct({type:String})],zt.prototype,"placeholder",void 0),Ut([ct({type:String})],zt.prototype,"type",void 0),Ut([ct({type:Boolean})],zt.prototype,"required",void 0),Ut([ct({type:Boolean})],zt.prototype,"disabled",void 0),Ut([ct({type:Boolean})],zt.prototype,"readonly",void 0),Ut([ct({type:Number})],zt.prototype,"minlength",void 0),Ut([ct({type:Number})],zt.prototype,"maxlength",void 0),Ut([ct({type:String})],zt.prototype,"pattern",void 0),Ut([ct({type:String})],zt.prototype,"autocomplete",void 0),Ut([ct({type:String})],zt.prototype,"hint",void 0),Ut([
|
|
733
|
+
/**
|
|
734
|
+
* @license
|
|
735
|
+
* Copyright 2017 Google LLC
|
|
736
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
737
|
+
*/
|
|
738
|
+
function(t){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}("input")],zt.prototype,"_input",void 0),Ut([ht()],zt.prototype,"_touched",void 0),Ut([ht()],zt.prototype,"_dirty",void 0),zt=Ut([at("kr-text-field")],zt);export{Mt as DialogRef,ut as KRAccordion,xt as KRAlert,kt as KRButton,Ct as KRCodeDemo,Ot as KRContextMenu,Ht as KRDialog,zt as KRTextField};
|
|
739
|
+
//# sourceMappingURL=krubble.bundled.min.js.map
|