@kdcloudjs/kdesign 1.3.2 → 1.3.3

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 (50) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/kdesign-complete.less +171 -103
  3. package/dist/kdesign.css +160 -73
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +346 -268
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +8 -8
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/button/group.js +2 -1
  11. package/es/button/style/index.css +20 -19
  12. package/es/button/style/index.less +29 -27
  13. package/es/button/style/token.less +4 -4
  14. package/es/checkbox/checkbox.js +20 -12
  15. package/es/config-provider/compDefaultProps.d.ts +0 -1
  16. package/es/config-provider/compDefaultProps.js +1 -2
  17. package/es/menu/menu.d.ts +1 -1
  18. package/es/menu/menu.js +51 -19
  19. package/es/menu/menuItem.d.ts +1 -0
  20. package/es/menu/menuItem.js +14 -10
  21. package/es/menu/style/index.css +139 -53
  22. package/es/menu/style/index.less +101 -69
  23. package/es/menu/style/mixin.less +33 -1
  24. package/es/menu/style/token.less +4 -2
  25. package/es/menu/subMenu.d.ts +1 -1
  26. package/es/menu/subMenu.js +118 -112
  27. package/es/radio/radio.d.ts +1 -1
  28. package/es/radio/radio.js +18 -11
  29. package/es/select/select.js +9 -2
  30. package/lib/button/group.js +2 -1
  31. package/lib/button/style/index.css +20 -19
  32. package/lib/button/style/index.less +29 -27
  33. package/lib/button/style/token.less +4 -4
  34. package/lib/checkbox/checkbox.js +19 -11
  35. package/lib/config-provider/compDefaultProps.d.ts +0 -1
  36. package/lib/config-provider/compDefaultProps.js +1 -2
  37. package/lib/menu/menu.d.ts +1 -1
  38. package/lib/menu/menu.js +57 -23
  39. package/lib/menu/menuItem.d.ts +1 -0
  40. package/lib/menu/menuItem.js +16 -10
  41. package/lib/menu/style/index.css +139 -53
  42. package/lib/menu/style/index.less +101 -69
  43. package/lib/menu/style/mixin.less +33 -1
  44. package/lib/menu/style/token.less +4 -2
  45. package/lib/menu/subMenu.d.ts +1 -1
  46. package/lib/menu/subMenu.js +137 -135
  47. package/lib/radio/radio.d.ts +1 -1
  48. package/lib/radio/radio.js +30 -20
  49. package/lib/select/select.js +9 -2
  50. package/package.json +1 -1
@@ -4,6 +4,9 @@
4
4
 
5
5
  @menu-prefix-cls: ~'@{kd-prefix}-menu';
6
6
  @menuitem-prefix-cls: ~'@{menu-prefix-cls}-item';
7
+ @menu-dark-prefix-cls: ~'@{menu-prefix-cls}-dark';
8
+ @menu-light-prefix-cls: ~'@{menu-prefix-cls}-light';
9
+ @menu-popper-prefix-cls: ~'@{menu-prefix-cls}-popper';
7
10
  @submenu-prefix-cls: ~'@{menu-prefix-cls}-submenu';
8
11
 
9
12
  .@{menu-prefix-cls} {
@@ -27,77 +30,20 @@
27
30
  }
28
31
  }
29
32
 
33
+ &-collapsed {
34
+ width: 50px;
35
+ min-width: auto;
36
+ }
37
+
30
38
  &-vertical {
31
39
  .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover,
32
40
  .@{submenu-prefix-cls}-hover {
33
41
  .hover();
34
42
  }
35
-
36
- .@{submenu-prefix-cls} {
37
- padding-right: 0;
38
-
39
- &-sub {
40
- background: @menu-sub-color-background;
41
-
42
- .@{menuitem-prefix-cls} {
43
- &:hover,
44
- &-active {
45
- color: @menu-sub-color-active;
46
- }
47
- }
48
-
49
- &-second,
50
- &-third {
51
- animation: kdZoomTopLeftIn calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
52
- opacity: 1;
53
- visibility: visible;
54
- transition: opacity, visibility;
55
- transition-duration: calc(@menu-motion-duration - 0.1s);
56
- transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
57
- }
58
-
59
- &-hide {
60
- opacity: 0;
61
- visibility: hidden;
62
- animation: kdZoomTopLeftOut calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
63
- transition: opacity, visibility;
64
- transition-duration: calc(@menu-motion-duration - 0.1s);
65
- transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
66
- }
67
- }
68
- }
69
- }
70
-
71
- &-collapsed {
72
- width: 50px;
73
- min-width: auto;
74
43
  }
