@dnb/eufemia 9.23.1 → 9.24.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 (179) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/cjs/components/avatar/Avatar.d.ts +6 -5
  3. package/cjs/components/avatar/Avatar.js +4 -8
  4. package/cjs/components/breadcrumb/Breadcrumb.d.ts +0 -6
  5. package/cjs/components/breadcrumb/Breadcrumb.js +1 -7
  6. package/cjs/components/dialog/Dialog.d.ts +2 -1
  7. package/cjs/components/dialog/Dialog.js +79 -51
  8. package/cjs/components/dialog/DialogContent.d.ts +1 -1
  9. package/cjs/components/dialog/DialogContent.js +50 -12
  10. package/cjs/components/dialog/parts/DialogAction.d.ts +34 -0
  11. package/cjs/components/dialog/parts/DialogAction.js +136 -0
  12. package/cjs/components/dialog/style/_dialog.scss +152 -72
  13. package/cjs/components/dialog/style/dnb-dialog.css +352 -199
  14. package/cjs/components/dialog/style/dnb-dialog.min.css +1 -1
  15. package/cjs/components/dialog/types.d.ts +20 -2
  16. package/cjs/components/drawer/style/dnb-drawer.css +177 -100
  17. package/cjs/components/drawer/style/dnb-drawer.min.css +1 -1
  18. package/cjs/components/form-status/FormStatus.d.ts +19 -2
  19. package/cjs/components/form-status/FormStatus.js +27 -3
  20. package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
  21. package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
  22. package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
  23. package/cjs/components/info-card/InfoCard.d.ts +0 -9
  24. package/cjs/components/info-card/InfoCard.js +0 -9
  25. package/cjs/components/modal/Modal.d.ts +1 -0
  26. package/cjs/components/modal/Modal.js +1 -1
  27. package/cjs/components/modal/ModalContent.js +13 -5
  28. package/cjs/components/modal/parts/CloseButton.d.ts +1 -0
  29. package/cjs/components/modal/style/_modal.scss +1 -0
  30. package/cjs/components/modal/style/dnb-modal.css +177 -100
  31. package/cjs/components/modal/style/dnb-modal.min.css +1 -1
  32. package/cjs/components/modal/types.d.ts +9 -1
  33. package/cjs/components/number-format/NumberFormat.d.ts +7 -1
  34. package/cjs/components/number-format/NumberFormat.js +5 -1
  35. package/cjs/components/number-format/NumberUtils.d.ts +12 -3
  36. package/cjs/components/number-format/NumberUtils.js +106 -7
  37. package/cjs/components/tag/Tag.d.ts +5 -6
  38. package/cjs/components/tag/Tag.js +3 -8
  39. package/cjs/fragments/drawer-list/DrawerList.js +1 -1
  40. package/cjs/fragments/drawer-list/DrawerListHelpers.js +3 -1
  41. package/cjs/shared/Context.d.ts +2 -0
  42. package/cjs/shared/Context.js +1 -0
  43. package/cjs/shared/Eufemia.js +1 -1
  44. package/cjs/shared/locales/en-GB.d.ts +4 -0
  45. package/cjs/shared/locales/en-GB.js +4 -0
  46. package/cjs/shared/locales/en-US.d.ts +4 -0
  47. package/cjs/shared/locales/index.d.ts +8 -0
  48. package/cjs/shared/locales/nb-NO.d.ts +4 -0
  49. package/cjs/shared/locales/nb-NO.js +4 -0
  50. package/cjs/shared/useTranslation.d.ts +1 -0
  51. package/cjs/style/dnb-ui-components.css +177 -100
  52. package/cjs/style/dnb-ui-components.min.css +2 -2
  53. package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
  54. package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
  55. package/cjs/style/themes/theme-ui/dnb-theme-ui.css +16 -0
  56. package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
  57. package/components/avatar/Avatar.d.ts +6 -5
  58. package/components/avatar/Avatar.js +4 -8
  59. package/components/breadcrumb/Breadcrumb.d.ts +0 -6
  60. package/components/breadcrumb/Breadcrumb.js +1 -7
  61. package/components/dialog/Dialog.d.ts +2 -1
  62. package/components/dialog/Dialog.js +78 -52
  63. package/components/dialog/DialogContent.d.ts +1 -1
  64. package/components/dialog/DialogContent.js +46 -9
  65. package/components/dialog/parts/DialogAction.d.ts +34 -0
  66. package/components/dialog/parts/DialogAction.js +96 -0
  67. package/components/dialog/style/_dialog.scss +152 -72
  68. package/components/dialog/style/dnb-dialog.css +352 -199
  69. package/components/dialog/style/dnb-dialog.min.css +1 -1
  70. package/components/dialog/types.d.ts +20 -2
  71. package/components/drawer/style/dnb-drawer.css +177 -100
  72. package/components/drawer/style/dnb-drawer.min.css +1 -1
  73. package/components/form-status/FormStatus.d.ts +19 -2
  74. package/components/form-status/FormStatus.js +23 -2
  75. package/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
  76. package/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
  77. package/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
  78. package/components/info-card/InfoCard.d.ts +0 -9
  79. package/components/info-card/InfoCard.js +0 -9
  80. package/components/modal/Modal.d.ts +1 -0
  81. package/components/modal/Modal.js +1 -1
  82. package/components/modal/ModalContent.js +13 -5
  83. package/components/modal/parts/CloseButton.d.ts +1 -0
  84. package/components/modal/style/_modal.scss +1 -0
  85. package/components/modal/style/dnb-modal.css +177 -100
  86. package/components/modal/style/dnb-modal.min.css +1 -1
  87. package/components/modal/types.d.ts +9 -1
  88. package/components/number-format/NumberFormat.d.ts +7 -1
  89. package/components/number-format/NumberFormat.js +5 -1
  90. package/components/number-format/NumberUtils.d.ts +12 -3
  91. package/components/number-format/NumberUtils.js +105 -7
  92. package/components/tag/Tag.d.ts +5 -6
  93. package/components/tag/Tag.js +3 -8
  94. package/es/components/avatar/Avatar.d.ts +6 -5
  95. package/es/components/avatar/Avatar.js +5 -9
  96. package/es/components/breadcrumb/Breadcrumb.d.ts +0 -6
  97. package/es/components/breadcrumb/Breadcrumb.js +1 -7
  98. package/es/components/dialog/Dialog.d.ts +2 -1
  99. package/es/components/dialog/Dialog.js +50 -22
  100. package/es/components/dialog/DialogContent.d.ts +1 -1
  101. package/es/components/dialog/DialogContent.js +40 -8
  102. package/es/components/dialog/parts/DialogAction.d.ts +34 -0
  103. package/es/components/dialog/parts/DialogAction.js +82 -0
  104. package/es/components/dialog/style/_dialog.scss +152 -72
  105. package/es/components/dialog/style/dnb-dialog.css +352 -199
  106. package/es/components/dialog/style/dnb-dialog.min.css +1 -1
  107. package/es/components/dialog/types.d.ts +20 -2
  108. package/es/components/drawer/style/dnb-drawer.css +177 -100
  109. package/es/components/drawer/style/dnb-drawer.min.css +1 -1
  110. package/es/components/form-status/FormStatus.d.ts +19 -2
  111. package/es/components/form-status/FormStatus.js +21 -2
  112. package/es/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
  113. package/es/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
  114. package/es/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
  115. package/es/components/info-card/InfoCard.d.ts +0 -9
  116. package/es/components/info-card/InfoCard.js +0 -9
  117. package/es/components/modal/Modal.d.ts +1 -0
  118. package/es/components/modal/Modal.js +1 -1
  119. package/es/components/modal/ModalContent.js +13 -6
  120. package/es/components/modal/parts/CloseButton.d.ts +1 -0
  121. package/es/components/modal/style/_modal.scss +1 -0
  122. package/es/components/modal/style/dnb-modal.css +177 -100
  123. package/es/components/modal/style/dnb-modal.min.css +1 -1
  124. package/es/components/modal/types.d.ts +9 -1
  125. package/es/components/number-format/NumberFormat.d.ts +7 -1
  126. package/es/components/number-format/NumberFormat.js +5 -1
  127. package/es/components/number-format/NumberUtils.d.ts +12 -3
  128. package/es/components/number-format/NumberUtils.js +101 -7
  129. package/es/components/tag/Tag.d.ts +5 -6
  130. package/es/components/tag/Tag.js +3 -8
  131. package/es/fragments/drawer-list/DrawerList.js +1 -1
  132. package/es/fragments/drawer-list/DrawerListHelpers.js +3 -1
  133. package/es/shared/Context.d.ts +2 -0
  134. package/es/shared/Context.js +1 -0
  135. package/es/shared/Eufemia.js +1 -1
  136. package/es/shared/locales/en-GB.d.ts +4 -0
  137. package/es/shared/locales/en-GB.js +4 -0
  138. package/es/shared/locales/en-US.d.ts +4 -0
  139. package/es/shared/locales/index.d.ts +8 -0
  140. package/es/shared/locales/nb-NO.d.ts +4 -0
  141. package/es/shared/locales/nb-NO.js +4 -0
  142. package/es/shared/useTranslation.d.ts +1 -0
  143. package/es/style/dnb-ui-components.css +177 -100
  144. package/es/style/dnb-ui-components.min.css +2 -2
  145. package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
  146. package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
  147. package/es/style/themes/theme-ui/dnb-theme-ui.css +16 -0
  148. package/es/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
  149. package/esm/dnb-ui-basis.min.mjs +1 -1
  150. package/esm/dnb-ui-components.min.mjs +1 -1
  151. package/esm/dnb-ui-elements.min.mjs +1 -1
  152. package/esm/dnb-ui-extensions.min.mjs +3 -3
  153. package/esm/dnb-ui-lib.min.mjs +3 -3
  154. package/esm/dnb-ui-web-components.min.mjs +2 -2
  155. package/fragments/drawer-list/DrawerList.js +1 -1
  156. package/fragments/drawer-list/DrawerListHelpers.js +3 -1
  157. package/package.json +1 -1
  158. package/shared/Context.d.ts +2 -0
  159. package/shared/Context.js +1 -0
  160. package/shared/Eufemia.js +1 -1
  161. package/shared/locales/en-GB.d.ts +4 -0
  162. package/shared/locales/en-GB.js +4 -0
  163. package/shared/locales/en-US.d.ts +4 -0
  164. package/shared/locales/index.d.ts +8 -0
  165. package/shared/locales/nb-NO.d.ts +4 -0
  166. package/shared/locales/nb-NO.js +4 -0
  167. package/shared/useTranslation.d.ts +1 -0
  168. package/style/dnb-ui-components.css +177 -100
  169. package/style/dnb-ui-components.min.css +2 -2
  170. package/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
  171. package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
  172. package/style/themes/theme-ui/dnb-theme-ui.css +16 -0
  173. package/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
  174. package/umd/dnb-ui-basis.min.js +1 -1
  175. package/umd/dnb-ui-components.min.js +1 -1
  176. package/umd/dnb-ui-elements.min.js +1 -1
  177. package/umd/dnb-ui-extensions.min.js +2 -2
  178. package/umd/dnb-ui-lib.min.js +4 -4
  179. package/umd/dnb-ui-web-components.min.js +2 -2
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ declare type extendedMouseEvent = {
3
+ event: React.MouseEvent<HTMLElement>;
4
+ close: () => void;
5
+ };
6
+ interface DialogActionProps {
7
+ /**
8
+ * For dialog actions, give a custom text for the decline button.
9
+ */
10
+ declineText?: string;
11
+ /**
12
+ * For dialog actions, give a custom text for the confirm button.
13
+ */
14
+ confirmText?: string;
15
+ /**
16
+ * For variant confirmation, handle the confirm action click.
17
+ */
18
+ onConfirm?: (event: extendedMouseEvent) => void;
19
+ /**
20
+ * For variant confirmation, handle the decline action click.
21
+ */
22
+ onDecline?: (event: extendedMouseEvent) => void;
23
+ /**
24
+ * For variant confirmation, hide the default decline button and only show the confirm button.
25
+ */
26
+ hideDecline?: boolean;
27
+ /**
28
+ * Pass in custom confirm/decline buttons for action handling. Every child of type Button will be provided with a `close` function attribute.
29
+ */
30
+ children?: React.ReactElement | Array<React.ReactElement>;
31
+ }
32
+ declare const DialogAction: ({ declineText, confirmText, hideDecline, onConfirm, onDecline, children, }: DialogActionProps) => JSX.Element;
33
+ export default DialogAction;
34
+ export type { DialogActionProps };
@@ -0,0 +1,82 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
+
7
+ import React, { useContext } from 'react';
8
+ import Button from '../../button/Button';
9
+ import { Context } from '../../../shared';
10
+ import ModalContext from '../../modal/ModalContext';
11
+ import { dispatchCustomElementEvent } from '../../../shared/component-helper';
12
+
13
+ const fallbackCloseAction = ({
14
+ close
15
+ }) => close();
16
+
17
+ const DialogAction = ({
18
+ declineText = null,
19
+ confirmText = null,
20
+ hideDecline = false,
21
+ onConfirm = fallbackCloseAction,
22
+ onDecline = fallbackCloseAction,
23
+ children
24
+ }) => {
25
+ var _translation$Dialog, _translation$Dialog2;
26
+
27
+ const {
28
+ translation,
29
+ Button: ButtonContext
30
+ } = useContext(Context);
31
+ const {
32
+ close
33
+ } = useContext(ModalContext);
34
+ let childrenWithCloseFunc;
35
+
36
+ if (children) {
37
+ childrenWithCloseFunc = React.Children.map(children, child => {
38
+ if (child.type === Button) {
39
+ return React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
40
+ on_click: event => {
41
+ dispatchCustomElementEvent(child.props, 'on_click', {
42
+ event,
43
+ close
44
+ });
45
+ }
46
+ }), child.props.children);
47
+ } else {
48
+ return child;
49
+ }
50
+ });
51
+ }
52
+
53
+ return React.createElement("div", {
54
+ className: "dnb-dialog__actions"
55
+ }, childrenWithCloseFunc, !children && !hideDecline && React.createElement(Button, {
56
+ text: declineText || (translation === null || translation === void 0 ? void 0 : (_translation$Dialog = translation.Dialog) === null || _translation$Dialog === void 0 ? void 0 : _translation$Dialog.declineText),
57
+ variant: "secondary",
58
+ onClick: event => {
59
+ dispatchCustomElementEvent({
60
+ onDecline
61
+ }, 'onDecline', {
62
+ event,
63
+ close
64
+ });
65
+ },
66
+ size: (ButtonContext === null || ButtonContext === void 0 ? void 0 : ButtonContext.size) || 'large'
67
+ }), !children && React.createElement(Button, {
68
+ text: confirmText || (translation === null || translation === void 0 ? void 0 : (_translation$Dialog2 = translation.Dialog) === null || _translation$Dialog2 === void 0 ? void 0 : _translation$Dialog2.confirmText),
69
+ variant: "primary",
70
+ onClick: event => {
71
+ dispatchCustomElementEvent({
72
+ onConfirm
73
+ }, 'onConfirm', {
74
+ event,
75
+ close
76
+ });
77
+ },
78
+ size: (ButtonContext === null || ButtonContext === void 0 ? void 0 : ButtonContext.size) || 'large'
79
+ }));
80
+ };
81
+
82
+ export default DialogAction;
@@ -9,28 +9,34 @@
9
9
  // we do this because SCSS fails by using min(100vw, 50rem) = "Incompatible units: 'rem' and 'vw'"
