@varlet/cli 1.27.20 → 2.0.0-alpha.1663742071515

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 (176) hide show
  1. package/LICENCE +1 -1
  2. package/lib/commands/commitLint.js +1 -1
  3. package/lib/commands/compile.d.ts +5 -3
  4. package/lib/commands/compile.js +2 -2
  5. package/lib/commands/create.d.ts +8 -3
  6. package/lib/commands/create.js +100 -51
  7. package/lib/commands/dev.d.ts +4 -2
  8. package/lib/commands/dev.js +3 -3
  9. package/lib/commands/gen.d.ts +8 -1
  10. package/lib/commands/gen.js +61 -33
  11. package/lib/commands/jest.js +11 -7
  12. package/lib/commands/release.d.ts +4 -2
  13. package/lib/commands/release.js +2 -2
  14. package/lib/commands/test.d.ts +7 -0
  15. package/lib/commands/test.js +26 -0
  16. package/lib/commands/useVite.d.ts +1 -0
  17. package/lib/commands/useVite.js +70 -0
  18. package/lib/commands/vite.d.ts +3 -0
  19. package/lib/commands/vite.js +69 -0
  20. package/lib/compiler/compileModule.js +9 -5
  21. package/lib/compiler/compileSFC.js +14 -11
  22. package/lib/compiler/compileScript.js +4 -12
  23. package/lib/compiler/compileStyle.d.ts +1 -1
  24. package/lib/compiler/compileStyle.js +7 -17
  25. package/lib/compiler/compileTypes.js +4 -7
  26. package/lib/config/jest.config.js +1 -0
  27. package/lib/config/vite.config.js +1 -1
  28. package/lib/config/vitest.config.d.ts +2 -0
  29. package/lib/config/vitest.config.js +28 -0
  30. package/lib/index.js +22 -3
  31. package/lib/shared/constant.js +1 -1
  32. package/lib/shared/logger.d.ts +1 -0
  33. package/lib/shared/logger.js +3 -0
  34. package/package.json +16 -12
  35. package/site/components/button/Button.vue +45 -23
  36. package/site/components/button/button.less +6 -6
  37. package/site/components/button/props.ts +10 -2
  38. package/site/components/cell/Cell.vue +24 -12
  39. package/site/components/cell/cell.less +11 -7
  40. package/site/components/cell/props.ts +2 -2
  41. package/site/components/code-example/CodeExample.vue +17 -23
  42. package/site/components/context/index.ts +4 -0
  43. package/site/components/context/lock.ts +30 -41
  44. package/site/components/icon/Icon.vue +16 -9
  45. package/site/components/loading/Loading.vue +54 -25
  46. package/site/components/loading/loading.less +120 -35
  47. package/site/components/loading/props.ts +7 -2
  48. package/site/components/popup/Popup.tsx +102 -0
  49. package/site/components/popup/index.ts +10 -0
  50. package/site/components/popup/popup.less +125 -0
  51. package/site/components/popup/props.ts +63 -0
  52. package/site/components/progress/Progress.vue +28 -24
  53. package/site/components/progress/progress.less +16 -13
  54. package/site/components/progress/props.ts +1 -1
  55. package/site/components/ripple/index.ts +28 -7
  56. package/site/components/ripple/ripple.less +3 -0
  57. package/site/components/snackbar/Snackbar.vue +10 -7
  58. package/site/components/snackbar/core.vue +37 -22
  59. package/site/components/snackbar/index.tsx +14 -14
  60. package/site/components/snackbar/props.ts +10 -7
  61. package/site/components/utils/components.ts +49 -1
  62. package/site/components/utils/elements.ts +17 -0
  63. package/site/mobile/App.vue +42 -42
  64. package/site/mobile/components/AppHome.vue +1 -1
  65. package/site/mobile/components/app-bar/AppBar.vue +17 -21
  66. package/site/mobile/components/app-bar/appBar.less +2 -1
  67. package/site/mobile/main.ts +6 -2
  68. package/site/pc/Layout.vue +93 -67
  69. package/site/pc/components/AnimationBox.vue +3 -15
  70. package/site/pc/components/AppHeader.vue +110 -97
  71. package/site/pc/components/AppMobile.vue +8 -2
  72. package/site/pc/components/AppSidebar.vue +19 -10
  73. package/site/pc/components/LogoAnimation.vue +29 -31
  74. package/site/pc/floating.ts +3 -3
  75. package/site/pc/main.ts +6 -0
  76. package/site/pc/pages/index/index.less +142 -197
  77. package/site/pc/pages/index/index.vue +65 -80
  78. package/site/pc/pages/index/locale/en-US.ts +1 -5
  79. package/site/pc/pages/index/locale/zh-CN.ts +1 -5
  80. package/site/useProgress.ts +14 -17
  81. package/site/utils.ts +32 -20
  82. package/template/create/__tests__/index.spec.ejs +8 -0
  83. package/template/create/docs/en-US.md +0 -0
  84. package/template/create/docs/zh-CN.md +0 -0
  85. package/template/create/example/index.ejs +15 -0
  86. package/template/create/example/locale/en-US.ts +3 -0
  87. package/{generators/config/i18n/sfc/src/button → template/create}/example/locale/index.ts +0 -0
  88. package/template/create/example/locale/zh-CN.ts +3 -0
  89. package/template/create/index.ejs +12 -0
  90. package/template/create/less.ejs +3 -0
  91. package/template/create/props.ts +1 -0
  92. package/template/create/tsx.ejs +13 -0
  93. package/template/create/vue.ejs +17 -0
  94. package/{generators → template/generators}/base/.prettierignore +0 -0
  95. package/{generators → template/generators}/base/.prettierrc +0 -0
  96. package/{generators → template/generators}/base/README.md +0 -0
  97. package/{generators → template/generators}/base/babel.config.js +0 -0
  98. package/{generators → template/generators}/base/public/highlight.css +0 -0
  99. package/{generators → template/generators}/base/public/logo.svg +0 -0
  100. package/{generators → template/generators}/base/shims/shims-md.d.ts +0 -0
  101. package/{generators → template/generators}/base/shims/shims-vue.d.ts +0 -0
  102. package/{generators → template/generators}/base/tsconfig.json +0 -0
  103. package/{generators → template/generators}/config/default/base/docs/home.zh-CN.md +0 -0
  104. package/{generators → template/generators}/config/default/base/package.json +1 -1
  105. package/{generators → template/generators}/config/default/base/types/basicComponent.d.ts +0 -0
  106. package/{generators → template/generators}/config/default/base/types/button.d.ts +0 -0
  107. package/{generators → template/generators}/config/default/base/types/index.d.ts +0 -0
  108. package/{generators → template/generators}/config/default/base/varlet.config.js +1 -1
  109. package/{generators → template/generators}/config/default/sfc/src/button/Button.vue +6 -6
  110. package/{generators → template/generators}/config/default/sfc/src/button/__tests__/index.spec.js +0 -0
  111. package/{generators/config/default/tsx → template/generators/config/default/sfc}/src/button/button.less +1 -1
  112. package/{generators → template/generators}/config/default/sfc/src/button/docs/zh-CN.md +0 -0
  113. package/{generators → template/generators}/config/default/sfc/src/button/example/BasicUse.vue +0 -0
  114. package/{generators → template/generators}/config/default/sfc/src/button/example/ModifyColor.vue +0 -0
  115. package/{generators → template/generators}/config/default/sfc/src/button/example/index.vue +2 -2
  116. package/{generators → template/generators}/config/default/sfc/src/button/index.ts +0 -0
  117. package/{generators → template/generators}/config/default/tsx/src/button/Button.tsx +11 -13
  118. package/{generators → template/generators}/config/default/tsx/src/button/__tests__/index.spec.js +0 -0
  119. package/{generators/config/i18n → template/generators/config/default}/tsx/src/button/button.less +1 -1
  120. package/{generators → template/generators}/config/default/tsx/src/button/docs/zh-CN.md +0 -0
  121. package/{generators → template/generators}/config/default/tsx/src/button/example/BasicUse.vue +0 -0
  122. package/{generators → template/generators}/config/default/tsx/src/button/example/ModifyColor.vue +0 -0
  123. package/{generators → template/generators}/config/default/tsx/src/button/example/index.vue +2 -2
  124. package/{generators → template/generators}/config/default/tsx/src/button/index.ts +0 -0
  125. package/{generators → template/generators}/config/i18n/base/docs/home.en-US.md +0 -0
  126. package/{generators → template/generators}/config/i18n/base/docs/home.zh-CN.md +0 -0
  127. package/{generators → template/generators}/config/i18n/base/package.json +1 -1
  128. package/{generators → template/generators}/config/i18n/base/types/basicComponent.d.ts +0 -0
  129. package/{generators → template/generators}/config/i18n/base/types/button.d.ts +0 -0
  130. package/{generators → template/generators}/config/i18n/base/types/index.d.ts +0 -0
  131. package/{generators → template/generators}/config/i18n/base/types/locale.d.ts +0 -0
  132. package/{generators → template/generators}/config/i18n/base/varlet.config.js +3 -3
  133. package/{generators → template/generators}/config/i18n/sfc/src/button/Button.vue +7 -7
  134. package/{generators → template/generators}/config/i18n/sfc/src/button/__tests__/index.spec.js +0 -0
  135. package/{generators → template/generators}/config/i18n/sfc/src/button/button.less +1 -1
  136. package/{generators → template/generators}/config/i18n/sfc/src/button/docs/en-US.md +0 -0
  137. package/{generators → template/generators}/config/i18n/sfc/src/button/docs/zh-CN.md +0 -0
  138. package/{generators → template/generators}/config/i18n/sfc/src/button/example/BasicUse.vue +0 -0
  139. package/{generators → template/generators}/config/i18n/sfc/src/button/example/ModifyColor.vue +0 -0
  140. package/{generators → template/generators}/config/i18n/sfc/src/button/example/index.vue +1 -1
  141. package/{generators/config/i18n/tsx → template/generators/config/i18n/sfc}/src/button/example/locale/en-US.ts +1 -1
  142. package/{generators/config/i18n/tsx → template/generators/config/i18n/sfc}/src/button/example/locale/index.ts +0 -0
  143. package/{generators/config/i18n/tsx → template/generators/config/i18n/sfc}/src/button/example/locale/zh-CN.ts +1 -1
  144. package/{generators → template/generators}/config/i18n/sfc/src/button/index.ts +0 -0
  145. package/{generators → template/generators}/config/i18n/sfc/src/locale/__tests__/index.spec.js +0 -0
  146. package/{generators → template/generators}/config/i18n/sfc/src/locale/docs/en-US.md +0 -0
  147. package/{generators → template/generators}/config/i18n/sfc/src/locale/docs/zh-CN.md +0 -0
  148. package/{generators → template/generators}/config/i18n/sfc/src/locale/en-US.d.ts +0 -0
  149. package/{generators/config/i18n/tsx → template/generators/config/i18n/sfc}/src/locale/en-US.ts +1 -1
  150. package/{generators → template/generators}/config/i18n/sfc/src/locale/index.ts +0 -0
  151. package/{generators → template/generators}/config/i18n/sfc/src/locale/zh-CN.d.ts +0 -0
  152. package/{generators/config/i18n/tsx → template/generators/config/i18n/sfc}/src/locale/zh-CN.ts +1 -1
  153. package/{generators → template/generators}/config/i18n/tsx/src/button/Button.tsx +12 -14
  154. package/{generators → template/generators}/config/i18n/tsx/src/button/__tests__/index.spec.js +0 -0
  155. package/{generators/config/default/sfc → template/generators/config/i18n/tsx}/src/button/button.less +1 -1
  156. package/{generators → template/generators}/config/i18n/tsx/src/button/docs/en-US.md +0 -0
  157. package/{generators → template/generators}/config/i18n/tsx/src/button/docs/zh-CN.md +0 -0
  158. package/{generators → template/generators}/config/i18n/tsx/src/button/example/BasicUse.vue +0 -0
  159. package/{generators → template/generators}/config/i18n/tsx/src/button/example/ModifyColor.vue +0 -0
  160. package/{generators → template/generators}/config/i18n/tsx/src/button/example/index.vue +1 -1
  161. package/{generators/config/i18n/sfc → template/generators/config/i18n/tsx}/src/button/example/locale/en-US.ts +1 -1
  162. package/template/generators/config/i18n/tsx/src/button/example/locale/index.ts +23 -0
  163. package/{generators/config/i18n/sfc → template/generators/config/i18n/tsx}/src/button/example/locale/zh-CN.ts +1 -1
  164. package/{generators → template/generators}/config/i18n/tsx/src/button/index.ts +0 -0
  165. package/{generators → template/generators}/config/i18n/tsx/src/locale/__tests__/index.spec.js +0 -0
  166. package/{generators → template/generators}/config/i18n/tsx/src/locale/docs/en-US.md +0 -0
  167. package/{generators → template/generators}/config/i18n/tsx/src/locale/docs/zh-CN.md +0 -0
  168. package/{generators → template/generators}/config/i18n/tsx/src/locale/en-US.d.ts +0 -0
  169. package/{generators/config/i18n/sfc → template/generators/config/i18n/tsx}/src/locale/en-US.ts +1 -1
  170. package/{generators → template/generators}/config/i18n/tsx/src/locale/index.ts +0 -0
  171. package/{generators → template/generators}/config/i18n/tsx/src/locale/zh-CN.d.ts +0 -0
  172. package/{generators/config/i18n/sfc → template/generators/config/i18n/tsx}/src/locale/zh-CN.ts +1 -1
  173. package/varlet.default.config.js +137 -15
  174. package/site/mobile/components/styles/common.less +0 -64
  175. package/site/mobile/components/styles/elevation.less +0 -126
  176. package/site/mobile/components/styles/var.less +0 -27
