x-ui-design 1.0.31-gamma.1 → 1.0.33

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 (218) hide show
  1. package/.github/workflows/x-ui-design.yml +14 -0
  2. package/README.md +22 -1
  3. package/compile.sh +15 -0
  4. package/dist/{components → esm/types/components}/DatePicker/DatePicker.d.ts +2 -1
  5. package/dist/{components → esm/types/components}/DatePicker/RangePicker/RangePicker.d.ts +2 -1
  6. package/dist/{components → esm/types/components}/Dropdown/Dropdown.d.ts +2 -1
  7. package/dist/{components → esm/types/components}/Empty/Empty.d.ts +2 -1
  8. package/dist/{components → esm/types/components}/Form/Item/Item.d.ts +2 -1
  9. package/dist/esm/types/components/Icons/Icons.d.ts +19 -0
  10. package/dist/{components → esm/types/components}/Input/Input.d.ts +2 -1
  11. package/dist/{components → esm/types/components}/Input/Textarea/Textarea.d.ts +2 -1
  12. package/dist/{components → esm/types/components}/Popover/Popover.d.ts +2 -1
  13. package/dist/{components → esm/types/components}/Radio/Button/Button.d.ts +2 -1
  14. package/dist/{components → esm/types/components}/Radio/Group/Group.d.ts +2 -1
  15. package/dist/{components → esm/types/components}/Radio/Radio.d.ts +2 -1
  16. package/dist/{components → esm/types/components}/Result/Result.d.ts +2 -1
  17. package/dist/{components → esm/types/components}/Switch/Switch.d.ts +2 -1
  18. package/dist/{components → esm/types/components}/Upload/Upload.d.ts +2 -1
  19. package/dist/esm/types/index.d.ts +50 -0
  20. package/dist/{types → esm/types/types}/input.d.ts +2 -2
  21. package/dist/index.d.ts +144 -1
  22. package/dist/index.esm.js +4233 -3792
  23. package/dist/index.esm.js.map +1 -1
  24. package/dist/index.js +4338 -3897
  25. package/dist/index.js.map +1 -1
  26. package/eslint.config.mjs +16 -0
  27. package/lib/components/Button/Button.tsx +136 -0
  28. package/lib/components/Button/index.ts +1 -0
  29. package/lib/components/Button/style.css +197 -0
  30. package/lib/components/Checkbox/Checkbox.tsx +131 -0
  31. package/lib/components/Checkbox/index.ts +1 -0
  32. package/lib/components/Checkbox/style.css +95 -0
  33. package/lib/components/ConditionalWrapper/index.tsx +12 -0
  34. package/lib/components/DatePicker/DatePicker.tsx +526 -0
  35. package/lib/components/DatePicker/RangePicker/RangePicker.tsx +500 -0
  36. package/lib/components/DatePicker/RangePicker/index.ts +1 -0
  37. package/lib/components/DatePicker/RangePicker/style.css +434 -0
  38. package/lib/components/DatePicker/TimePicker/TimePicker.tsx +497 -0
  39. package/lib/components/DatePicker/TimePicker/index.ts +1 -0
  40. package/lib/components/DatePicker/TimePicker/style.css +197 -0
  41. package/lib/components/DatePicker/index.ts +1 -0
  42. package/lib/components/DatePicker/style.css +318 -0
  43. package/lib/components/Dropdown/Dropdown.tsx +234 -0
  44. package/lib/components/Dropdown/index.ts +1 -0
  45. package/lib/components/Dropdown/style.css +124 -0
  46. package/lib/components/Empty/Empty.tsx +45 -0
  47. package/lib/components/Empty/index.ts +1 -0
  48. package/lib/components/Empty/style.css +13 -0
  49. package/lib/components/Form/Form.tsx +130 -0
  50. package/lib/components/Form/Item/Item.tsx +294 -0
  51. package/lib/components/Form/Item/index.ts +1 -0
  52. package/lib/components/Form/Item/style.css +61 -0
  53. package/lib/components/Form/index.ts +1 -0
  54. package/lib/components/Icons/Icons.tsx +433 -0
  55. package/lib/components/Icons/index.ts +15 -0
  56. package/lib/components/Input/Input.tsx +218 -0
  57. package/lib/components/Input/Textarea/Textarea.tsx +110 -0
  58. package/lib/components/Input/Textarea/index.ts +1 -0
  59. package/lib/components/Input/Textarea/style.css +104 -0
  60. package/lib/components/Input/index.ts +1 -0
  61. package/lib/components/Input/style.css +137 -0
  62. package/lib/components/Menu/Item/Item.tsx +65 -0
  63. package/lib/components/Menu/Menu.tsx +261 -0
  64. package/lib/components/Menu/SubMenu/SubMenu.tsx +68 -0
  65. package/lib/components/Menu/index.css +145 -0
  66. package/lib/components/Menu/index.ts +1 -0
  67. package/lib/components/Popover/Popover.tsx +135 -0
  68. package/lib/components/Popover/index.ts +1 -0
  69. package/lib/components/Popover/style.css +82 -0
  70. package/lib/components/Radio/Button/Button.tsx +42 -0
  71. package/lib/components/Radio/Button/index.ts +1 -0
  72. package/lib/components/Radio/Button/style.css +43 -0
  73. package/lib/components/Radio/Group/Group.tsx +105 -0
  74. package/lib/components/Radio/Group/index.ts +1 -0
  75. package/lib/components/Radio/Group/style.css +53 -0
  76. package/lib/components/Radio/Radio.tsx +83 -0
  77. package/lib/components/Radio/index.ts +1 -0
  78. package/lib/components/Radio/style.css +73 -0
  79. package/lib/components/Result/Result.tsx +39 -0
  80. package/lib/components/Result/index.ts +1 -0
  81. package/lib/components/Result/style.css +173 -0
  82. package/lib/components/Select/Option/Option.tsx +49 -0
  83. package/lib/components/Select/Option/index.ts +1 -0
  84. package/lib/components/Select/Option/style.css +50 -0
  85. package/lib/components/Select/Select.tsx +935 -0
  86. package/lib/components/Select/Tag/Tag.tsx +43 -0
  87. package/lib/components/Select/Tag/index.ts +1 -0
  88. package/lib/components/Select/Tag/style.css +87 -0
  89. package/lib/components/Select/index.ts +1 -0
  90. package/lib/components/Select/style.css +186 -0
  91. package/lib/components/Skeleton/Avatar/Avatar.tsx +61 -0
  92. package/lib/components/Skeleton/Avatar/index.ts +1 -0
  93. package/lib/components/Skeleton/Avatar/style.css +27 -0
  94. package/lib/components/Skeleton/Button/Button.tsx +44 -0
  95. package/lib/components/Skeleton/Button/index.ts +1 -0
  96. package/lib/components/Skeleton/Button/style.css +50 -0
  97. package/lib/components/Skeleton/Image/Image.tsx +45 -0
  98. package/lib/components/Skeleton/Image/index.ts +1 -0
  99. package/lib/components/Skeleton/Image/style.css +23 -0
  100. package/lib/components/Skeleton/Input/Input.tsx +42 -0
  101. package/lib/components/Skeleton/Input/index.ts +1 -0
  102. package/lib/components/Skeleton/Input/style.css +56 -0
  103. package/lib/components/Skeleton/Skeleton.tsx +97 -0
  104. package/lib/components/Skeleton/index.ts +1 -0
  105. package/lib/components/Skeleton/style.css +84 -0
  106. package/lib/components/Switch/Switch.tsx +68 -0
  107. package/lib/components/Switch/index.css +50 -0
  108. package/lib/components/Switch/index.ts +1 -0
  109. package/lib/components/Upload/Upload.tsx +291 -0
  110. package/lib/components/Upload/index.ts +1 -0
  111. package/lib/components/Upload/style.css +151 -0
  112. package/lib/global.d.ts +1 -0
  113. package/lib/helpers/flatten.ts +26 -0
  114. package/lib/helpers/index.ts +52 -0
  115. package/lib/helpers/mask.ts +52 -0
  116. package/lib/hooks/useForm.ts +548 -0
  117. package/lib/hooks/usePosition.ts +206 -0
  118. package/lib/hooks/useWatch.ts +41 -0
  119. package/lib/hooks/useWatchError.ts +20 -0
  120. package/lib/index.ts +184 -0
  121. package/lib/styles/global.css +57 -0
  122. package/lib/types/button.ts +83 -0
  123. package/lib/types/checkbox.ts +32 -0
  124. package/lib/types/datepicker.ts +165 -0
  125. package/lib/types/dropdown.ts +41 -0
  126. package/lib/types/empty.ts +8 -0
  127. package/lib/types/form.ts +179 -0
  128. package/lib/types/index.ts +38 -0
  129. package/lib/types/input.ts +72 -0
  130. package/lib/types/menu.ts +55 -0
  131. package/lib/types/popover.ts +16 -0
  132. package/lib/types/radio.ts +69 -0
  133. package/lib/types/result.ts +22 -0
  134. package/lib/types/select.ts +126 -0
  135. package/lib/types/skeleton.ts +62 -0
  136. package/lib/types/switch.ts +22 -0
  137. package/lib/types/upload.ts +67 -0
  138. package/lib/utils/index.ts +37 -0
  139. package/lib/utils/lazy.ts +17 -0
  140. package/next.config.ts +7 -0
  141. package/package.json +18 -20
  142. package/rollup.config.js +71 -0
  143. package/src/app/favicon.ico +0 -0
  144. package/src/app/globals.css +48 -0
  145. package/src/app/layout.d.ts +5 -0
  146. package/src/app/layout.tsx +16 -0
  147. package/src/app/page.d.ts +1 -0
  148. package/src/app/page.tsx +22 -0
  149. package/tsconfig.json +46 -0
  150. package/dist/components/Icons/Icons.d.ts +0 -18
  151. /package/dist/{components → esm/types/components}/Button/Button.d.ts +0 -0
  152. /package/dist/{components → esm/types/components}/Button/index.d.ts +0 -0
  153. /package/dist/{components → esm/types/components}/Checkbox/Checkbox.d.ts +0 -0
  154. /package/dist/{components → esm/types/components}/Checkbox/index.d.ts +0 -0
  155. /package/dist/{components → esm/types/components}/ConditionalWrapper/index.d.ts +0 -0
  156. /package/dist/{components → esm/types/components}/DatePicker/RangePicker/index.d.ts +0 -0
  157. /package/dist/{components → esm/types/components}/DatePicker/TimePicker/TimePicker.d.ts +0 -0
  158. /package/dist/{components → esm/types/components}/DatePicker/TimePicker/index.d.ts +0 -0
  159. /package/dist/{components → esm/types/components}/DatePicker/index.d.ts +0 -0
  160. /package/dist/{components → esm/types/components}/Dropdown/index.d.ts +0 -0
  161. /package/dist/{components → esm/types/components}/Empty/index.d.ts +0 -0
  162. /package/dist/{components → esm/types/components}/Form/Form.d.ts +0 -0
  163. /package/dist/{components → esm/types/components}/Form/Item/index.d.ts +0 -0
  164. /package/dist/{components → esm/types/components}/Form/index.d.ts +0 -0
  165. /package/dist/{components → esm/types/components}/Icons/index.d.ts +0 -0
  166. /package/dist/{components → esm/types/components}/Input/Textarea/index.d.ts +0 -0
  167. /package/dist/{components → esm/types/components}/Input/index.d.ts +0 -0
  168. /package/dist/{components → esm/types/components}/Menu/Item/Item.d.ts +0 -0
  169. /package/dist/{components → esm/types/components}/Menu/Menu.d.ts +0 -0
  170. /package/dist/{components → esm/types/components}/Menu/SubMenu/SubMenu.d.ts +0 -0
  171. /package/dist/{components → esm/types/components}/Menu/index.d.ts +0 -0
  172. /package/dist/{components → esm/types/components}/Popover/index.d.ts +0 -0
  173. /package/dist/{components → esm/types/components}/Radio/Button/index.d.ts +0 -0
  174. /package/dist/{components → esm/types/components}/Radio/Group/index.d.ts +0 -0
  175. /package/dist/{components → esm/types/components}/Radio/index.d.ts +0 -0
  176. /package/dist/{components → esm/types/components}/Result/index.d.ts +0 -0
  177. /package/dist/{components → esm/types/components}/Select/Option/Option.d.ts +0 -0
  178. /package/dist/{components → esm/types/components}/Select/Option/index.d.ts +0 -0
  179. /package/dist/{components → esm/types/components}/Select/Select.d.ts +0 -0
  180. /package/dist/{components → esm/types/components}/Select/Tag/Tag.d.ts +0 -0
  181. /package/dist/{components → esm/types/components}/Select/Tag/index.d.ts +0 -0
  182. /package/dist/{components → esm/types/components}/Select/index.d.ts +0 -0
  183. /package/dist/{components → esm/types/components}/Skeleton/Avatar/Avatar.d.ts +0 -0
  184. /package/dist/{components → esm/types/components}/Skeleton/Avatar/index.d.ts +0 -0
  185. /package/dist/{components → esm/types/components}/Skeleton/Button/Button.d.ts +0 -0
  186. /package/dist/{components → esm/types/components}/Skeleton/Button/index.d.ts +0 -0
  187. /package/dist/{components → esm/types/components}/Skeleton/Image/Image.d.ts +0 -0
  188. /package/dist/{components → esm/types/components}/Skeleton/Image/index.d.ts +0 -0
  189. /package/dist/{components → esm/types/components}/Skeleton/Input/Input.d.ts +0 -0
  190. /package/dist/{components → esm/types/components}/Skeleton/Input/index.d.ts +0 -0
  191. /package/dist/{components → esm/types/components}/Skeleton/Skeleton.d.ts +0 -0
  192. /package/dist/{components → esm/types/components}/Skeleton/index.d.ts +0 -0
  193. /package/dist/{components → esm/types/components}/Switch/index.d.ts +0 -0
  194. /package/dist/{components → esm/types/components}/Upload/index.d.ts +0 -0
  195. /package/dist/{helpers → esm/types/helpers}/flatten.d.ts +0 -0
  196. /package/dist/{helpers → esm/types/helpers}/index.d.ts +0 -0
  197. /package/dist/{helpers → esm/types/helpers}/mask.d.ts +0 -0
  198. /package/dist/{hooks → esm/types/hooks}/useForm.d.ts +0 -0
  199. /package/dist/{hooks → esm/types/hooks}/usePosition.d.ts +0 -0
  200. /package/dist/{hooks → esm/types/hooks}/useWatch.d.ts +0 -0
  201. /package/dist/{hooks → esm/types/hooks}/useWatchError.d.ts +0 -0
  202. /package/dist/{types → esm/types/types}/button.d.ts +0 -0
  203. /package/dist/{types → esm/types/types}/checkbox.d.ts +0 -0
  204. /package/dist/{types → esm/types/types}/datepicker.d.ts +0 -0
  205. /package/dist/{types → esm/types/types}/dropdown.d.ts +0 -0
  206. /package/dist/{types → esm/types/types}/empty.d.ts +0 -0
  207. /package/dist/{types → esm/types/types}/form.d.ts +0 -0
  208. /package/dist/{types → esm/types/types}/index.d.ts +0 -0
  209. /package/dist/{types → esm/types/types}/menu.d.ts +0 -0
  210. /package/dist/{types → esm/types/types}/popover.d.ts +0 -0
  211. /package/dist/{types → esm/types/types}/radio.d.ts +0 -0
  212. /package/dist/{types → esm/types/types}/result.d.ts +0 -0
  213. /package/dist/{types → esm/types/types}/select.d.ts +0 -0
  214. /package/dist/{types → esm/types/types}/skeleton.d.ts +0 -0
  215. /package/dist/{types → esm/types/types}/switch.d.ts +0 -0
  216. /package/dist/{types → esm/types/types}/upload.d.ts +0 -0
  217. /package/dist/{utils → esm/types/utils}/index.d.ts +0 -0
  218. /package/dist/{utils → esm/types/utils}/lazy.d.ts +0 -0
