@digitalc/dxp-ui 0.0.6-alpha.14 → 0.0.6-alpha.16

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 (47) hide show
  1. package/es/components/Form/designTokens.d.ts +2 -2
  2. package/es/components/Form/designTokens.js +2 -2
  3. package/es/components/Input/designTokens.d.ts +2 -0
  4. package/es/components/Input/designTokens.js +4 -1
  5. package/es/style/themes/font-local.css +0 -25
  6. package/es/style/themes/fonts-optimized.css +0 -24
  7. package/es/utils/TokenContext.js +14 -3
  8. package/es/utils/fontLoader.js +2 -2
  9. package/lib/components/Form/designTokens.d.ts +2 -2
  10. package/lib/components/Form/designTokens.js +2 -2
  11. package/lib/components/Input/designTokens.d.ts +2 -0
  12. package/lib/components/Input/designTokens.js +4 -1
  13. package/lib/style/themes/font-local.css +0 -25
  14. package/lib/style/themes/fonts-optimized.css +0 -24
  15. package/lib/utils/TokenContext.js +14 -1
  16. package/lib/utils/fontLoader.js +1 -19
  17. package/package.json +1 -1
  18. package/es/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
  19. package/es/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
  20. package/es/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
  21. package/es/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
  22. package/es/fonts/SF/SF-Pro-Text-Medium.svg +0 -40549
  23. package/es/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
  24. package/es/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
  25. package/es/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
  26. package/es/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
  27. package/es/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
  28. package/es/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
  29. package/es/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
  30. package/es/fonts/optimized/SF-Pro-Text-Bold.otf +0 -0
  31. package/es/fonts/optimized/SF-Pro-Text-Regular.otf +0 -0
  32. package/es/fonts/optimized/SF-Pro-Text-Semibold.otf +0 -0
  33. package/lib/fonts/SF/SF-Pro-Display-BlackItalic.otf +0 -0
  34. package/lib/fonts/SF/SF-Pro-Text-Bold.otf +0 -0
  35. package/lib/fonts/SF/SF-Pro-Text-Medium.eot +0 -0
  36. package/lib/fonts/SF/SF-Pro-Text-Medium.otf +0 -0
  37. package/lib/fonts/SF/SF-Pro-Text-Medium.svg +0 -40549
  38. package/lib/fonts/SF/SF-Pro-Text-Medium.ttf +0 -0
  39. package/lib/fonts/SF/SF-Pro-Text-Medium.woff +0 -0
  40. package/lib/fonts/SF/SF-Pro-Text-Medium.woff2 +0 -0
  41. package/lib/fonts/SF/SF-Pro-Text-Regular.otf +0 -0
  42. package/lib/fonts/SF/SF-Pro-Text-Regular.ttf +0 -0
  43. package/lib/fonts/SF/SF-Pro-Text-Semibold.otf +0 -0
  44. package/lib/fonts/SF/SF-Pro-Text-SemiboldItalic.otf +0 -0
  45. package/lib/fonts/optimized/SF-Pro-Text-Bold.otf +0 -0
  46. package/lib/fonts/optimized/SF-Pro-Text-Regular.otf +0 -0
  47. package/lib/fonts/optimized/SF-Pro-Text-Semibold.otf +0 -0
