@carbon/styles 1.112.0 → 1.113.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/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.112.0",
4
+ "version": "1.113.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -40,15 +40,15 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@carbon/colors": "^11.55.0",
44
- "@carbon/feature-flags": "^1.6.0",
45
- "@carbon/grid": "^11.59.0",
46
- "@carbon/layout": "^11.56.0",
47
- "@carbon/motion": "^11.49.0",
48
- "@carbon/themes": "^11.78.0",
49
- "@carbon/type": "^11.64.0",
43
+ "@carbon/colors": "^11.56.0",
44
+ "@carbon/feature-flags": "^1.7.0",
45
+ "@carbon/grid": "^11.60.0",
46
+ "@carbon/layout": "^11.57.0",
47
+ "@carbon/motion": "^11.50.0",
48
+ "@carbon/themes": "^11.79.0",
49
+ "@carbon/type": "^11.65.0",
50
50
  "@ibm/plex": "6.4.1",
51
- "@ibm/plex-mono": "1.1.0",
51
+ "@ibm/plex-mono": "2.5.0",
52
52
  "@ibm/plex-sans": "1.1.0",
53
53
  "@ibm/plex-sans-arabic": "1.1.0",
54
54
  "@ibm/plex-sans-devanagari": "1.1.0",
@@ -75,5 +75,5 @@
75
75
  "scss/**/*.css",
76
76
  "css/**/*.css"
77
77
  ],
78
- "gitHead": "a57cf8a896fe3fe09c5ab27648cd58947f37360a"
78
+ "gitHead": "188d23202ec1092322dee92cf0df9d9958224ae4"
79
79
  }
@@ -39,6 +39,7 @@ describe('scss/components/button', () => {
39
39
  "button-padding-ghost-sm",
40
40
  "button-border-width",
41
41
  "button-outline-width",
42
+ "button-min-inline-size",
42
43
  "button-separator",
43
44
  "button-primary",
44
45
  "button-secondary",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2018, 2023
2
+ * Copyright IBM Corp. 2018, 2026
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.
@@ -9,6 +9,7 @@
9
9
 
10
10
  'use strict';
11
11
 
12
+ const postcss = require('postcss');
12
13
  const { SassRenderer } = require('@carbon/test-utils/scss');
13
14
 
14
15
  const { render } = SassRenderer.create(__dirname);
@@ -23,4 +24,44 @@ describe('scss/components/pagination', () => {
23
24
  `);
24
25
  expect(unwrap('mixin')).toBe(true);
25
26
  });
27
+
28
+ test('hover styles are only applied on devices that support hover', async () => {
29
+ const { result } = await render(`
30
+ @use '../pagination';
31
+ `);
32
+ const hoverRules = [];
33
+
34
+ postcss.parse(result.css.toString()).walkRules((rule) => {
35
+ if (
36
+ (rule.selector.includes('.cds--pagination') ||
37
+ rule.selector.includes('.cds--unstable-pagination')) &&
38
+ rule.selector.includes(':hover')
39
+ ) {
40
+ hoverRules.push(rule);
41
+ }
42
+ });
43
+
44
+ expect(hoverRules.length).toBeGreaterThan(0);
45
+ expect(
46
+ hoverRules
47
+ .filter((rule) => {
48
+ let parent = rule.parent;
49
+
50
+ while (parent) {
51
+ if (
52
+ parent.type === 'atrule' &&
53
+ parent.name === 'media' &&
54
+ parent.params.includes('(any-hover: hover)')
55
+ ) {
56
+ return false;
57
+ }
58
+
59
+ parent = parent.parent;
60
+ }
61
+
62
+ return true;
63
+ })
64
+ .map((rule) => rule.selector)
65
+ ).toEqual([]);
66
+ });
26
67
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2018, 2023
2
+ * Copyright IBM Corp. 2018, 2026
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.
@@ -9,6 +9,7 @@
9
9
 
10
10
  'use strict';
11
11
 
12
+ const postcss = require('postcss');
12
13
  const { SassRenderer } = require('@carbon/test-utils/scss');
13
14
 
14
15
  const { render } = SassRenderer.create(__dirname);
@@ -24,4 +25,60 @@ describe('scss/components/ui-shell', () => {
24
25
  `);
25
26
  expect(unwrap('mixin')).toBe(true);
26
27
  });
28
+
29
+ test('header hover styles are only applied on devices that support hover', async () => {
30
+ const { result } = await render(`
31
+ @use '../ui-shell/header';
32
+ `);
33
+ const hoverRules = [];
34
+
35
+ postcss.parse(result.css.toString()).walkRules((rule) => {
36
+ if (
37
+ rule.selector.includes('.cds--header') &&
38
+ rule.selector.includes(':hover')
39
+ ) {
40
+ hoverRules.push(rule);
41
+ }
42
+ });
43
+
44
+ expect(hoverRules.length).toBeGreaterThan(0);
45
+ expect(
46
+ hoverRules.some((rule) =>
47
+ rule.selector.includes('.cds--header__action:hover')
48
+ )
49
+ ).toBe(true);
50
+ expect(
51
+ hoverRules.some((rule) =>
52
+ rule.selector.includes('.cds--header__menu-item:hover')
53
+ )
54
+ ).toBe(true);
55
+ expect(
56
+ hoverRules.some(
57
+ (rule) =>
58
+ rule.selector.includes('.cds--header__menu-item--current') &&
59
+ rule.selector.includes(':hover')
60
+ )
61
+ ).toBe(true);
62
+ expect(
63
+ hoverRules
64
+ .filter((rule) => {
65
+ let parent = rule.parent;
66
+
67
+ while (parent) {
68
+ if (
69
+ parent.type === 'atrule' &&
70
+ parent.name === 'media' &&
71
+ parent.params.includes('(any-hover: hover)')
72
+ ) {
73
+ return false;
74
+ }
75
+
76
+ parent = parent.parent;
77
+ }
78
+
79
+ return true;
80
+ })
81
+ .map((rule) => rule.selector)
82
+ ).toEqual([]);
83
+ });
27
84
  });
