@idealyst/navigation 1.0.83 → 1.0.84

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.
@@ -1,196 +0,0 @@
1
- import React from 'react';
2
- import { AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, PopoverExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples } from "../../../components/src/examples";
3
- import { DataGridShowcase } from "../../../datagrid/src/examples";
4
- import { DatePickerExamples } from "../../../datepicker/src/examples";
5
- import { Screen, Text, View, Button } from "../../../components/src";
6
- import { UnistylesRuntime } from 'react-native-unistyles';
7
- import { RouteParam } from '../routing';
8
- import { getNextTheme, getThemeDisplayName, isHighContrastTheme } from './unistyles';
9
-
10
- const HomeDrawerScreen = () => {
11
- const currentTheme = UnistylesRuntime.themeName || 'light';
12
-
13
- const cycleTheme = () => {
14
- const nextTheme = getNextTheme(currentTheme);
15
- UnistylesRuntime.setTheme(nextTheme as any);
16
- console.log('Theme changed to:', nextTheme);
17
- };
18
-
19
- const toggleHighContrast = () => {
20
- const currentTheme = UnistylesRuntime.themeName || 'light';
21
- let newTheme: string;
22
-
23
- if (isHighContrastTheme(currentTheme)) {
24
- // Switch to standard variant
25
- newTheme = currentTheme.includes('dark') ? 'dark' : 'light';
26
- } else {
27
- // Switch to high contrast variant
28
- newTheme = currentTheme.includes('dark') ? 'darkHighContrast' : 'lightHighContrast';
29
- }
30
-
31
- UnistylesRuntime.setTheme(newTheme as any);
32
- console.log('Theme toggled to:', newTheme);
33
- };
34
-
35
- return (
36
- <Screen>
37
- <View style={{ gap: 16 }}>
38
- <Text size="large" weight="bold">
39
- Welcome to the Component Library
40
- </Text>
41
- <Text size="medium">
42
- Use the drawer menu to explore different components
43
- </Text>
44
-
45
- <View style={{ gap: 12, padding: 16, backgroundColor: 'rgba(128, 128, 128, 0.1)', borderRadius: 8, marginTop: 8 }}>
46
- <Text size="medium" weight="semibold">
47
- Theme Controls
48
- </Text>
49
- <Text size="small">
50
- Current Theme: {getThemeDisplayName(currentTheme)}
51
- </Text>
52
-
53
- <View style={{ gap: 8 }}>
54
- <Button variant="outlined" onPress={cycleTheme}>
55
- 🔄 Cycle Theme (Light → Dark → Light HC → Dark HC)
56
- </Button>
57
-
58
- <Button variant="outlined" onPress={toggleHighContrast}>
59
- ♿ Toggle High Contrast
60
- </Button>
61
- </View>
62
-
63
- {isHighContrastTheme(currentTheme) && (
64
- <Text size="small" style={{ fontStyle: 'italic' }}>
65
- ♿ High contrast mode is active for better accessibility
66
- </Text>
67
- )}
68
- </View>
69
- </View>
70
- </Screen>
71
- );
72
- };
73
-
74
- const AvatarDrawerScreen = () => (
75
- <Screen>
76
- <AvatarExamples />
77
- </Screen>
78
- );
79
-
80
- const BadgeDrawerScreen = () => (
81
- <Screen>
82
- <BadgeExamples />
83
- </Screen>
84
- );
85
-
86
- const ButtonDrawerScreen = () => (
87
- <Screen>
88
- <ButtonExamples />
89
- </Screen>
90
- );
91
-
92
- const CardDrawerScreen = () => (
93
- <Screen>
94
- <CardExamples />
95
- </Screen>
96
- );
97
-
98
- const CheckboxDrawerScreen = () => (
99
- <Screen>
100
- <CheckboxExamples />
101
- </Screen>
102
- );
103
-
104
- const DividerDrawerScreen = () => (
105
- <Screen>
106
- <DividerExamples />
107
- </Screen>
108
- );
109
-
110
- const InputDrawerScreen = () => (
111
- <Screen>
112
- <InputExamples />
113
- </Screen>
114
- );
115
-
116
- const TextDrawerScreen = () => (
117
- <Screen>
118
- <TextExamples />
119
- </Screen>
120
- );
121
-
122
- const ViewDrawerScreen = () => (
123
- <Screen>
124
- <ViewExamples />
125
- </Screen>
126
- );
127
-
128
- const IconDrawerScreen = () => (
129
- <Screen>
130
- <IconExamples />
131
- </Screen>
132
- );
133
-
134
- const SVGImageDrawerScreen = () => (
135
- <Screen>
136
- <SVGImageExamples />
137
- </Screen>
138
- );
139
-
140
- const DialogDrawerScreen = () => (
141
- <Screen>
142
- <DialogExamples />
143
- </Screen>
144
- );
145
-
146
- const PopoverDrawerScreen = () => (
147
- <Screen>
148
- <PopoverExamples />
149
- </Screen>
150
- );
151
-
152
- const DataGridDrawerScreen = () => (
153
- <Screen>
154
- <DataGridShowcase />
155
- </Screen>
156
- );
157
-
158
- const DatePickerDrawerScreen = () => (
159
- <Screen>
160
- <DatePickerExamples />
161
- </Screen>
162
- );
163
-
164
- const ThemeExtensionDrawerScreen = () => (
165
- <Screen>
166
- <ThemeExtensionExamples />
167
- </Screen>
168
- );
169
-
170
- const DrawerRouter: RouteParam = {
171
- path: "/",
172
- component: HomeDrawerScreen,
173
- layout: {
174
- type: "drawer",
175
- },
176
- routes: [
177
- { path: "avatar", component: AvatarDrawerScreen },
178
- { path: "badge", component: BadgeDrawerScreen },
179
- { path: "button", component: ButtonDrawerScreen },
180
- { path: "card", component: CardDrawerScreen },
181
- { path: "checkbox", component: CheckboxDrawerScreen },
182
- { path: "divider", component: DividerDrawerScreen },
183
- { path: "input", component: InputDrawerScreen },
184
- { path: "text", component: TextDrawerScreen },
185
- { path: "view", component: ViewDrawerScreen },
186
- { path: "icon", component: IconDrawerScreen },
187
- { path: "svg-image", component: SVGImageDrawerScreen },
188
- { path: "dialog", component: DialogDrawerScreen },
189
- { path: "popover", component: PopoverDrawerScreen },
190
- { path: "datagrid", component: DataGridDrawerScreen },
191
- { path: "datepicker", component: DatePickerDrawerScreen },
192
- { path: "theme-extension", component: ThemeExtensionDrawerScreen },
193
- ],
194
- };
195
-
196
- export default DrawerRouter;
@@ -1,62 +0,0 @@
1
- import { NavigatorParam, RouteParam } from '../routing';
2
- import React from 'react';
3
- import { Button, Screen, Text } from '../../../components/src';
4
- import { useNavigator } from '../context';
5
- import CustomTabLayout from './CustomTabLayout';
6
- import CustomStackLayout from './CustomStackLayout';
7
-
8
- const RootScreen = () => {
9
-
10
- const navigator = useNavigator();
11
-
12
- return <Screen>
13
- <Text>Root Screen</Text>
14
- <Button title="Go to Tab" onPress={() => navigator.navigate({
15
- path: '/tab',
16
- vars: {},
17
- })} />
18
- </Screen>
19
- }
20
-
21
- const ExampleHybridRouter: NavigatorParam = {
22
- path: '/',
23
- type: 'navigator',
24
- layout: 'stack',
25
- layoutComponent: CustomStackLayout,
26
- routes: [
27
- {
28
- type: 'screen',
29
- path: '/',
30
- component: RootScreen,
31
- options: {
32
- title: 'Example',
33
- },
34
- },
35
- {
36
- type: 'navigator',
37
- path: '/tab',
38
- layout: 'tab',
39
- layoutComponent: CustomTabLayout,
40
- routes: [
41
- {
42
- type: 'screen',
43
- path: '/a',
44
- component: () => <Text>Tab A Example</Text>,
45
- options: {
46
- title: 'Tab Example',
47
- },
48
- },
49
- {
50
- type: 'screen',
51
- path: '/b',
52
- component: () => <Text>Tab B Example</Text>,
53
- options: {
54
- title: 'B',
55
- },
56
- },
57
- ]
58
- },
59
- ]
60
- }
61
-
62
- export default ExampleHybridRouter;
@@ -1,276 +0,0 @@
1
- import React from 'react';
2
- import { AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, PopoverExamples, ScreenExamples, SelectExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples } from "../../../components/src/examples";
3
- import { DataGridShowcase } from "../../../datagrid/src/examples";
4
- import { DatePickerExamples } from "../../../datepicker/src/examples";
5
- import { Button, Divider, Screen, Text, View } from "../../../components/src";
6
- import { useNavigator } from "../context";
7
- import { UnistylesRuntime } from 'react-native-unistyles';
8
- import { NavigatorParam, RouteParam } from '../routing';
9
- import { getNextTheme, getThemeDisplayName, isHighContrastTheme } from './unistyles';
10
-
11
- const HomeScreen = () => {
12
- const navigator = useNavigator();
13
- const currentTheme = UnistylesRuntime.themeName || 'light';
14
-
15
- const cycleTheme = () => {
16
- const nextTheme = getNextTheme(currentTheme);
17
- UnistylesRuntime.setTheme(nextTheme as any);
18
- console.log('Theme changed to:', nextTheme);
19
- };
20
-
21
- const toggleHighContrast = () => {
22
- const currentTheme = UnistylesRuntime.themeName || 'light';
23
- let newTheme: string;
24
-
25
- if (isHighContrastTheme(currentTheme)) {
26
- // Switch to standard variant
27
- newTheme = currentTheme.includes('dark') ? 'dark' : 'light';
28
- } else {
29
- // Switch to high contrast variant
30
- newTheme = currentTheme.includes('dark') ? 'darkHighContrast' : 'lightHighContrast';
31
- }
32
-
33
- UnistylesRuntime.setTheme(newTheme as any);
34
- console.log('Theme toggled to:', newTheme);
35
- };
36
-
37
- return (
38
- <Screen>
39
- <View style={{ maxWidth: 800, width: '100%', gap: 10, marginHorizontal: 'auto' }}>
40
- {/* Theme Controls Section */}
41
- <View style={{ gap: 12, padding: 16, backgroundColor: 'rgba(128, 128, 128, 0.1)', borderRadius: 8 }}>
42
- <Text size="medium" weight="bold">
43
- Theme Controls
44
- </Text>
45
- <Text size="small">
46
- Current Theme: {getThemeDisplayName(currentTheme)}
47
- </Text>
48
-
49
- <View style={{ flexDirection: 'row', gap: 12, flexWrap: 'wrap' }}>
50
- <Button
51
- variant="outlined"
52
- intent="primary"
53
- size="medium"
54
- onPress={cycleTheme}
55
- >
56
- 🔄 Cycle Theme
57
- </Button>
58
-
59
- <Button
60
- variant="outlined"
61
- intent="neutral"
62
- size="medium"
63
- onPress={toggleHighContrast}
64
- >
65
- ♿ Toggle High Contrast 123
66
- </Button>
67
- </View>
68
-
69
- {isHighContrastTheme(currentTheme) && (
70
- <Text size="small" style={{ fontStyle: 'italic', color: '#666' }}>
71
- ♿ High contrast mode is active for better accessibility
72
- </Text>
73
- )}
74
- </View>
75
-
76
- {/* Component Navigation Buttons */}
77
- <View style={{ gap: 10 }}>
78
- <Button
79
- onPress={() => {
80
- navigator.navigate({
81
- path: "/avatar",
82
- vars: {},
83
- });
84
- }}>
85
- Avatar
86
- </Button>
87
- <Button
88
- onPress={() => {
89
- navigator.navigate({
90
- path: "/badge",
91
- vars: {},
92
- });
93
- }}>
94
- Badge
95
- </Button>
96
- <Button
97
- onPress={() => {
98
- navigator.navigate({
99
- path: "/button",
100
- vars: {},
101
- });
102
- }}>
103
- Button
104
- </Button>
105
- <Button
106
- onPress={() => {
107
- navigator.navigate({
108
- path: "/card",
109
- vars: {},
110
- });
111
- }}>
112
- Card
113
- </Button>
114
- <Button
115
- onPress={() => {
116
- navigator.navigate({
117
- path: "/checkbox",
118
- vars: {},
119
- });
120
- }}>
121
- Checkbox
122
- </Button>
123
- <Button
124
- onPress={() => {
125
- navigator.navigate({
126
- path: "/divider",
127
- vars: {},
128
- });
129
- }}>
130
- Divider
131
- </Button>
132
- <Button
133
- onPress={() => {
134
- navigator.navigate({
135
- path: "/input",
136
- vars: {},
137
- });
138
- }}>
139
- Input
140
- </Button>
141
- <Button
142
- onPress={() => {
143
- navigator.navigate({
144
- path: "/text",
145
- vars: {},
146
- });
147
- }}>
148
- Text
149
- </Button>
150
- <Button
151
- onPress={() => {
152
- navigator.navigate({
153
- path: "/view",
154
- vars: {},
155
- });
156
- }}>
157
- View
158
- </Button>
159
- <Button
160
- onPress={() => {
161
- navigator.navigate({
162
- path: "/screen",
163
- vars: {},
164
- });
165
- }}>
166
- Screen
167
- </Button>
168
- <Button
169
- onPress={() => {
170
- navigator.navigate({
171
- path: "/icon",
172
- vars: {},
173
- });
174
- }}>
175
- Icon
176
- </Button>
177
- <Button
178
- onPress={() => {
179
- navigator.navigate({
180
- path: "/dialog",
181
- vars: {},
182
- });
183
- }}>
184
- Dialog
185
- </Button>
186
- <Button
187
- onPress={() => {
188
- navigator.navigate({
189
- path: "/popover",
190
- vars: {},
191
- });
192
- }}>
193
- Popover
194
- </Button>
195
- <Button
196
- onPress={() => {
197
- navigator.navigate({
198
- path: "/select",
199
- vars: {},
200
- });
201
- }}>
202
- Select
203
- </Button>
204
-
205
- <Divider spacing="medium" />
206
- <Text size="small" weight="semibold" color="secondary">Data Components</Text>
207
- <Button
208
- variant="outlined"
209
- intent="neutral"
210
- onPress={() => {
211
- navigator.navigate({
212
- path: "/datagrid",
213
- vars: {},
214
- });
215
- }}>
216
- 📊 DataGrid Showcase
217
- </Button>
218
- <Button
219
- variant="outlined"
220
- intent="neutral"
221
- onPress={() => {
222
- navigator.navigate({
223
- path: "/datepicker",
224
- vars: {},
225
- });
226
- }}>
227
- 📅 DatePicker Examples
228
- </Button>
229
-
230
- <Divider spacing="medium" />
231
- <Text size="small" weight="semibold" color="secondary">Theme System</Text>
232
- <Button
233
- variant="outlined"
234
- intent="success"
235
- onPress={() => {
236
- navigator.navigate({
237
- path: "/theme-extension",
238
- vars: {},
239
- });
240
- }}>
241
- 🎨 Theme Extension Demo
242
- </Button>
243
- </View>
244
- </View>
245
- </Screen>
246
- )
247
- };
248
-
249
- const StackRouter: NavigatorParam = {
250
- path: "/",
251
- type: 'navigator',
252
- layout: 'stack',
253
- routes: [
254
- { path: "/", type: 'screen', component: HomeScreen },
255
- { path: "avatar", type: 'screen', component: AvatarExamples},
256
- { path: "badge", type: 'screen', component: BadgeExamples},
257
- { path: "button", type: 'screen', component: ButtonExamples},
258
- { path: "card", type: 'screen', component: CardExamples},
259
- { path: "checkbox", type: 'screen', component: CheckboxExamples},
260
- { path: "divider", type: 'screen', component: DividerExamples},
261
- { path: "input", type: 'screen', component: InputExamples},
262
- { path: "text", type: 'screen', component: TextExamples},
263
- { path: "view", type: 'screen', component: ViewExamples},
264
- { path: "screen", type: 'screen', component: ScreenExamples},
265
- { path: "icon", type: 'screen', component: IconExamples},
266
- { path: "svg-image", type: 'screen', component: SVGImageExamples},
267
- { path: "dialog", type: 'screen', component: DialogExamples},
268
- { path: "popover", type: 'screen', component: PopoverExamples},
269
- { path: "select", type: 'screen', component: SelectExamples},
270
- { path: "datagrid", type: 'screen', component: DataGridShowcase},
271
- { path: "datepicker", type: 'screen', component: DatePickerExamples},
272
- { path: "theme-extension", type: 'screen', component: ThemeExtensionExamples},
273
- ],
274
- };
275
-
276
- export default StackRouter;