@bonniernews/dn-design-system-web 15.0.0-beta.0 → 15.0.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 (101) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/components/article-body-image/README-UXD.md +0 -0
  3. package/components/article-top-image/README-UXD.md +0 -0
  4. package/components/badge/README-UXD.md +0 -0
  5. package/components/blocked-content/README-UXD.md +0 -0
  6. package/components/buddy-menu/README-UXD.md +0 -0
  7. package/components/button/README-UXD.md +40 -0
  8. package/components/button/button.njk +32 -33
  9. package/components/button/button.scss +89 -90
  10. package/components/button-toggle/README-UXD.md +0 -0
  11. package/components/byline/README-UXD.md +0 -0
  12. package/components/checkbox/README-UXD.md +0 -0
  13. package/components/direkt-circle/README-UXD.md +0 -0
  14. package/components/disclaimer/README-UXD.md +0 -0
  15. package/components/divider/README-UXD.md +0 -0
  16. package/components/factbox/README-UXD.md +0 -0
  17. package/components/floating-button/README-UXD.md +0 -0
  18. package/components/footer/README-UXD.md +0 -0
  19. package/components/game-header/README-UXD.md +0 -0
  20. package/components/group-header/README-UXD.md +0 -0
  21. package/components/group-header/README.md +1 -1
  22. package/components/group-header/group-header.njk +5 -2
  23. package/components/group-header/group-header.scss +26 -2
  24. package/components/icon-button/README-UXD.md +0 -0
  25. package/components/icon-button/icon-button.njk +2 -1
  26. package/components/icon-button-toggle/README-UXD.md +0 -0
  27. package/components/icon-button-toggle/README.md +0 -1
  28. package/components/icon-button-toggle/icon-button-toggle.njk +1 -2
  29. package/components/icon-sprite/README-UXD.md +0 -0
  30. package/components/icon-sprite/README.md +1 -0
  31. package/components/icon-with-wrapper/README-UXD.md +0 -0
  32. package/components/image-caption/README-UXD.md +0 -0
  33. package/components/link-box/README-UXD.md +0 -0
  34. package/components/list-item/README-UXD.md +0 -0
  35. package/components/list-item/README-accordion.md +1 -1
  36. package/components/list-item/README-checkbox.md +1 -1
  37. package/components/list-item/README-image.md +48 -0
  38. package/components/list-item/README-radio.md +1 -1
  39. package/components/list-item/README-switch.md +1 -1
  40. package/components/list-item/README-toggle.md +1 -1
  41. package/components/list-item/README.md +1 -1
  42. package/components/list-item/list-item.njk +5 -2
  43. package/components/list-item/list-item.scss +35 -0
  44. package/components/modal/README-UXD.md +0 -0
  45. package/components/pictogram/README-UXD.md +0 -0
  46. package/components/pictogram/pictogram.scss +1 -1
  47. package/components/quote/README-UXD.md +0 -0
  48. package/components/radio-button/README-UXD.md +0 -0
  49. package/components/spinner/README-UXD.md +0 -0
  50. package/components/switch/README-UXD.md +0 -0
  51. package/components/tag-header/README-UXD.md +0 -0
  52. package/components/tag-header/tag-header.scss +4 -4
  53. package/components/teaser-card/README-UXD.md +0 -0
  54. package/components/teaser-dot/README-UXD.md +0 -0
  55. package/components/teaser-footer/README-UXD.md +0 -0
  56. package/components/teaser-footer/teaser-footer.scss +2 -2
  57. package/components/teaser-image/README-UXD.md +0 -0
  58. package/components/teaser-large/README-UXD.md +0 -0
  59. package/components/teaser-large/teaser-large.scss +3 -3
  60. package/components/teaser-list-swipe/README-UXD.md +0 -0
  61. package/components/teaser-list-swipe/teaser-list-swipe.njk +2 -2
  62. package/components/teaser-list-vertical/README-UXD.md +0 -0
  63. package/components/teaser-longlife/README-UXD.md +0 -0
  64. package/components/teaser-native/README-UXD.md +0 -0
  65. package/components/teaser-onsite/README-UXD.md +0 -0
  66. package/components/teaser-package/README-UXD.md +0 -0
  67. package/components/teaser-package/README.md +1 -0
  68. package/components/teaser-package/teaser-package.njk +9 -1
  69. package/components/teaser-right-now/README-UXD.md +0 -0
  70. package/components/teaser-slideshow/README-UXD.md +0 -0
  71. package/components/teaser-split/README-UXD.md +0 -0
  72. package/components/teaser-split/teaser-split.scss +1 -1
  73. package/components/teaser-standard/README-UXD.md +0 -0
  74. package/components/teaser-standard/teaser-standard.scss +2 -2
  75. package/components/teaser-swipe-card/README-UXD.md +0 -0
  76. package/components/teaser-tipsa/README-UXD.md +0 -0
  77. package/components/text-button/README-UXD.md +0 -0
  78. package/components/text-button-toggle/README-UXD.md +0 -0
  79. package/components/text-input/README-UXD.md +0 -0
  80. package/components/thematic-break/README-UXD.md +0 -0
  81. package/components/tooltip/README-UXD.md +0 -0
  82. package/components/tooltip/README.md +51 -0
  83. package/components/tooltip/tooltip.js +59 -0
  84. package/components/tooltip/tooltip.njk +38 -0
  85. package/components/tooltip/tooltip.scss +63 -0
  86. package/components/video-caption/README-UXD.md +0 -0
  87. package/components/vip-badge/README-UXD.md +0 -0
  88. package/foundations/helpers/README-UXD.md +0 -0
  89. package/foundations/typography/README-UXD.md +0 -0
  90. package/foundations/variables/colorsCssVariables.scss +2 -1
  91. package/foundations/variables/colorsDnDarkTokens.scss +2 -1
  92. package/foundations/variables/colorsDnLightTokens.scss +2 -1
  93. package/foundations/variables/typographyTokensScreenExtraLarge.scss +3 -3
  94. package/foundations/variables/typographyTokensScreenLarge.scss +3 -3
  95. package/foundations/variables/typographyTokensScreenSmall.scss +2 -2
  96. package/introduction/README-UXD.md +1 -0
  97. package/introduction/README.md +19 -0
  98. package/package.json +1 -1
  99. package/tokens/colors-css-variables.json +2 -1
  100. package/tokens/colors-dark-mode.json +3 -2
  101. package/tokens/colors-light-mode.json +3 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,159 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [15.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.11...@bonniernews/dn-design-system-web@15.0.0) (2024-03-26)
