@atlaskit/side-navigation 1.2.12 → 1.2.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 (100) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/codemods/{0.8.0-change-css-fn-prop.ts → 0.8.0-change-css-fn-prop.tsx} +0 -0
  3. package/codemods/__tests__/{0.8.0-change-css-fn-prop.ts → 0.8.0-change-css-fn-prop.tsx} +0 -0
  4. package/codemods/helpers/{generic.ts → generic.tsx} +0 -0
  5. package/dist/cjs/components/Footer/index.js +11 -2
  6. package/dist/cjs/components/Header/index.js +11 -2
  7. package/dist/cjs/components/Item/button-item.js +10 -1
  8. package/dist/cjs/components/Item/go-back-item.js +11 -1
  9. package/dist/cjs/components/Item/link-item.js +12 -1
  10. package/dist/cjs/components/Item/skeleton-item.js +11 -2
  11. package/dist/cjs/components/LoadingItems/index.js +6 -0
  12. package/dist/cjs/components/NavigationContent/index.js +9 -0
  13. package/dist/cjs/components/NavigationFooter/index.js +8 -0
  14. package/dist/cjs/components/NavigationHeader/index.js +9 -0
  15. package/dist/cjs/components/NestableNavigationContent/context.js +3 -0
  16. package/dist/cjs/components/NestableNavigationContent/index.js +8 -0
  17. package/dist/cjs/components/NestableNavigationContent/nesting-motion.js +3 -0
  18. package/dist/cjs/components/NestingItem/hack-for-ert.js +1 -0
  19. package/dist/cjs/components/Section/heading-item.js +7 -1
  20. package/dist/cjs/components/Section/section.js +11 -1
  21. package/dist/cjs/components/Section/skeleton-heading-item.js +10 -2
  22. package/dist/cjs/components/SideNavigation/index.js +10 -0
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/es2019/components/Footer/index.js +11 -2
  25. package/dist/es2019/components/Header/index.js +11 -2
  26. package/dist/es2019/components/Item/button-item.js +11 -1
  27. package/dist/es2019/components/Item/custom-item.js +2 -0
  28. package/dist/es2019/components/Item/go-back-item.js +12 -1
  29. package/dist/es2019/components/Item/link-item.js +13 -1
  30. package/dist/es2019/components/Item/skeleton-item.js +11 -2
  31. package/dist/es2019/components/LoadingItems/index.js +5 -0
  32. package/dist/es2019/components/NavigationContent/index.js +9 -0
  33. package/dist/es2019/components/NavigationFooter/index.js +8 -0
  34. package/dist/es2019/components/NavigationHeader/index.js +8 -0
  35. package/dist/es2019/components/NestableNavigationContent/context.js +4 -0
  36. package/dist/es2019/components/NestableNavigationContent/index.js +8 -0
  37. package/dist/es2019/components/NestableNavigationContent/nesting-motion.js +4 -0
  38. package/dist/es2019/components/NestingItem/hack-for-ert.js +1 -0
  39. package/dist/es2019/components/Section/heading-item.js +7 -1
  40. package/dist/es2019/components/Section/section.js +11 -1
  41. package/dist/es2019/components/Section/skeleton-heading-item.js +10 -2
  42. package/dist/es2019/components/SideNavigation/index.js +10 -0
  43. package/dist/es2019/version.json +1 -1
  44. package/dist/esm/components/Footer/index.js +11 -2
  45. package/dist/esm/components/Header/index.js +11 -2
  46. package/dist/esm/components/Item/button-item.js +11 -1
  47. package/dist/esm/components/Item/custom-item.js +2 -0
  48. package/dist/esm/components/Item/go-back-item.js +12 -1
  49. package/dist/esm/components/Item/link-item.js +13 -1
  50. package/dist/esm/components/Item/skeleton-item.js +11 -2
  51. package/dist/esm/components/LoadingItems/index.js +5 -0
  52. package/dist/esm/components/NavigationContent/index.js +9 -0
  53. package/dist/esm/components/NavigationFooter/index.js +8 -0
  54. package/dist/esm/components/NavigationHeader/index.js +8 -0
  55. package/dist/esm/components/NestableNavigationContent/context.js +4 -0
  56. package/dist/esm/components/NestableNavigationContent/index.js +8 -0
  57. package/dist/esm/components/NestableNavigationContent/nesting-motion.js +4 -0
  58. package/dist/esm/components/NestingItem/hack-for-ert.js +1 -0
  59. package/dist/esm/components/Section/heading-item.js +7 -1
  60. package/dist/esm/components/Section/section.js +11 -1
  61. package/dist/esm/components/Section/skeleton-heading-item.js +10 -2
  62. package/dist/esm/components/SideNavigation/index.js +10 -0
  63. package/dist/esm/version.json +1 -1
  64. package/dist/types/components/Footer/index.d.ts +6 -0
  65. package/dist/types/components/Header/index.d.ts +9 -3
  66. package/dist/types/components/Item/button-item.d.ts +9 -0
  67. package/dist/types/components/Item/custom-item.d.ts +2 -2
  68. package/dist/types/components/Item/go-back-item.d.ts +9 -0
  69. package/dist/types/components/Item/link-item.d.ts +11 -0
  70. package/dist/types/components/Item/skeleton-item.d.ts +8 -0
  71. package/dist/types/components/LoadingItems/index.d.ts +6 -1
  72. package/dist/types/components/NavigationContent/index.d.ts +8 -0
  73. package/dist/types/components/NavigationFooter/index.d.ts +8 -0
  74. package/dist/types/components/NavigationHeader/index.d.ts +8 -0
  75. package/dist/types/components/NestableNavigationContent/context.d.ts +3 -0
  76. package/dist/types/components/NestableNavigationContent/index.d.ts +12 -4
  77. package/dist/types/components/NestableNavigationContent/nesting-motion.d.ts +3 -0
  78. package/dist/types/components/NestingItem/index.d.ts +1 -1
  79. package/dist/types/components/Section/heading-item.d.ts +6 -0
  80. package/dist/types/components/Section/section.d.ts +9 -0
  81. package/dist/types/components/Section/skeleton-heading-item.d.ts +7 -0
  82. package/dist/types/components/SideNavigation/index.d.ts +9 -0
  83. package/docs/00-intro.tsx +10 -65
  84. package/package.json +8 -7
  85. package/report.api.md +419 -0
  86. package/docs/01-side-navigation.tsx +0 -33
  87. package/docs/02-navigation-header.tsx +0 -39
  88. package/docs/03-navigation-content.tsx +0 -40
  89. package/docs/04-nestable-navigation-content.tsx +0 -95
  90. package/docs/05-navigation-footer.tsx +0 -38
  91. package/docs/99-loading-states.tsx +0 -95
  92. package/docs/button-item.tsx +0 -38
  93. package/docs/custom-item.tsx +0 -45
  94. package/docs/go-back-item.tsx +0 -31
  95. package/docs/heading-item.tsx +0 -30
  96. package/docs/link-item.tsx +0 -39
  97. package/docs/nesting-item.tsx +0 -52
  98. package/docs/section.tsx +0 -40
  99. package/docs/skeleton-heading-item.tsx +0 -30
  100. package/docs/skeleton-item.tsx +0 -30
