@rededor/cura 1.4.0-alpha.0 → 1.4.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/cjs/cura-accordion_12.cjs.entry.js +12 -16
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-counter.cjs.entry.js +63 -0
- package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js +83 -0
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +2 -11
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +24 -15
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/{cura-icon.definitions-8d714f6a.js → cura-icon.definitions-5223028b.js} +2 -4
- package/dist/cjs/cura-icon.definitions-5223028b.js.map +1 -0
- package/dist/cjs/cura-icons-view.cjs.entry.js +2 -5
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-input-date.cjs.entry.js +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +28 -7
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.css +51 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js +149 -0
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.js.map +1 -0
- package/dist/collection/components/badges/{cura-badge-number/cura-badge-number.stories.js → cura-badge-counter/cura-badge-counter.stories.js} +33 -13
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.stories.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +1 -1
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.css +73 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js +219 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js +126 -0
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +5 -14
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
- package/dist/collection/components/cura-card/cura-card.js +1 -1
- package/dist/collection/components/cura-icon/cura-icon.definitions.js +1 -2
- package/dist/collection/components/cura-icon/cura-icon.definitions.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.js +2 -6
- package/dist/collection/components/cura-icon/cura-icon.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.stories.js +1 -3
- package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +2 -5
- package/dist/collection/components/cura-icons-view/cura-icons-view.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +4 -2
- package/dist/collection/components/cura-modal/cura-modal.js +91 -10
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.stories.js +54 -18
- package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -1
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +26 -16
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-counter.d.ts +11 -0
- package/dist/components/cura-badge-counter.js +8 -0
- package/dist/components/cura-badge-counter.js.map +1 -0
- package/dist/components/cura-badge-counter2.js +90 -0
- package/dist/components/cura-badge-counter2.js.map +1 -0
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/{cura-badge-number.d.ts → cura-badge-pill.d.ts} +4 -4
- package/dist/components/cura-badge-pill.js +120 -0
- package/dist/components/cura-badge-pill.js.map +1 -0
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +6 -15
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-calendar2.js +1 -1
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +2 -2
- package/dist/components/cura-dropdown-search.js +26 -16
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icon2.js +3 -8
- package/dist/components/cura-icon2.js.map +1 -1
- package/dist/components/cura-icons-view.js +7 -16
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-modal.js +36 -9
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +3 -3
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +1 -1
- package/dist/components/index.js +4 -2
- 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/{p-01e301d4.entry.js → p-116a1cd6.entry.js} +2 -2
- package/dist/cura/{p-5bb8302c.entry.js → p-19f28fa8.entry.js} +2 -2
- package/dist/cura/p-19f28fa8.entry.js.map +1 -0
- package/dist/cura/{p-eda28278.entry.js → p-2545cfc7.entry.js} +2 -2
- package/dist/cura/p-35920ac0.entry.js +2 -0
- package/dist/cura/p-35920ac0.entry.js.map +1 -0
- package/dist/cura/{p-eea093b2.entry.js → p-36dbec98.entry.js} +2 -2
- package/dist/cura/{p-ed839f1e.entry.js → p-3d958d45.entry.js} +2 -2
- package/dist/cura/{p-3536c96b.entry.js → p-3e4ca7e7.entry.js} +2 -2
- package/dist/cura/{p-e5b0dd74.entry.js → p-3eca0f0c.entry.js} +2 -2
- package/dist/cura/{p-1f53580a.entry.js → p-42258230.entry.js} +2 -2
- package/dist/cura/p-48f9289b.js +2 -0
- package/dist/cura/p-48f9289b.js.map +1 -0
- package/dist/cura/{p-dbd9eab3.entry.js → p-4b496c51.entry.js} +2 -2
- package/dist/cura/p-52f854e0.entry.js +2 -0
- package/dist/cura/p-52f854e0.entry.js.map +1 -0
- package/dist/cura/{p-81c66f2b.entry.js → p-576c65b4.entry.js} +2 -2
- package/dist/cura/{p-bfb5e9e1.entry.js → p-6e4f4fbf.entry.js} +2 -2
- package/dist/cura/{p-0e28f1c8.entry.js → p-818c581f.entry.js} +2 -2
- package/dist/cura/{p-b0451cb3.entry.js → p-a91d451f.entry.js} +2 -2
- package/dist/cura/p-aa65cb50.entry.js +2 -0
- package/dist/cura/p-aa65cb50.entry.js.map +1 -0
- package/dist/cura/{p-075b02de.entry.js → p-b1a51e81.entry.js} +2 -2
- package/dist/cura/{p-f375a612.entry.js → p-bdb1a0c5.entry.js} +2 -2
- package/dist/cura/p-c4da4c44.entry.js +2 -0
- package/dist/cura/p-c4da4c44.entry.js.map +1 -0
- package/dist/cura/{p-a7ecea4a.entry.js → p-dcd2e5bb.entry.js} +2 -2
- package/dist/cura/{p-7853ab16.entry.js → p-e1a41792.entry.js} +2 -2
- package/dist/cura/p-ef593f12.entry.js +2 -0
- package/dist/cura/p-ef593f12.entry.js.map +1 -0
- package/dist/cura/p-f23c4ed8.entry.js +2 -0
- package/dist/cura/p-f23c4ed8.entry.js.map +1 -0
- package/dist/cura/p-f5d45776.entry.js +2 -0
- package/dist/esm/cura-accordion_12.entry.js +12 -16
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-counter.entry.js +59 -0
- package/dist/esm/cura-badge-counter.entry.js.map +1 -0
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-pill.entry.js +79 -0
- package/dist/esm/cura-badge-pill.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +2 -11
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-calendar.entry.js +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
- package/dist/esm/cura-dropdown-search.entry.js +24 -15
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icon.definitions-a892c0e2.js +17 -0
- package/dist/esm/cura-icon.definitions-a892c0e2.js.map +1 -0
- package/dist/esm/cura-icons-view.entry.js +2 -5
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-input-date.entry.js +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-modal.entry.js +28 -7
- package/dist/esm/cura-modal.entry.js.map +1 -1
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/badges/cura-badge-counter/cura-badge-counter.d.ts +30 -0
- package/dist/types/components/badges/{cura-badge-number/cura-badge-number.stories.d.ts → cura-badge-counter/cura-badge-counter.stories.d.ts} +26 -1
- package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.d.ts +44 -0
- package/dist/types/components/badges/cura-badge-pill/cura-badge-pill.stories.d.ts +119 -0
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +1 -2
- package/dist/types/components/cura-icon/cura-icon.definitions.d.ts +0 -1
- package/dist/types/components/cura-modal/cura-modal.d.ts +22 -3
- package/dist/types/components/cura-modal/cura-modal.stories.d.ts +42 -3
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
- package/dist/types/components.d.ts +140 -19
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/cura-badge-number.cjs.entry.js +0 -29
- package/dist/cjs/cura-badge-number.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-icon.definitions-8d714f6a.js.map +0 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +0 -28
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +0 -66
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +0 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js.map +0 -1
- package/dist/components/cura-badge-number.js +0 -8
- package/dist/components/cura-badge-number.js.map +0 -1
- package/dist/components/cura-badge-number2.js +0 -49
- package/dist/components/cura-badge-number2.js.map +0 -1
- package/dist/cura/p-0308cf6b.entry.js +0 -2
- package/dist/cura/p-0308cf6b.entry.js.map +0 -1
- package/dist/cura/p-5bb8302c.entry.js.map +0 -1
- package/dist/cura/p-7090d4a7.entry.js +0 -2
- package/dist/cura/p-7090d4a7.entry.js.map +0 -1
- package/dist/cura/p-71a2dcef.entry.js +0 -2
- package/dist/cura/p-71a2dcef.entry.js.map +0 -1
- package/dist/cura/p-9a7e3f48.entry.js +0 -2
- package/dist/cura/p-9a7e3f48.entry.js.map +0 -1
- package/dist/cura/p-a7221f0c.js +0 -2
- package/dist/cura/p-a7221f0c.js.map +0 -1
- package/dist/cura/p-d635501a.entry.js +0 -2
- package/dist/cura/p-d635501a.entry.js.map +0 -1
- package/dist/cura/p-ebed83d1.entry.js +0 -2
- package/dist/esm/cura-badge-number.entry.js +0 -25
- package/dist/esm/cura-badge-number.entry.js.map +0 -1
- package/dist/esm/cura-icon.definitions-aaa4e80f.js +0 -18
- package/dist/esm/cura-icon.definitions-aaa4e80f.js.map +0 -1
- package/dist/types/components/badges/cura-badge-number/cura-badge-number.d.ts +0 -8
- /package/dist/cura/{p-01e301d4.entry.js.map → p-116a1cd6.entry.js.map} +0 -0
- /package/dist/cura/{p-eda28278.entry.js.map → p-2545cfc7.entry.js.map} +0 -0
- /package/dist/cura/{p-eea093b2.entry.js.map → p-36dbec98.entry.js.map} +0 -0
- /package/dist/cura/{p-ed839f1e.entry.js.map → p-3d958d45.entry.js.map} +0 -0
- /package/dist/cura/{p-3536c96b.entry.js.map → p-3e4ca7e7.entry.js.map} +0 -0
- /package/dist/cura/{p-e5b0dd74.entry.js.map → p-3eca0f0c.entry.js.map} +0 -0
- /package/dist/cura/{p-1f53580a.entry.js.map → p-42258230.entry.js.map} +0 -0
- /package/dist/cura/{p-dbd9eab3.entry.js.map → p-4b496c51.entry.js.map} +0 -0
- /package/dist/cura/{p-81c66f2b.entry.js.map → p-576c65b4.entry.js.map} +0 -0
- /package/dist/cura/{p-bfb5e9e1.entry.js.map → p-6e4f4fbf.entry.js.map} +0 -0
- /package/dist/cura/{p-0e28f1c8.entry.js.map → p-818c581f.entry.js.map} +0 -0
- /package/dist/cura/{p-b0451cb3.entry.js.map → p-a91d451f.entry.js.map} +0 -0
- /package/dist/cura/{p-075b02de.entry.js.map → p-b1a51e81.entry.js.map} +0 -0
- /package/dist/cura/{p-f375a612.entry.js.map → p-bdb1a0c5.entry.js.map} +0 -0
- /package/dist/cura/{p-a7ecea4a.entry.js.map → p-dcd2e5bb.entry.js.map} +0 -0
- /package/dist/cura/{p-7853ab16.entry.js.map → p-e1a41792.entry.js.map} +0 -0
- /package/dist/cura/{p-ebed83d1.entry.js.map → p-f5d45776.entry.js.map} +0 -0
|
@@ -54,7 +54,7 @@ const CuraAlert = class {
|
|
|
54
54
|
return this.icon ? this.icon : iconMapping[this.type];
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
|
-
return (index.h(index.Host, { key: '
|
|
57
|
+
return (index.h(index.Host, { key: 'c7d36a87c8ca4ea44a53d90edf5028e27d4ab631' }, index.h("div", { key: 'c54f199ba48a8a0e0549c5f046cf7dc128d8108e', class: this.getClasses(), style: this.styles }, index.h("cura-icon", { key: 'f1607925bceeaf29a8bee7a021b1bf9e9be5b0e6', name: this.getNameIcon(), class: "icon-left", size: 16, color: `${this.type}-dark` }), index.h("div", { key: '6ccb322b9594a0c963cf8fa873b4a66642d69357', class: "content" }, this.label ? (index.h("cura-label", { class: "title", size: "small", color: "neutral-darker", weight: "bold" }, this.label)) : '', index.h("cura-paragraph", { key: 'e70495f19e2eac2b0c593d156436061aba50c295', class: "text", color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", { key: '043f67d199324f668aced318a81e6ecdbd3ac97a' })), index.h("slot", { key: '83cc65b83514bdbc77a3676d2fab55ebb20aa5dc', name: "actions" })), this.closeable ?
|
|
58
58
|
(index.h("cura-icon", { name: "close", size: 16, color: "error-dark", class: "icon-right", onClick: this.handleClose }))
|
|
59
59
|
: '')));
|
|
60
60
|
}
|
|
@@ -54,7 +54,7 @@ const CuraAvatar = class {
|
|
|
54
54
|
this.imageSrc = this.imageSrcDefault || `${this.assetsPath}/images/avatar/patient-default.svg`;
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
|
-
return (index.h(index.Host, { key: '
|
|
57
|
+
return (index.h(index.Host, { key: '2760534555a0483e7e30c5f3009ec0cf68d0973b', style: this.hostCSSProperties(), role: "img" }, index.h("div", { key: '3daf6dd066983dc63525c38b7da498147c0bf387', class: this.getClasses(), style: this.styles }, index.h("img", { key: 'a5f4de7983722fc3f750404fa985c312590b5e98', src: this.imageSrc || this.imageSrcDefault || `${this.assetsPath}/images/avatar/patient-default.svg`, onError: () => this.onSrcError() }))));
|
|
58
58
|
}
|
|
59
59
|
get host() { return index.getElement(this); }
|
|
60
60
|
static get watchers() { return {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
|
|
7
|
+
const curaBadgeCounterCss = ":host{width:fit-content;display:inline-block;height:calc(var(--base-spacing) * 4px);position:relative}:host .container{display:flex;min-width:calc(var(--base-spacing) * 4px);width:fit-content;height:calc(var(--base-spacing) * 4px);justify-content:center;align-items:center;border-radius:calc(calc(var(--base-spacing) * 4px) / 2);background:var(--background-color);box-sizing:border-box;padding:0 calc(var(--base-spacing) * 1px);position:relative}:host .container.outline,:host .container.transparent{background:transparent !important}:host .container.outline::before{content:\"\";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid var(--background-color);border-radius:calc(calc(var(--base-spacing) * 4px) / 2)}";
|
|
8
|
+
const CuraBadgeCounterStyle0 = curaBadgeCounterCss;
|
|
9
|
+
|
|
10
|
+
const CuraBadgeNumber = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.theme = window.CuraAPI.theme;
|
|
14
|
+
this.labelColor = 'primary-darker';
|
|
15
|
+
this.bgColorName = 'primary-lighter';
|
|
16
|
+
this.number = undefined;
|
|
17
|
+
this.color = 'primary';
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.type = 'solid';
|
|
20
|
+
this.styles = {};
|
|
21
|
+
}
|
|
22
|
+
handleColorChange() {
|
|
23
|
+
this.setColors();
|
|
24
|
+
}
|
|
25
|
+
setColors() {
|
|
26
|
+
const color = this.color.toLowerCase();
|
|
27
|
+
/** type outline and transparent */
|
|
28
|
+
if (this.type === 'outline' || this.type === 'transparent') {
|
|
29
|
+
this.bgColorName = this.disabled ? `neutral-medium` : `${color}-dark`;
|
|
30
|
+
this.labelColor = this.bgColorName;
|
|
31
|
+
/** type solid - default */
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.bgColorName = color === 'neutral' || this.disabled ? `neutral-pale` : `${color}-lighter`;
|
|
35
|
+
this.labelColor = this.disabled ? 'neutral-medium' : `${color}-dark`;
|
|
36
|
+
}
|
|
37
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--background-color': this.theme.colors.getColor(`${this.bgColorName}`) });
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
|
|
41
|
+
this.setColors();
|
|
42
|
+
}
|
|
43
|
+
getClasses() {
|
|
44
|
+
const classes = {
|
|
45
|
+
'container': true,
|
|
46
|
+
};
|
|
47
|
+
classes[this.type.toLowerCase()] = true;
|
|
48
|
+
return classes;
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (index.h(index.Host, { key: 'bb6ab35685970eadac6962b3a01f158ebac05515' }, this.number && this.number <= 0 ? '' : (index.h("div", { class: this.getClasses(), style: this.styles }, index.h("cura-label", { size: "xsmall", "line-height": "none", color: this.labelColor }, this.number >= 100 ? '99+' : this.number)))));
|
|
52
|
+
}
|
|
53
|
+
static get watchers() { return {
|
|
54
|
+
"disabled": ["handleColorChange"],
|
|
55
|
+
"color": ["handleColorChange"],
|
|
56
|
+
"type": ["handleColorChange"]
|
|
57
|
+
}; }
|
|
58
|
+
};
|
|
59
|
+
CuraBadgeNumber.style = CuraBadgeCounterStyle0;
|
|
60
|
+
|
|
61
|
+
exports.cura_badge_counter = CuraBadgeNumber;
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=cura-badge-counter.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-badge-counter.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,uvBAAuvB,CAAC;AACpxB,+BAAe,mBAAmB;;MCMrB,eAAe;;;QAE1B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAqB7B,eAAU,GAAG,gBAAgB,CAAC;QAC9B,gBAAW,GAAG,iBAAiB,CAAC;;qBAZR,SAAS;wBAIL,KAAK;oBAI4B,OAAO;sBAElD,EAAE;;IAOpB,iBAAiB;QACf,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;IAED,SAAS;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;;QAEvC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;YAC1D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,GAAG,gBAAgB,GAAG,GAAG,KAAK,OAAO,CAAC;YACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;;SAEpC;aAAM;YACL,IAAI,CAAC,WAAW,GAAG,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,GAAG,GAAG,KAAK,UAAU,CAAC;YAC9F,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,GAAG,gBAAgB,GAAG,GAAG,KAAK,OAAO,CAAC;SACtE;QACD,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,GACxE,CAAA;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAChE,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;IAED,UAAU;QACR,MAAM,OAAO,GAAG;YACd,WAAW,EAAE,IAAI;SAClB,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;QACxC,OAAO,OAAO,CAAC;KAChB;IAGD,MAAM;QACJ,QACEA,QAACC,UAAI,uDACD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,IACtCD,iBAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,IAC/CA,wBAAY,IAAI,EAAC,QAAQ,iBAAa,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,UAAU,IAChE,IAAI,CAAC,MAAM,IAAI,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,CAC9B,CACT,CACL,CACI,EACP;KACH;;;;;;;;;;;","names":["h","Host"],"sources":["src/components/badges/cura-badge-counter/cura-badge-counter.scss?tag=cura-badge-counter&encapsulation=shadow","src/components/badges/cura-badge-counter/cura-badge-counter.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n\n:host {\n width: fit-content;\n display: inline-block;\n height: #{$spacing-xxs};\n position: relative;\n\n .container {\n display: flex;\n min-width: #{$spacing-xxs};\n width: fit-content;\n height: #{$spacing-xxs};\n justify-content: center;\n align-items: center;\n border-radius: calc(#{$spacing-xxs} / 2);\n background: var(--background-color);\n box-sizing: border-box;\n padding: 0 #{$spacing-tiny};\n position: relative;\n\n &.outline,\n &.transparent {\n background: transparent !important;\n }\n\n &.outline {\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: 1px solid var(--background-color);\n border-radius: calc(#{$spacing-xxs} / 2);\n }\n }\n }\n\n}\n","import { Component, Host, Prop, h, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-counter',\n styleUrl: 'cura-badge-counter.scss',\n shadow: true,\n})\nexport class CuraBadgeNumber {\n\n theme = window.CuraAPI.theme;\n\n /** Número a ser representado no badge.\n * Apresentará 99+ para números acima desse valor.\n */\n @Prop({ reflect: true }) number: number | null;\n /**\n * Cor fundamental do design system sem profundidade.\n * Ex.: primary (padrão)\n */\n @Prop() color: string = 'primary';\n /**\n * Define o estado do badge como desabilitado ou habilitado.\n */\n @Prop() disabled: boolean = false;\n /**\n * Define o estilo visual entre solid (default), outline ou transparent.\n */\n @Prop() type: 'solid' | 'outline' | 'transparent' | string = 'solid';\n\n @State() styles = {};\n labelColor = 'primary-darker';\n bgColorName = 'primary-lighter';\n\n @Watch(\"disabled\")\n @Watch(\"color\")\n @Watch(\"type\")\n handleColorChange() {\n this.setColors();\n }\n\n setColors() {\n const color = this.color.toLowerCase();\n /** type outline and transparent */\n if (this.type === 'outline' || this.type === 'transparent') {\n this.bgColorName = this.disabled ? `neutral-medium` : `${color}-dark`;\n this.labelColor = this.bgColorName;\n /** type solid - default */\n } else {\n this.bgColorName = color === 'neutral' || this.disabled ? `neutral-pale` : `${color}-lighter`;\n this.labelColor = this.disabled ? 'neutral-medium' : `${color}-dark`;\n }\n this.styles = {\n ...this.styles,\n '--background-color': this.theme.colors.getColor(`${this.bgColorName}`),\n }\n }\n\n connectedCallback() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.setColors();\n }\n\n getClasses() {\n const classes = {\n 'container': true,\n };\n classes[this.type.toLowerCase()] = true;\n return classes;\n }\n\n\n render() {\n return (\n <Host>\n { this.number && this.number <= 0 ? '' : (\n <div class={this.getClasses()} style={this.styles}>\n <cura-label size=\"xsmall\" line-height=\"none\" color={this.labelColor}>\n {this.number >= 100 ? '99+' : this.number}\n </cura-label>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -27,7 +27,7 @@ const CuraDistance = class {
|
|
|
27
27
|
this.formatDistance();
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (index.h(index.Host, { key: '
|
|
30
|
+
return (index.h(index.Host, { key: 'cdc206deecbed2e069befda5d21ddcaf03049afc' }, index.h("div", { key: 'd22d2b5b97964281e8588fbc17a66f3fddcd875e', class: "container", style: this.styles }, index.h("cura-label", { key: '0d54ab1ad403ba23a57fb78a422ed8c577cd627e', size: 'xsmall', weight: 'bold', color: 'neutral-black' }, this.displayDistance, this.isThousandRounded ? 'K' : ''), index.h("cura-label", { key: 'd4929a67484bbfd6d6f3edce82414951ea4778c8', size: 'xsmall', weight: 'bold', color: 'neutral-dark' }, this.label))));
|
|
31
31
|
}
|
|
32
32
|
setCssProperties() {
|
|
33
33
|
this.styles = {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
|
|
7
|
+
const curaBadgePillCss = ".badge-container{display:flex;align-items:center;justify-content:center;gap:calc(var(--base-spacing) * 1px);padding:calc(var(--base-spacing) * 1px);border-radius:var(--border-radius);font-family:var(--font-family);font-size:var(--font-size);position:relative;box-sizing:border-box;width:fit-content;height:calc(var(--base-spacing) * 5px);min-width:calc(var(--base-spacing) * 5px);background-color:var(--color-background)}.badge-container::before{content:\"\";width:100%;height:100%;position:absolute;left:0px;top:0px;box-sizing:border-box;border:1px solid transparent;border-radius:var(--border-radius);pointer-events:none}.badge-container.icon-only cura-label{display:none !important}.badge-container.disabled{background-color:var(--color-background-disabled)}.badge-container.outline{background-color:transparent}.badge-container.outline::before{border:1px solid var(--color-base)}.badge-container.outline.disabled::before{border:1px solid var(--color-outline-disabled)}.badge-container.transparent{background-color:transparent}.badge-container.transparent::before{border:1px solid transparent}.badge-container.transparent.disabled{background-color:transparent}.badge-container cura-icon{display:flex}";
|
|
8
|
+
const CuraBadgePillStyle0 = curaBadgePillCss;
|
|
9
|
+
|
|
10
|
+
const CuraBadgePill = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.theme = window.CuraAPI.theme;
|
|
14
|
+
this.type = 'solid';
|
|
15
|
+
this.color = 'primary';
|
|
16
|
+
this.iconName = undefined;
|
|
17
|
+
this.iconset = 'default';
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.iconOnly = false;
|
|
20
|
+
this.borderRadius = "2px";
|
|
21
|
+
this.styles = {};
|
|
22
|
+
}
|
|
23
|
+
handleColorChange() {
|
|
24
|
+
this.setColors();
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.setBaseStyles();
|
|
28
|
+
this.setColors();
|
|
29
|
+
}
|
|
30
|
+
setBaseStyles() {
|
|
31
|
+
this.styles['--base-spacing'] = this.theme.spacing.getSpacing();
|
|
32
|
+
this.styles['--font-family'] = this.theme.fonts.getFamily();
|
|
33
|
+
this.styles['--font-size'] = this.theme.fonts.getSize();
|
|
34
|
+
this.styles = Object.assign({}, this.styles);
|
|
35
|
+
}
|
|
36
|
+
setColors() {
|
|
37
|
+
const colors = [
|
|
38
|
+
{ name: '--color-background', theme: `${this.color}-lighter` },
|
|
39
|
+
{ name: '--color-base', theme: `${this.color}-dark` },
|
|
40
|
+
{ name: '--color-background-disabled', theme: 'neutral-pale' },
|
|
41
|
+
{ name: '--color-outline-disabled', theme: 'neutral-medium' },
|
|
42
|
+
];
|
|
43
|
+
colors.forEach(color => {
|
|
44
|
+
this.styles[color.name] = this.theme.colors.getColor(color.theme);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
hostCSSProperties() {
|
|
48
|
+
return {
|
|
49
|
+
'--border-radius': this.borderRadius || '2px',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getClasses() {
|
|
53
|
+
const classes = {};
|
|
54
|
+
classes['badge-container'] = true;
|
|
55
|
+
classes[`icon-only`] = this.iconOnly;
|
|
56
|
+
classes['disabled'] = this.disabled;
|
|
57
|
+
classes[`${this.type}`] = true;
|
|
58
|
+
return classes;
|
|
59
|
+
}
|
|
60
|
+
getSymbolColor() {
|
|
61
|
+
return this.disabled
|
|
62
|
+
? 'neutral-medium'
|
|
63
|
+
: `${this.color}-dark`;
|
|
64
|
+
}
|
|
65
|
+
getIcon() {
|
|
66
|
+
if (!this.iconName)
|
|
67
|
+
return '';
|
|
68
|
+
return index.h("cura-icon", { name: this.iconName, iconset: this.iconset, size: 'micro', color: this.getSymbolColor() });
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
const symbolColor = this.getSymbolColor();
|
|
72
|
+
return (index.h(index.Host, { key: 'b6870052543347fdc83a75629b30251ddab35e12', style: this.hostCSSProperties() }, index.h("div", { key: 'ae8b14c1c9c323b8387e7ed4e3a97bade9c712f4', class: this.getClasses(), style: this.styles }, this.getIcon(), index.h("cura-label", { key: 'd14ab9efd48f33c7b8153cf85699b2fc96ecd7af', size: 'xsmall', "line-height": "117%", color: symbolColor }, index.h("slot", { key: 'b684ca1b248d04700a2b8a7245c455fb9bdef474' })))));
|
|
73
|
+
}
|
|
74
|
+
get host() { return index.getElement(this); }
|
|
75
|
+
static get watchers() { return {
|
|
76
|
+
"color": ["handleColorChange"]
|
|
77
|
+
}; }
|
|
78
|
+
};
|
|
79
|
+
CuraBadgePill.style = CuraBadgePillStyle0;
|
|
80
|
+
|
|
81
|
+
exports.cura_badge_pill = CuraBadgePill;
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=cura-badge-pill.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-badge-pill.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,qrCAAqrC,CAAC;AAC/sC,4BAAe,gBAAgB;;MCMlB,aAAa;;;QAwCxB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;oBAlCwC,OAAO;qBAK+B,SAAS;;uBAUjF,SAAS;wBAKR,KAAK;wBAKL,KAAK;4BAKO,KAAK;sBAEnC,EAAE;;IAKpB,iBAAiB;QACf,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB;IAEO,aAAa;QACnB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACxD,IAAI,CAAC,MAAM,qBAAQ,IAAI,CAAC,MAAM,CAAE,CAAC;KAClC;IAEO,SAAS;QACf,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,UAAU,EAAE;YAC9D,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,OA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AC,iBAAiB,EAAE,IACnCD,kEAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,IAC9C,IAAI,CAAC,OAAO,EAAE,EACfA,yEAAY,IAAI,EAAC,QAAQ,iBAAa,MAAM,EAAC,KAAK,EAAE,WAAW,IAC7DA,oEAAa,CACF,CACT,CACD,EACP;KACH;;;;;;;;;;","names":["h","Host"],"sources":["src/components/badges/cura-badge-pill/cura-badge-pill.scss?tag=cura-badge-pill&encapsulation=shadow","src/components/badges/cura-badge-pill/cura-badge-pill.tsx"],"sourcesContent":["@import \"../../../scss/mixins/spacing.scss\";\n\n.badge-container {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: #{$spacing-tiny};\n padding: #{$spacing-tiny};\n border-radius: var(--border-radius);\n font-family: var(--font-family);\n font-size: var(--font-size);\n position: relative;\n box-sizing: border-box;\n width: fit-content;\n height: #{$spacing-xs};\n min-width: #{$spacing-xs};\n\n background-color: var(--color-background);\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: 1px solid transparent;\n border-radius: var(--border-radius);\n pointer-events: none;\n }\n\n &.icon-only {\n cura-label {\n display: none !important;\n }\n }\n\n &.disabled {\n background-color: var(--color-background-disabled);\n }\n\n &.outline {\n background-color: transparent;\n\n &::before {\n border: 1px solid var(--color-base);\n }\n\n &.disabled::before {\n border: 1px solid var(--color-outline-disabled);\n }\n }\n\n &.transparent {\n background-color: transparent;\n\n &::before {\n border: 1px solid transparent;\n }\n\n &.disabled {\n background-color: transparent;\n }\n }\n\n cura-icon {\n display: flex;\n }\n}\n","import { Component, Host, Prop, State, h, Watch, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-pill',\n styleUrl: 'cura-badge-pill.scss',\n shadow: true,\n})\nexport class CuraBadgePill {\n @Element() host: HTMLElement;\n\n /**\n * Badge type: solid | outline | transparent\n */\n @Prop({ reflect: true }) type: 'solid' | 'outline' | 'transparent' = 'solid';\n\n /**\n * Color base from color scheme. Default: primary\n */\n @Prop() color: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error' = 'primary';\n\n /**\n * Name of the icon to be used from iconset\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Custom iconset if needed\n */\n @Prop({ reflect: true }) iconset = 'default';\n\n /**\n * Disabled state. Boolean\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * Set badge to icon only. Boolean\n */\n @Prop({ reflect: true }) iconOnly = false;\n\n /**\n * Set border-radius.\n */\n @Prop({ reflect: true }) borderRadius: string = \"2px\";\n\n @State() styles = {};\n\n theme = window.CuraAPI.theme;\n\n @Watch('color')\n handleColorChange() {\n this.setColors();\n }\n\n connectedCallback() {\n this.setBaseStyles();\n this.setColors();\n }\n\n private setBaseStyles() {\n this.styles['--base-spacing'] = this.theme.spacing.getSpacing();\n this.styles['--font-family'] = this.theme.fonts.getFamily();\n this.styles['--font-size'] = this.theme.fonts.getSize();\n this.styles = { ...this.styles };\n }\n\n private setColors() {\n const colors = [\n { name: '--color-background', theme: `${this.color}-lighter` },\n { name: '--color-base', theme: `${this.color}-dark` },\n { name: '--color-background-disabled', theme: 'neutral-pale' },\n { name: '--color-outline-disabled', theme: 'neutral-medium' },\n ];\n\n colors.forEach(color => {\n this.styles[color.name] = this.theme.colors.getColor(color.theme);\n });\n }\n\n hostCSSProperties() {\n return {\n '--border-radius': this.borderRadius || '2px',\n };\n }\n\n getClasses() {\n const classes = {};\n classes['badge-container'] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['disabled'] = this.disabled;\n classes[`${this.type}`] = true;\n return classes;\n }\n\n getSymbolColor() {\n return this.disabled\n ? 'neutral-medium'\n : `${this.color}-dark`;\n }\n\n getIcon() {\n if (!this.iconName) return '';\n return <cura-icon\n name={this.iconName}\n iconset={this.iconset}\n size={'micro'}\n color={this.getSymbolColor()}\n />;\n }\n\n render() {\n const symbolColor = this.getSymbolColor();\n return (\n <Host style={this.hostCSSProperties()}>\n <div class={this.getClasses()} style={this.styles}>\n {this.getIcon()}\n <cura-label size='xsmall' line-height=\"117%\" color={symbolColor}>\n <slot></slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -103,7 +103,7 @@ const CuraButtonOutline = class {
|
|
|
103
103
|
render() {
|
|
104
104
|
const symbolColor = this.getSymbolColor();
|
|
105
105
|
const labelSize = curaButton_definitions.labelSizes[this.size] || curaButton_definitions.labelSizes["default"];
|
|
106
|
-
return (index.h(index.Host, { key: '
|
|
106
|
+
return (index.h(index.Host, { key: '8c7adeaec50deaf3829295d2231b390992064735' }, this.href ? (index.h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
107
107
|
}
|
|
108
108
|
static get formAssociated() { return true; }
|
|
109
109
|
static get watchers() { return {
|
|
@@ -67,15 +67,6 @@ const CuraButtonSelect = class {
|
|
|
67
67
|
return this.selected ? 'neutral-white' : 'neutral-black';
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
getColorCounter() {
|
|
71
|
-
if (this.background === 'dark' && this.disabled) {
|
|
72
|
-
return !this.selected ? 'neutral-black' : 'neutral-dark';
|
|
73
|
-
}
|
|
74
|
-
if (this.background === 'light' && this.disabled) {
|
|
75
|
-
return 'neutral-pale';
|
|
76
|
-
}
|
|
77
|
-
return `${this.color}-lighter`;
|
|
78
|
-
}
|
|
79
70
|
getColorBagdeNumber() {
|
|
80
71
|
if (this.background === 'dark' && this.disabled) {
|
|
81
72
|
return this.selected ? 'neutral-black' : 'neutral-dark';
|
|
@@ -93,7 +84,7 @@ const CuraButtonSelect = class {
|
|
|
93
84
|
return index.h("cura-icon", { name: this.iconName, size: iconSize, color: this.getLabelFontColor() });
|
|
94
85
|
}
|
|
95
86
|
getCounter() {
|
|
96
|
-
return (index.h("cura-badge-
|
|
87
|
+
return (index.h("cura-badge-counter", { number: this.counter, color: this.color, disabled: this.disabled || null, class: "badge-number" }));
|
|
97
88
|
}
|
|
98
89
|
getCheckIconRight() {
|
|
99
90
|
const iconSize = this.size === 'large' ? 20 : 16;
|
|
@@ -115,7 +106,7 @@ const CuraButtonSelect = class {
|
|
|
115
106
|
}
|
|
116
107
|
render() {
|
|
117
108
|
const labelSize = curaButton_definitions.labelSizes[this.size] || curaButton_definitions.labelSizes['default'];
|
|
118
|
-
return (index.h(index.Host, { key: '
|
|
109
|
+
return (index.h(index.Host, { key: '54bf5dc64b99128f839fdc22ff56dd709971fc8e' }, index.h("button", { key: '422e4d80d321fb9e4cddd165700220071012bea8', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("div", { key: '6c40080d1b8746e394539cf717d658e4d834c500', class: "button-container" }, this.iconName ? this.getIcon() : null, index.h("cura-label", { key: 'f2f9b54cbcd2c7a571d966ba20f344384ecaadc0', class: "label", size: labelSize, lineHeight: "0%", color: this.getLabelFontColor(), weight: "regular" }, index.h("slot", { key: 'f5c471e0771c6c19685aa591461a73b1aaa83c47' })), this.counter ? this.getCounter() : null, this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null))));
|
|
119
110
|
}
|
|
120
111
|
get host() { return index.getElement(this); }
|
|
121
112
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-button-select.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,mBAAmB,GAAG,usGAAusG,CAAC;AACpuG,+BAAe,mBAAmB;;MCOrB,gBAAgB;;;;QAiB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAdsB,KAAK;;oBAEM,QAAQ;;;0BAG/B,OAAO;qBACtB,SAAS;;uBAGd,KAAK;sBACN,EAAE;;IAUpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,SAAS,GAAG,eAAe,EAAE;YACzG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,QAAQ,EAAE;YAC3H,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,QAAQ,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,EAAE;YACvH,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,eAAe,EAAE;YACvG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,UAAU,EAAE;YAC7H,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KA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I,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;KAChD;IAED,MAAM;QACJ,MAAM,SAAS,GAAGC,iCAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAIA,iCAAU,CAAC,SAAS,CAAC,CAAC;QACjE,QACED,QAACE,UAAI,uDACHF,qEACE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAC3C,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,IAE3CA,kEAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EACtCA,yEAAY,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAC,SAAS,IAC1GA,oEAAa,CACF,EACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,EACvC,IAAI,CAAC,YAAY,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAC7E,CACC,CACJ,EACP;KACH;;;;;;;;;;;","names":["h","labelSizes","Host"],"sources":["src/components/buttons/cura-button-select/cura-button-select.scss?tag=cura-button-select&encapsulation=shadow","src/components/buttons/cura-button-select/cura-button-select.tsx"],"sourcesContent":["@import '../../../scss/mixins/buttons.scss';\n\n:host {\n @include button-host();\n\n button,\n a {\n @include button-element() {\n background-color: var(--neutral-purewhite);\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-border);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):hover {\n background-color: var(--color-background-hover);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-border) !important;\n }\n }\n\n @include button-sizes();\n\n @include button-label();\n\n // Children Elements\n @include button-container() {\n flex-direction: row !important;\n\n .badge-number {\n margin-left: 10px;\n }\n }\n\n @include button-icon();\n\n // selected state\n @include button-selected() {\n background-color: var(--color-select);\n border-color: var(--color-select);\n\n &:not(.disabled):hover {\n background-color: var(--color-border-hover-pressed);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-select-focus) !important;\n }\n\n &.disabled {\n background-color: var(--color-disable-select);\n border-color: var(--color-disable-select);\n }\n }\n\n // Disabled state\n @include button-disabled() {\n background-color: var(--neutral-white-primary-darker);\n border-color: var(--color-border-disable-unselect);\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\nexport class CuraButtonSelect {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, mutable: true }) selected = false;\n @Prop({ reflect: true, mutable: true }) iconName: string;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n @Prop({ reflect: true, mutable: true }) counter: string | number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light' = 'light';\n @Prop() color: string = 'primary';\n @Prop({ reflect: true }) iconPosition: 'left' | 'right';\n\n @State() hovered = false;\n @State() styles = {};\n\n @Event({ eventName: 'onclick' }) onclick: EventEmitter<{ selected: boolean }>;\n\n theme = window.CuraAPI.theme;\n\n weights;\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },\n { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },\n { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },\n { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },\n { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },\n { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },\n { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },\n { name: '--color-border-disable-unselect', thema: 'neutral-dark' },\n { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },\n { name: '--color-counter', thema: !this.disabled && 'primary-lighter' },\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 getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\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.setColors();\n }\n\n getLabelFontColor() {\n if (this.disabled) return 'neutral-dark';\n\n if (this.background === 'dark') {\n return this.selected ? 'neutral-black' : 'neutral-white';\n }\n if (this.background === 'light') {\n return this.selected ? 'neutral-white' : 'neutral-black';\n }\n }\n\n getColorCounter() {\n if (this.background === 'dark' && this.disabled) {\n return !this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-pale';\n }\n return `${this.color}-lighter`;\n }\n\n getColorBagdeNumber() {\n if (this.background === 'dark' && this.disabled) {\n return this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-medium';\n }\n\n return `${this.color}-darker`;\n }\n\n getIcon() {\n const iconSize = this.size === 'large' ? 20 : 16;\n if (this.iconPosition === 'right') {\n return;\n }\n\n return <cura-icon name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-number color={this.getColorCounter()} class=\"badge-number\">\n <cura-label color={this.getColorBagdeNumber()} size=\"small\">\n {this.counter}\n </cura-label>\n </cura-badge-number>\n );\n }\n\n getCheckIconRight() {\n const iconSize = this.size === 'large' ? 20 : 16;\n return <cura-icon name=\"check\" size={iconSize} color={this.getLabelFontColor()}></cura-icon>;\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) e.preventDefault();\n this.selected = !this.selected;\n this.onclick.emit({ selected: this.selected });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n return (\n <Host>\n <button\n class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled}\n onClick={e => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"button-container\">\n {this.iconName ? this.getIcon() : null}\n <cura-label class=\"label\" size={labelSize} lineHeight=\"0%\" color={this.getLabelFontColor()} weight=\"regular\">\n <slot></slot>\n </cura-label>\n {this.counter ? this.getCounter() : null}\n {this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null}\n </div>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cura-button-select.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,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AE,EAC3C,YAAY,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,IAE3CA,kEAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EACtCA,yEAAY,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAC,SAAS,IAC1GA,oEAAa,CACF,EACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,EACvC,IAAI,CAAC,YAAY,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAC7E,CACC,CACJ,EACP;KACH;;;;;;;;;;;","names":["h","labelSizes","Host"],"sources":["src/components/buttons/cura-button-select/cura-button-select.scss?tag=cura-button-select&encapsulation=shadow","src/components/buttons/cura-button-select/cura-button-select.tsx"],"sourcesContent":["@import '../../../scss/mixins/buttons.scss';\n\n:host {\n @include button-host();\n\n button,\n a {\n @include button-element() {\n background-color: var(--neutral-purewhite);\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-border);\n border-radius: var(--border-radius);\n }\n\n &:not(.disabled):hover {\n background-color: var(--color-background-hover);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-border) !important;\n }\n }\n\n @include button-sizes();\n\n @include button-label();\n\n // Children Elements\n @include button-container() {\n flex-direction: row !important;\n\n .badge-number {\n margin-left: 10px;\n }\n }\n\n @include button-icon();\n\n // selected state\n @include button-selected() {\n background-color: var(--color-select);\n border-color: var(--color-select);\n\n &:not(.disabled):hover {\n background-color: var(--color-border-hover-pressed);\n border-color: var(--color-border-hover-pressed);\n }\n\n &:focus {\n border-color: var(--color-select-focus) !important;\n }\n\n &.disabled {\n background-color: var(--color-disable-select);\n border-color: var(--color-disable-select);\n }\n }\n\n // Disabled state\n @include button-disabled() {\n background-color: var(--neutral-white-primary-darker);\n border-color: var(--color-border-disable-unselect);\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { labelSizes } from '../cura-button.definitions';\n\n@Component({\n tag: 'cura-button-select',\n styleUrl: 'cura-button-select.scss',\n shadow: true,\n})\nexport class CuraButtonSelect {\n @Element() host: HTMLElement;\n\n @Prop({ reflect: true, mutable: true }) selected = false;\n @Prop({ reflect: true, mutable: true }) iconName: string;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n @Prop({ reflect: true, mutable: true }) counter: number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light' = 'light';\n @Prop() color: string = 'primary';\n @Prop({ reflect: true }) iconPosition: 'left' | 'right';\n\n @State() hovered = false;\n @State() styles = {};\n\n @Event({ eventName: 'onclick' }) onclick: EventEmitter<{ selected: boolean }>;\n\n theme = window.CuraAPI.theme;\n\n weights;\n\n @Watch('background')\n @Watch('color')\n setColors() {\n const colors = [\n { name: '--color-border', thema: this.background === 'light' ? `${this.color}-darker` : 'neutral-white' },\n { name: '--color-border-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-light` },\n { name: '--color-background-hover', thema: this.background === 'light' ? `${this.color}-light` : `${this.color}-dark` },\n { name: '--color-select', thema: this.background === 'light' ? `${this.color}-base` : 'neutral-white' },\n { name: '--color-select-hover-pressed', thema: this.background === 'light' ? `${this.color}-dark` : `${this.color}-lighter` },\n { name: '--color-select-focus', thema: this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter` },\n { name: '--color-disable-select', thema: this.background === 'light' ? 'neutral-white' : 'neutral-black' },\n { name: '--color-border-disable-unselect', thema: 'neutral-dark' },\n { name: '--color-counter-disabled', thema: this.background === 'light' ? 'neutral-pale' : 'neutral-black' },\n { name: '--color-counter', thema: !this.disabled && 'primary-lighter' },\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 getClasses() {\n const classes = {};\n classes[`${this.size?.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes['disabled'] = this.disabled;\n classes['selected'] = this.selected;\n return classes;\n }\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\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.setColors();\n }\n\n getLabelFontColor() {\n if (this.disabled) return 'neutral-dark';\n\n if (this.background === 'dark') {\n return this.selected ? 'neutral-black' : 'neutral-white';\n }\n if (this.background === 'light') {\n return this.selected ? 'neutral-white' : 'neutral-black';\n }\n }\n\n getColorBagdeNumber() {\n if (this.background === 'dark' && this.disabled) {\n return this.selected ? 'neutral-black' : 'neutral-dark';\n }\n\n if (this.background === 'light' && this.disabled) {\n return 'neutral-medium';\n }\n\n return `${this.color}-darker`;\n }\n\n getIcon() {\n const iconSize = this.size === 'large' ? 20 : 16;\n if (this.iconPosition === 'right') {\n return;\n }\n\n return <cura-icon name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-counter\n number={this.counter}\n color={this.color}\n disabled={this.disabled || null}\n class=\"badge-number\">\n </cura-badge-counter>\n );\n }\n\n getCheckIconRight() {\n const iconSize = this.size === 'large' ? 20 : 16;\n return <cura-icon name=\"check\" size={iconSize} color={this.getLabelFontColor()}></cura-icon>;\n }\n\n handleMouseEnter() {\n if (this.disabled) return;\n this.hovered = true;\n }\n\n handleMouseLeave() {\n this.hovered = false;\n }\n\n handleClick(e: Event) {\n if (this.disabled) e.preventDefault();\n this.selected = !this.selected;\n this.onclick.emit({ selected: this.selected });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n return (\n <Host>\n <button\n class={this.getClasses()}\n style={this.styles}\n disabled={this.disabled}\n onClick={e => this.handleClick(e)}\n onMouseEnter={() => this.handleMouseEnter()}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n <div class=\"button-container\">\n {this.iconName ? this.getIcon() : null}\n <cura-label class=\"label\" size={labelSize} lineHeight=\"0%\" color={this.getLabelFontColor()} weight=\"regular\">\n <slot></slot>\n </cura-label>\n {this.counter ? this.getCounter() : null}\n {this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null}\n </div>\n </button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -92,7 +92,7 @@ const CuraButtonTransparent = class {
|
|
|
92
92
|
render() {
|
|
93
93
|
const symbolColor = this.getSymbolColor();
|
|
94
94
|
const labelSize = curaButton_definitions.labelSizes[this.size] || curaButton_definitions.labelSizes["default"];
|
|
95
|
-
return (index.h(index.Host, { key: '
|
|
95
|
+
return (index.h(index.Host, { key: '5cdc491f0c3e80910e76c5bef2e26ce468ffda1f' }, this.href ? (index.h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
96
96
|
}
|
|
97
97
|
static get formAssociated() { return true; }
|
|
98
98
|
static get watchers() { return {
|
|
@@ -3906,7 +3906,7 @@ const CuraCalendar = class {
|
|
|
3906
3906
|
}
|
|
3907
3907
|
render() {
|
|
3908
3908
|
const { months } = this.fetchMonthNames();
|
|
3909
|
-
return (index$1.h(index$1.Host, { key: '
|
|
3909
|
+
return (index$1.h(index$1.Host, { key: 'fcea88a384ceebadccb6059ef59cea945f875a72', style: this.getHostCSSProperties() }, index$1.h("div", { key: '82c5271ba6b073439fb58471920f73b68b8f1320', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''}`, style: this.styles }, index$1.h("header", { key: '3921fb57f3d526b9f33c59f998ad422806505bc1', class: "header" }, index$1.h("div", { key: '1f852f0f29ff927d3940c670f5b25206837cc331', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, index$1.h("cura-icon", { key: '697fda3903f24611628fe24a7f669ab87474aeab', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (index$1.h("div", { class: "select" }, index$1.h("cura-select", { size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (index$1.h("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), index$1.h("cura-select", { size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (index$1.h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (index$1.h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), index$1.h("cura-icon", { key: '6b7f0694e978b0807c4e54629cda68f2fde27c8a', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), index$1.h("span", { key: '5a151331c2c9872cf3b50bbaea7c9b92b1476297', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (index$1.h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: "bold", key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), index$1.h("div", { key: '7eeb57ed5dc104c953343697a205a922a1b2b912', class: "dates" }, !this.collapsed
|
|
3910
3910
|
? this.fetchDaysOfMonth().map((day, index) => (index$1.h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
3911
3911
|
: this.fetchDaysOfWeek().map((day, index) => (index$1.h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (index$1.h("div", { class: "collapsed-container" }, index$1.h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (index$1.h("div", { class: "collapsed-container" }, index$1.h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null)));
|
|
3912
3912
|
}
|
|
@@ -43,7 +43,7 @@ const CuraCard = class {
|
|
|
43
43
|
return classes;
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (index.h(index.Host, { key: '
|
|
46
|
+
return (index.h(index.Host, { key: 'db1a13cfe3bb925300e65641e1d45fade5a03f52', role: this.href ? 'link' : 'div' }, this.href ? (index.h("a", { class: this.getClasses(), target: this.target, style: this.styles, href: this.href }, index.h("slot", null))) : (index.h("div", { class: this.getClasses(), style: this.styles }, index.h("slot", null)))));
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
CuraCard.style = CuraCardStyle0;
|
|
@@ -164,7 +164,7 @@ const CuraCheckbox = class {
|
|
|
164
164
|
return index.h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
165
165
|
}
|
|
166
166
|
render() {
|
|
167
|
-
return (index.h(index.Host, { key: '
|
|
167
|
+
return (index.h(index.Host, { key: '29437631c4078574a1123fcd27f471efd6738a2c' }, index.h("div", { key: '3821e17c78c011a7ab1fb4ab148258fe85be7d19', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, index.h("div", { key: '0f868dfa5f35c3cd11d870eca977bb2a9c67a7d7', class: "info" }, index.h("div", { key: '05cf807789ad779bf90946926176a2a17b1c4704', class: "label-wrapper" }, index.h("cura-label", { key: '979497d243d7296f2c8bb5347ab01d2e12568c01', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { key: 'a8e3a3b6a891bb4c2ade3271fe8d11674770c160', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { key: 'afcd5016c3f232e05684b38e8ec97d6e604b8f12', color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", { key: 'af27633296d454363d71d5b27227c40a26a4e119' }))), index.h("div", { key: 'd357e30a36326de76d1cd91332a32e3befeb03a9', class: 'checkbox', tabIndex: this.ontabindex }, index.h("input", { key: '0ef63518fced76e52746b79cd598f96065f83a60', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
168
168
|
}
|
|
169
169
|
static get formAssociated() { return true; }
|
|
170
170
|
get host() { return index.getElement(this); }
|
|
@@ -69,7 +69,7 @@ const CuraDisplay = class {
|
|
|
69
69
|
return tags[`${this.level}`] || tags['default'];
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
return (index.h(index.Host, { key: '
|
|
72
|
+
return (index.h(index.Host, { key: '32758f666bb547d7cd3646694e8cc132a795bc44', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
73
73
|
}
|
|
74
74
|
get host() { return index.getElement(this); }
|
|
75
75
|
static get watchers() { return {
|
|
@@ -12,7 +12,7 @@ const CuraDropdownSearchOptionTitle = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (index.h(index.Host, { key: '
|
|
15
|
+
return (index.h(index.Host, { key: 'ff083af27d3250e4722c6f238b80b33f739cb64c', slot: "dropdown-search-option" }, index.h("cura-label", { key: '62e9b2a758e000eb1ce5e5a76c1e9e555b5a4c8c', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, index.h("slot", { key: 'e96fd0daa9b210bdea256d88c17b6cc9c425c5bc' }))));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
CuraDropdownSearchOptionTitle.style = CuraDropdownSearchOptionTitleStyle0;
|
|
@@ -46,12 +46,12 @@ const CuraDropdownSearchOption = class {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: '333293644b47d0b7b8e288cf6a81e3e8916a82bd', slot: "dropdown-search-option" }, index.h("div", { key: '5a7f789204607805d65c3b0a586ffdeb54c10a02', style: this.styles, class: {
|
|
50
50
|
"option-container": true,
|
|
51
51
|
hovered: this.selectable ? this.hovered : false,
|
|
52
52
|
selected: this.selected,
|
|
53
53
|
disabled: !this.selectable
|
|
54
|
-
} }, index.h("div", { key: '
|
|
54
|
+
} }, index.h("div", { key: '7ba5fd8f0f35fe0b5856fdaeedf09c7cb8d4fd24', class: "content-container" }, index.h("div", { key: '6618b6f7248e43be1f6915800662d48bf3a08f7c', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, index.h("slot", { key: 'c8c6d3a059d221ae3871f2cb048cb6145bec3546', name: "image" }), index.h("cura-heading", { key: '4678a347d5211c38c9e05dded43ab68840cebca2', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, index.h("slot", { key: '97a34c9bb70e3aaf34fb3ead81ef5e6a0cd05782' }))), index.h("slot", { key: 'fecb411b2de2c169f01cf1a8c1ca2ed14ee049e9', name: "action" })))));
|
|
55
55
|
}
|
|
56
56
|
get hostElement() { return index.getElement(this); }
|
|
57
57
|
static get watchers() { return {
|
|
@@ -19,20 +19,10 @@ const CuraDropdownSearch = class {
|
|
|
19
19
|
const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;
|
|
20
20
|
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
21
21
|
if (dropdown) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
dropdown.style.position = 'fixed';
|
|
28
|
-
dropdown.style.bottom = '0';
|
|
29
|
-
}
|
|
22
|
+
dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';
|
|
23
|
+
dropdown.style.bottom = isKeyboardOpen ? `${window.screen.height - window.innerHeight}px` : '0';
|
|
24
|
+
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
|
|
30
25
|
}
|
|
31
|
-
window.scroll({
|
|
32
|
-
top: 0,
|
|
33
|
-
left: 0,
|
|
34
|
-
behavior: 'smooth',
|
|
35
|
-
});
|
|
36
26
|
});
|
|
37
27
|
};
|
|
38
28
|
this.handleSlotChange = () => {
|
|
@@ -70,6 +60,7 @@ const CuraDropdownSearch = class {
|
|
|
70
60
|
this.showOverlay();
|
|
71
61
|
}
|
|
72
62
|
else {
|
|
63
|
+
this.resetDropdownStyles();
|
|
73
64
|
this.removeOverlay();
|
|
74
65
|
}
|
|
75
66
|
}
|
|
@@ -94,6 +85,7 @@ const CuraDropdownSearch = class {
|
|
|
94
85
|
this.isOnBlurInput = true;
|
|
95
86
|
this.hoveredIndex = -1;
|
|
96
87
|
this.options = [];
|
|
88
|
+
this.originalOverflow = '';
|
|
97
89
|
}
|
|
98
90
|
connectedCallback() {
|
|
99
91
|
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
@@ -145,12 +137,15 @@ const CuraDropdownSearch = class {
|
|
|
145
137
|
this.overlayElement.style.zIndex = '9999';
|
|
146
138
|
this.overlayElement.style.backgroundColor = 'white';
|
|
147
139
|
document.body.appendChild(this.overlayElement);
|
|
140
|
+
this.originalOverflow = document.body.style.overflow;
|
|
141
|
+
document.body.style.overflow = 'hidden';
|
|
148
142
|
}
|
|
149
143
|
}
|
|
150
144
|
removeOverlay() {
|
|
151
145
|
if (this.overlayElement && this.overlayElement.parentNode === document.body) {
|
|
152
146
|
document.body.removeChild(this.overlayElement);
|
|
153
147
|
this.overlayElement = null;
|
|
148
|
+
document.body.style.overflow = this.originalOverflow;
|
|
154
149
|
}
|
|
155
150
|
}
|
|
156
151
|
addClickListenersToOptions() {
|
|
@@ -174,6 +169,7 @@ const CuraDropdownSearch = class {
|
|
|
174
169
|
this.updateSelectedOption(this.value);
|
|
175
170
|
this.isDropdownOpen = false;
|
|
176
171
|
this.isOnBlurInput = true;
|
|
172
|
+
this.resetDropdownStyles();
|
|
177
173
|
this.removeOverlay();
|
|
178
174
|
}
|
|
179
175
|
}
|
|
@@ -213,6 +209,7 @@ const CuraDropdownSearch = class {
|
|
|
213
209
|
if (this.isOnBlurInput === true) {
|
|
214
210
|
setTimeout(() => {
|
|
215
211
|
this.isDropdownOpen = false;
|
|
212
|
+
this.resetDropdownStyles();
|
|
216
213
|
this.removeOverlay();
|
|
217
214
|
}, 200);
|
|
218
215
|
}
|
|
@@ -246,11 +243,23 @@ const CuraDropdownSearch = class {
|
|
|
246
243
|
this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
|
|
247
244
|
}
|
|
248
245
|
}
|
|
246
|
+
handleGoBack() {
|
|
247
|
+
this.resetDropdownStyles();
|
|
248
|
+
this.isMobile = false;
|
|
249
|
+
}
|
|
250
|
+
resetDropdownStyles() {
|
|
251
|
+
var _a;
|
|
252
|
+
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
253
|
+
if (dropdown && dropdown.style.position === 'fixed') {
|
|
254
|
+
dropdown.style.position = 'relative';
|
|
255
|
+
dropdown.style.removeProperty('bottom');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
249
258
|
render() {
|
|
250
259
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
251
|
-
return (index.h(index.Host, { key: '
|
|
260
|
+
return (index.h(index.Host, { key: '5acd835c67558501ac74915597423754c1d412ea', style: this.hostCSSProperties(), class: "dropdown-overlay" }, index.h("div", { key: 'cb0ca2ec4f574f95897163726f81b75b18a4505e', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, index.h("div", { key: 'c6eac11c0c3420e35b7432af8748976f32814851', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (index.h("cura-button-transparent", { key: 'd1cd468c497877ad7f4f22a5dd1bc5bc662bfa6e', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), index.h("cura-input-text", { key: '35f3943ecd4966a1d27ed9e4fba4de08376dd767', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => this.handleOnFocus(), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
|
|
252
261
|
this.handleOnBlur();
|
|
253
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, index.h("slot", { key: '
|
|
262
|
+
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, index.h("slot", { key: '13cffd23e80ec86b266c5b109b2e8ecb89f28944', name: "helperText" }))), index.h("div", { key: 'f0047c0b74057fbf21893f3c92fcaf97db59e544', id: "dropdown-search-list", class: this.getDropdownClasses() }, index.h("slot", { key: '386584475924a3a621308e50697c49bcbe5f1bae', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
254
263
|
}
|
|
255
264
|
get host() { return index.getElement(this); }
|
|
256
265
|
static get watchers() { return {
|