@oceanbase/design 1.0.0-alpha.8 → 1.0.0-alpha.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.
Files changed (48) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/card/index.d.ts +2 -0
  3. package/es/card/index.js +33 -13
  4. package/es/card/style/index.js +36 -20
  5. package/es/checkbox/style/index.js +5 -3
  6. package/es/config-provider/index.js +3 -1
  7. package/es/descriptions/hooks/useItems.d.ts +9 -9
  8. package/es/descriptions/index.d.ts +10 -0
  9. package/es/descriptions/index.js +59 -3
  10. package/es/descriptions/style/index.js +48 -5
  11. package/es/drawer/style/index.js +11 -5
  12. package/es/slider/style/index.js +3 -2
  13. package/es/style/cssVariables.d.ts +25 -0
  14. package/es/style/cssVariables.js +48 -0
  15. package/es/style/cssVariablesMeta.d.ts +24 -0
  16. package/es/style/cssVariablesMeta.js +974 -0
  17. package/es/table/index.js +8 -0
  18. package/es/table/style/index.js +9 -3
  19. package/es/tag/style/index.js +1 -1
  20. package/es/theme/default.d.ts +44 -0
  21. package/es/theme/default.js +159 -40
  22. package/es/theme/interface.d.ts +43 -0
  23. package/es/theme/style/compact.less +43 -24
  24. package/es/theme/style/default.less +43 -24
  25. package/lib/card/index.d.ts +2 -0
  26. package/lib/card/index.js +27 -12
  27. package/lib/card/style/index.js +61 -29
  28. package/lib/checkbox/style/index.js +4 -3
  29. package/lib/config-provider/index.js +3 -0
  30. package/lib/descriptions/hooks/useItems.d.ts +9 -9
  31. package/lib/descriptions/index.d.ts +10 -0
  32. package/lib/descriptions/index.js +49 -2
  33. package/lib/descriptions/style/index.js +85 -4
  34. package/lib/drawer/style/index.js +9 -4
  35. package/lib/slider/style/index.js +5 -2
  36. package/lib/style/cssVariables.d.ts +25 -0
  37. package/lib/style/cssVariables.js +261 -0
  38. package/lib/style/cssVariablesMeta.d.ts +24 -0
  39. package/lib/style/cssVariablesMeta.js +1059 -0
  40. package/lib/table/index.js +7 -0
  41. package/lib/table/style/index.js +10 -1
  42. package/lib/tag/style/index.js +1 -1
  43. package/lib/theme/default.d.ts +44 -0
  44. package/lib/theme/default.js +232 -42
  45. package/lib/theme/interface.d.ts +43 -0
  46. package/lib/theme/style/compact.less +43 -24
  47. package/lib/theme/style/default.less +43 -24
  48. package/package.json +2 -2
