@carbon/ibm-products-styles 2.75.0 → 2.76.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/ibm-products-styles",
3
3
  "description": "Carbon for IBM Products styles",
4
- "version": "2.75.0",
4
+ "version": "2.76.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "installConfig": {
7
7
  "hoistingLimits": "none"
@@ -49,7 +49,7 @@
49
49
  "cross-env": "^10.0.0",
50
50
  "glob": "^11.0.1",
51
51
  "jest": "^29.7.0",
52
- "jest-config-ibm-cloud-cognitive": "^1.38.0",
52
+ "jest-config-ibm-cloud-cognitive": "^1.39.0-rc.0",
53
53
  "jest-environment-jsdom": "^29.7.0",
54
54
  "npm-run-all2": "^8.0.0",
55
55
  "rimraf": "^6.0.1",
@@ -57,14 +57,14 @@
57
57
  "yargs": "^18.0.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@carbon/grid": "^11.44.0",
61
- "@carbon/layout": "^11.42.0",
62
- "@carbon/motion": "^11.36.0",
63
- "@carbon/themes": "^11.61.0",
64
- "@carbon/type": "^11.48.0"
60
+ "@carbon/grid": "^11.45.0",
61
+ "@carbon/layout": "^11.43.0",
62
+ "@carbon/motion": "^11.37.0",
63
+ "@carbon/themes": "^11.62.0",
64
+ "@carbon/type": "^11.49.0"
65
65
  },
66
66
  "dependencies": {
67
67
  "@ibm/telemetry-js": "^1.9.1"
68
68
  },
69
- "gitHead": "02d6f4fe2d1dc65327ae5c9fdae4bd92ab5c3bcd"
69
+ "gitHead": "18c246c4b4f3cae35f0056cb73f68b68fb0b534d"
70
70
  }
@@ -51,6 +51,17 @@ $motion-duration: $duration-moderate-02;
51
51
  }
52
52
  }
53
53
 
54
+ &:not(.is-visible) {
55
+ &.#{$block-class}.#{$block-class} .#{$block-class}__container {
56
+ // we want the enter/leave animation to run up most of the height of the
57
+ // viewport, capped at 500px to set an upper limit on the movement speed
58
+ // For the reason for calc() see https://github.com/sass/sass/issues/2849
59
+ // and https://github.com/sass/node-sass/issues/2815.
60
+ // stylelint-disable-next-line carbon/layout-use
61
+ transform: translate3d(0, calc(min(95vh, 500px)), 0);
62
+ }
63
+ }
64
+
54
65
  &.#{$block-class}.#{$block-class} {
55
66
  /* tearsheet uses --overlay-color and --overlay-opacity in ::before */
56
67
  background: initial;
@@ -106,12 +117,6 @@ $motion-duration: $duration-moderate-02;
106
117
  block-size: 100%;
107
118
  inset-block-start: auto;
108
119
  max-block-size: calc(100% - #{$spacing-09});
109
- // we want the enter/leave animation to run up most of the height of the
110
- // viewport, capped at 500px to set an upper limit on the movement speed
111
- // For the reason for calc() see https://github.com/sass/sass/issues/2849
112
- // and https://github.com/sass/node-sass/issues/2815.
113
- // stylelint-disable-next-line carbon/layout-use
114
- transform: translate3d(0, calc(min(95vh, 500px)), 0);
115
120
  }
116
121
 
117
122
  &.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-slug
@@ -24,31 +24,48 @@ $motion-duration: $duration-moderate-02;
24
24
  // ──────────────────────────────────────────────────────────────
25
25
  .#{$block-class__next}__container {
26
26
  align-self: flex-end;
27
+ border: 1px solid $border-subtle-01;
27
28
  block-size: 100%;
28
29
  inset-block-start: auto;
