@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 3.92 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{h,H as Host,r as registerInstance}from"./index-DyUiyxj3.js";import{e as watchString}from"./common-BXXICkFX.js";import{v as validateLabel}from"./label-Dkj9sxQK.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{a as BEM_CLASS_ICON,b as BEM_CLASS_ICON__ICON}from"./bem-Gw3XXPol.js";import"./browser-DaourpHc.js";class IconController{constructor(n){this.component=n}validateIcons(n){watchString(this.component,"_icons",n,{required:!0})}validateLabel(n){validateLabel(this.component,n,{required:!0,defaultValue:""})}componentWillLoad(){this.validateIcons(this.component._icons),this.validateLabel(this.component._label)}}const defaultStyleCss='/* forward the rem function */\n@font-face {\n font-family: "kolicons";\n src: url("kolicons.eot?t=1768480390305"); /* IE9*/\n src: url("kolicons.eot?t=1768480390305#iefix") format("embedded-opentype"), url("kolicons.woff2?t=1768480390305") format("woff2"), url("kolicons.woff?t=1768480390305") format("woff"), url("kolicons.ttf?t=1768480390305") format("truetype"), url("kolicons.svg?t=1768480390305#kolicons") format("svg"); /* iOS 4.1- */\n}\n[class^=kolicon-], [class*=" kolicon-"] {\n font-family: "kolicons";\n font-size: inherit;\n font-style: normal;\n font-weight: 400;\n line-height: 1em;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.kolicon-alert-error::before {\n content: "\\ea01";\n}\n\n.kolicon-alert-info::before {\n content: "\\ea02";\n}\n\n.kolicon-alert-success::before {\n content: "\\ea03";\n}\n\n.kolicon-alert-warning::before {\n content: "\\ea04";\n}\n\n.kolicon-check::before {\n content: "\\ea05";\n}\n\n.kolicon-chevron-double-left::before {\n content: "\\ea06";\n}\n\n.kolicon-chevron-double-right::before {\n content: "\\ea07";\n}\n\n.kolicon-chevron-down::before {\n content: "\\ea08";\n}\n\n.kolicon-chevron-left::before {\n content: "\\ea09";\n}\n\n.kolicon-chevron-right::before {\n content: "\\ea0a";\n}\n\n.kolicon-chevron-up::before {\n content: "\\ea0b";\n}\n\n.kolicon-cogwheel::before {\n content: "\\ea0c";\n}\n\n.kolicon-cross::before {\n content: "\\ea0d";\n}\n\n.kolicon-eye-closed::before {\n content: "\\ea0e";\n}\n\n.kolicon-eye::before {\n content: "\\ea0f";\n}\n\n.kolicon-house::before {\n content: "\\ea10";\n}\n\n.kolicon-kolibri::before {\n content: "\\ea11";\n}\n\n.kolicon-link-external::before {\n content: "\\ea12";\n}\n\n.kolicon-link::before {\n content: "\\ea13";\n}\n\n.kolicon-minus::before {\n content: "\\ea14";\n}\n\n.kolicon-plus::before {\n content: "\\ea15";\n}\n\n.kolicon-settings::before {\n content: "\\ea16";\n}\n\n.kolicon-sort-asc::before {\n content: "\\ea17";\n}\n\n.kolicon-sort-desc::before {\n content: "\\ea18";\n}\n\n.kolicon-sort-neutral::before {\n content: "\\ea19";\n}\n\n.kolicon-version::before {\n content: "\\ea1a";\n}\n\n@layer kol-component {\n /* :host implicitly inherits font-size, see below */\n :host {\n color: inherit;\n display: contents;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n}',KolIcon=class{render(){const n=this.state._label.length>0;return h(Host,{key:"0310e88acca66642d5a2f1b0783c4b51e7d57178",exportparts:"icon",class:BEM_CLASS_ICON},h("i",{key:"defda52dda0896dfc3aa3271e34a679cad2d81de","aria-hidden":n?void 0:"true","aria-label":n?this.state._label:void 0,class:clsx(BEM_CLASS_ICON__ICON,this.state._icons),part:"icon",role:n?"img":"presentation"}))}constructor(n){registerInstance(this,n),this.state={_icons:"kolicon-logo",_label:""},this.controller=new IconController(this)}validateIcons(n){this.controller.validateIcons(n)}validateLabel(n){this.controller.validateLabel(n)}componentWillLoad(){this.controller.componentWillLoad()}static get watchers(){return{_icons:["validateIcons"],_label:["validateLabel"]}}};KolIcon.style={default:defaultStyleCss};export{KolIcon as kol_icon};