@aloudata/aloudata-design 0.4.8-beta.9 → 0.4.9

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.
@@ -14,6 +14,7 @@
14
14
  // max-height: 264px;
15
15
  overflow-y: auto;
16
16
  overflow-y: overlay;
17
+ border:1px solid @BG70;
17
18
  }
18
19
  }
19
20
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
  &:hover,&.ald-select-open{
8
8
  border-color:@B40;
9
- box-shadow: @shadow-drop;
9
+ // box-shadow: @shadow-drop;
10
10
  }
11
11
 
12
12
  /**
@@ -41,7 +41,7 @@
41
41
  color: inherit;
42
42
  text-align: left;
43
43
  word-break: break-all;
44
- border-bottom: 1px solid @BG70;
44
+ border-bottom: 1px solid @BG80;
45
45
 
46
46
  &-content {
47
47
  flex: 1;
@@ -218,6 +218,10 @@
218
218
  margin-left: 4px;
219
219
  }
220
220
 
221
+ .ald-table-thead {
222
+ border-top: 1px solid @BG70;
223
+ }
224
+
221
225
  &-column-resizable {
222
226
  overflow: overlay;
223
227
 
@@ -39,7 +39,21 @@ export interface ITabsProps extends Omit<TabsProps, 'size'> {
39
39
  tabPosition?: 'left' | 'right' | 'top' | 'bottom';
40
40
  className?: string;
41
41
  children?: React.ReactNode;
42
+ /**
43
+ * @description header行背景颜色
44
+ * @default -
45
+ */
42
46
  headerBackgroundColor?: string;
47
+ /**
48
+ * @description tab 宽度等分,只有tabPosition 为top的时候生效
49
+ * @default false
50
+ */
51
+ monospace?: boolean;
52
+ /**
53
+ * @description tab 填充padding,默认false
54
+ * @default false
55
+ */
56
+ padding?: boolean | number;
43
57
  }
44
58
  declare function Tabs(props: ITabsProps): JSX.Element;