@@ -0,0 +1,43 @@
1
+ import React, { FC, MouseEvent } from 'react';
2
+ import { TargetProps } from '../../../types';
3
+ import { CustomTagProps } from '../../../types/select';
4
+ import { prefixClsSelect } from '../../../utils';
5
+ import './style.css';
6
+
7
+ const Tag: FC<CustomTagProps> = ({
8
+ prefixCls = prefixClsSelect,
9
+ style = {},
10
+ onClose,
11
+ value,
12
+ label,
13
+ closable,
14
+ color,
15
+ icon,
16
+ className = ''
17
+ }) => {
18
+ const handleOnClick = (e: MouseEvent<HTMLSpanElement> & TargetProps) => {
19
+ e.preventDefault();
20
+ e.stopPropagation();
21
+
22
+ e.target.value = value;
23
+
24
+ onClose?.(e);
25
+ };
26
+
27
+ return (
28
+ <div
29
+ style={{ ...style, backgroundColor: color }}
30
+ className={`${prefixCls}-tag ${className}`}
31
+ >
32
+ <span>{label !== undefined ? label : value}</span>
33
+
34
+ {closable && (
35
+ <span className={`${prefixCls}-tag-close-icon`} onClick={handleOnClick}>
36
+ {icon || <>&#x2715;</>}
37
+ </span>
38
+ )}
39
+ </div>
40
+ );
41
+ };
42
+
43
+ export default Tag;
@@ -0,0 +1 @@
1
+ export { default as Tag } from '../../Select/Tag/Tag'
@@ -0,0 +1,87 @@
1
+ .xUi-select .xUi-select-tag-container {
2
+ gap: 4px;
3
+ flex: auto;
4
+ display: flex;
5
+ flex-wrap: wrap;
6
+ line-height: 12px;
7
+ position: relative;
8
+ }
9
+
10
+ .xUi-select .xUi-select-tag-container-fixHeight {
11
+ max-height: 32px !important;
12
+ overflow: hidden;
13
+ }
14
+
15
+ .xUi-select.middle .xUi-select-tag-container,
16
+ .xUi-select.large .xUi-select-tag-container {
17
+ line-height: 22px;
18
+ }
19
+
20
+ .xUi-select .xUi-select-tag {
21
+ background: rgba(0, 0, 0, 0.06);
22
+ border: 1px solid transparent;
23
+ align-items: center;
24
+ align-self: center;
25
+ flex: none;
26
+ box-sizing: border-box;
27
+ max-width: 100%;
28
+ border-radius: var(--xui-border-radius-sm);
29
+ cursor: default;
30
+ padding: 2px;
31
+ text-overflow: ellipsis;
32
+ overflow: hidden;
33
+ white-space: nowrap;
34
+ display: flex;
35
+ height: 100%;
36
+ transition:
37
+ font-size 0.3s,
38
+ line-height 0.3s,
39
+ height 0.3s;
40
+ }
41
+
42
+ .xUi-select.middle .xUi-select-tag {
43
+ padding: 4px 8px;
44
+ }
45
+
46
+ .xUi-select.large .xUi-select-tag {
47
+ padding: 4px 8px;
48
+ font-size: var(--xui-font-size-lg);
49
+ }
50
+
51
+ .xUi-select .xUi-select-tag span {
52
+ margin: 0 2px;
53
+ font-size: var(--xui-font-size-sm);
54
+ }
55
+
56
+ .xUi-select .xUi-select-tag .xUi-select-tag-close-icon {
57
+ cursor: pointer;
58
+ font-size: var(--xui-font-size-xs);
59
+ color: rgba(0, 0, 0, 0.5);
60
+ }
61
+
62
+ .xUi-select .xUi-select-tag .xUi-select-tag-close-icon:hover {
63
+ color: var(--xui-text-color);
64
+ }
65
+
66
+ .xUi-select .xUi-select-tag:has([class="xUi-select-tag-input"]) {
67
+ padding: 0;
68
+ border: none;
69
+ outline: none;
70
+ color: var(--xui-text-color);
71
+ font-size: var(--xui-font-size-md);
72
+ background: transparent;
73
+ }
74
+
75
+ .xUi-select .xUi-select-tag:has([class="xUi-select-tag-input"]) input {
76
+ padding: 0;
77
+ border: none;
78
+ height: -webkit-fill-available;
79
+ background-color: transparent;
80
+ font-size: var(--xui-font-size-md);
81
+ }
82
+
83
+ .xUi-select .xUi-select-tag-input:focus {
84
+ border: none;
85
+ outline: none;
86
+ box-shadow: none;
87
+ }
@@ -0,0 +1 @@
1
+ export { default as Select } from '../Select/Select'
@@ -0,0 +1,186 @@
1
+ @keyframes spin {
2
+ 0% {
3
+ transform: rotate(0deg);
4
+ }
5
+ 100% {
6
+ transform: rotate(360deg);
7
+ }
8
+ }
9
+
10
+ .xUi-select {
11
+ width: 100%;
12
+ position: relative;
13
+ display: inline-flex;
14
+ flex-direction: row-reverse;
15
+ color: var(--xui-text-color);
16
+ min-height: 24px;
17
+ background-color: transparent;
18
+ border-radius: var(--xui-border-radius-sm);
19
+ border: 1px solid var(--xui-border-color);
20
+ box-sizing: border-box;
21
+ padding: 2px 8px;
22
+
23
+ &:has([tabindex="0"]:focus-visible) {
24
+ border-color: var(--xui-primary-color);
25
+ }
26
+ }
27
+
28
+ .xUi-select-disabled {
29
+ background: rgba(0, 0, 0, 0.04);
30
+ }
31
+
32
+ .xUi-select-arrow {
33
+ margin: 0 4px;
34
+ display: flex;
35
+ gap: 6px;
36
+ align-items: center;
37
+ pointer-events: all !important;
38
+ color: var(--xui-text-color-light);
39
+ }
40
+
41
+ .xUi-select-arrow svg {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ }
46
+
47
+ .xUi-select-loading {
48
+ margin: 0 8px;
49
+ animation: spin 1s linear infinite;
50
+ display: inline-block;
51
+ color: var(--xui-text-color-light);
52
+ }
53
+
54
+ .xUi-select .xUi-select-trigger {
55
+ display: flex;
56
+ width: 100%;
57
+ justify-content: space-between;
58
+ align-items: center;
59
+ cursor: pointer;
60
+ border-radius: var(--xui-border-radius-sm);
61
+ background: transparent;
62
+ }
63
+
64
+ .xUi-select .xUi-select-clear-btn {
65
+ margin: 0 8px;
66
+ background: none;
67
+ border: none;
68
+ color: #999;
69
+ cursor: pointer;
70
+ padding: 0;
71
+ line-height: 1;
72
+ }
73
+
74
+ .xUi-select .xUi-select-clear-btn {
75
+ font-size: var(--xui-font-size-lg);
76
+ }
77
+
78
+ .xUi-select .xUi-select-clear-btn:hover {
79
+ color: var(--xui-primary-color);
80
+ }
81
+
82
+ .xUi-select-dropdown {
83
+ top: 100%;
84
+ left: 0;
85
+ right: unset;
86
+ width: inherit;
87
+ z-index: 10;
88
+ margin-top: 5px;
89
+ overflow-y: auto;
90
+ max-height: 350px;
91
+ position: absolute;
92
+ border-radius: var(--xui-border-radius-sm);
93
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
94
+ background-color: var(--xui-select-background-color);
95
+ }
96
+
97
+ .xUi-select-dropdown.topRight,
98
+ .xUi-select-dropdown.bottomRight {
99
+ right: 0;
100
+ left: unset;
101
+ }
102
+
103
+ .xUi-select .xUi-select-loading-spinner {
104
+ padding: 10px;
105
+ text-align: center;
106
+ color: #999;
107
+ }
108
+
109
+ .xUi-select:focus-within {
110
+ border-color: var(--xui-primary-color-light);
111
+ box-shadow: none;
112
+ }
113
+
114
+ .xUi-select:hover:not(.xUi-select-disabled) {
115
+ border-color: var(--xui-primary-color);
116
+ }
117
+
118
+ .xUi-select-disabled .xUi-select-input,
119
+ .xUi-select-disabled .xUi-select-trigger,
120
+ .xUi-select-disabled {
121
+ cursor: not-allowed !important;
122
+ opacity: 0.6 !important;
123
+ }
124
+
125
+ .xUi-select-selected-icon {
126
+ color: var(--xui-primary-color-light);
127
+ }
128
+
129
+ .xUi-select-error {
130
+ border-color: var(--xui-error-color);
131
+ }
132
+
133
+ .xUi-select-arrow .error-svg-icon,
134
+ .xUi-select-error .error-svg-icon {
135
+ color: var(--xui-error-color);
136
+ }
137
+
138
+ .xUi-select .xUi-select-input {
139
+ width: 100%;
140
+ padding: 0;
141
+ height: auto;
142
+ height: -webkit-fit-content;
143
+ border: none;
144
+ outline: none;
145
+ background: transparent;
146
+ font-size: var(--xui-font-size-md);
147
+ color: var(--xui-text-color);
148
+ user-select: none;
149
+ cursor: pointer;
150
+ display: inline-flex;
151
+ align-items: center;
152
+ }
153
+
154
+ .xUi-select .xUi-select-input:focus {
155
+ border: none;
156
+ outline: none;
157
+ box-shadow: none;
158
+ }
159
+
160
+ .xUi-select.middle {
161
+ font-size: var(--xui-font-size-md);
162
+ min-height: 30px;
163
+ border-radius: var(--xui-border-radius-md);
164
+ }
165
+
166
+ .xUi-select.middle input {
167
+ font-size: var(--xui-font-size-md);
168
+ }
169
+
170
+ .xUi-select.middle .xUi-select-trigger {
171
+ border-radius: var(--xui-border-radius-md);
172
+ }
173
+
174
+ .xUi-select.large {
175
+ font-size: var(--xui-font-size-lg);
176
+ min-height: 44px;
177
+ border-radius: var(--xui-border-radius-lg);
178
+ }
179
+
180
+ .xUi-select.large .xUi-select-trigger {
181
+ border-radius: var(--xui-border-radius-lg);
182
+ }
183
+
184
+ .xUi-select input {
185
+ font-size: var(--xui-font-size-lg);
186
+ }
@@ -0,0 +1,61 @@
1
+ import React, { FC, ReactElement } from 'react';
2
+ import { clsx } from '../../../helpers';
3
+ import { SkeletonAvatarProps } from '../../../types/skeleton';
4
+ import { prefixClsSkeleton } from '../../../utils';
5
+ import './style.css';
6
+
7
+ export const AVATAR_DEFAULT_SIZE = 32;
8
+ export const AVATAR_GLOBAL_SIZE = 40;
9
+
10
+ export const GET_AVATAR_SKELETON_PROPS = (
11
+ avatar: SkeletonAvatarProps | boolean
12
+ ): SkeletonAvatarProps => {
13
+ return typeof avatar !== 'boolean'
14
+ ? {
15
+ shape: avatar?.shape || 'circle',
16
+ size: avatar?.size || AVATAR_GLOBAL_SIZE,
17
+ style: avatar?.style || {},
18
+ className: avatar?.className || ''
19
+ }
20
+ : {
21
+ shape: 'circle',
22
+ size: AVATAR_GLOBAL_SIZE
23
+ };
24
+ };
25
+
26
+ const SkeletonAvatar: FC<SkeletonAvatarProps> = ({
27
+ prefixCls = prefixClsSkeleton,
28
+ className,
29
+ shape = 'circle',
30
+ style,
31
+ wrapperStyle,
32
+ size = AVATAR_DEFAULT_SIZE,
33
+ active,
34
+ applyElementStyle = true,
35
+ ...props
36
+ }): ReactElement => {
37
+ return (
38
+ <div
39
+ className={clsx([
40
+ `${prefixCls}`,
41
+ {
42
+ [`${prefixCls}-element`]: applyElementStyle,
43
+ [`${prefixCls}-active`]: active
44
+ },
45
+ className
46
+ ])}
47
+ style={wrapperStyle}
48
+ {...props}
49
+ >
50
+ <span
51
+ className={clsx([`${prefixCls}-avatar ${prefixCls}-avatar-${shape}`])}
52
+ style={{
53
+ ...(size ? { width: size, height: size, lineHeight: size } : {}),
54
+ ...(style || {})
55
+ }}
56
+ />
57
+ </div>
58
+ );
59
+ };
60
+
61
+ export default SkeletonAvatar
@@ -0,0 +1 @@
1
+ export { default as SkeletonAvatar } from './Avatar'
@@ -0,0 +1,27 @@
1
+ @keyframes xUi-skeleton-loading {
2
+ 0% {
3
+ background-position: 100% 50%;
4
+ }
5
+
6
+ 100% {
7
+ background-position: 0 50%;
8
+ }
9
+ }
10
+
11
+ .xUi-skeleton-avatar {
12
+ width: 40px;
13
+ height: 40px;
14
+ display: block;
15
+ line-height: 40px;
16
+ background: linear-gradient(90deg, rgba(190, 190, 190, 0.2) 25%, rgba(129, 129, 129, 0.24) 37%, rgba(190, 190, 190, 0.2) 63%);
17
+ background-size: 400% 100%;
18
+ animation: xUi-skeleton-loading 1.4s ease infinite;
19
+ }
20
+
21
+ .xUi-skeleton-avatar-circle {
22
+ border-radius: 50%;
23
+ }
24
+
25
+ .xUi-skeleton-avatar-square {
26
+ border-radius: 4px;
27
+ }
@@ -0,0 +1,44 @@
1
+ import React, { FC, ReactElement } from 'react';
2
+ import { clsx } from '../../../helpers';
3
+ import { SkeletonButtonProps } from '../../../types/skeleton';
4
+ import { prefixClsSkeleton } from '../../../utils';
5
+ import './style.css';
6
+
7
+ const BUTTON_SKELETON_SIZE = {
8
+ small: `${prefixClsSkeleton}-button-sm`,
9
+ large: `${prefixClsSkeleton}-button-lg`,
10
+ default: ''
11
+ };
12
+
13
+ const SkeletonButton: FC<SkeletonButtonProps> = ({
14
+ prefixCls = prefixClsSkeleton,
15
+ style = {},
16
+ active,
17
+ className,
18
+ size = 'default',
19
+ applyElementStyle = true
20
+ }): ReactElement => {
21
+ return (
22
+ <div
23
+ className={clsx([
24
+ `${prefixCls}`,
25
+ {
26
+ [`${prefixCls}-element`]: applyElementStyle,
27
+ [`${prefixCls}-active`]: active
28
+ },
29
+ className
30
+ ])}
31
+ >
32
+ <span
33
+ className={clsx([
34
+ `${prefixCls}-button `,
35
+ BUTTON_SKELETON_SIZE[size],
36
+ className
37
+ ])}
38
+ style={style}
39
+ ></span>
40
+ </div>
41
+ );
42
+ };
43
+
44
+ export default SkeletonButton
@@ -0,0 +1 @@
1
+ export { default as SkeletonButton } from './Button'
@@ -0,0 +1,50 @@
1
+ @keyframes xUi-skeleton-loading {
2
+ 0% {
3
+ background-position: 100% 50%;
4
+ }
5
+
6
+ 100% {
7
+ background-position: 0 50%;
8
+ }
9
+ }
10
+
11
+ .xUi-skeleton-element {
12
+ display: inline-block !important;
13
+ width: auto !important;
14
+ }
15
+
16
+ .xUi-skeleton-button {
17
+ display: inline-block;
18
+ vertical-align: top;
19
+ background: rgba(190, 190, 190, 0.2);
20
+ border-radius: 4px;
21
+ width: 64px;
22
+ min-width: 64px;
23
+ height: 32px;
24
+ line-height: 32px;
25
+ }
26
+
27
+ .xUi-skeleton-button-sm {
28
+ width: 48px;
29
+ min-width: 48px;
30
+ height: 24px;
31
+ line-height: 24px;
32
+ }
33
+
34
+ .xUi-skeleton-button-lg {
35
+ width: 80px;
36
+ min-width: 80px;
37
+ height: 44px;
38
+ line-height: 44px;
39
+ }
40
+
41
+ .xUi-skeleton-active .xUi-skeleton-button {
42
+ background: linear-gradient(
43
+ 90deg,
44
+ rgba(190, 190, 190, 0.2) 25%,
45
+ rgba(129, 129, 129, 0.24) 37%,
46
+ rgba(190, 190, 190, 0.2) 63%
47
+ );
48
+ background-size: 400% 100%;
49
+ animation: xUi-skeleton-loading 1.4s ease infinite;
50
+ }
@@ -0,0 +1,45 @@
1
+ import React, { FC, ReactElement } from 'react';
2
+ import { SkeletonImageProps } from '../../../types/skeleton';
3
+ import { prefixClsSkeleton } from '../../../utils';
4
+ import './style.css';
5
+
6
+ const CUSTOm_ICON_SIZE = 48;
7
+
8
+ const SkeletonImage: FC<SkeletonImageProps> = ({
9
+ prefixCls = prefixClsSkeleton,
10
+ className,
11
+ style = {}
12
+ }): ReactElement => {
13
+ return (
14
+ <div className={`${prefixCls}-image ${className || ''}`} style={style}>
15
+ <span
16
+ className={`${prefixCls}-icon`}
17
+ style={{
18
+ fontSize: `${style?.width || CUSTOm_ICON_SIZE}px`,
19
+ color: '#bfbfbf',
20
+ position: 'relative',
21
+ width: '100%',
22
+ height: '100%',
23
+ ...(style?.backgroundColor
24
+ ? { backgroundColor: style?.backgroundColor }
25
+ : {})
26
+ }}
27
+ >
28
+ <svg
29
+ viewBox="0 0 1098 1024"
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ width="1em"
32
+ height="1em"
33
+ fill="currentColor"
34
+ >
35
+ <path
36
+ d="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z"
37
+ className={`${prefixCls}-image-path`}
38
+ ></path>
39
+ </svg>
40
+ </span>
41
+ </div>
42
+ );
43
+ };
44
+
45
+ export default SkeletonImage
@@ -0,0 +1 @@
1
+ export { default as SkeletonImage } from './Image'
@@ -0,0 +1,23 @@
1
+ .xUi-skeleton-image {
2
+ width: 96px;
3
+ height: 96px;
4
+ line-height: 96px;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ vertical-align: top;
9
+ background: rgba(190, 190, 190, 0.2);
10
+ }
11
+
12
+ .xUi-skeleton-image .xUi-skeleton-icon {
13
+ font-size: inherit !important;
14
+ }
15
+
16
+ .xUi-skeleton-image svg {
17
+ width: 48px;
18
+ height: 100%;
19
+ max-width: 192px;
20
+ line-height: 48px;
21
+ display: flex;
22
+ margin: 0 auto;
23
+ }
@@ -0,0 +1,42 @@
1
+ import React, { FC, ReactElement } from 'react';
2
+ import { clsx } from '../../../helpers';
3
+ import { SkeletonInputProps } from '../../../types/skeleton';
4
+ import { prefixClsSkeleton } from '../../../utils';
5
+ import './style.css';
6
+
7
+ const INPUT_SKELETON_SIZE = {
8
+ small: `${prefixClsSkeleton}-input-sm`,
9
+ large: `${prefixClsSkeleton}-input-lg`,
10
+ default: ''
11
+ };
12
+
13
+ const SkeletonInput: FC<SkeletonInputProps> = ({
14
+ prefixCls = prefixClsSkeleton,
15
+ style,
16
+ block,
17
+ active,
18
+ className,
19
+ size = 'default'
20
+ }): ReactElement => {
21
+ return (
22
+ <div
23
+ className={clsx([
24
+ `${prefixCls}-element`,
25
+ {
26
+ [`${prefixCls}-active`]: active,
27
+ [`${prefixCls}-block`]: block
28
+ },
29
+ className
30
+ ])}
31
+ >
32
+ <span
33
+ className={`${prefixCls}-input ${INPUT_SKELETON_SIZE[size]} ${
34
+ className || ''
35
+ }`}
36
+ style={style}
37
+ />
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default SkeletonInput
@@ -0,0 +1 @@
1
+ export { default as SkeletonInput } from './Input'
@@ -0,0 +1,56 @@
1
+ @keyframes xUi-skeleton-loading {
2
+ 0% {
3
+ background-position: 100% 50%;
4
+ }
5
+ 100% {
6
+ background-position: 0 50%;
7
+ }
8
+ }
9
+
10
+ .xUi-skeleton-element {
11
+ display: inline-block !important;
12
+ width: auto !important;
13
+ }
14
+
15
+ .xUi-skeleton-input {
16
+ display: inline-block;
17
+ vertical-align: top;
18
+ background: rgba(190, 190, 190, 0.2);
19
+ width: 160px;
20
+ min-width: 160px;
21
+ height: 32px;
22
+ line-height: 32px;
23
+ }
24
+
25
+ .xUi-skeleton-input-sm {
26
+ width: 120px;
27
+ min-width: 120px;
28
+ height: 24px;
29
+ line-height: 24px;
30
+ }
31
+
32
+ .xUi-skeleton-input-lg {
33
+ width: 200px;
34
+ min-width: 200px;
35
+ height: 44px;
36
+ line-height: 44px;
37
+ }
38
+
39
+ .xUi-skeleton-active .xUi-skeleton-input {
40
+ background: linear-gradient(
41
+ 90deg,
42
+ rgba(190, 190, 190, 0.2) 25%,
43
+ rgba(129, 129, 129, 0.24) 37%,
44
+ rgba(190, 190, 190, 0.2) 63%
45
+ );
46
+ background-size: 400% 100%;
47
+ animation: xUi-skeleton-loading 1.4s ease infinite;
48
+ }
49
+
50
+ .xUi-skeleton-block {
51
+ width: 100%;
52
+ }
53
+
54
+ .xUi-skeleton-block .xUi-skeleton-input {
55
+ width: 100%;
56
+ }