{"_id":"@alphinex/navigation","_rev":"6-5ddaf9cb6ffb8afd2aef537a48a11be4","name":"@alphinex/navigation","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.1":{"name":"@alphinex/navigation","version":"1.0.1","license":"UNLICENSED","_id":"@alphinex/navigation@1.0.1","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"d363c61bbc376425dd96eca159ca404434dbd84d","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.1.tgz","fileCount":5,"integrity":"sha512-1d4TKufL3pbRxuWW4munVGJ4RCCZP4qYlkPPIu6eGYAIq+YVUbxI37idGpO4kxHNYOIskFHKfviDIGSM+H91/Q==","signatures":[{"sig":"MEUCIQD+PVZoOvPos5rUOlJDxZgXNtLBtXXuwc3F4HCHAoYITwIgN+Lhiogs+tmoovhh99n2+6UOkloTDIH8/BiL9fbKnFA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14058},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/ui":"2.3.0","@alphinex/core":"1.0.0","@alphinex/hooks":"1.0.1","@alphinex/icons":"1.0.1","@alphinex/theme":"1.1.0","@alphinex/utils":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","axe-core":"^4.10.2","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/navigation_1.0.1_1786200451949_0.42907778631405136","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alphinex/navigation","version":"1.0.2","license":"UNLICENSED","_id":"@alphinex/navigation@1.0.2","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"796497a729f1584122578b16c4fcefb01bb3af6e","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.2.tgz","fileCount":5,"integrity":"sha512-pb4ZVgbStyjLOkjK7KIgU4m3xytOCL9h8+x/bUhkrEh63VXuyMh7BszyToRrQn9TENiXNqQb9vYAPBYNWhZQWg==","signatures":[{"sig":"MEUCID7cCpFbEhrGlXLSIcZYQ1SXo5TbuAhY2Ie08L+goNERAiEAkpwpzySuAFx268ijjneaBYMhjBgP9J29evPtHgrrJi8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14058},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/ui":"2.4.0","@alphinex/core":"1.0.0","@alphinex/hooks":"1.0.1","@alphinex/icons":"1.0.1","@alphinex/theme":"1.1.0","@alphinex/utils":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","axe-core":"^4.10.2","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/navigation_1.0.2_1786218409438_0.06877039743304514","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@alphinex/navigation","version":"1.0.3","license":"UNLICENSED","_id":"@alphinex/navigation@1.0.3","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"36893bfdae5e4f99690aafbe445bf7b285444fe9","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.3.tgz","fileCount":5,"integrity":"sha512-LAUyThk3afHAA/rjdKJOWrRdc+/nX9Gf1FzxEhcf5w/a/zZAS5tJn8WZ9UHdDCCxbphyXJKajRbY4NiZPsZKig==","signatures":[{"sig":"MEQCIG2YW1JBYdNMLQ/ewNSRbAiSK5ahCXgaxa7AYQKVmLqmAiAaRtMi51l7bi9SCBxuG3e+4EdzNctpAJjsUa5KYpIgHQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14058},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/ui":"2.5.0","@alphinex/core":"1.0.0","@alphinex/hooks":"1.0.1","@alphinex/icons":"1.0.1","@alphinex/theme":"1.1.0","@alphinex/utils":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","axe-core":"^4.10.2","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/navigation_1.0.3_1786273320719_0.4558112252636657","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@alphinex/navigation","version":"1.0.4","license":"UNLICENSED","_id":"@alphinex/navigation@1.0.4","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"285ce66db4c4b62ed960eb305fe34c8467ecc575","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.4.tgz","fileCount":5,"integrity":"sha512-93n6WSc+0FMEtFoZBTj/3yxLl5limb7FxOYNvPJORrMsEBTeesO7OoeJxTu8FL8IG3wGql/28yhgOhPrJlV6rg==","signatures":[{"sig":"MEQCIFEB7PlF6ldtXWvsZ4OrHj4N9TeQATbnaNvYn05U5H2aAiAjOpYySCNmv/otZqNah5+esD1fjK8c6Vwl5+0iM/DioA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14058},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/ui":"2.5.1","@alphinex/core":"1.0.0","@alphinex/hooks":"1.0.1","@alphinex/icons":"1.1.0","@alphinex/theme":"1.1.0","@alphinex/utils":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","axe-core":"^4.10.2","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/navigation_1.0.4_1786298614857_0.20366361377019593","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@alphinex/navigation","version":"1.0.5","license":"UNLICENSED","_id":"@alphinex/navigation@1.0.5","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"dist":{"shasum":"bb66f4da360afebdf808dbd91cc0c5205d04c371","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.5.tgz","fileCount":5,"integrity":"sha512-/BH6t8R9cNVSKT2pXWutNo6F2M39qIsOGJjmA//9hakEkBIbo5YcrO7FYAqkgHKoXACpzUjWwM6yWB0qPCSClw==","signatures":[{"sig":"MEYCIQDyOQQrZeAuAOZb4/BupzhXzSY1M6LI2baOTyZjn6z4AQIhAJnbD0LVR8mVneRFsdH1BfEdPPBBRemS+UT2oJ2VvNQ3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14058},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite build --watch","lint":"eslint .","test":"vitest run","build":"vite build","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"@alphinex/ui":"2.6.0","@alphinex/core":"1.0.0","@alphinex/hooks":"1.0.2","@alphinex/icons":"1.2.0","@alphinex/theme":"1.1.0","@alphinex/utils":"1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.5","jsdom":"^25.0.1","react":"^19.0.0","eslint":"^9.17.0","vitest":"^2.1.8","axe-core":"^4.10.2","react-dom":"^19.0.0","typescript":"^5.7.2","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@vitejs/plugin-react":"^4.3.4","@alphinex/build-config":"0.0.0","@testing-library/react":"^16.1.0","@alphinex/eslint-config":"0.0.0","@testing-library/jest-dom":"^6.6.3","@alphinex/typescript-config":"0.0.0","@testing-library/user-event":"^14.5.2"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/navigation_1.0.5_1786525491614_0.37671433258339415","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@alphinex/navigation","version":"1.0.6","private":false,"description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","license":"UNLICENSED","type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"dependencies":{"@alphinex/core":"1.0.0","@alphinex/theme":"1.1.0","@alphinex/icons":"1.2.0","@alphinex/hooks":"1.0.2","@alphinex/utils":"1.1.0","@alphinex/ui":"2.7.0"},"peerDependencies":{"react":"^19.0.0","react-dom":"^19.0.0"},"peerDependenciesMeta":{"react":{"optional":false},"react-dom":{"optional":false}},"devDependencies":{"typescript":"^5.7.2","vite":"^6.0.5","vitest":"^2.1.8","react":"^19.0.0","react-dom":"^19.0.0","@types/react":"^19.0.2","@types/react-dom":"^19.0.2","@testing-library/react":"^16.1.0","@testing-library/jest-dom":"^6.6.3","@testing-library/user-event":"^14.5.2","@vitejs/plugin-react":"^4.3.4","axe-core":"^4.10.2","jsdom":"^25.0.1","eslint":"^9.17.0","@alphinex/build-config":"0.0.0","@alphinex/eslint-config":"0.0.0","@alphinex/typescript-config":"0.0.0"},"scripts":{"build":"vite build","dev":"vite build --watch","lint":"eslint .","typecheck":"tsc --noEmit","test":"vitest run","clean":"rimraf dist .turbo"},"_nodeVersion":"22.14.0","_id":"@alphinex/navigation@1.0.6","dist":{"integrity":"sha512-Lxx5WZ67H4TEDunLeouZeXraHjdLWHHt4iYJpP8LlZAUcAB9+DfaIXWIHa0IGYfGRANj5QlzoG8dr0UQsGUs6w==","shasum":"15b13c6d1be57493b5892903caa61f593dd89307","tarball":"https://registry.npmjs.org/@alphinex/navigation/-/navigation-1.0.6.tgz","fileCount":5,"unpackedSize":14058,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHlTbNWh0mspVtc+ATRGEYVGq2bZ+l3sWs4wFNKwxpHFAiAH2CIo0FRHqdlaXciacWR1U2MT3qJ7CqMRWUUxs8Rdzg=="}]},"_npmUser":{"name":"anasaliqureshi","email":"anas@alphinex.com"},"directories":{},"maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/navigation_1.0.6_1786546540299_0.6033137826154247"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-08T14:47:31.798Z","modified":"2026-08-12T14:55:40.635Z","1.0.1":"2026-08-08T14:47:32.093Z","1.0.2":"2026-08-08T19:46:49.574Z","1.0.3":"2026-08-09T11:02:00.858Z","1.0.4":"2026-08-09T18:03:35.018Z","1.0.5":"2026-08-12T09:04:51.770Z","1.0.6":"2026-08-12T14:55:40.443Z"},"license":"UNLICENSED","description":"Shared, typed nav-tree structure (icons/permission-key/nesting metadata) + a NavTree renderer over @alphinex/ui's TreeView — replaces the hardcoded flat NAV_ITEMS arrays duplicated across apps. See documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §10.2 (Spri","maintainers":[{"name":"anasaliqureshi","email":"anas@alphinex.com"}],"readme":"# @alphinex/navigation\n\nA shared, typed nav-tree structure (`NavItem` — icon, an opaque permission key, nesting via\n`children`) plus `NavTree`, a renderer over `@alphinex/ui`'s `TreeView`. Replaces the\nhand-rolled flat `NAV_ITEMS` arrays that used to be duplicated across apps. See\n[ADR-0021](../../documentation/adr/0021-treeview-and-navigation-package.md) for why this is its\nown package rather than living in `@alphinex/ui`.\n\n## `NavTree`\n\n```tsx\nimport { NavTree, type NavItem } from \"@alphinex/navigation\";\nimport { useNavigate, useLocation } from \"react-router-dom\";\n\nconst NAV_ITEMS: NavItem[] = [\n  { id: \"overview\", label: \"Overview\", href: \"/\" },\n  {\n    id: \"admin\",\n    label: \"Admin\",\n    children: [\n      { id: \"users\", label: \"Users\", href: \"/admin/users\" },\n      { id: \"billing\", label: \"Billing\", href: \"/admin/billing\" },\n    ],\n  },\n];\n\nfunction Sidebar() {\n  const navigate = useNavigate();\n  const { pathname } = useLocation();\n  const selected = NAV_ITEMS.find((item) => item.href === pathname);\n\n  return (\n    <NavTree\n      items={NAV_ITEMS}\n      selectedId={selected?.id}\n      onNavigate={(item) => item.href && navigate(item.href)}\n    />\n  );\n}\n```\n\n`onNavigate` receives the selected `NavItem` (so you can read its `href`) — this package doesn't\nassume React Router, Next's router, or anything else; you decide how to actually navigate.\n\n## `NavItem`\n\n```ts\ninterface NavItem {\n  id: string;\n  label: string;\n  href?: string;\n  icon?: ReactNode;\n  /** An opaque key — see filterNavItems() below. Omit for an item everyone can see. */\n  permission?: string;\n  children?: NavItem[];\n}\n```\n\n## `filterNavItems` / `useNavItems`\n\nFilters a nav tree down to what an app's own permission check allows, recursively. Deliberately\ntakes a plain `can(permission)` callback rather than depending on `@alphinex/permissions`\ndirectly — use `usePermission()` from `@alphinex/permissions` to build that callback if that's\nyour permissions model, or wire up anything else:\n\n```tsx\nimport { useNavItems } from \"@alphinex/navigation\";\nimport { usePermission } from \"@alphinex/permissions\";\n\nfunction Sidebar() {\n  const { can } = usePermission();\n  const visibleItems = useNavItems(NAV_ITEMS, can);\n  return <NavTree items={visibleItems} onNavigate={handleNavigate} />;\n}\n```\n\nA pure grouping node (no `href` of its own) that loses every child to filtering is dropped too —\n`filterNavItems`/`useNavItems` is also exported directly if you want to filter without `NavTree`.\n\nSee [documentation/ARCHITECTURE.md](../../documentation/ARCHITECTURE.md) for the full package contract, dependency rules, and roadmap placement.\n","readmeFilename":""}