@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
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).kr={})}(this,(function(e){"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/const t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=s.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(t,e))}return e}toString(){return this.cssText}};const n=(e,...t)=>{const i=1===e.length?e[0]:t.reduce(((t,i,o)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1]),e[0]);return new r(i,e,o)},l=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new r("string"==typeof e?e:e+"",void 0,o))(t)})(e):e
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/,{is:a,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,g=f.trustedTypes,b=g?g.emptyScript:"",v=f.reactiveElementPolyfillSupport,y=(e,t)=>e,m={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},_=(e,t)=>!a(e,t),$={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;let x=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=$){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,t);void 0!==o&&d(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=c(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:o,set(t){const r=o?.call(this);s?.call(this,t),this.requestUpdate(e,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const e=u(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const e=this.properties,t=[...h(e),...p(e)];for(const i of t)this.createProperty(i,e[i])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,i]of t)this.elementProperties.set(e,i)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(l(e))}else void 0!==e&&t.push(l(e));return t}static _$Eu(e,t){const i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(i)e.adoptedStyleSheets=o.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const i of o){const o=document.createElement("style"),s=t.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=i.cssText,e.appendChild(o)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(e,t){const i=this.constructor,o=i._$Eh.get(e);if(void 0!==o&&this._$Em!==o){const e=i.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:m;this._$Em=o;const r=s.fromAttribute(t,e.type);this[o]=r??this._$Ej?.get(o)??r,this._$Em=null}}requestUpdate(e,t,i){if(void 0!==e){const o=this.constructor,s=this[e];if(i??=o.getPropertyOptions(e),!((i.hasChanged??_)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??t??this[e]),!0!==s||void 0!==r)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===o&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,i]of e){const{wrapped:e}=i,o=this[t];!0!==e||this._$AL.has(t)||void 0===o||this.C(t,void 0,i,o)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[y("elementProperties")]=new Map,x[y("finalized")]=new Map,v?.({ReactiveElement:x}),(f.reactiveElementVersions??=[]).push("2.1.1");
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*/
|
|
17
|
+
const w=globalThis,k=w.trustedTypes,A=k?k.createPolicy("lit-html",{createHTML:e=>e}):void 0,R="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+E,S=`<${C}>`,P=document,T=()=>P.createComment(""),K=e=>null===e||"object"!=typeof e&&"function"!=typeof e,O=Array.isArray,M="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,j=/>/g,U=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,B=/"/g,N=/^(?:script|style|textarea|title)$/i,L=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),F=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),q=new WeakMap,I=P.createTreeWalker(P,129);function W(e,t){if(!O(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}const J=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",n=H;for(let t=0;t<i;t++){const i=e[t];let l,a,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===H?"!--"===a[1]?n=D:void 0!==a[1]?n=j:void 0!==a[2]?(N.test(a[2])&&(s=RegExp("</"+a[2],"g")),n=U):void 0!==a[3]&&(n=U):n===U?">"===a[0]?(n=s??H,d=-1):void 0===a[1]?d=-2:(d=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?U:'"'===a[3]?B:z):n===B||n===z?n=U:n===D||n===j?n=H:(n=U,s=void 0);const h=n===U&&e[t+1].startsWith("/>")?" ":"";r+=n===H?i+S:d>=0?(o.push(l),i.slice(0,d)+R+i.slice(d)+E+h):i+E+(-2===d?t:h)}return[W(e,r+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Z{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let s=0,r=0;const n=e.length-1,l=this.parts,[a,d]=J(e,t);if(this.el=Z.createElement(a,i),I.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=I.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(R)){const t=d[r++],i=o.getAttribute(e).split(E),n=/([.?@])?(.*)/.exec(t);l.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?ee:"?"===n[1]?te:"@"===n[1]?ie:Y}),o.removeAttribute(e)}else e.startsWith(E)&&(l.push({type:6,index:s}),o.removeAttribute(e));if(N.test(o.tagName)){const e=o.textContent.split(E),t=e.length-1;if(t>0){o.textContent=k?k.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],T()),I.nextNode(),l.push({type:2,index:++s});o.append(e[t],T())}}}else if(8===o.nodeType)if(o.data===C)l.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(E,e+1));)l.push({type:7,index:s}),e+=E.length-1}s++}}static createElement(e,t){const i=P.createElement("template");return i.innerHTML=e,i}}function G(e,t,i=e,o){if(t===F)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=K(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),void 0===r?s=void 0:(s=new r(e),s._$AT(e,i,o)),void 0!==o?(i._$Co??=[])[o]=s:i._$Cl=s),void 0!==s&&(t=G(e,s._$AS(e,t.values),s,o)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,o=(e?.creationScope??P).importNode(t,!0);I.currentNode=o;let s=I.nextNode(),r=0,n=0,l=i[0];for(;void 0!==l;){if(r===l.index){let t;2===l.type?t=new X(s,s.nextSibling,this,e):1===l.type?t=new l.ctor(s,l.name,l.strings,this,e):6===l.type&&(t=new oe(s,this,e)),this._$AV.push(t),l=i[++n]}r!==l?.index&&(s=I.nextNode(),r++)}return I.currentNode=P,o}p(e){let t=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),K(e)?e===V||null==e||""===e?(this._$AH!==V&&this._$AR(),this._$AH=V):e!==this._$AH&&e!==F&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>O(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==V&&K(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:i}=e,o="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=Z.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(t);else{const e=new Q(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=q.get(e.strings);return void 0===t&&q.set(e.strings,t=new Z(e)),t}k(e){O(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const s of e)o===t.length?t.push(i=new X(this.O(T()),this.O(T()),this,this.options)):i=t[o],i._$AI(s),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,s){this.type=1,this._$AH=V,this._$AN=void 0,this.element=e,this.name=t,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=V}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=G(this,e,t,0),r=!K(e)||e!==this._$AH&&e!==F,r&&(this._$AH=e);else{const o=e;let n,l;for(e=s[0],n=0;n<s.length-1;n++)l=G(this,o[i+n],t,n),l===F&&(l=this._$AH[n]),r||=!K(l)||l!==this._$AH[n],l===V?e=V:e!==V&&(e+=(l??"")+s[n+1]),this._$AH[n]=l}r&&!o&&this.j(e)}j(e){e===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ee extends Y{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===V?void 0:e}}class te extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==V)}}class ie extends Y{constructor(e,t,i,o,s){super(e,t,i,o,s),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??V)===F)return;const i=this._$AH,o=e===V&&i!==V||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==V&&(i===V||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class oe{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}}const se=w.litHtmlPolyfillSupport;se?.(Z,X),(w.litHtmlVersions??=[]).push("3.3.1");const re=globalThis;
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/let ne=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{const o=i?.renderBefore??t;let s=o._$litPart$;if(void 0===s){const e=i?.renderBefore??null;o._$litPart$=s=new X(t.insertBefore(T(),e),e,void 0,i??{})}return s._$AI(e),s})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return F}};ne._$litElement$=!0,ne.finalized=!0,re.litElementHydrateSupport?.({LitElement:ne});const le=re.litElementPolyfillSupport;le?.({LitElement:ne}),(re.litElementVersions??=[]).push("4.2.1");
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/
|
|
28
|
+
const ae=e=>(t,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)}
|
|
29
|
+
/**
|
|
30
|
+
* @license
|
|
31
|
+
* Copyright 2017 Google LLC
|
|
32
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
+
*/,de={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:_},ce=(e=de,t,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&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),"accessor"===o){const{name:o}=i;return{set(i){const s=t.get.call(this);t.set.call(this,i),this.requestUpdate(o,s,e)},init(t){return void 0!==t&&this.C(o,void 0,e,t),t}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];t.call(this,i),this.requestUpdate(o,s,e)}}throw Error("Unsupported decorator location: "+o)};function he(e){return(t,i)=>"object"==typeof i?ce(e,t,i):((e,t,i)=>{const o=t.hasOwnProperty(i);return t.constructor.createProperty(i,e),o?Object.getOwnPropertyDescriptor(t,i):void 0})(e,t,i)
|
|
34
|
+
/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright 2017 Google LLC
|
|
37
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
+
*/}function pe(e){return he({...e,state:!0,attribute:!1})}
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/var ue=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAccordion=class extends ne{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return L`
|
|
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
|
+
`}},e.KRAccordion.styles=n`
|
|
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
|
+
`,ue([he({type:String})],e.KRAccordion.prototype,"header",void 0),ue([he({type:Boolean,reflect:!0})],e.KRAccordion.prototype,"expanded",void 0),e.KRAccordion=ue([ae("kr-accordion")],e.KRAccordion);
|
|
110
|
+
/**
|
|
111
|
+
* @license
|
|
112
|
+
* Copyright 2017 Google LLC
|
|
113
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
+
*/
|
|
115
|
+
const fe=1,ge=2,be=3,ve=4,ye=e=>(...t)=>({_$litDirective$:e,values:t});class me{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}
|
|
116
|
+
/**
|
|
117
|
+
* @license
|
|
118
|
+
* Copyright 2018 Google LLC
|
|
119
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
+
*/const _e=ye(class extends me{constructor(e){if(super(e),e.type!==fe||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t=>e[t])).join(" ")+" "}update(e,[t]){if(void 0===this.st){this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((e=>""!==e))));for(const e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}const i=e.element.classList;for(const e of this.st)e in t||(i.remove(e),this.st.delete(e));for(const e in t){const o=!!t[e];o===this.st.has(e)||this.nt?.has(e)||(o?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return F}});var $e=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRAlert=class extends ne{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 e={info:L`<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:L`<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:L`<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:L`<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 L`
|
|
121
|
+
<div
|
|
122
|
+
class=${_e({alert:!0,["alert--"+this.type]:!0,"alert--hidden":!this.visible})}
|
|
123
|
+
role="alert"
|
|
124
|
+
>
|
|
125
|
+
${e[this.type]}
|
|
126
|
+
<div class="content">
|
|
127
|
+
${this.header?L`<h4 class="header">${this.header}</h4>`:V}
|
|
128
|
+
<div class="message">
|
|
129
|
+
<slot></slot>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
${this.dismissible?L`
|
|
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
|
+
`:V}
|
|
144
|
+
</div>
|
|
145
|
+
`}},e.KRAlert.styles=n`
|
|
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
|
+
`,$e([he({type:String})],e.KRAlert.prototype,"type",void 0),$e([he({type:String})],e.KRAlert.prototype,"header",void 0),$e([he({type:Boolean})],e.KRAlert.prototype,"dismissible",void 0),$e([he({type:Boolean})],e.KRAlert.prototype,"visible",void 0),e.KRAlert=$e([ae("kr-alert")],e.KRAlert);var xe=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRButton=class extends ne{constructor(){super(...arguments),this.variant="primary",this.size="medium",this.disabled=!1}render(){const e="medium"!==this.size?this.size:"";return L`
|
|
253
|
+
<button
|
|
254
|
+
part="button"
|
|
255
|
+
class="${this.variant} ${e}"
|
|
256
|
+
?disabled=${this.disabled}
|
|
257
|
+
>
|
|
258
|
+
<slot></slot>
|
|
259
|
+
</button>
|
|
260
|
+
`}},e.KRButton.styles=n`
|
|
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
|
+
`,xe([he({type:String})],e.KRButton.prototype,"variant",void 0),xe([he({type:String})],e.KRButton.prototype,"size",void 0),xe([he({type:Boolean})],e.KRButton.prototype,"disabled",void 0),e.KRButton=xe([ae("kr-button")],e.KRButton);
|
|
335
|
+
/**
|
|
336
|
+
* @license
|
|
337
|
+
* Copyright 2017 Google LLC
|
|
338
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
339
|
+
*/
|
|
340
|
+
class we extends me{constructor(e){if(super(e),this.it=V,e.type!==ge)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||null==e)return this._t=void 0,this.it=e;if(e===F)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}we.directiveName="unsafeHTML",we.resultType=1;const ke=ye(we);var Ae=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRCodeDemo=class extends ne{constructor(){super(...arguments),this.language="html",this.code="",this.activeTab="preview",this.copied=!1}setTab(e){this.activeTab=e}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(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}async copyCode(){if(this.code)try{await navigator.clipboard.writeText(this.code),this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}catch(e){console.error("Failed to copy code:",e)}}render(){return L`
|
|
341
|
+
<div class="tabs">
|
|
342
|
+
<button
|
|
343
|
+
class=${_e({tab:!0,"tab--active":"preview"===this.activeTab})}
|
|
344
|
+
@click=${()=>this.setTab("preview")}
|
|
345
|
+
>
|
|
346
|
+
Preview
|
|
347
|
+
</button>
|
|
348
|
+
<button
|
|
349
|
+
class=${_e({tab:!0,"tab--active":"code"===this.activeTab})}
|
|
350
|
+
@click=${()=>this.setTab("code")}
|
|
351
|
+
>
|
|
352
|
+
Code
|
|
353
|
+
</button>
|
|
354
|
+
</div>
|
|
355
|
+
|
|
356
|
+
<div class=${_e({panel:!0,"panel--active":"preview"===this.activeTab,preview:!0})}>
|
|
357
|
+
<slot name="preview"></slot>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class=${_e({panel:!0,"panel--active":"code"===this.activeTab,"code-container":!0})}>
|
|
361
|
+
<button
|
|
362
|
+
class=${_e({"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>${ke(this.getHighlightedCode())}</code></pre>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
`}},e.KRCodeDemo.styles=n`
|
|
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
|
+
`,Ae([he({type:String})],e.KRCodeDemo.prototype,"language",void 0),Ae([he({type:String})],e.KRCodeDemo.prototype,"code",void 0),Ae([pe()],e.KRCodeDemo.prototype,"activeTab",void 0),Ae([pe()],e.KRCodeDemo.prototype,"copied",void 0),e.KRCodeDemo=Ae([ae("kr-code-demo")],e.KRCodeDemo);var Re=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRContextMenu=class extends ne{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector("kr-context-menu");t&&t.remove();const i=document.createElement("kr-context-menu");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+"px"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+"px"),requestAnimationFrame((()=>{document.addEventListener("click",this.boundHandleOutsideClick),document.addEventListener("contextmenu",this.boundHandleOutsideClick),document.addEventListener("keydown",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){"Escape"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener("click",this.boundHandleOutsideClick),document.removeEventListener("contextmenu",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return L`
|
|
530
|
+
<div class="menu">
|
|
531
|
+
${this.items.map((e=>e.divider?L`<div class="menu__divider"></div>`:L`
|
|
532
|
+
<button
|
|
533
|
+
class="menu__item"
|
|
534
|
+
?disabled=${e.disabled}
|
|
535
|
+
@click=${()=>this.handleItemClick(e)}
|
|
536
|
+
>
|
|
537
|
+
${e.icon?L`<span class="menu__item-icon">${e.icon}</span>`:null}
|
|
538
|
+
${e.label}
|
|
539
|
+
</button>
|
|
540
|
+
`))}
|
|
541
|
+
</div>
|
|
542
|
+
`}},e.KRContextMenu.styles=n`
|
|
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
|
+
`,Re([pe()],e.KRContextMenu.prototype,"items",void 0),e.KRContextMenu=Re([ae("kr-context-menu")],e.KRContextMenu);var Ee=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ce{constructor(){this.resolvePromise=null,this.dialogElement=null,this.promise=new Promise((e=>{this.resolvePromise=e}))}setDialogElement(e){this.dialogElement=e}close(e){this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.dialogElement?.remove()}afterClosed(){return this.promise}}e.KRDialog=class extends ne{constructor(){super(...arguments),this.contentElement=null,this.dialogRef=null,this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static open(e,t){const i=document.querySelector("kr-dialog");i&&i.remove();const o=new Ce,s=document.createElement("kr-dialog");o.setDialogElement(s),s.dialogRef=o;const r=new e;return r.dialogRef=o,t?.data&&(r.data=t.data),s.contentElement=r,document.body.appendChild(s),document.addEventListener("keydown",s.boundHandleKeyDown),o}handleKeyDown(e){"Escape"===e.key&&this.dialogRef?.close(void 0)}handleBackdropClick(e){e.target.classList.contains("backdrop")&&this.dialogRef?.close(void 0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.boundHandleKeyDown)}render(){return L`
|
|
598
|
+
<div class="backdrop" @click=${this.handleBackdropClick}></div>
|
|
599
|
+
<div class="dialog">
|
|
600
|
+
${this.contentElement}
|
|
601
|
+
</div>
|
|
602
|
+
`}},e.KRDialog.styles=n`
|
|
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
|
+
`,Ee([pe()],e.KRDialog.prototype,"contentElement",void 0),e.KRDialog=Ee([ae("kr-dialog")],e.KRDialog);
|
|
628
|
+
/**
|
|
629
|
+
* @license
|
|
630
|
+
* Copyright 2020 Google LLC
|
|
631
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
632
|
+
*/
|
|
633
|
+
const Se={},Pe=ye(class extends me{constructor(e){if(super(e),e.type!==be&&e.type!==fe&&e.type!==ve)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===F||t===V)return t;const i=e.element,o=e.name;if(e.type===be){if(t===i[o])return F}else if(e.type===ve){if(!!t===i.hasAttribute(o))return F}else if(e.type===fe&&i.getAttribute(o)===t+"")return F;return((e,t=Se)=>{e._$AH=t;
|
|
634
|
+
/**
|
|
635
|
+
* @license
|
|
636
|
+
* Copyright 2020 Google LLC
|
|
637
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
638
|
+
*/})(e),t}});var Te=function(e,t,i,o){var s,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};e.KRTextField=class extends ne{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(e){this.value=e}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage,this._input)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),L`
|
|
639
|
+
<div class="wrapper">
|
|
640
|
+
${this.label?L`
|
|
641
|
+
<label for="input">
|
|
642
|
+
${this.label}
|
|
643
|
+
${this.required?L`<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=${Pe(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
|
+
${e?L`<div class="validation-message">${e}</div>`:this.hint?L`<div class="hint">${this.hint}</div>`:""}
|
|
664
|
+
</div>
|
|
665
|
+
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}},e.KRTextField.styles=n`
|
|
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
|
+
`,e.KRTextField.formAssociated=!0,Te([he({type:String})],e.KRTextField.prototype,"label",void 0),Te([he({type:String})],e.KRTextField.prototype,"name",void 0),Te([he({type:String})],e.KRTextField.prototype,"value",void 0),Te([he({type:String})],e.KRTextField.prototype,"placeholder",void 0),Te([he({type:String})],e.KRTextField.prototype,"type",void 0),Te([he({type:Boolean})],e.KRTextField.prototype,"required",void 0),Te([he({type:Boolean})],e.KRTextField.prototype,"disabled",void 0),Te([he({type:Boolean})],e.KRTextField.prototype,"readonly",void 0),Te([he({type:Number})],e.KRTextField.prototype,"minlength",void 0),Te([he({type:Number})],e.KRTextField.prototype,"maxlength",void 0),Te([he({type:String})],e.KRTextField.prototype,"pattern",void 0),Te([he({type:String})],e.KRTextField.prototype,"autocomplete",void 0),Te([he({type:String})],e.KRTextField.prototype,"hint",void 0),Te([
|
|
733
|
+
/**
|
|
734
|
+
* @license
|
|
735
|
+
* Copyright 2017 Google LLC
|
|
736
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
737
|
+
*/
|
|
738
|
+
function(e){return(t,i,o)=>((e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i))(t,i,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}("input")],e.KRTextField.prototype,"_input",void 0),Te([pe()],e.KRTextField.prototype,"_touched",void 0),Te([pe()],e.KRTextField.prototype,"_dirty",void 0),e.KRTextField=Te([ae("kr-text-field")],e.KRTextField),e.DialogRef=Ce})),function(e){Object.keys(e).forEach((function(t){t.startsWith("KR")&&"function"==typeof e[t]&&(e[t.slice(2)]=e[t],delete e[t])}))}(kr);
|
|
739
|
+
//# sourceMappingURL=krubble.umd.min.js.map
|