@carbon/styles 1.24.0 → 1.25.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.24.0",
4
+ "version": "1.25.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -59,5 +59,5 @@
59
59
  "scss/**/*.css",
60
60
  "css/**/*.css"
61
61
  ],
62
- "gitHead": "07168bf0272678a04c92cd1e700ac60e66355a95"
62
+ "gitHead": "47966b102beb1310c23bb0fc914a22f639dc08d6"
63
63
  }
@@ -12,6 +12,7 @@
12
12
  @use 'checkbox';
13
13
  @use 'code-snippet';
14
14
  @use 'combo-box';
15
+ @use 'combo-button';
15
16
  @use 'contained-list';
16
17
  @use 'content-switcher';
17
18
  @use 'copy-button';
@@ -40,6 +41,7 @@
40
41
  @use 'list';
41
42
  @use 'list-box';
42
43
  @use 'loading';
44
+ @use 'menu-button';
43
45
  @use 'menu';
44
46
  @use 'modal';
45
47
  @use 'multiselect';
@@ -201,6 +201,12 @@ $copy-btn-feedback: $background-inverse !default;
201
201
  order: 1;
202
202
  overflow-y: auto;
203
203
  transition: max-height $duration-moderate-01 motion(standard, productive);
204
+
205
+ &:focus {
206
+ @include focus-outline('outline');
207
+
208
+ outline-offset: 0;
209
+ }
204
210
  }
205
211
 
206
212
  // expanded snippet container
@@ -0,0 +1,47 @@
1
+ //
2
+ // Copyright IBM Corp. 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 '../../config' as *;
9
+ @use '../../motion' as *;
10
+ @use '../../utilities/convert' as *;
11
+
12
+ /// Combo Button styles
13
+ /// @access public
14
+ /// @group combo-button
15
+ @mixin combo-button {
16
+ .#{$prefix}--combo-button__container {
17
+ display: inline-flex;
18
+ column-gap: rem(1px);
19
+ }
20
+
21
+ $triggerSizes: (
22
+ 'sm': rem(32px),
23
+ 'md': rem(40px),
24
+ 'lg': rem(48px),
25
+ );
26
+
27
+ @each $size, $trigger in $triggerSizes {
28
+ .#{$prefix}--combo-button__container--#{$size}
29
+ .#{$prefix}--combo-button__primary-action {
30
+ min-width: 10rem - rem(1px) - $trigger;
31
+ }
32
+ }
33
+
34
+ .#{$prefix}--combo-button__primary-action .#{$prefix}--btn {
35
+ width: 100%;
36
+ }
37
+
38
+ .#{$prefix}--combo-button__trigger svg {
39
+ transition: transform $duration-fast-02 motion(standard, productive);
40
+ }
41
+
42
+ .#{$prefix}--combo-button__container--open
43
+ .#{$prefix}--combo-button__trigger
44
+ svg {
45
+ transform: rotate(180deg);
46
+ }
47
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 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 'combo-button';
9
+ @use 'combo-button';
10
+
11
+ @include combo-button.combo-button;
@@ -393,10 +393,9 @@
393
393
  .#{$prefix}--batch-actions:focus {
394
394
  @include focus-outline;
395
395
  }
396
-
396
+ // 200% to allow tooltips
397
397
  .#{$prefix}--batch-actions--active {
398
- overflow: auto hidden;
399
- clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
398
+ clip-path: polygon(0 0, 200% 0, 200% 200%, 0 200%);
400
399
  pointer-events: all;
401
400
  transform: translate3d(0, 0, 0);
402
401
  }
@@ -11,6 +11,7 @@
11
11
  @use '../../theme' as *;
12
12
  @use '../../type' as *;
13
13
 
14
+ @use '../../utilities/button-reset';
14
15
  @use '../../utilities/convert' as *;
15
16
  @use '../../utilities/focus-outline' as *;
16
17
  @use '../../utilities/high-contrast-mode' as *;
@@ -320,6 +321,8 @@
320
321
  }
321
322
 
322
323
  .#{$prefix}--file__drop-container {
324
+ @include button-reset.reset;
325
+
323
326
  display: flex;
324
327
  overflow: hidden;
325
328
  height: rem(96px);
