@hero-design/rn 8.56.1 → 8.57.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +31 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +5240 -4333
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +5239 -4332
- package/package.json +7 -6
- package/src/components/Button/StyledButton.tsx +16 -30
- package/src/components/Calendar/__tests__/index.spec.tsx +5 -5
- package/src/components/Carousel/CardCarousel.tsx +7 -10
- package/src/components/Carousel/__tests__/index.spec.tsx +14 -0
- package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +32 -29
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +4 -0
- package/src/components/PinInput/index.tsx +1 -1
- package/src/components/Tabs/SceneView.tsx +6 -4
- package/src/components/Tabs/ScrollableTabs.tsx +8 -2
- package/src/components/Tabs/{ScrollableTabsHeader.tsx → ScrollableTabsHeader/ScrollableTabsHeader.tsx} +73 -42
- package/src/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.ts +45 -0
- package/src/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.ts +91 -0
- package/src/components/Tabs/StyledScrollableTabs.tsx +14 -3
- package/src/components/Tabs/__tests__/ScrollableTabsHeader.spec.tsx +7 -3
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +42 -6
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +623 -3
- package/src/components/Tabs/__tests__/useInitHighlightedAnimation.spec.tsx +56 -0
- package/src/components/Tabs/__tests__/useInitUnderlinedAnimation.spec.tsx +65 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +148 -1
- package/src/components/TextInput/index.tsx +135 -57
- package/src/components/Toast/ToastContext.ts +20 -2
- package/src/components/Toast/ToastProvider.tsx +7 -4
- package/src/components/Typography/Body/__tests__/__snapshots__/StyledBody.tsx.snap +2 -2
- package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
- package/src/theme/components/typography.ts +1 -1
- package/types/components/Carousel/CardCarousel.d.ts +1 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Tabs/ScrollableTabs.d.ts +4 -1
- package/types/components/Tabs/{ScrollableTabsHeader.d.ts → ScrollableTabsHeader/ScrollableTabsHeader.d.ts} +7 -3
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.d.ts +9 -0
- package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.d.ts +10 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +5 -1
- package/types/components/Tabs/index.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +29 -1
- package/types/components/Toast/ToastContext.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.57.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
"@emotion/react": "^11.9.3",
|
|
25
25
|
"@hero-design/colors": "8.42.5",
|
|
26
26
|
"date-fns": "^2.16.1",
|
|
27
|
-
"events": "^3.2.0",
|
|
28
27
|
"hero-editor": "^1.9.21",
|
|
29
28
|
"nanoid": "^4.0.2"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|
|
32
|
-
"@hero-design/react-native-month-year-picker": "^8.42.
|
|
33
|
-
"@react-native-community/datetimepicker": "^3.5.2",
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.42.7",
|
|
32
|
+
"@react-native-community/datetimepicker": "^3.5.2 || ^7.2.0",
|
|
34
33
|
"@react-native-community/slider": "4.4.3",
|
|
35
34
|
"react": "18.2.0",
|
|
36
35
|
"react-native": "^0.71.0",
|
|
@@ -49,8 +48,8 @@
|
|
|
49
48
|
"@babel/runtime": "^7.20.0",
|
|
50
49
|
"@emotion/jest": "^11.11.0",
|
|
51
50
|
"@hero-design/eslint-plugin": "9.0.0",
|
|
52
|
-
"@hero-design/react-native-month-year-picker": "^8.42.
|
|
53
|
-
"@react-native-community/datetimepicker": "
|
|
51
|
+
"@hero-design/react-native-month-year-picker": "^8.42.7",
|
|
52
|
+
"@react-native-community/datetimepicker": "7.2.0",
|
|
54
53
|
"@react-native-community/slider": "4.4.3",
|
|
55
54
|
"@rollup/plugin-babel": "^5.3.1",
|
|
56
55
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
@@ -60,6 +59,7 @@
|
|
|
60
59
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
61
60
|
"@testing-library/jest-native": "^5.4.2",
|
|
62
61
|
"@testing-library/react-native": "^9.1.0",
|
|
62
|
+
"@types/events": "^3.0.3",
|
|
63
63
|
"@types/jest": "^29.5.3",
|
|
64
64
|
"@types/react": "^18.2.0",
|
|
65
65
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"jest-junit": "^16.0.0",
|
|
74
74
|
"prettier-config-hd": "8.42.4",
|
|
75
75
|
"react": "18.2.0",
|
|
76
|
+
"react-dom": "^18.2.0",
|
|
76
77
|
"react-native": "0.71.14",
|
|
77
78
|
"react-native-gesture-handler": "~2.5.0",
|
|
78
79
|
"react-native-linear-gradient": "^2.6.2",
|
|
@@ -79,21 +79,7 @@ const genOutlineContainerStyles = (
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
const
|
|
83
|
-
theme: Theme,
|
|
84
|
-
intent: Intent,
|
|
85
|
-
disabled?: boolean
|
|
86
|
-
): ReactNativeStyle => {
|
|
87
|
-
if (disabled) {
|
|
88
|
-
return {
|
|
89
|
-
color: theme.__hd__.button.colors.disabledText,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return { color: theme.__hd__.button.colors[intent] };
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const genTextVariantTextStyles = (
|
|
82
|
+
const genTextStyles = (
|
|
97
83
|
theme: Theme,
|
|
98
84
|
intent: Intent,
|
|
99
85
|
disabled?: boolean
|
|
@@ -156,17 +142,17 @@ const StyledButtonText = styled(Typography.Title)<{
|
|
|
156
142
|
color: theme.__hd__.button.colors.invertedText,
|
|
157
143
|
};
|
|
158
144
|
case 'outlined-primary':
|
|
159
|
-
return
|
|
145
|
+
return genTextStyles(theme, 'primary', disabled);
|
|
160
146
|
case 'outlined-secondary':
|
|
161
|
-
return
|
|
147
|
+
return genTextStyles(theme, 'secondary', disabled);
|
|
162
148
|
case 'outlined-danger':
|
|
163
|
-
return
|
|
149
|
+
return genTextStyles(theme, 'danger', disabled);
|
|
164
150
|
case 'text-primary':
|
|
165
|
-
return
|
|
151
|
+
return genTextStyles(theme, 'primary', disabled);
|
|
166
152
|
case 'text-secondary':
|
|
167
|
-
return
|
|
153
|
+
return genTextStyles(theme, 'secondary', disabled);
|
|
168
154
|
case 'text-danger':
|
|
169
|
-
return
|
|
155
|
+
return genTextStyles(theme, 'danger', disabled);
|
|
170
156
|
}
|
|
171
157
|
};
|
|
172
158
|
return {
|
|
@@ -183,11 +169,11 @@ const StyledButtonTitleOfVariantText = styled(Typography.Body)<{
|
|
|
183
169
|
const themeStyling = () => {
|
|
184
170
|
switch (themeButtonVariant) {
|
|
185
171
|
case 'text-primary':
|
|
186
|
-
return
|
|
172
|
+
return genTextStyles(theme, 'primary', disabled);
|
|
187
173
|
case 'text-secondary':
|
|
188
|
-
return
|
|
174
|
+
return genTextStyles(theme, 'secondary', disabled);
|
|
189
175
|
case 'text-danger':
|
|
190
|
-
return
|
|
176
|
+
return genTextStyles(theme, 'danger', disabled);
|
|
191
177
|
}
|
|
192
178
|
};
|
|
193
179
|
return {
|
|
@@ -220,17 +206,17 @@ const StyledButtonIcon = styled(Icon)<{
|
|
|
220
206
|
case 'filled-danger':
|
|
221
207
|
return { color: theme.__hd__.button.colors.invertedText };
|
|
222
208
|
case 'outlined-primary':
|
|
223
|
-
return
|
|
209
|
+
return genTextStyles(theme, 'primary', disabled);
|
|
224
210
|
case 'outlined-secondary':
|
|
225
|
-
return
|
|
211
|
+
return genTextStyles(theme, 'secondary', disabled);
|
|
226
212
|
case 'outlined-danger':
|
|
227
|
-
return
|
|
213
|
+
return genTextStyles(theme, 'danger', disabled);
|
|
228
214
|
case 'text-primary':
|
|
229
|
-
return
|
|
215
|
+
return genTextStyles(theme, 'primary', disabled);
|
|
230
216
|
case 'text-secondary':
|
|
231
|
-
return
|
|
217
|
+
return genTextStyles(theme, 'secondary', disabled);
|
|
232
218
|
case 'text-danger':
|
|
233
|
-
return
|
|
219
|
+
return genTextStyles(theme, 'danger', disabled);
|
|
234
220
|
}
|
|
235
221
|
};
|
|
236
222
|
|
|
@@ -114,9 +114,9 @@ describe('Calendar', () => {
|
|
|
114
114
|
platform
|
|
115
115
|
${'ios'}
|
|
116
116
|
${'android'}
|
|
117
|
-
`('renders correct picker on $platform', ({ platform }) => {
|
|
117
|
+
`('renders correct picker on $platform', ({ platform: mockedPlatform }) => {
|
|
118
118
|
jest.mock('react-native/Libraries/Utilities/Platform', () => ({
|
|
119
|
-
OS:
|
|
119
|
+
OS: mockedPlatform,
|
|
120
120
|
select: () => null,
|
|
121
121
|
}));
|
|
122
122
|
|
|
@@ -133,7 +133,7 @@ describe('Calendar', () => {
|
|
|
133
133
|
fireEvent.press(getByTestId('calendar-month-picker'));
|
|
134
134
|
|
|
135
135
|
// Pickers are mocked at packages/rn/testUtils/setup.tsx
|
|
136
|
-
if (
|
|
136
|
+
if (mockedPlatform === 'ios') {
|
|
137
137
|
expect(queryByText('IOS picker')).toBeDefined();
|
|
138
138
|
} else {
|
|
139
139
|
expect(queryByText('Android picker')).toBeDefined();
|
|
@@ -146,9 +146,9 @@ describe('Calendar', () => {
|
|
|
146
146
|
${'android'}
|
|
147
147
|
`(
|
|
148
148
|
'onToggleMonthPicker is called when toggling month year picker on $platform',
|
|
149
|
-
({ platform }) => {
|
|
149
|
+
({ platform: mockedPlatform }) => {
|
|
150
150
|
jest.mock('react-native/Libraries/Utilities/Platform', () => ({
|
|
151
|
-
OS:
|
|
151
|
+
OS: mockedPlatform,
|
|
152
152
|
select: () => null,
|
|
153
153
|
}));
|
|
154
154
|
|
|
@@ -67,6 +67,10 @@ export interface CardCarouselProps {
|
|
|
67
67
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
export const getCardCarouselValidIndex = (index: number, length: number) => {
|
|
71
|
+
return Math.min(Math.max(index, 0), length - 1);
|
|
72
|
+
};
|
|
73
|
+
|
|
70
74
|
export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
71
75
|
(
|
|
72
76
|
{
|
|
@@ -92,14 +96,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
92
96
|
Platform.OS === 'ios' ? VIEW_POSITION_CENTER : undefined;
|
|
93
97
|
const snapToIndex = useCallback(
|
|
94
98
|
(index: number) => {
|
|
95
|
-
|
|
96
|
-
if (index < 0) {
|
|
97
|
-
validIndex = 0;
|
|
98
|
-
} else if (index >= items.length) {
|
|
99
|
-
validIndex = items.length - 1;
|
|
100
|
-
} else {
|
|
101
|
-
validIndex = index;
|
|
102
|
-
}
|
|
99
|
+
const validIndex = getCardCarouselValidIndex(index, items.length);
|
|
103
100
|
|
|
104
101
|
carouselRef.current?.scrollToIndex({
|
|
105
102
|
index: validIndex,
|
|
@@ -107,7 +104,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
107
104
|
viewPosition,
|
|
108
105
|
});
|
|
109
106
|
},
|
|
110
|
-
[
|
|
107
|
+
[items.length, viewPosition]
|
|
111
108
|
);
|
|
112
109
|
|
|
113
110
|
/*
|
|
@@ -123,7 +120,7 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
|
|
|
123
120
|
animated: true,
|
|
124
121
|
viewPosition,
|
|
125
122
|
});
|
|
126
|
-
}, [
|
|
123
|
+
}, [currentIndex, items.length, viewPosition]);
|
|
127
124
|
|
|
128
125
|
React.useImperativeHandle(
|
|
129
126
|
ref,
|
|
@@ -7,6 +7,7 @@ import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
|
7
7
|
import Button from '../../Button/Button';
|
|
8
8
|
import HeroDesignProvider from '../../HeroDesignProvider';
|
|
9
9
|
import Image from '../../Image';
|
|
10
|
+
import { getCardCarouselValidIndex } from '../CardCarousel';
|
|
10
11
|
|
|
11
12
|
const carouselData = [
|
|
12
13
|
{
|
|
@@ -180,3 +181,16 @@ describe('Carousel', () => {
|
|
|
180
181
|
expect(queryByTestId('page-control-indicator1')).toBeFalsy();
|
|
181
182
|
});
|
|
182
183
|
});
|
|
184
|
+
|
|
185
|
+
// write test for getCardCarouselValidIndex
|
|
186
|
+
describe('getCardCarouselValidIndex', () => {
|
|
187
|
+
it('should return 0 when index is less than 0', () => {
|
|
188
|
+
expect(getCardCarouselValidIndex(-1, 3)).toBe(0);
|
|
189
|
+
});
|
|
190
|
+
it('should return 2 when index is equal to 2', () => {
|
|
191
|
+
expect(getCardCarouselValidIndex(2, 3)).toBe(2);
|
|
192
|
+
});
|
|
193
|
+
it('should return 2 when index is greater than 2', () => {
|
|
194
|
+
expect(getCardCarouselValidIndex(3, 3)).toBe(2);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
@@ -63,38 +63,41 @@ describe('DatePickerCalendar', () => {
|
|
|
63
63
|
platform
|
|
64
64
|
${'ios'}
|
|
65
65
|
${'android'}
|
|
66
|
-
`(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
`(
|
|
67
|
+
'renders month year picker when pressing on title',
|
|
68
|
+
({ platform: mockedPlatform }) => {
|
|
69
|
+
jest.mock('react-native/Libraries/Utilities/Platform', () => ({
|
|
70
|
+
OS: mockedPlatform,
|
|
71
|
+
select: () => null,
|
|
72
|
+
}));
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
const { queryByText, getByText, getByTestId } = renderWithTheme(
|
|
75
|
+
<DatePickerCalendar
|
|
76
|
+
value={new Date('December 21, 1995')}
|
|
77
|
+
label="Start date"
|
|
78
|
+
confirmLabel="Confirm"
|
|
79
|
+
helpText="This is help text"
|
|
80
|
+
onChange={jest.fn()}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
fireEvent.press(getByText('Start date'));
|
|
85
|
+
fireEvent.press(getByText('December 1995'));
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (mockedPlatform === 'ios') {
|
|
88
|
+
expect(queryByText('IOS picker')).toBeDefined();
|
|
89
|
+
} else {
|
|
90
|
+
expect(queryByText('Android picker')).toBeDefined();
|
|
91
|
+
}
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
// Selecting month
|
|
94
|
+
fireEvent(
|
|
95
|
+
getByTestId('calendar'),
|
|
96
|
+
'onMonthChange',
|
|
97
|
+
new Date('January 17, 1993')
|
|
98
|
+
);
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
expect(queryByText('January 1993')).toBeDefined();
|
|
101
|
+
}
|
|
102
|
+
);
|
|
100
103
|
});
|
|
@@ -57,7 +57,7 @@ exports[`Empty renders empty state content correctly 1`] = `
|
|
|
57
57
|
[
|
|
58
58
|
{
|
|
59
59
|
"color": "#001f23",
|
|
60
|
-
"fontFamily": "
|
|
60
|
+
"fontFamily": "RebondGrotesque",
|
|
61
61
|
"fontSize": 18,
|
|
62
62
|
"letterSpacing": 0.54,
|
|
63
63
|
"lineHeight": 26,
|
|
@@ -173,7 +173,7 @@ exports[`Empty renders empty state with image correctly 1`] = `
|
|
|
173
173
|
[
|
|
174
174
|
{
|
|
175
175
|
"color": "#001f23",
|
|
176
|
-
"fontFamily": "
|
|
176
|
+
"fontFamily": "RebondGrotesque",
|
|
177
177
|
"fontSize": 18,
|
|
178
178
|
"letterSpacing": 0.54,
|
|
179
179
|
"lineHeight": 26,
|
|
@@ -101,7 +101,7 @@ exports[`Error renders error screen with custom image element correctly 1`] = `
|
|
|
101
101
|
[
|
|
102
102
|
{
|
|
103
103
|
"color": "#001f23",
|
|
104
|
-
"fontFamily": "
|
|
104
|
+
"fontFamily": "RebondGrotesque",
|
|
105
105
|
"fontSize": 18,
|
|
106
106
|
"letterSpacing": 0.54,
|
|
107
107
|
"lineHeight": 26,
|
|
@@ -255,7 +255,7 @@ exports[`Error renders error screen with image correctly 1`] = `
|
|
|
255
255
|
[
|
|
256
256
|
{
|
|
257
257
|
"color": "#001f23",
|
|
258
|
-
"fontFamily": "
|
|
258
|
+
"fontFamily": "RebondGrotesque",
|
|
259
259
|
"fontSize": 18,
|
|
260
260
|
"letterSpacing": 0.54,
|
|
261
261
|
"lineHeight": 26,
|
|
@@ -441,7 +441,7 @@ exports[`Error renders full screen error page correctly 1`] = `
|
|
|
441
441
|
[
|
|
442
442
|
{
|
|
443
443
|
"color": "#001f23",
|
|
444
|
-
"fontFamily": "
|
|
444
|
+
"fontFamily": "RebondGrotesque",
|
|
445
445
|
"fontSize": 18,
|
|
446
446
|
"letterSpacing": 0.54,
|
|
447
447
|
"lineHeight": 26,
|
|
@@ -557,7 +557,7 @@ exports[`Error renders title only correctly 1`] = `
|
|
|
557
557
|
[
|
|
558
558
|
{
|
|
559
559
|
"color": "#001f23",
|
|
560
|
-
"fontFamily": "
|
|
560
|
+
"fontFamily": "RebondGrotesque",
|
|
561
561
|
"fontSize": 18,
|
|
562
562
|
"letterSpacing": 0.54,
|
|
563
563
|
"lineHeight": 26,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark":59013,"box-check":59014,"box":59015,"bpay":59016,"buildings":59017,"cake":59018,"calendar-clock":59019,"calendar":59020,"candy-box-menu":59021,"caret-down-small":59022,"caret-down":59023,"caret-left-small":59024,"caret-left":59025,"caret-right-small":59026,"caret-right":59027,"caret-up-small":59028,"caret-up":59029,"check-radio":59030,"circle-add":59031,"circle-cancel":59032,"circle-check":59033,"circle-down":59034,"circle-info":59035,"circle-left":59036,"circle-ok":59037,"circle-pencil":59038,"circle-question":59039,"circle-remove":59040,"circle-right":59041,"circle-up":59042,"circle-warning":59043,"clock-3":59044,"clock":59045,"cloud-download":59046,"cloud-upload":59047,"cog":59048,"coin":59049,"contacts":59050,"credit-card":59051,"diamond":59052,"direction-arrows":59053,"directory":59054,"document":59055,"dollar-coin-shine":59056,"double-buildings":59057,"edit-template":59058,"envelope":59059,"exclude":59060,"expand-content":59061,"expense":59062,"eye-circle":
|
|
1
|
+
{"activate":59000,"add-emoji":59001,"add-person":59002,"adjustment":59003,"alignment":59004,"antenna":59005,"archive":59006,"assignment-warning":59007,"bank":59008,"bell":59009,"billing":59010,"bolt":59011,"bookmark-added":59012,"bookmark":59013,"box-check":59014,"box":59015,"bpay":59016,"buildings":59017,"cake":59018,"calendar-clock":59019,"calendar":59020,"candy-box-menu":59021,"caret-down-small":59022,"caret-down":59023,"caret-left-small":59024,"caret-left":59025,"caret-right-small":59026,"caret-right":59027,"caret-up-small":59028,"caret-up":59029,"check-radio":59030,"circle-add":59031,"circle-cancel":59032,"circle-check":59033,"circle-down":59034,"circle-info":59035,"circle-left":59036,"circle-ok":59037,"circle-pencil":59038,"circle-question":59039,"circle-remove":59040,"circle-right":59041,"circle-up":59042,"circle-warning":59043,"clock-3":59044,"clock":59045,"cloud-download":59046,"cloud-upload":59047,"cog":59048,"coin":59049,"contacts":59050,"credit-card":59051,"diamond":59052,"direction-arrows":59053,"directory":59054,"document":59055,"dollar-coin-shine":59056,"double-buildings":59057,"edit-template":59058,"envelope":59059,"exclude":59060,"expand-content":59061,"expense":59062,"explore_nearby":59063,"eye-circle":59064,"eye-invisible":59065,"eye":59066,"face-meh":59067,"face-sad":59068,"face-smiley":59069,"feed":59070,"feedbacks":59071,"file-certified":59072,"file-clone":59073,"file-copy":59074,"file-csv":59075,"file-dispose":59076,"file-doc":59077,"file-excel":59078,"file-export":59079,"file-lock":59080,"file-pdf":59081,"file-powerpoint":59082,"file-search":59083,"file-secured":59084,"file-sheets":59085,"file-slide":59086,"file-verified":59087,"file-word":59088,"file":59089,"filter":59090,"folder-user":59091,"folder":59092,"format-bold":59093,"format-heading1":59094,"format-heading2":59095,"format-italic":59096,"format-list-bulleted":59097,"format-list-numbered":59098,"format-underlined":59099,"funnel-filter":59100,"global-dollar":59101,"globe":59102,"graduation-cap":59103,"graph":59104,"happy-sun":59105,"health-bag":59106,"heart":59107,"hero-points":59108,"home":59109,"image":59110,"import":59111,"incident-siren":59112,"instapay-daily":59113,"instapay-now":59114,"instapay":59115,"list":59116,"loading-2":59117,"loading":59118,"location-on":59119,"location":59120,"lock":59121,"looks-one":59122,"looks-two":59123,"media-content":59124,"menu":59125,"money-notes":59126,"moneybag":59127,"moon":59128,"multiple-stars":59129,"multiple-users":59130,"near-me":59131,"node":59132,"open-folder":59133,"paperclip":59134,"payment-summary":59135,"pencil":59136,"phone":59137,"piggy-bank":59138,"plane-up":59139,"plane":59140,"play-circle":59141,"print":59142,"raising-hands":59143,"reply-arrow":59144,"reply":59145,"reschedule":59146,"rostering":59147,"salary-sacrifice":59148,"save":59149,"schedule-send":59150,"schedule":59151,"search-person":59152,"send":59153,"speaker-active":59154,"speaker":59155,"star-award":59156,"star-badge":59157,"star-circle":59158,"star-medal":59159,"star":59160,"steps-circle":59161,"stopwatch":59162,"suitcase":59163,"surfing":59164,"survey":59165,"swag-pillar-benefit":59166,"swag-pillar-career":59167,"swag-pillar-money":59168,"swag-pillar-work":59169,"swag":59170,"swipe-right":59171,"switch":59172,"tag":59173,"target":59174,"teams":59175,"timesheet":59176,"touch-id":59177,"trash-bin":59178,"unlock":59179,"user":59180,"video-1":59181,"video-2":59182,"wallet":59183,"warning":59184,"activate-outlined":59185,"add-credit-card-outlined":59186,"add-person-outlined":59187,"add-section-outlined":59188,"add-time-outlined":59189,"add":59190,"adjustment-outlined":59191,"ai-outlined":59192,"alignment-2-outlined":59193,"alignment-outlined":59194,"all-caps":59195,"application-outlined":59196,"arrow-down":59197,"arrow-downwards":59198,"arrow-left":59199,"arrow-leftwards":59200,"arrow-right":59201,"arrow-rightwards":59202,"arrow-up":59203,"arrow-upwards":59204,"article-outlined":59205,"at-sign":59206,"auto-graph-outlined":59207,"beer-outlined":59208,"bell-active-outlined":59209,"bell-outlined":59210,"bell-slash-outlined":59211,"bill-management-outlined":59212,"billing-outlined":59213,"body-outlined":59214,"bold":59215,"bolt-outlined":59216,"book-outlined":59217,"bookmark-added-outlined":59218,"bookmark-outlined":59219,"box-check-outlined":59220,"box-outlined":59221,"bullet-points":59222,"cake-outlined":59223,"calendar-dates-outlined":59224,"calendar-star-outlined":59225,"call-outlined":59226,"call-split-outlined":59227,"camera-outlined":59228,"cancel":59229,"car-forward-outlined":59230,"cashback-outlined":59231,"charging-station-outlined":59232,"chat-bubble-outlined":59233,"chat-unread-outlined":59234,"checkmark":59235,"circle-add-outlined":59236,"circle-cancel-outlined":59237,"circle-down-outlined":59238,"circle-info-outlined":59239,"circle-left-outlined":59240,"circle-ok-outlined":59241,"circle-question-outlined":59242,"circle-remove-outlined":59243,"circle-right-outlined":59244,"circle-up-outlined":59245,"circle-warning-outlined":59246,"clock-2-outlined":59247,"clock-outlined":59248,"cog-outlined":59249,"coin-outlined":59250,"coin-super-outlined":59251,"comment-outlined":59252,"contacts-outlined":59253,"contacts-user-outlined":59254,"credit-card-outlined":59255,"cup-outlined":59256,"dentistry-outlined":59257,"direction-arrows-outlined":59258,"directory-outlined":59259,"document-outlined":59260,"dollar-box-outlined":59261,"dollar-card-outlined":59262,"dollar-coin-shine-outlined":59263,"dollar-credit-card-outlined":59264,"dollar-sign":59265,"double-buildings-outlined":59266,"double-left-arrows":59267,"double-right-arrows":59268,"download-box-outlined":59269,"download-outlined":59270,"edit-template-outlined":59271,"email-outlined":59272,"enter-arrow":59273,"envelope-outlined":59274,"expense-approval-outlined":59275,"expense-outlined":59276,"explore-outlined":59277,"extension-outlined":59278,"external-link":59279,"eye-invisible-outlined":59280,"eye-outlined":59281,"face-id":59282,"face-meh-outlined":59283,"face-open-smiley-outlined":59284,"face-sad-outlined":59285,"face-smiley-outlined":59286,"fastfood-outlined":59287,"feed-outlined":59288,"file-certified-outlined":59289,"file-clone-outlined":59290,"file-copy-outlined":59291,"file-dispose-outlined":59292,"file-dollar-certified-outlined":59293,"file-dollar-outlined":59294,"file-download-outlined":59295,"file-export-outlined":59296,"file-lock-outlined":59297,"file-outlined":59298,"file-search-outlined":59299,"file-secured-outlined":59300,"file-statutory-outlined":59301,"file-verified-outlined":59302,"filter-outlined":59303,"folder-outlined":59304,"folder-user-outlined":59305,"form-outlined":59306,"funnel-filter-outline":59307,"goal-outlined":59308,"graph-outlined":59309,"hand-holding-user-outlined":59310,"happy-sun-outlined":59311,"health-bag-outlined":59312,"heart-outlined":59313,"home-active-outlined":59314,"home-outlined":59315,"id-card-outlined":59316,"image-outlined":59317,"import-outlined":59318,"instapay-outlined":59319,"italic":59320,"job-search-outlined":59321,"leave-approval-outlined":59322,"link-1":59323,"link-2":59324,"list-outlined":59325,"live-help-outlined":59326,"local_mall_outlined":59327,"location-on-outlined":59328,"location-outlined":59329,"lock-outlined":59330,"locked-file-outlined":59331,"log-out":59332,"mail-outlined":59333,"map-outlined":59334,"media-content-outlined":59335,"menu-close":59336,"menu-expand":59337,"menu-fold-outlined":59338,"menu-unfold-outlined":59339,"moneybag-outlined":59340,"moon-outlined":59341,"more-horizontal":59342,"more-vertical":59343,"multiple-folders-outlined":59344,"multiple-users-outlined":59345,"near-me-outlined":59346,"node-outlined":59347,"number-points":59348,"number":59349,"overview-outlined":59350,"payment-summary-outlined":59351,"payslip-outlined":59352,"pencil-outlined":59353,"percentage":59354,"phone-outlined":59355,"piggy-bank-outlined":59356,"plane-outlined":59357,"play-circle-outlined":59358,"print-outlined":59359,"propane-tank-outlined":59360,"qr-code-outlined":59361,"qualification-outlined":59362,"re-assign":59363,"redeem":59364,"refresh":59365,"remove":59366,"reply-outlined":59367,"restart":59368,"resume-outlined":59369,"return-arrow":59370,"rostering-outlined":59371,"safety-outlined":59372,"save-outlined":59373,"schedule-outlined":59374,"search-outlined":59375,"search-secured-outlined":59376,"send-outlined":59377,"share-1":59378,"share-2":59379,"share-outlined":59380,"shopping_basket_outlined":59381,"show-chart-outlined":59382,"single-down-arrow":59383,"single-left-arrow":59384,"single-right-arrow":59385,"single-up-arrow":59386,"smart-match-outlined":59387,"sparkle-outlined":59388,"speaker-active-outlined":59389,"speaker-outlined":59390,"star-circle-outlined":59391,"star-outlined":59392,"stash-outlined":59393,"stopwatch-outlined":59394,"strikethrough":59395,"styler-outlined":59396,"suitcase-clock-outlined":59397,"suitcase-outlined":59398,"survey-outlined":59399,"switch-outlined":59400,"sync":59401,"tag-outlined":59402,"target-outlined":59403,"tennis-outlined":59404,"ticket-outlined":59405,"timesheet-outlined":59406,"timesheets-outlined":59407,"today-outlined":59408,"transfer":59409,"trash-bin-outlined":59410,"umbrela-outlined":59411,"unavailability-outlined":59412,"unavailable":59413,"underline":59414,"union-outlined":59415,"unlock-outlined":59416,"upload-outlined":59417,"user-circle-outlined":59418,"user-gear-outlined":59419,"user-outlined":59420,"user-rectangle-outlined":59421,"video-1-outlined":59422,"video-2-outlined":59423,"volunteer-outlined":59424,"wallet-outlined":59425}
|
|
@@ -63,6 +63,7 @@ const IconList = [
|
|
|
63
63
|
'exclude',
|
|
64
64
|
'expand-content',
|
|
65
65
|
'expense',
|
|
66
|
+
'explore_nearby',
|
|
66
67
|
'eye-circle',
|
|
67
68
|
'eye-invisible',
|
|
68
69
|
'eye',
|
|
@@ -326,12 +327,14 @@ const IconList = [
|
|
|
326
327
|
'link-2',
|
|
327
328
|
'list-outlined',
|
|
328
329
|
'live-help-outlined',
|
|
330
|
+
'local_mall_outlined',
|
|
329
331
|
'location-on-outlined',
|
|
330
332
|
'location-outlined',
|
|
331
333
|
'lock-outlined',
|
|
332
334
|
'locked-file-outlined',
|
|
333
335
|
'log-out',
|
|
334
336
|
'mail-outlined',
|
|
337
|
+
'map-outlined',
|
|
335
338
|
'media-content-outlined',
|
|
336
339
|
'menu-close',
|
|
337
340
|
'menu-expand',
|
|
@@ -378,6 +381,7 @@ const IconList = [
|
|
|
378
381
|
'share-1',
|
|
379
382
|
'share-2',
|
|
380
383
|
'share-outlined',
|
|
384
|
+
'shopping_basket_outlined',
|
|
381
385
|
'show-chart-outlined',
|
|
382
386
|
'single-down-arrow',
|
|
383
387
|
'single-left-arrow',
|
|
@@ -127,7 +127,7 @@ const PinInput = forwardRef<PinInputHandler, PinInputProps>(
|
|
|
127
127
|
|
|
128
128
|
const changeText = useCallback(
|
|
129
129
|
(text: string) => {
|
|
130
|
-
const pin = (text.match(/
|
|
130
|
+
const pin = (text.match(/\d/g) || []).join('');
|
|
131
131
|
|
|
132
132
|
onChangeText?.(pin);
|
|
133
133
|
|
|
@@ -22,10 +22,12 @@ const SceneView = ({
|
|
|
22
22
|
);
|
|
23
23
|
const focused = index === selectedIndex;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
|
|
27
|
+
// Always render the route when it becomes focused
|
|
28
|
+
setIsLoading(false);
|
|
29
|
+
}
|
|
30
|
+
}, [isLoading, index, selectedIndex, lazyPreloadDistance]);
|
|
29
31
|
|
|
30
32
|
React.useEffect(() => {
|
|
31
33
|
let unsubscribe: (() => void) | undefined;
|
|
@@ -4,9 +4,13 @@ import PagerView from 'react-native-pager-view';
|
|
|
4
4
|
import { TabContainer, ContentWrapper } from './StyledScrollableTabs';
|
|
5
5
|
import type { TabsProps } from '.';
|
|
6
6
|
import SceneView from './SceneView';
|
|
7
|
-
import ScrollableTabHeader from './ScrollableTabsHeader';
|
|
7
|
+
import ScrollableTabHeader from './ScrollableTabsHeader/ScrollableTabsHeader';
|
|
8
8
|
import { ScreenContext, TabContext } from './useIsFocused';
|
|
9
9
|
|
|
10
|
+
export interface ScrollableTabProps extends TabsProps {
|
|
11
|
+
variant?: 'underlined' | 'highlighted';
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
const ScrollableTab = ({
|
|
11
15
|
onTabPress,
|
|
12
16
|
selectedTabKey,
|
|
@@ -17,7 +21,8 @@ const ScrollableTab = ({
|
|
|
17
21
|
lazyPreloadDistance = 1,
|
|
18
22
|
swipeEnabled = true,
|
|
19
23
|
testID: componentTestID,
|
|
20
|
-
|
|
24
|
+
variant = 'highlighted',
|
|
25
|
+
}: ScrollableTabProps) => {
|
|
21
26
|
const pagerViewRef = React.useRef<PagerView>(null);
|
|
22
27
|
const insets = useSafeAreaInsets();
|
|
23
28
|
const selectedTabIndex = tabs.findIndex(
|
|
@@ -61,6 +66,7 @@ const ScrollableTab = ({
|
|
|
61
66
|
barStyle={barStyle}
|
|
62
67
|
insets={insets}
|
|
63
68
|
testID={componentTestID ? `${componentTestID}-tab-bar` : undefined}
|
|
69
|
+
variant={variant}
|
|
64
70
|
/>
|
|
65
71
|
<ContentWrapper
|
|
66
72
|
initialPage={selectedTabIndex}
|