@atlaskit/link-picker 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 3.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122927](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122927)
14
+ [`1a18023f54f1c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a18023f54f1c) -
15
+ EDM-11900 adding a wrapper with correct id so aria-controls can find the right element for a11y
16
+
3
17
  ## 3.0.2
4
18
 
5
19
  ### Patch Changes
@@ -93,6 +93,7 @@ var SearchResults = exports.SearchResults = function SearchResults(_ref) {
93
93
  onKeyDown: handleKeyDown,
94
94
  hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
95
95
  activePlugin: activePlugin,
96
- adaptiveHeight: adaptiveHeight
96
+ adaptiveHeight: adaptiveHeight,
97
+ tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
97
98
  }), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(_linkSearchError.LinkSearchError, null) : null));
98
99
  };
@@ -23,7 +23,7 @@ var _handleNavKeyDown = require("../../../../common/utils/handleNavKeyDown");
23
23
  var _linkSearchNoResults = require("./link-search-no-results");
24
24
  var _listItem = require("./list-item");
25
25
  var _useTrackResultsShown = require("./use-track-results-shown");
26
- var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className"];
26
+ var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
27
27
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
28
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
29
  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; }
@@ -78,6 +78,7 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
78
78
  activePlugin = _ref.activePlugin,
79
79
  adaptiveHeight = _ref.adaptiveHeight,
80
80
  className = _ref.className,
81
+ tabPanelId = _ref.tabPanelId,
81
82
  restProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
82
83
  var itemsContent;
83
84
  var loadingContent;
@@ -123,11 +124,14 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
123
124
  var emptyState = activePlugin === null || activePlugin === void 0 || (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
124
125
  if (emptyState) {
125
126
  return /*#__PURE__*/React.createElement("div", {
127
+ id: tabPanelId,
126
128
  className: (0, _runtime.ax)([styles.emptyStateNoResultsWrapper])
127
129
  }, emptyState);
128
130
  }
129
131
  }
130
- return /*#__PURE__*/React.createElement(_linkSearchNoResults.NoResults, null);
132
+ return /*#__PURE__*/React.createElement("div", {
133
+ id: tabPanelId
134
+ }, /*#__PURE__*/React.createElement(_linkSearchNoResults.NoResults, null));
131
135
  }
132
136
  var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
133
137
  if (items && items.length > 0) {
@@ -183,6 +187,7 @@ var LinkSearchList = exports.LinkSearchList = /*#__PURE__*/(0, _react.forwardRef
183
187
  }));
184
188
  }
185
189
  return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
190
+ id: tabPanelId,
186
191
  ref: ref,
187
192
  className: (0, _runtime.ax)(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
188
193
  }, restProps), itemsContent, loadingContent);
@@ -26,7 +26,7 @@ var testIds = exports.testIds = {
26
26
  };
27
27
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
28
28
  packageName: "@atlaskit/link-picker" || '',
29
- packageVersion: "3.0.2" || '',
29
+ packageVersion: "3.0.4" || '',
30
30
  componentName: _constants.COMPONENT_NAME,
31
31
  source: _constants.COMPONENT_NAME
32
32
  };
@@ -81,6 +81,7 @@ export const SearchResults = ({
81
81
  onKeyDown: handleKeyDown,
82
82
  hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
83
83
  activePlugin: activePlugin,
84
- adaptiveHeight: adaptiveHeight
84
+ adaptiveHeight: adaptiveHeight,
85
+ tabPanelId: `${testIds.tabList}-${activeTab}-tab`
85
86
  }), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(LinkSearchError, null) : null));
86
87
  };
@@ -64,6 +64,7 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
64
64
  activePlugin,
65
65
  adaptiveHeight,
66
66
  className,
67
+ tabPanelId,
67
68
  ...restProps
68
69
  }, ref) => {
69
70
  var _activePlugin$uiOptio;
@@ -111,11 +112,14 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
111
112
  const emptyState = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
112
113
  if (emptyState) {
113
114
  return /*#__PURE__*/React.createElement("div", {
115
+ id: tabPanelId,
114
116
  className: ax([styles.emptyStateNoResultsWrapper])
115
117
  }, emptyState);
116
118
  }
117
119
  }
118
- return /*#__PURE__*/React.createElement(NoResults, null);
120
+ return /*#__PURE__*/React.createElement("div", {
121
+ id: tabPanelId
122
+ }, /*#__PURE__*/React.createElement(NoResults, null));
119
123
  }
120
124
  const listItemNameMaxLines = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
121
125
  if (items && items.length > 0) {
@@ -165,6 +169,7 @@ export const LinkSearchList = /*#__PURE__*/forwardRef(({
165
169
  }));
166
170
  }
167
171
  return /*#__PURE__*/React.createElement("div", _extends({
172
+ id: tabPanelId,
168
173
  ref: ref,
169
174
  className: ax(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
170
175
  }, restProps), itemsContent, loadingContent);
@@ -15,7 +15,7 @@ export const testIds = {
15
15
  };
16
16
  export const PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/link-picker" || '',
18
- packageVersion: "3.0.2" || '',
18
+ packageVersion: "3.0.4" || '',
19
19
  componentName: COMPONENT_NAME,
20
20
  source: COMPONENT_NAME
21
21
  };
@@ -83,6 +83,7 @@ export var SearchResults = function SearchResults(_ref) {
83
83
  onKeyDown: handleKeyDown,
84
84
  hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
85
85
  activePlugin: activePlugin,
86
- adaptiveHeight: adaptiveHeight
86
+ adaptiveHeight: adaptiveHeight,
87
+ tabPanelId: "".concat(testIds.tabList, "-").concat(activeTab, "-tab")
87
88
  }), error ? (_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : /*#__PURE__*/React.createElement(LinkSearchError, null) : null));
88
89
  };
@@ -2,7 +2,7 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className"];
5
+ var _excluded = ["onChange", "onSelect", "onKeyDown", "items", "activeIndex", "selectedIndex", "isLoading", "ariaControls", "ariaLabelledBy", "ariaReadOnly", "role", "id", "hasSearchTerm", "activePlugin", "adaptiveHeight", "className", "tabPanelId"];
6
6
  import "./index.compiled.css";
7
7
  import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
@@ -68,6 +68,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
68
68
  activePlugin = _ref.activePlugin,
69
69
  adaptiveHeight = _ref.adaptiveHeight,
70
70
  className = _ref.className,
71
+ tabPanelId = _ref.tabPanelId,
71
72
  restProps = _objectWithoutProperties(_ref, _excluded);
72
73
  var itemsContent;
73
74
  var loadingContent;
@@ -113,11 +114,14 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
113
114
  var emptyState = activePlugin === null || activePlugin === void 0 || (_activePlugin$emptySt = activePlugin.emptyStateNoResults) === null || _activePlugin$emptySt === void 0 ? void 0 : _activePlugin$emptySt.call(activePlugin);
114
115
  if (emptyState) {
115
116
  return /*#__PURE__*/React.createElement("div", {
117
+ id: tabPanelId,
116
118
  className: ax([styles.emptyStateNoResultsWrapper])
117
119
  }, emptyState);
118
120
  }
119
121
  }
120
- return /*#__PURE__*/React.createElement(NoResults, null);
122
+ return /*#__PURE__*/React.createElement("div", {
123
+ id: tabPanelId
124
+ }, /*#__PURE__*/React.createElement(NoResults, null));
121
125
  }
122
126
  var listItemNameMaxLines = activePlugin === null || activePlugin === void 0 || (_activePlugin$uiOptio = activePlugin.uiOptions) === null || _activePlugin$uiOptio === void 0 ? void 0 : _activePlugin$uiOptio.listItemNameMaxLines;
123
127
  if (items && items.length > 0) {
@@ -173,6 +177,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
173
177
  }));
174
178
  }
175
179
  return /*#__PURE__*/React.createElement("div", _extends({
180
+ id: tabPanelId,
176
181
  ref: ref,
177
182
  className: ax(["_1bsb1osq _ca0qidpf _1tkeys9h _19pkpxbi _otyrpxbi _16jlkb7n _1e0c1txw _2lx21bp4", className])
178
183
  }, restProps), itemsContent, loadingContent);
@@ -16,7 +16,7 @@ export var testIds = {
16
16
  };
17
17
  export var PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/link-picker" || '',
19
- packageVersion: "3.0.2" || '',
19
+ packageVersion: "3.0.4" || '',
20
20
  componentName: COMPONENT_NAME,
21
21
  source: COMPONENT_NAME
22
22
  };
@@ -47,6 +47,8 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
47
47
  id?: string;
48
48
  hasSearchTerm?: boolean;
49
49
  activePlugin?: LinkPickerPlugin;
50
+ /** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
51
+ tabPanelId?: string;
50
52
  }
51
53
  export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
52
54
  export {};
@@ -47,6 +47,8 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<LinkSearc
47
47
  id?: string;
48
48
  hasSearchTerm?: boolean;
49
49
  activePlugin?: LinkPickerPlugin;
50
+ /** Because we don't use the DST TabPanels component, tabPanelId is needed to set the correct aria-controls for a11y. */
51
+ tabPanelId?: string;
50
52
  }
51
53
  export declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
52
54
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/form": "^12.0.0",
53
53
  "@atlaskit/frontend-utilities": "^3.0.0",
54
54
  "@atlaskit/heading": "^5.1.0",
55
- "@atlaskit/icon": "^24.1.0",
55
+ "@atlaskit/icon": "^25.0.0",
56
56
  "@atlaskit/intl-messages-provider": "^2.0.0",
57
57
  "@atlaskit/linking-common": "^8.0.0",
58
58
  "@atlaskit/onboarding": "^13.0.0",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/tabs": "^18.0.0",
63
63
  "@atlaskit/textfield": "^8.0.0",
64
64
  "@atlaskit/theme": "^18.0.0",
65
- "@atlaskit/tokens": "^4.3.0",
65
+ "@atlaskit/tokens": "^4.4.0",
66
66
  "@atlaskit/tooltip": "^20.0.0",
67
67
  "@atlaskit/ufo": "^0.4.0",
68
68
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -80,13 +80,13 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@af/analytics-codegen": "^0.1.0",
83
- "@af/integration-testing": "*",
84
- "@af/visual-regression": "*",
83
+ "@af/integration-testing": "^0.5.0",
84
+ "@af/visual-regression": "^1.3.0",
85
85
  "@atlaskit/dropdown-menu": "^13.0.0",
86
86
  "@atlaskit/link-provider": "^2.0.0",
87
87
  "@atlaskit/link-test-helpers": "^8.0.0",
88
- "@atlaskit/visual-regression": "*",
89
- "@atlassian/feature-flags-test-utils": "*",
88
+ "@atlaskit/visual-regression": "^0.10.0",
89
+ "@atlassian/feature-flags-test-utils": "^0.3.0",
90
90
  "@testing-library/dom": "^10.1.0",
91
91
  "@testing-library/jest-dom": "^6.4.5",
92
92
  "@testing-library/react": "^13.4.0",