@@ -1,5 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { ButtonItemProps } from '@atlaskit/menu';
3
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
+ */
4
13
  declare const GoBackItem: React.ForwardRefExoticComponent<ButtonItemProps & React.RefAttributes<HTMLElement>>;
5
14
  export default GoBackItem;
@@ -1,5 +1,16 @@
1
1
  import React from 'react';
2
2
  import { LinkItemProps } from '@atlaskit/menu';
3
3
  export type { LinkItemProps } from '@atlaskit/menu';
4
+ /**
5
+ * __Link item__
6
+ *
7
+ * Renders an item wrapped in an anchor tag, useful when you have an item that
8
+ * should change routes using native browser navigation. For SPA transitions use
9
+ * a [custom item](https://atlassian.design/components/side-navigation/examples#custom-item)
10
+ * with the respective router logic.
11
+ *
12
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#link-item)
13
+ * - [Code](https://atlassian.design/components/side-navigation/code)
14
+ */
4
15
  declare const LinkItem: React.ForwardRefExoticComponent<LinkItemProps & React.RefAttributes<HTMLElement>>;
5
16
  export default LinkItem;
@@ -1,5 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import { SkeletonItemProps } from '@atlaskit/menu';
3
3
  export type { SkeletonItemProps } from '@atlaskit/menu';
