@rededor/cura 0.3.6 → 0.3.7
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-a41d7f40.js → app-globals-6c6fb457.js} +28 -65
- package/dist/cjs/app-globals-6c6fb457.js.map +1 -0
- package/dist/cjs/cura-button_9.cjs.entry.js +519 -0
- package/dist/cjs/cura-button_9.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/modules/cura-theme-colors-module.js +7 -2
- package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
- package/dist/collection/api/theme-presets/static.js +20 -62
- package/dist/collection/api/theme-presets/static.js.map +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/buttons/cura-button/cura-button.css +128 -125
- package/dist/collection/components/buttons/cura-button/cura-button.js +36 -33
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +220 -0
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +308 -0
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +204 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +308 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.css +33 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +77 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.js +3 -3
- package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +3 -3
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +3 -3
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
- package/dist/components/cura-button-outline.d.ts +11 -0
- package/dist/components/cura-button-outline.js +123 -0
- package/dist/components/cura-button-outline.js.map +1 -0
- package/dist/components/cura-button-transparent.d.ts +11 -0
- package/dist/components/cura-button-transparent.js +123 -0
- package/dist/components/cura-button-transparent.js.map +1 -0
- package/dist/components/cura-button.js +28 -18
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-display.js +3 -3
- package/dist/components/cura-display.js.map +1 -1
- package/dist/components/cura-heading.js +3 -3
- package/dist/components/cura-heading.js.map +1 -1
- package/dist/components/cura-loader-circle.d.ts +11 -0
- package/dist/components/cura-loader-circle.js +8 -0
- package/dist/components/cura-loader-circle.js.map +1 -0
- package/dist/components/cura-loader-circle2.js +51 -0
- package/dist/components/cura-loader-circle2.js.map +1 -0
- package/dist/components/cura-paragraph.js +3 -3
- package/dist/components/cura-paragraph.js.map +1 -1
- package/dist/components/index.js +33 -64
- 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/cura.js +1 -1
- package/dist/cura/p-17ac5c79.system.js +2 -0
- package/dist/cura/p-17ac5c79.system.js.map +1 -0
- package/dist/cura/p-25345c98.system.entry.js +2 -0
- package/dist/cura/p-25345c98.system.entry.js.map +1 -0
- package/dist/cura/p-bb730a40.entry.js +2 -0
- package/dist/cura/p-bb730a40.entry.js.map +1 -0
- package/dist/cura/p-c8bb96d1.system.js +2 -0
- package/dist/cura/p-c8bb96d1.system.js.map +1 -0
- package/dist/cura/p-efea6652.js +2 -0
- package/dist/cura/p-efea6652.js.map +1 -0
- package/dist/esm/{app-globals-8ed931e6.js → app-globals-7fe8416c.js} +28 -65
- package/dist/esm/app-globals-7fe8416c.js.map +1 -0
- package/dist/esm/cura-button_9.entry.js +507 -0
- package/dist/esm/cura-button_9.entry.js.map +1 -0
- package/dist/esm/cura.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm-es5/app-globals-7fe8416c.js +2 -0
- package/dist/esm-es5/app-globals-7fe8416c.js.map +1 -0
- package/dist/esm-es5/cura-button_9.entry.js +2 -0
- package/dist/esm-es5/cura-button_9.entry.js.map +1 -0
- package/dist/esm-es5/cura.js +1 -1
- package/dist/esm-es5/cura.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/types/api/theme-presets/static.d.ts +20 -40
- package/dist/types/components/buttons/cura-button/cura-button.d.ts +6 -4
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +61 -0
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +61 -0
- package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.d.ts +23 -0
- package/dist/types/components.d.ts +251 -4
- package/package.json +2 -2
- package/dist/cjs/app-globals-a41d7f40.js.map +0 -1
- package/dist/cjs/cura-button_6.cjs.entry.js +0 -336
- package/dist/cjs/cura-button_6.cjs.entry.js.map +0 -1
- package/dist/cura/p-36c8b693.system.js +0 -2
- package/dist/cura/p-36c8b693.system.js.map +0 -1
- package/dist/cura/p-4e3b7ddf.entry.js +0 -2
- package/dist/cura/p-4e3b7ddf.entry.js.map +0 -1
- package/dist/cura/p-4fc49972.system.js +0 -2
- package/dist/cura/p-4fc49972.system.js.map +0 -1
- package/dist/cura/p-8cd9f935.system.entry.js +0 -2
- package/dist/cura/p-8cd9f935.system.entry.js.map +0 -1
- package/dist/cura/p-bac0b4ab.js +0 -2
- package/dist/cura/p-bac0b4ab.js.map +0 -1
- package/dist/esm/app-globals-8ed931e6.js.map +0 -1
- package/dist/esm/cura-button_6.entry.js +0 -327
- package/dist/esm/cura-button_6.entry.js.map +0 -1
- package/dist/esm-es5/app-globals-8ed931e6.js +0 -2
- package/dist/esm-es5/app-globals-8ed931e6.js.map +0 -1
- package/dist/esm-es5/cura-button_6.entry.js +0 -2
- package/dist/esm-es5/cura-button_6.entry.js.map +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Button Definitions.
|
|
3
|
+
* Required CSS Properties:
|
|
4
|
+
* --font-size
|
|
5
|
+
* --base-spacing
|
|
6
|
+
* --font-family
|
|
7
|
+
* --font-weight-medium
|
|
8
|
+
* --text-align
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Buttons Host element definitions.
|
|
12
|
+
* Use: @include button-host() { ... }
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Buttons base definitions.
|
|
16
|
+
* Use: @include button-element() { ... }
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Button sizes definitions.
|
|
20
|
+
* Use: @include button-sizes() { ... }
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Button container definitions.
|
|
24
|
+
* Use: @include button-container() { ... }
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Button label definitions.
|
|
28
|
+
* Use: @include button-label() { ... }
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Button shadow definitions.
|
|
32
|
+
* Use: @include button-label() { ... }
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Button disabled state definitions
|
|
36
|
+
* Use: @include button-disabled() { ... }
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Button loading state definitions
|
|
40
|
+
* Use: @include button-loading() { ... }
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Button icon definitions
|
|
44
|
+
* Use: @include button-icon() { ... }
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Button icon only behavior definitions
|
|
48
|
+
* Use: @include button-icon-only-behavior() { ... }
|
|
49
|
+
*/
|
|
50
|
+
:host {
|
|
51
|
+
--border-radius: 4px;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
:host button, :host a {
|
|
56
|
+
outline: none;
|
|
57
|
+
box-shadow: none;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
display: flex;
|
|
60
|
+
width: 100%;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
text-decoration: none !important;
|
|
64
|
+
font-size: var(--font-size);
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
transition: background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;
|
|
67
|
+
border-radius: var(--border-radius);
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
border: none;
|
|
70
|
+
box-shadow: inset 0px 0px 0px 2px var(--color-base);
|
|
71
|
+
padding: calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);
|
|
72
|
+
min-height: calc(var(--base-spacing) * 13px);
|
|
73
|
+
min-width: calc(var(--base-spacing) * 13px);
|
|
74
|
+
}
|
|
75
|
+
:host button:not(.disabled):not(.isLoading):hover, :host a:not(.disabled):not(.isLoading):hover {
|
|
76
|
+
box-shadow: inset 0px 0px 0px 2px var(--color-light);
|
|
77
|
+
}
|
|
78
|
+
:host button:not(.disabled):not(.isLoading):hover .label, :host a:not(.disabled):not(.isLoading):hover .label {
|
|
79
|
+
color: var(--color-light);
|
|
80
|
+
}
|
|
81
|
+
:host button:not(.disabled):not(.isLoading):hover cura-icon, :host a:not(.disabled):not(.isLoading):hover cura-icon {
|
|
82
|
+
--color: var(--color-light) !important;
|
|
83
|
+
}
|
|
84
|
+
:host button:not(.disabled):not(.inverted):not(.isLoading):active, :host a:not(.disabled):not(.inverted):not(.isLoading):active {
|
|
85
|
+
box-shadow: inset 0px 0px 0px 2px var(--color-dark);
|
|
86
|
+
}
|
|
87
|
+
:host button:not(.disabled):not(.inverted):not(.isLoading):active .label, :host a:not(.disabled):not(.inverted):not(.isLoading):active .label {
|
|
88
|
+
color: var(--color-dark);
|
|
89
|
+
}
|
|
90
|
+
:host button:not(.disabled):not(.inverted):not(.isLoading):active cura-icon, :host a:not(.disabled):not(.inverted):not(.isLoading):active cura-icon {
|
|
91
|
+
--color: var(--color-dark) !important;
|
|
92
|
+
}
|
|
93
|
+
:host button.medium, :host a.medium {
|
|
94
|
+
padding: calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);
|
|
95
|
+
min-height: calc(var(--base-spacing) * 11px);
|
|
96
|
+
min-width: calc(var(--base-spacing) * 11px);
|
|
97
|
+
}
|
|
98
|
+
:host button.small, :host a.small {
|
|
99
|
+
padding: calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);
|
|
100
|
+
min-height: calc(var(--base-spacing) * 8px);
|
|
101
|
+
min-width: calc(var(--base-spacing) * 8px);
|
|
102
|
+
}
|
|
103
|
+
:host button .button-container, :host a .button-container {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
opacity: 1;
|
|
107
|
+
transition: opacity 0.2s linear;
|
|
108
|
+
}
|
|
109
|
+
:host button.icon-right .button-container, :host a.icon-right .button-container {
|
|
110
|
+
flex-direction: row-reverse;
|
|
111
|
+
}
|
|
112
|
+
:host button .label, :host a .label {
|
|
113
|
+
flex: 1;
|
|
114
|
+
font-family: var(--font-family);
|
|
115
|
+
font-weight: var(--font-weight-medium);
|
|
116
|
+
font-size: 1.43em;
|
|
117
|
+
line-height: 1.2em;
|
|
118
|
+
text-align: var(--text-align, "left");
|
|
119
|
+
color: var(--color-base);
|
|
120
|
+
}
|
|
121
|
+
:host button .label.inverted, :host a .label.inverted {
|
|
122
|
+
color: var(--neutral-white);
|
|
123
|
+
}
|
|
124
|
+
:host button.medium .label, :host a.medium .label {
|
|
125
|
+
font-size: 1.14em;
|
|
126
|
+
}
|
|
127
|
+
:host button.small .label, :host a.small .label {
|
|
128
|
+
font-size: 1em;
|
|
129
|
+
}
|
|
130
|
+
:host button.icon-left cura-icon, :host a.icon-left cura-icon {
|
|
131
|
+
margin-right: calc(var(--base-spacing) * 3px);
|
|
132
|
+
}
|
|
133
|
+
:host button.icon-right cura-icon, :host a.icon-right cura-icon {
|
|
134
|
+
margin-left: calc(var(--base-spacing) * 3px);
|
|
135
|
+
}
|
|
136
|
+
:host button.medium.icon-left cura-icon, :host a.medium.icon-left cura-icon {
|
|
137
|
+
margin-right: calc(var(--base-spacing) * 2.7px);
|
|
138
|
+
}
|
|
139
|
+
:host button.medium.icon-right cura-icon, :host a.medium.icon-right cura-icon {
|
|
140
|
+
margin-left: calc(var(--base-spacing) * 2.7px);
|
|
141
|
+
}
|
|
142
|
+
:host button.small.icon-left cura-icon, :host a.small.icon-left cura-icon {
|
|
143
|
+
margin-right: calc(var(--base-spacing) * 2.5px);
|
|
144
|
+
}
|
|
145
|
+
:host button.small.icon-right cura-icon, :host a.small.icon-right cura-icon {
|
|
146
|
+
margin-left: calc(var(--base-spacing) * 2.5px);
|
|
147
|
+
}
|
|
148
|
+
:host button.disabled, :host a.disabled {
|
|
149
|
+
cursor: not-allowed;
|
|
150
|
+
box-shadow: inset 0px 0px 0px 2px var(--neutral-base);
|
|
151
|
+
}
|
|
152
|
+
:host button.disabled .label, :host button.disabled .label.inverted, :host a.disabled .label, :host a.disabled .label.inverted {
|
|
153
|
+
color: var(--neutral-dark);
|
|
154
|
+
}
|
|
155
|
+
:host button.disabled.inverted, :host a.disabled.inverted {
|
|
156
|
+
opacity: 0.6;
|
|
157
|
+
box-shadow: inset 0px 0px 0px 2px var(--neutral-white);
|
|
158
|
+
}
|
|
159
|
+
:host button.disabled.inverted .label, :host button.disabled.inverted .label.inverted, :host a.disabled.inverted .label, :host a.disabled.inverted .label.inverted {
|
|
160
|
+
color: var(--neutral-white);
|
|
161
|
+
}
|
|
162
|
+
:host button.disabled.inverted cura-icon, :host a.disabled.inverted cura-icon {
|
|
163
|
+
--color: var(--neutral-white) !important;
|
|
164
|
+
}
|
|
165
|
+
:host button.disabled.inverted cura-loader-circle, :host a.disabled.inverted cura-loader-circle {
|
|
166
|
+
--color: var(--neutral-white) !important;
|
|
167
|
+
}
|
|
168
|
+
:host button.icon-only, :host a.icon-only {
|
|
169
|
+
padding: calc(var(--base-spacing) * 3.5px);
|
|
170
|
+
}
|
|
171
|
+
:host button.icon-only .label, :host a.icon-only .label {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
:host button.icon-only cura-icon, :host a.icon-only cura-icon {
|
|
175
|
+
margin-left: 0 !important;
|
|
176
|
+
margin-right: 0 !important;
|
|
177
|
+
}
|
|
178
|
+
:host button.icon-only.medium, :host a.icon-only.medium {
|
|
179
|
+
padding: calc(var(--base-spacing) * 2.75px);
|
|
180
|
+
}
|
|
181
|
+
:host button.icon-only.small, :host a.icon-only.small {
|
|
182
|
+
padding: calc(var(--base-spacing) * 1.5px);
|
|
183
|
+
}
|
|
184
|
+
:host button.inverted, :host a.inverted {
|
|
185
|
+
box-shadow: inset 0px 0px 0px 2px var(--neutral-white);
|
|
186
|
+
}
|
|
187
|
+
:host button.inverted:not(.disabled):not(.isLoading):hover, :host a.inverted:not(.disabled):not(.isLoading):hover {
|
|
188
|
+
box-shadow: inset 0px 0px 0px 2px var(--color-lighter);
|
|
189
|
+
}
|
|
190
|
+
:host button.inverted:not(.disabled):not(.isLoading):hover .label, :host a.inverted:not(.disabled):not(.isLoading):hover .label {
|
|
191
|
+
color: var(--color-lighter);
|
|
192
|
+
}
|
|
193
|
+
:host button.inverted:not(.disabled):not(.isLoading):hover cura-icon, :host a.inverted:not(.disabled):not(.isLoading):hover cura-icon {
|
|
194
|
+
--color: var(--color-lighter) !important;
|
|
195
|
+
}
|
|
196
|
+
:host button.inverted:not(.disabled):not(.isLoading):active, :host a.inverted:not(.disabled):not(.isLoading):active {
|
|
197
|
+
box-shadow: inset 0px 0px 0px 2px var(--color-light);
|
|
198
|
+
}
|
|
199
|
+
:host button.inverted:not(.disabled):not(.isLoading):active .label, :host a.inverted:not(.disabled):not(.isLoading):active .label {
|
|
200
|
+
color: var(--color-light);
|
|
201
|
+
}
|
|
202
|
+
:host button.inverted:not(.disabled):not(.isLoading):active cura-icon, :host a.inverted:not(.disabled):not(.isLoading):active cura-icon {
|
|
203
|
+
--color: var(--color-light) !important;
|
|
204
|
+
}
|
|
205
|
+
:host button cura-loader-circle, :host a cura-loader-circle {
|
|
206
|
+
position: absolute;
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
:host button.isLoading, :host a.isLoading {
|
|
210
|
+
cursor: wait;
|
|
211
|
+
}
|
|
212
|
+
:host button.isLoading .button-container, :host a.isLoading .button-container {
|
|
213
|
+
opacity: 0.3;
|
|
214
|
+
}
|
|
215
|
+
:host button.isLoading.icon-only .button-container, :host a.isLoading.icon-only .button-container {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
:host button.isLoading cura-loader-circle, :host a.isLoading cura-loader-circle {
|
|
219
|
+
display: block;
|
|
220
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class CuraButtonOutline {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.size = 'large';
|
|
5
|
+
this.disabled = false;
|
|
6
|
+
this.isLoading = false;
|
|
7
|
+
this.iconName = undefined;
|
|
8
|
+
this.iconset = 'default';
|
|
9
|
+
this.iconPosition = 'left';
|
|
10
|
+
this.iconOnly = undefined;
|
|
11
|
+
this.href = undefined;
|
|
12
|
+
this.target = "_self";
|
|
13
|
+
this.color = 'accent';
|
|
14
|
+
this.fontColor = 'dark';
|
|
15
|
+
this.textAlign = 'left';
|
|
16
|
+
this.styles = {};
|
|
17
|
+
}
|
|
18
|
+
handleChangeColor() {
|
|
19
|
+
this.setColors();
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
23
|
+
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
24
|
+
this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
|
|
25
|
+
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
26
|
+
this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
|
|
27
|
+
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
28
|
+
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
29
|
+
this.styles['--font-weight-medium'] = this.weights.medium;
|
|
30
|
+
this.styles['--text-align'] = this.textAlign;
|
|
31
|
+
this.setColors();
|
|
32
|
+
}
|
|
33
|
+
getClasses() {
|
|
34
|
+
const classes = {};
|
|
35
|
+
classes[`${this.size.toLowerCase()}`] = true;
|
|
36
|
+
classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
|
|
37
|
+
classes[`icon-only`] = this.iconOnly;
|
|
38
|
+
classes['inverted'] = this.fontColor === 'light';
|
|
39
|
+
classes['disabled'] = this.disabled;
|
|
40
|
+
classes['isLoading'] = this.isLoading;
|
|
41
|
+
return classes;
|
|
42
|
+
}
|
|
43
|
+
setColors() {
|
|
44
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`) });
|
|
45
|
+
}
|
|
46
|
+
getIcon() {
|
|
47
|
+
if (!this.iconName)
|
|
48
|
+
return '';
|
|
49
|
+
const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
|
|
50
|
+
const color = this.getSymbolColor();
|
|
51
|
+
return h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: color });
|
|
52
|
+
}
|
|
53
|
+
getSymbolColor() {
|
|
54
|
+
return this.disabled
|
|
55
|
+
? 'neutral-dark'
|
|
56
|
+
: this.fontColor === 'light'
|
|
57
|
+
? 'neutral-white'
|
|
58
|
+
: `${this.color}-base`;
|
|
59
|
+
}
|
|
60
|
+
handleClick(e) {
|
|
61
|
+
if (this.disabled || this.isLoading)
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return (h(Host, null, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
|
|
66
|
+
}
|
|
67
|
+
static get is() { return "cura-button-outline"; }
|
|
68
|
+
static get encapsulation() { return "shadow"; }
|
|
69
|
+
static get originalStyleUrls() {
|
|
70
|
+
return {
|
|
71
|
+
"$": ["cura-button-outline.scss"]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static get styleUrls() {
|
|
75
|
+
return {
|
|
76
|
+
"$": ["cura-button-outline.css"]
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get properties() {
|
|
80
|
+
return {
|
|
81
|
+
"size": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "'small' | 'medium' | 'large'",
|
|
86
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Button size: small | medium | large (default)"
|
|
94
|
+
},
|
|
95
|
+
"attribute": "size",
|
|
96
|
+
"reflect": true,
|
|
97
|
+
"defaultValue": "'large'"
|
|
98
|
+
},
|
|
99
|
+
"disabled": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"mutable": false,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "boolean",
|
|
104
|
+
"resolved": "boolean",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Disabled state. Boolean."
|
|
112
|
+
},
|
|
113
|
+
"attribute": "disabled",
|
|
114
|
+
"reflect": true,
|
|
115
|
+
"defaultValue": "false"
|
|
116
|
+
},
|
|
117
|
+
"isLoading": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "boolean",
|
|
122
|
+
"resolved": "boolean",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "Loading state. Boolean."
|
|
130
|
+
},
|
|
131
|
+
"attribute": "is-loading",
|
|
132
|
+
"reflect": true,
|
|
133
|
+
"defaultValue": "false"
|
|
134
|
+
},
|
|
135
|
+
"iconName": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "Name of the icon to be used from iconset."
|
|
148
|
+
},
|
|
149
|
+
"attribute": "icon-name",
|
|
150
|
+
"reflect": true
|
|
151
|
+
},
|
|
152
|
+
"iconset": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "string",
|
|
157
|
+
"resolved": "string",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": false,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "Custom iconset if needed."
|
|
165
|
+
},
|
|
166
|
+
"attribute": "iconset",
|
|
167
|
+
"reflect": true,
|
|
168
|
+
"defaultValue": "'default'"
|
|
169
|
+
},
|
|
170
|
+
"iconPosition": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "'left' | 'right'",
|
|
175
|
+
"resolved": "\"left\" | \"right\"",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": "Icon position: left (default) | right."
|
|
183
|
+
},
|
|
184
|
+
"attribute": "icon-position",
|
|
185
|
+
"reflect": true,
|
|
186
|
+
"defaultValue": "'left'"
|
|
187
|
+
},
|
|
188
|
+
"iconOnly": {
|
|
189
|
+
"type": "boolean",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "false",
|
|
193
|
+
"resolved": "boolean",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Set button to FAB/icon only."
|
|
201
|
+
},
|
|
202
|
+
"attribute": "icon-only",
|
|
203
|
+
"reflect": true
|
|
204
|
+
},
|
|
205
|
+
"href": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"mutable": false,
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "string",
|
|
210
|
+
"resolved": "string",
|
|
211
|
+
"references": {}
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"optional": false,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": "Property href switch button to link."
|
|
218
|
+
},
|
|
219
|
+
"attribute": "href",
|
|
220
|
+
"reflect": true
|
|
221
|
+
},
|
|
222
|
+
"target": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "Set target if link."
|
|
235
|
+
},
|
|
236
|
+
"attribute": "target",
|
|
237
|
+
"reflect": true,
|
|
238
|
+
"defaultValue": "\"_self\""
|
|
239
|
+
},
|
|
240
|
+
"color": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"mutable": false,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "string",
|
|
245
|
+
"resolved": "string",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": "Color base from color scheme. Default: accent."
|
|
253
|
+
},
|
|
254
|
+
"attribute": "color",
|
|
255
|
+
"reflect": false,
|
|
256
|
+
"defaultValue": "'accent'"
|
|
257
|
+
},
|
|
258
|
+
"fontColor": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"mutable": false,
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "'dark' | 'light'",
|
|
263
|
+
"resolved": "\"dark\" | \"light\"",
|
|
264
|
+
"references": {}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": false,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "Set the font color to dark or light."
|
|
271
|
+
},
|
|
272
|
+
"attribute": "font-color",
|
|
273
|
+
"reflect": true,
|
|
274
|
+
"defaultValue": "'dark'"
|
|
275
|
+
},
|
|
276
|
+
"textAlign": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"mutable": false,
|
|
279
|
+
"complexType": {
|
|
280
|
+
"original": "'left' | 'center' | 'right'",
|
|
281
|
+
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
282
|
+
"references": {}
|
|
283
|
+
},
|
|
284
|
+
"required": false,
|
|
285
|
+
"optional": false,
|
|
286
|
+
"docs": {
|
|
287
|
+
"tags": [],
|
|
288
|
+
"text": "Set text aligment for the button label.\nVales: left (default) | center | right."
|
|
289
|
+
},
|
|
290
|
+
"attribute": "text-align",
|
|
291
|
+
"reflect": true,
|
|
292
|
+
"defaultValue": "'left'"
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
static get states() {
|
|
297
|
+
return {
|
|
298
|
+
"styles": {}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
static get watchers() {
|
|
302
|
+
return [{
|
|
303
|
+
"propName": "color",
|
|
304
|
+
"methodName": "handleChangeColor"
|
|
305
|
+
}];
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=cura-button-outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-button-outline.js","sourceRoot":"","sources":["../../../../src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOvE,MAAM,OAAO,iBAAiB;;gBAKgC,OAAO;oBAKjC,KAAK;qBAIJ,KAAK;;mBASP,SAAS;wBAIc,MAAM;;;kBAa9B,OAAO;iBAKvB,QAAQ;qBAQ6B,MAAM;qBAKK,MAAM;kBAGpD,EAAE;;EAdpB,iBAAiB;IACf,IAAI,CAAC,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AAU,EAAE,EAC9B,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,EAC/B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;MACnC,YAAM,KAAK,EAAC,kBAAkB;QAC1B,IAAI,CAAC,OAAO,EAAE;QAChB,YAAM,KAAK,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,EAAC;UAAE,eAAa,CAAO,CACjF;MACP,0BAAoB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,GAAuB,CACjF,CACV,CACM,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Watch, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n})\nexport class CuraButtonOutline {\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({reflect: true}) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({reflect: true}) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({reflect: true}) isLoading = false;\n \n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({reflect: true}) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({reflect: true}) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({reflect: true}) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({reflect: true}) iconOnly: false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({reflect: true}) href: string;\n /**\n * Set target if link.\n */\n @Prop({reflect: true}) target = \"_self\";\n\n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n /**\n * Set the font color to dark or light.\n */\n @Prop({reflect: true}) fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({reflect: true}) textAlign: 'left' | 'center' | 'right' = 'left';\n\n\n @State() styles = {};\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n \n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['inverted'] = this.fontColor === 'light';\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n return classes;\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 };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const color = this.getSymbolColor();\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={color}></cura-icon>;\n }\n\n getSymbolColor() {\n return this.disabled \n ? 'neutral-dark' \n : this.fontColor === 'light' \n ? 'neutral-white' \n : `${this.color}-base`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) e.preventDefault();\n }\n\n render() {\n return (\n <Host>\n { this.href ? (\n <a href={this.disabled ? '' : this.href} \n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles} \n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"]}
|