@uh-design-system/component-library 0.2.4 → 0.4.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/attributes-f7831329.js +78 -0
- package/dist/cjs/component-library.cjs.js +3 -3
- package/dist/cjs/{ds-accordion_2.cjs.entry.js → ds-accordion_3.cjs.entry.js} +419 -241
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +47 -0
- package/dist/cjs/ds-link.cjs.entry.js +54 -0
- package/dist/cjs/ds-text-input.cjs.entry.js +12 -16
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +20 -0
- package/dist/cjs/{index-fd4f6cd2.js → index-bfa0f441.js} +17 -11
- package/dist/cjs/linkUtils-695da37c.js +16 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/utils-8b73aa91.js +10 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/00-foundations/icons/categories/arrows.js +6 -0
- package/dist/collection/components/00-foundations/icons/categories/information.js +12 -0
- package/dist/collection/components/00-foundations/icons/categories/media.js +4 -0
- package/dist/collection/components/00-foundations/icons/categories/social.js +17 -0
- package/dist/collection/components/00-foundations/icons/iconList.js +2 -0
- package/dist/collection/components/00-foundations/typography/stories/typography.stories.js +110 -0
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +101 -82
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +41 -9
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +15 -0
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +1 -1
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +10 -1
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +168 -104
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +23 -2
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +6 -0
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +13 -7
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.css +5 -1
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +8 -5
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.stories.js +2 -2
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +224 -0
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +281 -0
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +53 -0
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +73 -0
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +72 -0
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +208 -0
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +161 -0
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.examples.stories.js +33 -0
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.features.stories.js +19 -0
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.stories.js +40 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +72 -48
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +44 -4
- package/dist/collection/components/01-base-components/ds-text-input/{ds-text-input.examples.stories.js → stories/ds-text-input.examples.stories.js} +13 -0
- package/dist/collection/components/01-base-components/ds-text-input/{ds-text-input.features.stories.js → stories/ds-text-input.features.stories.js} +18 -4
- package/dist/collection/components/01-base-components/ds-text-input/{ds-text-input.stories.js → stories/ds-text-input.stories.js} +2 -2
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/introduction/introduction.stories.js +9 -0
- package/dist/collection/utils/link/linkUtils.js +11 -0
- package/dist/collection/utils/typography/typographyUtils.js +21 -0
- package/dist/collection/utils/utils.js +5 -0
- package/dist/component-library/attributes-9419ac39.js +1 -0
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/ds-accordion_3.entry.js +1 -0
- package/dist/component-library/ds-link-with-arrow.entry.js +1 -0
- package/dist/component-library/ds-link.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 -0
- package/dist/component-library/{index-4200d514.js → index-42701395.js} +2 -2
- package/dist/component-library/linkUtils-3d1b28cf.js +1 -0
- package/dist/component-library/utils-cca2a41a.js +1 -0
- package/dist/components/attributes.js +154 -0
- package/dist/components/ds-accordion.js +31 -12
- package/dist/components/ds-button2.js +6 -78
- package/dist/components/ds-icon2.js +320 -231
- package/dist/components/ds-link-with-arrow.d.ts +11 -0
- package/dist/components/ds-link-with-arrow.js +78 -0
- package/dist/components/ds-link.d.ts +11 -0
- package/dist/components/ds-link.js +90 -0
- package/dist/components/ds-text-input.js +11 -13
- package/dist/components/ds-visually-hidden2.js +1 -1
- package/dist/components/index2.js +7 -10
- package/dist/components/linkUtils.js +13 -0
- package/dist/components/utils.js +8 -0
- package/dist/esm/attributes-9419ac39.js +75 -0
- package/dist/esm/component-library.js +4 -4
- package/dist/esm/{ds-accordion_2.entry.js → ds-accordion_3.entry.js} +419 -242
- package/dist/esm/ds-link-with-arrow.entry.js +43 -0
- package/dist/esm/ds-link.entry.js +50 -0
- package/dist/esm/ds-text-input.entry.js +8 -12
- package/dist/esm/ds-visually-hidden.entry.js +16 -0
- package/dist/esm/{index-4200d514.js → index-42701395.js} +17 -11
- package/dist/esm/linkUtils-3d1b28cf.js +13 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/utils-cca2a41a.js +8 -0
- package/dist/types/components/00-foundations/icons/categories/social.d.ts +5 -0
- package/dist/types/components/00-foundations/typography/stories/typography.stories.d.ts +9 -0
- package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +1 -0
- 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 +3 -0
- package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +1 -1
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +25 -0
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.examples.stories.d.ts +11 -0
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +11 -0
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +18 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.examples.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.features.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-text-input/{ds-text-input.examples.stories.d.ts → stories/ds-text-input.examples.stories.d.ts} +2 -1
- package/dist/types/components/01-base-components/ds-text-input/{ds-text-input.features.stories.d.ts → stories/ds-text-input.features.stories.d.ts} +4 -1
- package/dist/types/components/01-base-components/ds-text-input/{ds-text-input.stories.d.ts → stories/ds-text-input.stories.d.ts} +1 -1
- package/dist/types/components.d.ts +66 -2
- package/dist/types/introduction/introduction.stories.d.ts +10 -0
- package/dist/types/utils/link/linkUtils.d.ts +2 -0
- package/dist/types/utils/typography/typographyUtils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -4
- package/dist/cjs/ds-button_2.cjs.entry.js +0 -170
- package/dist/component-library/ds-accordion_2.entry.js +0 -1
- package/dist/component-library/ds-button_2.entry.js +0 -1
- package/dist/components/index3.js +0 -80
- package/dist/esm/ds-button_2.entry.js +0 -165
|
@@ -13,6 +13,7 @@ export namespace Components {
|
|
|
13
13
|
"borderAligned": boolean;
|
|
14
14
|
"closeButtonLabel": string;
|
|
15
15
|
"headingLevel": number;
|
|
16
|
+
"hideTopBorder": boolean;
|
|
16
17
|
"openByDefault": boolean;
|
|
17
18
|
"useCloseButton": boolean;
|
|
18
19
|
"variant": 'default' | 'compact';
|
|
@@ -22,6 +23,7 @@ export namespace Components {
|
|
|
22
23
|
"colour": 'blue' | 'black' | 'white';
|
|
23
24
|
"disabled": boolean;
|
|
24
25
|
"fontWeight": string;
|
|
26
|
+
"fullWidth": boolean;
|
|
25
27
|
"icon": string;
|
|
26
28
|
"iconPosition": 'start' | 'end';
|
|
27
29
|
"size": 'small' | 'medium';
|
|
@@ -37,11 +39,30 @@ export namespace Components {
|
|
|
37
39
|
}
|
|
38
40
|
interface DsIcon {
|
|
39
41
|
"colour": string;
|
|
42
|
+
"dsTitle": string;
|
|
40
43
|
"hidden": boolean;
|
|
41
44
|
"name": string;
|
|
42
45
|
"role": string;
|
|
43
46
|
"size": string;
|
|
44
|
-
|
|
47
|
+
}
|
|
48
|
+
interface DsLink {
|
|
49
|
+
"download"?: boolean;
|
|
50
|
+
"href": string;
|
|
51
|
+
"icon": string;
|
|
52
|
+
"iconPosition": LinkIconPosition;
|
|
53
|
+
"language"?: LinkLang;
|
|
54
|
+
"size"?: LinkSize;
|
|
55
|
+
"target"?: LinkTarget;
|
|
56
|
+
"text"?: string;
|
|
57
|
+
"variant": LinkVariant;
|
|
58
|
+
"weight": LinkWeight;
|
|
59
|
+
}
|
|
60
|
+
interface DsLinkWithArrow {
|
|
61
|
+
"href": string;
|
|
62
|
+
"iconPosition": LinkIconPosition;
|
|
63
|
+
"language"?: LinkLang;
|
|
64
|
+
"target"?: LinkTarget;
|
|
65
|
+
"text"?: string;
|
|
45
66
|
}
|
|
46
67
|
interface DsTextInput {
|
|
47
68
|
"actionButtonAriaLabel"?: string;
|
|
@@ -61,6 +82,8 @@ export namespace Components {
|
|
|
61
82
|
"maxlength"?: number;
|
|
62
83
|
"min"?: number;
|
|
63
84
|
"name": string;
|
|
85
|
+
"optional"?: boolean;
|
|
86
|
+
"optionalText"?: string;
|
|
64
87
|
"pattern"?: string;
|
|
65
88
|
"placeholder"?: string;
|
|
66
89
|
"prefixText"?: string;
|
|
@@ -94,6 +117,18 @@ declare global {
|
|
|
94
117
|
prototype: HTMLDsIconElement;
|
|
95
118
|
new (): HTMLDsIconElement;
|
|
96
119
|
};
|
|
120
|
+
interface HTMLDsLinkElement extends Components.DsLink, HTMLStencilElement {
|
|
121
|
+
}
|
|
122
|
+
var HTMLDsLinkElement: {
|
|
123
|
+
prototype: HTMLDsLinkElement;
|
|
124
|
+
new (): HTMLDsLinkElement;
|
|
125
|
+
};
|
|
126
|
+
interface HTMLDsLinkWithArrowElement extends Components.DsLinkWithArrow, HTMLStencilElement {
|
|
127
|
+
}
|
|
128
|
+
var HTMLDsLinkWithArrowElement: {
|
|
129
|
+
prototype: HTMLDsLinkWithArrowElement;
|
|
130
|
+
new (): HTMLDsLinkWithArrowElement;
|
|
131
|
+
};
|
|
97
132
|
interface HTMLDsTextInputElement extends Components.DsTextInput, HTMLStencilElement {
|
|
98
133
|
}
|
|
99
134
|
var HTMLDsTextInputElement: {
|
|
@@ -110,6 +145,8 @@ declare global {
|
|
|
110
145
|
"ds-accordion": HTMLDsAccordionElement;
|
|
111
146
|
"ds-button": HTMLDsButtonElement;
|
|
112
147
|
"ds-icon": HTMLDsIconElement;
|
|
148
|
+
"ds-link": HTMLDsLinkElement;
|
|
149
|
+
"ds-link-with-arrow": HTMLDsLinkWithArrowElement;
|
|
113
150
|
"ds-text-input": HTMLDsTextInputElement;
|
|
114
151
|
"ds-visually-hidden": HTMLDsVisuallyHiddenElement;
|
|
115
152
|
}
|
|
@@ -120,6 +157,7 @@ declare namespace LocalJSX {
|
|
|
120
157
|
"borderAligned"?: boolean;
|
|
121
158
|
"closeButtonLabel"?: string;
|
|
122
159
|
"headingLevel"?: number;
|
|
160
|
+
"hideTopBorder"?: boolean;
|
|
123
161
|
"openByDefault"?: boolean;
|
|
124
162
|
"useCloseButton"?: boolean;
|
|
125
163
|
"variant"?: 'default' | 'compact';
|
|
@@ -129,6 +167,7 @@ declare namespace LocalJSX {
|
|
|
129
167
|
"colour"?: 'blue' | 'black' | 'white';
|
|
130
168
|
"disabled"?: boolean;
|
|
131
169
|
"fontWeight"?: string;
|
|
170
|
+
"fullWidth"?: boolean;
|
|
132
171
|
"icon"?: string;
|
|
133
172
|
"iconPosition"?: 'start' | 'end';
|
|
134
173
|
"size"?: 'small' | 'medium';
|
|
@@ -144,11 +183,30 @@ declare namespace LocalJSX {
|
|
|
144
183
|
}
|
|
145
184
|
interface DsIcon {
|
|
146
185
|
"colour"?: string;
|
|
186
|
+
"dsTitle"?: string;
|
|
147
187
|
"hidden"?: boolean;
|
|
148
188
|
"name"?: string;
|
|
149
189
|
"role"?: string;
|
|
150
190
|
"size"?: string;
|
|
151
|
-
|
|
191
|
+
}
|
|
192
|
+
interface DsLink {
|
|
193
|
+
"download"?: boolean;
|
|
194
|
+
"href": string;
|
|
195
|
+
"icon"?: string;
|
|
196
|
+
"iconPosition"?: LinkIconPosition;
|
|
197
|
+
"language"?: LinkLang;
|
|
198
|
+
"size"?: LinkSize;
|
|
199
|
+
"target"?: LinkTarget;
|
|
200
|
+
"text"?: string;
|
|
201
|
+
"variant"?: LinkVariant;
|
|
202
|
+
"weight"?: LinkWeight;
|
|
203
|
+
}
|
|
204
|
+
interface DsLinkWithArrow {
|
|
205
|
+
"href": string;
|
|
206
|
+
"iconPosition"?: LinkIconPosition;
|
|
207
|
+
"language"?: LinkLang;
|
|
208
|
+
"target"?: LinkTarget;
|
|
209
|
+
"text"?: string;
|
|
152
210
|
}
|
|
153
211
|
interface DsTextInput {
|
|
154
212
|
"actionButtonAriaLabel"?: string;
|
|
@@ -167,6 +225,8 @@ declare namespace LocalJSX {
|
|
|
167
225
|
"maxlength"?: number;
|
|
168
226
|
"min"?: number;
|
|
169
227
|
"name"?: string;
|
|
228
|
+
"optional"?: boolean;
|
|
229
|
+
"optionalText"?: string;
|
|
170
230
|
"pattern"?: string;
|
|
171
231
|
"placeholder"?: string;
|
|
172
232
|
"prefixText"?: string;
|
|
@@ -183,6 +243,8 @@ declare namespace LocalJSX {
|
|
|
183
243
|
"ds-accordion": DsAccordion;
|
|
184
244
|
"ds-button": DsButton;
|
|
185
245
|
"ds-icon": DsIcon;
|
|
246
|
+
"ds-link": DsLink;
|
|
247
|
+
"ds-link-with-arrow": DsLinkWithArrow;
|
|
186
248
|
"ds-text-input": DsTextInput;
|
|
187
249
|
"ds-visually-hidden": DsVisuallyHidden;
|
|
188
250
|
}
|
|
@@ -194,6 +256,8 @@ declare module "@stencil/core" {
|
|
|
194
256
|
"ds-accordion": LocalJSX.DsAccordion & JSXBase.HTMLAttributes<HTMLDsAccordionElement>;
|
|
195
257
|
"ds-button": LocalJSX.DsButton & JSXBase.HTMLAttributes<HTMLDsButtonElement>;
|
|
196
258
|
"ds-icon": LocalJSX.DsIcon & JSXBase.HTMLAttributes<HTMLDsIconElement>;
|
|
259
|
+
"ds-link": LocalJSX.DsLink & JSXBase.HTMLAttributes<HTMLDsLinkElement>;
|
|
260
|
+
"ds-link-with-arrow": LocalJSX.DsLinkWithArrow & JSXBase.HTMLAttributes<HTMLDsLinkWithArrowElement>;
|
|
197
261
|
"ds-text-input": LocalJSX.DsTextInput & JSXBase.HTMLAttributes<HTMLDsTextInputElement>;
|
|
198
262
|
"ds-visually-hidden": LocalJSX.DsVisuallyHidden & JSXBase.HTMLAttributes<HTMLDsVisuallyHiddenElement>;
|
|
199
263
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uh-design-system/component-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,8 +44,6 @@
|
|
|
44
44
|
"start": "stencil build --dev --watch --serve",
|
|
45
45
|
"test-storybook": "test-storybook",
|
|
46
46
|
"test-storybook:update": "rm -rf __snapshots__ && test-storybook -u",
|
|
47
|
-
"test-storybook:docker": "./scripts/run-tests-in-docker.sh",
|
|
48
|
-
"test-storybook:update:docker": "rm -rf __snapshots__ && ./scripts/run-tests-in-docker.sh -u",
|
|
49
47
|
"test": "stencil test --spec --e2e",
|
|
50
48
|
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
51
49
|
"generate": "stencil generate",
|
|
@@ -95,5 +93,5 @@
|
|
|
95
93
|
"glob": "^9.0.0"
|
|
96
94
|
},
|
|
97
95
|
"license": "MIT",
|
|
98
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "66cf27f598c9c38e05082f53e4f2e24f2dc909e3"
|
|
99
97
|
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-fd4f6cd2.js');
|
|
6
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
|
7
|
-
|
|
8
|
-
const inheritAttributes = (el, attributes = []) => {
|
|
9
|
-
const attributeObject = {};
|
|
10
|
-
attributes.forEach(attr => {
|
|
11
|
-
if (el.hasAttribute(attr)) {
|
|
12
|
-
const value = el.getAttribute(attr);
|
|
13
|
-
if (value !== null) {
|
|
14
|
-
attributeObject[attr] = el.getAttribute(attr);
|
|
15
|
-
}
|
|
16
|
-
el.removeAttribute(attr);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return attributeObject;
|
|
20
|
-
};
|
|
21
|
-
const ariaAttributes = [
|
|
22
|
-
'role',
|
|
23
|
-
'aria-activedescendant',
|
|
24
|
-
'aria-atomic',
|
|
25
|
-
'aria-autocomplete',
|
|
26
|
-
'aria-braillelabel',
|
|
27
|
-
'aria-brailleroledescription',
|
|
28
|
-
'aria-busy',
|
|
29
|
-
'aria-checked',
|
|
30
|
-
'aria-colcount',
|
|
31
|
-
'aria-colindex',
|
|
32
|
-
'aria-colindextext',
|
|
33
|
-
'aria-colspan',
|
|
34
|
-
'aria-controls',
|
|
35
|
-
'aria-current',
|
|
36
|
-
'aria-describedby',
|
|
37
|
-
'aria-description',
|
|
38
|
-
'aria-details',
|
|
39
|
-
'aria-disabled',
|
|
40
|
-
'aria-errormessage',
|
|
41
|
-
'aria-expanded',
|
|
42
|
-
'aria-flowto',
|
|
43
|
-
'aria-haspopup',
|
|
44
|
-
'aria-hidden',
|
|
45
|
-
'aria-invalid',
|
|
46
|
-
'aria-keyshortcuts',
|
|
47
|
-
'aria-label',
|
|
48
|
-
'aria-labelledby',
|
|
49
|
-
'aria-level',
|
|
50
|
-
'aria-live',
|
|
51
|
-
'aria-multiline',
|
|
52
|
-
'aria-multiselectable',
|
|
53
|
-
'aria-orientation',
|
|
54
|
-
'aria-owns',
|
|
55
|
-
'aria-placeholder',
|
|
56
|
-
'aria-posinset',
|
|
57
|
-
'aria-pressed',
|
|
58
|
-
'aria-readonly',
|
|
59
|
-
'aria-relevant',
|
|
60
|
-
'aria-required',
|
|
61
|
-
'aria-roledescription',
|
|
62
|
-
'aria-rowcount',
|
|
63
|
-
'aria-rowindex',
|
|
64
|
-
'aria-rowindextext',
|
|
65
|
-
'aria-rowspan',
|
|
66
|
-
'aria-selected',
|
|
67
|
-
'aria-setsize',
|
|
68
|
-
'aria-sort',
|
|
69
|
-
'aria-valuemax',
|
|
70
|
-
'aria-valuemin',
|
|
71
|
-
'aria-valuenow',
|
|
72
|
-
'aria-valuetext',
|
|
73
|
-
];
|
|
74
|
-
const inheritAriaAttributes = (el, ignoreList) => {
|
|
75
|
-
let attributesToInherit = [...ariaAttributes];
|
|
76
|
-
if (ignoreList && ignoreList.length > 0) {
|
|
77
|
-
attributesToInherit = attributesToInherit.filter(attr => !ignoreList.includes(attr));
|
|
78
|
-
}
|
|
79
|
-
return inheritAttributes(el, attributesToInherit);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const dsButtonCss = ".sc-ds-button-h{display:inline-block}button.sc-ds-button{align-items:center;border-radius:0;border-style:solid;display:flex;font-family:var(--ds-fontFamily-body);font-weight:var(--ds-fontWeight-bold);outline:4px solid transparent;border-width:var(--ds-borderWidth-thick);font-size:var(--ds-fontSize-18);min-height:44px;padding:var(--ds-spacing-3xSmall) var(--ds-spacing-xSmall)}button.sc-ds-button:focus{outline-offset:2px;outline-width:2px}button.icon-only.sc-ds-button{padding-left:0;padding-right:0;aspect-ratio:1;justify-content:center}button.sc-ds-button .button-value.sc-ds-button{padding-right:var(--ds-spacing-3xSmall);padding-left:var(--ds-spacing-3xSmall)}button.sc-ds-button ds-icon.sc-ds-button{height:1.5rem}button.icon-start.sc-ds-button:not(.small) ds-icon.sc-ds-button{margin-right:var(--ds-spacing-3xSmall)}button.icon-end.sc-ds-button:not(.small) ds-icon.sc-ds-button{margin-left:var(--ds-spacing-3xSmall)}button.primary.blue.sc-ds-button{background-color:var(--ds-bgColor-primary);border-color:transparent;color:var(--ds-textColor-white)}button.primary.blue.sc-ds-button:hover{background-color:var(--ds-bgColor-primary-hover)}button.primary.blue.sc-ds-button:active,button.primary.blue--active.sc-ds-button{background-color:var(--ds-bgColor-primary-active)}button.primary.blue.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.primary.blue[aria-disabled=true].sc-ds-button,button.primary.blue.disabled.sc-ds-button,button.primary.blue.sc-ds-button:disabled{background-color:var(--ds-bgColor-disabled-onLight);border-color:transparent;color:var(--ds-textColor-disabled-onLight)}button.primary.black.sc-ds-button{background-color:var(--ds-bgColor-black);border-color:transparent;color:var(--ds-textColor-white)}button.primary.black.sc-ds-button:hover{background-color:var(--ds-bgColor-black-hover)}button.primary.black.sc-ds-button:active,button.primary.black--active.sc-ds-button{background-color:var(--ds-bgColor-black-active)}button.primary.black.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.primary.black[aria-disabled=true].sc-ds-button,button.primary.black.disabled.sc-ds-button,button.primary.black.sc-ds-button:disabled{background-color:var(--ds-bgColor-disabled-onLight);border-color:transparent;color:var(--ds-textColor-disabled-onLight)}button.primary.white.sc-ds-button{background-color:var(--ds-bgColor-white);border-color:transparent;color:var(--ds-textColor-default)}button.primary.white.sc-ds-button:hover{background-color:var(--ds-bgColor-white-hover)}button.primary.white.sc-ds-button:active,button.primary.white--active.sc-ds-button{background-color:var(--ds-bgColor-white-active)}button.primary.white.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-black);outline-color:var(--ds-borderColor-white)}button.primary.white[aria-disabled=true].sc-ds-button,button.primary.white.disabled.sc-ds-button,button.primary.white.sc-ds-button:disabled{background-color:var(--ds-bgColor-disabled-onDark);border-color:transparent;color:var(--ds-textColor-disabled-onDark)}button.secondary.blue.sc-ds-button{background-color:var(--ds-bgColor-secondary);border-color:var(--ds-borderColor-primary);color:var(--ds-textColor-primary)}button.secondary.blue.sc-ds-button:hover{background-color:var(--ds-bgColor-secondary-hover)}button.secondary.blue.sc-ds-button:active,button.secondary.blue--active.sc-ds-button{background-color:var(--ds-bgColor-secondary-active)}button.secondary.blue.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.secondary.blue[aria-disabled=true].sc-ds-button,button.secondary.blue.disabled.sc-ds-button,button.secondary.blue.sc-ds-button:disabled{background-color:var(--ds-bgColor-secondary);border-color:var(--ds-borderColor-disabled-onLight);color:var(--ds-textColor-disabled-onLight)}button.secondary.black.sc-ds-button{background-color:transparent;border-color:var(--ds-borderColor-black);color:var(--ds-textColor-default)}button.secondary.black.sc-ds-button:hover{background-color:var(--ds-bgColor-transparent-onLight-hover)}button.secondary.black.sc-ds-button:active,button.secondary.black--active.sc-ds-button{background-color:var(--ds-bgColor-transparent-onLight-active)}button.secondary.black.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.secondary.black[aria-disabled=true].sc-ds-button,button.secondary.black.disabled.sc-ds-button,button.secondary.black.sc-ds-button:disabled{background-color:transparent;border-color:var(--ds-borderColor-disabled-onLight);color:var(--ds-textColor-disabled-onLight)}button.secondary.white.sc-ds-button{background-color:transparent;border-color:var(--ds-borderColor-white);color:var(--ds-textColor-white)}button.secondary.white.sc-ds-button:hover{background-color:var(--ds-bgColor-transparent-onDark-hover)}button.secondary.white.sc-ds-button:active,button.secondary.white--active.sc-ds-button{background-color:var(--ds-bgColor-transparent-onDark-active)}button.secondary.white.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-black);outline-color:var(--ds-borderColor-white)}button.secondary.white[aria-disabled=true].sc-ds-button,button.secondary.white.disabled.sc-ds-button,button.secondary.white.sc-ds-button:disabled{background-color:transparent;border-color:var(--ds-borderColor-disabled-onDark);color:var(--ds-textColor-disabled-onDark)}button.supplementary.blue.sc-ds-button{background-color:transparent;border-color:transparent;color:var(--ds-textColor-primary);padding-right:0;padding-left:0}button.supplementary.blue.sc-ds-button:hover{background-color:var(--ds-bgColor-secondary-hover)}button.supplementary.blue.sc-ds-button:active,button.supplementary.blue--active.sc-ds-button{background-color:var(--ds-bgColor-secondary-active)}button.supplementary.blue.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.supplementary.blue[aria-disabled=true].sc-ds-button,button.supplementary.blue.disabled.sc-ds-button,button.supplementary.blue.sc-ds-button:disabled{background-color:transparent;border-color:transparent;color:var(--ds-textColor-disabled-onLight)}button.supplementary.black.sc-ds-button{background-color:transparent;border-color:transparent;color:var(--ds-textColor-default);padding-right:0;padding-left:0}button.supplementary.black.sc-ds-button:hover{background-color:var(--ds-bgColor-transparent-onLight-hover)}button.supplementary.black.sc-ds-button:active,button.supplementary.black--active.sc-ds-button{background-color:var(--ds-bgColor-transparent-onLight-active)}button.supplementary.black.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black)}button.supplementary.black[aria-disabled=true].sc-ds-button,button.supplementary.black.disabled.sc-ds-button,button.supplementary.black.sc-ds-button:disabled{background-color:transparent;border-color:transparent;color:var(--ds-textColor-disabled-onLight)}button.supplementary.white.sc-ds-button{background-color:transparent;border-color:transparent;color:var(--ds-textColor-white);padding-right:0;padding-left:0}button.supplementary.white.sc-ds-button:hover{background-color:var(--ds-bgColor-transparent-onDark-hover)}button.supplementary.white.sc-ds-button:active,button.supplementary.white--active.sc-ds-button{background-color:var(--ds-bgColor-transparent-onDark-active)}button.supplementary.white.sc-ds-button:focus-visible{box-shadow:0 0 0 2px var(--ds-borderColor-black);outline-color:var(--ds-borderColor-white)}button.supplementary.white[aria-disabled=true].sc-ds-button,button.supplementary.white.disabled.sc-ds-button,button.supplementary.white.sc-ds-button:disabled{background-color:transparent;border-color:transparent;color:var(--ds-textColor-disabled-onDark)}button.small.sc-ds-button{border-width:var(--ds-borderWidth-thin);font-size:var(--ds-fontSize-14);min-height:32px;padding:var(--ds-spacing-4xSmall) var(--ds-spacing-2xSmall)}button.small.icon-only.sc-ds-button{width:32px}button.small.sc-ds-button ds-icon.sc-ds-button{height:1rem}";
|
|
83
|
-
const DsButtonStyle0 = dsButtonCss;
|
|
84
|
-
|
|
85
|
-
const DsButton = class {
|
|
86
|
-
constructor(hostRef) {
|
|
87
|
-
index.registerInstance(this, hostRef);
|
|
88
|
-
}
|
|
89
|
-
inheritedAttributes = {};
|
|
90
|
-
buttonEl;
|
|
91
|
-
pressedKeys = new Set();
|
|
92
|
-
get el() { return index.getElement(this); }
|
|
93
|
-
value = '';
|
|
94
|
-
variant = 'primary';
|
|
95
|
-
colour = 'blue';
|
|
96
|
-
size = 'medium';
|
|
97
|
-
fontWeight = 'normal';
|
|
98
|
-
icon = '';
|
|
99
|
-
iconPosition = 'start';
|
|
100
|
-
type = 'button';
|
|
101
|
-
disabled = false;
|
|
102
|
-
ariaDisabled = 'false';
|
|
103
|
-
componentWillLoad() {
|
|
104
|
-
this.inheritedAttributes = {
|
|
105
|
-
...inheritAriaAttributes(this.el, ['aria-disabled']),
|
|
106
|
-
...inheritAttributes(this.el, [
|
|
107
|
-
'autofocus',
|
|
108
|
-
'form',
|
|
109
|
-
'formaction',
|
|
110
|
-
'formenctype',
|
|
111
|
-
'formmethod',
|
|
112
|
-
'formnovalidate',
|
|
113
|
-
'formtarget',
|
|
114
|
-
'name',
|
|
115
|
-
'popovertarget',
|
|
116
|
-
'popovertargetaction',
|
|
117
|
-
]),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
handleKeyDown = (event) => {
|
|
121
|
-
if (event.repeat) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
switch (event.key) {
|
|
125
|
-
case 'Enter':
|
|
126
|
-
case ' ':
|
|
127
|
-
this.pressedKeys.add(event.key);
|
|
128
|
-
this.buttonEl.classList.add(`${this.colour}--active`);
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
handleKeyUp = (event) => {
|
|
133
|
-
switch (event.key) {
|
|
134
|
-
case 'Enter':
|
|
135
|
-
case ' ':
|
|
136
|
-
this.pressedKeys.delete(event.key);
|
|
137
|
-
if (this.pressedKeys.size === 0) {
|
|
138
|
-
this.buttonEl.classList.remove(`${this.colour}--active`);
|
|
139
|
-
}
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
render() {
|
|
144
|
-
const classes = index$1.classNames(`${this.variant} ${this.colour} ${this.size}`, {
|
|
145
|
-
'icon-start': this.icon && this.iconPosition === 'start' && this.value,
|
|
146
|
-
'icon-end': this.icon && this.iconPosition === 'end' && this.value,
|
|
147
|
-
'icon-only': this.icon && !this.value,
|
|
148
|
-
});
|
|
149
|
-
const iconSize = this.size === 'small' ? '1rem' : undefined;
|
|
150
|
-
const isDisabled = this.disabled || this.ariaDisabled === 'true';
|
|
151
|
-
return (index.h("button", { key: 'f987b8884e1aab8959c2157039996019b42f826a', ref: el => (this.buttonEl = el), onKeyDown: this.handleKeyDown, onKeyUp: this.handleKeyUp, class: classes, style: { fontWeight: this.fontWeight }, type: this.type, "aria-disabled": isDisabled ? 'true' : 'false', ...this.inheritedAttributes }, index.h("slot", { key: '6b87d0e8e45f28f5a3dfb54cbb69d6c7acc3ef15', name: "prefix" }, this.icon && this.iconPosition === 'start' && index.h("ds-icon", { key: '32dd7550a1b1203e7a6b24dd0e7ef4516ee6ed45', name: this.icon, size: iconSize })), this.value && index.h("span", { key: 'ba87d4898f376ff0b1d4fa43258c36fb034ee88c', class: "button-value" }, this.value), index.h("slot", { key: 'ba2a58d944a9e11aaade04d25dad9c544a5966ea', name: "suffix" }, this.icon && this.iconPosition === 'end' && index.h("ds-icon", { key: 'e30f0970737c93c2153e9ae68c87c47c3c4a2329', name: this.icon, size: iconSize }))));
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
DsButton.style = DsButtonStyle0;
|
|
155
|
-
|
|
156
|
-
const dsVisuallyHiddenCss = ":host{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";
|
|
157
|
-
const DsVisuallyHiddenStyle0 = dsVisuallyHiddenCss;
|
|
158
|
-
|
|
159
|
-
const DsVisuallyHidden = class {
|
|
160
|
-
constructor(hostRef) {
|
|
161
|
-
index.registerInstance(this, hostRef);
|
|
162
|
-
}
|
|
163
|
-
render() {
|
|
164
|
-
return (index.h("slot", { key: '390610148832811748f7700f0d438b257bdb354d' }));
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
DsVisuallyHidden.style = DsVisuallyHiddenStyle0;
|
|
168
|
-
|
|
169
|
-
exports.ds_button = DsButton;
|
|
170
|
-
exports.ds_visually_hidden = DsVisuallyHidden;
|