@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.
Files changed (116) hide show
  1. package/dist/cjs/attributes-f7831329.js +78 -0
  2. package/dist/cjs/component-library.cjs.js +3 -3
  3. package/dist/cjs/{ds-accordion_2.cjs.entry.js → ds-accordion_3.cjs.entry.js} +419 -241
  4. package/dist/cjs/ds-link-with-arrow.cjs.entry.js +47 -0
  5. package/dist/cjs/ds-link.cjs.entry.js +54 -0
  6. package/dist/cjs/ds-text-input.cjs.entry.js +12 -16
  7. package/dist/cjs/ds-visually-hidden.cjs.entry.js +20 -0
  8. package/dist/cjs/{index-fd4f6cd2.js → index-bfa0f441.js} +17 -11
  9. package/dist/cjs/linkUtils-695da37c.js +16 -0
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/utils-8b73aa91.js +10 -0
  12. package/dist/collection/collection-manifest.json +3 -1
  13. package/dist/collection/components/00-foundations/icons/categories/arrows.js +6 -0
  14. package/dist/collection/components/00-foundations/icons/categories/information.js +12 -0
  15. package/dist/collection/components/00-foundations/icons/categories/media.js +4 -0
  16. package/dist/collection/components/00-foundations/icons/categories/social.js +17 -0
  17. package/dist/collection/components/00-foundations/icons/iconList.js +2 -0
  18. package/dist/collection/components/00-foundations/typography/stories/typography.stories.js +110 -0
  19. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +101 -82
  20. package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +41 -9
  21. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +15 -0
  22. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +1 -1
  23. package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +10 -1
  24. package/dist/collection/components/01-base-components/ds-button/ds-button.css +168 -104
  25. package/dist/collection/components/01-base-components/ds-button/ds-button.js +23 -2
  26. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +6 -0
  27. package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +13 -7
  28. package/dist/collection/components/01-base-components/ds-icon/ds-icon.css +5 -1
  29. package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +8 -5
  30. package/dist/collection/components/01-base-components/ds-icon/ds-icon.stories.js +2 -2
  31. package/dist/collection/components/01-base-components/ds-link/ds-link.css +224 -0
  32. package/dist/collection/components/01-base-components/ds-link/ds-link.js +281 -0
  33. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +53 -0
  34. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +73 -0
  35. package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +72 -0
  36. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +208 -0
  37. package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +161 -0
  38. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.examples.stories.js +33 -0
  39. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.features.stories.js +19 -0
  40. package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.stories.js +40 -0
  41. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +72 -48
  42. package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +44 -4
  43. 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
  44. 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
  45. package/dist/collection/components/01-base-components/ds-text-input/{ds-text-input.stories.js → stories/ds-text-input.stories.js} +2 -2
  46. package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
  47. package/dist/collection/introduction/introduction.stories.js +9 -0
  48. package/dist/collection/utils/link/linkUtils.js +11 -0
  49. package/dist/collection/utils/typography/typographyUtils.js +21 -0
  50. package/dist/collection/utils/utils.js +5 -0
  51. package/dist/component-library/attributes-9419ac39.js +1 -0
  52. package/dist/component-library/component-library.css +1 -1
  53. package/dist/component-library/component-library.esm.js +1 -1
  54. package/dist/component-library/ds-accordion_3.entry.js +1 -0
  55. package/dist/component-library/ds-link-with-arrow.entry.js +1 -0
  56. package/dist/component-library/ds-link.entry.js +1 -0
  57. package/dist/component-library/ds-text-input.entry.js +1 -1
  58. package/dist/component-library/ds-visually-hidden.entry.js +1 -0
  59. package/dist/component-library/{index-4200d514.js → index-42701395.js} +2 -2
  60. package/dist/component-library/linkUtils-3d1b28cf.js +1 -0
  61. package/dist/component-library/utils-cca2a41a.js +1 -0
  62. package/dist/components/attributes.js +154 -0
  63. package/dist/components/ds-accordion.js +31 -12
  64. package/dist/components/ds-button2.js +6 -78
  65. package/dist/components/ds-icon2.js +320 -231
  66. package/dist/components/ds-link-with-arrow.d.ts +11 -0
  67. package/dist/components/ds-link-with-arrow.js +78 -0
  68. package/dist/components/ds-link.d.ts +11 -0
  69. package/dist/components/ds-link.js +90 -0
  70. package/dist/components/ds-text-input.js +11 -13
  71. package/dist/components/ds-visually-hidden2.js +1 -1
  72. package/dist/components/index2.js +7 -10
  73. package/dist/components/linkUtils.js +13 -0
  74. package/dist/components/utils.js +8 -0
  75. package/dist/esm/attributes-9419ac39.js +75 -0
  76. package/dist/esm/component-library.js +4 -4
  77. package/dist/esm/{ds-accordion_2.entry.js → ds-accordion_3.entry.js} +419 -242
  78. package/dist/esm/ds-link-with-arrow.entry.js +43 -0
  79. package/dist/esm/ds-link.entry.js +50 -0
  80. package/dist/esm/ds-text-input.entry.js +8 -12
  81. package/dist/esm/ds-visually-hidden.entry.js +16 -0
  82. package/dist/esm/{index-4200d514.js → index-42701395.js} +17 -11
  83. package/dist/esm/linkUtils-3d1b28cf.js +13 -0
  84. package/dist/esm/loader.js +3 -3
  85. package/dist/esm/utils-cca2a41a.js +8 -0
  86. package/dist/types/components/00-foundations/icons/categories/social.d.ts +5 -0
  87. package/dist/types/components/00-foundations/typography/stories/typography.stories.d.ts +9 -0
  88. package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +2 -0
  89. package/dist/types/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.d.ts +1 -0
  90. package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +1 -0
  91. package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
  92. package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +3 -0
  93. package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +1 -1
  94. package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +25 -0
  95. package/dist/types/components/01-base-components/ds-link/stories/ds-link.examples.stories.d.ts +11 -0
  96. package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +11 -0
  97. package/dist/types/components/01-base-components/ds-link/stories/ds-link.stories.d.ts +7 -0
  98. package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +18 -0
  99. package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.examples.stories.d.ts +7 -0
  100. package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.features.stories.d.ts +7 -0
  101. package/dist/types/components/01-base-components/ds-link-with-arrow/stories/ds-arrow-link.stories.d.ts +7 -0
  102. package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +2 -0
  103. 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
  104. 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
  105. 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
  106. package/dist/types/components.d.ts +66 -2
  107. package/dist/types/introduction/introduction.stories.d.ts +10 -0
  108. package/dist/types/utils/link/linkUtils.d.ts +2 -0
  109. package/dist/types/utils/typography/typographyUtils.d.ts +1 -0
  110. package/dist/types/utils/utils.d.ts +1 -0
  111. package/package.json +2 -4
  112. package/dist/cjs/ds-button_2.cjs.entry.js +0 -170
  113. package/dist/component-library/ds-accordion_2.entry.js +0 -1
  114. package/dist/component-library/ds-button_2.entry.js +0 -1
  115. package/dist/components/index3.js +0 -80
  116. package/dist/esm/ds-button_2.entry.js +0 -165
