@oceanbase/design 1.0.0-alpha.7 → 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 (56) 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 +13 -11
  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/form/FormItem.d.ts +1 -1
  13. package/es/form/FormItem.js +7 -9
  14. package/es/form/style/index.js +9 -9
  15. package/es/slider/style/index.js +3 -2
  16. package/es/style/cssVariables.d.ts +25 -0
  17. package/es/style/cssVariables.js +48 -0
  18. package/es/style/cssVariablesMeta.d.ts +24 -0
  19. package/es/style/cssVariablesMeta.js +974 -0
  20. package/es/style/global.js +4 -4
  21. package/es/table/index.js +8 -0
  22. package/es/table/style/index.js +9 -3
  23. package/es/tag/style/index.js +1 -1
  24. package/es/theme/default.d.ts +44 -0
  25. package/es/theme/default.js +159 -40
  26. package/es/theme/interface.d.ts +43 -0
  27. package/es/theme/style/compact.less +43 -24
  28. package/es/theme/style/default.less +43 -24
  29. package/lib/card/index.d.ts +2 -0
  30. package/lib/card/index.js +27 -12
  31. package/lib/card/style/index.js +61 -29
  32. package/lib/checkbox/style/index.js +4 -3
  33. package/lib/config-provider/index.js +15 -4
  34. package/lib/descriptions/hooks/useItems.d.ts +9 -9
  35. package/lib/descriptions/index.d.ts +10 -0
  36. package/lib/descriptions/index.js +49 -2
  37. package/lib/descriptions/style/index.js +85 -4
  38. package/lib/drawer/style/index.js +9 -4
  39. package/lib/form/FormItem.d.ts +1 -1
  40. package/lib/form/FormItem.js +5 -6
  41. package/lib/form/style/index.js +13 -11
  42. package/lib/slider/style/index.js +5 -2
  43. package/lib/style/cssVariables.d.ts +25 -0
  44. package/lib/style/cssVariables.js +261 -0
  45. package/lib/style/cssVariablesMeta.d.ts +24 -0
  46. package/lib/style/cssVariablesMeta.js +1059 -0
  47. package/lib/style/global.js +4 -4
  48. package/lib/table/index.js +7 -0
  49. package/lib/table/style/index.js +10 -1
  50. package/lib/tag/style/index.js +1 -1
  51. package/lib/theme/default.d.ts +44 -0
  52. package/lib/theme/default.js +232 -42
  53. package/lib/theme/interface.d.ts +43 -0
  54. package/lib/theme/style/compact.less +43 -24
  55. package/lib/theme/style/default.less +43 -24
  56. package/package.json +2 -2
@@ -17,7 +17,6 @@ import ConfigProvider from "../config-provider";
17
17
  import { useTooltipTypeList } from "../tooltip/hooks/useTooltipTypeList";
18
18
  import useStyle from "./style";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
- import { Fragment as _Fragment } from "react/jsx-runtime";
21
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
21
  var AntFormItem = AntForm.Item;
23
22
  export * from 'antd/es/form/FormItem';
@@ -67,13 +66,14 @@ var FormItem = function FormItem(_ref) {
67
66
  className: "".concat(prefixCls, "-item-description"),
68
67
  children: description
69
68
  }) : null;
