@aloudata/aloudata-design 0.1.0-beta1

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 (293) hide show
  1. package/.editorconfig +16 -0
  2. package/.eslintrc.js +43 -0
  3. package/.fatherrc.ts +16 -0
  4. package/.prettierignore +7 -0
  5. package/.prettierrc.js +1 -0
  6. package/.stylelintrc.json +36 -0
  7. package/.umirc.ts +15 -0
  8. package/README.md +82 -0
  9. package/commitlint.config.js +21 -0
  10. package/docs/index.md +21 -0
  11. package/jest/setupTests.js +1 -0
  12. package/lib/Button/demo/Icon/index.d.ts +3 -0
  13. package/lib/Button/demo/Icon/index.js +82 -0
  14. package/lib/Button/demo/Icon/index.less +6 -0
  15. package/lib/Button/demo/basic/index.d.ts +4 -0
  16. package/lib/Button/demo/basic/index.js +73 -0
  17. package/lib/Button/demo/basic/index.less +7 -0
  18. package/lib/Button/demo/disable/index.d.ts +3 -0
  19. package/lib/Button/demo/disable/index.js +37 -0
  20. package/lib/Button/demo/disable/index.less +0 -0
  21. package/lib/Button/demo/href/index.d.ts +2 -0
  22. package/lib/Button/demo/href/index.js +30 -0
  23. package/lib/Button/demo/loading/index.d.ts +3 -0
  24. package/lib/Button/demo/loading/index.js +51 -0
  25. package/lib/Button/demo/loading/index.less +6 -0
  26. package/lib/Button/index.d.ts +50 -0
  27. package/lib/Button/index.js +124 -0
  28. package/lib/Button/style/index.d.ts +2 -0
  29. package/lib/Button/style/index.js +5 -0
  30. package/lib/Button/style/index.less +255 -0
  31. package/lib/Dropdown/Button.d.ts +69 -0
  32. package/lib/Dropdown/Button.js +52 -0
  33. package/lib/Dropdown/demo/basic/index.d.ts +4 -0
  34. package/lib/Dropdown/demo/basic/index.js +35 -0
  35. package/lib/Dropdown/demo/button/index.d.ts +3 -0
  36. package/lib/Dropdown/demo/button/index.js +182 -0
  37. package/lib/Dropdown/demo/button/index.less +9 -0
  38. package/lib/Dropdown/demo/placement/index.d.ts +2 -0
  39. package/lib/Dropdown/demo/placement/index.js +56 -0
  40. package/lib/Dropdown/demo/subMenu/index.d.ts +2 -0
  41. package/lib/Dropdown/demo/subMenu/index.js +59 -0
  42. package/lib/Dropdown/demo/trigger/index.d.ts +2 -0
  43. package/lib/Dropdown/demo/trigger/index.js +32 -0
  44. package/lib/Dropdown/index.d.ts +59 -0
  45. package/lib/Dropdown/index.js +47 -0
  46. package/lib/Dropdown/style/index.d.ts +2 -0
  47. package/lib/Dropdown/style/index.js +5 -0
  48. package/lib/Dropdown/style/index.less +40 -0
  49. package/lib/Icon/iconfont/demo.css +539 -0
  50. package/lib/Icon/iconfont/demo_index.html +628 -0
  51. package/lib/Icon/iconfont/iconfont.css +93 -0
  52. package/lib/Icon/iconfont/iconfont.js +48 -0
  53. package/lib/Icon/iconfont/iconfont.json +142 -0
  54. package/lib/Icon/iconfont/iconfont.ttf +0 -0
  55. package/lib/Icon/iconfont/iconfont.woff +0 -0
  56. package/lib/Icon/iconfont/iconfont.woff2 +0 -0
  57. package/lib/Icon/index.d.ts +11 -0
  58. package/lib/Icon/index.js +54 -0
  59. package/lib/Icon/index.less +32 -0
  60. package/lib/Input/components/Group/index.d.ts +15 -0
  61. package/lib/Input/components/Group/index.js +24 -0
  62. package/lib/Input/components/Password/index.d.ts +10 -0
  63. package/lib/Input/components/Password/index.js +33 -0
  64. package/lib/Input/components/TextArea/index.d.ts +52 -0
  65. package/lib/Input/components/TextArea/index.js +26 -0
  66. package/lib/Input/demo/allowClear/index.d.ts +3 -0
  67. package/lib/Input/demo/allowClear/index.js +25 -0
  68. package/lib/Input/demo/allowClear/index.less +0 -0
  69. package/lib/Input/demo/basic/index.d.ts +4 -0
  70. package/lib/Input/demo/basic/index.js +80 -0
  71. package/lib/Input/demo/basic/index.less +6 -0
  72. package/lib/Input/demo/gourp/index.d.ts +2 -0
  73. package/lib/Input/demo/gourp/index.js +81 -0
  74. package/lib/Input/demo/password/index.d.ts +3 -0
  75. package/lib/Input/demo/password/index.js +35 -0
  76. package/lib/Input/demo/password/index.less +0 -0
  77. package/lib/Input/demo/prefix/index.d.ts +3 -0
  78. package/lib/Input/demo/prefix/index.js +32 -0
  79. package/lib/Input/demo/prefix/index.less +0 -0
  80. package/lib/Input/demo/showCount/index.d.ts +3 -0
  81. package/lib/Input/demo/showCount/index.js +31 -0
  82. package/lib/Input/demo/showCount/index.less +0 -0
  83. package/lib/Input/demo/textArea/autoSize.d.ts +2 -0
  84. package/lib/Input/demo/textArea/autoSize.js +63 -0
  85. package/lib/Input/index.d.ts +65 -0
  86. package/lib/Input/index.js +63 -0
  87. package/lib/Input/style/index.d.ts +2 -0
  88. package/lib/Input/style/index.js +5 -0
  89. package/lib/Input/style/index.less +62 -0
  90. package/lib/Menu/Divider.d.ts +5 -0
  91. package/lib/Menu/Divider.js +28 -0
  92. package/lib/Menu/MenuItem.d.ts +17 -0
  93. package/lib/Menu/MenuItem.js +28 -0
  94. package/lib/Menu/SubMenu.d.ts +26 -0
  95. package/lib/Menu/SubMenu.js +44 -0
  96. package/lib/Menu/index.d.ts +20 -0
  97. package/lib/Menu/index.js +49 -0
  98. package/lib/Menu/style/index.d.ts +2 -0
  99. package/lib/Menu/style/index.js +5 -0
  100. package/lib/Menu/style/index.less +33 -0
  101. package/lib/Select/BaseSelect.d.ts +5 -0
  102. package/lib/Select/BaseSelect.js +433 -0
  103. package/lib/Select/OptionsList/OptGroup.d.ts +7 -0
  104. package/lib/Select/OptionsList/OptGroup.js +14 -0
  105. package/lib/Select/OptionsList/OptionItem.d.ts +35 -0
  106. package/lib/Select/OptionsList/OptionItem.js +185 -0
  107. package/lib/Select/OptionsList/Options.d.ts +7 -0
  108. package/lib/Select/OptionsList/Options.js +14 -0
  109. package/lib/Select/OptionsList/index.d.ts +4 -0
  110. package/lib/Select/OptionsList/index.js +207 -0
  111. package/lib/Select/Selector/index.d.ts +4 -0
  112. package/lib/Select/Selector/index.js +273 -0
  113. package/lib/Select/VirtualList.d.ts +5 -0
  114. package/lib/Select/VirtualList.js +42 -0
  115. package/lib/Select/demo/disabled/index.d.ts +2 -0
  116. package/lib/Select/demo/disabled/index.js +64 -0
  117. package/lib/Select/demo/multiple/index.d.ts +2 -0
  118. package/lib/Select/demo/multiple/index.js +154 -0
  119. package/lib/Select/demo/options/index.d.ts +2 -0
  120. package/lib/Select/demo/options/index.js +69 -0
  121. package/lib/Select/demo/single/index.d.ts +2 -0
  122. package/lib/Select/demo/single/index.js +99 -0
  123. package/lib/Select/hooks/useCacheOption.d.ts +9 -0
  124. package/lib/Select/hooks/useCacheOption.js +113 -0
  125. package/lib/Select/index.d.ts +12 -0
  126. package/lib/Select/index.js +34 -0
  127. package/lib/Select/interface.d.ts +221 -0
  128. package/lib/Select/interface.js +5 -0
  129. package/lib/Select/style/index.d.ts +2 -0
  130. package/lib/Select/style/index.js +5 -0
  131. package/lib/Select/style/index.less +539 -0
  132. package/lib/Select/utils.d.ts +21 -0
  133. package/lib/Select/utils.js +233 -0
  134. package/lib/Tabs/TabPane.d.ts +21 -0
  135. package/lib/Tabs/TabPane.js +24 -0
  136. package/lib/Tabs/demo/adaptHeight/index.d.ts +3 -0
  137. package/lib/Tabs/demo/adaptHeight/index.js +34 -0
  138. package/lib/Tabs/demo/adaptHeight/index.less +3 -0
  139. package/lib/Tabs/demo/basic/index.d.ts +4 -0
  140. package/lib/Tabs/demo/basic/index.js +67 -0
  141. package/lib/Tabs/demo/basic/index.less +5 -0
  142. package/lib/Tabs/demo/horizontalScroll/index.d.ts +3 -0
  143. package/lib/Tabs/demo/horizontalScroll/index.js +45 -0
  144. package/lib/Tabs/demo/horizontalScroll/index.less +3 -0
  145. package/lib/Tabs/index.d.ts +41 -0
  146. package/lib/Tabs/index.js +58 -0
  147. package/lib/Tabs/style/index.d.ts +2 -0
  148. package/lib/Tabs/style/index.js +5 -0
  149. package/lib/Tabs/style/index.less +61 -0
  150. package/lib/Tooltip/demo/basic/index.d.ts +2 -0
  151. package/lib/Tooltip/demo/basic/index.js +20 -0
  152. package/lib/Tooltip/demo/overflow/index.d.ts +2 -0
  153. package/lib/Tooltip/demo/overflow/index.js +20 -0
  154. package/lib/Tooltip/demo/placement/index.d.ts +6 -0
  155. package/lib/Tooltip/demo/placement/index.js +86 -0
  156. package/lib/Tooltip/demo/placement/index.less +7 -0
  157. package/lib/Tooltip/demo/trigger/index.d.ts +3 -0
  158. package/lib/Tooltip/demo/trigger/index.js +34 -0
  159. package/lib/Tooltip/demo/trigger/index.less +5 -0
  160. package/lib/Tooltip/index.d.ts +63 -0
  161. package/lib/Tooltip/index.js +44 -0
  162. package/lib/Tooltip/style/index.d.ts +2 -0
  163. package/lib/Tooltip/style/index.js +5 -0
  164. package/lib/Tooltip/style/index.less +14 -0
  165. package/lib/_utils/hooks/useControlledState.d.ts +2 -0
  166. package/lib/_utils/hooks/useControlledState.js +63 -0
  167. package/lib/_utils/hooks/usePrefixCls.d.ts +2 -0
  168. package/lib/_utils/hooks/usePrefixCls.js +27 -0
  169. package/lib/index.d.ts +8 -0
  170. package/lib/index.js +63 -0
  171. package/lib/style/index.d.ts +2 -0
  172. package/lib/style/index.js +5 -0
  173. package/lib/style/index.less +3 -0
  174. package/lib/style/mixins/index.less +0 -0
  175. package/lib/style/themes/default/index.less +36 -0
  176. package/lib/style/themes/default/themeColor.less +259 -0
  177. package/package.json +83 -0
  178. package/public/favicon.ico +0 -0
  179. package/src/Button/demo/Icon/index.less +6 -0
  180. package/src/Button/demo/Icon/index.tsx +41 -0
  181. package/src/Button/demo/basic/index.less +7 -0
  182. package/src/Button/demo/basic/index.tsx +26 -0
  183. package/src/Button/demo/disable/index.less +0 -0
  184. package/src/Button/demo/disable/index.tsx +16 -0
  185. package/src/Button/demo/href/index.tsx +14 -0
  186. package/src/Button/demo/loading/index.less +6 -0
  187. package/src/Button/demo/loading/index.tsx +21 -0
  188. package/src/Button/index.md +25 -0
  189. package/src/Button/index.test.tsx +58 -0
  190. package/src/Button/index.tsx +136 -0
  191. package/src/Button/style/index.less +255 -0
  192. package/src/Button/style/index.ts +2 -0
  193. package/src/Dropdown/Button.tsx +93 -0
  194. package/src/Dropdown/demo/basic/index.tsx +20 -0
  195. package/src/Dropdown/demo/button/index.less +9 -0
  196. package/src/Dropdown/demo/button/index.tsx +98 -0
  197. package/src/Dropdown/demo/placement/index.tsx +47 -0
  198. package/src/Dropdown/demo/subMenu/index.tsx +35 -0
  199. package/src/Dropdown/demo/trigger/index.tsx +19 -0
  200. package/src/Dropdown/index.md +35 -0
  201. package/src/Dropdown/index.test.tsx +185 -0
  202. package/src/Dropdown/index.tsx +71 -0
  203. package/src/Dropdown/style/index.less +40 -0
  204. package/src/Dropdown/style/index.ts +2 -0
  205. package/src/Icon/iconfont/demo.css +539 -0
  206. package/src/Icon/iconfont/demo_index.html +628 -0
  207. package/src/Icon/iconfont/iconfont.css +93 -0
  208. package/src/Icon/iconfont/iconfont.js +1 -0
  209. package/src/Icon/iconfont/iconfont.json +142 -0
  210. package/src/Icon/iconfont/iconfont.ttf +0 -0
  211. package/src/Icon/iconfont/iconfont.woff +0 -0
  212. package/src/Icon/iconfont/iconfont.woff2 +0 -0
  213. package/src/Icon/index.less +32 -0
  214. package/src/Icon/index.tsx +38 -0
  215. package/src/Input/components/Group/index.tsx +21 -0
  216. package/src/Input/components/Password/index.tsx +23 -0
  217. package/src/Input/components/TextArea/index.tsx +57 -0
  218. package/src/Input/demo/allowClear/index.less +0 -0
  219. package/src/Input/demo/allowClear/index.tsx +10 -0
  220. package/src/Input/demo/basic/index.less +6 -0
  221. package/src/Input/demo/basic/index.tsx +25 -0
  222. package/src/Input/demo/gourp/index.tsx +30 -0
  223. package/src/Input/demo/password/index.less +0 -0
  224. package/src/Input/demo/password/index.tsx +11 -0
  225. package/src/Input/demo/prefix/index.less +0 -0
  226. package/src/Input/demo/prefix/index.tsx +13 -0
  227. package/src/Input/demo/showCount/index.less +0 -0
  228. package/src/Input/demo/showCount/index.tsx +16 -0
  229. package/src/Input/demo/textArea/autoSize.tsx +21 -0
  230. package/src/Input/index.md +37 -0
  231. package/src/Input/index.test.tsx +78 -0
  232. package/src/Input/index.tsx +91 -0
  233. package/src/Input/style/index.less +62 -0
  234. package/src/Input/style/index.ts +2 -0
  235. package/src/Menu/Divider.tsx +12 -0
  236. package/src/Menu/MenuItem.tsx +24 -0
  237. package/src/Menu/SubMenu.tsx +37 -0
  238. package/src/Menu/index.md +36 -0
  239. package/src/Menu/index.test.tsx +144 -0
  240. package/src/Menu/index.tsx +27 -0
  241. package/src/Menu/style/index.less +33 -0
  242. package/src/Menu/style/index.ts +2 -0
  243. package/src/Select/BaseSelect.tsx +321 -0
  244. package/src/Select/OptionsList/OptGroup.tsx +9 -0
  245. package/src/Select/OptionsList/OptionItem.tsx +151 -0
  246. package/src/Select/OptionsList/Options.tsx +11 -0
  247. package/src/Select/OptionsList/index.tsx +169 -0
  248. package/src/Select/Selector/index.tsx +211 -0
  249. package/src/Select/VirtualList.tsx +36 -0
  250. package/src/Select/demo/disabled/index.tsx +44 -0
  251. package/src/Select/demo/multiple/index.tsx +77 -0
  252. package/src/Select/demo/options/index.tsx +63 -0
  253. package/src/Select/demo/single/index.tsx +50 -0
  254. package/src/Select/hooks/useCacheOption.ts +67 -0
  255. package/src/Select/index.md +72 -0
  256. package/src/Select/index.tsx +23 -0
  257. package/src/Select/interface.ts +231 -0
  258. package/src/Select/style/index.less +539 -0
  259. package/src/Select/style/index.ts +2 -0
  260. package/src/Select/utils.tsx +133 -0
  261. package/src/Tabs/TabPane.tsx +28 -0
  262. package/src/Tabs/demo/adaptHeight/index.less +3 -0
  263. package/src/Tabs/demo/adaptHeight/index.tsx +33 -0
  264. package/src/Tabs/demo/basic/index.less +5 -0
  265. package/src/Tabs/demo/basic/index.tsx +30 -0
  266. package/src/Tabs/demo/horizontalScroll/index.less +3 -0
  267. package/src/Tabs/demo/horizontalScroll/index.tsx +36 -0
  268. package/src/Tabs/index.md +30 -0
  269. package/src/Tabs/index.test.tsx +100 -0
  270. package/src/Tabs/index.tsx +64 -0
  271. package/src/Tabs/style/index.less +61 -0
  272. package/src/Tabs/style/index.ts +2 -0
  273. package/src/Tooltip/demo/basic/index.tsx +10 -0
  274. package/src/Tooltip/demo/overflow/index.tsx +10 -0
  275. package/src/Tooltip/demo/placement/index.less +7 -0
  276. package/src/Tooltip/demo/placement/index.tsx +60 -0
  277. package/src/Tooltip/demo/trigger/index.less +5 -0
  278. package/src/Tooltip/demo/trigger/index.tsx +22 -0
  279. package/src/Tooltip/index.md +28 -0
  280. package/src/Tooltip/index.test.tsx +152 -0
  281. package/src/Tooltip/index.tsx +113 -0
  282. package/src/Tooltip/style/index.less +14 -0
  283. package/src/Tooltip/style/index.ts +2 -0
  284. package/src/_utils/hooks/useControlledState.ts +39 -0
  285. package/src/_utils/hooks/usePrefixCls.ts +11 -0
  286. package/src/index.ts +8 -0
  287. package/src/style/index.less +3 -0
  288. package/src/style/index.ts +2 -0
  289. package/src/style/mixins/index.less +0 -0
  290. package/src/style/themes/default/index.less +36 -0
  291. package/src/style/themes/default/themeColor.less +259 -0
  292. package/tsconfig.json +13 -0
  293. package/typings.d.ts +3 -0