4
+ /**
5
+ * __Skeleton item__
6
+ *
7
+ * A skeleton item can be used to reduce the perceived laoding time.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#loading)
10
+ * - [Code](https://atlassian.design/components/side-navigation/code)
11
+ */
4
12
  declare const SkeletonItem: (props: SkeletonItemProps) => JSX.Element | null;
5
13
  export default SkeletonItem;
@@ -19,12 +19,17 @@ export interface LoadingItemsProps {
19
19
  * A `testId` prop is provided for specified elements,
20
20
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
21
21
  * serving as a hook for automated tests.
22
-
22
+ *
23
23
  * Will set these elements when defined:
24
24
  * - The entering container - `{testId}--entering`
25
25
  * - The exiting container - `{testId}--exiting`
26
26
  */
27
27
  testId?: string;
28
28
  }
29
+ /**
30
+ * __Loading items__
31
+ *
32
+ * Loading items conditionally render based on the useShouldNestedElementRender() hook.
33
+ */
29
34
  declare const LoadingItems: ({ children, isLoading, fallback, testId, }: LoadingItemsProps) => JSX.Element;
30
35
  export default LoadingItems;
@@ -13,5 +13,13 @@ export interface NavigationContentProps {
13
13
  */
14
14
  testId?: string;
15
15
  }
16
+ /**
17
+ * __Navigation content__
18
+ *
19
+ * A navigation content is used as the container for navigation items.
20
+ *
21
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#content)
22
+ * - [Code](https://atlassian.design/components/side-navigation/code)
23
+ */
16
24
  declare const NavigationContent: import("react").ForwardRefExoticComponent<NavigationContentProps & HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
17
25
  export default NavigationContent;
@@ -3,5 +3,13 @@ import { ReactNode } from 'react';
3
3
  export interface NavigationFooterProps {
4
4
  children: ReactNode;
5
5
  }
6
+ /**
7
+ * __Navigation footer__
8
+ *
9
+ * Allows for customisation of the footer.
10
+ *
11
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
12
+ * - [Code](https://atlassian.design/components/side-navigation/code)
13
+ */
6
14
  declare const NavigationFooter: ({ children }: NavigationFooterProps) => JSX.Element;
7
15
  export default NavigationFooter;
@@ -2,5 +2,13 @@
2
2
  export interface NavigationHeaderProps {
3
3
  children: JSX.Element | JSX.Element[];
4
4
  }
5
+ /**
6
+ * __Navigation header__
7
+ *
8
+ * Allows for customisation of the header.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#header-and-footer)
11
+ * - [Code](https://atlassian.design/components/side-navigation/code)
12
+ */
5
13
  declare const NavigationHeader: (props: NavigationHeaderProps) => JSX.Element;
6
14
  export default NavigationHeader;
@@ -7,6 +7,9 @@ interface NestedContext {
7
7
  parentId: string;
8
8
  backButton?: React.ReactNode;
9
9
  }
10
+ /**
11
+ * @internal
12
+ */
10
13
  export declare const NestedContext: import("react").Context<NestedContext | undefined>;
11
14
  export declare const useNestedContext: () => NestedContext;
12
15
  /**
@@ -11,7 +11,7 @@ export interface NestableNavigationContentProps {
11
11
  * A `testId` prop is provided for specified elements,
12
12
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
13
13
  * serving as a hook for automated tests.
14
-
14
+ *
15
15
  * Will set these elements when defined:
16
16
  * - This wrapper - `{testId}`
17
17
  * - The back item (displayed when inside a nested view) - `{testId}--go-back-item`
@@ -38,9 +38,9 @@ export interface NestableNavigationContentProps {
38
38
  */
39
39
  onChange?: (stack: string[]) => void;
40
40
  /**
41
- Custom overrides for the composed components.
42
-
43
- @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
41
+ * Custom overrides for the composed components.
42
+ *
43
+ * @deprecated Please avoid using this prop as we intend to remove the prop completely in a future release. See DSP-2682 for more information.
44
44
  */
