@atlaskit/pragmatic-drag-and-drop-react-accessibility 0.2.0 → 0.3.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 +6 -0
- package/constellation/index/about.mdx +0 -2
- package/dist/cjs/drag-handle-button.js +2 -1
- package/dist/cjs/drag-handle-dropdown-menu.js +4 -2
- package/dist/es2019/drag-handle-button.js +11 -1
- package/dist/es2019/drag-handle-dropdown-menu.js +4 -2
- package/dist/esm/drag-handle-button.js +2 -1
- package/dist/esm/drag-handle-dropdown-menu.js +4 -2
- package/dist/types/drag-handle-dropdown-menu.d.ts +1 -1
- package/dist/types-ts4.5/drag-handle-dropdown-menu.d.ts +1 -1
- package/package.json +6 -3
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/pragmatic-drag-and-drop-react-accessibility
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ee9aa9b7300`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee9aa9b7300) - [ux] The button now has `display: flex`
|
|
8
|
+
|
|
3
9
|
## 0.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -23,6 +23,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
function DragHandleDropdownMenu(_ref) {
|
|
24
24
|
var children = _ref.children,
|
|
25
25
|
consumerRef = _ref.triggerRef,
|
|
26
|
+
appearance = _ref.appearance,
|
|
26
27
|
label = _ref.label;
|
|
27
28
|
var renderTrigger = (0, _react.useCallback)(function (_ref2) {
|
|
28
29
|
var triggerRef = _ref2.triggerRef,
|
|
@@ -31,9 +32,10 @@ function DragHandleDropdownMenu(_ref) {
|
|
|
31
32
|
return /*#__PURE__*/_react.default.createElement(_dragHandleButton.DragHandleButton, (0, _extends2.default)({
|
|
32
33
|
ref: mergedRef
|
|
33
34
|
}, triggerProps, {
|
|
34
|
-
label: label
|
|
35
|
+
label: label,
|
|
36
|
+
appearance: appearance
|
|
35
37
|
}));
|
|
36
|
-
}, [consumerRef, label]);
|
|
38
|
+
}, [appearance, consumerRef, label]);
|
|
37
39
|
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.default, {
|
|
38
40
|
trigger: renderTrigger
|
|
39
41
|
}, children);
|
|
@@ -14,7 +14,8 @@ const buttonStyles = css({
|
|
|
14
14
|
padding: "var(--ds-space-0, 0px)",
|
|
15
15
|
width: 'max-content',
|
|
16
16
|
border: 'none',
|
|
17
|
-
cursor: 'grab'
|
|
17
|
+
cursor: 'grab',
|
|
18
|
+
display: 'flex'
|
|
18
19
|
});
|
|
19
20
|
const buttonAppearanceStyles = {
|
|
20
21
|
default: css({
|
|
@@ -51,6 +52,15 @@ export const DragHandleButton = /*#__PURE__*/forwardRef(function DragHandleButto
|
|
|
51
52
|
testId,
|
|
52
53
|
appearance: appearanceProp = 'default',
|
|
53
54
|
label,
|
|
55
|
+
/**
|
|
56
|
+
* Defaulting to `button` instead of `submit` (native default in some cases).
|
|
57
|
+
*
|
|
58
|
+
* A type of `submit` only makes sense in a form context, and isn't very
|
|
59
|
+
* relevant to a drag handle.
|
|
60
|
+
*
|
|
61
|
+
* `@atlaskit/button` also defaults to a type of `button` as well, as it
|
|
62
|
+
* is more semantically appropriate in a wider range of cases.
|
|
63
|
+
*/
|
|
54
64
|
type = 'button',
|
|
55
65
|
...buttonProps
|
|
56
66
|
}, ref) {
|
|
@@ -12,6 +12,7 @@ import { DragHandleButton } from './drag-handle-button';
|
|
|
12
12
|
export function DragHandleDropdownMenu({
|
|
13
13
|
children,
|
|
14
14
|
triggerRef: consumerRef,
|
|
15
|
+
appearance,
|
|
15
16
|
label
|
|
16
17
|
}) {
|
|
17
18
|
const renderTrigger = useCallback(({
|
|
@@ -22,9 +23,10 @@ export function DragHandleDropdownMenu({
|
|
|
22
23
|
return /*#__PURE__*/React.createElement(DragHandleButton, _extends({
|
|
23
24
|
ref: mergedRef
|
|
24
25
|
}, triggerProps, {
|
|
25
|
-
label: label
|
|
26
|
+
label: label,
|
|
27
|
+
appearance: appearance
|
|
26
28
|
}));
|
|
27
|
-
}, [consumerRef, label]);
|
|
29
|
+
}, [appearance, consumerRef, label]);
|
|
28
30
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
29
31
|
trigger: renderTrigger
|
|
30
32
|
}, children);
|
|
@@ -14,6 +14,7 @@ import { DragHandleButton } from './drag-handle-button';
|
|
|
14
14
|
export function DragHandleDropdownMenu(_ref) {
|
|
15
15
|
var children = _ref.children,
|
|
16
16
|
consumerRef = _ref.triggerRef,
|
|
17
|
+
appearance = _ref.appearance,
|
|
17
18
|
label = _ref.label;
|
|
18
19
|
var renderTrigger = useCallback(function (_ref2) {
|
|
19
20
|
var triggerRef = _ref2.triggerRef,
|
|
@@ -22,9 +23,10 @@ export function DragHandleDropdownMenu(_ref) {
|
|
|
22
23
|
return /*#__PURE__*/React.createElement(DragHandleButton, _extends({
|
|
23
24
|
ref: mergedRef
|
|
24
25
|
}, triggerProps, {
|
|
25
|
-
label: label
|
|
26
|
+
label: label,
|
|
27
|
+
appearance: appearance
|
|
26
28
|
}));
|
|
27
|
-
}, [consumerRef, label]);
|
|
29
|
+
}, [appearance, consumerRef, label]);
|
|
28
30
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
29
31
|
trigger: renderTrigger
|
|
30
32
|
}, children);
|
|
@@ -23,4 +23,4 @@ export type DragHandleDropdownMenuProps = {
|
|
|
23
23
|
*
|
|
24
24
|
* The API is designed to mirror the `@atlaskit/dropdown-menu` API.
|
|
25
25
|
*/
|
|
26
|
-
export declare function DragHandleDropdownMenu({ children, triggerRef: consumerRef, label, }: DragHandleDropdownMenuProps): JSX.Element;
|
|
26
|
+
export declare function DragHandleDropdownMenu({ children, triggerRef: consumerRef, appearance, label, }: DragHandleDropdownMenuProps): JSX.Element;
|
|
@@ -23,4 +23,4 @@ export type DragHandleDropdownMenuProps = {
|
|
|
23
23
|
*
|
|
24
24
|
* The API is designed to mirror the `@atlaskit/dropdown-menu` API.
|
|
25
25
|
*/
|
|
26
|
-
export declare function DragHandleDropdownMenu({ children, triggerRef: consumerRef, label, }: DragHandleDropdownMenuProps): JSX.Element;
|
|
26
|
+
export declare function DragHandleDropdownMenu({ children, triggerRef: consumerRef, appearance, label, }: DragHandleDropdownMenuProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Optional react components to help implement accessible alternative flows for Pragmatic drag and drop",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
"inPublicMirror": false,
|
|
13
13
|
"releaseModel": "continuous",
|
|
14
14
|
"website": {
|
|
15
|
-
"name": "
|
|
16
|
-
"category": "
|
|
15
|
+
"name": "React accessibility",
|
|
16
|
+
"category": "Libraries",
|
|
17
|
+
"status": {
|
|
18
|
+
"type": "alpha"
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
22
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED