@atlaskit/help 6.0.8 → 7.1.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 (95) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/assets/ErrorImage.js +1 -1
  3. package/dist/cjs/assets/NotFoundImage.js +1 -1
  4. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/index.js +3 -1
  5. package/dist/cjs/components/Article/HelpArticle/WasHelpfulForm/styled.js +3 -1
  6. package/dist/cjs/components/Article/HelpArticle/index.js +6 -8
  7. package/dist/cjs/components/Article/WhatsNewArticle/styled.js +5 -3
  8. package/dist/cjs/components/Article/index.js +2 -2
  9. package/dist/cjs/components/Article/styled.js +3 -1
  10. package/dist/cjs/components/ArticlesList/ArticlesList.js +4 -2
  11. package/dist/cjs/components/ArticlesList/ArticlesListItem/index.js +4 -2
  12. package/dist/cjs/components/ArticlesList/ArticlesListItem/styled.js +10 -7
  13. package/dist/cjs/components/Help.js +3 -1
  14. package/dist/cjs/components/HelpContentButton/styled.js +3 -1
  15. package/dist/cjs/components/RelatedArticles/styled.js +3 -1
  16. package/dist/cjs/components/Search/SearchResults/SearchExternalSite.js +4 -2
  17. package/dist/cjs/components/Search/SearchResults/SearchResultsEmpty.js +4 -2
  18. package/dist/cjs/components/Search/SearchResults/index.js +8 -11
  19. package/dist/cjs/components/Search/SearchResults/styled.js +5 -3
  20. package/dist/cjs/components/WhatsNew/WhatsNewButton/index.js +9 -9
  21. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +3 -1
  22. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +3 -1
  23. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +8 -5
  24. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +3 -1
  25. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  26. package/dist/cjs/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +3 -1
  27. package/dist/cjs/components/WhatsNew/WhatsNewResults/index.js +33 -6
  28. package/dist/cjs/components/WhatsNew/WhatsNewResults/styled.js +3 -1
  29. package/dist/cjs/components/contexts/navigationContext.js +111 -50
  30. package/dist/cjs/util/styled.js +11 -9
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/assets/ErrorImage.js +1 -1
  33. package/dist/es2019/assets/NotFoundImage.js +1 -1
  34. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -1
  35. package/dist/es2019/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -1
  36. package/dist/es2019/components/Article/HelpArticle/index.js +6 -8
  37. package/dist/es2019/components/Article/WhatsNewArticle/styled.js +4 -3
  38. package/dist/es2019/components/Article/styled.js +2 -1
  39. package/dist/es2019/components/ArticlesList/ArticlesList.js +3 -2
  40. package/dist/es2019/components/ArticlesList/ArticlesListItem/index.js +3 -2
  41. package/dist/es2019/components/ArticlesList/ArticlesListItem/styled.js +9 -7
  42. package/dist/es2019/components/HelpContentButton/styled.js +6 -5
  43. package/dist/es2019/components/RelatedArticles/styled.js +2 -1
  44. package/dist/es2019/components/Search/SearchResults/SearchExternalSite.js +3 -2
  45. package/dist/es2019/components/Search/SearchResults/SearchResultsEmpty.js +3 -2
  46. package/dist/es2019/components/Search/SearchResults/index.js +6 -9
  47. package/dist/es2019/components/Search/SearchResults/styled.js +4 -3
  48. package/dist/es2019/components/WhatsNew/WhatsNewButton/index.js +8 -9
  49. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +2 -1
  50. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +2 -1
  51. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +7 -5
  52. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -1
  53. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  54. package/dist/es2019/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +2 -1
  55. package/dist/es2019/components/WhatsNew/WhatsNewResults/index.js +31 -5
  56. package/dist/es2019/components/WhatsNew/WhatsNewResults/styled.js +2 -1
  57. package/dist/es2019/components/contexts/navigationContext.js +99 -39
  58. package/dist/es2019/util/styled.js +16 -15
  59. package/dist/es2019/version.json +1 -1
  60. package/dist/esm/assets/ErrorImage.js +1 -1
  61. package/dist/esm/assets/NotFoundImage.js +1 -1
  62. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/index.js +2 -1
  63. package/dist/esm/components/Article/HelpArticle/WasHelpfulForm/styled.js +2 -1
  64. package/dist/esm/components/Article/HelpArticle/index.js +6 -8
  65. package/dist/esm/components/Article/WhatsNewArticle/styled.js +4 -3
  66. package/dist/esm/components/Article/index.js +2 -2
  67. package/dist/esm/components/Article/styled.js +2 -1
  68. package/dist/esm/components/ArticlesList/ArticlesList.js +3 -2
  69. package/dist/esm/components/ArticlesList/ArticlesListItem/index.js +3 -2
  70. package/dist/esm/components/ArticlesList/ArticlesListItem/styled.js +9 -7
  71. package/dist/esm/components/Help.js +2 -1
  72. package/dist/esm/components/HelpContentButton/styled.js +2 -1
  73. package/dist/esm/components/RelatedArticles/styled.js +2 -1
  74. package/dist/esm/components/Search/SearchResults/SearchExternalSite.js +3 -2
  75. package/dist/esm/components/Search/SearchResults/SearchResultsEmpty.js +3 -2
  76. package/dist/esm/components/Search/SearchResults/index.js +8 -11
  77. package/dist/esm/components/Search/SearchResults/styled.js +4 -3
  78. package/dist/esm/components/WhatsNew/WhatsNewButton/index.js +8 -9
  79. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsEmpty/styled.js +2 -1
  80. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsError/styled.js +2 -1
  81. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultItem/styled.js +7 -5
  82. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/WhatsNewResultsList.js +2 -1
  83. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/index.js +6 -8
  84. package/dist/esm/components/WhatsNew/WhatsNewResults/WhatsNewResultsList/styled.js +2 -1
  85. package/dist/esm/components/WhatsNew/WhatsNewResults/index.js +33 -7
  86. package/dist/esm/components/WhatsNew/WhatsNewResults/styled.js +2 -1
  87. package/dist/esm/components/contexts/navigationContext.js +108 -50
  88. package/dist/esm/util/styled.js +10 -9
  89. package/dist/esm/version.json +1 -1
  90. package/dist/types/assets/ErrorImage.d.ts +1 -1
  91. package/dist/types/assets/NotFoundImage.d.ts +1 -1
  92. package/dist/types/components/RelatedArticles/styled.d.ts +1 -1
  93. package/dist/types/components/contexts/navigationContext.d.ts +12 -7
  94. package/dist/types/model/Help.d.ts +8 -4
  95. package/package.json +10 -4
