@carbon/styles 1.76.0 → 1.77.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.
@@ -130,8 +130,8 @@ describe('@carbon/styles/scss/type', () => {
130
130
  const { stylesheet } = css.parse(result.css.toString());
131
131
  const [rule] = stylesheet.rules;
132
132
  for (const declaration of rule.declarations) {
133
- expect(declaration.property).toEqual(
134
- expect.stringContaining('--custom-')
133
+ expect(declaration.value).toEqual(
134
+ expect.stringContaining('var(--custom-')
135
135
  );
136
136
  }
137
137
  });
package/scss/_config.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2018, 2023
2
+ // Copyright IBM Corp. 2018, 2025
3
3
  //
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
@@ -18,11 +18,11 @@ $css--body: true !default;
18
18
  /// @group config
19
19
  $css--font-face: true !default;
20
20
 
21
- /// If true, emit the custom type properties in in :root
21
+ /// If true, emit the custom type properties in :root
22
22
  /// @access public
23
23
  /// @type Bool
24
24
  /// @group config
25
- $css--emit-type-custom-props: true !default;
25
+ $css--emit-type-custom-props: false !default;
26
26
 
27
27
  /// If true, include reset CSS
28
28
  /// @access public
@@ -8,6 +8,7 @@
8
8
  @use 'accordion';
9
9
  @use 'ai-label';
10
10
  @use 'aspect-ratio';
11
+ @use 'badge-indicator';
11
12
  @use 'breadcrumb';
12
13
  @use 'button';
13
14
  @use 'chat-button';
@@ -59,6 +60,7 @@
59
60
  @use 'radio-button';
60
61
  @use 'search';
61
62
  @use 'select';
63
+ @use 'shape-indicator';
62
64
  @use 'skeleton-styles';
63
65
  @use 'slider';
64
66
  @use 'slug';
@@ -0,0 +1,48 @@
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
+
8
+ //-----------------------------
9
+ // Badge indicator
10
+ //-----------------------------
11
+
12
+ @use '../../config' as *;
13
+ @use '../../spacing' as *;
14
+ @use '../../theme' as *;
15
+ @use '../../type';
16
+ @use '../../utilities/component-reset';
17
+ @use '../../utilities/convert';
18
+
19
+ /// Badge indicator styles
20
+ /// @access public
21
+ /// @group badge-indicator
22
+ @mixin badge-indicator {
23
+ .#{$prefix}--badge-indicator {
24
+ @include type.type-style('helper-text-01');
25
+
26
+ position: absolute;
27
+ display: flex;
28
+ padding: 0 $spacing-02 $spacing-01;
29
+ border-radius: 100px;
30
+ background: $support-error;
31
+ color: $text-on-color;
32
+
33
+ inset-block-start: 0;
34
+ inset-inline-end: 0;
35
+
36
+ margin-block-start: $spacing-03;
37
+ margin-inline-end: $spacing-03;
38
+
39
+ max-block-size: $spacing-05;
40
+ min-block-size: $spacing-03;
41
+ min-inline-size: $spacing-03;
42
+ }
43
+
44
+ .#{$prefix}--badge-indicator--count {
45
+ margin-block-start: $spacing-02;
46
+ margin-inline-end: $spacing-02;
47
+ }
48
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2023
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
+
8
+ @forward 'badge-indicator';
9
+ @use 'badge-indicator';
10
+
11
+ @include badge-indicator.badge-indicator;
@@ -30,6 +30,14 @@
30
30
  }
31
31
  }
32
32
 
33
+ .#{$prefix}--breadcrumb--sm {
34
+ @include type-style('label-01');
35
+ }
36
+
37
+ .#{$prefix}--breadcrumb .#{$prefix}--link {
38
+ font: inherit;
39
+ }
40
+
33
41
  .#{$prefix}--breadcrumb-item {
34
42
  position: relative;
35
43
  display: flex;
@@ -37,6 +45,10 @@
37
45
  margin-inline-end: $spacing-03;
38
46
  }
39
47
 
48
+ .#{$prefix}--breadcrumb--sm .#{$prefix}--breadcrumb-item {
49
+ margin-inline-end: $spacing-02;
50
+ }
51
+
40
52
  .#{$prefix}--breadcrumb-item .#{$prefix}--link:visited {
