UNPKG

@kelvininc/ui-components

Version:
28 lines (23 loc) 2.19 kB
'use strict'; var index = require('./index-rNNWWpit.js'); var cssClass_helper = require('./css-class.helper-h-CvPc5n.js'); var utils = require('./utils-Ck_7CWOx.js'); require('./wizard.types-C9Yhv1tt.js'); require('./config-dyyw7PBD.js'); require('./isNil-B-fGcnNC.js'); const iconCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}:host{--icon-color:var(--icon-surface-neutral-primary);--icon-height:var(--size-md);--icon-width:var(--size-md);--icon-rotation:0deg}.icon{display:flex;fill:var(--icon-color);width:var(--icon-width);height:var(--icon-height);transform:rotate(var(--icon-rotation));}.icon.icon-8{width:8px;height:8px}.icon.icon-12{width:12px;height:12px}.icon.icon-16{width:16px;height:16px}.icon.icon-20{width:20px;height:20px}.icon.icon-24{width:24px;height:24px}.icon.icon-40{width:40px;height:40px}.icon.icon-full-size{width:100%;height:100%}.icon.rotate-0{transform:rotate(0deg)}.icon.rotate-45{transform:rotate(45deg)}.icon.rotate-90{transform:rotate(90deg)}.icon.rotate-135{transform:rotate(135deg)}.icon.rotate-180{transform:rotate(180deg)}.icon.rotate-225{transform:rotate(225deg)}.icon.rotate-270{transform:rotate(270deg)}.icon.rotate-315{transform:rotate(315deg)}"; const KvIcon = class { constructor(hostRef) { index.registerInstance(this, hostRef); /** @inheritdoc */ this.customClass = ''; /** (optional) Icon custom color */ this.customColor = ''; } render() { const { baseAssetsUrl, symbolsFileName } = utils.getConfig(); return (index.h(index.Host, { key: '201a1dd05bca7cc1cd500dcf3a3691532a52585e' }, index.h("svg", { key: '2be52a1c929f1e7953c7c98c299ebcbb2316af49', part: "icon", xmlns: "http://www.w3.org/2000/svg", class: Object.assign(Object.assign({}, cssClass_helper.getClassMap(this.customClass)), { icon: true }), style: { fill: this.customColor } }, index.h("use", { key: 'b7dbcbc78785c4453a6c12a2ac36b03e2922256a', href: `${baseAssetsUrl}${symbolsFileName}#${this.name}` })))); } }; KvIcon.style = iconCss; exports.kv_icon = KvIcon;