29
- max-block-size: calc(100% - #{$spacing-09});
30
- transform: translate3d(0, calc(min(95vh, 500px)), 0);
31
- @include breakpoint-down(md) {
32
- max-block-size: none;
30
+ max-block-size: calc(100% - var(--tearsheet-vertical-gap, #{$spacing-09}));
31
+ }
32
+ &:not(.#{$block-class__next}--stack-activated.is-visible) {
33
+ .#{$block-class__next}__container {
34
+ @include breakpoint-down(md) {
35
+ max-block-size: none;
36
+ }
33
37
  }
34
38
  }
35
39
 
36
- &.#{$block-class__next}.#{$block-class__next}--has-ai-label
40
+ &:not(.is-visible) {
41
+ &.#{$block-class__next}.#{$block-class__next}
42
+ .#{$block-class__next}__container {
43
+ transform: translate3d(0, calc(min(95vh, 500px)), 0);
44
+ }
45
+ }
46
+ &.#{$block-class__next}.#{$block-class__next}--has-ai-label {
37
47
  .#{$block-class__next}__container {
38
- border: 1px solid transparent;
39
-
40
- /* override carbon ai removing background gradient */
41
- background:
42
- linear-gradient(to top, var(--cds-layer), var(--cds-layer)) padding-box,
43
- linear-gradient(
44
- to bottom,
45
- var(--cds-ai-border-start, #78a9ff),
46
- var(--cds-ai-border-end, #d0e2ff)
47
- )
48
- border-box,
49
- linear-gradient(to top, var(--cds-layer), var(--cds-layer)) border-box;
50
- border-block-end: 0;
51
- box-shadow: 0 4px 10px 2px $ai-drop-shadow;
48
+ border: 1px solid transparent;
49
+
50
+ /* override carbon ai removing background gradient */
51
+ background:
52
+ linear-gradient(to top, var(--cds-layer), var(--cds-layer)) padding-box,
53
+ linear-gradient(
54
+ to bottom,
55
+ var(--cds-ai-border-start, #78a9ff),
56
+ var(--cds-ai-border-end, #d0e2ff)
57
+ )
58
+ border-box,
59
+ linear-gradient(to top, var(--cds-layer), var(--cds-layer)) border-box;
60
+ border-block-end: 0;
61
+ box-shadow: 0 4px 10px 2px $ai-drop-shadow;
62
+ }
63
+ .#{$block-class__next}__main-content {
64
+ position: relative;
65
+ @include utilities.ai-popover-gradient('default', 0, 'background');
66
+
67
+ box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow;
68
+ }
52
69
  }
53
70
 
54
71
  // Extra specificity to override Carbon default transition
@@ -56,7 +73,7 @@ $motion-duration: $duration-moderate-02;
56
73
  .#{$block-class__next}__container {
57
74
  transition:
58
75
  transform $motion-duration motion(entrance, expressive),
59
- max-height $motion-duration motion(entrance, expressive);
76
+ max-block-size $motion-duration motion(entrance, expressive);
60
77
  }
61
78
 
62
79
  // Wide variant at medium breakpoint
@@ -107,9 +124,11 @@ $motion-duration: $duration-moderate-02;
107
124
  display: grid;
108
125
  flex-basis: unset;
109
126
  gap: $spacing-05;
110
- grid-template-columns:
111
- auto
112
- minmax(var(--tearsheet-header-title-grid-width, 0), 1fr);
127
+ grid-template-columns: minmax(auto, 40rem) minmax(
128
+ var(--tearsheet-header-title-grid-width, 0),
129
+ 1fr
130
+ );
131
+
113
132
  inline-size: calc(100% - var(--tearsheet-header-action-offset));
114
133
 
115
134
  @include breakpoint-down(md) {
@@ -128,6 +147,7 @@ $motion-duration: $duration-moderate-02;
128
147
  .#{$block-class__next}__header-label {
129
148
  @include type.type-style('label-01');
130
149
 
150
+ color: $text-secondary;
131
151
  margin-block-end: $spacing-02;
132
152
  }
133
153
 
@@ -145,22 +165,11 @@ $motion-duration: $duration-moderate-02;
145
165
  svg {
146
166
  flex-shrink: 0;
147
167
  }
148
-
149
- &.#{$block-class__next}__leading-icon {
150
- flex-direction: row;
151
-
152
- svg {
153
- margin-inline-end: $spacing-05;
154
- }
168
+ .#{$block-class__next}__title-start {
169
+ margin-inline-end: $spacing-05;
155
170
  }
156
-
157
- &.#{$block-class__next}__trailing-icon {
158
- flex-direction: row-reverse;
159
- justify-content: flex-end;
160
-
161
- svg {
162
- margin-inline-start: $spacing-05;
163
- }
171
+ .#{$block-class__next}__title-end {
172
+ margin-inline-start: $spacing-05;
164
173
  }
