@digitalc/dxp-ui 0.0.1

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 (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/es/assets/iconFont/iconfont.css +734 -0
  4. package/es/assets/iconFont/iconfont.eot +0 -0
  5. package/es/assets/iconFont/iconfont.js +43 -0
  6. package/es/assets/iconFont/iconfont.json +1262 -0
  7. package/es/assets/iconFont/iconfont.svg +377 -0
  8. package/es/assets/iconFont/iconfont.ttf +0 -0
  9. package/es/assets/iconFont/iconfont.woff +0 -0
  10. package/es/assets/iconFont/iconfont.woff2 +0 -0
  11. package/es/assets/token.json +239 -0
  12. package/es/components/Button/designTokens.d.ts +66 -0
  13. package/es/components/Button/designTokens.js +131 -0
  14. package/es/components/Button/index.d.ts +44 -0
  15. package/es/components/Button/index.js +92 -0
  16. package/es/components/Button/index_backup.d.ts +72 -0
  17. package/es/components/Button/index_backup.js +110 -0
  18. package/es/components/Button/style/button.less +34 -0
  19. package/es/components/Button/style/variables.less +5 -0
  20. package/es/components/Text/index.d.ts +32 -0
  21. package/es/components/Text/index.js +59 -0
  22. package/es/components/Text/style/text.less +116 -0
  23. package/es/components/Text/style/variables.less +4 -0
  24. package/es/components/index.d.ts +4 -0
  25. package/es/components/index.js +4 -0
  26. package/es/constants/index.d.ts +15 -0
  27. package/es/constants/index.js +16 -0
  28. package/es/fonts/Poppins/Poppins-Bold.ttf +0 -0
  29. package/es/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  30. package/es/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  31. package/es/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  32. package/es/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  33. package/es/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  34. package/es/fonts/Poppins/Poppins-Italic.ttf +0 -0
  35. package/es/fonts/Poppins/Poppins-Light.ttf +0 -0
  36. package/es/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  37. package/es/fonts/Poppins/Poppins-Medium.ttf +0 -0
  38. package/es/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  39. package/es/fonts/Poppins/Poppins-Regular.ttf +0 -0
  40. package/es/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  41. package/es/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  42. package/es/fonts/Poppins/Poppins-Thin.ttf +0 -0
  43. package/es/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  44. package/es/fonts/Roboto/Roboto-Black.ttf +0 -0
  45. package/es/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  46. package/es/fonts/Roboto/Roboto-Bold.ttf +0 -0
  47. package/es/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  48. package/es/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
  49. package/es/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
  50. package/es/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
  51. package/es/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
  52. package/es/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  53. package/es/fonts/Roboto/Roboto-Italic.ttf +0 -0
  54. package/es/fonts/Roboto/Roboto-Light.ttf +0 -0
  55. package/es/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  56. package/es/fonts/Roboto/Roboto-Medium.ttf +0 -0
  57. package/es/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  58. package/es/fonts/Roboto/Roboto-Regular.ttf +0 -0
  59. package/es/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
  60. package/es/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
  61. package/es/fonts/Roboto/Roboto-Thin.ttf +0 -0
  62. package/es/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  63. package/es/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  64. package/es/index.d.ts +3 -0
  65. package/es/index.js +3 -0
  66. package/es/style/antdDesignToken.json +503 -0
  67. package/es/style/themes/base-vars.css +6 -0
  68. package/es/style/themes/colorful.css +5 -0
  69. package/es/style/themes/index.css +4 -0
  70. package/es/style/variables.less +34 -0
  71. package/es/tokens/DXPGlobal.d.ts +240 -0
  72. package/es/tokens/DXPGlobal.js +5 -0
  73. package/es/utils/noop.d.ts +1 -0
  74. package/es/utils/noop.js +1 -0
  75. package/es/utils/themeContext.d.ts +11 -0
  76. package/es/utils/themeContext.js +39 -0
  77. package/es/utils/tokenHelper.d.ts +1 -0
  78. package/es/utils/tokenHelper.js +4 -0
  79. package/es/utils/tokenManager.d.ts +1464 -0
  80. package/es/utils/tokenManager.js +750 -0
  81. package/package.json +112 -0
  82. package/umd/dxp-ui.min.css +1 -0
  83. package/umd/dxp-ui.min.js +1 -0
  84. package/umd/static/Poppins-Bold.8001a01b.ttf +0 -0
  85. package/umd/static/Roboto-Bold.ff276312.ttf +0 -0
  86. package/umd/static/Roboto-Regular.a5023d7b.ttf +0 -0
  87. package/umd/static/Roboto-SemiBold.3452daa4.ttf +0 -0
@@ -0,0 +1,240 @@
1
+ declare const dxpToken: {
2
+ borderRadiusLg: number;
3
+ borderRadiusMd: number;
4
+ borderRadiusSm: number;
5
+ borderRadiusXl: number;
6
+ borderUpload: string;
7
+ borderWidthCta: number;
8
+ borderWidthHover: number;
9
+ borderWidthSelected: number;
10
+ borderWidthStandard: number;
11
+ borderWidthStrikeout: number;
12
+ colorBackgroundActive: string;
13
+ colorBackgroundActiveInverse: string;
14
+ colorBackgroundActiveWeak: string;
15
+ colorBackgroundActiveWeakInverse: string;
16
+ colorBackgroundCoachmark: string;
17
+ colorBackgroundCta: string;
18
+ colorBackgroundCtaInverse: string;
19
+ colorBackgroundCtaInversePressed: string;
20
+ colorBackgroundCtaPressed: string;
21
+ colorBackgroundCtaSuccess: string;
22
+ colorBackgroundDark: string;
23
+ colorBackgroundDark2: string;
24
+ colorBackgroundDisabled: string;
25
+ colorBackgroundFooter: string;
26
+ colorBackgroundHeader: string;
27
+ colorBackgroundHover: string;
28
+ colorBackgroundHoverNeutral: string;
29
+ colorBackgroundOverlay: string;
30
+ colorBackgroundOverlayLight: string;
31
+ colorBackgroundSelected: string;
32
+ colorBackgroundStandard: string;
33
+ colorBackgroundSubtle: string;
34
+ colorBackgroundSubtle2: string;
35
+ colorBackgroundWeak: string;
36
+ colorBorderActive: string;
37
+ colorBorderActiveInverse: string;
38
+ colorBorderBenchmark: string;
39
+ colorBorderBenchmarkInverse: string;
40
+ colorBorderCta: string;
41
+ colorBorderCtaInverse: string;
42
+ colorBorderDisabled: string;
43
+ colorBorderError: string;
44
+ colorBorderSelected: string;
45
+ colorBorderStandard: string;
46
+ colorBorderStrikeout: string;
47
+ colorBorderStrikeoutInverse: string;
48
+ colorBorderStrong: string;
49
+ colorBorderWeak: string;
50
+ colorBorderWeakInverse: string;
51
+ colorDivider: string;
52
+ colorGradientNeutral: string;
53
+ colorGraph1: string;
54
+ colorGraph2: string;
55
+ colorGraph3: string;
56
+ colorGraph4: string;
57
+ colorGraph5: string;
58
+ colorGraph6: string;
59
+ colorGraph7: string;
60
+ colorGraph8: string;
61
+ colorGraph9: string;
62
+ colorGraph10: string;
63
+ colorGraph11: string;
64
+ colorGraph12: string;
65
+ colorIconActive: string;
66
+ colorIconAlert: string;
67
+ colorIconAlertInverse: string;
68
+ colorIconBottomNavigationActive: string;
69
+ colorIconBottomNavigationInactive: string;
70
+ colorIconCta: string;
71
+ colorIconCtaInverse: string;
72
+ colorIconDisabled: string;
73
+ colorIconInactive: string;
74
+ colorIconInverse: string;
75
+ colorIconLink: string;
76
+ colorIconLinkInverse: string;
77
+ colorIconLoader: string;
78
+ colorIconLocationPin: string;
79
+ colorIconLocationPinActive: string;
80
+ colorIconNeutral: string;
81
+ colorIconNotice: string;
82
+ colorIconPending: string;
83
+ colorIconRating: string;
84
+ colorIconSubtle: string;
85
+ colorIconSubtleInverse: string;
86
+ colorIconSuccess: string;
87
+ colorIconWeak: string;
88
+ colorNotificationAlert: string;
89
+ colorNotificationDefault: string;
90
+ colorNotificationPromo: string;
91
+ colorRewards1: string;
92
+ colorRewards2: string;
93
+ colorRewards3: string;
94
+ colorRibbonPrimary: string;
95
+ colorRibbonPrimary2: string;
96
+ colorRibbonPrimary3: string;
97
+ colorRibbonPrimaryDark: string;
98
+ colorRibbonSecondary: string;
99
+ colorRibbonSecondary2: string;
100
+ colorRibbonSecondaryDark: string;
101
+ colorTagPrimary: string;
102
+ colorTagSecondary: string;
103
+ colorTextAlert: string;
104
+ colorTextCoachmark: string;
105
+ colorTextCta: string;
106
+ colorTextCtaInverse: string;
107
+ colorTextDisabled: string;
108
+ colorTextHeaderActive: string;
109
+ colorTextHeaderActiveInverse: string;
110
+ colorTextHeaderHighlight: string;
111
+ colorTextHeaderHighlightInverse: string;
112
+ colorTextInverse: string;
113
+ colorTextLabel: string;
114
+ colorTextLink: string;
115
+ colorTextLinkInverse: string;
116
+ colorTextNavigationActive: string;
117
+ colorTextNeutral: string;
118
+ colorTextStrikethrough: string;
119
+ colorTextSubtle: string;
120
+ colorTextSubtleInverse: string;
121
+ colorTextSuccess: string;
122
+ colorToggleActiveStrong: string;
123
+ colorToggleActiveWeak: string;
124
+ colorToggleInactiveStrong: string;
125
+ colorToggleInactiveWeak: string;
126
+ colorToggleIndicator: string;
127
+ opacityDisabled: number;
128
+ opacityHover: number;
129
+ opacityOverlay: number;
130
+ opacityPressed: number;
131
+ opacitySubtle: number;
132
+ shadowHigh: {
133
+ elevation: number;
134
+ shadowColor: string;
135
+ shadowOffset: {
136
+ width: number;
137
+ height: number;
138
+ };
139
+ shadowOpacity: number;
140
+ shadowRadius: number;
141
+ };
142
+ shadowHighInverse: {
143
+ elevation: number;
144
+ shadowColor: string;
145
+ shadowOffset: {
146
+ width: number;
147
+ height: number;
148
+ };
149
+ shadowOpacity: number;
150
+ shadowRadius: number;
151
+ };
152
+ shadowLow: {
153
+ elevation: number;
154
+ shadowColor: string;
155
+ shadowOffset: {
156
+ width: number;
157
+ height: number;
158
+ };
159
+ shadowOpacity: number;
160
+ shadowRadius: number;
161
+ };
162
+ sizingBullet: number;
163
+ sizingBulletSm: number;
164
+ sizingCirclePatternLg: number;
165
+ sizingCirclePatternMd: number;
166
+ sizingCirclePatternSm: number;
167
+ sizingCirclePatternXs: number;
168
+ sizingColorList: number;
169
+ sizingFileInput: number;
170
+ sizingFileInputLg: number;
171
+ sizingIconGeneralLg: number;
172
+ sizingIconGeneralMd: number;
173
+ sizingIconGeneralSm: number;
174
+ sizingIconGeneralXl: number;
175
+ sizingIconGeneralXs: number;
176
+ sizingIconGeneralXs2: number;
177
+ sizingIconSpotLg: number;
178
+ sizingIconSpotMd: number;
179
+ sizingIconSpotSm: number;
180
+ sizingIconSpotXl: number;
181
+ sizingIconSpotXs: number;
182
+ sizingIconSpotXxl: number;
183
+ sizingIconUtilityLg: number;
184
+ sizingIconUtilityMd: number;
185
+ sizingIconUtilitySm: number;
186
+ sizingIconUtilityXs: number;
187
+ sizingIconUtilityXs2: number;
188
+ sizingIconUtilityXxs: number;
189
+ sizingImageLg: number;
190
+ sizingImageMd: number;
191
+ sizingImageSm: number;
192
+ sizingImageXl: number;
193
+ sizingImageXs: number;
194
+ sizingImageXxl: number;
195
+ sizingImageXxs: number;
196
+ sizingTagLg: number;
197
+ sizingTagMd: number;
198
+ sizingTagSm: number;
199
+ sizingTextBoxLg: number;
200
+ sizingTextBoxMd: number;
201
+ sizingTextBoxSm: number;
202
+ sizingTextBoxXs: number;
203
+ sizingTextBoxXxs: number;
204
+ sizingVoucherMd: number;
205
+ sizingVoucherSm: number;
206
+ spacingBulletMd: number;
207
+ spacingBulletSm: number;
208
+ spacingBulletXs: number;
209
+ spacingGapLg: number;
210
+ spacingGapMd: number;
211
+ spacingGapSm: number;
212
+ spacingGapSm2: number;
213
+ spacingGapXl: number;
214
+ spacingGapXs: number;
215
+ spacingGapXxl: number;
216
+ spacingGapXxxl: number;
217
+ spacingIconLg: number;
218
+ spacingIconMd: number;
219
+ spacingIconSm: number;
220
+ spacingIconXs: number;
221
+ spacingIconXxs: number;
222
+ spacingImageLg: number;
223
+ spacingImageMd: number;
224
+ spacingImageSm: number;
225
+ spacingImageXs: number;
226
+ spacingInputMd: number;
227
+ spacingInputMd2: number;
228
+ spacingInputMd3: number;
229
+ spacingInputSm: number;
230
+ spacingInputSm2: number;
231
+ spacingInputSm3: number;
232
+ spacingInputXs: number;
233
+ spacingTextLg: number;
234
+ spacingTextMd: number;
235
+ spacingTextSm: number;
236
+ spacingTextXl: number;
237
+ spacingTextXs: number;
238
+ spacingTextXxl: number;
239
+ };
240
+ export default dxpToken;
@@ -0,0 +1,5 @@
1
+ // DXPGlobal.ts 是 dxp UI 的全局 主题 变量
2
+
3
+ import local_dxpGlobaltoken from "../assets/token.json";
4
+ var dxpToken = local_dxpGlobaltoken;
5
+ export default dxpToken;
@@ -0,0 +1 @@
1
+ export declare function noop(): void;
@@ -0,0 +1 @@
1
+ export function noop() {}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export type ThemeStyle = 'default' | 'colorful';
3
+ export interface ThemeContextType {
4
+ style: ThemeStyle;
5
+ setStyle: (style: ThemeStyle) => void;
6
+ }
7
+ export declare const ThemeProvider: React.FC<{
8
+ children: React.ReactNode;
9
+ defaultStyle?: ThemeStyle;
10
+ }>;
11
+ export declare const useTheme: () => ThemeContextType;
@@ -0,0 +1,39 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { createContext, useContext, useEffect } from 'react';
3
+
4
+ // 主题类型定义
5
+
6
+ // 创建 Context
7
+ var ThemeContext = /*#__PURE__*/createContext({
8
+ style: 'default',
9
+ setStyle: function setStyle() {}
10
+ });
11
+ export var ThemeProvider = function ThemeProvider(_ref) {
12
+ var children = _ref.children,
13
+ _ref$defaultStyle = _ref.defaultStyle,
14
+ defaultStyle = _ref$defaultStyle === void 0 ? 'default' : _ref$defaultStyle;
15
+ var _React$useState = React.useState(defaultStyle),
16
+ _React$useState2 = _slicedToArray(_React$useState, 2),
17
+ style = _React$useState2[0],
18
+ setStyle = _React$useState2[1];
19
+
20
+ // 应用主题样式
21
+ useEffect(function () {
22
+ document.documentElement.setAttribute('data-theme-style', style);
23
+ }, [style]);
24
+ return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
25
+ value: {
26
+ style: style,
27
+ setStyle: setStyle
28
+ }
29
+ }, children);
30
+ };
31
+
32
+ // Hook for using theme
33
+ export var useTheme = function useTheme() {
34
+ var context = useContext(ThemeContext);
35
+ if (!context) {
36
+ throw new Error('useTheme must be used within a ThemeProvider');
37
+ }
38
+ return context;
39
+ };
@@ -0,0 +1 @@
1
+ export declare const getToken: (tokenName: string) => any;
@@ -0,0 +1,4 @@
1
+ import TokenManager from "./tokenManager";
2
+ export var getToken = function getToken(tokenName) {
3
+ return TokenManager.tokenKey(tokenName);
4
+ };