@@ -1,126 +0,0 @@
1
- .var-site-elevation {
2
- &--0 {
3
- box-shadow: 0 0 0 0 var(--site-shadow-key-umbra-opacity), 0 0 0 0 var(--site-shadow-key-penumbra-opacity),
4
- 0 0 0 0 var(--site-shadow-key-ambient-opacity);
5
- }
6
-
7
- &--1 {
8
- box-shadow: 0 2px 1px -1px var(--site-shadow-key-umbra-opacity), 0 1px 1px 0 var(--site-shadow-key-penumbra-opacity),
9
- 0 1px 3px 0 var(--site-shadow-key-ambient-opacity);
10
- }
11
-
12
- &--2 {
13
- box-shadow: 0 3px 1px -2px var(--site-shadow-key-umbra-opacity), 0 2px 2px 0 var(--site-shadow-key-penumbra-opacity),
14
- 0 1px 5px 0 var(--site-shadow-key-ambient-opacity);
15
- }
16
-
17
- &--3 {
18
- box-shadow: 0 3px 3px -2px var(--site-shadow-key-umbra-opacity), 0 3px 4px 0 var(--site-shadow-key-penumbra-opacity),
19
- 0 1px 8px 0 var(--site-shadow-key-ambient-opacity);
20
- }
21
-
22
- &--4 {
23
- box-shadow: 0 2px 4px -1px var(--site-shadow-key-umbra-opacity), 0 4px 5px 0 var(--site-shadow-key-penumbra-opacity),
24
- 0 1px 10px 0 var(--site-shadow-key-ambient-opacity);
25
- }
26
-
27
- &--5 {
28
- box-shadow: 0 3px 5px -1px var(--site-shadow-key-umbra-opacity), 0 5px 8px 0 var(--site-shadow-key-penumbra-opacity),
29
- 0 1px 14px 0 var(--site-shadow-key-ambient-opacity);
30
- }
31
-
32
- &--6 {
33
- box-shadow: 0 3px 5px -1px var(--site-shadow-key-umbra-opacity), 0 6px 10px 0 var(--site-shadow-key-penumbra-opacity),
34
- 0 1px 18px 0 var(--site-shadow-key-ambient-opacity);
35
- }
36
-
37
- &--7 {
38
- box-shadow: 0 4px 5px -2px var(--site-shadow-key-umbra-opacity), 0 7px 10px 1px var(--site-shadow-key-penumbra-opacity),
39
- 0 2px 16px 1px var(--site-shadow-key-ambient-opacity);
40
- }
41
-
42
- &--8 {
43
- box-shadow: 0 5px 5px -3px var(--site-shadow-key-umbra-opacity), 0 8px 10px 1px var(--site-shadow-key-penumbra-opacity),
44
- 0 3px 14px 2px var(--site-shadow-key-ambient-opacity);
45
- }
46
-
47
- &--9 {
48
- box-shadow: 0 5px 6px -3px var(--site-shadow-key-umbra-opacity), 0 9px 12px 1px var(--site-shadow-key-penumbra-opacity),
49
- 0 3px 16px 2px var(--site-shadow-key-ambient-opacity);
50
- }
51
-
52
- &--10 {
53
- box-shadow: 0 6px 6px -3px var(--site-shadow-key-umbra-opacity), 0 10px 14px 1px var(--site-shadow-key-penumbra-opacity),
54
- 0 4px 18px 3px var(--site-shadow-key-ambient-opacity);
55
- }
56
-
57
- &--11 {
58
- box-shadow: 0 6px 7px -4px var(--site-shadow-key-umbra-opacity), 0 11px 15px 1px var(--site-shadow-key-penumbra-opacity),
59
- 0 4px 20px 3px var(--site-shadow-key-ambient-opacity);
60
- }
61
-
62
- &--12 {
63
- box-shadow: 0 7px 8px -4px var(--site-shadow-key-umbra-opacity), 0 12px 17px 2px var(--site-shadow-key-penumbra-opacity),
64
- 0 5px 22px 4px var(--site-shadow-key-ambient-opacity);
65
- }
66
-
67
- &--13 {
68
- box-shadow: 0 7px 8px -4px var(--site-shadow-key-umbra-opacity), 0 13px 19px 2px var(--site-shadow-key-penumbra-opacity),
69
- 0 5px 24px 4px var(--site-shadow-key-ambient-opacity);
70
- }
71
-
72
- &--14 {
73
- box-shadow: 0 7px 9px -4px var(--site-shadow-key-umbra-opacity), 0 14px 21px 2px var(--site-shadow-key-penumbra-opacity),
74
- 0 5px 26px 4px var(--site-shadow-key-ambient-opacity);
75
- }
76
-
77
- &--15 {
78
- box-shadow: 0 8px 9px -5px var(--site-shadow-key-umbra-opacity), 0 15px 22px 2px var(--site-shadow-key-penumbra-opacity),
79
- 0 6px 28px 5px var(--site-shadow-key-ambient-opacity);
80
- }
81
-
82
- &--16 {
83
- box-shadow: 0 8px 10px -5px var(--site-shadow-key-umbra-opacity), 0 16px 24px 2px var(--site-shadow-key-penumbra-opacity),
84
- 0 6px 30px 5px var(--site-shadow-key-ambient-opacity);
85
- }
86
-
87
- &--17 {
88
- box-shadow: 0 8px 11px -5px var(--site-shadow-key-umbra-opacity), 0 17px 26px 2px var(--site-shadow-key-penumbra-opacity),
89
- 0 6px 32px 5px var(--site-shadow-key-ambient-opacity);
90
- }
91
-
92
- &--18 {
93
- box-shadow: 0 9px 11px -5px var(--site-shadow-key-umbra-opacity), 0 18px 28px 2px var(--site-shadow-key-penumbra-opacity),
94
- 0 7px 34px 6px var(--site-shadow-key-ambient-opacity);
95
- }
96
-
97
- &--19 {
98
- box-shadow: 0 9px 12px -6px var(--site-shadow-key-umbra-opacity), 0 19px 29px 2px var(--site-shadow-key-penumbra-opacity),
99
- 0 7px 36px 6px var(--site-shadow-key-ambient-opacity);
100
- }
101
-
102
- &--20 {
103
- box-shadow: 0 10px 13px -6px var(--site-shadow-key-umbra-opacity), 0 20px 31px 3px var(--site-shadow-key-penumbra-opacity),
104
- 0 8px 38px 7px var(--site-shadow-key-ambient-opacity);
105
- }
106
-
107
- &--21 {
108
- box-shadow: 0 10px 13px -6px var(--site-shadow-key-umbra-opacity), 0 21px 33px 3px var(--site-shadow-key-penumbra-opacity),
109
- 0 8px 40px 7px var(--site-shadow-key-ambient-opacity);
110
- }
111
-
112
- &--22 {
113
- box-shadow: 0 10px 14px -6px var(--site-shadow-key-umbra-opacity), 0 22px 35px 3px var(--site-shadow-key-penumbra-opacity),
114
- 0 8px 42px 7px var(--site-shadow-key-ambient-opacity);
115
- }
116
-
117
- &--23 {
118
- box-shadow: 0 11px 14px -7px var(--site-shadow-key-umbra-opacity), 0 23px 36px 3px var(--site-shadow-key-penumbra-opacity),
119
- 0 9px 44px 8px var(--site-shadow-key-ambient-opacity);
120
- }
121
-
122
- &--24 {
123
- box-shadow: 0 11px 15px -7px var(--site-shadow-key-umbra-opacity), 0 24px 38px 3px var(--site-shadow-key-penumbra-opacity),
124
- 0 9px 46px 8px var(--site-shadow-key-ambient-opacity);
125
- }
126
- }
@@ -1,27 +0,0 @@
1
- // 文字
2
- @site-font-size-xs: 10px;
3
- @site-font-size-sm: 12px;
4
- @site-font-size-md: 14px;
5
- @site-font-size-lg: 16px;
6
-
7
- // 图标
8
- @site-icon-size-xs: 16px;
9
- @site-icon-size-sm: 18px;
10
- @site-icon-size-md: 20px;
11
- @site-icon-size-lg: 22px;
12
-
13
- //颜色
14
- @site-color-primary: #3a7afe;
15
- @site-color-info: #00afef;
16
- @site-color-success: #00c48f;
17
- @site-color-warning: #ff9f00;
18
- @site-color-danger: #f44336;
19
- @site-color-disabled: #e0e0e0;
20
-
21
- // 动画函数
22
- @site-cubic-bezier: cubic-bezier(0.25, 0.8, 0.5, 1);
23
-
24
- // 阴影
25
- @site-shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2);
26
- @site-shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14);
27
- @site-shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);