@atlaskit/side-navigation 11.1.11 → 11.1.13

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 (71) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/common/use-child-ids-effect.js +24 -0
  3. package/dist/cjs/common/use-child-ids.js +23 -0
  4. package/dist/cjs/components/Footer/index.js +4 -4
  5. package/dist/cjs/components/Header/header-container.js +53 -0
  6. package/dist/cjs/components/Header/index.compiled.css +2 -2
  7. package/dist/cjs/components/Header/index.js +6 -49
  8. package/dist/cjs/components/Item/button-item.compiled.css +1 -1
  9. package/dist/cjs/components/Item/button-item.js +1 -1
  10. package/dist/cjs/components/Item/custom-item.compiled.css +1 -1
  11. package/dist/cjs/components/Item/custom-item.js +1 -1
  12. package/dist/cjs/components/NestableNavigationContent/index.js +4 -4
  13. package/dist/cjs/components/NestingItem/index.js +8 -6
  14. package/dist/cjs/index.js +33 -18
  15. package/dist/es2019/common/use-child-ids-effect.js +18 -0
  16. package/dist/es2019/common/use-child-ids.js +17 -0
  17. package/dist/es2019/components/Footer/index.js +3 -3
  18. package/dist/es2019/components/Header/header-container.js +44 -0
  19. package/dist/es2019/components/Header/index.compiled.css +2 -2
  20. package/dist/es2019/components/Header/index.js +4 -45
  21. package/dist/es2019/components/Item/button-item.compiled.css +1 -1
  22. package/dist/es2019/components/Item/button-item.js +1 -1
  23. package/dist/es2019/components/Item/custom-item.compiled.css +1 -1
  24. package/dist/es2019/components/Item/custom-item.js +1 -1
  25. package/dist/es2019/components/NestableNavigationContent/index.js +2 -2
  26. package/dist/es2019/components/NestingItem/index.js +4 -2
  27. package/dist/es2019/index.js +15 -1
  28. package/dist/esm/common/use-child-ids-effect.js +18 -0
  29. package/dist/esm/common/use-child-ids.js +17 -0
  30. package/dist/esm/components/Footer/index.js +3 -3
  31. package/dist/esm/components/Header/header-container.js +46 -0
  32. package/dist/esm/components/Header/index.compiled.css +2 -2
  33. package/dist/esm/components/Header/index.js +4 -47
  34. package/dist/esm/components/Item/button-item.compiled.css +1 -1
  35. package/dist/esm/components/Item/button-item.js +1 -1
  36. package/dist/esm/components/Item/custom-item.compiled.css +1 -1
  37. package/dist/esm/components/Item/custom-item.js +1 -1
  38. package/dist/esm/components/NestableNavigationContent/index.js +2 -2
  39. package/dist/esm/components/NestingItem/index.js +4 -2
  40. package/dist/esm/index.js +15 -1
  41. package/dist/types/common/use-child-ids-effect.d.ts +3 -0
  42. package/dist/types/common/use-child-ids.d.ts +5 -0
  43. package/dist/types/components/Header/header-container.d.ts +8 -0
  44. package/dist/types/components/Header/index.d.ts +0 -6
  45. package/dist/types/index.d.ts +30 -2
  46. package/dist/types-ts4.5/common/use-child-ids-effect.d.ts +3 -0
  47. package/dist/types-ts4.5/common/use-child-ids.d.ts +5 -0
  48. package/dist/types-ts4.5/components/Header/header-container.d.ts +8 -0
  49. package/dist/types-ts4.5/components/Header/index.d.ts +0 -6
  50. package/dist/types-ts4.5/index.d.ts +30 -2
  51. package/package.json +2 -2
  52. package/dist/cjs/components/Item/index.js +0 -41
  53. package/dist/cjs/components/NestingItem/hack-for-ert.js +0 -8
  54. package/dist/cjs/components/index.js +0 -119
  55. package/dist/cjs/components/utils/hooks.js +0 -38
  56. package/dist/es2019/components/Item/index.js +0 -5
  57. package/dist/es2019/components/NestingItem/hack-for-ert.js +0 -2
  58. package/dist/es2019/components/index.js +0 -11
  59. package/dist/es2019/components/utils/hooks.js +0 -32
  60. package/dist/esm/components/Item/index.js +0 -5
  61. package/dist/esm/components/NestingItem/hack-for-ert.js +0 -2
  62. package/dist/esm/components/index.js +0 -11
  63. package/dist/esm/components/utils/hooks.js +0 -32
  64. package/dist/types/components/Item/index.d.ts +0 -10
  65. package/dist/types/components/NestingItem/hack-for-ert.d.ts +0 -2
  66. package/dist/types/components/index.d.ts +0 -22
  67. package/dist/types/components/utils/hooks.d.ts +0 -5
  68. package/dist/types-ts4.5/components/Item/index.d.ts +0 -10
  69. package/dist/types-ts4.5/components/NestingItem/hack-for-ert.d.ts +0 -2
  70. package/dist/types-ts4.5/components/index.d.ts +0 -22
  71. package/dist/types-ts4.5/components/utils/hooks.d.ts +0 -5