@@ -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
- button {
8
+ .ds-button {
9
+ width: 100%;
6
10
  align-items: center;
7
11
  border-radius: 0;
8
12
  border-style: solid;
@@ -10,229 +14,289 @@ button {
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
- button:focus {
19
- outline-offset: 2px;
20
- outline-width: 2px;
21
- }
22
- button.icon-only {
23
- padding-left: 0;
24
- padding-right: 0;
25
- aspect-ratio: 1;
26
17
  justify-content: center;
27
18
  }
28
- button .button-value {
19
+ .ds-button .button-value {
29
20
  padding-right: var(--ds-spacing-3xSmall);
30
21
  padding-left: var(--ds-spacing-3xSmall);
31
22
  }
32
- button ds-icon {
23
+ .ds-button ds-icon {
33
24
  height: 1.5rem;
34
25
  }
35
- button.icon-start:not(.small) ds-icon {
26
+ .ds-button.icon-start:not(.small) ds-icon {
36
27
  margin-right: var(--ds-spacing-3xSmall);
37
28
  }
38
- button.icon-end:not(.small) ds-icon {
29
+ .ds-button.icon-end:not(.small) ds-icon {
39
30
  margin-left: var(--ds-spacing-3xSmall);
40
31
  }
41
- button.primary.blue {
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
+ }
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
  }
46
- button.primary.blue:hover {
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
+ }
80
+ .ds-button.primary.blue:hover {
47
81
  background-color: var(--ds-bgColor-primary-hover);
48
82
  }
49
- button.primary.blue:active, button.primary.blue--active {
83
+ .ds-button.primary.blue:active, .ds-button.primary.blue--active {
50
84
  background-color: var(--ds-bgColor-primary-active);
51
85
  }
52
- 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
- button.primary.blue[aria-disabled=true], button.primary.blue.disabled, button.primary.blue:disabled {
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;
59
89
  color: var(--ds-textColor-disabled-onLight);
60
90
  }
61
- button.primary.black {
91
+ .ds-button.primary.black {
62
92
  background-color: var(--ds-bgColor-black);
63
93
  border-color: transparent;
64
94
  color: var(--ds-textColor-white);
65
95
  }
66
- button.primary.black:hover {
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
+ }
103
+ .ds-button.primary.black:hover {
67
104
  background-color: var(--ds-bgColor-black-hover);
68
105
  }
69
- button.primary.black:active, button.primary.black--active {
106
+ .ds-button.primary.black:active, .ds-button.primary.black--active {
70
107
  background-color: var(--ds-bgColor-black-active);
71
108
  }
72
- 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
- button.primary.black[aria-disabled=true], button.primary.black.disabled, button.primary.black:disabled {
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;
79
112
  color: var(--ds-textColor-disabled-onLight);
80
113
  }
81
- button.primary.white {
114
+ .ds-button.primary.white {
82
115
  background-color: var(--ds-bgColor-white);
83
116
  border-color: transparent;
84
117
  color: var(--ds-textColor-default);
85
118
  }
86
- button.primary.white:hover {
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
+ }
126
+ .ds-button.primary.white:hover {
87
127
  background-color: var(--ds-bgColor-white-hover);
88
128
  }
89
- button.primary.white:active, button.primary.white--active {
129
+ .ds-button.primary.white:active, .ds-button.primary.white--active {
90
130
  background-color: var(--ds-bgColor-white-active);
91
131
  }
92
- 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
- button.primary.white[aria-disabled=true], button.primary.white.disabled, button.primary.white:disabled {
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;
99
135
  color: var(--ds-textColor-disabled-onDark);
100
136
  }
101
- button.secondary.blue {
137
+ .ds-button.secondary.blue {
102
138
  background-color: var(--ds-bgColor-secondary);
103
139
  border-color: var(--ds-borderColor-primary);
104
140
  color: var(--ds-textColor-primary);
105
141
  }
106
- button.secondary.blue:hover {
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
+ }
149
+ .ds-button.secondary.blue:hover {
107
150
  background-color: var(--ds-bgColor-secondary-hover);
108
151
  }
109
- button.secondary.blue:active, button.secondary.blue--active {
152
+ .ds-button.secondary.blue:active, .ds-button.secondary.blue--active {
110
153
  background-color: var(--ds-bgColor-secondary-active);
111
154
  }
112
- 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
- button.secondary.blue[aria-disabled=true], button.secondary.blue.disabled, button.secondary.blue:disabled {
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);
119
158
  color: var(--ds-textColor-disabled-onLight);
120
159
  }
121
- button.secondary.black {
160
+ .ds-button.secondary.black {
122
161
  background-color: transparent;
123
162
  border-color: var(--ds-borderColor-black);
124
163
  color: var(--ds-textColor-default);
125
164
  }
126
- button.secondary.black:hover {
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
+ }
172
+ .ds-button.secondary.black:hover {
127
173
  background-color: var(--ds-bgColor-transparent-onLight-hover);
128
174
  }
129
- button.secondary.black:active, button.secondary.black--active {
175
+ .ds-button.secondary.black:active, .ds-button.secondary.black--active {
130
176
  background-color: var(--ds-bgColor-transparent-onLight-active);
131
177
  }
132
- 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
- button.secondary.black[aria-disabled=true], button.secondary.black.disabled, button.secondary.black:disabled {
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);
139
181
  color: var(--ds-textColor-disabled-onLight);
140
182
  }
141
- button.secondary.white {
183
+ .ds-button.secondary.white {
142
184
  background-color: transparent;
143
185
  border-color: var(--ds-borderColor-white);
144
186
  color: var(--ds-textColor-white);
145
187
  }
146
- button.secondary.white:hover {
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
+ }
195
+ .ds-button.secondary.white:hover {
147
196
  background-color: var(--ds-bgColor-transparent-onDark-hover);
148
197
  }
149
- button.secondary.white:active, button.secondary.white--active {
198
+ .ds-button.secondary.white:active, .ds-button.secondary.white--active {
150
199
  background-color: var(--ds-bgColor-transparent-onDark-active);
151
200
  }
152
- 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
- button.secondary.white[aria-disabled=true], button.secondary.white.disabled, button.secondary.white:disabled {
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);
159
204
  color: var(--ds-textColor-disabled-onDark);
160
205
  }
161
- button.supplementary.blue {
206
+ .ds-button.supplementary.blue {
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;
167
210
  }
168
- button.supplementary.blue:hover {
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);
217
+ }
218
+ .ds-button.supplementary.blue:hover {
169
219
  background-color: var(--ds-bgColor-secondary-hover);
170
220
  }
171
- button.supplementary.blue:active, button.supplementary.blue--active {
221
+ .ds-button.supplementary.blue:active, .ds-button.supplementary.blue--active {
172
222
  background-color: var(--ds-bgColor-secondary-active);
173
223
  }
174
- 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);
177
227
  }
178
- button.supplementary.blue[aria-disabled=true], button.supplementary.blue.disabled, button.supplementary.blue:disabled {
228
+ .ds-button.supplementary.blue.small {
229
+ padding-right: var(--ds-borderWidth-thin);
230
+ padding-left: var(--ds-borderWidth-thin);
231
+ }
232
+ .ds-button.supplementary.blue[aria-disabled=true], .ds-button.supplementary.blue.disabled, .ds-button.supplementary.blue:disabled {
179
233
  background-color: transparent;
180
234
  border-color: transparent;
181
235
  color: var(--ds-textColor-disabled-onLight);
182
236
  }
183
- button.supplementary.black {
237
+ .ds-button.supplementary.black {
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;
189
241
  }
190
- button.supplementary.black:hover {
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);
248
+ }
249
+ .ds-button.supplementary.black:hover {
191
250
  background-color: var(--ds-bgColor-transparent-onLight-hover);
192
251
  }
193
- button.supplementary.black:active, button.supplementary.black--active {
252
+ .ds-button.supplementary.black:active, .ds-button.supplementary.black--active {
194
253
  background-color: var(--ds-bgColor-transparent-onLight-active);
195
254
  }
196
- 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
- button.supplementary.black[aria-disabled=true], button.supplementary.black.disabled, button.supplementary.black:disabled {
263
+ .ds-button.supplementary.black[aria-disabled=true], .ds-button.supplementary.black.disabled, .ds-button.supplementary.black:disabled {
201
264
  background-color: transparent;
202
265
  border-color: transparent;
203
266
  color: var(--ds-textColor-disabled-onLight);
204
267
  }
205
- button.supplementary.white {
268
+ .ds-button.supplementary.white {
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;
211
272
  }
212
- button.supplementary.white:hover {
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);
279
+ }
280
+ .ds-button.supplementary.white:hover {
213
281
  background-color: var(--ds-bgColor-transparent-onDark-hover);
214
282
  }
215
- button.supplementary.white:active, button.supplementary.white--active {
283
+ .ds-button.supplementary.white:active, .ds-button.supplementary.white--active {
216
284
  background-color: var(--ds-bgColor-transparent-onDark-active);
217
285
  }
218
- 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);
221
289
  }
222
- button.supplementary.white[aria-disabled=true], button.supplementary.white.disabled, button.supplementary.white:disabled {
290
+ .ds-button.supplementary.white.small {
291
+ padding-right: var(--ds-borderWidth-thin);
292
+ padding-left: var(--ds-borderWidth-thin);
293
+ }
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
- 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
- button.small.icon-only {
234
- width: 32px;
235
- }
236
- 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 = {
@@ -57,14 +58,14 @@ export class DsButton {
57
58
  }
58
59
  };
59
60
  render() {
60
- const classes = classNames(`${this.variant} ${this.colour} ${this.size}`, {
61
+ const classes = classNames(`ds-button ${this.variant} ${this.colour} ${this.size}`, {
61
62
  'icon-start': this.icon && this.iconPosition === 'start' && this.value,
62
63
  'icon-end': this.icon && this.iconPosition === 'end' && this.value,
63
64
  'icon-only': this.icon && !this.value,
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: '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 }, h("slot", { key: '6b87d0e8e45f28f5a3dfb54cbb69d6c7acc3ef15', name: "prefix" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '32dd7550a1b1203e7a6b24dd0e7ef4516ee6ed45', name: this.icon, size: iconSize })), this.value && h("span", { key: 'ba87d4898f376ff0b1d4fa43258c36fb034ee88c', class: "button-value" }, this.value), h("slot", { key: 'ba2a58d944a9e11aaade04d25dad9c544a5966ea', name: "suffix" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: 'e30f0970737c93c2153e9ae68c87c47c3c4a2329', 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
+ };
@@ -56,13 +56,10 @@ Small.args = {
56
56
  value: 'Small',
57
57
  size: 'small',
58
58
  };
59
- export const Disabled = {
60
- render: () => html `
61
- <div class="button-group">
62
- <ds-button disabled value="disabled"></ds-button>
63
- <ds-button aria-disabled="true" value="aria-disabled"></ds-button>
64
- </div>
65
- `,
59
+ export const Disabled = {};
60
+ Disabled.args = {
61
+ value: 'Disabled',
62
+ disabled: true,
66
63
  };
67
64
  export const IconStart = {};
68
65
  IconStart.args = {
@@ -75,3 +72,12 @@ IconEnd.args = {
75
72
  icon: 'arrow_forward',
76
73
  iconPosition: 'end',
77
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
+ };
@@ -1,3 +1,7 @@
1
1
  :host {
2
- display: inline;
2
+ display: flex;
3
3
  }
4
+
5
+ .ds-icon--container {
6
+ display: flex;
7
+ }
@@ -1,10 +1,11 @@
1
1
  import { Fragment, h } from "@stencil/core";
2
2
  import { icons } from "../../../components/00-foundations/icons/iconList";
3
+ import { remToPx } from "../../../utils/utils";
3
4
  export class DsIcon {
4
5
  name;
5
6
  colour;
6
7
  size = '1.5rem';
7
- title = 'Icon';
8
+ dsTitle = 'Icon';
8
9
  role = 'img';
9
10
  hidden = true;
10
11
  message = '';
@@ -33,7 +34,9 @@ export class DsIcon {
33
34
  const size = this.size || '1.5rem';
34
35
  const colour = this.getIconColour() || 'currentColor';
35
36
  const role = this.role || 'img';
36
- const title = this.title || '';
37
+ const title = this.dsTitle || '';
38
+ svgElement.setAttribute('width', remToPx(size));
39
+ svgElement.setAttribute('height', remToPx(size));
37
40
  svgElement.setAttribute('style', `fill: ${colour}; width: ${size}; height: ${size};`);
38
41
  svgElement.setAttribute('role', role);
39
42
  const titleText = title || 'Icon';
@@ -45,13 +48,13 @@ export class DsIcon {
45
48
  }
46
49
  }
47
50
  render() {
48
- return (h(Fragment, { key: '8d8a1304c6293c49ecc830ec02227dff9852b8c5' }, h("span", { key: '83f992b6b58f24398fa84e0fe62a62e60ea72e1b', class: "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' })));
49
52
  }
50
53
  static get is() { return "ds-icon"; }
51
54
  static get encapsulation() { return "shadow"; }
52
55
  static get originalStyleUrls() {
53
56
  return {
54
- "$": ["ds-icon.css"]
57
+ "$": ["ds-icon.scss"]
55
58
  };
56
59
  }
57
60
  static get styleUrls() {
@@ -119,7 +122,7 @@ export class DsIcon {
119
122
  "reflect": false,
120
123
  "defaultValue": "'1.5rem'"
121
124
  },
122
- "title": {
125
+ "dsTitle": {
123
126
  "type": "string",
124
127
  "mutable": false,
125
128
  "complexType": {
@@ -25,7 +25,7 @@ const meta = {
25
25
  },
26
26
  name: 'Size',
27
27
  },
28
- title: {
28
+ dsTitle: {
29
29
  control: {
30
30
  type: 'text',
31
31
  },
@@ -50,6 +50,6 @@ export const Default = {};
50
50
  Default.args = {
51
51
  name: 'archive',
52
52
  role: 'img',
53
- title: 'Icon',
53
+ dsTitle: 'Icon',
54
54
  hidden: true,
55
55
  };