@jamsrui/tooltip 0.0.16 → 0.0.17
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/index.d.mts +9 -9
- package/dist/index.mjs +1 -1
- package/dist/tooltip-config.d.mts +2 -2
- package/dist/tooltip-config.mjs +1 -1
- package/dist/use-tooltip.mjs +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -2,10 +2,10 @@ import * as react from 'react';
|
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { Tooltip as Tooltip$1 } from './tooltip.mjs';
|
|
4
4
|
import { TooltipArrow } from './tooltip-arrow.mjs';
|
|
5
|
+
import { TooltipConfig } from './tooltip-config.mjs';
|
|
6
|
+
export { useTooltipConfig } from './tooltip-config.mjs';
|
|
5
7
|
import { TooltipContent } from './tooltip-content.mjs';
|
|
6
8
|
import { TooltipTrigger } from './tooltip-trigger.mjs';
|
|
7
|
-
export { TooltipConfig, useTooltipConfig } from './tooltip-config.mjs';
|
|
8
|
-
import { FloatingDelayGroup } from '@floating-ui/react';
|
|
9
9
|
export { FloatingDelayGroup as TooltipGroup } from '@floating-ui/react';
|
|
10
10
|
import './use-tooltip.mjs';
|
|
11
11
|
import '@jamsrui/utils';
|
|
@@ -13,21 +13,21 @@ import './styles.mjs';
|
|
|
13
13
|
import '@jamsrui/core';
|
|
14
14
|
|
|
15
15
|
declare const Tooltip: ((props: Tooltip$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
16
|
-
Root: (props: Tooltip$1.Props) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
Arrow: (props: TooltipArrow.Props) => react_jsx_runtime.JSX.Element | null;
|
|
18
|
-
Content: (props: TooltipContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
19
16
|
Trigger: (props: TooltipTrigger.Props) => react_jsx_runtime.JSX.Element;
|
|
20
|
-
|
|
17
|
+
Content: (props: TooltipContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
18
|
+
Arrow: (props: TooltipArrow.Props) => react_jsx_runtime.JSX.Element | null;
|
|
21
19
|
};
|
|
22
20
|
declare namespace Tooltip {
|
|
23
21
|
interface Props extends Tooltip$1.Props {
|
|
24
22
|
}
|
|
25
|
-
interface
|
|
23
|
+
interface Config extends TooltipConfig.Props {
|
|
24
|
+
}
|
|
25
|
+
interface Trigger extends TooltipTrigger.Props {
|
|
26
26
|
}
|
|
27
27
|
interface Content extends TooltipContent.Props {
|
|
28
28
|
}
|
|
29
|
-
interface
|
|
29
|
+
interface Arrow extends TooltipArrow.Props {
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export { Tooltip };
|
|
33
|
+
export { Tooltip, TooltipArrow, TooltipConfig, TooltipContent, TooltipTrigger };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TooltipGroup as
|
|
1
|
+
import{TooltipGroup as e,Tooltip as p}from"./tooltip.mjs";import{TooltipArrow as o}from"./tooltip-arrow.mjs";import{TooltipConfig as i,useTooltipConfig as n}from"./tooltip-config.mjs";import{TooltipContent as t}from"./tooltip-content.mjs";import{TooltipTrigger as r}from"./tooltip-trigger.mjs";const x=Object.assign(p,{Trigger:r,Content:t,Arrow:o});export{x as Tooltip,o as TooltipArrow,i as TooltipConfig,t as TooltipContent,e as TooltipGroup,r as TooltipTrigger,n as useTooltipConfig};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { WithGlobalConfig } from '@jamsrui/core';
|
|
3
3
|
import { Tooltip } from './tooltip.mjs';
|
|
4
4
|
import './use-tooltip.mjs';
|
|
5
5
|
import '@floating-ui/react';
|
|
@@ -14,7 +14,7 @@ declare const TooltipConfig: (props: Omit<Partial<TooltipConfig.Props>, "childre
|
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
}) => react_jsx_runtime.JSX.Element;
|
|
16
16
|
declare namespace TooltipConfig {
|
|
17
|
-
interface Props extends
|
|
17
|
+
interface Props extends WithGlobalConfig<Tooltip.Props> {
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
package/dist/tooltip-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[p
|
|
1
|
+
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[i,p]=o({displayName:"TooltipConfigContext"});export{i as TooltipConfig,p as useTooltipConfig};
|
package/dist/use-tooltip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as c,useMemo as V,useState as N}from"react";import{arrow as j,autoUpdate as k,flip as H,offset as I,safePolygon as M,shift as W,useDelayGroup as U,useDismiss as q,useFloating as z,useFocus as B,useHover as J,useInteractions as K,useRole as L}from"@floating-ui/react";import{useControlledState as Q}from"@jamsrui/hooks";import{tooltipVariants as X}from"./styles.mjs";const oe=h=>{const{delay:r,offset:w=4,placement:C="top",radius:O,defaultOpen:D,isOpen:F,onOpenChange:T,disabled:f=!1,...Y}=h,[p,A]=Q({defaultProp:D,onChange:T,prop:F}),[m,x]=N(null),i=!!m,G=i?7:0,{refs:n,floatingStyles:u,context:e}=z({open:p,onOpenChange:A,placement:C,whileElementsMounted:k,middleware:[I(w+G),H({fallbackAxisSideDirection:"start"}),W(),j({element:m})]}),{delay:o}=U(e);let t=400,s=100;typeof r=="number"?(t=r,s=r):typeof r=="object"&&(t=r.open??t,s=r.close??s),typeof o=="number"&&o>0?(t=o,s=o):typeof o=="object"&&(t=o.open??t,s=o.close??s);const S=J(e,{move:!1,handleClose:M({blockPointerEvents:!0}),delay:{close:s,open:t}}),v=B(e),E=q(e),R=L(e,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:y}=K([S,v,E,R]),l=X({radius:O}),P=c(a=>({...a,className:l.content(),style:u,ref:n.setFloating,...y()}),[u,y,n.setFloating,l]),g=c(a=>({tipRadius:4,...a,context:e,ref:x,className:l.arrow({className:a.className})}),[e,l]),b=c(()=>({...d({ref:n.setReference})}),[d,n.setReference]);return V(()=>({getContentProps:P,getArrowProps:g,isOpen:p,showArrow:i,getTriggerProps:b,isDisabled:f}),[P,g,p,i,b,f])};export{oe as useTooltip};
|
|
1
|
+
"use client";import{useCallback as c,useMemo as V,useState as N}from"react";import{arrow as j,autoUpdate as k,flip as H,offset as I,safePolygon as M,shift as W,useDelayGroup as U,useDismiss as q,useFloating as z,useFocus as B,useHover as J,useInteractions as K,useRole as L}from"@floating-ui/react";import{useControlledState as Q}from"@jamsrui/hooks";import{tooltipVariants as X}from"./styles.mjs";const oe=h=>{const{delay:r,offset:w=4,placement:C="top",radius:O,defaultOpen:D,isOpen:F,onOpenChange:T,disabled:f=!1,...Y}=h,[p,A]=Q({defaultProp:D,onChange:T,prop:F}),[m,x]=N(null),i=!!m,G=i?7:0,{refs:n,floatingStyles:u,context:e}=z({open:p,onOpenChange:A,placement:C,whileElementsMounted:k,middleware:[I(w+G),H({fallbackAxisSideDirection:"start"}),W(),j({element:m})]}),{delay:o}=U(e);let t=400,s=100;typeof r=="number"?(t=r,s=r):typeof r=="object"&&(t=r.open??t,s=r.close??s),typeof o=="number"&&o>0?(t=o,s=o):typeof o=="object"&&(t=o.open??t,s=o.close??s);const S=J(e,{move:!1,handleClose:M({blockPointerEvents:!0}),delay:{close:s,open:t}}),v=B(e),E=q(e),R=L(e,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:y}=K([S,v,E,R]),l=X({radius:O}),P=c(a=>({...a,className:l.content(),style:u,ref:n.setFloating,...y()}),[u,y,n.setFloating,l]),g=c(a=>({tipRadius:4,...a,context:e,ref:x,className:l.arrow({className:a.className})}),[e,l]),b=c(()=>({...d({ref:n.setReference})}),[d,n.setReference]);return V(()=>({getContentProps:P,getArrowProps:g,isOpen:p,showArrow:i,getTriggerProps:b,isDisabled:f}),[P,g,p,i,b,f])};export{oe as useTooltip};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/tooltip",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@floating-ui/react": ">=0.27",
|
|
9
|
-
"@jamsrui/hooks": "^0.0.
|
|
10
|
-
"@jamsrui/
|
|
11
|
-
"@jamsrui/
|
|
9
|
+
"@jamsrui/hooks": "^0.0.17",
|
|
10
|
+
"@jamsrui/core": "^0.0.14",
|
|
11
|
+
"@jamsrui/utils": "^0.0.17"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|