@hero-design/rn 7.23.0 → 7.24.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 (73) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/assets/fonts/hero-icons.ttf +0 -0
  3. package/es/index.js +857 -8825
  4. package/lib/assets/fonts/hero-icons.ttf +0 -0
  5. package/lib/index.js +858 -8824
  6. package/package.json +6 -4
  7. package/rollup.config.js +1 -0
  8. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
  9. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +1 -0
  10. package/src/components/Empty/index.tsx +1 -2
  11. package/src/components/Icon/HeroIcon/fonts/hero-icons.ttf +0 -0
  12. package/src/components/Icon/HeroIcon/glyphMap.json +1 -0
  13. package/src/components/Icon/HeroIcon/index.tsx +3 -7
  14. package/src/components/Icon/IconList.ts +8 -5
  15. package/src/components/Icon/index.tsx +1 -0
  16. package/src/components/RichTextEditor/RichTextEditor.tsx +1 -4
  17. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +2 -0
  18. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +8 -4
  19. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
  20. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +8 -4
  21. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
  22. package/src/components/Spinner/AnimatedSpinner.tsx +22 -7
  23. package/src/components/Spinner/StyledSpinner.tsx +16 -11
  24. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +3 -1
  25. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +42 -31
  26. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
  27. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +532 -72
  28. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
  29. package/src/components/Spinner/index.tsx +6 -1
  30. package/src/components/Swipeable/StyledSwipeable.tsx +11 -0
  31. package/src/components/Swipeable/SwipeableAction.tsx +45 -0
  32. package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +37 -0
  33. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +130 -0
  34. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +33 -0
  35. package/src/components/Swipeable/__tests__/index.spec.tsx +34 -0
  36. package/src/components/Swipeable/index.tsx +148 -0
  37. package/src/components/TextInput/StyledTextInput.tsx +6 -12
  38. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +12 -6
  39. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +22 -138
  40. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +13 -0
  41. package/src/components/TextInput/__tests__/index.spec.tsx +114 -124
  42. package/src/components/TextInput/index.tsx +7 -6
  43. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
  44. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +1 -0
  45. package/src/index.ts +4 -0
  46. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +11 -6
  47. package/src/theme/components/spinner.ts +4 -1
  48. package/src/theme/components/swipeable.ts +13 -0
  49. package/src/theme/components/textInput.ts +0 -5
  50. package/src/theme/getTheme.ts +3 -0
  51. package/src/theme/global/colors/jobs.ts +0 -1
  52. package/src/theme/global/colors/work.ts +0 -2
  53. package/src/types.ts +2 -0
  54. package/testUtils/setup.tsx +13 -0
  55. package/types/components/Empty/index.d.ts +1 -2
  56. package/types/components/Icon/IconList.d.ts +1 -1
  57. package/types/components/Icon/index.d.ts +4 -1
  58. package/types/components/Icon/utils.d.ts +1 -1
  59. package/types/components/Spinner/AnimatedSpinner.d.ts +2 -1
  60. package/types/components/Spinner/StyledSpinner.d.ts +1 -0
  61. package/types/components/Spinner/index.d.ts +5 -1
  62. package/types/components/Swipeable/StyledSwipeable.d.ts +10 -0
  63. package/types/components/Swipeable/SwipeableAction.d.ts +27 -0
  64. package/types/components/Swipeable/index.d.ts +41 -0
  65. package/types/components/TextInput/StyledTextInput.d.ts +2 -1
  66. package/types/components/TextInput/index.d.ts +1 -1
  67. package/types/index.d.ts +3 -2
  68. package/types/theme/components/spinner.d.ts +4 -1
  69. package/types/theme/components/swipeable.d.ts +9 -0
  70. package/types/theme/components/textInput.d.ts +0 -5
  71. package/types/theme/getTheme.d.ts +2 -0
  72. package/types/types.d.ts +2 -1
  73. package/src/components/Icon/HeroIcon/selection.json +0 -7029
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "7.23.0",
3
+ "version": "7.24.0",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@emotion/native": "^11.9.3",
22
22
  "@emotion/react": "^11.9.3",
23
- "@hero-design/colors": "7.23.0",
23
+ "@hero-design/colors": "7.24.0",
24
24
  "date-fns": "^2.16.1",
25
25
  "events": "^3.2.0",
26
26
  "hero-editor": "^1.9.12"
@@ -30,6 +30,7 @@
30
30
  "@react-native-community/slider": "4.1.12",
31
31
  "react": "17.0.2",
32
32
  "react-native": "0.65.1",