45
59
  declare namespace Tabs {
@@ -1,4 +1,4 @@
1
- var _excluded = ["size", "className", "popupClassName", "adaptHeight", "style", "headerBackgroundColor"];
1
+ var _excluded = ["size", "className", "popupClassName", "adaptHeight", "style", "monospace", "tabPosition", "padding"];
2
2
 
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
4
4
 
@@ -12,12 +12,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
12
12
 
13
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
14
 
15
- import React from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
15
+ import React, { useMemo } from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
16
16
 
17
- import { Tabs as AntdTabs } from 'antd';
18
17
  import { MoreVerticalLine } from '@aloudata/icons-react';
19
- import TabPane from "./TabPane";
18
+ import { Tabs as AntdTabs } from 'antd';
20
19
  import classNames from 'classnames';
20
+ import TabPane from "./TabPane";
21
21
  export default function Tabs(props) {
22
22
  var size = props.size,
23
23
  className = props.className,
@@ -25,15 +25,45 @@ export default function Tabs(props) {
25
25
  adaptHeight = props.adaptHeight,
26
26
  _props$style = props.style,
27
27
  style = _props$style === void 0 ? {} : _props$style,
28
- headerBackgroundColor = props.headerBackgroundColor,
28
+ monospace = props.monospace,
29
+ _props$tabPosition = props.tabPosition,
30
+ tabPosition = _props$tabPosition === void 0 ? 'top' : _props$tabPosition,
31
+ _props$padding = props.padding,
32
+ padding = _props$padding === void 0 ? false : _props$padding,
29
33
  otherProps = _objectWithoutProperties(props, _excluded);
30
34
 
35
+ var headerBackgroundColor = props.headerBackgroundColor;
36
+
31
37
  var tabsProps = _objectSpread({}, otherProps);
32
38
 
33
39
  if (size === 'large') {
34
40
  tabsProps.size = size;
35
41
  }
36
42
 
43
+ var _monospace = tabPosition !== 'top' ? false : monospace;
44
+
45
+ var _padding = useMemo(function () {
46
+ if (tabPosition !== 'top') return 0;
47
+
48
+ if (typeof padding === 'number') {
49
+ return padding;
50
+ }
51
+
52
+ if (typeof padding === 'boolean' && padding) {
53
+ return 16;
54
+ }
55
+
56
+ return 0;
57
+ }, [padding, tabPosition]);
58
+
59
+ var getTabBarGutter = function getTabBarGutter() {
60
+ if (tabPosition === 'top' && !_monospace) {
61
+ return 24;
62
+ }
63
+
64
+ return 0;
65
+ };
66
+
37
67
  return /*#__PURE__*/React.createElement(AntdTabs, _extends({
38
68
  moreIcon: /*#__PURE__*/React.createElement("div", {
39
69
  className: "ald-tabs-more-icon"
@@ -41,13 +71,17 @@ export default function Tabs(props) {
41
71
  color: "currentColor"
42
72
  })),
43
73
  style: Object.assign(style, {
44
- "--header-bg-color": headerBackgroundColor
74
+ '--header-bg-color': headerBackgroundColor,
75
+ '--tabs-padding': "".concat(_padding, "px")
45
76
  }),
46
- tabBarGutter: 24,
77
+ tabPosition: tabPosition,
78
+ tabBarGutter: getTabBarGutter(),
47
79
  popupClassName: classNames(popupClassName, 'ald-tabs-dropdown'),
48
80
  className: classNames('ald-tabs', className, {
49
81
  'ald-adapt-height': adaptHeight,
50
- 'ald-tabs-default': size !== 'large'
82
+ 'ald-tabs-default': size !== 'large',
83
+ 'ald-tabs-monospace': _monospace,
84
+ 'ald-tabs-padding': !!padding
51
85
  })
52
86
  }, tabsProps));
53
87
  }
@@ -129,12 +129,22 @@
129
129
  &.ant-tabs-bottom > .ant-tabs-nav,
130
130
  &.ant-tabs-top > div > .ant-tabs-nav,
131
131
  &.ant-tabs-bottom > div > .ant-tabs-nav {
132
- margin: 0 0 16px;
132
+ margin-bottom: 16px;
133
133
 
134
134
  &::before {
135
135
  border-color: @BG70;
136
136
  }
137
137
  }
138
+
139
+ &.ant-tabs-left {
140
+ .ant-tabs-nav-list {
141
+ padding-right: 24px;
142
+ }
143
+
144
+ .ant-tabs-tab {
145
+ padding: 8px 0;
146
+ }
147
+ }
138
148
  }
139
149
 
140
150
  .ald-tabs-dropdown {
@@ -170,3 +180,30 @@
170
180
  }
171
181
  }
172
182
  }
