@wallarm-org/design-system 0.50.1 → 0.50.2-rc-feature-shell.2

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.
Files changed (52) hide show
  1. package/dist/components/AppShell/story-content/_storyConfigRenderer.d.ts +1 -1
  2. package/dist/components/AppShell/story-content/_storyConfigRenderer.js +15 -29
  3. package/dist/components/AppShell/story-content/_storyLib.js +1 -1
  4. package/dist/components/AppShell/story-content/_storyNavConfigs.d.ts +1 -1
  5. package/dist/components/AppShell/story-content/_storyNavConfigs.js +5 -0
  6. package/dist/components/NavPanel/NavPanelHeader.js +1 -1
  7. package/dist/components/Page/PageContent.js +1 -1
  8. package/dist/components/Page/PageHeader.js +1 -1
  9. package/dist/components/{ProductNav → RemoteShell}/HeaderActions.d.ts +1 -1
  10. package/dist/components/{ProductNav → RemoteShell}/NavItemsList.d.ts +1 -1
  11. package/dist/components/RemoteShell/NavPanelContent.d.ts +6 -0
  12. package/dist/components/RemoteShell/NavPanelContent.js +65 -0
  13. package/dist/components/RemoteShell/RemoteShell.d.ts +7 -0
  14. package/dist/components/RemoteShell/RemoteShell.js +109 -9
  15. package/dist/components/RemoteShell/RemoteShellBreadcrumb.js +39 -4
  16. package/dist/components/RemoteShell/RemoteShellContent.d.ts +1 -0
  17. package/dist/components/RemoteShell/RemoteShellContent.js +7 -3
  18. package/dist/components/RemoteShell/RemoteShellPanel.d.ts +4 -2
  19. package/dist/components/RemoteShell/RemoteShellPanel.js +76 -3
  20. package/dist/components/RemoteShell/index.d.ts +2 -0
  21. package/dist/components/RemoteShell/index.js +2 -1
  22. package/dist/components/{ProductNav/ProductNavContext.d.ts → RemoteShell/model/RemoteShellContext.d.ts} +3 -3
  23. package/dist/components/RemoteShell/model/RemoteShellContext.js +9 -0
  24. package/dist/components/RemoteShell/model/index.d.ts +5 -0
  25. package/dist/components/RemoteShell/model/index.js +5 -0
  26. package/dist/components/{ProductNav → RemoteShell/model}/matchNav.js +1 -1
  27. package/dist/components/{ProductNav → RemoteShell/model}/types.d.ts +2 -3
  28. package/dist/index.d.ts +1 -2
  29. package/dist/index.js +2 -3
  30. package/dist/metadata/components.json +35 -303
  31. package/package.json +1 -1
  32. package/dist/components/ProductNav/ProductNav.d.ts +0 -13
  33. package/dist/components/ProductNav/ProductNav.js +0 -109
  34. package/dist/components/ProductNav/ProductNavBreadcrumbs.d.ts +0 -2
  35. package/dist/components/ProductNav/ProductNavBreadcrumbs.js +0 -38
  36. package/dist/components/ProductNav/ProductNavContext.js +0 -9
  37. package/dist/components/ProductNav/ProductNavPanel.d.ts +0 -6
  38. package/dist/components/ProductNav/ProductNavPanel.js +0 -107
  39. package/dist/components/ProductNav/index.d.ts +0 -11
  40. package/dist/components/ProductNav/index.js +0 -10
  41. package/dist/components/ProductNav/useProductNav.d.ts +0 -16
  42. package/dist/components/ProductNav/useProductNav.js +0 -19
  43. /package/dist/components/{ProductNav → RemoteShell}/HeaderActions.js +0 -0
  44. /package/dist/components/{ProductNav → RemoteShell}/NavItemsList.js +0 -0
  45. /package/dist/components/{ProductNav → RemoteShell/model}/matchNav.d.ts +0 -0
  46. /package/dist/components/{ProductNav → RemoteShell/model}/navUtils.d.ts +0 -0
  47. /package/dist/components/{ProductNav → RemoteShell/model}/navUtils.js +0 -0
  48. /package/dist/components/{ProductNav → RemoteShell/model}/types.js +0 -0
  49. /package/dist/components/{ProductNav → RemoteShell/model}/useDrillTransition.d.ts +0 -0
  50. /package/dist/components/{ProductNav → RemoteShell/model}/useDrillTransition.js +0 -0
  51. /package/dist/components/{ProductNav → RemoteShell/model}/useLocationPathname.d.ts +0 -0
  52. /package/dist/components/{ProductNav → RemoteShell/model}/useLocationPathname.js +0 -0
