@carbon/styles 1.17.0 → 1.18.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/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.17.0",
4
+ "version": "1.18.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -32,13 +32,13 @@
32
32
  "sass": "^1.33.0"
33
33
  },
34
34
  "dependencies": {
35
- "@carbon/colors": "^11.8.0",
36
- "@carbon/feature-flags": "^0.9.0",
37
- "@carbon/grid": "^11.7.0",
38
- "@carbon/layout": "^11.7.0",
39
- "@carbon/motion": "^11.5.0",
40
- "@carbon/themes": "^11.12.0",
41
- "@carbon/type": "^11.11.0",
35
+ "@carbon/colors": "^11.9.0-rc.0",
36
+ "@carbon/feature-flags": "^0.10.0-rc.0",
37
+ "@carbon/grid": "^11.8.0-rc.0",
38
+ "@carbon/layout": "^11.8.0-rc.0",
39
+ "@carbon/motion": "^11.6.0-rc.0",
40
+ "@carbon/themes": "^11.13.0-rc.0",
41
+ "@carbon/type": "^11.12.0-rc.0",
42
42
  "@ibm/plex": "6.0.0-next.6"
43
43
  },
44
44
  "devDependencies": {
@@ -59,5 +59,5 @@
59
59
  "scss/**/*.css",
60
60
  "css/**/*.css"
61
61
  ],
62
- "gitHead": "06fdbdbc9cade1f6c352024175d348f9bd107b14"
62
+ "gitHead": "50cfaf729cfe80fecb6f7371ef13b53b25514145"
63
63
  }
@@ -180,6 +180,37 @@
180
180
  background-color: $icon-disabled;
181
181
  }
182
182
 
183
+ //----------------------------------------------
184
+ // Read-only
185
+ // ---------------------------------------------
186
+ .#{$prefix}--checkbox-wrapper--readonly .#{$prefix}--checkbox-label {
187
+ cursor: default;
188
+ }
189
+
190
+ .#{$prefix}--checkbox-wrapper--readonly .#{$prefix}--checkbox-label-text {
191
+ cursor: text;
192
+ user-select: text;
193
+ }
194
+
195
+ .#{$prefix}--checkbox-wrapper--readonly
196
+ .#{$prefix}--checkbox
197
+ + .#{$prefix}--checkbox-label::before {
198
+ border-color: $icon-disabled;
199
+ }
200
+
201
+ .#{$prefix}--checkbox-wrapper--readonly
202
+ .#{$prefix}--checkbox:checked
203
+ + .#{$prefix}--checkbox-label::before {
204
+ border: 1px solid $icon-disabled;
205
+ background: transparent;
206
+ }
207
+
208
+ .#{$prefix}--checkbox-wrapper--readonly
209
+ .#{$prefix}--checkbox:checked
210
+ + .#{$prefix}--checkbox-label::after {
211
+ border-color: $text-primary;
212
+ }
213
+
183
214
  //-----------------------------------------------
184
215
  // Skeleton
185
216
  //-----------------------------------------------
@@ -234,14 +234,15 @@ $copy-btn-feedback: $background-inverse !default;
234
234
  overflow-x: auto;
235
235
  }
236
236
 
237
- .#{$prefix}--snippet--multi .#{$prefix}--snippet-container pre::after {
237
+ .#{$prefix}--snippet--multi.#{$prefix}--snippet--has-right-overflow
238
+ .#{$prefix}--snippet-container
239
+ pre::after {
238
240
  position: absolute;
239
241
  top: 0;
240
242
  right: 0;
241
243
  width: rem(16px);
242
244
  height: 100%;
243
- // Safari interprets `transparent` differently, so make color token value transparent instead:
244
- background-image: linear-gradient(to right, rgba($layer, 0), $layer);
245
+ background-image: linear-gradient(to right, transparent, $layer);
245
246
  content: '';
246
247
  }
247
248
 
@@ -5,6 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
+ @use 'sass:list';
9
+
8
10
  @use '../../config' as *;
9
11
  @use '../../motion' as *;
10
12
  @use '../../spacing' as *;
@@ -31,6 +33,35 @@
31
33
  width: 100%;
32
34
  }
33
35
 
