@momentum-design/components 0.120.14 → 0.120.16
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 +428 -282
- package/dist/browser/index.js.map +3 -3
- 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/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/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/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 +876 -178
- 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/package.json +1 -1
@@ -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 : '')}"
|
@@ -2,86 +2,108 @@ import { css } from 'lit';
|
|
2
2
|
import { hostFocusRingStyles } from '../../utils/styles';
|
3
3
|
const styles = [
|
4
4
|
css `
|
5
|
+
/* Base styles and CSS custom properties */
|
5
6
|
:host {
|
6
7
|
--mdc-checkbox-background-color-hover: var(--mds-color-theme-control-inactive-hover);
|
7
8
|
--mdc-checkbox-pressed-icon-color: var(--mds-color-theme-control-inactive-pressed);
|
8
9
|
--mdc-checkbox-checked-pressed-icon-color: var(--mds-color-theme-control-active-pressed);
|
9
10
|
--mdc-checkbox-checked-background-color-hover: var(--mds-color-theme-control-active-hover);
|
10
11
|
--mdc-checkbox-disabled-checked-icon-color: var(--mds-color-theme-control-active-disabled);
|
12
|
+
--mdc-checkbox-disabled-text-color: var(--mds-color-theme-text-primary-disabled);
|
11
13
|
|
12
14
|
flex-direction: row;
|
13
15
|
align-items: flex-start;
|
14
16
|
}
|
15
17
|
|
18
|
+
/* Component structure and layout */
|
19
|
+
:host mdc-staticcheckbox {
|
20
|
+
position: relative;
|
21
|
+
}
|
22
|
+
|
23
|
+
:host::part(checkbox-input) {
|
24
|
+
margin: 0;
|
25
|
+
padding: 0;
|
26
|
+
position: absolute;
|
27
|
+
top: 0;
|
28
|
+
left: 0;
|
29
|
+
opacity: 0.1%;
|
30
|
+
overflow: visible;
|
31
|
+
z-index: 1;
|
32
|
+
width: 1rem;
|
33
|
+
height: 1rem;
|
34
|
+
border-radius: 0.125rem;
|
35
|
+
}
|
36
|
+
|
37
|
+
:host::part(text-container) {
|
38
|
+
display: flex;
|
39
|
+
flex-direction: column;
|
40
|
+
gap: 0.25rem;
|
41
|
+
}
|
42
|
+
|
16
43
|
:host::part(label) {
|
17
44
|
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
18
45
|
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
19
46
|
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
47
|
+
word-break: break-word;
|
48
|
+
white-space: normal;
|
20
49
|
}
|
21
50
|
|
22
|
-
|
51
|
+
/* Default interactive states */
|
52
|
+
:host::part(label),
|
53
|
+
:host::part(checkbox-input) {
|
23
54
|
cursor: pointer;
|
24
55
|
}
|
25
56
|
|
26
|
-
:host([disabled])::part(label) :host([disabled])::part(checkbox-input) {
|
27
|
-
cursor: default;
|
28
|
-
}
|
29
|
-
|
30
57
|
:host(:hover) mdc-staticcheckbox {
|
31
|
-
background: var(--mdc-checkbox-background-color-hover);
|
58
|
+
background-color: var(--mdc-checkbox-background-color-hover);
|
32
59
|
}
|
60
|
+
|
33
61
|
:host(:active) mdc-staticcheckbox {
|
34
|
-
background: var(--mdc-checkbox-pressed-icon-color);
|
62
|
+
background-color: var(--mdc-checkbox-pressed-icon-color);
|
35
63
|
}
|
36
64
|
|
37
65
|
:host([checked]:hover)::part(icon-container),
|
38
66
|
:host([indeterminate]:hover)::part(icon-container) {
|
39
|
-
background: var(--mdc-checkbox-checked-background-color-hover);
|
67
|
+
background-color: var(--mdc-checkbox-checked-background-color-hover);
|
40
68
|
}
|
69
|
+
|
41
70
|
:host([checked]:active)::part(icon-container),
|
42
71
|
:host([indeterminate]:active)::part(icon-container) {
|
43
|
-
background: var(--mdc-checkbox-checked-pressed-icon-color);
|
72
|
+
background-color: var(--mdc-checkbox-checked-pressed-icon-color);
|
44
73
|
}
|
45
74
|
|
46
|
-
|
47
|
-
|
75
|
+
/* Readonly state - disables pointer events */
|
76
|
+
:host([readonly]),
|
77
|
+
:host([soft-disabled]) {
|
78
|
+
pointer-events: none;
|
48
79
|
}
|
49
80
|
|
50
|
-
|
51
|
-
:host([disabled]
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
position: relative;
|
57
|
-
}
|
58
|
-
|
59
|
-
:host::part(checkbox-input) {
|
60
|
-
margin: 0;
|
61
|
-
padding: 0;
|
62
|
-
position: absolute;
|
63
|
-
top: 0;
|
64
|
-
left: 0;
|
65
|
-
opacity: 0.1%;
|
66
|
-
overflow: visible;
|
67
|
-
z-index: 1;
|
81
|
+
/* Disabled states override interactive styles */
|
82
|
+
:host([disabled])::part(label),
|
83
|
+
:host([disabled])::part(checkbox-input),
|
84
|
+
:host([soft-disabled])::part(label),
|
85
|
+
:host([soft-disabled])::part(checkbox-input) {
|
86
|
+
cursor: default;
|
68
87
|
}
|
69
88
|
|
70
|
-
:host
|
71
|
-
|
72
|
-
|
73
|
-
border-radius: 0.125rem;
|
89
|
+
:host([disabled]) mdc-staticcheckbox,
|
90
|
+
:host([soft-disabled]) mdc-staticcheckbox {
|
91
|
+
background-color: unset;
|
74
92
|
}
|
75
93
|
|
76
|
-
:host::part(
|
77
|
-
|
78
|
-
|
79
|
-
|
94
|
+
:host([disabled][checked])::part(icon-container),
|
95
|
+
:host([disabled][indeterminate])::part(icon-container),
|
96
|
+
:host([soft-disabled][checked])::part(icon-container),
|
97
|
+
:host([soft-disabled][indeterminate])::part(icon-container) {
|
98
|
+
background-color: var(--mdc-checkbox-disabled-checked-icon-color);
|
80
99
|
}
|
81
100
|
|
82
|
-
:host::part(label)
|
83
|
-
|
84
|
-
|
101
|
+
:host([disabled])::part(label),
|
102
|
+
:host([disabled])::part(help-text),
|
103
|
+
:host([soft-disabled])::part(label),
|
104
|
+
:host([soft-disabled])::part(label-text),
|
105
|
+
:host([soft-disabled])::part(help-text) {
|
106
|
+
color: var(--mdc-checkbox-disabled-text-color);
|
85
107
|
}
|
86
108
|
`,
|
87
109
|
...hostFocusRingStyles(true),
|
@@ -83,11 +83,6 @@ declare class Combobox extends Combobox_base implements AssociatedFormControl {
|
|
83
83
|
* The placeholder text which will be shown on the text if provided.
|
84
84
|
*/
|
85
85
|
placeholder?: string;
|
86
|
-
/**
|
87
|
-
* readonly attribute of the combobox field. If true, the combobox is read-only.
|
88
|
-
* @default false
|
89
|
-
*/
|
90
|
-
readonly: boolean;
|
91
86
|
/**
|
92
87
|
* The placement of the popover within Combobox.
|
93
88
|
* This defines the position of the popover relative to the combobox input field.
|
@@ -109,11 +109,6 @@ class Combobox extends CaptureDestroyEventForChildElement(AutoFocusOnMountMixin(
|
|
109
109
|
}
|
110
110
|
constructor() {
|
111
111
|
super();
|
112
|
-
/**
|
113
|
-
* readonly attribute of the combobox field. If true, the combobox is read-only.
|
114
|
-
* @default false
|
115
|
-
*/
|
116
|
-
this.readonly = false;
|
117
112
|
/**
|
118
113
|
* The placement of the popover within Combobox.
|
119
114
|
* This defines the position of the popover relative to the combobox input field.
|
@@ -704,10 +699,6 @@ __decorate([
|
|
704
699
|
property({ type: String }),
|
705
700
|
__metadata("design:type", String)
|
706
701
|
], Combobox.prototype, "placeholder", void 0);
|
707
|
-
__decorate([
|
708
|
-
property({ type: Boolean }),
|
709
|
-
__metadata("design:type", Object)
|
710
|
-
], Combobox.prototype, "readonly", void 0);
|
711
702
|
__decorate([
|
712
703
|
property({ type: String, reflect: true }),
|
713
704
|
__metadata("design:type", String)
|
@@ -70,6 +70,16 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
|
|
70
70
|
* This is used for accessibility purposes to provide a description of the icon.
|
71
71
|
*/
|
72
72
|
infoIconAriaLabel?: string;
|
73
|
+
/**
|
74
|
+
* Determines whether the form field is read-only.
|
75
|
+
* @default false
|
76
|
+
*/
|
77
|
+
readonly: boolean;
|
78
|
+
/**
|
79
|
+
* Determines whether the form field is soft-disabled.
|
80
|
+
* @default false
|
81
|
+
*/
|
82
|
+
softDisabled: boolean;
|
73
83
|
/** @internal */
|
74
84
|
protected shouldRenderLabel: Boolean;
|
75
85
|
/**
|
@@ -68,6 +68,16 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
68
68
|
*/
|
69
69
|
this.toggletipPlacement = DEFAULTS.TOGGLETIP_PLACEMENT;
|
70
70
|
this.toggletipStrategy = DEFAULTS.TOGGLETIP_STRATEGY;
|
71
|
+
/**
|
72
|
+
* Determines whether the form field is read-only.
|
73
|
+
* @default false
|
74
|
+
*/
|
75
|
+
this.readonly = false;
|
76
|
+
/**
|
77
|
+
* Determines whether the form field is soft-disabled.
|
78
|
+
* @default false
|
79
|
+
*/
|
80
|
+
this.softDisabled = false;
|
71
81
|
/** @internal */
|
72
82
|
this.shouldRenderLabel = true;
|
73
83
|
}
|
@@ -133,6 +143,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
133
143
|
if (!this.label)
|
134
144
|
return nothing;
|
135
145
|
const triggerId = `toggletip-trigger-${uuidv4()}`;
|
146
|
+
const shouldDisableToggletip = this.disabled || this.softDisabled;
|
136
147
|
return html `<div part="label-text">
|
137
148
|
<slot name="label">${this.renderLabelElement()}</slot>
|
138
149
|
${this.required ? html `<span part="required-indicator">*</span>` : nothing}
|
@@ -144,7 +155,8 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
144
155
|
size="${DEFAULTS.ICON_SIZE}"
|
145
156
|
variant="${BUTTON_VARIANTS.TERTIARY}"
|
146
157
|
aria-label="${ifDefined(this.infoIconAriaLabel)}"
|
147
|
-
?disabled="${
|
158
|
+
?disabled="${shouldDisableToggletip}"
|
159
|
+
?soft-disabled="${this.softDisabled}"
|
148
160
|
id="${triggerId}"
|
149
161
|
></mdc-button>
|
150
162
|
<mdc-toggletip
|
@@ -207,4 +219,12 @@ __decorate([
|
|
207
219
|
property({ type: String, reflect: true, attribute: 'info-icon-aria-label' }),
|
208
220
|
__metadata("design:type", String)
|
209
221
|
], FormfieldWrapper.prototype, "infoIconAriaLabel", void 0);
|
222
|
+
__decorate([
|
223
|
+
property({ type: Boolean, reflect: true }),
|
224
|
+
__metadata("design:type", Object)
|
225
|
+
], FormfieldWrapper.prototype, "readonly", void 0);
|
226
|
+
__decorate([
|
227
|
+
property({ type: Boolean, reflect: true, attribute: 'soft-disabled' }),
|
228
|
+
__metadata("design:type", Object)
|
229
|
+
], FormfieldWrapper.prototype, "softDisabled", void 0);
|
210
230
|
export default FormfieldWrapper;
|
@@ -75,10 +75,6 @@ declare class Input extends Input_base implements AssociatedFormControl {
|
|
75
75
|
* The placeholder text that is displayed when the input field is empty.
|
76
76
|
*/
|
77
77
|
placeholder: string;
|
78
|
-
/**
|
79
|
-
* readonly attribute of the input field. If true, the input field is read-only.
|
80
|
-
*/
|
81
|
-
readonly: boolean;
|
82
78
|
/**
|
83
79
|
* The prefix text that is displayed before the input field. It has a max length of 10 characters.
|
84
80
|
* When the prefix text is set, make sure to set the 'data-aria-label'
|
@@ -92,10 +92,6 @@ class Input extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
92
92
|
* The placeholder text that is displayed when the input field is empty.
|
93
93
|
*/
|
94
94
|
this.placeholder = '';
|
95
|
-
/**
|
96
|
-
* readonly attribute of the input field. If true, the input field is read-only.
|
97
|
-
*/
|
98
|
-
this.readonly = false;
|
99
95
|
/**
|
100
96
|
* The trailing button when set to true, shows a clear button that clears the input field.
|
101
97
|
* @default false
|
@@ -353,10 +349,6 @@ __decorate([
|
|
353
349
|
property({ type: String }),
|
354
350
|
__metadata("design:type", Object)
|
355
351
|
], Input.prototype, "placeholder", void 0);
|
356
|
-
__decorate([
|
357
|
-
property({ type: Boolean }),
|
358
|
-
__metadata("design:type", Object)
|
359
|
-
], Input.prototype, "readonly", void 0);
|
360
352
|
__decorate([
|
361
353
|
property({ type: String, attribute: 'prefix-text' }),
|
362
354
|
__metadata("design:type", String)
|
@@ -120,6 +120,7 @@ class MenuItemCheckbox extends ControlledMixin(MenuItem) {
|
|
120
120
|
slot="leading-controls"
|
121
121
|
?checked="${this.checked}"
|
122
122
|
?disabled="${this.disabled}"
|
123
|
+
?soft-disabled="${this.softDisabled}"
|
123
124
|
></mdc-staticcheckbox>
|
124
125
|
`;
|
125
126
|
}
|
@@ -139,6 +140,7 @@ class MenuItemCheckbox extends ControlledMixin(MenuItem) {
|
|
139
140
|
slot="trailing-controls"
|
140
141
|
?checked="${this.checked}"
|
141
142
|
?disabled="${this.disabled}"
|
143
|
+
?soft-disabled="${this.softDisabled}"
|
142
144
|
size="${TOGGLE_SIZE.COMPACT}"
|
143
145
|
></mdc-statictoggle>
|
144
146
|
`;
|
@@ -46,12 +46,6 @@ declare class Radio extends Radio_base implements AssociatedFormControl {
|
|
46
46
|
* @default false
|
47
47
|
*/
|
48
48
|
checked: boolean;
|
49
|
-
/**
|
50
|
-
* Determines whether the radio is read-only.
|
51
|
-
*
|
52
|
-
* @default false
|
53
|
-
*/
|
54
|
-
readonly: boolean;
|
55
49
|
connectedCallback(): void;
|
56
50
|
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
57
51
|
/**
|
@@ -65,12 +65,6 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
65
65
|
* @default false
|
66
66
|
*/
|
67
67
|
this.checked = false;
|
68
|
-
/**
|
69
|
-
* Determines whether the radio is read-only.
|
70
|
-
*
|
71
|
-
* @default false
|
72
|
-
*/
|
73
|
-
this.readonly = false;
|
74
68
|
this.renderLabelAndHelperText = () => {
|
75
69
|
if (!this.label)
|
76
70
|
return nothing;
|
@@ -188,7 +182,7 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
188
182
|
*/
|
189
183
|
handleChange() {
|
190
184
|
var _a;
|
191
|
-
if (this.disabled || this.readonly)
|
185
|
+
if (this.disabled || this.readonly || this.softDisabled)
|
192
186
|
return;
|
193
187
|
const radios = this.getAllRadiosWithinSameGroup();
|
194
188
|
radios.forEach(radio => {
|
@@ -228,6 +222,9 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
228
222
|
var _a;
|
229
223
|
if (this.disabled)
|
230
224
|
return;
|
225
|
+
if ((this.readonly || this.softDisabled) && event.key === KEYS.SPACE) {
|
226
|
+
event.preventDefault();
|
227
|
+
}
|
231
228
|
const radios = this.getAllRadiosWithinSameGroup();
|
232
229
|
const enabledRadios = radios.filter(radio => !radio.disabled);
|
233
230
|
const currentIndex = enabledRadios.indexOf(this);
|
@@ -286,6 +283,7 @@ class Radio extends AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(
|
|
286
283
|
?checked="${this.checked}"
|
287
284
|
?disabled="${this.disabled}"
|
288
285
|
?readonly="${this.readonly}"
|
286
|
+
?soft-disabled="${this.softDisabled}"
|
289
287
|
>
|
290
288
|
<input
|
291
289
|
id="${this.inputId}"
|
@@ -315,8 +313,4 @@ __decorate([
|
|
315
313
|
property({ type: Boolean, reflect: true }),
|
316
314
|
__metadata("design:type", Object)
|
317
315
|
], Radio.prototype, "checked", void 0);
|
318
|
-
__decorate([
|
319
|
-
property({ type: Boolean, reflect: true }),
|
320
|
-
__metadata("design:type", Object)
|
321
|
-
], Radio.prototype, "readonly", void 0);
|
322
316
|
export default Radio;
|
@@ -3,6 +3,7 @@ import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
|
3
3
|
const styles = [
|
4
4
|
hostFitContentStyles,
|
5
5
|
css `
|
6
|
+
/* Base styles and CSS custom properties */
|
6
7
|
:host {
|
7
8
|
display: flex;
|
8
9
|
flex-direction: row;
|
@@ -19,11 +20,44 @@ const styles = [
|
|
19
20
|
--mdc-radio-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
|
20
21
|
}
|
21
22
|
|
22
|
-
|
23
|
+
/* Component structure and layout */
|
24
|
+
:host::part(radio-input) {
|
25
|
+
position: absolute;
|
26
|
+
opacity: 0;
|
27
|
+
margin: 0;
|
28
|
+
width: 100%;
|
29
|
+
height: 100%;
|
30
|
+
cursor: pointer;
|
31
|
+
z-index: 2;
|
32
|
+
}
|
33
|
+
|
34
|
+
:host::part(text-container) {
|
35
|
+
display: flex;
|
36
|
+
flex-direction: column;
|
37
|
+
justify-content: center;
|
38
|
+
gap: 0.25rem;
|
39
|
+
flex: 1;
|
40
|
+
}
|
41
|
+
|
42
|
+
:host::part(required-indicator) {
|
43
|
+
display: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
:host::part(label) {
|
47
|
+
cursor: pointer;
|
48
|
+
word-break: break-word;
|
49
|
+
white-space: normal;
|
50
|
+
font-size: var(--mds-font-apps-body-midsize-regular-font-size);
|
51
|
+
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
52
|
+
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
53
|
+
}
|
54
|
+
|
55
|
+
/* Default interactive states */
|
56
|
+
:host(:hover) mdc-staticradio {
|
23
57
|
background-color: var(--mdc-radio-control-inactive-hover);
|
24
58
|
}
|
25
59
|
|
26
|
-
:host(:active)
|
60
|
+
:host(:active) mdc-staticradio {
|
27
61
|
background-color: var(--mdc-radio-control-inactive-pressed-color);
|
28
62
|
}
|
29
63
|
|
@@ -37,54 +71,56 @@ const styles = [
|
|
37
71
|
background-color: var(--mdc-radio-control-active-pressed-color);
|
38
72
|
}
|
39
73
|
|
74
|
+
/* Readonly state - disables pointer events but allows specific hover behavior */
|
75
|
+
:host([readonly]) {
|
76
|
+
pointer-events: none;
|
77
|
+
}
|
78
|
+
|
40
79
|
:host([readonly]:hover)::part(radio-icon) {
|
41
80
|
border-color: var(--mdc-staticradio-normal-border-color);
|
42
81
|
background-color: var(--mdc-staticradio-control-inactive-color);
|
43
82
|
}
|
44
83
|
|
45
|
-
:host([disabled]
|
46
|
-
|
47
|
-
border-color: var(--mdc-radio-disabled-border-color);
|
48
|
-
background-color: var(--mdc-radio-control-inactive-disabled-background);
|
49
|
-
}
|
50
|
-
|
51
|
-
:host([disabled][checked]:hover)::part(radio-icon) {
|
52
|
-
background-color: var(--mdc-radio-control-active-disabled-background);
|
84
|
+
:host([soft-disabled]) {
|
85
|
+
pointer-events: none;
|
53
86
|
}
|
54
87
|
|
55
|
-
|
88
|
+
/* Disabled states override interactive styles */
|
89
|
+
:host([disabled])::part(radio-input),
|
90
|
+
:host([soft-disabled])::part(radio-input),
|
91
|
+
:host([readonly])::part(radio-input),
|
92
|
+
:host([disabled])::part(label),
|
93
|
+
:host([soft-disabled])::part(label),
|
56
94
|
:host([readonly])::part(label) {
|
57
95
|
cursor: default;
|
58
96
|
}
|
59
97
|
|
60
|
-
:host
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
font-weight: var(--mds-font-apps-body-midsize-regular-font-weight);
|
66
|
-
line-height: var(--mds-font-apps-body-midsize-regular-line-height);
|
98
|
+
:host([disabled]:hover) mdc-staticradio,
|
99
|
+
:host([disabled]:active) mdc-staticradio,
|
100
|
+
:host([soft-disabled]:hover) mdc-staticradio,
|
101
|
+
:host([soft-disabled]:active) mdc-staticradio {
|
102
|
+
background-color: unset;
|
67
103
|
}
|
68
104
|
|
69
|
-
:host::part(radio-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
cursor: pointer;
|
76
|
-
z-index: 2;
|
105
|
+
:host([disabled]:hover)::part(radio-icon),
|
106
|
+
:host([soft-disabled]:hover)::part(radio-icon),
|
107
|
+
:host([disabled][readonly]:hover)::part(radio-icon),
|
108
|
+
:host([soft-disabled][readonly]:hover)::part(radio-icon) {
|
109
|
+
border-color: var(--mdc-radio-disabled-border-color);
|
110
|
+
background-color: var(--mdc-radio-control-inactive-disabled-background);
|
77
111
|
}
|
78
112
|
|
79
|
-
:host::part(
|
80
|
-
|
81
|
-
|
82
|
-
justify-content: center;
|
83
|
-
gap: 0.25rem;
|
84
|
-
flex: 1;
|
113
|
+
:host([disabled][checked]:hover)::part(radio-icon),
|
114
|
+
:host([soft-disabled][checked]:hover)::part(radio-icon) {
|
115
|
+
background-color: var(--mdc-radio-control-active-disabled-background);
|
85
116
|
}
|
86
|
-
|
87
|
-
|
117
|
+
|
118
|
+
:host([disabled])::part(label-text),
|
119
|
+
:host([disabled])::part(help-text),
|
120
|
+
:host([soft-disabled])::part(label),
|
121
|
+
:host([soft-disabled])::part(label-text),
|
122
|
+
:host([soft-disabled])::part(help-text) {
|
123
|
+
color: var(--mdc-radio-text-disabled-color);
|
88
124
|
}
|
89
125
|
`,
|
90
126
|
...hostFocusRingStyles(true),
|
@@ -71,11 +71,6 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
71
71
|
* The placeholder text which will be shown on the text if provided.
|
72
72
|
*/
|
73
73
|
placeholder?: string;
|
74
|
-
/**
|
75
|
-
* readonly attribute of the select field. If true, the select is read-only.
|
76
|
-
* @default false
|
77
|
-
*/
|
78
|
-
readonly: boolean;
|
79
74
|
/**
|
80
75
|
* The placement of the popover within Select component.
|
81
76
|
* This defines the position of the popover relative to the select input field.
|
@@ -86,14 +81,6 @@ declare class Select extends Select_base implements AssociatedFormControl {
|
|
86
81
|
* @default 'bottom-start'
|
87
82
|
*/
|
88
83
|
placement: Placement;
|
89
|
-
/**
|
90
|
-
* Indicates whether the select is soft disabled.
|
91
|
-
* When set to `true`, the select appears visually disabled but still allows
|
92
|
-
* focus.
|
93
|
-
*
|
94
|
-
* @default undefined
|
95
|
-
*/
|
96
|
-
softDisabled?: boolean;
|
97
84
|
/**
|
98
85
|
* This describes the clipping element(s) or area that overflow of the used popover will be checked relative to.
|
99
86
|
* The default is 'clippingAncestors', which are the overflow ancestors which will cause the
|
@@ -89,11 +89,6 @@ import styles from './select.styles';
|
|
89
89
|
class Select extends ListNavigationMixin(CaptureDestroyEventForChildElement(AutoFocusOnMountMixin(FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))))) {
|
90
90
|
constructor() {
|
91
91
|
super();
|
92
|
-
/**
|
93
|
-
* readonly attribute of the select field. If true, the select is read-only.
|
94
|
-
* @default false
|
95
|
-
*/
|
96
|
-
this.readonly = false;
|
97
92
|
/**
|
98
93
|
* The placement of the popover within Select component.
|
99
94
|
* This defines the position of the popover relative to the select input field.
|
@@ -619,18 +614,10 @@ __decorate([
|
|
619
614
|
property({ type: String }),
|
620
615
|
__metadata("design:type", String)
|
621
616
|
], Select.prototype, "placeholder", void 0);
|
622
|
-
__decorate([
|
623
|
-
property({ type: Boolean }),
|
624
|
-
__metadata("design:type", Object)
|
625
|
-
], Select.prototype, "readonly", void 0);
|
626
617
|
__decorate([
|
627
618
|
property({ type: String, reflect: true }),
|
628
619
|
__metadata("design:type", String)
|
629
620
|
], Select.prototype, "placement", void 0);
|
630
|
-
__decorate([
|
631
|
-
property({ type: Boolean, attribute: 'soft-disabled', reflect: true }),
|
632
|
-
__metadata("design:type", Boolean)
|
633
|
-
], Select.prototype, "softDisabled", void 0);
|
634
621
|
__decorate([
|
635
622
|
property({ type: String, reflect: true, attribute: 'boundary' }),
|
636
623
|
__metadata("design:type", String)
|
@@ -4,7 +4,7 @@ declare const StaticCheckbox_base: import("../../utils/mixins/index.types").Cons
|
|
4
4
|
/**
|
5
5
|
* This is a decorative component that is styled to look as a checkbox.
|
6
6
|
*
|
7
|
-
* It has
|
7
|
+
* It has 5 properties - checked, indeterminate, disabled, readonly and soft-disabled.
|
8
8
|
*
|
9
9
|
* We are using the same styling that has been created for the `mdc-checkbox` component.
|
10
10
|
*
|
@@ -40,6 +40,18 @@ declare class StaticCheckbox extends StaticCheckbox_base {
|
|
40
40
|
* @default false
|
41
41
|
*/
|
42
42
|
indeterminate: boolean;
|
43
|
+
/**
|
44
|
+
* Determines whether the checkbox is read-only.
|
45
|
+
*
|
46
|
+
* @default false
|
47
|
+
*/
|
48
|
+
readonly: boolean;
|
49
|
+
/**
|
50
|
+
* Determines whether the checkbox is soft-disabled.
|
51
|
+
*
|
52
|
+
* @default false
|
53
|
+
*/
|
54
|
+
softDisabled: boolean;
|
43
55
|
render(): import("lit-html").TemplateResult<1>;
|
44
56
|
static styles: Array<CSSResult>;
|
45
57
|
}
|