45
45
  overrides?: {
46
46
  /**
@@ -56,5 +56,13 @@ export interface NestableNavigationContentProps {
56
56
  };
57
57
  };
58
58
  }
59
+ /**
60
+ * __Nestable navigation content__
61
+ *
62
+ * The container for navigation items with nested views
63
+ *
64
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#nested-navigation)
65
+ * - [Code](https://atlassian.design/components/side-navigation/code)
66
+ */
59
67
  declare const NestableNavigationContent: (props: NestableNavigationContentProps) => JSX.Element;
60
68
  export default NestableNavigationContent;
@@ -14,5 +14,8 @@ interface NestingMotionProps {
14
14
  children: (props: ChildrenAsFunctionProps) => React.ReactNode;
15
15
  testId?: string;
16
16
  }
17
+ /**
18
+ * @internal
19
+ */
17
20
  export declare const NestingMotion: (props: NestingMotionProps) => JSX.Element;
18
21
  export {};
@@ -37,7 +37,7 @@ export interface NestingItemProps<TCustomComponentProps = CustomItemComponentPro
37
37
  * A `testId` prop is provided for specified elements,
38
38
  * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
39
39
  * serving as a hook for automated tests.
40
-
40
+ *
41
41
  * Will set these elements when defined:
42
42
  * - The container - `{testId}--container`
43
43
  * - The nesting item - `{testId}--item`
@@ -1,5 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { HeadingItemProps } from '@atlaskit/menu';
3
3
  export type { HeadingItemProps } from '@atlaskit/menu';
4
+ /**
5
+ * __Heading item__
6
+ *
7
+ * Available for advanced use cases, for most situations providing a title to Section should be enough.
8
+ *
9
+ */
4
10
  declare const HeadingItem: (props: HeadingItemProps) => JSX.Element | null;
5
11
  export default HeadingItem;
@@ -21,5 +21,14 @@ export interface SectionProps {
21
21
  */
22
22
  testId?: string;
23
23
  }
24
+ /**
25
+ * __Section__
26
+ *
27
+ * Used to separate items into sections. Using the title prop makes a section
28
+ * implicitly group the items for screen readers with no additional work required.
29
+ *
30
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#section)
31
+ * - [Code](https://atlassian.design/components/side-navigation/code)
32
+ */
24
33
  declare const Section: React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>>;
25
34
  export default Section;
@@ -1,5 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SkeletonHeadingItemProps } from '@atlaskit/menu';
3
3
  export type { SkeletonHeadingItemProps } from '@atlaskit/menu';
4
+ /**
5
+ * __Skeleton heading item__
6
+ *
7
+ * A skeleton heading item for use in managing loading states.
8
+ *
9
+ * - [Examples](https://atlassian.design/components/side-navigation/examples#loading)
10
+ */
4
11
  declare const SkeletonHeadingItem: (props: SkeletonHeadingItemProps) => JSX.Element | null;
5
12
  export default SkeletonHeadingItem;
@@ -19,5 +19,14 @@ export interface SideNavigationProps {
19
19
  */
20
20
  testId?: string;
21
21
  }
22
+ /**
23
+ * __Side navigation__
24
+ *
25
+ * A highly composable side navigation component that supports nested views.
26
+ *
27
+ * - [Examples](https://atlassian.design/components/side-navigation/examples)
28
+ * - [Code](https://atlassian.design/components/side-navigation/code)
29
+ * - [Usage](https://atlassian.design/components/side-navigation/usage)
30
+ */
22
31
  declare const SideNavigation: import("react").ForwardRefExoticComponent<SideNavigationProps & import("react").RefAttributes<HTMLElement>>;
23
32
  export default SideNavigation;
package/docs/00-intro.tsx CHANGED
@@ -1,70 +1,15 @@
1
1
  import React from 'react';
2
2
 
3
- import { code, Example, md } from '@atlaskit/docs';
3
+ import { md } from '@atlaskit/docs';
4
+ import SectionMessage from '@atlaskit/section-message';
4
5
 
