@idealyst/navigation 1.0.82 → 1.0.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/navigation",
3
- "version": "1.0.82",
3
+ "version": "1.0.83",
4
4
  "description": "Cross-platform navigation library for React and React Native",
5
5
  "readme": "README.md",
6
6
  "main": "src/index.ts",
@@ -31,6 +31,11 @@
31
31
  "import": "./src/examples/unistyles.ts",
32
32
  "require": "./src/examples/unistyles.ts",
33
33
  "types": "./src/examples/unistyles.ts"
34
+ },
35
+ "./router": {
36
+ "import": "./src/router/index.ts",
37
+ "require": "./src/router/index.ts",
38
+ "types": "./src/router/index.ts"
34
39
  }
35
40
  },
36
41
  "scripts": {
@@ -38,25 +43,26 @@
38
43
  "publish:npm": "npm publish"
39
44
  },
40
45
  "peerDependencies": {
41
- "@idealyst/components": "^1.0.82",
42
- "@idealyst/theme": "^1.0.82",
43
- "@react-navigation/bottom-tabs": "^7.0.0",
44
- "@react-navigation/drawer": "^7.0.0",
45
- "@react-navigation/native": "^7.0.0",
46
- "@react-navigation/native-stack": "^7.0.0",
46
+ "@idealyst/components": "^1.0.83",
47
+ "@idealyst/theme": "^1.0.83",
48
+ "@react-navigation/bottom-tabs": ">=7.0.0",
49
+ "@react-navigation/drawer": ">=7.0.0",
50
+ "@react-navigation/native": ">=7.0.0",
51
+ "@react-navigation/native-stack": ">=7.0.0",
47
52
  "react": ">=16.8.0",
48
53
  "react-native": ">=0.60.0",
49
54
  "react-native-gesture-handler": "*",
50
55
  "react-native-reanimated": "*",
51
56
  "react-native-safe-area-context": "*",
52
57
  "react-native-screens": "*",
53
- "react-native-unistyles": "^3.0.10",
54
- "react-router": "^7.6.3",
55
- "react-router-dom": "^7.6.3"
58
+ "react-native-unistyles": ">=3.0.0",
59
+ "react-router": ">=6.0.0",
60
+ "react-router-dom": ">=6.0.0"
56
61
  },
57
62
  "devDependencies": {
58
63
  "@types/react": "^19.1.8",
59
64
  "@types/react-dom": "^19.1.6",
65
+ "react-router": "7.9.1",
60
66
  "typescript": "^5.0.0"
61
67
  },
62
68
  "files": [
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, memo, useContext, useMemo } from 'react';
2
- import { useNavigate, useParams } from 'react-router';
2
+ import { useNavigate, useParams } from '../router';
3
3
  import { NavigateParams, NavigatorProviderProps, NavigatorContextValue } from './types';
4
4
  import { buildNavigator } from '../routing';
5
5
 
@@ -7,7 +7,7 @@ const NavigatorContext = createContext<NavigatorContextValue>({
7
7
  navigate: () => {},
8
8
  });
9
9
 
