@bonniernews/dn-design-system-web 4.1.0-alpha.4 → 4.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.1.0 (2023-09-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **web:** fix missing spacing and refactor text-button ([#976](https://github.com/BonnierNews/dn-design-system/issues/976)) ([f634b42](https://github.com/BonnierNews/dn-design-system/commit/f634b4235d2c6a939cf8ae9e47fcac242fe9f221))
12
+
13
+
14
+
15
+ ## [4.1.0-alpha.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@4.1.0-alpha.4...@bonniernews/dn-design-system-web@4.1.0-alpha.5) (2023-09-04)
16
+
17
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
18
+
19
+
20
+
21
+
22
+
6
23
  ## 4.1.0-alpha.4 (2023-09-04)
7
24
 
8
25
 
@@ -4,19 +4,52 @@
4
4
 
5
5
  $ds-text-btn__min-clickable-area: 0;
6
6
  $ds-text-btn__underline-offset: 2px;
7
- $ds-text-btn__icon-size: 24px;
8
- $ds-text-btn__icon-size-small: 20px;
9
7
 
10
- @mixin ds-text-btn-disabled() {
11
- cursor: not-allowed;
12
- &::before {
13
- background-color: unset;
8
+ .ds-text-btn {
9
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x3)};
10
+ --ds-text-btn__icon-size: #{ds-px-to-rem(24px)};
11
+
12
+ &.ds-force-px {
13
+ --ds-text-btn__icon-size: 24px;
14
14
  }
15
- .ds-icon {
16
- color: $ds-color-icon-disabled;
15
+
16
+ &.ds-text-btn--icon-left {
17
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x3 $ds-sc-x3 $ds-sc-x3 $ds-sc-x2)};
18
+ --ds-text-btn__icon-margin: #{ds-spacing-component(0 $ds-sc-x2 0 0)};
17
19
  }
18
- .ds-text-btn__text {
19
- color: $ds-color-text-disabled;
20
+
21
+ &.ds-text-btn--icon-right {
22
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x3 $ds-sc-x2 $ds-sc-x3 $ds-sc-x3)};
23
+ --ds-text-btn__icon-margin: #{ds-spacing-component(0 0 0 $ds-sc-x2)};
24
+ }
25
+
26
+ &.ds-text-btn--small {
27
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x2)};
28
+ --ds-text-btn__icon-size: #{ds-px-to-rem(20px)};
29
+
30
+ &.ds-force-px {
31
+ --ds-text-btn__icon-size: 20px;
32
+ }
33
+
34
+ &.ds-text-btn--icon-left {
35
+ --ds-text-btn__icon-margin: #{ds-spacing-component(0 $ds-sc-x1 0 0)};
36
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x2 $ds-sc-x2 $ds-sc-x2 $ds-sc-x1)};
37
+ &.ds-text-btn--condensed {
38
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x1 $ds-sc-x1 $ds-sc-x1 0)};
39
+ }
40
+ }
41
+
42
+ &.ds-text-btn--icon-right {
43
+ --ds-text-btn__icon-margin: #{ds-spacing-component(0 0 0 $ds-sc-x1)};
44
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x2 $ds-sc-x1 $ds-sc-x2 $ds-sc-x2)};
45
+ &.ds-text-btn--condensed {
46
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x1 0 $ds-sc-x1 $ds-sc-x1)};
47
+ }
48
+ }
49
+ }
50
+
51
+ &.ds-text-btn--condensed {
52
+ --ds-text-btn__inner-padding: #{ds-spacing-component($ds-sc-x1)};
20
53
  }
21
54
  }
22
55
 
