@bonniernews/dn-design-system-web 28.0.0 → 28.0.1-beta.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 (63) hide show
  1. package/components/blocked-content/blocked-content.js +1 -1
  2. package/components/blocked-content/blocked-content.njk +2 -2
  3. package/components/buddy-menu/buddy-menu.njk +5 -5
  4. package/components/buddy-menu/buddy-menu.scss +0 -1
  5. package/components/button/README.md +6 -8
  6. package/components/button/button-types.ts +34 -25
  7. package/components/button/button.njk +8 -15
  8. package/components/button/button.scss +58 -85
  9. package/components/button-toggle/README.md +8 -5
  10. package/components/button-toggle/button-toggle.njk +3 -0
  11. package/components/divider/README.md +1 -1
  12. package/components/empty-state/empty-state.njk +2 -3
  13. package/components/factbox/factbox.njk +4 -4
  14. package/components/group-header/group-header.njk +10 -10
  15. package/components/group-header/group-header.scss +1 -2
  16. package/components/list-item/list-item-types.ts +3 -3
  17. package/components/list-item/list-item.njk +4 -4
  18. package/components/modal/modal.njk +10 -8
  19. package/components/modal/modal.scss +3 -4
  20. package/components/pagination/pagination.njk +0 -1
  21. package/components/profile-header/profile-header.njk +2 -2
  22. package/components/tag-header/tag-header.njk +2 -2
  23. package/components/teaser-list-swipe/teaser-list-swipe.njk +9 -9
  24. package/components/teaser-list-swipe/teaser-list-swipe.scss +3 -3
  25. package/components/teaser-list-vertical/teaser-list-vertical.njk +1 -1
  26. package/components/text-input/text-input.njk +5 -3
  27. package/components/text-input/text-input.scss +2 -3
  28. package/components/tooltip/tooltip.njk +4 -4
  29. package/components/tooltip/tooltip.scss +0 -1
  30. package/package.json +1 -1
  31. package/preact/components/buddy-menu/buddy-menu.js +24 -69
  32. package/preact/components/buddy-menu/buddy-menu.js.map +4 -4
  33. package/preact/components/button/button-base.d.ts +1 -1
  34. package/preact/components/button/button-base.js +4 -12
  35. package/preact/components/button/button-base.js.map +2 -2
  36. package/preact/components/button/button-types.d.ts +24 -19
  37. package/preact/components/button/button.d.ts +1 -1
  38. package/preact/components/button/button.js +7 -17
  39. package/preact/components/button/button.js.map +2 -2
  40. package/preact/components/button-toggle/button-toggle.d.ts +1 -1
  41. package/preact/components/button-toggle/button-toggle.js +11 -14
  42. package/preact/components/button-toggle/button-toggle.js.map +2 -2
  43. package/preact/components/list-item/list-item-types.d.ts +3 -3
  44. package/preact/components/list-item/list-item.js +13 -16
  45. package/preact/components/list-item/list-item.js.map +2 -2
  46. package/preact/components/text-input/text-input.js +28 -29
  47. package/preact/components/text-input/text-input.js.map +3 -3
  48. package/components/icon-button/README-NJK.md +0 -47
  49. package/components/icon-button/README-UXD.md +0 -44
  50. package/components/icon-button/README.md +0 -31
  51. package/components/icon-button/icon-button.njk +0 -22
  52. package/components/icon-button/icon-button.scss +0 -32
  53. package/components/icon-button-toggle/README-NJK.md +0 -53
  54. package/components/icon-button-toggle/README-UXD.md +0 -0
  55. package/components/icon-button-toggle/README.md +0 -38
  56. package/components/icon-button-toggle/icon-button-toggle.njk +0 -18
  57. package/components/icon-button-toggle/icon-button-toggle.scss +0 -1
  58. package/preact/components/icon-button/icon-button.d.ts +0 -10
  59. package/preact/components/icon-button/icon-button.js +0 -198
  60. package/preact/components/icon-button/icon-button.js.map +0 -7
  61. package/preact/components/icon-button-toggle/icon-button-toggle.d.ts +0 -18
  62. package/preact/components/icon-button-toggle/icon-button-toggle.js +0 -200
  63. package/preact/components/icon-button-toggle/icon-button-toggle.js.map +0 -7