@@ -0,0 +1,48 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ /**
6
+ * OceanBase Design System - CSS Variables Style
7
+ * 使用 @ant-design/cssinjs 动态注入 CSS 变量
8
+ * 根据主题 token 值动态生成
9
+ */
10
+
11
+ import React from 'react';
12
+ import { useStyleRegister } from '@ant-design/cssinjs';
13
+ import themeConfig from "../theme";
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ /**
17
+ * 根据 token 生成 CSS 变量样式
18
+ */
19
+ var genCssVariablesStyle = function genCssVariablesStyle(token) {
20
+ var _root;
21
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ob';
22
+ return [{
23
+ ':root': (_root = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-white"), token.white), "--".concat(prefix, "-gray-1"), token.gray1), "--".concat(prefix, "-gray-2"), token.gray2), "--".concat(prefix, "-gray-3"), token.gray3), "--".concat(prefix, "-gray-4"), token.gray4), "--".concat(prefix, "-gray-5"), token.gray5), "--".concat(prefix, "-gray-6"), token.gray6), "--".concat(prefix, "-gray-7"), token.gray7), "--".concat(prefix, "-gray-8"), token.gray8), "--".concat(prefix, "-gray-9"), token.gray9), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-gray-10"), token.colorText), "--".concat(prefix, "-black"), token.black), "--".concat(prefix, "-blue-1"), token.blue1), "--".concat(prefix, "-blue-2"), token.blue2), "--".concat(prefix, "-blue-3"), token.blue3), "--".concat(prefix, "-blue-4"), token.blue4), "--".concat(prefix, "-blue-5"), token.blue5), "--".concat(prefix, "-blue-6"), token.blue6), "--".concat(prefix, "-green-1"), token.green1), "--".concat(prefix, "-green-2"), token.green2), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-green-3"), token.green3), "--".concat(prefix, "-green-4"), token.green4), "--".concat(prefix, "-green-5"), token.green5), "--".concat(prefix, "-green-6"), token.green6), "--".concat(prefix, "-orange-1"), token.orange1), "--".concat(prefix, "-orange-2"), token.orange2), "--".concat(prefix, "-orange-3"), token.orange3), "--".concat(prefix, "-orange-4"), token.orange4), "--".concat(prefix, "-orange-5"), token.orange5), "--".concat(prefix, "-orange-6"), token.orange6), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-red-1"), token.red1), "--".concat(prefix, "-red-2"), token.red2), "--".concat(prefix, "-red-3"), token.red3), "--".concat(prefix, "-red-4"), token.red4), "--".concat(prefix, "-red-5"), token.red5), "--".concat(prefix, "-red-6"), token.red6), "--".concat(prefix, "-fuchsia-1"), token.fuchsia1), "--".concat(prefix, "-fuchsia-2"), token.fuchsia2), "--".concat(prefix, "-fuchsia-3"), token.fuchsia3), "--".concat(prefix, "-fuchsia-4"), token.fuchsia4), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-fuchsia-5"), token.fuchsia5), "--".concat(prefix, "-fuchsia-6"), token.fuchsia6), "--".concat(prefix, "-color-bg-default"), token.colorBgContainer), "--".concat(prefix, "-color-bg-primary"), token.gray1), "--".concat(prefix, "-color-bg-secondary"), token.gray2), "--".concat(prefix, "-color-bg-hover"), token.gray2), "--".concat(prefix, "-color-bg-hover-secondary"), token.gray3), "--".concat(prefix, "-color-bg-focus"), token.gray3), "--".concat(prefix, "-color-bg-active"), token.blue4), "--".concat(prefix, "-color-bg-disabled"), token.gray3), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-color-divider"), token.gray4), "--".concat(prefix, "-color-border-default"), token.gray5), "--".concat(prefix, "-color-border-container"), token.gray4), "--".concat(prefix, "-color-border-inverse"), token.white), "--".concat(prefix, "-color-border-hover"), token.blue4), "--".concat(prefix, "-color-border-focus"), token.blue4), "--".concat(prefix, "-color-border-error"), token.red4), "--".concat(prefix, "-color-border-warning"), token.orange4), "--".concat(prefix, "-color-text-default"), token.colorText), "--".concat(prefix, "-color-text-navigation"), token.gray9), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-color-text-label"), token.gray8), "--".concat(prefix, "-color-text-info"), token.gray7), "--".concat(prefix, "-color-text-disabled"), token.gray6), "--".concat(prefix, "-color-text-focus"), token.colorText), "--".concat(prefix, "-color-text-selected"), token.blue4), "--".concat(prefix, "-color-text-link"), token.blue4), "--".concat(prefix, "-color-text-inverse"), token.white), "--".concat(prefix, "-color-icon-default"), token.gray8), "--".concat(prefix, "-color-icon-hover"), token.blue4), "--".concat(prefix, "-color-icon-disabled"), token.gray6), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-color-icon-focus"), token.blue4), "--".concat(prefix, "-color-icon-inverse"), token.white), "--".concat(prefix, "-color-icon-info"), token.blue4), "--".concat(prefix, "-color-icon-warning"), token.orange4), "--".concat(prefix, "-color-icon-success"), token.green4), "--".concat(prefix, "-color-icon-error"), token.red4), "--".concat(prefix, "-color-default-text"), token.colorText), "--".concat(prefix, "-color-default-icon"), token.gray8), "--".concat(prefix, "-color-default-fill"), token.gray2), "--".concat(prefix, "-color-default-border"), token.gray2), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-color-info-text"), token.blue6), "--".concat(prefix, "-color-info-icon"), token.blue6), "--".concat(prefix, "-color-info-fill"), token.blue1), "--".concat(prefix, "-color-info-border"), token.blue3), "--".concat(prefix, "-color-success-text"), token.green6), "--".concat(prefix, "-color-success-icon"), token.green6), "--".concat(prefix, "-color-success-fill"), token.green1), "--".concat(prefix, "-color-success-border"), token.green3), "--".concat(prefix, "-color-warning-text"), token.orange6), "--".concat(prefix, "-color-warning-icon"), token.orange6), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-color-warning-fill"), token.orange1), "--".concat(prefix, "-color-warning-border"), token.orange3), "--".concat(prefix, "-color-error-text"), token.red6), "--".concat(prefix, "-color-error-icon"), token.red6), "--".concat(prefix, "-color-error-fill"), token.red1), "--".concat(prefix, "-color-error-border"), token.red3), "--".concat(prefix, "-color-critical-text"), token.fuchsia6), "--".concat(prefix, "-color-critical-icon"), token.fuchsia6), "--".concat(prefix, "-color-critical-fill"), token.fuchsia1), "--".concat(prefix, "-color-critical-border"), token.fuchsia3), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-font-family-default"), token.fontFamily), "--".concat(prefix, "-font-weight-sm"), token.fontWeightWeak), "--".concat(prefix, "-font-weight-md"), token.fontWeight), "--".concat(prefix, "-font-weight-lg"), token.fontWeightStrong), "--".concat(prefix, "-font-size-300"), "".concat(token.fontSizeSM, "px")), "--".concat(prefix, "-font-size-325"), "".concat(token.fontSize, "px")), "--".concat(prefix, "-font-size-400"), "".concat(token.fontSizeLG, "px")), "--".concat(prefix, "-font-size-450"), "".concat(token.fontSizeHeading3, "px")), "--".concat(prefix, "-font-size-500"), "".concat(token.fontSizeHeading2, "px")), "--".concat(prefix, "-font-line-height-500"), '20px'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-font-line-height-600"), '24px'), "--".concat(prefix, "-font-line-height-650"), '26px'), "--".concat(prefix, "-font-line-height-700"), '28px'), "--".concat(prefix, "-font-h1"), "".concat(token.fontWeightStrong, " ").concat(token.fontSizeHeading2, "px/var(--").concat(prefix, "-font-line-height-700) ").concat(token.fontFamily)), "--".concat(prefix, "-font-h2"), "".concat(token.fontWeightStrong, " ").concat(token.fontSizeHeading3, "px/var(--").concat(prefix, "-font-line-height-650) ").concat(token.fontFamily)), "--".concat(prefix, "-font-h3"), "".concat(token.fontWeightStrong, " ").concat(token.fontSizeLG, "px/var(--").concat(prefix, "-font-line-height-600) ").concat(token.fontFamily)), "--".concat(prefix, "-font-h4"), "".concat(token.fontWeightStrong, " ").concat(token.fontSize, "px/var(--").concat(prefix, "-font-line-height-500) ").concat(token.fontFamily)), "--".concat(prefix, "-font-body1"), "".concat(token.fontWeight, " ").concat(token.fontSize, "px/var(--").concat(prefix, "-font-line-height-500) ").concat(token.fontFamily)), "--".concat(prefix, "-font-body2"), "".concat(token.fontWeightWeak, " ").concat(token.fontSizeSM, "px/var(--").concat(prefix, "-font-line-height-500) ").concat(token.fontFamily)), "--".concat(prefix, "-font-caption"), "".concat(token.fontWeightWeak, " ").concat(token.fontSizeSM, "px/var(--").concat(prefix, "-font-line-height-500) ").concat(token.fontFamily)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-shadow-1-top"), '0px -1px 2px 0px hsla(219, 50%, 15%, 0.1)'), "--".concat(prefix, "-shadow-1-bottom"), '0px 1px 2px 0px hsla(219, 50%, 15%, 0.1)'), "--".concat(prefix, "-shadow-1-left"), '-1px 0px 2px 0px hsla(219, 50%, 15%, 0.1)'), "--".concat(prefix, "-shadow-1-right"), '1px 0px 2px 0px hsla(219, 50%, 15%, 0.1)'), "--".concat(prefix, "-shadow-2"), token.boxShadowSecondary), "--".concat(prefix, "-radius-sm"), "".concat(token.borderRadius, "px")), "--".concat(prefix, "-radius-md"), "".concat(token.borderRadiusMD, "px")), "--".concat(prefix, "-radius-lg"), "".concat(token.borderRadiusLG, "px")), "--".concat(prefix, "-space-0"), '0px'), "--".concat(prefix, "-space-50"), '2px'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-space-100"), "".concat(token.paddingXXS, "px")), "--".concat(prefix, "-space-150"), '6px'), "--".concat(prefix, "-space-200"), "".concat(token.paddingXS, "px")), "--".concat(prefix, "-space-300"), "".concat(token.paddingSM, "px")), "--".concat(prefix, "-space-400"), "".concat(token.padding, "px")), "--".concat(prefix, "-space-500"), "".concat(token.paddingMD, "px")), "--".concat(prefix, "-space-600"), "".concat(token.paddingLG, "px")), "--".concat(prefix, "-space-800"), "".concat(token.paddingXL, "px")), "--".concat(prefix, "-spacing-negative-25"), '-1px'), "--".concat(prefix, "-navi-color-bg"), token.colorNaviBg), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-navi-color-bg-hover"), token.colorNaviBgHover), "--".concat(prefix, "-navi-color-bg-focus"), token.colorNaviBgHover), "--".concat(prefix, "-btn-color-primary-bg"), token.blue4), "--".concat(prefix, "-btn-color-primary-bg-hover"), token.blue5), "--".concat(prefix, "-btn-color-primary-bg-disabled"), token.blue3), "--".concat(prefix, "-btn-color-primary-text"), token.white), "--".concat(prefix, "-btn-color-primary-icon"), token.white), "--".concat(prefix, "-btn-color-secondary-border"), token.blue4), "--".concat(prefix, "-btn-color-secondary-text"), token.blue4), "--".concat(prefix, "-btn-color-secondary-icon"), token.blue4), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_root, "--".concat(prefix, "-btn-color-danger-border"), token.red4), "--".concat(prefix, "-btn-color-danger-text"), token.red4), "--".concat(prefix, "-progress-color-bg-default"), token.gray4), "--".concat(prefix, "-progress-color-bg-loading"), token.blue4), "--".concat(prefix, "-progress-color-bg-success"), token.green4), "--".concat(prefix, "-progress-color-bg-error"), token.red4), "--".concat(prefix, "-switch-color-bg-default"), token.gray7), "--".concat(prefix, "-switch-color-bg-disabled"), token.gray4), "--".concat(prefix, "-switch-color-bg-active"), token.blue4), "--".concat(prefix, "-switch-color-bg-disabled-selected"), token.gray5))
24
+ }];
25
+ };
26
+ /**
27
+ * CSS 变量注入组件
28
+ * 使用 @ant-design/cssinjs 动态注入 CSS 变量
29
+ */
30
+ var CssVariablesStyle = function CssVariablesStyle(_ref) {
31
+ var _ref$prefix = _ref.prefix,
32
+ prefix = _ref$prefix === void 0 ? 'ob' : _ref$prefix;
33
+ var _themeConfig$useToken = themeConfig.useToken(),
34
+ theme = _themeConfig$useToken.theme,
35
+ token = _themeConfig$useToken.token;
36
+ var wrapSSR = useStyleRegister({
37
+ theme: theme,
38
+ token: token,
39
+ path: ['ob-css-variables'],
40
+ hashId: '',
41
+ order: -1001 // 在全局样式之前注入
42
+ }, function () {
43
+ return genCssVariablesStyle(token, prefix);
44
+ });
45
+ return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {}));
46
+ };
47
+ export { CssVariablesStyle, genCssVariablesStyle };
48
+ export default CssVariablesStyle;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CSS Variables Metadata
3
+ * CSS 变量元数据定义,用于文档展示
4
+ */
5
+ export type CssVariableCategory = 'color' | 'color-bg' | 'color-border' | 'color-text' | 'color-icon' | 'color-status' | 'font' | 'shadow' | 'radius' | 'space' | 'component';
6
+ export interface CssVariableMeta {
7
+ /** 变量名 (不含前缀) */
8
+ name: string;
9
+ /** 描述 */
10
+ desc: string;
11
+ /** 英文描述 */
12
+ descEn?: string;
13
+ /** 分类 */
14
+ category: CssVariableCategory;
15
+ /** token 来源 (用于获取值) */
16
+ token?: string;
17
+ /** 固定值 (非 token) */
18
+ value?: string;
19
+ }
20
+ /**
21
+ * CSS 变量元数据
22
+ */
23
+ export declare const cssVariablesMeta: CssVariableMeta[];
24
+ export default cssVariablesMeta;