@atlaskit/navigation-system 11.4.2 → 11.5.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 (78) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/constellation/layout/code.mdx +28 -0
  3. package/dist/cjs/ui/page-layout/panel-splitter/get-panel-growth-side.js +19 -0
  4. package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.compiled.css +2 -0
  5. package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +25 -7
  6. package/dist/cjs/ui/page-layout/top-nav/top-nav-element-context.js +9 -0
  7. package/dist/cjs/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
  8. package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +52 -15
  9. package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
  10. package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.js +4 -2
  11. package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
  12. package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +6 -2
  13. package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
  14. package/dist/cjs/ui/page-layout/top-nav/top-nav.js +75 -7
  15. package/dist/cjs/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +75 -0
  16. package/dist/cjs/ui/page-layout/top-nav/use-top-nav-breakpoints.js +19 -0
  17. package/dist/cjs/ui/page-layout/top-nav/use-top-nav-end-focus.js +102 -0
  18. package/dist/cjs/ui/top-nav-items/custom-title.compiled.css +2 -1
  19. package/dist/cjs/ui/top-nav-items/custom-title.js +6 -3
  20. package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
  21. package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +4 -2
  22. package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
  23. package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
  24. package/dist/cjs/ui/top-nav-items/search.compiled.css +34 -2
  25. package/dist/cjs/ui/top-nav-items/search.js +106 -11
  26. package/dist/es2019/ui/page-layout/panel-splitter/get-panel-growth-side.js +14 -0
  27. package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.compiled.css +2 -0
  28. package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +22 -6
  29. package/dist/es2019/ui/page-layout/top-nav/top-nav-element-context.js +3 -0
  30. package/dist/es2019/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
  31. package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +53 -14
  32. package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
  33. package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.js +4 -2
  34. package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
  35. package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +6 -2
  36. package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
  37. package/dist/es2019/ui/page-layout/top-nav/top-nav.js +54 -8
  38. package/dist/es2019/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +48 -0
  39. package/dist/es2019/ui/page-layout/top-nav/use-top-nav-breakpoints.js +14 -0
  40. package/dist/es2019/ui/page-layout/top-nav/use-top-nav-end-focus.js +97 -0
  41. package/dist/es2019/ui/top-nav-items/custom-title.compiled.css +2 -1
  42. package/dist/es2019/ui/top-nav-items/custom-title.js +6 -3
  43. package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
  44. package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +4 -2
  45. package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
  46. package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
  47. package/dist/es2019/ui/top-nav-items/search.compiled.css +34 -2
  48. package/dist/es2019/ui/top-nav-items/search.js +105 -10
  49. package/dist/esm/ui/page-layout/panel-splitter/get-panel-growth-side.js +13 -0
  50. package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.compiled.css +2 -0
  51. package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +25 -7
  52. package/dist/esm/ui/page-layout/top-nav/top-nav-element-context.js +3 -0
  53. package/dist/esm/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
  54. package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +53 -15
  55. package/dist/esm/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
  56. package/dist/esm/ui/page-layout/top-nav/top-nav-middle.js +4 -2
  57. package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
  58. package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +6 -2
  59. package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
  60. package/dist/esm/ui/page-layout/top-nav/top-nav.js +75 -8
  61. package/dist/esm/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +68 -0
  62. package/dist/esm/ui/page-layout/top-nav/use-top-nav-breakpoints.js +14 -0
  63. package/dist/esm/ui/page-layout/top-nav/use-top-nav-end-focus.js +96 -0
  64. package/dist/esm/ui/top-nav-items/custom-title.compiled.css +2 -1
  65. package/dist/esm/ui/top-nav-items/custom-title.js +6 -3
  66. package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
  67. package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +4 -2
  68. package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
  69. package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
  70. package/dist/esm/ui/top-nav-items/search.compiled.css +34 -2
  71. package/dist/esm/ui/top-nav-items/search.js +107 -11
  72. package/dist/types/ui/page-layout/panel-splitter/get-panel-growth-side.d.ts +10 -0
  73. package/dist/types/ui/page-layout/top-nav/top-nav-element-context.d.ts +5 -0
  74. package/dist/types/ui/page-layout/top-nav/top-nav-end.d.ts +1 -0
  75. package/dist/types/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.d.ts +2 -0
  76. package/dist/types/ui/page-layout/top-nav/use-top-nav-breakpoints.d.ts +10 -0
  77. package/dist/types/ui/page-layout/top-nav/use-top-nav-end-focus.d.ts +12 -0
  78. package/package.json +10 -10