@@ -6,11 +6,13 @@
6
6
  //
7
7
 
8
8
  @use 'accordion';
9
+ @use 'action-set';
9
10
  @use 'ai-label';
10
11
  @use 'aspect-ratio';
11
12
  @use 'badge-indicator';
12
13
  @use 'breadcrumb';
13
14
  @use 'button';
15
+ @use 'card';
14
16
  @use 'chat-button';
15
17
  @use 'checkbox';
16
18
  @use 'code-snippet';
@@ -60,6 +62,8 @@
60
62
  @use 'progress-bar';
61
63
  @use 'progress-indicator';
62
64
  @use 'radio-button';
65
+ @use 'resizer';
66
+ @use 'side-panel';
63
67
  @use 'search';
64
68
  @use 'select';
65
69
  @use 'shape-indicator';
@@ -78,4 +82,5 @@
78
82
  @use 'toggle';
79
83
  @use 'tooltip';
80
84
  @use 'treeview';
85
+ @use 'truncated-text';
81
86
  @use 'ui-shell';
@@ -0,0 +1,130 @@
1
+ //
2
+ // Copyright IBM Corp. 2021, 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
+ // Action set
10
+ //-----------------------------
11
+
12
+ @use '../../config' as *;
13
+ @use '../../theme' as *;
14
+ @use '../../type';
15
+ @use '../../spacing' as *;
16
+ @use '../../utilities/convert' as *;
17
+
18
+ /// Action set styles
19
+ /// @access public
20
+ /// @group action-set
21
+ @mixin action-set {
22
+ .#{$prefix}--action-set {
23
+ align-items: stretch;
24
+ justify-content: flex-end;
25
+ background-color: $layer-01;
26
+ }
27
+
28
+ .#{$prefix}--action-set .#{$prefix}--action-set__action-button {
29
+ @include type.type-style('body-short-01');
30
+
31
+ align-items: center;
32
+ margin: 0;
33
+
34
+ &.#{$prefix}--action-set__action-button--expressive {
35
+ block-size: $spacing-10;
36
+ padding-block: $spacing-05 $spacing-07;
37
+ }
38
+ }
39
+
40
+ .#{$prefix}--action-set.#{$prefix}--btn-set
41
+ .#{$prefix}--action-set__action-button.#{$prefix}--btn.#{$prefix}--btn--expressive,
42
+ .#{$prefix}--action-set.#{$prefix}--btn-set
43
+ .#{$prefix}--action-set__action-button.#{$prefix}--btn {
44
+ max-inline-size: none;
45
+ }
46
+
47
+ .#{$prefix}--action-set:not(.#{$prefix}--action-set--stacking)
48
+ .#{$prefix}--action-set__action-button--ghost {
49
+ padding-inline-start: $spacing-05;
50
+ }
51
+
52
+ // For row-single in medium,
53
+ // or for ghosts in row-single,
54
+ // buttons are 100% width
55
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-single.#{$prefix}--action-set--md
56
+ .#{$prefix}--action-set__action-button,
57
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-single
58
+ .#{$prefix}--action-set__action-button--ghost {
59
+ flex: 0 0 100%;
60
+ }
61
+
62
+ // For ghosts in row-double,
63
+ // buttons are 75% width and expand to use any remaining space
64
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-double
65
+ .#{$prefix}--action-set__action-button--ghost {
66
+ flex: 1 1 75%;
67
+ }
68
+
69
+ // For row-single in large (non-ghost),
70
+ // or row-double in medium or large,
71
+ // buttons are 50% width
72
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-single.#{$prefix}--action-set--lg
73
+ .#{$prefix}--action-set__action-button:not(
74
+ .#{$prefix}--action-set__action-button--ghost
75
+ ),
76
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-double.#{$prefix}--action-set--md
77
+ .#{$prefix}--action-set__action-button,
78
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-double.#{$prefix}--action-set--lg
79
+ .#{$prefix}--action-set__action-button,
80
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-triple
81
+ .#{$prefix}--action-set__action-button--ghost {
82
+ flex: 0 1 50%;
83
+ }
84
+
85
+ // For ghosts in row-triple,
86
+ // buttons are 50% width and expand to use any remaining space
87
+ .#{$prefix}--action-set.#{$prefix}--action-set--row-triple
88
+ .#{$prefix}--action-set__action-button--ghost {
89
+ flex: 1 1 50%;
90
+ }
91
+
92
+ // For row-triple in large (non-ghost),
93
+ // or any non-ghosts in extra large or 2xl,
94
+ // or row-quadruple (non-ghost),
95
+ // buttons are 25% width with a max of 232px
96
+ .#{$prefix}--action-set.#{$prefix}--btn-set.#{$prefix}--action-set--row-triple.#{$prefix}--action-set--lg
97
+ .#{$prefix}--action-set__action-button:not(
98
+ .#{$prefix}--action-set__action-button--ghost
99
+ ),
100
+ .#{$prefix}--action-set.#{$prefix}--btn-set.#{$prefix}--action-set--xl
101
+ .#{$prefix}--action-set__action-button:not(
102
+ .#{$prefix}--action-set__action-button--ghost
103
+ ),
104
+ .#{$prefix}--action-set.#{$prefix}--btn-set.#{$prefix}--action-set--2xl
105
+ .#{$prefix}--action-set__action-button:not(
106
+ .#{$prefix}--action-set__action-button--ghost
107
+ ),
108
+ .#{$prefix}--action-set.#{$prefix}--btn-set.#{$prefix}--action-set--row-quadruple
109
+ .#{$prefix}--action-set__action-button:not(
110
+ .#{$prefix}--action-set__action-button--ghost
111
+ ) {
112
+ flex: 0 1 25%;
113
+
114
+ max-inline-size: to-rem(232px);
115
+ }
116
+
117
+ .#{$prefix}--action-set.#{$prefix}--btn-set.#{$prefix}--action-set--row-quadruple
118
+ .#{$prefix}--action-set__action-button--ghost {
119
+ flex: 1 1 25%;
120
+ }
121
+
122
+ .#{$prefix}--action-set
123
+ .#{$prefix}--action-set__action-button
124
+ .#{$prefix}--inline-loading {
125
+ position: absolute;
126
+ inline-size: $spacing-07;
127
+ inset-block-start: 0;
128
+ inset-inline-end: 0;
129
+ }
130
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 2021, 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
+ @forward 'action-set';
9
+ @use 'action-set';
10
+
11
+ @include action-set.action-set;
@@ -58,9 +58,9 @@
58
58
  // NOTE: Container queries are based on this value which is based on IBM Products implementation
