@uh-design-system/component-library 0.3.1 → 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.
Files changed (55) hide show
  1. package/dist/cjs/component-library.cjs.js +1 -1
  2. package/dist/cjs/ds-accordion_3.cjs.entry.js +11 -10
  3. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +3 -3
  4. package/dist/cjs/ds-link.cjs.entry.js +3 -3
  5. package/dist/cjs/ds-text-input.cjs.entry.js +3 -3
  6. package/dist/cjs/ds-visually-hidden.cjs.entry.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/00-foundations/typography/stories/typography.stories.js +110 -0
  9. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +11 -3
  10. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +6 -6
  11. package/dist/collection/components/01-base-components/ds-button/ds-button.css +127 -63
  12. package/dist/collection/components/01-base-components/ds-button/ds-button.js +22 -1
  13. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +6 -0
  14. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +10 -0
  15. package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +2 -2
  16. package/dist/collection/components/01-base-components/ds-link/ds-link.css +91 -25
  17. package/dist/collection/components/01-base-components/ds-link/ds-link.js +3 -3
  18. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +1 -1
  19. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +86 -20
  20. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +3 -3
  21. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.stories.js +1 -1
  22. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +30 -11
  23. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +3 -3
  24. package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
  25. package/dist/collection/utils/typography/typographyUtils.js +21 -0
  26. package/dist/component-library/component-library.css +1 -1
  27. package/dist/component-library/component-library.esm.js +1 -1
  28. package/dist/component-library/ds-accordion_3.entry.js +1 -1
  29. package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
  30. package/dist/component-library/ds-link.entry.js +1 -1
  31. package/dist/component-library/ds-text-input.entry.js +1 -1
  32. package/dist/component-library/ds-visually-hidden.entry.js +1 -1
  33. package/dist/components/ds-accordion.js +7 -7
  34. package/dist/components/ds-button2.js +4 -2
  35. package/dist/components/ds-icon2.js +2 -2
  36. package/dist/components/ds-link-with-arrow.js +4 -4
  37. package/dist/components/ds-link.js +4 -4
  38. package/dist/components/ds-text-input.js +4 -4
  39. package/dist/components/ds-visually-hidden2.js +1 -1
  40. package/dist/esm/component-library.js +1 -1
  41. package/dist/esm/ds-accordion_3.entry.js +11 -10
  42. package/dist/esm/ds-link-with-arrow.entry.js +3 -3
  43. package/dist/esm/ds-link.entry.js +3 -3
  44. package/dist/esm/ds-text-input.entry.js +3 -3
  45. package/dist/esm/ds-visually-hidden.entry.js +1 -1
  46. package/dist/esm/loader.js +1 -1
  47. package/dist/types/components/00-foundations/typography/stories/typography.stories.d.ts +9 -0
  48. package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +1 -0
  49. package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
  50. package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +3 -0
  51. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +1 -1
  52. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +1 -1
  53. package/dist/types/components.d.ts +6 -4
  54. package/dist/types/utils/typography/typographyUtils.d.ts +1 -0
  55. package/package.json +2 -4
@@ -1,8 +1,12 @@
1
1
  :host {
2
2
  display: inline-block;
3
3
  }
4
+ :host[full-width] {
5
+ width: 100%;
6
+ }
4
7
 
5
8
  .ds-button {
9
+ width: 100%;
6
10
  align-items: center;
7
11
  border-radius: 0;
8
12
  border-style: solid;
@@ -10,19 +14,6 @@
10
14
  font-family: var(--ds-fontFamily-body);
11
15
  font-weight: var(--ds-fontWeight-bold);
12
16
  outline: 4px solid transparent;
13
- border-width: var(--ds-borderWidth-thick);
14
- font-size: var(--ds-fontSize-18);
15
- min-height: 44px;
16
- padding: var(--ds-spacing-3xSmall) var(--ds-spacing-xSmall);
17
- }
18
- .ds-button:focus {
19
- outline-offset: 2px;
20
- outline-width: 2px;
21
- }
22
- .ds-button.icon-only {
23
- padding-left: 0;
24
- padding-right: 0;
25
- aspect-ratio: 1;
26
17
  justify-content: center;
27
18
  }
