@gusarov-studio/rubik-ui 10.0.2 → 11.0.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.
- package/dist/Tooltip/Tooltip.d.ts +7 -15
- package/dist/Tooltip/TooltipContent.d.ts +3 -2
- package/dist/Tooltip/TooltipContext.d.ts +5 -53
- package/dist/Tooltip/TooltipRoot.d.ts +20 -0
- package/dist/Tooltip/TooltipTrigger.d.ts +1 -1
- package/dist/Tooltip/hooks/useTooltip.d.ts +3 -2
- package/dist/Tooltip/index.d.ts +10 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.declarations.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
width?: WidthValue;
|
|
9
|
-
withArrow?: boolean;
|
|
10
|
-
initialOpen?: boolean;
|
|
11
|
-
open?: boolean;
|
|
12
|
-
onOpenChange?: (open: boolean) => void;
|
|
13
|
-
}
|
|
14
|
-
interface TooltipProps extends TooltipPropsBase {
|
|
15
|
-
children: React.ReactNode;
|
|
2
|
+
import { type TooltipRootProps } from "./TooltipRoot";
|
|
3
|
+
interface TooltipProps extends TooltipRootProps {
|
|
4
|
+
title: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
zIndex?: number | `${number}`;
|
|
16
8
|
}
|
|
17
9
|
declare const Tooltip: React.FC<TooltipProps>;
|
|
18
|
-
export { Tooltip, type
|
|
10
|
+
export { Tooltip, type TooltipProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Tooltip.scss";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type TooltipContentProps = React.HTMLProps<HTMLDivElement>;
|
|
4
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { TooltipContent, type TooltipContentProps };
|
|
@@ -1,55 +1,7 @@
|
|
|
1
1
|
import type { useTooltip } from "./hooks/useTooltip";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
declare const useTooltipContext: () => {
|
|
5
|
-
placement: import("@floating-ui/utils").Placement;
|
|
6
|
-
strategy: import("@floating-ui/utils").Strategy;
|
|
7
|
-
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
isPositioned: boolean;
|
|
11
|
-
update: () => void;
|
|
12
|
-
floatingStyles: React.CSSProperties;
|
|
13
|
-
refs: {
|
|
14
|
-
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
15
|
-
floating: React.MutableRefObject<HTMLElement | null>;
|
|
16
|
-
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
17
|
-
setFloating: (node: HTMLElement | null) => void;
|
|
18
|
-
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
19
|
-
elements: {
|
|
20
|
-
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
21
|
-
floating: HTMLElement | null;
|
|
22
|
-
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
23
|
-
context: {
|
|
24
|
-
x: number;
|
|
25
|
-
y: number;
|
|
26
|
-
placement: import("@floating-ui/utils").Placement;
|
|
27
|
-
strategy: import("@floating-ui/utils").Strategy;
|
|
28
|
-
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
29
|
-
isPositioned: boolean;
|
|
30
|
-
update: () => void;
|
|
31
|
-
floatingStyles: React.CSSProperties;
|
|
32
|
-
open: boolean;
|
|
33
|
-
onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
|
|
34
|
-
events: import("@floating-ui/react").FloatingEvents;
|
|
35
|
-
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
36
|
-
nodeId: string | undefined;
|
|
37
|
-
floatingId: string | undefined;
|
|
38
|
-
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
39
|
-
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
40
|
-
};
|
|
41
|
-
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
|
|
42
|
-
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
43
|
-
getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
|
|
44
|
-
active?: boolean;
|
|
45
|
-
selected?: boolean;
|
|
46
|
-
}) => Record<string, unknown>;
|
|
47
|
-
size: "24" | "32" | "36" | "44";
|
|
48
|
-
withArrow: boolean;
|
|
49
|
-
arrowRef: import("react").MutableRefObject<SVGSVGElement | null>;
|
|
50
|
-
centered: boolean;
|
|
51
|
-
width: (number | "auto" | "0" | import("../types/CSSUnit").CSSUnit | `calc(${string})`) | undefined;
|
|
52
|
-
open: boolean;
|
|
53
|
-
setOpen: (newOpen: boolean) => void;
|
|
2
|
+
type TooltipContextType = ReturnType<typeof useTooltip> & {
|
|
3
|
+
zIndex?: number | `${number}`;
|
|
54
4
|
};
|
|
55
|
-
|
|
5
|
+
declare const TooltipContext: import("react").Context<TooltipContextType | null>;
|
|
6
|
+
declare const useTooltipContext: () => TooltipContextType;
|
|
7
|
+
export { TooltipContext, type TooltipContextType, useTooltipContext };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Placement } from "@floating-ui/react";
|
|
3
|
+
import type { CSSUnit } from "../types/CSSUnit";
|
|
4
|
+
type WidthValue = CSSUnit | "0" | `calc(${string})` | number | "auto";
|
|
5
|
+
interface TooltipRootPropsBase {
|
|
6
|
+
size?: "24" | "32" | "36" | "44";
|
|
7
|
+
position?: Placement;
|
|
8
|
+
width?: WidthValue;
|
|
9
|
+
withArrow?: boolean;
|
|
10
|
+
initialOpen?: boolean;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
zIndex?: number | `${number}`;
|
|
14
|
+
}
|
|
15
|
+
interface TooltipRootProps extends TooltipRootPropsBase {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
zIndex?: number | `${number}`;
|
|
18
|
+
}
|
|
19
|
+
declare const TooltipRoot: React.FC<TooltipRootProps>;
|
|
20
|
+
export { TooltipRoot, type TooltipRootPropsBase, type TooltipRootProps };
|
|
@@ -4,4 +4,4 @@ interface TooltipTriggerProps extends React.HTMLProps<HTMLElement> {
|
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
7
|
-
export { TooltipTrigger };
|
|
7
|
+
export { TooltipTrigger, type TooltipTriggerProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const useTooltip: ({ size, position, withArrow, width, initialOpen, open: controlledOpen, onOpenChange, }?:
|
|
1
|
+
import type { TooltipRootPropsBase } from "../TooltipRoot";
|
|
2
|
+
declare const useTooltip: ({ size, position, withArrow, width, initialOpen, open: controlledOpen, onOpenChange, zIndex, }?: TooltipRootPropsBase) => {
|
|
3
3
|
placement: import("@floating-ui/utils").Placement;
|
|
4
4
|
strategy: import("@floating-ui/utils").Strategy;
|
|
5
5
|
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
@@ -49,5 +49,6 @@ declare const useTooltip: ({ size, position, withArrow, width, initialOpen, open
|
|
|
49
49
|
width: (number | "auto" | "0" | import("../../types/CSSUnit").CSSUnit | `calc(${string})`) | undefined;
|
|
50
50
|
open: boolean;
|
|
51
51
|
setOpen: (newOpen: boolean) => void;
|
|
52
|
+
zIndex: number | `${number}` | undefined;
|
|
52
53
|
};
|
|
53
54
|
export { useTooltip };
|
package/dist/Tooltip/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Tooltip, type TooltipProps } from "./Tooltip";
|
|
2
|
+
import { type TooltipRootProps } from "./TooltipRoot";
|
|
3
|
+
import { type TooltipTriggerProps } from "./TooltipTrigger";
|
|
4
|
+
import { type TooltipContentProps } from "./TooltipContent";
|
|
5
|
+
declare const CustomTooltip: {
|
|
6
|
+
Root: import("react").FC<TooltipRootProps>;
|
|
7
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<TooltipTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
8
|
+
Content: import("react").ForwardRefExoticComponent<Omit<TooltipContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
};
|
|
10
|
+
export { Tooltip, CustomTooltip, type TooltipProps, type TooltipRootProps, type TooltipTriggerProps, type TooltipContentProps, };
|