10
10
  --dialog-min-width: 320px; // use px, so larger font-size don't enlarge the min, has to be under 20rem, because of spacing and later mobile fullscreen
11
11
  --dialog-avg-width: 60vw; // content defines the size
12
- --dialog-max-width: 60rem; // because of our default width --layout-large
12
+ --dialog-max-width: 49rem; // because of our default width --layout-large
13
+ --dialog-confirm-max-width: 40rem;
13
14
  --dialog-spacing: 2rem; // should reflect --spacing-large
14
15
  --dialog-spacing-minus: -2rem; // should reflect --spacing-large
15
16
  }
16
17
 
17
18
  .dnb-dialog {
18
19
  position: relative;
19
-
20
- width: var(--dialog-avg-width);
21
- min-width: var(--dialog-min-width);
22
- max-width: var(--dialog-max-width);
23
20
  max-height: 100vh;
24
-
25
- @include defaultDropShadow();
26
21
  border-radius: 0.5rem;
22
+ @include defaultDropShadow();
27
23
 
28
24
  user-select: text;
29
25
  -webkit-user-select: text; // Safari / Touch fix
30
26
  border: none;
31
-
32
27
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
33
28
 
29
+ &--information {
30
+ min-width: var(--dialog-min-width);
31
+ width: var(--dialog-avg-width);
32
+ max-width: var(--dialog-max-width);
33
+ }
34
+
35
+ &--confirmation {
36
+ max-width: var(--dialog-confirm-max-width);
37
+ margin: 0 1rem;
38
+ }
39
+
34
40
  &--auto-fullscreen {
35
41
  @include allBelow(small) {
36
42
  @include modalFullscreen();
@@ -39,14 +45,43 @@
39
45
  &--fullscreen {
40
46
  @include modalFullscreen();
41
47
  }
48
+ &--spacing#{&}--information &__content {
49
+ padding-bottom: calc(var(--dialog-spacing) * 2);
42
50
 
43
- @include IS_SAFARI_MOBILE() {
44
- // iOS on iPhone fix
45
- // Because Safari includes the navigation bar on the height
46
- @media (max-height: 40em) and (orientation: landscape) {
47
- &:not(#{&}--fullscreen) {
48
- max-height: 80vh;
49
- }
51
+ @include IS_SAFARI_MOBILE {
52
+ padding-bottom: calc(var(--dialog-spacing) * 8);
53
+ }
54
+ }
55
+
56
+ &--spacing#{&}--information &__inner {
57
+ padding-left: calc(var(--dialog-spacing) * 1.75); // 3.5rem (56px)
58
+ padding-right: calc(var(--dialog-spacing) * 1.75); // 3.5rem (56px)
59
+
60
+ @include allBelow(large) {
61
+ padding-left: calc(var(--dialog-spacing)); // 2rem (32px)
62
+ padding-right: calc(var(--dialog-spacing)); // 2rem (32px)
63
+ }
64
+
65
+ @include allBelow(small) {
66
+ padding-left: calc(var(--dialog-spacing) / 2); // 1rem (16px)
67
+ padding-right: calc(var(--dialog-spacing) / 2); // 1rem (16px)
68
+ }
69
+ }
70
+
71
+ &--spacing#{&}--information &__navigation.dnb-section {
72
+ margin-top: calc(var(--dialog-spacing)); // 2rem (32px)
73
+ margin-bottom: calc(var(--dialog-spacing) / 2); // 1rem (16px)
74
+
75
+ @include allBelow(medium) {
76
+ margin-top: calc(var(--dialog-spacing) / 2); // 1rem (16px)
77
+ }
78
+ }
79
+
80
+ &--spacing#{&}--confirmation &__inner {
81
+ padding: calc(var(--dialog-spacing)); // 2rem (32px)
82
+
83
+ @include IS_SAFARI_MOBILE {
84
+ padding-bottom: calc(var(--dialog-spacing) * 8);
50
85
  }
51
86
  }
52
87
 
@@ -70,25 +105,98 @@
70
105
  }
