weifuwu 0.27.12 → 0.27.13

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.
@@ -0,0 +1,646 @@
1
+ /**
2
+ * weifuwu-ui.css — Zero-dependency UI component styles for weifuwu SSR.
3
+ *
4
+ * Usage:
5
+ * <link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css">
6
+ *
7
+ * Theme: set data-theme="dark" on <html> to activate dark mode.
8
+ * Customize: override CSS variables in :root.
9
+ *
10
+ * @license MIT
11
+ * @version 0.1.0
12
+ */
13
+
14
+ /* ═══════════════════════════════════════════════════════════════════
15
+ CSS Variables (Theme Entry)
16
+ ═══════════════════════════════════════════════════════════════════ */
17
+
18
+ :root {
19
+ --wu-primary: #3b82f6;
20
+ --wu-primary-hover: #2563eb;
21
+ --wu-primary-light: color-mix(in srgb, var(--wu-primary) 15%, transparent);
22
+ --wu-danger: #ef4444;
23
+ --wu-danger-hover: #dc2626;
24
+ --wu-danger-light: color-mix(in srgb, var(--wu-danger) 15%, transparent);
25
+ --wu-success: #22c55e;
26
+ --wu-success-light: color-mix(in srgb, var(--wu-success) 15%, transparent);
27
+ --wu-warning: #f59e0b;
28
+ --wu-warning-light: color-mix(in srgb, var(--wu-warning) 15%, transparent);
29
+
30
+ --wu-bg: #ffffff;
31
+ --wu-bg-secondary: #f9fafb;
32
+ --wu-bg-tertiary: #f3f4f6;
33
+ --wu-text: #111827;
34
+ --wu-text-secondary: #6b7280;
35
+ --wu-text-muted: #9ca3af;
36
+ --wu-border: #d1d5db;
37
+ --wu-border-light: #e5e7eb;
38
+
39
+ --wu-radius: 6px;
40
+ --wu-radius-lg: 10px;
41
+ --wu-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
42
+ --wu-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
43
+ --wu-transition: 150ms ease;
44
+
45
+ font-family:
46
+ system-ui,
47
+ -apple-system,
48
+ sans-serif;
49
+ color: var(--wu-text);
50
+ background: var(--wu-bg);
51
+ }
52
+
53
+ /* ── Dark Theme ─────────────────────────────────────────────────── */
54
+
55
+ [data-theme='dark'] {
56
+ --wu-bg: #0f172a;
57
+ --wu-bg-secondary: #1e293b;
58
+ --wu-bg-tertiary: #334155;
59
+ --wu-text: #f1f5f9;
60
+ --wu-text-secondary: #94a3b8;
61
+ --wu-text-muted: #64748b;
62
+ --wu-border: #475569;
63
+ --wu-border-light: #334155;
64
+ }
65
+
66
+ /* ═══════════════════════════════════════════════════════════════════
67
+ Layout Utilities
68
+ ═══════════════════════════════════════════════════════════════════ */
69
+
70
+ .wu-flex {
71
+ display: flex;
72
+ }
73
+ .wu-flex-col {
74
+ flex-direction: column;
75
+ }
76
+ .wu-flex-wrap {
77
+ flex-wrap: wrap;
78
+ }
79
+ .wu-flex-1 {
80
+ flex: 1;
81
+ }
82
+ .wu-items-center {
83
+ align-items: center;
84
+ }
85
+ .wu-items-start {
86
+ align-items: flex-start;
87
+ }
88
+ .wu-justify-between {
89
+ justify-content: space-between;
90
+ }
91
+ .wu-justify-center {
92
+ justify-content: center;
93
+ }
94
+ .wu-gap-xs {
95
+ gap: 4px;
96
+ }
97
+ .wu-gap-sm {
98
+ gap: 8px;
99
+ }
100
+ .wu-gap {
101
+ gap: 12px;
102
+ }
103
+ .wu-gap-md {
104
+ gap: 16px;
105
+ }
106
+ .wu-gap-lg {
107
+ gap: 24px;
108
+ }
109
+
110
+ .wu-grid {
111
+ display: grid;
112
+ }
113
+ .wu-grid-cols-2 {
114
+ grid-template-columns: repeat(2, 1fr);
115
+ }
116
+ .wu-grid-cols-3 {
117
+ grid-template-columns: repeat(3, 1fr);
118
+ }
119
+ .wu-grid-cols-4 {
120
+ grid-template-columns: repeat(4, 1fr);
121
+ }
122
+
123
+ @media (max-width: 640px) {
124
+ .wu-grid-cols-2,
125
+ .wu-grid-cols-3,
126
+ .wu-grid-cols-4 {
127
+ grid-template-columns: 1fr;
128
+ }
129
+ }
130
+
131
+ /* ═══════════════════════════════════════════════════════════════════
132
+ Typography
133
+ ═══════════════════════════════════════════════════════════════════ */
134
+
135
+ .wu-text-xs {
136
+ font-size: 0.75rem;
137
+ }
138
+ .wu-text-sm {
139
+ font-size: 0.875rem;
140
+ }
141
+ .wu-text-md {
142
+ font-size: 1rem;
143
+ }
144
+ .wu-text-lg {
145
+ font-size: 1.125rem;
146
+ }
147
+ .wu-text-xl {
148
+ font-size: 1.25rem;
149
+ }
150
+ .wu-text-2xl {
151
+ font-size: 1.5rem;
152
+ font-weight: 700;
153
+ }
154
+ .wu-text-muted {
155
+ color: var(--wu-text-muted);
156
+ }
157
+ .wu-text-secondary {
158
+ color: var(--wu-text-secondary);
159
+ }
160
+ .wu-text-center {
161
+ text-align: center;
162
+ }
163
+ .wu-font-bold {
164
+ font-weight: 600;
165
+ }
166
+ .wu-truncate {
167
+ overflow: hidden;
168
+ text-overflow: ellipsis;
169
+ white-space: nowrap;
170
+ }
171
+
172
+ /* ═══════════════════════════════════════════════════════════════════
173
+ Buttons
174
+ ═══════════════════════════════════════════════════════════════════ */
175
+
176
+ .wu-btn {
177
+ display: inline-flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ gap: 6px;
181
+ padding: 8px 16px;
182
+ font-size: 0.875rem;
183
+ font-weight: 500;
184
+ line-height: 1.25rem;
185
+ border: 1px solid var(--wu-border);
186
+ border-radius: var(--wu-radius);
187
+ background: var(--wu-bg);
188
+ color: var(--wu-text);
189
+ cursor: pointer;
190
+ transition: all var(--wu-transition);
191
+ white-space: nowrap;
192
+ text-decoration: none;
193
+ font-family: inherit;
194
+ }
195
+ .wu-btn:hover {
196
+ background: var(--wu-bg-secondary);
197
+ }
198
+ .wu-btn:disabled {
199
+ opacity: 0.5;
200
+ cursor: not-allowed;
201
+ }
202
+
203
+ .wu-btn-primary {
204
+ background: var(--wu-primary);
205
+ color: #ffffff;
206
+ border-color: var(--wu-primary);
207
+ }
208
+ .wu-btn-primary:hover {
209
+ background: var(--wu-primary-hover);
210
+ }
211
+
212
+ .wu-btn-danger {
213
+ background: var(--wu-danger);
214
+ color: #ffffff;
215
+ border-color: var(--wu-danger);
216
+ }
217
+ .wu-btn-danger:hover {
218
+ background: var(--wu-danger-hover);
219
+ }
220
+
221
+ .wu-btn-sm {
222
+ padding: 4px 10px;
223
+ font-size: 0.75rem;
224
+ }
225
+ .wu-btn-lg {
226
+ padding: 12px 24px;
227
+ font-size: 1rem;
228
+ }
229
+ .wu-btn-block {
230
+ display: flex;
231
+ width: 100%;
232
+ }
233
+
234
+ /* ═══════════════════════════════════════════════════════════════════
235
+ Forms
236
+ ═══════════════════════════════════════════════════════════════════ */
237
+
238
+ .wu-input,
239
+ .wu-select,
240
+ .wu-textarea {
241
+ width: 100%;
242
+ padding: 8px 12px;
243
+ font-size: 0.875rem;
244
+ border: 1px solid var(--wu-border);
245
+ border-radius: var(--wu-radius);
246
+ background: var(--wu-bg);
247
+ color: var(--wu-text);
248
+ transition: border-color var(--wu-transition);
249
+ box-sizing: border-box;
250
+ font-family: inherit;
251
+ }
252
+ .wu-input:focus,
253
+ .wu-select:focus,
254
+ .wu-textarea:focus {
255
+ outline: none;
256
+ border-color: var(--wu-primary);
257
+ box-shadow: 0 0 0 3px var(--wu-primary-light);
258
+ }
259
+ .wu-label {
260
+ display: block;
261
+ font-size: 0.875rem;
262
+ font-weight: 500;
263
+ color: var(--wu-text);
264
+ margin-bottom: 4px;
265
+ }
266
+ .wu-error {
267
+ font-size: 0.75rem;
268
+ color: var(--wu-danger);
269
+ margin-top: 2px;
270
+ }
271
+
272
+ /* ═══════════════════════════════════════════════════════════════════
273
+ Card
274
+ ═══════════════════════════════════════════════════════════════════ */
275
+
276
+ .wu-card {
277
+ background: var(--wu-bg);
278
+ border: 1px solid var(--wu-border-light);
279
+ border-radius: var(--wu-radius-lg);
280
+ padding: 16px;
281
+ box-shadow: var(--wu-shadow);
282
+ }
283
+ .wu-card-header {
284
+ font-weight: 600;
285
+ font-size: 0.875rem;
286
+ margin-bottom: 8px;
287
+ padding-bottom: 8px;
288
+ border-bottom: 1px solid var(--wu-border-light);
289
+ }
290
+
291
+ /* ═══════════════════════════════════════════════════════════════════
292
+ Modal
293
+ ═══════════════════════════════════════════════════════════════════ */
294
+
295
+ [wu-modal] {
296
+ display: none;
297
+ position: fixed;
298
+ inset: 0;
299
+ z-index: 1000;
300
+ align-items: center;
301
+ justify-content: center;
302
+ background: rgba(0, 0, 0, 0.4);
303
+ }
304
+ [wu-modal].wu-open {
305
+ display: flex;
306
+ }
307
+ .wu-modal-content {
308
+ background: var(--wu-bg);
309
+ border-radius: var(--wu-radius-lg);
310
+ padding: 24px;
311
+ min-width: 320px;
312
+ max-width: 90vw;
313
+ max-height: 80vh;
314
+ overflow-y: auto;
315
+ box-shadow: var(--wu-shadow-lg);
316
+ }
317
+ .wu-modal-title {
318
+ font-size: 1.125rem;
319
+ font-weight: 600;
320
+ margin-bottom: 12px;
321
+ }
322
+
323
+ /* ═══════════════════════════════════════════════════════════════════
324
+ Collapse
325
+ ═══════════════════════════════════════════════════════════════════ */
326
+
327
+ [wu-collapse] {
328
+ border: 1px solid var(--wu-border-light);
329
+ border-radius: var(--wu-radius);
330
+ overflow: hidden;
331
+ }
332
+ [wu-collapse] > [wu-toggle] {
333
+ width: 100%;
334
+ padding: 10px 14px;
335
+ background: var(--wu-bg-secondary);
336
+ border: none;
337
+ font-size: 0.875rem;
338
+ font-weight: 500;
339
+ text-align: left;
340
+ cursor: pointer;
341
+ display: flex;
342
+ justify-content: space-between;
343
+ align-items: center;
344
+ color: var(--wu-text);
345
+ font-family: inherit;
346
+ }
347
+ [wu-collapse] > [wu-toggle]:hover {
348
+ background: var(--wu-bg-tertiary);
349
+ }
350
+ [wu-collapse] > [wu-toggle]::after {
351
+ content: '\25BE';
352
+ transition: transform var(--wu-transition);
353
+ }
354
+ [wu-collapse].wu-open > [wu-toggle]::after {
355
+ transform: rotate(180deg);
356
+ }
357
+ [wu-collapse] > [wu-body] {
358
+ display: none;
359
+ padding: 12px 14px;
360
+ font-size: 0.875rem;
361
+ }
362
+ [wu-collapse].wu-open > [wu-body] {
363
+ display: block;
364
+ }
365
+
366
+ /* ═══════════════════════════════════════════════════════════════════
367
+ Tabs
368
+ ═══════════════════════════════════════════════════════════════════ */
369
+
370
+ [wu-tabs] > nav {
371
+ display: flex;
372
+ border-bottom: 2px solid var(--wu-border-light);
373
+ margin-bottom: 12px;
374
+ gap: 0;
375
+ }
376
+ [wu-tabs] [wu-tab] {
377
+ padding: 8px 16px;
378
+ font-size: 0.875rem;
379
+ font-weight: 500;
380
+ border: none;
381
+ background: none;
382
+ color: var(--wu-text-secondary);
383
+ cursor: pointer;
384
+ border-bottom: 2px solid transparent;
385
+ margin-bottom: -2px;
386
+ transition: all var(--wu-transition);
387
+ font-family: inherit;
388
+ }
389
+ [wu-tabs] [wu-tab]:hover {
390
+ color: var(--wu-text);
391
+ }
392
+ [wu-tabs] [wu-tab].wu-active {
393
+ color: var(--wu-primary);
394
+ border-bottom-color: var(--wu-primary);
395
+ }
396
+ [wu-tabs] [wu-panel] {
397
+ display: none;
398
+ }
399
+ [wu-tabs] [wu-panel].wu-active {
400
+ display: block;
401
+ }
402
+
403
+ /* ═══════════════════════════════════════════════════════════════════
404
+ Dropdown
405
+ ═══════════════════════════════════════════════════════════════════ */
406
+
407
+ [wu-dropdown] {
408
+ position: relative;
409
+ display: inline-block;
410
+ }
411
+ [wu-dropdown] [wu-menu] {
412
+ display: none;
413
+ position: absolute;
414
+ top: 100%;
415
+ left: 0;
416
+ z-index: 500;
417
+ min-width: 160px;
418
+ background: var(--wu-bg);
419
+ border: 1px solid var(--wu-border-light);
420
+ border-radius: var(--wu-radius);
421
+ box-shadow: var(--wu-shadow-lg);
422
+ padding: 4px 0;
423
+ margin-top: 4px;
424
+ }
425
+ [wu-dropdown].wu-open [wu-menu] {
426
+ display: block;
427
+ }
428
+ [wu-dropdown] [wu-menu] a,
429
+ [wu-dropdown] [wu-menu] button {
430
+ display: block;
431
+ width: 100%;
432
+ padding: 8px 14px;
433
+ font-size: 0.875rem;
434
+ text-align: left;
435
+ border: none;
436
+ background: none;
437
+ color: var(--wu-text);
438
+ text-decoration: none;
439
+ cursor: pointer;
440
+ box-sizing: border-box;
441
+ font-family: inherit;
442
+ }
443
+ [wu-dropdown] [wu-menu] a:hover,
444
+ [wu-dropdown] [wu-menu] button:hover {
445
+ background: var(--wu-bg-secondary);
446
+ }
447
+ [wu-dropdown] [wu-menu] hr {
448
+ margin: 4px 0;
449
+ border: none;
450
+ border-top: 1px solid var(--wu-border-light);
451
+ }
452
+
453
+ /* ═══════════════════════════════════════════════════════════════════
454
+ Toast Notifications
455
+ ═══════════════════════════════════════════════════════════════════ */
456
+
457
+ .wu-toast-container {
458
+ position: fixed;
459
+ top: 16px;
460
+ right: 16px;
461
+ z-index: 2000;
462
+ display: flex;
463
+ flex-direction: column;
464
+ gap: 8px;
465
+ pointer-events: none;
466
+ }
467
+ .wu-toast {
468
+ padding: 12px 16px;
469
+ border-radius: var(--wu-radius);
470
+ font-size: 0.875rem;
471
+ color: #ffffff;
472
+ box-shadow: var(--wu-shadow-lg);
473
+ animation: wu-slide-in 200ms ease;
474
+ pointer-events: auto;
475
+ max-width: 360px;
476
+ }
477
+ .wu-toast-success {
478
+ background: var(--wu-success);
479
+ }
480
+ .wu-toast-error {
481
+ background: var(--wu-danger);
482
+ }
483
+ .wu-toast-info {
484
+ background: var(--wu-primary);
485
+ }
486
+ .wu-toast-warning {
487
+ background: var(--wu-warning);
488
+ color: #111827;
489
+ }
490
+ .wu-toast-leaving {
491
+ animation: wu-slide-out 200ms ease forwards;
492
+ }
493
+
494
+ @keyframes wu-slide-in {
495
+ from {
496
+ transform: translateX(100%);
497
+ opacity: 0;
498
+ }
499
+ to {
500
+ transform: translateX(0);
501
+ opacity: 1;
502
+ }
503
+ }
504
+ @keyframes wu-slide-out {
505
+ from {
506
+ transform: translateX(0);
507
+ opacity: 1;
508
+ }
509
+ to {
510
+ transform: translateX(100%);
511
+ opacity: 0;
512
+ }
513
+ }
514
+
515
+ /* ═══════════════════════════════════════════════════════════════════
516
+ Skeleton (Loading Placeholder)
517
+ ═══════════════════════════════════════════════════════════════════ */
518
+
519
+ .wu-skeleton {
520
+ background: linear-gradient(
521
+ 90deg,
522
+ var(--wu-bg-tertiary) 25%,
523
+ var(--wu-bg-secondary) 50%,
524
+ var(--wu-bg-tertiary) 75%
525
+ );
526
+ background-size: 200% 100%;
527
+ animation: wu-shimmer 1.5s infinite;
528
+ border-radius: var(--wu-radius);
529
+ }
530
+ @keyframes wu-shimmer {
531
+ 0% {
532
+ background-position: 200% 0;
533
+ }
534
+ 100% {
535
+ background-position: -200% 0;
536
+ }
537
+ }
538
+
539
+ /* ═══════════════════════════════════════════════════════════════════
540
+ Flash Messages
541
+ ═══════════════════════════════════════════════════════════════════ */
542
+
543
+ [wu-flash] {
544
+ padding: 0;
545
+ }
546
+ .wu-flash-msg {
547
+ padding: 10px 14px;
548
+ border-radius: var(--wu-radius);
549
+ font-size: 0.875rem;
550
+ margin-bottom: 8px;
551
+ animation: wu-slide-in 200ms ease;
552
+ }
553
+ .wu-flash-success {
554
+ background: var(--wu-success-light);
555
+ color: var(--wu-success);
556
+ border: 1px solid color-mix(in srgb, var(--wu-success) 30%, transparent);
557
+ }
558
+ .wu-flash-error {
559
+ background: var(--wu-danger-light);
560
+ color: var(--wu-danger);
561
+ border: 1px solid color-mix(in srgb, var(--wu-danger) 30%, transparent);
562
+ }
563
+ .wu-flash-info {
564
+ background: var(--wu-primary-light);
565
+ color: var(--wu-primary);
566
+ border: 1px solid color-mix(in srgb, var(--wu-primary) 30%, transparent);
567
+ }
568
+ .wu-flash-leaving {
569
+ animation: wu-slide-out 200ms ease forwards;
570
+ }
571
+
572
+ /* ═══════════════════════════════════════════════════════════════════
573
+ Utility Classes
574
+ ═══════════════════════════════════════════════════════════════════ */
575
+
576
+ .wu-hidden {
577
+ display: none !important;
578
+ }
579
+ .wu-block {
580
+ display: block;
581
+ }
582
+ .wu-w-full {
583
+ width: 100%;
584
+ }
585
+ .wu-w-half {
586
+ width: 50%;
587
+ }
588
+ .wu-p-2 {
589
+ padding: 8px;
590
+ }
591
+ .wu-p-3 {
592
+ padding: 12px;
593
+ }
594
+ .wu-p-4 {
595
+ padding: 16px;
596
+ }
597
+ .wu-px-4 {
598
+ padding-left: 16px;
599
+ padding-right: 16px;
600
+ }
601
+ .wu-py-2 {
602
+ padding-top: 8px;
603
+ padding-bottom: 8px;
604
+ }
605
+ .wu-py-3 {
606
+ padding-top: 12px;
607
+ padding-bottom: 12px;
608
+ }
609
+ .wu-mb-2 {
610
+ margin-bottom: 8px;
611
+ }
612
+ .wu-mb-4 {
613
+ margin-bottom: 16px;
614
+ }
615
+ .wu-mt-2 {
616
+ margin-top: 8px;
617
+ }
618
+ .wu-mt-4 {
619
+ margin-top: 16px;
620
+ }
621
+ .wu-ml-auto {
622
+ margin-left: auto;
623
+ }
624
+ .wu-rounded {
625
+ border-radius: var(--wu-radius);
626
+ }
627
+ .wu-border {
628
+ border: 1px solid var(--wu-border-light);
629
+ }
630
+ .wu-border-right {
631
+ border-right: 1px solid var(--wu-border-light);
632
+ }
633
+ .wu-border-bottom {
634
+ border-bottom: 1px solid var(--wu-border-light);
635
+ }
636
+ .wu-divider {
637
+ border: none;
638
+ border-top: 1px solid var(--wu-border-light);
639
+ margin: 12px 0;
640
+ }
641
+ .wu-overflow-auto {
642
+ overflow: auto;
643
+ }
644
+ .wu-relative {
645
+ position: relative;
646
+ }