{"version":3,"file":"index.es.min.js","sources":["../../../packages/helpers/src/props.helpers.js","../../../packages/components/src/icon-text/icon-text.js"],"sourcesContent":["const getData = attributes => attributes.find(attribute => attribute.nodeName === 'data')\n\nconst createProps = attributes => {\n const data = getData([...attributes])\n const props = [...attributes]\n .filter(attribute => attribute.nodeName !== 'data')\n .reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n if (isNil(data)) {\n return props\n }\n\n try {\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log('ERROR: No data', error, data?.nodeValue)\n }\n}\n\nconst isNil = obj => obj === undefined || obj === null\n\nexport const parseBool = value => (!value || value === 'false' ? false : true)\n\nexport default createProps\n","import createProps from '@kissui/helpers/src/props.helpers'\n\nclass IconText extends HTMLElement {\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.render()\n }\n\n render() {\n const {\n icon,\n icon_size = '',\n label,\n classname = 't-2xs-500-sl',\n sub_label = '',\n sub_classname = ''\n } = this.props\n\n this.innerHTML = `\n <nb-icon icon=\"${icon}\"></nb-icon>\n <p class=\"${classname}\">\n ${label}\n ${sub_label && `<span>${sub_label}</span>`}\n </p>\n `\n if (sub_classname !== '') {\n this.querySelector('span').classList.add(sub_classname)\n }\n if (icon_size !== '') {\n this.style.setProperty('--icon-size', icon_size / 16 + 'rem')\n }\n }\n}\n\ncustomElements.get('nb-icon-text') || customElements.define('nb-icon-text', IconText)\nexport default IconText\n"],"names":["isNil","obj","IconText","HTMLElement","connectedCallback","this","props","attributes","data","find","attribute","nodeName","getData","filter","reduce","all","attr","nodeValue","JSON","parse","error","console","log","createProps","render","icon","icon_size","label","classname","sub_label","sub_classname","innerHTML","querySelector","classList","add","style","setProperty","customElements","get","define"],"mappings":"AAAA,MAqBMA,EAAQC,GAAoC,MAARA,ECnB1C,MAAMC,UAAiBC,YACnBC,iBAAAA,GACIC,KAAKC,MDFOC,CAAAA,IACVC,MAAAA,EAHMD,CAAAA,GAAcA,EAAWE,MAAKC,GAAoC,SAAvBA,EAAUC,WAGpDC,CAAQ,IAAIL,IACnBD,EAAQ,IAAIC,GACbM,QAAOH,GAAoC,SAAvBA,EAAUC,WAC9BG,QAAO,CAACC,EAAKC,KACH,IAAKD,EAAK,CAACC,EAAKL,UAAWK,EAAKC,aACxC,CAAE,GAET,GAAIjB,EAAMQ,GACCF,OAAAA,EAGP,IACO,MAAA,IAAKA,KAAUY,KAAKC,MAAMX,EAAKS,WACzC,OAAQG,GACLC,QAAQC,IAAI,iBAAkBF,EAAOZ,GAAMS,UAC/C,GCdiBM,CAAYlB,KAAKE,YAC9BF,KAAKmB,QACT,CAEAA,MAAAA,GACU,MACFC,KAAAA,EACAC,UAAAA,EAAY,GACZC,MAAAA,EACAC,UAAAA,EAAY,eACZC,UAAAA,EAAY,GACZC,cAAAA,EAAgB,IAChBzB,KAAKC,MAETD,KAAK0B,UAAY,gCACIN,wCACLG,wBACND,sBACAE,GAAa,SAASA,yCAGV,KAAlBC,GACAzB,KAAK2B,cAAc,QAAQC,UAAUC,IAAIJ,GAE3B,KAAdJ,GACArB,KAAK8B,MAAMC,YAAY,cAAeV,EAAY,GAAK,MAE/D,EAGJW,eAAeC,IAAI,iBAAmBD,eAAeE,OAAO,eAAgBrC"}