@atlaskit/side-navigation 2.0.4 → 3.0.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 (59) hide show
  1. package/CHANGELOG.md +95 -65
  2. package/constellation/index/examples.mdx +19 -10
  3. package/constellation/index/props.mdx +12 -12
  4. package/constellation/index/usage.mdx +5 -5
  5. package/dist/cjs/common/constants.js +2 -4
  6. package/dist/cjs/common/styles.js +4 -7
  7. package/dist/cjs/components/Footer/index.js +1 -2
  8. package/dist/cjs/components/Header/index.js +2 -4
  9. package/dist/cjs/components/Item/button-item.js +1 -2
  10. package/dist/cjs/components/Item/custom-item.js +1 -2
  11. package/dist/cjs/components/Item/go-back-item.js +1 -2
  12. package/dist/cjs/components/Item/link-item.js +1 -2
  13. package/dist/cjs/components/Item/skeleton-item.js +1 -2
  14. package/dist/cjs/components/LoadingItems/index.js +1 -2
  15. package/dist/cjs/components/NavigationContent/index.js +1 -2
  16. package/dist/cjs/components/NavigationContent/styles.js +4 -7
  17. package/dist/cjs/components/NavigationFooter/index.js +1 -2
  18. package/dist/cjs/components/NavigationHeader/index.js +1 -2
  19. package/dist/cjs/components/NestableNavigationContent/context.js +4 -7
  20. package/dist/cjs/components/NestableNavigationContent/index.js +2 -4
  21. package/dist/cjs/components/NestableNavigationContent/nesting-motion.js +2 -3
  22. package/dist/cjs/components/NestingItem/index.js +1 -2
  23. package/dist/cjs/components/NestingItem/styles.js +3 -5
  24. package/dist/cjs/components/Section/heading-item.js +1 -2
  25. package/dist/cjs/components/Section/section.js +1 -2
  26. package/dist/cjs/components/Section/skeleton-heading-item.js +1 -2
  27. package/dist/cjs/components/SideNavigation/index.js +1 -2
  28. package/dist/cjs/components/utils/hooks.js +3 -5
  29. package/package.json +12 -17
  30. package/dist/types-ts4.5/common/constants.d.ts +0 -2
  31. package/dist/types-ts4.5/common/styles.d.ts +0 -11
  32. package/dist/types-ts4.5/components/Footer/index.d.ts +0 -28
  33. package/dist/types-ts4.5/components/Header/index.d.ts +0 -56
  34. package/dist/types-ts4.5/components/Item/button-item.d.ts +0 -14
  35. package/dist/types-ts4.5/components/Item/custom-item.d.ts +0 -14
  36. package/dist/types-ts4.5/components/Item/go-back-item.d.ts +0 -14
  37. package/dist/types-ts4.5/components/Item/index.d.ts +0 -10
  38. package/dist/types-ts4.5/components/Item/link-item.d.ts +0 -16
  39. package/dist/types-ts4.5/components/Item/skeleton-item.d.ts +0 -13
  40. package/dist/types-ts4.5/components/LoadingItems/index.d.ts +0 -35
  41. package/dist/types-ts4.5/components/NavigationContent/index.d.ts +0 -25
  42. package/dist/types-ts4.5/components/NavigationContent/styles.d.ts +0 -91
  43. package/dist/types-ts4.5/components/NavigationFooter/index.d.ts +0 -14
  44. package/dist/types-ts4.5/components/NavigationHeader/index.d.ts +0 -16
  45. package/dist/types-ts4.5/components/NestableNavigationContent/context.d.ts +0 -27
  46. package/dist/types-ts4.5/components/NestableNavigationContent/index.d.ts +0 -79
  47. package/dist/types-ts4.5/components/NestableNavigationContent/nesting-motion.d.ts +0 -22
  48. package/dist/types-ts4.5/components/NestingItem/hack-for-ert.d.ts +0 -2
  49. package/dist/types-ts4.5/components/NestingItem/index.d.ts +0 -91
  50. package/dist/types-ts4.5/components/NestingItem/styles.d.ts +0 -28
  51. package/dist/types-ts4.5/components/Section/heading-item.d.ts +0 -11
  52. package/dist/types-ts4.5/components/Section/index.d.ts +0 -6
  53. package/dist/types-ts4.5/components/Section/section.d.ts +0 -39
  54. package/dist/types-ts4.5/components/Section/skeleton-heading-item.d.ts +0 -12
  55. package/dist/types-ts4.5/components/SideNavigation/index.d.ts +0 -32
  56. package/dist/types-ts4.5/components/index.d.ts +0 -22
  57. package/dist/types-ts4.5/components/utils/hooks.d.ts +0 -5
  58. package/dist/types-ts4.5/index.d.ts +0 -4
  59. package/tmp/api-report-tmp.d.ts +0 -230
