@atlaskit/navigation-system 9.0.0 → 9.1.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 +21 -0
- package/dist/cjs/components/skip-links/skip-link.js +0 -1
- package/dist/cjs/components/skip-links/skip-links-container.compiled.css +2 -7
- package/dist/cjs/components/skip-links/skip-links-container.js +17 -14
- package/dist/cjs/components/skip-links/skip-links-popup.compiled.css +22 -0
- package/dist/cjs/components/skip-links/skip-links-popup.js +124 -0
- package/dist/cjs/context/skip-links/skip-links-provider.js +2 -0
- package/dist/cjs/ui/page-layout/root.js +6 -3
- package/dist/cjs/ui/top-nav-items/themed/themed-button.js +1 -5
- package/dist/cjs/ui/top-nav-items/themed/themed-icon-button.js +1 -5
- package/dist/es2019/components/skip-links/skip-link.js +0 -1
- package/dist/es2019/components/skip-links/skip-links-container.compiled.css +2 -7
- package/dist/es2019/components/skip-links/skip-links-container.js +17 -14
- package/dist/es2019/components/skip-links/skip-links-popup.compiled.css +22 -0
- package/dist/es2019/components/skip-links/skip-links-popup.js +107 -0
- package/dist/es2019/context/skip-links/skip-links-provider.js +2 -0
- package/dist/es2019/ui/page-layout/root.js +4 -3
- package/dist/es2019/ui/top-nav-items/themed/themed-button.js +1 -5
- package/dist/es2019/ui/top-nav-items/themed/themed-icon-button.js +1 -5
- package/dist/esm/components/skip-links/skip-link.js +0 -1
- package/dist/esm/components/skip-links/skip-links-container.compiled.css +2 -7
- package/dist/esm/components/skip-links/skip-links-container.js +17 -14
- package/dist/esm/components/skip-links/skip-links-popup.compiled.css +22 -0
- package/dist/esm/components/skip-links/skip-links-popup.js +115 -0
- package/dist/esm/context/skip-links/skip-links-provider.js +2 -0
- package/dist/esm/ui/page-layout/root.js +6 -3
- package/dist/esm/ui/top-nav-items/themed/themed-button.js +1 -5
- package/dist/esm/ui/top-nav-items/themed/themed-icon-button.js +1 -5
- package/dist/types/components/skip-links/skip-link.d.ts +7 -5
- package/dist/types/components/skip-links/skip-links-container.d.ts +3 -2
- package/dist/types/components/skip-links/skip-links-popup.d.ts +11 -0
- package/dist/types/context/skip-links/skip-links-provider.d.ts +2 -1
- package/dist/types/ui/page-layout/root.d.ts +5 -1
- package/dist/types-ts4.5/components/skip-links/skip-link.d.ts +7 -5
- package/dist/types-ts4.5/components/skip-links/skip-links-container.d.ts +3 -2
- package/dist/types-ts4.5/components/skip-links/skip-links-popup.d.ts +11 -0
- package/dist/types-ts4.5/context/skip-links/skip-links-provider.d.ts +2 -1
- package/dist/types-ts4.5/ui/page-layout/root.d.ts +5 -1
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 9.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0d8519bedea15`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d8519bedea15) -
|
|
8
|
+
Cleanup feature gate `platform_themed_button_use_icon_renderer`. Icon renderer is now always used
|
|
9
|
+
for themed button icons.
|
|
10
|
+
|
|
11
|
+
## 9.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`c47d9797de1d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c47d9797de1d4) -
|
|
16
|
+
Skip links are now rendered inside of a popup. This change is behind the
|
|
17
|
+
`platform_dst_nav4_skip_link_a11y_1` feature gate.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`36a98dddcf5af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36a98dddcf5af) -
|
|
22
|
+
Cleanup of feature gate navx-4418-fix-effect-state-updates-in-gsn (true)
|
|
23
|
+
|
|
3
24
|
## 9.0.0
|
|
4
25
|
|
|
5
26
|
### Major Changes
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
-
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
5
|
-
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
6
4
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
7
|
-
.
|
|
8
|
-
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
|
|
9
|
-
._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
5
|
+
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
10
6
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
11
7
|
._1e02v47k{inset-inline-start:var(--ds-space-250,20px)}
|
|
12
8
|
._1e0c1txw{display:flex}
|
|
@@ -19,7 +15,6 @@
|
|
|
19
15
|
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
20
16
|
._kqsw1n9t{position:fixed}
|
|
21
17
|
._lcxvglyw{pointer-events:none}
|
|
22
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
23
18
|
._tzy4idpf{opacity:0}
|
|
24
19
|
._18eu1wug:focus-within{pointer-events:auto}
|
|
25
20
|
._1digjh3g:focus-within{z-index:calc(infinity)}
|
|
@@ -16,16 +16,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
18
|
var _skipLink = require("./skip-link");
|
|
19
|
+
var _skipLinksPopup = require("./skip-links-popup");
|
|
19
20
|
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); }
|
|
20
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
23
|
var styles = {
|
|
23
|
-
root: "_1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
24
|
-
|
|
25
|
-
rootNew: "_2rko1mok _1rjcu2gc _18zrpxbi",
|
|
26
|
-
label: "_11c8i4vh _1rjcu2gc _syazazsu",
|
|
27
|
-
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
28
|
-
skipLinkListOld: "_zulp1b66"
|
|
24
|
+
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
25
|
+
skipLinkList: "_zulp1b66 _1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t"
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
/**
|
|
@@ -96,10 +93,11 @@ var isOnlyWhitespaceRegex = /^\s*$/;
|
|
|
96
93
|
* The label is used as the heading of the skip links container. If the provided label is a string
|
|
97
94
|
* comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
|
|
98
95
|
*
|
|
99
|
-
*
|
|
96
|
+
* When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
|
|
100
97
|
*/
|
|
101
98
|
function SkipLinksContainer(_ref) {
|
|
102
99
|
var label = _ref.label,
|
|
100
|
+
triggerLabel = _ref.triggerLabel,
|
|
103
101
|
testId = _ref.testId,
|
|
104
102
|
links = _ref.links;
|
|
105
103
|
var sortedLinks = (0, _react.useMemo)(function () {
|
|
@@ -109,18 +107,23 @@ function SkipLinksContainer(_ref) {
|
|
|
109
107
|
return null;
|
|
110
108
|
}
|
|
111
109
|
var isEmptyLabel = isOnlyWhitespaceRegex.test(label);
|
|
110
|
+
if ((0, _platformFeatureFlags.fg)('platform_dst_nav4_skip_link_a11y_1')) {
|
|
111
|
+
return /*#__PURE__*/React.createElement(_skipLinksPopup.SkipLinksPopup, {
|
|
112
|
+
label: label,
|
|
113
|
+
triggerLabel: triggerLabel,
|
|
114
|
+
testId: testId,
|
|
115
|
+
links: sortedLinks
|
|
116
|
+
});
|
|
117
|
+
}
|
|
112
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
113
119
|
onKeyDown: closeOnEscape,
|
|
114
120
|
"data-testid": testId ? "".concat(testId, "--skip-links-container") : undefined,
|
|
115
|
-
className: (0, _runtime.ax)([styles.root
|
|
116
|
-
}, !isEmptyLabel &&
|
|
117
|
-
"data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
|
|
118
|
-
className: (0, _runtime.ax)([styles.label])
|
|
119
|
-
}, label) : /*#__PURE__*/React.createElement(_compiled.Text, {
|
|
121
|
+
className: (0, _runtime.ax)([styles.root])
|
|
122
|
+
}, !isEmptyLabel && /*#__PURE__*/React.createElement(_compiled.Text, {
|
|
120
123
|
weight: "bold",
|
|
121
124
|
testId: testId ? "".concat(testId, "--skip-links-container--label") : undefined
|
|
122
|
-
}, label)
|
|
123
|
-
className: (0, _runtime.ax)([styles.skipLinkList
|
|
125
|
+
}, label), /*#__PURE__*/React.createElement("ol", {
|
|
126
|
+
className: (0, _runtime.ax)([styles.skipLinkList])
|
|
124
127
|
}, sortedLinks.map(function (_ref2) {
|
|
125
128
|
var id = _ref2.id,
|
|
126
129
|
label = _ref2.label,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
4
|
+
._1dqoglyw{border-style:none}
|
|
5
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
6
|
+
._152tutpp{inset-block-start:var(--ds-space-150,9pt)}
|
|
7
|
+
._1e02utpp{inset-inline-start:var(--ds-space-150,9pt)}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1pby1mrw{z-index:-1}
|
|
10
|
+
._1pbyjh3g{z-index:calc(infinity)}
|
|
11
|
+
._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
|
|
12
|
+
._1x8w11lx{list-style-position:outside}
|
|
13
|
+
._2lx21bp4{flex-direction:column}
|
|
14
|
+
._2mzuglyw{list-style-type:none}
|
|
15
|
+
._4ojojh3g:has(:focus-visible){z-index:calc(infinity)}
|
|
16
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
17
|
+
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
18
|
+
._c8j0kb7n:has(:focus-visible){opacity:1}
|
|
19
|
+
._kqsw1n9t{position:fixed}
|
|
20
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
21
|
+
._t9ecz6y5{transform:translateY(-100%)}
|
|
22
|
+
._tzy4idpf{opacity:0}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/* skip-links-popup.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
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.SkipLinksPopup = SkipLinksPopup;
|
|
10
|
+
require("./skip-links-popup.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
+
var _reactDom = require("react-dom");
|
|
17
|
+
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
18
|
+
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
19
|
+
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
20
|
+
var _skipLink = require("./skip-link");
|
|
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 contentStyles = {
|
|
23
|
+
root: "_1rjcu2gc _18zrpxbi _1e0c1txw _2lx21bp4 _1pbyjh3g",
|
|
24
|
+
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
25
|
+
label: "_11c8i4vh _1rjcu2gc _syazazsu"
|
|
26
|
+
};
|
|
27
|
+
var triggerStyles = {
|
|
28
|
+
root: "_2rko12b0 _1dqoglyw _kqsw1n9t _1e02utpp _152tutpp _1pby1mrw _tzy4idpf _bfhk1bhr _4ojojh3g _c8j0kb7n",
|
|
29
|
+
isOpen: "_tzy4idpf _t9ecz6y5"
|
|
30
|
+
};
|
|
31
|
+
var popupOffset = [0, 0];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
|
|
35
|
+
* control opens a dialog listing skip targets.
|
|
36
|
+
*/
|
|
37
|
+
function SkipLinksPopup(_ref) {
|
|
38
|
+
var title = _ref.label,
|
|
39
|
+
triggerLabel = _ref.triggerLabel,
|
|
40
|
+
testId = _ref.testId,
|
|
41
|
+
links = _ref.links;
|
|
42
|
+
var titleId = (0, _react.useId)();
|
|
43
|
+
var _useState = (0, _react.useState)(false),
|
|
44
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
|
+
isOpen = _useState2[0],
|
|
46
|
+
setIsOpen = _useState2[1];
|
|
47
|
+
var triggerRef = (0, _react.useRef)(null);
|
|
48
|
+
var openPopup = (0, _react.useCallback)(function () {
|
|
49
|
+
setIsOpen(true);
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Closes the popup.
|
|
54
|
+
*
|
|
55
|
+
* Uses `flushSync` to avoid issues with focus management.
|
|
56
|
+
* This ensures the popup's focus lock is fully released by the time skip links or our `onClose` try to move focus.
|
|
57
|
+
*/
|
|
58
|
+
var closePopup = (0, _react.useCallback)(function () {
|
|
59
|
+
(0, _reactDom.flushSync)(function () {
|
|
60
|
+
setIsOpen(false);
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Restores focus to the trigger on close, if it hasn't moved to another element, such as when Esc is pressed instead of a skip link.
|
|
66
|
+
*
|
|
67
|
+
* We need this because using the standard `shouldReturnFocus` on the popup would break the skip link focus behaviour,
|
|
68
|
+
* as focus would always move back to the trigger.
|
|
69
|
+
*/
|
|
70
|
+
var onClose = (0, _react.useCallback)(function () {
|
|
71
|
+
closePopup();
|
|
72
|
+
|
|
73
|
+
// Focus on the body implies a skip link was not clicked
|
|
74
|
+
if (document.activeElement === document.body) {
|
|
75
|
+
var _triggerRef$current;
|
|
76
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
|
|
77
|
+
}
|
|
78
|
+
}, [closePopup]);
|
|
79
|
+
return /*#__PURE__*/React.createElement(_popup.default, {
|
|
80
|
+
isOpen: isOpen,
|
|
81
|
+
onClose: onClose,
|
|
82
|
+
placement: "bottom-start",
|
|
83
|
+
shouldRenderToParent: true,
|
|
84
|
+
shouldReturnFocus: false,
|
|
85
|
+
role: "dialog",
|
|
86
|
+
titleId: titleId,
|
|
87
|
+
testId: testId ? "".concat(testId, "--skip-links-container") : undefined,
|
|
88
|
+
offset: popupOffset,
|
|
89
|
+
content: function content() {
|
|
90
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: (0, _runtime.ax)([contentStyles.root])
|
|
92
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
"data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
|
|
94
|
+
id: titleId,
|
|
95
|
+
className: (0, _runtime.ax)([contentStyles.label])
|
|
96
|
+
}, title), /*#__PURE__*/React.createElement("ol", {
|
|
97
|
+
className: (0, _runtime.ax)([contentStyles.skipLinkList])
|
|
98
|
+
}, links.map(function (_ref2) {
|
|
99
|
+
var id = _ref2.id,
|
|
100
|
+
label = _ref2.label,
|
|
101
|
+
_onBeforeNavigate = _ref2.onBeforeNavigate;
|
|
102
|
+
return /*#__PURE__*/React.createElement(_skipLink.SkipLink, {
|
|
103
|
+
key: id,
|
|
104
|
+
id: id,
|
|
105
|
+
onBeforeNavigate: function onBeforeNavigate() {
|
|
106
|
+
closePopup();
|
|
107
|
+
_onBeforeNavigate === null || _onBeforeNavigate === void 0 || _onBeforeNavigate();
|
|
108
|
+
}
|
|
109
|
+
}, label);
|
|
110
|
+
})));
|
|
111
|
+
},
|
|
112
|
+
trigger: function trigger(triggerProps) {
|
|
113
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: (0, _runtime.ax)([triggerStyles.root, isOpen && triggerStyles.isOpen])
|
|
115
|
+
}, /*#__PURE__*/React.createElement(_new.default, (0, _extends2.default)({}, triggerProps, {
|
|
116
|
+
ref: (0, _mergeRefs.default)([triggerProps.ref, triggerRef]),
|
|
117
|
+
appearance: "primary",
|
|
118
|
+
isSelected: isOpen,
|
|
119
|
+
testId: testId ? "".concat(testId, "--skip-links-trigger") : undefined,
|
|
120
|
+
onClick: openPopup
|
|
121
|
+
}), triggerLabel));
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
@@ -45,6 +45,7 @@ var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
|
45
45
|
function SkipLinksProvider(_ref) {
|
|
46
46
|
var children = _ref.children,
|
|
47
47
|
label = _ref.label,
|
|
48
|
+
triggerLabel = _ref.triggerLabel,
|
|
48
49
|
testId = _ref.testId;
|
|
49
50
|
var _useState = (0, _react.useState)([]),
|
|
50
51
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -84,6 +85,7 @@ function SkipLinksProvider(_ref) {
|
|
|
84
85
|
value: contextValue
|
|
85
86
|
}, /*#__PURE__*/_react.default.createElement(_skipLinksContainer.SkipLinksContainer, {
|
|
86
87
|
label: label,
|
|
88
|
+
triggerLabel: triggerLabel,
|
|
87
89
|
testId: testId,
|
|
88
90
|
links: links
|
|
89
91
|
}), children);
|
|
@@ -35,12 +35,14 @@ function Root(_ref) {
|
|
|
35
35
|
xcss = _ref.xcss,
|
|
36
36
|
_ref$UNSAFE_dangerous = _ref.UNSAFE_dangerouslyHoistSlotSizes,
|
|
37
37
|
UNSAFE_dangerouslyHoistSlotSizes = _ref$UNSAFE_dangerous === void 0 ? false : _ref$UNSAFE_dangerous,
|
|
38
|
-
skipLinksLabel = _ref.skipLinksLabel,
|
|
38
|
+
_ref$skipLinksLabel = _ref.skipLinksLabel,
|
|
39
|
+
skipLinksLabel = _ref$skipLinksLabel === void 0 ? (0, _platformFeatureFlags.fg)('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:' : _ref$skipLinksLabel,
|
|
40
|
+
_ref$skipLinksTrigger = _ref.skipLinksTriggerLabel,
|
|
41
|
+
skipLinksTriggerLabel = _ref$skipLinksTrigger === void 0 ? 'Skip to' : _ref$skipLinksTrigger,
|
|
39
42
|
testId = _ref.testId,
|
|
40
43
|
defaultSideNavCollapsed = _ref.defaultSideNavCollapsed,
|
|
41
44
|
_ref$isSideNavShortcu = _ref.isSideNavShortcutEnabled,
|
|
42
45
|
isSideNavShortcutEnabled = _ref$isSideNavShortcu === void 0 ? false : _ref$isSideNavShortcu;
|
|
43
|
-
var resolvedSkipLinksLabel = skipLinksLabel !== null && skipLinksLabel !== void 0 ? skipLinksLabel : (0, _platformFeatureFlags.fg)('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:';
|
|
44
46
|
var ref = (0, _react.useRef)(null);
|
|
45
47
|
(0, _react.useEffect)(function () {
|
|
46
48
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -62,7 +64,8 @@ function Root(_ref) {
|
|
|
62
64
|
}, /*#__PURE__*/_react.default.createElement(_topNavStartContextProvider.TopNavStartProvider, null, /*#__PURE__*/_react.default.createElement(_openLayerObserver.OpenLayerObserver, null, /*#__PURE__*/_react.default.createElement(_hoistSlotSizesContext.DangerouslyHoistSlotSizes.Provider, {
|
|
63
65
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
64
66
|
}, /*#__PURE__*/_react.default.createElement(_skipLinksProvider.SkipLinksProvider, {
|
|
65
|
-
label:
|
|
67
|
+
label: skipLinksLabel,
|
|
68
|
+
triggerLabel: skipLinksTriggerLabel,
|
|
66
69
|
testId: testId
|
|
67
70
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
68
71
|
ref: ref,
|
|
@@ -12,7 +12,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _iconRenderer = _interopRequireDefault(require("../icon-renderer"));
|
|
17
16
|
var _themedPressable = require("./themed-pressable");
|
|
18
17
|
var _excluded = ["iconBefore", "children"];
|
|
@@ -29,11 +28,8 @@ var ThemedButton = exports.ThemedButton = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
29
28
|
ref: ref
|
|
30
29
|
}), IconBefore && /*#__PURE__*/_react.default.createElement("span", {
|
|
31
30
|
className: (0, _runtime.ax)([textButtonStyles.iconBefore])
|
|
32
|
-
},
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_iconRenderer.default, {
|
|
33
32
|
icon: IconBefore
|
|
34
|
-
}) : /*#__PURE__*/_react.default.createElement(IconBefore, {
|
|
35
|
-
label: "",
|
|
36
|
-
color: "currentColor"
|
|
37
33
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
38
34
|
className: (0, _runtime.ax)([textButtonStyles.text])
|
|
39
35
|
}, children));
|
|
@@ -12,7 +12,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
16
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
18
17
|
var _iconRenderer = _interopRequireDefault(require("../icon-renderer"));
|
|
@@ -74,11 +73,8 @@ var ThemedIconButton = exports.ThemedIconButton = /*#__PURE__*/(0, _react.forwar
|
|
|
74
73
|
(_triggerProps$onBlur = triggerProps.onBlur) === null || _triggerProps$onBlur === void 0 || _triggerProps$onBlur.call(triggerProps, e);
|
|
75
74
|
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
|
|
76
75
|
}
|
|
77
|
-
}),
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement(_iconRenderer.default, {
|
|
78
77
|
icon: Icon
|
|
79
|
-
}) : /*#__PURE__*/_react.default.createElement(Icon, {
|
|
80
|
-
label: "",
|
|
81
|
-
color: "currentColor"
|
|
82
78
|
}), /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, label))
|
|
83
79
|
);
|
|
84
80
|
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
-
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
5
|
-
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
6
4
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
7
|
-
.
|
|
8
|
-
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
|
|
9
|
-
._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
5
|
+
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
10
6
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
11
7
|
._1e02v47k{inset-inline-start:var(--ds-space-250,20px)}
|
|
12
8
|
._1e0c1txw{display:flex}
|
|
@@ -19,7 +15,6 @@
|
|
|
19
15
|
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
20
16
|
._kqsw1n9t{position:fixed}
|
|
21
17
|
._lcxvglyw{pointer-events:none}
|
|
22
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
23
18
|
._tzy4idpf{opacity:0}
|
|
24
19
|
._18eu1wug:focus-within{pointer-events:auto}
|
|
25
20
|
._1digjh3g:focus-within{z-index:calc(infinity)}
|
|
@@ -6,13 +6,10 @@ import { useMemo } from 'react';
|
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { SkipLink } from './skip-link';
|
|
9
|
+
import { SkipLinksPopup } from './skip-links-popup';
|
|
9
10
|
const styles = {
|
|
10
|
-
root: "_1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
11
|
-
|
|
12
|
-
rootNew: "_2rko1mok _1rjcu2gc _18zrpxbi",
|
|
13
|
-
label: "_11c8i4vh _1rjcu2gc _syazazsu",
|
|
14
|
-
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
15
|
-
skipLinkListOld: "_zulp1b66"
|
|
11
|
+
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
12
|
+
skipLinkList: "_zulp1b66 _1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t"
|
|
16
13
|
};
|
|
17
14
|
|
|
18
15
|
/**
|
|
@@ -76,10 +73,11 @@ const isOnlyWhitespaceRegex = /^\s*$/;
|
|
|
76
73
|
* The label is used as the heading of the skip links container. If the provided label is a string
|
|
77
74
|
* comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
|
|
78
75
|
*
|
|
79
|
-
*
|
|
76
|
+
* When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
|
|
80
77
|
*/
|
|
81
78
|
export function SkipLinksContainer({
|
|
82
79
|
label,
|
|
80
|
+
triggerLabel,
|
|
83
81
|
testId,
|
|
84
82
|
links
|
|
85
83
|
}) {
|
|
@@ -90,18 +88,23 @@ export function SkipLinksContainer({
|
|
|
90
88
|
return null;
|
|
91
89
|
}
|
|
92
90
|
const isEmptyLabel = isOnlyWhitespaceRegex.test(label);
|
|
91
|
+
if (fg('platform_dst_nav4_skip_link_a11y_1')) {
|
|
92
|
+
return /*#__PURE__*/React.createElement(SkipLinksPopup, {
|
|
93
|
+
label: label,
|
|
94
|
+
triggerLabel: triggerLabel,
|
|
95
|
+
testId: testId,
|
|
96
|
+
links: sortedLinks
|
|
97
|
+
});
|
|
98
|
+
}
|
|
93
99
|
return /*#__PURE__*/React.createElement("div", {
|
|
94
100
|
onKeyDown: closeOnEscape,
|
|
95
101
|
"data-testid": testId ? `${testId}--skip-links-container` : undefined,
|
|
96
|
-
className: ax([styles.root
|
|
97
|
-
}, !isEmptyLabel &&
|
|
98
|
-
"data-testid": testId ? `${testId}--skip-links-container--label` : undefined,
|
|
99
|
-
className: ax([styles.label])
|
|
100
|
-
}, label) : /*#__PURE__*/React.createElement(Text, {
|
|
102
|
+
className: ax([styles.root])
|
|
103
|
+
}, !isEmptyLabel && /*#__PURE__*/React.createElement(Text, {
|
|
101
104
|
weight: "bold",
|
|
102
105
|
testId: testId ? `${testId}--skip-links-container--label` : undefined
|
|
103
|
-
}, label)
|
|
104
|
-
className: ax([styles.skipLinkList
|
|
106
|
+
}, label), /*#__PURE__*/React.createElement("ol", {
|
|
107
|
+
className: ax([styles.skipLinkList])
|
|
105
108
|
}, sortedLinks.map(({
|
|
106
109
|
id,
|
|
107
110
|
label,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
4
|
+
._1dqoglyw{border-style:none}
|
|
5
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
6
|
+
._152tutpp{inset-block-start:var(--ds-space-150,9pt)}
|
|
7
|
+
._1e02utpp{inset-inline-start:var(--ds-space-150,9pt)}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1pby1mrw{z-index:-1}
|
|
10
|
+
._1pbyjh3g{z-index:calc(infinity)}
|
|
11
|
+
._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
|
|
12
|
+
._1x8w11lx{list-style-position:outside}
|
|
13
|
+
._2lx21bp4{flex-direction:column}
|
|
14
|
+
._2mzuglyw{list-style-type:none}
|
|
15
|
+
._4ojojh3g:has(:focus-visible){z-index:calc(infinity)}
|
|
16
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
17
|
+
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
18
|
+
._c8j0kb7n:has(:focus-visible){opacity:1}
|
|
19
|
+
._kqsw1n9t{position:fixed}
|
|
20
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
21
|
+
._t9ecz6y5{transform:translateY(-100%)}
|
|
22
|
+
._tzy4idpf{opacity:0}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* skip-links-popup.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./skip-links-popup.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useCallback, useId, useRef, useState } from 'react';
|
|
7
|
+
import { flushSync } from 'react-dom';
|
|
8
|
+
import Button from '@atlaskit/button/new';
|
|
9
|
+
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
10
|
+
import Popup from '@atlaskit/popup';
|
|
11
|
+
import { SkipLink } from './skip-link';
|
|
12
|
+
const contentStyles = {
|
|
13
|
+
root: "_1rjcu2gc _18zrpxbi _1e0c1txw _2lx21bp4 _1pbyjh3g",
|
|
14
|
+
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
15
|
+
label: "_11c8i4vh _1rjcu2gc _syazazsu"
|
|
16
|
+
};
|
|
17
|
+
const triggerStyles = {
|
|
18
|
+
root: "_2rko12b0 _1dqoglyw _kqsw1n9t _1e02utpp _152tutpp _1pby1mrw _tzy4idpf _bfhk1bhr _4ojojh3g _c8j0kb7n",
|
|
19
|
+
isOpen: "_tzy4idpf _t9ecz6y5"
|
|
20
|
+
};
|
|
21
|
+
const popupOffset = [0, 0];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
|
|
25
|
+
* control opens a dialog listing skip targets.
|
|
26
|
+
*/
|
|
27
|
+
export function SkipLinksPopup({
|
|
28
|
+
label: title,
|
|
29
|
+
triggerLabel,
|
|
30
|
+
testId,
|
|
31
|
+
links
|
|
32
|
+
}) {
|
|
33
|
+
const titleId = useId();
|
|
34
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
35
|
+
const triggerRef = useRef(null);
|
|
36
|
+
const openPopup = useCallback(() => {
|
|
37
|
+
setIsOpen(true);
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Closes the popup.
|
|
42
|
+
*
|
|
43
|
+
* Uses `flushSync` to avoid issues with focus management.
|
|
44
|
+
* This ensures the popup's focus lock is fully released by the time skip links or our `onClose` try to move focus.
|
|
45
|
+
*/
|
|
46
|
+
const closePopup = useCallback(() => {
|
|
47
|
+
flushSync(() => {
|
|
48
|
+
setIsOpen(false);
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Restores focus to the trigger on close, if it hasn't moved to another element, such as when Esc is pressed instead of a skip link.
|
|
54
|
+
*
|
|
55
|
+
* We need this because using the standard `shouldReturnFocus` on the popup would break the skip link focus behaviour,
|
|
56
|
+
* as focus would always move back to the trigger.
|
|
57
|
+
*/
|
|
58
|
+
const onClose = useCallback(() => {
|
|
59
|
+
closePopup();
|
|
60
|
+
|
|
61
|
+
// Focus on the body implies a skip link was not clicked
|
|
62
|
+
if (document.activeElement === document.body) {
|
|
63
|
+
var _triggerRef$current;
|
|
64
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
65
|
+
}
|
|
66
|
+
}, [closePopup]);
|
|
67
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
68
|
+
isOpen: isOpen,
|
|
69
|
+
onClose: onClose,
|
|
70
|
+
placement: "bottom-start",
|
|
71
|
+
shouldRenderToParent: true,
|
|
72
|
+
shouldReturnFocus: false,
|
|
73
|
+
role: "dialog",
|
|
74
|
+
titleId: titleId,
|
|
75
|
+
testId: testId ? `${testId}--skip-links-container` : undefined,
|
|
76
|
+
offset: popupOffset,
|
|
77
|
+
content: () => /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: ax([contentStyles.root])
|
|
79
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
"data-testid": testId ? `${testId}--skip-links-container--label` : undefined,
|
|
81
|
+
id: titleId,
|
|
82
|
+
className: ax([contentStyles.label])
|
|
83
|
+
}, title), /*#__PURE__*/React.createElement("ol", {
|
|
84
|
+
className: ax([contentStyles.skipLinkList])
|
|
85
|
+
}, links.map(({
|
|
86
|
+
id,
|
|
87
|
+
label,
|
|
88
|
+
onBeforeNavigate
|
|
89
|
+
}) => /*#__PURE__*/React.createElement(SkipLink, {
|
|
90
|
+
key: id,
|
|
91
|
+
id: id,
|
|
92
|
+
onBeforeNavigate: () => {
|
|
93
|
+
closePopup();
|
|
94
|
+
onBeforeNavigate === null || onBeforeNavigate === void 0 ? void 0 : onBeforeNavigate();
|
|
95
|
+
}
|
|
96
|
+
}, label)))),
|
|
97
|
+
trigger: triggerProps => /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: ax([triggerStyles.root, isOpen && triggerStyles.isOpen])
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
|
|
100
|
+
ref: mergeRefs([triggerProps.ref, triggerRef]),
|
|
101
|
+
appearance: "primary",
|
|
102
|
+
isSelected: isOpen,
|
|
103
|
+
testId: testId ? `${testId}--skip-links-trigger` : undefined,
|
|
104
|
+
onClick: openPopup
|
|
105
|
+
}), triggerLabel))
|
|
106
|
+
});
|
|
107
|
+
}
|
|
@@ -34,6 +34,7 @@ const getByDomOrderSortFunction = () => {
|
|
|
34
34
|
export function SkipLinksProvider({
|
|
35
35
|
children,
|
|
36
36
|
label,
|
|
37
|
+
triggerLabel,
|
|
37
38
|
testId
|
|
38
39
|
}) {
|
|
39
40
|
const [links, setLinks] = useState([]);
|
|
@@ -71,6 +72,7 @@ This error will not be shown in production, and the duplicate skip link will be
|
|
|
71
72
|
value: contextValue
|
|
72
73
|
}, /*#__PURE__*/React.createElement(SkipLinksContainer, {
|
|
73
74
|
label: label,
|
|
75
|
+
triggerLabel: triggerLabel,
|
|
74
76
|
testId: testId,
|
|
75
77
|
links: links
|
|
76
78
|
}), children);
|
|
@@ -26,12 +26,12 @@ export function Root({
|
|
|
26
26
|
children,
|
|
27
27
|
xcss,
|
|
28
28
|
UNSAFE_dangerouslyHoistSlotSizes = false,
|
|
29
|
-
skipLinksLabel,
|
|
29
|
+
skipLinksLabel = fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:',
|
|
30
|
+
skipLinksTriggerLabel = 'Skip to',
|
|
30
31
|
testId,
|
|
31
32
|
defaultSideNavCollapsed,
|
|
32
33
|
isSideNavShortcutEnabled = false
|
|
33
34
|
}) {
|
|
34
|
-
const resolvedSkipLinksLabel = skipLinksLabel !== null && skipLinksLabel !== void 0 ? skipLinksLabel : fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:';
|
|
35
35
|
const ref = useRef(null);
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -62,7 +62,8 @@ This message will not be displayed in production.
|
|
|
62
62
|
}, /*#__PURE__*/React.createElement(TopNavStartProvider, null, /*#__PURE__*/React.createElement(OpenLayerObserver, null, /*#__PURE__*/React.createElement(DangerouslyHoistSlotSizes.Provider, {
|
|
63
63
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
64
64
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
65
|
-
label:
|
|
65
|
+
label: skipLinksLabel,
|
|
66
|
+
triggerLabel: skipLinksTriggerLabel,
|
|
66
67
|
testId: testId
|
|
67
68
|
}, /*#__PURE__*/React.createElement("div", {
|
|
68
69
|
ref: ref,
|
|
@@ -3,7 +3,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./themed-button.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import IconRenderer from '../icon-renderer';
|
|
8
7
|
import { ThemedPressable } from './themed-pressable';
|
|
9
8
|
const textButtonStyles = {
|
|
@@ -19,11 +18,8 @@ export const ThemedButton = /*#__PURE__*/forwardRef(function ThemedButton({
|
|
|
19
18
|
ref: ref
|
|
20
19
|
}), IconBefore && /*#__PURE__*/React.createElement("span", {
|
|
21
20
|
className: ax([textButtonStyles.iconBefore])
|
|
22
|
-
},
|
|
21
|
+
}, /*#__PURE__*/React.createElement(IconRenderer, {
|
|
23
22
|
icon: IconBefore
|
|
24
|
-
}) : /*#__PURE__*/React.createElement(IconBefore, {
|
|
25
|
-
label: "",
|
|
26
|
-
color: "currentColor"
|
|
27
23
|
})), /*#__PURE__*/React.createElement("span", {
|
|
28
24
|
className: ax([textButtonStyles.text])
|
|
29
25
|
}, children));
|
|
@@ -3,7 +3,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
7
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
9
8
|
import IconRenderer from '../icon-renderer';
|
|
@@ -63,10 +62,7 @@ export const ThemedIconButton = /*#__PURE__*/forwardRef(function ThemedIconButto
|
|
|
63
62
|
(_triggerProps$onBlur = triggerProps.onBlur) === null || _triggerProps$onBlur === void 0 ? void 0 : _triggerProps$onBlur.call(triggerProps, e);
|
|
64
63
|
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, e);
|
|
65
64
|
}
|
|
66
|
-
}),
|
|
65
|
+
}), /*#__PURE__*/React.createElement(IconRenderer, {
|
|
67
66
|
icon: Icon
|
|
68
|
-
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
69
|
-
label: "",
|
|
70
|
-
color: "currentColor"
|
|
71
67
|
}), /*#__PURE__*/React.createElement(VisuallyHidden, null, label)));
|
|
72
68
|
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
-
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
3
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
5
|
-
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
6
4
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
7
|
-
.
|
|
8
|
-
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
|
|
9
|
-
._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
5
|
+
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._152tv47k{inset-block-start:var(--ds-space-250,20px)}
|
|
10
6
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
11
7
|
._1e02v47k{inset-inline-start:var(--ds-space-250,20px)}
|
|
12
8
|
._1e0c1txw{display:flex}
|
|
@@ -19,7 +15,6 @@
|
|
|
19
15
|
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
20
16
|
._kqsw1n9t{position:fixed}
|
|
21
17
|
._lcxvglyw{pointer-events:none}
|
|
22
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
23
18
|
._tzy4idpf{opacity:0}
|
|
24
19
|
._18eu1wug:focus-within{pointer-events:auto}
|
|
25
20
|
._1digjh3g:focus-within{z-index:calc(infinity)}
|
|
@@ -10,13 +10,10 @@ import { useMemo } from 'react';
|
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
12
12
|
import { SkipLink } from './skip-link';
|
|
13
|
+
import { SkipLinksPopup } from './skip-links-popup';
|
|
13
14
|
var styles = {
|
|
14
|
-
root: "_1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
15
|
-
|
|
16
|
-
rootNew: "_2rko1mok _1rjcu2gc _18zrpxbi",
|
|
17
|
-
label: "_11c8i4vh _1rjcu2gc _syazazsu",
|
|
18
|
-
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
19
|
-
skipLinkListOld: "_zulp1b66"
|
|
15
|
+
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
16
|
+
skipLinkList: "_zulp1b66 _1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t"
|
|
20
17
|
};
|
|
21
18
|
|
|
22
19
|
/**
|
|
@@ -87,10 +84,11 @@ var isOnlyWhitespaceRegex = /^\s*$/;
|
|
|
87
84
|
* The label is used as the heading of the skip links container. If the provided label is a string
|
|
88
85
|
* comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
|
|
89
86
|
*
|
|
90
|
-
*
|
|
87
|
+
* When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
|
|
91
88
|
*/
|
|
92
89
|
export function SkipLinksContainer(_ref) {
|
|
93
90
|
var label = _ref.label,
|
|
91
|
+
triggerLabel = _ref.triggerLabel,
|
|
94
92
|
testId = _ref.testId,
|
|
95
93
|
links = _ref.links;
|
|
96
94
|
var sortedLinks = useMemo(function () {
|
|
@@ -100,18 +98,23 @@ export function SkipLinksContainer(_ref) {
|
|
|
100
98
|
return null;
|
|
101
99
|
}
|
|
102
100
|
var isEmptyLabel = isOnlyWhitespaceRegex.test(label);
|
|
101
|
+
if (fg('platform_dst_nav4_skip_link_a11y_1')) {
|
|
102
|
+
return /*#__PURE__*/React.createElement(SkipLinksPopup, {
|
|
103
|
+
label: label,
|
|
104
|
+
triggerLabel: triggerLabel,
|
|
105
|
+
testId: testId,
|
|
106
|
+
links: sortedLinks
|
|
107
|
+
});
|
|
108
|
+
}
|
|
103
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
104
110
|
onKeyDown: closeOnEscape,
|
|
105
111
|
"data-testid": testId ? "".concat(testId, "--skip-links-container") : undefined,
|
|
106
|
-
className: ax([styles.root
|
|
107
|
-
}, !isEmptyLabel &&
|
|
108
|
-
"data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
|
|
109
|
-
className: ax([styles.label])
|
|
110
|
-
}, label) : /*#__PURE__*/React.createElement(Text, {
|
|
112
|
+
className: ax([styles.root])
|
|
113
|
+
}, !isEmptyLabel && /*#__PURE__*/React.createElement(Text, {
|
|
111
114
|
weight: "bold",
|
|
112
115
|
testId: testId ? "".concat(testId, "--skip-links-container--label") : undefined
|
|
113
|
-
}, label)
|
|
114
|
-
className: ax([styles.skipLinkList
|
|
116
|
+
}, label), /*#__PURE__*/React.createElement("ol", {
|
|
117
|
+
className: ax([styles.skipLinkList])
|
|
115
118
|
}, sortedLinks.map(function (_ref2) {
|
|
116
119
|
var id = _ref2.id,
|
|
117
120
|
label = _ref2.label,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
+
._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
|
|
4
|
+
._1dqoglyw{border-style:none}
|
|
5
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
6
|
+
._152tutpp{inset-block-start:var(--ds-space-150,9pt)}
|
|
7
|
+
._1e02utpp{inset-inline-start:var(--ds-space-150,9pt)}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1pby1mrw{z-index:-1}
|
|
10
|
+
._1pbyjh3g{z-index:calc(infinity)}
|
|
11
|
+
._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
|
|
12
|
+
._1x8w11lx{list-style-position:outside}
|
|
13
|
+
._2lx21bp4{flex-direction:column}
|
|
14
|
+
._2mzuglyw{list-style-type:none}
|
|
15
|
+
._4ojojh3g:has(:focus-visible){z-index:calc(infinity)}
|
|
16
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
17
|
+
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
18
|
+
._c8j0kb7n:has(:focus-visible){opacity:1}
|
|
19
|
+
._kqsw1n9t{position:fixed}
|
|
20
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
21
|
+
._t9ecz6y5{transform:translateY(-100%)}
|
|
22
|
+
._tzy4idpf{opacity:0}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* skip-links-popup.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import "./skip-links-popup.compiled.css";
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
import { useCallback, useId, useRef, useState } from 'react';
|
|
8
|
+
import { flushSync } from 'react-dom';
|
|
9
|
+
import Button from '@atlaskit/button/new';
|
|
10
|
+
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
11
|
+
import Popup from '@atlaskit/popup';
|
|
12
|
+
import { SkipLink } from './skip-link';
|
|
13
|
+
var contentStyles = {
|
|
14
|
+
root: "_1rjcu2gc _18zrpxbi _1e0c1txw _2lx21bp4 _1pbyjh3g",
|
|
15
|
+
skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
|
|
16
|
+
label: "_11c8i4vh _1rjcu2gc _syazazsu"
|
|
17
|
+
};
|
|
18
|
+
var triggerStyles = {
|
|
19
|
+
root: "_2rko12b0 _1dqoglyw _kqsw1n9t _1e02utpp _152tutpp _1pby1mrw _tzy4idpf _bfhk1bhr _4ojojh3g _c8j0kb7n",
|
|
20
|
+
isOpen: "_tzy4idpf _t9ecz6y5"
|
|
21
|
+
};
|
|
22
|
+
var popupOffset = [0, 0];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
|
|
26
|
+
* control opens a dialog listing skip targets.
|
|
27
|
+
*/
|
|
28
|
+
export function SkipLinksPopup(_ref) {
|
|
29
|
+
var title = _ref.label,
|
|
30
|
+
triggerLabel = _ref.triggerLabel,
|
|
31
|
+
testId = _ref.testId,
|
|
32
|
+
links = _ref.links;
|
|
33
|
+
var titleId = useId();
|
|
34
|
+
var _useState = useState(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
isOpen = _useState2[0],
|
|
37
|
+
setIsOpen = _useState2[1];
|
|
38
|
+
var triggerRef = useRef(null);
|
|
39
|
+
var openPopup = useCallback(function () {
|
|
40
|
+
setIsOpen(true);
|
|
41
|
+
}, []);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Closes the popup.
|
|
45
|
+
*
|
|
46
|
+
* Uses `flushSync` to avoid issues with focus management.
|
|
47
|
+
* This ensures the popup's focus lock is fully released by the time skip links or our `onClose` try to move focus.
|
|
48
|
+
*/
|
|
49
|
+
var closePopup = useCallback(function () {
|
|
50
|
+
flushSync(function () {
|
|
51
|
+
setIsOpen(false);
|
|
52
|
+
});
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Restores focus to the trigger on close, if it hasn't moved to another element, such as when Esc is pressed instead of a skip link.
|
|
57
|
+
*
|
|
58
|
+
* We need this because using the standard `shouldReturnFocus` on the popup would break the skip link focus behaviour,
|
|
59
|
+
* as focus would always move back to the trigger.
|
|
60
|
+
*/
|
|
61
|
+
var onClose = useCallback(function () {
|
|
62
|
+
closePopup();
|
|
63
|
+
|
|
64
|
+
// Focus on the body implies a skip link was not clicked
|
|
65
|
+
if (document.activeElement === document.body) {
|
|
66
|
+
var _triggerRef$current;
|
|
67
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
|
|
68
|
+
}
|
|
69
|
+
}, [closePopup]);
|
|
70
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
71
|
+
isOpen: isOpen,
|
|
72
|
+
onClose: onClose,
|
|
73
|
+
placement: "bottom-start",
|
|
74
|
+
shouldRenderToParent: true,
|
|
75
|
+
shouldReturnFocus: false,
|
|
76
|
+
role: "dialog",
|
|
77
|
+
titleId: titleId,
|
|
78
|
+
testId: testId ? "".concat(testId, "--skip-links-container") : undefined,
|
|
79
|
+
offset: popupOffset,
|
|
80
|
+
content: function content() {
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: ax([contentStyles.root])
|
|
83
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
"data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
|
|
85
|
+
id: titleId,
|
|
86
|
+
className: ax([contentStyles.label])
|
|
87
|
+
}, title), /*#__PURE__*/React.createElement("ol", {
|
|
88
|
+
className: ax([contentStyles.skipLinkList])
|
|
89
|
+
}, links.map(function (_ref2) {
|
|
90
|
+
var id = _ref2.id,
|
|
91
|
+
label = _ref2.label,
|
|
92
|
+
_onBeforeNavigate = _ref2.onBeforeNavigate;
|
|
93
|
+
return /*#__PURE__*/React.createElement(SkipLink, {
|
|
94
|
+
key: id,
|
|
95
|
+
id: id,
|
|
96
|
+
onBeforeNavigate: function onBeforeNavigate() {
|
|
97
|
+
closePopup();
|
|
98
|
+
_onBeforeNavigate === null || _onBeforeNavigate === void 0 || _onBeforeNavigate();
|
|
99
|
+
}
|
|
100
|
+
}, label);
|
|
101
|
+
})));
|
|
102
|
+
},
|
|
103
|
+
trigger: function trigger(triggerProps) {
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: ax([triggerStyles.root, isOpen && triggerStyles.isOpen])
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
|
|
107
|
+
ref: mergeRefs([triggerProps.ref, triggerRef]),
|
|
108
|
+
appearance: "primary",
|
|
109
|
+
isSelected: isOpen,
|
|
110
|
+
testId: testId ? "".concat(testId, "--skip-links-trigger") : undefined,
|
|
111
|
+
onClick: openPopup
|
|
112
|
+
}), triggerLabel));
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
@@ -36,6 +36,7 @@ var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
|
36
36
|
export function SkipLinksProvider(_ref) {
|
|
37
37
|
var children = _ref.children,
|
|
38
38
|
label = _ref.label,
|
|
39
|
+
triggerLabel = _ref.triggerLabel,
|
|
39
40
|
testId = _ref.testId;
|
|
40
41
|
var _useState = useState([]),
|
|
41
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -75,6 +76,7 @@ export function SkipLinksProvider(_ref) {
|
|
|
75
76
|
value: contextValue
|
|
76
77
|
}, /*#__PURE__*/React.createElement(SkipLinksContainer, {
|
|
77
78
|
label: label,
|
|
79
|
+
triggerLabel: triggerLabel,
|
|
78
80
|
testId: testId,
|
|
79
81
|
links: links
|
|
80
82
|
}), children);
|
|
@@ -27,12 +27,14 @@ export function Root(_ref) {
|
|
|
27
27
|
xcss = _ref.xcss,
|
|
28
28
|
_ref$UNSAFE_dangerous = _ref.UNSAFE_dangerouslyHoistSlotSizes,
|
|
29
29
|
UNSAFE_dangerouslyHoistSlotSizes = _ref$UNSAFE_dangerous === void 0 ? false : _ref$UNSAFE_dangerous,
|
|
30
|
-
skipLinksLabel = _ref.skipLinksLabel,
|
|
30
|
+
_ref$skipLinksLabel = _ref.skipLinksLabel,
|
|
31
|
+
skipLinksLabel = _ref$skipLinksLabel === void 0 ? fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:' : _ref$skipLinksLabel,
|
|
32
|
+
_ref$skipLinksTrigger = _ref.skipLinksTriggerLabel,
|
|
33
|
+
skipLinksTriggerLabel = _ref$skipLinksTrigger === void 0 ? 'Skip to' : _ref$skipLinksTrigger,
|
|
31
34
|
testId = _ref.testId,
|
|
32
35
|
defaultSideNavCollapsed = _ref.defaultSideNavCollapsed,
|
|
33
36
|
_ref$isSideNavShortcu = _ref.isSideNavShortcutEnabled,
|
|
34
37
|
isSideNavShortcutEnabled = _ref$isSideNavShortcu === void 0 ? false : _ref$isSideNavShortcu;
|
|
35
|
-
var resolvedSkipLinksLabel = skipLinksLabel !== null && skipLinksLabel !== void 0 ? skipLinksLabel : fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:';
|
|
36
38
|
var ref = useRef(null);
|
|
37
39
|
useEffect(function () {
|
|
38
40
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -54,7 +56,8 @@ export function Root(_ref) {
|
|
|
54
56
|
}, /*#__PURE__*/React.createElement(TopNavStartProvider, null, /*#__PURE__*/React.createElement(OpenLayerObserver, null, /*#__PURE__*/React.createElement(DangerouslyHoistSlotSizes.Provider, {
|
|
55
57
|
value: UNSAFE_dangerouslyHoistSlotSizes
|
|
56
58
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
57
|
-
label:
|
|
59
|
+
label: skipLinksLabel,
|
|
60
|
+
triggerLabel: skipLinksTriggerLabel,
|
|
58
61
|
testId: testId
|
|
59
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
60
63
|
ref: ref,
|
|
@@ -5,7 +5,6 @@ var _excluded = ["iconBefore", "children"];
|
|
|
5
5
|
import "./themed-button.compiled.css";
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
import React, { forwardRef } from 'react';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import IconRenderer from '../icon-renderer';
|
|
10
9
|
import { ThemedPressable } from './themed-pressable';
|
|
11
10
|
var textButtonStyles = {
|
|
@@ -20,11 +19,8 @@ export var ThemedButton = /*#__PURE__*/forwardRef(function ThemedButton(_ref, re
|
|
|
20
19
|
ref: ref
|
|
21
20
|
}), IconBefore && /*#__PURE__*/React.createElement("span", {
|
|
22
21
|
className: ax([textButtonStyles.iconBefore])
|
|
23
|
-
},
|
|
22
|
+
}, /*#__PURE__*/React.createElement(IconRenderer, {
|
|
24
23
|
icon: IconBefore
|
|
25
|
-
}) : /*#__PURE__*/React.createElement(IconBefore, {
|
|
26
|
-
label: "",
|
|
27
|
-
color: "currentColor"
|
|
28
24
|
})), /*#__PURE__*/React.createElement("span", {
|
|
29
25
|
className: ax([textButtonStyles.text])
|
|
30
26
|
}, children));
|
|
@@ -5,7 +5,6 @@ var _excluded = ["icon", "label", "tooltip"];
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import React, { forwardRef } from 'react';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
9
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
11
10
|
import IconRenderer from '../icon-renderer';
|
|
@@ -65,11 +64,8 @@ export var ThemedIconButton = /*#__PURE__*/forwardRef(function ThemedIconButton(
|
|
|
65
64
|
(_triggerProps$onBlur = triggerProps.onBlur) === null || _triggerProps$onBlur === void 0 || _triggerProps$onBlur.call(triggerProps, e);
|
|
66
65
|
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
|
|
67
66
|
}
|
|
68
|
-
}),
|
|
67
|
+
}), /*#__PURE__*/React.createElement(IconRenderer, {
|
|
69
68
|
icon: Icon
|
|
70
|
-
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
-
label: "",
|
|
72
|
-
color: "currentColor"
|
|
73
69
|
}), /*#__PURE__*/React.createElement(VisuallyHidden, null, label))
|
|
74
70
|
);
|
|
75
71
|
});
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
6
|
import type { SkipLinkData } from '../../context/skip-links/types';
|
|
7
|
+
type SkipLinkProps = {
|
|
8
|
+
id: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
|
|
11
|
+
};
|
|
7
12
|
/**
|
|
8
13
|
* A link that moves current tab position to a different element
|
|
9
14
|
*
|
|
10
15
|
* This component is rendered internally and is not exported publicly.
|
|
11
16
|
*/
|
|
12
|
-
export declare const SkipLink: ({ id, children, onBeforeNavigate
|
|
13
|
-
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
|
|
16
|
-
}) => JSX.Element;
|
|
17
|
+
export declare const SkipLink: ({ id, children, onBeforeNavigate }: SkipLinkProps) => JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -8,10 +8,11 @@ import { type SkipLinkData } from '../../context/skip-links/types';
|
|
|
8
8
|
* The label is used as the heading of the skip links container. If the provided label is a string
|
|
9
9
|
* comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
|
|
12
12
|
*/
|
|
13
|
-
export declare function SkipLinksContainer({ label, testId, links, }: {
|
|
13
|
+
export declare function SkipLinksContainer({ label, triggerLabel, testId, links, }: {
|
|
14
14
|
label: string;
|
|
15
|
+
triggerLabel: string;
|
|
15
16
|
testId?: string;
|
|
16
17
|
links: Array<SkipLinkData>;
|
|
17
18
|
}): JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SkipLinkData } from '../../context/skip-links/types';
|
|
2
|
+
/**
|
|
3
|
+
* Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
|
|
4
|
+
* control opens a dialog listing skip targets.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SkipLinksPopup({ label: title, triggerLabel, testId, links, }: {
|
|
7
|
+
label: string;
|
|
8
|
+
triggerLabel: string;
|
|
9
|
+
testId?: string;
|
|
10
|
+
links: Array<SkipLinkData>;
|
|
11
|
+
}): JSX.Element;
|
|
@@ -5,8 +5,9 @@ import React, { type ReactNode } from 'react';
|
|
|
5
5
|
* - Provides the context to register/unregister skip links
|
|
6
6
|
* - Renders the skip links container
|
|
7
7
|
*/
|
|
8
|
-
export declare function SkipLinksProvider({ children, label, testId, }: {
|
|
8
|
+
export declare function SkipLinksProvider({ children, label, triggerLabel, testId, }: {
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
label: string;
|
|
11
|
+
triggerLabel: string;
|
|
11
12
|
testId?: string;
|
|
12
13
|
}): React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
|
|
|
9
9
|
* The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
|
|
10
10
|
* @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
|
|
11
11
|
*/
|
|
12
|
-
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
|
|
12
|
+
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, skipLinksTriggerLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
|
|
13
13
|
/**
|
|
14
14
|
* For rendering the layout areas, e.g. TopNav, SideNav, Main.
|
|
15
15
|
* They should be rendered as immediate children.
|
|
@@ -31,6 +31,10 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
|
|
|
31
31
|
* The header text for the skip links container element.
|
|
32
32
|
*/
|
|
33
33
|
skipLinksLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The label for the skip links button that opens the skip links popup.
|
|
36
|
+
*/
|
|
37
|
+
skipLinksTriggerLabel?: string;
|
|
34
38
|
/**
|
|
35
39
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
36
40
|
*/
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
6
|
import type { SkipLinkData } from '../../context/skip-links/types';
|
|
7
|
+
type SkipLinkProps = {
|
|
8
|
+
id: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
|
|
11
|
+
};
|
|
7
12
|
/**
|
|
8
13
|
* A link that moves current tab position to a different element
|
|
9
14
|
*
|
|
10
15
|
* This component is rendered internally and is not exported publicly.
|
|
11
16
|
*/
|
|
12
|
-
export declare const SkipLink: ({ id, children, onBeforeNavigate
|
|
13
|
-
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
|
|
16
|
-
}) => JSX.Element;
|
|
17
|
+
export declare const SkipLink: ({ id, children, onBeforeNavigate }: SkipLinkProps) => JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -8,10 +8,11 @@ import { type SkipLinkData } from '../../context/skip-links/types';
|
|
|
8
8
|
* The label is used as the heading of the skip links container. If the provided label is a string
|
|
9
9
|
* comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
|
|
12
12
|
*/
|
|
13
|
-
export declare function SkipLinksContainer({ label, testId, links, }: {
|
|
13
|
+
export declare function SkipLinksContainer({ label, triggerLabel, testId, links, }: {
|
|
14
14
|
label: string;
|
|
15
|
+
triggerLabel: string;
|
|
15
16
|
testId?: string;
|
|
16
17
|
links: Array<SkipLinkData>;
|
|
17
18
|
}): JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SkipLinkData } from '../../context/skip-links/types';
|
|
2
|
+
/**
|
|
3
|
+
* Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
|
|
4
|
+
* control opens a dialog listing skip targets.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SkipLinksPopup({ label: title, triggerLabel, testId, links, }: {
|
|
7
|
+
label: string;
|
|
8
|
+
triggerLabel: string;
|
|
9
|
+
testId?: string;
|
|
10
|
+
links: Array<SkipLinkData>;
|
|
11
|
+
}): JSX.Element;
|
|
@@ -5,8 +5,9 @@ import React, { type ReactNode } from 'react';
|
|
|
5
5
|
* - Provides the context to register/unregister skip links
|
|
6
6
|
* - Renders the skip links container
|
|
7
7
|
*/
|
|
8
|
-
export declare function SkipLinksProvider({ children, label, testId, }: {
|
|
8
|
+
export declare function SkipLinksProvider({ children, label, triggerLabel, testId, }: {
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
label: string;
|
|
11
|
+
triggerLabel: string;
|
|
11
12
|
testId?: string;
|
|
12
13
|
}): React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
|
|
|
9
9
|
* The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
|
|
10
10
|
* @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
|
|
11
11
|
*/
|
|
12
|
-
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
|
|
12
|
+
export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, skipLinksTriggerLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
|
|
13
13
|
/**
|
|
14
14
|
* For rendering the layout areas, e.g. TopNav, SideNav, Main.
|
|
15
15
|
* They should be rendered as immediate children.
|
|
@@ -31,6 +31,10 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
|
|
|
31
31
|
* The header text for the skip links container element.
|
|
32
32
|
*/
|
|
33
33
|
skipLinksLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The label for the skip links button that opens the skip links popup.
|
|
36
|
+
*/
|
|
37
|
+
skipLinksTriggerLabel?: string;
|
|
34
38
|
/**
|
|
35
39
|
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
36
40
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
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",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@atlaskit/side-nav-items": "^1.13.0",
|
|
88
88
|
"@atlaskit/tokens": "^13.0.0",
|
|
89
89
|
"@atlaskit/tooltip": "^21.2.0",
|
|
90
|
-
"@atlaskit/visually-hidden": "^3.
|
|
90
|
+
"@atlaskit/visually-hidden": "^3.1.0",
|
|
91
91
|
"@babel/runtime": "^7.0.0",
|
|
92
92
|
"@compiled/react": "^0.20.0",
|
|
93
93
|
"bind-event-listener": "^3.0.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@af/integration-testing": "workspace:^",
|
|
104
104
|
"@af/visual-regression": "workspace:^",
|
|
105
105
|
"@atlaskit/badge": "^18.6.0",
|
|
106
|
-
"@atlaskit/banner": "^14.
|
|
106
|
+
"@atlaskit/banner": "^14.1.0",
|
|
107
107
|
"@atlaskit/breadcrumbs": "^16.1.0",
|
|
108
108
|
"@atlaskit/dropdown-menu": "^16.8.0",
|
|
109
109
|
"@atlaskit/form": "^15.5.0",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@atlaskit/menu": "^8.5.0",
|
|
114
114
|
"@atlaskit/modal-dialog": "^14.18.0",
|
|
115
115
|
"@atlaskit/onboarding": "^14.6.0",
|
|
116
|
-
"@atlaskit/page-header": "^12.
|
|
116
|
+
"@atlaskit/page-header": "^12.2.0",
|
|
117
117
|
"@atlaskit/page-layout": "^4.3.0",
|
|
118
118
|
"@atlaskit/popper": "^7.2.0",
|
|
119
119
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
124
124
|
"@atlassian/gemini": "^1.44.0",
|
|
125
125
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
126
|
-
"@atlassian/search-dialog": "^10.
|
|
126
|
+
"@atlassian/search-dialog": "^10.1.0",
|
|
127
127
|
"@atlassian/ssr-tests": "workspace:^",
|
|
128
128
|
"@atlassian/test-utils": "^1.0.0",
|
|
129
129
|
"@atlassian/testing-library": "^0.5.0",
|
|
@@ -163,9 +163,6 @@
|
|
|
163
163
|
"navx-full-height-sidebar": {
|
|
164
164
|
"type": "boolean"
|
|
165
165
|
},
|
|
166
|
-
"platform_themed_button_use_icon_renderer": {
|
|
167
|
-
"type": "boolean"
|
|
168
|
-
},
|
|
169
166
|
"platform_dst_button_chevron_sizing": {
|
|
170
167
|
"type": "boolean"
|
|
171
168
|
},
|