lumen-plus 0.0.3 → 0.0.5

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 (73) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/theme-chalk/_index.scss +69 -0
  3. package/dist/theme-chalk/_reset.scss +16 -0
  4. package/dist/theme-chalk/_variables.scss +91 -0
  5. package/dist/theme-chalk/affix.scss +8 -0
  6. package/dist/theme-chalk/alert.scss +140 -0
  7. package/dist/theme-chalk/autocomplete.scss +238 -0
  8. package/dist/theme-chalk/avatar.scss +49 -0
  9. package/dist/theme-chalk/backtop.scss +55 -0
  10. package/dist/theme-chalk/badge.scss +47 -0
  11. package/dist/theme-chalk/breadcrumb.scss +50 -0
  12. package/dist/theme-chalk/button.scss +472 -0
  13. package/dist/theme-chalk/calendar.scss +166 -0
  14. package/dist/theme-chalk/card.scss +70 -0
  15. package/dist/theme-chalk/carousel.scss +167 -0
  16. package/dist/theme-chalk/cascader.scss +265 -0
  17. package/dist/theme-chalk/checkbox.scss +127 -0
  18. package/dist/theme-chalk/collapse.scss +100 -0
  19. package/dist/theme-chalk/color-picker.scss +247 -0
  20. package/dist/theme-chalk/container.scss +79 -0
  21. package/dist/theme-chalk/date-picker.scss +352 -0
  22. package/dist/theme-chalk/date-time-picker.scss +396 -0
  23. package/dist/theme-chalk/descriptions.scss +160 -0
  24. package/dist/theme-chalk/dialog.scss +154 -0
  25. package/dist/theme-chalk/divider.scss +61 -0
  26. package/dist/theme-chalk/drawer.scss +211 -0
  27. package/dist/theme-chalk/dropdown.scss +230 -0
  28. package/dist/theme-chalk/empty.scss +36 -0
  29. package/dist/theme-chalk/form.scss +187 -0
  30. package/dist/theme-chalk/icon.scss +16 -0
  31. package/dist/theme-chalk/image.scss +171 -0
  32. package/dist/theme-chalk/input-number.scss +229 -0
  33. package/dist/theme-chalk/input-tag.scss +119 -0
  34. package/dist/theme-chalk/input.scss +249 -0
  35. package/dist/theme-chalk/link.scss +28 -0
  36. package/dist/theme-chalk/loading.scss +68 -0
  37. package/dist/theme-chalk/menu.scss +239 -0
  38. package/dist/theme-chalk/message.scss +150 -0
  39. package/dist/theme-chalk/messagebox.scss +76 -0
  40. package/dist/theme-chalk/mixins/_bem.scss +103 -0
  41. package/dist/theme-chalk/mixins/_function.scss +12 -0
  42. package/dist/theme-chalk/notification.scss +164 -0
  43. package/dist/theme-chalk/pagination.scss +130 -0
  44. package/dist/theme-chalk/pin-input.scss +192 -0
  45. package/dist/theme-chalk/popconfirm.scss +194 -0
  46. package/dist/theme-chalk/popover.scss +196 -0
  47. package/dist/theme-chalk/progress.scss +51 -0
  48. package/dist/theme-chalk/radio.scss +128 -0
  49. package/dist/theme-chalk/rating.scss +227 -0
  50. package/dist/theme-chalk/result.scss +80 -0
  51. package/dist/theme-chalk/segmented.scss +108 -0
  52. package/dist/theme-chalk/select.scss +301 -0
  53. package/dist/theme-chalk/skeleton.scss +113 -0
  54. package/dist/theme-chalk/slider.scss +259 -0
  55. package/dist/theme-chalk/space.scss +44 -0
  56. package/dist/theme-chalk/statistic.scss +49 -0
  57. package/dist/theme-chalk/steps.scss +255 -0
  58. package/dist/theme-chalk/switch.scss +277 -0
  59. package/dist/theme-chalk/table.scss +343 -0
  60. package/dist/theme-chalk/tabs.scss +433 -0
  61. package/dist/theme-chalk/tag.scss +143 -0
  62. package/dist/theme-chalk/textarea.scss +125 -0
  63. package/dist/theme-chalk/time-picker.scss +321 -0
  64. package/dist/theme-chalk/timeline.scss +119 -0
  65. package/dist/theme-chalk/tooltip.scss +165 -0
  66. package/dist/theme-chalk/transfer.scss +219 -0
  67. package/dist/theme-chalk/tree-select.scss +384 -0
  68. package/dist/theme-chalk/tree.scss +101 -0
  69. package/dist/theme-chalk/upload.scss +457 -0
  70. package/dist/theme-chalk/watermark.scss +30 -0
  71. package/dist/utils/index.js +1 -0
  72. package/dist/utils/transitions.js +31 -0
  73. package/package.json +8 -2
