@atlaskit/side-navigation 9.1.1 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @atlaskit/side-navigation
2
2
 
3
+ ## 10.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#156707](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/156707)
8
+ [`84d702274b2dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/84d702274b2dd) -
9
+ Migrated `HeadingItem` and `Section` components from @emotion/react to @compiled/react in order to
10
+ improve performance, align with the rest of the Atlaskit techstack, and support React 18 Streaming
11
+ SSR.
12
+
13
+ Removed the deprecated `cssFn` prop from the `HeadingItem` component, as this is not supported
14
+ with @compiled/react.
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
20
+ ## 9.2.0
21
+
22
+ ### Minor Changes
23
+
24
+ - [#148607](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148607)
25
+ [`96c3ed72d55bf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/96c3ed72d55bf) -
26
+ Internal change to Section component to remove deprecated APIs.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies
31
+
3
32
  ## 9.1.1
4
33
 
5
34
  ### Patch Changes
@@ -0,0 +1 @@
1
+ ._18zru2gc{padding-inline:var(--ds-space-100,8px)}
@@ -1,32 +1,47 @@
1
+ /* heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("./heading-item.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
8
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
14
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
15
  var _menu = require("@atlaskit/menu");
11
- var _styles = require("../../common/styles");
12
16
  var _context = require("../NestableNavigationContent/context");
17
+ var _excluded = ["className"];
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ var styles = {
21
+ headingItem: "_18zru2gc"
22
+ };
23
+
13
24
  /**
14
25
  * __Heading item__
15
26
  *
16
27
  * Available for advanced use cases, for most situations providing a `title` to `section` should be enough.
17
28
  *
18
29
  */
