@carbon/styles 0.5.0-rc.0 → 0.7.0-rc.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.
- package/docs/sass.md +0 -2
- package/package.json +9 -9
- package/scss/_config.scss +1 -1
- package/scss/compat/_themes.scss +28 -1
- package/scss/components/accordion/_accordion.scss +6 -2
- package/scss/components/dropdown/_dropdown.scss +1 -1
- package/scss/components/notification/_actionable-notification.scss +410 -0
- package/scss/components/notification/_index.scss +3 -0
- package/scss/components/notification/_inline-notification.scss +1 -1
- package/scss/components/notification/_mixins.scss +2 -1
- package/scss/components/notification/_toast-notification.scss +2 -2
- package/scss/components/notification/_tokens.scss +107 -0
- package/scss/components/slider/_slider.scss +1 -1
- package/scss/components/tag/_tag.scss +6 -0
- package/scss/utilities/_box-shadow.scss +3 -1
- package/scss/utilities/_component-tokens.scss +46 -0
package/docs/sass.md
CHANGED
|
@@ -383,9 +383,7 @@ you're using from `scss/compat/themes` and set that as your theme.
|
|
|
383
383
|
|
|
384
384
|
```scss
|
|
385
385
|
@use '@carbon/styles/scss/compat/themes' as compat;
|
|
386
|
-
@use '@carbon/styles/scss/themes';
|
|
387
386
|
@use '@carbon/styles/scss/compat/theme' with (
|
|
388
|
-
$fallback: themes.$g100,
|
|
389
387
|
$theme: compat.$g100,
|
|
390
388
|
);
|
|
391
389
|
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/styles",
|
|
3
3
|
"description": "Styles for the Carbon Design System",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@carbon/colors": "^10.
|
|
23
|
+
"@carbon/colors": "^10.33.0",
|
|
24
24
|
"@carbon/feature-flags": "^0.6.0",
|
|
25
|
-
"@carbon/grid": "^10.
|
|
26
|
-
"@carbon/layout": "^10.
|
|
27
|
-
"@carbon/motion": "^10.
|
|
28
|
-
"@carbon/themes": "^10.
|
|
29
|
-
"@carbon/type": "^10.
|
|
25
|
+
"@carbon/grid": "^10.37.0",
|
|
26
|
+
"@carbon/layout": "^10.33.0",
|
|
27
|
+
"@carbon/motion": "^10.25.0",
|
|
28
|
+
"@carbon/themes": "^10.45.0-rc.0",
|
|
29
|
+
"@carbon/type": "^10.37.0",
|
|
30
30
|
"@ibm/plex": "6.0.0-next.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@carbon/test-utils": "^10.
|
|
33
|
+
"@carbon/test-utils": "^10.19.0",
|
|
34
34
|
"css": "^3.0.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "f0790b800558cdc7aee71fd6f57e6575064fdb80"
|
|
37
37
|
}
|
package/scss/_config.scss
CHANGED
package/scss/compat/_themes.scss
CHANGED
|
@@ -5,4 +5,31 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
@
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use '@carbon/themes/scss/compat/themes' as compat;
|
|
10
|
+
@use '../themes';
|
|
11
|
+
|
|
12
|
+
// For our compatability themes, we will merge the themes from v10 and v11 and
|
|
13
|
+
// provide this combination as one of our four default themes.
|
|
14
|
+
//
|
|
15
|
+
// This is useful for situations where a user is trying to use the compatability
|
|
16
|
+
// theme, for example:
|
|
17
|
+
//
|
|
18
|
+
// ```scss
|
|
19
|
+
// @use '@carbon/styles/scss/reset';
|
|
20
|
+
// @use '@carbon/styles/scss/compat/themes';
|
|
21
|
+
// @use '@carbon/styles/scss/compat/theme' with (
|
|
22
|
+
// $theme: themes.$g100
|
|
23
|
+
// );
|
|
24
|
+
// ```
|
|
25
|
+
//
|
|
26
|
+
// Without merging these themes, then the value of a token in v11 would default
|
|
27
|
+
// to our $white theme. As a result, the user would need to specify both the
|
|
28
|
+
// `$theme` and the `$fallback` to the `scss/compat/theme` module.
|
|
29
|
+
//
|
|
30
|
+
// Now that we merge the themes, this code snippet will function as expected.
|
|
31
|
+
|
|
32
|
+
$white: map.merge(themes.$white, compat.$white);
|
|
33
|
+
$g10: map.merge(themes.$g10, compat.$g10);
|
|
34
|
+
$g90: map.merge(themes.$g90, compat.$g90);
|
|
35
|
+
$g100: map.merge(themes.$g100, compat.$g100);
|
|
@@ -183,11 +183,15 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
183
183
|
|
|
184
184
|
.#{$prefix}--accordion--start .#{$prefix}--accordion__arrow {
|
|
185
185
|
// Alters `$arrow-margin` token:
|
|
186
|
-
margin: 2px 0 0 $spacing-
|
|
186
|
+
margin: 2px 0 0 $spacing-05;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.#{$prefix}--accordion--start .#{$prefix}--accordion__title {
|
|
190
|
+
margin-right: $spacing-05;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
.#{$prefix}--accordion--start .#{$prefix}--accordion__content {
|
|
190
|
-
margin-left: $spacing-
|
|
194
|
+
margin-left: $spacing-07;
|
|
191
195
|
}
|
|
192
196
|
|
|
193
197
|
.#{$prefix}--accordion__item--collapsing .#{$prefix}--accordion__content,
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2016, 2018
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
@use 'mixins' as *;
|
|
8
|
+
@use '../../breakpoint' as *;
|
|
9
|
+
@use '../../colors' as *;
|
|
10
|
+
@use '../../config' as *;
|
|
11
|
+
@use '../../feature-flags' as *;
|
|
12
|
+
@use '../../motion' as *;
|
|
13
|
+
@use '../../spacing' as *;
|
|
14
|
+
@use '../../theme' as *;
|
|
15
|
+
@use '../../themes' as *;
|
|
16
|
+
@use '../../type' as *;
|
|
17
|
+
@use '../../utilities/convert' as *;
|
|
18
|
+
@use '../../utilities/high-contrast-mode' as *;
|
|
19
|
+
@use '../../utilities/focus-outline' as *;
|
|
20
|
+
@use './tokens' as *;
|
|
21
|
+
@use '../button/mixins' as button-mixins;
|
|
22
|
+
@use '../button/vars' as button-vars;
|
|
23
|
+
|
|
24
|
+
/// Actionable notification styles
|
|
25
|
+
/// @access public
|
|
26
|
+
/// @group notification
|
|
27
|
+
@mixin actionable-notification {
|
|
28
|
+
.#{$prefix}--actionable-notification {
|
|
29
|
+
@include reset;
|
|
30
|
+
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
width: 100%;
|
|
34
|
+
min-width: rem(288px);
|
|
35
|
+
max-width: rem(288px);
|
|
36
|
+
height: auto;
|
|
37
|
+
min-height: rem(48px);
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
margin-top: $spacing-05;
|
|
40
|
+
margin-bottom: $spacing-05;
|
|
41
|
+
color: $text-inverse;
|
|
42
|
+
|
|
43
|
+
@include breakpoint(md) {
|
|
44
|
+
max-width: rem(608px);
|
|
45
|
+
flex-wrap: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include breakpoint(lg) {
|
|
49
|
+
max-width: rem(736px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include breakpoint(max) {
|
|
53
|
+
max-width: rem(832px);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{$prefix}--actionable-notification--toast {
|
|
58
|
+
min-width: rem(288px);
|
|
59
|
+
max-width: rem(288px);
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
65
|
+
a {
|
|
66
|
+
color: $link-inverse;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.#{$prefix}--actionable-notification a {
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.#{$prefix}--actionable-notification a:hover {
|
|
74
|
+
text-decoration: underline;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.#{$prefix}--actionable-notification a:focus {
|
|
78
|
+
outline: 1px solid $link-inverse;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.#{$prefix}--actionable-notification.#{$prefix}--actionable-notification--low-contrast
|
|
82
|
+
a:focus {
|
|
83
|
+
@include focus-outline;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.#{$prefix}--actionable-notification--low-contrast {
|
|
87
|
+
color: $text-primary;
|
|
88
|
+
|
|
89
|
+
&::before {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100%;
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
border-width: 1px 1px 1px 0;
|
|
97
|
+
border-style: solid;
|
|
98
|
+
content: '';
|
|
99
|
+
filter: opacity(0.4);
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.#{$prefix}--actionable-notification--error {
|
|
105
|
+
@include notification--experimental(
|
|
106
|
+
$support-error-inverse,
|
|
107
|
+
$background-inverse
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--error {
|
|
112
|
+
@include notification--experimental(
|
|
113
|
+
$support-error,
|
|
114
|
+
$notification-background-error
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
&::before {
|
|
118
|
+
border-color: $support-error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.#{$prefix}--actionable-notification--success {
|
|
123
|
+
@include notification--experimental(
|
|
124
|
+
$support-success-inverse,
|
|
125
|
+
$background-inverse
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--success {
|
|
130
|
+
@include notification--experimental(
|
|
131
|
+
$support-success,
|
|
132
|
+
$notification-background-success
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
&::before {
|
|
136
|
+
border-color: $support-success;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.#{$prefix}--actionable-notification--info,
|
|
141
|
+
.#{$prefix}--actionable-notification--info-square {
|
|
142
|
+
@include notification--experimental(
|
|
143
|
+
$support-info-inverse,
|
|
144
|
+
$background-inverse
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--info,
|
|
149
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--info-square {
|
|
150
|
+
@include notification--experimental(
|
|
151
|
+
$support-info,
|
|
152
|
+
$notification-background-info
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
&::before {
|
|
156
|
+
border-color: $support-info;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.#{$prefix}--actionable-notification--warning,
|
|
161
|
+
.#{$prefix}--actionable-notification--warning-alt {
|
|
162
|
+
@include notification--experimental(
|
|
163
|
+
$support-warning-inverse,
|
|
164
|
+
$background-inverse
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--warning,
|
|
169
|
+
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--warning-alt {
|
|
170
|
+
@include notification--experimental(
|
|
171
|
+
$support-warning,
|
|
172
|
+
$notification-background-warning
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
&::before {
|
|
176
|
+
border-color: $support-warning;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.#{$prefix}--actionable-notification--warning
|
|
181
|
+
.#{$prefix}--inline-notification__icon,
|
|
182
|
+
.#{$prefix}--actionable-notification--warning
|
|
183
|
+
.#{$prefix}--toast-notification__icon
|
|
184
|
+
path[opacity='0'] {
|
|
185
|
+
fill: $black-100;
|
|
186
|
+
opacity: 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.#{$prefix}--actionable-notification__details {
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-grow: 1;
|
|
192
|
+
margin: 0 $spacing-09 0 $spacing-05;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--toast)
|
|
196
|
+
.#{$prefix}--actionable-notification__details {
|
|
197
|
+
@include breakpoint(md) {
|
|
198
|
+
margin: 0 $spacing-05;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.#{$prefix}--actionable-notification .#{$prefix}--inline-notification__icon {
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
margin-top: rem(14px);
|
|
205
|
+
margin-right: $spacing-05;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.#{$prefix}--actionable-notification .#{$prefix}--toast-notification__icon {
|
|
209
|
+
flex-shrink: 0;
|
|
210
|
+
margin-top: $spacing-05;
|
|
211
|
+
margin-right: $spacing-05;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.#{$prefix}--actionable-notification__text-wrapper {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-wrap: wrap;
|
|
217
|
+
padding: rem(15px) 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.#{$prefix}--actionable-notification__content {
|
|
221
|
+
@include type-style('body-short-01');
|
|
222
|
+
|
|
223
|
+
word-break: break-word;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Ghost action button when inline */
|
|
227
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost {
|
|
228
|
+
height: rem(32px);
|
|
229
|
+
margin-bottom: $spacing-03;
|
|
230
|
+
margin-left: $spacing-08;
|
|
231
|
+
|
|
232
|
+
@include breakpoint(md) {
|
|
233
|
+
margin: $spacing-03 0;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
238
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost {
|
|
239
|
+
color: $link-inverse;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:active,
|
|
243
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:hover {
|
|
244
|
+
background-color: $background-inverse-hover;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.#{$prefix}--actionable-notification--low-contrast
|
|
248
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:active,
|
|
249
|
+
.#{$prefix}--actionable-notification--low-contrast
|
|
250
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:hover {
|
|
251
|
+
background-color: $notification-action-hover;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:focus {
|
|
255
|
+
border-color: transparent;
|
|
256
|
+
box-shadow: none;
|
|
257
|
+
outline: 2px solid $focus-inverse;
|
|
258
|
+
outline-offset: -2px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.#{$prefix}--actionable-notification--low-contrast
|
|
262
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost:focus {
|
|
263
|
+
outline-color: $focus;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.#{$prefix}--actionable-notification--hide-close-button
|
|
267
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost {
|
|
268
|
+
margin-right: $spacing-03;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* Tertiary action button when not inline (toast) */
|
|
272
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary {
|
|
273
|
+
margin-bottom: $spacing-03;
|
|
274
|
+
|
|
275
|
+
// Button should be left aligned with text. 20px is the width of the notification icon
|
|
276
|
+
margin-left: calc(#{$spacing-07} + #{rem(20px)});
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Tertiary button styles by default use mostly "inverse" tokens. Since the non-low-contrast notification
|
|
280
|
+
// background is dark, the button styles have to be inversed again.
|
|
281
|
+
// So essentially the:
|
|
282
|
+
// btn-tertiary white theme button styles should become g100 button styles
|
|
283
|
+
// btn-tertiary g10 theme button styles should become g90 button styles
|
|
284
|
+
// btn-tertiary g90 theme button styles should become g10 button styles
|
|
285
|
+
// btn-tertiary g100 theme button styles should become white button styles
|
|
286
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
287
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary {
|
|
288
|
+
@include button-mixins.button-theme(
|
|
289
|
+
transparent,
|
|
290
|
+
$notification-action-tertiary-inverse,
|
|
291
|
+
$notification-action-tertiary-inverse,
|
|
292
|
+
$notification-action-tertiary-inverse-hover,
|
|
293
|
+
currentColor,
|
|
294
|
+
$notification-action-tertiary-inverse-active
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
299
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:hover {
|
|
300
|
+
color: $notification-action-tertiary-inverse-text;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
304
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:focus {
|
|
305
|
+
border-color: $focus-inverse;
|
|
306
|
+
background-color: $notification-action-tertiary-inverse;
|
|
307
|
+
box-shadow: inset 0 0 0 button-vars.$button-outline-width $focus-inverse,
|
|
308
|
+
inset 0 0 0 button-vars.$button-border-width $background-inverse;
|
|
309
|
+
color: $notification-action-tertiary-inverse-text;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
313
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:active {
|
|
314
|
+
border-color: transparent;
|
|
315
|
+
background-color: $notification-action-tertiary-inverse-active;
|
|
316
|
+
color: $notification-action-tertiary-inverse-text;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
320
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:disabled,
|
|
321
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
322
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:hover:disabled,
|
|
323
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
324
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary:focus:disabled,
|
|
325
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
326
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary.#{$prefix}--btn--disabled,
|
|
327
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
328
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary.#{$prefix}--btn--disabled:hover,
|
|
329
|
+
.#{$prefix}--actionable-notification:not(.#{$prefix}--actionable-notification--low-contrast)
|
|
330
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary.#{$prefix}--btn--disabled:focus {
|
|
331
|
+
background: transparent;
|
|
332
|
+
color: $notification-action-tertiary-inverse-text-on-color-disabled;
|
|
333
|
+
outline: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.#{$prefix}--actionable-notification--hide-close-button
|
|
337
|
+
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--tertiary {
|
|
338
|
+
margin-right: $spacing-03;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.#{$prefix}--actionable-notification__close-button {
|
|
342
|
+
@include focus-outline('reset');
|
|
343
|
+
|
|
344
|
+
position: absolute;
|
|
345
|
+
top: 0;
|
|
346
|
+
right: 0;
|
|
347
|
+
display: flex;
|
|
348
|
+
width: rem(48px);
|
|
349
|
+
min-width: rem(48px);
|
|
350
|
+
max-width: rem(48px);
|
|
351
|
+
height: rem(48px);
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
align-items: center;
|
|
354
|
+
justify-content: center;
|
|
355
|
+
padding: 0;
|
|
356
|
+
border: none;
|
|
357
|
+
background: transparent;
|
|
358
|
+
cursor: pointer;
|
|
359
|
+
transition: outline $duration-fast-02 motion(standard, productive),
|
|
360
|
+
background-color $duration-fast-02 motion(standard, productive);
|
|
361
|
+
|
|
362
|
+
&:focus {
|
|
363
|
+
outline: 2px solid $focus-inverse;
|
|
364
|
+
outline-offset: -2px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.#{$prefix}--actionable-notification__close-icon {
|
|
368
|
+
fill: $icon-inverse;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@include breakpoint(md) {
|
|
372
|
+
position: static;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.#{$prefix}--actionable-notification--toast
|
|
377
|
+
.#{$prefix}--actionable-notification__close-button {
|
|
378
|
+
@include breakpoint(md) {
|
|
379
|
+
position: absolute;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.#{$prefix}--actionable-notification--low-contrast
|
|
384
|
+
.#{$prefix}--actionable-notification__close-button:focus {
|
|
385
|
+
@include focus-outline('outline');
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.#{$prefix}--actionable-notification--low-contrast
|
|
389
|
+
.#{$prefix}--actionable-notification__close-button
|
|
390
|
+
.#{$prefix}--actionable-notification__close-icon {
|
|
391
|
+
fill: $icon-primary;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Windows HCM fix
|
|
395
|
+
/* stylelint-disable */
|
|
396
|
+
.#{$prefix}--actionable-notification {
|
|
397
|
+
@include high-contrast-mode('outline');
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.#{$prefix}--actionable-notification__close-button:focus,
|
|
401
|
+
.#{$prefix}--btn.#{$prefix}--btn--ghost.#{$prefix}--actionable-notification__action-button:focus {
|
|
402
|
+
@include high-contrast-mode('focus');
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.#{$prefix}--actionable-notification .#{$prefix}--inline-notification__icon,
|
|
406
|
+
.#{$prefix}--actionable-notification .#{$prefix}--toast-notification__icon {
|
|
407
|
+
@include high-contrast-mode('icon-fill');
|
|
408
|
+
}
|
|
409
|
+
/* stylelint-enable */
|
|
410
|
+
}
|
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
@forward './tokens';
|
|
9
9
|
@forward 'inline-notification';
|
|
10
10
|
@forward 'toast-notification';
|
|
11
|
+
@forward 'actionable-notification';
|
|
11
12
|
|
|
12
13
|
@use '../../theme';
|
|
13
14
|
@use './tokens';
|
|
14
15
|
@use './inline-notification';
|
|
15
16
|
@use './toast-notification';
|
|
17
|
+
@use './actionable-notification';
|
|
16
18
|
|
|
17
19
|
@include theme.add-component-tokens(tokens.$notification-tokens);
|
|
18
20
|
@include inline-notification.inline-notification;
|
|
19
21
|
@include toast-notification.toast-notification;
|
|
22
|
+
@include actionable-notification.actionable-notification;
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
margin-right: $spacing-05;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
@if enabled('enable-v11-release') {
|
|
149
|
+
@if feature-flag-enabled('enable-v11-release') {
|
|
150
150
|
.#{$prefix}--toast-notification__content {
|
|
151
151
|
@include type-style('body-short-01');
|
|
152
152
|
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
fill: $icon-primary;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
@if not enabled('enable-v11-release') {
|
|
208
|
+
@if not feature-flag-enabled('enable-v11-release') {
|
|
209
209
|
.#{$prefix}--toast-notification__title {
|
|
210
210
|
@include type-style('productive-heading-01');
|
|
211
211
|
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
@use 'sass:color';
|
|
9
|
+
@use "sass:map";
|
|
10
|
+
@use "sass:list";
|
|
9
11
|
@use '../../colors';
|
|
10
12
|
@use '../../themes';
|
|
11
13
|
@use '../../theme';
|
|
12
14
|
@use '../../utilities/component-tokens';
|
|
15
|
+
@use '../button/tokens' as button-tokens;
|
|
13
16
|
|
|
14
17
|
$notification-background-error: (
|
|
15
18
|
fallback: colors.$red-10,
|
|
@@ -121,12 +124,91 @@ $notification-action-hover: (
|
|
|
121
124
|
),
|
|
122
125
|
) !default;
|
|
123
126
|
|
|
127
|
+
$notification-action-tertiary-inverse: (
|
|
128
|
+
fallback: map.get(button-tokens.$button-tokens, button-tertiary, fallback),
|
|
129
|
+
values:
|
|
130
|
+
component-tokens.get-inverse-theme-values(
|
|
131
|
+
map.get(button-tokens.$button-tokens, button-tertiary)
|
|
132
|
+
),
|
|
133
|
+
) !default;
|
|
134
|
+
|
|
135
|
+
$notification-action-tertiary-inverse-active: (
|
|
136
|
+
fallback:
|
|
137
|
+
map.get(button-tokens.$button-tokens, button-tertiary-active, fallback),
|
|
138
|
+
values:
|
|
139
|
+
component-tokens.get-inverse-theme-values(
|
|
140
|
+
map.get(button-tokens.$button-tokens, button-tertiary-active)
|
|
141
|
+
),
|
|
142
|
+
) !default;
|
|
143
|
+
|
|
144
|
+
$notification-action-tertiary-inverse-hover: (
|
|
145
|
+
fallback:
|
|
146
|
+
map.get(button-tokens.$button-tokens, button-tertiary-hover, fallback),
|
|
147
|
+
values:
|
|
148
|
+
component-tokens.get-inverse-theme-values(
|
|
149
|
+
map.get(button-tokens.$button-tokens, button-tertiary-hover)
|
|
150
|
+
),
|
|
151
|
+
) !default;
|
|
152
|
+
|
|
153
|
+
$notification-action-tertiary-inverse-text: (
|
|
154
|
+
fallback: map.get(themes.$white, text-inverse),
|
|
155
|
+
values: (
|
|
156
|
+
(
|
|
157
|
+
theme: themes.$white,
|
|
158
|
+
value: map.get(themes.$g100, text-inverse),
|
|
159
|
+
),
|
|
160
|
+
(
|
|
161
|
+
theme: themes.$g10,
|
|
162
|
+
value: map.get(themes.$g90, text-inverse),
|
|
163
|
+
),
|
|
164
|
+
(
|
|
165
|
+
theme: themes.$g90,
|
|
166
|
+
value: map.get(themes.$g10, text-inverse),
|
|
167
|
+
),
|
|
168
|
+
(
|
|
169
|
+
theme: themes.$g100,
|
|
170
|
+
value: map.get(themes.$white, text-inverse),
|
|
171
|
+
),
|
|
172
|
+
),
|
|
173
|
+
) !default;
|
|
174
|
+
|
|
175
|
+
$notification-action-tertiary-inverse-text-on-color-disabled: (
|
|
176
|
+
fallback: map.get(themes.$white, text-on-color-disabled),
|
|
177
|
+
values: (
|
|
178
|
+
(
|
|
179
|
+
theme: themes.$white,
|
|
180
|
+
value: map.get(themes.$g100, text-on-color-disabled),
|
|
181
|
+
),
|
|
182
|
+
(
|
|
183
|
+
theme: themes.$g10,
|
|
184
|
+
value: map.get(themes.$g90, text-on-color-disabled),
|
|
185
|
+
),
|
|
186
|
+
(
|
|
187
|
+
theme: themes.$g90,
|
|
188
|
+
value: map.get(themes.$g10, text-on-color-disabled),
|
|
189
|
+
),
|
|
190
|
+
(
|
|
191
|
+
theme: themes.$g100,
|
|
192
|
+
value: map.get(themes.$white, text-on-color-disabled),
|
|
193
|
+
),
|
|
194
|
+
),
|
|
195
|
+
) !default;
|
|
196
|
+
|
|
124
197
|
$notification-tokens: (
|
|
125
198
|
notification-background-error: $notification-background-error,
|
|
126
199
|
notification-background-success: $notification-background-success,
|
|
127
200
|
notification-background-info: $notification-background-info,
|
|
128
201
|
notification-background-warning: $notification-background-warning,
|
|
129
202
|
notification-action-hover: $notification-action-hover,
|
|
203
|
+
notification-action-tertiary-inverse: $notification-action-tertiary-inverse,
|
|
204
|
+
notification-action-tertiary-inverse-active:
|
|
205
|
+
$notification-action-tertiary-inverse-active,
|
|
206
|
+
notification-action-tertiary-inverse-hover:
|
|
207
|
+
$notification-action-tertiary-inverse-hover,
|
|
208
|
+
notification-action-tertiary-inverse-text:
|
|
209
|
+
$notification-action-tertiary-inverse-text,
|
|
210
|
+
notification-action-tertiary-inverse-text-on-color-disabled:
|
|
211
|
+
$notification-action-tertiary-inverse-text-on-color-disabled,
|
|
130
212
|
);
|
|
131
213
|
|
|
132
214
|
$notification-background-error: component-tokens.get-var(
|
|
@@ -153,3 +235,28 @@ $notification-action-hover: component-tokens.get-var(
|
|
|
153
235
|
$notification-action-hover,
|
|
154
236
|
'notification-action-hover'
|
|
155
237
|
);
|
|
238
|
+
|
|
239
|
+
$notification-action-tertiary-inverse: component-tokens.get-var(
|
|
240
|
+
$notification-action-tertiary-inverse,
|
|
241
|
+
'notification-action-tertiary-inverse'
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
$notification-action-tertiary-inverse-active: component-tokens.get-var(
|
|
245
|
+
$notification-action-tertiary-inverse-active,
|
|
246
|
+
'notification-action-tertiary-inverse-active'
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
$notification-action-tertiary-inverse-hover: component-tokens.get-var(
|
|
250
|
+
$notification-action-tertiary-inverse-hover,
|
|
251
|
+
'notification-action-tertiary-inverse-hover'
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
$notification-action-tertiary-inverse-text: component-tokens.get-var(
|
|
255
|
+
$notification-action-tertiary-inverse-text,
|
|
256
|
+
'notification-action-tertiary-inverse-text'
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
$notification-action-tertiary-inverse-text-on-color-disabled: component-tokens.get-var(
|
|
260
|
+
$notification-action-tertiary-inverse-text-on-color-disabled,
|
|
261
|
+
'notification-action-tertiary-inverse-text-on-color-disabled'
|
|
262
|
+
);
|
|
@@ -114,6 +114,12 @@
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
.#{$prefix}--tag--outline {
|
|
118
|
+
@include tag-theme($background, $text-primary, $layer-hover);
|
|
119
|
+
|
|
120
|
+
box-shadow: inset 0 0 0 1px $background-inverse;
|
|
121
|
+
}
|
|
122
|
+
|
|
117
123
|
.#{$prefix}--tag--disabled,
|
|
118
124
|
.#{$prefix}--tag--filter.#{$prefix}--tag--disabled,
|
|
119
125
|
.#{$prefix}--tag--interactive.#{$prefix}--tag--disabled {
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use '../theme';
|
|
9
|
+
|
|
8
10
|
/// Adds box shadow
|
|
9
11
|
/// @access public
|
|
10
12
|
/// @example @include box-shadow;
|
|
11
13
|
/// @group utilities
|
|
12
14
|
@mixin box-shadow {
|
|
13
|
-
box-shadow: 0 2px 6px
|
|
15
|
+
box-shadow: 0 2px 6px theme.$shadow;
|
|
14
16
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
@use 'sass:map';
|
|
9
9
|
@use 'sass:meta';
|
|
10
|
+
@use "sass:list";
|
|
10
11
|
@use '../themes';
|
|
11
12
|
@use '../theme';
|
|
12
13
|
@use './custom-property';
|
|
@@ -53,3 +54,48 @@
|
|
|
53
54
|
|
|
54
55
|
@return custom-property.get-var($name, $token-map);
|
|
55
56
|
}
|
|
57
|
+
|
|
58
|
+
/// Get inverse theme values for a given component token.
|
|
59
|
+
/// @param {any} $token-map The possible values for the token, this value can
|
|
60
|
+
/// be a plain value used as a CSS value or a Sass Map
|
|
61
|
+
@function get-inverse-theme-values($token-map) {
|
|
62
|
+
$inverse-theme-values: ();
|
|
63
|
+
$inverse-value: ();
|
|
64
|
+
|
|
65
|
+
@each $theme-value in map.get($token-map, values) {
|
|
66
|
+
$theme: map.get($theme-value, theme);
|
|
67
|
+
$value: map.get($theme-value, value);
|
|
68
|
+
|
|
69
|
+
@if $theme == themes.$g100 {
|
|
70
|
+
$inverse-value: (
|
|
71
|
+
theme: themes.$white,
|
|
72
|
+
value: $value,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@if $theme == themes.$g90 {
|
|
77
|
+
$inverse-value: (
|
|
78
|
+
theme: themes.$g10,
|
|
79
|
+
value: $value,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@if $theme == themes.$g10 {
|
|
84
|
+
$inverse-value: (
|
|
85
|
+
theme: themes.$g90,
|
|
86
|
+
value: $value,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@if $theme == themes.$white {
|
|
91
|
+
$inverse-value: (
|
|
92
|
+
theme: themes.$g100,
|
|
93
|
+
value: $value,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
$inverse-theme-values: list.append($inverse-theme-values, $inverse-value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@return $inverse-theme-values;
|
|
101
|
+
}
|