From 5b96aca65da864373e58334becb93a6a8a1c37e1 Mon Sep 17 00:00:00 2001 From: victortrinh2 <132942359+victortrinh2@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:11:23 -0400 Subject: [PATCH] [DS-379] Make heading optional in Popover (#164) --- .changeset/angry-panthers-try.md | 5 +++++ packages/components/src/popover/src/Popover.tsx | 2 +- .../src/popover/tests/chromatic/Popover.stories.tsx | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/angry-panthers-try.md diff --git a/.changeset/angry-panthers-try.md b/.changeset/angry-panthers-try.md new file mode 100644 index 000000000..1ef49bd9d --- /dev/null +++ b/.changeset/angry-panthers-try.md @@ -0,0 +1,5 @@ +--- +"@workleap/orbiter-ui": patch +--- + +Heading is now optional in Popover diff --git a/packages/components/src/popover/src/Popover.tsx b/packages/components/src/popover/src/Popover.tsx index ba7731d57..26fd3f946 100644 --- a/packages/components/src/popover/src/Popover.tsx +++ b/packages/components/src/popover/src/Popover.tsx @@ -92,7 +92,7 @@ export function InnerPopover({ const { button, "button-group": buttonGroup, content, footer, heading } = useSlots(children, useMemo(() => ({ _: { - required: ["heading", "content"] + required: ["content"] }, button: { className: "o-ui-popover-button", diff --git a/packages/components/src/popover/tests/chromatic/Popover.stories.tsx b/packages/components/src/popover/tests/chromatic/Popover.stories.tsx index fdb58d08e..752ef43bb 100644 --- a/packages/components/src/popover/tests/chromatic/Popover.stories.tsx +++ b/packages/components/src/popover/tests/chromatic/Popover.stories.tsx @@ -207,3 +207,12 @@ export const Style: PopoverStory = { ) }; + +export const NoHeading: PopoverStory = { + storyName: "no heading", + render: () => ( + + SpaceX designs, manufactures, and launches the world's most advanced rockets and spacecraft. + + ) +};