@rededor/cura 1.2.0 → 1.3.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/{app-globals-4d07f363.js → app-globals-f33ceef8.js} +32 -1
- package/dist/cjs/app-globals-f33ceef8.js.map +1 -0
- package/dist/cjs/cura-accordion_12.cjs.entry.js +39 -38
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +3 -2
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-number.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-number.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +17 -9
- 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 +2 -2
- package/dist/cjs/cura-calendar.cjs.entry.js.map +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 +21 -11
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +3 -3
- package/dist/cjs/cura-input-date.cjs.entry.js +45 -45
- package/dist/cjs/cura-input-date.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +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 +232 -0
- package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/api/theme-presets/theme-presets.js +2 -0
- package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-richet.js +32 -0
- package/dist/collection/api/theme-presets/theme-richet.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.css +0 -6
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +41 -43
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +54 -36
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +61 -60
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +41 -23
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -1
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +1 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +0 -2
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +1 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +1 -1
- 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.css +36 -2
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +39 -11
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js +18 -7
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.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.css +25 -11
- package/dist/collection/components/cura-alert/cura-alert.js +2 -1
- package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +1 -0
- 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.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +3 -3
- 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.css +159 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +397 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.js.map +1 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.stories.js +137 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.stories.js.map +1 -0
- 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.css +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +20 -10
- 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.css +15 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +69 -68
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js +29 -10
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.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.css +5 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +7 -6
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-accordion-item.js +19 -12
- package/dist/components/cura-accordion-item.js.map +1 -1
- package/dist/components/cura-accordion.js +14 -15
- package/dist/components/cura-accordion.js.map +1 -1
- package/dist/components/cura-alert.js +3 -2
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/cura-badge-number2.js +2 -2
- package/dist/components/cura-badge-number2.js.map +1 -1
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +18 -9
- 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 +2 -2
- package/dist/components/cura-calendar2.js.map +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 +21 -11
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +8 -7
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icons-view.js +3 -3
- package/dist/components/cura-input-date.js +54 -57
- package/dist/components/cura-input-date.js.map +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-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.d.ts +11 -0
- package/dist/components/cura-tooltip.js +291 -0
- package/dist/components/cura-tooltip.js.map +1 -0
- package/dist/components/index.js +33 -0
- 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-116a1cd6.entry.js → p-01e301d4.entry.js} +2 -2
- package/dist/cura/{p-c6508bd7.entry.js → p-022b22b6.entry.js} +2 -2
- package/dist/cura/p-0308cf6b.entry.js +2 -0
- package/dist/cura/p-0308cf6b.entry.js.map +1 -0
- package/dist/cura/p-22e921d9.entry.js +2 -0
- package/dist/cura/p-22e921d9.entry.js.map +1 -0
- package/dist/cura/p-2b9eadc7.entry.js +2 -0
- package/dist/cura/p-2b9eadc7.entry.js.map +1 -0
- package/dist/cura/{p-b2d5db22.entry.js → p-2c0f5497.entry.js} +2 -2
- package/dist/cura/p-5bb8302c.entry.js +2 -0
- package/dist/cura/p-5bb8302c.entry.js.map +1 -0
- package/dist/cura/{p-fcbf4311.entry.js → p-639c1b67.entry.js} +2 -2
- package/dist/cura/{p-2956f120.entry.js → p-7853ab16.entry.js} +2 -2
- package/dist/cura/{p-2956f120.entry.js.map → p-7853ab16.entry.js.map} +1 -1
- package/dist/cura/{p-41c3d47d.entry.js → p-81c66f2b.entry.js} +2 -2
- package/dist/cura/p-82b99090.js +2 -0
- package/dist/cura/p-82b99090.js.map +1 -0
- package/dist/cura/p-93525d68.entry.js +2 -0
- package/dist/cura/p-93525d68.entry.js.map +1 -0
- package/dist/cura/p-9991f7db.entry.js +2 -0
- package/dist/cura/p-9e3d26fe.entry.js +2 -0
- package/dist/cura/p-9e3d26fe.entry.js.map +1 -0
- package/dist/cura/{p-dcd2e5bb.entry.js → p-a7ecea4a.entry.js} +2 -2
- package/dist/cura/{p-33772510.entry.js → p-b0451cb3.entry.js} +2 -2
- package/dist/cura/{p-8f3db0fe.entry.js → p-b883e098.entry.js} +2 -2
- package/dist/cura/{p-907b3d12.entry.js → p-bfb5e9e1.entry.js} +2 -2
- package/dist/cura/{p-e5023e34.entry.js → p-c444e692.entry.js} +2 -2
- package/dist/cura/{p-fdce91a7.entry.js → p-d635501a.entry.js} +2 -2
- package/dist/cura/{p-fd083399.entry.js → p-df851816.entry.js} +2 -2
- package/dist/cura/{p-44e3325a.entry.js → p-e3d3bc3d.entry.js} +2 -2
- package/dist/cura/p-eda28278.entry.js +2 -0
- package/dist/cura/p-eda28278.entry.js.map +1 -0
- package/dist/esm/{app-globals-6ca7103d.js → app-globals-e54ee4c3.js} +32 -1
- package/dist/esm/app-globals-e54ee4c3.js.map +1 -0
- package/dist/esm/cura-accordion_12.entry.js +39 -38
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +3 -2
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-number.entry.js +2 -2
- package/dist/esm/cura-badge-number.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +17 -9
- 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 +2 -2
- package/dist/esm/cura-calendar.entry.js.map +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 +21 -11
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +3 -3
- package/dist/esm/cura-input-date.entry.js +45 -45
- package/dist/esm/cura-input-date.entry.js.map +1 -1
- package/dist/esm/cura-loader-bar.entry.js +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 +228 -0
- package/dist/esm/cura-tooltip.entry.js.map +1 -0
- package/dist/esm/cura.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/types/api/theme-presets/theme-presets.d.ts +43 -0
- package/dist/types/api/theme-presets/theme-richet.d.ts +43 -0
- package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +7 -3
- package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +38 -16
- package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +8 -3
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +2 -0
- package/dist/types/components/buttons/cura-button-select/cura-button-select.stories.d.ts +14 -0
- package/dist/types/components/cura-tooltip/cura-tooltip.d.ts +25 -0
- package/dist/types/components/cura-tooltip/cura-tooltip.stories.d.ts +119 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +1 -0
- package/dist/types/components/forms/cura-input-date/cura-input-date.d.ts +19 -19
- package/dist/types/components/text/cura-heading/cura-heading.d.ts +1 -0
- package/dist/types/components.d.ts +75 -10
- package/package.json +2 -2
- package/dist/cjs/app-globals-4d07f363.js.map +0 -1
- package/dist/cura/p-0b7a7306.js +0 -2
- package/dist/cura/p-0b7a7306.js.map +0 -1
- package/dist/cura/p-2d267d23.entry.js +0 -2
- package/dist/cura/p-2d267d23.entry.js.map +0 -1
- package/dist/cura/p-4e14c01c.entry.js +0 -2
- package/dist/cura/p-b43b69f3.entry.js +0 -2
- package/dist/cura/p-b43b69f3.entry.js.map +0 -1
- package/dist/cura/p-be10b681.entry.js +0 -2
- package/dist/cura/p-be10b681.entry.js.map +0 -1
- package/dist/cura/p-cda24a1e.entry.js +0 -2
- package/dist/cura/p-cda24a1e.entry.js.map +0 -1
- package/dist/cura/p-e8bc6381.entry.js +0 -2
- package/dist/cura/p-e8bc6381.entry.js.map +0 -1
- package/dist/cura/p-ed97cf3c.entry.js +0 -2
- package/dist/cura/p-ed97cf3c.entry.js.map +0 -1
- package/dist/esm/app-globals-6ca7103d.js.map +0 -1
- /package/dist/cura/{p-116a1cd6.entry.js.map → p-01e301d4.entry.js.map} +0 -0
- /package/dist/cura/{p-c6508bd7.entry.js.map → p-022b22b6.entry.js.map} +0 -0
- /package/dist/cura/{p-b2d5db22.entry.js.map → p-2c0f5497.entry.js.map} +0 -0
- /package/dist/cura/{p-fcbf4311.entry.js.map → p-639c1b67.entry.js.map} +0 -0
- /package/dist/cura/{p-41c3d47d.entry.js.map → p-81c66f2b.entry.js.map} +0 -0
- /package/dist/cura/{p-4e14c01c.entry.js.map → p-9991f7db.entry.js.map} +0 -0
- /package/dist/cura/{p-dcd2e5bb.entry.js.map → p-a7ecea4a.entry.js.map} +0 -0
- /package/dist/cura/{p-33772510.entry.js.map → p-b0451cb3.entry.js.map} +0 -0
- /package/dist/cura/{p-8f3db0fe.entry.js.map → p-b883e098.entry.js.map} +0 -0
- /package/dist/cura/{p-907b3d12.entry.js.map → p-bfb5e9e1.entry.js.map} +0 -0
- /package/dist/cura/{p-e5023e34.entry.js.map → p-c444e692.entry.js.map} +0 -0
- /package/dist/cura/{p-fdce91a7.entry.js.map → p-d635501a.entry.js.map} +0 -0
- /package/dist/cura/{p-fd083399.entry.js.map → p-df851816.entry.js.map} +0 -0
- /package/dist/cura/{p-44e3325a.entry.js.map → p-e3d3bc3d.entry.js.map} +0 -0
|
@@ -2,21 +2,16 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
export class CuraAccordionItem {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.label = '';
|
|
5
|
-
this.iconSize =
|
|
5
|
+
this.iconSize = 20;
|
|
6
|
+
this.labelIcon = '';
|
|
6
7
|
this.openIcon = 'down';
|
|
7
8
|
this.closeIcon = 'up';
|
|
8
9
|
this.iconColor = '';
|
|
9
|
-
this.iconActiveColor = '';
|
|
10
10
|
this.colorMode = 'dark';
|
|
11
|
+
this.level = 3;
|
|
11
12
|
this.opened = false;
|
|
12
13
|
this.styles = {};
|
|
13
14
|
}
|
|
14
|
-
getIconColor() {
|
|
15
|
-
const inverted = this.colorMode === 'light';
|
|
16
|
-
const iconColor = inverted ? 'neutral-lighter' : `${this.iconColor}-base`;
|
|
17
|
-
const iconActiveColor = inverted ? 'neutral-purewhite' : `${this.iconActiveColor}-base`;
|
|
18
|
-
return this.opened ? iconActiveColor : iconColor;
|
|
19
|
-
}
|
|
20
15
|
getClasses() {
|
|
21
16
|
const classes = {};
|
|
22
17
|
classes['accordion-item'] = true;
|
|
@@ -27,8 +22,13 @@ export class CuraAccordionItem {
|
|
|
27
22
|
accordionItemClick(_) {
|
|
28
23
|
this.opened = !this.opened;
|
|
29
24
|
}
|
|
25
|
+
renderIcon() {
|
|
26
|
+
if (!this.labelIcon)
|
|
27
|
+
return '';
|
|
28
|
+
return h("cura-icon", { name: this.labelIcon, size: this.iconSize, color: "neutral-black" });
|
|
29
|
+
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '3dd53ab4a597b1726045ec4d3ed066c6c30050d0', slot: "accordion-item" }, h("div", { key: '209291c7c9b587ac546e8b9e40b7d94a11a2489e', class: this.getClasses(), style: this.styles }, h("div", { key: '9c2de1103c7f30bc9d2cb0a86fc660c98b94be84', class: "label", onClick: e => this.accordionItemClick(e) }, h("div", { key: '052a8be2c00edf3907e49970120d9b65937ab031', class: "label-container" }, h("div", { key: 'da543cdbcb0c0d5f691c3d2fcabfbfc9ec46f506', class: "label-content" }, this.renderIcon(), h("cura-heading", { key: 'f587de080f2c1779ffacf0b557827c24edf5e1ee', size: "small", level: this.level, weight: 'bold', "margin-block": "0", color: "neutral-black" }, this.label)), h("cura-icon", { key: '611b48e32dfd7056a563aab56401feb3c8febee2', name: this.opened ? this.closeIcon : this.openIcon, size: this.iconSize, color: "neutral-black" }))), h("div", { key: 'e1d5e606f3e9415570a2a5c2ba3d96264d430bd0', class: 'content' }, h("div", { key: '62b76ef21093a4d051120e2502936049a186c36a', class: "content-wrapper" }, h("slot", { key: '646b3d0163edf473c1a2e824f251f4db85b2fc18' }))))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "cura-accordion-item"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,9 +78,9 @@ export class CuraAccordionItem {
|
|
|
78
78
|
},
|
|
79
79
|
"attribute": "icon-size",
|
|
80
80
|
"reflect": true,
|
|
81
|
-
"defaultValue": "
|
|
81
|
+
"defaultValue": "20"
|
|
82
82
|
},
|
|
83
|
-
"
|
|
83
|
+
"labelIcon": {
|
|
84
84
|
"type": "string",
|
|
85
85
|
"mutable": false,
|
|
86
86
|
"complexType": {
|
|
@@ -94,11 +94,11 @@ export class CuraAccordionItem {
|
|
|
94
94
|
"tags": [],
|
|
95
95
|
"text": ""
|
|
96
96
|
},
|
|
97
|
-
"attribute": "
|
|
97
|
+
"attribute": "label-icon",
|
|
98
98
|
"reflect": true,
|
|
99
|
-
"defaultValue": "'
|
|
99
|
+
"defaultValue": "''"
|
|
100
100
|
},
|
|
101
|
-
"
|
|
101
|
+
"openIcon": {
|
|
102
102
|
"type": "string",
|
|
103
103
|
"mutable": false,
|
|
104
104
|
"complexType": {
|
|
@@ -112,11 +112,11 @@ export class CuraAccordionItem {
|
|
|
112
112
|
"tags": [],
|
|
113
113
|
"text": ""
|
|
114
114
|
},
|
|
115
|
-
"attribute": "
|
|
115
|
+
"attribute": "open-icon",
|
|
116
116
|
"reflect": true,
|
|
117
|
-
"defaultValue": "'
|
|
117
|
+
"defaultValue": "'down'"
|
|
118
118
|
},
|
|
119
|
-
"
|
|
119
|
+
"closeIcon": {
|
|
120
120
|
"type": "string",
|
|
121
121
|
"mutable": false,
|
|
122
122
|
"complexType": {
|
|
@@ -128,13 +128,13 @@ export class CuraAccordionItem {
|
|
|
128
128
|
"optional": false,
|
|
129
129
|
"docs": {
|
|
130
130
|
"tags": [],
|
|
131
|
-
"text": "
|
|
131
|
+
"text": ""
|
|
132
132
|
},
|
|
133
|
-
"attribute": "icon
|
|
133
|
+
"attribute": "close-icon",
|
|
134
134
|
"reflect": true,
|
|
135
|
-
"defaultValue": "''"
|
|
135
|
+
"defaultValue": "'up'"
|
|
136
136
|
},
|
|
137
|
-
"
|
|
137
|
+
"iconColor": {
|
|
138
138
|
"type": "string",
|
|
139
139
|
"mutable": false,
|
|
140
140
|
"complexType": {
|
|
@@ -146,9 +146,9 @@ export class CuraAccordionItem {
|
|
|
146
146
|
"optional": false,
|
|
147
147
|
"docs": {
|
|
148
148
|
"tags": [],
|
|
149
|
-
"text": ""
|
|
149
|
+
"text": "Color scheme base color\n(By default, the icon will use the same color of 'color')"
|
|
150
150
|
},
|
|
151
|
-
"attribute": "icon-
|
|
151
|
+
"attribute": "icon-color",
|
|
152
152
|
"reflect": true,
|
|
153
153
|
"defaultValue": "''"
|
|
154
154
|
},
|
|
@@ -170,6 +170,24 @@ export class CuraAccordionItem {
|
|
|
170
170
|
"reflect": false,
|
|
171
171
|
"defaultValue": "'dark'"
|
|
172
172
|
},
|
|
173
|
+
"level": {
|
|
174
|
+
"type": "number",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "1 | 2 | 3 | 4 | 5 | 6",
|
|
178
|
+
"resolved": "1 | 2 | 3 | 4 | 5 | 6",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\nValues: 1 to 6 (3 default)."
|
|
186
|
+
},
|
|
187
|
+
"attribute": "level",
|
|
188
|
+
"reflect": true,
|
|
189
|
+
"defaultValue": "3"
|
|
190
|
+
},
|
|
173
191
|
"opened": {
|
|
174
192
|
"type": "boolean",
|
|
175
193
|
"mutable": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-accordion-item.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion-item/cura-accordion-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAG,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOjE,MAAM,OAAO,iBAAiB;;qBAKW,EAAE;wBAMP,EAAE;
|
|
1
|
+
{"version":3,"file":"cura-accordion-item.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion-item/cura-accordion-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAG,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOjE,MAAM,OAAO,iBAAiB;;qBAKW,EAAE;wBAMP,EAAE;yBACD,EAAE;wBACH,MAAM;yBACL,IAAI;yBAMJ,EAAE;yBAKC,MAAM;qBAMU,CAAC;sBAEC,KAAK;sBAE3C,EAAE;;IAEpB,UAAU;QACR,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;QACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,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BAC1B,8DAAa,CACT,CACF,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-accordion-item',\n styleUrl: 'cura-accordion-item.scss',\n shadow: true,\n})\nexport class CuraAccordionItem {\n\n /**\n * Text label for accordion item\n */\n @Prop({reflect: true}) label: string = '';\n\n /** ***Properties below are inherited from the cura-accordion*** */\n /**\n * Accordion items icons\n */\n @Prop({reflect: true}) iconSize = 20;\n @Prop({reflect: true}) labelIcon = '';\n @Prop({reflect: true}) openIcon = 'down';\n @Prop({reflect: true}) closeIcon = 'up';\n\n /**\n * Color scheme base color\n * (By default, the icon will use the same color of 'color')\n */\n @Prop({reflect: true}) iconColor = '';\n\n /**\n * Set the color mode to dark or light\n */\n @Prop() colorMode: 'dark' | 'light' = 'dark';\n\n /**\n * Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\n * Values: 1 to 6 (3 default).\n */\n @Prop({reflect: true}) level: 1 | 2 | 3 | 4 | 5 | 6 = 3;\n\n @Prop({reflect: true, mutable: true}) opened: boolean = false;\n\n @State() styles = {};\n\n getClasses() {\n const classes = {};\n classes['accordion-item'] = true;\n classes['active'] = this.opened;\n classes['inverted'] = this.colorMode === 'light';\n return classes;\n }\n\n accordionItemClick(_: Event) {\n this.opened = !this.opened;\n }\n\n renderIcon() {\n if (!this.labelIcon) return '';\n return <cura-icon name={this.labelIcon} size={this.iconSize} color={\"neutral-black\"}></cura-icon>;\n }\n\n render() {\n return (\n <Host slot=\"accordion-item\">\n <div class={this.getClasses()} style={this.styles}>\n <div class=\"label\" onClick={e => this.accordionItemClick(e)}>\n <div class=\"label-container\">\n <div class=\"label-content\">\n {this.renderIcon()}\n <cura-heading size=\"small\" level={this.level} weight='bold' margin-block=\"0\" color=\"neutral-black\">\n {this.label}\n </cura-heading>\n </div>\n <cura-icon name={this.opened ? this.closeIcon : this.openIcon} size={this.iconSize} color={\"neutral-black\"}></cura-icon>\n </div>\n </div>\n <div class='content'>\n <div class=\"content-wrapper\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -18,7 +18,7 @@ export class CuraDistance {
|
|
|
18
18
|
this.formatDistance();
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: '7027189b17f2ad1759f9d43bc5dbc9cbb1fe47cc' }, h("div", { key: 'bc57ac9c32c0651469d4bd6ee75d0f97408fde34', class: "container", style: this.styles }, h("cura-label", { key: '913db081273caf2e7d46d92b22e1988cf28ddeb3', size: 'xsmall', weight: 'bold', color: 'neutral-black' }, this.displayDistance, this.isThousandRounded ? 'K' : ''), h("cura-label", { key: '4c327bd9d55466bb2d9c614d9aa0420e42da23ce', size: 'xsmall', weight: 'bold', color: 'neutral-dark' }, this.label))));
|
|
22
22
|
}
|
|
23
23
|
setCssProperties() {
|
|
24
24
|
this.styles = {
|
|
@@ -10,7 +10,7 @@ export class CuraBadgeNumber {
|
|
|
10
10
|
this.styles = Object.assign(Object.assign({}, this.styles), { '--background-color': this.theme.colors.getColor(this.color) });
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'a20934b4bec43ab7024e1bc4ad7537ff0d54b937' }, h("div", { key: 'a3fc8332932a117db4be61092050c3df3e4142bc', class: "container", style: this.styles }, h("cura-label", { key: 'ff53c0645348be0d392728778e3486c353243af5' }, h("slot", { key: 'f0774cc8f8ad07287b68bb3c59bf22cd4fc69755' }, this.number)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "cura-badge-number"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-badge-number.js","sourceRoot":"","sources":["../../../../src/components/badges/cura-badge-number/cura-badge-number.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"cura-badge-number.js","sourceRoot":"","sources":["../../../../src/components/badges/cura-badge-number/cura-badge-number.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,eAAe;;QAI1B,WAAM,GAAG,EAAE,CAAC;QAEZ,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;;;;IAE7B,iBAAiB;QACf,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAC7D,CAAA;IACH,CAAC;IAGD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM;gBACvC;oBACE,+DAAO,IAAI,CAAC,MAAM,CAAQ,CACf,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-badge-number',\n styleUrl: 'cura-badge-number.scss',\n shadow: true,\n})\nexport class CuraBadgeNumber {\n\n @Prop({ reflect: true }) number: number | null\n @Prop({ reflect: true }) color: string\n styles = {};\n\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--background-color': this.theme.colors.getColor(this.color),\n }\n }\n\n\n render() {\n return (\n <Host>\n <div class=\"container\" style={this.styles}>\n <cura-label>\n <slot>{this.number}</slot>\n </cura-label>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -88,7 +88,7 @@ export class CuraButton {
|
|
|
88
88
|
render() {
|
|
89
89
|
const symbolColor = this.getSymbolColor();
|
|
90
90
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
91
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: '2831f74cc53bbadcaf1648c759090204cf3c20ea' }, this.href ? (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() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (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 }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { class: "label", size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
92
92
|
}
|
|
93
93
|
static get is() { return "cura-button"; }
|
|
94
94
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +87,7 @@ export class CuraButtonOutline {
|
|
|
87
87
|
render() {
|
|
88
88
|
const symbolColor = this.getSymbolColor();
|
|
89
89
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
return (h(Host, { key: '5adde27bc83165040d4279e4835646e13b08a412' }, this.href ? (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() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (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 }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
91
91
|
}
|
|
92
92
|
static get is() { return "cura-button-outline"; }
|
|
93
93
|
static get encapsulation() { return "shadow"; }
|
|
@@ -95,12 +95,24 @@
|
|
|
95
95
|
position: relative;
|
|
96
96
|
background-color: var(--neutral-purewhite);
|
|
97
97
|
box-sizing: border-box;
|
|
98
|
-
border:
|
|
98
|
+
border: none;
|
|
99
99
|
}
|
|
100
100
|
:host button:focus,
|
|
101
101
|
:host a:focus {
|
|
102
102
|
outline: 2px solid #6EA8FF;
|
|
103
103
|
}
|
|
104
|
+
:host button::before,
|
|
105
|
+
:host a::before {
|
|
106
|
+
content: "";
|
|
107
|
+
width: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
position: absolute;
|
|
110
|
+
left: 0px;
|
|
111
|
+
top: 0px;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
border: 2px solid var(--color-border);
|
|
114
|
+
border-radius: var(--border-radius);
|
|
115
|
+
}
|
|
104
116
|
:host button:not(.disabled):hover,
|
|
105
117
|
:host a:not(.disabled):hover {
|
|
106
118
|
background-color: var(--color-background-hover);
|
|
@@ -137,7 +149,11 @@
|
|
|
137
149
|
opacity: 1;
|
|
138
150
|
transition: opacity 0.2s linear;
|
|
139
151
|
position: relative;
|
|
140
|
-
|
|
152
|
+
flex-direction: row !important;
|
|
153
|
+
}
|
|
154
|
+
:host button .button-container .badge-number,
|
|
155
|
+
:host a .button-container .badge-number {
|
|
156
|
+
margin-left: 10px;
|
|
141
157
|
}
|
|
142
158
|
:host button.icon-right .button-container,
|
|
143
159
|
:host a.icon-right .button-container {
|
|
@@ -147,6 +163,24 @@
|
|
|
147
163
|
:host a.justify .button-container {
|
|
148
164
|
width: 100%;
|
|
149
165
|
}
|
|
166
|
+
:host button.icon-left cura-icon,
|
|
167
|
+
:host a.icon-left cura-icon {
|
|
168
|
+
margin-right: calc(var(--base-spacing) * 3px);
|
|
169
|
+
}
|
|
170
|
+
:host button.icon-right cura-icon,
|
|
171
|
+
:host a.icon-right cura-icon {
|
|
172
|
+
margin-left: calc(var(--base-spacing) * 3px);
|
|
173
|
+
}
|
|
174
|
+
:host button.medium.icon-left cura-icon, :host button.small.icon-left cura-icon,
|
|
175
|
+
:host a.medium.icon-left cura-icon,
|
|
176
|
+
:host a.small.icon-left cura-icon {
|
|
177
|
+
margin-right: calc(var(--base-spacing) * 2px);
|
|
178
|
+
}
|
|
179
|
+
:host button.medium.icon-right cura-icon, :host button.small.icon-right cura-icon,
|
|
180
|
+
:host a.medium.icon-right cura-icon,
|
|
181
|
+
:host a.small.icon-right cura-icon {
|
|
182
|
+
margin-left: calc(var(--base-spacing) * 2px);
|
|
183
|
+
}
|
|
150
184
|
:host button.selected,
|
|
151
185
|
:host a.selected {
|
|
152
186
|
cursor: pointer;
|
|
@@ -5,11 +5,12 @@ export class CuraButtonSelect {
|
|
|
5
5
|
this.theme = window.CuraAPI.theme;
|
|
6
6
|
this.selected = false;
|
|
7
7
|
this.iconName = undefined;
|
|
8
|
-
this.size =
|
|
8
|
+
this.size = 'medium';
|
|
9
9
|
this.counter = undefined;
|
|
10
10
|
this.disabled = undefined;
|
|
11
|
-
this.background =
|
|
12
|
-
this.color =
|
|
11
|
+
this.background = 'light';
|
|
12
|
+
this.color = 'primary';
|
|
13
|
+
this.iconPosition = undefined;
|
|
13
14
|
this.hovered = false;
|
|
14
15
|
this.styles = {};
|
|
15
16
|
}
|
|
@@ -33,7 +34,7 @@ export class CuraButtonSelect {
|
|
|
33
34
|
var _a;
|
|
34
35
|
const classes = {};
|
|
35
36
|
classes[`${(_a = this.size) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`] = true;
|
|
36
|
-
classes[
|
|
37
|
+
classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
|
|
37
38
|
classes['disabled'] = this.disabled;
|
|
38
39
|
classes['selected'] = this.selected;
|
|
39
40
|
return classes;
|
|
@@ -75,11 +76,18 @@ export class CuraButtonSelect {
|
|
|
75
76
|
return `${this.color}-darker`;
|
|
76
77
|
}
|
|
77
78
|
getIcon() {
|
|
78
|
-
const iconSize = this.size === 'large' ?
|
|
79
|
-
|
|
79
|
+
const iconSize = this.size === 'large' ? 20 : 16;
|
|
80
|
+
if (this.iconPosition === 'right') {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
return h("cura-icon", { name: this.iconName, size: iconSize, color: this.getLabelFontColor() });
|
|
80
84
|
}
|
|
81
85
|
getCounter() {
|
|
82
|
-
return (h("cura-badge-number", { color: this.getColorCounter() }, h("cura-label", { color: this.getColorBagdeNumber() }, this.counter)));
|
|
86
|
+
return (h("cura-badge-number", { color: this.getColorCounter(), class: "badge-number" }, h("cura-label", { color: this.getColorBagdeNumber(), size: "small" }, this.counter)));
|
|
87
|
+
}
|
|
88
|
+
getCheckIconRight() {
|
|
89
|
+
const iconSize = this.size === 'large' ? 20 : 16;
|
|
90
|
+
return h("cura-icon", { name: "check", size: iconSize, color: this.getLabelFontColor() });
|
|
83
91
|
}
|
|
84
92
|
handleMouseEnter() {
|
|
85
93
|
if (this.disabled)
|
|
@@ -97,7 +105,7 @@ export class CuraButtonSelect {
|
|
|
97
105
|
}
|
|
98
106
|
render() {
|
|
99
107
|
const labelSize = labelSizes[this.size] || labelSizes['default'];
|
|
100
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: '8b766a3e23c2af13a47d113884047d19717702f2' }, h("button", { key: '90b57f260baa61de7c73e09965e190cd13eb62e1', class: this.getClasses(), style: this.styles, disabled: this.disabled, onClick: e => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { key: 'f318438fa59f43846ce5043e4ee290faf3cf05d4', class: "button-container" }, this.iconName ? this.getIcon() : null, h("cura-label", { key: '2d069740c62b32dd3aa0fd74bdafb951d8deb73b', class: "label", size: labelSize, lineHeight: "0%", color: this.getLabelFontColor(), weight: "regular" }, h("slot", { key: 'e71e072d1dd91bbbafa939181cc22ba7b7c6189e' })), this.counter ? this.getCounter() : null, this.iconPosition === 'right' && this.selected ? this.getCheckIconRight() : null))));
|
|
101
109
|
}
|
|
102
110
|
static get is() { return "cura-button-select"; }
|
|
103
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -163,7 +171,8 @@ export class CuraButtonSelect {
|
|
|
163
171
|
"text": ""
|
|
164
172
|
},
|
|
165
173
|
"attribute": "size",
|
|
166
|
-
"reflect": true
|
|
174
|
+
"reflect": true,
|
|
175
|
+
"defaultValue": "'medium'"
|
|
167
176
|
},
|
|
168
177
|
"counter": {
|
|
169
178
|
"type": "any",
|
|
@@ -214,7 +223,8 @@ export class CuraButtonSelect {
|
|
|
214
223
|
"text": ""
|
|
215
224
|
},
|
|
216
225
|
"attribute": "background",
|
|
217
|
-
"reflect": false
|
|
226
|
+
"reflect": false,
|
|
227
|
+
"defaultValue": "'light'"
|
|
218
228
|
},
|
|
219
229
|
"color": {
|
|
220
230
|
"type": "string",
|
|
@@ -231,7 +241,25 @@ export class CuraButtonSelect {
|
|
|
231
241
|
"text": ""
|
|
232
242
|
},
|
|
233
243
|
"attribute": "color",
|
|
234
|
-
"reflect": false
|
|
244
|
+
"reflect": false,
|
|
245
|
+
"defaultValue": "'primary'"
|
|
246
|
+
},
|
|
247
|
+
"iconPosition": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"mutable": false,
|
|
250
|
+
"complexType": {
|
|
251
|
+
"original": "'left' | 'right'",
|
|
252
|
+
"resolved": "\"left\" | \"right\"",
|
|
253
|
+
"references": {}
|
|
254
|
+
},
|
|
255
|
+
"required": false,
|
|
256
|
+
"optional": false,
|
|
257
|
+
"docs": {
|
|
258
|
+
"tags": [],
|
|
259
|
+
"text": ""
|
|
260
|
+
},
|
|
261
|
+
"attribute": "icon-position",
|
|
262
|
+
"reflect": true
|
|
235
263
|
}
|
|
236
264
|
};
|
|
237
265
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-button-select.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAOxD,MAAM,OAAO,gBAAgB;;QAgB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAbsB,KAAK;;;;;;;uBAQrC,KAAK;sBACN,EAAE;;IAUpB,SAAS;QACP,MAAM,MAAM,GAAG;YACb,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,EAAE;YACzG,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,QAAQ,EAAE;YAC3H,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,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C,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI;oBACtC,mEAAY,KAAK,EAAC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAC,SAAS;wBAC1G,8DAAa,CACF;oBACZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CACpC,CACC,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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';\n @Prop({ reflect: true, mutable: true }) counter: string | number | null;\n @Prop({ reflect: true }) disabled: boolean;\n @Prop() background: 'dark' | 'light';\n @Prop() color: string;\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'] = 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' ? 24 : this.size === 'medium' ? 20 : 16;\n\n return <cura-icon class=\"button-icon\" name={this.iconName} size={iconSize} color={this.getLabelFontColor()} />;\n }\n\n getCounter() {\n return (\n <cura-badge-number color={this.getColorCounter()}>\n <cura-label color={this.getColorBagdeNumber()}>{this.counter}</cura-label>\n </cura-badge-number>\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 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 </div>\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-button-select.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAOxD,MAAM,OAAO,gBAAgB;;QAiB3B,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;wBAdsB,KAAK;;oBAEM,QAAQ;;;0BAG/B,OAAO;qBACtB,SAAS;;uBAGd,K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,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI,CAC7E,CACC,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
|
|
@@ -38,6 +38,7 @@ const renderCuraButtonSelect = (label, args) => {
|
|
|
38
38
|
? `
|
|
39
39
|
color="${args.color}"`
|
|
40
40
|
: ''}
|
|
41
|
+
${args.iconPosition ? `icon-position="${args.iconPosition}"` : ''}
|
|
41
42
|
>
|
|
42
43
|
${label}
|
|
43
44
|
</cura-button-select>
|
|
@@ -79,8 +80,8 @@ export default {
|
|
|
79
80
|
description: 'Tamanhos disponíveis.',
|
|
80
81
|
table: {
|
|
81
82
|
category: 'Properties',
|
|
82
|
-
defaultValue: { summary: 'large' }
|
|
83
|
-
}
|
|
83
|
+
defaultValue: { summary: 'large' },
|
|
84
|
+
},
|
|
84
85
|
},
|
|
85
86
|
color: {
|
|
86
87
|
control: { type: 'select' },
|
|
@@ -88,16 +89,16 @@ export default {
|
|
|
88
89
|
description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
|
|
89
90
|
table: {
|
|
90
91
|
category: 'Properties',
|
|
91
|
-
}
|
|
92
|
+
},
|
|
92
93
|
},
|
|
93
94
|
iconName: {
|
|
94
95
|
control: { type: 'select' },
|
|
95
96
|
options: ['', ...iconNames],
|
|
96
97
|
description: 'Nome do ícone a ser utilizado no iconset.',
|
|
97
98
|
table: {
|
|
98
|
-
category: 'Icons'
|
|
99
|
+
category: 'Icons',
|
|
99
100
|
},
|
|
100
|
-
name: 'icon-name'
|
|
101
|
+
name: 'icon-name',
|
|
101
102
|
},
|
|
102
103
|
background: {
|
|
103
104
|
control: { type: 'inline-radio' },
|
|
@@ -105,7 +106,7 @@ export default {
|
|
|
105
106
|
description: 'Define cor clara ou escura do componente.',
|
|
106
107
|
table: {
|
|
107
108
|
category: 'Properties',
|
|
108
|
-
defaultValue: { summary: 'light' }
|
|
109
|
+
defaultValue: { summary: 'light' },
|
|
109
110
|
},
|
|
110
111
|
},
|
|
111
112
|
counter: {
|
|
@@ -116,6 +117,15 @@ export default {
|
|
|
116
117
|
defaultValue: { summary: 1 },
|
|
117
118
|
},
|
|
118
119
|
},
|
|
120
|
+
iconPosition: {
|
|
121
|
+
control: { type: 'inline-radio' },
|
|
122
|
+
options: ['left', 'right'],
|
|
123
|
+
description: 'Define a posição do ícone. Apenas o ícone <b>check</b> é permitido a direita.',
|
|
124
|
+
table: {
|
|
125
|
+
category: 'Icons',
|
|
126
|
+
defaultValue: { summary: 'left' },
|
|
127
|
+
},
|
|
128
|
+
},
|
|
119
129
|
},
|
|
120
130
|
};
|
|
121
131
|
export const Button = {
|
|
@@ -127,7 +137,8 @@ export const Button = {
|
|
|
127
137
|
disabled: false,
|
|
128
138
|
background: 'light',
|
|
129
139
|
color: 'primary',
|
|
130
|
-
label:
|
|
140
|
+
label: 'Button',
|
|
141
|
+
iconPosition: 'left',
|
|
131
142
|
},
|
|
132
143
|
};
|
|
133
144
|
//# sourceMappingURL=cura-button-select.stories.js.map
|
package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-button-select.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"cura-button-select.stories.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-select/cura-button-select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE;IAC1D,MAAM,KAAK,GAAG,uBACZ,IAAI,CAAC,QAAQ;QACX,CAAC,CAAC;oBACY,IAAI,CAAC,QAAQ,GAAG;QAC9B,CAAC,CAAC,EACN,GACE,IAAI,CAAC,QAAQ;QACX,CAAC,CAAC;oBACY,IAAI,CAAC,QAAQ,GAAG;QAC9B,CAAC,CAAC,EACN;IAEE,IAAI,CAAC,QAAQ;QACX,CAAC,CAAC;qBACa,IAAI,CAAC,QAAQ,GAAG;QAC/B,CAAC,CAAC,EACN,GACE,IAAI,CAAC,IAAI;QACP,CAAC,CAAC;gBACQ,IAAI,CAAC,IAAI,GAAG;QACtB,CAAC,CAAC,EACN;IAEE,IAAI,CAAC,OAAO;QACV,CAAC,CAAC;mBACW,IAAI,CAAC,OAAO,GAAG;QAC5B,CAAC,CAAC,EACN;IAEE,IAAI,CAAC,UAAU;QACb,CAAC,CAAC;sBACc,IAAI,CAAC,UAAU,GAAG;QAClC,CAAC,CAAC,EACN;IAEE,IAAI,CAAC,KAAK;QACR,CA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AAE,UAAU;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,OAAO;QACnB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE,MAAM;KACrB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst renderCuraButtonSelect = (label: string, args: any) => {\n const block = `<cura-button-select ${\n args.selected\n ? `\n selected=\"${args.selected}\"`\n : ''\n }${\n args.disabled\n ? `\n disabled=\"${args.disabled}\"`\n : ''\n }\n ${\n args.iconName\n ? `\n icon-name=\"${args.iconName}\"`\n : ''\n }${\n args.size\n ? `\n size=\"${args.size}\"`\n : ''\n }\n ${\n args.counter\n ? `\n counter=\"${args.counter}\"`\n : ''\n }\n ${\n args.background\n ? `\n background=\"${args.background}\"`\n : ''\n }\n ${\n args.color\n ? `\n color=\"${args.color}\"`\n : ''\n }\n ${args.iconPosition ? `icon-position=\"${args.iconPosition}\"` : ''}\n >\n ${label}\n </cura-button-select>\n `;\n return `${block}`;\n};\n\nexport default {\n title: 'Componentes/Buttons/Button Select',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n return renderCuraButtonSelect(label, args);\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',\n name: 'Label',\n },\n disabled: {\n control: 'boolean',\n description: 'Estado desabilitado.',\n table: {\n category: 'State',\n defaultValue: { summary: false },\n },\n },\n selected: {\n control: 'boolean',\n description: 'Estado selecionado.',\n table: {\n category: 'State',\n defaultValue: { summary: false },\n },\n },\n size: {\n control: { type: 'inline-radio' },\n options: ['small', 'medium', 'large'],\n description: 'Tamanhos disponíveis.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'large' },\n },\n },\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n },\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone a ser utilizado no iconset.',\n table: {\n category: 'Icons',\n },\n name: 'icon-name',\n },\n background: {\n control: { type: 'inline-radio' },\n options: ['dark', 'light'],\n description: 'Define cor clara ou escura do componente.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n },\n counter: {\n control: 'number',\n description: 'Define o número a ser exibido pelo componente',\n table: {\n category: 'Properties',\n defaultValue: { summary: 1 },\n },\n },\n iconPosition: {\n control: { type: 'inline-radio' },\n options: ['left', 'right'],\n description: 'Define a posição do ícone. Apenas o ícone <b>check</b> é permitido a direita.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'left' },\n },\n },\n },\n};\n\nexport const Button = {\n args: {\n selected: false,\n iconName: 'calendar',\n size: 'medium',\n counter: 1,\n disabled: false,\n background: 'light',\n color: 'primary',\n label: 'Button',\n iconPosition: 'left',\n },\n};\n"]}
|
package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js
CHANGED
|
@@ -76,7 +76,7 @@ export class CuraButtonTransparent {
|
|
|
76
76
|
render() {
|
|
77
77
|
const symbolColor = this.getSymbolColor();
|
|
78
78
|
const labelSize = labelSizes[this.size] || labelSizes["default"];
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: '60ab1e67798d35b9bb391ad491e4a9e6f3bc123f' }, this.href ? (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() }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor }))) : (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 }, h("span", { class: "button-container" }, this.getIcon(), h("cura-label", { size: labelSize, lineHeight: '105%', color: symbolColor }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: symbolColor })))));
|
|
80
80
|
}
|
|
81
81
|
static get is() { return "cura-button-transparent"; }
|
|
82
82
|
static get encapsulation() { return "shadow"; }
|