@tamagui/toast 1.15.4 → 1.15.6
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/Toast.js.map +1 -1
- package/dist/cjs/ToastImperative.js +1 -2
- package/dist/cjs/ToastImperative.js.map +2 -2
- package/dist/cjs/ToastImpl.js +8 -12
- package/dist/cjs/ToastImpl.js.map +2 -2
- package/dist/cjs/ToastProvider.js +9 -3
- package/dist/cjs/ToastProvider.js.map +2 -2
- package/dist/cjs/ToastViewport.js +44 -21
- package/dist/cjs/ToastViewport.js.map +2 -2
- package/dist/esm/Toast.js.map +1 -1
- package/dist/esm/Toast.mjs.map +1 -1
- package/dist/esm/ToastImperative.js +1 -2
- package/dist/esm/ToastImperative.js.map +2 -2
- package/dist/esm/ToastImperative.mjs +1 -2
- package/dist/esm/ToastImperative.mjs.map +2 -2
- package/dist/esm/ToastImpl.js +8 -12
- package/dist/esm/ToastImpl.js.map +2 -2
- package/dist/esm/ToastImpl.mjs +8 -12
- package/dist/esm/ToastImpl.mjs.map +2 -2
- package/dist/esm/ToastProvider.js +9 -3
- package/dist/esm/ToastProvider.js.map +2 -2
- package/dist/esm/ToastProvider.mjs +9 -3
- package/dist/esm/ToastProvider.mjs.map +2 -2
- package/dist/esm/ToastViewport.js +44 -21
- package/dist/esm/ToastViewport.js.map +2 -2
- package/dist/esm/ToastViewport.mjs +44 -21
- package/dist/esm/ToastViewport.mjs.map +2 -2
- package/dist/jsx/Toast.js.map +1 -1
- package/dist/jsx/Toast.mjs.map +1 -1
- package/dist/jsx/ToastImperative.js +1 -2
- package/dist/jsx/ToastImperative.js.map +2 -2
- package/dist/jsx/ToastImperative.mjs +1 -2
- package/dist/jsx/ToastImperative.mjs.map +2 -2
- package/dist/jsx/ToastImpl.js +8 -11
- package/dist/jsx/ToastImpl.js.map +2 -2
- package/dist/jsx/ToastImpl.mjs +8 -11
- package/dist/jsx/ToastImpl.mjs.map +2 -2
- package/dist/jsx/ToastProvider.js +9 -3
- package/dist/jsx/ToastProvider.js.map +2 -2
- package/dist/jsx/ToastProvider.mjs +9 -3
- package/dist/jsx/ToastProvider.mjs.map +2 -2
- package/dist/jsx/ToastViewport.js +44 -20
- package/dist/jsx/ToastViewport.js.map +2 -2
- package/dist/jsx/ToastViewport.mjs +44 -20
- package/dist/jsx/ToastViewport.mjs.map +2 -2
- package/package.json +13 -13
- package/src/Toast.tsx +2 -2
- package/src/ToastImperative.tsx +11 -3
- package/src/ToastImpl.tsx +21 -21
- package/src/ToastProvider.tsx +14 -5
- package/src/ToastViewport.tsx +51 -21
- package/types/Toast.d.ts +38 -66
- package/types/Toast.d.ts.map +1 -1
- package/types/ToastAnnounce.d.ts +1 -1
- package/types/ToastImperative.d.ts +10 -1
- package/types/ToastImperative.d.ts.map +1 -1
- package/types/ToastImpl.d.ts +13 -20
- package/types/ToastImpl.d.ts.map +1 -1
- package/types/ToastProvider.d.ts +2 -2
- package/types/ToastProvider.d.ts.map +1 -1
- package/types/ToastViewport.d.ts +18 -59
- package/types/ToastViewport.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/toast",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.6",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/animate-presence": "1.15.
|
|
35
|
-
"@tamagui/compose-refs": "1.15.
|
|
36
|
-
"@tamagui/core": "1.15.
|
|
37
|
-
"@tamagui/create-context": "1.15.
|
|
38
|
-
"@tamagui/dismissable": "1.15.
|
|
39
|
-
"@tamagui/polyfill-dev": "1.15.
|
|
40
|
-
"@tamagui/portal": "1.15.
|
|
41
|
-
"@tamagui/stacks": "1.15.
|
|
42
|
-
"@tamagui/text": "1.15.
|
|
43
|
-
"@tamagui/use-controllable-state": "1.15.
|
|
44
|
-
"@tamagui/visually-hidden": "1.15.
|
|
34
|
+
"@tamagui/animate-presence": "1.15.6",
|
|
35
|
+
"@tamagui/compose-refs": "1.15.6",
|
|
36
|
+
"@tamagui/core": "1.15.6",
|
|
37
|
+
"@tamagui/create-context": "1.15.6",
|
|
38
|
+
"@tamagui/dismissable": "1.15.6",
|
|
39
|
+
"@tamagui/polyfill-dev": "1.15.6",
|
|
40
|
+
"@tamagui/portal": "1.15.6",
|
|
41
|
+
"@tamagui/stacks": "1.15.6",
|
|
42
|
+
"@tamagui/text": "1.15.6",
|
|
43
|
+
"@tamagui/use-controllable-state": "1.15.6",
|
|
44
|
+
"@tamagui/visually-hidden": "1.15.6"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"burnt": "^0.10.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-native": "*"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@tamagui/build": "1.15.
|
|
52
|
+
"@tamagui/build": "1.15.6",
|
|
53
53
|
"burnt": "^0.10.0",
|
|
54
54
|
"react": "^18.2.0",
|
|
55
55
|
"react-native": "^0.71.4"
|
package/src/Toast.tsx
CHANGED
|
@@ -50,7 +50,7 @@ const ToastTitleFrame = styled(SizableText, {
|
|
|
50
50
|
size: '$4',
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
},
|
|
53
|
+
} as const,
|
|
54
54
|
defaultVariants: {
|
|
55
55
|
unstyled: false,
|
|
56
56
|
},
|
|
@@ -84,7 +84,7 @@ const ToastDescriptionFrame = styled(SizableText, {
|
|
|
84
84
|
size: '$1',
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
|
-
},
|
|
87
|
+
} as const,
|
|
88
88
|
|
|
89
89
|
defaultVariants: {
|
|
90
90
|
unstyled: false,
|
package/src/ToastImperative.tsx
CHANGED
|
@@ -19,15 +19,24 @@ interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message
|
|
|
19
19
|
interface ShowOptions extends CreateNativeToastOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Used when need custom data
|
|
22
|
+
* @deprecated Use `customData` instead
|
|
22
23
|
*/
|
|
23
24
|
additionalInfo?: Record<string, any>
|
|
25
|
+
/**
|
|
26
|
+
* Used when need custom data
|
|
27
|
+
*/
|
|
28
|
+
customData?: Record<string, any>
|
|
24
29
|
/**
|
|
25
30
|
* Overrides the native option on `ToastImperativeProvider`
|
|
26
31
|
*/
|
|
27
32
|
native?: ToastNativeValue
|
|
33
|
+
/**
|
|
34
|
+
* Which viewport to send this toast to. This is only intended to be used with custom toasts and you should wire it up when creating the toast.
|
|
35
|
+
*/
|
|
36
|
+
viewportName?: string | 'default'
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
type ToastData = { title: string; id: string } &
|
|
39
|
+
type ToastData = { title: string; id: string } & ShowOptions & {
|
|
31
40
|
isHandledNatively: boolean
|
|
32
41
|
}
|
|
33
42
|
|
|
@@ -122,6 +131,7 @@ export const ToastImperativeProvider = ({
|
|
|
122
131
|
setToast({
|
|
123
132
|
title,
|
|
124
133
|
id: counterRef.current.toString(),
|
|
134
|
+
viewportName: showOptions?.viewportName ?? 'default',
|
|
125
135
|
...showOptions,
|
|
126
136
|
isHandledNatively,
|
|
127
137
|
})
|
|
@@ -143,8 +153,6 @@ export const ToastImperativeProvider = ({
|
|
|
143
153
|
}
|
|
144
154
|
}, [show, hide, lastNativeToastRef, JSON.stringify(options || null)])
|
|
145
155
|
|
|
146
|
-
const currentContextValue = useMemo(() => {}, [])
|
|
147
|
-
|
|
148
156
|
return (
|
|
149
157
|
<ToastContext.Provider value={contextValue}>
|
|
150
158
|
<ToastCurrentContext.Provider value={toast}>
|
package/src/ToastImpl.tsx
CHANGED
|
@@ -31,13 +31,10 @@ import { VIEWPORT_PAUSE, VIEWPORT_RESUME } from './ToastViewport'
|
|
|
31
31
|
const ToastImplFrame = styled(ThemeableStack, {
|
|
32
32
|
name: 'ToastImpl',
|
|
33
33
|
variants: {
|
|
34
|
-
backgrounded: {
|
|
35
|
-
true: {
|
|
36
|
-
backgroundColor: '$color6',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
34
|
unstyled: {
|
|
40
35
|
false: {
|
|
36
|
+
focusable: true,
|
|
37
|
+
backgroundColor: '$color6',
|
|
41
38
|
borderRadius: '$10',
|
|
42
39
|
paddingHorizontal: '$5',
|
|
43
40
|
paddingVertical: '$2',
|
|
@@ -45,9 +42,8 @@ const ToastImplFrame = styled(ThemeableStack, {
|
|
|
45
42
|
marginVertical: '$1',
|
|
46
43
|
},
|
|
47
44
|
},
|
|
48
|
-
},
|
|
45
|
+
} as const,
|
|
49
46
|
defaultVariants: {
|
|
50
|
-
backgrounded: true,
|
|
51
47
|
unstyled: false,
|
|
52
48
|
},
|
|
53
49
|
})
|
|
@@ -132,7 +128,7 @@ type ToastImplProps = ToastImplPrivateProps &
|
|
|
132
128
|
*/
|
|
133
129
|
viewportName?: string
|
|
134
130
|
/**
|
|
135
|
-
*
|
|
131
|
+
*
|
|
136
132
|
*/
|
|
137
133
|
id?: string
|
|
138
134
|
}
|
|
@@ -152,7 +148,7 @@ const ToastImpl = React.forwardRef<TamaguiElement, ToastImplProps>(
|
|
|
152
148
|
onSwipeMove,
|
|
153
149
|
onSwipeCancel,
|
|
154
150
|
onSwipeEnd,
|
|
155
|
-
viewportName,
|
|
151
|
+
viewportName = 'default',
|
|
156
152
|
...toastProps
|
|
157
153
|
} = props
|
|
158
154
|
const isPresent = useIsPresent()
|
|
@@ -164,17 +160,22 @@ const ToastImpl = React.forwardRef<TamaguiElement, ToastImplProps>(
|
|
|
164
160
|
const closeTimerRemainingTimeRef = React.useRef(duration)
|
|
165
161
|
const closeTimerRef = React.useRef(0)
|
|
166
162
|
const { onToastAdd, onToastRemove } = context
|
|
163
|
+
|
|
164
|
+
const viewport = React.useMemo(() => {
|
|
165
|
+
return context.viewports[viewportName] as HTMLElement | null | undefined
|
|
166
|
+
}, [context.viewports, viewportName])
|
|
167
|
+
|
|
167
168
|
const handleClose = useEvent(() => {
|
|
168
169
|
if (!isPresent) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
170
|
+
// already removed from the react tree
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
// focus viewport if focus is within toast to read the remaining toast
|
|
174
|
+
// count to SR users and ensure focus isn't lost
|
|
175
|
+
if (isWeb) {
|
|
176
|
+
const isFocusInToast = (node as HTMLDivElement)?.contains(document.activeElement)
|
|
177
|
+
if (isFocusInToast) viewport?.focus()
|
|
178
|
+
}
|
|
178
179
|
onClose()
|
|
179
180
|
})
|
|
180
181
|
|
|
@@ -201,7 +202,7 @@ const ToastImpl = React.forwardRef<TamaguiElement, ToastImplProps>(
|
|
|
201
202
|
|
|
202
203
|
React.useEffect(() => {
|
|
203
204
|
if (!isWeb) return
|
|
204
|
-
|
|
205
|
+
|
|
205
206
|
if (viewport) {
|
|
206
207
|
viewport.addEventListener(VIEWPORT_PAUSE, handlePause)
|
|
207
208
|
viewport.addEventListener(VIEWPORT_RESUME, handleResume)
|
|
@@ -210,7 +211,7 @@ const ToastImpl = React.forwardRef<TamaguiElement, ToastImplProps>(
|
|
|
210
211
|
viewport.removeEventListener(VIEWPORT_RESUME, handleResume)
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
}, [
|
|
214
|
+
}, [viewport, duration, onPause, onResume, startTimer])
|
|
214
215
|
|
|
215
216
|
// start timer when toast opens or duration changes.
|
|
216
217
|
// we include `open` in deps because closed !== unmounted when animating
|
|
@@ -345,7 +346,6 @@ const ToastImpl = React.forwardRef<TamaguiElement, ToastImplProps>(
|
|
|
345
346
|
role="status"
|
|
346
347
|
aria-live="off"
|
|
347
348
|
aria-atomic
|
|
348
|
-
tabIndex={0}
|
|
349
349
|
data-state={open ? 'open' : 'closed'}
|
|
350
350
|
data-swipe-direction={context.swipeDirection}
|
|
351
351
|
pointerEvents="auto"
|
package/src/ToastProvider.tsx
CHANGED
|
@@ -24,8 +24,8 @@ type ToastProviderContextValue = {
|
|
|
24
24
|
swipeDirection: SwipeDirection
|
|
25
25
|
swipeThreshold: number
|
|
26
26
|
toastCount: number
|
|
27
|
-
|
|
28
|
-
onViewportChange(viewport: TamaguiElement): void
|
|
27
|
+
viewports: Record<string, TamaguiElement | null>
|
|
28
|
+
onViewportChange(name: string, viewport: TamaguiElement): void
|
|
29
29
|
onToastAdd(): void
|
|
30
30
|
onToastRemove(): void
|
|
31
31
|
isFocusedToastEscapeKeyDownRef: React.MutableRefObject<boolean>
|
|
@@ -97,11 +97,20 @@ const ToastProvider: React.FC<ToastProviderProps> = (
|
|
|
97
97
|
children,
|
|
98
98
|
} = props
|
|
99
99
|
const id = providedId ?? React.useId()
|
|
100
|
-
const [
|
|
100
|
+
const [viewports, setViewports] = React.useState<
|
|
101
|
+
ToastProviderContextValue['viewports']
|
|
102
|
+
>({})
|
|
101
103
|
const [toastCount, setToastCount] = React.useState(0)
|
|
102
104
|
const isFocusedToastEscapeKeyDownRef = React.useRef(false)
|
|
103
105
|
const isClosePausedRef = React.useRef(false)
|
|
104
106
|
|
|
107
|
+
const handleViewportChange = React.useCallback(
|
|
108
|
+
(name: string, viewport: TamaguiElement | null) => {
|
|
109
|
+
setViewports((prev) => ({ ...prev, [name]: viewport }))
|
|
110
|
+
},
|
|
111
|
+
[]
|
|
112
|
+
)
|
|
113
|
+
|
|
105
114
|
// memo context to avoid expensive re-renders
|
|
106
115
|
const options = React.useMemo(() => {
|
|
107
116
|
return {
|
|
@@ -123,8 +132,8 @@ const ToastProvider: React.FC<ToastProviderProps> = (
|
|
|
123
132
|
swipeDirection={swipeDirection}
|
|
124
133
|
swipeThreshold={swipeThreshold}
|
|
125
134
|
toastCount={toastCount}
|
|
126
|
-
|
|
127
|
-
onViewportChange={
|
|
135
|
+
viewports={viewports}
|
|
136
|
+
onViewportChange={handleViewportChange}
|
|
128
137
|
onToastAdd={React.useCallback(() => {
|
|
129
138
|
setToastCount((prevCount) => prevCount + 1)
|
|
130
139
|
}, [])}
|
package/src/ToastViewport.tsx
CHANGED
|
@@ -20,25 +20,46 @@ const VIEWPORT_RESUME = 'toast.viewportResume'
|
|
|
20
20
|
|
|
21
21
|
const ToastViewportWrapperFrame = styled(YStack, {
|
|
22
22
|
name: 'ViewportWrapper',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
|
|
24
|
+
variants: {
|
|
25
|
+
unstyled: {
|
|
26
|
+
false: {
|
|
27
|
+
pointerEvents: 'box-none',
|
|
28
|
+
top: 0,
|
|
29
|
+
bottom: 0,
|
|
30
|
+
left: 0,
|
|
31
|
+
right: 0,
|
|
32
|
+
position: isWeb ? ('fixed' as any) : 'absolute',
|
|
33
|
+
maxWidth: '100%',
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
zIndex: 100000,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
} as const,
|
|
39
|
+
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
unstyled: false,
|
|
42
|
+
},
|
|
33
43
|
})
|
|
34
44
|
|
|
35
45
|
const ToastViewportFrame = styled(YStack, {
|
|
36
46
|
name: VIEWPORT_NAME,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
|
|
48
|
+
variants: {
|
|
49
|
+
unstyled: {
|
|
50
|
+
false: {
|
|
51
|
+
pointerEvents: 'box-none',
|
|
52
|
+
position: isWeb ? ('fixed' as any) : 'absolute',
|
|
53
|
+
maxWidth: '100%',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
} as const,
|
|
57
|
+
|
|
58
|
+
defaultVariants: {
|
|
59
|
+
unstyled: false,
|
|
60
|
+
},
|
|
41
61
|
})
|
|
62
|
+
|
|
42
63
|
type ToastViewportFrameProps = GetProps<typeof ToastViewportFrame>
|
|
43
64
|
type ToastViewportProps = ToastViewportFrameProps & {
|
|
44
65
|
/**
|
|
@@ -68,7 +89,7 @@ const ToastViewport = React.forwardRef<HTMLDivElement, ToastViewportProps>(
|
|
|
68
89
|
__scopeToast,
|
|
69
90
|
hotkey = VIEWPORT_DEFAULT_HOTKEY,
|
|
70
91
|
label = 'Notifications ({hotkey})',
|
|
71
|
-
name,
|
|
92
|
+
name = 'default',
|
|
72
93
|
multipleToasts,
|
|
73
94
|
...viewportProps
|
|
74
95
|
} = props
|
|
@@ -78,7 +99,13 @@ const ToastViewport = React.forwardRef<HTMLDivElement, ToastViewportProps>(
|
|
|
78
99
|
const tailFocusProxyRef = React.useRef<FocusProxyElement>(null)
|
|
79
100
|
const wrapperRef = React.useRef<HTMLDivElement>(null)
|
|
80
101
|
const ref = React.useRef<HTMLDivElement>(null)
|
|
81
|
-
const
|
|
102
|
+
const onViewportChange = React.useCallback(
|
|
103
|
+
(el: TamaguiElement) => {
|
|
104
|
+
if (context.viewports[name] !== el) context.onViewportChange(name, el)
|
|
105
|
+
},
|
|
106
|
+
[name, context.viewports]
|
|
107
|
+
)
|
|
108
|
+
const composedRefs = useComposedRefs(forwardedRef, ref, onViewportChange)
|
|
82
109
|
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '')
|
|
83
110
|
const hasToasts = context.toastCount > 0
|
|
84
111
|
|
|
@@ -132,8 +159,8 @@ const ToastViewport = React.forwardRef<HTMLDivElement, ToastViewportProps>(
|
|
|
132
159
|
const isFocusInside = wrapper.contains(document.activeElement)
|
|
133
160
|
if (!isFocusInside) handleResume()
|
|
134
161
|
}
|
|
135
|
-
// Toasts are not in the viewport React tree so we need to bind DOM events
|
|
136
162
|
|
|
163
|
+
// Toasts are not in the viewport React tree so we need to bind DOM events
|
|
137
164
|
wrapper.addEventListener('focusin', handlePause)
|
|
138
165
|
wrapper.addEventListener('focusout', handleFocusOutResume)
|
|
139
166
|
wrapper.addEventListener('pointermove', handlePause)
|
|
@@ -232,6 +259,7 @@ const ToastViewport = React.forwardRef<HTMLDivElement, ToastViewportProps>(
|
|
|
232
259
|
>
|
|
233
260
|
{hasToasts && (
|
|
234
261
|
<FocusProxy
|
|
262
|
+
viewportName={name}
|
|
235
263
|
ref={headFocusProxyRef}
|
|
236
264
|
onFocusFromOutsideViewport={() => {
|
|
237
265
|
const tabbableCandidates = getSortedTabbableCandidates({
|
|
@@ -259,6 +287,7 @@ const ToastViewport = React.forwardRef<HTMLDivElement, ToastViewportProps>(
|
|
|
259
287
|
</Collection.Slot>
|
|
260
288
|
{hasToasts && (
|
|
261
289
|
<FocusProxy
|
|
290
|
+
viewportName={name}
|
|
262
291
|
ref={tailFocusProxyRef}
|
|
263
292
|
onFocusFromOutsideViewport={() => {
|
|
264
293
|
const tabbableCandidates = getSortedTabbableCandidates({
|
|
@@ -283,12 +312,15 @@ type FocusProxyElement = React.ElementRef<typeof VisuallyHidden>
|
|
|
283
312
|
type VisuallyHiddenProps = GetProps<typeof VisuallyHidden>
|
|
284
313
|
interface FocusProxyProps extends VisuallyHiddenProps {
|
|
285
314
|
onFocusFromOutsideViewport(): void
|
|
315
|
+
viewportName: string
|
|
286
316
|
}
|
|
287
317
|
|
|
288
318
|
const FocusProxy = React.forwardRef<FocusProxyElement, ScopedProps<FocusProxyProps>>(
|
|
289
319
|
(props, forwardedRef) => {
|
|
290
|
-
const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } =
|
|
320
|
+
const { __scopeToast, onFocusFromOutsideViewport, viewportName, ...proxyProps } =
|
|
321
|
+
props
|
|
291
322
|
const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast)
|
|
323
|
+
const viewport = context.viewports[viewportName] as HTMLElement
|
|
292
324
|
|
|
293
325
|
return (
|
|
294
326
|
<VisuallyHidden
|
|
@@ -301,9 +333,7 @@ const FocusProxy = React.forwardRef<FocusProxyElement, ScopedProps<FocusProxyPro
|
|
|
301
333
|
onFocus={(event) => {
|
|
302
334
|
if (!isWeb) return
|
|
303
335
|
const prevFocusedElement = event.relatedTarget as HTMLElement | null
|
|
304
|
-
const isFocusFromOutsideViewport = !
|
|
305
|
-
prevFocusedElement
|
|
306
|
-
)
|
|
336
|
+
const isFocusFromOutsideViewport = !viewport?.contains(prevFocusedElement)
|
|
307
337
|
if (isFocusFromOutsideViewport) onFocusFromOutsideViewport()
|
|
308
338
|
}}
|
|
309
339
|
/>
|
package/types/Toast.d.ts
CHANGED
|
@@ -4,60 +4,44 @@ import { ToastNativePlatform, ToastNativeValue, useToast, useToastController, us
|
|
|
4
4
|
import { ToastProps } from './ToastImpl';
|
|
5
5
|
import { ToastProvider, ToastProviderProps, createToastScope } from './ToastProvider';
|
|
6
6
|
import { ToastViewport, ToastViewportProps } from './ToastViewport';
|
|
7
|
-
declare const ToastTitleFrame: import("@tamagui/core").TamaguiComponent<
|
|
7
|
+
declare const ToastTitleFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
8
8
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
9
|
-
}
|
|
10
|
-
readonly
|
|
11
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
|
|
12
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
13
|
-
}>>) | (Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
14
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
15
|
-
}, string | number> & {
|
|
16
|
-
[x: string]: undefined;
|
|
9
|
+
}, "unstyled"> & {
|
|
10
|
+
readonly unstyled?: boolean | undefined;
|
|
17
11
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
18
12
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
19
|
-
},
|
|
20
|
-
|
|
13
|
+
}, "unstyled"> & {
|
|
14
|
+
readonly unstyled?: boolean | undefined;
|
|
21
15
|
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
22
16
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
27
|
-
} | ({
|
|
17
|
+
}, "unstyled"> & {
|
|
18
|
+
readonly unstyled?: boolean | undefined;
|
|
19
|
+
}>>, TamaguiElement, import("@tamagui/core").TextPropsBase, {
|
|
28
20
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
29
21
|
} & {
|
|
30
|
-
|
|
31
|
-
}
|
|
22
|
+
readonly unstyled?: boolean | undefined;
|
|
23
|
+
}, {
|
|
32
24
|
displayName: string | undefined;
|
|
33
25
|
}>;
|
|
34
26
|
type PrimitiveDivProps = GetProps<typeof ToastTitleFrame>;
|
|
35
27
|
type ToastTitleProps = PrimitiveDivProps & {};
|
|
36
|
-
declare const ToastDescriptionFrame: import("@tamagui/core").TamaguiComponent<
|
|
28
|
+
declare const ToastDescriptionFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
37
29
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
38
|
-
}
|
|
39
|
-
readonly
|
|
40
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
|
|
41
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
42
|
-
}>>) | (Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
43
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
44
|
-
}, string | number> & {
|
|
45
|
-
[x: string]: undefined;
|
|
30
|
+
}, "unstyled"> & {
|
|
31
|
+
readonly unstyled?: boolean | undefined;
|
|
46
32
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
47
33
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
48
|
-
},
|
|
49
|
-
|
|
34
|
+
}, "unstyled"> & {
|
|
35
|
+
readonly unstyled?: boolean | undefined;
|
|
50
36
|
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
51
37
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
56
|
-
} | ({
|
|
38
|
+
}, "unstyled"> & {
|
|
39
|
+
readonly unstyled?: boolean | undefined;
|
|
40
|
+
}>>, TamaguiElement, import("@tamagui/core").TextPropsBase, {
|
|
57
41
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
58
42
|
} & {
|
|
59
|
-
|
|
60
|
-
}
|
|
43
|
+
readonly unstyled?: boolean | undefined;
|
|
44
|
+
}, {
|
|
61
45
|
displayName: string | undefined;
|
|
62
46
|
}>;
|
|
63
47
|
type ToastDescriptionFrameProps = GetProps<typeof ToastDescriptionFrame>;
|
|
@@ -182,52 +166,40 @@ declare const ToastCloseFrame: import("@tamagui/core").TamaguiComponent<(Omit<im
|
|
|
182
166
|
readonly bordered?: number | boolean | undefined;
|
|
183
167
|
readonly transparent?: boolean | undefined;
|
|
184
168
|
readonly chromeless?: boolean | "all" | undefined;
|
|
185
|
-
} &
|
|
169
|
+
} & {
|
|
186
170
|
[x: string]: undefined;
|
|
187
|
-
}
|
|
171
|
+
}, {
|
|
188
172
|
displayName: string | undefined;
|
|
189
173
|
}>;
|
|
190
174
|
type ToastCloseFrameProps = GetProps<typeof ToastCloseFrame>;
|
|
191
175
|
type ToastCloseProps = ToastCloseFrameProps & {};
|
|
192
176
|
declare const Toast: ((props: Omit<ToastProps & React.RefAttributes<TamaguiElement>, "theme" | "themeInverse"> & import("@tamagui/core").ThemeableProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & {
|
|
193
|
-
Title: React.ForwardRefExoticComponent<
|
|
194
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
195
|
-
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
|
|
196
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
197
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
|
|
177
|
+
Title: React.ForwardRefExoticComponent<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
198
178
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
199
|
-
}
|
|
200
|
-
readonly
|
|
201
|
-
}, string | number> & {
|
|
202
|
-
[x: string]: undefined;
|
|
179
|
+
}, "unstyled"> & {
|
|
180
|
+
readonly unstyled?: boolean | undefined;
|
|
203
181
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
204
182
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
205
|
-
},
|
|
206
|
-
|
|
183
|
+
}, "unstyled"> & {
|
|
184
|
+
readonly unstyled?: boolean | undefined;
|
|
207
185
|
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
208
186
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
Description: React.ForwardRefExoticComponent<
|
|
187
|
+
}, "unstyled"> & {
|
|
188
|
+
readonly unstyled?: boolean | undefined;
|
|
189
|
+
}>> & React.RefAttributes<TamaguiElement>>;
|
|
190
|
+
Description: React.ForwardRefExoticComponent<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
213
191
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
214
|
-
}
|
|
215
|
-
readonly
|
|
216
|
-
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
|
|
217
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
218
|
-
}>>) | Omit<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
219
|
-
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
220
|
-
}, string | number> & {
|
|
221
|
-
[x: string]: undefined;
|
|
192
|
+
}, "unstyled"> & {
|
|
193
|
+
readonly unstyled?: boolean | undefined;
|
|
222
194
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
223
195
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
224
|
-
},
|
|
225
|
-
|
|
196
|
+
}, "unstyled"> & {
|
|
197
|
+
readonly unstyled?: boolean | undefined;
|
|
226
198
|
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/core").ExtendsBaseTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
|
|
227
199
|
readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
}
|
|
200
|
+
}, "unstyled"> & {
|
|
201
|
+
readonly unstyled?: boolean | undefined;
|
|
202
|
+
}>> & React.RefAttributes<TamaguiElement>>;
|
|
231
203
|
Action: React.ForwardRefExoticComponent<((Omit<import("react-native").ViewProps, "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{
|
|
232
204
|
readonly fullscreen?: boolean | undefined;
|
|
233
205
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
package/types/Toast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../src/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EAMf,MAAM,eAAe,CAAA;AAItB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACd,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAGL,UAAU,EAEX,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQnE,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../src/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EAMf,MAAM,eAAe,CAAA;AAItB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QANf;;;;;WAKG;iBACM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GhB,CAAA;AAID,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EAEb,gBAAgB,EAEhB,QAAQ,EACR,kBAAkB,EAClB,aAAa,GACd,CAAA;AACD,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAElB,gBAAgB,EAChB,mBAAmB,GACpB,CAAA"}
|
package/types/ToastAnnounce.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const ToastAnnounceExcludeFrame: import("@tamagui/core").TamaguiComponen
|
|
|
8
8
|
[x: string]: undefined;
|
|
9
9
|
}>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, string | number> & {
|
|
10
10
|
[x: string]: undefined;
|
|
11
|
-
}>>), TamaguiElement, Omit<import("react-native").ViewProps, "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps, {
|
|
11
|
+
}>>), TamaguiElement, Omit<import("react-native").ViewProps, "children" | "display" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps, {
|
|
12
12
|
[x: string]: undefined;
|
|
13
13
|
}, {
|
|
14
14
|
displayName: string | undefined;
|
|
@@ -9,17 +9,26 @@ interface ToastImperativeOptions extends Omit<CreateNativeToastOptions, 'message
|
|
|
9
9
|
interface ShowOptions extends CreateNativeToastOptions {
|
|
10
10
|
/**
|
|
11
11
|
* Used when need custom data
|
|
12
|
+
* @deprecated Use `customData` instead
|
|
12
13
|
*/
|
|
13
14
|
additionalInfo?: Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Used when need custom data
|
|
17
|
+
*/
|
|
18
|
+
customData?: Record<string, any>;
|
|
14
19
|
/**
|
|
15
20
|
* Overrides the native option on `ToastImperativeProvider`
|
|
16
21
|
*/
|
|
17
22
|
native?: ToastNativeValue;
|
|
23
|
+
/**
|
|
24
|
+
* Which viewport to send this toast to. This is only intended to be used with custom toasts and you should wire it up when creating the toast.
|
|
25
|
+
*/
|
|
26
|
+
viewportName?: string | 'default';
|
|
18
27
|
}
|
|
19
28
|
type ToastData = {
|
|
20
29
|
title: string;
|
|
21
30
|
id: string;
|
|
22
|
-
} &
|
|
31
|
+
} & ShowOptions & {
|
|
23
32
|
isHandledNatively: boolean;
|
|
24
33
|
};
|
|
25
34
|
interface ToastContextI {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastImperative.d.ts","sourceRoot":"","sources":["../src/ToastImperative.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqD,MAAM,OAAO,CAAA;AAIzE,OAAO,EACL,w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