@hero-design/rn 7.13.0 → 7.14.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/.eslintrc.json +3 -1
- package/.turbo/turbo-build.log +3 -2
- package/assets/fonts/hero-icons.ttf +0 -0
- package/babel.config.js +16 -0
- package/es/index.js +26957 -7622
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +26963 -7624
- package/package.json +9 -4
- package/rollup.config.js +1 -0
- package/src/components/Accordion/AccordionItem.tsx +50 -0
- package/src/components/Accordion/StyledAccordion.tsx +29 -0
- package/src/components/Accordion/__tests__/AccordionItem.spec.tsx +56 -0
- package/src/components/Accordion/__tests__/StyledAccordion.spec.tsx +17 -0
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +529 -0
- package/src/components/Accordion/__tests__/__snapshots__/StyledAccordion.spec.tsx.snap +33 -0
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +822 -0
- package/src/components/Accordion/__tests__/index.spec.tsx +54 -0
- package/src/components/Accordion/index.tsx +82 -0
- package/src/components/Accordion/utils.tsx +11 -0
- package/src/components/Button/IconButton.tsx +1 -1
- package/src/components/Calendar/CalendarRowItem.tsx +54 -0
- package/src/components/Calendar/StyledCalendar.tsx +76 -0
- package/src/components/Calendar/__tests__/CalendarRowItem.spec.tsx +76 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +411 -0
- package/src/components/Calendar/__tests__/helper.spec.ts +50 -0
- package/src/components/Calendar/__tests__/index.spec.tsx +99 -0
- package/src/components/Calendar/helpers.ts +29 -0
- package/src/components/Calendar/index.tsx +217 -0
- package/src/components/Collapse/index.tsx +13 -15
- package/src/components/ContentNavigator/index.tsx +6 -0
- package/src/components/Empty/StyledEmpty.tsx +47 -0
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +66 -0
- package/src/components/Empty/__tests__/index.spec.tsx +17 -0
- package/src/components/Empty/index.tsx +53 -0
- package/src/components/FAB/ActionGroup/ActionItem.tsx +6 -2
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -0
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +7 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +84 -22
- package/src/components/FAB/ActionGroup/index.tsx +8 -1
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +13 -0
- package/src/components/List/BasicListItem.tsx +44 -34
- package/src/components/List/ListItem.tsx +67 -58
- package/src/components/List/StyledBasicListItem.tsx +2 -3
- package/src/components/List/StyledListItem.tsx +2 -2
- package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +5 -2
- package/src/components/List/__tests__/StyledListItem.spec.tsx +4 -1
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +15 -10
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +52 -32
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +128 -48
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +132 -52
- package/src/components/RichTextEditor/EditorEvent.ts +7 -0
- package/src/components/RichTextEditor/EditorToolbar.tsx +220 -0
- package/src/components/RichTextEditor/MentionList.tsx +69 -0
- package/src/components/RichTextEditor/RichTextEditor.tsx +396 -0
- package/src/components/RichTextEditor/StyledRichTextEditor.ts +20 -0
- package/src/components/RichTextEditor/StyledToolbar.ts +32 -0
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +130 -0
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +109 -0
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +245 -0
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +324 -0
- package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +45 -0
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +526 -0
- package/src/components/RichTextEditor/constants.ts +20 -0
- package/src/components/RichTextEditor/hero-editor.d.ts +8 -0
- package/src/components/RichTextEditor/index.tsx +8 -0
- package/src/components/RichTextEditor/utils/events.ts +31 -0
- package/src/components/RichTextEditor/utils/rnWebView.ts +19 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +77 -0
- package/src/components/SectionHeading/__tests__/index.spec.tsx +14 -0
- package/src/components/SectionHeading/index.tsx +16 -9
- package/src/components/Tag/StyledTag.tsx +12 -2
- package/src/components/Tag/__tests__/Tag.spec.tsx +35 -8
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +118 -4
- package/src/components/Tag/index.tsx +9 -2
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -0
- package/src/components/Typography/Text/StyledText.tsx +2 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +2 -1
- package/src/index.ts +8 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +101 -4
- package/src/theme/components/accordion.ts +19 -0
- package/src/theme/components/calendar.ts +34 -0
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/empty.ts +38 -0
- package/src/theme/components/fab.ts +4 -3
- package/src/theme/components/list.ts +1 -0
- package/src/theme/components/pinInput.ts +1 -1
- package/src/theme/components/richTextEditor.ts +34 -0
- package/src/theme/components/tag.ts +8 -2
- package/src/theme/components/typography.ts +1 -0
- package/src/theme/global/borders.ts +6 -6
- package/src/theme/global/colors.ts +4 -1
- package/src/theme/index.ts +12 -0
- package/testUtils/setup.tsx +17 -0
- package/types/components/Accordion/AccordionItem.d.ts +14 -0
- package/types/components/Accordion/StyledAccordion.d.ts +32 -0
- package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +1 -0
- package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +1 -0
- package/types/components/Accordion/__tests__/index.spec.d.ts +1 -0
- package/types/components/Accordion/index.d.ts +38 -0
- package/types/components/Accordion/utils.d.ts +1 -0
- package/types/components/Button/IconButton.d.ts +1 -1
- package/types/components/Calendar/CalendarRowItem.d.ts +10 -0
- package/types/components/Calendar/StyledCalendar.d.ts +54 -0
- package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +1 -0
- package/types/components/Calendar/__tests__/helper.spec.d.ts +1 -0
- package/types/components/Calendar/__tests__/index.spec.d.ts +1 -0
- package/types/components/Calendar/helpers.d.ts +3 -0
- package/types/components/Calendar/index.d.ts +40 -0
- package/types/components/Collapse/index.d.ts +1 -1
- package/types/components/ContentNavigator/index.d.ts +5 -1
- package/types/components/Empty/StyledEmpty.d.ts +31 -0
- package/types/components/Empty/__tests__/index.spec.d.ts +1 -0
- package/types/components/Empty/index.d.ts +26 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +6 -1
- package/types/components/FAB/ActionGroup/index.d.ts +6 -1
- package/types/components/FAB/index.d.ts +1 -1
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/List/StyledBasicListItem.d.ts +3 -3
- package/types/components/List/StyledListItem.d.ts +3 -3
- package/types/components/RichTextEditor/EditorEvent.d.ts +3 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +17 -0
- package/types/components/RichTextEditor/MentionList.d.ts +12 -0
- package/types/components/RichTextEditor/RichTextEditor.d.ts +65 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +16 -0
- package/types/components/RichTextEditor/StyledToolbar.d.ts +21 -0
- package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +1 -0
- package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +1 -0
- package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +1 -0
- package/types/components/RichTextEditor/constants.d.ts +19 -0
- package/types/components/RichTextEditor/index.d.ts +5 -0
- package/types/components/RichTextEditor/utils/events.d.ts +8 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +7 -0
- package/types/components/SectionHeading/index.d.ts +2 -2
- package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
- package/types/components/Tag/StyledTag.d.ts +1 -1
- package/types/components/Tag/index.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/index.d.ts +5 -1
- package/types/theme/components/accordion.d.ts +13 -0
- package/types/theme/components/calendar.d.ts +26 -0
- package/types/theme/components/empty.d.ts +28 -0
- package/types/theme/components/fab.d.ts +1 -0
- package/types/theme/components/list.d.ts +1 -0
- package/types/theme/components/richTextEditor.d.ts +26 -0
- package/types/theme/components/tag.d.ts +8 -2
- package/types/theme/components/typography.d.ts +1 -0
- package/types/theme/global/colors.d.ts +4 -1
- package/types/theme/global/index.d.ts +4 -1
- package/types/theme/index.d.ts +8 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const IconList = [
|
|
2
2
|
'activate',
|
|
3
|
+
'add-emoji',
|
|
3
4
|
'add-person',
|
|
4
5
|
'adjustment',
|
|
5
6
|
'alignment',
|
|
7
|
+
'archive',
|
|
6
8
|
'bank',
|
|
7
9
|
'bell',
|
|
8
10
|
'billing',
|
|
@@ -77,6 +79,13 @@ const IconList = [
|
|
|
77
79
|
'file',
|
|
78
80
|
'folder-user',
|
|
79
81
|
'folder',
|
|
82
|
+
'format-bold',
|
|
83
|
+
'format-heading1',
|
|
84
|
+
'format-heading2',
|
|
85
|
+
'format-italic',
|
|
86
|
+
'format-list-bulleted',
|
|
87
|
+
'format-list-numbered',
|
|
88
|
+
'format-underlined',
|
|
80
89
|
'funnel-filter',
|
|
81
90
|
'global-dollar',
|
|
82
91
|
'globe',
|
|
@@ -97,6 +106,7 @@ const IconList = [
|
|
|
97
106
|
'lock',
|
|
98
107
|
'looks-one',
|
|
99
108
|
'looks-two',
|
|
109
|
+
'mandatory',
|
|
100
110
|
'media-content',
|
|
101
111
|
'menu',
|
|
102
112
|
'moneybag',
|
|
@@ -118,10 +128,13 @@ const IconList = [
|
|
|
118
128
|
'reschedule',
|
|
119
129
|
'rostering',
|
|
120
130
|
'save',
|
|
131
|
+
'schedule-send',
|
|
121
132
|
'schedule',
|
|
122
133
|
'search-person',
|
|
123
134
|
'send',
|
|
124
135
|
'speaker',
|
|
136
|
+
'star-award',
|
|
137
|
+
'star-badge',
|
|
125
138
|
'star-medal',
|
|
126
139
|
'star',
|
|
127
140
|
'steps-circle',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../theme';
|
|
4
5
|
import Icon, { IconName } from '../Icon';
|
|
5
6
|
import Typography from '../Typography';
|
|
6
7
|
import {
|
|
@@ -59,40 +60,49 @@ const BasicListItem = ({
|
|
|
59
60
|
selected = false,
|
|
60
61
|
disabled = false,
|
|
61
62
|
onPress,
|
|
62
|
-
}: ListItemProps): JSX.Element =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
63
|
+
}: ListItemProps): JSX.Element => {
|
|
64
|
+
const theme = useTheme();
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<StyledListItemContainer
|
|
68
|
+
style={style}
|
|
69
|
+
testID={testID}
|
|
70
|
+
themeSelected={selected}
|
|
71
|
+
themeDisabled={disabled}
|
|
72
|
+
onPress={onPress}
|
|
73
|
+
disabled={disabled}
|
|
74
|
+
underlayColor={
|
|
75
|
+
theme.__hd__.list.colors.highlightedListItemContainerBackground
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
<>
|
|
79
|
+
{prefix && (
|
|
80
|
+
<StyledPrefixContainer>
|
|
81
|
+
{typeof prefix === 'string' ? <Icon icon={prefix} /> : prefix}
|
|
82
|
+
</StyledPrefixContainer>
|
|
83
|
+
)}
|
|
84
|
+
<StyledTitleContainer>
|
|
85
|
+
<Typography.Text intent="body" fontSize="large">
|
|
86
|
+
{title}
|
|
87
|
+
</Typography.Text>
|
|
88
|
+
{subtitle && (
|
|
89
|
+
<Typography.Text intent="subdued" fontSize="small">
|
|
90
|
+
{subtitle}
|
|
91
|
+
</Typography.Text>
|
|
92
|
+
)}
|
|
93
|
+
</StyledTitleContainer>
|
|
94
|
+
{suffix && (
|
|
95
|
+
<StyledSuffixContainer>
|
|
96
|
+
{typeof suffix === 'string' ? (
|
|
97
|
+
<Icon icon={suffix} intent="text" size="small" />
|
|
98
|
+
) : (
|
|
99
|
+
suffix
|
|
100
|
+
)}
|
|
101
|
+
</StyledSuffixContainer>
|
|
92
102
|
)}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
</>
|
|
104
|
+
</StyledListItemContainer>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
97
107
|
|
|
98
108
|
export default BasicListItem;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import { StyleProp, ViewStyle, View } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../theme';
|
|
4
5
|
import Icon, { IconName } from '../Icon';
|
|
5
6
|
import Typography from '../Typography';
|
|
6
7
|
import {
|
|
@@ -77,66 +78,74 @@ const ListItem = ({
|
|
|
77
78
|
variant = 'full-width',
|
|
78
79
|
onPress,
|
|
79
80
|
disabled = false,
|
|
80
|
-
}: ListItemProps): JSX.Element =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}}
|
|
101
|
-
>
|
|
102
|
-
{prefix && (
|
|
103
|
-
<StyledPrefixContainer>
|
|
104
|
-
{typeof prefix === 'string' ? <Icon icon={prefix} /> : prefix}
|
|
105
|
-
</StyledPrefixContainer>
|
|
81
|
+
}: ListItemProps): JSX.Element => {
|
|
82
|
+
const theme = useTheme();
|
|
83
|
+
return (
|
|
84
|
+
<StyledListItemContainer
|
|
85
|
+
style={style}
|
|
86
|
+
testID={testID}
|
|
87
|
+
themeSelected={selected}
|
|
88
|
+
themeVariant={variant}
|
|
89
|
+
onPress={onPress}
|
|
90
|
+
disabled={disabled}
|
|
91
|
+
underlayColor={
|
|
92
|
+
theme.__hd__.list.colors.highlightedListItemContainerBackground
|
|
93
|
+
}
|
|
94
|
+
>
|
|
95
|
+
<>
|
|
96
|
+
{leadingStatus && (
|
|
97
|
+
<StyledLeadingStatus
|
|
98
|
+
themeLeadingStatusIntent={leadingStatus}
|
|
99
|
+
testID="leadingStatus"
|
|
100
|
+
/>
|
|
106
101
|
)}
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
<StyledContentContainer>
|
|
103
|
+
<View
|
|
104
|
+
style={{
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
}}
|
|
112
108
|
>
|
|
113
|
-
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{subtitle}
|
|
118
|
-
</Typography.Text>
|
|
119
|
-
)}
|
|
120
|
-
</StyledTitleContainer>
|
|
121
|
-
{suffix && (
|
|
122
|
-
<StyledSuffixContainer>
|
|
123
|
-
{typeof suffix === 'string' ? (
|
|
124
|
-
<Icon
|
|
125
|
-
icon={suffix}
|
|
126
|
-
intent={disabled ? 'disabled-text' : 'primary'}
|
|
127
|
-
size="small"
|
|
128
|
-
/>
|
|
129
|
-
) : (
|
|
130
|
-
suffix
|
|
109
|
+
{prefix && (
|
|
110
|
+
<StyledPrefixContainer>
|
|
111
|
+
{typeof prefix === 'string' ? <Icon icon={prefix} /> : prefix}
|
|
112
|
+
</StyledPrefixContainer>
|
|
131
113
|
)}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
114
|
+
<StyledTitleContainer>
|
|
115
|
+
<Typography.Text
|
|
116
|
+
intent="body"
|
|
117
|
+
fontSize="large"
|
|
118
|
+
fontWeight="semi-bold"
|
|
119
|
+
>
|
|
120
|
+
{title}
|
|
121
|
+
</Typography.Text>
|
|
122
|
+
{subtitle && (
|
|
123
|
+
<Typography.Text intent="subdued" fontSize="small">
|
|
124
|
+
{subtitle}
|
|
125
|
+
</Typography.Text>
|
|
126
|
+
)}
|
|
127
|
+
</StyledTitleContainer>
|
|
128
|
+
{suffix && (
|
|
129
|
+
<StyledSuffixContainer>
|
|
130
|
+
{typeof suffix === 'string' ? (
|
|
131
|
+
<Icon
|
|
132
|
+
icon={suffix}
|
|
133
|
+
intent={disabled ? 'disabled-text' : 'primary'}
|
|
134
|
+
size="small"
|
|
135
|
+
/>
|
|
136
|
+
) : (
|
|
137
|
+
suffix
|
|
138
|
+
)}
|
|
139
|
+
</StyledSuffixContainer>
|
|
140
|
+
)}
|
|
141
|
+
</View>
|
|
142
|
+
{children && (
|
|
143
|
+
<StyledChildrenContainer>{children}</StyledChildrenContainer>
|
|
144
|
+
)}
|
|
145
|
+
</StyledContentContainer>
|
|
146
|
+
</>
|
|
147
|
+
</StyledListItemContainer>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
141
150
|
|
|
142
151
|
export default ListItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableHighlight, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
const StyledPrefixContainer = styled(View)(({ theme }) => ({
|
|
5
5
|
marginRight: theme.__hd__.list.space.prefixContainerMarginRight,
|
|
@@ -11,12 +11,11 @@ const StyledTitleContainer = styled(View)(() => ({
|
|
|
11
11
|
flex: 1,
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
const StyledListItemContainer = styled(
|
|
14
|
+
const StyledListItemContainer = styled(TouchableHighlight)<{
|
|
15
15
|
themeSelected?: boolean;
|
|
16
16
|
themeDisabled?: boolean;
|
|
17
17
|
}>(({ theme, themeSelected, themeDisabled }) => ({
|
|
18
18
|
alignItems: 'center',
|
|
19
|
-
flex: 1,
|
|
20
19
|
flexDirection: 'row',
|
|
21
20
|
backgroundColor: themeSelected
|
|
22
21
|
? theme.__hd__.select.colors.checkedOption
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TouchableHighlight, View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
|
|
4
4
|
export type Variant = 'full-width' | 'card';
|
|
@@ -9,7 +9,7 @@ export type LeadingStatusIntent =
|
|
|
9
9
|
| 'info'
|
|
10
10
|
| 'archived';
|
|
11
11
|
|
|
12
|
-
const StyledListItemContainer = styled(
|
|
12
|
+
const StyledListItemContainer = styled(TouchableHighlight)<{
|
|
13
13
|
themeSelected?: boolean;
|
|
14
14
|
themeVariant?: Variant;
|
|
15
15
|
}>(({ theme, themeSelected = false, themeVariant = 'basic' }) => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import Typography from '../../Typography';
|
|
3
4
|
import { StyledListItemContainer } from '../StyledBasicListItem';
|
|
4
5
|
|
|
5
|
-
describe('
|
|
6
|
+
describe('StyledListItemContainer', () => {
|
|
6
7
|
it.each`
|
|
7
8
|
themeSelected | themeDisabled
|
|
8
9
|
${true} | ${false}
|
|
@@ -16,7 +17,9 @@ describe('ListItemContainer', () => {
|
|
|
16
17
|
<StyledListItemContainer
|
|
17
18
|
themeSelected={themeSelected}
|
|
18
19
|
themeDisabled={themeDisabled}
|
|
19
|
-
|
|
20
|
+
>
|
|
21
|
+
<Typography.Text>StyledListItemContainer</Typography.Text>
|
|
22
|
+
</StyledListItemContainer>
|
|
20
23
|
);
|
|
21
24
|
expect(toJSON()).toMatchSnapshot();
|
|
22
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import Typography from '../../Typography';
|
|
3
4
|
import {
|
|
4
5
|
StyledLeadingStatus,
|
|
5
6
|
StyledListItemContainer,
|
|
@@ -19,7 +20,9 @@ describe('ListItemContainer', () => {
|
|
|
19
20
|
<StyledListItemContainer
|
|
20
21
|
themeSelected={themeSelected}
|
|
21
22
|
themeVariant={themeVariant}
|
|
22
|
-
|
|
23
|
+
>
|
|
24
|
+
<Typography.Text>StyledListItemContainer</Typography.Text>
|
|
25
|
+
</StyledListItemContainer>
|
|
23
26
|
);
|
|
24
27
|
expect(toJSON()).toMatchSnapshot();
|
|
25
28
|
}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`BasicListItem renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
Object {
|
|
7
|
+
"disabled": false,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
5
10
|
accessible={true}
|
|
6
|
-
collapsable={false}
|
|
7
11
|
focusable={false}
|
|
8
|
-
nativeID="animatedComponent"
|
|
9
12
|
onClick={[Function]}
|
|
10
13
|
onResponderGrant={[Function]}
|
|
11
14
|
onResponderMove={[Function]}
|
|
@@ -14,14 +17,16 @@ exports[`BasicListItem renders correctly 1`] = `
|
|
|
14
17
|
onResponderTerminationRequest={[Function]}
|
|
15
18
|
onStartShouldSetResponder={[Function]}
|
|
16
19
|
style={
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"alignItems": "center",
|
|
23
|
+
"backgroundColor": "#ffffff",
|
|
24
|
+
"flexDirection": "row",
|
|
25
|
+
"opacity": 1,
|
|
26
|
+
"padding": 16,
|
|
27
|
+
},
|
|
28
|
+
undefined,
|
|
29
|
+
]
|
|
25
30
|
}
|
|
26
31
|
testID="basic-list-item"
|
|
27
32
|
>
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`ListItem renders correctly ListItem with children 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
Object {
|
|
7
|
+
"disabled": false,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
5
10
|
accessible={true}
|
|
6
|
-
collapsable={false}
|
|
7
11
|
focusable={false}
|
|
8
|
-
nativeID="animatedComponent"
|
|
9
12
|
onClick={[Function]}
|
|
10
13
|
onResponderGrant={[Function]}
|
|
11
14
|
onResponderMove={[Function]}
|
|
@@ -14,12 +17,14 @@ exports[`ListItem renders correctly ListItem with children 1`] = `
|
|
|
14
17
|
onResponderTerminationRequest={[Function]}
|
|
15
18
|
onStartShouldSetResponder={[Function]}
|
|
16
19
|
style={
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
Array [
|
|
21
|
+
Object {
|
|
22
|
+
"backgroundColor": "#ffffff",
|
|
23
|
+
"flexDirection": "row",
|
|
24
|
+
"padding": 16,
|
|
25
|
+
},
|
|
26
|
+
undefined,
|
|
27
|
+
]
|
|
23
28
|
}
|
|
24
29
|
>
|
|
25
30
|
<View
|
|
@@ -292,10 +297,13 @@ exports[`ListItem renders correctly ListItem with children 1`] = `
|
|
|
292
297
|
|
|
293
298
|
exports[`ListItem renders correctly ListItem with icon 1`] = `
|
|
294
299
|
<View
|
|
300
|
+
accessibilityState={
|
|
301
|
+
Object {
|
|
302
|
+
"disabled": false,
|
|
303
|
+
}
|
|
304
|
+
}
|
|
295
305
|
accessible={true}
|
|
296
|
-
collapsable={false}
|
|
297
306
|
focusable={false}
|
|
298
|
-
nativeID="animatedComponent"
|
|
299
307
|
onClick={[Function]}
|
|
300
308
|
onResponderGrant={[Function]}
|
|
301
309
|
onResponderMove={[Function]}
|
|
@@ -304,12 +312,14 @@ exports[`ListItem renders correctly ListItem with icon 1`] = `
|
|
|
304
312
|
onResponderTerminationRequest={[Function]}
|
|
305
313
|
onStartShouldSetResponder={[Function]}
|
|
306
314
|
style={
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
315
|
+
Array [
|
|
316
|
+
Object {
|
|
317
|
+
"backgroundColor": "#ffffff",
|
|
318
|
+
"flexDirection": "row",
|
|
319
|
+
"padding": 16,
|
|
320
|
+
},
|
|
321
|
+
undefined,
|
|
322
|
+
]
|
|
313
323
|
}
|
|
314
324
|
testID="list-item"
|
|
315
325
|
>
|
|
@@ -414,10 +424,13 @@ exports[`ListItem renders correctly ListItem with icon 1`] = `
|
|
|
414
424
|
|
|
415
425
|
exports[`ListItem renders correctly ListItem with leading status 1`] = `
|
|
416
426
|
<View
|
|
427
|
+
accessibilityState={
|
|
428
|
+
Object {
|
|
429
|
+
"disabled": false,
|
|
430
|
+
}
|
|
431
|
+
}
|
|
417
432
|
accessible={true}
|
|
418
|
-
collapsable={false}
|
|
419
433
|
focusable={false}
|
|
420
|
-
nativeID="animatedComponent"
|
|
421
434
|
onClick={[Function]}
|
|
422
435
|
onResponderGrant={[Function]}
|
|
423
436
|
onResponderMove={[Function]}
|
|
@@ -426,12 +439,14 @@ exports[`ListItem renders correctly ListItem with leading status 1`] = `
|
|
|
426
439
|
onResponderTerminationRequest={[Function]}
|
|
427
440
|
onStartShouldSetResponder={[Function]}
|
|
428
441
|
style={
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
442
|
+
Array [
|
|
443
|
+
Object {
|
|
444
|
+
"backgroundColor": "#ffffff",
|
|
445
|
+
"flexDirection": "row",
|
|
446
|
+
"padding": 16,
|
|
447
|
+
},
|
|
448
|
+
undefined,
|
|
449
|
+
]
|
|
435
450
|
}
|
|
436
451
|
>
|
|
437
452
|
<View
|
|
@@ -531,10 +546,13 @@ exports[`ListItem renders correctly ListItem with leading status 1`] = `
|
|
|
531
546
|
|
|
532
547
|
exports[`ListItem renders correctly ListItem with prefix suffix is React.Element 1`] = `
|
|
533
548
|
<View
|
|
549
|
+
accessibilityState={
|
|
550
|
+
Object {
|
|
551
|
+
"disabled": false,
|
|
552
|
+
}
|
|
553
|
+
}
|
|
534
554
|
accessible={true}
|
|
535
|
-
collapsable={false}
|
|
536
555
|
focusable={false}
|
|
537
|
-
nativeID="animatedComponent"
|
|
538
556
|
onClick={[Function]}
|
|
539
557
|
onResponderGrant={[Function]}
|
|
540
558
|
onResponderMove={[Function]}
|
|
@@ -543,12 +561,14 @@ exports[`ListItem renders correctly ListItem with prefix suffix is React.Element
|
|
|
543
561
|
onResponderTerminationRequest={[Function]}
|
|
544
562
|
onStartShouldSetResponder={[Function]}
|
|
545
563
|
style={
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
564
|
+
Array [
|
|
565
|
+
Object {
|
|
566
|
+
"backgroundColor": "#ffffff",
|
|
567
|
+
"flexDirection": "row",
|
|
568
|
+
"padding": 16,
|
|
569
|
+
},
|
|
570
|
+
undefined,
|
|
571
|
+
]
|
|
552
572
|
}
|
|
553
573
|
testID="list-item"
|
|
554
574
|
>
|