@carbon/ibm-products-styles 2.74.0 → 2.75.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.
@@ -0,0 +1,408 @@
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
+ @use '@carbon/styles/scss/theme' as *;
8
+ @use '@carbon/styles/scss/colors' as *;
9
+ @use '@carbon/styles/scss/spacing' as *;
10
+ @use '@carbon/styles/scss/motion' as *;
11
+ @use '@carbon/styles/scss/breakpoint' as *;
12
+ @use '@carbon/styles/scss/type';
13
+ @use '@carbon/styles/scss/utilities';
14
+ @use '../../global/styles/project-settings' as *;
15
+ @use '../../global/styles/mixins' as *;
16
+
17
+ $block-class__next: #{$pkg-prefix}--tearsheet__next;
18
+ $motion-duration: $duration-moderate-02;
19
+
20
+ /// Experimental tearsheet styles
21
+ @include block-wrap($block-class__next) {
22
+ // ──────────────────────────────────────────────────────────────
23
+ // Container
24
+ // ──────────────────────────────────────────────────────────────
25
+ .#{$block-class__next}__container {
26
+ align-self: flex-end;
27
+ block-size: 100%;
28
+ 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;
33
+ }
34
+ }
35
+
36
+ &.#{$block-class__next}.#{$block-class__next}--has-ai-label
37
+ .#{$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;
52
+ }
53
+
54
+ // Extra specificity to override Carbon default transition
55
+ &.#{$block-class__next}.#{$block-class__next}
56
+ .#{$block-class__next}__container {
57
+ transition:
58
+ transform $motion-duration motion(entrance, expressive),
59
+ max-height $motion-duration motion(entrance, expressive);
60
+ }
61
+
62
+ // Wide variant at medium breakpoint
63
+ @include breakpoint(md) {
64
+ &.#{$block-class__next}--wide .#{$block-class__next}__container {
65
+ inline-size: calc(100% - (2 * #{$spacing-10}));
66
+ }
67
+ }
68
+
69
+ // ──────────────────────────────────────────────────────────────
70
+ // Header
71
+ // ──────────────────────────────────────────────────────────────
72
+ .#{$block-class__next}__header {
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ align-content: space-between;
76
+ border-block-end: 1px solid $border-subtle-01;
77
+ margin-block: 0;
78
+ max-block-size: 50vh;
79
+ padding-block-end: 0;
80
+ padding-block-start: $spacing-06;
81
+ padding-inline: $spacing-07;
82
+
83
+ > * {
84
+ flex-basis: 100%;
85
+ }
86
+ // change if carbon provide flexible close button
87
+ > *:not(
88
+ .#{$block-class__next}__navigation-bar,
89
+ .#{$block-class__next}__header-content-wrapper,
90
+ .#{$carbon-prefix}--modal-close-button
91
+ ) {
92
+ margin-block-end: $spacing-06;
93
+ }
94
+
95
+ @include breakpoint-down(md) {
96
+ padding-inline: $spacing-05;
97
+ }
98
+ }
99
+ .#{$carbon-prefix}--modal-container--sm .#{$carbon-prefix}--modal-header {
100
+ padding-inline-end: $spacing-07;
101
+ }
102
+
103
+ // ──────────────────────────────────────────────────────────────
104
+ // Header content wrapper (grid on desktop → flex on mobile)
105
+ // ──────────────────────────────────────────────────────────────
106
+ .#{$block-class__next}__header-content-wrapper {
107
+ display: grid;
108
+ flex-basis: unset;
109
+ gap: $spacing-05;
110
+ grid-template-columns:
111
+ auto
112
+ minmax(var(--tearsheet-header-title-grid-width, 0), 1fr);
113
+ inline-size: calc(100% - var(--tearsheet-header-action-offset));
114
+
115
+ @include breakpoint-down(md) {
116
+ display: flex;
117
+ flex-direction: column;
118
+ }
119
+ }
120
+
121
+ // Header content and actions
122
+ .#{$block-class__next}__header-content,
123
+ .#{$block-class__next}__header-actions {
124
+ margin-block-end: $spacing-06;
125
+ }
126
+
127
+ // Label, title, description styles
128
+ .#{$block-class__next}__header-label {
129
+ @include type.type-style('label-01');
130
+
131
+ margin-block-end: $spacing-02;
132
+ }
133
+
134
+ .#{$block-class__next}__header-title {
135
+ @include type.type-style('heading-04');
136
+
137
+ @include breakpoint-down(md) {
138
+ @include type.type-style('heading-03');
139
+ }
140
+
141
+ display: flex;
142
+ align-items: flex-start;
143
+ margin-block-end: $spacing-03;
144
+
145
+ svg {
146
+ flex-shrink: 0;
147
+ }
148
+
149
+ &.#{$block-class__next}__leading-icon {
150
+ flex-direction: row;
151
+
152
+ svg {
153
+ margin-inline-end: $spacing-05;
154
+ }
155
+ }
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
+ }
164
+ }
165
+ }
166
+
167
+ .#{$block-class__next}__header-description {
168
+ @include type.type-style('body-compact-01');
169
+ }
170
+
171
+ .#{$block-class__next}__header--no-close-icon {
172
+ display: none;
173
+ }
174
+
175
+ .#{$block-class__next}__header-content {
176
+ max-inline-size: 40rem;
177
+ }
178
+
179
+ // ──────────────────────────────────────────────────────────────
180
+ // Navigation bar inside header
181
+ // ──────────────────────────────────────────────────────────────
182
+ .#{$block-class__next}__navigation-bar {
183
+ position: relative;
184
+ // margin: $spacing-04 0 0;
185
+ display: flex;
186
+ align-items: center;
187
+ justify-content: space-between;
188
+ gap: $spacing-10;
189
+ max-inline-size: 100%;
190
+ min-block-size: $spacing-08;
191
+
192
+ .#{$block-class__next}__scroller-container {
193
+ position: absolute;
194
+ inset-inline-end: -$spacing-07;
195
+ margin-inline-end: 1px;
196
+ @include breakpoint-down(md) {
197
+ inset-inline-end: -$spacing-05;
198
+ }
199
+
200
+ .#{$block-class__next}__scroller-button-icon-collapsed {
201
+ transform: rotate(-180deg);
202
+ }
203
+ }
204
+
205
+ .#{$carbon-prefix}--tabs {
206
+ margin-inline-start: -$spacing-05;
207
+ }
208
+ }
209
+
210
+ // ──────────────────────────────────────────────────────────────
211
+ // Header actions
212
+ // ──────────────────────────────────────────────────────────────
213
+ .#{$block-class__next}__header-actions {
214
+ display: flex;
215
+ justify-content: flex-end;
216
+ }
217
+
218
+ .#{$block-class__next}__content__header-actions {
219
+ display: flex;
220
+ overflow: hidden;
221
+ flex: 0 0 auto;
222
+ align-items: center;
223
+ justify-content: flex-end;
224
+ block-size: $spacing-07;
225
+ inline-size: 100%;
226
+ margin-block-start: -14px;
227
+
228
+ // apply spacing only between two visible items
229
+ > *:not([hidden]) + *:not([hidden]) {
230
+ padding-inline-start: $spacing-03;
231
+ }
232
+
233
+ > * {
234
+ flex-shrink: 0;
235
+ }
236
+ @include breakpoint-down(md) {
237
+ justify-content: flex-start;
238
+ margin-inline-end: 0;
239
+ }
240
+ }
241
+
242
+ // ──────────────────────────────────────────────────────────────
243
+ // Header (default vs collapsed)
244
+ // ──────────────────────────────────────────────────────────────
245
+ .#{$block-class__next}__header {
246
+ opacity: 1;
247
+
248
+ // Default visible: hide everything except nav-bar, header-content-wrapper & close button
249
+ > *:not(
250
+ .#{$block-class__next}__navigation-bar,
251
+ .#{$block-class__next}__header-content-wrapper,
252
+ .#{$carbon-prefix}--modal-close-button
253
+ ),
254
+ .#{$block-class__next}__header-content-wrapper
255
+ .#{$block-class__next}__header-content
256
+ > *:not(.#{$block-class__next}__content__title-wrapper) {
257
+ overflow: hidden;
258
+ max-block-size: 50vh;
259
+ opacity: 1;
260
+ transition: all $motion-duration motion(entrance, expressive);
261
+ }
262
+ }
263
+
264
+ .#{$block-class__next}__header-collapsed {
265
+ // Hide everything except navigation bar, header-content-wrapper & close button
266
+ > *:not(
267
+ .#{$block-class__next}__navigation-bar,
268
+ .#{$block-class__next}__header-content-wrapper,
269
+ .#{$carbon-prefix}--modal-close-button,
270
+ .excludeFromCollapse
271
+ ),
272
+ .#{$block-class__next}__header-actions
273
+ > *:not(.#{$block-class__next}__content__header-actions),
274
+ .#{$block-class__next}__header-content-wrapper
275
+ .#{$block-class__next}__header-content
276
+ > *:not(.#{$block-class__next}__content__title-wrapper),
277
+ > *:not(
278
+ .#{$block-class__next}__navigation-bar,
279
+ .#{$block-class__next}__header-content-wrapper,
280
+ .#{$carbon-prefix}--modal-close-button,
281
+ .excludeFromCollapse
282
+ )
283
+ * {
284
+ overflow: hidden;
285
+ padding: 0;
286
+ margin: 0;
287
+ max-block-size: 0;
288
+ min-block-size: 0;
289
+ opacity: 0;
290
+ transition: all $motion-duration ease;
291
+ visibility: hidden;
292
+ }
293
+
294
+ // Reset margins and transitions on always-visible items
295
+ .#{$block-class__next}__header-content-wrapper,
296
+ .#{$block-class__next}__header-content,
297
+ .#{$block-class__next}__content__title-wrapper,
298
+ .#{$block-class__next}__header-actions
299
+ .#{$block-class__next}__header-title {
300
+ margin-block: 0;
301
+ transition: all $motion-duration ease;
302
+ }
303
+ }
304
+
305
+ // ──────────────────────────────────────────────────────────────
306
+ // Body layout grid
307
+ // ──────────────────────────────────────────────────────────────
308
+ .#{$block-class__next}__body-layout {
309
+ display: grid;
310
+ grid-template-areas:
311
+ 'influencer body'
312
+ 'influencer footer';
313
+ grid-template-columns:
314
+ var(--tearsheet-influencer-width, calc($spacing-10 * 4))
315
+ 1fr;
316
+ grid-template-rows: 1fr auto;
317
+ padding-block: 0;
318
+ padding-inline-end: 0;
319
+
320
+ /* Redefine grid when influencer is absent */
321
+ &:not(:has(> .#{$block-class__next}__influencer)) {
322
+ grid-template-areas:
323
+ 'body'
324
+ 'footer';
325
+ grid-template-columns: 1fr;
326
+ }
327
+ }
328
+
329
+ /* Assign components to their named grid areas */
330
+ .#{$block-class__next}__influencer {
331
+ grid-area: influencer;
332
+ }
333
+
334
+ .#{$block-class__next}__body {
335
+ position: relative;
336
+ display: grid;
337
+ overflow: hidden;
338
+ grid-area: body;
339
+ grid-template-columns: 1fr var(
340
+ --tearsheet-summary-content-width,
341
+ calc($spacing-10 * 4)
342
+ );
343
+ @include breakpoint-down(md) {
344
+ grid-template-columns: 1fr 0;
345
+ }
346
+
347
+ > *:only-child {
348
+ grid-column: 1 / -1;
349
+ }
350
+ }
351
+
352
+ .#{$block-class__next}__footer {
353
+ border-block-start: 1px solid $border-subtle-01;
354
+ grid-area: footer;
355
+ }
356
+
357
+ .#{$block-class__next}__influencer,
358
+ .#{$block-class__next}__main-content,
359
+ .#{$block-class__next}__summary-content {
360
+ overflow: auto;
361
+ padding-inline: $spacing-07;
362
+ @include breakpoint-down(md) {
363
+ padding-inline: $spacing-05;
364
+ }
365
+ }
366
+
367
+ .#{$block-class__next}__main-content {
368
+ position: relative;
369
+ @include utilities.ai-popover-gradient('default', 0, 'background');
370
+
371
+ box-shadow: inset 0 -80px 70px -65px $ai-inner-shadow;
372
+ }
373
+ .#{$pkg-prefix}--side-panel {
374
+ position: absolute;
375
+ z-index: 9999;
376
+ block-size: 100%;
377
+ inline-size: 100%;
378
+ inset-block-start: 0;
379
+ max-inline-size: none;
380
+ .#{$pkg-prefix}--side-panel__header {
381
+ min-block-size: 0;
382
+ }
383
+ }
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;
407
+ }
408
+ }