@@ -0,0 +1,96 @@
1
+ import { useCallback, useEffect, useRef } from 'react';
2
+ import { bindAll } from 'bind-event-listener';
3
+ import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
4
+ function getActions(list) {
5
+ var _list$querySelectorAl;
6
+ return Array.from((_list$querySelectorAl = list === null || list === void 0 ? void 0 : list.querySelectorAll('button, a[href], input, select, textarea, [tabindex]')) !== null && _list$querySelectorAl !== void 0 ? _list$querySelectorAl : []).filter(function (element) {
7
+ // In-place and top-layer popups can be DOM descendants of the list.
8
+ // Their controls must not replace the index of the action that opened them.
9
+ var layer = element.closest('[popover], [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]');
10
+ return element.tabIndex >= 0 && !element.matches(':disabled') && element.getClientRects().length > 0 && !(layer && list !== null && list !== void 0 && list.contains(layer));
11
+ });
12
+ }
13
+
14
+ /**
15
+ * Keeps keyboard position when the regular actions move into or out of overflow.
16
+ */
17
+ export function useTopNavEndFocus(_ref) {
18
+ var isMobile = _ref.isMobile,
19
+ enabled = _ref.enabled;
20
+ var actionsRef = useRef(null);
21
+ var triggerRef = useRef(null);
22
+ var focusedElement = useRef(null);
23
+ var actionIndex = useRef(0);
24
+ var previousIsMobile = useRef(isMobile);
25
+
26
+ // React capture follows owned portals as well as DOM descendants. The scope
27
+ // includes the overflow popup's focusable shell, but excludes persistent items.
28
+ var onFocusCapture = useCallback(function (event) {
29
+ var target = event.target;
30
+ focusedElement.current = target;
31
+ var index = getActions(actionsRef.current).indexOf(target);
32
+ if (index >= 0) {
33
+ actionIndex.current = index;
34
+ }
35
+ }, []);
36
+ useLayoutEffect(function () {
37
+ if (!enabled) {
38
+ return;
39
+ }
40
+ return bindAll(document, [{
41
+ type: 'focusin',
42
+ listener: function listener(event) {
43
+ // Owned React focus has already been recorded in capture, including
44
+ // portaled layers. Everything else cancels the pending handoff.
45
+ if (event.target !== focusedElement.current) {
46
+ focusedElement.current = null;
47
+ }
48
+ }
49
+ }, {
50
+ type: 'focusout',
51
+ listener: function listener(event) {
52
+ if (!(event instanceof FocusEvent)) {
53
+ return;
54
+ }
55
+ var element = focusedElement.current;
56
+ if (event.target !== element) {
57
+ return;
58
+ }
59
+ if (event.relatedTarget) {
60
+ focusedElement.current = null;
61
+ return;
62
+ }
63
+ // A popup can blur its trigger during unmount, before removing its DOM.
64
+ // Wait until that commit completes to distinguish removal from explicit blur.
65
+ queueMicrotask(function () {
66
+ if (focusedElement.current === element && element !== null && element !== void 0 && element.isConnected && element.getClientRects().length) {
67
+ focusedElement.current = null;
68
+ }
69
+ });
70
+ }
71
+ }]);
72
+ }, [enabled]);
73
+
74
+ // Restore after the removed popup has released its focus trap in passive cleanup.
75
+ useEffect(function () {
76
+ var _actions$actionIndex$;
77
+ var changed = previousIsMobile.current !== isMobile;
78
+ previousIsMobile.current = isMobile;
79
+ if (!enabled || !changed) {
80
+ return;
81
+ }
82
+ var previous = focusedElement.current;
83
+ focusedElement.current = null;
84
+ if (!previous || document.activeElement !== document.body && document.activeElement !== previous) {
85
+ return;
86
+ }
87
+ var actions = getActions(actionsRef.current);
88
+ var replacement = isMobile ? triggerRef.current : (_actions$actionIndex$ = actions[actionIndex.current]) !== null && _actions$actionIndex$ !== void 0 ? _actions$actionIndex$ : actions[0];
89
+ replacement === null || replacement === void 0 || replacement.focus();
90
+ }, [enabled, isMobile]);
91
+ return {
92
+ actionsRef: actionsRef,
93
+ triggerRef: triggerRef,
94
+ onFocusCapture: onFocusCapture
95
+ };
96
+ }
@@ -1,6 +1,7 @@
1
1
  ._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
2
  ._18m915vq{overflow-y:hidden}
3
3
  ._1bto1l2s{text-overflow:ellipsis}
4
+ ._1e0c1u4u{display:var(--n_tnLogoDisplay,none)}
4
5
  ._1e0cglyw{display:none}
5
6
  ._1reo15vq{overflow-x:hidden}
6
7
  ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
@@ -8,4 +9,4 @@
8
9
  ._p12fuuw1{max-width:200px}
