@atlaskit/pragmatic-drag-and-drop-react-accessibility 2.0.8 → 2.1.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,27 @@
1
1
  # @atlaskit/pragmatic-drag-and-drop-react-accessibility
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3136f686a1929`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3136f686a1929) -
8
+ Updating `DragHandleButton` to use our new `DragHandleVerticalIcon`.
9
+
10
+ Deprecating `DragHandleButtonSmall`.
11
+
12
+ Rationale:
13
+
14
+ - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
15
+ (the smallest icon size is now `12px` x `12px`)
16
+ - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
17
+ - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
18
+ minimum hit target size for accessibility.
19
+ [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 2.0.8
4
26
 
5
27
  ### Patch Changes
@@ -21,11 +21,24 @@ import DragHandleDropdownMenuExample from '../../examples/drag-handle-dropdown-m
21
21
 
22
22
  <Example Component={DragHandleButtonExample} />
23
23
 
24
- ## Small variant
24
+ ## Small variant (deprecated)
25
+
26
+ <SectionMessage appearance="warning">
27
+
28
+ The small variant has now been deprecated.
29
+
30
+ - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system (the
31
+ smallest icon size is now `12px` x `12px`)
32
+ - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
33
+ - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px` minimum
34
+ hit target size for accessibility.
35
+ [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
36
+
37
+ </SectionMessage>
25
38
 
26
39
  A small variant is available through the `/drag-handle-button-small` entrypoint.
27
40
 
28
- It is intended for experiences with very limited space to accomodate a drag handle. It is not
41
+ It is intended for experiences with very limited space to accommodate a drag handle. It is not
29
42
  recommended for general use due to the small target size.
30
43
 
31
44
  <Example Component={DragHandleButtonSmallExample} />
@@ -24,11 +24,23 @@ var iconSmallStylesNew = (0, _primitives.xcss)({
24
24
  display: 'inline-flex'
25
25
  });
26
26
 
27
+ // TODO: will run full deprecation process later. For now just want people to stop using this.
28
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
27
29
  /**
28
30
  * A button with pre-configured styling to look like a drag handle.
29
31
  *
30
32
  * This component uses a native button because the `@atlaskit/button`
31
33
  * cancels `mouseDown` events, which prevents dragging.
34
+ *
35
+ * @deprecated Please use `DragHandleButton`.
36
+ *
37
+ * Rationale:
38
+ *
39
+ * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
40
+ * (the smallest icon size is now `12px` x `12px`)
41
+ * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
42
+ * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
43
+ * minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
32
44
  */
33
45
  var DragHandleButtonSmall = exports.DragHandleButtonSmall = /*#__PURE__*/(0, _react.forwardRef)(function DragHandleButton(_ref, ref) {
34
46
  var label = _ref.label,
@@ -9,7 +9,7 @@ exports.DragHandleButton = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
- var _dragHandleVerticalDragHandler = _interopRequireDefault(require("@atlaskit/icon/core/migration/drag-handle-vertical--drag-handler"));
12
+ var _dragHandleVertical = _interopRequireDefault(require("@atlaskit/icon/core/drag-handle-vertical"));
13
13
  var _dragHandleButtonBase = require("./drag-handle-button-base");
14
14
  var _excluded = ["label"];
15
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -24,8 +24,7 @@ var DragHandleButton = exports.DragHandleButton = /*#__PURE__*/(0, _react.forwar
24
24
  buttonProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
25
25
  return /*#__PURE__*/_react.default.createElement(_dragHandleButtonBase.DragHandleButtonBase, (0, _extends2.default)({
26
26
  ref: ref
27
- }, buttonProps), /*#__PURE__*/_react.default.createElement(_dragHandleVerticalDragHandler.default, {
28
- color: "currentColor",
27
+ }, buttonProps), /*#__PURE__*/_react.default.createElement(_dragHandleVertical.default, {
29
28
  spacing: "spacious",
30
29
  label: label,
31
30
  size: "small"
@@ -14,11 +14,23 @@ const iconSmallStylesNew = xcss({
14
14
  display: 'inline-flex'
15
15
  });
16
16
 
17
+ // TODO: will run full deprecation process later. For now just want people to stop using this.
18
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
17
19
  /**
18
20
  * A button with pre-configured styling to look like a drag handle.
19
21
  *
20
22
  * This component uses a native button because the `@atlaskit/button`
21
23
  * cancels `mouseDown` events, which prevents dragging.
24
+ *
25
+ * @deprecated Please use `DragHandleButton`.
26
+ *
27
+ * Rationale:
28
+ *
29
+ * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
30
+ * (the smallest icon size is now `12px` x `12px`)
31
+ * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
32
+ * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
33
+ * minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
22
34
  */
23
35
  export const DragHandleButtonSmall = /*#__PURE__*/forwardRef(function DragHandleButton({
24
36
  label,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { forwardRef } from 'react';
3
- import DragHandleVerticalIcon from '@atlaskit/icon/core/migration/drag-handle-vertical--drag-handler';
3
+ import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
4
4
  import { DragHandleButtonBase } from './drag-handle-button-base';
5
5
  /**
6
6
  * A button with pre-configured styling to look like a drag handle.
@@ -15,7 +15,6 @@ export const DragHandleButton = /*#__PURE__*/forwardRef(function DragHandleButto
15
15
  return /*#__PURE__*/React.createElement(DragHandleButtonBase, _extends({
16
16
  ref: ref
17
17
  }, buttonProps), /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
18
- color: "currentColor",
19
18
  spacing: "spacious",
20
19
  label: label,
21
20
  size: "small"
@@ -16,11 +16,23 @@ var iconSmallStylesNew = xcss({
16
16
  display: 'inline-flex'
17
17
  });
18
18
 
19
+ // TODO: will run full deprecation process later. For now just want people to stop using this.
20
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
19
21
  /**
20
22
  * A button with pre-configured styling to look like a drag handle.
21
23
  *
22
24
  * This component uses a native button because the `@atlaskit/button`
23
25
  * cancels `mouseDown` events, which prevents dragging.
26
+ *
27
+ * @deprecated Please use `DragHandleButton`.
28
+ *
29
+ * Rationale:
30
+ *
31
+ * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
32
+ * (the smallest icon size is now `12px` x `12px`)
33
+ * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
34
+ * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
35
+ * minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
24
36
  */
25
37
  export var DragHandleButtonSmall = /*#__PURE__*/forwardRef(function DragHandleButton(_ref, ref) {
26
38
  var label = _ref.label,
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["label"];
4
4
  import React, { forwardRef } from 'react';
5
- import DragHandleVerticalIcon from '@atlaskit/icon/core/migration/drag-handle-vertical--drag-handler';
5
+ import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
6
6
  import { DragHandleButtonBase } from './drag-handle-button-base';
7
7
  /**
8
8
  * A button with pre-configured styling to look like a drag handle.
@@ -16,7 +16,6 @@ export var DragHandleButton = /*#__PURE__*/forwardRef(function DragHandleButton(
16
16
  return /*#__PURE__*/React.createElement(DragHandleButtonBase, _extends({
17
17
  ref: ref
18
18
  }, buttonProps), /*#__PURE__*/React.createElement(DragHandleVerticalIcon, {
19
- color: "currentColor",
20
19
  spacing: "spacious",
21
20
  label: label,
22
21
  size: "small"
@@ -4,6 +4,16 @@ import React from 'react';
4
4
  *
5
5
  * This component uses a native button because the `@atlaskit/button`
6
6
  * cancels `mouseDown` events, which prevents dragging.
7
+ *
8
+ * @deprecated Please use `DragHandleButton`.
9
+ *
10
+ * Rationale:
11
+ *
12
+ * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
13
+ * (the smallest icon size is now `12px` x `12px`)
14
+ * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
15
+ * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
16
+ * minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
7
17
  */
8
18
  export declare const DragHandleButtonSmall: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
19
  appearance?: import("./types").DragHandleButtonAppearance;
@@ -4,6 +4,16 @@ import React from 'react';
4
4
  *
5
5
  * This component uses a native button because the `@atlaskit/button`
6
6
  * cancels `mouseDown` events, which prevents dragging.
7
+ *
8
+ * @deprecated Please use `DragHandleButton`.
9
+ *
10
+ * Rationale:
11
+ *
12
+ * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system
13
+ * (the smallest icon size is now `12px` x `12px`)
14
+ * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility
15
+ * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`
16
+ * minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)
7
17
  */
8
18
  export declare const DragHandleButtonSmall: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
19
  appearance?: import("./types").DragHandleButtonAppearance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
3
- "version": "2.0.8",
3
+ "version": "2.1.0",
4
4
  "description": "An optional package for Pragmatic drag and drop containing react components to assist with setting up accessible experiences",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -51,8 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@af/visual-regression": "workspace:^",
53
53
  "@atlaskit/ds-lib": "^5.0.0",
54
- "@atlaskit/visual-regression": "workspace:^",
55
- "@atlassian/ssr-tests": "^0.2.0",
54
+ "@atlassian/ssr-tests": "^0.3.0",
56
55
  "@testing-library/react": "^13.4.0",
57
56
  "react-dom": "^18.2.0",
58
57
  "wait-for-expect": "^1.2.0"