@mirohq/design-system-tooltip
Advanced tools
Comparing version 3.2.14 to 3.2.15-use-press.2
@@ -5,2 +5,3 @@ 'use strict'; | ||
var jsxRuntime = require('react/jsx-runtime'); | ||
var React = require('react'); | ||
@@ -55,13 +56,20 @@ var reactTooltip = require('@radix-ui/react-tooltip'); | ||
...restProps | ||
}, forwardRef) => /* @__PURE__ */ React__default["default"].createElement(StyledContent, { | ||
...restProps, | ||
ref: forwardRef, | ||
align, | ||
alignOffset, | ||
avoidCollisions, | ||
collisionPadding, | ||
side, | ||
sideOffset, | ||
sticky | ||
}, children, /* @__PURE__ */ React__default["default"].createElement(StyledArrowIcon, null)) | ||
}, forwardRef) => /* @__PURE__ */ jsxRuntime.jsxs( | ||
StyledContent, | ||
{ | ||
...restProps, | ||
ref: forwardRef, | ||
align, | ||
alignOffset, | ||
avoidCollisions, | ||
collisionPadding, | ||
side, | ||
sideOffset, | ||
sticky, | ||
children: [ | ||
children, | ||
/* @__PURE__ */ jsxRuntime.jsx(StyledArrowIcon, {}) | ||
] | ||
} | ||
) | ||
); | ||
@@ -71,8 +79,11 @@ | ||
const Trigger = React__default["default"].forwardRef(({ onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ React__default["default"].createElement(StyledTrigger, { | ||
...restProps, | ||
onClick: onPress != null ? onPress : onClick, | ||
"data-tooltip-trigger": "", | ||
ref: forwardRef | ||
})); | ||
const Trigger = React__default["default"].forwardRef(({ onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx( | ||
StyledTrigger, | ||
{ | ||
...restProps, | ||
onClick: onPress != null ? onPress : onClick, | ||
"data-tooltip-trigger": "", | ||
ref: forwardRef | ||
} | ||
)); | ||
@@ -83,10 +94,6 @@ const ProviderContext = React.createContext({}); | ||
...restProps | ||
}) => /* @__PURE__ */ React__default["default"].createElement(ProviderContext.Provider, { | ||
value: restProps | ||
}, children); | ||
}) => /* @__PURE__ */ jsxRuntime.jsx(ProviderContext.Provider, { value: restProps, children }); | ||
const useTooltipContext = () => React.useContext(ProviderContext); | ||
const Portal = (props) => /* @__PURE__ */ React__default["default"].createElement(reactTooltip.Portal, { | ||
...props | ||
}); | ||
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactTooltip.Portal, { ...props }); | ||
@@ -117,3 +124,3 @@ let delayTimer; | ||
clearTimeout(skipDelayTimer); | ||
if (newOpenState === false) { | ||
if (!newOpenState) { | ||
skipDelayTimer = setTimeout(() => { | ||
@@ -157,17 +164,18 @@ shouldSkipDelay = false; | ||
}, []); | ||
return /* @__PURE__ */ React__default["default"].createElement(reactTooltip.Provider, { | ||
delayDuration: 0, | ||
skipDelayDuration: 0 | ||
}, /* @__PURE__ */ React__default["default"].createElement(reactTooltip.Root, { | ||
disableHoverableContent, | ||
open: open != null ? open : openState, | ||
delayDuration: 0, | ||
onOpenChange: (newState) => { | ||
if (open == null) { | ||
setDelayedOpen(newState); | ||
return; | ||
} | ||
newState ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose(); | ||
return /* @__PURE__ */ jsxRuntime.jsx(reactTooltip.Provider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsx( | ||
reactTooltip.Root, | ||
{ | ||
disableHoverableContent, | ||
open: open != null ? open : openState, | ||
delayDuration: 0, | ||
onOpenChange: (newState) => { | ||
if (open == null) { | ||
setDelayedOpen(newState); | ||
return; | ||
} | ||
newState ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose(); | ||
}, | ||
children | ||
} | ||
}, children)); | ||
) }); | ||
}; | ||
@@ -174,0 +182,0 @@ Tooltip.Trigger = Trigger; |
@@ -0,1 +1,2 @@ | ||
import { jsxs, jsx } from 'react/jsx-runtime'; | ||
import React, { createContext, useContext, useState, useCallback, useEffect } from 'react'; | ||
@@ -46,13 +47,20 @@ import { Arrow, Content as Content$1, Trigger as Trigger$1, Portal as Portal$1, Provider as Provider$1, Root } from '@radix-ui/react-tooltip'; | ||
...restProps | ||
}, forwardRef) => /* @__PURE__ */ React.createElement(StyledContent, { | ||
...restProps, | ||
ref: forwardRef, | ||
align, | ||
alignOffset, | ||
avoidCollisions, | ||
collisionPadding, | ||
side, | ||
sideOffset, | ||
sticky | ||
}, children, /* @__PURE__ */ React.createElement(StyledArrowIcon, null)) | ||
}, forwardRef) => /* @__PURE__ */ jsxs( | ||
StyledContent, | ||
{ | ||
...restProps, | ||
ref: forwardRef, | ||
align, | ||
alignOffset, | ||
avoidCollisions, | ||
collisionPadding, | ||
side, | ||
sideOffset, | ||
sticky, | ||
children: [ | ||
children, | ||
/* @__PURE__ */ jsx(StyledArrowIcon, {}) | ||
] | ||
} | ||
) | ||
); | ||
@@ -62,8 +70,11 @@ | ||
const Trigger = React.forwardRef(({ onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ React.createElement(StyledTrigger, { | ||
...restProps, | ||
onClick: onPress != null ? onPress : onClick, | ||
"data-tooltip-trigger": "", | ||
ref: forwardRef | ||
})); | ||
const Trigger = React.forwardRef(({ onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ jsx( | ||
StyledTrigger, | ||
{ | ||
...restProps, | ||
onClick: onPress != null ? onPress : onClick, | ||
"data-tooltip-trigger": "", | ||
ref: forwardRef | ||
} | ||
)); | ||
@@ -74,10 +85,6 @@ const ProviderContext = createContext({}); | ||
...restProps | ||
}) => /* @__PURE__ */ React.createElement(ProviderContext.Provider, { | ||
value: restProps | ||
}, children); | ||
}) => /* @__PURE__ */ jsx(ProviderContext.Provider, { value: restProps, children }); | ||
const useTooltipContext = () => useContext(ProviderContext); | ||
const Portal = (props) => /* @__PURE__ */ React.createElement(Portal$1, { | ||
...props | ||
}); | ||
const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props }); | ||
@@ -108,3 +115,3 @@ let delayTimer; | ||
clearTimeout(skipDelayTimer); | ||
if (newOpenState === false) { | ||
if (!newOpenState) { | ||
skipDelayTimer = setTimeout(() => { | ||
@@ -148,17 +155,18 @@ shouldSkipDelay = false; | ||
}, []); | ||
return /* @__PURE__ */ React.createElement(Provider$1, { | ||
delayDuration: 0, | ||
skipDelayDuration: 0 | ||
}, /* @__PURE__ */ React.createElement(Root, { | ||
disableHoverableContent, | ||
open: open != null ? open : openState, | ||
delayDuration: 0, | ||
onOpenChange: (newState) => { | ||
if (open == null) { | ||
setDelayedOpen(newState); | ||
return; | ||
} | ||
newState ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose(); | ||
return /* @__PURE__ */ jsx(Provider$1, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsx( | ||
Root, | ||
{ | ||
disableHoverableContent, | ||
open: open != null ? open : openState, | ||
delayDuration: 0, | ||
onOpenChange: (newState) => { | ||
if (open == null) { | ||
setDelayedOpen(newState); | ||
return; | ||
} | ||
newState ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose(); | ||
}, | ||
children | ||
} | ||
}, children)); | ||
) }); | ||
}; | ||
@@ -165,0 +173,0 @@ Tooltip.Trigger = Trigger; |
{ | ||
"name": "@mirohq/design-system-tooltip", | ||
"version": "3.2.14", | ||
"version": "3.2.15-use-press.2", | ||
"description": "", | ||
@@ -31,5 +31,5 @@ "author": "Miro", | ||
"@radix-ui/react-tooltip": "^1.0.3", | ||
"@mirohq/design-system-stitches": "^2.3.3", | ||
"@mirohq/design-system-styles": "^1.0.25", | ||
"@mirohq/design-system-utils": "^0.14.0", | ||
"@mirohq/design-system-stitches": "^2.3.4-use-press.0", | ||
"@mirohq/design-system-styles": "^1.1.0-use-press.0", | ||
"@mirohq/design-system-utils": "^0.14.0-use-press.2", | ||
"@mirohq/design-tokens": "^2.7.1" | ||
@@ -36,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
89633
1425
2