@@ -1,30 +1,30 @@
1
- import SideNavigationProps from '!!extract-react-types-loader!../../src/components/SideNavigation'
2
- import HeaderProps from '!!extract-react-types-loader!../../src/components/Header'
3
- import FooterProps from '!!extract-react-types-loader!../../docs/ert/footer'
4
- import NavigationContentProps from '!!extract-react-types-loader!../../src/components/NavigationContent'
5
- import NestableNavigationContentProps from '!!extract-react-types-loader!../../src/components/NestableNavigationContent'
6
- import SectionProps from '!!extract-react-types-loader!../../src/components/Section'
1
+ import SideNavigationProps from '!!extract-react-types-loader!../../src/components/SideNavigation';
2
+ import HeaderProps from '!!extract-react-types-loader!../../src/components/Header';
3
+ import FooterProps from '!!extract-react-types-loader!../../docs/ert/footer';
4
+ import NavigationContentProps from '!!extract-react-types-loader!../../src/components/NavigationContent';
5
+ import NestableNavigationContentProps from '!!extract-react-types-loader!../../src/components/NestableNavigationContent';
6
+ import SectionProps from '!!extract-react-types-loader!../../src/components/Section';
7
7
 
8
8
  ### Navigation props
9
9
 
10
- <PropsTable heading="" props={SideNavigationProps}/>
10
+ <PropsTable heading="" props={SideNavigationProps} />
11
11
 
12
12
  ### Header props
13
13
 
14
- <PropsTable heading="" props={HeaderProps}/>
14
+ <PropsTable heading="" props={HeaderProps} />
15
15
 
16
16
  ### Footer props
17
17
 
18
- <PropsTable heading="" props={FooterProps}/>
18
+ <PropsTable heading="" props={FooterProps} />
19
19
 
20
20
  ### Content props
21
21
 
22
- <PropsTable heading="" props={NavigationContentProps}/>
22
+ <PropsTable heading="" props={NavigationContentProps} />
23
23
 
24
24
  ### Nestable content props
25
25
 
26
- <PropsTable heading="" props={NestableNavigationContentProps}/>
26
+ <PropsTable heading="" props={NestableNavigationContentProps} />
27
27
 
28
28
  ### Section props
29
29
 
30
- <PropsTable heading="" props={SectionProps}/>
30
+ <PropsTable heading="" props={SectionProps} />
@@ -8,9 +8,9 @@ order: 2
8
8
 
9
9
  Occasionally it's necessary to load some of the side navigation content asynchronously. There are a few things to take care of
10
10
 
11
- * Only use skeletons when you're quite certain of what the loaded state will look like. Most items that would appear in side navigation are probably fine to use with skeletons, for example, `@atlaskit/tree`.
12
- * When transitioning from loading skeleton to loaded items, try to ensure the jump does not look janky - use the equivalent skeleton item that is appropriate and be careful of things jumping around by a few pixels. We should be striving for UI that feels __stable__, which means it doesn't jump around when content loads.
13
- * Ensure loading does not take too long - try to anticipate if a user will look at your menu via hover events and the like, and pre-load the data as soon as possible.
14
- * When content is loading in, make sure it all loads in at the same time - our minds aren't fast enough to distinguish each item loading individually, for example, and it would appear slower to most users.
11
+ - Only use skeletons when you're quite certain of what the loaded state will look like. Most items that would appear in side navigation are probably fine to use with skeletons, for example, `@atlaskit/tree`.
12
+ - When transitioning from loading skeleton to loaded items, try to ensure the jump does not look janky - use the equivalent skeleton item that is appropriate and be careful of things jumping around by a few pixels. We should be striving for UI that feels **stable**, which means it doesn't jump around when content loads.
13
+ - Ensure loading does not take too long - try to anticipate if a user will look at your menu via hover events and the like, and pre-load the data as soon as possible.
14
+ - When content is loading in, make sure it all loads in at the same time - our minds aren't fast enough to distinguish each item loading individually, for example, and it would appear slower to most users.
15
15
 