@@ -19,6 +19,16 @@
19
19
  @use '../fluid-combo-box';
20
20
 
21
21
  @mixin fluid-multiselect {
22
+ .#{$prefix}--multi-select__wrapper.#{$prefix}--list-box__wrapper--fluid--focus:not(.#{$prefix}--multi-select--filterable__wrapper)
23
+ .#{$prefix}--list-box__field--wrapper--input-focused {
24
+ outline: none;
25
+ }
26
+
27
+ .#{$prefix}--list-box__wrapper--fluid
28
+ .#{$prefix}--tag.#{$prefix}--tag--filter {
29
+ margin-top: 1.25rem;
30
+ }
31
+
22
32
  // Filterable
23
33
  .#{$prefix}--list-box__wrapper--fluid
24
34
  .#{$prefix}--multi-select--filterable--input-focused {
@@ -91,9 +91,17 @@
91
91
  display: none;
92
92
  }
93
93
 
94
+ .#{$prefix}--text-area--fluid .#{$prefix}--text-area--invalid,
95
+ .#{$prefix}--text-area--fluid .#{$prefix}--text-area--warn {
96
+ resize: none;
97
+ }
98
+
99
+ .#{$prefix}--text-area--fluid
100
+ .#{$prefix}--text-area__wrapper[data-invalid]
101
+ .#{$prefix}--text-area__divider,
94
102
  .#{$prefix}--text-area--fluid
95
- .#{$prefix}--text-area--invalid
96
- + .#{$prefix}--text-area__divider {
103
+ .#{$prefix}--text-area__wrapper--warn
104
+ .#{$prefix}--text-area__divider {
97
105
  display: block;
98
106
  border-style: solid;
99
107
  border-color: $border-subtle;
@@ -101,11 +109,13 @@
101
109
  margin: 0 1rem;
102
110
  }
103
111
 
104
- // invalid error message container
112
+ // invalid & warning error message container
105
113
  .#{$prefix}--text-area--fluid
106
- .#{$prefix}--text-area--invalid
107
- + .#{$prefix}--text-area__divider
108
- + .#{$prefix}--form-requirement {
114
+ .#{$prefix}--text-area__wrapper[data-invalid]
115
+ .#{$prefix}--form-requirement.#{$prefix}--form-requirement,
116
+ .#{$prefix}--text-area--fluid
117
+ .#{$prefix}--text-area__wrapper--warn
118
+ .#{$prefix}--form-requirement.#{$prefix}--form-requirement {
109
119
  position: relative;
110
120
  display: block;
111
121
  overflow: visible;
@@ -113,13 +123,30 @@
113
123
  padding: 0.5rem 2.5rem 0.5rem 1rem;
114
124
  margin: 0;
115
125
  background: $field;
126
+ }
127
+
128
+ .#{$prefix}--text-area--fluid
129
+ .#{$prefix}--text-area__wrapper--warn
130
+ .#{$prefix}--form-requirement.#{$prefix}--form-requirement {
131
+ border-bottom: 1px solid $border-strong;
132
+ color: $text-primary;
133
+ }
134
+
135
+ .#{$prefix}--text-area--fluid
136
+ .#{$prefix}--text-area__wrapper[data-invalid]
137
+ .#{$prefix}--form-requirement.#{$prefix}--form-requirement {
138
+ border-bottom: none;
116
139
  color: $text-error;
117
140
  }
118
141
 
142
+ .#{$prefix}--text-area--fluid .#{$prefix}--text-area--warn {
143
+ border-bottom: none;
144
+ }
145
+
119
146
  .#{$prefix}--modal
120
147
  .#{$prefix}--text-area--fluid
121
- .#{$prefix}--text-area--invalid
122
- + .#{$prefix}--text-area__divider
148
+ .#{$prefix}--text-area__wrapper[data-invalid]
149
+ .#{$prefix}--text-area__divider
123
150
  + .#{$prefix}--form-requirement {
124
151
  background: $field-02;
125
152
  }
@@ -125,7 +125,7 @@ $input-label-weight: 400 !default;
125
125
  > .#{$prefix}--text-area--invalid:not(:focus),
126
126
  .#{$prefix}--select-input__wrapper[data-invalid]