5
6
  export default md`
6
-
7
- ## Documentation
8
-
9
- All the documentation can be found in the **sidebar nav links** 👈
10
-
11
- - [Side navigation](side-navigation/docs/side-navigation)
12
- - [Navigation header](side-navigation/docs/navigation-header)
13
- - [Navigation content](side-navigation/docs/navigation-content)
14
- - [Nestable navigation content](side-navigation/docs/nestable-navigation-content)
15
- - [Navigation footer](side-navigation/docs/navigation-content)
16
- - [Loading states](side-navigation/docs/loading-states)
17
- - [Button item](side-navigation/docs/button-item)
18
- - [Custom item](side-navigation/docs/custom-item)
19
- - [Go back item](side-navigation/docs/go-back-item)
20
- - [Link item](side-navigation/docs/link-item)
21
- - [Nesting item](side-navigation/docs/nesting-item)
22
- - [Heading item](side-navigation/docs/heading-item)
23
- - [Section](side-navigation/docs/section)
24
- - [Skeleton item](side-navigation/docs/skeleton-item)
25
- - [Skeleton heading item](side-navigation/docs/skeleton-heading-item)
26
-
27
- ## Usage
28
-
29
- ${code`
30
- import {
31
- SideNavigation,
32
- Section,
33
- NavigationHeader,
34
- Header,
35
- NestableNavigationContent,
36
- ButtonItem,
37
- NestingItem,
38
- Footer,
39
- NavigationFooter,
40
- } from '@atlaskit/side-navigation';
41
-
42
- <SideNavigation label="project">
43
- <NavigationHeader>
44
- <Header>NXTGen Industries</Header>
45
- </NavigationHeader>
46
- <NestableNavigationContent>
47
- <Section>
48
- <ButtonItem>Your work</ButtonItem>
49
- <NestingItem title="Filters">
50
- <Section>
51
- <ButtonItem>Search issues</ButtonItem>
52
- </Section>
53
- </NestingItem>
54
- </Section>
55
- </NestableNavigationContent>
56
- <NavigationFooter>
57
- <Footer>You're in a next-gen project</Footer>
58
- </NavigationFooter>
59
- </SideNavigation>
60
- `}
61
-
62
- ${(
63
- <Example
64
- title=""
65
- Component={require('../examples/00-nested-side-navigation').default}
66
- source={require('!!raw-loader!../examples/00-nested-side-navigation')}
67
- packageName="@atlaskit/sidebar-navigation"
68
- />
69
- )}
7
+ ${(
8
+ <SectionMessage appearance="information">
9
+ This component is now documented on{' '}
10
+ <a href="https://atlassian.design/components/side-navigation">
11
+ atlassian.design
12
+ </a>
13
+ </SectionMessage>
14
+ )}
70
15
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-navigation",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "A highly composable side navigation component that supports nested views.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -13,7 +13,7 @@
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
15
  "sideEffects": false,
16
- "atlaskit:src": "src/index.ts",
16
+ "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
19
  "deprecatedAutoEntryPoints": true,
@@ -24,10 +24,10 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/ds-lib": "^2.0.0",
27
+ "@atlaskit/ds-lib": "^2.1.0",
28
28
  "@atlaskit/icon": "^21.10.0",
29
29
  "@atlaskit/menu": "^1.3.0",
30
- "@atlaskit/motion": "^1.1.0",
30
+ "@atlaskit/motion": "^1.2.0",
31
31
  "@atlaskit/theme": "^12.1.0",
32
32
  "@atlaskit/tokens": "^0.10.0",
33
33
  "@babel/runtime": "^7.0.0",
@@ -40,10 +40,10 @@
40
40
  "@atlaskit/atlassian-navigation": "^2.2.0",
41
41
  "@atlaskit/button": "^16.3.0",
42
42
  "@atlaskit/docs": "*",
43
- "@atlaskit/logo": "^13.7.0",
44
- "@atlaskit/onboarding": "^10.4.0",
43
+ "@atlaskit/logo": "^13.8.0",
44
+ "@atlaskit/onboarding": "^10.5.0",
45
45
  "@atlaskit/section-message": "^6.0.0",
46
- "@atlaskit/select": "^15.3.0",
46
+ "@atlaskit/select": "^15.5.0",
47
47
  "@atlaskit/visual-regression": "*",
48
48
  "@atlaskit/webdriver-runner": "*",
49
49
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -62,6 +62,7 @@
62
62
  "import-structure": "atlassian-conventions"
63
63
  },
64
64
  "@repo/internal": {
65
+ "design-system": "v1",
65
66
  "dom-events": "use-bind-event-listener",
66
67
  "ui-components": "lite-mode",
67
68
  "analytics": "analytics-next",