@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
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- // eslint-disable-next-line import/no-anonymous-default-export
8
- function _default(_) {}
@@ -1,119 +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 _Item.ButtonItem;
11
- }
12
- });
13
- Object.defineProperty(exports, "CustomItem", {
14
- enumerable: true,
15
- get: function get() {
16
- return _Item.CustomItem;
17
- }
18
- });
19
- Object.defineProperty(exports, "Footer", {
20
- enumerable: true,
21
- get: function get() {
22
- return _Footer.default;
23
- }
24
- });
25
- Object.defineProperty(exports, "GoBackItem", {
26
- enumerable: true,
27
- get: function get() {
28
- return _Item.GoBackItem;
29
- }
30
- });
31
- Object.defineProperty(exports, "Header", {
32
- enumerable: true,
33
- get: function get() {
34
- return _Header.default;
35
- }
36
- });
37
- Object.defineProperty(exports, "HeadingItem", {
38
- enumerable: true,
39
- get: function get() {
40
- return _Section.HeadingItem;
41
- }
42
- });
43
- Object.defineProperty(exports, "LinkItem", {
44
- enumerable: true,
45
- get: function get() {
46
- return _Item.LinkItem;
47
- }
48
- });
49
- Object.defineProperty(exports, "LoadingItems", {
50
- enumerable: true,
51
- get: function get() {
52
- return _LoadingItems.default;
53
- }
54
- });
55
- Object.defineProperty(exports, "NavigationContent", {
56
- enumerable: true,
57
- get: function get() {
58
- return _NavigationContent.default;
59
- }
60
- });
61
- Object.defineProperty(exports, "NavigationFooter", {
62
- enumerable: true,
63
- get: function get() {
64
- return _NavigationFooter.default;
65
- }
66
- });
67
- Object.defineProperty(exports, "NavigationHeader", {
68
- enumerable: true,
69
- get: function get() {
70
- return _NavigationHeader.default;
71
- }
72
- });
73
- Object.defineProperty(exports, "NestableNavigationContent", {
74
- enumerable: true,
75
- get: function get() {
76
- return _NestableNavigationContent.default;
77
- }
78
- });
79
- Object.defineProperty(exports, "NestingItem", {
80
- enumerable: true,
81
- get: function get() {
82
- return _NestingItem.default;
83
- }
84
- });
85
- Object.defineProperty(exports, "Section", {
86
- enumerable: true,
87
- get: function get() {
88
- return _Section.Section;
89
- }
90
- });
91
- Object.defineProperty(exports, "SideNavigation", {
92
- enumerable: true,
93
- get: function get() {
94
- return _SideNavigation.default;
95
- }
96
- });
97
- Object.defineProperty(exports, "SkeletonHeadingItem", {
98
- enumerable: true,
99
- get: function get() {
100
- return _Section.SkeletonHeadingItem;
101
- }
102
- });
103
- Object.defineProperty(exports, "SkeletonItem", {
104
- enumerable: true,
105
- get: function get() {
106
- return _Item.SkeletonItem;
107
- }
108
- });
109
- var _SideNavigation = _interopRequireDefault(require("./SideNavigation"));
110
- var _Section = require("./Section");
111
- var _NestingItem = _interopRequireDefault(require("./NestingItem"));
112
- var _NavigationContent = _interopRequireDefault(require("./NavigationContent"));
113
- var _Item = require("./Item");
114
- var _Footer = _interopRequireDefault(require("./Footer"));
115
- var _Header = _interopRequireDefault(require("./Header"));
116
- var _NavigationHeader = _interopRequireDefault(require("./NavigationHeader"));
117
- var _NavigationFooter = _interopRequireDefault(require("./NavigationFooter"));
118
- var _LoadingItems = _interopRequireDefault(require("./LoadingItems"));
119
- var _NestableNavigationContent = _interopRequireDefault(require("./NestableNavigationContent"));
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useChildIdsEffect = exports.useChildIds = void 0;
7
- var _react = require("react");
8
- var _NestableNavigationContent = require("../NestableNavigationContent");
9
- var useChildIds = exports.useChildIds = function useChildIds(currentStackId, committedStack, onUnknownNest) {
10
- var childIdsRef = (0, _react.useRef)(new Set());
11
- (0, _react.useEffect)(function () {
12
- // we are holding navigation item IDs in childIdsRef
13
- // check if the current displayed nav item (currentStackId) is in childIdsRef. if it's not, this means it's undefined
14
- if (currentStackId === _NestableNavigationContent.ROOT_ID || !childIdsRef.current.size || childIdsRef.current.has(currentStackId) || !onUnknownNest) {
15
- return;
16
- }
17
- onUnknownNest(committedStack || [currentStackId]);
18
- }, [currentStackId, committedStack, onUnknownNest]);
19
- return {
20
- childIdsRef: childIdsRef
21
- };
22
- };
23
- var useChildIdsEffect = exports.useChildIdsEffect = function useChildIdsEffect(childIds, id) {
24
- (0, _react.useEffect)(function () {
25
- if (!childIds || !childIds.current) {
26
- return;
27
- }
28
- if (!childIds.current.has(id)) {
29
- childIds.current.add(id);
30
- }
31
- return function () {
32
- // eslint-disable-next-line react-hooks/exhaustive-deps
33
- childIds.current.delete(id);
34
- };
35
- // childIds shouldn't change as it's a ref
36
- // eslint-disable-next-line react-hooks/exhaustive-deps
37
- }, [id]);
38
- };
@@ -1,5 +0,0 @@
1
- export { default as ButtonItem } from './button-item';
2
- export { default as CustomItem } from './custom-item';
3
- export { default as GoBackItem } from './go-back-item';
4
- export { default as LinkItem } from './link-item';
5
- export { default as SkeletonItem } from './skeleton-item';
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line import/no-anonymous-default-export
2
- export default function (_) {}
@@ -1,11 +0,0 @@
1
- export { default as SideNavigation } from './SideNavigation';
2
- export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
3
- export { default as NestingItem } from './NestingItem';
4
- export { default as NavigationContent } from './NavigationContent';
5
- export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
6
- export { default as Footer } from './Footer';
7
- export { default as Header } from './Header';
8
- export { default as NavigationHeader } from './NavigationHeader';
9
- export { default as NavigationFooter } from './NavigationFooter';
10
- export { default as LoadingItems } from './LoadingItems';
11
- export { default as NestableNavigationContent } from './NestableNavigationContent';
@@ -1,32 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import { ROOT_ID } from '../NestableNavigationContent';
3
- export const useChildIds = (currentStackId, committedStack, onUnknownNest) => {
4
- const childIdsRef = useRef(new Set());
5
- useEffect(() => {
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
15
- };
16
- };
17
- export const useChildIdsEffect = (childIds, id) => {
18
- useEffect(() => {
19
- if (!childIds || !childIds.current) {
20
- return;
21
- }
22
- if (!childIds.current.has(id)) {
23
- childIds.current.add(id);
24
- }
25
- return () => {
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- childIds.current.delete(id);
28
- };
29
- // childIds shouldn't change as it's a ref
30
- // eslint-disable-next-line react-hooks/exhaustive-deps
31
- }, [id]);
32
- };
@@ -1,5 +0,0 @@
1
- export { default as ButtonItem } from './button-item';
2
- export { default as CustomItem } from './custom-item';
3
- export { default as GoBackItem } from './go-back-item';
4
- export { default as LinkItem } from './link-item';
5
- export { default as SkeletonItem } from './skeleton-item';
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line import/no-anonymous-default-export
2
- export default function (_) {}
@@ -1,11 +0,0 @@
1
- export { default as SideNavigation } from './SideNavigation';
2
- export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
3
- export { default as NestingItem } from './NestingItem';
4
- export { default as NavigationContent } from './NavigationContent';
5
- export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
6
- export { default as Footer } from './Footer';
7
- export { default as Header } from './Header';
8
- export { default as NavigationHeader } from './NavigationHeader';
9
- export { default as NavigationFooter } from './NavigationFooter';
10
- export { default as LoadingItems } from './LoadingItems';
11
- export { default as NestableNavigationContent } from './NestableNavigationContent';
@@ -1,32 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import { ROOT_ID } from '../NestableNavigationContent';
3
- export 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 var useChildIdsEffect = function useChildIdsEffect(childIds, id) {
18
- useEffect(function () {
19
- if (!childIds || !childIds.current) {
20
- return;
21
- }
22
- if (!childIds.current.has(id)) {
23
- childIds.current.add(id);
24
- }
25
- return function () {
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- childIds.current.delete(id);
28
- };
29
- // childIds shouldn't change as it's a ref
30
- // eslint-disable-next-line react-hooks/exhaustive-deps
31
- }, [id]);
32
- };
@@ -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';
@@ -1,2 +0,0 @@
1
- import { type NestingItemProps } from './index';
2
- export default function (_: NestingItemProps): void;
@@ -1,22 +0,0 @@
1
- export { default as SideNavigation } from './SideNavigation';
2
- export type { SideNavigationProps } from './SideNavigation';
3
- export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
4
- export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps } from './Section';
5
- export { default as NestingItem } from './NestingItem';
6
- export type { NestingItemProps } from './NestingItem';
7
- export { default as NavigationContent } from './NavigationContent';
8
- export type { NavigationContentProps } from './NavigationContent';
9
- export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
10
- export type { CustomItemComponentProps, CustomItemProps, ButtonItemProps, GoBackItemProps, LinkItemProps, SkeletonItemProps, } from './Item';
11
- export { default as Footer } from './Footer';
12
- export type { FooterProps } from './Footer';
13
- export { default as Header } from './Header';
14
- export type { HeaderProps } from './Header';
15
- export { default as NavigationHeader } from './NavigationHeader';
16
- export type { NavigationHeaderProps } from './NavigationHeader';
17
- export { default as NavigationFooter } from './NavigationFooter';
18
- export type { NavigationFooterProps } from './NavigationFooter';
19
- export { default as LoadingItems } from './LoadingItems';
20
- export type { LoadingItemsProps } from './LoadingItems';
21
- export { default as NestableNavigationContent } from './NestableNavigationContent';
22
- export type { NestableNavigationContentProps } from './NestableNavigationContent';
@@ -1,5 +0,0 @@
1
- import { type MutableRefObject } from 'react';
2
- export declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
3
- childIdsRef: MutableRefObject<Set<string>>;
4
- };
5
- export declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;
@@ -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';
@@ -1,2 +0,0 @@
1
- import { type NestingItemProps } from './index';
2
- export default function (_: NestingItemProps): void;
@@ -1,22 +0,0 @@
1
- export { default as SideNavigation } from './SideNavigation';
2
- export type { SideNavigationProps } from './SideNavigation';
3
- export { Section, HeadingItem, SkeletonHeadingItem } from './Section';
4
- export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps } from './Section';
5
- export { default as NestingItem } from './NestingItem';
6
- export type { NestingItemProps } from './NestingItem';
7
- export { default as NavigationContent } from './NavigationContent';
8
- export type { NavigationContentProps } from './NavigationContent';
9
- export { ButtonItem, GoBackItem, LinkItem, CustomItem, SkeletonItem } from './Item';
10
- export type { CustomItemComponentProps, CustomItemProps, ButtonItemProps, GoBackItemProps, LinkItemProps, SkeletonItemProps, } from './Item';
11
- export { default as Footer } from './Footer';
12
- export type { FooterProps } from './Footer';
13
- export { default as Header } from './Header';
14
- export type { HeaderProps } from './Header';
15
- export { default as NavigationHeader } from './NavigationHeader';
16
- export type { NavigationHeaderProps } from './NavigationHeader';
17
- export { default as NavigationFooter } from './NavigationFooter';
18
- export type { NavigationFooterProps } from './NavigationFooter';
19
- export { default as LoadingItems } from './LoadingItems';
20
- export type { LoadingItemsProps } from './LoadingItems';
21
- export { default as NestableNavigationContent } from './NestableNavigationContent';
22
- export type { NestableNavigationContentProps } from './NestableNavigationContent';
@@ -1,5 +0,0 @@
1
- import { type MutableRefObject } from 'react';
2
- export declare const useChildIds: (currentStackId: string, committedStack: string[], onUnknownNest?: (stack: string[]) => void) => {
3
- childIdsRef: MutableRefObject<Set<string>>;
4
- };
5
- export declare const useChildIdsEffect: (childIds: MutableRefObject<Set<string>>, id: string) => void;