@darthcharles/greda 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,5 +15,6 @@ requested for the initial component set.
15
15
 
16
16
  Local adaptations: relative imports; shared semantic color utilities; a scoped CSS baseline;
17
17
  consumer token mapping; optional portal containers; button loading, 1px press feedback from the current Nova style, and a default
18
- non-submit type; viewport bounds on dialogs; invalid-field styles; an accessible
18
+ non-submit type; viewport bounds on dialogs and popovers; popover root positioning options,
19
+ portal container refs, and an explicit close helper; invalid-field styles; an accessible
19
20
  toast close name; and a distinct indeterminate checkbox icon.
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
4
+ export type PopoverAnchorProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;
5
+ type Side = NonNullable<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>["side"]>;
6
+ type Align = NonNullable<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>["align"]>;
7
+ export interface PopoverProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {
8
+ placement?: Side | `${Side}-${Exclude<Align, "center">}`;
9
+ sideOffset?: number;
10
+ }
11
+ declare function Popover({ placement, sideOffset, ...props }: PopoverProps): React.JSX.Element;
12
+ export type PopoverTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;
13
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
14
+ export type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
15
+ container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>["container"] | React.RefObject<HTMLElement | null>;
16
+ };
17
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
18
+ container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>["container"] | React.RefObject<HTMLElement | null>;
19
+ } & React.RefAttributes<HTMLDivElement>>;
20
+ export type PopoverCloseProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Close>;
21
+ declare const PopoverClose: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
22
+ export { Popover, PopoverTrigger, PopoverContent, PopoverClose, PopoverAnchor };
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from "./components/ui/checkbox";
10
10
  export * from "./components/ui/tabs";
11
11
  export * from "./components/ui/toast";
12
12
  export * from "./components/ui/tooltip";
13
+ export * from "./components/ui/popover";
13
14
  export { cn } from "./lib/utils";