@ornikar/bumper 2.2.1-canary.431a0c996598cbee4e3c07f6b9886d37d2a76679.0 → 2.2.1-canary.d9333a410786c9c1a722ce408a27e7980c9146a4.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/core/BumperDecorator.d.ts +1 -1
- package/dist/definitions/core/BumperDecorator.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +0 -3
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/story-components/StorySection.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 +6 -10
- package/src/components/breakpoints/hooks/useBreakpointValue.test.ts +40 -0
- package/src/components/breakpoints/hooks/useCurrentBreakpointName.test.ts +39 -0
- package/src/components/breakpoints/utils/breakpointsUtils.test.ts +10 -10
- 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,146 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
-
|
|
3
|
-
exports[`bumper/Toast Toast 1`] = `
|
|
4
|
-
<RNCSafeAreaProvider
|
|
5
|
-
onInsetsChange={[Function]}
|
|
6
|
-
style={
|
|
7
|
-
[
|
|
8
|
-
{
|
|
9
|
-
"flex": 1,
|
|
10
|
-
},
|
|
11
|
-
undefined,
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
>
|
|
15
|
-
<RNCSafeAreaProvider
|
|
16
|
-
onInsetsChange={[Function]}
|
|
17
|
-
style={
|
|
18
|
-
[
|
|
19
|
-
{
|
|
20
|
-
"flex": 1,
|
|
21
|
-
},
|
|
22
|
-
undefined,
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
>
|
|
26
|
-
<View
|
|
27
|
-
style={
|
|
28
|
-
{
|
|
29
|
-
"flexDirection": "column",
|
|
30
|
-
"paddingBottom": 12,
|
|
31
|
-
"paddingLeft": 4,
|
|
32
|
-
"paddingRight": 4,
|
|
33
|
-
"paddingTop": 4,
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
<Text
|
|
38
|
-
style={
|
|
39
|
-
{
|
|
40
|
-
"fontFamily": "GTStandardSemibold",
|
|
41
|
-
"fontSize": 38,
|
|
42
|
-
"letterSpacing": 0,
|
|
43
|
-
"lineHeight": 48,
|
|
44
|
-
"marginBottom": 4,
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
suppressHighlighting={true}
|
|
48
|
-
>
|
|
49
|
-
Demo
|
|
50
|
-
</Text>
|
|
51
|
-
<View
|
|
52
|
-
onBlur={[Function]}
|
|
53
|
-
onClick={[Function]}
|
|
54
|
-
onFocus={[Function]}
|
|
55
|
-
onResponderGrant={[Function]}
|
|
56
|
-
onResponderMove={[Function]}
|
|
57
|
-
onResponderRelease={[Function]}
|
|
58
|
-
onResponderTerminate={[Function]}
|
|
59
|
-
onResponderTerminationRequest={[Function]}
|
|
60
|
-
onStartShouldSetResponder={[Function]}
|
|
61
|
-
>
|
|
62
|
-
<Text
|
|
63
|
-
style={
|
|
64
|
-
{
|
|
65
|
-
"fontFamily": "GTStandard",
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
suppressHighlighting={true}
|
|
69
|
-
>
|
|
70
|
-
Show Toast
|
|
71
|
-
</Text>
|
|
72
|
-
</View>
|
|
73
|
-
<View
|
|
74
|
-
onBlur={[Function]}
|
|
75
|
-
onClick={[Function]}
|
|
76
|
-
onFocus={[Function]}
|
|
77
|
-
onResponderGrant={[Function]}
|
|
78
|
-
onResponderMove={[Function]}
|
|
79
|
-
onResponderRelease={[Function]}
|
|
80
|
-
onResponderTerminate={[Function]}
|
|
81
|
-
onResponderTerminationRequest={[Function]}
|
|
82
|
-
onStartShouldSetResponder={[Function]}
|
|
83
|
-
>
|
|
84
|
-
<Text
|
|
85
|
-
style={
|
|
86
|
-
{
|
|
87
|
-
"fontFamily": "GTStandard",
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
suppressHighlighting={true}
|
|
91
|
-
>
|
|
92
|
-
Show Toast 2
|
|
93
|
-
</Text>
|
|
94
|
-
</View>
|
|
95
|
-
</View>
|
|
96
|
-
<View
|
|
97
|
-
pointerEvents="box-none"
|
|
98
|
-
style={
|
|
99
|
-
{
|
|
100
|
-
"bottom": 0,
|
|
101
|
-
"left": 0,
|
|
102
|
-
"maxWidth": "100%",
|
|
103
|
-
"position": "absolute",
|
|
104
|
-
"right": 0,
|
|
105
|
-
"top": 0,
|
|
106
|
-
"zIndex": 9007199254740991,
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
>
|
|
110
|
-
<View
|
|
111
|
-
aria-label="Notifications (F8)"
|
|
112
|
-
pointerEvents="box-none"
|
|
113
|
-
role="region"
|
|
114
|
-
style={
|
|
115
|
-
{
|
|
116
|
-
"bottom": 0,
|
|
117
|
-
"flexDirection": "column",
|
|
118
|
-
"left": 0,
|
|
119
|
-
"maxWidth": "100%",
|
|
120
|
-
"position": "absolute",
|
|
121
|
-
"right": 0,
|
|
122
|
-
"top": 0,
|
|
123
|
-
"zIndex": 100000,
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
tabIndex={-1}
|
|
127
|
-
>
|
|
128
|
-
<View
|
|
129
|
-
focusable={false}
|
|
130
|
-
pointerEvents="box-none"
|
|
131
|
-
style={
|
|
132
|
-
{
|
|
133
|
-
"flexDirection": "column",
|
|
134
|
-
"left": 0,
|
|
135
|
-
"maxWidth": "100%",
|
|
136
|
-
"position": "absolute",
|
|
137
|
-
"right": 0,
|
|
138
|
-
"top": 0,
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
/>
|
|
142
|
-
</View>
|
|
143
|
-
</View>
|
|
144
|
-
</RNCSafeAreaProvider>
|
|
145
|
-
</RNCSafeAreaProvider>
|
|
146
|
-
`;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
-
|
|
3
|
-
exports[`bumper/Toast Toast 1`] = `
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<div
|
|
6
|
-
class="css-view-175oi2r r-flex-13awgt0"
|
|
7
|
-
>
|
|
8
|
-
<span
|
|
9
|
-
class=""
|
|
10
|
-
style="display: contents;"
|
|
11
|
-
>
|
|
12
|
-
<span
|
|
13
|
-
class=" "
|
|
14
|
-
style="display: contents;"
|
|
15
|
-
>
|
|
16
|
-
<span
|
|
17
|
-
class=" t_light is_Theme"
|
|
18
|
-
style="display: contents;"
|
|
19
|
-
>
|
|
20
|
-
<div
|
|
21
|
-
class="css-view-175oi2r r-flex-13awgt0"
|
|
22
|
-
>
|
|
23
|
-
<div
|
|
24
|
-
class="is_VStack _display-flex _alignItems-stretch _flexBasis-auto _boxSizing-border-box _position-relative _minHeight-0px _minWidth-0px _flexShrink-0 _flexDirection-column _paddingTop-t-space-4 _paddingBottom-t-space-12 _paddingRight-t-space-4 _paddingLeft-t-space-4"
|
|
25
|
-
>
|
|
26
|
-
<span
|
|
27
|
-
class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _display-inline _boxSizing-border-box _wordWrap-break-word _whiteSpace-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-t-space-4 _marginLeft-0px _fontFamily-f-family _fontSize-f-size-head100347201 _lineHeight-f-lineHeigh1544154440 _letterSpacing-f-letterSpa1195674547 _fontWeight-f-weight-se1074390495"
|
|
28
|
-
data-disable-theme="true"
|
|
29
|
-
>
|
|
30
|
-
Demo
|
|
31
|
-
</span>
|
|
32
|
-
<div
|
|
33
|
-
class="_display-flex _alignItems-stretch _flexDirection-column _flexBasis-auto _boxSizing-border-box _position-relative _minHeight-0px _minWidth-0px _flexShrink-0"
|
|
34
|
-
>
|
|
35
|
-
<span
|
|
36
|
-
class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _display-inline _boxSizing-border-box _wordWrap-break-word _whiteSpace-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _fontFamily-f-family"
|
|
37
|
-
data-disable-theme="true"
|
|
38
|
-
>
|
|
39
|
-
Show Toast
|
|
40
|
-
</span>
|
|
41
|
-
</div>
|
|
42
|
-
<div
|
|
43
|
-
class="_display-flex _alignItems-stretch _flexDirection-column _flexBasis-auto _boxSizing-border-box _position-relative _minHeight-0px _minWidth-0px _flexShrink-0"
|
|
44
|
-
>
|
|
45
|
-
<span
|
|
46
|
-
class="font_GTStandard _WebkitFontSmoothing-_platformweb_antialiased _display-inline _boxSizing-border-box _wordWrap-break-word _whiteSpace-pre-wrap _marginTop-0px _marginRight-0px _marginBottom-0px _marginLeft-0px _fontFamily-f-family"
|
|
47
|
-
data-disable-theme="true"
|
|
48
|
-
>
|
|
49
|
-
Show Toast 2
|
|
50
|
-
</span>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
<span
|
|
54
|
-
style="z-index: 9007199254740991; position: fixed; inset: 0; contain: strict; pointer-events: none;"
|
|
55
|
-
>
|
|
56
|
-
<div
|
|
57
|
-
aria-label="Notifications (F8)"
|
|
58
|
-
class="is_ViewportWrapper _display-flex _alignItems-stretch _flexBasis-auto _boxSizing-border-box _position-fixed _minHeight-0px _minWidth-0px _flexShrink-0 _flexDirection-column _pointerEvents-box-none _top-0px _bottom-0px _left-0px _right-0px _maxWidth-10037 _zIndex-100000"
|
|
59
|
-
role="region"
|
|
60
|
-
tabindex="-1"
|
|
61
|
-
>
|
|
62
|
-
<div
|
|
63
|
-
class="is_ToastViewport _display-flex _alignItems-stretch _flexBasis-auto _boxSizing-border-box _position-fixed _minHeight-0px _minWidth-0px _flexShrink-0 _flexDirection-column _pointerEvents-box-none _maxWidth-10037 _top-0px _left-0px _right-0px"
|
|
64
|
-
tabindex="-1"
|
|
65
|
-
>
|
|
66
|
-
<div
|
|
67
|
-
style="display: contents;"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</span>
|
|
72
|
-
<div
|
|
73
|
-
style="display: contents;"
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
</span>
|
|
77
|
-
</span>
|
|
78
|
-
</span>
|
|
79
|
-
</div>
|
|
80
|
-
</DocumentFragment>
|
|
81
|
-
`;
|
|
@@ -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
|
-
}
|