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,90 +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.InlineInputsContext = void 0;
|
|
8
7
|
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
12
|
var _label = _interopRequireDefault(require("../../__internal__/label"));
|
|
13
13
|
|
|
14
14
|
var _inlineInputs = _interopRequireWildcard(require("./inline-inputs.style"));
|
|
15
15
|
|
|
16
|
-
var _guid = _interopRequireDefault(
|
|
17
|
-
require("../../__internal__/utils/helpers/guid")
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) {
|
|
21
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache() {
|
|
25
|
-
if (typeof WeakMap !== "function") return null;
|
|
26
|
-
var cache = new WeakMap();
|
|
27
|
-
_getRequireWildcardCache = function () {
|
|
28
|
-
return cache;
|
|
29
|
-
};
|
|
30
|
-
return cache;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _interopRequireWildcard(obj) {
|
|
34
|
-
if (obj && obj.__esModule) {
|
|
35
|
-
return obj;
|
|
36
|
-
}
|
|
37
|
-
if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
|
|
38
|
-
return { default: obj };
|
|
39
|
-
}
|
|
40
|
-
var cache = _getRequireWildcardCache();
|
|
41
|
-
if (cache && cache.has(obj)) {
|
|
42
|
-
return cache.get(obj);
|
|
43
|
-
}
|
|
44
|
-
var newObj = {};
|
|
45
|
-
var hasPropertyDescriptor =
|
|
46
|
-
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
-
for (var key in obj) {
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
49
|
-
var desc = hasPropertyDescriptor
|
|
50
|
-
? Object.getOwnPropertyDescriptor(obj, key)
|
|
51
|
-
: null;
|
|
52
|
-
if (desc && (desc.get || desc.set)) {
|
|
53
|
-
Object.defineProperty(newObj, key, desc);
|
|
54
|
-
} else {
|
|
55
|
-
newObj[key] = obj[key];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
newObj.default = obj;
|
|
60
|
-
if (cache) {
|
|
61
|
-
cache.set(obj, newObj);
|
|
62
|
-
}
|
|
63
|
-
return newObj;
|
|
64
|
-
}
|
|
16
|
+
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
|
|
65
17
|
|
|
66
|
-
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
+
|
|
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
|
+
|
|
24
|
+
const InlineInputsContext = /*#__PURE__*/_react.default.createContext({});
|
|
67
25
|
|
|
68
26
|
exports.InlineInputsContext = InlineInputsContext;
|
|
69
27
|
|
|
70
28
|
const columnWrapper = (children, gutter, labelId) => {
|
|
71
|
-
return _react.default.Children.map(children,
|
|
72
|
-
return /*#__PURE__*/
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_inlineInputs.StyledInlineInput,
|
|
81
|
-
{
|
|
82
|
-
gutter: gutter,
|
|
83
|
-
"data-element": "inline-input",
|
|
84
|
-
},
|
|
85
|
-
input
|
|
86
|
-
)
|
|
87
|
-
);
|
|
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, {
|
|
35
|
+
gutter: gutter,
|
|
36
|
+
"data-element": "inline-input"
|
|
37
|
+
}, input));
|
|
88
38
|
});
|
|
89
39
|
};
|
|
90
40
|
|
|
@@ -95,84 +45,40 @@ const InlineInputs = ({
|
|
|
95
45
|
className = "",
|
|
96
46
|
gutter = "none",
|
|
97
47
|
inputWidth,
|
|
98
|
-
labelWidth
|
|
48
|
+
labelWidth
|
|
99
49
|
}) => {
|
|
100
50
|
const labelId = (0, _react.useRef)((0, _guid.default)());
|
|
101
51
|
|
|
102
52
|
function renderLabel() {
|
|
103
53
|
if (!label) return null;
|
|
104
|
-
return /*#__PURE__*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
htmlFor: htmlFor,
|
|
110
|
-
},
|
|
111
|
-
label
|
|
112
|
-
);
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_label.default, {
|
|
55
|
+
labelId: labelId.current,
|
|
56
|
+
inline: true,
|
|
57
|
+
htmlFor: htmlFor
|
|
58
|
+
}, label);
|
|
113
59
|
}
|
|
114
60
|
|
|
115
|
-
return /*#__PURE__*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
_inlineInputs.StyledContentContainer,
|
|
126
|
-
{
|
|
127
|
-
gutter: gutter,
|
|
128
|
-
"data-element": "inline-inputs-container",
|
|
129
|
-
inputWidth: inputWidth,
|
|
130
|
-
},
|
|
131
|
-
columnWrapper(children, gutter, label ? labelId.current : undefined)
|
|
132
|
-
)
|
|
133
|
-
);
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, {
|
|
62
|
+
gutter: gutter,
|
|
63
|
+
"data-component": "inline-inputs",
|
|
64
|
+
className: className,
|
|
65
|
+
labelWidth: labelWidth
|
|
66
|
+
}, renderLabel(), /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledContentContainer, {
|
|
67
|
+
gutter: gutter,
|
|
68
|
+
"data-element": "inline-inputs-container",
|
|
69
|
+
inputWidth: inputWidth
|
|
70
|
+
}, columnWrapper(children, gutter, label ? labelId.current : undefined)));
|
|
134
71
|
};
|
|
135
72
|
|
|
136
73
|
InlineInputs.propTypes = {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
className: _propTypes.default.string,
|
|
145
|
-
/**
|
|
146
|
-
* Gutter prop gets passed down to Row component if false gutter value is "none"
|
|
147
|
-
*/
|
|
148
|
-
gutter: _propTypes.default.oneOf([
|
|
149
|
-
"extra-large",
|
|
150
|
-
"extra-small",
|
|
151
|
-
"large",
|
|
152
|
-
"medium-large",
|
|
153
|
-
"medium-small",
|
|
154
|
-
"medium",
|
|
155
|
-
"none",
|
|
156
|
-
"small",
|
|
157
|
-
]),
|
|
158
|
-
/**
|
|
159
|
-
* The id of the corresponding input control for the label
|
|
160
|
-
*/
|
|
161
|
-
htmlFor: _propTypes.default.string,
|
|
162
|
-
/**
|
|
163
|
-
* Width of the inline inputs container in percentage
|
|
164
|
-
*/
|
|
165
|
-
inputWidth: _propTypes.default.number,
|
|
166
|
-
/**
|
|
167
|
-
* Defines the label text for the heading.
|
|
168
|
-
*/
|
|
169
|
-
label: _propTypes.default.string,
|
|
170
|
-
/**
|
|
171
|
-
* Width of a label in percentage
|
|
172
|
-
*/
|
|
173
|
-
labelWidth: _propTypes.default.number,
|
|
74
|
+
"children": _propTypes.default.node,
|
|
75
|
+
"className": _propTypes.default.string,
|
|
76
|
+
"gutter": _propTypes.default.oneOf(["extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "none", "small"]),
|
|
77
|
+
"htmlFor": _propTypes.default.string,
|
|
78
|
+
"inputWidth": _propTypes.default.number,
|
|
79
|
+
"label": _propTypes.default.string,
|
|
80
|
+
"labelWidth": _propTypes.default.number
|
|
174
81
|
};
|
|
175
|
-
|
|
176
82
|
InlineInputs.displayName = "InlineInputs";
|
|
177
83
|
var _default = InlineInputs;
|
|
178
|
-
exports.default = _default;
|
|
84
|
+
exports.default = _default;
|