165
174
  }
166
175
 
@@ -172,10 +181,6 @@ $motion-duration: $duration-moderate-02;
172
181
  display: none;
173
182
  }
174
183
 
175
- .#{$block-class__next}__header-content {
176
- max-inline-size: 40rem;
177
- }
178
-
179
184
  // ──────────────────────────────────────────────────────────────
180
185
  // Navigation bar inside header
181
186
  // ──────────────────────────────────────────────────────────────
@@ -191,8 +196,8 @@ $motion-duration: $duration-moderate-02;
191
196
 
192
197
  .#{$block-class__next}__scroller-container {
193
198
  position: absolute;
194
- inset-inline-end: -$spacing-07;
195
- margin-inline-end: 1px;
199
+ inset-block-end: $spacing-01;
200
+ inset-inline-end: calc(-#{$spacing-07} + #{$spacing-01});
196
201
  @include breakpoint-down(md) {
197
202
  inset-inline-end: -$spacing-05;
198
203
  }
@@ -225,9 +230,15 @@ $motion-duration: $duration-moderate-02;
225
230
  inline-size: 100%;
226
231
  margin-block-start: -14px;
227
232
 
228
- // apply spacing only between two visible items
229
- > *:not([hidden]) + *:not([hidden]) {
230
- padding-inline-start: $spacing-03;
233
+ > *.#{$block-class__next}__header-action-item:not([data-hidden='true']) {
234
+ margin-inline-end: $spacing-03; /* space between visible items */
235
+ }
236
+
237
+ /* Remove margin on the last visible item */
238
+ > *.#{$block-class__next}__header-action-item:not(
239
+ [data-hidden='true']
240
+ ):nth-last-child(2) {
241
+ margin-inline-end: 0;
231
242
  }
232
243
 
233
244
  > * {
@@ -238,31 +249,78 @@ $motion-duration: $duration-moderate-02;
238
249
  margin-inline-end: 0;
239
250
  }
240
251
  }
241
-
252
+ &.#{$block-class__next}--narrow {
253
+ .#{$block-class__next}__header {
254
+ padding-inline: $spacing-05;
255
+ }
256
+ .#{$block-class__next}__header.#{$block-class__next}__header-collapsed {
257
+ .#{$block-class__next}__header-actions {
258
+ display: none;
259
+ }
260
+ }
261
+ .#{$block-class__next}__header-content-wrapper {
262
+ display: flex;
263
+ flex-direction: column;
264
+ }
265
+ .#{$block-class__next}__header-title {
266
+ @include type.type-style('heading-03');
267
+ }
268
+ .#{$block-class__next}__content__header-actions {
269
+ justify-content: flex-start;
270
+ margin-inline-end: 0;
271
+ }
272
+ .#{$block-class__next}__body {
273
+ grid-template-columns: 1fr 0;
274
+ }
275
+ .#{$block-class__next}__influencer,
276
+ .#{$block-class__next}__main-content,
277
+ .#{$block-class__next}__summary-content {
278
+ &:not(.#{$block-class__next}__flush) {
279
+ padding-inline: $spacing-05;
280
+ }
281
+ }
282
+ }
242
283
  // ──────────────────────────────────────────────────────────────
243
284
  // Header (default vs collapsed)
244
285
  // ──────────────────────────────────────────────────────────────
245
286
  .#{$block-class__next}__header {
246
- opacity: 1;
247
-
248
- // Default visible: hide everything except nav-bar, header-content-wrapper & close button
287
+ // Animate all non-core visible elements
249
288
  > *:not(
250
289
  .#{$block-class__next}__navigation-bar,
251
290
  .#{$block-class__next}__header-content-wrapper,
252
- .#{$carbon-prefix}--modal-close-button
253
- ),
291
+ .#{$carbon-prefix}--modal-close-button,
292
+ .excludeFromCollapse
293
+ ) {
294
+ overflow: hidden;
295
+ max-block-size: 50vh; // large enough for expanded content
296
+ opacity: 1;
297
+ transition:
298
+ max-block-size $motion-duration motion(entrance, expressive),
299
+ opacity $motion-duration motion(entrance, expressive),
300
+ margin $motion-duration motion(entrance, expressive),
301
+ padding $motion-duration motion(entrance, expressive);
302
+ }
303
+
304
+ .#{$block-class__next}__header-actions,
254
305
  .#{$block-class__next}__header-content-wrapper
