carbon-react 114.18.2 → 115.0.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.
Files changed (81) hide show
  1. package/esm/__internal__/checkable-input/checkable-input.component.d.ts +1 -1
  2. package/esm/__internal__/checkable-input/checkable-input.component.js +3 -4
  3. package/esm/__internal__/checkable-input/hidden-checkable-input.component.d.ts +2 -0
  4. package/esm/__internal__/checkable-input/hidden-checkable-input.component.js +5 -5
  5. package/esm/__internal__/input/input.component.js +2 -1
  6. package/esm/__internal__/input-behaviour/input-behaviour.component.js +2 -7
  7. package/esm/__internal__/input-behaviour/useInputBehaviour.d.ts +0 -1
  8. package/esm/components/checkbox/checkbox.component.d.ts +2 -0
  9. package/esm/components/checkbox/checkbox.component.js +2 -0
  10. package/esm/components/draggable/draggable-container.component.d.ts +17 -0
  11. package/esm/components/draggable/draggable-container.component.js +174 -61
  12. package/esm/components/draggable/draggable-item.component.d.ts +30 -0
  13. package/esm/components/draggable/draggable-item.component.js +180 -36
  14. package/esm/components/draggable/draggable-item.style.d.ts +9 -0
  15. package/esm/components/draggable/index.d.ts +4 -2
  16. package/esm/components/draggable/internal/drop-target.component.d.ts +8 -0
  17. package/esm/components/draggable/internal/drop-target.component.js +187 -0
  18. package/esm/components/grouped-character/grouped-character.component.js +0 -1
  19. package/esm/components/inline-inputs/index.d.ts +1 -1
  20. package/esm/components/inline-inputs/index.js +1 -1
  21. package/esm/components/inline-inputs/inline-inputs.component.d.ts +6 -5
  22. package/esm/components/inline-inputs/inline-inputs.component.js +8 -13
  23. package/esm/components/number/number.component.js +0 -1
  24. package/esm/components/select/filterable-select/filterable-select.component.js +11 -4
  25. package/esm/components/select/multi-select/multi-select.component.js +13 -4
  26. package/esm/components/select/select-textbox/select-textbox.component.js +2 -0
  27. package/esm/components/select/simple-select/simple-select.component.js +13 -4
  28. package/esm/components/settings-row/index.d.ts +2 -1
  29. package/esm/components/settings-row/settings-row.component.d.ts +22 -0
  30. package/esm/components/settings-row/settings-row.component.js +165 -23
  31. package/esm/components/settings-row/settings-row.style.d.ts +7 -0
  32. package/esm/components/textarea/textarea.component.d.ts +2 -0
  33. package/esm/components/textarea/textarea.component.js +2 -2
  34. package/esm/components/textbox/textbox.component.d.ts +7 -3
  35. package/esm/components/textbox/textbox.component.js +3 -5
  36. package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +0 -1
  37. package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
  38. package/lib/__internal__/checkable-input/checkable-input.component.d.ts +1 -1
  39. package/lib/__internal__/checkable-input/checkable-input.component.js +3 -4
  40. package/lib/__internal__/checkable-input/hidden-checkable-input.component.d.ts +2 -0
  41. package/lib/__internal__/checkable-input/hidden-checkable-input.component.js +5 -5
  42. package/lib/__internal__/input/input.component.js +2 -1
  43. package/lib/__internal__/input-behaviour/input-behaviour.component.js +2 -12
  44. package/lib/__internal__/input-behaviour/useInputBehaviour.d.ts +0 -1
  45. package/lib/components/checkbox/checkbox.component.d.ts +2 -0
  46. package/lib/components/checkbox/checkbox.component.js +2 -0
  47. package/lib/components/draggable/draggable-container.component.d.ts +17 -0
  48. package/lib/components/draggable/draggable-container.component.js +174 -64
  49. package/lib/components/draggable/draggable-item.component.d.ts +30 -0
  50. package/lib/components/draggable/draggable-item.component.js +179 -37
  51. package/lib/components/draggable/draggable-item.style.d.ts +9 -0
  52. package/lib/components/draggable/index.d.ts +4 -2
  53. package/lib/components/draggable/internal/drop-target.component.d.ts +8 -0
  54. package/lib/components/draggable/internal/drop-target.component.js +200 -0
  55. package/lib/components/grouped-character/grouped-character.component.js +0 -1
  56. package/lib/components/inline-inputs/index.d.ts +1 -1
  57. package/lib/components/inline-inputs/index.js +2 -10
  58. package/lib/components/inline-inputs/inline-inputs.component.d.ts +6 -5
  59. package/lib/components/inline-inputs/inline-inputs.component.js +11 -20
  60. package/lib/components/number/number.component.js +0 -1
  61. package/lib/components/select/filterable-select/filterable-select.component.js +12 -4
  62. package/lib/components/select/multi-select/multi-select.component.js +14 -4
  63. package/lib/components/select/select-textbox/select-textbox.component.js +2 -0
  64. package/lib/components/select/simple-select/simple-select.component.js +14 -4
  65. package/lib/components/settings-row/index.d.ts +2 -1
  66. package/lib/components/settings-row/settings-row.component.d.ts +22 -0
  67. package/lib/components/settings-row/settings-row.component.js +166 -26
  68. package/lib/components/settings-row/settings-row.style.d.ts +7 -0
  69. package/lib/components/textarea/textarea.component.d.ts +2 -0
  70. package/lib/components/textarea/textarea.component.js +2 -2
  71. package/lib/components/textbox/textbox.component.d.ts +7 -3
  72. package/lib/components/textbox/textbox.component.js +3 -5
  73. package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +0 -1
  74. package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
  75. package/package.json +1 -1
  76. package/esm/components/draggable/draggable-container.d.ts +0 -28
  77. package/esm/components/draggable/draggable-item.d.ts +0 -18
  78. package/esm/components/settings-row/settings-row.d.ts +0 -21
  79. package/lib/components/draggable/draggable-container.d.ts +0 -28
  80. package/lib/components/draggable/draggable-item.d.ts +0 -18
  81. package/lib/components/settings-row/settings-row.d.ts +0 -21