33
+ "react-native-gesture-handler": "~2.1.0",
33
34
  "react-native-pager-view": "^5.4.25",
34
35
  "react-native-safe-area-context": "^4.2.5",
35
36
  "react-native-vector-icons": "^9.1.0",
@@ -57,10 +58,11 @@
57
58
  "@types/react-native": "^0.67.7",
58
59
  "@types/react-native-vector-icons": "^6.4.10",
59
60
  "babel-plugin-inline-import": "^3.0.0",
60
- "eslint-config-hd": "7.23.0",
61
+ "eslint-config-hd": "7.24.0",
61
62
  "jest": "^27.3.1",
62
63
  "react": "17.0.2",
63
64
  "react-native": "0.65.1",
65
+ "react-native-gesture-handler": "~2.1.0",
64
66
  "react-native-pager-view": "^5.4.25",
65
67
  "react-native-safe-area-context": "^4.2.5",
66
68
  "react-native-vector-icons": "^9.1.0",
@@ -70,7 +72,7 @@
70
72
  "rollup-plugin-copy": "^3.4.0",
71
73
  "rollup-plugin-flow": "^1.1.1",
72
74
  "ts-jest": "^27.0.7",
73
- "prettier-config-hd": "7.23.0"
75
+ "prettier-config-hd": "7.24.0"
74
76
  },
75
77
  "prettier": "prettier-config-hd"
76
78
  }
package/rollup.config.js CHANGED
@@ -29,6 +29,7 @@ export default {
29
29
  'react-native-safe-area-context',
30
30
  '@react-native-community/datetimepicker',
31
31
  '@react-native-community/slider',
32
+ 'react-native-gesture-handler',
32
33
  'react-native-webview',
33
34
  'react-native-pager-view',
34
35
  'react-native-vector-icons',
@@ -61,6 +61,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
61
61
  undefined,
62
62
  ]
63
63
  }
64
+ themeFocused={false}
64
65
  themeVariant="filled"
65
66
  />
66
67
  <View
