@digitalc/dxp-ui 0.0.5-alpha.6 → 0.0.5-alpha.8

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 (342) hide show
  1. package/README.md +108 -4
  2. package/package.json +2 -3
  3. package/es/assets/iconFont/demo.css +0 -539
  4. package/es/assets/iconFont/demo_index.html +0 -4400
  5. package/es/assets/iconFont/iconfont.css +0 -750
  6. package/es/assets/iconFont/iconfont.eot +0 -0
  7. package/es/assets/iconFont/iconfont.json +0 -1290
  8. package/es/assets/iconFont/iconfont.svg +0 -385
  9. package/es/assets/iconFont/iconfont.ttf +0 -0
  10. package/es/assets/iconFont/iconfont.woff +0 -0
  11. package/es/assets/iconFont/iconfont.woff2 +0 -0
  12. package/es/assets/token.json +0 -259
  13. package/es/components/Amount/designTokens.d.ts +0 -6
  14. package/es/components/Amount/designTokens.js +0 -9
  15. package/es/components/Amount/index.d.ts +0 -22
  16. package/es/components/Amount/index.js +0 -139
  17. package/es/components/Amount/style/index.less +0 -10
  18. package/es/components/Amount/style/variables.less +0 -4
  19. package/es/components/Button/designTokens.d.ts +0 -66
  20. package/es/components/Button/designTokens.js +0 -131
  21. package/es/components/Button/index.d.ts +0 -44
  22. package/es/components/Button/index.js +0 -88
  23. package/es/components/Button/style/index.less +0 -38
  24. package/es/components/Button/style/variables.less +0 -5
  25. package/es/components/Chip/designTokens.d.ts +0 -15
  26. package/es/components/Chip/designTokens.js +0 -22
  27. package/es/components/Chip/index.d.ts +0 -11
  28. package/es/components/Chip/index.js +0 -91
  29. package/es/components/Chip/style/index.less +0 -9
  30. package/es/components/Chip/style/variables.less +0 -4
  31. package/es/components/Divider/index.d.ts +0 -16
  32. package/es/components/Divider/index.js +0 -55
  33. package/es/components/Divider/style/index.less +0 -78
  34. package/es/components/Divider/style/variables.less +0 -4
  35. package/es/components/Icon/Icon.d.ts +0 -9
  36. package/es/components/Icon/Icon.js +0 -14
  37. package/es/components/Icon/designTokens.d.ts +0 -6
  38. package/es/components/Icon/designTokens.js +0 -7
  39. package/es/components/Icon/index.d.ts +0 -10
  40. package/es/components/Icon/index.js +0 -29
  41. package/es/components/IconButton/designTokens.d.ts +0 -21
  42. package/es/components/IconButton/designTokens.js +0 -39
  43. package/es/components/IconButton/index.d.ts +0 -23
  44. package/es/components/IconButton/index.js +0 -105
  45. package/es/components/IconButton/style/index.less +0 -59
  46. package/es/components/IconButton/style/variables.less +0 -5
  47. package/es/components/IconButtonGroup/index.d.ts +0 -15
  48. package/es/components/IconButtonGroup/index.js +0 -22
  49. package/es/components/Image/index.d.ts +0 -20
  50. package/es/components/Image/index.js +0 -24
  51. package/es/components/Input/designTokens.d.ts +0 -26
  52. package/es/components/Input/designTokens.js +0 -34
  53. package/es/components/Input/index.d.ts +0 -10
  54. package/es/components/Input/index.js +0 -83
  55. package/es/components/Input/style/index.less +0 -13
  56. package/es/components/Input/style/variables.less +0 -5
  57. package/es/components/Modal/designTokens.d.ts +0 -21
  58. package/es/components/Modal/designTokens.js +0 -24
  59. package/es/components/Modal/index.d.ts +0 -17
  60. package/es/components/Modal/index.js +0 -86
  61. package/es/components/Modal/style/index.less +0 -76
  62. package/es/components/Modal/style/variables.less +0 -5
  63. package/es/components/Stepper/designTokens.d.ts +0 -16
  64. package/es/components/Stepper/designTokens.js +0 -51
  65. package/es/components/Stepper/index.d.ts +0 -15
  66. package/es/components/Stepper/index.js +0 -88
  67. package/es/components/Stepper/style/index.less +0 -68
  68. package/es/components/Stepper/style/variables.less +0 -5
  69. package/es/components/StickyFooter/designTokens.d.ts +0 -10
  70. package/es/components/StickyFooter/designTokens.js +0 -17
  71. package/es/components/StickyFooter/index.d.ts +0 -13
  72. package/es/components/StickyFooter/index.js +0 -70
  73. package/es/components/StickyFooter/style/index.less +0 -18
  74. package/es/components/StickyFooter/style/variables.less +0 -4
  75. package/es/components/Tabs/designTokens.d.ts +0 -32
  76. package/es/components/Tabs/designTokens.js +0 -45
  77. package/es/components/Tabs/index.d.ts +0 -13
  78. package/es/components/Tabs/index.js +0 -81
  79. package/es/components/Tabs/style/index.less +0 -19
  80. package/es/components/Tabs/style/variables.less +0 -4
  81. package/es/components/Tag/designTokens.d.ts +0 -92
  82. package/es/components/Tag/designTokens.js +0 -127
  83. package/es/components/Tag/index.d.ts +0 -15
  84. package/es/components/Tag/index.js +0 -85
  85. package/es/components/Tag/style/index.less +0 -9
  86. package/es/components/Tag/style/variables.less +0 -4
  87. package/es/components/Text/designTokens.d.ts +0 -23
  88. package/es/components/Text/designTokens.js +0 -24
  89. package/es/components/Text/index.d.ts +0 -13
  90. package/es/components/Text/index.js +0 -59
  91. package/es/components/Text/style/index.less +0 -2
  92. package/es/components/Text/style/variables.less +0 -4
  93. package/es/components/TextLink/designTokens.d.ts +0 -10
  94. package/es/components/TextLink/designTokens.js +0 -11
  95. package/es/components/TextLink/index.d.ts +0 -19
  96. package/es/components/TextLink/index.js +0 -93
  97. package/es/components/Toast/designTokens.d.ts +0 -13
  98. package/es/components/Toast/designTokens.js +0 -20
  99. package/es/components/Toast/index.d.ts +0 -25
  100. package/es/components/Toast/index.js +0 -174
  101. package/es/components/Toast/style/index.less +0 -18
  102. package/es/components/Toast/style/variables.less +0 -12
  103. package/es/components/Toggle/designTokens.d.ts +0 -9
  104. package/es/components/Toggle/designTokens.js +0 -13
  105. package/es/components/Toggle/index.d.ts +0 -27
  106. package/es/components/Toggle/index.js +0 -21
  107. package/es/components/index.d.ts +0 -35
  108. package/es/components/index.js +0 -20
  109. package/es/constants/index.d.ts +0 -15
  110. package/es/constants/index.js +0 -16
  111. package/es/fonts/Poppins/Poppins-Bold.ttf +0 -0
  112. package/es/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  113. package/es/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  114. package/es/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  115. package/es/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  116. package/es/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  117. package/es/fonts/Poppins/Poppins-Italic.ttf +0 -0
  118. package/es/fonts/Poppins/Poppins-Light.ttf +0 -0
  119. package/es/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  120. package/es/fonts/Poppins/Poppins-Medium.ttf +0 -0
  121. package/es/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  122. package/es/fonts/Poppins/Poppins-Regular.ttf +0 -0
  123. package/es/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  124. package/es/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  125. package/es/fonts/Poppins/Poppins-Thin.ttf +0 -0
  126. package/es/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  127. package/es/fonts/Roboto/Roboto-Black.ttf +0 -0
  128. package/es/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  129. package/es/fonts/Roboto/Roboto-Bold.ttf +0 -0
  130. package/es/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  131. package/es/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
  132. package/es/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
  133. package/es/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
  134. package/es/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
  135. package/es/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  136. package/es/fonts/Roboto/Roboto-Italic.ttf +0 -0
  137. package/es/fonts/Roboto/Roboto-Light.ttf +0 -0
  138. package/es/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  139. package/es/fonts/Roboto/Roboto-Medium.ttf +0 -0
  140. package/es/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  141. package/es/fonts/Roboto/Roboto-Regular.ttf +0 -0
  142. package/es/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
  143. package/es/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
  144. package/es/fonts/Roboto/Roboto-Thin.ttf +0 -0
  145. package/es/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  146. package/es/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  147. package/es/index.d.ts +0 -3
  148. package/es/index.js +0 -3
  149. package/es/style/antdDesignToken.json +0 -503
  150. package/es/style/themes/base-vars.css +0 -6
  151. package/es/style/themes/colorful.css +0 -5
  152. package/es/style/themes/index.css +0 -4
  153. package/es/style/variables.less +0 -34
  154. package/es/tokens/DXPGlobal.d.ts +0 -260
  155. package/es/tokens/DXPGlobal.js +0 -5
  156. package/es/utils/noop.d.ts +0 -1
  157. package/es/utils/noop.js +0 -1
  158. package/es/utils/scaleTool.d.ts +0 -12
  159. package/es/utils/scaleTool.js +0 -48
  160. package/es/utils/theme.d.ts +0 -11
  161. package/es/utils/theme.js +0 -15
  162. package/es/utils/themeContext.d.ts +0 -44
  163. package/es/utils/themeContext.js +0 -60
  164. package/es/utils/tokenHelper.d.ts +0 -1
  165. package/es/utils/tokenHelper.js +0 -7
  166. package/es/utils/tokenManager.d.ts +0 -1506
  167. package/es/utils/tokenManager.js +0 -771
  168. package/lib/assets/iconFont/demo.css +0 -539
  169. package/lib/assets/iconFont/demo_index.html +0 -4400
  170. package/lib/assets/iconFont/iconfont.css +0 -750
  171. package/lib/assets/iconFont/iconfont.eot +0 -0
  172. package/lib/assets/iconFont/iconfont.json +0 -1290
  173. package/lib/assets/iconFont/iconfont.svg +0 -385
  174. package/lib/assets/iconFont/iconfont.ttf +0 -0
  175. package/lib/assets/iconFont/iconfont.woff +0 -0
  176. package/lib/assets/iconFont/iconfont.woff2 +0 -0
  177. package/lib/assets/token.json +0 -259
  178. package/lib/components/Amount/designTokens.d.ts +0 -6
  179. package/lib/components/Amount/designTokens.js +0 -33
  180. package/lib/components/Amount/index.d.ts +0 -22
  181. package/lib/components/Amount/index.js +0 -154
  182. package/lib/components/Amount/style/index.less +0 -10
  183. package/lib/components/Amount/style/variables.less +0 -4
  184. package/lib/components/Button/designTokens.d.ts +0 -66
  185. package/lib/components/Button/designTokens.js +0 -139
  186. package/lib/components/Button/index.d.ts +0 -44
  187. package/lib/components/Button/index.js +0 -103
  188. package/lib/components/Button/style/index.less +0 -38
  189. package/lib/components/Button/style/variables.less +0 -5
  190. package/lib/components/Chip/designTokens.d.ts +0 -15
  191. package/lib/components/Chip/designTokens.js +0 -45
  192. package/lib/components/Chip/index.d.ts +0 -11
  193. package/lib/components/Chip/index.js +0 -174
  194. package/lib/components/Chip/style/index.less +0 -9
  195. package/lib/components/Chip/style/variables.less +0 -4
  196. package/lib/components/Divider/index.d.ts +0 -16
  197. package/lib/components/Divider/index.js +0 -111
  198. package/lib/components/Divider/style/index.less +0 -78
  199. package/lib/components/Divider/style/variables.less +0 -4
  200. package/lib/components/Icon/Icon.d.ts +0 -9
  201. package/lib/components/Icon/Icon.js +0 -47
  202. package/lib/components/Icon/designTokens.d.ts +0 -6
  203. package/lib/components/Icon/designTokens.js +0 -41
  204. package/lib/components/Icon/index.d.ts +0 -10
  205. package/lib/components/Icon/index.js +0 -73
  206. package/lib/components/IconButton/designTokens.d.ts +0 -21
  207. package/lib/components/IconButton/designTokens.js +0 -61
  208. package/lib/components/IconButton/index.d.ts +0 -23
  209. package/lib/components/IconButton/index.js +0 -200
  210. package/lib/components/IconButton/style/index.less +0 -59
  211. package/lib/components/IconButton/style/variables.less +0 -5
  212. package/lib/components/IconButtonGroup/index.d.ts +0 -15
  213. package/lib/components/IconButtonGroup/index.js +0 -53
  214. package/lib/components/Image/index.d.ts +0 -20
  215. package/lib/components/Image/index.js +0 -85
  216. package/lib/components/Input/designTokens.d.ts +0 -26
  217. package/lib/components/Input/designTokens.js +0 -75
  218. package/lib/components/Input/index.d.ts +0 -10
  219. package/lib/components/Input/index.js +0 -131
  220. package/lib/components/Input/style/index.less +0 -13
  221. package/lib/components/Input/style/variables.less +0 -5
  222. package/lib/components/Modal/designTokens.d.ts +0 -21
  223. package/lib/components/Modal/designTokens.js +0 -65
  224. package/lib/components/Modal/index.d.ts +0 -17
  225. package/lib/components/Modal/index.js +0 -101
  226. package/lib/components/Modal/style/index.less +0 -76
  227. package/lib/components/Modal/style/variables.less +0 -5
  228. package/lib/components/Stepper/designTokens.d.ts +0 -16
  229. package/lib/components/Stepper/designTokens.js +0 -78
  230. package/lib/components/Stepper/index.d.ts +0 -15
  231. package/lib/components/Stepper/index.js +0 -110
  232. package/lib/components/Stepper/style/index.less +0 -68
  233. package/lib/components/Stepper/style/variables.less +0 -5
  234. package/lib/components/StickyFooter/designTokens.d.ts +0 -10
  235. package/lib/components/StickyFooter/designTokens.js +0 -41
  236. package/lib/components/StickyFooter/index.d.ts +0 -13
  237. package/lib/components/StickyFooter/index.js +0 -132
  238. package/lib/components/StickyFooter/style/index.less +0 -18
  239. package/lib/components/StickyFooter/style/variables.less +0 -4
  240. package/lib/components/Tabs/designTokens.d.ts +0 -32
  241. package/lib/components/Tabs/designTokens.js +0 -70
  242. package/lib/components/Tabs/index.d.ts +0 -13
  243. package/lib/components/Tabs/index.js +0 -120
  244. package/lib/components/Tabs/style/index.less +0 -19
  245. package/lib/components/Tabs/style/variables.less +0 -4
  246. package/lib/components/Tag/designTokens.d.ts +0 -92
  247. package/lib/components/Tag/designTokens.js +0 -183
  248. package/lib/components/Tag/index.d.ts +0 -15
  249. package/lib/components/Tag/index.js +0 -146
  250. package/lib/components/Tag/style/index.less +0 -9
  251. package/lib/components/Tag/style/variables.less +0 -4
  252. package/lib/components/Text/designTokens.d.ts +0 -23
  253. package/lib/components/Text/designTokens.js +0 -47
  254. package/lib/components/Text/index.d.ts +0 -13
  255. package/lib/components/Text/index.js +0 -353
  256. package/lib/components/Text/style/index.less +0 -2
  257. package/lib/components/Text/style/variables.less +0 -4
  258. package/lib/components/TextLink/designTokens.d.ts +0 -10
  259. package/lib/components/TextLink/designTokens.js +0 -45
  260. package/lib/components/TextLink/index.d.ts +0 -19
  261. package/lib/components/TextLink/index.js +0 -119
  262. package/lib/components/Toast/designTokens.d.ts +0 -13
  263. package/lib/components/Toast/designTokens.js +0 -40
  264. package/lib/components/Toast/index.d.ts +0 -25
  265. package/lib/components/Toast/index.js +0 -208
  266. package/lib/components/Toast/style/index.less +0 -18
  267. package/lib/components/Toast/style/variables.less +0 -12
  268. package/lib/components/Toggle/designTokens.d.ts +0 -9
  269. package/lib/components/Toggle/designTokens.js +0 -47
  270. package/lib/components/Toggle/index.d.ts +0 -27
  271. package/lib/components/Toggle/index.js +0 -67
  272. package/lib/components/index.d.ts +0 -35
  273. package/lib/components/index.js +0 -71
  274. package/lib/constants/index.d.ts +0 -15
  275. package/lib/constants/index.js +0 -41
  276. package/lib/fonts/Poppins/Poppins-Bold.ttf +0 -0
  277. package/lib/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  278. package/lib/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  279. package/lib/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  280. package/lib/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  281. package/lib/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  282. package/lib/fonts/Poppins/Poppins-Italic.ttf +0 -0
  283. package/lib/fonts/Poppins/Poppins-Light.ttf +0 -0
  284. package/lib/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  285. package/lib/fonts/Poppins/Poppins-Medium.ttf +0 -0
  286. package/lib/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  287. package/lib/fonts/Poppins/Poppins-Regular.ttf +0 -0
  288. package/lib/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  289. package/lib/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  290. package/lib/fonts/Poppins/Poppins-Thin.ttf +0 -0
  291. package/lib/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  292. package/lib/fonts/Roboto/Roboto-Black.ttf +0 -0
  293. package/lib/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  294. package/lib/fonts/Roboto/Roboto-Bold.ttf +0 -0
  295. package/lib/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  296. package/lib/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
  297. package/lib/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
  298. package/lib/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
  299. package/lib/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
  300. package/lib/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  301. package/lib/fonts/Roboto/Roboto-Italic.ttf +0 -0
  302. package/lib/fonts/Roboto/Roboto-Light.ttf +0 -0
  303. package/lib/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  304. package/lib/fonts/Roboto/Roboto-Medium.ttf +0 -0
  305. package/lib/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  306. package/lib/fonts/Roboto/Roboto-Regular.ttf +0 -0
  307. package/lib/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
  308. package/lib/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
  309. package/lib/fonts/Roboto/Roboto-Thin.ttf +0 -0
  310. package/lib/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  311. package/lib/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  312. package/lib/index.d.ts +0 -3
  313. package/lib/index.js +0 -21
  314. package/lib/style/antdDesignToken.json +0 -503
  315. package/lib/style/themes/base-vars.css +0 -6
  316. package/lib/style/themes/colorful.css +0 -5
  317. package/lib/style/themes/index.css +0 -4
  318. package/lib/style/variables.less +0 -34
  319. package/lib/tokens/DXPGlobal.d.ts +0 -260
  320. package/lib/tokens/DXPGlobal.js +0 -37
  321. package/lib/utils/noop.d.ts +0 -1
  322. package/lib/utils/noop.js +0 -26
  323. package/lib/utils/scaleTool.d.ts +0 -12
  324. package/lib/utils/scaleTool.js +0 -66
  325. package/lib/utils/theme.d.ts +0 -11
  326. package/lib/utils/theme.js +0 -32
  327. package/lib/utils/themeContext.d.ts +0 -44
  328. package/lib/utils/themeContext.js +0 -117
  329. package/lib/utils/tokenHelper.d.ts +0 -1
  330. package/lib/utils/tokenHelper.js +0 -38
  331. package/lib/utils/tokenManager.d.ts +0 -1506
  332. package/lib/utils/tokenManager.js +0 -799
  333. package/umd/dxp-ui.min.css +0 -1
  334. package/umd/dxp-ui.min.js +0 -1
  335. package/umd/static/Poppins-Bold.8001a01b.ttf +0 -0
  336. package/umd/static/Roboto-Bold.ff276312.ttf +0 -0
  337. package/umd/static/Roboto-Regular.a5023d7b.ttf +0 -0
  338. package/umd/static/Roboto-SemiBold.3452daa4.ttf +0 -0
  339. package/umd/static/iconfont.176e7470.svg +0 -1
  340. package/umd/static/iconfont.47a0c957.ttf +0 -0
  341. package/umd/static/iconfont.6f470e01.eot +0 -0
  342. package/umd/static/iconfont.796b49bb.woff +0 -0