255
306
  .#{$block-class__next}__header-content
256
- > *:not(.#{$block-class__next}__content__title-wrapper) {
257
- overflow: hidden;
258
- max-block-size: 50vh;
307
+ *:not(
308
+ .#{$block-class__next}__content__title-wrapper,
309
+ .#{$block-class__next}__header-label
310
+ ) {
259
311
  opacity: 1;
260
- transition: all $motion-duration motion(entrance, expressive);
312
+ transition:
313
+ all $motion-duration motion(entrance, expressive),
314
+ opacity $motion-duration motion(entrance, expressive);
261
315
  }
262
316
  }
263
317
 
318
+ // COLLAPSED STATE
264
319
  .#{$block-class__next}__header-collapsed {
265
- // Hide everything except navigation bar, header-content-wrapper & close button
320
+ padding-block-start: $spacing-04;
321
+ transition: padding $motion-duration motion(entrance, expressive);
322
+
323
+ // Collapse everything except core elements
266
324
  > *:not(
267
325
  .#{$block-class__next}__navigation-bar,
268
326
  .#{$block-class__next}__header-content-wrapper,
@@ -271,8 +329,7 @@ $motion-duration: $duration-moderate-02;
271
329
  ),
272
330
  .#{$block-class__next}__header-actions
273
331
  > *:not(.#{$block-class__next}__content__header-actions),
274
- .#{$block-class__next}__header-content-wrapper
275
- .#{$block-class__next}__header-content
332
+ .#{$block-class__next}__header-content
276
333
  > *:not(.#{$block-class__next}__content__title-wrapper),
277
334
  > *:not(
278
335
  .#{$block-class__next}__navigation-bar,
@@ -280,25 +337,78 @@ $motion-duration: $duration-moderate-02;
280
337
  .#{$carbon-prefix}--modal-close-button,
281
338
  .excludeFromCollapse
282
339
  )
340
+ *,
341
+ .#{$block-class__next}__header-content-wrapper
342
+ .#{$block-class__next}__header-content
343
+ > *:not(.#{$block-class__next}__content__title-wrapper)
283
344
  * {
284
345
  overflow: hidden;
285
346
  padding: 0;
286
347
  margin: 0;
287
348
  max-block-size: 0;
288
- min-block-size: 0;
289
349
  opacity: 0;
290
- transition: all $motion-duration ease;
291
- visibility: hidden;
350
+ pointer-events: none;
351
+ transition: all $motion-duration motion(entrance, expressive);
352
+ }
353
+
354
+ // Header title
355
+ .#{$block-class__next}__header-title {
356
+ @include type.type-style('label-02');
357
+
358
+ align-items: center;
359
+ margin-block-start: $spacing-02;
360
+ transition: all $motion-duration motion(entrance, expressive);
361
+
362
+ > span {
363
+ display: flex;
364
+ align-items: center;
365
+ block-size: $spacing-06;
366
+ }
367
+ }
368
+
369
+ .#{$block-class__next}__header-content {
370
+ align-self: center;
371
+ margin-block-end: 0;
372
+ }
373
+
374
+ .#{$block-class__next}__content__header-actions {
375
+ margin-block-start: -$spacing-01;
292
376
  }
293
377
 
294
- // Reset margins and transitions on always-visible items
378
+ // Hide header actions on small screens
379
+ @include breakpoint-down(md) {
380
+ .#{$block-class__next}__header-actions {
381
+ display: none;
382
+ }
383
+ }
384
+
385
+ // Normalize visible elements
295
386
  .#{$block-class__next}__header-content-wrapper,
296
387
  .#{$block-class__next}__header-content,
297
388
  .#{$block-class__next}__content__title-wrapper,
298
- .#{$block-class__next}__header-actions
299
- .#{$block-class__next}__header-title {
389
+ .#{$block-class__next}__header-actions,
390
+ .#{$block-class__next}__header-title {
300
391
  margin-block: 0;
