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