UNPKG

@kelvininc/ui-components

Version:
38 lines (33 loc) 3.13 kB
'use strict'; var index = require('./index-DpuMIXDY.js'); var components = require('./components-D2lyDQ_a.js'); require('./lib-config-QLtHwxiM.js'); var isEmpty = require('./isEmpty-C_HQvGy-.js'); require('./_Set-BIUoGFN6.js'); require('./_Map-DiT24PAz.js'); require('./isObject-COPdF2vE.js'); const actionButtonIconCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}:host{--button-size-large:36px;--button-size-small:28px;--button-icon-large-width:24px;--button-icon-large-height:24px;--button-icon-small-height:20px;--button-icon-small-width:20px;position:relative}.action-button-icon--size-large kv-action-button::part(button){width:var(--button-size-large)}.action-button-icon--size-large kv-icon{--icon-width:var(--button-icon-large-width);--icon-height:var(--button-icon-large-height)}.action-button-icon--size-small kv-action-button::part(button){width:var(--button-size-small)}.action-button-icon--size-small kv-icon{--icon-width:var(--button-icon-small-width);--icon-height:var(--button-icon-small-height)}kv-action-button{--background-color-active-tertiary:var(--kv-neutral-5, #707070);--border-color-active-tertiary:var(--kv-neutral-4, #bebebe);--text-color-active-tertiary:var(--kv-neutral-4, #bebebe);--button-padding-x-small:0;--button-height-large:var(--button-size-large);--button-height-small:var(--button-size-small);display:flex}kv-action-button::part(button){justify-content:center}.button-badge{position:absolute;z-index:1;top:-5px;right:-5px}"; const KvActionButtonIcon = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.clickButton = index.createEvent(this, "clickButton", 7); this.focusButton = index.createEvent(this, "focusButton", 7); this.blurButton = index.createEvent(this, "blurButton", 7); /** @inheritdoc */ this.disabled = false; /** @inheritdoc */ this.active = false; /** @inheritdoc */ this.loading = false; /** @inheritdoc */ this.size = components.EComponentSize.Small; } render() { return (index.h(index.Host, { key: '25dbc3f7db60a9da257979cc7282d23cbd5a7cdd' }, index.h("div", { key: '1b8e9ce8e9592f88e65e65dbe99e845befdd1359', class: { 'action-button-icon': true, [`action-button-icon--size-${this.size}`]: true } }, index.h("kv-action-button", { key: '1e36e61292a0c4d82a3df7fe0f477c13ee4874af', type: this.type, active: this.active, loading: this.loading, size: this.size, disabled: this.disabled, exportparts: "button" }, index.h("kv-icon", { key: '8ea12e905429bd969581935046dc8bbf5aa7f89f', name: this.icon, exportparts: "icon" }), !isEmpty.isEmpty(this.badgeLabel) && (index.h("div", { key: '0bcf0b5bef891aaa284b01df38a3cfd346428dcf', class: "button-badge", exportparts: "badge" }, index.h("kv-badge", { key: 'd4abe78228d53bca4a7bade95f2d6de67712d9b1', state: this.badgeState }, this.badgeLabel))))))); } }; KvActionButtonIcon.style = actionButtonIconCss; exports.kv_action_button_icon = KvActionButtonIcon;