zenkit-css 1.2.2 → 1.2.3

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,612 @@
1
+ // ========================================
2
+ // ZenKit - Sheet Component
3
+ // Half-screen modal / Bottom sheet
4
+ // ========================================
5
+
6
+ @use '../abstracts/variables' as *;
7
+
8
+ // ----------------------------------------
9
+ // Sheet Wrapper
10
+ // ----------------------------------------
11
+ .sheet-wrapper {
12
+ position: fixed;
13
+ inset: 0;
14
+ z-index: $z-modal;
15
+ display: none;
16
+ pointer-events: none;
17
+
18
+ &.is-open {
19
+ display: block;
20
+ pointer-events: auto;
21
+ }
22
+ }
23
+
24
+ // ----------------------------------------
25
+ // Sheet Overlay
26
+ // ----------------------------------------
27
+ .sheet-overlay {
28
+ position: absolute;
29
+ inset: 0;
30
+ background-color: rgba(0, 0, 0, 0.5);
31
+ opacity: 0;
32
+ transition: opacity $transition-base $transition-timing;
33
+
34
+ .is-open & {
35
+ opacity: 1;
36
+ }
37
+ }
38
+
39
+ // ----------------------------------------
40
+ // Sheet Content
41
+ // ----------------------------------------
42
+ .sheet-content {
43
+ position: absolute;
44
+ display: flex;
45
+ flex-direction: column;
46
+ background-color: var(--bg);
47
+ box-shadow: $shadow-xl;
48
+ transition: transform $transition-base $transition-timing;
49
+ overflow: hidden;
50
+ }
51
+
52
+ // ----------------------------------------
53
+ // Sheet Sides
54
+ // ----------------------------------------
55
+
56
+ // Bottom (Default - mobile-first)
57
+ .sheet-bottom {
58
+ .sheet-content {
59
+ bottom: 0;
60
+ left: 0;
61
+ right: 0;
62
+ max-height: 96vh;
63
+ border-radius: $border-radius-lg $border-radius-lg 0 0;
64
+ transform: translateY(100%);
65
+ }
66
+
67
+ &.is-open .sheet-content {
68
+ transform: translateY(0);
69
+ }
70
+ }
71
+
72
+ // Top
73
+ .sheet-top {
74
+ .sheet-content {
75
+ top: 0;
76
+ left: 0;
77
+ right: 0;
78
+ max-height: 96vh;
79
+ border-radius: 0 0 $border-radius-lg $border-radius-lg;
80
+ transform: translateY(-100%);
81
+ }
82
+
83
+ &.is-open .sheet-content {
84
+ transform: translateY(0);
85
+ }
86
+ }
87
+
88
+ // Left
89
+ .sheet-left {
90
+ .sheet-content {
91
+ top: 0;
92
+ left: 0;
93
+ bottom: 0;
94
+ width: 400px;
95
+ max-width: 100%;
96
+ border-radius: 0 $border-radius-lg $border-radius-lg 0;
97
+ transform: translateX(-100%);
98
+ }
99
+
100
+ &.is-open .sheet-content {
101
+ transform: translateX(0);
102
+ }
103
+ }
104
+
105
+ // Right
106
+ .sheet-right {
107
+ .sheet-content {
108
+ top: 0;
109
+ right: 0;
110
+ bottom: 0;
111
+ width: 400px;
112
+ max-width: 100%;
113
+ border-radius: $border-radius-lg 0 0 $border-radius-lg;
114
+ transform: translateX(100%);
115
+ }
116
+
117
+ &.is-open .sheet-content {
118
+ transform: translateX(0);
119
+ }
120
+ }
121
+
122
+ // ----------------------------------------
123
+ // Sheet Handle (Drag indicator)
124
+ // ----------------------------------------
125
+ .sheet-handle {
126
+ display: flex;
127
+ justify-content: center;
128
+ padding: 0.75rem;
129
+ cursor: grab;
130
+
131
+ &:active {
132
+ cursor: grabbing;
133
+ }
134
+ }
135
+
136
+ .sheet-handle-bar {
137
+ width: 48px;
138
+ height: 4px;
139
+ background-color: var(--gray-300);
140
+ border-radius: 2px;
141
+ transition: background-color $transition-fast $transition-timing;
142
+ }
143
+
144
+ .sheet-handle:hover .sheet-handle-bar {
145
+ background-color: var(--gray-400);
146
+ }
147
+
148
+ // ----------------------------------------
149
+ // Sheet Header
150
+ // ----------------------------------------
151
+ .sheet-header {
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: space-between;
155
+ padding: 1rem 1.5rem;
156
+ border-bottom: 1px solid var(--border);
157
+ flex-shrink: 0;
158
+ }
159
+
160
+ .sheet-header-compact {
161
+ padding: 0.75rem 1rem;
162
+ }
163
+
164
+ .sheet-title {
165
+ margin: 0;
166
+ font-size: var(--text-lg);
167
+ font-weight: $font-weight-semibold;
168
+ color: var(--text);
169
+ }
170
+
171
+ .sheet-description {
172
+ margin: 0.25rem 0 0;
173
+ font-size: var(--text-sm);
174
+ color: var(--text-muted);
175
+ }
176
+
177
+ .sheet-close {
178
+ display: flex;
179
+ align-items: center;
180
+ justify-content: center;
181
+ width: 2rem;
182
+ height: 2rem;
183
+ padding: 0;
184
+ color: var(--text-muted);
185
+ background: transparent;
186
+ border: none;
187
+ border-radius: $border-radius;
188
+ cursor: pointer;
189
+ transition: color $transition-fast $transition-timing,
190
+ background-color $transition-fast $transition-timing;
191
+
192
+ &:hover {
193
+ color: var(--text);
194
+ background-color: var(--gray-100);
195
+ }
196
+
197
+ svg {
198
+ width: 1.25rem;
199
+ height: 1.25rem;
200
+ }
201
+ }
202
+
203
+ // ----------------------------------------
204
+ // Sheet Body
205
+ // ----------------------------------------
206
+ .sheet-body {
207
+ flex: 1;
208
+ padding: 1.5rem;
209
+ overflow-y: auto;
210
+ -webkit-overflow-scrolling: touch;
211
+ }
212
+
213
+ .sheet-body-compact {
214
+ padding: 1rem;
215
+ }
216
+
217
+ .sheet-body-flush {
218
+ padding: 0;
219
+ }
220
+
221
+ // ----------------------------------------
222
+ // Sheet Footer
223
+ // ----------------------------------------
224
+ .sheet-footer {
225
+ display: flex;
226
+ align-items: center;
227
+ justify-content: flex-end;
228
+ gap: 0.75rem;
229
+ padding: 1rem 1.5rem;
230
+ border-top: 1px solid var(--border);
231
+ flex-shrink: 0;
232
+ }
233
+
234
+ .sheet-footer-compact {
235
+ padding: 0.75rem 1rem;
236
+ }
237
+
238
+ .sheet-footer-stacked {
239
+ flex-direction: column;
240
+
241
+ .btn {
242
+ width: 100%;
243
+ }
244
+ }
245
+
246
+ .sheet-footer-space-between {
247
+ justify-content: space-between;
248
+ }
249
+
250
+ // ----------------------------------------
251
+ // Sheet Sizes
252
+ // ----------------------------------------
253
+ .sheet-sm {
254
+ &.sheet-bottom .sheet-content,
255
+ &.sheet-top .sheet-content {
256
+ max-height: 40vh;
257
+ }
258
+
259
+ &.sheet-left .sheet-content,
260
+ &.sheet-right .sheet-content {
261
+ width: 320px;
262
+ }
263
+ }
264
+
265
+ .sheet-lg {
266
+ &.sheet-bottom .sheet-content,
267
+ &.sheet-top .sheet-content {
268
+ max-height: 80vh;
269
+ }
270
+
271
+ &.sheet-left .sheet-content,
272
+ &.sheet-right .sheet-content {
273
+ width: 560px;
274
+ }
275
+ }
276
+
277
+ .sheet-xl {
278
+ &.sheet-bottom .sheet-content,
279
+ &.sheet-top .sheet-content {
280
+ max-height: 90vh;
281
+ }
282
+
283
+ &.sheet-left .sheet-content,
284
+ &.sheet-right .sheet-content {
285
+ width: 720px;
286
+ }
287
+ }
288
+
289
+ .sheet-full {
290
+ &.sheet-bottom .sheet-content,
291
+ &.sheet-top .sheet-content {
292
+ max-height: 100vh;
293
+ border-radius: 0;
294
+ }
295
+
296
+ &.sheet-left .sheet-content,
297
+ &.sheet-right .sheet-content {
298
+ width: 100%;
299
+ border-radius: 0;
300
+ }
301
+ }
302
+
303
+ // ----------------------------------------
304
+ // Sheet Snap Points (for bottom sheet)
305
+ // ----------------------------------------
306
+ .sheet-snap-25 {
307
+ &.sheet-bottom .sheet-content {
308
+ height: 25vh;
309
+ }
310
+ }
311
+
312
+ .sheet-snap-50 {
313
+ &.sheet-bottom .sheet-content {
314
+ height: 50vh;
315
+ }
316
+ }
317
+
318
+ .sheet-snap-75 {
319
+ &.sheet-bottom .sheet-content {
320
+ height: 75vh;
321
+ }
322
+ }
323
+
324
+ .sheet-snap-100 {
325
+ &.sheet-bottom .sheet-content {
326
+ height: 100vh;
327
+ border-radius: 0;
328
+ }
329
+ }
330
+
331
+ // ----------------------------------------
332
+ // Sheet Menu (Action sheet)
333
+ // ----------------------------------------
334
+ .sheet-menu {
335
+ .sheet-body {
336
+ padding: 0.5rem 0;
337
+ }
338
+ }
339
+
340
+ .sheet-menu-item {
341
+ display: flex;
342
+ align-items: center;
343
+ gap: 0.75rem;
344
+ width: 100%;
345
+ padding: 0.875rem 1.5rem;
346
+ font-size: var(--text-base);
347
+ color: var(--text);
348
+ background: transparent;
349
+ border: none;
350
+ cursor: pointer;
351
+ text-align: left;
352
+ transition: background-color $transition-fast $transition-timing;
353
+
354
+ &:hover {
355
+ background-color: var(--gray-100);
356
+ }
357
+
358
+ &:active {
359
+ background-color: var(--gray-200);
360
+ }
361
+
362
+ svg {
363
+ width: 1.25rem;
364
+ height: 1.25rem;
365
+ color: var(--text-muted);
366
+ }
367
+ }
368
+
369
+ .sheet-menu-item-danger {
370
+ color: var(--danger);
371
+
372
+ svg {
373
+ color: var(--danger);
374
+ }
375
+
376
+ &:hover {
377
+ background-color: var(--danger-50);
378
+ }
379
+ }
380
+
381
+ .sheet-menu-divider {
382
+ height: 1px;
383
+ margin: 0.5rem 0;
384
+ background-color: var(--border);
385
+ }
386
+
387
+ .sheet-menu-header {
388
+ padding: 0.5rem 1.5rem;
389
+ font-size: var(--text-xs);
390
+ font-weight: $font-weight-medium;
391
+ color: var(--text-muted);
392
+ text-transform: uppercase;
393
+ letter-spacing: 0.05em;
394
+ }
395
+
396
+ // ----------------------------------------
397
+ // Sheet with Cancel Button (iOS style)
398
+ // ----------------------------------------
399
+ .sheet-with-cancel {
400
+ .sheet-body {
401
+ padding-bottom: 0.5rem;
402
+ }
403
+ }
404
+
405
+ .sheet-cancel {
406
+ margin: 0.5rem 1rem 1rem;
407
+ width: calc(100% - 2rem);
408
+ padding: 0.875rem;
409
+ font-size: var(--text-base);
410
+ font-weight: $font-weight-semibold;
411
+ color: var(--primary);
412
+ background-color: var(--gray-100);
413
+ border: none;
414
+ border-radius: $border-radius-lg;
415
+ cursor: pointer;
416
+ transition: background-color $transition-fast $transition-timing;
417
+
418
+ &:hover {
419
+ background-color: var(--gray-200);
420
+ }
421
+ }
422
+
423
+ // ----------------------------------------
424
+ // Sheet Scrollable
425
+ // ----------------------------------------
426
+ .sheet-scrollable {
427
+ .sheet-body {
428
+ overflow-y: auto;
429
+ overscroll-behavior: contain;
430
+ }
431
+ }
432
+
433
+ // ----------------------------------------
434
+ // Sheet No Overlay
435
+ // ----------------------------------------
436
+ .sheet-no-overlay {
437
+ .sheet-overlay {
438
+ display: none;
439
+ }
440
+ }
441
+
442
+ // ----------------------------------------
443
+ // Sheet Nested
444
+ // ----------------------------------------
445
+ .sheet-nested {
446
+ .sheet-content {
447
+ box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
448
+ }
449
+ }
450
+
451
+ // ----------------------------------------
452
+ // Sheet Animations
453
+ // ----------------------------------------
454
+ .sheet-animate-spring {
455
+ .sheet-content {
456
+ transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
457
+ }
458
+ }
459
+
460
+ .sheet-animate-bounce {
461
+ &.is-open .sheet-content {
462
+ animation: sheet-bounce 0.5s ease-out;
463
+ }
464
+ }
465
+
466
+ @keyframes sheet-bounce {
467
+ 0% {
468
+ transform: translateY(100%);
469
+ }
470
+ 60% {
471
+ transform: translateY(-8px);
472
+ }
473
+ 100% {
474
+ transform: translateY(0);
475
+ }
476
+ }
477
+
478
+ // ----------------------------------------
479
+ // Sheet Form
480
+ // ----------------------------------------
481
+ .sheet-form {
482
+ .sheet-body {
483
+ display: flex;
484
+ flex-direction: column;
485
+ gap: 1rem;
486
+ }
487
+ }
488
+
489
+ // ----------------------------------------
490
+ // Sheet Image Preview
491
+ // ----------------------------------------
492
+ .sheet-image-preview {
493
+ .sheet-body {
494
+ padding: 0;
495
+ display: flex;
496
+ align-items: center;
497
+ justify-content: center;
498
+ background-color: var(--gray-900);
499
+ }
500
+
501
+ .sheet-close {
502
+ position: absolute;
503
+ top: 0.75rem;
504
+ right: 0.75rem;
505
+ z-index: 1;
506
+ color: var(--white);
507
+ background-color: rgba(0, 0, 0, 0.5);
508
+
509
+ &:hover {
510
+ background-color: rgba(0, 0, 0, 0.7);
511
+ }
512
+ }
513
+
514
+ img {
515
+ max-width: 100%;
516
+ max-height: 100%;
517
+ object-fit: contain;
518
+ }
519
+ }
520
+
521
+ // ----------------------------------------
522
+ // Dark Mode
523
+ // ----------------------------------------
524
+ [data-theme="dark"] {
525
+ .sheet-content {
526
+ background-color: var(--gray-900);
527
+ border-color: var(--gray-700);
528
+ }
529
+
530
+ .sheet-handle-bar {
531
+ background-color: var(--gray-600);
532
+ }
533
+
534
+ .sheet-handle:hover .sheet-handle-bar {
535
+ background-color: var(--gray-500);
536
+ }
537
+
538
+ .sheet-header {
539
+ border-color: var(--gray-700);
540
+ }
541
+
542
+ .sheet-footer {
543
+ border-color: var(--gray-700);
544
+ }
545
+
546
+ .sheet-close:hover {
547
+ background-color: var(--gray-800);
548
+ }
549
+
550
+ .sheet-menu-item:hover {
551
+ background-color: var(--gray-800);
552
+ }
553
+
554
+ .sheet-menu-item:active {
555
+ background-color: var(--gray-700);
556
+ }
557
+
558
+ .sheet-menu-item-danger:hover {
559
+ background-color: rgba($danger, 0.15);
560
+ }
561
+
562
+ .sheet-menu-divider {
563
+ background-color: var(--gray-700);
564
+ }
565
+
566
+ .sheet-cancel {
567
+ background-color: var(--gray-800);
568
+
569
+ &:hover {
570
+ background-color: var(--gray-700);
571
+ }
572
+ }
573
+ }
574
+
575
+ // ----------------------------------------
576
+ // Responsive
577
+ // ----------------------------------------
578
+ @media (max-width: 767px) {
579
+ .sheet-left .sheet-content,
580
+ .sheet-right .sheet-content {
581
+ width: 100%;
582
+ border-radius: $border-radius-lg $border-radius-lg 0 0;
583
+ }
584
+
585
+ .sheet-left {
586
+ .sheet-content {
587
+ top: auto;
588
+ bottom: 0;
589
+ left: 0;
590
+ right: 0;
591
+ transform: translateY(100%);
592
+ }
593
+
594
+ &.is-open .sheet-content {
595
+ transform: translateY(0);
596
+ }
597
+ }
598
+
599
+ .sheet-right {
600
+ .sheet-content {
601
+ top: auto;
602
+ bottom: 0;
603
+ left: 0;
604
+ right: 0;
605
+ transform: translateY(100%);
606
+ }
607
+
608
+ &.is-open .sheet-content {
609
+ transform: translateY(0);
610
+ }
611
+ }
612
+ }