@mirohq/design-system-tooltip
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -10,2 +10,3 @@ 'use strict'; | ||
var designSystemBaseTooltip = require('@mirohq/design-system-base-tooltip'); | ||
var designSystemExperiments = require('@mirohq/design-system-experiments'); | ||
var designSystemStitches = require('@mirohq/design-system-stitches'); | ||
@@ -24,3 +25,13 @@ var designSystemUtils = require('@mirohq/design-system-utils'); | ||
transform: "translateY(-1px)", | ||
width: "15px" | ||
width: "15px", | ||
forcedColorAdjust: "auto", | ||
variants: { | ||
v1: { | ||
true: { | ||
fill: "$gray-800", | ||
width: "8px", | ||
height: "6px" | ||
} | ||
} | ||
} | ||
}); | ||
@@ -36,3 +47,15 @@ const StyledContent = designSystemStitches.styled(reactTooltip.Content, { | ||
padding: "$150", | ||
zIndex: "$tooltip" | ||
zIndex: "$tooltip", | ||
outline: "1px solid transparent", | ||
variants: { | ||
v1: { | ||
true: { | ||
background: "$gray-800", | ||
color: "$gray-50", | ||
padding: "calc($50 + $25) $100", | ||
lineHeight: "$400", | ||
borderRadius: "$100" | ||
} | ||
} | ||
} | ||
}); | ||
@@ -53,3 +76,3 @@ | ||
}, forwardRef) => { | ||
const { triggerRef } = React.useContext(TooltipTriggerContext); | ||
const { triggerRef, v1 } = React.useContext(TooltipTriggerContext); | ||
const removeDuplicateAriaDescription = (element) => { | ||
@@ -96,2 +119,3 @@ var _a, _b; | ||
...restProps, | ||
v1, | ||
ref: forwardRef, | ||
@@ -108,3 +132,3 @@ align, | ||
children, | ||
/* @__PURE__ */ jsxRuntime.jsx(StyledArrowIcon, {}) | ||
/* @__PURE__ */ jsxRuntime.jsx(StyledArrowIcon, { v1 }) | ||
] | ||
@@ -144,6 +168,16 @@ } | ||
const StyledHotkey = designSystemStitches.styled(designSystemPrimitive.Primitive.span, { | ||
marginLeft: "$100" | ||
marginLeft: "$100", | ||
variants: { | ||
v1: { | ||
true: { | ||
marginRight: "-$50" | ||
} | ||
} | ||
} | ||
}); | ||
const Hotkey = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledHotkey, { ...restProps, ref: forwardRef, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseHotkey.Hotkey, { variant: "inverted", children }) })); | ||
const Hotkey = React__default["default"].forwardRef(({ children, ...restProps }, forwardRef) => { | ||
const { v1 } = React.useContext(TooltipTriggerContext); | ||
return /* @__PURE__ */ jsxRuntime.jsx(StyledHotkey, { ...restProps, ref: forwardRef, v1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseHotkey.Hotkey, { variant: "inverted", v1, children }) }); | ||
}); | ||
@@ -156,3 +190,4 @@ let delayTimer; | ||
const TooltipTriggerContext = React.createContext({ | ||
triggerRef: { current: null } | ||
triggerRef: { current: null }, | ||
v1: false | ||
}); | ||
@@ -171,2 +206,3 @@ const Tooltip = ({ | ||
var _a; | ||
const [v1] = designSystemExperiments.useNewDesignLanguage(); | ||
const context = useTooltipContext(); | ||
@@ -252,3 +288,4 @@ const isMounted = React.useRef(false); | ||
id: triggerId, | ||
triggerRef | ||
triggerRef, | ||
v1 | ||
}, | ||
@@ -255,0 +292,0 @@ children: /* @__PURE__ */ jsxRuntime.jsx( |
@@ -6,2 +6,3 @@ import { jsxs, jsx } from 'react/jsx-runtime'; | ||
import { useBaseTooltipContext } from '@mirohq/design-system-base-tooltip'; | ||
import { useNewDesignLanguage } from '@mirohq/design-system-experiments'; | ||
import { styled } from '@mirohq/design-system-stitches'; | ||
@@ -16,3 +17,13 @@ import { mergeRefs } from '@mirohq/design-system-utils'; | ||
transform: "translateY(-1px)", | ||
width: "15px" | ||
width: "15px", | ||
forcedColorAdjust: "auto", | ||
variants: { | ||
v1: { | ||
true: { | ||
fill: "$gray-800", | ||
width: "8px", | ||
height: "6px" | ||
} | ||
} | ||
} | ||
}); | ||
@@ -28,3 +39,15 @@ const StyledContent = styled(Content$1, { | ||
padding: "$150", | ||
zIndex: "$tooltip" | ||
zIndex: "$tooltip", | ||
outline: "1px solid transparent", | ||
variants: { | ||
v1: { | ||
true: { | ||
background: "$gray-800", | ||
color: "$gray-50", | ||
padding: "calc($50 + $25) $100", | ||
lineHeight: "$400", | ||
borderRadius: "$100" | ||
} | ||
} | ||
} | ||
}); | ||
@@ -45,3 +68,3 @@ | ||
}, forwardRef) => { | ||
const { triggerRef } = useContext(TooltipTriggerContext); | ||
const { triggerRef, v1 } = useContext(TooltipTriggerContext); | ||
const removeDuplicateAriaDescription = (element) => { | ||
@@ -88,2 +111,3 @@ var _a, _b; | ||
...restProps, | ||
v1, | ||
ref: forwardRef, | ||
@@ -100,3 +124,3 @@ align, | ||
children, | ||
/* @__PURE__ */ jsx(StyledArrowIcon, {}) | ||
/* @__PURE__ */ jsx(StyledArrowIcon, { v1 }) | ||
] | ||
@@ -136,6 +160,16 @@ } | ||
const StyledHotkey = styled(Primitive.span, { | ||
marginLeft: "$100" | ||
marginLeft: "$100", | ||
variants: { | ||
v1: { | ||
true: { | ||
marginRight: "-$50" | ||
} | ||
} | ||
} | ||
}); | ||
const Hotkey = React.forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsx(StyledHotkey, { ...restProps, ref: forwardRef, children: /* @__PURE__ */ jsx(Hotkey$1, { variant: "inverted", children }) })); | ||
const Hotkey = React.forwardRef(({ children, ...restProps }, forwardRef) => { | ||
const { v1 } = useContext(TooltipTriggerContext); | ||
return /* @__PURE__ */ jsx(StyledHotkey, { ...restProps, ref: forwardRef, v1, children: /* @__PURE__ */ jsx(Hotkey$1, { variant: "inverted", v1, children }) }); | ||
}); | ||
@@ -148,3 +182,4 @@ let delayTimer; | ||
const TooltipTriggerContext = createContext({ | ||
triggerRef: { current: null } | ||
triggerRef: { current: null }, | ||
v1: false | ||
}); | ||
@@ -163,2 +198,3 @@ const Tooltip = ({ | ||
var _a; | ||
const [v1] = useNewDesignLanguage(); | ||
const context = useTooltipContext(); | ||
@@ -244,3 +280,4 @@ const isMounted = useRef(false); | ||
id: triggerId, | ||
triggerRef | ||
triggerRef, | ||
v1 | ||
}, | ||
@@ -247,0 +284,0 @@ children: /* @__PURE__ */ jsx( |
@@ -10,3 +10,7 @@ import * as react from 'react'; | ||
declare const StyledContent: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>>, {}, {}>; | ||
declare const StyledContent: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>>>, "v1"> & _stitches_react_types_styled_component.TransformProps<{ | ||
v1?: boolean | "true" | undefined; | ||
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>>, { | ||
v1?: boolean | "true" | undefined; | ||
}, {}>; | ||
declare type StyledContentProps = StrictComponentProps<typeof StyledContent>; | ||
@@ -31,3 +35,3 @@ | ||
interface ContentProps extends StyledContentProps { | ||
interface ContentProps extends Omit<StyledContentProps, 'v1'> { | ||
/** | ||
@@ -147,3 +151,7 @@ * The preferred alignment against the trigger. May change when collisions | ||
declare const StyledHotkey: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLSpanElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>, {}, {}>; | ||
declare const StyledHotkey: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>>, "v1"> & _stitches_react_types_styled_component.TransformProps<{ | ||
v1?: boolean | "true" | undefined; | ||
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLSpanElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>, { | ||
v1?: boolean | "true" | undefined; | ||
}, {}>; | ||
declare type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>; | ||
@@ -150,0 +158,0 @@ |
{ | ||
"name": "@mirohq/design-system-tooltip", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "", | ||
@@ -31,7 +31,8 @@ "author": "Miro", | ||
"@radix-ui/react-tooltip": "^1.0.3", | ||
"@mirohq/design-system-base-hotkey": "^0.1.24", | ||
"@mirohq/design-system-base-hotkey": "^0.2.0", | ||
"@mirohq/design-system-base-tooltip": "^0.1.0", | ||
"@mirohq/design-system-experiments": "^0.2.0", | ||
"@mirohq/design-system-primitive": "^1.1.2", | ||
"@mirohq/design-system-stitches": "^2.6.23", | ||
"@mirohq/design-system-use-id": "^0.1.2", | ||
"@mirohq/design-system-stitches": "^2.6.23", | ||
"@mirohq/design-system-utils": "^0.15.4" | ||
@@ -38,0 +39,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80061
796
11
+ Added@mirohq/design-system-base-hotkey@0.2.7(transitive)
+ Added@mirohq/design-system-experiments@0.2.0(transitive)
+ Added@mirohq/design-system-use-event@0.2.1(transitive)
+ Added@mirohq/design-system-use-event-listener@0.3.2(transitive)
+ Added@mirohq/design-system-use-listeners@0.1.1(transitive)
+ Added@mirohq/design-system-use-local-storage@0.3.11(transitive)
- Removed@mirohq/design-system-base-hotkey@0.1.24(transitive)