@atlaskit/drawer 7.8.0 → 7.10.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,22 @@
1
1
  # @atlaskit/drawer
2
2
 
3
+ ## 7.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#103863](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103863)
8
+ [`919672b42f27`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/919672b42f27) -
9
+ Update close button to use IconButton from `@atlaskit/button/new`. Some minor visual changes are
10
+ expected.
11
+
12
+ ## 7.9.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#102398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102398)
17
+ [`872ce80f5ef9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/872ce80f5ef9) -
18
+ Add support for React 18.
19
+
3
20
  ## 7.8.0
4
21
 
5
22
  ### Minor Changes
@@ -27,7 +27,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
27
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
28
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
29
29
  var packageName = "@atlaskit/drawer";
30
- var packageVersion = "7.8.0";
30
+ var packageVersion = "7.10.0";
31
31
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
32
32
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
33
33
  return createAndFireEventOnAtlaskit({
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
10
  var _react = require("react");
10
11
  var _react2 = require("@emotion/react");
12
+ var _new = require("@atlaskit/button/new");
11
13
  var _arrowLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/arrow-left"));
12
14
  var _motion = require("@atlaskit/motion");
13
15
  var _constants = require("../../constants");
@@ -15,7 +17,6 @@ var _utils = require("../utils");
15
17
  var _content = _interopRequireDefault(require("./content"));
16
18
  var _drawerWrapper = _interopRequireDefault(require("./drawer-wrapper"));
17
19
  var _focusLock = _interopRequireDefault(require("./focus-lock"));
18
- var _iconButton = _interopRequireDefault(require("./icon-button"));
19
20
  var _sidebar = _interopRequireDefault(require("./sidebar"));
20
21
  var _excluded = ["component"],
21
22
  _excluded2 = ["component"];
@@ -105,15 +106,18 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
105
106
  drawerRef: drawerRef,
106
107
  label: label,
107
108
  titleId: titleId
108
- }, (0, _react2.jsx)(Sidebar, sideBarOverrides, (0, _react2.jsx)(_iconButton.default, {
109
+ }, (0, _react2.jsx)(Sidebar, sideBarOverrides, (0, _react2.jsx)(_new.IconButton, {
109
110
  onClick: onClose,
110
- testId: testId && 'DrawerPrimitiveSidebarCloseButton'
111
- }, Icon ? (0, _react2.jsx)(Icon, {
112
- size: "large",
113
- label: closeLabel
114
- }) : (0, _react2.jsx)(_arrowLeft.default, {
115
- label: closeLabel
116
- }))), (0, _react2.jsx)(Content, contentOverrides, children)));
111
+ testId: testId && 'DrawerPrimitiveSidebarCloseButton',
112
+ icon: Icon ? function (iconProps) {
113
+ return (0, _react2.jsx)(Icon, (0, _extends2.default)({}, iconProps, {
114
+ size: "large"
115
+ }));
116
+ } : _arrowLeft.default,
117
+ label: closeLabel,
118
+ shape: "circle",
119
+ appearance: "subtle"
120
+ })), (0, _react2.jsx)(Content, contentOverrides, children)));
117
121
  }));
118
122
  };
119
123
 
@@ -8,7 +8,7 @@ import { defaultFocusLockSettings } from '../constants';
8
8
  import Blanket from './blanket';
9
9
  import DrawerPrimitive from './primitives';
10
10
  const packageName = "@atlaskit/drawer";
11
- const packageVersion = "7.8.0";
11
+ const packageVersion = "7.10.0";
12
12
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
13
13
  const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
14
14
  action: 'dismissed',
@@ -1,7 +1,9 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
2
3
 
3
4
  import { useCallback, useRef } from 'react';
4
5
  import { jsx } from '@emotion/react';
6
+ import { IconButton } from '@atlaskit/button/new';
5
7
  import ArrowLeft from '@atlaskit/icon/glyph/arrow-left';
6
8
  import { ExitingPersistence, SlideIn, useExitingPersistence } from '@atlaskit/motion';
7
9
  import { animationTimingFunction, transitionDurationMs } from '../../constants';
@@ -9,7 +11,6 @@ import { createExtender } from '../utils';
9
11
  import ContentOverrides from './content';
10
12
  import DrawerWrapper from './drawer-wrapper';
11
13
  import FocusLock from './focus-lock';
12
- import IconButton from './icon-button';
13
14
  import SidebarOverrides from './sidebar';
14
15
 
15
16
  // Misc.
@@ -103,13 +104,14 @@ const DrawerPrimitive = ({
103
104
  titleId: titleId
104
105
  }, jsx(Sidebar, sideBarOverrides, jsx(IconButton, {
105
106
  onClick: onClose,
106
- testId: testId && 'DrawerPrimitiveSidebarCloseButton'
107
- }, Icon ? jsx(Icon, {
108
- size: "large",
109
- label: closeLabel
110
- }) : jsx(ArrowLeft, {
111
- label: closeLabel
112
- }))), jsx(Content, contentOverrides, children)))));
107
+ testId: testId && 'DrawerPrimitiveSidebarCloseButton',
108
+ icon: Icon ? iconProps => jsx(Icon, _extends({}, iconProps, {
109
+ size: "large"
110
+ })) : ArrowLeft,
111
+ label: closeLabel,
112
+ shape: "circle",
113
+ appearance: "subtle"
114
+ })), jsx(Content, contentOverrides, children)))));
113
115
  };
114
116
 
115
117
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
@@ -18,7 +18,7 @@ import { defaultFocusLockSettings } from '../constants';
18
18
  import Blanket from './blanket';
19
19
  import DrawerPrimitive from './primitives';
20
20
  var packageName = "@atlaskit/drawer";
21
- var packageVersion = "7.8.0";
21
+ var packageVersion = "7.10.0";
22
22
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
23
23
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
24
24
  return createAndFireEventOnAtlaskit({
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  var _excluded = ["component"],
3
4
  _excluded2 = ["component"];
@@ -5,6 +6,7 @@ var _excluded = ["component"],
5
6
 
6
7
  import { useCallback, useRef } from 'react';
7
8
  import { jsx } from '@emotion/react';
9
+ import { IconButton } from '@atlaskit/button/new';
8
10
  import ArrowLeft from '@atlaskit/icon/glyph/arrow-left';
9
11
  import { ExitingPersistence, SlideIn, useExitingPersistence } from '@atlaskit/motion';
10
12
  import { animationTimingFunction, transitionDurationMs } from '../../constants';
@@ -12,7 +14,6 @@ import { createExtender } from '../utils';
12
14
  import ContentOverrides from './content';
13
15
  import DrawerWrapper from './drawer-wrapper';
14
16
  import FocusLock from './focus-lock';
15
- import IconButton from './icon-button';
16
17
  import SidebarOverrides from './sidebar';
17
18
 
18
19
  // Misc.
@@ -102,13 +103,16 @@ var DrawerPrimitive = function DrawerPrimitive(_ref2) {
102
103
  titleId: titleId
103
104
  }, jsx(Sidebar, sideBarOverrides, jsx(IconButton, {
104
105
  onClick: onClose,
105
- testId: testId && 'DrawerPrimitiveSidebarCloseButton'
106
- }, Icon ? jsx(Icon, {
107
- size: "large",
108
- label: closeLabel
109
- }) : jsx(ArrowLeft, {
110
- label: closeLabel
111
- }))), jsx(Content, contentOverrides, children)));
106
+ testId: testId && 'DrawerPrimitiveSidebarCloseButton',
107
+ icon: Icon ? function (iconProps) {
108
+ return jsx(Icon, _extends({}, iconProps, {
109
+ size: "large"
110
+ }));
111
+ } : ArrowLeft,
112
+ label: closeLabel,
113
+ shape: "circle",
114
+ appearance: "subtle"
115
+ })), jsx(Content, contentOverrides, children)));
112
116
  }));
113
117
  };
114
118
 
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import { DrawerProps, DrawerWidth } from './types';
2
+ import { type DrawerProps, type DrawerWidth } from './types';
3
3
  export declare class DrawerBase extends Component<DrawerProps, {
4
4
  renderPortal: boolean;
5
5
  }> {
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { CSSObject, jsx } from '@emotion/react';
3
- import { ContentProps } from '../types';
2
+ import { type CSSObject, jsx } from '@emotion/react';
3
+ import { type ContentProps } from '../types';
4
4
  declare const _default: {
5
5
  component: ({ cssFn, ...props }: ContentProps) => jsx.JSX.Element;
6
6
  cssFn: () => CSSObject;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { ReactElement, Ref } from 'react';
3
- import { DrawerPrimitiveProps, Widths } from '../types';
2
+ import { type ReactElement, type Ref } from 'react';
3
+ import { type DrawerPrimitiveProps, type Widths } from '../types';
4
4
  export declare const wrapperWidth: Widths;
5
5
  interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId' | 'label' | 'titleId'> {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { DrawerPrimitiveProps } from '../types';
3
+ import { type DrawerPrimitiveProps } from '../types';
4
4
  declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
5
5
  export default DrawerPrimitive;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
3
- import { CSSObject } from '@emotion/react';
4
- import { SidebarProps } from '../types';
2
+ import { type FC } from 'react';
3
+ import { type CSSObject } from '@emotion/react';
4
+ import { type SidebarProps } from '../types';
5
5
  declare const _default: {
6
6
  component: FC<SidebarProps>;
7
7
  cssFn: () => CSSObject;
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import { DrawerProps, DrawerWidth } from './types';
2
+ import { type DrawerProps, type DrawerWidth } from './types';
3
3
  export declare class DrawerBase extends Component<DrawerProps, {
4
4
  renderPortal: boolean;
5
5
  }> {
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { CSSObject, jsx } from '@emotion/react';
3
- import { ContentProps } from '../types';
2
+ import { type CSSObject, jsx } from '@emotion/react';
3
+ import { type ContentProps } from '../types';
4
4
  declare const _default: {
5
5
  component: ({ cssFn, ...props }: ContentProps) => jsx.JSX.Element;
6
6
  cssFn: () => CSSObject;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
- import { ReactElement, Ref } from 'react';
3
- import { DrawerPrimitiveProps, Widths } from '../types';
2
+ import { type ReactElement, type Ref } from 'react';
3
+ import { type DrawerPrimitiveProps, type Widths } from '../types';
4
4
  export declare const wrapperWidth: Widths;
5
5
  interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId' | 'label' | 'titleId'> {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { DrawerPrimitiveProps } from '../types';
3
+ import { type DrawerPrimitiveProps } from '../types';
4
4
  declare const DrawerPrimitive: ({ children, icon: Icon, closeLabel, onClose, onCloseComplete, onOpenComplete, overrides, testId, in: isOpen, shouldReturnFocus, autoFocusFirstElem, isFocusLockEnabled, width, label, titleId, }: DrawerPrimitiveProps) => jsx.JSX.Element;
5
5
  export default DrawerPrimitive;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
- import { FC } from 'react';
3
- import { CSSObject } from '@emotion/react';
4
- import { SidebarProps } from '../types';
2
+ import { type FC } from 'react';
3
+ import { type CSSObject } from '@emotion/react';
4
+ import { type SidebarProps } from '../types';
5
5
  declare const _default: {
6
6
  component: FC<SidebarProps>;
7
7
  cssFn: () => CSSObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.8.0",
3
+ "version": "7.10.0",
4
4
  "description": "A drawer is a panel that slides in from the left side of the screen.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,16 +36,18 @@
36
36
  "website": {
37
37
  "name": "Drawer",
38
38
  "category": "Components"
39
- }
39
+ },
40
+ "runReact18": true
40
41
  },
41
42
  "dependencies": {
42
43
  "@atlaskit/analytics-next": "^9.3.0",
43
44
  "@atlaskit/blanket": "^13.1.0",
44
- "@atlaskit/icon": "^22.1.0",
45
- "@atlaskit/motion": "^1.5.0",
46
- "@atlaskit/portal": "^4.4.0",
47
- "@atlaskit/theme": "^12.7.0",
48
- "@atlaskit/tokens": "^1.45.0",
45
+ "@atlaskit/button": "^17.17.0",
46
+ "@atlaskit/icon": "^22.3.0",
47
+ "@atlaskit/motion": "^1.6.0",
48
+ "@atlaskit/portal": "^4.5.0",
49
+ "@atlaskit/theme": "^12.8.0",
50
+ "@atlaskit/tokens": "^1.49.0",
49
51
  "@babel/runtime": "^7.0.0",
50
52
  "@emotion/react": "^11.7.1",
51
53
  "bind-event-listener": "^3.0.0",
@@ -56,7 +58,7 @@
56
58
  "use-callback-ref": "^1.2.3"
57
59
  },
58
60
  "peerDependencies": {
59
- "react": "^16.8.0"
61
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
60
62
  },
61
63
  "devDependencies": {
62
64
  "@af/accessibility-testing": "*",
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("@emotion/react");
8
- var _colors = require("@atlaskit/theme/colors");
9
- /** @jsx jsx */
10
-
11
- var iconButtonStyles = (0, _react.css)({
12
- padding: "var(--ds-space-100, 8px)",
13
- backgroundColor: 'inherit',
14
- border: 'none',
15
- borderRadius: "var(--ds-space-1000, 80px)",
16
- color: 'inherit',
17
- cursor: 'pointer',
18
- lineHeight: "var(--ds-font-lineHeight-100, 1)",
19
- '&:hover': {
20
- backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")")
21
- },
22
- '&:active': {
23
- backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")")
24
- }
25
- });
26
- var IconButton = function IconButton(_ref) {
27
- var children = _ref.children,
28
- onClick = _ref.onClick,
29
- testId = _ref.testId;
30
- return (0, _react.jsx)("button", {
31
- type: "button",
32
- css: iconButtonStyles,
33
- onClick: onClick,
34
- "data-testid": testId
35
- }, children);
36
- };
37
-
38
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
39
- var _default = exports.default = IconButton;
@@ -1,32 +0,0 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { B50, N30A } from '@atlaskit/theme/colors';
5
- const iconButtonStyles = css({
6
- padding: "var(--ds-space-100, 8px)",
7
- backgroundColor: 'inherit',
8
- border: 'none',
9
- borderRadius: "var(--ds-space-1000, 80px)",
10
- color: 'inherit',
11
- cursor: 'pointer',
12
- lineHeight: "var(--ds-font-lineHeight-100, 1)",
13
- '&:hover': {
14
- backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N30A})`
15
- },
16
- '&:active': {
17
- backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${B50})`
18
- }
19
- });
20
- const IconButton = ({
21
- children,
22
- onClick,
23
- testId
24
- }) => jsx("button", {
25
- type: "button",
26
- css: iconButtonStyles,
27
- onClick: onClick,
28
- "data-testid": testId
29
- }, children);
30
-
31
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
32
- export default IconButton;
@@ -1,33 +0,0 @@
1
- /** @jsx jsx */
2
-
3
- import { css, jsx } from '@emotion/react';
4
- import { B50, N30A } from '@atlaskit/theme/colors';
5
- var iconButtonStyles = css({
6
- padding: "var(--ds-space-100, 8px)",
7
- backgroundColor: 'inherit',
8
- border: 'none',
9
- borderRadius: "var(--ds-space-1000, 80px)",
10
- color: 'inherit',
11
- cursor: 'pointer',
12
- lineHeight: "var(--ds-font-lineHeight-100, 1)",
13
- '&:hover': {
14
- backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")")
15
- },
16
- '&:active': {
17
- backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")")
18
- }
19
- });
20
- var IconButton = function IconButton(_ref) {
21
- var children = _ref.children,
22
- onClick = _ref.onClick,
23
- testId = _ref.testId;
24
- return jsx("button", {
25
- type: "button",
26
- css: iconButtonStyles,
27
- onClick: onClick,
28
- "data-testid": testId
29
- }, children);
30
- };
31
-
32
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
33
- export default IconButton;
@@ -1,9 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC, MouseEventHandler, ReactNode } from 'react';
3
- interface IconButtonProps {
4
- testId?: string;
5
- onClick?: MouseEventHandler<HTMLButtonElement>;
6
- children: ReactNode;
7
- }
8
- declare const IconButton: FC<IconButtonProps>;
9
- export default IconButton;
@@ -1,9 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC, MouseEventHandler, ReactNode } from 'react';
3
- interface IconButtonProps {
4
- testId?: string;
5
- onClick?: MouseEventHandler<HTMLButtonElement>;
6
- children: ReactNode;
7
- }
8
- declare const IconButton: FC<IconButtonProps>;
9
- export default IconButton;