@hero-design/rn 7.12.1 → 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.
Files changed (185) hide show
  1. package/.eslintrc.json +3 -1
  2. package/.turbo/turbo-build.log +3 -2
  3. package/assets/fonts/hero-icons.ttf +0 -0
  4. package/babel.config.js +16 -0
  5. package/es/index.js +35840 -16325
  6. package/lib/assets/fonts/hero-icons.ttf +0 -0
  7. package/lib/index.js +35847 -16327
  8. package/package.json +9 -4
  9. package/rollup.config.js +1 -0
  10. package/src/components/Accordion/AccordionItem.tsx +50 -0
  11. package/src/components/Accordion/StyledAccordion.tsx +29 -0
  12. package/src/components/Accordion/__tests__/AccordionItem.spec.tsx +56 -0
  13. package/src/components/Accordion/__tests__/StyledAccordion.spec.tsx +17 -0
  14. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +529 -0
  15. package/src/components/Accordion/__tests__/__snapshots__/StyledAccordion.spec.tsx.snap +33 -0
  16. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +822 -0
  17. package/src/components/Accordion/__tests__/index.spec.tsx +54 -0
  18. package/src/components/Accordion/index.tsx +82 -0
  19. package/src/components/Accordion/utils.tsx +11 -0
  20. package/src/components/Button/Button.tsx +64 -60
  21. package/src/components/Button/IconButton.tsx +1 -1
  22. package/src/components/Button/StyledButton.tsx +4 -6
  23. package/src/components/Button/__tests__/StyledButton.spec.tsx +11 -4
  24. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +312 -78
  25. package/src/components/Calendar/CalendarRowItem.tsx +54 -0
  26. package/src/components/Calendar/StyledCalendar.tsx +76 -0
  27. package/src/components/Calendar/__tests__/CalendarRowItem.spec.tsx +76 -0
  28. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +411 -0
  29. package/src/components/Calendar/__tests__/helper.spec.ts +50 -0
  30. package/src/components/Calendar/__tests__/index.spec.tsx +99 -0
  31. package/src/components/Calendar/helpers.ts +29 -0
  32. package/src/components/Calendar/index.tsx +217 -0
  33. package/src/components/Collapse/index.tsx +13 -15
  34. package/src/components/ContentNavigator/index.tsx +6 -0
  35. package/src/components/DatePicker/DatePickerAndroid.tsx +59 -0
  36. package/src/components/DatePicker/DatePickerIOS.tsx +87 -0
  37. package/src/components/DatePicker/StyledDatePicker.tsx +8 -0
  38. package/src/components/DatePicker/__tests__/DatePicker.spec.tsx +34 -0
  39. package/src/components/DatePicker/__tests__/DatePickerAndroid.spec.tsx +39 -0
  40. package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +46 -0
  41. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +199 -0
  42. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +513 -0
  43. package/src/components/DatePicker/index.tsx +15 -0
  44. package/src/components/DatePicker/types.ts +49 -0
  45. package/src/components/Empty/StyledEmpty.tsx +47 -0
  46. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +66 -0
  47. package/src/components/Empty/__tests__/index.spec.tsx +17 -0
  48. package/src/components/Empty/index.tsx +53 -0
  49. package/src/components/FAB/ActionGroup/ActionItem.tsx +6 -2
  50. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -0
  51. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +7 -1
  52. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +84 -22
  53. package/src/components/FAB/ActionGroup/index.tsx +8 -1
  54. package/src/components/Icon/HeroIcon/selection.json +1 -1
  55. package/src/components/Icon/IconList.ts +13 -0
  56. package/src/components/List/BasicListItem.tsx +44 -34
  57. package/src/components/List/ListItem.tsx +67 -58
  58. package/src/components/List/StyledBasicListItem.tsx +2 -3
  59. package/src/components/List/StyledListItem.tsx +2 -2
  60. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +5 -2
  61. package/src/components/List/__tests__/StyledListItem.spec.tsx +4 -1
  62. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +15 -10
  63. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +52 -32
  64. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +128 -48
  65. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +132 -52
  66. package/src/components/RichTextEditor/EditorEvent.ts +7 -0
  67. package/src/components/RichTextEditor/EditorToolbar.tsx +220 -0
  68. package/src/components/RichTextEditor/MentionList.tsx +69 -0
  69. package/src/components/RichTextEditor/RichTextEditor.tsx +396 -0
  70. package/src/components/RichTextEditor/StyledRichTextEditor.ts +20 -0
  71. package/src/components/RichTextEditor/StyledToolbar.ts +32 -0
  72. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +130 -0
  73. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +109 -0
  74. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +245 -0
  75. package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +324 -0
  76. package/src/components/RichTextEditor/__tests__/__snapshots__/MentionList.spec.tsx.snap +45 -0
  77. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +526 -0
  78. package/src/components/RichTextEditor/constants.ts +20 -0
  79. package/src/components/RichTextEditor/hero-editor.d.ts +8 -0
  80. package/src/components/RichTextEditor/index.tsx +8 -0
  81. package/src/components/RichTextEditor/utils/events.ts +31 -0
  82. package/src/components/RichTextEditor/utils/rnWebView.ts +19 -0
  83. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +77 -0
  84. package/src/components/SectionHeading/__tests__/index.spec.tsx +14 -0
  85. package/src/components/SectionHeading/index.tsx +16 -9
  86. package/src/components/Tag/StyledTag.tsx +12 -2
  87. package/src/components/Tag/__tests__/Tag.spec.tsx +35 -8
  88. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +118 -4
  89. package/src/components/Tag/index.tsx +9 -2
  90. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +1 -0
  91. package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
  92. package/src/components/TimePicker/types.ts +1 -1
  93. package/src/components/Typography/Text/StyledText.tsx +2 -1
  94. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  95. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  96. package/src/components/Typography/Text/index.tsx +2 -1
  97. package/src/index.ts +10 -0
  98. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +119 -4
  99. package/src/theme/components/accordion.ts +19 -0
  100. package/src/theme/components/button.ts +12 -0
  101. package/src/theme/components/calendar.ts +34 -0
  102. package/src/theme/components/card.ts +1 -1
  103. package/src/theme/components/datePicker.ts +11 -0
  104. package/src/theme/components/empty.ts +38 -0
  105. package/src/theme/components/fab.ts +4 -3
  106. package/src/theme/components/list.ts +1 -0
  107. package/src/theme/components/pinInput.ts +1 -1
  108. package/src/theme/components/richTextEditor.ts +34 -0
  109. package/src/theme/components/tag.ts +8 -2
  110. package/src/theme/components/typography.ts +1 -0
  111. package/src/theme/global/borders.ts +6 -6
  112. package/src/theme/global/colors.ts +5 -1
  113. package/src/theme/index.ts +15 -0
  114. package/testUtils/setup.tsx +17 -0
  115. package/types/components/Accordion/AccordionItem.d.ts +14 -0
  116. package/types/components/Accordion/StyledAccordion.d.ts +32 -0
  117. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +1 -0
  118. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +1 -0
  119. package/types/components/Accordion/__tests__/index.spec.d.ts +1 -0
  120. package/types/components/Accordion/index.d.ts +38 -0
  121. package/types/components/Accordion/utils.d.ts +1 -0
  122. package/types/components/Button/IconButton.d.ts +1 -1
  123. package/types/components/Button/StyledButton.d.ts +3 -3
  124. package/types/components/Calendar/CalendarRowItem.d.ts +10 -0
  125. package/types/components/Calendar/StyledCalendar.d.ts +54 -0
  126. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +1 -0
  127. package/types/components/Calendar/__tests__/helper.spec.d.ts +1 -0
  128. package/types/components/Calendar/__tests__/index.spec.d.ts +1 -0
  129. package/types/components/Calendar/helpers.d.ts +3 -0
  130. package/types/components/Calendar/index.d.ts +40 -0
  131. package/types/components/Collapse/index.d.ts +1 -1
  132. package/types/components/ContentNavigator/index.d.ts +5 -1
  133. package/types/components/DatePicker/DatePickerAndroid.d.ts +3 -0
  134. package/types/components/DatePicker/DatePickerIOS.d.ts +3 -0
  135. package/types/components/DatePicker/StyledDatePicker.d.ts +8 -0
  136. package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +1 -0
  137. package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +1 -0
  138. package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +1 -0
  139. package/types/components/DatePicker/index.d.ts +3 -0
  140. package/types/components/DatePicker/types.d.ts +48 -0
  141. package/types/components/Empty/StyledEmpty.d.ts +31 -0
  142. package/types/components/Empty/__tests__/index.spec.d.ts +1 -0
  143. package/types/components/Empty/index.d.ts +26 -0
  144. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +6 -1
  145. package/types/components/FAB/ActionGroup/index.d.ts +6 -1
  146. package/types/components/FAB/index.d.ts +1 -1
  147. package/types/components/Icon/IconList.d.ts +1 -1
  148. package/types/components/Icon/utils.d.ts +1 -1
  149. package/types/components/List/StyledBasicListItem.d.ts +3 -3
  150. package/types/components/List/StyledListItem.d.ts +3 -3
  151. package/types/components/RichTextEditor/EditorEvent.d.ts +3 -0
  152. package/types/components/RichTextEditor/EditorToolbar.d.ts +17 -0
  153. package/types/components/RichTextEditor/MentionList.d.ts +12 -0
  154. package/types/components/RichTextEditor/RichTextEditor.d.ts +65 -0
  155. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +16 -0
  156. package/types/components/RichTextEditor/StyledToolbar.d.ts +21 -0
  157. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +1 -0
  158. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +1 -0
  159. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +1 -0
  160. package/types/components/RichTextEditor/constants.d.ts +19 -0
  161. package/types/components/RichTextEditor/index.d.ts +5 -0
  162. package/types/components/RichTextEditor/utils/events.d.ts +8 -0
  163. package/types/components/RichTextEditor/utils/rnWebView.d.ts +7 -0
  164. package/types/components/SectionHeading/index.d.ts +2 -2
  165. package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
  166. package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
  167. package/types/components/Tag/StyledTag.d.ts +1 -1
  168. package/types/components/Tag/index.d.ts +1 -1
  169. package/types/components/TimePicker/types.d.ts +1 -1
  170. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  171. package/types/components/Typography/Text/index.d.ts +1 -1
  172. package/types/index.d.ts +6 -1
  173. package/types/theme/components/accordion.d.ts +13 -0
  174. package/types/theme/components/button.d.ts +12 -0
  175. package/types/theme/components/calendar.d.ts +26 -0
  176. package/types/theme/components/datePicker.d.ts +6 -0
  177. package/types/theme/components/empty.d.ts +28 -0
  178. package/types/theme/components/fab.d.ts +1 -0
  179. package/types/theme/components/list.d.ts +1 -0
  180. package/types/theme/components/richTextEditor.d.ts +26 -0
  181. package/types/theme/components/tag.d.ts +8 -2
  182. package/types/theme/components/typography.d.ts +1 -0
  183. package/types/theme/global/colors.d.ts +5 -1
  184. package/types/theme/global/index.d.ts +5 -1
  185. package/types/theme/index.d.ts +10 -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