19
- var HeadingItem = function HeadingItem(props) {
30
+ var HeadingItem = function HeadingItem(_ref) {
31
+ var UNSAFE_className = _ref.className,
32
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
33
  var _useShouldNestedEleme = (0, _context.useShouldNestedElementRender)(),
21
34
  shouldRender = _useShouldNestedEleme.shouldRender;
22
35
  if (!shouldRender) {
23
36
  return null;
24
37
  }
25
- var cssFn = (0, _styles.overrideStyleFunction)(_styles.sectionHeaderSpacingStyles, props.cssFn);
26
-
27
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides, @repo/internal/react/no-unsafe-spread-props
28
- return /*#__PURE__*/_react.default.createElement(_menu.HeadingItem, (0, _extends2.default)({}, props, {
29
- cssFn: cssFn
38
+ return /*#__PURE__*/React.createElement(_menu.HeadingItem
39
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/no-unsafe-overrides
40
+ , (0, _extends2.default)({}, props, {
41
+ // @ts-expect-error
42
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
43
+ className: (0, _runtime.ax)([styles.headingItem, UNSAFE_className])
44
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
30
45
  }));
31
46
  };
32
47
  var _default = exports.default = HeadingItem;
@@ -9,7 +9,6 @@ exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _menu = require("@atlaskit/menu");
12
- var _styles = require("../../common/styles");
13
12
  var _context = require("../NestableNavigationContent/context");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -30,14 +29,8 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
29
  return props.children;
31
30
  }
32
31
  return /*#__PURE__*/_react.default.createElement(_menu.Section, (0, _extends2.default)({}, props, {
33
- ref: ref
34
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides
35
- ,
36
- overrides: {
37
- HeadingItem: {
38
- cssFn: _styles.sectionHeaderSpacingStyles
39
- }
40
- }
32
+ ref: ref,
33
+ isSideNavSection: true
41
34
  }));
42
35
  });
43
36
  var _default = exports.default = Section;
@@ -0,0 +1 @@
1
+ ._18zru2gc{padding-inline:var(--ds-space-100,8px)}
@@ -1,26 +1,40 @@
1
+ /* heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
+ import "./heading-item.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
3
6
  import { HeadingItem as MenuHeadingItem } from '@atlaskit/menu';
4
- import { overrideStyleFunction, sectionHeaderSpacingStyles } from '../../common/styles';
5
7
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
8
+ const styles = {
9
+ headingItem: "_18zru2gc"
10
+ };
11
+
6
12
  /**
7
13
  * __Heading item__
8
14
  *
9
15
  * Available for advanced use cases, for most situations providing a `title` to `section` should be enough.
10
16
  *
11
17
  */
12
- const HeadingItem = props => {
18
+ const HeadingItem = ({
19
+ // @ts-expect-error
20
+ // Although this isn't defined on props it is available because we've used
21
+ // Spread props below and on the jsx element in MenuHeadingItem.
22
+ className: UNSAFE_className,
23
+ ...props
24
+ }) => {
13
25
  const {
14
26
  shouldRender
15
27
  } = useShouldNestedElementRender();
16
28
  if (!shouldRender) {
17
29
  return null;
18
30
  }
19
- const cssFn = overrideStyleFunction(sectionHeaderSpacingStyles, props.cssFn);
20
-
21
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides, @repo/internal/react/no-unsafe-spread-props
22
- return /*#__PURE__*/React.createElement(MenuHeadingItem, _extends({}, props, {
23
- cssFn: cssFn
31
+ return /*#__PURE__*/React.createElement(MenuHeadingItem
32
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/no-unsafe-overrides
33
+ , _extends({}, props, {
34
+ // @ts-expect-error
35
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
36
+ className: ax([styles.headingItem, UNSAFE_className])
37
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
24
38
  }));
25
39
  };
26
40
  export default HeadingItem;
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Section as MenuSection } from '@atlaskit/menu';
4
- import { sectionHeaderSpacingStyles } from '../../common/styles';
5
4
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
6
5
  // Type needed on props to extract types with extract react types.
7
6
  /**
@@ -21,14 +20,8 @@ const Section = /*#__PURE__*/forwardRef((props, ref) => {
21
20
  return props.children;
22
21
  }
23
22
  return /*#__PURE__*/React.createElement(MenuSection, _extends({}, props, {
24
- ref: ref
25
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides
26
- ,
27
- overrides: {
28
- HeadingItem: {
29
- cssFn: sectionHeaderSpacingStyles
30
- }
31
- }
23
+ ref: ref,
24
+ isSideNavSection: true
32
25
  }));
33
26
  });
34
27
  export default Section;
@@ -0,0 +1 @@
1
+ ._18zru2gc{padding-inline:var(--ds-space-100,8px)}
@@ -1,25 +1,37 @@
1
+ /* heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["className"];
5
+ import "./heading-item.compiled.css";
6
+ import * as React from 'react';
7
+ import { ax, ix } from "@compiled/react/runtime";
3
8
  import { HeadingItem as MenuHeadingItem } from '@atlaskit/menu';
4
- import { overrideStyleFunction, sectionHeaderSpacingStyles } from '../../common/styles';
5
9
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
10
+ var styles = {
11
+ headingItem: "_18zru2gc"
12
+ };
13
+
6
14
  /**
7
15
  * __Heading item__
8
16
  *
9
17
  * Available for advanced use cases, for most situations providing a `title` to `section` should be enough.
10
18
  *
11
19
  */
12
- var HeadingItem = function HeadingItem(props) {
20
+ var HeadingItem = function HeadingItem(_ref) {
21
+ var UNSAFE_className = _ref.className,
22
+ props = _objectWithoutProperties(_ref, _excluded);
13
23
  var _useShouldNestedEleme = useShouldNestedElementRender(),
14
24
  shouldRender = _useShouldNestedEleme.shouldRender;
15
25
  if (!shouldRender) {
16
26
  return null;
17
27
  }
18
- var cssFn = overrideStyleFunction(sectionHeaderSpacingStyles, props.cssFn);
19
-
20
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides, @repo/internal/react/no-unsafe-spread-props
21
- return /*#__PURE__*/React.createElement(MenuHeadingItem, _extends({}, props, {
22
- cssFn: cssFn
28
+ return /*#__PURE__*/React.createElement(MenuHeadingItem
29
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/no-unsafe-overrides
30
+ , _extends({}, props, {
31
+ // @ts-expect-error
32
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
33
+ className: ax([styles.headingItem, UNSAFE_className])
34
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides, @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides
23
35
  }));
24
36
  };
25
37
  export default HeadingItem;
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
3
  import { Section as MenuSection } from '@atlaskit/menu';
4
- import { sectionHeaderSpacingStyles } from '../../common/styles';
5
4
  import { useShouldNestedElementRender } from '../NestableNavigationContent/context';
6
5
  // Type needed on props to extract types with extract react types.
7
6
  /**
@@ -20,14 +19,8 @@ var Section = /*#__PURE__*/forwardRef(function (props, ref) {
20
19
  return props.children;
21
20
  }
22
21
  return /*#__PURE__*/React.createElement(MenuSection, _extends({}, props, {
23
- ref: ref
24
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-apis, @repo/internal/react/no-unsafe-overrides
25
- ,
26
- overrides: {
27
- HeadingItem: {
28
- cssFn: sectionHeaderSpacingStyles
29
- }
30
- }
22
+ ref: ref,
23
+ isSideNavSection: true
31
24
  }));
32
25
  });
33
26
  export default Section;
@@ -3,8 +3,8 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import React from 'react';
6
- import { type CustomItemComponentProps, type Overrides } from '@atlaskit/menu';
7
- interface NestingItemOverrides extends Overrides {
6
+ import { type CustomItemComponentProps } from '@atlaskit/menu';
7
+ interface NestingItemOverrides {
8
8
  /**
9
9
  * Use this to override the back button displayed when navigation is nested.
10
10
  * You'll want to import the [go back item](/packages/navigation/side-navigation/docs/go-back-item) component and use it here.
@@ -1,4 +1,8 @@
1
- import React from 'react';
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /// <reference types="react" />
2
6
  import { type HeadingItemProps } from '@atlaskit/menu';
3
7
  export type { HeadingItemProps } from '@atlaskit/menu';
4
8
  /**
@@ -7,5 +11,5 @@ export type { HeadingItemProps } from '@atlaskit/menu';
7
11
  * Available for advanced use cases, for most situations providing a `title` to `section` should be enough.
8
12
  *
9
13
  */
10
- declare const HeadingItem: (props: HeadingItemProps) => React.JSX.Element | null;
14
+ declare const HeadingItem: ({ className: UNSAFE_className, ...props }: HeadingItemProps) => JSX.Element | null;
11
15
  export default HeadingItem;
@@ -3,8 +3,8 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import React from 'react';
6
- import { type CustomItemComponentProps, type Overrides } from '@atlaskit/menu';
7
- interface NestingItemOverrides extends Overrides {
6
+ import { type CustomItemComponentProps } from '@atlaskit/menu';
7
+ interface NestingItemOverrides {
8
8
  /**
9
9
  * Use this to override the back button displayed when navigation is nested.
10
10
  * You'll want to import the [go back item](/packages/navigation/side-navigation/docs/go-back-item) component and use it here.
@@ -1,4 +1,8 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
2
6
  import { type HeadingItemProps } from '@atlaskit/menu';
3
7
  export type { HeadingItemProps } from '@atlaskit/menu';
4
8
  /**
@@ -7,5 +11,5 @@ export type { HeadingItemProps } from '@atlaskit/menu';
7
11
  * Available for advanced use cases, for most situations providing a `title` to `section` should be enough.
8
12
  *
9
13
  */
10
- declare const HeadingItem: (props: HeadingItemProps) => React.JSX.Element | null;
14
+ declare const HeadingItem: ({ className: UNSAFE_className, ...props }: HeadingItemProps) => JSX.Element | null;
11
15
  export default HeadingItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/side-navigation",
3
- "version": "9.1.1",
3
+ "version": "10.0.0",
4
4
  "description": "A highly composable side navigation component that supports nested views.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/css": "^0.10.0",
36
36
  "@atlaskit/ds-lib": "^4.0.0",
37
37
  "@atlaskit/icon": "^26.0.0",
38
- "@atlaskit/menu": "^5.0.0",
38
+ "@atlaskit/menu": "^7.0.0",
39
39
  "@atlaskit/motion": "^5.1.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
41
  "@atlaskit/primitives": "^14.7.0",
@@ -54,18 +54,18 @@
54
54
  "@atlaskit/atlassian-navigation": "^5.1.0",
55
55
  "@atlaskit/button": "^23.0.0",
56
56
  "@atlaskit/docs": "^10.0.0",
57
- "@atlaskit/dropdown-menu": "^14.1.0",
57
+ "@atlaskit/dropdown-menu": "^15.0.0",
58
58
  "@atlaskit/form": "^12.0.0",
59
59
  "@atlaskit/image": "^3.0.0",
60
60
  "@atlaskit/link": "^3.1.0",
61
61
  "@atlaskit/logo": "^18.0.0",
62
- "@atlaskit/onboarding": "^14.0.0",
62
+ "@atlaskit/onboarding": "^14.1.0",
63
63
  "@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
64
64
  "@atlaskit/pragmatic-drag-and-drop-live-region": "^1.3.0",
65
65
  "@atlaskit/pragmatic-drag-and-drop-react-accessibility": "^2.0.0",
66
- "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
66
+ "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
67
67
  "@atlaskit/section-message": "^8.2.0",
68
- "@atlaskit/select": "^20.4.0",
68
+ "@atlaskit/select": "^20.5.0",
69
69
  "@atlaskit/visual-regression": "workspace:^",
70
70
  "@testing-library/react": "^13.4.0",
71
71
  "raf-stub": "^2.0.1",