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,218 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key */
|
|
2
|
+
import { TextStyle, View, ViewStyle } from "react-native"
|
|
3
|
+
|
|
4
|
+
import { Icon } from "@/components/Icon"
|
|
5
|
+
import { ListItem } from "@/components/ListItem"
|
|
6
|
+
import { ListView } from "@/components/ListView"
|
|
7
|
+
import { Text } from "@/components/Text"
|
|
8
|
+
import { translate } from "@/i18n/translate"
|
|
9
|
+
import type { ThemedStyle } from "@/theme/types"
|
|
10
|
+
import { $styles } from "@/theme/styles"
|
|
11
|
+
|
|
12
|
+
import { DemoDivider } from "../DemoDivider"
|
|
13
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
14
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
15
|
+
|
|
16
|
+
const listData =
|
|
17
|
+
`Tempor Id Ea Aliqua Pariatur Aliquip. Irure Minim Voluptate Consectetur Consequat Sint Esse Proident Irure. Nostrud Elit Veniam Nostrud Excepteur Minim Deserunt Quis Dolore Velit Nulla Irure Voluptate Tempor. Occaecat Amet Laboris Nostrud Qui Do Quis Lorem Ex Elit Fugiat Deserunt. In Pariatur Excepteur Exercitation Ex Incididunt Qui Mollit Dolor Sit Non. Culpa Officia Minim Cillum Exercitation Voluptate Proident Laboris Et Est Reprehenderit Quis Pariatur Nisi`
|
|
18
|
+
.split(".")
|
|
19
|
+
.map((item) => item.trim())
|
|
20
|
+
|
|
21
|
+
const $customLeft: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
22
|
+
backgroundColor: colors.error,
|
|
23
|
+
flexGrow: 0,
|
|
24
|
+
flexBasis: 60,
|
|
25
|
+
height: "100%",
|
|
26
|
+
flexWrap: "wrap",
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const $customTextStyle: ThemedStyle<TextStyle> = ({ colors }) => ({
|
|
31
|
+
color: colors.error,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const $customTouchableStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
35
|
+
backgroundColor: colors.error,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const $customContainerStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
39
|
+
borderTopWidth: 5,
|
|
40
|
+
borderTopColor: colors.palette.neutral100,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const $listStyle: ThemedStyle<ViewStyle> = ({ colors, spacing }) => ({
|
|
44
|
+
height: 148,
|
|
45
|
+
paddingHorizontal: spacing.xs,
|
|
46
|
+
backgroundColor: colors.palette.neutral200,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export const DemoListItem: Demo = {
|
|
50
|
+
name: "ListItem",
|
|
51
|
+
description: "demoListItem:description",
|
|
52
|
+
data: ({ theme, themed }) => [
|
|
53
|
+
<DemoUseCase
|
|
54
|
+
name="demoListItem:useCase.height.name"
|
|
55
|
+
description="demoListItem:useCase.height.description"
|
|
56
|
+
>
|
|
57
|
+
<ListItem topSeparator>{translate("demoListItem:useCase.height.defaultHeight")}</ListItem>
|
|
58
|
+
|
|
59
|
+
<ListItem topSeparator height={100}>
|
|
60
|
+
{translate("demoListItem:useCase.height.customHeight")}
|
|
61
|
+
</ListItem>
|
|
62
|
+
|
|
63
|
+
<ListItem topSeparator>{translate("demoListItem:useCase.height.textHeight")}</ListItem>
|
|
64
|
+
|
|
65
|
+
<ListItem topSeparator bottomSeparator TextProps={{ numberOfLines: 1 }}>
|
|
66
|
+
{translate("demoListItem:useCase.height.longText")}
|
|
67
|
+
</ListItem>
|
|
68
|
+
</DemoUseCase>,
|
|
69
|
+
|
|
70
|
+
<DemoUseCase
|
|
71
|
+
name="demoListItem:useCase.separators.name"
|
|
72
|
+
description="demoListItem:useCase.separators.description"
|
|
73
|
+
>
|
|
74
|
+
<ListItem topSeparator>{translate("demoListItem:useCase.separators.topSeparator")}</ListItem>
|
|
75
|
+
|
|
76
|
+
<DemoDivider size={40} />
|
|
77
|
+
|
|
78
|
+
<ListItem topSeparator bottomSeparator>
|
|
79
|
+
{translate("demoListItem:useCase.separators.topAndBottomSeparator")}
|
|
80
|
+
</ListItem>
|
|
81
|
+
|
|
82
|
+
<DemoDivider size={40} />
|
|
83
|
+
|
|
84
|
+
<ListItem bottomSeparator>
|
|
85
|
+
{translate("demoListItem:useCase.separators.bottomSeparator")}
|
|
86
|
+
</ListItem>
|
|
87
|
+
</DemoUseCase>,
|
|
88
|
+
|
|
89
|
+
<DemoUseCase
|
|
90
|
+
name="demoListItem:useCase.icons.name"
|
|
91
|
+
description="demoListItem:useCase.icons.description"
|
|
92
|
+
>
|
|
93
|
+
<ListItem topSeparator leftIcon="ladybug">
|
|
94
|
+
{translate("demoListItem:useCase.icons.leftIcon")}
|
|
95
|
+
</ListItem>
|
|
96
|
+
|
|
97
|
+
<ListItem topSeparator rightIcon="ladybug">
|
|
98
|
+
{translate("demoListItem:useCase.icons.rightIcon")}
|
|
99
|
+
</ListItem>
|
|
100
|
+
|
|
101
|
+
<ListItem topSeparator bottomSeparator rightIcon="ladybug" leftIcon="ladybug">
|
|
102
|
+
{translate("demoListItem:useCase.icons.leftRightIcons")}
|
|
103
|
+
</ListItem>
|
|
104
|
+
</DemoUseCase>,
|
|
105
|
+
|
|
106
|
+
<DemoUseCase
|
|
107
|
+
name="demoListItem:useCase.customLeftRight.name"
|
|
108
|
+
description="demoListItem:useCase.customLeftRight.description"
|
|
109
|
+
>
|
|
110
|
+
<ListItem
|
|
111
|
+
topSeparator
|
|
112
|
+
LeftComponent={
|
|
113
|
+
<View style={themed([$styles.row, $customLeft, { marginEnd: theme.spacing.md }])}>
|
|
114
|
+
{Array.from({ length: 9 }, (x, i) => i).map((i) => (
|
|
115
|
+
<Icon key={i} icon="ladybug" color={theme.colors.palette.neutral100} size={20} />
|
|
116
|
+
))}
|
|
117
|
+
</View>
|
|
118
|
+
}
|
|
119
|
+
>
|
|
120
|
+
{translate("demoListItem:useCase.customLeftRight.customLeft")}
|
|
121
|
+
</ListItem>
|
|
122
|
+
|
|
123
|
+
<ListItem
|
|
124
|
+
topSeparator
|
|
125
|
+
bottomSeparator
|
|
126
|
+
RightComponent={
|
|
127
|
+
<View style={themed([$styles.row, $customLeft, { marginStart: theme.spacing.md }])}>
|
|
128
|
+
{Array.from({ length: 9 }, (x, i) => i).map((i) => (
|
|
129
|
+
<Icon key={i} icon="ladybug" color={theme.colors.palette.neutral100} size={20} />
|
|
130
|
+
))}
|
|
131
|
+
</View>
|
|
132
|
+
}
|
|
133
|
+
>
|
|
134
|
+
{translate("demoListItem:useCase.customLeftRight.customRight")}
|
|
135
|
+
</ListItem>
|
|
136
|
+
</DemoUseCase>,
|
|
137
|
+
|
|
138
|
+
<DemoUseCase
|
|
139
|
+
name="demoListItem:useCase.passingContent.name"
|
|
140
|
+
description="demoListItem:useCase.passingContent.description"
|
|
141
|
+
>
|
|
142
|
+
<ListItem topSeparator text={translate("demoListItem:useCase.passingContent.children")} />
|
|
143
|
+
<ListItem topSeparator tx="demoShowroomScreen:demoViaTxProp" />
|
|
144
|
+
<ListItem topSeparator>{translate("demoListItem:useCase.passingContent.children")}</ListItem>
|
|
145
|
+
<ListItem topSeparator bottomSeparator>
|
|
146
|
+
<Text>
|
|
147
|
+
<Text preset="bold">
|
|
148
|
+
{translate("demoListItem:useCase.passingContent.nestedChildren1")}
|
|
149
|
+
</Text>
|
|
150
|
+
{` `}
|
|
151
|
+
<Text preset="default">
|
|
152
|
+
{translate("demoListItem:useCase.passingContent.nestedChildren2")}
|
|
153
|
+
</Text>
|
|
154
|
+
</Text>
|
|
155
|
+
</ListItem>
|
|
156
|
+
</DemoUseCase>,
|
|
157
|
+
|
|
158
|
+
<DemoUseCase
|
|
159
|
+
name="demoListItem:useCase.listIntegration.name"
|
|
160
|
+
description="demoListItem:useCase.listIntegration.description"
|
|
161
|
+
>
|
|
162
|
+
<View style={themed($listStyle)}>
|
|
163
|
+
<ListView<string>
|
|
164
|
+
data={listData}
|
|
165
|
+
estimatedItemSize={59}
|
|
166
|
+
renderItem={({ item, index }) => (
|
|
167
|
+
<ListItem
|
|
168
|
+
text={item}
|
|
169
|
+
rightIcon="caretRight"
|
|
170
|
+
TextProps={{ numberOfLines: 1 }}
|
|
171
|
+
topSeparator={index !== 0}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
/>
|
|
175
|
+
</View>
|
|
176
|
+
</DemoUseCase>,
|
|
177
|
+
|
|
178
|
+
<DemoUseCase
|
|
179
|
+
name="demoListItem:useCase.styling.name"
|
|
180
|
+
description="demoListItem:useCase.styling.description"
|
|
181
|
+
>
|
|
182
|
+
<ListItem topSeparator textStyle={themed($customTextStyle)}>
|
|
183
|
+
{translate("demoListItem:useCase.styling.styledText")}
|
|
184
|
+
</ListItem>
|
|
185
|
+
|
|
186
|
+
<ListItem
|
|
187
|
+
topSeparator
|
|
188
|
+
textStyle={{ color: theme.colors.palette.neutral100 }}
|
|
189
|
+
style={themed($customTouchableStyle)}
|
|
190
|
+
>
|
|
191
|
+
{translate("demoListItem:useCase.styling.styledText")}
|
|
192
|
+
</ListItem>
|
|
193
|
+
|
|
194
|
+
<ListItem
|
|
195
|
+
topSeparator
|
|
196
|
+
textStyle={{ color: theme.colors.palette.neutral100 }}
|
|
197
|
+
style={themed($customTouchableStyle)}
|
|
198
|
+
containerStyle={themed($customContainerStyle)}
|
|
199
|
+
>
|
|
200
|
+
{translate("demoListItem:useCase.styling.styledContainer")}
|
|
201
|
+
</ListItem>
|
|
202
|
+
<ListItem
|
|
203
|
+
topSeparator
|
|
204
|
+
textStyle={{ color: theme.colors.palette.neutral100 }}
|
|
205
|
+
style={themed($customTouchableStyle)}
|
|
206
|
+
containerStyle={themed($customContainerStyle)}
|
|
207
|
+
rightIcon="ladybug"
|
|
208
|
+
leftIcon="ladybug"
|
|
209
|
+
rightIconColor={theme.colors.palette.neutral100}
|
|
210
|
+
leftIconColor={theme.colors.palette.neutral100}
|
|
211
|
+
>
|
|
212
|
+
{translate("demoListItem:useCase.styling.tintedIcons")}
|
|
213
|
+
</ListItem>
|
|
214
|
+
</DemoUseCase>,
|
|
215
|
+
],
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// @demo remove-file
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key, react-native/no-inline-styles */
|
|
2
|
+
import { Text } from "@/components/Text"
|
|
3
|
+
import { translate } from "@/i18n/translate"
|
|
4
|
+
|
|
5
|
+
import { DemoDivider } from "../DemoDivider"
|
|
6
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
7
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
8
|
+
|
|
9
|
+
export const DemoText: Demo = {
|
|
10
|
+
name: "Text",
|
|
11
|
+
description: "demoText:description",
|
|
12
|
+
data: ({ theme }) => [
|
|
13
|
+
<DemoUseCase
|
|
14
|
+
name="demoText:useCase.presets.name"
|
|
15
|
+
description="demoText:useCase.presets.description"
|
|
16
|
+
>
|
|
17
|
+
<Text>{translate("demoText:useCase.presets.default")}</Text>
|
|
18
|
+
|
|
19
|
+
<DemoDivider />
|
|
20
|
+
|
|
21
|
+
<Text preset="bold">{translate("demoText:useCase.presets.bold")}</Text>
|
|
22
|
+
|
|
23
|
+
<DemoDivider />
|
|
24
|
+
|
|
25
|
+
<Text preset="subheading">{translate("demoText:useCase.presets.subheading")}</Text>
|
|
26
|
+
|
|
27
|
+
<DemoDivider />
|
|
28
|
+
|
|
29
|
+
<Text preset="heading">{translate("demoText:useCase.presets.heading")}</Text>
|
|
30
|
+
</DemoUseCase>,
|
|
31
|
+
|
|
32
|
+
<DemoUseCase
|
|
33
|
+
name="demoText:useCase.sizes.name"
|
|
34
|
+
description="demoText:useCase.sizes.description"
|
|
35
|
+
>
|
|
36
|
+
<Text size="xs">{translate("demoText:useCase.sizes.xs")}</Text>
|
|
37
|
+
|
|
38
|
+
<DemoDivider />
|
|
39
|
+
|
|
40
|
+
<Text size="sm">{translate("demoText:useCase.sizes.sm")}</Text>
|
|
41
|
+
|
|
42
|
+
<DemoDivider />
|
|
43
|
+
|
|
44
|
+
<Text size="md">{translate("demoText:useCase.sizes.md")}</Text>
|
|
45
|
+
|
|
46
|
+
<DemoDivider />
|
|
47
|
+
|
|
48
|
+
<Text size="lg">{translate("demoText:useCase.sizes.lg")}</Text>
|
|
49
|
+
|
|
50
|
+
<DemoDivider />
|
|
51
|
+
|
|
52
|
+
<Text size="xl">{translate("demoText:useCase.sizes.xl")}</Text>
|
|
53
|
+
|
|
54
|
+
<DemoDivider />
|
|
55
|
+
|
|
56
|
+
<Text size="xxl">{translate("demoText:useCase.sizes.xxl")}</Text>
|
|
57
|
+
</DemoUseCase>,
|
|
58
|
+
|
|
59
|
+
<DemoUseCase
|
|
60
|
+
name="demoText:useCase.weights.name"
|
|
61
|
+
description="demoText:useCase.weights.description"
|
|
62
|
+
>
|
|
63
|
+
<Text weight="light">{translate("demoText:useCase.weights.light")}</Text>
|
|
64
|
+
|
|
65
|
+
<DemoDivider />
|
|
66
|
+
|
|
67
|
+
<Text weight="normal">{translate("demoText:useCase.weights.normal")}</Text>
|
|
68
|
+
|
|
69
|
+
<DemoDivider />
|
|
70
|
+
|
|
71
|
+
<Text weight="medium">{translate("demoText:useCase.weights.medium")}</Text>
|
|
72
|
+
|
|
73
|
+
<DemoDivider />
|
|
74
|
+
|
|
75
|
+
<Text weight="semiBold">{translate("demoText:useCase.weights.semibold")}</Text>
|
|
76
|
+
|
|
77
|
+
<DemoDivider />
|
|
78
|
+
|
|
79
|
+
<Text weight="bold">{translate("demoText:useCase.weights.bold")}</Text>
|
|
80
|
+
</DemoUseCase>,
|
|
81
|
+
|
|
82
|
+
<DemoUseCase
|
|
83
|
+
name="demoText:useCase.passingContent.name"
|
|
84
|
+
description="demoText:useCase.passingContent.description"
|
|
85
|
+
>
|
|
86
|
+
<Text text={translate("demoText:useCase.passingContent.viaText")} />
|
|
87
|
+
|
|
88
|
+
<DemoDivider />
|
|
89
|
+
|
|
90
|
+
<Text>
|
|
91
|
+
<Text tx="demoText:useCase.passingContent.viaTx" />
|
|
92
|
+
<Text tx="demoShowroomScreen:lorem2Sentences" />
|
|
93
|
+
</Text>
|
|
94
|
+
|
|
95
|
+
<DemoDivider />
|
|
96
|
+
|
|
97
|
+
<Text>{translate("demoText:useCase.passingContent.children")}</Text>
|
|
98
|
+
|
|
99
|
+
<DemoDivider />
|
|
100
|
+
|
|
101
|
+
<Text>
|
|
102
|
+
<Text>{translate("demoText:useCase.passingContent.nestedChildren")}</Text>
|
|
103
|
+
<Text preset="bold">{translate("demoText:useCase.passingContent.nestedChildren2")}</Text>
|
|
104
|
+
{` `}
|
|
105
|
+
<Text preset="default">{translate("demoText:useCase.passingContent.nestedChildren3")}</Text>
|
|
106
|
+
{` `}
|
|
107
|
+
<Text preset="bold"> {translate("demoText:useCase.passingContent.nestedChildren4")}</Text>
|
|
108
|
+
</Text>
|
|
109
|
+
</DemoUseCase>,
|
|
110
|
+
|
|
111
|
+
<DemoUseCase
|
|
112
|
+
name="demoText:useCase.styling.name"
|
|
113
|
+
description="demoText:useCase.styling.description"
|
|
114
|
+
>
|
|
115
|
+
<Text>
|
|
116
|
+
<Text style={{ color: theme.colors.error }}>
|
|
117
|
+
{translate("demoText:useCase.styling.text")}
|
|
118
|
+
</Text>
|
|
119
|
+
{` `}
|
|
120
|
+
<Text
|
|
121
|
+
style={{
|
|
122
|
+
color: theme.colors.palette.neutral100,
|
|
123
|
+
backgroundColor: theme.colors.error,
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
{translate("demoText:useCase.styling.text2")}
|
|
127
|
+
</Text>
|
|
128
|
+
{` `}
|
|
129
|
+
<Text
|
|
130
|
+
style={{
|
|
131
|
+
textDecorationLine: "underline line-through",
|
|
132
|
+
textDecorationStyle: "dashed",
|
|
133
|
+
color: theme.colors.error,
|
|
134
|
+
textDecorationColor: theme.colors.error,
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
{translate("demoText:useCase.styling.text3")}
|
|
138
|
+
</Text>
|
|
139
|
+
</Text>
|
|
140
|
+
</DemoUseCase>,
|
|
141
|
+
],
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// @demo remove-file
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-key */
|
|
2
|
+
import { TextStyle, ViewStyle } from "react-native"
|
|
3
|
+
|
|
4
|
+
import { Icon } from "@/components/Icon"
|
|
5
|
+
import { TextField } from "@/components/TextField"
|
|
6
|
+
import type { ThemedStyle } from "@/theme/types"
|
|
7
|
+
|
|
8
|
+
import { DemoDivider } from "../DemoDivider"
|
|
9
|
+
import { Demo } from "../DemoShowroomScreen"
|
|
10
|
+
import { DemoUseCase } from "../DemoUseCase"
|
|
11
|
+
|
|
12
|
+
const $customInputStyle: ThemedStyle<TextStyle> = ({ colors }) => ({
|
|
13
|
+
backgroundColor: colors.error,
|
|
14
|
+
color: colors.palette.neutral100,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const $customInputWrapperStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
18
|
+
backgroundColor: colors.error,
|
|
19
|
+
borderColor: colors.palette.neutral800,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const $customContainerStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
23
|
+
backgroundColor: colors.error,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const $customLabelAndHelperStyle: ThemedStyle<TextStyle> = ({ colors }) => ({
|
|
27
|
+
color: colors.palette.neutral100,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const $customInputWithAbsoluteAccessoriesStyle: ThemedStyle<ViewStyle> = ({ spacing }) => ({
|
|
31
|
+
marginHorizontal: spacing.xxl,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const $customLeftAccessoryStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
35
|
+
backgroundColor: colors.error,
|
|
36
|
+
position: "absolute",
|
|
37
|
+
left: 0,
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const $customRightAccessoryStyle: ThemedStyle<ViewStyle> = ({ colors }) => ({
|
|
41
|
+
backgroundColor: colors.error,
|
|
42
|
+
position: "absolute",
|
|
43
|
+
right: 0,
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
export const DemoTextField: Demo = {
|
|
47
|
+
name: "TextField",
|
|
48
|
+
description: "demoTextField:description",
|
|
49
|
+
data: ({ themed }) => [
|
|
50
|
+
<DemoUseCase
|
|
51
|
+
name="demoTextField:useCase.statuses.name"
|
|
52
|
+
description="demoTextField:useCase.statuses.description"
|
|
53
|
+
>
|
|
54
|
+
<TextField
|
|
55
|
+
value="Labore occaecat in id eu commodo aliquip occaecat veniam officia pariatur."
|
|
56
|
+
labelTx="demoTextField:useCase.statuses.noStatus.label"
|
|
57
|
+
labelTxOptions={{ prop: "label" }}
|
|
58
|
+
helperTx="demoTextField:useCase.statuses.noStatus.helper"
|
|
59
|
+
helperTxOptions={{ prop: "helper" }}
|
|
60
|
+
placeholderTx="demoTextField:useCase.statuses.noStatus.placeholder"
|
|
61
|
+
placeholderTxOptions={{ prop: "placeholder" }}
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<DemoDivider size={24} />
|
|
65
|
+
|
|
66
|
+
<TextField
|
|
67
|
+
status="error"
|
|
68
|
+
value="Est Lorem duis sunt sunt duis proident minim elit dolore incididunt pariatur eiusmod anim cillum."
|
|
69
|
+
labelTx="demoTextField:useCase.statuses.error.label"
|
|
70
|
+
labelTxOptions={{ prop: "label" }}
|
|
71
|
+
helperTx="demoTextField:useCase.statuses.error.helper"
|
|
72
|
+
helperTxOptions={{ prop: "helper" }}
|
|
73
|
+
placeholderTx="demoTextField:useCase.statuses.error.placeholder"
|
|
74
|
+
placeholderTxOptions={{ prop: "placeholder" }}
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
<DemoDivider size={24} />
|
|
78
|
+
|
|
79
|
+
<TextField
|
|
80
|
+
status="disabled"
|
|
81
|
+
value="Eu ipsum mollit non minim voluptate nulla fugiat aliqua ullamco aute consectetur nulla nulla amet."
|
|
82
|
+
labelTx="demoTextField:useCase.statuses.disabled.label"
|
|
83
|
+
labelTxOptions={{ prop: "label" }}
|
|
84
|
+
helperTx="demoTextField:useCase.statuses.disabled.helper"
|
|
85
|
+
helperTxOptions={{ prop: "helper" }}
|
|
86
|
+
placeholderTx="demoTextField:useCase.statuses.disabled.placeholder"
|
|
87
|
+
placeholderTxOptions={{ prop: "placeholder" }}
|
|
88
|
+
/>
|
|
89
|
+
</DemoUseCase>,
|
|
90
|
+
|
|
91
|
+
<DemoUseCase
|
|
92
|
+
name="demoTextField:useCase.passingContent.name"
|
|
93
|
+
description="demoTextField:useCase.passingContent.description"
|
|
94
|
+
>
|
|
95
|
+
<TextField
|
|
96
|
+
labelTx="demoTextField:useCase.passingContent.viaLabel.labelTx"
|
|
97
|
+
labelTxOptions={{ prop: "label" }}
|
|
98
|
+
helperTx="demoTextField:useCase.passingContent.viaLabel.helper"
|
|
99
|
+
helperTxOptions={{ prop: "helper" }}
|
|
100
|
+
placeholderTx="demoTextField:useCase.passingContent.viaLabel.placeholder"
|
|
101
|
+
placeholderTxOptions={{ prop: "placeholder" }}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<DemoDivider size={24} />
|
|
105
|
+
|
|
106
|
+
<TextField
|
|
107
|
+
labelTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
108
|
+
labelTxOptions={{ prop: "label" }}
|
|
109
|
+
helperTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
110
|
+
helperTxOptions={{ prop: "helper" }}
|
|
111
|
+
placeholderTx="demoShowroomScreen:demoViaSpecifiedTxProp"
|
|
112
|
+
placeholderTxOptions={{ prop: "placeholder" }}
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
<DemoDivider size={24} />
|
|
116
|
+
|
|
117
|
+
<TextField
|
|
118
|
+
value="Reprehenderit Lorem magna non consequat ullamco cupidatat."
|
|
119
|
+
labelTx="demoTextField:useCase.passingContent.rightAccessory.label"
|
|
120
|
+
labelTxOptions={{ prop: "label" }}
|
|
121
|
+
helperTx="demoTextField:useCase.passingContent.rightAccessory.helper"
|
|
122
|
+
helperTxOptions={{ prop: "helper" }}
|
|
123
|
+
RightAccessory={(props) => <Icon icon="ladybug" containerStyle={props.style} size={21} />}
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
<DemoDivider size={24} />
|
|
127
|
+
|
|
128
|
+
<TextField
|
|
129
|
+
labelTx="demoTextField:useCase.passingContent.leftAccessory.label"
|
|
130
|
+
labelTxOptions={{ prop: "label" }}
|
|
131
|
+
helperTx="demoTextField:useCase.passingContent.leftAccessory.helper"
|
|
132
|
+
helperTxOptions={{ prop: "helper" }}
|
|
133
|
+
value="Eiusmod exercitation mollit elit magna occaecat eiusmod Lorem minim veniam."
|
|
134
|
+
LeftAccessory={(props) => <Icon icon="ladybug" containerStyle={props.style} size={21} />}
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
<DemoDivider size={24} />
|
|
138
|
+
|
|
139
|
+
<TextField
|
|
140
|
+
labelTx="demoTextField:useCase.passingContent.supportsMultiline.label"
|
|
141
|
+
labelTxOptions={{ prop: "label" }}
|
|
142
|
+
helperTx="demoTextField:useCase.passingContent.supportsMultiline.helper"
|
|
143
|
+
helperTxOptions={{ prop: "helper" }}
|
|
144
|
+
value="Eiusmod exercitation mollit elit magna occaecat eiusmod Lorem minim veniam. Laborum Lorem velit velit minim irure ad in ut adipisicing consectetur."
|
|
145
|
+
multiline
|
|
146
|
+
RightAccessory={(props) => <Icon icon="ladybug" containerStyle={props.style} size={21} />}
|
|
147
|
+
/>
|
|
148
|
+
</DemoUseCase>,
|
|
149
|
+
|
|
150
|
+
<DemoUseCase
|
|
151
|
+
name="demoTextField:useCase.styling.name"
|
|
152
|
+
description="demoTextField:useCase.styling.description"
|
|
153
|
+
>
|
|
154
|
+
<TextField
|
|
155
|
+
labelTx="demoTextField:useCase.styling.styleInput.label"
|
|
156
|
+
labelTxOptions={{ prop: "label" }}
|
|
157
|
+
helperTx="demoTextField:useCase.styling.styleInput.helper"
|
|
158
|
+
helperTxOptions={{ prop: "helper" }}
|
|
159
|
+
value="Laborum cupidatat aliquip sunt sunt voluptate sint sit proident sunt mollit exercitation ullamco ea elit."
|
|
160
|
+
style={themed($customInputStyle)}
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
<DemoDivider size={24} />
|
|
164
|
+
|
|
165
|
+
<TextField
|
|
166
|
+
labelTx="demoTextField:useCase.styling.styleInputWrapper.label"
|
|
167
|
+
labelTxOptions={{ prop: "label" }}
|
|
168
|
+
helperTx="demoTextField:useCase.styling.styleInputWrapper.helper"
|
|
169
|
+
helperTxOptions={{ prop: "helper" }}
|
|
170
|
+
value="Aute velit esse dolore pariatur exercitation irure nulla do sunt in duis mollit duis et."
|
|
171
|
+
inputWrapperStyle={themed($customInputWrapperStyle)}
|
|
172
|
+
style={themed($customInputStyle)}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<DemoDivider size={24} />
|
|
176
|
+
|
|
177
|
+
<TextField
|
|
178
|
+
labelTx="demoTextField:useCase.styling.styleContainer.label"
|
|
179
|
+
labelTxOptions={{ prop: "label" }}
|
|
180
|
+
helperTx="demoTextField:useCase.styling.styleContainer.helper"
|
|
181
|
+
helperTxOptions={{ prop: "helper" }}
|
|
182
|
+
value="Aliquip proident commodo adipisicing non adipisicing Lorem excepteur ullamco voluptate laborum."
|
|
183
|
+
style={themed($customInputStyle)}
|
|
184
|
+
containerStyle={themed($customContainerStyle)}
|
|
185
|
+
inputWrapperStyle={themed($customInputWrapperStyle)}
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
<DemoDivider size={24} />
|
|
189
|
+
|
|
190
|
+
<TextField
|
|
191
|
+
labelTx="demoTextField:useCase.styling.styleLabel.label"
|
|
192
|
+
labelTxOptions={{ prop: "label" }}
|
|
193
|
+
helperTx="demoTextField:useCase.styling.styleLabel.helper"
|
|
194
|
+
helperTxOptions={{ prop: "helper" }}
|
|
195
|
+
value="Ex culpa in consectetur dolor irure velit."
|
|
196
|
+
style={themed($customInputStyle)}
|
|
197
|
+
containerStyle={themed($customContainerStyle)}
|
|
198
|
+
inputWrapperStyle={themed($customInputWrapperStyle)}
|
|
199
|
+
HelperTextProps={{ style: themed($customLabelAndHelperStyle) }}
|
|
200
|
+
LabelTextProps={{ style: themed($customLabelAndHelperStyle) }}
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
<DemoDivider size={24} />
|
|
204
|
+
|
|
205
|
+
<TextField
|
|
206
|
+
labelTx="demoTextField:useCase.styling.styleAccessories.label"
|
|
207
|
+
labelTxOptions={{ prop: "label" }}
|
|
208
|
+
helperTx="demoTextField:useCase.styling.styleAccessories.helper"
|
|
209
|
+
helperTxOptions={{ prop: "helper" }}
|
|
210
|
+
value="Aute nisi dolore fugiat anim mollit nulla ex minim ipsum ex elit."
|
|
211
|
+
style={themed($customInputWithAbsoluteAccessoriesStyle)}
|
|
212
|
+
LeftAccessory={() => (
|
|
213
|
+
<Icon
|
|
214
|
+
icon="ladybug"
|
|
215
|
+
containerStyle={themed($customLeftAccessoryStyle)}
|
|
216
|
+
color="white"
|
|
217
|
+
size={41}
|
|
218
|
+
/>
|
|
219
|
+
)}
|
|
220
|
+
RightAccessory={() => (
|
|
221
|
+
<Icon
|
|
222
|
+
icon="ladybug"
|
|
223
|
+
containerStyle={themed($customRightAccessoryStyle)}
|
|
224
|
+
color="white"
|
|
225
|
+
size={41}
|
|
226
|
+
/>
|
|
227
|
+
)}
|
|
228
|
+
/>
|
|
229
|
+
</DemoUseCase>,
|
|
230
|
+
],
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// @demo remove-file
|