9
10
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
10
11
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
11
- @media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
12
+ @media (min-width:64rem){._10y41txw._10y41txw{display:flex}._dm251vcx{display:var(--n_tnLogoDisplay,flex)}}
@@ -3,10 +3,13 @@ import "./custom-title.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import { useHasCustomTheme } from './themed/has-custom-theme-context';
7
8
  var styles = {
8
- root: "_1reo15vq _18m915vq _11c8fhey _o5721q9c _p12fuuw1 _1bto1l2s _bozg1b66 _y4tiu2gc _1e0cglyw _10y41txw",
9
- subtleText: "_syazazsu"
9
+ root: "_1reo15vq _18m915vq _11c8fhey _o5721q9c _p12fuuw1 _1bto1l2s _bozg1b66 _y4tiu2gc _1e0cglyw",
10
+ subtleText: "_syazazsu",
11
+ container: "_1e0c1u4u _dm251vcx",
12
+ viewport: "_10y41txw"
10
13
  };
11
14
  /**
12
15
  * __Custom title__
@@ -21,6 +24,6 @@ export var CustomTitle = /*#__PURE__*/forwardRef(function CustomTitle(_ref, ref)
21
24
  return /*#__PURE__*/React.createElement("div", {
22
25
  ref: ref,
23
26
  "data-testid": testId,
24
- className: ax([styles.root, !hasCustomTheme && styles.subtleText])
27
+ className: ax([styles.root, fg('platform-dst-chat-panel-layout') ? styles.container : styles.viewport, !hasCustomTheme && styles.subtleText])
25
28
  }, children);
26
29
  });
@@ -3,6 +3,7 @@
3
3
  ._1bah1h6o{justify-content:center}
4
4
  ._1bsb1ris{width:max-content}
5
5
  ._1e0c1txw{display:flex}
6
+ ._1e0c1u4u{display:var(--n_tnLogoDisplay,none)}
6
7
  ._1e0cglyw{display:none}
7
8
  ._1o9zidpf{flex-shrink:0}
8
9
  ._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
@@ -24,4 +25,4 @@
24
25
  ._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
25
26
  ._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
26
27
  ._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
27
- @media (min-width:64rem){._10y41txw._10y41txw{display:flex}}
28
+ @media (min-width:64rem){._10y41txw._10y41txw{display:flex}._dm251vcx{display:var(--n_tnLogoDisplay,flex)}}
@@ -22,7 +22,9 @@ var iconContainerStyles = {
22
22
  root: "_1reo15vq _18m915vq _1e0c1txw _p12f1tcg _c71l1tcg"
23
23
  };
24
24
  var logoTextStyles = {
25
- root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
25
+ root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o",
26
+ container: "_1e0c1u4u _dm251vcx",
27
+ viewport: "_10y41txw"
26
28
  };
