UNPKG

@kelvininc/ui-components

Version:
43 lines (37 loc) 4.18 kB
'use strict'; var index = require('./index-DpuMIXDY.js'); var icon_types = require('./icon.types-B8lvUrX_.js'); var absoluteTimePickerDropdown_types = require('./absolute-time-picker-dropdown.types-mPwO9zQk.js'); var components = require('./components-D2lyDQ_a.js'); require('./lib-config-QLtHwxiM.js'); require('./action-button.types-BYOe6st0.js'); require('./summary-card.types-W26sTdH1.js'); require('./toaster.types-DlSCye8T.js'); require('./tree-item.types-C2yRoORC.js'); require('./tag-alarm.types-BeZw-7PT.js'); require('./wizard.types-DTbE-B6d.js'); const ALERT_ICON_NAMES = { [absoluteTimePickerDropdown_types.EAlertType.Info]: icon_types.EIconName.Error, [absoluteTimePickerDropdown_types.EAlertType.Error]: icon_types.EIconName.Error, [absoluteTimePickerDropdown_types.EAlertType.Success]: icon_types.EIconName.Success, [absoluteTimePickerDropdown_types.EAlertType.Warning]: icon_types.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) { index.registerInstance(this, hostRef); /** @inheritdoc */ this.size = components.EComponentSize.Large; /** @inheritdoc */ this.showIcon = true; } render() { return (index.h(index.Host, { key: '9beb6ad2e18eb3461e82a69172a32161c8e59ce3' }, index.h("div", { key: 'da22f882860cc7b7d48cd52b4ac2e594f7cd7228', class: "alert-container" }, index.h("div", { key: '32cff6ba6efe2dd4f5d6904ad744498dfec3f853', part: "container", class: { 'alert': true, [`alert--type-${this.type}`]: true, 'alert--size-small': this.size === components.EComponentSize.Small } }, index.h("div", { key: 'dfd7833877925992bde1851262a6dffa7c8476c6', class: "information" }, this.showIcon && index.h("kv-icon", { key: '8cf4eaed3b04962519bcfe9e8663efde7ad67402', name: ALERT_ICON_NAMES[this.type], class: "icon" }), index.h("div", { key: '23aaea7b6a924cb81635a9c914b4c169bce877a5', class: "text-container" }, index.h("div", { key: '7c7afb49cb49cb44f0ee00149d2c2089da423f4e', class: "title" }, this.label), index.h("slot", { key: '72d42bec31a02f6c24a096ef68d4001d5780d5cd', name: "description" }, this.description && index.h("div", { key: '34980a019ffbb65a8ac07ce02b331c72c0353050', class: "description" }, this.description)))), index.h("slot", { key: '31d7343a44dd75dfed32f9b57f846e5f16109b99', name: "actions" }))))); } }; KvAlert.style = alertCss; exports.kv_alert = KvAlert;