-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Chakra__MakeProps.res
1535 lines (1431 loc) · 50.5 KB
/
Chakra__MakeProps.res
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
let optionMap = Belt.Option.map
let arrayMap = Belt.Array.map
let withShorthand = (x, y) =>
switch (x, y) {
| (Some(_x), Some(_y)) => y
| (Some(_x), None) => x
| (None, Some(_y)) => y
| (None, None) => None
}
module Identity = {
type t
external fromArray: array<'a> => t = "%identity"
external fromString: string => t = "%identity"
external fromInt: int => t = "%identity"
external fromFloat: float => t = "%identity"
external fromBool: bool => t = "%identity"
external fromObject: {..} => t = "%identity"
external fromAbs: 'a => t = "%identity"
}
module Bool = {
let rec identity = x =>
switch x {
| #true_ => true->Identity.fromBool
| #false_ => false->Identity.fromBool
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Text = {
let rec identity = x =>
switch x {
| #text(str) => str->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BoxSize = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Width.t as w => w->Width.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Width = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Width.t as w => w->Width.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module MaxWidth = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...MaxWidth.t as w => w->MaxWidth.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Height = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Height.t as w => w->Height.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module MaxHeight = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...MaxHeight.t as w => w->MaxHeight.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Display = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...DisplayOutside.t as o => o->DisplayOutside.toString->Identity.fromString
| #...DisplayInside.t as i => i->DisplayInside.toString->Identity.fromString
| #...DisplayListItem.t as l => l->DisplayListItem.toString->Identity.fromString
| #...DisplayInternal.t as i' => i'->DisplayInternal.toString->Identity.fromString
| #...DisplayBox.t as b => b->DisplayBox.toString->Identity.fromString
| #...DisplayLegacy.t as l' => l'->DisplayLegacy.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module VerticalAlign = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...VerticalAlign.t as bs => bs->VerticalAlign.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Overflow = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Overflow.t as l => l->Overflow.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Flex = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Flex.t as f => f->Flex.toString->Identity.fromString
| #num(n) => n->Js.Float.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FlexDirection = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...FlexDirection.t as fd => fd->FlexDirection.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FlexWrap = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...FlexWrap.t as fw => fw->FlexWrap.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FlexShrink = {
let rec identity = x =>
switch x {
| #num(n) => n->Js.Float.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FlexGrow = {
let rec identity = x =>
switch x {
| #num(n) => n->Js.Float.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FlexBasis = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...FlexBasis.t as b => b->FlexBasis.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Order = {
let rec identity = x =>
switch x {
| #num(n) => n->Js.Int.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module AlignContent = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...AlignContent.t as ac => ac->AlignContent.toString->Identity.fromString
| #...NormalAlignment.t as na => na->NormalAlignment.toString->Identity.fromString
| #...BaselineAlignment.t as ba => ba->BaselineAlignment.toString->Identity.fromString
| #...DistributedAlignment.t as da => da->DistributedAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module AlignItems = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...AlignItems.t as ai => ai->AlignItems.toString->Identity.fromString
| #...PositionalAlignment.t as pa => pa->PositionalAlignment.toString->Identity.fromString
| #...BaselineAlignment.t as ba => ba->BaselineAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module AlignSelf = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...AlignSelf.t as as_ => as_->AlignSelf.toString->Identity.fromString
| #...PositionalAlignment.t as pa => pa->PositionalAlignment.toString->Identity.fromString
| #...BaselineAlignment.t as ba => ba->BaselineAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module JustifyContent = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...PositionalAlignment.t as pa => pa->PositionalAlignment.toString->Identity.fromString
| #...NormalAlignment.t as na => na->NormalAlignment.toString->Identity.fromString
| #...DistributedAlignment.t as da => da->DistributedAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module JustifyItems = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...PositionalAlignment.t as pa => pa->PositionalAlignment.toString->Identity.fromString
| #...NormalAlignment.t as na => na->NormalAlignment.toString->Identity.fromString
| #...BaselineAlignment.t as ba => ba->BaselineAlignment.toString->Identity.fromString
| #...OverflowAlignment.t as oa => oa->OverflowAlignment.toString->Identity.fromString
| #...LegacyAlignment.t as la => la->LegacyAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module JustifySelf = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...JustifySelf.t as j => j->JustifySelf.toString->Identity.fromString
| #...PositionalAlignment.t as pa => pa->PositionalAlignment.toString->Identity.fromString
| #...BaselineAlignment.t as ba => ba->BaselineAlignment.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Margin = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Margin.t as m => m->Margin.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Spaces.t as csp => csp->Spaces.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Padding = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Spaces.t as csp => csp->Spaces.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Color = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Colors.t as cs => cs->Colors.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Opacity = {
let rec identity = x =>
switch x {
| #num(x) => x->Js.Float.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundColor = Color
module BorderStyle = {
open Chakra__AtomicTypes
let toString = x =>
switch x {
| #...BorderStyle.t as b => b->BorderStyle.toString
| #...Var.t as va => va->Var.toString
| #...Cascading.t as c => c->Cascading.toString
}
let rec identity = x =>
switch x {
| #...BorderStyle.t as bs => bs->toString->Identity.fromString
| #...Var.t as v => v->toString->Identity.fromString
| #...Cascading.t as c => c->toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Border = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Borders.t as b => b->Borders.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BorderRadius = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Radii.t as cr => cr->Radii.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BorderWidth = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BorderWidth.t as bw => bw->BorderWidth.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BorderColor = Color
module GridGap = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridRow = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridRow.t as p => p->GridRow.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridRowGap = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridColumn = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridColumn.t as p => p->GridColumn.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridColumnGap = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...ColumnGap.t as gcg => gcg->ColumnGap.toString->Identity.fromString
| #...Percentage.t as p => p->Percentage.toString->Identity.fromString
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridArea = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridArea.t as t => t->GridArea.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #gridArea2(grid1, grid2) => {
let grid1 = grid1->GridArea.toString
let grid2 = grid2->GridArea.toString
let grid = `${grid1} / ${grid2}`
grid->Identity.fromString
}
| #gridArea3(grid1, grid2, grid3) => {
let grid1 = grid1->GridArea.toString
let grid2 = grid2->GridArea.toString
let grid3 = grid3->GridArea.toString
let grid = `${grid1} / ${grid2} / ${grid3}`
grid->Identity.fromString
}
| #gridArea4(grid1, grid2, grid3, grid4) => {
let grid1 = grid1->GridArea.toString
let grid2 = grid2->GridArea.toString
let grid3 = grid3->GridArea.toString
let grid4 = grid4->GridArea.toString
let grid = `${grid1} / ${grid2} / ${grid3} / ${grid4}`
grid->Identity.fromString
}
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridAutoFlow = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridAutoFlow.t as f => f->GridAutoFlow.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridAutoRows = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Dimension.t as d => d->Dimension.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridAutoColumns = GridAutoRows
module GridTemplateRows = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridLength.t as gl => gl->GridLength.toString->Identity.fromString
| #grid(arrr_of_gridLength) =>
arrr_of_gridLength
->Js.Array2.map(GridLength.toString)
->Js.Array2.joinWith(" ")
->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module GridTemplateColumns = GridTemplateRows
module GridTemplateAreas = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...GridTemplateAreas.t as t => t->GridTemplateAreas.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FontFamily = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...FontFamilyName.t as ff => ff->FontFamilyName.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #body => "body"->Identity.fromString
| #heading => "heading"->Identity.fromString
| #mono => "mono"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FontSize = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...FontSizes.t as fs => fs->FontSizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FontWeight = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...FontWeights.t as fw => fw->FontWeights.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module LineHeight = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...LineHeights.t as ls => ls->LineHeights.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module LetterSpacing = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...LetterSpacings.t as ls => ls->LetterSpacings.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module TextAlign = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...TextAligns.t as ta => ta->TextAligns.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module FontStyle = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...FontStyles.t as fs => fs->FontStyles.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module TextDecoration = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...TextDecorations.t as tt => tt->TextDecorations.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module TextTransform = {
open Chakra__AtomicTypes.Typography
let rec identity = x =>
switch x {
| #...TextTransforms.t as tt => tt->TextTransforms.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Gradient = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Gradients.t as g => g->Gradients.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundClip = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BackgroundClip.t as bc => bc->BackgroundClip.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Background = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Colors.t as bc => bc->Colors.toString->Identity.fromString
| #...Url.t as u => u->Url.toString->Identity.fromString
| #...Gradients.t as g => g->Gradients.toString->Identity.fromString
| #none => "none"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundImage = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BackgroundImage.t as bi => bi->BackgroundImage.toString->Identity.fromString
| #...Url.t as u => u->Url.toString->Identity.fromString
| #...Gradients.t as g => g->Gradients.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundSize = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #size(x, y) => {
let x = x->Length.toString
let y = y->Length.toString
let size = `${x} ${y}`
size->Identity.fromString
}
| #auto => "auto"->Identity.fromString
| #cover => "cover"->Identity.fromString
| #contain => "contain"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundPosition = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BackgroundPosition.t as bp => bp->BackgroundPosition.toString->Identity.fromString
| #hv(h, v) => {
let h = switch h {
| #...BackgroundPosition.X.t as h => BackgroundPosition.X.toString(h)
| #...Length.t as l => Length.toString(l)
}
let v = switch v {
| #...BackgroundPosition.Y.t as v => BackgroundPosition.Y.toString(v)
| #...Length.t as l => Length.toString(l)
}
let b = `${h} ${v}`
b->Identity.fromString
}
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundRepeat = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BackgroundRepeat.t as br => br->BackgroundRepeat.toString->Identity.fromString
| #hv(#...BackgroundRepeat.horizontal as h, #...BackgroundRepeat.vertical as v) => {
let h = h->BackgroundRepeat.toString
let v = v->BackgroundRepeat.toString
let b = `${h} ${v}`
b->Identity.fromString
}
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BackgroundAttachment = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...BackgroundAttachment.t as ba => ba->BackgroundAttachment.toString->Identity.fromString
| #...Url.t as u => u->Url.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Position = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Position.t as ba => ba->Position.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Top = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Length.t as l => l->Length.toString->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Sizes = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...Sizes.t as cs => cs->Sizes.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Right = Top
module Bottom = Top
module Left = Top
module ZIndex = {
open Chakra__AtomicTypes
let rec identity = x =>
switch x {
| #...ZIndex.t as z => z->ZIndex.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Shadow = {
open Chakra__AtomicTypes
let string_of_box = (x, y, c, ~blur=?, ~spread=?, ~inset=?, ()) => {
let x = x->Length.toString
let y = y->Length.toString
let c = c->Colors.toString
switch (blur, spread, inset) {
| (_, _, Some(_inset)) => `inset ${x} ${y} ${c}`
| (Some(radius), None, _) => {
let radius = radius->Length.toString
`${x} ${y} ${radius} ${c}`
}
| (Some(radius), Some(spread), _) => {
let radius = radius->Length.toString
let spread = spread->Length.toString
`${x} ${y} ${radius} ${spread} ${c}`
}
| _ => `${x}, ${y}, ${c}`
}
}
let rec identity = x =>
switch x {
| #none => "none"->Identity.fromString
| #box(x, y, c) => string_of_box(x, y, c, ())->Identity.fromString
| #blur(x, y, blur, c) => string_of_box(x, y, c, ~blur, ())->Identity.fromString
| #spread(x, y, blur, spread, c) =>
string_of_box(x, y, c, ~blur, ~spread, ())->Identity.fromString
| #inset(x, y, c) => string_of_box(x, y, c, ~inset=true, ())->Identity.fromString
| #...Var.t as va => va->Var.toString->Identity.fromString
| #...Cascading.t as c => c->Cascading.toString->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module BoxShadow = Shadow
module TextShadow = Shadow
// Component Specific
module Badge = {
module Variant = {
let rec identity = x =>
switch x {
| #outline => "outline"->Identity.fromString
| #solid => "solid"->Identity.fromString
| #subtle => "subtle"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module AspectRatio = {
module Ratio = {
let rec identity = x =>
switch x {
| #num(f) => f->Js.Float.toString->Identity.fromString
| #ratio(a, b) => {
let a = a->Js.Float.toString
let b = b->Js.Float.toString
`${a} ${b}`->Identity.fromString
}
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module Button = {
module Size = {
let rec identity = x =>
switch x {
| #sm => "sm"->Identity.fromString
| #md => "md"->Identity.fromString
| #lg => "lg"->Identity.fromString
| #xs => "xs"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module Variant = {
let rec identity = x =>
switch x {
| #link => "link"->Identity.fromString
| #outline => "outline"->Identity.fromString
| #solid => "solid"->Identity.fromString
| #ghost => "ghost"->Identity.fromString
| #unstyled => "unstyled"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
module SpinnerPlacement = {
let rec identity = x =>
switch x {
| #start => "start"->Identity.fromString
| #end => "end"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module CloseButton = {
module Size = {
let rec identity = x =>
switch x {
| #sm => "sm"->Identity.fromString
| #md => "md"->Identity.fromString
| #lg => "lg"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module Divider = {
module Variant = {
let rec identity = x =>
switch x {
| #dashed => "dashed"->Identity.fromString
| #solid => "solid"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module Select = {
module Variant = {
let rec identity = x =>
switch x {
| #outline => "outline"->Identity.fromString
| #filled => "filled"->Identity.fromString
| #flushed => "flushed"->Identity.fromString
| #unstyled => "unstyled"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
module Stat = {
module Size = {
let rec identity = x =>
switch x {
| #md => "md"->Identity.fromString
| #array(arr) => arr->arrayMap(identity)->Identity.fromArray
}
let fromOption = o => o->optionMap(identity)
}
}
/**
this is module for handle 2 type between [string] or [number]
*/
module StringOrNumber = {