@atlaskit/help 7.10.12 → 7.11.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 (44) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/analytics.js +1 -1
  3. package/dist/cjs/components/Article/ArticleLoadingFail/index.js +1 -1
  4. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  5. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  6. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  7. package/dist/cjs/components/Article/HelpArticle/index.js +1 -1
  8. package/dist/cjs/components/Article/WhatsNewArticle/index.js +1 -1
  9. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +1 -1
  10. package/dist/cjs/components/HelpContentButton/index.js +11 -1
  11. package/dist/cjs/components/RelatedArticles/index.js +1 -1
  12. package/dist/cjs/components/Search/SearchInput/index.js +1 -1
  13. package/dist/cjs/components/Search/SearchResults/index.js +37 -1
  14. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +1 -1
  15. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  16. package/dist/es2019/analytics.js +1 -1
  17. package/dist/es2019/components/Article/ArticleLoadingFail/index.js +1 -1
  18. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  19. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  20. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  21. package/dist/es2019/components/Article/HelpArticle/index.js +1 -1
  22. package/dist/es2019/components/Article/WhatsNewArticle/index.js +1 -1
  23. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +1 -1
  24. package/dist/es2019/components/HelpContentButton/index.js +11 -1
  25. package/dist/es2019/components/RelatedArticles/index.js +1 -1
  26. package/dist/es2019/components/Search/SearchInput/index.js +1 -1
  27. package/dist/es2019/components/Search/SearchResults/index.js +34 -2
  28. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +1 -1
  29. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  30. package/dist/esm/analytics.js +1 -1
  31. package/dist/esm/components/Article/ArticleLoadingFail/index.js +1 -1
  32. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulNoButton.js +1 -1
  33. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/WasHelpfulYesButton.js +1 -1
  34. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +1 -1
  35. package/dist/esm/components/Article/HelpArticle/index.js +1 -1
  36. package/dist/esm/components/Article/WhatsNewArticle/index.js +1 -1
  37. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +1 -1
  38. package/dist/esm/components/HelpContentButton/index.js +11 -1
  39. package/dist/esm/components/RelatedArticles/index.js +1 -1
  40. package/dist/esm/components/Search/SearchInput/index.js +1 -1
  41. package/dist/esm/components/Search/SearchResults/index.js +38 -2
  42. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +1 -1
  43. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/index.js +1 -1
  44. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/help
2
2
 