183
+
184
+ .ald-tabs-monospace {
185
+ .ant-tabs-nav {
186
+ .ant-tabs-nav-wrap {
187
+ .ant-tabs-nav-list {
188
+ width: 100%;
189
+
190
+ .ant-tabs-tab {
191
+ flex-grow: 1;
192
+ justify-content: center;
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ .ald-tabs-padding {
200
+ .ant-tabs-nav {
201
+ .ant-tabs-nav-wrap {
202
+ margin: 0 var(--tabs-padding);
203
+ }
204
+ }
205
+
206
+ .ant-tabs-content-holder {
207
+ padding: 0 var(--tabs-padding) var(--tabs-padding);
208
+ }
209
+ }
@@ -5,12 +5,18 @@
5
5
  padding: 6px 12px;
6
6
  line-height: 20px;
7
7
  background: @BG10;
8
- border-radius: @border-radius-base;
8
+ border-radius: 4px;
9
9
  box-shadow: none;
10
10
  color:@ND0;
11
11
  font-size: 13px;
12
12
  }
13
13
 
14
+ .ant-tooltip-arrow {
15
+ &::before{
16
+ background-color: @BG10;
17
+ }
18
+ }
19
+
14
20
  .ant-tooltip-arrow-content {
15
21
  background: @BG10;
16
22
  }
@@ -1,13 +1,30 @@
1
- import { Button, notification } from "../..";
1
+ import { Button, notification, Space } from "../..";
2
2
  import React from 'react';
3
3
  export default (function () {
4
- var notices = function notices() {
5
- notification.error({
6
- message: 'Notification Title'
4
+ var notices = function notices(type) {
5
+ notification[type]({
6
+ message: 'Notification Message',
7
+ description: 'description,description,description,description,description,description,description,description'
7
8
  });
8
9
  };
9
10
 
10
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
11
- onClick: notices
12
- }, "Notification error"));
11
+ return /*#__PURE__*/React.createElement(Space, {
12
+ direction: "vertical"
13
+ }, /*#__PURE__*/React.createElement(Button, {
14
+ onClick: function onClick() {
15
+ return notices('success');
16
+ }
17
+ }, "Notification success with message\u3001description"), /*#__PURE__*/React.createElement(Button, {
18
+ onClick: function onClick() {
19
+ return notices('error');
20
+ }
21
+ }, "Notification error with message\u3001description"), /*#__PURE__*/React.createElement(Button, {
22
+ onClick: function onClick() {
23
+ return notices('warning');
24
+ }
25
+ }, "Notification warning with message\u3001description"), /*#__PURE__*/React.createElement(Button, {
26
+ onClick: function onClick() {
27
+ return notices('info');
28
+ }
29
+ }, "Notification info with message\u3001description"));
13
30
  });
@@ -1,2 +1,10 @@
1
- import { notification } from 'antd';
1
+ import type { ArgsProps } from 'antd/es/notification/interface';
2
+ declare const notification: {
3
+ open: (config: ArgsProps) => void;
4
+ success: (config: ArgsProps) => void;
5
+ error: (config: ArgsProps) => void;
6
+ warning: (config: ArgsProps) => void;
7
+ info: (config: ArgsProps) => void;
8
+ destroy: (key?: string) => void;
9
+ };
2
10
  export default notification;
@@ -1,2 +1,149 @@
1
- import { notification } from 'antd';
1
+ var _excluded = ["icon", "className", "style", "closeIcon"],
2
+ _excluded2 = ["icon", "className", "style", "closeIcon"],
3
+ _excluded3 = ["icon", "className", "style", "closeIcon"],
4
+ _excluded4 = ["icon", "className", "style", "closeIcon"];
5
+
6
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
7
+
8
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
+
10
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
+
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+
14
+ 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; }
15
+
16
+ import { AlertTriangleDuotone, CancelCircleDuotone, CheckCircleDuotone, CloseMLine, InfoCircleLine } from '@aloudata/icons-react';
17
+ import { notification as AntdNotification } from 'antd';
18
+ import classnames from 'classnames';
19
+ import React from 'react';
20
+ import theme from "../style/themes/default/themeColor.module.less";
21
+ var iconMap = {
22
+ info: /*#__PURE__*/React.createElement(InfoCircleLine, {
23
+ fill: theme.B40,
24
+ size: 20
25
+ }),
26
+ success: /*#__PURE__*/React.createElement(CheckCircleDuotone, {
27
+ fill: [theme.SA40, theme.ND0],
28
+ theme: "multi-color",
29
+ size: 20
30
+ }),
31
+ error: /*#__PURE__*/React.createElement(CancelCircleDuotone, {
32
+ fill: [theme.SC40, theme.ND0],
33
+ size: 20,
34
+ theme: "multi-color"
35
+ }),
36
+ warning: /*#__PURE__*/React.createElement(AlertTriangleDuotone, {
37
+ fill: [theme.SB40, theme.ND0],
38
+ theme: "multi-color",
39
+ size: 20
40
+ })
41
+ };
42
+ var closeX = /*#__PURE__*/React.createElement(CloseMLine, {
43
+ size: 20,
44
+ fill: theme.NL40
45
+ });
46
+
47
+ var getSDefaultStyle = function getSDefaultStyle(type) {
48
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
49
+ padding: '16px 24px',
50
+ background: theme.SC95,
51
+ border: '1px solid',
52
+ borderRadius: '4px',
53
+ boxShadow: theme.SHADOW_LG
54
+ }, type === 'error' && {
55
+ background: theme.SC95,
56
+ borderColor: theme.SC60
57
+ }), type === 'success' && {
58
+ background: theme.SA95,
59
+ borderColor: theme.SA60
60
+ }), type === 'warning' && {
61
+ background: theme.SB95,
62
+ borderColor: theme.SB60
63
+ }), type === 'info' && {
64
+ background: theme.B95,
65
+ borderColor: theme.B60
66
+ });
67
+ };
68
+
69
+ var notification = {
70
+ open: function open(config) {
71
+ return AntdNotification.open(config);
72
+ },
73
+ success: function success(config) {
74
+ var _config$icon = config.icon,
75
+ icon = _config$icon === void 0 ? iconMap.success : _config$icon,
76
+ _config$className = config.className,
77
+ className = _config$className === void 0 ? classnames('ald-notification-notice', config.className) : _config$className,
78
+ _config$style = config.style,
79
+ style = _config$style === void 0 ? Object.assign(getSDefaultStyle('success'), config.style) : _config$style,
80
+ _config$closeIcon = config.closeIcon,
81
+ closeIcon = _config$closeIcon === void 0 ? closeX : _config$closeIcon,
82
+ rest = _objectWithoutProperties(config, _excluded);
83
+
84
+ return AntdNotification.success(_objectSpread({
85
+ icon: icon,
86
+ style: style,
87
+ className: className,
88
+ closeIcon: closeIcon
89
+ }, rest));
90
+ },
91
+ error: function error(config) {
92
+ var _config$icon2 = config.icon,
93
+ icon = _config$icon2 === void 0 ? iconMap.error : _config$icon2,
94
+ _config$className2 = config.className,
95
+ className = _config$className2 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className2,
96
+ _config$style2 = config.style,
97
+ style = _config$style2 === void 0 ? Object.assign(getSDefaultStyle('error'), config.style) : _config$style2,
98
+ _config$closeIcon2 = config.closeIcon,
99
+ closeIcon = _config$closeIcon2 === void 0 ? closeX : _config$closeIcon2,
100
+ rest = _objectWithoutProperties(config, _excluded2);
101
+
102
+ return AntdNotification.error(_objectSpread({
103
+ icon: icon,
104
+ style: style,
105
+ className: className,
106
+ closeIcon: closeIcon
107
+ }, rest));
108
+ },
109
+ warning: function warning(config) {
110
+ var _config$icon3 = config.icon,
111
+ icon = _config$icon3 === void 0 ? iconMap.warning : _config$icon3,
112
+ _config$className3 = config.className,
113
+ className = _config$className3 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className3,
114
+ _config$style3 = config.style,
115
+ style = _config$style3 === void 0 ? Object.assign(getSDefaultStyle('warning'), config.style) : _config$style3,
116
+ _config$closeIcon3 = config.closeIcon,
117
+ closeIcon = _config$closeIcon3 === void 0 ? closeX : _config$closeIcon3,
118
+ rest = _objectWithoutProperties(config, _excluded3);
119
+
120
+ return AntdNotification.warning(_objectSpread({
121
+ icon: icon,
122
+ style: style,
123
+ className: className,
124
+ closeIcon: closeIcon
125
+ }, rest));
126
+ },
127
+ info: function info(config) {
128
+ var _config$icon4 = config.icon,
129
+ icon = _config$icon4 === void 0 ? iconMap.info : _config$icon4,
130
+ _config$className4 = config.className,
131
+ className = _config$className4 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className4,
132
+ _config$style4 = config.style,
133
+ style = _config$style4 === void 0 ? Object.assign(getSDefaultStyle('info'), config.style) : _config$style4,
134
+ _config$closeIcon4 = config.closeIcon,
135
+ closeIcon = _config$closeIcon4 === void 0 ? closeX : _config$closeIcon4,
136
+ rest = _objectWithoutProperties(config, _excluded4);
137
+
138
+ return AntdNotification.info(_objectSpread({
139
+ icon: icon,
140
+ style: style,
141
+ className: className,
142
+ closeIcon: closeIcon
143
+ }, rest));
144
+ },
145
+ destroy: function destroy(key) {
146
+ return AntdNotification.destroy(key);
147
+ }
148
+ };
2
149
  export default notification;
