@ornikar/bumper 2.2.1-canary.431a0c996598cbee4e3c07f6b9886d37d2a76679.0 → 2.2.1-canary.807c44961b602a3d69cc09c68bd5036b2794e70a.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/CHANGELOG.md +2 -9
- package/dist/definitions/index.d.ts +0 -3
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/tamagui.config.d.ts +1 -20
- package/dist/definitions/tamagui.config.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +5 -168
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +5 -168
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +2 -167
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.js +1 -166
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +4 -167
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.mjs +4 -166
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +5 -177
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +4 -175
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -11
- package/src/index.ts +0 -5
- package/src/tamagui.config.ts +0 -3
- package/dist/definitions/animations.d.ts +0 -22
- package/dist/definitions/animations.d.ts.map +0 -1
- package/dist/definitions/components/toast/SafeToastViewport.d.ts +0 -9
- package/dist/definitions/components/toast/SafeToastViewport.d.ts.map +0 -1
- package/dist/definitions/components/toast/ToastProvider.d.ts +0 -10
- package/dist/definitions/components/toast/ToastProvider.d.ts.map +0 -1
- package/dist/definitions/components/toast/ToastRenderer.d.ts +0 -8
- package/dist/definitions/components/toast/ToastRenderer.d.ts.map +0 -1
- package/dist/definitions/components/toast/ToastStoreProvider.d.ts +0 -11
- package/dist/definitions/components/toast/ToastStoreProvider.d.ts.map +0 -1
- package/dist/definitions/components/toast/decorators/ToastProviderDecorator.d.ts +0 -2
- package/dist/definitions/components/toast/decorators/ToastProviderDecorator.d.ts.map +0 -1
- package/dist/definitions/components/toast/types.d.ts +0 -8
- package/dist/definitions/components/toast/types.d.ts.map +0 -1
- package/dist/definitions/components/toast/useToast.d.ts +0 -9
- package/dist/definitions/components/toast/useToast.d.ts.map +0 -1
- package/src/animations.ts +0 -25
- package/src/components/toast/SafeToastViewport.tsx +0 -26
- package/src/components/toast/Toast.stories.tsx +0 -75
- package/src/components/toast/ToastProvider.tsx +0 -33
- package/src/components/toast/ToastRenderer.tsx +0 -26
- package/src/components/toast/ToastStoreProvider.tsx +0 -41
- package/src/components/toast/__snapshots__/Toast.stories.tsx.snap +0 -146
- package/src/components/toast/__snapshots_web__/Toast.stories.tsx.snap +0 -81
- package/src/components/toast/decorators/ToastProviderDecorator.tsx +0 -23
- package/src/components/toast/types.ts +0 -9
- package/src/components/toast/useToast.tsx +0 -35
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { makeDecorator } from '@storybook/addons';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
4
|
-
import { ToastProvider } from '../ToastProvider';
|
|
5
|
-
|
|
6
|
-
export const ToastStoryDecorator = makeDecorator({
|
|
7
|
-
name: 'ToastStoryDecorator',
|
|
8
|
-
parameterName: 'toast',
|
|
9
|
-
wrapper: (storyFn, context): ReactNode => {
|
|
10
|
-
const story = storyFn(context) as unknown as ReactNode;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<SafeAreaProvider>
|
|
14
|
-
<ToastProvider
|
|
15
|
-
ToastComponent={context.parameters.toast.component || null}
|
|
16
|
-
position={context.parameters.toast?.position || 'top'}
|
|
17
|
-
>
|
|
18
|
-
{story}
|
|
19
|
-
</ToastProvider>
|
|
20
|
-
</SafeAreaProvider>
|
|
21
|
-
);
|
|
22
|
-
},
|
|
23
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { useToastStore } from './ToastStoreProvider';
|
|
3
|
-
import type { ToastOptions } from './types';
|
|
4
|
-
|
|
5
|
-
interface UseToastReturn {
|
|
6
|
-
toasts: ToastOptions[];
|
|
7
|
-
showToast: (options: ToastOptions) => void;
|
|
8
|
-
hideToast: (id: string) => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function useToast(): UseToastReturn {
|
|
12
|
-
const { toasts, addToast, removeToast } = useToastStore();
|
|
13
|
-
|
|
14
|
-
const showToast = useCallback(
|
|
15
|
-
(options: ToastOptions): void => {
|
|
16
|
-
const { title, ...otherOptions } = options;
|
|
17
|
-
const id = `${JSON.stringify(options)}${Math.random()}`;
|
|
18
|
-
addToast({ id, title, ...otherOptions });
|
|
19
|
-
},
|
|
20
|
-
[addToast],
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
const hideToast = useCallback(
|
|
24
|
-
(id: string): void => {
|
|
25
|
-
removeToast(id);
|
|
26
|
-
},
|
|
27
|
-
[removeToast],
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
toasts,
|
|
32
|
-
showToast,
|
|
33
|
-
hideToast,
|
|
34
|
-
};
|
|
35
|
-
}
|