@cloudtower/eagle 0.33.35 → 0.33.37

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.
Files changed (32) hide show
  1. package/dist/cjs/core/MediumDialog/MediumDialog.js +54 -0
  2. package/dist/cjs/core/SmallDialog/SmallDialog.js +144 -0
  3. package/dist/cjs/core/SmallDialog/SmallDialog.style.js +11 -0
  4. package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
  5. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  6. package/dist/cjs/index.js +9 -2
  7. package/dist/cjs/stats1.html +1 -1
  8. package/dist/components.css +30222 -1887
  9. package/dist/esm/core/MediumDialog/MediumDialog.js +48 -0
  10. package/dist/esm/core/SmallDialog/SmallDialog.js +137 -0
  11. package/dist/esm/core/SmallDialog/SmallDialog.style.js +6 -0
  12. package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
  13. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  14. package/dist/esm/index.js +3 -1
  15. package/dist/esm/stats1.html +1 -1
  16. package/dist/linaria.merged.scss +2336 -2268
  17. package/dist/src/core/MediumDialog/MediumDialog.d.ts +3 -0
  18. package/dist/src/core/MediumDialog/index.d.ts +1 -0
  19. package/dist/src/core/SmallDialog/SmallDialog.d.ts +3 -0
  20. package/dist/src/core/SmallDialog/SmallDialog.style.d.ts +4 -0
  21. package/dist/src/{coreX/Dialogs/SmallDialog.d.ts → core/SmallDialog/SmallDialog.type.d.ts} +12 -4
  22. package/dist/src/core/SmallDialog/index.d.ts +3 -0
  23. package/dist/src/core/index.d.ts +2 -0
  24. package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +2 -0
  25. package/dist/src/coreX/Dialogs/index.d.ts +0 -1
  26. package/dist/stories/docs/core/MediumDialog.stories.d.ts +35 -0
  27. package/dist/stories/docs/core/SmallDialog.stories.d.ts +37 -0
  28. package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +5 -0
  29. package/dist/style.css +1839 -1770
  30. package/package.json +4 -4
  31. package/dist/cjs/coreX/Dialogs/SmallDialog.js +0 -86
  32. package/dist/esm/coreX/Dialogs/SmallDialog.js +0 -80
