@kelvininc/ui-components
Version:
Kelvin UI Components
64 lines (60 loc) • 3.42 kB
JavaScript
import { p as proxyCustomElement, H, d as createEvent, h, e as Host } from './p-D6GMjtmE.js';
import { a as EComponentSize } from './p-BRgmvbuh.js';
import { d as defineCustomElement$2 } from './p-CsQJZTqg.js';
import { d as defineCustomElement$1 } from './p-B41PGLQm.js';
const actionButtonTextCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}:host{--button-icon-width:16px;--button-icon-height:16px}kv-icon{--icon-width:var(--button-icon-width);--icon-height:var(--button-icon-width);margin-right:var(--kv-spacing-2x, 8px)}.action-button-text{white-space:nowrap}kv-action-button[size=large] .action-button-text{font-family:var(--kv-primary-font, \"proxima-nova\", sans-serif, \"Arial\");font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:21px;letter-spacing:normal;text-transform:none}kv-action-button[size=small] .action-button-text{font-family:var(--kv-primary-font, \"proxima-nova\", sans-serif, \"Arial\");font-size:12px;font-weight:600;font-stretch:normal;font-style:normal;line-height:18px;letter-spacing:normal;text-transform:none}";
const KvActionButtonText = /*@__PURE__*/ proxyCustomElement(class KvActionButtonText extends H {
constructor() {
super();
this.__registerHost();
this.__attachShadow();
this.clickButton = createEvent(this, "clickButton", 7);
this.focusButton = createEvent(this, "focusButton", 7);
this.blurButton = createEvent(this, "blurButton", 7);
/** @inheritdoc */
this.disabled = false;
/** @inheritdoc */
this.active = false;
/** @inheritdoc */
this.loading = false;
/** @inheritdoc */
this.size = EComponentSize.Large;
}
render() {
return (h(Host, { key: 'b47d2526a0fbf3582fc6c1b19b44ea8edfe78b4e' }, h("kv-action-button", { key: '9f84ac33f8ea003b94d866e321183458b2045335', active: this.active, loading: this.loading, type: this.type, disabled: this.disabled, size: this.size, exportparts: "button" }, this.icon && h("kv-icon", { key: '4d121624e8572d8d3c3cae37513a138d8844086a', name: this.icon, exportparts: "icon" }), h("span", { key: '0b9c9fa2a02df17e3aa317281c9055cff614175e', class: "action-button-text", part: "button-text" }, this.text))));
}
static get style() { return actionButtonTextCss; }
}, [1, "kv-action-button-text", {
"text": [513],
"icon": [513],
"type": [513],
"disabled": [516],
"active": [516],
"loading": [516],
"size": [513]
}]);
function defineCustomElement() {
if (typeof customElements === "undefined") {
return;
}
const components = ["kv-action-button-text", "kv-action-button", "kv-icon"];
components.forEach(tagName => { switch (tagName) {
case "kv-action-button-text":
if (!customElements.get(tagName)) {
customElements.define(tagName, KvActionButtonText);
}
break;
case "kv-action-button":
if (!customElements.get(tagName)) {
defineCustomElement$2();
}
break;
case "kv-icon":
if (!customElements.get(tagName)) {
defineCustomElement$1();
}
break;
} });
}
defineCustomElement();
export { KvActionButtonText as K, defineCustomElement as d };