@@ -0,0 +1,259 @@
1
+ /**
2
+ *中性浅色背景 Neutral Light
3
+ * 主要用于文字颜色
4
+ **/
5
+ @NL0: #121212;
6
+ @NL97: fade(@NL0, 3%);
7
+ @NL95: fade(@NL0, 5%);
8
+ @NL90: fade(@NL0, 10%);
9
+ @NL80: fade(@NL0, 20%);
10
+ @NL70: fade(@NL0, 30%);
11
+ @NL60: fade(@NL0, 40%);
12
+ @NL50: fade(@NL0, 50%);
13
+ @NL40: fade(@NL0, 60%);
14
+ @NL30: fade(@NL0, 70%);
15
+ @NL20: fade(@NL0, 80%);
16
+ @NL10: fade(@NL0, 90%);
17
+
18
+ /**
19
+ *中性深色背景 Neutral Dark
20
+ * 主要用于文字颜色
21
+ **/
22
+ @ND0: #FFFFFF;
23
+ @ND97: fade(@ND0, 3%);
24
+ @ND95: fade(@ND0, 5%);
25
+ @ND90: fade(@ND0, 10%);
26
+ @ND80: fade(@ND0, 20%);
27
+ @ND70: fade(@ND0, 30%);
28
+ @ND60: fade(@ND0, 40%);
29
+ @ND50: fade(@ND0, 50%);
30
+ @ND40: fade(@ND0, 60%);
31
+ @ND30: fade(@ND0, 70%);
32
+ @ND20: fade(@ND0, 80%);
33
+ @ND10: fade(@ND0, 90%);
34
+
35
+ /**
36
+ * 品牌色 Brand
37
+ * 用作主操作强调、文字链、品牌传递
38
+ **/
39
+ @B10: #00127B;
40
+ @B20: #1029BC;
41
+ @B30: #2944D7;
42
+ @B40: #435CF0;
43
+ @B50: #6077FF;
44
+ @B60: #7F92FF;
45
+ @B70: #9FADFF;
46
+ @B80: #BDC9FF;
47
+ @B90: #DFE3FE;
48
+ @B95: #EFF1FF;
49
+ @B98: #F8F9FF;
50
+
51
+ /**
52
+ * 辅助A Secondary A
53
+ * 表达完成、成功
54
+ **/
55
+ @SA10: #00270F;
56
+ @SA20: #024F20;
57
+ @SA30: #007830;
58
+ @SA40: #059F41;
59
+ @SA50: #08C552;
60
+ @SA60: #1BDE6D;
61
+ @SA70: #35F886;
62
+ @SA80: #70FFAB;
63
+ @SA90: #B8FFD5;
64
+ @SA95: #DBFFEA;
65
+ @SA98: #EFFFF5;
66
+
67
+ /**
68
+ * 辅助B Secondary B
69
+ * 表达提醒、警告
70
+ **/
71
+ @SB10: #261600;
72
+ @SB20: #542B00;
73
+ @SB30: #7E4100;
74
+ @SB40: #A85700;
75
+ @SB50: #D26E00;
76
+ @SB60: #F48500;
77
+ @SB70: #FFA000;
78
+ @SB80: #FFBF5B;
79
+ @SB90: #FFDEB0;
80
+ @SB95: #FFF0D9;
81
+ @SB98: #FFF8EE;
82
+
83
+ /**
84
+ * 辅助C Secondary C
85
+ * 表达错误、失败
86
+ **/
87
+ @SC10: #550005;
88
+ @SC20: #AF0001;
89
+ @SC30: #EC0011;
90
+ @SC40: #FF0033;
91
+ @SC50: #FF2755;
92
+ @SC60: #FF5B78;
93
+ @SC70: #FF879A;
94
+ @SC80: #FFAFBB;
95
+ @SC90: #FFD7DE;
96
+ @SC95: #FFEBEE;
97
+ @SC98: #FFF6F7;
98
+
99
+ /**
100
+ * 背景色 Background
101
+ * 主要用于背景色
102
+ **/
103
+ @BG0: #121212;
104
+ @BG10: #2A2A2A;
105
+ @BG20: #414141;
106
+ @BG30: #595959;
107
+ @BG40: #717171;
108
+ @BG50: #88888B;
109
+ @BG60: #A0A0A0;
110
+ @BG70: #B7B7B7;
111
+ @BG80: #D0D0D0;
112
+ @BG90: #E7E8E8;
113
+ @BG95: #F3F3F3;
114
+ @BG97: #F8F8F8;
115
+ @BG100: #FFFFFF;
116
+
117
+ /**
118
+ * 品牌背景 Brand Background
119
+ * 品牌色衍生灰调背景
120
+ **/
121
+ @BBG10: #061B3B;
122
+ @BBG15: #112645;
123
+ @BBG20: #203555;
124
+ @BBG30: #3B4F6E;
125
+ @BBG40: #536788;
126
+ @BBG50: #6C82A3;
127
+ @BBG60: #869BBB;
128
+ @BBG70: #A0B5D5;
129
+ @BBG80: #BACDEE;
130
+ @BBG90: #D7E7FE;
131
+ @BBG95: #EBF3FF;
132
+ @BBG97: #F3F8FF;
133
+ @BBG98: #F7F8FF;
134
+
135
+ /***
136
+ * 黑白
137
+ ***/
138
+ @white:#FFFFFF;
139
+ @black:#121212;
140
+
141
+ /***
142
+ * 图片
143
+ ***/
144
+ @imageholder: fade(#999898, 30%);
145
+ @mate: fade(#000000, 50%);
146
+
147
+ /***
148
+ * 投影
149
+ ***/
150
+ @shadow-option: 0 1px 1px rgba(0, 0, 0, 0.12);
151
+ @shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 1px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.08);
152
+ @shadow-actionsheet: 0 3px 5px rgba(0, 0, 0, 0.1), 0 1px 18px rgba(0, 0, 0, 0.06), 0 6px 10px rgba(0, 0, 0, 0.08);
153
+ @shadow-notification: 0 11px 15px rgba(0, 0, 0, 0.1), 0 9px 46px rgba(0, 0, 0, 0.08), 0 24px 38px rgba(0, 0, 0, 0.04);
154
+
155
+ // 用css module的能力,将less变量输出给js,供js文件中使用
156
+ :export {
157
+ NL0: @NL0;
158
+ NL97: @NL97;
159
+ NL95: @NL95;
160
+ NL90: @NL90;
161
+ NL80: @NL80;
162
+ NL70: @NL70;
163
+ NL60: @NL60;
164
+ NL50: @NL50;
165
+ NL40: @NL40;
166
+ NL30: @NL30;
167
+ NL20: @NL20;
168
+ NL10: @NL10;
169
+ ND0: @ND0;
170
+ ND97: @ND97;
171
+ ND95: @ND95;
172
+ ND90: @ND90;
173
+ ND80: @ND80;
174
+ ND70: @ND70;
175
+ ND60: @ND60;
176
+ ND50: @ND50;
177
+ ND40: @ND40;
178
+ ND30: @ND30;
179
+ ND20: @ND20;
180
+ ND10: @ND10;
181
+ B10: @B10;
182
+ B20: @B20;
183
+ B30: @B30;
184
+ B40: @B40;
185
+ B50: @B50;
186
+ B60: @B60;
187
+ B70: @B70;
188
+ B80: @B80;
189
+ B90: @B90;
190
+ B95: @B95;
191
+ B98: @B98;
192
+ SA10: @SA10;
193
+ SA20: @SA20;
194
+ SA30: @SA30;
195
+ SA40: @SA40;
196
+ SA50: @SA50;
197
+ SA60: @SA60;
198
+ SA70: @SA70;
199
+ SA80: @SA80;
200
+ SA90: @SA90;
201
+ SA95: @SA95;
202
+ SA98: @SA98;
203
+ SB10: @SB10;
204
+ SB20: @SB20;
205
+ SB30: @SB30;
206
+ SB40: @SB40;
207
+ SB50: @SB50;
208
+ SB60: @SB60;
209
+ SB70: @SB70;
210
+ SB80: @SB80;
211
+ SB90: @SB90;
212
+ SB95: @SB95;
213
+ SB98: @SB98;
214
+ SC10: @SC10;
215
+ SC20: @SC20;
216
+ SC30: @SC30;
217
+ SC40: @SC40;
218
+ SC50: @SC50;
219
+ SC60: @SC60;
220
+ SC70: @SC70;
221
+ SC80: @SC80;
222
+ SC90: @SC90;
223
+ SC95: @SC95;
224
+ SC98: @SC98;
225
+ BG0: @BG0;
226
+ BG10: @BG10;
227
+ BG20: @BG20;
228
+ BG30: @BG30;
229
+ BG40: @BG40;
230
+ BG50: @BG50;
231
+ BG60: @BG60;
232
+ BG70: @BG70;
233
+ BG80: @BG80;
234
+ BG90: @BG90;
235
+ BG95: @BG95;
236
+ BG97: @BG97;
237
+ BG100: @BG100;
238
+ BBG10: @BBG10;
239
+ BBG15: @BBG15;
240
+ BBG20: @BBG20;
241
+ BBG30: @BBG30;
242
+ BBG40: @BBG40;
243
+ BBG50: @BBG50;
244
+ BBG60: @BBG60;
245
+ BBG70: @BBG70;
246
+ BBG80: @BBG80;
247
+ BBG90: @BBG90;
248
+ BBG95: @BBG95;
249
+ BBG97: @BBG97;
250
+ BBG98: @BBG98;
251
+ WHITE: @white;
252
+ BLACK: @black;
253
+ IMAGE_HOLDER: @imageholder;
254
+ MATE: @mate;
255
+ SHADOW_OPTION: @shadow-option;
256
+ SHADOW_CARD: @shadow-card;
257
+ SHADOW_ACTIONSHEET: @shadow-actionsheet;
258
+ SHADOW_NOTIFICATION: @shadow-notification;
259
+ }
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@aloudata/aloudata-design",
3
+ "version": "0.1.0-beta1",
4
+ "scripts": {
5
+ "start": "dumi dev",
6
+ "docs:build": "dumi build",
7
+ "docs:deploy": "gh-pages -d docs-dist",
8
+ "build": "father-build",
9
+ "lint": "npm run stylelint && npm run lint-js ",
10
+ "lint-js": "eslint src/",
11
+ "stylelint": "npx stylelint ./src",
12
+ "deploy": "npm run docs:build && npm run docs:deploy",
13
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
14
+ "test": "umi-test",
15
+ "test:coverage": "umi-test --coverage",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "module": "es/index.js",
19
+ "typings": "es/index.d.ts",
20
+ "husky": {
21
+ "hooks": {
22
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
23
+ "pre-commit": "npm run lint && npm run stylelint && npm run test"
24
+ }
25
+ },
26
+ "gitHooks": {
27
+ "pre-commit": "lint-staged"
28
+ },
29
+ "lint-staged": {
30
+ "*.{js,jsx,less,md,json}": [
31
+ "prettier --write"
32
+ ],
33
+ "*.ts?(x)": [
34
+ "prettier --parser=typescript --write"
35
+ ]
36
+ },
37
+ "dependencies": {
38
+ "@ant-design/icons": "^4.7.0",
39
+ "@types/react-truncate": "^2.3.4",
40
+ "antd": "^4.18.6",
41
+ "classnames": "^2.3.1",
42
+ "lodash": "^4.17.21",
43
+ "rc-menu": "^9.3.2",
44
+ "rc-overflow": "^1.2.3",
45
+ "rc-trigger": "^5.2.10",
46
+ "rc-virtual-list": "^3.4.2",
47
+ "react": "^16.12.0 || ^17.0.0",
48
+ "react-dom": "^16.12.0 || ^17.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@aloudata/eslint-config-base": "^0.0.6",
52
+ "@commitlint/cli": "^12.1.4",
53
+ "@commitlint/config-angular": "^12.1.4",
54
+ "@testing-library/jest-dom": "^5.15.1",
55
+ "@testing-library/react": "^12.1.2",
56
+ "@types/jest": "^27.0.3",
57
+ "@types/lodash": "^4.14.178",
58
+ "@umijs/fabric": "^2.8.1",
59
+ "@umijs/test": "^3.0.5",
60
+ "babel-plugin-import": "^1.13.3",
61
+ "dumi": "^1.1.0",
62
+ "eslint": "^7.27.0",
63
+ "eslint-config-airbnb-typescript": "^12.3.1",
64
+ "eslint-plugin-import": "^2.23.4",
65
+ "eslint-plugin-jsx-a11y": "^6.4.1",
66
+ "eslint-plugin-react": "^7.24.0",
67
+ "eslint-plugin-react-hooks": "^4.2.0",
68
+ "father-build": "^1.17.2",
69
+ "gh-pages": "^3.0.0",
70
+ "husky": "^3.0.9",
71
+ "lint-staged": "^10.0.7",
72
+ "postcss": "8.4.6",
73
+ "prettier": "^2.2.1",
74
+ "stylelint": "^14.5.3",
75
+ "stylelint-config-standard": "^24.0.0",
76
+ "yorkie": "^2.0.0"
77
+ },
78
+ "jest": {
79
+ "setupFiles": [
80
+ "./jest/setupTests.js"
81
+ ]
82
+ }
83
+ }
Binary file
@@ -0,0 +1,6 @@
1
+ .ald-button-demo {
2
+ .ant-btn {
3
+ margin-right: 8px;
4
+ margin-bottom: 12px;
5
+ }
6
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { Button } from '@aloudata/aloudata-design';
3
+ import './index.less';
4
+ import Icon from '../../../Icon'
5
+ export default () => {
6
+ return (
7
+ <div className="ald-button-demo">
8
+ <Button type="primary" icon={<Icon type="add" size={20} />}>
9
+ Search
10
+ </Button>
11
+ <Button type="secondary" icon={<Icon type="add" size={20} />}>
12
+ Search
13
+ </Button>
14
+ <Button type="text" icon={<Icon type="add" size={20} />}>
15
+ Search
16
+ </Button>
17
+ <Button type="danger" icon={<Icon type="add" size={20} />}>
18
+ Search
19
+ </Button>
20
+ <Button type="link" icon={<Icon type="add" size={20} />}>
21
+ Search
22
+ </Button>
23
+ <br />
24
+ <Button icon={<Icon type="add" size={20} />}>
25
+ </Button>
26
+ <Button shape='circle' icon={<Icon type="add" size={20} />}>
27
+ </Button>
28
+ <Button shape='circle'>
29
+ S
30
+ </Button>
31
+ <br />
32
+ <Button size='small' icon={<Icon type="add" size={20} />}>
33
+ </Button>
34
+ <Button shape='circle' size="large" icon={<Icon type="add" size={20} />}>
35
+ </Button>
36
+ <Button shape='circle'>
37
+ M
38
+ </Button>
39
+ </div>
40
+ )
41
+ }
@@ -0,0 +1,7 @@
1
+
2
+ .ald-button-demo {
3
+ .ant-btn {
4
+ margin-right: 8px;
5
+ margin-top: 12px;
6
+ }
7
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Button } from '@aloudata/aloudata-design';
3
+ import '../../style/index.less';
4
+ import { Radio } from 'antd';
5
+ import './index.less';
6
+ export default () => {
7
+ const [size, setSize] = React.useState('default');
8
+ const handleSizeChange = (e: any) => {
9
+ setSize(e.target.value);
10
+ }
11
+ return (
12
+ <div className='ald-button-demo'>
13
+ <Radio.Group value={size} onChange={handleSizeChange}>
14
+ <Radio.Button value="small">Small</Radio.Button>
15
+ <Radio.Button value='default'>Default</Radio.Button>
16
+ <Radio.Button value="large">Large</Radio.Button>
17
+ </Radio.Group>
18
+ <br />
19
+ <Button type="primary" size={size}>Primary Button</Button>
20
+ <Button type="danger" size={size}>danger Button</Button>
21
+ <Button type="secondary" size={size}>secondary Button</Button>
22
+ <Button type="text" size={size}>Text Button</Button>
23
+ <Button type="link" size={size}>Link Button</Button>
24
+ </div>
25
+ )
26
+ };
File without changes
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Button } from '@aloudata/aloudata-design';
3
+ import './index.less';
4
+
5
+ export default () => {
6
+
7
+ return (
8
+ <div className="ald-button-demo">
9
+ <Button type="primary" disabled>primary disable</Button>
10
+ <Button type="secondary" disabled>secondary disable</Button>
11
+ <Button type="text" disabled>text disable</Button>
12
+ <Button type="danger" disabled>danger disable</Button>
13
+ <Button type="link" disabled>link disable</Button>
14
+ </div>
15
+ )
16
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Button } from '@aloudata/aloudata-design';
3
+
4
+ export default () => {
5
+
6
+ return (
7
+ <div className="ald-button-demo">
8
+ <Button href="https://www.aloudata.com/">aloudata</Button>
9
+ <Button href="https://www.aloudata.com/" target="_blank">target _blank aloudata</Button>
10
+ <Button href="https://www.aloudata.com/" target="_self">target _self aloudata</Button>
11
+ <Button target="_blank"> 无href target _blank</Button>
12
+ </div>
13
+ )
14
+ }
@@ -0,0 +1,6 @@
1
+ .ald-button-demo {
2
+ .ant-btn {
3
+ margin-right: 8px;
4
+ margin-bottom: 12px;
5
+ }
6
+ }
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import { Button } from "@aloudata/aloudata-design";
3
+ import './index.less'
4
+
5
+
6
+ export default () => {
7
+ const [loading, setLoading] = React.useState(false);
8
+ const handleChange = (e: any) => {
9
+ setLoading(true);
10
+ setTimeout(setLoading.bind(false), 3000)
11
+ }
12
+
13
+ return (
14
+ <div className="ald-button-demo">
15
+ <Button loading={true}>loading</Button>
16
+ <Button loading={true}></Button>
17
+ <Button loading={loading} onClick={handleChange}>点击提交</Button>
18
+ </div>
19
+
20
+ )
21
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ # nav:
3
+ # title: 组件
4
+ # path: /components
5
+ title: Button 按钮
6
+ group:
7
+ title: 组件
8
+ ---
9
+
10
+ ## Button 按钮
11
+
12
+ 按钮用于开始一个即时操作。
13
+
14
+ ## 代码演示
15
+
16
+ <code src="./demo/basic" title="基础用法" description="不同尺寸不同类型的按钮">
17
+ <code src="./demo/icon" title="带图标" description="纯图标和带前缀图标">
18
+ <code src="./demo/loading" title="加载中" description="纯图标和带前缀图标">
19
+ <code src="./demo/disable" title="禁用状态">
20
+ <code src="./demo/href" title="链接" description="target属性在有href时生效">
21
+
22
+ <API />
23
+
24
+ 支持原生 button 的其他所有属性。
25
+
@@ -0,0 +1,58 @@
1
+ import '@testing-library/jest-dom';
2
+ import React from 'react';
3
+ import { render, screen, fireEvent } from '@testing-library/react';
4
+ import Button from './index';
5
+ import { SearchOutlined } from '@ant-design/icons';
6
+
7
+ describe('Button ', () => {
8
+ it('render Button with type=link', () => {
9
+ const type = 'link';
10
+ render(<Button type={type}>{type}</Button>);
11
+ expect(document.querySelector('.ant-btn-link')).not.toBeNull();
12
+ });
13
+
14
+ it('render Button with type=danger', () => {
15
+ const type = 'danger';
16
+ render(<Button type={type}>{type}</Button>);
17
+ expect(document.querySelector('.ant-btn-dangerous')).not.toBeNull();
18
+ });
19
+
20
+ it('render Button size=small', () => {
21
+ const size = 'small';
22
+ render(<Button size={size} className="ald-btn-sm">{size}</Button>);
23
+ expect(document.querySelector('.ald-btn-sm')).toHaveClass('ant-btn-sm');
24
+ });
25
+
26
+ it('render Button disable', () => {
27
+ render(<Button disabled className="ald-btn-disable">disabled</Button>);
28
+ expect(document.querySelector('.ald-btn-disable')).toBeDisabled();
29
+ });
30
+
31
+ it('render Button shape=circle', () => {
32
+ render(<Button shape="circle" className="ald-btn-circle">circle</Button>);
33
+ expect(document.querySelector('.ald-btn-circle')).toHaveClass('ant-btn-circle');
34
+ });
35
+
36
+ it('render Button icon', () => {
37
+ render(<Button icon={<SearchOutlined />}>Search</Button>);
38
+ expect(document.querySelector('.anticon-search')).not.toBeNull();
39
+ });
40
+
41
+ it('render Button loading', () => {
42
+ render(<Button loading>loading</Button>);
43
+ expect(document.querySelector('.anticon-loading')).not.toBeNull();
44
+ });
45
+
46
+ it('render Button href', () => {
47
+ render(<Button href="https://www.aloudata.com/" className="ald-btn-href">aloudata</Button>);
48
+ expect(document.querySelector('.ald-btn-href')).toHaveAttribute('href', 'https://www.aloudata.com/');
49
+ });
50
+
51
+ it('render Button onClick', () => {
52
+ const onClick = jest.fn();
53
+ render(<Button onClick={onClick}>onClick</Button>);
54
+ const button = screen.queryByRole('button');
55
+ fireEvent.click(button!);
56
+ expect(onClick).toBeCalled();
57
+ });
58
+ });