@tamagui/tooltip 1.0.1-beta.21 → 1.0.1-beta.211

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.
Files changed (43) hide show
  1. package/dist/cjs/Tooltip.js +113 -131
  2. package/dist/cjs/Tooltip.js.map +3 -3
  3. package/dist/cjs/Tooltip.native.js +7 -10
  4. package/dist/cjs/Tooltip.native.js.map +2 -2
  5. package/dist/cjs/TooltipSimple.js +91 -0
  6. package/dist/cjs/TooltipSimple.js.map +7 -0
  7. package/dist/cjs/TooltipSimple.native.js +32 -0
  8. package/dist/cjs/TooltipSimple.native.js.map +7 -0
  9. package/dist/cjs/index.js +2 -0
  10. package/dist/cjs/index.js.map +2 -2
  11. package/dist/esm/Tooltip.js +109 -103
  12. package/dist/esm/Tooltip.js.map +3 -3
  13. package/dist/esm/Tooltip.native.js +5 -9
  14. package/dist/esm/Tooltip.native.js.map +2 -2
  15. package/dist/esm/TooltipSimple.js +67 -0
  16. package/dist/esm/TooltipSimple.js.map +7 -0
  17. package/dist/esm/TooltipSimple.native.js +8 -0
  18. package/dist/esm/TooltipSimple.native.js.map +7 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/index.js.map +2 -2
  21. package/dist/jsx/Tooltip.js +76 -77
  22. package/dist/jsx/Tooltip.js.map +7 -0
  23. package/dist/jsx/Tooltip.native.js +6 -9
  24. package/dist/jsx/Tooltip.native.js.map +7 -0
  25. package/dist/jsx/TooltipSimple.js +39 -0
  26. package/dist/jsx/TooltipSimple.js.map +7 -0
  27. package/dist/jsx/TooltipSimple.native.js +8 -0
  28. package/dist/jsx/TooltipSimple.native.js.map +7 -0
  29. package/dist/jsx/index.js +2 -0
  30. package/dist/jsx/index.js.map +7 -0
  31. package/package.json +20 -15
  32. package/src/Tooltip.native.tsx +20 -0
  33. package/src/Tooltip.tsx +169 -0
  34. package/src/TooltipSimple.native.tsx +5 -0
  35. package/src/TooltipSimple.tsx +68 -0
  36. package/src/index.tsx +2 -0
  37. package/types/Tooltip.d.ts +42 -52
  38. package/types/TooltipSimple.d.ts +10 -0
  39. package/types/TooltipSimple.native.d.ts +2 -0
  40. package/types/index.d.ts +1 -0
  41. package/types/Tooltip.d.ts.map +0 -1
  42. package/types/Tooltip.native.d.ts.map +0 -1
  43. package/types/index.d.ts.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Tooltip.tsx"],