41
53
  color: $link-primary;
42
54
 
@@ -51,6 +63,10 @@
51
63
  margin-inline-start: $spacing-03;
52
64
  }
53
65
 
66
+ .#{$prefix}--breadcrumb--sm .#{$prefix}--breadcrumb-item::after {
67
+ margin-inline-start: $spacing-02;
68
+ }
69
+
54
70
  .#{$prefix}--breadcrumb--no-trailing-slash
55
71
  .#{$prefix}--breadcrumb-item:last-child::after {
56
72
  content: '';
@@ -107,6 +123,12 @@
107
123
  }
108
124
  }
109
125
 
126
+ .#{$prefix}--breadcrumb--sm
127
+ .#{$prefix}--breadcrumb-item
128
+ .#{$prefix}--overflow-menu {
129
+ inline-size: $spacing-05;
130
+ }
131
+
110
132
  .#{$prefix}--breadcrumb-item .#{$prefix}--overflow-menu:hover::after {
111
133
  opacity: 1;
112
134
  }
@@ -117,7 +139,9 @@
117
139
  box-shadow: none;
118
140
  }
119
141
 
120
- .#{$prefix}--breadcrumb-item .#{$prefix}--overflow-menu__icon {
142
+ .#{$prefix}--breadcrumb-item
143
+ .#{$prefix}--overflow-menu
144
+ .#{$prefix}--overflow-menu__icon {
121
145
  position: relative;
122
146
  fill: $link-primary;
123
147
  transform: translateY(4px);
@@ -409,6 +409,13 @@
409
409
  box-shadow: none;
410
410
  }
411
411
 
412
+ // badge indicator
413
+
414
+ .#{$prefix}--btn--sm .#{$prefix}--badge-indicator {
415
+ margin-block-start: $spacing-02;
416
+ margin-inline-end: $spacing-02;
417
+ }
418
+
412
419
  // Windows HCM fix
413
420
  .#{$prefix}--btn:focus {
414
421
  @include high-contrast-mode('focus');
@@ -60,6 +60,29 @@ $status-orange: (
60
60
  ),
61
61
  ) !default;
62
62
 
63
+ // status-orange-outline
64
+ $status-orange-outline: (
65
+ fallback: map.get(status.$status-orange-outline, white-theme),
66
+ values: (
67
+ (
68
+ theme: themes.$white,
69
+ value: map.get(status.$status-orange-outline, white-theme),
70
+ ),
71
+ (
72
+ theme: themes.$g10,
73
+ value: map.get(status.$status-orange-outline, g-10),
74
+ ),
75
+ (
76
+ theme: themes.$g90,
77
+ value: map.get(status.$status-orange, g-90),
78
+ ),
79
+ (
80
+ theme: themes.$g100,
81
+ value: map.get(status.$status-orange, g-100),
82
+ ),
83
+ ),
84
+ ) !default;
85
+
63
86
  // status-yellow
64
87
  $status-yellow: (
65
88
  fallback: map.get(status.$status-yellow, white-theme),
@@ -83,6 +106,29 @@ $status-yellow: (
83
106
  ),
84
107
  ) !default;
85
108
 
109
+ // status-yellow-outline
110
+ $status-yellow-outline: (
111
+ fallback: map.get(status.$status-yellow-outline, white-theme),
112
+ values: (
113
+ (
114
+ theme: themes.$white,
115
+ value: map.get(status.$status-yellow-outline, white-theme),
116
+ ),
117
+ (
118
+ theme: themes.$g10,
119
+ value: map.get(status.$status-yellow-outline, g-10),
120
+ ),
121
+ (
122
+ theme: themes.$g90,
123
+ value: map.get(status.$status-yellow, g-90),
124
+ ),
125
+ (
126
+ theme: themes.$g100,
127
+ value: map.get(status.$status-yellow, g-100),
128
+ ),
129
+ ),
130
+ ) !default;
131
+
86
132
  // status-green
