@bonniernews/dn-design-system-web 0.1.0-alpha.2 → 0.1.0-alpha.22
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 +187 -0
- package/components/button/README.md +12 -8
- package/components/button/button.njk +6 -3
- package/components/button/button.scss +180 -89
- package/components/divider/README.md +11 -0
- package/components/divider/divider.njk +21 -0
- package/components/divider/divider.scss +22 -0
- package/components/hyperlink/README.md +15 -0
- package/components/hyperlink/hyperlink.njk +12 -4
- package/components/hyperlink/hyperlink.scss +1 -9
- package/components/icon-button/README.md +7 -3
- package/components/icon-button/icon-button.njk +13 -4
- package/components/icon-button/icon-button.scss +80 -55
- package/components/text-button/README.md +21 -0
- package/components/text-button/text-button.njk +43 -0
- package/components/text-button/text-button.scss +127 -0
- package/foundations/a11y/a11y.scss +8 -0
- package/foundations/a11y/visually-hidden.njk +3 -0
- package/foundations/base.scss +2 -0
- package/foundations/colors.scss +6 -6
- package/foundations/helpers/mediaQueries.scss +62 -0
- package/foundations/helpers/metrics.scss +42 -0
- package/foundations/helpers/spacing.scss +21 -25
- package/foundations/helpers/typography.scss +134 -0
- package/foundations/icons/icon-sprite.svg +1 -1
- package/foundations/icons/icon.njk +171 -16
- package/foundations/icons/svg/add.svg +8 -0
- package/foundations/icons/svg/arrow_back.svg +3 -3
- package/foundations/icons/svg/arrow_forward.svg +3 -3
- package/foundations/icons/svg/bookmark-filled.svg +8 -0
- package/foundations/icons/svg/bookmarked.svg +8 -0
- package/foundations/icons/svg/celebration.svg +8 -0
- package/foundations/icons/svg/check.svg +3 -3
- package/foundations/icons/svg/check_box-filled.svg +8 -0
- package/foundations/icons/svg/check_box_outline_blank.svg +8 -0
- package/foundations/icons/svg/chevron_left.svg +8 -0
- package/foundations/icons/svg/chevron_right.svg +8 -0
- package/foundations/icons/svg/comment.svg +8 -0
- package/foundations/icons/svg/delete.svg +3 -3
- package/foundations/icons/svg/expand_less.svg +8 -0
- package/foundations/icons/svg/expand_more.svg +8 -0
- package/foundations/icons/svg/favorite-filled.svg +2 -2
- package/foundations/icons/svg/favorite.svg +3 -3
- package/foundations/icons/svg/format_size.svg +8 -0
- package/foundations/icons/svg/grid_view.svg +8 -0
- package/foundations/icons/svg/headphones-filled.svg +3 -3
- package/foundations/icons/svg/headphones.svg +3 -3
- package/foundations/icons/svg/history.svg +8 -0
- package/foundations/icons/svg/home-filled.svg +3 -3
- package/foundations/icons/svg/home.svg +3 -3
- package/foundations/icons/svg/info-filled.svg +8 -0
- package/foundations/icons/svg/integrity.svg +8 -0
- package/foundations/icons/svg/ios_share.svg +8 -0
- package/foundations/icons/svg/lock.svg +8 -0
- package/foundations/icons/svg/manage_accounts-filled.svg +3 -3
- package/foundations/icons/svg/manage_accounts.svg +3 -3
- package/foundations/icons/svg/mark_email_unread.svg +8 -0
- package/foundations/icons/svg/memory.svg +8 -0
- package/foundations/icons/svg/menu-filled.svg +8 -0
- package/foundations/icons/svg/menu.svg +3 -3
- package/foundations/icons/svg/more_horiz.svg +8 -0
- package/foundations/icons/svg/notifications.svg +3 -3
- package/foundations/icons/svg/person.svg +8 -0
- package/foundations/icons/svg/radio_button_checked.svg +8 -0
- package/foundations/icons/svg/radio_button_unchecked.svg +8 -0
- package/foundations/icons/svg/search.svg +8 -0
- package/foundations/icons/svg/share.svg +8 -0
- package/foundations/icons/svg/user_policy.svg +8 -0
- package/foundations/icons/svg/view_list.svg +8 -0
- package/foundations/icons/svg/visibility.svg +3 -3
- package/foundations/icons/svg/visibility_off.svg +3 -3
- package/foundations/icons/svg/volume_off.svg +8 -0
- package/foundations/icons/svg/volume_up.svg +8 -0
- package/foundations/typography/README.md +80 -0
- package/foundations/typography/typography.njk +19 -0
- package/foundations/typography/typography.scss +15 -0
- package/foundations/variables/colorsDnDarkTokens.scss +48 -0
- package/foundations/variables/colorsDnLightTokens.scss +43 -0
- package/foundations/variables/metrics.scss +14 -0
- package/foundations/variables/spacingComponent.scss +8 -7
- package/foundations/variables/spacingLayout.scss +8 -6
- package/foundations/variables/typographyTokensScreenLarge.scss +324 -0
- package/foundations/variables/typographyTokensScreenSmall.scss +324 -0
- package/package.json +1 -1
- package/components/button-group/README.md +0 -20
- package/components/button-group/button-group.njk +0 -27
- package/components/button-group/button-group.scss +0 -25
- package/components/text/text-sans.njk +0 -25
- package/components/text/text-sans.scss +0 -1
- package/foundations/fonts.scss +0 -82
- package/foundations/helpers/colorMap.scss +0 -15
- package/foundations/helpers/fontFamily.scss +0 -11
- package/foundations/helpers/variable.scss +0 -17
- package/foundations/typography-sans.scss +0 -43
- package/foundations/variables/colorsDnDark.scss +0 -66
- package/foundations/variables/colorsDnLight.scss +0 -66
- package/foundations/variables/typography.scss +0 -149
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,193 @@
|
|
|
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
|
+
# [0.1.0-alpha.22](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.21...@bonniernews/dn-design-system-web@0.1.0-alpha.22) (2022-10-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 0.1.0-alpha.21 (2022-10-10)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.1.0-alpha.20](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.19...@bonniernews/dn-design-system-web@0.1.0-alpha.20) (2022-10-07)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **web:** sync sass variables with tokens ([#269](https://github.com/BonnierNews/dn-design-system/issues/269)) ([b760051](https://github.com/BonnierNews/dn-design-system/commit/b760051a2a09ad299c20d193ac47cec95bbf5dab))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# 0.1.0-alpha.19 (2022-10-07)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [0.1.0-alpha.18](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.17...@bonniernews/dn-design-system-web@0.1.0-alpha.18) (2022-10-03)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* **web:** divider component for web ([#252](https://github.com/BonnierNews/dn-design-system/issues/252)) ([93f5dfb](https://github.com/BonnierNews/dn-design-system/commit/93f5dfb365da8a554b4ea21d519c614cc06081df))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# 0.1.0-alpha.17 (2022-10-03)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* **web:** text button component for web ([#254](https://github.com/BonnierNews/dn-design-system/issues/254)) ([6711a5b](https://github.com/BonnierNews/dn-design-system/commit/6711a5b6d46da68eb25db1f9af4f25fbb219011d))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# [0.1.0-alpha.16](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.15...@bonniernews/dn-design-system-web@0.1.0-alpha.16) (2022-09-30)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Bug Fixes
|
|
67
|
+
|
|
68
|
+
* **web:** use metrics and new spacing tokens ([#249](https://github.com/BonnierNews/dn-design-system/issues/249)) ([67fe9a7](https://github.com/BonnierNews/dn-design-system/commit/67fe9a715fdadeb1cf08f7fb291d35cd4818307a))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# 0.1.0-alpha.15 (2022-09-29)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# 0.1.0-alpha.14 (2022-09-27)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Features
|
|
86
|
+
|
|
87
|
+
* **web:** update web typography ([#235](https://github.com/BonnierNews/dn-design-system/issues/235)) ([83a5039](https://github.com/BonnierNews/dn-design-system/commit/83a5039955f6df69f983b52531c46be29738e39d))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# 0.1.0-alpha.13 (2022-09-09)
|
|
94
|
+
|
|
95
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# 0.1.0-alpha.12 (2022-09-08)
|
|
102
|
+
|
|
103
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# [0.1.0-alpha.11](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.10...@bonniernews/dn-design-system-web@0.1.0-alpha.11) (2022-09-07)
|
|
110
|
+
|
|
111
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# 0.1.0-alpha.10 (2022-09-07)
|
|
118
|
+
|
|
119
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# 0.1.0-alpha.9 (2022-08-24)
|
|
126
|
+
|
|
127
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# 0.1.0-alpha.8 (2022-08-22)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
* **web:** focus style only on focus-visible and use pressed design as active ([#174](https://github.com/BonnierNews/dn-design-system/issues/174)) ([503ee14](https://github.com/BonnierNews/dn-design-system/commit/503ee148593fac203ff9127e0372061ab7280df5))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# 0.1.0-alpha.7 (2022-08-19)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Features
|
|
148
|
+
|
|
149
|
+
* **app:** add input field component ([#156](https://github.com/BonnierNews/dn-design-system/issues/156)) ([be8231c](https://github.com/BonnierNews/dn-design-system/commit/be8231c4b0b9b707eda5384bfc462c5f4e787b32))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# 0.1.0-alpha.6 (2022-08-18)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# 0.1.0-alpha.5 (2022-08-15)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Features
|
|
167
|
+
|
|
168
|
+
* **web:** add option for full-width on mobile for buttons ([#162](https://github.com/BonnierNews/dn-design-system/issues/162)) ([845a187](https://github.com/BonnierNews/dn-design-system/commit/845a187132a5976a804a86b2561fbbdbf5ee81fa))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# [0.1.0-alpha.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@0.1.0-alpha.3...@bonniernews/dn-design-system-web@0.1.0-alpha.4) (2022-08-08)
|
|
175
|
+
|
|
176
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# 0.1.0-alpha.3 (2022-08-04)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
### Features
|
|
186
|
+
|
|
187
|
+
* **core:** add info icon ([#157](https://github.com/BonnierNews/dn-design-system/issues/157)) ([fa62ae1](https://github.com/BonnierNews/dn-design-system/commit/fa62ae15901bfe87d5dfcaa0db0d70e107ccd0ed))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
6
193
|
# 0.1.0-alpha.2 (2022-07-01)
|
|
7
194
|
|
|
8
195
|
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
**@bonniernews/dn-design-system-web/components/button/README.md**
|
|
2
2
|
|
|
3
3
|
----
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# Button
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Parameters available but not used in storybook:
|
|
8
8
|
|
|
9
9
|
```javascript
|
|
10
|
-
/* Additional available parameters */
|
|
11
10
|
attributes: {
|
|
12
11
|
"data-test": "12345"
|
|
13
12
|
},
|
|
14
13
|
classNames: "my-special-class",
|
|
15
|
-
href: "https://designsystem-latest.dn.se/"
|
|
16
|
-
type: "submit"
|
|
14
|
+
href: "https://designsystem-latest.dn.se/",
|
|
15
|
+
type: "submit",
|
|
16
|
+
mobile: {
|
|
17
|
+
fullWidth: true
|
|
18
|
+
}
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
ℹ️ If you add href parameter the button will be rendered as an `<a>`
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
----
|
|
24
|
+
|
|
25
|
+
# 🧐 See it in the wild:
|
|
22
26
|
- [DN Skola prenumeration](https://prenumerera.dn.se/skolor/)
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
6
6
|
{% set variant = [] %}
|
|
7
7
|
{% set text = params.text %}
|
|
8
|
-
{% set isDisabled = true if params.state and params.state == 'disabled' else false %}
|
|
9
8
|
{% set attributes %}
|
|
10
9
|
{% for attribute, value in params.attributes %}
|
|
11
10
|
{{attribute}}={{value}}
|
|
@@ -26,6 +25,10 @@
|
|
|
26
25
|
{% set variant = (variant.push(classNamePrefix + "full-width"), variant) %}
|
|
27
26
|
{% endif %}
|
|
28
27
|
|
|
28
|
+
{% if params.mobile and params.mobile.fullWidth %}
|
|
29
|
+
{% set variant = (variant.push(classNamePrefix + "mobile-full-width"), variant) %}
|
|
30
|
+
{% endif %}
|
|
31
|
+
|
|
29
32
|
{% if params.iconName and params.iconPosition and params.iconPosition != "none" %}
|
|
30
33
|
{% set iconName = params.iconName | lower %}
|
|
31
34
|
{% set variant = (variant.push(classNamePrefix + "icon" + "-" + params.iconPosition ), variant) %}
|
|
@@ -39,8 +42,8 @@
|
|
|
39
42
|
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
40
43
|
|
|
41
44
|
{% if params.href %}
|
|
42
|
-
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}>{{ text }}{{- iconSvg | safe if iconSvg -}}</a>
|
|
45
|
+
<a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}><span class="{{ componentClassName + '__inner'}}">{{ text }}{{- iconSvg | safe if iconSvg -}}</span></a>
|
|
43
46
|
{% else %}
|
|
44
|
-
<button type="{{ type | default('button') }}" class="{{ classes }}" {{ "disabled" if
|
|
47
|
+
<button type="{{ params.type | default('button') }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{ attributes }}><span class="{{ componentClassName + '__inner'}}">{{ text }}{{- iconSvg | safe if iconSvg -}}</span></button>
|
|
45
48
|
{% endif %}
|
|
46
49
|
{% endmacro %}
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
@use "../../foundations/helpers/spacing.scss" as *;
|
|
2
|
-
@use "../../foundations/helpers/
|
|
3
|
-
@use "../../foundations/helpers/
|
|
4
|
-
@use "../../foundations/
|
|
2
|
+
@use "../../foundations/helpers/typography.scss" as *;
|
|
3
|
+
@use "../../foundations/helpers/mediaQueries.scss" as *;
|
|
4
|
+
@use "../../foundations/helpers/metrics.scss" as *;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
$ds-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
$ds-btn-outlined__border-width: ds-metrics-border-width(x1);
|
|
7
|
+
$ds-btn__clickable-area: 48px;
|
|
8
|
+
|
|
9
|
+
@mixin ds-btn-disabled() {
|
|
10
|
+
background-color: var(--ds-surface-secondary-soft);
|
|
11
|
+
color: var(--ds-text-primary-soft);
|
|
12
|
+
&::before {
|
|
13
|
+
background-color: unset;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
10
16
|
|
|
11
17
|
.ds-btn {
|
|
12
|
-
@include ds-font-sans();
|
|
13
18
|
cursor: pointer;
|
|
14
|
-
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
line-height: 24px;
|
|
17
|
-
letter-spacing: .4px;
|
|
19
|
+
background-color: transparent;
|
|
18
20
|
border: 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
min-width: $ds-btn__clickable-area;
|
|
22
|
+
min-height: $ds-btn__clickable-area;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
padding: 0;
|
|
23
27
|
|
|
24
|
-
&:focus {
|
|
25
|
-
outline-offset: 2px;
|
|
26
|
-
}
|
|
27
|
-
&:disabled {
|
|
28
|
+
&:focus-visible {
|
|
28
29
|
outline: none;
|
|
30
|
+
.ds-btn__inner {
|
|
31
|
+
outline: ds-metrics-border-width(x2) solid;
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&:disabled .ds-btn__inner {
|
|
36
|
+
@include ds-btn-disabled;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
@at-root a#{&} {
|
|
@@ -34,124 +42,207 @@ $ds-btn__outline-width: 2px;
|
|
|
34
42
|
text-decoration: none;
|
|
35
43
|
}
|
|
36
44
|
|
|
45
|
+
.ds-btn__inner {
|
|
46
|
+
@include ds-typography('detailstandard-button');
|
|
47
|
+
border-radius: ds-metrics-border-radius(x1);
|
|
48
|
+
padding: ds-spacing-component(x3 x6);
|
|
49
|
+
position: relative;
|
|
50
|
+
&::before {
|
|
51
|
+
content: "";
|
|
52
|
+
border-radius: inherit;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 0;
|
|
56
|
+
left: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
37
62
|
&--full-width {
|
|
38
|
-
|
|
63
|
+
&,
|
|
64
|
+
& .ds-btn__inner {
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
39
67
|
}
|
|
40
|
-
&--small {
|
|
41
|
-
padding: ds-spacing(
|
|
68
|
+
&--small .ds-btn__inner {
|
|
69
|
+
padding: ds-spacing-component(x2 x5);
|
|
42
70
|
}
|
|
43
|
-
&--outlined,
|
|
71
|
+
&--secondary-outlined,
|
|
44
72
|
&--destructive {
|
|
45
|
-
|
|
73
|
+
.ds-btn__inner {
|
|
74
|
+
padding: ds-spacing-component(x3)-$ds-btn-outlined__border-width ds-spacing-component(x6)-$ds-btn-outlined__border-width;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.ds-btn--small .ds-btn__inner {
|
|
78
|
+
padding: ds-spacing-component(x2)-$ds-btn-outlined__border-width ds-spacing-component(x5)-$ds-btn-outlined__border-width;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
46
82
|
|
|
47
|
-
|
|
48
|
-
|
|
83
|
+
@include ds-mq-only-breakpoint(mobile) {
|
|
84
|
+
.ds-btn--mobile-full-width {
|
|
85
|
+
&,
|
|
86
|
+
& .ds-btn__inner {
|
|
87
|
+
width: 100%;
|
|
49
88
|
}
|
|
50
89
|
}
|
|
51
90
|
}
|
|
52
91
|
|
|
53
|
-
.ds-btn--icon-left,
|
|
54
|
-
.ds-btn--icon-right {
|
|
92
|
+
.ds-btn--icon-left .ds-btn__inner,
|
|
93
|
+
.ds-btn--icon-right .ds-btn__inner {
|
|
55
94
|
display: inline-flex;
|
|
56
95
|
align-items: center;
|
|
57
96
|
justify-content: center;
|
|
58
97
|
.ds-icon {
|
|
59
98
|
display: flex;
|
|
60
99
|
height: 24px;
|
|
61
|
-
margin: ds-spacing(0 0 0
|
|
100
|
+
margin: ds-spacing-component(0 0 0 x2);
|
|
62
101
|
svg {
|
|
63
102
|
fill: currentColor;
|
|
64
103
|
}
|
|
65
104
|
}
|
|
66
105
|
}
|
|
67
106
|
|
|
68
|
-
.ds-btn--icon-left {
|
|
107
|
+
.ds-btn--icon-left .ds-btn__inner {
|
|
69
108
|
flex-direction: row-reverse;
|
|
70
109
|
.ds-icon {
|
|
71
|
-
margin: ds-spacing(0
|
|
110
|
+
margin: ds-spacing-component(0 x2 0 0);
|
|
72
111
|
}
|
|
73
112
|
}
|
|
74
113
|
|
|
75
114
|
.ds-btn--brand {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
115
|
+
.ds-btn__inner {
|
|
116
|
+
background-color: var(--ds-surface-brand-strong);
|
|
117
|
+
color: var(--ds-text-on-brand);
|
|
118
|
+
&::before {
|
|
119
|
+
background-color: var(--ds-interaction-primary-none);
|
|
120
|
+
}
|
|
80
121
|
}
|
|
81
|
-
&:
|
|
82
|
-
|
|
122
|
+
&:hover .ds-btn__inner::before {
|
|
123
|
+
background-color: var(--ds-interaction-primary-soft);
|
|
83
124
|
}
|
|
84
|
-
&:
|
|
85
|
-
background-color: var(--ds-
|
|
86
|
-
|
|
87
|
-
|
|
125
|
+
&:active .ds-btn__inner::before {
|
|
126
|
+
background-color: var(--ds-interaction-primary-strong);
|
|
127
|
+
}
|
|
128
|
+
&:focus-visible .ds-btn__inner {
|
|
129
|
+
outline-color: var(--ds-border-brand-strong);
|
|
130
|
+
}
|
|
131
|
+
&:disabled .ds-btn__inner {
|
|
132
|
+
@include ds-btn-disabled;
|
|
88
133
|
}
|
|
89
134
|
}
|
|
90
135
|
|
|
91
136
|
.ds-btn--business {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
137
|
+
.ds-btn__inner {
|
|
138
|
+
background-color: var(--ds-surface-business-strong);
|
|
139
|
+
color: var(--ds-text-on-business);
|
|
140
|
+
&::before {
|
|
141
|
+
background-color: var(--ds-interaction-primary-none);
|
|
142
|
+
}
|
|
96
143
|
}
|
|
97
|
-
&:
|
|
98
|
-
|
|
144
|
+
&:hover .ds-btn__inner::before {
|
|
145
|
+
background-color: var(--ds-interaction-primary-soft);
|
|
99
146
|
}
|
|
100
|
-
&:
|
|
101
|
-
background-color: var(--ds-
|
|
102
|
-
|
|
103
|
-
|
|
147
|
+
&:active .ds-btn__inner::before {
|
|
148
|
+
background-color: var(--ds-interaction-primary-strong);
|
|
149
|
+
}
|
|
150
|
+
&:focus-visible .ds-btn__inner {
|
|
151
|
+
outline-color: var(--ds-border-business-strong);
|
|
152
|
+
}
|
|
153
|
+
&:disabled .ds-btn__inner {
|
|
154
|
+
@include ds-btn-disabled;
|
|
104
155
|
}
|
|
105
156
|
}
|
|
106
157
|
|
|
107
158
|
.ds-btn--primary {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
159
|
+
.ds-btn__inner {
|
|
160
|
+
background-color: var(--ds-surface-primary-strong);
|
|
161
|
+
color: var(--ds-text-on-primary);
|
|
162
|
+
&::before {
|
|
163
|
+
background-color: var(--ds-interaction-secondary-none);
|
|
164
|
+
}
|
|
112
165
|
}
|
|
113
|
-
&:
|
|
114
|
-
|
|
166
|
+
&:hover .ds-btn__inner::before {
|
|
167
|
+
background-color: var(--ds-interaction-secondary-soft);
|
|
115
168
|
}
|
|
116
|
-
&:
|
|
117
|
-
background-color: var(--ds-
|
|
118
|
-
|
|
119
|
-
|
|
169
|
+
&:active .ds-btn__inner::before {
|
|
170
|
+
background-color: var(--ds-interaction-secondary-strong);
|
|
171
|
+
}
|
|
172
|
+
&:focus-visible .ds-btn__inner {
|
|
173
|
+
outline-color: var(--ds-border-primary-strong);
|
|
174
|
+
}
|
|
175
|
+
&:disabled .ds-btn__inner {
|
|
176
|
+
@include ds-btn-disabled;
|
|
120
177
|
}
|
|
121
178
|
}
|
|
122
179
|
|
|
123
|
-
.ds-btn--
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
180
|
+
.ds-btn--secondaryOutlined {
|
|
181
|
+
.ds-btn__inner {
|
|
182
|
+
background-color: var(--ds-surface-secondary-strong);
|
|
183
|
+
border: $ds-btn-outlined__border-width solid var(--ds-border-primary-strong);
|
|
184
|
+
color: var(--ds-text-primary-strong);
|
|
185
|
+
&::before {
|
|
186
|
+
background-color: var(--ds-interaction-primary-none);
|
|
187
|
+
}
|
|
129
188
|
}
|
|
130
|
-
&:
|
|
131
|
-
|
|
189
|
+
&:hover .ds-btn__inner::before {
|
|
190
|
+
background-color: var(--ds-interaction-primary-soft);
|
|
132
191
|
}
|
|
133
|
-
&:
|
|
134
|
-
background-color: var(--ds-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
outline:
|
|
192
|
+
&:active .ds-btn__inner::before {
|
|
193
|
+
background-color: var(--ds-interaction-primary-strong);
|
|
194
|
+
}
|
|
195
|
+
&:focus-visible .ds-btn__inner {
|
|
196
|
+
outline-color: var(--ds-border-primary-strong);
|
|
197
|
+
}
|
|
198
|
+
&:disabled .ds-btn__inner {
|
|
199
|
+
@include ds-btn-disabled;
|
|
200
|
+
border-color: var(--ds-surface-secondary-soft);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ds-btn--secondaryFilled {
|
|
205
|
+
.ds-btn__inner {
|
|
206
|
+
background-color: var(--ds-surface-secondary-soft);
|
|
207
|
+
color: var(--ds-text-primary-strong);
|
|
208
|
+
&::before {
|
|
209
|
+
background-color: var(--ds-interaction-secondary-none);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
&:hover .ds-btn__inner::before {
|
|
213
|
+
background-color: var(--ds-interaction-primary-soft);
|
|
214
|
+
}
|
|
215
|
+
&:active .ds-btn__inner::before {
|
|
216
|
+
background-color: var(--ds-interaction-primary-strong);
|
|
217
|
+
}
|
|
218
|
+
&:focus-visible .ds-btn__inner {
|
|
219
|
+
outline-color: var(--ds-border-primary-strong);
|
|
220
|
+
}
|
|
221
|
+
&:disabled .ds-btn__inner {
|
|
222
|
+
@include ds-btn-disabled;
|
|
138
223
|
}
|
|
139
224
|
}
|
|
140
225
|
|
|
141
226
|
.ds-btn--destructive {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
color: var(--ds-
|
|
155
|
-
|
|
227
|
+
.ds-btn__inner {
|
|
228
|
+
background-color: var(--ds-surface-secondary-strong);
|
|
229
|
+
border: $ds-btn-outlined__border-width solid var(--ds-border-critical-strong);
|
|
230
|
+
color: var(--ds-text-critical-strong);
|
|
231
|
+
}
|
|
232
|
+
&::before {
|
|
233
|
+
background-color: var(--ds-interaction-primary-none);
|
|
234
|
+
}
|
|
235
|
+
&:hover .ds-btn__inner::before {
|
|
236
|
+
background-color: var(--ds-interaction-primary-soft);
|
|
237
|
+
}
|
|
238
|
+
&:active .ds-btn__inner::before {
|
|
239
|
+
background-color: var(--ds-interaction-primary-strong);
|
|
240
|
+
}
|
|
241
|
+
&:focus-visible .ds-btn__inner {
|
|
242
|
+
outline-color: var(--ds-border-critical-strong);
|
|
243
|
+
}
|
|
244
|
+
&:disabled .ds-btn__inner {
|
|
245
|
+
@include ds-btn-disabled;
|
|
246
|
+
border-color: var(--ds-surface-secondary-soft);
|
|
156
247
|
}
|
|
157
248
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% macro Divider(params) %}
|
|
2
|
+
{% set componentClassName = "ds-divider" %}
|
|
3
|
+
{% set classNamePrefix = componentClassName + "--" %}
|
|
4
|
+
{% set variant = [] %}
|
|
5
|
+
|
|
6
|
+
{% if params.variant %}
|
|
7
|
+
{% set variant = (variant.push(classNamePrefix + params.variant), variant) %}
|
|
8
|
+
{% else %}
|
|
9
|
+
{% set variant = (variant.push(classNamePrefix + "soft"), variant) %}
|
|
10
|
+
{% endif %}
|
|
11
|
+
|
|
12
|
+
{% if params.classNames %}
|
|
13
|
+
{% set variant = (variant.push(params.classNames), variant) %}
|
|
14
|
+
{% endif%}
|
|
15
|
+
|
|
16
|
+
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
17
|
+
|
|
18
|
+
<div class="{{ classes }}">
|
|
19
|
+
<span class="{{ componentClassName + '__inner'}}"></span>
|
|
20
|
+
</div>
|
|
21
|
+
{% endmacro %}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@use "../../foundations/helpers/spacing.scss" as *;
|
|
2
|
+
@use "../../foundations/helpers/metrics.scss" as *;
|
|
3
|
+
|
|
4
|
+
.ds-divider {
|
|
5
|
+
margin: ds-spacing-layout(x2 0);
|
|
6
|
+
width: 100%;
|
|
7
|
+
.ds-divider__inner {
|
|
8
|
+
background-color: currentColor;
|
|
9
|
+
display: block;
|
|
10
|
+
height: ds-metrics-border-width(x1);
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
&--soft {
|
|
14
|
+
color: var(--ds-border-primary-soft);
|
|
15
|
+
}
|
|
16
|
+
&--medium {
|
|
17
|
+
color: var(--ds-border-primary-medium);
|
|
18
|
+
}
|
|
19
|
+
&--strong {
|
|
20
|
+
color: var(--ds-border-primary-strong);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
**@bonniernews/dn-design-system-web/components/hyperlink/README.md**
|
|
2
|
+
|
|
3
|
+
----
|
|
4
|
+
|
|
5
|
+
# Hyperlink
|
|
6
|
+
|
|
7
|
+
Parameters available but not used in storybook:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
attributes: {
|
|
11
|
+
"data-test": "12345"
|
|
12
|
+
},
|
|
13
|
+
classNames: "my-special-class",
|
|
14
|
+
href: "https://designsystem-latest.dn.se/"
|
|
15
|
+
```
|