package/README.md CHANGED
@@ -9,7 +9,9 @@ React Component.
9
9
  ## Install
10
10
 
11
11
  ```bash | pure
12
- npm install @digitalc/dxp-ui
12
+ npm install @digitalc/dxp-ui
13
+ // 注意不在在 官方源上安装依赖,可以设置 npm 的镜像源。
14
+ npm config set registry https://registry.npmjs.org/
13
15
  ```
14
16
 
15
17
  ## Usage
@@ -17,10 +19,10 @@ npm install @digitalc/dxp-ui
17
19
  <!-- prettier-ignore -->
18
20
  ```tsx | pure
19
21
  import { Button } from '@digitalc/dxp-ui';
22
+ // 后续完善打包工具后,会自动引入样式,目前如果样式不对的情况下,需要手动引入样式。
20
23
  import "@digitalc/dxp-ui/umd/dxp-ui.min.css"
21
24
 
22
25
  const Demo = () => {
23
-
24
26
  return (
25
27
  <div style={{ margin: 20 }}>
26
28
  <div>
@@ -36,15 +38,114 @@ const Demo = () => {
36
38
 
37
39
  export default Demo;
38
40
  ```
41
+
39
42
  注意:
40
43
  如果是使用的 Umi4、Vite 5 和 Turbopack 将原生支持智能样式编译的(:内置各种语言预处理工具),可以直接引用即可。