127
127
  .#{$prefix}--select-input:not(:focus),
128
- .#{$prefix}--list-box[data-invalid]:not(:focus),
128
+ .#{$prefix}--list-box[data-invalid]:not(.#{$prefix}--multi-select--invalid--focused),
129
129
  .#{$prefix}--combo-box[data-invalid]:not(.#{$prefix}--multi-select--selected)
130
130
  .#{$prefix}--text-input:not(:focus) {
131
131
  @include focus-outline('invalid');
@@ -142,6 +142,7 @@ $input-label-weight: 400 !default;
142
142
  .#{$prefix}--text-input__field-wrapper--warning,
143
143
  .#{$prefix}--text-input__field-wrapper--warning > .#{$prefix}--text-input,
144
144
  .#{$prefix}--text-area__wrapper[data-invalid],
145
+ .#{$prefix}--text-area__wrapper--warn,
145
146
  .#{$prefix}--select-input__wrapper[data-invalid],
146
147
  .#{$prefix}--select--warning .#{$prefix}--select-input__wrapper,
147
148
  .#{$prefix}--time-picker[data-invalid],
@@ -27,7 +27,7 @@
27
27
 
28
28
  position: fixed;
29
29
  z-index: z('modal');
30
- min-width: 13rem;
30
+ min-width: 10rem;
31
31
  max-width: 18rem;
32
32
  padding: $spacing-02 0;
33
33
  background-color: $layer;
@@ -35,6 +35,10 @@
35
35
  visibility: hidden;
36
36
  }
37
37
 
38
+ .#{$prefix}--menu--with-icons {
39
+ min-width: 12rem;
40
+ }
41
+
38
42
  .#{$prefix}--menu--open {
39
43
  visibility: visible;
40
44
 
@@ -62,7 +66,7 @@
62
66
  color: $text-primary;
63
67
  column-gap: $spacing-03;
64
68
  cursor: pointer;
65
- grid-template-columns: 0 1fr max-content;
69
+ grid-template-columns: 1fr max-content;
66
70
  padding-inline: $spacing-05;
67
71
  transition: background-color $duration-fast-01 motion(standard, productive);
68
72
 
@@ -89,6 +93,10 @@
89
93
  }
90
94
 
91
95
  .#{$prefix}--menu-item__icon {
96
+ display: none;
97
+ }
98
+
99
+ .#{$prefix}--menu--with-icons .#{$prefix}--menu-item__icon {
92
100
  display: flex;
93
101
  }
94
102
 
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright IBM Corp. 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 'menu-button';
9
+ @use 'menu-button';
10
+
11
+ @include menu-button.menu-button;
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright IBM Corp. 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 '../../config' as *;
9
+ @use '../../motion' as *;
10
+ @use '../../utilities/convert' as *;
11
+
12
+ /// Menu Button styles
13
+ /// @access public
14
+ /// @group menu-button
15
+ @mixin menu-button {
16
+ .#{$prefix}--menu-button__trigger:not(.#{$prefix}--btn--ghost) {
17
+ min-width: 10rem;
18
+ }
19
+
20
+ .#{$prefix}--menu-button__trigger svg {
21
+ transition: transform $duration-fast-02 motion(standard, productive);
22
+ }
23
+
24
+ .#{$prefix}--menu-button__trigger--open svg {
25
+ transform: rotate(180deg);
26
+ }
27
+ }
@@ -17,12 +17,19 @@
17
17
  /// @access public
18
18
  /// @group multi-select
19
19
  @mixin multiselect {
20
- .#{$prefix}--multi-select .#{$prefix}--tag {
21
- min-width: auto;
22
- margin: 0 $spacing-03 0 0;
20
+ .#{$prefix}--multi-select .#{$prefix}--list-box__field--wrapper {
21
+ display: inline-flex;
22
+ width: 100%;
23
+ height: calc(100% + 1px);
24
+ align-items: center;
25
+ }
26
+
27
+ .#{$prefix}--multi-select .#{$prefix}--list-box__field:focus {
28
+ @include focus-outline('reset');
23
29
  }
24
30
 
25
- .#{$prefix}--multi-select--filterable .#{$prefix}--tag {
31
+ .#{$prefix}--multi-select .#{$prefix}--tag {
32
+ min-width: auto;
26
33
  margin: 0 $spacing-03 0 $spacing-05;
