@atlaskit/navigation-system 11.3.4 → 11.4.0
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/CHANGELOG.md +16 -0
- package/README.md +20 -0
- package/constellation/layout/code.mdx +1 -1
- package/constellation/layout/examples.mdx +4 -16
- package/constellation/layout/images/layout-anatomy-dark.png +0 -0
- package/constellation/layout/images/layout-anatomy-light.png +0 -0
- package/constellation/layout/images/layout-do-dark.png +0 -0
- package/constellation/layout/images/layout-do-light.png +0 -0
- package/constellation/layout/images/layout-dont-dark.png +0 -0
- package/constellation/layout/images/layout-dont-light.png +0 -0
- package/constellation/layout/images/layout-example-dark.png +0 -0
- package/constellation/layout/images/layout-example-light.png +0 -0
- package/constellation/layout/images/layout-example-sideNav-dark.png +0 -0
- package/constellation/layout/images/layout-example-sideNav-light.png +0 -0
- package/constellation/layout/images/layout-example-topNav-1-dark.png +0 -0
- package/constellation/layout/images/layout-example-topNav-1-light.png +0 -0
- package/constellation/layout/usage.mdx +1 -2
- package/constellation/top-nav-items/examples.mdx +7 -13
- package/dist/cjs/entry-points/layout/panel-layout.js +19 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/cjs/ui/page-layout/chat-panel.js +1 -1
- package/dist/cjs/ui/page-layout/constants.js +15 -1
- package/dist/cjs/ui/page-layout/get-panel-layout-defaults.js +22 -0
- package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +5 -4
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.js +206 -0
- package/dist/cjs/ui/page-layout/main/main.js +5 -2
- package/dist/cjs/ui/page-layout/main-min-width-context.js +10 -0
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +67 -0
- package/dist/cjs/ui/page-layout/panel-layout.js +162 -0
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +4 -4
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +1 -1
- package/dist/es2019/entry-points/layout/panel-layout.js +2 -0
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/es2019/ui/page-layout/chat-panel.js +2 -2
- package/dist/es2019/ui/page-layout/constants.js +14 -0
- package/dist/es2019/ui/page-layout/get-panel-layout-defaults.js +16 -0
- package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +4 -3
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.js +193 -0
- package/dist/es2019/ui/page-layout/main/main.js +6 -3
- package/dist/es2019/ui/page-layout/main-min-width-context.js +5 -0
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +74 -0
- package/dist/es2019/ui/page-layout/panel-layout.js +147 -0
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +4 -4
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +2 -2
- package/dist/esm/entry-points/layout/panel-layout.js +2 -0
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/esm/ui/page-layout/chat-panel.js +2 -2
- package/dist/esm/ui/page-layout/constants.js +14 -0
- package/dist/esm/ui/page-layout/get-panel-layout-defaults.js +16 -0
- package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +4 -3
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/esm/ui/page-layout/local-panel-surface.js +197 -0
- package/dist/esm/ui/page-layout/main/main.js +6 -3
- package/dist/esm/ui/page-layout/main-min-width-context.js +5 -0
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/esm/ui/page-layout/panel-layout-shell.js +59 -0
- package/dist/esm/ui/page-layout/panel-layout.js +154 -0
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +4 -4
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +2 -2
- package/dist/types/entry-points/layout/panel-layout.d.ts +3 -0
- package/dist/types/ui/page-layout/constants.d.ts +12 -0
- package/dist/types/ui/page-layout/get-panel-layout-defaults.d.ts +10 -0
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +5 -1
- package/dist/types/ui/page-layout/local-panel-surface.d.ts +32 -0
- package/dist/types/ui/page-layout/main-min-width-context.d.ts +2 -0
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +47 -0
- package/dist/types/ui/page-layout/panel-layout.d.ts +74 -0
- package/layout/panel-layout/package.json +10 -0
- package/package.json +4 -4
- package/constellation/layout/images/layout-example-topNav-2-dark.png +0 -3
- package/constellation/layout/images/layout-example-topNav-2-light.png +0 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { type Key, type MutableRefObject, type ReactNode } from 'react';
|
|
6
|
+
import type { LayoutAreaMode, LayoutAreaState } from './layout-area-sizing-context';
|
|
7
|
+
import type { PanelResizeEnd } from './panel-layout';
|
|
8
|
+
import type { ResizeBounds } from './panel-splitter/types';
|
|
9
|
+
type LocalPanelSurfaceProps = {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
contentKey?: Key;
|
|
12
|
+
label: string;
|
|
13
|
+
resizeLabel: string;
|
|
14
|
+
defaultWidth: number;
|
|
15
|
+
minWidth: number;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
testId?: string;
|
|
18
|
+
layoutRef: MutableRefObject<HTMLDivElement | null>;
|
|
19
|
+
managedSizing?: LayoutAreaState;
|
|
20
|
+
getManagedResizeBounds: () => ResizeBounds | undefined;
|
|
21
|
+
prepareResize?: () => Promise<boolean>;
|
|
22
|
+
onManagedResizeStart: (mode: LayoutAreaMode) => void;
|
|
23
|
+
onManagedResize: (mode: LayoutAreaMode, width: number) => void;
|
|
24
|
+
onManagedResizeEnd: (mode: LayoutAreaMode, width: number) => void;
|
|
25
|
+
onWidthChange: (width: number) => void;
|
|
26
|
+
onResizeEnd: (event: PanelResizeEnd) => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Internal surface for PanelLayout. The host supplies content; navigation owns its geometry.
|
|
30
|
+
*/
|
|
31
|
+
export declare function LocalPanelSurface({ children, contentKey, label, resizeLabel, defaultWidth, minWidth, maxWidth, testId, layoutRef, managedSizing, getManagedResizeBounds, prepareResize, onManagedResizeStart, onManagedResize, onManagedResizeEnd, onWidthChange, onResizeEnd, }: LocalPanelSurfaceProps): JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { type MutableRefObject, type ReactNode } from 'react';
|
|
6
|
+
import type { LayoutAreaMode } from './layout-area-sizing-context';
|
|
7
|
+
type PanelLayoutShellProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Main content rendered alongside the local panel.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Panel content or surface supplied by the caller.
|
|
14
|
+
*/
|
|
15
|
+
panel: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the local panel is open.
|
|
18
|
+
*/
|
|
19
|
+
isPanelOpen: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Effective panel track width in pixels.
|
|
22
|
+
*/
|
|
23
|
+
panelWidth: number;
|
|
24
|
+
compactPanelWidth: number;
|
|
25
|
+
/**
|
|
26
|
+
* Minimum panel width in pixels.
|
|
27
|
+
*/
|
|
28
|
+
panelMinWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Allocated placement. Before measurement, CSS reserves a track when both minimums fit the host.
|
|
31
|
+
*/
|
|
32
|
+
mode?: LayoutAreaMode;
|
|
33
|
+
/**
|
|
34
|
+
* Shared with the panel's resize controls so imperative resizing also updates the grid track.
|
|
35
|
+
*/
|
|
36
|
+
layoutRef?: MutableRefObject<HTMLDivElement | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Clips the layout during panel motion.
|
|
39
|
+
*/
|
|
40
|
+
shouldClipOverflow?: boolean;
|
|
41
|
+
testId?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Grid and scrolling for Main and its local panel. Use inside navigation's Root and Main.
|
|
45
|
+
*/
|
|
46
|
+
export declare function PanelLayoutShell({ children, panel, isPanelOpen, panelWidth, compactPanelWidth, panelMinWidth, mode, layoutRef, shouldClipOverflow, testId, }: PanelLayoutShellProps): JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type Key, type ReactNode } from 'react';
|
|
2
|
+
import { type LayoutAreaMode } from './layout-area-sizing-context';
|
|
3
|
+
export type PanelResizeEnd = {
|
|
4
|
+
initialWidth: number;
|
|
5
|
+
finalWidth: number;
|
|
6
|
+
mode: LayoutAreaMode;
|
|
7
|
+
};
|
|
8
|
+
export type PanelLayoutProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Main content. Mount PanelLayout inside navigation's Main, alongside ChatPanel in Root.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Caller-owned panel content; no Panel System provider or renderer is required.
|
|
15
|
+
*/
|
|
16
|
+
panel: ReactNode;
|
|
17
|
+
isPanelOpen: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Optional content identity, used to reset scrolling and animate content replacement.
|
|
20
|
+
*/
|
|
21
|
+
panelKey?: Key;
|
|
22
|
+
/**
|
|
23
|
+
* Controlled preferred width in pixels. Allocation may constrain it without changing the request.
|
|
24
|
+
*/
|
|
25
|
+
panelWidth?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Initial preferred width in pixels; subsequent changes are ignored.
|
|
28
|
+
* Defaults to 365, or 400 with chat layout enabled.
|
|
29
|
+
* After a user resize, one preferred width is retained across inline and overlay modes.
|
|
30
|
+
* Available space can constrain the rendered width without overwriting that preference.
|
|
31
|
+
*/
|
|
32
|
+
defaultPanelWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Default at compact viewport sizes. Defaults to 320, or an explicitly supplied defaultPanelWidth.
|
|
35
|
+
* Used only until a controlled width or user resize supplies a preference.
|
|
36
|
+
*/
|
|
37
|
+
compactDefaultPanelWidth?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Minimum width in pixels. Defaults to 320; overlays can be smaller in a narrower container.
|
|
40
|
+
*/
|
|
41
|
+
panelMinWidth?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Optional maximum width in pixels.
|
|
44
|
+
*/
|
|
45
|
+
panelMaxWidth?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Called after user resizing, with the effective width. Accept this value to control panelWidth.
|
|
48
|
+
*/
|
|
49
|
+
onPanelWidthChange?: (width: number) => void;
|
|
50
|
+
/**
|
|
51
|
+
* One callback per completed pointer/keyboard resize, for persistence and analytics.
|
|
52
|
+
*/
|
|
53
|
+
onResizeEnd?: (event: PanelResizeEnd) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Accessible region and splitter labels; pass localized values in products.
|
|
56
|
+
*/
|
|
57
|
+
panelLabel?: string;
|
|
58
|
+
resizeLabel?: string;
|
|
59
|
+
testId?: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A coordinated local panel with caller-owned content and state. Keep this host mounted
|
|
63
|
+
* while closed to retain resized widths. Unmount it to reset its width preferences.
|
|
64
|
+
*
|
|
65
|
+
* Mount only one local-panel host per navigation Root/sizing coordinator, including
|
|
66
|
+
* closed hosts and panel-system's LayoutWithPanel. Switch content through the same host;
|
|
67
|
+
* separate Roots may each own a local panel.
|
|
68
|
+
*
|
|
69
|
+
* With chat layout enabled it shares Root's sizing coordinator. Otherwise it measures
|
|
70
|
+
* its own Main region, leaving existing navigation/chat behavior unchanged.
|
|
71
|
+
* Local-panel placement and resize constraints use this layout in both cases; disabling
|
|
72
|
+
* the chat-layout gate does not restore the previous panel-system layout engine.
|
|
73
|
+
*/
|
|
74
|
+
export declare function PanelLayout(props: PanelLayoutProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/navigation-system/layout/panel-layout",
|
|
3
|
+
"main": "../../dist/cjs/entry-points/layout/panel-layout.js",
|
|
4
|
+
"module": "../../dist/esm/entry-points/layout/panel-layout.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/entry-points/layout/panel-layout.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/entry-points/layout/panel-layout.d.ts"
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@atlaskit/primitives": "^22.6.0",
|
|
75
75
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
76
76
|
"@atlaskit/side-nav-items": "^2.6.0",
|
|
77
|
-
"@atlaskit/tokens": "^20.
|
|
77
|
+
"@atlaskit/tokens": "^20.7.0",
|
|
78
78
|
"@atlaskit/tooltip": "^24.4.0",
|
|
79
79
|
"@atlaskit/top-layer": "^6.6.0",
|
|
80
80
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
"@atlaskit/textfield": "^10.2.0",
|
|
127
127
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
128
128
|
"@atlassian/gemini": "^1.54.0",
|
|
129
|
-
"@atlassian/panel-system": "^
|
|
129
|
+
"@atlassian/panel-system": "^2.0.0",
|
|
130
130
|
"@atlassian/react-async": "^0.23.0",
|
|
131
131
|
"@atlassian/react-entrypoint": "^1.1.0",
|
|
132
|
-
"@atlassian/search-dialog": "^10.
|
|
132
|
+
"@atlassian/search-dialog": "^10.24.0",
|
|
133
133
|
"@atlassian/ssr-tests": "workspace:^",
|
|
134
134
|
"@atlassian/test-utils": "^1.1.0",
|
|
135
135
|
"@atlassian/testing-library": "^0.12.0",
|