@jamsrui/tooltip 0.0.13 → 0.0.14
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.mjs +1 -1
- package/dist/styles.mjs +1 -1
- package/dist/tooltip-arrow.mjs +1 -1
- package/dist/tooltip-config.mjs +1 -1
- package/dist/tooltip-content.mjs +1 -1
- package/dist/tooltip-context.mjs +1 -1
- package/dist/tooltip-trigger.mjs +1 -1
- package/dist/tooltip.mjs +1 -1
- package/dist/use-tooltip.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-47EFJXRD.mjs +0 -1
- package/dist/chunk-67HMOO7F.mjs +0 -1
- package/dist/chunk-C2D5NMEG.mjs +0 -1
- package/dist/chunk-DTYTFK7D.mjs +0 -1
- package/dist/chunk-GWBVOOXK.mjs +0 -1
- package/dist/chunk-HHCN7FQG.mjs +0 -1
- package/dist/chunk-JHUW52HO.mjs +0 -1
- package/dist/chunk-UAC7SK5Q.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TooltipGroup as t,Tooltip as o}from"./tooltip.mjs";import{TooltipArrow as r}from"./tooltip-arrow.mjs";import{TooltipContent as e}from"./tooltip-content.mjs";import{TooltipTrigger as p}from"./tooltip-trigger.mjs";import{TooltipConfig as g,useTooltipConfig as m}from"./tooltip-config.mjs";import{TooltipGroup as c}from"./tooltip.mjs";const s=Object.assign(o,{Root:o,Arrow:r,Content:e,Trigger:p,Group:t});export{s as Tooltip,g as TooltipConfig,c as TooltipGroup,m as useTooltipConfig};
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{radiusVariant as t,tv as o}from"@jamsrui/utils";const a=o({slots:{content:"bg-surface inline-flex px-3 py-1 text-sm font-medium text-foreground",arrow:"fill-background-secondary"},variants:{radius:t("content")},defaultVariants:{radius:"md"}});export{a as tooltipVariants};
|
package/dist/tooltip-arrow.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import{FloatingArrow as e}from"@floating-ui/react";import{useTooltipContext as n}from"./tooltip-context.mjs";const w=o=>{const{getArrowProps:r,isOpen:t}=n();return t?p(e,{...r(o),...o}):null};export{w as TooltipArrow};
|
package/dist/tooltip-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[p,i]=o({displayName:"TooltipConfigContext"});export{p as TooltipConfig,i as useTooltipConfig};
|
package/dist/tooltip-content.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useRenderElement as r}from"@jamsrui/hooks";import{useTooltipContext as p}from"./tooltip-context.mjs";const l=t=>{const{isOpen:e,getContentProps:o}=p(),n=r("div",{props:[o(t)]});return e?n:null};export{l as TooltipContent};
|
package/dist/tooltip-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{createContext as o,use as e}from"react";const p=o(null),n=()=>{const t=e(p);if(!t)throw new Error("useTooltipContext must be used within a TooltipContext.Provider");return t};export{p as TooltipContext,n as useTooltipContext};
|
package/dist/tooltip-trigger.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{Fragment as l,jsx as c}from"react/jsx-runtime";import{cloneElement as n}from"react";import{useTooltipContext as p}from"./tooltip-context.mjs";const T=r=>{const{children:e}=r,{getTriggerProps:o,isDisabled:t}=p();if(t)return e;const i=n(e,o());return c(l,{children:i})};export{T as TooltipTrigger};
|
package/dist/tooltip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{TooltipContext as p}from"./tooltip-context.mjs";import{useTooltip as r}from"./use-tooltip.mjs";const s=o=>{const{children:t}=o,e=r(o);return i(p,{value:e,children:t})};import{FloatingDelayGroup as x}from"@floating-ui/react";export{s as Tooltip,x as TooltipGroup};
|
package/dist/use-tooltip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/tooltip",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
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.14",
|
|
10
|
+
"@jamsrui/utils": "^0.0.14",
|
|
11
|
+
"@jamsrui/core": "^0.0.12"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
package/dist/chunk-47EFJXRD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{radiusVariant as t,tv as o}from"@jamsrui/utils";var a=o({slots:{content:"bg-surface inline-flex px-3 py-1 text-sm font-medium text-foreground",arrow:"fill-background-secondary"},variants:{radius:t("content")},defaultVariants:{radius:"md"}});export{a};
|
package/dist/chunk-67HMOO7F.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-JHUW52HO.mjs";import{a as t}from"./chunk-DTYTFK7D.mjs";import{FloatingDelayGroup as x}from"@floating-ui/react";import{jsx as i}from"react/jsx-runtime";var s=o=>{let{children:p}=o,r=e(o);return i(t,{value:r,children:p})};export{s as a,x as b};
|
package/dist/chunk-C2D5NMEG.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createConfigContext as o}from"@jamsrui/utils";var[p,i]=o({displayName:"TooltipConfigContext"});export{p as a,i as b};
|
package/dist/chunk-DTYTFK7D.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as o,use as e}from"react";var p=o(null),n=()=>{let t=e(p);if(!t)throw new Error("useTooltipContext must be used within a TooltipContext.Provider");return t};export{p as a,n as b};
|
package/dist/chunk-GWBVOOXK.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./chunk-DTYTFK7D.mjs";import{FloatingArrow as n}from"@floating-ui/react";import{jsx as p}from"react/jsx-runtime";var w=o=>{let{getArrowProps:t,isOpen:e}=r();return e?p(n,{...t(o),...o}):null};export{w as a};
|
package/dist/chunk-HHCN7FQG.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as t}from"./chunk-DTYTFK7D.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var l=e=>{let{isOpen:o,getContentProps:n}=t(),r=p("div",{props:[n(e)]});return o?r:null};export{l as a};
|
package/dist/chunk-JHUW52HO.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./chunk-47EFJXRD.mjs";import{useCallback as c,useMemo as N,useState as j}from"react";import{arrow as k,autoUpdate as H,flip as I,offset as M,safePolygon as W,shift as U,useDelayGroup as q,useDismiss as z,useFloating as B,useFocus as J,useHover as K,useInteractions as L,useRole as Q}from"@floating-ui/react";import{useControlledState as X}from"@jamsrui/hooks";var oe=w=>{let{delay:r,offset:C=4,placement:O="top",radius:D,defaultOpen:F,isOpen:T,onOpenChange:A,disabled:f=!1,...Y}=w,[p,x]=X({defaultProp:F,onChange:A,prop:T}),[m,G]=j(null),i=!!m,S=i?7:0,{refs:n,floatingStyles:u,context:e}=B({open:p,onOpenChange:x,placement:O,whileElementsMounted:H,middleware:[M(C+S),I({fallbackAxisSideDirection:"start"}),U(),k({element:m})]}),{delay:o}=q(e),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);let v=K(e,{move:!1,handleClose:W({blockPointerEvents:!0}),delay:{close:s,open:t}}),E=J(e),R=z(e),V=Q(e,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:y}=L([v,E,R,V]),l=h({radius:D}),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:G,className:l.arrow({className:a.className})}),[e,l]),b=c(()=>({...d({ref:n.setReference})}),[d,n.setReference]);return N(()=>({getContentProps:P,getArrowProps:g,isOpen:p,showArrow:i,getTriggerProps:b,isDisabled:f}),[P,g,p,i,b,f])};export{oe as a};
|
package/dist/chunk-UAC7SK5Q.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./chunk-DTYTFK7D.mjs";import{cloneElement as p}from"react";import{Fragment as l,jsx as c}from"react/jsx-runtime";var T=o=>{let{children:e}=o,{getTriggerProps:t,isDisabled:i}=r();if(i)return e;let n=p(e,t());return c(l,{children:n})};export{T as a};
|