@@ -14,7 +14,7 @@ export const HelpArticle = ({
14
14
  isLoading
15
15
  }) => {
16
16
  const {
17
- setArticleId,
17
+ openArticle,
18
18
  getCurrentArticleItemData
19
19
  } = useNavigationContext();
20
20
  const {
@@ -56,13 +56,11 @@ export const HelpArticle = ({
56
56
  onRelatedArticlesListItemClick(event, analyticsEvent, articleData);
57
57
  }
58
58
 
59
- if (setArticleId) {
60
- setArticleId({
61
- id: articleData.id,
62
- type: ARTICLE_TYPE.HELP_ARTICLE
63
- });
64
- }
65
- }, [setArticleId, onRelatedArticlesListItemClick]);
59
+ openArticle({
60
+ id: articleData.id,
61
+ type: ARTICLE_TYPE.HELP_ARTICLE
62
+ });
63
+ }, [openArticle, onRelatedArticlesListItemClick]);
66
64
  const handleOnRelatedArticlesShowMoreClick = useCallback((event, analyticsEvent, isCollapsed) => {
67
65
  analyticsEvent.payload.attributes = {
68
66
  componentName: 'Article',
@@ -2,9 +2,10 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { fontSize, fontSizeSmall, gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const WhatsNewTypeTitle = styled.span`
6
7
  text-decoration: none;
7
- color: ${colors.N300};
8
+ color: ${token('color.text.subtlest', colors.N300)};
8
9
  font-size: ${fontSize()}px;
9
10
  vertical-align: middle;
10
11
  padding-left: ${gridSize() / 2}px;
@@ -18,7 +19,7 @@ export const WhatsNewIconContainer = styled.div`
18
19
  `;
19
20
  export const WhatsNewTitleText = styled.span`
20
21
  text-decoration: none;
21
- color: ${colors.N800};
22
+ color: ${token('color.text', colors.N800)};
22
23
  font-size: ${fontSize()}px;
23
24
  font-weight: 600;
24
25
  white-space: normal;
@@ -28,7 +29,7 @@ export const WhatsNewTitleText = styled.span`
28
29
  `;
29
30
  export const WhatsNewRelatedLinksTitleText = styled.span`
30
31
  text-decoration: none;
31
- color: ${colors.N800};
32
+ color: ${token('color.text', colors.N800)};
32
33
  font-size: ${fontSizeSmall()}px;
33
34
  font-weight: 600;
34
35
  white-space: normal;
@@ -1,13 +1,14 @@
1
1
  /** @jsx jsx */
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const ArticleContainer = styled.div`
5
6
  padding: ${gridSize() * 2}px ${gridSize() * 3}px;
6
7
  position: absolute;
7
8
  height: 100%;
8
9
  width: 100%;
9
10
  top: 0;
10
- background-color: #ffffff;
11
+ background-color: ${token('elevation.surface', '#FFFFFF')};
11
12
  left: 100%;
12
13
  flex: 1;
13
14
  flex-direction: column;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { gridSize } from '@atlaskit/theme/constants';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
+ import { token } from '@atlaskit/tokens';
4
5
  import AnimateHeight from 'react-animate-height';
5
6
  import ArticlesListItem from './ArticlesListItem';
6
7
  import { MIN_ITEMS_TO_DISPLAY, ANIMATE_HEIGHT_TRANSITION_DURATION_MS } from './constants';
@@ -14,7 +15,7 @@ const articlesList = ({
14
15
  }) => articles && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, articles.slice(0, minItemsToDisplay).map((article, i) => {
15
16
  return /*#__PURE__*/React.createElement(ArticlesListItem, {
16
17
  styles: {
17
- border: style === 'secondary' ? `2px solid ${colors.N30}` : 0,
18
+ border: style === 'secondary' ? `2px solid ${token('color.border', colors.N30)}` : 0,
18
19
  padding: style === 'secondary' ? `${gridSize()}px ${gridSize() * 2}px` : `${gridSize()}px`,
19
20
  marginBottom: style === 'secondary' ? `${gridSize() * 1.5}px` : 0
20
21
  },
@@ -35,7 +36,7 @@ const articlesList = ({
35
36
  height: numberOfArticlesToDisplay > minItemsToDisplay ? 'auto' : 0
36
37
  }, articles.slice(minItemsToDisplay, articles.length).map((article, i) => /*#__PURE__*/React.createElement(ArticlesListItem, {
37
38
  styles: {
38
- border: style === 'secondary' ? `2px solid ${colors.N30}` : 0,
39
+ border: style === 'secondary' ? `2px solid ${token('color.border', colors.N30)}` : 0,
39
40
  padding: style === 'secondary' ? `${gridSize()}px ${gridSize() * 2}px` : `${gridSize()}px`,
40
41
  marginBottom: style === 'secondary' ? `${gridSize() * 1.5}px` : 0
41
42
  },
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import * as colors from '@atlaskit/theme/colors';
3
3
  import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
4
4
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { injectIntl } from 'react-intl-next';
6
7
  import { name as packageName, version as packageVersion } from '../../../version.json';
7
8
  // import { messages } from '../../../messages';
@@ -55,8 +56,8 @@ export const ArticlesListItem = ({
55
56
  }, /*#__PURE__*/React.createElement(ArticlesListItemContainer, null, typeTitle && /*#__PURE__*/React.createElement(ArticlesListItemTypeTitle, null, formatMessage(typeTitle)), /*#__PURE__*/React.createElement(ArticlesListItemTitleText, null, title), href && /*#__PURE__*/React.createElement(ArticlesListItemLinkIcon, null, /*#__PURE__*/React.createElement(ShortcutIcon, {
56
57
  size: "small",
57
58
  label: "",
58
- primaryColor: colors.N90,
59
- secondaryColor: colors.N90
59
+ primaryColor: token('color.icon.subtle', colors.N90),
60
+ secondaryColor: token('color.icon.subtle', colors.N90)
60
61
  }))), /*#__PURE__*/React.createElement(ArticlesListItemDescription, null, description));
61
62
  };
62
63
 
@@ -2,6 +2,7 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { fontSize, gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const ArticlesListItemWrapper = styled.a({
6
7
  position: `relative`,
7
8
  boxSizing: `border-box`,
@@ -9,21 +10,22 @@ export const ArticlesListItemWrapper = styled.a({
9
10
  display: `block`,
10
11
  textDecoration: `none`,
11
12
  cursor: `pointer`,
12
- color: `${colors.N200}`,
13
+ color: `${token('color.text.subtlest', colors.N200)}`,
13
14
  borderRadius: `3px`,
15
+ backgroundColor: `${token('color.background.neutral.subtle', 'transparent')}`,
14
16
  '&:hover, &:focus, &:visited, &:active': {
15
17
  textDecoration: `none`,
16
18
  outline: `none`,
17
19
  outlineOffset: `none`
18
20
  },
19
21
  '&:focus': {
20
- boxShadow: `${colors.B100} 0px 0px 0px 2px inset`
22
+ boxShadow: `${token('color.border.focused', colors.B100)} 0px 0px 0px 2px inset`
21
23
  },
22
24
  '&:hover': {
23
- backgroundColor: `${colors.N30}`
25
+ backgroundColor: `${token('color.background.neutral.subtle.hovered', colors.N30)}`
24
26
  },
25
27
  '&:active': {
26
- backgroundColor: `${colors.B50}`
28
+ backgroundColor: `${token('color.background.neutral.subtle.pressed', colors.B50)}`
27
29
  }
28
30
  }, props => props.styles);
29
31
  export const ArticlesListItemContainer = styled.div`
@@ -34,7 +36,7 @@ export const ArticlesListItemTypeTitle = styled.div`
34
36
  font-weight: bold;
35
37
  font-size: 11px;
36
38
  line-height: ${gridSize() * 2}px;
37
- color: ${colors.N200};
39
+ color: ${token('color.text.subtlest', colors.N200)};
38
40
  padding-bottom: ${gridSize() / 2}px;
39
41
  `;
40
42
  export const ArticlesListItemLinkIcon = styled.div`
@@ -42,7 +44,7 @@ export const ArticlesListItemLinkIcon = styled.div`
42
44
  `;
43
45
  export const ArticlesListItemTitleText = styled.span`
44
46
  text-decoration: none;
45
- color: ${colors.N800};
47
+ color: ${token('color.text', colors.N800)};
46
48
  font-size: ${fontSize()}px;
47
49
  font-weight: 600;
48
50
  display: block;
@@ -54,6 +56,6 @@ export const ArticlesListItemTitleText = styled.span`
54
56
  export const ArticlesListItemDescription = styled.p`
55
57
  display: block;
56
58
  line-height: ${gridSize() * 2.5}px;
57
- color: ${colors.N400};
59
+ color: ${token('color.text.subtle', colors.N400)};
58
60
  margin: 0;
59
61
  `;
@@ -2,11 +2,12 @@
2
2
  import styled from 'styled-components';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
4
  import { gridSize } from '@atlaskit/theme/constants';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const HelpContentButtonContainer = styled.a`
6
7
  display: block;
7
8
  cursor: pointer;
8
9
  width: calc(100% - ${gridSize() * 2}px);
9
- color: ${colors.N600};
10
+ color: ${token('color.text.subtle', colors.N600)};
10
11
  padding: ${gridSize}px;
11
12
  border-radius: 3px;
12
13
 
@@ -17,19 +18,19 @@ export const HelpContentButtonContainer = styled.a`
17
18
  text-decoration: none;
18
19
  outline: none;
19
20
  outline-offset: none;
20
- color: ${colors.N600};
21
+ color: ${token('color.text.subtle', colors.N600)};
21
22
  }
22
23
 
23
24
  &:focus {
24
- box-shadow: ${colors.B100} 0 0 0 2px inset;
25
+ box-shadow: ${token('color.border.focused', colors.B100)} 0 0 0 2px inset;
25
26
  }
26
27
 
27
28
  &:hover {
28
- background-color: ${colors.N30};
29
+ background-color: ${token('color.background.neutral.subtle.hovered', colors.N30)};
29
30
  }
30
31
 
31
32
  &:active {
32
- background-color: ${colors.B50};
33
+ background-color: ${token('color.background.neutral.subtle.pressed', colors.B50)};
33
34
  }
34
35
  `;
35
36
  export const HelpContentButtonIcon = styled.div`
@@ -3,6 +3,7 @@ import { css } from '@emotion/core';
3
3
  import styled from '@emotion/styled';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
5
  import { gridSize, fontSize } from '@atlaskit/theme/constants';
6
+ import { token } from '@atlaskit/tokens';
6
7
 
7
8
  const baseHeading = (size, lineHeight) => `
8
9
  font-size: ${size / fontSize()}em;
@@ -18,7 +19,7 @@ export const truncate = (width = '100%') => css`
18
19
  `;
19
20
  export const RelatedArticlesTitle = styled.div`
20
21
  ${baseHeading(16, 20)}
21
- color: ${colors.heading};
22
+ color: ${token('color.text', colors.N800)};
22
23
  font-weight: 600;
23
24
  letter-spacing: -0.006em;
24
25
  padding: ${gridSize() * 2}px 0;
@@ -6,6 +6,7 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
6
6
  import { injectIntl } from 'react-intl-next';
7
7
  import { messages } from '../../../messages';
8
8
  import { SearchResultSearchExternalSiteContainer } from './styled';
9
+ import { token } from '@atlaskit/tokens';
9
10
  export const SearchExternalSite = ({
10
11
  searchExternalUrl,
11
12
  onSearchExternalUrlClick,
@@ -35,8 +36,8 @@ export const SearchExternalSite = ({
35
36
  iconAfter: /*#__PURE__*/React.createElement(ShortcutIcon, {
36
37
  size: "small",
37
38
  label: "",
38
- primaryColor: colors.N90,
39
- secondaryColor: colors.N90
39
+ primaryColor: token('color.icon.subtle', colors.N90),
40
+ secondaryColor: token('color.icon.subtle', colors.N90)
40
41
  }),
41
42
  spacing: "compact",
42
43
  href: searchExternalUrl,
@@ -3,6 +3,7 @@ import { useAnalyticsEvents, AnalyticsContext } from '@atlaskit/analytics-next';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
4
  import Button from '@atlaskit/button/custom-theme-button';
5
5
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { injectIntl } from 'react-intl-next';
7
8
  import NotFoundImage from '../../../assets/NotFoundImage';
8
9
  import { messages } from '../../../messages';
@@ -36,8 +37,8 @@ export const SearchResultsEmpty = ({
36
37
  iconAfter: /*#__PURE__*/React.createElement(ShortcutIcon, {
37
38
  size: "small",
38
39
  label: "",
39
- primaryColor: colors.N90,
40
- secondaryColor: colors.N90
40
+ primaryColor: token('color.icon.subtle', colors.N90),
41
+ secondaryColor: token('color.icon.subtle', colors.N90)
41
42
  }),
42
43
  spacing: "compact",
43
44
  href: searchExternalUrl,
@@ -44,19 +44,16 @@ export const SearchResults = () => {
44
44
  onSearchExternalUrlClick
45
45
  } = useSearchContext();
46
46
  const {
47
- setArticleId,
47
+ openArticle,
48
48
  view
49
49
  } = useNavigationContext();
50
50
  const handleOnSearchResultItemClick = useCallback((event, analyticsEvent, articleData) => {
51
- if (setArticleId) {
52
- setArticleId({
53
- id: articleData.id,
54
- type: ARTICLE_TYPE.HELP_ARTICLE
55
- });
56
- }
57
-
51
+ openArticle({
52
+ id: articleData.id,
53
+ type: ARTICLE_TYPE.HELP_ARTICLE
54
+ });
58
55
  onSearchResultItemClick(event, analyticsEvent, articleData);
59
- }, [onSearchResultItemClick, setArticleId]);
56
+ }, [onSearchResultItemClick, openArticle]);
60
57
  return /*#__PURE__*/React.createElement(Transition, {
61
58
  in: view === VIEW.SEARCH && isSearchResultVisible,
62
59
  timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS
@@ -2,12 +2,13 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const SearchResultsContainer = styled.div`
6
7
  position: absolute;
7
8
  height: 100%;
8
9
  width: 100%;
9
10
  top: 0;
10
- background-color: #ffffff;
11
+ background-color: ${token('elevation.surface', '#FFFFFF')};
11
12
  flex: 1;
12
13
  flex-direction: column;
13
14
  box-sizing: border-box;
@@ -29,7 +30,7 @@ export const SearchResultEmptyMessageText = styled.div`
29
30
  text-align: center;
30
31
 
31
32
  p {
32
- color: ${colors.N200};
33
+ color: ${token('color.text.subtlest', colors.N200)};
33
34
  }
34
35
  `;
35
36
  export const SearchResultSearchExternalSiteContainer = styled.div`
@@ -37,6 +38,6 @@ export const SearchResultSearchExternalSiteContainer = styled.div`
37
38
  text-align: center;
38
39
 
39
40
  p {
40
- color: ${colors.N200};
41
+ color: ${token('color.text.subtlest', colors.N200)};
41
42
  }
42
43
  `;
@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
2
2
  import { AnalyticsContext } from '@atlaskit/analytics-next';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
4
  import LightbulbIcon from '@atlaskit/icon/glyph/lightbulb';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { injectIntl } from 'react-intl-next';
6
7
  import { name as packageName, version as packageVersion } from '../../../version.json';
7
8
  import { useWhatsNewArticleContext } from '../../contexts/whatsNewArticleContext';
@@ -25,20 +26,18 @@ export const WhatsNewButton = ({
25
26
  whatsNewGetNotificationProvider
26
27
  } = useWhatsNewArticleContext();
27
28
  const {
28
- setArticleId
29
+ openArticle
29
30
  } = useNavigationContext();
30
31
  const handleOnButtonClick = useCallback((id, analytics, event) => {
31
32
  if (onWhatsNewButtonClick) {
32
33
  onWhatsNewButtonClick(event, analytics);
33
34
  }
34
35
 
35
- if (setArticleId) {
36
- setArticleId({
37
- id: '',
38
- type: ARTICLE_TYPE.WHATS_NEW
39
- });
40
- }
41
- }, [onWhatsNewButtonClick, setArticleId]);
36
+ openArticle({
37
+ id: '',
38
+ type: ARTICLE_TYPE.WHATS_NEW
39
+ });
40
+ }, [onWhatsNewButtonClick, openArticle]);
42
41
  return /*#__PURE__*/React.createElement(HelpContentButton, {
43
42
  id: "whats-new",
44
43
  key: "whats-new",
@@ -49,7 +48,7 @@ export const WhatsNewButton = ({
49
48
  productName
50
49
  }) : formatMessage(messages.help_whats_new_button_label_without_product_name),
51
50
  icon: /*#__PURE__*/React.createElement(LightbulbIcon, {
52
- primaryColor: colors.N600,
51
+ primaryColor: token('color.icon.subtle', colors.N600),
53
52
  size: "medium",
54
53
  label: ""
55
54
  })
@@ -2,6 +2,7 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const WhatsNewResultsEmptyMessageImage = styled.div`
6
7
  padding: ${3 * gridSize()}px ${3 * gridSize()}px 0 ${3 * gridSize()}px;
7
8
  text-align: center;
@@ -11,6 +12,6 @@ export const WhatsNewResultsEmptyMessageText = styled.div`
11
12
  text-align: center;
12
13
 
13
14
  p {
14
- color: ${colors.N200};
15
+ color: ${token('color.text.subtlest', colors.N200)};
15
16
  }
16
17
  `;
@@ -2,6 +2,7 @@
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
  export const SearchResultEmptyMessageImage = styled.div`
6
7
  padding: ${3 * gridSize()}px ${3 * gridSize()}px 0 ${3 * gridSize()}px;
7
8
  text-align: center;
@@ -11,6 +12,6 @@ export const SearchResultEmptyMessageText = styled.div`
11
12
  text-align: center;
12
13
 
13
14
  p {
14
- color: ${colors.N200};
15
+ color: ${token('color.text.subtlest', colors.N200)};
15
16
  }
16
17
  `;
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
4
  import { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';
5
5
  import * as colors from '@atlaskit/theme/colors';
6
+ import { token } from '@atlaskit/tokens';
6
7
  export const WhatsNewResultListItemWrapper = styled.a({
7
8
  position: `relative`,
8
9
  boxSizing: `border-box`,
@@ -10,7 +11,8 @@ export const WhatsNewResultListItemWrapper = styled.a({
10
11
  display: `block`,
11
12
  textDecoration: `none`,
12
13
  cursor: `pointer`,
13
- color: `${colors.N200}`,
14
+ color: `${token('color.text.subtlest', colors.N200)}`,
15
+ backgroundColor: `${token('color.background.neutral.subtle', colors.N0)}`,
14
16
  borderRadius: `3px`,
15
17
  '&:hover, &:focus, &:visited, &:active': {
16
18
  textDecoration: `none`,
@@ -18,13 +20,13 @@ export const WhatsNewResultListItemWrapper = styled.a({
18
20
  outlineOffset: `none`
19
21
  },
20
22
  '&:focus': {
21
- boxShadow: `${colors.B100} 0px 0px 0px 2px inset`
23
+ boxShadow: `${token('color.border.focused', colors.B100)} 0px 0px 0px 2px inset`
22
24
  },
23
25
  '&:hover': {
24
- backgroundColor: `${colors.N30}`
26
+ backgroundColor: `${token('color.background.neutral.subtle.hovered', colors.N30)}`
25
27
  },
26
28
  '&:active': {
27
- backgroundColor: `${colors.B50}`
29
+ backgroundColor: `${token('color.background.neutral.subtle.pressed', colors.B50)}`
28
30
  }
29
31
  }, props => props.styles);
30
32
  export const WhatsNewResultListItemTitleContainer = styled.div`
@@ -45,6 +47,6 @@ export const WhatsNewResultListItemTitleText = styled.span`
45
47
  export const WhatsNewResultListItemDescription = styled.p`
46
48
  display: block;
47
49
  line-height: ${gridSize() * 2.5}px;
48
- color: ${colors.N800};
50
+ color: ${token('color.text', colors.N800)};
49
51
  margin: 0;
50
52
  `;
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { gridSize } from '@atlaskit/theme/constants';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
+ import { token } from '@atlaskit/tokens';
4
5
  import toDate from 'date-fns/toDate';
5
6
  import isYesterday from 'date-fns/isYesterday';
6
7
  import isToday from 'date-fns/isToday';
@@ -40,7 +41,7 @@ const WhatsNewResultsList = ({
40
41
  key: key
41
42
  }, /*#__PURE__*/React.createElement(WhatsNewResultsListGroupTitle, null, whatsNewArticlesGroupedByDate[key].title), whatsNewArticlesGroupedByDate[key].items.map((whatsNewArticle, i) => /*#__PURE__*/React.createElement(WhatsNewResultItem, {
42
43
  styles: {
43
- border: style === 'secondary' ? `2px solid ${colors.N30}` : 0,
44
+ border: style === 'secondary' ? `2px solid ${token('color.border', colors.N30)}` : 0,
44
45
  padding: style === 'secondary' ? `${gridSize()}px ${gridSize() * 2}px` : `${gridSize()}px`,
45
46
  marginBottom: style === 'secondary' ? `${gridSize() * 1.5}px` : 0
46
47
  },
@@ -29,7 +29,7 @@ const WhatsNewResultsList = ({
29
29
  onShowMoreButtonClick
30
30
  }) => {
31
31
  const {
32
- setArticleId
32
+ openArticle
33
33
  } = useNavigationContext();
34
34
 
35
35
  const handleShowMoreButtonClick = (event, analyticsEvent) => {
@@ -39,17 +39,15 @@ const WhatsNewResultsList = ({
39
39
  };
40
40
 
41
41
  const handleOnWhatsNewResultItemClick = useCallback((event, analyticsEvent, articleData) => {
42
- if (setArticleId) {
43
- setArticleId({
44
- id: articleData.id,
45
- type: ARTICLE_TYPE.WHATS_NEW
46
- });
47
- }
42
+ openArticle({
43
+ id: articleData.id,
44
+ type: ARTICLE_TYPE.WHATS_NEW
45
+ });
48
46
 
49
47
  if (onWhatsNewResultItemClick) {
50
48
  onWhatsNewResultItemClick(event, analyticsEvent, articleData);
51
49
  }
52
- }, [onWhatsNewResultItemClick, setArticleId]);
50
+ }, [onWhatsNewResultItemClick, openArticle]);
53
51
  return whatsNewArticles && whatsNewArticles.length > 0 ? /*#__PURE__*/React.createElement(WhatsNewResultsListContainer, null, /*#__PURE__*/React.createElement(ThemeProvider, {
54
52
  theme: {
55
53
  [itemThemeNamespace]: ITEM_THEME
@@ -2,6 +2,7 @@
2
2
  import { css } from '@emotion/core';
3
3
  import styled from '@emotion/styled';
4
4
  import { fontSizeSmall, gridSize } from '@atlaskit/theme/constants';
5
+ import { token } from '@atlaskit/tokens';
5
6
  import * as colors from '@atlaskit/theme/colors';
6
7
  export const truncate = (width = '100%') => css`
7
8
  overflow-x: hidden;
@@ -16,7 +17,7 @@ export const WhatsNewResultsListGroupWrapper = styled.div`
16
17
  padding: ${gridSize()}px 0 ${gridSize()}px 0;
17
18
  `;
18
19
  export const WhatsNewResultsListGroupTitle = styled.div`
19
- color: ${colors.N200};
20
+ color: ${token('color.text.subtlest', colors.N200)};
20
21
  font-size: ${fontSizeSmall()}px;
21
22
  font-weight: bold;
22
23
  padding: 0 ${gridSize()}px ${gridSize()}px ${gridSize()}px;
@@ -1,5 +1,6 @@
1
- import React, { useCallback, useState } from 'react';
1
+ import React, { useCallback, useState, useRef } from 'react';
2
2
  import { Transition } from 'react-transition-group';
3
+ import isEqual from 'lodash/isEqual';
3
4
  import Select from '@atlaskit/select';
4
5
  import { injectIntl } from 'react-intl-next';
5
6
  import { VIEW } from '../../constants';
@@ -51,11 +52,17 @@ export const WhatsNewResults = ({
51
52
  searchWhatsNewArticlesState,
52
53
  onWhatsNewResultItemClick
53
54
  } = useWhatsNewArticleContext();
55
+ const containerRef = useRef(null);
56
+ const containerScrollPosition = useRef(0);
54
57
  const SELECT_DEFAULT_VALUE = {
55
58
  value: '',
56
59
  label: formatMessage(messages.help_whats_new_filter_select_option_all)
57
60
  };
58
- const [selectedOption, setSelectedOption] = useState(SELECT_DEFAULT_VALUE);
61
+ const SELECT_EMPTY_VALUE = {
62
+ value: undefined,
63
+ label: ''
64
+ };
65
+ const [selectedOption, setSelectedOption] = useState(SELECT_EMPTY_VALUE);
59
66
  const handleOnShowMoreButtonClick = useCallback(() => {
60
67
  if (searchWhatsNewArticlesResult && onSearchWhatsNewArticles) {
61
68
  const {
@@ -70,8 +77,25 @@ export const WhatsNewResults = ({
70
77
  }, [onSearchWhatsNewArticles, searchWhatsNewArticlesResult, selectedOption]);
71
78
 
72
79
  const handleOnEnter = () => {
73
- setSelectedOption(SELECT_DEFAULT_VALUE);
74
- onSearchWhatsNewArticles && onSearchWhatsNewArticles();
80
+ setTimeout(() => {
81
+ if (containerRef.current) {
82
+ containerRef.current.scrollTop = containerScrollPosition.current;
83
+ }
84
+ }, 0);
85
+
86
+ if (isEqual(selectedOption, SELECT_EMPTY_VALUE)) {
87
+ setSelectedOption(SELECT_DEFAULT_VALUE);
88
+ onSearchWhatsNewArticles && onSearchWhatsNewArticles();
89
+ }
90
+ };
91
+
92
+ const handleOnExit = () => {
93
+ if (helpContextView === VIEW.DEFAULT_CONTENT) {
94
+ setSelectedOption(SELECT_EMPTY_VALUE);
95
+ containerScrollPosition.current = 0;
96
+ } else {
97
+ containerScrollPosition.current = containerRef.current ? containerRef.current.scrollTop : 0;
98
+ }
75
99
  };
76
100
 
77
101
  const handleOnClearFilter = () => {
@@ -87,8 +111,10 @@ export const WhatsNewResults = ({
87
111
  return /*#__PURE__*/React.createElement(Transition, {
88
112
  in: helpContextView === VIEW.WHATS_NEW,
89
113
  timeout: FADEIN_OVERLAY_TRANSITION_DURATION_MS,
90
- onEnter: handleOnEnter
114
+ onEnter: handleOnEnter,
115
+ onExit: handleOnExit
91
116
  }, state => /*#__PURE__*/React.createElement(WhatsNewResultsContainer, {
117
+ ref: containerRef,
92
118
  style: { ...defaultStyle,
93
119
  ...transitionStyles[state]
94
120
  }
@@ -1,12 +1,13 @@
1
1
  /** @jsx jsx */
2
2
  import styled from '@emotion/styled';
3
3
  import { gridSize } from '@atlaskit/theme/constants';
4
+ import { token } from '@atlaskit/tokens';
4
5
  export const WhatsNewResultsContainer = styled.div`
5
6
  position: absolute;
6
7
  height: 100%;
7
8
  width: 100%;
8
9
  top: 0;
9
- background-color: #ffffff;
10
+ background-color: ${token('elevation.surface', '#FFFFFF')};
10
11
  flex: 1;
11
12
  flex-direction: column;
12
13
  box-sizing: border-box;