@@ -61,6 +61,7 @@ exports[`DatePickerIOS renders correctly 1`] = `
61
61
  undefined,
62
62
  ]
63
63
  }
64
+ themeFocused={false}
64
65
  themeVariant="filled"
65
66
  />
66
67
  <View
@@ -24,8 +24,7 @@ interface EmptyProps {
24
24
  */
25
25
  description?: string;
26
26
  /**
27
- * Empty's variant
28
- * 'dark' if rendered on a dark background and 'light' otherwise
27
+ * Empty's variant.
29
28
  */
30
29
  variant?: 'light' | 'dark';
31
30
  /**
@@ -0,0 +1 @@
1
+ {"activate":50000,"add-emoji":50001,"add-person":50002,"adjustment":50003,"alignment":50004,"archive":50005,"bank":50006,"bell":50007,"billing":50008,"bookmark":50009,"box-check":50010,"box":50011,"buildings":50012,"cake":50013,"calendar-clock":50014,"calendar":50015,"candy-box-menu":50016,"carat-down-small":50017,"carat-down":50018,"carat-left":50019,"carat-right":50020,"carat-up":50021,"circle-add":50022,"circle-cancel":50023,"circle-check":50024,"circle-down":50025,"circle-info":50026,"circle-left":50027,"circle-ok":50028,"circle-pencil":50029,"circle-question":50030,"circle-remove":50031,"circle-right":50032,"circle-up":50033,"circle-warning":50034,"clock-3":50035,"clock":50036,"cloud-download":50037,"cloud-upload":50038,"cog":50039,"coin":50040,"contacts":50041,"credit-card":50042,"diamond":50043,"direction-arrows":50044,"directory":50045,"document":50046,"dollar-coin-shine":50047,"double-buildings":50048,"edit-template":50049,"envelope":50050,"expense":50051,"eye-circle":50052,"eye-invisible":50053,"eye":50054,"face-meh":50055,"face-sad":50056,"face-smiley":50057,"feed":50058,"feedbacks":50059,"file-certified":50060,"file-clone":50061,"file-copy":50062,"file-csv":50063,"file-dispose":50064,"file-doc":50065,"file-excel":50066,"file-export":50067,"file-lock":50068,"file-pdf":50069,"file-powerpoint":50070,"file-search":50071,"file-secured":50072,"file-sheets":50073,"file-slide":50074,"file-verified":50075,"file-word":50076,"file":50077,"folder-user":50078,"folder":50079,"format-bold":50080,"format-heading1":50081,"format-heading2":50082,"format-italic":50083,"format-list-bulleted":50084,"format-list-numbered":50085,"format-underlined":50086,"funnel-filter":50087,"global-dollar":50088,"globe":50089,"graduation-cap":50090,"graph":50091,"happy-sun":50092,"health-bag":50093,"heart":50094,"home":50095,"image":50096,"import":50097,"incident-siren":50098,"instapay":50099,"list":50100,"loading-2":50101,"loading":50102,"location":50103,"lock":50104,"looks-one":50105,"looks-two":50106,"mandatory":50107,"media-content":50108,"menu":50109,"moneybag":50110,"moon":50111,"multiple-stars":50112,"multiple-users":50113,"node":50114,"open-folder":50115,"paperclip":50116,"payment-summary":50117,"pencil":50118,"phone":50119,"piggy-bank":50120,"plane":50121,"play-circle":50122,"print":50123,"raising-hands":50124,"rectangle-mandatory":50125,"reply-arrow":50126,"reply":50127,"reschedule":50128,"rostering":50129,"save":50130,"schedule-send":50131,"schedule":50132,"search-person":50133,"send":50134,"speaker":50135,"star-award":50136,"star-badge":50137,"star-medal":50138,"star":50139,"steps-circle":50140,"stopwatch":50141,"suitcase":50142,"survey":50143,"swag":50144,"switch":50145,"tag":50146,"target":50147,"teams":50148,"timesheet":50149,"touch-id":50150,"trash-bin":50151,"unlock":50152,"user":50153,"video-1":50154,"video-2":50155,"warning":50156,"activate-outlined":50157,"add-person-outlined":50158,"add-section-outlined":50159,"add-time-outlined":50160,"add":50161,"adjustment-outlined":50162,"alignment-2-outlined":50163,"alignment-outlined":50164,"all-caps":50165,"arrow-down":50166,"arrow-left":50167,"arrow-right":50168,"arrow-up":50169,"at-sign":50170,"bell-outlined":50171,"billing-outlined":50172,"body-outlined":50173,"bold":50174,"bookmark-outlined":50175,"box-check-outlined":50176,"box-outlined":50177,"bullet-points":50178,"cake-outlined":50179,"calendar-dates-outlined":50180,"calendar-star-outlined":50181,"camera-outlined":50182,"cancel":50183,"checkmark":50184,"circle-add-outlined":50185,"circle-cancel-outlined":50186,"circle-down-outlined":50187,"circle-info-outlined":50188,"circle-left-outlined":50189,"circle-ok-outlined":50190,"circle-question-outlined":50191,"circle-remove-outlined":50192,"circle-right-outlined":50193,"circle-up-outlined":50194,"circle-warning-outlined":50195,"clock-2-outlined":50196,"clock-outlined":50197,"cog-outlined":50198,"coin-outlined":50199,"comment-outlined":50200,"contacts-outlined":50201,"credit-card-outlined":50202,"direction-arrows-outlined":50203,"directory-outlined":50204,"document-outlined":50205,"dollar-coin-shine-outlined":50206,"dollar-sign":50207,"double-buildings-outlined":50208,"double-left-arrows":50209,"double-right-arrows":50210,"download-outlined":50211,"edit-template-outlined":50212,"email-outlined":50213,"enter-arrow":50214,"envelope-outlined":50215,"expense-outlined":50216,"external-link":50217,"eye-invisible-outlined":50218,"eye-outlined":50219,"face-id":50220,"face-meh-outlined":50221,"face-open-smiley-outlined":50222,"face-sad-outlined":50223,"face-smiley-outlined":50224,"feed-outlined":50225,"file-certified-outlined":50226,"file-clone-outlined":50227,"file-copy-outlined":50228,"file-dispose-outlined":50229,"file-download-outlined":50230,"file-export-outlined":50231,"file-lock-outlined":50232,"file-outlined":50233,"file-search-outlined":50234,"file-secured-outlined":50235,"file-verified-outlined":50236,"filter-outlined":50237,"folder-outlined":50238,"folder-user-outlined":50239,"funnel-filter-outline":50240,"graph-outlined":50241,"happy-sun-outlined":50242,"health-bag-outlined":50243,"heart-outlined":50244,"home-outlined":50245,"image-outlined":50246,"import-outlined":50247,"instapay-outlined":50248,"italic":50249,"link-1":50250,"link-2":50251,"list-outlined":50252,"location-outlined":50253,"lock-outlined":50254,"locked-file-outlined":50255,"log-out":50256,"media-content-outlined":50257,"menu-close":50258,"menu-expand":50259,"menu-fold-outlined":50260,"menu-unfold-outlined":50261,"moneybag-outlined":50262,"moon-outlined":50263,"more-horizontal":50264,"more-vertical":50265,"multiple-folders-outlined":50266,"multiple-users-outlined":50267,"node-outlined":50268,"number-points":50269,"number":50270,"payment-summary-outlined":50271,"payslip-outlined":50272,"pencil-outlined":50273,"percentage":50274,"phone-outlined":50275,"piggy-bank-outlined":50276,"plane-outlined":50277,"play-circle-outlined":50278,"print-outlined":50279,"qr-code-outlined":50280,"re-assign":50281,"redeem":50282,"refresh":50283,"remove":50284,"reply-outlined":50285,"restart":50286,"return-arrow":50287,"rostering-outlined":50288,"save-outlined":50289,"schedule-outlined":50290,"search-outlined":50291,"send-outlined":50292,"share-1":50293,"share-2":50294,"single-down-arrow":50295,"single-left-arrow":50296,"single-right-arrow":50297,"single-up-arrow":50298,"speaker-outlined":50299,"star-outlined":50300,"stopwatch-outlined":50301,"strikethrough":50302,"suitcase-outlined":50303,"survey-outlined":50304,"switch-outlined":50305,"sync":50306,"target-outlined":50307,"timesheet-outlined":50308,"transfer":50309,"trash-bin-outlined":50310,"trash-outlined":50311,"unavailable":50312,"underline":50313,"unlock-outlined":50314,"upload-outlined":50315,"user-circle-outlined":50316,"user-outlined":50317,"user-rectangle-outlined":50318,"video-1-outlined":50319,"video-2-outlined":50320,"wallet-outlined":50321}
@@ -1,6 +1,6 @@
1
- import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
1
+ import { createIconSet } from 'react-native-vector-icons';
2
2
  import styled from '@emotion/native';
3
- import heroIconConfig from './selection.json';
3
+ import glyphMap from './glyphMap.json';
4
4
 
5
5
  type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
6
6
  type ThemeIntent =
@@ -14,11 +14,7 @@ type ThemeIntent =
14
14
  | 'disabled-text'
15
15
  | 'text-inverted';
16
16
 
17
- const HeroIcon = createIconSetFromIcoMoon(
18
- heroIconConfig,
19
- 'hero-icons',
20
- 'hero-icons.ttf'
21
- );
17
+ const HeroIcon = createIconSet(glyphMap, 'hero-icons', 'hero-icons.ttf');
22
18
 
23
19
  const COLOR_INTENTS = {
24
20
  text: 'text',
@@ -1,3 +1,4 @@
1
+ // 🔴 DO NOT EDIT — This file is generated automatically.
1
2
  const IconList = [
2
3
  'activate',
3
4
  'add-emoji',
@@ -34,8 +35,8 @@ const IconList = [
34
35
  'circle-right',
35
36
  'circle-up',
36
37
  'circle-warning',
37
- 'clock',
38
38
  'clock-3',
39
+ 'clock',
39
40
  'cloud-download',
40
41
  'cloud-upload',
41
42
  'cog',
@@ -77,7 +78,6 @@ const IconList = [
77
78
  'file-verified',
78
79
  'file-word',
79
80
  'file',
80
- 'filter-outlined',
81
81
  'folder-user',
82
82
  'folder',
83
83
  'format-bold',
@@ -101,8 +101,8 @@ const IconList = [
101
101
  'incident-siren',
102
102
  'instapay',
103
103
  'list',
104
- 'loading',
105
104
  'loading-2',
105
+ 'loading',
106
106
  'location',
107
107
  'lock',
108
108
  'looks-one',
@@ -125,8 +125,9 @@ const IconList = [
125
125
  'play-circle',
126
126
  'print',
127
127
  'raising-hands',
128
- 'reply',
128
+ 'rectangle-mandatory',
129
129
  'reply-arrow',
130
+ 'reply',
130
131
  'reschedule',
131
132
  'rostering',
132
133
  'save',
@@ -155,6 +156,7 @@ const IconList = [
155
156
  'user',
156
157
  'video-1',
157
158
  'video-2',
159
+ 'warning',
158
160
  'activate-outlined',
159
161
  'add-person-outlined',
160
162
  'add-section-outlined',
@@ -235,6 +237,7 @@ const IconList = [
235
237
  'file-search-outlined',
236
238
  'file-secured-outlined',
237
239
  'file-verified-outlined',
240
+ 'filter-outlined',
238
241
  'folder-outlined',
239
242
  'folder-user-outlined',
240
243
  'funnel-filter-outline',
@@ -308,6 +311,7 @@ const IconList = [
308
311
  'timesheet-outlined',
309
312
  'transfer',
310
313
  'trash-bin-outlined',
314
+ 'trash-outlined',
311
315
  'unavailable',
312
316
  'underline',
313
317
  'unlock-outlined',
@@ -318,7 +322,6 @@ const IconList = [
318
322
  'video-1-outlined',
319
323
  'video-2-outlined',
320
324
  'wallet-outlined',
321
- 'warning',
322
325
  ] as const;
323
326
 
324
327
  export default IconList;
@@ -68,4 +68,5 @@ const Icon = ({
68
68
  />
69
69
  );
70
70
 
71
+ Icon.List = IconList;
71
72
  export default Icon;
@@ -139,9 +139,6 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
139
139
  if (error) {
140
140
  return 'error';
141
141
  }
142
- if (isFocused) {
143
- return 'focused';
144
- }
145
142
  if (isEmptyValue) {
146
143
  return 'filled';
147
144
  }
@@ -312,7 +309,7 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
312
309
  return (
313
310
  <StyledContainer testID={testID}>
314
311
  <StyledTextInputContainer>
315
- <StyledBorderBackDrop themeVariant={variant} />
312
+ <StyledBorderBackDrop themeVariant={variant} themeFocused={isFocused} />
316
313
  {(isFocused || (label && !isEmptyValue)) && (
317
314
  <StyledLabelContainer pointerEvents="none">
318
315
  {required && (
@@ -40,6 +40,7 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
40
40
  undefined,
41
41
  ]
42
42
  }
43
+ themeFocused={false}
43
44
  themeVariant="error"
44
45
  />
45
46
  <View
@@ -300,6 +301,7 @@ exports[`RichTextEditor should render correctly 1`] = `
300
301
  undefined,
