@cloudtower/eagle 490.0.10 → 490.0.12
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/dist/cjs/core/Alert/alert.style.js +7 -0
- package/dist/cjs/core/Alert/index.js +108 -61
- package/dist/cjs/core/Checkbox/index.js +1 -0
- package/dist/cjs/core/LegacySelect/index.js +10 -3
- package/dist/cjs/core/Timeline/index.js +1 -1
- package/dist/cjs/coreX/CheckPointList/index.js +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/legacy-antd.js +1 -1
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +3787 -3786
- package/dist/esm/core/Alert/alert.style.js +4 -0
- package/dist/esm/core/Alert/index.js +105 -62
- package/dist/esm/core/Checkbox/index.js +1 -0
- package/dist/esm/core/LegacySelect/index.js +10 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/linaria.merged.scss +4650 -4649
- package/dist/src/core/Alert/__test__/Alert.test.d.ts +1 -0
- package/dist/src/core/Alert/alert.style.d.ts +2 -0
- package/dist/src/core/Alert/alert.type.d.ts +49 -0
- package/dist/src/core/Alert/index.d.ts +1 -0
- package/dist/src/core/Checkbox/index.d.ts +4 -0
- package/dist/src/core/LegacySelect/select.type.d.ts +4 -0
- package/dist/stories/docs/core/Alert.stories.d.ts +120 -11
- package/dist/style.css +3787 -3786
- package/docs/core/Alert/guide.md +126 -0
- package/docs/llms.txt +1 -1
- package/package.json +4 -4
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var iconsReact = require('@cloudtower/icons-react');
|
|
4
|
-
var index = require('../Icon/index.js');
|
|
6
|
+
var index$1 = require('../Icon/index.js');
|
|
7
|
+
var index = require('../Link/index.js');
|
|
8
|
+
var useParrotTranslation = require('../../hooks/useParrotTranslation.js');
|
|
5
9
|
var antd = require('antd');
|
|
6
10
|
var cs = require('classnames');
|
|
7
11
|
var React = require('react');
|
|
12
|
+
var alert_style = require('./alert.style.js');
|
|
8
13
|
var icon = require('../../utils/icon.js');
|
|
9
14
|
|
|
10
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -18,76 +23,118 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
18
23
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
24
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
25
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
21
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value
|
|
26
|
-
}) : obj[key] = value;
|
|
26
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
27
27
|
var __spreadValues = (a, b) => {
|
|
28
|
-
for (var prop in b || (b = {}))
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
for (var prop in b || (b = {}))
|
|
29
|
+
if (__hasOwnProp.call(b, prop))
|
|
30
|
+
__defNormalProp(a, prop, b[prop]);
|
|
31
|
+
if (__getOwnPropSymbols)
|
|
32
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
33
|
+
if (__propIsEnum.call(b, prop))
|
|
34
|
+
__defNormalProp(a, prop, b[prop]);
|
|
35
|
+
}
|
|
32
36
|
return a;
|
|
33
37
|
};
|
|
34
38
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
35
39
|
var __objRest = (source, exclude) => {
|
|
36
40
|
var target = {};
|
|
37
|
-
for (var prop in source)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
for (var prop in source)
|
|
42
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
43
|
+
target[prop] = source[prop];
|
|
44
|
+
if (source != null && __getOwnPropSymbols)
|
|
45
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
46
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
47
|
+
target[prop] = source[prop];
|
|
48
|
+
}
|
|
41
49
|
return target;
|
|
42
50
|
};
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
const Alert = (_a) => {
|
|
52
|
+
var _b = _a, {
|
|
53
|
+
type,
|
|
54
|
+
icon: icon$1,
|
|
55
|
+
showIcon = true,
|
|
56
|
+
className,
|
|
57
|
+
onClose,
|
|
58
|
+
closeText,
|
|
59
|
+
action,
|
|
60
|
+
message,
|
|
61
|
+
description,
|
|
62
|
+
closable,
|
|
63
|
+
expandConfig,
|
|
64
|
+
"data-testid": dataTestId
|
|
65
|
+
} = _b, props = __objRest(_b, [
|
|
66
|
+
"type",
|
|
67
|
+
"icon",
|
|
68
|
+
"showIcon",
|
|
69
|
+
"className",
|
|
70
|
+
"onClose",
|
|
71
|
+
"closeText",
|
|
72
|
+
"action",
|
|
73
|
+
"message",
|
|
74
|
+
"description",
|
|
75
|
+
"closable",
|
|
76
|
+
"expandConfig",
|
|
77
|
+
"data-testid"
|
|
78
|
+
]);
|
|
79
|
+
var _a2;
|
|
80
|
+
const { t } = useParrotTranslation();
|
|
81
|
+
const _icon = /* @__PURE__ */ React__default.default.createElement(index$1, { alt: type, src: icon.getAlertIcon(type) });
|
|
64
82
|
const _type = type === "normal" ? "info" : type;
|
|
65
83
|
const _closable = closable || Boolean(onClose) || Boolean(closeText);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
const [internalExpanded, setInternalExpanded] = React.useState(
|
|
85
|
+
(_a2 = expandConfig == null ? void 0 : expandConfig.defaultExpanded) != null ? _a2 : false
|
|
86
|
+
);
|
|
87
|
+
const isControlled = (expandConfig == null ? void 0 : expandConfig.expanded) !== void 0;
|
|
88
|
+
const expanded = isControlled ? expandConfig.expanded : internalExpanded;
|
|
89
|
+
const handleToggle = React.useCallback(() => {
|
|
90
|
+
var _a3;
|
|
91
|
+
const next = !expanded;
|
|
92
|
+
if (!isControlled) {
|
|
93
|
+
setInternalExpanded(next);
|
|
94
|
+
}
|
|
95
|
+
(_a3 = expandConfig == null ? void 0 : expandConfig.onExpandChange) == null ? void 0 : _a3.call(expandConfig, next);
|
|
96
|
+
}, [expanded, isControlled, expandConfig == null ? void 0 : expandConfig.onExpandChange]);
|
|
97
|
+
const showExpandToggle = expandConfig && description;
|
|
98
|
+
const expandToggle = showExpandToggle ? /* @__PURE__ */ React__default.default.createElement(
|
|
99
|
+
index,
|
|
100
|
+
{
|
|
101
|
+
onClick: handleToggle,
|
|
102
|
+
"data-testid": "alert-expand-toggle",
|
|
103
|
+
suffixIcon: /* @__PURE__ */ React__default.default.createElement(
|
|
104
|
+
index$1,
|
|
105
|
+
{
|
|
106
|
+
src: expanded ? iconsReact.ArrowChevronUpSmall16BlueIcon : iconsReact.ArrowChevronDownSmall16BlueIcon
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
},
|
|
110
|
+
expanded ? t("alert_collapse") : t("alert_expand")
|
|
111
|
+
) : null;
|
|
112
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
113
|
+
antd.Alert,
|
|
114
|
+
__spreadProps(__spreadValues({}, props), {
|
|
115
|
+
"data-testid": dataTestId,
|
|
116
|
+
className: cs__default.default(alert_style.AlertStyle, type ? `alert-${type}` : "", className, {
|
|
117
|
+
action: action || expandToggle
|
|
118
|
+
}),
|
|
119
|
+
type: _type,
|
|
120
|
+
message: /* @__PURE__ */ React__default.default.createElement("div", { className: alert_style.MessageWrapperStyle }, /* @__PURE__ */ React__default.default.createElement("div", { style: { flex: 1 } }, message, showExpandToggle && expanded ? /* @__PURE__ */ React__default.default.createElement("div", null, description) : null), action ? /* @__PURE__ */ React__default.default.createElement("span", { className: cs__default.default("action") }, action) : null, expandToggle ? /* @__PURE__ */ React__default.default.createElement("span", { className: cs__default.default("action") }, expandToggle) : null),
|
|
121
|
+
description: expandConfig ? void 0 : description,
|
|
122
|
+
icon: icon$1 || _icon,
|
|
123
|
+
showIcon,
|
|
124
|
+
onClose,
|
|
125
|
+
closeText: closeText || _closable && /* @__PURE__ */ React__default.default.createElement(
|
|
126
|
+
index$1,
|
|
127
|
+
{
|
|
128
|
+
src: iconsReact.XmarkRemove16RegularTertiaryCapsOffIcon,
|
|
129
|
+
hoverSrc: iconsReact.XmarkRemove16RegularPrimaryCapsOffIcon
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
closable: _closable
|
|
133
|
+
})
|
|
134
|
+
);
|
|
90
135
|
};
|
|
91
136
|
var Alert$1 = Alert;
|
|
92
137
|
|
|
93
|
-
|
|
138
|
+
exports.AlertStyle = alert_style.AlertStyle;
|
|
139
|
+
exports.MessageWrapperStyle = alert_style.MessageWrapperStyle;
|
|
140
|
+
exports.default = Alert$1;
|
|
@@ -73,6 +73,7 @@ const Checkbox = (_a) => {
|
|
|
73
73
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
74
74
|
antd.Checkbox,
|
|
75
75
|
__spreadProps(__spreadValues({}, props), {
|
|
76
|
+
"data-test": props["data-test"] || props.value,
|
|
76
77
|
className: cs__default.default(className, checkbox_style.CheckboxStyle, compact && "compact")
|
|
77
78
|
}),
|
|
78
79
|
(dataTestId || props.value) && /* @__PURE__ */ React__default.default.createElement("span", { ref: markerRef, style: { display: "none" } }),
|
|
@@ -69,7 +69,8 @@ const LegacySelect = (_a) => {
|
|
|
69
69
|
size = "middle",
|
|
70
70
|
meta,
|
|
71
71
|
placeholder,
|
|
72
|
-
"data-testid": dataTestId
|
|
72
|
+
"data-testid": dataTestId,
|
|
73
|
+
"data-test": dataTest
|
|
73
74
|
} = _b, restProps = __objRest(_b, [
|
|
74
75
|
"input",
|
|
75
76
|
"multiple",
|
|
@@ -90,7 +91,8 @@ const LegacySelect = (_a) => {
|
|
|
90
91
|
"size",
|
|
91
92
|
"meta",
|
|
92
93
|
"placeholder",
|
|
93
|
-
"data-testid"
|
|
94
|
+
"data-testid",
|
|
95
|
+
"data-test"
|
|
94
96
|
]);
|
|
95
97
|
var _a2;
|
|
96
98
|
const limitExceeded = multiple && selectLimit && selectLimit <= (((_a2 = input.value) == null ? void 0 : _a2.length) || 0);
|
|
@@ -122,6 +124,10 @@ const LegacySelect = (_a) => {
|
|
|
122
124
|
"data-testid",
|
|
123
125
|
String(placeholder || item.textContent)
|
|
124
126
|
);
|
|
127
|
+
inputDom && (placeholder || item) && inputDom.setAttribute(
|
|
128
|
+
"data-test",
|
|
129
|
+
String(placeholder || item.textContent)
|
|
130
|
+
);
|
|
125
131
|
}
|
|
126
132
|
}, [selectRef, placeholder]);
|
|
127
133
|
React.useEffect(() => {
|
|
@@ -192,7 +198,8 @@ const LegacySelect = (_a) => {
|
|
|
192
198
|
React__default.default.Children.map(children, (child) => {
|
|
193
199
|
return reactIs.isElement(child) ? __spreadProps(__spreadValues({}, child), {
|
|
194
200
|
props: __spreadProps(__spreadValues({}, child.props), {
|
|
195
|
-
"data-
|
|
201
|
+
"data-test": child.props.value,
|
|
202
|
+
"data-testid": dataTestId || dataTest ? `${dataTestId || dataTest}-option-${child.props.value}` : void 0
|
|
196
203
|
})
|
|
197
204
|
}) : child;
|
|
198
205
|
})
|
|
@@ -127,7 +127,7 @@ const Timeline = ({
|
|
|
127
127
|
),
|
|
128
128
|
/* @__PURE__ */ React__default.default.createElement("div", { className: "item-time" }, subInfoRender ? subInfoRender(subInfo) : subInfo ? /* @__PURE__ */ React__default.default.createElement(Timeline_widget.TimelineArea, __spreadValues({}, subInfo)) : /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null), finalDetailMessages.length > 0 ? finalDetailMessages.map(
|
|
129
129
|
(detailMessage2, index2) => detailMessageRender ? detailMessageRender(detailMessage2, index2) : /* @__PURE__ */ React__default.default.createElement(
|
|
130
|
-
index$1,
|
|
130
|
+
index$1.default,
|
|
131
131
|
__spreadValues({
|
|
132
132
|
key: `detail-message-${index2}`,
|
|
133
133
|
showIcon: false,
|
|
@@ -72,7 +72,7 @@ const CheckPointItem = ({
|
|
|
72
72
|
if (action.type === "icon") {
|
|
73
73
|
return /* @__PURE__ */ React__default.default.createElement(index$1, __spreadValues({}, action.props));
|
|
74
74
|
}
|
|
75
|
-
})), /* @__PURE__ */ React__default.default.createElement(index.Show, { condition: Boolean(tagProps) }, /* @__PURE__ */ React__default.default.createElement(index$5.default, __spreadValues({}, tagProps))))), /* @__PURE__ */ React__default.default.createElement(index.Show, { condition: Boolean(alertProps) }, /* @__PURE__ */ React__default.default.createElement(index$6, __spreadValues({ showIcon: false }, alertProps))));
|
|
75
|
+
})), /* @__PURE__ */ React__default.default.createElement(index.Show, { condition: Boolean(tagProps) }, /* @__PURE__ */ React__default.default.createElement(index$5.default, __spreadValues({}, tagProps))))), /* @__PURE__ */ React__default.default.createElement(index.Show, { condition: Boolean(alertProps) }, /* @__PURE__ */ React__default.default.createElement(index$6.default, __spreadValues({ showIcon: false }, alertProps))));
|
|
76
76
|
};
|
|
77
77
|
const CheckPointList = ({
|
|
78
78
|
items = [],
|
package/dist/cjs/index.js
CHANGED
|
@@ -82,6 +82,7 @@ var index$16 = require('./core/TimeZoneSelect/index.js');
|
|
|
82
82
|
var index$17 = require('./core/Token/index.js');
|
|
83
83
|
var index$18 = require('./core/Tooltip/index.js');
|
|
84
84
|
var index$19 = require('./core/Truncate/index.js');
|
|
85
|
+
var alert_style = require('./core/Alert/alert.style.js');
|
|
85
86
|
var Antd5Dropdown = require('./core/Antd5Dropdown/Antd5Dropdown.js');
|
|
86
87
|
var antd5 = require('antd5');
|
|
87
88
|
var arch_type = require('./core/Arch/arch.type.js');
|
|
@@ -203,7 +204,7 @@ exports.MessageContext = useMessage.MessageContext;
|
|
|
203
204
|
exports.useMessage = useMessage.useMessage;
|
|
204
205
|
exports.ModalActions = modal.ModalActions;
|
|
205
206
|
exports.AccordionCard = index$3;
|
|
206
|
-
exports.Alert = index$4;
|
|
207
|
+
exports.Alert = index$4.default;
|
|
207
208
|
exports.Antd5Anchor = index$5;
|
|
208
209
|
exports.Arch = index$6.default;
|
|
209
210
|
exports.Avatar = index$7;
|
|
@@ -428,6 +429,8 @@ exports.Token = index$17.default;
|
|
|
428
429
|
exports.TokenPresetColors = index$17.TokenPresetColors;
|
|
429
430
|
exports.Tooltip = index$18;
|
|
430
431
|
exports.Truncate = index$19;
|
|
432
|
+
exports.AlertStyle = alert_style.AlertStyle;
|
|
433
|
+
exports.MessageWrapperStyle = alert_style.MessageWrapperStyle;
|
|
431
434
|
exports.Antd5Dropdown = Antd5Dropdown.Antd5Dropdown;
|
|
432
435
|
Object.defineProperty(exports, 'Antd5Flex', {
|
|
433
436
|
enumerable: true,
|
package/dist/cjs/legacy-antd.js
CHANGED
|
@@ -113,7 +113,7 @@ function getAntdKit() {
|
|
|
113
113
|
},
|
|
114
114
|
inputGroup: index$n,
|
|
115
115
|
Empty: /* @__PURE__ */ React__default.default.createElement(index$o, null),
|
|
116
|
-
alert: index$p,
|
|
116
|
+
alert: index$p.default,
|
|
117
117
|
searchInput: SearchInput.SearchInput,
|
|
118
118
|
badge: index$q,
|
|
119
119
|
radio: index$r.default,
|