@atlaskit/side-navigation 11.1.14 → 11.1.15

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 (99) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/Item/button-item.js +2 -2
  3. package/dist/cjs/components/Item/custom-item.js +2 -2
  4. package/dist/cjs/components/Item/link-item.js +2 -2
  5. package/dist/cjs/components/Item/skeleton-item.js +2 -2
  6. package/dist/cjs/components/LoadingItems/index.js +2 -2
  7. package/dist/cjs/components/NavigationContent/container-css.js +33 -0
  8. package/dist/cjs/components/NavigationContent/index.js +2 -2
  9. package/dist/cjs/components/NavigationContent/inner-container-css.js +51 -0
  10. package/dist/cjs/components/NavigationContent/outer-container-css.js +44 -0
  11. package/dist/cjs/components/NestableNavigationContent/index.js +2 -2
  12. package/dist/cjs/components/NestableNavigationContent/nested-context.js +10 -0
  13. package/dist/cjs/components/NestableNavigationContent/use-nested-context.js +19 -0
  14. package/dist/cjs/components/NestableNavigationContent/use-should-nested-element-render.js +19 -0
  15. package/dist/cjs/components/NestingItem/index.js +4 -3
  16. package/dist/cjs/components/Section/heading-item.js +2 -3
  17. package/dist/cjs/components/Section/section.js +2 -2
  18. package/dist/cjs/components/Section/skeleton-heading-item.js +2 -3
  19. package/dist/cjs/index.js +8 -6
  20. package/dist/es2019/components/Item/button-item.js +1 -1
  21. package/dist/es2019/components/Item/custom-item.js +1 -1
  22. package/dist/es2019/components/Item/go-back-item.js +1 -0
  23. package/dist/es2019/components/Item/link-item.js +1 -1
  24. package/dist/es2019/components/Item/skeleton-item.js +2 -1
  25. package/dist/es2019/components/LoadingItems/index.js +1 -1
  26. package/dist/es2019/components/NavigationContent/container-css.js +25 -0
  27. package/dist/es2019/components/NavigationContent/index.js +1 -1
  28. package/dist/es2019/components/NavigationContent/inner-container-css.js +41 -0
  29. package/dist/es2019/components/NavigationContent/outer-container-css.js +36 -0
  30. package/dist/es2019/components/NestableNavigationContent/index.js +1 -1
  31. package/dist/es2019/components/NestableNavigationContent/nested-context.js +3 -0
  32. package/dist/es2019/components/NestableNavigationContent/use-nested-context.js +18 -0
  33. package/dist/es2019/components/NestableNavigationContent/use-should-nested-element-render.js +13 -0
  34. package/dist/es2019/components/NestingItem/index.js +2 -1
  35. package/dist/es2019/components/Section/heading-item.js +1 -2
  36. package/dist/es2019/components/Section/section.js +1 -1
  37. package/dist/es2019/components/Section/skeleton-heading-item.js +1 -2
  38. package/dist/es2019/index.js +4 -2
  39. package/dist/esm/components/Item/button-item.js +1 -1
  40. package/dist/esm/components/Item/custom-item.js +1 -1
  41. package/dist/esm/components/Item/go-back-item.js +1 -0
  42. package/dist/esm/components/Item/link-item.js +1 -1
  43. package/dist/esm/components/Item/skeleton-item.js +2 -1
  44. package/dist/esm/components/LoadingItems/index.js +1 -1
  45. package/dist/esm/components/NavigationContent/container-css.js +27 -0
  46. package/dist/esm/components/NavigationContent/index.js +1 -1
  47. package/dist/esm/components/NavigationContent/inner-container-css.js +44 -0
  48. package/dist/esm/components/NavigationContent/outer-container-css.js +38 -0
  49. package/dist/esm/components/NestableNavigationContent/index.js +1 -1
  50. package/dist/esm/components/NestableNavigationContent/nested-context.js +3 -0
  51. package/dist/esm/components/NestableNavigationContent/use-nested-context.js +13 -0
  52. package/dist/esm/components/NestableNavigationContent/use-should-nested-element-render.js +13 -0
  53. package/dist/esm/components/NestingItem/index.js +2 -1
  54. package/dist/esm/components/Section/heading-item.js +1 -2
  55. package/dist/esm/components/Section/section.js +1 -1
  56. package/dist/esm/components/Section/skeleton-heading-item.js +1 -2
  57. package/dist/esm/index.js +4 -2
  58. package/dist/types/components/Item/button-item.d.ts +0 -1
  59. package/dist/types/components/Item/custom-item.d.ts +3 -2
  60. package/dist/types/components/Item/go-back-item.d.ts +0 -1
  61. package/dist/types/components/Item/link-item.d.ts +0 -1
  62. package/dist/types/components/Item/skeleton-item.d.ts +0 -1
  63. package/dist/types/components/NavigationContent/container-css.d.ts +18 -0
  64. package/dist/types/components/NavigationContent/inner-container-css.d.ts +34 -0
  65. package/dist/types/components/NavigationContent/outer-container-css.d.ts +36 -0
  66. package/dist/types/components/NestableNavigationContent/{context.d.ts → nested-context.d.ts} +0 -15
  67. package/dist/types/components/NestableNavigationContent/use-nested-context.d.ts +2 -0
  68. package/dist/types/components/NestableNavigationContent/use-should-nested-element-render.d.ts +3 -0
  69. package/dist/types/components/Section/heading-item.d.ts +3 -2
  70. package/dist/types/components/Section/skeleton-heading-item.d.ts +3 -2
  71. package/dist/types/index.d.ts +12 -8
  72. package/dist/types-ts4.5/components/Item/button-item.d.ts +0 -1
  73. package/dist/types-ts4.5/components/Item/custom-item.d.ts +3 -2
  74. package/dist/types-ts4.5/components/Item/go-back-item.d.ts +0 -1
  75. package/dist/types-ts4.5/components/Item/link-item.d.ts +0 -1
  76. package/dist/types-ts4.5/components/Item/skeleton-item.d.ts +0 -1
  77. package/dist/types-ts4.5/components/NavigationContent/container-css.d.ts +18 -0
  78. package/dist/types-ts4.5/components/NavigationContent/inner-container-css.d.ts +34 -0
  79. package/dist/types-ts4.5/components/NavigationContent/outer-container-css.d.ts +36 -0
  80. package/dist/types-ts4.5/components/NestableNavigationContent/{context.d.ts → nested-context.d.ts} +0 -15
  81. package/dist/types-ts4.5/components/NestableNavigationContent/use-nested-context.d.ts +2 -0
  82. package/dist/types-ts4.5/components/NestableNavigationContent/use-should-nested-element-render.d.ts +3 -0
  83. package/dist/types-ts4.5/components/Section/heading-item.d.ts +3 -2
  84. package/dist/types-ts4.5/components/Section/skeleton-heading-item.d.ts +3 -2
  85. package/dist/types-ts4.5/index.d.ts +12 -8
  86. package/package.json +6 -6
  87. package/dist/cjs/components/NavigationContent/styles.js +0 -127
  88. package/dist/cjs/components/NestableNavigationContent/context.js +0 -43
  89. package/dist/cjs/components/Section/index.js +0 -27
  90. package/dist/es2019/components/NavigationContent/styles.js +0 -113
  91. package/dist/es2019/components/NestableNavigationContent/context.js +0 -43
  92. package/dist/es2019/components/Section/index.js +0 -3
  93. package/dist/esm/components/NavigationContent/styles.js +0 -120
  94. package/dist/esm/components/NestableNavigationContent/context.js +0 -38
  95. package/dist/esm/components/Section/index.js +0 -3
  96. package/dist/types/components/NavigationContent/styles.d.ts +0 -91
  97. package/dist/types/components/Section/index.d.ts +0 -6
  98. package/dist/types-ts4.5/components/NavigationContent/styles.d.ts +0 -91
  99. package/dist/types-ts4.5/components/Section/index.d.ts +0 -6
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { type SkeletonHeadingItemProps } from '@atlaskit/menu';
3
- export type { SkeletonHeadingItemProps } from '@atlaskit/menu';
2
+ import { type SkeletonHeadingItemProps as MenuSkeletonHeadingItemProps } from '@atlaskit/menu';
3
+ export interface SkeletonHeadingItemProps extends MenuSkeletonHeadingItemProps {
4
+ }
4
5
  /**
5
6
  * __Skeleton heading item__
6
7
  *
@@ -1,7 +1,11 @@
1
1
  export { default as SideNavigation } from './components/SideNavigation';
2
2
  export type { SideNavigationProps } from './components/SideNavigation';
3
- export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
4
- export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps, } from './components/Section';
3
+ export { default as Section } from './components/Section/section';
4
+ export { default as HeadingItem } from './components/Section/heading-item';
5
+ export { default as SkeletonHeadingItem } from './components/Section/skeleton-heading-item';
6
+ export type { HeadingItemProps } from './components/Section/heading-item';
7
+ export type { SectionProps } from './components/Section/section';
8
+ export type { SkeletonHeadingItemProps } from './components/Section/skeleton-heading-item';
5
9
  export { default as NestingItem } from './components/NestingItem';
6
10
  export type { NestingItemProps } from './components/NestingItem';
7
11
  export { default as NavigationContent } from './components/NavigationContent';
@@ -11,11 +15,11 @@ export { default as GoBackItem } from './components/Item/go-back-item';
11
15
  export { default as LinkItem } from './components/Item/link-item';
12
16
  export { default as CustomItem } from './components/Item/custom-item';
13
17
  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';
18
+ export type { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
19
+ export type { ButtonItemProps } from '@atlaskit/menu';
20
+ export type { ButtonItemProps as GoBackItemProps } from '@atlaskit/menu';
21
+ export type { LinkItemProps } from '@atlaskit/menu';
22
+ export type { SkeletonItemProps } from '@atlaskit/menu';
19
23
  export { default as Footer } from './components/Footer';
20
24
  export type { FooterProps } from './components/Footer';
21
25
  export { default as Header } from './components/Header';
@@ -28,5 +32,5 @@ export { default as LoadingItems } from './components/LoadingItems';
28
32
  export type { LoadingItemsProps } from './components/LoadingItems';
29
33
  export { default as NestableNavigationContent } from './components/NestableNavigationContent';
30
34
  export type { NestableNavigationContentProps } from './components/NestableNavigationContent';
31
- export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
35
+ export { useShouldNestedElementRender } from './components/NestableNavigationContent/use-should-nested-element-render';
32
36
  export { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from './common/constants';
@@ -1,5 +1,4 @@
1
1
  import { type ButtonItemProps } from '@atlaskit/menu';
2
- export type { ButtonItemProps } from '@atlaskit/menu';
3
2
  /**
4
3
  * __Button item__
5
4
  *
@@ -1,5 +1,6 @@
1
- import { type CustomItemComponentProps, type CustomItemProps } from '@atlaskit/menu';
2
- export type { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
1
+ import { type CustomItemProps, type CustomItemComponentProps as MenuCustomItemComponentProps } from '@atlaskit/menu';
2
+ export interface CustomItemComponentProps extends MenuCustomItemComponentProps {
3
+ }
3
4
  interface CustomItemPropsHack {
4
5
  <TComponentProps extends {}>(props: CustomItemProps<TComponentProps> & {
5
6
  ref?: any;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { ButtonItemProps } from '@atlaskit/menu';
3
- export type { ButtonItemProps as GoBackItemProps } from '@atlaskit/menu';
4
3
  /**
5
4
  * __Go back item__
6
5
  *
@@ -1,5 +1,4 @@
1
1
  import { type LinkItemProps } from '@atlaskit/menu';
2
- export type { LinkItemProps } from '@atlaskit/menu';
3
2
  /**
4
3
  * __Link item__
5
4
  *
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type SkeletonItemProps } from '@atlaskit/menu';
3
- export type { SkeletonItemProps } from '@atlaskit/menu';
4
3
  /**
5
4
  * __Skeleton item__
6
5
  *
@@ -0,0 +1,18 @@
1
+ interface StyleOpts {
2
+ showTopScrollIndicator?: boolean;
3
+ }
4
+ export declare const containerCSS: (opts: StyleOpts) => {
5
+ readonly marginTop: 0 | 2;
6
+ readonly marginLeft: "var(--ds-space-100)";
7
+ readonly marginRight: "var(--ds-space-100)";
8
+ readonly position: "relative";
9
+ readonly "& [data-ds--menu--heading-item]": {
10
+ readonly marginBottom: "var(--ds-space-075)";
11
+ readonly marginTop: "var(--ds-space-200)";
12
+ };
13
+ readonly "& [data-ds--menu--skeleton-heading-item]": {
14
+ readonly marginTop: number;
15
+ readonly marginBottom: number;
16
+ };
17
+ };
18
+ export {};
@@ -0,0 +1,34 @@
1
+ interface StyleOpts {
2
+ showTopScrollIndicator?: boolean;
3
+ }
4
+ export declare const innerContainerCSS: (opts: StyleOpts) => {
5
+ readonly "&::after": {
6
+ readonly borderRadius: "var(--ds-radius-xsmall)";
7
+ readonly content: "''";
8
+ readonly display: "block";
9
+ readonly flexShrink: 0;
10
+ readonly height: 2;
11
+ readonly marginTop: "auto";
12
+ readonly position: "relative";
13
+ readonly zIndex: 2;
14
+ readonly backgroundColor: "var(--ds-menu-scroll-indicator-color, var(--ds-surface))";
15
+ };
16
+ readonly "&::before"?: {
17
+ readonly borderRadius: "var(--ds-radius-xsmall)";
18
+ readonly content: "''";
19
+ readonly left: 0;
20
+ readonly right: 0;
21
+ readonly height: 2;
22
+ readonly backgroundColor: "var(--ds-menu-scroll-indicator-color, var(--ds-surface))";
23
+ readonly position: "absolute";
24
+ readonly display: "block";
25
+ readonly zIndex: 2;
26
+ } | undefined;
27
+ readonly display: "flex";
28
+ readonly overflow: "auto";
29
+ readonly width: "100%";
30
+ readonly position: "relative";
31
+ readonly boxSizing: "border-box";
32
+ readonly flexDirection: "column";
33
+ };
34
+ export {};
@@ -0,0 +1,36 @@
1
+ interface StyleOpts {
2
+ showTopScrollIndicator?: boolean;
3
+ }
4
+ export declare const outerContainerCSS: (opts: StyleOpts & {
5
+ scrollbarWidth: number;
6
+ }) => {
7
+ readonly display: "flex";
8
+ readonly height: "100%";
9
+ readonly overflow: "hidden";
10
+ readonly position: "relative";
11
+ readonly "&::before": {
12
+ readonly content: "''";
13
+ readonly display: "block";
14
+ readonly left: "var(--ds-space-100)";
15
+ readonly right: number;
16
+ readonly height: 2;
17
+ readonly borderRadius: "var(--ds-radius-xsmall)";
18
+ readonly backgroundColor: "var(--ds-menu-seperator-color, var(--ds-border))";
19
+ readonly position: "absolute";
20
+ readonly zIndex: 1;
21
+ };
22
+ readonly "&::after": {
23
+ readonly content: "''";
24
+ readonly position: "absolute";
25
+ readonly display: "block";
26
+ readonly borderRadius: "var(--ds-radius-xsmall)";
27
+ readonly flexShrink: 0;
28
+ readonly height: 2;
29
+ readonly left: "var(--ds-space-100)";
30
+ readonly right: number;
31
+ readonly bottom: 0;
32
+ readonly zIndex: 1;
33
+ readonly backgroundColor: "var(--ds-menu-seperator-color, var(--ds-border))";
34
+ };
35
+ };
36
+ export {};
@@ -1,7 +1,4 @@
1
1
  import { type MutableRefObject } from 'react';
2
- /**
3
- * @internal
4
- */
5
2
  export interface NestedContextValue {
6
3
  currentStackId: string;
7
4
  onNest: (id: string) => void;
@@ -16,16 +13,4 @@ export interface NestedContextValue {
16
13
  isDefaultFocusControl?: boolean;
17
14
  focusGoBackButton?: boolean;
18
15
  }
19
- /**
20
- * @internal
21
- */
22
16
  export declare const NestedContext: import('react').Context<NestedContextValue | undefined>;
23
- export declare const useNestedContext: () => NestedContextValue;
24
- /**
25
- * Used by children of the NestableNavigationContent component to see if they should render or not.
26
- * If `shouldRender` returns `true` - return your nodes.
27
- * If it returns `false` - either return `null` or `children` if you have children.
28
- */
29
- export declare const useShouldNestedElementRender: () => {
30
- shouldRender: boolean;
31
- };
@@ -0,0 +1,2 @@
1
+ import { type NestedContextValue } from './nested-context';
2
+ export declare const useNestedContext: () => NestedContextValue;
@@ -0,0 +1,3 @@
1
+ export declare const useShouldNestedElementRender: () => {
2
+ shouldRender: boolean;
3
+ };
@@ -2,8 +2,9 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { type HeadingItemProps } from '@atlaskit/menu';
6
- export type { HeadingItemProps } from '@atlaskit/menu';
5
+ import { type HeadingItemProps as MenuHeadingItemProps } from '@atlaskit/menu';
6
+ export interface HeadingItemProps extends MenuHeadingItemProps {
7
+ }
7
8
  /**
8
9
  * __Heading item__
9
10
  *
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { type SkeletonHeadingItemProps } from '@atlaskit/menu';
3
- export type { SkeletonHeadingItemProps } from '@atlaskit/menu';
2
+ import { type SkeletonHeadingItemProps as MenuSkeletonHeadingItemProps } from '@atlaskit/menu';
3
+ export interface SkeletonHeadingItemProps extends MenuSkeletonHeadingItemProps {
4
+ }
4
5
  /**
5
6
  * __Skeleton heading item__
6
7
  *
@@ -1,7 +1,11 @@
1
1
  export { default as SideNavigation } from './components/SideNavigation';
2
2
  export type { SideNavigationProps } from './components/SideNavigation';
3
- export { Section, HeadingItem, SkeletonHeadingItem } from './components/Section';
4
- export type { HeadingItemProps, SectionProps, SkeletonHeadingItemProps, } from './components/Section';
3
+ export { default as Section } from './components/Section/section';
4
+ export { default as HeadingItem } from './components/Section/heading-item';
5
+ export { default as SkeletonHeadingItem } from './components/Section/skeleton-heading-item';
6
+ export type { HeadingItemProps } from './components/Section/heading-item';
7
+ export type { SectionProps } from './components/Section/section';
8
+ export type { SkeletonHeadingItemProps } from './components/Section/skeleton-heading-item';
5
9
  export { default as NestingItem } from './components/NestingItem';
6
10
  export type { NestingItemProps } from './components/NestingItem';
7
11
  export { default as NavigationContent } from './components/NavigationContent';
@@ -11,11 +15,11 @@ export { default as GoBackItem } from './components/Item/go-back-item';
11
15
  export { default as LinkItem } from './components/Item/link-item';
12
16
  export { default as CustomItem } from './components/Item/custom-item';
13
17
  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';
18
+ export type { CustomItemComponentProps, CustomItemProps } from '@atlaskit/menu';
19
+ export type { ButtonItemProps } from '@atlaskit/menu';
20
+ export type { ButtonItemProps as GoBackItemProps } from '@atlaskit/menu';
21
+ export type { LinkItemProps } from '@atlaskit/menu';
22
+ export type { SkeletonItemProps } from '@atlaskit/menu';
19
23
  export { default as Footer } from './components/Footer';
20
24
  export type { FooterProps } from './components/Footer';
21
25
  export { default as Header } from './components/Header';
@@ -28,5 +32,5 @@ export { default as LoadingItems } from './components/LoadingItems';
28
32
  export type { LoadingItemsProps } from './components/LoadingItems';
29
33
  export { default as NestableNavigationContent } from './components/NestableNavigationContent';
30
34
  export type { NestableNavigationContentProps } from './components/NestableNavigationContent';
31
- export { useShouldNestedElementRender } from './components/NestableNavigationContent/context';
35
+ export { useShouldNestedElementRender } from './components/NestableNavigationContent/use-should-nested-element-render';
32
36
  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.14",
3
+ "version": "11.1.15",
4
4
  "description": "A highly composable side navigation component that supports nested views.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/css": "^0.19.0",
39
- "@atlaskit/ds-lib": "^6.0.0",
39
+ "@atlaskit/ds-lib": "^7.0.0",
40
40
  "@atlaskit/icon": "^34.0.0",
41
41
  "@atlaskit/menu": "^8.4.0",
42
42
  "@atlaskit/motion": "^5.5.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/primitives": "^18.1.0",
45
- "@atlaskit/tokens": "^11.4.0",
45
+ "@atlaskit/tokens": "^12.0.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@compiled/react": "^0.20.0"
48
48
  },
@@ -54,13 +54,13 @@
54
54
  "@af/integration-testing": "workspace:^",
55
55
  "@af/visual-regression": "workspace:^",
56
56
  "@atlaskit/atlassian-navigation": "^5.6.0",
57
- "@atlaskit/button": "^23.10.0",
57
+ "@atlaskit/button": "^23.11.0",
58
58
  "@atlaskit/docs": "^11.7.0",
59
59
  "@atlaskit/dropdown-menu": "^16.8.0",
60
60
  "@atlaskit/form": "^15.5.0",
61
61
  "@atlaskit/image": "^3.0.0",
62
- "@atlaskit/link": "^3.3.0",
63
- "@atlaskit/logo": "^19.10.0",
62
+ "@atlaskit/link": "^3.4.0",
63
+ "@atlaskit/logo": "^20.0.0",
64
64
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
65
65
  "@atlaskit/pragmatic-drag-and-drop-live-region": "^1.3.0",
66
66
  "@atlaskit/pragmatic-drag-and-drop-react-accessibility": "^2.2.0",
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.outerContainerCSS = exports.innerContainerCSS = exports.containerCSS = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _constants = require("../../common/constants");
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
- 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
- var scrollIndicatorMaskZIndex = 2;
13
- var scrollIndicatorZIndex = 1;
14
- var scrollIndicatorHeight = 2;
15
- var scrollIndicatorBorderRadius = '1px';
16
- var containerPadding = 8;
17
- var itemHeadingContentHeight = 16; // Originally headingSizes.h100.lineHeight from '@atlaskit/theme/typography'
18
- var skeletonHeadingHeight = containerPadding;
19
- var skeletonHeadingMarginOffset = 3;
20
- // Skeleton content is slightly shorter than the real content.
21
- // Because of that we slightly increase the top margin to offset this so the
22
- // containing size both real and skeleton always equal approx 30px.
23
- var skeletonHeadingTopMargin = containerPadding * 2.5 + (itemHeadingContentHeight - skeletonHeadingHeight) - skeletonHeadingMarginOffset;
24
- // We want to move the entire body up by 3px without affecting the height of the skeleton container.
25
- var skeletonHeadingBottomMargin = containerPadding * 0.75 + skeletonHeadingMarginOffset;
26
- /**
27
- * This outer container css contains the "real" scroll indicators which are
28
- * always rendered to the screen.
29
- * They are "conditionally" shown from the users perspective using the inner container CSS
30
- * which has other pseudo elements which "mask" the "real" scroll indicators.
31
- */
32
- var outerContainerCSS = exports.outerContainerCSS = function outerContainerCSS(opts) {
33
- return {
34
- // Flex is needed to ensure the overflow indicators are positioned correctly.
35
- display: 'flex',
36
- height: '100%',
37
- overflow: 'hidden',
38
- position: 'relative',
39
- '&::before': {
40
- content: "''",
41
- display: 'block',
42
- left: "var(--ds-space-100, 8px)",
43
- right: containerPadding + opts.scrollbarWidth,
44
- height: scrollIndicatorHeight,
45
- borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"),
46
- backgroundColor: "var(".concat(_constants.VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, #0B120E24)", ")"),
47
- position: 'absolute',
48
- zIndex: scrollIndicatorZIndex
49
- },
50
- '&::after': {
51
- content: "''",
52
- position: 'absolute',
53
- display: 'block',
54
- borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"),
55
- flexShrink: 0,
56
- height: scrollIndicatorHeight,
57
- left: "var(--ds-space-100, 8px)",
58
- right: containerPadding + opts.scrollbarWidth,
59
- bottom: 0,
60
- zIndex: scrollIndicatorZIndex,
61
- backgroundColor: "var(".concat(_constants.VAR_SEPARATOR_COLOR, ", ", "var(--ds-border, #0B120E24)", ")")
62
- }
63
- };
64
- };
65
-
66
- /**
67
- * This inner container css contains the "mask" logic for the scroll indicators.
68
- * Essentially they cover (mask) the "real" scroll indicators when the user is scrolled
69
- * to the top or bottom of the container.
70
- */
71
- var innerContainerCSS = exports.innerContainerCSS = function innerContainerCSS(opts) {
72
- return _objectSpread(_objectSpread({
73
- display: 'flex',
74
- overflow: 'auto',
75
- width: '100%',
76
- position: 'relative',
77
- boxSizing: 'border-box',
78
- flexDirection: 'column'
79
- }, !opts.showTopScrollIndicator && {
80
- '&::before': {
81
- borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"),
82
- content: "''",
83
- left: 0,
84
- right: 0,
85
- height: scrollIndicatorHeight,
86
- backgroundColor: "var(".concat(_constants.VAR_SCROLL_INDICATOR_COLOR, ", ", "var(--ds-surface, #FFFFFF)", ")"),
87
- position: 'absolute',
88
- display: 'block',
89
- zIndex: scrollIndicatorMaskZIndex
90
- }
91
- }), {}, {
92
- // This after pseudo element abuses being a flex child and pushes itself down to the
93
- // very bottom of the container - doing so ends up "masking" the actual scroll indicator.
94
- '&::after': {
95
- borderRadius: "var(--ds-radius-xsmall, ".concat(scrollIndicatorBorderRadius, ")"),
96
- content: "''",
97
- display: 'block',
98
- flexShrink: 0,
99
- height: scrollIndicatorHeight,
100
- // This is used to "push" the element to the bottom of the flex container.
101
- marginTop: 'auto',
102
- position: 'relative',
103
- zIndex: scrollIndicatorMaskZIndex,
104
- backgroundColor: "var(".concat(_constants.VAR_SCROLL_INDICATOR_COLOR, ", ", "var(--ds-surface, #FFFFFF)", ")")
105
- }
106
- });
107
- };
108
- var containerCSS = exports.containerCSS = function containerCSS(opts) {
109
- return {
110
- // When the scroll indicator is always shown we need to add some padding
111
- // so the spacing between matches what it would be if the indicator was a "block" element.
112
- // We use margin here so any child absolutely positioned elements are positioned correctly.
113
- marginTop: opts.showTopScrollIndicator ? scrollIndicatorHeight : 0,
114
- marginLeft: "var(--ds-space-100, 8px)",
115
- marginRight: "var(--ds-space-100, 8px)",
116
- // Enables child absolutely positioned elements to be positioned relative to this element.
117
- position: 'relative',
118
- '& [data-ds--menu--heading-item]': {
119
- marginBottom: "var(--ds-space-075, 6px)",
120
- marginTop: "var(--ds-space-200, 16px)"
121
- },
122
- '& [data-ds--menu--skeleton-heading-item]': {
123
- marginTop: skeletonHeadingTopMargin,
124
- marginBottom: skeletonHeadingBottomMargin
125
- }
126
- };
127
- };
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useShouldNestedElementRender = exports.useNestedContext = exports.NestedContext = void 0;
7
- var _react = require("react");
8
- /**
9
- * @internal
10
- */
11
-
12
- /**
13
- * @internal
14
- */
15
- var NestedContext = exports.NestedContext = /*#__PURE__*/(0, _react.createContext)(undefined);
16
- var useNestedContext = exports.useNestedContext = function useNestedContext() {
17
- var context = (0, _react.useContext)(NestedContext);
18
- if (!context) {
19
- var error = '';
20
- if (process.env.NODE_ENV === 'development') {
21
- error = "\nTo use a <NestingItem /> it needs to be a descendant of <NestableNavigationContent>.\nYou probably need to replace your <NavigationContent> with <NestableNavigationContent>.\n\nimport { NestableNavigationContent } from '@atlaskit/side-navigation';\n ";
22
- }
23
- throw new Error(error);
24
- }
25
- return context;
26
- };
27
-
28
- /**
29
- * Used by children of the NestableNavigationContent component to see if they should render or not.
30
- * If `shouldRender` returns `true` - return your nodes.
31
- * If it returns `false` - either return `null` or `children` if you have children.
32
- */
33
- var useShouldNestedElementRender = exports.useShouldNestedElementRender = function useShouldNestedElementRender() {
34
- var context = (0, _react.useContext)(NestedContext);
35
- if (!context) {
36
- return {
37
- shouldRender: true
38
- };
39
- }
40
- return {
41
- shouldRender: context.currentStackId === context.parentId
42
- };
43
- };
@@ -1,27 +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, "HeadingItem", {
8
- enumerable: true,
9
- get: function get() {
10
- return _headingItem.default;
11
- }
12
- });
13
- Object.defineProperty(exports, "Section", {
14
- enumerable: true,
15
- get: function get() {
16
- return _section.default;
17
- }
18
- });
19
- Object.defineProperty(exports, "SkeletonHeadingItem", {
20
- enumerable: true,
21
- get: function get() {
22
- return _skeletonHeadingItem.default;
23
- }
24
- });
25
- var _headingItem = _interopRequireDefault(require("./heading-item"));
26
- var _section = _interopRequireDefault(require("./section"));
27
- var _skeletonHeadingItem = _interopRequireDefault(require("./skeleton-heading-item"));
@@ -1,113 +0,0 @@
1
- import { VAR_SCROLL_INDICATOR_COLOR, VAR_SEPARATOR_COLOR } from '../../common/constants';
2
- const scrollIndicatorMaskZIndex = 2;
3
- const scrollIndicatorZIndex = 1;
4
- const scrollIndicatorHeight = 2;
5
- const scrollIndicatorBorderRadius = '1px';
6
- const containerPadding = 8;
7
- const itemHeadingContentHeight = 16; // Originally headingSizes.h100.lineHeight from '@atlaskit/theme/typography'
8
- const skeletonHeadingHeight = containerPadding;
9
- const skeletonHeadingMarginOffset = 3;
10
- // Skeleton content is slightly shorter than the real content.
11
- // Because of that we slightly increase the top margin to offset this so the
12
- // containing size both real and skeleton always equal approx 30px.
13
- const skeletonHeadingTopMargin = containerPadding * 2.5 + (itemHeadingContentHeight - skeletonHeadingHeight) - skeletonHeadingMarginOffset;
14
- // We want to move the entire body up by 3px without affecting the height of the skeleton container.
15
- const skeletonHeadingBottomMargin = containerPadding * 0.75 + skeletonHeadingMarginOffset;
16
- /**
17
- * This outer container css contains the "real" scroll indicators which are
18
- * always rendered to the screen.
19
- * They are "conditionally" shown from the users perspective using the inner container CSS
20
- * which has other pseudo elements which "mask" the "real" scroll indicators.
21
- */
22
- export const outerContainerCSS = opts => ({
23
- // Flex is needed to ensure the overflow indicators are positioned correctly.
24
- display: 'flex',
25
- height: '100%',
26
- overflow: 'hidden',
27
- position: 'relative',
28
- '&::before': {
29
- content: "''",
30
- display: 'block',
31
- left: "var(--ds-space-100, 8px)",
32
- right: containerPadding + opts.scrollbarWidth,
33
- height: scrollIndicatorHeight,
34
- borderRadius: `var(--ds-radius-xsmall, ${scrollIndicatorBorderRadius})`,
35
- backgroundColor: `var(${VAR_SEPARATOR_COLOR}, ${"var(--ds-border, #0B120E24)"})`,
36
- position: 'absolute',
37
- zIndex: scrollIndicatorZIndex
38
- },
39
- '&::after': {
40
- content: "''",
41
- position: 'absolute',
42
- display: 'block',
43
- borderRadius: `var(--ds-radius-xsmall, ${scrollIndicatorBorderRadius})`,
44
- flexShrink: 0,
45
- height: scrollIndicatorHeight,
46
- left: "var(--ds-space-100, 8px)",
47
- right: containerPadding + opts.scrollbarWidth,
48
- bottom: 0,
49
- zIndex: scrollIndicatorZIndex,
50
- backgroundColor: `var(${VAR_SEPARATOR_COLOR}, ${"var(--ds-border, #0B120E24)"})`
51
- }
52
- });
53
-
54
- /**
55
- * This inner container css contains the "mask" logic for the scroll indicators.
56
- * Essentially they cover (mask) the "real" scroll indicators when the user is scrolled
57
- * to the top or bottom of the container.
58
- */
59
- export const innerContainerCSS = opts => ({
60
- display: 'flex',
61
- overflow: 'auto',
62
- width: '100%',
63
- position: 'relative',
64
- boxSizing: 'border-box',
65
- flexDirection: 'column',
66
- // This before pseudo element is works by being positioned at the top of this scrolling
67
- // container - so when you scroll down it stops "masking" the actual scroll indicator.
68
- ...(!opts.showTopScrollIndicator && {
69
- '&::before': {
70
- borderRadius: `var(--ds-radius-xsmall, ${scrollIndicatorBorderRadius})`,
71
- content: "''",
72
- left: 0,
73
- right: 0,
74
- height: scrollIndicatorHeight,
75
- backgroundColor: `var(${VAR_SCROLL_INDICATOR_COLOR}, ${"var(--ds-surface, #FFFFFF)"})`,
76
- position: 'absolute',
77
- display: 'block',
78
- zIndex: scrollIndicatorMaskZIndex
79
- }
80
- }),
81
- // This after pseudo element abuses being a flex child and pushes itself down to the
82
- // very bottom of the container - doing so ends up "masking" the actual scroll indicator.
83
- '&::after': {
84
- borderRadius: `var(--ds-radius-xsmall, ${scrollIndicatorBorderRadius})`,
85
- content: "''",
86
- display: 'block',
87
- flexShrink: 0,
88
- height: scrollIndicatorHeight,
89
- // This is used to "push" the element to the bottom of the flex container.
90
- marginTop: 'auto',
91
- position: 'relative',
92
- zIndex: scrollIndicatorMaskZIndex,
93
- backgroundColor: `var(${VAR_SCROLL_INDICATOR_COLOR}, ${"var(--ds-surface, #FFFFFF)"})`
94
- }
95
- });
96
- export const containerCSS = opts => ({
97
- // When the scroll indicator is always shown we need to add some padding
98
- // so the spacing between matches what it would be if the indicator was a "block" element.
99
- // We use margin here so any child absolutely positioned elements are positioned correctly.
100
- marginTop: opts.showTopScrollIndicator ? scrollIndicatorHeight : 0,
101
- marginLeft: "var(--ds-space-100, 8px)",
102
- marginRight: "var(--ds-space-100, 8px)",
103
- // Enables child absolutely positioned elements to be positioned relative to this element.
104
- position: 'relative',
105
- '& [data-ds--menu--heading-item]': {
106
- marginBottom: "var(--ds-space-075, 6px)",
107
- marginTop: "var(--ds-space-200, 16px)"
108
- },
109
- '& [data-ds--menu--skeleton-heading-item]': {
110
- marginTop: skeletonHeadingTopMargin,
111
- marginBottom: skeletonHeadingBottomMargin
112
- }
113
- });