@atlaskit/drawer 7.6.1 → 7.6.3

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.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#41729](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41729) [`04235acacd6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04235acacd6) - Enrol package to push model in Jira
8
+
9
+ ## 7.6.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#41065](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41065) [`e96b5be2269`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e96b5be2269) - [ux] This release removes the feature flag behind which Drawer got improves for accessibility. Now it is a modal dialog, preventing users to focus elements beyond it's content. Focus is set to first element of Drawer content on opening. On closing focus is returned to triggering element. Additionally introduced props adding/referencing accessible name.
14
+
3
15
  ## 7.6.1
4
16
 
5
17
  ### Patch 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() { 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; } } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
29
29
  var packageName = "@atlaskit/drawer";
30
- var packageVersion = "7.6.1";
30
+ var packageVersion = "7.6.3";
31
31
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
32
32
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
33
33
  return createAndFireEventOnAtlaskit({
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.wrapperWidth = exports.default = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
9
  var _react = require("react");
11
10
  var _react2 = require("@emotion/react");
12
11
  var _useCallbackRef = require("use-callback-ref");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
12
  var _colors = require("@atlaskit/theme/colors");
15
13
  var _tokens = require("@atlaskit/tokens");
16
14
  var _usePreventProgrammaticScroll = _interopRequireDefault(require("./hooks/use-prevent-programmatic-scroll"));
@@ -38,10 +36,8 @@ var wrapperStyles = (0, _react2.css)((_css = {
38
36
  height: '100vh',
39
37
  position: 'fixed',
40
38
  zIndex: 500,
41
- top: 0,
42
- left: 0,
43
39
  backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")")
44
- }, (0, _defineProperty2.default)(_css, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), (0, _defineProperty2.default)(_css, "overflow", 'hidden'), _css));
40
+ }, (0, _defineProperty2.default)(_css, _tokens.CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(_colors.N0, ")")), (0, _defineProperty2.default)(_css, "insetBlockStart", 0), (0, _defineProperty2.default)(_css, "insetInlineStart", 0), (0, _defineProperty2.default)(_css, "overflow", 'hidden'), _css));
45
41
  /**
46
42
  * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
47
43
  */
@@ -70,18 +66,16 @@ var DrawerWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, scrollRe
70
66
  }, [scrollRef]);
71
67
  var ref = (0, _useCallbackRef.useMergeRefs)([drawerRef, assignSecondChildRef]);
72
68
  (0, _usePreventProgrammaticScroll.default)();
73
- var modalDialogAttributes = (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
74
- 'aria-modal': true,
75
- role: 'dialog',
76
- 'aria-label': label,
77
- 'aria-labelledby': titleId
78
- };
79
- return (0, _react2.jsx)("div", (0, _extends2.default)({
69
+ return (0, _react2.jsx)("div", {
80
70
  css: wrapperStyles,
81
71
  style: wrapperWidth[width],
82
72
  className: className,
83
73
  "data-testid": testId,
84
- ref: ref
85
- }, modalDialogAttributes), children);
74
+ ref: ref,
75
+ "aria-modal": true,
76
+ role: "dialog",
77
+ "aria-label": label,
78
+ "aria-labelledby": titleId
79
+ }, children);
86
80
  });
87
81
  var _default = exports.default = DrawerWrapper;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.widths = exports.transitionTimingFunction = exports.transitionDurationMs = exports.transitionDuration = exports.defaultFocusLockSettings = exports.animationTimingFunction = void 0;
7
7
  var _curves = require("@atlaskit/motion/curves");
8
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
8
  var transitionDuration = exports.transitionDuration = '0.22s';
10
9
  var transitionDurationMs = exports.transitionDurationMs = 220;
11
10
  var transitionTimingFunction = exports.transitionTimingFunction = _curves.easeOut;
@@ -16,5 +15,5 @@ var animationTimingFunction = exports.animationTimingFunction = function animati
16
15
  var defaultFocusLockSettings = exports.defaultFocusLockSettings = {
17
16
  isFocusLockEnabled: true,
18
17
  shouldReturnFocus: true,
19
- autoFocusFirstElem: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
18
+ autoFocusFirstElem: true
20
19
  };