3
+ ## 7.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#165991](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165991)
8
+ [`d79acd356e171`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d79acd356e171) -
9
+ a11y changes
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 7.10.13
16
+
17
+ ### Patch Changes
18
+
19
+ - [#166004](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/166004)
20
+ [`7e18c21c38822`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7e18c21c38822) -
21
+ added live region to announce search results updates for screen reader users
22
+
3
23
  ## 7.10.12
4
24
 
5
25
  ### Patch Changes
@@ -14,5 +14,5 @@ var createAndFire = exports.createAndFire = x.createAndFireEvent('atlaskit');
14
14
  var defaultAnalyticsAttributes = exports.defaultAnalyticsAttributes = {
15
15
  componentName: 'help',
16
16
  packageName: "@atlaskit/help",
17
- packageVersion: "7.10.12"
17
+ packageVersion: "7.11.0"
18
18
  };
@@ -15,7 +15,7 @@ var _styled = require("./styled");
15
15
  var ANALYTICS_CONTEXT_DATA = {
16
16
  componentName: 'ArticleLoadingFail',
17
17
  packageName: "@atlaskit/help",
18
- packageVersion: "7.10.12"
18
+ packageVersion: "7.11.0"
19
19
  };
20
20
  var ArticleLoadingFail = exports.ArticleLoadingFail = function ArticleLoadingFail(_ref) {
21
21
  var onTryAgainButtonClick = _ref.onTryAgainButtonClick,
@@ -13,7 +13,7 @@ var _messages = require("../../../../messages");
13
13
  var ANALYTICS_CONTEXT_DATA = {
14
14
  componentName: 'ArticleWasHelpfulNoButton',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.10.12"
16
+ packageVersion: "7.11.0"
17
17
  };
18
18
  var ArticleWasHelpfulNoButton = exports.ArticleWasHelpfulNoButton = function ArticleWasHelpfulNoButton(_ref) {
19
19
  var _ref$isSelected = _ref.isSelected,
@@ -13,7 +13,7 @@ var _messages = require("../../../../messages");
13
13
  var ANALYTICS_CONTEXT_DATA = {
14
14
  componentName: 'ArticleWasHelpfulYesButton',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.10.12"
16
+ packageVersion: "7.11.0"
17
17
  };
18
18
  var ArticleWasHelpfulYesButton = exports.ArticleWasHelpfulYesButton = function ArticleWasHelpfulYesButton(_ref) {
19
19
  var _ref$isSelected = _ref.isSelected,
@@ -42,7 +42,7 @@ var FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
42
42
  var ANALYTICS_CONTEXT_DATA = {
43
43
  componentName: 'ArticleWasHelpfulForm',
44
44
  packageName: "@atlaskit/help",
45
- packageVersion: "7.10.12"
45
+ packageVersion: "7.11.0"
46
46
  };
47
47
  var buttonStyles = (0, _react2.css)({
48
48
  padding: '0',
@@ -65,7 +65,7 @@ var HelpArticle = exports.HelpArticle = function HelpArticle(_ref) {
65
65
  analyticsEvent.payload.attributes = {
66
66
  componentName: 'Article',
67
67
  packageName: "@atlaskit/help",
68
- packageVersion: "7.10.12"
68
+ packageVersion: "7.11.0"
69
69
  };
70
70
  if (onRelatedArticlesShowMoreClick) {
71
71
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -22,7 +22,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
22
22
  var analyticsContextData = {
23
23
  componentName: 'ArticlesListItem',
24
24
  packageName: "@atlaskit/help",
25
- packageVersion: "7.10.12"
25
+ packageVersion: "7.11.0"
26
26
  };
27
27
  var WhatsNewArticle = exports.WhatsNewArticle = function WhatsNewArticle(_ref) {
28
28
  var formatMessage = _ref.intl.formatMessage,
@@ -18,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
18
18
  var ANALYTICS_CONTEXT_DATA = {
19
19
  componentName: 'ArticlesListItem',
20
20
  packageName: "@atlaskit/help",
21
- packageVersion: "7.10.12"
21
+ packageVersion: "7.11.0"
22
22
  };
23
23
  var highlightText = function highlightText(text) {
24
24
  if (!text) {
@@ -17,7 +17,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
17
17
  var analitycsContextData = {
18
18
  componentName: 'HelpContentButton',
19
19
  packageName: "@atlaskit/help",
20
- packageVersion: "7.10.12"
20
+ packageVersion: "7.11.0"
21
21
  };
22
22
  var HelpContentButton = function HelpContentButton(_ref) {
23
23
  var _ref$id = _ref.id,
@@ -40,6 +40,14 @@ var HelpContentButton = function HelpContentButton(_ref) {
40
40
  onClick(id, analyticsEvent, event);
41
41
  }
42
42
  }, [createAnalyticsEvent, id, onClick]);
43
+ var handleKeyDown = (0, _react.useCallback)(function (event) {
44
+ if (event.key === 'Enter' && onClick) {
45
+ var analyticsEvent = createAnalyticsEvent({
46
+ action: 'clicked'
47
+ });
48
+ onClick(id, analyticsEvent, event);
49
+ }
50
+ }, [createAnalyticsEvent, id, onClick]);
43
51
  var buttonContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styled.HelpContentButtonIcon, null, icon), /*#__PURE__*/_react.default.createElement(_styled.HelpContentButtonText, null, text, notificationLogProvider !== null && /*#__PURE__*/_react.default.createElement(_styled.HelpContentButtonExternalNotificationIcon, null, /*#__PURE__*/_react.default.createElement(_notificationIndicator.NotificationIndicator, {
44
52
  notificationLogProvider: notificationLogProvider,
45
53
  max: notificationMax,
@@ -55,8 +63,10 @@ var HelpContentButton = function HelpContentButton(_ref) {
55
63
  data: analitycsContextData
56
64
  }, /*#__PURE__*/_react.default.createElement(_styled.HelpContentButtonContainer, {
57
65
  onClick: handleOnClick,
66
+ onKeyDown: handleKeyDown,
58
67
  href: href,
59
68
  id: id,
69
+ tabIndex: 0,
60
70
  target: href && '_blank'
61
71
  }, tooltipText ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
62
72
  content: tooltipText,
@@ -33,7 +33,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
33
33
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
34
34
 
35
35
  var packageName = "@atlaskit/help";
36
- var packageVersion = "7.10.12";
36
+ var packageVersion = "7.11.0";
37
37
  var buttonStyles = (0, _react2.css)({
38
38
  padding: '0',
39
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -32,7 +32,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
32
32
  var ANALYTICS_CONTEXT_DATA = {
33
33
  componentName: 'searchInput',
34
34
  packageName: "@atlaskit/help",
35
- packageVersion: "7.10.12"
35
+ packageVersion: "7.11.0"
36
36
  };
37
37
  var buttonStyles = (0, _react2.css)({
38
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = exports.SearchResults = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _reactTransitionGroup = require("react-transition-group");
12
13
  var _Requests = require("../../../model/Requests");
@@ -71,13 +72,48 @@ var SearchResults = exports.SearchResults = function SearchResults() {
71
72
  }
72
73
  onSearchResultItemClick(event, analyticsEvent, articleData);
73
74
  }, [onSearchResultItemClick, openArticle, openExternalSearchUrlInNewTab]);
75
+ var _useState = (0, _react.useState)(0),
76
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
77
+ suggestionsCount = _useState2[0],
78
+ setSuggestionsCount = _useState2[1];
79
+ var liveRegionRef = (0, _react.useRef)(null);
80
+ (0, _react.useEffect)(function () {
81
+ if (searchResult) {
82
+ setSuggestionsCount(searchResult.length);
83
+ } else {
84
+ setSuggestionsCount(0);
85
+ }
86
+ }, [searchResult]);
74
87
  return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
75
88
  in: view === _constants.VIEW.SEARCH && isSearchResultVisible,
76
89
  timeout: _constants.FADEIN_OVERLAY_TRANSITION_DURATION_MS
77
90
  }, function (state) {
78
91
  return /*#__PURE__*/_react.default.createElement(_styled.SearchResultsContainer, {
79
92
  style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
80
- }, searchState !== _Requests.REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SearchResults.default, {
93
+ }, /*#__PURE__*/_react.default.createElement("div", {
94
+ ref: liveRegionRef,
95
+ "aria-live": "polite",
96
+ "aria-atomic": "true",
97
+ style: {
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
99
+ position: 'absolute',
100
+ // hidden visually, but accessible
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
102
+ width: 1,
103
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
104
+ height: 1,
105
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
106
+ margin: -1,
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
108
+ border: 0,
109
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
110
+ padding: 0,
111
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
112
+ clip: 'rect(0 0 0 0)',
113
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
114
+ overflow: 'hidden'
115
+ }
116
+ }, suggestionsCount > 0 && "".concat(suggestionsCount, " suggestion").concat(suggestionsCount !== 1 ? 's' : '', " available for typed text."), suggestionsCount === 0 && 'No suggestions available.'), searchState !== _Requests.REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SearchResults.default, {
81
117
  searchResult: searchResult,
82
118
  onSearchResultItemClick: handleOnSearchResultItemClick
83
119
  }), /*#__PURE__*/_react.default.createElement(_SearchExternalSite.default, {
@@ -21,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
21
21
  var ANALYTICS_CONTEXT_DATA = {
22
22
  componentName: 'WhatsNewButton',
23
23
  packageName: "@atlaskit/help",
24
- packageVersion: "7.10.12"
24
+ packageVersion: "7.11.0"
25
25
  };
26
26
  var WhatsNewButton = exports.WhatsNewButton = function WhatsNewButton(_ref) {
27
27
  var productName = _ref.productName,
@@ -15,7 +15,7 @@ var _styled2 = require("./styled");
15
15
  var ANALYTICS_CONTEXT_DATA = {
16
16
  componentName: 'ArticlesListItem',
17
17
  packageName: "@atlaskit/help",
18
- packageVersion: "7.10.12"
18
+ packageVersion: "7.11.0"
19
19
  };
20
20
  var WhatsNewResultListItem = exports.WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
21
21
  var formatMessage = _ref.intl.formatMessage,
@@ -5,5 +5,5 @@ export const createAndFire = x.createAndFireEvent('atlaskit');
5
5
  export const defaultAnalyticsAttributes = {
6
6
  componentName: 'help',
7
7
  packageName: "@atlaskit/help",
8
- packageVersion: "7.10.12"
8
+ packageVersion: "7.11.0"
9
9
  };
@@ -8,7 +8,7 @@ import { LoadingErrorMessage, LoadingErrorButtonContainer } from './styled';
8
8
  const ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticleLoadingFail',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  export const ArticleLoadingFail = ({
14
14
  onTryAgainButtonClick,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulNoButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.10.12"
9
+ packageVersion: "7.11.0"
10
10
  };
11
11
  export const ArticleWasHelpfulNoButton = ({
12
12
  isSelected = false,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  const ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulYesButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.10.12"
9
+ packageVersion: "7.11.0"
10
10
  };
11
11
  export const ArticleWasHelpfulYesButton = ({
12
12
  isSelected = false,
@@ -29,7 +29,7 @@ const FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
29
29
  const ANALYTICS_CONTEXT_DATA = {
30
30
  componentName: 'ArticleWasHelpfulForm',
31
31
  packageName: "@atlaskit/help",
32
- packageVersion: "7.10.12"
32
+ packageVersion: "7.11.0"
33
33
  };
34
34
  const buttonStyles = css({
35
35
  padding: '0',
@@ -60,7 +60,7 @@ export const HelpArticle = ({
60
60
  analyticsEvent.payload.attributes = {
61
61
  componentName: 'Article',
62
62
  packageName: "@atlaskit/help",
63
- packageVersion: "7.10.12"
63
+ packageVersion: "7.11.0"
64
64
  };
65
65
  if (onRelatedArticlesShowMoreClick) {
66
66
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -13,7 +13,7 @@ import { WhatsNewTypeTitle, WhatsNewTitleText, WhatsNewIconContainer, RelatedLin
13
13
  const analyticsContextData = {
14
14
  componentName: 'ArticlesListItem',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.10.12"
16
+ packageVersion: "7.11.0"
17
17
  };
18
18
  export const WhatsNewArticle = ({
19
19
  intl: {
@@ -8,7 +8,7 @@ import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTit
8
8
  const ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  const highlightText = text => {
14
14
  if (!text) {
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  const analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "7.10.12"
10
+ packageVersion: "7.11.0"
11
11
  };
12
12
  const HelpContentButton = ({
13
13
  id = '',
@@ -30,6 +30,14 @@ const HelpContentButton = ({
30
30
  onClick(id, analyticsEvent, event);
31
31
  }
32
32
  }, [createAnalyticsEvent, id, onClick]);
33
+ const handleKeyDown = useCallback(event => {
34
+ if (event.key === 'Enter' && onClick) {
35
+ const analyticsEvent = createAnalyticsEvent({
36
+ action: 'clicked'
37
+ });
38
+ onClick(id, analyticsEvent, event);
39
+ }
40
+ }, [createAnalyticsEvent, id, onClick]);
33
41
  const buttonContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HelpContentButtonIcon, null, icon), /*#__PURE__*/React.createElement(HelpContentButtonText, null, text, notificationLogProvider !== null && /*#__PURE__*/React.createElement(HelpContentButtonExternalNotificationIcon, null, /*#__PURE__*/React.createElement(NotificationIndicator, {
34
42
  notificationLogProvider: notificationLogProvider,
35
43
  max: notificationMax,
@@ -45,8 +53,10 @@ const HelpContentButton = ({
45
53
  data: analitycsContextData
46
54
  }, /*#__PURE__*/React.createElement(HelpContentButtonContainer, {
47
55
  onClick: handleOnClick,
56
+ onKeyDown: handleKeyDown,
48
57
  href: href,
49
58
  id: id,
59
+ tabIndex: 0,
50
60
  target: href && '_blank'
51
61
  }, tooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
52
62
  content: tooltipText,
@@ -20,7 +20,7 @@ import { usePrevious } from '../../util/hooks/previous';
20
20
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
21
  import { css, jsx } from '@emotion/react';
22
22
  const packageName = "@atlaskit/help";
23
- const packageVersion = "7.10.12";
23
+ const packageVersion = "7.11.0";
24
24
  const buttonStyles = css({
25
25
  padding: '0',
26
26
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -21,7 +21,7 @@ import { SearchInputContainer, SearchIconContainer, CloseButtonAndSpinnerContain
21
21
  const ANALYTICS_CONTEXT_DATA = {
22
22
  componentName: 'searchInput',
23
23
  packageName: "@atlaskit/help",
24
- packageVersion: "7.10.12"
24
+ packageVersion: "7.11.0"
25
25
  };
26
26
  const buttonStyles = css({
27
27
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -1,4 +1,4 @@
1
- import React, { useCallback } from 'react';
1
+ import React, { useCallback, useRef, useState, useEffect } from 'react';
2
2
  import { Transition } from 'react-transition-group';
3
3
  import { REQUEST_STATE } from '../../../model/Requests';
4
4
  import { FADEIN_OVERLAY_TRANSITION_DURATION_MS, VIEW } from '../../constants';
@@ -60,6 +60,15 @@ export const SearchResults = () => {
60
60
  }
61
61
  onSearchResultItemClick(event, analyticsEvent, articleData);
62
62
  }, [onSearchResultItemClick, openArticle, openExternalSearchUrlInNewTab]);
63
+ const [suggestionsCount, setSuggestionsCount] = useState(0);
64
+ const liveRegionRef = useRef(null);
65
+ useEffect(() => {
66
+ if (searchResult) {
67
+ setSuggestionsCount(searchResult.length);
68
+ } else {
69
+ setSuggestionsCount(0);
70
+ }
71
+ }, [searchResult]);
63
72
  return /*#__PURE__*/React.createElement(Transition, {
64
73
  in: view === VIEW.SEARCH && isSearchResultVisible,
65
74
  timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS
@@ -70,7 +79,30 @@ export const SearchResults = () => {
70
79
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
71
80
  ...transitionStyles[state]
72
81
  }
73
- }, searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchResultsList, {
82
+ }, /*#__PURE__*/React.createElement("div", {
83
+ ref: liveRegionRef,
84
+ "aria-live": "polite",
85
+ "aria-atomic": "true",
86
+ style: {
87
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
88
+ position: 'absolute',
89
+ // hidden visually, but accessible
90
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
91
+ width: 1,
92
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
93
+ height: 1,
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
95
+ margin: -1,
96
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
97
+ border: 0,
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
99
+ padding: 0,
100
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
101
+ clip: 'rect(0 0 0 0)',
102
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
103
+ overflow: 'hidden'
104
+ }
105
+ }, suggestionsCount > 0 && `${suggestionsCount} suggestion${suggestionsCount !== 1 ? 's' : ''} available for typed text.`, suggestionsCount === 0 && 'No suggestions available.'), searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchResultsList, {
74
106
  searchResult: searchResult,
75
107
  onSearchResultItemClick: handleOnSearchResultItemClick
76
108
  }), /*#__PURE__*/React.createElement(SearchExternalSite, {
@@ -11,7 +11,7 @@ import { ARTICLE_TYPE } from '../../../model/Help';
11
11
  const ANALYTICS_CONTEXT_DATA = {
12
12
  componentName: 'WhatsNewButton',
13
13
  packageName: "@atlaskit/help",
14
- packageVersion: "7.10.12"
14
+ packageVersion: "7.11.0"
15
15
  };
16
16
  export const WhatsNewButton = ({
17
17
  productName,
@@ -8,7 +8,7 @@ import { WhatsNewResultListItemWrapper, WhatsNewResultListItemTitleContainer, Wh
8
8
  const ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  export const WhatsNewResultListItem = ({
14
14
  intl: {
@@ -5,5 +5,5 @@ export var createAndFire = x.createAndFireEvent('atlaskit');
5
5
  export var defaultAnalyticsAttributes = {
6
6
  componentName: 'help',
7
7
  packageName: "@atlaskit/help",
8
- packageVersion: "7.10.12"
8
+ packageVersion: "7.11.0"
9
9
  };
@@ -8,7 +8,7 @@ import { LoadingErrorMessage, LoadingErrorButtonContainer } from './styled';
8
8
  var ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticleLoadingFail',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  export var ArticleLoadingFail = function ArticleLoadingFail(_ref) {
14
14
  var onTryAgainButtonClick = _ref.onTryAgainButtonClick,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  var ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulNoButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.10.12"
9
+ packageVersion: "7.11.0"
10
10
  };
11
11
  export var ArticleWasHelpfulNoButton = function ArticleWasHelpfulNoButton(_ref) {
12
12
  var _ref$isSelected = _ref.isSelected,
@@ -6,7 +6,7 @@ import { messages } from '../../../../messages';
6
6
  var ANALYTICS_CONTEXT_DATA = {
7
7
  componentName: 'ArticleWasHelpfulYesButton',
8
8
  packageName: "@atlaskit/help",
9
- packageVersion: "7.10.12"
9
+ packageVersion: "7.11.0"
10
10
  };
11
11
  export var ArticleWasHelpfulYesButton = function ArticleWasHelpfulYesButton(_ref) {
12
12
  var _ref$isSelected = _ref.isSelected,
@@ -30,7 +30,7 @@ var FEEDBACK_REASON_TEXT_MAX_LENGTH = '16000';
30
30
  var ANALYTICS_CONTEXT_DATA = {
31
31
  componentName: 'ArticleWasHelpfulForm',
32
32
  packageName: "@atlaskit/help",
33
- packageVersion: "7.10.12"
33
+ packageVersion: "7.11.0"
34
34
  };
35
35
  var buttonStyles = css({
36
36
  padding: '0',
@@ -56,7 +56,7 @@ export var HelpArticle = function HelpArticle(_ref) {
56
56
  analyticsEvent.payload.attributes = {
57
57
  componentName: 'Article',
58
58
  packageName: "@atlaskit/help",
59
- packageVersion: "7.10.12"
59
+ packageVersion: "7.11.0"
60
60
  };
61
61
  if (onRelatedArticlesShowMoreClick) {
62
62
  onRelatedArticlesShowMoreClick(event, analyticsEvent, isCollapsed);
@@ -13,7 +13,7 @@ import { WhatsNewTypeTitle, WhatsNewTitleText, WhatsNewIconContainer, RelatedLin
13
13
  var analyticsContextData = {
14
14
  componentName: 'ArticlesListItem',
15
15
  packageName: "@atlaskit/help",
16
- packageVersion: "7.10.12"
16
+ packageVersion: "7.11.0"
17
17
  };
18
18
  export var WhatsNewArticle = function WhatsNewArticle(_ref) {
19
19
  var formatMessage = _ref.intl.formatMessage,
@@ -8,7 +8,7 @@ import { ArticlesListItemWrapper, ArticlesListItemContainer, ArticlesListItemTit
8
8
  var ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  var highlightText = function highlightText(text) {
14
14
  if (!text) {
@@ -7,7 +7,7 @@ import { HelpContentButtonContainer, HelpContentButtonIcon, HelpContentButtonTex
7
7
  var analitycsContextData = {
8
8
  componentName: 'HelpContentButton',
9
9
  packageName: "@atlaskit/help",
10
- packageVersion: "7.10.12"
10
+ packageVersion: "7.11.0"
11
11
  };
12
12
  var HelpContentButton = function HelpContentButton(_ref) {
13
13
  var _ref$id = _ref.id,
@@ -30,6 +30,14 @@ var HelpContentButton = function HelpContentButton(_ref) {
30
30
  onClick(id, analyticsEvent, event);
31
31
  }
32
32
  }, [createAnalyticsEvent, id, onClick]);
33
+ var handleKeyDown = useCallback(function (event) {
34
+ if (event.key === 'Enter' && onClick) {
35
+ var analyticsEvent = createAnalyticsEvent({
36
+ action: 'clicked'
37
+ });
38
+ onClick(id, analyticsEvent, event);
39
+ }
40
+ }, [createAnalyticsEvent, id, onClick]);
33
41
  var buttonContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HelpContentButtonIcon, null, icon), /*#__PURE__*/React.createElement(HelpContentButtonText, null, text, notificationLogProvider !== null && /*#__PURE__*/React.createElement(HelpContentButtonExternalNotificationIcon, null, /*#__PURE__*/React.createElement(NotificationIndicator, {
34
42
  notificationLogProvider: notificationLogProvider,
35
43
  max: notificationMax,
@@ -45,8 +53,10 @@ var HelpContentButton = function HelpContentButton(_ref) {
45
53
  data: analitycsContextData
46
54
  }, /*#__PURE__*/React.createElement(HelpContentButtonContainer, {
47
55
  onClick: handleOnClick,
56
+ onKeyDown: handleKeyDown,
48
57
  href: href,
49
58
  id: id,
59
+ tabIndex: 0,
50
60
  target: href && '_blank'
51
61
  }, tooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
52
62
  content: tooltipText,
@@ -23,7 +23,7 @@ import { usePrevious } from '../../util/hooks/previous';
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
24
  import { css, jsx } from '@emotion/react';
25
25
  var packageName = "@atlaskit/help";
26
- var packageVersion = "7.10.12";
26
+ var packageVersion = "7.11.0";
27
27
  var buttonStyles = css({
28
28
  padding: '0',
29
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
@@ -21,7 +21,7 @@ import { SearchInputContainer, SearchIconContainer, CloseButtonAndSpinnerContain
21
21
  var ANALYTICS_CONTEXT_DATA = {
22
22
  componentName: 'searchInput',
23
23
  packageName: "@atlaskit/help",
24
- packageVersion: "7.10.12"
24
+ packageVersion: "7.11.0"
25
25
  };
26
26
  var buttonStyles = css({
27
27
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -1,7 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  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; }
3
4
  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) { _defineProperty(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; }
4
- import React, { useCallback } from 'react';
5
+ import React, { useCallback, useRef, useState, useEffect } from 'react';
5
6
  import { Transition } from 'react-transition-group';
6
7
  import { REQUEST_STATE } from '../../../model/Requests';
7
8
  import { FADEIN_OVERLAY_TRANSITION_DURATION_MS, VIEW } from '../../constants';
@@ -61,13 +62,48 @@ export var SearchResults = function SearchResults() {
61
62
  }
62
63
  onSearchResultItemClick(event, analyticsEvent, articleData);
63
64
  }, [onSearchResultItemClick, openArticle, openExternalSearchUrlInNewTab]);
65
+ var _useState = useState(0),
66
+ _useState2 = _slicedToArray(_useState, 2),
67
+ suggestionsCount = _useState2[0],
68
+ setSuggestionsCount = _useState2[1];
69
+ var liveRegionRef = useRef(null);
70
+ useEffect(function () {
71
+ if (searchResult) {
72
+ setSuggestionsCount(searchResult.length);
73
+ } else {
74
+ setSuggestionsCount(0);
75
+ }
76
+ }, [searchResult]);
64
77
  return /*#__PURE__*/React.createElement(Transition, {
65
78
  in: view === VIEW.SEARCH && isSearchResultVisible,
66
79
  timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS
67
80
  }, function (state) {
68
81
  return /*#__PURE__*/React.createElement(SearchResultsContainer, {
69
82
  style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
70
- }, searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchResultsList, {
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ ref: liveRegionRef,
85
+ "aria-live": "polite",
86
+ "aria-atomic": "true",
87
+ style: {
88
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
89
+ position: 'absolute',
90
+ // hidden visually, but accessible
91
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
92
+ width: 1,
93
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
94
+ height: 1,
95
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
96
+ margin: -1,
97
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
98
+ border: 0,
99
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
100
+ padding: 0,
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
102
+ clip: 'rect(0 0 0 0)',
103
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
104
+ overflow: 'hidden'
105
+ }
106
+ }, suggestionsCount > 0 && "".concat(suggestionsCount, " suggestion").concat(suggestionsCount !== 1 ? 's' : '', " available for typed text."), suggestionsCount === 0 && 'No suggestions available.'), searchState !== REQUEST_STATE.error && searchResult !== null && searchResult.length > 0 && state !== 'exited' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchResultsList, {
71
107
  searchResult: searchResult,
72
108
  onSearchResultItemClick: handleOnSearchResultItemClick
73
109
  }), /*#__PURE__*/React.createElement(SearchExternalSite, {
@@ -11,7 +11,7 @@ import { ARTICLE_TYPE } from '../../../model/Help';
11
11
  var ANALYTICS_CONTEXT_DATA = {
12
12
  componentName: 'WhatsNewButton',
13
13
  packageName: "@atlaskit/help",
14
- packageVersion: "7.10.12"
14
+ packageVersion: "7.11.0"
15
15
  };
16
16
  export var WhatsNewButton = function WhatsNewButton(_ref) {
17
17
  var productName = _ref.productName,
@@ -8,7 +8,7 @@ import { WhatsNewResultListItemWrapper, WhatsNewResultListItemTitleContainer, Wh
8
8
  var ANALYTICS_CONTEXT_DATA = {
9
9
  componentName: 'ArticlesListItem',
10
10
  packageName: "@atlaskit/help",
11
- packageVersion: "7.10.12"
11
+ packageVersion: "7.11.0"
12
12
  };
13
13
  export var WhatsNewResultListItem = function WhatsNewResultListItem(_ref) {
14
14
  var formatMessage = _ref.intl.formatMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/help",
3
- "version": "7.10.12",
3
+ "version": "7.11.0",
4
4
  "description": "A cross-product help component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/form": "^10.5.0",
42
42
  "@atlaskit/help-article": "^4.2.0",
43
43
  "@atlaskit/help-layout": "^4.4.0",
44
- "@atlaskit/icon": "^22.24.0",
44
+ "@atlaskit/icon": "^22.25.0",
45
45
  "@atlaskit/legacy-custom-icons": "^0.17.0",
46
46
  "@atlaskit/notification-indicator": "^9.4.0",
47
47
  "@atlaskit/notification-log-client": "^6.1.0",