@atlaskit/navigation-system 11.6.1 → 11.7.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 11.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`248cb52df6c6d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/248cb52df6c6d) -
8
+ Add ChatPanel compactDefaultWidth to override the compact viewport default independently of
9
+ defaultWidth behind platform-dst-chat-panel-layout.
10
+
3
11
  ## 11.6.1
4
12
 
5
13
  ### Patch Changes
@@ -60,6 +60,7 @@ function ChatPanel(_ref) {
60
60
  var _managedSizing$mode, _managedSizing$width;
61
61
  var children = _ref.children,
62
62
  defaultWidthProp = _ref.defaultWidth,
63
+ compactDefaultWidthProp = _ref.compactDefaultWidth,
63
64
  _ref$minWidth = _ref.minWidth,
64
65
  minWidth = _ref$minWidth === void 0 ? fallbackMinWidth : _ref$minWidth,
65
66
  maxWidth = _ref.maxWidth,
@@ -81,7 +82,12 @@ function ChatPanel(_ref) {
81
82
  fallbackDefaultWidth: fallbackDefaultWidth,
82
83
  slotName: 'ChatPanel'
83
84
  });
84
- var compactDefaultWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
85
+ var compactFallbackWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
86
+ var compactDefaultWidth = (0, _useSafeDefaultWidth.useSafeDefaultWidth)({
87
+ defaultWidthProp: (0, _fg.fg)('platform-dst-chat-panel-layout') ? compactDefaultWidthProp !== null && compactDefaultWidthProp !== void 0 ? compactDefaultWidthProp : compactFallbackWidth : compactFallbackWidth,
88
+ fallbackDefaultWidth: compactFallbackWidth,
89
+ slotName: 'ChatPanel compactDefaultWidth'
90
+ });
85
91
  (0, _useSkipLinkInternal.useSkipLinkInternal)({
86
92
  id: id,
87
93
  label: skipLinkLabel,
@@ -48,6 +48,7 @@ const styles = {
48
48
  export function ChatPanel({
49
49
  children,
50
50
  defaultWidth: defaultWidthProp,
51
+ compactDefaultWidth: compactDefaultWidthProp,
51
52
  minWidth = fallbackMinWidth,
52
53
  maxWidth,
53
54
  label = 'Chat panel',
@@ -67,7 +68,12 @@ export function ChatPanel({
67
68
  fallbackDefaultWidth,
68
69
  slotName: 'ChatPanel'
69
70
  });
70
- const compactDefaultWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
71
+ const compactFallbackWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
72
+ const compactDefaultWidth = useSafeDefaultWidth({
73
+ defaultWidthProp: fg('platform-dst-chat-panel-layout') ? compactDefaultWidthProp !== null && compactDefaultWidthProp !== void 0 ? compactDefaultWidthProp : compactFallbackWidth : compactFallbackWidth,
74
+ fallbackDefaultWidth: compactFallbackWidth,
75
+ slotName: 'ChatPanel compactDefaultWidth'
76
+ });
71
77
  useSkipLinkInternal({
72
78
  id,
73
79
  label: skipLinkLabel,
@@ -51,6 +51,7 @@ export function ChatPanel(_ref) {
51
51
  var _managedSizing$mode, _managedSizing$width;
52
52
  var children = _ref.children,
53
53
  defaultWidthProp = _ref.defaultWidth,
54
+ compactDefaultWidthProp = _ref.compactDefaultWidth,
54
55
  _ref$minWidth = _ref.minWidth,
55
56
  minWidth = _ref$minWidth === void 0 ? fallbackMinWidth : _ref$minWidth,
56
57
  maxWidth = _ref.maxWidth,
@@ -72,7 +73,12 @@ export function ChatPanel(_ref) {
72
73
  fallbackDefaultWidth: fallbackDefaultWidth,
73
74
  slotName: 'ChatPanel'
74
75
  });
75
- var compactDefaultWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
76
+ var compactFallbackWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
77
+ var compactDefaultWidth = useSafeDefaultWidth({
78
+ defaultWidthProp: fg('platform-dst-chat-panel-layout') ? compactDefaultWidthProp !== null && compactDefaultWidthProp !== void 0 ? compactDefaultWidthProp : compactFallbackWidth : compactFallbackWidth,
79
+ fallbackDefaultWidth: compactFallbackWidth,
80
+ slotName: 'ChatPanel compactDefaultWidth'
81
+ });
76
82
  useSkipLinkInternal({
77
83
  id: id,
78
84
  label: skipLinkLabel,
@@ -9,7 +9,7 @@ import type { CommonSlotProps } from './types';
9
9
  *
10
10
  * You can optionally render a `PanelSplitter` as a child to make the chat panel resizable.
11
11
  */
12
- export declare function ChatPanel({ children, defaultWidth: defaultWidthProp, minWidth, maxWidth, label, skipLinkLabel, testId, id: providedId, xcss, hasBorder, onClose, }: CommonSlotProps & {
12
+ export declare function ChatPanel({ children, defaultWidth: defaultWidthProp, compactDefaultWidth: compactDefaultWidthProp, minWidth, maxWidth, label, skipLinkLabel, testId, id: providedId, xcss, hasBorder, onClose, }: CommonSlotProps & {
13
13
  /**
14
14
  * The content of the layout area.
15
15
  */
@@ -19,9 +19,16 @@ export declare function ChatPanel({ children, defaultWidth: defaultWidthProp, mi
19
19
  */
20
20
  label?: string;
21
21
  /**
22
- * The default width of the layout area in pixels.
22
+ * The default width of the layout area in pixels. Defaults to 400.
23
+ * Also used at compact viewport sizes unless compactDefaultWidth is supplied.
23
24
  */
24
25
  defaultWidth?: number;
26
+ /**
27
+ * Default width in pixels at compact viewport sizes, before user resizing.
28
+ * Falls back to an explicitly supplied defaultWidth, then 320.
29
+ * Requires platform-dst-chat-panel-layout. Available space and resize bounds still apply.
30
+ */
31
+ compactDefaultWidth?: number;
25
32
  /**
26
33
  * The minimum width the chat panel can be resized to.
27
34
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "11.6.1",
3
+ "version": "11.7.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",