41
44
 
42
45
  但如果是 使用的 webpack 或 umi3 脚手架的前端项目,需要在内部的 webpack 配置less编译。(因为包是esm格式,并支持了按需加载,所以没编译less文件),具体是通过 webpack-chain 添加指定的包,并进行构建。
43
46
 
47
+ ```
48
+ chainWebpack(memo, { webpack, env }) {
49
+ // 额外 处理 dxp-ui-less... 需要安装 less-loader: npm install less-loader --save-dev
50
+
51
+ 代码在下面,第4条。
52
+
53
+ }
54
+ ```
55
+
56
+ ## 兼容 @digitalc/dxp-ui 组件库
57
+
58
+ dxp-ui 使用了 antd5 做二次开发,但在"umi": "^3.x"项目中,已有组件库版本是 antd 4.x。
59
+ 底层依赖的版本与4有差异,编译时会报错,所以需要兼容 @digitalc/dxp-ui 组件库。
60
+
61
+ 整体兼容方案如下:
44
62
 
63
+ ### 1、安装两个版本npm
64
+
65
+ 如果必须需要用到 antd4 版本,可以看这篇 antd 多版本共存:
66
+ https://ant-design.antgroup.com/docs/react/migration-v5-cn
67
+
68
+ 5.0 有哪些不兼容的变化: https://ant-design.antgroup.com/docs/react/migration-v5-cn
69
+
70
+ ```bash
71
+ 在 package.json 文件,添加以下内容,并执行 npm install :
72
+ "@digitalc/dxp-ui": "^0.0.5-alpha.6",
73
+ "antd": "^5.24.5",
74
+ "antd4": "npm:antd@4.24.16", // 兼容 antd4 ,但需要把 antd 前缀让出来。
45
75
  ```