27
29
  var secondaryNameStyles = {
28
30
  root: "_1pfh1i6y"
@@ -76,7 +78,7 @@ export var AppLogo = function AppLogo(_ref) {
76
78
  }, /*#__PURE__*/React.createElement(LogoRenderer, {
77
79
  logoOrIcon: icon
78
80
  })), /*#__PURE__*/React.createElement("span", {
79
- className: ax([logoTextStyles.root])
81
+ className: ax([logoTextStyles.root, fg('platform-dst-chat-panel-layout') ? logoTextStyles.container : logoTextStyles.viewport])
80
82
  }, /*#__PURE__*/React.createElement(Tooltip, {
81
83
  content: name,
82
84
  position: "bottom",
@@ -2,7 +2,9 @@
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
4
  ._1e0c1txw{display:flex}
5
+ ._1e0c1u4u{display:var(--n_tnLogoDisplay,none)}
5
6
  ._1e0cglyw{display:none}
7
+ ._1e0coqrb{display:var(--n_tnIconDisplay,flex)}
6
8
  ._1jpx1f51 img{object-fit:contain}
7
9
  ._1reo15vq{overflow-x:hidden}
8
10
  ._4cvr1h6o{align-items:center}
@@ -17,4 +19,4 @@
17
19
  ._irr31rps:hover{background-color:var(--ds-top-bar-button-background-hovered)}
18
20
  ._1di69yc7:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)!important}
19
21
  ._1di6yhlj:active{background-color:var(--ds-top-bar-button-background-pressed)!important}
20
- @media (min-width:64rem){._10y41txw._10y41txw{display:flex}._10y4glyw._10y4glyw{display:none}}
22
+ @media (min-width:64rem){._10y41txw._10y41txw{display:flex}._10y4glyw._10y4glyw{display:none}._dm2517mw{display:var(--n_tnIconDisplay,none)}._dm251vcx{display:var(--n_tnLogoDisplay,flex)}}
@@ -3,6 +3,7 @@ import "./custom-logo.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useEffect, useRef } from 'react';
5
5
  import { cx } from '@compiled/react';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import { Anchor } from '@atlaskit/primitives/compiled/anchor';
7
8
  import { useHasCustomTheme } from '../themed/has-custom-theme-context';
8
9
  import { LogoRenderer } from './logo-renderer';
@@ -17,10 +18,14 @@ var sharedIconOrLogoContainerStyles = {
17
18
  root: "_1reo15vq _18m915vq _18zr1b66 _bna71tcg _rtys1kw7 _1jpx1f51"
18
19
  };
19
20
  var iconContainerStyles = {
20
- root: "_1e0c1txw _p12f1tcg _vchh1ntv _10y4glyw"
21
+ root: "_1e0c1txw _p12f1tcg _vchh1ntv",
22
+ container: "_1e0coqrb _dm2517mw",
23
+ viewport: "_10y4glyw"
21
24
  };
22
25
  var logoContainerStyles = {
23
- root: "_1e0cglyw _p12fnklw _vchh1ntv _10y41txw"
26
+ root: "_1e0cglyw _p12fnklw _vchh1ntv",
27
+ container: "_1e0c1u4u _dm251vcx",
28
+ viewport: "_10y41txw"
24
29
  };
25
30
 
26
31
  /**
@@ -79,11 +84,11 @@ export var CustomLogo = function CustomLogo(_ref) {
79
84
  xcss: cx(anchorStyles.root, anchorStyles.customLogoBorderRadius, anchorStyles.newMargin, hasCustomTheme ? anchorStyles.newInteractionStatesCustomTheming : anchorStyles.newInteractionStates),
80
85
  onClick: onClick
81
86
  }, /*#__PURE__*/React.createElement("div", {
82
- className: ax([sharedIconOrLogoContainerStyles.root, iconContainerStyles.root])
87
+ className: ax([sharedIconOrLogoContainerStyles.root, iconContainerStyles.root, fg('platform-dst-chat-panel-layout') ? iconContainerStyles.container : iconContainerStyles.viewport])
83
88
  }, /*#__PURE__*/React.createElement(LogoRenderer, {
84
89
  logoOrIcon: icon
85
90
  })), /*#__PURE__*/React.createElement("div", {
86
- className: ax([sharedIconOrLogoContainerStyles.root, logoContainerStyles.root])
91
+ className: ax([sharedIconOrLogoContainerStyles.root, logoContainerStyles.root, fg('platform-dst-chat-panel-layout') ? logoContainerStyles.container : logoContainerStyles.viewport])
87
92
  }, /*#__PURE__*/React.createElement(LogoRenderer, {
88
93
  logoOrIcon: logo
89
94
  })));
@@ -1,21 +1,53 @@
1
1
  ._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