- <StyledListItemContainer
64
- style={style}
65
- testID={testID}
66
- themeSelected={selected}
67
- themeDisabled={disabled}
68
- onPress={onPress}
69
- disabled={disabled}
70
- >
71
- {prefix && (
72
- <StyledPrefixContainer>
73
- {typeof prefix === 'string' ? <Icon icon={prefix} /> : prefix}
74
- </StyledPrefixContainer>
75
- )}
76
- <StyledTitleContainer>
77
- <Typography.Text intent="body" fontSize="large">
78
- {title}
79
- </Typography.Text>
80
- {subtitle && (
81
- <Typography.Text intent="subdued" fontSize="small">
82
- {subtitle}
83
- </Typography.Text>
84
- )}
85
- </StyledTitleContainer>
86
- {suffix && (
87
- <StyledSuffixContainer>
88
- {typeof suffix === 'string' ? (
89
- <Icon icon={suffix} intent="text" size="small" />
90
- ) : (
91
- suffix
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
- </StyledSuffixContainer>
94
- )}
95
- </StyledListItemContainer>
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
- <StyledListItemContainer
82
- style={style}
83
- testID={testID}
84
- themeSelected={selected}
85
- themeVariant={variant}
86
- onPress={onPress}
87
- disabled={disabled}
88
- >
89
- {leadingStatus && (
90
- <StyledLeadingStatus
91
- themeLeadingStatusIntent={leadingStatus}
92
- testID="leadingStatus"
93
- />
94
- )}
95
- <StyledContentContainer>
96
- <View
97
- style={{
98
- flexDirection: 'row',
99
- alignItems: 'center',
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
- <StyledTitleContainer>
108
- <Typography.Text
109
- intent="body"
110
- fontSize="large"
111
- fontWeight="semi-bold"
102
+ <StyledContentContainer>
103
+ <View
104
+ style={{
105
+ flexDirection: 'row',
106
+ alignItems: 'center',
107
+ }}
112
108
  >
113
- {title}
114
- </Typography.Text>
115
- {subtitle && (
116
- <Typography.Text intent="subdued" fontSize="small">
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
- </StyledSuffixContainer>
133
- )}
134
- </View>
135
- {children && (
136
- <StyledChildrenContainer>{children}</StyledChildrenContainer>
137
- )}
138
- </StyledContentContainer>
139
- </StyledListItemContainer>
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 { TouchableOpacity, View } from 'react-native';
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(TouchableOpacity)<{
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 { TouchableOpacity, View } from 'react-native';
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(TouchableOpacity)<{
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('ListItemContainer', () => {
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
- Object {
18
- "alignItems": "center",
19
- "backgroundColor": "#ffffff",
20
- "flex": 1,
21
- "flexDirection": "row",
22
- "opacity": 1,
23
- "padding": 16,
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
- Object {
18
- "backgroundColor": "#ffffff",
19
- "flexDirection": "row",
20
- "opacity": 1,
21
- "padding": 16,
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
- Object {
308
- "backgroundColor": "#ffffff",
309
- "flexDirection": "row",
310
- "opacity": 1,
311
- "padding": 16,
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
- Object {
430
- "backgroundColor": "#ffffff",
431
- "flexDirection": "row",
432
- "opacity": 1,
433
- "padding": 16,
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
- Object {
547
- "backgroundColor": "#ffffff",
548
- "flexDirection": "row",
549
- "opacity": 1,
550
- "padding": 16,
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
  >