@bonniernews/dn-design-system-web 0.1.0-alpha.2 → 0.1.0-alpha.20

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 (58) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/components/button/README.md +12 -8
  3. package/components/button/button.njk +6 -3
  4. package/components/button/button.scss +180 -89
  5. package/components/divider/README.md +11 -0
  6. package/components/divider/divider.njk +21 -0
  7. package/components/divider/divider.scss +22 -0
  8. package/components/hyperlink/README.md +15 -0
  9. package/components/hyperlink/hyperlink.njk +12 -4
  10. package/components/hyperlink/hyperlink.scss +1 -9
  11. package/components/icon-button/README.md +7 -3
  12. package/components/icon-button/icon-button.njk +13 -4
  13. package/components/icon-button/icon-button.scss +80 -55
  14. package/components/text-button/README.md +21 -0
  15. package/components/text-button/text-button.njk +43 -0
  16. package/components/text-button/text-button.scss +127 -0
  17. package/foundations/a11y/a11y.scss +8 -0
  18. package/foundations/a11y/visually-hidden.njk +3 -0
  19. package/foundations/base.scss +2 -0
  20. package/foundations/colors.scss +6 -6
  21. package/foundations/helpers/mediaQueries.scss +62 -0
  22. package/foundations/helpers/metrics.scss +42 -0
  23. package/foundations/helpers/spacing.scss +21 -25
  24. package/foundations/helpers/typography.scss +134 -0
  25. package/foundations/icons/icon-sprite.svg +1 -1
  26. package/foundations/icons/icon.njk +40 -0
  27. package/foundations/icons/svg/add.svg +8 -0
  28. package/foundations/icons/svg/celebration.svg +8 -0
  29. package/foundations/icons/svg/info-filled.svg +8 -0
  30. package/foundations/icons/svg/lock.svg +8 -0
  31. package/foundations/icons/svg/mark_email_unread.svg +8 -0
  32. package/foundations/icons/svg/menu-filled.svg +8 -0
  33. package/foundations/icons/svg/more_horiz.svg +8 -0
  34. package/foundations/icons/svg/search.svg +8 -0
  35. package/foundations/typography/README.md +80 -0
  36. package/foundations/typography/typography.njk +19 -0
  37. package/foundations/typography/typography.scss +15 -0
  38. package/foundations/variables/colorsDnDarkTokens.scss +44 -0
  39. package/foundations/variables/colorsDnLightTokens.scss +39 -0
  40. package/foundations/variables/metrics.scss +13 -0
  41. package/foundations/variables/spacingComponent.scss +8 -7
  42. package/foundations/variables/spacingLayout.scss +8 -6
  43. package/foundations/variables/typographyTokensScreenLarge.scss +324 -0
  44. package/foundations/variables/typographyTokensScreenSmall.scss +324 -0
  45. package/package.json +1 -1
  46. package/components/button-group/README.md +0 -20
  47. package/components/button-group/button-group.njk +0 -27
  48. package/components/button-group/button-group.scss +0 -25
  49. package/components/text/text-sans.njk +0 -25
  50. package/components/text/text-sans.scss +0 -1
  51. package/foundations/fonts.scss +0 -82
  52. package/foundations/helpers/colorMap.scss +0 -15
  53. package/foundations/helpers/fontFamily.scss +0 -11
  54. package/foundations/helpers/variable.scss +0 -17
  55. package/foundations/typography-sans.scss +0 -43
  56. package/foundations/variables/colorsDnDark.scss +0 -66
  57. package/foundations/variables/colorsDnLight.scss +0 -66
  58. package/foundations/variables/typography.scss +0 -149