301
302
  ]
302
303
  }
304
+ themeFocused={false}
303
305
  themeVariant="error"
304
306
  />
305
307
  <View
@@ -727,12 +727,13 @@ exports[`OptionList render isLoading correctly 1`] = `
727
727
  "backgroundColor": "#001f23",
728
728
  "borderRadius": 999,
729
729
  "height": 16,
730
- "opacity": 1,
730
+ "opacity": 0.9,
731
731
  "width": 16,
732
732
  },
733
733
  Object {},
734
734
  ]
735
735
  }
736
+ themeIntent="primary"
736
737
  themePosition="topLeft"
737
738
  themeSize="medium"
738
739
  />
@@ -746,12 +747,13 @@ exports[`OptionList render isLoading correctly 1`] = `
746
747
  "borderRadius": 999,
747
748
  "height": 16,
748
749
  "marginLeft": 8,
749
- "opacity": 0.75,
750
+ "opacity": 0.675,
750
751
  "width": 16,
751
752
  },
752
753
  Object {},
753
754
  ]
754
755
  }
756
+ themeIntent="primary"
755
757
  themePosition="topRight"
756
758
  themeSize="medium"
757
759
  />
@@ -780,12 +782,13 @@ exports[`OptionList render isLoading correctly 1`] = `
780
782
  "backgroundColor": "#001f23",
781
783
  "borderRadius": 999,
782
784
  "height": 16,
783
- "opacity": 0.5,
785
+ "opacity": 0.45,
784
786
  "width": 16,
785
787
  },
786
788
  Object {},
787
789
  ]
788
790
  }
791
+ themeIntent="primary"
789
792
  themePosition="bottomLeft"
790
793
  themeSize="medium"
791
794
  />
@@ -799,12 +802,13 @@ exports[`OptionList render isLoading correctly 1`] = `
799
802
  "borderRadius": 999,
