Skip to content

Commit 1703258

Browse files
committed
fix(props): fix invalid props for all Components
rename ~as_ to ~_as (it will make "as" in JS code output) change isTruncated props from Identity.t to be bool change colorScheme props from Identity.t to be ColorScheme.t (not use %identity cause the valid implementation of colorScheme is didn't have responsiveValues type)
1 parent ffb850c commit 1703258

26 files changed

+97
-185
lines changed

_templates/Box/new/new.ejs.t

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ external make: (
99
/**
1010
Component Props {<%= name %>}
1111
**/
12-
~as_: string=?,
13-
~isTruncated: Identity.t=?,
12+
~_as: string=?,
13+
~isTruncated: bool=?,
1414
/**
1515
Margin and Padding
1616
@see <https://chakra-ui.com/docs/features/style-props#margin-and-padding>
@@ -37,7 +37,7 @@ external make: (
3737
Colors and BackgroundColor
3838
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
3939
**/
40-
~colorScheme: Identity.t=?,
40+
~colorScheme: ColorScheme.t=?,
4141
~color: Identity.t=?,
4242
~backgroundColor: Identity.t=?,
4343
~opacity: Identity.t=?,
@@ -410,7 +410,6 @@ let makeProps = (
410410
/**
411411
Component Props {<%= name %>}
412412
**/
413-
~isTruncated=?,
414413
/**
415414
Margin and Padding
416415
**/
@@ -450,7 +449,6 @@ let makeProps = (
450449
Colors and BackgroundColor
451450
**/
452451
~color=?,
453-
~colorScheme=?,
454452
~backgroundColor=?,
455453
~bgColor=?,
456454
~opacity=?,
@@ -618,7 +616,6 @@ let makeProps = (
618616
/**
619617
Component Props {<%= name %>}
620618
**/
621-
~isTruncated=?isTruncated->Bool.fromOption,
622619
/**
623620
Margin and Padding
624621
**/
@@ -644,7 +641,6 @@ let makeProps = (
644641
Colors and Background Color
645642
**/
646643
~color=?color->Color.fromOption,
647-
~colorScheme=?colorScheme->ColorScheme.fromOption,
648644
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
649645
~opacity=?opacity->Opacity.fromOption,
650646
/**

src/Components/Chakra__AspectRatio.res

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ external make: (
66
/**
77
Component Props {AspectRatio}
88
**/
9-
~as_: string=?,
10-
~isTruncated: Identity.t=?,
9+
~_as: string=?,
10+
~isTruncated: bool=?,
1111
~ratio: Identity.t=?,
1212
/**
1313
Margin and Padding
@@ -35,7 +35,7 @@ external make: (
3535
Colors and BackgroundColor
3636
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
3737
**/
38-
~colorScheme: Identity.t=?,
38+
~colorScheme: ColorScheme.t=?,
3939
~color: Identity.t=?,
4040
~backgroundColor: Identity.t=?,
4141
~opacity: Identity.t=?,
@@ -451,7 +451,6 @@ let makeProps = (
451451
/**
452452
Component Props {AspectRatio}
453453
**/
454-
~isTruncated=?,
455454
~ratio=?,
456455
/**
457456
Margin and Padding
@@ -492,7 +491,6 @@ let makeProps = (
492491
Colors and BackgroundColor
493492
**/
494493
~color=?,
495-
~colorScheme=?,
496494
~backgroundColor=?,
497495
~bgColor=?,
498496
~opacity=?,
@@ -664,7 +662,6 @@ let makeProps = (
664662
/**
665663
Component Props {AspectRatio}
666664
**/
667-
~isTruncated=?isTruncated->Bool.fromOption,
668665
~ratio=?ratio->AspectRatio.Ratio.fromOption,
669666
/**
670667
Margin and Padding
@@ -691,7 +688,6 @@ let makeProps = (
691688
Colors and Background Color
692689
**/
693690
~color=?color->Color.fromOption,
694-
~colorScheme=?colorScheme->ColorScheme.fromOption,
695691
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
696692
~opacity=?opacity->Opacity.fromOption,
697693
/**

src/Components/Chakra__Badge.res

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ external make: (
77
Component Props {Badge}
88
@see <https://chakra-ui.com/docs/data-display/badge#props>
99
**/
10-
~as_: string=?,
11-
~isTruncated: Identity.t=?,
10+
@as("as") ~_as: string=?,
11+
~isTruncated: bool=?,
1212
~variant: Identity.t=?,
1313
/**
1414
Margin and Padding
@@ -36,7 +36,7 @@ external make: (
3636
Colors and BackgroundColor
3737
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
3838
**/
39-
~colorScheme: Identity.t=?,
39+
~colorScheme: ColorScheme.t=?,
4040
~color: Identity.t=?,
4141
~backgroundColor: Identity.t=?,
4242
~opacity: Identity.t=?,
@@ -452,7 +452,6 @@ let makeProps = (
452452
/**
453453
Component Props {Badge}
454454
**/
455-
~isTruncated=?,
456455
~variant=?,
457456
/**
458457
Margin and Padding
@@ -493,7 +492,6 @@ let makeProps = (
493492
Colors and BackgroundColor
494493
**/
495494
~color=?,
496-
~colorScheme=?,
497495
~backgroundColor=?,
498496
~bgColor=?,
499497
~opacity=?,
@@ -665,7 +663,6 @@ let makeProps = (
665663
/**
666664
Component Props {Badge}
667665
**/
668-
~isTruncated=?isTruncated->Bool.fromOption,
669666
~variant=?variant->Badge.Variant.fromOption,
670667
/**
671668
Margin and Padding
@@ -692,7 +689,6 @@ let makeProps = (
692689
Colors and Background Color
693690
**/
694691
~color=?color->Color.fromOption,
695-
~colorScheme=?colorScheme->ColorScheme.fromOption,
696692
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
697693
~opacity=?opacity->Opacity.fromOption,
698694
/**

src/Components/Chakra__Box.res

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ external make: (
66
/**
77
Component Props {Box}
88
**/
9-
~as_: string=?,
10-
~isTruncated: Identity.t=?,
9+
~_as: string=?,
10+
~isTruncated: bool=?,
1111
/**
1212
Margin and Padding
1313
@see <https://chakra-ui.com/docs/features/style-props#margin-and-padding>
@@ -34,7 +34,7 @@ external make: (
3434
Colors and BackgroundColor
3535
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
3636
**/
37-
~colorScheme: Identity.t=?,
37+
~colorScheme: ColorScheme.t=?,
3838
~color: Identity.t=?,
3939
~backgroundColor: Identity.t=?,
4040
~opacity: Identity.t=?,
@@ -271,7 +271,6 @@ external make: (
271271
@as("_placeholder") ~_placeholder: Pseudo.t=?,
272272
@as("_fullScreen") ~_fullScreen: Pseudo.t=?,
273273
@as("_selection") ~_selection: Pseudo.t=?,
274-
275274
/**
276275
TODO
277276
Other Props
@@ -450,7 +449,6 @@ let makeProps = (
450449
/**
451450
Component Props {Box}
452451
**/
453-
~isTruncated=?,
454452
/**
455453
Margin and Padding
456454
**/
@@ -490,7 +488,6 @@ let makeProps = (
490488
Colors and BackgroundColor
491489
**/
492490
~color=?,
493-
~colorScheme=?,
494491
~backgroundColor=?,
495492
~bgColor=?,
496493
~opacity=?,
@@ -662,7 +659,6 @@ let makeProps = (
662659
/**
663660
Component Props {Box}
664661
**/
665-
~isTruncated=?isTruncated->Bool.fromOption,
666662
/**
667663
Margin and Padding
668664
**/
@@ -688,7 +684,6 @@ let makeProps = (
688684
Colors and Background Color
689685
**/
690686
~color=?color->Color.fromOption,
691-
~colorScheme=?colorScheme->ColorScheme.fromOption,
692687
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
693688
~opacity=?opacity->Opacity.fromOption,
694689
/**

src/Components/Chakra__Button.res

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ external make: (
66
/**
77
Component Props {Button}
88
**/
9-
~as_: string=?,
10-
~isTruncated: Identity.t=?,
9+
~_as: string=?,
10+
~isTruncated: bool=?,
1111
~iconSpacing: Identity.t=?,
1212
~isActive: Identity.t=?,
1313
~isDisabled: Identity.t=?,
@@ -46,7 +46,7 @@ external make: (
4646
Colors and BackgroundColor
4747
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
4848
**/
49-
~colorScheme: Identity.t=?,
49+
~colorScheme: ColorScheme.t=?,
5050
~color: Identity.t=?,
5151
~backgroundColor: Identity.t=?,
5252
~opacity: Identity.t=?,
@@ -462,7 +462,6 @@ let makeProps = (
462462
/**
463463
Component Props {Button}
464464
**/
465-
~isTruncated=?,
466465
~iconSpacing=?,
467466
~isActive=?,
468467
~isDisabled=?,
@@ -511,7 +510,6 @@ let makeProps = (
511510
Colors and BackgroundColor
512511
**/
513512
~color=?,
514-
~colorScheme=?,
515513
~backgroundColor=?,
516514
~bgColor=?,
517515
~opacity=?,
@@ -683,7 +681,6 @@ let makeProps = (
683681
/**
684682
Component Props {Button}
685683
**/
686-
~isTruncated=?isTruncated->Bool.fromOption,
687684
~iconSpacing=?iconSpacing->Margin.fromOption,
688685
~isActive=?isActive->Bool.fromOption,
689686
~isDisabled=?isDisabled->Bool.fromOption,
@@ -718,7 +715,6 @@ let makeProps = (
718715
Colors and Background Color
719716
**/
720717
~color=?color->Color.fromOption,
721-
~colorScheme=?colorScheme->ColorScheme.fromOption,
722718
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
723719
~opacity=?opacity->Opacity.fromOption,
724720
/**

src/Components/Chakra__ButtonGroup.res

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ external make: (
66
/**
77
Component Props {ButtonGroup}
88
**/
9-
~as_: string=?,
10-
~isTruncated: Identity.t=?,
9+
~_as: string=?,
10+
~isTruncated: bool=?,
1111
~isAttached: Identity.t=?,
1212
~isDisabled: Identity.t=?,
1313
~size: Identity.t=?,
@@ -39,7 +39,7 @@ external make: (
3939
Colors and BackgroundColor
4040
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
4141
**/
42-
~colorScheme: Identity.t=?,
42+
~colorScheme: ColorScheme.t=?,
4343
~color: Identity.t=?,
4444
~backgroundColor: Identity.t=?,
4545
~opacity: Identity.t=?,
@@ -455,7 +455,6 @@ let makeProps = (
455455
/**
456456
Component Props {ButtonGroup}
457457
**/
458-
~isTruncated=?,
459458
~isAttached=?,
460459
~isDisabled=?,
461460
~size=?,
@@ -500,7 +499,6 @@ let makeProps = (
500499
Colors and BackgroundColor
501500
**/
502501
~color=?,
503-
~colorScheme=?,
504502
~backgroundColor=?,
505503
~bgColor=?,
506504
~opacity=?,
@@ -672,7 +670,6 @@ let makeProps = (
672670
/**
673671
Component Props {ButtonGroup}
674672
**/
675-
~isTruncated=?isTruncated->Bool.fromOption,
676673
~isAttached=?isAttached->Bool.fromOption,
677674
~isDisabled=?isDisabled->Bool.fromOption,
678675
~size=?size->Button.Size.fromOption,
@@ -703,7 +700,6 @@ let makeProps = (
703700
Colors and Background Color
704701
**/
705702
~color=?color->Color.fromOption,
706-
~colorScheme=?colorScheme->ColorScheme.fromOption,
707703
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
708704
~opacity=?opacity->Opacity.fromOption,
709705
/**

src/Components/Chakra__Center.res

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ external make: (
66
/**
77
Component Props {Center}
88
**/
9-
~as_: string=?,
10-
~isTruncated: Identity.t=?,
9+
~_as: string=?,
10+
~isTruncated: bool=?,
1111
/**
1212
Margin and Padding
1313
@see <https://chakra-ui.com/docs/features/style-props#margin-and-padding>
@@ -34,7 +34,7 @@ external make: (
3434
Colors and BackgroundColor
3535
@see <https://chakra-ui.com/docs/features/style-props#color-and-background-color>
3636
**/
37-
~colorScheme: Identity.t=?,
37+
~colorScheme: ColorScheme.t=?,
3838
~color: Identity.t=?,
3939
~backgroundColor: Identity.t=?,
4040
~opacity: Identity.t=?,
@@ -450,7 +450,6 @@ let makeProps = (
450450
/**
451451
Component Props {Center}
452452
**/
453-
~isTruncated=?,
454453
/**
455454
Margin and Padding
456455
**/
@@ -490,7 +489,6 @@ let makeProps = (
490489
Colors and BackgroundColor
491490
**/
492491
~color=?,
493-
~colorScheme=?,
494492
~backgroundColor=?,
495493
~bgColor=?,
496494
~opacity=?,
@@ -662,7 +660,6 @@ let makeProps = (
662660
/**
663661
Component Props {Center}
664662
**/
665-
~isTruncated=?isTruncated->Bool.fromOption,
666663
/**
667664
Margin and Padding
668665
**/
@@ -688,7 +685,6 @@ let makeProps = (
688685
Colors and Background Color
689686
**/
690687
~color=?color->Color.fromOption,
691-
~colorScheme=?colorScheme->ColorScheme.fromOption,
692688
~backgroundColor=?bgColor->withShorthand(backgroundColor)->BackgroundColor.fromOption,
693689
~opacity=?opacity->Opacity.fromOption,
694690
/**

0 commit comments

Comments
 (0)