@atlaskit/navigation-system 11.5.0 → 11.6.1
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 +20 -0
- package/dist/cjs/entry-points/top-nav-items/responsive-button.js +12 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +72 -23
- package/dist/cjs/ui/page-layout/chat-panel.js +1 -1
- package/dist/cjs/ui/page-layout/layout-overlay-clearance.js +61 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +10 -3
- package/dist/cjs/ui/page-layout/panel-layout.js +5 -3
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/cjs/ui/page-layout/root.compiled.css +5 -1
- package/dist/cjs/ui/page-layout/root.js +8 -2
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +2 -1
- package/dist/cjs/ui/page-layout/top-nav/use-is-compact-top-nav.js +16 -0
- package/dist/cjs/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +5 -3
- package/dist/cjs/ui/page-layout/top-nav/use-top-nav-breakpoints.js +4 -3
- package/dist/cjs/ui/top-nav-items/create-button.js +16 -1
- package/dist/cjs/ui/top-nav-items/responsive-button.js +38 -0
- package/dist/cjs/ui/top-nav-items/themed/icon-button.js +24 -4
- package/dist/cjs/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/cjs/ui/top-nav-items/themed/responsive-icon-button.js +33 -0
- package/dist/cjs/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/cjs/ui/top-nav-items/themed/themed-icon-button.js +68 -55
- package/dist/cjs/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/cjs/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/es2019/entry-points/top-nav-items/responsive-button.js +1 -0
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +60 -16
- package/dist/es2019/ui/page-layout/chat-panel.js +2 -1
- package/dist/es2019/ui/page-layout/layout-overlay-clearance.js +88 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +14 -3
- package/dist/es2019/ui/page-layout/panel-layout.js +5 -3
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/es2019/ui/page-layout/root.compiled.css +5 -1
- package/dist/es2019/ui/page-layout/root.js +8 -2
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +6 -1
- package/dist/es2019/ui/page-layout/top-nav/use-is-compact-top-nav.js +11 -0
- package/dist/es2019/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +5 -3
- package/dist/es2019/ui/page-layout/top-nav/use-top-nav-breakpoints.js +4 -3
- package/dist/es2019/ui/top-nav-items/create-button.js +16 -1
- package/dist/es2019/ui/top-nav-items/responsive-button.js +27 -0
- package/dist/es2019/ui/top-nav-items/themed/icon-button.js +23 -4
- package/dist/es2019/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/es2019/ui/top-nav-items/themed/responsive-icon-button.js +26 -0
- package/dist/es2019/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/es2019/ui/top-nav-items/themed/themed-icon-button.js +63 -51
- package/dist/es2019/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/es2019/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/esm/entry-points/top-nav-items/responsive-button.js +1 -0
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +72 -23
- package/dist/esm/ui/page-layout/chat-panel.js +2 -2
- package/dist/esm/ui/page-layout/layout-overlay-clearance.js +55 -0
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/esm/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/esm/ui/page-layout/panel-layout-shell.js +10 -3
- package/dist/esm/ui/page-layout/panel-layout.js +5 -3
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/esm/ui/page-layout/root.compiled.css +5 -1
- package/dist/esm/ui/page-layout/root.js +8 -2
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +3 -2
- package/dist/esm/ui/page-layout/top-nav/use-is-compact-top-nav.js +11 -0
- package/dist/esm/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +5 -3
- package/dist/esm/ui/page-layout/top-nav/use-top-nav-breakpoints.js +4 -3
- package/dist/esm/ui/top-nav-items/create-button.js +16 -1
- package/dist/esm/ui/top-nav-items/responsive-button.js +29 -0
- package/dist/esm/ui/top-nav-items/themed/icon-button.js +24 -4
- package/dist/esm/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/esm/ui/top-nav-items/themed/responsive-icon-button.js +26 -0
- package/dist/esm/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/esm/ui/top-nav-items/themed/themed-icon-button.js +68 -55
- package/dist/esm/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/esm/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/types/entry-points/top-nav-items/responsive-button.d.ts +1 -0
- package/dist/types/ui/page-layout/layout-overlay-clearance.d.ts +9 -0
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +6 -1
- package/dist/types/ui/page-layout/panel-layout.d.ts +1 -1
- package/dist/types/ui/page-layout/top-nav/top-nav-element-context.d.ts +4 -0
- package/dist/types/ui/page-layout/top-nav/use-is-compact-top-nav.d.ts +6 -0
- package/dist/types/ui/page-layout/top-nav/use-top-nav-breakpoints.d.ts +4 -3
- package/dist/types/ui/top-nav-items/create-button.d.ts +2 -0
- package/dist/types/ui/top-nav-items/responsive-button.d.ts +23 -0
- package/dist/types/ui/top-nav-items/themed/icon-button.d.ts +1 -5
- package/dist/types/ui/top-nav-items/themed/responsive-icon-button.d.ts +10 -0
- package/dist/types/ui/top-nav-items/themed/themed-icon-button.d.ts +8 -0
- package/package.json +6 -5
- package/top-nav-items/responsive-button/package.json +10 -0
|
@@ -8,19 +8,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.CreateButton = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
11
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
|
+
var _responsiveButton = require("./responsive-button");
|
|
11
13
|
var _button = require("./themed/button");
|
|
14
|
+
var _iconButton = require("./themed/icon-button");
|
|
12
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
16
|
/**
|
|
14
17
|
* __Create button__
|
|
15
18
|
*
|
|
16
19
|
* The create button for the top navigation.
|
|
20
|
+
* With platform-dst-chat-panel-layout enabled, shows only its icon below the
|
|
21
|
+
* enclosing TopNav's 48rem breakpoint. Children remain its accessible label.
|
|
17
22
|
*/
|
|
18
23
|
var CreateButton = exports.CreateButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
19
24
|
var children = _ref.children,
|
|
20
25
|
onClick = _ref.onClick,
|
|
21
26
|
testId = _ref.testId,
|
|
22
27
|
interactionName = _ref.interactionName;
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
28
|
+
return (0, _fg.fg)('platform-dst-chat-panel-layout') ? /*#__PURE__*/_react.default.createElement(_responsiveButton.ResponsiveButton, {
|
|
29
|
+
ref: ref,
|
|
30
|
+
appearance: "primary",
|
|
31
|
+
iconButton: _iconButton.IconButton,
|
|
32
|
+
isTooltipDisabled: false,
|
|
33
|
+
icon: _add.default,
|
|
34
|
+
label: children,
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
testId: testId,
|
|
37
|
+
interactionName: interactionName
|
|
38
|
+
}) : /*#__PURE__*/_react.default.createElement(_button.Button, {
|
|
24
39
|
ref: ref,
|
|
25
40
|
appearance: "primary",
|
|
26
41
|
iconBefore: _add.default,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ResponsiveButton = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _useIsCompactTopNav = require("../page-layout/top-nav/use-is-compact-top-nav");
|
|
13
|
+
var _excluded = ["iconButton", "icon", "label", "tooltip", "isTooltipDisabled"];
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* An explicit responsive action: icon-only at xs/xxs, icon and label at sm and above.
|
|
17
|
+
* TopNav provides container measurements behind platform-dst-chat-panel-layout.
|
|
18
|
+
* Server markup uses an accessible icon-only fallback until client measurement.
|
|
19
|
+
* With the gate off or outside TopNav, it uses text. The button element is preserved.
|
|
20
|
+
*/
|
|
21
|
+
var ResponsiveButton = exports.ResponsiveButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
22
|
+
var IconButtonComponent = _ref.iconButton,
|
|
23
|
+
icon = _ref.icon,
|
|
24
|
+
label = _ref.label,
|
|
25
|
+
tooltip = _ref.tooltip,
|
|
26
|
+
_ref$isTooltipDisable = _ref.isTooltipDisabled,
|
|
27
|
+
isTooltipDisabled = _ref$isTooltipDisable === void 0 ? false : _ref$isTooltipDisable,
|
|
28
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
var isCompact = (0, _useIsCompactTopNav.useIsCompactTopNav)();
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(IconButtonComponent, (0, _extends2.default)({}, props, {
|
|
31
|
+
ref: ref,
|
|
32
|
+
icon: icon,
|
|
33
|
+
label: label,
|
|
34
|
+
shouldShowLabel: !isCompact,
|
|
35
|
+
isTooltipDisabled: isTooltipDisabled,
|
|
36
|
+
tooltip: tooltip
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
@@ -7,15 +7,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.IconButton = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
13
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
14
|
var _hasCustomThemeContext = require("./has-custom-theme-context");
|
|
15
|
+
var _responsiveIconButton = require("./responsive-icon-button");
|
|
13
16
|
var _themedIconButton = require("./themed-icon-button");
|
|
17
|
+
var _excluded = ["isTooltipDisabled", "shouldShowLabel"];
|
|
14
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
-
var IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
19
|
+
var IconButton = exports.IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
20
|
+
var isTooltipDisabled = _ref.isTooltipDisabled,
|
|
21
|
+
shouldShowLabel = _ref.shouldShowLabel,
|
|
22
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
16
23
|
var hasCustomTheme = (0, _hasCustomThemeContext.useHasCustomTheme)();
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
if (shouldShowLabel !== undefined) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_responsiveIconButton.ResponsiveIconButton, (0, _extends2.default)({}, props, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
shouldShowLabel: shouldShowLabel,
|
|
28
|
+
isTooltipDisabled: isTooltipDisabled
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
// Preserve legacy custom-theme behavior outside the chat-panel rollout.
|
|
32
|
+
return hasCustomTheme ? /*#__PURE__*/_react.default.createElement(_themedIconButton.ThemedIconButton, (0, _extends2.default)({
|
|
19
33
|
ref: ref
|
|
20
|
-
}, props
|
|
34
|
+
}, props, {
|
|
35
|
+
isTooltipDisabled: (0, _fg.fg)('platform-dst-chat-panel-layout') ? isTooltipDisabled : undefined
|
|
36
|
+
})) : /*#__PURE__*/_react.default.createElement(_button.default, (0, _extends2.default)({
|
|
37
|
+
ref: ref
|
|
38
|
+
}, props, {
|
|
39
|
+
isTooltipDisabled: isTooltipDisabled
|
|
40
|
+
}));
|
|
21
41
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
._11f215s3{--ds-top-bar-button-selected-background:var(--ds-background-selected,#e9f2fe)}
|
|
2
|
+
._17r4187o{--ds-top-bar-button-disabled-background:var(--ds-background-disabled,#0515240f)}
|
|
3
|
+
._17r41j28{--ds-top-bar-button-disabled-background:transparent}
|
|
4
|
+
._1a59g6ey{--ds-top-bar-button-primary-background-pressed:var(--ds-background-brand-bold-pressed,#144794)}
|
|
5
|
+
._1b56sm61{--ds-top-bar-button-background:var(--ds-background-neutral-subtle,#00000000)}
|
|
6
|
+
._1fcq1l7x{--ds-top-bar-button-border:var(--ds-border,#0b120e24)}
|
|
7
|
+
._1ir41856{--ds-top-bar-button-primary-background:var(--ds-background-brand-bold,#1868db)}
|
|
8
|
+
._1jdn1gmx{--ds-top-bar-button-disabled-text:var(--ds-text-disabled,#080f214a)}
|
|
9
|
+
._1lx4fcek{--ds-top-bar-button-background-pressed:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
10
|
+
._1ugg6x5g{--ds-top-bar-button-selected-text:var(--ds-text-selected,#1868db)}
|
|
11
|
+
._1uufq98m{--ds-top-bar-button-selected-border:var(--ds-border-selected,#1868db)}
|
|
12
|
+
._1wknufnl{--ds-top-bar-button-selected-background-hovered:var(--ds-background-selected-hovered,#cfe1fd)}
|
|
13
|
+
._1wn615cr{--ds-top-bar-button-primary-text:var(--ds-text-inverse,#fff)}
|
|
14
|
+
._1y6knozp{--ds-top-bar-button-selected-background-pressed:var(--ds-background-selected-pressed,#8fb8f6)}
|
|
15
|
+
._3zkhhf2y{--ds-top-bar-button-primary-background-hovered:var(--ds-background-brand-bold-hovered,#1558bc)}
|
|
16
|
+
._rrxibk0g{--ds-top-bar-button-disabled-border:var(--ds-border-disabled,#0515240f)}
|
|
17
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
18
|
+
._y05i1dpa{--ds-top-bar-button-background-hovered:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* responsive-icon-button.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.ResponsiveIconButton = void 0;
|
|
10
|
+
require("./responsive-icon-button.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _hasCustomThemeContext = require("./has-custom-theme-context");
|
|
15
|
+
var _themedIconButton = require("./themed-icon-button");
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
// Custom properties adapt the existing themed control to the default ADS palette.
|
|
18
|
+
var styles = {
|
|
19
|
+
defaultTheme: "_syazazsu _1b56sm61 _y05i1dpa _1lx4fcek _1fcq1l7x _1wn615cr _1ir41856 _3zkhhf2y _1a59g6ey _1ugg6x5g _11f215s3 _1wknufnl _1y6knozp _1uufq98m _1jdn1gmx _17r4187o",
|
|
20
|
+
neutralDisabled: "_17r41j28 _rrxibk0g"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Keep one control mounted, including its tooltip, while its label and shape change.
|
|
25
|
+
*/
|
|
26
|
+
var ResponsiveIconButton = exports.ResponsiveIconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
27
|
+
var hasCustomTheme = (0, _hasCustomThemeContext.useHasCustomTheme)();
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
29
|
+
className: (0, _runtime.ax)([!hasCustomTheme && styles.defaultTheme, !hasCustomTheme && props.appearance !== 'primary' && styles.neutralDisabled])
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_themedIconButton.ThemedIconButton, (0, _extends2.default)({}, props, {
|
|
31
|
+
ref: ref
|
|
32
|
+
})));
|
|
33
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.ThemedIconButton = void 0;
|
|
10
|
+
require("./themed-icon-button.compiled.css");
|
|
10
11
|
var _runtime = require("@compiled/react/runtime");
|
|
11
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -16,66 +17,78 @@ var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
|
|
|
16
17
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden/visually-hidden"));
|
|
17
18
|
var _iconRenderer = _interopRequireDefault(require("../icon-renderer"));
|
|
18
19
|
var _themedPressable = require("./themed-pressable");
|
|
19
|
-
var _excluded = ["icon", "label", "tooltip"];
|
|
20
|
+
var _excluded = ["icon", "label", "tooltip", "isTooltipDisabled", "shouldShowLabel"];
|
|
20
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
|
+
var styles = {
|
|
23
|
+
label: "_k48p1wq8"
|
|
24
|
+
};
|
|
21
25
|
var ThemedIconButton = exports.ThemedIconButton = /*#__PURE__*/(0, _react.forwardRef)(function ThemedIconButton(_ref, ref) {
|
|
22
26
|
var _tooltip$content;
|
|
23
27
|
var Icon = _ref.icon,
|
|
24
28
|
label = _ref.label,
|
|
25
29
|
tooltip = _ref.tooltip,
|
|
30
|
+
isTooltipDisabled = _ref.isTooltipDisabled,
|
|
31
|
+
_ref$shouldShowLabel = _ref.shouldShowLabel,
|
|
32
|
+
shouldShowLabel = _ref$shouldShowLabel === void 0 ? false : _ref$shouldShowLabel,
|
|
26
33
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
34
|
+
return (
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
// Keep the trigger mounted when tooltip availability changes so focus is preserved.
|
|
37
|
+
_react.default.createElement(_Tooltip.default, (0, _extends2.default)({}, tooltip, {
|
|
38
|
+
content: isTooltipDisabled || shouldShowLabel ? null : (_tooltip$content = tooltip === null || tooltip === void 0 ? void 0 : tooltip.content) !== null && _tooltip$content !== void 0 ? _tooltip$content : label
|
|
39
|
+
}), function (triggerProps) {
|
|
40
|
+
return (
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
/**
|
|
43
|
+
* The `aria-describedby` from `triggerProps` is intentionally not passed down,
|
|
44
|
+
* because it would cause double announcements with the `VisuallyHidden` label.
|
|
45
|
+
*
|
|
46
|
+
* The `@atlaskit/button` IconButton uses the same approach.
|
|
47
|
+
*/
|
|
48
|
+
_react.default.createElement(_themedPressable.ThemedPressable, (0, _extends2.default)({}, props, {
|
|
49
|
+
shape: shouldShowLabel ? 'default' : 'square',
|
|
50
|
+
ref: (0, _mergeRefs.default)([ref, triggerProps.ref]),
|
|
51
|
+
onClick: function onClick(event, analyticsEvent) {
|
|
52
|
+
var _props$onClick, _triggerProps$onClick;
|
|
53
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event, analyticsEvent);
|
|
54
|
+
triggerProps === null || triggerProps === void 0 || (_triggerProps$onClick = triggerProps.onClick) === null || _triggerProps$onClick === void 0 || _triggerProps$onClick.call(triggerProps, event);
|
|
55
|
+
},
|
|
56
|
+
onMouseOver: function onMouseOver(e) {
|
|
57
|
+
var _triggerProps$onMouse, _props$onMouseOver;
|
|
58
|
+
(_triggerProps$onMouse = triggerProps.onMouseOver) === null || _triggerProps$onMouse === void 0 || _triggerProps$onMouse.call(triggerProps, e);
|
|
59
|
+
(_props$onMouseOver = props.onMouseOver) === null || _props$onMouseOver === void 0 || _props$onMouseOver.call(props, e);
|
|
60
|
+
},
|
|
61
|
+
onMouseOut: function onMouseOut(e) {
|
|
62
|
+
var _triggerProps$onMouse2, _props$onMouseOut;
|
|
63
|
+
(_triggerProps$onMouse2 = triggerProps.onMouseOut) === null || _triggerProps$onMouse2 === void 0 || _triggerProps$onMouse2.call(triggerProps, e);
|
|
64
|
+
(_props$onMouseOut = props.onMouseOut) === null || _props$onMouseOut === void 0 || _props$onMouseOut.call(props, e);
|
|
65
|
+
},
|
|
66
|
+
onMouseMove: function onMouseMove(e) {
|
|
67
|
+
var _triggerProps$onMouse3, _props$onMouseMove;
|
|
68
|
+
(_triggerProps$onMouse3 = triggerProps.onMouseMove) === null || _triggerProps$onMouse3 === void 0 || _triggerProps$onMouse3.call(triggerProps, e);
|
|
69
|
+
(_props$onMouseMove = props.onMouseMove) === null || _props$onMouseMove === void 0 || _props$onMouseMove.call(props, e);
|
|
70
|
+
},
|
|
71
|
+
onMouseDown: function onMouseDown(e) {
|
|
72
|
+
var _triggerProps$onMouse4, _props$onMouseDown;
|
|
73
|
+
(_triggerProps$onMouse4 = triggerProps.onMouseDown) === null || _triggerProps$onMouse4 === void 0 || _triggerProps$onMouse4.call(triggerProps, e);
|
|
74
|
+
(_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 || _props$onMouseDown.call(props, e);
|
|
75
|
+
},
|
|
76
|
+
onFocus: function onFocus(e) {
|
|
77
|
+
var _triggerProps$onFocus, _props$onFocus;
|
|
78
|
+
(_triggerProps$onFocus = triggerProps.onFocus) === null || _triggerProps$onFocus === void 0 || _triggerProps$onFocus.call(triggerProps, e);
|
|
79
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 || _props$onFocus.call(props, e);
|
|
80
|
+
},
|
|
81
|
+
onBlur: function onBlur(e) {
|
|
82
|
+
var _triggerProps$onBlur, _props$onBlur;
|
|
83
|
+
(_triggerProps$onBlur = triggerProps.onBlur) === null || _triggerProps$onBlur === void 0 || _triggerProps$onBlur.call(triggerProps, e);
|
|
84
|
+
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
|
|
85
|
+
}
|
|
86
|
+
}), /*#__PURE__*/_react.default.createElement(_iconRenderer.default, {
|
|
87
|
+
icon: Icon
|
|
88
|
+
}), shouldShowLabel ? /*#__PURE__*/_react.default.createElement("span", {
|
|
89
|
+
className: (0, _runtime.ax)([styles.label])
|
|
90
|
+
}, label) : /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, label))
|
|
91
|
+
);
|
|
92
|
+
})
|
|
93
|
+
);
|
|
81
94
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
._1tv3nqa1:after{border-style:solid}
|
|
15
15
|
._39yqe4h9:after{border-width:var(--ds-border-width,1px)}
|
|
16
16
|
._8l3m15jn:after{border-color:var(--ds-top-bar-button-selected-border)}
|
|
17
|
-
.
|
|
17
|
+
._8l3m4il5:after{border-color:var(--ds-top-bar-button-disabled-border,transparent)}
|
|
18
18
|
._8l3maykr:after{border-color:var(--ds-top-bar-button-border)}
|
|
19
19
|
._18postnw:after{position:absolute}
|
|
20
20
|
._1bah1h6o{justify-content:center}
|
|
@@ -21,7 +21,7 @@ var styles = {
|
|
|
21
21
|
root: "_zulp12x7 _11c8fhey _2rko1qi0 _v564k6bl _4bfu1r31 _1hmsglyw _ajmmnqa1 _1rjcze3t _1e0c1txw _4cvr1h6o _1bah1h6o _4t3i5r7u _kqswh2mm _1nrm1r31 _1a3b1r31 _9oik1r31 _c2waglyw _4fprglyw _1bnxglyw _1iohnqa1 _5goinqa1 _jf4cnqa1 _1ggl5xtf",
|
|
22
22
|
border: "_14mj1kw7 _9v7aze3t _1tv3nqa1 _39yqe4h9 _aetrb3bt _18postnw",
|
|
23
23
|
selected: "_11q71qds _syazw5ct _8l3m15jn _f8pjw5ct _1053w5ct _19lcjrv1 _30l3w5ct _j6xtnh62 _9h8hw5ct",
|
|
24
|
-
disabled: "_11q71c9b _syaz1i3i
|
|
24
|
+
disabled: "_11q71c9b _syaz1i3i _8l3m4il5 _f8pj1i3i _10531i3i _19lc1c9b _30l31i3i _j6xt1c9b _9h8h1i3i"
|
|
25
25
|
};
|
|
26
26
|
var shapeStyles = {
|
|
27
27
|
default: "_18zrutpp",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ResponsiveButton as ResponsiveTopNavButton } from '../../ui/top-nav-items/responsive-button';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
1
2
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
2
3
|
function clampTargetWidth({
|
|
3
4
|
target,
|
|
@@ -27,8 +28,9 @@ export function calculateLayoutAreaStates({
|
|
|
27
28
|
resizeSession,
|
|
28
29
|
initialModes
|
|
29
30
|
}) {
|
|
30
|
-
var _ref3, _resizeSession$overla, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
31
|
+
var _ref3, _resizeSession$overla, _resizeSession$overla2, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
31
32
|
const mainMinWidth = resolveLayoutWidth(mainMinWidthBound, viewportWidth);
|
|
33
|
+
const isRefinedLayout = fg('platform-dst-chat-panel-layout');
|
|
32
34
|
const availableWidth = Math.max(0, layoutWidth - occupiedWidth);
|
|
33
35
|
const sideNav = areas['side-nav'];
|
|
34
36
|
const panel = areas.panel;
|
|
@@ -42,14 +44,35 @@ export function calculateLayoutAreaStates({
|
|
|
42
44
|
const layoutModes = (_resizeSession$overla = resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.overlayModes) !== null && _resizeSession$overla !== void 0 ? _resizeSession$overla : initialModes;
|
|
43
45
|
// A growing panel cascades towards inline-start. Chat is on the other side
|
|
44
46
|
// of the local rail, so local growth must reserve its full starting width.
|
|
45
|
-
const shouldCollapseSideNav = Boolean(resizeSession && resizeSession.area !== 'side-nav' && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
47
|
+
const shouldCollapseSideNav = Boolean(resizeSession && resizeSession.area !== 'side-nav' && !(isRefinedLayout && ((_resizeSession$overla2 = resizeSession.overlayModes) === null || _resizeSession$overla2 === void 0 ? void 0 : _resizeSession$overla2.panel) === 'overlay' && resizeSession.area === 'panel') && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
46
48
|
target: getTargetWidth(resizingArea, isSideNavOverlay),
|
|
47
49
|
min: resolveLayoutWidth(resizingArea.minWidth, viewportWidth),
|
|
48
50
|
max: resizingArea.maxWidth !== undefined ? resolveLayoutWidth(resizingArea.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY
|
|
49
51
|
}) > availableWidth - mainMinWidth - sideNavMinWidth - (resizeSession.area === 'panel' ? resizeSession.baselineWidths['chat-panel'] !== undefined ? (_baselineWidths$chat = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths['chat-panel']) !== null && _baselineWidths$chat !== void 0 ? _baselineWidths$chat : chatPanelMinWidth : 0 : resizeSession.baselineWidths.panel !== undefined ? panelMinWidth : 0));
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
let isSideNavOpenInline = Boolean((sideNav === null || sideNav === void 0 ? void 0 : sideNav.isOpen) && !shouldCollapseSideNav && (layoutModes ? layoutModes['side-nav'] === 'inline' : !isSideNavOverlay && availableWidth >= mainMinWidth + sideNavMinWidth));
|
|
53
|
+
const canInlineChat = () => Boolean((chatPanel === null || chatPanel === void 0 ? void 0 : chatPanel.isOpen) && (!resizeSession || resizeSession.baselineWidths['chat-panel'] !== undefined) && (layoutModes ? layoutModes['chat-panel'] === 'inline' : !isChatPanelOverlay && availableWidth >= mainMinWidth + chatPanelMinWidth + (isSideNavOpenInline ? sideNavMinWidth : 0)));
|
|
54
|
+
let isChatPanelOpenInline = canInlineChat();
|
|
55
|
+
const canInlinePanel = () => Boolean((panel === null || panel === void 0 ? void 0 : panel.isOpen) && (!resizeSession || resizeSession.baselineWidths.panel !== undefined) && (layoutModes ? layoutModes.panel === 'inline' : availableWidth >= mainMinWidth + panelMinWidth + (isChatPanelOpenInline ? chatPanelMinWidth : 0) + (isSideNavOpenInline ? sideNavMinWidth : 0)));
|
|
56
|
+
let isPanelInline = canInlinePanel();
|
|
57
|
+
const overlayMainMinWidth = Math.max(mainMinWidth, panelMinWidth + 32);
|
|
58
|
+
if (isRefinedLayout && panel !== null && panel !== void 0 && panel.isOpen && !isPanelInline && isSideNavOpenInline && availableWidth < overlayMainMinWidth + sideNavMinWidth + (isChatPanelOpenInline ? chatPanelMinWidth : 0)) {
|
|
59
|
+
// Wider app minimums may leave no capacity for the clearance even after
|
|
60
|
+
// both siblings reach minimum. Move Chat to overlay, then recheck local.
|
|
61
|
+
isChatPanelOpenInline = false;
|
|
62
|
+
isPanelInline = canInlinePanel();
|
|
63
|
+
if (!isPanelInline && availableWidth < overlayMainMinWidth + sideNavMinWidth) {
|
|
64
|
+
// A constrained Root may not fit even navigation beside local's overlay.
|
|
65
|
+
isSideNavOpenInline = false;
|
|
66
|
+
isChatPanelOpenInline = canInlineChat();
|
|
67
|
+
isPanelInline = canInlinePanel();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// The clearance belongs to Main only while local overlays an inline SideNav.
|
|
72
|
+
// Decide placement using the ordinary minimum first, so the gap does not
|
|
73
|
+
// unnecessarily promote an otherwise-fitting inline panel to overlay.
|
|
74
|
+
const hasPanelClearance = isRefinedLayout && (panel === null || panel === void 0 ? void 0 : panel.isOpen) && !isPanelInline && isSideNavOpenInline;
|
|
75
|
+
const effectiveMainMinWidth = hasPanelClearance ? overlayMainMinWidth : mainMinWidth;
|
|
53
76
|
const inlineAreas = [isSideNavOpenInline && 'side-nav', isPanelInline && 'panel', isChatPanelOpenInline && 'chat-panel'].filter(area => Boolean(area));
|
|
54
77
|
const widths = new Map();
|
|
55
78
|
const minimums = new Map();
|
|
@@ -89,7 +112,7 @@ export function calculateLayoutAreaStates({
|
|
|
89
112
|
const chatWidth = (_widths$get3 = widths.get('chat-panel')) !== null && _widths$get3 !== void 0 ? _widths$get3 : 0;
|
|
90
113
|
widths.set('chat-panel', Math.max(chatPanelMinWidth, chatWidth - remainingDrag));
|
|
91
114
|
}
|
|
92
|
-
let overflow = Math.max(0, Array.from(widths.values()).reduce((total, width) => total + width, 0) - (availableWidth - mainMinWidth));
|
|
115
|
+
let overflow = Math.max(0, Array.from(widths.values()).reduce((total, width) => total + width, 0) - (availableWidth - (resizeSession ? effectiveMainMinWidth : mainMinWidth)));
|
|
93
116
|
const compressionOrder = ['panel', 'chat-panel', 'side-nav'];
|
|
94
117
|
// Main gives up spare space first. Only regions beyond the moving rail may
|
|
95
118
|
// then compress: local growth moves towards SideNav, never towards Chat.
|
|
@@ -106,11 +129,30 @@ export function calculateLayoutAreaStates({
|
|
|
106
129
|
widths.set(areaName, width - reduction);
|
|
107
130
|
overflow -= reduction;
|
|
108
131
|
}
|
|
132
|
+
if (hasPanelClearance && panel) {
|
|
133
|
+
var _panel$compactDefault, _widths$get5, _widths$get6;
|
|
134
|
+
// Opening/viewport fitting gives up SideNav width before Chat. During a
|
|
135
|
+
// panel drag only SideNav yields; Chat retains its starting width.
|
|
136
|
+
const isPanelResize = (resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'panel';
|
|
137
|
+
const desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, 'panel'), panel.maxWidth === undefined ? Infinity : resolveLayoutWidth(panel.maxWidth, viewportWidth)));
|
|
138
|
+
const overlayDefault = isSideNavOverlay ? (_panel$compactDefault = panel.compactDefaultWidth) !== null && _panel$compactDefault !== void 0 ? _panel$compactDefault : panel.defaultWidth : panel.defaultWidth;
|
|
139
|
+
const reservedMainWidth = isPanelResize ? Math.max(effectiveMainMinWidth, desiredPanelWidth + 32,
|
|
140
|
+
// Above the default, Main must also fit the panel within its 90% cap.
|
|
141
|
+
desiredPanelWidth > overlayDefault ? desiredPanelWidth / 0.9 : 0) : effectiveMainMinWidth;
|
|
142
|
+
let deficit = Math.max(0, reservedMainWidth + ((_widths$get5 = widths.get('side-nav')) !== null && _widths$get5 !== void 0 ? _widths$get5 : 0) + ((_widths$get6 = widths.get('chat-panel')) !== null && _widths$get6 !== void 0 ? _widths$get6 : 0) - availableWidth);
|
|
143
|
+
for (const name of isPanelResize ? ['side-nav'] : ['side-nav', 'chat-panel']) {
|
|
144
|
+
var _widths$get7, _minimums$get2;
|
|
145
|
+
const width = (_widths$get7 = widths.get(name)) !== null && _widths$get7 !== void 0 ? _widths$get7 : 0;
|
|
146
|
+
const reduction = Math.min(deficit, Math.max(0, width - ((_minimums$get2 = minimums.get(name)) !== null && _minimums$get2 !== void 0 ? _minimums$get2 : 0)));
|
|
147
|
+
widths.set(name, width - reduction);
|
|
148
|
+
deficit -= reduction;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
109
151
|
const states = {};
|
|
110
152
|
for (const areaName of inlineAreas) {
|
|
111
|
-
var _widths$
|
|
112
|
-
const width = (_widths$
|
|
113
|
-
const min = (_minimums$
|
|
153
|
+
var _widths$get8, _minimums$get3, _areas$areaName;
|
|
154
|
+
const width = (_widths$get8 = widths.get(areaName)) !== null && _widths$get8 !== void 0 ? _widths$get8 : 0;
|
|
155
|
+
const min = (_minimums$get3 = minimums.get(areaName)) !== null && _minimums$get3 !== void 0 ? _minimums$get3 : 0;
|
|
114
156
|
const maxWidth = (_areas$areaName = areas[areaName]) === null || _areas$areaName === void 0 ? void 0 : _areas$areaName.maxWidth;
|
|
115
157
|
const configuredMax = maxWidth !== undefined ? resolveLayoutWidth(maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
116
158
|
states[areaName] = {
|
|
@@ -119,9 +161,9 @@ export function calculateLayoutAreaStates({
|
|
|
119
161
|
minWidth: min,
|
|
120
162
|
resizeBounds: {
|
|
121
163
|
min,
|
|
122
|
-
max: Math.max(min, Math.min(configuredMax, availableWidth -
|
|
123
|
-
var _widths$
|
|
124
|
-
return sibling === areaName || sibling === 'side-nav' && areaName !== 'side-nav' ? total : total + (areaName === 'panel' && sibling === 'chat-panel' ? (_widths$
|
|
164
|
+
max: Math.max(min, Math.min(configuredMax, availableWidth - effectiveMainMinWidth - inlineAreas.reduce((total, sibling) => {
|
|
165
|
+
var _widths$get9, _minimums$get4;
|
|
166
|
+
return sibling === areaName || sibling === 'side-nav' && areaName !== 'side-nav' ? total : total + (areaName === 'panel' && sibling === 'chat-panel' ? (_widths$get9 = widths.get(sibling)) !== null && _widths$get9 !== void 0 ? _widths$get9 : 0 : (_minimums$get4 = minimums.get(sibling)) !== null && _minimums$get4 !== void 0 ? _minimums$get4 : 0);
|
|
125
167
|
}, 0)))
|
|
126
168
|
}
|
|
127
169
|
};
|
|
@@ -130,7 +172,7 @@ export function calculateLayoutAreaStates({
|
|
|
130
172
|
const inlineChatPanelWidth = (_states$chatPanel$wi = (_states$chatPanel = states['chat-panel']) === null || _states$chatPanel === void 0 ? void 0 : _states$chatPanel.width) !== null && _states$chatPanel$wi !== void 0 ? _states$chatPanel$wi : 0;
|
|
131
173
|
const mainAreaWidth = Math.max(0, availableWidth - inlineSideNavWidth - inlineChatPanelWidth);
|
|
132
174
|
for (const areaName of ['side-nav', 'panel', 'chat-panel']) {
|
|
133
|
-
var _states$areaName;
|
|
175
|
+
var _states$areaName, _area$compactDefaultW3;
|
|
134
176
|
const area = areas[areaName];
|
|
135
177
|
if (!(area !== null && area !== void 0 && area.isOpen) || ((_states$areaName = states[areaName]) === null || _states$areaName === void 0 ? void 0 : _states$areaName.mode) === 'inline' || areaName === 'side-nav' && shouldCollapseSideNav) {
|
|
136
178
|
continue;
|
|
@@ -140,13 +182,15 @@ export function calculateLayoutAreaStates({
|
|
|
140
182
|
// Chat covers Root; SideNav and the local panel overlay Main's grid track.
|
|
141
183
|
// Occupied tracks and inline chat are not part of that covered region.
|
|
142
184
|
const layoutMax = (areaName === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
143
|
-
const
|
|
144
|
-
const
|
|
185
|
+
const defaultWidth = isSideNavOverlay ? (_area$compactDefaultW3 = area.compactDefaultWidth) !== null && _area$compactDefaultW3 !== void 0 ? _area$compactDefaultW3 : area.defaultWidth : area.defaultWidth;
|
|
186
|
+
const overlayMax = isRefinedLayout && areaName === 'panel' ? hasPanelClearance ? Math.min(availableWidth - sideNavMinWidth - inlineChatPanelWidth - 32, Math.max(defaultWidth, (availableWidth - sideNavMinWidth - inlineChatPanelWidth) * 0.9)) : Math.min(mainAreaWidth, Math.max(defaultWidth, layoutMax)) : layoutMax;
|
|
187
|
+
const max = isRefinedLayout && areaName === 'panel' ? Math.max(min, Math.min(configuredMax, overlayMax)) : Math.max(0, Math.min(configuredMax, overlayMax));
|
|
188
|
+
const effectiveMin = isRefinedLayout && areaName === 'panel' ? min : Math.min(min, max);
|
|
145
189
|
const target = getOverlayTargetWidth(area, isSideNavOverlay, areaName);
|
|
146
190
|
const width = clampTargetWidth({
|
|
147
191
|
target,
|
|
148
192
|
min: effectiveMin,
|
|
149
|
-
max
|
|
193
|
+
max: hasPanelClearance && areaName === 'panel' ? Math.min(max, mainAreaWidth - 32, Math.max(defaultWidth, layoutMax)) : max
|
|
150
194
|
});
|
|
151
195
|
states[areaName] = {
|
|
152
196
|
mode: 'overlay',
|
|
@@ -10,7 +10,7 @@ import { chatPanelLiveWidthVar, chatPanelVar, defaultMainMinWidth, localSlotLaye
|
|
|
10
10
|
import { convertResizeBoundToPixels } from './panel-splitter/convert-resize-bound-to-pixels';
|
|
11
11
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
12
12
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
13
|
-
import { gridRootId } from './root';
|
|
13
|
+
import { gridRootFitId, gridRootId } from './root';
|
|
14
14
|
import { useLayoutAreaSizing } from './use-layout-area-sizing';
|
|
15
15
|
import { useLayoutId } from './use-layout-id';
|
|
16
16
|
import { useResizingWidthCssVarOnRootElement } from './use-resizing-width-css-var-on-root-element';
|
|
@@ -186,6 +186,7 @@ export function ChatPanel({
|
|
|
186
186
|
React.createElement("style", null, managedSizing ? `
|
|
187
187
|
#${gridRootId} { --n_chatTrack: ${mode === 'inline' ? `${renderedWidth}px` : '0px'}; ${chatPanelLiveWidthVar}: var(--n_chatTrack); }
|
|
188
188
|
` : `
|
|
189
|
+
#${gridRootFitId} { --n_clearanceChatMin: ${minWidth}; --n_clearanceChatTarget: ${chatPanelVariableWidth}; }
|
|
189
190
|
#${gridRootId} { --n_chatTrack: 0px; ${chatPanelLiveWidthVar}: 0px; }
|
|
190
191
|
#${gridRootId} [data-layout-chat-panel] {
|
|
191
192
|
grid-area: 2 / 1 / -1 / -1;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { gridRootChatFitId, gridRootId } from './root';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CSS owns fitting before hydration and lazy resize activation. Each slot hoists
|
|
6
|
+
* its own minimum and target into Root's capacity containers during rendering;
|
|
7
|
+
* the local shell supplies its minimum without waiting for effect registration.
|
|
8
|
+
*/
|
|
9
|
+
export function LayoutOverlayClearance({
|
|
10
|
+
panelMinWidth,
|
|
11
|
+
mainMinWidth
|
|
12
|
+
}) {
|
|
13
|
+
const navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
14
|
+
const navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
15
|
+
const chatMinimum = 'var(--n_clearanceChatMin, 0px)';
|
|
16
|
+
const chatTarget = 'var(--n_clearanceChatTarget, 0px)';
|
|
17
|
+
const extra = Math.max(0, panelMinWidth + 32 - mainMinWidth);
|
|
18
|
+
const available = 'calc(var(--n_layoutW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px))';
|
|
19
|
+
const root = `#${gridRootId}:has(> nav[data-layout-side-nav-open])`;
|
|
20
|
+
const fit = `#${gridRootChatFitId}:has(> #${gridRootId} > nav[data-layout-side-nav-open])`;
|
|
21
|
+
const rule = (chatInline, selector) => {
|
|
22
|
+
const chatMin = chatInline ? chatMinimum : '0px';
|
|
23
|
+
const baselineNav = `min(${navTarget}, calc(${available} - ${mainMinWidth}px - ${chatMin}))`;
|
|
24
|
+
const baselineChat = chatInline ? `max(${chatMin}, min(${chatTarget}, calc(${available} - ${mainMinWidth}px - ${navTarget})))` : '0px';
|
|
25
|
+
const deficit = `max(0px, calc(${mainMinWidth + extra}px + ${baselineNav} + ${baselineChat} - ${available}))`;
|
|
26
|
+
const navWidth = `max(${navMin}, calc(${baselineNav} - ${deficit}))`;
|
|
27
|
+
const chatWidth = `max(${chatMin}, calc(${baselineChat} - max(0px, calc(${deficit} - (${baselineNav} - ${navMin})))))`;
|
|
28
|
+
const container = chatInline ? 'navigation-panel-chat-space' : 'navigation-panel-nav-space';
|
|
29
|
+
return `@container ${container} (width >= ${extra + 1}px) and (width < ${panelMinWidth + 1}px) {
|
|
30
|
+
${selector} { --n_localPanelOverlayMax: calc(100% - 32px); ${chatInline ? `--n_chatTrack: ${chatWidth};` : ''} }
|
|
31
|
+
${selector} > nav[data-layout-slot] { width: ${navWidth}; }
|
|
32
|
+
${chatInline ? `${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }` : ''}
|
|
33
|
+
}`;
|
|
34
|
+
};
|
|
35
|
+
const inlineRule = (chatInline, selector) => {
|
|
36
|
+
const chatMin = chatInline ? chatMinimum : '0px';
|
|
37
|
+
const navWidth = `max(${navMin}, min(${navTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px - ${chatMin})))`;
|
|
38
|
+
const chatWidth = `max(${chatMin}, min(${chatTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px - ${navTarget})))`;
|
|
39
|
+
return `@container ${chatInline ? 'navigation-panel-chat-space' : 'navigation-panel-nav-space'} (width >= ${panelMinWidth + 1}px) {
|
|
40
|
+
${selector} > nav[data-layout-slot] { width: ${navWidth}; }
|
|
41
|
+
${chatInline ? `${selector} { --n_chatTrack: ${chatWidth}; }
|
|
42
|
+
${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }` : ''}
|
|
43
|
+
}`;
|
|
44
|
+
};
|
|
45
|
+
// Without inline navigation, only Main and the two panels share the width.
|
|
46
|
+
// Reserve local's minimum before allowing Chat to consume spare capacity.
|
|
47
|
+
const inlineWithoutNav = selector => `
|
|
48
|
+
@container navigation-panel-chat-space (width >= ${panelMinWidth + 1}px) {
|
|
49
|
+
${selector} { --n_chatTrack: min(${chatTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px)); }
|
|
50
|
+
${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }
|
|
51
|
+
}`;
|
|
52
|
+
const withoutChat = `${root}:not(:has(> [data-layout-chat-panel]))`;
|
|
53
|
+
const withChat = `${root}:has(> [data-layout-chat-panel])`;
|
|
54
|
+
// React 18 escapes comparison operators in style children during SSR. The
|
|
55
|
+
// stylesheet contains only internal selectors/tokens and numeric width props.
|
|
56
|
+
const css = `@media (min-width: 64rem) {
|
|
57
|
+
@container navigation-panel-nav-space (width < ${extra + 1}px) {
|
|
58
|
+
${fit} { --n_fitNav: 0px; }
|
|
59
|
+
${root} > nav[data-layout-slot] { grid-area: main; width: min(90%, ${navTarget}); background-color: ${"var(--ds-surface-overlay, #FFFFFF)"}; box-shadow: ${"var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"}; border-inline-end: none; }
|
|
60
|
+
}
|
|
61
|
+
@container navigation-panel-nav-space (width >= ${extra + 1}px) {
|
|
62
|
+
@container navigation-panel-chat-space (width < ${panelMinWidth + 1}px) {
|
|
63
|
+
${fit} { --n_fitNav: calc(${navMin} + ${extra}px); }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
${rule(false, withoutChat)}
|
|
67
|
+
${inlineRule(false, withoutChat)}
|
|
68
|
+
@container navigation-panel-chat-space (width < ${extra + 1}px) {
|
|
69
|
+
${rule(false, withChat)}
|
|
70
|
+
${inlineRule(false, withChat)}
|
|
71
|
+
}
|
|
72
|
+
${rule(true, withChat)}
|
|
73
|
+
${inlineRule(true, withChat)}
|
|
74
|
+
${inlineWithoutNav(`#${gridRootId}:not(:has(> nav[data-layout-side-nav-open]))`)}
|
|
75
|
+
}
|
|
76
|
+
@media (min-width: 40rem) and (width < 64rem) {
|
|
77
|
+
${inlineWithoutNav(`#${gridRootId}:has(> [data-layout-chat-panel])`)}
|
|
78
|
+
}`;
|
|
79
|
+
return (
|
|
80
|
+
/*#__PURE__*/
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, react/no-danger -- Root-scoped, internally generated CSS must retain query operators during SSR.
|
|
82
|
+
React.createElement("style", {
|
|
83
|
+
dangerouslySetInnerHTML: {
|
|
84
|
+
__html: css
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
._16qs1dhr{box-shadow:var(--p_lclPnlSsrShadow,var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f))}
|
|
12
12
|
._16qsglyw{box-shadow:none}
|
|
13
13
|
._18m91wug{overflow-y:auto}
|
|
14
|
+
._1bsb123g{width:var(--p_lclPnlSsrWidth,max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),100%,var(--n_localPanelOverlayMax,100%),max(var(--p_lclPnlSsrDefaultW),90%))))}
|
|
14
15
|
._1bsb13q4{width:min(90%,var(--p_lclPnlRsz,var(--p_lclPnlW)))}
|
|
15
16
|
._1bsb1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}
|
|
16
17
|
._1bsb1cku{width:var(--p_lclPnlSsrWidth,min(90%,var(--p_lclPnlSsrPreferredW)))}
|