16
- For a more in-depth look at how to approach loading states, please check out the _work in progress_ [skeleton exploration](https://hello.atlassian.net/wiki/spaces/ADG/pages/598816601/Loading+experiences+-+3.4+-+Guideline+exploration+-+Skeleton#Exploration-(spec)) (content restricted to Atlassian staff).
16
+ For a more in-depth look at how to approach loading states, please check out the _work in progress_ [skeleton exploration](<https://hello.atlassian.net/wiki/spaces/ADG/pages/598816601/Loading+experiences+-+3.4+-+Guideline+exploration+-+Skeleton#Exploration-(spec)>) (content restricted to Atlassian staff).
@@ -4,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VAR_SEPARATOR_COLOR = exports.VAR_SCROLL_INDICATOR_COLOR = void 0;
7
- var VAR_SEPARATOR_COLOR = '--ds-menu-seperator-color';
8
- exports.VAR_SEPARATOR_COLOR = VAR_SEPARATOR_COLOR;
9
- var VAR_SCROLL_INDICATOR_COLOR = '--ds-menu-scroll-indicator-color';
10
- exports.VAR_SCROLL_INDICATOR_COLOR = VAR_SCROLL_INDICATOR_COLOR;
7
+ var VAR_SEPARATOR_COLOR = exports.VAR_SEPARATOR_COLOR = '--ds-menu-seperator-color';
8
+ var VAR_SCROLL_INDICATOR_COLOR = exports.VAR_SCROLL_INDICATOR_COLOR = '--ds-menu-scroll-indicator-color';
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  *
17
17
  * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
18
18
  */
19
- var overrideStyleFunction = function overrideStyleFunction(baseStyle) {
19
+ var overrideStyleFunction = exports.overrideStyleFunction = function overrideStyleFunction(baseStyle) {
20
20
  var newStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
21
21
  return {};
22
22
  };
@@ -24,7 +24,6 @@ var overrideStyleFunction = function overrideStyleFunction(baseStyle) {
24
24
  return [baseStyle(state), newStyle(state)];
25
25
  };
26
26
  };
27
- exports.overrideStyleFunction = overrideStyleFunction;
28
27
  var defaultStyles = {
29
28
  '&:hover': {
30
29
  color: "var(--ds-text-subtle, ".concat(_colors.N500, ")"),
@@ -50,7 +49,7 @@ var selectedStyles = {
50
49
  color: "var(--ds-text-selected, ".concat(_colors.B400, ")")
51
50
  }
52
51
  };
53
- var baseSideNavItemStyle = function baseSideNavItemStyle(_ref) {
52
+ var baseSideNavItemStyle = exports.baseSideNavItemStyle = function baseSideNavItemStyle(_ref) {
54
53
  var isSelected = _ref.isSelected,
55
54
  isDisabled = _ref.isDisabled;
56
55
  return _objectSpread(_objectSpread(_objectSpread({
@@ -68,10 +67,8 @@ var baseSideNavItemStyle = function baseSideNavItemStyle(_ref) {
68
67
  width: "var(--ds-space-300, 24px)"
69
68
  }));
70
69
  };
71
- exports.baseSideNavItemStyle = baseSideNavItemStyle;
72
- var sectionHeaderSpacingStyles = function sectionHeaderSpacingStyles() {
70
+ var sectionHeaderSpacingStyles = exports.sectionHeaderSpacingStyles = function sectionHeaderSpacingStyles() {
73
71
  return {
74
72
  paddingInline: "var(--ds-space-100, 8px)"
75
73
  };
76
- };
77
- exports.sectionHeaderSpacingStyles = sectionHeaderSpacingStyles;
74
+ };
@@ -156,5 +156,4 @@ var FooterFacade = function FooterFacade(_ref3) {
156
156
  testId: testId
157
157
  }, children);
158
158
  };
159
- var _default = FooterFacade;
160
- exports.default = _default;
159
+ var _default = exports.default = FooterFacade;
@@ -27,7 +27,7 @@ var containerStyles = (0, _react2.css)({
27
27
  *
28
28
  * A container for Header and Footer that safely handles props to the child component
29
29
  */
30
- var Container = function Container(_ref) {
30
+ var Container = exports.Container = function Container(_ref) {
31
31
  var children = _ref.children,
32
32
  testId = _ref['data-testid'],
33
33
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -57,7 +57,6 @@ var Container = function Container(_ref) {
57
57
  css: containerStyles
58
58
  }, safeProps), children);
59
59
  };
60
- exports.Container = Container;
61
60
  /**
62
61
  * __Header__
63
62
  *
@@ -101,5 +100,4 @@ var Header = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
101
100
  }
102
101
  }));
103
102
  });
104
- var _default = Header;
105
- exports.default = _default;
103
+ var _default = exports.default = Header;
@@ -41,5 +41,4 @@ function (_ref, ref) {
41
41
  cssFn: cssOverride
42
42
  }, rest));
43
43
  });
44
- var _default = ButtonItem;
45
- exports.default = _default;
44
+ var _default = exports.default = ButtonItem;
@@ -41,5 +41,4 @@ function (_ref, ref) {
41
41
  }
42
42
  // Dirty hack to get generics working with forward ref [2/2]
43
43
  );
44
- var _default = CustomItem;
45
- exports.default = _default;
44
+ var _default = exports.default = CustomItem;
@@ -56,5 +56,4 @@ var GoBackItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
56
56
  ref: ref
57
57
  }, rest));
58
58
  });
59
- var _default = GoBackItem;
60
- exports.default = _default;
59
+ var _default = exports.default = GoBackItem;
@@ -43,5 +43,4 @@ function (_ref, ref) {
43
43
  cssFn: cssOverride
44
44
  }, rest));
45
45
  });
46
- var _default = LinkItem;
47
- exports.default = _default;
46
+ var _default = exports.default = LinkItem;
@@ -43,5 +43,4 @@ var SkeletonItem = function SkeletonItem(props) {
43
43
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
44
44
  }, props));
45
45
  };
46
- var _default = SkeletonItem;
47
- exports.default = _default;
46
+ var _default = exports.default = SkeletonItem;
@@ -51,5 +51,4 @@ var LoadingItems = function LoadingItems(_ref) {
51
51
  }), isLoading ? fallback : children);
52
52
  }));
53
53
  };
54
- var _default = LoadingItems;
55
- exports.default = _default;
54
+ var _default = exports.default = LoadingItems;
@@ -49,5 +49,4 @@ var NavigationContent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref
49
49
  })
50
50
  }, children)));
51
51
  });
52
- var _default = NavigationContent;
53
- exports.default = _default;
52
+ var _default = exports.default = NavigationContent;
@@ -31,7 +31,7 @@ var skeletonHeadingBottomMargin = containerPadding * 0.75 + skeletonHeadingMargi
31
31
  * They are "conditionally" shown from the users perspective using the inner container CSS
32
32
  * which has other pseudo elements which "mask" the "real" scroll indicators.
33
33
  */
34
- var outerContainerCSS = function outerContainerCSS(opts) {
34
+ var outerContainerCSS = exports.outerContainerCSS = function outerContainerCSS(opts) {
35
35
  return {
36
36
  // Flex is needed to ensure the overflow indicators are positioned correctly.
37
37
  display: 'flex',
@@ -70,8 +70,7 @@ var outerContainerCSS = function outerContainerCSS(opts) {
70
70
  * Essentially they cover (mask) the "real" scroll indicators when the user is scrolled
71
71
  * to the top or bottom of the container.
72
72
  */
73
- exports.outerContainerCSS = outerContainerCSS;
74
- var innerContainerCSS = function innerContainerCSS(opts) {
73
+ var innerContainerCSS = exports.innerContainerCSS = function innerContainerCSS(opts) {
75
74
  return _objectSpread(_objectSpread({
76
75
  display: 'flex',
77
76
  overflow: 'auto',
@@ -108,8 +107,7 @@ var innerContainerCSS = function innerContainerCSS(opts) {
108
107
  }
109
108
  });
110
109
  };
111
- exports.innerContainerCSS = innerContainerCSS;
112
- var containerCSS = function containerCSS(opts) {
110
+ var containerCSS = exports.containerCSS = function containerCSS(opts) {
113
111
  return {
114
112
  // When the scroll indicator is always shown we need to add some padding
115
113
  // so the spacing between matches what it would be if the indicator was a "block" element.
@@ -128,5 +126,4 @@ var containerCSS = function containerCSS(opts) {
128
126
  marginBottom: skeletonHeadingBottomMargin
129
127
  }
130
128
  };
131
- };
132
- exports.containerCSS = containerCSS;
129
+ };
@@ -27,5 +27,4 @@ var NavigationFooter = function NavigationFooter(_ref) {
27
27
  xcss: navigationFooterStyles
28
28
  }, children);
29
29
  };
30
- var _default = NavigationFooter;
31
- exports.default = _default;
30
+ var _default = exports.default = NavigationFooter;
@@ -28,5 +28,4 @@ var NavigationHeader = function NavigationHeader(props) {
28
28
  "data-navheader": true
29
29
  }, children);
30
30
  };
31
- var _default = NavigationHeader;
32
- exports.default = _default;
31
+ var _default = exports.default = NavigationHeader;
@@ -12,9 +12,8 @@ var _react = require("react");
12
12
  /**
13
13
  * @internal
14
14
  */
15
- var NestedContext = /*#__PURE__*/(0, _react.createContext)(undefined);
16
- exports.NestedContext = NestedContext;
17
- var useNestedContext = function useNestedContext() {
15
+ var NestedContext = exports.NestedContext = /*#__PURE__*/(0, _react.createContext)(undefined);
16
+ var useNestedContext = exports.useNestedContext = function useNestedContext() {
18
17
  var context = (0, _react.useContext)(NestedContext);
19
18
  if (!context) {
20
19
  var error = '';
@@ -31,8 +30,7 @@ var useNestedContext = function useNestedContext() {
31
30
  * If `shouldRender` returns `true` - return your nodes.
32
31
  * If it returns `false` - either return `null` or `children` if you have children.
33
32
  */
34
- exports.useNestedContext = useNestedContext;
35
- var useShouldNestedElementRender = function useShouldNestedElementRender() {
33
+ var useShouldNestedElementRender = exports.useShouldNestedElementRender = function useShouldNestedElementRender() {
36
34
  var context = (0, _react.useContext)(NestedContext);
37
35
  if (!context) {
38
36
  return {
@@ -42,5 +40,4 @@ var useShouldNestedElementRender = function useShouldNestedElementRender() {
42
40
  return {
43
41
  shouldRender: context.currentStackId === context.parentId
44
42
  };
45
- };
46
- exports.useShouldNestedElementRender = useShouldNestedElementRender;
43
+ };
@@ -19,8 +19,7 @@ var _nestingMotion = require("./nesting-motion");
19
19
 
20
20
  // Named so ERT doesn't pick up the override name as a type.
21
21
 
22
- var ROOT_ID = 'ATLASKIT_NESTED_ROOT';
23
- exports.ROOT_ID = ROOT_ID;
22
+ var ROOT_ID = exports.ROOT_ID = 'ATLASKIT_NESTED_ROOT';
24
23
  var nestableNavigationContentStyles = (0, _react2.css)({
25
24
  height: '100%',
26
25
  position: 'relative',
@@ -175,5 +174,4 @@ var NestableNavigationContent = function NestableNavigationContent(props) {
175
174
  }, children)));
176
175
  }))));
177
176
  };
178
- var _default = NestableNavigationContent;
179
- exports.default = _default;
177
+ var _default = exports.default = NestableNavigationContent;
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  /**
14
14
  * @internal
15
15
  */
16
- var NestingMotion = function NestingMotion(props) {
16
+ var NestingMotion = exports.NestingMotion = function NestingMotion(props) {
17
17
  var children = props.children,
18
18
  enterFrom = props.enterFrom,
19
19
  exitTo = props.exitTo,
@@ -31,5 +31,4 @@ var NestingMotion = function NestingMotion(props) {
31
31
  'data-testid': testId && "".concat(testId, "-").concat(direction)
32
32
  }, innerProps));
33
33
  });
34
- };
35
- exports.NestingMotion = NestingMotion;
34
+ };
@@ -145,5 +145,4 @@ var NestingItem = function NestingItem(props) {
145
145
  }
146
146
  return (0, _react2.jsx)(_index.ButtonItem, componentProps);
147
147
  };
148
- var _default = NestingItem;
149
- exports.default = _default;
148
+ var _default = exports.default = NestingItem;
@@ -10,7 +10,7 @@ var _enabledCSS, _disabledCSS;
10
10
  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; }
11
11
  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; }