75
44
 
76
45
  &-light {
77
- .light-default;
78
-
79
- .@{submenu-prefix-cls}-hover,
80
- .@{submenu-prefix-cls}-sub {
81
- .light-default;
82
- }
83
-
84
- .@{submenu-prefix-cls}-title:hover {
85
- color: @menu-light-color-hover;
86
- }
87
-
88
- .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
89
- .light-default;
90
- }
91
-
92
- .@{menuitem-prefix-cls} {
93
- &-active {
94
- .light-hover();
95
- }
96
- }
97
-
98
- .@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):hover {
99
- .light-hover();
100
- }
46
+ .light()
101
47
  }
102
48
 
103
49
  &-light&-vertical {
@@ -108,14 +54,13 @@
108
54
 
109
55
  .@{menuitem-prefix-cls} {
110
56
  &:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover {
111
- color: @menu-light-color-hover;
112
- background: #fff;
57
+ .light-hover();
113
58
  border: none;
114
59
  }
115
60
 
116
61
  &-active {
117
62
  color: @menu-light-color-active;
118
- background-color: @menu-light-color-background;
63
+ background-color: @menu-light-color-background-active;
119
64
  border: none !important;
120
65
  }
121
66
  }
@@ -142,7 +87,7 @@
142
87
  transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
143
88
 
144
89
  &-hover {
145
- color: @menu-sub-color-hover;
90
+ .hover();
146
91
  }
147
92
 
148
93
  &-sub {
@@ -223,15 +168,102 @@
223
168
  }
224
169
  }
225
170
 
226
- .@{menu-prefix-cls}-dark {
171
+ .@{menu-dark-prefix-cls} {
227
172
  .@{submenu-prefix-cls}-sub {
228
173
  background: @menu-sub-inline-color-background;
229
174
  }
230
175
 
231
- .@{submenu-prefix-cls}-sub-second,.@{submenu-prefix-cls}-sub-third {
176
+ .@{submenu-prefix-cls}-sub-second, .@{submenu-prefix-cls}-sub-third {
232
177
  background: @menu-sub-color-background;
233
178
  }
234
179
  }
235
180
 
181
+ .@{menu-light-prefix-cls} {
182
+ .@{submenu-prefix-cls}-active,.@{menuitem-prefix-cls}-active {
183
+ .light-active()
184
+ }
185
+ }
186
+
187
+ .@{menu-popper-prefix-cls} {
188
+ .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover,
189
+ .@{submenu-prefix-cls}-hover {
190
+ .hover();
191
+ }
192
+
193
+ &.hidden {
194
+ opacity: 0;
195
+ visibility: hidden;
196
+ display: none;
197
+ animation: kdZoomTopLeftOut calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
198
+ transition: opacity, visibility;
199
+ transition-duration: calc(@menu-motion-duration - 0.1s);
200
+ transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
201
+ }
202
+
203
+ .@{submenu-prefix-cls} {
204
+ padding-right: 0;
205
+
206
+ &-sub {
207
+ background: @menu-sub-inline-color-background;
208
+
209
+ .@{menuitem-prefix-cls} {
210
+ &:hover,
211
+ &-active {
212
+ color: @menu-sub-color-active;
213
+ }
214
+ }
215
+
216
+ &-second,
217
+ &-third {
218
+ animation: kdZoomTopLeftIn calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
219
+ opacity: 1;
220
+ visibility: visible;
221
+ transition: opacity, visibility;
222
+ transition-duration: calc(@menu-motion-duration - 0.1s);
223
+ transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
224
+ }
225
+
226
+ &-hide {
227
+ opacity: 0;
228
+ visibility: hidden;
229
+ animation: kdZoomTopLeftOut calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
230
+ transition: opacity, visibility;
231
+ transition-duration: calc(@menu-motion-duration - 0.1s);
232
+ transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
233
+ }
234
+ }
235
+ }
236
+
237
+ &.light {
238
+ .light();
239
+
240
+ .@{submenu-prefix-cls}-sub {
241
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
242
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05);
243
+ }
244
+
245
+ .@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover,
246
+ .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
247
+ .light-hover();
248
+ border: none;
249
+ }
250
+
251
+ .@{menuitem-prefix-cls}-hover,.@{submenu-prefix-cls}-hover {
252
+ .light-hover();
253
+ border: none;
254
+ }
255
+
256
+ .@{menuitem-prefix-cls}-active,.@{submenu-prefix-cls}-active {
257
+ .light-active();
258
+ border: none;
259
+ }
260
+ }
261
+ }
262
+
263
+
264
+
265
+
266
+
267
+
236
268
 