@@ -3,51 +3,10 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { forwardRef } from 'react';
6
- import { CustomItem } from '../Item';
6
+ import CustomItem from '../Item/custom-item';
7
+ import HeaderContainer from './header-container';
7
8
  const styles = {
8
- header: "_uizt1wug _vrjt1qyo _1cmdi7uo _11kjqtfy _jl2n73ad _1et6qtfy _1v6ji7uo"
9
- };
10
-
11
- /**
12
- * __Container__
13
- *
14
- * A container for Header and Footer that safely handles props to the child component
15
- */
16
- export const Container = ({
17
- children,
18
- 'data-testid': testId,
19
- ...props
20
- }) => {
21
- // https://stackoverflow.com/a/39333479
22
- const safeProps = (({
23
- className,
24
- onClick,
25
- onMouseDown,
26
- onDragStart,
27
- draggable,
28
- ref,
29
- tabIndex,
30
- disabled
31
- }) => ({
32
- className,
33
- onClick,
34
- onMouseDown,
35
- onDragStart,
36
- draggable,
37
- ref,
38
- tabIndex,
39
- disabled
40
- }))(props);
41
- return (
42
- /*#__PURE__*/
43
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
44
- React.createElement("div", _extends({
45
- "data-testid": testId,
46
- style: {
47
- position: 'relative'
48
- }
49
- }, safeProps), children)
50
- );
9
+ header: "_uizt1wug _vrjt1qyo _1cmdi7uo _11kjsm61 _jl2n73ad _1et6sm61 _1v6ji7uo"
51
10
  };