@@ -1 +1,29 @@
1
1
  @import '../../style/index.less';
2
+
3
+ .ald-notification-notice.ant-notification-notice {
4
+ .ant-notification-notice-icon {
5
+ top: 18px;
6
+ }
7
+
8
+ .ant-notification-notice-message {
9
+ margin-inline-start: 28px;
10
+ padding-inline-end: 28px;
11
+ margin-bottom: 4px;
12
+ }
13
+
14
+ .ant-notification-notice-description {
15
+ margin-inline-start: 28px;
16
+ font-weight: 400;
17
+ font-size: 13px;
18
+ line-height: 20px;
19
+ color: @NL40;
20
+ }
21
+
22
+ .ant-notification-notice-close {
23
+ top: 17px;
24
+
25
+ &:hover{
26
+ background:none;
27
+ }
28
+ }
29
+ }
@@ -45,7 +45,7 @@
45
45
  @B70: #84caff;
46
46
  @B80: #b2ddff;
47
47
  @B90: #d1e9ff;
48
- @B95: #eff8ff;
48
+ @B95: #ebf6ff;
49
49
  @B98: #f5faff;
50
50
 
51
51
  /**
@@ -101,14 +101,14 @@
101
101
  * 中性色是色彩系统的基础。 UI 设计中的几乎所有东西:文本、表单、背景、分隔线等等通常都是中性的。
102
102
  **/