@@ -53,7 +86,7 @@ $ds-text-btn__icon-size-small: 20px;
53
86
  .ds-text-btn__inner {
54
87
  background-color: transparent;
55
88
  border-radius: ds-metrics-border-radius(x1);
56
- padding: ds-spacing-component($ds-sc-x3);
89
+ padding: var(--ds-text-btn__inner-padding);
57
90
  position: relative;
58
91
  &::before {
59
92
  content: "";
@@ -65,16 +98,17 @@ $ds-text-btn__icon-size-small: 20px;
65
98
  bottom: 0;
66
99
  right: 0;
67
100
  }
101
+ }
68
102
 
69
- .ds-text-btn__text {
70
- @include ds-typography($ds-typography-functional-body02regular);
71
- @at-root .ds-force-px#{&} {
72
- @include ds-typography($ds-typography-functional-body02regular, true);
73
- }
74
- text-decoration: underline;
75
- text-underline-offset: $ds-text-btn__underline-offset;
76
- color: $ds-color-text-primary;
77
- }
103
+ .ds-text-btn__text {
104
+ @include ds-typography-with-force-px($ds-typography-functional-body02regular);
105
+ text-decoration: underline;
106
+ text-underline-offset: $ds-text-btn__underline-offset;
107
+ color: $ds-color-text-primary;
108
+ }
109
+
110
+ &.ds-text-btn--small .ds-text-btn__text {
111
+ @include ds-typography-with-force-px($ds-typography-functional-body01regular);
78
112
  }
79
113
 
80
114
  @include ds-hover() {
@@ -87,7 +121,16 @@ $ds-text-btn__icon-size-small: 20px;
87
121
  background-color: $ds-color-component-primary-overlay-02;
88
122
  }
89
123
  &:disabled:not(.ds-loading) .ds-text-btn__inner {
90
- @include ds-text-btn-disabled;
124
+ cursor: not-allowed;
125
+ &::before {
126
+ background-color: unset;
127
+ }
128
+ .ds-icon {
129
+ color: $ds-color-icon-disabled;
130
+ }
131
+ .ds-text-btn__text {
132
+ color: $ds-color-text-disabled;
133
+ }
91
134
  }
92
135
 
93
136
  @include ds-loading();
@@ -109,9 +152,9 @@ $ds-text-btn__icon-size-small: 20px;
109
152
 
110
153
  .ds-icon {
111
154
  display: flex;
112
- height: ds-px-to-rem($ds-text-btn__icon-size);
113
- width: ds-px-to-rem($ds-text-btn__icon-size);
114
- margin: ds-spacing-component(0 0 0 $ds-sc-x2);
155
+ height: var(--ds-text-btn__icon-size);
156
+ width: var(--ds-text-btn__icon-size);
157
+ margin: var(--ds-text-btn__icon-margin);
115
158
  color: $ds-color-icon-primary;
116
159
  svg {
117
160
  fill: currentColor;
@@ -123,76 +166,8 @@ $ds-text-btn__icon-size-small: 20px;
123
166
  }
124
167
  }
125
168
 
