@digitalc/dxp-ui 0.0.4 → 0.0.5-alpha.10

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 (373) hide show
  1. package/README.md +149 -11
  2. package/es/assets/iconFont/demo.css +539 -0
  3. package/es/assets/iconFont/demo_index.html +4400 -0
  4. package/es/assets/iconFont/iconfont.css +22 -6
  5. package/es/assets/iconFont/iconfont.eot +0 -0
  6. package/es/assets/iconFont/iconfont.json +28 -0
  7. package/es/assets/iconFont/iconfont.svg +8 -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/react.svg +1 -0
  12. package/es/assets/token.json +898 -237
  13. package/es/components/Accordion/designTokens.d.ts +11 -0
  14. package/es/components/Accordion/designTokens.js +16 -0
  15. package/es/components/Accordion/index.d.ts +21 -0
  16. package/es/components/Accordion/index.js +77 -0
  17. package/es/components/Accordion/style/index.less +14 -0
  18. package/es/components/Accordion/style/variables.less +4 -0
  19. package/es/components/Amount/designTokens.d.ts +6 -0
  20. package/es/components/Amount/designTokens.js +9 -0
  21. package/es/components/Amount/index.d.ts +22 -0
  22. package/es/components/Amount/index.js +139 -0
  23. package/es/components/Amount/style/index.less +10 -0
  24. package/es/components/Amount/style/variables.less +4 -0
  25. package/es/components/Button/designTokens.js +6 -7
  26. package/es/components/Button/index.d.ts +3 -4
  27. package/es/components/Button/index.js +29 -36
  28. package/es/components/Button/style/{button.less → index.less} +6 -2
  29. package/es/components/Chip/designTokens.d.ts +15 -0
  30. package/es/components/Chip/designTokens.js +22 -0
  31. package/es/components/Chip/index.d.ts +13 -0
  32. package/es/components/Chip/index.js +98 -0
  33. package/es/components/Chip/style/index.less +9 -0
  34. package/es/components/Chip/style/variables.less +4 -0
  35. package/es/components/Divider/index.d.ts +16 -0
  36. package/es/components/Divider/index.js +55 -0
  37. package/es/components/Divider/style/index.less +78 -0
  38. package/es/components/Divider/style/variables.less +4 -0
  39. package/es/components/Drawer/designTokens.d.ts +16 -0
  40. package/es/components/Drawer/designTokens.js +27 -0
  41. package/es/components/Drawer/index.d.ts +21 -0
  42. package/es/components/Drawer/index.js +189 -0
  43. package/es/components/Drawer/style/index.less +73 -0
  44. package/es/components/Drawer/style/variables.less +8 -0
  45. package/es/components/Icon/Icon.d.ts +9 -0
  46. package/es/components/Icon/Icon.js +18 -0
  47. package/es/components/Icon/designTokens.d.ts +6 -0
  48. package/es/components/Icon/designTokens.js +7 -0
  49. package/es/components/Icon/index.d.ts +12 -0
  50. package/es/components/Icon/index.js +29 -0
  51. package/es/components/IconButton/designTokens.d.ts +21 -0
  52. package/es/components/IconButton/designTokens.js +39 -0
  53. package/es/components/IconButton/index.d.ts +23 -0
  54. package/es/components/IconButton/index.js +105 -0
  55. package/es/components/IconButton/style/index.less +59 -0
  56. package/es/components/IconButton/style/variables.less +5 -0
  57. package/es/components/IconButtonGroup/index.d.ts +15 -0
  58. package/es/components/IconButtonGroup/index.js +22 -0
  59. package/es/components/Image/index.d.ts +10 -0
  60. package/es/components/Image/index.js +24 -0
  61. package/es/components/Modal/designTokens.d.ts +31 -0
  62. package/es/components/Modal/designTokens.js +35 -0
  63. package/es/components/Modal/index.d.ts +14 -0
  64. package/es/components/Modal/index.js +101 -0
  65. package/es/components/Modal/style/index.less +92 -0
  66. package/es/components/Modal/style/variables.less +5 -0
  67. package/es/components/Navigation/designTokens.d.ts +16 -0
  68. package/es/components/Navigation/designTokens.js +19 -0
  69. package/es/components/Navigation/index.d.ts +28 -0
  70. package/es/components/Navigation/index.js +103 -0
  71. package/es/components/Navigation/style/index.less +46 -0
  72. package/es/components/Navigation/style/variables.less +1 -0
  73. package/es/components/Search/designTokens.d.ts +34 -0
  74. package/es/components/Search/designTokens.js +51 -0
  75. package/es/components/Search/index.d.ts +13 -0
  76. package/es/components/Search/index.js +85 -0
  77. package/es/components/Search/style/index.less +32 -0
  78. package/es/components/Search/style/variables.less +5 -0
  79. package/es/components/Stepper/designTokens.d.ts +26 -0
  80. package/es/components/Stepper/designTokens.js +60 -0
  81. package/es/components/Stepper/index.d.ts +22 -0
  82. package/es/components/Stepper/index.js +153 -0
  83. package/es/components/Stepper/style/index.less +140 -0
  84. package/es/components/Stepper/style/variables.less +5 -0
  85. package/es/components/StickyFooter/designTokens.d.ts +10 -0
  86. package/es/components/StickyFooter/designTokens.js +17 -0
  87. package/es/components/StickyFooter/index.d.ts +13 -0
  88. package/es/components/StickyFooter/index.js +71 -0
  89. package/es/components/StickyFooter/style/index.less +18 -0
  90. package/es/components/StickyFooter/style/variables.less +4 -0
  91. package/es/components/Tabs/designTokens.d.ts +44 -0
  92. package/es/components/Tabs/designTokens.js +64 -0
  93. package/es/components/Tabs/index.d.ts +14 -0
  94. package/es/components/Tabs/index.js +102 -0
  95. package/es/components/Tabs/style/index.less +25 -0
  96. package/es/components/Tabs/style/variables.less +4 -0
  97. package/es/components/Tag/designTokens.d.ts +90 -0
  98. package/es/components/Tag/designTokens.js +124 -0
  99. package/es/components/Tag/index.d.ts +15 -0
  100. package/es/components/Tag/index.js +85 -0
  101. package/es/components/Tag/style/index.less +9 -0
  102. package/es/components/Tag/style/variables.less +4 -0
  103. package/es/components/Text/designTokens.d.ts +45 -0
  104. package/es/components/Text/designTokens.js +46 -0
  105. package/es/components/Text/index.d.ts +6 -25
  106. package/es/components/Text/index.js +57 -56
  107. package/es/components/Text/style/index.less +2 -0
  108. package/es/components/TextInputInside/designTokens.d.ts +38 -0
  109. package/es/components/TextInputInside/designTokens.js +59 -0
  110. package/es/components/TextInputInside/index.d.ts +10 -0
  111. package/es/components/TextInputInside/index.js +141 -0
  112. package/es/components/TextInputInside/style/index.less +36 -0
  113. package/es/components/TextInputInside/style/variables.less +5 -0
  114. package/es/components/TextInputOutside/designTokens.d.ts +41 -0
  115. package/es/components/TextInputOutside/designTokens.js +67 -0
  116. package/es/components/TextInputOutside/index.d.ts +18 -0
  117. package/es/components/TextInputOutside/index.js +66 -0
  118. package/es/components/TextInputOutside/style/index.less +4 -0
  119. package/es/components/TextInputOutside/style/variables.less +5 -0
  120. package/es/components/TextLink/designTokens.d.ts +10 -0
  121. package/es/components/TextLink/designTokens.js +11 -0
  122. package/es/components/TextLink/index.d.ts +20 -0
  123. package/es/components/TextLink/index.js +95 -0
  124. package/es/components/Toast/designTokens.d.ts +13 -0
  125. package/es/components/Toast/designTokens.js +20 -0
  126. package/es/components/Toast/index.d.ts +26 -0
  127. package/es/components/Toast/index.js +175 -0
  128. package/es/components/Toast/style/index.less +9 -0
  129. package/es/components/Toast/style/variables.less +12 -0
  130. package/es/components/Toggle/designTokens.d.ts +9 -0
  131. package/es/components/Toggle/designTokens.js +13 -0
  132. package/es/components/Toggle/index.d.ts +27 -0
  133. package/es/components/Toggle/index.js +21 -0
  134. package/es/components/index.d.ts +42 -0
  135. package/es/components/index.js +23 -2
  136. package/es/constants/index.d.ts +1 -0
  137. package/es/constants/index.js +2 -2
  138. package/es/index.d.ts +1 -0
  139. package/es/index.js +1 -2
  140. package/es/tokens/DXPGlobal.d.ts +254 -193
  141. package/es/tokens/DXPGlobal.js +4 -3
  142. package/es/utils/noop.js +1 -2
  143. package/es/utils/scaleTool.d.ts +12 -0
  144. package/es/utils/scaleTool.js +48 -0
  145. package/es/utils/theme.d.ts +11 -0
  146. package/es/utils/theme.js +15 -0
  147. package/es/utils/themeContext.d.ts +35 -2
  148. package/es/utils/themeContext.js +27 -7
  149. package/es/utils/tokenHelper.js +1 -2
  150. package/es/utils/tokenManager.d.ts +98 -2
  151. package/es/utils/tokenManager.js +772 -724
  152. package/lib/assets/iconFont/demo.css +539 -0
  153. package/lib/assets/iconFont/demo_index.html +4400 -0
  154. package/lib/assets/iconFont/iconfont.css +750 -0
  155. package/lib/assets/iconFont/iconfont.eot +0 -0
  156. package/lib/assets/iconFont/iconfont.json +1290 -0
  157. package/lib/assets/iconFont/iconfont.svg +385 -0
  158. package/lib/assets/iconFont/iconfont.ttf +0 -0
  159. package/lib/assets/iconFont/iconfont.woff +0 -0
  160. package/lib/assets/iconFont/iconfont.woff2 +0 -0
  161. package/lib/assets/react.svg +1 -0
  162. package/lib/assets/token.json +900 -0
  163. package/lib/components/Accordion/designTokens.d.ts +11 -0
  164. package/lib/components/Accordion/designTokens.js +42 -0
  165. package/lib/components/Accordion/index.d.ts +21 -0
  166. package/lib/components/Accordion/index.js +96 -0
  167. package/lib/components/Accordion/style/index.less +14 -0
  168. package/lib/components/Accordion/style/variables.less +4 -0
  169. package/lib/components/Amount/designTokens.d.ts +6 -0
  170. package/lib/components/Amount/designTokens.js +33 -0
  171. package/lib/components/Amount/index.d.ts +22 -0
  172. package/lib/components/Amount/index.js +154 -0
  173. package/lib/components/Amount/style/index.less +10 -0
  174. package/lib/components/Amount/style/variables.less +4 -0
  175. package/lib/components/Button/designTokens.d.ts +66 -0
  176. package/lib/components/Button/designTokens.js +139 -0
  177. package/lib/components/Button/index.d.ts +43 -0
  178. package/lib/components/Button/index.js +101 -0
  179. package/lib/components/Button/style/index.less +38 -0
  180. package/lib/components/Button/style/variables.less +5 -0
  181. package/lib/components/Chip/designTokens.d.ts +15 -0
  182. package/lib/components/Chip/designTokens.js +45 -0
  183. package/lib/components/Chip/index.d.ts +13 -0
  184. package/lib/components/Chip/index.js +178 -0
  185. package/lib/components/Chip/style/index.less +9 -0
  186. package/lib/components/Chip/style/variables.less +4 -0
  187. package/lib/components/Divider/index.d.ts +16 -0
  188. package/lib/components/Divider/index.js +111 -0
  189. package/lib/components/Divider/style/index.less +78 -0
  190. package/lib/components/Divider/style/variables.less +4 -0
  191. package/lib/components/Drawer/designTokens.d.ts +16 -0
  192. package/lib/components/Drawer/designTokens.js +62 -0
  193. package/lib/components/Drawer/index.d.ts +21 -0
  194. package/lib/components/Drawer/index.js +229 -0
  195. package/lib/components/Drawer/style/index.less +73 -0
  196. package/lib/components/Drawer/style/variables.less +8 -0
  197. package/lib/components/Icon/Icon.d.ts +9 -0
  198. package/lib/components/Icon/Icon.js +74 -0
  199. package/lib/components/Icon/designTokens.d.ts +6 -0
  200. package/lib/components/Icon/designTokens.js +41 -0
  201. package/lib/components/Icon/index.d.ts +12 -0
  202. package/lib/components/Icon/index.js +73 -0
  203. package/lib/components/IconButton/designTokens.d.ts +21 -0
  204. package/lib/components/IconButton/designTokens.js +61 -0
  205. package/lib/components/IconButton/index.d.ts +23 -0
  206. package/lib/components/IconButton/index.js +200 -0
  207. package/lib/components/IconButton/style/index.less +59 -0
  208. package/lib/components/IconButton/style/variables.less +5 -0
  209. package/lib/components/IconButtonGroup/index.d.ts +15 -0
  210. package/lib/components/IconButtonGroup/index.js +53 -0
  211. package/lib/components/Image/index.d.ts +10 -0
  212. package/lib/components/Image/index.js +82 -0
  213. package/lib/components/Modal/designTokens.d.ts +31 -0
  214. package/lib/components/Modal/designTokens.js +88 -0
  215. package/lib/components/Modal/index.d.ts +14 -0
  216. package/lib/components/Modal/index.js +168 -0
  217. package/lib/components/Modal/style/index.less +92 -0
  218. package/lib/components/Modal/style/variables.less +5 -0
  219. package/lib/components/Navigation/designTokens.d.ts +16 -0
  220. package/lib/components/Navigation/designTokens.js +53 -0
  221. package/lib/components/Navigation/index.d.ts +28 -0
  222. package/lib/components/Navigation/index.js +160 -0
  223. package/lib/components/Navigation/style/index.less +46 -0
  224. package/lib/components/Navigation/style/variables.less +1 -0
  225. package/lib/components/Search/designTokens.d.ts +34 -0
  226. package/lib/components/Search/designTokens.js +77 -0
  227. package/lib/components/Search/index.d.ts +13 -0
  228. package/lib/components/Search/index.js +137 -0
  229. package/lib/components/Search/style/index.less +32 -0
  230. package/lib/components/Search/style/variables.less +5 -0
  231. package/lib/components/Stepper/designTokens.d.ts +26 -0
  232. package/lib/components/Stepper/designTokens.js +90 -0
  233. package/lib/components/Stepper/index.d.ts +22 -0
  234. package/lib/components/Stepper/index.js +118 -0
  235. package/lib/components/Stepper/style/index.less +140 -0
  236. package/lib/components/Stepper/style/variables.less +5 -0
  237. package/lib/components/StickyFooter/designTokens.d.ts +10 -0
  238. package/lib/components/StickyFooter/designTokens.js +41 -0
  239. package/lib/components/StickyFooter/index.d.ts +13 -0
  240. package/lib/components/StickyFooter/index.js +135 -0
  241. package/lib/components/StickyFooter/style/index.less +18 -0
  242. package/lib/components/StickyFooter/style/variables.less +4 -0
  243. package/lib/components/Tabs/designTokens.d.ts +44 -0
  244. package/lib/components/Tabs/designTokens.js +90 -0
  245. package/lib/components/Tabs/index.d.ts +14 -0
  246. package/lib/components/Tabs/index.js +145 -0
  247. package/lib/components/Tabs/style/index.less +25 -0
  248. package/lib/components/Tabs/style/variables.less +4 -0
  249. package/lib/components/Tag/designTokens.d.ts +90 -0
  250. package/lib/components/Tag/designTokens.js +181 -0
  251. package/lib/components/Tag/index.d.ts +15 -0
  252. package/lib/components/Tag/index.js +146 -0
  253. package/lib/components/Tag/style/index.less +9 -0
  254. package/lib/components/Tag/style/variables.less +4 -0
  255. package/lib/components/Text/designTokens.d.ts +45 -0
  256. package/lib/components/Text/designTokens.js +69 -0
  257. package/lib/components/Text/index.d.ts +13 -0
  258. package/lib/components/Text/index.js +417 -0
  259. package/lib/components/Text/style/index.less +2 -0
  260. package/lib/components/Text/style/variables.less +4 -0
  261. package/lib/components/TextInputInside/designTokens.d.ts +38 -0
  262. package/lib/components/TextInputInside/designTokens.js +100 -0
  263. package/lib/components/TextInputInside/index.d.ts +10 -0
  264. package/lib/components/TextInputInside/index.js +230 -0
  265. package/lib/components/TextInputInside/style/index.less +36 -0
  266. package/lib/components/TextInputInside/style/variables.less +5 -0
  267. package/lib/components/TextInputOutside/designTokens.d.ts +41 -0
  268. package/lib/components/TextInputOutside/designTokens.js +95 -0
  269. package/lib/components/TextInputOutside/index.d.ts +18 -0
  270. package/lib/components/TextInputOutside/index.js +110 -0
  271. package/lib/components/TextInputOutside/style/index.less +4 -0
  272. package/lib/components/TextInputOutside/style/variables.less +5 -0
  273. package/lib/components/TextLink/designTokens.d.ts +10 -0
  274. package/lib/components/TextLink/designTokens.js +45 -0
  275. package/lib/components/TextLink/index.d.ts +20 -0
  276. package/lib/components/TextLink/index.js +120 -0
  277. package/lib/components/Toast/designTokens.d.ts +13 -0
  278. package/lib/components/Toast/designTokens.js +40 -0
  279. package/lib/components/Toast/index.d.ts +26 -0
  280. package/lib/components/Toast/index.js +213 -0
  281. package/lib/components/Toast/style/index.less +9 -0
  282. package/lib/components/Toast/style/variables.less +12 -0
  283. package/lib/components/Toggle/designTokens.d.ts +9 -0
  284. package/lib/components/Toggle/designTokens.js +47 -0
  285. package/lib/components/Toggle/index.d.ts +27 -0
  286. package/lib/components/Toggle/index.js +67 -0
  287. package/lib/components/index.d.ts +46 -0
  288. package/lib/components/index.js +83 -0
  289. package/lib/constants/index.d.ts +16 -0
  290. package/lib/constants/index.js +42 -0
  291. package/lib/fonts/Poppins/Poppins-Bold.ttf +0 -0
  292. package/lib/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  293. package/lib/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  294. package/lib/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  295. package/lib/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  296. package/lib/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  297. package/lib/fonts/Poppins/Poppins-Italic.ttf +0 -0
  298. package/lib/fonts/Poppins/Poppins-Light.ttf +0 -0
  299. package/lib/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  300. package/lib/fonts/Poppins/Poppins-Medium.ttf +0 -0
  301. package/lib/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  302. package/lib/fonts/Poppins/Poppins-Regular.ttf +0 -0
  303. package/lib/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  304. package/lib/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  305. package/lib/fonts/Poppins/Poppins-Thin.ttf +0 -0
  306. package/lib/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  307. package/lib/fonts/Roboto/Roboto-Black.ttf +0 -0
  308. package/lib/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  309. package/lib/fonts/Roboto/Roboto-Bold.ttf +0 -0
  310. package/lib/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  311. package/lib/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
  312. package/lib/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
  313. package/lib/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
  314. package/lib/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
  315. package/lib/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
  316. package/lib/fonts/Roboto/Roboto-Italic.ttf +0 -0
  317. package/lib/fonts/Roboto/Roboto-Light.ttf +0 -0
  318. package/lib/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  319. package/lib/fonts/Roboto/Roboto-Medium.ttf +0 -0
  320. package/lib/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  321. package/lib/fonts/Roboto/Roboto-Regular.ttf +0 -0
  322. package/lib/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
  323. package/lib/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
  324. package/lib/fonts/Roboto/Roboto-Thin.ttf +0 -0
  325. package/lib/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  326. package/lib/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
  327. package/lib/index.d.ts +3 -0
  328. package/lib/index.js +21 -0
  329. package/lib/style/antdDesignToken.json +503 -0
  330. package/lib/style/themes/base-vars.css +6 -0
  331. package/lib/style/themes/colorful.css +5 -0
  332. package/lib/style/themes/index.css +4 -0
  333. package/lib/style/variables.less +34 -0
  334. package/lib/tokens/DXPGlobal.d.ts +301 -0
  335. package/lib/tokens/DXPGlobal.js +37 -0
  336. package/lib/utils/noop.d.ts +1 -0
  337. package/lib/utils/noop.js +26 -0
  338. package/lib/utils/scaleTool.d.ts +12 -0
  339. package/lib/utils/scaleTool.js +66 -0
  340. package/lib/utils/theme.d.ts +11 -0
  341. package/lib/utils/theme.js +32 -0
  342. package/lib/utils/themeContext.d.ts +44 -0
  343. package/lib/utils/themeContext.js +117 -0
  344. package/lib/utils/tokenHelper.d.ts +1 -0
  345. package/lib/utils/tokenHelper.js +38 -0
  346. package/lib/utils/tokenManager.d.ts +1560 -0
  347. package/lib/utils/tokenManager.js +827 -0
  348. package/package.json +28 -21
  349. package/umd/dxp-ui.min.css +1 -2
  350. package/umd/dxp-ui.min.js +1 -2
  351. package/umd/static/iconfont.176e7470.svg +1 -0
  352. package/umd/static/iconfont.47a0c957.ttf +0 -0
  353. package/umd/static/iconfont.6f470e01.eot +0 -0
  354. package/umd/static/iconfont.796b49bb.woff +0 -0
  355. package/es/assets/iconFont/iconfont.js +0 -44
  356. package/es/assets/iconFont/iconfont.js.map +0 -1
  357. package/es/components/Button/designTokens.js.map +0 -1
  358. package/es/components/Button/index.js.map +0 -1
  359. package/es/components/Button/index_backup.d.ts +0 -72
  360. package/es/components/Button/index_backup.js +0 -111
  361. package/es/components/Button/index_backup.js.map +0 -1
  362. package/es/components/Text/index.js.map +0 -1
  363. package/es/components/Text/style/text.less +0 -116
  364. package/es/components/index.js.map +0 -1
  365. package/es/constants/index.js.map +0 -1
  366. package/es/index.js.map +0 -1
  367. package/es/tokens/DXPGlobal.js.map +0 -1
  368. package/es/utils/noop.js.map +0 -1
  369. package/es/utils/themeContext.js.map +0 -1
  370. package/es/utils/tokenHelper.js.map +0 -1
  371. package/es/utils/tokenManager.js.map +0 -1
  372. package/umd/dxp-ui.min.css.map +0 -1
  373. package/umd/dxp-ui.min.js.map +0 -1