800
803
  "height": 16,
801
804
  "marginLeft": 8,
802
- "opacity": 0.25,
805
+ "opacity": 0.225,
803
806
  "width": 16,
804
807
  },
805
808
  Object {},
806
809
  ]
807
810
  }
811
+ themeIntent="primary"
808
812
  themePosition="bottomRight"
809
813
  themeSize="medium"
810
814
  />
@@ -64,6 +64,7 @@ Array [
64
64
  undefined,
65
65
  ]
66
66
  }
67
+ themeFocused={false}
67
68
  themeVariant="default"
68
69
  />
69
70
  <View
@@ -1413,6 +1414,7 @@ Array [
1413
1414
  undefined,
1414
1415
  ]
1415
1416
  }
1417
+ themeFocused={false}
1416
1418
  themeVariant="filled"
1417
1419
  />
1418
1420
  <View
@@ -2958,6 +2960,7 @@ Array [
2958
2960
  undefined,
2959
2961
  ]
2960
2962
  }
2963
+ themeFocused={false}
2961
2964
  themeVariant="filled"
2962
2965
  />
2963
2966
  <View
@@ -4498,6 +4501,7 @@ Array [
4498
4501
  undefined,
4499
4502
  ]
4500
4503
  }
4504
+ themeFocused={false}
4501
4505
  themeVariant="readonly"
