@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,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
|
+
var index$2 = require('./index-Bp6Dd2i1.js');
|
|
5
|
+
var controlUtils = require('./controlUtils-ofqiQxRF.js');
|
|
6
|
+
var index$1 = require('./index-DwLFyR5p.js');
|
|
7
|
+
var utils = require('./utils-BjZTECpy.js');
|
|
8
|
+
var attributes = require('./attributes-BMbXzbwU.js');
|
|
4
9
|
|
|
5
|
-
const
|
|
6
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
const controlUtils = require('./controlUtils-041de0fd.js');
|
|
8
|
-
const store = require('./store-9bd20f3c.js');
|
|
9
|
-
const utils = require('./utils-3412cbed.js');
|
|
10
|
-
|
|
11
|
-
const dsTextInputCss = ".sc-ds-text-input:root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.no-style-leak.sc-ds-text-input *.sc-ds-text-input,.sc-ds-text-input-h *.sc-ds-text-input{all:unset;box-sizing:border-box;display:block}.sc-ds-text-input-h{display:block;width:288px}@media (min-width: 75rem){.sc-ds-text-input-h{width:320px}}.ds-input--label-container.sc-ds-text-input{margin-block-end:var(--ds-spacing-2xSmall)}.ds-input--label-container.sc-ds-text-input label.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-textColor-default)}.ds-input--label-container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);display:block;margin-block-start:var(--ds-spacing-3xSmall);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input{box-sizing:border-box;width:100%;display:inline-flex;position:relative;align-items:center;border-width:var(--ds-borderWidth-thin);border-style:solid;border-color:var(--ds-borderColor-default);padding-inline:var(--ds-spacing-xSmall)}.ds-input--container.sc-ds-text-input: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-input--container.sc-ds-text-input:focus-within{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-input--container.invalid.sc-ds-text-input{background-color:var(--ds-bgColor-danger);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.sc-ds-text-input:hover:not(.ds-input--container.invalid:focus-within){background-color:var(--ds-bgColor-danger-hover);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.active.sc-ds-text-input{background-color:var(--ds-bgColor-danger-active);border-color:var(--ds-borderColor-danger)}.ds-input--container.valid.sc-ds-text-input{background-color:var(--ds-bgColor-success);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.sc-ds-text-input:hover:not(.ds-input--container.valid:focus-within){background-color:var(--ds-bgColor-success-hover);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.active.sc-ds-text-input{background-color:var(--ds-bgColor-success-active);border-color:var(--ds-borderColor-success)}.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.disabled.sc-ds-text-input{background-color:var(--ds-bgColor-disabled-onLight);border-color:var(--ds-borderColor-disabled-onLight)}.ds-input--container.sc-ds-text-input:has(input:active){outline:none}.ds-input--container.sc-ds-text-input:has(input:active):not:has(input:disabled,input.sc-ds-text-input:readonly){border-color:var(--ds-borderColor-default)}.ds-input--container.active.sc-ds-text-input:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid).sc-ds-text-input{border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-active)}.ds-input--container.sc-ds-text-input:hover:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.active.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid.sc-ds-text-input,.ds-input--container.sc-ds-text-input:focus-within){border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-hover)}.ds-input--container.sc-ds-text-input:focus-within:not(.ds-input--container:focus-within.invalid,.ds-input--container.sc-ds-text-input:focus-within.valid,.ds-input--container.sc-ds-text-input:focus-within.readonly){border-color:var(--ds-borderColor-primary)}.ds-input--container.sc-ds-text-input:focus-within *.sc-ds-text-input>ds-button.suffix.sc-ds-text-input>button.sc-ds-text-input:focus-visible{background-clip:padding-box;outline-offset:-5px;box-shadow:none;height:var(--ds-spacing-xLarge);background-color:var(--ds-bgColor-transparent-onLight-hover)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input{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);width:100%;box-sizing:border-box;background-color:unset;flex-grow:1;height:var(--ds-spacing-xLarge);line-height:var(--ds-fontSize-24);color:var(--ds-textColor-default);border:none;padding-block:var(--ds-spacing-4xSmall)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled::placeholder{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::placeholder{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);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:focus{outline:none;border:none}.ds-input--container.sc-ds-text-input>input[type=number].sc-ds-text-input{-moz-appearance:textfield}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-cancel-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-inner-spin-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input>input.sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(ds-button.suffix){padding-inline-end:unset}.ds-input--container.sc-ds-text-input span.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input span.suffix.sc-ds-text-input{color:var(--ds-palette-black-70)}.ds-input--container.sc-ds-text-input ds-icon.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input-s>[slot=prefix],.ds-input--container .sc-ds-text-input-s>[slot=prefix]{height:1.5rem;color:var(--ds-textColor-default)}.ds-input--container.sc-ds-text-input ds-button.suffix.sc-ds-text-input{margin-top:calc(var(--ds-spacing-3xSmall) * -1);margin-right:calc(var(--ds-spacing-4xSmall) * -1);max-height:40px}.error-text--container.sc-ds-text-input,.success-text--container.sc-ds-text-input{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.error-text--container.sc-ds-text-input ds-icon.sc-ds-text-input,.success-text--container.sc-ds-text-input ds-icon.sc-ds-text-input{display:block;height:1.5rem}.error-text--container.sc-ds-text-input small.sc-ds-text-input,.success-text--container.sc-ds-text-input small.sc-ds-text-input{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)}.error-text--container.sc-ds-text-input{color:var(--ds-textColor-danger)}.success-text--container.sc-ds-text-input{color:var(--ds-textColor-success)}";
|
|
12
|
-
const DsTextInputStyle0 = dsTextInputCss;
|
|
10
|
+
const dsTextInputCss = ".sc-ds-text-input:root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.sc-ds-text-input-h *.sc-ds-text-input,.ds-no-style-leak.sc-ds-text-input *.sc-ds-text-input{all:unset;box-sizing:border-box;display:block}.sc-ds-text-input-h{display:block;width:288px}@media (min-width: 75rem){.sc-ds-text-input-h{width:320px}}.ds-input__label-container.sc-ds-text-input{margin-block-end:var(--ds-spacing-2xSmall)}.ds-input__label-container.sc-ds-text-input label.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-palette-black-95)}.ds-input__label-container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);display:block;margin-block-start:var(--ds-spacing-3xSmall);color:var(--ds-palette-black-70)}.ds-input__container.sc-ds-text-input{box-sizing:border-box;width:100%;display:inline-flex;position:relative;align-items:center;border-width:var(--ds-borderWidth-thin);border-style:solid;border-color:var(--ds-palette-black-50);padding-inline:var(--ds-spacing-xSmall)}.ds-input__container.sc-ds-text-input: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-input__container.sc-ds-text-input:focus-within{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-input__container.invalid.sc-ds-text-input{background-color:var(--ds-palette-red-05);border-color:var(--ds-palette-red-50)}.ds-input__container.invalid.sc-ds-text-input:hover:not(.ds-input__container.invalid:focus-within){background-color:var(--ds-palette-red-10);border-color:var(--ds-palette-red-50)}.ds-input__container.invalid.active.sc-ds-text-input{background-color:var(--ds-palette-red-20);border-color:var(--ds-palette-red-50)}.ds-input__container.valid.sc-ds-text-input{background-color:var(--ds-palette-green-05);border-color:var(--ds-palette-green-50)}.ds-input__container.valid.sc-ds-text-input:hover:not(.ds-input__container.valid:focus-within){background-color:var(--ds-palette-green-10);border-color:var(--ds-palette-green-50)}.ds-input__container.valid.active.sc-ds-text-input{background-color:var(--ds-palette-green-20);border-color:var(--ds-palette-green-50)}.ds-input__container.readonly.sc-ds-text-input,.ds-input__container.disabled.sc-ds-text-input{background-color:var(--ds-overlay-black-10);border-color:var(--ds-overlay-black-15)}.ds-input__container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input__container.sc-ds-text-input:has(ds-button.suffix){padding-inline-end:unset}.ds-input__container.sc-ds-text-input:has(input:active){outline:none}.ds-input__container.sc-ds-text-input:has(input:active):not:has(input:disabled,input.sc-ds-text-input:read-only){border-color:var(--ds-palette-black-50)}.ds-input__container.active.sc-ds-text-input:not(.ds-input__container.disabled,.ds-input__container.readonly.sc-ds-text-input,.ds-input__container.invalid.sc-ds-text-input,.ds-input__container.valid).sc-ds-text-input{border-color:var(--ds-palette-black-50);background-color:var(--ds-palette-black-20)}.ds-input__container.sc-ds-text-input:hover:not(.ds-input__container.disabled,.ds-input__container.readonly.sc-ds-text-input,.ds-input__container.active.sc-ds-text-input,.ds-input__container.invalid.sc-ds-text-input,.ds-input__container.valid.sc-ds-text-input,.ds-input__container.sc-ds-text-input:focus-within){border-color:var(--ds-palette-black-50);background-color:var(--ds-palette-black-10)}.ds-input__container.sc-ds-text-input:focus-within:not(.ds-input__container:focus-within.invalid,.ds-input__container.sc-ds-text-input:focus-within.valid,.ds-input__container.sc-ds-text-input:focus-within.readonly){border-color:var(--ds-palette-mainBlue-70)}.ds-input__container.sc-ds-text-input:focus-within *.sc-ds-text-input>ds-button.suffix.sc-ds-text-input>button.sc-ds-text-input:focus-visible{background-clip:padding-box;outline-offset:-5px;box-shadow:none;height:var(--ds-spacing-xLarge);background-color:var(--ds-overlay-black-10)}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input{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);width:100%;box-sizing:border-box;background-color:unset;flex-grow:1;height:var(--ds-spacing-xLarge);line-height:var(--ds-fontSize-24);color:var(--ds-palette-black-95);border:none;padding-block:var(--ds-spacing-4xSmall)}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::placeholder{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);color:var(--ds-palette-black-70)}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input:disabled{color:var(--ds-palette-black-40)}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input:disabled::placeholder{color:var(--ds-palette-black-40)}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input:focus{outline:none;border:none}.ds-input__container.sc-ds-text-input>input[type=number].sc-ds-text-input{appearance:textfield}.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-decoration,.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-cancel-button,.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-button,.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-decoration,.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-inner-spin-button,.ds-input__container.sc-ds-text-input>input.sc-ds-text-input::-webkit-outer-spin-button{appearance:none;margin:0}.ds-input__container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input>input.sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input__container.sc-ds-text-input span.prefix.sc-ds-text-input,.ds-input__container.sc-ds-text-input span.suffix.sc-ds-text-input{color:var(--ds-palette-black-70)}.ds-input__container.sc-ds-text-input ds-icon.prefix.sc-ds-text-input,.ds-input__container.sc-ds-text-input-s>[slot=prefix],.ds-input__container .sc-ds-text-input-s>[slot=prefix]{height:1.5rem;color:var(--ds-palette-black-95)}.ds-input__container.sc-ds-text-input ds-button.suffix.sc-ds-text-input{margin-top:calc(var(--ds-spacing-3xSmall) * -1);margin-right:calc(var(--ds-spacing-4xSmall) * -1);max-height:40px}";
|
|
13
11
|
|
|
14
12
|
const INPUT_TYPE_ICONS_MAP = {
|
|
15
13
|
search: 'search',
|
|
@@ -22,7 +20,9 @@ const inputIdGenerator = utils.idGenerator('ds-input');
|
|
|
22
20
|
const DsTextInput = class {
|
|
23
21
|
constructor(hostRef) {
|
|
24
22
|
index.registerInstance(this, hostRef);
|
|
25
|
-
this.
|
|
23
|
+
this.dsChange = index.createEvent(this, "dsChange");
|
|
24
|
+
this.dsInput = index.createEvent(this, "dsInput");
|
|
25
|
+
this.dsClear = index.createEvent(this, "dsClear");
|
|
26
26
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
27
27
|
this.internals = hostRef.$hostElement$["s-ei"];
|
|
28
28
|
}
|
|
@@ -42,96 +42,104 @@ const DsTextInput = class {
|
|
|
42
42
|
hasSuffixSlot = false;
|
|
43
43
|
get el() { return index.getElement(this); }
|
|
44
44
|
internals;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
45
|
+
dsChange;
|
|
46
|
+
dsInput;
|
|
47
|
+
dsClear;
|
|
48
|
+
dsLabel;
|
|
49
|
+
dsPlaceholder;
|
|
50
|
+
dsId = inputIdGenerator.next().value;
|
|
51
|
+
dsName;
|
|
52
|
+
dsDisabled;
|
|
53
|
+
dsOptional;
|
|
54
|
+
dsRequired;
|
|
55
|
+
dsReadonly;
|
|
56
|
+
dsValue;
|
|
57
|
+
dsMin;
|
|
58
|
+
dsMax;
|
|
59
|
+
dsMaxLength;
|
|
60
|
+
dsPattern;
|
|
61
|
+
dsAutocomplete;
|
|
62
|
+
dsOptionalText;
|
|
63
|
+
dsErrorText;
|
|
64
|
+
dsSuccessText;
|
|
65
|
+
dsAssistiveText;
|
|
66
|
+
dsActionButtonAriaLabel;
|
|
67
|
+
dsHiddenAssistiveText;
|
|
68
|
+
dsPrefixText;
|
|
69
|
+
dsSuffixText;
|
|
70
|
+
dsIcon = '';
|
|
71
|
+
dsType = 'text';
|
|
72
|
+
dsAriaLabel;
|
|
73
|
+
dsAriaLabelledby;
|
|
74
|
+
dsAriaDescribedby;
|
|
73
75
|
hasFocus = false;
|
|
74
76
|
clearButtonVisible = false;
|
|
75
77
|
passwordInputVisible = false;
|
|
76
78
|
inputActive = false;
|
|
77
79
|
validationMessage;
|
|
78
80
|
setIds = () => {
|
|
79
|
-
this.assistiveTextId = `${this.
|
|
80
|
-
this.visuallyHiddenAssistiveTextId = `${this.
|
|
81
|
-
this.errorTextId = `${this.
|
|
82
|
-
this.successTextId = `${this.
|
|
81
|
+
this.assistiveTextId = `${this.dsId}-assistive-text`;
|
|
82
|
+
this.visuallyHiddenAssistiveTextId = `${this.dsId}-visually-hidden-assistive-text`;
|
|
83
|
+
this.errorTextId = `${this.dsId}-error-text`;
|
|
84
|
+
this.successTextId = `${this.dsId}-success-text`;
|
|
83
85
|
};
|
|
84
|
-
getValidationMessage = () => this.
|
|
86
|
+
getValidationMessage = () => this.dsErrorText || this.internals?.validationMessage || this.inputElement?.validationMessage;
|
|
85
87
|
async togglePasswordVisibility() {
|
|
86
88
|
return (this.passwordInputVisible = !this.passwordInputVisible);
|
|
87
89
|
}
|
|
88
|
-
async clearInput() {
|
|
89
|
-
this.
|
|
90
|
+
async clearInput(e) {
|
|
91
|
+
this.dsValue = '';
|
|
90
92
|
this.inputElement.focus();
|
|
91
93
|
this.clearButtonVisible = false;
|
|
92
|
-
this.
|
|
94
|
+
this.dsClear.emit({ event: e, value: this.dsValue });
|
|
95
|
+
}
|
|
96
|
+
valueObserver(value) {
|
|
97
|
+
this.dsChange.emit({ value });
|
|
93
98
|
}
|
|
94
99
|
getLabelText = () => {
|
|
95
|
-
if (this.
|
|
96
|
-
return controlUtils.getRequiredText(this.
|
|
100
|
+
if (this.dsRequired) {
|
|
101
|
+
return controlUtils.getRequiredText(this.dsLabel);
|
|
97
102
|
}
|
|
98
|
-
if (this.
|
|
99
|
-
return controlUtils.getOptionalText(this.
|
|
103
|
+
if (this.dsOptional) {
|
|
104
|
+
return controlUtils.getOptionalText(this.dsLabel, this.dsOptionalText);
|
|
100
105
|
}
|
|
101
|
-
return this.
|
|
106
|
+
return this.dsLabel;
|
|
102
107
|
};
|
|
103
108
|
componentWillLoad() {
|
|
104
109
|
this.inheritedAttributes = {
|
|
105
|
-
...
|
|
110
|
+
...attributes.inheritAttributes(this, this.el, ['id']),
|
|
106
111
|
};
|
|
107
112
|
this.setIds();
|
|
108
113
|
this.hasPrefixSlot = !!this.el.querySelector('[slot="prefix"]');
|
|
109
114
|
this.hasSuffixSlot = !!this.el.querySelector('[slot="suffix"]');
|
|
110
|
-
if (
|
|
115
|
+
if (index$1.isValidation('server') || this.dsErrorText) {
|
|
111
116
|
this.validationMessage = this.getValidationMessage();
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
handleInput = (e) => {
|
|
115
120
|
const target = e.target;
|
|
121
|
+
this.dsValue = target.value;
|
|
116
122
|
this.clearButtonVisible = !!target.value;
|
|
117
123
|
this.internals?.setFormValue(target.value);
|
|
118
|
-
|
|
124
|
+
this.dsInput.emit({ event: e, value: this.dsValue });
|
|
125
|
+
if (index$1.isValidation('client') && this.validationMessage) {
|
|
119
126
|
this.validationMessage = this.getValidationMessage();
|
|
120
127
|
}
|
|
121
128
|
};
|
|
122
129
|
handleBlur = () => {
|
|
123
130
|
this.hasFocus = false;
|
|
124
|
-
if (
|
|
131
|
+
if (index$1.isValidation('client')) {
|
|
125
132
|
this.validationMessage = this.getValidationMessage();
|
|
126
133
|
}
|
|
127
134
|
};
|
|
128
135
|
onActionButtonClicked = (e) => {
|
|
129
136
|
e.stopPropagation();
|
|
130
|
-
switch (this.
|
|
137
|
+
switch (this.dsType) {
|
|
131
138
|
case 'password':
|
|
132
139
|
return this.togglePasswordVisibility();
|
|
133
140
|
case 'search':
|
|
134
|
-
this.clearInput();
|
|
141
|
+
this.clearInput(e);
|
|
142
|
+
return;
|
|
135
143
|
default:
|
|
136
144
|
return;
|
|
137
145
|
}
|
|
@@ -140,12 +148,12 @@ const DsTextInput = class {
|
|
|
140
148
|
if (this.hasPrefixSlot) {
|
|
141
149
|
return index.h("slot", { name: "prefix" });
|
|
142
150
|
}
|
|
143
|
-
if (this.
|
|
144
|
-
return (index.h("slot", { name: "prefix" }, index.h("span", { class: "prefix" }, this.
|
|
151
|
+
if (this.dsPrefixText) {
|
|
152
|
+
return (index.h("slot", { name: "prefix" }, index.h("span", { class: "prefix" }, this.dsPrefixText)));
|
|
145
153
|
}
|
|
146
|
-
const prefixIcon = this.
|
|
154
|
+
const prefixIcon = this.dsIcon || INPUT_TYPE_ICONS_MAP[this.dsType];
|
|
147
155
|
if (prefixIcon) {
|
|
148
|
-
return (index.h("slot", { name: "prefix" }, index.h("ds-icon", { class: "prefix",
|
|
156
|
+
return (index.h("slot", { name: "prefix" }, index.h("ds-icon", { class: "prefix", dsName: prefixIcon })));
|
|
149
157
|
}
|
|
150
158
|
return null;
|
|
151
159
|
}
|
|
@@ -153,13 +161,13 @@ const DsTextInput = class {
|
|
|
153
161
|
if (this.hasSuffixSlot) {
|
|
154
162
|
return index.h("slot", { name: "suffix" });
|
|
155
163
|
}
|
|
156
|
-
if (this.
|
|
157
|
-
return (index.h("slot", { name: "suffix" }, index.h("span", { class: "suffix" }, this.
|
|
164
|
+
if (this.dsSuffixText) {
|
|
165
|
+
return (index.h("slot", { name: "suffix" }, index.h("span", { class: "suffix" }, this.dsSuffixText)));
|
|
158
166
|
}
|
|
159
|
-
const actionButtonIcon = INPUT_TYPE_ACTION_BUTTON_ICON_MAP[this.
|
|
160
|
-
const ariaPressed = this.
|
|
167
|
+
const actionButtonIcon = INPUT_TYPE_ACTION_BUTTON_ICON_MAP[this.dsType]?.(this) ?? '';
|
|
168
|
+
const ariaPressed = this.dsType === 'password' ? this.passwordInputVisible : undefined;
|
|
161
169
|
if (actionButtonIcon) {
|
|
162
|
-
return (index.h("slot", { name: "suffix" }, index.h("ds-button", { ref: e => (this.suffixButtonElement = e),
|
|
170
|
+
return (index.h("slot", { name: "suffix" }, index.h("ds-button", { ref: e => (this.suffixButtonElement = e), dsVariant: "supplementary", dsColour: "black", class: "suffix", dsDisabled: false, dsIcon: actionButtonIcon, onClick: this.onActionButtonClicked, "aria-pressed": ariaPressed, "aria-label": this.dsActionButtonAriaLabel })));
|
|
163
171
|
}
|
|
164
172
|
return null;
|
|
165
173
|
}
|
|
@@ -169,22 +177,27 @@ const DsTextInput = class {
|
|
|
169
177
|
this.inputElement.focus();
|
|
170
178
|
}
|
|
171
179
|
render() {
|
|
172
|
-
const inputType = this.
|
|
173
|
-
return (index.h(index.Fragment, { key: '
|
|
174
|
-
disabled: this.
|
|
175
|
-
readonly: this.
|
|
176
|
-
valid: !!this.
|
|
180
|
+
const inputType = this.dsType === 'password' && this.passwordInputVisible ? 'text' : this.dsType;
|
|
181
|
+
return (index.h(index.Fragment, { key: '015e667345613d819eb885bdfde2011eefc60577' }, index.h("div", { key: 'abc03d3418fb9c648bc4d8039a4602366b6125c8', class: "ds-input__label-container" }, index.h("slot", { key: '9b660821e35939092570b4f6f449caca22771dcb', name: "label" }, index.h("label", { key: '96efa9db67a1f51f3380f7a3c350a8da45df9e1e', htmlFor: this.dsId }, this.getLabelText())), index.h("slot", { key: 'a5cb893f2c69efb68b7557fe5d253b58e7930f4c', name: "assistiveText" }, index.h("small", { key: '341f60604eb3b795bcaf5d81306dc349d0093647', id: this.assistiveTextId }, this.dsAssistiveText), index.h("ds-visually-hidden", { key: '613244a6dd9bb180a82c4250514ab74392cbaee8', id: this.visuallyHiddenAssistiveTextId }, this.dsHiddenAssistiveText))), index.h("div", { key: 'e0fb89582c7651eb00ec0dce5f5c4d0648840237', onMouseDown: () => (this.inputActive = true), onMouseUp: () => (this.inputActive = false), onClick: e => this.handleInputContainerClick(e), class: index$2.classNames('ds-input__container', {
|
|
182
|
+
disabled: this.dsDisabled,
|
|
183
|
+
readonly: this.dsReadonly,
|
|
184
|
+
valid: !!this.dsSuccessText,
|
|
177
185
|
invalid: !!this.validationMessage,
|
|
178
186
|
focus: this.hasFocus,
|
|
179
187
|
active: !!this.inputActive,
|
|
180
|
-
}) }, this.renderPrefixContent(), index.h("input", { key: '
|
|
181
|
-
index$
|
|
182
|
-
[this.
|
|
183
|
-
[this.
|
|
184
|
-
|
|
188
|
+
}) }, this.renderPrefixContent(), index.h("input", { key: '5ad15cf4d756aae913e08bfd71338ea3d80c11b9', ref: e => (this.inputElement = e), id: this.dsId, name: this.dsName, "aria-label": this.dsAriaLabel, "aria-labelledby": this.dsAriaLabelledby, "aria-describedby": this.dsAriaDescribedby ||
|
|
189
|
+
index$2.classNames({
|
|
190
|
+
[this.assistiveTextId]: !!this.dsAssistiveText,
|
|
191
|
+
[this.visuallyHiddenAssistiveTextId]: !!this.dsHiddenAssistiveText,
|
|
192
|
+
[this.errorTextId]: !!this.validationMessage,
|
|
193
|
+
[this.successTextId]: !!this.dsSuccessText,
|
|
194
|
+
}), "aria-invalid": this.validationMessage ? 'true' : 'false', disabled: this.dsDisabled, required: this.dsRequired, readonly: this.dsReadonly, value: this.dsValue, type: inputType, min: this.dsMin, max: this.dsMax, maxlength: this.dsMaxLength, pattern: this.dsPattern, placeholder: this.dsPlaceholder, autocomplete: this.dsAutocomplete, onInput: this.handleInput, onFocus: () => (this.hasFocus = true), onBlur: this.handleBlur, ...this.inheritedAttributes }), this.renderSuffixContent()), index.h("slot", { key: '4e378385106dd578542a99303cd4217e7bf21694', name: "validity" }, index.h("ds-input-validity", { key: '367fab0f5d7446f99a028e881fa5c8ab8d9829e5', id: this.errorTextId, dsText: this.validationMessage, dsType: "error", dsValidityRole: "alert" }), index.h("ds-input-validity", { key: '8c35c70e4beb5ade4a5f8f6fb2a35d94be57cd98', id: this.successTextId, dsText: this.dsSuccessText, dsType: "success", dsValidityRole: "status" }))));
|
|
185
195
|
}
|
|
186
196
|
static get formAssociated() { return true; }
|
|
197
|
+
static get watchers() { return {
|
|
198
|
+
"value": ["valueObserver"]
|
|
199
|
+
}; }
|
|
187
200
|
};
|
|
188
|
-
DsTextInput.style =
|
|
201
|
+
DsTextInput.style = dsTextInputCss;
|
|
189
202
|
|
|
190
203
|
exports.ds_text_input = DsTextInput;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const index = require('./index-bf84b124.js');
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
6
4
|
|
|
7
5
|
const dsVisuallyHiddenCss = ".ds-visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";
|
|
8
|
-
const DsVisuallyHiddenStyle0 = dsVisuallyHiddenCss;
|
|
9
6
|
|
|
10
7
|
const DsVisuallyHidden = class {
|
|
11
8
|
constructor(hostRef) {
|
|
12
9
|
index.registerInstance(this, hostRef);
|
|
13
10
|
}
|
|
14
11
|
render() {
|
|
15
|
-
return (index.h("div", { key: '
|
|
12
|
+
return (index.h("div", { key: 'faa791957259a5ef05d2417a7b316e4cdabd8291', class: "ds-visually-hidden" }, index.h("slot", { key: 'd7c192f15bf2d74700205ad29f3bb78d0f9cce80' })));
|
|
16
13
|
}
|
|
17
14
|
};
|
|
18
|
-
DsVisuallyHidden.style =
|
|
15
|
+
DsVisuallyHidden.style = dsVisuallyHiddenCss;
|
|
19
16
|
|
|
20
17
|
exports.ds_visually_hidden = DsVisuallyHidden;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
var classnames = {exports: {}};
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
Copyright (c) 2018 Jed Watson.
|
|
11
|
+
Licensed under the MIT License (MIT), see
|
|
12
|
+
http://jedwatson.github.io/classnames
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var hasRequiredClassnames;
|
|
16
|
+
|
|
17
|
+
function requireClassnames () {
|
|
18
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
19
|
+
hasRequiredClassnames = 1;
|
|
20
|
+
(function (module) {
|
|
21
|
+
/* global define */
|
|
22
|
+
|
|
23
|
+
(function () {
|
|
24
|
+
|
|
25
|
+
var hasOwn = {}.hasOwnProperty;
|
|
26
|
+
|
|
27
|
+
function classNames () {
|
|
28
|
+
var classes = '';
|
|
29
|
+
|
|
30
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
31
|
+
var arg = arguments[i];
|
|
32
|
+
if (arg) {
|
|
33
|
+
classes = appendClass(classes, parseValue(arg));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return classes;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function parseValue (arg) {
|
|
41
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
42
|
+
return arg;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (typeof arg !== 'object') {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (Array.isArray(arg)) {
|
|
50
|
+
return classNames.apply(null, arg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
54
|
+
return arg.toString();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var classes = '';
|
|
58
|
+
|
|
59
|
+
for (var key in arg) {
|
|
60
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
61
|
+
classes = appendClass(classes, key);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return classes;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function appendClass (value, newClass) {
|
|
69
|
+
if (!newClass) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (value) {
|
|
74
|
+
return value + ' ' + newClass;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return value + newClass;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (module.exports) {
|
|
81
|
+
classNames.default = classNames;
|
|
82
|
+
module.exports = classNames;
|
|
83
|
+
} else {
|
|
84
|
+
window.classNames = classNames;
|
|
85
|
+
}
|
|
86
|
+
}());
|
|
87
|
+
} (classnames));
|
|
88
|
+
return classnames.exports;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var classnamesExports = requireClassnames();
|
|
92
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
93
|
+
|
|
94
|
+
exports.classNames = classNames;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var index = require('./index-Mjp9Y-Sw.js');
|
|
4
4
|
|
|
5
5
|
const appendToMap = (map, propName, value) => {
|
|
6
6
|
const items = map.get(propName);
|
|
@@ -194,14 +194,18 @@ const createStore = (defaultState, shouldUpdate) => {
|
|
|
194
194
|
|
|
195
195
|
const initialState = {
|
|
196
196
|
validation: 'client',
|
|
197
|
+
language: 'en',
|
|
197
198
|
};
|
|
198
199
|
const { state, set } = createStore({
|
|
199
200
|
...initialState,
|
|
200
201
|
});
|
|
201
202
|
const isValidation = (validation) => state.validation === validation;
|
|
202
|
-
const
|
|
203
|
+
const getLanguage = () => state.language;
|
|
204
|
+
const configure = ({ validation, language }) => {
|
|
203
205
|
set('validation', validation || initialState.validation);
|
|
206
|
+
set('language', language || initialState.language);
|
|
204
207
|
};
|
|
205
208
|
|
|
206
209
|
exports.configure = configure;
|
|
210
|
+
exports.getLanguage = getLanguage;
|
|
207
211
|
exports.isValidation = isValidation;
|