@hero-design/rn 8.51.0 → 8.52.1

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 (39) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +20 -0
  3. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  4. package/es/index.js +258 -254
  5. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  6. package/lib/index.js +258 -254
  7. package/package.json +1 -1
  8. package/src/components/Carousel/CardCarousel.tsx +1 -5
  9. package/src/components/Carousel/StyledCardCarousel.tsx +1 -16
  10. package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +92 -172
  11. package/src/components/Carousel/__tests__/index.spec.tsx +14 -0
  12. package/src/components/Carousel/index.tsx +15 -14
  13. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +6 -3
  14. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +2 -1
  15. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +2 -1
  16. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +2 -1
  17. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  18. package/src/components/Icon/IconList.ts +4 -0
  19. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -2
  20. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +12 -6
  21. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +10 -5
  22. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +90 -54
  23. package/src/components/Swipeable/index.tsx +31 -17
  24. package/src/components/TextInput/StyledTextInput.tsx +3 -4
  25. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +0 -10
  26. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +34 -25
  27. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +4 -2
  28. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +4 -2
  29. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -12
  30. package/src/theme/components/cardCarousel.ts +1 -8
  31. package/src/theme/components/swipeable.ts +6 -1
  32. package/src/theme/components/textInput.ts +1 -2
  33. package/types/components/Carousel/StyledCardCarousel.d.ts +1 -7
  34. package/types/components/Icon/IconList.d.ts +1 -1
  35. package/types/components/Icon/index.d.ts +1 -1
  36. package/types/components/Icon/utils.d.ts +1 -1
  37. package/types/theme/components/cardCarousel.d.ts +0 -10
  38. package/types/theme/components/swipeable.d.ts +4 -0
  39. package/types/theme/components/textInput.d.ts +1 -2
