@easyv/react-components 0.1.0 → 0.2.1

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 (78) hide show
  1. package/dist/BlurInput/index.d.ts +12 -0
  2. package/dist/BlurInput/index.js +58 -0
  3. package/dist/ColorsPicker/ControlBar.d.ts +9 -0
  4. package/dist/ColorsPicker/ControlBar.js +75 -0
  5. package/dist/ColorsPicker/History.d.ts +7 -0
  6. package/dist/ColorsPicker/History.js +53 -0
  7. package/dist/ColorsPicker/HistoryLinear.d.ts +6 -0
  8. package/dist/ColorsPicker/HistoryLinear.js +36 -0
  9. package/dist/ColorsPicker/HistoryPure.d.ts +5 -0
  10. package/dist/ColorsPicker/HistoryPure.js +28 -0
  11. package/dist/ColorsPicker/LinearColorPicker/LinearColorInput.d.ts +8 -0
  12. package/dist/ColorsPicker/LinearColorPicker/LinearColorInput.js +50 -0
  13. package/dist/ColorsPicker/LinearColorPicker/LinearColorPanel.d.ts +8 -0
  14. package/dist/ColorsPicker/LinearColorPicker/LinearColorPanel.js +89 -0
  15. package/dist/ColorsPicker/LinearColorPicker/LinearPointsBar.d.ts +10 -0
  16. package/dist/ColorsPicker/LinearColorPicker/LinearPointsBar.js +156 -0
  17. package/dist/ColorsPicker/LinearColorPicker/index.d.ts +2 -0
  18. package/dist/ColorsPicker/LinearColorPicker/index.js +2 -0
  19. package/dist/ColorsPicker/LinearColorPicker/useHistory.d.ts +4 -0
  20. package/dist/ColorsPicker/LinearColorPicker/useHistory.js +32 -0
  21. package/dist/ColorsPicker/MixedColorPicker/ColorTypeTab.d.ts +8 -0
  22. package/dist/ColorsPicker/MixedColorPicker/ColorTypeTab.js +30 -0
  23. package/dist/ColorsPicker/MixedColorPicker/MixedPanel.d.ts +9 -0
  24. package/dist/ColorsPicker/MixedColorPicker/MixedPanel.js +76 -0
  25. package/dist/ColorsPicker/MixedColorPicker/index.d.ts +1 -0
  26. package/dist/ColorsPicker/MixedColorPicker/index.js +1 -0
  27. package/dist/ColorsPicker/Palette.d.ts +8 -0
  28. package/dist/ColorsPicker/Palette.js +43 -0
  29. package/dist/ColorsPicker/Panel.d.ts +7 -0
  30. package/dist/ColorsPicker/Panel.js +258 -0
  31. package/dist/ColorsPicker/PanelContainer.d.ts +6 -0
  32. package/dist/ColorsPicker/PanelContainer.js +8 -0
  33. package/dist/ColorsPicker/PureColorPicker/PureColorInput.d.ts +7 -0
  34. package/dist/ColorsPicker/PureColorPicker/PureColorInput.js +61 -0
  35. package/dist/ColorsPicker/PureColorPicker/PureColorPanel.d.ts +8 -0
  36. package/dist/ColorsPicker/PureColorPicker/PureColorPanel.js +42 -0
  37. package/dist/ColorsPicker/PureColorPicker/index.d.ts +2 -0
  38. package/dist/ColorsPicker/PureColorPicker/index.js +2 -0
  39. package/dist/ColorsPicker/PureColorPicker/useHistory.d.ts +4 -0
  40. package/dist/ColorsPicker/PureColorPicker/useHistory.js +32 -0
  41. package/dist/ColorsPicker/PuresColorPicker/PuresCards.d.ts +10 -0
  42. package/dist/ColorsPicker/PuresColorPicker/PuresCards.js +40 -0
  43. package/dist/ColorsPicker/PuresColorPicker/PuresColorInput.d.ts +7 -0
  44. package/dist/ColorsPicker/PuresColorPicker/PuresColorInput.js +20 -0
  45. package/dist/ColorsPicker/PuresColorPicker/PuresColorPanel.d.ts +8 -0
  46. package/dist/ColorsPicker/PuresColorPicker/PuresColorPanel.js +90 -0
  47. package/dist/ColorsPicker/PuresColorPicker/index.d.ts +3 -0
  48. package/dist/ColorsPicker/PuresColorPicker/index.js +3 -0
  49. package/dist/ColorsPicker/PuresColorPicker/useHistory.d.ts +5 -0
  50. package/dist/ColorsPicker/PuresColorPicker/useHistory.js +34 -0
  51. package/dist/ColorsPicker/RangeColorPicker/RangeColorInput.d.ts +7 -0
  52. package/dist/ColorsPicker/RangeColorPicker/RangeColorInput.js +19 -0
  53. package/dist/ColorsPicker/RangeColorPicker/RangeColorPanel.d.ts +8 -0
  54. package/dist/ColorsPicker/RangeColorPicker/RangeColorPanel.js +67 -0
  55. package/dist/ColorsPicker/RangeColorPicker/RangePointBar.d.ts +8 -0
  56. package/dist/ColorsPicker/RangeColorPicker/RangePointBar.js +63 -0
  57. package/dist/ColorsPicker/RangeColorPicker/index.d.ts +2 -0
  58. package/dist/ColorsPicker/RangeColorPicker/index.js +2 -0
  59. package/dist/ColorsPicker/common/Preview.d.ts +11 -0
  60. package/dist/ColorsPicker/common/Preview.js +60 -0
  61. package/dist/ColorsPicker/hooks/useColorsPicker.d.ts +2 -0
  62. package/dist/ColorsPicker/hooks/useColorsPicker.js +106 -0
  63. package/dist/ColorsPicker/hooks/useControlBlock.d.ts +12 -0
  64. package/dist/ColorsPicker/hooks/useControlBlock.js +69 -0
  65. package/dist/ColorsPicker/hooks/useLocalstorageRef.d.ts +3 -0
  66. package/dist/ColorsPicker/hooks/useLocalstorageRef.js +11 -0
  67. package/dist/ColorsPicker/index.d.ts +4 -0
  68. package/dist/ColorsPicker/index.js +199 -0
  69. package/dist/ColorsPicker/interface.d.ts +59 -0
  70. package/dist/ColorsPicker/interface.js +1 -0
  71. package/dist/ColorsPicker/style/index.less +515 -0
  72. package/dist/ColorsPicker/utils.d.ts +29 -0
  73. package/dist/ColorsPicker/utils.js +233 -0
  74. package/dist/global.d.ts +13 -0
  75. package/dist/hooks/index.d.ts +3 -0
  76. package/dist/index.d.ts +2 -0
  77. package/dist/index.js +1 -2
  78. package/package.json +12 -9