@@ -0,0 +1,48 @@
1
+ import React__default from 'react';
2
+ import { cx } from '@linaria/core';
3
+ import { Typo } from '../Typo/index.js';
4
+ import { SmallDialog } from '../SmallDialog/SmallDialog.js';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value
15
+ }) : obj[key] = value;
16
+ var __spreadValues = (a, b) => {
17
+ for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
28
+ }
29
+ return target;
30
+ };
31
+ const MediumDialogStyle = "E_m5foqp8";
32
+ const MediumDialog = _a => {
33
+ var _b = _a,
34
+ {
35
+ className
36
+ } = _b,
37
+ restProps = __objRest(_b, ["className"]);
38
+ return /* @__PURE__ */React__default.createElement(SmallDialog, __spreadValues({
39
+ TitleRender: ({
40
+ title
41
+ }) => /* @__PURE__ */React__default.createElement("span", {
42
+ className: Typo.Display.d1s_bold_title
43
+ }, title),
44
+ className: cx(MediumDialogStyle, className)
45
+ }, restProps));
46
+ };
47
+
48
+ export { MediumDialog };
@@ -0,0 +1,137 @@
1
+ import { ExclamationErrorCircleFill16RedIcon, XmarkCloseBold24TertiaryIcon, XmarkCloseBold24SecondaryIcon } from '@cloudtower/icons-react';
2
+ import { cx } from '@linaria/core';
3
+ import { usePopModal } from '../KitStoreProvider/index.js';
4
+ import { Modal } from 'antd';
5
+ import React__default from 'react';
6
+ import cs from 'classnames';
7
+ import OverflowTooltip from '../../coreX/OverflowTooltip/index.js';
8
+ import { Show } from '../../coreX/Show/index.js';
9
+ import { FooterStyle, ErrorTextStyle, DialogStyle, CloseIconStyle } from './SmallDialog.style.js';
10
+ import Icon from '../Icon/index.js';
11
+ import Button from '../Button/index.js';
12
+ import { Flex } from 'antd5';
13
+ import { Typo } from '../Typo/index.js';
14
+
15
+ var __defProp = Object.defineProperty;
16
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
19
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20
+ var __spreadValues = (a, b) => {
21
+ for (var prop in b || (b = {}))
22
+ if (__hasOwnProp.call(b, prop))
23
+ __defNormalProp(a, prop, b[prop]);
24
+ if (__getOwnPropSymbols)
25
+ for (var prop of __getOwnPropSymbols(b)) {
26
+ if (__propIsEnum.call(b, prop))
27
+ __defNormalProp(a, prop, b[prop]);
28
+ }
29
+ return a;
30
+ };
31
+ const DefaultTitleRender = ({
32
+ title
33
+ }) => {
34
+ return /* @__PURE__ */ React__default.createElement("span", { className: cs(Typo.Display.d2_bold_title) }, title);
35
+ };
36
+ const SmallDialog = ({
37
+ title,
38
+ TitleRender,
39
+ cancelText = "\u5173\u95ED",
40
+ okText = "\u786E\u5B9A",
41
+ showOk = true,
42
+ onOk,
43
+ onCancel,
44
+ maskClosable = true,
45
+ closable = true,
46
+ className,
47
+ footerClassName,
48
+ okButtonProps,
49
+ cancelButtonProps,
50
+ children,
51
+ showFooterErrorIcon = true,
52
+ error,
53
+ confirmLoading
54
+ }) => {
55
+ const popModal = usePopModal();
56
+ const handleClose = () => {
57
+ if (onCancel) {
58
+ onCancel(popModal);
59
+ } else {
60
+ popModal();
61
+ }
62
+ };
63
+ const handleOk = () => {
64
+ if (onOk) {
65
+ onOk(popModal);
66
+ } else {
67
+ popModal();
68
+ }
69
+ };
70
+ const CustomTitleRender = TitleRender || DefaultTitleRender;
71
+ return /* @__PURE__ */ React__default.createElement(
72
+ Modal,
73
+ {
74
+ visible: true,
75
+ title: /* @__PURE__ */ React__default.createElement(CustomTitleRender, { title }),
76
+ footer: /* @__PURE__ */ React__default.createElement(
77
+ "div",
78
+ {
79
+ className: cs(FooterStyle, footerClassName, {
80
+ "has-error": !!error
81
+ })
82
+ },
83
+ /* @__PURE__ */ React__default.createElement(Show, { condition: !!error }, /* @__PURE__ */ React__default.createElement(
84
+ Flex,
85
+ {
86
+ gap: 4,
87
+ align: "center",
88
+ className: cx(ErrorTextStyle, Typo.Label.l3_regular)
89
+ },
90
+ /* @__PURE__ */ React__default.createElement(Show, { condition: showFooterErrorIcon }, /* @__PURE__ */ React__default.createElement(
91
+ Icon,
92
+ {
93
+ src: ExclamationErrorCircleFill16RedIcon,
94
+ iconHeight: 16,
95
+ iconWidth: 16
96
+ }
97
+ )),
98
+ /* @__PURE__ */ React__default.createElement(OverflowTooltip, { multiLines: 3, content: error, tooltip: error })
99
+ )),
100
+ /* @__PURE__ */ React__default.createElement(Flex, null, /* @__PURE__ */ React__default.createElement(
101
+ Button,
102
+ __spreadValues({
103
+ type: showOk ? "quiet" : "ordinary",
104
+ onClick: handleClose,
105
+ className: Typo.Label.l2_bold_title
106
+ }, cancelButtonProps),
107
+ cancelText
108
+ ), showOk && /* @__PURE__ */ React__default.createElement(
109
+ Button,
110
+ __spreadValues({
111
+ type: "primary",
112
+ onClick: handleOk,
113
+ loading: confirmLoading
114
+ }, okButtonProps),
115
+ okText
116
+ ))
117
+ ),
118
+ onCancel: handleClose,
119
+ closable,
120
+ maskClosable,
121
+ className: cx(DialogStyle, className),
122
+ closeIcon: /* @__PURE__ */ React__default.createElement(
123
+ Icon,
124
+ {
125
+ src: XmarkCloseBold24TertiaryIcon,
126
+ className: CloseIconStyle,
127
+ iconHeight: 24,
128
+ iconWidth: 24,
129
+ hoverSrc: XmarkCloseBold24SecondaryIcon
130
+ }
131
+ )
132
+ },
133
+ children
134
+ );
135
+ };
136
+
137
+ export { SmallDialog };
@@ -0,0 +1,6 @@
1
+ const DialogStyle = "E_dxyv8bv";
2
+ const FooterStyle = "E_fbgo4wr";
3
+ const ErrorTextStyle = "E_ekxnz54";
4
+ const CloseIconStyle = "E_ct1041x";
5
+
6
+ export { CloseIconStyle, DialogStyle, ErrorTextStyle, FooterStyle };
@@ -2,7 +2,7 @@ import { cx } from '@linaria/core';
2
2
  import { Typo } from '../../../core/Typo/index.js';