12
12
  // exposed for testing purposes
13
- var enabledCSS = (_enabledCSS = {}, (0, _defineProperty2.default)(_enabledCSS, '&:hover [data-custom-icon]', {
13
+ var enabledCSS = exports.enabledCSS = (_enabledCSS = {}, (0, _defineProperty2.default)(_enabledCSS, '&:hover [data-custom-icon]', {
14
14
  display: 'none'
15
15
  }), (0, _defineProperty2.default)(_enabledCSS, '&:active [data-custom-icon]', {
16
16
  display: 'none'
@@ -27,13 +27,11 @@ var enabledCSS = (_enabledCSS = {}, (0, _defineProperty2.default)(_enabledCSS, '
27
27
  }), (0, _defineProperty2.default)(_enabledCSS, '& [data-right-arrow]', {
28
28
  display: 'none'
29
29
  }), _enabledCSS);
30
- exports.enabledCSS = enabledCSS;
31
30
  var disabledCSS = (_disabledCSS = {}, (0, _defineProperty2.default)(_disabledCSS, '[data-item-elem-after]', {
32
31
  opacity: 0
33
32
  }), (0, _defineProperty2.default)(_disabledCSS, '& [data-right-arrow]', {
34
33
  display: 'none'
35
34
  }), _disabledCSS);
36
- var nestingItemStyle = function nestingItemStyle(state) {
35
+ var nestingItemStyle = exports.nestingItemStyle = function nestingItemStyle(state) {
37
36
  return _objectSpread({}, state.isDisabled ? disabledCSS : enabledCSS);
38
- };
39
- exports.nestingItemStyle = nestingItemStyle;
37
+ };
@@ -29,5 +29,4 @@ var HeadingItem = function HeadingItem(props) {
29
29
  cssFn: cssFn
30
30
  }));
31
31
  };
32
- var _default = HeadingItem;
33
- exports.default = _default;
32
+ var _default = exports.default = HeadingItem;
@@ -40,5 +40,4 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
40
40
  }
41
41
  }));
