@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
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-DwLFyR5p.js');
|
|
4
|
+
require('./index-Mjp9Y-Sw.js');
|
|
4
5
|
|
|
5
|
-
const store = require('./store-9bd20f3c.js');
|
|
6
|
-
require('./index-bf84b124.js');
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
exports.configure = store.configure;
|
|
8
|
+
exports.configure = index.configure;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var index = require('./index-DwLFyR5p.js');
|
|
4
|
+
|
|
3
5
|
const opensInNewTab = (target) => target === '_blank';
|
|
4
|
-
const visuallyHiddenAssistiveText = (
|
|
5
|
-
switch (
|
|
6
|
+
const visuallyHiddenAssistiveText = () => {
|
|
7
|
+
switch (index.getLanguage()) {
|
|
6
8
|
case 'fi':
|
|
7
9
|
return 'Avautuu uuteen välilehteen';
|
|
8
10
|
case 'sv':
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const index = require('./index-bf84b124.js');
|
|
6
|
-
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
7
5
|
|
|
8
6
|
const defineCustomElements = async (win, options) => {
|
|
9
7
|
if (typeof window === 'undefined') return undefined;
|
|
10
8
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["ds-
|
|
9
|
+
return index.bootstrapLazy([["ds-card.cjs",[[1,"ds-card",{"dsVariant":[1,"ds-variant"],"dsHeading":[1,"ds-heading"],"dsHeadingLevel":[2,"ds-heading-level"],"dsDescription":[1,"ds-description"],"dsUrl":[1,"ds-url"],"dsUrlTarget":[1,"ds-url-target"],"dsImageUrl":[1,"ds-image-url"],"dsImageAlt":[1,"ds-image-alt"],"dsEyebrow":[1,"ds-eyebrow"],"dsSubtitle":[1,"ds-subtitle"],"dsShowArrow":[4,"ds-show-arrow"]},[[2,"click","handleClick"],[2,"keydown","handleKeydown"]]]]],["ds-input-validity.cjs",[[0,"ds-input-validity",{"dsText":[1,"ds-text"],"dsType":[1,"ds-type"],"dsValidityRole":[1,"ds-validity-role"],"dsAriaLive":[1,"ds-aria-live"],"dsAriaAtomic":[1,"ds-aria-atomic"],"identifier":[32]}]]],["ds-radio-button.cjs",[[65,"ds-radio-button",{"dsId":[1,"ds-id"],"dsErrorsDisabled":[4,"ds-errors-disabled"],"dsValue":[1,"ds-value"],"dsLegend":[1,"ds-legend"],"dsAssistiveText":[1,"ds-assistive-text"],"dsText":[1,"ds-text"],"dsRequired":[4,"ds-required"],"dsDisabled":[4,"ds-disabled"],"dsChecked":[4,"ds-checked"],"dsErrorText":[1,"ds-error-text"],"focusable":[32],"invalid":[32],"initialChecked":[32],"validationMessage":[32],"dsFocus":[64],"setFocusable":[64],"setChecked":[64]},null,{"dsChecked":["dsCheckedObserver"]}]]],["ds-checkbox.cjs",[[65,"ds-checkbox",{"dsId":[1,"ds-id"],"dsChecked":[1028,"ds-checked"],"dsLegend":[1,"ds-legend"],"dsAssistiveText":[1,"ds-assistive-text"],"dsText":[1,"ds-text"],"dsIndeterminate":[4,"ds-indeterminate"],"dsDisabled":[4,"ds-disabled"],"dsErrorText":[1,"ds-error-text"],"dsErrorsDisabled":[4,"ds-errors-disabled"],"dsRequired":[4,"ds-required"],"dsOptional":[4,"ds-optional"],"dsOptionalText":[1,"ds-optional-text"],"dsAriaLabel":[1,"ds-aria-label"],"invalid":[32],"initialChecked":[32],"validationMessage":[32]},null,{"dsChecked":["dsCheckedObserver"]}]]],["ds-checkbox-group.cjs",[[65,"ds-checkbox-group",{"dsLegend":[1,"ds-legend"],"dsAssistiveText":[1,"ds-assistive-text"],"dsDirection":[1,"ds-direction"],"dsErrorText":[1,"ds-error-text"],"dsText":[1,"ds-text"],"dsChecked":[4,"ds-checked"],"dsDisabled":[4,"ds-disabled"],"dsRequired":[4,"ds-required"],"dsAllRequired":[4,"ds-all-required"],"dsOptional":[4,"ds-optional"],"dsOptionalText":[1,"ds-optional-text"],"childElementsCount":[32],"checkedChildElementCount":[32],"isIndeterminate":[32],"indeterminateChildCheckboxCount":[32],"showInternalsValidationMessage":[32],"setChecked":[64]},[[0,"dsCheckboxGroupIndeterminateChildChange","listenIndeterminateChildChange"],[0,"input","listenCheckboxChange"],[0,"dsCheckboxGroupChange","listenCheckboxGroupChange"]],{"dsDisabled":["watchCheckboxDisabledChange"],"dsChecked":["watchCheckedChange"],"isIndeterminate":["watchIndeterminateChange"],"dsErrorText":["errorTextObserver"],"checkedChildElementCount":["watchCheckedChildElementCountChange"]}]]],["ds-visually-hidden.cjs",[[1,"ds-visually-hidden"]]],["ds-spinner.cjs",[[1,"ds-spinner",{"dsText":[1,"ds-text"],"dsSize":[1,"ds-size"],"dsSpinnerTextPosition":[1,"ds-spinner-text-position"],"dsSpinnerColor":[1,"ds-spinner-color"],"dsUseRoleAlert":[4,"ds-use-role-alert"],"dsUseAriaLive":[4,"ds-use-aria-live"],"dsHiddenAssistiveText":[1,"ds-hidden-assistive-text"]}]]],["ds-icon.cjs",[[1,"ds-icon",{"dsName":[1,"ds-name"],"dsColour":[1,"ds-colour"],"dsSize":[1,"ds-size"],"dsTitle":[1,"ds-title"],"dsRole":[1,"ds-role"],"dsHidden":[4,"ds-hidden"],"message":[32]}]]],["ds-button.cjs",[[6,"ds-button",{"dsValue":[1,"ds-value"],"dsVariant":[1,"ds-variant"],"dsColour":[1,"ds-colour"],"dsSize":[1,"ds-size"],"dsIcon":[1,"ds-icon"],"dsIconPosition":[1,"ds-icon-position"],"dsType":[1,"ds-type"],"dsDisabled":[4,"ds-disabled"],"dsIsLoading":[4,"ds-is-loading"],"dsUseSpinner":[4,"ds-use-spinner"],"dsSpinnerHiddenText":[1,"ds-spinner-hidden-text"],"dsFullWidth":[4,"ds-full-width"],"dsAriaDisabled":[1,"ds-aria-disabled"],"dsFocus":[64]}]]],["ds-text-input.cjs",[[70,"ds-text-input",{"dsLabel":[1,"ds-label"],"dsPlaceholder":[1,"ds-placeholder"],"dsId":[1,"ds-id"],"dsName":[1,"ds-name"],"dsDisabled":[4,"ds-disabled"],"dsOptional":[4,"ds-optional"],"dsRequired":[4,"ds-required"],"dsReadonly":[4,"ds-readonly"],"dsValue":[1,"ds-value"],"dsMin":[2,"ds-min"],"dsMax":[2,"ds-max"],"dsMaxLength":[2,"ds-max-length"],"dsPattern":[1,"ds-pattern"],"dsAutocomplete":[1,"ds-autocomplete"],"dsOptionalText":[1,"ds-optional-text"],"dsErrorText":[1,"ds-error-text"],"dsSuccessText":[1,"ds-success-text"],"dsAssistiveText":[1,"ds-assistive-text"],"dsActionButtonAriaLabel":[1,"ds-action-button-aria-label"],"dsHiddenAssistiveText":[1,"ds-hidden-assistive-text"],"dsPrefixText":[1,"ds-prefix-text"],"dsSuffixText":[1,"ds-suffix-text"],"dsIcon":[1,"ds-icon"],"dsType":[1,"ds-type"],"dsAriaLabel":[1,"ds-aria-label"],"dsAriaLabelledby":[1,"ds-aria-labelledby"],"dsAriaDescribedby":[1,"ds-aria-describedby"],"hasFocus":[32],"clearButtonVisible":[32],"passwordInputVisible":[32],"inputActive":[32],"validationMessage":[32],"togglePasswordVisibility":[64],"clearInput":[64]},null,{"value":["valueObserver"]}]]],["ds-accordion.cjs",[[1,"ds-accordion",{"dsVariant":[1,"ds-variant"],"dsBorderAligned":[4,"ds-border-aligned"],"dsOpenByDefault":[4,"ds-open-by-default"],"dsAccordionId":[1,"ds-accordion-id"],"dsHeadingLevel":[2,"ds-heading-level"],"dsUseCloseButton":[4,"ds-use-close-button"],"dsCloseButtonLabel":[1,"ds-close-button-label"],"dsHideTopBorder":[4,"ds-hide-top-border"],"dsHideBottomBorder":[4,"ds-hide-bottom-border"],"isExpanded":[32]},null,{"isExpanded":["watchHandler"]}]]],["ds-link.cjs",[[1,"ds-link",{"dsText":[1,"ds-text"],"dsSize":[1,"ds-size"],"dsVariant":[1,"ds-variant"],"dsWeight":[1,"ds-weight"],"dsIcon":[1025,"ds-icon"],"dsIconPosition":[1025,"ds-icon-position"],"dsIconTitle":[1,"ds-icon-title"],"dsIconHidden":[4,"ds-icon-hidden"],"dsHref":[1,"ds-href"],"dsTarget":[1,"ds-target"],"dsDownload":[4,"ds-download"],"dsAriaLabel":[1,"ds-aria-label"],"dsColour":[1,"ds-colour"]}]]],["ds-link-with-arrow.cjs",[[1,"ds-link-with-arrow",{"dsText":[1,"ds-text"],"dsIconPosition":[1,"ds-icon-position"],"dsHref":[1,"ds-href"],"dsTarget":[1,"ds-target"],"dsAriaLabel":[1,"ds-aria-label"]}]]],["ds-radio-button-group.cjs",[[65,"ds-radio-button-group",{"dsLegend":[1,"ds-legend"],"dsAssistiveText":[1,"ds-assistive-text"],"dsValue":[1025,"ds-value"],"dsDirection":[1,"ds-direction"],"dsErrorText":[1,"ds-error-text"],"dsRequired":[4,"ds-required"],"showInternalsValidationMessage":[32],"getValue":[64]},[[0,"dsRadioButtonChecked","onInputChange"],[4,"keydown","onKeyDown"]],{"dsErrorText":["errorTextObserver"],"dsValue":["dsValueObserver"]}]]]], options);
|
|
12
10
|
};
|
|
13
11
|
|
|
14
12
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const formatAs = (value, suffix) => value.endsWith(suffix) ? value : `${value}${suffix}`;
|
|
4
|
+
const formatAsPx = (value) => formatAs(value, 'px');
|
|
5
|
+
const slugifyText = (text) => {
|
|
6
|
+
return text
|
|
7
|
+
.toString()
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.replace(/\s+/g, '-')
|
|
10
|
+
.replace(/[^\w-]+/g, '')
|
|
11
|
+
.replace(/--+/g, '-')
|
|
12
|
+
.replace(/^-+/, '')
|
|
13
|
+
.replace(/-+$/, '');
|
|
14
|
+
};
|
|
15
|
+
const remToPx = (remString) => {
|
|
16
|
+
const rootFontSize = 16;
|
|
17
|
+
const rem = parseFloat(remString);
|
|
18
|
+
return formatAsPx(`${rem * rootFontSize}`);
|
|
19
|
+
};
|
|
20
|
+
function* idGenerator(id) {
|
|
21
|
+
let currentId = 1;
|
|
22
|
+
while (true) {
|
|
23
|
+
yield `${id}-${currentId++}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.idGenerator = idGenerator;
|
|
28
|
+
exports.remToPx = remToPx;
|
|
29
|
+
exports.slugifyText = slugifyText;
|
|
@@ -7,14 +7,14 @@ export default meta;
|
|
|
7
7
|
const howNamingWorksDOM = html `
|
|
8
8
|
<div class="ds-sb-how-naming-works">
|
|
9
9
|
<div>
|
|
10
|
-
<ds-button value="Continue"></ds-button>
|
|
10
|
+
<ds-button ds-value="Continue"></ds-button>
|
|
11
11
|
<!The button gets it's accessible name from its text content>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
<ds-text-input type="text" label="First name"></ds-text-input>
|
|
14
|
+
<ds-text-input ds-type="text" ds-label="First name"></ds-text-input>
|
|
15
15
|
<!The text input gets its accessible name from the label/for structure>
|
|
16
16
|
|
|
17
|
-
<ds-link href="#" text="Apply to University of Helsinki"></ds-link>
|
|
17
|
+
<ds-link ds-href="#" ds-text="Apply to University of Helsinki"></ds-link>
|
|
18
18
|
<!The link gets it's accessible name from its text content>
|
|
19
19
|
</div>
|
|
20
20
|
`;
|
|
@@ -1,21 +1,96 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"components/01-base-components/ds-checkbox/ds-checkbox.js",
|
|
4
3
|
"components/01-base-components/ds-checkbox-group/ds-checkbox-group.js",
|
|
5
4
|
"components/01-base-components/ds-text-input/ds-text-input.js",
|
|
6
5
|
"components/01-base-components/ds-accordion/ds-accordion.js",
|
|
7
6
|
"components/01-base-components/ds-button/ds-button.js",
|
|
7
|
+
"components/01-base-components/ds-card/ds-card.js",
|
|
8
|
+
"components/01-base-components/ds-checkbox/ds-checkbox.js",
|
|
8
9
|
"components/01-base-components/ds-icon/ds-icon.js",
|
|
9
10
|
"components/01-base-components/ds-input-validity/ds-input-validity.js",
|
|
10
11
|
"components/01-base-components/ds-link/ds-link.js",
|
|
11
12
|
"components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js",
|
|
13
|
+
"components/01-base-components/ds-radio-button/ds-radio-button.js",
|
|
14
|
+
"components/01-base-components/ds-radio-button-group/ds-radio-button-group.js",
|
|
15
|
+
"components/01-base-components/ds-spinner/ds-spinner.js",
|
|
12
16
|
"components/01-base-components/ds-visually-hidden/ds-visually-hidden.js"
|
|
13
17
|
],
|
|
14
18
|
"compiler": {
|
|
15
19
|
"name": "@stencil/core",
|
|
16
|
-
"version": "4.
|
|
20
|
+
"version": "4.30.0",
|
|
17
21
|
"typescriptVersion": "5.5.4"
|
|
18
22
|
},
|
|
19
23
|
"collections": [],
|
|
20
|
-
"bundles": [
|
|
24
|
+
"bundles": [
|
|
25
|
+
{
|
|
26
|
+
"components": [
|
|
27
|
+
"ds-accordion"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"components": [
|
|
32
|
+
"ds-button"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"components": [
|
|
37
|
+
"ds-card"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"components": [
|
|
42
|
+
"ds-checkbox"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"components": [
|
|
47
|
+
"ds-checkbox-group"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"components": [
|
|
52
|
+
"ds-icon"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"components": [
|
|
57
|
+
"ds-input-validity"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"components": [
|
|
62
|
+
"ds-link"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"components": [
|
|
67
|
+
"ds-link-with-arrow"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"components": [
|
|
72
|
+
"ds-radio-button"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"components": [
|
|
77
|
+
"ds-radio-button-group"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"components": [
|
|
82
|
+
"ds-spinner"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"components": [
|
|
87
|
+
"ds-text-input"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"components": [
|
|
92
|
+
"ds-visually-hidden"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
]
|
|
21
96
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.ds-accordion__open-button {
|
|
10
|
-
color: var(--ds-
|
|
10
|
+
color: var(--ds-palette-black-95);
|
|
11
11
|
outline: var(--ds-borderWidth-thick) solid transparent;
|
|
12
|
-
fill: var(--ds-
|
|
12
|
+
fill: var(--ds-palette-black-95);
|
|
13
13
|
position: relative;
|
|
14
14
|
all: unset;
|
|
15
15
|
align-items: flex-start;
|
|
@@ -21,11 +21,9 @@
|
|
|
21
21
|
width: 100%;
|
|
22
22
|
}
|
|
23
23
|
.ds-accordion__open-button:focus-visible {
|
|
24
|
-
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-
|
|
25
|
-
outline
|
|
26
|
-
outline-offset: var(--ds-borderWidth-thin);
|
|
27
|
-
outline-style: solid;
|
|
28
|
-
outline-width: var(--ds-borderWidth-thin);
|
|
24
|
+
box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-palette-white);
|
|
25
|
+
outline: var(--ds-borderWidth-thin) solid var(--ds-palette-black-95);
|
|
26
|
+
outline-offset: calc(var(--ds-borderWidth-thin) * 1);
|
|
29
27
|
}
|
|
30
28
|
.ds-accordion__open-button:hover:not(:focus-visible).ds-accordion--border-aligned::before, .ds-accordion__open-button:hover:not(:focus-visible).ds-accordion--border-aligned::after {
|
|
31
29
|
content: "";
|
|
@@ -44,10 +42,10 @@
|
|
|
44
42
|
cursor: pointer;
|
|
45
43
|
}
|
|
46
44
|
.ds-accordion__open-button:hover, .ds-accordion__open-button:hover::before, .ds-accordion__open-button:hover::after {
|
|
47
|
-
background: var(--ds-
|
|
45
|
+
background: var(--ds-overlay-black-10);
|
|
48
46
|
}
|
|
49
47
|
.ds-accordion__open-button:active, .ds-accordion__open-button:active::before, .ds-accordion__open-button:active::after {
|
|
50
|
-
background: var(--ds-
|
|
48
|
+
background: var(--ds-overlay-black-15);
|
|
51
49
|
}
|
|
52
50
|
.ds-accordion__open-button:focus-visible {
|
|
53
51
|
z-index: 1;
|
|
@@ -73,13 +71,13 @@
|
|
|
73
71
|
width: calc(100% - var(--ds-spacing-large));
|
|
74
72
|
}
|
|
75
73
|
:host(:first-child) .ds-accordion__open-button:not(.ds-accordion--hide-top-border) {
|
|
76
|
-
border-top: var(--ds-borderWidth-hairline) solid var(--ds-
|
|
74
|
+
border-top: var(--ds-borderWidth-hairline) solid var(--ds-palette-black-20);
|
|
77
75
|
}
|
|
78
76
|
:host(:first-child) .ds-accordion__open-button:not(.ds-accordion--hide-top-border):focus-visible {
|
|
79
77
|
border-top-color: transparent;
|
|
80
78
|
}
|
|
81
|
-
.ds-accordion__open-button[aria-expanded=false] {
|
|
82
|
-
border-bottom: var(--ds-borderWidth-hairline) solid var(--ds-
|
|
79
|
+
.ds-accordion__open-button:not(.ds-accordion--hide-bottom-border)[aria-expanded=false] {
|
|
80
|
+
border-bottom: var(--ds-borderWidth-hairline) solid var(--ds-palette-black-20);
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
.ds-accordion__panel--border-aligned {
|
|
@@ -92,7 +90,7 @@
|
|
|
92
90
|
position: absolute;
|
|
93
91
|
bottom: -1px;
|
|
94
92
|
height: 1px;
|
|
95
|
-
left:
|
|
93
|
+
left: 0;
|
|
96
94
|
background: var(--ds-palette-white);
|
|
97
95
|
width: var(--ds-spacing-small);
|
|
98
96
|
}
|
|
@@ -102,22 +100,25 @@
|
|
|
102
100
|
position: absolute;
|
|
103
101
|
bottom: -1px;
|
|
104
102
|
height: 1px;
|
|
105
|
-
right:
|
|
103
|
+
right: 0;
|
|
106
104
|
background: var(--ds-palette-white);
|
|
107
105
|
width: var(--ds-spacing-small);
|
|
108
106
|
}
|
|
109
107
|
.ds-accordion__panel--expanded {
|
|
110
108
|
display: block;
|
|
111
|
-
border-bottom: var(--ds-borderWidth-hairline) solid var(--ds-
|
|
109
|
+
border-bottom: var(--ds-borderWidth-hairline) solid var(--ds-palette-black-20);
|
|
112
110
|
padding-inline: var(--ds-spacing-small);
|
|
113
111
|
}
|
|
112
|
+
.ds-accordion__panel--expanded.ds-accordion__panel--hide-bottom-border {
|
|
113
|
+
border-bottom: 0;
|
|
114
|
+
}
|
|
114
115
|
|
|
115
116
|
::slotted([slot=header]) {
|
|
116
|
-
color: var(--ds-
|
|
117
|
+
color: var(--ds-palette-black-95);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
.ds-accordion__content {
|
|
120
|
-
color: var(--ds-
|
|
121
|
+
color: var(--ds-palette-black-95);
|
|
121
122
|
font-family: var(--ds-fontFamily-body);
|
|
122
123
|
padding-block: var(--ds-spacing-small);
|
|
123
124
|
}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
export class DsAccordion {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
dsVariant = 'default';
|
|
5
|
+
dsBorderAligned = false;
|
|
6
|
+
dsOpenByDefault = false;
|
|
7
|
+
dsAccordionId = 'dsaccordion';
|
|
8
|
+
dsHeadingLevel = 2;
|
|
9
|
+
dsUseCloseButton = false;
|
|
10
|
+
dsCloseButtonLabel = 'Close';
|
|
11
|
+
dsHideTopBorder = false;
|
|
12
|
+
dsHideBottomBorder = false;
|
|
12
13
|
isExpanded = false;
|
|
13
14
|
host;
|
|
15
|
+
dsToggle;
|
|
14
16
|
headerButtonRef;
|
|
15
17
|
shouldMoveFocus = false;
|
|
16
18
|
componentWillLoad() {
|
|
17
|
-
if (this.
|
|
19
|
+
if (this.dsOpenByDefault) {
|
|
18
20
|
this.isExpanded = true;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -23,6 +25,7 @@ export class DsAccordion {
|
|
|
23
25
|
this.headerButtonRef.focus();
|
|
24
26
|
this.shouldMoveFocus = false;
|
|
25
27
|
}
|
|
28
|
+
this.dsToggle.emit(isExpanded);
|
|
26
29
|
}
|
|
27
30
|
handleClick = (event) => {
|
|
28
31
|
const isCloseButton = event.target.closest('.ds-accordion__close-button');
|
|
@@ -32,31 +35,31 @@ export class DsAccordion {
|
|
|
32
35
|
handleKeyDown = (event) => {
|
|
33
36
|
switch (event.key) {
|
|
34
37
|
case 'Enter':
|
|
35
|
-
case ' ':
|
|
38
|
+
case ' ': {
|
|
36
39
|
event.preventDefault();
|
|
37
40
|
const isCloseButton = event.target.closest('.ds-accordion__close-button');
|
|
38
41
|
this.shouldMoveFocus = isCloseButton ? true : false;
|
|
39
42
|
this.isExpanded = !this.isExpanded;
|
|
40
43
|
break;
|
|
44
|
+
}
|
|
41
45
|
}
|
|
42
46
|
};
|
|
43
47
|
render() {
|
|
44
|
-
const iconSize = this.
|
|
45
|
-
const buttonSize = this.
|
|
46
|
-
return (h("div", { key: '
|
|
47
|
-
'ds-accordion--border-aligned': this.
|
|
48
|
-
})
|
|
49
|
-
'ds-accordion--border-aligned': this.
|
|
50
|
-
'ds-accordion--hide-top-border': this.
|
|
51
|
-
|
|
52
|
-
h("ds-icon", {
|
|
53
|
-
|
|
54
|
-
'ds-accordion__panel--
|
|
55
|
-
'ds-accordion__panel--
|
|
56
|
-
}), hidden: !this.isExpanded }, h("div", { key: '
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}), fontWeight: 'semiBold', variant: 'supplementary', colour: 'black', icon: 'keyboard_arrow_up', iconPosition: 'start', onClick: this.handleClick, onKeyDown: this.handleKeyDown, value: this.closeButtonLabel, size: buttonSize, type: 'button' })))));
|
|
48
|
+
const iconSize = this.dsVariant === 'compact' ? '1.5rem' : '2rem';
|
|
49
|
+
const buttonSize = this.dsVariant === 'compact' ? 'small' : 'medium';
|
|
50
|
+
return (h("div", { key: '3f11aeec4a4941f0dcce0380b05a515c3b9c89e6', class: classNames('ds-accordion', `ds-accordion--${this.dsVariant}`, {
|
|
51
|
+
'ds-accordion--border-aligned': this.dsBorderAligned,
|
|
52
|
+
}) }, h("div", { key: '6a8ca7a66d2f43c970b359972cc5e2830252edb1', class: "ds-accordion__item" }, h("div", { key: '378a67aa57baf72f491370e2e357828d516832d2', role: "heading", "aria-level": this.dsHeadingLevel, class: "ds-accordion__title" }, h("button", { key: '3d495833ea4e1b31ac730947268850d7ba04a15d', class: classNames('ds-accordion__open-button', `ds-accordion--${this.dsVariant}`, {
|
|
53
|
+
'ds-accordion--border-aligned': this.dsBorderAligned,
|
|
54
|
+
'ds-accordion--hide-top-border': this.dsHideTopBorder,
|
|
55
|
+
'ds-accordion--hide-bottom-border': this.dsHideBottomBorder,
|
|
56
|
+
}), onClick: this.handleClick, onKeyDown: this.handleKeyDown, "aria-expanded": this.isExpanded ? 'true' : 'false', "aria-controls": `${this.dsAccordionId}-panel`, id: this.dsAccordionId, ref: el => (this.headerButtonRef = el) }, h("span", { key: 'e720c9480de197083d4c3c956c6129caeb01a033', class: "ds-accordion__icon", "aria-hidden": "true" }, this.isExpanded ? h("ds-icon", { dsSize: iconSize, dsHidden: true, dsName: "keyboard_arrow_up" }) : h("ds-icon", { dsSize: iconSize, dsHidden: true, dsName: "keyboard_arrow_down" })), h("slot", { key: 'b406436f9de56d89e343150a19c0d133e8b9e2da', name: "header" }))), h("div", { key: 'a51a019dbc6e9401aaf1552edc127226cecb0b7c', id: `${this.dsAccordionId}-panel`, role: "region", "aria-labelledby": this.dsAccordionId, class: classNames('ds-accordion__panel', `ds-accordion__panel--${this.dsVariant}`, {
|
|
57
|
+
'ds-accordion__panel--border-aligned': this.dsBorderAligned,
|
|
58
|
+
'ds-accordion__panel--expanded': this.isExpanded,
|
|
59
|
+
'ds-accordion__panel--hide-bottom-border': this.dsHideBottomBorder,
|
|
60
|
+
}), hidden: !this.isExpanded }, h("div", { key: 'a7d46ee04bbe43fbfdea6ac0ec3a760aeb17ba64', class: "ds-accordion__content" }, h("slot", { key: '00e8c609cc32ed726226547af724295884e40bb7', name: "content" })), this.dsUseCloseButton && (h("ds-button", { key: '7b03bc58471493bc89501753e35238b770eaf563', "aria-labelledby": `${this.dsAccordionId}-close-button ${this.dsAccordionId}`, id: `${this.dsAccordionId}-close-button`, class: classNames('ds-accordion__close-button', `ds-accordion--${this.dsVariant}`, {
|
|
61
|
+
'ds-accordion--border-aligned': this.dsBorderAligned,
|
|
62
|
+
}), dsVariant: "supplementary", dsColour: "black", dsIcon: "keyboard_arrow_up", dsIconPosition: "start", onClick: this.handleClick, onKeyDown: this.handleKeyDown, dsValue: this.dsCloseButtonLabel, dsSize: buttonSize, dsType: "button" }))))));
|
|
60
63
|
}
|
|
61
64
|
static get is() { return "ds-accordion"; }
|
|
62
65
|
static get encapsulation() { return "shadow"; }
|
|
@@ -72,8 +75,9 @@ export class DsAccordion {
|
|
|
72
75
|
}
|
|
73
76
|
static get properties() {
|
|
74
77
|
return {
|
|
75
|
-
"
|
|
78
|
+
"dsVariant": {
|
|
76
79
|
"type": "string",
|
|
80
|
+
"attribute": "ds-variant",
|
|
77
81
|
"mutable": false,
|
|
78
82
|
"complexType": {
|
|
79
83
|
"original": "'default' | 'compact'",
|
|
@@ -84,16 +88,16 @@ export class DsAccordion {
|
|
|
84
88
|
"optional": false,
|
|
85
89
|
"docs": {
|
|
86
90
|
"tags": [],
|
|
87
|
-
"text": ""
|
|
91
|
+
"text": "Variant of the accordion"
|
|
88
92
|
},
|
|
89
93
|
"getter": false,
|
|
90
94
|
"setter": false,
|
|
91
|
-
"attribute": "variant",
|
|
92
95
|
"reflect": false,
|
|
93
96
|
"defaultValue": "'default'"
|
|
94
97
|
},
|
|
95
|
-
"
|
|
98
|
+
"dsBorderAligned": {
|
|
96
99
|
"type": "boolean",
|
|
100
|
+
"attribute": "ds-border-aligned",
|
|
97
101
|
"mutable": false,
|
|
98
102
|
"complexType": {
|
|
99
103
|
"original": "boolean",
|
|
@@ -104,16 +108,16 @@ export class DsAccordion {
|
|
|
104
108
|
"optional": false,
|
|
105
109
|
"docs": {
|
|
106
110
|
"tags": [],
|
|
107
|
-
"text": ""
|
|
111
|
+
"text": "Aligns the border to the position where accordion content starts"
|
|
108
112
|
},
|
|
109
113
|
"getter": false,
|
|
110
114
|
"setter": false,
|
|
111
|
-
"attribute": "border-aligned",
|
|
112
115
|
"reflect": false,
|
|
113
116
|
"defaultValue": "false"
|
|
114
117
|
},
|
|
115
|
-
"
|
|
118
|
+
"dsOpenByDefault": {
|
|
116
119
|
"type": "boolean",
|
|
120
|
+
"attribute": "ds-open-by-default",
|
|
117
121
|
"mutable": false,
|
|
118
122
|
"complexType": {
|
|
119
123
|
"original": "boolean",
|
|
@@ -124,16 +128,16 @@ export class DsAccordion {
|
|
|
124
128
|
"optional": false,
|
|
125
129
|
"docs": {
|
|
126
130
|
"tags": [],
|
|
127
|
-
"text": ""
|
|
131
|
+
"text": "Displays the accordion as opened when loaded"
|
|
128
132
|
},
|
|
129
133
|
"getter": false,
|
|
130
134
|
"setter": false,
|
|
131
|
-
"attribute": "open-by-default",
|
|
132
135
|
"reflect": false,
|
|
133
136
|
"defaultValue": "false"
|
|
134
137
|
},
|
|
135
|
-
"
|
|
138
|
+
"dsAccordionId": {
|
|
136
139
|
"type": "string",
|
|
140
|
+
"attribute": "ds-accordion-id",
|
|
137
141
|
"mutable": false,
|
|
138
142
|
"complexType": {
|
|
139
143
|
"original": "string",
|
|
@@ -144,16 +148,16 @@ export class DsAccordion {
|
|
|
144
148
|
"optional": false,
|
|
145
149
|
"docs": {
|
|
146
150
|
"tags": [],
|
|
147
|
-
"text": ""
|
|
151
|
+
"text": "Id of the accordion button"
|
|
148
152
|
},
|
|
149
153
|
"getter": false,
|
|
150
154
|
"setter": false,
|
|
151
|
-
"attribute": "accordion-id",
|
|
152
155
|
"reflect": false,
|
|
153
156
|
"defaultValue": "'dsaccordion'"
|
|
154
157
|
},
|
|
155
|
-
"
|
|
158
|
+
"dsHeadingLevel": {
|
|
156
159
|
"type": "number",
|
|
160
|
+
"attribute": "ds-heading-level",
|
|
157
161
|
"mutable": false,
|
|
158
162
|
"complexType": {
|
|
159
163
|
"original": "number",
|
|
@@ -164,16 +168,16 @@ export class DsAccordion {
|
|
|
164
168
|
"optional": false,
|
|
165
169
|
"docs": {
|
|
166
170
|
"tags": [],
|
|
167
|
-
"text": ""
|
|
171
|
+
"text": "Heading level to be used for the accordion"
|
|
168
172
|
},
|
|
169
173
|
"getter": false,
|
|
170
174
|
"setter": false,
|
|
171
|
-
"attribute": "heading-level",
|
|
172
175
|
"reflect": false,
|
|
173
176
|
"defaultValue": "2"
|
|
174
177
|
},
|
|
175
|
-
"
|
|
178
|
+
"dsUseCloseButton": {
|
|
176
179
|
"type": "boolean",
|
|
180
|
+
"attribute": "ds-use-close-button",
|
|
177
181
|
"mutable": false,
|
|
178
182
|
"complexType": {
|
|
179
183
|
"original": "boolean",
|
|
@@ -184,16 +188,16 @@ export class DsAccordion {
|
|
|
184
188
|
"optional": false,
|
|
185
189
|
"docs": {
|
|
186
190
|
"tags": [],
|
|
187
|
-
"text": ""
|
|
191
|
+
"text": "Displays a close button at the end of an opened accordion"
|
|
188
192
|
},
|
|
189
193
|
"getter": false,
|
|
190
194
|
"setter": false,
|
|
191
|
-
"attribute": "use-close-button",
|
|
192
195
|
"reflect": false,
|
|
193
196
|
"defaultValue": "false"
|
|
194
197
|
},
|
|
195
|
-
"
|
|
198
|
+
"dsCloseButtonLabel": {
|
|
196
199
|
"type": "string",
|
|
200
|
+
"attribute": "ds-close-button-label",
|
|
197
201
|
"mutable": false,
|
|
198
202
|
"complexType": {
|
|
199
203
|
"original": "string",
|
|
@@ -204,16 +208,36 @@ export class DsAccordion {
|
|
|
204
208
|
"optional": false,
|
|
205
209
|
"docs": {
|
|
206
210
|
"tags": [],
|
|
207
|
-
"text": ""
|
|
211
|
+
"text": "Text of the close button"
|
|
208
212
|
},
|
|
209
213
|
"getter": false,
|
|
210
214
|
"setter": false,
|
|
211
|
-
"attribute": "close-button-label",
|
|
212
215
|
"reflect": false,
|
|
213
216
|
"defaultValue": "'Close'"
|
|
214
217
|
},
|
|
215
|
-
"
|
|
218
|
+
"dsHideTopBorder": {
|
|
219
|
+
"type": "boolean",
|
|
220
|
+
"attribute": "ds-hide-top-border",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "boolean",
|
|
224
|
+
"resolved": "boolean",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Removes the top border"
|
|
232
|
+
},
|
|
233
|
+
"getter": false,
|
|
234
|
+
"setter": false,
|
|
235
|
+
"reflect": false,
|
|
236
|
+
"defaultValue": "false"
|
|
237
|
+
},
|
|
238
|
+
"dsHideBottomBorder": {
|
|
216
239
|
"type": "boolean",
|
|
240
|
+
"attribute": "ds-hide-bottom-border",
|
|
217
241
|
"mutable": false,
|
|
218
242
|
"complexType": {
|
|
219
243
|
"original": "boolean",
|
|
@@ -224,11 +248,10 @@ export class DsAccordion {
|
|
|
224
248
|
"optional": false,
|
|
225
249
|
"docs": {
|
|
226
250
|
"tags": [],
|
|
227
|
-
"text": ""
|
|
251
|
+
"text": "Removes the bottom border"
|
|
228
252
|
},
|
|
229
253
|
"getter": false,
|
|
230
254
|
"setter": false,
|
|
231
|
-
"attribute": "hide-top-border",
|
|
232
255
|
"reflect": false,
|
|
233
256
|
"defaultValue": "false"
|
|
234
257
|
}
|
|
@@ -239,6 +262,24 @@ export class DsAccordion {
|
|
|
239
262
|
"isExpanded": {}
|
|
240
263
|
};
|
|
241
264
|
}
|
|
265
|
+
static get events() {
|
|
266
|
+
return [{
|
|
267
|
+
"method": "dsToggle",
|
|
268
|
+
"name": "dsToggle",
|
|
269
|
+
"bubbles": true,
|
|
270
|
+
"cancelable": true,
|
|
271
|
+
"composed": true,
|
|
272
|
+
"docs": {
|
|
273
|
+
"tags": [],
|
|
274
|
+
"text": "Emitted when the accordion is expanded or closed."
|
|
275
|
+
},
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "boolean",
|
|
278
|
+
"resolved": "boolean",
|
|
279
|
+
"references": {}
|
|
280
|
+
}
|
|
281
|
+
}];
|
|
282
|
+
}
|
|
242
283
|
static get elementRef() { return "host"; }
|
|
243
284
|
static get watchers() {
|
|
244
285
|
return [{
|