4
+ "sourcesContent": ["import '@tamagui/polyfill-dev'\n\nimport {\n FloatingDelayGroup,\n useDelayGroup,\n useDelayGroupContext,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n} from '@floating-ui/react-dom-interactions'\nimport { useEvent, useId, withStaticProperties } from '@tamagui/core'\nimport { ScopedProps } from '@tamagui/create-context'\nimport {\n PopoverAnchor,\n PopoverArrow,\n PopoverArrowProps,\n PopoverContent,\n PopoverContentProps,\n PopoverTrigger,\n __PopoverProviderInternal,\n usePopoverScope,\n} from '@tamagui/popover'\nimport {\n FloatingOverrideContext,\n Popper,\n PopperProps,\n UseFloatingFn,\n usePopperContext,\n} from '@tamagui/popper'\nimport * as React from 'react'\n\nconst TooltipContent = React.forwardRef(\n ({ __scopePopover, ...props }: ScopedProps<PopoverContentProps, 'Popover'>, ref: any) => {\n const popperScope = usePopoverScope(__scopePopover)\n const popper = usePopperContext('PopperContent', popperScope['__scopePopper'])\n return (\n <PopoverContent\n componentName=\"TooltipContent\"\n disableRemoveScroll\n trapFocus={false}\n padding={props.size || popper.size || '$2'}\n pointerEvents=\"none\"\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nconst TooltipArrow = React.forwardRef((props: PopoverArrowProps, ref: any) => {\n return <PopoverArrow componentName=\"TooltipArrow\" ref={ref} {...props} />\n})\n\nexport type TooltipProps = PopperProps & {\n children?: React.ReactNode\n onOpenChange?: (open: boolean) => void\n groupId?: string\n restMs?: number\n delay?:\n | number\n | {\n open?: number\n close?: number\n }\n}\n\ntype Delay =\n | number\n | Partial<{\n open: number\n close: number\n }>\n\nexport const TooltipGroup = ({ children, delay }: { children?: any; delay: Delay }) => {\n return (\n <FloatingDelayGroup delay={React.useMemo(() => delay, [JSON.stringify(delay)])}>\n {children}\n </FloatingDelayGroup>\n )\n}\n\nexport const Tooltip = withStaticProperties(\n ((props: ScopedProps<TooltipProps, 'Popover'>) => {\n const {\n __scopePopover,\n children,\n restMs = 500,\n delay: delayProp,\n onOpenChange: onOpenChangeProp,\n ...restProps\n } = props\n const popperScope = usePopoverScope(__scopePopover)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false)\n const { delay: delayGroup, setCurrentId } = useDelayGroupContext()\n const delay = delayProp ?? delayGroup\n const [open, setOpen] = React.useState(false)\n const id = props.groupId\n\n const onOpenChange = useEvent((open) => {\n setOpen(open)\n if (open) {\n setCurrentId(id)\n }\n onOpenChangeProp?.(open)\n })\n\n const useFloatingFn: UseFloatingFn = (props) => {\n const floating = useFloating({\n ...props,\n open,\n onOpenChange,\n })\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useHover(floating.context, { delay, restMs }),\n useFocus(floating.context),\n useRole(floating.context, { role: 'tooltip' }),\n useDismiss(floating.context),\n useDelayGroup(floating.context, { id }),\n ])\n return {\n ...floating,\n getReferenceProps,\n getFloatingProps,\n } as any\n }\n\n const useFloatingContext = React.useCallback(useFloatingFn, [id, delay, open])\n const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), [])\n const onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), [])\n const contentId = useId()\n\n return (\n <FloatingOverrideContext.Provider value={useFloatingContext}>\n {/* default tooltip to a smaller size */}\n <Popper size=\"$2\" {...popperScope} {...restProps}>\n <__PopoverProviderInternal\n scope={__scopePopover}\n contentId={contentId}\n triggerRef={triggerRef}\n sheetBreakpoint={false}\n scopeKey=\"\"\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={voidFn}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={onCustomAnchorAdd}\n onCustomAnchorRemove={onCustomAnchorRemove}\n >\n {children}\n </__PopoverProviderInternal>\n </Popper>\n </FloatingOverrideContext.Provider>\n )\n }) as React.FC<TooltipProps>,\n {\n Anchor: PopoverAnchor,\n Arrow: TooltipArrow,\n Content: TooltipContent,\n Trigger: PopoverTrigger,\n }\n)\n\nTooltip.displayName = 'Tooltip'\n\nconst voidFn = () => {}\n"],
5
+ "mappings": "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",
6
+ "names": ["open", "props"]
7
+ }
@@ -1,12 +1,10 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  import { withStaticProperties } from "@tamagui/core";
4
- const RenderChildren = /* @__PURE__ */ __name((props) => {
2
+ const RenderChildren = (props) => {
5
3
  return props.children;
6
- }, "RenderChildren");
7
- const RenderNull = /* @__PURE__ */ __name((props) => {
4
+ };
5
+ const RenderNull = (props) => {
8
6
  return null;
9
- }, "RenderNull");
7
+ };
10
8
  const Tooltip = withStaticProperties(RenderChildren, {
11
9
  Anchor: RenderChildren,
12
10
  Arrow: RenderNull,
@@ -14,8 +12,7 @@ const Tooltip = withStaticProperties(RenderChildren, {
14
12
  Content: RenderNull,
15
13
  Trigger: RenderChildren
16
14
  });
17
- const TooltipSimple = RenderChildren;
18
15
  export {
19
- Tooltip,
20
- TooltipSimple
16
+ Tooltip
21
17
  };
18
+ //# sourceMappingURL=Tooltip.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Tooltip.native.tsx"],
4
+ "sourcesContent": ["import { withStaticProperties } from '@tamagui/core'\n\n// no output on native for now\n// could have an option to long-press or similar to show in a context menu/drawer\n\nconst RenderChildren = (props: any) => {\n return props.children\n}\n\nconst RenderNull = (props: any) => {\n return null\n}\n\nexport const Tooltip = withStaticProperties(RenderChildren, {\n Anchor: RenderChildren,\n Arrow: RenderNull,\n Close: RenderNull,\n Content: RenderNull,\n Trigger: RenderChildren,\n})\n"],
5
+ "mappings": "AAAA,SAAS,4BAA4B;AAKrC,MAAM,iBAAiB,CAAC,UAAe;AACrC,SAAO,MAAM;AACf;AAEA,MAAM,aAAa,CAAC,UAAe;AACjC,SAAO;AACT;AAEO,MAAM,UAAU,qBAAqB,gBAAgB;AAAA,EAC1D,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,39 @@
1
+ import { useDelayGroupContext } from "@floating-ui/react-dom-interactions";
2
+ import { ThemeInverse } from "@tamagui/core";
3
+ import { Paragraph } from "@tamagui/text";
4
+ import { Tooltip, TooltipGroup } from "./Tooltip";
5
+ const TooltipSimple = ({
6
+ label,
7
+ children,
8
+ contentProps,
9
+ ...tooltipProps
10
+ }) => {
11
+ let context;
12
+ try {
13
+ context = useDelayGroupContext();
14
+ } catch {
15
+ }
16
+ const contents = <Tooltip {...tooltipProps}>
17
+ <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
18
+ <ThemeInverse><Tooltip.Content zIndex={1e5} enterStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }} exitStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }} x={0} scale={1} y={0} elevation="$0.5" opacity={1} animation={[
19
+ "quick",
20
+ {
21
+ opacity: {
22
+ overshootClamping: true
23
+ }
24
+ }
25
+ ]} {...contentProps}>
26
+ <Tooltip.Arrow />
27
+ <Paragraph size="$2" lineHeight="$0">{label}</Paragraph>
28
+ </Tooltip.Content></ThemeInverse>
29
+ </Tooltip>;
30
+ if (!context) {
31
+ return <TooltipGroup delay={defaultTooltipDelay}>{contents}</TooltipGroup>;
32
+ }
33
+ return contents;
34
+ };
35
+ const defaultTooltipDelay = { open: 3e3, close: 100 };
36
+ export {
37
+ TooltipSimple
38
+ };
39
+ //# sourceMappingURL=TooltipSimple.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/TooltipSimple.tsx"],
4
+ "sourcesContent": ["import { useDelayGroupContext } from '@floating-ui/react-dom-interactions'\nimport { ThemeInverse } from '@tamagui/core'\nimport { SizableStackProps } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\nimport * as React from 'react'\n\nimport { Tooltip, TooltipGroup, TooltipProps } from './Tooltip'\n\nexport type TooltipSimpleProps = TooltipProps & {\n label?: React.ReactNode\n children?: React.ReactNode\n contentProps?: SizableStackProps\n}\n\nexport const TooltipSimple: React.FC<TooltipSimpleProps> = ({\n label,\n children,\n contentProps,\n ...tooltipProps\n}) => {\n let context\n try {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n context = useDelayGroupContext()\n } catch {\n // ok\n }\n\n const contents = (\n <Tooltip {...tooltipProps}>\n <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>\n <ThemeInverse>\n <Tooltip.Content\n zIndex={100_000}\n enterStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }}\n exitStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }}\n x={0}\n scale={1}\n y={0}\n elevation=\"$0.5\"\n opacity={1}\n animation={[\n 'quick',\n {\n opacity: {\n overshootClamping: true,\n },\n },\n ]}\n {...contentProps}\n >\n <Tooltip.Arrow />\n <Paragraph size=\"$2\" lineHeight=\"$0\">\n {label}\n </Paragraph>\n </Tooltip.Content>\n </ThemeInverse>\n </Tooltip>\n )\n\n if (!context) {\n return <TooltipGroup delay={defaultTooltipDelay}>{contents}</TooltipGroup>\n }\n\n return contents\n}\n\nconst defaultTooltipDelay = { open: 3000, close: 100 }\n"],
5
+ "mappings": "AAAA,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB;AAG1B,SAAS,SAAS,oBAAkC;AAQ7C,MAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,KACG;AACL,MAAM;AACJ,MAAI;AACJ,MAAI;AAEF,cAAU,qBAAqB;AAAA,EACjC,QAAE;AAAA,EAEF;AAEA,QAAM,WACJ,CAAC,YAAY;AAAA,IACX,CAAC,QAAQ,QAAQ,SAAS,SAAS,EAAlC,QAAQ;AAAA,IACT,CAAC,aACC,CAAC,QAAQ,QACP,QAAQ,KACR,YAAY,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,GAAG,OAAO,KAAK,GACnD,WAAW,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,GAAG,OAAO,KAAK,GAClD,GAAG,GACH,OAAO,GACP,GAAG,GACH,UAAU,OACV,SAAS,GACT,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,SAAS;AAAA,UACP,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,IACF,OACI;AAAA,MAEJ,CAAC,QAAQ,MAAM;AAAA,MACf,CAAC,UAAU,KAAK,KAAK,WAAW,MAC7B,MACH,EAFC;AAAA,IAGH,EAvBC,QAAQ,QAwBX,EAzBC;AAAA,EA0BH,EA5BC;AA+BH,MAAI,CAAC,SAAS;AACZ,WAAO,CAAC,aAAa,OAAO,sBAAsB,SAAS,EAAnD;AAAA,EACV;AAEA,SAAO;AACT;AAEA,MAAM,sBAAsB,EAAE,MAAM,KAAM,OAAO,IAAI;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ const RenderChildren = (props) => {
2
+ return props.children;
3
+ };
4
+ const TooltipSimple = RenderChildren;
5
+ export {
6
+ TooltipSimple
7
+ };
8
+ //# sourceMappingURL=TooltipSimple.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/TooltipSimple.native.tsx"],
4
+ "sourcesContent": ["const RenderChildren = (props: any) => {\n return props.children\n}\n\nexport const TooltipSimple = RenderChildren\n"],
5
+ "mappings": "AAAA,MAAM,iBAAiB,CAAC,UAAe;AACrC,SAAO,MAAM;AACf;AAEO,MAAM,gBAAgB;",
6
+ "names": []
7
+ }
package/dist/jsx/index.js CHANGED
@@ -1 +1,3 @@
1
1
  export * from "./Tooltip";