71
106
  }
72
107
 
73
- // Padding right and left based on screen size
74
- &--spacing &__inner {
75
- // FOR DIALOG STYLES
76
- padding: 0 var(--dialog-spacing) 0;
108
+ &__align--centered &__inner {
109
+ align-items: center;
110
+ justify-content: center;
111
+ }
112
+ &__align--centered &__title,
113
+ &__align--centered#{&}--confirmation &__content {
114
+ text-align: center;
115
+ }
116
+
117
+ &__content {
118
+ position: relative;
119
+ z-index: 1;
120
+ }
121
+
122
+ &__actions {
123
+ padding-top: 1.5rem;
77
124
 
78
- @include allAbove(x-large) {
79
- padding: 0 calc(var(--dialog-spacing) * 1.75) 0; // 3.5rem (56px)
125
+ display: flex;
126
+ justify-content: center;
127
+ width: 100%;
128
+
129
+ > :not(:last-child) {
130
+ margin-right: 1rem;
80
131
  }
132
+ }
133
+
134
+ &__align--center &__content {
135
+ align-items: center;
136
+ text-align: center;
137
+ }
138
+
139
+ &__align--right &__content {
140
+ align-items: flex-end;
141
+ text-align: right;
142
+ }
143
+
144
+ &__title ~ &__content {
145
+ padding-top: calc(var(--dialog-spacing) / 2);
146
+ }
147
+
148
+ &__title {
81
149
  @include allBelow(medium) {
82
- padding: 0 calc(var(--dialog-spacing) / 1.333333) 0; // 2rem (32px)
150
+ font-size: var(--font-size-large) !important;
151
+ line-height: var(--line-height-medium) !important;
83
152
  }
84
153
  @include allBelow(small) {
85
- padding: 0 calc(var(--dialog-spacing) / 2) 0; // 1rem (16px)
154
+ font-size: var(--font-size-medium) !important;
155
+ line-height: calc(var(--line-height-medium) - 0.25rem) !important;
86
156
  }
87
157
  }
88
158
 
89
- &__align--centered &__inner {
90
- align-items: center;
91
- justify-content: center;
159
+ &--information &__title {
160
+ margin-bottom: var(--spacing-small) !important;
161
+ }
162
+
163
+ &--confirmation &__title {
164
+ margin-bottom: var(--spacing-x-small) !important;
165
+ }
166
+
167
+ &__navigation.dnb-section {
168
+ display: flex;
169
+ flex-direction: row;
170
+ justify-content: space-between;
171
+ }
172
+
173
+ &__icon {
174
+ // Modify the border prop from the icon component
175
+ &__primary.dnb-icon--border::after {
176
+ left: -50%;
177
+ right: -50%;
178
+ top: -50%;
179
+ bottom: -50%;
180
+
181
+ border: none;
182
+ background-color: currentColor;
183
+ opacity: 0.1;
184
+ }
185
+
186
+ &__primary#{&}--warning {
187
+ color: var(--color-fire-red);
188
+
189
+ ::after {
190
+ background-color: var(--color-fire-red-8);
191
+ }
192
+ }
193
+ &__primary#{&}--info {
194
+ color: var(--color-emerald-green);
195
+
196
+ ::after {
197
+ background-color: var(--color-pistachio);
198
+ }
199
+ }
92
200
  }