package/CHANGELOG.md CHANGED
@@ -3,6 +3,177 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **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))
12
+
13
+
14
+
15
+
16
+
17
+ # 0.1.0-alpha.19 (2022-10-07)
18
+
19
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
20
+
21
+
22
+
23
+
24
+
25
+ # [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)
26
+
27
+
28
+ ### Features
29
+
30
+ * **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))
31
+
32
+
33
+
34
+
35
+
36
+ # 0.1.0-alpha.17 (2022-10-03)
37
+
38
+
39
+ ### Features
40
+
41
+ * **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))
42
+
43
+
44
+
45
+
46
+
47
+ # [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)
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * **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))
53
+
54
+
55
+
56
+
57
+
58
+ # 0.1.0-alpha.15 (2022-09-29)
59
+
60
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
61
+
62
+
63
+
64
+
65
+
66
+ # 0.1.0-alpha.14 (2022-09-27)
67
+
68
+
69
+ ### Features
70
+
71
+ * **web:** update web typography ([#235](https://github.com/BonnierNews/dn-design-system/issues/235)) ([83a5039](https://github.com/BonnierNews/dn-design-system/commit/83a5039955f6df69f983b52531c46be29738e39d))
72
+
73
+
74
+
75
+
76
+
77
+ # 0.1.0-alpha.13 (2022-09-09)
78
+
79
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
80
+
81
+
82
+
83
+
84
+
85
+ # 0.1.0-alpha.12 (2022-09-08)
86
+
87
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
88
+
89
+
90
+
91
+
92
+
93
+ # [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)
94
+
95
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
96
+
97
+
98
+
99
+
100
+
101
+ # 0.1.0-alpha.10 (2022-09-07)
102
+
103
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
104
+
105
+
106
+
107
+
108
+
109
+ # 0.1.0-alpha.9 (2022-08-24)
110
+
111
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
112
+
113
+
114
+
115
+
116
+
117
+ # 0.1.0-alpha.8 (2022-08-22)
118
+
119
+
120
+ ### Bug Fixes
121
+
122
+ * **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))
123
+
124
+
125
+
126
+
127
+
128
+ # 0.1.0-alpha.7 (2022-08-19)
129
+
130
+
131
+ ### Features
132
+
133
+ * **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))
134
+
135
+
136
+
137
+
138
+
139
+ # 0.1.0-alpha.6 (2022-08-18)
140
+
141
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
142
+
143
+
144
+
145
+
146
+
147
+ # 0.1.0-alpha.5 (2022-08-15)
148
+
149
+
150
+ ### Features
151
+
152
+ * **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))
153
+
154
+
155
+
156
+
157
+
158
+ # [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)
159
+
160
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
161
+
162
+
163
+
164
+
165
+
166
+ # 0.1.0-alpha.3 (2022-08-04)
167
+
168
+
169
+ ### Features
170
+
171
+ * **core:** add info icon ([#157](https://github.com/BonnierNews/dn-design-system/issues/157)) ([fa62ae1](https://github.com/BonnierNews/dn-design-system/commit/fa62ae15901bfe87d5dfcaa0db0d70e107ccd0ed))
172
+
173
+
174
+
175
+
176
+
6
177
  # 0.1.0-alpha.2 (2022-07-01)
7
178
 
8
179
  **Note:** Version bump only for package @bonniernews/dn-design-system-web
@@ -1,22 +1,26 @@
1
- ### @bonniernews/dn-design-system-web/components/button/README.md
1
+ **@bonniernews/dn-design-system-web/components/button/README.md**
2
2
 
3
3
  ----
4
4
 
5
- #### **Some sample documentation for a component**
5
+ # Button
6
6
 
7
- Here we can document **technical details** and for example list parameters not available in storybook but used in the *real world*.
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/" // if you add href parameter the button will rendered as an <a>
16
- type: "submit"
14
+ href: "https://designsystem-latest.dn.se/",
15
+ type: "submit",
16
+ mobile: {
17
+ fullWidth: true
18
+ }
17
19
  ```
18
20
 
19
- We could also link to places where the component is/will be implemented
21
+ ℹ️ If you add href parameter the button will be rendered as an `<a>`
20
22
 
21
- #### 🧐 See it in the wild:
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 isDisabled }} {{ attributes }}>{{ text }}{{- iconSvg | safe if iconSvg -}}</button>
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/variable.scss" as *;
3
- @use "../../foundations/helpers/fontFamily.scss" as *;
4
- @use "../../foundations/variables/colorsDnLight" as *;
2
+ @use "../../foundations/helpers/typography.scss" as *;
3
+ @use "../../foundations/helpers/mediaQueries.scss" as *;
4
+ @use "../../foundations/helpers/metrics.scss" as *;
5
5
 
6
- // Temporary variables we maybe should handle in a better way
7
- $ds-btn__border-radius: 2px;
8
- $ds-btn__border-width--outlined: 1px;
9
- $ds-btn__outline-width: 2px;
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
- font-weight: 500;
15
- font-size: 16px;
16
- line-height: 24px;
17
- letter-spacing: .4px;
19
+ background-color: transparent;
18
20
  border: 0;
19
- border-radius: $ds-btn__border-radius;
20
- display: inline-block;
21
- transition: background-color 50ms ease-out;
22
- padding: ds-spacing(1.5 3);
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
- width: 100%;
63
+ &,
64
+ & .ds-btn__inner {
65
+ width: 100%;
66
+ }
39
67
  }
40
- &--small {
41
- padding: ds-spacing(1 2.5);
68
+ &--small .ds-btn__inner {
69
+ padding: ds-spacing-component(x2 x5);
42
70
  }
43
- &--outlined,
71
+ &--secondary-outlined,
44
72
  &--destructive {
45
- padding: ds-spacing(1.5)-$ds-btn__border-width--outlined ds-spacing(3)-$ds-btn__border-width--outlined;
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
- &.ds-btn--small {
48
- padding: ds-spacing(1)-$ds-btn__border-width--outlined ds-spacing(2.5)-$ds-btn__border-width--outlined;
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 1);
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 1 0 0);
110
+ margin: ds-spacing-component(0 x2 0 0);
72
111
  }
73
112
  }
74
113
 
75
114
  .ds-btn--brand {
76
- background-color: var(--ds-action-brand-default);
77
- color: var(--ds-text-on-brand);
78
- &:hover {
79
- background-color: var(--ds-action-brand-hover);
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
- &:focus {
82
- outline: $ds-btn__outline-width solid var(--ds-border-brand-default);
122
+ &:hover .ds-btn__inner::before {
123
+ background-color: var(--ds-interaction-primary-soft);
83
124
  }
84
- &:disabled {
85
- background-color: var(--ds-action-brand-disabled);
86
- color: var(--ds-text-primary-disabled);
87
- outline: none;
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
- background-color: var(--ds-action-business-default);
93
- color: var(--ds-text-on-business);
94
- &:hover {
95
- background-color: var(--ds-action-business-hover);
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
- &:focus {
98
- outline: $ds-btn__outline-width solid var(--ds-border-business-default);
144
+ &:hover .ds-btn__inner::before {
145
+ background-color: var(--ds-interaction-primary-soft);
99
146
  }
100
- &:disabled {
101
- background-color: var(--ds-action-business-disabled);
102
- color: var(--ds-text-primary-disabled);
103
- outline: none;
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
- background-color: var(--ds-action-primary-default);
109
- color: var(--ds-text-on-primary);
110
- &:hover {
111
- background-color: var(--ds-action-primary-hover);
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
- &:focus {
114
- outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
166
+ &:hover .ds-btn__inner::before {
167
+ background-color: var(--ds-interaction-secondary-soft);
115
168
  }
116
- &:disabled {
117
- background-color: var(--ds-action-primary-disabled);
118
- color: var(--ds-text-primary-disabled);
119
- outline: none;
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--outlined {
124
- background-color: var(--ds-action-secondary-default);
125
- border: $ds-btn__border-width--outlined solid var(--ds-border-primary-strong);
126
- color: var(--ds-text-primary-default);
127
- &:hover {
128
- background-color: var(--ds-action-secondary-hover);
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
- &:focus {
131
- outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
189
+ &:hover .ds-btn__inner::before {
190
+ background-color: var(--ds-interaction-primary-soft);
132
191
  }
133
- &:disabled {
134
- background-color: var(--ds-action-secondary-disabled);
135
- border-color: var(--ds-action-secondary-disabled);
136
- color: var(--ds-text-primary-disabled);
137
- outline: none;
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
- background-color: var(--ds-action-secondary-default);
143
- border: $ds-btn__border-width--outlined solid var(--ds-border-critical-default);
144
- color: var(--ds-text-critical-default);
145
- &:hover {
146
- background-color: var(--ds-action-critical-hover);
147
- }
148
- &:focus {
149
- outline: $ds-btn__outline-width solid var(--ds-border-primary-strong);
150
- }
151
- &:disabled {
152
- background-color: var(--ds-action-secondary-disabled);
153
- border-color: var(--ds-action-secondary-disabled);
154
- color: var(--ds-text-primary-disabled);
155
- outline: none;
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,11 @@
1
+ **@bonniernews/dn-design-system-web/components/divider/README.md**
2
+
3
+ ----
4
+
5
+ # Divider
6
+
7
+ Parameters available but not used in storybook:
8
+
9
+ ```javascript
10
+ classNames: "my-special-class"
11
+ ```
@@ -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
+ ```
@@ -1,8 +1,16 @@
1
1
  {% macro Hyperlink(params) %}
2
- {% set componentClassName = "ds-hyperlink" %}
3
- {% set classNamePrefix = componentClassName + "--" %}
4
2
  {% set variant = [] %}
5
3
 
4
+ {% set attributes %}
5
+ {% for attribute, value in params.attributes %}
6
+ {{attribute}}={{value}}
7
+ {% endfor %}
8
+ {% endset %}
9
+
10
+ {% if params.textComponent %}
11
+ {% set variant = (variant.push('ds-t-' + params.textComponent), variant) %}
12
+ {% endif %}
13
+
6
14
  {% if params.textColor %}
7
15
  {% set variant = (variant.push("ds-color-text-" + params.textColor), variant) %}
8
16
  {% endif %}
@@ -11,7 +19,7 @@
11
19
  {% set variant = (variant.push(params.classNames), variant) %}
12
20
  {% endif%}
13
21
 
14
- {% set classes = componentClassName + " " + variant | join(" ") %}
22
+ {% set classes = variant | join(" ") %}
15
23
 
16
- <a href="{{ params.href | default('#', true) }}" class="{{ classes }}">{{ params.text }}</a>
24
+ <a href="{{ params.href | default('#', true) }}" class="{{ classes }}" {{ attributes }}>{{ params.text }}</a>
17
25
  {% endmacro %}