2
+ export * from "./TooltipSimple";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx"],
4
+ "sourcesContent": ["export * from './Tooltip'\nexport * from './TooltipSimple'\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,33 +1,38 @@
1
1
  {
2
2
  "name": "@tamagui/tooltip",
3
- "version": "1.0.1-beta.21",
4
- "sideEffects": true,
3
+ "version": "1.0.1-beta.211",
4
+ "sideEffects": [
5
+ "*.css"
6
+ ],
5
7
  "source": "src/index.ts",
6
- "typings": "types",
8
+ "types": "./types/index.d.ts",
7
9
  "main": "dist/cjs",
8
10
  "module": "dist/esm",
9
11
  "module:jsx": "dist/jsx",
10
12
  "files": [
13
+ "src",
11
14
  "types",
12
15
  "dist"
13
16
  ],
14
17
  "scripts": {
15
18
  "build": "tamagui-build",
16
19
  "watch": "tamagui-build --watch",
20
+ "lint": "eslint",
21
+ "lint:fix": "yarn lint --fix",
17
22
  "clean": "tamagui-build clean",
18
23
  "clean:build": "tamagui-build clean:build"
19
24
  },
20
25
  "dependencies": {
21
- "@floating-ui/react-dom-interactions": "^0.4.0",
22
- "@tamagui/compose-refs": "^1.0.1-beta.21",
23
- "@tamagui/core": "^1.0.1-beta.21",
24
- "@tamagui/create-context": "^1.0.1-beta.21",
25
- "@tamagui/polyfill-dev": "^1.0.1-beta.21",
26
- "@tamagui/popover": "^1.0.1-beta.21",
27
- "@tamagui/popper": "^1.0.1-beta.21",
28
- "@tamagui/stacks": "^1.0.1-beta.21",
29
- "@tamagui/text": "^1.0.1-beta.21",
30
- "@tamagui/use-controllable-state": "^1.0.1-beta.21"
26
+ "@floating-ui/react-dom-interactions": "^0.10.3",
27
+ "@tamagui/compose-refs": "^1.0.1-beta.211",
28
+ "@tamagui/core": "^1.0.1-beta.211",
29
+ "@tamagui/create-context": "^1.0.1-beta.211",
30
+ "@tamagui/polyfill-dev": "^1.0.1-beta.211",
31
+ "@tamagui/popover": "^1.0.1-beta.211",
32
+ "@tamagui/popper": "^1.0.1-beta.211",
33
+ "@tamagui/stacks": "^1.0.1-beta.211",
34
+ "@tamagui/text": "^1.0.1-beta.211",
35
+ "@tamagui/use-controllable-state": "^1.0.1-beta.211"
31
36
  },
32
37
  "peerDependencies": {
33
38
  "react": "*",
@@ -35,9 +40,9 @@
35
40
  "react-native": "*"
36
41
  },
37
42
  "devDependencies": {
38
- "@tamagui/build": "^1.0.1-beta.21",
43
+ "@tamagui/build": "^1.0.1-beta.211",
39
44
  "@types/react-dom": "^18.0.3",
40
- "@types/react-native": "^0.67.3",
45
+ "@types/react-native": "^0.69.2",
41
46
  "react": "*",
42
47
  "react-dom": "*",
43
48
  "react-native": "*"
@@ -0,0 +1,20 @@
1
+ import { withStaticProperties } from '@tamagui/core'
2
+
3
+ // no output on native for now
4
+ // could have an option to long-press or similar to show in a context menu/drawer
5
+
6
+ const RenderChildren = (props: any) => {
7
+ return props.children
8
+ }
9
+
10
+ const RenderNull = (props: any) => {
11
+ return null
12
+ }
13
+
14
+ export const Tooltip = withStaticProperties(RenderChildren, {
15
+ Anchor: RenderChildren,
16
+ Arrow: RenderNull,
17
+ Close: RenderNull,
18
+ Content: RenderNull,
19
+ Trigger: RenderChildren,
20
+ })
@@ -0,0 +1,169 @@
1
+ import '@tamagui/polyfill-dev'
2
+
3
+ import {
4
+ FloatingDelayGroup,
5
+ useDelayGroup,
6
+ useDelayGroupContext,
7
+ useDismiss,
8
+ useFloating,
9
+ useFocus,
10
+ useHover,
11
+ useInteractions,
12
+ useRole,
13
+ } from '@floating-ui/react-dom-interactions'
14
+ import { useEvent, useId, withStaticProperties } from '@tamagui/core'
15
+ import { ScopedProps } from '@tamagui/create-context'
16
+ import {
17
+ PopoverAnchor,
18
+ PopoverArrow,
19
+ PopoverArrowProps,
20
+ PopoverContent,
21
+ PopoverContentProps,
22
+ PopoverTrigger,
23
+ __PopoverProviderInternal,
24
+ usePopoverScope,
25
+ } from '@tamagui/popover'
26
+ import {
27
+ FloatingOverrideContext,
28
+ Popper,
29
+ PopperProps,
30
+ UseFloatingFn,
31
+ usePopperContext,
32
+ } from '@tamagui/popper'
33
+ import * as React from 'react'
34
+
35
+ const TooltipContent = React.forwardRef(
36
+ ({ __scopePopover, ...props }: ScopedProps<PopoverContentProps, 'Popover'>, ref: any) => {
37
+ const popperScope = usePopoverScope(__scopePopover)
38
+ const popper = usePopperContext('PopperContent', popperScope['__scopePopper'])
39
+ return (
40
+ <PopoverContent
41
+ componentName="TooltipContent"
42
+ disableRemoveScroll
43
+ trapFocus={false}
44
+ padding={props.size || popper.size || '$2'}
45
+ pointerEvents="none"
46
+ ref={ref}
47
+ {...props}
48
+ />
49
+ )
50
+ }
51
+ )
52
+
53
+ const TooltipArrow = React.forwardRef((props: PopoverArrowProps, ref: any) => {
54
+ return <PopoverArrow componentName="TooltipArrow" ref={ref} {...props} />
55
+ })
56
+
57
+ export type TooltipProps = PopperProps & {
58
+ children?: React.ReactNode
59
+ onOpenChange?: (open: boolean) => void
60
+ groupId?: string
61
+ restMs?: number
62
+ delay?:
63
+ | number
64
+ | {
65
+ open?: number
66
+ close?: number
67
+ }
68
+ }
69
+
70
+ type Delay =
71
+ | number
72
+ | Partial<{
73
+ open: number
74
+ close: number
75
+ }>
76
+
77
+ export const TooltipGroup = ({ children, delay }: { children?: any; delay: Delay }) => {
78
+ return (
79
+ <FloatingDelayGroup delay={React.useMemo(() => delay, [JSON.stringify(delay)])}>
80
+ {children}
81
+ </FloatingDelayGroup>
82
+ )
83
+ }
84
+
85
+ export const Tooltip = withStaticProperties(
86
+ ((props: ScopedProps<TooltipProps, 'Popover'>) => {
87
+ const {
88
+ __scopePopover,
89
+ children,
90
+ restMs = 500,
91
+ delay: delayProp,
92
+ onOpenChange: onOpenChangeProp,
93
+ ...restProps
94
+ } = props
95
+ const popperScope = usePopoverScope(__scopePopover)
96
+ const triggerRef = React.useRef<HTMLButtonElement>(null)
97
+ const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false)
98
+ const { delay: delayGroup, setCurrentId } = useDelayGroupContext()
99
+ const delay = delayProp ?? delayGroup
100
+ const [open, setOpen] = React.useState(false)
101
+ const id = props.groupId
102
+
103
+ const onOpenChange = useEvent((open) => {
104
+ setOpen(open)
105
+ if (open) {
106
+ setCurrentId(id)
107
+ }
108
+ onOpenChangeProp?.(open)
109
+ })
110
+
111
+ const useFloatingFn: UseFloatingFn = (props) => {
112
+ const floating = useFloating({
113
+ ...props,
114
+ open,
115
+ onOpenChange,
116
+ })
117
+ const { getReferenceProps, getFloatingProps } = useInteractions([
118
+ useHover(floating.context, { delay, restMs }),
119
+ useFocus(floating.context),
120
+ useRole(floating.context, { role: 'tooltip' }),
121
+ useDismiss(floating.context),
122
+ useDelayGroup(floating.context, { id }),
123
+ ])
124
+ return {
125
+ ...floating,
126
+ getReferenceProps,
127
+ getFloatingProps,
128
+ } as any
129
+ }
130
+
131
+ const useFloatingContext = React.useCallback(useFloatingFn, [id, delay, open])
132
+ const onCustomAnchorAdd = React.useCallback(() => setHasCustomAnchor(true), [])
133
+ const onCustomAnchorRemove = React.useCallback(() => setHasCustomAnchor(false), [])
134
+ const contentId = useId()
135
+
136
+ return (
137
+ <FloatingOverrideContext.Provider value={useFloatingContext}>
138
+ {/* default tooltip to a smaller size */}
139
+ <Popper size="$2" {...popperScope} {...restProps}>
140
+ <__PopoverProviderInternal
141
+ scope={__scopePopover}
142
+ contentId={contentId}
143
+ triggerRef={triggerRef}
144
+ sheetBreakpoint={false}
145
+ scopeKey=""
146
+ open={open}
147
+ onOpenChange={setOpen}
148
+ onOpenToggle={voidFn}
149
+ hasCustomAnchor={hasCustomAnchor}
150
+ onCustomAnchorAdd={onCustomAnchorAdd}
151
+ onCustomAnchorRemove={onCustomAnchorRemove}
152
+ >
153
+ {children}
154
+ </__PopoverProviderInternal>
155
+ </Popper>
156
+ </FloatingOverrideContext.Provider>
157
+ )
158
+ }) as React.FC<TooltipProps>,
159
+ {
160
+ Anchor: PopoverAnchor,
161
+ Arrow: TooltipArrow,
162
+ Content: TooltipContent,
163
+ Trigger: PopoverTrigger,
164
+ }
165
+ )
166
+
167
+ Tooltip.displayName = 'Tooltip'
168
+
169
+ const voidFn = () => {}
@@ -0,0 +1,5 @@
1
+ const RenderChildren = (props: any) => {
2
+ return props.children
3
+ }
4
+
5
+ export const TooltipSimple = RenderChildren
@@ -0,0 +1,68 @@
1
+ import { useDelayGroupContext } from '@floating-ui/react-dom-interactions'
2
+ import { ThemeInverse } from '@tamagui/core'
3
+ import { SizableStackProps } from '@tamagui/stacks'
4
+ import { Paragraph } from '@tamagui/text'
5
+ import * as React from 'react'
6
+
7
+ import { Tooltip, TooltipGroup, TooltipProps } from './Tooltip'
8
+
9
+ export type TooltipSimpleProps = TooltipProps & {
10
+ label?: React.ReactNode
11
+ children?: React.ReactNode
12
+ contentProps?: SizableStackProps
13
+ }
14
+
15
+ export const TooltipSimple: React.FC<TooltipSimpleProps> = ({
16
+ label,
17
+ children,
18
+ contentProps,
19
+ ...tooltipProps
20
+ }) => {
21
+ let context
22
+ try {
23
+ // eslint-disable-next-line react-hooks/rules-of-hooks
24
+ context = useDelayGroupContext()
25
+ } catch {
26
+ // ok
27
+ }
28
+
29
+ const contents = (
30
+ <Tooltip {...tooltipProps}>
31
+ <Tooltip.Trigger asChild>{children}</Tooltip.Trigger>
32
+ <ThemeInverse>
33
+ <Tooltip.Content
34
+ zIndex={100_000}
35
+ enterStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }}
36
+ exitStyle={{ x: 0, y: -8, opacity: 0, scale: 0.93 }}
37
+ x={0}
38
+ scale={1}
39
+ y={0}
40
+ elevation="$0.5"
41
+ opacity={1}
42
+ animation={[
43
+ 'quick',
44
+ {
45
+ opacity: {
46
+ overshootClamping: true,
47
+ },
48
+ },
49
+ ]}
50
+ {...contentProps}
51
+ >
52
+ <Tooltip.Arrow />
53
+ <Paragraph size="$2" lineHeight="$0">
54
+ {label}
55
+ </Paragraph>
56
+ </Tooltip.Content>
57
+ </ThemeInverse>
58
+ </Tooltip>
59
+ )
60
+
61
+ if (!context) {
62
+ return <TooltipGroup delay={defaultTooltipDelay}>{contents}</TooltipGroup>
63
+ }
64
+
65
+ return contents
66
+ }
67
+
68
+ const defaultTooltipDelay = { open: 3000, close: 100 }
package/src/index.tsx ADDED
@@ -0,0 +1,2 @@
1
+ export * from './Tooltip'
2
+ export * from './TooltipSimple'
@@ -1,6 +1,5 @@
1
1
  import '@tamagui/polyfill-dev';
