diff --git a/packages/calcite-components/src/components/dialog/dialog.e2e.ts b/packages/calcite-components/src/components/dialog/dialog.e2e.ts index d9acdb326c8..5949386dd71 100644 --- a/packages/calcite-components/src/components/dialog/dialog.e2e.ts +++ b/packages/calcite-components/src/components/dialog/dialog.e2e.ts @@ -593,7 +593,7 @@ describe("calcite-dialog", () => { const page = await newE2EPage(); await page.setContent( html` -
+
diff --git a/packages/calcite-components/src/components/dialog/dialog.stories.ts b/packages/calcite-components/src/components/dialog/dialog.stories.ts index e63c2580f78..1547ff3f3d7 100644 --- a/packages/calcite-components/src/components/dialog/dialog.stories.ts +++ b/packages/calcite-components/src/components/dialog/dialog.stories.ts @@ -137,6 +137,22 @@ const footerContent = html`Cancel Save`; +const customContent = html`
+

This dialog has default content replaced with custom content.

+ Close +
`; + export const slots = (): string => html`
Slot for a content-top.
@@ -171,6 +187,10 @@ export const slotsWithModal = (): string => html`
`; +export const customContentSlot = (): string => html` + ${customContent} +`; + export const darkModeRTLCustomSizeCSSVars = (): string => html` ) : null} - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
diff --git a/packages/calcite-components/src/components/dialog/resources.ts b/packages/calcite-components/src/components/dialog/resources.ts index 31298ddf31a..77d71083954 100644 --- a/packages/calcite-components/src/components/dialog/resources.ts +++ b/packages/calcite-components/src/components/dialog/resources.ts @@ -15,6 +15,7 @@ export const SLOTS = { actionBar: "action-bar", alerts: "alerts", content: "content", + customContent: "custom-content", contentTop: "content-top", contentBottom: "content-bottom", headerActionsStart: "header-actions-start", diff --git a/packages/calcite-components/src/demos/dialog.html b/packages/calcite-components/src/demos/dialog.html index b5df23532a2..4130f964503 100644 --- a/packages/calcite-components/src/demos/dialog.html +++ b/packages/calcite-components/src/demos/dialog.html @@ -26,6 +26,18 @@ text-align: right; } + .custom-content-slot-test-div { + margin: auto; + padding: 20px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background-color: var(--calcite-color-background); + border: 1px solid var(--calcite-color-brand); + border-radius: 5px; + } + hr { margin: 25px 0; border-top: 1px solid var(--calcite-color-border-2); @@ -1679,12 +1691,32 @@

Dialog

+
+ +
+
+
+ +
+

This dialog has default content replaced with custom content.

+ Close +
+
+ + + custom content slot + +
+
+