diff --git a/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap b/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap
index e01a9c6e3e..024ce2108b 100644
--- a/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap
+++ b/packages/ibm-products-styles/src/__tests__/__snapshots__/styles.test.js.snap
@@ -2725,6 +2725,12 @@ p.c4p--about-modal__copyright-text:first-child {
max-height: calc(100% - 3rem);
transform: translate3d(0, min(95vh, 500px), 0);
}
+.c4p--tearsheet.c4p--tearsheet.c4p--tearsheet.c4p--tearsheet.c4p--tearsheet--has-slug .c4p--tearsheet__container {
+ border: 1px solid transparent;
+ /* override carbon ai removing background gradient */
+ background: linear-gradient(to top, var(--cds-layer), var(--cds-layer)) padding-box, linear-gradient(to bottom, var(--cds-ai-border-start, #78a9ff), var(--cds-ai-border-end, #d0e2ff)) border-box, linear-gradient(to top, var(--cds-layer), var(--cds-layer)) border-box;
+ box-shadow: 0 4px 10px 2px var(--cds-ai-drop-shadow, rgba(15, 98, 254, 0.32));
+}
.c4p--tearsheet.c4p--tearsheet.c4p--tearsheet .c4p--tearsheet__container {
transition: transform 240ms cubic-bezier(0, 0, 0.3, 1), max-height 240ms cubic-bezier(0, 0, 0.3, 1);
}
@@ -2822,8 +2828,11 @@ p.c4p--about-modal__copyright-text:first-child {
.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__header.c4p--tearsheet__header--with-nav {
padding: 1.5rem 2rem 0;
}
-.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__header.c4p--tearsheet__header--with-close-icon {
- padding-right: 4rem;
+.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__header.c4p--tearsheet__header--with-close-icon, .c4p--tearsheet.c4p--tearsheet--has-slug .c4p--tearsheet__header.c4p--tearsheet__header {
+ padding-right: 5rem;
+}
+.c4p--tearsheet.c4p--tearsheet--wide.c4p--tearsheet--has-slug .c4p--tearsheet__header.c4p--tearsheet__header--with-close-icon {
+ margin-right: 3rem;
}
.c4p--tearsheet.c4p--tearsheet--narrow .c4p--tearsheet__header-description {
max-width: 80%;
@@ -2876,6 +2885,9 @@ p.c4p--about-modal__copyright-text:first-child {
overflow: auto;
flex-grow: 1;
}
+.c4p--tearsheet.c4p--tearsheet--has-slug .c4p--tearsheet__main {
+ background: linear-gradient(to top, var(--cds-ai-aura-start, rgba(69, 137, 255, 0.1)) 0%, var(--cds-ai-aura-end, rgba(255, 255, 255, 0)) 50%) padding-box, linear-gradient(to top, var(--cds-background, #ffffff), var(--cds-background, #ffffff)) padding-box, linear-gradient(to bottom, var(--cds-ai-border-start, #78a9ff), var(--cds-ai-border-end, #d0e2ff)) border-box, linear-gradient(to top, var(--cds-background, #ffffff), var(--cds-background, #ffffff)) border-box;
+}
.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__content .cds--pagination,
.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__content .cds--pagination__control-buttons,
.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__content .cds--text-input,
@@ -2914,6 +2926,9 @@ p.c4p--about-modal__copyright-text:first-child {
.c4p--tearsheet.c4p--tearsheet--wide .c4p--tearsheet__buttons {
background: var(--cds-background, #ffffff);
}
+.c4p--tearsheet.c4p--tearsheet--has-slug:not(.c4p--tearsheet--has-close) .cds--slug {
+ inset-inline-end: 0;
+}
.c4p--create-tearsheet-narrow .cds--modal-header__heading,
.c4p--create-tearsheet-narrow .cds--modal-header__label,
diff --git a/packages/ibm-products-styles/src/components/Tearsheet/_tearsheet.scss b/packages/ibm-products-styles/src/components/Tearsheet/_tearsheet.scss
index eae14d7038..60f19faeaf 100644
--- a/packages/ibm-products-styles/src/components/Tearsheet/_tearsheet.scss
+++ b/packages/ibm-products-styles/src/components/Tearsheet/_tearsheet.scss
@@ -93,6 +93,22 @@ $motion-duration: $duration-moderate-02;
transform: translate3d(0, calc(min(95vh, 500px)), 0);
}
+ &.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-slug
+ .#{$block-class}__container {
+ border: 1px solid transparent;
+ /* override carbon ai removing background gradient */
+ background: linear-gradient(to top, var(--cds-layer), var(--cds-layer))
+ padding-box,
+ linear-gradient(
+ to bottom,
+ var(--cds-ai-border-start, #78a9ff),
+ var(--cds-ai-border-end, #d0e2ff)
+ )
+ border-box,
+ linear-gradient(to top, var(--cds-layer), var(--cds-layer)) border-box;
+ box-shadow: 0 4px 10px 2px $ai-drop-shadow;
+ }
+
// extra specificity to ensure this transition overrides the carbon default
&.#{$block-class}.#{$block-class} .#{$block-class}__container {
transition: transform $motion-duration motion(entrance, expressive),
@@ -223,8 +239,14 @@ $motion-duration: $duration-moderate-02;
}
&.#{$block-class}--wide
+ .#{$block-class}__header.#{$block-class}__header--with-close-icon,
+ &.#{$block-class}--has-slug .#{$block-class}__header.#{$block-class}__header {
+ padding-right: $spacing-11;
+ }
+
+ &.#{$block-class}--wide.#{$block-class}--has-slug
.#{$block-class}__header.#{$block-class}__header--with-close-icon {
- padding-right: $spacing-10;
+ margin-right: $spacing-09;
}
&.#{$block-class}--narrow .#{$block-class}__header-description {
@@ -292,6 +314,10 @@ $motion-duration: $duration-moderate-02;
flex-grow: 1;
}
+ &.#{$block-class}--has-slug .#{$block-class}__main {
+ @include utilities.callout-gradient('default', 0);
+ }
+
&.#{$block-class}--wide .#{$block-class}__content {
// Revert background color overridden by Carbon's modal - https://github.com/carbon-design-system/carbon/blob/main/packages/styles/scss/components/modal/_modal.scss#L54
.#{$carbon-prefix}--pagination,
@@ -320,7 +346,8 @@ $motion-duration: $duration-moderate-02;
.#{$carbon-prefix}--dropdown--light .#{$carbon-prefix}--dropdown-list,
/* stylelint-disable-next-line prettier/prettier */
.#{$carbon-prefix}--number--light input[type='number'],
- .#{$carbon-prefix}--date-picker--light .#{$carbon-prefix}--date-picker__input {
+ .#{$carbon-prefix}--date-picker--light
+ .#{$carbon-prefix}--date-picker__input {
background-color: $field-02;
}
}
@@ -340,4 +367,9 @@ $motion-duration: $duration-moderate-02;
&.#{$block-class}--wide .#{$block-class}__buttons {
background: $background;
}
+
+ &.#{$block-class}--has-slug:not(.#{$block-class}--has-close)
+ .#{$carbon-prefix}--slug {
+ inset-inline-end: 0;
+ }
}
diff --git a/packages/ibm-products/src/components/Tearsheet/Tearsheet.stories.js b/packages/ibm-products/src/components/Tearsheet/Tearsheet.stories.js
index 4229b8abb0..840abf4ae7 100644
--- a/packages/ibm-products/src/components/Tearsheet/Tearsheet.stories.js
+++ b/packages/ibm-products/src/components/Tearsheet/Tearsheet.stories.js
@@ -21,6 +21,8 @@ import {
Tabs,
TabList,
TextInput,
+ unstable__Slug as Slug,
+ unstable__SlugContent as SlugContent,
} from '@carbon/react';
import { Tearsheet, deprecatedProps } from './Tearsheet';
@@ -102,6 +104,17 @@ export default {
navigation: { control: { disable: true } },
open: { control: { disable: true } },
portalTarget: { control: { disable: true } },
+ slug: {
+ control: {
+ type: 'select',
+ labels: {
+ 0: 'No AI slug',
+ 1: 'with AI Slug',
+ },
+ default: 0,
+ },
+ options: [0, 1],
+ },
},
};
@@ -160,9 +173,29 @@ const tabs = (
const title = 'Title of the tearsheet';
+const sampleSlug = (
+ AI Explained Confidence score
+ This is not really Lorem Ipsum but the spell checker did not like the
+ previous text with it's non-words which is why this unwieldy
+ sentence, should one choose to call it that, here.
+ Model type Foundation model84%
+
+
AI Explained
+Confidence score
++ This is not really Lorem Ipsum but the spell checker did not like the + previous text with it's non-words which is why this unwieldy + sentence, should one choose to call it that, here. +
+Model type
+Foundation model
+AI Explained
+Confidence score
++ This is not really Lorem Ipsum but the spell checker did not like the + previous text with it's non-words which is why this unwieldy + sentence, should one choose to call it that, here. +
+Model type
+Foundation model
+