301
- transition: all $motion-duration ease;
392
+ transition: margin-block $motion-duration ease;
393
+ }
394
+
395
+ .#{$block-class__next}__header-content-wrapper {
396
+ min-block-size: $spacing-08;
397
+ padding-block-end: $spacing-04;
398
+ }
399
+
400
+ // Divider line above navigation bar
401
+ .#{$block-class__next}__navigation-bar::before {
402
+ position: absolute;
403
+ z-index: 1;
404
+ background: rgba(0, 0, 0, 0.12);
405
+ block-size: 1px;
406
+ content: '';
407
+ inline-size: 100vw;
408
+ inset-block-start: -$spacing-02;
409
+ inset-inline-start: 50%;
410
+ pointer-events: none;
411
+ transform: translateX(-50%);
302
412
  }
303
413
  }
304
414
 
@@ -328,6 +438,7 @@ $motion-duration: $duration-moderate-02;
328
438
 
329
439
  /* Assign components to their named grid areas */
330
440
  .#{$block-class__next}__influencer {
441
+ border-inline-end: 1px solid $border-subtle-01;
331
442
  grid-area: influencer;
332
443
  }
333
444
 
@@ -358,17 +469,16 @@ $motion-duration: $duration-moderate-02;
358
469
  .#{$block-class__next}__main-content,
359
470
  .#{$block-class__next}__summary-content {
360
471
  overflow: auto;
361
- padding-inline: $spacing-07;
362
- @include breakpoint-down(md) {
363
- padding-inline: $spacing-05;
472
+ &:not(.#{$block-class__next}__flush) {
473
+ padding-inline: $spacing-07;
474
+ @include breakpoint-down(md) {
475
+ padding-inline: $spacing-05;
476
+ }
364
477
  }
365
478
  }
366
479
 
367
480
  .#{$block-class__next}__main-content {
368
481
  position: relative;
369
- @include utilities.ai-popover-gradient('default', 0, 'background');
370
-
371
- box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow;
372
482
  }
373
483
  .#{$pkg-prefix}--side-panel {
374
484
  position: absolute;
@@ -381,28 +491,40 @@ $motion-duration: $duration-moderate-02;
381
491
  min-block-size: 0;
382
492
  }
383
493
  }
384
- }
385
- .#{$block-class__next}--narrow {
386
- .#{$block-class__next}__header {
387
- padding-inline: $spacing-05;
388
- }
389
- .#{$block-class__next}__header-content-wrapper {
390
- display: flex;
391
- flex-direction: column;
392
- }
393
- .#{$block-class__next}__header-title {
394
- @include type.type-style('heading-03');
395
- }
396
- .#{$block-class__next}__content__header-actions {
397
- justify-content: flex-start;
398
- margin-inline-end: 0;
399
- }
400
- .#{$block-class__next}__body {
401
- grid-template-columns: 1fr 0;
402
- }
403
- .#{$block-class__next}__influencer,
404
- .#{$block-class__next}__main-content,
405
- .#{$block-class__next}__summary-content {
406
- padding-inline: $spacing-05;
494
+
495
+ &.#{$block-class__next}--stack-activated.is-visible {
496
+ --overlay-color: #{$overlay};
497
+ --overlay-alpha: 0.5;
498
+
499
+ z-index: calc(#{utilities.z('modal')} - var(--stack-depth, 0));
500
+
501
+ background-color: initial;
502
+
503
+ &::before {
504
+ position: absolute;
505
+ display: block;
506
+ background: var(--overlay-color);
507
+ content: '';
508
+ inset: 0;
509
+ opacity: calc(var(--overlay-alpha) - var(--stack-depth) * 0.1);
510
+
511
+ transition:
512
+ background-color $motion-duration motion(exit, expressive),
513
+ opacity $motion-duration motion(exit, expressive);
514
+
515
+ @media (prefers-reduced-motion: reduce) {
516
+ transition: none;
517
+ }
518
+ }
519
+
520
+ &.is-visible {
521
+ .#{$block-class__next}__container {
522
+ max-block-size: calc(
523
+ 100% - var(--tearsheet-vertical-gap, #{$spacing-09}) +
524
+ var(--block-size-change)
525
+ );
526
+ transform: scaleX(var(--scale-factor));
527
+ }
528
+ }
407
529
  }
408
530
  }