@hero-design/rn 8.56.1 → 8.57.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 (38) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  4. package/es/index.js +5106 -4266
  5. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  6. package/lib/index.js +5105 -4265
  7. package/package.json +2 -1
  8. package/src/components/Button/StyledButton.tsx +16 -30
  9. package/src/components/Carousel/CardCarousel.tsx +3 -4
  10. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  11. package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  12. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  13. package/src/components/Icon/IconList.ts +4 -0
  14. package/src/components/PinInput/index.tsx +1 -1
  15. package/src/components/Tabs/SceneView.tsx +6 -4
  16. package/src/components/Tabs/ScrollableTabs.tsx +8 -2
  17. package/src/components/Tabs/{ScrollableTabsHeader.tsx → ScrollableTabsHeader/ScrollableTabsHeader.tsx} +73 -42
  18. package/src/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.ts +45 -0
  19. package/src/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.ts +91 -0
  20. package/src/components/Tabs/StyledScrollableTabs.tsx +14 -3
  21. package/src/components/Tabs/__tests__/ScrollableTabsHeader.spec.tsx +7 -3
  22. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +42 -6
  23. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +623 -3
  24. package/src/components/Tabs/__tests__/useInitHighlightedAnimation.spec.tsx +56 -0
  25. package/src/components/Tabs/__tests__/useInitUnderlinedAnimation.spec.tsx +65 -0
  26. package/src/components/Typography/Body/__tests__/__snapshots__/StyledBody.tsx.snap +2 -2
  27. package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  28. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
  29. package/src/theme/components/typography.ts +1 -1
  30. package/types/components/Icon/IconList.d.ts +1 -1
  31. package/types/components/Icon/index.d.ts +1 -1
  32. package/types/components/Icon/utils.d.ts +1 -1
  33. package/types/components/Tabs/ScrollableTabs.d.ts +4 -1
  34. package/types/components/Tabs/{ScrollableTabsHeader.d.ts → ScrollableTabsHeader/ScrollableTabsHeader.d.ts} +7 -3
  35. package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitHighlightedAnimation.d.ts +9 -0
  36. package/types/components/Tabs/ScrollableTabsHeader/hooks/useInitUnderlinedAnimation.d.ts +10 -0
  37. package/types/components/Tabs/StyledScrollableTabs.d.ts +5 -1
  38. package/types/components/Tabs/index.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.56.1",
3
+ "version": "8.57.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -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 genOutlineTextStyles = (
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 genOutlineTextStyles(theme, 'primary', disabled);
145
+ return genTextStyles(theme, 'primary', disabled);
160
146
  case 'outlined-secondary':
161
- return genOutlineTextStyles(theme, 'secondary', disabled);
147
+ return genTextStyles(theme, 'secondary', disabled);
162
148
  case 'outlined-danger':
163
- return genOutlineTextStyles(theme, 'danger', disabled);
149
+ return genTextStyles(theme, 'danger', disabled);
164
150
  case 'text-primary':
165
- return genTextVariantTextStyles(theme, 'primary', disabled);
151
+ return genTextStyles(theme, 'primary', disabled);
166
152
  case 'text-secondary':
167
- return genTextVariantTextStyles(theme, 'secondary', disabled);
153
+ return genTextStyles(theme, 'secondary', disabled);
168
154
  case 'text-danger':
169
- return genTextVariantTextStyles(theme, 'danger', disabled);
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 genTextVariantTextStyles(theme, 'primary', disabled);
172
+ return genTextStyles(theme, 'primary', disabled);
187
173
  case 'text-secondary':
188
- return genTextVariantTextStyles(theme, 'secondary', disabled);
174
+ return genTextStyles(theme, 'secondary', disabled);
189
175
  case 'text-danger':
190
- return genTextVariantTextStyles(theme, 'danger', disabled);
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 genOutlineTextStyles(theme, 'primary', disabled);
209
+ return genTextStyles(theme, 'primary', disabled);
224
210
  case 'outlined-secondary':
