carbon-react 104.3.0 → 104.7.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/lib/components/confirm/confirm.component.d.ts +4 -1
- package/lib/components/confirm/confirm.component.js +32 -4
- package/lib/components/dialog/dialog.component.js +12 -9
- package/lib/components/dialog/dialog.style.js +4 -16
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +20 -9
- package/lib/components/dialog-full-screen/dialog-full-screen.style.js +2 -4
- package/lib/components/draggable/draggable-container.component.js +2 -2
- package/lib/components/draggable/draggable-item.component.js +1 -1
- package/lib/components/draggable/draggable-test.stories.js +66 -0
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +8 -8
- package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.d.ts +1 -0
- package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js +2 -1
- package/lib/components/sidebar/sidebar.style.js +2 -2
- package/lib/components/tile-select/tile-select.style.js +18 -49
- package/package.json +3 -3
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export default Confirm;
|
|
2
|
-
declare function Confirm({ open, children, destructive, cancelButtonDestructive, confirmButtonDestructive, cancelButtonType, confirmButtonType, cancelButtonIconType, cancelButtonIconPosition, confirmButtonIconType, confirmButtonIconPosition, cancelLabel, onCancel, disableCancel, onConfirm, isLoadingConfirm, disableConfirm, confirmLabel, iconType, subtitle, title, ...rest }: {
|
|
2
|
+
declare function Confirm({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, open, children, destructive, cancelButtonDestructive, confirmButtonDestructive, cancelButtonType, confirmButtonType, cancelButtonIconType, cancelButtonIconPosition, confirmButtonIconType, confirmButtonIconPosition, cancelLabel, onCancel, disableCancel, onConfirm, isLoadingConfirm, disableConfirm, confirmLabel, iconType, subtitle, title, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
|
+
"aria-labelledby": any;
|
|
5
|
+
"aria-describedby": any;
|
|
6
|
+
"aria-label": any;
|
|
4
7
|
open: any;
|
|
5
8
|
children: any;
|
|
6
9
|
destructive: any;
|
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid/guid.js"));
|
|
13
|
+
|
|
12
14
|
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
13
15
|
|
|
14
16
|
var _heading = _interopRequireDefault(require("../heading"));
|
|
@@ -27,11 +29,18 @@ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLoc
|
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
32
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
30
36
|
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); }
|
|
31
37
|
|
|
32
38
|
let deprecatedWarnTriggered = false;
|
|
33
39
|
|
|
34
40
|
const Confirm = ({
|
|
41
|
+
"aria-labelledby": ariaLabelledBy,
|
|
42
|
+
"aria-describedby": ariaDescribedBy,
|
|
43
|
+
"aria-label": ariaLabel,
|
|
35
44
|
open,
|
|
36
45
|
children,
|
|
37
46
|
destructive,
|
|
@@ -62,6 +71,25 @@ const Confirm = ({
|
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
const l = (0, _useLocale.default)();
|
|
74
|
+
const {
|
|
75
|
+
current: titleId
|
|
76
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
77
|
+
const {
|
|
78
|
+
current: subtitleId
|
|
79
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
80
|
+
const ariaProps = {
|
|
81
|
+
"aria-labelledby": ariaLabelledBy,
|
|
82
|
+
"aria-describedby": ariaDescribedBy,
|
|
83
|
+
"aria-label": ariaLabel
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
if (title && iconType) {
|
|
87
|
+
ariaProps["aria-labelledby"] = titleId;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (subtitle && iconType) {
|
|
91
|
+
ariaProps["aria-describedby"] = subtitleId;
|
|
92
|
+
}
|
|
65
93
|
|
|
66
94
|
const renderCancelButton = () => {
|
|
67
95
|
if (!onCancel) return null;
|
|
@@ -100,9 +128,9 @@ const Confirm = ({
|
|
|
100
128
|
fontSize: "medium"
|
|
101
129
|
}), /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
102
130
|
title: title,
|
|
103
|
-
titleId:
|
|
131
|
+
titleId: titleId,
|
|
104
132
|
subheader: subtitle,
|
|
105
|
-
subtitleId:
|
|
133
|
+
subtitleId: subtitleId,
|
|
106
134
|
divider: false
|
|
107
135
|
}));
|
|
108
136
|
}
|
|
@@ -118,7 +146,7 @@ const Confirm = ({
|
|
|
118
146
|
title: getTitle(),
|
|
119
147
|
"data-component": "confirm",
|
|
120
148
|
role: "alertdialog"
|
|
121
|
-
}, rest), children, /*#__PURE__*/_react.default.createElement(_confirm.StyledConfirmButtons, null, renderCancelButton(), renderConfirmButton()));
|
|
149
|
+
}, ariaProps, rest), children, /*#__PURE__*/_react.default.createElement(_confirm.StyledConfirmButtons, null, renderCancelButton(), renderConfirmButton()));
|
|
122
150
|
};
|
|
123
151
|
|
|
124
152
|
Confirm.defaultProps = {
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid/guid.js"));
|
|
13
|
+
|
|
12
14
|
var _modal = _interopRequireDefault(require("../modal"));
|
|
13
15
|
|
|
14
16
|
var _heading = _interopRequireDefault(require("../heading"));
|
|
@@ -58,6 +60,12 @@ const Dialog = ({
|
|
|
58
60
|
const innerContentRef = (0, _react.useRef)();
|
|
59
61
|
const titleRef = (0, _react.useRef)();
|
|
60
62
|
const listenersAdded = (0, _react.useRef)(false);
|
|
63
|
+
const {
|
|
64
|
+
current: titleId
|
|
65
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
66
|
+
const {
|
|
67
|
+
current: subtitleId
|
|
68
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
61
69
|
const centerDialog = (0, _react.useCallback)(() => {
|
|
62
70
|
const {
|
|
63
71
|
width: dialogWidth,
|
|
@@ -133,9 +141,9 @@ const Dialog = ({
|
|
|
133
141
|
}, typeof title === "string" ? /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
134
142
|
"data-element": "dialog-title",
|
|
135
143
|
title: title,
|
|
136
|
-
titleId:
|
|
144
|
+
titleId: titleId,
|
|
137
145
|
subheader: subtitle,
|
|
138
|
-
subtitleId:
|
|
146
|
+
subtitleId: subtitleId,
|
|
139
147
|
divider: false,
|
|
140
148
|
help: help
|
|
141
149
|
}) : title);
|
|
@@ -150,15 +158,10 @@ const Dialog = ({
|
|
|
150
158
|
const dialogProps = {
|
|
151
159
|
size,
|
|
152
160
|
dialogHeight,
|
|
153
|
-
"aria-labelledby": rest["aria-labelledby"],
|
|
154
|
-
"aria-describedby": subtitle ?
|
|
161
|
+
"aria-labelledby": title && typeof title === "string" ? titleId : rest["aria-labelledby"],
|
|
162
|
+
"aria-describedby": subtitle ? subtitleId : rest["aria-describedby"],
|
|
155
163
|
"aria-label": rest["aria-label"]
|
|
156
164
|
};
|
|
157
|
-
|
|
158
|
-
if (title && typeof title === "string") {
|
|
159
|
-
dialogProps["aria-labelledby"] = "carbon-dialog-title";
|
|
160
|
-
}
|
|
161
|
-
|
|
162
165
|
const componentTags = {
|
|
163
166
|
"data-component": rest["data-component"] || "dialog",
|
|
164
167
|
"data-element": rest["data-element"],
|
|
@@ -7,8 +7,6 @@ exports.DialogInnerContentStyle = exports.DialogContentStyle = exports.DialogTit
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
11
|
-
|
|
12
10
|
var _form = require("../form/form.style");
|
|
13
11
|
|
|
14
12
|
var _heading = require("../heading/heading.style");
|
|
@@ -34,10 +32,8 @@ const dialogSizes = {
|
|
|
34
32
|
const HORIZONTAL_PADDING = 35;
|
|
35
33
|
const CONTENT_BOTTOM_PADDING = 30;
|
|
36
34
|
const DialogStyle = _styledComponents.default.div`
|
|
37
|
-
background-color:
|
|
38
|
-
box-shadow:
|
|
39
|
-
theme
|
|
40
|
-
}) => theme.shadows.depth3};
|
|
35
|
+
background-color: var(--colorsUtilityMajor025);
|
|
36
|
+
box-shadow: var(--boxShadow300);
|
|
41
37
|
display: flex;
|
|
42
38
|
flex-direction: column;
|
|
43
39
|
position: fixed;
|
|
@@ -119,9 +115,7 @@ const DialogTitleStyle = _styledComponents.default.div`
|
|
|
119
115
|
margin-bottom: 20px;
|
|
120
116
|
|
|
121
117
|
${_heading.StyledHeadingTitle} {
|
|
122
|
-
color:
|
|
123
|
-
theme
|
|
124
|
-
}) => theme.text.color};
|
|
118
|
+
color: var(--colorsUtilityYin090);
|
|
125
119
|
display: block;
|
|
126
120
|
overflow: hidden;
|
|
127
121
|
text-overflow: ellipsis;
|
|
@@ -147,10 +141,4 @@ const DialogInnerContentStyle = _styledComponents.default.div`
|
|
|
147
141
|
position: relative;
|
|
148
142
|
flex: 1;
|
|
149
143
|
`;
|
|
150
|
-
exports.DialogInnerContentStyle = DialogInnerContentStyle;
|
|
151
|
-
DialogTitleStyle.defaultProps = {
|
|
152
|
-
theme: _base.default
|
|
153
|
-
};
|
|
154
|
-
DialogStyle.defaultProps = {
|
|
155
|
-
theme: _base.default
|
|
156
|
-
};
|
|
144
|
+
exports.DialogInnerContentStyle = DialogInnerContentStyle;
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid/guid.js"));
|
|
13
|
+
|
|
12
14
|
var _modal = _interopRequireDefault(require("../modal"));
|
|
13
15
|
|
|
14
16
|
var _heading = _interopRequireDefault(require("../heading"));
|
|
@@ -51,11 +53,17 @@ const DialogFullScreen = ({
|
|
|
51
53
|
onCancel,
|
|
52
54
|
contentRef,
|
|
53
55
|
help,
|
|
54
|
-
role = "
|
|
56
|
+
role = "dialog",
|
|
55
57
|
...rest
|
|
56
58
|
}) => {
|
|
57
59
|
const dialogRef = (0, _react.useRef)();
|
|
58
60
|
const headingRef = (0, _react.useRef)();
|
|
61
|
+
const {
|
|
62
|
+
current: titleId
|
|
63
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
64
|
+
const {
|
|
65
|
+
current: subtitleId
|
|
66
|
+
} = (0, _react.useRef)((0, _guid.default)());
|
|
59
67
|
|
|
60
68
|
const closeIcon = () => {
|
|
61
69
|
if (!showCloseIcon || !onCancel) return null;
|
|
@@ -74,13 +82,18 @@ const DialogFullScreen = ({
|
|
|
74
82
|
}, typeof title === "string" ? /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
75
83
|
"data-element": "dialog-title",
|
|
76
84
|
title: title,
|
|
77
|
-
titleId:
|
|
85
|
+
titleId: titleId,
|
|
78
86
|
subheader: subtitle,
|
|
79
|
-
subtitleId:
|
|
87
|
+
subtitleId: subtitleId,
|
|
80
88
|
divider: false,
|
|
81
89
|
help: help
|
|
82
90
|
}) : title, headerChildren);
|
|
83
91
|
|
|
92
|
+
const ariaProps = {
|
|
93
|
+
"aria-labelledby": title && typeof title === "string" ? titleId : ariaLabelledBy,
|
|
94
|
+
"aria-describedby": subtitle ? subtitleId : ariaDescribedBy,
|
|
95
|
+
"aria-label": ariaLabel
|
|
96
|
+
};
|
|
84
97
|
const componentTags = {
|
|
85
98
|
"data-component": "dialog-full-screen",
|
|
86
99
|
"data-element": rest["data-element"],
|
|
@@ -94,16 +107,14 @@ const DialogFullScreen = ({
|
|
|
94
107
|
autoFocus: !disableAutoFocus,
|
|
95
108
|
focusFirstElement: focusFirstElement,
|
|
96
109
|
wrapperRef: dialogRef
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement(_dialogFullScreen.default, {
|
|
98
|
-
"aria-modal": true
|
|
99
|
-
|
|
100
|
-
"aria-label": ariaLabel,
|
|
101
|
-
"aria-labelledby": ariaLabelledBy || "carbon-dialog-title",
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_dialogFullScreen.default, _extends({
|
|
111
|
+
"aria-modal": true
|
|
112
|
+
}, ariaProps, {
|
|
102
113
|
ref: dialogRef,
|
|
103
114
|
"data-element": "dialog-full-screen",
|
|
104
115
|
pagesStyling: pagesStyling,
|
|
105
116
|
role: role
|
|
106
|
-
}, dialogTitle(), /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
117
|
+
}), dialogTitle(), /*#__PURE__*/_react.default.createElement(_content.default, {
|
|
107
118
|
hasHeader: title !== undefined,
|
|
108
119
|
"data-element": "content",
|
|
109
120
|
ref: contentRef,
|
|
@@ -26,9 +26,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
26
26
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
28
|
const StyledDialogFullScreen = _styledComponents.default.div`
|
|
29
|
-
background-color:
|
|
30
|
-
theme
|
|
31
|
-
}) => theme.disabled.input};
|
|
29
|
+
background-color: var(--colorsUtilityMajor025);
|
|
32
30
|
height: 100%;
|
|
33
31
|
left: 0;
|
|
34
32
|
position: fixed;
|
|
@@ -36,7 +34,7 @@ const StyledDialogFullScreen = _styledComponents.default.div`
|
|
|
36
34
|
width: 100%;
|
|
37
35
|
z-index: ${({
|
|
38
36
|
theme
|
|
39
|
-
}) => theme.zIndex.fullScreenModal};
|
|
37
|
+
}) => theme.zIndex.fullScreenModal}; // TODO (tokens): implement elevation tokens - FE-4437
|
|
40
38
|
display: flex;
|
|
41
39
|
flex-direction: column;
|
|
42
40
|
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactDnd = require("react-dnd");
|
|
11
11
|
|
|
12
|
-
var _reactDndHtml5Backend =
|
|
12
|
+
var _reactDndHtml5Backend = require("react-dnd-html5-backend");
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
@@ -96,7 +96,7 @@ const DraggableContainer = ({
|
|
|
96
96
|
|
|
97
97
|
const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
|
|
98
98
|
return /*#__PURE__*/_react.default.createElement(_reactDnd.DndProvider, {
|
|
99
|
-
backend: _reactDndHtml5Backend.
|
|
99
|
+
backend: _reactDndHtml5Backend.HTML5Backend
|
|
100
100
|
}, /*#__PURE__*/_react.default.createElement(DropTarget, _extends({
|
|
101
101
|
getOrder: getItemsId
|
|
102
102
|
}, marginProps), draggableItems.map(item => /*#__PURE__*/_react.default.cloneElement(item, {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Default = exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _addonActions = require("@storybook/addon-actions");
|
|
11
|
+
|
|
12
|
+
var _draggableContainer = _interopRequireDefault(require("./draggable-container.component"));
|
|
13
|
+
|
|
14
|
+
var _draggableItem = _interopRequireDefault(require("./draggable-item.component"));
|
|
15
|
+
|
|
16
|
+
var _checkbox = require("../checkbox");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
var _default = {
|
|
21
|
+
title: "Draggable/Test",
|
|
22
|
+
parameters: {
|
|
23
|
+
info: {
|
|
24
|
+
disable: true
|
|
25
|
+
},
|
|
26
|
+
chromatic: {
|
|
27
|
+
disable: true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.default = _default;
|
|
32
|
+
|
|
33
|
+
const Default = () => {
|
|
34
|
+
const handleUpdate = items => {
|
|
35
|
+
(0, _addonActions.action)("onUpdate")(items);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_draggableContainer.default, {
|
|
39
|
+
getOrder: handleUpdate
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_draggableItem.default, {
|
|
41
|
+
key: "1",
|
|
42
|
+
id: 1
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
44
|
+
label: "Draggable Label One"
|
|
45
|
+
})), /*#__PURE__*/_react.default.createElement(_draggableItem.default, {
|
|
46
|
+
key: "2",
|
|
47
|
+
id: 2
|
|
48
|
+
}, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
49
|
+
label: "Draggable Label Two"
|
|
50
|
+
})), /*#__PURE__*/_react.default.createElement(_draggableItem.default, {
|
|
51
|
+
key: "3",
|
|
52
|
+
id: 3
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
54
|
+
label: "Draggable Label Three"
|
|
55
|
+
})), /*#__PURE__*/_react.default.createElement(_draggableItem.default, {
|
|
56
|
+
key: "4",
|
|
57
|
+
id: 4
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
59
|
+
label: "Draggable Label Four"
|
|
60
|
+
})));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.Default = Default;
|
|
64
|
+
Default.story = {
|
|
65
|
+
name: "default"
|
|
66
|
+
};
|
package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js
CHANGED
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactDnd = require("react-dnd");
|
|
11
11
|
|
|
12
|
-
var _reactDndHtml5Backend =
|
|
12
|
+
var _reactDndHtml5Backend = require("react-dnd-html5-backend");
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
@@ -45,6 +45,11 @@ const DropTarget = ({
|
|
|
45
45
|
}, rest), children);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
DropTarget.propTypes = {
|
|
49
|
+
children: _propTypes.default.node.isRequired,
|
|
50
|
+
getOrder: _propTypes.default.func
|
|
51
|
+
};
|
|
52
|
+
|
|
48
53
|
const FlatTableBodyDraggable = ({
|
|
49
54
|
children,
|
|
50
55
|
getOrder
|
|
@@ -88,15 +93,14 @@ const FlatTableBodyDraggable = ({
|
|
|
88
93
|
};
|
|
89
94
|
|
|
90
95
|
return /*#__PURE__*/_react.default.createElement(_reactDnd.DndProvider, {
|
|
91
|
-
backend: _reactDndHtml5Backend.
|
|
96
|
+
backend: _reactDndHtml5Backend.HTML5Backend
|
|
92
97
|
}, /*#__PURE__*/_react.default.createElement(DropTarget, {
|
|
93
98
|
getOrder: getItemsId
|
|
94
99
|
}, draggableItems.map(item => /*#__PURE__*/_react.default.cloneElement(item, {
|
|
95
100
|
id: `${item.props.id}`,
|
|
96
101
|
moveItem,
|
|
97
102
|
findItem,
|
|
98
|
-
draggable: true
|
|
99
|
-
key: `${item.props.id}`
|
|
103
|
+
draggable: true
|
|
100
104
|
}, [/*#__PURE__*/_react.default.createElement(_flatTableCell.default, {
|
|
101
105
|
key: item.props.id
|
|
102
106
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -108,9 +112,5 @@ FlatTableBodyDraggable.propTypes = {
|
|
|
108
112
|
getOrder: _propTypes.default.func,
|
|
109
113
|
children: _propTypes.default.node.isRequired
|
|
110
114
|
};
|
|
111
|
-
DropTarget.propTypes = {
|
|
112
|
-
children: _propTypes.default.node.isRequired,
|
|
113
|
-
getOrder: _propTypes.default.func
|
|
114
|
-
};
|
|
115
115
|
var _default = FlatTableBodyDraggable;
|
|
116
116
|
exports.default = _default;
|
|
@@ -5,6 +5,7 @@ declare function FlatTableRowDraggable({ children, id, findItem, moveItem }: {
|
|
|
5
5
|
findItem: any;
|
|
6
6
|
moveItem: any;
|
|
7
7
|
}): React.DetailedReactHTMLElement<{
|
|
8
|
+
key: any;
|
|
8
9
|
id: any;
|
|
9
10
|
isDragging: boolean;
|
|
10
11
|
ref: (node: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js
CHANGED
|
@@ -23,8 +23,8 @@ const FlatTableRowDraggable = ({
|
|
|
23
23
|
const [{
|
|
24
24
|
isDragging
|
|
25
25
|
}, drag] = (0, _reactDnd.useDrag)({
|
|
26
|
+
type: "flatTableRow",
|
|
26
27
|
item: {
|
|
27
|
-
type: "flatTableRow",
|
|
28
28
|
id,
|
|
29
29
|
originalIndex
|
|
30
30
|
},
|
|
@@ -60,6 +60,7 @@ const FlatTableRowDraggable = ({
|
|
|
60
60
|
|
|
61
61
|
});
|
|
62
62
|
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
63
|
+
key: originalIndex,
|
|
63
64
|
id,
|
|
64
65
|
isDragging,
|
|
65
66
|
ref: node => drag(drop(node))
|
|
@@ -26,7 +26,7 @@ const SidebarStyle = _styledComponents.default.div`
|
|
|
26
26
|
size,
|
|
27
27
|
theme
|
|
28
28
|
}) => (0, _styledComponents.css)`
|
|
29
|
-
background
|
|
29
|
+
background: var(--colorsUtilityMajor025);
|
|
30
30
|
border-radius: 1px;
|
|
31
31
|
bottom: 0;
|
|
32
32
|
position: fixed;
|
|
@@ -40,7 +40,7 @@ const SidebarStyle = _styledComponents.default.div`
|
|
|
40
40
|
`}
|
|
41
41
|
|
|
42
42
|
${position && (0, _styledComponents.css)`
|
|
43
|
-
box-shadow:
|
|
43
|
+
box-shadow: var(--boxShadow300);
|
|
44
44
|
${position}: 0;
|
|
45
45
|
`}
|
|
46
46
|
|
|
@@ -13,8 +13,6 @@ var _fieldset = _interopRequireDefault(require("../fieldset"));
|
|
|
13
13
|
|
|
14
14
|
var _input = require("../../__internal__/input");
|
|
15
15
|
|
|
16
|
-
var _tint = _interopRequireDefault(require("../../style/utils/tint"));
|
|
17
|
-
|
|
18
16
|
var _fieldset2 = require("../fieldset/fieldset.style");
|
|
19
17
|
|
|
20
18
|
var _icon = _interopRequireDefault(require("../icon/icon.style"));
|
|
@@ -33,6 +31,7 @@ const StyledTitle = _styledComponents.default.h3`
|
|
|
33
31
|
margin: 0;
|
|
34
32
|
margin-right: 16px;
|
|
35
33
|
margin-bottom: 8px;
|
|
34
|
+
color: var(--colorsActionMinorYin090);
|
|
36
35
|
`;
|
|
37
36
|
exports.StyledTitle = StyledTitle;
|
|
38
37
|
const StyledSubtitle = _styledComponents.default.h4`
|
|
@@ -41,6 +40,7 @@ const StyledSubtitle = _styledComponents.default.h4`
|
|
|
41
40
|
margin: 0;
|
|
42
41
|
margin-right: 16px;
|
|
43
42
|
margin-bottom: 8px;
|
|
43
|
+
color: var(--colorsActionMinorYin090);
|
|
44
44
|
`;
|
|
45
45
|
exports.StyledSubtitle = StyledSubtitle;
|
|
46
46
|
const StyledAdornment = _styledComponents.default.div`
|
|
@@ -51,36 +51,28 @@ const StyledAdornment = _styledComponents.default.div`
|
|
|
51
51
|
`;
|
|
52
52
|
exports.StyledAdornment = StyledAdornment;
|
|
53
53
|
const StyledDescription = _styledComponents.default.p`
|
|
54
|
-
color:
|
|
55
|
-
theme
|
|
56
|
-
}) => theme.tileSelect.descriptionColor};
|
|
54
|
+
color: var(--colorsActionMinorYin055);
|
|
57
55
|
font-size: 14px;
|
|
58
56
|
margin: 0;
|
|
59
57
|
`;
|
|
60
58
|
exports.StyledDescription = StyledDescription;
|
|
61
59
|
const StyledTileSelect = _styledComponents.default.div`
|
|
62
|
-
background
|
|
63
|
-
theme
|
|
64
|
-
}) => theme.colors.white};
|
|
60
|
+
background: var(--colorsActionMinorYang100);
|
|
65
61
|
padding: 24px;
|
|
66
62
|
${({
|
|
67
|
-
checked
|
|
68
|
-
theme
|
|
63
|
+
checked
|
|
69
64
|
}) => checked && (0, _styledComponents.css)`
|
|
70
|
-
background:
|
|
65
|
+
background: var(--colorsActionMajor025);
|
|
71
66
|
`}
|
|
72
67
|
|
|
73
68
|
${({
|
|
74
|
-
disabled
|
|
75
|
-
theme
|
|
69
|
+
disabled
|
|
76
70
|
}) => disabled && (0, _styledComponents.css)`
|
|
77
|
-
background:
|
|
71
|
+
background: var(--colorsActionMinorYang100);
|
|
78
72
|
${StyledTitle}, ${StyledSubtitle}, ${StyledDescription} {
|
|
79
|
-
color:
|
|
73
|
+
color: var(--colorsActionMinorYin030);
|
|
80
74
|
}
|
|
81
75
|
${StyledAdornment} * {
|
|
82
|
-
color: ${theme.colors.black};
|
|
83
|
-
fill: ${theme.colors.black};
|
|
84
76
|
opacity: 0.3;
|
|
85
77
|
}
|
|
86
78
|
`}
|
|
@@ -89,18 +81,17 @@ exports.StyledTileSelect = StyledTileSelect;
|
|
|
89
81
|
const StyledFocusWrapper = _styledComponents.default.div`
|
|
90
82
|
${({
|
|
91
83
|
checked,
|
|
92
|
-
theme,
|
|
93
84
|
hasFocus
|
|
94
85
|
}) => (0, _styledComponents.css)`
|
|
95
86
|
position: relative;
|
|
96
|
-
border: 1px solid
|
|
87
|
+
border: 1px solid var(--colorsActionMinor250);
|
|
97
88
|
${checked && (0, _styledComponents.css)`
|
|
98
|
-
border-color:
|
|
89
|
+
border-color: var(--colorsActionMajor500);
|
|
99
90
|
z-index: 10;
|
|
100
91
|
`}
|
|
101
92
|
|
|
102
93
|
${hasFocus && (0, _styledComponents.css)`
|
|
103
|
-
outline: 3px solid
|
|
94
|
+
outline: 3px solid var(--colorsSemanticFocus500);
|
|
104
95
|
z-index: 15;
|
|
105
96
|
`}
|
|
106
97
|
`}
|
|
@@ -116,11 +107,10 @@ const StyledTileSelectContainer = _styledComponents.default.div`
|
|
|
116
107
|
}
|
|
117
108
|
${({
|
|
118
109
|
checked,
|
|
119
|
-
disabled
|
|
120
|
-
theme
|
|
110
|
+
disabled
|
|
121
111
|
}) => !checked && !disabled && (0, _styledComponents.css)`
|
|
122
112
|
&:hover ${StyledTileSelect} {
|
|
123
|
-
background:
|
|
113
|
+
background: var(--colorsActionMinor050);
|
|
124
114
|
}
|
|
125
115
|
`}
|
|
126
116
|
`;
|
|
@@ -171,8 +161,7 @@ const StyledTitleContainer = _styledComponents.default.div`
|
|
|
171
161
|
exports.StyledTitleContainer = StyledTitleContainer;
|
|
172
162
|
const StyledDeselectWrapper = _styledComponents.default.div`
|
|
173
163
|
${({
|
|
174
|
-
hasActionAdornment
|
|
175
|
-
theme
|
|
164
|
+
hasActionAdornment
|
|
176
165
|
}) => (0, _styledComponents.css)`
|
|
177
166
|
z-index: 200;
|
|
178
167
|
position: relative;
|
|
@@ -181,10 +170,10 @@ const StyledDeselectWrapper = _styledComponents.default.div`
|
|
|
181
170
|
height: fit-content;
|
|
182
171
|
|
|
183
172
|
${hasActionAdornment && `
|
|
184
|
-
margin-right:
|
|
173
|
+
margin-right: var(--sizing200);
|
|
185
174
|
display: flex;
|
|
186
175
|
align-items: baseline;
|
|
187
|
-
min-height:
|
|
176
|
+
min-height: var(--sizing400);
|
|
188
177
|
|
|
189
178
|
${_icon.default} {
|
|
190
179
|
top: 2px;
|
|
@@ -214,9 +203,7 @@ const StyledTileSelectFieldset = (0, _styledComponents.default)(_fieldset.defaul
|
|
|
214
203
|
`;
|
|
215
204
|
exports.StyledTileSelectFieldset = StyledTileSelectFieldset;
|
|
216
205
|
const StyledGroupDescription = _styledComponents.default.p`
|
|
217
|
-
color:
|
|
218
|
-
theme
|
|
219
|
-
}) => theme.tileSelect.descriptionColor};
|
|
206
|
+
color: var(--colorsActionMinorYin055);
|
|
220
207
|
margin: 0;
|
|
221
208
|
margin-bottom: 16px;
|
|
222
209
|
`;
|
|
@@ -224,24 +211,6 @@ exports.StyledGroupDescription = StyledGroupDescription;
|
|
|
224
211
|
StyledTileSelectFieldset.defaultProps = {
|
|
225
212
|
theme: _themes.baseTheme
|
|
226
213
|
};
|
|
227
|
-
StyledTileSelect.defaultProps = {
|
|
228
|
-
theme: _themes.baseTheme
|
|
229
|
-
};
|
|
230
214
|
StyledTileSelectContainer.defaultProps = {
|
|
231
215
|
theme: _themes.baseTheme
|
|
232
|
-
};
|
|
233
|
-
StyledGroupDescription.defaultProps = {
|
|
234
|
-
theme: _themes.baseTheme
|
|
235
|
-
};
|
|
236
|
-
StyledTileSelectInput.defaultProps = {
|
|
237
|
-
theme: _themes.baseTheme
|
|
238
|
-
};
|
|
239
|
-
StyledDescription.defaultProps = {
|
|
240
|
-
theme: _themes.baseTheme
|
|
241
|
-
};
|
|
242
|
-
StyledDeselectWrapper.defaultProps = {
|
|
243
|
-
theme: _themes.baseTheme
|
|
244
|
-
};
|
|
245
|
-
StyledFocusWrapper.defaultProps = {
|
|
246
|
-
theme: _themes.baseTheme
|
|
247
216
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "104.
|
|
3
|
+
"version": "104.7.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
"polished": "^4.0.5",
|
|
172
172
|
"prop-types": "^15.7.2",
|
|
173
173
|
"react-day-picker": "~7.4.10",
|
|
174
|
-
"react-dnd": "^
|
|
175
|
-
"react-dnd-html5-backend": "^
|
|
174
|
+
"react-dnd": "^14.0.5",
|
|
175
|
+
"react-dnd-html5-backend": "^14.1.0",
|
|
176
176
|
"react-is": "^17.0.2",
|
|
177
177
|
"react-transition-group": "^4.4.1",
|
|
178
178
|
"styled-system": "^5.1.5",
|