@atlaskit/pragmatic-drag-and-drop-react-accessibility 0.2.0 → 0.3.1
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 +13 -1
- package/constellation/drag-handle-button/examples.mdx +3 -3
- package/constellation/drag-handle-button/props.mdx +0 -1
- package/constellation/drag-handle-dropdown-menu/examples.mdx +3 -3
- package/constellation/drag-handle-dropdown-menu/props.mdx +0 -1
- package/constellation/index/about.mdx +1 -3
- package/dist/cjs/drag-handle-button.js +4 -4
- package/dist/cjs/drag-handle-dropdown-menu.js +4 -2
- package/dist/cjs/index.js +1 -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/package.json +8 -5
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
- package/dist/types-ts4.5/drag-handle-button.d.ts +0 -49
- package/dist/types-ts4.5/drag-handle-dropdown-menu.d.ts +0 -26
- package/dist/types-ts4.5/index.d.ts +0 -5
- package/tmp/api-report-tmp.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
# @atlaskit/pragmatic-drag-and-drop-react-accessibility
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 0.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#38144](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38144) [`ee9aa9b7300`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee9aa9b7300) - [ux] The button now has `display: flex`
|
|
14
|
+
|
|
3
15
|
## 0.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
6
18
|
|
|
7
|
-
- [`ffb3e727aaf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ffb3e727aaf) - The `type` of the `DragHandleButton` now defaults to `'button'` (instead of `'submit'`)
|
|
19
|
+
- [#38115](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38115) [`ffb3e727aaf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ffb3e727aaf) - The `type` of the `DragHandleButton` now defaults to `'button'` (instead of `'submit'`)
|
|
8
20
|
- [`9f5b56f5677`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9f5b56f5677) - The `DragHandleButton` props now extend `ButtonHTMLAttributes` (instead of just `HTMLAttributes`)
|
|
@@ -12,10 +12,10 @@ import DragHandleButtonExample from '../../examples/drag-handle-button';
|
|
|
12
12
|
<SectionMessage appearance="warning">
|
|
13
13
|
This component does not use the <Code>@atlaskit/button</Code> component,
|
|
14
14
|
because <Code>@atlaskit/button</Code> cancels <Code>mousedown</Code> events
|
|
15
|
-
and prevents dragging from occurring.
|
|
16
|
-
|
|
15
|
+
and prevents dragging from occurring. Instead this component uses a native{' '}
|
|
16
|
+
<Code><button></Code> element.
|
|
17
17
|
</SectionMessage>
|
|
18
18
|
|
|
19
19
|
## Default
|
|
20
20
|
|
|
21
|
-
<Example Component={DragHandleButtonExample} />
|
|
21
|
+
<Example Component={DragHandleButtonExample} />
|
|
@@ -12,10 +12,10 @@ import DragHandleDropdownMenuExample from '../../examples/drag-handle-dropdown-m
|
|
|
12
12
|
<SectionMessage appearance="warning">
|
|
13
13
|
This component does not use the <Code>@atlaskit/button</Code> component,
|
|
14
14
|
because <Code>@atlaskit/button</Code> cancels <Code>mousedown</Code> events
|
|
15
|
-
and prevents dragging from occurring.
|
|
16
|
-
|
|
15
|
+
and prevents dragging from occurring. Instead this component uses a native{' '}
|
|
16
|
+
<Code><button></Code> element.
|
|
17
17
|
</SectionMessage>
|
|
18
18
|
|
|
19
19
|
## Default
|
|
20
20
|
|
|
21
|
-
<Example Component={DragHandleDropdownMenuExample} />
|
|
21
|
+
<Example Component={DragHandleDropdownMenuExample} />
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
order: 0
|
|
3
|
-
title: React Accessibility
|
|
4
|
-
description: React components to help implement accessible alternative flows
|
|
5
3
|
---
|
|
6
4
|
|
|
7
5
|
This package provides some optional `react` components that can be used to build
|
|
8
|
-
alternative flows for accessibility.
|
|
6
|
+
alternative flows for accessibility.
|
|
@@ -22,7 +22,8 @@ var buttonStyles = (0, _react2.css)({
|
|
|
22
22
|
padding: "var(--ds-space-0, 0px)",
|
|
23
23
|
width: 'max-content',
|
|
24
24
|
border: 'none',
|
|
25
|
-
cursor: 'grab'
|
|
25
|
+
cursor: 'grab',
|
|
26
|
+
display: 'flex'
|
|
26
27
|
});
|
|
27
28
|
var buttonAppearanceStyles = {
|
|
28
29
|
default: (0, _react2.css)({
|
|
@@ -54,7 +55,7 @@ var buttonAppearanceStyles = {
|
|
|
54
55
|
* This component uses a native button because the `@atlaskit/button`
|
|
55
56
|
* cancels `mouseDown` events, which prevents dragging.
|
|
56
57
|
*/
|
|
57
|
-
var DragHandleButton = /*#__PURE__*/(0, _react.forwardRef)(function DragHandleButton(_ref, ref) {
|
|
58
|
+
var DragHandleButton = exports.DragHandleButton = /*#__PURE__*/(0, _react.forwardRef)(function DragHandleButton(_ref, ref) {
|
|
58
59
|
var _ref$isSelected = _ref.isSelected,
|
|
59
60
|
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
60
61
|
testId = _ref.testId,
|
|
@@ -73,5 +74,4 @@ var DragHandleButton = /*#__PURE__*/(0, _react.forwardRef)(function DragHandleBu
|
|
|
73
74
|
}, buttonProps), (0, _react2.jsx)(_dragHandler.default, {
|
|
74
75
|
label: label
|
|
75
76
|
})));
|
|
76
|
-
});
|
|
77
|
-
exports.DragHandleButton = DragHandleButton;
|
|
77
|
+
});
|
|
@@ -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);
|
package/dist/cjs/index.js
CHANGED
|
@@ -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;
|
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.1",
|
|
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",
|
|
@@ -37,11 +40,11 @@
|
|
|
37
40
|
"./drag-handle-dropdown-menu": "./src/drag-handle-dropdown-menu.tsx"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
|
-
"@atlaskit/dropdown-menu": "^
|
|
43
|
+
"@atlaskit/dropdown-menu": "^12.0.0",
|
|
41
44
|
"@atlaskit/ds-lib": "^2.2.3",
|
|
42
45
|
"@atlaskit/focus-ring": "^1.3.4",
|
|
43
46
|
"@atlaskit/icon": "^21.12.6",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
47
|
+
"@atlaskit/tokens": "^1.25.0",
|
|
45
48
|
"@babel/runtime": "^7.0.0",
|
|
46
49
|
"@emotion/react": "^11.7.1"
|
|
47
50
|
},
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED
package/dist/esm/version.json
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
3
|
-
export type DragHandleButtonAppearance = 'default' | 'subtle' | 'selected';
|
|
4
|
-
export type DragHandleButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
-
/**
|
|
6
|
-
* Change the style to indicate the button is selected
|
|
7
|
-
*/
|
|
8
|
-
isSelected?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* A `testId` prop is provided for specified elements, which is a unique string
|
|
11
|
-
* that appears as a data attribute `data-testid` in the rendered code,
|
|
12
|
-
* serving as a hook for automated tests
|
|
13
|
-
*/
|
|
14
|
-
testId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The base styling to apply to the button
|
|
17
|
-
*/
|
|
18
|
-
appearance?: DragHandleButtonAppearance;
|
|
19
|
-
/**
|
|
20
|
-
* Text used to describe what the button is in context.
|
|
21
|
-
*/
|
|
22
|
-
label: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* A button with pre-configured styling to look like a drag handle.
|
|
26
|
-
*
|
|
27
|
-
* This component uses a native button because the `@atlaskit/button`
|
|
28
|
-
* cancels `mouseDown` events, which prevents dragging.
|
|
29
|
-
*/
|
|
30
|
-
export declare const DragHandleButton: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
31
|
-
/**
|
|
32
|
-
* Change the style to indicate the button is selected
|
|
33
|
-
*/
|
|
34
|
-
isSelected?: boolean | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* A `testId` prop is provided for specified elements, which is a unique string
|
|
37
|
-
* that appears as a data attribute `data-testid` in the rendered code,
|
|
38
|
-
* serving as a hook for automated tests
|
|
39
|
-
*/
|
|
40
|
-
testId?: string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* The base styling to apply to the button
|
|
43
|
-
*/
|
|
44
|
-
appearance?: DragHandleButtonAppearance | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Text used to describe what the button is in context.
|
|
47
|
-
*/
|
|
48
|
-
label: string;
|
|
49
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReactElement, Ref } from 'react';
|
|
2
|
-
import { DragHandleButtonAppearance } from './drag-handle-button';
|
|
3
|
-
export type DragHandleDropdownMenuProps = {
|
|
4
|
-
/**
|
|
5
|
-
* The contents of the dropdown menu.
|
|
6
|
-
*/
|
|
7
|
-
children: ReactElement;
|
|
8
|
-
/**
|
|
9
|
-
* Ref for the button which acts as the dropdown trigger.
|
|
10
|
-
*/
|
|
11
|
-
triggerRef: Ref<HTMLButtonElement>;
|
|
12
|
-
/**
|
|
13
|
-
* The appearance of the button which acts as the dropdown trigger.
|
|
14
|
-
*/
|
|
15
|
-
appearance?: DragHandleButtonAppearance;
|
|
16
|
-
/**
|
|
17
|
-
* The string used as the button label.
|
|
18
|
-
*/
|
|
19
|
-
label: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* A dropdown menu with a predefined trigger, styled to look like a drag handle.
|
|
23
|
-
*
|
|
24
|
-
* The API is designed to mirror the `@atlaskit/dropdown-menu` API.
|
|
25
|
-
*/
|
|
26
|
-
export declare function DragHandleDropdownMenu({ children, triggerRef: consumerRef, label, }: DragHandleDropdownMenuProps): JSX.Element;
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/pragmatic-drag-and-drop-react-accessibility"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
// @public
|
|
8
|
-
const _default: {};
|
|
9
|
-
export default _default;
|
|
10
|
-
|
|
11
|
-
// (No @packageDocumentation comment for this package)
|
|
12
|
-
|
|
13
|
-
```
|