@@ -1,107 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { NavPanel, NavPanelBack, NavPanelDivider, NavPanelHeader } from "../NavPanel/index.js";
3
- import { Text } from "../Text/index.js";
4
- import { HeaderActions } from "./HeaderActions.js";
5
- import { NavItemsList } from "./NavItemsList.js";
6
- import { findDrillNode } from "./navUtils.js";
7
- import { useProductNavContext } from "./ProductNavContext.js";
8
- import { DRILL_ANIMATION_DURATION, DRILL_ANIMATION_EASING, useDrillTransition } from "./useDrillTransition.js";
9
- const ProductNavPanel = ({ resizable })=>{
10
- const { config, navStack, effectiveActiveItemId, navigate, drillInto, goBack, drillLevel } = useProductNavContext();
11
- const { transition, clearTransition } = useDrillTransition(drillLevel);
12
- const hasHeaderActions = !!config.headerActions?.length;
13
- const renderContent = (level)=>{
14
- const entry = navStack[Math.min(level, navStack.length - 1)];
15
- if (0 === level) return /*#__PURE__*/ jsxs(Fragment, {
16
- children: [
17
- hasHeaderActions ? /*#__PURE__*/ jsxs("div", {
18
- className: "sticky top-0 z-10 flex shrink-0 items-center justify-between p-4",
19
- children: [
20
- /*#__PURE__*/ jsx(Text, {
21
- size: "sm",
22
- weight: "medium",
23
- children: config.productLabel
24
- }),
25
- /*#__PURE__*/ jsx(HeaderActions, {
26
- actions: config.headerActions
27
- })
28
- ]
29
- }) : /*#__PURE__*/ jsx(NavPanelHeader, {
30
- children: config.productLabel
31
- }),
32
- /*#__PURE__*/ jsx(NavItemsList, {
33
- items: config.items,
34
- activeItemId: effectiveActiveItemId,
35
- onNavigate: navigate,
36
- onDrillClick: drillInto
37
- })
38
- ]
39
- });
40
- const parentEntry = navStack[level - 1];
41
- const drillNode = findDrillNode(parentEntry.items, parentEntry.activeItemId);
42
- const backLabel = drillNode?.label ?? 'Back';
43
- return /*#__PURE__*/ jsxs(Fragment, {
44
- children: [
45
- /*#__PURE__*/ jsxs("div", {
46
- className: "sticky top-0 z-10 flex flex-col gap-2 bg-bg-surface-1",
47
- children: [
48
- /*#__PURE__*/ jsx(NavPanelHeader, {
49
- children: entry.title
50
- }),
51
- /*#__PURE__*/ jsx(NavPanelBack, {
52
- onClick: goBack,
53
- children: backLabel
54
- }),
55
- /*#__PURE__*/ jsx(NavPanelDivider, {})
56
- ]
57
- }),
58
- /*#__PURE__*/ jsx(NavItemsList, {
59
- items: entry.items,
60
- activeItemId: effectiveActiveItemId,
61
- onNavigate: navigate,
62
- onDrillClick: drillInto
63
- })
64
- ]
65
- });
66
- };
67
- if (transition) {
68
- const isForward = 'forward' === transition.direction;
69
- const slideAnim = isForward ? 'ds-nav-drill-forward' : 'ds-nav-drill-backward';
70
- const timing = `${DRILL_ANIMATION_DURATION} ${DRILL_ANIMATION_EASING} both`;
71
- return /*#__PURE__*/ jsx(NavPanel, {
72
- resizable: resizable,
73
- children: /*#__PURE__*/ jsx("div", {
74
- className: "min-h-0 flex-1 overflow-hidden",
75
- children: /*#__PURE__*/ jsxs("div", {
76
- className: "flex motion-reduce:animate-none",
77
- style: {
78
- animation: `${slideAnim} ${timing}`
79
- },
80
- onAnimationEnd: clearTransition,
81
- children: [
82
- /*#__PURE__*/ jsx("div", {
83
- className: "flex w-full shrink-0 flex-col gap-2 motion-reduce:animate-none",
84
- style: {
85
- animation: `${isForward ? 'ds-nav-blur-out' : 'ds-nav-blur-in'} ${timing}`
86
- },
87
- children: renderContent(isForward ? transition.fromLevel : drillLevel)
88
- }),
89
- /*#__PURE__*/ jsx("div", {
90
- className: "flex w-full shrink-0 flex-col gap-2 motion-reduce:animate-none",
91
- style: {
92
- animation: `${isForward ? 'ds-nav-blur-in' : 'ds-nav-blur-out'} ${timing}`
93
- },
94
- children: renderContent(isForward ? drillLevel : transition.fromLevel)
95
- })
96
- ]
97
- })
98
- })
99
- });
100
- }
101
- return /*#__PURE__*/ jsx(NavPanel, {
102
- resizable: resizable,
103
- children: renderContent(drillLevel)
104
- });
105
- };
106
- ProductNavPanel.displayName = 'ProductNavPanel';
107
- export { ProductNavPanel };
@@ -1,11 +0,0 @@
1
- export { NavPanelSkeleton, type NavPanelSkeletonProps } from '../NavPanel';
2
- export { type MatchNavResult, matchNav } from './matchNav';
3
- export { findDrillNode, findFirstLinkPath } from './navUtils';
4
- export { ProductNav, type ProductNavProps } from './ProductNav';
5
- export { ProductNavBreadcrumbs } from './ProductNavBreadcrumbs';
6
- export type { ProductNavContextValue } from './ProductNavContext';
7
- export { useProductNavContext } from './ProductNavContext';
8
- export { ProductNavPanel } from './ProductNavPanel';
9
- export type { BreadcrumbSegment, NavConfig, NavConfigDrill, NavConfigGroup, NavConfigHeaderAction, NavConfigLink, NavConfigNode, NavConfigSectionHeader, NavStackEntry, } from './types';
10
- export { pushPathname, useLocationPathname } from './useLocationPathname';
11
- export { type UseProductNavResult, useProductNav } from './useProductNav';
@@ -1,10 +0,0 @@
1
- import { NavPanelSkeleton } from "../NavPanel/index.js";
2
- import { matchNav } from "./matchNav.js";
3
- import { findDrillNode, findFirstLinkPath } from "./navUtils.js";
4
- import { ProductNav } from "./ProductNav.js";
5
- import { ProductNavBreadcrumbs } from "./ProductNavBreadcrumbs.js";
6
- import { useProductNavContext } from "./ProductNavContext.js";
7
- import { ProductNavPanel } from "./ProductNavPanel.js";
8
- import { pushPathname, useLocationPathname } from "./useLocationPathname.js";
9
- import { useProductNav } from "./useProductNav.js";
10
- export { NavPanelSkeleton, ProductNav, ProductNavBreadcrumbs, ProductNavPanel, findDrillNode, findFirstLinkPath, matchNav, pushPathname, useLocationPathname, useProductNav, useProductNavContext };
@@ -1,16 +0,0 @@
1
- import { type Dispatch, type SetStateAction } from 'react';
2
- import type { BreadcrumbSegment, NavStackEntry } from './types';
3
- export interface UseProductNavResult {
4
- navStack: NavStackEntry[];
5
- peekDepth: number;
6
- setPeekDepth: Dispatch<SetStateAction<number>>;
7
- breadcrumbSegments: BreadcrumbSegment[];
8
- activeItemId: string | null;
9
- }
10
- /**
11
- * Hook providing computed nav state + peekDepth management.
12
- *
13
- * Reads computed state from ProductNav context.
14
- * `peekDepth` is the only local mutable state and resets on pathname changes.
15
- */
16
- export declare function useProductNav(): UseProductNavResult;
@@ -1,19 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { useProductNavContext } from "./ProductNavContext.js";
3
- function useProductNav() {
4
- const { pathname, navStack, breadcrumbSegments, activeItemId } = useProductNavContext();
5
- const [peekDepth, setPeekDepth] = useState(0);
6
- useEffect(()=>{
7
- setPeekDepth(0);
8
- }, [
9
- pathname
10
- ]);
11
- return {
12
- navStack,
13
- peekDepth,
14
- setPeekDepth,
15
- breadcrumbSegments,
16
- activeItemId
17
- };
18
- }
19
- export { useProductNav };