@oceanbase/design 0.2.21 → 0.2.23

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.
@@ -5,15 +5,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { genComponentStyleHook as antGenComponentStyleHook } from 'antd/es/theme/internal';
8
+ import theme from "../theme";
8
9
  export function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
9
10
  return function (prefixCls) {
10
11
  var useStyle = antGenComponentStyleHook("OB-".concat(componentName), function (token) {
11
12
  return [styleFn(token)];
12
13
  }, getDefaultToken);
13
14
  var _useStyle = useStyle(prefixCls),
14
- _useStyle2 = _slicedToArray(_useStyle, 2),
15
- wrapSSR = _useStyle2[0],
16
- hashId = _useStyle2[1];
15
+ _useStyle2 = _slicedToArray(_useStyle, 1),
16
+ wrapSSR = _useStyle2[0];
17
+ // use hashId from useToken, as hashId is '' when hashed is false
18
+ // ref: https://github.com/ant-design/ant-design/blob/master/components/theme/useToken.ts#L80
19
+ var _theme$useToken = theme.useToken(),
20
+ hashId = _theme$useToken.hashId;
17
21
  return {
18
22
  wrapSSR: wrapSSR,
19
23
  hashId: hashId
@@ -58,7 +58,7 @@ export var genAlertStyle = function genAlertStyle(token) {
58
58
  var height = token.fontSize * token.lineHeight;
59
59
  return _ref2 = {}, _defineProperty(_ref2, "".concat(componentCls), (_$concat2 = {
60
60
  // vertical align to flex-start
61
- alignItems: 'flex-start'
61
+ alignItems: 'flex-start !important'
62
62
  }, _defineProperty(_$concat2, "".concat(componentCls, "-icon"), {
63
63
  height: height
64
64
  }), _defineProperty(_$concat2, "".concat(componentCls, "-close-icon"), {
package/es/index.js CHANGED
@@ -1,5 +1,3 @@
1
- import { theme } from 'antd';
2
-
3
1
  // 引入 antd/dist/reset.css,以重置基本样式,保证原生元素遵从 antd 规范样式
4
2
  // ref: https://ant.design/docs/react/migration-v5-cn#%E6%8A%80%E6%9C%AF%E8%B0%83%E6%95%B4
5
3
  import 'antd/dist/reset.css';
@@ -20,7 +18,6 @@ export { default as Tooltip } from "./tooltip";
20
18
  export { default as Breadcrumb } from "./breadcrumb";
21
19
  export { default as Spin } from "./spin";
22
20
  export { default as Badge } from "./badge";
21
+ import theme from "./theme";
23
22
  var useToken = theme.useToken;
24
-
25
- // 直接导出 useToken,方便上层使用
26
23
  export { useToken };
@@ -1 +1,2 @@
1
+ export * from 'antd/es/menu/hooks/useItems';
1
2
  export * from 'antd/es/menu';
package/es/menu/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from 'antd/es/menu/hooks/useItems';
1
2
  export * from 'antd/es/menu';
@@ -4,7 +4,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
4
4
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
6
  export var genTableStyle = function genTableStyle(token) {
7
- var _$concat, _trTd$concat$co, _$concat4, _$concat$concat, _$concat7, _trNthChild2nNot, _$concat$concat4, _$concat14, _ref;
7
+ var _$concat, _trTd$concat$co, _$concat4, _$concat$concat, _$concat5, _$concat8, _trNthChild2nNot, _$concat$concat4, _$concat15, _ref;
8
8
  var antCls = token.antCls,
9
9
  componentCls = token.componentCls,
10
10
  colorTextBase = token.colorTextBase,
@@ -65,11 +65,15 @@ export var genTableStyle = function genTableStyle(token) {
65
65
  backgroundColor: "".concat(colorFillQuaternary, " !important")
66
66
  }), _defineProperty(_trTd$concat$co, "".concat(componentCls, "-tbody > tr:last-child"), _defineProperty({}, 'td:first-child, td:last-child', {
67
67
  borderRadius: borderRadiusLG
68
- })), _trTd$concat$co)), _$concat4)), _$concat$concat)), _defineProperty(_ref, "".concat(componentCls, "-wrapper"), (_$concat7 = {}, _defineProperty(_$concat7, "".concat(componentCls, ":not(").concat(componentCls, "-middle):not(").concat(componentCls, "-small)"), _defineProperty({}, "".concat(componentCls, "-thead > tr"), _defineProperty({}, 'td, th', {
68
+ })), _trTd$concat$co)), _$concat4)), _$concat$concat)), _defineProperty(_ref, "".concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-scroll-horizontal, ").concat(componentCls, "-wrapper ").concat(componentCls).concat(componentCls, "-fixed-header"), _defineProperty({}, "".concat(componentCls, "-tbody"), (_$concat5 = {}, _defineProperty(_$concat5, "tr:nth-child(2n + 1):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(antCls, "-descriptions-row) > td"), {
69
+ backgroundColor: colorFillQuaternary
70
+ }), _defineProperty(_$concat5, "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row):not(").concat(antCls, "-descriptions-row) > td"), {
71
+ backgroundColor: colorBgBase
72
+ }), _$concat5))), _defineProperty(_ref, "".concat(componentCls, "-wrapper"), (_$concat8 = {}, _defineProperty(_$concat8, "".concat(componentCls, ":not(").concat(componentCls, "-middle):not(").concat(componentCls, "-small)"), _defineProperty({}, "".concat(componentCls, "-thead > tr"), _defineProperty({}, 'td, th', {
69
73
  padding: largeCellPadding
70
- }))), _defineProperty(_$concat7, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
74
+ }))), _defineProperty(_$concat8, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
71
75
  padding: largeCellPadding
72
- })), _$concat7)), _defineProperty(_ref, "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable)"), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
76
+ })), _$concat8)), _defineProperty(_ref, "".concat(componentCls, "-wrapper:not(").concat(componentCls, "-expandable)"), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered)"), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:not(".concat(componentCls, "-measure-row) > td"), {
73
77
  border: 'none'
74
78
  })))), _defineProperty(_ref, "".concat(componentCls, "-wrapper").concat(componentCls, "-expandable"), (_$concat$concat4 = {}, _defineProperty(_$concat$concat4, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-tbody"), _defineProperty({}, "tr:nth-child(2n):not(".concat(componentCls, "-placeholder):not(").concat(componentCls, "-row-selected):not(").concat(componentCls, "-expanded-row)"), (_trNthChild2nNot = {}, _defineProperty(_trNthChild2nNot, '& > td', {
75
79
  backgroundColor: colorBgBase
@@ -79,11 +83,11 @@ export var genTableStyle = function genTableStyle(token) {
79
83
  }
80
84
  }), _trNthChild2nNot)))), _defineProperty(_$concat$concat4, "".concat(componentCls, "-pagination"), _defineProperty({}, "&".concat(antCls, "-pagination"), {
81
85
  borderTop: 'none'
82
- })), _$concat$concat4)), _defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), (_$concat14 = {}, _defineProperty(_$concat14, "&".concat(antCls, "-pagination"), {
86
+ })), _$concat$concat4)), _defineProperty(_ref, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-pagination"), (_$concat15 = {}, _defineProperty(_$concat15, "&".concat(antCls, "-pagination"), {
83
87
  padding: "".concat(padding, "px 0"),
84
88
  margin: '0 !important',
85
89
  borderTop: "1px solid ".concat(colorBorderSecondary)
86
- }), _defineProperty(_$concat14, "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
90
+ }), _defineProperty(_$concat15, "".concat(componentCls, "-batch-operation-bar"), _defineProperty({
87
91
  position: 'absolute',
88
92
  left: 0,
89
93
  display: 'inline-block',
@@ -94,7 +98,7 @@ export var genTableStyle = function genTableStyle(token) {
94
98
  }, "".concat(componentCls, "-batch-operation-selection-count"), {
95
99
  margin: "0 ".concat(marginXS, "px"),
96
100
  color: colorLink
97
- }))), _$concat14))), _defineProperty(_ref, "".concat(antCls, "-popover").concat(componentCls, "-batch-operation-selection-popover"), _defineProperty({}, "".concat(antCls, "-popover-inner"), {
101
+ }))), _$concat15))), _defineProperty(_ref, "".concat(antCls, "-popover").concat(componentCls, "-batch-operation-selection-popover"), _defineProperty({}, "".concat(antCls, "-popover-inner"), {
98
102
  padding: 0
99
103
  })), _ref;
