@hero-design/rn 8.6.1 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  3. package/es/index.js +444 -412
  4. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  5. package/lib/index.js +444 -411
  6. package/package.json +5 -5
  7. package/src/components/Carousel/StyledCarousel.tsx +5 -0
  8. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +622 -6
  9. package/src/components/Carousel/__tests__/index.spec.tsx +3 -1
  10. package/src/components/Carousel/index.tsx +4 -4
  11. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  12. package/src/components/Icon/IconList.ts +7 -0
  13. package/src/components/PageControl/StyledPageControl.tsx +17 -0
  14. package/src/components/PageControl/__tests__/__snapshots__/index.spec.tsx.snap +58 -0
  15. package/src/components/PageControl/__tests__/index.spec.tsx +21 -0
  16. package/src/components/PageControl/index.tsx +75 -0
  17. package/src/components/Typography/Text/StyledText.tsx +1 -0
  18. package/src/components/Typography/Text/index.tsx +1 -0
  19. package/src/index.ts +2 -0
  20. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +20 -12
  21. package/src/theme/components/carousel.ts +1 -16
  22. package/src/theme/components/pageControl.ts +25 -0
  23. package/src/theme/components/typography.ts +2 -0
  24. package/src/theme/getTheme.ts +3 -0
  25. package/src/theme/global/borders.ts +4 -0
  26. package/types/components/Carousel/StyledCarousel.d.ts +5 -1
  27. package/types/components/Icon/IconList.d.ts +1 -1
  28. package/types/components/Icon/index.d.ts +1 -1
  29. package/types/components/Icon/utils.d.ts +1 -1
  30. package/types/components/{Carousel/CarouselPaginator/StyledCarouselPaginator.d.ts → PageControl/StyledPageControl.d.ts} +3 -3
  31. package/types/components/PageControl/index.d.ts +21 -0
  32. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  33. package/types/components/Typography/Text/index.d.ts +1 -1
  34. package/types/index.d.ts +2 -1
  35. package/types/theme/components/carousel.d.ts +0 -12
  36. package/types/theme/components/pageControl.d.ts +18 -0
  37. package/types/theme/components/typography.d.ts +2 -0
  38. package/types/theme/getTheme.d.ts +2 -0
  39. package/types/theme/global/borders.d.ts +2 -0
  40. package/src/components/Carousel/CarouselPaginator/StyledCarouselPaginator.tsx +0 -20
  41. package/src/components/Carousel/CarouselPaginator/index.tsx +0 -57
  42. package/types/components/Carousel/CarouselPaginator/index.d.ts +0 -7