52
11
  /**
53
12
  * __Header__
@@ -58,7 +17,7 @@ export const Container = ({
58
17
  const Header = /*#__PURE__*/forwardRef((props, ref) => {
59
18
  return /*#__PURE__*/React.createElement(CustomItem, _extends({}, props, {
60
19
  ref: ref,
61
- component: props.component || Container,
20
+ component: props.component || HeaderContainer,
62
21
  isTitleHeading: true,
63
22
  className: ax([styles.header])
64
23
  }));
@@ -4,7 +4,7 @@
4
4
  ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
5
5
  ._1a391k8s [data-item-elem-before]{height:1.5rem}
6
6
  ._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
7
- ._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
7
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
8
8
  ._racp1k8s [data-item-elem-before]{width:1.5rem}
9
9
  ._syaz6x5g{color:var(--ds-text-selected,#1868db)}._10536x5g:visited{color:var(--ds-text-selected,#1868db)}
10
10
  ._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
@@ -7,7 +7,7 @@ import { forwardRef } from 'react';
7
7
  import { ButtonItem as Button } from '@atlaskit/menu';
8
8
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
9
9
  const styles = {
10
- root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhkqtfy _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
10
+ root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhksm61 _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
11
11
  selectedStyles: "_bfhk15s3 _syaz6x5g _10536x5g _irr3ufnl _30l36x5g _1di6nozp _9h8h6x5g"
12
12
  };
13
13
 
@@ -4,7 +4,7 @@
4
4
  ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
5
5
  ._1a391k8s [data-item-elem-before]{height:1.5rem}
6
6
  ._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
7
- ._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
7
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
8
8
  ._racp1k8s [data-item-elem-before]{width:1.5rem}
9
9
  ._syaz6x5g{color:var(--ds-text-selected,#1868db)}._10536x5g:visited{color:var(--ds-text-selected,#1868db)}
10
10
  ._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
@@ -7,7 +7,7 @@ import { forwardRef } from 'react';
7
7
  import { CustomItem as Custom } from '@atlaskit/menu';
8
8
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
9
9
  const styles = {
10
- root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhkqtfy _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
10
+ root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhksm61 _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
11
11
  selectedStyles: "_bfhk15s3 _syaz6x5g _10536x5g _irr3ufnl _30l36x5g _1di6nozp _9h8h6x5g"
12
12
  };
13
13
 
@@ -5,9 +5,9 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
6
  import { ExitingPersistence } from '@atlaskit/motion';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { GoBackItem as GoBackButton } from '../Item';
8
+ import useChildIds from '../../common/use-child-ids';
9
+ import GoBackButton from '../Item/go-back-item';
9
10
  import { default as NestingItem } from '../NestingItem';
10
- import { useChildIds } from '../utils/hooks';
11
11
  import { NestedContext } from './context';
12
12
  import { NestingMotion } from './nesting-motion';
13
13
  // Named so ERT doesn't pick up the override name as a type.
@@ -6,10 +6,12 @@ import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } fr
6
6
  import ArrowRightIcon from '@atlaskit/icon/core/arrow-right';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { Box } from '@atlaskit/primitives/compiled';
9
- import { ButtonItem, CustomItem, NavigationContent } from '../index';
9
+ import useChildIdsEffect from '../../common/use-child-ids-effect';
10
+ import ButtonItem from '../Item/button-item';
11
+ import CustomItem from '../Item/custom-item';
12
+ import NavigationContent from '../NavigationContent';
10
13
  import { ROOT_ID } from '../NestableNavigationContent';
11
14
  import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
12
- import { useChildIdsEffect } from '../utils/hooks';
13
15
  const styles = {
14
16
  iconContainer: "_1e0c1nu9",
15
17
  nestingItem: "_udl3glyw _kqsfglyw _udrwglyw _13qvglyw _9mqr1kw7 _povs1kw7 _uv2d1kw7 _atks1kw7",
@@ -1,3 +1,17 @@
1
- export { SideNavigation, Header, NavigationHeader, NavigationContent, Section, HeadingItem, SkeletonHeadingItem, NestableNavigationContent, NestingItem, ButtonItem, LinkItem, GoBackItem, CustomItem, SkeletonItem, Footer, NavigationFooter, LoadingItems } from './components';
1
+ export { default as SideNavigation } from './components/SideNavigation';
2
+ export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
3
+ export { default as NestingItem } from './components/NestingItem';
4
+ export { default as NavigationContent } from './components/NavigationContent';
5
+ export { default as ButtonItem } from './components/Item/button-item';
6
+ export { default as GoBackItem } from './components/Item/go-back-item';
7
+ export { default as LinkItem } from './components/Item/link-item';
8
+ export { default as CustomItem } from './components/Item/custom-item';
9
+ export { default as SkeletonItem } from './components/Item/skeleton-item';
10
+ export { default as Footer } from './components/Footer';
11
+ export { default as Header } from './components/Header';
12
+ export { default as NavigationHeader } from './components/NavigationHeader';
13
+ export { default as NavigationFooter } from './components/NavigationFooter';
14
+ export { default as LoadingItems } from './components/LoadingItems';
15
+ export { default as NestableNavigationContent } from './components/NestableNavigationContent';
2
16
  export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
3
17
  export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from './common/constants';
@@ -0,0 +1,18 @@
1
+ import { useEffect } from 'react';
2
+ var useChildIdsEffect = function useChildIdsEffect(childIds, id) {
3
+ useEffect(function () {
4
+ if (!childIds || !childIds.current) {
5
+ return;
6
+ }
7
+ if (!childIds.current.has(id)) {
8
+ childIds.current.add(id);
9
+ }
10
+ return function () {
11
+ // eslint-disable-next-line react-hooks/exhaustive-deps
12
+ childIds.current.delete(id);
13
+ };
14
+ // childIds shouldn't change as it's a ref
15
+ // eslint-disable-next-line react-hooks/exhaustive-deps
16
+ }, [id]);
17
+ };
18
+ export default useChildIdsEffect;
@@ -0,0 +1,17 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { ROOT_ID } from '../components/NestableNavigationContent';
3
+ var useChildIds = function useChildIds(currentStackId, committedStack, onUnknownNest) {
4
+ var childIdsRef = useRef(new Set());
5
+ useEffect(function () {
6
+ // we are holding navigation item IDs in childIdsRef
7
+ // check if the current displayed nav item (currentStackId) is in childIdsRef. if it's not, this means it's undefined
8
+ if (currentStackId === ROOT_ID || !childIdsRef.current.size || childIdsRef.current.has(currentStackId) || !onUnknownNest) {
9
+ return;
10
+ }
11
+ onUnknownNest(committedStack || [currentStackId]);
12
+ }, [currentStackId, committedStack, onUnknownNest]);
13
+ return {
14
+ childIdsRef: childIdsRef
15
+ };
16
+ };
17
+ export default useChildIds;
@@ -7,8 +7,8 @@ import { ax, ix } from "@compiled/react/runtime";
7
7
 
8
8
  import warnOnce from '@atlaskit/ds-lib/warn-once';
9
9
  import { Box, Stack, Text } from '@atlaskit/primitives/compiled';
10
- import { Container } from '../Header';
11
- import { CustomItem } from '../Item';
10
+ import HeaderContainer from '../Header/header-container';
11
+ import CustomItem from '../Item/custom-item';
12
12
  var styles = {
13
13
  iconContainer: "_1e0c1o8l _1bsb1k8s _4t3i1k8s",
14
14
  oldFooter: "_uizt1wug _1e0c1ule _y3gn1h6o _1tke1tcg _4cvr1h6o _1bsb1osq _vrjtwadc _16vx1h6o _bek6ze3t _rh04u2gc _76zj1o8l _13e21h6o _14bw1o8l _xosk12x7 _wte412x7 _ou5312x7 _1jo512x7 _11kjsm61 _jl2n73ad _1et6sm61 _1v6jazsu"
@@ -36,7 +36,7 @@ var OldFooter = function OldFooter(props) {
36
36
  };
37
37
  }(props);
38
38
  return /*#__PURE__*/React.createElement(CustomItem, _extends({}, safeProps, {
39
- component: props.component || Container,
39
+ component: props.component || HeaderContainer,
40
40
  className: ax([styles.oldFooter])
41
41
  }));
42
42
  };
@@ -0,0 +1,46 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "data-testid"];
4
+ import React from 'react';
5
+ /**
6
+ * __Container__
7
+ *
8
+ * A container for Header and Footer that safely handles props to the child component
9
+ */
10
+ var HeaderContainer = function HeaderContainer(_ref) {
11
+ var children = _ref.children,
12
+ testId = _ref['data-testid'],
13
+ props = _objectWithoutProperties(_ref, _excluded);
14
+ // https://stackoverflow.com/a/39333479
15
+ var safeProps = function (_ref2) {
16
+ var className = _ref2.className,
17
+ onClick = _ref2.onClick,
18
+ onMouseDown = _ref2.onMouseDown,
19
+ onDragStart = _ref2.onDragStart,
20
+ draggable = _ref2.draggable,
21
+ ref = _ref2.ref,
22
+ tabIndex = _ref2.tabIndex,
23
+ disabled = _ref2.disabled;
24
+ return {
25
+ className: className,
26
+ onClick: onClick,
27
+ onMouseDown: onMouseDown,
28
+ onDragStart: onDragStart,
29
+ draggable: draggable,
30
+ ref: ref,
31
+ tabIndex: tabIndex,
32
+ disabled: disabled
33
+ };
34
+ }(props);
35
+ return (
36
+ /*#__PURE__*/
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
38
+ React.createElement("div", _extends({
39
+ "data-testid": testId,
40
+ style: {
41
+ position: 'relative'
42
+ }
43
+ }, safeProps), children)
44
+ );
45
+ };
46
+ export default HeaderContainer;
@@ -1,7 +1,7 @@
1
1
 
2
2
  ._vrjt1qyo [data-item-title]{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}._1cmdi7uo [data-item-title]{color:var(--ds-text,#292a2e)}
3
3
  ._uizt1wug{-webkit-user-select:auto;-ms-user-select:auto;user-select:auto}
4
- div._11kjqtfy:hover{background-color:var(--ds-background-neutral-subtle,transparent)}
4
+ div._11kjsm61:hover{background-color:var(--ds-background-neutral-subtle,#00000000)}
5
5
  div._jl2n73ad:hover{cursor:default}
6
- div._1et6qtfy:active{background-color:var(--ds-background-neutral-subtle,transparent)}
6
+ div._1et6sm61:active{background-color:var(--ds-background-neutral-subtle,#00000000)}
7
7
  div._1v6ji7uo:active{color:var(--ds-text,#292a2e)}
@@ -1,55 +1,12 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "data-testid"];
5
3
  import "./index.compiled.css";
6
4
  import { ax, ix } from "@compiled/react/runtime";
7
5
  import React, { forwardRef } from 'react';
8
- import { CustomItem } from '../Item';
6
+ import CustomItem from '../Item/custom-item';
7
+ import HeaderContainer from './header-container';
9
8
  var styles = {
10
- header: "_uizt1wug _vrjt1qyo _1cmdi7uo _11kjqtfy _jl2n73ad _1et6qtfy _1v6ji7uo"
11
- };
12
-
13
- /**
14
- * __Container__
15
- *
16
- * A container for Header and Footer that safely handles props to the child component
17
- */
18
- export var Container = function Container(_ref) {
19
- var children = _ref.children,
20
- testId = _ref['data-testid'],
21
- props = _objectWithoutProperties(_ref, _excluded);
22
- // https://stackoverflow.com/a/39333479
23
- var safeProps = function (_ref2) {
24
- var className = _ref2.className,
25
- onClick = _ref2.onClick,
26
- onMouseDown = _ref2.onMouseDown,
27
- onDragStart = _ref2.onDragStart,
28
- draggable = _ref2.draggable,
29
- ref = _ref2.ref,
30
- tabIndex = _ref2.tabIndex,
31
- disabled = _ref2.disabled;
32
- return {
33
- className: className,
34
- onClick: onClick,
35
- onMouseDown: onMouseDown,
36
- onDragStart: onDragStart,
37
- draggable: draggable,
38
- ref: ref,
39
- tabIndex: tabIndex,
40
- disabled: disabled
41
- };
42
- }(props);
43
- return (
44
- /*#__PURE__*/
45
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
46
- React.createElement("div", _extends({
47
- "data-testid": testId,
48
- style: {
49
- position: 'relative'
50
- }
51
- }, safeProps), children)
52
- );
9
+ header: "_uizt1wug _vrjt1qyo _1cmdi7uo _11kjsm61 _jl2n73ad _1et6sm61 _1v6ji7uo"
53
10
  };
54
11
  /**
55
12
  * __Header__
@@ -60,7 +17,7 @@ export var Container = function Container(_ref) {
60
17
  var Header = /*#__PURE__*/forwardRef(function (props, ref) {
61
18
  return /*#__PURE__*/React.createElement(CustomItem, _extends({}, props, {
62
19
  ref: ref,
63
- component: props.component || Container,
20
+ component: props.component || HeaderContainer,
64
21
  isTitleHeading: true,
65
22
  className: ax([styles.header])
66
23
  }));
@@ -4,7 +4,7 @@
4
4
  ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
5
5
  ._1a391k8s [data-item-elem-before]{height:1.5rem}
6
6
  ._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
7
- ._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
7
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
8
8
  ._racp1k8s [data-item-elem-before]{width:1.5rem}
9
9
  ._syaz6x5g{color:var(--ds-text-selected,#1868db)}._10536x5g:visited{color:var(--ds-text-selected,#1868db)}
10
10
  ._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
@@ -9,7 +9,7 @@ import { forwardRef } from 'react';
9
9
  import { ButtonItem as Button } from '@atlaskit/menu';
10
10
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
11
11
  var styles = {
12
- root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhkqtfy _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
12
+ root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhksm61 _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
13
13
  selectedStyles: "_bfhk15s3 _syaz6x5g _10536x5g _irr3ufnl _30l36x5g _1di6nozp _9h8h6x5g"
14
14
  };
15
15
 
@@ -4,7 +4,7 @@
4
4
  ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
5
5
  ._1a391k8s [data-item-elem-before]{height:1.5rem}
6
6
  ._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
7
- ._bfhkqtfy{background-color:var(--ds-background-neutral-subtle,transparent)}
7
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
8
8
  ._racp1k8s [data-item-elem-before]{width:1.5rem}
9
9
  ._syaz6x5g{color:var(--ds-text-selected,#1868db)}._10536x5g:visited{color:var(--ds-text-selected,#1868db)}
10
10
  ._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
@@ -9,7 +9,7 @@ import { forwardRef } from 'react';
9
9
  import { CustomItem as Custom } from '@atlaskit/menu';
10
10
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
11
11
  var styles = {
12
- root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhkqtfy _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
12
+ root: "_2rkofajl _1rjcu2gc _18zru2gc _bfhksm61 _1a391k8s _racp1k8s _30l3azsu _irr31dpa _ppn2azsu _183jfcek",
13
13
  selectedStyles: "_bfhk15s3 _syaz6x5g _10536x5g _irr3ufnl _30l36x5g _1di6nozp _9h8h6x5g"
14
14
  };
15
15
 
@@ -6,9 +6,9 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
7
  import { ExitingPersistence } from '@atlaskit/motion';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
- import { GoBackItem as GoBackButton } from '../Item';
9
+ import useChildIds from '../../common/use-child-ids';
10
+ import GoBackButton from '../Item/go-back-item';
10
11
  import { default as NestingItem } from '../NestingItem';
11
- import { useChildIds } from '../utils/hooks';
12
12
  import { NestedContext } from './context';
13
13
  import { NestingMotion } from './nesting-motion';
14
14
  // Named so ERT doesn't pick up the override name as a type.
@@ -13,10 +13,12 @@ import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } fr
13
13
  import ArrowRightIcon from '@atlaskit/icon/core/arrow-right';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { Box } from '@atlaskit/primitives/compiled';
16
- import { ButtonItem, CustomItem, NavigationContent } from '../index';
16
+ import useChildIdsEffect from '../../common/use-child-ids-effect';
17
+ import ButtonItem from '../Item/button-item';
18
+ import CustomItem from '../Item/custom-item';
19
+ import NavigationContent from '../NavigationContent';
17
20
  import { ROOT_ID } from '../NestableNavigationContent';
18
21
  import { NestedContext, useNestedContext } from '../NestableNavigationContent/context';
19
- import { useChildIdsEffect } from '../utils/hooks';
20
22
  var styles = {
21
23
  iconContainer: "_1e0c1nu9",
22
24
  nestingItem: "_udl3glyw _kqsfglyw _udrwglyw _13qvglyw _9mqr1kw7 _povs1kw7 _uv2d1kw7 _atks1kw7",
package/dist/esm/index.js CHANGED
@@ -1,3 +1,17 @@
1
- export { SideNavigation, Header, NavigationHeader, NavigationContent, Section, HeadingItem, SkeletonHeadingItem, NestableNavigationContent, NestingItem, ButtonItem, LinkItem, GoBackItem, CustomItem, SkeletonItem, Footer, NavigationFooter, LoadingItems } from './components';
1
+ export { default as SideNavigation } from './components/SideNavigation';
2
+ export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
3
+ export { default as NestingItem } from './components/NestingItem';
4
+ export { default as NavigationContent } from './components/NavigationContent';
5
+ export { default as ButtonItem } from './components/Item/button-item';
6
+ export { default as GoBackItem } from './components/Item/go-back-item';
7
+ export { default as LinkItem } from './components/Item/link-item';
8
+ export { default as CustomItem } from './components/Item/custom-item';
9
+ export { default as SkeletonItem } from './components/Item/skeleton-item';
10
+ export { default as Footer } from './components/Footer';
11
+ export { default as Header } from './components/Header';
12
+ export { default as NavigationHeader } from './components/NavigationHeader';
13
+ export { default as NavigationFooter } from './components/NavigationFooter';
14
+ export { default as LoadingItems } from './components/LoadingItems';
15
+ export { default as NestableNavigationContent } from './components/NestableNavigationContent';
2
16
  export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
3
17
  export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from './common/constants';
@@ -0,0 +1,3 @@
1
+ import { type MutableRefObject } from 'react';
2
+ declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
3
+ export default useChildIdsEffect;
@@ -0,0 +1,5 @@
1
+ import { type MutableRefObject } from 'react';
2
+ declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
3
+ childIdsRef: MutableRefObject<Set<string>>;
4
+ };
5
+ export default useChildIds;
@@ -0,0 +1,8 @@
1
+ import { type CustomItemComponentProps } from '@atlaskit/menu';
2
+ /**
3
+ * __Container__
4
+ *
5
+ * A container for Header and Footer that safely handles props to the child component
6
+ */
7
+ declare const HeaderContainer: (props: CustomItemComponentProps) => JSX.Element;
8
+ export default HeaderContainer;
@@ -4,12 +4,6 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type CustomItemComponentProps } from '@atlaskit/menu';
7
- /**
8
- * __Container__
9
- *
10
- * A container for Header and Footer that safely handles props to the child component
11
- */
12
- export declare const Container: (props: CustomItemComponentProps) => JSX.Element;
13
7
  export type HeaderProps = {
14
8
  /**
15
9
  * Element to render before the item text.
@@ -1,4 +1,32 @@
1
- export { SideNavigation, Header, NavigationHeader, NavigationContent, Section, HeadingItem, SkeletonHeadingItem, NestableNavigationContent, NestingItem, ButtonItem, LinkItem, GoBackItem, CustomItem, SkeletonItem, Footer, NavigationFooter, LoadingItems, } from './components';
2
- export type { CustomItemComponentProps, CustomItemProps, LoadingItemsProps, ButtonItemProps, FooterProps, GoBackItemProps, HeaderProps, HeadingItemProps, LinkItemProps, NavigationContentProps, NavigationFooterProps, NavigationHeaderProps, NestableNavigationContentProps, NestingItemProps, SectionProps, SideNavigationProps, SkeletonHeadingItemProps, SkeletonItemProps, } from './components';
1
+ export { default as SideNavigation } from './components/SideNavigation';
2
+ export type { SideNavigationProps } from './components/SideNavigation';
3
+ export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
4
+ export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps, } from './components/Section';
5
+ export { default as NestingItem } from './components/NestingItem';
6
+ export type { NestingItemProps } from './components/NestingItem';
7
+ export { default as NavigationContent } from './components/NavigationContent';
8
+ export type { NavigationContentProps } from './components/NavigationContent';
9
+ export { default as ButtonItem } from './components/Item/button-item';
10
+ export { default as GoBackItem } from './components/Item/go-back-item';
11
+ export { default as LinkItem } from './components/Item/link-item';
12
+ export { default as CustomItem } from './components/Item/custom-item';
13
+ export { default as SkeletonItem } from './components/Item/skeleton-item';
14
+ export type { CustomItemComponentProps, CustomItemProps } from './components/Item/custom-item';
15
+ export type { ButtonItemProps } from './components/Item/button-item';
16
+ export type { GoBackItemProps } from './components/Item/go-back-item';
17
+ export type { LinkItemProps } from './components/Item/link-item';
18
+ export type { SkeletonItemProps } from './components/Item/skeleton-item';
19
+ export { default as Footer } from './components/Footer';
20
+ export type { FooterProps } from './components/Footer';
21
+ export { default as Header } from './components/Header';
22
+ export type { HeaderProps } from './components/Header';
23
+ export { default as NavigationHeader } from './components/NavigationHeader';
24
+ export type { NavigationHeaderProps } from './components/NavigationHeader';
25
+ export { default as NavigationFooter } from './components/NavigationFooter';
26
+ export type { NavigationFooterProps } from './components/NavigationFooter';
27
+ export { default as LoadingItems } from './components/LoadingItems';
28
+ export type { LoadingItemsProps } from './components/LoadingItems';
29
+ export { default as NestableNavigationContent } from './components/NestableNavigationContent';
30
+ export type { NestableNavigationContentProps } from './components/NestableNavigationContent';
3
31
  export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
4
32
  export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from './common/constants';
@@ -0,0 +1,3 @@
1
+ import { type MutableRefObject } from 'react';
2
+ declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
3
+ export default useChildIdsEffect;
@@ -0,0 +1,5 @@
1
+ import { type MutableRefObject } from 'react';
2
+ declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
3
+ childIdsRef: MutableRefObject<Set<string>>;
4
+ };
5
+ export default useChildIds;
@@ -0,0 +1,8 @@
1
+ import { type CustomItemComponentProps } from '@atlaskit/menu';
2
+ /**
3
+ * __Container__
4
+ *
5
+ * A container for Header and Footer that safely handles props to the child component
6
+ */
7
+ declare const HeaderContainer: (props: CustomItemComponentProps) => JSX.Element;
8
+ export default HeaderContainer;
@@ -4,12 +4,6 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type CustomItemComponentProps } from '@atlaskit/menu';
7
- /**
8
- * __Container__
9
- *
10
- * A container for Header and Footer that safely handles props to the child component
11
- */
12
- export declare const Container: (props: CustomItemComponentProps) => JSX.Element;
13
7
  export type HeaderProps = {
14
8
  /**
15
9
  * Element to render before the item text.
@@ -1,4 +1,32 @@
1
- export { SideNavigation, Header, NavigationHeader, NavigationContent, Section, HeadingItem, SkeletonHeadingItem, NestableNavigationContent, NestingItem, ButtonItem, LinkItem, GoBackItem, CustomItem, SkeletonItem, Footer, NavigationFooter, LoadingItems, } from './components';
2
- export type { CustomItemComponentProps, CustomItemProps, LoadingItemsProps, ButtonItemProps, FooterProps, GoBackItemProps, HeaderProps, HeadingItemProps, LinkItemProps, NavigationContentProps, NavigationFooterProps, NavigationHeaderProps, NestableNavigationContentProps, NestingItemProps, SectionProps, SideNavigationProps, SkeletonHeadingItemProps, SkeletonItemProps, } from './components';
1
+ export { default as SideNavigation } from './components/SideNavigation';
2
+ export type { SideNavigationProps } from './components/SideNavigation';
3
+ export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
4
+ export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps, } from './components/Section';
5
+ export { default as NestingItem } from './components/NestingItem';
6
+ export type { NestingItemProps } from './components/NestingItem';
7
+ export { default as NavigationContent } from './components/NavigationContent';
8
+ export type { NavigationContentProps } from './components/NavigationContent';
9
+ export { default as ButtonItem } from './components/Item/button-item';
10
+ export { default as GoBackItem } from './components/Item/go-back-item';
11
+ export { default as LinkItem } from './components/Item/link-item';
12
+ export { default as CustomItem } from './components/Item/custom-item';
13
+ export { default as SkeletonItem } from './components/Item/skeleton-item';
14
+ export type { CustomItemComponentProps, CustomItemProps } from './components/Item/custom-item';
15
+ export type { ButtonItemProps } from './components/Item/button-item';
16
+ export type { GoBackItemProps } from './components/Item/go-back-item';
17
+ export type { LinkItemProps } from './components/Item/link-item';
18
+ export type { SkeletonItemProps } from './components/Item/skeleton-item';
19
+ export { default as Footer } from './components/Footer';
20
+ export type { FooterProps } from './components/Footer';
21
+ export { default as Header } from './components/Header';
22
+ export type { HeaderProps } from './components/Header';
23
+ export { default as NavigationHeader } from './components/NavigationHeader';
24
+ export type { NavigationHeaderProps } from './components/NavigationHeader';
25
+ export { default as NavigationFooter } from './components/NavigationFooter';
26
+ export type { NavigationFooterProps } from './components/NavigationFooter';
27
+ export { default as LoadingItems } from './components/LoadingItems';
28
+ export type { LoadingItemsProps } from './components/LoadingItems';
29
+ export { default as NestableNavigationContent } from './components/NestableNavigationContent';
30
+ export type { NestableNavigationContentProps } from './components/NestableNavigationContent';
3
31
  export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
4
32
  export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from './common/constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-navigation",
3
- "version": "11.1.11",
3
+ "version": "11.1.13",
4
4
  "description": "A highly composable side navigation component that supports nested views.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/css": "^0.19.0",
32
32
  "@atlaskit/ds-lib": "^6.0.0",
33
- "@atlaskit/icon": "^33.1.0",
33
+ "@atlaskit/icon": "^34.0.0",
34
34
  "@atlaskit/menu": "^8.4.0",
35
35
  "@atlaskit/motion": "^5.5.0",
36
36
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "ButtonItem", {
8
- enumerable: true,
9
- get: function get() {
10
- return _buttonItem.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "CustomItem", {
14
- enumerable: true,
15
- get: function get() {
16
- return _customItem.default;
17
- }
18
- });
19
- Object.defineProperty(exports, "GoBackItem", {
20
- enumerable: true,
21
- get: function get() {
22
- return _goBackItem.default;
23
- }
24
- });
25
- Object.defineProperty(exports, "LinkItem", {
26
- enumerable: true,
27
- get: function get() {
28
- return _linkItem.default;
29
- }
30
- });
31
- Object.defineProperty(exports, "SkeletonItem", {
32
- enumerable: true,
33
- get: function get() {
34
- return _skeletonItem.default;
35
- }
36
- });
37
- var _buttonItem = _interopRequireDefault(require("./button-item"));
38
- var _customItem = _interopRequireDefault(require("./custom-item"));
39
- var _goBackItem = _interopRequireDefault(require("./go-back-item"));
40
- var _linkItem = _interopRequireDefault(require("./link-item"));
41
- var _skeletonItem = _interopRequireDefault(require("./skeleton-item"));