package/README.md CHANGED
@@ -4,12 +4,15 @@ React Component.
4
4
 
5
5
  ## Feature
6
6
 
7
- - React life cycle support @digitalc/dxp-ui component
7
+ - React life cycle support [@digitalc/dxp-ui](https://www.npmjs.com/package/@digitalc/dxp-ui) component
8
+ 目前计划是提供基于antd5的基础组件库,分别 支持 TM、esales、GOMO 不同风格,后续提供全量定业务组件库。即可不用使用第三方组件,快速切换组件风格,同时支持业务组件库,方便业务组件二次开发。
8
9
 
9
10
  ## Install
10
11
 
11
12
  ```bash | pure
12
13
  npm install @digitalc/dxp-ui
14
+ // 目前版本不稳定,推荐用官方源安装,如果其他源安装失败,可以设置 npm 的镜像源。
15
+ npm config set registry https://registry.npmjs.org/
13
16
  ```
14
17
 
15
18
  ## Usage
@@ -17,22 +20,157 @@ npm install @digitalc/dxp-ui
17
20
  <!-- prettier-ignore -->
18
21
  ```tsx | pure
19
22
  import { Button } from '@digitalc/dxp-ui';
23
+ // 后续完善打包工具后,会自动引入样式,目前如果样式不对的情况下,需要手动引入样式。
20
24
  import "@digitalc/dxp-ui/umd/dxp-ui.min.css"
21
25
 
22
26
  const Demo = () => {
23
-
24
27
  return (
25
- <div style={{ margin: 20 }}>
26
- <div>
27
- <Button>
28
- Create Button
29
- </Button>
30
- </div>
31
-
32
- <div style={{ height: 200 }} />
33
- </div>
28
+ <>
29
+ <Button type="primary" className="abac">
30
+ Primary Button
31
+ </Button>
32
+
33
+ <Button>Default Button</Button>
34
+
35
+ <Button disabled>Disabled Button</Button>
36
+
37
+ <Button inverse type="primary">
38
+ inverse Button
39
+ </Button>
40
+ </>
34
41
  );
35
42
  };
36
43
 
37
44
  export default Demo;
38
45
  ```
46
+
47
+ 注意:
48
+ 如果是使用的 Umi4、Vite 5 和 Turbopack 将原生支持智能样式编译的(:内置各种语言预处理工具),可以直接引用即可。
49
+
50
+ 但如果是 使用的 webpack 或 umi3 脚手架的前端项目,需要在内部的 webpack 配置less编译。(因为包是esm格式,并支持了按需加载,所以没编译less文件),具体是通过 webpack-chain 添加指定的包,并进行构建。
51
+
52
+ ```
53
+ chainWebpack(memo, { webpack, env }) {
54
+ // 额外 处理 dxp-ui-less... 需要安装 less-loader: npm install less-loader --save-dev
55
+
56
+ 代码在下面,第4条。
57
+
58
+ }
59
+ ```
60
+
61
+ ## 兼容 @digitalc/dxp-ui 组件库
62
+
63
+ dxp-ui 使用了 antd5 做二次开发,但在"umi": "^3.x"项目中,已有组件库版本是 antd 4.x。
64
+ 底层依赖的版本与4有差异,编译时会报错,所以需要兼容 @digitalc/dxp-ui 组件库。
65
+
66
+ 整体兼容方案如下:
67
+
68
+ ### 1、安装两个版本npm
69
+
70
+ 如果必须需要用到 antd4 版本,可以看这篇 antd 多版本共存:
71
+ https://ant-design.antgroup.com/docs/react/migration-v5-cn
72
+
73
+ 5.0 有哪些不兼容的变化: https://ant-design.antgroup.com/docs/react/migration-v5-cn
74
+
75
+ ```bash
76
+ 在 package.json 文件,添加以下内容,并执行 npm install :
77
+ "@digitalc/dxp-ui": "^0.0.5-alpha.6",
78
+ "antd": "^5.24.5",
79
+ "antd4": "npm:antd@4.24.16", // 兼容 antd4 ,但需要把 antd 前缀让出来。
80
+ ```
81
+
82
+ ### 2、在 umi.config.ts 中配置以下代码:
83
+
84
+ ```js
85
+ export default {
86
+ antd: false, // 关闭 antd 的默认载入
87
+ esbuild: {},
88
+ // nodeModulesTransform: {
89
+ // type: 'none',
90
+ // },
91
+ };
92
+ ```
93
+
94
+ 替换压缩器为 esbuild这一步是因为比 webpack 快,非强制,如果开启,需要安装依赖。
95
+
96
+ ```bash
97
+ $ yarn add @umijs/plugin-esbuild
98
+ ```
99
+
100
+ 默认会处理 node_modules 中的代码,这个打开后就不会处理 node_modules 中的代码,导致打包格式不对。 Umi 以下配置不要打开(必须关闭))。
101
+
102
+ ```js
103
+ // nodeModulesTransform: {
104
+ // type: 'none',
105
+ // },
106
+ ```
107
+
108
+ ### 3、在 根 BaseLayout.jsx 中,引入 ConfigProvider,将 children 用 ConfigProvider 包裹。
109
+
110
+ ```js
111
+ import { ConfigProvider as Antd5ConfigProvider } from 'antd';
112
+
113
+ // antd5 配置前缀,防止与 antd4 css 冲突
114
+ <Antd5ConfigProvider
115
+ prefixCls={'ant5'}
116
+ theme={{
117
+ cssVar: true,
118
+ hashed: false,
119
+ }}
120
+ >
121
+ {children}
122
+ </Antd5ConfigProvider>;
123
+ ```
124
+
125
+ ### 4、正常情况下,已经可用了,不需要配置额外操作(也不需要将之前的antd,改成antd4,直接用5覆盖,具体修改内容:看下v4 to v5 升级指南)。
126
+
127
+ ```js
128
+ import { Button as AntdBtn4 } from 'antd4';
129
+ import { Button as AntdBtn5 } from 'antd';
130
+ import { Button, IconButton, IconButtonGroup, Toast, Stepper } from '@digitalc/dxp-ui';
131
+
132
+
133
+ <Button type="primary">Primary Button</Button>
134
+ <AntdBtn4>antd4 Button</AntdBtn4>
135
+ <AntdBtn5>antd5 Button</AntdBtn5>
136
+
137
+
138
+ ```
139
+
140
+ 示例图:
141
+
142
+ ![image.png](https://p.ipic.vip/xa5nz7.png)
143
+
144
+ 改完后,尽量对项目做全量测试。
145
+ 如果出现 less 格式不对,则需要做额外处理。
146
+
147
+ 原因是使用的 Umi4、Vite 5 和 Turbopack 将原生支持智能样式编译的(:内置各种语言预处理工具),可以直接引用即可。
148
+
149
+ 但如果是使用的 webpack 或 umi3 脚手架的前端项目,需要在内部的 webpack 配置less编译。(因为包是esm格式,并支持了按需加载,所以没编译less文件),具体是通过 webpack-chain 添加指定的包,并进行构建。
150
+
151
+ ```bash
152
+ chainWebpack(memo, { webpack, env }) {
153
+ // 额外 处理 dxp-ui-less... 需要安装 less-loader: npm install less-loader --save-dev
154
+ memo.module
155
+ .rule('dxp-ui-less')
156
+ .test(/\.less$/)
157
+ .include.add(/node_modules[\\/]@digitalc[\\/]dxp-ui/) // 替换为你的包名(如 antd-mobile)
158
+ .end()
159
+ .use('less-loader')
160
+ .loader('less-loader')
161
+ .options({
162
+ lessOptions: {
163
+ javascriptEnabled: true,
164
+ // 可选:覆盖变量
165
+ modifyVars: {
166
+ 'primary-color': '#1890ff',
167
+ },
168
+ // 其他自定义变量...
169
+ },
170
+ });
171
+ }
172
+ ```
173
+
174
+ end。
175
+
176
+ <img src="https://p.ipic.vip/xa5nz7.png" width="880" />
@@ -0,0 +1,539 @@
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
+ }