76
+
77
+ ### 2、在 umi.config.ts 中配置以下代码:
78
+
79
+ ```js
80
+ export default {
81
+ antd: false, // 关闭 antd 的默认载入
82
+ esbuild: {},
83
+ // nodeModulesTransform: {
84
+ // type: 'none',
85
+ // },
86
+ };
87
+ ```
88
+
89
+ 替换压缩器为 esbuild这一步是因为比 webpack 快,非强制,如果开启,需要安装依赖。
90
+
91
+ ```bash
92
+ $ yarn add @umijs/plugin-esbuild
93
+ ```
94
+
95
+ 默认会处理 node_modules 中的代码,这个打开后就不会处理 node_modules 中的代码,导致打包格式不对。 Umi 以下配置不要打开(必须关闭))。
96
+
97
+ ```js
98
+ // nodeModulesTransform: {
99
+ // type: 'none',
100
+ // },
101
+ ```
102
+
103
+ ### 3、在 根 BaseLayout.jsx 中,引入 ConfigProvider,将 children 用 ConfigProvider 包裹。
104
+
105
+ ```js
106
+ import { ConfigProvider as Antd5ConfigProvider } from 'antd';
107
+
108
+ // antd5 配置前缀,防止与 antd4 css 冲突
109
+ <Antd5ConfigProvider
110
+ prefixCls={'ant5'}
111
+ theme={{
112
+ cssVar: true,
113
+ hashed: false,
114
+ }}
115
+ >
116
+ {children}
117
+ </Antd5ConfigProvider>;
118
+ ```
119
+
120
+ ### 4、正常情况下,已经可用了,不需要配置额外操作(也不需要将之前的antd,改成antd4,直接用5覆盖,具体修改内容:看下v4 to v5 升级指南)。
121
+
122
+ ```js
123
+ import { Button as AntdBtn4 } from 'antd4';
124
+ import { Button as AntdBtn5 } from 'antd';
125
+ import { Button, IconButton, IconButtonGroup, Toast, Stepper } from '@digitalc/dxp-ui';
126
+
127
+
128
+ <Button type="primary">Primary Button</Button>
129
+ <AntdBtn4>antd4 Button</AntdBtn4>
130
+ <AntdBtn5>antd5 Button</AntdBtn5>
131
+
132
+
133
+ ```
134
+
135
+ 示例图:
136
+
137
+ ![image.png](https://p.ipic.vip/xa5nz7.png)
138
+
139
+ 改完后,尽量对项目做全量测试。
140
+ 如果出现 less 格式不对,则需要做额外处理。
141
+
142
+ 原因是使用的 Umi4、Vite 5 和 Turbopack 将原生支持智能样式编译的(:内置各种语言预处理工具),可以直接引用即可。
143
+
144
+ 但如果是使用的 webpack 或 umi3 脚手架的前端项目,需要在内部的 webpack 配置less编译。(因为包是esm格式,并支持了按需加载,所以没编译less文件),具体是通过 webpack-chain 添加指定的包,并进行构建。
145
+
146
+ ```bash
46
147
  chainWebpack(memo, { webpack, env }) {
47
- // 额外 处理 dxp-ui-less...
148
+ // 额外 处理 dxp-ui-less... 需要安装 less-loader: npm install less-loader --save-dev
48
149
  memo.module
49
150
  .rule('dxp-ui-less')
50
151
  .test(/\.less$/)
@@ -62,6 +163,9 @@ export default Demo;
62
163
  // 其他自定义变量...
63
164
  },
64
165
  });
65
- // end...
66
166
  }
67
167
  ```
168
+
169
+ end。
170
+
171
+ <img src="https://p.ipic.vip/xa5nz7.png" width="880" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalc/dxp-ui",
3
- "version": "0.0.5-alpha.6",
3
+ "version": "0.0.5-alpha.8",
4
4
  "description": "A UI library of Digitalc Design React Component",
5
5
  "keywords": [
6
6
  "react",
@@ -35,7 +35,6 @@
35
35
  "lint:css": "stylelint \"src/**/*.{less,css}\"",
36
36
  "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
37
37
  "prepare": "dumi setup",
38
- "prepublishOnly": "father doctor && npm run build",
39
38
  "prepublishOnly1": "npm run build && SKIP_TESTS=true np --no-cleanup --any-branch --no-publish --no-test",
40
39
  "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,scss,md,json}\"",
41
40
  "publish": "npm publish --access public",
@@ -118,7 +117,7 @@
118
117
  "react-dom": "^18.3.1 || ^19.0.0"
119
118
  },
120
119
  "engines": {
121
- "node": ">=8.x"
120
+ "node": ">=14.x"
122
121
  },
123
122
  "publishConfig": {
124
123
  "access": "public"
@@ -1,539 +0,0 @@
1
- /* Logo 字体 */
2
- @font-face {
3
- font-family: "iconfont logo";
4
- src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
5
- src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
6
- url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
7
- url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
8
- url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
9
- }
10
-
11
- .logo {
12
- font-family: "iconfont logo";
13
- font-size: 160px;
14
- font-style: normal;
15
- -webkit-font-smoothing: antialiased;
16
- -moz-osx-font-smoothing: grayscale;
17
- }
18
-
19
- /* tabs */
20
- .nav-tabs {
21
- position: relative;
22
- }
23
-
24
- .nav-tabs .nav-more {
25
- position: absolute;
26
- right: 0;
27
- bottom: 0;
28
- height: 42px;
29
- line-height: 42px;
30
- color: #666;
31
- }
32
-
33
- #tabs {
34
- border-bottom: 1px solid #eee;
35
- }
36
-
37
- #tabs li {
38
- cursor: pointer;
39
- width: 100px;
40
- height: 40px;
41
- line-height: 40px;
42
- text-align: center;
43
- font-size: 16px;
44
- border-bottom: 2px solid transparent;
45
- position: relative;
46
- z-index: 1;
47
- margin-bottom: -1px;
48
- color: #666;
49
- }
50
-
51
-
52
- #tabs .active {
53
- border-bottom-color: #f00;
54
- color: #222;
55
- }
56
-
57
- .tab-container .content {
58
- display: none;
59
- }
60
-
61
- /* 页面布局 */
62
- .main {
63
- padding: 30px 100px;
64
- width: 960px;
65
- margin: 0 auto;
66
- }
67
-
68
- .main .logo {
69
- color: #333;
70
- text-align: left;
71
- margin-bottom: 30px;
72
- line-height: 1;
73
- height: 110px;
74
- margin-top: -50px;
75
- overflow: hidden;
76
- *zoom: 1;
77
- }
78
-
79
- .main .logo a {
80
- font-size: 160px;
81
- color: #333;
82
- }
83
-
84
- .helps {
85
- margin-top: 40px;
86
- }
87
-
88
- .helps pre {
89
- padding: 20px;
90
- margin: 10px 0;
91
- border: solid 1px #e7e1cd;
92
- background-color: #fffdef;
93
- overflow: auto;
94
- }
95
-
96
- .icon_lists {
97
- width: 100% !important;
98
- overflow: hidden;
99
- *zoom: 1;
100
- }
101
-
102
- .icon_lists li {
103
- width: 100px;
104
- margin-bottom: 10px;
105
- margin-right: 20px;
106
- text-align: center;
107
- list-style: none !important;
108
- cursor: default;
109
- }
110
-
111
- .icon_lists li .code-name {
112
- line-height: 1.2;
113
- }
114
-
115
- .icon_lists .icon {
116
- display: block;
117
- height: 100px;
118
- line-height: 100px;
119
- font-size: 42px;
120
- margin: 10px auto;
121
- color: #333;
122
- -webkit-transition: font-size 0.25s linear, width 0.25s linear;
123
- -moz-transition: font-size 0.25s linear, width 0.25s linear;
124
- transition: font-size 0.25s linear, width 0.25s linear;
125
- }
126
-
127
- .icon_lists .icon:hover {
128
- font-size: 100px;
129
- }
130
-
131
- .icon_lists .svg-icon {
132
- /* 通过设置 font-size 来改变图标大小 */
133
- width: 1em;
134
- /* 图标和文字相邻时,垂直对齐 */
135
- vertical-align: -0.15em;
136
- /* 通过设置 color 来改变 SVG 的颜色/fill */
137
- fill: currentColor;
138
- /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
139
- normalize.css 中也包含这行 */
140
- overflow: hidden;
141
- }
142
-
143
- .icon_lists li .name,
144
- .icon_lists li .code-name {
145
- color: #666;
146
- }
147
-
148
- /* markdown 样式 */
149
- .markdown {
150
- color: #666;
151
- font-size: 14px;
152
- line-height: 1.8;
153
- }
154
-
155
- .highlight {
156
- line-height: 1.5;
157
- }
158
-
159
- .markdown img {
160
- vertical-align: middle;
161
- max-width: 100%;
162
- }
163
-
164
- .markdown h1 {
165
- color: #404040;
166
- font-weight: 500;
167
- line-height: 40px;
168
- margin-bottom: 24px;
169
- }
170
-
171
- .markdown h2,
172
- .markdown h3,
173
- .markdown h4,
174
- .markdown h5,
175
- .markdown h6 {
176
- color: #404040;
177
- margin: 1.6em 0 0.6em 0;
178
- font-weight: 500;
179
- clear: both;
180
- }
181
-
182
- .markdown h1 {
183
- font-size: 28px;
184
- }
185
-
186
- .markdown h2 {
187
- font-size: 22px;
188
- }
189
-
190
- .markdown h3 {
191
- font-size: 16px;
192
- }
193
-
194
- .markdown h4 {
195
- font-size: 14px;
196
- }
197
-
198
- .markdown h5 {
199
- font-size: 12px;
200
- }
201
-
202
- .markdown h6 {
203
- font-size: 12px;
204
- }
205
-
206
- .markdown hr {
207
- height: 1px;
208
- border: 0;
209
- background: #e9e9e9;
210
- margin: 16px 0;
211
- clear: both;
212
- }
213
-
214
- .markdown p {
215
- margin: 1em 0;
216
- }
217
-
218
- .markdown>p,
219
- .markdown>blockquote,
220
- .markdown>.highlight,
221
- .markdown>ol,
222
- .markdown>ul {
223
- width: 80%;
224
- }
225
-
226
- .markdown ul>li {
227
- list-style: circle;
228
- }
229
-
230
- .markdown>ul li,
231
- .markdown blockquote ul>li {
232
- margin-left: 20px;
233
- padding-left: 4px;
234
- }
235
-
236
- .markdown>ul li p,
237
- .markdown>ol li p {
238
- margin: 0.6em 0;
239
- }
240
-
241
- .markdown ol>li {
242
- list-style: decimal;
243
- }
244
-
245
- .markdown>ol li,
246
- .markdown blockquote ol>li {
247
- margin-left: 20px;
248
- padding-left: 4px;
249
- }
250
-
251
- .markdown code {
252
- margin: 0 3px;
253
- padding: 0 5px;
254
- background: #eee;
255
- border-radius: 3px;
256
- }
257
-
258
- .markdown strong,
259
- .markdown b {
260
- font-weight: 600;
261
- }
262
-
263
- .markdown>table {
264
- border-collapse: collapse;
265
- border-spacing: 0px;
266
- empty-cells: show;
267
- border: 1px solid #e9e9e9;
268
- width: 95%;
269
- margin-bottom: 24px;
270
- }
271
-
272
- .markdown>table th {
273
- white-space: nowrap;
274
- color: #333;
275
- font-weight: 600;
276
- }
277
-
278
- .markdown>table th,
279
- .markdown>table td {
280
- border: 1px solid #e9e9e9;
281
- padding: 8px 16px;
282
- text-align: left;
283
- }
284
-
285
- .markdown>table th {
286
- background: #F7F7F7;
287
- }
288
-
289
- .markdown blockquote {
290
- font-size: 90%;
291
- color: #999;
292
- border-left: 4px solid #e9e9e9;
293
- padding-left: 0.8em;
294
- margin: 1em 0;
295
- }
296
-
297
- .markdown blockquote p {
298
- margin: 0;
299
- }
300
-
301
- .markdown .anchor {
302
- opacity: 0;
303
- transition: opacity 0.3s ease;
304
- margin-left: 8px;
305
- }
306
-
307
- .markdown .waiting {
308
- color: #ccc;
309
- }
310
-
311
- .markdown h1:hover .anchor,
312
- .markdown h2:hover .anchor,
313
- .markdown h3:hover .anchor,
314
- .markdown h4:hover .anchor,
315
- .markdown h5:hover .anchor,
316
- .markdown h6:hover .anchor {
317
- opacity: 1;
318
- display: inline-block;
319
- }
320
-
321
- .markdown>br,
322
- .markdown>p>br {
323
- clear: both;
324
- }
325
-
326
-
327
- .hljs {
328
- display: block;
329
- background: white;
330
- padding: 0.5em;
331
- color: #333333;
332
- overflow-x: auto;
333
- }
334
-
335
- .hljs-comment,
336
- .hljs-meta {
337
- color: #969896;
338
- }
339
-
340
- .hljs-string,
341
- .hljs-variable,
342
- .hljs-template-variable,
343
- .hljs-strong,
344
- .hljs-emphasis,
345
- .hljs-quote {
346
- color: #df5000;
347
- }
348
-
349
- .hljs-keyword,
350
- .hljs-selector-tag,
351
- .hljs-type {
352
- color: #a71d5d;
353
- }
354
-
355
- .hljs-literal,
356
- .hljs-symbol,
357
- .hljs-bullet,
358
- .hljs-attribute {
359
- color: #0086b3;
360
- }
361
-
362
- .hljs-section,
363
- .hljs-name {
364
- color: #63a35c;
365
- }
366
-
367
- .hljs-tag {
368
- color: #333333;
369
- }
370
-
371
- .hljs-title,
372
- .hljs-attr,
373
- .hljs-selector-id,
374
- .hljs-selector-class,
375
- .hljs-selector-attr,
376
- .hljs-selector-pseudo {
377
- color: #795da3;
378
- }
379
-
380
- .hljs-addition {
381
- color: #55a532;
382
- background-color: #eaffea;
383
- }
384
-
385
- .hljs-deletion {
386
- color: #bd2c00;
387
- background-color: #ffecec;
388
- }
389
-
390
- .hljs-link {
391
- text-decoration: underline;
392
- }
393
-
394
- /* 代码高亮 */
395
- /* PrismJS 1.15.0
396
- https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
397
- /**
398
- * prism.js default theme for JavaScript, CSS and HTML
399
- * Based on dabblet (http://dabblet.com)
400
- * @author Lea Verou
401
- */
402
- code[class*="language-"],
403
- pre[class*="language-"] {
404
- color: black;
405
- background: none;
406
- text-shadow: 0 1px white;
407
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
408
- text-align: left;
409
- white-space: pre;
410
- word-spacing: normal;
411
- word-break: normal;
412
- word-wrap: normal;
413
- line-height: 1.5;
414
-
415
- -moz-tab-size: 4;
416
- -o-tab-size: 4;
417
- tab-size: 4;
418
-
419
- -webkit-hyphens: none;
420
- -moz-hyphens: none;
421
- -ms-hyphens: none;
422
- hyphens: none;
423
- }
424
-
425
- pre[class*="language-"]::-moz-selection,
426
- pre[class*="language-"] ::-moz-selection,
427
- code[class*="language-"]::-moz-selection,
428
- code[class*="language-"] ::-moz-selection {
429
- text-shadow: none;
430
- background: #b3d4fc;
431
- }
432
-
433
- pre[class*="language-"]::selection,
434
- pre[class*="language-"] ::selection,
435
- code[class*="language-"]::selection,
436
- code[class*="language-"] ::selection {
437
- text-shadow: none;
438
- background: #b3d4fc;
439
- }
440
-
441
- @media print {
442
-
443
- code[class*="language-"],
444
- pre[class*="language-"] {
445
- text-shadow: none;
446
- }
447
- }
448
-
449
- /* Code blocks */
450
- pre[class*="language-"] {
451
- padding: 1em;
452
- margin: .5em 0;
453
- overflow: auto;
454
- }
455
-
456
- :not(pre)>code[class*="language-"],
457
- pre[class*="language-"] {
458
- background: #f5f2f0;
459
- }
460
-
461
- /* Inline code */
462
- :not(pre)>code[class*="language-"] {
463
- padding: .1em;
464
- border-radius: .3em;
465
- white-space: normal;
466
- }
467
-
468
- .token.comment,
469
- .token.prolog,
470
- .token.doctype,
471
- .token.cdata {
472
- color: slategray;
473
- }
474
-
475
- .token.punctuation {
476
- color: #999;
477
- }
478
-
479
- .namespace {
480
- opacity: .7;
481
- }
482
-
483
- .token.property,
484
- .token.tag,
485
- .token.boolean,
486
- .token.number,
487
- .token.constant,
488
- .token.symbol,
489
- .token.deleted {
490
- color: #905;
491
- }
492
-
493
- .token.selector,
494
- .token.attr-name,
495
- .token.string,
496
- .token.char,
497
- .token.builtin,
498
- .token.inserted {
499
- color: #690;
500
- }
501
-
502
- .token.operator,
503
- .token.entity,
504
- .token.url,
505
- .language-css .token.string,
506
- .style .token.string {
507
- color: #9a6e3a;
508
- background: hsla(0, 0%, 100%, .5);
509
- }
510
-
511
- .token.atrule,
512
- .token.attr-value,
513
- .token.keyword {
514
- color: #07a;
515
- }
516
-
517
- .token.function,
518
- .token.class-name {
519
- color: #DD4A68;
520
- }
521
-
522
- .token.regex,
523
- .token.important,
524
- .token.variable {
525
- color: #e90;
526
- }
527
-
528
- .token.important,
529
- .token.bold {
530
- font-weight: bold;
531
- }
532
-
533
- .token.italic {
534
- font-style: italic;
535
- }
536
-
537
- .token.entity {
538
- cursor: help;
539
- }