@bonniernews/dn-design-system-web 9.1.1 → 10.0.0-beta.1

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 (31) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/components/blocked-content/blocked-content.js +1 -1
  3. package/components/blocked-content/blocked-content.njk +0 -1
  4. package/components/buddy-menu/buddy-menu.scss +2 -2
  5. package/components/button/README.md +0 -1
  6. package/components/button/button.njk +6 -11
  7. package/components/button/button.scss +141 -216
  8. package/components/button-toggle/README.md +0 -1
  9. package/components/button-toggle/button-toggle.njk +5 -8
  10. package/components/button-toggle/button-toggle.scss +115 -144
  11. package/components/byline/byline.njk +1 -2
  12. package/components/factbox/factbox.njk +2 -4
  13. package/components/factbox/factbox.scss +2 -2
  14. package/components/floating-button/floating-button.njk +5 -9
  15. package/components/floating-button/floating-button.scss +46 -53
  16. package/components/group-header/group-header.scss +21 -6
  17. package/components/icon-button/icon-button.njk +6 -8
  18. package/components/icon-button/icon-button.scss +93 -111
  19. package/components/icon-button-toggle/icon-button-toggle.scss +3 -5
  20. package/components/list-item/list-item.njk +0 -1
  21. package/components/modal/modal.scss +2 -2
  22. package/components/pictogram/pictogram.njk +1 -1
  23. package/components/teaser-list-swipe/teaser-list-swipe.scss +2 -2
  24. package/components/text-button/README.md +0 -1
  25. package/components/text-button/text-button.njk +7 -12
  26. package/components/text-button/text-button.scss +45 -61
  27. package/components/text-button-toggle/README.md +0 -1
  28. package/components/text-button-toggle/text-button-toggle.njk +7 -10
  29. package/components/text-button-toggle/text-button-toggle.scss +50 -60
  30. package/foundations/helpers/metrics.scss +1 -0
  31. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,33 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [10.0.0-beta.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@9.1.1...@bonniernews/dn-design-system-web@10.0.0-beta.1) (2024-01-10)
