@danske/sapphire-css 32.0.1 → 32.1.1
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.
|
@@ -38,34 +38,40 @@
|
|
|
38
38
|
bottom: 0;
|
|
39
39
|
left: 50%;
|
|
40
40
|
}
|
|
41
|
+
|
|
41
42
|
.sapphire-toast-container--bottom-left {
|
|
42
43
|
--sapphire-toast-horizontal-transform: 0%;
|
|
43
44
|
bottom: 0;
|
|
44
45
|
left: 0;
|
|
45
46
|
}
|
|
47
|
+
|
|
46
48
|
.sapphire-toast-container--bottom-right {
|
|
47
49
|
--sapphire-toast-horizontal-transform: 0%;
|
|
48
50
|
bottom: 0;
|
|
49
51
|
right: 0;
|
|
50
52
|
}
|
|
53
|
+
|
|
51
54
|
.sapphire-toast-container--top {
|
|
52
55
|
--sapphire-toast-animation-direction: -1;
|
|
53
56
|
--sapphire-toast-horizontal-transform: -50%;
|
|
54
57
|
top: 0;
|
|
55
58
|
left: 50%;
|
|
56
59
|
}
|
|
60
|
+
|
|
57
61
|
.sapphire-toast-container--top-left {
|
|
58
62
|
--sapphire-toast-animation-direction: -1;
|
|
59
63
|
--sapphire-toast-horizontal-transform: 0%;
|
|
60
64
|
top: 0;
|
|
61
65
|
left: 0;
|
|
62
66
|
}
|
|
67
|
+
|
|
63
68
|
.sapphire-toast-container--top-right {
|
|
64
69
|
--sapphire-toast-animation-direction: -1;
|
|
65
70
|
--sapphire-toast-horizontal-transform: 0%;
|
|
66
71
|
top: 0;
|
|
67
72
|
right: 0;
|
|
68
73
|
}
|
|
74
|
+
|
|
69
75
|
/************************************************************/
|
|
70
76
|
|
|
71
77
|
.sapphire-toast {
|
|
@@ -82,27 +88,27 @@
|
|
|
82
88
|
max-width: var(--sapphire-toast-size-width-max);
|
|
83
89
|
min-width: var(--sapphire-toast-size-width-min);
|
|
84
90
|
box-shadow: var(--sapphire-toast-shadow);
|
|
85
|
-
border-radius: var(--sapphire-
|
|
91
|
+
border-radius: var(--sapphire-semantic-size-radius-popover);
|
|
86
92
|
animation-duration: var(--sapphire-toast-time-transition);
|
|
87
93
|
|
|
88
94
|
/* Ease-out Cubic */
|
|
89
95
|
animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
90
96
|
|
|
91
97
|
/* if implemented as focusable, we don't want the outline because this is not
|
|
92
|
-
|
|
98
|
+
* an an interactive element in itself */
|
|
93
99
|
outline: none;
|
|
94
100
|
|
|
95
101
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
103
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
104
|
+
* can happen in other contexts as well.
|
|
105
|
+
*
|
|
106
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
107
|
+
*
|
|
108
|
+
* For more details see:
|
|
109
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
110
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
111
|
+
*/
|
|
106
112
|
-webkit-font-smoothing: antialiased;
|
|
107
113
|
-moz-osx-font-smoothing: grayscale;
|
|
108
114
|
}
|
|
@@ -127,12 +133,14 @@
|
|
|
127
133
|
|
|
128
134
|
.sapphire-toast__content {
|
|
129
135
|
display: flex;
|
|
130
|
-
gap: var(--sapphire-
|
|
136
|
+
gap: var(--sapphire-semantic-size-spacing-20);
|
|
131
137
|
align-items: center;
|
|
132
138
|
justify-content: space-between;
|
|
133
139
|
|
|
134
|
-
background-color: var(
|
|
135
|
-
|
|
140
|
+
background-color: var(
|
|
141
|
+
--sapphire-semantic-color-background-surface-primary-default
|
|
142
|
+
);
|
|
143
|
+
color: var(--sapphire-semantic-color-content-default-primary);
|
|
136
144
|
font-family: var(--sapphire-toast-font-name);
|
|
137
145
|
font-size: var(--sapphire-toast-size-font);
|
|
138
146
|
font-weight: var(--sapphire-toast-font-weight);
|
|
@@ -141,3 +149,145 @@
|
|
|
141
149
|
var(--sapphire-toast-size-spacing-horizontal);
|
|
142
150
|
padding-right: var(--sapphire-toast-size-spacing-end);
|
|
143
151
|
}
|
|
152
|
+
|
|
153
|
+
.sapphire-toast__content--success {
|
|
154
|
+
background-color: var(
|
|
155
|
+
--sapphire-semantic-color-background-positive-primary-default
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.sapphire-toast__title--with-icon {
|
|
160
|
+
flex: 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Close Button
|
|
165
|
+
*
|
|
166
|
+
* This is a special button, not matching any of our existing buttons or icon
|
|
167
|
+
* buttons and these are only meant to be used in the toast component.
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
.sapphire-toast__close-button {
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
display: inline-flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
vertical-align: middle;
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
|
|
178
|
+
/* In Safari buttons get a 2px border
|
|
179
|
+
* https://github.com/necolas/normalize.css/blob/master/normalize.css#L160-L169
|
|
180
|
+
*/
|
|
181
|
+
margin: 0;
|
|
182
|
+
padding: 0;
|
|
183
|
+
|
|
184
|
+
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
185
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
186
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
187
|
+
* can happen in other contexts as well.
|
|
188
|
+
*
|
|
189
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
190
|
+
*
|
|
191
|
+
* For more details see:
|
|
192
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
193
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
194
|
+
*/
|
|
195
|
+
-webkit-font-smoothing: antialiased;
|
|
196
|
+
-moz-osx-font-smoothing: grayscale;
|
|
197
|
+
|
|
198
|
+
/* sizing */
|
|
199
|
+
height: var(--sapphire-semantic-size-height-control-s);
|
|
200
|
+
width: var(--sapphire-semantic-size-height-control-s);
|
|
201
|
+
flex-shrink: 0; /* When part of flex layout the button will otherwise be squashed */
|
|
202
|
+
|
|
203
|
+
/* shape */
|
|
204
|
+
border-radius: var(--sapphire-semantic-size-height-control-s);
|
|
205
|
+
border-style: solid;
|
|
206
|
+
border-width: 0;
|
|
207
|
+
border-color: transparent;
|
|
208
|
+
|
|
209
|
+
/* transition */
|
|
210
|
+
/* we don't want to transition outline-offset */
|
|
211
|
+
transition-property: opacity, background-color, color;
|
|
212
|
+
animation-duration: var(--sapphire-semantic-time-motion-default);
|
|
213
|
+
transition-timing-function: ease-in-out;
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
|
|
216
|
+
background-color: var(
|
|
217
|
+
--sapphire-semantic-color-background-action-tertiary-ghost-default
|
|
218
|
+
);
|
|
219
|
+
color: var(--sapphire-semantic-color-content-action-tertiary-default);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Hover (button)
|
|
224
|
+
*/
|
|
225
|
+
.sapphire-toast__close-button:not(:disabled):not(:active):not(.is-active):not(
|
|
226
|
+
.js-hover
|
|
227
|
+
):hover,
|
|
228
|
+
.sapphire-toast__close-button:not(:disabled):not(:active):not(
|
|
229
|
+
.is-active
|
|
230
|
+
).is-hover {
|
|
231
|
+
background-color: var(
|
|
232
|
+
--sapphire-semantic-color-background-action-tertiary-ghost-hover
|
|
233
|
+
);
|
|
234
|
+
color: var(--sapphire-semantic-color-content-action-tertiary-default);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Focus (button)
|
|
239
|
+
*/
|
|
240
|
+
.sapphire-toast__close-button:focus {
|
|
241
|
+
outline: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.sapphire-toast__close-button.is-focus,
|
|
245
|
+
.sapphire-toast__close-button:not(.js-focus):focus-visible {
|
|
246
|
+
background-color: var(
|
|
247
|
+
--sapphire-semantic-color-background-action-tertiary-ghost-default
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Active (button)
|
|
253
|
+
*/
|
|
254
|
+
.sapphire-toast__close-button:not(:disabled).is-active,
|
|
255
|
+
.sapphire-toast__close-button:not(:disabled):active,
|
|
256
|
+
.sapphire-toast__close-button:not(:disabled):focus-visible:active {
|
|
257
|
+
background-color: var(
|
|
258
|
+
--sapphire-semantic-color-background-action-tertiary-ghost-active
|
|
259
|
+
);
|
|
260
|
+
color: var(--sapphire-semantic-color-content-action-tertiary-active);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Success styles
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Hover (button)
|
|
269
|
+
*/
|
|
270
|
+
.sapphire-toast__content--success
|
|
271
|
+
.sapphire-toast__close-button:not(:disabled):not(:active):not(.is-active):not(
|
|
272
|
+
.js-hover
|
|
273
|
+
):hover,
|
|
274
|
+
.sapphire-toast__content--success
|
|
275
|
+
.sapphire-toast__close-button:not(:disabled):not(:active):not(
|
|
276
|
+
.is-active
|
|
277
|
+
).is-hover {
|
|
278
|
+
background-color: var(--sapphire-global-color-green-400);
|
|
279
|
+
color: var(--sapphire-semantic-color-content-action-tertiary-hover);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Active (button)
|
|
284
|
+
*/
|
|
285
|
+
.sapphire-toast__content--success
|
|
286
|
+
.sapphire-toast__close-button:not(:disabled).is-active,
|
|
287
|
+
.sapphire-toast__content--success
|
|
288
|
+
.sapphire-toast__close-button:not(:disabled):active,
|
|
289
|
+
.sapphire-toast__content--success
|
|
290
|
+
.sapphire-toast__close-button:not(:disabled):focus-visible:active {
|
|
291
|
+
background-color: var(--sapphire-global-color-green-300);
|
|
292
|
+
color: var(--sapphire-semantic-color-content-action-tertiary-active);
|
|
293
|
+
}
|
|
@@ -13,6 +13,14 @@ declare const styles: {
|
|
|
13
13
|
readonly "sapphire-toast--exiting": string;
|
|
14
14
|
readonly "fade-out": string;
|
|
15
15
|
readonly "sapphire-toast__content": string;
|
|
16
|
+
readonly "sapphire-toast__content--success": string;
|
|
17
|
+
readonly "sapphire-toast__title--with-icon": string;
|
|
18
|
+
readonly "sapphire-toast__close-button": string;
|
|
19
|
+
readonly "is-active": string;
|
|
20
|
+
readonly "js-hover": string;
|
|
21
|
+
readonly "is-hover": string;
|
|
22
|
+
readonly "is-focus": string;
|
|
23
|
+
readonly "js-focus": string;
|
|
16
24
|
};
|
|
17
25
|
export = styles;
|
|
18
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-css",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.1.1",
|
|
4
4
|
"description": "CSS implementation of the Sapphire Design System from Danske Bank A/S",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "~4.6.4"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@danske/sapphire-design-tokens": "^
|
|
69
|
+
"@danske/sapphire-design-tokens": "^40.0.1"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "96f9ae692dc2cdc75d36dd92943cdf70a2b39b4c"
|
|
72
72
|
}
|