4502
4506
  />
4503
4507
  <View
@@ -6057,6 +6061,7 @@ Array [
6057
6061
  undefined,
6058
6062
  ]
6059
6063
  }
6064
+ themeFocused={false}
6060
6065
  themeVariant="filled"
6061
6066
  />
6062
6067
  <View
@@ -702,12 +702,13 @@ exports[`OptionList render isLoading correctly 1`] = `
702
702
  "backgroundColor": "#001f23",
703
703
  "borderRadius": 999,
704
704
  "height": 16,
705
- "opacity": 1,
705
+ "opacity": 0.9,
706
706
  "width": 16,
707
707
  },
708
708
  Object {},
709
709
  ]
710
710
  }
711
+ themeIntent="primary"
711
712
  themePosition="topLeft"
712
713
  themeSize="medium"
713
714
  />
@@ -721,12 +722,13 @@ exports[`OptionList render isLoading correctly 1`] = `
721
722
  "borderRadius": 999,
722
723
  "height": 16,
723
724
  "marginLeft": 8,
724
- "opacity": 0.75,
725
+ "opacity": 0.675,
725
726
  "width": 16,
726
727
  },
727
728
  Object {},
728
729
  ]
729
730
  }
731
+ themeIntent="primary"
730
732
  themePosition="topRight"
731
733
  themeSize="medium"
732
734
  />
@@ -755,12 +757,13 @@ exports[`OptionList render isLoading correctly 1`] = `
755
757
  "backgroundColor": "#001f23",
756
758
  "borderRadius": 999,
757
759
  "height": 16,
758
- "opacity": 0.5,
760
+ "opacity": 0.45,
759
761
  "width": 16,
760
762
  },
761
763
  Object {},
762
764
  ]
763
765
  }
766
+ themeIntent="primary"
764
767
  themePosition="bottomLeft"
765
768
  themeSize="medium"
766
769
  />
@@ -774,12 +777,13 @@ exports[`OptionList render isLoading correctly 1`] = `
774
777
  "borderRadius": 999,
775
778
  "height": 16,
776
779
  "marginLeft": 8,
777
- "opacity": 0.25,
780
+ "opacity": 0.225,
778
781
  "width": 16,
779
782
  },
780
783
  Object {},
781
784
  ]
782
785
  }
786
+ themeIntent="primary"
783
787
  themePosition="bottomRight"
784
788
  themeSize="medium"
785
789
  />
@@ -64,6 +64,7 @@ Array [
64
64
  undefined,
65
65
  ]
66
66
  }
67
+ themeFocused={false}
67
68
  themeVariant="default"
68
69
  />
69
70
  <View
@@ -1341,6 +1342,7 @@ Array [
1341
1342
  undefined,
1342
1343
  ]
1343
1344
  }
1345
+ themeFocused={false}
1344
1346
  themeVariant="filled"
1345
1347
  />
1346
1348
  <View
@@ -2763,6 +2765,7 @@ Array [
2763
2765
  undefined,
2764
2766
  ]
2765
2767
  }
2768
+ themeFocused={false}
2766
2769
  themeVariant="filled"
2767
2770
  />
2768
2771
  <View
@@ -4182,6 +4185,7 @@ Array [
4182
4185
  undefined,
4183
4186
  ]
4184
4187
  }
4188
+ themeFocused={false}
4185
4189
  themeVariant="readonly"
4186
4190
  />
4187
4191
  <View
@@ -5618,6 +5622,7 @@ Array [
5618
5622
  undefined,
5619
5623
  ]
5620
5624
  }
5625
+ themeFocused={false}
5621
5626
  themeVariant="filled"
5622
5627
  />
5623
5628
  <View
@@ -7,7 +7,13 @@ const AnimatedRow = Animated.createAnimatedComponent(StyledSpinnerRow);
7
7
 
8
8
  const AnimatedDot = Animated.createAnimatedComponent(StyledSpinnerDot);
