@atlaskit/navigation-system 10.7.1 → 10.9.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 +73 -0
- package/constellation/top-nav-items/examples.mdx +1 -4
- package/dist/cjs/ui/page-layout/panel.js +10 -6
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/es2019/ui/page-layout/panel.js +10 -6
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/esm/ui/page-layout/panel.js +10 -6
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +4 -1
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +15 -3
- package/dist/types/ui/page-layout/panel.d.ts +14 -1
- package/dist/types/ui/top-nav-items/nav-logo/app-logo.d.ts +16 -10
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 10.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`994b264c96af8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/994b264c96af8) -
|
|
8
|
+
`AppLogo` now accepts an optional `secondaryName` prop, which renders supporting text below the
|
|
9
|
+
app name in wider viewports. This can be used to provide extra context for an app or experience
|
|
10
|
+
while keeping the existing `name`, `label`, and small-screen behavior unchanged.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
|
|
14
|
+
import { AppLogo } from '@atlaskit/navigation-system/top-nav-items';
|
|
15
|
+
|
|
16
|
+
<AppLogo
|
|
17
|
+
href="http://www.atlassian.design"
|
|
18
|
+
icon={ConfluenceIcon}
|
|
19
|
+
name="Confluence"
|
|
20
|
+
secondaryName="Documentation"
|
|
21
|
+
label="Home page"
|
|
22
|
+
/>;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 10.8.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- [`5dd6269af3c70`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5dd6269af3c70) -
|
|
34
|
+
Add an opt-in `maxWidth` to the `Panel` layout slot and preview panel `Panel` config, letting a
|
|
35
|
+
single consumer request a wider resize bound (e.g. `70vw`) than the default cap of half the
|
|
36
|
+
viewport width. Defaults are unchanged, so all existing consumers remain capped at the default.
|
|
37
|
+
|
|
38
|
+
**`@atlaskit/navigation-system`** — the `Panel` layout slot accepts a `maxWidth` (`vw`/`px`),
|
|
39
|
+
applied to both the rendered width and the resize bounds (mouse and keyboard):
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Panel } from '@atlaskit/navigation-system/layout/panel';
|
|
43
|
+
|
|
44
|
+
<Panel defaultWidth={600} maxWidth="70vw">
|
|
45
|
+
{/* ...panel content... */}
|
|
46
|
+
</Panel>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**`@atlassian/preview-panels-api`** — the opened panel config takes the same `maxWidth`:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { usePreviewPanelsActions } from '@atlassian/preview-panels-api';
|
|
53
|
+
|
|
54
|
+
const { open } = usePreviewPanelsActions();
|
|
55
|
+
|
|
56
|
+
open({
|
|
57
|
+
panel: {
|
|
58
|
+
id: 'issue-123',
|
|
59
|
+
type: 'issue',
|
|
60
|
+
product: 'jira',
|
|
61
|
+
content: () => <IssuePreview />,
|
|
62
|
+
maxWidth: '70vw',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**`@atlassian/preview-panel-global-objects`** — `useGlobalObjectPreviewPanels` accepts a
|
|
68
|
+
`maxWidth` option that it forwards onto the panel it opens, so global-object preview panels
|
|
69
|
+
(Confluence page, goals, teams, CMDB object, etc.) share the same wider bound. Omitting it keeps
|
|
70
|
+
the default cap:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
const previewPanels = useGlobalObjectPreviewPanels('jira', cloudId, { maxWidth: '70vw' });
|
|
74
|
+
```
|
|
75
|
+
|
|
3
76
|
## 10.7.1
|
|
4
77
|
|
|
5
78
|
### Patch Changes
|
|
@@ -171,10 +171,7 @@ A button component that supports theming. The following variants are available:
|
|
|
171
171
|
Use this component when you need to add buttons to the top nav. Be aware that adding custom buttons
|
|
172
172
|
may negatively impact the consistency across apps.
|
|
173
173
|
|
|
174
|
-
<Example
|
|
175
|
-
Component={TopNavButtonExample}
|
|
176
|
-
featureFlagDefaults={{ 'platform-dst-motion-uplift-button': true }}
|
|
177
|
-
/>
|
|
174
|
+
<Example Component={TopNavButtonExample} />
|
|
178
175
|
|
|
179
176
|
## Responsive
|
|
180
177
|
|
|
@@ -67,7 +67,8 @@ function Panel(_ref) {
|
|
|
67
67
|
providedId = _ref.id,
|
|
68
68
|
xcss = _ref.xcss,
|
|
69
69
|
_ref$hasBorder = _ref.hasBorder,
|
|
70
|
-
hasBorder = _ref$hasBorder === void 0 ? true : _ref$hasBorder
|
|
70
|
+
hasBorder = _ref$hasBorder === void 0 ? true : _ref$hasBorder,
|
|
71
|
+
maxWidth = _ref.maxWidth;
|
|
71
72
|
var dangerouslyHoistSlotSizes = (0, _react.useContext)(_hoistSlotSizesContext.DangerouslyHoistSlotSizes);
|
|
72
73
|
var id = (0, _useLayoutId.useLayoutId)({
|
|
73
74
|
providedId: providedId
|
|
@@ -166,20 +167,23 @@ function Panel(_ref) {
|
|
|
166
167
|
var _sideNavRef$current$o, _sideNavRef$current;
|
|
167
168
|
var sideNavWidth = (_sideNavRef$current$o = (_sideNavRef$current = sideNavRef.current) === null || _sideNavRef$current === void 0 ? void 0 : _sideNavRef$current.offsetWidth) !== null && _sideNavRef$current$o !== void 0 ? _sideNavRef$current$o : 0;
|
|
168
169
|
/**
|
|
169
|
-
*
|
|
170
|
+
* By default the panel should not resize larger than the page content, equivalent to the `Main` + `Aside` slots.
|
|
170
171
|
*
|
|
171
172
|
* This maximum width is equivalent to half the viewport width, after removing the sidebar width.
|
|
173
|
+
*
|
|
174
|
+
* Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
172
175
|
*/
|
|
173
|
-
var
|
|
176
|
+
var defaultMaxWidth = "".concat(Math.round((window.innerWidth - sideNavWidth) / 2), "px");
|
|
174
177
|
return {
|
|
175
178
|
min: "".concat(minWidth, "px"),
|
|
176
|
-
max:
|
|
179
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : defaultMaxWidth
|
|
177
180
|
};
|
|
178
|
-
}, [minWidth, sideNavRef]);
|
|
181
|
+
}, [maxWidth, minWidth, sideNavRef]);
|
|
179
182
|
var panelWidthSlotBounds = {
|
|
180
183
|
min: "".concat(minWidth, "px"),
|
|
181
184
|
// `sideNavLiveWidthVar` is not defined if the `SideNav` is not mounted, so we fallback to `0px`.
|
|
182
|
-
|
|
185
|
+
// Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
186
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : "round(nearest, calc((100vw - var(".concat(_constants.sideNavLiveWidthVar, ", 0px)) / 2), 1px)")
|
|
183
187
|
};
|
|
184
188
|
var panelVariableWidth = "clamp(".concat(panelWidthSlotBounds.min, ", ").concat(width, "px, ").concat(panelWidthSlotBounds.max, ")");
|
|
185
189
|
(0, _useResizingWidthCssVarOnRootElement.useResizingWidthCssVarOnRootElement)({
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -34,14 +34,16 @@ var iconContainerStyles = {
|
|
|
34
34
|
fullHeightSidebar: "_1o9zidpf"
|
|
35
35
|
};
|
|
36
36
|
var logoTextStyles = {
|
|
37
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
37
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
38
|
+
};
|
|
39
|
+
var secondaryNameStyles = {
|
|
40
|
+
root: "_1pfh1i6y"
|
|
38
41
|
};
|
|
39
42
|
function isTextClamped(element) {
|
|
40
43
|
// Checking for vertical height rather than horizontal height.
|
|
41
44
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
42
45
|
return element.scrollHeight > element.clientHeight;
|
|
43
46
|
}
|
|
44
|
-
|
|
45
47
|
/**
|
|
46
48
|
* __App logo__
|
|
47
49
|
*
|
|
@@ -52,6 +54,7 @@ function isTextClamped(element) {
|
|
|
52
54
|
var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
53
55
|
var name = _ref.name,
|
|
54
56
|
label = _ref.label,
|
|
57
|
+
secondaryName = _ref.secondaryName,
|
|
55
58
|
href = _ref.href,
|
|
56
59
|
icon = _ref.icon,
|
|
57
60
|
onClick = _ref.onClick;
|
|
@@ -59,6 +62,7 @@ var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
|
59
62
|
var ref = (0, _react.useRef)(null);
|
|
60
63
|
var nameRef = (0, _react.useRef)(null);
|
|
61
64
|
var hasCustomTheme = (0, _hasCustomThemeContext.useHasCustomTheme)();
|
|
65
|
+
var showSecondaryName = Boolean(secondaryName) && (0, _platformFeatureFlags.fg)('platform_dst_ads_appswitcher_improvements');
|
|
62
66
|
|
|
63
67
|
/**
|
|
64
68
|
* Show the tooltip if the name is truncated
|
|
@@ -107,5 +111,13 @@ var AppLogo = exports.AppLogo = function AppLogo(_ref) {
|
|
|
107
111
|
maxLines: 1,
|
|
108
112
|
ref: nameRef
|
|
109
113
|
}, name));
|
|
110
|
-
})
|
|
114
|
+
}), showSecondaryName && /*#__PURE__*/_react.default.createElement("span", {
|
|
115
|
+
className: (0, _runtime.ax)([secondaryNameStyles.root])
|
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
117
|
+
"aria-hidden": true,
|
|
118
|
+
color: "color.text.subtlest",
|
|
119
|
+
weight: "regular",
|
|
120
|
+
maxLines: 1,
|
|
121
|
+
size: "small"
|
|
122
|
+
}, secondaryName)))));
|
|
111
123
|
};
|
|
@@ -52,7 +52,8 @@ export function Panel({
|
|
|
52
52
|
testId,
|
|
53
53
|
id: providedId,
|
|
54
54
|
xcss,
|
|
55
|
-
hasBorder = true
|
|
55
|
+
hasBorder = true,
|
|
56
|
+
maxWidth
|
|
56
57
|
}) {
|
|
57
58
|
const dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
58
59
|
const id = useLayoutId({
|
|
@@ -148,20 +149,23 @@ export function Panel({
|
|
|
148
149
|
var _sideNavRef$current$o, _sideNavRef$current;
|
|
149
150
|
const sideNavWidth = (_sideNavRef$current$o = (_sideNavRef$current = sideNavRef.current) === null || _sideNavRef$current === void 0 ? void 0 : _sideNavRef$current.offsetWidth) !== null && _sideNavRef$current$o !== void 0 ? _sideNavRef$current$o : 0;
|
|
150
151
|
/**
|
|
151
|
-
*
|
|
152
|
+
* By default the panel should not resize larger than the page content, equivalent to the `Main` + `Aside` slots.
|
|
152
153
|
*
|
|
153
154
|
* This maximum width is equivalent to half the viewport width, after removing the sidebar width.
|
|
155
|
+
*
|
|
156
|
+
* Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
154
157
|
*/
|
|
155
|
-
const
|
|
158
|
+
const defaultMaxWidth = `${Math.round((window.innerWidth - sideNavWidth) / 2)}px`;
|
|
156
159
|
return {
|
|
157
160
|
min: `${minWidth}px`,
|
|
158
|
-
max:
|
|
161
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : defaultMaxWidth
|
|
159
162
|
};
|
|
160
|
-
}, [minWidth, sideNavRef]);
|
|
163
|
+
}, [maxWidth, minWidth, sideNavRef]);
|
|
161
164
|
const panelWidthSlotBounds = {
|
|
162
165
|
min: `${minWidth}px`,
|
|
163
166
|
// `sideNavLiveWidthVar` is not defined if the `SideNav` is not mounted, so we fallback to `0px`.
|
|
164
|
-
|
|
167
|
+
// Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
168
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : `round(nearest, calc((100vw - var(${sideNavLiveWidthVar}, 0px)) / 2), 1px)`
|
|
165
169
|
};
|
|
166
170
|
const panelVariableWidth = `clamp(${panelWidthSlotBounds.min}, ${width}px, ${panelWidthSlotBounds.max})`;
|
|
167
171
|
useResizingWidthCssVarOnRootElement({
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -25,14 +25,16 @@ const iconContainerStyles = {
|
|
|
25
25
|
fullHeightSidebar: "_1o9zidpf"
|
|
26
26
|
};
|
|
27
27
|
const logoTextStyles = {
|
|
28
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
28
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
29
|
+
};
|
|
30
|
+
const secondaryNameStyles = {
|
|
31
|
+
root: "_1pfh1i6y"
|
|
29
32
|
};
|
|
30
33
|
function isTextClamped(element) {
|
|
31
34
|
// Checking for vertical height rather than horizontal height.
|
|
32
35
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
33
36
|
return element.scrollHeight > element.clientHeight;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
38
|
/**
|
|
37
39
|
* __App logo__
|
|
38
40
|
*
|
|
@@ -43,6 +45,7 @@ function isTextClamped(element) {
|
|
|
43
45
|
export const AppLogo = ({
|
|
44
46
|
name,
|
|
45
47
|
label,
|
|
48
|
+
secondaryName,
|
|
46
49
|
href,
|
|
47
50
|
icon,
|
|
48
51
|
onClick
|
|
@@ -51,6 +54,7 @@ export const AppLogo = ({
|
|
|
51
54
|
const ref = useRef(null);
|
|
52
55
|
const nameRef = useRef(null);
|
|
53
56
|
const hasCustomTheme = useHasCustomTheme();
|
|
57
|
+
const showSecondaryName = Boolean(secondaryName) && fg('platform_dst_ads_appswitcher_improvements');
|
|
54
58
|
|
|
55
59
|
/**
|
|
56
60
|
* Show the tooltip if the name is truncated
|
|
@@ -97,5 +101,13 @@ export const AppLogo = ({
|
|
|
97
101
|
weight: "semibold",
|
|
98
102
|
maxLines: 1,
|
|
99
103
|
ref: nameRef
|
|
100
|
-
}, name)))
|
|
104
|
+
}, name))), showSecondaryName && /*#__PURE__*/React.createElement("span", {
|
|
105
|
+
className: ax([secondaryNameStyles.root])
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
107
|
+
"aria-hidden": true,
|
|
108
|
+
color: "color.text.subtlest",
|
|
109
|
+
weight: "regular",
|
|
110
|
+
maxLines: 1,
|
|
111
|
+
size: "small"
|
|
112
|
+
}, secondaryName)))));
|
|
101
113
|
};
|
|
@@ -58,7 +58,8 @@ export function Panel(_ref) {
|
|
|
58
58
|
providedId = _ref.id,
|
|
59
59
|
xcss = _ref.xcss,
|
|
60
60
|
_ref$hasBorder = _ref.hasBorder,
|
|
61
|
-
hasBorder = _ref$hasBorder === void 0 ? true : _ref$hasBorder
|
|
61
|
+
hasBorder = _ref$hasBorder === void 0 ? true : _ref$hasBorder,
|
|
62
|
+
maxWidth = _ref.maxWidth;
|
|
62
63
|
var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
63
64
|
var id = useLayoutId({
|
|
64
65
|
providedId: providedId
|
|
@@ -157,20 +158,23 @@ export function Panel(_ref) {
|
|
|
157
158
|
var _sideNavRef$current$o, _sideNavRef$current;
|
|
158
159
|
var sideNavWidth = (_sideNavRef$current$o = (_sideNavRef$current = sideNavRef.current) === null || _sideNavRef$current === void 0 ? void 0 : _sideNavRef$current.offsetWidth) !== null && _sideNavRef$current$o !== void 0 ? _sideNavRef$current$o : 0;
|
|
159
160
|
/**
|
|
160
|
-
*
|
|
161
|
+
* By default the panel should not resize larger than the page content, equivalent to the `Main` + `Aside` slots.
|
|
161
162
|
*
|
|
162
163
|
* This maximum width is equivalent to half the viewport width, after removing the sidebar width.
|
|
164
|
+
*
|
|
165
|
+
* Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
163
166
|
*/
|
|
164
|
-
var
|
|
167
|
+
var defaultMaxWidth = "".concat(Math.round((window.innerWidth - sideNavWidth) / 2), "px");
|
|
165
168
|
return {
|
|
166
169
|
min: "".concat(minWidth, "px"),
|
|
167
|
-
max:
|
|
170
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : defaultMaxWidth
|
|
168
171
|
};
|
|
169
|
-
}, [minWidth, sideNavRef]);
|
|
172
|
+
}, [maxWidth, minWidth, sideNavRef]);
|
|
170
173
|
var panelWidthSlotBounds = {
|
|
171
174
|
min: "".concat(minWidth, "px"),
|
|
172
175
|
// `sideNavLiveWidthVar` is not defined if the `SideNav` is not mounted, so we fallback to `0px`.
|
|
173
|
-
|
|
176
|
+
// Consumers can opt in to a larger maximum via the `maxWidth` prop.
|
|
177
|
+
max: maxWidth !== null && maxWidth !== void 0 ? maxWidth : "round(nearest, calc((100vw - var(".concat(sideNavLiveWidthVar, ", 0px)) / 2), 1px)")
|
|
174
178
|
};
|
|
175
179
|
var panelVariableWidth = "clamp(".concat(panelWidthSlotBounds.min, ", ").concat(width, "px, ").concat(panelWidthSlotBounds.max, ")");
|
|
176
180
|
useResizingWidthCssVarOnRootElement({
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
._2rko19bv{border-radius:10px}
|
|
2
2
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
3
|
._18zr1b66{padding-inline:var(--ds-space-050,4px)}._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bah1h6o{justify-content:center}
|
|
4
5
|
._1bsb1ris{width:max-content}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
6
7
|
._1e0cglyw{display:none}
|
|
7
8
|
._1o9zidpf{flex-shrink:0}
|
|
8
9
|
._1o9zkb7n{flex-shrink:1}
|
|
10
|
+
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
9
11
|
._1reo15vq{overflow-x:hidden}
|
|
10
12
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
11
13
|
._1w901kw7._1w901kw7{color:inherit}
|
|
14
|
+
._2lx21bp4{flex-direction:column}
|
|
12
15
|
._4cvr1h6o{align-items:center}
|
|
13
16
|
._4t3izwfg{height:2pc}
|
|
14
17
|
._5jyqglyw._5jyqglyw{text-decoration-line:none}
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
|
|
25
28
|
._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
|
|
26
29
|
._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
|
|
27
|
-
@media (min-width:64rem){.
|
|
30
|
+
@media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
|
|
@@ -25,14 +25,16 @@ var iconContainerStyles = {
|
|
|
25
25
|
fullHeightSidebar: "_1o9zidpf"
|
|
26
26
|
};
|
|
27
27
|
var logoTextStyles = {
|
|
28
|
-
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw
|
|
28
|
+
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
29
|
+
};
|
|
30
|
+
var secondaryNameStyles = {
|
|
31
|
+
root: "_1pfh1i6y"
|
|
29
32
|
};
|
|
30
33
|
function isTextClamped(element) {
|
|
31
34
|
// Checking for vertical height rather than horizontal height.
|
|
32
35
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
33
36
|
return element.scrollHeight > element.clientHeight;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
38
|
/**
|
|
37
39
|
* __App logo__
|
|
38
40
|
*
|
|
@@ -43,6 +45,7 @@ function isTextClamped(element) {
|
|
|
43
45
|
export var AppLogo = function AppLogo(_ref) {
|
|
44
46
|
var name = _ref.name,
|
|
45
47
|
label = _ref.label,
|
|
48
|
+
secondaryName = _ref.secondaryName,
|
|
46
49
|
href = _ref.href,
|
|
47
50
|
icon = _ref.icon,
|
|
48
51
|
onClick = _ref.onClick;
|
|
@@ -50,6 +53,7 @@ export var AppLogo = function AppLogo(_ref) {
|
|
|
50
53
|
var ref = useRef(null);
|
|
51
54
|
var nameRef = useRef(null);
|
|
52
55
|
var hasCustomTheme = useHasCustomTheme();
|
|
56
|
+
var showSecondaryName = Boolean(secondaryName) && fg('platform_dst_ads_appswitcher_improvements');
|
|
53
57
|
|
|
54
58
|
/**
|
|
55
59
|
* Show the tooltip if the name is truncated
|
|
@@ -98,5 +102,13 @@ export var AppLogo = function AppLogo(_ref) {
|
|
|
98
102
|
maxLines: 1,
|
|
99
103
|
ref: nameRef
|
|
100
104
|
}, name));
|
|
101
|
-
})
|
|
105
|
+
}), showSecondaryName && /*#__PURE__*/React.createElement("span", {
|
|
106
|
+
className: ax([secondaryNameStyles.root])
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
108
|
+
"aria-hidden": true,
|
|
109
|
+
color: "color.text.subtlest",
|
|
110
|
+
weight: "regular",
|
|
111
|
+
maxLines: 1,
|
|
112
|
+
size: "small"
|
|
113
|
+
}, secondaryName)))));
|
|
102
114
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StrictXCSSProp } from '@atlaskit/css';
|
|
2
|
+
import type { ResizeBound } from './panel-splitter/types';
|
|
2
3
|
import type { CommonSlotProps } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* The Panel layout area is rendered to the right (inline end) of the Main area, or the Aside area if it is present.
|
|
@@ -7,7 +8,7 @@ import type { CommonSlotProps } from './types';
|
|
|
7
8
|
*
|
|
8
9
|
* You can optionally render a `PanelSplitter` as a child to make the panel area resizable.
|
|
9
10
|
*/
|
|
10
|
-
export declare function Panel({ children, defaultWidth: defaultWidthProp, label, skipLinkLabel, testId, id: providedId, xcss, hasBorder, }: CommonSlotProps & {
|
|
11
|
+
export declare function Panel({ children, defaultWidth: defaultWidthProp, label, skipLinkLabel, testId, id: providedId, xcss, hasBorder, maxWidth, }: CommonSlotProps & {
|
|
11
12
|
/**
|
|
12
13
|
* The content of the layout area.
|
|
13
14
|
*/
|
|
@@ -25,6 +26,18 @@ export declare function Panel({ children, defaultWidth: defaultWidthProp, label,
|
|
|
25
26
|
* in which case `400px` will be used as the minimum resizing width instead.
|
|
26
27
|
*/
|
|
27
28
|
defaultWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Opt-in override for the maximum width the panel can be resized to, applied to both the rendered
|
|
31
|
+
* width and the resize bounds (mouse and keyboard).
|
|
32
|
+
*
|
|
33
|
+
* When omitted, the panel defaults to half the viewport width (after removing the sidebar width),
|
|
34
|
+
* which keeps it from growing larger than the page content. Provide a `vw` or `px` value (e.g.
|
|
35
|
+
* `'70vw'`) to allow a wider panel.
|
|
36
|
+
*
|
|
37
|
+
* This is currently used by Jira's Issue Navigator native issue preview panel; other consumers
|
|
38
|
+
* should leave it unset to keep the default cap.
|
|
39
|
+
*/
|
|
40
|
+
maxWidth?: ResizeBound;
|
|
28
41
|
/**
|
|
29
42
|
* Bounded style overrides.
|
|
30
43
|
*/
|
|
@@ -4,18 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { LogoProps } from '@atlaskit/logo';
|
|
7
|
-
|
|
8
|
-
* __App logo__
|
|
9
|
-
*
|
|
10
|
-
* The app logo for the top navigation.
|
|
11
|
-
*
|
|
12
|
-
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
13
|
-
*/
|
|
14
|
-
export declare const AppLogo: ({ name, label, href, icon, onClick, }: {
|
|
7
|
+
interface AppLogoProps {
|
|
15
8
|
/**
|
|
16
|
-
* The name of the app. Will be displayed next to the logo in wider viewports
|
|
9
|
+
* The name of the app. Will be displayed next to the logo in wider viewports.
|
|
17
10
|
*/
|
|
18
11
|
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Provide a secondaryName for the app. Will be displayed below the name in wider viewports.
|
|
14
|
+
*/
|
|
15
|
+
secondaryName?: string;
|
|
19
16
|
/**
|
|
20
17
|
* Provide an accessible label, often used by screen readers.
|
|
21
18
|
* This label should include the name of the app, and if applicable,
|
|
@@ -34,4 +31,13 @@ export declare const AppLogo: ({ name, label, href, icon, onClick, }: {
|
|
|
34
31
|
* Handler called on click.
|
|
35
32
|
*/
|
|
36
33
|
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
37
|
-
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* __App logo__
|
|
37
|
+
*
|
|
38
|
+
* The app logo for the top navigation.
|
|
39
|
+
*
|
|
40
|
+
* To provide a responsive experience, label text will render next to an icon at larger viewports.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AppLogo: ({ name, label, secondaryName, href, icon, onClick, }: AppLogoProps) => JSX.Element;
|
|
43
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/button": "^24.3.0",
|
|
60
60
|
"@atlaskit/css": "^1.0.0",
|
|
61
61
|
"@atlaskit/ds-lib": "^8.0.0",
|
|
62
|
-
"@atlaskit/icon": "^37.
|
|
62
|
+
"@atlaskit/icon": "^37.2.0",
|
|
63
63
|
"@atlaskit/layering": "^5.0.0",
|
|
64
64
|
"@atlaskit/logo": "^21.4.0",
|
|
65
65
|
"@atlaskit/motion": "^7.5.0",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"@atlaskit/platform-feature-flags-react": "^1.1.0",
|
|
68
68
|
"@atlaskit/popup": "^5.1.0",
|
|
69
69
|
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|
|
70
|
-
"@atlaskit/primitives": "^22.
|
|
70
|
+
"@atlaskit/primitives": "^22.2.0",
|
|
71
71
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
72
72
|
"@atlaskit/side-nav-items": "^2.3.0",
|
|
73
|
-
"@atlaskit/tokens": "^16.
|
|
73
|
+
"@atlaskit/tokens": "^16.3.0",
|
|
74
74
|
"@atlaskit/tooltip": "^23.1.0",
|
|
75
75
|
"@atlaskit/visually-hidden": "^4.2.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@atlaskit/top-layer": "^1.10.0",
|
|
112
112
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
113
113
|
"@atlassian/gemini": "^1.51.0",
|
|
114
|
-
"@atlassian/search-dialog": "^10.
|
|
114
|
+
"@atlassian/search-dialog": "^10.6.0",
|
|
115
115
|
"@atlassian/ssr-tests": "workspace:^",
|
|
116
116
|
"@atlassian/test-utils": "^1.1.0",
|
|
117
117
|
"@atlassian/testing-library": "^0.11.0",
|