From 03c4b961769393bf29f6701761c1284fccd0bf01 Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:01:29 +0200 Subject: [PATCH] feat(system): add more control to Popover --- packages/status-react/src/system/popover/popover.tsx | 6 ++++-- packages/status-react/src/system/popover/styles.tsx | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/status-react/src/system/popover/popover.tsx b/packages/status-react/src/system/popover/popover.tsx index e284e5c0..e6c47952 100644 --- a/packages/status-react/src/system/popover/popover.tsx +++ b/packages/status-react/src/system/popover/popover.tsx @@ -9,15 +9,17 @@ import type { Ref } from 'react' interface TriggerProps { children: [React.ReactElement, React.ReactElement] + open?: boolean + onOpenChange?: (open: boolean) => void } const PopoverTrigger = (props: TriggerProps, ref: Ref) => { - const { children, ...triggerProps } = props + const { children, open, onOpenChange, ...triggerProps } = props const [trigger, content] = children return ( - + {cloneElement(trigger, { ref, ...triggerProps })} diff --git a/packages/status-react/src/system/popover/styles.tsx b/packages/status-react/src/system/popover/styles.tsx index 5223ba85..6d911707 100644 --- a/packages/status-react/src/system/popover/styles.tsx +++ b/packages/status-react/src/system/popover/styles.tsx @@ -6,7 +6,6 @@ export type Variants = VariantProps export const Content = styled('div', { backgroundColor: 'white', - padding: '$4', borderRadius: 8, boxShadow: 'hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px',