3
3
  import useParrotTranslation from '../../../hooks/useParrotTranslation.js';
4
4
  import React__default from 'react';
5
- import { SmallDialog } from '../SmallDialog.js';
5
+ import { SmallDialog } from '../../../core/SmallDialog/SmallDialog.js';
6
6
 
7
7
  const ContentStyle = "E_cevhqx7";
8
8
  const SecondaryDescStyle = "E_snbqlt4";
@@ -18,7 +18,8 @@ const DeleteDialog = props => {
18
18
  okText = t("common.delete"),
19
19
  onOk,
20
20
  onCancel,
21
- className
21
+ className,
22
+ confirmLoading
22
23
  } = props;
23
24
  return /* @__PURE__ */React__default.createElement(SmallDialog, {
24
25
  title,
@@ -30,7 +31,8 @@ const DeleteDialog = props => {
30
31
  cancelText,
31
32
  okButtonProps: {
32
33
  danger: true
33
- }
34
+ },
35
+ confirmLoading
34
36
  }, description && /* @__PURE__ */React__default.createElement("div", {
35
37
  className: cx(ContentStyle, Typo.Label.l2_regular)
36
38
  }, description), secondaryDesc && /* @__PURE__ */React__default.createElement("div", {
@@ -1,7 +1,7 @@
1
1
  import { cx } from '@linaria/core';
2
2
  import { Typo } from '../../../core/Typo/index.js';
3
3
  import React__default from 'react';
4
- import { SmallDialog } from '../SmallDialog.js';
4
+ import { SmallDialog } from '../../../core/SmallDialog/SmallDialog.js';
5
5
  import { RejectDialogType } from './RejectDialog.type.js';
6
6
 
7
7
  const ContentList = "E_c1ss4prm";
package/dist/esm/index.js CHANGED
@@ -118,6 +118,9 @@ export { ColumnTitle, EmptyRowMenu, KitTableContext, TableLoading } from './core
118
118
  export { ValidateTriggerType } from './core/TableForm/types.js';
119
119
  export { Timeline } from './core/Timeline/index.js';
120
120
  export { Typo } from './core/Typo/index.js';
121
+ export { SmallDialog } from './core/SmallDialog/SmallDialog.js';
122
+ export { CloseIconStyle, DialogStyle, ErrorTextStyle, FooterStyle } from './core/SmallDialog/SmallDialog.style.js';
123
+ export { MediumDialog } from './core/MediumDialog/MediumDialog.js';
121
124
  export { default as BarChart, getWidth } from './coreX/BarChart/index.js';
122
125
  export { default as BatchOperation, renderBatchOperationMenuItem } from './coreX/BatchOperation/index.js';
123
126
  export { default as ChartWithTooltip, ChartWithUnit } from './coreX/ChartWithTooltip/index.js';
@@ -149,7 +152,6 @@ export { default as RelativeTime } from './coreX/DateRangePicker/RelativeTime.js
149
152
  export { DeleteDialog } from './coreX/Dialogs/DeleteDialog/DeleteDialog.js';
150
153
  export { RejectDialog } from './coreX/Dialogs/RejectDialog/RejectDialog.js';
151
154
  export { RejectDialogType } from './coreX/Dialogs/RejectDialog/RejectDialog.type.js';
152
- export { SmallDialog } from './coreX/Dialogs/SmallDialog.js';
153
155
  export { InfoRowList } from './coreX/InfoRowList/InfoRowList.js';
154
156
  export { Show } from './coreX/Show/index.js';
155
157
  export { Animation, Keyframes } from './styles/token/animation.js';