10
- export const NavigatorProvider = ({
10
+ export const NavigatorProvider = ({
11
11
  route,
12
12
  }: NavigatorProviderProps) => {
13
13
  const reactRouterNavigate = useNavigate()
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, PopoverExamples, ScreenExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples } from "../../../components/src/examples";
2
+ import { AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, PopoverExamples, ScreenExamples, SelectExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples } from "../../../components/src/examples";
3
3
  import { DataGridShowcase } from "../../../datagrid/src/examples";
4
4
  import { DatePickerExamples } from "../../../datepicker/src/examples";
5
5
  import { Button, Divider, Screen, Text, View } from "../../../components/src";
@@ -192,6 +192,15 @@ const HomeScreen = () => {
192
192
  }}>
193
193
  Popover
194
194
  </Button>
195
+ <Button
196
+ onPress={() => {
197
+ navigator.navigate({
198
+ path: "/select",
199
+ vars: {},
200
+ });
201
+ }}>
202
+ Select
203
+ </Button>
195
204
 
196
205
  <Divider spacing="medium" />
197
206
  <Text size="small" weight="semibold" color="secondary">Data Components</Text>
@@ -257,6 +266,7 @@ const StackRouter: NavigatorParam = {
257
266
  { path: "svg-image", type: 'screen', component: SVGImageExamples},
258
267
  { path: "dialog", type: 'screen', component: DialogExamples},
259
268
  { path: "popover", type: 'screen', component: PopoverExamples},
269
+ { path: "select", type: 'screen', component: SelectExamples},
260
270
  { path: "datagrid", type: 'screen', component: DataGridShowcase},
261
271
  { path: "datepicker", type: 'screen', component: DatePickerExamples},
262
272
  { path: "theme-extension", type: 'screen', component: ThemeExtensionExamples},
@@ -1,4 +1,4 @@
1
- import { useParams as useReactRouterParams } from 'react-router';
1
+ import { useParams as useReactRouterParams } from '../router';
2
2
 
3
3
  /**
4
4
  * Custom useParams hook that wraps React Router's useParams
package/src/index.web.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Web-specific exports
2
2
  export * from './index';
3
3
 
4
- // Re-export React Router components to ensure single instance
5
- export { Outlet } from 'react-router';
4
+ // Direct export to fix module resolution
5
+ export { NavigatorProvider, useNavigator } from './context/NavigatorContext.web';
@@ -1,8 +1,7 @@
1
1
  import React from 'react'
2
2
  import { View, Text } from '@idealyst/components'
3
3
  import { StackLayoutProps } from '../routing/types'
4
- import { Outlet } from '..'
5
-
4
+ import { Outlet } from '../router'
6
5
  export interface DefaultStackLayoutProps extends StackLayoutProps {
7
6
  onNavigate: (path: string) => void
8
7
  currentPath: string
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { View, Text, Button, Icon } from '@idealyst/components'
3
3
  import { TabLayoutProps } from '../routing/types'
4
- import { Outlet } from '..'
4
+ import { Outlet } from '../router'
5
5
 
6
6
  export interface DefaultTabLayoutProps extends TabLayoutProps {}
7
7
 
@@ -0,0 +1,17 @@
1
+ // Native platforms don't use React Router
2
+ // This is a stub to maintain cross-platform compatibility
3
+
4
+ export const BrowserRouter = null;
5
+ export const HashRouter = null;
6
+ export const MemoryRouter = null;
7
+ export const Router = null;
8
+ export const useNavigate = () => null;
9
+ export const useLocation = () => null;
10
+ export const useParams = () => null;
11
+ export const useSearchParams = () => null;
12
+ export const Navigate = null;
13
+ export const Outlet = null;
14
+ export const Route = null;
15
+ export const Routes = null;
16
+ export const Link = null;
17
+ export const NavLink = null;
@@ -0,0 +1,3 @@
1
+ // Platform-specific exports will be used
2
+ // This file exists for TypeScript resolution
3
+ // The actual exports come from platform-specific files
@@ -0,0 +1,6 @@
1
+ // Export all React Router modules from a centralized location
2
+ // This prevents duplication issues when multiple packages need React Router
3
+
4
+ // Re-export everything from react-router-dom
5
+ // This includes all react-router exports plus the DOM-specific ones
6
+ export * from 'react-router-dom';
@@ -1,6 +1,2 @@
1
1
  export * from './router.native';
2
2
  export * from './types';
3
-
4
- // Added for consistency
5
- const Outlet = null
6
- export { Outlet };
@@ -1,4 +1,2 @@
1
1
  export * from './router.web';
2
- export * from './types';
3
-
4
- export { Outlet } from 'react-router';
2
+ export * from './types';
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Routes, Route } from 'react-router'
2
+ import { Routes, Route } from '../router'
3
3
  import { DefaultStackLayout } from '../layouts/DefaultStackLayout'
4
4
  import { DefaultTabLayout } from '../layouts/DefaultTabLayout'
5
5
  import { NavigatorParam, RouteParam } from './types'