42
42
  });
43
- var _default = Section;
44
- exports.default = _default;
43
+ var _default = exports.default = Section;
@@ -35,5 +35,4 @@ var SkeletonHeadingItem = function SkeletonHeadingItem(props) {
35
35
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
36
36
  }, props));
37
37
  };
38
- var _default = SkeletonHeadingItem;
39
- exports.default = _default;
38
+ var _default = exports.default = SkeletonHeadingItem;
@@ -45,5 +45,4 @@ var SideNavigation = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
45
45
  value: "notch"
46
46
  }, children));
47
47
  });
48
- var _default = SideNavigation;
49
- exports.default = _default;
48
+ var _default = exports.default = SideNavigation;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useChildIdsEffect = exports.useChildIds = void 0;
7
7
  var _react = require("react");
8
8
  var _NestableNavigationContent = require("../NestableNavigationContent");
9
- var useChildIds = function useChildIds(currentStackId, committedStack, onUnknownNest) {
9
+ var useChildIds = exports.useChildIds = function useChildIds(currentStackId, committedStack, onUnknownNest) {
10
10
  var childIdsRef = (0, _react.useRef)(new Set());
11
11
  (0, _react.useEffect)(function () {
12
12
  // we are holding navigation item IDs in childIdsRef
@@ -20,8 +20,7 @@ var useChildIds = function useChildIds(currentStackId, committedStack, onUnknown
20
20
  childIdsRef: childIdsRef
21
21
  };
22
22
  };
23
- exports.useChildIds = useChildIds;
24
- var useChildIdsEffect = function useChildIdsEffect(childIds, id) {
23
+ var useChildIdsEffect = exports.useChildIdsEffect = function useChildIdsEffect(childIds, id) {
25
24
  (0, _react.useEffect)(function () {
26
25
  if (!childIds || !childIds.current) {
27
26
  return;
@@ -36,5 +35,4 @@ var useChildIdsEffect = function useChildIdsEffect(childIds, id) {
36
35
  // childIds shouldn't change as it's a ref
37
36
  // eslint-disable-next-line react-hooks/exhaustive-deps
38
37
  }, [id]);
39
- };
40
- exports.useChildIdsEffect = useChildIdsEffect;
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-navigation",
3
- "version": "2.0.4",
3
+ "version": "3.0.0",
4
4
  "description": "A highly composable side navigation component that supports nested views.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.tsx",
25
17
  "atlassian": {
@@ -32,14 +24,14 @@
32
24
  }
33
25
  },
34
26
  "dependencies": {
35
- "@atlaskit/ds-explorations": "^2.2.0",
27
+ "@atlaskit/ds-explorations": "^3.0.0",
36
28
  "@atlaskit/ds-lib": "^2.2.0",
37
29
  "@atlaskit/icon": "^21.12.0",
38
- "@atlaskit/menu": "^1.10.0",
39
- "@atlaskit/motion": "^1.4.0",
40
- "@atlaskit/primitives": "^1.4.0",
30
+ "@atlaskit/menu": "^2.0.0",
31
+ "@atlaskit/motion": "^1.5.0",
32
+ "@atlaskit/primitives": "^1.6.0",
41
33
  "@atlaskit/theme": "^12.6.0",
42
- "@atlaskit/tokens": "^1.21.0",
34
+ "@atlaskit/tokens": "^1.25.0",
43
35
  "@babel/runtime": "^7.0.0",
44
36
  "@emotion/react": "^11.7.1"
45
37
  },
@@ -81,9 +73,12 @@
81
73
  "deprecation": "no-deprecated-imports"
82
74
  }
83
75
  },
84
- "platform-feature-flags": {
85
- "platform.design-system-team.menu-selected-state-change_0see9": {
86
- "type": "boolean"
76
+ "typesVersions": {
77
+ ">=4.5 <4.9": {
78
+ "*": [
79
+ "dist/types-ts4.5/*",
80
+ "dist/types-ts4.5/index.d.ts"
81
+ ]
87
82
  }
88
83
  },
89
84
  "homepage": "https://atlassian.design/components/side-navigation/",
@@ -1,2 +0,0 @@
1
- export declare const VAR_SEPARATOR_COLOR = "--ds-menu-seperator-color";
2
- export declare const VAR_SCROLL_INDICATOR_COLOR = "--ds-menu-scroll-indicator-color";
@@ -1,11 +0,0 @@
1
- import { CSSFn, StatelessCSSFn } from '@atlaskit/menu';
2
- /**
3
- * Allows chaining of style functions on top of base style functions
4
- * @param baseStyle the base custom cssFn
5
- * @param newStyle a new cssFn to be applied after the base style
6
- *
7
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
8
- */
9
- export declare const overrideStyleFunction: <TState>(baseStyle: CSSFn<TState>, newStyle?: CSSFn<TState> | undefined) => CSSFn<TState>;
10
- export declare const baseSideNavItemStyle: CSSFn;
11
- export declare const sectionHeaderSpacingStyles: StatelessCSSFn;
@@ -1,28 +0,0 @@
1
- /// <reference types="react" />
2
- import { HeaderProps } from '../Header';
3
- type NewFooterProps = Omit<HeaderProps, 'cssFn' | 'component' | 'onClick'>;
4
- type FooterFacadeProps = (HeaderProps & {
5
- /**
6
- * @private
7
- * @deprecated
8
- */
9
- useDeprecatedApi?: true;
10
- }) | (NewFooterProps & {
11
- /**
12
- * @private
13
- * @deprecated
14
- */
15
- useDeprecatedApi?: false;
16
- cssFn?: never;
17
- component?: never;
18
- onClick?: never;
19
- });
20
- export type FooterProps = HeaderProps | NewFooterProps;
21
- /**
22
- * __Footer__
23
- *
24
- * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
25
- * - [Code](https://atlassian.design/components/side-navigation/code)
26
- */
27
- declare const FooterFacade: ({ useDeprecatedApi, description, iconBefore, testId, children, component, cssFn, onClick, }: FooterFacadeProps) => JSX.Element;
28
- export default FooterFacade;
@@ -1,56 +0,0 @@
1
- /// <reference types="react" />
2
- import { jsx } from '@emotion/react';
3
- import { CSSFn, CustomItemComponentProps } from '@atlaskit/menu';
4
- /**
5
- * __Container__
6
- *
7
- * A container for Header and Footer that safely handles props to the child component
8
- */
9
- export declare const Container: ({ children, "data-testid": testId, ...props }: CustomItemComponentProps) => jsx.JSX.Element;
10
- export type HeaderProps = {
11
- /**
12
- * A function that can be used to override the styles of the component.
13
- * It receives the current styles and state and expects a styles object.
14
- * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
15
- */
16
- cssFn?: CSSFn;
17
- /**
18
- * Element to render before the item text.
19
- * Generally should be an [icon](https://atlaskit.atlassian.com/packages/design-system/icon) component.
20
- */
21
- iconBefore?: React.ReactNode;
22
- /**
23
- * Event that is triggered when the element is clicked.
24
- */
25
- onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
26
- /**
27
- * Description of the item.
28
- * This will render smaller text below the primary text of the item as well as slightly increasing the height of the item.
29
- */
30
- description?: string | JSX.Element;
31
- /**
32
- * Primary content for the item.
33
- */
34
- children?: React.ReactNode;
35
- /**
36
- * A `testId` prop is provided for specified elements,
37
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
38
- * serving as a hook for automated tests.
39
- */
40
- testId?: string;
41
- /**
42
- * Custom component to render as an item.
43
- * This can be both a functional component or a class component.
44
- * __Will return `null` if no component is defined.__
45
- * __NOTE:__ Make sure the reference for this component does not change between renders else undefined behavior may happen.
46
- */
47
- component?: React.ComponentType<CustomItemComponentProps>;
48
- };
49
- /**
50
- * __Header__
51
- *
52
- * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
53
- * - [Code](https://atlassian.design/components/side-navigation/code)
54
- */
55
- declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLElement>>;
56
- export default Header;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { ButtonItemProps } from '@atlaskit/menu';
3
- export type { ButtonItemProps } from '@atlaskit/menu';
4
- /**
5
- * __Button item__
6
- *
7
- * A button item renders an item wrapped in a button tag, used primarily when an
8
- * action does something other than changing routes.
9
- *
10
- * - [Examples](https://atlassian.design/components/side-navigation/examples#button-item)
11
- * - [Code](https://atlassian.design/components/side-navigation/code)
12
- */
13
- declare const ButtonItem: React.ForwardRefExoticComponent<ButtonItemProps & React.RefAttributes<HTMLElement>>;
14
- export default ButtonItem;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
3
- export type { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
4
- interface CustomItemPropsHack {
5
- <TComponentProps extends {}>(props: CustomItemProps<TComponentProps> & {
6
- ref?: any;
7
- } & Omit<TComponentProps, keyof CustomItemComponentProps>): JSX.Element | null;
8
- }
9
- /**
10
- * Used to support any custom items needed by products alongside the Header and Footer patterns.
11
- * Specific implementation of headers and footers are provided in the examples folder.
12
- */
13
- declare const CustomItem: CustomItemPropsHack;
14
- export default CustomItem;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { ButtonItemProps } from '@atlaskit/menu';
3
- export type { ButtonItemProps as GoBackItemProps } from '@atlaskit/menu';
4
- /**
5
- * __Go back item__
6
- *
7
- * A go back item is used to provide a customized "go back" button in nested
8
- * navigations.
9
- *
10
- * - [Examples](https://atlassian.design/components/side-navigation/examples#go-back-item)
11
- * - [Code](https://atlassian.design/components/side-navigation/code)
12
- */
13
- declare const GoBackItem: React.ForwardRefExoticComponent<ButtonItemProps & React.RefAttributes<HTMLElement>>;
14
- export default GoBackItem;
@@ -1,10 +0,0 @@
1
- export { default as ButtonItem } from './button-item';
2
- export type { ButtonItemProps } from './button-item';
3
- export { default as CustomItem } from './custom-item';
4
- export type { CustomItemProps, CustomItemComponentProps } from './custom-item';
5
- export { default as GoBackItem } from './go-back-item';
6
- export type { GoBackItemProps } from './go-back-item';
7
- export { default as LinkItem } from './link-item';
8
- export type { LinkItemProps } from './link-item';
9
- export { default as SkeletonItem } from './skeleton-item';
10
- export type { SkeletonItemProps } from './skeleton-item';