@@ -218,7 +218,7 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
218
218
  [
219
219
  {
220
220
  "minHeight": 16,
221
- "paddingLeft": 16,
221
+ "paddingHorizontal": 16,
222
222
  "paddingTop": 2,
223
223
  },
224
224
  undefined,
@@ -229,6 +229,7 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
229
229
  style={
230
230
  [
231
231
  {
232
+ "alignItems": "flex-start",
232
233
  "flexDirection": "row",
233
234
  "justifyContent": "space-between",
234
235
  },
@@ -535,7 +536,7 @@ exports[`RichTextEditor should render correctly 1`] = `
535
536
  [
536
537
  {
537
538
  "minHeight": 16,
538
- "paddingLeft": 16,
539
+ "paddingHorizontal": 16,
539
540
  "paddingTop": 2,
540
541
  },
541
542
  undefined,
@@ -546,6 +547,7 @@ exports[`RichTextEditor should render correctly 1`] = `
546
547
  style={
547
548
  [
548
549
  {
550
+ "alignItems": "flex-start",
549
551
  "flexDirection": "row",
550
552
  "justifyContent": "space-between",
551
553
  },
@@ -239,7 +239,7 @@ exports[`rendering allows custom renderer 1`] = `
239
239
  [
240
240
  {
241
241
  "minHeight": 16,
242
- "paddingLeft": 16,
242
+ "paddingHorizontal": 16,
243
243
  "paddingTop": 2,
244
244
  },
245
245
  undefined,
@@ -250,6 +250,7 @@ exports[`rendering allows custom renderer 1`] = `
250
250
  style={
251
251
  [
252
252
  {
253
+ "alignItems": "flex-start",
253
254
  "flexDirection": "row",
254
255
  "justifyContent": "space-between",
255
256
  },
@@ -1770,7 +1771,7 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
1770
1771
  [
1771
1772
  {
1772
1773
  "minHeight": 16,
1773
- "paddingLeft": 16,
1774
+ "paddingHorizontal": 16,
1774
1775
  "paddingTop": 2,
1775
1776
  },
1776
1777
  undefined,
@@ -1781,6 +1782,7 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
1781
1782
  style={
1782
1783
  [
1783
1784
  {
1785
+ "alignItems": "flex-start",
1784
1786
  "flexDirection": "row",
1785
1787
  "justifyContent": "space-between",
1786
1788
  },
@@ -2061,7 +2063,7 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
2061
2063
  [
2062
2064
  {
2063
2065
  "minHeight": 16,
2064
- "paddingLeft": 16,
2066
+ "paddingHorizontal": 16,
2065
2067
  "paddingTop": 2,
2066
2068
  },
2067
2069
  undefined,
@@ -2072,6 +2074,7 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
2072
2074
  style={
2073
2075
  [
2074
2076
  {
2077
+ "alignItems": "flex-start",
2075
2078
  "flexDirection": "row",
2076
2079
  "justifyContent": "space-between",
2077
2080
  },
@@ -3811,7 +3814,7 @@ exports[`rendering renders correctly when input is loading 1`] = `
3811
3814
  [
3812
3815
  {
3813
3816
  "minHeight": 16,
3814
- "paddingLeft": 16,
3817
+ "paddingHorizontal": 16,
3815
3818
  "paddingTop": 2,
3816
3819
  },
3817
3820
  undefined,
@@ -3822,6 +3825,7 @@ exports[`rendering renders correctly when input is loading 1`] = `
3822
3825
  style={
3823
3826
  [
3824
3827
  {
3828
+ "alignItems": "flex-start",
3825
3829
  "flexDirection": "row",
3826
3830
  "justifyContent": "space-between",
3827
3831
  },
@@ -4102,7 +4106,7 @@ exports[`rendering renders correctly when receives sections 1`] = `
4102
4106
  [
4103
4107
  {
4104
4108
  "minHeight": 16,
4105
- "paddingLeft": 16,
4109
+ "paddingHorizontal": 16,
4106
4110
  "paddingTop": 2,
4107
4111
  },
4108
4112
  undefined,
@@ -4113,6 +4117,7 @@ exports[`rendering renders correctly when receives sections 1`] = `
4113
4117
  style={
4114
4118
  [
4115
4119
  {
4120
+ "alignItems": "flex-start",
4116
4121
  "flexDirection": "row",
4117
4122
  "justifyContent": "space-between",
4118
4123
  },
@@ -5419,7 +5424,7 @@ exports[`rendering renders correctly when receives sections 2`] = `
5419
5424
  [
5420
5425
  {
5421
5426
  "minHeight": 16,
5422
- "paddingLeft": 16,
5427
+ "paddingHorizontal": 16,
5423
5428
  "paddingTop": 2,
5424
5429
  },
5425
5430
  undefined,
@@ -5430,6 +5435,7 @@ exports[`rendering renders correctly when receives sections 2`] = `
5430
5435
  style={
5431
5436
  [
5432
5437
  {
5438
+ "alignItems": "flex-start",
5433
5439
  "flexDirection": "row",
5434
5440
  "justifyContent": "space-between",
5435
5441
  },
@@ -238,7 +238,7 @@ exports[`rendering allows custom renderer 1`] = `
238
238
  [
239
239
  {
240
240
  "minHeight": 16,
241
- "paddingLeft": 16,
241
+ "paddingHorizontal": 16,
242
242
  "paddingTop": 2,
243
243
  },
244
244
  undefined,
@@ -249,6 +249,7 @@ exports[`rendering allows custom renderer 1`] = `
249
249
  style={
250
250
  [
251
251
  {
252
+ "alignItems": "flex-start",
252
253
  "flexDirection": "row",
253
254
  "justifyContent": "space-between",
254
255
  },
@@ -1685,7 +1686,7 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
1685
1686
  [
1686
1687
  {
1687
1688
  "minHeight": 16,
1688
- "paddingLeft": 16,
1689
+ "paddingHorizontal": 16,
1689
1690
  "paddingTop": 2,
1690
1691
  },
1691
1692
  undefined,
@@ -1696,6 +1697,7 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
1696
1697
  style={
1697
1698
  [
1698
1699
  {
1700
+ "alignItems": "flex-start",
1699
1701
  "flexDirection": "row",
1700
1702
  "justifyContent": "space-between",
1701
1703
  },
@@ -1976,7 +1978,7 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
1976
1978
  [
1977
1979
  {
1978
1980
  "minHeight": 16,
1979
- "paddingLeft": 16,
1981
+ "paddingHorizontal": 16,
1980
1982
  "paddingTop": 2,
1981
1983
  },
1982
1984
  undefined,
@@ -1987,6 +1989,7 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
1987
1989
  style={
1988
1990
  [
1989
1991
  {
1992
+ "alignItems": "flex-start",
1990
1993
  "flexDirection": "row",
1991
1994
  "justifyContent": "space-between",
1992
1995
  },
@@ -3586,7 +3589,7 @@ exports[`rendering renders correctly when input is loading 1`] = `
3586
3589
  [
3587
3590
  {
3588
3591
  "minHeight": 16,
3589
- "paddingLeft": 16,
3592
+ "paddingHorizontal": 16,
3590
3593
  "paddingTop": 2,
3591
3594
  },
3592
3595
  undefined,
@@ -3597,6 +3600,7 @@ exports[`rendering renders correctly when input is loading 1`] = `
3597
3600
  style={
3598
3601
  [
3599
3602
  {
3603
+ "alignItems": "flex-start",
3600
3604
  "flexDirection": "row",
3601
3605
  "justifyContent": "space-between",
3602
3606
  },
@@ -3877,7 +3881,7 @@ exports[`rendering renders correctly when receives sections 1`] = `
3877
3881
  [
3878
3882
  {
3879
3883
  "minHeight": 16,
3880
- "paddingLeft": 16,
3884
+ "paddingHorizontal": 16,
3881
3885
  "paddingTop": 2,
3882
3886
  },
3883
3887
  undefined,
@@ -3888,6 +3892,7 @@ exports[`rendering renders correctly when receives sections 1`] = `
3888
3892
  style={
3889
3893
  [
3890
3894
  {
3895
+ "alignItems": "flex-start",
3891
3896
  "flexDirection": "row",
3892
3897
  "justifyContent": "space-between",
3893
3898
  },
@@ -10,37 +10,55 @@ exports[`Swipeable renders correctly with variant=card 1`] = `
10
10
  >
11
11
  <View>
12
12
  <View
13
- containerStyle={
14
- {
15
- "borderRadius": 8,
16
- }
13
+ onLayout={[Function]}
14
+ style={
15
+ [
16
+ {},
17
+ undefined,
18
+ ]
17
19
  }
18
- onSwipeableClose={[Function]}
19
- onSwipeableLeftOpen={[Function]}
20
- onSwipeableRightOpen={[Function]}
21
- renderLeftActions={[Function]}
22
- renderRightActions={[Function]}
23
20
  >
24
- <Text
25
- allowFontScaling={false}
26
- style={
27
- [
28
- {
29
- "color": "#001f23",
30
- "fontFamily": "BeVietnamPro-Regular",
31
- "fontSize": 14,
32
- "letterSpacing": 0.48,
33
- "lineHeight": 22,
34
- },
35
- undefined,
36
- ]
21
+ <View
22
+ childrenContainerStyle={
23
+ {
24
+ "backgroundColor": "#ffffff",
25
+ "borderRadius": 8,
26
+ "position": "relative",
27
+ "width": 4,
28
+ }
29
+ }
30
+ containerStyle={
31
+ {
32
+ "borderRadius": 8,
33
+ }
37
34
  }
38
- themeIntent="body"
39
- themeTypeface="neutral"
40
- themeVariant="small"
35
+ onSwipeableClose={[Function]}
36
+ onSwipeableLeftOpen={[Function]}
37
+ onSwipeableRightOpen={[Function]}
38
+ renderLeftActions={[Function]}
39
+ renderRightActions={[Function]}
41
40
  >
42
- Swipeable Item
43
- </Text>
41
+ <Text
42
+ allowFontScaling={false}
43
+ style={
44
+ [
45
+ {
46
+ "color": "#001f23",
47
+ "fontFamily": "BeVietnamPro-Regular",
48
+ "fontSize": 14,
49
+ "letterSpacing": 0.48,
50
+ "lineHeight": 22,
51
+ },
52
+ undefined,
53
+ ]
54
+ }
55
+ themeIntent="body"
56
+ themeTypeface="neutral"
57
+ themeVariant="small"
58
+ >
59
+ Swipeable Item
60
+ </Text>
61
+ </View>
44
62
  </View>
45
63
  </View>
46
64
  <View
@@ -76,37 +94,55 @@ exports[`Swipeable renders correctly with variant=full-width 1`] = `
76
94
  >
77
95
  <View>
78
96
  <View
79
- containerStyle={
80
- {
81
- "borderRadius": 0,
82
- }
97
+ onLayout={[Function]}
98
+ style={
99
+ [
100
+ {},
101
+ undefined,
102
+ ]
83
103
  }
84
- onSwipeableClose={[Function]}
85
- onSwipeableLeftOpen={[Function]}
86
- onSwipeableRightOpen={[Function]}
87
- renderLeftActions={[Function]}
88
- renderRightActions={[Function]}
89
104
  >
90
- <Text
91
- allowFontScaling={false}
92
- style={
93
- [
94
- {
95
- "color": "#001f23",
96
- "fontFamily": "BeVietnamPro-Regular",
97
- "fontSize": 14,
98
- "letterSpacing": 0.48,
99
- "lineHeight": 22,
100
- },
101
- undefined,
102
- ]
105
+ <View
106
+ childrenContainerStyle={
107
+ {
108
+ "backgroundColor": "#ffffff",
109
+ "borderRadius": 8,
110
+ "position": "relative",
111
+ "width": 4,
112
+ }
113
+ }
114
+ containerStyle={
115
+ {
116
+ "borderRadius": 0,
117
+ }
103
118
  }
104
- themeIntent="body"
105
- themeTypeface="neutral"
106
- themeVariant="small"
119
+ onSwipeableClose={[Function]}
120
+ onSwipeableLeftOpen={[Function]}
121
+ onSwipeableRightOpen={[Function]}
122
+ renderLeftActions={[Function]}
123
+ renderRightActions={[Function]}
107
124
  >
108
- Swipeable Item
109
- </Text>
125
+ <Text
126
+ allowFontScaling={false}
127
+ style={
128
+ [
129
+ {
130
+ "color": "#001f23",
131
+ "fontFamily": "BeVietnamPro-Regular",
132
+ "fontSize": 14,
133
+ "letterSpacing": 0.48,
134
+ "lineHeight": 22,
135
+ },
136
+ undefined,
137
+ ]
138
+ }
139
+ themeIntent="body"
140
+ themeTypeface="neutral"
141
+ themeVariant="small"
142
+ >
143
+ Swipeable Item
144
+ </Text>
145
+ </View>
110
146
  </View>
111
147
  </View>
112
148
  <View
@@ -13,6 +13,7 @@ import {
13
13
  } from 'react-native-gesture-handler';
14
14
  import SwipeableAction from './SwipeableAction';
15
15
  import { useTheme } from '../../theme';
16
+ import Box from '../Box';
16
17
 
17
18
  type State = 'closed' | 'leftOpen' | 'rightOpen';
18
19
  // We are supporting both v1 and v2 of RNGH at the same time.
@@ -90,6 +91,8 @@ const renderActions = (
90
91
  width,
91
92
  flexDirection: 'row',
92
93
  transform: [{ translateX: trans }],
94
+ zIndex: -99,
95
+ position: 'relative',
93
96
  }}
94
97
  >
95
98
  {actions}
@@ -111,6 +114,7 @@ const Swipeable = ({
111
114
  const theme = useTheme();
112
115
  const { width } = useWindowDimensions();
113
116
  const swipeableRef = useRef<RnghSwipeable>(null);
117
+ const [containerWidth, setContainerWidth] = React.useState(0);
114
118
 
115
119
  const renderLeftActions = useCallback(
116
120
  (progress: Animated.AnimatedInterpolation<string | number>) =>
@@ -146,23 +150,33 @@ const Swipeable = ({
146
150
 
147
151
  return (
148
152
  <GestureHandlerRootView>
149
- <RnghSwipeable
150
- {...swipeableProps}
151
- ref={swipeableRef}
152
- {...(leftActions !== undefined && { renderLeftActions })}
153
- {...(rightActions !== undefined && { renderRightActions })}
154
- onSwipeableLeftOpen={() => onStateChange?.('leftOpen')}
155
- onSwipeableRightOpen={() => onStateChange?.('rightOpen')}
156
- onSwipeableClose={() => onStateChange?.('closed')}
157
- containerStyle={{
158
- borderRadius:
159
- variant === 'card'
160
- ? theme.__hd__.swipeable.radii.swipeableContainer
161
- : 0,
162
- }}
163
- >
164
- {children}
165
- </RnghSwipeable>
153
+ <Box onLayout={(e) => setContainerWidth(e.nativeEvent.layout.width)}>
154
+ <RnghSwipeable
155
+ {...swipeableProps}
156
+ ref={swipeableRef}
157
+ {...(leftActions !== undefined && { renderLeftActions })}
158
+ {...(rightActions !== undefined && { renderRightActions })}
159
+ onSwipeableLeftOpen={() => onStateChange?.('leftOpen')}
160
+ onSwipeableRightOpen={() => onStateChange?.('rightOpen')}
161
+ onSwipeableClose={() => onStateChange?.('closed')}
162
+ containerStyle={{
163
+ borderRadius:
164
+ variant === 'card'
165
+ ? theme.__hd__.swipeable.radii.swipeableContainer
166
+ : 0,
167
+ }}
168
+ childrenContainerStyle={{
169
+ backgroundColor:
170
+ theme.__hd__.swipeable.colors.defaultContainerBackground,
171
+ position: 'relative',
172
+ width:
173
+ containerWidth + theme.__hd__.swipeable.space.containerExtraWidth,
174
+ borderRadius: theme.__hd__.swipeable.radii.swipeableContainer,
175
+ }}
176
+ >
177
+ {children}
178
+ </RnghSwipeable>
179
+ </Box>
166
180
  </GestureHandlerRootView>
167
181
  );
168
182
  };
@@ -56,8 +56,6 @@ const StyledMaxLengthMessage = styled(Typography.Caption)<{
56
56
  themeState: State;
57
57
  }>(({ theme, themeState }) => ({
58
58
  color: theme.__hd__.textInput.colors.maxLengthLabels[themeState],
59
- marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
60
- alignSelf: 'flex-end',
61
59
  flex: 1,
62
60
  flexGrow: 1,
63
61
  textAlign: 'right',
@@ -112,8 +110,8 @@ const StyledTextInputAndLabelContainer = styled(View)(() => ({
112
110
  }));
113
111
 
114
112
  const StyledErrorAndHelpTextContainer = styled(View)(({ theme }) => ({
115
- paddingLeft:
116
- theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingLeft,
113
+ paddingHorizontal:
114
+ theme.__hd__.textInput.space.errorAndHelpTextContainerHorizontalPadding,
117
115
  minHeight: theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,
118
116
  paddingTop: theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingTop,
119
117
  }));
@@ -121,6 +119,7 @@ const StyledErrorAndHelpTextContainer = styled(View)(({ theme }) => ({
121
119
  const StyledErrorAndMaxLengthContainer = styled(View)(() => ({
122
120
  flexDirection: 'row',
123
121
  justifyContent: 'space-between',
122
+ alignItems: 'flex-start',
124
123
  }));
125
124
 
126
125
  export {
@@ -777,11 +777,9 @@ exports[`StyledMaxLengthMessage renders correctly with themeState default 1`] =
777
777
  },
778
778
  [
779
779
  {
780
- "alignSelf": "flex-end",
781
780
  "color": "#001f23",
782
781
  "flex": 1,
783
782
  "flexGrow": 1,
784
- "marginRight": 4,
785
783
  "textAlign": "right",
786
784
  },
787
785
  undefined,
@@ -838,11 +836,9 @@ exports[`StyledMaxLengthMessage renders correctly with themeState disabled 1`] =
838
836
  },
839
837
  [
840
838
  {
841
- "alignSelf": "flex-end",
842
839
  "color": "#bfc1c5",
843
840
  "flex": 1,
844
841
  "flexGrow": 1,
845
- "marginRight": 4,
846
842
  "textAlign": "right",
847
843
  },
848
844
  undefined,
@@ -899,11 +895,9 @@ exports[`StyledMaxLengthMessage renders correctly with themeState error 1`] = `
899
895
  },
900
896
  [
901
897
  {
902
- "alignSelf": "flex-end",
903
898
  "color": "#cb300a",
904
899
  "flex": 1,
905
900
  "flexGrow": 1,
906
- "marginRight": 4,
907
901
  "textAlign": "right",
908
902
  },
909
903
  undefined,
@@ -960,11 +954,9 @@ exports[`StyledMaxLengthMessage renders correctly with themeState filled 1`] = `
960
954
  },
961
955
  [
962
956
  {
963
- "alignSelf": "flex-end",
964
957
  "color": "#001f23",
965
958
  "flex": 1,
966
959
  "flexGrow": 1,
967
- "marginRight": 4,
968
960
  "textAlign": "right",
969
961
  },
970
962
  undefined,
@@ -1021,11 +1013,9 @@ exports[`StyledMaxLengthMessage renders correctly with themeState readonly 1`] =
1021
1013
  },
1022
1014
  [
1023
1015
  {
1024
- "alignSelf": "flex-end",
1025
1016
  "color": "#808f91",
1026
1017
  "flex": 1,
1027
1018
  "flexGrow": 1,
1028
- "marginRight": 4,
1029
1019
  "textAlign": "right",
1030
1020
  },
1031
1021
  undefined,