@overdoser/react-toolkit 0.0.7 → 0.0.8

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.
@@ -5,8 +5,23 @@ export interface PopoverClasses {
5
5
  popover: string;
6
6
  }
7
7
  export interface PopoverProps {
8
- /** Trigger content. Wrapped in an internal `<button>`. */
8
+ /**
9
+ * Trigger content. By default, wrapped in an internal `<button>` — pass any
10
+ * `ReactNode` (string, icon, fragment). If you need to pass your own
11
+ * interactive element (e.g. a `<Button>`) without the extra wrapping that
12
+ * would nest `<button>` inside `<button>`, set `asChild` and pass a single
13
+ * React element instead.
14
+ */
9
15
  trigger: React.ReactNode;
16
+ /**
17
+ * Render the trigger as-is (no internal `<button>` wrapper) and merge the
18
+ * onClick / `aria-*` handlers + ref into it. The trigger MUST be a single
19
+ * React element whose root is interactive (e.g. a `<button>`, `<a>`, or a
20
+ * `role="button"` element). Use this when nesting `<button>` inside
21
+ * `<button>` would otherwise produce a hydration warning.
22
+ * @default false
23
+ */
24
+ asChild?: boolean;
10
25
  /** Panel content. Rendered inside a `[role="dialog"]` when open. */
11
26
  content: React.ReactNode;
12
27
  /** Side of the trigger to anchor the panel to. @default 'bottom' */