UNPKG

@kelvininc/ui-components

Version:
70 lines (66 loc) 3.87 kB
import { H as proxyCustomElement, I as H, J as createEvent, e as EComponentSize, K as h, L as Host } from './p-BP5CxQcH.js'; import { d as defineCustomElement$2 } from './p-0XA6IHyr.js'; import { d as defineCustomElement$1 } from './p-DQ7v6WT-.js'; import { i as isEmpty } from './p-BZNGlO8m.js'; const actionButtonTextCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}kv-action-button[type=text]{--button-height-large:16px;--button-height-small:16px;--button-padding-x-large:none;--button-padding-y-large:none;--button-padding-x-small:none;--button-padding-y-small:none}.action-button-text{white-space:nowrap;font-family:Proxima Nova;font-weight:600;font-size:14px;line-height:20px;letter-spacing:0}.action-button-text--type-text{font-family:Proxima Nova;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0}.action-button-text--type-text.action-button-text--active,.action-button-text--type-text:hover:not(.action-button-text--disabled){font-family:Proxima Nova;font-weight:600;font-size:14px;line-height:20px;letter-spacing:0}"; 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: '53629f03126894b16733ad9a76b6e5f8a5bca049' }, h("kv-action-button", { key: 'cfb2cbbe3d02ecee82cc8bee00958e34efe004ec', active: this.active, loading: this.loading, type: this.type, disabled: this.disabled, size: this.size, exportparts: "button" }, this.icon && h("kv-icon", { key: 'b9c4df734e4458cae7b412d6e483c4c559017ddc', name: this.icon, exportparts: "icon" }), !isEmpty(this.text) && (h("span", { key: '62e671cc9ad0d90196c5462cc19264a0d8733ba2', class: { 'action-button-text': true, 'action-button-text--disabled': this.disabled, 'action-button-text--active': this.active, [`action-button-text--type-${this.type}`]: true }, part: "button-text" }, this.text)), this.rightIcon && h("kv-icon", { key: '0d2e1dac1a4950989c4b0fc49a6a4ec073753aad', name: this.rightIcon, exportparts: "icon" })))); } static get style() { return actionButtonTextCss; } }, [257, "kv-action-button-text", { "text": [513], "icon": [513], "rightIcon": [513, "right-icon"], "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 };