@@ -551,9 +551,622 @@ exports[`Carousel renders basic carousel 1`] = `
551
551
  Object {
552
552
  "alignItems": "center",
553
553
  "flexDirection": "row",
554
- "marginStart": "auto",
555
554
  },
556
- undefined,
555
+ Array [
556
+ Object {
557
+ "marginStart": "auto",
558
+ },
559
+ undefined,
560
+ ],
561
+ ]
562
+ }
563
+ >
564
+ <View
565
+ collapsable={false}
566
+ style={
567
+ Object {
568
+ "backgroundColor": "#401960",
569
+ "borderRadius": 999,
570
+ "height": 8,
571
+ "marginHorizontal": 8,
572
+ "opacity": 1,
573
+ "width": 24,
574
+ }
575
+ }
576
+ testID="page-control-indicator0"
577
+ />
578
+ <View
579
+ collapsable={false}
580
+ style={
581
+ Object {
582
+ "backgroundColor": "#401960",
583
+ "borderRadius": 999,
584
+ "height": 8,
585
+ "marginHorizontal": 8,
586
+ "opacity": 0.5,
587
+ "width": 8,
588
+ }
589
+ }
590
+ testID="page-control-indicator1"
591
+ />
592
+ <View
593
+ collapsable={false}
594
+ style={
595
+ Object {
596
+ "backgroundColor": "#401960",
597
+ "borderRadius": 999,
598
+ "height": 8,
599
+ "marginHorizontal": 8,
600
+ "opacity": 0.5,
601
+ "width": 8,
602
+ }
603
+ }
604
+ testID="page-control-indicator2"
605
+ />
606
+ </View>
607
+ </View>
608
+ </View>
609
+ </View>
610
+ `;
611
+
612
+ exports[`Carousel should call skip call back when press skip 1`] = `
613
+ <View
614
+ testID="carousel"
615
+ >
616
+ <View
617
+ style={
618
+ Array [
619
+ Object {
620
+ "backgroundColor": "#ece8ef",
621
+ "bottom": 0,
622
+ "left": 0,
623
+ "position": "absolute",
624
+ "right": 0,
625
+ "top": 0,
626
+ },
627
+ undefined,
628
+ ]
629
+ }
630
+ themeSlideBackground="#ece8ef"
631
+ />
632
+ <View
633
+ style={
634
+ Array [
635
+ Object {
636
+ "flexGrow": 2,
637
+ "justifyContent": "space-between",
638
+ },
639
+ undefined,
640
+ ]
641
+ }
642
+ >
643
+ <RCTScrollView
644
+ bounces={false}
645
+ data={
646
+ Array [
647
+ Object {
648
+ "background": "#ece8ef",
649
+ "body": "Access your Work, Money and Benefits in the palm of your hand.",
650
+ "heading": "Welcome to the new Employment Hero app",
651
+ "image": "https://picsum.photos/800/1200",
652
+ },
653
+ Object {
654
+ "background": "#ccd2d3",
655
+ "body": "Our app now has a new bright clean modern look and feel with the same great features.",
656
+ "content": <Image
657
+ source={
658
+ Object {
659
+ "uri": "https://picsum.photos/30",
660
+ }
661
+ }
662
+ />,
663
+ "heading": "Same app with a new look!",
664
+ "image": "https://picsum.photos/800/1200",
665
+ },
666
+ Object {
667
+ "background": "#ccd2d3",
668
+ "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae pulvinar quam, ac facilisis massa. Aliquam facilisis nisi eu justo dignissim, vel tempus justo iaculis.",
669
+ "heading": "Easier to get around",
670
+ "image": "https://picsum.photos/800/1200",
671
+ },
672
+ ]
673
+ }
674
+ getItem={[Function]}
675
+ getItemCount={[Function]}
676
+ horizontal={true}
677
+ keyExtractor={[Function]}
678
+ onContentSizeChange={[Function]}
679
+ onLayout={[Function]}
680
+ onMomentumScrollBegin={[Function]}
681
+ onMomentumScrollEnd={[Function]}
682
+ onScroll={[Function]}
683
+ onScrollBeginDrag={[Function]}
684
+ onScrollEndDrag={[Function]}
685
+ onViewableItemsChanged={[Function]}
686
+ pagingEnabled={true}
687
+ removeClippedSubviews={false}
688
+ renderItem={[Function]}
689
+ scrollEventThrottle={32}
690
+ showsHorizontalScrollIndicator={false}
691
+ stickyHeaderIndices={Array []}
692
+ viewabilityConfig={
693
+ Object {
694
+ "viewAreaCoveragePercentThreshold": 50,
695
+ }
696
+ }
697
+ viewabilityConfigCallbackPairs={
698
+ Array [
699
+ Object {
700
+ "onViewableItemsChanged": [Function],
701
+ "viewabilityConfig": Object {
702
+ "viewAreaCoveragePercentThreshold": 50,
703
+ },
704
+ },
705
+ ]
706
+ }
707
+ >
708
+ <View>
709
+ <View
710
+ onLayout={[Function]}
711
+ style={
712
+ Array [
713
+ Object {
714
+ "flexDirection": "row",
715
+ },
716
+ null,
717
+ ]
718
+ }
719
+ >
720
+ <View
721
+ style={
722
+ Array [
723
+ Object {},
724
+ Object {
725
+ "width": 750,
726
+ },
727
+ ]
728
+ }
729
+ >
730
+ <Image
731
+ source={
732
+ Object {
733
+ "uri": "https://picsum.photos/800/1200",
734
+ }
735
+ }
736
+ style={
737
+ Array [
738
+ Object {
739
+ "borderRadius": 0,
740
+ "height": 72,
741
+ "width": 72,
742
+ },
743
+ Array [
744
+ Object {
745
+ "flex": 1,
746
+ "resizeMode": "contain",
747
+ "width": "100%",
748
+ },
749
+ undefined,
750
+ ],
751
+ ]
752
+ }
753
+ />
754
+ <View
755
+ marginTop="large"
756
+ paddingHorizontal="large"
757
+ style={
758
+ Array [
759
+ Object {
760
+ "marginTop": 24,
761
+ "paddingHorizontal": 24,
762
+ },
763
+ Array [
764
+ Object {
765
+ "minHeight": 250,
766
+ "width": 750,
767
+ },
768
+ undefined,
769
+ ],
770
+ ]
771
+ }
772
+ width={750}
773
+ >
774
+ <Text
775
+ style={
776
+ Array [
777
+ Object {
778
+ "color": "#001f23",
779
+ "fontFamily": "BeVietnamPro-Regular",
780
+ "fontSize": 14,
781
+ "letterSpacing": 0.42,
782
+ "lineHeight": 22,
783
+ },
784
+ Array [
785
+ Object {
786
+ "fontFamily": "RebondGrotesque-SemiBold",
787
+ "fontSize": 32,
788
+ "lineHeight": 44,
789
+ "marginBottom": 16,
790
+ "marginTop": 8,
791
+ },
792
+ undefined,
793
+ ],
794
+ ]
795
+ }
796
+ themeFontSize="medium"
797
+ themeFontWeight="regular"
798
+ themeIntent="body"
799
+ themeTypeface="neutral"
800
+ >
801
+ Welcome to the new Employment Hero app
802
+ </Text>
803
+ <Text
804
+ style={
805
+ Array [
806
+ Object {
807
+ "color": "#001f23",
808
+ "fontFamily": "BeVietnamPro-Regular",
809
+ "fontSize": 16,
810
+ "letterSpacing": 0.48,
811
+ "lineHeight": 24,
812
+ },
813
+ undefined,
814
+ ]
815
+ }
816
+ themeFontSize="large"
817
+ themeFontWeight="regular"
818
+ themeIntent="body"
819
+ themeTypeface="neutral"
820
+ >
821
+ Access your Work, Money and Benefits in the palm of your hand.
822
+ </Text>
823
+ </View>
824
+ </View>
825
+ </View>
826
+ <View
827
+ onLayout={[Function]}
828
+ style={
829
+ Array [
830
+ Object {
831
+ "flexDirection": "row",
832
+ },
833
+ null,
834
+ ]
835
+ }
836
+ >
837
+ <View
838
+ style={
839
+ Array [
840
+ Object {},
841
+ Object {
842
+ "width": 750,
843
+ },
844
+ ]
845
+ }
846
+ >
847
+ <Image
848
+ source={
849
+ Object {
850
+ "uri": "https://picsum.photos/800/1200",
851
+ }
852
+ }
853
+ style={
854
+ Array [
855
+ Object {
856
+ "borderRadius": 0,
857
+ "height": 72,
858
+ "width": 72,
859
+ },
860
+ Array [
861
+ Object {
862
+ "flex": 1,
863
+ "resizeMode": "contain",
864
+ "width": "100%",
865
+ },
866
+ undefined,
867
+ ],
868
+ ]
869
+ }
870
+ />
871
+ <View
872
+ marginTop="large"
873
+ paddingHorizontal="large"
874
+ style={
875
+ Array [
876
+ Object {
877
+ "marginTop": 24,
878
+ "paddingHorizontal": 24,
879
+ },
880
+ Array [
881
+ Object {
882
+ "minHeight": 250,
883
+ "width": 750,
884
+ },
885
+ undefined,
886
+ ],
887
+ ]
888
+ }
889
+ width={750}
890
+ >
891
+ <Image
892
+ source={
893
+ Object {
894
+ "uri": "https://picsum.photos/30",
895
+ }
896
+ }
897
+ style={
898
+ Array [
899
+ Object {
900
+ "borderRadius": 0,
901
+ "height": 72,
902
+ "width": 72,
903
+ },
904
+ undefined,
905
+ ]
906
+ }
907
+ />
908
+ <Text
909
+ style={
910
+ Array [
911
+ Object {
912
+ "color": "#001f23",
913
+ "fontFamily": "BeVietnamPro-Regular",
914
+ "fontSize": 14,
915
+ "letterSpacing": 0.42,
916
+ "lineHeight": 22,
917
+ },
918
+ Array [
919
+ Object {
920
+ "fontFamily": "RebondGrotesque-SemiBold",
921
+ "fontSize": 32,
922
+ "lineHeight": 44,
923
+ "marginBottom": 16,
924
+ "marginTop": 8,
925
+ },
926
+ undefined,
927
+ ],
928
+ ]
929
+ }
930
+ themeFontSize="medium"
931
+ themeFontWeight="regular"
932
+ themeIntent="body"
933
+ themeTypeface="neutral"
934
+ >
935
+ Same app with a new look!
936
+ </Text>
937
+ <Text
938
+ style={
939
+ Array [
940
+ Object {
941
+ "color": "#001f23",
942
+ "fontFamily": "BeVietnamPro-Regular",
943
+ "fontSize": 16,
944
+ "letterSpacing": 0.48,
945
+ "lineHeight": 24,
946
+ },
947
+ undefined,
948
+ ]
949
+ }
950
+ themeFontSize="large"
951
+ themeFontWeight="regular"
952
+ themeIntent="body"
953
+ themeTypeface="neutral"
954
+ >
955
+ Our app now has a new bright clean modern look and feel with the same great features.
956
+ </Text>
957
+ </View>
958
+ </View>
959
+ </View>
960
+ <View
961
+ onLayout={[Function]}
962
+ style={
963
+ Array [
964
+ Object {
965
+ "flexDirection": "row",
966
+ },
967
+ null,
968
+ ]
969
+ }
970
+ >
971
+ <View
972
+ style={
973
+ Array [
974
+ Object {},
975
+ Object {
976
+ "width": 750,
977
+ },
978
+ ]
979
+ }
980
+ >
981
+ <Image
982
+ source={
983
+ Object {
984
+ "uri": "https://picsum.photos/800/1200",
985
+ }
986
+ }
987
+ style={
988
+ Array [
989
+ Object {
990
+ "borderRadius": 0,
991
+ "height": 72,
992
+ "width": 72,
993
+ },
994
+ Array [
995
+ Object {
996
+ "flex": 1,
997
+ "resizeMode": "contain",
998
+ "width": "100%",
999
+ },
1000
+ undefined,
1001
+ ],
1002
+ ]
1003
+ }
1004
+ />
1005
+ <View
1006
+ marginTop="large"
1007
+ paddingHorizontal="large"
1008
+ style={
1009
+ Array [
1010
+ Object {
1011
+ "marginTop": 24,
1012
+ "paddingHorizontal": 24,
1013
+ },
1014
+ Array [
1015
+ Object {
1016
+ "minHeight": 250,
1017
+ "width": 750,
1018
+ },
1019
+ undefined,
1020
+ ],
1021
+ ]
1022
+ }
1023
+ width={750}
1024
+ >
1025
+ <Text
1026
+ style={
1027
+ Array [
1028
+ Object {
1029
+ "color": "#001f23",
1030
+ "fontFamily": "BeVietnamPro-Regular",
1031
+ "fontSize": 14,
1032
+ "letterSpacing": 0.42,
1033
+ "lineHeight": 22,
1034
+ },
1035
+ Array [
1036
+ Object {
1037
+ "fontFamily": "RebondGrotesque-SemiBold",
1038
+ "fontSize": 32,
1039
+ "lineHeight": 44,
1040
+ "marginBottom": 16,
1041
+ "marginTop": 8,
1042
+ },
1043
+ undefined,
1044
+ ],
1045
+ ]
1046
+ }
1047
+ themeFontSize="medium"
1048
+ themeFontWeight="regular"
1049
+ themeIntent="body"
1050
+ themeTypeface="neutral"
1051
+ >
1052
+ Easier to get around
1053
+ </Text>
1054
+ <Text
1055
+ style={
1056
+ Array [
1057
+ Object {
1058
+ "color": "#001f23",
1059
+ "fontFamily": "BeVietnamPro-Regular",
1060
+ "fontSize": 16,
1061
+ "letterSpacing": 0.48,
1062
+ "lineHeight": 24,
1063
+ },
1064
+ undefined,
1065
+ ]
1066
+ }
1067
+ themeFontSize="large"
1068
+ themeFontWeight="regular"
1069
+ themeIntent="body"
1070
+ themeTypeface="neutral"
1071
+ >
1072
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae pulvinar quam, ac facilisis massa. Aliquam facilisis nisi eu justo dignissim, vel tempus justo iaculis.
1073
+ </Text>
1074
+ </View>
1075
+ </View>
1076
+ </View>
1077
+ </View>
1078
+ </RCTScrollView>
1079
+ <View
1080
+ style={
1081
+ Array [
1082
+ Object {
1083
+ "flexDirection": "row",
1084
+ "justifyContent": "space-between",
1085
+ "marginBottom": 24,
1086
+ "paddingHorizontal": 24,
1087
+ "paddingVertical": 16,
1088
+ },
1089
+ undefined,
1090
+ ]
1091
+ }
1092
+ >
1093
+ <View
1094
+ accessibilityState={
1095
+ Object {
1096
+ "disabled": false,
1097
+ }
1098
+ }
1099
+ accessible={true}
1100
+ collapsable={false}
1101
+ focusable={true}
1102
+ onClick={[Function]}
1103
+ onResponderGrant={[Function]}
1104
+ onResponderMove={[Function]}
1105
+ onResponderRelease={[Function]}
1106
+ onResponderTerminate={[Function]}
1107
+ onResponderTerminationRequest={[Function]}
1108
+ onStartShouldSetResponder={[Function]}
1109
+ style={
1110
+ Object {
1111
+ "alignItems": "center",
1112
+ "alignSelf": "stretch",
1113
+ "backgroundColor": "#401960",
1114
+ "borderRadius": 32,
1115
+ "flexDirection": "row",
1116
+ "justifyContent": "center",
1117
+ "opacity": 1,
1118
+ "padding": 16,
1119
+ }
1120
+ }
1121
+ >
1122
+ <Text
1123
+ disabled={false}
1124
+ ellipsizeMode="tail"
1125
+ numberOfLines={1}
1126
+ style={
1127
+ Array [
1128
+ Object {
1129
+ "color": "#001f23",
1130
+ "fontFamily": "BeVietnamPro-Regular",
1131
+ "fontSize": 14,
1132
+ "letterSpacing": 0.42,
1133
+ "lineHeight": 22,
1134
+ },
1135
+ Array [
1136
+ Object {
1137
+ "color": "#ffffff",
1138
+ "flexShrink": 1,
1139
+ "fontFamily": "BeVietnamPro-SemiBold",
1140
+ "fontSize": 18,
1141
+ "lineHeight": 24,
1142
+ "textAlign": "center",
1143
+ },
1144
+ undefined,
1145
+ ],
1146
+ ]
1147
+ }
1148
+ themeFontSize="medium"
1149
+ themeFontWeight="regular"
1150
+ themeIntent="body"
1151
+ themeTypeface="neutral"
1152
+ themeVariant="filled-primary"
1153
+ >
1154
+ Skip
1155
+ </Text>
1156
+ </View>
1157
+ <View
1158
+ style={
1159
+ Array [
1160
+ Object {
1161
+ "alignItems": "center",
1162
+ "flexDirection": "row",
1163
+ },
1164
+ Array [
1165
+ Object {
1166
+ "marginStart": "auto",
1167
+ },
1168
+ undefined,
1169
+ ],
557
1170
  ]
558
1171
  }
559
1172
  >
@@ -565,10 +1178,11 @@ exports[`Carousel renders basic carousel 1`] = `
565
1178
  "borderRadius": 999,
