@douglasneuroinformatics/libui 3.5.0 → 3.5.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@douglasneuroinformatics/libui",
3
3
  "type": "module",
4
- "version": "3.5.0",
4
+ "version": "3.5.1",
5
5
  "packageManager": "pnpm@9.11.0",
6
6
  "description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
7
7
  "author": "Joshua Unrau",
@@ -7,14 +7,26 @@ export type TooltipRootProps = {
7
7
  children: React.ReactNode;
8
8
  /** The duration from when the mouse enters a tooltip trigger until the tooltip opens. */
9
9
  delayDuration?: number;
10
+ /** Event handler called when the open state of the tooltip changes. */
11
+ onOpenChange?: (open: boolean) => void;
12
+ /** The controlled open state of the tooltip. Must be used in conjunction with onOpenChange. */
13
+ open?: boolean;
10
14
  /** How much time a user has to enter another trigger without incurring a delay again. */
11
15
  skipDelayDuration?: number;
12
16
  };
13
17
 
14
- export const TooltipRoot = ({ children, delayDuration = 0, skipDelayDuration = 300 }: TooltipRootProps) => {
18
+ export const TooltipRoot = ({
19
+ children,
20
+ delayDuration = 0,
21
+ onOpenChange,
22
+ open,
23
+ skipDelayDuration = 300
24
+ }: TooltipRootProps) => {
15
25
  return (
16
26
  <Provider delayDuration={delayDuration} skipDelayDuration={skipDelayDuration}>
17
- <Root>{children}</Root>
27
+ <Root open={open} onOpenChange={onOpenChange}>
28
+ {children}
29
+ </Root>
18
30
  </Provider>
19
31
  );
20
32
  };