@@ -29,7 +29,7 @@ export interface CommonCheckableInputProps extends ValidationProps, CommonHidden
29
29
  reverse?: boolean;
30
30
  /** Size of the component */
31
31
  size?: "small" | "large";
32
- /** The id of the element that labels the input */
32
+ /** Prop to specify the aria-labelledby attribute of the input */
33
33
  ariaLabelledBy?: string;
34
34
  /** When true, displays validation icon on label */
35
35
  validationOnLabel?: boolean;
@@ -9,7 +9,7 @@ import HiddenCheckableInput from "./hidden-checkable-input.component";
9
9
  import guid from "../utils/helpers/guid";
10
10
  import useInputAccessibility from "../../hooks/__internal__/useInputAccessibility";
11
11
  const CheckableInput = /*#__PURE__*/React.forwardRef(({
12
- ariaLabelledBy: externalAriaLabelledBy,
12
+ ariaLabelledBy,
13
13
  autoFocus,
14
14
  checked,
15
15
  children,
@@ -45,8 +45,7 @@ const CheckableInput = /*#__PURE__*/React.forwardRef(({
45
45
  labelId,
46
46
  fieldHelpId,
47
47
  validationIconId,
48
- ariaDescribedBy,
49
- ariaLabelledBy
48
+ ariaDescribedBy
50
49
  } = useInputAccessibility({
51
50
  id,
52
51
  error,
@@ -82,7 +81,7 @@ const CheckableInput = /*#__PURE__*/React.forwardRef(({
82
81
  };
83
82
  const inputProps = {
84
83
  "aria-describedby": ariaDescribedBy,
85
- "aria-labelledby": externalAriaLabelledBy || ariaLabelledBy,
84
+ "aria-labelledby": ariaLabelledBy,
86
85
  "aria-invalid": !!error,
87
86
  autoFocus,
88
87
  checked,
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  export interface CommonHiddenCheckableInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "size" | "type"> {
3
+ /** Prop to specify the aria-labelledby attribute of the input */
4
+ ariaLabelledBy?: string;
3
5
  /** If true the Component will be focused when page load */
4
6
  autoFocus?: boolean;
5
7
  /** Checked state of the input */
@@ -5,6 +5,7 @@ import PropTypes from "prop-types";
5
5
  import HiddenCheckableInputStyle from "./hidden-checkable-input.style";
6
6
  import { InputContext, InputGroupContext } from "../input-behaviour";
7
7
  const HiddenCheckableInput = /*#__PURE__*/React.forwardRef(({
8
+ ariaLabelledBy,
8
9
  name,
9
10
  checked,
10
11
  type,
@@ -18,8 +19,7 @@ const HiddenCheckableInput = /*#__PURE__*/React.forwardRef(({
18
19
  onBlur,
19
20
  onFocus,
20
21
  onMouseEnter,
21
- onMouseLeave,
22
- ariaLabelledBy
22
+ onMouseLeave
23
23
  } = useContext(InputContext);
24
24
  const {
25
25
  onBlur: onBlurGroup,
@@ -53,6 +53,7 @@ const HiddenCheckableInput = /*#__PURE__*/React.forwardRef(({
53
53
  };
54
54
 
55
55
  return /*#__PURE__*/React.createElement(HiddenCheckableInputStyle, _extends({
56
+ "aria-labelledby": ariaLabelledBy,
56
57
  autoFocus: autoFocus,
57
58
  "aria-checked": checked,
58
59
  checked: checked,
@@ -60,9 +61,7 @@ const HiddenCheckableInput = /*#__PURE__*/React.forwardRef(({
60
61
  role: role || type,
61
62
  type: type,
62
63
  value: value
63
- }, props, ariaLabelledBy && {
64
- "aria-labelledby": ariaLabelledBy
65
- }, {
64
+ }, props, {
66
65
  onFocus: handleFocus,
67
66
  onBlur: handleBlur,
68
67
  onMouseEnter: handleMouseEnter,
@@ -124,6 +123,7 @@ HiddenCheckableInput.propTypes = {
124
123
  "aria-valuemin": PropTypes.number,
125
124
  "aria-valuenow": PropTypes.number,
126
125
  "aria-valuetext": PropTypes.string,
126
+ "ariaLabelledBy": PropTypes.string,
127
127
  "autoCapitalize": PropTypes.string,
128
128
  "autoComplete": PropTypes.string,
129
129
  "autoCorrect": PropTypes.string,
@@ -29,6 +29,7 @@ function selectTextOnFocus(input) {
29
29
 
30
30
  const Input = /*#__PURE__*/React.forwardRef(({
31
31
  align,
32
+ "aria-labelledby": ariaLabelledBy,
32
33
  placeholder,
33
34
  disabled,
34
35
  readOnly,
@@ -145,7 +146,7 @@ const Input = /*#__PURE__*/React.forwardRef(({
145
146
  };
146
147
 
147
148
  return /*#__PURE__*/React.createElement(StyledInput, _extends({}, rest, {
148
- "aria-labelledby": context.ariaLabelledBy,
149
+ "aria-labelledby": ariaLabelledBy,
149
150
  align: align,
150
151
  placeholder: placeholder,
151
152
  disabled: disabled,
@@ -1,6 +1,5 @@
1
- import React, { useContext } from "react";
1
+ import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import { InlineInputsContext } from "../../components/inline-inputs";
4
3
  import useInputBehaviour from "./useInputBehaviour";
5
4
  const InputContext = /*#__PURE__*/React.createContext({});
6
5
 
@@ -8,12 +7,8 @@ const InputBehaviour = ({
8
7
  children
9
8
  }) => {
10
9
  const contextValue = useInputBehaviour();
11
- const {
12
- ariaLabelledBy
13
- } = useContext(InlineInputsContext);
14
10
  return /*#__PURE__*/React.createElement(InputContext.Provider, {
15
- value: { ...contextValue,
16
- ariaLabelledBy
11
+ value: { ...contextValue
17
12
  }
18
13
  }, children);
19
14
  };
@@ -9,7 +9,6 @@ export interface InputContextProps {
9
9
  inputRef?: (input: {
10
10
  current: HTMLInputElement | HTMLTextAreaElement | null;
11
11
  }) => void;
12
- ariaLabelledBy?: string;
13
12
  }
14
13
  declare const useInputBehaviour: (blockGroupBehaviour?: boolean | undefined) => InputContextProps;
15
14
  export default useInputBehaviour;
@@ -4,6 +4,8 @@ import { CommonCheckableInputProps } from "../../__internal__/checkable-input/ch
4
4
  export interface CheckboxProps extends CommonCheckableInputProps, MarginProps {
5
5
  /** Breakpoint for adaptive spacing (left margin changes to 0). Enables the adaptive behaviour when set */
6
6
  adaptiveSpacingBreakpoint?: number;
7
+ /** Prop to specify the aria-labelledby property of the input */
8
+ "aria-labelledby"?: string;
7
9
  /** Identifier used for testing purposes, applied to the root element of the component. */
8
10
  "data-component"?: string;
9
11
  /** Identifier used for testing purposes, applied to the root element of the component. */
@@ -12,6 +12,7 @@ import Logger from "../../__internal__/utils/logger";
12
12
  import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
13
13
  let deprecateInputRefWarnTriggered = false;
14
14
  const Checkbox = /*#__PURE__*/React.forwardRef(({
15
+ "aria-labelledby": ariaLabelledBy,
15
16
  id,
16
17
  label,
17
18
  onChange,
@@ -61,6 +62,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(({
61
62
  }
62
63
 
63
64
  const inputProps = {
65
+ ariaLabelledBy,
64
66
  onClick,
65
67
  onChange,
66
68
  onBlur,
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { MarginProps } from "styled-system";
3
+ export interface DraggableContainerProps extends MarginProps {
4
+ /** Callback fired when order is changed */
5
+ getOrder?: (draggableItemIds?: (string | number | undefined)[], movedItemId?: string | number | undefined) => void;
6
+ /**
7
+ * The content of the component
8
+ *
9
+ * `<DraggableItem />` is required to make `Draggable` works
10
+ */
11
+ children?: React.ReactNode;
12
+ }
13
+ declare const DraggableContainer: {
14
+ ({ children, getOrder, ...rest }: DraggableContainerProps): JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default DraggableContainer;
@@ -1,32 +1,13 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- import React, { useEffect, useState, useRef } from "react";
4
- import { DndProvider, useDrop } from "react-dnd";
5
- import { HTML5Backend } from "react-dnd-html5-backend";
3
+ import React, { useEffect, useState, useRef, useMemo } from "react";
6
4
  import PropTypes from "prop-types";
7
- import styledSystemPropTypes from "@styled-system/prop-types";
5
+ import { DndProvider } from "react-dnd";
6
+ import { HTML5Backend } from "react-dnd-html5-backend";
7
+ import invariant from "invariant";
8
8
  import { filterStyledSystemMarginProps } from "../../style/utils";
9
9
  import DraggableItem from "./draggable-item.component";
10
- import { StyledIcon, StyledDraggableContainer } from "./draggable-item.style";
11
- const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes);
12
-
13
- const DropTarget = ({
14
- children,
15
- getOrder,
16
- ...rest
17
- }) => {
18
- const [, drop] = useDrop({
19
- accept: "draggableItem",
20
-
21
- drop(item) {
22
- getOrder(item === null || item === void 0 ? void 0 : item.id);
23
- }
24
-
25
- });
26
- return /*#__PURE__*/React.createElement(StyledDraggableContainer, _extends({
27
- ref: drop
28
- }, rest), children);
29
- };
10
+ import DropTarget from "./internal/drop-target.component";
30
11
 
31
12
  const DraggableContainer = ({
32
13
  children,
@@ -34,6 +15,9 @@ const DraggableContainer = ({
34
15
  ...rest
35
16
  }) => {
36
17
  const [draggableItems, setDraggableItems] = useState(React.Children.toArray(children));
18
+ const hasProperChildren = useMemo(() => React.Children.toArray(children).every(child => /*#__PURE__*/React.isValidElement(child) && child.type.displayName === DraggableItem.displayName), [children]); // `<DraggableItem />` is required to make `Draggable` work
19
+
20
+ !hasProperChildren ? process.env.NODE_ENV !== "production" ? invariant(false, `\`${DraggableContainer.displayName}\` only accepts children of type \`${DraggableItem.displayName}\`.`) : invariant(false) : void 0;
37
21
  const isFirstRender = useRef(true);
38
22
  useEffect(() => {
39
23
  if (!isFirstRender.current) {
@@ -45,7 +29,7 @@ const DraggableContainer = ({
45
29
 
46
30
  const findItem = id => {
47
31
  const draggableItem = draggableItems.filter(item => {
48
- return `${item.props.id}` === id;
32
+ return /*#__PURE__*/React.isValidElement(item) && `${item.props.id}` === id;
49
33
  })[0];
50
34
  return {
51
35
  draggableItem,
@@ -79,43 +63,172 @@ const DraggableContainer = ({
79
63
  backend: HTML5Backend
80
64
  }, /*#__PURE__*/React.createElement(DropTarget, _extends({
81
65
  getOrder: getItemsId
82
- }, marginProps), draggableItems.map(item => /*#__PURE__*/React.cloneElement(item, {
83
- id: `${item.props.id}`,
84
- findItem,
85
- moveItem
86
- }, [item.props.children, /*#__PURE__*/React.createElement(StyledIcon, {
87
- key: item.props.id,
88
- type: "drag"
89
- })]))));
66
+ }, marginProps), draggableItems.map(item => {
67
+ return /*#__PURE__*/React.isValidElement(item) && /*#__PURE__*/React.cloneElement(item, {
68
+ id: `${item.props.id}`,
69
+ findItem,
70
+ moveItem
71
+ }, [item.props.children]);
72
+ })));
90
73
  };
91
74
 
92
- DraggableContainer.propTypes = { ...marginPropTypes,
93
-
94
- /** Callback fired when order is changed */
95
- getOrder: PropTypes.func,
96
-
97
- /**
98
- * The content of the component
99
- *
100
- * `<DraggableItem />` is required to make `Draggable` works
101
- * */
102
- children: (props, propName, componentName) => {
103
- const prop = props[propName];
104
- let error;
105
- React.Children.forEach(prop, child => {
106
- if (!child) {
107
- return;
108
- }
109
-
110
- if (DraggableItem.displayName !== child.type.displayName) {
111
- error = new Error(`\`${componentName}\` only accepts children of type \`${DraggableItem.displayName}\`.`);
112
- }
113
- });
114
- return error;
115
- }
116
- };
117
- DropTarget.propTypes = { ...marginPropTypes,
118
- children: PropTypes.node.isRequired,
119
- getOrder: PropTypes.func
75
+ DraggableContainer.propTypes = {
76
+ "children": PropTypes.node,
77
+ "getOrder": PropTypes.func,
78
+ "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
79
+ "__@toStringTag": PropTypes.string.isRequired,
80
+ "description": PropTypes.string,
81
+ "toString": PropTypes.func.isRequired,
82
+ "valueOf": PropTypes.func.isRequired
83
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
84
+ "__@toStringTag": PropTypes.string.isRequired,
85
+ "description": PropTypes.string,
86
+ "toString": PropTypes.func.isRequired,
87
+ "valueOf": PropTypes.func.isRequired
88
+ }), PropTypes.string]),
89
+ "margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
90
+ "__@toStringTag": PropTypes.string.isRequired,
91
+ "description": PropTypes.string,
92
+ "toString": PropTypes.func.isRequired,
93
+ "valueOf": PropTypes.func.isRequired
94
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
95
+ "__@toStringTag": PropTypes.string.isRequired,
96
+ "description": PropTypes.string,
97
+ "toString": PropTypes.func.isRequired,
98
+ "valueOf": PropTypes.func.isRequired
99
+ }), PropTypes.string]),
100
+ "marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
101
+ "__@toStringTag": PropTypes.string.isRequired,
102
+ "description": PropTypes.string,
103
+ "toString": PropTypes.func.isRequired,
104
+ "valueOf": PropTypes.func.isRequired
105
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
106
+ "__@toStringTag": PropTypes.string.isRequired,
107
+ "description": PropTypes.string,
108
+ "toString": PropTypes.func.isRequired,
109
+ "valueOf": PropTypes.func.isRequired
110
+ }), PropTypes.string]),
111
+ "marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
112
+ "__@toStringTag": PropTypes.string.isRequired,
113
+ "description": PropTypes.string,
114
+ "toString": PropTypes.func.isRequired,
115
+ "valueOf": PropTypes.func.isRequired
116
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
117
+ "__@toStringTag": PropTypes.string.isRequired,
118
+ "description": PropTypes.string,
119
+ "toString": PropTypes.func.isRequired,
120
+ "valueOf": PropTypes.func.isRequired
121
+ }), PropTypes.string]),
122
+ "marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
123
+ "__@toStringTag": PropTypes.string.isRequired,
124
+ "description": PropTypes.string,
125
+ "toString": PropTypes.func.isRequired,
126
+ "valueOf": PropTypes.func.isRequired
127
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
128
+ "__@toStringTag": PropTypes.string.isRequired,
129
+ "description": PropTypes.string,
130
+ "toString": PropTypes.func.isRequired,
131
+ "valueOf": PropTypes.func.isRequired
132
+ }), PropTypes.string]),
133
+ "marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
134
+ "__@toStringTag": PropTypes.string.isRequired,
135
+ "description": PropTypes.string,
136
+ "toString": PropTypes.func.isRequired,
137
+ "valueOf": PropTypes.func.isRequired
138
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
139
+ "__@toStringTag": PropTypes.string.isRequired,
140
+ "description": PropTypes.string,
141
+ "toString": PropTypes.func.isRequired,
142
+ "valueOf": PropTypes.func.isRequired
143
+ }), PropTypes.string]),
144
+ "marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
145
+ "__@toStringTag": PropTypes.string.isRequired,
146
+ "description": PropTypes.string,
147
+ "toString": PropTypes.func.isRequired,
148
+ "valueOf": PropTypes.func.isRequired
149
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
150
+ "__@toStringTag": PropTypes.string.isRequired,
151
+ "description": PropTypes.string,
152
+ "toString": PropTypes.func.isRequired,
153
+ "valueOf": PropTypes.func.isRequired
154
+ }), PropTypes.string]),
155
+ "marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
156
+ "__@toStringTag": PropTypes.string.isRequired,
157
+ "description": PropTypes.string,
158
+ "toString": PropTypes.func.isRequired,
159
+ "valueOf": PropTypes.func.isRequired
160
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
161
+ "__@toStringTag": PropTypes.string.isRequired,
162
+ "description": PropTypes.string,
163
+ "toString": PropTypes.func.isRequired,
164
+ "valueOf": PropTypes.func.isRequired
165
+ }), PropTypes.string]),
166
+ "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
167
+ "__@toStringTag": PropTypes.string.isRequired,
168
+ "description": PropTypes.string,
169
+ "toString": PropTypes.func.isRequired,
170
+ "valueOf": PropTypes.func.isRequired
171
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
172
+ "__@toStringTag": PropTypes.string.isRequired,
173
+ "description": PropTypes.string,
174
+ "toString": PropTypes.func.isRequired,
175
+ "valueOf": PropTypes.func.isRequired
176
+ }), PropTypes.string]),
177
+ "ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
178
+ "__@toStringTag": PropTypes.string.isRequired,
179
+ "description": PropTypes.string,
180
+ "toString": PropTypes.func.isRequired,
181
+ "valueOf": PropTypes.func.isRequired
182
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
183
+ "__@toStringTag": PropTypes.string.isRequired,
184
+ "description": PropTypes.string,
185
+ "toString": PropTypes.func.isRequired,
186
+ "valueOf": PropTypes.func.isRequired
187
+ }), PropTypes.string]),
188
+ "mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
189
+ "__@toStringTag": PropTypes.string.isRequired,
190
+ "description": PropTypes.string,
191
+ "toString": PropTypes.func.isRequired,
192
+ "valueOf": PropTypes.func.isRequired
193
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
194
+ "__@toStringTag": PropTypes.string.isRequired,
195
+ "description": PropTypes.string,
196
+ "toString": PropTypes.func.isRequired,
197
+ "valueOf": PropTypes.func.isRequired
198
+ }), PropTypes.string]),
199
+ "mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
200
+ "__@toStringTag": PropTypes.string.isRequired,
201
+ "description": PropTypes.string,
202
+ "toString": PropTypes.func.isRequired,
203
+ "valueOf": PropTypes.func.isRequired
204
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
205
+ "__@toStringTag": PropTypes.string.isRequired,
206
+ "description": PropTypes.string,
207
+ "toString": PropTypes.func.isRequired,
208
+ "valueOf": PropTypes.func.isRequired
209
+ }), PropTypes.string]),
210
+ "mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
211
+ "__@toStringTag": PropTypes.string.isRequired,
212
+ "description": PropTypes.string,
213
+ "toString": PropTypes.func.isRequired,
214
+ "valueOf": PropTypes.func.isRequired
215
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
216
+ "__@toStringTag": PropTypes.string.isRequired,
217
+ "description": PropTypes.string,
218
+ "toString": PropTypes.func.isRequired,
219
+ "valueOf": PropTypes.func.isRequired
220
+ }), PropTypes.string]),
221
+ "my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
222
+ "__@toStringTag": PropTypes.string.isRequired,
223
+ "description": PropTypes.string,
224
+ "toString": PropTypes.func.isRequired,
225
+ "valueOf": PropTypes.func.isRequired
226
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
227
+ "__@toStringTag": PropTypes.string.isRequired,
228
+ "description": PropTypes.string,
229
+ "toString": PropTypes.func.isRequired,
230
+ "valueOf": PropTypes.func.isRequired
231
+ }), PropTypes.string])
120
232
  };
233
+ DraggableContainer.displayName = "DraggableContainer";
121
234
  export default DraggableContainer;
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { PaddingProps } from "styled-system";
3
+ export interface DraggableItemProps extends PaddingProps {
4
+ /**
5
+ * The id of the `DraggableItem`.
6
+ *
7
+ * Use this prop to make `Draggable` work
8
+ */
9
+ id: number | string;
10
+ /** The content of the component. */
11
+ children: React.ReactNode;
12
+ /**
13
+ * @private
14
+ * @ignore
15
+ */
16
+ findItem?: (id: string | number) => {
17
+ DraggableItemProps: React.ReactElement;
18
+ index: number;
19
+ };
20
+ /**
21
+ * @private
22
+ * @ignore
23
+ */
24
+ moveItem?: (droppedId: string | number, overIndex: number | undefined) => void;
25
+ }
26
+ declare const DraggableItem: {
27
+ ({ id, findItem, moveItem, children, py, ...rest }: DraggableItemProps): JSX.Element;
28
+ displayName: string;
29
+ };
30
+ export default DraggableItem;