@atlaskit/pragmatic-drag-and-drop-react-accessibility 2.0.7 → 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 +28 -0
- package/constellation/drag-handle-button/about.mdx +15 -2
- package/dist/cjs/drag-handle-button-small.js +12 -0
- package/dist/cjs/drag-handle-button.js +2 -3
- package/dist/es2019/drag-handle-button-small.js +12 -0
- package/dist/es2019/drag-handle-button.js +1 -2
- package/dist/esm/drag-handle-button-small.js +12 -0
- package/dist/esm/drag-handle-button.js +1 -2
- package/dist/types/drag-handle-button-base.d.ts +0 -1
- package/dist/types/drag-handle-button-small.d.ts +13 -3
- package/dist/types/drag-handle-button.d.ts +3 -3
- package/dist/types-ts4.5/drag-handle-button-base.d.ts +0 -1
- package/dist/types-ts4.5/drag-handle-button-small.d.ts +13 -3
- package/dist/types-ts4.5/drag-handle-button.d.ts +3 -3
- package/drag-handle-button/package.json +1 -1
- package/drag-handle-button-small/package.json +1 -1
- package/package.json +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
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
|
+
|
|
25
|
+
## 2.0.8
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
3
31
|
## 2.0.7
|
|
4
32
|
|
|
5
33
|
### 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
|
|
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
|
|
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(
|
|
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/
|
|
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/
|
|
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,10 +4,20 @@ 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
|
-
appearance?: import("./types").DragHandleButtonAppearance
|
|
19
|
+
appearance?: import("./types").DragHandleButtonAppearance;
|
|
10
20
|
label: string;
|
|
11
|
-
isSelected?: boolean
|
|
12
|
-
testId?: string
|
|
21
|
+
isSelected?: boolean;
|
|
22
|
+
testId?: string;
|
|
13
23
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
|
6
6
|
* cancels `mouseDown` events, which prevents dragging.
|
|
7
7
|
*/
|
|
8
8
|
export declare const DragHandleButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
appearance?: import("./types").DragHandleButtonAppearance
|
|
9
|
+
appearance?: import("./types").DragHandleButtonAppearance;
|
|
10
10
|
label: string;
|
|
11
|
-
isSelected?: boolean
|
|
12
|
-
testId?: string
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
testId?: string;
|
|
13
13
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,10 +4,20 @@ 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
|
-
appearance?: import("./types").DragHandleButtonAppearance
|
|
19
|
+
appearance?: import("./types").DragHandleButtonAppearance;
|
|
10
20
|
label: string;
|
|
11
|
-
isSelected?: boolean
|
|
12
|
-
testId?: string
|
|
21
|
+
isSelected?: boolean;
|
|
22
|
+
testId?: string;
|
|
13
23
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
|
6
6
|
* cancels `mouseDown` events, which prevents dragging.
|
|
7
7
|
*/
|
|
8
8
|
export declare const DragHandleButton: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
-
appearance?: import("./types").DragHandleButtonAppearance
|
|
9
|
+
appearance?: import("./types").DragHandleButtonAppearance;
|
|
10
10
|
label: string;
|
|
11
|
-
isSelected?: boolean
|
|
12
|
-
testId?: string
|
|
11
|
+
isSelected?: boolean;
|
|
12
|
+
testId?: string;
|
|
13
13
|
} & React.RefAttributes<HTMLButtonElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
|
|
3
|
-
"version": "2.0
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
41
|
-
"@atlaskit/icon": "^
|
|
41
|
+
"@atlaskit/icon": "^28.0.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
43
|
"@atlaskit/primitives": "^14.11.0",
|
|
44
44
|
"@atlaskit/tokens": "^6.0.0",
|
|
@@ -51,11 +51,9 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@af/visual-regression": "workspace:^",
|
|
53
53
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
54
|
-
"@
|
|
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
|
-
"typescript": "~5.4.2",
|
|
59
57
|
"wait-for-expect": "^1.2.0"
|
|
60
58
|
},
|
|
61
59
|
"techstack": {
|