@@ -15,7 +15,7 @@ function dsBlockedContent(params) {
15
15
  <h2 class="ds-blocked-content__title">Hoppsan, här saknas något</h2>
16
16
  <div class="ds-blocked-content__body">Innehållet ${ params.vendor ? `från ${params.vendor}` : '' } kunde inte visas på grund av dina val i kakinställningarna.</div>
17
17
  </div>
18
- <button type="button" class="ds-btn ds-btn--secondary ds-btn--default ds-btn--medium ds-btn--full-width">
18
+ <button type="button" class="ds-btn ds-btn--secondaryFilled ds-btn--default ds-btn--md ds-btn--full-width">
19
19
  <div class="ds-btn__inner">
20
20
  <span>Hantera kakor</span>
21
21
  <div class="ds-spinner ds-spinner--small ds-spinner--primary">
@@ -23,8 +23,8 @@
23
23
  </div>
24
24
  {{ Button({
25
25
  text: 'Hantera kakor',
26
- variant: 'secondary',
27
- size: 'medium',
26
+ variant: 'secondaryFilled',
27
+ size: 'md',
28
28
  classNames: '',
29
29
  fullWidth: true,
30
30
  forcePx: params.forcePx,
@@ -1,6 +1,5 @@
1
1
  {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
2
  {% from '@bonniernews/dn-design-system-web/components/list-item/list-item.njk' import ListItem %}
3
- {% from '@bonniernews/dn-design-system-web/components/icon-button/icon-button.njk' import IconButton %}
4
3
  {% from '@bonniernews/dn-design-system-web/components/button/button.njk' import Button %}
5
4
 
6
5
  {% macro BuddyMenu(params) %}
@@ -18,12 +17,13 @@
18
17
  <div class="{{ componentClassName + '__inner'}}">
19
18
  <div class="ds-buddy-menu__scrollable-container">
20
19
  <div class="ds-buddy-menu__content">
21
- {{ IconButton({
20
+ {{ Button({
22
21
  variant: "transparent",
23
- size: "small",
22
+ size: "sm",
24
23
  iconName: "close",
25
24
  classNames: "ds-buddy-menu__close",
26
- forcePx: params.forcePx
25
+ forcePx: params.forcePx,
26
+ isIconButton: true
27
27
  })}}
28
28
 
29
29
  <div class="ds-buddy-menu__header">
@@ -46,7 +46,7 @@
46
46
 
47
47
  {{ Button({
48
48
  text: "Mitt konto",
49
- variant: "primary",
49
+ variant: "primaryBlack",
50
50
  fullWidth: true,
51
51
  href: params.myAccountUrl | default("#"),
52
52
  attributes: { "data-hide-promo" : "" },
@@ -1,6 +1,5 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
  @use "../button/button.scss" as *;
3
- @use "../icon-button/icon-button.scss" as *;
4
3
  @use "../list-item/list-item.scss" as *;
5
4
 
6
5
  :root {
@@ -9,27 +9,25 @@ Button
9
9
 
10
10
  | Name | Description | Default |
11
11
  |:--- | :--- | :--- |
12
- | text\* | string | \- |
12
+ | isIconButton | boolean | false |
13
+ | iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "bookmark-filled", "bookmarked", "campaign" | \- |
14
+ | variant | Design variant<br />"primary", "staticWhite", "primaryBlack", "secondaryFilled", "secondaryOutline", "transparent" | "primary" |
13
15
  | disabled | Note: only works on button-tag, not on a-tag<br />boolean | false |
14
16
  | classNames | string | \- |
15
17
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />{ \[key: string\]: string; } | \- |
16
18
  | forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | false |
17
- | size | "large", "small", "medium", "xlarge" | "medium" |
19
+ | size | "sm", "md", "lg", "xl" | "md" |
18
20
  | loading | boolean | false |
19
- | iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "bookmark-filled", "bookmarked", "campaign" | \- |
20
- | variant | Design variant<br />"brand", "secondary", "primary", "staticWhite" | "primary" |
21
+ | text | string | \- |
21
22
  | fullWidth | Button will be full width on both desktop and mobile<br />boolean | false |
22
23
  | mobileFullWidth | Button will only full width on mobile<br />boolean | false |
23
24
  | href | If href is set the button will be rendered as an a-tag<br />string | \- |
24
25
  | type | "button", "submit" | "button" |
25
- | emphasis | "default", "elevated", "outline", "transparent" | "default" |
26
- | rounded | Button will be rounded<br />boolean | false |
27
26
  | iconPosition | "right", "none", "left" | "none" |
28
27
 
29
28
  ```jsx
30
29
  <Button
31
- emphasis="default"
32
- size="medium"
30
+ size="md"
33
31
  text="Primary"
34
32
  variant="primary"
35
33
  />
@@ -1,15 +1,20 @@
1
1
  import type { DsIcon } from '@bonniernews/dn-design-system-web/types-lib/ds-icon.d.ts'
2
2
 
3
3
  export interface ButtonSharedProps {
4
+ /** Design variant */
5
+ variant?: 'primary' | 'primaryBlack' | 'secondaryFilled' | 'secondaryOutline' | 'transparent' | 'staticWhite'
4
6
  /** Note: only works on button-tag, not on a-tag */
5
7
  disabled?: boolean
8
+ /** add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icons--all-icons */
9
+ iconName?: DsIcon
6
10
  classNames?: string
7
11
  /** Ex. { target: "_blank", "data-test": "lorem ipsum" } */
8
12
  attributes?: { [key: string]: string }
9
13
  /** Fixed pixel value is used for typography to prevent scaling based on html font-size */
10
14
  forcePx?: boolean
11
- size?: 'small' | 'medium' | 'large' | 'xlarge'
12
- loading?: boolean
15
+ size?: 'sm' | 'md' | 'lg' | 'xl'
16
+ loading?: boolean,
17
+ isIconButton?: boolean
13
18
  }
14
19
 
15
20
  export interface AllyProps {
@@ -17,23 +22,15 @@ export interface AllyProps {
17
22
  }
18
23
 
19
24
  export interface ButtonBaseProps extends ButtonSharedProps {
20
- /** Design variant */
21
- variant?: 'primary' | 'secondary' | 'brand' | 'staticWhite'
22
25
  text?: string
23
- emphasis?: 'default' | 'elevated' | 'outline' | 'transparent'
24
- /** Button will be rounded */
25
- rounded?: boolean
26
26
  /** Button will be full width on both desktop and mobile */
27
27
  fullWidth?: boolean
28
28
  /** Button will only full width on mobile */
29
29
  mobileFullWidth?: boolean
30
30
  iconPosition?: 'none' | 'left' | 'right'
31
- /** add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icons--all-icons */
32
- iconName?: DsIcon
33
31
  type?: 'button' | 'submit'
34
32
  /** If href is set the button will be rendered as an a-tag */
35
33
  href?: string
36
- isIconButton?: boolean
37
34
  a11y?: AllyProps
38
35
  selected?: boolean
39
36
  isToggle?: boolean
@@ -60,28 +57,40 @@ export interface ToggleWrapperProps {
60
57
  offChild?: any
61
58
  }
62
59
 
63
- export interface ButtonProps
60
+ export interface ButtonStandardProps
64
61
  extends ButtonSharedProps,
65
62
  Pick<
66
63
  ButtonBaseProps,
67
- 'text' | 'variant' | 'emphasis' | 'rounded' | 'fullWidth' | 'mobileFullWidth' | 'iconPosition' | 'iconName' | 'type' | 'href'
64
+ 'text' | 'fullWidth' | 'mobileFullWidth' | 'iconPosition' | 'type' | 'href'
68
65
  > {
69
- text: string // set as required
66
+ text: string
70
67
  }
71
68
 
72
- export interface ButtonToggleProps
69
+ export interface ButtonIconProps
73
70
  extends ButtonSharedProps,
74
- Pick<ButtonBaseProps, 'selected' | 'text' | 'selectedText' | 'fullWidth' | 'mobileFullWidth'> {
75
- selectedText: string // set as required
76
- variant?: 'primary' | 'secondary' | 'brand'
71
+ Pick<
72
+ ButtonBaseProps,
73
+ 'text' | 'fullWidth' | 'mobileFullWidth' | 'iconPosition' | 'type' | 'href'> {
74
+ iconName: DsIcon
75
+ }
76
+
77
+ export type ButtonProps =
78
+ | ({ isIconButton: true } & ButtonIconProps)
79
+ | ({ isIconButton?: false } & ButtonStandardProps)
80
+
81
+ export interface ButtonToggleStandardProps
82
+ extends ButtonSharedProps,
83
+ Pick<ButtonBaseProps, 'selected' | 'text' | 'selectedText' | 'selectedIconName' | 'fullWidth' | 'mobileFullWidth'> {
84
+ selectedText: string
77
85
  }
78
- export interface IconButtonProps extends ButtonSharedProps, Pick<ButtonBaseProps, 'iconName' | 'emphasis' | 'rounded' | 'href'> {
79
- a11y?: object;
80
- variant?: 'primary' | 'secondary' | 'brand'
81
- }
82
86
 
87
+ export interface ButtonToggleIconProps
88
+ extends ButtonSharedProps,
89
+ Pick<ButtonBaseProps, 'selected' | 'text' | 'selectedText' | 'fullWidth' | 'mobileFullWidth'> {
90
+ iconName: DsIcon
91
+ selectedIconName: DsIcon
92
+ }
83
93
 
84
- export interface IconButtonToggleProps extends ButtonSharedProps, Pick<ButtonBaseProps, 'iconName' | 'emphasis' | 'selectedIconName'> {
85
- selected?: boolean;
86
- variant?: 'primary' | 'secondary' | 'brand'
87
- }
94
+ export type ButtonToggleProps =
95
+ | ({ isIconButton?: false } & ButtonToggleStandardProps)
96
+ | ({ isIconButton: true } & ButtonToggleIconProps)
@@ -26,15 +26,10 @@
26
26
  {%- set attributes = getAttributes(params.attributes) %}
27
27
  {%- set ariaLabel = 'aria-label="' + text + '"' if params.text and not params.attributes["aria-label"] else "" %}
28
28
  {%- set buttonVariant = params.variant | default("primary") %}
29
- {%- set emphasis = params.emphasis | default("default") %}
30
29
 
31
- {% if params.variant == "staticWhite" %}
32
- {% if emphasis == "transparent" or emphasis == "outline" %}
33
- {%- set spinnerVariant = "staticWhite" %}
34
- {% else %}
30
+ {% if params.variant == "staticWhite" or params.variant == "transparent" %}
35
31
  {%- set spinnerVariant = "staticBlack" %}
36
- {% endif %}
37
- {% elif emphasis == "transparent" or emphasis == "outline" or params.variant == "secondary" %}
32
+ {% elif params.variant == "secondaryFilled" or params.variant == "secondaryOutline" %}
38
33
  {%- set spinnerVariant = "primary" %}
39
34
  {% else %}
40
35
  {%- set spinnerVariant = "secondary" %}
@@ -44,21 +39,19 @@
44
39
  {{ Spinner({ size: 'small', variant: spinnerVariant, forcePx: params.forcePx, attributes: { "aria-hidden": "true" } }) }}
45
40
  {% endset %}
46
41
 
47
- {%- if params.iconName and ((params.iconPosition and params.iconPosition != "none") or params.isIconBtn == true) %}
42
+ {%- if params.iconName and ((params.iconPosition and params.iconPosition != "none") or params.isIconButton == true) %}
48
43
  {% set iconSvg = IconUse({ icon: params.iconName, attributes: { "aria-hidden": "true" } }) %}
49
44
  {% endif %}
50
45
 
51
46
  {%- set classes = [
52
47
  componentClassName,
53
48
  classNamePrefix + buttonVariant,
54
- classNamePrefix + emphasis,
55
49
  classNamePrefix + "selected" if params.selected,
56
- classNamePrefix + params.size if params.size else classNamePrefix + "large",
50
+ classNamePrefix + params.size if params.size else classNamePrefix + "lg",
57
51
  classNamePrefix + "full-width" if params.fullWidth,
58
52
  classNamePrefix + "mobile-full-width" if params.mobile and params.mobile.fullWidth,
59
- classNamePrefix + "icon-" + params.iconPosition if iconSvg and not params.isIconBtn,
60
- classNamePrefix + "icon-only" if params.isIconBtn,
61
- classNamePrefix + "rounded" if params.rounded,
53
+ classNamePrefix + "icon-" + params.iconPosition if iconSvg and not params.isIconButton,
54
+ classNamePrefix + "icon-only" if params.isIconButton,
62
55
  classNamePrefix + "toggle" if params.isToggle,
63
56
  classNamePrefix + "selected" if params.isToggle and params.selected,
64
57
  "ds-loading" if params.loading,
@@ -68,7 +61,7 @@
68
61
 
69
62
  {%- if params.isToggle %}
70
63
  {% call ToggleWrapper({ ariaLabel: ariaLabel, selected: params.selected, classes: classes, attributes: attributes, disabled: params.disabled, loadingHtml: loadingHtml }) %}
71
- {%- if params.isIconBtn %}
64
+ {%- if params.isIconButton %}
72
65
  <span class="ds-btn__off" aria-hidden="true">{{ IconUse({ icon: params.iconName }) }}</span>
73
66
  <span class="ds-btn__on" aria-hidden="true">{{ IconUse({ icon: params.selectedIconName }) }}</span>
74
67
  {% else %}
@@ -82,7 +75,7 @@
82
75
  {% if params.href %}
83
76
  {% set loadingHtml = null %}
84
77
  {% endif %}
85
- {% set buttonParams = { isIconButton: params.isIconBtn, a11y: params.a11y, text: text, iconSvg: iconSvg, loadingHtml: loadingHtml , attributes: params.attributes } %}
78
+ {% set buttonParams = { isIconButton: params.isIconButton, a11y: params.a11y, text: text, iconSvg: iconSvg, loadingHtml: loadingHtml , attributes: params.attributes } %}
86
79
  {%- if params.href %}
87
80
  <a href="{{ params.href | default('#', true) }}" {{ ariaLabel | safe }} class="{{ classes }}" {{- attributes | safe }}>
88
81
  {{ InnerButton(buttonParams) }}
@@ -19,7 +19,7 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
19
19
 
20
20
  cursor: pointer;
21
21
  border: $ds-btn-outlined__border-width solid var(--ds-btn__border-color);
22
- border-radius: ds-border-radius(012);
22
+ border-radius: 100px;
23
23
  position: relative;
24
24
  background-color: var(--ds-btn__background-color);
25
25
  color: var(--ds-btn__color);
@@ -32,66 +32,35 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
32
32
  }
33
33
 
34
34
  &.ds-btn--primary {
35
- &.ds-btn--default,
36
- &.ds-btn--elevated {
37
- --ds-btn__background-color: #{$ds-color-surface-primaryinvert};
38
- --ds-btn__color: #{$ds-color-text-primaryinvert};
39
- }
40
- &.ds-btn--outline {
41
- --ds-btn__border-color: #{$ds-color-border-primary-strongest};
42
- --ds-btn__color: #{$ds-color-text-primary};
43
- }
44
- &.ds-btn--transparent {
45
- --ds-btn__color: #{$ds-color-text-primary};
46
- }
35
+ --ds-btn__background-color: #{$ds-color-brand-600};
36
+ --ds-btn__color: #{$ds-color-text-on-brand};
47
37
  }
48
38
 
49
- &.ds-btn--secondary {
50
- &.ds-btn--default,
51
- &.ds-btn--elevated {
52
- --ds-btn__background-color: #{$ds-color-surface-primary-raised-strong};
53
- --ds-btn__color: #{$ds-color-text-primary};
54
- }
55
- &.ds-btn--outline {
56
- --ds-btn__border-color: #{$ds-color-border-primary-strong};
57
- --ds-btn__color: #{$ds-color-text-primary};
58
- }
59
- &.ds-btn--transparent {
60
- --ds-btn__color: #{$ds-color-text-primary};
61
- }
39
+ &.ds-btn--primaryBlack {
40
+ --ds-btn__background-color: #{$ds-color-surface-primaryinvert};
41
+ --ds-btn__color: #{$ds-color-text-primaryinvert};
62
42
  }
63
43
 
64
- &.ds-btn--brand {
65
- --ds-btn__outline-color: #{$ds-color-border-brand};
66
- &.ds-btn--default,
67
- &.ds-btn--elevated {
68
- --ds-btn__background-color: #{$ds-color-surface-brand};
69
- --ds-btn__color: #{$ds-color-neutral-white};
70
- }
71
- &.ds-btn--outline {
72
- --ds-btn__border-color: #{$ds-color-surface-brand};
73
- --ds-btn__color: #{$ds-color-text-brand};
74
- }
75
- &.ds-btn--transparent {
76
- --ds-btn__color: #{$ds-color-text-brand};
77
- }
44
+ &.ds-btn--secondaryFilled {
45
+ --ds-btn__background-color: #{$ds-color-surface-primary-raised-strong};
46
+ --ds-btn__color: #{$ds-color-text-primary};
47
+ }
48
+
49
+ &.ds-btn--secondaryOutline {
50
+ --ds-btn__background-color: transparent;
51
+ --ds-btn__color: #{$ds-color-text-primary};
52
+ --ds-btn__border-color: #{$ds-color-border-primary-strong};
78
53
  }
79
54
 
80
55
  &.ds-btn--staticWhite {
81
56
  --ds-btn__outline-color: #{$ds-color-neutral-white};
82
- &.ds-btn--default,
83
- &.ds-btn--elevated {
84
- --ds-btn__background-color: #{$ds-color-neutral-white};
85
- --ds-btn__color: #{$ds-color-neutral-black};
86
- }
87
- &.ds-btn--outline {
88
- --ds-btn__background-color: transparent;
89
- --ds-btn__border-color: #{$ds-color-neutral-white};
90
- --ds-btn__color: #{$ds-color-neutral-white};
91
- }
92
- &.ds-btn--transparent {
93
- --ds-btn__color: #{$ds-color-neutral-white};
94
- }
57
+ --ds-btn__background-color: #{$ds-color-neutral-white};
58
+ --ds-btn__color: #{$ds-color-neutral-black};
59
+ }
60
+
61
+ &.ds-btn--transparent {
62
+ --ds-btn__color: #{$ds-color-text-primary};
63
+ --ds-btn__background-color: transparent;
95
64
  }
96
65
 
97
66
  &.ds-btn--toggle.ds-btn--selected:not(.ds-btn--icon-only) {
@@ -100,83 +69,87 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
100
69
  --ds-btn__border-color: #{$ds-color-border-primary-strongest};
101
70
  --ds-btn__outline-color: #{$ds-color-border-primary-strongest};
102
71
  }
103
- &.ds-btn--transparent {
104
- --ds-btn__background-color: transparent;
105
- }
106
-
107
- &.ds-btn--rounded {
108
- border-radius: 100px;
109
- }
110
72
 
111
- &.ds-btn--elevated {
112
- box-shadow: ds-shadow-get-box-shadow($ds-shadow-elevation-md);
113
- }
114
-
115
- &.ds-btn--small {
73
+ &.ds-btn--sm {
116
74
  --ds-btn__icon-size: #{ds-px-to-rem(20px)};
117
75
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050), true)};
76
+ --ds-btn__icon-only-padding: #{ds-px-to-rem(5px)};
118
77
  padding: _btn-brdr(ds-spacing($ds-s-025), true) _btn-brdr(ds-spacing($ds-s-075), true);
119
- @include ds-typography($variable: $ds-typography-functional-body-sm, $fontWeight: $ds-fontweight-semibold);
78
+ @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-medium);
120
79
  @at-root .ds-force-px#{&} {
121
80
  --ds-btn__icon-size: 20px;
122
81
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050))};
82
+ --ds-btn__icon-only-padding: 5px;
123
83
  padding: _btn-brdr(ds-spacing($ds-s-025)) _btn-brdr(ds-spacing($ds-s-075));
124
84
  @include ds-typography(
125
- $variable: $ds-typography-functional-body-sm,
126
- $fontWeight: $ds-fontweight-semibold,
85
+ $variable: $ds-typography-functional-body-md,
86
+ $fontWeight: $ds-fontweight-medium,
127
87
  $forcePx: true
128
88
  );
129
89
  }
130
90
  }
131
91
 
132
- &.ds-btn--medium {
92
+ &.ds-btn--md {
133
93
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100), true)};
94
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-050), true)};
134
95
  padding: _btn-brdr(ds-spacing($ds-s-050), true) _btn-brdr(ds-spacing($ds-s-125), true);
135
- @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-semibold);
96
+ @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-medium);
136
97
  @at-root .ds-force-px#{&} {
137
98
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100))};
99
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-050))};
138
100
  padding: _btn-brdr(ds-spacing($ds-s-050)) _btn-brdr(ds-spacing($ds-s-125));
139
101
  @include ds-typography(
140
102
  $variable: $ds-typography-functional-body-md,
141
- $fontWeight: $ds-fontweight-semibold,
103
+ $fontWeight: $ds-fontweight-medium,
142
104
  $forcePx: true
143
105
  );
144
106
  }
145
107
  }
146
108
 
147
- &.ds-btn--large {
109
+ &.ds-btn--lg {
148
110
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125), true)};
111
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-075), true)};
149
112
  padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-150), true);
150
- @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-semibold);
113
+ @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-medium);
151
114
 
152
115
  @at-root .ds-force-px#{&} {
153
116
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125))};
117
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-075))};
154
118
  padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-150));
155
119
  @include ds-typography(
156
120
  $variable: $ds-typography-functional-body-md,
157
- $fontWeight: $ds-fontweight-semibold,
121
+ $fontWeight: $ds-fontweight-medium,
158
122
  $forcePx: true
159
123
  );
160
124
  }
161
125
  }
162
126
 
163
- &.ds-btn--xlarge {
164
- --ds-btn__icon-size: #{ds-px-to-rem(32px)};
127
+ &.ds-btn--xl {
128
+ --ds-btn__icon-size: #{ds-px-to-rem(24px)};
165
129
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200), true) - ds-px-to-rem(4px)};
166
- padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-200), true);
167
- @include ds-typography($variable: $ds-typography-functional-body-lg, $fontWeight: $ds-fontweight-semibold);
130
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-100), true)};
131
+ padding: _btn-brdr(ds-spacing($ds-s-100), true) _btn-brdr(ds-spacing($ds-s-200), true);
132
+ @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-medium);
168
133
  @at-root .ds-force-px#{&} {
169
- --ds-btn__icon-size: 32px;
134
+ --ds-btn__icon-size: 24px;
170
135
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200)) - 4px};
171
- padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-200));
136
+ --ds-btn__icon-only-padding: #{_btn-brdr(ds-spacing($ds-s-200))};
137
+ padding: _btn-brdr(ds-spacing($ds-s-100)) _btn-brdr(ds-spacing($ds-s-200));
172
138
  @include ds-typography(
173
- $variable: $ds-typography-functional-body-lg,
174
- $fontWeight: $ds-fontweight-semibold,
139
+ $variable: $ds-typography-functional-body-md,
140
+ $fontWeight: $ds-fontweight-medium,
175
141
  $forcePx: true
176
142
  );
177
143
  }
178
144
  }
179
145
 
146
+ &.ds-btn--icon-only {
147
+ padding: var(--ds-btn__icon-only-padding);
148
+ @at-root .ds-force-px#{&} {
149
+ padding: var(--ds-btn__icon-only-padding);
150
+ }
151
+ }
152
+
180
153
  span {
181
154
  pointer-events: none;
182
155
  }
@@ -267,7 +240,7 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
267
240
  margin: ds-spacing(0 0 0 $ds-s-050);
268
241
  }
269
242
  }
270
- &.ds-btn--small .ds-icon {
243
+ &.ds-btn--sm .ds-icon {
271
244
  margin: ds-spacing(0 0 0 $ds-s-025, rem);
272
245
  @at-root .ds-force-px#{&} {
273
246
  margin: ds-spacing(0 0 0 $ds-s-025);
@@ -281,7 +254,7 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
281
254
  .ds-icon {
282
255
  margin: ds-spacing(0 $ds-s-050 0 0, rem);
283
256
  }
284
- &.ds-btn--small .ds-icon {
257
+ &.ds-btn--sm .ds-icon {
285
258
  margin: ds-spacing(0 $ds-s-025 0 0, rem);
286
259
  }
287
260
  &.ds-force-px {
@@ -289,7 +262,7 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
289
262
  .ds-icon {
290
263
  margin: ds-spacing(0 $ds-s-050 0 0);
291
264
  }
292
- &.ds-btn--small .ds-icon {
265
+ &.ds-btn--sm .ds-icon {
293
266
  margin: ds-spacing(0 $ds-s-025 0 0);
294
267
  }
295
268
  }
@@ -16,24 +16,27 @@ The component will not include styling by itself. Make sure to include the right
16
16
 
17
17
  | Name | Description | Default |
18
18
  |:--- | :--- | :--- |
19
- | selectedText\* | string | \- |
20
- | variant | "brand", "secondary", "primary" | "primary" |
19
+ | isIconButton | boolean | false |
20
+ | selectedText | string | \- |
21
+ | variant | Design variant<br />"primary", "staticWhite", "primaryBlack", "secondaryFilled", "secondaryOutline", "transparent" | "primary" |
21
22
  | disabled | Note: only works on button-tag, not on a-tag<br />boolean | false |
23
+ | iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "bookmark-filled", "bookmarked", "campaign" | \- |
22
24
  | classNames | string | \- |
23
25
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />{ \[key: string\]: string; } | { } |
24
26
  | forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | false |
25
- | size | "large", "small", "medium", "xlarge" | "medium" |
27
+ | size | "sm", "md", "lg", "xl" | "md" |
26
28
  | loading | boolean | false |
27
29
  | text | string | \- |
28
30
  | selected | boolean | false |
31
+ | selectedIconName | "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "bookmark-filled", "bookmarked", "campaign" | \- |
29
32
  | fullWidth | Button will be full width on both desktop and mobile<br />boolean | false |
30
33
  | mobileFullWidth | Button will only full width on mobile<br />boolean | false |
31
34
 
32
35
  ```jsx
33
36
  <ButtonToggle
34
37
  selectedText="Följer"
35
- size="large"
38
+ size="lg"
36
39
  text="Följ"
37
- variant="brand"
40
+ variant="primary"
38
41
  />
39
42
  ```
@@ -12,6 +12,9 @@
12
12
  size: params.size,
13
13
  fullWidth: params.fullWidth,
14
14
  mobile: params.mobile,
15
+ isIconButton: params.isIconButton,
16
+ iconName: params.iconName,
17
+ selectedIconName: params.selectedIconName,
15
18
  loading: params.loading,
16
19
  forcePx: params.forcePx,
17
20
  classNames: params.classNames,
@@ -8,7 +8,7 @@ The component will not include styling by itself. Make sure to include the right
8
8
 
9
9
  | Name | Description | Default |
10
10
  |:--- | :--- | :--- |
11
- | variant | "medium", "soft", "hard" | "soft" |
11
+ | variant | "soft", "medium", "hard" | "soft" |
12
12
  | classNames | string | \- |
13
13
  | attributes | object | \- |
14
14
 
@@ -35,7 +35,7 @@
35
35
  {% if params.brandButton %}
36
36
  {{ Button({
37
37
  text: params.brandButton.text,
38
- variant: "brand",
38
+ variant: "primary",
39
39
  href: params.brandButton.href,
40
40
  classNames: params.brandButton.classNames,
41
41
  attributes: params.brandButton.attributes,
@@ -47,8 +47,7 @@
47
47
  {% if params.primaryButton %}
48
48
  {{ Button({
49
49
  text: params.primaryButton.text,
50
- variant: "primary",
51
- emphasis: "outline",
50
+ variant: "secondaryOutline",
52
51
  href: params.primaryButton.href,
53
52
  classNames: params.primaryButton.classNames,
54
53
  attributes: params.primaryButton.attributes,
@@ -29,8 +29,8 @@
29
29
  <div class="{{ componentClassName + '__show-more'}}">
30
30
  {{ Button({
31
31
  text: 'Visa mer',
32
- variant: 'secondary',
33
- size: 'medium',
32
+ variant: 'secondaryFilled',
33
+ size: 'md',
34
34
  iconPosition: 'right',
35
35
  iconName: 'expand_more',
36
36
  classNames: 'ds-factbox__expand-more',
@@ -40,8 +40,8 @@
40
40
  })}}
41
41
  {{ Button({
42
42
  text: 'Visa mindre',
43
- variant: 'secondary',
44
- size: 'medium',
43
+ variant: 'secondaryFilled',
44
+ size: 'md',
45
45
  iconPosition: 'right',
46
46
  iconName: 'expand_less',
47
47
  classNames: 'ds-factbox__expand-less',
@@ -1,7 +1,7 @@
1
1
  {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
2
  {% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
3
3
  {% from '@bonniernews/dn-design-system-web/components/button-toggle/button-toggle.njk' import ButtonToggle %}
4
- {% from '@bonniernews/dn-design-system-web/components/icon-button/icon-button.njk' import IconButton %}
4
+ {% from '@bonniernews/dn-design-system-web/components/button/button.njk' import Button %}
5
5
 
6
6
  {% macro GroupHeader(params) %}
7
7
  {% set componentClassName = "ds-group-header" %}
@@ -49,8 +49,8 @@
49
49
  {# there is no static-white toggle btn so it is disabled for bauta for now #}
50
50
  {% if params.type == 'toggle' and not params.variant %}
51
51
  {{ ButtonToggle({
52
- variant: "brand",
53
- size: 'small',
52
+ variant: "primary",
53
+ size: 'sm',
54
54
  text: params.toggleText,
55
55
  selectedText: params.toggleSelectedText,
56
56
  selected: params.toggleSelected,
@@ -59,20 +59,20 @@
59
59
  attributes: params.toggleAttributes
60
60
  }) }}
61
61
  {% elif (params.type == 'arrows') %}
62
- {% set buttonVariant = "staticWhite" if params.variant else "primary" %}
62
+ {% set buttonVariant = "staticWhite" if params.variant else "secondaryOutline" %}
63
63
  <div class="{{ componentClassName + '__arrows' }} hidden-mobile hidden-tablet">
64
- {{ IconButton({
64
+ {{ Button({
65
65
  variant: buttonVariant,
66
- emphasis: "outline",
67
- size: "small",
66
+ size: "sm",
67
+ isIconButton: true,
68
68
  iconName: "arrow_back",
69
69
  classNames: "ds-group-header__arrow ds-group-header__arrow--left",
70
70
  attributes: {"aria-label": "Föregående"}
71
71
  }) }}
72
- {{ IconButton({
72
+ {{ Button({
73
73
  variant: buttonVariant,
74
- emphasis: "outline",
75
- size: "small",
74
+ size: "sm",
75
+ isIconButton: true,
76
76
  iconName: "arrow_forward",
77
77
  classNames: "ds-group-header__arrow ds-group-header__arrow--right",
78
78
  attributes: {"aria-label": "Nästa"}