From 499bc3d4897ff80782c7b3136d908b170aeb6544 Mon Sep 17 00:00:00 2001 From: Matt Driscoll Date: Thu, 25 Jul 2024 14:17:08 -0700 Subject: [PATCH 1/3] fix(panel, flow-item): prevent footer slots from conflicting with each other. #9855 --- .../src/components/flow-item/flow-item.stories.ts | 8 +++++--- .../src/components/flow-item/flow-item.tsx | 13 ++++++------- .../src/components/panel/panel.tsx | 13 ++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/calcite-components/src/components/flow-item/flow-item.stories.ts b/packages/calcite-components/src/components/flow-item/flow-item.stories.ts index 6e44129892b..f80d1efc45d 100644 --- a/packages/calcite-components/src/components/flow-item/flow-item.stories.ts +++ b/packages/calcite-components/src/components/flow-item/flow-item.stories.ts @@ -234,7 +234,8 @@ export const footerPaddingAndContentBottom = (): string =>
Header!

Slotted content!

Content bottom!
-
Footer!
+ Footer 1 + Footer 2 `; @@ -248,13 +249,14 @@ export const footerStartEndAndContentBottom = (): string => `; -export const footerSlotPrecedence = (): string => +export const footerSlotCoexistence = (): string => html`
Header!

Slotted content!

Content bottom!
-
Footer!
+ Footer 1 + Footer 2 ${footerHTML}
`; diff --git a/packages/calcite-components/src/components/flow-item/flow-item.tsx b/packages/calcite-components/src/components/flow-item/flow-item.tsx index 835ec027b18..cdf76f4fe48 100644 --- a/packages/calcite-components/src/components/flow-item/flow-item.tsx +++ b/packages/calcite-components/src/components/flow-item/flow-item.tsx @@ -52,10 +52,10 @@ import { CSS, ICONS, SLOTS } from "./resources"; * @slot header-content - A slot for adding custom content to the component's header. * @slot header-menu-actions - A slot for adding an overflow menu with `calcite-action`s inside a `calcite-dropdown`. * @slot fab - A slot for adding a `calcite-fab` (floating action button) to perform an action. - * @slot footer - A slot for adding custom content to the component's footer. + * @slot footer - A slot for adding custom content to the component's footer. Should not be used in conjunction with footer-start or footer-end slots. * @slot footer-actions - [Deprecated] Use the `"footer"` slot instead. A slot for adding `calcite-button`s to the component's footer. - * @slot footer-end - A slot for adding a trailing footer custom content. - * @slot footer-start - A slot for adding a leading footer custom content. + * @slot footer-end - A slot for adding a trailing footer custom content. Should not be used in conjunction with footer slot. + * @slot footer-start - A slot for adding a leading footer custom content. Should not be used in conjunction with footer slot. */ @Component({ tag: "calcite-flow-item", @@ -405,10 +405,9 @@ export class FlowItem - - - - + + + diff --git a/packages/calcite-components/src/components/panel/panel.tsx b/packages/calcite-components/src/components/panel/panel.tsx index dd73c532ddb..05ad5dec3f6 100644 --- a/packages/calcite-components/src/components/panel/panel.tsx +++ b/packages/calcite-components/src/components/panel/panel.tsx @@ -58,10 +58,10 @@ import { CSS, ICONS, SLOTS } from "./resources"; * @slot header-content - A slot for adding custom content to the header. * @slot header-menu-actions - A slot for adding an overflow menu with actions inside a `calcite-dropdown`. * @slot fab - A slot for adding a `calcite-fab` (floating action button) to perform an action. - * @slot footer - A slot for adding custom content to the component's footer. + * @slot footer - A slot for adding custom content to the component's footer. Should not be used in conjunction with footer-start or footer-end slots. * @slot footer-actions - [Deprecated] Use the `footer-start` and `footer-end` slots instead. A slot for adding `calcite-button`s to the component's footer. - * @slot footer-end - A slot for adding a trailing footer custom content. - * @slot footer-start - A slot for adding a leading footer custom content. + * @slot footer-end - A slot for adding a trailing footer custom content. Should not be used in conjunction with footer slot. + * @slot footer-start - A slot for adding a leading footer custom content. Should not be used in conjunction with footer slot. */ @Component({ tag: "calcite-panel", @@ -620,10 +620,9 @@ export class Panel return (