93
201
 
94
202
  // Animation in
@@ -110,35 +218,20 @@
110
218
  }
111
219
  }
112
220
 
113
- &__content {
114
- position: relative;
115
- z-index: 1;
116
- }
117
-
118
- &--spacing &__content {
221
+ &__body {
119
222
  padding-bottom: calc(var(--dialog-spacing) * 2);
120
-
121
- @include IS_SAFARI_MOBILE {
122
- padding-bottom: calc(var(--dialog-spacing) * 8);
123
- }
124
- }
125
-
126
- &__align--center &__content {
127
- align-items: center;
128
- text-align: center;
129
- }
130
-
131
- &__align--right &__content {
132
- align-items: flex-end;
133
- text-align: right;
223
+ margin-bottom: calc(var(--dialog-spacing-minus) * 2);
134
224
  }
135
225
 
136
- &__title ~ &__content {
137
- padding-top: calc(var(--dialog-spacing) / 2);
226
+ &__header {
227
+ &::after {
228
+ top: -500%;
229
+ height: 600%;
230
+ }
138
231
  }
139
232
 
140
- & &__header [class*='dnb-h--'],
141
- & &__header .dnb-modal__title {
233
+ &__header [class*='dnb-h--'],
234
+ &__header .dnb-modal__title {
142
235
  padding: 0;
143
236
  &:not([class*='__top']) {
144
237
  margin-top: 0;
@@ -148,36 +241,23 @@
148
241
  }
149
242
  }
150
243
 
151
- & &__header {
152
- &::after {
153
- top: -500%;
154
- height: 600%;
155
- }
156
- }
157
-
158
244
  &--spacing &__header {
159
245
  .dnb-tabs {
160
246
  margin-top: 3.5rem;
161
247
  }
162
248
  }
163
249
 
164
- &__body {
165
- padding-bottom: calc(var(--dialog-spacing) * 2);
166
- margin-bottom: calc(var(--dialog-spacing-minus) * 2);
167
- }
168
-
169
- &__navigation.dnb-section {
170
- display: flex;
171
- flex-direction: row;
172
- justify-content: space-between;
250
+ &__icon ~ &__header {
251
+ margin-top: 1.5rem;
173
252
  }
174
253
 
175
- &--spacing &__navigation.dnb-section {
176
- // on large screens
177
- margin-top: calc(var(--dialog-spacing) * 1.75);
178
- margin-bottom: calc(var(--dialog-spacing) / 2);
179
- @include allBelow(medium) {
180
- margin-top: calc(var(--dialog-spacing) / 2);
254
+ @include IS_SAFARI_MOBILE() {
255
+ // iOS on iPhone fix
256
+ // Because Safari includes the navigation bar on the height
257
+ @media (max-height: 40em) and (orientation: landscape) {
258
+ &:not(#{&}--fullscreen) {
259
+ max-height: 80vh;
260
+ }
181
261
  }
182
262
  }
183
263
  }