@rededor/cura 1.6.1-alpha.8 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/assets/icons/iconset-default-list.ts +1 -1
- package/dist/assets/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/assets/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/{app-globals-28c6f5c4.js → app-globals-6d5b51b6.js} +2 -2
- package/dist/cjs/{app-globals-28c6f5c4.js.map → app-globals-6d5b51b6.js.map} +1 -1
- package/dist/cjs/{cura-accordion_18.cjs.entry.js → cura-accordion_20.cjs.entry.js} +148 -8
- package/dist/cjs/cura-accordion_20.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-checkbox.cjs.entry.js +4 -3
- package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +3 -3
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +4 -3
- package/dist/cjs/cura-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +4 -4
- package/dist/cjs/cura-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-tabs-button.cjs.entry.js +106 -0
- package/dist/cjs/cura-tabs-button.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-tabs-transparent.cjs.entry.js +105 -0
- package/dist/cjs/cura-tabs-transparent.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-tabs.definitions-b8955ad4.js +12 -0
- package/dist/cjs/cura-tabs.definitions-b8955ad4.js.map +1 -0
- package/dist/cjs/{cura-theme-module-f1e4a309.js → cura-theme-module-09bb63a4.js} +32 -1
- package/dist/cjs/cura-theme-module-09bb63a4.js.map +1 -0
- package/dist/cjs/cura.cjs.js +3 -3
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/api/theme-presets/theme-perinatal-temporary.js +32 -0
- package/dist/collection/api/theme-presets/theme-perinatal-temporary.js.map +1 -0
- 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/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets-raw/icons/default/vaccine.svg +3 -0
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/cura-avatar/cura-avatar.js +34 -16
- package/dist/collection/components/cura-avatar/cura-avatar.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +1 -1
- package/dist/collection/components/cura-modal/cura-modal.js +2 -2
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.css +5 -7
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +31 -6
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js.map +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.css +8 -11
- package/dist/collection/components/forms/cura-radio/cura-radio.js +31 -6
- package/dist/collection/components/forms/cura-radio/cura-radio.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.css +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +22 -3
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +12 -0
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.css +1 -4
- package/dist/collection/components/forms/cura-switch/cura-switch.js +31 -7
- package/dist/collection/components/forms/cura-switch/cura-switch.js.map +1 -1
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.css +170 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.js +263 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js +89 -0
- package/dist/collection/components/tabs/cura-tabs/cura-tabs.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.css +176 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js +259 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js +96 -0
- package/dist/collection/components/tabs/cura-tabs-button/cura-tabs-button.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.css +25 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js +133 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js +65 -0
- package/dist/collection/components/tabs/cura-tabs-group/cura-tabs-group.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.css +168 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js +258 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js +89 -0
- package/dist/collection/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.js.map +1 -0
- package/dist/collection/components/tabs/cura-tabs.definitions.js +7 -0
- package/dist/collection/components/tabs/cura-tabs.definitions.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-avatar.js.map +1 -1
- package/dist/components/cura-checkbox.js +6 -4
- package/dist/components/cura-checkbox.js.map +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-modal.js +3 -3
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +6 -4
- package/dist/components/cura-radio.js.map +1 -1
- package/dist/components/cura-select2.js +6 -4
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-switch.js +6 -5
- package/dist/components/cura-switch.js.map +1 -1
- package/dist/components/cura-tabs-button.d.ts +11 -0
- package/dist/components/cura-tabs-button.js +150 -0
- package/dist/components/cura-tabs-button.js.map +1 -0
- package/dist/components/cura-tabs-group.d.ts +11 -0
- package/dist/components/cura-tabs-group.js +64 -0
- package/dist/components/cura-tabs-group.js.map +1 -0
- package/dist/components/cura-tabs-transparent.d.ts +11 -0
- package/dist/components/cura-tabs-transparent.js +143 -0
- package/dist/components/cura-tabs-transparent.js.map +1 -0
- package/dist/components/cura-tabs.d.ts +11 -0
- package/dist/components/cura-tabs.definitions.js +10 -0
- package/dist/components/cura-tabs.definitions.js.map +1 -0
- package/dist/components/cura-tabs.js +148 -0
- package/dist/components/cura-tabs.js.map +1 -0
- package/dist/components/index.js +39 -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/index.esm.js +1 -1
- package/dist/cura/p-0ccde0ff.entry.js +2 -0
- package/dist/cura/p-0ccde0ff.entry.js.map +1 -0
- package/dist/cura/p-1ef21ae9.entry.js +2 -0
- package/dist/cura/p-1ef21ae9.entry.js.map +1 -0
- package/dist/cura/p-53c18ed4.js +2 -0
- package/dist/cura/p-53c18ed4.js.map +1 -0
- package/dist/cura/p-5c6f9593.entry.js +2 -0
- package/dist/cura/p-5c6f9593.entry.js.map +1 -0
- package/dist/cura/{p-0c25333f.js → p-6cbd49dd.js} +2 -2
- package/dist/cura/p-7a68835f.entry.js +2 -0
- package/dist/cura/p-7a68835f.entry.js.map +1 -0
- package/dist/cura/p-7e2d1229.entry.js +2 -0
- package/dist/cura/p-7e2d1229.entry.js.map +1 -0
- package/dist/cura/{p-ac01bec2.entry.js → p-8aade007.entry.js} +2 -2
- package/dist/cura/p-9f460031.js +2 -0
- package/dist/cura/p-9f460031.js.map +1 -0
- package/dist/cura/p-b4ee956b.entry.js +2 -0
- package/dist/cura/p-b4ee956b.entry.js.map +1 -0
- package/dist/cura/p-b6ff8ac1.entry.js +2 -0
- package/dist/cura/p-b6ff8ac1.entry.js.map +1 -0
- package/dist/cura/p-d8e1e182.entry.js +2 -0
- package/dist/cura/p-d8e1e182.entry.js.map +1 -0
- package/dist/esm/{app-globals-ca1945d1.js → app-globals-c2abb41c.js} +2 -2
- package/dist/esm/{app-globals-ca1945d1.js.map → app-globals-c2abb41c.js.map} +1 -1
- package/dist/esm/{cura-accordion_18.entry.js → cura-accordion_20.entry.js} +147 -9
- package/dist/esm/cura-accordion_20.entry.js.map +1 -0
- package/dist/esm/cura-checkbox.entry.js +4 -3
- package/dist/esm/cura-checkbox.entry.js.map +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-icons-view.entry.js +1 -1
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-modal.entry.js +3 -3
- package/dist/esm/cura-modal.entry.js.map +1 -1
- package/dist/esm/cura-radio.entry.js +4 -3
- package/dist/esm/cura-radio.entry.js.map +1 -1
- package/dist/esm/cura-switch.entry.js +4 -4
- package/dist/esm/cura-switch.entry.js.map +1 -1
- package/dist/esm/cura-tabs-button.entry.js +102 -0
- package/dist/esm/cura-tabs-button.entry.js.map +1 -0
- package/dist/esm/cura-tabs-transparent.entry.js +101 -0
- package/dist/esm/cura-tabs-transparent.entry.js.map +1 -0
- package/dist/esm/cura-tabs.definitions-a017126e.js +10 -0
- package/dist/esm/cura-tabs.definitions-a017126e.js.map +1 -0
- package/dist/esm/{cura-theme-module-0fa5ee0b.js → cura-theme-module-bf286f68.js} +32 -1
- package/dist/esm/cura-theme-module-bf286f68.js.map +1 -0
- package/dist/esm/cura.js +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/api/theme-presets/theme-perinatal-temporary.d.ts +43 -0
- package/dist/types/api/theme-presets/theme-presets.d.ts +43 -0
- package/dist/types/components/cura-avatar/cura-avatar.d.ts +37 -0
- package/dist/types/components/forms/cura-checkbox/cura-checkbox.d.ts +17 -4
- package/dist/types/components/forms/cura-radio/cura-radio.d.ts +17 -4
- package/dist/types/components/forms/cura-select/cura-select.d.ts +6 -0
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +11 -0
- package/dist/types/components/forms/cura-switch/cura-switch.d.ts +16 -3
- package/dist/types/components/tabs/cura-tabs/cura-tabs.d.ts +30 -0
- package/dist/types/components/tabs/cura-tabs/cura-tabs.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.d.ts +29 -0
- package/dist/types/components/tabs/cura-tabs-button/cura-tabs-button.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.d.ts +18 -0
- package/dist/types/components/tabs/cura-tabs-group/cura-tabs-group.stories.d.ts +57 -0
- package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.d.ts +29 -0
- package/dist/types/components/tabs/cura-tabs-transparent/cura-tabs-transparent.stories.d.ts +99 -0
- package/dist/types/components/tabs/cura-tabs.definitions.d.ts +6 -0
- package/dist/types/components.d.ts +298 -24
- package/package.json +2 -2
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-theme-module-f1e4a309.js.map +0 -1
- package/dist/cura/p-03feed94.entry.js +0 -2
- package/dist/cura/p-03feed94.entry.js.map +0 -1
- package/dist/cura/p-07817634.entry.js +0 -2
- package/dist/cura/p-07817634.entry.js.map +0 -1
- package/dist/cura/p-84c18273.entry.js +0 -2
- package/dist/cura/p-84c18273.entry.js.map +0 -1
- package/dist/cura/p-9fce5ec5.entry.js +0 -2
- package/dist/cura/p-9fce5ec5.entry.js.map +0 -1
- package/dist/cura/p-b84924e1.entry.js +0 -2
- package/dist/cura/p-b84924e1.entry.js.map +0 -1
- package/dist/cura/p-b856b946.entry.js +0 -2
- package/dist/cura/p-b856b946.entry.js.map +0 -1
- package/dist/cura/p-bf8e2037.js +0 -2
- package/dist/cura/p-bf8e2037.js.map +0 -1
- package/dist/esm/cura-accordion_18.entry.js.map +0 -1
- package/dist/esm/cura-theme-module-0fa5ee0b.js.map +0 -1
- /package/dist/cura/{p-0c25333f.js.map → p-6cbd49dd.js.map} +0 -0
- /package/dist/cura/{p-ac01bec2.entry.js.map → p-8aade007.entry.js.map} +0 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { labelSizes } from "../cura-tabs.definitions";
|
|
3
|
+
export class CuraTabs {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.name = undefined;
|
|
6
|
+
this.iconName = undefined;
|
|
7
|
+
this.selected = false;
|
|
8
|
+
this.disabled = false;
|
|
9
|
+
this.borderBottom = true;
|
|
10
|
+
this.size = 'large';
|
|
11
|
+
this.colorMode = 'light';
|
|
12
|
+
this.hovered = false;
|
|
13
|
+
this.styles = {};
|
|
14
|
+
}
|
|
15
|
+
setColors() {
|
|
16
|
+
const colors = [
|
|
17
|
+
{ name: '--background-color-selected', theme: this.colorMode === 'light' ? 'primary-base' : 'primary-lighter' },
|
|
18
|
+
{ name: '--background-color-hover', theme: this.colorMode === 'light' ? 'primary-lighter' : null },
|
|
19
|
+
{
|
|
20
|
+
name: '--background-disabled-selected',
|
|
21
|
+
theme: this.colorMode === 'light' ? 'neutral-pale' : 'neutral-black',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: '--border-bottom-color',
|
|
25
|
+
theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
colors.forEach(c => {
|
|
29
|
+
if (c.theme)
|
|
30
|
+
this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);
|
|
31
|
+
});
|
|
32
|
+
this.styles = Object.assign({}, this.styles);
|
|
33
|
+
}
|
|
34
|
+
computeContentColor() {
|
|
35
|
+
if (this.disabled)
|
|
36
|
+
return 'neutral-dark';
|
|
37
|
+
if (this.colorMode === 'dark') {
|
|
38
|
+
if (this.hovered && !this.selected) {
|
|
39
|
+
return 'neutral-purewhite';
|
|
40
|
+
}
|
|
41
|
+
return this.selected ? 'neutral-black' : 'primary-lighter';
|
|
42
|
+
}
|
|
43
|
+
return this.selected ? 'neutral-purewhite' : 'primary-dark';
|
|
44
|
+
}
|
|
45
|
+
updateDynamicStyles() {
|
|
46
|
+
if (this.colorMode === 'dark' && this.hovered && !this.selected) {
|
|
47
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--border-bottom-color': window.CuraAPI.theme.colors.getColor('neutral-purewhite') });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
getIcon() {
|
|
51
|
+
if (!this.iconName)
|
|
52
|
+
return '';
|
|
53
|
+
const iconSize = this.size === 'large' ? 20 : 16;
|
|
54
|
+
const iconColor = this.computeContentColor();
|
|
55
|
+
return h("cura-icon", { name: this.iconName, size: iconSize, color: iconColor });
|
|
56
|
+
}
|
|
57
|
+
getClasses() {
|
|
58
|
+
return {
|
|
59
|
+
[this.size]: true,
|
|
60
|
+
[this.colorMode]: true,
|
|
61
|
+
'selected': this.selected,
|
|
62
|
+
'disabled': this.disabled,
|
|
63
|
+
'border-bottom': this.borderBottom,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'), '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'), '--base-spacing': window.CuraAPI.theme.spacing.getSpacing() });
|
|
68
|
+
this.setColors();
|
|
69
|
+
}
|
|
70
|
+
handleMouseEnter() {
|
|
71
|
+
if (this.disabled)
|
|
72
|
+
return;
|
|
73
|
+
this.hovered = true;
|
|
74
|
+
}
|
|
75
|
+
handleMouseLeave() {
|
|
76
|
+
this.hovered = false;
|
|
77
|
+
}
|
|
78
|
+
handleClick(e) {
|
|
79
|
+
if (this.disabled) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.selected = !this.selected;
|
|
84
|
+
this.tabSelect.emit({ name: this.name });
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
const labelSize = labelSizes[this.size] || labelSizes['default'];
|
|
88
|
+
const labelColor = this.computeContentColor();
|
|
89
|
+
this.updateDynamicStyles();
|
|
90
|
+
return (h(Host, { key: '3966968b73a9a51ec26f3206cdb09fbfcb3d3daf', role: "button", "aria-pressed": this.selected, "aria-disabled": this.disabled }, h("button", { key: '00cc6382c635a05c52fd74b3e02e968c2d94cacb', class: this.getClasses(), style: this.styles, onClick: e => this.handleClick(e), disabled: this.disabled, onMouseEnter: this.handleMouseEnter.bind(this), onMouseLeave: this.handleMouseLeave.bind(this) }, this.getIcon(), h("cura-label", { key: 'e193500f156c10cf0442e6f504e19d552c19f849', size: labelSize, color: labelColor, lineHeight: "0", marginBlock: "0" }, h("slot", { key: '8a0ac7c4b2ff4990093d13b4110e370616cf39f4' })))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "cura-tabs"; }
|
|
93
|
+
static get encapsulation() { return "shadow"; }
|
|
94
|
+
static get originalStyleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["cura-tabs.scss"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get styleUrls() {
|
|
100
|
+
return {
|
|
101
|
+
"$": ["cura-tabs.css"]
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get properties() {
|
|
105
|
+
return {
|
|
106
|
+
"name": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"attribute": "name",
|
|
121
|
+
"reflect": true
|
|
122
|
+
},
|
|
123
|
+
"iconName": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"mutable": false,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "string",
|
|
128
|
+
"resolved": "string",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": false,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": ""
|
|
136
|
+
},
|
|
137
|
+
"attribute": "icon-name",
|
|
138
|
+
"reflect": true
|
|
139
|
+
},
|
|
140
|
+
"selected": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"mutable": true,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "boolean",
|
|
145
|
+
"resolved": "boolean",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": false,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": ""
|
|
153
|
+
},
|
|
154
|
+
"attribute": "selected",
|
|
155
|
+
"reflect": true,
|
|
156
|
+
"defaultValue": "false"
|
|
157
|
+
},
|
|
158
|
+
"disabled": {
|
|
159
|
+
"type": "boolean",
|
|
160
|
+
"mutable": true,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "boolean",
|
|
163
|
+
"resolved": "boolean",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"attribute": "disabled",
|
|
173
|
+
"reflect": true,
|
|
174
|
+
"defaultValue": "false"
|
|
175
|
+
},
|
|
176
|
+
"borderBottom": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"mutable": true,
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "boolean",
|
|
181
|
+
"resolved": "boolean",
|
|
182
|
+
"references": {}
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"optional": false,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": ""
|
|
189
|
+
},
|
|
190
|
+
"attribute": "border-bottom",
|
|
191
|
+
"reflect": true,
|
|
192
|
+
"defaultValue": "true"
|
|
193
|
+
},
|
|
194
|
+
"size": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"mutable": false,
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "'small' | 'medium' | 'large'",
|
|
199
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
200
|
+
"references": {}
|
|
201
|
+
},
|
|
202
|
+
"required": false,
|
|
203
|
+
"optional": false,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": ""
|
|
207
|
+
},
|
|
208
|
+
"attribute": "size",
|
|
209
|
+
"reflect": true,
|
|
210
|
+
"defaultValue": "'large'"
|
|
211
|
+
},
|
|
212
|
+
"colorMode": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"mutable": true,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "'dark' | 'light'",
|
|
217
|
+
"resolved": "\"dark\" | \"light\"",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": ""
|
|
225
|
+
},
|
|
226
|
+
"attribute": "color-mode",
|
|
227
|
+
"reflect": true,
|
|
228
|
+
"defaultValue": "'light'"
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
static get states() {
|
|
233
|
+
return {
|
|
234
|
+
"hovered": {},
|
|
235
|
+
"styles": {}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
static get events() {
|
|
239
|
+
return [{
|
|
240
|
+
"method": "tabSelect",
|
|
241
|
+
"name": "tabSelect",
|
|
242
|
+
"bubbles": true,
|
|
243
|
+
"cancelable": true,
|
|
244
|
+
"composed": true,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": ""
|
|
248
|
+
},
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "{ name: string }",
|
|
251
|
+
"resolved": "{ name: string; }",
|
|
252
|
+
"references": {}
|
|
253
|
+
}
|
|
254
|
+
}];
|
|
255
|
+
}
|
|
256
|
+
static get watchers() {
|
|
257
|
+
return [{
|
|
258
|
+
"propName": "colorMode",
|
|
259
|
+
"methodName": "setColors"
|
|
260
|
+
}];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=cura-tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-tabs.js","sourceRoot":"","sources":["../../../../src/components/tabs/cura-tabs/cura-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAOtD,MAAM,OAAO,QAAQ;;;;wBAGyC,KAAK;wBACL,KAAK;4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AQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9C,YAAY,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAE7C,IAAI,CAAC,OAAO,EAAE;gBACf,mEAAY,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAC,GAAG,EAAC,WAAW,EAAC,GAAG;oBAC5E,8DAAa,CACF,CACN,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Prop, State, Watch } from '@stencil/core';\nimport { labelSizes } from '../cura-tabs.definitions';\n\n@Component({\n tag: 'cura-tabs',\n styleUrl: 'cura-tabs.scss',\n shadow: true,\n})\nexport class CuraTabs {\n @Prop({ reflect: true }) name: string;\n @Prop({ reflect: true }) iconName: string;\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n @Prop({ reflect: true, mutable: true }) borderBottom: boolean = true;\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'large';\n @Prop({ reflect: true, mutable: true }) colorMode: 'dark' | 'light' = 'light';\n\n @State() hovered = false;\n @State() styles: Record<string, string> = {};\n\n @Event() tabSelect: EventEmitter<{ name: string }>;\n\n @Watch('colorMode')\n setColors() {\n const colors = [\n { name: '--background-color-selected', theme: this.colorMode === 'light' ? 'primary-base' : 'primary-lighter' },\n { name: '--background-color-hover', theme: this.colorMode === 'light' ? 'primary-lighter' : null },\n {\n name: '--background-disabled-selected',\n theme: this.colorMode === 'light' ? 'neutral-pale' : 'neutral-black',\n },\n {\n name: '--border-bottom-color',\n theme: this.colorMode === 'light' ? 'neutral-base' : 'primary',\n },\n ];\n\n colors.forEach(c => {\n if (c.theme) this.styles[c.name] = window.CuraAPI.theme.colors.getColor(c.theme);\n });\n\n this.styles = { ...this.styles };\n }\n\n computeContentColor(): string {\n if (this.disabled) return 'neutral-dark';\n\n if (this.colorMode === 'dark') {\n if (this.hovered && !this.selected) {\n return 'neutral-purewhite';\n }\n return this.selected ? 'neutral-black' : 'primary-lighter';\n }\n\n return this.selected ? 'neutral-purewhite' : 'primary-dark';\n }\n\n private updateDynamicStyles() {\n if (this.colorMode === 'dark' && this.hovered && !this.selected) {\n this.styles = {\n ...this.styles,\n '--border-bottom-color': window.CuraAPI.theme.colors.getColor('neutral-purewhite'),\n };\n }\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'large' ? 20 : 16;\n const iconColor = this.computeContentColor();\n\n return <cura-icon name={this.iconName} size={iconSize} color={iconColor}></cura-icon>;\n }\n\n getClasses() {\n return {\n [this.size]: true,\n [this.colorMode]: true,\n 'selected': this.selected,\n 'disabled': this.disabled,\n 'border-bottom': this.borderBottom,\n };\n }\n\n connectedCallback() {\n this.styles = {\n ...this.styles,\n '--primary-dark': window.CuraAPI.theme.colors.getColor('primary-dark'),\n '--neutral-purewhite': window.CuraAPI.theme.colors.getColor('neutral-purewhite'),\n '--base-spacing': window.CuraAPI.theme.spacing.getSpacing(),\n };\n\n this.setColors();\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) {\n e.preventDefault();\n return;\n }\n\n this.selected = !this.selected;\n this.tabSelect.emit({ name: this.name });\n }\n\n render() {\n const labelSize = labelSizes[this.size] || labelSizes['default'];\n const labelColor = this.computeContentColor();\n this.updateDynamicStyles();\n\n return (\n <Host role=\"button\" aria-pressed={this.selected} aria-disabled={this.disabled}>\n <button\n class={this.getClasses()}\n style={this.styles}\n onClick={e => this.handleClick(e)}\n disabled={this.disabled}\n onMouseEnter={this.handleMouseEnter.bind(this)}\n onMouseLeave={this.handleMouseLeave.bind(this)}\n >\n {this.getIcon()}\n <cura-label size={labelSize} color={labelColor} lineHeight=\"0\" marginBlock=\"0\">\n <slot></slot>\n </cura-label>\n </button>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import iconNames from "../../../assets/icons/iconset-default-list";
|
|
14
|
+
const renderCuraTabs = (args) => `
|
|
15
|
+
<cura-tabs
|
|
16
|
+
name=${args.name}
|
|
17
|
+
icon-name=${args.iconName}
|
|
18
|
+
selected=${args.selected}
|
|
19
|
+
disabled=${args.disabled}
|
|
20
|
+
border-bottom=${args.borderBottom}
|
|
21
|
+
size=${args.size}
|
|
22
|
+
color-mode=${args.colorMode}
|
|
23
|
+
>
|
|
24
|
+
Label
|
|
25
|
+
</cura-tabs>
|
|
26
|
+
`;
|
|
27
|
+
export default {
|
|
28
|
+
title: 'Componentes/Tabs/Tabs',
|
|
29
|
+
tags: ['autodocs'],
|
|
30
|
+
render: (_a) => {
|
|
31
|
+
var args = __rest(_a, []);
|
|
32
|
+
return renderCuraTabs(args);
|
|
33
|
+
},
|
|
34
|
+
argTypes: {
|
|
35
|
+
name: {
|
|
36
|
+
control: 'text',
|
|
37
|
+
description: 'Define o identificador único do tabs. Obrigatório definir um "name" distinto para cada cura-tabs quando utilizado dentro de um tabs-group, garantindo o controle correto do estado e a seleção da aba ativa.',
|
|
38
|
+
table: {
|
|
39
|
+
category: 'Properties',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
iconName: {
|
|
43
|
+
control: { type: 'select' },
|
|
44
|
+
options: ['', ...iconNames],
|
|
45
|
+
description: 'Define o nome do ícone exibido do iconset.',
|
|
46
|
+
table: {
|
|
47
|
+
category: 'Properties',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
selected: { control: 'boolean', description: 'Define se a aba está selecionada.', table: { category: 'State', defaultValue: { summary: false } } },
|
|
51
|
+
disabled: { control: 'boolean', description: 'Define se a aba está desabilitada.', table: { category: 'State', defaultValue: { summary: false } } },
|
|
52
|
+
borderBottom: { control: 'boolean', description: 'Define se a borda inferior é exibida.', table: { category: 'Properties', defaultValue: { summary: 'true' } } },
|
|
53
|
+
size: {
|
|
54
|
+
control: 'select',
|
|
55
|
+
options: ['small', 'medium', 'large'],
|
|
56
|
+
description: 'Define o tamanho do elemento.',
|
|
57
|
+
table: {
|
|
58
|
+
category: 'Properties',
|
|
59
|
+
defaultValue: { summary: 'large' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
colorMode: {
|
|
63
|
+
control: { type: 'inline-radio' },
|
|
64
|
+
options: ['light', 'dark'],
|
|
65
|
+
description: 'Define a cor de tema.',
|
|
66
|
+
table: {
|
|
67
|
+
category: 'Properties',
|
|
68
|
+
defaultValue: { summary: 'light' },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
tabSelect: {
|
|
72
|
+
action: 'tabSelect',
|
|
73
|
+
description: 'Evento disparado ao clicar na aba. Retorna o "name" da aba.',
|
|
74
|
+
table: { category: 'Events' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const CuraTabs = {
|
|
79
|
+
args: {
|
|
80
|
+
name: 'tab1',
|
|
81
|
+
iconName: 'infoCircle',
|
|
82
|
+
selected: false,
|
|
83
|
+
disabled: false,
|
|
84
|
+
borderBottom: true,
|
|
85
|
+
size: 'large',
|
|
86
|
+
colorMode: 'light',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=cura-tabs.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-tabs.stories.js","sourceRoot":"","sources":["../../../../src/components/tabs/cura-tabs/cura-tabs.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,cAAc,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC;;aAEzB,IAAI,CAAC,IAAI;kBACJ,IAAI,CAAC,QAAQ;iBACd,IAAI,CAAC,QAAQ;iBACb,IAAI,CAAC,QAAQ;sBACR,IAAI,CAAC,YAAY;aAC1B,IAAI,CAAC,IAAI;mBACH,IAAI,CAAC,SAAS;;;;CAIhC,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QAChB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,WAAW,EACT,8MAA8M;YAChN,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;aACvB;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;YAC3B,WAAW,EAAE,4CAA4C;YACzD,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;aACvB;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AQ,EAAE,YAAY;QACtB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,OAAO;KACnB;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst renderCuraTabs = (args: any) => `\n <cura-tabs\n name=${args.name}\n icon-name=${args.iconName}\n selected=${args.selected}\n disabled=${args.disabled}\n border-bottom=${args.borderBottom}\n size=${args.size}\n color-mode=${args.colorMode}\n >\n Label\n </cura-tabs>\n`;\n\nexport default {\n title: 'Componentes/Tabs/Tabs',\n tags: ['autodocs'],\n render: ({ ...args }) => {\n return renderCuraTabs(args);\n },\n argTypes: {\n name: {\n control: 'text',\n description:\n 'Define o identificador único do tabs. Obrigatório definir um \"name\" distinto para cada cura-tabs quando utilizado dentro de um tabs-group, garantindo o controle correto do estado e a seleção da aba ativa.',\n table: {\n category: 'Properties',\n },\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Define o nome do ícone exibido do iconset.',\n table: {\n category: 'Properties',\n },\n },\n selected: { control: 'boolean', description: 'Define se a aba está selecionada.', table: { category: 'State', defaultValue: { summary: false } } },\n disabled: { control: 'boolean', description: 'Define se a aba está desabilitada.', table: { category: 'State', defaultValue: { summary: false } } },\n borderBottom: { control: 'boolean', description: 'Define se a borda inferior é exibida.', table: { category: 'Properties', defaultValue: { summary: 'true' } } },\n size: {\n control: 'select',\n options: ['small', 'medium', 'large'],\n description: 'Define o tamanho do elemento.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'large' },\n },\n },\n colorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Define a cor de tema.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n },\n tabSelect: {\n action: 'tabSelect',\n description: 'Evento disparado ao clicar na aba. Retorna o \"name\" da aba.',\n table: { category: 'Events' },\n },\n },\n};\n\nexport const CuraTabs = {\n args: {\n name: 'tab1',\n iconName: 'infoCircle',\n selected: false,\n disabled: false,\n borderBottom: true,\n size: 'large',\n colorMode: 'light',\n },\n};\n"]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Spacing Definitions.
|
|
3
|
+
* Required CSS Properties from Cura:
|
|
4
|
+
* --cura-spacing-base
|
|
5
|
+
*/
|
|
6
|
+
/* None: 0px */
|
|
7
|
+
/* Tiny default: 4px */
|
|
8
|
+
/* Mini default: 8px */
|
|
9
|
+
/* XXXS default: 12px */
|
|
10
|
+
/* XXS default: 16px */
|
|
11
|
+
/* XS default: 20px */
|
|
12
|
+
/* S default: 20px */
|
|
13
|
+
/* M default: 32px */
|
|
14
|
+
/* L default: 40px */
|
|
15
|
+
/* XL default: 48px */
|
|
16
|
+
/* XXL default: 64px */
|
|
17
|
+
/* XXXL default: 72px */
|
|
18
|
+
/* Huge default: 96px */
|
|
19
|
+
/**
|
|
20
|
+
* Global Button Definitions.
|
|
21
|
+
* Required CSS Properties:
|
|
22
|
+
* --font-size
|
|
23
|
+
* --base-spacing
|
|
24
|
+
* --font-family
|
|
25
|
+
* --font-weight-medium
|
|
26
|
+
* --text-align
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Spacing sass vars
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Global Spacing Definitions.
|
|
33
|
+
* Required CSS Properties from Cura:
|
|
34
|
+
* --cura-spacing-base
|
|
35
|
+
*/
|
|
36
|
+
/* None: 0px */
|
|
37
|
+
/* Tiny default: 4px */
|
|
38
|
+
/* Mini default: 8px */
|
|
39
|
+
/* XXXS default: 12px */
|
|
40
|
+
/* XXS default: 16px */
|
|
41
|
+
/* XS default: 20px */
|
|
42
|
+
/* S default: 20px */
|
|
43
|
+
/* M default: 32px */
|
|
44
|
+
/* L default: 40px */
|
|
45
|
+
/* XL default: 48px */
|
|
46
|
+
/* XXL default: 64px */
|
|
47
|
+
/* XXXL default: 72px */
|
|
48
|
+
/* Huge default: 96px */
|
|
49
|
+
/**
|
|
50
|
+
* Buttons Host element definitions.
|
|
51
|
+
* Use: @include button-host() { ... }
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Buttons base definitions.
|
|
55
|
+
* Use: @include button-element() { ... }
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Button sizes definitions.
|
|
59
|
+
* Use: @include button-sizes() { ... }
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Button container definitions.
|
|
63
|
+
* Use: @include button-container() { ... }
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* Button label definitions.
|
|
67
|
+
* Use: @include button-label() { ... }
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Button shadow definitions.
|
|
71
|
+
* Use: @include button-label() { ... }
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* Button disabled state definitions
|
|
75
|
+
* Use: @include button-disabled() { ... }
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Button selected state definitions
|
|
79
|
+
* Use: @include button-selected() { ... }
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Button loading state definitions
|
|
83
|
+
* Use: @include button-loading() { ... }
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Button icon definitions
|
|
87
|
+
* Use: @include button-icon() { ... }
|
|
88
|
+
*/
|
|
89
|
+
/**
|
|
90
|
+
* Button icon only behavior definitions
|
|
91
|
+
* Use: @include button-icon-only-behavior() { ... }
|
|
92
|
+
*/
|
|
93
|
+
:host button,
|
|
94
|
+
:host a {
|
|
95
|
+
outline: none;
|
|
96
|
+
box-shadow: none;
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
display: flex;
|
|
99
|
+
width: 100%;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
text-decoration: none !important;
|
|
103
|
+
font-size: var(--font-size);
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
transition: background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;
|
|
106
|
+
border-radius: var(--border-radius);
|
|
107
|
+
position: relative;
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
border: none;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
min-width: 120px;
|
|
115
|
+
width: fit-content;
|
|
116
|
+
border: 2px solid var(--border-color);
|
|
117
|
+
border-radius: 4px;
|
|
118
|
+
}
|
|
119
|
+
:host button:focus,
|
|
120
|
+
:host a:focus {
|
|
121
|
+
outline: 2px solid #6EA8FF;
|
|
122
|
+
}
|
|
123
|
+
:host button:not(.selected),
|
|
124
|
+
:host a:not(.selected) {
|
|
125
|
+
border: 2px solid var(--border-color);
|
|
126
|
+
}
|
|
127
|
+
:host button:not(.disabled, .selected):hover,
|
|
128
|
+
:host a:not(.disabled, .selected):hover {
|
|
129
|
+
background-color: var(--background-color-hover);
|
|
130
|
+
}
|
|
131
|
+
:host button:not(.disabled, .selected):hover.dark,
|
|
132
|
+
:host a:not(.disabled, .selected):hover.dark {
|
|
133
|
+
border-color: var(--neutral-purewhite);
|
|
134
|
+
}
|
|
135
|
+
:host button.small,
|
|
136
|
+
:host a.small {
|
|
137
|
+
padding: calc(var(--cura-spacing-base) * 2px) calc(var(--cura-spacing-base) * 2px);
|
|
138
|
+
}
|
|
139
|
+
:host button.medium,
|
|
140
|
+
:host a.medium {
|
|
141
|
+
padding: calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 3px);
|
|
142
|
+
}
|
|
143
|
+
:host button.large,
|
|
144
|
+
:host a.large {
|
|
145
|
+
padding: calc(var(--cura-spacing-base) * 3px) calc(var(--cura-spacing-base) * 4px);
|
|
146
|
+
}
|
|
147
|
+
:host button:focus,
|
|
148
|
+
:host a:focus {
|
|
149
|
+
border-color: var(--primary-light);
|
|
150
|
+
}
|
|
151
|
+
:host button cura-icon,
|
|
152
|
+
:host a cura-icon {
|
|
153
|
+
margin-right: calc(var(--cura-spacing-base) * 2px);
|
|
154
|
+
}
|
|
155
|
+
:host button cura-badge-counter,
|
|
156
|
+
:host a cura-badge-counter {
|
|
157
|
+
margin-left: calc(var(--cura-spacing-base) * 2px);
|
|
158
|
+
}
|
|
159
|
+
:host button.selected,
|
|
160
|
+
:host a.selected {
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
background-color: var(--background-color-selected);
|
|
163
|
+
}
|
|
164
|
+
:host button.selected.disabled,
|
|
165
|
+
:host a.selected.disabled {
|
|
166
|
+
border-color: transparent;
|
|
167
|
+
background-color: var(--background-disabled-selected);
|
|
168
|
+
}
|
|
169
|
+
:host button.disabled,
|
|
170
|
+
:host a.disabled {
|
|
171
|
+
cursor: not-allowed;
|
|
172
|
+
}
|
|
173
|
+
:host button.disabled:not(.selected),
|
|
174
|
+
:host a.disabled:not(.selected) {
|
|
175
|
+
border-color: var(--neutral-dark);
|
|
176
|
+
}
|