@hero-design/rn 8.71.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.
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +23 -0
- package/es/index.js +353 -208
- package/lib/index.js +353 -208
- package/package.json +1 -1
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Badge/StyledBadge.tsx +17 -2
- package/src/components/Badge/__tests__/Badge.spec.tsx +15 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +187 -0
- package/src/components/Badge/index.tsx +20 -36
- package/src/components/Badge/types.ts +55 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +3 -3
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +9 -9
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +7 -7
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +6 -6
- package/src/components/FAB/FAB.tsx +6 -1
- package/src/components/FAB/Pair/StyledFAB.tsx +19 -0
- package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +276 -0
- package/src/components/FAB/Pair/__tests__/index.spec.tsx +39 -0
- package/src/components/FAB/Pair/index.tsx +46 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +31 -14
- package/src/components/FAB/index.tsx +3 -1
- package/src/components/Progress/ProgressStep.tsx +3 -1
- package/src/components/Progress/StyledStep.tsx +13 -11
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +215 -4
- package/src/components/Progress/__tests__/index.spec.js +16 -4
- package/src/components/Search/SearchOneLine.tsx +7 -1
- package/src/components/Search/SearchSuffixIcon.tsx +12 -1
- package/src/components/Search/SearchTwoLine.tsx +7 -1
- package/src/components/Search/StyledSearch.tsx +42 -16
- package/src/components/Search/__tests__/SearchOneLine.spec.tsx +30 -0
- package/src/components/Search/__tests__/SearchTwoLine.spec.tsx +15 -0
- package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +166 -10
- package/src/components/Search/__tests__/__snapshots__/SearchSuffixIcon.spec.tsx.snap +3 -0
- package/src/components/Search/__tests__/__snapshots__/SearchTwoLine.spec.tsx.snap +182 -2
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +6 -0
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +3 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +9 -0
- package/src/components/Toolbar/StyledToolbar.tsx +11 -0
- package/src/components/Toolbar/ToolbarItem.tsx +3 -3
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +24 -4
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +46 -9
- package/src/theme/components/badge.ts +10 -1
- package/src/theme/components/button.ts +2 -2
- package/src/theme/components/fab.ts +3 -0
- package/src/theme/components/search.ts +30 -5
- package/src/theme/components/switch.ts +2 -2
- package/src/theme/components/toolbar.ts +1 -1
- package/stats/8.72.0/rn-stats.html +4844 -0
- package/types/components/Badge/StyledBadge.d.ts +9 -1
- package/types/components/Badge/index.d.ts +3 -34
- package/types/components/Badge/types.d.ts +53 -0
- package/types/components/FAB/Pair/StyledFAB.d.ts +12 -0
- package/types/components/FAB/Pair/index.d.ts +16 -0
- package/types/components/FAB/index.d.ts +1 -0
- package/types/components/Progress/StyledStep.d.ts +2 -0
- package/types/components/Search/SearchOneLine.d.ts +5 -0
- package/types/components/Search/SearchTwoLine.d.ts +5 -0
- package/types/components/Search/StyledSearch.d.ts +7 -2
- package/types/components/Toolbar/StyledToolbar.d.ts +9 -2
- package/types/theme/components/badge.d.ts +8 -0
- package/types/theme/components/fab.d.ts +3 -0
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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": "#
|
|
248
|
+
"textSecondary": "#f6f6f7",
|
|
241
249
|
},
|
|
242
250
|
"primary": "#401960",
|
|
243
|
-
"secondary": "#
|
|
251
|
+
"secondary": "#4d6265",
|
|
244
252
|
"textLoadingBackground": "#ece8ef",
|
|
245
253
|
"utilityBackground": "#ffffff",
|
|
246
254
|
},
|
|
@@ -567,6 +575,8 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
567
575
|
"radius": 4,
|
|
568
576
|
},
|
|
569
577
|
"sizes": {
|
|
578
|
+
"fabPairHeight": 48,
|
|
579
|
+
"fabPairIconOnlyWidth": 48,
|
|
570
580
|
"height": 64,
|
|
571
581
|
"iconContainerHeight": 24,
|
|
572
582
|
"iconContainerWidth": 24,
|
|
@@ -580,6 +590,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
580
590
|
"buttonMarginRight": 24,
|
|
581
591
|
"buttonMarginTop": 24,
|
|
582
592
|
"containerPadding": 20,
|
|
593
|
+
"fabPairMarginRight": 8,
|
|
583
594
|
"titleMarginHorizontal": 8,
|
|
584
595
|
},
|
|
585
596
|
},
|
|
@@ -823,14 +834,29 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
823
834
|
"search": {
|
|
824
835
|
"borderWidths": {
|
|
825
836
|
"container": {
|
|
826
|
-
"
|
|
827
|
-
|
|
837
|
+
"basic": {
|
|
838
|
+
"focused": 2,
|
|
839
|
+
"normal": 2,
|
|
840
|
+
},
|
|
841
|
+
"reversed": {
|
|
842
|
+
"focused": 2,
|
|
843
|
+
"normal": 1,
|
|
844
|
+
},
|
|
828
845
|
},
|
|
829
846
|
},
|
|
830
847
|
"colors": {
|
|
831
|
-
"
|
|
832
|
-
|
|
833
|
-
|
|
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",
|
|
834
860
|
"text": "#001f23",
|
|
835
861
|
},
|
|
836
862
|
"fontSizes": {
|
|
@@ -843,6 +869,16 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
843
869
|
"container": 999,
|
|
844
870
|
"surfix": 999,
|
|
845
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
|
+
},
|
|
846
882
|
"sizes": {
|
|
847
883
|
"surfixSize": 40,
|
|
848
884
|
},
|
|
@@ -852,6 +888,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
852
888
|
"containerHorizontalPadding": 8,
|
|
853
889
|
"containerVerticalPadding": 8,
|
|
854
890
|
"inputHorizontalMargin": 8,
|
|
891
|
+
"inputVerticalPadding": 2,
|
|
855
892
|
"prefixHorizontalPadding": 4,
|
|
856
893
|
"surfixPadding": 8,
|
|
857
894
|
},
|
|
@@ -980,7 +1017,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
980
1017
|
"backgroundColors": {
|
|
981
1018
|
"checked": "#401960",
|
|
982
1019
|
"disabled-checked": "#ece8ef",
|
|
983
|
-
"disabled-unchecked": "#
|
|
1020
|
+
"disabled-unchecked": "#4d6265",
|
|
984
1021
|
"unchecked": "#808f91",
|
|
985
1022
|
},
|
|
986
1023
|
"selector": {
|
|
@@ -1216,7 +1253,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1216
1253
|
"iconButtonBackground": "#ece8ef",
|
|
1217
1254
|
"info": "#b5c3fd",
|
|
1218
1255
|
"primary": "#401960",
|
|
1219
|
-
"secondary": "#
|
|
1256
|
+
"secondary": "#4d6265",
|
|
1220
1257
|
"success": "#5ace7d",
|
|
1221
1258
|
},
|
|
1222
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.
|
|
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.
|
|
55
|
+
textSecondary: theme.colors.neutralGlobalSurface,
|
|
56
56
|
textDanger: theme.colors.errorSurface,
|
|
57
57
|
},
|
|
58
58
|
};
|
|
@@ -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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
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.
|
|
9
|
+
'disabled-unchecked': theme.colors.mutedOnDefaultGlobalSurface,
|
|
10
10
|
},
|
|
11
|
-
thumb: theme.colors.
|
|
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.
|
|
9
|
+
secondary: theme.colors.mutedOnDefaultGlobalSurface,
|
|
10
10
|
info: theme.colors.info,
|
|
11
11
|
success: theme.colors.success,
|
|
12
12
|
danger: theme.colors.warning,
|