@rededor/cura 1.5.0-alpha.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
- package/dist/assets/assets/icons/iconset-default-tmp.svg +26 -0
- package/dist/assets/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/app-globals-57c5b283.js +51 -0
- package/dist/cjs/app-globals-57c5b283.js.map +1 -0
- package/dist/cjs/{cura-accordion_13.cjs.entry.js → cura-accordion_12.cjs.entry.js} +26 -76
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-badge-pill.cjs.entry.js +9 -13
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +32 -26
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +73 -0
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-stepper.cjs.entry.js +1 -1
- package/dist/cjs/cura-stepper.cjs.entry.js.map +1 -1
- package/dist/{esm/app-globals-e54ee4c3.js → cjs/cura-theme-module-14544f5f.js} +25 -54
- package/dist/cjs/cura-theme-module-14544f5f.js.map +1 -0
- package/dist/cjs/cura.cjs.js +3 -2
- package/dist/cjs/cura.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-module.js +21 -8
- package/dist/collection/api/modules/cura-theme-module.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +26 -0
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets-raw/icons/default/accessibility2.svg +4 -0
- package/dist/collection/assets-raw/icons/default/accessibility3.svg +5 -0
- package/dist/collection/assets-raw/icons/default/accessibility4.svg +4 -0
- package/dist/collection/assets-raw/icons/default/elevator.svg +5 -0
- package/dist/collection/assets-raw/icons/default/parking.svg +3 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +10 -14
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +0 -1
- package/dist/collection/components/cura-stepper/cura-stepper.js +1 -1
- package/dist/collection/components/cura-stepper/cura-stepper.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +32 -26
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +3 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +70 -8
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +61 -15
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- package/dist/collection/index.js +5 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/components/cura-badge-pill2.js +10 -14
- package/dist/components/cura-badge-pill2.js.map +1 -1
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button-transparent2.js.map +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +32 -26
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-input-text2.js +3 -1
- package/dist/components/cura-input-text2.js.map +1 -1
- package/dist/components/cura-modal.js +1 -1
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-select2.js +23 -8
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-stepper.js +1 -1
- package/dist/components/cura-stepper.js.map +1 -1
- package/dist/components/index.js +26 -9
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/index.esm.js +1 -1
- package/dist/cura/index.esm.js.map +1 -1
- package/dist/cura/{p-82b99090.js → p-1051a947.js} +2 -2
- package/dist/cura/p-1051a947.js.map +1 -0
- package/dist/cura/{p-04006a3e.entry.js → p-57ad7c56.entry.js} +2 -2
- package/dist/cura/{p-04006a3e.entry.js.map → p-57ad7c56.entry.js.map} +1 -1
- package/dist/cura/p-629c34fe.entry.js +2 -0
- package/dist/cura/p-629c34fe.entry.js.map +1 -0
- package/dist/cura/p-62a3056f.entry.js +2 -0
- package/dist/cura/p-62a3056f.entry.js.map +1 -0
- package/dist/cura/p-7f25f4dc.entry.js +2 -0
- package/dist/cura/p-7f25f4dc.entry.js.map +1 -0
- package/dist/cura/p-a4a1f6c6.entry.js +2 -0
- package/dist/cura/p-a4a1f6c6.entry.js.map +1 -0
- package/dist/cura/{p-cfbe2bce.entry.js → p-bd99ef4c.entry.js} +2 -2
- package/dist/cura/{p-cfbe2bce.entry.js.map → p-bd99ef4c.entry.js.map} +1 -1
- package/dist/cura/p-d21364b2.js +2 -0
- package/dist/cura/p-d21364b2.js.map +1 -0
- package/dist/cura/{p-0a133399.entry.js → p-dbab7864.entry.js} +2 -2
- package/dist/cura/{p-0a133399.entry.js.map → p-dbab7864.entry.js.map} +1 -1
- package/dist/cura/p-f30270f0.entry.js +2 -0
- package/dist/cura/p-f30270f0.entry.js.map +1 -0
- package/dist/esm/app-globals-036c3b80.js +49 -0
- package/dist/esm/app-globals-036c3b80.js.map +1 -0
- package/dist/esm/{cura-accordion_13.entry.js → cura-accordion_12.entry.js} +27 -76
- package/dist/esm/cura-accordion_12.entry.js.map +1 -0
- package/dist/esm/cura-badge-pill.entry.js +9 -13
- package/dist/esm/cura-badge-pill.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-outline.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-button-transparent.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search.entry.js +32 -26
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +1 -1
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-modal.entry.js +69 -0
- package/dist/esm/cura-modal.entry.js.map +1 -0
- package/dist/esm/cura-stepper.entry.js +1 -1
- package/dist/esm/cura-stepper.entry.js.map +1 -1
- package/dist/{cjs/app-globals-f33ceef8.js → esm/cura-theme-module-b23f8ac8.js} +23 -56
- package/dist/esm/cura-theme-module-b23f8ac8.js.map +1 -0
- package/dist/esm/cura.js +3 -2
- package/dist/esm/cura.js.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -2
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/api/modules/cura-theme-module.d.ts +8 -6
- package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.d.ts +1 -1
- package/dist/types/components/forms/cura-select/cura-select.d.ts +10 -0
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +25 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
- package/dist/cjs/app-globals-f33ceef8.js.map +0 -1
- package/dist/cjs/cura-accordion_13.cjs.entry.js.map +0 -1
- package/dist/cura/p-23fa2246.entry.js +0 -2
- package/dist/cura/p-23fa2246.entry.js.map +0 -1
- package/dist/cura/p-2af6216a.entry.js +0 -2
- package/dist/cura/p-2af6216a.entry.js.map +0 -1
- package/dist/cura/p-46eaee31.entry.js +0 -2
- package/dist/cura/p-46eaee31.entry.js.map +0 -1
- package/dist/cura/p-7ba80d78.entry.js +0 -2
- package/dist/cura/p-7ba80d78.entry.js.map +0 -1
- package/dist/cura/p-82b99090.js.map +0 -1
- package/dist/esm/app-globals-e54ee4c3.js.map +0 -1
- package/dist/esm/cura-accordion_13.entry.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as i,H as a}from"./p-fd5ed6b0.js";import{i as c}from"./p-48f9289b.js";const r=["360","accessibility","accessibility2","accessibility3","accessibility4","addUser","airdrop","alertCircle","alertTriangle","arrowDown","arrowDownCircle","arrowLeft","arrowLeftCircle","arrowRight","arrowRightCircle","arrowUp","arrowUpCircle","attach","avatarF","avatarM","biometry","bloodGroup","calendar","cam","camOff","central","chatCircle","check","checkBadge","checkCircle","checkDouble","clock","close","closeCircle","collapse","config","contacts","currency","delete","desktop","doc","down","download","drug","duplicate","edit","elevator","exam","examDoc","expand","facebook","fileBmp","fileJpg","filePdf","filePng","fileUpload","fileXls","filter","fullscreen","gallery","geotag","geotagUnity","geotagUnityGroup","google","graph","healthPlan","heart","height","height2","home","horizontalList","imageUp","infoCircle","instagram","key","lamp","language","language2","languageEN","languagePT","lattes","left","like","link","linkExternal","linkedin","list","login","logout","mail","maintenance","medDoc","medEspec","medImg","medUser","medical","menuHamburguer","menuKebab","menuMeatballs","mic","micOff","minus","minusCircle","minusSquare","mobile","news","notification","npsDeslike","npsHate","npsLike","npsLove","npsNeutral","order","parking","partner","phone","play","plus","plusCircle","plusSquare","print","profile","profileCircle","questionCircle","questionSquare","range","reload","ribbon","right","schedule","scheduleCancel","scheduleCheck","scheduleHistorico","search","secure","share","siren","sound","soundOff","subItem","swap","target","team","telegram","twitter","unLink","unSecure","unity","unlike","up","upload","verticalList","viewFalse","viewTrue","weight","whatsapp","wifi","wifiOff","youtube","zoomIn","zoomOut"];const l=':host{display:block;padding:24px;font-family:"Roboto", Arial, Helvetica, sans-serif}.iconDetail{display:block}.iconSizes{display:flex;align-items:center}.iconSizes .size{display:flex;flex-direction:column;text-align:center;align-items:center;margin-right:9px;padding:8px}.iconSizes .size:last-child{margin-right:0}.iconSizes .size span{font-size:10px;margin:8px 0}.iconSizes.invert{margin-top:12px}.iconSizes.invert .size{background-color:#2d2d2d;color:#F6F6F6;border-radius:3px}.icons{margin-top:28px;display:flex;flex-wrap:wrap;position:relative}.icons .icon{position:relative;padding:4px;cursor:pointer;opacity:0.6;transition:opacity 0.2s linear;width:105px;display:flex;flex-direction:column;text-align:center;align-items:center;margin-bottom:16px;box-sizing:border-box;}.icons .icon cura-label{margin-top:8px}.icons .icon cura-paragraph{margin-top:4px}';const n=l;const s=class{constructor(i){e(this,i);this.sizes=Object.keys(c).filter((e=>e!=="default"));this.colors=["primary","secondary","accent","info","warning","error","success","neutral"];this.setSelected=e=>{this.selected=e};this.selected=r[0]}connectedCallback(){this.sizes.unshift(this.sizes.pop())}render(){return i(a,{key:"4918bc5d13f24f3133af45ce5991b3f3f43e99cf"},i("div",{key:"837d47976a39702b13ceb5a7c5ac8ae097d34988",class:"iconDetail"},i("cura-heading",{key:"de4c75c4652b464991aa173cf7243db65f9ba2ba",size:"small","margin-block":"0 24px"},"Icon: ",i("b",{key:"77591ce199e5140ddcde3d7b956586d27fe6bc05"},this.selected)),i("div",{key:"6da36b174603d48ab3b11a8490c424f164855147",class:"iconSizes"},this.sizes.map((e=>i("div",{class:"size"},i("cura-icon",{name:this.selected,size:e}),i("span",null,e))))),i("div",{key:"4920c8010e0a55f80bb557f4ba0e537b7861ae36",class:"iconSizes invert"},this.sizes.map((e=>i("div",{class:"size"},i("cura-icon",{name:this.selected,size:e,color:"neutral-white"}),i("span",null,e)))))),i("div",{key:"99739b351fb25036efd4b55774c0f077058be8fc",class:"icons"},r.map((e=>i("div",{class:{icon:true,selected:e===this.selected},onClick:()=>this.setSelected(e)},i("cura-icon",{name:e,size:"32",color:e===this.selected?"accent-dark":"neutral-dark"}),i("cura-label",{size:"xsmall",weight:e===this.selected?"bold":"regular",color:e===this.selected?"accent-dark":"neutral-dark"},e))))))}};s.style=n;export{s as cura_icons_view};
|
|
2
|
+
//# sourceMappingURL=p-7f25f4dc.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["iconsetdefaulticons","curaIconsViewCss","CuraIconsViewStyle0","CuraIconsView","this","sizes","Object","keys","iconSizes","filter","key","colors","setSelected","icon","selected","connectedCallback","unshift","pop","render","h","Host","class","size","map","name","color","onClick","weight"],"sources":["src/assets/icons/iconset-default-list.ts","src/components/cura-icons-view/cura-icons-view.scss?tag=cura-icons-view&encapsulation=shadow","src/components/cura-icons-view/cura-icons-view.tsx"],"sourcesContent":["export default [\"360\",\"accessibility\",\"accessibility2\",\"accessibility3\",\"accessibility4\",\"addUser\",\"airdrop\",\"alertCircle\",\"alertTriangle\",\"arrowDown\",\"arrowDownCircle\",\"arrowLeft\",\"arrowLeftCircle\",\"arrowRight\",\"arrowRightCircle\",\"arrowUp\",\"arrowUpCircle\",\"attach\",\"avatarF\",\"avatarM\",\"biometry\",\"bloodGroup\",\"calendar\",\"cam\",\"camOff\",\"central\",\"chatCircle\",\"check\",\"checkBadge\",\"checkCircle\",\"checkDouble\",\"clock\",\"close\",\"closeCircle\",\"collapse\",\"config\",\"contacts\",\"currency\",\"delete\",\"desktop\",\"doc\",\"down\",\"download\",\"drug\",\"duplicate\",\"edit\",\"elevator\",\"exam\",\"examDoc\",\"expand\",\"facebook\",\"fileBmp\",\"fileJpg\",\"filePdf\",\"filePng\",\"fileUpload\",\"fileXls\",\"filter\",\"fullscreen\",\"gallery\",\"geotag\",\"geotagUnity\",\"geotagUnityGroup\",\"google\",\"graph\",\"healthPlan\",\"heart\",\"height\",\"height2\",\"home\",\"horizontalList\",\"imageUp\",\"infoCircle\",\"instagram\",\"key\",\"lamp\",\"language\",\"language2\",\"languageEN\",\"languagePT\",\"lattes\",\"left\",\"like\",\"link\",\"linkExternal\",\"linkedin\",\"list\",\"login\",\"logout\",\"mail\",\"maintenance\",\"medDoc\",\"medEspec\",\"medImg\",\"medUser\",\"medical\",\"menuHamburguer\",\"menuKebab\",\"menuMeatballs\",\"mic\",\"micOff\",\"minus\",\"minusCircle\",\"minusSquare\",\"mobile\",\"news\",\"notification\",\"npsDeslike\",\"npsHate\",\"npsLike\",\"npsLove\",\"npsNeutral\",\"order\",\"parking\",\"partner\",\"phone\",\"play\",\"plus\",\"plusCircle\",\"plusSquare\",\"print\",\"profile\",\"profileCircle\",\"questionCircle\",\"questionSquare\",\"range\",\"reload\",\"ribbon\",\"right\",\"schedule\",\"scheduleCancel\",\"scheduleCheck\",\"scheduleHistorico\",\"search\",\"secure\",\"share\",\"siren\",\"sound\",\"soundOff\",\"subItem\",\"swap\",\"target\",\"team\",\"telegram\",\"twitter\",\"unLink\",\"unSecure\",\"unity\",\"unlike\",\"up\",\"upload\",\"verticalList\",\"viewFalse\",\"viewTrue\",\"weight\",\"whatsapp\",\"wifi\",\"wifiOff\",\"youtube\",\"zoomIn\",\"zoomOut\"];",":host {\n display: block;\n padding: 24px;\n font-family: 'Roboto', Arial, Helvetica, sans-serif;\n}\n\n.iconDetail {\n display: block;\n}\n\n.iconSizes {\n display: flex;\n align-items: center;\n\n\n .size {\n display: flex;\n flex-direction: column;\n text-align: center;\n align-items: center;\n margin-right: 9px;\n padding: 8px;\n\n &:last-child { margin-right: 0; }\n span {\n font-size: 10px;\n margin: 8px 0;\n }\n }\n\n &.invert {\n margin-top: 12px;\n\n .size {\n background-color: #2d2d2d;\n color: #F6F6F6;\n border-radius: 3px;\n }\n }\n}\n\n.icons {\n margin-top: 28px;\n display: flex;\n flex-wrap: wrap;\n position: relative;\n\n .icon {\n position: relative;\n padding: 4px;\n cursor: pointer;\n opacity: .6;\n transition: opacity .2s linear;\n width: 105px;\n display: flex;\n flex-direction: column;\n text-align: center;\n align-items: center;\n margin-bottom: 16px;\n box-sizing: border-box;\n cura-label {\n margin-top: 8px;\n }\n cura-paragraph {\n margin-top: 4px;\n }\n /* &.selected {\n transform: scale(1.2);\n } */\n }\n}\n\n","import { Component, Host, h, State } from '@stencil/core';\nimport iconsetdefaulticons from '../../assets/icons/iconset-default-list';\nimport { iconSizes } from '../cura-icon/cura-icon.definitions';\n\n@Component({\n tag: 'cura-icons-view',\n styleUrl: 'cura-icons-view.scss',\n shadow: true,\n})\nexport class CuraIconsView {\n\n sizes = Object.keys(iconSizes).filter(key => key !== 'default');\n colors = ['primary', 'secondary', 'accent', 'info', 'warning', 'error', 'success', 'neutral'];\n @State() selected = iconsetdefaulticons[0];\n\n connectedCallback() {\n this.sizes.unshift(this.sizes.pop());\n }\n\n setSelected = (icon) => {\n this.selected = icon;\n }\n\n render() {\n return (\n <Host>\n <div class=\"iconDetail\">\n <cura-heading size=\"small\" margin-block=\"0 24px\">Icon: <b>{ this.selected }</b></cura-heading>\n <div class=\"iconSizes\">\n { this.sizes.map( size =>\n <div class=\"size\">\n <cura-icon name={this.selected} size={size}></cura-icon>\n <span>{ size }</span>\n </div>\n )}\n </div>\n <div class=\"iconSizes invert\">\n { this.sizes.map( size =>\n <div class=\"size\">\n <cura-icon name={this.selected} size={size} color=\"neutral-white\"></cura-icon>\n <span>{ size }</span>\n </div>\n )}\n </div>\n </div>\n <div class=\"icons\">\n { iconsetdefaulticons.map(icon =>\n <div class={{icon: true, selected: icon === this.selected }} onClick={() => this.setSelected(icon)}>\n <cura-icon\n name={icon}\n size=\"32\"\n color={icon === this.selected ? 'accent-dark' : 'neutral-dark'}></cura-icon>\n <cura-label\n size=\"xsmall\"\n weight={icon === this.selected ? 'bold' : 'regular'}\n color={icon === this.selected ? 'accent-dark' : 'neutral-dark'}>{icon}</cura-label>\n </div>\n )}\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"sFAAA,MAAAA,EAAe,CAAC,MAAM,gBAAgB,iBAAiB,iBAAiB,iBAAiB,UAAU,UAAU,cAAc,gBAAgB,YAAY,kBAAkB,YAAY,kBAAkB,aAAa,mBAAmB,UAAU,gBAAgB,SAAS,UAAU,UAAU,WAAW,aAAa,WAAW,MAAM,SAAS,UAAU,aAAa,QAAQ,aAAa,cAAc,cAAc,QAAQ,QAAQ,cAAc,WAAW,SAAS,WAAW,WAAW,SAAS,UAAU,MAAM,OAAO,WAAW,OAAO,YAAY,OAAO,WAAW,OAAO,UAAU,SAAS,WAAW,UAAU,UAAU,UAAU,UAAU,aAAa,UAAU,SAAS,aAAa,UAAU,SAAS,cAAc,mBAAmB,SAAS,QAAQ,aAAa,QAAQ,SAAS,UAAU,OAAO,iBAAiB,UAAU,aAAa,YAAY,MAAM,OAAO,WAAW,YAAY,aAAa,aAAa,SAAS,OAAO,OAAO,OAAO,eAAe,WAAW,OAAO,QAAQ,SAAS,OAAO,cAAc,SAAS,WAAW,SAAS,UAAU,UAAU,iBAAiB,YAAY,gBAAgB,MAAM,SAAS,QAAQ,cAAc,cAAc,SAAS,OAAO,eAAe,aAAa,UAAU,UAAU,UAAU,aAAa,QAAQ,UAAU,UAAU,QAAQ,OAAO,OAAO,aAAa,aAAa,QAAQ,UAAU,gBAAgB,iBAAiB,iBAAiB,QAAQ,SAAS,SAAS,QAAQ,WAAW,iBAAiB,gBAA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EAAA,aACEK,KAAMX,EACNS,KAAK,KACLG,MAAOZ,IAAST,KAAKU,SAAW,cAAgB,iBAClDK,EAAA,cACEG,KAAK,SACLK,OAAQd,IAAST,KAAKU,SAAW,OAAS,UAC1CW,MAAOZ,IAAST,KAAKU,SAAW,cAAgB,gBAAiBD,O","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,c as e,h as t,H as s}from"./p-fd5ed6b0.js";const i=":host{display:block}.modal{position:fixed;height:100%;width:100%;top:var(--top-offset);bottom:var(--bottom-offset);left:var(--left-offset);right:var(--right-offset);z-index:-1;margin-top:var(--offset-top)}.modal.open{z-index:var(--zIndex)}.modal.open .backdrop,.modal.open .wrapper{opacity:1;visibility:visible;animation:fadeIn 0.3s ease-out}.container{display:flex;align-items:center;justify-content:center}.backdrop,.wrapper{opacity:0;visibility:hidden;transition:opacity 0.3s ease, visibility 0.3s ease}.backdrop{background-color:var(--background-color);z-index:calc(var(--zIndex) - 10);animation:fadeIn 0.3s ease-out}.wrapper{position:fixed;background-color:var(--neutral-white);border:2px solid var(--neutral-light);border-radius:calc(var(--base-spacing) * 3px);max-width:600px;min-width:200px;padding:0px calc(var(--base-spacing) * 4px) calc(var(--base-spacing) * 4px) calc(var(--base-spacing) * 4px);z-index:var(--zIndex);box-shadow:0px 8px 16px 0px var(--neutral-black-shadow-4, rgba(38, 38, 38, 0.12));transform:scale(0.95);transition:transform 0.3s ease-out, opacity 0.3s ease, visibility 0.3s ease}.wrapper ::slotted(*){max-height:80vh;overflow:auto;padding-right:calc(var(--base-spacing) * 5px)}.modal.open .wrapper{transform:scale(1);opacity:1;visibility:visible}.close{justify-self:flex-end;padding-top:calc(var(--base-spacing) * 4px);background:none;border:none;cursor:pointer}.close.mobile{display:none}.close.desktop{display:flex}@media (max-width: 768px){.wrapper{position:fixed;bottom:0px;width:80%;padding-top:calc(var(--base-spacing) * 4px);padding-bottom:0px;border-radius:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px) 0px 0px;border-bottom:none}.close{align-items:center;border-top:1px dashed var(--neutral-light);margin-top:calc(var(--base-spacing) * 4px);padding:calc(var(--base-spacing) * 4px) 0px;justify-content:center;width:100%}.close.mobile{display:flex;gap:calc(var(--base-spacing) * 2px)}.close.desktop{display:none}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}";const o=i;const r=class{constructor(t){a(this,t);this.modalClose=e(this,"modalClose",7);this.handleClose=()=>{this.modalClose.emit();this.open=false};this.open=false;this.background="light";this.top=0;this.bottom=0;this.left=0;this.right=0;this.mobileCloseLabel="Fechar";this.zindex="100";this.styles={}}setColors(){const a={dark:window.CuraAPI.theme.colors.getColor("neutral-black",.4),light:window.CuraAPI.theme.colors.getColor("primary-darker",.8)};this.styles=Object.assign(Object.assign({},this.styles),{"--background-color":a[this.background]})}setOffset(a,e){this.styles=Object.assign(Object.assign({},this.styles),{[`--${a}-offset`]:`${e}px`})}setTop(){this.setOffset("top",this.top)}setBottom(){this.setOffset("bottom",this.bottom)}setLeft(){this.setOffset("left",this.left)}setRight(){this.setOffset("right",this.right)}connectedCallback(){this.styles=Object.assign(Object.assign({},this.styles),{"--neutral-white":window.CuraAPI.theme.colors.getColor("neutral-white"),"--neutral-light":window.CuraAPI.theme.colors.getColor("neutral-light"),"--base-spacing":window.CuraAPI.theme.spacing.getSpacing()});this.setColors();this.setTop();this.setBottom();this.setLeft();this.setRight()}render(){return t(s,{key:"50f4146aed5392ae16803fb060d4921a5e8a3271",role:"dialog","aria-modal":"true",style:{"--zIndex":this.zindex}},t("div",{key:"149e99a4b8b479515ed3d67c5c8aea08d4d96d1c",class:this.open?"modal container open":"modal container",style:this.styles},t("div",{key:"f32f7f7e16475c51babf95e1ca5f4fea449c1bb0",class:this.open?"modal backdrop open":"modal backdrop",onClick:this.handleClose}),t("div",{key:"183f7ab8f2cee8106795f6104c38a2c93272387f",class:"wrapper"},t("button",{key:"28778c8120c92dfcae0443dccd21f55a204bd82e",class:"close desktop",onClick:this.handleClose},t("cura-icon",{key:"a847de5c1314ea1460673870334f3f98e98f1cf9",name:"close",color:"error-dark",size:"small"})),t("slot",{key:"e08b556b7232425c2b83a21dac75d30fb4361a83"}),t("button",{key:"e736a95f878ff5a2ad6897d9140fd74b26939445",class:"close mobile",onClick:this.handleClose},t("cura-icon",{key:"9eaeaca6f4ea9d3cde5fd44e108de389c727f991",name:"close",color:"error-dark",size:"16"}),t("cura-paragraph",{key:"2476b85e5dd7d6092d3d1d1714ee4a79b73b12d0",color:"error-dark",size:"small",marginBlock:"0"},this.mobileCloseLabel)))))}static get watchers(){return{background:["setColors"],top:["setTop"],bottom:["setBottom"],left:["setLeft"],right:["setRight"]}}};r.style=o;export{r as cura_modal};
|
|
2
|
+
//# sourceMappingURL=p-a4a1f6c6.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaModalCss","CuraModalStyle0","CuraModal","this","handleClose","modalClose","emit","open","setColors","backgroundTheme","dark","window","CuraAPI","theme","colors","getColor","light","styles","Object","assign","background","setOffset","name","value","setTop","top","setBottom","bottom","setLeft","left","setRight","right","connectedCallback","spacing","getSpacing","render","h","Host","key","role","style","zindex","class","onClick","color","size","marginBlock","mobileCloseLabel"],"sources":["src/components/cura-modal/cura-modal.scss?tag=cura-modal&encapsulation=shadow","src/components/cura-modal/cura-modal.tsx"],"sourcesContent":["@import '../../../src/scss/mixins/spacing.scss';\n@import '../../../src/scss/mixins/shadows.scss';\n@import '../../../src/scss/mixins/responsive.scss';\n@import '../../../src/scss/mixins/animations.scss';\n\n:host {\n display: block;\n}\n\n.modal {\n position: fixed;\n height: 100%;\n width: 100%;\n top: var(--top-offset);\n bottom: var(--bottom-offset);\n left: var(--left-offset);\n right: var(--right-offset);\n z-index: -1;\n margin-top: var(--offset-top);\n\n &.open {\n z-index: var(--zIndex);\n\n .backdrop,\n .wrapper {\n opacity: 1;\n visibility: visible;\n animation: fadeIn 0.3s ease-out;\n }\n }\n}\n\n.container {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.backdrop,\n.wrapper {\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\n.backdrop {\n background-color: var(--background-color);\n z-index: calc(var(--zIndex) - 10);\n animation: fadeIn 0.3s ease-out;\n}\n\n.wrapper {\n position: fixed;\n background-color: var(--neutral-white);\n border: 2px solid var(--neutral-light);\n border-radius: #{$spacing-xxxs};\n max-width: 600px;\n min-width: 200px;\n padding: #{$spacing-none} #{$spacing-xxs} #{$spacing-xxs} #{$spacing-xxs};\n z-index: var(--zIndex);\n\n @include shadow-level4();\n\n transform: scale(0.95);\n transition: transform 0.3s ease-out, opacity 0.3s ease, visibility 0.3s ease;\n\n ::slotted(*) {\n max-height: 80vh;\n overflow: auto;\n padding-right: #{$spacing-xs};\n }\n}\n\n.modal.open .wrapper {\n transform: scale(1);\n opacity: 1;\n visibility: visible;\n}\n\n.close {\n justify-self: flex-end;\n padding-top: #{$spacing-xxs};\n background: none;\n border: none;\n cursor: pointer;\n\n &.mobile {\n display: none;\n }\n\n &.desktop {\n display: flex;\n }\n}\n\n@include mobile-only() {\n .wrapper {\n position: fixed;\n bottom: #{$spacing-none};\n width: 80%;\n padding-top: #{$spacing-xxs};\n padding-bottom: #{$spacing-none};\n border-radius: #{$spacing-xxxs} #{$spacing-xxxs} #{$spacing-none} #{$spacing-none};\n border-bottom: none;\n }\n\n .close {\n align-items: center;\n border-top: 1px dashed var(--neutral-light);\n margin-top: #{$spacing-xxs};\n padding: #{$spacing-xxs} #{$spacing-none};\n justify-content: center;\n width: 100%;\n\n &.mobile {\n display: flex;\n gap: #{$spacing-mini};\n }\n\n &.desktop {\n display: none;\n }\n }\n}\n\n@include fadeIn();\n@include fadeOut();\n","import { Component, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-modal',\n styleUrl: 'cura-modal.scss',\n shadow: true,\n})\nexport class CuraModal {\n /**\n * Property open to control modal visibility.\n * Default: false\n */\n @Prop({ mutable: true, reflect: true }) open?: boolean = false;\n /**\n * Property background to control modal backdrop color.\n * Default: light\n */\n @Prop() background?: 'dark' | 'light' = 'light';\n /**\n * Property top to control modal top position.\n * Default: 0px\n */\n @Prop() top?: number = 0;\n /**\n * Property bottom to control modal bottom position.\n * Default: 0px\n */\n @Prop() bottom?: number = 0;\n /**\n * Property left to control modal left position.\n * Default: 0px\n */\n @Prop() left?: number = 0;\n /**\n * Property right to control modal right position.\n * Default: 0px\n */\n @Prop() right?: number = 0;\n /**\n * Defines the label for the close button when the modal is viewed on mobile.\n * Default: Fechar\n */\n @Prop({ reflect: true }) mobileCloseLabel: string = 'Fechar';\n /**\n * Property zindex to control the z-index value of the component.\n * Default: 100\n */\n @Prop({ reflect: true }) zindex: string = '100';\n /**\n * Event close to handle modal close.\n */\n @Event({ eventName: 'modalClose' }) modalClose: EventEmitter<void>;\n\n @State() styles = {};\n\n @Watch('background')\n setColors() {\n const backgroundTheme = {\n dark: window.CuraAPI.theme.colors.getColor('neutral-black', 0.4),\n light: window.CuraAPI.theme.colors.getColor('primary-darker', 0.8),\n };\n\n this.styles = {\n ...this.styles,\n '--background-color': backgroundTheme[this.background],\n };\n }\n\n setOffset(name: string, value: number) {\n this.styles = {\n ...this.styles,\n [`--${name}-offset`]: `${value}px`,\n };\n }\n\n @Watch('top')\n setTop() {\n this.setOffset('top', this.top);\n }\n\n @Watch('bottom')\n setBottom() {\n this.setOffset('bottom', this.bottom);\n }\n\n @Watch('left')\n setLeft() {\n this.setOffset('left', this.left);\n }\n\n @Watch('right')\n setRight() {\n this.setOffset('right', this.right);\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--neutral-white': window.CuraAPI.theme.colors.getColor('neutral-white'),\n '--neutral-light': window.CuraAPI.theme.colors.getColor('neutral-light'),\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n };\n this.setColors();\n this.setTop();\n this.setBottom();\n this.setLeft();\n this.setRight();\n }\n\n private handleClose = () => {\n this.modalClose.emit();\n this.open = false;\n };\n\n render() {\n return (\n <Host role=\"dialog\" aria-modal=\"true\" style={{ '--zIndex': this.zindex }}>\n <div class={this.open ? 'modal container open' : 'modal container'} style={this.styles}>\n <div class={this.open ? 'modal backdrop open' : 'modal backdrop'} onClick={this.handleClose}></div>\n <div class=\"wrapper\">\n {/* Desktop button */}\n <button class=\"close desktop\" onClick={this.handleClose}>\n <cura-icon name=\"close\" color=\"error-dark\" size=\"small\"></cura-icon>\n </button>\n <slot></slot>\n {/* Mobile button */}\n <button class=\"close mobile\" onClick={this.handleClose}>\n <cura-icon name=\"close\" color=\"error-dark\" size=\"16\"></cura-icon>\n <cura-paragraph color=\"error-dark\" size=\"small\" marginBlock=\"0\">\n {this.mobileCloseLabel}\n </cura-paragraph>\n </button>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAe,khEACrB,MAAAC,EAAeD,E,MCMFE,EAAS,M,gEAsGZC,KAAAC,YAAc,KACpBD,KAAKE,WAAWC,OAChBH,KAAKI,KAAO,KAAK,E,UAnGsC,M,gBAKjB,Q,SAKjB,E,YAKG,E,UAKF,E,WAKC,E,sBAK2B,S,YAKV,M,YAMxB,E,CAGlB,SAAAC,GACE,MAAMC,EAAkB,CACtBC,KAAMC,OAAOC,QAAQC,MAAMC,OAAOC,SAAS,gBAAiB,IAC5DC,MAAOL,OAAOC,QAAQC,MAAMC,OAAOC,SAAS,iBAAkB,KAGhEZ,KAAKc,OAAMC,OAAAC,OAAAD,OAAAC,OAAA,GACNhB,KAAKc,QAAM,CACd,qBAAsBR,EAAgBN,KAAKiB,a,CAI/C,SAAAC,CAAUC,EAAcC,GACtBpB,KAAKc,OAAMC,OAAAC,OAAAD,OAAAC,OAAA,GACNhB,KAAKc,QAAM,CACd,CAAC,KAAKK,YAAgB,GAAGC,O,CAK7B,MAAAC,GACErB,KAAKkB,UAAU,MAAO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}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as e,H as s,g as r}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box;width:100%}cura-heading{--margin-block:0 !important}.container{display:flex}.compact{display:flex;padding:0px;justify-content:space-between;align-items:center}.compact .heading{text-align:right}.stepper-list{gap:4px;display:flex;flex-shrink:0;align-items:center;padding:0;flex:1;width:100%;justify-content:space-between}.step{display:flex;align-items:center;flex-direction:row;flex:1;gap:4px}.step .wrapper{flex:1;position:relative}.step .divider{background-color:var(--neutral-light);height:2px;flex:1;transition:all 1s}.step .animation{position:absolute;top:0;left:0;right:0;width:var(--progress-width)}.step .done{background-color:var(--success-light)}.step .stop{background-color:var(--error-light)}.step .active{background-color:var(--info-light)}.last{flex:0}";const o=i;const a=class{constructor(e){t(this,e);this.activeStepIndex=undefined;this.errorInCurrentStep=false;this.displayHeading=false;this.variant="default";this.steps=[];this.styles={};this.stepList=[]}connectedCallback(){this.initializeSteps();const{fonts:t,colors:e,spacing:s}=window.CuraAPI.theme;const r=t.getWeights();this.styles=this.generateStyles(e,t,s,r)}generateStyles(t,e,s,r){return{"--base-spacing":s.getSpacing(),"--neutral-purewhite":t.getColor("neutral-purewhite"),"--neutral-lighter":t.getColor("neutral-lighter"),"--neutral-base":t.getColor("neutral-base"),"--neutral-light":t.getColor("neutral-light"),"--success-light":t.getColor("success-light"),"--info-light":t.getColor("info-light"),"--error-light":t.getColor("error-light"),"--font-size":e.getSize(),"--font-color":e.getColor(),"--font-family":e.getFamily(),"--font-weight-regular":r.regular}}initializeSteps(){if(typeof this.steps==="string"){this.stepList=JSON.parse(this.steps||"[]")}else{this.stepList=this.steps}}getStepStatus(t){if(this.activeStepIndex===t&&this.errorInCurrentStep)return"stop";if(this.activeStepIndex===t&&this.stepList.length!==t)return"active";if(this.activeStepIndex>=t)return"done";return"default"}getProgressStyles(){const t={default:{progressColor:"var(--info-light)",activeStepTextColor:"info-darker",nextStepTextColor:"info-dark"},firstStep:{progressColor:"var(--info-light)",activeStepTextColor:"neutral-dark",nextStepTextColor:"neutral-medium"},completed:{progressColor:"var(--success-light)",activeStepTextColor:"success-darker",nextStepTextColor:"success-dark"},error:{progressColor:"var(--error-light)",activeStepTextColor:"error-darker",nextStepTextColor:"error-dark"}};if(this.errorInCurrentStep){return t.error}if(this.activeStepIndex===0){return t.firstStep}if(this.activeStepIndex===this.stepList.length){return t.completed}return t.default}renderCompactStepper(){var t;const s=this.activeStepIndex===0?this.stepList[this.activeStepIndex].title:this.stepList[this.activeStepIndex-1].title;const r=this.activeStepIndex===0?this.stepList[this.activeStepIndex+1].title:(t=this.stepList[this.activeStepIndex])===null||t===void 0?void 0:t.title;const i=this.activeStepIndex===this.stepList.length;const o=!(i||this.errorInCurrentStep);const{progressColor:a,activeStepTextColor:l,nextStepTextColor:n}=this.getProgressStyles();const c=this.activeStepIndex*100/this.stepList.length;return e("div",{class:"container compact",style:this.styles},e("cura-progress-bar",{progress:c,progressColor:a,active:this.activeStepIndex!==0},!o?e("cura-icon",{name:this.errorInCurrentStep?"alertCircle":"checkCircle",color:this.errorInCurrentStep?"error-dark":"success-dark",size:"16"}):e("cura-heading",{color:"neutral-dark",size:"xsmall"},this.activeStepIndex,"/",this.stepList.length)),this.displayHeading&&e("div",{class:"heading"},e("cura-heading",{size:"small",weight:"bold",color:l},s),!i&&e("cura-heading",{size:"xsmall",weight:"regular",color:n},"Próximo: ",r)))}renderStep(t,s){const r=this.getStepStatus(s+1);const i=s===this.stepList.length-1;const o=r!=="default"?"100%":"0";return e("div",{class:`step ${i?"last":""}`,key:t.title},e("cura-stepper-item",{heading:t.title,label:t.label,displayHeading:this.displayHeading,status:r}),s<this.stepList.length-1&&e("div",{class:"wrapper"},e("div",{class:"divider"}),e("div",{class:`divider ${r} animation`,style:{"--progress-width":o}})))}renderStepper(){return e("div",{class:"container",style:this.styles},e("div",{class:"stepper-list"},this.stepList.map(((t,e)=>this.renderStep(t,e)))))}render(){return e(s,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,H as s,g as r}from"./p-fd5ed6b0.js";const i=":host{display:block;box-sizing:border-box;width:100%}cura-heading{--margin-block:0 !important}.container{display:flex}.compact{display:flex;padding:0px;justify-content:space-between;align-items:center}.compact .heading{text-align:right}.stepper-list{gap:4px;display:flex;flex-shrink:0;align-items:center;padding:0;flex:1;width:100%;justify-content:space-between}.step{display:flex;align-items:center;flex-direction:row;flex:1;gap:4px}.step .wrapper{flex:1;position:relative}.step .divider{background-color:var(--neutral-light);height:2px;flex:1;transition:all 1s}.step .animation{position:absolute;top:0;left:0;right:0;width:var(--progress-width)}.step .done{background-color:var(--success-light)}.step .stop{background-color:var(--error-light)}.step .active{background-color:var(--info-light)}.last{flex:0}";const o=i;const a=class{constructor(e){t(this,e);this.activeStepIndex=undefined;this.errorInCurrentStep=false;this.displayHeading=false;this.variant="default";this.steps=[];this.styles={};this.stepList=[]}connectedCallback(){this.initializeSteps();const{fonts:t,colors:e,spacing:s}=window.CuraAPI.theme;const r=t.getWeights();this.styles=this.generateStyles(e,t,s,r)}generateStyles(t,e,s,r){return{"--base-spacing":s.getSpacing(),"--neutral-purewhite":t.getColor("neutral-purewhite"),"--neutral-lighter":t.getColor("neutral-lighter"),"--neutral-base":t.getColor("neutral-base"),"--neutral-light":t.getColor("neutral-light"),"--success-light":t.getColor("success-light"),"--info-light":t.getColor("info-light"),"--error-light":t.getColor("error-light"),"--font-size":e.getSize(),"--font-color":e.getColor(),"--font-family":e.getFamily(),"--font-weight-regular":r.regular}}initializeSteps(){if(typeof this.steps==="string"){this.stepList=JSON.parse(this.steps||"[]")}else{this.stepList=this.steps}}getStepStatus(t){if(this.activeStepIndex===t&&this.errorInCurrentStep)return"stop";if(this.activeStepIndex===t&&this.stepList.length!==t)return"active";if(this.activeStepIndex>=t)return"done";return"default"}getProgressStyles(){const t={default:{progressColor:"var(--info-light)",activeStepTextColor:"info-darker",nextStepTextColor:"info-dark"},firstStep:{progressColor:"var(--info-light)",activeStepTextColor:"neutral-dark",nextStepTextColor:"neutral-medium"},completed:{progressColor:"var(--success-light)",activeStepTextColor:"success-darker",nextStepTextColor:"success-dark"},error:{progressColor:"var(--error-light)",activeStepTextColor:"error-darker",nextStepTextColor:"error-dark"}};if(this.errorInCurrentStep){return t.error}if(this.activeStepIndex===0){return t.firstStep}if(this.activeStepIndex===this.stepList.length){return t.completed}return t.default}renderCompactStepper(){var t;const s=this.activeStepIndex===0?this.stepList[this.activeStepIndex].title:this.stepList[this.activeStepIndex-1].title;const r=this.activeStepIndex===0?this.stepList[this.activeStepIndex+1].title:(t=this.stepList[this.activeStepIndex])===null||t===void 0?void 0:t.title;const i=this.activeStepIndex===this.stepList.length;const o=!(i||this.errorInCurrentStep);const{progressColor:a,activeStepTextColor:l,nextStepTextColor:n}=this.getProgressStyles();const c=this.activeStepIndex*100/this.stepList.length;return e("div",{class:"container compact",style:this.styles},e("cura-progress-bar",{progress:c,progressColor:a,active:this.activeStepIndex!==0},!o?e("cura-icon",{name:this.errorInCurrentStep?"alertCircle":"checkCircle",color:this.errorInCurrentStep?"error-dark":"success-dark",size:"16"}):e("cura-heading",{color:"neutral-dark",size:"xsmall"},this.activeStepIndex,"/",this.stepList.length)),this.displayHeading&&e("div",{class:"heading"},e("cura-heading",{size:"small",weight:"bold",color:l},s),!i&&e("cura-heading",{size:"xsmall",weight:"regular",color:n},"Próximo: ",r)))}renderStep(t,s){const r=this.getStepStatus(s+1);const i=s===this.stepList.length-1;const o=r!=="default"?"100%":"0";return e("div",{class:`step ${i?"last":""}`,key:t.title},e("cura-stepper-item",{heading:t.title,label:t.label,displayHeading:this.displayHeading,status:r}),s<this.stepList.length-1&&e("div",{class:"wrapper"},e("div",{class:"divider"}),e("div",{class:`divider ${r} animation`,style:{"--progress-width":o}})))}renderStepper(){return e("div",{class:"container",style:this.styles},e("div",{class:"stepper-list"},this.stepList.map(((t,e)=>this.renderStep(t,e)))))}render(){return e(s,{key:"a6562de52fefff80eb2d310555ce56956cce64d9"},this.variant==="default"?this.renderStepper():this.renderCompactStepper())}get host(){return r(this)}};a.style=o;export{a as cura_stepper};
|
|
2
|
+
//# sourceMappingURL=p-bd99ef4c.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["curaStepperCss","CuraStepperStyle0","CuraStepper","connectedCallback","this","initializeSteps","fonts","colors","spacing","window","CuraAPI","theme","weights","getWeights","styles","generateStyles","getSpacing","getColor","getSize","getFamily","regular","steps","stepList","JSON","parse","getStepStatus","step","activeStepIndex","errorInCurrentStep","length","getProgressStyles","progressStyles","default","progressColor","activeStepTextColor","nextStepTextColor","firstStep","completed","error","renderCompactStepper","title","subtitle","_a","inProgress","progress","h","class","style","active","name","color","size","displayHeading","weight","renderStep","stepIndex","stepStatus","lastStep","progressWidth","key","heading","label","status","renderStepper","map","render","Host","variant"],"sources":["src/components/cura-stepper/cura-stepper.scss?tag=cura-stepper&encapsulation=shadow","src/components/cura-stepper/cura-stepper.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\ncura-heading { \n --margin-block: 0 !important;\n}\n\n.container {\n display: flex;\n}\n\n.compact {\n display: flex;\n padding: 0px;\n justify-content: space-between;\n align-items: center;\n\n .heading{\n text-align: right;\n }\n}\n\n.stepper-list {\n gap: 4px;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n padding: 0;\n flex: 1;\n width: 100%;\n justify-content: space-between;\n}\n\n.step{\n display: flex;\n align-items: center;\n flex-direction: row;\n flex: 1;\n gap: 4px;\n\n .wrapper {\n flex: 1;\n position: relative;\n }\n\n .divider{\n background-color: var(--neutral-light);\n height: 2px;\n flex: 1;\n\n transition: all 1s;\n }\n\n .animation {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n width: var(--progress-width);\n }\n\n .done{\n background-color: var(--success-light);\n }\n\n .stop{\n background-color: var(--error-light);\n }\n\n .active{\n background-color: var(--info-light);\n }\n}\n\n.last{\n flex: 0;\n}\n","import { Component, Host, State, h, Element, Prop } from '@stencil/core';\nimport { Step } from './stepper.type';\n\n@Component({\n tag: 'cura-stepper',\n styleUrl: 'cura-stepper.scss',\n shadow: true,\n})\nexport class CuraStepper {\n /**\n * The current active step index\n */\n @Prop({ reflect: true }) activeStepIndex: number;\n\n /**\n * Indicates if a step has encountered an error\n * If `true`, the current step will be marked as 'stop'\n */\n @Prop({ reflect: true }) errorInCurrentStep: boolean = false;\n\n /**\n * Whether to display the title (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * Allows you to set the appearance of the component (default: default)\n */\n @Prop({ reflect: true }) variant: 'compact' | 'default' = 'default';\n\n /**\n * List of steps in the stepper.\n */\n @Prop() steps: Step[] | string = [];\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n @State() styles = {};\n\n /**\n * Array of steps in the stepper.\n *\n * @type {Date[]}\n * @default []\n */\n @State() stepList: Step[] = [];\n\n connectedCallback() {\n this.initializeSteps();\n\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = this.generateStyles(colors, fonts, spacing, weights);\n }\n\n generateStyles(colors, fonts, spacing, weights) {\n return {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--neutral-light': colors.getColor('neutral-light'),\n '--success-light': colors.getColor('success-light'),\n '--info-light': colors.getColor('info-light'),\n '--error-light': colors.getColor('error-light'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n initializeSteps() {\n if (typeof this.steps === 'string') {\n this.stepList = JSON.parse(this.steps || '[]');\n } else {\n this.stepList = this.steps;\n }\n }\n\n getStepStatus(step: number): 'done' | 'stop' | 'active' | 'default' {\n if (this.activeStepIndex === step && this.errorInCurrentStep) return 'stop';\n if (this.activeStepIndex === step && this.stepList.length !== step) return 'active';\n if (this.activeStepIndex >= step) return 'done';\n\n return 'default';\n }\n\n getProgressStyles() {\n const progressStyles = {\n default: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'info-darker',\n nextStepTextColor: 'info-dark',\n },\n firstStep: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'neutral-dark',\n nextStepTextColor: 'neutral-medium',\n },\n completed: {\n progressColor: 'var(--success-light)',\n activeStepTextColor: 'success-darker',\n nextStepTextColor: 'success-dark',\n },\n error: {\n progressColor: 'var(--error-light)',\n activeStepTextColor: 'error-darker',\n nextStepTextColor: 'error-dark',\n },\n };\n\n if (this.errorInCurrentStep) {\n return progressStyles.error;\n }\n\n if (this.activeStepIndex === 0) {\n return progressStyles.firstStep;\n }\n\n if (this.activeStepIndex === this.stepList.length) {\n return progressStyles.completed;\n }\n\n return progressStyles.default;\n }\n\n renderCompactStepper() {\n const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;\n const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : this.stepList[this.activeStepIndex]?.title;\n const completed = this.activeStepIndex === this.stepList.length;\n const inProgress = !(completed || this.errorInCurrentStep);\n const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();\n\n // Representa a porcentagem de progresso (step atual / quantidade de steps;)\n const progress = (this.activeStepIndex * 100) / this.stepList.length;\n\n return (\n <div class=\"container compact\" style={this.styles}>\n <cura-progress-bar progress={progress} progressColor={progressColor} active={this.activeStepIndex !== 0}>\n {!inProgress ? (\n <cura-icon name={this.errorInCurrentStep ? 'alertCircle' : 'checkCircle'} color={this.errorInCurrentStep ? 'error-dark' : 'success-dark'} size=\"16\"></cura-icon>\n ) : (\n <cura-heading color=\"neutral-dark\" size=\"xsmall\">\n {this.activeStepIndex}/{this.stepList.length}\n </cura-heading>\n )}\n </cura-progress-bar>\n {this.displayHeading && (\n <div class=\"heading\">\n <cura-heading size=\"small\" weight=\"bold\" color={activeStepTextColor}>\n {title}\n </cura-heading>\n {!completed && (\n <cura-heading size=\"xsmall\" weight=\"regular\" color={nextStepTextColor}>\n Próximo: {subtitle}\n </cura-heading>\n )}\n </div>\n )}\n </div>\n );\n }\n\n renderStep(step: Step, stepIndex: number) {\n const stepStatus = this.getStepStatus(stepIndex + 1);\n const lastStep = stepIndex === this.stepList.length - 1;\n const progressWidth = stepStatus !== 'default' ? '100%' : '0';\n\n return (\n <div class={`step ${lastStep ? 'last' : ''}`} key={step.title}>\n <cura-stepper-item heading={step.title} label={step.label} displayHeading={this.displayHeading} status={stepStatus} />\n {stepIndex < this.stepList.length - 1 && (\n <div class=\"wrapper\">\n <div class=\"divider\" />\n <div class={`divider ${stepStatus} animation`} style={{ '--progress-width': progressWidth }} />\n </div>\n )}\n </div>\n );\n }\n renderStepper() {\n return (\n <div class=\"container\" style={this.styles}>\n <div class=\"stepper-list\">{this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex))}</div>\n </div>\n );\n }\n\n render() {\n return <Host>{this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper()}</Host>;\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAiB,0yBACvB,MAAAC,EAAeD,E,MCOFE,EAAW,M,gFAUiC,M,oBAKJ,M,aAKO,U,WAKzB,G,YAMf,G,cAQU,E,CAE5B,iBAAAC,GACEC,KAAKC,kBAEL,MAAMC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,OAAOC,QAAQC,MAClD,MAAMC,EAAUN,EAAMO,aAEtBT,KAAKU,OAASV,KAAKW,eAAeR,EAAQD,EAAOE,EAASI,E,CAG5D,cAAAG,CAAeR,EAAQD,EAAOE,EAASI,GACrC,MAAO,CACL,iBAAkBJ,EAAQQ,aAC1B,sBAAuBT,EAAOU,SAAS,qBACvC,oBAAqBV,EAAOU,SAAS,mBACrC,iBAAkBV,EAAOU,SAAS,gBAClC,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EAAYnD,KAAKkB,SAASO,OAAS,GAClCgB,EAAA,OAAKC,MAAM,WACTD,EAAA,OAAKC,MAAM,YACXD,EAAA,OAAKC,MAAO,WAAWU,cAAwBT,MAAO,CAAE,mBAAoBW,M,CAMtF,aAAAK,GACE,OACElB,EAAA,OAAKC,MAAM,YAAYC,MAAO3C,KAAKU,QACjC+B,EAAA,OAAKC,MAAM,gBAAgB1C,KAAKkB,SAAS0C,KAAI,CAACtC,EAAM6B,IAAcnD,KAAKkD,WAAW5B,EAAM6B,M,CAK9F,MAAAU,GACE,OAAOpB,EAACqB,EAAI,CAAAP,IAAA,4CAAEvD,KAAK+D,UAAY,UAAY/D,KAAK2D,gBAAkB3D,KAAKmC,uB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["curaStepperCss","CuraStepperStyle0","CuraStepper","connectedCallback","this","initializeSteps","fonts","colors","spacing","window","CuraAPI","theme","weights","getWeights","styles","generateStyles","getSpacing","getColor","getSize","getFamily","regular","steps","stepList","JSON","parse","getStepStatus","step","activeStepIndex","errorInCurrentStep","length","getProgressStyles","progressStyles","default","progressColor","activeStepTextColor","nextStepTextColor","firstStep","completed","error","renderCompactStepper","title","subtitle","_a","inProgress","progress","h","class","style","active","name","color","size","displayHeading","weight","renderStep","stepIndex","stepStatus","lastStep","progressWidth","key","heading","label","status","renderStepper","map","render","Host","variant"],"sources":["src/components/cura-stepper/cura-stepper.scss?tag=cura-stepper&encapsulation=shadow","src/components/cura-stepper/cura-stepper.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\ncura-heading { \n --margin-block: 0 !important;\n}\n\n.container {\n display: flex;\n}\n\n.compact {\n display: flex;\n padding: 0px;\n justify-content: space-between;\n align-items: center;\n\n .heading{\n text-align: right;\n }\n}\n\n.stepper-list {\n gap: 4px;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n padding: 0;\n flex: 1;\n width: 100%;\n justify-content: space-between;\n}\n\n.step{\n display: flex;\n align-items: center;\n flex-direction: row;\n flex: 1;\n gap: 4px;\n\n .wrapper {\n flex: 1;\n position: relative;\n }\n\n .divider{\n background-color: var(--neutral-light);\n height: 2px;\n flex: 1;\n\n transition: all 1s;\n }\n\n .animation {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n width: var(--progress-width);\n }\n\n .done{\n background-color: var(--success-light);\n }\n\n .stop{\n background-color: var(--error-light);\n }\n\n .active{\n background-color: var(--info-light);\n }\n}\n\n.last{\n flex: 0;\n}\n","import { Component, Host, State, h, Element, Prop } from '@stencil/core';\nimport { Step } from './stepper.type';\n\n@Component({\n tag: 'cura-stepper',\n styleUrl: 'cura-stepper.scss',\n shadow: true,\n})\nexport class CuraStepper {\n /**\n * The current active step index\n */\n @Prop({ reflect: true }) activeStepIndex: number;\n\n /**\n * Indicates if a step has encountered an error\n * If `true`, the current step will be marked as 'stop'\n */\n @Prop({ reflect: true }) errorInCurrentStep: boolean = false;\n\n /**\n * Whether to display the title (default: false)\n */\n @Prop({ reflect: true }) displayHeading: boolean = false;\n\n /**\n * Allows you to set the appearance of the component (default: default)\n */\n @Prop({ reflect: true }) variant: 'compact' | 'default' = 'default';\n\n /**\n * List of steps in the stepper.\n */\n @Prop() steps: Step[] | string = [];\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n @State() styles = {};\n\n /**\n * Array of steps in the stepper.\n *\n * @type {Date[]}\n * @default []\n */\n @State() stepList: Step[] = [];\n\n connectedCallback() {\n this.initializeSteps();\n\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = this.generateStyles(colors, fonts, spacing, weights);\n }\n\n generateStyles(colors, fonts, spacing, weights) {\n return {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--neutral-light': colors.getColor('neutral-light'),\n '--success-light': colors.getColor('success-light'),\n '--info-light': colors.getColor('info-light'),\n '--error-light': colors.getColor('error-light'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n initializeSteps() {\n if (typeof this.steps === 'string') {\n this.stepList = JSON.parse(this.steps || '[]');\n } else {\n this.stepList = this.steps;\n }\n }\n\n getStepStatus(step: number): 'done' | 'stop' | 'active' | 'default' {\n if (this.activeStepIndex === step && this.errorInCurrentStep) return 'stop';\n if (this.activeStepIndex === step && this.stepList.length !== step) return 'active';\n if (this.activeStepIndex >= step) return 'done';\n\n return 'default';\n }\n\n getProgressStyles() {\n const progressStyles = {\n default: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'info-darker',\n nextStepTextColor: 'info-dark',\n },\n firstStep: {\n progressColor: 'var(--info-light)',\n activeStepTextColor: 'neutral-dark',\n nextStepTextColor: 'neutral-medium',\n },\n completed: {\n progressColor: 'var(--success-light)',\n activeStepTextColor: 'success-darker',\n nextStepTextColor: 'success-dark',\n },\n error: {\n progressColor: 'var(--error-light)',\n activeStepTextColor: 'error-darker',\n nextStepTextColor: 'error-dark',\n },\n };\n\n if (this.errorInCurrentStep) {\n return progressStyles.error;\n }\n\n if (this.activeStepIndex === 0) {\n return progressStyles.firstStep;\n }\n\n if (this.activeStepIndex === this.stepList.length) {\n return progressStyles.completed;\n }\n\n return progressStyles.default;\n }\n\n renderCompactStepper() {\n const title = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex].title : this.stepList[this.activeStepIndex - 1].title;\n const subtitle = this.activeStepIndex === 0 ? this.stepList[this.activeStepIndex + 1].title : this.stepList[this.activeStepIndex]?.title;\n const completed = this.activeStepIndex === this.stepList.length;\n const inProgress = !(completed || this.errorInCurrentStep);\n const { progressColor, activeStepTextColor, nextStepTextColor } = this.getProgressStyles();\n\n // Representa a porcentagem de progresso (step atual / quantidade de steps;)\n const progress = (this.activeStepIndex * 100) / this.stepList.length;\n\n return (\n <div class=\"container compact\" style={this.styles}>\n <cura-progress-bar progress={progress} progressColor={progressColor} active={this.activeStepIndex !== 0}>\n {!inProgress ? (\n <cura-icon name={this.errorInCurrentStep ? 'alertCircle' : 'checkCircle'} color={this.errorInCurrentStep ? 'error-dark' : 'success-dark'} size=\"16\"></cura-icon>\n ) : (\n <cura-heading color=\"neutral-dark\" size=\"xsmall\">\n {this.activeStepIndex}/{this.stepList.length}\n </cura-heading>\n )}\n </cura-progress-bar>\n {this.displayHeading && (\n <div class=\"heading\">\n <cura-heading size=\"small\" weight=\"bold\" color={activeStepTextColor}>\n {title}\n </cura-heading>\n {!completed && (\n <cura-heading size=\"xsmall\" weight=\"regular\" color={nextStepTextColor}>\n Próximo: {subtitle}\n </cura-heading>\n )}\n </div>\n )}\n </div>\n );\n }\n\n renderStep(step: Step, stepIndex: number) {\n const stepStatus = this.getStepStatus(stepIndex + 1);\n const lastStep = stepIndex === this.stepList.length - 1;\n const progressWidth = stepStatus !== 'default' ? '100%' : '0';\n\n return (\n <div class={`step ${lastStep ? 'last' : ''}`} key={step.title}>\n <cura-stepper-item heading={step.title} label={step.label} displayHeading={this.displayHeading} status={stepStatus}></cura-stepper-item>\n {stepIndex < this.stepList.length - 1 && (\n <div class=\"wrapper\">\n <div class=\"divider\" />\n <div class={`divider ${stepStatus} animation`} style={{ '--progress-width': progressWidth }} />\n </div>\n )}\n </div>\n );\n }\n renderStepper() {\n return (\n <div class=\"container\" style={this.styles}>\n <div class=\"stepper-list\">{this.stepList.map((step, stepIndex) => this.renderStep(step, stepIndex))}</div>\n </div>\n );\n }\n\n render() {\n return <Host>{this.variant === 'default' ? this.renderStepper() : this.renderCompactStepper()}</Host>;\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAiB,0yBACvB,MAAAC,EAAeD,E,MCOFE,EAAW,M,gFAUiC,M,oBAKJ,M,aAKO,U,WAKzB,G,YAMf,G,cAQU,E,CAE5B,iBAAAC,GACEC,KAAKC,kBAEL,MAAMC,MAAEA,EA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MAAMC,EAAapD,KAAKqB,cAAc8B,EAAY,GAClD,MAAME,EAAWF,IAAcnD,KAAKkB,SAASO,OAAS,EACtD,MAAM6B,EAAgBF,IAAe,UAAY,OAAS,IAE1D,OACEX,EAAA,OAAKC,MAAO,QAAQW,EAAW,OAAS,KAAME,IAAKjC,EAAKc,OACtDK,EAAA,qBAAmBe,QAASlC,EAAKc,MAAOqB,MAAOnC,EAAKmC,MAAOT,eAAgBhD,KAAKgD,eAAgBU,OAAQN,IACvGD,EAAYnD,KAAKkB,SAASO,OAAS,GAClCgB,EAAA,OAAKC,MAAM,WACTD,EAAA,OAAKC,MAAM,YACXD,EAAA,OAAKC,MAAO,WAAWU,cAAwBT,MAAO,CAAE,mBAAoBW,M,CAMtF,aAAAK,GACE,OACElB,EAAA,OAAKC,MAAM,YAAYC,MAAO3C,KAAKU,QACjC+B,EAAA,OAAKC,MAAM,gBAAgB1C,KAAKkB,SAAS0C,KAAI,CAACtC,EAAM6B,IAAcnD,KAAKkD,WAAW5B,EAAM6B,M,CAK9F,MAAAU,GACE,OAAOpB,EAACqB,EAAI,CAAAP,IAAA,4CAAEvD,KAAK+D,UAAY,UAAY/D,KAAK2D,gBAAkB3D,KAAKmC,uB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{C as t}from"./p-1051a947.js";class n{constructor(n){this.localAssetsPath=n&&n.localAssetsPath?n.localAssetsPath:`/assets`;const o=new t;this.theme={load:function(t){o.load(t)},setCustom:function(t){o.setCustom(t)},colors:{getColor:function(t,n){return o.colors.getColor(t,n)}},fonts:{getFamily:function(t){return o.fonts.getFamily(t)},getWeights:function(){return o.fonts.getWeights()},getSize:function(){return o.fonts.getSize()},getColor:function(){return o.fonts.getColor()}},spacing:{getSpacing:function(){return o.spacing.getSpacing()}},breakpoints:{get:function(t,n){return o.breakpoints.get(t,n)}}};if(n&&n.customTheme){this.theme.setCustom(n.customTheme)}else{const t=n&&n.theme?n.theme:"default";this.theme.load(t)}}}function o(){const t=window.CuraInit;window.CuraAPI=t?new n(t):new n;const o=window.CuraAPI;window.dispatchEvent(new CustomEvent("CuraAPIReady",{detail:{api:o}}));if(t&&typeof t.onReady==="function")t.onReady(o)}const e=o;export{e as g};
|
|
2
|
+
//# sourceMappingURL=p-d21364b2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CuraAPI","constructor","config","this","localAssetsPath","themeModule","CuraThemeModule","theme","load","themeTag","setCustom","customThemeDefinitions","colors","getColor","colorWithDepth","opacity","fonts","getFamily","type","getWeights","getSize","spacing","getSpacing","breakpoints","get","size","position","customTheme","window","CuraInit","api","dispatchEvent","CustomEvent","detail","onReady","globalScripts","appGlobalScript"],"sources":["src/api/cura-api.ts","src/rededor-cura-start.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { CuraConfig, APIThemeFunctions, CuraCustomTheme } from './cura-api.type';\nimport CuraThemeModule from './modules/cura-theme-module';\n\nexport default class CuraAPI {\n\n theme: APIThemeFunctions;\n localAssetsPath: string;\n\n constructor (config?: CuraConfig) {\n this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;\n const themeModule = new CuraThemeModule();\n this.theme = {\n load: function(themeTag: string) { themeModule.load(themeTag); },\n setCustom: function(customThemeDefinitions: CuraCustomTheme) { themeModule.setCustom(customThemeDefinitions); },\n colors: {\n getColor: function(colorWithDepth?: string, opacity?: number) { return themeModule.colors.getColor(colorWithDepth, opacity) },\n },\n fonts: {\n getFamily: function(type?: string) { return themeModule.fonts.getFamily(type) },\n getWeights: function() { return themeModule.fonts.getWeights() },\n getSize: function() { return themeModule.fonts.getSize() },\n getColor: function() { return themeModule.fonts.getColor() }\n },\n spacing: {\n getSpacing: function() { return themeModule.spacing.getSpacing(); },\n },\n breakpoints: {\n get: function(size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge', position?: 'min' | 'max') { return themeModule.breakpoints.get(size, position); }\n }\n };\n if (config && config.customTheme) {\n this.theme.setCustom(config.customTheme);\n } else {\n const theme = config && config.theme ? config.theme : 'default';\n this.theme.load(theme);\n }\n }\n\n}\n","import CuraAPI from './api/cura-api';\nimport { CuraConfig } from './api/cura-api.type';\n// import { setAssetPath } from '@stencil/core';\n\n// setAssetPath(import.meta.url);\ndeclare global {\n interface Window {\n CuraAPI?: CuraAPI,\n CuraInit?: CuraConfig\n }\n}\n\nexport default function() {\n const config = window.CuraInit;\n window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();\n const api = window.CuraAPI;\n window.dispatchEvent(new CustomEvent(\"CuraAPIReady\", { detail: {api} }));\n if (config && typeof config.onReady === 'function') config.onReady(api);\n}\n","import appGlobalScript from '/Users/fellipesoares/Code/cura/packages/component-lib/src/rededor-cura-start.ts';\nexport const globalScripts = appGlobalScript;\n"],"mappings":"0CAGqBA,EAKnB,WAAAC,CAAaC,GACXC,KAAKC,gBAAkBF,GAAUA,EAAOE,gBAAkBF,EAAOE,gBAAkB,UACnF,MAAMC,EAAc,IAAIC,EACxBH,KAAKI,MAAQ,CACXC,KAAM,SAASC,GAAoBJ,EAAYG,KAAKC,EAAU,EAC9DC,UAAW,SAASC,GAA2CN,EAAYK,UAAUC,EAAwB,EAC7GC,OAAQ,CACNC,SAAU,SAASC,EAAyBC,GAAoB,OAAOV,EAAYO,OAAOC,SAASC,EAAgBC,EAAQ,GAE7HC,MAAO,CACLC,UAAW,SAASC,GAAiB,OAAOb,EAAYW,MAAMC,UAAUC,EAAK,EAC7EC,WAAY,WAAa,OAAOd,EAAYW,MAAMG,YAAY,EAC9DC,QAAS,WAAa,OAAOf,EAAYW,MAAMI,SAAS,EACxDP,SAAU,WAAa,OAAOR,EAAYW,MAAMH,UAAU,GAE5DQ,QAAS,CACPC,WAAY,WAAa,OAAOjB,EAAYgB,QAAQC,YAAa,GAEnEC,YAAa,CACXC,IAAK,SAASC,EAA2DC,GAA4B,OAAOrB,EAAYkB,YAAYC,IAAIC,EAAMC,EAAU,IAG5J,GAAIxB,GAAUA,EAAOyB,YAAa,CAChCxB,KAAKI,MAAMG,UAAUR,EAAOyB,Y,KACvB,CACL,MAAMpB,EAAQL,GAAUA,EAAOK,MAAQL,EAAOK,MAAQ,UACtDJ,KAAKI,MAAMC,KAAKD,E,gBCrBpB,MAAML,EAAS0B,OAAOC,SACtBD,OAAO5B,QAAUE,EAAS,IAAIF,EAAQE,GAAU,IAAIF,EACpD,MAAM8B,EAAMF,OAAO5B,QACnB4B,OAAOG,cAAc,IAAIC,YAAY,eAAgB,CAAEC,OAAQ,CAACH,UAChE,GAAI5B,UAAiBA,EAAOgC,UAAY,WAAYhC,EAAOgC,QAAQJ,EACrE,CCjBY,MAACK,EAAgBC,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as o,H as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-dark-neutral-purewhite);border-radius:var(--border-radius)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{background-color:var(--color-lighter-color-darker)}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{background-color:var(--color-light-color-darker)}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.disabled,:host a.disabled{cursor:not-allowed}:host button.disabled::before,:host a.disabled::before{border-color:var(--neutral-dark)}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 3px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 2px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}';const n=a;const e=class{constructor(o){t(this,o);if(o.$hostElement$["s-ei"]){this.internals=o.$hostElement$["s-ei"]}else{this.internals=o.$hostElement$.attachInternals();o.$hostElement$["s-ei"]=this.internals}this.type="button";this.size="large";this.disabled=false;this.isLoading=false;this.iconName=undefined;this.iconset="default";this.iconPosition="left";this.iconOnly=false;this.href=undefined;this.target="_self";this.color="primary";this.background="light";this.fontColor="dark";this.textAlign="left";this.justify=false;this.styles={};this.hovered=false}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--text-align"]=this.textAlign;this.setColors()}getClasses(){var t;const o={};o[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;o[`icon-${this.iconPosition.toLowerCase()}`]=true;o[`icon-only`]=this.iconOnly;o["disabled"]=this.disabled;o["isLoading"]=this.isLoading;o["justify"]=this.justify;return o}setColors(){const t=[{name:"--color-dark-neutral-purewhite",thema:`${this.background==="light"?`${this.color}-dark`:"neutral-purewhite"}`},{name:"--color-lighter-color-darker",thema:`${this.background==="light"?`${this.color}-lighter`:`${this.color}-darker`}`},{name:"--color-light-color-darker",thema:`${this.background==="light"?`${this.color}-light`:`${this.color}-lighter`}`},{name:"--neutral-dark",thema:"neutral-dark"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getIcon(){if(!this.iconName)return"";const t=this.size==="large"?20:16;return o("cura-icon",{name:this.iconName,iconset:this.iconset,size:t,color:this.getSymbolColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}getSymbolColor(){if(this.disabled)return"neutral-dark";return this.fontColor==="light"?"neutral-purewhite":`${this.color}-darker`}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault();return}if(!this.href){if(this.type==="submit"&&this.internals.form)this.internals.form.submit();if(this.type==="reset"&&this.internals.form)this.internals.form.reset()}}render(){const t=this.getSymbolColor();const a=s[this.size]||s["default"];return o(i,{key:"0a0c25f94d0c18dbb90e4836ca3e7bcbbe10d032"},this.href?o("a",{href:this.disabled?"":this.href,target:this.target,class:this.getClasses(),style:this.styles,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as o,H as i}from"./p-fd5ed6b0.js";import{l as s}from"./p-efcb32eb.js";const a=':host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:transparent;box-sizing:border-box;border:none}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button::before,:host a::before{content:"";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:2px solid var(--color-dark-neutral-purewhite);border-radius:var(--border-radius)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{background-color:var(--color-lighter-color-darker)}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{background-color:var(--color-light-color-darker)}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 10px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 2px);min-height:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button.justify .button-container,:host a.justify .button-container{width:100%}:host button cura-label,:host a cura-label{flex:1;text-align:var(--text-align, "left")}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host button.small.icon-left cura-icon,:host a.medium.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2px)}:host button.medium.icon-right cura-icon,:host button.small.icon-right cura-icon,:host a.medium.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2px)}:host button.disabled,:host a.disabled{cursor:not-allowed}:host button.disabled::before,:host a.disabled::before{border-color:var(--neutral-dark)}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3px) calc(var(--base-spacing) * 3px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 3px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 2px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}';const n=a;const e=class{constructor(o){t(this,o);if(o.$hostElement$["s-ei"]){this.internals=o.$hostElement$["s-ei"]}else{this.internals=o.$hostElement$.attachInternals();o.$hostElement$["s-ei"]=this.internals}this.type="button";this.size="large";this.disabled=false;this.isLoading=false;this.iconName=undefined;this.iconset="default";this.iconPosition="left";this.iconOnly=false;this.href=undefined;this.target="_self";this.color="primary";this.background="light";this.fontColor="dark";this.textAlign="left";this.justify=false;this.styles={};this.hovered=false}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--base-spacing"]=window.CuraAPI.theme.spacing.getSpacing();this.styles["--neutral-white"]=window.CuraAPI.theme.colors.getColor(`neutral-white`);this.styles["--neutral-base"]=window.CuraAPI.theme.colors.getColor(`neutral-base`);this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor(`neutral-dark`);this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium;this.styles["--text-align"]=this.textAlign;this.setColors()}getClasses(){var t;const o={};o[`${(t=this.size)===null||t===void 0?void 0:t.toLowerCase()}`]=true;o[`icon-${this.iconPosition.toLowerCase()}`]=true;o[`icon-only`]=this.iconOnly;o["disabled"]=this.disabled;o["isLoading"]=this.isLoading;o["justify"]=this.justify;return o}setColors(){const t=[{name:"--color-dark-neutral-purewhite",thema:`${this.background==="light"?`${this.color}-dark`:"neutral-purewhite"}`},{name:"--color-lighter-color-darker",thema:`${this.background==="light"?`${this.color}-lighter`:`${this.color}-darker`}`},{name:"--color-light-color-darker",thema:`${this.background==="light"?`${this.color}-light`:`${this.color}-lighter`}`},{name:"--neutral-dark",thema:"neutral-dark"}];t.forEach((t=>this.styles[t.name]=window.CuraAPI.theme.colors.getColor(t.thema)));this.styles=Object.assign({},this.styles)}getIcon(){if(!this.iconName)return"";const t=this.size==="large"?20:16;return o("cura-icon",{name:this.iconName,iconset:this.iconset,size:t,color:this.getSymbolColor()})}handleMouseEnter(){if(this.disabled)return;this.hovered=true}handleMouseLeave(){this.hovered=false}getSymbolColor(){if(this.disabled)return"neutral-dark";return this.fontColor==="light"?"neutral-purewhite":`${this.color}-darker`}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault();return}if(!this.href){if(this.type==="submit"&&this.internals.form)this.internals.form.submit();if(this.type==="reset"&&this.internals.form)this.internals.form.reset()}}render(){const t=this.getSymbolColor();const a=s[this.size]||s["default"];return o(i,{key:"0a0c25f94d0c18dbb90e4836ca3e7bcbbe10d032"},this.href?o("a",{href:this.disabled?"":this.href,target:this.target,class:this.getClasses(),style:this.styles,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave()},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"normal",color:t},o("slot",null))),o("cura-loader-circle",{size:this.size,color:t})):o("button",{class:this.getClasses(),style:this.styles,disabled:this.disabled||null,onClick:t=>this.handleClick(t),onMouseEnter:()=>this.handleMouseEnter(),onMouseLeave:()=>this.handleMouseLeave(),type:this.type},o("span",{class:"button-container"},this.getIcon(),o("cura-label",{size:a,lineHeight:"normal",color:t},o("slot",null))),o("cura-loader-circle",{size:this.size,color:t})))}static get formAssociated(){return true}static get watchers(){return{background:["setColors"],color:["setColors","getSymbolColor"],fontColor:["getSymbolColor"]}}};e.style=n;export{e as cura_button_outline};
|
|
2
|
+
//# sourceMappingURL=p-dbab7864.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["curaButtonOutlineCss","CuraButtonOutlineStyle0","CuraButtonOutline","connectedCallback","this","weights","window","CuraAPI","theme","fonts","getWeights","styles","spacing","getSpacing","colors","getColor","getSize","getFamily","medium","textAlign","setColors","getClasses","classes","_a","size","toLowerCase","iconPosition","iconOnly","disabled","isLoading","justify","name","thema","background","color","forEach","Object","assign","getIcon","iconName","iconSize","h","iconset","getSymbolColor","handleMouseEnter","hovered","handleMouseLeave","fontColor","handleClick","e","preventDefault","href","type","internals","form","submit","reset","render","symbolColor","labelSize","labelSizes","Host","key","target","class","style","onClick","onMouseEnter","onMouseLeave","lineHeight"],"sources":["src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-dark-neutral-purewhite);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):not(.isLoading):hover {\n background-color: var(--color-lighter-color-darker);\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active {\n background-color: var(--color-light-color-darker);\n }\n\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label();\n\n\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n &::before {\n border-color: var(--neutral-dark);\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State, AttachInternals } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n formAssociated: true\n})\nexport class CuraButtonOutline {\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Button type: button (default) | submit | reset\n */\n @Prop({ reflect: true }) type: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({ reflect: true }) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({ reflect: true }) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({ reflect: true }) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({ reflect: true }) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({ reflect: true }) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({ reflect: true }) href: string;\n /**\n * Set target if link.\n */\n @Prop({ reflect: true }) target = \"_self\";\n /**\n * Color base from color scheme. Default: primary.\n */\n @Prop() color = 'primary';\n /**\n * Set the font background to dark or light.\n */\n @Prop() background: 'dark' | 'light' = 'light';\n\n /**\n * Set the font color to dark or light.\n */\n @Prop() fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({ reflect: true }) textAlign: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Justify icons and label inside the button.\n * Vales: false (default) | true.\n */\n @Prop({ reflect: true }) justify = false;\n\n @State() styles = {};\n\n @State() hovered = false;\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n classes['justify'] = this.justify;\n return classes;\n }\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-dark-neutral-purewhite', thema: `${this.background === 'light' ? `${this.color}-dark` : 'neutral-purewhite'}` },\n { name: '--color-lighter-color-darker', thema: `${this.background === 'light' ? `${this.color}-lighter` : `${this.color}-darker`}` },\n { name: '--color-light-color-darker', thema: `${this.background === 'light' ? `${this.color}-light` : `${this.color}-lighter`}` },\n { name: '--neutral-dark', thema: 'neutral-dark' },\n ]\n\n colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema));\n this.styles = { ...this.styles };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={this.getSymbolColor()}></cura-icon>;\n }\n\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Watch('fontColor')\n @Watch('color')\n getSymbolColor() {\n if (this.disabled) return 'neutral-dark';\n return this.fontColor === 'light' ? 'neutral-purewhite' : `${this.color}-darker`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) {\n e.preventDefault();\n return;\n }\n if (!this.href) {\n if (this.type === 'submit' && this.internals.form) this.internals.form.submit();\n if (this.type === 'reset' && this.internals.form) this.internals.form.reset();\n }\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n const labelSize = labelSizes[this.size] || labelSizes[\"default\"];\n return (\n <Host>\n {this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='105%' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n type={this.type}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='105%' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"mappings":"sFAAA,MAAMA,EAAuB,q5GAC7B,MAAAC,EAAeD,E,MCQFE,EAAiB,M,mMAOmC,S,UAKD,Q,cAK1B,M,eAIC,M,qCASF,U,kBAIuB,O,cAItB,M,gCASF,Q,WAIlB,U,gBAIuB,Q,eAKD,O,eAK4B,O,aAM/B,M,YAEjB,G,aAEC,K,CAInB,iBAAAC,GACEC,KAAKC,QAAUC,OAAOC,QAAQC,MAAMC,MAAMC,aAC1CN,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMI,QAAQC,aAC7DT,KAAKO,OAAO,mBAAqBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,iBACtEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,eAAiBL,OAAOC,QAAQC,MAAMC,MAAMO,UACxDZ,KAAKO,OAAO,iBAAmBL,OAAOC,QAAQC,MAAMC,MAAMQ,YAC1Db,KAAKO,OAAO,wBAA0BP,KAAKC,QAAQa,OACnDd,KAAKO,OAAO,gBAAkBP,KAAKe,UACnCf,KAAKgB,W,CAIP,UAAAC,G,MACE,MAAMC,EAAU,GAChBA,EAAQ,IAAGC,EAAAnB,KAAKoB,QAAI,MAAAD,SAAA,SAAAA,EAAEE,iBAAmB,KACzCH,EAAQ,QAAQlB,KAAKsB,aAAaD,iBAAmB,KACrDH,EAAQ,aAAelB,KAAKuB,SAC5BL,EAAQ,YAAclB,KAAKwB,SAC3BN,EAAQ,aAAelB,KAAKyB,UAC5BP,EAAQ,WAAalB,KAAK0B,QAC1B,OAAOR,C,CAKT,SAAAF,GACE,MAAMN,EAAS,CACb,CAAEiB,KAAM,iCAAk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uC,iBACzB,MAAMgB,EAAYC,EAAWxD,KAAKoB,OAASoC,EAAW,WACtD,OACEnB,EAACoB,EAAI,CAAAC,IAAA,4CACF1D,KAAK+C,KACJV,EAAA,KAAGU,KAAM/C,KAAKwB,SAAW,GAAKxB,KAAK+C,KACjCY,OAAQ3D,KAAK2D,OACbC,MAAO5D,KAAKiB,aACZ4C,MAAO7D,KAAKO,OACZuD,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,oBACzBL,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,OAAOnC,MAAOwB,GAAajB,EAAA,eAErEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,KAG9CjB,EAAA,UAAQuB,MAAO5D,KAAKiB,aAClB4C,MAAO7D,KAAKO,OACZiB,SAAUxB,KAAKwB,UAAY,KAC3BsC,QAAUjB,GAAM7C,KAAK4C,YAAYC,GACjCkB,aAAc,IAAM/D,KAAKwC,mBACzBwB,aAAc,IAAMhE,KAAK0C,mBACzBM,KAAMhD,KAAKgD,MACXX,EAAA,QAAMuB,MAAM,oBACT5D,KAAKkC,UACNG,EAAA,cAAYjB,KAAMmC,EAAWU,WAAW,OAAOnC,MAAOwB,GAAajB,EAAA,eAErEA,EAAA,sBAAoBjB,KAAMpB,KAAKoB,KAAMU,MAAOwB,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["curaButtonOutlineCss","CuraButtonOutlineStyle0","CuraButtonOutline","connectedCallback","this","weights","window","CuraAPI","theme","fonts","getWeights","styles","spacing","getSpacing","colors","getColor","getSize","getFamily","medium","textAlign","setColors","getClasses","classes","_a","size","toLowerCase","iconPosition","iconOnly","disabled","isLoading","justify","name","thema","background","color","forEach","Object","assign","getIcon","iconName","iconSize","h","iconset","getSymbolColor","handleMouseEnter","hovered","handleMouseLeave","fontColor","handleClick","e","preventDefault","href","type","internals","form","submit","reset","render","symbolColor","labelSize","labelSizes","Host","key","target","class","style","onClick","onMouseEnter","onMouseLeave","lineHeight"],"sources":["src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n box-sizing: border-box;\n border: none;\n\n &::before {\n content: \"\";\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0px;\n top: 0px;\n box-sizing: border-box;\n border: 2px solid var(--color-dark-neutral-purewhite);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):not(.isLoading):hover {\n background-color: var(--color-lighter-color-darker);\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active {\n background-color: var(--color-light-color-darker);\n }\n\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label();\n\n\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n &::before {\n border-color: var(--neutral-dark);\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State, AttachInternals } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n formAssociated: true\n})\nexport class CuraButtonOutline {\n\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Button type: button (default) | submit | reset\n */\n @Prop({ reflect: true }) type: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({ reflect: true }) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({ reflect: true }) isLoading = false;\n\n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({ reflect: true }) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({ reflect: true }) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({ reflect: true }) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({ reflect: true }) href: string;\n /**\n * Set target if link.\n */\n @Prop({ reflect: true }) target = \"_self\";\n /**\n * Color base from color scheme. Default: primary.\n */\n @Prop() color = 'primary';\n /**\n * Set the font background to dark or light.\n */\n @Prop() background: 'dark' | 'light' = 'light';\n\n /**\n * Set the font color to dark or light.\n */\n @Prop() fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({ reflect: true }) textAlign: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Justify icons and label inside the button.\n * Vales: false (default) | true.\n */\n @Prop({ reflect: true }) justify = false;\n\n @State() styles = {};\n\n @State() hovered = false;\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n\n\n getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n classes['justify'] = this.justify;\n return classes;\n }\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-dark-neutral-purewhite', thema: `${this.background === 'light' ? `${this.color}-dark` : 'neutral-purewhite'}` },\n { name: '--color-lighter-color-darker', thema: `${this.background === 'light' ? `${this.color}-lighter` : `${this.color}-darker`}` },\n { name: '--color-light-color-darker', thema: `${this.background === 'light' ? `${this.color}-light` : `${this.color}-lighter`}` },\n { name: '--neutral-dark', thema: 'neutral-dark' },\n ]\n\n colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.thema));\n this.styles = { ...this.styles };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={this.getSymbolColor()}></cura-icon>;\n }\n\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Watch('fontColor')\n @Watch('color')\n getSymbolColor() {\n if (this.disabled) return 'neutral-dark';\n return this.fontColor === 'light' ? 'neutral-purewhite' : `${this.color}-darker`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) {\n e.preventDefault();\n return;\n }\n if (!this.href) {\n if (this.type === 'submit' && this.internals.form) this.internals.form.submit();\n if (this.type === 'reset' && this.internals.form) this.internals.form.reset();\n }\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n const labelSize = labelSizes[this.size] || labelSizes[\"default\"];\n return (\n <Host>\n {this.href ? (\n <a href={this.disabled ? '' : this.href}\n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='normal' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n type={this.type}>\n <span class=\"button-container\">\n {this.getIcon()}\n <cura-label size={labelSize} lineHeight='normal' color={symbolColor}><slot></slot></cura-label>\n </span>\n <cura-loader-circle size={this.size} color={symbolColor}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"mappings":"sFAAA,MAAMA,EAAuB,q5GAC7B,MAAAC,EAAeD,E,MCQFE,EAAiB,M,mMAOmC,S,UAKD,Q,cAK1B,M,eAIC,M,qCASF,U,kBAIuB,O,cAItB,M,gCASF,Q,WAIlB,U,gBAIuB,Q,eAKD,O,eAK4B,O,aAM/B,M,YAEjB,G,aAEC,K,CAInB,iBAAAC,GACEC,KAAKC,QAAUC,OAAOC,QAAQC,MAAMC,MAAMC,aAC1CN,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMI,QAAQC,aAC7DT,KAAKO,OAAO,mBAAqBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,iBACtEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,kBAAoBL,OAAOC,QAAQC,MAAMM,OAAOC,SAAS,gBACrEX,KAAKO,OAAO,eAAiBL,OAAOC,QAAQC,MAAMC,MAAMO,UACxDZ,KAAKO,OAAO,iBAAmBL,OAAOC,QAAQC,MAAMC,MAAMQ,YAC1Db,KAAKO,OAAO,wBAA0BP,KAAKC,QAAQa,OACnDd,KAAKO,OAAO,gBAAkBP,KAAKe,UACnCf,KAAKgB,W,CAIP,UAAAC,G,MACE,MAAMC,EAAU,GAChBA,EAAQ,IAAGC,EAAAnB,KAAKoB,QAAI,MAAAD,SAAA,SAAAA,EAAEE,iBAAmB,KACzCH,EAAQ,QAAQlB,KAAKsB,aAAa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host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown .dropdown-search-list{z-index:1000}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:1%;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex;margin-right:4px}.dropdown-mobile .dropdown-input-search cura-input-text{padding:12px 8px 12px 0px}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:calc(100vh - var(--dynamic-input-search-height, 0));max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";const r=d;const n=class{constructor(o){i(this,o);this.valueChanged=t(this,"valueChanged",7);this.onselect=t(this,"onselect",7);this.overlayElement=null;this.adjustInputPosition=()=>{setTimeout((()=>{var i,t;const o=(window===null||window===void 0?void 0:window.innerHeight)<this.screenDefaultHeight;const e=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-mobile");if(e){e.style.position=o?"absolute":"fixed";e.style.bottom=o?`${((t=window===null||window===void 0?void 0:window.screen)===null||t===void 0?void 0:t.height)-(window===null||window===void 0?void 0:window.innerHeight)}px`:"0";window.scroll({top:0,left:0})}}),300)};this.handleSlotChange=()=>{this.options=Array.from(this.host.querySelectorAll("cura-dropdown-search-option"));this.addClickListenersToOptions();this.updateHoveredIndex()};this.handleInputChange=i=>{const t=i.target;this.value=t.value;this.onValueChange(this.value)};this.handleKeyDown=i=>{if(i.key==="ArrowDown"){i.preventDefault();this.moveHighlight(1)}else if(i.key==="ArrowUp"){i.preventDefault();this.moveHighlight(-1)}else if(i.key==="Enter"){i.preventDefault();if(this.hoveredIndex>-1){this.handleOnBlur();this.onSelectedOption(this.hoveredIndex)}}};this.handleResize=()=>{this.isMobile=window.innerWidth<768;if(this.isDropdownOpen){if(this.isMobile){this.showOverlay()}else{this.resetDropdownStyles();this.removeOverlay()}}};this.setUp=()=>{this.handleResize();this.adjustInputPosition()};this.size="large";this.status="default";this.disabled=false;this.name=undefined;this.required=false;this.selected=false;this.value="";this.placeholder="";this.label="";this.iconName="search";this.dropdownMaxHeight="630px";this.overlayVisible=false;this.isDropdownOpen=false;this.styles={};this.isMobile=window.innerWidth<768;this.mode="default";this.inputTextRef=undefined;this.isOnBlurInput=true;this.hoveredIndex=-1;this.options=[];this.originalOverflow="";this.screenDefaultHeight=0}connectedCallback(){this.weights=window.CuraAPI.theme.fonts.getWeights();this.styles["--info-base"]=window.CuraAPI.theme.colors.getColor("info-base");this.styles["--neutral-purewhite"]=window.CuraAPI.theme.colors.getColor("neutral-purewhite");this.styles["--neutral-light"]=window.CuraAPI.theme.colors.getColor("neutral-light");this.styles["--neutral-dark"]=window.CuraAPI.theme.colors.getColor("neutral-dark");this.styles["--neutral-black-shadow"]=window.CuraAPI.theme.colors.getColor(`neutral-black`,.16);this.styles["--error-dark"]=window.CuraAPI.theme.colors.getColor("error-dark");this.styles["--error-lighter"]=window.CuraAPI.theme.colors.getColor("error-lighter");this.styles["--breakpoints"]=window.CuraAPI.theme.breakpoints.get();this.styles["--font-size"]=window.CuraAPI.theme.fonts.getSize();this.styles["--font-family"]=window.CuraAPI.theme.fonts.getFamily();this.styles["--font-weight-medium"]=this.weights.medium}onValueChange(i){this.value=i;this.updateSelectedOption(i);this.valueChanged.emit(i)}componentWillLoad(){this.updateSelectedOption(this.value)}componentDidRender(){if(this.isDropdownOpen&&this.isMobile){this.showOverlay();this.getDropdownSearchListHeight()}else{this.removeOverlay()}}componentDidLoad(){var i;this.screenDefaultHeight=window===null||window===void 0?void 0:window.innerHeight;window===null||window===void 0?void 0:window.addEventListener("resize",this.setUp);(i=window===null||window===void 0?void 0:window.visualViewport)===null||i===void 0?void 0:i.addEventListener("resize",this.adjustInputPosition)}disconnectedCallback(){var i;window===null||window===void 0?void 0:window.removeEventListener("resize",this.setUp);(i=window===null||window===void 0?void 0:window.visualViewport)===null||i===void 0?void 0:i.removeEventListener("resize",this.adjustInputPosition)}showOverlay(){if(!this.overlayElement){this.overlayElement=document.createElement("div");this.overlayElement.className="dropdown-overlay";this.overlayElement.style.position="fixed";this.overlayElement.style.top="0";this.overlayElement.style.left="0";this.overlayElement.style.width="100%";this.overlayElement.style.height="100%";this.overlayElement.style.zIndex="9999";this.overlayElement.style.backgroundColor="white";document.body.appendChild(this.overlayElement);this.originalOverflow=document.body.style.overflow;document.body.style.overflow="hidden"}}removeOverlay(){if(this.overlayElement&&this.overlayElement.parentNode===document.body){document.body.removeChild(this.overlayElement);this.overlayElement=null;document.body.style.overflow=this.originalOverflow}}addClickListenersToOptions(){this.options.forEach(((i,t)=>{i===null||i===void 0?void 0:i.addEventListener("optionSelected",(()=>this.onSelectedOption(t)))}))}updateSelectedOption(i){const t=this.options.findIndex((t=>t.getAttribute("value")===i));this.hoveredIndex=t;this.updateOptionAttribute("hovered",this.hoveredIndex);this.updateOptionAttribute("selected",this.hoveredIndex);this.scrollHoveredOptionIntoView();this.adjustInputPosition()}onSelectedOption(i){setTimeout((()=>{const t=this.options[i];if(t.selectable){const i=t.getAttribute("value")||t.textContent;this.value=i||"";this.updateSelectedOption(this.value);this.isDropdownOpen=false;this.isOnBlurInput=true;this.resetDropdownStyles();this.removeOverlay()}}),200)}moveHighlight(i){const t=this.options;const o=(this.hoveredIndex+i+t.length)%t.length;this.hoveredIndex=o;this.updateOptionAttribute("hovered",this.hoveredIndex);this.scrollHoveredOptionIntoView()}updateOptionAttribute(i,t){this.options.forEach(((o,e)=>{o[i]=e===t}))}updateHoveredIndex(){const i=this.options;const t=this.value;this.hoveredIndex=i.findIndex((i=>i.getAttribute("value")===t))}scrollHoveredOptionIntoView(){var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-search-list");const o=this.options[this.hoveredIndex];if(t&&o){const i=o.getBoundingClientRect();const e=t.getBoundingClientRect();if(i.bottom>e.bottom){t.scrollTop+=i.bottom-e.bottom}if(i.top<e.top){t.scrollTop-=e.top-i.top}}}handleOnBlur(){if(this.isOnBlurInput===true){setTimeout((()=>{this.isDropdownOpen=false;this.resetDropdownStyles();this.removeOverlay()}),200)}}getClasses(){return{"dropdown-input-search":true,"dropdown-open":this.isDropdownOpen,disabled:this.disabled,[this.status]:true}}getDropdownClasses(){return{"dropdown-search-list":true,visible:this.options.length&&this.isDropdownOpen?true:false}}hostCSSProperties(){return{"--dropdown-max-height":this.dropdownMaxHeight}}handleOnFocus(){this.isDropdownOpen=true}getDropdownSearchListHeight(){setTimeout((()=>{var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-input-search");if(t){this.host.style.setProperty("--dynamic-input-search-height",`${t.offsetHeight}px`)}}),310)}handleGoBack(){this.resetDropdownStyles();this.isMobile=false}resetDropdownStyles(){var i;const t=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.querySelector(".dropdown-mobile");if(t&&t.style.position==="fixed"){t.style.position="relative";t.style.removeProperty("bottom")}}render(){const i=this.isMobile&&this.isDropdownOpen;return o(e,{key:"29caf35386c324e85a5b68caa280193e8f1a3aae",style:this.hostCSSProperties(),class:"dropdown-overlay"},o("div",{key:"879dc628c89920323a97f5b29aeadf6e774615ef",class:`dropdown ${i?"dropdown-mobile":""}`,style:this.styles},o("div",{key:"31c2df66c5311abedfd1661fb9d8b135dde4ea8a",class:this.getClasses()},this.isMobile&&this.isDropdownOpen&&o("cura-button-transparent",{key:"418fa19788b7dd8374d4c9c78837ad89c9f11f9e",fontColor:"dark",onClick:()=>this.handleGoBack(),iconName:"arrowLeft",size:"medium",iconOnly:true,color:"primary"}),o("cura-input-text",{key:"78dfa84f63f4a5a3b72f94e589b9c362d8e78e19",disabled:this.disabled,label:this.label,part:"cura-input-field",mode:i?"transparent":"default",required:this.required,hideErrorIcon:this.status==="error",iconName:this.iconName||"search",value:this.value,status:this.status,onValueChange:i=>this.onValueChange(i.target.value),onInput:i=>this.handleInputChange(i),onFocus:()=>this.handleOnFocus(),onClick:()=>window.innerWidth<768?this.isMobile=true:null,onBlur:()=>{this.handleOnBlur()},placeholder:this.placeholder,size:this.size,onKeyDown:this.handleKeyDown},o("slot",{key:"e7f13fc467083f08b4666f4323b8734fb734fe1c",name:"helperText"}))),o("div",{key:"9a39a16c1dfefd6481593ce062036e19cd1b65fa",id:"dropdown-search-list",class:this.getDropdownClasses()},o("slot",{key:"36af7eb7212ea066af0edb68b5e12bf9f931fae1",name:"dropdown-search-option",onSlotchange:this.handleSlotChange}))))}get host(){return s(this)}static get watchers(){return{value:["onValueChange"]}}};n.style=r;export{n as cura_dropdown_search};
|
|
2
|
+
//# sourceMappingURL=p-f30270f0.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["curaDropdownSearchCss","CuraDropdownSearchStyle0","CuraDropdownSearch","this","overlayElement","adjustInputPosition","setTimeout","isKeyboardOpen","window","innerHeight","screenDefaultHeight","dropdown","_a","host","shadowRoot","querySelector","style","position","bottom","_b","screen","height","scroll","top","left","handleSlotChange","options","Array","from","querySelectorAll","addClickListenersToOptions","updateHoveredIndex","handleInputChange","event","input","target","value","onValueChange","handleKeyDown","key","preventDefault","moveHighlight","hoveredIndex","handleOnBlur","onSelectedOption","handleResize","isMobile","innerWidth","isDropdownOpen","showOverlay","resetDropdownStyles","removeOverlay","setUp","connectedCallback","weights","CuraAPI","theme","fonts","getWeights","styles","colors","getColor","breakpoints","get","getSize","getFamily","medium","newValue","updateSelectedOption","valueChanged","emit","componentWillLoad","componentDidRender","getDropdownSearchListHeight","componentDidLoad","addEventListener","visualViewport","disconnectedCallback","removeEventListener","document","createElement","className","width","zIndex","backgroundColor","body","appendChild","originalOverflow","overflow","parentNode","removeChild","forEach","option","index","selectedOptionIndex","findIndex","getAttribute","updateOptionAttribute","scrollHoveredOptionIntoView","selectedOption","selectable","selectedValue","textContent","isOnBlurInput","direction","visibleOptions","newIndex","length","attribute","indexToUpdate","currentValue","container","hoveredOption","optionRect","getBoundingClientRect","containerRect","scrollTop","getClasses","disabled","status","getDropdownClasses","visible","hostCSSProperties","dropdownMaxHeight","handleOnFocus","dropdownInputSearchElement","setProperty","offsetHeight","handleGoBack","removeProperty","render","isMobileDropdown","h","Host","class","fontColor","onClick","iconName","size","iconOnly","color","label","part","mode","required","hideErrorIcon","e","onInput","onFocus","onBlur","placeholder","onKeyDown","name","id","onSlotchange"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search.scss?tag=cura-dropdown-search&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"sourcesContent":["@import '../../../scss/mixins/shadows.scss';\n\n:host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown {\n display: flex;\n position: relative;\n\n flex-direction: column;\n width: inherit;\n\n .dropdown-search-list {\n z-index: 1000;\n }\n\n &-input-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n\n\n &.dropdown-open {\n ::part(cura-input-field) {\n border-radius: 4px 4px 0px 0px;\n }\n ::slotted([slot='helperText']) {\n display: none;\n }\n\n cura-input-text {\n ::slotted([slot='helperText']) {\n display: none;\n }\n }\n }\n }\n\n &-search-list {\n position: absolute;\n top: calc(100% - 8px);\n width: 100%;\n max-height: var(--dropdown-max-height);\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n @include shadow-level3(--neutral-black-shadow);\n border-radius: 0px 0px 4px 4px;\n border-top: 0 var(--neutral-light);\n border-right: 2px solid var(--neutral-light);\n border-bottom: 2px solid var(--neutral-light);\n border-left: 2px solid var(--neutral-light);\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n display: none;\n\n &.visible {\n display: block;\n }\n\n &-input-search {\n width: inherit;\n\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 16px 8px;\n border-bottom: 2px solid var(--info-base);\n background-color: var(--neutral-purewhite);\n\n cura-input-text {\n width: inherit;\n }\n\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n }\n }\n\n &-mobile {\n position: fixed;\n top: 1%;\n left: 0;\n right: 0;\n width: 100%;\n z-index: 10000;\n \n .dropdown-input-search {\n display: flex;\n background-color: var(--neutral-purewhite);\n border-bottom: 2px solid var(--info-base);\n z-index: 10000;\n cura-button-transparent {\n display: flex;\n margin-right: 4px;\n }\n cura-input-text {\n padding: 12px 8px 12px 0px;\n }\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n &.dropdown-open {\n display: flex;\n\n ::slotted([slot='helperText']) {\n display: block;\n }\n }\n }\n\n .dropdown-search-list {\n position: static;\n width: 100%;\n height: calc(100vh - var(--dynamic-input-search-height, 0));\n max-height: none;\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n box-shadow: none;\n border: none;\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n z-index: 10000;\n }\n }\n}\n","import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n /**\n *\n * Stores the original value of the 'overflow' style of the body\n * before blocking the scroll.\n */\n @State() originalOverflow: string = '';\n @State() screenDefaultHeight = 0;\n\n private adjustInputPosition = () => {\n setTimeout(() => {\n const isKeyboardOpen = window?.innerHeight < this.screenDefaultHeight;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLElement;\n if (dropdown) {\n dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';\n dropdown.style.bottom = isKeyboardOpen ? `${window?.screen?.height - window?.innerHeight}px` : '0';\n window.scroll({ top: 0, left: 0 });\n }\n }, 300);\n };\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.value = newValue;\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n this.getDropdownSearchListHeight();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n this.screenDefaultHeight = window?.innerHeight;\n window?.addEventListener('resize', this.setUp);\n window?.visualViewport?.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window?.removeEventListener('resize', this.setUp);\n window?.visualViewport?.removeEventListener('resize', this.adjustInputPosition);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n\n this.originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n document.body.style.overflow = this.originalOverflow;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option?.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollHoveredOptionIntoView();\n this.adjustInputPosition();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n };\n\n private onSelectedOption(index: number) {\n setTimeout(() => {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }, 200);\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollHoveredOptionIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollHoveredOptionIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.resetDropdownStyles();\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n getDropdownSearchListHeight() {\n setTimeout(() => {\n const dropdownInputSearchElement = this.host.shadowRoot?.querySelector('.dropdown-input-search') as HTMLInputElement;\n if (dropdownInputSearchElement) {\n this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);\n }\n }, 310)\n }\n\n handleGoBack() {\n this.resetDropdownStyles();\n this.isMobile = false;\n }\n\n resetDropdownStyles() {\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n if (dropdown && dropdown.style.position === 'fixed') {\n dropdown.style.position = 'relative';\n dropdown.style.removeProperty('bottom');\n }\n }\n\n setUp = () => {\n this.handleResize()\n this.adjustInputPosition();\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent fontColor=\"dark\" onClick={() => this.handleGoBack()} iconName=\"arrowLeft\" size=\"medium\" iconOnly color=\"primary\"></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAwB,g9EAC9B,MAAAC,EAAeD,E,MCMFE,EAAkB,M,uGAmHrBC,KAAAC,eAAwC,KAYxCD,KAAAE,oBAAsB,KAC5BC,YAAW,K,QACT,MAAMC,GAAiBC,SAAM,MAANA,cAAM,SAANA,OAAQC,aAAcN,KAAKO,oBAClD,MAAMC,GAAWC,EAAAT,KAAKU,KAAKC,cAAU,MAAAF,SAAA,SAAAA,EAAEG,cAAc,oBACrD,GAAIJ,EAAU,CACZA,EAASK,MAAMC,SAAWV,EAAiB,WAAa,QACxDI,EAASK,MAAME,OAASX,EAAiB,KAAGY,EAAAX,SAAM,MAANA,cAAM,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A7F,IAAA,2CAAK+F,MAAO,YAAYH,EAAmB,kBAAoB,KAAMnH,MAAOb,KAAKwD,QAC/EyE,EAAA,OAAA7F,IAAA,2CAAK+F,MAAOnI,KAAKkH,cAChBlH,KAAK2C,UAAY3C,KAAK6C,gBACnBoF,EAAA,2BAAA7F,IAAA,2CAAyBgG,UAAU,OAAOC,QAAS,IAAMrI,KAAK6H,eAAgBS,SAAS,YAAYC,KAAK,SAASC,SAAQ,KAACC,MAAM,YAElIR,EAAA,mBAAA7F,IAAA,2CACE+E,SAAUnH,KAAKmH,SACfuB,MAAO1I,KAAK0I,MACZC,KAAK,mBACLC,KAAMZ,EAAmB,cAAgB,UACzCa,SAAU7I,KAAK6I,SACfC,cAAe9I,KAAKoH,SAAW,QAC/BkB,SAAUtI,KAAKsI,UAAY,SAC3BrG,MAAOjC,KAAKiC,MACZmF,OAAQpH,KAAKoH,OACblF,cAAe6G,GAAK/I,KAAKkC,cAAc6G,EAAE/G,OAAOC,OAChD+G,QAASD,GAAK/I,KAAK6B,kBAAkBkH,GACrCE,QAAS,IAAMjJ,KAAKyH,gBACpBY,QAAS,IAAOhI,OAAOuC,WAAa,IAAO5C,KAAK2C,SAAW,KAAQ,KACnEuG,OAAQ,KACNlJ,KAAKwC,cAAc,EAErB2G,YAAanJ,KAAKmJ,YAClBZ,KAAMvI,KAAKuI,KACXa,UAAWpJ,KAAKmC,eAEhB8F,EAAA,QAAA7F,IAAA,2CAAMiH,KAAK,iBAGfpB,EAAA,OAAA7F,IAAA,2CAAKkH,GAAG,uBAAuBnB,MAAOnI,KAAKqH,sBACzCY,EAAA,QAAA7F,IAAA,2CAAMiH,KAAK,yBAAyBE,aAAcvJ,KAAKsB,qB","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { C as CuraThemeModule } from './cura-theme-module-b23f8ac8.js';
|
|
2
|
+
|
|
3
|
+
class CuraAPI {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;
|
|
6
|
+
const themeModule = new CuraThemeModule();
|
|
7
|
+
this.theme = {
|
|
8
|
+
load: function (themeTag) { themeModule.load(themeTag); },
|
|
9
|
+
setCustom: function (customThemeDefinitions) { themeModule.setCustom(customThemeDefinitions); },
|
|
10
|
+
colors: {
|
|
11
|
+
getColor: function (colorWithDepth, opacity) { return themeModule.colors.getColor(colorWithDepth, opacity); },
|
|
12
|
+
},
|
|
13
|
+
fonts: {
|
|
14
|
+
getFamily: function (type) { return themeModule.fonts.getFamily(type); },
|
|
15
|
+
getWeights: function () { return themeModule.fonts.getWeights(); },
|
|
16
|
+
getSize: function () { return themeModule.fonts.getSize(); },
|
|
17
|
+
getColor: function () { return themeModule.fonts.getColor(); }
|
|
18
|
+
},
|
|
19
|
+
spacing: {
|
|
20
|
+
getSpacing: function () { return themeModule.spacing.getSpacing(); },
|
|
21
|
+
},
|
|
22
|
+
breakpoints: {
|
|
23
|
+
get: function (size, position) { return themeModule.breakpoints.get(size, position); }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
if (config && config.customTheme) {
|
|
27
|
+
this.theme.setCustom(config.customTheme);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const theme = config && config.theme ? config.theme : 'default';
|
|
31
|
+
this.theme.load(theme);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function appGlobalScript () {
|
|
37
|
+
const config = window.CuraInit;
|
|
38
|
+
window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();
|
|
39
|
+
const api = window.CuraAPI;
|
|
40
|
+
window.dispatchEvent(new CustomEvent("CuraAPIReady", { detail: { api } }));
|
|
41
|
+
if (config && typeof config.onReady === 'function')
|
|
42
|
+
config.onReady(api);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const globalScripts = appGlobalScript;
|
|
46
|
+
|
|
47
|
+
export { globalScripts as g };
|
|
48
|
+
|
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AC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE;aAC3J;SACH,CAAC;QACD,IAAI,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE;YAChC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;SAC1C;aAAM;YACL,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;YAChE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxB;KACF;;;;ICvBD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC/B,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3B,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC,CAAC;IACzE,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;QAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1E;;ACjBY,MAAC,aAAa,GAAG;;;;","names":[],"sources":["src/api/cura-api.ts","src/rededor-cura-start.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { CuraConfig, APIThemeFunctions, CuraCustomTheme } from './cura-api.type';\nimport CuraThemeModule from './modules/cura-theme-module';\n\nexport default class CuraAPI {\n\n theme: APIThemeFunctions;\n localAssetsPath: string;\n\n constructor (config?: CuraConfig) {\n this.localAssetsPath = config && config.localAssetsPath ? config.localAssetsPath : `/assets`;\n const themeModule = new CuraThemeModule();\n this.theme = {\n load: function(themeTag: string) { themeModule.load(themeTag); },\n setCustom: function(customThemeDefinitions: CuraCustomTheme) { themeModule.setCustom(customThemeDefinitions); },\n colors: {\n getColor: function(colorWithDepth?: string, opacity?: number) { return themeModule.colors.getColor(colorWithDepth, opacity) },\n },\n fonts: {\n getFamily: function(type?: string) { return themeModule.fonts.getFamily(type) },\n getWeights: function() { return themeModule.fonts.getWeights() },\n getSize: function() { return themeModule.fonts.getSize() },\n getColor: function() { return themeModule.fonts.getColor() }\n },\n spacing: {\n getSpacing: function() { return themeModule.spacing.getSpacing(); },\n },\n breakpoints: {\n get: function(size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge', position?: 'min' | 'max') { return themeModule.breakpoints.get(size, position); }\n }\n };\n if (config && config.customTheme) {\n this.theme.setCustom(config.customTheme);\n } else {\n const theme = config && config.theme ? config.theme : 'default';\n this.theme.load(theme);\n }\n }\n\n}\n","import CuraAPI from './api/cura-api';\nimport { CuraConfig } from './api/cura-api.type';\n// import { setAssetPath } from '@stencil/core';\n\n// setAssetPath(import.meta.url);\ndeclare global {\n interface Window {\n CuraAPI?: CuraAPI,\n CuraInit?: CuraConfig\n }\n}\n\nexport default function() {\n const config = window.CuraInit;\n window.CuraAPI = config ? new CuraAPI(config) : new CuraAPI();\n const api = window.CuraAPI;\n window.dispatchEvent(new CustomEvent(\"CuraAPIReady\", { detail: {api} }));\n if (config && typeof config.onReady === 'function') config.onReady(api);\n}\n","import appGlobalScript from '/Users/fellipesoares/Code/cura/packages/component-lib/src/rededor-cura-start.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
|