@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 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
@@ -1,7 +1,5 @@
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
@@ -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)({
@@ -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);
@@ -16,7 +16,8 @@ var buttonStyles = css({
16
16
  padding: "var(--ds-space-0, 0px)",
17
17
  width: 'max-content',
18
18
  border: 'none',
19
- cursor: 'grab'
19
+ cursor: 'grab',
20
+ display: 'flex'
20
21
  });
21
22
  var buttonAppearanceStyles = {
22
23
  default: css({
@@ -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.2.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": "PragmaticDragAndDropReactAccessibility",
16
- "category": "Components"
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",
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
3
- "version": "0.2.0",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
3
- "version": "0.2.0",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/pragmatic-drag-and-drop-react-accessibility",
3
- "version": "0.2.0",
4
- "sideEffects": false
5
- }