@@ -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.6.1";
11
+ const packageVersion = "7.6.3";
12
12
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
13
13
  const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
14
14
  action: 'dismissed',
@@ -1,9 +1,7 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  /** @jsx jsx */
3
2
  import { forwardRef, useCallback } from 'react';
4
3
  import { css, jsx } from '@emotion/react';
5
4
  import { useMergeRefs } from 'use-callback-ref';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
5
  import { N0 } from '@atlaskit/theme/colors';
8
6
  import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
9
7
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
@@ -29,10 +27,10 @@ const wrapperStyles = css({
29
27
  height: '100vh',
30
28
  position: 'fixed',
31
29
  zIndex: 500,
32
- top: 0,
33
- left: 0,
34
30
  backgroundColor: `var(--ds-surface-overlay, ${N0})`,
35
31
  [CURRENT_SURFACE_CSS_VAR]: `var(--ds-surface-overlay, ${N0})`,
32
+ insetBlockStart: 0,
33
+ insetInlineStart: 0,
36
34
  overflow: 'hidden'
37
35
  });
38
36
  /**
@@ -63,18 +61,16 @@ const DrawerWrapper = /*#__PURE__*/forwardRef(({
63
61
  }, [scrollRef]);
64
62
  const ref = useMergeRefs([drawerRef, assignSecondChildRef]);
65
63
  usePreventProgrammaticScroll();
66
- const modalDialogAttributes = getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
67
- 'aria-modal': true,
68
- role: 'dialog',
69
- 'aria-label': label,
70
- 'aria-labelledby': titleId
71
- };
72
- return jsx("div", _extends({
64
+ return jsx("div", {
73
65
  css: wrapperStyles,
74
66
  style: wrapperWidth[width],
75
67
  className: className,
76
68
  "data-testid": testId,
77
- ref: ref
78
- }, modalDialogAttributes), children);
69
+ ref: ref,
70
+ "aria-modal": true,
71
+ role: "dialog",
72
+ "aria-label": label,
73
+ "aria-labelledby": titleId
74
+ }, children);
79
75
  });
80
76
  export default DrawerWrapper;
@@ -1,5 +1,4 @@
1
1
  import { easeOut } from '@atlaskit/motion/curves';
2
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
2
  export const transitionDuration = '0.22s';
4
3
  export const transitionDurationMs = 220;
5
4
  export const transitionTimingFunction = easeOut;
@@ -8,5 +7,5 @@ export const animationTimingFunction = () => easeOut;
8
7
  export const defaultFocusLockSettings = {
9
8
  isFocusLockEnabled: true,
10
9
  shouldReturnFocus: true,
11
- autoFocusFirstElem: getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
10
+ autoFocusFirstElem: true
12
11
  };
@@ -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.6.1";
21
+ var packageVersion = "7.6.3";
22
22
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
23
23
  var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
24
24
  return createAndFireEventOnAtlaskit({
@@ -1,11 +1,9 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  var _css;
4
3
  /** @jsx jsx */
5
4
  import { forwardRef, useCallback } from 'react';
6
5
  import { css, jsx } from '@emotion/react';
7
6
  import { useMergeRefs } from 'use-callback-ref';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
9
7
  import { N0 } from '@atlaskit/theme/colors';
10
8
  import { CURRENT_SURFACE_CSS_VAR } from '@atlaskit/tokens';
11
9
  import usePreventProgrammaticScroll from './hooks/use-prevent-programmatic-scroll';
@@ -31,10 +29,8 @@ var wrapperStyles = css((_css = {
31
29
  height: '100vh',
32
30
  position: 'fixed',
33
31
  zIndex: 500,
34
- top: 0,
35
- left: 0,
36
32
  backgroundColor: "var(--ds-surface-overlay, ".concat(N0, ")")
37
- }, _defineProperty(_css, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), _defineProperty(_css, "overflow", 'hidden'), _css));
33
+ }, _defineProperty(_css, CURRENT_SURFACE_CSS_VAR, "var(--ds-surface-overlay, ".concat(N0, ")")), _defineProperty(_css, "insetBlockStart", 0), _defineProperty(_css, "insetInlineStart", 0), _defineProperty(_css, "overflow", 'hidden'), _css));
38
34
  /**
39
35
  * A wrapper that controls the styling of the drawer with a few hacks with refs to get our Touch±Scroll locks working.
40
36
  */
