@hanzogui/toast 2.0.0 → 2.0.4
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/package.json +18 -18
- package/src/Toast.tsx +7 -7
- package/src/ToastAnnounce.tsx +6 -6
- package/src/ToastImperative.tsx +3 -3
- package/src/ToastImpl.tsx +10 -10
- package/src/ToastPortal.tsx +1 -1
- package/src/ToastProvider.tsx +4 -4
- package/src/ToastViewport.tsx +8 -8
- package/src/createNativeToast.native.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/toast",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
"clean:build": "hanzo-gui-build clean:build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@hanzogui/animate-presence": "2.0.
|
|
40
|
-
"@hanzogui/collection": "2.0.
|
|
41
|
-
"@hanzogui/compose-refs": "2.0.
|
|
42
|
-
"@hanzogui/constants": "2.0.
|
|
43
|
-
"@hanzogui/core": "2.0.
|
|
44
|
-
"@hanzogui/create-context": "2.0.
|
|
45
|
-
"@hanzogui/dismissable": "2.0.
|
|
46
|
-
"@hanzogui/helpers": "2.0.
|
|
47
|
-
"@hanzogui/native": "2.0.
|
|
48
|
-
"@hanzogui/polyfill-dev": "2.0.
|
|
49
|
-
"@hanzogui/portal": "2.0.
|
|
50
|
-
"@hanzogui/stacks": "2.0.
|
|
51
|
-
"@hanzogui/start-transition": "2.0.
|
|
52
|
-
"@hanzogui/text": "2.0.
|
|
53
|
-
"@hanzogui/use-controllable-state": "2.0.
|
|
54
|
-
"@hanzogui/visually-hidden": "2.0.
|
|
39
|
+
"@hanzogui/animate-presence": "2.0.1",
|
|
40
|
+
"@hanzogui/collection": "2.0.1",
|
|
41
|
+
"@hanzogui/compose-refs": "2.0.1",
|
|
42
|
+
"@hanzogui/constants": "2.0.1",
|
|
43
|
+
"@hanzogui/core": "2.0.1",
|
|
44
|
+
"@hanzogui/create-context": "2.0.1",
|
|
45
|
+
"@hanzogui/dismissable": "2.0.1",
|
|
46
|
+
"@hanzogui/helpers": "2.0.1",
|
|
47
|
+
"@hanzogui/native": "2.0.1",
|
|
48
|
+
"@hanzogui/polyfill-dev": "2.0.1",
|
|
49
|
+
"@hanzogui/portal": "2.0.1",
|
|
50
|
+
"@hanzogui/stacks": "2.0.1",
|
|
51
|
+
"@hanzogui/start-transition": "2.0.1",
|
|
52
|
+
"@hanzogui/text": "2.0.1",
|
|
53
|
+
"@hanzogui/use-controllable-state": "2.0.1",
|
|
54
|
+
"@hanzogui/visually-hidden": "2.0.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@hanzogui/build": "2.0.
|
|
57
|
+
"@hanzogui/build": "2.0.1",
|
|
58
58
|
"react": ">=19",
|
|
59
59
|
"react-native": "0.83.2"
|
|
60
60
|
},
|
package/src/Toast.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnimatePresence } from '@
|
|
2
|
-
import type { GetProps, NativePlatform, NativeValue, GuiElement } from '@
|
|
3
|
-
import { styled, useEvent } from '@
|
|
4
|
-
import { composeEventHandlers, withStaticProperties } from '@
|
|
5
|
-
import { YStack } from '@
|
|
6
|
-
import { SizableText } from '@
|
|
7
|
-
import { useControllableState } from '@
|
|
1
|
+
import { AnimatePresence } from '@hanzo/gui-animate-presence'
|
|
2
|
+
import type { GetProps, NativePlatform, NativeValue, GuiElement } from '@hanzo/gui-core'
|
|
3
|
+
import { styled, useEvent } from '@hanzo/gui-core'
|
|
4
|
+
import { composeEventHandlers, withStaticProperties } from '@hanzo/gui-helpers'
|
|
5
|
+
import { YStack } from '@hanzo/gui-stacks'
|
|
6
|
+
import { SizableText } from '@hanzo/gui-text'
|
|
7
|
+
import { useControllableState } from '@hanzo/gui-use-controllable-state'
|
|
8
8
|
import * as React from 'react'
|
|
9
9
|
import { ToastAnnounceExclude } from './ToastAnnounce'
|
|
10
10
|
import type { CustomData } from './ToastImperative'
|
package/src/ToastAnnounce.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useIsomorphicLayoutEffect } from '@
|
|
2
|
-
import type { GetProps, GuiElement } from '@
|
|
3
|
-
import { View, Text, styled, useEvent } from '@
|
|
4
|
-
import { Portal } from '@
|
|
5
|
-
import { startTransition } from '@
|
|
6
|
-
import { VisuallyHidden } from '@
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@hanzo/gui-constants'
|
|
2
|
+
import type { GetProps, GuiElement } from '@hanzo/gui-core'
|
|
3
|
+
import { View, Text, styled, useEvent } from '@hanzo/gui-core'
|
|
4
|
+
import { Portal } from '@hanzo/gui-portal'
|
|
5
|
+
import { startTransition } from '@hanzo/gui-start-transition'
|
|
6
|
+
import { VisuallyHidden } from '@hanzo/gui-visually-hidden'
|
|
7
7
|
import * as React from 'react'
|
|
8
8
|
|
|
9
9
|
import type { ScopedProps } from './ToastProvider'
|
package/src/ToastImperative.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NativePlatform, NativeValue } from '@
|
|
2
|
-
import { isAndroid, isIos, isWeb } from '@
|
|
1
|
+
import type { NativePlatform, NativeValue } from '@hanzo/gui-core'
|
|
2
|
+
import { isAndroid, isIos, isWeb } from '@hanzo/gui-core'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { createNativeToast } from './createNativeToast'
|
|
5
5
|
import type { CreateNativeToastOptions, NativeToastRef } from './types'
|
|
@@ -19,7 +19,7 @@ export interface ToastImperativeOptions extends Omit<
|
|
|
19
19
|
*
|
|
20
20
|
* e.g.
|
|
21
21
|
* ```ts
|
|
22
|
-
* declare module '@
|
|
22
|
+
* declare module '@hanzo/gui-toast' {
|
|
23
23
|
* interface CustomData {
|
|
24
24
|
* preset: 'error' | 'success'
|
|
25
25
|
* isUrgent: true
|
package/src/ToastImpl.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useIsPresent } from '@
|
|
2
|
-
import { useComposedRefs } from '@
|
|
3
|
-
import { isWeb } from '@
|
|
4
|
-
import type { GetProps, GuiElement } from '@
|
|
1
|
+
import { useIsPresent } from '@hanzo/gui-animate-presence'
|
|
2
|
+
import { useComposedRefs } from '@hanzo/gui-compose-refs'
|
|
3
|
+
import { isWeb } from '@hanzo/gui-constants'
|
|
4
|
+
import type { GetProps, GuiElement } from '@hanzo/gui-core'
|
|
5
5
|
import {
|
|
6
6
|
View,
|
|
7
7
|
Theme,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
useConfiguration,
|
|
11
11
|
useEvent,
|
|
12
12
|
useThemeName,
|
|
13
|
-
} from '@
|
|
14
|
-
import type { DismissableProps } from '@
|
|
15
|
-
import { Dismissable } from '@
|
|
16
|
-
import { composeEventHandlers } from '@
|
|
17
|
-
import { PortalItem } from '@
|
|
18
|
-
import { YStack } from '@
|
|
13
|
+
} from '@hanzo/gui-core'
|
|
14
|
+
import type { DismissableProps } from '@hanzo/gui-dismissable'
|
|
15
|
+
import { Dismissable } from '@hanzo/gui-dismissable'
|
|
16
|
+
import { composeEventHandlers } from '@hanzo/gui-helpers'
|
|
17
|
+
import { PortalItem } from '@hanzo/gui-portal'
|
|
18
|
+
import { YStack } from '@hanzo/gui-stacks'
|
|
19
19
|
import * as React from 'react'
|
|
20
20
|
import type {
|
|
21
21
|
Animated,
|
package/src/ToastPortal.tsx
CHANGED
package/src/ToastProvider.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createCollection } from '@
|
|
2
|
-
import type { NativeValue, GuiElement } from '@
|
|
3
|
-
import { createStyledContext } from '@
|
|
4
|
-
import { startTransition } from '@
|
|
1
|
+
import { createCollection } from '@hanzo/gui-collection'
|
|
2
|
+
import type { NativeValue, GuiElement } from '@hanzo/gui-core'
|
|
3
|
+
import { createStyledContext } from '@hanzo/gui-core'
|
|
4
|
+
import { startTransition } from '@hanzo/gui-start-transition'
|
|
5
5
|
import * as React from 'react'
|
|
6
6
|
|
|
7
7
|
import { TOAST_CONTEXT } from './constants'
|
package/src/ToastViewport.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnimatePresence } from '@
|
|
2
|
-
import { useComposedRefs } from '@
|
|
3
|
-
import { isWeb } from '@
|
|
4
|
-
import type { GetProps, GuiElement } from '@
|
|
5
|
-
import { styled } from '@
|
|
6
|
-
import { PortalHost } from '@
|
|
7
|
-
import { YStack } from '@
|
|
8
|
-
import { VisuallyHidden } from '@
|
|
1
|
+
import { AnimatePresence } from '@hanzo/gui-animate-presence'
|
|
2
|
+
import { useComposedRefs } from '@hanzo/gui-compose-refs'
|
|
3
|
+
import { isWeb } from '@hanzo/gui-constants'
|
|
4
|
+
import type { GetProps, GuiElement } from '@hanzo/gui-core'
|
|
5
|
+
import { styled } from '@hanzo/gui-core'
|
|
6
|
+
import { PortalHost } from '@hanzo/gui-portal'
|
|
7
|
+
import { YStack } from '@hanzo/gui-stacks'
|
|
8
|
+
import { VisuallyHidden } from '@hanzo/gui-visually-hidden'
|
|
9
9
|
import * as React from 'react'
|
|
10
10
|
import { TOAST_CONTEXT } from './constants'
|
|
11
11
|
import { ToastPortal } from './ToastPortal'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBurnt } from '@
|
|
1
|
+
import { getBurnt } from '@hanzo/gui-native'
|
|
2
2
|
import type { CreateNativeToastsFn, HideNativeToastsFn } from './types'
|
|
3
3
|
|
|
4
4
|
export const createNativeToast: CreateNativeToastsFn = (
|
|
@@ -8,7 +8,7 @@ export const createNativeToast: CreateNativeToastsFn = (
|
|
|
8
8
|
const burnt = getBurnt()
|
|
9
9
|
if (!burnt.isEnabled) {
|
|
10
10
|
console.warn(
|
|
11
|
-
`Warning: Must call import '@
|
|
11
|
+
`Warning: Must call import '@hanzo/gui-native/setup-burnt' at your app entry point to use native toasts`
|
|
12
12
|
)
|
|
13
13
|
return false
|
|
14
14
|
}
|