carbon-react 104.58.3 → 104.58.6
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/esm/__internal__/checkable-input/hidden-checkable-input.component.js +5 -2
- package/esm/__internal__/input/input.component.js +1 -0
- package/esm/__internal__/input-behaviour/input-behaviour.component.js +8 -2
- package/esm/components/alert/alert.component.d.ts +3 -49
- package/esm/components/alert/alert.component.js +244 -46
- package/esm/components/alert/index.d.ts +1 -1
- package/esm/components/carousel/carousel.component.js +1 -13
- package/esm/components/carousel/carousel.style.js +11 -2
- package/esm/components/carousel/slide/slide.component.js +1 -3
- package/esm/components/carousel/slide/slide.style.js +7 -14
- package/esm/components/checkbox/checkbox-group.component.d.ts +2 -0
- package/esm/components/checkbox/checkbox-group.component.js +9 -7
- package/esm/components/checkbox/checkbox.component.js +15 -7
- package/esm/components/dialog/dialog.component.js +1 -10
- package/esm/components/form/form.component.d.ts +1 -2
- package/esm/components/form/form.component.js +0 -10
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +2 -0
- package/esm/components/inline-inputs/inline-inputs.component.js +11 -23
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +7 -1
- package/esm/components/step-sequence/step-sequence.component.d.ts +2 -0
- package/esm/components/step-sequence/step-sequence.component.js +7 -4
- package/esm/components/textarea/textarea.component.js +7 -3
- package/esm/components/textarea/textarea.style.d.ts +1 -0
- package/esm/components/textarea/textarea.style.js +2 -1
- package/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +2 -0
- package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +18 -2
- package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.js +30 -5
- package/esm/style/themes/aegean/aegean-theme.config.d.ts +2 -1
- package/esm/style/themes/aegean/aegean-theme.config.js +2 -1
- package/esm/style/themes/mint/mint-theme.config.d.ts +2 -1
- package/esm/style/themes/mint/mint-theme.config.js +2 -1
- package/lib/__internal__/checkable-input/hidden-checkable-input.component.js +5 -2
- package/lib/__internal__/input/input.component.js +1 -0
- package/lib/__internal__/input-behaviour/input-behaviour.component.js +13 -2
- package/lib/components/alert/alert.component.d.ts +3 -49
- package/lib/components/alert/alert.component.js +139 -54
- package/lib/components/alert/index.d.ts +1 -1
- package/lib/components/carousel/carousel.component.js +1 -14
- package/lib/components/carousel/carousel.style.js +12 -2
- package/lib/components/carousel/slide/slide.component.js +1 -3
- package/lib/components/carousel/slide/slide.style.js +7 -14
- package/lib/components/checkbox/checkbox-group.component.d.ts +2 -0
- package/lib/components/checkbox/checkbox-group.component.js +13 -8
- package/lib/components/checkbox/checkbox.component.js +20 -7
- package/lib/components/dialog/dialog.component.js +1 -11
- package/lib/components/form/form.component.d.ts +1 -2
- package/lib/components/form/form.component.js +0 -10
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +2 -0
- package/lib/components/inline-inputs/inline-inputs.component.js +12 -21
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +13 -2
- package/lib/components/step-sequence/step-sequence.component.d.ts +2 -0
- package/lib/components/step-sequence/step-sequence.component.js +11 -6
- package/lib/components/textarea/textarea.component.js +7 -3
- package/lib/components/textarea/textarea.style.d.ts +1 -0
- package/lib/components/textarea/textarea.style.js +4 -2
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +2 -0
- package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +18 -2
- package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.js +29 -4
- package/lib/style/themes/aegean/aegean-theme.config.d.ts +2 -1
- package/lib/style/themes/aegean/aegean-theme.config.js +2 -1
- package/lib/style/themes/mint/mint-theme.config.d.ts +2 -1
- package/lib/style/themes/mint/mint-theme.config.js +2 -1
- package/package.json +1 -1
- package/esm/components/alert/alert.d.ts +0 -5
- package/lib/components/alert/alert.d.ts +0 -5
|
@@ -1,82 +1,167 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
exports.default = exports.Alert = void 0;
|
|
9
8
|
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
13
13
|
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _extends() {
|
|
19
|
+
_extends =
|
|
20
|
+
Object.assign ||
|
|
21
|
+
function (target) {
|
|
22
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
23
|
+
var source = arguments[i];
|
|
24
|
+
for (var key in source) {
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
26
|
+
target[key] = source[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
return _extends.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const Alert = ({ children, size = "extra-small", ...rest }) =>
|
|
36
|
+
/*#__PURE__*/ _react.default.createElement(
|
|
37
|
+
_dialog.default,
|
|
38
|
+
_extends(
|
|
39
|
+
{
|
|
40
|
+
"data-component": "alert",
|
|
41
|
+
role: "alertdialog",
|
|
42
|
+
size: size,
|
|
43
|
+
},
|
|
44
|
+
rest
|
|
45
|
+
),
|
|
46
|
+
children
|
|
47
|
+
);
|
|
25
48
|
|
|
26
49
|
Alert.propTypes = {
|
|
27
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Prop to specify the aria-describedby property of the Dialog component
|
|
52
|
+
*/
|
|
28
53
|
"aria-describedby": _propTypes.default.string,
|
|
29
|
-
|
|
30
54
|
/**
|
|
31
|
-
* Prop to specify the aria-label of the component.
|
|
55
|
+
* Prop to specify the aria-label of the Dialog component.
|
|
32
56
|
* To be used only when the title prop is not defined, and the component is not labelled by any internal element.
|
|
33
57
|
*/
|
|
34
58
|
"aria-label": _propTypes.default.string,
|
|
35
|
-
|
|
36
59
|
/**
|
|
37
|
-
* Prop to specify the aria-
|
|
60
|
+
* Prop to specify the aria-labelledby property of the Dialog component
|
|
38
61
|
* To be used when the title prop is a custom React Node,
|
|
39
62
|
* or the component is labelled by an internal element other than the title.
|
|
40
63
|
*/
|
|
41
64
|
"aria-labelledby": _propTypes.default.string,
|
|
42
|
-
|
|
43
|
-
|
|
65
|
+
/**
|
|
66
|
+
* The ARIA role to be applied to the modal
|
|
67
|
+
*/
|
|
68
|
+
ariaRole: _propTypes.default.string,
|
|
69
|
+
/**
|
|
70
|
+
* Modal content
|
|
71
|
+
*/
|
|
44
72
|
children: _propTypes.default.node,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Padding to be set on the Dialog content
|
|
75
|
+
*/
|
|
76
|
+
contentPadding: _propTypes.default.shape({
|
|
77
|
+
p: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
78
|
+
px: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
79
|
+
py: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
80
|
+
}),
|
|
81
|
+
disableAutoFocus: _propTypes.default.bool,
|
|
82
|
+
/**
|
|
83
|
+
* Determines if the Dialog can be closed
|
|
84
|
+
*/
|
|
85
|
+
disableClose: _propTypes.default.bool,
|
|
86
|
+
/**
|
|
87
|
+
* Determines if the Esc Key closes the modal
|
|
88
|
+
*/
|
|
53
89
|
disableEscKey: _propTypes.default.bool,
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
subtitle: _propTypes.default.string,
|
|
63
|
-
|
|
64
|
-
/** Size of Alert */
|
|
65
|
-
size: _propTypes.default.oneOf(["auto", "extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"]),
|
|
66
|
-
|
|
67
|
-
/** Determines if the close icon is shown */
|
|
68
|
-
showCloseIcon: _propTypes.default.bool,
|
|
69
|
-
|
|
70
|
-
/** Optional reference to an element meant to be focused on open */
|
|
90
|
+
disableFocusTrap: _propTypes.default.bool,
|
|
91
|
+
/**
|
|
92
|
+
* Determines if the background is disabled when the modal is open
|
|
93
|
+
*/
|
|
94
|
+
enableBackgroundUI: _propTypes.default.bool,
|
|
95
|
+
/**
|
|
96
|
+
* Optional reference to an element meant to be focused on open
|
|
97
|
+
*/
|
|
71
98
|
focusFirstElement: _propTypes.default.shape({
|
|
72
|
-
current:
|
|
99
|
+
current: function (props, propName) {
|
|
100
|
+
if (props[propName] == null) {
|
|
101
|
+
return new Error(
|
|
102
|
+
"Prop '" + propName + "' is required but wasn't specified"
|
|
103
|
+
);
|
|
104
|
+
} else if (
|
|
105
|
+
typeof props[propName] !== "object" ||
|
|
106
|
+
props[propName].nodeType !== 1
|
|
107
|
+
) {
|
|
108
|
+
return new Error(
|
|
109
|
+
"Expected prop '" + propName + "' to be of type Element"
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
73
113
|
}),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Allows developers to specify a specific height for the dialog.
|
|
116
|
+
*/
|
|
117
|
+
height: _propTypes.default.string,
|
|
118
|
+
/**
|
|
119
|
+
* Adds Help tooltip to Header
|
|
120
|
+
*/
|
|
121
|
+
help: _propTypes.default.string,
|
|
122
|
+
/**
|
|
123
|
+
* A custom close event handler
|
|
124
|
+
*/
|
|
125
|
+
onCancel: _propTypes.default.func,
|
|
126
|
+
/**
|
|
127
|
+
* Sets the open state of the modal
|
|
128
|
+
*/
|
|
129
|
+
open: _propTypes.default.bool.isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The ARIA role to be applied to the Dialog container
|
|
132
|
+
*/
|
|
133
|
+
role: _propTypes.default.string,
|
|
134
|
+
/**
|
|
135
|
+
* Determines if the close icon is shown
|
|
136
|
+
*/
|
|
137
|
+
showCloseIcon: _propTypes.default.bool,
|
|
138
|
+
/**
|
|
139
|
+
* Size of dialog, default size is 750px
|
|
140
|
+
*/
|
|
141
|
+
size: _propTypes.default.oneOf([
|
|
142
|
+
"auto",
|
|
143
|
+
"extra-large",
|
|
144
|
+
"extra-small",
|
|
145
|
+
"large",
|
|
146
|
+
"medium-large",
|
|
147
|
+
"medium-small",
|
|
148
|
+
"medium",
|
|
149
|
+
"small",
|
|
150
|
+
]),
|
|
151
|
+
/**
|
|
152
|
+
* Subtitle displayed at top of dialog
|
|
153
|
+
*/
|
|
154
|
+
subtitle: _propTypes.default.string,
|
|
155
|
+
/**
|
|
156
|
+
* Transition time
|
|
157
|
+
*/
|
|
158
|
+
timeout: _propTypes.default.number,
|
|
159
|
+
/**
|
|
160
|
+
* Title displayed at top of dialog
|
|
161
|
+
*/
|
|
162
|
+
title: _propTypes.default.node,
|
|
80
163
|
};
|
|
164
|
+
|
|
165
|
+
exports.Alert = Alert;
|
|
81
166
|
var _default = Alert;
|
|
82
|
-
exports.default = _default;
|
|
167
|
+
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./alert";
|
|
1
|
+
export { default } from "./alert.component";
|
|
@@ -97,19 +97,6 @@ const BaseCarousel = ({
|
|
|
97
97
|
handleSlideChange(newSlideSelection);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
function visibleSlides() {
|
|
101
|
-
const arrayWithKeys = _react.default.Children.map(children, (element, key) => {
|
|
102
|
-
return /*#__PURE__*/_react.default.cloneElement(element, {
|
|
103
|
-
key: `slide-${(0, _guid.default)()}`,
|
|
104
|
-
id: key,
|
|
105
|
-
selectedIndex: selectedSlideIndex,
|
|
106
|
-
...element.props
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
return arrayWithKeys;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
100
|
function slideSelector() {
|
|
114
101
|
if (!enableSlideSelector) return null;
|
|
115
102
|
const buttons = [];
|
|
@@ -170,7 +157,7 @@ const BaseCarousel = ({
|
|
|
170
157
|
className: "carbon-carousel__content"
|
|
171
158
|
}, previousButton(), /*#__PURE__*/_react.default.createElement(_carousel.CarouselSliderWrapper, {
|
|
172
159
|
elementIndex: selectedSlideIndex
|
|
173
|
-
},
|
|
160
|
+
}, children), nextButton()), slideSelector());
|
|
174
161
|
};
|
|
175
162
|
|
|
176
163
|
BaseCarousel.propTypes = {
|
|
@@ -11,6 +11,8 @@ var _icon = _interopRequireDefault(require("../icon"));
|
|
|
11
11
|
|
|
12
12
|
var _slide = require("./slide.config");
|
|
13
13
|
|
|
14
|
+
var _slide2 = require("./slide/slide.style");
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -144,9 +146,17 @@ const CarouselSliderWrapper = _styledComponents.default.div`
|
|
|
144
146
|
transition: 0.4s;
|
|
145
147
|
display: flex;
|
|
146
148
|
position: relative;
|
|
147
|
-
|
|
149
|
+
|
|
150
|
+
${({
|
|
148
151
|
elementIndex
|
|
149
|
-
}) =>
|
|
152
|
+
}) => (0, _styledComponents.css)`
|
|
153
|
+
left: ${10 - 80 * elementIndex}%;
|
|
154
|
+
|
|
155
|
+
${_slide2.SlideStyle}:nth-of-type(${elementIndex + 1}) {
|
|
156
|
+
transform: scale(1);
|
|
157
|
+
opacity: 1;
|
|
158
|
+
}
|
|
159
|
+
`}
|
|
150
160
|
`;
|
|
151
161
|
exports.CarouselSliderWrapper = CarouselSliderWrapper;
|
|
152
162
|
const CarouselWrapperStyle = _styledComponents.default.div`
|
|
@@ -17,9 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
|
|
18
18
|
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); }
|
|
19
19
|
|
|
20
|
-
const Slide = props => {
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_slide.SlideStyle, _extends({}, props, (0, _tags.default)("slide", props)));
|
|
22
|
-
};
|
|
20
|
+
const Slide = props => /*#__PURE__*/_react.default.createElement(_slide.SlideStyle, _extends({}, props, (0, _tags.default)("slide", props)));
|
|
23
21
|
|
|
24
22
|
Slide.defaultProps = {
|
|
25
23
|
theme: _base.default
|
|
@@ -13,9 +13,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
13
13
|
|
|
14
14
|
const SlideStyle = _styledComponents.default.div`
|
|
15
15
|
${({
|
|
16
|
-
onClick
|
|
17
|
-
id,
|
|
18
|
-
selectedIndex
|
|
16
|
+
onClick
|
|
19
17
|
}) => (0, _styledComponents.css)`
|
|
20
18
|
box-sizing: border-box;
|
|
21
19
|
display: inline-block;
|
|
@@ -30,17 +28,12 @@ const SlideStyle = _styledComponents.default.div`
|
|
|
30
28
|
box-shadow: var(--boxShadow200);
|
|
31
29
|
background-color: var(--colorsUtilityYang100);
|
|
32
30
|
|
|
33
|
-
${
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
transition: all 0.2s ease-in;
|
|
40
|
-
transform: scale(1.02);
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
}
|
|
43
|
-
`}
|
|
31
|
+
${onClick && (0, _styledComponents.css)`
|
|
32
|
+
:hover {
|
|
33
|
+
transition: all 0.2s ease-in;
|
|
34
|
+
transform: scale(1.02);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
44
37
|
`}
|
|
45
38
|
`}
|
|
46
39
|
`; // eslint-disable-next-line import/prefer-default-export
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.CheckboxGroupContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -27,6 +27,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
27
27
|
|
|
28
28
|
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
29
29
|
|
|
30
|
+
const CheckboxGroupContext = /*#__PURE__*/_react.default.createContext({});
|
|
31
|
+
|
|
32
|
+
exports.CheckboxGroupContext = CheckboxGroupContext;
|
|
33
|
+
|
|
30
34
|
const CheckboxGroup = props => {
|
|
31
35
|
const {
|
|
32
36
|
children,
|
|
@@ -59,13 +63,14 @@ const CheckboxGroup = props => {
|
|
|
59
63
|
}, (0, _utils.filterStyledSystemMarginProps)(props)), /*#__PURE__*/_react.default.createElement(_checkbox.StyledCheckboxGroup, {
|
|
60
64
|
"data-component": "checkbox-group",
|
|
61
65
|
legendInline: legendInline
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(CheckboxGroupContext.Provider, {
|
|
67
|
+
value: {
|
|
68
|
+
inputName: groupName,
|
|
69
|
+
error: !!error,
|
|
70
|
+
warning: !!warning,
|
|
71
|
+
info: !!info
|
|
72
|
+
}
|
|
73
|
+
}, children))));
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
CheckboxGroup.propTypes = {
|
|
@@ -5,7 +5,7 @@ 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
|
|
|
@@ -23,8 +23,14 @@ var _utils = require("../../style/utils");
|
|
|
23
23
|
|
|
24
24
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
25
25
|
|
|
26
|
+
var _checkboxGroup = require("./checkbox-group.component");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
30
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
28
34
|
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); }
|
|
29
35
|
|
|
30
36
|
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
@@ -65,6 +71,12 @@ const Checkbox = ({
|
|
|
65
71
|
}) => {
|
|
66
72
|
const largeScreen = (0, _useIsAboveBreakpoint.default)(adaptiveSpacingBreakpoint);
|
|
67
73
|
const adaptiveSpacingSmallScreen = !!(adaptiveSpacingBreakpoint && !largeScreen);
|
|
74
|
+
const {
|
|
75
|
+
error: contextError,
|
|
76
|
+
warning: contextWarning,
|
|
77
|
+
info: contextInfo,
|
|
78
|
+
inputName
|
|
79
|
+
} = (0, _react.useContext)(_checkboxGroup.CheckboxGroupContext);
|
|
68
80
|
const inputProps = {
|
|
69
81
|
onClick,
|
|
70
82
|
onChange,
|
|
@@ -82,15 +94,16 @@ const Checkbox = ({
|
|
|
82
94
|
labelHelp,
|
|
83
95
|
labelSpacing,
|
|
84
96
|
required,
|
|
85
|
-
error,
|
|
86
|
-
warning,
|
|
87
|
-
info,
|
|
97
|
+
error: contextError || error,
|
|
98
|
+
warning: contextWarning || warning,
|
|
99
|
+
info: contextInfo || info,
|
|
88
100
|
fieldHelpInline,
|
|
89
101
|
checked,
|
|
90
102
|
disabled,
|
|
91
103
|
inputWidth,
|
|
92
104
|
labelWidth,
|
|
93
105
|
tooltipPosition,
|
|
106
|
+
inputName,
|
|
94
107
|
...props
|
|
95
108
|
};
|
|
96
109
|
return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
@@ -104,9 +117,9 @@ const Checkbox = ({
|
|
|
104
117
|
labelSpacing: labelSpacing,
|
|
105
118
|
inputWidth: inputWidth,
|
|
106
119
|
adaptiveSpacingSmallScreen: adaptiveSpacingSmallScreen,
|
|
107
|
-
error: error,
|
|
108
|
-
warning: warning,
|
|
109
|
-
info: info,
|
|
120
|
+
error: contextError || error,
|
|
121
|
+
warning: contextWarning || warning,
|
|
122
|
+
info: contextInfo || info,
|
|
110
123
|
fieldHelpInline: fieldHelpInline,
|
|
111
124
|
reverse: reverse,
|
|
112
125
|
size: size
|
|
@@ -25,8 +25,6 @@ var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
|
25
25
|
|
|
26
26
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
27
27
|
|
|
28
|
-
var _form = _interopRequireDefault(require("../form"));
|
|
29
|
-
|
|
30
28
|
var _dialog2 = require("./dialog.config");
|
|
31
29
|
|
|
32
30
|
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
@@ -193,15 +191,7 @@ const Dialog = ({
|
|
|
193
191
|
role: role
|
|
194
192
|
}, contentPadding), dialogTitle(), /*#__PURE__*/_react.default.createElement(_dialog.DialogContentStyle, contentPadding, /*#__PURE__*/_react.default.createElement(_dialog.DialogInnerContentStyle, _extends({
|
|
195
193
|
ref: innerContentRef
|
|
196
|
-
}, contentPadding),
|
|
197
|
-
if ((child === null || child === void 0 ? void 0 : child.type) === _form.default) {
|
|
198
|
-
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
199
|
-
dialogRef
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return child;
|
|
204
|
-
}))), closeIcon())));
|
|
194
|
+
}, contentPadding), children)), closeIcon())));
|
|
205
195
|
};
|
|
206
196
|
|
|
207
197
|
Dialog.propTypes = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Form;
|
|
2
|
-
declare function Form({ children, saveButton, leftSideButtons, rightSideButtons, errorCount, warningCount, onSubmit, buttonAlignment, stickyFooter,
|
|
2
|
+
declare function Form({ children, saveButton, leftSideButtons, rightSideButtons, errorCount, warningCount, onSubmit, buttonAlignment, stickyFooter, fieldSpacing, noValidate, height, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
children: any;
|
|
5
5
|
saveButton: any;
|
|
@@ -10,7 +10,6 @@ declare function Form({ children, saveButton, leftSideButtons, rightSideButtons,
|
|
|
10
10
|
onSubmit: any;
|
|
11
11
|
buttonAlignment?: string | undefined;
|
|
12
12
|
stickyFooter: any;
|
|
13
|
-
dialogRef: any;
|
|
14
13
|
fieldSpacing?: number | undefined;
|
|
15
14
|
noValidate?: boolean | undefined;
|
|
16
15
|
height: any;
|
|
@@ -35,7 +35,6 @@ const Form = ({
|
|
|
35
35
|
onSubmit,
|
|
36
36
|
buttonAlignment = "right",
|
|
37
37
|
stickyFooter,
|
|
38
|
-
dialogRef,
|
|
39
38
|
fieldSpacing = 3,
|
|
40
39
|
noValidate = true,
|
|
41
40
|
height,
|
|
@@ -110,15 +109,6 @@ Form.propTypes = { ..._propTypes2.default.space,
|
|
|
110
109
|
/** Disable HTML5 validation */
|
|
111
110
|
noValidate: _propTypes.default.bool,
|
|
112
111
|
|
|
113
|
-
/**
|
|
114
|
-
* @private
|
|
115
|
-
* @ignore
|
|
116
|
-
* Used to detect if FormFooter should be sticky when used in Dialog component
|
|
117
|
-
*/
|
|
118
|
-
dialogRef: _propTypes.default.shape({
|
|
119
|
-
current: _propTypes.default.any
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
112
|
/** Height of the form (any valid CSS value) */
|
|
123
113
|
height: _propTypes.default.string
|
|
124
114
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.InlineInputsContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -21,22 +21,20 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
let inputs = children;
|
|
24
|
+
const InlineInputsContext = /*#__PURE__*/_react.default.createContext({});
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
inputs = [children];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return inputs.map((input, index) => {
|
|
32
|
-
// Input is never going to be re-ordered so we don't require a defined key
|
|
26
|
+
exports.InlineInputsContext = InlineInputsContext;
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
const columnWrapper = (children, gutter, labelId) => {
|
|
29
|
+
return _react.default.Children.map(children, input => {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(InlineInputsContext.Provider, {
|
|
31
|
+
value: {
|
|
32
|
+
ariaLabelledBy: labelId
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledInlineInput, {
|
|
37
35
|
gutter: gutter,
|
|
38
36
|
"data-element": "inline-input"
|
|
39
|
-
}, input);
|
|
37
|
+
}, input));
|
|
40
38
|
});
|
|
41
39
|
};
|
|
42
40
|
|
|
@@ -61,13 +59,6 @@ const InlineInputs = props => {
|
|
|
61
59
|
}, label);
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
function renderChildren() {
|
|
65
|
-
if (!label) return children;
|
|
66
|
-
return _react.default.Children.map(children, child => /*#__PURE__*/_react.default.cloneElement(child, {
|
|
67
|
-
"aria-labelledby": labelId.current
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
62
|
return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, {
|
|
72
63
|
gutter: gutter,
|
|
73
64
|
"data-component": "inline-inputs",
|
|
@@ -77,7 +68,7 @@ const InlineInputs = props => {
|
|
|
77
68
|
gutter: gutter,
|
|
78
69
|
"data-element": "inline-inputs-container",
|
|
79
70
|
inputWidth: inputWidth
|
|
80
|
-
}, columnWrapper(
|
|
71
|
+
}, columnWrapper(children, gutter, label ? labelId.current : undefined)));
|
|
81
72
|
}; // Assign props over for demo site
|
|
82
73
|
|
|
83
74
|
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _stepSequenceItem = _interopRequireDefault(require("./step-sequence-item.style"));
|
|
13
13
|
|
|
@@ -19,11 +19,21 @@ var _stepSequenceItemHiddenLabel = _interopRequireDefault(require("./step-sequen
|
|
|
19
19
|
|
|
20
20
|
var _icon = _interopRequireDefault(require("../../icon"));
|
|
21
21
|
|
|
22
|
+
var _stepSequence = require("../step-sequence.component");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
26
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
24
30
|
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); }
|
|
25
31
|
|
|
26
32
|
const StepSequenceItem = props => {
|
|
33
|
+
const {
|
|
34
|
+
orientation
|
|
35
|
+
} = (0, _react.useContext)(_stepSequence.StepSequenceContext);
|
|
36
|
+
|
|
27
37
|
const indicatorText = () => {
|
|
28
38
|
return !props.hideIndicator ? /*#__PURE__*/_react.default.createElement(_stepSequenceItemIndicator.default, null, props.indicator) : null;
|
|
29
39
|
};
|
|
@@ -53,6 +63,7 @@ const StepSequenceItem = props => {
|
|
|
53
63
|
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.default, _extends({
|
|
54
64
|
"data-component": "step-sequence-item"
|
|
55
65
|
}, props, {
|
|
66
|
+
orientation: orientation,
|
|
56
67
|
key: `step-seq-item-${props.indicator}`
|
|
57
68
|
}), hiddenLabel(), /*#__PURE__*/_react.default.createElement(_stepSequenceItemContent.default, null, icon(), /*#__PURE__*/_react.default.createElement("span", null, props.children)));
|
|
58
69
|
};
|