@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,22 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
+
var index$2 = require('./index-DwLFyR5p.js');
|
|
4
6
|
|
|
5
|
-
const
|
|
6
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
const store = require('./store-9bd20f3c.js');
|
|
8
|
-
|
|
9
|
-
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-textColor-danger)}.ds-input-validity--success{color:var(--ds-textColor-success)}.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)}";
|
|
10
|
-
const DsInputValidityStyle0 = dsInputValidityCss;
|
|
7
|
+
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)}";
|
|
11
8
|
|
|
12
9
|
const DsInputValidity = class {
|
|
13
10
|
constructor(hostRef) {
|
|
14
11
|
index.registerInstance(this, hostRef);
|
|
15
12
|
}
|
|
16
13
|
get el() { return index.getElement(this); }
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
dsText;
|
|
15
|
+
dsType = 'error';
|
|
16
|
+
dsValidityRole;
|
|
17
|
+
dsAriaLive;
|
|
18
|
+
dsAriaAtomic;
|
|
20
19
|
identifier;
|
|
21
20
|
componentDidLoad() {
|
|
22
21
|
this.identifier = this.el.getAttribute('id');
|
|
@@ -24,13 +23,13 @@ const DsInputValidity = class {
|
|
|
24
23
|
}
|
|
25
24
|
render() {
|
|
26
25
|
const classes = index$1.classNames('ds-input-validity', {
|
|
27
|
-
'ds-input-validity--error': this.
|
|
28
|
-
'ds-input-validity--success': this.
|
|
26
|
+
'ds-input-validity--error': this.dsType === 'error',
|
|
27
|
+
'ds-input-validity--success': this.dsType === 'success',
|
|
29
28
|
});
|
|
30
|
-
const icon = this.
|
|
31
|
-
return (index.h("div", { key: '
|
|
29
|
+
const icon = this.dsType === 'success' ? 'check_circle_fill' : 'warning_fill';
|
|
30
|
+
return (index.h("div", { key: '469ca293035b5f7f7f832fcde1651aef6d8a7e93', role: index$2.isValidation('client') ? this.dsValidityRole : undefined, "aria-live": index$2.isValidation('client') ? this.dsAriaLive : undefined, "aria-atomic": index$2.isValidation('client') ? this.dsAriaAtomic : undefined }, this.dsText && (index.h("div", { key: 'c1b800c75f2434fd3f26f656289853897a5fd485', class: classes }, index.h("ds-icon", { key: '7af7ca8d0ab5be6b795f4143c310b5134cadc7cd', dsName: icon }), index.h("small", { key: '81f8f36d3558f98331a0ec15cffcc3a6bb41f449', id: this.identifier }, this.dsText)))));
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
|
-
DsInputValidity.style =
|
|
33
|
+
DsInputValidity.style = dsInputValidityCss;
|
|
35
34
|
|
|
36
35
|
exports.ds_input_validity = DsInputValidity;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
6
|
+
var linkUtils = require('./linkUtils-onlbgKdI.js');
|
|
7
|
+
var utils = require('./utils-BjZTECpy.js');
|
|
8
|
+
require('./index-DwLFyR5p.js');
|
|
4
9
|
|
|
5
|
-
const
|
|
6
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
const utils = require('./utils-3412cbed.js');
|
|
8
|
-
const linkUtils = require('./linkUtils-695da37c.js');
|
|
9
|
-
|
|
10
|
-
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-textColor-link);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-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}@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-textColor-white);background-color:var(--ds-bgColor-primary)}.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-bgColor-primary-hover)}:active slot>.ds-link-with-arrow__icon{background-color:var(--ds-bgColor-primary-active)}.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-textColor-link-hover)}.ds-link-with-arrow:active,.ds-link-with-arrow:focus-visible{color:var(--ds-textColor-link-active)}";
|
|
11
|
-
const DsLinkWithArrowStyle0 = dsLinkWithArrowCss;
|
|
10
|
+
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)}";
|
|
12
11
|
|
|
13
12
|
const visuallyHiddenAssistiveTextIdGenerator = utils.idGenerator('visually-hidden-assistive-text');
|
|
14
13
|
const DsLinkWithArrow = class {
|
|
@@ -20,15 +19,17 @@ const DsLinkWithArrow = class {
|
|
|
20
19
|
rel;
|
|
21
20
|
visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
|
|
22
21
|
get el() { return index.getElement(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
|
+
...attributes.inheritAriaAttributes(this.el, ['aria-label']),
|
|
30
|
+
...attributes.inheritSpecifiedAttributes(this.el, ['lang']),
|
|
31
|
+
};
|
|
32
|
+
if (linkUtils.opensInNewTab(this.dsTarget)) {
|
|
32
33
|
this.icon = 'arrow_outward';
|
|
33
34
|
this.rel = 'noopener noreferrer';
|
|
34
35
|
}
|
|
@@ -36,12 +37,12 @@ const DsLinkWithArrow = class {
|
|
|
36
37
|
render() {
|
|
37
38
|
const classes = index$1.classNames('ds-link-with-arrow');
|
|
38
39
|
const iconClasses = index$1.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 (index.h("a", { key: '
|
|
43
|
+
return (index.h("a", { key: 'be8d2878b2b0801df9d5b5988aa96ac251f659cc', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, index.h("slot", { key: '7b5247167879c1b0335c33c1fcf74551bb78b25d', name: "prefix" }, this.dsIconPosition === 'start' && index.h("ds-icon", { key: 'd1c996dee504b053d11ad790b7ce545b1e1eab1a', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), this.dsText, index.h("slot", { key: 'd7f14b3e9f57dc3761254852f94267a55474cd3e', name: "suffix" }, this.dsIconPosition === 'end' && index.h("ds-icon", { key: 'c174d0e68979dc095a08936e6fffcc3a9e434088', dsName: this.icon, class: iconClasses, dsSize: "1.4em" })), linkUtils.opensInNewTab(this.dsTarget) && index.h("ds-visually-hidden", { key: 'de0de903e0bf1733b8be9fc2b35797e944cd3470', id: this.visuallyHiddenAssistiveTextId }, linkUtils.visuallyHiddenAssistiveText())));
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
DsLinkWithArrow.style =
|
|
46
|
+
DsLinkWithArrow.style = dsLinkWithArrowCss;
|
|
46
47
|
|
|
47
48
|
exports.ds_link_with_arrow = DsLinkWithArrow;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
6
|
+
var linkUtils = require('./linkUtils-onlbgKdI.js');
|
|
7
|
+
var utils = require('./utils-BjZTECpy.js');
|
|
8
|
+
require('./index-DwLFyR5p.js');
|
|
4
9
|
|
|
5
|
-
const
|
|
6
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
const utils = require('./utils-3412cbed.js');
|
|
8
|
-
const linkUtils = require('./linkUtils-695da37c.js');
|
|
9
|
-
|
|
10
|
-
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-textColor-link);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-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.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-textColor-link-hover)}.ds-link:active{color:var(--ds-textColor-link-active)}.ds-link:visited{color:var(--ds-textColor-link-visited)}.ds-link--standalone{color:var(--ds-textColor-link);text-decoration-line:none}.ds-link--standalone:hover,.ds-link--standalone:active{text-decoration-line:underline}.ds-link--standalone:hover{color:var(--ds-textColor-link-hover)}.ds-link--standalone:active{color:var(--ds-textColor-link-active)}.ds-link--standalone:focus-visible{color:var(--ds-textColor-link)}.ds-link--standalone:visited{color:var(--ds-textColor-link)}";
|
|
11
|
-
const DsLinkStyle0 = dsLinkCss;
|
|
10
|
+
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)}";
|
|
12
11
|
|
|
13
12
|
const visuallyHiddenAssistiveTextIdGenerator = utils.idGenerator('visually-hidden-assistive-text');
|
|
14
13
|
const DsLink = class {
|
|
@@ -19,38 +18,42 @@ const DsLink = class {
|
|
|
19
18
|
rel;
|
|
20
19
|
visuallyHiddenAssistiveTextId = visuallyHiddenAssistiveTextIdGenerator.next().value;
|
|
21
20
|
get el() { return index.getElement(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
|
+
...attributes.inheritAriaAttributes(this.el, ['aria-label']),
|
|
37
|
+
...attributes.inheritSpecifiedAttributes(this.el, ['lang']),
|
|
38
|
+
};
|
|
39
|
+
if (linkUtils.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 = index$1.classNames('ds-link', `ds-link--${this.
|
|
45
|
-
[`ds-link--${this.
|
|
46
|
+
const classes = index$1.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 = index$1.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 (index.h("a", { key: '
|
|
54
|
+
return (index.h("a", { key: 'a2dadeffad7a9ea98044d8d9e655b9623cdb287e', href: this.dsHref, class: classes, rel: this.rel, target: this.dsTarget, download: this.dsDownload, "aria-label": this.dsAriaLabel, ...this.inheritedAttributes }, index.h("slot", { key: '731bfe4dc924dd63b2815daed0ebe8bf2f7c455e', name: "prefix" }, this.dsIcon && this.dsIconPosition === 'start' && (index.h("ds-icon", { key: '4070f566905c409d9489221edaebb796aaccf973', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), this.dsText, index.h("slot", { key: 'a57232ddd92c4225efe30b22247e8bf649e1f98f', name: "suffix" }, this.dsIcon && this.dsIconPosition === 'end' && (index.h("ds-icon", { key: '12d9a52ab321c0f607013accf39ee82947bac4eb', dsName: this.dsIcon, class: iconClasses, dsSize: "1em", dsTitle: this.dsIconTitle, dsHidden: this.dsIconHidden }))), linkUtils.opensInNewTab(this.dsTarget) && index.h("ds-visually-hidden", { key: 'baf51d298ca730b60c969e980fe91eb6096bd791', id: this.visuallyHiddenAssistiveTextId }, linkUtils.visuallyHiddenAssistiveText())));
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
|
-
DsLink.style =
|
|
57
|
+
DsLink.style = dsLinkCss;
|
|
55
58
|
|
|
56
59
|
exports.ds_link = DsLink;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
5
|
+
var utils = require('./utils-BjZTECpy.js');
|
|
6
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
7
|
+
var controlUtils = require('./controlUtils-ofqiQxRF.js');
|
|
8
|
+
require('./index-DwLFyR5p.js');
|
|
9
|
+
|
|
10
|
+
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)}";
|
|
11
|
+
|
|
12
|
+
const radioButtonGroupIdGenerator = utils.idGenerator('ds-radio-button-group');
|
|
13
|
+
const DsRadioButtonGroup = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
index.registerInstance(this, hostRef);
|
|
16
|
+
this.dsRadioGroupValueChange = index.createEvent(this, "dsRadioGroupValueChange");
|
|
17
|
+
this.dsRadioGroupInvalidStateChange = index.createEvent(this, "dsRadioGroupInvalidStateChange");
|
|
18
|
+
this.dsChange = index.createEvent(this, "dsChange");
|
|
19
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
20
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
24
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
fieldsetId = radioButtonGroupIdGenerator.next().value;
|
|
28
|
+
errorTextId = `${this.fieldsetId}-error`;
|
|
29
|
+
assistiveTextId = `${this.fieldsetId}-assistive-text`;
|
|
30
|
+
inheritedAttributes = {};
|
|
31
|
+
get el() { return index.getElement(this); }
|
|
32
|
+
internals;
|
|
33
|
+
dsLegend;
|
|
34
|
+
dsAssistiveText;
|
|
35
|
+
dsValue;
|
|
36
|
+
dsDirection = 'vertical';
|
|
37
|
+
dsErrorText = '';
|
|
38
|
+
dsRequired = false;
|
|
39
|
+
showInternalsValidationMessage = false;
|
|
40
|
+
dsRadioGroupValueChange;
|
|
41
|
+
dsRadioGroupInvalidStateChange;
|
|
42
|
+
dsChange;
|
|
43
|
+
getLegendText = () => {
|
|
44
|
+
if (this.dsRequired) {
|
|
45
|
+
return controlUtils.getRequiredText(this.dsLegend);
|
|
46
|
+
}
|
|
47
|
+
return this.dsLegend;
|
|
48
|
+
};
|
|
49
|
+
getValidationMessage = () => this.dsErrorText || (this.showInternalsValidationMessage ? this.internals?.validationMessage : '');
|
|
50
|
+
getRadios = () => {
|
|
51
|
+
return Array.from(this.el.querySelectorAll('ds-radio-button'));
|
|
52
|
+
};
|
|
53
|
+
getEnabledRadios = () => {
|
|
54
|
+
return this.getRadios().filter(e => !e.dsDisabled);
|
|
55
|
+
};
|
|
56
|
+
updateRadios = (updateFn) => {
|
|
57
|
+
this.getRadios().forEach(updateFn);
|
|
58
|
+
};
|
|
59
|
+
updateFocusableRadioButton = () => {
|
|
60
|
+
const radios = this.getEnabledRadios();
|
|
61
|
+
if (!radios.length) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let focusableBtn = null;
|
|
65
|
+
for (const radio of radios) {
|
|
66
|
+
const isFocusable = radio.dsValue === this.dsValue;
|
|
67
|
+
radio.setFocusable(isFocusable);
|
|
68
|
+
if (isFocusable) {
|
|
69
|
+
focusableBtn = radio;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!focusableBtn) {
|
|
73
|
+
radios[0].setFocusable(true);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
formResetCallback() {
|
|
77
|
+
this.internals?.setValidity({});
|
|
78
|
+
}
|
|
79
|
+
componentWillLoad() {
|
|
80
|
+
this.inheritedAttributes = attributes.inheritAriaAttributes(this.el, ['aria-labelledby']);
|
|
81
|
+
this.updateFocusableRadioButton();
|
|
82
|
+
}
|
|
83
|
+
componentDidLoad() {
|
|
84
|
+
this.updateRadios(element => {
|
|
85
|
+
element.setAttribute('ds-errors-disabled', 'true');
|
|
86
|
+
});
|
|
87
|
+
if (this.dsRequired) {
|
|
88
|
+
this.internals?.setValidity({ valueMissing: true }, controlUtils.atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async getValue() {
|
|
92
|
+
return this.dsValue;
|
|
93
|
+
}
|
|
94
|
+
errorTextObserver(errorText) {
|
|
95
|
+
this.dsRadioGroupInvalidStateChange.emit(!!errorText);
|
|
96
|
+
}
|
|
97
|
+
dsValueObserver(value) {
|
|
98
|
+
this.dsChange.emit(value);
|
|
99
|
+
if (this.dsRequired) {
|
|
100
|
+
this.internals?.setValidity({ valueMissing: !value }, controlUtils.atLeastOneOption(), this.getRadios()?.[0].shadowRoot.querySelector('input'));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
onInputChange(e) {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
const targetElem = e.target;
|
|
106
|
+
this.dsValue = targetElem.dsValue;
|
|
107
|
+
this.dsRadioGroupValueChange.emit(this.dsValue);
|
|
108
|
+
this.updateFocusableRadioButton();
|
|
109
|
+
}
|
|
110
|
+
onKeyDown(e) {
|
|
111
|
+
if (!['ArrowUp', 'ArrowLeft', 'ArrowDown', 'ArrowRight'].includes(e.key)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (e.target && !this.el.contains(e.target)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const radios = this.getEnabledRadios();
|
|
118
|
+
if (e.target && !radios.includes(e.target)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
const currentIndex = radios.findIndex(r => r === e.target);
|
|
123
|
+
let nextIndex;
|
|
124
|
+
if (['ArrowUp', 'ArrowLeft'].includes(e.key)) {
|
|
125
|
+
nextIndex = currentIndex === 0 ? radios.length - 1 : currentIndex - 1;
|
|
126
|
+
}
|
|
127
|
+
if (['ArrowDown', 'ArrowRight'].includes(e.key)) {
|
|
128
|
+
nextIndex = (currentIndex + 1) % radios.length;
|
|
129
|
+
}
|
|
130
|
+
const nextElem = radios[nextIndex];
|
|
131
|
+
nextElem.dsFocus();
|
|
132
|
+
nextElem.setChecked();
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
const classes = index$1.classNames('ds-radio-button-group');
|
|
136
|
+
const legendClasses = index$1.classNames('ds-radio-button-group__legend');
|
|
137
|
+
const assistiveTextClasses = index$1.classNames('ds-radio-button-group__assistive-text');
|
|
138
|
+
const radioButtonsSlotClasses = index$1.classNames('ds-radio-button-group__radio-buttons-slot', {
|
|
139
|
+
'ds-radio-button-group__radio-buttons-slot--horizontal': this.dsDirection === 'horizontal',
|
|
140
|
+
});
|
|
141
|
+
const errorClasses = index$1.classNames('ds-radio-button-group__error');
|
|
142
|
+
const ariaDescribedBy = [!!this.dsAssistiveText && this.assistiveTextId, !!this.dsErrorText && this.errorTextId].filter(Boolean).join(' ');
|
|
143
|
+
return (index.h(index.Host, { key: 'fd0fece58fea50d7ea0672b7f49608c2cdcb306e', "data-invalid": !!this.dsErrorText || undefined }, index.h("fieldset", { key: '809c66ac58f880345c231b2930ddd9c91c61cbc2', class: classes, "aria-describedby": ariaDescribedBy, ...this.inheritedAttributes }, index.h("legend", { key: '5194fa04e6645381ef83ad5b4f09c98ea6757da4', class: legendClasses }, index.h("slot", { key: '2944e5176ce596d6ab5ee6ee735f5b1e5a4e892b', name: "legend" }, this.getLegendText())), index.h("slot", { key: '3df729bf79cef8d07e88c3e52e337a54a3fb4ead', name: "assistiveText" }, this.dsAssistiveText && (index.h("small", { key: '36148c44fd5cc17ae506ab598ff79de41e23b71f', class: assistiveTextClasses, id: this.assistiveTextId }, this.dsAssistiveText))), index.h("div", { key: '54380add5970ee72c0357b9562815d39a95602f0', class: radioButtonsSlotClasses }, index.h("slot", { key: '3ec766be90173f61dbb76b762c7f6d3f9781570f', onSlotchange: this.updateFocusableRadioButton })), (!!this.dsErrorText || this.dsRequired) && (index.h("slot", { key: 'c8ae86acd96ecba84d7ab83dad731511629e3f4b', name: "validity" }, index.h("div", { key: 'da0ce15f076e2c76ca040a6ad6100d706e576862', class: errorClasses }, index.h("ds-input-validity", { key: 'd9beed52855b81a8125cb0c6498b023357383328', id: this.errorTextId, dsText: this.getValidationMessage(), dsType: "error", dsAriaLive: "polite", dsAriaAtomic: "true" })))))));
|
|
144
|
+
}
|
|
145
|
+
static get formAssociated() { return true; }
|
|
146
|
+
static get watchers() { return {
|
|
147
|
+
"dsErrorText": ["errorTextObserver"],
|
|
148
|
+
"dsValue": ["dsValueObserver"]
|
|
149
|
+
}; }
|
|
150
|
+
};
|
|
151
|
+
DsRadioButtonGroup.style = dsRadioButtonGroupCss;
|
|
152
|
+
|
|
153
|
+
exports.ds_radio_button_group = DsRadioButtonGroup;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
5
|
+
var controlUtils = require('./controlUtils-ofqiQxRF.js');
|
|
6
|
+
var utils = require('./utils-BjZTECpy.js');
|
|
7
|
+
var index$2 = require('./index-Bp6Dd2i1.js');
|
|
8
|
+
var index$1 = require('./index-DwLFyR5p.js');
|
|
9
|
+
|
|
10
|
+
const dsRadioButtonCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-radio-button{box-sizing:border-box;display:inline-flex;color:var(--ds-palette-black-95)}.ds-radio-button--disabled{color:var(--ds-palette-black-40)}.ds-radio-button__validity{margin-left:10px}.ds-radio-button:has(input:focus-visible) .ds-radio-button__icon{box-shadow:inset 0 0 0 var(--ds-borderWidth-thick) var(--ds-palette-white);outline:var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);outline-offset:calc(var(--ds-borderWidth-thin) * -1 * 5)}.ds-radio-button__icon{border-radius:50%;height:44px;width:44px}.ds-radio-button__text{margin-top:11px}.ds-radio-button__icon__outer-circle{stroke:var(--ds-palette-black-50);fill:var(--ds-palette-white)}.ds-radio-button__icon__outer-circle--checked{stroke:var(--ds-palette-mainBlue-70);fill:var(--ds-palette-white)}.ds-radio-button__icon__inner-circle{stroke:unset;fill:var(--ds-palette-mainBlue-70)}.ds-radio-button:hover:not(.ds-radio-button--disabled) .ds-radio-button__icon__outer-circle{stroke:var(--ds-palette-black-50);fill:var(--ds-palette-black-10)}.ds-radio-button:hover:not(.ds-radio-button--disabled) .ds-radio-button__icon__outer-circle--checked{stroke:var(--ds-palette-mainBlue-80);fill:var(--ds-palette-white)}.ds-radio-button:hover:not(.ds-radio-button--disabled) .ds-radio-button__icon__inner-circle{stroke:unset;fill:var(--ds-palette-mainBlue-80)}.ds-radio-button:active:not(.ds-radio-button--disabled) .ds-radio-button__icon__outer-circle{stroke:var(--ds-palette-black-50);fill:var(--ds-palette-black-20)}.ds-radio-button:active:not(.ds-radio-button--disabled) .ds-radio-button__icon__outer-circle--checked{stroke:var(--ds-palette-mainBlue-90);fill:var(--ds-palette-white)}.ds-radio-button:active:not(.ds-radio-button--disabled) .ds-radio-button__icon__inner-circle{stroke:unset;fill:var(--ds-palette-mainBlue-90)}.ds-radio-button--disabled .ds-radio-button__icon__outer-circle{stroke:var(--ds-overlay-black-15);fill:var(--ds-overlay-black-10)}.ds-radio-button--disabled .ds-radio-button__icon__outer-circle--checked{stroke:var(--ds-overlay-black-15);fill:var(--ds-overlay-black-10)}.ds-radio-button--disabled .ds-radio-button__icon__inner-circle{stroke:unset;fill:var(--ds-overlay-black-15)}.ds-radio-button--invalid .ds-radio-button__icon__outer-circle{stroke:var(--ds-palette-red-50);fill:var(--ds-palette-white)}.ds-radio-button--invalid .ds-radio-button__icon__outer-circle--checked{stroke:var(--ds-palette-red-50);fill:var(--ds-palette-white)}.ds-radio-button--invalid .ds-radio-button__icon__inner-circle{stroke:unset;fill:var(--ds-palette-mainBlue-70)}.ds-radio-button-fieldset{display:inline-flex;flex-direction:column;border:none;margin:0;padding:0}.ds-radio-button-fieldset__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-fieldset__assistive-text{display:inline;font-size:var(--ds-fontSize-14);color:var(--ds-palette-black-70);line-height:var(--ds-lineHeight-large)}";
|
|
11
|
+
|
|
12
|
+
const radioButtonIdGenerator = utils.idGenerator('ds-radio-button');
|
|
13
|
+
const DsRadioButton = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
index.registerInstance(this, hostRef);
|
|
16
|
+
this.dsChange = index.createEvent(this, "dsChange");
|
|
17
|
+
this.dsRadioButtonChecked = index.createEvent(this, "dsRadioButtonChecked");
|
|
18
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
19
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
23
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
radioGroup = null;
|
|
27
|
+
inputElem;
|
|
28
|
+
dsChange;
|
|
29
|
+
dsRadioButtonChecked;
|
|
30
|
+
get el() { return index.getElement(this); }
|
|
31
|
+
internals;
|
|
32
|
+
dsId = radioButtonIdGenerator.next().value;
|
|
33
|
+
dsErrorsDisabled = false;
|
|
34
|
+
dsValue = this.dsId;
|
|
35
|
+
dsLegend;
|
|
36
|
+
dsAssistiveText;
|
|
37
|
+
dsText;
|
|
38
|
+
dsRequired = false;
|
|
39
|
+
dsDisabled = false;
|
|
40
|
+
dsChecked = false;
|
|
41
|
+
dsErrorText = '';
|
|
42
|
+
focusable = true;
|
|
43
|
+
invalid = !!this.dsErrorText;
|
|
44
|
+
initialChecked = this.dsChecked;
|
|
45
|
+
validationMessage;
|
|
46
|
+
errorTextId = `${this.dsId}-error`;
|
|
47
|
+
assistiveTextId = `${this.dsId}-assistive-text`;
|
|
48
|
+
async dsFocus() {
|
|
49
|
+
this.inputElem.focus();
|
|
50
|
+
}
|
|
51
|
+
async setFocusable(flag) {
|
|
52
|
+
this.focusable = flag;
|
|
53
|
+
}
|
|
54
|
+
async setChecked() {
|
|
55
|
+
this.dsChecked = true;
|
|
56
|
+
this.internals?.setFormValue('true');
|
|
57
|
+
this.dsRadioButtonChecked.emit();
|
|
58
|
+
if (index$1.isValidation('client') && this.validationMessage) {
|
|
59
|
+
this.validationMessage = this.getValidationMessage();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
dsCheckedObserver(isChecked) {
|
|
63
|
+
this.dsChange.emit(isChecked);
|
|
64
|
+
}
|
|
65
|
+
inheritedAttributes = {};
|
|
66
|
+
getValidationMessage = () => (!this.dsErrorsDisabled ? this.dsErrorText || this.internals?.validationMessage || this.inputElem?.validationMessage : '');
|
|
67
|
+
componentWillLoad() {
|
|
68
|
+
this.inheritedAttributes = {
|
|
69
|
+
...attributes.inheritAttributes(this, this.el),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
formResetCallback() {
|
|
73
|
+
this.dsChecked = this.initialChecked;
|
|
74
|
+
this.internals.setValidity({});
|
|
75
|
+
this.internals.setFormValue(this.dsChecked.toString());
|
|
76
|
+
}
|
|
77
|
+
connectedCallback() {
|
|
78
|
+
this.radioGroup = this.el.closest('ds-radio-button-group');
|
|
79
|
+
if (this.radioGroup) {
|
|
80
|
+
this.updateCheckedState();
|
|
81
|
+
this.invalid = !!this.radioGroup.dsErrorText;
|
|
82
|
+
this.radioGroup.addEventListener('dsRadioGroupValueChange', this.updateCheckedState);
|
|
83
|
+
this.radioGroup.addEventListener('dsRadioGroupInvalidStateChange', this.updateInvalidState);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
if (this.radioGroup) {
|
|
88
|
+
this.radioGroup.removeEventListener('dsRadioGroupValueChange', this.updateCheckedState);
|
|
89
|
+
this.radioGroup.removeEventListener('dsRadioGroupInvalidStateChange', this.updateInvalidState);
|
|
90
|
+
}
|
|
91
|
+
this.radioGroup = null;
|
|
92
|
+
}
|
|
93
|
+
updateCheckedState = async () => {
|
|
94
|
+
this.dsChecked = this.dsValue === (await this.radioGroup.getValue());
|
|
95
|
+
};
|
|
96
|
+
updateInvalidState = (e) => {
|
|
97
|
+
this.invalid = e.detail;
|
|
98
|
+
};
|
|
99
|
+
handleInput = () => {
|
|
100
|
+
this.setChecked();
|
|
101
|
+
};
|
|
102
|
+
handleBlur = () => {
|
|
103
|
+
if (index$1.isValidation('client')) {
|
|
104
|
+
this.validationMessage = this.getValidationMessage();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
getLegendText = () => {
|
|
108
|
+
if (this.dsRequired) {
|
|
109
|
+
return controlUtils.getRequiredText(this.dsLegend);
|
|
110
|
+
}
|
|
111
|
+
return this.dsLegend;
|
|
112
|
+
};
|
|
113
|
+
renderRadioIcon() {
|
|
114
|
+
const iconClass = 'ds-radio-button__icon';
|
|
115
|
+
const outerCircleClasses = index$2.classNames(`${iconClass}__outer-circle`, {
|
|
116
|
+
[`${iconClass}__outer-circle--checked`]: this.dsChecked,
|
|
117
|
+
});
|
|
118
|
+
const innerCircleClasses = index$2.classNames(`${iconClass}__inner-circle`);
|
|
119
|
+
return (index.h("slot", { name: "icon" }, index.h("div", { class: iconClass, "aria-hidden": "true" }, index.h("svg", { width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("rect", { x: "10", y: "10", width: "24", height: "24", rx: "12", fill: "white" }), index.h("circle", { class: outerCircleClasses, cx: "22", cy: "22", r: "10", fill: "white", stroke: "#005A94", "stroke-width": "2" }), this.dsChecked && index.h("circle", { class: innerCircleClasses, cx: "22", cy: "22", r: "6", fill: "#005A94" })))));
|
|
120
|
+
}
|
|
121
|
+
renderRadioButton() {
|
|
122
|
+
const classes = index$2.classNames('ds-radio-button', {
|
|
123
|
+
'ds-radio-button--disabled': this.dsDisabled,
|
|
124
|
+
'ds-radio-button--invalid': !!this.dsErrorText || this.invalid,
|
|
125
|
+
});
|
|
126
|
+
const inputClasses = index$2.classNames('ds-radio-button__input');
|
|
127
|
+
const textClasses = index$2.classNames('ds-radio-button__text');
|
|
128
|
+
const tabindex = this.focusable ? 0 : -1;
|
|
129
|
+
return (index.h(index.Fragment, null, index.h("div", null, index.h("label", { class: classes }, index.h("ds-visually-hidden", null, index.h("input", { ref: ref => (this.inputElem = ref), type: "radio", class: inputClasses, value: this.dsValue, disabled: this.dsDisabled, onInput: this.handleInput, onBlur: this.handleBlur, checked: this.dsChecked, tabindex: tabindex, ...this.inheritedAttributes })), this.renderRadioIcon(), index.h("slot", null, index.h("span", { class: textClasses }, this.dsText)))), !this.dsErrorsDisabled && (index.h("slot", { name: "validity" }, index.h("div", { class: "ds-radio-button__validity" }, index.h("ds-input-validity", { id: this.errorTextId, dsText: this.dsErrorText, dsType: "error", dsAriaLive: "polite", dsAriaAtomic: "true" }))))));
|
|
130
|
+
}
|
|
131
|
+
renderFieldset() {
|
|
132
|
+
const fieldsetClasses = index$2.classNames('ds-radio-button-fieldset');
|
|
133
|
+
const legendClasses = index$2.classNames('ds-radio-button-fieldset__legend');
|
|
134
|
+
const assistiveTextClasses = index$2.classNames('ds-radio-button-fieldset__assistive-text');
|
|
135
|
+
const ariaDescribedBy = [!!this.dsErrorText && this.errorTextId, !!this.dsAssistiveText && this.assistiveTextId].filter(Boolean).join(' ');
|
|
136
|
+
return (index.h("fieldset", { class: fieldsetClasses, "aria-describedby": ariaDescribedBy }, index.h("legend", { class: legendClasses }, index.h("slot", { name: "legend" }, this.getLegendText())), index.h("slot", { name: "assistiveText" }, this.dsAssistiveText && (index.h("small", { class: assistiveTextClasses, id: this.assistiveTextId }, this.dsAssistiveText))), this.renderRadioButton()));
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
if (this.dsLegend) {
|
|
140
|
+
return this.renderFieldset();
|
|
141
|
+
}
|
|
142
|
+
return this.renderRadioButton();
|
|
143
|
+
}
|
|
144
|
+
static get formAssociated() { return true; }
|
|
145
|
+
static get watchers() { return {
|
|
146
|
+
"dsChecked": ["dsCheckedObserver"]
|
|
147
|
+
}; }
|
|
148
|
+
};
|
|
149
|
+
DsRadioButton.style = dsRadioButtonCss;
|
|
150
|
+
|
|
151
|
+
exports.ds_radio_button = DsRadioButton;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
5
|
+
var index$1 = require('./index-Bp6Dd2i1.js');
|
|
6
|
+
|
|
7
|
+
const dsSpinnerCss = "html{font-size:100%}body{font-size:1rem}.ds-font{}.ds-font--heading{font-family:var(--ds-fontFamily-heading)}.ds-font--body{font-family:var(--ds-fontFamily-body)}.ds-font--regular{font-weight:var(--ds-fontWeight-regular)}.ds-font--semibold{font-weight:var(--ds-fontWeight-semibold)}.ds-font--semibold-plus{font-weight:var(--ds-fontWeight-semiboldPlus)}.ds-font--bold{font-weight:var(--ds-fontWeight-bold)}.ds-tracking--xtight{letter-spacing:var(--ds-letterSpacing-xTight)}.ds-tracking--tight{letter-spacing:var(--ds-letterSpacing-tight)}.ds-tracking--normal{letter-spacing:var(--ds-letterSpacing-normal)}.ds-tracking--wide{letter-spacing:var(--ds-letterSpacing-wide)}.ds-tracking--xwide{letter-spacing:var(--ds-letterSpacing-xWide)}.ds-leading--small{line-height:var(--ds-lineHeight-small)}.ds-leading--medium{line-height:var(--ds-lineHeight-medium)}.ds-leading--large{line-height:var(--ds-lineHeight-large)}.ds-leading--xlarge{line-height:var(--ds-lineHeight-xLarge)}.ds-width--normal{font-stretch:var(--ds-fontWidth-normal)}.ds-width--condense{font-stretch:var(--ds-fontWidth-condense)}.ds-number--proportional{font-variant-numeric:var(--ds-number-style)}.ds-paragraph--16{margin-bottom:var(--ds-fontSize-16)}.ds-paragraph--20{margin-bottom:var(--ds-fontSize-20)}.ds-list--spacing{gap:4px}.ds-text-color--default{color:var(--ds-palette-black-95)}.ds-text{}.ds-text--2xl-regular{font-size:var(--ds-fontSize-22);font-weight:var(--ds-fontWeight-regular)}.ds-text--xl-regular{font-size:var(--ds-fontSize-20);font-weight:var(--ds-fontWeight-regular)}.ds-text--lg-regular{font-size:var(--ds-fontSize-18);font-weight:var(--ds-fontWeight-regular)}.ds-text--md-regular{font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular)}.ds-text--sm-regular{font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-regular)}.ds-text--xs-regular{font-size:var(--ds-fontSize-12);font-weight:var(--ds-fontWeight-regular)}.ds-text--2xl-semibold{font-size:var(--ds-fontSize-22);font-weight:var(--ds-fontWeight-semibold)}.ds-text--xl-semibold{font-size:var(--ds-fontSize-20);font-weight:var(--ds-fontWeight-semibold)}.ds-text--lg-semibold{font-size:var(--ds-fontSize-18);font-weight:var(--ds-fontWeight-semibold)}.ds-text--md-semibold{font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold)}.ds-text--sm-semibold{font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-semibold)}.ds-text--xs-semibold{font-size:var(--ds-fontSize-12);font-weight:var(--ds-fontWeight-semibold)}.ds-text--2xl-bold{font-size:var(--ds-fontSize-22);font-weight:var(--ds-fontWeight-bold)}.ds-text--xl-bold{font-size:var(--ds-fontSize-20);font-weight:var(--ds-fontWeight-bold)}.ds-text--lg-bold{font-size:var(--ds-fontSize-18);font-weight:var(--ds-fontWeight-bold)}.ds-text--md-bold{font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-bold)}.ds-text--sm-bold{font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-bold)}.ds-text--xs-bold{font-size:var(--ds-fontSize-12);font-weight:var(--ds-fontWeight-bold)}.ds-spinner{display:flex;align-items:center;justify-content:center;}.ds-spinner--small{padding:1.5px}.ds-spinner--small:has(.ds-spinner__text){gap:var(--ds-spacing-2xSmall)}.ds-spinner--medium{padding:3px}.ds-spinner--medium:has(.ds-spinner__text){gap:var(--ds-spacing-2xSmall)}.ds-spinner--large{padding:3px}.ds-spinner--large:has(.ds-spinner__text){gap:var(--ds-spacing-xSmall)}.ds-spinner--xLarge{padding:5.5px}.ds-spinner--xLarge:has(.ds-spinner__text){gap:10px}.ds-spinner--2xLarge{padding:5.5px}.ds-spinner--2xLarge:has(.ds-spinner__text){gap:var(--ds-spacing-small)}.ds-spinner--below{flex-direction:column;align-items:center}.ds-spinner--right{flex-direction:row;align-items:center}.ds-spinner__spinner{width:var(--spinner-size, 24px);height:var(--spinner-size, 24px);border-radius:50%;border:calc(var(--spinner-size, 24px) / 6) solid var(--ds-overlay-black-15);position:relative;display:flex;align-items:center;justify-content:center}.ds-spinner__text{font-family:var(--ds-fontFamily-body);color:var(--ds-palette-black-95)}.ds-spinner__text--white{color:var(--ds-palette-white)}.ds-spinner__segment{display:block;position:absolute;width:var(--spinner-size, 24px);height:var(--spinner-size, 24px);border:calc(var(--spinner-size, 24px) / 6) solid var(--spinner-color, #005a94);border-radius:50%;animation:ds-spinner-rotate 1.1s cubic-bezier(0.7, 0.15, 0.3, 0.8) infinite;border-color:var(--spinner-color, #005a94) var(--spinner-border-color) var(--spinner-border-color) var(--spinner-border-color)}.ds-spinner__segment--1{animation-delay:-0.3s}.ds-spinner__segment--2{animation-delay:-0.2s}.ds-spinner__segment--3{animation-delay:-0.1s}@keyframes ds-spinner-rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.ds-spinner__segment{animation-duration:2.2s;animation-timing-function:linear;}.ds-spinner__segment--1{animation-delay:-0.6s}.ds-spinner__segment--2{animation-delay:-0.4s}.ds-spinner__segment--3{animation-delay:-0.2s}}";
|
|
8
|
+
|
|
9
|
+
const SPINNER_SIZES = {
|
|
10
|
+
'small': 10,
|
|
11
|
+
'medium': 14,
|
|
12
|
+
'large': 20,
|
|
13
|
+
'xLarge': 28,
|
|
14
|
+
'2xLarge': 40,
|
|
15
|
+
};
|
|
16
|
+
const SPINNER_TEXT_SIZES = {
|
|
17
|
+
'small': 'ds-text--xs-regular',
|
|
18
|
+
'medium': 'ds-text--sm-regular',
|
|
19
|
+
'large': 'ds-text--md-regular',
|
|
20
|
+
'xLarge': 'ds-text--lg-regular',
|
|
21
|
+
'2xLarge': 'ds-text--xl-regular',
|
|
22
|
+
};
|
|
23
|
+
const SPINNER_COLORS = {
|
|
24
|
+
blue: 'var(--ds-palette-mainBlue-70)',
|
|
25
|
+
black: 'var(--ds-palette-black-95)',
|
|
26
|
+
white: 'var(--ds-palette-white)',
|
|
27
|
+
};
|
|
28
|
+
const DsSpinner = class {
|
|
29
|
+
constructor(hostRef) {
|
|
30
|
+
index.registerInstance(this, hostRef);
|
|
31
|
+
}
|
|
32
|
+
inheritedAttributes = {};
|
|
33
|
+
get el() { return index.getElement(this); }
|
|
34
|
+
dsText;
|
|
35
|
+
dsSize = 'medium';
|
|
36
|
+
dsSpinnerTextPosition = 'below';
|
|
37
|
+
dsSpinnerColor = 'blue';
|
|
38
|
+
dsUseRoleAlert = false;
|
|
39
|
+
dsUseAriaLive = false;
|
|
40
|
+
dsHiddenAssistiveText;
|
|
41
|
+
componentWillLoad() {
|
|
42
|
+
this.inheritedAttributes = attributes.inheritAriaAttributes(this.el);
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const sizeInPixels = SPINNER_SIZES[this.dsSize];
|
|
46
|
+
const textSizeClass = SPINNER_TEXT_SIZES[this.dsSize];
|
|
47
|
+
const spinnerColorVariable = SPINNER_COLORS[this.dsSpinnerColor];
|
|
48
|
+
const classes = index$1.classNames('ds-spinner', `ds-spinner--${this.dsSize}`, {
|
|
49
|
+
[`ds-spinner--${this.dsSpinnerTextPosition}`]: !!this.dsText,
|
|
50
|
+
});
|
|
51
|
+
const textClasses = index$1.classNames('ds-spinner__text', textSizeClass, `ds-spinner__text--${this.dsSpinnerColor}`);
|
|
52
|
+
const segmentClasses = index => index$1.classNames('ds-spinner__segment', `ds-spinner__segment--${index}`);
|
|
53
|
+
return (index.h("div", { key: '3d312dd8883b903bb59c8ceface626444ac0df44', role: this.dsUseRoleAlert ? 'alert' : null, "aria-live": this.dsUseAriaLive ? 'polite' : null, class: classes, style: {
|
|
54
|
+
'--spinner-size': `${sizeInPixels}px`,
|
|
55
|
+
'--spinner-color': `${spinnerColorVariable}`,
|
|
56
|
+
'--spinner-border-color': this.dsSpinnerColor == 'white' ? 'var(--ds-overlay-white-15)' : 'transparent',
|
|
57
|
+
}, ...this.inheritedAttributes }, index.h("div", { key: '81d04de4de327d4b8be4a03a4b0f97d56214547e', class: "ds-spinner__spinner" }, index.h("div", { key: 'f7136c4637d17bc796d2e69df8aae51244d1d97e', class: segmentClasses(1) }), index.h("div", { key: 'd839ca7f1aae71616062b82af2d5b7610299bf25', class: segmentClasses(2) }), index.h("div", { key: 'bcbd84559e7fd2204320f4788837df61aed6208a', class: segmentClasses(3) })), this.dsHiddenAssistiveText && (index.h("ds-visually-hidden", { key: '8b3f758381d1623f84e0c237ec17b97a81a85983' }, index.h("span", { key: '52930b05b2b868c38f785b09d6bb86dddfde828b' }, this.dsHiddenAssistiveText))), this.dsText && index.h("span", { key: '91677c1f685820bc32f6c8557df98c1c37cdbf8e', class: textClasses }, this.dsText)));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
DsSpinner.style = dsSpinnerCss;
|
|
61
|
+
|
|
62
|
+
exports.ds_spinner = DsSpinner;
|