@@ -63,18 +59,16 @@ var DrawerWrapper = /*#__PURE__*/forwardRef(function (_ref, scrollRef) {
63
59
  }, [scrollRef]);
64
60
  var ref = useMergeRefs([drawerRef, assignSecondChildRef]);
65
61
  usePreventProgrammaticScroll();
66
- var modalDialogAttributes = getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') && {
67
- 'aria-modal': true,
68
- role: 'dialog',
69
- 'aria-label': label,
70
- 'aria-labelledby': titleId
71
- };
72
- return jsx("div", _extends({
62
+ return jsx("div", {
73
63
  css: wrapperStyles,
74
64
  style: wrapperWidth[width],
75
65
  className: className,
76
66
  "data-testid": testId,
77
- ref: ref
78
- }, modalDialogAttributes), children);
67
+ ref: ref,
68
+ "aria-modal": true,
69
+ role: "dialog",
70
+ "aria-label": label,
71
+ "aria-labelledby": titleId
72
+ }, children);
79
73
  });
80
74
  export default DrawerWrapper;
@@ -1,5 +1,4 @@
1
1
  import { easeOut } from '@atlaskit/motion/curves';
2
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
2
  export var transitionDuration = '0.22s';
4
3
  export var transitionDurationMs = 220;
5
4
  export var transitionTimingFunction = easeOut;
@@ -10,5 +9,5 @@ export var animationTimingFunction = function animationTimingFunction() {
10
9
  export var defaultFocusLockSettings = {
11
10
  isFocusLockEnabled: true,
12
11
  shouldReturnFocus: true,
13
- autoFocusFirstElem: getBooleanFF('platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc') || false
12
+ autoFocusFirstElem: true
14
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/drawer",
3
- "version": "7.6.1",
3
+ "version": "7.6.3",
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/"
@@ -27,6 +27,9 @@
27
27
  "team": "Design System Team",
28
28
  "deprecatedAutoEntryPoints": true,
29
29
  "releaseModel": "continuous",
30
+ "productPushConsumption": [
31
+ "jira"
32
+ ],
30
33
  "website": {
31
34
  "name": "Drawer",
32
35
  "category": "Components"
@@ -37,10 +40,9 @@
37
40
  "@atlaskit/blanket": "^12.4.0",
38
41
  "@atlaskit/icon": "^21.12.0",
39
42
  "@atlaskit/motion": "^1.5.0",
40
- "@atlaskit/platform-feature-flags": "^0.2.0",
41
43
  "@atlaskit/portal": "^4.3.0",
42
44
  "@atlaskit/theme": "^12.6.0",
43
- "@atlaskit/tokens": "^1.25.0",
45
+ "@atlaskit/tokens": "^1.28.0",
44
46
  "@babel/runtime": "^7.0.0",
45
47
  "@emotion/react": "^11.7.1",
46
48
  "bind-event-listener": "^2.1.1",
@@ -62,9 +64,9 @@
62
64
  "@atlaskit/visual-regression": "*",
63
65
  "@atlaskit/webdriver-runner": "*",
64
66
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
65
- "@atlassian/feature-flags-test-utils": "*",
66
67
  "@testing-library/react": "^12.1.5",
67
68
  "@testing-library/user-event": "^14.4.3",
69
+ "@types/exenv": "^1.2.0",
68
70
  "lodash": "^4.17.21",
69
71
  "react-dom": "^16.8.0",
70
72
  "react-lorem-component": "^0.13.0",
@@ -93,10 +95,5 @@
93
95
  ]
94
96
  }
95
97
  },
96
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
97
- "platform-feature-flags": {
98
- "platform.design-system-team.drawer-screen-reader-focus-trap-refactor_hfuxc": {
99
- "type": "boolean"
100
- }
101
- }
98
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
102
99
  }