@@ -0,0 +1,515 @@
1
+ // panel
2
+ .colors-picker-panel-container {
3
+ width: 244px;
4
+ border-radius: 4px;
5
+ border: 1px solid var(--color-border-2);
6
+ background: var(--color-bg-1);
7
+ box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.25);
8
+ }
9
+
10
+ .colors-picker-panel {
11
+ padding: 12px;
12
+ }
13
+
14
+ .colors-picker-control-wrapper {
15
+ margin: 12px 0;
16
+ display: flex;
17
+ gap: 8px;
18
+ }
19
+
20
+ .colors-picker-control-bars {
21
+ flex: 1;
22
+ }
23
+
24
+ .colors-picker-input-wrapper {
25
+ display: flex;
26
+ gap: 4px;
27
+ font-size: 12px;
28
+ }
29
+
30
+ .colors-picker-input {
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: center;
34
+ flex: 1;
35
+
36
+ &.colors-picker-input-hex {
37
+ flex: 2.1875;
38
+ }
39
+
40
+ .arco-input {
41
+ font-size: 12px;
42
+ padding-left: 0;
43
+ padding-right: 0;
44
+ text-align: center;
45
+ }
46
+ }
47
+
48
+ .colors-picker-input-label {
49
+ margin-top: 4px;
50
+ color: var(--color-text-3);
51
+ }
52
+
53
+ // 色板
54
+ .colors-picker-palette {
55
+ position: relative;
56
+ width: 100%;
57
+ height: 150px;
58
+ cursor: pointer;
59
+ background-image: linear-gradient(0deg, #000, transparent),
60
+ linear-gradient(90deg, rgb(255, 255, 255), rgba(255, 255, 255, 0));
61
+ border-radius: 2px;
62
+ }
63
+
64
+ .colors-picker-handler {
65
+ position: absolute;
66
+ width: 12px;
67
+ height: 12px;
68
+ border-radius: 50%;
69
+ background-color: transparent;
70
+ border: 2px solid #fff;
71
+ transform: translate(-50%, -50%);
72
+ }
73
+
74
+ // 色相、透明度的控制条
75
+ .colors-picker-control-bar {
76
+ position: relative;
77
+ padding: 0 5px;
78
+ height: 10px;
79
+ border-radius: 5px;
80
+ border: 1px solid #17171a;
81
+ margin: 3px 0;
82
+
83
+ .colors-picker-control-bar-inner {
84
+ position: relative;
85
+ height: 100%;
86
+ }
87
+
88
+ .colors-picker-handler {
89
+ width: 10px;
90
+ height: 10px;
91
+ top: -1px;
92
+ transform: translateX(-50%);
93
+ }
94
+
95
+ &.colors-picker-control-hue {
96
+ background-image: linear-gradient(
97
+ 90deg,
98
+ red,
99
+ #ff0 17%,
100
+ #0f0 33%,
101
+ #0ff 50%,
102
+ #00f 67%,
103
+ #f0f 83%,
104
+ red
105
+ );
106
+
107
+ .colors-picker-control-bar-inner {
108
+ background-image: linear-gradient(
109
+ 90deg,
110
+ red,
111
+ #ff0 17%,
112
+ #0f0 33%,
113
+ #0ff 50%,
114
+ #00f 67%,
115
+ #f0f 83%,
116
+ red
117
+ );
118
+ }
119
+ }
120
+
121
+ &.colors-picker-control-alpha {
122
+ background-image: conic-gradient(
123
+ #ccc 0,
124
+ #ccc 90deg,
125
+ #fff 90deg,
126
+ #fff 180deg,
127
+ #ccc 180deg,
128
+ #ccc 270deg,
129
+ #fff 270deg,
130
+ #fff 360deg
131
+ );
132
+ background-size: 6px 6px;
133
+ }
134
+ }
135
+
136
+ .colors-picker-control-alpha {
137
+ margin-top: 7px;
138
+ }
139
+
140
+ .colors-picker-control-bar-right-box {
141
+ position: absolute;
142
+ right: -5px;
143
+ border-top-right-radius: 5px;
144
+ border-bottom-right-radius: 5px;
145
+ top: 0;
146
+ width: 5px;
147
+ height: 8px;
148
+ }
149
+
150
+ // 最近使用
151
+ .colors-picker-history {
152
+ border-top: 1px solid var(--color-border-1);
153
+ padding: 12px;
154
+ }
155
+
156
+ .colors-picker-history-title {
157
+ display: flex;
158
+ justify-content: space-between;
159
+ align-items: center;
160
+ cursor: pointer;
161
+ }
162
+
163
+ .colors-picker-history-icon {
164
+ width: 12px;
165
+ height: 12px;
166
+ color: var(--color-text-2);
167
+ transition: transform linear 200ms;
168
+
169
+ &.colors-picker-history-collapsed {
170
+ transform: rotate(-90deg);
171
+ }
172
+ }
173
+
174
+ .colors-picker-history-list {
175
+ display: flex;
176
+ flex-wrap: wrap;
177
+ margin-top: 12px;
178
+ }
179
+
180
+ .colors-picker-history-type-title {
181
+ margin-top: 12px;
182
+ color: var(--color-text-2);
183
+ }
184
+
185
+ // 最近使用 - 纯色
186
+ .colors-picker-history-pure-wrapper {
187
+ display: flex;
188
+ gap: 8px;
189
+ flex-wrap: wrap;
190
+ margin-top: 12px;
191
+ }
192
+
193
+ // 预览颜色
194
+ .colors-picker-preview {
195
+ position: relative;
196
+ overflow: hidden;
197
+ width: 28px;
198
+ height: 28px;
199
+ border-radius: 1px;
200
+ background-image: conic-gradient(
201
+ #ccc 0,
202
+ #ccc 90deg,
203
+ #fff 90deg,
204
+ #fff 180deg,
205
+ #ccc 180deg,
206
+ #ccc 270deg,
207
+ #fff 270deg,
208
+ #fff 360deg
209
+ );
210
+ background-size: 8px 8px;
211
+
212
+ .colors-picker-preview-color {
213
+ width: 100%;
214
+ height: 100%;
215
+ }
216
+
217
+ &.colors-picker-preview-circle {
218
+ border-radius: 50%;
219
+ }
220
+
221
+ &.colors-picker-preview-border {
222
+ border: 1px solid #333;
223
+ }
224
+ }
225
+
226
+ // 多色
227
+ .pures-color-picker-trigger {
228
+ position: relative;
229
+ width: 100%;
230
+ height: 28px;
231
+ padding: 7px;
232
+ border: 1px solid var(--color-border-2);
233
+ border-radius: 4px;
234
+
235
+ &::before {
236
+ position: absolute;
237
+ content: '';
238
+ top: 7px;
239
+ left: 7px;
240
+ width: calc(100% - 14px);
241
+ height: calc(100% - 14px);
242
+ border-radius: 1px;
243
+ background-image: conic-gradient(
244
+ #ccc 0,
245
+ #ccc 90deg,
246
+ #fff 90deg,
247
+ #fff 180deg,
248
+ #ccc 180deg,
249
+ #ccc 270deg,
250
+ #fff 270deg,
251
+ #fff 360deg
252
+ );
253
+ background-size: 8px 8px;
254
+ }
255
+
256
+ .pures-color-picker-trigger-color {
257
+ position: relative;
258
+ width: 100%;
259
+ height: 100%;
260
+ border-radius: 1px;
261
+ }
262
+ }
263
+
264
+ .pures-color-picker-cards {
265
+ display: flex;
266
+ flex-wrap: wrap;
267
+ padding: 6px 11px;
268
+ border-bottom: 1px solid var(--color-border-1);
269
+ gap: 4px;
270
+
271
+ .pures-color-picker-card {
272
+ width: 24px;
273
+ height: 24px;
274
+ flex-shrink: 0;
275
+ border-radius: 4px;
276
+ border-width: 2px;
277
+ border-style: solid;
278
+ cursor: pointer;
279
+ }
280
+
281
+ .pures-color-picker-add {
282
+ display: flex;
283
+ align-items: center;
284
+ justify-content: center;
285
+ width: 24px;
286
+ height: 24px;
287
+ flex-shrink: 0;
288
+ border-radius: 4px;
289
+ background-color: rgba(255, 255, 255, 0.08);
290
+ cursor: pointer;
291
+ font-size: 14px;
292
+ }
293
+ }
294
+
295
+ // 取色器
296
+ .colors-picker-eye-dropper {
297
+ width: 28px;
298
+ height: 28px;
299
+ display: flex;
300
+ align-items: center;
301
+ justify-content: center;
302
+ border-radius: 4px;
303
+ color: var(--color-text-2);
304
+ cursor: pointer;
305
+
306
+ &:hover {
307
+ background: rgb(var(--primary-6));
308
+ color: var(--color-text-1);
309
+ }
310
+ }
311
+
312
+ // 纯色输入框
313
+ .pure-color-picker {
314
+ display: flex;
315
+ gap: 12px;
316
+
317
+ .pure-color-picker-hex {
318
+ font-size: 12px;
319
+ }
320
+
321
+ .pure-color-picker-alpha {
322
+ width: 64px;
323
+ flex-shrink: 0;
324
+ font-size: 12px;
325
+ }
326
+ }
327
+
328
+ .pure-color-picker-preview {
329
+ width: 28px;
330
+ height: 28px;
331
+ padding: 7px;
332
+ flex-shrink: 0;
333
+ border-radius: 4px;
334
+ border: 1px solid var(--color-border-2);
335
+ background: var(--color-bg-white);
336
+ }
337
+
338
+ .pure-color-picker-preview-inner {
339
+ width: 100%;
340
+ height: 100%;
341
+ border-radius: 1px;
342
+ background-image: conic-gradient(
343
+ #ccc 0deg,
344
+ #ccc 90deg,
345
+ #fff 90deg,
346
+ #fff 180deg,
347
+ #ccc 180deg,
348
+ #ccc 270deg,
349
+ #fff 270deg,
350
+ #fff 360deg,
351
+ #ccc 360deg
352
+ );
353
+ background-size: 8px 8px;
354
+
355
+ div {
356
+ width: 100%;
357
+ height: 100%;
358
+ }
359
+ }
360
+
361
+ // 多种类型的颜色选择 Tab
362
+ .colors-picker-tabs {
363
+ padding: 10px 12px;
364
+ display: flex;
365
+ align-items: center;
366
+ gap: 8px;
367
+ border-bottom: 1px solid var(--color-border-1);
368
+
369
+ .colors-picker-tab {
370
+ width: 16px;
371
+ height: 16px;
372
+ border-radius: 50%;
373
+ cursor: pointer;
374
+
375
+ &.active {
376
+ width: 18px;
377
+ height: 18px;
378
+ border: 1px solid rgb(var(--primary-6));
379
+ }
380
+
381
+ &.colors-picker-tab-pure {
382
+ background-color: rgba(180, 183, 193, 0.8);
383
+
384
+ &.active {
385
+ background-color: rgba(var(--primary-6), 0.8);
386
+ }
387
+ }
388
+
389
+ &.colors-picker-tab-pures {
390
+ background-image: linear-gradient(
391
+ to right,
392
+ rgba(180, 183, 193, 0.8) 0%,
393
+ rgba(180, 183, 193, 0.8) 33.3%,
394
+ rgba(180, 183, 193, 0.6) 33.3%,
395
+ rgba(180, 183, 193, 0.6) 66.6%,
396
+ rgba(180, 183, 193, 0.4) 66.6%,
397
+ rgba(180, 183, 193, 0.4) 100%
398
+ );
399
+
400
+ &.active {
401
+ background-image: linear-gradient(
402
+ to right,
403
+ rgba(var(--primary-6), 0.8) 0%,
404
+ rgba(var(--primary-6), 0.8) 33.3%,
405
+ rgba(var(--primary-6), 0.6) 33.3%,
406
+ rgba(var(--primary-6), 0.6) 66.6%,
407
+ rgba(var(--primary-6), 0.4) 66.6%,
408
+ rgba(var(--primary-6), 0.4) 100%
409
+ );
410
+ }
411
+ }
412
+
413
+ &.colors-picker-tab-linear {
414
+ background-image: linear-gradient(
415
+ to bottom,
416
+ rgba(180, 183, 193, 1),
417
+ rgba(180, 183, 193, 0.1)
418
+ );
419
+
420
+ &.active {
421
+ background-image: linear-gradient(
422
+ to bottom,
423
+ rgba(var(--primary-6), 1),
424
+ rgba(var(--primary-6), 0.1)
425
+ );
426
+ }
427
+ }
428
+ }
429
+ }
430
+
431
+ // 渐变的点控制
432
+ .colors-picker-linear-points-bar-wrapper {
433
+ padding: 8px 12px;
434
+ display: flex;
435
+ align-items: center;
436
+ gap: 8px;
437
+
438
+ .colors-picker-linear-points-bar {
439
+ position: relative;
440
+ flex: 1;
441
+ height: 8px;
442
+ border-radius: 4px;
443
+ padding: 0 4px;
444
+ background-image: conic-gradient(
445
+ #ccc 0deg,
446
+ #ccc 90deg,
447
+ #fff 90deg,
448
+ #fff 180deg,
449
+ #ccc 180deg,
450
+ #ccc 270deg,
451
+ #fff 270deg,
452
+ #fff 360deg,
453
+ #ccc 360deg
454
+ );
455
+ background-size: 8px 8px;
456
+ }
457
+
458
+ .colors-picker-points-bar-prev-half,
459
+ .colors-picker-points-bar-next-half {
460
+ position: absolute;
461
+ width: 4px;
462
+ height: 8px;
463
+ top: 0;
464
+ }
465
+
466
+ .colors-picker-points-bar-prev-half {
467
+ border-top-left-radius: 4px;
468
+ border-bottom-left-radius: 4px;
469
+ left: 0;
470
+ }
471
+
472
+ .colors-picker-points-bar-next-half {
473
+ border-top-right-radius: 4px;
474
+ border-bottom-right-radius: 4px;
475
+ right: 0;
476
+ }
477
+
478
+ .colors-picker-linear-points-bar-color {
479
+ width: 100%;
480
+ height: 100%;
481
+ position: relative;
482
+ }
483
+
484
+ .colors-picker-linear-point {
485
+ position: absolute;
486
+ top: -1px;
487
+ width: 10px;
488
+ height: 10px;
489
+ border-radius: 50%;
490
+ border: 2px solid #fff;
491
+ cursor: pointer;
492
+ transform: translateX(-50%);
493
+
494
+ &.active {
495
+ box-shadow: 0 0 0 2px rgba(var(--primary-6), 0.5);
496
+ }
497
+ }
498
+
499
+ .colors-picker-linear-points-switch {
500
+ width: 24px;
501
+ height: 24px;
502
+ border-radius: 4px;
503
+ display: flex;
504
+ align-items: center;
505
+ justify-content: center;
506
+ font-size: 14px;
507
+ color: var(--color-text-2);
508
+ background: rgba(255, 255, 255, 0.08);
509
+ cursor: pointer;
510
+
511
+ &:hover {
512
+ color: var(--color-text-1);
513
+ }
514
+ }
515
+ }
@@ -0,0 +1,29 @@
1
+ import { ColorValueMap } from './interface';
2
+ export declare function toHex(x: any): string;
3
+ export declare function resolveColor(colorParam: string): {
4
+ r?: undefined;
5
+ g?: undefined;
6
+ b?: undefined;
7
+ a?: undefined;
8
+ hex?: undefined;
9
+ } | {
10
+ r: any;
11
+ g: any;
12
+ b: any;
13
+ a: any;
14
+ hex: string;
15
+ };
16
+ export declare function transformColor(color: any, a: any): string | undefined;
17
+ export declare function getBackgroundAccordingColor(color: any, fixedAngle?: number): {
18
+ backgroundImage: string;
19
+ background?: undefined;
20
+ } | {
21
+ background: any;
22
+ backgroundImage?: undefined;
23
+ } | undefined;
24
+ export declare function getMiddleColor(colors: any, offset: any): any;
25
+ export declare function getHexValue(hex: string): string;
26
+ export declare function getLinearGradientStyle(color: ColorValueMap['linear']): {
27
+ backgroundImage: string;
28
+ opacity: number;
29
+ };