-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
index.js
3563 lines (3555 loc) · 185 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { classNames } from '../../utils/Utils';
export const TRANSITIONS = {
toggleable: {
timeout: 500,
classNames: {
enter: 'max-h-0',
enterActive: '!max-h-[1000px] overflow-hidden transition-[max-height] duration-500 ease-in',
exit: 'max-h-[1000px]',
exitActive: '!max-h-0 overflow-hidden transition-[max-height] duration-500 ease-out'
}
},
overlay: {
timeout: 150,
classNames: {
enter: 'opacity-0 scale-75',
enterActive: 'opacity-100 !scale-100 transition-transform transition-opacity duration-150 ease-in',
exit: 'opacity-100',
exitActive: '!opacity-0 transition-opacity duration-150 ease-linear'
}
}
};
const Tailwind = {
global: {
css: `
*[data-pd-ripple="true"]{
overflow: hidden;
position: relative;
}
span[data-p-ink-active="true"]{
animation: ripple 0.4s linear;
}
@keyframes ripple {
100% {
opacity: 0;
transform: scale(2.5);
}
}
.progress-spinner-circle {
stroke-dasharray: 89, 200;
stroke-dashoffset: 0;
animation: p-progress-spinner-dash 1.5s ease-in-out infinite, p-progress-spinner-color 6s ease-in-out infinite;
stroke-linecap: round;
}
@keyframes p-progress-spinner-dash{
0% {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -35px;
}
100% {
stroke-dasharray: 89, 200;
stroke-dashoffset: -124px;
}
}
@keyframes p-progress-spinner-color {
100%, 0% {
stroke: #ff5757;
}
40% {
stroke: #696cff;
}
66% {
stroke: #1ea97c;
}
80%, 90% {
stroke: #cc8925;
}
}
.progressbar-value-animate::after {
will-change: left, right;
animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}
.progressbar-value-animate::before {
will-change: left, right;
animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}
@keyframes p-progressbar-indeterminate-anim {
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
}
`
},
//PANELS
panel: {
header: ({ props }) => ({
className: classNames(
'flex items-center justify-between', // flex and alignments
'border border-gray-300 bg-gray-100 text-gray-700 rounded-tl-lg rounded-tr-lg', // borders and colors
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80', // Dark mode
{ 'p-5': !props.toggleable, 'py-3 px-5': props.toggleable } // condition
)
}),
title: 'leading-none font-bold',
toggler: {
className: classNames(
'inline-flex items-center justify-center overflow-hidden relative no-underline', // alignments
'w-8 h-8 text-gray-600 border-0 bg-transparent rounded-full transition duration-200 ease-in-out', // widths, borders, and transitions
'hover:text-gray-900 hover:border-transparent hover:bg-gray-200 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]', // hover
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]' // focus
)
},
togglerIcon: 'inline-block',
content: {
className: classNames(
'p-5 border border-gray-300 bg-white text-gray-700 border-t-0 last:rounded-br-lg last:rounded-bl-lg',
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
)
},
transition: TRANSITIONS.toggleable
},
accordion: {
root: 'mb-1',
accordiontab: {
root: 'mb-1',
header: ({ context }) => {
return {
className: classNames(
{ 'select-none pointer-events-none cursor-default opacity-60': context.disabled } // Condition
)
};
},
headerAction: ({ context }) => ({
className: classNames(
'flex items-center cursor-pointer relative no-underline select-none', // Alignments
'p-5 transition duration-200 ease-in-out rounded-t-md font-bold transition-shadow duration-200', // Padding and transition
'border border-gray-300 bg-gray-100 text-gray-600', // Borders and colors
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]', // Dark mode
'hover:border-gray-300 hover:bg-gray-200 hover:text-gray-800', // Hover
'focus:outline-none focus:outline-offset-0 focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)]', // Focus
{ 'rounded-br-md rounded-bl-md': !context.selected, 'rounded-br-0 rounded-bl-0 text-gray-800': context.selected } // Condition
)
}),
headerIcon: 'inline-block mr-2',
headerTitle: 'leading-none',
content: {
className: classNames(
'p-5 border border-gray-300 bg-white text-gray-700 border-t-0 rounded-tl-none rounded-tr-none rounded-br-lg rounded-bl-lg',
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
)
},
transition: TRANSITIONS.toggleable
}
},
card: {
root: {
className: classNames(
'bg-white text-gray-700 shadow-md rounded-md', // Background, text color, box shadow, and border radius.
'dark:bg-gray-900 dark:text-white ' //dark
)
},
body: 'p-5', // Padding.
title: 'text-2xl font-bold mb-2', // Font size, font weight, and margin bottom.
subTitle: {
className: classNames(
'font-normal mb-2 text-gray-600', // Font weight, margin bottom, and text color.
'dark:text-white/60 ' //dark
)
},
content: 'py-5', // Vertical padding.
footer: 'pt-5' // Top padding.
},
divider: {
root: ({ props }) => ({
className: classNames(
'flex relative', // alignments.
{
'w-full my-5 mx-0 py-0 px-5 before:block before:left-0 before:absolute before:top-1/2 before:w-full before:border-t before:border-gray-300 before:dark:border-blue-900/40': props.layout == 'horizontal', // Padding and borders for horizontal layout.
'min-h-full mx-4 md:mx-5 py-5 before:block before:min-h-full before:absolute before:left-1/2 before:top-0 before:transform before:-translate-x-1/2 before:border-l before:border-gray-300 before:dark:border-blue-900/40':
props.layout == 'vertical' // Padding and borders for vertical layout.
},
{
'before:border-solid': props.type == 'solid',
'before:border-dotted': props.type == 'dotted',
'before:border-dashed': props.type == 'dashed'
} // Border type condition.
)
}),
content: 'px-1 bg-white z-10 dark:bg-gray-900' // Padding and background color.
},
fieldset: {
root: {
className: classNames(
'border border-gray-300 bg-white text-gray-700 rounded-md block mx-2 my-0.5 pl-4 pr-5 inline-size-min', // Borders, background, text color, spacing, and inline size.
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' //dark
)
},
legend: ({ props }) => ({
className: classNames(
'border border-gray-300 text-gray-700 bg-gray-50 font-bold rounded-md',
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ', //dark
{
'p-0 transition-none hover:bg-gray-100 hover:border-gray-300 hover:text-gray-900 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]': props.toggleable,
'p-5': !props.toggleable
}
)
}),
toggler: ({ props }) => ({
className: classNames('flex items-center justify-center', {
'p-5 text-gray-700 rounded-md transition-none cursor-pointer overflow-hidden relative select-none hover:text-gray-900 focus:focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)] dark:text-white/80 dark:hover:text-white/80 dark:hover:bg-gray-800/60 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]':
props.toggleable
})
}),
togglerIcon: 'mr-2 inline-block', // Margin and display style.
legendTitle: 'flex items-center justify-center leading-none', // alignments, and leading style.
content: 'p-5', // Padding.
transition: TRANSITIONS.toggleable
},
scrollpanel: {
wrapper: 'overflow-hidden relative float-left h-full w-full z-[1]',
content: 'box-border h-[calc(100%+18px)] overflow-scroll pr-[18px] pb-[18px] pl-0 pt-0 relative scrollbar-none w-[calc(100%+18px)] [&::-webkit-scrollbar]:hidden',
barX: {
className: classNames('relative bg-gray-100 invisible rounded cursor-pointer h-[9px] bottom-0 z-[2]', 'transition duration-[250ms] ease-linear')
},
barY: {
className: classNames('relative bg-gray-100 rounded cursor-pointer w-[9px] top-0 z-[2]', 'transition duration-[250ms] ease-linear')
}
},
tabview: {
navContainer: ({ props }) => ({
className: classNames(
'relative', // Relative positioning.
{ 'overflow-hidden': props.scrollable } // Overflow condition.
)
}),
navContent: 'overflow-y-hidden overscroll-contain overscroll-auto scroll-smooth [&::-webkit-scrollbar]:hidden', // Overflow and scrollbar styles.
previousButton: {
className: classNames('h-full flex items-center justify-center !absolute top-0 z-20', 'left-0', 'bg-white text-blue-500 w-12 shadow-md rounded-none', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 )') // Flex and absolute positioning styles.
},
nextButton: {
className: classNames('h-full flex items-center justify-center !absolute top-0 z-20', 'right-0', 'bg-white text-blue-500 w-12 shadow-md rounded-none', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ') // Flex and absolute positioning styles.
},
nav: {
className: classNames('flex flex-1 list-none m-0 p-0', 'bg-transparent border border-gray-300 border-0 border-b-2', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ') // Flex, list, margin, padding, and border styles.
}
},
tabpanel: {
header: ({ props }) => ({
className: classNames('mr-0', { 'cursor-default pointer-events-none select-none user-select-none opacity-60': props?.disabled }) // Margin and condition-based styles.
}),
headerAction: ({ parent, context }) => ({
className: classNames(
'items-center cursor-pointer flex overflow-hidden relative select-none text-decoration-none user-select-none', // Flex and overflow styles.
'border-b-2 p-5 font-bold rounded-t-md transition-shadow duration-200 m-0', // Border, padding, font, and transition styles.
'transition-colors duration-200', // Transition duration style.
'focus:outline-none focus:outline-offset-0 focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]', // Focus styles.
{
'border-gray-300 bg-white text-gray-700 hover:bg-white hover:border-gray-400 hover:text-gray-600 dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 dark:hover:bg-gray-800/80':
parent != null ? parent.state.activeIndex !== context.index : true, // Condition-based hover styles.
'bg-white border-blue-500 text-blue-500 dark:bg-gray-900 dark:border-blue-300 dark:text-blue-300': parent != null ? parent.state.activeIndex === context.index : false // Condition-based active styles.
}
),
style: { marginBottom: '-2px' } // Negative margin style.
}),
headerTitle: {
className: classNames('leading-none whitespace-nowrap') // Leading and whitespace styles.
},
content: {
className: classNames('bg-white p-5 border-0 text-gray-700 rounded-bl-md rounded-br-md', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80') // Background, padding, border, and text styles.
}
},
splitter: {
root: ({ props, state }) => ({
className: classNames('flex flex-nowrap bg-white dark:bg-gray-900 rounded-lg text-gray-700 dark:text-white/80', {
'border border-solid border-gray-300 dark:border-blue-900/40': !state.nested,
'flex-col': props.layout === 'vertical'
})
}),
gutter: ({ props }) => ({
className: classNames('flex items-center justify-center shrink-0', 'transition-all duration-200 bg-gray-100 dark:bg-gray-800', {
'cursor-col-resize': props.layout == 'horizontal',
'cursor-row-resize': props.layout !== 'horizontal'
})
}),
gutterHandler: ({ props }) => ({
className: classNames('bg-gray-300 dark:bg-gray-600 transition-all duration-200', {
'h-7 w-[0.3rem]': props.layout == 'horizontal',
'w-7 h-[0.3rem]': props.layout == 'vertical'
})
})
},
dialog: {
root: ({ state }) => ({
className: classNames('rounded-lg shadow-lg border-0', 'max-h-[90%] transform scale-100', 'm-0 w-[50vw]', 'dark:border dark:border-blue-900/40', {
'transition-none transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': state.maximized
})
}),
header: {
className: classNames('flex items-center justify-between shrink-0', 'bg-white text-gray-800 border-t-0 rounded-tl-lg rounded-tr-lg p-6', 'dark:bg-gray-900 dark:text-white/80')
},
headerTitle: 'font-bold text-lg',
headerIcons: 'flex items-center',
closeButton: {
className: classNames(
'flex items-center justify-center overflow-hidden relative',
'w-8 h-8 text-gray-500 border-0 bg-transparent rounded-full transition duration-200 ease-in-out mr-2 last:mr-0',
'hover:text-gray-700 hover:border-transparent hover:bg-gray-200',
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]', // focus
'dark:hover:text-white/80 dark:hover:border-transparent dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]'
)
},
closeButtonIcon: 'w-4 h-4 inline-block',
content: ({ props, state }) => ({
className: classNames('overflow-y-auto', 'bg-white text-gray-700 px-6 pb-8 pt-0', { 'rounded-bl-lg rounded-br-lg': !props.footer }, 'dark:bg-gray-900 dark:text-white/80 ', {
grow: state.maximized
})
}),
footer: {
className: classNames('flex gap-2 shrink-0 justify-end align-center', 'border-t-0 bg-white text-gray-700 px-6 pb-6 text-right rounded-b-lg', 'dark:bg-gray-900 dark:text-white/80')
},
mask: ({ state }) => ({
className: classNames('transition duration-200', { 'bg-black/40': state.containerVisible })
}),
transition: ({ props }) => {
return {
timeout: 200,
classNames:
props.position === 'top'
? {
enter: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-y-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-0 -translate-y-full translate-z-0'
}
: props.position === 'bottom'
? {
enter: 'opacity-0 scale-75 translate-y-full',
enterActive: '!opacity-100 !scale-100 !translate-y-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-0 translate-y-full translate-z-0'
}
: props.position === 'left' || props.position === 'top-left' || props.position === 'bottom-left'
? {
enter: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-x-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 -translate-x-full translate-y-0 translate-z-0'
}
: props.position === 'right' || props.position === 'top-right' || props.position === 'bottom-right'
? {
enter: 'opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-x-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-full translate-y-0 translate-z-0'
}
: {
enter: 'opacity-0 scale-75',
enterActive: '!opacity-100 !scale-100 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75'
}
};
}
},
confirmdialog: {
root: {
className: classNames(
'bg-white text-gray-700 border-0 rounded-md shadow-lg',
'z-40 transform origin-center',
'mt-3 absolute left-0 top-0',
'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900',
'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80'
)
},
content: 'p-5 items-center flex',
icon: 'text-2xl',
message: 'ml-4',
footer: 'flex gap-2 justify-end align-center text-right px-5 py-5 pt-0',
transition: TRANSITIONS.overlay
},
confirmpopup: {
root: {
className: classNames(
'bg-white text-gray-700 border-0 rounded-md shadow-lg',
'z-40 transform origin-center',
'mt-3 absolute left-0 top-0',
'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900',
'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80'
)
},
content: 'p-5 items-center flex',
icon: 'text-2xl',
message: 'ml-4',
footer: 'flex gap-2 justify-end align-center text-right px-5 py-5 pt-0',
transition: TRANSITIONS.overlay
},
overlaypanel: {
root: {
className: classNames(
'bg-white text-gray-700 border-0 rounded-md shadow-lg',
'z-40 transform origin-center',
'absolute left-0 top-0 mt-3',
'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900',
'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80'
)
},
closeButton: 'flex items-center justify-center overflow-hidden absolute top-0 right-0 w-6 h-6',
content: 'p-5 items-center flex',
transition: TRANSITIONS.overlay
},
sidebar: {
root: ({ props }) => ({
className: classNames(
'flex flex-col pointer-events-auto relative transform relative',
'bg-white text-gray-700 border-0 shadow-lg',
{
'!transition-none !transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': props.fullScreen,
'h-full w-80': props.position == 'left' || props.position == 'right',
'h-40 w-full': props.position == 'top' || props.position == 'bottom'
},
'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80'
)
}),
header: {
className: classNames('flex items-center justify-end', 'p-5')
},
closeButton: {
className: classNames(
'flex items-center justify-center overflow-hidden relative',
'w-8 h-8 text-gray-500 border-0 bg-transparent rounded-full transition duration-200 ease-in-out mr-2 last:mr-0',
'hover:text-gray-700 hover:border-transparent hover:bg-gray-200',
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]', // focus
'dark:hover:text-white/80 dark:hover:text-white/80 dark:hover:border-transparent dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]'
)
},
closeButtonIcon: 'w-4 h-4 inline-block',
content: {
className: classNames('p-5 pt-0 h-full w-full', 'grow overflow-y-auto')
},
mask: {
className: classNames('flex pointer-events-auto', 'bg-black bg-opacity-40 transition duration-200 z-20 transition-colors')
},
transition: ({ props }) => {
return {
timeout: 300,
classNames: props.fullScreen
? {
enter: 'opacity-0',
enterActive: '!opacity-100 transition-opacity duration-300 ease-in',
exit: 'opacity-100 transition-opacity duration-300 ease-in',
exitActive: '!opacity-0'
}
: props.position === 'top'
? {
enter: 'translate-x-0 -translate-y-full translate-z-0',
enterActive: '!translate-y-0 transition-transform duration-300',
exit: 'translate-y-0 transition-transform duration-300',
exitActive: 'translate-x-0 !-translate-y-full translate-z-0'
}
: props.position === 'bottom'
? {
enter: 'translate-x-0 translate-y-full translate-z-0',
enterActive: '!translate-y-0 transition-transform duration-300',
exit: 'translate-y-0 transition-transform duration-300',
exitActive: 'translate-x-0 !translate-y-full translate-z-0'
}
: props.position === 'left'
? {
enter: '-translate-x-full translate-y-0 translate-z-0',
enterActive: '!translate-x-0 transition-transform duration-300',
exit: 'translate-x-0 transition-transform duration-300',
exitActive: '!-translate-x-full translate-y-0 translate-z-0'
}
: props.position === 'right'
? {
enter: 'translate-x-full translate-y-0 translate-z-0',
enterActive: '!translate-x-0 transition-transform duration-300',
exit: 'translate-x-0 transition-transform duration-300',
exitActive: '!translate-x-full translate-y-0 translate-z-0'
}
: undefined
};
}
},
toolbar: {
root: {
className: classNames('flex items-center justify-between flex-wrap', 'bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-blue-900/40 p-5 rounded-md gap-2')
},
start: 'flex items-center',
center: 'flex items-center',
end: 'flex items-center'
},
tooltip: {
root: ({ context }) => {
return {
className: classNames('absolute shadow-md', {
'py-0 px-1': context.right || context.left || (!context.right && !context.left && !context.top && !context.bottom),
'py-1 px-0': context.top || context.bottom
})
};
},
arrow: ({ context }) => ({
className: classNames('absolute w-0 h-0 border-transparent border-solid', {
'-mt-1 border-y-[0.25rem] border-r-[0.25rem] border-l-0 border-r-gray-600': context.right,
'-mt-1 border-y-[0.25rem] border-l-[0.25rem] border-r-0 border-l-gray-600': context.left,
'-ml-1 border-x-[0.25rem] border-t-[0.25rem] border-b-0 border-t-gray-600': context.top,
'-ml-1 border-x-[0.25rem] border-b-[0.25rem] border-t-0 border-b-gray-600': context.bottom
})
}),
text: {
className: 'p-3 bg-gray-600 text-white rounded-md whitespace-pre-line break-words'
}
},
//UPLOAD
fileupload: {
input: 'hidden',
buttonbar: {
className: classNames('flex flex-wrap', 'bg-gray-50 dark:bg-gray-800 p-5 border border-solid border-gray-300 dark:border-blue-900/40 text-gray-700 dark:text-white/80 rounded-tr-lg rounded-tl-lg gap-2 border-b-0')
},
basicButton: {
className: classNames('text-white bg-blue-500 border border-blue-500 p-3 px-5 rounded-md text-base', 'overflow-hidden relative')
},
chooseButton: {
className: classNames('text-white bg-blue-500 border border-blue-500 p-3 px-5 rounded-md text-base', 'overflow-hidden relative')
},
chooseIcon: 'mr-2 inline-block',
chooseButtonLabel: 'flex-1 font-bold',
uploadButton: {
icon: 'mr-2'
},
cancelButton: {
icon: 'mr-2'
},
content: {
className: classNames('relative', 'bg-white dark:bg-gray-900 p-8 border border-gray-300 dark:border-blue-900/40 text-gray-700 dark:text-white/80 rounded-b-lg')
},
file: {
className: classNames('flex items-center flex-wrap', 'p-4 border border-gray-300 dark:border-blue-900/40 rounded gap-2 mb-2', 'last:mb-0')
},
thumbnail: 'shrink-0',
fileName: 'mb-2',
fileSize: 'mr-2',
uploadIcon: 'mr-2'
},
//Messages
messages: {
root: ({ state, index }) => {
return {
className: classNames('my-4 rounded-md', {
'bg-blue-100 border-solid border-0 border-l-4 border-blue-500 text-blue-700': state.messages[index] && state.messages[index].message.severity == 'info',
'bg-green-100 border-solid border-0 border-l-4 border-green-500 text-green-700': state.messages[index] && state.messages[index].message.severity == 'success',
'bg-orange-100 border-solid border-0 border-l-4 border-orange-500 text-orange-700': state.messages[index] && state.messages[index].message.severity == 'warn',
'bg-red-100 border-solid border-0 border-l-4 border-red-500 text-red-700': state.messages[index] && state.messages[index].message.severity == 'error'
})
};
},
wrapper: 'flex items-center py-5 px-7',
icon: {
className: classNames('w-6 h-6', 'text-lg mr-2')
},
text: 'text-base font-normal',
button: {
className: classNames('w-8 h-8 rounded-full bg-transparent transition duration-200 ease-in-out', 'ml-auto overflow-hidden relative', 'flex items-center justify-center', 'hover:bg-white/30')
},
transition: {
timeout: 300,
classNames: {
enter: 'max-h-0 opacity-0',
enterActive: '!max-h-40 !opacity-100 overflow-hidden transition-all duration-300',
exit: 'max-h-40 opacity-100',
exitActive: '!max-h-0 !opacity-0 !m-0 overflow-hidden transition-all duration-300 ease-in'
}
}
},
message: {
root: ({ props }) => ({
className: classNames('inline-flex items-center justify-center align-top', 'p-3 m-0 rounded-md', {
'bg-blue-100 border-0 text-blue-700': props.severity == 'info',
'bg-green-100 border-0 text-green-700': props.severity == 'success',
'bg-orange-100 border-0 text-orange-700': props.severity == 'warn',
'bg-red-100 border-0 text-red-700': props.severity == 'error'
})
}),
icon: 'text-base mr-2'
},
toast: {
root: {
className: classNames('w-96', 'opacity-90')
},
message: ({ state, index }) => ({
className: classNames('my-4 rounded-md w-full', {
'bg-blue-100 border-solid border-0 border-l-4 border-blue-500 text-blue-700': state.messages[index] && state.messages[index].message.severity == 'info',
'bg-green-100 border-solid border-0 border-l-4 border-green-500 text-green-700': state.messages[index] && state.messages[index].message.severity == 'success',
'bg-orange-100 border-solid border-0 border-l-4 border-orange-500 text-orange-700': state.messages[index] && state.messages[index].message.severity == 'warn',
'bg-red-100 border-solid border-0 border-l-4 border-red-500 text-red-700': state.messages[index] && state.messages[index].message.severity == 'error'
})
}),
content: 'flex items-center py-5 px-7',
icon: {
className: classNames('w-6 h-6', 'text-lg mr-2')
},
text: 'text-base font-normal flex flex-col flex-1 grow shrink ml-4',
summary: 'font-bold block',
detail: 'mt-1 block',
closeButton: {
className: classNames('w-8 h-8 rounded-full bg-transparent transition duration-200 ease-in-out', 'ml-auto overflow-hidden relative', 'flex items-center justify-center', 'hover:bg-white/30')
},
transition: {
timeout: { enter: 300, exit: 500 },
classNames: {
enter: 'opacity-0 max-h-0 translate-x-0 translate-y-2/4 translate-z-0',
enterActive: '!max-h-40 !opacity-90 !translate-y-0 transition-transform transition-opacity duration-300',
exit: 'max-h-40 opacity-90',
exitActive: '!max-h-0 !opacity-0 !mb-0 overflow-hidden transition-all duration-500 ease-in'
}
}
},
//BUTTONS
button: {
root: ({ props, context }) => ({
className: classNames(
'items-center cursor-pointer inline-flex overflow-hidden relative select-none text-center align-bottom',
'transition duration-200 ease-in-out',
'focus:outline-none focus:outline-offset-0',
{
'text-white dark:text-gray-900 bg-blue-500 dark:bg-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-600 dark:hover:bg-blue-500 hover:border-blue-600 dark:hover:border-blue-500 focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
!props.link && props.severity === null && !props.text && !props.outlined && !props.plain,
'text-blue-600 bg-transparent border-transparent focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.link
},
{
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(176,185,198,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(203,213,225,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'secondary',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(136,234,172,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(134,239,172,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'success',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'info',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(250,207,133,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(252,211,77,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'warning',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(212,170,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(216,180,254,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'help',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(247,162,162,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(252,165,165,0.7),0_1px_2px_0_rgba(0,0,0,0)]':
props.severity === 'danger'
},
{
'text-white dark:text-gray-900 bg-gray-500 dark:bg-gray-400 border border-gray-500 dark:border-gray-400 hover:bg-gray-600 dark:hover:bg-gray-500 hover:border-gray-600 dark:hover:border-gray-500':
props.severity === 'secondary' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-green-500 dark:bg-green-400 border border-green-500 dark:border-green-400 hover:bg-green-600 dark:hover:bg-green-500 hover:border-green-600 dark:hover:border-green-500':
props.severity === 'success' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 dark:bg-blue-400 bg-blue-500 dark:bg-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-600 hover:border-blue-600 dark:hover:bg-blue-500 dark:hover:border-blue-500':
props.severity === 'info' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-orange-500 dark:bg-orange-400 border border-orange-500 dark:border-orange-400 hover:bg-orange-600 dark:hover:bg-orange-500 hover:border-orange-600 dark:hover:border-orange-500':
props.severity === 'warning' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-purple-500 dark:bg-purple-400 border border-purple-500 dark:border-purple-400 hover:bg-purple-600 dark:hover:bg-purple-500 hover:border-purple-600 dark:hover:border-purple-500':
props.severity === 'help' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-red-500 dark:bg-red-400 border border-red-500 dark:border-red-400 hover:bg-red-600 dark:hover:bg-red-500 hover:border-red-600 dark:hover:border-red-500':
props.severity === 'danger' && !props.text && !props.outlined && !props.plain
},
{ 'shadow-lg': props.raised },
{ 'rounded-md': !props.rounded, 'rounded-full': props.rounded },
{
'bg-transparent border-transparent': props.text && !props.plain,
'text-blue-500 dark:text-blue-400 hover:bg-blue-300/20': props.text && (props.severity === null || props.severity === 'info') && !props.plain,
'text-gray-500 dark:text-gray-400 hover:bg-gray-300/20': props.text && props.severity === 'secondary' && !props.plain,
'text-green-500 dark:text-green-400 hover:bg-green-300/20': props.text && props.severity === 'success' && !props.plain,
'text-orange-500 dark:text-orange-400 hover:bg-orange-300/20': props.text && props.severity === 'warning' && !props.plain,
'text-purple-500 dark:text-purple-400 hover:bg-purple-300/20': props.text && props.severity === 'help' && !props.plain,
'text-red-500 dark:text-red-400 hover:bg-red-300/20': props.text && props.severity === 'danger' && !props.plain
},
{ 'shadow-lg': props.raised && props.text },
{
'text-gray-500 hover:bg-gray-300/20': props.plain & props.text,
'text-gray-500 border border-gray-500 hover:bg-gray-300/20': props.plain & props.outlined,
'text-white bg-gray-500 border border-gray-500 hover:bg-gray-600 hover:border-gray-600': props.plain & !props.outlined & !props.text
},
{
'bg-transparent border': props.outlined && !props.plain,
'text-blue-500 dark:text-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-300/20': props.outlined && (props.severity === null || props.severity === 'info') && !props.plain,
'text-gray-500 dark:text-gray-400 border border-gray-500 dark:border-gray-400 hover:bg-gray-300/20': props.outlined && props.severity === 'secondary' && !props.plain,
'text-green-500 dark:text-green-400 border border-green-500 dark:border-green-400 hover:bg-green-300/20': props.outlined && props.severity === 'success' && !props.plain,
'text-orange-500 dark:text-orange-400 border border-orange-500 dark:border-orange-400 hover:bg-orange-300/20': props.outlined && props.severity === 'warning' && !props.plain,
'text-purple-500 dark:text-purple-400 border border-purple-500 dark:border-purple-400 hover:bg-purple-300/20': props.outlined && props.severity === 'help' && !props.plain,
'text-red-500 dark:text-red-400 border border-red-500 dark:border-red-400 hover:bg-red-300/20': props.outlined && props.severity === 'danger' && !props.plain
},
{ 'px-4 py-3 text-base': props.size === null, 'text-xs py-2 px-3': props.size === 'small', 'text-xl py-3 px-4': props.size === 'large' },
{ 'flex-column': props.iconPos == 'top' || props.iconPos == 'bottom' },
{ 'opacity-60 pointer-events-none cursor-default': context?.disabled }
)
}),
label: ({ props }) => ({
className: classNames(
'flex-1',
'duration-200',
'font-bold',
{
'hover:underline': props.link
},
{ 'invisible w-0': props.label == null }
)
}),
icon: ({ props }) => ({
className: classNames('mx-0', {
'mr-2': props.iconPos == 'left' && props.label != null,
'ml-2 order-1': props.iconPos == 'right' && props.label != null,
'mb-2': props.iconPos == 'top' && props.label != null,
'mt-2 order-2': props.iconPos == 'bottom' && props.label != null
})
}),
loadingIcon: ({ props }) => ({
className: classNames('mx-0', {
'mr-2': props.loading && props.iconPos == 'left' && props.label != null,
'ml-2 order-1': props.loading && props.iconPos == 'right' && props.label != null,
'mb-2': props.loading && props.iconPos == 'top' && props.label != null,
'mt-2 order-2': props.loading && props.iconPos == 'bottom' && props.label != null
})
}),
badge: ({ props }) => ({
className: classNames({ 'ml-2 w-4 h-4 leading-none flex items-center justify-center': props.badge })
})
},
speeddial: {
root: 'absolute flex',
button: {
root: ({ parent }) => ({
className: classNames('w-16 !h-16 !rounded-full justify-center z-10', {
'rotate-45': parent.state.visible
})
}),
label: {
className: 'hidden'
}
},
menu: 'm-0 p-0 list-none flex items-center justify-center transition delay-200 z-20',
menuitem: ({ props, state }) => ({
className: classNames(
'transform transition-transform duration-200 ease-out transition-opacity duration-800',
!state.visible ? 'opacity-0 scale-0' : 'opacity-1 scale-100',
{
'my-1 first:mb-2': props.direction == 'up' && props.type == 'linear',
'my-1 first:mt-2': props.direction == 'down' && props.type == 'linear',
'mx-1 first:mr-2': props.direction == 'left' && props.type == 'linear',
'mx-1 first:ml-2': props.direction == 'right' && props.type == 'linear'
},
{ absolute: props.type !== 'linear' }
)
}),
action: {
className: classNames('flex items-center justify-center rounded-full relative overflow-hidden', 'w-12 h-12 bg-gray-700 hover:bg-gray-800 text-white')
},
mask: ({ state }) => ({
className: classNames('absolute left-0 top-0 w-full h-full transition-opacity duration-250 ease-in-out bg-black/40 z-0', {
'opacity-0': !state.visible,
'pointer-events-none opacity-100 transition-opacity duration-400 ease-in-out': state.visible
})
})
},
splitbutton: {
root: ({ props }) => ({
className: classNames('inline-flex relative', 'rounded-md', { 'shadow-lg': props.raised })
}),
button: {
root: ({ parent }) => ({
className: classNames('rounded-r-none border-r-0', { 'rounded-l-full': parent.props.rounded })
}),
icon: 'mr-2'
},
menu: {
className: classNames('outline-none', 'py-1 px-0 rounded-md list-none bg-white border-none shadow-lg')
},
menuList: 'm-0 p-0 border-none outline-none no-underline list-none',
menuButton: {
root: ({ parent }) => ({
className: classNames('rounded-l-none', { 'rounded-r-full': parent.props.rounded })
}),
label: 'hidden'
},
anchor: 'cursor-pointer flex items-center relative overflow-hidden py-3 px-5 rounded-none transition select-none hover:text-gray-700 hover:bg-gray-200',
menuIcon: 'mr-2'
},
//FORMS
inputtext: {
root: ({ props, context }) => ({
className: classNames(
'm-0',
'font-sans text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 border transition-colors duration-200 appearance-none rounded-lg',
{
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': !context.disabled,
'hover:border-blue-500': !props.invalid && !context.disabled,
'opacity-60 select-none pointer-events-none cursor-default': context.disabled,
'border-gray-300 dark:border-blue-900/40': !props.invalid,
'border-red-500 hover:border-red-500/80 focus:border-red-500': props.invalid && !context.disabled,
'border-red-500/50': props.invalid && context.disabled
},
{
'text-lg px-4 py-4': props.size === 'large',
'text-xs px-2 py-2': props.size === 'small',
'p-3 text-base': !props.size || typeof props.size === 'number'
},
{
'pl-8': context.iconPosition === 'left',
'pr-8': props.iconPosition === 'right'
}
)
})
},
inputnumber: {
root: 'w-full inline-flex',
input: {
root: ({ props }) => ({
className: classNames({ 'rounded-tr-none rounded-br-none': props.showButtons && props.buttonLayout == 'stacked' })
})
},
buttonGroup: ({ props }) => ({
className: classNames({ 'flex flex-col': props.showButtons && props.buttonLayout == 'stacked' })
}),
incrementButton: ({ props }) => ({
className: classNames('flex !items-center !justify-center', {
'rounded-br-none rounded-bl-none rounded-bl-none !p-0 flex-1 w-[3rem]': props.showButtons && props.buttonLayout == 'stacked'
})
}),
decrementButton: ({ props }) => ({
className: classNames('flex !items-center !justify-center', {
'rounded-tr-none rounded-tl-none rounded-tl-none !p-0 flex-1 w-[3rem]': props.showButtons && props.buttonLayout == 'stacked'
})
})
},
knob: {
root: ({ props }) => ({
className: classNames('focus:outline-none focus:outline-offset-0 focus:shadow-0', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
range: 'stroke-current transition duration-100 ease-in stroke-gray-200 dark:stroke-gray-700 fill-none',
value: 'animate-dash-frame stroke-blue-500 fill-none',
label: 'text-center text-xl'
},
inputswitch: {
root: ({ props }) => ({
className: classNames('inline-block relative', 'w-12 h-7', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
slider: ({ props }) => ({
className: classNames(
'absolute cursor-pointer top-0 left-0 right-0 bottom-0 border border-transparent',
'transition-colors duration-200 rounded-2xl',
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]',
"before:absolute before:content-'' before:top-1/2 before:bg-white before:dark:bg-gray-900 before:w-5 before:h-5 before:left-1 before:-mt-2.5 before:rounded-full before:transition-duration-200",
{
'bg-gray-200 dark:bg-gray-800 hover:bg-gray-300 hover:dark:bg-gray-700 ': !props.checked,
'bg-blue-500 before:transform before:translate-x-5': props.checked
}
)
})
},
cascadeselect: {
root: ({ props }) => ({
className: classNames('inline-flex cursor-pointer select-none relative', 'bg-white dark:bg-gray-900 border border-gray-300 dark:border-blue-900/40 transition duration-200 ease-in-out rounded-lg', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
label: {
className: classNames('block whitespace-nowrap overflow-hidden flex flex-1 w-1 text-overflow-ellipsis cursor-pointer', 'bg-transparent border-0 p-3 text-gray-700 dark:text-white/80', 'appearance-none rounded-md')
},
dropdownButton: {
className: classNames('flex items-center justify-center shrink-0', 'bg-transparent text-gray-600 dark:text-white/80 w-[3rem] rounded-tr-6 rounded-br-6')
},
panel: 'py-3 bg-white dark:bg-gray-900 border-0 shadow-md',
list: 'm-0 sm:p-0 list-none',
sublistWrapper: {
className: classNames('block absolute left-full top-0', 'min-w-full z-10')
},
sublist: {
className: classNames('py-3 bg-white dark:bg-gray-900 border-0 shadow-md')
},
item: ({ state }) => ({
className: classNames('cursor-pointer font-normal whitespace-nowrap', 'm-0 border-0 bg-transparent transition-shadow rounded-none', {
'text-gray-700 hover:text-gray-700 hover:bg-gray-200 dark:text-white/80 dark:hover:text-white/80 dark:hover:bg-gray-800/80': !state.selected,
'bg-blue-50 text-blue-700 dark:bg-blue-300 dark:text-white/80': state.selected
})
}),
content: {
className: classNames('flex items-center overflow-hidden relative', 'py-3 px-5')
},
optionGroupIcon: 'ml-auto',
transition: TRANSITIONS.overlay
},
floatlabel: {
root: {
className: classNames(
'block relative', // root component style
'[&>label]:absolute [&>label]:pointer-events-none [&>label]:left-2 [&>label]:top-1/2 [&>label]:-mt-2 [&>label]:leading-none [&>label]:transition-all [&>label]:ease-in-out', // label style
'[&>textarea~label]:top-4', // textarea
'[&>input:focus~label]:-top-3 [&>input:focus~label]:text-xs', // input focus
'[&>input:autofill~label]:-top-3 [&>input:autofill~label]:text-xs', // input autofill
'[&>input.p-filled~label]:-top-3 [&>input.p-filled~label]:text-xs', // input filled
'[&>textarea:focus~label]:-top-3 [&>textarea:focus~label]:text-xs', // textarea focus
'[&>textarea.p-filled~label]:-top-3 [&>textarea.p-filled~label]:text-xs', // textarea filled
'[&>div[data-pc-name="dropdown"][data-p-focus="false"]~label]:-top-3 [&>div[data-pc-name="dropdown"][data-p-focus="false"]~label]:text-xs', // dropdown focus
'[&>input::placeholder]:opacity-0 [&>input::placeholder]:transition-all [&>input::placeholder]:ease-in-out', // placeholder
'[&>input::placeholder:focus]:opacity-100 [&>input::placeholder:focus]:transition-all [&>input::placeholder:focus]:ease-in-out' // placeholder focus
)
}
},
iconfield: {
root: {
className: classNames('relative')
}
},
inputicon: {
root: ({ context }) => ({
className: classNames('absolute top-1/2 -mt-2', {
'left-2': context.iconPosition === 'left',
'right-2': context.iconPosition === 'right'
})
})
},
inputmask: {
root: ({ props, context }) => ({
className: classNames(
'm-0',
'font-sans text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 border transition-colors duration-200 appearance-none rounded-lg',
{
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': !context.disabled,
'hover:border-blue-500': !props.invalid && !context.disabled,
'opacity-60 select-none pointer-events-none cursor-default': context.disabled,
'border-gray-300 dark:border-blue-900/40': !props.invalid,
'border-red-500 hover:border-red-500/80 focus:border-red-500': props.invalid && !context.disabled,
'border-red-500/50': props.invalid && context.disabled
},
{
'text-lg px-4 py-4': props.size === 'large',
'text-xs px-2 py-2': props.size === 'small',
'p-3 text-base': !props.size || typeof props.size === 'number'
},
{
'pl-8': context.iconPosition === 'left',
'pr-8': props.iconPosition === 'right'
}
)
})
},
inputotp: {
root: { className: 'flex items-center gap-2' },
input: {
root: {
className: classNames(
'box-border text-center w-10 h-11 p-3 text-slate-900 border border-gray-300 rounded-lg transition-all duration-200',
'hover:border-cyan-500',
'focus:border-cyan-500 focus:shadow-[0_0_0_0.2rem_#a5f3fc] focus:outline-0 focus:outline-offset-0'
)
}
}
},
rating: {
root: ({ props }) => ({
className: classNames('relative flex items-center', 'gap-2', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
}),
cancelItem: ({ context }) => ({
className: classNames(
'inline-flex items-center cursor-pointer'
// {
// 'outline-none outline-offset-0 shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': context.focused
// }
)
}),
cancelIcon: {
className: classNames('text-red-500', 'w-5 h-5', 'transition duration-200 ease-in')
},
item: ({ props, context }) => ({
className: classNames(
'inline-flex items-center',
{
'cursor-pointer': !props.readOnly,
'cursor-default': props.readOnly
},
{
'outline-none outline-offset-0 shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': context.active
}
)
}),
offIcon: {
className: classNames('text-gray-700 hover:text-blue-400', 'w-5 h-5', 'transition duration-200 ease-in')
},
onIcon: {
className: classNames('text-blue-500', 'w-5 h-5', 'transition duration-200 ease-in')