@mirohq/design-system-tooltip 3.2.36 → 3.3.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/main.js +9 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +9 -0
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +501 -0
- package/package.json +5 -4
package/dist/main.js
CHANGED
|
@@ -7,6 +7,8 @@ var React = require('react');
|
|
|
7
7
|
var reactTooltip = require('@radix-ui/react-tooltip');
|
|
8
8
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
9
9
|
var designSystemStyles = require('@mirohq/design-system-styles');
|
|
10
|
+
var designSystemBaseHotkey = require('@mirohq/design-system-base-hotkey');
|
|
11
|
+
var designSystemPrimitive = require('@mirohq/design-system-primitive');
|
|
10
12
|
|
|
11
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
14
|
|
|
@@ -96,6 +98,12 @@ const useTooltipContext = () => React.useContext(ProviderContext);
|
|
|
96
98
|
|
|
97
99
|
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactTooltip.Portal, { ...props });
|
|
98
100
|
|
|
101
|
+
const StyledHotkey = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
102
|
+
marginLeft: "$100"
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
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 }) }));
|
|
106
|
+
|
|
99
107
|
let delayTimer;
|
|
100
108
|
let skipDelayTimer;
|
|
101
109
|
let shouldSkipDelay = false;
|
|
@@ -186,6 +194,7 @@ Tooltip.Trigger = Trigger;
|
|
|
186
194
|
Tooltip.Content = Content;
|
|
187
195
|
Tooltip.Provider = Provider;
|
|
188
196
|
Tooltip.Portal = Portal;
|
|
197
|
+
Tooltip.Hotkey = Hotkey;
|
|
189
198
|
|
|
190
199
|
var types = /*#__PURE__*/Object.freeze({
|
|
191
200
|
__proto__: null
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n\nTrigger.displayName = 'Tooltip.Trigger'\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nProvider.displayName = 'Tooltip.Provider'\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect, useRef } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n\n /**\n * The content\n */\n children: React.ReactNode\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n isMounted.current = true\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["styled","RadixArrow","RadixContent","animations","React","jsxs","Trigger","jsx","createContext","useContext","RadixPortal","useRef","useState","useCallback","useEffect","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;;;;;;;AAQa,MAAA,eAAA,GAAkBA,4BAAOC,kBAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,kBAAA;AAAA,EACX,KAAO,EAAA,MAAA;AACT,CAAC,CAAA,CAAA;AAEY,MAAA,aAAA,GAAgBD,4BAAOE,oBAAc,EAAA;AAAA,EAChD,eAAiB,EAAA,QAAA;AAAA,EACjB,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,KAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,gDAAkD,EAAA;AAAA,IAChD,iBAAmB,EAAA,OAAA;AAAA,IACnB,uBAAyB,EAAA,MAAA;AAAA,IACzB,UAAY,EAAA,SAAA;AAAA,IACZ,8BAAgC,EAAA;AAAA,MAC9B,eAAeC,6BAAW,CAAA,MAAA;AAAA,KAC5B;AAAA,IACA,wBAA0B,EAAA;AAAA,MACxB,eAAeA,6BAAW,CAAA,OAAA;AAAA,KAC5B;AAAA,GACF;AAAA,EACA,MAAQ,EAAA,UAAA;AACV,CAAC,CAAA;;AC2CM,MAAM,UAAUC,yBAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,KAAQ,GAAA,QAAA;AAAA,IACR,WAAc,GAAA,CAAA;AAAA,IACd,eAAkB,GAAA,IAAA;AAAA,IAClB,gBAAmB,GAAA,CAAA;AAAA,IACnB,QAAA;AAAA,IACA,IAAO,GAAA,KAAA;AAAA,IACP,UAAa,GAAA,CAAA;AAAA,IACb,MAAS,GAAA,SAAA;AAAA,IACT,GAAG,SAAA;AAAA,KAEL,UAEA,qBAAAC,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U,CAAA,CAAA;AACvB,QAAA,YAAA,CAAa,cAAc,CAAA,CAAA;AAC3B,QAAkB,eAAA,GAAA,KAAA,CAAA;AAAA,OACpB;AAAA,KACF;AAAA,IACA,CAAC,oBAAoB,CAAA;AAAA,GACvB,CAAA;AAEA,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,SAAA,CAAU,OAAU,GAAA,IAAA,CAAA;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,CAAU,OAAU,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAAA,GACF,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACGP,cAAA,CAAAQ,qBAAA,EAAA,EAAc,aAAe,EAAA,CAAA,EAAG,mBAAmB,CAClD,EAAA,QAAA,kBAAAR,cAAA;AAAA,IAACS,iBAAA;AAAA,IAAA;AAAA,MACC,uBAAA;AAAA,MACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,MACd,aAAe,EAAA,CAAA;AAAA,MACf,YAAc,EAAA,gBAAA;AAAA,MAEb,QAAA;AAAA,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/partials/hotkey.styled.tsx","../src/partials/hotkey.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n\nTrigger.displayName = 'Tooltip.Trigger'\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nProvider.displayName = 'Tooltip.Provider'\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\nimport { Hotkey } from './partials/hotkey'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n\n /**\n * The content\n */\n children: React.ReactNode\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n isMounted.current = true\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\nTooltip.Hotkey = Hotkey\n"],"names":["styled","RadixArrow","RadixContent","animations","React","jsxs","Trigger","jsx","createContext","useContext","RadixPortal","Primitive","BaseHotkey","useRef","useState","useCallback","useEffect","RadixProvider","RadixTooltip"],"mappings":";;;;;;;;;;;;;;;;AAQa,MAAA,eAAA,GAAkBA,4BAAOC,kBAAY,EAAA;AAAA,EAChD,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA,KAAA;AAAA,EACR,SAAW,EAAA,kBAAA;AAAA,EACX,KAAO,EAAA,MAAA;AACT,CAAC,CAAA,CAAA;AAEY,MAAA,aAAA,GAAgBD,4BAAOE,oBAAc,EAAA;AAAA,EAChD,eAAiB,EAAA,QAAA;AAAA,EACjB,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,KAAA;AAAA,EACZ,UAAY,EAAA,MAAA;AAAA,EACZ,UAAY,EAAA,SAAA;AAAA,EACZ,OAAS,EAAA,MAAA;AAAA,EACT,gDAAkD,EAAA;AAAA,IAChD,iBAAmB,EAAA,OAAA;AAAA,IACnB,uBAAyB,EAAA,MAAA;AAAA,IACzB,UAAY,EAAA,SAAA;AAAA,IACZ,8BAAgC,EAAA;AAAA,MAC9B,eAAeC,6BAAW,CAAA,MAAA;AAAA,KAC5B;AAAA,IACA,wBAA0B,EAAA;AAAA,MACxB,eAAeA,6BAAW,CAAA,OAAA;AAAA,KAC5B;AAAA,GACF;AAAA,EACA,MAAQ,EAAA,UAAA;AACV,CAAC,CAAA;;AC2CM,MAAM,UAAUC,yBAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,KAAQ,GAAA,QAAA;AAAA,IACR,WAAc,GAAA,CAAA;AAAA,IACd,eAAkB,GAAA,IAAA;AAAA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,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAaA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA,CAAA;AACjB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -3,6 +3,8 @@ import React, { createContext, useContext, useRef, useState, useCallback, useEff
|
|
|
3
3
|
import { Arrow, Content as Content$1, Trigger as Trigger$1, Portal as Portal$1, Provider as Provider$1, Root } from '@radix-ui/react-tooltip';
|
|
4
4
|
import { styled } from '@mirohq/design-system-stitches';
|
|
5
5
|
import { animations } from '@mirohq/design-system-styles';
|
|
6
|
+
import { Hotkey as Hotkey$1 } from '@mirohq/design-system-base-hotkey';
|
|
7
|
+
import { Primitive } from '@mirohq/design-system-primitive';
|
|
6
8
|
|
|
7
9
|
const StyledArrowIcon = styled(Arrow, {
|
|
8
10
|
fill: "$black",
|
|
@@ -88,6 +90,12 @@ const useTooltipContext = () => useContext(ProviderContext);
|
|
|
88
90
|
|
|
89
91
|
const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
|
|
90
92
|
|
|
93
|
+
const StyledHotkey = styled(Primitive.span, {
|
|
94
|
+
marginLeft: "$100"
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const Hotkey = React.forwardRef(({ children, ...restProps }, forwardRef) => /* @__PURE__ */ jsx(StyledHotkey, { ...restProps, ref: forwardRef, children: /* @__PURE__ */ jsx(Hotkey$1, { variant: "inverted", children }) }));
|
|
98
|
+
|
|
91
99
|
let delayTimer;
|
|
92
100
|
let skipDelayTimer;
|
|
93
101
|
let shouldSkipDelay = false;
|
|
@@ -178,6 +186,7 @@ Tooltip.Trigger = Trigger;
|
|
|
178
186
|
Tooltip.Content = Content;
|
|
179
187
|
Tooltip.Provider = Provider;
|
|
180
188
|
Tooltip.Portal = Portal;
|
|
189
|
+
Tooltip.Hotkey = Hotkey;
|
|
181
190
|
|
|
182
191
|
var types = /*#__PURE__*/Object.freeze({
|
|
183
192
|
__proto__: null
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n\nTrigger.displayName = 'Tooltip.Trigger'\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nProvider.displayName = 'Tooltip.Provider'\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import React, { useState, useCallback, useEffect, useRef } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n\n /**\n * The content\n */\n children: React.ReactNode\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n isMounted.current = true\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\n"],"names":["RadixArrow","RadixContent","Trigger","Rad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A,CAAA;AAAA,OACpB;AAAA,KACF;AAAA,IACA,CAAC,oBAAoB,CAAA;AAAA,GACvB,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,SAAA,CAAU,OAAU,GAAA,IAAA,CAAA;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,CAAU,OAAU,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAAA,GACF,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,uBACG,GAAA,CAAAC,UAAA,EAAA,EAAc,aAAe,EAAA,CAAA,EAAG,mBAAmB,CAClD,EAAA,QAAA,kBAAA,GAAA;AAAA,IAACC,IAAA;AAAA,IAAA;AAAA,MACC,uBAAA;AAAA,MACA,MAAM,IAAQ,IAAA,IAAA,GAAA,IAAA,GAAA,SAAA;AAAA,MACd,aAAe,EAAA,CAAA;AAAA,MACf,YAAc,EAAA,gBAAA;AAAA,MAEb,QAAA;AAAA,KAAA;AAAA,GAEL,EAAA,CAAA,CAAA;AAEJ,EAAA;AAYA,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,OAAU,GAAA,OAAA,CAAA;AAClB,OAAA,CAAQ,QAAW,GAAA,QAAA,CAAA;AACnB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/partials/content.styled.tsx","../src/partials/content.tsx","../src/partials/trigger.styled.tsx","../src/partials/trigger.tsx","../src/partials/provider.tsx","../src/partials/portal.tsx","../src/partials/hotkey.styled.tsx","../src/partials/hotkey.tsx","../src/tooltip.tsx"],"sourcesContent":["import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport {\n Content as RadixContent,\n Arrow as RadixArrow,\n} from '@radix-ui/react-tooltip'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { animations } from '@mirohq/design-system-styles'\n\nexport const StyledArrowIcon = styled(RadixArrow, {\n fill: '$black',\n height: '5px',\n transform: 'translateY(-1px)',\n width: '15px',\n})\n\nexport const StyledContent = styled(RadixContent, {\n backgroundColor: '$black',\n borderRadius: '$50',\n color: '$white',\n fontSize: '14px',\n fontWeight: '400',\n lineHeight: '20px',\n fontFamily: 'inherit',\n padding: '$150',\n '@media (prefers-reduced-motion: no-preference)': {\n animationDuration: '220ms',\n animationTimingFunction: 'ease',\n willChange: 'opacity',\n '&[data-state=\"delayed-open\"]': {\n animationName: animations.fadeIn,\n },\n '&[data-state=\"closed\"]': {\n animationName: animations.fadeOut,\n },\n },\n zIndex: '$tooltip',\n})\n\nexport type StyledContentProps = StrictComponentProps<typeof StyledContent>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { StyledContent, StyledArrowIcon } from './content.styled'\nimport type { StyledContentProps } from './content.styled'\nimport type { PointerDownOutsideEvent, Side, Align } from '../types'\n\nexport interface ContentProps extends StyledContentProps {\n /**\n * The preferred alignment against the trigger. May change when collisions\n * occur.\n */\n align?: Align\n\n /**\n * An offset in pixels from the \"start\" or \"end\" alignment options.\n */\n alignOffset?: number\n\n /**\n * The distance in pixels from the trigger.\n */\n sideOffset?: number\n\n /** The preferred side of the trigger to render against when open.\n * Will be reversed when collisions occur and avoidCollisions is enabled.\n */\n side?: Side\n\n /**\n * When true, overrides the side and align preferences to prevent collisions\n * with window edges.\n */\n avoidCollisions?: boolean\n\n /**\n * The distance in pixels from window edges where collision detection should\n * occur.\n */\n collisionPadding?: number\n\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. It inherits from Tooltip.Portal.\n */\n forceMount?: true\n\n /**\n * The element used as the collision boundary. By default this is the\n * viewport, though you can provide additional element(s) to be included in\n * this check.\n */\n collisionBoundary?: Element | null\n\n /**\n * The sticky behavior on the align axis. \"partial\" will keep the content in\n * the boundary as long as the trigger is at least partially in the boundary\n * whilst \"always\" will keep the content in the boundary regardless.\n */\n sticky?: 'partial' | 'always'\n\n /**\n * Whether to hide the content when the trigger becomes fully occluded.\n */\n hideWhenDetached?: boolean\n\n /**\n * Event handler called when the escape key is down. It can be prevented by\n * calling event.preventDefault.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Event handler called when a pointer event occurs outside the bounds of the\n * component. It can be prevented by calling event.preventDefault.\n */\n onPointerDownOutside?: (event: PointerDownOutsideEvent) => void\n}\n\nexport const Content = React.forwardRef<\n ElementRef<typeof StyledContent>,\n ContentProps\n>(\n (\n {\n align = 'center',\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 0,\n children,\n side = 'top',\n sideOffset = 5,\n sticky = 'partial',\n ...restProps\n },\n forwardRef\n ) => (\n <StyledContent\n {...restProps}\n ref={forwardRef}\n align={align}\n alignOffset={alignOffset}\n avoidCollisions={avoidCollisions}\n collisionPadding={collisionPadding}\n side={side}\n sideOffset={sideOffset}\n sticky={sticky}\n >\n {children}\n <StyledArrowIcon />\n </StyledContent>\n )\n)\n\nContent.displayName = 'Tooltip.Content'\n","import { styled } from '@mirohq/design-system-stitches'\nimport { Trigger } from '@radix-ui/react-tooltip'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\n\nexport const StyledTrigger = styled(Trigger)\n\nexport type StyledTriggerProps = StrictComponentProps<typeof StyledTrigger>\n","import React from 'react'\nimport type { ElementRef, DOMAttributes } from 'react'\n\nimport { StyledTrigger } from './trigger.styled'\nimport type { StyledTriggerProps } from './trigger.styled'\n\nexport interface TriggerProps extends StyledTriggerProps {\n /**\n * temporary the same as onClick, later will be added touch events support\n */\n onPress?: DOMAttributes<HTMLElement>['onClick']\n}\n\nexport const Trigger = React.forwardRef<\n ElementRef<typeof StyledTrigger>,\n TriggerProps\n>(({ onPress, onClick, ...restProps }, forwardRef) => (\n <StyledTrigger\n {...restProps}\n onClick={onPress ?? onClick}\n data-tooltip-trigger=''\n ref={forwardRef}\n />\n))\n\nTrigger.displayName = 'Tooltip.Trigger'\n","import React, { createContext, useContext } from 'react'\n\nexport interface ProviderProps {\n /**\n * The duration from when the mouse enters a tooltip trigger until\n * the tooltip opens.\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n */\n skipDelayDuration?: number\n\n /**\n * The content\n */\n children?: React.ReactNode\n}\n\nexport const ProviderContext = createContext<ProviderProps>({} as any)\n\nexport const Provider: React.FC<ProviderProps> = ({\n children,\n ...restProps\n}) => (\n <ProviderContext.Provider value={restProps}>\n {children}\n </ProviderContext.Provider>\n)\n\nProvider.displayName = 'Tooltip.Provider'\n\nexport const useTooltipContext = (): ProviderProps =>\n useContext(ProviderContext)\n","import React from 'react'\nimport type { TooltipPortalProps } from '@radix-ui/react-tooltip'\nimport { Portal as RadixPortal } from '@radix-ui/react-tooltip'\n\nexport interface PortalProps extends TooltipPortalProps {\n /**\n * Used to force mounting when more control is needed. Useful when controlling\n * animation with React animation libraries. If used on this part, it will be\n * inherited by Tooltip.Content.\n */\n forceMount?: true\n\n /**\n * Specify a container element to portal the content into.\n */\n container?: HTMLElement | null\n}\n\nexport const Portal: React.FC<PortalProps> = props => <RadixPortal {...props} />\n","import type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\n\nexport const StyledHotkey = styled(Primitive.span, {\n marginLeft: '$100',\n})\n\nexport type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { Hotkey as BaseHotkey } from '@mirohq/design-system-base-hotkey'\n\nimport type { StyledHotkeyProps } from './hotkey.styled'\nimport { StyledHotkey } from './hotkey.styled'\n\nexport interface HotkeyProps extends StyledHotkeyProps {\n /**\n * The content.\n */\n children: string\n}\n\nexport const Hotkey = React.forwardRef<\n ElementRef<typeof StyledHotkey>,\n HotkeyProps\n>(({ children, ...restProps }, forwardRef) => (\n <StyledHotkey {...restProps} ref={forwardRef}>\n <BaseHotkey variant='inverted'>{children}</BaseHotkey>\n </StyledHotkey>\n))\n","import React, { useState, useCallback, useEffect, useRef } from 'react'\nimport {\n Provider as RadixProvider,\n Root as RadixTooltip,\n} from '@radix-ui/react-tooltip'\n\nimport { Content } from './partials/content'\nimport { Trigger } from './partials/trigger'\nimport { Provider, useTooltipContext } from './partials/provider'\nimport { Portal } from './partials/portal'\nimport { Hotkey } from './partials/hotkey'\n\nexport interface TooltipProps {\n /**\n * The open state of the tooltip when it is initially rendered. Use when you\n * do not need to control its open state.\n */\n defaultOpen?: boolean\n\n /**\n * The current state of the tooltip.\n */\n open?: boolean\n\n /**\n * Event handler called when the tooltip opens.\n */\n onOpen?: () => void\n\n /**\n * Event handler called when the tooltip closes.\n */\n onClose?: () => void\n\n /**\n * Overrides the duration given to the `Provider` to customize the open delay\n * for a specific tooltip.\n * @default 200\n */\n delayDuration?: number\n\n /**\n * How much time a user has to enter another trigger without incurring\n * a delay again.\n * @default 500\n */\n skipDelayDuration?: number\n\n /**\n * Clears the delayDuration and skipDelayDuration timeouts when the component\n * is unmounted. This flag is `true` by default when using NODE_ENV=test.\n * @default false\n */\n clearDelaysOnUnmount?: boolean\n\n /**\n * Closes the tooltip as soon as the pointer leaves the trigger making it\n * impossible to hover the content.\n */\n disableHoverableContent?: boolean\n\n /**\n * The content\n */\n children: React.ReactNode\n}\n\nlet delayTimer: ReturnType<typeof setTimeout> | undefined\nlet skipDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet shouldSkipDelay = false\n\nexport const DEFAULT_SKIP_DELAY_DURATION = 500\nexport const DEFAULT_DELAY_DURATION = 200\n\nexport const Tooltip: React.FC<TooltipProps> & Partials = ({\n defaultOpen = false,\n open,\n onOpen,\n onClose,\n skipDelayDuration,\n delayDuration,\n disableHoverableContent,\n clearDelaysOnUnmount = process.env.NODE_ENV === 'test',\n children,\n}) => {\n const context = useTooltipContext()\n const isMounted = useRef(false)\n\n const [openState, setOpenState] = useState(defaultOpen)\n const setDelayedOpen = useCallback(\n (newOpenState: boolean) => {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n\n if (!newOpenState) {\n skipDelayTimer = setTimeout(() => {\n shouldSkipDelay = false\n }, skipDelayDuration ?? context.skipDelayDuration ?? DEFAULT_SKIP_DELAY_DURATION)\n\n setOpenState(false)\n onClose?.()\n return\n }\n\n if (\n shouldSkipDelay ||\n document.querySelector('[data-tooltip-trigger]:focus') != null\n ) {\n setOpenState(newOpenState)\n return\n }\n\n delayTimer = setTimeout(() => {\n // ignore it if the the user quickly hover the trigger and leave before the timeout\n // (unfortunately JSDOM seems not to support :hover selector)\n if (\n document.querySelector('[data-tooltip-trigger]:hover') == null &&\n process.env.NODE_ENV !== 'test'\n ) {\n return\n }\n\n shouldSkipDelay = true\n\n if (isMounted.current) {\n setOpenState(true)\n onOpen?.()\n }\n }, delayDuration ?? context.delayDuration ?? DEFAULT_DELAY_DURATION)\n },\n [delayDuration, skipDelayDuration, context, onClose, onOpen]\n )\n\n const handleOpenChange = useCallback(\n (newState: boolean) => {\n if (open == null) {\n setDelayedOpen(newState)\n return\n }\n\n newState ? onOpen?.() : onClose?.()\n },\n [open, onOpen, onClose, setDelayedOpen]\n )\n\n useEffect(\n () => () => {\n if (clearDelaysOnUnmount) {\n clearTimeout(delayTimer)\n clearTimeout(skipDelayTimer)\n shouldSkipDelay = false\n }\n },\n [clearDelaysOnUnmount]\n )\n\n useEffect(() => {\n isMounted.current = true\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return (\n <RadixProvider delayDuration={0} skipDelayDuration={0}>\n <RadixTooltip\n disableHoverableContent={disableHoverableContent}\n open={open ?? openState}\n delayDuration={0} // we control it manually\n onOpenChange={handleOpenChange}\n >\n {children}\n </RadixTooltip>\n </RadixProvider>\n )\n}\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Trigger: typeof Trigger\n Content: typeof Content\n Provider: typeof Provider\n Portal: typeof Portal\n Hotkey: typeof Hotkey\n}\n\nTooltip.Trigger = Trigger\nTooltip.Content = Content\nTooltip.Provider = Provider\nTooltip.Portal = Portal\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CAAA;AACjB,OAAA,CAAQ,MAAS,GAAA,MAAA;;;;;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as _stitches_react_types_styled_component from '@stitches/react/types/s
|
|
|
6
6
|
import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
|
|
7
7
|
import * as _radix_ui_react_tooltip from '@radix-ui/react-tooltip';
|
|
8
8
|
import { TooltipPortalProps } from '@radix-ui/react-tooltip';
|
|
9
|
+
import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
|
|
9
10
|
|
|
10
11
|
declare const StyledContent: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_radix_ui_react_tooltip.TooltipContentProps & react.RefAttributes<HTMLDivElement>>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
11
12
|
'border-widths': {
|
|
@@ -1108,6 +1109,505 @@ interface PortalProps extends TooltipPortalProps {
|
|
|
1108
1109
|
}
|
|
1109
1110
|
declare const Portal: react__default.FC<PortalProps>;
|
|
1110
1111
|
|
|
1112
|
+
declare const StyledHotkey: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"span">>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
1113
|
+
'border-widths': {
|
|
1114
|
+
readonly none: 0;
|
|
1115
|
+
readonly sm: "1px";
|
|
1116
|
+
readonly md: "2px";
|
|
1117
|
+
readonly lg: "4px";
|
|
1118
|
+
};
|
|
1119
|
+
colors: {
|
|
1120
|
+
readonly black: any;
|
|
1121
|
+
readonly 'blue-100': any;
|
|
1122
|
+
readonly 'blue-200': any;
|
|
1123
|
+
readonly 'blue-300': any;
|
|
1124
|
+
readonly 'blue-400': any;
|
|
1125
|
+
readonly 'blue-500': any;
|
|
1126
|
+
readonly 'blue-600': any;
|
|
1127
|
+
readonly 'blue-700': any;
|
|
1128
|
+
readonly 'blue-800': any;
|
|
1129
|
+
readonly 'blue-900': any;
|
|
1130
|
+
readonly 'blue-1000': any;
|
|
1131
|
+
readonly 'gray-100': any;
|
|
1132
|
+
readonly 'gray-200': any;
|
|
1133
|
+
readonly 'gray-300': any;
|
|
1134
|
+
readonly 'gray-400': any;
|
|
1135
|
+
readonly 'gray-500': any;
|
|
1136
|
+
readonly 'gray-600': any;
|
|
1137
|
+
readonly 'gray-700': any;
|
|
1138
|
+
readonly 'gray-800': any;
|
|
1139
|
+
readonly 'gray-900': any;
|
|
1140
|
+
readonly 'green-100': any;
|
|
1141
|
+
readonly 'green-200': any;
|
|
1142
|
+
readonly 'green-300': any;
|
|
1143
|
+
readonly 'green-400': any;
|
|
1144
|
+
readonly 'green-500': any;
|
|
1145
|
+
readonly 'green-600': any;
|
|
1146
|
+
readonly 'green-700': any;
|
|
1147
|
+
readonly 'green-800': any;
|
|
1148
|
+
readonly 'green-900': any;
|
|
1149
|
+
readonly 'indigo-100': any;
|
|
1150
|
+
readonly 'indigo-200': any;
|
|
1151
|
+
readonly 'indigo-300': any;
|
|
1152
|
+
readonly 'indigo-400': any;
|
|
1153
|
+
readonly 'indigo-500': any;
|
|
1154
|
+
readonly 'indigo-600': any;
|
|
1155
|
+
readonly 'indigo-700': any;
|
|
1156
|
+
readonly 'indigo-800': any;
|
|
1157
|
+
readonly 'indigo-900': any;
|
|
1158
|
+
readonly 'red-100': any;
|
|
1159
|
+
readonly 'red-200': any;
|
|
1160
|
+
readonly 'red-300': any;
|
|
1161
|
+
readonly 'red-400': any;
|
|
1162
|
+
readonly 'red-500': any;
|
|
1163
|
+
readonly 'red-600': any;
|
|
1164
|
+
readonly 'red-700': any;
|
|
1165
|
+
readonly 'red-800': any;
|
|
1166
|
+
readonly 'red-900': any;
|
|
1167
|
+
readonly transparent: any;
|
|
1168
|
+
readonly white: any;
|
|
1169
|
+
readonly 'yellow-100': any;
|
|
1170
|
+
readonly 'yellow-200': any;
|
|
1171
|
+
readonly 'yellow-300': any;
|
|
1172
|
+
readonly 'yellow-400': any;
|
|
1173
|
+
readonly 'yellow-500': any;
|
|
1174
|
+
readonly 'yellow-600': any;
|
|
1175
|
+
readonly 'yellow-700': any;
|
|
1176
|
+
readonly 'yellow-800': any;
|
|
1177
|
+
readonly 'yellow-900': any;
|
|
1178
|
+
"background-alpha-active"?: any;
|
|
1179
|
+
"background-alpha-hover"?: any;
|
|
1180
|
+
"background-danger-prominent"?: any;
|
|
1181
|
+
"background-danger-prominent-active"?: any;
|
|
1182
|
+
"background-danger-prominent-hover"?: any;
|
|
1183
|
+
"background-danger-subtle"?: any;
|
|
1184
|
+
"background-danger-subtle-active"?: any;
|
|
1185
|
+
"background-danger-subtle-hover"?: any;
|
|
1186
|
+
"background-neutrals"?: any;
|
|
1187
|
+
"background-neutrals-active"?: any;
|
|
1188
|
+
"background-neutrals-container"?: any;
|
|
1189
|
+
"background-neutrals-controls-disabled"?: any;
|
|
1190
|
+
"background-neutrals-disabled"?: any;
|
|
1191
|
+
"background-neutrals-hover"?: any;
|
|
1192
|
+
"background-neutrals-inactive"?: any;
|
|
1193
|
+
"background-neutrals-inactive-hover"?: any;
|
|
1194
|
+
"background-neutrals-inverted"?: any;
|
|
1195
|
+
"background-neutrals-inverted-subtle"?: any;
|
|
1196
|
+
"background-neutrals-page"?: any;
|
|
1197
|
+
"background-neutrals-page-subtle"?: any;
|
|
1198
|
+
"background-neutrals-scrolls"?: any;
|
|
1199
|
+
"background-neutrals-scrolls-expanded"?: any;
|
|
1200
|
+
"background-neutrals-scrolls-hover"?: any;
|
|
1201
|
+
"background-neutrals-scrolls-pressed"?: any;
|
|
1202
|
+
"background-neutrals-scrolls-pressed-hover"?: any;
|
|
1203
|
+
"background-neutrals-subtle"?: any;
|
|
1204
|
+
"background-neutrals-subtle-active"?: any;
|
|
1205
|
+
"background-neutrals-subtle-hover"?: any;
|
|
1206
|
+
"background-primary-prominent"?: any;
|
|
1207
|
+
"background-primary-prominent-active"?: any;
|
|
1208
|
+
"background-primary-prominent-expanded"?: any;
|
|
1209
|
+
"background-primary-prominent-hover"?: any;
|
|
1210
|
+
"background-primary-prominent-pressed"?: any;
|
|
1211
|
+
"background-primary-prominent-pressed-hover"?: any;
|
|
1212
|
+
"background-primary-prominent-selected"?: any;
|
|
1213
|
+
"background-primary-subtle"?: any;
|
|
1214
|
+
"background-primary-subtle-active"?: any;
|
|
1215
|
+
"background-primary-subtle-expanded"?: any;
|
|
1216
|
+
"background-primary-subtle-hover"?: any;
|
|
1217
|
+
"background-primary-subtle-pressed"?: any;
|
|
1218
|
+
"background-primary-subtle-pressed-hover"?: any;
|
|
1219
|
+
"background-primary-subtle-selected"?: any;
|
|
1220
|
+
"background-success"?: any;
|
|
1221
|
+
"background-success-prominent"?: any;
|
|
1222
|
+
"background-success-prominent-active"?: any;
|
|
1223
|
+
"background-success-prominent-hover"?: any;
|
|
1224
|
+
"background-warning-prominent"?: any;
|
|
1225
|
+
"background-warning-subtle"?: any;
|
|
1226
|
+
"border-danger"?: any;
|
|
1227
|
+
"border-danger-active"?: any;
|
|
1228
|
+
"border-danger-hover"?: any;
|
|
1229
|
+
"border-focus-inner"?: any;
|
|
1230
|
+
"border-focus-middle"?: any;
|
|
1231
|
+
"border-focus-outer"?: any;
|
|
1232
|
+
"border-neutrals"?: any;
|
|
1233
|
+
"border-neutrals-active"?: any;
|
|
1234
|
+
"border-neutrals-controls"?: any;
|
|
1235
|
+
"border-neutrals-controls-disabled"?: any;
|
|
1236
|
+
"border-neutrals-disabled"?: any;
|
|
1237
|
+
"border-neutrals-hover"?: any;
|
|
1238
|
+
"border-neutrals-inverted"?: any;
|
|
1239
|
+
"border-neutrals-subtle"?: any;
|
|
1240
|
+
"border-neutrals-text"?: any;
|
|
1241
|
+
"border-neutrals-text-active"?: any;
|
|
1242
|
+
"border-neutrals-text-hover"?: any;
|
|
1243
|
+
"border-neutrals-text-subtle"?: any;
|
|
1244
|
+
"border-neutrals-text-subtle-active"?: any;
|
|
1245
|
+
"border-neutrals-text-subtle-hover"?: any;
|
|
1246
|
+
"border-neutrals-transparent"?: any;
|
|
1247
|
+
"border-primary"?: any;
|
|
1248
|
+
"border-primary-active"?: any;
|
|
1249
|
+
"border-primary-hover"?: any;
|
|
1250
|
+
"border-primary-inverted"?: any;
|
|
1251
|
+
"border-success"?: any;
|
|
1252
|
+
"border-success-active"?: any;
|
|
1253
|
+
"border-success-hover"?: any;
|
|
1254
|
+
"border-warning"?: any;
|
|
1255
|
+
"icon-danger"?: any;
|
|
1256
|
+
"icon-danger-active"?: any;
|
|
1257
|
+
"icon-danger-hover"?: any;
|
|
1258
|
+
"icon-danger-inverted"?: any;
|
|
1259
|
+
"icon-neutrals"?: any;
|
|
1260
|
+
"icon-neutrals-disabled"?: any;
|
|
1261
|
+
"icon-neutrals-inactive"?: any;
|
|
1262
|
+
"icon-neutrals-inactive-hover"?: any;
|
|
1263
|
+
"icon-neutrals-inverted"?: any;
|
|
1264
|
+
"icon-neutrals-search"?: any;
|
|
1265
|
+
"icon-neutrals-subtle"?: any;
|
|
1266
|
+
"icon-neutrals-text"?: any;
|
|
1267
|
+
"icon-primary"?: any;
|
|
1268
|
+
"icon-primary-active"?: any;
|
|
1269
|
+
"icon-primary-hover"?: any;
|
|
1270
|
+
"icon-primary-inverted"?: any;
|
|
1271
|
+
"icon-primary-selected"?: any;
|
|
1272
|
+
"icon-success"?: any;
|
|
1273
|
+
"icon-success-active"?: any;
|
|
1274
|
+
"icon-success-hover"?: any;
|
|
1275
|
+
"icon-success-inverted"?: any;
|
|
1276
|
+
"icon-warning"?: any;
|
|
1277
|
+
"icon-warning-prominent"?: any;
|
|
1278
|
+
"icon-warning-subtle"?: any;
|
|
1279
|
+
"text-danger"?: any;
|
|
1280
|
+
"text-danger-active"?: any;
|
|
1281
|
+
"text-danger-hover"?: any;
|
|
1282
|
+
"text-danger-inverted"?: any;
|
|
1283
|
+
"text-neutrals"?: any;
|
|
1284
|
+
"text-neutrals-active"?: any;
|
|
1285
|
+
"text-neutrals-disabled"?: any;
|
|
1286
|
+
"text-neutrals-hover"?: any;
|
|
1287
|
+
"text-neutrals-inverted"?: any;
|
|
1288
|
+
"text-neutrals-placeholder"?: any;
|
|
1289
|
+
"text-neutrals-placeholder-only"?: any;
|
|
1290
|
+
"text-neutrals-subtle"?: any;
|
|
1291
|
+
"text-neutrals-subtle-active"?: any;
|
|
1292
|
+
"text-neutrals-subtle-hover"?: any;
|
|
1293
|
+
"text-primary"?: any;
|
|
1294
|
+
"text-primary-active"?: any;
|
|
1295
|
+
"text-primary-hover"?: any;
|
|
1296
|
+
"text-primary-inverted"?: any;
|
|
1297
|
+
"text-primary-inverted-subtle"?: any;
|
|
1298
|
+
"text-primary-selected"?: any;
|
|
1299
|
+
"text-success"?: any;
|
|
1300
|
+
"text-success-active"?: any;
|
|
1301
|
+
"text-success-hover"?: any;
|
|
1302
|
+
"text-success-inverted"?: any;
|
|
1303
|
+
"text-warning"?: any;
|
|
1304
|
+
"text-warning-subtle"?: any;
|
|
1305
|
+
};
|
|
1306
|
+
'font-sizes': {
|
|
1307
|
+
readonly 150: "0.75rem";
|
|
1308
|
+
readonly 175: "0.875rem";
|
|
1309
|
+
readonly 200: "1rem";
|
|
1310
|
+
readonly 225: "1.125rem";
|
|
1311
|
+
readonly 250: "1.25rem";
|
|
1312
|
+
readonly 300: "1.5rem";
|
|
1313
|
+
readonly 400: "2rem";
|
|
1314
|
+
readonly 500: "2.5rem";
|
|
1315
|
+
readonly 600: "3rem";
|
|
1316
|
+
readonly 800: "4rem";
|
|
1317
|
+
readonly 900: "4.5rem";
|
|
1318
|
+
};
|
|
1319
|
+
fonts: {
|
|
1320
|
+
readonly heading: "Roobert, sans-serif";
|
|
1321
|
+
readonly body: "Open Sans, sans-serif";
|
|
1322
|
+
};
|
|
1323
|
+
radii: {
|
|
1324
|
+
readonly none: 0;
|
|
1325
|
+
readonly half: "999em";
|
|
1326
|
+
readonly 25: "2px";
|
|
1327
|
+
readonly 50: "4px";
|
|
1328
|
+
readonly 75: "6px";
|
|
1329
|
+
readonly 100: "8px";
|
|
1330
|
+
readonly 200: "16px";
|
|
1331
|
+
};
|
|
1332
|
+
shadows: {
|
|
1333
|
+
readonly 'focus-small': "0 0 0 2px $colors$border-focus-outer, inset 0 0 0 2px $colors$border-focus-middle, inset 0 0 0 3px $colors$border-focus-inner";
|
|
1334
|
+
readonly 'focus-small-outline': "0 0 0 2px $colors$border-focus-outer, inset 0 0 0 1px $colors$border-focus-middle, inset 0 0 0 2px $colors$border-focus-inner";
|
|
1335
|
+
readonly 'focus-large': "0 0 0 4px $colors$border-focus-inner, inset 0 0 0 2px $colors$border-focus-middle, inset 0 0 0 3px $colors$border-focus-outer";
|
|
1336
|
+
readonly 'focus-controls': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$border-focus-middle, 0 0 0 5px $colors$border-focus-outer";
|
|
1337
|
+
readonly 'focus-controls-error': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$border-danger, 0 0 0 5px $colors$background-danger-subtle-hover";
|
|
1338
|
+
readonly 'focus-controls-success': "0 0 0 1px $colors$border-focus-inner, 0 0 0 3px $colors$background-success-prominent, 0 0 0 5px $colors$background-success";
|
|
1339
|
+
};
|
|
1340
|
+
sizes: {
|
|
1341
|
+
readonly number: string;
|
|
1342
|
+
readonly 'icon-200': "16px";
|
|
1343
|
+
readonly 'icon-300': "24px";
|
|
1344
|
+
readonly 'icon-400': "32px";
|
|
1345
|
+
};
|
|
1346
|
+
space: {
|
|
1347
|
+
readonly 0: "0px";
|
|
1348
|
+
readonly 25: "2px";
|
|
1349
|
+
readonly 50: "4px";
|
|
1350
|
+
readonly 100: "8px";
|
|
1351
|
+
readonly 150: "12px";
|
|
1352
|
+
readonly 200: "16px";
|
|
1353
|
+
readonly 300: "24px";
|
|
1354
|
+
readonly 400: "32px";
|
|
1355
|
+
readonly 500: "40px";
|
|
1356
|
+
readonly 600: "48px";
|
|
1357
|
+
readonly 700: "56px";
|
|
1358
|
+
readonly 800: "64px";
|
|
1359
|
+
readonly 1200: "96px";
|
|
1360
|
+
readonly 1600: "128px";
|
|
1361
|
+
};
|
|
1362
|
+
'space-gap': {
|
|
1363
|
+
readonly 0: any;
|
|
1364
|
+
readonly 50: any;
|
|
1365
|
+
readonly 100: any;
|
|
1366
|
+
readonly 200: any;
|
|
1367
|
+
readonly 300: any;
|
|
1368
|
+
};
|
|
1369
|
+
'space-inset': {
|
|
1370
|
+
readonly 0: any;
|
|
1371
|
+
readonly 50: any;
|
|
1372
|
+
readonly 100: any;
|
|
1373
|
+
readonly 150: any;
|
|
1374
|
+
readonly 200: any;
|
|
1375
|
+
readonly 300: any;
|
|
1376
|
+
readonly 400: any;
|
|
1377
|
+
readonly 500: any;
|
|
1378
|
+
readonly 600: any;
|
|
1379
|
+
readonly 700: any;
|
|
1380
|
+
readonly 800: any;
|
|
1381
|
+
readonly 1200: any;
|
|
1382
|
+
readonly 1600: any;
|
|
1383
|
+
};
|
|
1384
|
+
'space-offset': {
|
|
1385
|
+
readonly 0: any;
|
|
1386
|
+
readonly 50: any;
|
|
1387
|
+
readonly 100: any;
|
|
1388
|
+
readonly 150: any;
|
|
1389
|
+
readonly 200: any;
|
|
1390
|
+
readonly 300: any;
|
|
1391
|
+
readonly 400: any;
|
|
1392
|
+
readonly 600: any;
|
|
1393
|
+
readonly 800: any;
|
|
1394
|
+
readonly 1200: any;
|
|
1395
|
+
readonly 1600: any;
|
|
1396
|
+
readonly 'stacking-0': any;
|
|
1397
|
+
readonly 'stacking-100': any;
|
|
1398
|
+
readonly 'stacking-200': any;
|
|
1399
|
+
readonly 'stacking-300': any;
|
|
1400
|
+
readonly 'stacking-400': any;
|
|
1401
|
+
readonly 'stacking-500': any;
|
|
1402
|
+
readonly 'stacking-800': any;
|
|
1403
|
+
};
|
|
1404
|
+
'stroke-width': {
|
|
1405
|
+
readonly thin: "1.5px";
|
|
1406
|
+
readonly normal: "2px";
|
|
1407
|
+
readonly bold: "4px";
|
|
1408
|
+
};
|
|
1409
|
+
'z-indices': {
|
|
1410
|
+
readonly dropdownMenu: 100;
|
|
1411
|
+
readonly select: 200;
|
|
1412
|
+
readonly popover: 300;
|
|
1413
|
+
readonly tooltip: 400;
|
|
1414
|
+
};
|
|
1415
|
+
}, {
|
|
1416
|
+
readonly background: "colors";
|
|
1417
|
+
readonly backgroundColor: "colors";
|
|
1418
|
+
readonly backgroundImage: "colors";
|
|
1419
|
+
readonly blockSize: "sizes";
|
|
1420
|
+
readonly border: "colors";
|
|
1421
|
+
readonly borderBlock: "colors";
|
|
1422
|
+
readonly borderBlockEnd: "colors";
|
|
1423
|
+
readonly borderBlockStart: "colors";
|
|
1424
|
+
readonly borderBottom: "colors";
|
|
1425
|
+
readonly borderBottomColor: "colors";
|
|
1426
|
+
readonly borderBottomLeftRadius: "radii";
|
|
1427
|
+
readonly borderBottomRightRadius: "radii";
|
|
1428
|
+
readonly borderBottomStyle: "border-styles";
|
|
1429
|
+
readonly borderBottomWidth: "border-widths";
|
|
1430
|
+
readonly borderColor: "colors";
|
|
1431
|
+
readonly borderImage: "colors";
|
|
1432
|
+
readonly borderInline: "colors";
|
|
1433
|
+
readonly borderInlineEnd: "colors";
|
|
1434
|
+
readonly borderInlineStart: "colors";
|
|
1435
|
+
readonly borderLeft: "colors";
|
|
1436
|
+
readonly borderLeftColor: "colors";
|
|
1437
|
+
readonly borderLeftStyle: "border-styles";
|
|
1438
|
+
readonly borderLeftWidth: "border-widths";
|
|
1439
|
+
readonly borderRadius: "radii";
|
|
1440
|
+
readonly borderRight: "colors";
|
|
1441
|
+
readonly borderRightColor: "colors";
|
|
1442
|
+
readonly borderRightStyle: "border-styles";
|
|
1443
|
+
readonly borderRightWidth: "border-widths";
|
|
1444
|
+
readonly borderSpacing: "space-offset";
|
|
1445
|
+
readonly borderStyle: "border-styles";
|
|
1446
|
+
readonly borderTop: "colors";
|
|
1447
|
+
readonly borderTopColor: "colors";
|
|
1448
|
+
readonly borderTopLeftRadius: "radii";
|
|
1449
|
+
readonly borderTopRightRadius: "radii";
|
|
1450
|
+
readonly borderTopStyle: "border-styles";
|
|
1451
|
+
readonly borderTopWidth: "border-widths";
|
|
1452
|
+
readonly borderWidth: "border-widths";
|
|
1453
|
+
readonly bottom: "space";
|
|
1454
|
+
readonly boxShadow: "shadows";
|
|
1455
|
+
readonly caretColor: "colors";
|
|
1456
|
+
readonly color: "colors";
|
|
1457
|
+
readonly columnGap: "space-gap";
|
|
1458
|
+
readonly columnRuleColor: "colors";
|
|
1459
|
+
readonly fill: "colors";
|
|
1460
|
+
readonly flexBasis: "sizes";
|
|
1461
|
+
readonly fontFamily: "fonts";
|
|
1462
|
+
readonly fontSize: "font-sizes";
|
|
1463
|
+
readonly fontWeight: "font-weights";
|
|
1464
|
+
readonly gap: "space-gap";
|
|
1465
|
+
readonly gridColumnGap: "space-gap";
|
|
1466
|
+
readonly gridGap: "space-gap";
|
|
1467
|
+
readonly gridRowGap: "space-gap";
|
|
1468
|
+
readonly gridTemplateColumns: "sizes";
|
|
1469
|
+
readonly gridTemplateRows: "sizes";
|
|
1470
|
+
readonly height: "sizes";
|
|
1471
|
+
readonly inlineSize: "sizes";
|
|
1472
|
+
readonly inset: "space-inset";
|
|
1473
|
+
readonly insetBlock: "space-inset";
|
|
1474
|
+
readonly insetBlockEnd: "space-inset";
|
|
1475
|
+
readonly insetBlockStart: "space-inset";
|
|
1476
|
+
readonly insetInline: "space-inset";
|
|
1477
|
+
readonly insetInlineEnd: "space-inset";
|
|
1478
|
+
readonly insetInlineStart: "space-inset";
|
|
1479
|
+
readonly left: "space";
|
|
1480
|
+
readonly letterSpacing: "letter-spacings";
|
|
1481
|
+
readonly lineHeight: "line-heights";
|
|
1482
|
+
readonly margin: "space-offset";
|
|
1483
|
+
readonly marginBlock: "space-offset";
|
|
1484
|
+
readonly marginBlockEnd: "space-offset";
|
|
1485
|
+
readonly marginBlockStart: "space-offset";
|
|
1486
|
+
readonly marginBottom: "space-offset";
|
|
1487
|
+
readonly marginInline: "space-offset";
|
|
1488
|
+
readonly marginInlineEnd: "space-offset";
|
|
1489
|
+
readonly marginInlineStart: "space-offset";
|
|
1490
|
+
readonly marginLeft: "space-offset";
|
|
1491
|
+
readonly marginRight: "space-offset";
|
|
1492
|
+
readonly marginTop: "space-offset";
|
|
1493
|
+
readonly maxBlockSize: "sizes";
|
|
1494
|
+
readonly maxHeight: "sizes";
|
|
1495
|
+
readonly maxInlineSize: "sizes";
|
|
1496
|
+
readonly maxWidth: "sizes";
|
|
1497
|
+
readonly minBlockSize: "sizes";
|
|
1498
|
+
readonly minHeight: "sizes";
|
|
1499
|
+
readonly minInlineSize: "sizes";
|
|
1500
|
+
readonly minWidth: "sizes";
|
|
1501
|
+
readonly outline: "colors";
|
|
1502
|
+
readonly outlineColor: "colors";
|
|
1503
|
+
readonly padding: "space-inset";
|
|
1504
|
+
readonly paddingBlock: "space-inset";
|
|
1505
|
+
readonly paddingBlockEnd: "space-inset";
|
|
1506
|
+
readonly paddingBlockStart: "space-inset";
|
|
1507
|
+
readonly paddingBottom: "space-inset";
|
|
1508
|
+
readonly paddingInline: "space-inset";
|
|
1509
|
+
readonly paddingInlineEnd: "space-inset";
|
|
1510
|
+
readonly paddingInlineStart: "space-inset";
|
|
1511
|
+
readonly paddingLeft: "space-inset";
|
|
1512
|
+
readonly paddingRight: "space-inset";
|
|
1513
|
+
readonly paddingTop: "space-inset";
|
|
1514
|
+
readonly right: "space";
|
|
1515
|
+
readonly rowGap: "space-gap";
|
|
1516
|
+
readonly scrollMargin: "space-offset";
|
|
1517
|
+
readonly scrollMarginBlock: "space-offset";
|
|
1518
|
+
readonly scrollMarginBlockEnd: "space-offset";
|
|
1519
|
+
readonly scrollMarginBlockStart: "space-offset";
|
|
1520
|
+
readonly scrollMarginBottom: "space-offset";
|
|
1521
|
+
readonly scrollMarginInline: "space-offset";
|
|
1522
|
+
readonly scrollMarginInlineEnd: "space-offset";
|
|
1523
|
+
readonly scrollMarginInlineStart: "space-offset";
|
|
1524
|
+
readonly scrollMarginLeft: "space-offset";
|
|
1525
|
+
readonly scrollMarginRight: "space-offset";
|
|
1526
|
+
readonly scrollMarginTop: "space-offset";
|
|
1527
|
+
readonly scrollPadding: "space-inset";
|
|
1528
|
+
readonly scrollPaddingBlock: "space-inset";
|
|
1529
|
+
readonly scrollPaddingBlockEnd: "space-inset";
|
|
1530
|
+
readonly scrollPaddingBlockStart: "space-inset";
|
|
1531
|
+
readonly scrollPaddingBottom: "space-inset";
|
|
1532
|
+
readonly scrollPaddingInline: "space-inset";
|
|
1533
|
+
readonly scrollPaddingInlineEnd: "space-inset";
|
|
1534
|
+
readonly scrollPaddingInlineStart: "space-inset";
|
|
1535
|
+
readonly scrollPaddingLeft: "space-inset";
|
|
1536
|
+
readonly scrollPaddingRight: "space-inset";
|
|
1537
|
+
readonly scrollPaddingTop: "space-inset";
|
|
1538
|
+
readonly stroke: "colors";
|
|
1539
|
+
readonly strokeWidth: "stroke-width";
|
|
1540
|
+
readonly textDecorationColor: "colors";
|
|
1541
|
+
readonly textShadow: "shadows";
|
|
1542
|
+
readonly top: "space";
|
|
1543
|
+
readonly transition: "transitions";
|
|
1544
|
+
readonly width: "sizes";
|
|
1545
|
+
readonly zIndex: "z-indices";
|
|
1546
|
+
}, {
|
|
1547
|
+
paddingX: (value: {
|
|
1548
|
+
readonly [$$PropertyValue]: "padding";
|
|
1549
|
+
}) => {
|
|
1550
|
+
paddingLeft: {
|
|
1551
|
+
readonly [$$PropertyValue]: "padding";
|
|
1552
|
+
};
|
|
1553
|
+
paddingRight: {
|
|
1554
|
+
readonly [$$PropertyValue]: "padding";
|
|
1555
|
+
};
|
|
1556
|
+
};
|
|
1557
|
+
paddingY: (value: {
|
|
1558
|
+
readonly [$$PropertyValue]: "padding";
|
|
1559
|
+
}) => {
|
|
1560
|
+
paddingTop: {
|
|
1561
|
+
readonly [$$PropertyValue]: "padding";
|
|
1562
|
+
};
|
|
1563
|
+
paddingBottom: {
|
|
1564
|
+
readonly [$$PropertyValue]: "padding";
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
marginX: (value: {
|
|
1568
|
+
readonly [$$PropertyValue]: "margin";
|
|
1569
|
+
}) => {
|
|
1570
|
+
marginLeft: {
|
|
1571
|
+
readonly [$$PropertyValue]: "margin";
|
|
1572
|
+
};
|
|
1573
|
+
marginRight: {
|
|
1574
|
+
readonly [$$PropertyValue]: "margin";
|
|
1575
|
+
};
|
|
1576
|
+
};
|
|
1577
|
+
marginY: (value: {
|
|
1578
|
+
readonly [$$PropertyValue]: "margin";
|
|
1579
|
+
}) => {
|
|
1580
|
+
marginTop: {
|
|
1581
|
+
readonly [$$PropertyValue]: "margin";
|
|
1582
|
+
};
|
|
1583
|
+
marginBottom: {
|
|
1584
|
+
readonly [$$PropertyValue]: "margin";
|
|
1585
|
+
};
|
|
1586
|
+
};
|
|
1587
|
+
square: (value: {
|
|
1588
|
+
readonly [$$PropertyValue]: "width";
|
|
1589
|
+
}) => {
|
|
1590
|
+
width: {
|
|
1591
|
+
readonly [$$PropertyValue]: "width";
|
|
1592
|
+
};
|
|
1593
|
+
height: {
|
|
1594
|
+
readonly [$$PropertyValue]: "width";
|
|
1595
|
+
};
|
|
1596
|
+
};
|
|
1597
|
+
_hover: (css: _stitches_react_types_css_util.CSSProperties) => {
|
|
1598
|
+
'&:hover, &[data-hovered]': _stitches_react_types_css_util.CSSProperties;
|
|
1599
|
+
};
|
|
1600
|
+
}>>>, 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">>, {}, {}>;
|
|
1601
|
+
declare type StyledHotkeyProps = StrictComponentProps<typeof StyledHotkey>;
|
|
1602
|
+
|
|
1603
|
+
interface HotkeyProps extends StyledHotkeyProps {
|
|
1604
|
+
/**
|
|
1605
|
+
* The content.
|
|
1606
|
+
*/
|
|
1607
|
+
children: string;
|
|
1608
|
+
}
|
|
1609
|
+
declare const Hotkey: react__default.ForwardRefExoticComponent<Omit<HotkeyProps, "ref"> & react__default.RefAttributes<HTMLSpanElement>>;
|
|
1610
|
+
|
|
1111
1611
|
interface TooltipProps {
|
|
1112
1612
|
/**
|
|
1113
1613
|
* The open state of the tooltip when it is initially rendered. Use when you
|
|
@@ -1162,6 +1662,7 @@ interface Partials {
|
|
|
1162
1662
|
Content: typeof Content;
|
|
1163
1663
|
Provider: typeof Provider;
|
|
1164
1664
|
Portal: typeof Portal;
|
|
1665
|
+
Hotkey: typeof Hotkey;
|
|
1165
1666
|
}
|
|
1166
1667
|
|
|
1167
1668
|
export { DEFAULT_DELAY_DURATION as TOOLTIP_DEFAULT_DELAY_DURATION, DEFAULT_SKIP_DELAY_DURATION as TOOLTIP_DEFAULT_SKIP_DELAY_DURATION, Tooltip, ContentProps as TooltipContentProps, PortalProps as TooltipPortalProps, TooltipProps, ProviderProps as TooltipProviderProps, TriggerProps as TooltipTriggerProps, types as TooltipTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-tooltip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@radix-ui/react-tooltip": "^1.0.3",
|
|
31
|
-
"@mirohq/design-system-
|
|
32
|
-
"@mirohq/design-
|
|
31
|
+
"@mirohq/design-system-base-hotkey": "^0.1.0",
|
|
32
|
+
"@mirohq/design-system-stitches": "^2.6.0",
|
|
33
|
+
"@mirohq/design-system-styles": "^1.1.19",
|
|
33
34
|
"@mirohq/design-system-utils": "^0.14.3",
|
|
34
|
-
"@mirohq/design-
|
|
35
|
+
"@mirohq/design-tokens": "^3.6.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"build": "rollup -c ../../../rollup.config.js",
|