@momentum-design/components 0.104.12 → 0.104.14
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 +52 -49
- package/dist/browser/index.js.map +3 -3
- package/dist/components/checkbox/checkbox.component.js +1 -1
- package/dist/components/formfieldgroup/formfieldgroup.component.js +0 -2
- package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +6 -5
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +8 -10
- package/dist/components/input/input.component.js +1 -1
- package/dist/components/progressspinner/progressspinner.component.js +1 -1
- package/dist/components/progressspinner/progressspinner.styles.js +8 -5
- package/dist/components/radio/radio.component.js +1 -1
- package/dist/components/select/select.component.js +1 -1
- package/dist/components/textarea/textarea.component.js +1 -1
- package/dist/components/toggle/toggle.component.js +1 -1
- package/dist/custom-elements.json +0 -343
- package/dist/utils/mixins/FormInternalsMixin.js +0 -6
- package/package.json +1 -1
@@ -18,6 +18,12 @@ declare const FormfieldWrapper_base: import("../../utils/mixins/index.types").Co
|
|
18
18
|
*
|
19
19
|
*/
|
20
20
|
declare class FormfieldWrapper extends FormfieldWrapper_base {
|
21
|
+
/**
|
22
|
+
* Indicates the unique identifier for the native input element.
|
23
|
+
* Required for acccessibility.
|
24
|
+
* @internal
|
25
|
+
*/
|
26
|
+
protected inputId: string;
|
21
27
|
/**
|
22
28
|
* The label of the input field. It is linked to the input field using the `for` attribute.
|
23
29
|
*/
|
@@ -28,11 +34,6 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
|
|
28
34
|
* @default false
|
29
35
|
*/
|
30
36
|
required: boolean;
|
31
|
-
/**
|
32
|
-
* The unique id of the input field. It is used to link the input field with the label.
|
33
|
-
* @default ''
|
34
|
-
*/
|
35
|
-
id: string;
|
36
37
|
/**
|
37
38
|
* The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
|
38
39
|
*/
|
@@ -9,6 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
};
|
10
10
|
import { html, nothing } from 'lit';
|
11
11
|
import { property } from 'lit/decorators.js';
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
12
13
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
14
|
import { Component } from '../../models';
|
14
15
|
import { DisabledMixin } from '../../utils/mixins/DisabledMixin';
|
@@ -33,17 +34,18 @@ import { getHelperIcon } from './formfieldwrapper.utils';
|
|
33
34
|
class FormfieldWrapper extends DisabledMixin(Component) {
|
34
35
|
constructor() {
|
35
36
|
super(...arguments);
|
37
|
+
/**
|
38
|
+
* Indicates the unique identifier for the native input element.
|
39
|
+
* Required for acccessibility.
|
40
|
+
* @internal
|
41
|
+
*/
|
42
|
+
this.inputId = `mdc-el-${uuidv4()}`;
|
36
43
|
/**
|
37
44
|
* The required attribute to indicate that the input field is required.
|
38
45
|
* It is used to append a required indicator (*) to the label.
|
39
46
|
* @default false
|
40
47
|
*/
|
41
48
|
this.required = false;
|
42
|
-
/**
|
43
|
-
* The unique id of the input field. It is used to link the input field with the label.
|
44
|
-
* @default ''
|
45
|
-
*/
|
46
|
-
this.id = '';
|
47
49
|
/**
|
48
50
|
* The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
|
49
51
|
*/
|
@@ -66,7 +68,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
66
68
|
return nothing;
|
67
69
|
}
|
68
70
|
return this.shouldRenderLabel
|
69
|
-
? html `<label for="${this.
|
71
|
+
? html `<label for="${this.inputId}" id="${DEFAULTS.HEADING_ID}" class="mdc-label" part="label">${this.label}</label>`
|
70
72
|
: html ` <mdc-text
|
71
73
|
id="${DEFAULTS.HEADING_ID}"
|
72
74
|
tagname="${MDC_TEXT_OPTIONS.TAGNAME}"
|
@@ -163,10 +165,6 @@ __decorate([
|
|
163
165
|
property({ type: Boolean, reflect: true, attribute: 'required' }),
|
164
166
|
__metadata("design:type", Object)
|
165
167
|
], FormfieldWrapper.prototype, "required", void 0);
|
166
|
-
__decorate([
|
167
|
-
property({ type: String }),
|
168
|
-
__metadata("design:type", Object)
|
169
|
-
], FormfieldWrapper.prototype, "id", void 0);
|
170
168
|
__decorate([
|
171
169
|
property({ reflect: true, attribute: 'help-text-type' }),
|
172
170
|
__metadata("design:type", String)
|
@@ -284,7 +284,7 @@ class Input extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper)) {
|
|
284
284
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
285
285
|
class="input"
|
286
286
|
part="mdc-input"
|
287
|
-
id="${this.
|
287
|
+
id="${this.inputId}"
|
288
288
|
name="${this.name}"
|
289
289
|
.value="${live(this.value)}"
|
290
290
|
?disabled="${this.disabled}"
|
@@ -58,7 +58,7 @@ class Progressspinner extends Progressbar {
|
|
58
58
|
aria-valuemax="100"
|
59
59
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
60
60
|
>
|
61
|
-
<svg part="spinner-base">
|
61
|
+
<svg part="spinner-base" viewBox="0 0 48 48">
|
62
62
|
<circle
|
63
63
|
part="spinner-track"
|
64
64
|
cx="24"
|
@@ -11,14 +11,14 @@ const styles = css `
|
|
11
11
|
}
|
12
12
|
|
13
13
|
:host::part(spinner-container) {
|
14
|
-
width:
|
15
|
-
height:
|
14
|
+
width: var(--mdc-spinner-size);
|
15
|
+
height: var(--mdc-spinner-size);
|
16
16
|
position: relative;
|
17
17
|
}
|
18
18
|
|
19
19
|
:host::part(spinner-base) {
|
20
|
-
width:
|
21
|
-
height:
|
20
|
+
width: 100%;
|
21
|
+
height: 100%;
|
22
22
|
rotate: -90deg;
|
23
23
|
}
|
24
24
|
|
@@ -36,12 +36,15 @@ const styles = css `
|
|
36
36
|
}
|
37
37
|
|
38
38
|
:host::part(success-icon) {
|
39
|
+
--mdc-icon-size: var(--mdc-spinner-size);
|
39
40
|
color: var(--mdc-progress-success-color);
|
40
41
|
}
|
41
42
|
|
42
43
|
:host::part(error-icon) {
|
44
|
+
--mdc-icon-size: calc(2 / 3 * var(--mdc-spinner-size));
|
45
|
+
|
43
46
|
color: var(--mdc-progress-error-color);
|
44
|
-
margin:
|
47
|
+
margin: calc(1 / 6 * var(--mdc-spinner-size));
|
45
48
|
}
|
46
49
|
`;
|
47
50
|
export default [styles];
|
@@ -280,7 +280,7 @@ class Textarea extends FormInternalsMixin(DataAriaLabelMixin(FormfieldWrapper))
|
|
280
280
|
<textarea
|
281
281
|
aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
|
282
282
|
part="textarea"
|
283
|
-
id="${this.
|
283
|
+
id="${this.inputId}"
|
284
284
|
name="${this.name}"
|
285
285
|
.value="${this.value}"
|
286
286
|
?disabled="${this.disabled}"
|