@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
|
@@ -23,14 +23,14 @@ export class CuraAccordion {
|
|
|
23
23
|
};
|
|
24
24
|
this.mutationObserver = new MutationObserver(this.mutationObserverCallback);
|
|
25
25
|
this.color = 'primary';
|
|
26
|
-
this.activeColor = 'accent';
|
|
27
26
|
this.colorMode = 'dark';
|
|
28
|
-
this.iconSize =
|
|
27
|
+
this.iconSize = 20;
|
|
28
|
+
this.labelIcon = '';
|
|
29
29
|
this.openIcon = 'down';
|
|
30
30
|
this.closeIcon = 'up';
|
|
31
31
|
this.iconColor = '';
|
|
32
|
-
this.iconActiveColor = '';
|
|
33
32
|
this.behavior = 'default';
|
|
33
|
+
this.level = 3;
|
|
34
34
|
this.styles = {};
|
|
35
35
|
}
|
|
36
36
|
handleChangeColor() {
|
|
@@ -39,8 +39,6 @@ export class CuraAccordion {
|
|
|
39
39
|
connectedCallback() {
|
|
40
40
|
const weights = window.CuraAPI.theme.fonts.getWeights();
|
|
41
41
|
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
42
|
-
this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);
|
|
43
|
-
this.styles['--neutral-lighter'] = window.CuraAPI.theme.colors.getColor(`neutral-lighter`);
|
|
44
42
|
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
45
43
|
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
46
44
|
this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();
|
|
@@ -62,17 +60,20 @@ export class CuraAccordion {
|
|
|
62
60
|
// Theme
|
|
63
61
|
item.colorMode = this.colorMode;
|
|
64
62
|
item.iconColor = this.iconColor || this.color;
|
|
65
|
-
item.iconActiveColor = this.iconActiveColor || this.activeColor;
|
|
66
63
|
// Icon
|
|
67
64
|
item.iconSize = this.iconSize;
|
|
65
|
+
if (this.labelIcon)
|
|
66
|
+
item.labelIcon = this.labelIcon; // It's possible to define a specific icon for each item.
|
|
68
67
|
item.openIcon = this.openIcon;
|
|
69
68
|
item.closeIcon = this.closeIcon;
|
|
69
|
+
// Level
|
|
70
|
+
item.level = this.level;
|
|
70
71
|
}
|
|
71
72
|
setColors() {
|
|
72
|
-
this.styles = Object.assign(Object.assign({}, this.styles), {
|
|
73
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { "--acc-color": window.CuraAPI.theme.colors.getColor("neutral-black"), "--acc-color-hover": window.CuraAPI.theme.colors.getColor(`${this.color}-base`), "--acc-color-icon": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-base`), "--acc-color-icon-hover": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-darker`), "--acc-color-inverted": window.CuraAPI.theme.colors.getColor("neutral-white"), "--acc-color-hover-inverted": window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), "--acc-color-icon-inverted": window.CuraAPI.theme.colors.getColor("neutral-white"), "--acc-color-icon-hover-inverted": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-lighter`) });
|
|
73
74
|
}
|
|
74
75
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: 'a56103203dd352195eaac03957350c73a1fcfb06', style: this.styles }, h("slot", { key: '3226a757908201e1c91d6a9a195980d9020f2327', name: 'accordion-item' })));
|
|
76
77
|
}
|
|
77
78
|
static get is() { return "cura-accordion"; }
|
|
78
79
|
static get encapsulation() { return "shadow"; }
|
|
@@ -106,24 +107,6 @@ export class CuraAccordion {
|
|
|
106
107
|
"reflect": true,
|
|
107
108
|
"defaultValue": "'primary'"
|
|
108
109
|
},
|
|
109
|
-
"activeColor": {
|
|
110
|
-
"type": "string",
|
|
111
|
-
"mutable": false,
|
|
112
|
-
"complexType": {
|
|
113
|
-
"original": "string",
|
|
114
|
-
"resolved": "string",
|
|
115
|
-
"references": {}
|
|
116
|
-
},
|
|
117
|
-
"required": false,
|
|
118
|
-
"optional": false,
|
|
119
|
-
"docs": {
|
|
120
|
-
"tags": [],
|
|
121
|
-
"text": ""
|
|
122
|
-
},
|
|
123
|
-
"attribute": "active-color",
|
|
124
|
-
"reflect": true,
|
|
125
|
-
"defaultValue": "'accent'"
|
|
126
|
-
},
|
|
127
110
|
"colorMode": {
|
|
128
111
|
"type": "string",
|
|
129
112
|
"mutable": false,
|
|
@@ -158,9 +141,9 @@ export class CuraAccordion {
|
|
|
158
141
|
},
|
|
159
142
|
"attribute": "icon-size",
|
|
160
143
|
"reflect": true,
|
|
161
|
-
"defaultValue": "
|
|
144
|
+
"defaultValue": "20"
|
|
162
145
|
},
|
|
163
|
-
"
|
|
146
|
+
"labelIcon": {
|
|
164
147
|
"type": "string",
|
|
165
148
|
"mutable": false,
|
|
166
149
|
"complexType": {
|
|
@@ -174,11 +157,11 @@ export class CuraAccordion {
|
|
|
174
157
|
"tags": [],
|
|
175
158
|
"text": ""
|
|
176
159
|
},
|
|
177
|
-
"attribute": "
|
|
160
|
+
"attribute": "label-icon",
|
|
178
161
|
"reflect": true,
|
|
179
|
-
"defaultValue": "'
|
|
162
|
+
"defaultValue": "''"
|
|
180
163
|
},
|
|
181
|
-
"
|
|
164
|
+
"openIcon": {
|
|
182
165
|
"type": "string",
|
|
183
166
|
"mutable": false,
|
|
184
167
|
"complexType": {
|
|
@@ -192,11 +175,11 @@ export class CuraAccordion {
|
|
|
192
175
|
"tags": [],
|
|
193
176
|
"text": ""
|
|
194
177
|
},
|
|
195
|
-
"attribute": "
|
|
178
|
+
"attribute": "open-icon",
|
|
196
179
|
"reflect": true,
|
|
197
|
-
"defaultValue": "'
|
|
180
|
+
"defaultValue": "'down'"
|
|
198
181
|
},
|
|
199
|
-
"
|
|
182
|
+
"closeIcon": {
|
|
200
183
|
"type": "string",
|
|
201
184
|
"mutable": false,
|
|
202
185
|
"complexType": {
|
|
@@ -208,13 +191,13 @@ export class CuraAccordion {
|
|
|
208
191
|
"optional": false,
|
|
209
192
|
"docs": {
|
|
210
193
|
"tags": [],
|
|
211
|
-
"text": "
|
|
194
|
+
"text": ""
|
|
212
195
|
},
|
|
213
|
-
"attribute": "icon
|
|
196
|
+
"attribute": "close-icon",
|
|
214
197
|
"reflect": true,
|
|
215
|
-
"defaultValue": "''"
|
|
198
|
+
"defaultValue": "'up'"
|
|
216
199
|
},
|
|
217
|
-
"
|
|
200
|
+
"iconColor": {
|
|
218
201
|
"type": "string",
|
|
219
202
|
"mutable": false,
|
|
220
203
|
"complexType": {
|
|
@@ -226,9 +209,9 @@ export class CuraAccordion {
|
|
|
226
209
|
"optional": false,
|
|
227
210
|
"docs": {
|
|
228
211
|
"tags": [],
|
|
229
|
-
"text": ""
|
|
212
|
+
"text": "Color scheme base color\n(By default, the icon will use the same color of 'color')"
|
|
230
213
|
},
|
|
231
|
-
"attribute": "icon-
|
|
214
|
+
"attribute": "icon-color",
|
|
232
215
|
"reflect": true,
|
|
233
216
|
"defaultValue": "''"
|
|
234
217
|
},
|
|
@@ -249,6 +232,24 @@ export class CuraAccordion {
|
|
|
249
232
|
"attribute": "behavior",
|
|
250
233
|
"reflect": true,
|
|
251
234
|
"defaultValue": "'default'"
|
|
235
|
+
},
|
|
236
|
+
"level": {
|
|
237
|
+
"type": "number",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "1 | 2 | 3 | 4 | 5 | 6",
|
|
241
|
+
"resolved": "1 | 2 | 3 | 4 | 5 | 6",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\nValues: 1 to 6 (3 default)."
|
|
249
|
+
},
|
|
250
|
+
"attribute": "level",
|
|
251
|
+
"reflect": true,
|
|
252
|
+
"defaultValue": "3"
|
|
252
253
|
}
|
|
253
254
|
};
|
|
254
255
|
}
|
|
@@ -262,9 +263,6 @@ export class CuraAccordion {
|
|
|
262
263
|
return [{
|
|
263
264
|
"propName": "color",
|
|
264
265
|
"methodName": "handleChangeColor"
|
|
265
|
-
}, {
|
|
266
|
-
"propName": "activeColor",
|
|
267
|
-
"methodName": "handleChangeColor"
|
|
268
266
|
}];
|
|
269
267
|
}
|
|
270
268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-accordion.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion/cura-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,aAAa;;QAwCxB,6BAAwB,GAAG,CAAC,SAA2B,EAAE,CAAmB,EAAE,EAAE;;YAC9E,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACjC,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,KAAI,MAAA,QAAQ,CAAC,MAAM,0CAAG,QAAQ,CAAC,CAAA,EAAE,CAAC;oBACzG,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;wBAAE,SAAS;oBAC1C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;wBAC/D,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;4BAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;wBACtB,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;gBACD,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBAClC,MAAM,UAAU,GAAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-accordion',\n styleUrl: 'cura-accordion.scss',\n shadow: true,\n})\nexport class CuraAccordion {\n\n @Element() host: HTMLElement;\n\n /**\n * Color scheme base color\n */\n @Prop({reflect: true}) color = 'primary';\n @Prop({reflect: true}) activeColor = 'accent';\n @Watch('color')\n @Watch('activeColor')\n handleChangeColor() {\n this.setColors();\n }\n\n /**\n * Set the color mode to dark or light\n */\n @Prop({reflect: true}) colorMode: 'dark' | 'light' = 'dark';\n\n /**\n * Accordion items icons\n */\n @Prop({reflect: true}) iconSize = 32;\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' and 'activeColor')\n */\n @Prop({reflect: true}) iconColor = '';\n @Prop({reflect: true}) iconActiveColor = '';\n\n /**\n * Accordion behavior when item is clicked\n * (The default will close all items except the current one)\n */\n @Prop({reflect: true}) behavior: 'default' | 'keep-open' = 'default';\n\n mutationObserverCallback = (mutations: MutationRecord[], _: MutationObserver) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'opened' && mutation.target?.['opened']) {\n if (this.behavior !== 'default') continue;\n this.host.querySelectorAll('cura-accordion-item').forEach(item => {\n if (item != mutation.target) {\n item.opened = false;\n }\n });\n }\n if (mutation.type === 'childList') {\n const addedNodes = Array.from(mutation.addedNodes || []);\n for(let node of addedNodes) {\n this.setChildProperties(node as HTMLCuraAccordionItemElement);\n }\n }\n }\n }\n mutationObserver: MutationObserver = new MutationObserver(this.mutationObserverCallback);\n\n @State() styles = {};\n\n connectedCallback() {\n const weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);\n this.styles['--neutral-lighter'] = window.CuraAPI.theme.colors.getColor(`neutral-lighter`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-regular'] = weights.regular;\n this.setColors();\n }\n\n componentDidLoad() {\n this.host.querySelectorAll('cura-accordion-item').forEach(item => {\n this.setChildProperties(item);\n });\n const options: MutationObserverInit = {childList: true, subtree: true, attributes: true}\n this.mutationObserver.observe(this.host, options)\n }\n\n disconnectedCallback() {\n this.mutationObserver.disconnect();\n }\n\n setChildProperties(item: HTMLCuraAccordionItemElement) {\n // Theme\n item.colorMode = this.colorMode;\n item.iconColor = this.iconColor || this.color;\n item.iconActiveColor = this.iconActiveColor || this.activeColor;\n // Icon\n item.iconSize = this.iconSize;\n item.openIcon = this.openIcon;\n item.closeIcon = this.closeIcon;\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`),\n '--color-active-lighter': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-lighter`),\n '--color-active-light': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-light`),\n '--color-active-base': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-base`),\n '--color-active-dark': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-dark`),\n\n '--icon-color-lighter': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-lighter`),\n '--icon-color-light': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-light`),\n '--icon-color-base': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-base`),\n '--icon-color-dark': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-dark`),\n '--icon-color-active-lighter': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-lighter`),\n '--icon-color-active-light': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-light`),\n '--icon-color-active-base': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-base`),\n '--icon-color-active-dark': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-dark`),\n };\n }\n\n render() {\n return (\n <Host style={this.styles}>\n <slot name='accordion-item'></slot>\n </Host>\n );\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-accordion.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion/cura-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,aAAa;;QA4CxB,6BAAwB,GAAG,CAAC,SAA2B,EAAE,CAAmB,EAAE,EAAE;;YAC9E,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACjC,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,KAAI,MAAA,QAAQ,CAAC,MAAM,0CAAG,QAAQ,CAAC,CAAA,EAAE,CAAC;oBACzG,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;wBAAE,SAAS;oBAC1C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;wBAC/D,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;4BAC5B,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-accordion',\n styleUrl: 'cura-accordion.scss',\n shadow: true,\n})\nexport class CuraAccordion {\n\n @Element() host: HTMLElement;\n\n /**\n * Color scheme base color\n */\n @Prop({reflect: true}) color = 'primary';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n\n /**\n * Set the color mode to dark or light\n */\n @Prop({reflect: true}) colorMode: 'dark' | 'light' = 'dark';\n\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 * Accordion behavior when item is clicked\n * (The default will close all items except the current one)\n */\n @Prop({reflect: true}) behavior: 'default' | 'keep-open' = 'default';\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 mutationObserverCallback = (mutations: MutationRecord[], _: MutationObserver) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'opened' && mutation.target?.['opened']) {\n if (this.behavior !== 'default') continue;\n this.host.querySelectorAll('cura-accordion-item').forEach(item => {\n if (item != mutation.target) {\n item.opened = false;\n }\n });\n }\n if (mutation.type === 'childList') {\n const addedNodes = Array.from(mutation.addedNodes || []);\n for(let node of addedNodes) {\n this.setChildProperties(node as HTMLCuraAccordionItemElement);\n }\n }\n }\n }\n mutationObserver: MutationObserver = new MutationObserver(this.mutationObserverCallback);\n\n @State() styles = {};\n\n connectedCallback() {\n const weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-regular'] = weights.regular;\n this.setColors();\n }\n\n componentDidLoad() {\n this.host.querySelectorAll('cura-accordion-item').forEach(item => {\n this.setChildProperties(item);\n });\n const options: MutationObserverInit = {childList: true, subtree: true, attributes: true}\n this.mutationObserver.observe(this.host, options)\n }\n\n disconnectedCallback() {\n this.mutationObserver.disconnect();\n }\n\n setChildProperties(item: HTMLCuraAccordionItemElement) {\n // Theme\n item.colorMode = this.colorMode;\n item.iconColor = this.iconColor || this.color;\n // Icon\n item.iconSize = this.iconSize;\n if (this.labelIcon) item.labelIcon = this.labelIcon; // It's possible to define a specific icon for each item.\n item.openIcon = this.openIcon;\n item.closeIcon = this.closeIcon;\n // Level\n item.level = this.level;\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n \"--acc-color\": window.CuraAPI.theme.colors.getColor(\"neutral-black\"),\n \"--acc-color-hover\": window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n \"--acc-color-icon\": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-base`),\n \"--acc-color-icon-hover\": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-darker`),\n \"--acc-color-inverted\": window.CuraAPI.theme.colors.getColor(\"neutral-white\"),\n \"--acc-color-hover-inverted\": window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n \"--acc-color-icon-inverted\": window.CuraAPI.theme.colors.getColor(\"neutral-white\"),\n \"--acc-color-icon-hover-inverted\": window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-lighter`),\n };\n }\n\n render() {\n return (\n <Host style={this.styles}>\n <slot name='accordion-item'></slot>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -20,26 +20,26 @@ export default {
|
|
|
20
20
|
// return `<div>${label}</div>`;
|
|
21
21
|
return `<cura-accordion
|
|
22
22
|
color="${args.color}"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
open-icon="${args.openIcon}"
|
|
26
|
-
close-icon="${args.closeIcon}"
|
|
27
|
-
icon-size="${args.iconSize}"
|
|
28
|
-
icon-color="${args.iconColor}"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
style="${args.darkBackground ? 'background-color:
|
|
23
|
+
color-mode="${args.colorMode}" ${args.labelIcon ? `
|
|
24
|
+
label-icon="${args.labelIcon}"` : ''} ${args.openIcon ? `
|
|
25
|
+
open-icon="${args.openIcon}"` : ''} ${args.closeIcon ? `
|
|
26
|
+
close-icon="${args.closeIcon}"` : ''}
|
|
27
|
+
icon-size="${args.iconSize}" ${args.iconColor ? `
|
|
28
|
+
icon-color="${args.iconColor}"` : ''}
|
|
29
|
+
behavior="${args.behavior}" ${args.level ? `
|
|
30
|
+
level="${args.level}"` : ''}
|
|
31
|
+
style="${args.darkBackground ? 'background-color: black; padding: 10px' : 'padding: 10px'}"
|
|
32
32
|
>
|
|
33
|
-
<cura-accordion-item label="
|
|
33
|
+
<cura-accordion-item label="${args.label} 1" ${args.labelIconItem ? `label-icon="${args.labelIconItem}"` : ''}>
|
|
34
34
|
Texto 1
|
|
35
35
|
</cura-accordion-item>
|
|
36
|
-
<cura-accordion-item label="
|
|
36
|
+
<cura-accordion-item label="Label 2">
|
|
37
37
|
Texto 2
|
|
38
38
|
</cura-accordion-item>
|
|
39
|
-
<cura-accordion-item label="
|
|
39
|
+
<cura-accordion-item label="Label 3">
|
|
40
40
|
Texto 3
|
|
41
41
|
</cura-accordion-item>
|
|
42
|
-
<cura-accordion-item label="
|
|
42
|
+
<cura-accordion-item label="Label 4">
|
|
43
43
|
Texto 4
|
|
44
44
|
</cura-accordion-item>
|
|
45
45
|
</cura-accordion>`;
|
|
@@ -55,16 +55,6 @@ export default {
|
|
|
55
55
|
},
|
|
56
56
|
name: 'color'
|
|
57
57
|
},
|
|
58
|
-
activeColor: {
|
|
59
|
-
control: { type: 'select' },
|
|
60
|
-
options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
|
|
61
|
-
description: 'Define cor base do item ativo. Cor do DS sem profundidade (ex: accent).',
|
|
62
|
-
table: {
|
|
63
|
-
category: 'Properties',
|
|
64
|
-
defaultValue: { summary: 'accent' }
|
|
65
|
-
},
|
|
66
|
-
name: 'active-color'
|
|
67
|
-
},
|
|
68
58
|
colorMode: {
|
|
69
59
|
control: { type: 'inline-radio' },
|
|
70
60
|
options: ['dark', 'light'],
|
|
@@ -85,6 +75,23 @@ export default {
|
|
|
85
75
|
},
|
|
86
76
|
name: 'behavior'
|
|
87
77
|
},
|
|
78
|
+
level: {
|
|
79
|
+
control: { type: 'number', min: 1, max: 6, step: 1 },
|
|
80
|
+
description: 'Define a tag semântica da label. Ex. h1, h2, h3, etc.',
|
|
81
|
+
table: {
|
|
82
|
+
category: 'Properties',
|
|
83
|
+
defaultValue: { summary: 3 }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
labelIcon: {
|
|
87
|
+
control: { type: 'select' },
|
|
88
|
+
options: ['', ...iconNames],
|
|
89
|
+
description: 'Ícone da label. (É possivel adicionar este atributo diretamente em um "cura-accordion-item")',
|
|
90
|
+
table: {
|
|
91
|
+
category: 'Icons'
|
|
92
|
+
},
|
|
93
|
+
name: 'label-icon'
|
|
94
|
+
},
|
|
88
95
|
openIcon: {
|
|
89
96
|
control: { type: 'select' },
|
|
90
97
|
options: iconNames,
|
|
@@ -111,7 +118,7 @@ export default {
|
|
|
111
118
|
description: 'Tamanho do ícone.',
|
|
112
119
|
table: {
|
|
113
120
|
category: 'Icons',
|
|
114
|
-
defaultValue: { summary: '
|
|
121
|
+
defaultValue: { summary: '20' }
|
|
115
122
|
},
|
|
116
123
|
name: 'icon-size'
|
|
117
124
|
},
|
|
@@ -124,15 +131,6 @@ export default {
|
|
|
124
131
|
},
|
|
125
132
|
name: 'icon-color'
|
|
126
133
|
},
|
|
127
|
-
iconActiveColor: {
|
|
128
|
-
control: { type: 'select' },
|
|
129
|
-
options: ['', 'primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
|
|
130
|
-
description: 'Cor do ícone ativo. (Por padrão ele utiliza a mesma cor da propriedade \'active-color\').',
|
|
131
|
-
table: {
|
|
132
|
-
category: 'Icons',
|
|
133
|
-
},
|
|
134
|
-
name: 'icon-active-color'
|
|
135
|
-
},
|
|
136
134
|
darkBackground: {
|
|
137
135
|
control: 'boolean',
|
|
138
136
|
description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em temas escuros de background',
|
|
@@ -141,20 +139,40 @@ export default {
|
|
|
141
139
|
defaultValue: { summary: 'false' }
|
|
142
140
|
}
|
|
143
141
|
},
|
|
142
|
+
label: {
|
|
143
|
+
control: 'text',
|
|
144
|
+
description: 'Label do item.',
|
|
145
|
+
table: {
|
|
146
|
+
category: 'Accordion Item 1'
|
|
147
|
+
},
|
|
148
|
+
name: 'label'
|
|
149
|
+
},
|
|
150
|
+
labelIconItem: {
|
|
151
|
+
control: { type: 'select' },
|
|
152
|
+
options: ['', ...iconNames],
|
|
153
|
+
description: 'Ícone da label do item.',
|
|
154
|
+
table: {
|
|
155
|
+
category: 'Accordion Item 1'
|
|
156
|
+
},
|
|
157
|
+
name: 'label-icon'
|
|
158
|
+
},
|
|
144
159
|
},
|
|
145
160
|
};
|
|
146
161
|
export const Accordion = {
|
|
147
162
|
args: {
|
|
148
163
|
color: 'primary',
|
|
149
|
-
activeColor: 'accent',
|
|
150
164
|
colorMode: 'dark',
|
|
165
|
+
labelIcon: '',
|
|
151
166
|
openIcon: 'down',
|
|
152
167
|
closeIcon: 'up',
|
|
153
|
-
iconSize: '
|
|
168
|
+
iconSize: '20',
|
|
154
169
|
iconColor: "",
|
|
155
|
-
iconActiveColor: "",
|
|
156
170
|
behavior: 'default',
|
|
171
|
+
level: '',
|
|
157
172
|
darkBackground: false,
|
|
173
|
+
// Accordion Item
|
|
174
|
+
label: "Label do item",
|
|
175
|
+
labelIconItem: "",
|
|
158
176
|
},
|
|
159
177
|
};
|
|
160
178
|
//# sourceMappingURL=cura-accordion.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-accordion.stories.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion/cura-accordion.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,iCAAiC;IACxC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,mFAAmF;QACnF,gCAAgC;QAChC,OAAO;aACE,IAAI,CAAC,KAAK;
|
|
1
|
+
{"version":3,"file":"cura-accordion.stories.js","sourceRoot":"","sources":["../../../../src/components/accordion/cura-accordion/cura-accordion.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,iCAAiC;IACxC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,mFAAmF;QACnF,gCAAgC;QAChC,OAAO;aACE,IAAI,CAAC,KAAK;kBACL,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;kBACpC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC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B;aAC7B;YACD,IAAI,EAAE,YAAY;SACnB;KAEF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,KAAK;QAErB,iBAAiB;QACjB,KAAK,EAAE,eAAe;QACtB,aAAa,EAAE,EAAE;KAClB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nexport default {\n title: 'Componentes/Accordion/Accordion',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n // You can either use a function to create DOM elements or use a plain html string!\n // return `<div>${label}</div>`;\n return `<cura-accordion\n color=\"${args.color}\"\n color-mode=\"${args.colorMode}\" ${args.labelIcon ? `\n label-icon=\"${args.labelIcon}\"` : ''} ${args.openIcon ? `\n open-icon=\"${args.openIcon}\"` : ''} ${args.closeIcon ? `\n close-icon=\"${args.closeIcon}\"` : ''}\n icon-size=\"${args.iconSize}\" ${args.iconColor ? `\n icon-color=\"${args.iconColor}\"` : ''}\n behavior=\"${args.behavior}\" ${args.level ? `\n level=\"${args.level}\"` : ''}\n style=\"${args.darkBackground ? 'background-color: black; padding: 10px' : 'padding: 10px'}\"\n >\n <cura-accordion-item label=\"${args.label} 1\" ${args.labelIconItem ? `label-icon=\"${args.labelIconItem}\"` : ''}>\n Texto 1\n </cura-accordion-item>\n <cura-accordion-item label=\"Label 2\">\n Texto 2\n </cura-accordion-item>\n <cura-accordion-item label=\"Label 3\">\n Texto 3\n </cura-accordion-item>\n <cura-accordion-item label=\"Label 4\">\n Texto 4\n </cura-accordion-item>\n </cura-accordion>`;\n },\n argTypes: {\n color: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Define cor base do item. Cor do DS sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'primary'}\n },\n name: 'color'\n },\n colorMode: {\n control: { type: 'inline-radio' },\n options: ['dark', 'light'],\n description: 'Seta tema claro ou escuro.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'dark'}\n },\n name: 'color-mode'\n },\n behavior: {\n control: { type: 'inline-radio' },\n options: ['default', 'keep-open'],\n description: 'Comportamento do accordion.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'default'}\n },\n name: 'behavior'\n },\n level: {\n control: { type: 'number', min: 1, max: 6, step: 1 },\n description: 'Define a tag semântica da label. Ex. h1, h2, h3, etc.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 3 }\n }\n },\n labelIcon: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Ícone da label. (É possivel adicionar este atributo diretamente em um \"cura-accordion-item\")',\n table: {\n category: 'Icons'\n },\n name: 'label-icon'\n },\n openIcon: {\n control: { type: 'select' },\n options: iconNames,\n description: 'Ícone para abrir o item.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'down'}\n },\n name: 'open-icon'\n },\n closeIcon: {\n control: { type: 'select' },\n options: iconNames,\n description: 'Ícone para fechar o item.',\n table: {\n category: 'Icons',\n defaultValue: { summary: 'up'}\n },\n name: 'close-icon'\n },\n iconSize: {\n control: { type: 'select' },\n options: [\"128\", \"72\", \"64\", \"48\", \"40\", \"32\", \"24\", \"20\", \"16\"],\n description: 'Tamanho do ícone.',\n table: {\n category: 'Icons',\n defaultValue: { summary: '20'}\n },\n name: 'icon-size'\n },\n iconColor: {\n control: { type: 'select' },\n options: ['', 'primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor do ícone. (Por padrão ele utiliza a mesma cor da propriedade \\'color\\').',\n table: {\n category: 'Icons',\n },\n name: 'icon-color'\n },\n\n darkBackground: {\n control: 'boolean',\n description: 'Não é uma propriedade do componente. Aplicado como estilo CSS diretamente para visualização em temas escuros de background',\n table: {\n category: 'CSS',\n defaultValue: { summary: 'false'}\n }\n },\n\n label: {\n control: 'text',\n description: 'Label do item.',\n table: {\n category: 'Accordion Item 1'\n },\n name: 'label'\n },\n labelIconItem: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Ícone da label do item.',\n table: {\n category: 'Accordion Item 1'\n },\n name: 'label-icon'\n },\n\n },\n};\n\nexport const Accordion = {\n args: {\n color: 'primary',\n colorMode: 'dark',\n labelIcon: '',\n openIcon: 'down',\n closeIcon: 'up',\n iconSize: '20',\n iconColor: \"\",\n behavior: 'default',\n level: '',\n darkBackground: false,\n\n // Accordion Item\n label: \"Label do item\",\n labelIconItem: \"\",\n },\n};\n"]}
|
|
@@ -23,50 +23,79 @@
|
|
|
23
23
|
* Responsive media for large and up.
|
|
24
24
|
* Use: @include large-up() { ... }
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Global Spacing Definitions.
|
|
28
|
+
* Required CSS Properties:
|
|
29
|
+
* --base-spacing
|
|
30
|
+
*/
|
|
31
|
+
/* None: 0px */
|
|
32
|
+
/* Tiny default: 4px */
|
|
33
|
+
/* Mini default: 8px */
|
|
34
|
+
/* XXXS default: 12px */
|
|
35
|
+
/* XXS default: 16px */
|
|
36
|
+
/* XS default: 20px */
|
|
37
|
+
/* S default: 20px */
|
|
38
|
+
/* M default: 32px */
|
|
39
|
+
/* L default: 40px */
|
|
40
|
+
/* XL default: 48px */
|
|
41
|
+
/* XXL default: 64px */
|
|
42
|
+
/* XXXL default: 72px */
|
|
43
|
+
/* Huge default: 96px */
|
|
26
44
|
:host {
|
|
27
45
|
display: block;
|
|
28
46
|
}
|
|
29
47
|
:host .accordion-item {
|
|
30
48
|
width: 100%;
|
|
31
49
|
}
|
|
32
|
-
:host .accordion-item
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
}
|
|
36
|
-
:host .accordion-item .label::before {
|
|
50
|
+
:host .accordion-item::after {
|
|
37
51
|
content: "";
|
|
38
52
|
display: block;
|
|
39
53
|
border-top: solid 1px var(--neutral-base);
|
|
40
54
|
width: 100%;
|
|
41
55
|
}
|
|
56
|
+
:host .accordion-item:hover:not(.active)::after {
|
|
57
|
+
content: "";
|
|
58
|
+
display: block;
|
|
59
|
+
border-top: solid 1px var(--acc-color-icon-hover);
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
:host .accordion-item .label {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
}
|
|
42
66
|
:host .accordion-item .label .label-container {
|
|
43
67
|
display: flex;
|
|
44
68
|
flex-grow: 1;
|
|
45
69
|
justify-content: space-between;
|
|
46
70
|
align-items: center;
|
|
47
|
-
gap: calc(var(--base-spacing) *
|
|
48
|
-
|
|
71
|
+
gap: calc(var(--base-spacing) * 3px);
|
|
72
|
+
padding: calc(var(--base-spacing) * 3px);
|
|
49
73
|
word-break: break-word;
|
|
50
74
|
cursor: pointer;
|
|
51
75
|
font-size: 1.14em;
|
|
52
76
|
font-weight: var(--font-weight-regular);
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
}
|
|
78
|
+
:host .accordion-item .label .label-container .label-content {
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: calc(var(--base-spacing) * 3px);
|
|
83
|
+
}
|
|
84
|
+
:host .accordion-item .label .label-container .label-content cura-icon {
|
|
85
|
+
--color: var(--acc-color) !important;
|
|
86
|
+
}
|
|
87
|
+
:host .accordion-item .label .label-container .label-content cura-heading {
|
|
88
|
+
--color-body: var(--acc-color) !important;
|
|
55
89
|
}
|
|
56
90
|
:host .accordion-item .label .label-container cura-icon {
|
|
91
|
+
--color: var(--acc-color-icon) !important;
|
|
57
92
|
margin-right: 4px;
|
|
58
93
|
}
|
|
59
|
-
:host .accordion-item .label .label-container:hover {
|
|
60
|
-
color: var(--color-
|
|
94
|
+
:host .accordion-item .label .label-container:hover cura-heading {
|
|
95
|
+
--color-body: var(--acc-color-hover) !important;
|
|
61
96
|
}
|
|
62
97
|
:host .accordion-item .label .label-container:hover cura-icon {
|
|
63
|
-
--color: var(--
|
|
64
|
-
}
|
|
65
|
-
:host .accordion-item .label .label-container:active {
|
|
66
|
-
color: var(--color-dark);
|
|
67
|
-
}
|
|
68
|
-
:host .accordion-item .label .label-container:active cura-icon {
|
|
69
|
-
--color: var(--icon-color-dark) !important;
|
|
98
|
+
--color: var(--acc-color-icon-hover) !important;
|
|
70
99
|
}
|
|
71
100
|
:host .accordion-item .content {
|
|
72
101
|
font-size: 1em;
|
|
@@ -75,59 +104,31 @@
|
|
|
75
104
|
transition: max-height 0.25s ease;
|
|
76
105
|
}
|
|
77
106
|
:host .accordion-item .content .content-wrapper {
|
|
78
|
-
padding: calc(var(--base-spacing) *
|
|
79
|
-
border-top: solid 1px var(--neutral-base);
|
|
107
|
+
padding: calc(var(--base-spacing) * 3px);
|
|
80
108
|
}
|
|
81
|
-
:host .accordion-item.active
|
|
82
|
-
|
|
109
|
+
:host .accordion-item.inverted:hover:not(.active)::after {
|
|
110
|
+
content: "";
|
|
111
|
+
display: block;
|
|
112
|
+
border-top: solid 1px var(--acc-color-icon-hover-inverted);
|
|
113
|
+
width: 100%;
|
|
83
114
|
}
|
|
84
|
-
:host .accordion-item.
|
|
85
|
-
color: var(--color-
|
|
115
|
+
:host .accordion-item.inverted .label .label-container cura-heading {
|
|
116
|
+
--color-body: var(--acc-color-inverted) !important;
|
|
86
117
|
}
|
|
87
|
-
:host .accordion-item.
|
|
88
|
-
--color: var(--
|
|
118
|
+
:host .accordion-item.inverted .label .label-container cura-icon {
|
|
119
|
+
--color: var(--acc-color-icon-inverted) !important;
|
|
89
120
|
}
|
|
90
|
-
:host .accordion-item.
|
|
91
|
-
color: var(--color-
|
|
121
|
+
:host .accordion-item.inverted .label .label-container:hover cura-heading {
|
|
122
|
+
--color-body: var(--acc-color-hover-inverted) !important;
|
|
92
123
|
}
|
|
93
|
-
:host .accordion-item.
|
|
94
|
-
--color: var(--
|
|
124
|
+
:host .accordion-item.inverted .label .label-container:hover cura-icon {
|
|
125
|
+
--color: var(--acc-color-icon-hover-inverted) !important;
|
|
95
126
|
}
|
|
96
127
|
:host .accordion-item.active .content {
|
|
97
128
|
max-height: 200vh;
|
|
98
129
|
overflow-y: auto;
|
|
99
130
|
transition: max-height 0.5s ease 0.14s;
|
|
100
131
|
}
|
|
101
|
-
:host .accordion-item.inverted .label .label-container {
|
|
102
|
-
color: var(--neutral-lighter);
|
|
103
|
-
}
|
|
104
|
-
:host .accordion-item.inverted .label .label-container:hover {
|
|
105
|
-
color: var(--color-lighter);
|
|
106
|
-
}
|
|
107
|
-
:host .accordion-item.inverted .label .label-container:hover cura-icon {
|
|
108
|
-
--color: var(--icon-color-lighter) !important;
|
|
109
|
-
}
|
|
110
|
-
:host .accordion-item.inverted .label .label-container:active {
|
|
111
|
-
color: var(--color-light);
|
|
112
|
-
}
|
|
113
|
-
:host .accordion-item.inverted .label .label-container:active cura-icon {
|
|
114
|
-
--color: var(--icon-color-light) !important;
|
|
115
|
-
}
|
|
116
|
-
:host .accordion-item.active.inverted .label .label-container {
|
|
117
|
-
color: var(--neutral-purewhite);
|
|
118
|
-
}
|
|
119
|
-
:host .accordion-item.active.inverted .label .label-container:hover {
|
|
120
|
-
color: var(--color-active-lighter);
|
|
121
|
-
}
|
|
122
|
-
:host .accordion-item.active.inverted .label .label-container:hover cura-icon {
|
|
123
|
-
--color: var(--icon-color-active-lighter) !important;
|
|
124
|
-
}
|
|
125
|
-
:host .accordion-item.active.inverted .label .label-container:active {
|
|
126
|
-
color: var(--color-active-light);
|
|
127
|
-
}
|
|
128
|
-
:host .accordion-item.active.inverted .label .label-container:active cura-icon {
|
|
129
|
-
--color: var(--icon-color-active-light) !important;
|
|
130
|
-
}
|
|
131
132
|
@media (min-width: 769px) and (max-width: 992px) {
|
|
132
133
|
:host .accordion-item .label .label-container {
|
|
133
134
|
font-size: 1.29em;
|