103
103
  @BG0: #000000;
104
- @BG10: #101828;
104
+ @BG10: #101825;
105
105
  @BG20: #1d2939;
106
106
  @BG30: #475467;
107
107
  @BG40: #667085;
108
108
  @BG50: #98a2b3;
109
- @BG60: #d0d5dd;
110
- @BG70: #eaecf0;
111
- @BG80: #f2f4f7;
109
+ @BG60: #d3d7de;
110
+ @BG70: #e3e5ea;
111
+ @BG80: #eff2f5;
112
112
  @BG90: #f5f6f7;
113
113
  @BG95: #f9fafb;
114
114
  @BG97: #fcfcfd;
@@ -125,8 +125,8 @@
125
125
  @shadow-sm: 0px 1px 4px rgba(16, 24, 40, 0.06), 0px 1px 2px rgba(16, 24, 40, 0.04);
126
126
  @shadow-xs: 0px 1px 2px rgba(16, 24, 40, 0.05);
127
127
  @shadow-body-top-left: -4px -4px 2px rgba(0, 0, 0, 0.05);
128
- @shadow-primary:0px 0 0 4px rgba(21, 111, 238, 0.12);
129
- @shadow-drop:0px 0 0 4px #1570EF1F;
128
+ @shadow-primary:0 0 0 4px rgba(21, 111, 238, 0.12);
129
+ @shadow-drop:0 0 0 4px #1570EF1F;
130
130
  // 业务颜色
131
131
  // 除了原色之外,在业务、提示和标签等组件中使用一些次要颜色也很有帮助。这些次要颜色应该少用或作为重点使用,而主要颜色应该占优先地位。
132
132
 
@@ -202,8 +202,8 @@
202
202
  @TE20: #382765;
203
203
  @TE30: #4f378f;
204
204
  @TE40: #6144af;
205
- @TE50: #704ecb;
206
- @TE60: #7e58e3;
205
+ @TE50: #9d76ed;
206
+ @TE60: #b692f6;
207
207
  @TE70: #a08ae8;
208
208
  @TE80: #bcafee;
209
209
  @TE90: #d4cdf4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "0.4.8-beta.9",
3
+ "version": "0.4.9",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "@aloudata/icons-react": "0.1.7",
54
54
  "@aloudata/icons-svg": "0.1.7",
55
- "antd": "5.2.0",
55
+ "antd": "^5.3.1",
56
56
  "memoize-one": "^6.0.0",
57
57
  "rc-menu": "^9.8.0",
58
58
  "react-table": "^7.8.0",