9
9
 
10
- const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
10
+ const AnimatedSpinner = ({
11
+ size,
12
+ intent,
13
+ }: {
14
+ size: 'small' | 'medium';
15
+ intent: 'primary' | 'inverted';
16
+ }) => {
11
17
  const rotateAnimation = useRef<Animated.Value>(new Animated.Value(0));
12
18
 
13
19
  useEffect(() => {
@@ -32,6 +38,15 @@ const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
32
38
  outputRange: ['0deg', '360deg'],
33
39
  });
34
40
 
41
+ const rowProps = {
42
+ themeSize: size,
43
+ };
44
+
45
+ const dotProps = {
46
+ themeSize: size,
47
+ themeIntent: intent,
48
+ };
49
+
35
50
  return (
36
51
  <Animated.View
37
52
  style={StyleSheet.flatten([
@@ -40,13 +55,13 @@ const AnimatedSpinner = ({ size = 'medium' }: { size: 'small' | 'medium' }) => {
40
55
  },
41
56
  ])}
42
57
  >
43
- <AnimatedRow themePosition="top" themeSize={size}>
44
- <AnimatedDot themePosition="topLeft" themeSize={size} />
45
- <AnimatedDot themePosition="topRight" themeSize={size} />
58
+ <AnimatedRow themePosition="top" {...rowProps}>
59
+ <AnimatedDot themePosition="topLeft" {...dotProps} />
60
+ <AnimatedDot themePosition="topRight" {...dotProps} />
46
61
  </AnimatedRow>
47
- <AnimatedRow themePosition="bottom" themeSize={size}>
48
- <AnimatedDot themePosition="bottomLeft" themeSize={size} />
49
- <AnimatedDot themePosition="bottomRight" themeSize={size} />
62
+ <AnimatedRow themePosition="bottom" {...rowProps}>
63
+ <AnimatedDot themePosition="bottomLeft" {...dotProps} />
64
+ <AnimatedDot themePosition="bottomRight" {...dotProps} />
50
65
  </AnimatedRow>
51
66
  </Animated.View>
52
67
  );
@@ -25,30 +25,35 @@ const StyledSpinnerRow = styled(View)<{
25
25
  const StyledSpinnerDot = styled(View)<{
26
26
  themePosition: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
27
27
  themeSize: 'small' | 'medium';
28
- }>(({ themePosition, themeSize = 'medium', theme }) => {
28
+ themeIntent: 'primary' | 'inverted';
29
+ }>(({ themePosition, themeSize, themeIntent, theme }) => {
29
30
  const themeStyling = () => {
31
+ const backgroundColor =
32
+ theme.__hd__.spinner.colors.dot[themeIntent];
33
+ const dotPadding = theme.__hd__.spinner.space.spinnerDotPadding[themeSize];
34
+
30
35
  switch (themePosition) {
31
36
  case 'topLeft':
32
37
  return {
33
- backgroundColor: theme.__hd__.spinner.colors.dot,
34
- opacity: 1,
38
+ backgroundColor,
39
+ opacity: 0.9,
35
40
  };
36
41
  case 'topRight':
37
42
  return {
38
- marginLeft: theme.__hd__.spinner.space.spinnerDotPadding[themeSize],
39
- backgroundColor: theme.__hd__.spinner.colors.dot,
40
- opacity: 0.75,
43
+ marginLeft: dotPadding,
44
+ backgroundColor,
45
+ opacity: 0.675,
41
46
  };
42
47
  case 'bottomLeft':
43
48
  return {
44
- backgroundColor: theme.__hd__.spinner.colors.dot,
45
- opacity: 0.5,
49
+ backgroundColor,
50
+ opacity: 0.45,
46
51
  };
47
52
  case 'bottomRight':
48
53
  return {
49
- marginLeft: theme.__hd__.spinner.space.spinnerDotPadding[themeSize],
50
- backgroundColor: theme.__hd__.spinner.colors.dot,
51
- opacity: 0.25,
54
+ marginLeft: dotPadding,
55
+ backgroundColor,
56
+ opacity: 0.225,
52
57
  };
53
58
  }
54
59
  };
@@ -4,7 +4,9 @@ import { AnimatedSpinner } from '../AnimatedSpinner';
4
4
 
5
5
  describe('AnimatedSpinner', () => {
6
6
  it('renders correctly', () => {
7
- const { toJSON } = renderWithTheme(<AnimatedSpinner size="medium" />);
7
+ const { toJSON } = renderWithTheme(
8
+ <AnimatedSpinner size="medium" intent="primary" />
9
+ );
8
10
 
9
11
  expect(toJSON()).toMatchSnapshot();
10
12
  });
@@ -8,25 +8,24 @@ import {
8
8
  } from '../StyledSpinner';
9
9
 
10
10
  describe('StyledSpinnerContainer', () => {
11
- it('renders correctly in small size', () => {
12
- const { toJSON } = renderWithTheme(
13
- <StyledSpinnerContainer>
14
- <AnimatedSpinner size="small" />
15
- </StyledSpinnerContainer>
16
- );
17
-
18
- expect(toJSON()).toMatchSnapshot();
19
- });
20
-
21
- it('renders correctly in medium size', () => {
22
- const { toJSON } = renderWithTheme(
23
- <StyledSpinnerContainer>
24
- <AnimatedSpinner size="medium" />
25
- </StyledSpinnerContainer>
26
- );
11
+ it.each`
12
+ intent | size
13
+ ${'primary'} | ${'small'}
14
+ ${'inverted'} | ${'small'}
15
+ ${'primary'} | ${'medium'}
16
+ ${'inverted'} | ${'medium'}
17
+ `(
18
+ 'renders correctly when intent is $themeIntent, and size is $themeSize',
19
+ ({ intent, size }) => {
20
+ const { toJSON } = renderWithTheme(
21
+ <StyledSpinnerContainer>
22
+ <AnimatedSpinner size={size} intent={intent} />
23
+ </StyledSpinnerContainer>
24
+ );
27
25
 
28
- expect(toJSON()).toMatchSnapshot();
29
- });
26
+ expect(toJSON()).toMatchSnapshot();
27
+ }
28
+ );
30
29
  });
31
30
 
32
31
  describe('StyledSpinnerRow', () => {
@@ -48,22 +47,34 @@ describe('StyledSpinnerRow', () => {
48
47
  );
49
48
  });
50
49
 
51
- describe('StyledSpinnerText', () => {
50
+ describe('StyledSpinnerDot', () => {
52
51
  it.each`
53
- themePosition | themeSize
54
- ${'topLeft'} | ${'small'}
55
- ${'topRight'} | ${'small'}
56
- ${'bottomLeft'} | ${'small'}
57
- ${'bottomRight'} | ${'small'}
58
- ${'topLeft'} | ${'medium'}
59
- ${'topRight'} | ${'medium'}
60
- ${'bottomLeft'} | ${'medium'}
61
- ${'bottomRight'} | ${'medium'}
52
+ themePosition | themeSize | themeIntent
53
+ ${'topLeft'} | ${'small'} | ${'primary'}
54
+ ${'topRight'} | ${'small'} | ${'primary'}
55
+ ${'bottomLeft'} | ${'small'} | ${'primary'}
56
+ ${'bottomRight'} | ${'small'} | ${'primary'}
57
+ ${'topLeft'} | ${'medium'} | ${'primary'}
58
+ ${'topRight'} | ${'medium'} | ${'primary'}
59
+ ${'bottomLeft'} | ${'medium'} | ${'primary'}
60
+ ${'bottomRight'} | ${'medium'} | ${'primary'}
61
+ ${'topLeft'} | ${'small'} | ${'inverted'}
62
+ ${'topRight'} | ${'small'} | ${'inverted'}
63
+ ${'bottomLeft'} | ${'small'} | ${'inverted'}
64
+ ${'bottomRight'} | ${'small'} | ${'inverted'}
65
+ ${'topLeft'} | ${'medium'} | ${'inverted'}
66
+ ${'topRight'} | ${'medium'} | ${'inverted'}
67
+ ${'bottomLeft'} | ${'medium'} | ${'inverted'}
68
+ ${'bottomRight'} | ${'medium'} | ${'inverted'}
62
69
  `(
63
- 'renders correctly when position is $themePosition, size is $themeSize',
64
- ({ themePosition, themeSize }) => {
70
+ 'renders correctly when position is $themePosition, size is $themeSize, intent is $themeIntent',
71
+ ({ themePosition, themeSize, themeIntent }) => {
65
72
  const { toJSON } = renderWithTheme(
66
- <StyledSpinnerDot themePosition={themePosition} themeSize={themeSize} />
73
+ <StyledSpinnerDot
74
+ themePosition={themePosition}
75
+ themeSize={themeSize}
76
+ themeIntent={themeIntent}
77
+ />
67
78
  );
68
79
 
69
80
  expect(toJSON()).toMatchSnapshot();