27
34
  }
28
35
 
@@ -75,12 +82,16 @@
75
82
  outline: none;
76
83
  }
77
84
 
78
- .#{$prefix}--multi-select--filterable--input-focused {
85
+ .#{$prefix}--multi-select--filterable--input-focused,
86
+ .#{$prefix}--multi-select
87
+ .#{$prefix}--list-box__field--wrapper--input-focused {
79
88
  @include focus-outline('outline');
80
89
  }
81
90
 
82
91
  .#{$prefix}--multi-select--filterable.#{$prefix}--multi-select--selected
83
- .#{$prefix}--text-input {
92
+ .#{$prefix}--text-input,
93
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--selected
94
+ .#{$prefix}--list-box__field {
84
95
  padding-left: 0;
85
96
  }
86
97
 
@@ -8,6 +8,7 @@
8
8
  @use '../../config' as *;
9
9
  @use '../../theme';
10
10
  @use '../../utilities/box-shadow' as *;
11
+ @use '../../utilities/button-reset';
11
12
  @use '../../utilities/custom-property';
12
13
  @use '../../utilities/high-contrast-mode' as *;
13
14
  @use '../../utilities/focus-outline' as *;
@@ -370,4 +371,51 @@ $popover-caret-height: custom-property.get-var(
370
371
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
371
372
  transform: translate(calc(-1 * $popover-offset + 100%), -50%);
372
373
  }
374
+
375
+ //-----------------------------------------------------------------------------
376
+ // Tab Tip Variant
377
+ //-----------------------------------------------------------------------------
378
+ .#{$prefix}--popover--tab-tip .#{$prefix}--popover-content {
379
+ border-radius: 0;
380
+ }
381
+
382
+ .#{$prefix}--popover--tab-tip__button {
383
+ @include button-reset.reset;
384
+
385
+ position: relative;
386
+ display: inline-flex;
387
+ width: rem(32px);
388
+ height: rem(32px);
389
+ align-items: center;
390
+ justify-content: center;
391
+
392
+ &:focus {
393
+ @include focus-outline('outline');
394
+ }
395
+
396
+ &:hover {
397
+ background-color: theme.$layer-hover;
398
+ }
399
+ }
400
+
401
+ .#{$prefix}--popover--tab-tip.#{$prefix}--popover--open
402
+ .#{$prefix}--popover--tab-tip__button {
403
+ background: theme.$layer;
404
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
405
+ }
406
+
407
+ .#{$prefix}--popover--tab-tip.#{$prefix}--popover--open
408
+ .#{$prefix}--popover--tab-tip__button:not(:focus)::after {
409
+ position: absolute;
410
+ z-index: z('floating') + 1;
411
+ bottom: 0;
412
+ width: 100%;
413
+ height: 2px;
414
+ background: theme.$layer;
415
+ content: '';
416
+ }
417
+
418
+ .#{$prefix}--popover--tab-tip__button svg {
419
+ fill: theme.$icon-primary;
420
+ }
373
421
  }
@@ -279,7 +279,6 @@ $icon-tab-size: custom-property.get-var('icon-tab-size', rem(40px));
279
279
  }
280
280
 
281
281
  overflow: hidden;
282
- max-width: 10rem;
283
282
  padding: $spacing-04 $spacing-05 $spacing-03;
284
283
  border-bottom: $tab-underline-color;
285
284
  color: $text-secondary;
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  @use '../form';
9
+ @use '../../colors' as *;
9
10
  @use '../../config' as *;
10
11
  @use '../../motion' as *;
11
12
  @use '../../spacing' as *;
@@ -71,6 +72,15 @@
71
72
  fill: $support-error;
72
73
  }
73
74
 
75
+ .#{$prefix}--text-area__invalid-icon--warning {
76
+ fill: $support-warning;
77
+ }
78
+
79
+ .#{$prefix}--text-area__invalid-icon--warning path[fill] {
80
+ fill: $black-100;
81
+ opacity: 1;
82
+ }
83
+
74
84
  .#{$prefix}--text-area__counter-alert {
75
85
  position: absolute;
76
86
  overflow: hidden;