@uh-design-system/component-library 0.5.1 → 0.5.3
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/component-library.cjs.js +2 -2
- package/dist/cjs/{controlUtils-041de0fd.js → controlUtils-8bf55ef0.js} +1 -1
- package/dist/cjs/{ds-accordion_3.cjs.entry.js → ds-accordion_5.cjs.entry.js} +122 -24
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +39 -30
- package/dist/cjs/ds-checkbox.cjs.entry.js +33 -28
- package/dist/cjs/ds-input-validity.cjs.entry.js +4 -4
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +5 -6
- package/dist/cjs/ds-link.cjs.entry.js +5 -6
- package/dist/cjs/ds-radio-button-group.cjs.entry.js +111 -0
- package/dist/cjs/ds-radio-button.cjs.entry.js +150 -0
- package/dist/cjs/ds-text-input.cjs.entry.js +15 -10
- package/dist/cjs/{index-bf84b124.js → index-947af833.js} +36 -4
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{store-9bd20f3c.js → store-e8e87298.js} +1 -1
- package/dist/cjs/{attributes-5f5b58be.js → utils-3412cbed.js} +41 -2
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/00-foundations/icons/categories/actions.js +2 -0
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +12 -12
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +11 -13
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +98 -87
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +92 -6
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +66 -0
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +3 -0
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +31 -20
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +31 -47
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +1 -1
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +52 -26
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +74 -18
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +1 -1
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +2 -2
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +1 -1
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +12 -12
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +1 -1
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +10 -10
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +1 -1
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +116 -0
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +468 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +70 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +36 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +31 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +287 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +51 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +58 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +59 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +309 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.js +221 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.js +122 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.js +107 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.stories.js +59 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +38 -38
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +12 -6
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +2 -2
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.css +1 -1
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/utils/attributes/attributes.js +14 -3
- package/dist/collection/utils/button/buttonUtils.js +14 -0
- package/dist/collection/utils/colours/colourTypes.js +3 -3
- package/dist/collection/utils/colours/colourUtils.js +5 -3
- package/dist/collection/utils/controls/controlUtils.js +1 -1
- package/dist/collection/utils/spinner/spinnerUtils.js +20 -0
- package/dist/collection/utils/tests/testUtils.js +1 -0
- package/dist/collection/utils/typography/typographyUtils.js +3 -3
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/controlUtils-c2ba44bd.js +1 -0
- package/dist/component-library/ds-accordion_5.entry.js +1 -0
- package/dist/component-library/ds-checkbox-group.entry.js +1 -1
- package/dist/component-library/ds-checkbox.entry.js +1 -1
- package/dist/component-library/ds-input-validity.entry.js +1 -1
- package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
- package/dist/component-library/ds-link.entry.js +1 -1
- package/dist/component-library/ds-radio-button-group.entry.js +1 -0
- package/dist/component-library/ds-radio-button.entry.js +1 -0
- package/dist/component-library/ds-text-input.entry.js +1 -1
- package/dist/component-library/index-84fd0ee9.js +2 -0
- package/dist/component-library/index.esm.js +1 -1
- package/dist/component-library/{store-b8d17c10.js → store-73a56075.js} +1 -1
- package/dist/component-library/{attributes-7d09be1b.js → utils-cfc536bc.js} +1 -1
- package/dist/components/attributes.js +15 -3
- package/dist/components/controlUtils.js +1 -1
- package/dist/components/ds-accordion.js +28 -18
- package/dist/components/ds-button2.js +51 -9
- package/dist/components/ds-checkbox-group.js +38 -27
- package/dist/components/ds-checkbox2.js +33 -26
- package/dist/components/ds-icon2.js +4 -1
- package/dist/components/ds-input-validity2.js +2 -2
- package/dist/components/ds-link-with-arrow.js +2 -2
- package/dist/components/ds-link.js +2 -2
- package/dist/components/ds-radio-button-group.d.ts +11 -0
- package/dist/components/ds-radio-button-group.js +147 -0
- package/dist/components/ds-radio-button.d.ts +11 -0
- package/dist/components/ds-radio-button.js +196 -0
- package/dist/components/ds-spinner.d.ts +11 -0
- package/dist/components/ds-spinner.js +6 -0
- package/dist/components/ds-spinner2.js +90 -0
- package/dist/components/ds-text-input.js +25 -13
- package/dist/components/ds-visually-hidden2.js +2 -2
- package/dist/components/index2.js +36 -5
- package/dist/esm/component-library.js +3 -3
- package/dist/esm/controlUtils-c2ba44bd.js +4 -0
- package/dist/esm/{ds-accordion_3.entry.js → ds-accordion_5.entry.js} +120 -24
- package/dist/esm/ds-checkbox-group.entry.js +38 -29
- package/dist/esm/ds-checkbox.entry.js +33 -28
- package/dist/esm/ds-input-validity.entry.js +4 -4
- package/dist/esm/ds-link-with-arrow.entry.js +4 -5
- package/dist/esm/ds-link.entry.js +4 -5
- package/dist/esm/ds-radio-button-group.entry.js +107 -0
- package/dist/esm/ds-radio-button.entry.js +146 -0
- package/dist/esm/ds-text-input.entry.js +15 -10
- package/dist/esm/{index-434995e1.js → index-84fd0ee9.js} +36 -5
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{store-b8d17c10.js → store-73a56075.js} +1 -1
- package/dist/esm/{attributes-7d09be1b.js → utils-cfc536bc.js} +38 -3
- package/dist/styles/helpers.css +7 -0
- package/dist/styles/helpers.css.map +1 -0
- package/dist/styles/mixins/_breakpoints.scss +14 -0
- package/dist/styles/mixins/_focus.scss +28 -0
- package/dist/styles/mixins/_wrapper.scss +5 -0
- package/dist/styles/mixins/imports-default/_imports.scss +2 -0
- package/dist/styles/mixins/tokens/_breakpoints.scss +13 -0
- package/dist/styles/mixins/tokens/_semantic-colours.scss +75 -0
- package/dist/styles/mixins.scss +10 -0
- package/dist/styles/variables.css +168 -0
- package/dist/styles/variables.css.map +1 -0
- package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +5 -0
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +6 -10
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +5 -4
- package/dist/types/components/01-base-components/ds-radio-button/ds-radio-button.d.ts +44 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.d.ts +15 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/ds-radio-button-group.d.ts +24 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.d.ts +6 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.d.ts +10 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/ds-spinner.d.ts +17 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +2 -1
- package/dist/types/components.d.ts +135 -20
- package/dist/types/utils/attributes/attributes.d.ts +2 -1
- package/dist/types/utils/button/buttonUtils.d.ts +1 -0
- package/dist/types/utils/colours/colourTypes.d.ts +3 -3
- package/dist/types/utils/spinner/spinnerUtils.d.ts +1 -0
- package/dist/types/utils/tests/testUtils.d.ts +1 -0
- package/package.json +15 -15
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +0 -20
- package/dist/cjs/utils-2ba5e075.js +0 -28
- package/dist/component-library/controlUtils-9ca4087b.js +0 -1
- package/dist/component-library/ds-accordion_3.entry.js +0 -1
- package/dist/component-library/ds-visually-hidden.entry.js +0 -1
- package/dist/component-library/index-434995e1.js +0 -2
- package/dist/component-library/utils-5daa5bc0.js +0 -1
- package/dist/esm/controlUtils-9ca4087b.js +0 -4
- package/dist/esm/ds-visually-hidden.entry.js +0 -16
- package/dist/esm/utils-5daa5bc0.js +0 -24
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--ds-breakpoint-xSmall: 20rem;
|
|
3
|
+
--ds-breakpoint-small: 30rem;
|
|
4
|
+
--ds-breakpoint-medium: 60rem;
|
|
5
|
+
--ds-breakpoint-large: 75rem;
|
|
6
|
+
--ds-breakpoint-xLarge: 90rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
.ds-checkbox-fieldset {
|
|
2
10
|
display: inline-flex;
|
|
3
11
|
flex-direction: column;
|
|
@@ -16,17 +24,19 @@
|
|
|
16
24
|
.ds-checkbox-fieldset__assistive-text {
|
|
17
25
|
display: inline;
|
|
18
26
|
font-size: var(--ds-fontSize-14);
|
|
19
|
-
color: var(--ds-
|
|
27
|
+
color: var(--ds-palette-black-70);
|
|
20
28
|
line-height: var(--ds-lineHeight-large);
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
.ds-checkbox {
|
|
24
32
|
display: inline-flex;
|
|
25
33
|
align-self: flex-start;
|
|
26
|
-
align-items:
|
|
34
|
+
align-items: flex-start;
|
|
27
35
|
flex-direction: row;
|
|
28
36
|
flex-wrap: nowrap;
|
|
29
37
|
text-wrap: wrap;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
white-space: normal;
|
|
30
40
|
position: relative;
|
|
31
41
|
cursor: pointer;
|
|
32
42
|
user-select: none;
|
|
@@ -37,10 +47,10 @@
|
|
|
37
47
|
margin-right: 0;
|
|
38
48
|
}
|
|
39
49
|
.ds-checkbox--disabled {
|
|
40
|
-
color: var(--ds-
|
|
50
|
+
color: var(--ds-palette-black-40);
|
|
41
51
|
}
|
|
42
52
|
.ds-checkbox__span--optional {
|
|
43
|
-
color: var(--ds-
|
|
53
|
+
color: var(--ds-palette-black-70);
|
|
44
54
|
font-size: var(--ds-fontSize-14);
|
|
45
55
|
}
|
|
46
56
|
.ds-checkbox:has(.ds-checkbox__input:disabled) {
|
|
@@ -52,13 +62,14 @@
|
|
|
52
62
|
-webkit-appearance: none;
|
|
53
63
|
appearance: none;
|
|
54
64
|
/* For iOS < 15 to remove gradient background */
|
|
55
|
-
background-color: var(--ds-
|
|
65
|
+
background-color: var(--ds-palette-white);
|
|
56
66
|
/* Not removed via appearance */
|
|
57
67
|
margin: 0;
|
|
58
68
|
display: grid;
|
|
59
69
|
place-content: center;
|
|
60
70
|
height: 24px;
|
|
61
71
|
width: 24px;
|
|
72
|
+
flex-shrink: 0;
|
|
62
73
|
margin-right: var(--ds-spacing-xSmall);
|
|
63
74
|
border-width: var(--ds-borderWidth-thin);
|
|
64
75
|
border-style: solid;
|
|
@@ -69,24 +80,24 @@
|
|
|
69
80
|
/** checkmark **/
|
|
70
81
|
}
|
|
71
82
|
.ds-checkbox__input:focus-visible {
|
|
72
|
-
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-
|
|
73
|
-
outline-color: var(--ds-
|
|
74
|
-
outline-offset: var(--ds-borderWidth-thin);
|
|
83
|
+
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
|
|
84
|
+
outline-color: var(--ds-palette-black-95);
|
|
85
|
+
outline-offset: calc(var(--ds-borderWidth-thin) * 1);
|
|
75
86
|
outline-style: solid;
|
|
76
87
|
outline-width: var(--ds-borderWidth-thin);
|
|
77
88
|
}
|
|
78
89
|
.ds-checkbox__input:hover, .ds-checkbox__input:active {
|
|
79
|
-
border-color: var(--ds-
|
|
90
|
+
border-color: var(--ds-palette-black-50);
|
|
80
91
|
}
|
|
81
92
|
.ds-checkbox__input:hover {
|
|
82
|
-
background-color: var(--ds-
|
|
93
|
+
background-color: var(--ds-palette-black-10);
|
|
83
94
|
}
|
|
84
95
|
.ds-checkbox__input:active {
|
|
85
|
-
background-color: var(--ds-
|
|
96
|
+
background-color: var(--ds-palette-black-20);
|
|
86
97
|
}
|
|
87
98
|
.ds-checkbox__input:disabled {
|
|
88
|
-
background-color: var(--ds-
|
|
89
|
-
border-color: var(--ds-
|
|
99
|
+
background-color: var(--ds-overlay-black-10);
|
|
100
|
+
border-color: var(--ds-overlay-black-15);
|
|
90
101
|
}
|
|
91
102
|
@media (forced-colors: active) {
|
|
92
103
|
.ds-checkbox__input:disabled {
|
|
@@ -94,24 +105,24 @@
|
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
.ds-checkbox__input:checked, .ds-checkbox__input:indeterminate {
|
|
97
|
-
background-color: var(--ds-
|
|
98
|
-
border-color: var(--ds-
|
|
108
|
+
background-color: var(--ds-palette-mainBlue-70);
|
|
109
|
+
border-color: var(--ds-overlay-black-00);
|
|
99
110
|
}
|
|
100
111
|
.ds-checkbox__input:checked:hover, .ds-checkbox__input:indeterminate:hover {
|
|
101
|
-
background-color: var(--ds-
|
|
112
|
+
background-color: var(--ds-palette-mainBlue-80);
|
|
102
113
|
}
|
|
103
114
|
.ds-checkbox__input:checked:active, .ds-checkbox__input:indeterminate:active {
|
|
104
|
-
background-color: var(--ds-
|
|
115
|
+
background-color: var(--ds-palette-mainBlue-90);
|
|
105
116
|
}
|
|
106
117
|
.ds-checkbox__input:checked:disabled, .ds-checkbox__input:indeterminate:disabled {
|
|
107
|
-
background-color: var(--ds-
|
|
118
|
+
background-color: var(--ds-overlay-black-10);
|
|
108
119
|
}
|
|
109
120
|
.ds-checkbox__input:user-invalid, .ds-checkbox__input--invalid, .ds-checkbox__input--invalid:checked, .ds-checkbox__input--invalid:indeterminate {
|
|
110
|
-
border-color: var(--ds-
|
|
121
|
+
border-color: var(--ds-palette-red-50);
|
|
111
122
|
}
|
|
112
123
|
.ds-checkbox__input:disabled {
|
|
113
124
|
cursor: not-allowed;
|
|
114
|
-
color: var(--ds-
|
|
125
|
+
color: var(--ds-palette-black-40);
|
|
115
126
|
}
|
|
116
127
|
.ds-checkbox__input::before {
|
|
117
128
|
content: "";
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { Fragment, h } from "@stencil/core";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { inheritAriaAttributes } from "../../../utils/attributes/attributes";
|
|
3
|
+
import { inheritAriaAttributes, inheritAttributes } from "../../../utils/attributes/attributes";
|
|
4
4
|
import { getOptionalText, getRequiredText } from "../../../utils/controls/controlUtils";
|
|
5
5
|
import { isValidation } from "../../../store";
|
|
6
6
|
import { getAriaLabel, idGenerator } from "../../../utils/utils";
|
|
7
7
|
const checkboxIdGenerator = idGenerator('ds-checkbox');
|
|
8
8
|
export class DsCheckbox {
|
|
9
|
+
checkboxGroup = null;
|
|
9
10
|
inputElem;
|
|
10
11
|
labelId;
|
|
11
12
|
inputValidityId;
|
|
12
13
|
assistiveTextId;
|
|
13
14
|
inheritedAttributes = {};
|
|
14
|
-
initialChecked;
|
|
15
15
|
labelClicked = false;
|
|
16
16
|
el;
|
|
17
17
|
internals;
|
|
18
|
-
dsCheckboxInput;
|
|
19
18
|
identifier = checkboxIdGenerator.next().value;
|
|
20
19
|
checked = false;
|
|
21
20
|
legend;
|
|
@@ -29,7 +28,8 @@ export class DsCheckbox {
|
|
|
29
28
|
optional = false;
|
|
30
29
|
optionalText;
|
|
31
30
|
ariaLabel;
|
|
32
|
-
|
|
31
|
+
invalid = !!this.errorText;
|
|
32
|
+
initialChecked = this.checked;
|
|
33
33
|
validationMessage;
|
|
34
34
|
setIds = () => {
|
|
35
35
|
this.labelId = `${this.identifier}-label`;
|
|
@@ -59,24 +59,33 @@ export class DsCheckbox {
|
|
|
59
59
|
return this.text;
|
|
60
60
|
};
|
|
61
61
|
getAriaDescribedBy = () => [Boolean(this.assistiveText) && this.assistiveTextId, Boolean(this.getValidationMessage()) && this.inputValidityId].filter(Boolean).join(' ');
|
|
62
|
-
|
|
62
|
+
formResetCallback() {
|
|
63
63
|
this.checked = this.initialChecked;
|
|
64
|
-
this.value = this.checked.toString();
|
|
65
64
|
this.internals?.setValidity({});
|
|
66
|
-
this.internals?.setFormValue(this.
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
this.internals?.setFormValue(this.checked.toString());
|
|
66
|
+
}
|
|
67
|
+
connectedCallback() {
|
|
68
|
+
this.checkboxGroup = this.el.closest('ds-checkbox-group');
|
|
69
|
+
if (this.checkboxGroup) {
|
|
70
|
+
this.invalid = !!this.checkboxGroup.errorText;
|
|
71
|
+
this.checkboxGroup.addEventListener('dsCheckboxGroupInvalidStateChange', this.updateInvalidState);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
disconnectedCallback() {
|
|
75
|
+
if (this.checkboxGroup) {
|
|
76
|
+
this.checkboxGroup.removeEventListener('dsCheckboxGroupInvalidStateChange', this.updateInvalidState);
|
|
77
|
+
}
|
|
78
|
+
this.checkboxGroup = null;
|
|
75
79
|
}
|
|
80
|
+
updateInvalidState = (e) => {
|
|
81
|
+
this.invalid = e.detail;
|
|
82
|
+
};
|
|
76
83
|
componentWillLoad() {
|
|
77
|
-
this.setInitialState();
|
|
78
84
|
this.setIds();
|
|
79
|
-
this.inheritedAttributes =
|
|
85
|
+
this.inheritedAttributes = {
|
|
86
|
+
...inheritAriaAttributes(this.el, ['aria-label', 'aria-describedby', 'aria-hidden', 'aria-invalid']),
|
|
87
|
+
...inheritAttributes(this, this.el),
|
|
88
|
+
};
|
|
80
89
|
if (isValidation('server') || this.errorText) {
|
|
81
90
|
this.validationMessage = this.getValidationMessage();
|
|
82
91
|
}
|
|
@@ -84,9 +93,7 @@ export class DsCheckbox {
|
|
|
84
93
|
handleInput = (e) => {
|
|
85
94
|
const target = e.target;
|
|
86
95
|
this.checked = target.checked;
|
|
87
|
-
this.
|
|
88
|
-
this.internals?.setFormValue(this.value);
|
|
89
|
-
this.dsCheckboxInput.emit({ id: this.identifier, checked: target.checked });
|
|
96
|
+
this.internals?.setFormValue(target.checked.toString());
|
|
90
97
|
if (isValidation('client') && this.validationMessage) {
|
|
91
98
|
this.validationMessage = this.getValidationMessage();
|
|
92
99
|
}
|
|
@@ -114,13 +121,13 @@ export class DsCheckbox {
|
|
|
114
121
|
'ds-checkbox--no-margin': Boolean(!this.text),
|
|
115
122
|
});
|
|
116
123
|
const inputClasses = classNames('ds-checkbox__input', {
|
|
117
|
-
'ds-checkbox__input--invalid': Boolean(this.errorText),
|
|
124
|
+
'ds-checkbox__input--invalid': Boolean(this.errorText) || this.invalid,
|
|
118
125
|
});
|
|
119
126
|
const errorClasses = classNames('ds-checkbox-error', {
|
|
120
127
|
'ds-checkbox-error--visible': Boolean(this.validationMessage),
|
|
121
128
|
});
|
|
122
129
|
const ariaDescribedBy = this.getAriaDescribedBy();
|
|
123
|
-
return (h(Fragment, null, h("div", null, h("label", { id: this.labelId, class: classes, onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp }, h("input", { ref: inputElem => (this.inputElem = inputElem), type: "checkbox", class: inputClasses, checked: this.checked, indeterminate: this.indeterminate, onInput: this.handleInput, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, value: this.
|
|
130
|
+
return (h(Fragment, null, h("div", null, h("label", { id: this.labelId, class: classes, onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp }, h("input", { ref: inputElem => (this.inputElem = inputElem), type: "checkbox", class: inputClasses, checked: this.checked, indeterminate: this.indeterminate, onInput: this.handleInput, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, value: this.checked.toString(), disabled: this.disabled, required: this.required, id: this.identifier, "aria-describedby": ariaDescribedBy, "aria-label": getAriaLabel(this.getCheckboxText(), this.ariaLabel), "aria-invalid": this.errorText ? true : undefined, ...this.inheritedAttributes }), this.getCheckboxText())), !this.errorsDisabled && (h("div", { class: errorClasses }, h("ds-input-validity", { id: this.inputValidityId, text: this.validationMessage, type: "error", role: "alert" })))));
|
|
124
131
|
}
|
|
125
132
|
renderFieldset() {
|
|
126
133
|
const fieldsetClasses = classNames('ds-checkbox-fieldset');
|
|
@@ -408,34 +415,11 @@ export class DsCheckbox {
|
|
|
408
415
|
}
|
|
409
416
|
static get states() {
|
|
410
417
|
return {
|
|
411
|
-
"
|
|
418
|
+
"invalid": {},
|
|
419
|
+
"initialChecked": {},
|
|
412
420
|
"validationMessage": {}
|
|
413
421
|
};
|
|
414
422
|
}
|
|
415
|
-
static get events() {
|
|
416
|
-
return [{
|
|
417
|
-
"method": "dsCheckboxInput",
|
|
418
|
-
"name": "dsCheckboxInput",
|
|
419
|
-
"bubbles": true,
|
|
420
|
-
"cancelable": true,
|
|
421
|
-
"composed": true,
|
|
422
|
-
"docs": {
|
|
423
|
-
"tags": [],
|
|
424
|
-
"text": ""
|
|
425
|
-
},
|
|
426
|
-
"complexType": {
|
|
427
|
-
"original": "DsCheckboxInputEvent",
|
|
428
|
-
"resolved": "DsCheckboxInputEvent",
|
|
429
|
-
"references": {
|
|
430
|
-
"DsCheckboxInputEvent": {
|
|
431
|
-
"location": "local",
|
|
432
|
-
"path": "/Users/teemuparssinen/hy/uh-design-system/component-library/packages/component-library/src/components/01-base-components/ds-checkbox/ds-checkbox.tsx",
|
|
433
|
-
"id": "src/components/01-base-components/ds-checkbox/ds-checkbox.tsx::DsCheckboxInputEvent"
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}];
|
|
438
|
-
}
|
|
439
423
|
static get elementRef() { return "el"; }
|
|
440
424
|
static get attachInternalsMemberName() { return "internals"; }
|
|
441
425
|
}
|
package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js
CHANGED
|
@@ -4,6 +4,7 @@ import { inheritAriaAttributes } from "../../../utils/attributes/attributes";
|
|
|
4
4
|
import { idGenerator } from "../../../utils/utils";
|
|
5
5
|
const fieldsetIdGenerator = idGenerator('ds-checkbox-group');
|
|
6
6
|
export class DsCheckboxGroup {
|
|
7
|
+
checkboxElem;
|
|
7
8
|
fieldsetId = fieldsetIdGenerator.next().value;
|
|
8
9
|
checkboxId = `${this.fieldsetId}-checkbox`;
|
|
9
10
|
errorTextId = `${this.fieldsetId}-error`;
|
|
@@ -13,6 +14,7 @@ export class DsCheckboxGroup {
|
|
|
13
14
|
el;
|
|
14
15
|
dsCheckboxGroupChange;
|
|
15
16
|
dsCheckboxGroupIndeterminateChildChange;
|
|
17
|
+
dsCheckboxGroupInvalidStateChange;
|
|
16
18
|
legend;
|
|
17
19
|
assistiveText;
|
|
18
20
|
direction = 'vertical';
|
|
@@ -20,7 +22,7 @@ export class DsCheckboxGroup {
|
|
|
20
22
|
text = '';
|
|
21
23
|
checked = false;
|
|
22
24
|
disabled = false;
|
|
23
|
-
childElementsCount =
|
|
25
|
+
childElementsCount = 1;
|
|
24
26
|
checkedChildElementCount = 0;
|
|
25
27
|
isIndeterminate = false;
|
|
26
28
|
indeterminateChildCheckboxCount = 0;
|
|
@@ -66,55 +68,61 @@ export class DsCheckboxGroup {
|
|
|
66
68
|
watchIndeterminateChange(newValue) {
|
|
67
69
|
this.dsCheckboxGroupIndeterminateChildChange.emit({ id: this.fieldsetId, indeterminate: newValue });
|
|
68
70
|
}
|
|
71
|
+
errorTextObserver(errorText) {
|
|
72
|
+
this.dsCheckboxGroupInvalidStateChange.emit(!!errorText);
|
|
73
|
+
}
|
|
69
74
|
listenIndeterminateChildChange(event) {
|
|
70
75
|
this.indeterminateChildCheckboxCount = event.detail.indeterminate ? this.indeterminateChildCheckboxCount + 1 : this.indeterminateChildCheckboxCount - 1;
|
|
71
76
|
}
|
|
72
|
-
watchCheckedChildElementCountChange(
|
|
73
|
-
this.isIndeterminate =
|
|
74
|
-
this.checkedChildElementCount !== this.childElementsCount && this.checkedChildElementCount < this.childElementsCount && this.checkedChildElementCount > 0;
|
|
75
|
-
if (newValue === this.childElementsCount && newValue > oldValue) {
|
|
76
|
-
this.dsCheckboxGroupChange.emit({ id: this.fieldsetId, checked: true });
|
|
77
|
-
}
|
|
78
|
-
else if (oldValue === this.childElementsCount && newValue < oldValue) {
|
|
79
|
-
this.dsCheckboxGroupChange.emit({ id: this.fieldsetId, checked: false });
|
|
80
|
-
}
|
|
77
|
+
watchCheckedChildElementCountChange() {
|
|
78
|
+
this.isIndeterminate = this.checkedChildElementCount > 0 && this.checkedChildElementCount < this.childElementsCount;
|
|
81
79
|
}
|
|
82
|
-
updateCheckedChildElementCount = (
|
|
83
|
-
if (
|
|
84
|
-
this.checkedChildElementCount =
|
|
80
|
+
updateCheckedChildElementCount = (checked) => {
|
|
81
|
+
if (checked) {
|
|
82
|
+
this.checkedChildElementCount = Math.min(this.childElementsCount, this.checkedChildElementCount + 1);
|
|
85
83
|
}
|
|
86
84
|
else {
|
|
87
|
-
this.checkedChildElementCount =
|
|
85
|
+
this.checkedChildElementCount = Math.max(0, this.checkedChildElementCount - 1);
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
88
|
listenCheckboxChange(event) {
|
|
91
|
-
if (event.
|
|
92
|
-
this.updateChildElementsChecked(
|
|
89
|
+
if (event.target === this.el) {
|
|
90
|
+
this.updateChildElementsChecked(this.checkboxElem.checked);
|
|
91
|
+
this.dsCheckboxGroupChange.emit({ id: this.fieldsetId, checked: this.checkboxElem.checked });
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
const target = event.target;
|
|
95
|
+
if (this.getChildCheckboxElements().includes(target)) {
|
|
96
|
+
const previousCheckedChildElementCount = this.checkedChildElementCount;
|
|
97
|
+
this.updateCheckedChildElementCount(target.checked);
|
|
98
|
+
if (this.checkedChildElementCount === this.childElementsCount && this.checkedChildElementCount > previousCheckedChildElementCount) {
|
|
99
|
+
this.dsCheckboxGroupChange.emit({ id: this.fieldsetId, checked: true });
|
|
100
|
+
}
|
|
101
|
+
else if (previousCheckedChildElementCount === this.childElementsCount && this.checkedChildElementCount < previousCheckedChildElementCount) {
|
|
102
|
+
this.dsCheckboxGroupChange.emit({ id: this.fieldsetId, checked: false });
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
listenCheckboxGroupChange(event) {
|
|
100
107
|
if (this.getChildElements().includes(event.target)) {
|
|
101
|
-
|
|
108
|
+
event.stopPropagation();
|
|
109
|
+
this.updateCheckedChildElementCount(event.detail.checked);
|
|
102
110
|
}
|
|
103
111
|
}
|
|
104
|
-
setChildElementCount = () => {
|
|
105
|
-
this.childElementsCount = this.getChildElements().length;
|
|
106
|
-
};
|
|
107
112
|
componentWillLoad() {
|
|
108
113
|
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-labelledby']);
|
|
109
114
|
}
|
|
110
115
|
componentDidLoad() {
|
|
111
|
-
this.
|
|
116
|
+
this.childElementsCount = this.getChildElements().length;
|
|
112
117
|
this.updateChildCheckboxes(element => {
|
|
113
118
|
element.setAttribute('data-errors-disabled', 'true');
|
|
114
119
|
});
|
|
115
120
|
}
|
|
116
121
|
componentDidUpdate() {
|
|
117
|
-
this.
|
|
122
|
+
const childElementCount = this.getChildElements().length;
|
|
123
|
+
if (this.childElementsCount !== childElementCount) {
|
|
124
|
+
this.childElementsCount = childElementCount;
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
127
|
render() {
|
|
120
128
|
const classes = classNames('ds-checkbox-group', {
|
|
@@ -128,7 +136,7 @@ export class DsCheckboxGroup {
|
|
|
128
136
|
const nestedClasses = classNames('ds-checkbox-group', 'ds-checkbox-group--inset');
|
|
129
137
|
const checkboxesClasses = classNames('ds-checkbox-group__checkboxes');
|
|
130
138
|
const ariaDescribedBy = this.getAriaDescribedBy();
|
|
131
|
-
return (h("fieldset", { key: '
|
|
139
|
+
return (h("fieldset", { key: '25b932a80cf1b2c7467ef5ea012661992cb88853', id: this.fieldsetId, class: classes, "aria-describedby": ariaDescribedBy, ...this.inheritedAttributes }, this.legend && h("legend", { key: 'e96b23987622f5df0144a9499122f7afba552648', class: legendClasses }, this.legend), this.assistiveText && (h("small", { key: 'ae3fb6f287dd518ad911391054f6ed4de7e8ea6f', class: assistiveTextClasses, id: this.assistiveTextId }, this.assistiveText)), this.text ? (h(Fragment, null, h("ds-checkbox", { ref: checkboxElem => (this.checkboxElem = checkboxElem), id: this.checkboxId, text: this.text, checked: this.checkedChildElementCount === this.childElementsCount, disabled: this.disabled, indeterminate: this.indeterminateChildCheckboxCount > 0 || this.isIndeterminate }), h("fieldset", { id: this.nestedId, "aria-labelledby": this.checkboxId, class: nestedClasses }, h("slot", null)))) : (h("div", { class: checkboxesClasses }, h("slot", null))), h("div", { key: 'd2719bdb242a526af73e628d2ce7bca234c94961', class: errorClasses }, h("ds-input-validity", { key: 'a31a78918c1894bd8f68207c3ea3f9df984bd52b', id: this.errorTextId, text: this.errorText, type: "error" }))));
|
|
132
140
|
}
|
|
133
141
|
static get is() { return "ds-checkbox-group"; }
|
|
134
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -335,6 +343,21 @@ export class DsCheckboxGroup {
|
|
|
335
343
|
}
|
|
336
344
|
}
|
|
337
345
|
}
|
|
346
|
+
}, {
|
|
347
|
+
"method": "dsCheckboxGroupInvalidStateChange",
|
|
348
|
+
"name": "dsCheckboxGroupInvalidStateChange",
|
|
349
|
+
"bubbles": true,
|
|
350
|
+
"cancelable": true,
|
|
351
|
+
"composed": true,
|
|
352
|
+
"docs": {
|
|
353
|
+
"tags": [],
|
|
354
|
+
"text": ""
|
|
355
|
+
},
|
|
356
|
+
"complexType": {
|
|
357
|
+
"original": "boolean",
|
|
358
|
+
"resolved": "boolean",
|
|
359
|
+
"references": {}
|
|
360
|
+
}
|
|
338
361
|
}];
|
|
339
362
|
}
|
|
340
363
|
static get methods() {
|
|
@@ -376,6 +399,9 @@ export class DsCheckboxGroup {
|
|
|
376
399
|
}, {
|
|
377
400
|
"propName": "isIndeterminate",
|
|
378
401
|
"methodName": "watchIndeterminateChange"
|
|
402
|
+
}, {
|
|
403
|
+
"propName": "errorText",
|
|
404
|
+
"methodName": "errorTextObserver"
|
|
379
405
|
}, {
|
|
380
406
|
"propName": "checkedChildElementCount",
|
|
381
407
|
"methodName": "watchCheckedChildElementCountChange"
|
|
@@ -389,7 +415,7 @@ export class DsCheckboxGroup {
|
|
|
389
415
|
"capture": false,
|
|
390
416
|
"passive": false
|
|
391
417
|
}, {
|
|
392
|
-
"name": "
|
|
418
|
+
"name": "input",
|
|
393
419
|
"method": "listenCheckboxChange",
|
|
394
420
|
"target": undefined,
|
|
395
421
|
"capture": false,
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
+
import { getShadowRoot } from "../../../../utils/tests/testUtils";
|
|
3
|
+
import { expect, userEvent, waitFor } from "@storybook/test";
|
|
2
4
|
const meta = {
|
|
3
5
|
title: 'Base Components/CheckboxGroup/Features',
|
|
4
6
|
component: 'ds-checkbox-group',
|
|
5
|
-
render:
|
|
6
|
-
<ds-checkbox-group
|
|
7
|
-
legend=${args.legend}
|
|
8
|
-
assistive-text=${args.assistiveText}
|
|
9
|
-
direction=${args.direction}
|
|
10
|
-
error-text=${args.errorText}
|
|
11
|
-
>
|
|
7
|
+
render: args => html `
|
|
8
|
+
<ds-checkbox-group legend=${args.legend} assistive-text=${args.assistiveText} direction=${args.direction} error-text=${args.errorText}>
|
|
12
9
|
<ds-checkbox text="Value text"></ds-checkbox>
|
|
13
10
|
<ds-checkbox text="Value text"></ds-checkbox>
|
|
14
11
|
<ds-checkbox text="Value text"></ds-checkbox>
|
|
@@ -52,12 +49,8 @@ export const Nested = {
|
|
|
52
49
|
checked: false,
|
|
53
50
|
disabled: false,
|
|
54
51
|
},
|
|
55
|
-
render:
|
|
56
|
-
<ds-checkbox-group
|
|
57
|
-
text=${args.text}
|
|
58
|
-
checked=${args.checked}
|
|
59
|
-
disabled=${args.disabled}
|
|
60
|
-
>
|
|
52
|
+
render: args => html `
|
|
53
|
+
<ds-checkbox-group text=${args.text} checked=${args.checked} disabled=${args.disabled}>
|
|
61
54
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
62
55
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
63
56
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
@@ -75,15 +68,78 @@ export const DeeplyNested = {
|
|
|
75
68
|
disabled="false"
|
|
76
69
|
>
|
|
77
70
|
<ds-checkbox text="Parent checkbox"></ds-checkbox>
|
|
78
|
-
<ds-checkbox-group
|
|
79
|
-
text="Parent checkbox"
|
|
80
|
-
checked="false"
|
|
81
|
-
disabled="false"
|
|
82
|
-
>
|
|
71
|
+
<ds-checkbox-group id="parent-checkbox-group" text="Parent checkbox" checked="false" disabled="false">
|
|
83
72
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
84
73
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
85
74
|
<ds-checkbox text="Child checkbox"></ds-checkbox>
|
|
86
75
|
</ds-checkbox-group>
|
|
87
76
|
</ds-checkbox-group>
|
|
88
77
|
`,
|
|
78
|
+
play: async ({ canvasElement, step }) => {
|
|
79
|
+
const grandParentShadowRoot = await getShadowRoot(canvasElement, 'ds-checkbox-group');
|
|
80
|
+
const grandParentCheckboxWebc = grandParentShadowRoot.querySelector('ds-checkbox');
|
|
81
|
+
const grandParentCheckboxInput = grandParentCheckboxWebc.shadowRoot.querySelector('input');
|
|
82
|
+
const parentShadowRoot = await getShadowRoot(canvasElement, 'ds-checkbox-group#parent-checkbox-group');
|
|
83
|
+
const parentCheckboxWebc = parentShadowRoot.querySelector('ds-checkbox');
|
|
84
|
+
const parentCheckboxInput = parentCheckboxWebc.shadowRoot.querySelector('input');
|
|
85
|
+
const slottedCheckboxWebcs = canvasElement.querySelectorAll('ds-checkbox');
|
|
86
|
+
const slottedCheckboxInputs = [];
|
|
87
|
+
for (const webc of slottedCheckboxWebcs) {
|
|
88
|
+
slottedCheckboxInputs.push(webc.shadowRoot.querySelector('input'));
|
|
89
|
+
}
|
|
90
|
+
await waitFor(() => {
|
|
91
|
+
expect(grandParentCheckboxInput.checked).toBe(false);
|
|
92
|
+
expect(parentCheckboxInput.checked).toBe(false);
|
|
93
|
+
});
|
|
94
|
+
await step('Clicking an unchecked grand parent checkbox should check all checkboxes', async () => {
|
|
95
|
+
userEvent.click(grandParentCheckboxInput);
|
|
96
|
+
await waitFor(() => {
|
|
97
|
+
expect(grandParentCheckboxInput.checked).toBe(true);
|
|
98
|
+
expect(parentCheckboxInput.checked).toBe(true);
|
|
99
|
+
slottedCheckboxInputs.forEach(checkbox => {
|
|
100
|
+
expect(checkbox.checked).toBe(true);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
await waitFor(() => {
|
|
105
|
+
expect(grandParentCheckboxInput.checked).toBe(true);
|
|
106
|
+
expect(parentCheckboxInput.checked).toBe(true);
|
|
107
|
+
});
|
|
108
|
+
await step('Clicking a checked grand parent checkbox should uncheck all checkboxes', async () => {
|
|
109
|
+
userEvent.click(grandParentCheckboxInput);
|
|
110
|
+
await waitFor(() => {
|
|
111
|
+
expect(grandParentCheckboxInput.checked).toBe(false);
|
|
112
|
+
expect(parentCheckboxInput.checked).toBe(false);
|
|
113
|
+
slottedCheckboxInputs.forEach(checkbox => {
|
|
114
|
+
expect(checkbox.checked).toBe(false);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
await waitFor(() => {
|
|
119
|
+
expect(grandParentCheckboxInput.checked).toBe(false);
|
|
120
|
+
expect(parentCheckboxInput.checked).toBe(false);
|
|
121
|
+
});
|
|
122
|
+
await step('Clicking all unchecked child checkboxes should check parent and grandparent checkbox', async () => {
|
|
123
|
+
slottedCheckboxInputs.forEach(checkbox => {
|
|
124
|
+
userEvent.click(checkbox);
|
|
125
|
+
});
|
|
126
|
+
await waitFor(() => {
|
|
127
|
+
expect(grandParentCheckboxInput.checked).toBe(true);
|
|
128
|
+
expect(parentCheckboxInput.checked).toBe(true);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
await waitFor(() => {
|
|
132
|
+
expect(grandParentCheckboxInput.checked).toBe(true);
|
|
133
|
+
expect(parentCheckboxInput.checked).toBe(true);
|
|
134
|
+
});
|
|
135
|
+
await step('Clicking all checked child checkboxes should uncheck parent and grandparent checkbox', async () => {
|
|
136
|
+
slottedCheckboxInputs.forEach(checkbox => {
|
|
137
|
+
userEvent.click(checkbox);
|
|
138
|
+
});
|
|
139
|
+
await waitFor(() => {
|
|
140
|
+
expect(grandParentCheckboxInput.checked).toBe(false);
|
|
141
|
+
expect(parentCheckboxInput.checked).toBe(false);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
},
|
|
89
145
|
};
|
|
@@ -48,7 +48,7 @@ export class DsIcon {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
return (h(Fragment, { key: '
|
|
51
|
+
return (h(Fragment, { key: '71d2466d7ab9bdac086b7e4723bdbcae85f46179' }, h("span", { key: 'b19955f6f321b89dfce0d7843dcc41d3db92b29f', class: "ds-icon--container", innerHTML: this.getIcon(), "aria-hidden": this.hidden ? 'true' : 'false' })));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "ds-icon"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
gap: var(--ds-spacing-2xSmall);
|
|
14
14
|
}
|
|
15
15
|
.ds-input-validity--error {
|
|
16
|
-
color: var(--ds-
|
|
16
|
+
color: var(--ds-palette-red-70);
|
|
17
17
|
}
|
|
18
18
|
.ds-input-validity--success {
|
|
19
|
-
color: var(--ds-
|
|
19
|
+
color: var(--ds-palette-green-70);
|
|
20
20
|
}
|
|
21
21
|
.ds-input-validity ds-icon {
|
|
22
22
|
display: block;
|
package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js
CHANGED
|
@@ -17,7 +17,7 @@ export class DsInputValidity {
|
|
|
17
17
|
'ds-input-validity--success': this.type === 'success',
|
|
18
18
|
});
|
|
19
19
|
const icon = this.type === 'success' ? 'check_circle_fill' : 'warning_fill';
|
|
20
|
-
return (h("div", { key: '
|
|
20
|
+
return (h("div", { key: 'b76f90369546a44b88ff02ec08182ebf2299c0e9', role: isValidation('client') ? this.validityRole : undefined }, this.text && (h("div", { key: '575d68fff500bac58612514a3c4efebdb62dffdb', class: classes }, h("ds-icon", { key: '707c95678fdf517f83bc5126a1fcea0d9f8eb5cb', name: icon }), h("small", { key: '39e098386b1ed37c9d797513d626bb50e2e50034', id: this.identifier }, this.text)))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "ds-input-validity"; }
|
|
23
23
|
static get originalStyleUrls() {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
.ds-link {
|
|
14
14
|
display: inline-flex;
|
|
15
15
|
align-items: center;
|
|
16
|
-
color: var(--ds-
|
|
16
|
+
color: var(--ds-palette-mainBlue-70);
|
|
17
17
|
font-weight: var(--ds-fontWeight-regular);
|
|
18
18
|
letter-spacing: var(--ds-letterSpacing-wide);
|
|
19
19
|
text-decoration-line: underline;
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
text-underline-position: from-font;
|
|
25
25
|
}
|
|
26
26
|
.ds-link:focus-visible {
|
|
27
|
-
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-
|
|
28
|
-
outline-color: var(--ds-
|
|
29
|
-
outline-offset: var(--ds-borderWidth-thin);
|
|
27
|
+
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
|
|
28
|
+
outline-color: var(--ds-palette-black-95);
|
|
29
|
+
outline-offset: calc(var(--ds-borderWidth-thin) * 1);
|
|
30
30
|
outline-style: solid;
|
|
31
31
|
outline-width: var(--ds-borderWidth-thin);
|
|
32
32
|
}
|
|
@@ -75,30 +75,30 @@
|
|
|
75
75
|
text-underline-offset: 12%;
|
|
76
76
|
}
|
|
77
77
|
.ds-link:hover {
|
|
78
|
-
color: var(--ds-
|
|
78
|
+
color: var(--ds-palette-mainBlue-80);
|
|
79
79
|
}
|
|
80
80
|
.ds-link:active {
|
|
81
|
-
color: var(--ds-
|
|
81
|
+
color: var(--ds-palette-mainBlue-90);
|
|
82
82
|
}
|
|
83
83
|
.ds-link:visited {
|
|
84
|
-
color:
|
|
84
|
+
color: #551a8b;
|
|
85
85
|
}
|
|
86
86
|
.ds-link--standalone {
|
|
87
|
-
color: var(--ds-
|
|
87
|
+
color: var(--ds-palette-mainBlue-70);
|
|
88
88
|
text-decoration-line: none;
|
|
89
89
|
}
|
|
90
90
|
.ds-link--standalone:hover, .ds-link--standalone:active {
|
|
91
91
|
text-decoration-line: underline;
|
|
92
92
|
}
|
|
93
93
|
.ds-link--standalone:hover {
|
|
94
|
-
color: var(--ds-
|
|
94
|
+
color: var(--ds-palette-mainBlue-80);
|
|
95
95
|
}
|
|
96
96
|
.ds-link--standalone:active {
|
|
97
|
-
color: var(--ds-
|
|
97
|
+
color: var(--ds-palette-mainBlue-90);
|
|
98
98
|
}
|
|
99
99
|
.ds-link--standalone:focus-visible {
|
|
100
|
-
color: var(--ds-
|
|
100
|
+
color: var(--ds-palette-mainBlue-70);
|
|
101
101
|
}
|
|
102
102
|
.ds-link--standalone:visited {
|
|
103
|
-
color: var(--ds-
|
|
103
|
+
color: var(--ds-palette-mainBlue-70);
|
|
104
104
|
}
|