237
269
 
@@ -1,5 +1,10 @@
1
1
  @import './token.less';
2
2
 
3
+ @menu-prefix-cls: ~'@{kd-prefix}-menu';
4
+ @menuitem-prefix-cls: ~'@{menu-prefix-cls}-item';
5
+ @menu-vertical-prefix-cls: ~'@{menu-prefix-cls}-vertical';
6
+ @submenu-prefix-cls: ~'@{menu-prefix-cls}-submenu';
7
+
3
8
  // 菜单默认样式
4
9
  .menu() {
5
10
  position: relative;
@@ -77,10 +82,15 @@
77
82
  }
78
83
 
79
84
  .light-hover {
80
- background-color: @menu-light-color-background;
85
+ background-color: @menu-light-color-background-hover;
81
86
  color: @menu-light-color-hover;
82
87
  }
83
88
 
89
+ .light-active {
90
+ background-color: @menu-light-color-background-active;
91
+ color: @menu-light-color-active;
92
+ }
93
+
84
94
  .light-default {
85
95
  color: @menu-light-color;
86
96
  background: #ffffff;
@@ -95,3 +105,25 @@
95
105
  .ellipsis();
96
106
  }
97
107
  }
108
+
109
+
110
+ .light {
111
+ .light-default();
112
+
113
+ .@{submenu-prefix-cls}-hover,
114
+ .@{submenu-prefix-cls}-sub {
115
+ .light-default();
116
+ }
117
+
118
+ .@{submenu-prefix-cls}-title:hover {
119
+ color: @menu-light-color-hover;
120
+ }
121
+
122
+ .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
123
+ .light-hover();
124
+ }
125
+
126
+ .@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):hover {
127
+ .light-hover();
128
+ }
129
+ }
@@ -11,10 +11,12 @@
11
11
  @menu-sub-inline-color-background: var(~'@{menu-prefix}-sub-inline-color-background', #1f212b);
12
12
  @menu-inline-color-active: var(~'@{menu-prefix}-inline-color-active', @color-white);
13
13
  @menu-color-background: var(~'@{menu-prefix}-color-background', #343848);
14
+
14
15
  @menu-light-color: var(~'@{menu-prefix}-light-color-text', @color-text-primary);
15
- @menu-light-color-hover: var(~'@{menu-prefix}-light-color-text-hover', @color-ongoing);
16
+ @menu-light-color-hover: var(~'@{menu-prefix}-light-color-text-hover', @color-text-primary);
16
17
  @menu-light-color-active: var(~'@{menu-prefix}-light-color-text-active', @color-theme);
17
- @menu-light-color-background: var(~'@{menu-prefix}-light-color-background', @color-background-ongoing);
18
+ @menu-light-color-background-hover: var(~'@{menu-prefix}-light-color-background-hover', #f5f5f5);
19
+ @menu-light-color-background-active: var(~'@{menu-prefix}-light-color-background-active', #e3ebff);
18
20
 
19
21
  // font
20
22
  @menu-icon-font-size: var(~'@{menu-prefix}-icon-font-size', @font-size-xx-large);
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  export interface MenuSubMenuProps extends React.HTMLAttributes<HTMLElement> {
3
3
  disabled?: boolean;
4
4
  icon?: React.ReactNode;