@hero-design/rn 8.70.0 → 8.72.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 (76) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +29 -0
  3. package/es/index.js +402 -219
  4. package/lib/index.js +402 -219
  5. package/package.json +1 -1
  6. package/src/components/Accordion/AccordionItem.tsx +1 -1
  7. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
  8. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  9. package/src/components/Badge/StyledBadge.tsx +17 -2
  10. package/src/components/Badge/__tests__/Badge.spec.tsx +15 -0
  11. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +187 -0
  12. package/src/components/Badge/index.tsx +20 -36
  13. package/src/components/Badge/types.ts +55 -0
  14. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +3 -3
  15. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
  16. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +7 -7
  17. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +6 -6
  18. package/src/components/Chip/StyledChip.tsx +44 -8
  19. package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +212 -2
  20. package/src/components/Chip/__tests__/index.spec.tsx +2 -0
  21. package/src/components/Chip/index.tsx +1 -1
  22. package/src/components/FAB/FAB.tsx +6 -1
  23. package/src/components/FAB/Pair/StyledFAB.tsx +19 -0
  24. package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +276 -0
  25. package/src/components/FAB/Pair/__tests__/index.spec.tsx +39 -0
  26. package/src/components/FAB/Pair/index.tsx +46 -0
  27. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +31 -14
  28. package/src/components/FAB/index.tsx +3 -1
  29. package/src/components/Progress/ProgressStep.tsx +3 -1
  30. package/src/components/Progress/StyledStep.tsx +13 -11
  31. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +215 -4
  32. package/src/components/Progress/__tests__/index.spec.js +16 -4
  33. package/src/components/Search/SearchOneLine.tsx +7 -1
  34. package/src/components/Search/SearchSuffixIcon.tsx +12 -1
  35. package/src/components/Search/SearchTwoLine.tsx +7 -1
  36. package/src/components/Search/StyledSearch.tsx +42 -16
  37. package/src/components/Search/__tests__/SearchOneLine.spec.tsx +30 -0
  38. package/src/components/Search/__tests__/SearchTwoLine.spec.tsx +15 -0
  39. package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +166 -10
  40. package/src/components/Search/__tests__/__snapshots__/SearchSuffixIcon.spec.tsx.snap +3 -0
  41. package/src/components/Search/__tests__/__snapshots__/SearchTwoLine.spec.tsx.snap +182 -2
  42. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
  43. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -0
  44. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +6 -0
  45. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +3 -0
  46. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +9 -0
  47. package/src/components/Toolbar/StyledToolbar.tsx +11 -0
  48. package/src/components/Toolbar/ToolbarItem.tsx +3 -3
  49. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +24 -4
  50. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +50 -9
  51. package/src/theme/components/badge.ts +10 -1
  52. package/src/theme/components/button.ts +2 -2
  53. package/src/theme/components/chip.ts +4 -0
  54. package/src/theme/components/fab.ts +3 -0
  55. package/src/theme/components/search.ts +30 -5
  56. package/src/theme/components/switch.ts +2 -2
  57. package/src/theme/components/toolbar.ts +1 -1
  58. package/stats/8.71.0/rn-stats.html +4842 -0
  59. package/stats/8.72.0/rn-stats.html +4844 -0
  60. package/types/components/Badge/StyledBadge.d.ts +9 -1
  61. package/types/components/Badge/index.d.ts +3 -34
  62. package/types/components/Badge/types.d.ts +53 -0
  63. package/types/components/Chip/StyledChip.d.ts +1 -1
  64. package/types/components/Chip/index.d.ts +1 -1
  65. package/types/components/FAB/Pair/StyledFAB.d.ts +12 -0
  66. package/types/components/FAB/Pair/index.d.ts +16 -0
  67. package/types/components/FAB/index.d.ts +1 -0
  68. package/types/components/Progress/StyledStep.d.ts +2 -0
  69. package/types/components/Search/SearchOneLine.d.ts +5 -0
  70. package/types/components/Search/SearchTwoLine.d.ts +5 -0
  71. package/types/components/Search/StyledSearch.d.ts +7 -2
  72. package/types/components/Toolbar/StyledToolbar.d.ts +9 -2
  73. package/types/theme/components/badge.d.ts +8 -0
  74. package/types/theme/components/chip.d.ts +4 -0
  75. package/types/theme/components/fab.d.ts +3 -0
  76. package/types/theme/components/search.d.ts +31 -5
