@danxbot/ui 3.10.1 → 3.11.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.
@@ -18,6 +18,19 @@ export interface PopoverProps {
18
18
  * documentation surface cannot dispatch a click.
19
19
  */
20
20
  defaultOpen?: boolean;
21
+ /**
22
+ * Told when the popup opens and when it closes. Uncontrolled still — this
23
+ * OBSERVES the state Base UI owns rather than taking it over, which is why
24
+ * there is no `open` prop beside it.
25
+ *
26
+ * `Collapsible`, `Dialog` and `Menu` all already carry this exact signature;
27
+ * the popover was the one overlay a consumer could not hear. The reason to
28
+ * hear it is almost never styling — it is WORK: a panel whose contents cost
29
+ * a request must not pay for that request while it is shut, and a page of a
30
+ * hundred closed popovers that each fetched on mount is a hundred requests
31
+ * for the one panel somebody eventually opens.
32
+ */
33
+ onOpenChange?: (open: boolean) => void;
21
34
  /**
22
35
  * Names the popup for assistive technology.
23
36
  *
@@ -30,7 +43,7 @@ export interface PopoverProps {
30
43
  "aria-labelledby"?: string;
31
44
  "aria-label"?: string;
32
45
  }
33
- export declare function Popover({ trigger, side, align, arrow, className, children, ref, defaultOpen, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, }: PopoverProps): import("react").JSX.Element;
46
+ export declare function Popover({ trigger, side, align, arrow, className, children, ref, defaultOpen, onOpenChange, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, }: PopoverProps): import("react").JSX.Element;
34
47
  /** Closes the nearest Popover. */
35
48
  export declare function PopoverClose({ children }: {
36
49
  children: ReactNode;
@@ -59,6 +59,24 @@ export interface ProvenanceDisclosureProps {
59
59
  * edges and does not want a second one.
60
60
  */
61
61
  triggerContent?: ReactNode;
62
+ /**
63
+ * Called with `true` when the panel opens and `false` when it closes.
64
+ *
65
+ * The signature `Collapsible`, `Dialog`, `Menu` and `Popover` all use, for
66
+ * the reason a fourth spelling would be worse than a familiar one: a
67
+ * consumer already knows what `onOpenChange` does everywhere else here.
68
+ *
69
+ * Purely an observation. The popover stays uncontrolled, so this does not
70
+ * make the caller responsible for closing it, for returning focus, or for
71
+ * escape — pass the callback and nothing else about the component moves.
72
+ *
73
+ * The reason it exists is the fetch: a value's citations, its source pages,
74
+ * its audit trail are usually a request, and this is the only moment at
75
+ * which a consumer knows that request is now worth making. It does NOT fire
76
+ * on mount — see the note at the top of this file for why that is the load-
77
+ * bearing half of the guarantee, not a footnote to it.
78
+ */
79
+ onOpenChange?: (open: boolean) => void;
62
80
  className?: string;
63
81
  }
64
- export declare function ProvenanceDisclosure({ record, actions, emptyLabel, redactedLabel, triggerBadge, valueWrap, triggerContent, className, }: ProvenanceDisclosureProps): import("react").JSX.Element;
82
+ export declare function ProvenanceDisclosure({ record, actions, emptyLabel, redactedLabel, triggerBadge, valueWrap, triggerContent, onOpenChange, className, }: ProvenanceDisclosureProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "3.10.1",
3
+ "version": "3.11.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",