@hero-design/rn 7.22.1 → 7.22.3
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 +2 -2
- package/es/index.js +309 -284
- package/lib/index.js +309 -284
- package/package.json +4 -4
- 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/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +24 -24
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +6 -6
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +3 -3
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +2 -2
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +4 -18
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +5 -19
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
- package/src/components/Icon/HeroIcon/index.tsx +2 -0
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Icon/index.tsx +1 -0
- package/src/components/List/StyledBasicListItem.tsx +1 -0
- package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -13
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +163 -2
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +12 -12
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +6 -2
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -4
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +5 -5
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +3 -1
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +4 -1
- package/src/components/RichTextEditor/RichTextEditor.tsx +1 -3
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +10 -38
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +2 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +25 -9
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +66 -108
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +2 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +24 -8
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +57 -99
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
- package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Spinner/StyledSpinner.tsx +8 -4
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +32 -16
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +3 -3
- package/src/components/Tabs/ScrollableTabs.tsx +2 -5
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +1 -1
- package/src/components/TextInput/StyledTextInput.tsx +11 -16
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +3 -3
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +28 -46
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +67 -249
- package/src/components/TextInput/index.tsx +27 -27
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +4 -18
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +5 -19
- package/src/components/Toast/ToastProvider.tsx +2 -4
- package/src/components/Toast/__tests__/index.spec.tsx +138 -0
- package/src/components/Toolbar/ToolbarItem.tsx +1 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
- package/src/components/Typography/Text/StyledText.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +3 -3
- package/src/components/Typography/Text/index.tsx +1 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +93 -84
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +4 -4
- package/src/theme/components/avatar.ts +2 -2
- package/src/theme/components/badge.ts +6 -6
- package/src/theme/components/bottomNavigation.ts +2 -2
- package/src/theme/components/bottomSheet.ts +3 -3
- package/src/theme/components/button.ts +20 -20
- package/src/theme/components/calendar.ts +4 -4
- package/src/theme/components/card.ts +5 -5
- package/src/theme/components/checkbox.ts +1 -1
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +4 -4
- package/src/theme/components/empty.ts +3 -4
- package/src/theme/components/fab.ts +7 -7
- package/src/theme/components/icon.ts +4 -3
- package/src/theme/components/list.ts +8 -6
- package/src/theme/components/pinInput.ts +4 -4
- package/src/theme/components/progress.ts +3 -3
- package/src/theme/components/richTextEditor.ts +3 -3
- package/src/theme/components/sectionHeading.ts +1 -1
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/slider.ts +3 -3
- package/src/theme/components/spinner.ts +1 -4
- package/src/theme/components/switch.ts +7 -7
- package/src/theme/components/tabs.ts +5 -5
- package/src/theme/components/tag.ts +12 -12
- package/src/theme/components/textInput.ts +38 -38
- package/src/theme/components/toast.ts +6 -6
- package/src/theme/components/toolbar.ts +3 -2
- package/src/theme/components/typography.ts +4 -3
- package/src/theme/global/colors/global.ts +32 -0
- package/src/theme/global/colors/legacySystemPalette.ts +53 -0
- package/src/theme/global/colors/swag.ts +21 -34
- package/src/theme/global/colors/types.ts +46 -26
- package/src/theme/global/colors/work.ts +10 -9
- package/types/components/Icon/HeroIcon/index.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +3 -9
- package/types/components/TextInput/index.d.ts +4 -4
- package/types/components/Toast/__tests__/index.spec.d.ts +1 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/theme/components/empty.d.ts +0 -1
- package/types/theme/components/icon.d.ts +1 -0
- package/types/theme/components/list.d.ts +1 -0
- package/types/theme/components/spinner.d.ts +1 -4
- package/types/theme/components/toolbar.d.ts +1 -0
- package/types/theme/components/typography.d.ts +1 -0
- package/types/theme/global/colors/global.d.ts +3 -0
- package/types/theme/global/colors/legacySystemPalette.d.ts +3 -0
- package/types/theme/global/colors/types.d.ts +41 -20
- package/types/theme/global/index.d.ts +28 -19
|
@@ -26,7 +26,7 @@ exports[`StyledCheckbox renders correctly when disabled is true 1`] = `
|
|
|
26
26
|
style={
|
|
27
27
|
Array [
|
|
28
28
|
Object {
|
|
29
|
-
"borderColor": "#
|
|
29
|
+
"borderColor": "#4d6265",
|
|
30
30
|
"borderRadius": 4,
|
|
31
31
|
"borderWidth": 2,
|
|
32
32
|
"flexDirection": "row",
|
|
@@ -105,7 +105,7 @@ exports[`StyledWrapper renders correctly when disabled is true, withBorder is tr
|
|
|
105
105
|
onStartShouldSetResponder={[Function]}
|
|
106
106
|
style={
|
|
107
107
|
Object {
|
|
108
|
-
"borderColor": "#
|
|
108
|
+
"borderColor": "#4d6265",
|
|
109
109
|
"borderRadius": 8,
|
|
110
110
|
"borderWidth": 1,
|
|
111
111
|
"flexDirection": "row",
|
|
@@ -264,7 +264,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
|
|
|
264
264
|
style={
|
|
265
265
|
Array [
|
|
266
266
|
Object {
|
|
267
|
-
"color": "#
|
|
267
|
+
"color": "#4d6265",
|
|
268
268
|
"fontFamily": "BeVietnamPro-Regular",
|
|
269
269
|
"fontSize": 14,
|
|
270
270
|
"letterSpacing": 0.42,
|
|
@@ -289,7 +289,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
|
|
|
289
289
|
style={
|
|
290
290
|
Array [
|
|
291
291
|
Object {
|
|
292
|
-
"borderColor": "#
|
|
292
|
+
"borderColor": "#4d6265",
|
|
293
293
|
"borderRadius": 4,
|
|
294
294
|
"borderWidth": 2,
|
|
295
295
|
"flexDirection": "row",
|
|
@@ -321,7 +321,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
|
|
|
321
321
|
onStartShouldSetResponder={[Function]}
|
|
322
322
|
style={
|
|
323
323
|
Object {
|
|
324
|
-
"borderColor": "#
|
|
324
|
+
"borderColor": "#4d6265",
|
|
325
325
|
"borderRadius": 8,
|
|
326
326
|
"borderWidth": 1,
|
|
327
327
|
"flexDirection": "row",
|
|
@@ -334,7 +334,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
|
|
|
334
334
|
style={
|
|
335
335
|
Array [
|
|
336
336
|
Object {
|
|
337
|
-
"color": "#
|
|
337
|
+
"color": "#4d6265",
|
|
338
338
|
"fontFamily": "BeVietnamPro-Regular",
|
|
339
339
|
"fontSize": 14,
|
|
340
340
|
"letterSpacing": 0.42,
|
|
@@ -359,7 +359,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
|
|
|
359
359
|
style={
|
|
360
360
|
Array [
|
|
361
361
|
Object {
|
|
362
|
-
"borderColor": "#
|
|
362
|
+
"borderColor": "#4d6265",
|
|
363
363
|
"borderRadius": 4,
|
|
364
364
|
"borderWidth": 2,
|
|
365
365
|
"flexDirection": "row",
|
|
@@ -146,7 +146,7 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
|
|
|
146
146
|
style={
|
|
147
147
|
Array [
|
|
148
148
|
Object {
|
|
149
|
-
"color": "#
|
|
149
|
+
"color": "#4d6265",
|
|
150
150
|
"fontSize": 24,
|
|
151
151
|
},
|
|
152
152
|
undefined,
|
|
@@ -205,7 +205,7 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
|
|
|
205
205
|
style={
|
|
206
206
|
Array [
|
|
207
207
|
Object {
|
|
208
|
-
"color": "#
|
|
208
|
+
"color": "#4d6265",
|
|
209
209
|
"fontSize": 24,
|
|
210
210
|
},
|
|
211
211
|
undefined,
|
|
@@ -26,12 +26,16 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
26
26
|
style={
|
|
27
27
|
Array [
|
|
28
28
|
Object {
|
|
29
|
+
"borderColor": "#001f23",
|
|
30
|
+
"borderRadius": 8,
|
|
31
|
+
"borderWidth": 1,
|
|
29
32
|
"marginVertical": 8,
|
|
30
33
|
"width": "100%",
|
|
31
34
|
},
|
|
32
35
|
undefined,
|
|
33
36
|
]
|
|
34
37
|
}
|
|
38
|
+
themeVariant="filled"
|
|
35
39
|
>
|
|
36
40
|
<View
|
|
37
41
|
style={
|
|
@@ -45,24 +49,6 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
45
49
|
]
|
|
46
50
|
}
|
|
47
51
|
>
|
|
48
|
-
<View
|
|
49
|
-
style={
|
|
50
|
-
Array [
|
|
51
|
-
Object {
|
|
52
|
-
"borderColor": "#001f23",
|
|
53
|
-
"borderRadius": 8,
|
|
54
|
-
"borderWidth": 1,
|
|
55
|
-
"bottom": 0,
|
|
56
|
-
"left": 0,
|
|
57
|
-
"position": "absolute",
|
|
58
|
-
"right": 0,
|
|
59
|
-
"top": 0,
|
|
60
|
-
},
|
|
61
|
-
undefined,
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
themeVariant="filled"
|
|
65
|
-
/>
|
|
66
52
|
<View
|
|
67
53
|
pointerEvents="none"
|
|
68
54
|
style={
|
|
@@ -26,12 +26,16 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
26
26
|
style={
|
|
27
27
|
Array [
|
|
28
28
|
Object {
|
|
29
|
+
"borderColor": "#001f23",
|
|
30
|
+
"borderRadius": 8,
|
|
31
|
+
"borderWidth": 1,
|
|
29
32
|
"marginVertical": 8,
|
|
30
33
|
"width": "100%",
|
|
31
34
|
},
|
|
32
35
|
undefined,
|
|
33
36
|
]
|
|
34
37
|
}
|
|
38
|
+
themeVariant="filled"
|
|
35
39
|
>
|
|
36
40
|
<View
|
|
37
41
|
style={
|
|
@@ -45,24 +49,6 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
45
49
|
]
|
|
46
50
|
}
|
|
47
51
|
>
|
|
48
|
-
<View
|
|
49
|
-
style={
|
|
50
|
-
Array [
|
|
51
|
-
Object {
|
|
52
|
-
"borderColor": "#001f23",
|
|
53
|
-
"borderRadius": 8,
|
|
54
|
-
"borderWidth": 1,
|
|
55
|
-
"bottom": 0,
|
|
56
|
-
"left": 0,
|
|
57
|
-
"position": "absolute",
|
|
58
|
-
"right": 0,
|
|
59
|
-
"top": 0,
|
|
60
|
-
},
|
|
61
|
-
undefined,
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
themeVariant="filled"
|
|
65
|
-
/>
|
|
66
52
|
<View
|
|
67
53
|
pointerEvents="none"
|
|
68
54
|
style={
|
|
@@ -502,7 +488,7 @@ exports[`DatePickerIOS renders correctly 1`] = `
|
|
|
502
488
|
style={
|
|
503
489
|
Array [
|
|
504
490
|
Object {
|
|
505
|
-
"color": "#
|
|
491
|
+
"color": "#001f23",
|
|
506
492
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
507
493
|
"fontSize": 16,
|
|
508
494
|
"letterSpacing": 0.48,
|
|
@@ -44,7 +44,7 @@ exports[`Drawer renders correctly in invisible state 1`] = `
|
|
|
44
44
|
pointerEvents="box-none"
|
|
45
45
|
style={
|
|
46
46
|
Object {
|
|
47
|
-
"backgroundColor": "#
|
|
47
|
+
"backgroundColor": "#ffffff",
|
|
48
48
|
"bottom": 0,
|
|
49
49
|
"left": 0,
|
|
50
50
|
"opacity": 0,
|
|
@@ -125,7 +125,7 @@ exports[`Drawer renders correctly in visible state 1`] = `
|
|
|
125
125
|
pointerEvents="auto"
|
|
126
126
|
style={
|
|
127
127
|
Object {
|
|
128
|
-
"backgroundColor": "#
|
|
128
|
+
"backgroundColor": "#ffffff",
|
|
129
129
|
"bottom": 0,
|
|
130
130
|
"left": 0,
|
|
131
131
|
"opacity": 0.35,
|
|
@@ -206,7 +206,7 @@ exports[`Drawer renders correctly with no backdrop 1`] = `
|
|
|
206
206
|
pointerEvents="box-none"
|
|
207
207
|
style={
|
|
208
208
|
Object {
|
|
209
|
-
"backgroundColor": "#
|
|
209
|
+
"backgroundColor": "#ffffff",
|
|
210
210
|
"bottom": 0,
|
|
211
211
|
"left": 0,
|
|
212
212
|
"opacity": 0,
|
|
@@ -102,7 +102,7 @@ exports[`ActionGroup has active false 1`] = `
|
|
|
102
102
|
Object {
|
|
103
103
|
"alignItems": "center",
|
|
104
104
|
"alignSelf": "flex-end",
|
|
105
|
-
"backgroundColor": "#
|
|
105
|
+
"backgroundColor": "#001f23",
|
|
106
106
|
"borderRadius": 999,
|
|
107
107
|
"flexDirection": "row",
|
|
108
108
|
"margin": 8,
|
|
@@ -181,7 +181,7 @@ exports[`ActionGroup has active false 1`] = `
|
|
|
181
181
|
Object {
|
|
182
182
|
"alignItems": "center",
|
|
183
183
|
"alignSelf": "flex-end",
|
|
184
|
-
"backgroundColor": "#
|
|
184
|
+
"backgroundColor": "#001f23",
|
|
185
185
|
"borderRadius": 999,
|
|
186
186
|
"flexDirection": "row",
|
|
187
187
|
"margin": 8,
|
|
@@ -260,7 +260,7 @@ exports[`ActionGroup has active false 1`] = `
|
|
|
260
260
|
Object {
|
|
261
261
|
"alignItems": "center",
|
|
262
262
|
"alignSelf": "flex-end",
|
|
263
|
-
"backgroundColor": "#
|
|
263
|
+
"backgroundColor": "#001f23",
|
|
264
264
|
"borderRadius": 999,
|
|
265
265
|
"flexDirection": "row",
|
|
266
266
|
"margin": 8,
|
|
@@ -339,7 +339,7 @@ exports[`ActionGroup has active false 1`] = `
|
|
|
339
339
|
Object {
|
|
340
340
|
"alignItems": "center",
|
|
341
341
|
"alignSelf": "flex-end",
|
|
342
|
-
"backgroundColor": "#
|
|
342
|
+
"backgroundColor": "#001f23",
|
|
343
343
|
"borderRadius": 999,
|
|
344
344
|
"flexDirection": "row",
|
|
345
345
|
"margin": 8,
|
|
@@ -418,7 +418,7 @@ exports[`ActionGroup has active false 1`] = `
|
|
|
418
418
|
Object {
|
|
419
419
|
"alignItems": "center",
|
|
420
420
|
"alignSelf": "flex-end",
|
|
421
|
-
"backgroundColor": "#
|
|
421
|
+
"backgroundColor": "#001f23",
|
|
422
422
|
"borderRadius": 999,
|
|
423
423
|
"flexDirection": "row",
|
|
424
424
|
"margin": 8,
|
|
@@ -665,7 +665,7 @@ exports[`ActionGroup has active true 1`] = `
|
|
|
665
665
|
Object {
|
|
666
666
|
"alignItems": "center",
|
|
667
667
|
"alignSelf": "flex-end",
|
|
668
|
-
"backgroundColor": "#
|
|
668
|
+
"backgroundColor": "#001f23",
|
|
669
669
|
"borderRadius": 999,
|
|
670
670
|
"flexDirection": "row",
|
|
671
671
|
"margin": 8,
|
|
@@ -744,7 +744,7 @@ exports[`ActionGroup has active true 1`] = `
|
|
|
744
744
|
Object {
|
|
745
745
|
"alignItems": "center",
|
|
746
746
|
"alignSelf": "flex-end",
|
|
747
|
-
"backgroundColor": "#
|
|
747
|
+
"backgroundColor": "#001f23",
|
|
748
748
|
"borderRadius": 999,
|
|
749
749
|
"flexDirection": "row",
|
|
750
750
|
"margin": 8,
|
|
@@ -823,7 +823,7 @@ exports[`ActionGroup has active true 1`] = `
|
|
|
823
823
|
Object {
|
|
824
824
|
"alignItems": "center",
|
|
825
825
|
"alignSelf": "flex-end",
|
|
826
|
-
"backgroundColor": "#
|
|
826
|
+
"backgroundColor": "#001f23",
|
|
827
827
|
"borderRadius": 999,
|
|
828
828
|
"flexDirection": "row",
|
|
829
829
|
"margin": 8,
|
|
@@ -902,7 +902,7 @@ exports[`ActionGroup has active true 1`] = `
|
|
|
902
902
|
Object {
|
|
903
903
|
"alignItems": "center",
|
|
904
904
|
"alignSelf": "flex-end",
|
|
905
|
-
"backgroundColor": "#
|
|
905
|
+
"backgroundColor": "#001f23",
|
|
906
906
|
"borderRadius": 999,
|
|
907
907
|
"flexDirection": "row",
|
|
908
908
|
"margin": 8,
|
|
@@ -981,7 +981,7 @@ exports[`ActionGroup has active true 1`] = `
|
|
|
981
981
|
Object {
|
|
982
982
|
"alignItems": "center",
|
|
983
983
|
"alignSelf": "flex-end",
|
|
984
|
-
"backgroundColor": "#
|
|
984
|
+
"backgroundColor": "#001f23",
|
|
985
985
|
"borderRadius": 999,
|
|
986
986
|
"flexDirection": "row",
|
|
987
987
|
"margin": 8,
|
|
@@ -6,6 +6,7 @@ type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
|
6
6
|
type ThemeIntent =
|
|
7
7
|
| 'text'
|
|
8
8
|
| 'primary'
|
|
9
|
+
| 'secondary'
|
|
9
10
|
| 'info'
|
|
10
11
|
| 'danger'
|
|
11
12
|
| 'success'
|
|
@@ -22,6 +23,7 @@ const HeroIcon = createIconSetFromIcoMoon(
|
|
|
22
23
|
const COLOR_INTENTS = {
|
|
23
24
|
text: 'text',
|
|
24
25
|
primary: 'primary',
|
|
26
|
+
secondary: 'secondary',
|
|
25
27
|
info: 'info',
|
|
26
28
|
danger: 'danger',
|
|
27
29
|
success: 'success',
|
|
@@ -24,6 +24,7 @@ const StyledListItemContainer = styled(TouchableHighlight)<{
|
|
|
24
24
|
opacity: themeDisabled
|
|
25
25
|
? theme.__hd__.list.opacity.disabled
|
|
26
26
|
: theme.__hd__.list.opacity.enabled,
|
|
27
|
+
borderRadius: theme.__hd__.list.radii.basicItem,
|
|
27
28
|
}));
|
|
28
29
|
export {
|
|
29
30
|
StyledListItemContainer,
|
|
@@ -1,22 +1,46 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
4
|
+
import Icon from '../../Icon';
|
|
4
5
|
import BasicListItem from '../BasicListItem';
|
|
5
6
|
|
|
6
7
|
describe('BasicListItem', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
describe('when suffix and prefix are icon name', () => {
|
|
9
|
+
it('renders correctly', () => {
|
|
10
|
+
const wrapper = renderWithTheme(
|
|
11
|
+
<BasicListItem
|
|
12
|
+
title="List item"
|
|
13
|
+
subtitle="subtitle"
|
|
14
|
+
suffix="checkmark"
|
|
15
|
+
prefix="circle-question-outlined"
|
|
16
|
+
testID="basic-list-item"
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
20
|
+
expect(wrapper.queryAllByTestId('basic-list-item')).toHaveLength(1);
|
|
21
|
+
expect(wrapper.queryAllByText('List item')).toHaveLength(1);
|
|
22
|
+
expect(wrapper.queryAllByText('subtitle')).toHaveLength(1);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('when suffix and prefix are react element', () => {
|
|
27
|
+
it('renders correctly', () => {
|
|
28
|
+
const wrapper = renderWithTheme(
|
|
29
|
+
<BasicListItem
|
|
30
|
+
title="List item"
|
|
31
|
+
subtitle="subtitle"
|
|
32
|
+
suffix={<Icon icon="checkmark" testID="suffix" />}
|
|
33
|
+
prefix={<Icon icon="circle-question-outlined" testID="prefix" />}
|
|
34
|
+
testID="basic-list-item"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
38
|
+
expect(wrapper.queryAllByTestId('basic-list-item')).toHaveLength(1);
|
|
39
|
+
expect(wrapper.queryAllByTestId('suffix')).toHaveLength(1);
|
|
40
|
+
expect(wrapper.queryAllByTestId('prefix')).toHaveLength(1);
|
|
41
|
+
expect(wrapper.queryAllByText('List item')).toHaveLength(1);
|
|
42
|
+
expect(wrapper.queryAllByText('subtitle')).toHaveLength(1);
|
|
43
|
+
});
|
|
20
44
|
});
|
|
21
45
|
|
|
22
46
|
it('onPress', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`BasicListItem renders correctly 1`] = `
|
|
3
|
+
exports[`BasicListItem when suffix and prefix are icon name renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
accessibilityState={
|
|
6
6
|
Object {
|
|
@@ -21,6 +21,7 @@ exports[`BasicListItem renders correctly 1`] = `
|
|
|
21
21
|
Object {
|
|
22
22
|
"alignItems": "center",
|
|
23
23
|
"backgroundColor": "#ffffff",
|
|
24
|
+
"borderRadius": 4,
|
|
24
25
|
"flexDirection": "row",
|
|
25
26
|
"opacity": 1,
|
|
26
27
|
"padding": 16,
|
|
@@ -30,6 +31,31 @@ exports[`BasicListItem renders correctly 1`] = `
|
|
|
30
31
|
}
|
|
31
32
|
testID="basic-list-item"
|
|
32
33
|
>
|
|
34
|
+
<View
|
|
35
|
+
style={
|
|
36
|
+
Array [
|
|
37
|
+
Object {
|
|
38
|
+
"marginRight": 8,
|
|
39
|
+
},
|
|
40
|
+
undefined,
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
<HeroIcon
|
|
45
|
+
name="circle-question-outlined"
|
|
46
|
+
style={
|
|
47
|
+
Array [
|
|
48
|
+
Object {
|
|
49
|
+
"color": "#001f23",
|
|
50
|
+
"fontSize": 24,
|
|
51
|
+
},
|
|
52
|
+
undefined,
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
themeIntent="text"
|
|
56
|
+
themeSize="medium"
|
|
57
|
+
/>
|
|
58
|
+
</View>
|
|
33
59
|
<View
|
|
34
60
|
style={
|
|
35
61
|
Array [
|
|
@@ -63,7 +89,7 @@ exports[`BasicListItem renders correctly 1`] = `
|
|
|
63
89
|
style={
|
|
64
90
|
Array [
|
|
65
91
|
Object {
|
|
66
|
-
"color": "#
|
|
92
|
+
"color": "#4d6265",
|
|
67
93
|
"fontFamily": "BeVietnamPro-Regular",
|
|
68
94
|
"fontSize": 12,
|
|
69
95
|
"letterSpacing": 0.36,
|
|
@@ -106,3 +132,138 @@ exports[`BasicListItem renders correctly 1`] = `
|
|
|
106
132
|
</View>
|
|
107
133
|
</View>
|
|
108
134
|
`;
|
|
135
|
+
|
|
136
|
+
exports[`BasicListItem when suffix and prefix are react element renders correctly 1`] = `
|
|
137
|
+
<View
|
|
138
|
+
accessibilityState={
|
|
139
|
+
Object {
|
|
140
|
+
"disabled": false,
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
accessible={true}
|
|
144
|
+
focusable={false}
|
|
145
|
+
onClick={[Function]}
|
|
146
|
+
onResponderGrant={[Function]}
|
|
147
|
+
onResponderMove={[Function]}
|
|
148
|
+
onResponderRelease={[Function]}
|
|
149
|
+
onResponderTerminate={[Function]}
|
|
150
|
+
onResponderTerminationRequest={[Function]}
|
|
151
|
+
onStartShouldSetResponder={[Function]}
|
|
152
|
+
style={
|
|
153
|
+
Array [
|
|
154
|
+
Object {
|
|
155
|
+
"alignItems": "center",
|
|
156
|
+
"backgroundColor": "#ffffff",
|
|
157
|
+
"borderRadius": 4,
|
|
158
|
+
"flexDirection": "row",
|
|
159
|
+
"opacity": 1,
|
|
160
|
+
"padding": 16,
|
|
161
|
+
},
|
|
162
|
+
undefined,
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
testID="basic-list-item"
|
|
166
|
+
>
|
|
167
|
+
<View
|
|
168
|
+
style={
|
|
169
|
+
Array [
|
|
170
|
+
Object {
|
|
171
|
+
"marginRight": 8,
|
|
172
|
+
},
|
|
173
|
+
undefined,
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
>
|
|
177
|
+
<HeroIcon
|
|
178
|
+
name="circle-question-outlined"
|
|
179
|
+
style={
|
|
180
|
+
Array [
|
|
181
|
+
Object {
|
|
182
|
+
"color": "#001f23",
|
|
183
|
+
"fontSize": 24,
|
|
184
|
+
},
|
|
185
|
+
undefined,
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
testID="prefix"
|
|
189
|
+
themeIntent="text"
|
|
190
|
+
themeSize="medium"
|
|
191
|
+
/>
|
|
192
|
+
</View>
|
|
193
|
+
<View
|
|
194
|
+
style={
|
|
195
|
+
Array [
|
|
196
|
+
Object {
|
|
197
|
+
"flex": 1,
|
|
198
|
+
},
|
|
199
|
+
undefined,
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
>
|
|
203
|
+
<Text
|
|
204
|
+
style={
|
|
205
|
+
Array [
|
|
206
|
+
Object {
|
|
207
|
+
"color": "#001f23",
|
|
208
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
209
|
+
"fontSize": 16,
|
|
210
|
+
"letterSpacing": 0.48,
|
|
211
|
+
"lineHeight": 24,
|
|
212
|
+
},
|
|
213
|
+
undefined,
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
themeFontSize="large"
|
|
217
|
+
themeFontWeight="regular"
|
|
218
|
+
themeIntent="body"
|
|
219
|
+
>
|
|
220
|
+
List item
|
|
221
|
+
</Text>
|
|
222
|
+
<Text
|
|
223
|
+
style={
|
|
224
|
+
Array [
|
|
225
|
+
Object {
|
|
226
|
+
"color": "#4d6265",
|
|
227
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
228
|
+
"fontSize": 12,
|
|
229
|
+
"letterSpacing": 0.36,
|
|
230
|
+
"lineHeight": 20,
|
|
231
|
+
},
|
|
232
|
+
undefined,
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
themeFontSize="small"
|
|
236
|
+
themeFontWeight="regular"
|
|
237
|
+
themeIntent="subdued"
|
|
238
|
+
>
|
|
239
|
+
subtitle
|
|
240
|
+
</Text>
|
|
241
|
+
</View>
|
|
242
|
+
<View
|
|
243
|
+
style={
|
|
244
|
+
Array [
|
|
245
|
+
Object {
|
|
246
|
+
"marginLeft": 8,
|
|
247
|
+
},
|
|
248
|
+
undefined,
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
>
|
|
252
|
+
<HeroIcon
|
|
253
|
+
name="checkmark"
|
|
254
|
+
style={
|
|
255
|
+
Array [
|
|
256
|
+
Object {
|
|
257
|
+
"color": "#001f23",
|
|
258
|
+
"fontSize": 24,
|
|
259
|
+
},
|
|
260
|
+
undefined,
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
testID="suffix"
|
|
264
|
+
themeIntent="text"
|
|
265
|
+
themeSize="medium"
|
|
266
|
+
/>
|
|
267
|
+
</View>
|
|
268
|
+
</View>
|
|
269
|
+
`;
|