UNPKG

@kelvininc/ui-components

Version:
41 lines (36 loc) 3.91 kB
import { r as registerInstance, h, H as Host } from './index-D-JVwta2.js'; import { E as EIconName } from './icon.types-SVedE_O8.js'; import { f as EAlertType } from './absolute-time-picker-dropdown.types-CojoW2Y2.js'; import { a as EComponentSize } from './components-DzZLIMy0.js'; import './lib-config-DwRzddFC.js'; import './action-button.types-DVds6a5Z.js'; import './summary-card.types-BcMhjKoS.js'; import './toaster.types-vhHhaF4Q.js'; import './tree-item.types-CBuzk8fR.js'; import './tag-alarm.types-DHk26cGe.js'; import './wizard.types-7ioMFMb5.js'; const ALERT_ICON_NAMES = { [EAlertType.Info]: EIconName.Error, [EAlertType.Error]: EIconName.Error, [EAlertType.Success]: EIconName.Success, [EAlertType.Warning]: EIconName.Warning }; const alertCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}.alert-container{background-color:#fff}.alert{display:flex;padding:var(--kv-spacing-4x, 16px);justify-content:space-between;align-items:center}.alert--type-info{background-color:rgba(var(--kv-info-light-rgb, 198, 218, 255), 0.4)}.alert--type-info kv-icon{--icon-color:var(--kv-info, #276ef1)}.alert--type-error{background-color:rgba(var(--kv-error-light-rgb, 249, 209, 204), 0.4)}.alert--type-error kv-icon{--icon-color:var(--kv-error, #e11900)}.alert--type-success{background-color:rgba(var(--kv-success-light-rgb, 223, 247, 230), 0.4)}.alert--type-success kv-icon{--icon-color:var(--kv-success, #05a357)}.alert--type-warning{background-color:rgba(var(--kv-warning-light-rgb, 255, 227, 172), 0.4)}.alert--type-warning kv-icon{--icon-color:var(--kv-warning, #ffc043)}.alert .information{display:flex;align-items:center}.alert .information kv-icon{--icon-height:24px;--icon-width:24px}.alert .information .icon{margin-right:var(--kv-spacing-3x, 12px)}.alert .information .title{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;color:var(--kv-neutral-9, #121212)}.alert .information .description{font-family:var(--kv-primary-font, \"proxima-nova\", sans-serif, \"Arial\");font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;line-height:21px;letter-spacing:normal;text-transform:none;color:var(--kv-neutral-6, #3f3f3f);margin-top:var(--kv-spacing, 4px)}.alert--size-small{flex-direction:column;align-items:flex-start}"; const KvAlert = class { constructor(hostRef) { registerInstance(this, hostRef); /** @inheritdoc */ this.size = EComponentSize.Large; /** @inheritdoc */ this.showIcon = true; } render() { return (h(Host, { key: '9beb6ad2e18eb3461e82a69172a32161c8e59ce3' }, h("div", { key: 'da22f882860cc7b7d48cd52b4ac2e594f7cd7228', class: "alert-container" }, h("div", { key: '32cff6ba6efe2dd4f5d6904ad744498dfec3f853', part: "container", class: { 'alert': true, [`alert--type-${this.type}`]: true, 'alert--size-small': this.size === EComponentSize.Small } }, h("div", { key: 'dfd7833877925992bde1851262a6dffa7c8476c6', class: "information" }, this.showIcon && h("kv-icon", { key: '8cf4eaed3b04962519bcfe9e8663efde7ad67402', name: ALERT_ICON_NAMES[this.type], class: "icon" }), h("div", { key: '23aaea7b6a924cb81635a9c914b4c169bce877a5', class: "text-container" }, h("div", { key: '7c7afb49cb49cb44f0ee00149d2c2089da423f4e', class: "title" }, this.label), h("slot", { key: '72d42bec31a02f6c24a096ef68d4001d5780d5cd', name: "description" }, this.description && h("div", { key: '34980a019ffbb65a8ac07ce02b331c72c0353050', class: "description" }, this.description)))), h("slot", { key: '31d7343a44dd75dfed32f9b57f846e5f16109b99', name: "actions" }))))); } }; KvAlert.style = alertCss; export { KvAlert as kv_alert };