@tamagui/tooltip 1.0.1-beta.28 → 1.0.1-beta.31
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/cjs/Tooltip.js +8 -2
- package/dist/cjs/Tooltip.js.map +2 -2
- package/dist/esm/Tooltip.js +9 -3
- package/dist/esm/Tooltip.js.map +2 -2
- package/dist/jsx/Tooltip.js +5 -4
- package/package.json +11 -11
- package/types/Tooltip.d.ts +1 -11
- package/types/Tooltip.d.ts.map +1 -1
package/dist/cjs/Tooltip.js
CHANGED
|
@@ -64,10 +64,17 @@ var import_text = require("@tamagui/text");
|
|
|
64
64
|
var React = __toESM(require("react"));
|
|
65
65
|
const TooltipContent = React.forwardRef((props, ref) => {
|
|
66
66
|
return /* @__PURE__ */ React.createElement(import_popover.PopoverContent, __spreadValues({
|
|
67
|
+
componentName: "TooltipContent",
|
|
67
68
|
pointerEvents: "none",
|
|
68
69
|
ref
|
|
69
70
|
}, props));
|
|
70
71
|
});
|
|
72
|
+
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
73
|
+
return /* @__PURE__ */ React.createElement(import_popover.PopoverArrow, __spreadValues({
|
|
74
|
+
componentName: "TooltipArrow",
|
|
75
|
+
ref
|
|
76
|
+
}, props));
|
|
77
|
+
});
|
|
71
78
|
const TooltipGroup = import_react_dom_interactions.FloatingDelayGroup;
|
|
72
79
|
const Tooltip = (0, import_core.withStaticProperties)((props) => {
|
|
73
80
|
const _a = props, { __scopePopover, children, restMs = 500, delay: delayProp } = _a, restProps = __objRest(_a, ["__scopePopover", "children", "restMs", "delay"]);
|
|
@@ -124,8 +131,7 @@ const Tooltip = (0, import_core.withStaticProperties)((props) => {
|
|
|
124
131
|
}, children)));
|
|
125
132
|
}, {
|
|
126
133
|
Anchor: import_popover.PopoverAnchor,
|
|
127
|
-
Arrow:
|
|
128
|
-
Close: import_popover.PopoverClose,
|
|
134
|
+
Arrow: TooltipArrow,
|
|
129
135
|
Content: TooltipContent,
|
|
130
136
|
Trigger: import_popover.PopoverTrigger
|
|
131
137
|
});
|
package/dist/cjs/Tooltip.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { useId, withStaticProperties } from '@tamagui/core'\nimport { ScopedProps } from '@tamagui/create-context'\nimport {\n PopoverAnchor,\n PopoverArrow,\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,oCAUO;AACP,kBAA4C;AAE5C,qBASO;AACP,oBAA4E;AAE5E,kBAA0B;AAC1B,YAAuB;AAEvB,MAAM,iBAAiB,MAAM,WAAW,CAAC,OAA4B,QAAa;AAChF,SAAO,oCAAC;AAAA,IAAe,eAAc;AAAA,IAAO;AAAA,KAAc,MAAO;
|
|
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 { 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 { FloatingOverrideContext, Popper, PopperProps, UseFloatingFn } from '@tamagui/popper'\nimport { SizableStackProps } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\nimport * as React from 'react'\n\nconst TooltipContent = React.forwardRef((props: PopoverContentProps, ref: any) => {\n return <PopoverContent componentName=\"TooltipContent\" pointerEvents=\"none\" ref={ref} {...props} />\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\nexport const TooltipGroup = FloatingDelayGroup\n\nexport const Tooltip = withStaticProperties(\n ((props: ScopedProps<TooltipProps, 'Popover'>) => {\n const { __scopePopover, children, restMs = 500, delay: delayProp, ...restProps } = 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 = React.useCallback(\n (open) => {\n setOpen(open)\n if (open) {\n setCurrentId(id)\n }\n props.onOpenChange?.(open)\n },\n [id, setCurrentId]\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\n const voidFn = React.useCallback(() => {}, [setOpen])\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={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={voidFn}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal\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\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 return (\n <TooltipGroup delay={{ open: 3000, close: 100 }}>\n <Tooltip {...tooltipProps}>\n <Tooltip.Trigger>{children}</Tooltip.Trigger>\n <Tooltip.Content\n enterStyle={{ x: 0, y: -10, opacity: 0, scale: 0.9 }}\n exitStyle={{ x: 0, y: -10, opacity: 0, scale: 0.9 }}\n x={0}\n scale={1}\n y={0}\n elevation=\"$1\"\n opacity={1}\n animation={[\n 'bouncy',\n {\n opacity: {\n overshootClamping: true,\n },\n },\n ]}\n {...contentProps}\n >\n <Tooltip.Arrow />\n <Paragraph>{label}</Paragraph>\n </Tooltip.Content>\n </Tooltip>\n </TooltipGroup>\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,oCAUO;AACP,kBAA4C;AAE5C,qBASO;AACP,oBAA4E;AAE5E,kBAA0B;AAC1B,YAAuB;AAEvB,MAAM,iBAAiB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K,SAAS,GAAG,OAAO,IAAI;AAAA,IAClD,GAAG;AAAA,IACH,OAAO;AAAA,IACP,GAAG;AAAA,IACH,WAAU;AAAA,IACV,SAAS;AAAA,IACT,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,SAAS;AAAA,UACP,mBAAmB;AAAA,QACrB;AAAA,MACF;AAAA,IACF;AAAA,KACI,eAEJ,oCAAC,QAAQ,OAAR,IAAc,GACf,oCAAC,6BAAW,KAAM,CACpB,CACF,CACF;AAEJ,GAlC2D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Tooltip.js
CHANGED
|
@@ -16,7 +16,6 @@ import { useId, withStaticProperties } from "@tamagui/core";
|
|
|
16
16
|
import {
|
|
17
17
|
PopoverAnchor,
|
|
18
18
|
PopoverArrow,
|
|
19
|
-
PopoverClose,
|
|
20
19
|
PopoverContent,
|
|
21
20
|
PopoverTrigger,
|
|
22
21
|
__PopoverProviderInternal,
|
|
@@ -27,11 +26,19 @@ import { Paragraph } from "@tamagui/text";
|
|
|
27
26
|
import * as React from "react";
|
|
28
27
|
const TooltipContent = React.forwardRef((props, ref) => {
|
|
29
28
|
return /* @__PURE__ */ React.createElement(PopoverContent, {
|
|
29
|
+
componentName: "TooltipContent",
|
|
30
30
|
pointerEvents: "none",
|
|
31
31
|
ref,
|
|
32
32
|
...props
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
+
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
36
|
+
return /* @__PURE__ */ React.createElement(PopoverArrow, {
|
|
37
|
+
componentName: "TooltipArrow",
|
|
38
|
+
ref,
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
});
|
|
35
42
|
const TooltipGroup = FloatingDelayGroup;
|
|
36
43
|
const Tooltip = withStaticProperties((props) => {
|
|
37
44
|
const { __scopePopover, children, restMs = 500, delay: delayProp, ...restProps } = props;
|
|
@@ -92,8 +99,7 @@ const Tooltip = withStaticProperties((props) => {
|
|
|
92
99
|
}, children)));
|
|
93
100
|
}, {
|
|
94
101
|
Anchor: PopoverAnchor,
|
|
95
|
-
Arrow:
|
|
96
|
-
Close: PopoverClose,
|
|
102
|
+
Arrow: TooltipArrow,
|
|
97
103
|
Content: TooltipContent,
|
|
98
104
|
Trigger: PopoverTrigger
|
|
99
105
|
});
|
package/dist/esm/Tooltip.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { useId, withStaticProperties } from '@tamagui/core'\nimport { ScopedProps } from '@tamagui/create-context'\nimport {\n PopoverAnchor,\n PopoverArrow,\n
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
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 { 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 { FloatingOverrideContext, Popper, PopperProps, UseFloatingFn } from '@tamagui/popper'\nimport { SizableStackProps } from '@tamagui/stacks'\nimport { Paragraph } from '@tamagui/text'\nimport * as React from 'react'\n\nconst TooltipContent = React.forwardRef((props: PopoverContentProps, ref: any) => {\n return <PopoverContent componentName=\"TooltipContent\" pointerEvents=\"none\" ref={ref} {...props} />\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\nexport const TooltipGroup = FloatingDelayGroup\n\nexport const Tooltip = withStaticProperties(\n ((props: ScopedProps<TooltipProps, 'Popover'>) => {\n const { __scopePopover, children, restMs = 500, delay: delayProp, ...restProps } = 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 = React.useCallback(\n (open) => {\n setOpen(open)\n if (open) {\n setCurrentId(id)\n }\n props.onOpenChange?.(open)\n },\n [id, setCurrentId]\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\n const voidFn = React.useCallback(() => {}, [setOpen])\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={useId()}\n triggerRef={triggerRef}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={voidFn}\n hasCustomAnchor={hasCustomAnchor}\n onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])}\n onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])}\n modal\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\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 return (\n <TooltipGroup delay={{ open: 3000, close: 100 }}>\n <Tooltip {...tooltipProps}>\n <Tooltip.Trigger>{children}</Tooltip.Trigger>\n <Tooltip.Content\n enterStyle={{ x: 0, y: -10, opacity: 0, scale: 0.9 }}\n exitStyle={{ x: 0, y: -10, opacity: 0, scale: 0.9 }}\n x={0}\n scale={1}\n y={0}\n elevation=\"$1\"\n opacity={1}\n animation={[\n 'bouncy',\n {\n opacity: {\n overshootClamping: true,\n },\n },\n ]}\n {...contentProps}\n >\n <Tooltip.Arrow />\n <Paragraph>{label}</Paragraph>\n </Tooltip.Content>\n </Tooltip>\n </TooltipGroup>\n )\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AAEA;AACA;AAEA,MAAM,iBAAiB,MAAM,WAAW,CAAC,OAA4B,QAAa;AAChF,SAAO,oCAAC;AAAA,IAAe,eAAc;AAAA,IAAiB,eAAc;AAAA,IAAO;AA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QACrB;AAAA,MACF;AAAA,IACF;AAAA,OACI;AAAA,KAEJ,oCAAC,QAAQ,OAAR,IAAc,GACf,oCAAC,iBAAW,KAAM,CACpB,CACF,CACF;AAEJ,GAlC2D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Tooltip.js
CHANGED
|
@@ -16,7 +16,6 @@ import { useId, withStaticProperties } from "@tamagui/core";
|
|
|
16
16
|
import {
|
|
17
17
|
PopoverAnchor,
|
|
18
18
|
PopoverArrow,
|
|
19
|
-
PopoverClose,
|
|
20
19
|
PopoverContent,
|
|
21
20
|
PopoverTrigger,
|
|
22
21
|
__PopoverProviderInternal,
|
|
@@ -26,7 +25,10 @@ import { FloatingOverrideContext, Popper } from "@tamagui/popper";
|
|
|
26
25
|
import { Paragraph } from "@tamagui/text";
|
|
27
26
|
import * as React from "react";
|
|
28
27
|
const TooltipContent = React.forwardRef((props, ref) => {
|
|
29
|
-
return <PopoverContent pointerEvents="none" ref={ref} {...props} />;
|
|
28
|
+
return <PopoverContent componentName="TooltipContent" pointerEvents="none" ref={ref} {...props} />;
|
|
29
|
+
});
|
|
30
|
+
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
31
|
+
return <PopoverArrow componentName="TooltipArrow" ref={ref} {...props} />;
|
|
30
32
|
});
|
|
31
33
|
const TooltipGroup = FloatingDelayGroup;
|
|
32
34
|
const Tooltip = withStaticProperties((props) => {
|
|
@@ -71,8 +73,7 @@ const Tooltip = withStaticProperties((props) => {
|
|
|
71
73
|
return <FloatingOverrideContext.Provider value={useFloatingContext}><Popper size="$2" {...popperScope} {...restProps}><__PopoverProviderInternal scope={__scopePopover} contentId={useId()} triggerRef={triggerRef} open={open} onOpenChange={setOpen} onOpenToggle={voidFn} hasCustomAnchor={hasCustomAnchor} onCustomAnchorAdd={React.useCallback(() => setHasCustomAnchor(true), [])} onCustomAnchorRemove={React.useCallback(() => setHasCustomAnchor(false), [])} modal>{children}</__PopoverProviderInternal></Popper></FloatingOverrideContext.Provider>;
|
|
72
74
|
}, {
|
|
73
75
|
Anchor: PopoverAnchor,
|
|
74
|
-
Arrow:
|
|
75
|
-
Close: PopoverClose,
|
|
76
|
+
Arrow: TooltipArrow,
|
|
76
77
|
Content: TooltipContent,
|
|
77
78
|
Trigger: PopoverTrigger
|
|
78
79
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/tooltip",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.31",
|
|
4
4
|
"sideEffects": true,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react-dom-interactions": "^0.5.0",
|
|
22
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
23
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
24
|
-
"@tamagui/create-context": "^1.0.1-beta.
|
|
25
|
-
"@tamagui/polyfill-dev": "^1.0.1-beta.
|
|
26
|
-
"@tamagui/popover": "^1.0.1-beta.
|
|
27
|
-
"@tamagui/popper": "^1.0.1-beta.
|
|
28
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
29
|
-
"@tamagui/text": "^1.0.1-beta.
|
|
30
|
-
"@tamagui/use-controllable-state": "^1.0.1-beta.
|
|
22
|
+
"@tamagui/compose-refs": "^1.0.1-beta.31",
|
|
23
|
+
"@tamagui/core": "^1.0.1-beta.31",
|
|
24
|
+
"@tamagui/create-context": "^1.0.1-beta.31",
|
|
25
|
+
"@tamagui/polyfill-dev": "^1.0.1-beta.31",
|
|
26
|
+
"@tamagui/popover": "^1.0.1-beta.31",
|
|
27
|
+
"@tamagui/popper": "^1.0.1-beta.31",
|
|
28
|
+
"@tamagui/stacks": "^1.0.1-beta.31",
|
|
29
|
+
"@tamagui/text": "^1.0.1-beta.31",
|
|
30
|
+
"@tamagui/use-controllable-state": "^1.0.1-beta.31"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": "*",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-native": "*"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
38
|
+
"@tamagui/build": "^1.0.1-beta.31",
|
|
39
39
|
"@types/react-dom": "^18.0.3",
|
|
40
40
|
"@types/react-native": "^0.67.3",
|
|
41
41
|
"react": "*",
|
package/types/Tooltip.d.ts
CHANGED
|
@@ -39,17 +39,7 @@ export declare const Tooltip: React.FC<TooltipProps> & {
|
|
|
39
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
40
|
fullscreen?: boolean | undefined;
|
|
41
41
|
elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
42
|
-
}>> & React.RefAttributes<
|
|
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;
|
|
52
|
-
}>> & React.RefAttributes<HTMLElement | import("react-native").View>>;
|
|
42
|
+
}>> & React.RefAttributes<unknown>>;
|
|
53
43
|
Content: React.ForwardRefExoticComponent<import("@tamagui/popover").PopoverContentTypeProps & React.RefAttributes<unknown>>;
|
|
54
44
|
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
45
|
fullscreen?: boolean | undefined;
|
package/types/Tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAyB9B,OAAO,EAAm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