87
133
  $status-green: (
88
134
  fallback: map.get(status.$status-green, white-theme),
@@ -179,7 +225,9 @@ $status-gray: (
179
225
  $status-tokens: (
180
226
  status-red: $status-red,
181
227
  status-orange: $status-orange,
228
+ status-orange-outline: $status-orange-outline,
182
229
  status-yellow: $status-yellow,
230
+ status-yellow-outline: $status-yellow-outline,
183
231
  status-green: $status-green,
184
232
  status-blue: $status-blue,
185
233
  status-purple: $status-purple,
@@ -189,7 +237,15 @@ $status-tokens: (
189
237
  // Generate CSS custom properties for each token
190
238
  $status-red: component-tokens.get-var($status-red, 'status-red');
191
239
  $status-orange: component-tokens.get-var($status-orange, 'status-orange');
240
+ $status-orange-outline: component-tokens.get-var(
241
+ $status-orange-outline,
242
+ 'status-orange-outline'
243
+ );
192
244
  $status-yellow: component-tokens.get-var($status-yellow, 'status-yellow');
245
+ $status-yellow-outline: component-tokens.get-var(
246
+ $status-yellow-outline,
247
+ 'status-yellow-outline'
248
+ );
193
249
  $status-green: component-tokens.get-var($status-green, 'status-green');
194
250
  $status-blue: component-tokens.get-var($status-blue, 'status-blue');
195
251
  $status-purple: component-tokens.get-var($status-purple, 'status-purple');
@@ -98,14 +98,6 @@
98
98
  }
99
99
  }
100
100
 
101
- .#{$prefix}--menu-item__icon {
102
- display: none;
103
- }
104
-
105
- .#{$prefix}--menu--with-icons .#{$prefix}--menu-item__icon {
106
- display: flex;
107
- }
108
-
109
101
  .#{$prefix}--menu-item__label {
110
102
  overflow: hidden;
111
103
  text-overflow: ellipsis;
@@ -121,18 +113,74 @@
121
113
  @include component-reset.reset;
122
114
  }
123
115
 
116
+ .#{$prefix}--menu-item__icon,
117
+ .#{$prefix}--menu-item__selection-icon {
118
+ display: none;
119
+ }
120
+
124
121
  .#{$prefix}--menu--with-icons > .#{$prefix}--menu-item,
125
122
  .#{$prefix}--menu--with-icons
126
123
  > .#{$prefix}--menu-item-group
127
124
  > ul
128
125
  > .#{$prefix}--menu-item,
129
126
  .#{$prefix}--menu--with-icons
127
+ > .#{$prefix}--menu-item-radio-group
128
+ > ul
129
+ > .#{$prefix}--menu-item,
130
+ .#{$prefix}--menu--with-selectable-items > .#{$prefix}--menu-item,
131
+ .#{$prefix}--menu--with-selectable-items
132
+ > .#{$prefix}--menu-item-group
133
+ > ul
134
+ > .#{$prefix}--menu-item,
135
+ .#{$prefix}--menu--with-selectable-items
130
136
  > .#{$prefix}--menu-item-radio-group
131
137
  > ul
132
138
  > .#{$prefix}--menu-item {
133
139
  grid-template-columns: 1rem 1fr max-content;
134
140
  }
135
141
 
142
+ .#{$prefix}--menu--with-icons
143
+ > .#{$prefix}--menu-item
144
+ > .#{$prefix}--menu-item__icon,
145
+ .#{$prefix}--menu--with-icons
146
+ > .#{$prefix}--menu-item-group
147
+ > ul
148
+ > .#{$prefix}--menu-item
149
+ > .#{$prefix}--menu-item__icon,
150
+ .#{$prefix}--menu--with-icons
151
+ > .#{$prefix}--menu-item-radio-group
152
+ > ul
153
+ > .#{$prefix}--menu-item
154
+ > .#{$prefix}--menu-item__icon,
155
+ .#{$prefix}--menu--with-selectable-items
156
+ > .#{$prefix}--menu-item
157
+ > .#{$prefix}--menu-item__selection-icon,
158
+ .#{$prefix}--menu--with-selectable-items
159
+ > .#{$prefix}--menu-item-group
160
+ > ul
161
+ > .#{$prefix}--menu-item
162
+ > .#{$prefix}--menu-item__selection-icon,
163
+ .#{$prefix}--menu--with-selectable-items
164
+ > .#{$prefix}--menu-item-radio-group
165
+ > ul
166
+ > .#{$prefix}--menu-item
167
+ > .#{$prefix}--menu-item__selection-icon {
168
+ display: flex;
169
+ }
170
+
171
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
172
+ > .#{$prefix}--menu-item,
173
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
174
+ > .#{$prefix}--menu-item-group
175
+ > ul
176
+ > .#{$prefix}--menu-item,
177
+ .#{$prefix}--menu--with-icons.#{$prefix}--menu--with-selectable-items
178
+ > .#{$prefix}--menu-item-radio-group
179
+ > ul
180
+ > .#{$prefix}--menu-item {
181
+ grid-template-columns: 1rem 1rem 1fr max-content;
182
+ }
183
+
136
184
  .#{$prefix}--menu-item--disabled {