@@ -187,7 +187,12 @@ exports[`ToolbarItems renders correctly when intent is danger, icon is undefined
187
187
  "letterSpacing": 0.24,
188
188
  "lineHeight": 24,
189
189
  },
190
- undefined,
190
+ [
191
+ {
192
+ "color": "#f46363",
193
+ },
194
+ undefined,
195
+ ],
191
196
  ]
192
197
  }
193
198
  themeIntent="danger"
@@ -279,7 +284,12 @@ exports[`ToolbarItems renders correctly when intent is info, icon is undefined,
279
284
  "letterSpacing": 0.24,
280
285
  "lineHeight": 24,
281
286
  },
282
- undefined,
287
+ [
288
+ {
289
+ "color": "#355bfb",
290
+ },
291
+ undefined,
292
+ ],
283
293
  ]
284
294
  }
285
295
  themeIntent="info"
@@ -729,7 +739,12 @@ exports[`ToolbarItems renders correctly when intent is success, icon is undefine
729
739
  "letterSpacing": 0.24,
730
740
  "lineHeight": 24,
731
741
  },
732
- undefined,
742
+ [
743
+ {
744
+ "color": "#5ace7d",
745
+ },
746
+ undefined,
747
+ ],
733
748
  ]
734
749
  }
735
750
  themeIntent="success"
@@ -821,7 +836,12 @@ exports[`ToolbarItems renders correctly when intent is warning, icon is undefine
821
836
  "letterSpacing": 0.24,
822
837
  "lineHeight": 24,
823
838
  },
824
- undefined,
839
+ [
840
+ {
841
+ "color": "#ffbe71",
842
+ },
843
+ undefined,
844
+ ],
825
845
  ]
826
846
  }
827
847
  themeIntent="warning"
@@ -116,8 +116,12 @@ exports[`theme returns correct theme object 1`] = `
116
116
  },
117
117
  },
118
118
  "badge": {
119
+ "borderWidths": {
120
+ "default": 2,
121
+ },
119
122
  "colors": {
120
123
  "archived": "#606065",
124
+ "border": "#ffffff",
121
125
  "danger": "#cb300a",
122
126
  "info": "#355bfb",
123
127
  "primary": "#401960",
@@ -126,6 +130,10 @@ exports[`theme returns correct theme object 1`] = `
126
130
  "warning": "#ac5d00",
127
131
  },
128
132
  "fontSizes": {
133
+ "icon": {
134
+ "medium": 12,
135
+ "small": 8,
136
+ },
129
137
  "medium": 12,
130
138
  "small": 8,
131
139
  },
@@ -237,10 +245,10 @@ exports[`theme returns correct theme object 1`] = `
237
245
  "outlinedSecondary": "#ece8ef",
238
246
  "textDanger": "#fcebe7",
239
247
  "textPrimary": "#ece8ef",
240
- "textSecondary": "#ece8ef",
248
+ "textSecondary": "#f6f6f7",
241
249
  },
242
250
  "primary": "#401960",
243
- "secondary": "#795e90",
251
+ "secondary": "#4d6265",
244
252
  "textLoadingBackground": "#ece8ef",
245
253
  "utilityBackground": "#ffffff",
246
254
  },
@@ -379,6 +387,8 @@ exports[`theme returns correct theme object 1`] = `
379
387
  "wrapper": 1,
380
388
  },
381
389
  "colors": {
390
+ "compactDefaultBackground": "#ffffff",
391
+ "compactSelectedBackground": "#f6f6f7",
382
392
  "filledBackground": "#ffffff",
383
393
  "outlinedDefaultBackground": "#ffffff",
384
394
  "outlinedDefaultBorder": "#bfc1c5",
@@ -407,6 +417,8 @@ exports[`theme returns correct theme object 1`] = `
407
417
  "outlinedSelectedBorder": 2,
408
418
  },
409
419
  "space": {
420
+ "compactWrapperHorizontalPadding": 8,
421
+ "compactWrapperVerticalPadding": 4,
410
422
  "iconWrapperHorizontalMargin": 8,
411
423
  "outlinedSelectedMarginTop": -2,
412
424
  "wrapperHorizontalPadding": 12,
@@ -563,6 +575,8 @@ exports[`theme returns correct theme object 1`] = `
563
575
  "radius": 4,
564
576
  },
