carbon-react 96.0.0 → 98.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.
- package/lib/components/multi-action-button/multi-action-button.component.js +2 -2
- package/lib/components/multi-action-button/multi-action-button.config.js +1 -1
- package/lib/components/multi-action-button/multi-action-button.d.ts +4 -1
- package/lib/components/textarea/textarea-test.stories.js +153 -0
- package/lib/components/textarea/textarea.component.js +144 -215
- package/lib/components/textarea/textarea.d.ts +1 -1
- package/lib/components/toast/toast.component.js +90 -156
- package/package.json +4 -4
|
@@ -212,8 +212,8 @@ const MultiActionButton = ({
|
|
|
212
212
|
|
|
213
213
|
MultiActionButton.propTypes = { ...marginPropTypes,
|
|
214
214
|
|
|
215
|
-
/** Button type: "primary" | "secondary"
|
|
216
|
-
buttonType: _propTypes.default.oneOf(["primary", "secondary"]),
|
|
215
|
+
/** Button type: "primary" | "secondary" | "tertiary" */
|
|
216
|
+
buttonType: _propTypes.default.oneOf(["primary", "secondary", "tertiary"]),
|
|
217
217
|
|
|
218
218
|
/** The additional button to display. */
|
|
219
219
|
children: _propTypes.default.node.isRequired,
|
|
@@ -8,5 +8,5 @@ const MULTI_ACTION_BUTTON_ALIGNMENTS = ["left", "right"];
|
|
|
8
8
|
exports.MULTI_ACTION_BUTTON_ALIGNMENTS = MULTI_ACTION_BUTTON_ALIGNMENTS;
|
|
9
9
|
const MULTI_ACTION_BUTTON_SIZES = ["small", "medium", "large"];
|
|
10
10
|
exports.MULTI_ACTION_BUTTON_SIZES = MULTI_ACTION_BUTTON_SIZES;
|
|
11
|
-
const MULTI_ACTION_BUTTON_THEMES = ["primary", "secondary"];
|
|
11
|
+
const MULTI_ACTION_BUTTON_THEMES = ["primary", "secondary", "tertiary"];
|
|
12
12
|
exports.MULTI_ACTION_BUTTON_THEMES = MULTI_ACTION_BUTTON_THEMES;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import SplitButton from "../split-button";
|
|
2
2
|
|
|
3
|
-
declare class MultiActionButton extends SplitButton {
|
|
3
|
+
declare class MultiActionButton extends SplitButton {
|
|
4
|
+
/** Button type: "primary" | "secondary" | "tertiary" */
|
|
5
|
+
buttonType?: "primary" | "secondary" | "tertiary";
|
|
6
|
+
}
|
|
4
7
|
|
|
5
8
|
export default MultiActionButton;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Default = exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _specialCharacters = _interopRequireWildcard(require("../../../.storybook/utils/argTypes/specialCharacters"));
|
|
11
|
+
|
|
12
|
+
var _ = _interopRequireDefault(require("."));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
var _default = {
|
|
23
|
+
component: _.default,
|
|
24
|
+
title: "Textarea/Test",
|
|
25
|
+
parameters: {
|
|
26
|
+
info: {
|
|
27
|
+
disable: true
|
|
28
|
+
},
|
|
29
|
+
chromatic: {
|
|
30
|
+
disable: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
argTypes: {
|
|
34
|
+
labelAlign: {
|
|
35
|
+
options: ["left", "right"],
|
|
36
|
+
control: {
|
|
37
|
+
type: "select"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
cols: {
|
|
41
|
+
control: {
|
|
42
|
+
min: 0,
|
|
43
|
+
max: 100,
|
|
44
|
+
step: 1,
|
|
45
|
+
type: "range"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
rows: {
|
|
49
|
+
control: {
|
|
50
|
+
min: 0,
|
|
51
|
+
max: 100,
|
|
52
|
+
step: 1,
|
|
53
|
+
type: "range"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
inputWidth: {
|
|
57
|
+
control: {
|
|
58
|
+
min: 0,
|
|
59
|
+
max: 100,
|
|
60
|
+
step: 1,
|
|
61
|
+
type: "range"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
labelWidth: {
|
|
65
|
+
control: {
|
|
66
|
+
min: 0,
|
|
67
|
+
max: 100,
|
|
68
|
+
step: 1,
|
|
69
|
+
type: "range"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
adaptiveLabelBreakpoint: {
|
|
73
|
+
control: {
|
|
74
|
+
type: "number"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
placeholderSpecialCharacters: _specialCharacters.default,
|
|
78
|
+
labelSpecialCharacters: _specialCharacters.default,
|
|
79
|
+
labelHelpSpecialCharacters: _specialCharacters.default,
|
|
80
|
+
characterLimitSpecialCharacters: {
|
|
81
|
+
options: [..._specialCharacters.default.options, ..._specialCharacters.number.options],
|
|
82
|
+
mapping: { ..._specialCharacters.default.mapping,
|
|
83
|
+
..._specialCharacters.number.mapping
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
fieldHelpSpecialCharacters: _specialCharacters.default
|
|
87
|
+
},
|
|
88
|
+
args: {
|
|
89
|
+
expandable: false,
|
|
90
|
+
cols: 0,
|
|
91
|
+
rows: 0,
|
|
92
|
+
disabled: false,
|
|
93
|
+
autoFocus: false,
|
|
94
|
+
readOnly: false,
|
|
95
|
+
placeholder: "",
|
|
96
|
+
fieldHelp: "",
|
|
97
|
+
characterLimit: "",
|
|
98
|
+
inputWidth: 100,
|
|
99
|
+
warnOverLimit: false,
|
|
100
|
+
enforceCharacterLimit: true,
|
|
101
|
+
label: "",
|
|
102
|
+
labelHelp: "",
|
|
103
|
+
labelInline: false,
|
|
104
|
+
labelWidth: 30,
|
|
105
|
+
labelAlign: undefined,
|
|
106
|
+
adaptiveLabelBreakpoint: undefined,
|
|
107
|
+
required: false,
|
|
108
|
+
placeholderSpecialCharacters: undefined,
|
|
109
|
+
labelSpecialCharacters: undefined,
|
|
110
|
+
labelHelpSpecialCharacters: undefined,
|
|
111
|
+
characterLimitSpecialCharacters: undefined,
|
|
112
|
+
fieldHelpSpecialCharacters: undefined
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
exports.default = _default;
|
|
116
|
+
|
|
117
|
+
const Default = ({
|
|
118
|
+
placeholder,
|
|
119
|
+
placeholderSpecialCharacters,
|
|
120
|
+
label,
|
|
121
|
+
labelSpecialCharacters,
|
|
122
|
+
labelHelp,
|
|
123
|
+
labelHelpSpecialCharacters,
|
|
124
|
+
characterLimit,
|
|
125
|
+
characterLimitSpecialCharacters,
|
|
126
|
+
fieldHelp,
|
|
127
|
+
fieldHelpSpecialCharacters,
|
|
128
|
+
...args
|
|
129
|
+
}) => {
|
|
130
|
+
const [state, setState] = (0, _react.useState)("");
|
|
131
|
+
|
|
132
|
+
const handleChange = ({
|
|
133
|
+
target: {
|
|
134
|
+
value
|
|
135
|
+
}
|
|
136
|
+
}) => {
|
|
137
|
+
setState(value);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({}, args, {
|
|
141
|
+
name: "textarea",
|
|
142
|
+
onChange: handleChange,
|
|
143
|
+
value: state,
|
|
144
|
+
placeholder: placeholder || placeholderSpecialCharacters,
|
|
145
|
+
label: label || labelSpecialCharacters,
|
|
146
|
+
labelHelp: labelHelp || labelHelpSpecialCharacters,
|
|
147
|
+
helpAriaLabel: labelHelp || labelHelpSpecialCharacters,
|
|
148
|
+
characterLimit: characterLimit || characterLimitSpecialCharacters,
|
|
149
|
+
fieldHelp: fieldHelp || fieldHelpSpecialCharacters
|
|
150
|
+
}));
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
exports.Default = Default;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.OriginalTextarea = 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
|
|
|
@@ -35,229 +35,167 @@ var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
|
35
35
|
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
37
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
|
-
|
|
42
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
43
|
-
|
|
44
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
|
-
|
|
46
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
47
|
-
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
53
|
-
|
|
54
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
38
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
55
39
|
|
|
56
|
-
function
|
|
40
|
+
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; }
|
|
57
41
|
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
42
|
+
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); }
|
|
61
43
|
|
|
62
44
|
const getFormatNumber = (value, locale) => new Intl.NumberFormat(locale).format(value);
|
|
63
45
|
|
|
64
46
|
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
65
47
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
48
|
+
const Textarea = ({
|
|
49
|
+
autoFocus,
|
|
50
|
+
fieldHelp,
|
|
51
|
+
label,
|
|
52
|
+
size,
|
|
53
|
+
children,
|
|
54
|
+
characterLimit,
|
|
55
|
+
enforceCharacterLimit = true,
|
|
56
|
+
warnOverLimit = false,
|
|
57
|
+
onChange,
|
|
58
|
+
disabled = false,
|
|
59
|
+
labelInline,
|
|
60
|
+
labelAlign,
|
|
61
|
+
labelHelp,
|
|
62
|
+
labelSpacing,
|
|
63
|
+
inputIcon,
|
|
64
|
+
id: idProp,
|
|
65
|
+
error,
|
|
66
|
+
warning,
|
|
67
|
+
info,
|
|
68
|
+
name,
|
|
69
|
+
readOnly = false,
|
|
70
|
+
placeholder,
|
|
71
|
+
expandable = false,
|
|
72
|
+
rows,
|
|
73
|
+
cols,
|
|
74
|
+
validationOnLabel = false,
|
|
75
|
+
adaptiveLabelBreakpoint,
|
|
76
|
+
inputWidth,
|
|
77
|
+
labelWidth = 30,
|
|
78
|
+
tooltipPosition,
|
|
79
|
+
value,
|
|
80
|
+
"data-component": dataComponent,
|
|
81
|
+
"data-element": dataElement,
|
|
82
|
+
"data-role": dataRole,
|
|
83
|
+
helpAriaLabel,
|
|
84
|
+
...props
|
|
85
|
+
}) => {
|
|
86
|
+
const locale = (0, _react.useContext)(_i18nContext.default);
|
|
87
|
+
const {
|
|
88
|
+
current: id
|
|
89
|
+
} = (0, _react.useRef)(idProp || (0, _guid.default)());
|
|
90
|
+
const inputRef = (0, _react.useRef)();
|
|
91
|
+
const minHeight = (0, _react.useRef)(0);
|
|
92
|
+
|
|
93
|
+
const expandTextarea = () => {
|
|
94
|
+
const textarea = inputRef.current;
|
|
95
|
+
|
|
96
|
+
if (textarea.scrollHeight > minHeight.current) {
|
|
97
|
+
// Reset height to zero - IE specific
|
|
98
|
+
textarea.style.height = "0px"; // Set the height so all content is shown
|
|
99
|
+
|
|
100
|
+
textarea.style.height = `${Math.max(textarea.scrollHeight, minHeight.current)}px`;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
94
103
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_createClass(Textarea, [{
|
|
99
|
-
key: "componentDidMount",
|
|
100
|
-
value:
|
|
101
|
-
/**
|
|
102
|
-
* A lifecycle method that is called after initial render.
|
|
103
|
-
* Allows access to refs and DOM to set expandable variables
|
|
104
|
-
*/
|
|
105
|
-
function componentDidMount() {
|
|
106
|
-
if (this.props.expandable) {
|
|
107
|
-
window.addEventListener("resize", this.expandTextarea); // Set the min height to the initially rendered height.
|
|
108
|
-
// Without minHeight expandable textareas will only have
|
|
109
|
-
// one line when no content is present.
|
|
110
|
-
|
|
111
|
-
this.minHeight = this._input.current.clientHeight;
|
|
112
|
-
this.expandTextarea();
|
|
113
|
-
}
|
|
104
|
+
(0, _react.useEffect)(() => {
|
|
105
|
+
if (expandable) {
|
|
106
|
+
expandTextarea();
|
|
114
107
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
108
|
+
});
|
|
109
|
+
(0, _react.useEffect)(() => {
|
|
110
|
+
if (expandable) {
|
|
111
|
+
window.addEventListener("resize", expandTextarea);
|
|
112
|
+
minHeight.current = inputRef.current.clientHeight;
|
|
121
113
|
}
|
|
122
|
-
}, {
|
|
123
|
-
key: "componentDidUpdate",
|
|
124
|
-
value: function componentDidUpdate() {
|
|
125
|
-
const {
|
|
126
|
-
expandable
|
|
127
|
-
} = this.props;
|
|
128
114
|
|
|
115
|
+
return () => {
|
|
129
116
|
if (expandable) {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}, {
|
|
134
|
-
key: "overLimit",
|
|
135
|
-
get: function () {
|
|
136
|
-
const value = this.props.value || "";
|
|
137
|
-
return value.length > parseInt(this.props.characterLimit, 10);
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
key: "characterCount",
|
|
141
|
-
get: function () {
|
|
142
|
-
const value = this.props.value || "";
|
|
143
|
-
const {
|
|
144
|
-
characterLimit,
|
|
145
|
-
warnOverLimit
|
|
146
|
-
} = this.props;
|
|
147
|
-
|
|
148
|
-
if (!characterLimit) {
|
|
149
|
-
return null;
|
|
117
|
+
window.removeEventListener("resize", expandTextarea);
|
|
150
118
|
}
|
|
119
|
+
};
|
|
120
|
+
}, [expandable]);
|
|
151
121
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}, {
|
|
160
|
-
key: "render",
|
|
161
|
-
value: function render() {
|
|
162
|
-
const {
|
|
163
|
-
autoFocus,
|
|
164
|
-
fieldHelp,
|
|
165
|
-
label,
|
|
166
|
-
size,
|
|
167
|
-
children,
|
|
168
|
-
characterLimit,
|
|
169
|
-
enforceCharacterLimit,
|
|
170
|
-
onChange,
|
|
171
|
-
disabled,
|
|
172
|
-
labelInline,
|
|
173
|
-
labelAlign,
|
|
174
|
-
labelHelp,
|
|
175
|
-
labelSpacing,
|
|
176
|
-
inputIcon,
|
|
177
|
-
error,
|
|
178
|
-
warning,
|
|
179
|
-
info,
|
|
180
|
-
name,
|
|
181
|
-
readOnly,
|
|
182
|
-
placeholder,
|
|
183
|
-
rows,
|
|
184
|
-
cols,
|
|
185
|
-
validationOnLabel,
|
|
186
|
-
adaptiveLabelBreakpoint,
|
|
187
|
-
inputWidth,
|
|
188
|
-
labelWidth,
|
|
189
|
-
tooltipPosition,
|
|
190
|
-
"data-component": dataComponent,
|
|
191
|
-
"data-element": dataElement,
|
|
192
|
-
"data-role": dataRole,
|
|
193
|
-
helpAriaLabel,
|
|
194
|
-
...props
|
|
195
|
-
} = this.props;
|
|
196
|
-
return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
197
|
-
helpAriaLabel: helpAriaLabel,
|
|
198
|
-
tooltipPosition: tooltipPosition
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement(_inputBehaviour.InputBehaviour, null, /*#__PURE__*/_react.default.createElement(_textarea.default, _extends({
|
|
200
|
-
labelInline: labelInline,
|
|
201
|
-
"data-component": dataComponent,
|
|
202
|
-
"data-role": dataRole,
|
|
203
|
-
"data-element": dataElement
|
|
204
|
-
}, (0, _utils.filterStyledSystemMarginProps)(props)), /*#__PURE__*/_react.default.createElement(_formField.default, {
|
|
205
|
-
fieldHelp: fieldHelp,
|
|
206
|
-
error: error,
|
|
207
|
-
warning: warning,
|
|
208
|
-
info: info,
|
|
209
|
-
label: label,
|
|
210
|
-
disabled: disabled,
|
|
211
|
-
id: this.id,
|
|
212
|
-
labelInline: labelInline,
|
|
213
|
-
labelAlign: labelAlign,
|
|
214
|
-
labelWidth: labelWidth,
|
|
215
|
-
labelHelp: labelHelp,
|
|
216
|
-
labelSpacing: labelSpacing,
|
|
217
|
-
isRequired: props.required,
|
|
218
|
-
useValidationIcon: validationOnLabel,
|
|
219
|
-
adaptiveLabelBreakpoint: adaptiveLabelBreakpoint
|
|
220
|
-
}, /*#__PURE__*/_react.default.createElement(_input.InputPresentation, {
|
|
221
|
-
size: size,
|
|
222
|
-
disabled: disabled,
|
|
223
|
-
readOnly: readOnly,
|
|
224
|
-
inputWidth: typeof inputWidth === "number" ? inputWidth : 100 - labelWidth,
|
|
225
|
-
error: error,
|
|
226
|
-
warning: warning,
|
|
227
|
-
info: info
|
|
228
|
-
}, /*#__PURE__*/_react.default.createElement(_input2.default, _extends({
|
|
229
|
-
autoFocus: autoFocus,
|
|
230
|
-
name: name,
|
|
231
|
-
"aria-invalid": !!error,
|
|
232
|
-
ref: this._input,
|
|
233
|
-
maxLength: enforceCharacterLimit && characterLimit ? characterLimit : undefined,
|
|
234
|
-
onChange: onChange,
|
|
235
|
-
disabled: disabled,
|
|
236
|
-
readOnly: readOnly,
|
|
237
|
-
labelInline: labelInline,
|
|
238
|
-
placeholder: disabled ? "" : placeholder,
|
|
239
|
-
rows: rows,
|
|
240
|
-
cols: cols,
|
|
241
|
-
id: this.id,
|
|
242
|
-
as: "textarea"
|
|
243
|
-
}, props)), children, /*#__PURE__*/_react.default.createElement(_inputIconToggle.default, {
|
|
244
|
-
disabled: disabled,
|
|
245
|
-
readOnly: readOnly,
|
|
246
|
-
inputIcon: inputIcon,
|
|
247
|
-
size: size,
|
|
248
|
-
error: error,
|
|
249
|
-
warning: warning,
|
|
250
|
-
info: info,
|
|
251
|
-
useValidationIcon: !validationOnLabel
|
|
252
|
-
}))), this.characterCount)));
|
|
122
|
+
const isOverLimit = () => {
|
|
123
|
+
return (value || "").length > parseInt(characterLimit, 10);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const characterCount = () => {
|
|
127
|
+
if (!characterLimit) {
|
|
128
|
+
return null;
|
|
253
129
|
}
|
|
254
|
-
}]);
|
|
255
130
|
|
|
256
|
-
|
|
257
|
-
|
|
131
|
+
return /*#__PURE__*/_react.default.createElement(_characterCount.default, {
|
|
132
|
+
isOverLimit: isOverLimit() && warnOverLimit,
|
|
133
|
+
value: getFormatNumber((value || "").length, locale.locale()),
|
|
134
|
+
limit: getFormatNumber(characterLimit, locale.locale()),
|
|
135
|
+
"data-element": "character-limit"
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
140
|
+
tooltipPosition: tooltipPosition,
|
|
141
|
+
helpAriaLabel: helpAriaLabel
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_inputBehaviour.InputBehaviour, null, /*#__PURE__*/_react.default.createElement(_textarea.default, _extends({
|
|
143
|
+
labelInline: labelInline,
|
|
144
|
+
"data-component": dataComponent,
|
|
145
|
+
"data-role": dataRole,
|
|
146
|
+
"data-element": dataElement
|
|
147
|
+
}, (0, _utils.filterStyledSystemMarginProps)(props)), /*#__PURE__*/_react.default.createElement(_formField.default, {
|
|
148
|
+
fieldHelp: fieldHelp,
|
|
149
|
+
error: error,
|
|
150
|
+
warning: warning,
|
|
151
|
+
info: info,
|
|
152
|
+
label: label,
|
|
153
|
+
disabled: disabled,
|
|
154
|
+
id: id,
|
|
155
|
+
labelInline: labelInline,
|
|
156
|
+
labelAlign: labelAlign,
|
|
157
|
+
labelWidth: labelWidth,
|
|
158
|
+
labelHelp: labelHelp,
|
|
159
|
+
labelSpacing: labelSpacing,
|
|
160
|
+
isRequired: props.required,
|
|
161
|
+
useValidationIcon: validationOnLabel,
|
|
162
|
+
adaptiveLabelBreakpoint: adaptiveLabelBreakpoint
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_input.InputPresentation, {
|
|
164
|
+
size: size,
|
|
165
|
+
disabled: disabled,
|
|
166
|
+
readOnly: readOnly,
|
|
167
|
+
inputWidth: typeof inputWidth === "number" ? inputWidth : 100 - labelWidth,
|
|
168
|
+
error: error,
|
|
169
|
+
warning: warning,
|
|
170
|
+
info: info
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement(_input2.default, _extends({
|
|
172
|
+
autoFocus: autoFocus,
|
|
173
|
+
name: name,
|
|
174
|
+
"aria-invalid": !!error,
|
|
175
|
+
ref: inputRef,
|
|
176
|
+
maxLength: enforceCharacterLimit && characterLimit ? characterLimit : undefined,
|
|
177
|
+
onChange: onChange,
|
|
178
|
+
disabled: disabled,
|
|
179
|
+
readOnly: readOnly,
|
|
180
|
+
labelInline: labelInline,
|
|
181
|
+
placeholder: disabled ? "" : placeholder,
|
|
182
|
+
rows: rows,
|
|
183
|
+
cols: cols,
|
|
184
|
+
id: id,
|
|
185
|
+
as: "textarea"
|
|
186
|
+
}, props)), children, /*#__PURE__*/_react.default.createElement(_inputIconToggle.default, {
|
|
187
|
+
disabled: disabled,
|
|
188
|
+
readOnly: readOnly,
|
|
189
|
+
inputIcon: inputIcon,
|
|
190
|
+
size: size,
|
|
191
|
+
error: error,
|
|
192
|
+
warning: warning,
|
|
193
|
+
info: info,
|
|
194
|
+
useValidationIcon: !validationOnLabel
|
|
195
|
+
}))), characterCount())));
|
|
196
|
+
};
|
|
258
197
|
|
|
259
198
|
exports.OriginalTextarea = Textarea;
|
|
260
|
-
Textarea.contextType = _i18nContext.default;
|
|
261
199
|
Textarea.propTypes = { ...marginPropTypes,
|
|
262
200
|
|
|
263
201
|
/** Automatically focus the input on component mount */
|
|
@@ -381,14 +319,5 @@ Textarea.propTypes = { ...marginPropTypes,
|
|
|
381
319
|
/** Aria label for rendered help component */
|
|
382
320
|
helpAriaLabel: _propTypes.default.string
|
|
383
321
|
};
|
|
384
|
-
Textarea.defaultProps = {
|
|
385
|
-
labelWidth: 30,
|
|
386
|
-
disabled: false,
|
|
387
|
-
expandable: false,
|
|
388
|
-
enforceCharacterLimit: true,
|
|
389
|
-
readOnly: false,
|
|
390
|
-
warnOverLimit: false,
|
|
391
|
-
validationOnLabel: false
|
|
392
|
-
};
|
|
393
322
|
var _default = Textarea;
|
|
394
323
|
exports.default = _default;
|
|
@@ -74,7 +74,7 @@ export interface TextareaProps
|
|
|
74
74
|
helpAriaLabel?: string;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
declare
|
|
77
|
+
declare function Textarea(props: TextareaProps): JSX.Element;
|
|
78
78
|
|
|
79
79
|
export { Textarea as OriginalTextarea };
|
|
80
80
|
export default Textarea;
|
|
@@ -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 _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
@@ -27,167 +27,107 @@ var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/e
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
-
|
|
34
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
|
-
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
37
|
-
|
|
38
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
|
-
|
|
40
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
-
|
|
42
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
-
|
|
44
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
45
|
-
|
|
46
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
-
|
|
48
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
-
|
|
50
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
-
|
|
52
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
-
|
|
54
|
-
let Toast = /*#__PURE__*/function (_React$Component) {
|
|
55
|
-
_inherits(Toast, _React$Component);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(Toast);
|
|
58
|
-
|
|
59
|
-
function Toast(props) {
|
|
60
|
-
var _this;
|
|
30
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
61
31
|
|
|
62
|
-
|
|
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; }
|
|
63
33
|
|
|
64
|
-
|
|
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); }
|
|
65
35
|
|
|
66
|
-
|
|
67
|
-
|
|
36
|
+
const Toast = ({
|
|
37
|
+
as = "warning",
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
id,
|
|
41
|
+
isCenter = true,
|
|
42
|
+
maxWidth,
|
|
43
|
+
onDismiss,
|
|
44
|
+
open = true,
|
|
45
|
+
targetPortalId,
|
|
46
|
+
timeout,
|
|
47
|
+
variant,
|
|
48
|
+
...restProps
|
|
49
|
+
}) => {
|
|
50
|
+
const toastRef = (0, _react.useRef)();
|
|
51
|
+
const timer = (0, _react.useRef)();
|
|
52
|
+
const componentClasses = (0, _react.useMemo)(() => {
|
|
53
|
+
return (0, _classnames.default)(className);
|
|
54
|
+
}, [className]);
|
|
55
|
+
const dismissToast = (0, _react.useCallback)(ev => {
|
|
56
|
+
const isTopmost = _modalManager.default.isTopmost(toastRef.current);
|
|
57
|
+
|
|
58
|
+
if (onDismiss && _events.default.isEscKey(ev) && isTopmost) {
|
|
59
|
+
ev.stopImmediatePropagation();
|
|
60
|
+
onDismiss(ev);
|
|
61
|
+
}
|
|
62
|
+
}, [onDismiss]);
|
|
63
|
+
(0, _react.useEffect)(() => {
|
|
64
|
+
const currentElement = toastRef.current;
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
ev.stopImmediatePropagation();
|
|
66
|
+
_modalManager.default.addModal(currentElement);
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
document.addEventListener("keyup", dismissToast);
|
|
69
|
+
return () => {
|
|
70
|
+
_modalManager.default.removeModal(currentElement);
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
document.removeEventListener("keyup", dismissToast);
|
|
73
|
+
};
|
|
74
|
+
}, [dismissToast]);
|
|
75
|
+
(0, _react.useEffect)(() => {
|
|
76
|
+
clearTimeout(timer.current);
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
get:
|
|
84
|
-
/** Classes to be applied to the component. */
|
|
85
|
-
function () {
|
|
86
|
-
return (0, _classnames.default)(this.props.className);
|
|
78
|
+
if (!timeout || !open || !onDismiss) {
|
|
79
|
+
return;
|
|
87
80
|
}
|
|
88
|
-
}, {
|
|
89
|
-
key: "componentDidMount",
|
|
90
|
-
value: function componentDidMount() {
|
|
91
|
-
_modalManager.default.addModal(this.toastRef.current);
|
|
92
81
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
timer.current = setTimeout(() => onDismiss(), timeout);
|
|
83
|
+
}, [onDismiss, open, timeout]);
|
|
84
|
+
|
|
85
|
+
function renderCloseIcon() {
|
|
86
|
+
if (!onDismiss) return null;
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
88
|
+
"data-element": "close",
|
|
89
|
+
onAction: onDismiss
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
91
|
+
type: "close"
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
95
|
+
function renderToastContent() {
|
|
96
|
+
if (!open) return null;
|
|
97
|
+
const toastProps = {
|
|
98
|
+
isCenter,
|
|
99
|
+
variant: variant || as,
|
|
100
|
+
id,
|
|
101
|
+
maxWidth
|
|
102
|
+
};
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
104
|
+
enter: true,
|
|
105
|
+
classNames: "toast",
|
|
106
|
+
timeout: {
|
|
107
|
+
appear: 1600,
|
|
108
|
+
enter: 1500,
|
|
109
|
+
exit: 500
|
|
114
110
|
}
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_toast.ToastStyle, _extends({
|
|
112
|
+
className: componentClasses
|
|
113
|
+
}, (0, _tags.default)(restProps["data-component"] || "toast", restProps), toastProps), /*#__PURE__*/_react.default.createElement(_toast.TypeIcon, {
|
|
114
|
+
variant: toastProps.variant
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
116
|
+
type: toastProps.variant
|
|
117
|
+
})), /*#__PURE__*/_react.default.createElement(_toast.ToastContentStyle, {
|
|
118
|
+
variant: toastProps.variant,
|
|
119
|
+
isDismiss: onDismiss
|
|
120
|
+
}, children), renderCloseIcon()));
|
|
121
|
+
}
|
|
115
122
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (!onDismiss) return null;
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
126
|
-
"data-element": "close",
|
|
127
|
-
onAction: onDismiss
|
|
128
|
-
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
129
|
-
type: "close"
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
/** Content rendered for the toast. */
|
|
133
|
-
|
|
134
|
-
}, {
|
|
135
|
-
key: "toastContent",
|
|
136
|
-
value: function toastContent() {
|
|
137
|
-
if (!this.props.open) return null;
|
|
138
|
-
const {
|
|
139
|
-
isCenter,
|
|
140
|
-
variant,
|
|
141
|
-
id,
|
|
142
|
-
as,
|
|
143
|
-
onDismiss,
|
|
144
|
-
children,
|
|
145
|
-
maxWidth
|
|
146
|
-
} = this.props;
|
|
147
|
-
const toastProps = {
|
|
148
|
-
isCenter,
|
|
149
|
-
variant: variant || as,
|
|
150
|
-
id,
|
|
151
|
-
maxWidth
|
|
152
|
-
};
|
|
153
|
-
return /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
|
|
154
|
-
enter: true,
|
|
155
|
-
classNames: "toast",
|
|
156
|
-
timeout: {
|
|
157
|
-
appear: 1600,
|
|
158
|
-
enter: 1500,
|
|
159
|
-
exit: 500
|
|
160
|
-
}
|
|
161
|
-
}, /*#__PURE__*/_react.default.createElement(_toast.ToastStyle, _extends({
|
|
162
|
-
className: this.componentClasses
|
|
163
|
-
}, (0, _tags.default)(this.props["data-component"] || "toast", this.props), toastProps), /*#__PURE__*/_react.default.createElement(_toast.TypeIcon, {
|
|
164
|
-
variant: toastProps.variant
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
166
|
-
type: toastProps.variant
|
|
167
|
-
})), /*#__PURE__*/_react.default.createElement(_toast.ToastContentStyle, {
|
|
168
|
-
variant: toastProps.variant,
|
|
169
|
-
isDismiss: onDismiss
|
|
170
|
-
}, children), this.closeIcon()));
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "render",
|
|
174
|
-
value: function render() {
|
|
175
|
-
const {
|
|
176
|
-
targetPortalId,
|
|
177
|
-
isCenter
|
|
178
|
-
} = this.props;
|
|
179
|
-
return /*#__PURE__*/_react.default.createElement(_toast.StyledPortal, {
|
|
180
|
-
id: targetPortalId,
|
|
181
|
-
isCenter: isCenter
|
|
182
|
-
}, /*#__PURE__*/_react.default.createElement(_toast.ToastWrapper, {
|
|
183
|
-
isCenter: isCenter,
|
|
184
|
-
ref: this.toastRef
|
|
185
|
-
}, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, this.toastContent())));
|
|
186
|
-
}
|
|
187
|
-
}]);
|
|
188
|
-
|
|
189
|
-
return Toast;
|
|
190
|
-
}(_react.default.Component);
|
|
123
|
+
return /*#__PURE__*/_react.default.createElement(_toast.StyledPortal, {
|
|
124
|
+
id: targetPortalId,
|
|
125
|
+
isCenter: isCenter
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_toast.ToastWrapper, {
|
|
127
|
+
isCenter: isCenter,
|
|
128
|
+
ref: toastRef
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, renderToastContent())));
|
|
130
|
+
};
|
|
191
131
|
|
|
192
132
|
Toast.propTypes = {
|
|
193
133
|
/** Customizes the appearance in the DLS theme */
|
|
@@ -226,11 +166,5 @@ Toast.propTypes = {
|
|
|
226
166
|
/** Maximum toast width */
|
|
227
167
|
maxWidth: _propTypes.default.string
|
|
228
168
|
};
|
|
229
|
-
Toast.defaultProps = {
|
|
230
|
-
as: "warning",
|
|
231
|
-
onDismiss: null,
|
|
232
|
-
open: true,
|
|
233
|
-
isCenter: true
|
|
234
|
-
};
|
|
235
169
|
var _default = Toast;
|
|
236
170
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "98.0.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
"babel": "cross-env NODE_ENV=production babel ./src --config-file ./babel.config.js --out-dir ./lib --ignore '**/*/__spec__.js','**/*.spec.js','**/__definition__.js' --quiet",
|
|
32
32
|
"clean-lib": "rimraf ./lib",
|
|
33
33
|
"copy-files": "cpy \"**/\" \"!**/(*.js|*.md|*.mdx|*.stories.*|*.snap)\" ../lib/ --cwd=src --parents",
|
|
34
|
-
"commit": "git-cz"
|
|
35
|
-
"chromatic": "chromatic"
|
|
34
|
+
"commit": "git-cz"
|
|
36
35
|
},
|
|
37
36
|
"repository": {
|
|
38
37
|
"type": "git",
|
|
@@ -89,6 +88,7 @@
|
|
|
89
88
|
"babel-jest": "^26.6.3",
|
|
90
89
|
"browserslist": "^4.16.6",
|
|
91
90
|
"chalk": "^4.1.1",
|
|
91
|
+
"chromatic": "^6.0.5",
|
|
92
92
|
"commitizen": "^4.2.4",
|
|
93
93
|
"conventional-changelog-conventionalcommits": "^4.5.0",
|
|
94
94
|
"core-js": "^3.1.4",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"dependencies": {
|
|
138
138
|
"@octokit/rest": "^18.12.0",
|
|
139
139
|
"@popperjs/core": "^2.9.0",
|
|
140
|
-
"@sage/design-tokens": "^1.
|
|
140
|
+
"@sage/design-tokens": "^1.80.0",
|
|
141
141
|
"@styled-system/prop-types": "^5.1.5",
|
|
142
142
|
"@tippyjs/react": "^4.2.5",
|
|
143
143
|
"classnames": "~2.2.6",
|