2
2
  import { PopperProps } from '@tamagui/popper';
3
- import { SizableStackProps } from '@tamagui/stacks';
4
3
  import * as React from 'react';
5
4
  export declare type TooltipProps = PopperProps & {
6
5
  children?: React.ReactNode;
@@ -12,60 +11,51 @@ export declare type TooltipProps = PopperProps & {
12
11
  close?: number;
13
12
  };
14
13
  };
15
- export declare const TooltipGroup: ({ children, delay, }: {
16
- children?: React.ReactNode;
17
- delay: number | Partial<{
18
- open: number;
19
- close: number;
20
- }>;
14
+ declare type Delay = number | Partial<{
15
+ open: number;
16
+ close: number;
17
+ }>;
18
+ export declare const TooltipGroup: ({ children, delay }: {
19
+ children?: any;
20
+ delay: Delay;
21
21
  }) => JSX.Element;
22
22
  export declare const Tooltip: React.FC<TooltipProps> & {
23
- Anchor: React.ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
24
- fullscreen?: boolean | undefined;
25
- elevation?: import("@tamagui/core").SizeTokens | undefined;
26
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
27
- fullscreen?: boolean | undefined;
28
- elevation?: import("@tamagui/core").SizeTokens | undefined;
29
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
30
- fullscreen?: boolean | undefined;
31
- elevation?: import("@tamagui/core").SizeTokens | undefined;
32
- }>> & React.RefAttributes<HTMLElement | import("react-native").View>>;
33
- Arrow: React.ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
34
- fullscreen?: boolean | undefined;
35
- elevation?: import("@tamagui/core").SizeTokens | undefined;
36
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
37
- fullscreen?: boolean | undefined;
38
- elevation?: import("@tamagui/core").SizeTokens | undefined;
39
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
40
- fullscreen?: boolean | undefined;
41
- elevation?: import("@tamagui/core").SizeTokens | undefined;
42
- }>> & React.RefAttributes<HTMLElement | import("react-native").View>>;
43
- Close: React.ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
44
- fullscreen?: boolean | undefined;
45
- elevation?: import("@tamagui/core").SizeTokens | undefined;
46
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
47
- fullscreen?: boolean | undefined;
48
- elevation?: import("@tamagui/core").SizeTokens | undefined;
49
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
50
- fullscreen?: boolean | undefined;
51
- elevation?: import("@tamagui/core").SizeTokens | undefined;
23
+ Anchor: React.ForwardRefExoticComponent<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
24
+ readonly fullscreen?: boolean | undefined;
25
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
26
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
27
+ readonly fullscreen?: boolean | undefined;
28
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
29
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
30
+ readonly fullscreen?: boolean | undefined;
31
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
52
32
  }>> & React.RefAttributes<HTMLElement | import("react-native").View>>;