565
577
  "sizes": {
578
+ "fabPairHeight": 48,
579
+ "fabPairIconOnlyWidth": 48,
566
580
  "height": 64,
567
581
  "iconContainerHeight": 24,
568
582
  "iconContainerWidth": 24,
@@ -576,6 +590,7 @@ exports[`theme returns correct theme object 1`] = `
576
590
  "buttonMarginRight": 24,
577
591
  "buttonMarginTop": 24,
578
592
  "containerPadding": 20,
593
+ "fabPairMarginRight": 8,
579
594
  "titleMarginHorizontal": 8,
580
595
  },
581
596
  },
@@ -819,14 +834,29 @@ exports[`theme returns correct theme object 1`] = `
819
834
  "search": {
820
835
  "borderWidths": {
821
836
  "container": {
822
- "focused": 2,
823
- "normal": 1,
837
+ "basic": {
838
+ "focused": 2,
839
+ "normal": 2,
840
+ },
841
+ "reversed": {
842
+ "focused": 2,
843
+ "normal": 1,
844
+ },
824
845
  },
825
846
  },
826
847
  "colors": {
827
- "borders": "#001f23",
828
- "containerBackground": "#f6f6f7",
829
- "surfixBackground": "#ffffff",
848
+ "basic": {
849
+ "border": "#f6f6f7",
850
+ "containerBackground": "#f6f6f7",
851
+ "focusedBorder": "#001f23",
852
+ },
853
+ "reversed": {
854
+ "border": "#e8e9ea",
855
+ "containerBackground": "#ffffff",
856
+ "focusedBorder": "#001f23",
857
+ },
858
+ "shadow": "#001f23",
859
+ "suffixBackground": "#ffffff",
830
860
  "text": "#001f23",
831
861
  },
832
862
  "fontSizes": {
@@ -839,6 +869,16 @@ exports[`theme returns correct theme object 1`] = `
839
869
  "container": 999,
840
870
  "surfix": 999,
841
871
  },
872
+ "shadows": {
873
+ "color": "#001f23",
874
+ "elevation": 3,
875
+ "offset": {
876
+ "height": 2,
877
+ "width": 0,
878
+ },
879
+ "opacity": 0.12,
880
+ "radius": 4,
881
+ },
842
882
  "sizes": {
843
883
  "surfixSize": 40,
844
884
  },
@@ -848,6 +888,7 @@ exports[`theme returns correct theme object 1`] = `
848
888
  "containerHorizontalPadding": 8,
849
889
  "containerVerticalPadding": 8,
850
890
  "inputHorizontalMargin": 8,
891
+ "inputVerticalPadding": 2,
851
892
  "prefixHorizontalPadding": 4,
852
893
  "surfixPadding": 8,
853
894
  },
@@ -976,7 +1017,7 @@ exports[`theme returns correct theme object 1`] = `
976
1017
  "backgroundColors": {
977
1018
  "checked": "#401960",
978
1019
  "disabled-checked": "#ece8ef",
979
- "disabled-unchecked": "#bfc1c5",
1020
+ "disabled-unchecked": "#4d6265",
980
1021
  "unchecked": "#808f91",
981
1022
  },
982
1023
  "selector": {
@@ -1212,7 +1253,7 @@ exports[`theme returns correct theme object 1`] = `
1212
1253
  "iconButtonBackground": "#ece8ef",
1213
1254
  "info": "#b5c3fd",
1214
1255
  "primary": "#401960",
1215
- "secondary": "#795e90",
1256
+ "secondary": "#4d6265",
1216
1257
  "success": "#5ace7d",
1217
1258
  },
1218
1259
  "radii": {
@@ -9,6 +9,7 @@ const getBadgeTheme = (theme: GlobalTheme) => {
9
9
  warning: theme.colors.onWarningSurface,
10
10
  archived: theme.colors.onArchivedSurface,
11
11
  text: theme.colors.onDarkGlobalSurface,
12
+ border: theme.colors.defaultGlobalSurface,
12
13
  };
13
14
 
14
15
  const fonts = {
@@ -19,6 +20,10 @@ const getBadgeTheme = (theme: GlobalTheme) => {
19
20
  const fontSizes = {
20
21
  medium: theme.fontSizes.small,
21
22
  small: 8,
23
+ icon: {
24
+ medium: theme.fontSizes.small,
25
+ small: 8,
26
+ },
22
27
  };
23
28
 
24
29
  const lineHeights = {
@@ -39,6 +44,10 @@ const getBadgeTheme = (theme: GlobalTheme) => {
39
44
  statusWidth: theme.sizes.small,
40
45
  };
41
46
 
47
+ const borderWidths = {
48
+ default: theme.borderWidths.medium,
49
+ };
50
+
42
51
  const space = {
43
52
  medium: {
44
53
  horizontalPadding: theme.space.small,
@@ -50,7 +59,7 @@ const getBadgeTheme = (theme: GlobalTheme) => {
50
59
  statusPositionRight: -theme.space.xxsmall,
51
60
  };
52
61
 
53
- return { colors, fonts, fontSizes, sizes, space, lineHeights };
62
+ return { colors, fonts, fontSizes, sizes, space, lineHeights, borderWidths };
54
63
  };
55
64
 
56
65
  export type BadgeThemeType = ReturnType<typeof getBadgeTheme>;
@@ -35,7 +35,7 @@ const getButtonTheme = (theme: GlobalTheme) => {
35
35
 
36
36
  const colors = {
37
37
  primary: theme.colors.primary,
38
- secondary: theme.colors.secondary,
38
+ secondary: theme.colors.mutedOnDefaultGlobalSurface,
39
39
  danger: theme.colors.onErrorSurface,
40
40
  defaultText: theme.colors.onDefaultGlobalSurface,
41
41
  disabledText: theme.colors.disabledOnDefaultGlobalSurface,
@@ -52,7 +52,7 @@ const getButtonTheme = (theme: GlobalTheme) => {
52
52
  outlinedSecondary: theme.colors.highlightedSurface,
53
53
  outlineDanger: theme.colors.errorSurface,
54
54
  textPrimary: theme.colors.highlightedSurface,
55
- textSecondary: theme.colors.highlightedSurface,
55
+ textSecondary: theme.colors.neutralGlobalSurface,
56
56
  textDanger: theme.colors.errorSurface,
57
57
  },
58
58
  };
@@ -9,11 +9,15 @@ const getChipTheme = (theme: GlobalTheme) => {
9
9
  outlinedSelectedBackground: theme.colors.secondaryOutline,
10
10
  outlinedSelectedBorder: theme.colors.primaryOutline,
11
11
  outlinedDefaultBorder: theme.colors.disabledOnDefaultGlobalSurface,
12
+ compactDefaultBackground: theme.colors.defaultGlobalSurface,
13
+ compactSelectedBackground: theme.colors.neutralGlobalSurface,
12
14
  };
13
15
 
14
16
  const space = {
15
17
  wrapperHorizontalPadding: theme.space.smallMedium,
16
18
  wrapperVerticalPadding: theme.space.small,
19
+ compactWrapperHorizontalPadding: theme.space.small,
20
+ compactWrapperVerticalPadding: theme.space.xsmall,
17
21
  iconWrapperHorizontalMargin: theme.space.small,
18
22
  outlinedSelectedMarginTop: -theme.space.xxsmall,
19
23
  };
@@ -18,6 +18,8 @@ const getFABTheme = (theme: GlobalTheme) => {
18
18
  height: theme.sizes.xxxxxlarge,
19
19
  iconContainerWidth: theme.sizes.large,
20
20
  iconContainerHeight: theme.sizes.large,
21
+ fabPairHeight: theme.sizes.xxxlarge,
22
+ fabPairIconOnlyWidth: theme.sizes.xxxlarge,
21
23
  };
22
24
 
23
25
  const fonts = {
@@ -53,6 +55,7 @@ const getFABTheme = (theme: GlobalTheme) => {
53
55
  buttonMarginRight: theme.space.large,
54
56
  containerPadding: theme.space.large - theme.space.xsmall,
55
57
  titleMarginHorizontal: theme.space.small,
58
+ fabPairMarginRight: theme.space.small,
56
59
  };
57
60
 
58
61
  const radii = {
@@ -2,16 +2,34 @@ import type { GlobalTheme } from '../global';
2
2
 
3
3
  const getSearchTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
- containerBackground: theme.colors.neutralGlobalSurface,
6
- surfixBackground: theme.colors.defaultGlobalSurface,
5
+ basic: {
6
+ containerBackground: theme.colors.neutralGlobalSurface,
7
+ border: theme.colors.neutralGlobalSurface,
8
+ focusedBorder: theme.colors.primaryOutline,
9
+ },
10
+ reversed: {
11
+ containerBackground: theme.colors.defaultGlobalSurface,
12
+ border: theme.colors.secondaryOutline,
13
+ focusedBorder: theme.colors.primaryOutline,
14
+ },
15
+ suffixBackground: theme.colors.defaultGlobalSurface,
7
16
  text: theme.colors.onDefaultGlobalSurface,
8
- borders: theme.colors.primaryOutline,
17
+ shadow: theme.colors.primaryOutline,
18
+ };
19
+
20
+ const shadows = {
21
+ offset: theme.shadows.default.shadowOffset,
22
+ opacity: theme.shadows.default.shadowOpacity,
23
+ radius: theme.shadows.default.shadowRadius,
24
+ elevation: theme.shadows.default.elevation,
25
+ color: theme.shadows.default.shadowColor,
9
26
  };
10
27
 
11
28
  const space = {
12
29
  containerHorizontalPadding: theme.space.small,
13
30
  containerVerticalPadding: theme.space.small,
14
31
  inputHorizontalMargin: theme.space.small,
32
+ inputVerticalPadding: theme.space.xxsmall,
15
33
  prefixHorizontalPadding: theme.space.xsmall,
16
34
  surfixPadding: theme.space.small,
17
35
  badgeTop: -theme.space.xxsmall,
@@ -28,8 +46,14 @@ const getSearchTheme = (theme: GlobalTheme) => {
28
46
 
29
47
  const borderWidths = {
30
48
  container: {
31
- normal: theme.borderWidths.base,
32
- focused: theme.borderWidths.medium,
49
+ basic: {
50
+ normal: theme.borderWidths.medium,
51
+ focused: theme.borderWidths.medium,
52
+ },
53
+ reversed: {
54
+ normal: theme.borderWidths.base,
55
+ focused: theme.borderWidths.medium,
56
+ },
33
57
  },
34
58
  };
35
59
 
@@ -50,6 +74,7 @@ const getSearchTheme = (theme: GlobalTheme) => {
50
74
  borderWidths,
51
75
  radii,
52
76
  sizes,
77
+ shadows,
53
78
  };
54
79
  };
55
80
 
@@ -6,9 +6,9 @@ const getSwitchTheme = (theme: GlobalTheme) => {
6
6
  checked: theme.colors.primary,
7
7
  unchecked: theme.colors.inactiveOnDefaultGlobalSurface,
8
8
  'disabled-checked': theme.colors.highlightedSurface,
9
- 'disabled-unchecked': theme.colors.disabledOnDefaultGlobalSurface,
9
+ 'disabled-unchecked': theme.colors.mutedOnDefaultGlobalSurface,
10
10
  },
11
- thumb: theme.colors.onSecondary,
11
+ thumb: theme.colors.onDarkGlobalSurface,
12
12
  selector: {
13
13
  background: theme.colors.defaultGlobalSurface,
14
14
  textBackground: theme.colors.decorativePrimarySurface,
@@ -6,7 +6,7 @@ const getToolbarTheme = (theme: GlobalTheme) => {
6
6
  background: theme.colors.defaultGlobalSurface,
7
7
  border: theme.colors.secondaryOutline,
8
8
  primary: theme.colors.primary,
9
- secondary: theme.colors.secondary,
9
+ secondary: theme.colors.mutedOnDefaultGlobalSurface,
10
10
  info: theme.colors.info,
11
11
  success: theme.colors.success,
12
12
  danger: theme.colors.warning,