@momentum-design/components 0.120.13 → 0.120.15
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/browser/index.js +622 -445
- package/dist/browser/index.js.map +3 -3
- package/dist/components/button/button.component.d.ts +8 -0
- package/dist/components/button/button.component.js +8 -0
- package/dist/components/button/button.styles.js +152 -116
- package/dist/components/buttonlink/buttonlink.component.d.ts +7 -0
- package/dist/components/buttonlink/buttonlink.component.js +7 -0
- package/dist/components/buttonlink/buttonlink.styles.js +2 -2
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -0
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -0
- package/dist/components/buttonsimple/buttonsimple.styles.js +20 -25
- package/dist/components/checkbox/checkbox.component.d.ts +1 -1
- package/dist/components/checkbox/checkbox.component.js +8 -2
- package/dist/components/checkbox/checkbox.styles.js +62 -40
- package/dist/components/chip/chip.component.d.ts +1 -0
- package/dist/components/chip/chip.component.js +1 -0
- package/dist/components/combobox/combobox.component.d.ts +0 -5
- package/dist/components/combobox/combobox.component.js +0 -9
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +10 -0
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +21 -1
- package/dist/components/input/input.component.d.ts +0 -4
- package/dist/components/input/input.component.js +0 -8
- package/dist/components/linkbutton/linkbutton.component.d.ts +1 -0
- package/dist/components/linkbutton/linkbutton.component.js +1 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +2 -0
- package/dist/components/menuitemradio/menuitemradio.component.js +1 -0
- package/dist/components/radio/radio.component.d.ts +0 -6
- package/dist/components/radio/radio.component.js +5 -11
- package/dist/components/radio/radio.styles.js +70 -34
- package/dist/components/select/select.component.d.ts +0 -13
- package/dist/components/select/select.component.js +0 -13
- package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +13 -1
- package/dist/components/staticcheckbox/staticcheckbox.component.js +21 -1
- package/dist/components/staticcheckbox/staticcheckbox.styles.js +30 -7
- package/dist/components/staticradio/staticradio.component.d.ts +7 -1
- package/dist/components/staticradio/staticradio.component.js +11 -1
- package/dist/components/staticradio/staticradio.styles.js +16 -9
- package/dist/components/statictoggle/statictoggle.component.d.ts +13 -1
- package/dist/components/statictoggle/statictoggle.component.js +21 -1
- package/dist/components/statictoggle/statictoggle.styles.js +24 -4
- package/dist/components/tab/tab.component.d.ts +1 -0
- package/dist/components/tab/tab.component.js +1 -0
- package/dist/components/textarea/textarea.component.d.ts +0 -5
- package/dist/components/textarea/textarea.component.js +0 -9
- package/dist/components/toggle/toggle.component.d.ts +1 -1
- package/dist/components/toggle/toggle.component.js +9 -3
- package/dist/components/toggle/toggle.styles.js +47 -20
- package/dist/custom-elements.json +1275 -261
- package/dist/react/button/index.d.ts +8 -0
- package/dist/react/button/index.js +8 -0
- package/dist/react/buttonlink/index.d.ts +7 -0
- package/dist/react/buttonlink/index.js +7 -0
- package/dist/react/buttonsimple/index.d.ts +5 -0
- package/dist/react/buttonsimple/index.js +5 -0
- package/dist/react/chip/index.d.ts +1 -0
- package/dist/react/chip/index.js +1 -0
- package/dist/react/linkbutton/index.d.ts +1 -0
- package/dist/react/linkbutton/index.js +1 -0
- package/dist/react/staticcheckbox/index.d.ts +1 -1
- package/dist/react/staticcheckbox/index.js +1 -1
- package/dist/react/staticradio/index.d.ts +1 -1
- package/dist/react/staticradio/index.js +1 -1
- package/dist/react/statictoggle/index.d.ts +1 -1
- package/dist/react/statictoggle/index.js +1 -1
- package/dist/react/tab/index.d.ts +1 -0
- package/dist/react/tab/index.js +1 -0
- package/package.json +1 -1
@@ -41,6 +41,14 @@ declare const Button_base: import("../../utils/mixins/index.types").Constructor<
|
|
41
41
|
* @csspart button-text - Text label of the button, passed in default slot
|
42
42
|
* @csspart prefix - Content before the text label, passed in `prefix` slot
|
43
43
|
* @csspart postfix - Content after the text label, passed in `postfix` slot
|
44
|
+
*
|
45
|
+
* @cssproperty --mdc-button-height - Height for button size
|
46
|
+
* @cssproperty --mdc-button-background - Background of the button
|
47
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
48
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
49
|
+
* @cssproperty --mdc-button-prefix-icon-size - Size of the prefix icon
|
50
|
+
* @cssproperty --mdc-button-postfix-icon-size - Size of the postfix icon
|
51
|
+
* @cssproperty --mdc-button-line-height - Line height of the button text
|
44
52
|
*/
|
45
53
|
declare class Button extends Button_base {
|
46
54
|
/**
|
@@ -52,6 +52,14 @@ import { getIconNameWithoutStyle } from './button.utils';
|
|
52
52
|
* @csspart button-text - Text label of the button, passed in default slot
|
53
53
|
* @csspart prefix - Content before the text label, passed in `prefix` slot
|
54
54
|
* @csspart postfix - Content after the text label, passed in `postfix` slot
|
55
|
+
*
|
56
|
+
* @cssproperty --mdc-button-height - Height for button size
|
57
|
+
* @cssproperty --mdc-button-background - Background of the button
|
58
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
59
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
60
|
+
* @cssproperty --mdc-button-prefix-icon-size - Size of the prefix icon
|
61
|
+
* @cssproperty --mdc-button-postfix-icon-size - Size of the postfix icon
|
62
|
+
* @cssproperty --mdc-button-line-height - Line height of the button text
|
55
63
|
*/
|
56
64
|
class Button extends ButtonComponentMixin(Buttonsimple) {
|
57
65
|
constructor() {
|
@@ -1,44 +1,19 @@
|
|
1
1
|
import { css } from 'lit';
|
2
2
|
const styles = css `
|
3
3
|
:host {
|
4
|
-
|
4
|
+
--mdc-button-prefix-icon-size: 1rem;
|
5
|
+
--mdc-button-postfix-icon-size: 1rem;
|
6
|
+
--mdc-button-line-height: var(--mds-font-lineheight-body-large);
|
7
|
+
|
8
|
+
background: var(
|
9
|
+
--mdc-button-background
|
10
|
+
); /* Using background instead of background-color since gradients are not supported in background-color */
|
11
|
+
border-color: var(--mdc-button-border-color);
|
5
12
|
border-radius: 1.25rem;
|
13
|
+
color: var(--mdc-button-text-color);
|
6
14
|
font-weight: var(--mds-font-apps-body-large-medium-font-weight);
|
7
15
|
outline: none;
|
8
|
-
|
9
|
-
--mdc-button-primary-color: var(--mds-color-theme-inverted-text-primary-normal);
|
10
|
-
--mdc-button-primary-background-color: var(--mds-color-theme-button-primary-normal);
|
11
|
-
--mdc-button-primary-hover-background-color: var(--mds-color-theme-button-primary-hover);
|
12
|
-
--mdc-button-primary-pressed-background-color: var(--mds-color-theme-button-primary-pressed);
|
13
|
-
--mdc-button-primary-disabled-background-color: var(--mds-color-theme-button-primary-disabled);
|
14
|
-
--mdc-button-primary-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
15
|
-
|
16
|
-
--mdc-button-secondary-color: var(--mds-color-theme-text-primary-normal);
|
17
|
-
--mdc-button-secondary-border-color: var(--mds-color-theme-outline-button-normal);
|
18
|
-
--mdc-button-secondary-hover-background-color: var(--mds-color-theme-button-secondary-hover);
|
19
|
-
--mdc-button-secondary-pressed-background-color: var(--mds-color-theme-button-secondary-pressed);
|
20
|
-
--mdc-button-secondary-disabled-background-color: var(--mds-color-theme-button-secondary-disabled);
|
21
|
-
--mdc-button-secondary-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
22
|
-
--mdc-button-secondary-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
23
|
-
|
24
|
-
--mdc-button-tertiary-color: var(--mds-color-theme-text-primary-normal);
|
25
|
-
--mdc-button-tertiary-hover-background-color: var(--mds-color-theme-button-secondary-hover);
|
26
|
-
--mdc-button-tertiary-pressed-background-color: var(--mds-color-theme-button-secondary-pressed);
|
27
|
-
--mdc-button-tertiary-disabled-background-color: var(--mds-color-theme-button-secondary-disabled);
|
28
|
-
--mdc-button-tertiary-disabled-color: var(--mds-color-theme-text-primary-disabled);
|
29
|
-
|
30
|
-
--mdc-button-active-background-color: var(--mds-color-theme-button-secondary-active-normal);
|
31
|
-
--mdc-button-active-hover-background-color: var(--mds-color-theme-button-secondary-active-hover);
|
32
|
-
--mdc-button-active-pressed-background-color: var(--mds-color-theme-button-secondary-active-pressed);
|
33
|
-
--mdc-button-active-disabled-background-color: var(--mds-color-theme-button-secondary-active-disabled);
|
34
|
-
|
35
|
-
--mdc-button-line-height-size-40: var(--mds-font-lineheight-body-large);
|
36
|
-
--mdc-button-line-height-size-32: var(--mds-font-lineheight-body-large);
|
37
|
-
--mdc-button-line-height-size-28: var(--mds-font-lineheight-body-midsize);
|
38
|
-
--mdc-button-line-height-size-24: var(--mds-font-lineheight-body-small);
|
39
|
-
|
40
|
-
--mdc-button-prefix-icon-size: 1rem;
|
41
|
-
--mdc-button-postfix-icon-size: 1rem;
|
16
|
+
line-height: var(--mdc-button-line-height);
|
42
17
|
}
|
43
18
|
|
44
19
|
:host([size='64']) {
|
@@ -71,76 +46,57 @@ const styles = css `
|
|
71
46
|
|
72
47
|
:host([active][color='default']:not([variant='primary'])) {
|
73
48
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
74
|
-
background: var(--
|
49
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-active-normal);
|
75
50
|
}
|
76
51
|
:host([active][color='default']:not([variant='primary']):hover) {
|
77
52
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
78
|
-
background: var(--
|
53
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-active-hover);
|
79
54
|
}
|
80
55
|
:host([active][color='default']:not([variant='primary']):active),
|
81
56
|
:host([active][color='default']:not([variant='primary']).pressed) {
|
82
57
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
83
|
-
background: var(--
|
58
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-active-pressed);
|
84
59
|
}
|
85
60
|
:host([active][color='default']:not([variant='primary'])[disabled]),
|
86
61
|
:host([active][color='default']:not([variant='primary'])[soft-disabled]) {
|
87
62
|
font-weight: var(--mds-font-apps-body-large-bold-font-weight);
|
88
|
-
background: var(--
|
63
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-active-disabled);
|
89
64
|
}
|
90
65
|
|
91
66
|
:host([variant='primary']) {
|
92
|
-
background: var(--
|
93
|
-
color: var(--
|
67
|
+
--mdc-button-background: var(--mds-color-theme-button-primary-normal);
|
68
|
+
--mdc-button-text-color: var(--mds-color-theme-inverted-text-primary-normal);
|
94
69
|
}
|
95
70
|
:host([variant='primary']:hover) {
|
96
|
-
background: var(--
|
71
|
+
--mdc-button-background: var(--mds-color-theme-button-primary-hover);
|
97
72
|
}
|
98
73
|
:host([variant='primary']:active),
|
99
74
|
:host([variant='primary'].pressed) {
|
100
|
-
background: var(--
|
101
|
-
}
|
102
|
-
:host([variant='primary'][disabled]),
|
103
|
-
:host([variant='primary'][soft-disabled]) {
|
104
|
-
background: var(--mdc-button-primary-disabled-background-color);
|
105
|
-
color: var(--mdc-button-primary-disabled-color);
|
106
|
-
cursor: auto;
|
75
|
+
--mdc-button-background: var(--mds-color-theme-button-primary-pressed);
|
107
76
|
}
|
108
77
|
|
109
78
|
:host([variant='secondary']) {
|
110
|
-
color: var(--
|
111
|
-
border-color: var(--
|
79
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-normal);
|
80
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-button-normal);
|
112
81
|
}
|
113
82
|
:host([variant='secondary']:hover) {
|
114
|
-
background: var(--
|
83
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
115
84
|
}
|
116
85
|
:host([variant='secondary']:active),
|
117
86
|
:host([variant='secondary'].pressed) {
|
118
|
-
background: var(--
|
119
|
-
}
|
120
|
-
:host([variant='secondary'][disabled]),
|
121
|
-
:host([variant='secondary'][soft-disabled]) {
|
122
|
-
color: var(--mdc-button-primary-disabled-color);
|
123
|
-
border-color: var(--mdc-button-secondary-disabled-border-color);
|
124
|
-
background: var(--mdc-button-secondary-disabled-background-color);
|
125
|
-
cursor: auto;
|
87
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
126
88
|
}
|
127
89
|
|
128
90
|
:host([variant='tertiary']) {
|
129
|
-
border-color: transparent;
|
130
|
-
color: var(--
|
91
|
+
--mdc-button-border-color: transparent;
|
92
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-normal);
|
131
93
|
}
|
132
94
|
:host([variant='tertiary']:hover) {
|
133
|
-
background: var(--
|
95
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
134
96
|
}
|
135
97
|
:host([variant='tertiary']:active),
|
136
98
|
:host([variant='tertiary'].pressed) {
|
137
|
-
background: var(--
|
138
|
-
}
|
139
|
-
:host([variant='tertiary'][disabled]),
|
140
|
-
:host([variant='tertiary'][soft-disabled]) {
|
141
|
-
color: var(--mdc-button-tertiary-disabled-color);
|
142
|
-
background: var(--mdc-button-tertiary-disabled-background-color);
|
143
|
-
cursor: auto;
|
99
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
144
100
|
}
|
145
101
|
|
146
102
|
:host([size='64'][data-btn-type='icon']),
|
@@ -155,25 +111,23 @@ const styles = css `
|
|
155
111
|
}
|
156
112
|
:host([size='40']) {
|
157
113
|
font-size: var(--mds-font-size-body-large);
|
158
|
-
line-height: var(--mdc-button-line-height-size-40);
|
159
114
|
padding: 0 1rem;
|
160
115
|
gap: 0.5rem;
|
161
116
|
}
|
162
117
|
:host([size='32']) {
|
163
118
|
font-size: var(--mds-font-size-body-large);
|
164
|
-
line-height: var(--mdc-button-line-height-size-32);
|
165
119
|
padding: 0 0.75rem;
|
166
120
|
gap: 0.375rem;
|
167
121
|
}
|
168
122
|
:host([size='28']) {
|
169
123
|
font-size: var(--mds-font-size-body-midsize);
|
170
|
-
line-height: var(--
|
124
|
+
line-height: var(--mds-font-lineheight-body-midsize);
|
171
125
|
padding: 0 0.75rem;
|
172
126
|
gap: 0.375rem;
|
173
127
|
}
|
174
128
|
:host([size='24']) {
|
175
129
|
font-size: var(--mds-font-size-body-small);
|
176
|
-
line-height: var(--
|
130
|
+
line-height: var(--mds-font-lineheight-body-small);
|
177
131
|
padding: 0 0.625rem;
|
178
132
|
gap: 0.25rem;
|
179
133
|
}
|
@@ -182,58 +136,140 @@ const styles = css `
|
|
182
136
|
aspect-ratio: 1;
|
183
137
|
}
|
184
138
|
|
185
|
-
:host([color='accent']) {
|
186
|
-
--mdc-button-
|
187
|
-
--mdc-button-
|
188
|
-
|
189
|
-
|
139
|
+
:host([color='accent'][variant='primary']) {
|
140
|
+
--mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
|
141
|
+
--mdc-button-background: var(--mds-color-theme-button-accent-normal);
|
142
|
+
}
|
143
|
+
:host([color='accent'][variant='primary']:hover) {
|
144
|
+
--mdc-button-background: var(--mds-color-theme-button-accent-hover);
|
145
|
+
}
|
146
|
+
:host([color='accent'][variant='primary']:active),
|
147
|
+
:host([color='accent'][variant='primary'].pressed) {
|
148
|
+
--mdc-button-background: var(--mds-color-theme-button-accent-pressed);
|
149
|
+
}
|
150
|
+
|
151
|
+
:host([color='accent'][variant='secondary']) {
|
152
|
+
--mdc-button-text-color: var(--mds-color-theme-text-accent-normal);
|
153
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-theme-normal);
|
154
|
+
}
|
155
|
+
:host([color='accent'][variant='secondary']:hover) {
|
156
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
157
|
+
}
|
158
|
+
:host([color='accent'][variant='secondary']:active),
|
159
|
+
:host([color='accent'][variant='secondary'].pressed) {
|
160
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
161
|
+
}
|
162
|
+
|
163
|
+
:host([color='positive'][variant='primary']) {
|
164
|
+
--mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
|
165
|
+
--mdc-button-background: var(--mds-color-theme-button-join-normal);
|
166
|
+
}
|
167
|
+
:host([color='positive'][variant='primary']:hover) {
|
168
|
+
--mdc-button-background: var(--mds-color-theme-button-join-hover);
|
169
|
+
}
|
170
|
+
:host([color='positive'][variant='primary']:active),
|
171
|
+
:host([color='positive'][variant='primary'].pressed) {
|
172
|
+
--mdc-button-background: var(--mds-color-theme-button-join-pressed);
|
173
|
+
}
|
174
|
+
|
175
|
+
:host([color='positive'][variant='secondary']) {
|
176
|
+
--mdc-button-text-color: var(--mds-color-theme-text-success-normal);
|
177
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-join-normal);
|
178
|
+
}
|
179
|
+
:host([color='positive'][variant='secondary']:hover) {
|
180
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
181
|
+
}
|
182
|
+
:host([color='positive'][variant='secondary']:active),
|
183
|
+
:host([color='positive'][variant='secondary'].pressed) {
|
184
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
185
|
+
}
|
190
186
|
|
191
|
-
|
192
|
-
--mdc-button-
|
193
|
-
--mdc-button-
|
194
|
-
|
187
|
+
:host([color='negative'][variant='primary']) {
|
188
|
+
--mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
|
189
|
+
--mdc-button-background: var(--mds-color-theme-button-cancel-normal);
|
190
|
+
}
|
191
|
+
:host([color='negative'][variant='primary']:hover) {
|
192
|
+
--mdc-button-background: var(--mds-color-theme-button-cancel-hover);
|
193
|
+
}
|
194
|
+
:host([color='negative'][variant='primary']:active),
|
195
|
+
:host([color='negative'][variant='primary'].pressed) {
|
196
|
+
--mdc-button-background: var(--mds-color-theme-button-cancel-pressed);
|
195
197
|
}
|
196
|
-
:host([color='positive']) {
|
197
|
-
--mdc-button-primary-color: var(--mds-color-theme-common-text-primary-normal);
|
198
|
-
--mdc-button-primary-background-color: var(--mds-color-theme-button-join-normal);
|
199
|
-
--mdc-button-primary-hover-background-color: var(--mds-color-theme-button-join-hover);
|
200
|
-
--mdc-button-primary-pressed-background-color: var(--mds-color-theme-button-join-pressed);
|
201
198
|
|
202
|
-
|
203
|
-
--mdc-button-
|
204
|
-
--mdc-button-
|
205
|
-
|
199
|
+
:host([color='negative'][variant='secondary']) {
|
200
|
+
--mdc-button-text-color: var(--mds-color-theme-text-error-normal);
|
201
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-cancel-normal);
|
202
|
+
}
|
203
|
+
:host([color='negative'][variant='secondary']:hover) {
|
204
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
205
|
+
}
|
206
|
+
:host([color='negative'][variant='secondary']:active),
|
207
|
+
:host([color='negative'][variant='secondary'].pressed) {
|
208
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
206
209
|
}
|
207
|
-
:host([color='negative']) {
|
208
|
-
--mdc-button-primary-color: var(--mds-color-theme-common-text-primary-normal);
|
209
|
-
--mdc-button-primary-background-color: var(--mds-color-theme-button-cancel-normal);
|
210
|
-
--mdc-button-primary-hover-background-color: var(--mds-color-theme-button-cancel-hover);
|
211
|
-
--mdc-button-primary-pressed-background-color: var(--mds-color-theme-button-cancel-pressed);
|
212
210
|
|
213
|
-
|
214
|
-
--mdc-button-
|
215
|
-
--mdc-button-
|
216
|
-
|
211
|
+
:host([color='promotional'][variant='primary']) {
|
212
|
+
--mdc-button-text-color: var(--mds-color-theme-common-text-primary-normal);
|
213
|
+
--mdc-button-background: var(--mds-color-theme-common-button-promotion-normal);
|
214
|
+
}
|
215
|
+
:host([color='promotional'][variant='primary']:hover) {
|
216
|
+
--mdc-button-background: var(--mds-color-theme-common-button-promotion-hover);
|
217
|
+
}
|
218
|
+
:host([color='promotional'][variant='primary']:active),
|
219
|
+
:host([color='promotional'][variant='primary'].pressed) {
|
220
|
+
--mdc-button-background: var(--mds-color-theme-common-button-promotion-active);
|
217
221
|
}
|
218
|
-
:host([color='promotional']) {
|
219
|
-
--mdc-button-primary-color: var(--mds-color-theme-common-text-primary-normal);
|
220
|
-
--mdc-button-primary-background-color: var(--mds-color-theme-common-button-promotion-normal);
|
221
|
-
--mdc-button-primary-hover-background-color: var(--mds-color-theme-common-button-promotion-hover);
|
222
|
-
--mdc-button-primary-pressed-background-color: var(--mds-color-theme-common-button-promotion-active);
|
223
222
|
|
224
|
-
|
225
|
-
--mdc-button-
|
226
|
-
--mdc-button-
|
227
|
-
|
223
|
+
:host([color='promotional'][variant='secondary']) {
|
224
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-normal);
|
225
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-promotion-normal);
|
226
|
+
}
|
227
|
+
:host([color='promotional'][variant='secondary']:hover) {
|
228
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-hover);
|
229
|
+
}
|
230
|
+
:host([color='promotional'][variant='secondary']:active),
|
231
|
+
:host([color='promotional'][variant='secondary'].pressed) {
|
232
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-pressed);
|
228
233
|
}
|
229
234
|
|
230
235
|
:host([inverted][variant='primary'][color='default']) {
|
231
|
-
--mdc-button-
|
232
|
-
--mdc-button-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
--mdc-button-
|
236
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-normal);
|
237
|
+
--mdc-button-background: var(--mds-color-theme-inverted-button-primary-normal);
|
238
|
+
}
|
239
|
+
|
240
|
+
:host([inverted][variant='primary'][color='default']:hover) {
|
241
|
+
--mdc-button-background: var(--mds-color-theme-inverted-button-primary-hover);
|
242
|
+
}
|
243
|
+
|
244
|
+
:host([inverted][variant='primary'][color='default']:active),
|
245
|
+
:host([inverted][variant='primary'][color='default'].pressed) {
|
246
|
+
--mdc-button-background: var(--mds-color-theme-inverted-button-primary-pressed);
|
247
|
+
}
|
248
|
+
:host([inverted][variant='primary'][color='default'][disabled]),
|
249
|
+
:host([inverted][variant='primary'][color='default'][soft-disabled]) {
|
250
|
+
--mdc-button-background: var(--mds-color-theme-inverted-button-primary-disabled);
|
251
|
+
--mdc-button-text-color: var(--mds-color-theme-inverted-text-primary-disabled);
|
252
|
+
cursor: auto;
|
253
|
+
}
|
254
|
+
|
255
|
+
:host([variant='primary'][disabled]),
|
256
|
+
:host([variant='primary'][soft-disabled]) {
|
257
|
+
--mdc-button-background: var(--mds-color-theme-button-primary-disabled);
|
258
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-disabled);
|
259
|
+
cursor: auto;
|
260
|
+
}
|
261
|
+
:host([variant='secondary'][disabled]),
|
262
|
+
:host([variant='secondary'][soft-disabled]) {
|
263
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-disabled);
|
264
|
+
--mdc-button-border-color: var(--mds-color-theme-outline-primary-disabled);
|
265
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-disabled);
|
266
|
+
cursor: auto;
|
267
|
+
}
|
268
|
+
:host([variant='tertiary'][disabled]),
|
269
|
+
:host([variant='tertiary'][soft-disabled]) {
|
270
|
+
--mdc-button-text-color: var(--mds-color-theme-text-primary-disabled);
|
271
|
+
--mdc-button-background: var(--mds-color-theme-button-secondary-disabled);
|
272
|
+
cursor: auto;
|
237
273
|
}
|
238
274
|
|
239
275
|
:host([data-btn-type='pill'])::part(button-text),
|
@@ -27,6 +27,13 @@ declare const ButtonLink_base: import("../../utils/mixins/index.types").Construc
|
|
27
27
|
* @csspart button-text - The slot containing the buttonlink text.
|
28
28
|
* @csspart postfix-icon - The postfix icon element.
|
29
29
|
*
|
30
|
+
* @cssproperty --mdc-button-height - Height for button size
|
31
|
+
* @cssproperty --mdc-button-background - Background color of the button
|
32
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
33
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
34
|
+
* @cssproperty --mdc-button-line-height - Line height of the button text
|
35
|
+
* @cssproperty --mdc-button-prefix-icon-size - Size of the prefix icon
|
36
|
+
* @cssproperty --mdc-button-postfix-icon-size - Size of the postfix icon
|
30
37
|
*/
|
31
38
|
declare class ButtonLink extends ButtonLink_base {
|
32
39
|
/**
|
@@ -39,6 +39,13 @@ import styles from './buttonlink.styles';
|
|
39
39
|
* @csspart button-text - The slot containing the buttonlink text.
|
40
40
|
* @csspart postfix-icon - The postfix icon element.
|
41
41
|
*
|
42
|
+
* @cssproperty --mdc-button-height - Height for button size
|
43
|
+
* @cssproperty --mdc-button-background - Background color of the button
|
44
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
45
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
46
|
+
* @cssproperty --mdc-button-line-height - Line height of the button text
|
47
|
+
* @cssproperty --mdc-button-prefix-icon-size - Size of the prefix icon
|
48
|
+
* @cssproperty --mdc-button-postfix-icon-size - Size of the postfix icon
|
42
49
|
*/
|
43
50
|
class ButtonLink extends ButtonComponentMixin(Linksimple) {
|
44
51
|
constructor() {
|
@@ -47,12 +47,12 @@ const styles = css `
|
|
47
47
|
}
|
48
48
|
|
49
49
|
:host([variant='secondary'])::part(anchor) {
|
50
|
-
border-color: var(--mdc-button-
|
50
|
+
border-color: var(--mdc-button-border-color);
|
51
51
|
}
|
52
52
|
|
53
53
|
:host([variant='secondary'][disabled])::part(anchor),
|
54
54
|
:host([variant='secondary'][soft-disabled])::part(anchor) {
|
55
|
-
border-color: var(--mdc-button-
|
55
|
+
border-color: var(--mdc-button-border-color);
|
56
56
|
}
|
57
57
|
`;
|
58
58
|
export default [styles, ...hostFocusRingStyles(true)];
|
@@ -15,6 +15,11 @@ declare const Buttonsimple_base: import("../../utils/mixins/index.types").Constr
|
|
15
15
|
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
16
16
|
*
|
17
17
|
* @tagname mdc-buttonsimple
|
18
|
+
*
|
19
|
+
* @cssproperty --mdc-button-height - Height for button size
|
20
|
+
* @cssproperty --mdc-button-background - Background color of the button
|
21
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
22
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
18
23
|
*/
|
19
24
|
declare class Buttonsimple extends Buttonsimple_base {
|
20
25
|
/**
|
@@ -27,6 +27,11 @@ import styles from './buttonsimple.styles';
|
|
27
27
|
* @event focus - (React: onFocus) This event is dispatched when the button receives focus.
|
28
28
|
*
|
29
29
|
* @tagname mdc-buttonsimple
|
30
|
+
*
|
31
|
+
* @cssproperty --mdc-button-height - Height for button size
|
32
|
+
* @cssproperty --mdc-button-background - Background color of the button
|
33
|
+
* @cssproperty --mdc-button-border-color - Borer color of the button
|
34
|
+
* @cssproperty --mdc-button-text-color - Text color of the button
|
30
35
|
*/
|
31
36
|
class Buttonsimple extends AutoFocusOnMountMixin(TabIndexMixin(DisabledMixin(Component))) {
|
32
37
|
/** @internal */
|
@@ -4,61 +4,56 @@ const styles = [
|
|
4
4
|
hostFitContentStyles,
|
5
5
|
css `
|
6
6
|
:host {
|
7
|
-
|
7
|
+
--mdc-button-height: unset;
|
8
|
+
--mdc-button-background: transparent;
|
9
|
+
--mdc-button-border-color: transparent;
|
10
|
+
--mdc-button-text-color: unset;
|
11
|
+
|
12
|
+
border: 0.0625rem solid var(--mdc-button-border-color);
|
8
13
|
cursor: pointer;
|
9
14
|
user-select: none;
|
10
15
|
|
11
|
-
background-color: var(--
|
12
|
-
color: var(--
|
16
|
+
background-color: var(--mdc-button-background);
|
17
|
+
color: var(--mdc-button-text-color);
|
13
18
|
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
19
|
+
height: var(--mdc-button-height);
|
14
20
|
outline: none;
|
15
|
-
|
16
|
-
--mdc-button-height-size-124: 7.75rem;
|
17
|
-
--mdc-button-height-size-88: 5.5rem;
|
18
|
-
--mdc-button-height-size-72: 4.5rem;
|
19
|
-
--mdc-button-height-size-64: 4rem;
|
20
|
-
--mdc-button-height-size-52: 3.25rem;
|
21
|
-
--mdc-button-height-size-40: 2.5rem;
|
22
|
-
--mdc-button-height-size-32: 2rem;
|
23
|
-
--mdc-button-height-size-28: 1.75rem;
|
24
|
-
--mdc-button-height-size-24: 1.5rem;
|
25
|
-
--mdc-button-height-size-20: 1.25rem;
|
26
21
|
}
|
27
22
|
|
28
23
|
:host([disabled]),
|
29
24
|
:host([soft-disabled]) {
|
30
|
-
background
|
25
|
+
--mdc-button-background: var(--mds-color-theme-text-primary-disabled);
|
31
26
|
}
|
32
27
|
:host([size='124']) {
|
33
|
-
|
28
|
+
--mdc-button-height: 7.75rem;
|
34
29
|
}
|
35
30
|
:host([size='88']) {
|
36
|
-
|
31
|
+
--mdc-button-height: 5.5rem;
|
37
32
|
}
|
38
33
|
:host([size='72']) {
|
39
|
-
|
34
|
+
--mdc-button-height: 4.5rem;
|
40
35
|
}
|
41
36
|
:host([size='64']) {
|
42
|
-
|
37
|
+
--mdc-button-height: 4rem;
|
43
38
|
}
|
44
39
|
:host([size='52']) {
|
45
|
-
|
40
|
+
--mdc-button-height: 3.25rem;
|
46
41
|
}
|
47
42
|
:host([size='40']) {
|
48
|
-
|
43
|
+
--mdc-button-height: 2.5rem;
|
49
44
|
}
|
50
45
|
:host([size='32']) {
|
51
|
-
|
46
|
+
--mdc-button-height: 2rem;
|
52
47
|
}
|
53
48
|
:host([size='28']) {
|
54
|
-
|
49
|
+
--mdc-button-height: 1.75rem;
|
55
50
|
font-size: var(--mds-font-size-body-midsize);
|
56
51
|
}
|
57
52
|
:host([size='24']) {
|
58
|
-
|
53
|
+
--mdc-button-height: 1.5rem;
|
59
54
|
}
|
60
55
|
:host([size='20']) {
|
61
|
-
|
56
|
+
--mdc-button-height: 1.25rem;
|
62
57
|
}
|
63
58
|
`,
|
64
59
|
...hostFocusRingStyles(),
|
@@ -86,7 +86,7 @@ declare class Checkbox extends Checkbox_base implements AssociatedFormControl {
|
|
86
86
|
formStateRestoreCallback(state: string): void;
|
87
87
|
/**
|
88
88
|
* Toggles the state of the checkbox element.
|
89
|
-
* If the element is not disabled, then
|
89
|
+
* If the element is not disabled, soft-disabled, or readonly, then
|
90
90
|
* the checked property is toggled and the indeterminate property is set to false.
|
91
91
|
*/
|
92
92
|
private toggleState;
|
@@ -151,11 +151,11 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
151
151
|
}
|
152
152
|
/**
|
153
153
|
* Toggles the state of the checkbox element.
|
154
|
-
* If the element is not disabled, then
|
154
|
+
* If the element is not disabled, soft-disabled, or readonly, then
|
155
155
|
* the checked property is toggled and the indeterminate property is set to false.
|
156
156
|
*/
|
157
157
|
toggleState() {
|
158
|
-
if (!this.disabled) {
|
158
|
+
if (!this.disabled && !this.softDisabled && !this.readonly) {
|
159
159
|
this.checked = !this.checked;
|
160
160
|
this.indeterminate = false;
|
161
161
|
}
|
@@ -167,6 +167,9 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
167
167
|
*/
|
168
168
|
handleKeyDown(event) {
|
169
169
|
var _a;
|
170
|
+
if ((this.readonly || this.softDisabled) && event.key === KEYS.SPACE) {
|
171
|
+
event.preventDefault();
|
172
|
+
}
|
170
173
|
if (event.key === KEYS.ENTER) {
|
171
174
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.requestSubmit();
|
172
175
|
}
|
@@ -194,6 +197,8 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
194
197
|
?checked="${this.checked}"
|
195
198
|
?indeterminate="${this.indeterminate}"
|
196
199
|
?disabled="${this.disabled}"
|
200
|
+
?readonly="${this.readonly}"
|
201
|
+
?soft-disabled="${this.softDisabled}"
|
197
202
|
>
|
198
203
|
<input
|
199
204
|
id="${this.inputId}"
|
@@ -206,6 +211,7 @@ class Checkbox extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMix
|
|
206
211
|
aria-checked="${this.indeterminate ? 'mixed' : this.checked}"
|
207
212
|
.indeterminate="${this.indeterminate}"
|
208
213
|
.disabled="${this.disabled}"
|
214
|
+
?readonly="${this.readonly}"
|
209
215
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
210
216
|
tabindex="${this.disabled ? -1 : 0}"
|
211
217
|
aria-describedby="${ifDefined(this.helpText ? FORMFIELD_DEFAULTS.HELPER_TEXT_ID : '')}"
|