@antscorp/antsomi-ui 1.3.5-beta.447 → 1.3.5-beta.449

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.
@@ -1,4 +1,9 @@
1
- /// <reference types="react" />
2
- export declare const Alert: import("styled-components").StyledComponent<import("react").FC<import("antd").AlertProps> & {
1
+ import React from 'react';
2
+ import type { AlertProps as AntdAlertProps } from 'antd';
3
+ export declare const AlertStyled: import("styled-components").StyledComponent<React.FC<AntdAlertProps> & {
3
4
  ErrorBoundary: typeof import("antd/es/alert/ErrorBoundary").default;
4
5
  }, any, {}, never>;
6
+ export interface AlertProps extends AntdAlertProps {
7
+ variant?: 'default' | 'outline';
8
+ }
9
+ export declare const Alert: React.FC<AlertProps>;
@@ -1,19 +1,53 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  var _a, _b, _c, _d;
2
13
  // Libraries
14
+ import React from 'react';
3
15
  import styled from 'styled-components';
4
16
  import { Alert as AntdAlert } from 'antd';
5
17
  // Constants
6
- import { THEME } from '@antscorp/antsomi-ui/es/constants';
7
- export const Alert = styled(AntdAlert) `
8
- padding: 10px;
18
+ import { globalToken, THEME } from '@antscorp/antsomi-ui/es/constants';
19
+ import clsx from 'clsx';
20
+ import { WarningIcon } from '@antscorp/antsomi-ui/es/components/icons';
21
+ export const AlertStyled = styled(AntdAlert) `
22
+ padding: 15px !important;
9
23
  font-size: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.fontSize}px;
24
+ box-sizing: border-box;
25
+ gap: 15px;
10
26
 
11
- .antsomi-alert-message {
27
+ /* .antsomi-alert-message {
12
28
  color: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorTextBase} !important;
13
- }
29
+ } */
14
30
 
15
31
  &.antsomi-alert-info {
16
32
  background-color: ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.bw1};
17
33
  border-color: ${(_d = THEME.token) === null || _d === void 0 ? void 0 : _d.bw1};
18
34
  }
35
+
36
+ &.antsomi-alert-outline {
37
+ background-color: transparent;
38
+
39
+ &.antsomi-alert-warning {
40
+ border-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.orange6} !important;
41
+ svg {
42
+ margin: 0;
43
+ }
44
+ }
45
+ }
19
46
  `;
47
+ export const Alert = props => {
48
+ const { variant = 'default', className, icon, type } = props, restProps = __rest(props, ["variant", "className", "icon", "type"]);
49
+ return (React.createElement(AlertStyled, Object.assign({ className: clsx(className, {
50
+ 'antsomi-alert-outline': variant === 'outline',
51
+ 'antsomi-alert-default': variant === 'default',
52
+ }), icon: variant === 'outline' && !icon && type === 'warning' ? React.createElement(WarningIcon, null) : icon, type: type }, restProps)));
53
+ };
@@ -3,12 +3,16 @@ import { ModalFuncProps } from 'antd';
3
3
  interface EditorTabItem {
4
4
  showIcon?: boolean;
5
5
  closeable?: boolean;
6
+ showDropdown?: boolean;
6
7
  id: string;
7
8
  name: string;
8
9
  type: 'query' | 'table-detail';
9
10
  }
10
11
  interface EditorTabProps {
11
12
  showArrow?: boolean;
13
+ /**
14
+ * @deprecated pass showDropdown key to each item in `listTab` props
15
+ */
12
16
  showDropdown?: boolean;
13
17
  editNameOnConfigure?: boolean;
14
18
  newTabText?: string;
@@ -157,8 +157,7 @@ export const EditorTab = props => {
157
157
  React.createElement(Icon, { type: "icon-ants-angle-left" }))),
158
158
  React.createElement("div", { ref: leftBlockRef, className: classnames('left-block', leftBlockClassName), onWheel: onWheelLeftBlock }, arrTabs && arrTabs.length
159
159
  ? arrTabs.map((tab, idx) => {
160
- const { showIcon = true, closeable = true } = tab;
161
- // const { showIcon = true, showDropdown = true, closeable = true } = tab;
160
+ const { showIcon = true, showDropdown = true, closeable = true } = tab;
162
161
  return (React.createElement("div", { key: tab.id, onClick: () => handleActiveTab(tab.id), className: classnames('tab-item', tabItemClassName, {
163
162
  active: tab.id === activeTabId,
164
163
  }) },
@@ -14,6 +14,7 @@ export const THEME = {
14
14
  colorTextPlaceholder: '#BEBEBE',
15
15
  colorTextDisabled: '#999999',
16
16
  colorError: '#EF3340',
17
+ colorSuccess: '#12B800',
17
18
  colorWarning: '#faad14',
18
19
  colorPrimary: '#005fb8',
19
20
  colorTextHover: '#3a72b6',
@@ -55,6 +56,7 @@ export const THEME = {
55
56
  red6: '#EF3340',
56
57
  red7: '#CF1825',
57
58
  red8: '#FF0000',
59
+ orange6: '#F29100',
58
60
  bw0: '#FFFFFF',
59
61
  bw1_1: '#f8f8fc',
60
62
  bw1: '#f0f6fa',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.447",
3
+ "version": "1.3.5-beta.449",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",