69
+ var actionContent = action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsx("span", {
70
+ className: "".concat(prefixCls, "-item-action"),
71
+ children: action
72
+ }) : null;
70
73
  return wrapSSR( /*#__PURE__*/_jsx(AntFormItem, _objectSpread(_objectSpread({
71
74
  layout: layout,
72
- label: action && (layout === 'vertical' || vertical) ? /*#__PURE__*/_jsxs(_Fragment, {
73
- children: [label, action && /*#__PURE__*/_jsx("span", {
74
- className: "".concat(prefixCls, "-item-action"),
75
- children: action
76
- })]
75
+ label: actionContent || descriptionContent ? /*#__PURE__*/_jsxs("div", {
76
+ children: [label, actionContent, descriptionContent]
77
77
  }) : label,
78
78
  tooltip: tooltip
79
79
  // auto set required for Switch children to hide optional mark
@@ -83,9 +83,7 @@ var FormItem = function FormItem(_ref) {
83
83
  prefixCls: customizePrefixCls,
84
84
  className: formItemCls
85
85
  }, restProps), {}, {
86
- children: /*#__PURE__*/_jsxs(_Fragment, {
87
- children: [descriptionContent, children]
88
- })
86
+ children: children
89
87
  })));
90
88
  };
91
89
  FormItem.useStatus = AntFormItem.useStatus;
@@ -11,20 +11,20 @@ export var genFormStyle = function genFormStyle(token) {
11
11
  fontSize: token.fontSizeSM
12
12
  }), "".concat(componentCls, "-item-explain + ").concat(componentCls, "-item-extra"), {
13
13
  paddingTop: 0
14
- })), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty({}, "".concat(componentCls, "-item-label > label"), _defineProperty({
15
- width: '100%'
16
- }, "".concat(componentCls, "-item-action"), {
17
- position: 'absolute',
18
- right: 0
19
- }))), "".concat(componentCls, "-item-has-description"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
14
+ })), "".concat(componentCls).concat(componentCls, "-vertical"), _defineProperty({}, "".concat(componentCls, "-item:not(").concat(componentCls, "-item-horizontal)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-item-control-input"), {
20
15
  minHeight: 'auto'
21
16
  }), "".concat(componentCls, "-item-label"), {
22
- paddingBottom: token.paddingXXS
17
+ paddingBottom: calc(token.paddingXXS).add(2).equal()
23
18
  }), "".concat(componentCls, "-item-description"), {
24
- paddingBottom: calc(token.paddingXXS).add(2).equal(),
19
+ paddingTop: token.paddingXXS,
25
20
  fontSize: token.fontSizeSM,
26
21
  color: token.colorTextDescription
27
- })));
22
+ }), "".concat(componentCls, "-item-label > label"), _defineProperty({
23
+ width: '100%'
24
+ }, "".concat(componentCls, "-item-action"), {
25
+ position: 'absolute',
26
+ right: 0
27
+ }))));
28
28
  };
29
29
  export default (function (prefixCls) {
30
30
  var useStyle = genComponentStyleHook('Form', function (token) {
@@ -2,6 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
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
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
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
+ import { unit } from '@ant-design/cssinjs';
5
6
  import { genComponentStyleHook } from "../../_util/genComponentStyleHook";
6
7
  export var genSliderStyle = function genSliderStyle(token) {
7
8
  var componentCls = token.componentCls,
@@ -12,8 +13,8 @@ export var genSliderStyle = function genSliderStyle(token) {
12
13
  _token$handleLineWidt = token.handleLineWidth,
13
14
  handleLineWidth = _token$handleLineWidt === void 0 ? 2 : _token$handleLineWidt,
14
15
  calc = token.calc;
15
- var dotSizeHalf = calc(dotSize).div(2).equal();
16
- var handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
16
+ var dotSizeHalf = unit(calc(dotSize).div(2).equal());
17
+ var handleOffset = unit(calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal());
17
18
  return _defineProperty({}, "".concat(componentCls).concat(componentCls, "-horizontal"), _defineProperty({}, "".concat(componentCls, "-mark"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-mark-text[style*=\"left: 0%;\"]"), {
18
19
  transform: "translateX(calc(0% - ".concat(dotSizeHalf, ")) !important")
19
20
  }), "".concat(componentCls, "-mark-text[style*=\"left: 100%;\"]"), {
@@ -0,0 +1,25 @@
1
+ /**
2
+ * OceanBase Design System - CSS Variables Style
3
+ * 使用 @ant-design/cssinjs 动态注入 CSS 变量
4
+ * 根据主题 token 值动态生成
5
+ */
6
+ import React from 'react';
7
+ import type { CSSInterpolation } from '@ant-design/cssinjs';
8
+ import type { GlobalToken } from '../theme/interface';
9
+ /**
10
+ * 根据 token 生成 CSS 变量样式
11
+ */
12
+ declare const genCssVariablesStyle: (token: GlobalToken, prefix?: string) => CSSInterpolation;
13
+ export interface CssVariablesStyleProps {
14
+ /**
15
+ * CSS 变量前缀,默认为 'ob'
16
+ */
17
+ prefix?: string;
18
+ }
19
+ /**
20
+ * CSS 变量注入组件
21
+ * 使用 @ant-design/cssinjs 动态注入 CSS 变量
22
+ */
23
+ declare const CssVariablesStyle: React.FC<CssVariablesStyleProps>;
24
+ export { CssVariablesStyle, genCssVariablesStyle };
25
+ export default CssVariablesStyle;
@@ -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;