28
19
  .ds-button .button-value {
@@ -38,21 +29,60 @@
38
29
  .ds-button.icon-end:not(.small) ds-icon {
39
30
  margin-left: var(--ds-spacing-3xSmall);
40
31
  }
32
+ .ds-button:not(.small):not(.secondary) {
33
+ border-width: 0px;
34
+ font-size: var(--ds-fontSize-18);
35
+ min-height: 44px;
36
+ padding: var(--ds-spacing-3xSmall) calc(var(--ds-spacing-small) - 0px);
37
+ }
38
+ .ds-button:not(.small).secondary {
39
+ border-width: var(--ds-borderWidth-thick);
40
+ font-size: var(--ds-fontSize-18);
41
+ min-height: 44px;
42
+ padding: var(--ds-spacing-3xSmall) calc(var(--ds-spacing-small) - var(--ds-borderWidth-thick));
43
+ }
44
+ .ds-button:not(.small).icon-only {
45
+ padding-left: 0;
46
+ padding-right: 0;
47
+ }
48
+ .ds-button.small:not(.secondary) {
49
+ border-width: 0px;
50
+ font-size: var(--ds-fontSize-14);
51
+ min-height: 32px;
52
+ padding: var(--ds-spacing-4xSmall) calc(var(--ds-spacing-2xSmall) - 0px);
53
+ }
54
+ .ds-button.small.secondary {
55
+ border-width: var(--ds-borderWidth-thin);
56
+ font-size: var(--ds-fontSize-14);
57
+ min-height: 32px;
58
+ padding: var(--ds-spacing-4xSmall) calc(var(--ds-spacing-2xSmall) - var(--ds-borderWidth-thin));
59
+ }
60
+ .ds-button.small.icon-only {
61
+ padding-left: 0;
62
+ padding-right: 0;
63
+ width: 32px;
64
+ }
65
+ .ds-button.small ds-icon {
66
+ height: 1rem;
67
+ }
41
68
  .ds-button.primary.blue {
42
69
  background-color: var(--ds-bgColor-primary);
43
70
  border-color: transparent;
44
71
  color: var(--ds-textColor-white);
45
72
  }
73
+ .ds-button.primary.blue:focus-visible, .ds-button.primary.blue:focus-within {
74
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
75
+ outline-color: var(--ds-borderColor-black);
76
+ outline-offset: var(--ds-borderWidth-thin);
77
+ outline-style: solid;
78
+ outline-width: var(--ds-borderWidth-thin);
79
+ }
46
80
  .ds-button.primary.blue:hover {
47
81
  background-color: var(--ds-bgColor-primary-hover);
48
82
  }
49
83
  .ds-button.primary.blue:active, .ds-button.primary.blue--active {
50
84
  background-color: var(--ds-bgColor-primary-active);
51
85
  }
52
- .ds-button.primary.blue:focus-visible {
53
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
54
- outline-color: var(--ds-borderColor-black);
55
- }
56
86
  .ds-button.primary.blue[aria-disabled=true], .ds-button.primary.blue.disabled, .ds-button.primary.blue:disabled {
57
87
  background-color: var(--ds-bgColor-disabled-onLight);
58
88
  border-color: transparent;
@@ -63,16 +93,19 @@
63
93
  border-color: transparent;
64
94
  color: var(--ds-textColor-white);
65
95
  }
96
+ .ds-button.primary.black:focus-visible, .ds-button.primary.black:focus-within {
97
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
98
+ outline-color: var(--ds-borderColor-black);
99
+ outline-offset: var(--ds-borderWidth-thin);
100
+ outline-style: solid;
101
+ outline-width: var(--ds-borderWidth-thin);
102
+ }
66
103
  .ds-button.primary.black:hover {
67
104
  background-color: var(--ds-bgColor-black-hover);
68
105
  }
69
106
  .ds-button.primary.black:active, .ds-button.primary.black--active {
70
107
  background-color: var(--ds-bgColor-black-active);
71
108
  }
72
- .ds-button.primary.black:focus-visible {
73
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
74
- outline-color: var(--ds-borderColor-black);
75
- }
76
109
  .ds-button.primary.black[aria-disabled=true], .ds-button.primary.black.disabled, .ds-button.primary.black:disabled {
77
110
  background-color: var(--ds-bgColor-disabled-onLight);
78
111
  border-color: transparent;
@@ -83,16 +116,19 @@
83
116
  border-color: transparent;
84
117
  color: var(--ds-textColor-default);
85
118
  }
119
+ .ds-button.primary.white:focus-visible, .ds-button.primary.white:focus-within {
120
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
121
+ outline-color: var(--ds-borderColor-white);
122
+ outline-offset: var(--ds-borderWidth-thin);
123
+ outline-style: solid;
124
+ outline-width: var(--ds-borderWidth-thin);
125
+ }
86
126
  .ds-button.primary.white:hover {
87
127
  background-color: var(--ds-bgColor-white-hover);
88
128
  }
89
129
  .ds-button.primary.white:active, .ds-button.primary.white--active {
90
130
  background-color: var(--ds-bgColor-white-active);
91
131
  }
92
- .ds-button.primary.white:focus-visible {
93
- box-shadow: 0 0 0 2px var(--ds-borderColor-black);
94
- outline-color: var(--ds-borderColor-white);
95
- }
96
132
  .ds-button.primary.white[aria-disabled=true], .ds-button.primary.white.disabled, .ds-button.primary.white:disabled {
97
133
  background-color: var(--ds-bgColor-disabled-onDark);
98
134
  border-color: transparent;
@@ -103,16 +139,19 @@
103
139
  border-color: var(--ds-borderColor-primary);
104
140
  color: var(--ds-textColor-primary);
105
141
  }
142
+ .ds-button.secondary.blue:focus-visible, .ds-button.secondary.blue:focus-within {
143
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
144
+ outline-color: var(--ds-borderColor-black);
145
+ outline-offset: var(--ds-borderWidth-thin);
146
+ outline-style: solid;
147
+ outline-width: var(--ds-borderWidth-thin);
148
+ }
106
149
  .ds-button.secondary.blue:hover {
107
150
  background-color: var(--ds-bgColor-secondary-hover);
108
151
  }
109
152
  .ds-button.secondary.blue:active, .ds-button.secondary.blue--active {
110
153
  background-color: var(--ds-bgColor-secondary-active);
111
154
  }
112
- .ds-button.secondary.blue:focus-visible {
113
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
114
- outline-color: var(--ds-borderColor-black);
115
- }
116
155
  .ds-button.secondary.blue[aria-disabled=true], .ds-button.secondary.blue.disabled, .ds-button.secondary.blue:disabled {
117
156
  background-color: var(--ds-bgColor-secondary);
118
157
  border-color: var(--ds-borderColor-disabled-onLight);
@@ -123,16 +162,19 @@
123
162
  border-color: var(--ds-borderColor-black);
124
163
  color: var(--ds-textColor-default);
125
164
  }
165
+ .ds-button.secondary.black:focus-visible, .ds-button.secondary.black:focus-within {
166
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
167
+ outline-color: var(--ds-borderColor-black);
168
+ outline-offset: var(--ds-borderWidth-thin);
169
+ outline-style: solid;
170
+ outline-width: var(--ds-borderWidth-thin);
171
+ }
126
172
  .ds-button.secondary.black:hover {
127
173
  background-color: var(--ds-bgColor-transparent-onLight-hover);
128
174
  }
129
175
  .ds-button.secondary.black:active, .ds-button.secondary.black--active {
130
176
  background-color: var(--ds-bgColor-transparent-onLight-active);
131
177
  }
132
- .ds-button.secondary.black:focus-visible {
133
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
134
- outline-color: var(--ds-borderColor-black);
135
- }
136
178
  .ds-button.secondary.black[aria-disabled=true], .ds-button.secondary.black.disabled, .ds-button.secondary.black:disabled {
137
179
  background-color: transparent;
138
180
  border-color: var(--ds-borderColor-disabled-onLight);
@@ -143,16 +185,19 @@
143
185
  border-color: var(--ds-borderColor-white);
144
186
  color: var(--ds-textColor-white);
145
187
  }
188
+ .ds-button.secondary.white:focus-visible, .ds-button.secondary.white:focus-within {
189
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
190
+ outline-color: var(--ds-borderColor-white);
191
+ outline-offset: var(--ds-borderWidth-thin);
192
+ outline-style: solid;
193
+ outline-width: var(--ds-borderWidth-thin);
194
+ }
146
195
  .ds-button.secondary.white:hover {
147
196
  background-color: var(--ds-bgColor-transparent-onDark-hover);
148
197
  }
149
198
  .ds-button.secondary.white:active, .ds-button.secondary.white--active {
150
199
  background-color: var(--ds-bgColor-transparent-onDark-active);
151
200
  }
152
- .ds-button.secondary.white:focus-visible {
153
- box-shadow: 0 0 0 2px var(--ds-borderColor-black);
154
- outline-color: var(--ds-borderColor-white);
155
- }
156
201
  .ds-button.secondary.white[aria-disabled=true], .ds-button.secondary.white.disabled, .ds-button.secondary.white:disabled {
157
202
  background-color: transparent;
158
203
  border-color: var(--ds-borderColor-disabled-onDark);
@@ -162,8 +207,13 @@
162
207
  background-color: transparent;
163
208
  border-color: transparent;
164
209
  color: var(--ds-textColor-primary);
165
- padding-right: 0;
166
- padding-left: 0;
210
+ }
211
+ .ds-button.supplementary.blue:focus-visible, .ds-button.supplementary.blue:focus-within {
212
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
213
+ outline-color: var(--ds-borderColor-black);
214
+ outline-offset: var(--ds-borderWidth-thin);
215
+ outline-style: solid;
216
+ outline-width: var(--ds-borderWidth-thin);
167
217
  }
168
218
  .ds-button.supplementary.blue:hover {
169
219
  background-color: var(--ds-bgColor-secondary-hover);
@@ -171,9 +221,13 @@
171
221
  .ds-button.supplementary.blue:active, .ds-button.supplementary.blue--active {
172
222
  background-color: var(--ds-bgColor-secondary-active);
173
223
  }
174
- .ds-button.supplementary.blue:focus-visible {
175
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
176
- outline-color: var(--ds-borderColor-black);
224
+ .ds-button.supplementary.blue:not(.small) {
225
+ padding-right: var(--ds-borderWidth-thick);
226
+ padding-left: var(--ds-borderWidth-thick);
227
+ }
228
+ .ds-button.supplementary.blue.small {
229
+ padding-right: var(--ds-borderWidth-thin);
230
+ padding-left: var(--ds-borderWidth-thin);
177
231
  }
178
232
  .ds-button.supplementary.blue[aria-disabled=true], .ds-button.supplementary.blue.disabled, .ds-button.supplementary.blue:disabled {
179
233
  background-color: transparent;
@@ -184,8 +238,13 @@
184
238
  background-color: transparent;
185
239
  border-color: transparent;
186
240
  color: var(--ds-textColor-default);
187
- padding-right: 0;
188
- padding-left: 0;
241
+ }
242
+ .ds-button.supplementary.black:focus-visible, .ds-button.supplementary.black:focus-within {
243
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
244
+ outline-color: var(--ds-borderColor-black);
245
+ outline-offset: var(--ds-borderWidth-thin);
246
+ outline-style: solid;
247
+ outline-width: var(--ds-borderWidth-thin);
189
248
  }
190
249
  .ds-button.supplementary.black:hover {
191
250
  background-color: var(--ds-bgColor-transparent-onLight-hover);
@@ -193,9 +252,13 @@
193
252
  .ds-button.supplementary.black:active, .ds-button.supplementary.black--active {
194
253
  background-color: var(--ds-bgColor-transparent-onLight-active);
195
254
  }
196
- .ds-button.supplementary.black:focus-visible {
197
- box-shadow: 0 0 0 2px var(--ds-borderColor-white);
198
- outline-color: var(--ds-borderColor-black);
255
+ .ds-button.supplementary.black:not(.small) {
256
+ padding-right: var(--ds-borderWidth-thick);
257
+ padding-left: var(--ds-borderWidth-thick);
258
+ }
259
+ .ds-button.supplementary.black.small {
260
+ padding-right: var(--ds-borderWidth-thin);
261
+ padding-left: var(--ds-borderWidth-thin);
199
262
  }
200
263
  .ds-button.supplementary.black[aria-disabled=true], .ds-button.supplementary.black.disabled, .ds-button.supplementary.black:disabled {
201
264
  background-color: transparent;
@@ -206,8 +269,13 @@
206
269
  background-color: transparent;
207
270
  border-color: transparent;
208
271
  color: var(--ds-textColor-white);
209
- padding-right: 0;
210
- padding-left: 0;
272
+ }
273
+ .ds-button.supplementary.white:focus-visible, .ds-button.supplementary.white:focus-within {
274
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-black);
275
+ outline-color: var(--ds-borderColor-white);
276
+ outline-offset: var(--ds-borderWidth-thin);
277
+ outline-style: solid;
278
+ outline-width: var(--ds-borderWidth-thin);
211
279
  }
212
280
  .ds-button.supplementary.white:hover {
213
281
  background-color: var(--ds-bgColor-transparent-onDark-hover);
@@ -215,24 +283,20 @@
215
283
  .ds-button.supplementary.white:active, .ds-button.supplementary.white--active {
216
284
  background-color: var(--ds-bgColor-transparent-onDark-active);
217
285
  }
218
- .ds-button.supplementary.white:focus-visible {
219
- box-shadow: 0 0 0 2px var(--ds-borderColor-black);
220
- outline-color: var(--ds-borderColor-white);
286
+ .ds-button.supplementary.white:not(.small) {
287
+ padding-right: var(--ds-borderWidth-thick);
288
+ padding-left: var(--ds-borderWidth-thick);
289
+ }
290
+ .ds-button.supplementary.white.small {
291
+ padding-right: var(--ds-borderWidth-thin);
292
+ padding-left: var(--ds-borderWidth-thin);
221
293
  }
222
294
  .ds-button.supplementary.white[aria-disabled=true], .ds-button.supplementary.white.disabled, .ds-button.supplementary.white:disabled {
223
295
  background-color: transparent;
224
296
  border-color: transparent;
225
297
  color: var(--ds-textColor-disabled-onDark);
226
298
  }
227
- .ds-button.small {
228
- border-width: var(--ds-borderWidth-thin);
229
- font-size: var(--ds-fontSize-14);
230
- min-height: 32px;
231
- padding: var(--ds-spacing-4xSmall) var(--ds-spacing-2xSmall);
232
- }
233
- .ds-button.small.icon-only {
234
- width: 32px;
235
- }
236
- .ds-button.small ds-icon {
237
- height: 1rem;
299
+ .ds-button.icon-only {
300
+ aspect-ratio: 1;
301
+ justify-content: center;
238
302
  }
@@ -15,6 +15,7 @@ export class DsButton {
15
15
  iconPosition = 'start';
16
16
  type = 'button';
17
17
  disabled = false;
18
+ fullWidth = false;
18
19
  ariaDisabled = 'false';
19
20
  componentWillLoad() {
20
21
  this.inheritedAttributes = {
@@ -64,7 +65,7 @@ export class DsButton {
64
65
  });
65
66
  const iconSize = this.size === 'small' ? '1rem' : undefined;
66
67
  const isDisabled = this.disabled || this.ariaDisabled === 'true';
67
- return (h("button", { key: '46e6657656748f136011c38efecbd65ccfd68f71', 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 }, h("slot", { key: '564dbf073e00ffb607ad590ec733feec0d48561a', name: "prefix" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '9a52ef760ad5e040d5c6a80522271c13c67b76ab', name: this.icon, size: iconSize })), this.value && h("span", { key: '68d704a53e9afe7d27c022f58be47df3d0fe4de6', class: "button-value" }, this.value), h("slot", { key: 'd529e83212c31f7502afc748e9666b30a276c99c', name: "suffix" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: '08969d9219026744a7eec5a3d5928b4b4ceb6298', name: this.icon, size: iconSize }))));
68
+ return (h("button", { key: '57b49111cb6e4957d1cd69cdfd09b99fe620b614', 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 }, h("slot", { key: '56532d67c5a1df5e831025422db0c886bd731db0', name: "prefix" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '6028ee6b589400340f21411b252c7ba85732fa1c', name: this.icon, size: iconSize })), this.value && h("span", { key: '8b98003443f13f88f76b9a9a611eb1abc4daee74', class: "button-value" }, this.value), h("slot", { key: '35ad0a3aa154b8afba9bd50ffe30c1e25a37f382', name: "suffix" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: '7eebd8b5754c0dd1d3d6a435234728518a16a405', name: this.icon, size: iconSize }))));
68
69
  }
69
70
  static get is() { return "ds-button"; }
70
71
  static get encapsulation() { return "scoped"; }
@@ -269,6 +270,26 @@ export class DsButton {
269
270
  "reflect": false,
270
271
  "defaultValue": "false"
271
272
  },
273
+ "fullWidth": {
274
+ "type": "boolean",
275
+ "mutable": false,
276
+ "complexType": {
277
+ "original": "boolean",
278
+ "resolved": "boolean",
279
+ "references": {}
280
+ },
281
+ "required": false,
282
+ "optional": false,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": ""
286
+ },
287
+ "getter": false,
288
+ "setter": false,
289
+ "attribute": "full-width",
290
+ "reflect": false,
291
+ "defaultValue": "false"
292
+ },
272
293
  "ariaDisabled": {
273
294
  "type": "string",
274
295
  "mutable": false,
@@ -25,3 +25,9 @@ export const ResetAndSubmitButton = {
25
25
  </form>
26
26
  `,
27
27
  };
28
+ export const FullWidthWithIconsUsingSlots = {
29
+ render: () => html `<ds-button style="width: 100%" value="Full width with icons using slots">
30
+ <ds-icon slot="prefix" name="ds_flame"></ds-icon>
31
+ <ds-icon slot="suffix" name="ds_flame"></ds-icon>
32
+ </ds-button>`,
33
+ };
@@ -1,3 +1,4 @@
1
+ import { html } from "lit";
1
2
  const meta = {
2
3
  title: 'Base Components/Button/Features',
3
4
  component: 'ds-button',
@@ -71,3 +72,12 @@ IconEnd.args = {
71
72
  icon: 'arrow_forward',
72
73
  iconPosition: 'end',
73
74
  };
75
+ export const FullWidth = {
76
+ render: () => html `<ds-button full-width value="Full width"></ds-button>`
77
+ };
78
+ export const FullWidthWithStartIcon = {
79
+ render: () => html `<ds-button full-width icon="ds_flame" value="Full width"></ds-button>`
80
+ };
81
+ export const FullWidthWithEndIcon = {
82
+ render: () => html `<ds-button full-width icon="ds_flame" icon-position="end" value="Full width"></ds-button>`
83
+ };
@@ -48,7 +48,7 @@ export class DsIcon {
48
48
  }
49
49
  }
50
50
  render() {
51
- return (h(Fragment, { key: '237ef9992d67c967fe88d108c8bc2e38ce5c32bf' }, h("span", { key: '995f53c4fe20d616270f2d70e927065f794c5860', class: 'ds-icon--container', innerHTML: this.getIcon(), "aria-hidden": this.hidden ? 'true' : 'false' })));
51
+ return (h(Fragment, { key: 'cc6f636f46e631b82570aaa156bbced5e7c23fc6' }, h("span", { key: 'c3305714b164807c119ff1e9ab4d9496dd3eb105', class: 'ds-icon--container', innerHTML: this.getIcon(), "aria-hidden": this.hidden ? 'true' : 'false' })));
52
52
  }
53
53
  static get is() { return "ds-icon"; }
54
54
  static get encapsulation() { return "shadow"; }
@@ -138,7 +138,7 @@ export class DsIcon {
138
138
  },
139
139
  "getter": false,
140
140
  "setter": false,
141
- "attribute": "ds-title",
141
+ "attribute": "title",
142
142
  "reflect": false,
143
143
  "defaultValue": "'Icon'"
144
144
  },
@@ -15,6 +15,14 @@
15
15
  --ds-borderRadius-none: 0px;
16
16
  }
17
17
 
18
+ :root {
19
+ --ds-breakpoint-xSmall: 20rem;
20
+ --ds-breakpoint-small: 30rem;
21
+ --ds-breakpoint-medium: 60rem;
22
+ --ds-breakpoint-large: 75rem;
23
+ --ds-breakpoint-xLarge: 90rem;
24
+ }
25
+
18
26
  :root {
19
27
  --ds-fontFamily-heading: "Open Sans", sans-serif;
20
28
  --ds-fontFamily-body: "Open Sans", sans-serif;
@@ -57,26 +65,83 @@
57
65
  --ds-fontFamily-body: "Open Sans Variable", sans-serif;
58
66
  }
59
67
  }
60
- .bodyText {
61
- line-height: 1.5;
68
+ :root {
69
+ --ds-breakpoint-xSmall: 20rem;
70
+ --ds-breakpoint-small: 30rem;
71
+ --ds-breakpoint-medium: 60rem;
72
+ --ds-breakpoint-large: 75rem;
73
+ --ds-breakpoint-xLarge: 90rem;
62
74
  }
63
- .bodyText--2xLarge {
64
- font-size: 1.375rem;
75
+
76
+ /* Body text styles */
77
+ .ds-bodyText--2xLarge {
78
+ color: var(--ds-textColor-default);
79
+ font-family: var(--ds-fontFamily-body);
80
+ font-size: var(--ds-fontSize-20);
81
+ font-weight: var(--ds-fontWeight-regular);
82
+ letter-spacing: var(--ds-letterSpacing-wide);
83
+ line-height: var(--ds-lineHeight-large);
65
84
  }
66
- .bodyText--xLarge {
67
- font-size: 1.25rem;
85
+ @media (min-width: 30rem) {
86
+ .ds-bodyText--2xLarge {
87
+ font-size: var(--ds-fontSize-22);
88
+ }
68
89
  }
69
- .bodyText--large {
70
- font-size: 1.125rem;
90
+
91
+ .ds-bodyText--xLarge {
92
+ color: var(--ds-textColor-default);
93
+ font-family: var(--ds-fontFamily-body);
94
+ font-size: var(--ds-fontSize-18);
95
+ font-weight: var(--ds-fontWeight-regular);
96
+ letter-spacing: var(--ds-letterSpacing-wide);
97
+ line-height: var(--ds-lineHeight-large);
71
98
  }
72
- .bodyText--medium {
73
- font-size: 1rem;
99
+ @media (min-width: 30rem) {
100
+ .ds-bodyText--xLarge {
101
+ font-size: var(--ds-fontSize-20);
102
+ }
74
103
  }
75
- .bodyText--small {
76
- font-size: 0.875rem;
104
+
105
+ .ds-bodyText--large {
106
+ color: var(--ds-textColor-default);
107
+ font-family: var(--ds-fontFamily-body);
108
+ font-size: var(--ds-fontSize-16);
109
+ font-weight: var(--ds-fontWeight-regular);
110
+ letter-spacing: var(--ds-letterSpacing-wide);
111
+ line-height: var(--ds-lineHeight-large);
77
112
  }
78
- .bodyText--xSmall {
79
- font-size: 0.75rem;
113
+ @media (min-width: 30rem) {
114
+ .ds-bodyText--large {
115
+ font-size: var(--ds-fontSize-18);
116
+ }
117
+ }
118
+
119
+ .ds-bodyText--medium {
120
+ color: var(--ds-textColor-default);
121
+ font-family: var(--ds-fontFamily-body);
122
+ font-size: var(--ds-fontSize-14);
123
+ font-weight: var(--ds-fontWeight-regular);
124
+ letter-spacing: var(--ds-letterSpacing-wide);
125
+ line-height: var(--ds-lineHeight-large);
126
+ }
127
+ @media (min-width: 30rem) {
128
+ .ds-bodyText--medium {
129
+ font-size: var(--ds-fontSize-16);
130
+ }
131
+ }
132
+
133
+ .ds-bodyText--small {
134
+ color: var(--ds-textColor-default);
135
+ font-family: var(--ds-fontFamily-body);
136
+ font-size: var(--ds-fontSize-12);
137
+ font-weight: var(--ds-fontWeight-regular);
138
+ letter-spacing: var(--ds-letterSpacing-wide);
139
+ line-height: var(--ds-lineHeight-large);
140
+ }
141
+ @media (min-width: 30rem) {
142
+ .ds-bodyText--small {
143
+ font-size: var(--ds-fontSize-14);
144
+ }
80
145
  }
81
146
 
82
147
  :host {
@@ -96,6 +161,13 @@
96
161
  text-underline-offset: 12%;
97
162
  text-underline-position: from-font;
98
163
  }
164
+ .ds-link:focus-visible, .ds-link:focus-within {
165
+ box-shadow: 0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);
166
+ outline-color: var(--ds-borderColor-black);
167
+ outline-offset: var(--ds-borderWidth-thin);
168
+ outline-style: solid;
169
+ outline-width: var(--ds-borderWidth-thin);
170
+ }
99
171
  .ds-link--semibold {
100
172
  font-weight: var(--ds-fontWeight-semibold);
101
173
  }
@@ -128,31 +200,25 @@
128
200
  .ds-link:active {
129
201
  color: var(--ds-textColor-link-active);
130
202
  }
131
- .ds-link:focus-visible {
132
- outline-style: solid;
133
- outline-width: var(--ds-borderWidth-thin);
134
- outline-offset: var(--ds-borderWidth-thin);
135
- outline-color: var(--ds-palette-black);
136
- }
137
203
  .ds-link:visited {
138
204
  color: var(--ds-textColor-link-visited);
139
205
  }
140
206
  .ds-link--standalone {
141
- color: var(--ds-textColor-link--standalone);
207
+ color: var(--ds-textColor-link);
142
208
  text-decoration-line: none;
143
209
  }
144
210
  .ds-link--standalone:hover, .ds-link--standalone:active {
145
211
  text-decoration-line: underline;
146
212
  }
147
213
  .ds-link--standalone:hover {
148
- color: var(--ds-textColor-link--standalone-hover);
214
+ color: var(--ds-textColor-link-hover);
149
215
  }
150
216
  .ds-link--standalone:active {
151
- color: var(--ds-textColor-link--standalone-active);
217
+ color: var(--ds-textColor-link-active);
152
218
  }
153
219
  .ds-link--standalone:focus-visible {
154
- color: var(--ds-textColor-link--standalone-focus);
220
+ color: var(--ds-textColor-link);
155
221
  }
156
222
  .ds-link--standalone:visited {
157
- color: var(--ds-textColor-link--standalone);
223
+ color: var(--ds-textColor-link);
158
224
  }
@@ -18,7 +18,7 @@ export class DsLink {
18
18
  href;
19
19
  target;
20
20
  download;
21
- lang;
21
+ language;
22
22
  componentWillLoad() {
23
23
  this.inheritedAttributes = inheritAriaAttributes(this.el);
24
24
  if (opensInNewTab(this.target)) {
@@ -35,7 +35,7 @@ export class DsLink {
35
35
  [`ds-link__icon--start-${this.variant}`]: this.iconPosition === 'start',
36
36
  [`ds-link__icon--end-${this.variant}`]: this.iconPosition === 'end',
37
37
  });
38
- return (h("a", { key: '58a12ff2e845e9acf84c3917b5826b014ffb0919', href: this.href, class: classes, rel: this.rel, target: this.target, download: this.download, ...this.inheritedAttributes }, h("slot", { key: '88f6f827f0d37bb358a596c61a27778d3e7e9032', name: "iconStart" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '82ae7997d3e03e89260f3aabd9fe953d4f252f79', name: this.icon, class: iconClasses, size: "1em" })), this.text, h("slot", { key: 'ad1dc790a43c467d40a40882a55b5f7ad26d52fa', name: "iconEnd" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: 'fbecfd82f1cf0994bde85d554a07e6210370f457', name: this.icon, class: iconClasses, size: "1em" })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: 'f3de3a15b89e77f2838173a541a83c938f19b10d', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.lang ?? document.documentElement.lang)))));
38
+ return (h("a", { key: 'd8922731378178b2c927796fdc636fc26d4cbaea', href: this.href, class: classes, rel: this.rel, target: this.target, download: this.download, ...this.inheritedAttributes }, h("slot", { key: 'dfbd079b80132f7751501da7e47bb0f1aec4590a', name: "iconStart" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '2b3d864df8c04b340b0251c9ac185be918f7bb16', name: this.icon, class: iconClasses, size: "1em" })), this.text, h("slot", { key: '2fc2e4a3be8b83d545b27ae19096ffc5fbb72c0e', name: "iconEnd" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: '9592ce7c0222bd3c739943fb9b6a37b92e67618c', name: this.icon, class: iconClasses, size: "1em" })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: '43c55dded281f4e3a084ceb64edf695707309494', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.language ?? document.documentElement.lang)))));
39
39
  }
40
40
  static get is() { return "ds-link"; }
41
41
  static get encapsulation() { return "shadow"; }
@@ -251,7 +251,7 @@ export class DsLink {
251
251
  "attribute": "download",
252
252
  "reflect": false
253
253
  },
254
- "lang": {
254
+ "language": {
255
255
  "type": "string",
256
256
  "mutable": false,
257
257
  "complexType": {
@@ -63,7 +63,7 @@ export const Playground = {
63
63
  download: {
64
64
  control: 'boolean'
65
65
  },
66
- lang: {
66
+ language: {
67
67
  control: 'text',
68
68
  description: 'ISO 639 language code. Known languages are: "en", "fi", "sv". When undefined will use browser\'s language.',
69
69
  },