36
+ // Sizes
37
+
38
+ $sizes: (
39
+ // size: (height, item-block-padding)
40
+ 'sm': (rem(32px), $spacing-03),
41
+ 'md': (rem(40px), $spacing-04),
42
+ 'lg': (rem(48px), $spacing-05),
43
+ 'xl': (rem(64px), $spacing-06)
44
+ );
45
+
46
+ @each $size, $definition in $sizes {
47
+ $height: list.nth($definition, 1);
48
+ $item-block-padding: list.nth($definition, 2);
49
+
50
+ .#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--#{$size}
51
+ .#{$prefix}--contained-list__header {
52
+ height: $height;
53
+ }
54
+
55
+ .#{$prefix}--contained-list--#{$size}
56
+ .#{$prefix}--contained-list-item__content,
57
+ .#{$prefix}--contained-list--#{$size}
58
+ .#{$prefix}--contained-list-item--clickable
59
+ .#{$prefix}--contained-list-item__content {
60
+ min-height: $height;
61
+ padding: calc(#{$item-block-padding} - #{rem(2px)}) $spacing-05;
62
+ }
63
+ }
64
+
34
65
  // "On Page" variant
35
66
 
36
67
  .#{$prefix}--contained-list--on-page + .#{$prefix}--contained-list--on-page {
@@ -40,7 +71,6 @@
40
71
  .#{$prefix}--contained-list--on-page .#{$prefix}--contained-list__header {
41
72
  @include type-style('heading-compact-01');
42
73
 
43
- height: $spacing-09;
44
74
  border-bottom: 1px solid $border-subtle;
45
75
  background-color: $background;
46
76
  color: $text-primary;
@@ -92,7 +122,6 @@
92
122
  .#{$prefix}--contained-list-item__content {
93
123
  @include type-style('body-01');
94
124
 
95
- padding: calc(#{$spacing-05} - #{rem(2px)}) $spacing-05;
96
125
  color: $text-primary;
97
126
  }
98
127
 
@@ -210,4 +210,14 @@
210
210
  .#{$prefix}--date-picker__icon {
211
211
  @include high-contrast-mode('icon-fill');
212
212
  }
213
+
214
+ // readonly
215
+ .#{$prefix}--date-picker__input[readonly] {
216
+ background: transparent;
217
+ cursor: text;
218
+ }
219
+
220
+ .#{$prefix}--date-picker__input[readonly] + .#{$prefix}--date-picker__icon {
221
+ fill: $icon-disabled;
222
+ }
213
223
  }
@@ -440,13 +440,37 @@
440
440
  background: transparent;
441
441
  }
442
442
 
443
- .#{$prefix}--number--readonly .#{$prefix}--number__controls {
444
- display: none;
443
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn {
444
+ color: $icon-disabled;
445
+ pointer-events: none;
446
+
447
+ &:hover {
448
+ background-color: transparent;
449
+ cursor: pointer;
450
+
451
+ &::before,
452
+ &::after {
453
+ background-color: transparent;
454
+ }
455
+ }
445
456
  }
446
457
 
447
- .#{$prefix}--number__readonly-icon {
448
- position: absolute;
449
- right: rem(16px);
458
+ .#{$prefix}--number--readonly
459
+ input[type='number']:focus
460
+ ~ .#{$prefix}--number__controls
461
+ .#{$prefix}--number__control-btn:hover {
462
+ outline: none;
463
+ }
464
+
465
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn::before,
466
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn::after {
467
+ background: transparent;
468
+ }
469
+
470
+ .#{$prefix}--number--readonly
471
+ .#{$prefix}--number__controls:hover
472
+ .#{$prefix}--number__rule-divider:not(:first-of-type) {
473
+ background-color: $border-subtle;
450
474
  }
451
475
 
452
476
  // Skeleton State
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  &:hover {
46
- background-color: $background-hover;
46
+ background-color: $layer-hover;
47
47
  }
48
48
  }
49
49
 
@@ -134,9 +134,7 @@
134
134
  border-right: 1px solid $border-subtle;
135
135
  }
136
136
 
137
- .#{$prefix}--pagination
138
- .#{$prefix}--select__page-number
139
- .#{$prefix}--select-input {
137
+ .#{$prefix}--pagination__right {
140
138
  border-left: 1px solid $border-subtle;
141
139
  }
142
140
 
@@ -166,6 +164,16 @@
166
164
  margin-left: rem(1px);
167
165
  }
168
166
 
167
+ .#{$prefix}--pagination__right
168
+ .#{$prefix}--pagination__text.#{$prefix}--pagination__page-text {
169
+ margin-right: rem(1px);
170
+ margin-left: 1rem;
171
+ }
172
+
173
+ .#{$prefix}--pagination__right .#{$prefix}--pagination__text:empty {
174
+ margin: 0;
175
+ }
176
+
169
177
  .#{$prefix}--pagination__left {
170
178
  padding: 0 $spacing-05 0 0;
171
179
 
@@ -135,6 +135,24 @@ $radio-border-width: 1px !default;
135
135
  }
136
136
  }
137
137
 