100
104
  };
@@ -64,7 +64,6 @@ declare const _default: {
64
64
  colorFillTertiary: string;
65
65
  colorFillSecondary: string;
66
66
  colorFill: string;
67
- colorIcon: string;
68
67
  boxShadowSecondary: string;
69
68
  boxShadow: string;
70
69
  borderRadius: number;
@@ -4,7 +4,7 @@ export default {
4
4
  colorPrimaryBgHover: '#EAF1FF',
5
5
  colorPrimaryBorder: '#B3CCFF',
6
6
  colorPrimaryBorderHover: '#5189FB',
7
- colorPrimaryHover: '#004CE6',
7
+ colorPrimaryHover: '#5189FB',
8
8
  colorPrimaryTextHover: '#5189FB',
9
9
  colorPrimaryText: '#006AFF',
10
10
  colorPrimaryTextActive: '#004CE6',
@@ -60,11 +60,10 @@ export default {
60
60
  colorBgMask: 'rgba(19, 32, 57, 0.65)',
61
61
  colorBorder: '#CDD5E4',
62
62
  colorBorderSecondary: '#E2E8F3',
63
- colorFillQuaternary: 'rgb(245, 248, 254, 0.45)',
64
- colorFillTertiary: 'rgb(245, 248, 254, 0.65)',
65
- colorFillSecondary: 'rgb(245, 248, 254, 0.85)',
63
+ colorFillQuaternary: '#F8FAFE',
64
+ colorFillTertiary: '#F5F8FE',
65
+ colorFillSecondary: '#F5F8FE',
66
66
  colorFill: '#F5F8FE',
67
- colorIcon: '#8592AD',
68
67
  boxShadowSecondary: '0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05)',
69
68
  boxShadow: '0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02)',
70
69
  borderRadius: 6,
@@ -51,6 +51,9 @@ declare const _default: {
51
51
  };
52
52
  defaultConfig: {
53
53
  token: import("antd/es/theme/internal").SeedToken;
54
+ override: {
55
+ override: import("antd/es/theme/internal").SeedToken;
56
+ };
54
57
  hashed: boolean;
55
58
  };
56
59
  components: {
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/_util/genComponentStyleHook.ts
@@ -23,6 +33,7 @@ __export(genComponentStyleHook_exports, {
23
33
  });
24
34
  module.exports = __toCommonJS(genComponentStyleHook_exports);
25
35
  var import_internal = require("antd/es/theme/internal");
36
+ var import_theme = __toESM(require("../theme"));
26
37
  function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
27
38
  return (prefixCls) => {
28
39
  const useStyle = (0, import_internal.genComponentStyleHook)(
@@ -32,7 +43,8 @@ function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
32
43
  },
33
44
  getDefaultToken
34
45
  );
35
- const [wrapSSR, hashId] = useStyle(prefixCls);
46
+ const [wrapSSR] = useStyle(prefixCls);
47
+ const { hashId } = import_theme.default.useToken();
36
48
  return {
37
49
  wrapSSR,
38
50
  hashId
@@ -84,7 +84,7 @@ var genAlertStyle = (token) => {
84
84
  return {
85
85
  [`${componentCls}`]: {
86
86
  // vertical align to flex-start
87
- alignItems: "flex-start",
87
+ alignItems: "flex-start !important",
88
88
  [`${componentCls}-icon`]: {
89
89
  height
90
90
  },
package/lib/index.js CHANGED
@@ -51,7 +51,6 @@ __export(src_exports, {
51
51
  version: () => import_package.version
52
52
  });
53
53
  module.exports = __toCommonJS(src_exports);
54
- var import_antd = require("antd");
55
54
  var import_reset = require("antd/dist/reset.css");
56
55
  __reExport(src_exports, require("antd"), module.exports);
57
56
  var import_package = require("../package.json");
@@ -70,7 +69,8 @@ var import_tooltip = __toESM(require("./tooltip"));
70
69
  var import_breadcrumb = __toESM(require("./breadcrumb"));
71
70
  var import_spin = __toESM(require("./spin"));
72
71
  var import_badge = __toESM(require("./badge"));
73
- var { useToken } = import_antd.theme;
72
+ var import_theme2 = __toESM(require("./theme"));
73
+ var { useToken } = import_theme2.default;
74
74
  // Annotate the CommonJS export names for ESM import in node:
75
75
  0 && (module.exports = {
76
76
  Alert,
@@ -1 +1,2 @@
1
+ export * from 'antd/es/menu/hooks/useItems';
1
2
  export * from 'antd/es/menu';
package/lib/menu/index.js CHANGED
@@ -16,8 +16,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // src/menu/index.ts
17
17
  var menu_exports = {};
18
18
  module.exports = __toCommonJS(menu_exports);
19
+ __reExport(menu_exports, require("antd/es/menu/hooks/useItems"), module.exports);
19
20
  __reExport(menu_exports, require("antd/es/menu"), module.exports);
20
21
  // Annotate the CommonJS export names for ESM import in node:
21
22
  0 && (module.exports = {
23
+ ...require("antd/es/menu/hooks/useItems"),
22
24
  ...require("antd/es/menu")
23
25
  });
@@ -121,6 +121,21 @@ var genTableStyle = (token) => {
121
121
  }
122
122
  }
123
123
  },
124
+ // 滚动表格样式
125
+ // 由于滚动表格会在 tbody 下最前面多一个 tr 元素,因此需要设置相反的斑马条样式
126
+ // .ant-table-scroll-horizontal: 水平滚动
127
+ // .ant-table-fixed-header: 垂直滚动
128
+ [`${componentCls}-wrapper ${componentCls}${componentCls}-scroll-horizontal, ${componentCls}-wrapper ${componentCls}${componentCls}-fixed-header`]: {
129
+ [`${componentCls}-tbody`]: {
130
+ // 斑马纹样式
131
+ [`tr:nth-child(2n + 1):not(${componentCls}-placeholder):not(${componentCls}-row-selected):not(${antCls}-descriptions-row) > td`]: {
132
+ backgroundColor: colorFillQuaternary
133
+ },
134
+ [`tr:nth-child(2n):not(${componentCls}-placeholder):not(${componentCls}-row-selected):not(${componentCls}-expanded-row):not(${antCls}-descriptions-row) > td`]: {
135
+ backgroundColor: colorBgBase
136
+ }
137
+ }
138
+ },
124
139
  // large 表格样式
125
140
  [`${componentCls}-wrapper`]: {
126
141
  [`${componentCls}:not(${componentCls}-middle):not(${componentCls}-small)`]: {
@@ -64,7 +64,6 @@ declare const _default: {
64
64
  colorFillTertiary: string;
65
65
  colorFillSecondary: string;
66
66
  colorFill: string;
67
- colorIcon: string;
68
67
  boxShadowSecondary: string;
69
68
  boxShadow: string;
70
69
  borderRadius: number;
@@ -28,7 +28,7 @@ var default_default = {
28
28
  colorPrimaryBgHover: "#EAF1FF",
29
29
  colorPrimaryBorder: "#B3CCFF",
30
30
  colorPrimaryBorderHover: "#5189FB",
31
- colorPrimaryHover: "#004CE6",
31
+ colorPrimaryHover: "#5189FB",
32
32
  colorPrimaryTextHover: "#5189FB",
33
33
  colorPrimaryText: "#006AFF",
34
34
  colorPrimaryTextActive: "#004CE6",
@@ -84,11 +84,10 @@ var default_default = {
84
84
  colorBgMask: "rgba(19, 32, 57, 0.65)",
85
85
  colorBorder: "#CDD5E4",
86
86
  colorBorderSecondary: "#E2E8F3",
87
- colorFillQuaternary: "rgb(245, 248, 254, 0.45)",
88
- colorFillTertiary: "rgb(245, 248, 254, 0.65)",
89
- colorFillSecondary: "rgb(245, 248, 254, 0.85)",
87
+ colorFillQuaternary: "#F8FAFE",
88
+ colorFillTertiary: "#F5F8FE",
89
+ colorFillSecondary: "#F5F8FE",
90
90
  colorFill: "#F5F8FE",
91
- colorIcon: "#8592AD",
92
91
  boxShadowSecondary: "0 6px 16px 0 rgba(54, 69, 99, 0.08), 0 3px 6px -4px rgba(54, 69, 99, 0.12), 0 9px 28px 8px rgba(54, 69, 99, 0.05)",
93
92
  boxShadow: "0 1px 2px 0 rgba(54, 69, 99, 0.03), 0 1px 6px -1px rgba(54, 69, 99, 0.02), 0 2px 4px 0 rgba(54, 69, 99, 0.02)",
94
93
  borderRadius: 6,
@@ -51,6 +51,9 @@ declare const _default: {
51
51
  };
52
52
  defaultConfig: {
53
53
  token: import("antd/es/theme/internal").SeedToken;
54
+ override: {
55
+ override: import("antd/es/theme/internal").SeedToken;
56
+ };
54
57
  hashed: boolean;
55
58
  };
56
59
  components: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/design",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "The Design System of OceanBase",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -35,26 +35,26 @@
35
35
  "postbuild": "cp src/style/reset.css dist/"
36
36
  },
37
37
  "dependencies": {
38
- "@ant-design/cssinjs": "^1.17.0",
39
- "@oceanbase/icons": "^0.2.7",
40
- "@oceanbase/util": "^0.2.9",
38
+ "@ant-design/cssinjs": "^1.17.2",
39
+ "@oceanbase/icons": "^0.2.8",
40
+ "@oceanbase/util": "^0.2.10",
41
41
  "ahooks": "^2.10.14",
42
- "antd": "^5.9.0",
42
+ "antd": "^5.10.1",
43
43
  "classnames": "^2.3.2",
44
44
  "lodash": "^4.17.21",
45
45
  "lottie-web": "^5.12.2",
46
46
  "prop-types": "^15.8.1",
47
- "rc-util": "^5.37.0",
47
+ "rc-util": "^5.38.0",
48
48
  "react-sticky-mouse-tooltip": "^0.0.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@babel/cli": "^7.23.0",
52
- "@babel/preset-env": "^7.22.20",
52
+ "@babel/preset-env": "^7.23.2",
53
53
  "antd-token-previewer": "^1.1.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": ">=16.9.0",
57
57
  "react-dom": ">=16.9.0"
58
58
  },
59
- "gitHead": "38becd333620011d0d084df62b1131135a396abb"
59
+ "gitHead": "1138341df7a35d3d4939ccea79225ddf220de2cc"
60
60
  }