137
185
  color: $text-disabled;
138
186
  cursor: not-allowed;
@@ -30,19 +30,4 @@
30
30
  .#{$prefix}--menu-button__trigger--open svg {
31
31
  transform: rotate(180deg);
32
32
  }
33
-
34
- // Menu alignment classes
35
- $popover-offset: custom-property.get-var('popover-offset', 3rem);
36
-
37
- .#{$prefix}--menu-button__top {
38
- transform: translate(0, calc(-100% - $popover-offset));
39
- }
40
-
41
- .#{$prefix}--menu-button__top-start {
42
- transform: translate(0, calc(-100% - $popover-offset));
43
- }
44
-
45
- .#{$prefix}--menu-button__top-end {
46
- transform: translate(0, calc(-100% - $popover-offset));
47
- }
48
33
  }
@@ -266,6 +266,35 @@ $popover-caret-height: custom-property.get-var(
266
266
  transform: translate($popover-offset, calc(100% + $popover-offset));
267
267
  }
268
268
 
269
+ .#{$prefix}--popover--bottom-end:not(.#{$prefix}--popover--auto-align)
270
+ > .#{$prefix}--popover
271
+ > .#{$prefix}--popover-caret,
272
+ .#{$prefix}--popover--top-end:not(.#{$prefix}--popover--auto-align)
273
+ > .#{$prefix}--popover
274
+ > .#{$prefix}--popover-caret {
275
+ inset-block-end: 0;
276
+ inset-inline-end: 0;
277
+ inset-inline-start: auto;
278
+ }
279
+
280
+ .#{$prefix}--popover--bottom-start:not(.#{$prefix}--popover--auto-align)
281
+ > .#{$prefix}--popover
282
+ > .#{$prefix}--popover-caret {
283
+ inset-block-end: 0;
284
+ inset-inline-end: auto;
285
+ inset-inline-start: 0;
286
+ transform: translate(50%, calc($popover-offset));
287
+ }
288
+
289
+ .#{$prefix}--popover--top-start:not(.#{$prefix}--popover--auto-align)
290
+ > .#{$prefix}--popover
291
+ > .#{$prefix}--popover-caret {
292
+ inset-block-end: 0;
293
+ inset-inline-end: auto;
294
+ inset-inline-start: 0;
295
+ transform: translate(50%, calc(-1 * $popover-offset));
296
+ }
297
+
269
298
  [dir='rtl']
270
299
  .#{$prefix}--popover--bottom-right:not(.#{$prefix}--popover--auto-align)
