@idealyst/navigation 1.2.30 → 1.2.31

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.2.30",
3
+ "version": "1.2.31",
4
4
  "description": "Cross-platform navigation library for React and React Native",
5
5
  "readme": "README.md",
6
6
  "main": "src/index.ts",
@@ -43,10 +43,10 @@
43
43
  "publish:npm": "npm publish"
44
44
  },
45
45
  "peerDependencies": {
46
- "@idealyst/camera": "^1.1.6",
47
- "@idealyst/components": "^1.2.30",
48
- "@idealyst/microphone": "^1.1.7",
49
- "@idealyst/theme": "^1.2.30",
46
+ "@idealyst/camera": "^1.2.30",
47
+ "@idealyst/components": "^1.2.31",
48
+ "@idealyst/microphone": "^1.2.30",
49
+ "@idealyst/theme": "^1.2.31",
50
50
  "@react-navigation/bottom-tabs": ">=7.0.0",
51
51
  "@react-navigation/drawer": ">=7.0.0",
52
52
  "@react-navigation/native": ">=7.0.0",
@@ -70,12 +70,12 @@
70
70
  }
71
71
  },
72
72
  "devDependencies": {
73
- "@idealyst/camera": "^1.1.6",
74
- "@idealyst/components": "^1.2.30",
75
- "@idealyst/datagrid": "^1.0.93",
76
- "@idealyst/datepicker": "^1.0.93",
77
- "@idealyst/microphone": "^1.1.7",
78
- "@idealyst/theme": "^1.2.30",
73
+ "@idealyst/camera": "^1.2.30",
74
+ "@idealyst/components": "^1.2.31",
75
+ "@idealyst/datagrid": "^1.2.30",
76
+ "@idealyst/datepicker": "^1.2.30",
77
+ "@idealyst/microphone": "^1.2.30",
78
+ "@idealyst/theme": "^1.2.31",
79
79
  "@types/react": "^19.1.8",
80
80
  "@types/react-dom": "^19.1.6",
81
81
  "react": "^19.1.0",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, LinkExamples, PopoverExamples, ScreenExamples, SelectExamples, SliderExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples, SwitchExamples, RadioButtonExamples, ProgressExamples, TextAreaExamples, TabBarExamples, TooltipExamples, AccordionExamples, ListExamples, TableExamples, MenuExamples, ImageExamples, VideoExamples, AlertExamples, SkeletonExamples, ChipExamples, BreadcrumbExamples } from '@idealyst/components/examples';
2
+ import { ActivityIndicatorExamples, AvatarExamples, BadgeExamples, ButtonExamples, CardExamples, CheckboxExamples, DialogExamples, DividerExamples, IconExamples, InputExamples, LinkExamples, PopoverExamples, ScreenExamples, SelectExamples, SliderExamples, SVGImageExamples, TextExamples, ViewExamples, ThemeExtensionExamples, SwitchExamples, RadioButtonExamples, ProgressExamples, TextAreaExamples, TabBarExamples, TooltipExamples, AccordionExamples, ListExamples, TableExamples, MenuExamples, ImageExamples, VideoExamples, AlertExamples, SkeletonExamples, ChipExamples, BreadcrumbExamples } from '@idealyst/components/examples';
3
3
  import { DataGridShowcase } from '@idealyst/datagrid/examples';
4
4
  import { DatePickerExamples } from '@idealyst/datepicker/examples';
5
5
  import { CameraExamples } from '@idealyst/camera/examples';
@@ -298,6 +298,7 @@ const ExampleNavigationRouter: NavigatorParam = {
298
298
  { path: "fullscreen-demo", type: 'screen', component: FullScreenExample, options: { title: "Full Screen Demo", fullScreen: true } },
299
299
  // Nested settings navigator with its own 404 handling
300
300
  SettingsNavigator,
301
+ { path: "activity-indicator", type: 'screen', component: ActivityIndicatorExamples, options: { title: "Activity Indicator" } },
301
302
  { path: "avatar", type: 'screen', component: AvatarExamples, options: { title: "Avatar" } },
302
303
  { path: "badge", type: 'screen', component: BadgeExamples, options: { title: "Badge" } },
303
304
  { path: "button", type: 'screen', component: ButtonExamples, options: { title: "Button" } },
@@ -68,6 +68,7 @@ const componentGroups: ComponentGroup[] = [
68
68
  {
69
69
  title: 'Feedback',
70
70
  items: [
71
+ { label: 'Activity Indicator', path: '/activity-indicator', icon: 'loading' },
71
72
  { label: 'Progress', path: '/progress', icon: 'timer-sand-empty' },
72
73
  ],
73
74
  },
@@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react'
2
2
  import { Routes, Route, useLocation, useParams } from '../router'
3
3
  import { DefaultStackLayout } from '../layouts/DefaultStackLayout'
4
4
  import { DefaultTabLayout } from '../layouts/DefaultTabLayout'
5
- import { NavigatorParam, RouteParam, ScreenParam, NotFoundComponentProps } from './types'
5
+ import { NavigatorParam, RouteParam, ScreenParam, NotFoundComponentProps, StackLayoutProps, TabLayoutProps, RouteWithFullPath } from './types'
6
6
  import { NavigateParams } from '../context/types'
7
7
 
8
8
  /**
@@ -89,6 +89,24 @@ const NotFoundWrapper = ({
89
89
  return <Component path={location.pathname} params={params as Record<string, string>} />
90
90
  }
91
91
 
92
+ /**
93
+ * Wrapper component that provides currentPath to layout components
94
+ */
95
+ const LayoutWrapper: React.FC<{
96
+ LayoutComponent: React.ComponentType<StackLayoutProps | TabLayoutProps>
97
+ options?: any
98
+ routes: RouteWithFullPath[]
99
+ }> = ({ LayoutComponent, options, routes }) => {
100
+ const location = useLocation()
101
+ return (
102
+ <LayoutComponent
103
+ options={options}
104
+ routes={routes}
105
+ currentPath={location.pathname}
106
+ />
107
+ )
108
+ }
109
+
92
110
  /**
93
111
  * Build the Web navigator using React Router v7 nested routes
94
112
  * @param params Navigator configuration
@@ -218,15 +236,16 @@ const buildRoute = (params: RouteParam, index: number, isNested = false, parentP
218
236
  }
219
237
 
220
238
  // Build the main navigator route with layout
239
+ // Use LayoutWrapper to provide reactive currentPath
221
240
  const navigatorRoute = (
222
241
  <Route
223
242
  key={`${params.path}-${index}`}
224
243
  path={routePath}
225
244
  element={
226
- <LayoutComponent
245
+ <LayoutWrapper
246
+ LayoutComponent={LayoutComponent}
227
247
  options={params.options}
228
248
  routes={routesWithFullPaths}
229
- currentPath=""
230
249
  />
231
250
  }
232
251
  >