53
- Content: React.ForwardRefExoticComponent<import("@tamagui/popover").PopoverContentTypeProps & React.RefAttributes<unknown>>;
54
- Trigger: React.ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
55
- fullscreen?: boolean | undefined;
56
- elevation?: import("@tamagui/core").SizeTokens | undefined;
57
- } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
58
- fullscreen?: boolean | undefined;
59
- elevation?: import("@tamagui/core").SizeTokens | undefined;
60
- }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
61
- fullscreen?: boolean | undefined;
62
- elevation?: import("@tamagui/core").SizeTokens | undefined;
33
+ Arrow: React.ForwardRefExoticComponent<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
34
+ readonly fullscreen?: boolean | undefined;
35
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
36
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
37
+ readonly fullscreen?: boolean | undefined;
38
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
39
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
40
+ readonly fullscreen?: boolean | undefined;
41
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
42
+ }>> & {
43
+ offset?: number | undefined;
44
+ size?: import("@tamagui/core").SizeTokens | undefined;
45
+ } & React.RefAttributes<unknown>>;
46
+ Content: React.ForwardRefExoticComponent<import("@tamagui/popover").PopoverContentTypeProps & {
47
+ __scopePopover?: import("@tamagui/create-context").Scope<any>;
48
+ } & React.RefAttributes<unknown>>;
49
+ Trigger: React.ForwardRefExoticComponent<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
50
+ readonly fullscreen?: boolean | undefined;
51
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
52
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
53
+ readonly fullscreen?: boolean | undefined;
54
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
55
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("@tamagui/types-react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{}, "elevation" | "fullscreen"> & {
56
+ readonly fullscreen?: boolean | undefined;
57
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
63
58
  }>> & React.RefAttributes<HTMLElement | import("react-native").View>>;
