@uh-design-system/component-library 0.5.2 → 0.6.0
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/{utils-3412cbed.js → attributes-BMbXzbwU.js} +2 -28
- package/dist/cjs/component-library.cjs.js +7 -7
- package/dist/cjs/controlUtils-ofqiQxRF.js +42 -0
- package/dist/cjs/ds-accordion.cjs.entry.js +79 -0
- package/dist/cjs/ds-button.cjs.entry.js +107 -0
- package/dist/cjs/ds-card.cjs.entry.js +58 -0
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +109 -49
- package/dist/cjs/ds-checkbox.cjs.entry.js +88 -79
- package/dist/cjs/ds-icon.cjs.entry.js +943 -0
- package/dist/cjs/ds-input-validity.cjs.entry.js +14 -15
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +21 -20
- package/dist/cjs/ds-link.cjs.entry.js +34 -31
- package/dist/cjs/ds-radio-button-group.cjs.entry.js +153 -0
- package/dist/cjs/ds-radio-button.cjs.entry.js +151 -0
- package/dist/cjs/ds-spinner.cjs.entry.js +62 -0
- package/dist/cjs/ds-text-input.cjs.entry.js +90 -77
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +3 -6
- package/dist/cjs/index-Bp6Dd2i1.js +94 -0
- package/dist/cjs/{store-9bd20f3c.js → index-DwLFyR5p.js} +6 -2
- package/dist/cjs/{index-bf84b124.js → index-Mjp9Y-Sw.js} +701 -55
- package/dist/cjs/index.cjs.js +3 -5
- package/dist/cjs/{linkUtils-695da37c.js → linkUtils-onlbgKdI.js} +4 -2
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/utils-BjZTECpy.js +29 -0
- package/dist/collection/accessibility/stories/naming.stories.js +3 -3
- package/dist/collection/collection-manifest.json +78 -3
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +18 -17
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +91 -50
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +14 -14
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +24 -66
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +124 -145
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +150 -65
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +121 -23
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +49 -42
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +16 -72
- package/dist/collection/components/01-base-components/ds-card/ds-card.css +127 -0
- package/dist/collection/components/01-base-components/ds-card/ds-card.js +303 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.examples.stories.js +92 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.features.stories.js +66 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +46 -46
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +120 -111
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +20 -20
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +12 -25
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +2 -3
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +214 -63
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +215 -50
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +30 -28
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +36 -31
- package/dist/collection/components/01-base-components/ds-icon/stories/ds-icon.stories.js +10 -37
- 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 +60 -30
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +4 -9
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +24 -14
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +74 -75
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +27 -27
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +38 -21
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +8 -67
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +10 -12
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +30 -52
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.examples.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.features.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -28
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +115 -0
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +449 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +72 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +22 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +30 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +360 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +42 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +60 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +279 -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 +120 -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 +14 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +85 -118
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +230 -155
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +26 -21
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.features.stories.js +40 -40
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +30 -56
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/store.js +7 -1
- package/dist/collection/utils/attributes/attributes.js +2 -2
- 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 +35 -1
- package/dist/collection/utils/link/linkUtils.js +3 -2
- 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/collection/utils/utils.js +10 -9
- package/dist/component-library/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +1 -1
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/controlUtils-CNER0MvM.js +1 -0
- package/dist/component-library/ds-accordion.entry.js +1 -0
- package/dist/component-library/ds-button.entry.js +1 -0
- package/dist/component-library/ds-card.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-icon.entry.js +1 -0
- 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-spinner.entry.js +1 -0
- package/dist/component-library/ds-text-input.entry.js +1 -1
- package/dist/component-library/ds-visually-hidden.entry.js +1 -1
- package/dist/component-library/index-BfTCfPZ1.js +6 -0
- package/dist/component-library/index-Cm7V4EAn.js +2 -0
- package/dist/component-library/index-DuYjhvTn.js +1 -0
- package/dist/component-library/index.esm.js +1 -1
- package/dist/component-library/linkUtils-02nCfO0F.js +1 -0
- package/dist/component-library/utils-CqaqnfY4.js +1 -0
- package/dist/components/attributes.js +3 -3
- package/dist/components/controlUtils.js +35 -2
- package/dist/components/ds-accordion.js +58 -42
- package/dist/components/ds-button2.js +78 -39
- package/dist/components/ds-card.d.ts +11 -0
- package/dist/components/ds-card.js +91 -0
- package/dist/components/ds-checkbox-group.js +116 -56
- package/dist/components/ds-checkbox2.js +93 -80
- package/dist/components/ds-icon2.js +292 -292
- package/dist/components/ds-input-validity2.js +17 -14
- package/dist/components/ds-link-with-arrow.js +22 -22
- package/dist/components/ds-link.js +43 -40
- package/dist/components/ds-radio-button-group.d.ts +11 -0
- package/dist/components/ds-radio-button-group.js +185 -0
- package/dist/components/ds-radio-button.d.ts +11 -0
- package/dist/components/ds-radio-button.js +198 -0
- package/dist/components/ds-spinner.d.ts +11 -0
- package/dist/components/ds-spinner.js +6 -0
- package/dist/components/ds-spinner2.js +89 -0
- package/dist/components/ds-text-input.js +126 -104
- package/dist/components/ds-visually-hidden2.js +2 -3
- package/dist/components/index.js +208 -2
- package/dist/components/index2.js +713 -39
- package/dist/components/index3.js +69 -57
- package/dist/components/linkUtils.js +4 -2
- package/dist/docs.d.ts +443 -0
- package/dist/docs.json +4790 -0
- package/dist/esm/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +3 -26
- package/dist/esm/component-library.js +6 -5
- package/dist/esm/controlUtils-CNER0MvM.js +37 -0
- package/dist/esm/ds-accordion.entry.js +77 -0
- package/dist/esm/ds-button.entry.js +105 -0
- package/dist/esm/ds-card.entry.js +56 -0
- package/dist/esm/ds-checkbox-group.entry.js +108 -46
- package/dist/esm/ds-checkbox.entry.js +78 -67
- package/dist/esm/ds-icon.entry.js +941 -0
- package/dist/esm/ds-input-validity.entry.js +14 -13
- package/dist/esm/ds-link-with-arrow.entry.js +21 -18
- package/dist/esm/ds-link.entry.js +34 -29
- package/dist/esm/ds-radio-button-group.entry.js +151 -0
- package/dist/esm/ds-radio-button.entry.js +149 -0
- package/dist/esm/ds-spinner.entry.js +60 -0
- package/dist/esm/ds-text-input.entry.js +88 -73
- package/dist/esm/ds-visually-hidden.entry.js +3 -4
- package/dist/esm/index-BfTCfPZ1.js +92 -0
- package/dist/esm/{index-434995e1.js → index-Cm7V4EAn.js} +699 -34
- package/dist/{components/store.js → esm/index-DuYjhvTn.js} +6 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-02nCfO0F.js} +4 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/utils-CqaqnfY4.js +25 -0
- package/dist/hydrate/index.d.ts +271 -0
- package/dist/hydrate/index.js +22280 -0
- package/dist/hydrate/index.mjs +22272 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/styles/helpers.css +15 -0
- package/dist/styles/helpers.css.map +1 -0
- package/dist/styles/mixins/_breakpoints.scss +13 -0
- package/dist/styles/mixins/_focus.scss +26 -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 +12 -0
- package/dist/styles/variables.css +176 -0
- package/dist/styles/variables.css.map +1 -0
- package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +11 -8
- package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +16 -11
- 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-button/stories/ds-button.features.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-card/ds-card.d.ts +20 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.examples.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.features.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +21 -22
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +21 -11
- package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +3 -0
- package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +7 -5
- package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +5 -6
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +13 -14
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +5 -7
- 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 +34 -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 +11 -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 +37 -32
- package/dist/types/components.d.ts +1287 -228
- package/dist/types/stencil-public-runtime.d.ts +22 -0
- package/dist/types/store.d.ts +6 -1
- package/dist/types/utils/attributes/attributes.d.ts +1 -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/controls/controlUtils.d.ts +2 -0
- package/dist/types/utils/link/linkUtils.d.ts +1 -1
- package/dist/types/utils/spinner/spinnerUtils.d.ts +1 -0
- package/dist/types/utils/tests/testUtils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +40 -36
- package/dist/cjs/controlUtils-041de0fd.js +0 -7
- package/dist/cjs/ds-accordion_3.cjs.entry.js +0 -1095
- package/dist/cjs/index-5b0b9d4c.js +0 -82
- package/dist/component-library/controlUtils-9ca4087b.js +0 -1
- package/dist/component-library/ds-accordion_3.entry.js +0 -1
- package/dist/component-library/index-434995e1.js +0 -2
- package/dist/component-library/index-72ac5051.js +0 -6
- package/dist/component-library/linkUtils-3d1b28cf.js +0 -1
- package/dist/component-library/store-b8d17c10.js +0 -1
- package/dist/esm/controlUtils-9ca4087b.js +0 -4
- package/dist/esm/ds-accordion_3.entry.js +0 -1089
- package/dist/esm/index-72ac5051.js +0 -80
- package/dist/esm/store-b8d17c10.js +0 -204
- package/dist/loader/package.json +0 -11
- /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
- /package/dist/component-library/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
- /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
|
@@ -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,19 +24,17 @@
|
|
|
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:
|
|
27
|
-
flex-
|
|
28
|
-
flex-wrap: nowrap;
|
|
34
|
+
align-items: flex-start;
|
|
35
|
+
flex-flow: row nowrap;
|
|
29
36
|
text-wrap: wrap;
|
|
30
37
|
word-wrap: break-word;
|
|
31
|
-
word-break: break-all;
|
|
32
38
|
white-space: normal;
|
|
33
39
|
position: relative;
|
|
34
40
|
cursor: pointer;
|
|
@@ -36,26 +42,12 @@
|
|
|
36
42
|
width: auto;
|
|
37
43
|
padding: var(--ds-spacing-xSmall);
|
|
38
44
|
}
|
|
39
|
-
.ds-checkbox--no-margin .ds-checkbox__input {
|
|
40
|
-
margin-right: 0;
|
|
41
|
-
}
|
|
42
|
-
.ds-checkbox--disabled {
|
|
43
|
-
color: var(--ds-textColor-disabled-onLight);
|
|
44
|
-
}
|
|
45
|
-
.ds-checkbox__span--optional {
|
|
46
|
-
color: var(--ds-textColor-secondary);
|
|
47
|
-
font-size: var(--ds-fontSize-14);
|
|
48
|
-
}
|
|
49
|
-
.ds-checkbox:has(.ds-checkbox__input:disabled) {
|
|
50
|
-
cursor: not-allowed;
|
|
51
|
-
}
|
|
52
45
|
.ds-checkbox__input {
|
|
53
46
|
cursor: pointer;
|
|
54
47
|
/* hide the default checkbox */
|
|
55
|
-
-webkit-appearance: none;
|
|
56
48
|
appearance: none;
|
|
57
49
|
/* For iOS < 15 to remove gradient background */
|
|
58
|
-
background-color: var(--ds-
|
|
50
|
+
background-color: var(--ds-palette-white);
|
|
59
51
|
/* Not removed via appearance */
|
|
60
52
|
margin: 0;
|
|
61
53
|
display: grid;
|
|
@@ -69,53 +61,48 @@
|
|
|
69
61
|
border-color: var(--ds-palette-black-50);
|
|
70
62
|
/** unchecked **/
|
|
71
63
|
/** checked and indeterminate **/
|
|
72
|
-
/** Error state should override other styles */
|
|
73
64
|
/** checkmark **/
|
|
74
65
|
}
|
|
75
66
|
.ds-checkbox__input:focus-visible {
|
|
76
|
-
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-
|
|
77
|
-
outline
|
|
78
|
-
outline-offset: var(--ds-borderWidth-thin);
|
|
79
|
-
outline-style: solid;
|
|
80
|
-
outline-width: var(--ds-borderWidth-thin);
|
|
67
|
+
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
|
|
68
|
+
outline: var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);
|
|
69
|
+
outline-offset: calc(var(--ds-borderWidth-thin) * 1);
|
|
81
70
|
}
|
|
82
71
|
.ds-checkbox__input:hover, .ds-checkbox__input:active {
|
|
83
|
-
border-color: var(--ds-
|
|
72
|
+
border-color: var(--ds-palette-black-50);
|
|
84
73
|
}
|
|
85
74
|
.ds-checkbox__input:hover {
|
|
86
|
-
background-color: var(--ds-
|
|
75
|
+
background-color: var(--ds-palette-black-10);
|
|
87
76
|
}
|
|
88
77
|
.ds-checkbox__input:active {
|
|
89
|
-
background-color: var(--ds-
|
|
78
|
+
background-color: var(--ds-palette-black-20);
|
|
90
79
|
}
|
|
91
80
|
.ds-checkbox__input:disabled {
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
cursor: not-allowed;
|
|
82
|
+
color: var(--ds-palette-black-40);
|
|
83
|
+
background-color: var(--ds-overlay-black-10);
|
|
84
|
+
border-color: var(--ds-overlay-black-15);
|
|
94
85
|
}
|
|
95
86
|
@media (forced-colors: active) {
|
|
96
87
|
.ds-checkbox__input:disabled {
|
|
97
88
|
border-color: GrayText;
|
|
98
89
|
}
|
|
99
90
|
}
|
|
91
|
+
.ds-checkbox__input:user-invalid, .ds-checkbox__input--invalid, .ds-checkbox__input--invalid:checked, .ds-checkbox__input--invalid:indeterminate {
|
|
92
|
+
border-color: var(--ds-palette-red-50);
|
|
93
|
+
}
|
|
100
94
|
.ds-checkbox__input:checked, .ds-checkbox__input:indeterminate {
|
|
101
|
-
background-color: var(--ds-
|
|
102
|
-
border-color: var(--ds-
|
|
95
|
+
background-color: var(--ds-palette-mainBlue-70);
|
|
96
|
+
border-color: var(--ds-overlay-black-00);
|
|
103
97
|
}
|
|
104
98
|
.ds-checkbox__input:checked:hover, .ds-checkbox__input:indeterminate:hover {
|
|
105
|
-
background-color: var(--ds-
|
|
99
|
+
background-color: var(--ds-palette-mainBlue-80);
|
|
106
100
|
}
|
|
107
101
|
.ds-checkbox__input:checked:active, .ds-checkbox__input:indeterminate:active {
|
|
108
|
-
background-color: var(--ds-
|
|
102
|
+
background-color: var(--ds-palette-mainBlue-90);
|
|
109
103
|
}
|
|
110
104
|
.ds-checkbox__input:checked:disabled, .ds-checkbox__input:indeterminate:disabled {
|
|
111
|
-
background-color: var(--ds-
|
|
112
|
-
}
|
|
113
|
-
.ds-checkbox__input:user-invalid, .ds-checkbox__input--invalid, .ds-checkbox__input--invalid:checked, .ds-checkbox__input--invalid:indeterminate {
|
|
114
|
-
border-color: var(--ds-borderColor-danger);
|
|
115
|
-
}
|
|
116
|
-
.ds-checkbox__input:disabled {
|
|
117
|
-
cursor: not-allowed;
|
|
118
|
-
color: var(--ds-textColor-disabled-onLight);
|
|
105
|
+
background-color: var(--ds-overlay-black-10);
|
|
119
106
|
}
|
|
120
107
|
.ds-checkbox__input::before {
|
|
121
108
|
content: "";
|
|
@@ -129,15 +116,28 @@
|
|
|
129
116
|
.ds-checkbox__input:checked::before {
|
|
130
117
|
background-image: url("data:image/svg+xml;charset=utf-8,<svg width='16' height='13' viewBox='0 0 16 13' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M5.99997 7.87871L13.606 0.272705L15.7273 2.39403L5.99997 12.1214L0.272644 6.39402L2.39396 4.27271L5.99997 7.87871Z' fill='%23ffffff' /></svg>");
|
|
131
118
|
}
|
|
132
|
-
.ds-checkbox__input:checked:disabled::before {
|
|
133
|
-
background-image: url("data:image/svg+xml;charset=utf-8,<svg width='16' height='13' viewBox='0 0 16 13' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M5.99997 7.87871L13.606 0.272705L15.7273 2.39403L5.99997 12.1214L0.272644 6.39402L2.39396 4.27271L5.99997 7.87871Z' fill='%23999999' /></svg>");
|
|
134
|
-
}
|
|
135
119
|
.ds-checkbox__input:indeterminate::before {
|
|
136
120
|
background-image: url("data:image/svg+xml;charset=utf-8,<svg width='14' height='4' viewBox='0 0 14 4' xmlns='http://www.w3.org/2000/svg'><rect width='13.3333' height='3' transform='matrix(1 0 0 -1 0.333313 3.5)' fill='%23ffffff' /></svg>");
|
|
137
121
|
}
|
|
122
|
+
.ds-checkbox__input:checked:disabled::before {
|
|
123
|
+
background-image: url("data:image/svg+xml;charset=utf-8,<svg width='16' height='13' viewBox='0 0 16 13' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M5.99997 7.87871L13.606 0.272705L15.7273 2.39403L5.99997 12.1214L0.272644 6.39402L2.39396 4.27271L5.99997 7.87871Z' fill='%23999999' /></svg>");
|
|
124
|
+
}
|
|
138
125
|
.ds-checkbox__input:indeterminate:disabled::before {
|
|
139
126
|
background-image: url("data:image/svg+xml;charset=utf-8,<svg width='14' height='4' viewBox='0 0 14 4' xmlns='http://www.w3.org/2000/svg'><rect width='13.3333' height='3' transform='matrix(1 0 0 -1 0.333313 3.5)' fill='%23999999' /></svg>");
|
|
140
127
|
}
|
|
128
|
+
.ds-checkbox--no-margin .ds-checkbox__input {
|
|
129
|
+
margin-right: 0;
|
|
130
|
+
}
|
|
131
|
+
.ds-checkbox--disabled {
|
|
132
|
+
color: var(--ds-palette-black-40);
|
|
133
|
+
}
|
|
134
|
+
.ds-checkbox__span--optional {
|
|
135
|
+
color: var(--ds-palette-black-70);
|
|
136
|
+
font-size: var(--ds-fontSize-14);
|
|
137
|
+
}
|
|
138
|
+
.ds-checkbox:has(.ds-checkbox__input:disabled) {
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
}
|
|
141
141
|
|
|
142
142
|
.ds-checkbox-error {
|
|
143
143
|
display: flex;
|
|
@@ -3,100 +3,108 @@ import classNames from "classnames";
|
|
|
3
3
|
import { inheritAriaAttributes, inheritAttributes } from "../../../utils/attributes/attributes";
|
|
4
4
|
import { getOptionalText, getRequiredText } from "../../../utils/controls/controlUtils";
|
|
5
5
|
import { isValidation } from "../../../store";
|
|
6
|
-
import {
|
|
6
|
+
import { 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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
dsId = checkboxIdGenerator.next().value;
|
|
19
|
+
dsChecked = false;
|
|
20
|
+
dsLegend;
|
|
21
|
+
dsAssistiveText;
|
|
22
|
+
dsText;
|
|
23
|
+
dsIndeterminate = false;
|
|
24
|
+
dsDisabled = false;
|
|
25
|
+
dsErrorText = '';
|
|
26
|
+
dsErrorsDisabled = false;
|
|
27
|
+
dsRequired = false;
|
|
28
|
+
dsOptional = false;
|
|
29
|
+
dsOptionalText;
|
|
30
|
+
dsAriaLabel;
|
|
31
|
+
dsChange;
|
|
32
|
+
invalid = !!this.dsErrorText;
|
|
33
|
+
initialChecked = this.dsChecked;
|
|
33
34
|
validationMessage;
|
|
34
35
|
setIds = () => {
|
|
35
|
-
this.labelId = `${this.
|
|
36
|
-
this.inputValidityId = `${this.
|
|
37
|
-
this.assistiveTextId = `${this.
|
|
36
|
+
this.labelId = `${this.dsId}-label`;
|
|
37
|
+
this.inputValidityId = `${this.dsId}-validity`;
|
|
38
|
+
this.assistiveTextId = `${this.dsId}-assistive-text`;
|
|
38
39
|
};
|
|
39
|
-
getValidationMessage = () => (!this.
|
|
40
|
+
getValidationMessage = () => (!this.dsErrorsDisabled ? this.dsErrorText || this.internals?.validationMessage || this.inputElem?.validationMessage : '');
|
|
40
41
|
getLegendText = () => {
|
|
41
|
-
if (this.
|
|
42
|
-
return getRequiredText(this.
|
|
42
|
+
if (this.dsRequired) {
|
|
43
|
+
return getRequiredText(this.dsLegend);
|
|
43
44
|
}
|
|
44
|
-
if (this.
|
|
45
|
-
return getOptionalText(this.
|
|
45
|
+
if (this.dsOptional) {
|
|
46
|
+
return getOptionalText(this.dsLegend, this.dsOptionalText);
|
|
46
47
|
}
|
|
47
|
-
return this.
|
|
48
|
+
return this.dsLegend;
|
|
48
49
|
};
|
|
49
50
|
getCheckboxText = () => {
|
|
50
|
-
if (this.
|
|
51
|
-
return this.
|
|
51
|
+
if (this.dsLegend) {
|
|
52
|
+
return this.dsText;
|
|
52
53
|
}
|
|
53
|
-
if (this.
|
|
54
|
-
return getRequiredText(this.
|
|
54
|
+
if (this.dsRequired) {
|
|
55
|
+
return getRequiredText(this.dsText);
|
|
55
56
|
}
|
|
56
|
-
if (this.
|
|
57
|
-
return getOptionalText(this.
|
|
57
|
+
if (this.dsOptional) {
|
|
58
|
+
return getOptionalText(this.dsText, this.dsOptionalText);
|
|
58
59
|
}
|
|
59
|
-
return this.
|
|
60
|
-
};
|
|
61
|
-
getAriaDescribedBy = () => [Boolean(this.assistiveText) && this.assistiveTextId, Boolean(this.getValidationMessage()) && this.inputValidityId].filter(Boolean).join(' ');
|
|
62
|
-
restoreInitialState = () => {
|
|
63
|
-
this.checked = this.initialChecked;
|
|
64
|
-
this.value = this.checked.toString();
|
|
65
|
-
this.internals?.setValidity({});
|
|
66
|
-
this.internals?.setFormValue(this.value);
|
|
67
|
-
};
|
|
68
|
-
setInitialState = () => {
|
|
69
|
-
this.initialChecked = this.checked;
|
|
70
|
-
this.value = this.checked.toString();
|
|
71
|
-
this.internals?.setFormValue(this.value);
|
|
60
|
+
return this.dsText;
|
|
72
61
|
};
|
|
62
|
+
getAriaDescribedBy = () => [Boolean(this.dsAssistiveText) && this.assistiveTextId, Boolean(this.getValidationMessage()) && this.inputValidityId].filter(Boolean).join(' ');
|
|
73
63
|
formResetCallback() {
|
|
74
|
-
this.
|
|
64
|
+
this.dsChecked = this.initialChecked;
|
|
65
|
+
this.internals?.setValidity({});
|
|
66
|
+
this.internals?.setFormValue(this.dsChecked.toString());
|
|
67
|
+
}
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
this.checkboxGroup = this.el.closest('ds-checkbox-group');
|
|
70
|
+
if (this.checkboxGroup) {
|
|
71
|
+
this.invalid = !!this.checkboxGroup.dsErrorText;
|
|
72
|
+
this.checkboxGroup.addEventListener('dsCheckboxGroupInvalidStateChange', this.updateInvalidState);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
disconnectedCallback() {
|
|
76
|
+
if (this.checkboxGroup) {
|
|
77
|
+
this.checkboxGroup.removeEventListener('dsCheckboxGroupInvalidStateChange', this.updateInvalidState);
|
|
78
|
+
}
|
|
79
|
+
this.checkboxGroup = null;
|
|
75
80
|
}
|
|
81
|
+
updateInvalidState = (e) => {
|
|
82
|
+
this.invalid = e.detail;
|
|
83
|
+
};
|
|
76
84
|
componentWillLoad() {
|
|
77
|
-
this.setInitialState();
|
|
78
85
|
this.setIds();
|
|
79
86
|
this.inheritedAttributes = {
|
|
80
87
|
...inheritAriaAttributes(this.el, ['aria-label', 'aria-describedby', 'aria-hidden', 'aria-invalid']),
|
|
81
88
|
...inheritAttributes(this, this.el),
|
|
82
89
|
};
|
|
83
|
-
if (isValidation('server') || this.
|
|
90
|
+
if (isValidation('server') || this.dsErrorText) {
|
|
84
91
|
this.validationMessage = this.getValidationMessage();
|
|
85
92
|
}
|
|
86
93
|
}
|
|
94
|
+
dsCheckedObserver(isChecked) {
|
|
95
|
+
this.dsChange.emit(isChecked);
|
|
96
|
+
}
|
|
87
97
|
handleInput = (e) => {
|
|
88
98
|
const target = e.target;
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
this.internals?.setFormValue(this.value);
|
|
92
|
-
this.dsCheckboxInput.emit({ id: this.identifier, checked: target.checked });
|
|
99
|
+
this.dsChecked = target.checked;
|
|
100
|
+
this.internals?.setFormValue(target.checked.toString());
|
|
93
101
|
if (isValidation('client') && this.validationMessage) {
|
|
94
102
|
this.validationMessage = this.getValidationMessage();
|
|
95
103
|
}
|
|
96
104
|
};
|
|
97
105
|
handleKeyUp = (event) => {
|
|
98
106
|
if (event.key === 'Enter') {
|
|
99
|
-
this.inputElem.
|
|
107
|
+
this.inputElem.click();
|
|
100
108
|
}
|
|
101
109
|
};
|
|
102
110
|
handleBlur = () => {
|
|
@@ -113,26 +121,26 @@ export class DsCheckbox {
|
|
|
113
121
|
};
|
|
114
122
|
renderCheckbox() {
|
|
115
123
|
const classes = classNames('ds-checkbox', {
|
|
116
|
-
'ds-checkbox--disabled': this.
|
|
117
|
-
'ds-checkbox--no-margin': Boolean(!this.
|
|
124
|
+
'ds-checkbox--disabled': this.dsDisabled,
|
|
125
|
+
'ds-checkbox--no-margin': Boolean(!this.dsText),
|
|
118
126
|
});
|
|
119
127
|
const inputClasses = classNames('ds-checkbox__input', {
|
|
120
|
-
'ds-checkbox__input--invalid': Boolean(this.
|
|
128
|
+
'ds-checkbox__input--invalid': Boolean(this.dsErrorText) || this.invalid,
|
|
121
129
|
});
|
|
122
130
|
const errorClasses = classNames('ds-checkbox-error', {
|
|
123
131
|
'ds-checkbox-error--visible': Boolean(this.validationMessage),
|
|
124
132
|
});
|
|
125
133
|
const ariaDescribedBy = this.getAriaDescribedBy();
|
|
126
|
-
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.
|
|
134
|
+
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.dsChecked, indeterminate: this.dsIndeterminate, onInput: this.handleInput, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, value: this.dsChecked.toString(), disabled: this.dsDisabled, required: this.dsRequired, id: this.dsId, "aria-describedby": ariaDescribedBy, "aria-label": this.dsAriaLabel, "aria-invalid": this.dsErrorText ? true : undefined, ...this.inheritedAttributes }), this.getCheckboxText())), !this.dsErrorsDisabled && (h("div", { class: errorClasses }, h("ds-input-validity", { id: this.inputValidityId, dsText: this.validationMessage, dsType: "error", dsAriaLive: "polite", dsAriaAtomic: "true" })))));
|
|
127
135
|
}
|
|
128
136
|
renderFieldset() {
|
|
129
137
|
const fieldsetClasses = classNames('ds-checkbox-fieldset');
|
|
130
138
|
const legendClasses = classNames('ds-checkbox-fieldset__legend');
|
|
131
139
|
const assistiveTextClasses = classNames('ds-checkbox-fieldset__assistive-text');
|
|
132
|
-
return (h("fieldset", { class: fieldsetClasses }, h("legend", { class: legendClasses }, this.getLegendText()), this.
|
|
140
|
+
return (h("fieldset", { class: fieldsetClasses }, h("legend", { class: legendClasses }, this.getLegendText()), this.dsAssistiveText && (h("small", { class: assistiveTextClasses, id: this.assistiveTextId }, this.dsAssistiveText)), this.renderCheckbox()));
|
|
133
141
|
}
|
|
134
142
|
render() {
|
|
135
|
-
if (this.
|
|
143
|
+
if (this.dsLegend) {
|
|
136
144
|
return this.renderFieldset();
|
|
137
145
|
}
|
|
138
146
|
return this.renderCheckbox();
|
|
@@ -152,8 +160,9 @@ export class DsCheckbox {
|
|
|
152
160
|
}
|
|
153
161
|
static get properties() {
|
|
154
162
|
return {
|
|
155
|
-
"
|
|
163
|
+
"dsId": {
|
|
156
164
|
"type": "string",
|
|
165
|
+
"attribute": "ds-id",
|
|
157
166
|
"mutable": false,
|
|
158
167
|
"complexType": {
|
|
159
168
|
"original": "string",
|
|
@@ -164,16 +173,16 @@ export class DsCheckbox {
|
|
|
164
173
|
"optional": true,
|
|
165
174
|
"docs": {
|
|
166
175
|
"tags": [],
|
|
167
|
-
"text": ""
|
|
176
|
+
"text": "Passed to the `id` attribute of the `input` element of the rendered checkbox."
|
|
168
177
|
},
|
|
169
178
|
"getter": false,
|
|
170
179
|
"setter": false,
|
|
171
|
-
"attribute": "id",
|
|
172
180
|
"reflect": false,
|
|
173
181
|
"defaultValue": "checkboxIdGenerator.next().value as string"
|
|
174
182
|
},
|
|
175
|
-
"
|
|
183
|
+
"dsChecked": {
|
|
176
184
|
"type": "boolean",
|
|
185
|
+
"attribute": "ds-checked",
|
|
177
186
|
"mutable": true,
|
|
178
187
|
"complexType": {
|
|
179
188
|
"original": "boolean",
|
|
@@ -184,16 +193,16 @@ export class DsCheckbox {
|
|
|
184
193
|
"optional": false,
|
|
185
194
|
"docs": {
|
|
186
195
|
"tags": [],
|
|
187
|
-
"text": ""
|
|
196
|
+
"text": "Passed to the `checked` attriubte of the `input` element of the rendered checkbox."
|
|
188
197
|
},
|
|
189
198
|
"getter": false,
|
|
190
199
|
"setter": false,
|
|
191
|
-
"attribute": "checked",
|
|
192
200
|
"reflect": false,
|
|
193
201
|
"defaultValue": "false"
|
|
194
202
|
},
|
|
195
|
-
"
|
|
203
|
+
"dsLegend": {
|
|
196
204
|
"type": "string",
|
|
205
|
+
"attribute": "ds-legend",
|
|
197
206
|
"mutable": false,
|
|
198
207
|
"complexType": {
|
|
199
208
|
"original": "string",
|
|
@@ -204,15 +213,15 @@ export class DsCheckbox {
|
|
|
204
213
|
"optional": true,
|
|
205
214
|
"docs": {
|
|
206
215
|
"tags": [],
|
|
207
|
-
"text": ""
|
|
216
|
+
"text": "Label of the checkbox"
|
|
208
217
|
},
|
|
209
218
|
"getter": false,
|
|
210
219
|
"setter": false,
|
|
211
|
-
"attribute": "legend",
|
|
212
220
|
"reflect": false
|
|
213
221
|
},
|
|
214
|
-
"
|
|
222
|
+
"dsAssistiveText": {
|
|
215
223
|
"type": "string",
|
|
224
|
+
"attribute": "ds-assistive-text",
|
|
216
225
|
"mutable": false,
|
|
217
226
|
"complexType": {
|
|
218
227
|
"original": "string",
|
|
@@ -223,15 +232,15 @@ export class DsCheckbox {
|
|
|
223
232
|
"optional": true,
|
|
224
233
|
"docs": {
|
|
225
234
|
"tags": [],
|
|
226
|
-
"text": ""
|
|
235
|
+
"text": "Text for additional information shown below label"
|
|
227
236
|
},
|
|
228
237
|
"getter": false,
|
|
229
238
|
"setter": false,
|
|
230
|
-
"attribute": "assistive-text",
|
|
231
239
|
"reflect": false
|
|
232
240
|
},
|
|
233
|
-
"
|
|
241
|
+
"dsText": {
|
|
234
242
|
"type": "string",
|
|
243
|
+
"attribute": "ds-text",
|
|
235
244
|
"mutable": false,
|
|
236
245
|
"complexType": {
|
|
237
246
|
"original": "string",
|
|
@@ -242,15 +251,15 @@ export class DsCheckbox {
|
|
|
242
251
|
"optional": true,
|
|
243
252
|
"docs": {
|
|
244
253
|
"tags": [],
|
|
245
|
-
"text": ""
|
|
254
|
+
"text": "The text of the checkbox"
|
|
246
255
|
},
|
|
247
256
|
"getter": false,
|
|
248
257
|
"setter": false,
|
|
249
|
-
"attribute": "text",
|
|
250
258
|
"reflect": false
|
|
251
259
|
},
|
|
252
|
-
"
|
|
260
|
+
"dsIndeterminate": {
|
|
253
261
|
"type": "boolean",
|
|
262
|
+
"attribute": "ds-indeterminate",
|
|
254
263
|
"mutable": false,
|
|
255
264
|
"complexType": {
|
|
256
265
|
"original": "boolean",
|
|
@@ -261,16 +270,16 @@ export class DsCheckbox {
|
|
|
261
270
|
"optional": false,
|
|
262
271
|
"docs": {
|
|
263
272
|
"tags": [],
|
|
264
|
-
"text": ""
|
|
273
|
+
"text": "Mainly used in a nested checkbox group to display a parent\ncheckbox in a partially selected state if some but not\nall of the nested checkbox group's checkboxes are selected."
|
|
265
274
|
},
|
|
266
275
|
"getter": false,
|
|
267
276
|
"setter": false,
|
|
268
|
-
"attribute": "indeterminate",
|
|
269
277
|
"reflect": false,
|
|
270
278
|
"defaultValue": "false"
|
|
271
279
|
},
|
|
272
|
-
"
|
|
280
|
+
"dsDisabled": {
|
|
273
281
|
"type": "boolean",
|
|
282
|
+
"attribute": "ds-disabled",
|
|
274
283
|
"mutable": false,
|
|
275
284
|
"complexType": {
|
|
276
285
|
"original": "boolean",
|
|
@@ -281,16 +290,16 @@ export class DsCheckbox {
|
|
|
281
290
|
"optional": false,
|
|
282
291
|
"docs": {
|
|
283
292
|
"tags": [],
|
|
284
|
-
"text": ""
|
|
293
|
+
"text": "Passed to the `disabled` attribute of the `input` element of the rendered checkbox."
|
|
285
294
|
},
|
|
286
295
|
"getter": false,
|
|
287
296
|
"setter": false,
|
|
288
|
-
"attribute": "disabled",
|
|
289
297
|
"reflect": false,
|
|
290
298
|
"defaultValue": "false"
|
|
291
299
|
},
|
|
292
|
-
"
|
|
300
|
+
"dsErrorText": {
|
|
293
301
|
"type": "string",
|
|
302
|
+
"attribute": "ds-error-text",
|
|
294
303
|
"mutable": false,
|
|
295
304
|
"complexType": {
|
|
296
305
|
"original": "string",
|
|
@@ -301,16 +310,16 @@ export class DsCheckbox {
|
|
|
301
310
|
"optional": false,
|
|
302
311
|
"docs": {
|
|
303
312
|
"tags": [],
|
|
304
|
-
"text": ""
|
|
313
|
+
"text": "Error message shown below the text input.\nIf set, the checkbox is shown in an invalid state."
|
|
305
314
|
},
|
|
306
315
|
"getter": false,
|
|
307
316
|
"setter": false,
|
|
308
|
-
"attribute": "error-text",
|
|
309
317
|
"reflect": false,
|
|
310
318
|
"defaultValue": "''"
|
|
311
319
|
},
|
|
312
|
-
"
|
|
320
|
+
"dsErrorsDisabled": {
|
|
313
321
|
"type": "boolean",
|
|
322
|
+
"attribute": "ds-errors-disabled",
|
|
314
323
|
"mutable": false,
|
|
315
324
|
"complexType": {
|
|
316
325
|
"original": "boolean",
|
|
@@ -321,16 +330,16 @@ export class DsCheckbox {
|
|
|
321
330
|
"optional": false,
|
|
322
331
|
"docs": {
|
|
323
332
|
"tags": [],
|
|
324
|
-
"text": ""
|
|
333
|
+
"text": "Used internally in checkbox group to disable error messages\nfor a single checkbox."
|
|
325
334
|
},
|
|
326
335
|
"getter": false,
|
|
327
336
|
"setter": false,
|
|
328
|
-
"attribute": "data-errors-disabled",
|
|
329
337
|
"reflect": false,
|
|
330
338
|
"defaultValue": "false"
|
|
331
339
|
},
|
|
332
|
-
"
|
|
340
|
+
"dsRequired": {
|
|
333
341
|
"type": "boolean",
|
|
342
|
+
"attribute": "ds-required",
|
|
334
343
|
"mutable": false,
|
|
335
344
|
"complexType": {
|
|
336
345
|
"original": "boolean",
|
|
@@ -341,16 +350,16 @@ export class DsCheckbox {
|
|
|
341
350
|
"optional": false,
|
|
342
351
|
"docs": {
|
|
343
352
|
"tags": [],
|
|
344
|
-
"text": ""
|
|
353
|
+
"text": "Passed to the `required` attribute of the `input` element of the rendered checkbox."
|
|
345
354
|
},
|
|
346
355
|
"getter": false,
|
|
347
356
|
"setter": false,
|
|
348
|
-
"attribute": "required",
|
|
349
357
|
"reflect": false,
|
|
350
358
|
"defaultValue": "false"
|
|
351
359
|
},
|
|
352
|
-
"
|
|
360
|
+
"dsOptional": {
|
|
353
361
|
"type": "boolean",
|
|
362
|
+
"attribute": "ds-optional",
|
|
354
363
|
"mutable": false,
|
|
355
364
|
"complexType": {
|
|
356
365
|
"original": "boolean",
|
|
@@ -361,16 +370,16 @@ export class DsCheckbox {
|
|
|
361
370
|
"optional": false,
|
|
362
371
|
"docs": {
|
|
363
372
|
"tags": [],
|
|
364
|
-
"text": ""
|
|
373
|
+
"text": "Displays indicator that the checkbox is optional alongside label."
|
|
365
374
|
},
|
|
366
375
|
"getter": false,
|
|
367
376
|
"setter": false,
|
|
368
|
-
"attribute": "optional",
|
|
369
377
|
"reflect": false,
|
|
370
378
|
"defaultValue": "false"
|
|
371
379
|
},
|
|
372
|
-
"
|
|
380
|
+
"dsOptionalText": {
|
|
373
381
|
"type": "string",
|
|
382
|
+
"attribute": "ds-optional-text",
|
|
374
383
|
"mutable": false,
|
|
375
384
|
"complexType": {
|
|
376
385
|
"original": "string",
|
|
@@ -381,15 +390,15 @@ export class DsCheckbox {
|
|
|
381
390
|
"optional": true,
|
|
382
391
|
"docs": {
|
|
383
392
|
"tags": [],
|
|
384
|
-
"text": ""
|
|
393
|
+
"text": "Text shown alongside label, if the checkbox is set as optional."
|
|
385
394
|
},
|
|
386
395
|
"getter": false,
|
|
387
396
|
"setter": false,
|
|
388
|
-
"attribute": "optional-text",
|
|
389
397
|
"reflect": false
|
|
390
398
|
},
|
|
391
|
-
"
|
|
399
|
+
"dsAriaLabel": {
|
|
392
400
|
"type": "string",
|
|
401
|
+
"attribute": "ds-aria-label",
|
|
393
402
|
"mutable": false,
|
|
394
403
|
"complexType": {
|
|
395
404
|
"original": "string",
|
|
@@ -400,45 +409,45 @@ export class DsCheckbox {
|
|
|
400
409
|
"optional": false,
|
|
401
410
|
"docs": {
|
|
402
411
|
"tags": [],
|
|
403
|
-
"text": ""
|
|
412
|
+
"text": "Passed to the `aria-label` attribute of the `input` element of the rendered checkbox."
|
|
404
413
|
},
|
|
405
414
|
"getter": false,
|
|
406
415
|
"setter": false,
|
|
407
|
-
"attribute": "aria-label",
|
|
408
416
|
"reflect": false
|
|
409
417
|
}
|
|
410
418
|
};
|
|
411
419
|
}
|
|
412
420
|
static get states() {
|
|
413
421
|
return {
|
|
414
|
-
"
|
|
422
|
+
"invalid": {},
|
|
423
|
+
"initialChecked": {},
|
|
415
424
|
"validationMessage": {}
|
|
416
425
|
};
|
|
417
426
|
}
|
|
418
427
|
static get events() {
|
|
419
428
|
return [{
|
|
420
|
-
"method": "
|
|
421
|
-
"name": "
|
|
429
|
+
"method": "dsChange",
|
|
430
|
+
"name": "dsChange",
|
|
422
431
|
"bubbles": true,
|
|
423
432
|
"cancelable": true,
|
|
424
433
|
"composed": true,
|
|
425
434
|
"docs": {
|
|
426
435
|
"tags": [],
|
|
427
|
-
"text": ""
|
|
436
|
+
"text": "The `dsChange` event is fired each time the `value` property of\nthe `ds-checkbox` element is changed."
|
|
428
437
|
},
|
|
429
438
|
"complexType": {
|
|
430
|
-
"original": "
|
|
431
|
-
"resolved": "
|
|
432
|
-
"references": {
|
|
433
|
-
"DsCheckboxInputEvent": {
|
|
434
|
-
"location": "local",
|
|
435
|
-
"path": "/Users/teemuparssinen/hy/uh-design-system/component-library/packages/component-library/src/components/01-base-components/ds-checkbox/ds-checkbox.tsx",
|
|
436
|
-
"id": "src/components/01-base-components/ds-checkbox/ds-checkbox.tsx::DsCheckboxInputEvent"
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
+
"original": "boolean",
|
|
440
|
+
"resolved": "boolean",
|
|
441
|
+
"references": {}
|
|
439
442
|
}
|
|
440
443
|
}];
|
|
441
444
|
}
|
|
442
445
|
static get elementRef() { return "el"; }
|
|
446
|
+
static get watchers() {
|
|
447
|
+
return [{
|
|
448
|
+
"propName": "dsChecked",
|
|
449
|
+
"methodName": "dsCheckedObserver"
|
|
450
|
+
}];
|
|
451
|
+
}
|
|
443
452
|
static get attachInternalsMemberName() { return "internals"; }
|
|
444
453
|
}
|