138
+ // readonly
139
+ .#{$prefix}--radio-button-group--readonly
140
+ .#{$prefix}--radio-button
141
+ + .#{$prefix}--radio-button__label
142
+ .#{$prefix}--radio-button__appearance {
143
+ border-color: $icon-disabled;
144
+ }
145
+
146
+ .#{$prefix}--radio-button-group--readonly .#{$prefix}--radio-button__label {
147
+ cursor: default;
148
+ }
149
+
150
+ .#{$prefix}--radio-button-group--readonly
151
+ .#{$prefix}--radio-button__label-text {
152
+ cursor: text;
153
+ user-select: text;
154
+ }
155
+
138
156
  // Focus
139
157
 
140
158
  .#{$prefix}--radio-button:focus
@@ -252,6 +252,16 @@
252
252
  }
253
253
  }
254
254
 
255
+ // readonly
256
+ .#{$prefix}--select--readonly .#{$prefix}--select-input {
257
+ background-color: transparent;
258
+ cursor: default;
259
+ }
260
+
261
+ .#{$prefix}--select--readonly .#{$prefix}--select__arrow {
262
+ fill: $icon-disabled;
263
+ }
264
+
255
265
  //Skeleton State
256
266
  .#{$prefix}--select.#{$prefix}--skeleton {
257
267
  @include skeleton;
@@ -200,6 +200,20 @@
200
200
  }
201
201
  }
202
202
 
203
+ // readonly state
204
+ .#{$prefix}--slider--readonly {
205
+ cursor: default;
206
+ }
207
+
208
+ .#{$prefix}--slider--readonly .#{$prefix}--slider__thumb {
209
+ width: 0;
210
+ height: 0;
211
+ }
212
+
213
+ .#{$prefix}--slider--readonly ~ .#{$prefix}--slider-text-input {
214
+ background-color: transparent;
215
+ }
216
+
203
217
  // Skeleton state
204
218
  .#{$prefix}--slider-container.#{$prefix}--skeleton
205
219
  .#{$prefix}--slider__range-label {
@@ -307,6 +307,10 @@ $icon-tab-size: custom-property.get-var('icon-tab-size', rem(40px));
307
307
  //-----------------------------
308
308
  // Icon Item
309
309
  //-----------------------------
310
+ &.#{$prefix}--tabs__icon--default .#{$prefix}--tab--list,
311
+ &.#{$prefix}--tabs__icon--lg .#{$prefix}--tab--list {
312
+ overflow-x: visible;
313
+ }
310
314
 
311
315
  .#{$prefix}--tabs__nav-item--icon,
312
316
  &.#{$prefix}--tabs--contained .#{$prefix}--tabs__nav-item--icon {
@@ -88,4 +88,20 @@
88
88
  height: rem(48px);
89
89
  max-height: rem(48px);
90
90
  }
91
+
92
+ // readonly
93
+ .#{$prefix}--time-picker--readonly .#{$prefix}--time-picker__input-field {
94
+ background-color: transparent;
95
+ }
96
+
97
+ .#{$prefix}--time-picker--readonly .#{$prefix}--select-input {
98
+ background-color: transparent;
99
+ cursor: default;
100
+ }
101
+
102
+ .#{$prefix}--time-picker--readonly
103
+ .#{$prefix}--select-input
104
+ + .#{$prefix}--select__arrow {
105
+ fill: $icon-disabled;
106
+ }
91
107
  }
@@ -126,6 +126,10 @@
126
126
  visibility: visible;
127
127
  }
128
128
 
129
+ // ----------------------------------------
130
+ // disabled
131
+ // ----------------------------------------
132
+
129
133
  .#{$prefix}--toggle--disabled .#{$prefix}--toggle__appearance {
130
134
  cursor: not-allowed;
131
135
  }
@@ -147,6 +151,35 @@
147
151
  fill: button.$button-disabled;
148
152
  }
149
153
 
154
+ // ----------------------------------------
155
+ // readonly
156
+ // ----------------------------------------
157
+ .#{$prefix}--toggle--readonly .#{$prefix}--toggle__appearance {
158
+ cursor: default;
159
+ }
160
+
161
+ .#{$prefix}--toggle--readonly .#{$prefix}--toggle__switch {
162
+ border: 1px solid $icon-disabled;
163
+ background-color: transparent;
164
+
165
+ &::before {
166
+ top: rem(2px);
167
+ left: rem(2px);
168
+ background-color: $text-primary;
169
+ }
170
+ }
171
+
172
+ .#{$prefix}--toggle--readonly .#{$prefix}--toggle__check {
173
+ top: rem(5px);
174
+ right: rem(4px);
175
+ fill: $background;
176
+ }
177
+
178
+ .#{$prefix}--toggle--readonly .#{$prefix}--toggle__text {
179
+ cursor: text;
180
+ user-select: text;
181
+ }
182
+
150
183
  // HCM
151
184
 
152
185
  .#{$prefix}--toggle__switch,