8
+
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+
12
+ * **web:** refactor all buttons
13
+
14
+ ### Bug Fixes
15
+
16
+ * **web:** refactor all buttons ([0c59e5c](https://github.com/BonnierNews/dn-design-system/commit/0c59e5c2cc10c25784338a5c39e8a464c180fdcf))
17
+
18
+
19
+ ### Maintenance
20
+
21
+ * **web:** released version v10.0.0-beta.0 ([50a3e7e](https://github.com/BonnierNews/dn-design-system/commit/50a3e7e2cda4c8514348943ad08b0325a14f7b5f))
22
+
23
+ ## [10.0.0-beta.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@9.0.0...@bonniernews/dn-design-system-web@10.0.0-beta.0) (2024-01-04)
24
+
25
+
26
+ ### ⚠ BREAKING CHANGES
27
+
28
+ * **web:** refactor all buttons
29
+
30
+ ### Bug Fixes
31
+
32
+ * **web:** refactor all buttons ([7f89354](https://github.com/BonnierNews/dn-design-system/commit/7f893549c25b585bbd9de2f5fc95e33164b8bd75))
33
+
7
34
  ## [9.1.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@9.1.0...@bonniernews/dn-design-system-web@9.1.1) (2024-01-09)
8
35
 
9
36
 
@@ -15,7 +15,7 @@ function dsBlockedContent(params) {
15
15
  <h2 class="ds-blocked-content__title">Hoppsan, här saknas något</h2>
16
16
  <div class="ds-blocked-content__body">Innehållet ${ params.vendor ? `från ${params.vendor}` : '' } kunde inte visas på grund av dina val i cookie-inställningarna.</div>
17
17
  </div>
18
- <button type="button" class="ds-btn ds-btn--secondaryFilled ds-btn--condensed ds-btn--small ds-btn--full-width">
18
+ <button type="button" class="ds-btn ds-btn--secondaryFilled ds-btn--small ds-btn--full-width">
19
19
  <div class="ds-btn__inner">
20
20
  <span>Integritetsinställningar</span>
21
21
  <div class="ds-spinner ds-spinner--small ds-spinner--primary">
@@ -28,7 +28,6 @@
28
28
  classNames: '',
29
29
  fullWidth: true,
30
30
  forcePx: params.forcePx,
31
- condensed: true,
32
31
  attributes: params.elementAttributes
33
32
  })}}
34
33
  </div>
@@ -44,8 +44,8 @@
44
44
  }
45
45
  .ds-buddy-menu__close {
46
46
  position: absolute;
47
- right: ds-spacing($ds-s-025);
48
- top: ds-spacing($ds-s-025);
47
+ right: ds-spacing($ds-s-075);
48
+ top: ds-spacing($ds-s-075);
49
49
  }
50
50
  .ds-buddy-menu__greeting {
51
51
  @include ds-typography($ds-typography-functional-heading03bold);
@@ -16,7 +16,6 @@
16
16
  |size| String | no | default, small | default | |
17
17
  |fullWidth | bool | no | true, false | false | Button will be full width on both desktop and mobile |
18
18
  |mobile.fullWidth | bool | no | true, false | false | Ex mobile: { fullWidth: true } |
19
- |condensed | bool | no | true, false | false | Condensed reduces spacing to a bare minimum, use with care since this might make touch target area smaller than recommended size |
20
19
  |iconPosition | String | no | none, left, right | none | |
21
20
  |iconName | String | no | add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icons--all-icons |
22
21
  |loading | bool | no | true, false | false | |
@@ -12,11 +12,11 @@
12
12
  {%- set spinnerMap = { primary: "secondary", brand: "onBrand", business: "onBusiness", staticWhiteFilled: "staticBlack", staticWhiteOutlined: "staticWhite" } %}
13
13
  {%- set spinnerVariant = spinnerMap[buttonVariant] | default("primary") %}
14
14
  {%- set loadingHtml %}
15
- {{ Spinner({ size: 'small', variant: spinnerVariant, forcePx: params.forcePx }) }}
15
+ {{ Spinner({ size: 'small', variant: spinnerVariant, forcePx: params.forcePx, attributes: { "aria-hidden": "true" } }) }}
16
16
  {% endset %}
17
17
 
18
18
  {%- if params.iconName and params.iconPosition and params.iconPosition != "none" %}
19
- {% set iconSvg = IconUse({ icon: params.iconName }) %}
19
+ {% set iconSvg = IconUse({ icon: params.iconName, attributes: { "aria-hidden": "true" } }) %}
20
20
  {% endif %}
21
21
 
22
22
  {%- set classes = [
@@ -26,7 +26,6 @@
26
26
  classNamePrefix + params.size if params.size and params.size !== "default",
27
27
  classNamePrefix + "full-width" if params.fullWidth,
28
28
  classNamePrefix + "mobile-full-width" if params.mobile and params.mobile.fullWidth,
29
- classNamePrefix + "condensed" if params.condensed,
30
29
  classNamePrefix + "icon-" + params.iconPosition if iconSvg,
31
30
  "ds-loading" if params.loading,
32
31
  "ds-force-px" if params.forcePx,
@@ -35,17 +34,13 @@
35
34
 
36
35
  {%- if params.href %}
37
36
  <a href="{{ params.href | default('#', true) }}" {{ ariaLabel | safe }} class="{{ classes }}" {{- attributes | safe}}>
38
- <span class="{{ componentClassName + '__inner' }}" aria-hidden="true">
39
- <span>{{ text }}</span>
40
- {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
41
- </span>
37
+ <span aria-hidden="true">{{ text }}</span>
38
+ {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
42
39
  </a>
43
40
  {% else %}
44
41
  <button type="{{ params.type | default('button') }}" {{ ariaLabel | safe }} class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe}}>
45
- <span class="{{ componentClassName + '__inner' }}" aria-hidden="true">
46
- <span>{{ text }}</span>
47
- {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
48
- </span>
42
+ <span aria-hidden="true">{{ text }}</span>
43
+ {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
49
44
  </button>
50
45
  {% endif %}
51
46
  {% endmacro %}
@@ -4,34 +4,108 @@
4
4
  @use "../spinner/spinner.scss" as *;
5
5
 
6
6
  $ds-btn-outlined__border-width: ds-border-width(x1);
7
- $ds-btn__min-clickable-area: 48px;
8
7
  $ds-btn__icon-size: 24px;
9
8
 
10
9
  .ds-btn {
10
+ --ds-btn__background-color: transparent;
11
+ --ds-btn__background-color-hover: #{$ds-color-component-primary-overlay};
12
+ --ds-btn__background-color-active: #{$ds-color-component-primary-overlay-02};
13
+ --ds-btn__border-color: #{$ds-color-border-primary-03};
14
+ --ds-btn__outline-color: #{$ds-color-border-focus-02};
15
+ --ds-btn__color: #{$ds-color-text-primary};
16
+
17
+ &.ds-btn--primary {
18
+ --ds-btn__background-color: #{$ds-color-component-primary};
19
+ --ds-btn__background-color-hover: #{$ds-color-component-secondary-overlay};
20
+ --ds-btn__background-color-active: #{$ds-color-component-secondary-overlay-02};
21
+ --ds-btn__border-color: transparent;
22
+ --ds-btn__color: #{$ds-color-text-secondary};
23
+ }
24
+
25
+ &.ds-btn--brand {
26
+ --ds-btn__background-color: #{$ds-color-component-brand};
27
+ --ds-btn__border-color: transparent;
28
+ --ds-btn__color: #{$ds-color-text-on-brand};
29
+ --ds-btn__outline-color: #{$ds-color-border-focus};
30
+ }
31
+
32
+ &.ds-btn--business {
33
+ --ds-btn__background-color: #{$ds-color-component-business};
34
+ --ds-btn__border-color: transparent;
35
+ --ds-btn__color: #{$ds-color-text-on-business};
36
+ --ds-btn__outline-color: #{$ds-color-border-focus-04};
37
+ }
38
+
39
+ &.ds-btn--secondaryFilled {
40
+ --ds-btn__background-color: #{$ds-color-component-primary-overlay};
41
+ --ds-btn__border-color: transparent;
42
+ }
43
+
44
+ &.ds-btn--staticWhiteFilled {
45
+ --ds-btn__background-color: #{$ds-color-static-white};
46
+ --ds-btn__background-color-hover: #0808081a; // static version of lightmode component-secondary-overlay
47
+ --ds-btn__background-color-active: #08080833; // static version of lightmode component-secondary-overlay-2
48
+ --ds-btn__border-color: transparent;
49
+ --ds-btn__color: #{$ds-color-static-black};
50
+ }
51
+
52
+ &.ds-btn--staticWhiteOutlined {
53
+ // static version of darkmode component-secondary-overlay
54
+ --ds-btn__background-color-hover: rgba(255, 255, 255, 0.101960784);
55
+ // static version of darkmode component-secondary-overlay-2
56
+ --ds-btn__background-color-active: rgba(255, 255, 255, 0.2);
57
+ --ds-btn__border-color: #{$ds-color-static-white};
58
+ --ds-btn__color: #{$ds-color-static-white};
59
+ --ds-btn__outline-color: #{$ds-color-static-white};
60
+
61
+ &:not(:disabled) .ds-icon {
62
+ --ds-btn__color: #{$ds-color-static-white};
63
+ }
64
+ }
65
+
66
+ &.ds-btn--criticalOutlined {
67
+ --ds-btn__border-color: #{$ds-color-border-critical};
68
+ --ds-btn__color: #{$ds-color-text-critical};
69
+ --ds-btn__outline-color: #{$ds-color-border-focus-03};
70
+
71
+ &:not(:disabled) .ds-icon {
72
+ --ds-btn__color: #{$ds-color-icon-critical};
73
+ }
74
+ }
75
+
76
+ &.ds-btn--secondaryFilled,
77
+ &.ds-btn--secondaryOutlined,
78
+ &.ds-btn--criticalOutlined,
79
+ &.ds-btn--staticWhiteOutlined {
80
+ &:not(.ds-loading):disabled {
81
+ --ds-btn__background-color: #{$ds-color-component-primary-overlay};
82
+ --ds-btn__border-color: transparent;
83
+ --ds-btn__color: #{ds-color-text-disabled};
84
+ cursor: not-allowed;
85
+ }
86
+ }
87
+
88
+ @include ds-typography($ds-typography-detailstandard-button);
11
89
  cursor: pointer;
12
- background-color: transparent;
13
- border: none;
90
+ border: $ds-btn-outlined__border-width solid var(--ds-btn__border-color);
91
+ border-radius: ds-border-radius(x1);
92
+ padding: ds-spacing($ds-s-075, rem) - ds-px-to-rem($ds-btn-outlined__border-width) ds-spacing($ds-s-150, rem) - ds-px-to-rem(
93
+ $ds-btn-outlined__border-width
94
+ );
95
+ position: relative;
96
+ background-color: var(--ds-btn__background-color);
97
+ color: var(--ds-btn__color);
14
98
  display: inline-flex;
15
99
  align-items: center;
16
100
  justify-content: center;
17
- padding: 0;
18
- position: relative;
19
101
 
20
102
  span {
21
103
  pointer-events: none;
22
104
  }
23
105
 
24
- &:not(.ds-btn--condensed) {
25
- min-width: $ds-btn__min-clickable-area;
26
- min-height: $ds-btn__min-clickable-area;
27
- }
28
-
29
106
  &:focus-visible {
30
- outline: none;
31
- .ds-btn__inner {
32
- outline: ds-border-width(x2) solid;
33
- outline-offset: 2px;
34
- }
107
+ outline: ds-border-width(x2) solid var(--ds-btn__outline-color);
108
+ outline-offset: 2px;
35
109
  }
36
110
 
37
111
  @at-root a#{&} {
@@ -40,66 +114,61 @@ $ds-btn__icon-size: 24px;
40
114
  text-decoration: none;
41
115
  }
42
116
 
43
- .ds-btn__inner {
44
- @include ds-typography($ds-typography-detailstandard-button);
45
- border: $ds-btn-outlined__border-width solid;
46
- border-radius: ds-border-radius(x1);
47
- padding: ds-spacing($ds-s-075, rem) - ds-px-to-rem($ds-btn-outlined__border-width) ds-spacing($ds-s-150, rem) - ds-px-to-rem(
48
- $ds-btn-outlined__border-width
49
- );
117
+ &::before {
118
+ content: "";
119
+ border-radius: inherit;
120
+ pointer-events: none;
121
+ position: absolute;
122
+ top: -$ds-btn-outlined__border-width;
123
+ left: -$ds-btn-outlined__border-width;
124
+ bottom: -$ds-btn-outlined__border-width;
125
+ right: -$ds-btn-outlined__border-width;
126
+ background-color: transparent;
127
+ }
128
+
129
+ &::after {
130
+ content: "";
131
+ position: absolute;
132
+ min-width: $ds-btn__min-clickable-area;
133
+ min-height: $ds-btn__min-clickable-area;
134
+ width: 100%;
135
+ }
136
+
137
+ span,
138
+ i {
50
139
  position: relative;
51
- &::before {
52
- content: "";
53
- border-radius: inherit;
54
- pointer-events: none;
55
- position: absolute;
56
- top: -$ds-btn-outlined__border-width;
57
- left: -$ds-btn-outlined__border-width;
58
- bottom: -$ds-btn-outlined__border-width;
59
- right: -$ds-btn-outlined__border-width;
60
- }
61
- span,
62
- i {
63
- position: relative;
64
- }
65
140
  }
66
141
 
67
142
  @include ds-hover() {
68
- &:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
69
- background-color: $ds-color-component-primary-overlay;
143
+ &:hover:not(:disabled):not(.ds-loading)::before {
144
+ background: var(--ds-btn__background-color-hover);
70
145
  }
71
146
  }
72
- &:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
73
- background-color: $ds-color-component-primary-overlay-02;
147
+ &:active:not(:disabled):not(.ds-loading)::before {
148
+ background: var(--ds-btn__background-color-active);
74
149
  }
75
150
 
76
151
  @include ds-loading();
77
152
  }
78
153
 
79
154
  .ds-btn--full-width {
80
- &,
81
- & .ds-btn__inner {
82
- width: 100%;
83
- box-sizing: border-box;
84
- }
155
+ width: 100%;
156
+ box-sizing: border-box;
85
157
  }
86
158
 
87
- .ds-btn--small .ds-btn__inner {
159
+ .ds-btn--small {
88
160
  padding: ds-px-to-rem(ds-spacing($ds-s-050) - $ds-btn-outlined__border-width)
89
161
  ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
90
162
  }
91
163
 
92
164
  @include ds-mq-only-breakpoint(mobile) {
93
165
  .ds-btn--mobile-full-width {
94
- &,
95
- & .ds-btn__inner {
96
- width: 100%;
97
- }
166
+ width: 100%;
98
167
  }
99
168
  }
100
169
 
101
- .ds-btn--icon-left .ds-btn__inner,
102
- .ds-btn--icon-right .ds-btn__inner {
170
+ .ds-btn--icon-left,
171
+ .ds-btn--icon-right {
103
172
  display: inline-flex;
104
173
  align-items: center;
105
174
  justify-content: center;
@@ -115,206 +184,62 @@ $ds-btn__icon-size: 24px;
115
184
  }
116
185
 
117
186
  .ds-btn--icon-right {
118
- .ds-btn__inner {
119
- padding-right: ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
120
- }
121
- &.ds-btn--small .ds-btn__inner {
187
+ padding-right: ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
188
+ &.ds-btn--small {
122
189
  padding-right: ds-px-to-rem(ds-spacing($ds-s-100) - $ds-btn-outlined__border-width);
123
190
  }
124
191
  }
125
192
 
126
193
  .ds-btn--icon-left {
127
- .ds-btn__inner {
128
- flex-direction: row-reverse;
129
- padding-left: ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
130
- .ds-icon {
131
- margin: ds-spacing(0 $ds-s-050 0 0, rem);
132
- }
194
+ flex-direction: row-reverse;
195
+ padding-left: ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
196
+ .ds-icon {
197
+ margin: ds-spacing(0 $ds-s-050 0 0, rem);
133
198
  }
134
- &.ds-btn--small .ds-btn__inner {
199
+ &.ds-btn--small {
135
200
  padding-left: ds-px-to-rem(ds-spacing($ds-s-100) - $ds-btn-outlined__border-width);
136
201
  }
137
202
  }
138
203
 
139
- .ds-btn--brand {
140
- .ds-btn__inner {
141
- border-color: transparent;
142
- background-color: $ds-color-component-brand;
143
- color: $ds-color-text-on-brand;
144
- }
145
- &:focus-visible .ds-btn__inner {
146
- outline-color: $ds-color-border-focus;
147
- }
148
- }
149
-
150
- .ds-btn--business {
151
- .ds-btn__inner {
152
- background-color: $ds-color-component-business;
153
- border-color: transparent;
154
- color: $ds-color-text-on-business;
155
- }
156
- &:focus-visible .ds-btn__inner {
157
- outline-color: $ds-color-border-focus-04;
158
- }
159
- }
160
-
161
- .ds-btn--primary {
162
- .ds-btn__inner {
163
- border-color: transparent;
164
- background-color: $ds-color-component-primary;
165
- color: $ds-color-text-secondary;
166
- }
167
- &:focus-visible .ds-btn__inner {
168
- outline-color: $ds-color-border-focus-02;
169
- }
170
- @include ds-hover() {
171
- &:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
172
- background-color: $ds-color-component-secondary-overlay;
173
- }
174
- }
175
- &:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
176
- background-color: $ds-color-component-secondary-overlay-02;
177
- }
178
- }
179
-
180
- .ds-btn--secondaryOutlined {
181
- .ds-btn__inner {
182
- background-color: transparent;
183
- border-color: $ds-color-border-primary-03;
184
- color: $ds-color-text-primary;
185
- }
186
- &:focus-visible .ds-btn__inner {
187
- outline-color: $ds-color-border-focus-02;
188
- }
189
- }
190
-
191
- .ds-btn--secondaryFilled {
192
- .ds-btn__inner {
193
- border-color: transparent;
194
- background-color: $ds-color-component-primary-overlay;
195
- color: $ds-color-text-primary;
196
- }
197
- &:focus-visible .ds-btn__inner {
198
- outline-color: $ds-color-border-focus-02;
199
- }
200
- }
201
-
202
- .ds-btn--criticalOutlined {
203
- .ds-btn__inner {
204
- background-color: transparent;
205
- border-color: $ds-color-border-critical;
206
- color: $ds-color-text-critical;
207
- }
208
- &:not(:disabled) .ds-icon {
209
- color: $ds-color-icon-critical;
210
- }
211
- &:focus-visible .ds-btn__inner {
212
- outline-color: $ds-color-border-focus-03;
213
- }
214
- }
215
-
216
- .ds-btn--staticWhiteFilled {
217
- .ds-btn__inner {
218
- border-color: transparent;
219
- background-color: $ds-color-static-white;
220
- color: $ds-color-static-black;
221
- }
222
- &:focus-visible .ds-btn__inner {
223
- outline-color: $ds-color-border-focus-02;
224
- }
225
- @include ds-hover() {
226
- &:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
227
- background-color: #0808081a; // static version of lightmode component-secondary-overlay
228
- }
229
- }
230
- &:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
231
- background-color: #08080833; // static version of lightmode component-secondary-overlay-2
232
- }
233
- }
234
-
235
- .ds-btn--staticWhiteOutlined {
236
- .ds-btn__inner {
237
- background-color: transparent;
238
- border-color: $ds-color-static-white;
239
- color: $ds-color-static-white;
240
- }
241
- &:not(:disabled) .ds-icon {
242
- color: $ds-color-static-white;
243
- }
244
- &:focus-visible .ds-btn__inner {
245
- outline-color: $ds-color-static-white;
246
- }
247
- @include ds-hover() {
248
- &:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
249
- background-color: rgba(255, 255, 255, 0.101960784);
250
- // static version of darkmode component-secondary-overlay
251
- }
252
- }
253
- &:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
254
- background-color: rgba(255, 255, 255, 0.2);
255
- // static version of darkmode component-secondary-overlay-2
256
- }
257
- }
258
-
259
- .ds-btn--secondaryFilled,
260
- .ds-btn--secondaryOutlined,
261
- .ds-btn--criticalOutlined,
262
- .ds-btn--staticWhiteOutlined {
263
- &:not(.ds-loading):disabled .ds-btn__inner {
264
- cursor: not-allowed;
265
- background-color: $ds-color-component-primary-overlay;
266
- border-color: transparent;
267
- color: $ds-color-text-disabled;
268
- &::before {
269
- background-color: unset;
270
- }
271
- }
272
- }
273
-
274
204
  .ds-btn--brand,
275
205
  .ds-btn--business,
276
206
  .ds-btn--primary,
277
207
  .ds-btn--staticWhiteFilled {
278
208
  &:not(.ds-loading):disabled {
279
209
  opacity: $ds-opacity-component-disabled;
280
- .ds-btn__inner {
281
- cursor: not-allowed;
282
- }
210
+ cursor: not-allowed;
283
211
  }
284
212
  }
285
213
 
286
214
  .ds-btn.ds-force-px {
287
- .ds-btn__inner {
288
- /* stylelint-disable-next-line */
289
- padding: ds-spacing($ds-s-075) - $ds-btn-outlined__border-width ds-spacing($ds-s-150) -
290
- $ds-btn-outlined__border-width;
291
- @include ds-typography($ds-typography-detailstandard-button, true);
292
- }
293
- &.ds-btn--icon-left .ds-btn__inner,
294
- &.ds-btn--icon-right .ds-btn__inner {
215
+ /* stylelint-disable-next-line */
216
+ padding: ds-spacing($ds-s-075) - $ds-btn-outlined__border-width ds-spacing($ds-s-150) -
217
+ $ds-btn-outlined__border-width;
218
+ @include ds-typography($ds-typography-detailstandard-button, true);
219
+
220
+ &.ds-btn--icon-left,
221
+ &.ds-btn--icon-right {
295
222
  .ds-icon {
296
223
  margin: ds-spacing(0 0 0 $ds-s-050);
297
224
  height: $ds-btn__icon-size;
298
225
  width: $ds-btn__icon-size;
299
226
  }
300
227
  }
301
- &.ds-btn--icon-right .ds-btn__inner {
228
+ &.ds-btn--icon-right {
302
229
  padding-right: ds-spacing($ds-s-125)-$ds-btn-outlined__border-width;
303
230
  }
304
- &.ds-btn--icon-left .ds-btn__inner {
231
+ &.ds-btn--icon-left {
305
232
  padding-left: ds-spacing($ds-s-125)-$ds-btn-outlined__border-width;
306
233
  .ds-icon {
307
234
  margin: ds-spacing(0 $ds-s-050 0 0);
308
235
  }
309
236
  }
310
237
  &.ds-btn--small {
311
- .ds-btn__inner {
312
- padding: ds-spacing($ds-s-050)-$ds-btn-outlined__border-width ds-spacing($ds-s-125)-$ds-btn-outlined__border-width;
313
- }
314
- &.ds-btn--icon-right .ds-btn__inner {
238
+ padding: ds-spacing($ds-s-050)-$ds-btn-outlined__border-width ds-spacing($ds-s-125)-$ds-btn-outlined__border-width;
239
+ &.ds-btn--icon-right {
315
240
  padding-right: ds-spacing($ds-s-100)-$ds-btn-outlined__border-width;
316
241
  }
317
- &.ds-btn--icon-left .ds-btn__inner {
242
+ &.ds-btn--icon-left {
318
243
  padding-left: ds-spacing($ds-s-100)-$ds-btn-outlined__border-width;
319
244
  }
320
245
  }
@@ -17,7 +17,6 @@
17
17
  |variant | String | no | brand, SecondaryFilled | brand | Design variant |
18
18
  |size| String | no | default, small, xsmall | default | |
19
19
  |fullWidth | bool | no | true, false | false | Button will be full width on both desktop and mobile |
20
- |condensed | bool | no | true, false | false | Condensed reduces spacing to a bare minimum, use with care since this might make touch target area smaller than recommended size |
21
20
  |mobile.fullWidth | bool | no | true, false | false | Ex mobile: { fullWidth: true } |
22
21
  |loading | bool | no | true, false | false | |
23
22
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
@@ -14,7 +14,7 @@
14
14
  {%- set spinnerSize = "xsmall" if params.size == "xsmall" else "small" %}
15
15
 
16
16
  {%- set loadingHtml %}
17
- {{ Spinner({ size: spinnerSize, variant: spinnerVariant, forcePx: params.forcePx }) }}
17
+ {{ Spinner({ size: spinnerSize, variant: spinnerVariant, forcePx: params.forcePx, attributes: { "aria-hidden": "true" } }) }}
18
18
  {% endset %}
19
19
 
20
20
  {%- set classes = [
@@ -24,19 +24,16 @@
24
24
  classNamePrefix + params.size if params.size and params.size !== "default",
25
25
  classNamePrefix + "full-width" if params.fullWidth,
26
26
  classNamePrefix + "mobile-full-width" if params.mobile and params.mobile.fullWidth,
27
- classNamePrefix + "condensed" if params.condensed,
28
27
  "ds-loading" if params.loading,
29
28
  "ds-force-px" if params.forcePx,
30
29
  params.classNames if params.classNames
31
30
  ] | join(" ") %}
32
31
 
33
32
  <button type="button" role="switch" {{ ariaLabel | safe }} aria-checked="{{ "true" if params.selected else "false" }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
34
- <span class="{{ componentClassName + '__inner' }}" aria-hidden="true">
35
- <span class="{{ componentClassName + '__off' }}"><span>{{ params.text }}</span></span>
36
- <span class="{{ componentClassName + '__on' }}">
37
- {{ IconUse({ icon: "check" }) }} <span>{{ params.selectedText }}</span>
38
- </span>
39
- {{ loadingHtml | safe }}
33
+ <span class="{{ componentClassName + '__off' }}" aria-hidden="true"><span>{{ params.text }}</span></span>
34
+ <span class="{{ componentClassName + '__on' }}" aria-hidden="true">
35
+ {{ IconUse({ icon: "check" }) }} <span>{{ params.selectedText }}</span>
40
36
  </span>
37
+ {{ loadingHtml | safe }}
41
38
  </button>
42
39
  {% endmacro %}