@atlaskit/navigation-system 11.7.9 → 11.8.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/constellation/layout/code.mdx +8 -0
  3. package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +20 -14
  4. package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +4 -1
  5. package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +19 -6
  6. package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +1 -3
  7. package/dist/cjs/ui/page-layout/local-panel-surface.js +13 -3
  8. package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +2 -1
  9. package/dist/cjs/ui/page-layout/panel-layout-shell.js +11 -8
  10. package/dist/cjs/ui/page-layout/panel-layout.js +9 -1
  11. package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
  12. package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +19 -14
  13. package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +4 -1
  14. package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +17 -6
  15. package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +1 -3
  16. package/dist/es2019/ui/page-layout/local-panel-surface.js +13 -3
  17. package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +2 -1
  18. package/dist/es2019/ui/page-layout/panel-layout-shell.js +14 -7
  19. package/dist/es2019/ui/page-layout/panel-layout.js +7 -1
  20. package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
  21. package/dist/esm/ui/page-layout/calculate-layout-area-states.js +20 -14
  22. package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +4 -1
  23. package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +19 -6
  24. package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +1 -3
  25. package/dist/esm/ui/page-layout/local-panel-surface.js +13 -3
  26. package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +2 -1
  27. package/dist/esm/ui/page-layout/panel-layout-shell.js +11 -8
  28. package/dist/esm/ui/page-layout/panel-layout.js +9 -1
  29. package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
  30. package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +5 -1
  31. package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +1 -0
  32. package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +2 -1
  33. package/dist/types/ui/page-layout/panel-layout-shell.d.ts +3 -1
  34. package/dist/types/ui/page-layout/panel-layout.d.ts +8 -1
  35. package/package.json +4 -4
@@ -14,7 +14,7 @@ import { useLayoutAreaSizing } from './use-layout-area-sizing';
14
14
  // Development-only ownership checks are scoped to each coordinator, not the whole page.
15
15
  var mountedPanelLayouts = new WeakSet();