126
- .ds-force-px {
127
- &.ds-text-btn--icon-left .ds-text-btn__inner .ds-icon,
128
- &.ds-text-btn--icon-right .ds-text-btn__inner .ds-icon {
129
- height: $ds-text-btn__icon-size;
130
- width: $ds-text-btn__icon-size;
131
- }
132
- }
133
-
134
169
  .ds-text-btn--icon-left .ds-text-btn__inner {
135
- padding: ds-spacing-component($ds-sc-x3 $ds-sc-x3 $ds-sc-x3 $ds-sc-x2);
136
170
  flex-direction: row-reverse;
137
- .ds-icon {
138
- margin: ds-spacing-component(0 $ds-sc-x2 0 0);
139
- }
140
- }
141
-
142
- .ds-text-btn--icon-right .ds-text-btn__inner {
143
- padding: ds-spacing-component($ds-sc-x3 $ds-sc-x2 $ds-sc-x3 $ds-sc-x3);
144
- }
145
-
146
- .ds-text-btn--small {
147
- .ds-text-btn__inner {
148
- padding: ds-spacing-component($ds-sc-x2);
149
-
150
- .ds-text-btn__text {
151
- @include ds-typography($ds-typography-functional-body01regular);
152
- @at-root .ds-force-px#{&} {
153
- @include ds-typography($ds-typography-functional-body01regular, true);
154
- }
155
- }
156
- }
157
-
158
- &.ds-text-btn--icon-left .ds-text-btn__inner,
159
- &.ds-text-btn--icon-right .ds-text-btn__inner {
160
- .ds-icon {
161
- height: ds-px-to-rem($ds-text-btn__icon-size-small);
162
- width: ds-px-to-rem($ds-text-btn__icon-size-small);
163
- margin: ds-spacing-component(0 0 0 $ds-sc-x1);
164
- }
165
- }
166
-
167
- &.ds-text-btn--icon-left .ds-text-btn__inner {
168
- padding: ds-spacing-component($ds-sc-x2 $ds-sc-x2 $ds-sc-x2 $ds-sc-x1);
169
- }
170
-
171
-
172
- &.ds-text-btn--icon-right .ds-text-btn__inner {
173
- padding: ds-spacing-component($ds-sc-x2 $ds-sc-x1 $ds-sc-x2 $ds-sc-x2);
174
- }
175
- &.ds-text-btn--condensed {
176
- &.ds-text-btn--icon-left .ds-text-btn__inner {
177
- padding: ds-spacing-component($ds-sc-x1 $ds-sc-x1 $ds-sc-x1 0);
178
- }
179
-
180
- &.ds-text-btn--icon-right .ds-text-btn__inner {
181
- padding: ds-spacing-component($ds-sc-x1 0 $ds-sc-x1 $ds-sc-x1);
182
- }
183
- }
184
-
185
- &.ds-force-px {
186
- &.ds-text-btn--icon-left .ds-text-btn__inner .ds-icon,
187
- &.ds-text-btn--icon-right .ds-text-btn__inner .ds-icon {
188
- height: $ds-text-btn__icon-size-small;
189
- width: $ds-text-btn__icon-size-small;
190
- }
191
- }
192
- }
193
-
194
- .ds-text-btn--condensed .ds-text-btn__inner {
195
- padding: ds-spacing-component($ds-sc-x1);
196
171
  }
197
172
 
198
173
  @include ds-mq-only-breakpoint(mobile) {
@@ -191,3 +191,11 @@ $dsSerifWeights: (
191
191
  letter-spacing: normal;
192
192
  }
193
193
  }
194
+
195
+ @mixin ds-typography-with-force-px($token) {
196
+ @include ds-typography($token);
197
+ // If called from element without a wrapper class, ex. a it will generate incorrect selector .ds-force-pxa
198
+ @at-root .ds-force-px#{&} {
199
+ @include ds-typography($token, true);
200
+ }
201
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "4.1.0-alpha.4",
3
+ "version": "4.1.0",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
@@ -29,6 +29,7 @@
29
29
  "filter_list": "filter_list",
30
30
  "filter_none": "filter_none",
31
31
  "format_size": "format_size",
32
+ "forward_30": "forward_30",
32
33
  "grid_view": "grid_view",
33
34
  "headphones-filled": "headphones-filled",
34
35
  "headphones": "headphones",
@@ -40,6 +41,7 @@
40
41
  "instagram": "instagram",
41
42
  "integrity": "integrity",
42
43
  "ios_share": "ios_share",
44
+ "link": "link",
43
45
  "lock": "lock",
44
46
  "logout": "logout",
45
47
  "mail": "mail",
@@ -62,6 +64,8 @@
62
64
  "radio_button_checked": "radio_button_checked",
63
65
  "radio_button_unchecked": "radio_button_unchecked",
64
66
  "redeem": "redeem",
67
+ "refresh": "refresh",
68
+ "replay_30": "replay_30",
65
69
  "search_off": "search_off",
66
70
  "search": "search",
67
71
  "share": "share",