@tamagui/toast 2.0.0-rc.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Toast.cjs +149 -141
- package/dist/cjs/Toast.native.js +149 -142
- package/dist/cjs/Toast.native.js.map +1 -1
- package/dist/cjs/ToastAnnounce.cjs +78 -72
- package/dist/cjs/ToastAnnounce.native.js +85 -79
- package/dist/cjs/ToastAnnounce.native.js.map +1 -1
- package/dist/cjs/ToastComposable.cjs +780 -591
- package/dist/cjs/ToastComposable.native.js +863 -706
- package/dist/cjs/ToastComposable.native.js.map +1 -1
- package/dist/cjs/ToastImperative.cjs +99 -80
- package/dist/cjs/ToastImperative.native.js +104 -96
- package/dist/cjs/ToastImperative.native.js.map +1 -1
- package/dist/cjs/ToastImpl.cjs +300 -238
- package/dist/cjs/ToastImpl.native.js +309 -271
- package/dist/cjs/ToastImpl.native.js.map +1 -1
- package/dist/cjs/ToastItemFrame.cjs +143 -0
- package/dist/cjs/ToastItemFrame.native.js +148 -0
- package/dist/cjs/ToastItemFrame.native.js.map +1 -0
- package/dist/cjs/ToastPortal.cjs +23 -18
- package/dist/cjs/ToastPortal.native.js +27 -22
- package/dist/cjs/ToastPortal.native.js.map +1 -1
- package/dist/cjs/ToastProvider.cjs +102 -98
- package/dist/cjs/ToastProvider.native.js +108 -106
- package/dist/cjs/ToastProvider.native.js.map +1 -1
- package/dist/cjs/ToastState.cjs +218 -155
- package/dist/cjs/ToastState.native.js +270 -203
- package/dist/cjs/ToastState.native.js.map +1 -1
- package/dist/cjs/ToastViewport.cjs +274 -233
- package/dist/cjs/ToastViewport.native.js +301 -273
- package/dist/cjs/ToastViewport.native.js.map +1 -1
- package/dist/cjs/Toaster.cjs +71 -233
- package/dist/cjs/Toaster.native.js +72 -289
- package/dist/cjs/Toaster.native.js.map +1 -1
- package/dist/cjs/constants.cjs +14 -12
- package/dist/cjs/constants.native.js +14 -12
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/createNativeToast.cjs +43 -35
- package/dist/cjs/createNativeToast.native.js +42 -30
- package/dist/cjs/createNativeToast.native.js.map +1 -1
- package/dist/cjs/dispatchNativeToast.cjs +47 -0
- package/dist/cjs/dispatchNativeToast.native.js +52 -0
- package/dist/cjs/dispatchNativeToast.native.js.map +1 -0
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/useAnimatedDragGesture.cjs +184 -83
- package/dist/cjs/useAnimatedDragGesture.native.js +193 -79
- package/dist/cjs/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/cjs/useReducedMotion.cjs +44 -30
- package/dist/cjs/useReducedMotion.native.js +52 -43
- package/dist/cjs/useReducedMotion.native.js.map +1 -1
- package/dist/cjs/useToastAnimations.cjs +233 -155
- package/dist/cjs/useToastAnimations.native.js +246 -170
- package/dist/cjs/useToastAnimations.native.js.map +1 -1
- package/dist/cjs/v2.cjs +36 -0
- package/dist/cjs/v2.native.js +39 -0
- package/dist/cjs/v2.native.js.map +1 -0
- package/dist/esm/Toast.mjs +112 -106
- package/dist/esm/Toast.mjs.map +1 -1
- package/dist/esm/Toast.native.js +112 -107
- package/dist/esm/Toast.native.js.map +1 -1
- package/dist/esm/ToastAnnounce.mjs +46 -42
- package/dist/esm/ToastAnnounce.mjs.map +1 -1
- package/dist/esm/ToastAnnounce.native.js +52 -48
- package/dist/esm/ToastAnnounce.native.js.map +1 -1
- package/dist/esm/ToastComposable.mjs +742 -555
- package/dist/esm/ToastComposable.mjs.map +1 -1
- package/dist/esm/ToastComposable.native.js +825 -670
- package/dist/esm/ToastComposable.native.js.map +1 -1
- package/dist/esm/ToastImperative.mjs +71 -54
- package/dist/esm/ToastImperative.mjs.map +1 -1
- package/dist/esm/ToastImperative.native.js +76 -70
- package/dist/esm/ToastImperative.native.js.map +1 -1
- package/dist/esm/ToastImpl.mjs +261 -201
- package/dist/esm/ToastImpl.mjs.map +1 -1
- package/dist/esm/ToastImpl.native.js +270 -234
- package/dist/esm/ToastImpl.native.js.map +1 -1
- package/dist/esm/ToastItemFrame.mjs +114 -0
- package/dist/esm/ToastItemFrame.mjs.map +1 -0
- package/dist/esm/ToastItemFrame.native.js +116 -0
- package/dist/esm/ToastItemFrame.native.js.map +1 -0
- package/dist/esm/ToastPortal.mjs +8 -5
- package/dist/esm/ToastPortal.mjs.map +1 -1
- package/dist/esm/ToastPortal.native.js +12 -9
- package/dist/esm/ToastPortal.native.js.map +1 -1
- package/dist/esm/ToastProvider.mjs +71 -69
- package/dist/esm/ToastProvider.mjs.map +1 -1
- package/dist/esm/ToastProvider.native.js +77 -77
- package/dist/esm/ToastProvider.native.js.map +1 -1
- package/dist/esm/ToastState.mjs +205 -144
- package/dist/esm/ToastState.mjs.map +1 -1
- package/dist/esm/ToastState.native.js +258 -193
- package/dist/esm/ToastState.native.js.map +1 -1
- package/dist/esm/ToastViewport.mjs +238 -199
- package/dist/esm/ToastViewport.mjs.map +1 -1
- package/dist/esm/ToastViewport.native.js +265 -239
- package/dist/esm/ToastViewport.native.js.map +1 -1
- package/dist/esm/Toaster.mjs +45 -209
- package/dist/esm/Toaster.mjs.map +1 -1
- package/dist/esm/Toaster.native.js +46 -265
- package/dist/esm/Toaster.native.js.map +1 -1
- package/dist/esm/constants.mjs +2 -2
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +2 -2
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/createNativeToast.mjs +29 -24
- package/dist/esm/createNativeToast.mjs.map +1 -1
- package/dist/esm/createNativeToast.native.js +27 -18
- package/dist/esm/createNativeToast.native.js.map +1 -1
- package/dist/esm/dispatchNativeToast.mjs +22 -0
- package/dist/esm/dispatchNativeToast.mjs.map +1 -0
- package/dist/esm/dispatchNativeToast.native.js +24 -0
- package/dist/esm/dispatchNativeToast.native.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useAnimatedDragGesture.mjs +160 -61
- package/dist/esm/useAnimatedDragGesture.mjs.map +1 -1
- package/dist/esm/useAnimatedDragGesture.native.js +167 -55
- package/dist/esm/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/esm/useReducedMotion.mjs +18 -6
- package/dist/esm/useReducedMotion.mjs.map +1 -1
- package/dist/esm/useReducedMotion.native.js +25 -18
- package/dist/esm/useReducedMotion.native.js.map +1 -1
- package/dist/esm/useToastAnimations.mjs +206 -130
- package/dist/esm/useToastAnimations.mjs.map +1 -1
- package/dist/esm/useToastAnimations.native.js +218 -144
- package/dist/esm/useToastAnimations.native.js.map +1 -1
- package/dist/esm/v2.mjs +6 -0
- package/dist/esm/v2.mjs.map +1 -0
- package/dist/esm/v2.native.js +6 -0
- package/dist/esm/v2.native.js.map +1 -0
- package/dist/jsx/Toast.mjs +112 -106
- package/dist/jsx/Toast.mjs.map +1 -1
- package/dist/jsx/Toast.native.js +149 -142
- package/dist/jsx/Toast.native.js.map +1 -1
- package/dist/jsx/ToastAnnounce.mjs +46 -42
- package/dist/jsx/ToastAnnounce.mjs.map +1 -1
- package/dist/jsx/ToastAnnounce.native.js +85 -79
- package/dist/jsx/ToastAnnounce.native.js.map +1 -1
- package/dist/jsx/ToastComposable.mjs +742 -555
- package/dist/jsx/ToastComposable.mjs.map +1 -1
- package/dist/jsx/ToastComposable.native.js +863 -706
- package/dist/jsx/ToastComposable.native.js.map +1 -1
- package/dist/jsx/ToastImperative.mjs +71 -54
- package/dist/jsx/ToastImperative.mjs.map +1 -1
- package/dist/jsx/ToastImperative.native.js +104 -96
- package/dist/jsx/ToastImperative.native.js.map +1 -1
- package/dist/jsx/ToastImpl.mjs +261 -201
- package/dist/jsx/ToastImpl.mjs.map +1 -1
- package/dist/jsx/ToastImpl.native.js +309 -271
- package/dist/jsx/ToastImpl.native.js.map +1 -1
- package/dist/jsx/ToastItemFrame.mjs +114 -0
- package/dist/jsx/ToastItemFrame.mjs.map +1 -0
- package/dist/jsx/ToastItemFrame.native.js +148 -0
- package/dist/jsx/ToastItemFrame.native.js.map +1 -0
- package/dist/jsx/ToastPortal.mjs +8 -5
- package/dist/jsx/ToastPortal.mjs.map +1 -1
- package/dist/jsx/ToastPortal.native.js +27 -22
- package/dist/jsx/ToastPortal.native.js.map +1 -1
- package/dist/jsx/ToastProvider.mjs +71 -69
- package/dist/jsx/ToastProvider.mjs.map +1 -1
- package/dist/jsx/ToastProvider.native.js +108 -106
- package/dist/jsx/ToastProvider.native.js.map +1 -1
- package/dist/jsx/ToastState.mjs +205 -144
- package/dist/jsx/ToastState.mjs.map +1 -1
- package/dist/jsx/ToastState.native.js +270 -203
- package/dist/jsx/ToastState.native.js.map +1 -1
- package/dist/jsx/ToastViewport.mjs +238 -199
- package/dist/jsx/ToastViewport.mjs.map +1 -1
- package/dist/jsx/ToastViewport.native.js +301 -273
- package/dist/jsx/ToastViewport.native.js.map +1 -1
- package/dist/jsx/Toaster.mjs +45 -209
- package/dist/jsx/Toaster.mjs.map +1 -1
- package/dist/jsx/Toaster.native.js +72 -289
- package/dist/jsx/Toaster.native.js.map +1 -1
- package/dist/jsx/constants.mjs +2 -2
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.js +14 -12
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/createNativeToast.mjs +29 -24
- package/dist/jsx/createNativeToast.mjs.map +1 -1
- package/dist/jsx/createNativeToast.native.js +42 -30
- package/dist/jsx/createNativeToast.native.js.map +1 -1
- package/dist/jsx/dispatchNativeToast.mjs +22 -0
- package/dist/jsx/dispatchNativeToast.mjs.map +1 -0
- package/dist/jsx/dispatchNativeToast.native.js +52 -0
- package/dist/jsx/dispatchNativeToast.native.js.map +1 -0
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -6
- package/dist/jsx/index.native.js +7 -5
- package/dist/jsx/types.native.js +7 -5
- package/dist/jsx/useAnimatedDragGesture.mjs +160 -61
- package/dist/jsx/useAnimatedDragGesture.mjs.map +1 -1
- package/dist/jsx/useAnimatedDragGesture.native.js +193 -79
- package/dist/jsx/useAnimatedDragGesture.native.js.map +1 -1
- package/dist/jsx/useReducedMotion.mjs +18 -6
- package/dist/jsx/useReducedMotion.mjs.map +1 -1
- package/dist/jsx/useReducedMotion.native.js +52 -43
- package/dist/jsx/useReducedMotion.native.js.map +1 -1
- package/dist/jsx/useToastAnimations.mjs +206 -130
- package/dist/jsx/useToastAnimations.mjs.map +1 -1
- package/dist/jsx/useToastAnimations.native.js +246 -170
- package/dist/jsx/useToastAnimations.native.js.map +1 -1
- package/dist/jsx/v2.mjs +6 -0
- package/dist/jsx/v2.mjs.map +1 -0
- package/dist/jsx/v2.native.js +39 -0
- package/dist/jsx/v2.native.js.map +1 -0
- package/package.json +42 -29
- package/src/ToastComposable.tsx +1380 -0
- package/src/ToastImpl.tsx +14 -2
- package/src/ToastItemFrame.tsx +136 -0
- package/src/ToastPortal.tsx +2 -2
- package/src/ToastProvider.tsx +8 -1
- package/src/ToastState.ts +398 -0
- package/src/ToastViewport.tsx +4 -3
- package/src/Toaster.tsx +181 -0
- package/src/createNativeToast.native.tsx +4 -0
- package/src/createNativeToast.tsx +18 -24
- package/src/dispatchNativeToast.ts +43 -0
- package/src/useAnimatedDragGesture.native.ts +255 -0
- package/src/useAnimatedDragGesture.ts +319 -0
- package/src/useReducedMotion.ts +59 -0
- package/src/useToastAnimations.ts +372 -0
- package/src/v2.ts +31 -0
- package/types/ToastComposable.d.ts +199 -0
- package/types/ToastComposable.d.ts.map +1 -1
- package/types/ToastImpl.d.ts.map +1 -1
- package/types/ToastItemFrame.d.ts +25 -0
- package/types/ToastItemFrame.d.ts.map +1 -0
- package/types/ToastPortal.d.ts.map +1 -1
- package/types/ToastProvider.d.ts +1 -1
- package/types/ToastProvider.d.ts.map +1 -1
- package/types/ToastState.d.ts +179 -0
- package/types/ToastState.d.ts.map +1 -1
- package/types/ToastViewport.d.ts.map +1 -1
- package/types/Toaster.d.ts +112 -0
- package/types/Toaster.d.ts.map +1 -1
- package/types/createNativeToast.d.ts +5 -0
- package/types/createNativeToast.d.ts.map +1 -1
- package/types/createNativeToast.native.d.ts +1 -0
- package/types/createNativeToast.native.d.ts.map +1 -1
- package/types/dispatchNativeToast.d.ts +12 -0
- package/types/dispatchNativeToast.d.ts.map +1 -0
- package/types/useAnimatedDragGesture.d.ts +33 -0
- package/types/useAnimatedDragGesture.d.ts.map +1 -1
- package/types/useAnimatedDragGesture.native.d.ts +33 -0
- package/types/useAnimatedDragGesture.native.d.ts.map +1 -1
- package/types/useReducedMotion.d.ts +6 -0
- package/types/useToastAnimations.d.ts +50 -0
- package/types/useToastAnimations.d.ts.map +1 -1
- package/types/v2.d.ts +10 -0
- package/types/v2.d.ts.map +1 -0
- package/v2/index.cjs +2 -0
- package/v2/index.js +2 -0
- package/v2/index.native.cjs +2 -0
- package/v2/index.native.js +2 -0
- package/LICENSE +0 -21
- package/dist/cjs/Toast.js +0 -119
- package/dist/cjs/Toast.js.map +0 -6
- package/dist/cjs/ToastAnnounce.js +0 -72
- package/dist/cjs/ToastAnnounce.js.map +0 -6
- package/dist/cjs/ToastComposable.js +0 -548
- package/dist/cjs/ToastComposable.js.map +0 -6
- package/dist/cjs/ToastImperative.js +0 -71
- package/dist/cjs/ToastImperative.js.map +0 -6
- package/dist/cjs/ToastImpl.js +0 -227
- package/dist/cjs/ToastImpl.js.map +0 -6
- package/dist/cjs/ToastItem.cjs +0 -526
- package/dist/cjs/ToastItem.js +0 -409
- package/dist/cjs/ToastItem.js.map +0 -6
- package/dist/cjs/ToastItem.native.js +0 -614
- package/dist/cjs/ToastItem.native.js.map +0 -1
- package/dist/cjs/ToastPortal.js +0 -26
- package/dist/cjs/ToastPortal.js.map +0 -6
- package/dist/cjs/ToastProvider.js +0 -105
- package/dist/cjs/ToastProvider.js.map +0 -6
- package/dist/cjs/ToastState.js +0 -160
- package/dist/cjs/ToastState.js.map +0 -6
- package/dist/cjs/ToastViewport.js +0 -263
- package/dist/cjs/ToastViewport.js.map +0 -6
- package/dist/cjs/Toaster.js +0 -204
- package/dist/cjs/Toaster.js.map +0 -6
- package/dist/cjs/constants.js +0 -22
- package/dist/cjs/constants.js.map +0 -6
- package/dist/cjs/createNativeToast.js +0 -44
- package/dist/cjs/createNativeToast.js.map +0 -6
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/useAnimatedDragGesture.js +0 -97
- package/dist/cjs/useAnimatedDragGesture.js.map +0 -6
- package/dist/cjs/useDragGesture.cjs +0 -129
- package/dist/cjs/useDragGesture.js +0 -100
- package/dist/cjs/useDragGesture.js.map +0 -6
- package/dist/cjs/useDragGesture.native.js +0 -146
- package/dist/cjs/useDragGesture.native.js.map +0 -1
- package/dist/cjs/useReducedMotion.js +0 -53
- package/dist/cjs/useReducedMotion.js.map +0 -6
- package/dist/cjs/useToastAnimations.js +0 -144
- package/dist/cjs/useToastAnimations.js.map +0 -6
- package/dist/cjs/v1.cjs +0 -31
- package/dist/cjs/v1.js +0 -26
- package/dist/cjs/v1.js.map +0 -6
- package/dist/cjs/v1.native.js +0 -34
- package/dist/cjs/v1.native.js.map +0 -1
- package/dist/esm/Toast.js +0 -107
- package/dist/esm/Toast.js.map +0 -6
- package/dist/esm/ToastAnnounce.js +0 -55
- package/dist/esm/ToastAnnounce.js.map +0 -6
- package/dist/esm/ToastComposable.js +0 -543
- package/dist/esm/ToastComposable.js.map +0 -6
- package/dist/esm/ToastImperative.js +0 -50
- package/dist/esm/ToastImperative.js.map +0 -6
- package/dist/esm/ToastImpl.js +0 -225
- package/dist/esm/ToastImpl.js.map +0 -6
- package/dist/esm/ToastItem.js +0 -393
- package/dist/esm/ToastItem.js.map +0 -6
- package/dist/esm/ToastItem.mjs +0 -492
- package/dist/esm/ToastItem.mjs.map +0 -1
- package/dist/esm/ToastItem.native.js +0 -577
- package/dist/esm/ToastItem.native.js.map +0 -1
- package/dist/esm/ToastPortal.js +0 -13
- package/dist/esm/ToastPortal.js.map +0 -6
- package/dist/esm/ToastProvider.js +0 -87
- package/dist/esm/ToastProvider.js.map +0 -6
- package/dist/esm/ToastState.js +0 -144
- package/dist/esm/ToastState.js.map +0 -6
- package/dist/esm/ToastViewport.js +0 -250
- package/dist/esm/ToastViewport.js.map +0 -6
- package/dist/esm/Toaster.js +0 -188
- package/dist/esm/Toaster.js.map +0 -6
- package/dist/esm/constants.js +0 -6
- package/dist/esm/constants.js.map +0 -6
- package/dist/esm/createNativeToast.js +0 -28
- package/dist/esm/createNativeToast.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/useAnimatedDragGesture.js +0 -73
- package/dist/esm/useAnimatedDragGesture.js.map +0 -6
- package/dist/esm/useDragGesture.js +0 -76
- package/dist/esm/useDragGesture.js.map +0 -6
- package/dist/esm/useDragGesture.mjs +0 -95
- package/dist/esm/useDragGesture.mjs.map +0 -1
- package/dist/esm/useDragGesture.native.js +0 -109
- package/dist/esm/useDragGesture.native.js.map +0 -1
- package/dist/esm/useReducedMotion.js +0 -30
- package/dist/esm/useReducedMotion.js.map +0 -6
- package/dist/esm/useToastAnimations.js +0 -122
- package/dist/esm/useToastAnimations.js.map +0 -6
- package/dist/esm/v1.js +0 -17
- package/dist/esm/v1.js.map +0 -6
- package/dist/esm/v1.mjs +0 -3
- package/dist/esm/v1.mjs.map +0 -1
- package/dist/esm/v1.native.js +0 -3
- package/dist/esm/v1.native.js.map +0 -1
- package/dist/jsx/Toast.js +0 -107
- package/dist/jsx/Toast.js.map +0 -6
- package/dist/jsx/ToastAnnounce.js +0 -55
- package/dist/jsx/ToastAnnounce.js.map +0 -6
- package/dist/jsx/ToastComposable.js +0 -543
- package/dist/jsx/ToastComposable.js.map +0 -6
- package/dist/jsx/ToastImperative.js +0 -50
- package/dist/jsx/ToastImperative.js.map +0 -6
- package/dist/jsx/ToastImpl.js +0 -225
- package/dist/jsx/ToastImpl.js.map +0 -6
- package/dist/jsx/ToastItem.js +0 -393
- package/dist/jsx/ToastItem.js.map +0 -6
- package/dist/jsx/ToastItem.mjs +0 -492
- package/dist/jsx/ToastItem.mjs.map +0 -1
- package/dist/jsx/ToastItem.native.js +0 -614
- package/dist/jsx/ToastItem.native.js.map +0 -1
- package/dist/jsx/ToastPortal.js +0 -13
- package/dist/jsx/ToastPortal.js.map +0 -6
- package/dist/jsx/ToastProvider.js +0 -87
- package/dist/jsx/ToastProvider.js.map +0 -6
- package/dist/jsx/ToastState.js +0 -144
- package/dist/jsx/ToastState.js.map +0 -6
- package/dist/jsx/ToastViewport.js +0 -250
- package/dist/jsx/ToastViewport.js.map +0 -6
- package/dist/jsx/Toaster.js +0 -188
- package/dist/jsx/Toaster.js.map +0 -6
- package/dist/jsx/constants.js +0 -6
- package/dist/jsx/constants.js.map +0 -6
- package/dist/jsx/createNativeToast.js +0 -28
- package/dist/jsx/createNativeToast.js.map +0 -6
- package/dist/jsx/types.js +0 -1
- package/dist/jsx/types.js.map +0 -6
- package/dist/jsx/useAnimatedDragGesture.js +0 -73
- package/dist/jsx/useAnimatedDragGesture.js.map +0 -6
- package/dist/jsx/useDragGesture.js +0 -76
- package/dist/jsx/useDragGesture.js.map +0 -6
- package/dist/jsx/useDragGesture.mjs +0 -95
- package/dist/jsx/useDragGesture.mjs.map +0 -1
- package/dist/jsx/useDragGesture.native.js +0 -146
- package/dist/jsx/useDragGesture.native.js.map +0 -1
- package/dist/jsx/useReducedMotion.js +0 -30
- package/dist/jsx/useReducedMotion.js.map +0 -6
- package/dist/jsx/useToastAnimations.js +0 -122
- package/dist/jsx/useToastAnimations.js.map +0 -6
- package/dist/jsx/v1.js +0 -17
- package/dist/jsx/v1.js.map +0 -6
- package/dist/jsx/v1.mjs +0 -3
- package/dist/jsx/v1.mjs.map +0 -1
- package/dist/jsx/v1.native.js +0 -34
- package/dist/jsx/v1.native.js.map +0 -1
- package/types/ToastItem.d.ts.map +0 -1
- package/types/useDragGesture.d.ts.map +0 -1
- package/types/useDragGesture.native.d.ts.map +0 -1
- package/types/v1.d.ts.map +0 -1
package/dist/cjs/ToastItem.cjs
DELETED
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: !0
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
-
value: mod,
|
|
27
|
-
enumerable: !0
|
|
28
|
-
}) : target, mod)),
|
|
29
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
-
value: !0
|
|
31
|
-
}), mod);
|
|
32
|
-
var ToastItem_exports = {};
|
|
33
|
-
__export(ToastItem_exports, {
|
|
34
|
-
ToastItem: () => ToastItem
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(ToastItem_exports);
|
|
37
|
-
var import_constants = require("@tamagui/constants"),
|
|
38
|
-
import_core = require("@tamagui/core"),
|
|
39
|
-
import_stacks = require("@tamagui/stacks"),
|
|
40
|
-
import_text = require("@tamagui/text"),
|
|
41
|
-
React = __toESM(require("react"), 1),
|
|
42
|
-
import_useAnimatedDragGesture = require("./useAnimatedDragGesture.cjs"),
|
|
43
|
-
import_useToastAnimations = require("./useToastAnimations.cjs"),
|
|
44
|
-
import_createNativeToast = require("./createNativeToast.cjs"),
|
|
45
|
-
import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
-
const TIME_BEFORE_UNMOUNT = 200;
|
|
47
|
-
function DragWrapper({
|
|
48
|
-
isWeb: isWebProp,
|
|
49
|
-
animatedStyle,
|
|
50
|
-
gestureHandlers,
|
|
51
|
-
AnimatedView,
|
|
52
|
-
dragRef,
|
|
53
|
-
children
|
|
54
|
-
}) {
|
|
55
|
-
return isWebProp ? /* @__PURE__ */(0, import_jsx_runtime.jsx)("div", {
|
|
56
|
-
ref: dragRef,
|
|
57
|
-
style: {
|
|
58
|
-
flex: 1,
|
|
59
|
-
display: "flex",
|
|
60
|
-
flexDirection: "column",
|
|
61
|
-
// prevent text selection during drag
|
|
62
|
-
userSelect: "none",
|
|
63
|
-
WebkitUserSelect: "none",
|
|
64
|
-
// prevent touch scrolling interference
|
|
65
|
-
touchAction: "none",
|
|
66
|
-
// visual feedback that this is draggable
|
|
67
|
-
cursor: "grab"
|
|
68
|
-
},
|
|
69
|
-
...gestureHandlers,
|
|
70
|
-
children
|
|
71
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(AnimatedView, {
|
|
72
|
-
style: [{
|
|
73
|
-
flex: 1
|
|
74
|
-
}, animatedStyle],
|
|
75
|
-
...gestureHandlers,
|
|
76
|
-
children
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
const ToastPositionWrapper = (0, import_core.styled)(import_stacks.YStack, {
|
|
80
|
-
name: "ToastPositionWrapper",
|
|
81
|
-
pointerEvents: "auto",
|
|
82
|
-
position: "absolute",
|
|
83
|
-
left: 0,
|
|
84
|
-
right: 0,
|
|
85
|
-
// for stacking animation - default visible state
|
|
86
|
-
opacity: 1,
|
|
87
|
-
scale: 1,
|
|
88
|
-
y: 0,
|
|
89
|
-
x: 0
|
|
90
|
-
}),
|
|
91
|
-
ToastItemFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
92
|
-
name: "ToastItem",
|
|
93
|
-
// prevent text selection during drag - critical for gesture handling
|
|
94
|
-
userSelect: "none",
|
|
95
|
-
cursor: "grab",
|
|
96
|
-
focusable: !0,
|
|
97
|
-
variants: {
|
|
98
|
-
unstyled: {
|
|
99
|
-
false: {
|
|
100
|
-
backgroundColor: "$background",
|
|
101
|
-
borderRadius: "$4",
|
|
102
|
-
paddingHorizontal: "$4",
|
|
103
|
-
paddingVertical: "$3",
|
|
104
|
-
borderWidth: 1,
|
|
105
|
-
borderColor: "$borderColor",
|
|
106
|
-
shadowColor: "rgba(0, 0, 0, 0.15)",
|
|
107
|
-
shadowOffset: {
|
|
108
|
-
width: 0,
|
|
109
|
-
height: 4
|
|
110
|
-
},
|
|
111
|
-
shadowRadius: 12,
|
|
112
|
-
// sonner-style focus ring using outline
|
|
113
|
-
focusVisibleStyle: {
|
|
114
|
-
outlineWidth: 2,
|
|
115
|
-
outlineColor: "$color8",
|
|
116
|
-
outlineStyle: "solid"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
defaultVariants: {
|
|
122
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
125
|
-
ToastItemTitle = (0, import_core.styled)(import_text.SizableText, {
|
|
126
|
-
name: "ToastItemTitle",
|
|
127
|
-
variants: {
|
|
128
|
-
unstyled: {
|
|
129
|
-
false: {
|
|
130
|
-
fontWeight: "600",
|
|
131
|
-
color: "$color",
|
|
132
|
-
size: "$4"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
defaultVariants: {
|
|
137
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
138
|
-
}
|
|
139
|
-
}),
|
|
140
|
-
ToastItemDescription = (0, import_core.styled)(import_text.SizableText, {
|
|
141
|
-
name: "ToastItemDescription",
|
|
142
|
-
variants: {
|
|
143
|
-
unstyled: {
|
|
144
|
-
false: {
|
|
145
|
-
color: "$color11",
|
|
146
|
-
size: "$2",
|
|
147
|
-
marginTop: "$1"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
defaultVariants: {
|
|
152
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
153
|
-
}
|
|
154
|
-
}),
|
|
155
|
-
ToastCloseButton = (0, import_core.styled)(import_stacks.XStack, {
|
|
156
|
-
name: "ToastCloseButton",
|
|
157
|
-
render: "button",
|
|
158
|
-
alignItems: "center",
|
|
159
|
-
justifyContent: "center",
|
|
160
|
-
cursor: "pointer",
|
|
161
|
-
variants: {
|
|
162
|
-
unstyled: {
|
|
163
|
-
false: {
|
|
164
|
-
width: 20,
|
|
165
|
-
height: 20,
|
|
166
|
-
borderRadius: "$10",
|
|
167
|
-
backgroundColor: "$color5",
|
|
168
|
-
hoverStyle: {
|
|
169
|
-
backgroundColor: "$color6"
|
|
170
|
-
},
|
|
171
|
-
pressStyle: {
|
|
172
|
-
backgroundColor: "$color7"
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
defaultVariants: {
|
|
178
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
179
|
-
}
|
|
180
|
-
}),
|
|
181
|
-
ToastActionButton = (0, import_core.styled)(import_stacks.XStack, {
|
|
182
|
-
name: "ToastActionButton",
|
|
183
|
-
render: "button",
|
|
184
|
-
alignItems: "center",
|
|
185
|
-
justifyContent: "center",
|
|
186
|
-
cursor: "pointer",
|
|
187
|
-
variants: {
|
|
188
|
-
unstyled: {
|
|
189
|
-
false: {
|
|
190
|
-
borderRadius: "$2",
|
|
191
|
-
paddingHorizontal: "$2",
|
|
192
|
-
height: 24,
|
|
193
|
-
backgroundColor: "$color5",
|
|
194
|
-
hoverStyle: {
|
|
195
|
-
backgroundColor: "$color6"
|
|
196
|
-
},
|
|
197
|
-
pressStyle: {
|
|
198
|
-
backgroundColor: "$color7"
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
// primary action button style
|
|
203
|
-
primary: {
|
|
204
|
-
true: {
|
|
205
|
-
backgroundColor: "$color12",
|
|
206
|
-
hoverStyle: {
|
|
207
|
-
backgroundColor: "$color11"
|
|
208
|
-
},
|
|
209
|
-
pressStyle: {
|
|
210
|
-
backgroundColor: "$color10"
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
defaultVariants: {
|
|
216
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
217
|
-
}
|
|
218
|
-
}),
|
|
219
|
-
DefaultCloseIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
220
|
-
size: "$1",
|
|
221
|
-
color: "$color11",
|
|
222
|
-
children: "\u2715"
|
|
223
|
-
}),
|
|
224
|
-
DefaultSuccessIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
225
|
-
size: "$5",
|
|
226
|
-
color: "$green10",
|
|
227
|
-
children: "\u2713"
|
|
228
|
-
}),
|
|
229
|
-
DefaultErrorIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
230
|
-
size: "$5",
|
|
231
|
-
color: "$red10",
|
|
232
|
-
children: "\u2715"
|
|
233
|
-
}),
|
|
234
|
-
DefaultWarningIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
235
|
-
size: "$5",
|
|
236
|
-
color: "$yellow10",
|
|
237
|
-
children: "\u26A0"
|
|
238
|
-
}),
|
|
239
|
-
DefaultInfoIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
240
|
-
size: "$5",
|
|
241
|
-
color: "$blue10",
|
|
242
|
-
children: "\u2139"
|
|
243
|
-
}),
|
|
244
|
-
DefaultLoadingIcon = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
245
|
-
size: "$5",
|
|
246
|
-
color: "$color11",
|
|
247
|
-
children: "\u27F3"
|
|
248
|
-
}),
|
|
249
|
-
ToastItem = React.memo(function (props) {
|
|
250
|
-
const {
|
|
251
|
-
toast,
|
|
252
|
-
index,
|
|
253
|
-
expanded,
|
|
254
|
-
interacting,
|
|
255
|
-
position,
|
|
256
|
-
visibleToasts,
|
|
257
|
-
removeToast,
|
|
258
|
-
heights,
|
|
259
|
-
setHeights,
|
|
260
|
-
heightBeforeMe,
|
|
261
|
-
duration,
|
|
262
|
-
gap,
|
|
263
|
-
swipeDirection,
|
|
264
|
-
swipeThreshold,
|
|
265
|
-
closeButton,
|
|
266
|
-
icons,
|
|
267
|
-
disableNative,
|
|
268
|
-
burntOptions,
|
|
269
|
-
notificationOptions,
|
|
270
|
-
reducedMotion
|
|
271
|
-
} = props,
|
|
272
|
-
[mounted, setMounted] = React.useState(!1),
|
|
273
|
-
[removed, setRemoved] = React.useState(!1),
|
|
274
|
-
[swipeOut, setSwipeOut] = React.useState(!1),
|
|
275
|
-
toastRef = React.useRef(null),
|
|
276
|
-
closeTimerRef = React.useRef(null),
|
|
277
|
-
closeTimerStartRef = React.useRef(0),
|
|
278
|
-
lastPauseTimeRef = React.useRef(0),
|
|
279
|
-
remainingTimeRef = React.useRef(duration),
|
|
280
|
-
isFront = index === 0,
|
|
281
|
-
isVisible = index < visibleToasts,
|
|
282
|
-
toastType = toast.type ?? "default",
|
|
283
|
-
dismissible = toast.dismissible !== !1,
|
|
284
|
-
heightIndex = React.useMemo(() => heights.findIndex(h => h.toastId === toast.id) || 0, [heights, toast.id]),
|
|
285
|
-
toastsHeightBefore = React.useMemo(() => heights.reduce((prev, curr, reducerIndex) => reducerIndex >= heightIndex ? prev : prev + curr.height, 0), [heights, heightIndex]),
|
|
286
|
-
offset = heightIndex * gap + toastsHeightBefore,
|
|
287
|
-
[yPosition] = position.split("-"),
|
|
288
|
-
isTop = yPosition === "top";
|
|
289
|
-
React.useEffect(() => {
|
|
290
|
-
if (!disableNative && !import_constants.isWeb) {
|
|
291
|
-
const titleText = typeof toast.title == "function" ? toast.title() : toast.title,
|
|
292
|
-
descText = typeof toast.description == "function" ? toast.description() : toast.description;
|
|
293
|
-
typeof titleText == "string" && (0, import_createNativeToast.createNativeToast)(titleText, {
|
|
294
|
-
message: typeof descText == "string" ? descText : void 0,
|
|
295
|
-
duration,
|
|
296
|
-
burntOptions,
|
|
297
|
-
notificationOptions
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
}, []), React.useEffect(() => {
|
|
301
|
-
setMounted(!0);
|
|
302
|
-
}, []), React.useEffect(() => {
|
|
303
|
-
toast.delete && (setRemoved(!0), setTimeout(() => {
|
|
304
|
-
removeToast(toast);
|
|
305
|
-
}, TIME_BEFORE_UNMOUNT));
|
|
306
|
-
}, [toast.delete, toast, removeToast]);
|
|
307
|
-
const startTimer = React.useCallback(() => {
|
|
308
|
-
duration === Number.POSITIVE_INFINITY || toastType === "loading" || (closeTimerStartRef.current = Date.now(), closeTimerRef.current = setTimeout(() => {
|
|
309
|
-
toast.onAutoClose?.(toast), setRemoved(!0), setTimeout(() => {
|
|
310
|
-
removeToast(toast);
|
|
311
|
-
}, TIME_BEFORE_UNMOUNT);
|
|
312
|
-
}, remainingTimeRef.current));
|
|
313
|
-
}, [duration, toastType, toast, removeToast]),
|
|
314
|
-
pauseTimer = (0, import_core.useEvent)(() => {
|
|
315
|
-
if (closeTimerRef.current && clearTimeout(closeTimerRef.current), lastPauseTimeRef.current < closeTimerStartRef.current) {
|
|
316
|
-
const elapsed = Date.now() - closeTimerStartRef.current;
|
|
317
|
-
remainingTimeRef.current = Math.max(0, remainingTimeRef.current - elapsed);
|
|
318
|
-
}
|
|
319
|
-
lastPauseTimeRef.current = Date.now();
|
|
320
|
-
}),
|
|
321
|
-
resumeTimer = (0, import_core.useEvent)(() => {
|
|
322
|
-
startTimer();
|
|
323
|
-
});
|
|
324
|
-
React.useEffect(() => (expanded || interacting ? pauseTimer() : startTimer(), () => {
|
|
325
|
-
closeTimerRef.current && clearTimeout(closeTimerRef.current);
|
|
326
|
-
}), [expanded, interacting, startTimer]), React.useEffect(() => {
|
|
327
|
-
remainingTimeRef.current = duration;
|
|
328
|
-
}, [duration]);
|
|
329
|
-
const {
|
|
330
|
-
setDragOffset,
|
|
331
|
-
springBack,
|
|
332
|
-
animateOut,
|
|
333
|
-
animatedStyle,
|
|
334
|
-
AnimatedView,
|
|
335
|
-
dragRef
|
|
336
|
-
} = (0, import_useToastAnimations.useToastAnimations)({
|
|
337
|
-
reducedMotion
|
|
338
|
-
}),
|
|
339
|
-
{
|
|
340
|
-
isDragging,
|
|
341
|
-
gestureHandlers
|
|
342
|
-
} = (0, import_useAnimatedDragGesture.useAnimatedDragGesture)({
|
|
343
|
-
direction: swipeDirection,
|
|
344
|
-
threshold: swipeThreshold,
|
|
345
|
-
disabled: !dismissible || toastType === "loading",
|
|
346
|
-
expanded,
|
|
347
|
-
onDragStart: pauseTimer,
|
|
348
|
-
onDragMove: setDragOffset,
|
|
349
|
-
onDismiss: (exitDirection, velocity) => {
|
|
350
|
-
setSwipeOut(!0), toast.onDismiss?.(toast), setRemoved(!0), setHeights(prev => prev.filter(h => h.toastId !== toast.id)), animateOut(exitDirection, velocity, () => {
|
|
351
|
-
removeToast(toast);
|
|
352
|
-
});
|
|
353
|
-
},
|
|
354
|
-
onCancel: () => {
|
|
355
|
-
springBack(() => {
|
|
356
|
-
resumeTimer();
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}),
|
|
360
|
-
handleLayout = React.useCallback(event => {
|
|
361
|
-
const {
|
|
362
|
-
height
|
|
363
|
-
} = event.nativeEvent.layout;
|
|
364
|
-
setHeights(prev => prev.find(h => h.toastId === toast.id) ? prev.map(h => h.toastId === toast.id ? {
|
|
365
|
-
...h,
|
|
366
|
-
height
|
|
367
|
-
} : h) : [{
|
|
368
|
-
toastId: toast.id,
|
|
369
|
-
height,
|
|
370
|
-
position
|
|
371
|
-
}, ...prev]);
|
|
372
|
-
}, [toast.id, position, setHeights]);
|
|
373
|
-
React.useEffect(() => () => {
|
|
374
|
-
setHeights(prev => prev.filter(h => h.toastId !== toast.id));
|
|
375
|
-
}, [toast.id, setHeights]);
|
|
376
|
-
const handleClose = React.useCallback(() => {
|
|
377
|
-
dismissible && (toast.onDismiss?.(toast), setRemoved(!0), setTimeout(() => {
|
|
378
|
-
removeToast(toast);
|
|
379
|
-
}, TIME_BEFORE_UNMOUNT));
|
|
380
|
-
}, [dismissible, toast, removeToast]),
|
|
381
|
-
icon = toast.icon !== void 0 ? toast.icon : {
|
|
382
|
-
default: null,
|
|
383
|
-
success: icons?.success ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultSuccessIcon, {}),
|
|
384
|
-
error: icons?.error ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultErrorIcon, {}),
|
|
385
|
-
warning: icons?.warning ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultWarningIcon, {}),
|
|
386
|
-
info: icons?.info ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultInfoIcon, {}),
|
|
387
|
-
loading: icons?.loading ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultLoadingIcon, {})
|
|
388
|
-
}[toastType],
|
|
389
|
-
stackScale = !expanded && !isFront ? 1 - index * 0.05 : 1,
|
|
390
|
-
frontToastHeight = heights.length > 0 ? heights[0]?.height ?? 55 : 55,
|
|
391
|
-
expandedOffset = heightBeforeMe + index * gap,
|
|
392
|
-
liftPerToast = 10,
|
|
393
|
-
computedY = expanded ? isTop ? expandedOffset : -expandedOffset : isFront ? 0 : isTop ? liftPerToast * index : -liftPerToast * index,
|
|
394
|
-
computedScale = stackScale;
|
|
395
|
-
let computedOpacity = 1;
|
|
396
|
-
index >= visibleToasts ? computedOpacity = 0 : !expanded && index === visibleToasts - 1 && (computedOpacity = 0.5);
|
|
397
|
-
const computedZIndex = removed ? 0 : visibleToasts - index + 1,
|
|
398
|
-
computedHeight = !expanded && !isFront ? frontToastHeight : void 0,
|
|
399
|
-
computedPointerEvents = index >= visibleToasts ? "none" : "auto";
|
|
400
|
-
if (toast.jsx) return toast.jsx;
|
|
401
|
-
const title = typeof toast.title == "function" ? toast.title() : toast.title,
|
|
402
|
-
description = typeof toast.description == "function" ? toast.description() : toast.description,
|
|
403
|
-
dataAttributes = {
|
|
404
|
-
"data-mounted": mounted ? "true" : "false",
|
|
405
|
-
"data-removed": removed ? "true" : "false",
|
|
406
|
-
"data-swipe-out": swipeOut ? "true" : "false",
|
|
407
|
-
"data-visible": isVisible ? "true" : "false",
|
|
408
|
-
"data-front": isFront ? "true" : "false",
|
|
409
|
-
"data-index": String(index),
|
|
410
|
-
"data-type": toastType,
|
|
411
|
-
"data-expanded": expanded ? "true" : "false"
|
|
412
|
-
},
|
|
413
|
-
gapFillerHeight = expanded ? gap + 1 : 0;
|
|
414
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastPositionWrapper, {
|
|
415
|
-
ref: toastRef,
|
|
416
|
-
...dataAttributes,
|
|
417
|
-
onLayout: handleLayout,
|
|
418
|
-
transition: isDragging || reducedMotion ? void 0 : "200ms",
|
|
419
|
-
y: computedY,
|
|
420
|
-
scale: computedScale,
|
|
421
|
-
opacity: computedOpacity,
|
|
422
|
-
zIndex: computedZIndex,
|
|
423
|
-
height: computedHeight,
|
|
424
|
-
overflow: computedHeight ? "hidden" : void 0,
|
|
425
|
-
pointerEvents: computedPointerEvents,
|
|
426
|
-
top: isTop ? 0 : void 0,
|
|
427
|
-
bottom: isTop ? void 0 : 0,
|
|
428
|
-
...(import_constants.isWeb && !isFront && !expanded && {
|
|
429
|
-
style: {
|
|
430
|
-
transformOrigin: isTop ? "top center" : "bottom center"
|
|
431
|
-
}
|
|
432
|
-
}),
|
|
433
|
-
enterStyle: reducedMotion ? {
|
|
434
|
-
opacity: 0
|
|
435
|
-
} : {
|
|
436
|
-
opacity: 0,
|
|
437
|
-
y: isTop ? -10 : 10,
|
|
438
|
-
scale: 0.95
|
|
439
|
-
},
|
|
440
|
-
exitStyle: reducedMotion ? {
|
|
441
|
-
opacity: 0
|
|
442
|
-
} : {
|
|
443
|
-
opacity: 0,
|
|
444
|
-
// for swipe dismissal, drag transform handles position via animateOut
|
|
445
|
-
// for non-swipe dismissal (close button, timeout), use subtle position shift
|
|
446
|
-
x: 0,
|
|
447
|
-
y: swipeOut ? 0 : isTop ? -10 : 10,
|
|
448
|
-
scale: swipeOut ? 1 : 0.95
|
|
449
|
-
},
|
|
450
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(DragWrapper, {
|
|
451
|
-
isWeb: import_constants.isWeb,
|
|
452
|
-
animatedStyle,
|
|
453
|
-
gestureHandlers,
|
|
454
|
-
AnimatedView,
|
|
455
|
-
dragRef,
|
|
456
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(ToastItemFrame, {
|
|
457
|
-
role: "status",
|
|
458
|
-
"aria-live": "polite",
|
|
459
|
-
"aria-atomic": !0,
|
|
460
|
-
tabIndex: 0,
|
|
461
|
-
...(import_constants.isWeb && {
|
|
462
|
-
onKeyDown: event => {
|
|
463
|
-
event.key === "Escape" && dismissible && handleClose();
|
|
464
|
-
}
|
|
465
|
-
}),
|
|
466
|
-
children: [expanded && gapFillerHeight > 0 && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
467
|
-
position: "absolute",
|
|
468
|
-
left: 0,
|
|
469
|
-
right: 0,
|
|
470
|
-
height: gapFillerHeight,
|
|
471
|
-
pointerEvents: "auto",
|
|
472
|
-
...(isTop ? {
|
|
473
|
-
top: "100%"
|
|
474
|
-
} : {
|
|
475
|
-
bottom: "100%"
|
|
476
|
-
})
|
|
477
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_stacks.XStack, {
|
|
478
|
-
alignItems: "flex-start",
|
|
479
|
-
gap: "$3",
|
|
480
|
-
children: [icon && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.View, {
|
|
481
|
-
flexShrink: 0,
|
|
482
|
-
marginTop: "$0.5",
|
|
483
|
-
children: icon
|
|
484
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_stacks.YStack, {
|
|
485
|
-
flex: 1,
|
|
486
|
-
gap: "$1",
|
|
487
|
-
children: [title && /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastItemTitle, {
|
|
488
|
-
children: title
|
|
489
|
-
}), description && /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastItemDescription, {
|
|
490
|
-
children: description
|
|
491
|
-
})]
|
|
492
|
-
}), closeButton && dismissible && /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastCloseButton, {
|
|
493
|
-
onPress: handleClose,
|
|
494
|
-
"aria-label": "Close toast",
|
|
495
|
-
children: icons?.close ?? /* @__PURE__ */(0, import_jsx_runtime.jsx)(DefaultCloseIcon, {})
|
|
496
|
-
})]
|
|
497
|
-
}), (toast.action || toast.cancel) && /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_stacks.XStack, {
|
|
498
|
-
marginTop: "$3",
|
|
499
|
-
gap: "$2",
|
|
500
|
-
justifyContent: "flex-end",
|
|
501
|
-
children: [toast.cancel && /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastActionButton, {
|
|
502
|
-
onPress: event => {
|
|
503
|
-
toast.cancel?.onClick?.(event), handleClose();
|
|
504
|
-
},
|
|
505
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
506
|
-
size: "$2",
|
|
507
|
-
children: toast.cancel.label
|
|
508
|
-
})
|
|
509
|
-
}), toast.action && /* @__PURE__ */(0, import_jsx_runtime.jsx)(ToastActionButton, {
|
|
510
|
-
primary: !0,
|
|
511
|
-
onPress: event => {
|
|
512
|
-
toast.action?.onClick?.(event), event.defaultPrevented || handleClose();
|
|
513
|
-
},
|
|
514
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_text.SizableText, {
|
|
515
|
-
size: "$2",
|
|
516
|
-
fontWeight: "600",
|
|
517
|
-
color: "$background",
|
|
518
|
-
children: toast.action.label
|
|
519
|
-
})
|
|
520
|
-
})]
|
|
521
|
-
})]
|
|
522
|
-
})
|
|
523
|
-
})
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
ToastItem.displayName = "ToastItem";
|