@@ -7,7 +7,7 @@ declare const useDesignFormTokens: () => {
7
7
  lineHeight: number;
8
8
  labelHeight: any;
9
9
  labelColor: any;
10
- labelFontFamily: string;
10
+ fontFamily: string;
11
11
  labelFontSize: any;
12
12
  fontSize: any;
13
13
  itemMarginBottom: number;
@@ -22,7 +22,7 @@ declare const useDesignFormHorizontalTokens: () => {
22
22
  labelHeight: any;
23
23
  labelColor: any;
24
24
  lineHeight: number;
25
- labelFontFamily: string;
25
+ fontFamily: string;
26
26
  labelFontSize: any;
27
27
  fontSize: any;
28
28
  itemMarginBottom: number;
@@ -17,7 +17,7 @@ var useDesignFormTokens = function useDesignFormTokens() {
17
17
  // label高
18
18
  labelColor: getToken('colorInputTextLabel'),
19
19
  // label文本颜色
20
- labelFontFamily: "".concat(getToken('fontFamilySecondaryRegular'), "-Regular"),
20
+ fontFamily: "".concat(getToken('fontFamilySecondaryRegular'), "-Regular"),
21
21
  labelFontSize: getToken('fontSizeMobileContentC14'),
22
22
  fontSize: getToken('fontSizeMobileContentC14'),
23
23
  // 字体大小
@@ -44,7 +44,7 @@ var useDesignFormHorizontalTokens = function useDesignFormHorizontalTokens() {
44
44
  // label文本颜色
45
45
  lineHeight: 24 / getToken('fontSizeMobileContentC14'),
46
46
  // 行高
47
- labelFontFamily: "".concat(getToken('fontFamilySecondaryRegular'), "-Regular"),
47
+ fontFamily: "".concat(getToken('fontFamilySecondaryRegular'), "-Regular"),
48
48
  labelFontSize: getToken('fontSizeMobileContentC14'),
49
49
  fontSize: getToken('fontSizeMobileContentC14'),
50
50
  // 字体大小
@@ -24,6 +24,8 @@ declare const useDesignTokens: () => {
24
24
  colorInputTextPlaceholder: any;
25
25
  fontSize: any;
26
26
  colorBgContainerDisabled: any;
27
+ fontFamily: string;
28
+ colorTextDisabled: any;
27
29
  };
28
30
  declare const useStyleToken: () => {
29
31
  [x: string]: any;
@@ -53,7 +53,10 @@ var useDesignTokens = function useDesignTokens() {
53
53
  // placeholder文本颜色
54
54
  fontSize: getToken('fontSizeMobileContentC14'),
55
55
  // 字体大小
56
- colorBgContainerDisabled: getToken('colorInputBackgroundHaze') // 背景颜色
56
+ colorBgContainerDisabled: getToken('colorInputBackgroundHaze'),
57
+ // 背景颜色
58
+ fontFamily: "".concat(getToken('fontFamilySecondaryRegular'), "-Regular"),
59
+ colorTextDisabled: getToken('colorInputTextActive') // 禁用文本颜色
57
60
  };
58
61
  return designTokens;
59
62
  };
@@ -26,28 +26,3 @@
26
26
  font-weight: normal;
27
27
  font-style: normal;
28
28
  }
29
-
30
- @font-face {
31
- font-family: 'SF Pro Text-Regular';
32
- src: url('../../fonts/SF/SF-Pro-Text-Regular.ttf') format('opentype'),
33
- url('../../fonts/SF/SF-Pro-Text-Regular.otf') format('opentype');
34
- font-weight: normal;
35
- font-style: normal;
36
- }
37
-
38
- @font-face {
39
- font-family: 'SF Pro Text-SemiBold';
40
- src:
41
- url('../../fonts/SF/SF-Pro-Text-Semibold.otf') format('opentype'),
42
- url('../../fonts/SF/SF-Pro-Text-SemiboldItalic.otf') format('opentype');
43
- font-weight: normal;
44
- font-style: normal;
45
- }
46
-
47
- @font-face {
48
- font-family: 'SF Pro Text-Bold';
49
- src:
50
- url('../../fonts/SF/SF-Pro-Text-Bold.otf') format('opentype');
51
- font-weight: normal;
52
- font-style: normal;
53
- }
@@ -35,30 +35,6 @@
35
35
  font-display: swap;
36
36
  }
37
37
 
38
- @font-face {
39
- font-family: 'SF Pro Text-Regular';
40
- src: url('../../fonts/optimized/SF-Pro-Text-Regular.woff2') format('woff2');
41
- font-weight: normal;
42
- font-style: normal;
43
- font-display: swap;
44
- }
45
-
46
- @font-face {
47
- font-family: 'SF Pro Text-SemiBold';
48
- src: url('../../fonts/optimized/SF-Pro-Text-Semibold.woff2') format('woff2');
49
- font-weight: normal;
50
- font-style: normal;
51
- font-display: swap;
52
- }
53
-
54
- @font-face {
55
- font-family: 'SF Pro Text-Bold';
56
- src: url('../../fonts/optimized/SF-Pro-Text-Bold.woff2') format('woff2');
57
- font-weight: normal;
58
- font-style: normal;
59
- font-display: swap;
60
- }
61
-
62
38
  /* 方案二:使用CDN引用字体(推荐生产环境使用) */
63
39
  /*
64
40
  @font-face {
@@ -1,6 +1,9 @@
1
+ import "antd/es/config-provider/style";
2
+ import _ConfigProvider from "antd/es/config-provider";
1
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
4
  import React, { createContext, useContext, useState, useEffect, useMemo, useCallback } from 'react';
3
5
  import { TokenManager } from "./";
6
+ import { cssClasses } from "../constants";
4
7
 
5
8
  // 定义TokenContext的类型
6
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -62,9 +65,17 @@ export var TokenProvider = function TokenProvider(_ref) {
62
65
  tokenVersion: tokenVersion
63
66
  };
64
67
  }, [getToken, tokenVersion]);
65
- return /*#__PURE__*/_jsx(TokenContext.Provider, {
66
- value: value,
67
- children: children
68
+ return /*#__PURE__*/_jsx(_ConfigProvider, {
69
+ prefixCls: cssClasses.PREFIX,
70
+ theme: {
71
+ token: {
72
+ fontFamily: "".concat(value.getToken('fontFamilyPrimaryRegular'), "-Regular")
73
+ }
74
+ },
75
+ children: /*#__PURE__*/_jsx(TokenContext.Provider, {
76
+ value: value,
77
+ children: children
78
+ })
68
79
  });
69
80
  };
70
81
 
@@ -217,12 +217,12 @@ function loadCdnFonts() {
217
217
 
218
218
  // 设置字体显示方式
219
219
  var fontDisplay = currentConfig.fontDisplay || 'swap';
220
- style.textContent = "\n @font-face {\n font-family: 'Poppins-Bold';\n src: url('".concat(cdnBasePath, "/Poppins-Bold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-Regular';\n src: url('").concat(cdnBasePath, "/Roboto-Regular.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-Bold';\n src: url('").concat(cdnBasePath, "/Roboto-Bold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-SemiBold';\n src: url('").concat(cdnBasePath, "/Roboto-SemiBold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'SF Pro Text-Regular';\n src: url('").concat(cdnBasePath, "/SF-Pro-Text-Regular.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'SF Pro Text-SemiBold';\n src: url('").concat(cdnBasePath, "/SF-Pro-Text-Semibold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n ");
220
+ style.textContent = "\n @font-face {\n font-family: 'Poppins-Bold';\n src: url('".concat(cdnBasePath, "/Poppins-Bold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-Regular';\n src: url('").concat(cdnBasePath, "/Roboto-Regular.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-Bold';\n src: url('").concat(cdnBasePath, "/Roboto-Bold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n\n @font-face {\n font-family: 'Roboto-SemiBold';\n src: url('").concat(cdnBasePath, "/Roboto-SemiBold.woff2') format('woff2');\n font-weight: normal;\n font-style: normal;\n font-display: ").concat(fontDisplay, ";\n }\n ");
221
221
  document.head.appendChild(style);
222
222
 
223
223
  // 如果启用了预加载,添加预加载链接
224
224
  if (currentConfig.preload) {
225
- var fontFiles = ['Poppins-Bold.woff2', 'Roboto-Regular.woff2', 'Roboto-Bold.woff2', 'Roboto-SemiBold.woff2', 'SF-Pro-Text-Regular.woff2', 'SF-Pro-Text-Semibold.woff2'];
225
+ var fontFiles = ['Poppins-Bold.woff2', 'Roboto-Regular.woff2', 'Roboto-Bold.woff2', 'Roboto-SemiBold.woff2'];
226
226
  fontFiles.forEach(function (file) {
227
227
  var preloadLink = document.createElement('link');
228
228
  preloadLink.rel = 'preload';
@@ -7,7 +7,7 @@ declare const useDesignFormTokens: () => {
7
7
  lineHeight: number;
8
8
  labelHeight: any;
9
9
  labelColor: any;
10
- labelFontFamily: string;
10
+ fontFamily: string;
11
11
  labelFontSize: any;
12
12
  fontSize: any;
13
13
  itemMarginBottom: number;
@@ -22,7 +22,7 @@ declare const useDesignFormHorizontalTokens: () => {
22
22
  labelHeight: any;
23
23
  labelColor: any;
24
24
  lineHeight: number;
25
- labelFontFamily: string;
25
+ fontFamily: string;
26
26
  labelFontSize: any;
27
27
  fontSize: any;
28
28
  itemMarginBottom: number;
@@ -42,7 +42,7 @@ var useDesignFormTokens = () => {
42
42
  // label高
43
43
  labelColor: getToken("colorInputTextLabel"),
44
44
  // label文本颜色
45
- labelFontFamily: `${getToken("fontFamilySecondaryRegular")}-Regular`,
45
+ fontFamily: `${getToken("fontFamilySecondaryRegular")}-Regular`,
46
46
  labelFontSize: getToken("fontSizeMobileContentC14"),
47
47
  fontSize: getToken("fontSizeMobileContentC14"),
48
48
  // 字体大小
@@ -69,7 +69,7 @@ var useDesignFormHorizontalTokens = () => {
69
69
  // label文本颜色
70
70
  lineHeight: 24 / getToken("fontSizeMobileContentC14"),
71
71
  // 行高
72
- labelFontFamily: `${getToken("fontFamilySecondaryRegular")}-Regular`,
72
+ fontFamily: `${getToken("fontFamilySecondaryRegular")}-Regular`,
73
73
  labelFontSize: getToken("fontSizeMobileContentC14"),
74
74
  fontSize: getToken("fontSizeMobileContentC14"),
75
75
  // 字体大小
@@ -24,6 +24,8 @@ declare const useDesignTokens: () => {
24
24
  colorInputTextPlaceholder: any;
25
25
  fontSize: any;
26
26
  colorBgContainerDisabled: any;
27
+ fontFamily: string;
28
+ colorTextDisabled: any;
27
29
  };
28
30
  declare const useStyleToken: () => {
29
31
  [x: string]: any;
@@ -78,8 +78,11 @@ var useDesignTokens = () => {
78
78
  // placeholder文本颜色
79
79
  fontSize: getToken("fontSizeMobileContentC14"),
80
80
  // 字体大小
81
- colorBgContainerDisabled: getToken("colorInputBackgroundHaze")
81
+ colorBgContainerDisabled: getToken("colorInputBackgroundHaze"),
82
82
  // 背景颜色
83
+ fontFamily: `${getToken("fontFamilySecondaryRegular")}-Regular`,
84
+ colorTextDisabled: getToken("colorInputTextActive")
85
+ // 禁用文本颜色
83
86
  };
84
87
  return designTokens;
85
88
  };
@@ -26,28 +26,3 @@
26
26
  font-weight: normal;
27
27
  font-style: normal;
28
28
  }
29
-
30
- @font-face {
31
- font-family: 'SF Pro Text-Regular';
32
- src: url('../../fonts/SF/SF-Pro-Text-Regular.ttf') format('opentype'),
33
- url('../../fonts/SF/SF-Pro-Text-Regular.otf') format('opentype');
34
- font-weight: normal;
35
- font-style: normal;
36
- }
37
-
38
- @font-face {
39
- font-family: 'SF Pro Text-SemiBold';
40
- src:
41
- url('../../fonts/SF/SF-Pro-Text-Semibold.otf') format('opentype'),
42
- url('../../fonts/SF/SF-Pro-Text-SemiboldItalic.otf') format('opentype');
43
- font-weight: normal;
44
- font-style: normal;
45
- }
46
-
47
- @font-face {
48
- font-family: 'SF Pro Text-Bold';
49
- src:
50
- url('../../fonts/SF/SF-Pro-Text-Bold.otf') format('opentype');
51
- font-weight: normal;
52
- font-style: normal;
53
- }
@@ -35,30 +35,6 @@
35
35
  font-display: swap;
36
36
  }
37
37
 
38
- @font-face {
39
- font-family: 'SF Pro Text-Regular';
40
- src: url('../../fonts/optimized/SF-Pro-Text-Regular.woff2') format('woff2');
41
- font-weight: normal;
42
- font-style: normal;
43
- font-display: swap;
44
- }
45
-
46
- @font-face {
47
- font-family: 'SF Pro Text-SemiBold';
48
- src: url('../../fonts/optimized/SF-Pro-Text-Semibold.woff2') format('woff2');
49
- font-weight: normal;
50
- font-style: normal;
51
- font-display: swap;
52
- }
53
-
54
- @font-face {
55
- font-family: 'SF Pro Text-Bold';
56
- src: url('../../fonts/optimized/SF-Pro-Text-Bold.woff2') format('woff2');
57
- font-weight: normal;
58
- font-style: normal;
59
- font-display: swap;
60
- }
61
-
62
38
  /* 方案二:使用CDN引用字体(推荐生产环境使用) */
63
39
  /*
64
40
  @font-face {
@@ -36,7 +36,9 @@ __export(TokenContext_exports, {
36
36
  });
37
37
  module.exports = __toCommonJS(TokenContext_exports);
38
38
  var import_react = __toESM(require("react"));
39
+ var import_antd = require("antd");
39
40
  var import_utils = require("./");
41
+ var import_constants = require("../constants");
40
42
  var defaultValue = {
41
43
  getToken: (tokenName) => import_utils.TokenManager.tokenKey(tokenName),
42
44
  tokenVersion: 0
@@ -67,7 +69,18 @@ var TokenProvider = ({ children, getToken }) => {
67
69
  getToken: getToken || defaultValue.getToken,
68
70
  tokenVersion
69
71
  }), [getToken, tokenVersion]);
70
- return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value }, children);
72
+ return /* @__PURE__ */ import_react.default.createElement(
73
+ import_antd.ConfigProvider,
74
+ {
75
+ prefixCls: import_constants.cssClasses.PREFIX,
76
+ theme: {
77
+ token: {
78
+ fontFamily: `${value.getToken("fontFamilyPrimaryRegular")}-Regular`
79
+ }
80
+ }
81
+ },
82
+ /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value }, children)
83
+ );
71
84
  };
72
85
  var useDynamicTokens = () => {
73
86
  const context = (0, import_react.useContext)(TokenContext);
@@ -203,22 +203,6 @@ function loadCdnFonts(cdnBasePath = "") {
203
203
  font-style: normal;
204
204
  font-display: ${fontDisplay};
205
205
  }
206
-
207
- @font-face {
208
- font-family: 'SF Pro Text-Regular';
209
- src: url('${cdnBasePath}/SF-Pro-Text-Regular.woff2') format('woff2');
210
- font-weight: normal;
211
- font-style: normal;
212
- font-display: ${fontDisplay};
213
- }
214
-
215
- @font-face {
216
- font-family: 'SF Pro Text-SemiBold';
217
- src: url('${cdnBasePath}/SF-Pro-Text-Semibold.woff2') format('woff2');
218
- font-weight: normal;
219
- font-style: normal;
220
- font-display: ${fontDisplay};
221
- }
222
206
  `;
223
207
  document.head.appendChild(style);
224
208
  if (currentConfig.preload) {
@@ -226,9 +210,7 @@ function loadCdnFonts(cdnBasePath = "") {
226
210
  "Poppins-Bold.woff2",
227
211
  "Roboto-Regular.woff2",
228
212
  "Roboto-Bold.woff2",
229
- "Roboto-SemiBold.woff2",
230
- "SF-Pro-Text-Regular.woff2",
231
- "SF-Pro-Text-Semibold.woff2"
213
+ "Roboto-SemiBold.woff2"
232
214
  ];
233
215
  fontFiles.forEach((file) => {
234
216
  const preloadLink = document.createElement("link");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalc/dxp-ui",
3
- "version": "0.0.6-alpha.14",
3
+ "version": "0.0.6-alpha.16",
4
4
  "description": "A UI library of Digitalc Design React Component",
5
5
  "type": "module",
6
6
  "keywords": [
Binary file
Binary file
Binary file