566
1179
  "height": 8,
567
1180
  "marginHorizontal": 8,
568
- "opacity": 0.9993342210386151,
569
- "width": 23.978695073235684,
1181
+ "opacity": 1,
1182
+ "width": 24,
570
1183
  }
571
1184
  }
1185
+ testID="page-control-indicator0"
572
1186
  />
573
1187
  <View
574
1188
  collapsable={false}
@@ -578,10 +1192,11 @@ exports[`Carousel renders basic carousel 1`] = `
578
1192
  "borderRadius": 999,
579
1193
  "height": 8,
580
1194
  "marginHorizontal": 8,
581
- "opacity": 0.5006666666666667,
582
- "width": 8.021333333333333,
1195
+ "opacity": 0.5,
1196
+ "width": 8,
583
1197
  }
584
1198
  }
1199
+ testID="page-control-indicator1"
585
1200
  />
586
1201
  <View
587
1202
  collapsable={false}
@@ -595,6 +1210,7 @@ exports[`Carousel renders basic carousel 1`] = `
595
1210
  "width": 8,
596
1211
  }
597
1212
  }
1213
+ testID="page-control-indicator2"
598
1214
  />
599
1215
  </View>
600
1216
  </View>
@@ -76,7 +76,7 @@ describe('Carousel', () => {
76
76
  it('should call skip call back when press skip', () => {
77
77
  const onSkip = jest.fn();
78
78
 
79
- const { queryByText } = renderWithTheme(
79
+ const { queryByText, toJSON } = renderWithTheme(
80
80
  <Carousel
81
81
  testID="carousel"
82
82
  items={carouselData}
@@ -86,6 +86,8 @@ describe('Carousel', () => {
86
86
  />
87
87
  );
88
88
 
89
+ expect(toJSON()).toMatchSnapshot();
90
+
89
91
  expect(queryByText('Skip')).toBeTruthy();
90
92
 
91
93
  fireEvent.press(queryByText('Skip'));
@@ -17,11 +17,11 @@ import {
17
17
  } from 'react-native';
18
18
 
19
19
  import { CarouselData } from './types';
20
- import CarouselPaginator from './CarouselPaginator';
21
20
  import {
22
21
  StyledBackDrop,
23
22
  StyledCarouselFooterWrapper,
24
23
  StyledCarouselView,
24
+ StyledPageControl,
25
25
  } from './StyledCarousel';
26
26
  import CarouselItem from './CarouselItem';
27
27
 
@@ -153,9 +153,9 @@ const Carousel = ({
153
153
  <StyledCarouselFooterWrapper>
154
154
  {renderActions && renderActions(currentSlideIndex)}
155
155
  {shouldShowPagination(currentSlideIndex) && (
156
- <CarouselPaginator
157
- numberOfSlides={items.length}
158
- scrollX={scrollX}
156
+ <StyledPageControl
157
+ numberOfPages={items.length}
158
+ currentPage={currentSlideIndex}
159
159
  />
160
160
  )}
161
161
  </StyledCarouselFooterWrapper>