ignite-parse-auth-kit 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/CONTRIBUTING.md +0 -0
- package/LICENSE +21 -0
- package/README.md +492 -0
- package/app/app.tsx +116 -0
- package/app/components/AlertTongle.tsx +105 -0
- package/app/components/AutoImage.tsx +89 -0
- package/app/components/Button.tsx +248 -0
- package/app/components/Card.tsx +314 -0
- package/app/components/EmptyState.tsx +248 -0
- package/app/components/Header.tsx +332 -0
- package/app/components/Icon.tsx +140 -0
- package/app/components/ListItem.tsx +243 -0
- package/app/components/ListView.tsx +42 -0
- package/app/components/Screen.tsx +305 -0
- package/app/components/Text.test.tsx +23 -0
- package/app/components/Text.tsx +116 -0
- package/app/components/TextField.tsx +292 -0
- package/app/components/Toggle/Checkbox.tsx +123 -0
- package/app/components/Toggle/Radio.tsx +106 -0
- package/app/components/Toggle/Switch.tsx +264 -0
- package/app/components/Toggle/Toggle.tsx +285 -0
- package/app/components/index copy.ts +15 -0
- package/app/components/index.ts +18 -0
- package/app/config/config.base.ts +26 -0
- package/app/config/config.dev.ts +10 -0
- package/app/config/config.prod.ts +10 -0
- package/app/config/index.ts +28 -0
- package/app/context/AuthContext.tsx +14 -0
- package/app/context/EpisodeContext.tsx +136 -0
- package/app/context/auth/AuthProvider.tsx +340 -0
- package/app/context/auth/hooks.ts +29 -0
- package/app/context/auth/index.ts +38 -0
- package/app/context/auth/reducer.ts +68 -0
- package/app/context/auth/services.ts +394 -0
- package/app/context/auth/types.ts +99 -0
- package/app/context/auth/validation.ts +45 -0
- package/app/devtools/ReactotronClient.ts +9 -0
- package/app/devtools/ReactotronClient.web.ts +12 -0
- package/app/devtools/ReactotronConfig.ts +139 -0
- package/app/i18n/ar.ts +126 -0
- package/app/i18n/demo-ar.ts +464 -0
- package/app/i18n/demo-en.ts +462 -0
- package/app/i18n/demo-es.ts +469 -0
- package/app/i18n/demo-fr.ts +471 -0
- package/app/i18n/demo-hi.ts +468 -0
- package/app/i18n/demo-ja.ts +464 -0
- package/app/i18n/demo-ko.ts +457 -0
- package/app/i18n/en.ts +146 -0
- package/app/i18n/es.ts +132 -0
- package/app/i18n/fr.ts +132 -0
- package/app/i18n/hi.ts +131 -0
- package/app/i18n/index.ts +86 -0
- package/app/i18n/ja.ts +130 -0
- package/app/i18n/ko.ts +129 -0
- package/app/i18n/translate.ts +33 -0
- package/app/lib/Parse/index.ts +2 -0
- package/app/lib/Parse/parse.ts +62 -0
- package/app/navigators/AppNavigator.tsx +145 -0
- package/app/navigators/DemoNavigator.tsx +137 -0
- package/app/navigators/navigationUtilities.ts +208 -0
- package/app/screens/ChooseAuthScreen.tsx +224 -0
- package/app/screens/DemoCommunityScreen.tsx +141 -0
- package/app/screens/DemoDebugScreen.tsx +192 -0
- package/app/screens/DemoPodcastListScreen.tsx +387 -0
- package/app/screens/DemoShowroomScreen/DemoDivider.tsx +66 -0
- package/app/screens/DemoShowroomScreen/DemoShowroomScreen.tsx +313 -0
- package/app/screens/DemoShowroomScreen/DemoUseCase.tsx +52 -0
- package/app/screens/DemoShowroomScreen/DrawerIconButton.tsx +120 -0
- package/app/screens/DemoShowroomScreen/SectionListWithKeyboardAwareScrollView.tsx +59 -0
- package/app/screens/DemoShowroomScreen/demos/DemoAutoImage.tsx +230 -0
- package/app/screens/DemoShowroomScreen/demos/DemoButton.tsx +234 -0
- package/app/screens/DemoShowroomScreen/demos/DemoCard.tsx +181 -0
- package/app/screens/DemoShowroomScreen/demos/DemoEmptyState.tsx +78 -0
- package/app/screens/DemoShowroomScreen/demos/DemoHeader.tsx +151 -0
- package/app/screens/DemoShowroomScreen/demos/DemoIcon.tsx +115 -0
- package/app/screens/DemoShowroomScreen/demos/DemoListItem.tsx +218 -0
- package/app/screens/DemoShowroomScreen/demos/DemoText.tsx +144 -0
- package/app/screens/DemoShowroomScreen/demos/DemoTextField.tsx +233 -0
- package/app/screens/DemoShowroomScreen/demos/DemoToggle.tsx +354 -0
- package/app/screens/DemoShowroomScreen/demos/index.ts +12 -0
- package/app/screens/ErrorScreen/ErrorBoundary.tsx +76 -0
- package/app/screens/ErrorScreen/ErrorDetails.tsx +98 -0
- package/app/screens/ForgetPasswordScreen.tsx +180 -0
- package/app/screens/LoginScreen.tsx +260 -0
- package/app/screens/RegisterScreen.tsx +395 -0
- package/app/screens/WelcomeScreen.tsx +114 -0
- package/app/services/api/apiProblem.test.ts +73 -0
- package/app/services/api/apiProblem.ts +74 -0
- package/app/services/api/index.ts +91 -0
- package/app/services/api/types.ts +50 -0
- package/app/theme/colors.ts +85 -0
- package/app/theme/colorsDark.ts +50 -0
- package/app/theme/context.tsx +145 -0
- package/app/theme/context.utils.ts +25 -0
- package/app/theme/spacing.ts +14 -0
- package/app/theme/spacingDark.ts +14 -0
- package/app/theme/styles.ts +24 -0
- package/app/theme/theme.ts +23 -0
- package/app/theme/timing.ts +6 -0
- package/app/theme/types.ts +64 -0
- package/app/theme/typography.ts +71 -0
- package/app/utils/crashReporting.ts +62 -0
- package/app/utils/delay.ts +6 -0
- package/app/utils/formatDate.ts +49 -0
- package/app/utils/gestureHandler.native.ts +3 -0
- package/app/utils/gestureHandler.ts +6 -0
- package/app/utils/hasValidStringProp.ts +11 -0
- package/app/utils/openLinkInBrowser.ts +8 -0
- package/app/utils/storage/index.ts +82 -0
- package/app/utils/storage/storage.test.ts +61 -0
- package/app/utils/useHeader.tsx +37 -0
- package/app/utils/useIsMounted.ts +18 -0
- package/app/utils/useSafeAreaInsetsStyle.ts +46 -0
- package/app.config.ts +39 -0
- package/app.json +67 -0
- package/assets/icons/back.png +0 -0
- package/assets/icons/back@2x.png +0 -0
- package/assets/icons/back@3x.png +0 -0
- package/assets/icons/bell.png +0 -0
- package/assets/icons/bell@2x.png +0 -0
- package/assets/icons/bell@3x.png +0 -0
- package/assets/icons/caretLeft.png +0 -0
- package/assets/icons/caretLeft@2x.png +0 -0
- package/assets/icons/caretLeft@3x.png +0 -0
- package/assets/icons/caretRight.png +0 -0
- package/assets/icons/caretRight@2x.png +0 -0
- package/assets/icons/caretRight@3x.png +0 -0
- package/assets/icons/check.png +0 -0
- package/assets/icons/check@2x.png +0 -0
- package/assets/icons/check@3x.png +0 -0
- package/assets/icons/demo/clap.png +0 -0
- package/assets/icons/demo/clap@2x.png +0 -0
- package/assets/icons/demo/clap@3x.png +0 -0
- package/assets/icons/demo/community.png +0 -0
- package/assets/icons/demo/community@2x.png +0 -0
- package/assets/icons/demo/community@3x.png +0 -0
- package/assets/icons/demo/components.png +0 -0
- package/assets/icons/demo/components@2x.png +0 -0
- package/assets/icons/demo/components@3x.png +0 -0
- package/assets/icons/demo/debug.png +0 -0
- package/assets/icons/demo/debug@2x.png +0 -0
- package/assets/icons/demo/debug@3x.png +0 -0
- package/assets/icons/demo/github.png +0 -0
- package/assets/icons/demo/github@2x.png +0 -0
- package/assets/icons/demo/github@3x.png +0 -0
- package/assets/icons/demo/heart.png +0 -0
- package/assets/icons/demo/heart@2x.png +0 -0
- package/assets/icons/demo/heart@3x.png +0 -0
- package/assets/icons/demo/pin.png +0 -0
- package/assets/icons/demo/pin@2x.png +0 -0
- package/assets/icons/demo/pin@3x.png +0 -0
- package/assets/icons/demo/podcast.png +0 -0
- package/assets/icons/demo/podcast@2x.png +0 -0
- package/assets/icons/demo/podcast@3x.png +0 -0
- package/assets/icons/demo/slack.png +0 -0
- package/assets/icons/demo/slack@2x.png +0 -0
- package/assets/icons/demo/slack@3x.png +0 -0
- package/assets/icons/google.png +0 -0
- package/assets/icons/hidden.png +0 -0
- package/assets/icons/hidden@2x.png +0 -0
- package/assets/icons/hidden@3x.png +0 -0
- package/assets/icons/ladybug.png +0 -0
- package/assets/icons/ladybug@2x.png +0 -0
- package/assets/icons/ladybug@3x.png +0 -0
- package/assets/icons/lock.png +0 -0
- package/assets/icons/lock@2x.png +0 -0
- package/assets/icons/lock@3x.png +0 -0
- package/assets/icons/menu.png +0 -0
- package/assets/icons/menu@2x.png +0 -0
- package/assets/icons/menu@3x.png +0 -0
- package/assets/icons/more.png +0 -0
- package/assets/icons/more@2x.png +0 -0
- package/assets/icons/more@3x.png +0 -0
- package/assets/icons/settings.png +0 -0
- package/assets/icons/settings@2x.png +0 -0
- package/assets/icons/settings@3x.png +0 -0
- package/assets/icons/view.png +0 -0
- package/assets/icons/view@2x.png +0 -0
- package/assets/icons/view@3x.png +0 -0
- package/assets/icons/x.png +0 -0
- package/assets/icons/x@2x.png +0 -0
- package/assets/icons/x@3x.png +0 -0
- package/assets/images/app-icon-all.png +0 -0
- package/assets/images/app-icon-android-adaptive-background.png +0 -0
- package/assets/images/app-icon-android-adaptive-foreground.png +0 -0
- package/assets/images/app-icon-android-legacy.png +0 -0
- package/assets/images/app-icon-ios.png +0 -0
- package/assets/images/app-icon-web-favicon.png +0 -0
- package/assets/images/demo/cr-logo.png +0 -0
- package/assets/images/demo/cr-logo@2x.png +0 -0
- package/assets/images/demo/cr-logo@3x.png +0 -0
- package/assets/images/demo/rnl-logo.png +0 -0
- package/assets/images/demo/rnl-logo@2x.png +0 -0
- package/assets/images/demo/rnl-logo@3x.png +0 -0
- package/assets/images/demo/rnn-logo.png +0 -0
- package/assets/images/demo/rnn-logo@2x.png +0 -0
- package/assets/images/demo/rnn-logo@3x.png +0 -0
- package/assets/images/demo/rnr-image-1.png +0 -0
- package/assets/images/demo/rnr-image-1@2x.png +0 -0
- package/assets/images/demo/rnr-image-1@3x.png +0 -0
- package/assets/images/demo/rnr-image-2.png +0 -0
- package/assets/images/demo/rnr-image-2@2x.png +0 -0
- package/assets/images/demo/rnr-image-2@3x.png +0 -0
- package/assets/images/demo/rnr-image-3.png +0 -0
- package/assets/images/demo/rnr-image-3@2x.png +0 -0
- package/assets/images/demo/rnr-image-3@3x.png +0 -0
- package/assets/images/demo/rnr-logo.png +0 -0
- package/assets/images/demo/rnr-logo@2x.png +0 -0
- package/assets/images/demo/rnr-logo@3x.png +0 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/logo@2x.png +0 -0
- package/assets/images/logo@3x.png +0 -0
- package/assets/images/sad-face.png +0 -0
- package/assets/images/sad-face@2x.png +0 -0
- package/assets/images/sad-face@3x.png +0 -0
- package/assets/images/welcome-face.png +0 -0
- package/assets/images/welcome-face@2x.png +0 -0
- package/assets/images/welcome-face@3x.png +0 -0
- package/babel.config.js +7 -0
- package/bin/cli.js +196 -0
- package/ignite/templates/app-icon/android-adaptive-background.png +0 -0
- package/ignite/templates/app-icon/android-adaptive-foreground.png +0 -0
- package/ignite/templates/app-icon/android-legacy.png +0 -0
- package/ignite/templates/app-icon/ios-universal.png +0 -0
- package/ignite/templates/component/NAME.tsx.ejs +39 -0
- package/ignite/templates/navigator/NAMENavigator.tsx.ejs +18 -0
- package/ignite/templates/screen/NAMEScreen.tsx.ejs +29 -0
- package/ignite/templates/splash-screen/logo.png +0 -0
- package/index.tsx +9 -0
- package/jest.config.js +5 -0
- package/metro.config.js +31 -0
- package/package.json +166 -0
- package/plugins/withSplashScreen.ts +69 -0
- package/src/app/_layout.tsx +58 -0
- package/src/app/index.tsx +5 -0
- package/test/i18n.test.ts +75 -0
- package/test/mockFile.ts +6 -0
- package/test/setup.ts +58 -0
- package/test/test-tsconfig.json +8 -0
- package/tsconfig.json +52 -0
- package/types/lib.es5.d.ts +25 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key, react-native/no-inline-styles */
|
|
2
|
+
import { AutoImage } from "@/components/AutoImage"
|
|
3
|
+
import { Button } from "@/components/Button"
|
|
4
|
+
import { Card } from "@/components/Card"
|
|
5
|
+
import { Icon } from "@/components/Icon"
|
|
6
|
+
|
|
7
|
+
import { DemoDivider } from "../DemoDivider"
|
|
8
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
9
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
10
|
+
|
|
11
|
+
export const DemoCard: Demo = {
|
|
12
|
+
name: "Card",
|
|
13
|
+
description: "demoCard:description",
|
|
14
|
+
data: ({ theme }) => [
|
|
15
|
+
<DemoUseCase
|
|
16
|
+
name="demoCard:useCase.presets.name"
|
|
17
|
+
description="demoCard:useCase.presets.description"
|
|
18
|
+
>
|
|
19
|
+
<Card
|
|
20
|
+
headingTx="demoCard:useCase.presets.default.heading"
|
|
21
|
+
contentTx="demoCard:useCase.presets.default.content"
|
|
22
|
+
footerTx="demoCard:useCase.presets.default.footer"
|
|
23
|
+
/>
|
|
24
|
+
<DemoDivider />
|
|
25
|
+
<Card
|
|
26
|
+
headingTx="demoCard:useCase.presets.reversed.heading"
|
|
27
|
+
contentTx="demoCard:useCase.presets.reversed.content"
|
|
28
|
+
footerTx="demoCard:useCase.presets.reversed.footer"
|
|
29
|
+
preset="reversed"
|
|
30
|
+
/>
|
|
31
|
+
</DemoUseCase>,
|
|
32
|
+
|
|
33
|
+
<DemoUseCase
|
|
34
|
+
name="demoCard:useCase.verticalAlignment.name"
|
|
35
|
+
description="demoCard:useCase.verticalAlignment.description"
|
|
36
|
+
>
|
|
37
|
+
<Card
|
|
38
|
+
headingTx="demoCard:useCase.verticalAlignment.top.heading"
|
|
39
|
+
contentTx="demoCard:useCase.verticalAlignment.top.content"
|
|
40
|
+
footerTx="demoCard:useCase.verticalAlignment.top.footer"
|
|
41
|
+
style={{ minHeight: 160 }}
|
|
42
|
+
/>
|
|
43
|
+
<DemoDivider />
|
|
44
|
+
<Card
|
|
45
|
+
headingTx="demoCard:useCase.verticalAlignment.center.heading"
|
|
46
|
+
verticalAlignment="center"
|
|
47
|
+
preset="reversed"
|
|
48
|
+
contentTx="demoCard:useCase.verticalAlignment.center.content"
|
|
49
|
+
footerTx="demoCard:useCase.verticalAlignment.center.footer"
|
|
50
|
+
style={{ minHeight: 160 }}
|
|
51
|
+
/>
|
|
52
|
+
<DemoDivider />
|
|
53
|
+
<Card
|
|
54
|
+
headingTx="demoCard:useCase.verticalAlignment.spaceBetween.heading"
|
|
55
|
+
verticalAlignment="space-between"
|
|
56
|
+
contentTx="demoCard:useCase.verticalAlignment.spaceBetween.content"
|
|
57
|
+
footerTx="demoCard:useCase.verticalAlignment.spaceBetween.footer"
|
|
58
|
+
style={{ minHeight: 160 }}
|
|
59
|
+
/>
|
|
60
|
+
<DemoDivider />
|
|
61
|
+
<Card
|
|
62
|
+
preset="reversed"
|
|
63
|
+
headingTx="demoCard:useCase.verticalAlignment.reversed.heading"
|
|
64
|
+
verticalAlignment="force-footer-bottom"
|
|
65
|
+
contentTx="demoCard:useCase.verticalAlignment.reversed.content"
|
|
66
|
+
footerTx="demoCard:useCase.verticalAlignment.reversed.footer"
|
|
67
|
+
style={{ minHeight: 160 }}
|
|
68
|
+
/>
|
|
69
|
+
</DemoUseCase>,
|
|
70
|
+
|
|
71
|
+
<DemoUseCase
|
|
72
|
+
name="demoCard:useCase.passingContent.name"
|
|
73
|
+
description="demoCard:useCase.passingContent.description"
|
|
74
|
+
>
|
|
75
|
+
<Card
|
|
76
|
+
headingTx="demoCard:useCase.passingContent.heading"
|
|
77
|
+
contentTx="demoCard:useCase.passingContent.content"
|
|
78
|
+
footerTx="demoCard:useCase.passingContent.footer"
|
|
79
|
+
/>
|
|
80
|
+
<DemoDivider />
|
|
81
|
+
<Card
|
|
82
|
+
preset="reversed"
|
|
83
|
+
headingTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
84
|
+
headingTxOptions={{ prop: "heading" }}
|
|
85
|
+
contentTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
86
|
+
contentTxOptions={{ prop: "content" }}
|
|
87
|
+
footerTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
88
|
+
footerTxOptions={{ prop: "footer" }}
|
|
89
|
+
/>
|
|
90
|
+
</DemoUseCase>,
|
|
91
|
+
|
|
92
|
+
<DemoUseCase
|
|
93
|
+
name="demoCard:useCase.customComponent.name"
|
|
94
|
+
description="demoCard:useCase.customComponent.description"
|
|
95
|
+
>
|
|
96
|
+
<Card
|
|
97
|
+
HeadingComponent={
|
|
98
|
+
<Button
|
|
99
|
+
preset="reversed"
|
|
100
|
+
text="HeadingComponent"
|
|
101
|
+
LeftAccessory={(props) => <Icon style={props.style} icon="ladybug" />}
|
|
102
|
+
/>
|
|
103
|
+
}
|
|
104
|
+
ContentComponent={
|
|
105
|
+
<Button
|
|
106
|
+
style={{ marginVertical: theme.spacing.sm }}
|
|
107
|
+
text="ContentComponent"
|
|
108
|
+
LeftAccessory={(props) => <Icon style={props.style} icon="ladybug" />}
|
|
109
|
+
/>
|
|
110
|
+
}
|
|
111
|
+
FooterComponent={
|
|
112
|
+
<Button
|
|
113
|
+
preset="reversed"
|
|
114
|
+
text="FooterComponent"
|
|
115
|
+
LeftAccessory={(props) => <Icon style={props.style} icon="ladybug" />}
|
|
116
|
+
/>
|
|
117
|
+
}
|
|
118
|
+
/>
|
|
119
|
+
<DemoDivider />
|
|
120
|
+
<Card
|
|
121
|
+
headingTx="demoCard:useCase.customComponent.rightComponent"
|
|
122
|
+
verticalAlignment="center"
|
|
123
|
+
RightComponent={
|
|
124
|
+
<AutoImage
|
|
125
|
+
maxWidth={80}
|
|
126
|
+
maxHeight={60}
|
|
127
|
+
style={{ alignSelf: "center" }}
|
|
128
|
+
source={{
|
|
129
|
+
uri: "https://user-images.githubusercontent.com/1775841/184508739-f90d0ce5-7219-42fd-a91f-3382d016eae0.png",
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
}
|
|
133
|
+
/>
|
|
134
|
+
<DemoDivider />
|
|
135
|
+
<Card
|
|
136
|
+
preset="reversed"
|
|
137
|
+
headingTx="demoCard:useCase.customComponent.leftComponent"
|
|
138
|
+
verticalAlignment="center"
|
|
139
|
+
LeftComponent={
|
|
140
|
+
<AutoImage
|
|
141
|
+
maxWidth={80}
|
|
142
|
+
maxHeight={60}
|
|
143
|
+
style={{ alignSelf: "center" }}
|
|
144
|
+
source={{
|
|
145
|
+
uri: "https://user-images.githubusercontent.com/1775841/184508739-f90d0ce5-7219-42fd-a91f-3382d016eae0.png",
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
}
|
|
149
|
+
/>
|
|
150
|
+
</DemoUseCase>,
|
|
151
|
+
|
|
152
|
+
<DemoUseCase
|
|
153
|
+
name="demoCard:useCase.style.name"
|
|
154
|
+
description="demoCard:useCase.style.description"
|
|
155
|
+
>
|
|
156
|
+
<Card
|
|
157
|
+
headingTx="demoCard:useCase.style.heading"
|
|
158
|
+
headingStyle={{ color: theme.colors.error }}
|
|
159
|
+
contentTx="demoCard:useCase.style.content"
|
|
160
|
+
contentStyle={{
|
|
161
|
+
backgroundColor: theme.colors.error,
|
|
162
|
+
color: theme.colors.palette.neutral100,
|
|
163
|
+
}}
|
|
164
|
+
footerTx="demoCard:useCase.style.footer"
|
|
165
|
+
footerStyle={{
|
|
166
|
+
textDecorationLine: "underline line-through",
|
|
167
|
+
textDecorationStyle: "dashed",
|
|
168
|
+
color: theme.colors.error,
|
|
169
|
+
textDecorationColor: theme.colors.error,
|
|
170
|
+
}}
|
|
171
|
+
style={{
|
|
172
|
+
shadowRadius: 5,
|
|
173
|
+
shadowColor: theme.colors.error,
|
|
174
|
+
shadowOpacity: 0.5,
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
</DemoUseCase>,
|
|
178
|
+
],
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// @demo remove-file
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key, react-native/no-inline-styles */
|
|
2
|
+
import { EmptyState } from "@/components/EmptyState"
|
|
3
|
+
|
|
4
|
+
import { DemoDivider } from "../DemoDivider"
|
|
5
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
6
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
7
|
+
|
|
8
|
+
export const DemoEmptyState: Demo = {
|
|
9
|
+
name: "EmptyState",
|
|
10
|
+
description: "demoEmptyState:description",
|
|
11
|
+
data: ({ theme }) => [
|
|
12
|
+
<DemoUseCase
|
|
13
|
+
name="demoEmptyState:useCase.presets.name"
|
|
14
|
+
description="demoEmptyState:useCase.presets.description"
|
|
15
|
+
>
|
|
16
|
+
<EmptyState preset="generic" />
|
|
17
|
+
</DemoUseCase>,
|
|
18
|
+
|
|
19
|
+
<DemoUseCase
|
|
20
|
+
name="demoEmptyState:useCase.passingContent.name"
|
|
21
|
+
description="demoEmptyState:useCase.passingContent.description"
|
|
22
|
+
>
|
|
23
|
+
<EmptyState
|
|
24
|
+
imageSource={require("@assets/images/logo.png")}
|
|
25
|
+
headingTx="demoEmptyState:useCase.passingContent.customizeImageHeading"
|
|
26
|
+
contentTx="demoEmptyState:useCase.passingContent.customizeImageContent"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<DemoDivider size={30} line />
|
|
30
|
+
|
|
31
|
+
<EmptyState
|
|
32
|
+
headingTx="demoEmptyState:useCase.passingContent.viaHeadingProp"
|
|
33
|
+
contentTx="demoEmptyState:useCase.passingContent.viaContentProp"
|
|
34
|
+
buttonTx="demoEmptyState:useCase.passingContent.viaButtonProp"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<DemoDivider size={30} line />
|
|
38
|
+
|
|
39
|
+
<EmptyState
|
|
40
|
+
headingTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
41
|
+
headingTxOptions={{ prop: "heading" }}
|
|
42
|
+
contentTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
43
|
+
contentTxOptions={{ prop: "content" }}
|
|
44
|
+
buttonTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
45
|
+
buttonTxOptions={{ prop: "button" }}
|
|
46
|
+
/>
|
|
47
|
+
</DemoUseCase>,
|
|
48
|
+
|
|
49
|
+
<DemoUseCase
|
|
50
|
+
name="demoEmptyState:useCase.styling.name"
|
|
51
|
+
description="demoEmptyState:useCase.styling.description"
|
|
52
|
+
>
|
|
53
|
+
<EmptyState
|
|
54
|
+
preset="generic"
|
|
55
|
+
style={{ backgroundColor: theme.colors.error, paddingVertical: 20 }}
|
|
56
|
+
imageStyle={{ height: 75, tintColor: theme.colors.palette.neutral100 }}
|
|
57
|
+
ImageProps={{ resizeMode: "contain" }}
|
|
58
|
+
headingStyle={{
|
|
59
|
+
color: theme.colors.palette.neutral100,
|
|
60
|
+
textDecorationLine: "underline",
|
|
61
|
+
textDecorationColor: theme.colors.palette.neutral100,
|
|
62
|
+
}}
|
|
63
|
+
contentStyle={{
|
|
64
|
+
color: theme.colors.palette.neutral100,
|
|
65
|
+
textDecorationLine: "underline",
|
|
66
|
+
textDecorationColor: theme.colors.palette.neutral100,
|
|
67
|
+
}}
|
|
68
|
+
buttonStyle={{ alignSelf: "center", backgroundColor: theme.colors.palette.neutral100 }}
|
|
69
|
+
buttonTextStyle={{ color: theme.colors.error }}
|
|
70
|
+
ButtonProps={{
|
|
71
|
+
preset: "reversed",
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</DemoUseCase>,
|
|
75
|
+
],
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// @demo remove-file
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key, react-native/no-inline-styles */
|
|
2
|
+
import { TextStyle, View, ViewStyle } from "react-native"
|
|
3
|
+
|
|
4
|
+
import { Header } from "@/components/Header"
|
|
5
|
+
import { Icon } from "@/components/Icon"
|
|
6
|
+
import type { ThemedStyle } from "@/theme/types"
|
|
7
|
+
import { $styles } from "@/theme/styles"
|
|
8
|
+
|
|
9
|
+
import { DemoDivider } from "../DemoDivider"
|
|
10
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
11
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
12
|
+
|
|
13
|
+
const $rightAlignTitle: TextStyle = {
|
|
14
|
+
textAlign: "right",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const $customLeftAction: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
18
|
+
backgroundColor: colors.error,
|
|
19
|
+
flexGrow: 0,
|
|
20
|
+
flexBasis: 100,
|
|
21
|
+
height: "100%",
|
|
22
|
+
flexWrap: "wrap",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const $customTitle: ThemedStyle<TextStyle> = ({ colors }) => ({
|
|
27
|
+
textDecorationLine: "underline line-through",
|
|
28
|
+
textDecorationStyle: "dashed",
|
|
29
|
+
color: colors.error,
|
|
30
|
+
textDecorationColor: colors.error,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const $customWhiteTitle: ThemedStyle<TextStyle> = ({ colors }) => ({
|
|
34
|
+
color: colors.palette.neutral100,
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
export const DemoHeader: Demo = {
|
|
38
|
+
name: "Header",
|
|
39
|
+
description: "demoHeader:description",
|
|
40
|
+
data: ({ theme, themed }) => [
|
|
41
|
+
<DemoUseCase
|
|
42
|
+
name="demoHeader:useCase.actionIcons.name"
|
|
43
|
+
description="demoHeader:useCase.actionIcons.description"
|
|
44
|
+
>
|
|
45
|
+
<Header
|
|
46
|
+
titleTx="demoHeader:useCase.actionIcons.leftIconTitle"
|
|
47
|
+
leftIcon="ladybug"
|
|
48
|
+
safeAreaEdges={[]}
|
|
49
|
+
/>
|
|
50
|
+
<DemoDivider size={24} />
|
|
51
|
+
<Header
|
|
52
|
+
titleTx="demoHeader:useCase.actionIcons.rightIconTitle"
|
|
53
|
+
rightIcon="ladybug"
|
|
54
|
+
safeAreaEdges={[]}
|
|
55
|
+
/>
|
|
56
|
+
<DemoDivider size={24} />
|
|
57
|
+
<Header
|
|
58
|
+
titleTx="demoHeader:useCase.actionIcons.bothIconsTitle"
|
|
59
|
+
leftIcon="ladybug"
|
|
60
|
+
rightIcon="ladybug"
|
|
61
|
+
safeAreaEdges={[]}
|
|
62
|
+
/>
|
|
63
|
+
</DemoUseCase>,
|
|
64
|
+
|
|
65
|
+
<DemoUseCase
|
|
66
|
+
name="demoHeader:useCase.actionText.name"
|
|
67
|
+
description="demoHeader:useCase.actionText.description"
|
|
68
|
+
>
|
|
69
|
+
<Header
|
|
70
|
+
titleTx="demoHeader:useCase.actionText.leftTxTitle"
|
|
71
|
+
leftTx="demoShowroomScreen:demoHeaderTxExample"
|
|
72
|
+
safeAreaEdges={[]}
|
|
73
|
+
/>
|
|
74
|
+
<DemoDivider size={24} />
|
|
75
|
+
<Header
|
|
76
|
+
titleTx="demoHeader:useCase.actionText.rightTextTitle"
|
|
77
|
+
rightText="Yay"
|
|
78
|
+
safeAreaEdges={[]}
|
|
79
|
+
/>
|
|
80
|
+
</DemoUseCase>,
|
|
81
|
+
|
|
82
|
+
<DemoUseCase
|
|
83
|
+
name="demoHeader:useCase.customActionComponents.name"
|
|
84
|
+
description="demoHeader:useCase.customActionComponents.description"
|
|
85
|
+
>
|
|
86
|
+
<Header
|
|
87
|
+
titleTx="demoHeader:useCase.customActionComponents.customLeftActionTitle"
|
|
88
|
+
titleMode="flex"
|
|
89
|
+
titleStyle={$rightAlignTitle}
|
|
90
|
+
LeftActionComponent={
|
|
91
|
+
<View style={themed([$styles.row, $customLeftAction])}>
|
|
92
|
+
{Array.from({ length: 20 }, (x, i) => i).map((i) => (
|
|
93
|
+
<Icon key={i} icon="ladybug" color={theme.colors.palette.neutral100} size={20} />
|
|
94
|
+
))}
|
|
95
|
+
</View>
|
|
96
|
+
}
|
|
97
|
+
safeAreaEdges={[]}
|
|
98
|
+
/>
|
|
99
|
+
</DemoUseCase>,
|
|
100
|
+
|
|
101
|
+
<DemoUseCase
|
|
102
|
+
name="demoHeader:useCase.titleModes.name"
|
|
103
|
+
description="demoHeader:useCase.titleModes.description"
|
|
104
|
+
>
|
|
105
|
+
<Header
|
|
106
|
+
titleTx="demoHeader:useCase.titleModes.centeredTitle"
|
|
107
|
+
leftIcon="ladybug"
|
|
108
|
+
rightText="Hooray"
|
|
109
|
+
safeAreaEdges={[]}
|
|
110
|
+
/>
|
|
111
|
+
<DemoDivider size={24} />
|
|
112
|
+
<Header
|
|
113
|
+
titleTx="demoHeader:useCase.titleModes.flexTitle"
|
|
114
|
+
titleMode="flex"
|
|
115
|
+
leftIcon="ladybug"
|
|
116
|
+
rightText="Hooray"
|
|
117
|
+
safeAreaEdges={[]}
|
|
118
|
+
/>
|
|
119
|
+
</DemoUseCase>,
|
|
120
|
+
|
|
121
|
+
<DemoUseCase
|
|
122
|
+
name="demoHeader:useCase.styling.name"
|
|
123
|
+
description="demoHeader:useCase.styling.description"
|
|
124
|
+
>
|
|
125
|
+
<Header
|
|
126
|
+
titleTx="demoHeader:useCase.styling.styledTitle"
|
|
127
|
+
titleStyle={themed($customTitle)}
|
|
128
|
+
safeAreaEdges={[]}
|
|
129
|
+
/>
|
|
130
|
+
<DemoDivider size={24} />
|
|
131
|
+
<Header
|
|
132
|
+
titleTx="demoHeader:useCase.styling.styledWrapperTitle"
|
|
133
|
+
titleStyle={themed($customWhiteTitle)}
|
|
134
|
+
backgroundColor={theme.colors.error}
|
|
135
|
+
style={{ height: 35 }}
|
|
136
|
+
safeAreaEdges={[]}
|
|
137
|
+
/>
|
|
138
|
+
<DemoDivider size={24} />
|
|
139
|
+
<Header
|
|
140
|
+
titleTx="demoHeader:useCase.styling.tintedIconsTitle"
|
|
141
|
+
titleStyle={themed($customWhiteTitle)}
|
|
142
|
+
backgroundColor={theme.colors.error}
|
|
143
|
+
leftIcon="ladybug"
|
|
144
|
+
leftIconColor={theme.colors.palette.neutral100}
|
|
145
|
+
safeAreaEdges={[]}
|
|
146
|
+
/>
|
|
147
|
+
</DemoUseCase>,
|
|
148
|
+
],
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// @demo remove-file
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key */
|
|
2
|
+
import { ImageStyle, TextStyle, View, ViewStyle } from "react-native"
|
|
3
|
+
|
|
4
|
+
import { Icon, iconRegistry, type IconTypes } from "@/components/Icon"
|
|
5
|
+
import { Text } from "@/components/Text"
|
|
6
|
+
import type { ThemedStyle } from "@/theme/types"
|
|
7
|
+
import { $styles } from "@/theme/styles"
|
|
8
|
+
|
|
9
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
10
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
11
|
+
|
|
12
|
+
const $demoIconContainer: ThemedStyle<ViewStyle> = ({ spacing }) => ({
|
|
13
|
+
padding: spacing.xs,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const $iconTile: ThemedStyle<ViewStyle> = ({ spacing }) => ({
|
|
17
|
+
width: "33.333%",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
paddingVertical: spacing.xs,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const $iconTileLabel: ThemedStyle<TextStyle> = ({ colors, spacing }) => ({
|
|
23
|
+
marginTop: spacing.xxs,
|
|
24
|
+
color: colors.textDim,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const $customIconContainer: ThemedStyle<ViewStyle> = ({ colors, spacing }) => ({
|
|
28
|
+
padding: spacing.md,
|
|
29
|
+
backgroundColor: colors.palette.angry500,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const $customIcon: ThemedStyle<ImageStyle> = ({ colors }) => ({
|
|
33
|
+
tintColor: colors.palette.neutral100,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export const DemoIcon: Demo = {
|
|
37
|
+
name: "Icon",
|
|
38
|
+
description: "demoIcon:description",
|
|
39
|
+
data: ({ theme, themed }) => [
|
|
40
|
+
<DemoUseCase
|
|
41
|
+
name="demoIcon:useCase.icons.name"
|
|
42
|
+
description="demoIcon:useCase.icons.description"
|
|
43
|
+
layout="row"
|
|
44
|
+
itemStyle={$styles.flexWrap}
|
|
45
|
+
>
|
|
46
|
+
{Object.keys(iconRegistry).map((icon) => (
|
|
47
|
+
<View key={icon} style={themed($iconTile)}>
|
|
48
|
+
<Icon icon={icon as IconTypes} color={theme.colors.tint} size={35} />
|
|
49
|
+
|
|
50
|
+
<Text size="xs" style={themed($iconTileLabel)}>
|
|
51
|
+
{icon}
|
|
52
|
+
</Text>
|
|
53
|
+
</View>
|
|
54
|
+
))}
|
|
55
|
+
</DemoUseCase>,
|
|
56
|
+
|
|
57
|
+
<DemoUseCase
|
|
58
|
+
name="demoIcon:useCase.size.name"
|
|
59
|
+
description="demoIcon:useCase.size.description"
|
|
60
|
+
layout="row"
|
|
61
|
+
>
|
|
62
|
+
<Icon icon="ladybug" containerStyle={themed($demoIconContainer)} />
|
|
63
|
+
<Icon icon="ladybug" size={35} containerStyle={themed($demoIconContainer)} />
|
|
64
|
+
<Icon icon="ladybug" size={50} containerStyle={themed($demoIconContainer)} />
|
|
65
|
+
<Icon icon="ladybug" size={75} containerStyle={themed($demoIconContainer)} />
|
|
66
|
+
</DemoUseCase>,
|
|
67
|
+
|
|
68
|
+
<DemoUseCase
|
|
69
|
+
name="demoIcon:useCase.color.name"
|
|
70
|
+
description="demoIcon:useCase.color.description"
|
|
71
|
+
layout="row"
|
|
72
|
+
>
|
|
73
|
+
<Icon
|
|
74
|
+
icon="ladybug"
|
|
75
|
+
color={theme.colors.palette.accent500}
|
|
76
|
+
containerStyle={themed($demoIconContainer)}
|
|
77
|
+
/>
|
|
78
|
+
<Icon
|
|
79
|
+
icon="ladybug"
|
|
80
|
+
color={theme.colors.palette.primary500}
|
|
81
|
+
containerStyle={themed($demoIconContainer)}
|
|
82
|
+
/>
|
|
83
|
+
<Icon
|
|
84
|
+
icon="ladybug"
|
|
85
|
+
color={theme.colors.palette.secondary500}
|
|
86
|
+
containerStyle={themed($demoIconContainer)}
|
|
87
|
+
/>
|
|
88
|
+
<Icon
|
|
89
|
+
icon="ladybug"
|
|
90
|
+
color={theme.colors.palette.neutral700}
|
|
91
|
+
containerStyle={themed($demoIconContainer)}
|
|
92
|
+
/>
|
|
93
|
+
<Icon
|
|
94
|
+
icon="ladybug"
|
|
95
|
+
color={theme.colors.palette.angry500}
|
|
96
|
+
containerStyle={themed($demoIconContainer)}
|
|
97
|
+
/>
|
|
98
|
+
</DemoUseCase>,
|
|
99
|
+
|
|
100
|
+
<DemoUseCase
|
|
101
|
+
name="demoIcon:useCase.styling.name"
|
|
102
|
+
description="demoIcon:useCase.styling.description"
|
|
103
|
+
layout="row"
|
|
104
|
+
>
|
|
105
|
+
<Icon
|
|
106
|
+
icon="ladybug"
|
|
107
|
+
style={themed($customIcon)}
|
|
108
|
+
size={40}
|
|
109
|
+
containerStyle={themed($customIconContainer)}
|
|
110
|
+
/>
|
|
111
|
+
</DemoUseCase>,
|
|
112
|
+
],
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// @demo remove-file
|