@atlaskit/drawer 7.4.4 → 7.4.6

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,17 @@
1
1
  # @atlaskit/drawer
2
2
 
3
+ ## 7.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`021eea6cdc6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/021eea6cdc6) - Remove unnecessary styles. There is no expected behaviour change for consumers.
14
+
3
15
  ## 7.4.4
4
16
 
5
17
  ### Patch Changes
@@ -13,25 +13,17 @@ var _react2 = require("@emotion/react");
13
13
 
14
14
  var _blanket = _interopRequireDefault(require("@atlaskit/blanket"));
15
15
 
16
- var _motion = require("@atlaskit/motion");
16
+ var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
17
17
 
18
- var _constants = require("@atlaskit/theme/constants");
18
+ var _motion = require("@atlaskit/motion");
19
19
 
20
- var _constants2 = require("../constants");
20
+ var _constants = require("../constants");
21
21
 
22
22
  /** @jsx jsx */
23
23
 
24
- /**
25
- * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
26
- */
27
- var stackingStyles = (0, _react2.css)({
28
- position: 'relative',
29
- zIndex: _constants.layers.blanket()
30
- });
31
24
  /**
32
25
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
33
26
  */
34
-
35
27
  var Blanket = function Blanket(_ref) {
36
28
  var isOpen = _ref.isOpen,
37
29
  onBlanketClicked = _ref.onBlanketClicked,
@@ -46,19 +38,19 @@ var Blanket = function Blanket(_ref) {
46
38
  * The fade out animation uses half the passed duration so it evens out.
47
39
  */
48
40
  , {
49
- duration: _constants2.transitionDurationMs * 2
41
+ duration: _constants.transitionDurationMs * 2
50
42
  /**
51
43
  * We don't expose this on `FadeIn` but it does get passed down.
52
44
  * TODO: figure out how we want to handle this...
53
45
  */
54
46
  // @ts-ignore
55
47
  ,
56
- animationTimingFunction: _constants2.animationTimingFunction
48
+ animationTimingFunction: _constants.animationTimingFunction
57
49
  }, function (_ref2) {
58
50
  var className = _ref2.className;
59
- return (0, _react2.jsx)("div", {
60
- className: className,
61
- css: stackingStyles
51
+ return (0, _react2.jsx)(_box.default, {
52
+ position: "relative",
53
+ className: className
62
54
  }, (0, _react2.jsx)(_blanket.default, {
63
55
  isTinted: true,
64
56
  onBlanketClicked: onBlanketClicked,
@@ -50,7 +50,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
50
50
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
51
51
 
52
52
  var packageName = "@atlaskit/drawer";
53
- var packageVersion = "7.4.4";
53
+ var packageVersion = "7.4.6";
54
54
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
55
55
 
56
56
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -36,7 +36,7 @@ var Content = function Content(_ref) {
36
36
  * guide suggested as it made more sense as a transformer of the current styles rather than
37
37
  * a complete override with no chance of partially changing styles.
38
38
  */
39
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
39
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
40
40
  (0, _react.jsx)("div", (0, _extends2.default)({
41
41
  css: (0, _react.css)(cssFn(defaultStyles))
42
42
  }, props))
@@ -5,7 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.widths = exports.default = void 0;
8
+ exports.wrapperWidth = exports.default = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
11
 
10
12
  var _react = require("react");
11
13
 
@@ -13,31 +15,39 @@ var _react2 = require("@emotion/react");
13
15
 
14
16
  var _useCallbackRef = require("use-callback-ref");
15
17
 
16
- var _colors = require("@atlaskit/theme/colors");
18
+ var _box = _interopRequireDefault(require("@atlaskit/ds-explorations/box"));
17
19
 
18
20
  var _constants = require("@atlaskit/theme/constants");
19
21
 
20
22
  var _usePreventProgrammaticScroll = _interopRequireDefault(require("./hooks/use-prevent-programmatic-scroll"));
21
23
 
22
- /** @jsx jsx */
23
- var widths = {
24
- full: '100vw',
25
- extended: '95vw',
26
- narrow: 45 * (0, _constants.gridSize)(),
27
- medium: 60 * (0, _constants.gridSize)(),
28
- wide: 75 * (0, _constants.gridSize)()
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
+
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
+
28
+ var wrapperWidth = {
29
+ full: {
30
+ width: '100vw'
31
+ },
32
+ extended: {
33
+ width: '95vw'
34
+ },
35
+ narrow: {
36
+ width: 45 * (0, _constants.gridSize)()
37
+ },
38
+ medium: {
39
+ width: 60 * (0, _constants.gridSize)()
40
+ },
41
+ wide: {
42
+ width: 75 * (0, _constants.gridSize)()
43
+ }
29
44
  };
30
- exports.widths = widths;
31
- var wrapperStyles = (0, _react2.css)({
32
- display: 'flex',
33
- height: '100vh',
34
- position: 'fixed',
35
- zIndex: _constants.layers.blanket() + 1,
45
+ exports.wrapperWidth = wrapperWidth;
46
+ var wrapperStyles = {
36
47
  top: 0,
37
48
  left: 0,
38
- backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
39
- overflow: 'hidden'
40
- });
49
+ height: '100vh'
50
+ };
41
51
 
42
52
  /**
43
53
  * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
@@ -45,7 +55,8 @@ var wrapperStyles = (0, _react2.css)({
45
55
  var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRef) {
46
56
  var children = _ref.children,
47
57
  className = _ref.className,
48
- width = _ref.width,
58
+ _ref$width = _ref.width,
59
+ width = _ref$width === void 0 ? 'narrow' : _ref$width,
49
60
  testId = _ref.testId,
50
61
  drawerRef = _ref.drawerRef;
51
62
 
@@ -66,13 +77,15 @@ var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRe
66
77
  }, [scrollRef]);
67
78
  var ref = (0, _useCallbackRef.useMergeRefs)([drawerRef, assignSecondChildRef]);
68
79
  (0, _usePreventProgrammaticScroll.default)();
69
- return (0, _react2.jsx)("div", {
80
+ return (0, _react2.jsx)(_box.default, {
81
+ display: "flex",
82
+ position: "fixed",
83
+ backgroundColor: "elevation.surface.overlay",
84
+ overflow: "hidden",
85
+ layer: "blanket",
86
+ UNSAFE_style: _objectSpread(_objectSpread({}, wrapperStyles), wrapperWidth[width]),
70
87
  className: className,
71
- css: wrapperStyles,
72
- style: {
73
- width: widths[width !== null && width !== void 0 ? width : 'narrow']
74
- },
75
- "data-testid": testId,
88
+ testId: testId,
76
89
  ref: ref
77
90
  }, children);
78
91
  });
@@ -9,33 +9,20 @@ var _react = require("@emotion/react");
9
9
 
10
10
  var _colors = require("@atlaskit/theme/colors");
11
11
 
12
- var _constants = require("@atlaskit/theme/constants");
13
-
14
12
  /** @jsx jsx */
15
- var gridSize = (0, _constants.gridSize)();
16
13
  var iconButtonStyles = (0, _react.css)({
17
- display: 'flex',
18
- width: 5 * gridSize,
19
- height: 5 * gridSize,
20
- // TODO Delete this comment after verifying spacing token -> previous value `2 * gridSize`
21
- marginBottom: "var(--ds-scale-200, 16px)",
22
- // TODO Delete this comment after verifying spacing token -> previous value `0`
23
- padding: "var(--ds-scale-0, 0px)",
24
- alignItems: 'center',
25
- justifyContent: 'center',
26
- background: 0,
27
- border: 0,
28
- borderRadius: '50%',
14
+ padding: "var(--ds-scale-100, 8px)",
15
+ backgroundColor: 'inherit',
16
+ border: 'none',
17
+ borderRadius: "var(--ds-scale-1000, 80px)",
29
18
  color: 'inherit',
30
19
  cursor: 'pointer',
31
- fontSize: 'inherit',
32
- lineHeight: 1,
20
+ lineHeight: "var(--ds-font-lineHeight-100, 1)",
33
21
  '&:hover': {
34
22
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")")
35
23
  },
36
24
  '&:active': {
37
- backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")"),
38
- outline: 0
25
+ backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(_colors.B50, ")")
39
26
  }
40
27
  });
41
28
 
@@ -43,12 +30,14 @@ var IconButton = function IconButton(_ref) {
43
30
  var children = _ref.children,
44
31
  onClick = _ref.onClick,
45
32
  testId = _ref.testId;
46
- return (0, _react.jsx)("button", {
47
- type: "button",
48
- css: iconButtonStyles,
49
- onClick: onClick,
50
- "data-testid": testId
51
- }, children);
33
+ return (// eslint-disable-next-line @repo/internal/react/use-primitives
34
+ (0, _react.jsx)("button", {
35
+ type: "button",
36
+ css: iconButtonStyles,
37
+ onClick: onClick,
38
+ "data-testid": testId
39
+ }, children)
40
+ );
52
41
  }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
53
42
 
54
43
 
@@ -38,7 +38,7 @@ var sidebarCSS = function sidebarCSS() {
38
38
  var Sidebar = function Sidebar(_ref) {
39
39
  var cssFn = _ref.cssFn,
40
40
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
41
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
41
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
42
42
  return (0, _react.jsx)("div", (0, _extends2.default)({
43
43
  css: (0, _react.css)(cssFn(defaultStyle))
44
44
  }, props));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.4",
3
+ "version": "7.4.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,22 +1,14 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import AkBlanket from '@atlaskit/blanket';
5
+ import Box from '@atlaskit/ds-explorations/box';
5
6
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
6
- import { layers } from '@atlaskit/theme/constants';
7
7
  import { animationTimingFunction, transitionDurationMs } from '../constants';
8
8
 
9
- /**
10
- * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
11
- */
12
- const stackingStyles = css({
13
- position: 'relative',
14
- zIndex: layers.blanket()
15
- });
16
9
  /**
17
10
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
18
11
  */
19
-
20
12
  const Blanket = ({
21
13
  isOpen,
22
14
  onBlanketClicked,
@@ -42,9 +34,9 @@ const Blanket = ({
42
34
  animationTimingFunction: animationTimingFunction
43
35
  }, ({
44
36
  className
45
- }) => jsx("div", {
46
- className: className,
47
- css: stackingStyles
37
+ }) => jsx(Box, {
38
+ position: "relative",
39
+ className: className
48
40
  }, jsx(AkBlanket, {
49
41
  isTinted: true,
50
42
  onBlanketClicked: onBlanketClicked,
@@ -9,7 +9,7 @@ import { defaultFocusLockSettings } from '../constants';
9
9
  import Blanket from './blanket';
10
10
  import DrawerPrimitive from './primitives';
11
11
  const packageName = "@atlaskit/drawer";
12
- const packageVersion = "7.4.4";
12
+ const packageVersion = "7.4.6";
13
13
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
14
14
 
15
15
  const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
@@ -21,7 +21,7 @@ const Content = ({
21
21
  * guide suggested as it made more sense as a transformer of the current styles rather than
22
22
  * a complete override with no chance of partially changing styles.
23
23
  */
24
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
24
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
25
25
  jsx("div", _extends({
26
26
  css: css(cssFn(defaultStyles))
27
27
  }, props));
@@ -1,27 +1,32 @@
1
1
  /** @jsx jsx */
2
2
  import { forwardRef, useCallback } from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import { useMergeRefs } from 'use-callback-ref';
5
- import { N0 } from '@atlaskit/theme/colors';
6
- import { gridSize, layers } from '@atlaskit/theme/constants';
5
+ import Box from '@atlaskit/ds-explorations/box';
6
+ import { gridSize } from '@atlaskit/theme/constants';
7
7
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
8
- export const widths = {
9
- full: '100vw',
10
- extended: '95vw',
11
- narrow: 45 * gridSize(),
12
- medium: 60 * gridSize(),
13
- wide: 75 * gridSize()
8
+ export const wrapperWidth = {
9
+ full: {
10
+ width: '100vw'
11
+ },
12
+ extended: {
13
+ width: '95vw'
14
+ },
15
+ narrow: {
16
+ width: 45 * gridSize()
17
+ },
18
+ medium: {
19
+ width: 60 * gridSize()
20
+ },
21
+ wide: {
22
+ width: 75 * gridSize()
23
+ }
14
24
  };
15
- const wrapperStyles = css({
16
- display: 'flex',
17
- height: '100vh',
18
- position: 'fixed',
19
- zIndex: layers.blanket() + 1,
25
+ const wrapperStyles = {
20
26
  top: 0,
21
27
  left: 0,
22
- backgroundColor: `var(--ds-surface-overlay, ${N0})`,
23
- overflow: 'hidden'
24
- });
28
+ height: '100vh'
29
+ };
25
30
 
26
31
  /**
27
32
  * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
@@ -29,7 +34,7 @@ const wrapperStyles = css({
29
34
  const DrawerWrapper = /*#__PURE__*/forwardRef(({
30
35
  children,
31
36
  className,
32
- width,
37
+ width = 'narrow',
33
38
  testId,
34
39
  drawerRef
35
40
  }, scrollRef) => {
@@ -50,13 +55,17 @@ const DrawerWrapper = /*#__PURE__*/forwardRef(({
50
55
  }, [scrollRef]);
51
56
  const ref = useMergeRefs([drawerRef, assignSecondChildRef]);
52
57
  usePreventProgrammaticScroll();
53
- return jsx("div", {
54
- className: className,
55
- css: wrapperStyles,
56
- style: {
57
- width: widths[width !== null && width !== void 0 ? width : 'narrow']
58
+ return jsx(Box, {
59
+ display: "flex",
60
+ position: "fixed",
61
+ backgroundColor: "elevation.surface.overlay",
62
+ overflow: "hidden",
63
+ layer: "blanket",
64
+ UNSAFE_style: { ...wrapperStyles,
65
+ ...wrapperWidth[width]
58
66
  },
59
- "data-testid": testId,
67
+ className: className,
68
+ testId: testId,
60
69
  ref: ref
61
70
  }, children);
62
71
  });
@@ -1,31 +1,19 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
3
  import { B50, N30A } from '@atlaskit/theme/colors';
4
- import { gridSize as getGridSize } from '@atlaskit/theme/constants';
5
- const gridSize = getGridSize();
6
4
  const iconButtonStyles = css({
7
- display: 'flex',
8
- width: 5 * gridSize,
9
- height: 5 * gridSize,
10
- // TODO Delete this comment after verifying spacing token -> previous value `2 * gridSize`
11
- marginBottom: "var(--ds-scale-200, 16px)",
12
- // TODO Delete this comment after verifying spacing token -> previous value `0`
13
- padding: "var(--ds-scale-0, 0px)",
14
- alignItems: 'center',
15
- justifyContent: 'center',
16
- background: 0,
17
- border: 0,
18
- borderRadius: '50%',
5
+ padding: "var(--ds-scale-100, 8px)",
6
+ backgroundColor: 'inherit',
7
+ border: 'none',
8
+ borderRadius: "var(--ds-scale-1000, 80px)",
19
9
  color: 'inherit',
20
10
  cursor: 'pointer',
21
- fontSize: 'inherit',
22
- lineHeight: 1,
11
+ lineHeight: "var(--ds-font-lineHeight-100, 1)",
23
12
  '&:hover': {
24
13
  backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N30A})`
25
14
  },
26
15
  '&:active': {
27
- backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${B50})`,
28
- outline: 0
16
+ backgroundColor: `var(--ds-background-neutral-subtle-pressed, ${B50})`
29
17
  }
30
18
  });
31
19
 
@@ -33,7 +21,8 @@ const IconButton = ({
33
21
  children,
34
22
  onClick,
35
23
  testId
36
- }) => jsx("button", {
24
+ }) => // eslint-disable-next-line @repo/internal/react/use-primitives
25
+ jsx("button", {
37
26
  type: "button",
38
27
  css: iconButtonStyles,
39
28
  onClick: onClick,
@@ -23,7 +23,7 @@ const Sidebar = ({
23
23
  cssFn,
24
24
  ...props
25
25
  }) => {
26
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
26
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
27
27
  return jsx("div", _extends({
28
28
  css: css(cssFn(defaultStyle))
29
29
  }, props));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.4",
3
+ "version": "7.4.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,22 +1,14 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
- import { css, jsx } from '@emotion/react';
3
+ import { jsx } from '@emotion/react';
4
4
  import AkBlanket from '@atlaskit/blanket';
5
+ import Box from '@atlaskit/ds-explorations/box';
5
6
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
6
- import { layers } from '@atlaskit/theme/constants';
7
7
  import { animationTimingFunction, transitionDurationMs } from '../constants';
8
8
 
9
- /**
10
- * The FadeIn opacity transition creates a new stacking context so we need ensure layering is the same as @atlaskit/blanket
11
- */
12
- var stackingStyles = css({
13
- position: 'relative',
14
- zIndex: layers.blanket()
15
- });
16
9
  /**
17
10
  * A wrapper around `@atlaskit/blanket` that adds a fade in/out transition.
18
11
  */
19
-
20
12
  var Blanket = function Blanket(_ref) {
21
13
  var isOpen = _ref.isOpen,
22
14
  onBlanketClicked = _ref.onBlanketClicked,
@@ -41,9 +33,9 @@ var Blanket = function Blanket(_ref) {
41
33
  animationTimingFunction: animationTimingFunction
42
34
  }, function (_ref2) {
43
35
  var className = _ref2.className;
44
- return jsx("div", {
45
- className: className,
46
- css: stackingStyles
36
+ return jsx(Box, {
37
+ position: "relative",
38
+ className: className
47
39
  }, jsx(AkBlanket, {
48
40
  isTinted: true,
49
41
  onBlanketClicked: onBlanketClicked,
@@ -23,7 +23,7 @@ import { defaultFocusLockSettings } from '../constants';
23
23
  import Blanket from './blanket';
24
24
  import DrawerPrimitive from './primitives';
25
25
  var packageName = "@atlaskit/drawer";
26
- var packageVersion = "7.4.4";
26
+ var packageVersion = "7.4.6";
27
27
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
28
28
 
29
29
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
@@ -26,7 +26,7 @@ var Content = function Content(_ref) {
26
26
  * guide suggested as it made more sense as a transformer of the current styles rather than
27
27
  * a complete override with no chance of partially changing styles.
28
28
  */
29
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
29
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
30
30
  jsx("div", _extends({
31
31
  css: css(cssFn(defaultStyles))
32
32
  }, props))
@@ -1,27 +1,38 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+
1
7
  /** @jsx jsx */
2
8
  import { forwardRef, useCallback } from 'react';
3
- import { css, jsx } from '@emotion/react';
9
+ import { jsx } from '@emotion/react';
4
10
  import { useMergeRefs } from 'use-callback-ref';
5
- import { N0 } from '@atlaskit/theme/colors';
6
- import { gridSize, layers } from '@atlaskit/theme/constants';
11
+ import Box from '@atlaskit/ds-explorations/box';
12
+ import { gridSize } from '@atlaskit/theme/constants';
7
13
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
8
- export var widths = {
9
- full: '100vw',
10
- extended: '95vw',
11
- narrow: 45 * gridSize(),
12
- medium: 60 * gridSize(),
13
- wide: 75 * gridSize()
14
+ export var wrapperWidth = {
15
+ full: {
16
+ width: '100vw'
17
+ },
18
+ extended: {
19
+ width: '95vw'
20
+ },
21
+ narrow: {
22
+ width: 45 * gridSize()
23
+ },
24
+ medium: {
25
+ width: 60 * gridSize()
26
+ },
27
+ wide: {
28
+ width: 75 * gridSize()
29
+ }
14
30
  };
15
- var wrapperStyles = css({
16
- display: 'flex',
17
- height: '100vh',
18
- position: 'fixed',
19
- zIndex: layers.blanket() + 1,
31
+ var wrapperStyles = {
20
32
  top: 0,
21
33
  left: 0,
22
- backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")"),
23
- overflow: 'hidden'
24
- });
34
+ height: '100vh'
35
+ };
25
36
 
26
37
  /**
27
38
  * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
@@ -29,7 +40,8 @@ var wrapperStyles = css({
29
40
  var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
30
41
  var children = _ref.children,
31
42
  className = _ref.className,
32
- width = _ref.width,
43
+ _ref$width = _ref.width,
44
+ width = _ref$width === void 0 ? 'narrow' : _ref$width,
33
45
  testId = _ref.testId,
34
46
  drawerRef = _ref.drawerRef;
35
47
 
@@ -50,13 +62,15 @@ var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
50
62
  }, [scrollRef]);
51
63
  var ref = useMergeRefs([drawerRef, assignSecondChildRef]);
52
64
  usePreventProgrammaticScroll();
53
- return jsx("div", {
65
+ return jsx(Box, {
66
+ display: "flex",
67
+ position: "fixed",
68
+ backgroundColor: "elevation.surface.overlay",
69
+ overflow: "hidden",
70
+ layer: "blanket",
71
+ UNSAFE_style: _objectSpread(_objectSpread({}, wrapperStyles), wrapperWidth[width]),
54
72
  className: className,
55
- css: wrapperStyles,
56
- style: {
57
- width: widths[width !== null && width !== void 0 ? width : 'narrow']
58
- },
59
- "data-testid": testId,
73
+ testId: testId,
60
74
  ref: ref
61
75
  }, children);
62
76
  });
@@ -1,31 +1,19 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
3
  import { B50, N30A } from '@atlaskit/theme/colors';
4
- import { gridSize as getGridSize } from '@atlaskit/theme/constants';
5
- var gridSize = getGridSize();
6
4
  var iconButtonStyles = css({
7
- display: 'flex',
8
- width: 5 * gridSize,
9
- height: 5 * gridSize,
10
- // TODO Delete this comment after verifying spacing token -> previous value `2 * gridSize`
11
- marginBottom: "var(--ds-scale-200, 16px)",
12
- // TODO Delete this comment after verifying spacing token -> previous value `0`
13
- padding: "var(--ds-scale-0, 0px)",
14
- alignItems: 'center',
15
- justifyContent: 'center',
16
- background: 0,
17
- border: 0,
18
- borderRadius: '50%',
5
+ padding: "var(--ds-scale-100, 8px)",
6
+ backgroundColor: 'inherit',
7
+ border: 'none',
8
+ borderRadius: "var(--ds-scale-1000, 80px)",
19
9
  color: 'inherit',
20
10
  cursor: 'pointer',
21
- fontSize: 'inherit',
22
- lineHeight: 1,
11
+ lineHeight: "var(--ds-font-lineHeight-100, 1)",
23
12
  '&:hover': {
24
13
  backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")")
25
14
  },
26
15
  '&:active': {
27
- backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")"),
28
- outline: 0
16
+ backgroundColor: "var(--ds-background-neutral-subtle-pressed, ".concat(B50, ")")
29
17
  }
30
18
  });
31
19
 
@@ -33,12 +21,14 @@ var IconButton = function IconButton(_ref) {
33
21
  var children = _ref.children,
34
22
  onClick = _ref.onClick,
35
23
  testId = _ref.testId;
36
- return jsx("button", {
37
- type: "button",
38
- css: iconButtonStyles,
39
- onClick: onClick,
40
- "data-testid": testId
41
- }, children);
24
+ return (// eslint-disable-next-line @repo/internal/react/use-primitives
25
+ jsx("button", {
26
+ type: "button",
27
+ css: iconButtonStyles,
28
+ onClick: onClick,
29
+ "data-testid": testId
30
+ }, children)
31
+ );
42
32
  }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
43
33
 
44
34
 
@@ -27,7 +27,7 @@ var Sidebar = function Sidebar(_ref) {
27
27
  var cssFn = _ref.cssFn,
28
28
  props = _objectWithoutProperties(_ref, _excluded);
29
29
 
30
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props
30
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage, @repo/internal/react/no-unsafe-spread-props, @repo/internal/react/use-primitives
31
31
  return jsx("div", _extends({
32
32
  css: css(cssFn(defaultStyle))
33
33
  }, props));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.4",
3
+ "version": "7.4.6",
4
4
  "sideEffects": false
5
5
  }
@@ -22,10 +22,10 @@ export declare class DrawerBase extends Component<DrawerProps, {
22
22
  handleKeyDown: (event: KeyboardEvent) => void;
23
23
  render(): JSX.Element | null;
24
24
  }
25
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
25
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "children" | "onKeyDown" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "isOpen" | "zIndex"> & Partial<Pick<Omit<DrawerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "width" | keyof import("./types").FocusLockSettings>> & Partial<Pick<{
26
26
  autoFocusFirstElem?: boolean | (() => HTMLElement | null) | undefined;
27
27
  isFocusLockEnabled?: boolean | undefined;
28
28
  shouldReturnFocus?: boolean | undefined;
29
29
  width: DrawerWidth;
30
- }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "zIndex" | "isOpen" | "analyticsContext" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
30
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "width" | "children" | "onKeyDown" | "key" | "onClose" | "testId" | "icon" | "onOpenComplete" | "onCloseComplete" | "shouldUnmountOnExit" | "overrides" | "isOpen" | "analyticsContext" | "zIndex" | keyof import("./types").FocusLockSettings> & React.RefAttributes<any>>;
31
31
  export default _default;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactElement, Ref } from 'react';
3
3
  import { DrawerPrimitiveProps, Widths } from '../types';
4
- export declare const widths: Widths;
4
+ export declare const wrapperWidth: Widths;
5
5
  interface FocusLockRefTargetProps extends Pick<DrawerPrimitiveProps, 'width' | 'testId'> {
6
6
  /**
7
7
  * This must have two children explicitly as we target the second child as the Content.
@@ -2,11 +2,21 @@ import { ComponentType, ReactElement, ReactNode, SyntheticEvent } from 'react';
2
2
  import { CSSObject } from '@emotion/react';
3
3
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
4
  export declare type Widths = {
5
- extended: string;
6
- full: string;
7
- medium: number;
8
- narrow: number;
9
- wide: number;
5
+ extended: {
6
+ width: string;
7
+ };
8
+ full: {
9
+ width: string;
10
+ };
11
+ medium: {
12
+ width: number;
13
+ };
14
+ narrow: {
15
+ width: number;
16
+ };
17
+ wide: {
18
+ width: number;
19
+ };
10
20
  };
11
21
  export declare type DrawerWidth = 'extended' | 'full' | 'medium' | 'narrow' | 'wide';
12
22
  export interface BaseProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.4.4",
3
+ "version": "7.4.6",
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/"
@@ -28,6 +28,7 @@
28
28
  "dependencies": {
29
29
  "@atlaskit/analytics-next": "^8.2.0",
30
30
  "@atlaskit/blanket": "^12.3.0",
31
+ "@atlaskit/ds-explorations": "^2.0.0",
31
32
  "@atlaskit/icon": "^21.11.0",
32
33
  "@atlaskit/motion": "^1.3.0",
33
34
  "@atlaskit/portal": "^4.0.0",
@@ -81,7 +82,10 @@
81
82
  "static",
82
83
  "emotion"
83
84
  ],
84
- "deprecation": "no-deprecated-imports"
85
+ "deprecation": "no-deprecated-imports",
86
+ "ui-components": [
87
+ "primitives"
88
+ ]
85
89
  }
86
90
  },
87
91
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/drawer"
4
4