@@ -0,0 +1,457 @@
1
+ @use './variables' as *;
2
+ @use './mixins/bem' as *;
3
+
4
+ @include b('upload') {
5
+ @include when('disabled') {
6
+ .#{$namespace}-upload__trigger {
7
+ cursor: not-allowed;
8
+ }
9
+
10
+ .#{$namespace}-upload__button {
11
+ cursor: not-allowed;
12
+ opacity: 0.6;
13
+ }
14
+
15
+ .#{$namespace}-upload__card.is-trigger {
16
+ cursor: not-allowed;
17
+ opacity: 0.6;
18
+ }
19
+ }
20
+
21
+ @include e('trigger') {
22
+ display: inline-block;
23
+
24
+ &.is-drag {
25
+ display: block;
26
+ width: 100%;
27
+ padding: 40px 20px;
28
+ border: 2px dashed $border-color-base;
29
+ border-radius: $border-radius-base;
30
+ text-align: center;
31
+ cursor: pointer;
32
+ transition: border-color $transition-duration-fast;
33
+
34
+ &:hover {
35
+ border-color: $color-primary;
36
+ }
37
+ }
38
+
39
+ &.is-dragover {
40
+ border-color: $color-primary;
41
+ background: rgba($color-primary, 0.05);
42
+ }
43
+ }
44
+
45
+ @include e('drag-content') {
46
+ color: $color-text-secondary;
47
+
48
+ p {
49
+ margin: 12px 0 0;
50
+ font-size: $font-size-base;
51
+ }
52
+
53
+ em {
54
+ color: $color-primary;
55
+ font-style: normal;
56
+ }
57
+ }
58
+
59
+ @include e('button') {
60
+ display: inline-flex;
61
+ align-items: center;
62
+ gap: 6px;
63
+ padding: 8px 16px;
64
+ border: none;
65
+ border-radius: $border-radius-base;
66
+ background: $color-primary;
67
+ color: #fff;
68
+ font-size: $font-size-base;
69
+ cursor: pointer;
70
+ transition: background $transition-duration-fast;
71
+
72
+ &:hover:not(:disabled) {
73
+ background: $color-primary-light;
74
+ }
75
+ }
76
+
77
+ @include e('input') {
78
+ display: none;
79
+ }
80
+
81
+ @include e('tip') {
82
+ margin-top: 8px;
83
+ font-size: $font-size-small;
84
+ color: $color-text-secondary;
85
+ }
86
+
87
+ @include e('list') {
88
+ list-style: none;
89
+ margin: 12px 0 0;
90
+ padding: 0;
91
+ }
92
+
93
+ @include e('item') {
94
+ display: flex;
95
+ align-items: center;
96
+ padding: 8px 12px;
97
+ margin-bottom: 4px;
98
+ border-radius: $border-radius-base;
99
+ transition: background $transition-duration-fast;
100
+ cursor: pointer;
101
+
102
+ &:hover {
103
+ .#{$namespace}-upload__item-remove {
104
+ opacity: 1;
105
+ }
106
+ }
107
+
108
+ &.is-success {
109
+ .#{$namespace}-upload__item-status {
110
+ color: $color-success;
111
+ }
112
+ }
113
+
114
+ &.is-fail {
115
+ .#{$namespace}-upload__item-status {
116
+ color: $color-danger;
117
+ }
118
+ }
119
+
120
+ &.is-uploading {
121
+ .#{$namespace}-upload__item-name {
122
+ color: $color-text-secondary;
123
+ }
124
+ }
125
+ }
126
+
127
+ @include e('item-icon') {
128
+ color: $color-text-secondary;
129
+ margin-right: 8px;
130
+ flex-shrink: 0;
131
+ }
132
+
133
+ @include e('item-thumbnail') {
134
+ width: 48px;
135
+ height: 48px;
136
+ margin-right: 12px;
137
+ border-radius: $border-radius-base;
138
+ overflow: hidden;
139
+ background: $border-color-lighter;
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ flex-shrink: 0;
144
+
145
+ img {
146
+ width: 100%;
147
+ height: 100%;
148
+ object-fit: cover;
149
+ }
150
+
151
+ color: $color-text-secondary;
152
+ }
153
+
154
+ @include e('item-name') {
155
+ flex: 1;
156
+ font-size: $font-size-base;
157
+ color: $color-text-regular;
158
+ overflow: hidden;
159
+ text-overflow: ellipsis;
160
+ white-space: nowrap;
161
+ }
162
+
163
+ @include e('item-progress') {
164
+ flex: 1;
165
+ height: 4px;
166
+ background: $border-color-lighter;
167
+ border-radius: 2px;
168
+ overflow: hidden;
169
+ margin: 0 12px;
170
+ }
171
+
172
+ @include e('item-progress-bar') {
173
+ height: 100%;
174
+ background: $color-primary;
175
+ border-radius: 2px;
176
+ transition: width 0.3s ease;
177
+ }
178
+
179
+ @include e('item-status') {
180
+ margin-left: 8px;
181
+ flex-shrink: 0;
182
+ }
183
+
184
+ @include e('item-remove') {
185
+ display: flex;
186
+ align-items: center;
187
+ justify-content: center;
188
+ margin-left: 8px;
189
+ padding: 2px;
190
+ border: none;
191
+ border-radius: $border-radius-small;
192
+ background-color: transparent;
193
+ color: $color-text-secondary;
194
+ cursor: pointer;
195
+ opacity: 0;
196
+ transition: opacity $transition-duration-fast, color $transition-duration-fast, background-color $transition-duration-fast;
197
+ flex-shrink: 0;
198
+
199
+ &:hover {
200
+ color: $color-danger;
201
+ background-color: rgba($color-danger, 0.1);
202
+ }
203
+ }
204
+
205
+ // Picture 模式
206
+ @include m('picture') {
207
+ .#{$namespace}-upload__item {
208
+ padding: 8px;
209
+ border: 1px solid $border-color-light;
210
+ background: #fff;
211
+
212
+ &:hover {
213
+ background: #fff;
214
+ border-color: $color-primary;
215
+ }
216
+
217
+ &.is-fail {
218
+ border-color: $color-danger;
219
+ }
220
+ }
221
+ }
222
+
223
+ // Text 模式
224
+ @include m('text') {
225
+ .#{$namespace}-upload__item {
226
+ background: $bg-color-page;
227
+
228
+ &:hover {
229
+ background: $border-color-lighter;
230
+ }
231
+ }
232
+ }
233
+
234
+ // Picture Card 模式
235
+ @include m('picture-card') {
236
+ .#{$namespace}-upload__list {
237
+ display: flex;
238
+ flex-wrap: wrap;
239
+ gap: 8px;
240
+ margin: 0;
241
+ }
242
+
243
+ .#{$namespace}-upload__tip {
244
+ width: 100%;
245
+ }
246
+ }
247
+
248
+ @include e('card') {
249
+ width: 104px;
250
+ height: 104px;
251
+ border: 1px dashed $border-color-base;
252
+ border-radius: $border-radius-base;
253
+ overflow: hidden;
254
+ position: relative;
255
+
256
+ &.is-trigger {
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: center;
260
+ cursor: pointer;
261
+ transition: border-color $transition-duration-fast;
262
+
263
+ &:hover {
264
+ border-color: $color-primary;
265
+ }
266
+
267
+ &.is-dragover {
268
+ border-color: $color-primary;
269
+ background: rgba($color-primary, 0.05);
270
+ }
271
+ }
272
+
273
+ &.is-success {
274
+ border-style: solid;
275
+ border-color: $border-color-light;
276
+ }
277
+
278
+ &.is-fail {
279
+ border-style: solid;
280
+ border-color: $color-danger;
281
+ }
282
+
283
+ &.is-uploading {
284
+ border-style: solid;
285
+ }
286
+ }
287
+
288
+ @include e('card-inner') {
289
+ width: 100%;
290
+ height: 100%;
291
+ position: relative;
292
+ }
293
+
294
+ @include e('card-image') {
295
+ width: 100%;
296
+ height: 100%;
297
+ object-fit: cover;
298
+ }
299
+
300
+ @include e('card-file') {
301
+ position: absolute;
302
+ top: 50%;
303
+ left: 50%;
304
+ transform: translate(-50%, -50%);
305
+ color: $color-text-secondary;
306
+ }
307
+
308
+ @include e('card-progress') {
309
+ position: absolute;
310
+ bottom: 0;
311
+ left: 0;
312
+ right: 0;
313
+ height: 4px;
314
+ background: rgba(0, 0, 0, 0.3);
315
+ }
316
+
317
+ @include e('card-progress-bar') {
318
+ height: 100%;
319
+ background: $color-primary;
320
+ transition: width 0.3s ease;
321
+ }
322
+
323
+ @include e('card-actions') {
324
+ position: absolute;
325
+ top: 0;
326
+ left: 0;
327
+ right: 0;
328
+ bottom: 0;
329
+ background: rgba(0, 0, 0, 0.5);
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+ gap: 8px;
334
+ opacity: 0;
335
+ transition: opacity $transition-duration-fast;
336
+
337
+ .#{$namespace}-upload__card:hover & {
338
+ opacity: 1;
339
+ }
340
+ }
341
+
342
+ @include e('card-action') {
343
+ display: flex;
344
+ align-items: center;
345
+ justify-content: center;
346
+ width: 28px;
347
+ height: 28px;
348
+ border: none;
349
+ border-radius: 50%;
350
+ background: transparent;
351
+ color: #fff;
352
+ cursor: pointer;
353
+ transition: background $transition-duration-fast;
354
+
355
+ &:hover {
356
+ background: rgba(255, 255, 255, 0.2);
357
+ }
358
+ }
359
+
360
+ @include e('card-status') {
361
+ position: absolute;
362
+ right: -15px;
363
+ top: -6px;
364
+ width: 40px;
365
+ height: 24px;
366
+ background: $color-success;
367
+ transform: rotate(45deg);
368
+ display: flex;
369
+ align-items: flex-end;
370
+ justify-content: center;
371
+ padding-bottom: 1px;
372
+
373
+ &.is-success {
374
+ background: $color-success;
375
+ }
376
+
377
+ &.is-fail {
378
+ background: $color-danger;
379
+ }
380
+
381
+ color: #fff;
382
+
383
+ .#{$namespace}-icon {
384
+ transform: rotate(-45deg);
385
+ }
386
+ }
387
+
388
+ @include e('card-add') {
389
+ color: $border-color-base;
390
+ transition: color $transition-duration-fast;
391
+
392
+ .#{$namespace}-upload__card.is-trigger:hover & {
393
+ color: $color-primary;
394
+ }
395
+ }
396
+ }
397
+
398
+ .dark {
399
+ .#{$namespace}-upload {
400
+ .#{$namespace}-upload__trigger.is-drag {
401
+ border-color: $bg-color-dark-lighter;
402
+ }
403
+
404
+ .#{$namespace}-upload__drag-content {
405
+ color: $color-text-dark-secondary;
406
+ }
407
+
408
+ .#{$namespace}-upload__tip {
409
+ color: $color-text-dark-secondary;
410
+ }
411
+
412
+ &.#{$namespace}-upload--text {
413
+ .#{$namespace}-upload__item {
414
+ background: $bg-color-dark-light;
415
+
416
+ &:hover {
417
+ background: color-mix(in oklab, $bg-color-dark-lighter 70%, $color-text-dark);
418
+ }
419
+ }
420
+ }
421
+
422
+ .#{$namespace}-upload__item-thumbnail {
423
+ background: $bg-color-dark-lighter;
424
+ }
425
+
426
+ .#{$namespace}-upload__item-name {
427
+ color: $color-text-dark;
428
+ }
429
+
430
+ .#{$namespace}-upload__item-icon {
431
+ color: $color-text-dark-secondary;
432
+ }
433
+
434
+ .#{$namespace}-upload__item-progress {
435
+ background: $bg-color-dark-lighter;
436
+ }
437
+
438
+ &.#{$namespace}-upload--picture {
439
+ .#{$namespace}-upload__item {
440
+ background: $bg-color-dark-light;
441
+ border-color: $bg-color-dark-lighter;
442
+
443
+ &:hover {
444
+ background: $bg-color-dark-light;
445
+ }
446
+ }
447
+ }
448
+
449
+ .#{$namespace}-upload__card {
450
+ border-color: $bg-color-dark-lighter;
451
+
452
+ &.is-success {
453
+ border-color: $bg-color-dark-lighter;
454
+ }
455
+ }
456
+ }
457
+ }
@@ -0,0 +1,30 @@
1
+ @use './variables' as *;
2
+ @use './mixins/bem' as *;
3
+
4
+ @include b('watermark') {
5
+ position: relative;
6
+ --lm-watermark-font-color: rgba(0, 0, 0, 0.15);
7
+ --lm-watermark-opacity: 1;
8
+
9
+ @include e('mark') {
10
+ position: absolute;
11
+ top: 0;
12
+ left: 0;
13
+ width: 100%;
14
+ height: 100%;
15
+ pointer-events: none;
16
+ background-repeat: repeat;
17
+ opacity: var(--lm-watermark-opacity);
18
+ }
19
+ }
20
+
21
+ .dark {
22
+ .#{$namespace}-watermark {
23
+ --lm-watermark-font-color: rgba(255, 255, 255, 0.22);
24
+ --lm-watermark-opacity: 0.75;
25
+
26
+ .#{$namespace}-watermark__mark {
27
+ opacity: var(--lm-watermark-opacity);
28
+ }
29
+ }
30
+ }
@@ -0,0 +1 @@
1
+ export { createDropdownTransition, createCenteredDropdownTransition } from './transitions';
@@ -0,0 +1,31 @@
1
+ import { cubicOut } from 'svelte/easing';
2
+ export const createDropdownTransition = (reduceMotion) => {
3
+ return (_node, opts = {}) => {
4
+ const duration = reduceMotion ? 0 : (opts.duration ?? 160);
5
+ return {
6
+ duration,
7
+ easing: cubicOut,
8
+ css: (t) => {
9
+ const opacity = t;
10
+ const scale = 0.98 + t * 0.02;
11
+ const translateY = (1 - t) * -4;
12
+ return `transform-origin: top; transform: translateY(${translateY}px) scale(${scale}); opacity: ${opacity};`;
13
+ },
14
+ };
15
+ };
16
+ };
17
+ export const createCenteredDropdownTransition = (reduceMotion) => {
18
+ return (_node, opts = {}) => {
19
+ const duration = reduceMotion ? 0 : (opts.duration ?? 160);
20
+ return {
21
+ duration,
22
+ easing: cubicOut,
23
+ css: (t) => {
24
+ const opacity = t;
25
+ const scale = 0.98 + t * 0.02;
26
+ const translateY = (1 - t) * -4;
27
+ return `transform-origin: top; transform: translateX(-50%) translateY(${translateY}px) scale(${scale}); opacity: ${opacity};`;
28
+ },
29
+ };
30
+ };
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumen-plus",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Lumen Plus - Complete Svelte 5 UI Component Library",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",
@@ -12,6 +12,11 @@
12
12
  "import": "./dist/index.js",
13
13
  "default": "./dist/index.js"
14
14
  },
15
+ "./theme-chalk": {
16
+ "import": "./dist/theme-chalk/_index.scss",
17
+ "default": "./dist/theme-chalk/_index.scss"
18
+ },
19
+ "./theme-chalk/*": "./dist/theme-chalk/*",
15
20
  "./package.json": "./package.json"
16
21
  },
17
22
  "files": [
@@ -24,7 +29,8 @@
24
29
  "dev": "rm -rf dist && svelte-package -i src -o dist -w"
25
30
  },
26
31
  "dependencies": {
27
- "lucide": "^0.563.0"
32
+ "lucide": "^0.563.0",
33
+ "async-validator": "^4.2.5"
28
34
  },
29
35
  "devDependencies": {
30
36
  "@sveltejs/package": "^2.5.7",