59
59
  // Side panel has up to 3 buttons unstacked from size lg (640px). Min 160.33px/button
60
60
  // Narrow Tearsheet 540px has 4 buttons unstacked buttons. Min 135px/button
61
- // May need to be configurable as 3 * 135px is less than 640px.
62
- // Current value 176px only supports up to 3 buttons at 540px.
63
- $min-inline-button-size: convert.to-rem(176px);
61
+ // Override via `@use '@carbon/styles/scss/components/button' with
62
+ // ($button-min-inline-size: <value>)` for contexts that need a different threshold.
63
+ $min-inline-button-size: $button-min-inline-size;
64
64
 
65
65
  .#{$prefix}--btn-set__fluid-inner .#{$prefix}--btn {
66
66
  // default non-column layout
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  @use '../../spacing' as *;
9
+ @use '../../utilities/convert';
9
10
 
10
11
  /// @type Number
11
12
  /// @access public
@@ -77,3 +78,12 @@ $button-border-width: 2px !default;
77
78
  /// @access public
78
79
  /// @group button
79
80
  $button-outline-width: 1px !default;
81
+
82
+ /// Minimum inline size of a fluid button. Used as the container-query threshold
83
+ /// for stacking fluid button sets. Contexts with more buttons or narrower
84
+ /// containers (e.g. Tearsheet at 540px with 4 buttons) should lower this value
85
+ /// via `@use … with ($button-min-inline-size: <value>)`.
86
+ /// @type Number
87
+ /// @access public
88
+ /// @group button
89
+ $button-min-inline-size: convert.to-rem(176px) !default;