@carbon/styles 1.98.0 → 1.99.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/css/styles.css +44 -54
- package/css/styles.min.css +1 -1
- package/package.json +8 -8
- package/scss/__tests__/carousel-test.js +92 -0
- package/scss/_carbon-utilities.scss +8 -0
- package/scss/components/notification/_actionable-notification.scss +180 -103
- package/scss/components/notification/_inline-notification.scss +172 -97
- package/scss/components/notification/_toast-notification.scss +129 -66
- package/scss/components/popover/_popover.scss +47 -28
- package/scss/components/treeview/_treeview.scss +4 -1
- package/scss/utilities/_tooltip.scss +12 -10
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": "1.
|
|
4
|
+
"version": "1.99.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@carbon/colors": "^11.
|
|
43
|
+
"@carbon/colors": "^11.46.0-rc.0",
|
|
44
44
|
"@carbon/feature-flags": ">=0.32.0",
|
|
45
|
-
"@carbon/grid": "^11.
|
|
46
|
-
"@carbon/layout": "^11.
|
|
47
|
-
"@carbon/motion": "^11.
|
|
48
|
-
"@carbon/themes": "^11.
|
|
49
|
-
"@carbon/type": "^11.
|
|
45
|
+
"@carbon/grid": "^11.49.0-rc.0",
|
|
46
|
+
"@carbon/layout": "^11.47.0-rc.0",
|
|
47
|
+
"@carbon/motion": "^11.40.0-rc.0",
|
|
48
|
+
"@carbon/themes": "^11.67.0-rc.0",
|
|
49
|
+
"@carbon/type": "^11.53.0-rc.0",
|
|
50
50
|
"@ibm/plex": "6.0.0-next.6",
|
|
51
51
|
"@ibm/plex-mono": "1.1.0",
|
|
52
52
|
"@ibm/plex-sans": "1.1.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"scss/**/*.css",
|
|
76
76
|
"css/**/*.css"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "cbde6bd5df4774c2780411b3faa02ec3a0bb7585"
|
|
79
79
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
* @jest-environment node
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
const { SassRenderer } = require('@carbon/test-utils/scss');
|
|
13
|
+
|
|
14
|
+
const { render } = SassRenderer.create(__dirname);
|
|
15
|
+
|
|
16
|
+
describe('scss/carousel', () => {
|
|
17
|
+
test('Public API', async () => {
|
|
18
|
+
const { unwrap } = await render(`
|
|
19
|
+
@use 'sass:map';
|
|
20
|
+
@use 'sass:meta';
|
|
21
|
+
@use '../_carbon-utilities' as carousel;
|
|
22
|
+
|
|
23
|
+
$_: get('carousel-mixin', meta.mixin-exists('carousel', 'carousel'));
|
|
24
|
+
$_: get('keyframes-mixin', meta.mixin-exists('keyframes', 'carousel'));
|
|
25
|
+
$_: get('viewBase-mixin', meta.mixin-exists('viewBase', 'carousel'));
|
|
26
|
+
$_: get('wrapperStyles-mixin', meta.mixin-exists('wrapperStyles', 'carousel'));
|
|
27
|
+
$_: get('viewStyles-mixin', meta.mixin-exists('viewStyles', 'carousel'));
|
|
28
|
+
$_: get('variables', map.keys(meta.module-variables('carousel')));
|
|
29
|
+
`);
|
|
30
|
+
|
|
31
|
+
expect(unwrap('carousel-mixin')).toBe(true);
|
|
32
|
+
expect(unwrap('keyframes-mixin')).toBe(true);
|
|
33
|
+
expect(unwrap('viewBase-mixin')).toBe(true);
|
|
34
|
+
expect(unwrap('wrapperStyles-mixin')).toBe(true);
|
|
35
|
+
expect(unwrap('viewStyles-mixin')).toBe(true);
|
|
36
|
+
expect(unwrap('variables')).toEqual(['prefix', 'animateTime']);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('configuration - animateTime override', async () => {
|
|
40
|
+
const { unwrap } = await render(`
|
|
41
|
+
@use '../_carbon-utilities' as carousel with (
|
|
42
|
+
$animateTime: 500ms,
|
|
43
|
+
);
|
|
44
|
+
$_: get('animateTime', carousel.$animateTime);
|
|
45
|
+
`);
|
|
46
|
+
expect(unwrap('animateTime')).toBe('500ms');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('carousel mixin can be included without errors', async () => {
|
|
50
|
+
await expect(
|
|
51
|
+
render(`
|
|
52
|
+
@use '../_carbon-utilities' as carousel;
|
|
53
|
+
|
|
54
|
+
.test {
|
|
55
|
+
@include carousel.carousel;
|
|
56
|
+
}
|
|
57
|
+
`)
|
|
58
|
+
).resolves.not.toThrow();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('wrapperStyles mixin can be included without errors', async () => {
|
|
62
|
+
await expect(
|
|
63
|
+
render(`
|
|
64
|
+
@use '../_carbon-utilities' as carousel;
|
|
65
|
+
|
|
66
|
+
@include carousel.wrapperStyles;
|
|
67
|
+
`)
|
|
68
|
+
).resolves.not.toThrow();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('viewStyles mixin can be included without errors', async () => {
|
|
72
|
+
await expect(
|
|
73
|
+
render(`
|
|
74
|
+
@use '../_carbon-utilities' as carousel;
|
|
75
|
+
|
|
76
|
+
@include carousel.viewStyles;
|
|
77
|
+
`)
|
|
78
|
+
).resolves.not.toThrow();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('default variables have expected values', async () => {
|
|
82
|
+
const { unwrap } = await render(`
|
|
83
|
+
@use '../_carbon-utilities' as carousel;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
$_: get('animateTime', carousel.$animateTime);
|
|
87
|
+
`);
|
|
88
|
+
|
|
89
|
+
// animateTime should be $duration-moderate-02 from @carbon/styles/scss/motion
|
|
90
|
+
expect(unwrap('animateTime')).toBeDefined();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -22,42 +22,185 @@
|
|
|
22
22
|
@use '../button/mixins' as button-mixins;
|
|
23
23
|
@use '../button/vars' as button-vars;
|
|
24
24
|
|
|
25
|
-
/// Actionable notification styles
|
|
25
|
+
/// Actionable notification base styles
|
|
26
26
|
/// @access public
|
|
27
27
|
/// @group notification
|
|
28
|
-
@mixin actionable-notification {
|
|
29
|
-
|
|
30
|
-
@include reset;
|
|
28
|
+
@mixin actionable-notification-base {
|
|
29
|
+
@include reset;
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
block-size: auto;
|
|
35
|
+
color: $text-inverse;
|
|
36
|
+
inline-size: 100%;
|
|
37
|
+
max-inline-size: convert.to-rem(288px);
|
|
38
|
+
min-block-size: convert.to-rem(48px);
|
|
39
|
+
min-inline-size: convert.to-rem(288px);
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
@include breakpoint(md) {
|
|
42
|
+
flex-wrap: nowrap;
|
|
43
|
+
max-inline-size: convert.to-rem(608px);
|
|
44
|
+
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
@include breakpoint(lg) {
|
|
47
|
+
max-inline-size: convert.to-rem(736px);
|
|
48
|
+
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
@include breakpoint(max) {
|
|
51
|
+
max-inline-size: convert.to-rem(832px);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/// Actionable notification toast variant base styles
|
|
55
|
+
/// @access public
|
|
56
|
+
/// @group notification
|
|
57
|
+
@mixin actionable-notification-toast-base {
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
|
|
60
|
+
max-inline-size: convert.to-rem(288px);
|
|
61
|
+
min-inline-size: convert.to-rem(288px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Actionable notification low-contrast variant base styles
|
|
65
|
+
/// @access public
|
|
66
|
+
/// @group notification
|
|
67
|
+
@mixin actionable-notification-low-contrast-base {
|
|
68
|
+
color: $text-primary;
|
|
69
|
+
|
|
70
|
+
.#{$prefix}--actionable-notification__subtitle,
|
|
71
|
+
.#{$prefix}--actionable-notification__caption {
|
|
72
|
+
color: $text-primary;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.#{$prefix}--actionable-notification__close-button
|
|
76
|
+
.#{$prefix}--actionable-notification__close-icon {
|
|
77
|
+
fill: $icon-primary;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/// Actionable notification error variant base styles
|
|
82
|
+
/// @access public
|
|
83
|
+
/// @group notification
|
|
84
|
+
@mixin actionable-notification-error-base {
|
|
85
|
+
@include notification--experimental(
|
|
86
|
+
$support-error-inverse,
|
|
87
|
+
$background-inverse
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/// Actionable notification success variant base styles
|
|
92
|
+
/// @access public
|
|
93
|
+
/// @group notification
|
|
94
|
+
@mixin actionable-notification-success-base {
|
|
95
|
+
@include notification--experimental(
|
|
96
|
+
$support-success-inverse,
|
|
97
|
+
$background-inverse
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// Actionable notification info variant base styles
|
|
102
|
+
/// @access public
|
|
103
|
+
/// @group notification
|
|
104
|
+
@mixin actionable-notification-info-base {
|
|
105
|
+
@include notification--experimental(
|
|
106
|
+
$support-info-inverse,
|
|
107
|
+
$background-inverse
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/// Actionable notification warning variant base styles
|
|
112
|
+
/// @access public
|
|
113
|
+
/// @group notification
|
|
114
|
+
@mixin actionable-notification-warning-base {
|
|
115
|
+
@include notification--experimental(
|
|
116
|
+
$support-warning-inverse,
|
|
117
|
+
$background-inverse
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/// Actionable notification low-contrast error variant styles
|
|
122
|
+
/// @access public
|
|
123
|
+
/// @group notification
|
|
124
|
+
@mixin actionable-notification-low-contrast-error {
|
|
125
|
+
@include notification--experimental(
|
|
126
|
+
$support-error,
|
|
127
|
+
$notification-background-error
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
border-color: $support-error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/// Actionable notification low-contrast success variant styles
|
|
136
|
+
/// @access public
|
|
137
|
+
/// @group notification
|
|
138
|
+
@mixin actionable-notification-low-contrast-success {
|
|
139
|
+
@include notification--experimental(
|
|
140
|
+
$support-success,
|
|
141
|
+
$notification-background-success
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
&::before {
|
|
145
|
+
border-color: $support-success;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/// Actionable notification low-contrast info variant styles
|
|
150
|
+
/// @access public
|
|
151
|
+
/// @group notification
|
|
152
|
+
@mixin actionable-notification-low-contrast-info {
|
|
153
|
+
@include notification--experimental(
|
|
154
|
+
$support-info,
|
|
155
|
+
$notification-background-info
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
&::before {
|
|
159
|
+
border-color: $support-info;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/// Actionable notification low-contrast warning variant styles
|
|
164
|
+
/// @access public
|
|
165
|
+
/// @group notification
|
|
166
|
+
@mixin actionable-notification-low-contrast-warning {
|
|
167
|
+
@include notification--experimental(
|
|
168
|
+
$support-warning,
|
|
169
|
+
$notification-background-warning
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
&::before {
|
|
173
|
+
border-color: $support-warning;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/// Actionable notification low constrast inline ::before styles
|
|
178
|
+
/// @access public
|
|
179
|
+
/// @group notification
|
|
180
|
+
@mixin actionable-notification-low-contrast-inline-before {
|
|
181
|
+
position: absolute;
|
|
182
|
+
box-sizing: border-box;
|
|
183
|
+
border-width: 1px 1px 1px 0;
|
|
184
|
+
border-style: solid;
|
|
185
|
+
block-size: 100%;
|
|
186
|
+
content: '';
|
|
187
|
+
filter: opacity(0.4);
|
|
188
|
+
inline-size: 100%;
|
|
189
|
+
inset-block-start: 0;
|
|
190
|
+
inset-inline-start: 0;
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/// Actionable notification styles
|
|
195
|
+
/// @access public
|
|
196
|
+
/// @group notification
|
|
197
|
+
@mixin actionable-notification {
|
|
198
|
+
.#{$prefix}--actionable-notification {
|
|
199
|
+
@include actionable-notification-base;
|
|
54
200
|
}
|
|
55
201
|
|
|
56
202
|
.#{$prefix}--actionable-notification--toast {
|
|
57
|
-
|
|
58
|
-
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
|
|
59
|
-
max-inline-size: convert.to-rem(288px);
|
|
60
|
-
min-inline-size: convert.to-rem(288px);
|
|
203
|
+
@include actionable-notification-toast-base;
|
|
61
204
|
}
|
|
62
205
|
|
|
63
206
|
.#{$prefix}--actionable-notification:not(
|
|
@@ -85,99 +228,49 @@
|
|
|
85
228
|
}
|
|
86
229
|
|
|
87
230
|
.#{$prefix}--actionable-notification--low-contrast {
|
|
88
|
-
|
|
231
|
+
@include actionable-notification-low-contrast-base;
|
|
89
232
|
}
|
|
90
233
|
|
|
91
234
|
.#{$prefix}--actionable-notification--low-contrast:not(
|
|
92
235
|
.#{$prefix}--actionable-notification--toast
|
|
93
236
|
)::before {
|
|
94
|
-
|
|
95
|
-
box-sizing: border-box;
|
|
96
|
-
border-width: 1px 1px 1px 0;
|
|
97
|
-
border-style: solid;
|
|
98
|
-
block-size: 100%;
|
|
99
|
-
content: '';
|
|
100
|
-
filter: opacity(0.4);
|
|
101
|
-
inline-size: 100%;
|
|
102
|
-
inset-block-start: 0;
|
|
103
|
-
inset-inline-start: 0;
|
|
104
|
-
pointer-events: none;
|
|
237
|
+
@include actionable-notification-low-contrast-inline-before;
|
|
105
238
|
}
|
|
106
239
|
|
|
107
240
|
.#{$prefix}--actionable-notification--error {
|
|
108
|
-
@include notification
|
|
109
|
-
$support-error-inverse,
|
|
110
|
-
$background-inverse
|
|
111
|
-
);
|
|
241
|
+
@include actionable-notification-error-base;
|
|
112
242
|
}
|
|
113
243
|
|
|
114
244
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--error {
|
|
115
|
-
@include notification
|
|
116
|
-
$support-error,
|
|
117
|
-
$notification-background-error
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
&::before {
|
|
121
|
-
border-color: $support-error;
|
|
122
|
-
}
|
|
245
|
+
@include actionable-notification-low-contrast-error;
|
|
123
246
|
}
|
|
124
247
|
|
|
125
248
|
.#{$prefix}--actionable-notification--success {
|
|
126
|
-
@include notification
|
|
127
|
-
$support-success-inverse,
|
|
128
|
-
$background-inverse
|
|
129
|
-
);
|
|
249
|
+
@include actionable-notification-success-base;
|
|
130
250
|
}
|
|
131
251
|
|
|
132
252
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--success {
|
|
133
|
-
@include notification
|
|
134
|
-
$support-success,
|
|
135
|
-
$notification-background-success
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
&::before {
|
|
139
|
-
border-color: $support-success;
|
|
140
|
-
}
|
|
253
|
+
@include actionable-notification-low-contrast-success;
|
|
141
254
|
}
|
|
142
255
|
|
|
143
256
|
.#{$prefix}--actionable-notification--info,
|
|
144
257
|
.#{$prefix}--actionable-notification--info-square {
|
|
145
|
-
@include notification
|
|
146
|
-
$support-info-inverse,
|
|
147
|
-
$background-inverse
|
|
148
|
-
);
|
|
258
|
+
@include actionable-notification-info-base;
|
|
149
259
|
}
|
|
150
260
|
|
|
151
261
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--info,
|
|
152
262
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--info-square {
|
|
153
|
-
@include notification
|
|
154
|
-
$support-info,
|
|
155
|
-
$notification-background-info
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
&::before {
|
|
159
|
-
border-color: $support-info;
|
|
160
|
-
}
|
|
263
|
+
@include actionable-notification-low-contrast-info;
|
|
161
264
|
}
|
|
162
265
|
|
|
163
266
|
.#{$prefix}--actionable-notification--warning,
|
|
164
267
|
.#{$prefix}--actionable-notification--warning-alt {
|
|
165
|
-
@include notification
|
|
166
|
-
$support-warning-inverse,
|
|
167
|
-
$background-inverse
|
|
168
|
-
);
|
|
268
|
+
@include actionable-notification-warning-base;
|
|
169
269
|
}
|
|
170
270
|
|
|
171
271
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--warning,
|
|
172
272
|
.#{$prefix}--actionable-notification--low-contrast.#{$prefix}--actionable-notification--warning-alt {
|
|
173
|
-
@include notification
|
|
174
|
-
$support-warning,
|
|
175
|
-
$notification-background-warning
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
&::before {
|
|
179
|
-
border-color: $support-warning;
|
|
180
|
-
}
|
|
273
|
+
@include actionable-notification-low-contrast-warning;
|
|
181
274
|
}
|
|
182
275
|
|
|
183
276
|
.#{$prefix}--actionable-notification--warning
|
|
@@ -276,11 +369,6 @@
|
|
|
276
369
|
word-break: break-word;
|
|
277
370
|
}
|
|
278
371
|
|
|
279
|
-
.#{$prefix}--actionable-notification--low-contrast
|
|
280
|
-
.#{$prefix}--actionable-notification__subtitle {
|
|
281
|
-
color: $text-primary;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
372
|
.#{$prefix}--actionable-notification__caption {
|
|
285
373
|
@include type-style('body-compact-01');
|
|
286
374
|
|
|
@@ -288,11 +376,6 @@
|
|
|
288
376
|
padding-block-start: $spacing-06;
|
|
289
377
|
}
|
|
290
378
|
|
|
291
|
-
.#{$prefix}--actionable-notification--low-contrast
|
|
292
|
-
.#{$prefix}--actionable-notification__caption {
|
|
293
|
-
color: $text-primary;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
379
|
/* Ghost action button when inline */
|
|
297
380
|
.#{$prefix}--actionable-notification__action-button.#{$prefix}--btn--ghost {
|
|
298
381
|
block-size: convert.to-rem(32px);
|
|
@@ -483,12 +566,6 @@
|
|
|
483
566
|
@include focus-outline('outline');
|
|
484
567
|
}
|
|
485
568
|
|
|
486
|
-
.#{$prefix}--actionable-notification--low-contrast
|
|
487
|
-
.#{$prefix}--actionable-notification__close-button
|
|
488
|
-
.#{$prefix}--actionable-notification__close-icon {
|
|
489
|
-
fill: $icon-primary;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
569
|
// Windows HCM fix
|
|
493
570
|
|
|
494
571
|
.#{$prefix}--actionable-notification {
|