2
- ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._18zr12x7{padding-inline:var(--ds-space-075,6px)}
2
+ ._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._189ee4h9{border-width:var(--ds-border-width,1px)}
3
+ ._18zr12x7{padding-inline:var(--ds-space-075,6px)}
4
+ ._18zrze3t{padding-inline:var(--ds-space-0,0)}
5
+ ._1dqonqa1{border-style:solid}
6
+ ._1h6d12f6{border-color:var(--ds-border-input-search,#0b120e24)}
7
+ ._1h6drsbi{border-color:var(--ds-border-input,#8c8f97)}
3
8
  ._1ii7kb7n{grid-row:1}
4
9
  ._1rjcze3t{padding-block:var(--ds-space-0,0)}
5
10
  ._yyhy11wp{grid-column:3}
11
+ ._yyhycs5v{grid-column:2}
6
12
  ._yyhyjvu9{grid-column:1/-1}
7
13
  ._yyhykb7n{grid-column:1}
14
+ ._18m915vq{overflow-y:hidden}
15
+ ._1bah1h6o{justify-content:center}
8
16
  ._1bsb1osq{width:100%}
17
+ ._1bsb5ymi{width:var(--n_tnSearchWidth,2pc)}
18
+ ._1bsbzwfg{width:2pc}
19
+ ._1bto1l2s{text-overflow:ellipsis}
9
20
  ._1e0c1txw{display:flex}
21
+ ._1e0c9sqe{display:var(--n_tnSearchDisplay,none)}
22
+ ._1e0cfswt{display:var(--n_tnSearchIconDisplay,flex)}
10
23
  ._1e0cglyw{display:none}
24
+ ._1reo15vq{overflow-x:hidden}
25
+ ._1ul9idpf{min-width:0}
11
26
  ._4cvr1h6o{align-items:center}
12
27
  ._4t3izwfg{height:2pc}
13
28
  ._80om1kdv{cursor:text}
29
+ ._b4h01j9a{--n_tnSearchFieldBackground:var(--ds-background-input,#fff)}
30
+ ._bfhk11rw{background-color:var(--n_tnSearchFieldBackground)}
31
+ ._bfhk1j28{background-color:transparent}
14
32
  ._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
33
+ ._bfhksikg{background-color:var(--n_tnSearchIconBackground)}
34
+ ._j1r711j1{--n_tnSearchIconBackground:var(--ds-top-bar-button-background,var(--ds-background-neutral-subtle,#00000000))}
35
+ ._o5721q9c{white-space:nowrap}
15
36
  ._p12f1kvu{max-width:680px}
37
+ ._syaz1kw7{color:inherit}
38
+ ._syaz1q3r{color:var(--ds-icon,#292a2e)}
16
39
  ._vchhusvi{box-sizing:border-box}
40
+ ._yv0e14iv{grid-template-columns:auto minmax(0,1fr) auto}
17
41
  ._yv0e1mfv{grid-template-columns:auto 1fr auto}
42
+ ._3vbcl4ek:hover{--n_tnSearchFieldBackground:var(--ds-background-input-hovered,#f8f8f8)}
43
+ ._irr311rw:hover{background-color:var(--n_tnSearchFieldBackground)}
18
44
  ._irr3l4ek:hover{background-color:var(--ds-background-input-hovered,#f8f8f8)}
45
+ ._irr3sikg:hover{background-color:var(--n_tnSearchIconBackground)}
46
+ ._ml493uto:hover{--n_tnSearchIconBackground:var(--ds-top-bar-button-background-hovered,var(--ds-background-neutral-subtle-hovered,#0515240f))}
19
47
  ._1ggl5xtf:active{transition:var(--ds-button-pressed,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
48
+ ._1di611rw:active{background-color:var(--n_tnSearchFieldBackground)}
20
49
  ._1di6r01l:active{background-color:var(--ds-background-input-pressed,#fff)}
21
- @media (min-width:30rem){._114b11p5{display:grid}}
50
+ ._1di6sikg:active{background-color:var(--n_tnSearchIconBackground)}
51
+ ._1glhr01l:active{--n_tnSearchFieldBackground:var(--ds-background-input-pressed,#fff)}
52
+ ._9gm9sn0f:active{--n_tnSearchIconBackground:var(--ds-top-bar-button-background-pressed,var(--ds-background-neutral-subtle-pressed,#0b120e24))}
53
+ @media (min-width:30rem){._114b11p5{display:grid}._114b17i4{display:var(--n_tnSearchIconDisplay,none)}._114b1mwp{display:var(--n_tnSearchDisplay,grid)}._g711exps{width:var(--n_tnSearchWidth,100%)}}
@@ -2,31 +2,111 @@
2
2
  import "./search.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { Fragment } from 'react';
5
+
6
+ // Container widths and custom-theme colors need the unbounded Compiled style types.
7
+ import { cx } from '@compiled/react';
5
8
  import SearchIcon from '@atlaskit/icon/core/search';
6
9
  import { fg } from '@atlaskit/platform-feature-flags/fg';
7
10
  import { Pressable } from '@atlaskit/primitives/compiled/pressable';
8
11
  import { Show } from '@atlaskit/primitives/compiled/show';
9
12
  import { Text } from '@atlaskit/primitives/compiled/text';
13
+ import Tooltip from '@atlaskit/tooltip/Tooltip';
14
+ import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
15
+ import { useHasCustomTheme } from './themed/has-custom-theme-context';
10
16
  import { IconButton } from './themed/icon-button';
11
17
  var styles = {
12
- root: "_2rko1qi0 _v564k6bl _1rjcze3t _18zr12x7 _yv0e1mfv _4cvr1h6o _bfhk1j9a _vchhusvi _80om1kdv _1e0cglyw _4t3izwfg _p12f1kvu _1bsb1osq _irr3l4ek _1ggl5xtf _1di6r01l _114b11p5",
18
+ root: "_2rko1qi0 _v564k6bl _1rjcze3t _18zr12x7 _yv0e1mfv _4cvr1h6o _bfhk1j9a _vchhusvi _80om1kdv _4t3izwfg _p12f1kvu _1bsb1osq _irr3l4ek _1ggl5xtf _1di6r01l",
19
+ viewport: "_1e0cglyw _114b11p5",
20
+ containerBorder: "_189ee4h9 _1dqonqa1 _1h6drsbi",
21
+ containerBorderFinesse: "_1h6d12f6",
22
+ containerText: "_1reo15vq _18m915vq _yyhycs5v _1ul9idpf _1bto1l2s _o5721q9c",
13
23
  buttonText: "_yyhyjvu9 _1ii7kb7n",
14
24
  iconBefore: "_yyhykb7n _1ii7kb7n _1e0c1txw",
15
25
  elemAfter: "_yyhy11wp _1ii7kb7n _1e0c1txw"
16
26
  };
27
+ var containerStyles = {
28
+ container: "_bfhk11rw _1e0c9sqe _yv0e14iv _1ul9idpf _irr311rw _1di611rw _114b1mwp",
29
+ containerButton: "_2rko1qi0 _1rjcze3t _18zrze3t _1e0c1txw _bfhk1j28 _4t3izwfg _p12f1kvu _1ul9idpf _1bsb5ymi _syaz1kw7 _b4h01j9a _j1r711j1 _3vbcl4ek _ml493uto _1glhr01l _9gm9sn0f _g711exps",
30
+ containerIcon: "_2rko1qi0 _v564k6bl _1e0cfswt _4cvr1h6o _1bah1h6o _1bsbzwfg _4t3izwfg _syaz1q3r _bfhksikg _irr3sikg _1ggl5xtf _1di6sikg _114b17i4",
31
+ customThemeIcon: "_syaz1kw7"
32
+ };
17
33
  /**
18
- * __Search__
19
- *
20
- * The search element for the top navigation.
34
+ * Keep a single focus target through CSS presentation changes, including before hydration.
35
+ * Only the visual contents switch; no measurement or focus handoff is needed.
21
36
  */
22
- export var Search = function Search(_ref) {
37
+ function ContainerSearch(_ref) {
23
38
  var label = _ref.label,
24
- onClick = _ref.onClick,
39
+ _onClick = _ref.onClick,
25
40
  _ref$iconBefore = _ref.iconBefore,
26
41
  IconBefore = _ref$iconBefore === void 0 ? SearchIcon : _ref$iconBefore,
27
42
  elemAfter = _ref.elemAfter,
28
43
  interactionName = _ref.interactionName,
29
44
  ariaHaspopup = _ref['aria-haspopup'];
45
+ var hasCustomTheme = useHasCustomTheme();
46
+ var renderButton = function renderButton(triggerProps) {
47
+ return /*#__PURE__*/React.createElement(Pressable, {
48
+ ref: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.ref,
49
+ onFocus: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onFocus,
50
+ onBlur: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onBlur,
51
+ onMouseOver: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onMouseOver,
52
+ onMouseOut: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onMouseOut,
53
+ onMouseMove: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onMouseMove,
54
+ onMouseDown: triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onMouseDown,
55
+ onClick: function onClick(event) {
56
+ var _triggerProps$onClick;
57
+ _onClick === null || _onClick === void 0 || _onClick(event);
58
+ triggerProps === null || triggerProps === void 0 || (_triggerProps$onClick = triggerProps.onClick) === null || _triggerProps$onClick === void 0 || _triggerProps$onClick.call(triggerProps, event);
59
+ }
60
+ // @ts-expect-error -- The responsive width uses an inherited CSS variable outside bounded xcss values.
61
+ // Styles are co-located above; only the Pressable xcss type is imported.
62
+ // eslint-disable-next-line @compiled/no-suppress-xcss
63
+ ,
64
+ xcss: cx(containerStyles.containerButton),
65
+ interactionName: interactionName,
66
+ "aria-haspopup": ariaHaspopup
67
+ }, /*#__PURE__*/React.createElement("span", {
68
+ className: ax([styles.root, containerStyles.container, styles.containerBorder, fg('platform-dst-tokens-finesse') && styles.containerBorderFinesse])
69
+ }, /*#__PURE__*/React.createElement("span", {
70
+ className: ax([styles.iconBefore])
71
+ }, /*#__PURE__*/React.createElement(IconBefore, {
72
+ color: "var(--ds-icon-subtle, #505258)",
73
+ spacing: "spacious",
74
+ label: ""
75
+ })), /*#__PURE__*/React.createElement("span", {
76
+ className: ax([styles.buttonText, styles.containerText])
77
+ }, /*#__PURE__*/React.createElement(Text, {
78
+ color: "color.text.subtlest"
79
+ }, label)), elemAfter && /*#__PURE__*/React.createElement("span", {
80
+ className: ax([styles.elemAfter])
81
+ }, elemAfter)), /*#__PURE__*/React.createElement("span", {
82
+ className: ax([containerStyles.containerIcon, hasCustomTheme && containerStyles.customThemeIcon])
83
+ }, /*#__PURE__*/React.createElement(SearchIcon, {
84
+ color: "currentColor",
85
+ label: ""
86
+ }), /*#__PURE__*/React.createElement(VisuallyHidden, null, label)));
87
+ };
88
+ // Preserve the custom-theme label tooltip on the stable trigger.
89
+ // As with IconButton, omit aria-describedby to avoid announcing the label twice.
90
+ return hasCustomTheme ? /*#__PURE__*/React.createElement(Tooltip, {
91
+ content: label
92
+ }, renderButton) : renderButton();
93
+ }
94
+ var ViewportSearch = function ViewportSearch(_ref2) {
95
+ var label = _ref2.label,
96
+ onClick = _ref2.onClick,
97
+ _ref2$iconBefore = _ref2.iconBefore,
98
+ IconBefore = _ref2$iconBefore === void 0 ? SearchIcon : _ref2$iconBefore,
99
+ elemAfter = _ref2.elemAfter,
100
+ interactionName = _ref2.interactionName,
101
+ ariaHaspopup = _ref2['aria-haspopup'];
102
+ var iconButton = /*#__PURE__*/React.createElement(IconButton, {
103
+ label: label,
104
+ appearance: "subtle",
105
+ icon: SearchIcon,
106
+ onClick: onClick,
107
+ interactionName: interactionName,
108
+ "aria-haspopup": ariaHaspopup
109
+ });
30
110
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Pressable, {
31
111
  style: {
32
112
  // To win the specificity war against Emotion we move this into inline styles
@@ -36,7 +116,7 @@ export var Search = function Search(_ref) {
36
116
  border: "var(--ds-border-width, 1px)".concat(" solid ", fg('platform-dst-tokens-finesse') ? "var(--ds-border-input-search, #0B120E24)" : "var(--ds-border-input, #8C8F97)")
37
117
  },
38
118
  onClick: onClick,
39
- xcss: styles.root,
119
+ xcss: cx(styles.root, styles.viewport),
40
120
  interactionName: interactionName,
41
121
  "aria-haspopup": ariaHaspopup
42
122
  }, /*#__PURE__*/React.createElement("span", {
@@ -53,12 +133,28 @@ export var Search = function Search(_ref) {
53
133
  className: ax([styles.elemAfter])
54
134
  }, elemAfter)), /*#__PURE__*/React.createElement(Show, {
55
135
  below: "xs"
56
- }, /*#__PURE__*/React.createElement(IconButton, {
136
+ }, iconButton));
137
+ };
138
+
139
+ /**
140
+ * __Search__
141
+ *
142
+ * The search element for the top navigation.
143
+ */
144
+ export var Search = function Search(_ref3) {
145
+ var label = _ref3.label,
146
+ onClick = _ref3.onClick,
147
+ iconBefore = _ref3.iconBefore,
148
+ elemAfter = _ref3.elemAfter,
149
+ interactionName = _ref3.interactionName,
150
+ ariaHaspopup = _ref3['aria-haspopup'];
151
+ var Component = fg('platform-dst-chat-panel-layout') ? ContainerSearch : ViewportSearch;
152
+ return /*#__PURE__*/React.createElement(Component, {
57
153
  label: label,
58
- appearance: "subtle",
59
- icon: SearchIcon,
60
154
  onClick: onClick,
155
+ iconBefore: iconBefore,
156
+ elemAfter: elemAfter,
61
157
  interactionName: interactionName,
62
158
  "aria-haspopup": ariaHaspopup
63
- })));
159
+ });
64
160
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Returns the physical side the panel grows towards when the splitter is dragged away from it.
3
+ *
4
+ * `position: 'end'` grows towards the inline-end, which is the right in left-to-right languages, and
5
+ * `position: 'start'` grows towards the inline-start.
6
+ */
7
+ export declare function getPanelGrowthSide({ position, textDirection, }: {
8
+ position: 'start' | 'end';
9
+ textDirection: 'ltr' | 'rtl';
10
+ }): 'left' | 'right';
@@ -0,0 +1,5 @@
1
+ import { type Context } from 'react';
2
+ export type TopNavBreakpoints = {
3
+ belowSm: boolean;
4
+ };
5
+ export declare const TopNavElementContext: Context<TopNavBreakpoints | null>;
@@ -21,6 +21,7 @@ export declare function TopNavEnd({ children, persistentItems, label, showMoreBu
21
21
  /**
22
22
  * Actions at the inline end, after the other actions or their overflow button,
23
23
  * that stay in the top nav at every viewport size outside the overflow popup.
24
+ * Separated from the other actions by 8px; spacing within those actions remains 4px.
24
25
  * Items stay mounted when the viewport changes. Consumers must ensure
25
26
  * that this content fits on small screens. Supply complete accessible groups
26
27
  * (lists containing list items), and hide each group at its outermost element
@@ -0,0 +1,2 @@
1
+ import type { TopNavBreakpoints } from './top-nav-element-context';
2
+ export declare function useMeasuredTopNavBreakpoints(topNav: HTMLElement | null, remProbe: HTMLElement | null): TopNavBreakpoints;
@@ -0,0 +1,10 @@
1
+ import { type TopNavBreakpoints } from './top-nav-element-context';
2
+ /**
3
+ * Private breakpoint state for React rendering (overflow and responsive buttons).
4
+ * Presentation is handled by TopNav container queries, independently of this hook.
5
+ * Returns null outside TopNav or when platform-dst-chat-panel-layout is disabled.
6
+ * SSR and initial hydration use the expanded presentation. Measurements are published
7
+ * in a transition so suspended navigation can finish hydrating without losing its
8
+ * server DOM. All consumers share one observer on TopNav.
9
+ */
10
+ export declare function useTopNavBreakpoints(): TopNavBreakpoints | null;
@@ -0,0 +1,12 @@
1
+ import { type FocusEventHandler, type RefObject } from 'react';
2
+ /**
3
+ * Keeps keyboard position when the regular actions move into or out of overflow.
4
+ */
5
+ export declare function useTopNavEndFocus({ isMobile, enabled }: {
6
+ isMobile: boolean;
7
+ enabled: boolean;
8
+ }): {
9
+ actionsRef: RefObject<HTMLDivElement>;
10
+ triggerRef: RefObject<HTMLButtonElement>;
11
+ onFocusCapture: FocusEventHandler<HTMLDivElement>;
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "11.4.2",
3
+ "version": "11.5.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",
@@ -58,25 +58,25 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@atlaskit/analytics-next": "^12.6.0",
61
- "@atlaskit/app-provider": "^8.2.0",
61
+ "@atlaskit/app-provider": "^8.3.0",
62
62
  "@atlaskit/avatar": "^30.0.0",
63
- "@atlaskit/button": "^25.6.0",
63
+ "@atlaskit/button": "^25.7.0",
64
64
  "@atlaskit/css": "^1.1.0",
65
65
  "@atlaskit/ds-lib": "^8.0.0",
66
66
  "@atlaskit/icon": "^38.0.0",
67
67
  "@atlaskit/layering": "^6.1.0",
68
68
  "@atlaskit/logo": "^23.3.0",
69
- "@atlaskit/motion": "^9.5.0",
69
+ "@atlaskit/motion": "^9.6.0",
70
70
  "@atlaskit/platform-feature-flags": "^2.2.0",
71
71
  "@atlaskit/platform-feature-flags-react": "^1.2.0",
72
- "@atlaskit/popup": "^10.1.0",
72
+ "@atlaskit/popup": "^10.2.0",
73
73
  "@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
74
74
  "@atlaskit/primitives": "^22.6.0",
75
75
  "@atlaskit/react-compiler-gating": "^0.2.0",
76
76
  "@atlaskit/side-nav-items": "^2.6.0",
77
- "@atlaskit/tokens": "^20.8.0",
77
+ "@atlaskit/tokens": "^20.9.0",
78
78
  "@atlaskit/tooltip": "^24.4.0",
79
- "@atlaskit/top-layer": "^7.0.0",
79
+ "@atlaskit/top-layer": "^7.1.0",
80
80
  "@atlaskit/visually-hidden": "^4.4.0",
81
81
  "@babel/runtime": "^7.0.0",
82
82
  "@compiled/react": "^1.0.2",
@@ -107,7 +107,7 @@
107
107
  "@atlaskit/link": "^5.1.0",
108
108
  "@atlaskit/lozenge": "^17.0.0",
109
109
  "@atlaskit/menu": "^11.0.0",
110
- "@atlaskit/modal-dialog": "^17.1.0",
110
+ "@atlaskit/modal-dialog": "^17.2.0",
111
111
  "@atlaskit/onboarding": "^15.4.0",
112
112
  "@atlaskit/page-header": "^13.3.0",
113
113
  "@atlaskit/page-layout": "^5.5.0",
@@ -122,14 +122,14 @@
122
122
  "@atlaskit/spotlight": "^4.2.0",
123
123
  "@atlaskit/tabs": "^21.3.0",
124
124
  "@atlaskit/tag": "^17.0.0",
125
- "@atlaskit/textarea": "^10.2.0",
125
+ "@atlaskit/textarea": "^10.3.0",
126
126
  "@atlaskit/textfield": "^10.3.0",
127
127
  "@atlassian/feature-flags-test-utils": "^1.3.0",
128
128
  "@atlassian/gemini": "^1.54.0",
129
129
  "@atlassian/panel-system": "^2.0.0",
130
130
  "@atlassian/react-async": "^0.23.0",
131
131
  "@atlassian/react-entrypoint": "^1.1.0",
132
- "@atlassian/search-dialog": "^10.27.0",
132
+ "@atlassian/search-dialog": "^10.30.0",
133
133
  "@atlassian/ssr-tests": "workspace:^",
134
134
  "@atlassian/test-utils": "^1.1.0",
135
135
  "@atlassian/testing-library": "^0.12.0",