8
+
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+
12
+ * **web:** some button properties are deprecated
13
+
14
+ ### Features
15
+
16
+ * **web:** refactor buttons ([#1238](https://github.com/BonnierNews/dn-design-system/issues/1238)) ([d9ee881](https://github.com/BonnierNews/dn-design-system/commit/d9ee881010c3e14388fc648ced552cec9a0a4c36))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **app:** adjust for ÅÄÖ and small lineheight when creating styles ([#1260](https://github.com/BonnierNews/dn-design-system/issues/1260)) ([61893ce](https://github.com/BonnierNews/dn-design-system/commit/61893ce7f06546e7bbadf367fdddb33fb6ab6e98))
22
+ * **app:** remove paddingTop and negative marginTop in TextInput ([#1262](https://github.com/BonnierNews/dn-design-system/issues/1262)) ([b602c06](https://github.com/BonnierNews/dn-design-system/commit/b602c066fdd470282558cfee91eb5c0135b0fceb))
23
+
24
+
25
+ ### Maintenance
26
+
27
+ * prerelease packages ([9cb4286](https://github.com/BonnierNews/dn-design-system/commit/9cb4286bea19b21e9c82bfcaa479075fdb33d3f3))
28
+ * prerelease packages ([12eb081](https://github.com/BonnierNews/dn-design-system/commit/12eb08160c5f4577f51981dbb24b0ad4ad1d4f66))
29
+
30
+ ## [14.3.11](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.10...@bonniernews/dn-design-system-web@14.3.11) (2024-03-21)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **web:** add arrow icon to image group header ([#1258](https://github.com/BonnierNews/dn-design-system/issues/1258)) ([4237649](https://github.com/BonnierNews/dn-design-system/commit/423764937fd44e277e57d03f0683bd900b284b31))
36
+ ## [14.4.0-beta.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.10...@bonniernews/dn-design-system-web@14.4.0-beta.0) (2024-03-20)
37
+
38
+
39
+ ### Features
40
+
41
+ * **web:** refactor buttons ([e3124c6](https://github.com/BonnierNews/dn-design-system/commit/e3124c686fbe6b370eea0cd0acc8bebda926b29f))
42
+
43
+ ## [14.3.10](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.9...@bonniernews/dn-design-system-web@14.3.10) (2024-03-20)
44
+
45
+
46
+ ### Maintenance
47
+
48
+ * **web:** upgrade to storybook 8.0.0 add UXD-readme ([#1194](https://github.com/BonnierNews/dn-design-system/issues/1194)) ([59adc00](https://github.com/BonnierNews/dn-design-system/commit/59adc00f9d797e0e999250f1aa92d68626c8091c))
49
+
50
+ ## [14.3.9](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.8...@bonniernews/dn-design-system-web@14.3.9) (2024-03-20)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * **web:** minor fix for tooltip js ([#1257](https://github.com/BonnierNews/dn-design-system/issues/1257)) ([db6ddcf](https://github.com/BonnierNews/dn-design-system/commit/db6ddcf737188bef7b9fd2085e9de80d5f3418b9))
56
+
57
+ ## [14.3.8](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.7...@bonniernews/dn-design-system-web@14.3.8) (2024-03-20)
58
+
59
+
60
+ ### Bug Fixes
61
+
62
+ * **web:** export tooltip close function and add a toggle function ([#1253](https://github.com/BonnierNews/dn-design-system/issues/1253)) ([c032cbc](https://github.com/BonnierNews/dn-design-system/commit/c032cbc60f7084027d4965af1af0d4f193200ec6))
63
+
64
+ ## [14.3.7](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.6...@bonniernews/dn-design-system-web@14.3.7) (2024-03-20)
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * **web:** correct static color for pictogram ([#1256](https://github.com/BonnierNews/dn-design-system/issues/1256)) ([3862b3d](https://github.com/BonnierNews/dn-design-system/commit/3862b3daf8444881128b351eaaee9604cec0a89f))
70
+
71
+ ## [14.3.6](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.5...@bonniernews/dn-design-system-web@14.3.6) (2024-03-19)
72
+
73
+
74
+ ### Bug Fixes
75
+
76
+ * **web:** semibold text on image list item ([#1251](https://github.com/BonnierNews/dn-design-system/issues/1251)) ([e623514](https://github.com/BonnierNews/dn-design-system/commit/e623514d5761e60a4d853737dcc7cada0d7dffce))
77
+
78
+ ## [14.3.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.4...@bonniernews/dn-design-system-web@14.3.5) (2024-03-15)
79
+
80
+
81
+ ### Maintenance
82
+
83
+ * **foundations:** update tokens from Figma ([#1247](https://github.com/BonnierNews/dn-design-system/issues/1247)) ([13c450c](https://github.com/BonnierNews/dn-design-system/commit/13c450c200d518f199ad4190d62fce10bf234228))
84
+ * prerelease packages ([51094f1](https://github.com/BonnierNews/dn-design-system/commit/51094f148b5113464f5ea4bf2adc7ef6a6aeda91))
85
+
86
+ ## [14.3.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.3...@bonniernews/dn-design-system-web@14.3.4) (2024-03-15)
87
+
88
+
89
+ ### Bug Fixes
90
+
91
+ * **web:** move max-height styling to img element ([#1248](https://github.com/BonnierNews/dn-design-system/issues/1248)) ([811da42](https://github.com/BonnierNews/dn-design-system/commit/811da4268bacfbd2753ea01ac3836656ef8594d0))
92
+
93
+ ## [14.3.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.2...@bonniernews/dn-design-system-web@14.3.3) (2024-03-14)
94
+
95
+
96
+ ### Bug Fixes
97
+
98
+ * **web:** allow href attribute for imageListItem ([#1245](https://github.com/BonnierNews/dn-design-system/issues/1245)) ([4f8f6d1](https://github.com/BonnierNews/dn-design-system/commit/4f8f6d1092dcd3126498fcc5c4f90987dfd416c9))
99
+
100
+ ## [14.3.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.1...@bonniernews/dn-design-system-web@14.3.2) (2024-03-14)
101
+
102
+
103
+ ### Bug Fixes
104
+
105
+ * **web:** pass vignette icon markup to teaser package ([#1244](https://github.com/BonnierNews/dn-design-system/issues/1244)) ([e206d25](https://github.com/BonnierNews/dn-design-system/commit/e206d25989a09f686caca515b5ff284befd8a80c))
106
+
107
+
108
+ ### Maintenance
109
+
110
+ * adjust list item spacing ([#1243](https://github.com/BonnierNews/dn-design-system/issues/1243)) ([1235245](https://github.com/BonnierNews/dn-design-system/commit/123524541b75e0eab2fd449dd6764f916718dfe9))
111
+ * prerelease packages ([5fc1a71](https://github.com/BonnierNews/dn-design-system/commit/5fc1a718158f263abd7b4b9baf42b8f60b044eed))
112
+
113
+ ## [14.3.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.0...@bonniernews/dn-design-system-web@14.3.1) (2024-03-13)
114
+
115
+
116
+ ### Maintenance
117
+
118
+ * **web:** use new typo for podd components ([#1239](https://github.com/BonnierNews/dn-design-system/issues/1239)) ([c0a172e](https://github.com/BonnierNews/dn-design-system/commit/c0a172e69d429d19f3489e7a7a716d114bf7051e))
119
+
120
+ ## [14.3.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.2.1...@bonniernews/dn-design-system-web@14.3.0) (2024-03-13)
121
+
122
+
123
+ ### Features
124
+
125
+ * **web:** support for images in list item ([#1240](https://github.com/BonnierNews/dn-design-system/issues/1240)) ([0b83b22](https://github.com/BonnierNews/dn-design-system/commit/0b83b22ef2f843e63a127db7e4324d7d077c9ccb))
126
+
127
+
128
+ ### Bug Fixes
129
+
130
+ * **app:** better flex in BaseListItem ([#1241](https://github.com/BonnierNews/dn-design-system/issues/1241)) ([12f7229](https://github.com/BonnierNews/dn-design-system/commit/12f72296fe2ae6b5c73273b9449d92b85f07b335))
131
+
132
+
133
+ ### Maintenance
134
+
135
+ * prerelease packages ([114a615](https://github.com/BonnierNews/dn-design-system/commit/114a615923ab90db49adff9c6a9ce868d1b7d2f2))
136
+
137
+ ## [14.2.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.2.0...@bonniernews/dn-design-system-web@14.2.1) (2024-03-12)
138
+
139
+ ## [14.2.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.1.0...@bonniernews/dn-design-system-web@14.2.0) (2024-03-12)
140
+
141
+
142
+ ### Features
143
+
144
+ * **web:** tooltip ([#1210](https://github.com/BonnierNews/dn-design-system/issues/1210)) ([0f68d20](https://github.com/BonnierNews/dn-design-system/commit/0f68d20d9d950b42af3931f33b61d6d7260dec7d))
145
+
146
+ ## [14.1.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.0.4...@bonniernews/dn-design-system-web@14.1.0) (2024-03-11)
147
+
148
+
149
+ ### Features
150
+
151
+ * **app:** create ImageListItem and add font weight prop to all list items ([#1234](https://github.com/BonnierNews/dn-design-system/issues/1234)) ([73e06e9](https://github.com/BonnierNews/dn-design-system/commit/73e06e9df30f2bdb1677dd4bde015ddea9ddb185))
152
+ * **web:** support for images in group header ([#1235](https://github.com/BonnierNews/dn-design-system/issues/1235)) ([f4148dc](https://github.com/BonnierNews/dn-design-system/commit/f4148dc90b104326cd53e72f930510393bb533a6))
153
+
154
+
155
+ ### Maintenance
156
+
157
+ * prerelease packages ([2a8954c](https://github.com/BonnierNews/dn-design-system/commit/2a8954c0cce43dfc53d0b5617c0d41c6ae2ba94b))
158
+
159
+
7
160
  ## [15.0.0-beta.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.0.4...@bonniernews/dn-design-system-web@15.0.0-beta.0) (2024-03-11)
8
161
 
9
162
 
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,40 @@
1
+ # Standard button
2
+
3
+ Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
4
+
5
+
6
+ ### Anatomy
7
+
8
+ 1. **Label:** The text displayed on the button, indicating its function.
9
+ 2. **Icon** Iconography that enhances the function.
10
+ 3. **Background:** The background color or style that defines the button's appearance.
11
+ 4. **Border:** The outline surrounding the button, providing visual separation from surrounding elements.
12
+ 5. **Shape** The standard shape is rectangular but the component also supports a rounded format.
13
+
14
+
15
+ ## Variants
16
+
17
+ | Variant | How to use |
18
+ | --------- | ---------------------------------------------------------------------------------------------------- |
19
+ | [Brand](#brand) | Extra high emphasis button used for actions that are extra important for the user flow and conversion. I.e. ”Logga in” |
20
+ | [Primary](#primary) | High emphasis button used to attract attention to the most important task of the layout, typically the next step in the user flow. I.e. ”Nästa fråga” in a quiz. |
21
+ | [Secondary](#secondary)| Medium emphasis button used for alternative non-primary actions. I.e. ”Alla nyheter” in a list of news. |
22
+ | [Outline](#primary%20outline) | Low emphasis Button used for less important actions. Usually used in combination with a primary or brand Button. |
23
+
24
+
25
+ ## Usage
26
+
27
+ Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
28
+
29
+
30
+ ### Dos
31
+
32
+ - **Use Primary Buttons for Key Actions:** Employ primary buttons for primary actions within a given context, guiding user focus towards important interactions.
33
+ - **Provide Clear Labeling:** Ensure button labels are concise, descriptive, and indicative of the action they perform, enhancing usability.
34
+ - **Maintain Visual Hierarchy:** Utilize secondary and outline buttons to distinguish lesser actions or provide alternative choices, maintaining a clear visual hierarchy.
35
+
36
+ ### Don'ts
37
+
38
+ - **Avoid Ambiguous Labels:** Refrain from using vague or ambiguous labels like ”Fortsätt” that might confuse users about the button's function.
39
+ - **Overuse of Primary Buttons:** Reserve primary buttons for the most crucial actions to avoid overwhelming users with excessive visual weight.
40
+
@@ -1,13 +1,30 @@
1
1
  {% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
2
2
  {% from '@bonniernews/dn-design-system-web/components/spinner/spinner.njk' import Spinner %}
3
3
  {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
4
+ {% from '@bonniernews/dn-design-system-web/foundations/a11y/visually-hidden.njk' import VisuallyHidden %}
5
+
6
+ {% macro InnerButton(params) %}
7
+ {% if not params.isIconButton %}
8
+ <span aria-hidden="true">{{ params.text }}</span>
9
+ {% elif not params.attributes["aria-label"] and params.a11y and params.a11y.visuallyHidden %}
10
+ {{- VisuallyHidden({ text: params.a11y.visuallyHidden }) | safe -}}
11
+ {% endif %}
12
+ {{- params.iconSvg | safe if params.iconSvg -}} {{ params.loadingHtml | safe }}
13
+ {% endmacro %}
14
+
15
+ {% macro ToggleWrapper(params) %}
16
+ <button type="button" role="switch" {{ params.ariaLabel | safe }} aria-checked="{{ "true" if params.selected else "false" }}" class="{{ params.classes }}" {{ "disabled" if params.disabled }} {{- params.attributes | safe }}>
17
+ {{ caller() }}
18
+ {{ params.loadingHtml | safe }}
19
+ </button>
20
+ {% endmacro %}
4
21
 
5
22
  {% macro Button(params) %}
6
23
  {%- set componentClassName = "ds-btn" %}
7
24
  {%- set classNamePrefix = componentClassName + "--" %}
8
25
  {%- set text = params.text %}
9
26
  {%- set attributes = getAttributes(params.attributes) %}
10
- {%- set ariaLabel = 'aria-label="' + text + '"' if not params.attributes["aria-label"] else "" %}
27
+ {%- set ariaLabel = 'aria-label="' + text + '"' if params.text and not params.attributes["aria-label"] else "" %}
11
28
  {%- set buttonVariant = params.variant | default("primary") %}
12
29
  {%- set emphasis = params.emphasis | default("default") %}
13
30
 
@@ -31,10 +48,6 @@
31
48
  {% set iconSvg = IconUse({ icon: params.iconName, attributes: { "aria-hidden": "true" } }) %}
32
49
  {% endif %}
33
50
 
34
- {%- if params.a11y and params.a11y.visuallyHidden %}
35
- {% set visuallyHidden = VisuallyHidden({ text: params.a11y.visuallyHidden }) %}
36
- {% endif %}
37
-
38
51
  {%- set classes = [
39
52
  componentClassName,
40
53
  classNamePrefix + buttonVariant,
@@ -54,40 +67,26 @@
54
67
  ] | join(" ") %}
55
68
 
56
69
  {%- if params.isToggle %}
57
- {%- if params.isIconBtn %}
58
- <button type="button" role="switch" aria-checked="{{ "true" if params.selected else "false" }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
59
- {{- visuallyHidden | safe if visuallyHidden -}}
60
- <span class="{{ componentClassName + '__off' }}" aria-hidden="true">{{ IconUse({ icon: params.iconName }) }}</span>
61
- <span class="{{ componentClassName + '__on' }}" aria-hidden="true">{{ IconUse({ icon: params.selectedIconName }) }}</span>
62
- {{ loadingHtml | safe }}
63
- </button>
64
- {% else %}
65
- <button type="button" role="switch" {{ ariaLabel | safe }} aria-checked="{{ "true" if params.selected else "false" }}" class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
66
- <span class="{{ componentClassName + '__off' }}" aria-hidden="true"><span>{{ params.text }}</span></span>
67
- <span class="{{ componentClassName + '__on' }}" aria-hidden="true">
70
+ {% call ToggleWrapper({ ariaLabel: ariaLabel, selected: params.selected, classes: classes, attributes: attributes, disabled: params.disabled, loadingHtml: loadingHtml }) %}
71
+ {%- if params.isIconBtn %}
72
+ <span class="ds-btn__off" aria-hidden="true">{{ IconUse({ icon: params.iconName }) }}</span>
73
+ <span class="ds-btn__on" aria-hidden="true">{{ IconUse({ icon: params.selectedIconName }) }}</span>
74
+ {% else %}
75
+ <span class="ds-btn__off" aria-hidden="true"><span>{{ params.text }}</span></span>
76
+ <span class="ds-btn__on" aria-hidden="true">
68
77
  {{ IconUse({ icon: "check" }) }} <span>{{ params.selectedText }}</span>
69
78
  </span>
70
- {{ loadingHtml | safe }}
71
- </button>
72
- {% endif %}
79
+ {% endif %}
80
+ {% endcall %}
73
81
  {% else %}
82
+ {% set buttonParams = { isIconButton: params.isIconBtn, a11y: params.a11y, text: text, iconSvg: iconSvg, loadingHtml: loadingHtml , attributes: params.attributes } %}
74
83
  {%- if params.href %}
75
- <a href="{{ params.href | default('#', true) }}" {{ ariaLabel | safe }} class="{{ classes }}" {{- attributes | safe}}>
76
- {% if isIconButton %}
77
- {{- visuallyHidden | safe if visuallyHidden -}}
78
- {% else %}
79
- <span aria-hidden="true">{{ text }}</span>
80
- {% endif %}
81
- {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
84
+ <a href="{{ params.href | default('#', true) }}" {{ ariaLabel | safe }} class="{{ classes }}" {{- attributes | safe }}>
85
+ {{ InnerButton(buttonParams) }}
82
86
  </a>
83
87
  {% else %}
84
- <button type="{{ params.type | default('button') }}" {{ ariaLabel | safe }} class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe}}>
85
- {% if isIconButton %}
86
- {{- visuallyHidden | safe if visuallyHidden -}}
87
- {% else %}
88
- <span aria-hidden="true">{{ text }}</span>
89
- {% endif %}
90
- {{- iconSvg | safe if iconSvg -}} {{ loadingHtml | safe }}
88
+ <button type="{{ params.type | default('button') }}" {{ ariaLabel | safe }} class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
89
+ {{ InnerButton(buttonParams) }}
91
90
  </button>
92
91
  {% endif %}
93
92
  {% endif %}
@@ -4,9 +4,16 @@
4
4
  @use "../spinner/spinner.scss" as *;
5
5
 
6
6
  $ds-btn-outlined__border-width: ds-border-width(x1);
7
+ @function _btn-brdr($value, $rem: false) {
8
+ $value: (ds-strip-unit($value) - ds-strip-unit($ds-btn-outlined__border-width)) * 1px;
9
+ @if $rem {
10
+ @return ds-px-to-rem($value);
11
+ }
12
+ @return $value;
13
+ }
7
14
 
8
15
  .ds-btn {
9
- --ds-btn__background-color: transparent;
16
+ --ds-btn__background-color: #{$ds-color-surface-background};
10
17
  --ds-btn__border-color: transparent;
11
18
  --ds-btn__outline-color: #{$ds-color-border-focus-02};
12
19
  --ds-btn__icon-size: #{ds-px-to-rem(24px)};
@@ -14,52 +21,63 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
14
21
  --ds-btn__icon-size: 24px;
15
22
  }
16
23
 
17
- &.ds-btn--default,
18
- &.ds-btn--elevated {
19
- &.ds-btn--primary {
24
+ &.ds-btn--primary {
25
+ &.ds-btn--default,
26
+ &.ds-btn--elevated {
20
27
  --ds-btn__background-color: #{$ds-color-component-primary};
21
28
  --ds-btn__color: #{$ds-color-text-secondary};
22
29
  }
23
- &.ds-btn--secondary {
24
- --ds-btn__background-color: #{$ds-color-component-primary-overlay};
30
+ &.ds-btn--outline {
31
+ --ds-btn__border-color: #{$ds-color-component-primary};
25
32
  --ds-btn__color: #{$ds-color-text-primary};
26
33
  }
27
- &.ds-btn--brand {
28
- --ds-btn__background-color: #{$ds-color-component-brand};
29
- --ds-btn__color: #{$ds-color-text-secondary};
30
- }
31
- &.ds-btn--staticWhite {
32
- --ds-btn__background-color: #{$ds-color-static-white};
33
- --ds-btn__color: #{$ds-color-static-black};
34
+ &.ds-btn--transparent {
35
+ --ds-btn__color: #{$ds-color-text-primary};
34
36
  }
35
37
  }
36
-
37
- &.ds-btn--outline,
38
- &.ds-btn--transparent {
39
- &.ds-btn--primary,
40
- &.ds-btn--secondary {
38
+ &.ds-btn--secondary {
39
+ &.ds-btn--default,
40
+ &.ds-btn--elevated {
41
+ --ds-btn__background-color: #{$ds-color-component-primary-overlay};
41
42
  --ds-btn__color: #{$ds-color-text-primary};
42
43
  }
43
- &.ds-btn--brand {
44
- --ds-btn__color: #{$ds-color-text-brand};
44
+ &.ds-btn--outline {
45
+ --ds-btn__border-color: #{$ds-color-border-primary-02};
46
+ --ds-btn__color: #{$ds-color-text-primary};
45
47
  }
46
- &.ds-btn--staticWhite {
47
- --ds-btn__color: #{$ds-color-static-white};
48
+ &.ds-btn--transparent {
49
+ --ds-btn__color: #{$ds-color-text-primary};
48
50
  }
49
51
  }
50
-
51
- &.ds-btn--outline {
52
- &.ds-btn--primary {
53
- --ds-btn__border-color: #{$ds-color-component-primary};
54
- }
55
- &.ds-btn--secondary {
56
- --ds-btn__border-color: #{$ds-color-border-primary-02};
52
+ &.ds-btn--brand {
53
+ --ds-btn__outline-color: #{$ds-color-border-focus};
54
+ &.ds-btn--default,
55
+ &.ds-btn--elevated {
56
+ --ds-btn__background-color: #{$ds-color-component-brand};
57
+ --ds-btn__color: #{$ds-color-text-secondary};
57
58
  }
58
- &.ds-btn--brand {
59
+ &.ds-btn--outline {
59
60
  --ds-btn__border-color: #{$ds-color-component-brand};
61
+ --ds-btn__color: #{$ds-color-text-brand};
62
+ }
63
+ &.ds-btn--transparent {
64
+ --ds-btn__color: #{$ds-color-text-brand};
65
+ }
66
+ }
67
+ &.ds-btn--staticWhite {
68
+ --ds-btn__outline-color: #{$ds-color-static-white};
69
+ &.ds-btn--default,
70
+ &.ds-btn--elevated {
71
+ --ds-btn__background-color: #{$ds-color-static-white};
72
+ --ds-btn__color: #{$ds-color-static-black};
60
73
  }
61
- &.ds-btn--staticWhite {
74
+ &.ds-btn--outline {
75
+ --ds-btn__background-color: transparent;
62
76
  --ds-btn__border-color: #{$ds-color-static-white};
77
+ --ds-btn__color: #{$ds-color-static-white};
78
+ }
79
+ &.ds-btn--transparent {
80
+ --ds-btn__color: #{$ds-color-static-white};
63
81
  }
64
82
  }
65
83
 
@@ -69,12 +87,8 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
69
87
  --ds-btn__border-color: #{$ds-color-component-primary};
70
88
  --ds-btn__outline-color: #{$ds-color-border-focus-02};
71
89
  }
72
-
73
- &.ds-btn--brand {
74
- --ds-btn__outline-color: #{$ds-color-border-focus};
75
- }
76
- &.ds-btn--staticWhite {
77
- --ds-btn__outline-color: #{$ds-color-static-white};
90
+ &.ds-btn--transparent {
91
+ --ds-btn__background-color: transparent;
78
92
  }
79
93
  &.ds-btn--rounded {
80
94
  border-radius: 100px;
@@ -86,26 +100,45 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
86
100
  &.ds-btn--small {
87
101
  @include ds-typography($ds-typography-detailstandard-button-small);
88
102
  --ds-btn__icon-size: #{ds-px-to-rem(20px)};
103
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050), true)};
104
+ padding: _btn-brdr(ds-spacing($ds-s-025), true) _btn-brdr(ds-spacing($ds-s-075), true);
89
105
  @at-root .ds-force-px#{&} {
90
106
  @include ds-typography($ds-typography-detailstandard-button-small, true);
91
107
  --ds-btn__icon-size: 20px;
108
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050))};
109
+ padding: _btn-brdr(ds-spacing($ds-s-025)) _btn-brdr(ds-spacing($ds-s-075));
110
+ }
111
+ }
112
+ &.ds-btn--medium {
113
+ @include ds-typography($ds-typography-detailstandard-button);
114
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100), true)};
115
+ padding: _btn-brdr(ds-spacing($ds-s-050), true) _btn-brdr(ds-spacing($ds-s-125), true);
116
+ @at-root .ds-force-px#{&} {
117
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100))};
118
+ @include ds-typography($ds-typography-detailstandard-button, true);
119
+ padding: _btn-brdr(ds-spacing($ds-s-050)) _btn-brdr(ds-spacing($ds-s-125));
92
120
  }
93
121
  }
94
-
95
- &.ds-btn--medium,
96
122
  &.ds-btn--large {
97
123
  @include ds-typography($ds-typography-detailstandard-button);
124
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125), true)};
125
+ padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-150), true);
98
126
  @at-root .ds-force-px#{&} {
99
127
  @include ds-typography($ds-typography-detailstandard-button, true);
128
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125))};
129
+ padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-150));
100
130
  }
101
131
  }
102
-
103
132
  &.ds-btn--xlarge {
104
133
  @include ds-typography($ds-typography-detailstandard-button-xlarge);
105
134
  --ds-btn__icon-size: #{ds-px-to-rem(32px)};
135
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200), true) - ds-px-to-rem(4px)};
136
+ padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-200), true);
106
137
  @at-root .ds-force-px#{&} {
107
138
  @include ds-typography($ds-typography-detailstandard-button-xlarge, true);
108
139
  --ds-btn__icon-size: 32px;
140
+ --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200)) - 4px};
141
+ padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-200));
109
142
  }
110
143
  }
111
144
 
@@ -175,46 +208,6 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
175
208
  box-sizing: border-box;
176
209
  }
177
210
 
178
- .ds-btn--small {
179
- padding: ds-px-to-rem(ds-spacing($ds-s-025) - $ds-btn-outlined__border-width)
180
- ds-px-to-rem(ds-spacing($ds-s-075) - $ds-btn-outlined__border-width);
181
- @at-root .ds-force-px#{&} {
182
- /* stylelint-disable-next-line */
183
- padding: ds-spacing($ds-s-025) - $ds-btn-outlined__border-width ds-spacing($ds-s-075) -
184
- $ds-btn-outlined__border-width;
185
- }
186
- }
187
-
188
- .ds-btn--medium {
189
- padding: ds-px-to-rem(ds-spacing($ds-s-050) - $ds-btn-outlined__border-width)
190
- ds-px-to-rem(ds-spacing($ds-s-125) - $ds-btn-outlined__border-width);
191
- @at-root .ds-force-px#{&} {
192
- /* stylelint-disable-next-line */
193
- padding: ds-spacing($ds-s-050) - $ds-btn-outlined__border-width ds-spacing($ds-s-125) -
194
- $ds-btn-outlined__border-width;
195
- }
196
- }
197
-
198
- .ds-btn--large {
199
- padding: ds-px-to-rem(ds-spacing($ds-s-075) - $ds-btn-outlined__border-width)
200
- ds-px-to-rem(ds-spacing($ds-s-150) - $ds-btn-outlined__border-width);
201
- @at-root .ds-force-px#{&} {
202
- /* stylelint-disable-next-line */
203
- padding: ds-spacing($ds-s-075) - $ds-btn-outlined__border-width ds-spacing($ds-s-150) -
204
- $ds-btn-outlined__border-width;
205
- }
206
- }
207
-
208
- .ds-btn--xlarge {
209
- padding: ds-px-to-rem(ds-spacing($ds-s-075) - $ds-btn-outlined__border-width)
210
- ds-px-to-rem(ds-spacing($ds-s-200) - $ds-btn-outlined__border-width);
211
- @at-root .ds-force-px#{&} {
212
- /* stylelint-disable-next-line */
213
- padding: ds-spacing($ds-s-075) - $ds-btn-outlined__border-width ds-spacing($ds-s-200) -
214
- $ds-btn-outlined__border-width;
215
- }
216
- }
217
-
218
211
  @include ds-mq-only-breakpoint(mobile) {
219
212
  .ds-btn--mobile-full-width {
220
213
  width: 100%;
@@ -223,7 +216,7 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
223
216
 
224
217
  .ds-btn--icon-left,
225
218
  .ds-btn--icon-right,
226
- .ds-btn--selected,
219
+ .ds-btn--toggle.ds-btn--selected,
227
220
  .ds-btn--icon-only {
228
221
  display: inline-flex;
229
222
  align-items: center;
@@ -237,8 +230,11 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
237
230
  }
238
231
  }
239
232
  }
240
-
241
- .ds-btn--icon-right {
233
+ .ds-btn.ds-btn--icon-right {
234
+ padding-right: var(--ds-btn__icon-padding);
235
+ &.ds-force-px {
236
+ padding-right: var(--ds-btn__icon-padding);
237
+ }
242
238
  .ds-icon {
243
239
  margin: ds-spacing(0 0 0 $ds-s-050, rem);
244
240
  @at-root .ds-force-px#{&} {
@@ -252,19 +248,22 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
252
248
  }
253
249
  }
254
250
  }
255
-
256
- .ds-btn--icon-left,
257
- .ds-btn--selected:not(.ds-btn--icon-only) {
251
+ .ds-btn.ds-btn--icon-left,
252
+ .ds-btn.ds-btn--selected:not(.ds-btn--icon-only) {
258
253
  flex-direction: row-reverse;
254
+ padding-left: var(--ds-btn__icon-padding);
259
255
  .ds-icon {
260
256
  margin: ds-spacing(0 $ds-s-050 0 0, rem);
261
- @at-root .ds-force-px#{&} {
262
- margin: ds-spacing(0 $ds-s-050 0 0);
263
- }
264
257
  }
265
258
  &.ds-btn--small .ds-icon {
266
259
  margin: ds-spacing(0 $ds-s-025 0 0, rem);
267
- @at-root .ds-force-px#{&} {
260
+ }
261
+ &.ds-force-px {
262
+ padding-left: var(--ds-btn__icon-padding);
263
+ .ds-icon {
264
+ margin: ds-spacing(0 $ds-s-050 0 0);
265
+ }
266
+ &.ds-btn--small .ds-icon {
268
267
  margin: ds-spacing(0 $ds-s-025 0 0);
269
268
  }
270
269
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -11,7 +11,7 @@
11
11
  |parameter | type | required | options | default | description |
12
12
  |:--- | :--- | :--- | :--- | :--- | :--- |
13
13
  |title | string | yes | | | The title text |
14
- |variant | string | no | icon, link, toggle, arrows | icon | The variant to render |
14
+ |variant | string | no | icon, link, toggle, arrows, image, bauta, bauataxl, image | icon | The variant to render |
15
15
  |href | string | no | | | If given, the title is rendered as a link |
16
16
  |linkText | string | no | | | The link text to render (only for variants `link` and `direkt`) |
17
17
  |showBottomBorder | boolean | no | | | If true there will be a bottom border |
@@ -16,13 +16,16 @@
16
16
  ] | join(" ") %}
17
17
 
18
18
  {% set groupHeaderInner %}
19
- <h2 class="{{ componentClassName + '__title'}}">{{ params.title}}</h2>
19
+ {% if params.variant == 'image' %}
20
+ <div class="{{ componentClassName + '__image'}}">{{ params.mediaHtml | safe }}</div>
21
+ {% endif %}
22
+ <h2 class="{{ componentClassName + '__title'}}">{{ params.title }}</h2>
20
23
 
21
24
  {% if params.variant == 'link' and params.linkText and params.href %}
22
25
  <span class="{{ componentClassName + '__right-link' }}">
23
26
  {{ params.linkText }}
24
27
  </span>
25
- {% elif (params.variant == 'icon' or params.variant == 'bauta' or not params.variant) and params.href %}
28
+ {% elif (params.variant == 'icon' or params.variant == 'bauta' or params.variant == 'image' or not params.variant) and params.href %}
26
29
  {{ IconUse({ icon: "arrow_forward", classNames: componentClassName + '__icon' }) }}
27
30
  {% elif (params.variant == 'arrows') and params.href and params.linkText %}
28
31
  <span class="{{ componentClassName + '__right-link' }} hidden-desktop">