16
16
  function CoordinatedPanelLayout(_ref) {
17
- var _ref2, _state$width;
17
+ var _ref2, _ref3, _state$width;
18
18
  var children = _ref.children,
19
19
  panel = _ref.panel,
20
20
  isPanelOpen = _ref.isPanelOpen,
@@ -22,6 +22,7 @@ function CoordinatedPanelLayout(_ref) {
22
22
  panelWidth = _ref.panelWidth,
23
23
  defaultPanelWidth = _ref.defaultPanelWidth,
24
24
  compactDefaultPanelWidth = _ref.compactDefaultPanelWidth,
25
+ xlDefaultPanelWidth = _ref.xlDefaultPanelWidth,
25
26
  suppliedMinWidth = _ref.panelMinWidth,
26
27
  panelMaxWidth = _ref.panelMaxWidth,
27
28
  onPanelWidthChange = _ref.onPanelWidthChange,
@@ -52,6 +53,9 @@ function CoordinatedPanelLayout(_ref) {
52
53
  var _useState5 = useState((_ref2 = compactDefaultPanelWidth !== null && compactDefaultPanelWidth !== void 0 ? compactDefaultPanelWidth : defaultPanelWidth) !== null && _ref2 !== void 0 ? _ref2 : fg('platform-dst-chat-panel-layout') ? defaults.compactPanelWidth : panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaults.compactPanelWidth),
53
54
  _useState6 = _slicedToArray(_useState5, 1),
54
55
  compactWidth = _useState6[0];
56
+ var _useState7 = useState(fg('platform-dst-chat-panel-layout') ? (_ref3 = xlDefaultPanelWidth !== null && xlDefaultPanelWidth !== void 0 ? xlDefaultPanelWidth : defaultPanelWidth) !== null && _ref3 !== void 0 ? _ref3 : 500 : defaultWidth),
57
+ _useState8 = _slicedToArray(_useState7, 1),
58
+ xlWidth = _useState8[0];
55
59
  // Use the controlled request before measurement too, without changing the mount-time default.
56
60
  var fallbackWidth = Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaultWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity));
57
61
  var _useLayoutAreaSizing = useLayoutAreaSizing({
@@ -61,6 +65,7 @@ function CoordinatedPanelLayout(_ref) {
61
65
  requestedWidth: panelWidth,
62
66
  defaultWidth: defaultWidth,
63
67
  compactDefaultWidth: compactWidth,
68
+ xlDefaultWidth: xlWidth,
64
69
  minWidth: panelMinWidth,
65
70
  maxWidth: panelMaxWidth
66
71
  }
@@ -107,6 +112,8 @@ function CoordinatedPanelLayout(_ref) {
107
112
  isPanelOpen: isPanelOpen,
108
113
  panelWidth: (_state$width = state === null || state === void 0 ? void 0 : state.width) !== null && _state$width !== void 0 ? _state$width : fallbackWidth,
109
114
  defaultPanelWidth: defaultWidth,
115
+ xlDefaultPanelWidth: xlWidth,
116
+ xlPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : xlWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
110
117
  compactDefaultPanelWidth: compactWidth,
111
118
  compactPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : compactWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
112
119
  panelMinWidth: panelMinWidth,
@@ -142,6 +149,7 @@ export function PanelLayout(props) {
142
149
  panelWidth: props.panelWidth,
143
150
  defaultPanelWidth: props.defaultPanelWidth,
144
151
  compactDefaultPanelWidth: props.compactDefaultPanelWidth,
152
+ xlDefaultPanelWidth: props.xlDefaultPanelWidth,
145
153
  panelMinWidth: props.panelMinWidth,
146
154
  panelMaxWidth: props.panelMaxWidth,
147
155
  onPanelWidthChange: props.onPanelWidthChange,
@@ -8,6 +8,7 @@ export function useLayoutAreaSizing(_ref) {
8
8
  var requestedWidth = config.requestedWidth,
9
9
  defaultWidth = config.defaultWidth,
10
10
  compactDefaultWidth = config.compactDefaultWidth,
11
+ xlDefaultWidth = config.xlDefaultWidth,
11
12
  minWidth = config.minWidth,
12
13
  maxWidth = config.maxWidth,
13
14
  isOpen = config.isOpen,
@@ -34,12 +35,13 @@ export function useLayoutAreaSizing(_ref) {
34
35
  requestedWidth: requestedWidth,
35
36
  defaultWidth: defaultWidth,
36
37
  compactDefaultWidth: compactDefaultWidth,
38
+ xlDefaultWidth: xlDefaultWidth,
37
39
  minWidth: minWidth,
38
40
  maxWidth: maxWidth,
39
41
  isOpen: isOpen,
40
42
  onRequestClose: requestClose
41
43
  });
42
- }, [area, compactDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
44
+ }, [area, compactDefaultWidth, xlDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
43
45
  useEffect(function () {
44
46
  return function () {
45
47
  return unregisterArea === null || unregisterArea === void 0 ? void 0 : unregisterArea(area);
@@ -1,5 +1,5 @@
1
1
  import type { LayoutArea, LayoutAreaAllocation, LayoutAreaMode, LayoutWidthBound, ResizeSession, StoredLayoutArea } from './layout-area-sizing-context';
2
- export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, initialModes, }: {
2
+ export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, isXlViewport, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, initialModes, }: {
3
3
  viewportWidth: number;
4
4
  /**
5
5
  * Root's content width, excluding scrollbars, borders and padding.
@@ -13,6 +13,10 @@ export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth,
13
13
  * Whether the viewport is below Root and SideNav's 64rem desktop breakpoint.
14
14
  */
15
15
  isSideNavOverlay: boolean;
16
+ /**
17
+ * Whether the viewport matches the 110.5rem XL breakpoint.
18
+ */
19
+ isXlViewport?: boolean;
16
20
  occupiedWidth?: number;
17
21
  mainMinWidth: LayoutWidthBound;
18
22
  areas: Partial<Record<LayoutArea, StoredLayoutArea>>;
@@ -10,6 +10,7 @@ export type LayoutAreaConfig = {
10
10
  requestedWidth?: number;
11
11
  defaultWidth: number;
12
12
  compactDefaultWidth?: number;
13
+ xlDefaultWidth?: number;
13
14
  minWidth: LayoutWidthBound;
14
15
  maxWidth?: LayoutWidthBound;
15
16
  isOpen: boolean;
@@ -1,8 +1,9 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type LayoutArea, type LayoutAreaState, type LayoutAreaSizingContextValue } from './layout-area-sizing-context';
3
- export declare function LayoutAreaSizingRuntime({ children, layoutRef, onReady, onUpdate, }: {
3
+ export declare function LayoutAreaSizingRuntime({ children, layoutRef, onReady, onUpdate, viewportWidthAtLoad, }: {
4
4
  children?: ReactNode;
5
5
  layoutRef?: React.RefObject<HTMLDivElement | null>;
6
+ viewportWidthAtLoad?: number;
6
7
  onReady?: (actions: LayoutAreaSizingContextValue | null) => void;
7
8
  onUpdate?: (states: Partial<Record<LayoutArea, LayoutAreaState>>) => void;
8
9
  }): JSX.Element;
@@ -22,6 +22,8 @@ type PanelLayoutShellProps = {
22
22
  */
23
23
  panelWidth: number;
24
24
  compactPanelWidth: number;
25
+ xlPanelWidth: number;
26
+ xlDefaultPanelWidth: number;
25
27
  /**
26
28
  * Mount-time defaults determine the overlay cap independently of saved widths.
27
29
  */
@@ -48,5 +50,5 @@ type PanelLayoutShellProps = {
48
50
  /**
49
51
  * Grid and scrolling for Main and its local panel. Use inside navigation's Root and Main.
50
52
  */
51
- export declare function PanelLayoutShell({ children, panel, isPanelOpen, panelWidth, compactPanelWidth, defaultPanelWidth, compactDefaultPanelWidth, panelMinWidth, mode, layoutRef, shouldClipOverflow, testId, }: PanelLayoutShellProps): JSX.Element;
53
+ export declare function PanelLayoutShell({ children, panel, isPanelOpen, panelWidth, compactPanelWidth, xlPanelWidth, xlDefaultPanelWidth, defaultPanelWidth, compactDefaultPanelWidth, panelMinWidth, mode, layoutRef, shouldClipOverflow, testId, }: PanelLayoutShellProps): JSX.Element;
52
54
  export {};
@@ -25,7 +25,8 @@ export type PanelLayoutProps = {
25
25
  panelWidth?: number;
26
26
  /**
27
27
  * Initial preferred width in pixels; subsequent changes are ignored.
28
- * Defaults to 365, or 400 with chat layout enabled.
28
+ * Defaults to 365, or 400 with chat layout enabled (500 at XL and above).
29
+ * An explicit value also supplies the compact and XL defaults unless separately overridden.
29
30
  * After a user resize, one preferred width is retained across inline and overlay modes.
30
31
  * Available space can constrain the rendered width without overwriting that preference.
31
32
  */
@@ -35,6 +36,12 @@ export type PanelLayoutProps = {
35
36
  * Used only until a controlled width or user resize supplies a preference.
36
37
  */
37
38
  compactDefaultPanelWidth?: number;
39
+ /**
40
+ * Default at XL viewports (110.5rem / 1768px and above), with chat layout enabled.
41
+ * Defaults to 500, or an explicitly supplied defaultPanelWidth.
42
+ * Captured on mount; controlled and user-resized widths take precedence.
43
+ */
44
+ xlDefaultPanelWidth?: number;
38
45
  /**
39
46
  * Minimum width in pixels. Defaults to 320. With chat layout enabled, overlays retain this minimum.
40
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "11.7.9",
3
+ "version": "11.8.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",
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/side-nav-items": "^2.6.0",
77
77
  "@atlaskit/tokens": "^20.12.0",
78
78
  "@atlaskit/tooltip": "^24.4.0",
79
- "@atlaskit/top-layer": "^8.0.0",
79
+ "@atlaskit/top-layer": "^8.1.0",
80
80
  "@atlaskit/visually-hidden": "^4.4.0",
81
81
  "@babel/runtime": "^7.0.0",
82
82
  "@compiled/react": "^1.0.2",
@@ -124,9 +124,9 @@
124
124
  "@atlaskit/tag": "^17.1.0",
125
125
  "@atlaskit/textarea": "^10.3.0",
126
126
  "@atlaskit/textfield": "^10.3.0",
127
- "@atlassian/feature-flags-test-utils": "^1.3.0",
127
+ "@atlassian/feature-flags-test-utils": "^2.0.0",
128
128
  "@atlassian/gemini": "^1.55.0",
129
- "@atlassian/panel-system": "^2.2.0",
129
+ "@atlassian/panel-system": "^2.3.0",
130
130
  "@atlassian/react-async": "^0.23.0",
131
131
  "@atlassian/react-entrypoint": "^1.1.0",
132
132
  "@atlassian/relay-test-utils": "workspace:^",