64
59
  };
65
- export declare type TooltipSimpleProps = TooltipProps & {
66
- label?: React.ReactNode;
67
- children?: React.ReactNode;
68
- contentProps?: SizableStackProps;
69
- };
70
- export declare const TooltipSimple: React.FC<TooltipSimpleProps>;
60
+ export {};
71
61
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { SizableStackProps } from '@tamagui/stacks';
2
+ import * as React from 'react';
3
+ import { TooltipProps } from './Tooltip';
4
+ export declare type TooltipSimpleProps = TooltipProps & {
5
+ label?: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ contentProps?: SizableStackProps;
8
+ };
9
+ export declare const TooltipSimple: React.FC<TooltipSimpleProps>;
10
+ //# sourceMappingURL=TooltipSimple.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const TooltipSimple: (props: any) => any;
2
+ //# sourceMappingURL=TooltipSimple.native.d.ts.map
package/types/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './Tooltip';
2
+ export * from './TooltipSimple';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAyB9B,OAAO,EAAmC,WAAW,EAAiB,MAAM,iBAAiB,CAAA;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,oBAAY,YAAY,GAAG,WAAW,GAAG;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EACF,MAAM,GACN;QACE,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACN,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;iBAAqB,CAAA;AAE9C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EnB,CAAA;AAID,oBAAY,kBAAkB,GAAG,YAAY,GAAG;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,iBAAiB,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkCtD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.native.d.ts","sourceRoot":"","sources":["../src/Tooltip.native.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,OAAO,WARW,GAAG;oBAAH,GAAG;mBAIP,GAAG;mBAAH,GAAG;qBAAH,GAAG;qBAJC,GAAG;CAchC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}