beautiful-snackbar 1.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/README.md +233 -0
- package/example/.claude/settings.json +5 -0
- package/example/.vscode/extensions.json +1 -0
- package/example/.vscode/settings.json +7 -0
- package/example/AGENTS.md +3 -0
- package/example/CLAUDE.md +1 -0
- package/example/app.json +44 -0
- package/example/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/example/assets/expo.icon/Assets/grid.png +0 -0
- package/example/assets/expo.icon/icon.json +40 -0
- package/example/assets/images/android-icon-background.png +0 -0
- package/example/assets/images/android-icon-foreground.png +0 -0
- package/example/assets/images/android-icon-monochrome.png +0 -0
- package/example/assets/images/expo-badge-white.png +0 -0
- package/example/assets/images/expo-badge.png +0 -0
- package/example/assets/images/expo-logo.png +0 -0
- package/example/assets/images/favicon.png +0 -0
- package/example/assets/images/icon.png +0 -0
- package/example/assets/images/logo-glow.png +0 -0
- package/example/assets/images/react-logo.png +0 -0
- package/example/assets/images/react-logo@2x.png +0 -0
- package/example/assets/images/react-logo@3x.png +0 -0
- package/example/assets/images/splash-icon.png +0 -0
- package/example/assets/images/tabIcons/explore.png +0 -0
- package/example/assets/images/tabIcons/explore@2x.png +0 -0
- package/example/assets/images/tabIcons/explore@3x.png +0 -0
- package/example/assets/images/tabIcons/home.png +0 -0
- package/example/assets/images/tabIcons/home@2x.png +0 -0
- package/example/assets/images/tabIcons/home@3x.png +0 -0
- package/example/assets/images/tutorial-web.png +0 -0
- package/example/metro.config.js +24 -0
- package/example/package.json +46 -0
- package/example/scripts/reset-project.js +114 -0
- package/example/src/app/_layout.tsx +63 -0
- package/example/src/app/explore.tsx +181 -0
- package/example/src/app/index.tsx +641 -0
- package/example/src/components/animated-icon.module.css +6 -0
- package/example/src/components/animated-icon.tsx +132 -0
- package/example/src/components/animated-icon.web.tsx +108 -0
- package/example/src/components/app-tabs.tsx +33 -0
- package/example/src/components/app-tabs.web.tsx +116 -0
- package/example/src/components/external-link.tsx +25 -0
- package/example/src/components/hint-row.tsx +35 -0
- package/example/src/components/themed-text.tsx +73 -0
- package/example/src/components/themed-view.tsx +16 -0
- package/example/src/components/ui/collapsible.tsx +65 -0
- package/example/src/components/web-badge.tsx +44 -0
- package/example/src/constants/theme.ts +66 -0
- package/example/src/global.css +9 -0
- package/example/src/hooks/use-color-scheme.ts +1 -0
- package/example/src/hooks/use-color-scheme.web.ts +21 -0
- package/example/src/hooks/use-theme.ts +14 -0
- package/example/tsconfig.json +35 -0
- package/lib/components/ActionableSnackbar.d.ts +7 -0
- package/lib/components/ActionableSnackbar.js +96 -0
- package/lib/components/BeautifulSnackbar.d.ts +11 -0
- package/lib/components/BeautifulSnackbar.js +189 -0
- package/lib/components/StandardSnackbar.d.ts +7 -0
- package/lib/components/StandardSnackbar.js +65 -0
- package/lib/constants.d.ts +7 -0
- package/lib/constants.js +20 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +11 -0
- package/lib/manager.d.ts +58 -0
- package/lib/manager.js +107 -0
- package/lib/types.d.ts +25 -0
- package/lib/types.js +2 -0
- package/lib/useSnackbarAnimation.d.ts +14 -0
- package/lib/useSnackbarAnimation.js +118 -0
- package/package.json +33 -0
- package/src/components/ActionableSnackbar.tsx +109 -0
- package/src/components/BeautifulSnackbar.tsx +203 -0
- package/src/components/StandardSnackbar.tsx +70 -0
- package/src/constants.ts +20 -0
- package/src/index.ts +5 -0
- package/src/manager.ts +151 -0
- package/src/types.ts +27 -0
- package/src/useSnackbarAnimation.ts +145 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Image } from 'expo-image';
|
|
2
|
+
import { SymbolView } from 'expo-symbols';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Platform, Pressable, ScrollView, StyleSheet } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
|
|
7
|
+
import { ExternalLink } from '@/components/external-link';
|
|
8
|
+
import { ThemedText } from '@/components/themed-text';
|
|
9
|
+
import { ThemedView } from '@/components/themed-view';
|
|
10
|
+
import { Collapsible } from '@/components/ui/collapsible';
|
|
11
|
+
import { WebBadge } from '@/components/web-badge';
|
|
12
|
+
import { BottomTabInset, MaxContentWidth, Spacing } from '@/constants/theme';
|
|
13
|
+
import { useTheme } from '@/hooks/use-theme';
|
|
14
|
+
|
|
15
|
+
export default function TabTwoScreen() {
|
|
16
|
+
const safeAreaInsets = useSafeAreaInsets();
|
|
17
|
+
const insets = {
|
|
18
|
+
...safeAreaInsets,
|
|
19
|
+
bottom: safeAreaInsets.bottom + BottomTabInset + Spacing.three,
|
|
20
|
+
};
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
|
|
23
|
+
const contentPlatformStyle = Platform.select({
|
|
24
|
+
android: {
|
|
25
|
+
paddingTop: insets.top,
|
|
26
|
+
paddingLeft: insets.left,
|
|
27
|
+
paddingRight: insets.right,
|
|
28
|
+
paddingBottom: insets.bottom,
|
|
29
|
+
},
|
|
30
|
+
web: {
|
|
31
|
+
paddingTop: Spacing.six,
|
|
32
|
+
paddingBottom: Spacing.four,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<ScrollView
|
|
38
|
+
style={[styles.scrollView, { backgroundColor: theme.background }]}
|
|
39
|
+
contentInset={insets}
|
|
40
|
+
contentContainerStyle={[styles.contentContainer, contentPlatformStyle]}>
|
|
41
|
+
<ThemedView style={styles.container}>
|
|
42
|
+
<ThemedView style={styles.titleContainer}>
|
|
43
|
+
<ThemedText type="subtitle">Explore</ThemedText>
|
|
44
|
+
<ThemedText style={styles.centerText} themeColor="textSecondary">
|
|
45
|
+
This starter app includes example{'\n'}code to help you get started.
|
|
46
|
+
</ThemedText>
|
|
47
|
+
|
|
48
|
+
<ExternalLink href="https://docs.expo.dev" asChild>
|
|
49
|
+
<Pressable style={({ pressed }) => pressed && styles.pressed}>
|
|
50
|
+
<ThemedView type="backgroundElement" style={styles.linkButton}>
|
|
51
|
+
<ThemedText type="link">Expo documentation</ThemedText>
|
|
52
|
+
<SymbolView
|
|
53
|
+
tintColor={theme.text}
|
|
54
|
+
name={{ ios: 'arrow.up.right.square', android: 'link', web: 'link' }}
|
|
55
|
+
size={12}
|
|
56
|
+
/>
|
|
57
|
+
</ThemedView>
|
|
58
|
+
</Pressable>
|
|
59
|
+
</ExternalLink>
|
|
60
|
+
</ThemedView>
|
|
61
|
+
|
|
62
|
+
<ThemedView style={styles.sectionsWrapper}>
|
|
63
|
+
<Collapsible title="File-based routing">
|
|
64
|
+
<ThemedText type="small">
|
|
65
|
+
This app has two screens: <ThemedText type="code">src/app/index.tsx</ThemedText> and{' '}
|
|
66
|
+
<ThemedText type="code">src/app/explore.tsx</ThemedText>
|
|
67
|
+
</ThemedText>
|
|
68
|
+
<ThemedText type="small">
|
|
69
|
+
The layout file in <ThemedText type="code">src/app/_layout.tsx</ThemedText> sets up
|
|
70
|
+
the tab navigator.
|
|
71
|
+
</ThemedText>
|
|
72
|
+
<ExternalLink href="https://docs.expo.dev/router/introduction">
|
|
73
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
74
|
+
</ExternalLink>
|
|
75
|
+
</Collapsible>
|
|
76
|
+
|
|
77
|
+
<Collapsible title="Android, iOS, and web support">
|
|
78
|
+
<ThemedView type="backgroundElement" style={styles.collapsibleContent}>
|
|
79
|
+
<ThemedText type="small">
|
|
80
|
+
You can open this project on Android, iOS, and the web. To open the web version,
|
|
81
|
+
press <ThemedText type="smallBold">w</ThemedText> in the terminal running this
|
|
82
|
+
project.
|
|
83
|
+
</ThemedText>
|
|
84
|
+
<Image
|
|
85
|
+
source={require('@/assets/images/tutorial-web.png')}
|
|
86
|
+
style={styles.imageTutorial}
|
|
87
|
+
/>
|
|
88
|
+
</ThemedView>
|
|
89
|
+
</Collapsible>
|
|
90
|
+
|
|
91
|
+
<Collapsible title="Images">
|
|
92
|
+
<ThemedText type="small">
|
|
93
|
+
For static images, you can use the <ThemedText type="code">@2x</ThemedText> and{' '}
|
|
94
|
+
<ThemedText type="code">@3x</ThemedText> suffixes to provide files for different
|
|
95
|
+
screen densities.
|
|
96
|
+
</ThemedText>
|
|
97
|
+
<Image source={require('@/assets/images/react-logo.png')} style={styles.imageReact} />
|
|
98
|
+
<ExternalLink href="https://reactnative.dev/docs/images">
|
|
99
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
100
|
+
</ExternalLink>
|
|
101
|
+
</Collapsible>
|
|
102
|
+
|
|
103
|
+
<Collapsible title="Light and dark mode components">
|
|
104
|
+
<ThemedText type="small">
|
|
105
|
+
This template has light and dark mode support. The{' '}
|
|
106
|
+
<ThemedText type="code">useColorScheme()</ThemedText> hook lets you inspect what the
|
|
107
|
+
user's current color scheme is, and so you can adjust UI colors accordingly.
|
|
108
|
+
</ThemedText>
|
|
109
|
+
<ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/">
|
|
110
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
111
|
+
</ExternalLink>
|
|
112
|
+
</Collapsible>
|
|
113
|
+
|
|
114
|
+
<Collapsible title="Animations">
|
|
115
|
+
<ThemedText type="small">
|
|
116
|
+
This template includes an example of an animated component. The{' '}
|
|
117
|
+
<ThemedText type="code">src/components/ui/collapsible.tsx</ThemedText> component uses
|
|
118
|
+
the powerful <ThemedText type="code">react-native-reanimated</ThemedText> library to
|
|
119
|
+
animate opening this hint.
|
|
120
|
+
</ThemedText>
|
|
121
|
+
</Collapsible>
|
|
122
|
+
</ThemedView>
|
|
123
|
+
{Platform.OS === 'web' && <WebBadge />}
|
|
124
|
+
</ThemedView>
|
|
125
|
+
</ScrollView>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const styles = StyleSheet.create({
|
|
130
|
+
scrollView: {
|
|
131
|
+
flex: 1,
|
|
132
|
+
},
|
|
133
|
+
contentContainer: {
|
|
134
|
+
flexDirection: 'row',
|
|
135
|
+
justifyContent: 'center',
|
|
136
|
+
},
|
|
137
|
+
container: {
|
|
138
|
+
maxWidth: MaxContentWidth,
|
|
139
|
+
flexGrow: 1,
|
|
140
|
+
},
|
|
141
|
+
titleContainer: {
|
|
142
|
+
gap: Spacing.three,
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
paddingHorizontal: Spacing.four,
|
|
145
|
+
paddingVertical: Spacing.six,
|
|
146
|
+
},
|
|
147
|
+
centerText: {
|
|
148
|
+
textAlign: 'center',
|
|
149
|
+
},
|
|
150
|
+
pressed: {
|
|
151
|
+
opacity: 0.7,
|
|
152
|
+
},
|
|
153
|
+
linkButton: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
paddingHorizontal: Spacing.four,
|
|
156
|
+
paddingVertical: Spacing.two,
|
|
157
|
+
borderRadius: Spacing.five,
|
|
158
|
+
justifyContent: 'center',
|
|
159
|
+
gap: Spacing.one,
|
|
160
|
+
alignItems: 'center',
|
|
161
|
+
},
|
|
162
|
+
sectionsWrapper: {
|
|
163
|
+
gap: Spacing.five,
|
|
164
|
+
paddingHorizontal: Spacing.four,
|
|
165
|
+
paddingTop: Spacing.three,
|
|
166
|
+
},
|
|
167
|
+
collapsibleContent: {
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
},
|
|
170
|
+
imageTutorial: {
|
|
171
|
+
width: '100%',
|
|
172
|
+
aspectRatio: 296 / 171,
|
|
173
|
+
borderRadius: Spacing.three,
|
|
174
|
+
marginTop: Spacing.two,
|
|
175
|
+
},
|
|
176
|
+
imageReact: {
|
|
177
|
+
width: 100,
|
|
178
|
+
height: 100,
|
|
179
|
+
alignSelf: 'center',
|
|
180
|
+
},
|
|
181
|
+
});
|