@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,10 +1,9 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
|
-
import { i as isValidation } from './
|
|
3
|
+
import { i as isValidation } from './index.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './ds-icon2.js';
|
|
5
5
|
|
|
6
|
-
const dsInputValidityCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-input-validity{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.ds-input-validity--error{color:var(--ds-
|
|
7
|
-
const DsInputValidityStyle0 = dsInputValidityCss;
|
|
6
|
+
const dsInputValidityCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-input-validity{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.ds-input-validity--error{color:var(--ds-palette-red-70)}.ds-input-validity--success{color:var(--ds-palette-green-70)}.ds-input-validity ds-icon{display:block;height:1.5rem}.ds-input-validity small{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}";
|
|
8
7
|
|
|
9
8
|
const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
|
|
10
9
|
constructor() {
|
|
@@ -12,9 +11,11 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
|
|
|
12
11
|
this.__registerHost();
|
|
13
12
|
}
|
|
14
13
|
get el() { return this; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
dsText;
|
|
15
|
+
dsType = 'error';
|
|
16
|
+
dsValidityRole;
|
|
17
|
+
dsAriaLive;
|
|
18
|
+
dsAriaAtomic;
|
|
18
19
|
identifier;
|
|
19
20
|
componentDidLoad() {
|
|
20
21
|
this.identifier = this.el.getAttribute('id');
|
|
@@ -22,17 +23,19 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
|
|
|
22
23
|
}
|
|
23
24
|
render() {
|
|
24
25
|
const classes = classNames('ds-input-validity', {
|
|
25
|
-
'ds-input-validity--error': this.
|
|
26
|
-
'ds-input-validity--success': this.
|
|
26
|
+
'ds-input-validity--error': this.dsType === 'error',
|
|
27
|
+
'ds-input-validity--success': this.dsType === 'success',
|
|
27
28
|
});
|
|
28
|
-
const icon = this.
|
|
29
|
-
return (h("div", { key: '
|
|
29
|
+
const icon = this.dsType === 'success' ? 'check_circle_fill' : 'warning_fill';
|
|
30
|
+
return (h("div", { key: '469ca293035b5f7f7f832fcde1651aef6d8a7e93', role: isValidation('client') ? this.dsValidityRole : undefined, "aria-live": isValidation('client') ? this.dsAriaLive : undefined, "aria-atomic": isValidation('client') ? this.dsAriaAtomic : undefined }, this.dsText && (h("div", { key: 'c1b800c75f2434fd3f26f656289853897a5fd485', class: classes }, h("ds-icon", { key: '7af7ca8d0ab5be6b795f4143c310b5134cadc7cd', dsName: icon }), h("small", { key: '81f8f36d3558f98331a0ec15cffcc3a6bb41f449', id: this.identifier }, this.dsText)))));
|
|
30
31
|
}
|
|
31
|
-
static get style() { return
|
|
32
|
+
static get style() { return dsInputValidityCss; }
|
|
32
33
|
}, [0, "ds-input-validity", {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"dsText": [1, "ds-text"],
|
|
35
|
+
"dsType": [1, "ds-type"],
|
|
36
|
+
"dsValidityRole": [1, "ds-validity-role"],
|
|
37
|
+
"dsAriaLive": [1, "ds-aria-live"],
|
|
38
|
+
"dsAriaAtomic": [1, "ds-aria-atomic"],
|
|
36
39
|
"identifier": [32]
|
|
37
40
|
}]);
|
|
38
41
|
function defineCustomElement() {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { b as inheritSpecifiedAttributes, a as inheritAriaAttributes } from './attributes.js';
|
|
4
4
|
import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
|
|
5
|
-
import {
|
|
5
|
+
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
|
|
7
7
|
|
|
8
|
-
const dsLinkWithArrowCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link-with-arrow{display:inline-flex;align-items:center;color:var(--ds-
|
|
9
|
-
const DsLinkWithArrowStyle0 = dsLinkWithArrowCss;
|
|
8
|
+
const dsLinkWithArrowCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link-with-arrow{display:inline-flex;align-items:center;color:var(--ds-palette-mainBlue-70);letter-spacing:var(--ds-letterSpacing-wide);font-weight:var(--ds-fontWeight-semibold);font-size:var(--ds-fontSize-16);text-decoration-line:none}.ds-link-with-arrow:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);outline:var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);outline-offset:calc(var(--ds-borderWidth-thin) * 1)}@media (min-width: 30rem){.ds-link-with-arrow{font-size:var(--ds-fontSize-18)}}.ds-link-with-arrow__icon{display:inline-flex;width:2em;height:2em;line-height:0;align-items:center;justify-content:center;color:var(--ds-palette-white);background-color:var(--ds-palette-mainBlue-70)}.ds-link-with-arrow__icon--start{margin-right:var(--ds-spacing-xSmall)}.ds-link-with-arrow__icon--end{margin-left:var(--ds-spacing-xSmall)}:hover slot>.ds-link-with-arrow__icon{outline:10px solid;background-color:var(--ds-palette-mainBlue-80)}:active slot>.ds-link-with-arrow__icon{background-color:var(--ds-palette-mainBlue-90)}.ds-link-with-arrow:hover,.ds-link-with-arrow:active{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link-with-arrow:hover{color:var(--ds-palette-mainBlue-80)}.ds-link-with-arrow:active,.ds-link-with-arrow:focus-visible{color:var(--ds-palette-mainBlue-90)}";
|
|
10
9
|
|
|
11
10
|
const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
|
|
12
11
|
const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
@@ -20,15 +19,17 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
|
20
19
|
rel;
|
|
21
20
|
visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
|
|
22
21
|
get el() { return this; }
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ariaLabel;
|
|
22
|
+
dsText;
|
|
23
|
+
dsIconPosition = 'start';
|
|
24
|
+
dsHref;
|
|
25
|
+
dsTarget;
|
|
26
|
+
dsAriaLabel;
|
|
29
27
|
componentWillLoad() {
|
|
30
|
-
this.inheritedAttributes =
|
|
31
|
-
|
|
28
|
+
this.inheritedAttributes = {
|
|
29
|
+
...inheritAriaAttributes(this.el, ['aria-label']),
|
|
30
|
+
...inheritSpecifiedAttributes(this.el, ['lang']),
|
|
31
|
+
};
|
|
32
|
+
if (opensInNewTab(this.dsTarget)) {
|
|
32
33
|
this.icon = 'arrow_outward';
|
|
33
34
|
this.rel = 'noopener noreferrer';
|
|
34
35
|
}
|
|
@@ -36,19 +37,18 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
|
36
37
|
render() {
|
|
37
38
|
const classes = classNames('ds-link-with-arrow');
|
|
38
39
|
const iconClasses = classNames('ds-link-with-arrow__icon', {
|
|
39
|
-
'ds-link-with-arrow__icon--start': this.
|
|
40
|
-
'ds-link-with-arrow__icon--end': this.
|
|
40
|
+
'ds-link-with-arrow__icon--start': this.dsIconPosition === 'start',
|
|
41
|
+
'ds-link-with-arrow__icon--end': this.dsIconPosition === 'end',
|
|
41
42
|
});
|
|
42
|
-
return (h("a", { key: '
|
|
43
|
+
return (h("a", { key: 'be8d2878b2b0801df9d5b5988aa96ac251f659cc', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, h("slot", { key: '7b5247167879c1b0335c33c1fcf74551bb78b25d', name: "prefix" }, this.dsIconPosition === 'start' && h("ds-icon", { key: 'd1c996dee504b053d11ad790b7ce545b1e1eab1a', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), this.dsText, h("slot", { key: 'd7f14b3e9f57dc3761254852f94267a55474cd3e', name: "suffix" }, this.dsIconPosition === 'end' && h("ds-icon", { key: 'c174d0e68979dc095a08936e6fffcc3a9e434088', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), opensInNewTab(this.dsTarget) && h("ds-visually-hidden", { key: 'de0de903e0bf1733b8be9fc2b35797e944cd3470', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText())));
|
|
43
44
|
}
|
|
44
|
-
static get style() { return
|
|
45
|
+
static get style() { return dsLinkWithArrowCss; }
|
|
45
46
|
}, [1, "ds-link-with-arrow", {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"ariaLabel": [1, "aria-label"]
|
|
47
|
+
"dsText": [1, "ds-text"],
|
|
48
|
+
"dsIconPosition": [1, "ds-icon-position"],
|
|
49
|
+
"dsHref": [1, "ds-href"],
|
|
50
|
+
"dsTarget": [1, "ds-target"],
|
|
51
|
+
"dsAriaLabel": [1, "ds-aria-label"]
|
|
52
52
|
}]);
|
|
53
53
|
function defineCustomElement$1() {
|
|
54
54
|
if (typeof customElements === "undefined") {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { b as inheritSpecifiedAttributes, a as inheritAriaAttributes } from './attributes.js';
|
|
4
4
|
import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
|
|
5
|
-
import {
|
|
5
|
+
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
|
|
7
7
|
|
|
8
|
-
const dsLinkCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link{display:inline-flex;align-items:center;color:var(--ds-
|
|
9
|
-
const DsLinkStyle0 = dsLinkCss;
|
|
8
|
+
const dsLinkCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link{display:inline-flex;align-items:center;color:var(--ds-palette-mainBlue-70);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);outline:var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);outline-offset:calc(var(--ds-borderWidth-thin) * 1)}.ds-link--semibold{font-weight:var(--ds-fontWeight-semibold)}.ds-link--bold{font-weight:var(--ds-fontWeight-bold)}.ds-link--2xLarge{font-size:var(--ds-fontSize-22)}.ds-link--xLarge{font-size:var(--ds-fontSize-20)}.ds-link--large{font-size:var(--ds-fontSize-18)}.ds-link--medium{font-size:var(--ds-fontSize-16)}.ds-link--small{font-size:var(--ds-fontSize-14)}.ds-link--xSmall{font-size:var(--ds-fontSize-12)}.ds-link__icon{height:1em;width:1em}.ds-link__icon--start-inline{margin-right:var(--ds-spacing-3xSmall)}.ds-link__icon--start-standalone{margin-right:var(--ds-spacing-2xSmall)}.ds-link__icon--end-inline{margin-left:var(--ds-spacing-3xSmall)}.ds-link__icon--end-standalone{margin-left:var(--ds-spacing-2xSmall)}.ds-link:hover,.ds-link:active{text-decoration-thickness:13%;text-underline-offset:12%}.ds-link:hover{color:var(--ds-palette-mainBlue-80)}.ds-link:active{color:var(--ds-palette-mainBlue-90)}.ds-link:visited{color:#551a8b}.ds-link--standalone{color:var(--ds-palette-mainBlue-70);text-decoration-line:none}.ds-link--standalone:hover,.ds-link--standalone:active{text-decoration-line:underline}.ds-link--standalone:hover{color:var(--ds-palette-mainBlue-80)}.ds-link--standalone:active{color:var(--ds-palette-mainBlue-90)}.ds-link--standalone:focus-visible{color:var(--ds-palette-mainBlue-70)}.ds-link--standalone:visited{color:var(--ds-palette-mainBlue-70)}.ds-link--colour-white{color:var(--ds-palette-white)}.ds-link--colour-white:hover,.ds-link--colour-white:active,.ds-link--colour-white:visited,.ds-link--colour-white:focus-visible{color:var(--ds-palette-white)}.ds-link--colour-black{color:var(--ds-palette-black-95)}.ds-link--colour-black:hover,.ds-link--colour-black:active,.ds-link--colour-black:visited,.ds-link--colour-black:focus-visible{color:var(--ds-palette-black-95)}";
|
|
10
9
|
|
|
11
10
|
const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
|
|
12
11
|
const DsLink$1 = proxyCustomElement(class DsLink extends H {
|
|
@@ -19,52 +18,56 @@ const DsLink$1 = proxyCustomElement(class DsLink extends H {
|
|
|
19
18
|
rel;
|
|
20
19
|
visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
|
|
21
20
|
get el() { return this; }
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
dsText;
|
|
22
|
+
dsSize;
|
|
23
|
+
dsVariant = 'inline';
|
|
24
|
+
dsWeight = 'regular';
|
|
25
|
+
dsIcon = '';
|
|
26
|
+
dsIconPosition = 'end';
|
|
27
|
+
dsIconTitle;
|
|
28
|
+
dsIconHidden;
|
|
29
|
+
dsHref;
|
|
30
|
+
dsTarget;
|
|
31
|
+
dsDownload;
|
|
32
|
+
dsAriaLabel;
|
|
33
|
+
dsColour;
|
|
35
34
|
componentWillLoad() {
|
|
36
|
-
this.inheritedAttributes =
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
|
|
35
|
+
this.inheritedAttributes = {
|
|
36
|
+
...inheritAriaAttributes(this.el, ['aria-label']),
|
|
37
|
+
...inheritSpecifiedAttributes(this.el, ['lang']),
|
|
38
|
+
};
|
|
39
|
+
if (opensInNewTab(this.dsTarget)) {
|
|
40
|
+
this.dsIcon = 'open_in_new';
|
|
41
|
+
this.dsIconPosition = 'end';
|
|
40
42
|
this.rel = 'noopener noreferrer';
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
render() {
|
|
44
|
-
const classes = classNames('ds-link', `ds-link--${this.
|
|
45
|
-
[`ds-link--${this.
|
|
46
|
+
const classes = classNames('ds-link', `ds-link--${this.dsWeight}`, `ds-link--${this.dsVariant}`, {
|
|
47
|
+
[`ds-link--${this.dsSize}`]: !!this.dsSize,
|
|
48
|
+
[`ds-link--colour-${this.dsColour}`]: !!this.dsColour,
|
|
46
49
|
});
|
|
47
50
|
const iconClasses = classNames('ds-link__icon', {
|
|
48
|
-
[`ds-link__icon--start-${this.
|
|
49
|
-
[`ds-link__icon--end-${this.
|
|
51
|
+
[`ds-link__icon--start-${this.dsVariant}`]: this.dsIconPosition === 'start',
|
|
52
|
+
[`ds-link__icon--end-${this.dsVariant}`]: this.dsIconPosition === 'end',
|
|
50
53
|
});
|
|
51
|
-
return (h("a", { key: '
|
|
54
|
+
return (h("a", { key: 'a2dadeffad7a9ea98044d8d9e655b9623cdb287e', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, download: this.dsDownload, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, h("slot", { key: '731bfe4dc924dd63b2815daed0ebe8bf2f7c455e', name: "prefix" }, this.dsIcon && this.dsIconPosition === 'start' && (h("ds-icon", { key: '4070f566905c409d9489221edaebb796aaccf973', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), this.dsText, h("slot", { key: 'a57232ddd92c4225efe30b22247e8bf649e1f98f', name: "suffix" }, this.dsIcon && this.dsIconPosition === 'end' && (h("ds-icon", { key: '12d9a52ab321c0f607013accf39ee82947bac4eb', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), opensInNewTab(this.dsTarget) && h("ds-visually-hidden", { key: 'baf51d298ca730b60c969e980fe91eb6096bd791', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText())));
|
|
52
55
|
}
|
|
53
|
-
static get style() { return
|
|
56
|
+
static get style() { return dsLinkCss; }
|
|
54
57
|
}, [1, "ds-link", {
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
58
|
+
"dsText": [1, "ds-text"],
|
|
59
|
+
"dsSize": [1, "ds-size"],
|
|
60
|
+
"dsVariant": [1, "ds-variant"],
|
|
61
|
+
"dsWeight": [1, "ds-weight"],
|
|
62
|
+
"dsIcon": [1025, "ds-icon"],
|
|
63
|
+
"dsIconPosition": [1025, "ds-icon-position"],
|
|
64
|
+
"dsIconTitle": [1, "ds-icon-title"],
|
|
65
|
+
"dsIconHidden": [4, "ds-icon-hidden"],
|
|
66
|
+
"dsHref": [1, "ds-href"],
|
|
67
|
+
"dsTarget": [1, "ds-target"],
|
|
68
|
+
"dsDownload": [4, "ds-download"],
|
|
69
|
+
"dsAriaLabel": [1, "ds-aria-label"],
|
|
70
|
+
"dsColour": [1, "ds-colour"]
|
|
68
71
|
}]);
|
|
69
72
|
function defineCustomElement$1() {
|
|
70
73
|
if (typeof customElements === "undefined") {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsRadioButtonGroup extends Components.DsRadioButtonGroup, HTMLElement {}
|
|
4
|
+
export const DsRadioButtonGroup: {
|
|
5
|
+
prototype: DsRadioButtonGroup;
|
|
6
|
+
new (): DsRadioButtonGroup;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index2.js';
|
|
2
|
+
import { c as classNames } from './index3.js';
|
|
3
|
+
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
4
|
+
import { a as inheritAriaAttributes } from './attributes.js';
|
|
5
|
+
import { g as getRequiredText, b as atLeastOneOption } from './controlUtils.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './ds-input-validity2.js';
|
|
7
|
+
|
|
8
|
+
const dsRadioButtonGroupCss = ".ds-radio-button-group{display:inline-flex;flex-direction:column;border:none;padding:0;margin:0}.ds-radio-button-group__radio-buttons-slot{display:inline-flex;flex-direction:column}.ds-radio-button-group__radio-buttons-slot--horizontal{flex-flow:row wrap;gap:var(--ds-spacing-small)}.ds-radio-button-group__legend{padding-inline:0;color:var(--ds-palette-black-95);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);margin-bottom:var(--ds-spacing-3xSmall)}.ds-radio-button-group__assistive-text{font-size:var(--ds-fontSize-14);color:var(--ds-palette-black-70);line-height:var(--ds-lineHeight-large);margin-bottom:var(--ds-spacing-2xSmall)}";
|
|
9
|
+
|
|
10
|
+
const radioButtonGroupIdGenerator = idGenerator('ds-radio-button-group');
|
|
11
|
+
const DsRadioButtonGroup$1 = proxyCustomElement(class DsRadioButtonGroup extends H {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.__attachShadow();
|
|
16
|
+
this.dsRadioGroupValueChange = createEvent(this, "dsRadioGroupValueChange");
|
|
17
|
+
this.dsRadioGroupInvalidStateChange = createEvent(this, "dsRadioGroupInvalidStateChange");
|
|
18
|
+
this.dsChange = createEvent(this, "dsChange");
|
|
19
|
+
this.internals = this.attachInternals();
|
|
20
|
+
}
|
|
21
|
+
fieldsetId = radioButtonGroupIdGenerator.next().value;
|
|
22
|
+
errorTextId = `${this.fieldsetId}-error`;
|
|
23
|
+
assistiveTextId = `${this.fieldsetId}-assistive-text`;
|
|
24
|
+
inheritedAttributes = {};
|
|
25
|
+
get el() { return this; }
|
|
26
|
+
internals;
|
|
27
|
+
dsLegend;
|
|
28
|
+
dsAssistiveText;
|
|
29
|
+
dsValue;
|
|
30
|
+
dsDirection = 'vertical';
|
|
31
|
+
dsErrorText = '';
|
|
32
|
+
dsRequired = false;
|
|
33
|
+
showInternalsValidationMessage = false;
|
|
34
|
+
dsRadioGroupValueChange;
|
|
35
|
+
dsRadioGroupInvalidStateChange;
|
|
36
|
+
dsChange;
|
|
37
|
+
getLegendText = () => {
|
|
38
|
+
if (this.dsRequired) {
|
|
39
|
+
return getRequiredText(this.dsLegend);
|
|
40
|
+
}
|
|
41
|
+
return this.dsLegend;
|
|
42
|
+
};
|
|
43
|
+
getValidationMessage = () => this.dsErrorText || (this.showInternalsValidationMessage ? this.internals?.validationMessage : '');
|
|
44
|
+
getRadios = () => {
|
|
45
|
+
return Array.from(this.el.querySelectorAll('ds-radio-button'));
|
|
46
|
+
};
|
|
47
|
+
getEnabledRadios = () => {
|
|
48
|
+
return this.getRadios().filter(e => !e.dsDisabled);
|
|
49
|
+
};
|
|
50
|
+
updateRadios = (updateFn) => {
|
|
51
|
+
this.getRadios().forEach(updateFn);
|
|
52
|
+
};
|
|
53
|
+
updateFocusableRadioButton = () => {
|
|
54
|
+
const radios = this.getEnabledRadios();
|
|
55
|
+
if (!radios.length) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let focusableBtn = null;
|
|
59
|
+
for (const radio of radios) {
|
|
60
|
+
const isFocusable = radio.dsValue === this.dsValue;
|
|
61
|
+
radio.setFocusable(isFocusable);
|
|
62
|
+
if (isFocusable) {
|
|
63
|
+
focusableBtn = radio;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (!focusableBtn) {
|
|
67
|
+
radios[0].setFocusable(true);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
formResetCallback() {
|
|
71
|
+
this.internals?.setValidity({});
|
|
72
|
+
}
|
|
73
|
+
componentWillLoad() {
|
|
74
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-labelledby']);
|
|
75
|
+
this.updateFocusableRadioButton();
|
|
76
|
+
}
|
|
77
|
+
componentDidLoad() {
|
|
78
|
+
this.updateRadios(element => {
|
|
79
|
+
element.setAttribute('ds-errors-disabled', 'true');
|
|
80
|
+
});
|
|
81
|
+
if (this.dsRequired) {
|
|
82
|
+
this.internals?.setValidity({ valueMissing: true }, atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async getValue() {
|
|
86
|
+
return this.dsValue;
|
|
87
|
+
}
|
|
88
|
+
errorTextObserver(errorText) {
|
|
89
|
+
this.dsRadioGroupInvalidStateChange.emit(!!errorText);
|
|
90
|
+
}
|
|
91
|
+
dsValueObserver(value) {
|
|
92
|
+
this.dsChange.emit(value);
|
|
93
|
+
if (this.dsRequired) {
|
|
94
|
+
this.internals?.setValidity({ valueMissing: !value }, atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
onInputChange(e) {
|
|
98
|
+
e.stopPropagation();
|
|
99
|
+
const targetElem = e.target;
|
|
100
|
+
this.dsValue = targetElem.dsValue;
|
|
101
|
+
this.dsRadioGroupValueChange.emit(this.dsValue);
|
|
102
|
+
this.updateFocusableRadioButton();
|
|
103
|
+
}
|
|
104
|
+
onKeyDown(e) {
|
|
105
|
+
if (!['ArrowUp', 'ArrowLeft', 'ArrowDown', 'ArrowRight'].includes(e.key)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (e.target && !this.el.contains(e.target)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const radios = this.getEnabledRadios();
|
|
112
|
+
if (e.target && !radios.includes(e.target)) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
const currentIndex = radios.findIndex(r => r === e.target);
|
|
117
|
+
let nextIndex;
|
|
118
|
+
if (['ArrowUp', 'ArrowLeft'].includes(e.key)) {
|
|
119
|
+
nextIndex = currentIndex === 0 ? radios.length - 1 : currentIndex - 1;
|
|
120
|
+
}
|
|
121
|
+
if (['ArrowDown', 'ArrowRight'].includes(e.key)) {
|
|
122
|
+
nextIndex = (currentIndex + 1) % radios.length;
|
|
123
|
+
}
|
|
124
|
+
const nextElem = radios[nextIndex];
|
|
125
|
+
nextElem.dsFocus();
|
|
126
|
+
nextElem.setChecked();
|
|
127
|
+
}
|
|
128
|
+
render() {
|
|
129
|
+
const classes = classNames('ds-radio-button-group');
|
|
130
|
+
const legendClasses = classNames('ds-radio-button-group__legend');
|
|
131
|
+
const assistiveTextClasses = classNames('ds-radio-button-group__assistive-text');
|
|
132
|
+
const radioButtonsSlotClasses = classNames('ds-radio-button-group__radio-buttons-slot', {
|
|
133
|
+
'ds-radio-button-group__radio-buttons-slot--horizontal': this.dsDirection === 'horizontal',
|
|
134
|
+
});
|
|
135
|
+
const errorClasses = classNames('ds-radio-button-group__error');
|
|
136
|
+
const ariaDescribedBy = [!!this.dsAssistiveText && this.assistiveTextId, !!this.dsErrorText && this.errorTextId].filter(Boolean).join(' ');
|
|
137
|
+
return (h(Host, { key: 'fd0fece58fea50d7ea0672b7f49608c2cdcb306e', "data-invalid": !!this.dsErrorText || undefined }, h("fieldset", { key: '809c66ac58f880345c231b2930ddd9c91c61cbc2', class: classes, "aria-describedby": ariaDescribedBy, ...this.inheritedAttributes }, h("legend", { key: '5194fa04e6645381ef83ad5b4f09c98ea6757da4', class: legendClasses }, h("slot", { key: '2944e5176ce596d6ab5ee6ee735f5b1e5a4e892b', name: "legend" }, this.getLegendText())), h("slot", { key: '3df729bf79cef8d07e88c3e52e337a54a3fb4ead', name: "assistiveText" }, this.dsAssistiveText && (h("small", { key: '36148c44fd5cc17ae506ab598ff79de41e23b71f', class: assistiveTextClasses, id: this.assistiveTextId }, this.dsAssistiveText))), h("div", { key: '54380add5970ee72c0357b9562815d39a95602f0', class: radioButtonsSlotClasses }, h("slot", { key: '3ec766be90173f61dbb76b762c7f6d3f9781570f', onSlotchange: this.updateFocusableRadioButton })), (!!this.dsErrorText || this.dsRequired) && (h("slot", { key: 'c8ae86acd96ecba84d7ab83dad731511629e3f4b', name: "validity" }, h("div", { key: 'da0ce15f076e2c76ca040a6ad6100d706e576862', class: errorClasses }, h("ds-input-validity", { key: 'd9beed52855b81a8125cb0c6498b023357383328', id: this.errorTextId, dsText: this.getValidationMessage(), dsType: "error", dsAriaLive: "polite", dsAriaAtomic: "true" })))))));
|
|
138
|
+
}
|
|
139
|
+
static get formAssociated() { return true; }
|
|
140
|
+
static get watchers() { return {
|
|
141
|
+
"dsErrorText": ["errorTextObserver"],
|
|
142
|
+
"dsValue": ["dsValueObserver"]
|
|
143
|
+
}; }
|
|
144
|
+
static get style() { return dsRadioButtonGroupCss; }
|
|
145
|
+
}, [65, "ds-radio-button-group", {
|
|
146
|
+
"dsLegend": [1, "ds-legend"],
|
|
147
|
+
"dsAssistiveText": [1, "ds-assistive-text"],
|
|
148
|
+
"dsValue": [1025, "ds-value"],
|
|
149
|
+
"dsDirection": [1, "ds-direction"],
|
|
150
|
+
"dsErrorText": [1, "ds-error-text"],
|
|
151
|
+
"dsRequired": [4, "ds-required"],
|
|
152
|
+
"showInternalsValidationMessage": [32],
|
|
153
|
+
"getValue": [64]
|
|
154
|
+
}, [[0, "dsRadioButtonChecked", "onInputChange"], [4, "keydown", "onKeyDown"]], {
|
|
155
|
+
"dsErrorText": ["errorTextObserver"],
|
|
156
|
+
"dsValue": ["dsValueObserver"]
|
|
157
|
+
}]);
|
|
158
|
+
function defineCustomElement$1() {
|
|
159
|
+
if (typeof customElements === "undefined") {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const components = ["ds-radio-button-group", "ds-icon", "ds-input-validity"];
|
|
163
|
+
components.forEach(tagName => { switch (tagName) {
|
|
164
|
+
case "ds-radio-button-group":
|
|
165
|
+
if (!customElements.get(tagName)) {
|
|
166
|
+
customElements.define(tagName, DsRadioButtonGroup$1);
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
169
|
+
case "ds-icon":
|
|
170
|
+
if (!customElements.get(tagName)) {
|
|
171
|
+
defineCustomElement$3();
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case "ds-input-validity":
|
|
175
|
+
if (!customElements.get(tagName)) {
|
|
176
|
+
defineCustomElement$2();
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
} });
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const DsRadioButtonGroup = DsRadioButtonGroup$1;
|
|
183
|
+
const defineCustomElement = defineCustomElement$1;
|
|
184
|
+
|
|
185
|
+
export { DsRadioButtonGroup, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsRadioButton extends Components.DsRadioButton, HTMLElement {}
|
|
4
|
+
export const DsRadioButton: {
|
|
5
|
+
prototype: DsRadioButton;
|
|
6
|
+
new (): DsRadioButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|