@sc-360-v2/storefront-cms-library 0.4.89 → 0.4.91

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,874 @@
1
+ /* ============================================
2
+ Upload Media Component - BEM Scoped Styles
3
+ Prefix: .sc-upload-media
4
+ ============================================ */
5
+
6
+ .sc-upload-media {
7
+ display: flex;
8
+ flex-direction: column;
9
+ font-family: inherit;
10
+ color: #344054;
11
+ padding: 16px 24px;
12
+ height: 538px;
13
+
14
+ *,
15
+ *::before,
16
+ *::after {
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ /* === Header === */
21
+ &__header {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ // padding: 16px 16px 0px 16px;
26
+ }
27
+
28
+ &__title {
29
+ font-size: 16px;
30
+ font-weight: 600;
31
+ color: var(--_gray-900);
32
+ margin: 0;
33
+ line-height: 24px;
34
+ }
35
+
36
+ &__close {
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ width: 32px;
41
+ height: 32px;
42
+ border: none;
43
+ background: none;
44
+ border-radius: 6px;
45
+ cursor: pointer;
46
+ padding: 0;
47
+ color: #667085;
48
+ transition: all 0.15s ease;
49
+
50
+ &:hover {
51
+ background: #f2f4f7;
52
+ color: #344054;
53
+ }
54
+
55
+ svg {
56
+ width: 20px;
57
+ height: 20px;
58
+ stroke: currentColor;
59
+ fill: none;
60
+ stroke-width: 2;
61
+ stroke-linecap: round;
62
+ stroke-linejoin: round;
63
+ }
64
+ }
65
+
66
+ /* === Tabs === */
67
+ &__tabs {
68
+ display: grid;
69
+ grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
70
+ gap: 12px;
71
+ padding: 16px 0px 0px 0px;
72
+ }
73
+
74
+ &__tab {
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ gap: 8px;
79
+ padding: 12px 16px;
80
+ border: 1px solid #e4e7ec;
81
+ border-radius: 6px;
82
+ background: #fff;
83
+ font-size: 14px;
84
+ font-weight: 600;
85
+ cursor: pointer;
86
+ transition: all 0.15s ease;
87
+ color: #344054;
88
+
89
+ &:hover:not(&--disabled) {
90
+ background: var(--_primary-25);
91
+ border-color: var(--_primary-400);
92
+ }
93
+
94
+ &--active {
95
+ border-color: var(--_primary-400);
96
+ background: var(--_primary-25);
97
+ color: var(--_primary-400);
98
+
99
+ .sc-upload-media__tab-icon svg {
100
+ stroke: var(--_primary-400);
101
+ }
102
+ }
103
+
104
+ &--disabled {
105
+ background: #f9fafb;
106
+ color: #98a2b3;
107
+ cursor: not-allowed;
108
+ pointer-events: none;
109
+ }
110
+ }
111
+
112
+ &__tab-icon {
113
+ display: flex;
114
+ align-items: center;
115
+
116
+ svg {
117
+ width: 20px;
118
+ height: 20px;
119
+ stroke: #667085;
120
+ fill: none;
121
+ stroke-width: 2;
122
+ stroke-linecap: round;
123
+ stroke-linejoin: round;
124
+ }
125
+ }
126
+
127
+ /* === Body === */
128
+ &__body {
129
+ height: 100%;
130
+ padding: 16px 0px 0px 0px;
131
+ }
132
+
133
+ /* === Footer === */
134
+ &__footer {
135
+ display: flex;
136
+ justify-content: flex-end;
137
+ gap: 12px;
138
+ padding: 8px 0;
139
+ // border-top: 1px solid #e4e7ec;
140
+ }
141
+
142
+ &__btn {
143
+ display: inline-flex;
144
+ align-items: center;
145
+ gap: 6px;
146
+ padding: 8px 16px;
147
+ border-radius: 6px;
148
+ font-size: 14px;
149
+ font-weight: 600;
150
+ cursor: pointer;
151
+ transition: all 0.15s ease;
152
+ border: 1px solid transparent;
153
+ line-height: 1.4;
154
+
155
+ &--cancel {
156
+ background: transparent;
157
+ color: var(--_gray-900);
158
+
159
+ &:hover {
160
+ background: #f9fafb;
161
+ }
162
+ }
163
+
164
+ &--primary {
165
+ background: #4a6cf7;
166
+ color: #fff;
167
+
168
+ &:hover:not(:disabled) {
169
+ background: #3b5de7;
170
+ }
171
+
172
+ &:disabled {
173
+ background: #b0c4ff;
174
+ cursor: not-allowed;
175
+ }
176
+ }
177
+ }
178
+
179
+ &__spinner {
180
+ width: 16px;
181
+ height: 16px;
182
+ border: 2px solid rgba(255, 255, 255, 0.3);
183
+ border-top-color: #fff;
184
+ border-radius: 50%;
185
+ animation: sc-upload-media-spin 0.6s linear infinite;
186
+ display: none;
187
+
188
+ &--visible {
189
+ display: inline-block;
190
+ }
191
+ }
192
+ }
193
+
194
+ /* === FromDevice === */
195
+ .sc-upload-media-device {
196
+ border: 1px solid #e4e7ec;
197
+ border-radius: 6px;
198
+ background: #fcfcfd;
199
+ padding: 16px;
200
+ height: 100%;
201
+ overflow-y: auto;
202
+ display: flex;
203
+
204
+ &__dropzone {
205
+ display: flex;
206
+ flex-direction: column;
207
+ align-items: center;
208
+ justify-content: center;
209
+ height: 100%;
210
+ cursor: pointer;
211
+ text-align: center;
212
+ color: var(--_gray-900);
213
+ gap: 8px;
214
+ border: 1px solid transparent;
215
+ border-radius: 6px;
216
+ transition: all 0.15s ease;
217
+ height: 80px;
218
+ padding: 40px;
219
+ margin: auto;
220
+ width: fit-content;
221
+ align-self: center;
222
+
223
+ &:hover,
224
+ &:focus {
225
+ border: 1px solid var(--_primary-300) !important;
226
+ outline: 2px solid var(--_primary-50);
227
+ background-color: var(--_primary-25);
228
+ }
229
+
230
+ &--dragover {
231
+ border-color: #4a6cf7;
232
+ background: #f0f4ff;
233
+ }
234
+ }
235
+
236
+ &__dropzone-icon {
237
+ display: flex;
238
+ align-items: center;
239
+
240
+ svg {
241
+ width: 24px;
242
+ height: 24px;
243
+ stroke: #667085;
244
+ fill: none;
245
+ stroke-width: 2;
246
+ stroke-linecap: round;
247
+ stroke-linejoin: round;
248
+ }
249
+ }
250
+
251
+ &__dropzone-text {
252
+ font-size: 14px;
253
+ font-weight: 500;
254
+ }
255
+
256
+ &__current-preview {
257
+ display: flex;
258
+ flex-direction: column;
259
+ align-items: center;
260
+ justify-content: center;
261
+ gap: 12px;
262
+ height: 100%;
263
+
264
+ img {
265
+ max-width: 200px;
266
+ max-height: 150px;
267
+ object-fit: contain;
268
+ border: 1px solid #e4e7ec;
269
+ border-radius: 4px;
270
+ padding: 8px;
271
+ background: #fff;
272
+ }
273
+ }
274
+
275
+ &__replace-text {
276
+ font-size: 14px;
277
+ color: #667085;
278
+ }
279
+
280
+ &__file-grid {
281
+ display: grid;
282
+ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
283
+ gap: 10px;
284
+ }
285
+
286
+ &__file-item {
287
+ position: relative;
288
+ border: 1px solid var(--_gray-200);
289
+ display: flex;
290
+ flex-direction: column;
291
+ align-items: center;
292
+ border-radius: 6px;
293
+ height: 170px;
294
+ &:hover {
295
+ border: 1px solid var(--_primary-200);
296
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2);
297
+ }
298
+ }
299
+
300
+ &__file-preview {
301
+ position: relative;
302
+ width: 100%;
303
+ height: 100%;
304
+ border-radius: 6px;
305
+ overflow: hidden;
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: center;
309
+
310
+ img {
311
+ max-width: 100%;
312
+ max-height: 100%;
313
+ object-fit: cover;
314
+ }
315
+
316
+ video {
317
+ max-width: 100%;
318
+ max-height: 100%;
319
+ object-fit: cover;
320
+ }
321
+
322
+ &:hover .sc-upload-media-device__file-remove {
323
+ opacity: 1;
324
+ }
325
+ }
326
+
327
+ &__file-remove {
328
+ position: absolute;
329
+ top: 4px;
330
+ right: 4px;
331
+ width: 22px;
332
+ height: 22px;
333
+ background: rgba(255, 255, 255, 0.9);
334
+ border-radius: 50%;
335
+ display: flex;
336
+ align-items: center;
337
+ justify-content: center;
338
+ cursor: pointer;
339
+ opacity: 0;
340
+ transition: opacity 0.2s ease;
341
+ border: none;
342
+ padding: 0;
343
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
344
+
345
+ svg {
346
+ width: 14px;
347
+ height: 14px;
348
+ stroke: #d92d20;
349
+ fill: none;
350
+ stroke-width: 2;
351
+ stroke-linecap: round;
352
+ stroke-linejoin: round;
353
+ }
354
+ }
355
+
356
+ &__file-name {
357
+ display: flex;
358
+ align-items: center;
359
+ gap: 6px;
360
+ // margin-top: 6px;
361
+ padding: 8px;
362
+ font-size: 12px;
363
+ color: var(--_gray-900);
364
+
365
+ span {
366
+ overflow: hidden;
367
+ text-overflow: ellipsis;
368
+ white-space: nowrap;
369
+ max-width: 90px;
370
+ }
371
+
372
+ svg {
373
+ width: 16px;
374
+ height: 16px;
375
+ stroke: #667085;
376
+ fill: none;
377
+ stroke-width: 2;
378
+ flex-shrink: 0;
379
+ }
380
+ }
381
+
382
+ /* Hidden file input */
383
+ &__input {
384
+ display: none;
385
+ }
386
+ }
387
+
388
+ /* === FromUrl === */
389
+ .sc-upload-media-url {
390
+ height: 300px;
391
+ display: flex;
392
+ flex-direction: column;
393
+ gap: 12px;
394
+
395
+ &__input-wrapper {
396
+ position: relative;
397
+ border: 1px solid var(--_gray-300);
398
+ border-radius: 6px;
399
+ transition:
400
+ background-color 0.2s,
401
+ color 0.2s,
402
+ border-color 0.2s,
403
+ box-shadow 0.2s;
404
+ &:focus-within {
405
+ border: 1px solid var(--_primary-300);
406
+ outline: 2px solid var(--_primary-50);
407
+ }
408
+ }
409
+
410
+ &__input {
411
+ width: 100%;
412
+ padding: 10px 36px;
413
+ // border: 1px solid #e4e7ec;
414
+ border-radius: 6px;
415
+ font-size: 14px;
416
+ color: #344054;
417
+ outline: none;
418
+ transition: border-color 0.15s ease;
419
+
420
+ &:focus {
421
+ border-color: #4a6cf7;
422
+ box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
423
+ }
424
+
425
+ &--invalid {
426
+ border-color: #d92d20;
427
+
428
+ &:focus {
429
+ box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
430
+ }
431
+ }
432
+
433
+ &:disabled {
434
+ background: #f9fafb;
435
+ color: #98a2b3;
436
+ }
437
+ }
438
+
439
+ &__input-icon {
440
+ position: absolute;
441
+ left: 10px;
442
+ top: 50%;
443
+ transform: translateY(-50%);
444
+ display: flex;
445
+ cursor: pointer;
446
+
447
+ svg {
448
+ width: 16px;
449
+ height: 16px;
450
+ stroke: #667085;
451
+ fill: none;
452
+ stroke-width: 2;
453
+ }
454
+ }
455
+
456
+ &__input-clear {
457
+ position: absolute;
458
+ right: 10px;
459
+ top: 50%;
460
+ transform: translateY(-50%);
461
+ display: flex;
462
+ cursor: pointer;
463
+ background: none;
464
+ border: none;
465
+ padding: 0;
466
+
467
+ svg {
468
+ width: 14px;
469
+ height: 14px;
470
+ stroke: #667085;
471
+ fill: none;
472
+ stroke-width: 2;
473
+ }
474
+ }
475
+
476
+ &__error {
477
+ font-size: 12px;
478
+ color: #d92d20;
479
+ margin-top: 4px;
480
+ }
481
+
482
+ &__preview {
483
+ flex: 1;
484
+ display: flex;
485
+ flex-direction: column;
486
+ align-items: center;
487
+ justify-content: center;
488
+ border: 1px solid #e4e7ec;
489
+ border-radius: 6px;
490
+ background: #fcfcfd;
491
+ overflow-y: auto;
492
+ min-height: 0;
493
+
494
+ img {
495
+ max-width: 100%;
496
+ max-height: 200px;
497
+ object-fit: contain;
498
+ }
499
+ }
500
+
501
+ &__preview-empty {
502
+ display: flex;
503
+ flex-direction: column;
504
+ align-items: center;
505
+ justify-content: center;
506
+ gap: 8px;
507
+ color: #667085;
508
+ font-size: 14px;
509
+ font-weight: 500;
510
+ height: 100%;
511
+
512
+ svg {
513
+ width: 24px;
514
+ height: 24px;
515
+ stroke: #667085;
516
+ fill: none;
517
+ stroke-width: 2;
518
+ }
519
+ }
520
+
521
+ &__macro-display {
522
+ display: flex;
523
+ flex-direction: column;
524
+ align-items: center;
525
+ justify-content: center;
526
+ gap: 8px;
527
+ font-size: 14px;
528
+ height: 100%;
529
+ text-align: center;
530
+ padding: 16px;
531
+
532
+ strong {
533
+ color: #4a6cf7;
534
+ word-break: break-all;
535
+ }
536
+ }
537
+ }
538
+
539
+ /* === MyAssets === */
540
+ .sc-upload-media-assets {
541
+ display: flex;
542
+ flex-direction: column;
543
+ gap: 12px;
544
+ height: 100%;
545
+
546
+ &__search {
547
+ width: 100%;
548
+ padding: 10px 12px;
549
+ border: 1px solid var(--_gray-300) !important;
550
+ border-radius: 6px;
551
+ font-size: 14px;
552
+ color: var(--_gray-900);
553
+ outline: none;
554
+ transition:
555
+ background-color 0.2s,
556
+ color 0.2s,
557
+ border-color 0.2s,
558
+ box-shadow 0.2s;
559
+
560
+ &:focus {
561
+ border: 1px solid var(--_primary-300) !important;
562
+ outline: 2px solid var(--_primary-50);
563
+ }
564
+ }
565
+
566
+ &__breadcrumb {
567
+ display: flex;
568
+ align-items: center;
569
+ gap: 4px;
570
+ font-size: 13px;
571
+ color: #667085;
572
+ }
573
+
574
+ &__breadcrumb-back {
575
+ display: flex;
576
+ align-items: center;
577
+ cursor: pointer;
578
+ background: none;
579
+ border: none;
580
+ padding: 2px;
581
+ color: #667085;
582
+
583
+ svg {
584
+ width: 16px;
585
+ height: 16px;
586
+ stroke: currentColor;
587
+ fill: none;
588
+ stroke-width: 2;
589
+ }
590
+
591
+ &:hover {
592
+ color: #344054;
593
+ }
594
+ }
595
+
596
+ &__breadcrumb-item {
597
+ cursor: pointer;
598
+ color: var(--_gray-600);
599
+
600
+ &:hover:not(&--active) {
601
+ color: var(--_gray-900);
602
+ }
603
+
604
+ &--active {
605
+ font-weight: 400;
606
+ color: var(--_gray-900);
607
+ cursor: default !important;
608
+ }
609
+ }
610
+
611
+ &__breadcrumb-sep {
612
+ color: var(--_gray-600);
613
+ }
614
+
615
+ &__grid {
616
+ display: grid;
617
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
618
+ gap: 16px;
619
+ border: 1px solid #e4e7ec;
620
+ border-radius: 6px;
621
+ background: #fcfcfd;
622
+ padding: 16px;
623
+ height: 260px;
624
+ overflow-y: auto;
625
+ }
626
+
627
+ /* Folder card */
628
+ &__folder {
629
+ display: flex;
630
+ flex-direction: column;
631
+ border: 1px solid #e4e7ec;
632
+ border-radius: 6px;
633
+ cursor: pointer;
634
+ overflow: hidden;
635
+ transition: border-color 0.15s ease;
636
+ height: min-content;
637
+
638
+ // &:hover {
639
+ // border-color: #4a6cf7;
640
+ // }
641
+ }
642
+
643
+ &__folder-icon {
644
+ display: flex;
645
+ align-items: center;
646
+ justify-content: center;
647
+ height: 128px;
648
+ background: #fff;
649
+
650
+ svg {
651
+ width: 48px;
652
+ height: 48px;
653
+ stroke: #d0d5dd;
654
+ fill: none;
655
+ stroke-width: 1.5;
656
+ }
657
+ }
658
+
659
+ &__folder-label {
660
+ display: flex;
661
+ align-items: center;
662
+ justify-content: space-between;
663
+ gap: 8px;
664
+ padding: 12px;
665
+ border-top: 1px solid #e4e7ec;
666
+ font-size: 13px;
667
+ color: var(--_gray-900);
668
+
669
+ span {
670
+ overflow: hidden;
671
+ text-overflow: ellipsis;
672
+ white-space: nowrap;
673
+ }
674
+
675
+ input[type="radio"] {
676
+ width: 16px;
677
+ height: 16px;
678
+ accent-color: var(--_primary-400);
679
+ cursor: pointer;
680
+ flex-shrink: 0;
681
+ }
682
+
683
+ &:hover {
684
+ background: #f9fafb;
685
+ }
686
+ }
687
+
688
+ /* Image card */
689
+ &__image-card {
690
+ display: flex;
691
+ flex-direction: column;
692
+ align-items: center;
693
+ border: 1px solid #e4e7ec;
694
+ border-radius: 6px;
695
+ height: 170px;
696
+ cursor: pointer;
697
+ overflow: hidden;
698
+ transition: border-color 0.15s ease;
699
+ height: 170px;
700
+ width: 100%;
701
+ .sc-upload-media-assets__img-cntainer {
702
+ height: 130px;
703
+ width: 100%;
704
+ display: flex;
705
+ justify-content: center;
706
+ align-items: center;
707
+ overflow: hidden;
708
+ &__image-thumb {
709
+ max-width: 100%;
710
+ max-height: 128px;
711
+
712
+ object-fit: contain;
713
+ }
714
+ &__image-placeholder {
715
+ width: 100%;
716
+ height: 128px;
717
+ display: flex;
718
+ align-items: center;
719
+ justify-content: center;
720
+ background: #f5f5f5;
721
+
722
+ svg {
723
+ width: 32px;
724
+ height: 32px;
725
+ stroke: #d0d5dd;
726
+ fill: none;
727
+ stroke-width: 1.5;
728
+ }
729
+ }
730
+ }
731
+
732
+ &--selected {
733
+ border-color: var(--_primary-400);
734
+ border-width: 1px;
735
+ }
736
+ }
737
+
738
+ &__file__name-checkbox {
739
+ padding: 8px;
740
+ display: flex;
741
+ align-items: center;
742
+ flex-grow: 1;
743
+ width: 100%;
744
+ border-top: 1px solid var(--_gray-200);
745
+ justify-content: space-between;
746
+ span {
747
+ white-space: nowrap;
748
+ overflow: hidden;
749
+ text-overflow: ellipsis;
750
+ width: 115px;
751
+ line-height: 22px;
752
+ text-align: left;
753
+ }
754
+
755
+ input[type="checkbox"] {
756
+ -webkit-appearance: none;
757
+ -moz-appearance: none;
758
+ appearance: none;
759
+ width: 18px;
760
+ height: 18px;
761
+ border: 1px solid var(--_gray-300);
762
+ border-radius: 50%;
763
+ cursor: pointer;
764
+ position: relative;
765
+ margin: 0;
766
+ transition: all 0.15s ease;
767
+
768
+ &:checked {
769
+ border-color: var(--_primary-400);
770
+ background: var(--_primary-400);
771
+
772
+ &::after {
773
+ content: "";
774
+ position: absolute;
775
+ top: 45%;
776
+ left: 50%;
777
+ transform: translate(-50%, -60%) rotate(45deg);
778
+ width: 4px;
779
+ height: 9px;
780
+ border: solid #fff;
781
+ border-width: 0 1.5px 1.5px 0;
782
+ }
783
+ }
784
+
785
+ &:hover {
786
+ border-color: var(--_primary-400);
787
+ }
788
+ }
789
+ }
790
+
791
+ /* Empty state */
792
+ &__empty {
793
+ display: flex;
794
+ flex-direction: column;
795
+ align-items: center;
796
+ justify-content: center;
797
+ height: 100%;
798
+ color: #98a2b3;
799
+ font-size: 14px;
800
+ grid-column: 1 / -1;
801
+ color: var(--_gray-600);
802
+ }
803
+
804
+ /* Loading skeleton */
805
+ &__skeleton {
806
+ border-radius: 6px;
807
+ height: 120px;
808
+ background: linear-gradient(90deg, #f2f4f7 25%, #e4e7ec 50%, #f2f4f7 75%);
809
+ background-size: 200% 100%;
810
+ animation: sc-upload-media-shimmer 1.5s ease-in-out infinite;
811
+ }
812
+ }
813
+
814
+ /* === Animations === */
815
+ @keyframes sc-upload-media-spin {
816
+ to {
817
+ transform: rotate(360deg);
818
+ }
819
+ }
820
+
821
+ @keyframes sc-upload-media-shimmer {
822
+ 0% {
823
+ background-position: 200% 0;
824
+ }
825
+ 100% {
826
+ background-position: -200% 0;
827
+ }
828
+ }
829
+
830
+ /* === Upload Media Modal z-index override === */
831
+ .cfrm__modal--upload-media {
832
+ .cfrm__modal__backdrop {
833
+ z-index: 99999 !important;
834
+ }
835
+
836
+ .cfrm__modal__container {
837
+ z-index: 100000 !important;
838
+ }
839
+
840
+ .cfrm__modal__body {
841
+ .sc-upload-media {
842
+ .sc-upload-media__tabs {
843
+ padding: 8px 0px 0px 0px;
844
+ }
845
+ .sc-upload-media__footer {
846
+ padding: 12px 0px 16px 0px;
847
+ }
848
+ }
849
+ }
850
+
851
+ .sc-upload-media__header {
852
+ display: none;
853
+ }
854
+ }
855
+
856
+ /* === sccoreui Dialog override for upload media === */
857
+ .upload-media-dialog {
858
+ z-index: 100000 !important;
859
+ border-radius: 12px !important;
860
+ overflow: hidden !important;
861
+
862
+ .p-dialog-header {
863
+ display: none !important;
864
+ }
865
+
866
+ .p-dialog-content {
867
+ padding: 0 !important;
868
+ border-radius: 12px !important;
869
+ }
870
+ }
871
+
872
+ .upload-media-dialog + .p-dialog-mask {
873
+ z-index: 99999 !important;
874
+ }