@kodaris/krubble-components 1.0.4 → 1.0.6
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 +1596 -382
- package/dist/alert/alert.d.ts.map +1 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/button/button.d.ts +34 -3
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +193 -38
- package/dist/button/button.js.map +1 -1
- package/dist/code-demo/code-demo.d.ts.map +1 -1
- package/dist/code-demo/code-demo.js +2 -1
- package/dist/code-demo/code-demo.js.map +1 -1
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +2 -0
- package/dist/form/index.js.map +1 -1
- package/dist/form/select/select-option.d.ts +27 -0
- package/dist/form/select/select-option.d.ts.map +1 -0
- package/dist/form/select/select-option.js +50 -0
- package/dist/form/select/select-option.js.map +1 -0
- package/dist/form/select/select.d.ts +81 -0
- package/dist/form/select/select.d.ts.map +1 -0
- package/dist/form/select/select.js +519 -0
- package/dist/form/select/select.js.map +1 -0
- package/dist/form/text-field/text-field.d.ts +6 -0
- package/dist/form/text-field/text-field.d.ts.map +1 -1
- package/dist/form/text-field/text-field.js +38 -8
- package/dist/form/text-field/text-field.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/krubble.bundled.js +1329 -156
- package/dist/krubble.bundled.js.map +1 -1
- package/dist/krubble.bundled.min.js +592 -91
- package/dist/krubble.bundled.min.js.map +1 -1
- package/dist/krubble.umd.js +1325 -151
- package/dist/krubble.umd.js.map +1 -1
- package/dist/krubble.umd.min.js +585 -84
- package/dist/krubble.umd.min.js.map +1 -1
- package/dist/snackbar/snackbar.d.ts.map +1 -1
- package/dist/snackbar/snackbar.js +8 -1
- package/dist/snackbar/snackbar.js.map +1 -1
- package/dist/style/base.d.ts +6 -0
- package/dist/style/base.d.ts.map +1 -0
- package/dist/style/base.js +34 -0
- package/dist/style/base.js.map +1 -0
- package/dist/tabs/tab.d.ts +54 -0
- package/dist/tabs/tab.d.ts.map +1 -0
- package/dist/tabs/tab.js +103 -0
- package/dist/tabs/tab.js.map +1 -0
- package/dist/tabs/tabs.d.ts +47 -0
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +282 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/package.json +1 -1
- package/dist/alert.d.ts.map +0 -1
- package/dist/alert.js.map +0 -1
- /package/dist/{alert.d.ts → alert/alert.d.ts} +0 -0
- /package/dist/{alert.js → alert/alert.js} +0 -0
|
@@ -3,44 +3,71 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const e=globalThis,t=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;let s=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const i=this.t;if(t&&void 0===e){const t=void 0!==i&&1===i.length;t&&(e=o.get(i)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&o.set(i,e))}return e}toString(){return this.cssText}};const r=(e,...t)=>{const o=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 s(o,e,i)},n=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,i))(t)})(e):e,{is:a,defineProperty:l,getOwnPropertyDescriptor:d,getOwnPropertyNames:c,getOwnPropertySymbols:h,getPrototypeOf:p}=Object,u=globalThis,b=u.trustedTypes,f=b?b.emptyScript:"",g=u.reactiveElementPolyfillSupport,v=(e,t)=>e,y={toAttribute(e,t){switch(t){case Boolean:e=e?f: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}},m=(e,t)=>!a(e,t),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:m};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let
|
|
11
|
+
*/Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;let k=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&&l(this.prototype,e,o)}}static getPropertyDescriptor(e,t,i){const{get:o,set:s}=d(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(v("elementProperties")))return;const e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const e=this.properties,t=[...c(e),...h(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(n(e))}else void 0!==e&&t.push(n(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 i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((i,o)=>{if(t)i.adoptedStyleSheets=o.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const t of o){const o=document.createElement("style"),s=e.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=t.cssText,i.appendChild(o)}})(i,this.constructor.elementStyles),i}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:y).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:y;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,o=!1,s){if(void 0!==e){const r=this.constructor;if(!1===o&&(s=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??m)(s,t)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(r._$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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[v("elementProperties")]=new Map,k[v("finalized")]=new Map,g?.({ReactiveElement:k}),(u.reactiveElementVersions??=[]).push("2.1.2");
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const x=globalThis
|
|
17
|
+
const x=globalThis,$=e=>e,w=x.trustedTypes,A=w?w.createPolicy("lit-html",{createHTML:e=>e}):void 0,E="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+S,T=`<${C}>`,O=document,P=()=>O.createComment(""),R=e=>null===e||"object"!=typeof e&&"function"!=typeof e,z=Array.isArray,L="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,D=/>/g,I=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,U=/"/g,B=/^(?:script|style|textarea|title)$/i,V=(e=>(t,...i)=>({_$litType$:e,strings:t,values:i}))(1),N=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),K=new WeakMap,F=O.createTreeWalker(O,129);function W(e,t){if(!z(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}const X=(e,t)=>{const i=e.length-1,o=[];let s,r=2===t?"<svg>":3===t?"<math>":"",n=M;for(let t=0;t<i;t++){const i=e[t];let a,l,d=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===M?"!--"===l[1]?n=j:void 0!==l[1]?n=D:void 0!==l[2]?(B.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=I):void 0!==l[3]&&(n=I):n===I?">"===l[0]?(n=s??M,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?I:'"'===l[3]?U:H):n===U||n===H?n=I:n===j||n===D?n=M:(n=I,s=void 0);const h=n===I&&e[t+1].startsWith("/>")?" ":"";r+=n===M?i+T:d>=0?(o.push(a),i.slice(0,d)+E+i.slice(d)+S+h):i+S+(-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,a=this.parts,[l,d]=X(e,t);if(this.el=Z.createElement(l,i),F.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(o=F.nextNode())&&a.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const e of o.getAttributeNames())if(e.endsWith(E)){const t=d[r++],i=o.getAttribute(e).split(S),n=/([.?@])?(.*)/.exec(t);a.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(S)&&(a.push({type:6,index:s}),o.removeAttribute(e));if(B.test(o.tagName)){const e=o.textContent.split(S),t=e.length-1;if(t>0){o.textContent=w?w.emptyScript:"";for(let i=0;i<t;i++)o.append(e[i],P()),F.nextNode(),a.push({type:2,index:++s});o.append(e[t],P())}}}else if(8===o.nodeType)if(o.data===C)a.push({type:2,index:s});else{let e=-1;for(;-1!==(e=o.data.indexOf(S,e+1));)a.push({type:7,index:s}),e+=S.length-1}s++}}static createElement(e,t){const i=O.createElement("template");return i.innerHTML=e,i}}function J(e,t,i=e,o){if(t===N)return t;let s=void 0!==o?i._$Co?.[o]:i._$Cl;const r=R(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=J(e,s._$AS(e,t.values),s,o)),t}class G{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??O).importNode(t,!0);F.currentNode=o;let s=F.nextNode(),r=0,n=0,a=i[0];for(;void 0!==a;){if(r===a.index){let t;2===a.type?t=new Q(s,s.nextSibling,this,e):1===a.type?t=new a.ctor(s,a.name,a.strings,this,e):6===a.type&&(t=new oe(s,this,e)),this._$AV.push(t),a=i[++n]}r!==a?.index&&(s=F.nextNode(),r++)}return F.currentNode=O,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 Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=q,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=J(this,e,t),R(e)?e===q||null==e||""===e?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==N&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>z(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!==q&&R(this._$AH)?this._$AA.nextSibling.data=e:this.T(O.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 G(o,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=K.get(e.strings);return void 0===t&&K.set(e.strings,t=new Z(e)),t}k(e){z(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 Q(this.O(P()),this.O(P()),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=q,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=q}_$AI(e,t=this,i,o){const s=this.strings;let r=!1;if(void 0===s)e=J(this,e,t,0),r=!R(e)||e!==this._$AH&&e!==N,r&&(this._$AH=e);else{const o=e;let n,a;for(e=s[0],n=0;n<s.length-1;n++)a=J(this,o[i+n],t,n),a===N&&(a=this._$AH[n]),r||=!R(a)||a!==this._$AH[n],a===q?e=q:e!==q&&(e+=(a??"")+s[n+1]),this._$AH[n]=a}r&&!o&&this.j(e)}j(e){e===q?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===q?void 0:e}}class te extends Y{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}}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=J(this,e,t,0)??q)===N)return;const i=this._$AH,o=e===q&&i!==q||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==q&&(i===q||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){J(this,e)}}const se=x.litHtmlPolyfillSupport;se?.(Z,Q),(x.litHtmlVersions??=[]).push("3.3.2");const re=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let
|
|
22
|
+
*/let ne=class extends k{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 Q(t.insertBefore(P(),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 N}};ne._$litElement$=!0,ne.finalized=!0,re.litElementHydrateSupport?.({LitElement:ne});const ae=re.litElementPolyfillSupport;ae?.({LitElement:ne}),(re.litElementVersions??=[]).push("4.2.2");const le=r`
|
|
23
|
+
:host,
|
|
24
|
+
*,
|
|
25
|
+
*::before,
|
|
26
|
+
*::after {
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host {
|
|
31
|
+
/* Primary */
|
|
32
|
+
--kr-primary: rgb(22, 48, 82);
|
|
33
|
+
--kr-primary-hover: rgb(16, 36, 62);
|
|
34
|
+
--kr-primary-text: #ffffff;
|
|
35
|
+
|
|
36
|
+
/* Accent */
|
|
37
|
+
--kr-accent: #BEEA4E;
|
|
38
|
+
--kr-accent-hover: #a8d43a;
|
|
39
|
+
--kr-accent-text: #000000;
|
|
40
|
+
|
|
41
|
+
/* Text */
|
|
42
|
+
--kr-text: #000000;
|
|
43
|
+
--kr-text-muted: #4b5563;
|
|
44
|
+
--kr-text-disabled: #9ca3af;
|
|
45
|
+
|
|
46
|
+
/* Borders */
|
|
47
|
+
--kr-border: #e5e7eb;
|
|
48
|
+
}
|
|
49
|
+
`
|
|
23
50
|
/**
|
|
24
51
|
* @license
|
|
25
52
|
* Copyright 2017 Google LLC
|
|
26
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
|
|
28
|
-
const lt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:y},ct=(t=dt,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,!0,i)},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,!0,i)}}throw Error("Unsupported decorator location: "+o)};
|
|
54
|
+
*/,de=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},ce={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:m},he=(e=ce,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,!0,i)},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,!0,i)}}throw Error("Unsupported decorator location: "+o)};function pe(e){return(t,i)=>"object"==typeof i?he(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)}
|
|
29
55
|
/**
|
|
30
56
|
* @license
|
|
31
57
|
* Copyright 2017 Google LLC
|
|
32
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/function
|
|
59
|
+
*/function ue(e){return pe({...e,state:!0,attribute:!1})}
|
|
34
60
|
/**
|
|
35
61
|
* @license
|
|
36
62
|
* Copyright 2017 Google LLC
|
|
37
63
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
|
-
*/
|
|
64
|
+
*/
|
|
39
65
|
/**
|
|
40
66
|
* @license
|
|
41
67
|
* Copyright 2017 Google LLC
|
|
42
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/
|
|
69
|
+
*/
|
|
70
|
+
function be(e,t){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)}})}var fe=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let ge=class extends ne{constructor(){super(...arguments),this.header="",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return V`
|
|
44
71
|
<div class="header" @click=${this.toggle}>
|
|
45
72
|
<span class="header__title">${this.header}</span>
|
|
46
73
|
<svg class="header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -54,7 +81,7 @@ const lt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}
|
|
|
54
81
|
</div>
|
|
55
82
|
</div>
|
|
56
83
|
</div>
|
|
57
|
-
`}};
|
|
84
|
+
`}};ge.styles=r`
|
|
58
85
|
:host {
|
|
59
86
|
display: block;
|
|
60
87
|
margin-bottom: 16px;
|
|
@@ -106,23 +133,23 @@ const lt=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}
|
|
|
106
133
|
.content__body {
|
|
107
134
|
padding: 16px 16px 8px 16px;
|
|
108
135
|
}
|
|
109
|
-
`,
|
|
136
|
+
`,fe([pe({type:String})],ge.prototype,"header",void 0),fe([pe({type:Boolean,reflect:!0})],ge.prototype,"expanded",void 0),ge=fe([de("kr-accordion")],ge);
|
|
110
137
|
/**
|
|
111
138
|
* @license
|
|
112
139
|
* Copyright 2017 Google LLC
|
|
113
140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
141
|
*/
|
|
115
|
-
const
|
|
142
|
+
const ve=1,ye=2,me=3,_e=4,ke=e=>(...t)=>({_$litDirective$:e,values:t});let xe=class{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
143
|
/**
|
|
117
144
|
* @license
|
|
118
145
|
* Copyright 2018 Google LLC
|
|
119
146
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
-
*/const $
|
|
147
|
+
*/const $e=ke(class extends xe{constructor(e){if(super(e),e.type!==ve||"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 N}});var we=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Ae=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:V`<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:V`<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:V`<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:V`<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 V`
|
|
121
148
|
<div
|
|
122
|
-
class=${$
|
|
149
|
+
class=${$e({alert:!0,["alert--"+this.type]:!0,"alert--hidden":!this.visible})}
|
|
123
150
|
role="alert"
|
|
124
151
|
>
|
|
125
|
-
${
|
|
152
|
+
${e[this.type]}
|
|
126
153
|
<div class="content">
|
|
127
154
|
${this.header?V`<h4 class="header">${this.header}</h4>`:q}
|
|
128
155
|
<div class="message">
|
|
@@ -142,7 +169,7 @@ const bt=1,gt=2,vt=3,mt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class _t{
|
|
|
142
169
|
</button>
|
|
143
170
|
`:q}
|
|
144
171
|
</div>
|
|
145
|
-
`}};
|
|
172
|
+
`}};Ae.styles=r`
|
|
146
173
|
:host {
|
|
147
174
|
display: block;
|
|
148
175
|
}
|
|
@@ -249,130 +276,197 @@ const bt=1,gt=2,vt=3,mt=4,yt=t=>(...e)=>({_$litDirective$:t,values:e});class _t{
|
|
|
249
276
|
outline: 2px solid #3b82f6;
|
|
250
277
|
outline-offset: 2px;
|
|
251
278
|
}
|
|
252
|
-
`,
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
<slot></slot>
|
|
259
|
-
</button>
|
|
260
|
-
`}};At.styles=r`
|
|
279
|
+
`,we([pe({type:String})],Ae.prototype,"type",void 0),we([pe({type:String})],Ae.prototype,"header",void 0),we([pe({type:Boolean})],Ae.prototype,"dismissible",void 0),we([pe({type:Boolean})],Ae.prototype,"visible",void 0),Ae=we([de("kr-alert")],Ae);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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Se=class extends ne{constructor(){super(...arguments),this.variant="flat",this.color="primary",this.size="medium",this.disabled=!1,this._state="idle",this._stateText="",this._handleKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click())}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown)}showLoading(){this._clearStateTimeout(),this._state="loading",this._stateText=""}showSuccess(e="Success",t=2e3){this._clearStateTimeout(),this._state="success",this._stateText=e,this._stateTimeout=window.setTimeout(()=>this.reset(),t)}showError(e="Error",t=2e3){this._clearStateTimeout(),this._state="error",this._stateText=e,this._stateTimeout=window.setTimeout(()=>this.reset(),t)}reset(){this._clearStateTimeout(),this._state="idle",this._stateText=""}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle("kr-button--loading","loading"===this._state),this.classList.toggle("kr-button--success","success"===this._state),this.classList.toggle("kr-button--error","error"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle("kr-button--small","small"===this.size),this.classList.toggle("kr-button--large","large"===this.size)}render(){return V`
|
|
280
|
+
<slot></slot>
|
|
281
|
+
${"idle"!==this._state?V`<span class="state-overlay">
|
|
282
|
+
${"loading"===this._state?V`<span class="spinner"></span>`:this._stateText}
|
|
283
|
+
</span>`:""}
|
|
284
|
+
`}};Se.styles=r`
|
|
261
285
|
:host {
|
|
262
|
-
display: inline-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
286
|
+
display: inline-flex;
|
|
287
|
+
position: relative;
|
|
288
|
+
align-items: center;
|
|
289
|
+
justify-content: center;
|
|
266
290
|
font-family: inherit;
|
|
267
291
|
font-size: 14px;
|
|
268
292
|
font-weight: 400;
|
|
269
293
|
letter-spacing: 0.01em;
|
|
270
294
|
padding: 0 22px;
|
|
271
295
|
height: 36px;
|
|
272
|
-
line-height: 36px;
|
|
273
296
|
border: none;
|
|
274
297
|
border-radius: 20px;
|
|
275
298
|
cursor: pointer;
|
|
276
299
|
transition: background 0.15s ease;
|
|
300
|
+
user-select: none;
|
|
301
|
+
box-sizing: border-box;
|
|
277
302
|
}
|
|
278
303
|
|
|
279
|
-
|
|
280
|
-
|
|
304
|
+
:host([disabled]),
|
|
305
|
+
:host(.kr-button--loading),
|
|
306
|
+
:host(.kr-button--success),
|
|
307
|
+
:host(.kr-button--error) {
|
|
308
|
+
cursor: not-allowed;
|
|
309
|
+
pointer-events: none;
|
|
281
310
|
}
|
|
282
311
|
|
|
283
|
-
button:
|
|
312
|
+
:host([disabled]:not(.kr-button--loading):not(.kr-button--success):not(.kr-button--error)) {
|
|
284
313
|
opacity: 0.5;
|
|
285
|
-
cursor: not-allowed;
|
|
286
314
|
}
|
|
287
315
|
|
|
288
|
-
/*
|
|
289
|
-
|
|
316
|
+
/* Flat + Primary (default) */
|
|
317
|
+
:host,
|
|
318
|
+
:host(.kr-button--flat.kr-button--primary) {
|
|
290
319
|
background: #163052;
|
|
291
320
|
color: white;
|
|
292
321
|
}
|
|
293
322
|
|
|
294
|
-
|
|
323
|
+
:host(:hover:not([disabled])),
|
|
324
|
+
:host(.kr-button--flat.kr-button--primary:hover:not([disabled])) {
|
|
295
325
|
background: #0e1f35;
|
|
296
326
|
}
|
|
297
327
|
|
|
298
|
-
|
|
328
|
+
/* Flat + Secondary */
|
|
329
|
+
:host(.kr-button--flat.kr-button--secondary) {
|
|
299
330
|
background: #f3f4f6;
|
|
300
331
|
color: #374151;
|
|
301
332
|
}
|
|
302
333
|
|
|
303
|
-
button.secondary:hover:not(
|
|
334
|
+
:host(.kr-button--flat.kr-button--secondary:hover:not([disabled])) {
|
|
304
335
|
background: #e5e7eb;
|
|
305
336
|
}
|
|
306
337
|
|
|
307
|
-
|
|
338
|
+
/* Outline + Primary */
|
|
339
|
+
:host(.kr-button--outline.kr-button--primary) {
|
|
340
|
+
background: transparent;
|
|
341
|
+
border: 1px solid #163052;
|
|
342
|
+
color: #163052;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
:host(.kr-button--outline.kr-button--primary:hover:not([disabled])) {
|
|
346
|
+
background: rgba(22, 48, 82, 0.05);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* Outline + Secondary */
|
|
350
|
+
:host(.kr-button--outline.kr-button--secondary) {
|
|
308
351
|
background: transparent;
|
|
309
352
|
border: 1px solid #d1d5db;
|
|
310
353
|
color: #374151;
|
|
311
|
-
box-shadow: none;
|
|
312
354
|
}
|
|
313
355
|
|
|
314
|
-
button.
|
|
356
|
+
:host(.kr-button--outline.kr-button--secondary:hover:not([disabled])) {
|
|
315
357
|
background: #f9fafb;
|
|
316
358
|
border-color: #9ca3af;
|
|
317
|
-
box-shadow: none;
|
|
318
359
|
}
|
|
319
360
|
|
|
320
361
|
/* Sizes */
|
|
321
|
-
button
|
|
362
|
+
:host(.kr-button--small) {
|
|
322
363
|
font-size: 13px;
|
|
323
364
|
height: 28px;
|
|
324
|
-
line-height: 28px;
|
|
325
365
|
padding: 0 16px;
|
|
326
366
|
}
|
|
327
367
|
|
|
328
|
-
button
|
|
329
|
-
font-size:
|
|
368
|
+
:host(.kr-button--large) {
|
|
369
|
+
font-size: 16px;
|
|
330
370
|
height: 44px;
|
|
331
|
-
line-height: 44px;
|
|
332
371
|
padding: 0 24px;
|
|
372
|
+
border-radius: 30px;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* State colors */
|
|
376
|
+
:host(.kr-button--success) {
|
|
377
|
+
background: #198754 !important;
|
|
378
|
+
color: white !important;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
:host(.kr-button--error) {
|
|
382
|
+
background: rgb(220, 53, 69) !important;
|
|
383
|
+
color: white !important;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* Content */
|
|
387
|
+
:host(.kr-button--loading) slot,
|
|
388
|
+
:host(.kr-button--success) slot,
|
|
389
|
+
:host(.kr-button--error) slot {
|
|
390
|
+
visibility: hidden;
|
|
333
391
|
}
|
|
334
|
-
|
|
392
|
+
|
|
393
|
+
/* State overlay */
|
|
394
|
+
.state-overlay {
|
|
395
|
+
position: absolute;
|
|
396
|
+
inset: 0;
|
|
397
|
+
display: flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* Spinner */
|
|
403
|
+
@keyframes kr-spin {
|
|
404
|
+
to {
|
|
405
|
+
transform: rotate(360deg);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.spinner {
|
|
410
|
+
width: 12px;
|
|
411
|
+
height: 12px;
|
|
412
|
+
border: 2.5px solid currentColor;
|
|
413
|
+
border-top-color: transparent;
|
|
414
|
+
border-radius: 50%;
|
|
415
|
+
animation: kr-spin 0.6s linear infinite;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
:host(.kr-button--small) .spinner {
|
|
419
|
+
width: 10px;
|
|
420
|
+
height: 10px;
|
|
421
|
+
border-width: 2px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
:host(.kr-button--large) .spinner {
|
|
425
|
+
width: 16px;
|
|
426
|
+
height: 16px;
|
|
427
|
+
border-width: 3px;
|
|
428
|
+
}
|
|
429
|
+
`,Ee([pe({type:String,reflect:!0})],Se.prototype,"variant",void 0),Ee([pe({type:String,reflect:!0})],Se.prototype,"color",void 0),Ee([pe({type:String,reflect:!0})],Se.prototype,"size",void 0),Ee([pe({type:Boolean,reflect:!0})],Se.prototype,"disabled",void 0),Ee([ue()],Se.prototype,"_state",void 0),Ee([ue()],Se.prototype,"_stateText",void 0),Se=Ee([de("kr-button")],Se);
|
|
335
430
|
/**
|
|
336
431
|
* @license
|
|
337
432
|
* Copyright 2017 Google LLC
|
|
338
433
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
339
434
|
*/
|
|
340
|
-
class
|
|
435
|
+
class Ce extends xe{constructor(e){if(super(e),this.it=q,e.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===q||null==e)return this._t=void 0,this.it=e;if(e===N)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:[]}}}Ce.directiveName="unsafeHTML",Ce.resultType=1;const Te=ke(Ce);var Oe=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Pe=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 V`
|
|
341
436
|
<div class="tabs">
|
|
342
437
|
<button
|
|
343
|
-
class=${$
|
|
438
|
+
class=${$e({tab:!0,"tab--active":"preview"===this.activeTab})}
|
|
344
439
|
@click=${()=>this.setTab("preview")}
|
|
345
440
|
>
|
|
346
441
|
Preview
|
|
347
442
|
</button>
|
|
348
443
|
<button
|
|
349
|
-
class=${$
|
|
444
|
+
class=${$e({tab:!0,"tab--active":"code"===this.activeTab})}
|
|
350
445
|
@click=${()=>this.setTab("code")}
|
|
351
446
|
>
|
|
352
447
|
Code
|
|
353
448
|
</button>
|
|
354
449
|
</div>
|
|
355
450
|
|
|
356
|
-
<div class=${$
|
|
451
|
+
<div class=${$e({panel:!0,"panel--active":"preview"===this.activeTab,preview:!0})}>
|
|
357
452
|
<slot name="preview"></slot>
|
|
358
453
|
</div>
|
|
359
454
|
|
|
360
|
-
<div class=${$
|
|
455
|
+
<div class=${$e({panel:!0,"panel--active":"code"===this.activeTab,"code-container":!0})}>
|
|
361
456
|
<button
|
|
362
|
-
class=${$
|
|
457
|
+
class=${$e({"copy-btn":!0,"copy-btn--copied":this.copied})}
|
|
363
458
|
@click=${this.copyCode}
|
|
364
459
|
>
|
|
365
460
|
${this.copied?"Copied!":"Copy"}
|
|
366
461
|
</button>
|
|
367
|
-
<pre class="code"><code>${
|
|
462
|
+
<pre class="code"><code>${Te(this.getHighlightedCode())}</code></pre>
|
|
368
463
|
</div>
|
|
369
464
|
|
|
370
|
-
`}};
|
|
465
|
+
`}};Pe.styles=r`
|
|
371
466
|
:host {
|
|
372
467
|
display: block;
|
|
373
468
|
border: 1px solid #e9ecef;
|
|
374
469
|
border-radius: 8px;
|
|
375
|
-
overflow: hidden;
|
|
376
470
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
377
471
|
}
|
|
378
472
|
|
|
@@ -380,6 +474,7 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
380
474
|
display: flex;
|
|
381
475
|
background: #f8f9fa;
|
|
382
476
|
border-bottom: 1px solid #e9ecef;
|
|
477
|
+
border-radius: 8px 8px 0 0;
|
|
383
478
|
}
|
|
384
479
|
|
|
385
480
|
.tab {
|
|
@@ -439,6 +534,7 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
439
534
|
font-size: 13px;
|
|
440
535
|
line-height: 1.6;
|
|
441
536
|
color: #cdd6f4;
|
|
537
|
+
border-radius: 0 0 8px 8px;
|
|
442
538
|
}
|
|
443
539
|
|
|
444
540
|
.code code {
|
|
@@ -526,20 +622,20 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
526
622
|
.code .token.variable {
|
|
527
623
|
color: #fab387;
|
|
528
624
|
}
|
|
529
|
-
`,
|
|
625
|
+
`,Oe([pe({type:String})],Pe.prototype,"language",void 0),Oe([pe({type:String})],Pe.prototype,"code",void 0),Oe([ue()],Pe.prototype,"activeTab",void 0),Oe([ue()],Pe.prototype,"copied",void 0),Pe=Oe([de("kr-code-demo")],Pe);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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let ze=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 V`
|
|
530
626
|
<div class="menu">
|
|
531
|
-
${this.items.map(
|
|
627
|
+
${this.items.map(e=>e.divider?V`<div class="menu__divider"></div>`:V`
|
|
532
628
|
<button
|
|
533
629
|
class="menu__item"
|
|
534
|
-
?disabled=${
|
|
535
|
-
@click=${()=>this.handleItemClick(
|
|
630
|
+
?disabled=${e.disabled}
|
|
631
|
+
@click=${()=>this.handleItemClick(e)}
|
|
536
632
|
>
|
|
537
|
-
${
|
|
538
|
-
${
|
|
633
|
+
${e.icon?V`<span class="menu__item-icon">${e.icon}</span>`:null}
|
|
634
|
+
${e.label}
|
|
539
635
|
</button>
|
|
540
636
|
`)}
|
|
541
637
|
</div>
|
|
542
|
-
`}};
|
|
638
|
+
`}};ze.styles=r`
|
|
543
639
|
:host {
|
|
544
640
|
position: fixed;
|
|
545
641
|
z-index: 10000;
|
|
@@ -594,12 +690,12 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
594
690
|
background: rgba(255, 255, 255, 0.1);
|
|
595
691
|
margin: 4px 0;
|
|
596
692
|
}
|
|
597
|
-
`,
|
|
693
|
+
`,Re([ue()],ze.prototype,"items",void 0),ze=Re([de("kr-context-menu")],ze);var Le=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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 Me{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}}let je=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 Me,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 V`
|
|
598
694
|
<div class="backdrop" @click=${this.handleBackdropClick}></div>
|
|
599
695
|
<div class="dialog">
|
|
600
696
|
${this.contentElement}
|
|
601
697
|
</div>
|
|
602
|
-
`}};
|
|
698
|
+
`}};je.styles=r`
|
|
603
699
|
:host {
|
|
604
700
|
position: fixed;
|
|
605
701
|
inset: 0;
|
|
@@ -624,8 +720,8 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
624
720
|
max-height: 90vh;
|
|
625
721
|
overflow: auto;
|
|
626
722
|
}
|
|
627
|
-
`,
|
|
628
|
-
${
|
|
723
|
+
`,Le([ue()],je.prototype,"contentElement",void 0),je=Le([de("kr-dialog")],je);var De,Ie=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let He=De=class extends ne{constructor(){super(...arguments),this.dismissTimeout=null,this.type="info",this.title="",this.message="",this.duration=5e3}static show(e){const t=document.createElement("kr-snackbar");return t.message=e.message,t.title=e.title??"",t.type=e.type??"info",void 0!==e.duration?t.duration=e.duration:"error"===t.type?t.duration=0:t.duration=5e3,document.body.appendChild(t),t}connectedCallback(){super.connectedCallback(),this.setAttribute("role","alert"),this.classList.add(`kr-snackbar--${this.type}`),this.title&&this.classList.add("kr-snackbar--has-title"),De.activeSnackbars.push(this),this.updatePositions(),this.duration>0&&(this.dismissTimeout=window.setTimeout(()=>{this.dismiss()},this.duration))}disconnectedCallback(){super.disconnectedCallback();const e=De.activeSnackbars.indexOf(this);e>-1&&De.activeSnackbars.splice(e,1),this.updatePositions(),this.dismissTimeout&&clearTimeout(this.dismissTimeout)}updatePositions(){let e=24;for(const t of De.activeSnackbars)t.style.bottom=`${e}px`,e+=t.offsetHeight+8}dismiss(){this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.classList.add("kr-snackbar--closing"),this.addEventListener("animationend",()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0})),this.remove()},{once:!0})}render(){const e={info:V`<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:V`<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:V`<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:V`<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 V`
|
|
724
|
+
${e[this.type]}
|
|
629
725
|
<div class="content">
|
|
630
726
|
${this.title?V`<div class="title">${this.title}</div>`:""}
|
|
631
727
|
<div class="message">${this.message}</div>
|
|
@@ -640,7 +736,7 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
640
736
|
<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"/>
|
|
641
737
|
</svg>
|
|
642
738
|
</button>
|
|
643
|
-
`}};
|
|
739
|
+
`}};He.styles=r`
|
|
644
740
|
:host,
|
|
645
741
|
*,
|
|
646
742
|
*::before,
|
|
@@ -653,7 +749,7 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
653
749
|
left: 16px;
|
|
654
750
|
z-index: 10000;
|
|
655
751
|
display: flex;
|
|
656
|
-
align-items:
|
|
752
|
+
align-items: center;
|
|
657
753
|
gap: 12px;
|
|
658
754
|
padding: 14px 12px 14px 16px;
|
|
659
755
|
border-radius: 8px;
|
|
@@ -666,6 +762,10 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
666
762
|
animation: slideIn 0.2s ease-out;
|
|
667
763
|
}
|
|
668
764
|
|
|
765
|
+
:host(.kr-snackbar--has-title) {
|
|
766
|
+
align-items: flex-start;
|
|
767
|
+
}
|
|
768
|
+
|
|
669
769
|
@keyframes slideIn {
|
|
670
770
|
from {
|
|
671
771
|
opacity: 0;
|
|
@@ -783,18 +883,180 @@ class Et extends _t{constructor(t){if(super(t),this.it=q,t.type!==gt)throw Error
|
|
|
783
883
|
outline: 2px solid #3b82f6;
|
|
784
884
|
outline-offset: 2px;
|
|
785
885
|
}
|
|
786
|
-
`,
|
|
886
|
+
`,He.activeSnackbars=[],Ie([pe({type:String})],He.prototype,"type",void 0),Ie([pe({type:String})],He.prototype,"title",void 0),Ie([pe({type:String})],He.prototype,"message",void 0),Ie([pe({type:Number})],He.prototype,"duration",void 0),He=De=Ie([de("kr-snackbar")],He);
|
|
787
887
|
/**
|
|
788
888
|
* @license
|
|
789
|
-
* Copyright
|
|
889
|
+
* Copyright 2018 Google LLC
|
|
890
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
891
|
+
*/
|
|
892
|
+
const Ue="important",Be=" !"+Ue,Ve=ke(class extends xe{constructor(e){if(super(e),e.type!==ve||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,i)=>{const o=e[i];return null==o?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const o=t[e];if(null!=o){this.ft.add(e);const t="string"==typeof o&&o.endsWith(Be);e.includes("-")||t?i.setProperty(e,t?o.slice(0,-11):o,t?Ue:""):i[e]=o}}return N}});var Ne=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let qe=class extends ne{updated(e){e.has("activeTabId")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll("kr-tab"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach(e=>{e.active=e.id===this.activeTabId}),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("tab-dismiss",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter(e=>!e.disabled),i=t.findIndex(e=>e.id===this.activeTabId);let o=-1;switch(e.key){case"ArrowLeft":o=i>0?i-1:t.length-1;break;case"ArrowRight":o=i<t.length-1?i+1:0;break;case"Home":o=0;break;case"End":o=t.length-1}if(o>=0){e.preventDefault();const i=t[o];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent("tab-change",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const s=this.shadowRoot?.querySelectorAll(".label"),r=Array.from(s||[]).find(e=>e.getAttribute("data-tab-id")===i.id);r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return q;const i=t.cloneNode(!0);return i.removeAttribute("slot"),V`<span class="label-icon">${i}</span>`}render(){return V`
|
|
893
|
+
<div class="header" role="tablist" @keydown=${this._handleKeyDown}>
|
|
894
|
+
${this._getTabs().map(e=>V`
|
|
895
|
+
<button
|
|
896
|
+
class=${$e({label:!0,"label--active":e.id===this.activeTabId})}
|
|
897
|
+
role="tab"
|
|
898
|
+
data-tab-id=${e.id}
|
|
899
|
+
aria-selected=${e.id===this.activeTabId}
|
|
900
|
+
aria-controls=${`panel-${e.id}`}
|
|
901
|
+
tabindex=${e.id===this.activeTabId?0:-1}
|
|
902
|
+
?disabled=${e.disabled}
|
|
903
|
+
@click=${()=>this._handleTabClick(e)}
|
|
904
|
+
>
|
|
905
|
+
${this._renderTabIcon(e)}
|
|
906
|
+
<span>${e.title}</span>
|
|
907
|
+
${e.badge?V`<span class="label-badge" style=${Ve({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:q}
|
|
908
|
+
${e.dismissible?V`
|
|
909
|
+
<button
|
|
910
|
+
class="label-dismiss"
|
|
911
|
+
type="button"
|
|
912
|
+
aria-label="Close tab"
|
|
913
|
+
@click=${t=>this._handleTabDismiss(e,t)}
|
|
914
|
+
>
|
|
915
|
+
<svg viewBox="0 0 20 20" fill="currentColor" width="12" height="12"><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"/></svg>
|
|
916
|
+
</button>
|
|
917
|
+
`:q}
|
|
918
|
+
</button>
|
|
919
|
+
`)}
|
|
920
|
+
</div>
|
|
921
|
+
<div class="content" role="tabpanel" aria-labelledby=${this.activeTabId||""}>
|
|
922
|
+
<slot @slotchange=${this._updateActiveTab}></slot>
|
|
923
|
+
</div>
|
|
924
|
+
`}};qe.styles=[le,r`
|
|
925
|
+
:host {
|
|
926
|
+
display: flex;
|
|
927
|
+
flex-direction: column;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.header {
|
|
931
|
+
display: flex;
|
|
932
|
+
align-items: stretch;
|
|
933
|
+
border-bottom: 1px solid var(--kr-border);
|
|
934
|
+
overflow-x: auto;
|
|
935
|
+
scrollbar-width: none;
|
|
936
|
+
-ms-overflow-style: none;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.header::-webkit-scrollbar {
|
|
940
|
+
display: none;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.label {
|
|
944
|
+
position: relative;
|
|
945
|
+
display: flex;
|
|
946
|
+
align-items: center;
|
|
947
|
+
gap: 8px;
|
|
948
|
+
padding: 12px 16px;
|
|
949
|
+
font-family: inherit;
|
|
950
|
+
font-size: 14px;
|
|
951
|
+
font-weight: 500;
|
|
952
|
+
color: var(--kr-text-muted);
|
|
953
|
+
background: none;
|
|
954
|
+
border: none;
|
|
955
|
+
border-bottom: 2px solid transparent;
|
|
956
|
+
cursor: pointer;
|
|
957
|
+
transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
|
|
958
|
+
white-space: nowrap;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.label:hover:not(:disabled) {
|
|
962
|
+
color: var(--kr-text);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.label:focus-visible {
|
|
966
|
+
outline: 2px solid var(--kr-focus);
|
|
967
|
+
outline-offset: -2px;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.label--active {
|
|
971
|
+
color: var(--kr-primary);
|
|
972
|
+
border-bottom-color: var(--kr-primary);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.label:disabled {
|
|
976
|
+
color: var(--kr-text-disabled);
|
|
977
|
+
cursor: not-allowed;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.label-icon {
|
|
981
|
+
display: flex;
|
|
982
|
+
align-items: center;
|
|
983
|
+
justify-content: center;
|
|
984
|
+
flex-shrink: 0;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
.label-badge {
|
|
988
|
+
font-size: 11px;
|
|
989
|
+
font-weight: 500;
|
|
990
|
+
color: var(--kr-primary-text);
|
|
991
|
+
background-color: var(--kr-primary);
|
|
992
|
+
padding: 2px 8px;
|
|
993
|
+
border-radius: 10px;
|
|
994
|
+
margin-left: 4px;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.label-dismiss {
|
|
998
|
+
display: flex;
|
|
999
|
+
align-items: center;
|
|
1000
|
+
justify-content: center;
|
|
1001
|
+
width: 16px;
|
|
1002
|
+
height: 16px;
|
|
1003
|
+
margin-left: 4px;
|
|
1004
|
+
padding: 0;
|
|
1005
|
+
background: none;
|
|
1006
|
+
border: none;
|
|
1007
|
+
border-radius: 2px;
|
|
1008
|
+
color: var(--kr-text-muted);
|
|
1009
|
+
cursor: pointer;
|
|
1010
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.label-dismiss:hover {
|
|
1014
|
+
background-color: var(--kr-border);
|
|
1015
|
+
color: var(--kr-text);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.label-dismiss:focus-visible {
|
|
1019
|
+
outline: 2px solid var(--kr-focus);
|
|
1020
|
+
outline-offset: 2px;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
.content {
|
|
1024
|
+
padding: 16px;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/* Default slot styles - kr-tab children show/hide via their own active attribute */
|
|
1028
|
+
::slotted(kr-tab) {
|
|
1029
|
+
display: none;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
::slotted(kr-tab[active]) {
|
|
1033
|
+
display: block;
|
|
1034
|
+
}
|
|
1035
|
+
`],Ne([pe({type:String,attribute:"active-tab-id"})],qe.prototype,"activeTabId",void 0),qe=Ne([de("kr-tab-group")],qe);var Ke=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Fe=class extends ne{constructor(){super(...arguments),this.id="",this.title="",this.badge="",this.badgeBackground="",this.badgeColor="",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot="icon"]')}render(){return V`<slot></slot>`}};Fe.styles=[le,r`
|
|
1036
|
+
:host {
|
|
1037
|
+
display: none;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
:host([active]) {
|
|
1041
|
+
display: block;
|
|
1042
|
+
}
|
|
1043
|
+
`],Ke([pe({type:String,reflect:!0})],Fe.prototype,"id",void 0),Ke([pe({type:String})],Fe.prototype,"title",void 0),Ke([pe({type:String})],Fe.prototype,"badge",void 0),Ke([pe({type:String,attribute:"badge-background"})],Fe.prototype,"badgeBackground",void 0),Ke([pe({type:String,attribute:"badge-color"})],Fe.prototype,"badgeColor",void 0),Ke([pe({type:Boolean})],Fe.prototype,"disabled",void 0),Ke([pe({type:Boolean})],Fe.prototype,"dismissible",void 0),Ke([pe({type:Boolean,reflect:!0})],Fe.prototype,"active",void 0),Fe=Ke([de("kr-tab")],Fe);
|
|
1044
|
+
/**
|
|
1045
|
+
* @license
|
|
1046
|
+
* Copyright 2018 Google LLC
|
|
790
1047
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
791
1048
|
*/
|
|
792
|
-
const
|
|
1049
|
+
const We=e=>e??q,Xe={},Ze=ke(class extends xe{constructor(e){if(super(e),e.type!==me&&e.type!==ve&&e.type!==_e)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===N||t===q)return t;const i=e.element,o=e.name;if(e.type===me){if(t===i[o])return N}else if(e.type===_e){if(!!t===i.hasAttribute(o))return N}else if(e.type===ve&&i.getAttribute(o)===t+"")return N;return((e,t=Xe)=>{e._$AH=t;
|
|
793
1050
|
/**
|
|
794
1051
|
* @license
|
|
795
1052
|
* Copyright 2020 Google LLC
|
|
796
1053
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
797
|
-
*/})(
|
|
1054
|
+
*/})(e),t}});
|
|
1055
|
+
/**
|
|
1056
|
+
* @license
|
|
1057
|
+
* Copyright 2020 Google LLC
|
|
1058
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1059
|
+
*/var Je=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Ge=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._handleInvalid=e=>{e.preventDefault(),this._touched=!0},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}connectedCallback(){super.connectedCallback(),this.addEventListener("invalid",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_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)}render(){let e="";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),V`
|
|
798
1060
|
<div class="wrapper">
|
|
799
1061
|
${this.label?V`
|
|
800
1062
|
<label for="input">
|
|
@@ -804,24 +1066,25 @@ const Ut={},Dt=yt(class extends _t{constructor(t){if(super(t),t.type!==vt&&t.typ
|
|
|
804
1066
|
`:""}
|
|
805
1067
|
<input
|
|
806
1068
|
id="input"
|
|
1069
|
+
class=${$e({"input--invalid":this._touched&&this._input&&!this._input.validity.valid})}
|
|
807
1070
|
type=${this.type}
|
|
808
1071
|
name=${this.name}
|
|
809
|
-
.value=${
|
|
1072
|
+
.value=${Ze(this.value)}
|
|
810
1073
|
placeholder=${this.placeholder}
|
|
811
1074
|
?required=${this.required}
|
|
812
1075
|
?disabled=${this.disabled}
|
|
813
1076
|
?readonly=${this.readonly}
|
|
814
|
-
minlength=${this.minlength
|
|
815
|
-
maxlength=${this.maxlength
|
|
816
|
-
pattern=${this.pattern
|
|
817
|
-
autocomplete=${this.autocomplete}
|
|
1077
|
+
minlength=${We(this.minlength)}
|
|
1078
|
+
maxlength=${We(this.maxlength)}
|
|
1079
|
+
pattern=${We(this.pattern)}
|
|
1080
|
+
autocomplete=${We(this.autocomplete||void 0)}
|
|
818
1081
|
@input=${this._handleInput}
|
|
819
1082
|
@change=${this._handleChange}
|
|
820
1083
|
@blur=${this._handleBlur}
|
|
821
1084
|
/>
|
|
822
|
-
${
|
|
1085
|
+
${e?V`<div class="validation-message">${e}</div>`:this.hint?V`<div class="hint">${this.hint}</div>`:""}
|
|
823
1086
|
</div>
|
|
824
|
-
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}};
|
|
1087
|
+
`}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}};Ge.styles=r`
|
|
825
1088
|
:host {
|
|
826
1089
|
display: block;
|
|
827
1090
|
font-family: inherit;
|
|
@@ -871,11 +1134,11 @@ const Ut={},Dt=yt(class extends _t{constructor(t){if(super(t),t.type!==vt&&t.typ
|
|
|
871
1134
|
color: var(--kr-text-field-placeholder-color, #9ca3af);
|
|
872
1135
|
}
|
|
873
1136
|
|
|
874
|
-
|
|
1137
|
+
input.input--invalid {
|
|
875
1138
|
border-color: var(--kr-text-field-error-border-color, #ef4444);
|
|
876
1139
|
}
|
|
877
1140
|
|
|
878
|
-
|
|
1141
|
+
input.input--invalid:focus {
|
|
879
1142
|
box-shadow: 0 0 0 3px var(--kr-text-field-error-ring-color, rgba(239, 68, 68, 0.1));
|
|
880
1143
|
}
|
|
881
1144
|
|
|
@@ -888,11 +1151,249 @@ const Ut={},Dt=yt(class extends _t{constructor(t){if(super(t),t.type!==vt&&t.typ
|
|
|
888
1151
|
font-size: 0.75rem;
|
|
889
1152
|
color: var(--kr-text-field-helper-color, #6b7280);
|
|
890
1153
|
}
|
|
891
|
-
`,
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1154
|
+
`,Ge.formAssociated=!0,Je([pe({type:String})],Ge.prototype,"label",void 0),Je([pe({type:String})],Ge.prototype,"name",void 0),Je([pe({type:String})],Ge.prototype,"value",void 0),Je([pe({type:String})],Ge.prototype,"placeholder",void 0),Je([pe({type:String})],Ge.prototype,"type",void 0),Je([pe({type:Boolean})],Ge.prototype,"required",void 0),Je([pe({type:Boolean})],Ge.prototype,"disabled",void 0),Je([pe({type:Boolean})],Ge.prototype,"readonly",void 0),Je([pe({type:Number})],Ge.prototype,"minlength",void 0),Je([pe({type:Number})],Ge.prototype,"maxlength",void 0),Je([pe({type:String})],Ge.prototype,"pattern",void 0),Je([pe({type:String})],Ge.prototype,"autocomplete",void 0),Je([pe({type:String})],Ge.prototype,"hint",void 0),Je([be("input")],Ge.prototype,"_input",void 0),Je([ue()],Ge.prototype,"_touched",void 0),Je([ue()],Ge.prototype,"_dirty",void 0),Ge=Je([de("kr-text-field")],Ge);var Qe=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let Ye=class extends ne{constructor(){super(),this.label="",this.name="",this.value="",this.placeholder="Select an option",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint="",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{this.contains(e.target)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll("kr-select-option"));switch(e.key){case"Escape":this._close(),this._triggerElement?.focus();break;case"ArrowDown":if(e.preventDefault(),t.some(e=>!e.disabled)){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case"ArrowUp":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case"Enter":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},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._internals.setFormValue(""),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick),document.addEventListener("keydown",this._handleKeyDown),this.addEventListener("invalid",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has("required")||e.has("value"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick),document.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("invalid",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll("kr-select-option"));this._highlightedIndex=e.findIndex(e=>e.value===this.value)}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},"Please select an option",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll("kr-select-option")),t=e.find(e=>e.value===this.value)?.label;return V`
|
|
1155
|
+
<div class="wrapper">
|
|
1156
|
+
${this.label?V`
|
|
1157
|
+
<label>
|
|
1158
|
+
${this.label}
|
|
1159
|
+
${this.required?V`<span class="required" aria-hidden="true">*</span>`:""}
|
|
1160
|
+
</label>
|
|
1161
|
+
`:q}
|
|
1162
|
+
<div class="select-wrapper">
|
|
1163
|
+
<button
|
|
1164
|
+
class=${$e({"select-trigger":!0,"select-trigger--open":this._isOpen,"select-trigger--invalid":this._touched&&this.required&&!this.value})}
|
|
1165
|
+
type="button"
|
|
1166
|
+
?disabled=${this.disabled}
|
|
1167
|
+
aria-haspopup="listbox"
|
|
1168
|
+
aria-expanded=${this._isOpen}
|
|
1169
|
+
@click=${this._toggle}
|
|
1170
|
+
@blur=${this._handleBlur}
|
|
1171
|
+
>
|
|
1172
|
+
<span class=${$e({"select-value":!0,"select-placeholder":!t})}>
|
|
1173
|
+
${t||this.placeholder}
|
|
1174
|
+
</span>
|
|
1175
|
+
<svg
|
|
1176
|
+
class=${$e({"chevron-icon":!0,"select-icon":!0,"select-icon--open":this._isOpen})}
|
|
1177
|
+
viewBox="0 0 20 20"
|
|
1178
|
+
fill="currentColor"
|
|
1179
|
+
>
|
|
1180
|
+
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
|
1181
|
+
</svg>
|
|
1182
|
+
</button>
|
|
1183
|
+
|
|
1184
|
+
<div class=${$e({"select-dropdown":!0,hidden:!this._isOpen})} role="listbox">
|
|
1185
|
+
<div class="select-options">
|
|
1186
|
+
${0===e.length?V`<div class="select-empty">No options available</div>`:e.map((e,t)=>{const i=e.value===this.value;return V`
|
|
1187
|
+
<div
|
|
1188
|
+
class=${$e({"select-option":!0,"select-option--selected":i,"select-option--disabled":e.disabled,"select-option--highlighted":t===this._highlightedIndex})}
|
|
1189
|
+
role="option"
|
|
1190
|
+
aria-selected=${i}
|
|
1191
|
+
@click=${()=>this._selectOption(e)}
|
|
1192
|
+
@mouseenter=${()=>this._highlightedIndex=t}
|
|
1193
|
+
>
|
|
1194
|
+
${e.label}
|
|
1195
|
+
${i?V`<svg class="chevron-icon select-check" viewBox="0 0 20 20" fill="currentColor">
|
|
1196
|
+
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
|
|
1197
|
+
</svg>`:q}
|
|
1198
|
+
</div>
|
|
1199
|
+
`})}
|
|
1200
|
+
</div>
|
|
1201
|
+
</div>
|
|
1202
|
+
</div>
|
|
1203
|
+
${this._touched&&this.required&&!this.value?V`<div class="validation-message">Please select an option</div>`:this.hint?V`<div class="hint">${this.hint}</div>`:""}
|
|
1204
|
+
</div>
|
|
1205
|
+
<div class="options-slot">
|
|
1206
|
+
<slot @slotchange=${()=>this.requestUpdate()}></slot>
|
|
1207
|
+
</div>
|
|
1208
|
+
`}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}};Ye.styles=r`
|
|
1209
|
+
:host {
|
|
1210
|
+
display: block;
|
|
1211
|
+
font-family: inherit;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.wrapper {
|
|
1215
|
+
display: flex;
|
|
1216
|
+
flex-direction: column;
|
|
1217
|
+
gap: 0.25rem;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
label {
|
|
1221
|
+
font-size: 13px;
|
|
1222
|
+
font-weight: 500;
|
|
1223
|
+
color: var(--kr-select-label-color, #374151);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.required {
|
|
1227
|
+
color: var(--kr-select-required-color, #ef4444);
|
|
1228
|
+
margin-left: 0.125rem;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
.select-wrapper {
|
|
1232
|
+
position: relative;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.select-trigger {
|
|
1236
|
+
display: flex;
|
|
1237
|
+
align-items: center;
|
|
1238
|
+
justify-content: space-between;
|
|
1239
|
+
width: 100%;
|
|
1240
|
+
padding: 0.5rem 0.75rem;
|
|
1241
|
+
font-family: inherit;
|
|
1242
|
+
font-size: 14px;
|
|
1243
|
+
line-height: 1.5;
|
|
1244
|
+
color: var(--kr-select-color, #111827);
|
|
1245
|
+
background-color: var(--kr-select-bg, #fff);
|
|
1246
|
+
border: 1px solid var(--kr-select-border-color, #d1d5db);
|
|
1247
|
+
border-radius: 4px;
|
|
1248
|
+
cursor: pointer;
|
|
1249
|
+
transition: border-color 0.2s, box-shadow 0.2s;
|
|
1250
|
+
text-align: left;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
.select-trigger:hover:not(:disabled) {
|
|
1254
|
+
border-color: var(--kr-select-hover-border-color, #9ca3af);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
.select-trigger:focus {
|
|
1258
|
+
outline: none;
|
|
1259
|
+
border-color: var(--kr-select-focus-border-color, #2563eb);
|
|
1260
|
+
box-shadow: 0 0 0 3px var(--kr-select-focus-ring-color, rgba(37, 99, 235, 0.1));
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.select-trigger:disabled {
|
|
1264
|
+
background-color: var(--kr-select-disabled-bg, #f3f4f6);
|
|
1265
|
+
color: var(--kr-select-disabled-color, #9ca3af);
|
|
1266
|
+
cursor: not-allowed;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.select-trigger--invalid {
|
|
1270
|
+
border-color: var(--kr-select-error-border-color, #ef4444);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.select-trigger--invalid:focus {
|
|
1274
|
+
border-color: var(--kr-select-error-border-color, #ef4444);
|
|
1275
|
+
box-shadow: 0 0 0 3px var(--kr-select-error-ring-color, rgba(239, 68, 68, 0.1));
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.select-trigger--open {
|
|
1279
|
+
border-color: var(--kr-select-focus-border-color, #2563eb);
|
|
1280
|
+
box-shadow: 0 0 0 3px var(--kr-select-focus-ring-color, rgba(37, 99, 235, 0.1));
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.select-value {
|
|
1284
|
+
flex: 1;
|
|
1285
|
+
overflow: hidden;
|
|
1286
|
+
text-overflow: ellipsis;
|
|
1287
|
+
white-space: nowrap;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
.select-placeholder {
|
|
1291
|
+
color: var(--kr-select-placeholder-color, #9ca3af);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.select-icon {
|
|
1295
|
+
flex-shrink: 0;
|
|
1296
|
+
margin-left: 0.5rem;
|
|
1297
|
+
color: var(--kr-select-icon-color, #6b7280);
|
|
1298
|
+
transition: transform 0.2s;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.select-icon--open {
|
|
1302
|
+
transform: rotate(180deg);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
.select-dropdown {
|
|
1306
|
+
position: absolute;
|
|
1307
|
+
top: 100%;
|
|
1308
|
+
left: 0;
|
|
1309
|
+
right: 0;
|
|
1310
|
+
z-index: 50;
|
|
1311
|
+
margin-top: 0.25rem;
|
|
1312
|
+
background-color: var(--kr-select-dropdown-bg, #fff);
|
|
1313
|
+
border: 1px solid var(--kr-select-dropdown-border-color, #e5e7eb);
|
|
1314
|
+
border-radius: 4px;
|
|
1315
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
1316
|
+
max-height: 300px;
|
|
1317
|
+
overflow-y: auto;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
.select-options {
|
|
1321
|
+
padding: 0.25rem;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.select-option {
|
|
1325
|
+
display: flex;
|
|
1326
|
+
align-items: center;
|
|
1327
|
+
gap: 0.5rem;
|
|
1328
|
+
padding: 0.5rem 0.75rem;
|
|
1329
|
+
font-size: 14px;
|
|
1330
|
+
color: var(--kr-select-option-color, #111827);
|
|
1331
|
+
cursor: pointer;
|
|
1332
|
+
border-radius: 4px;
|
|
1333
|
+
transition: background-color 0.15s;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
.select-option:hover:not(.select-option--disabled) {
|
|
1337
|
+
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.select-option--selected {
|
|
1341
|
+
background-color: var(--kr-select-option-selected-bg, #eff6ff);
|
|
1342
|
+
color: var(--kr-select-option-selected-color, #1d4ed8);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.select-option--selected:hover {
|
|
1346
|
+
background-color: var(--kr-select-option-selected-hover-bg, #dbeafe);
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
.select-option--disabled {
|
|
1350
|
+
color: var(--kr-select-option-disabled-color, #9ca3af);
|
|
1351
|
+
cursor: not-allowed;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.select-option--highlighted {
|
|
1355
|
+
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
.select-empty {
|
|
1359
|
+
padding: 1rem;
|
|
1360
|
+
text-align: center;
|
|
1361
|
+
color: var(--kr-select-empty-color, #6b7280);
|
|
1362
|
+
font-size: 14px;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
.select-check {
|
|
1366
|
+
color: var(--kr-select-check-color, #2563eb);
|
|
1367
|
+
flex-shrink: 0;
|
|
1368
|
+
margin-left: auto;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.hint {
|
|
1372
|
+
font-size: 0.75rem;
|
|
1373
|
+
color: var(--kr-select-helper-color, #6b7280);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.validation-message {
|
|
1377
|
+
font-size: 0.75rem;
|
|
1378
|
+
color: var(--kr-select-error-color, #ef4444);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.hidden {
|
|
1382
|
+
display: none;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.chevron-icon {
|
|
1386
|
+
width: 16px;
|
|
1387
|
+
height: 16px;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/* Hide the slot - options are rendered in dropdown */
|
|
1391
|
+
.options-slot {
|
|
1392
|
+
display: none;
|
|
1393
|
+
}
|
|
1394
|
+
`,Ye.formAssociated=!0,Qe([pe({type:String})],Ye.prototype,"label",void 0),Qe([pe({type:String})],Ye.prototype,"name",void 0),Qe([pe({type:String})],Ye.prototype,"value",void 0),Qe([pe({type:String})],Ye.prototype,"placeholder",void 0),Qe([pe({type:Boolean})],Ye.prototype,"disabled",void 0),Qe([pe({type:Boolean})],Ye.prototype,"required",void 0),Qe([pe({type:Boolean})],Ye.prototype,"readonly",void 0),Qe([pe({type:String})],Ye.prototype,"hint",void 0),Qe([ue()],Ye.prototype,"_isOpen",void 0),Qe([ue()],Ye.prototype,"_highlightedIndex",void 0),Qe([ue()],Ye.prototype,"_touched",void 0),Qe([be(".select-trigger")],Ye.prototype,"_triggerElement",void 0),Ye=Qe([de("kr-select")],Ye);var et=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 a=e.length-1;a>=0;a--)(s=e[a])&&(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};let tt=class extends ne{constructor(){super(...arguments),this.value="",this.disabled=!1}get label(){return this.textContent?.trim()||""}render(){return V`<slot></slot>`}};tt.styles=r`
|
|
1395
|
+
:host {
|
|
1396
|
+
display: none;
|
|
1397
|
+
}
|
|
1398
|
+
`,et([pe({type:String})],tt.prototype,"value",void 0),et([pe({type:Boolean})],tt.prototype,"disabled",void 0),tt=et([de("kr-select-option")],tt);export{Me as DialogRef,ge as KRAccordion,Ae as KRAlert,Se as KRButton,Pe as KRCodeDemo,ze as KRContextMenu,je as KRDialog,Ye as KRSelect,tt as KRSelectOption,He as KRSnackbar,Fe as KRTab,qe as KRTabGroup,Ge as KRTextField,le as krBaseCSS};
|
|
898
1399
|
//# sourceMappingURL=krubble.bundled.min.js.map
|