@openwarelabs/ui 0.1.1 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type RefObject } from "react";
2
- export type Placement = "bottom-start" | "bottom-end" | "bottom" | "top-start" | "top-end" | "top";
2
+ export type Placement = "bottom-start" | "bottom-end" | "bottom" | "top-start" | "top-end" | "top" | "left" | "right";
3
3
  interface Options {
4
4
  open: boolean;
5
5
  anchorRef: RefObject<HTMLElement | null>;
@@ -14,7 +14,7 @@ interface Options {
14
14
  }
15
15
  /**
16
16
  * Positions a floating element (a popover, a listbox) against its anchor with fixed coordinates, flips it above
17
- * or below when there's no room, keeps it on screen, and follows the anchor when the page scrolls or resizes.
17
+ * or below (or, for "left" and "right", to the other side) when there's no room, keeps it on screen, and follows the anchor when the page scrolls or resizes.
18
18
  * It also puts the element in the browser's top layer (popover="manual"), so dialogs and overflow can't clip it.
19
19
  * Pass the element's `mounted` from usePresence as `open`, so it stays placed while it animates out.
20
20
  */
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties, type RefObject } from "react";
2
- export type Placement = "bottom-start" | "bottom-end" | "bottom" | "top-start" | "top-end" | "top";
2
+ export type Placement = "bottom-start" | "bottom-end" | "bottom" | "top-start" | "top-end" | "top" | "left" | "right";
3
3
  interface Options {
4
4
  open: boolean;
5
5
  anchorRef: RefObject<HTMLElement | null>;
@@ -14,7 +14,7 @@ interface Options {
14
14
  }
15
15
  /**
16
16
  * Positions a floating element (a popover, a listbox) against its anchor with fixed coordinates, flips it above
17
- * or below when there's no room, keeps it on screen, and follows the anchor when the page scrolls or resizes.
17
+ * or below (or, for "left" and "right", to the other side) when there's no room, keeps it on screen, and follows the anchor when the page scrolls or resizes.
18
18
  * It also puts the element in the browser's top layer (popover="manual"), so dialogs and overflow can't clip it.
19
19
  * Pass the element's `mounted` from usePresence as `open`, so it stays placed while it animates out.
20
20
  */