271
300
  > .#{$prefix}--popover
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2023
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
+
8
+ @forward 'shape-indicator';
9
+
10
+ @use 'shape-indicator';
11
+
12
+ @include shape-indicator.shape-indicator;
@@ -0,0 +1,92 @@
1
+ //
2
+ // Copyright IBM Corp. 2016, 2023
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
+
8
+ @use '../../theme' as *;
9
+ @use '../../type' as *;
10
+ @use '../../config' as *;
11
+ @use '../../spacing' as *;
12
+ @use '../../colors' as *;
13
+ @use '../icon-indicator/tokens' as *;
14
+
15
+ /// shape-indicator styles
16
+ /// @access public
17
+ /// @group tag
18
+ @mixin shape-indicator {
19
+ .#{$prefix}--shape-indicator {
20
+ @include type-style('helper-text-01');
21
+
22
+ display: flex;
23
+ color: $text-secondary;
24
+ }
25
+
26
+ .#{$prefix}--shape-indicator svg {
27
+ align-self: center;
28
+ margin-inline-end: $spacing-03;
29
+ }
30
+
31
+ .#{$prefix}--shape-indicator--14 {
32
+ @include type-style('body-compact-01');
33
+ }
34
+
35
+ .#{$prefix}--shape-indicator--failed {
36
+ fill: $status-red;
37
+ }
38
+
39
+ .#{$prefix}--shape-indicator--critical {
40
+ fill: $status-red;
41
+ }
42
+
43
+ .#{$prefix}--shape-indicator--high {
44
+ fill: $status-red;
45
+ }
46
+
47
+ .#{$prefix}--shape-indicator--medium {
48
+ fill: $status-orange;
49
+
50
+ path:first-of-type {
51
+ fill: $status-orange-outline;
52
+ }
53
+ }
54
+
55
+ .#{$prefix}--shape-indicator--low {
56
+ fill: $status-yellow;
57
+
58
+ path:nth-of-type(2) {
59
+ fill: $status-yellow-outline;
60
+ }
61
+ }
62
+
63
+ .#{$prefix}--shape-indicator--cautious {
64
+ fill: $status-yellow;
65
+
66
+ path:first-of-type {
67
+ fill: $status-yellow-outline;
68
+ }
69
+ }
70
+
71
+ .#{$prefix}--shape-indicator--undefined {
72
+ fill: $status-purple;
73
+ }
74
+
75
+ .#{$prefix}--shape-indicator--stable {
76
+ fill: $status-green;
77
+ }
78
+
79
+ .#{$prefix}--shape-indicator--informative {
80
+ fill: $status-blue;
81
+ }
82
+
83
+ .#{$prefix}--shape-indicator--incomplete {
84
+ path:nth-of-type(2) {
85
+ fill: $status-blue;
86
+ }
87
+ }
88
+
89
+ .#{$prefix}--shape-indicator--draft {
90
+ fill: $status-gray;
91
+ }
92
+ }
@@ -315,6 +315,7 @@
315
315
  .#{$prefix}--tabs__nav-item {
316
316
  @include reset;
317
317
 
318
+ position: relative;
318
319
  display: flex;
319
320
  flex: 1 0 auto;
320
321
  padding: 0;
@@ -547,6 +548,14 @@
547
548
  }
548
549
  }
549
550
 
551
+ .#{$prefix}--tabs__nav-item--icon-only:not(
552
+ .#{$prefix}--tabs__nav-item--icon-only__20
553
+ )
554
+ .#{$prefix}--badge-indicator {
555
+ margin-block-start: $spacing-02;
556
+ margin-inline-end: $spacing-02;
557
+ }
558
+
550
559
  //-----------------------------
551
560
  // Item Hover
552
561
  //-----------------------------
@@ -35,7 +35,6 @@ $tooltip-padding-inline: custom-property.get-var(
35
35
  @include type.type-style('body-01');
36
36
 
37
37
  padding: $tooltip-padding-block $tooltip-padding-inline;
38
- color: theme.$text-inverse;
39
38
  max-inline-size: convert.to-rem(288px);
40
39
  }
41
40
  }
@@ -64,6 +63,8 @@ $tooltip-padding-inline: custom-property.get-var(
64
63
 
65
64
  padding: convert.to-rem(8px) convert.to-rem(16px);
66
65
  max-inline-size: convert.to-rem(176px);
66
+ text-wrap: auto;
67
+ word-break: break-word;
67
68
  }
68
69
  }
69
70
 
@@ -163,11 +163,9 @@
163
163
  .#{$prefix}--tree-parent-node__toggle {
164
164
  display: flex;
165
165
  align-items: center;
166
- align-self: flex-start;
167
166
  border: 0;
168
167
  block-size: convert.to-rem(24px);
169
168
  inline-size: convert.to-rem(24px);
170
- margin-block-start: $spacing-02;
171
169
  margin-inline: -$spacing-02 $spacing-02;
172
170
  padding-inline-start: $spacing-02;
173
171
 
@@ -191,9 +189,7 @@
191
189
  }
192
190
 
193
191
  .#{$prefix}--tree-node__icon {
194
- align-self: flex-start;
195
192
  fill: $icon-secondary;
196
- margin-block-start: convert.to-rem(1px);
197
193
  margin-inline: $spacing-03 $spacing-03;
198
194
  min-block-size: 1rem;
199
195
  min-inline-size: 1rem;