225
- return genOutlineTextStyles(theme, 'secondary', disabled);
211
+ return genTextStyles(theme, 'secondary', disabled);
226
212
  case 'outlined-danger':
227
- return genOutlineTextStyles(theme, 'danger', disabled);
213
+ return genTextStyles(theme, 'danger', disabled);
228
214
  case 'text-primary':
229
- return genTextVariantTextStyles(theme, 'primary', disabled);
215
+ return genTextStyles(theme, 'primary', disabled);
230
216
  case 'text-secondary':
231
- return genTextVariantTextStyles(theme, 'secondary', disabled);
217
+ return genTextStyles(theme, 'secondary', disabled);
232
218
  case 'text-danger':
233
- return genTextVariantTextStyles(theme, 'danger', disabled);
219
+ return genTextStyles(theme, 'danger', disabled);
234
220
  }
235
221
  };
236
222
 
@@ -93,11 +93,10 @@ export const CardCarousel = forwardRef<CardCarouselHandles, CardCarouselProps>(
93
93
  const snapToIndex = useCallback(
94
94
  (index: number) => {
95
95
  let validIndex = 0;
96
- if (index < 0) {
97
- validIndex = 0;
98
- } else if (index >= items.length) {
96
+
97
+ if (index >= items.length) {
99
98
  validIndex = items.length - 1;
100
- } else {
99
+ } else if (index >= 0) {
101
100
  validIndex = index;
102
101
  }
103
102
 
@@ -57,7 +57,7 @@ exports[`Empty renders empty state content correctly 1`] = `
57
57
  [
58
58
  {
59
59
  "color": "#001f23",
60
- "fontFamily": "BeVietnamPro-Regular",
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": "BeVietnamPro-Regular",
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": "BeVietnamPro-Regular",
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": "BeVietnamPro-Regular",
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": "BeVietnamPro-Regular",
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": "BeVietnamPro-Regular",
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":59063,"eye-invisible":59064,"eye":59065,"face-meh":59066,"face-sad":59067,"face-smiley":59068,"feed":59069,"feedbacks":59070,"file-certified":59071,"file-clone":59072,"file-copy":59073,"file-csv":59074,"file-dispose":59075,"file-doc":59076,"file-excel":59077,"file-export":59078,"file-lock":59079,"file-pdf":59080,"file-powerpoint":59081,"file-search":59082,"file-secured":59083,"file-sheets":59084,"file-slide":59085,"file-verified":59086,"file-word":59087,"file":59088,"filter":59089,"folder-user":59090,"folder":59091,"format-bold":59092,"format-heading1":59093,"format-heading2":59094,"format-italic":59095,"format-list-bulleted":59096,"format-list-numbered":59097,"format-underlined":59098,"funnel-filter":59099,"global-dollar":59100,"globe":59101,"graduation-cap":59102,"graph":59103,"happy-sun":59104,"health-bag":59105,"heart":59106,"hero-points":59107,"home":59108,"image":59109,"import":59110,"incident-siren":59111,"instapay-daily":59112,"instapay-now":59113,"instapay":59114,"list":59115,"loading-2":59116,"loading":59117,"location-on":59118,"location":59119,"lock":59120,"looks-one":59121,"looks-two":59122,"media-content":59123,"menu":59124,"money-notes":59125,"moneybag":59126,"moon":59127,"multiple-stars":59128,"multiple-users":59129,"near-me":59130,"node":59131,"open-folder":59132,"paperclip":59133,"payment-summary":59134,"pencil":59135,"phone":59136,"piggy-bank":59137,"plane-up":59138,"plane":59139,"play-circle":59140,"print":59141,"raising-hands":59142,"reply-arrow":59143,"reply":59144,"reschedule":59145,"rostering":59146,"salary-sacrifice":59147,"save":59148,"schedule-send":59149,"schedule":59150,"search-person":59151,"send":59152,"speaker-active":59153,"speaker":59154,"star-award":59155,"star-badge":59156,"star-circle":59157,"star-medal":59158,"star":59159,"steps-circle":59160,"stopwatch":59161,"suitcase":59162,"surfing":59163,"survey":59164,"swag-pillar-benefit":59165,"swag-pillar-career":59166,"swag-pillar-money":59167,"swag-pillar-work":59168,"swag":59169,"swipe-right":59170,"switch":59171,"tag":59172,"target":59173,"teams":59174,"timesheet":59175,"touch-id":59176,"trash-bin":59177,"unlock":59178,"user":59179,"video-1":59180,"video-2":59181,"wallet":59182,"warning":59183,"activate-outlined":59184,"add-credit-card-outlined":59185,"add-person-outlined":59186,"add-section-outlined":59187,"add-time-outlined":59188,"add":59189,"adjustment-outlined":59190,"ai-outlined":59191,"alignment-2-outlined":59192,"alignment-outlined":59193,"all-caps":59194,"application-outlined":59195,"arrow-down":59196,"arrow-downwards":59197,"arrow-left":59198,"arrow-leftwards":59199,"arrow-right":59200,"arrow-rightwards":59201,"arrow-up":59202,"arrow-upwards":59203,"article-outlined":59204,"at-sign":59205,"auto-graph-outlined":59206,"beer-outlined":59207,"bell-active-outlined":59208,"bell-outlined":59209,"bell-slash-outlined":59210,"bill-management-outlined":59211,"billing-outlined":59212,"body-outlined":59213,"bold":59214,"bolt-outlined":59215,"book-outlined":59216,"bookmark-added-outlined":59217,"bookmark-outlined":59218,"box-check-outlined":59219,"box-outlined":59220,"bullet-points":59221,"cake-outlined":59222,"calendar-dates-outlined":59223,"calendar-star-outlined":59224,"call-outlined":59225,"call-split-outlined":59226,"camera-outlined":59227,"cancel":59228,"car-forward-outlined":59229,"cashback-outlined":59230,"charging-station-outlined":59231,"chat-bubble-outlined":59232,"chat-unread-outlined":59233,"checkmark":59234,"circle-add-outlined":59235,"circle-cancel-outlined":59236,"circle-down-outlined":59237,"circle-info-outlined":59238,"circle-left-outlined":59239,"circle-ok-outlined":59240,"circle-question-outlined":59241,"circle-remove-outlined":59242,"circle-right-outlined":59243,"circle-up-outlined":59244,"circle-warning-outlined":59245,"clock-2-outlined":59246,"clock-outlined":59247,"cog-outlined":59248,"coin-outlined":59249,"coin-super-outlined":59250,"comment-outlined":59251,"contacts-outlined":59252,"contacts-user-outlined":59253,"credit-card-outlined":59254,"cup-outlined":59255,"dentistry-outlined":59256,"direction-arrows-outlined":59257,"directory-outlined":59258,"document-outlined":59259,"dollar-box-outlined":59260,"dollar-card-outlined":59261,"dollar-coin-shine-outlined":59262,"dollar-credit-card-outlined":59263,"dollar-sign":59264,"double-buildings-outlined":59265,"double-left-arrows":59266,"double-right-arrows":59267,"download-box-outlined":59268,"download-outlined":59269,"edit-template-outlined":59270,"email-outlined":59271,"enter-arrow":59272,"envelope-outlined":59273,"expense-approval-outlined":59274,"expense-outlined":59275,"explore-outlined":59276,"extension-outlined":59277,"external-link":59278,"eye-invisible-outlined":59279,"eye-outlined":59280,"face-id":59281,"face-meh-outlined":59282,"face-open-smiley-outlined":59283,"face-sad-outlined":59284,"face-smiley-outlined":59285,"fastfood-outlined":59286,"feed-outlined":59287,"file-certified-outlined":59288,"file-clone-outlined":59289,"file-copy-outlined":59290,"file-dispose-outlined":59291,"file-dollar-certified-outlined":59292,"file-dollar-outlined":59293,"file-download-outlined":59294,"file-export-outlined":59295,"file-lock-outlined":59296,"file-outlined":59297,"file-search-outlined":59298,"file-secured-outlined":59299,"file-statutory-outlined":59300,"file-verified-outlined":59301,"filter-outlined":59302,"folder-outlined":59303,"folder-user-outlined":59304,"form-outlined":59305,"funnel-filter-outline":59306,"goal-outlined":59307,"graph-outlined":59308,"hand-holding-user-outlined":59309,"happy-sun-outlined":59310,"health-bag-outlined":59311,"heart-outlined":59312,"home-active-outlined":59313,"home-outlined":59314,"id-card-outlined":59315,"image-outlined":59316,"import-outlined":59317,"instapay-outlined":59318,"italic":59319,"job-search-outlined":59320,"leave-approval-outlined":59321,"link-1":59322,"link-2":59323,"list-outlined":59324,"live-help-outlined":59325,"location-on-outlined":59326,"location-outlined":59327,"lock-outlined":59328,"locked-file-outlined":59329,"log-out":59330,"mail-outlined":59331,"media-content-outlined":59332,"menu-close":59333,"menu-expand":59334,"menu-fold-outlined":59335,"menu-unfold-outlined":59336,"moneybag-outlined":59337,"moon-outlined":59338,"more-horizontal":59339,"more-vertical":59340,"multiple-folders-outlined":59341,"multiple-users-outlined":59342,"near-me-outlined":59343,"node-outlined":59344,"number-points":59345,"number":59346,"overview-outlined":59347,"payment-summary-outlined":59348,"payslip-outlined":59349,"pencil-outlined":59350,"percentage":59351,"phone-outlined":59352,"piggy-bank-outlined":59353,"plane-outlined":59354,"play-circle-outlined":59355,"print-outlined":59356,"propane-tank-outlined":59357,"qr-code-outlined":59358,"qualification-outlined":59359,"re-assign":59360,"redeem":59361,"refresh":59362,"remove":59363,"reply-outlined":59364,"restart":59365,"resume-outlined":59366,"return-arrow":59367,"rostering-outlined":59368,"safety-outlined":59369,"save-outlined":59370,"schedule-outlined":59371,"search-outlined":59372,"search-secured-outlined":59373,"send-outlined":59374,"share-1":59375,"share-2":59376,"share-outlined":59377,"show-chart-outlined":59378,"single-down-arrow":59379,"single-left-arrow":59380,"single-right-arrow":59381,"single-up-arrow":59382,"smart-match-outlined":59383,"sparkle-outlined":59384,"speaker-active-outlined":59385,"speaker-outlined":59386,"star-circle-outlined":59387,"star-outlined":59388,"stash-outlined":59389,"stopwatch-outlined":59390,"strikethrough":59391,"styler-outlined":59392,"suitcase-clock-outlined":59393,"suitcase-outlined":59394,"survey-outlined":59395,"switch-outlined":59396,"sync":59397,"tag-outlined":59398,"target-outlined":59399,"tennis-outlined":59400,"ticket-outlined":59401,"timesheet-outlined":59402,"timesheets-outlined":59403,"today-outlined":59404,"transfer":59405,"trash-bin-outlined":59406,"umbrela-outlined":59407,"unavailability-outlined":59408,"unavailable":59409,"underline":59410,"union-outlined":59411,"unlock-outlined":59412,"upload-outlined":59413,"user-circle-outlined":59414,"user-gear-outlined":59415,"user-outlined":59416,"user-rectangle-outlined":59417,"video-1-outlined":59418,"video-2-outlined":59419,"volunteer-outlined":59420,"wallet-outlined":59421}
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(/[0-9]/g) || []).join('');
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
- if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
26
- // Always render the route when it becomes focused
27
- setIsLoading(false);
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
- }: TabsProps) => {
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}
@@ -1,26 +1,28 @@
1
+ import { useTheme } from '@emotion/react';
1
2
  import React from 'react';
2
3
  import {
3
- TouchableWithoutFeedback,
4
4
  FlatList,
5
- Animated,
5
+ Platform,
6
6
  StyleProp,
7
- ViewStyle,
7
+ TouchableWithoutFeedback,
8
8
  ViewProps,
9
+ ViewStyle,
9
10
  } from 'react-native';
10
- import { useTheme } from '@emotion/react';
11
+ import type { ItemType, TabType } from '..';
12
+ import Icon from '../../Icon';
13
+ import { isHeroIcon } from '../../Icon/utils';
14
+ import Typography from '../../Typography';
11
15
  import {
12
16
  HeaderTabItem,
13
- HeaderTabWrapper,
17
+ HeaderTabItemIndicator,
14
18
  HeaderTabItemOutline,
15
- HeaderTabItemWrapper,
16
19
  HeaderTabItemOutlineWrapper,
17
- } from './StyledScrollableTabs';
18
- import { useAnimatedValueArray } from './utils';
19
- import { isHeroIcon } from '../Icon/utils';
20
- import Icon from '../Icon';
21
- import Typography from '../Typography';
22
- import type { ItemType, TabType } from '.';
23
- import TabWithBadge from './TabWithBadge';
20
+ HeaderTabItemWrapper,
21
+ HeaderTabWrapper,
22
+ } from '../StyledScrollableTabs';
23
+ import TabWithBadge from '../TabWithBadge';
24
+ import useInitHighlightedAnimation from './hooks/useInitHighlightedAnimation';
25
+ import useInitUnderlinedAnimation from './hooks/useInitUnderlinedAnimation';
24
26
 
25
27
  const getTabItem = ({
26
28
  item,
@@ -87,6 +89,10 @@ export interface ScrollableTabHeaderProps extends ViewProps {
87
89
  right: number;
88
90
  left: number;
89
91
  };
92
+ /**
93
+ * Variant of the tab header
94
+ */
95
+ variant?: 'underlined' | 'highlighted';
90
96
  }
91
97
  const ScrollableTabHeader = ({
92
98
  onTabPress,
@@ -95,12 +101,25 @@ const ScrollableTabHeader = ({
95
101
  barStyle,
96
102
  testID,
97
103
  insets = { top: 0, bottom: 0, right: 0, left: 0 },
104
+ variant = 'highlighted',
98
105
  }: ScrollableTabHeaderProps) => {
99
- const flatListRef = React.useRef<FlatList>(null);
100
106
  const theme = useTheme();
101
- const tabsAnims = useAnimatedValueArray(
102
- tabs.map((_, i) => (i === selectedIndex ? 1 : 0))
103
- );
107
+ const flatListRef = React.useRef<FlatList>(null);
108
+
109
+ // Init underlined animation data
110
+ const { underlinedTranslateX, underlinedOpacity } =
111
+ useInitUnderlinedAnimation({
112
+ tabsLength: tabs.length,
113
+ selectedIndex,
114
+ variant,
115
+ });
116
+
117
+ // Init highlighted animation data
118
+ const { tabsAnims } = useInitHighlightedAnimation({
119
+ selectedIndex,
120
+ tabsLength: tabs.length,
121
+ variant,
122
+ });
104
123
 
105
124
  React.useEffect(() => {
106
125
  const timeoutHandle: number | null = null;
@@ -111,19 +130,7 @@ const ScrollableTabHeader = ({
111
130
  });
112
131
  }
113
132
 
114
- const animation = Animated.parallel([
115
- ...tabs.map((_, i) =>
116
- Animated.timing(tabsAnims[i], {
117
- toValue: i === selectedIndex ? 1 : 0,
118
- duration: 150,
119
- useNativeDriver: true,
120
- })
121
- ),
122
- ]);
123
- animation.start();
124
-
125
133
  return () => {
126
- animation.stop();
127
134
  if (timeoutHandle) {
128
135
  clearTimeout(timeoutHandle);
129
136
  }
@@ -149,8 +156,20 @@ const ScrollableTabHeader = ({
149
156
  100
150
157
  );
151
158
  }}
159
+ style={
160
+ // Border styles specified in contentContainerStyle don't work
161
+ // so they need to be placed here instead on Android.
162
+ Platform.OS === 'android'
163
+ ? {
164
+ borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
165
+ borderBottomWidth: theme.__hd__.tabs.sizes.indicator,
166
+ }
167
+ : undefined
168
+ }
152
169
  contentContainerStyle={{
153
170
  paddingHorizontal: theme.__hd__.tabs.space.flatListHorizontalPadding,
171
+ borderBottomColor: theme.__hd__.tabs.colors.headerBottom,
172
+ borderBottomWidth: theme.__hd__.tabs.sizes.indicator,
154
173
  }}
155
174
  renderItem={({ item: tab, index }) => {
156
175
  const {
@@ -187,22 +206,34 @@ const ScrollableTabHeader = ({
187
206
  testID={tabItemTestID}
188
207
  >
189
208
  <HeaderTabItem isFirstItem={index === 0}>
190
- <HeaderTabItemOutlineWrapper>
191
- <HeaderTabItemOutline
192
- themeActive={active}
193
- style={{
194
- flex: 1,
195
- transform: [
196
- {
197
- scaleX: outlineScale,
198
- },
199
- ],
200
- }}
201
- />
202
- </HeaderTabItemOutlineWrapper>
209
+ {variant === 'highlighted' && (
210
+ <HeaderTabItemOutlineWrapper>
211
+ <HeaderTabItemOutline
212
+ themeActive={active}
213
+ style={{
214
+ flex: 1,
215
+ transform: [
216
+ {
217
+ scaleX: outlineScale,
218
+ },
219
+ ],
220
+ }}
221
+ />
222
+ </HeaderTabItemOutlineWrapper>
223
+ )}
224
+
203
225
  <HeaderTabItemWrapper>
204
226
  <TabWithBadge config={badge} tabItem={tabItem} />
205
227
  </HeaderTabItemWrapper>
228
+
229
+ {variant === 'underlined' && (
230
+ <HeaderTabItemIndicator
231
+ style={{
232
+ opacity: underlinedOpacity[index],
233
+ transform: [{ translateX: underlinedTranslateX[index] }],
234
+ }}
235
+ />
236
+ )}
206
237
  </HeaderTabItem>
207
238
  </TouchableWithoutFeedback>
208
239
  );
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { Animated, Platform } from 'react-native';
3
+ import { useAnimatedValueArray } from '../../utils';
4
+
5
+ const useInitHighlightedAnimation = ({
6
+ selectedIndex = 0,
7
+ tabsLength,
8
+ variant,
9
+ }: {
10
+ selectedIndex?: number;
11
+ tabsLength: number;
12
+ variant: 'underlined' | 'highlighted';
13
+ }) => {
14
+ const tabsAnims = useAnimatedValueArray(
15
+ Array.from({ length: tabsLength }).map((_, i) =>
16
+ i === selectedIndex ? 1 : 0
17
+ )
18
+ );
19
+
20
+ React.useEffect(() => {
21
+ if (variant !== 'highlighted') {
22
+ return;
23
+ }
24
+
25
+ const animation = Animated.parallel([
26
+ ...Array.from({ length: tabsLength }).map((_, i) =>
27
+ Animated.timing(tabsAnims[i], {
28
+ toValue: i === selectedIndex ? 1 : 0,
29
+ duration: 150,
30
+ useNativeDriver: Platform.OS !== 'web',
31
+ })
32
+ ),
33
+ ]);
34
+
35
+ animation.start();
36
+
37
+ return () => {
38
+ animation.stop();
39
+ };
40
+ }, [selectedIndex]);
41
+
42
+ return { tabsAnims };
43
+ };
44
+
45
+ export default useInitHighlightedAnimation;
@@ -0,0 +1,91 @@
1
+ import React from 'react';
2
+ import { Animated, Easing, Platform } from 'react-native';
3
+ import { useAnimatedValueArray } from '../../utils';
4
+
5
+ const TRANSLATE_DISTANCE = 30;
6
+
7
+ const animateOpacity = (animatedValue: Animated.Value, toValue: number) => {
8
+ return Animated.timing(animatedValue, {
9
+ toValue,
10
+ duration: 150,
11
+ easing: Easing.ease,
12
+ useNativeDriver: Platform.OS !== 'web',
13
+ });
14
+ };
15
+
16
+ const animateTranslateX = (animatedValue: Animated.Value, toValue: number) => {
17
+ return Animated.spring(animatedValue, {
18
+ toValue,
19
+ useNativeDriver: Platform.OS !== 'web',
20
+ });
21
+ };
22
+
23
+ const useInitUnderlinedAnimation = ({
24
+ tabsLength,
25
+ selectedIndex = 0,
26
+ variant,
27
+ }: {
28
+ tabsLength: number;
29
+ selectedIndex?: number;
30
+ variant: 'underlined' | 'highlighted';
31
+ }) => {
32
+ const previousIndex = React.useRef<number>(0);
33
+ const translateXAnims = useAnimatedValueArray(
34
+ Array.from({ length: tabsLength }).map(() => 0)
35
+ );
36
+
37
+ const opacityAnims = useAnimatedValueArray(
38
+ Array.from({ length: tabsLength }).map((_, i) =>
39
+ selectedIndex !== undefined && selectedIndex === i ? 1 : 0
40
+ )
41
+ );
42
+
43
+ const underlinedTranslateX = translateXAnims.map((anim) =>
44
+ anim.interpolate({
45
+ inputRange: [-1, 0, 1],
46
+ outputRange: [-TRANSLATE_DISTANCE, 0, TRANSLATE_DISTANCE],
47
+ })
48
+ );
49
+
50
+ const underlinedOpacity = opacityAnims.map((anim) =>
51
+ anim.interpolate({
52
+ inputRange: [0, 1],
53
+ outputRange: [0, 1],
54
+ })
55
+ );
56
+
57
+ React.useEffect(() => {
58
+ if (
59
+ variant === 'underlined' &&
60
+ selectedIndex !== undefined &&
61
+ previousIndex.current !== selectedIndex
62
+ ) {
63
+ // Prepare for translateX into the right position.
64
+ if (selectedIndex > previousIndex.current) {
65
+ translateXAnims[selectedIndex].setValue(-1);
66
+ } else {
67
+ translateXAnims[selectedIndex].setValue(1);
68
+ }
69
+
70
+ // Split animations into 2 sets of parallel animations to prevent race condition.
71
+ Animated.parallel([
72
+ animateOpacity(opacityAnims[selectedIndex], 1),
73
+ animateTranslateX(translateXAnims[selectedIndex], 0),
74
+ ]).start();
75
+
76
+ Animated.parallel([
77
+ animateOpacity(opacityAnims[previousIndex.current], 0),
78
+ animateTranslateX(
79
+ translateXAnims[previousIndex.current],
80
+ selectedIndex > previousIndex.current ? 1 : -1
81
+ ),
82
+ ]).start();
83
+
84
+ previousIndex.current = selectedIndex;
85
+ }
86
+ }, [selectedIndex, variant, opacityAnims, translateXAnims]);
87
+
88
+ return { underlinedTranslateX, underlinedOpacity };
89
+ };
90
+
91
+ export default useInitUnderlinedAnimation;