carbon-react 106.2.2 → 106.3.2
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__/input/input-presentation.component.js +13 -0
- package/esm/__internal__/input/input.component.js +294 -0
- package/esm/__internal__/input-behaviour/input-behaviour.component.js +4 -0
- package/esm/__internal__/input-behaviour/input-group-behaviour.component.js +5 -0
- package/esm/__internal__/validation-message/validation-message.component.js +5 -0
- package/esm/__internal__/validations/validation-icon.component.js +41 -1
- package/esm/components/alert/alert.component.js +38 -252
- package/esm/components/alert/index.d.ts +1 -0
- package/esm/components/badge/badge.component.js +20 -60
- package/esm/components/button/button.component.js +760 -3310
- package/esm/components/carbon-provider/carbon-provider.component.js +48 -106
- package/esm/components/date/__internal__/utils.js +1 -1
- package/esm/components/date/date.component.js +3 -1
- package/esm/components/heading/heading.style.d.ts +2 -2
- package/esm/components/hr/hr.component.js +171 -1305
- package/esm/components/hr/index.d.ts +1 -0
- package/esm/components/inline-inputs/inline-inputs.component.js +35 -90
- package/esm/components/link/index.d.ts +1 -0
- package/esm/components/link/link.component.js +123 -1228
- package/esm/components/navigation-bar/index.d.ts +1 -0
- package/esm/components/navigation-bar/navigation-bar.component.js +1018 -10761
- package/esm/components/pager/pager.style.d.ts +1 -1
- package/esm/components/pod/pod.style.d.ts +1 -1
- package/esm/components/progress-tracker/progress-tracker.component.d.ts +4 -1
- package/esm/components/progress-tracker/progress-tracker.component.js +25 -2
- package/esm/components/progress-tracker/progress-tracker.config.d.ts +0 -1
- package/esm/components/progress-tracker/progress-tracker.config.js +1 -1
- package/esm/components/progress-tracker/progress-tracker.d.ts +5 -3
- package/esm/components/progress-tracker/progress-tracker.style.js +9 -7
- package/esm/components/radio-button/radio-button-svg.component.js +16 -29
- package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
- package/esm/components/tooltip/tooltip.component.js +85 -254
- package/esm/components/vertical-divider/index.d.ts +1 -0
- package/esm/components/vertical-divider/vertical-divider.component.d.ts +2 -2
- package/esm/components/vertical-divider/vertical-divider.component.js +328 -1406
- package/esm/components/vertical-divider/vertical-divider.style.d.ts +3 -3
- package/lib/__internal__/input/input-presentation.component.js +16 -0
- package/lib/__internal__/input/input.component.js +295 -0
- package/lib/__internal__/input-behaviour/input-behaviour.component.js +6 -1
- package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +7 -1
- package/lib/__internal__/validation-message/validation-message.component.js +6 -0
- package/lib/__internal__/validations/validation-icon.component.js +39 -0
- package/lib/components/alert/alert.component.js +42 -143
- package/lib/components/alert/index.d.ts +1 -0
- package/lib/components/badge/badge.component.js +24 -50
- package/lib/components/button/button.component.js +768 -3378
- package/lib/components/carbon-provider/carbon-provider.component.js +54 -110
- package/lib/components/date/__internal__/utils.js +1 -1
- package/lib/components/date/date.component.js +3 -1
- package/lib/components/heading/heading.style.d.ts +2 -2
- package/lib/components/hr/hr.component.js +175 -676
- package/lib/components/hr/index.d.ts +1 -0
- package/lib/components/inline-inputs/inline-inputs.component.js +43 -137
- package/lib/components/link/index.d.ts +1 -0
- package/lib/components/link/link.component.js +142 -746
- package/lib/components/navigation-bar/index.d.ts +1 -0
- package/lib/components/navigation-bar/navigation-bar.component.js +1022 -5426
- package/lib/components/pager/pager.style.d.ts +1 -1
- package/lib/components/pod/pod.style.d.ts +1 -1
- package/lib/components/progress-tracker/progress-tracker.component.d.ts +4 -1
- package/lib/components/progress-tracker/progress-tracker.component.js +30 -2
- package/lib/components/progress-tracker/progress-tracker.config.d.ts +0 -1
- package/lib/components/progress-tracker/progress-tracker.config.js +3 -3
- package/lib/components/progress-tracker/progress-tracker.d.ts +5 -3
- package/lib/components/progress-tracker/progress-tracker.style.js +8 -6
- package/lib/components/radio-button/radio-button-svg.component.js +20 -38
- package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
- package/lib/components/tooltip/tooltip.component.js +98 -215
- package/lib/components/vertical-divider/index.d.ts +1 -0
- package/lib/components/vertical-divider/vertical-divider.component.d.ts +2 -2
- package/lib/components/vertical-divider/vertical-divider.component.js +334 -1457
- package/lib/components/vertical-divider/vertical-divider.style.d.ts +3 -3
- package/package.json +4 -3
|
@@ -1,167 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
exports.default = exports.Alert = void 0;
|
|
8
7
|
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
13
13
|
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
16
|
-
}
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
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
|
-
}
|
|
16
|
+
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); }
|
|
34
17
|
|
|
35
|
-
const Alert = ({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
rest
|
|
45
|
-
),
|
|
46
|
-
children
|
|
47
|
-
);
|
|
18
|
+
const Alert = ({
|
|
19
|
+
children,
|
|
20
|
+
size = "extra-small",
|
|
21
|
+
...rest
|
|
22
|
+
}) => /*#__PURE__*/_react.default.createElement(_dialog.default, _extends({
|
|
23
|
+
"data-component": "alert",
|
|
24
|
+
role: "alertdialog",
|
|
25
|
+
size: size
|
|
26
|
+
}, rest), children);
|
|
48
27
|
|
|
28
|
+
exports.Alert = Alert;
|
|
49
29
|
Alert.propTypes = {
|
|
50
|
-
/**
|
|
51
|
-
* Prop to specify the aria-describedby property of the Dialog component
|
|
52
|
-
*/
|
|
53
30
|
"aria-describedby": _propTypes.default.string,
|
|
54
|
-
/**
|
|
55
|
-
* Prop to specify the aria-label of the Dialog component.
|
|
56
|
-
* To be used only when the title prop is not defined, and the component is not labelled by any internal element.
|
|
57
|
-
*/
|
|
58
31
|
"aria-label": _propTypes.default.string,
|
|
59
|
-
/**
|
|
60
|
-
* Prop to specify the aria-labelledby property of the Dialog component
|
|
61
|
-
* To be used when the title prop is a custom React Node,
|
|
62
|
-
* or the component is labelled by an internal element other than the title.
|
|
63
|
-
*/
|
|
64
32
|
"aria-labelledby": _propTypes.default.string,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
children: _propTypes.default.node,
|
|
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]),
|
|
33
|
+
"ariaRole": _propTypes.default.string,
|
|
34
|
+
"children": _propTypes.default.node,
|
|
35
|
+
"contentPadding": _propTypes.default.shape({
|
|
36
|
+
"p": _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
37
|
+
"px": _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
|
|
38
|
+
"py": _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8])
|
|
80
39
|
}),
|
|
81
|
-
disableAutoFocus: _propTypes.default.bool,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*/
|
|
89
|
-
disableEscKey: _propTypes.default.bool,
|
|
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
|
-
*/
|
|
98
|
-
focusFirstElement: _propTypes.default.shape({
|
|
99
|
-
current: function (props, propName) {
|
|
40
|
+
"disableAutoFocus": _propTypes.default.bool,
|
|
41
|
+
"disableClose": _propTypes.default.bool,
|
|
42
|
+
"disableEscKey": _propTypes.default.bool,
|
|
43
|
+
"disableFocusTrap": _propTypes.default.bool,
|
|
44
|
+
"enableBackgroundUI": _propTypes.default.bool,
|
|
45
|
+
"focusFirstElement": _propTypes.default.shape({
|
|
46
|
+
"current": function (props, propName) {
|
|
100
47
|
if (props[propName] == null) {
|
|
101
|
-
return new Error(
|
|
102
|
-
|
|
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
|
-
);
|
|
48
|
+
return new Error("Prop '" + propName + "' is required but wasn't specified");
|
|
49
|
+
} else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
50
|
+
return new Error("Expected prop '" + propName + "' to be of type Element");
|
|
111
51
|
}
|
|
112
|
-
}
|
|
52
|
+
}
|
|
113
53
|
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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,
|
|
54
|
+
"height": _propTypes.default.string,
|
|
55
|
+
"help": _propTypes.default.string,
|
|
56
|
+
"onCancel": _propTypes.default.func,
|
|
57
|
+
"open": _propTypes.default.bool.isRequired,
|
|
58
|
+
"role": _propTypes.default.string,
|
|
59
|
+
"showCloseIcon": _propTypes.default.bool,
|
|
60
|
+
"size": _propTypes.default.oneOf(["auto", "extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "small"]),
|
|
61
|
+
"subtitle": _propTypes.default.string,
|
|
62
|
+
"timeout": _propTypes.default.number,
|
|
63
|
+
"title": _propTypes.default.node
|
|
163
64
|
};
|
|
164
|
-
|
|
165
|
-
exports.Alert = Alert;
|
|
166
65
|
var _default = Alert;
|
|
167
|
-
exports.default = _default;
|
|
66
|
+
exports.default = _default;
|
|
@@ -1,66 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
exports.default = exports.Badge = void 0;
|
|
8
7
|
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _badge = require("./badge.style");
|
|
13
13
|
|
|
14
|
-
function _interopRequireDefault(obj) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"data-element": "badge-cross-icon",
|
|
32
|
-
type: "cross",
|
|
33
|
-
}),
|
|
34
|
-
/*#__PURE__*/ _react.default.createElement(
|
|
35
|
-
_badge.StyledCounter,
|
|
36
|
-
{
|
|
37
|
-
"data-element": "badge-counter",
|
|
38
|
-
},
|
|
39
|
-
counter > 99 ? 99 : counter
|
|
40
|
-
)
|
|
41
|
-
),
|
|
42
|
-
children
|
|
43
|
-
);
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
const Badge = ({
|
|
17
|
+
children,
|
|
18
|
+
counter = 0,
|
|
19
|
+
onClick
|
|
20
|
+
}) => {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_badge.StyledBadgeWrapper, null, counter > 0 && /*#__PURE__*/_react.default.createElement(_badge.StyledButton, {
|
|
22
|
+
"data-component": "badge",
|
|
23
|
+
buttonType: "secondary",
|
|
24
|
+
onClick: onClick
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_badge.StyledCrossIcon, {
|
|
26
|
+
"data-element": "badge-cross-icon",
|
|
27
|
+
type: "cross"
|
|
28
|
+
}), /*#__PURE__*/_react.default.createElement(_badge.StyledCounter, {
|
|
29
|
+
"data-element": "badge-counter"
|
|
30
|
+
}, counter > 99 ? 99 : counter)), children);
|
|
44
31
|
};
|
|
45
32
|
|
|
33
|
+
exports.Badge = Badge;
|
|
46
34
|
Badge.propTypes = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
children: _propTypes.default.node,
|
|
51
|
-
/**
|
|
52
|
-
* The number rendered in the badge component
|
|
53
|
-
*/
|
|
54
|
-
counter: _propTypes.default.oneOfType([
|
|
55
|
-
_propTypes.default.number,
|
|
56
|
-
_propTypes.default.string,
|
|
57
|
-
]),
|
|
58
|
-
/**
|
|
59
|
-
* Callback fired when badge is clicked
|
|
60
|
-
*/
|
|
61
|
-
onClick: _propTypes.default.func,
|
|
35
|
+
"children": _propTypes.default.node,
|
|
36
|
+
"counter": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
37
|
+
"onClick": _propTypes.default.func
|
|
62
38
|
};
|
|
63
|
-
|
|
64
|
-
exports.Badge = Badge;
|
|
65
39
|
var _default = Badge;
|
|
66
|
-
exports.default = _default;
|
|
40
|
+
exports.default = _default;
|