@utilitywarehouse/hearth-react-native 0.12.0 → 0.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +22 -0
- package/build/components/Accordion/AccordionTrigger.js +1 -1
- package/build/components/BodyText/index.d.ts +1 -0
- package/build/components/Checkbox/CheckboxGroup.context.d.ts +2 -0
- package/build/components/Checkbox/CheckboxGroup.js +5 -5
- package/build/components/Checkbox/CheckboxIndicator.js +3 -3
- package/build/components/Checkbox/CheckboxTextContent.js +0 -1
- package/build/components/Checkbox/CheckboxTileRoot.js +9 -1
- package/build/components/DatePicker/DatePickerDay.js +3 -3
- package/build/components/FormField/FormField.d.ts +5 -5
- package/build/components/List/List.context.d.ts +2 -0
- package/build/components/List/List.context.js +2 -0
- package/build/components/List/List.js +19 -15
- package/build/components/List/ListAction/ListAction.js +3 -2
- package/build/components/List/ListAction/ListAction.props.d.ts +0 -1
- package/build/components/List/ListItem/ListItem.props.d.ts +4 -1
- package/build/components/List/ListItem/ListItemHeading.d.ts +13 -0
- package/build/components/List/ListItem/ListItemHeading.js +12 -0
- package/build/components/List/ListItem/ListItemHelperText.d.ts +2 -2
- package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
- package/build/components/List/ListItem/ListItemRoot.js +7 -6
- package/build/components/List/ListItem/index.d.ts +1 -1
- package/build/components/List/ListItem/index.js +1 -1
- package/build/components/PillGroup/Pill.js +2 -2
- package/build/components/Radio/RadioGroup.context.d.ts +2 -0
- package/build/components/Radio/RadioGroup.js +1 -1
- package/build/components/Radio/RadioIndicator.js +3 -3
- package/build/components/Radio/RadioTextContent.js +0 -1
- package/build/components/Radio/RadioTileRoot.js +9 -1
- package/build/components/RadioCard/RadioCardIndicator.js +3 -3
- package/build/components/RadioCard/RadioCardRoot.js +3 -3
- package/build/components/Tabs/Tab.js +5 -5
- package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
- package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +3 -3
- package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
- package/build/components/VerificationInput/VerificationInput.d.ts +6 -0
- package/build/components/VerificationInput/VerificationInput.js +35 -0
- package/build/components/VerificationInput/VerificationInput.props.d.ts +49 -0
- package/build/components/VerificationInput/VerificationInput.props.js +1 -0
- package/build/components/VerificationInput/VerificationInputSlot.d.ts +9 -0
- package/build/components/VerificationInput/VerificationInputSlot.js +72 -0
- package/build/components/VerificationInput/index.d.ts +4 -0
- package/build/components/VerificationInput/index.js +3 -0
- package/build/components/VerificationInput/useVerificationInput.d.ts +14 -0
- package/build/components/VerificationInput/useVerificationInput.js +58 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/docs/components/AllComponents.web.tsx +9 -0
- package/package.json +10 -11
- package/src/components/Accordion/Accordion.figma.tsx +23 -0
- package/src/components/Accordion/AccordionItemRoot.figma.tsx +47 -0
- package/src/components/Accordion/AccordionTrigger.tsx +1 -1
- package/src/components/Alert/Alert.figma.tsx +47 -0
- package/src/components/Avatar/Avatar.figma.tsx +33 -0
- package/src/components/Badge/Badge.figma.tsx +48 -24
- package/src/components/Banner/Banner.figma.tsx +15 -0
- package/src/components/Banner/BannerIllustration.figma.tsx +30 -0
- package/src/components/BodyText/index.ts +1 -0
- package/src/components/BottomSheet/BottomSheetModal.figma.tsx +20 -0
- package/src/components/Button/Button.figma.tsx +60 -229
- package/src/components/Card/Card.figma.tsx +43 -71
- package/src/components/Card/CardAction/CardAction.figma.tsx +44 -0
- package/src/components/Card/CardAction/CardAction.stories.tsx +1 -1
- package/src/components/Carousel/Carousel.figma.tsx +19 -0
- package/src/components/Checkbox/Checkbox.figma.tsx +26 -41
- package/src/components/Checkbox/CheckboxGroup.context.ts +1 -0
- package/src/components/Checkbox/CheckboxGroup.figma.tsx +20 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +7 -8
- package/src/components/Checkbox/CheckboxImage.figma.tsx +27 -0
- package/src/components/Checkbox/CheckboxIndicator.tsx +3 -3
- package/src/components/Checkbox/CheckboxTextContent.tsx +0 -1
- package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +32 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +9 -1
- package/src/components/CurrencyInput/CurrencyInput.figma.tsx +56 -0
- package/src/components/DateInput/DateInput.figma.tsx +75 -0
- package/src/components/DatePicker/DatePickerCalendar.figma.tsx +34 -0
- package/src/components/DatePicker/DatePickerDay.tsx +3 -3
- package/src/components/DatePickerInput/DatePickerInput.figma.tsx +62 -0
- package/src/components/DescriptionList/DescriptionList.figma.tsx +23 -0
- package/src/components/Divider/Divider.figma.tsx +23 -18
- package/src/components/ExpandableCard/ExpandableCard.figma.tsx +54 -0
- package/src/components/ExpandableCard/ExpandableCardGroup.figma.tsx +23 -0
- package/src/components/FormField/FormField.figma.tsx +23 -0
- package/src/components/Helper/HelperText.figma.tsx +23 -0
- package/src/components/IconButton/IconButton.figma.tsx +55 -161
- package/src/components/IconContainer/IconContainer.figma.tsx +50 -0
- package/src/components/InlineLink/InlineLink.figma.tsx +33 -0
- package/src/components/Input/Input.figma.tsx +52 -110
- package/src/components/Label/Label.figma.tsx +24 -0
- package/src/components/Link/Link.figma.tsx +42 -0
- package/src/components/List/List.context.ts +4 -0
- package/src/components/List/List.docs.mdx +30 -24
- package/src/components/List/List.figma.tsx +29 -108
- package/src/components/List/List.stories.tsx +26 -1
- package/src/components/List/List.tsx +26 -19
- package/src/components/List/ListAction/ListAction.figma.tsx +29 -0
- package/src/components/List/ListAction/ListAction.props.ts +0 -1
- package/src/components/List/ListAction/ListAction.tsx +3 -2
- package/src/components/List/ListItem/ListItem.figma.tsx +40 -220
- package/src/components/List/ListItem/ListItem.props.ts +4 -1
- package/src/components/List/ListItem/ListItemHeading.tsx +20 -0
- package/src/components/List/ListItem/ListItemHelperText.tsx +2 -3
- package/src/components/List/ListItem/ListItemLeadingContent.figma.tsx +29 -0
- package/src/components/List/ListItem/ListItemRoot.tsx +11 -6
- package/src/components/List/ListItem/ListItemTrailingContent.figma.tsx +27 -0
- package/src/components/List/ListItem/index.ts +1 -1
- package/src/components/Menu/Menu.figma.tsx +30 -0
- package/src/components/Menu/MenuItem.figma.tsx +31 -0
- package/src/components/Modal/Modal.docs.mdx +23 -20
- package/src/components/Modal/Modal.figma.tsx +56 -0
- package/src/components/PillGroup/Pill.figma.tsx +25 -0
- package/src/components/PillGroup/Pill.tsx +3 -3
- package/src/components/PillGroup/PillGroup.figma.tsx +21 -0
- package/src/components/ProgressStepper/ProgressStep.figma.tsx +30 -0
- package/src/components/ProgressStepper/ProgressStepper.figma.tsx +20 -0
- package/src/components/Radio/Radio.figma.tsx +22 -42
- package/src/components/Radio/Radio.stories.tsx +24 -0
- package/src/components/Radio/RadioGroup.context.ts +1 -0
- package/src/components/Radio/RadioGroup.figma.tsx +54 -0
- package/src/components/Radio/RadioGroup.tsx +2 -2
- package/src/components/Radio/RadioImage.figma.tsx +27 -0
- package/src/components/Radio/RadioIndicator.tsx +3 -3
- package/src/components/Radio/RadioTextContent.tsx +0 -1
- package/src/components/Radio/RadioTileRoot.figma.tsx +31 -0
- package/src/components/Radio/RadioTileRoot.tsx +9 -1
- package/src/components/RadioCard/RadioCardIndicator.tsx +3 -3
- package/src/components/RadioCard/RadioCardRoot.tsx +3 -3
- package/src/components/SectionHeader/SectionHeader.figma.tsx +30 -16
- package/src/components/Select/Select.figma.tsx +55 -0
- package/src/components/Select/SelectOption.figma.tsx +36 -0
- package/src/components/Spinner/Spinner.figma.tsx +20 -12
- package/src/components/Switch/Switch.figma.tsx +31 -23
- package/src/components/Tabs/Tab.tsx +5 -5
- package/src/components/Tabs/Tabs.figma.tsx +29 -0
- package/src/components/ThemedImage/ThemedImage.stories.tsx +1 -1
- package/src/components/Toast/ToastItem.figma.tsx +22 -0
- package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
- package/src/components/ToggleButtonCard/ToggleButtonCardRoot.tsx +3 -3
- package/src/components/UnstyledIconButton/UnstyledIconButton.figma.tsx +49 -0
- package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +1 -1
- package/src/components/VerificationInput/VerificationInput.docs.mdx +68 -0
- package/src/components/VerificationInput/VerificationInput.props.ts +52 -0
- package/src/components/VerificationInput/VerificationInput.stories.tsx +140 -0
- package/src/components/VerificationInput/VerificationInput.tsx +89 -0
- package/src/components/VerificationInput/VerificationInputSlot.tsx +94 -0
- package/src/components/VerificationInput/index.ts +5 -0
- package/src/components/VerificationInput/useVerificationInput.ts +72 -0
- package/src/components/index.ts +1 -0
- package/build/components/List/ListItem/ListItemText.d.ts +0 -6
- package/build/components/List/ListItem/ListItemText.js +0 -7
- package/src/components/Checkbox/CheckboxIndicator.figma.tsx +0 -19
- package/src/components/List/ListItem/ListItemText.tsx +0 -14
- package/src/components/Radio/RadioIndicator.figma.tsx +0 -21
|
@@ -1,220 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// )
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
42
|
-
// {
|
|
43
|
-
// variant: {
|
|
44
|
-
// 'Trailing Icon?': true,
|
|
45
|
-
// 'Trailing Icon': 'Chevron Right-01 - 24',
|
|
46
|
-
// },
|
|
47
|
-
// props,
|
|
48
|
-
// example: ({ disabled, divider, loading, text }) => (
|
|
49
|
-
// <ListItem
|
|
50
|
-
// text={text.text}
|
|
51
|
-
// helperText={text.helperText}
|
|
52
|
-
// disabled={disabled}
|
|
53
|
-
// divider={divider}
|
|
54
|
-
// loading={loading}
|
|
55
|
-
// onPress={() => console.log('list item pressed')}
|
|
56
|
-
// />
|
|
57
|
-
// ),
|
|
58
|
-
// }
|
|
59
|
-
// );
|
|
60
|
-
|
|
61
|
-
// figma.connect(
|
|
62
|
-
// ListItem,
|
|
63
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
64
|
-
// {
|
|
65
|
-
// props: props,
|
|
66
|
-
// variant: {
|
|
67
|
-
// 'Trailing Icon?': true,
|
|
68
|
-
// },
|
|
69
|
-
// example: ({ disabled, divider, loading, text, trailingIcon }) => (
|
|
70
|
-
// <ListItem
|
|
71
|
-
// text={text.text}
|
|
72
|
-
// helperText={text.helperText}
|
|
73
|
-
// disabled={disabled}
|
|
74
|
-
// divider={divider}
|
|
75
|
-
// loading={loading}
|
|
76
|
-
// trailingContent={trailingIcon}
|
|
77
|
-
// />
|
|
78
|
-
// ),
|
|
79
|
-
// }
|
|
80
|
-
// );
|
|
81
|
-
|
|
82
|
-
// figma.connect(
|
|
83
|
-
// ListItem,
|
|
84
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
85
|
-
// {
|
|
86
|
-
// props: props,
|
|
87
|
-
// variant: {
|
|
88
|
-
// 'Trailing Icon?': true,
|
|
89
|
-
// 'Leading Icon?': true,
|
|
90
|
-
// 'Trailing Icon': 'Chevron Right-01 - 24',
|
|
91
|
-
// },
|
|
92
|
-
// example: ({ disabled, divider, loading, text, leadingIcon }) => (
|
|
93
|
-
// <ListItem
|
|
94
|
-
// text={text.text}
|
|
95
|
-
// helperText={text.helperText}
|
|
96
|
-
// disabled={disabled}
|
|
97
|
-
// divider={divider}
|
|
98
|
-
// loading={loading}
|
|
99
|
-
// leadingContent={leadingIcon}
|
|
100
|
-
// onPress={() => console.log('list item pressed')}
|
|
101
|
-
// />
|
|
102
|
-
// ),
|
|
103
|
-
// }
|
|
104
|
-
// );
|
|
105
|
-
|
|
106
|
-
// figma.connect(
|
|
107
|
-
// ListItem,
|
|
108
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
109
|
-
// {
|
|
110
|
-
// props: props,
|
|
111
|
-
// variant: {
|
|
112
|
-
// 'Trailing Icon?': true,
|
|
113
|
-
// 'Leading Icon?': true,
|
|
114
|
-
// },
|
|
115
|
-
// example: ({ disabled, divider, loading, text, trailingIcon, leadingIcon }) => (
|
|
116
|
-
// <ListItem
|
|
117
|
-
// text={text.text}
|
|
118
|
-
// helperText={text.helperText}
|
|
119
|
-
// disabled={disabled}
|
|
120
|
-
// divider={divider}
|
|
121
|
-
// loading={loading}
|
|
122
|
-
// leadingContent={leadingIcon}
|
|
123
|
-
// trailingContent={trailingIcon}
|
|
124
|
-
// />
|
|
125
|
-
// ),
|
|
126
|
-
// }
|
|
127
|
-
// );
|
|
128
|
-
|
|
129
|
-
// figma.connect(
|
|
130
|
-
// ListItem,
|
|
131
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
132
|
-
// {
|
|
133
|
-
// props: props,
|
|
134
|
-
// variant: {
|
|
135
|
-
// 'Leading Icon?': true,
|
|
136
|
-
// },
|
|
137
|
-
// example: ({ disabled, divider, loading, text, leadingIcon }) => (
|
|
138
|
-
// <ListItem
|
|
139
|
-
// text={text.text}
|
|
140
|
-
// helperText={text.helperText}
|
|
141
|
-
// disabled={disabled}
|
|
142
|
-
// divider={divider}
|
|
143
|
-
// loading={loading}
|
|
144
|
-
// leadingContent={leadingIcon}
|
|
145
|
-
// />
|
|
146
|
-
// ),
|
|
147
|
-
// }
|
|
148
|
-
// );
|
|
149
|
-
|
|
150
|
-
// figma.connect(
|
|
151
|
-
// ListItem,
|
|
152
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
153
|
-
// {
|
|
154
|
-
// variant: {
|
|
155
|
-
// _content: 'toggle',
|
|
156
|
-
// 'Trailing Icon?': true,
|
|
157
|
-
// 'Leading Icon?': true,
|
|
158
|
-
// },
|
|
159
|
-
// props,
|
|
160
|
-
// example: ({ disabled, divider, loading, text, leadingIcon }) => (
|
|
161
|
-
// // Toggle doesn't exist in native-ui yet
|
|
162
|
-
// <ListItem
|
|
163
|
-
// text={text.text}
|
|
164
|
-
// helperText={text.helperText}
|
|
165
|
-
// disabled={disabled}
|
|
166
|
-
// divider={divider}
|
|
167
|
-
// loading={loading}
|
|
168
|
-
// leadingContent={leadingIcon}
|
|
169
|
-
// trailingContent={<Toggle />}
|
|
170
|
-
// />
|
|
171
|
-
// ),
|
|
172
|
-
// }
|
|
173
|
-
// );
|
|
174
|
-
|
|
175
|
-
// figma.connect(
|
|
176
|
-
// ListItem,
|
|
177
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
178
|
-
// {
|
|
179
|
-
// variant: {
|
|
180
|
-
// _content: 'toggle',
|
|
181
|
-
// 'Leading Icon?': true,
|
|
182
|
-
// },
|
|
183
|
-
// props,
|
|
184
|
-
// example: ({ disabled, divider, loading, text, leadingIcon }) => (
|
|
185
|
-
// // Toggle doesn't exist in native-ui yet
|
|
186
|
-
// <ListItem
|
|
187
|
-
// text={text.text}
|
|
188
|
-
// helperText={text.helperText}
|
|
189
|
-
// disabled={disabled}
|
|
190
|
-
// divider={divider}
|
|
191
|
-
// loading={loading}
|
|
192
|
-
// leadingContent={leadingIcon}
|
|
193
|
-
// trailingContent={<Toggle />}
|
|
194
|
-
// />
|
|
195
|
-
// ),
|
|
196
|
-
// }
|
|
197
|
-
// );
|
|
198
|
-
|
|
199
|
-
// figma.connect(
|
|
200
|
-
// ListItem,
|
|
201
|
-
// 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
|
|
202
|
-
// {
|
|
203
|
-
// variant: {
|
|
204
|
-
// _content: 'toggle',
|
|
205
|
-
// 'Leading Icon?': false,
|
|
206
|
-
// },
|
|
207
|
-
// props,
|
|
208
|
-
// example: ({ disabled, divider, loading, text }) => (
|
|
209
|
-
// // Toggle doesn't exist in native-ui yet
|
|
210
|
-
// <ListItem
|
|
211
|
-
// text={text.text}
|
|
212
|
-
// helperText={text.helperText}
|
|
213
|
-
// disabled={disabled}
|
|
214
|
-
// divider={divider}
|
|
215
|
-
// loading={loading}
|
|
216
|
-
// trailingContent={<Toggle />}
|
|
217
|
-
// />
|
|
218
|
-
// ),
|
|
219
|
-
// }
|
|
220
|
-
// );
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import ListItem from './ListItem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* -- This file was auto-generated by Code Connect --
|
|
6
|
+
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
+
* You should check this is correct, and update the `example` function
|
|
8
|
+
* to return the code example you'd like to see in Figma
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
figma.connect(ListItem, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2421%3A1628', {
|
|
12
|
+
props: {
|
|
13
|
+
// These props were automatically mapped based on your linked code:
|
|
14
|
+
loading: figma.enum('State', {
|
|
15
|
+
Loading: true,
|
|
16
|
+
}),
|
|
17
|
+
disabled: figma.enum('State', {
|
|
18
|
+
Disabled: true,
|
|
19
|
+
}),
|
|
20
|
+
'aria-disabled': figma.enum('State', {
|
|
21
|
+
Disabled: true,
|
|
22
|
+
}),
|
|
23
|
+
// No matching props could be found for these Figma properties:
|
|
24
|
+
// "listHeading": figma.string('List heading'),
|
|
25
|
+
// "helperText": figma.boolean('Helper text?'),
|
|
26
|
+
// "helperText": figma.string('Helper text'),
|
|
27
|
+
// "customContent": figma.instance('Custom content'),
|
|
28
|
+
// "badge": figma.boolean('Badge?'),
|
|
29
|
+
// "leadingContent": figma.boolean('Leading content?'),
|
|
30
|
+
// "trailingContent": figma.boolean('Trailing Content?'),
|
|
31
|
+
// "numericalValue": figma.boolean('Numerical value?'),
|
|
32
|
+
// "numericalValue": figma.string('Numerical value'),
|
|
33
|
+
// "variant": figma.enum('Variant', {
|
|
34
|
+
// "Default": "default",
|
|
35
|
+
// "Custom": "custom"
|
|
36
|
+
// }),
|
|
37
|
+
// "paddingNone": figma.boolean('Padding None?')
|
|
38
|
+
},
|
|
39
|
+
example: props => <ListItem loading={props.loading} disabled={props.disabled} />,
|
|
40
|
+
});
|
|
@@ -5,7 +5,6 @@ interface ListItemBaseProps extends Omit<PressableProps, 'children'> {
|
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
variant?: 'subtle' | 'emphasis';
|
|
8
|
-
isFirst?: boolean;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export interface ListItemWithChildren extends ListItemBaseProps {
|
|
@@ -17,6 +16,8 @@ export interface ListItemWithChildren extends ListItemBaseProps {
|
|
|
17
16
|
numericValue?: never;
|
|
18
17
|
badge?: never;
|
|
19
18
|
badgePosition?: never;
|
|
19
|
+
truncateHeading?: never;
|
|
20
|
+
truncateHelperText?: never;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface ListItemWithoutChildren extends ListItemBaseProps {
|
|
@@ -28,6 +29,8 @@ export interface ListItemWithoutChildren extends ListItemBaseProps {
|
|
|
28
29
|
numericValue?: string | number;
|
|
29
30
|
badge?: ReactNode;
|
|
30
31
|
badgePosition?: 'top' | 'bottom';
|
|
32
|
+
truncateHeading?: boolean;
|
|
33
|
+
truncateHelperText?: boolean;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
type ListItemProps = ListItemWithChildren | ListItemWithoutChildren;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BodyText, BodyTextProps } from '../../BodyText';
|
|
2
|
+
|
|
3
|
+
const ListItemHeading = ({ children, ...props }: BodyTextProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<BodyText size="lg" {...props}>
|
|
6
|
+
{children}
|
|
7
|
+
</BodyText>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
ListItemHeading.displayName = 'ListItemHeading';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `ListItemHeading` instead.
|
|
15
|
+
*/
|
|
16
|
+
export const ListItemText = ListItemHeading;
|
|
17
|
+
|
|
18
|
+
ListItemText.displayName = 'ListItemText';
|
|
19
|
+
|
|
20
|
+
export default ListItemHeading;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TextProps } from 'react-native';
|
|
2
1
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
-
import { BodyText } from '../../BodyText';
|
|
2
|
+
import { BodyText, BodyTextProps } from '../../BodyText';
|
|
4
3
|
|
|
5
|
-
const ListItemHelperText = ({ children, ...props }:
|
|
4
|
+
const ListItemHelperText = ({ children, ...props }: BodyTextProps) => {
|
|
6
5
|
return (
|
|
7
6
|
<BodyText size="md" {...props} style={[styles.text, props.style]}>
|
|
8
7
|
{children}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import ListItemLeadingContent from "./ListItemLeadingContent"
|
|
3
|
+
import figma from "@figma/code-connect"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* -- This file was auto-generated by Code Connect --
|
|
7
|
+
* None of your props could be automatically mapped to Figma properties.
|
|
8
|
+
* You should update the `props` object to include a mapping from your
|
|
9
|
+
* code props to Figma properties, and update the `example` function to
|
|
10
|
+
* return the code example you'd like to see in Figma
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
figma.connect(
|
|
14
|
+
ListItemLeadingContent,
|
|
15
|
+
"https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6732%3A5792",
|
|
16
|
+
{
|
|
17
|
+
props: {
|
|
18
|
+
// No matching props could be found for these Figma properties:
|
|
19
|
+
// "icon24": figma.instance('Icon-24'),
|
|
20
|
+
// "variant": figma.enum('Variant', {
|
|
21
|
+
// "Icon": "icon",
|
|
22
|
+
// "Icon Container": "icon-container",
|
|
23
|
+
// "Avatar": "avatar",
|
|
24
|
+
// "Indicator": "indicator"
|
|
25
|
+
// })
|
|
26
|
+
},
|
|
27
|
+
example: (props) => <ListItemLeadingContent />,
|
|
28
|
+
},
|
|
29
|
+
)
|
|
@@ -4,13 +4,13 @@ import { Pressable, ViewStyle } from 'react-native';
|
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { DetailText } from '../../DetailText';
|
|
6
6
|
import { Skeleton } from '../../Skeleton';
|
|
7
|
-
import { useListContext } from '../List.context';
|
|
7
|
+
import { useListContext, useListFirstItemContext } from '../List.context';
|
|
8
8
|
import { IListItemContext, ListItemContext } from './ListItem.context';
|
|
9
9
|
import type ListItemProps from './ListItem.props';
|
|
10
10
|
import ListItemContent from './ListItemContent';
|
|
11
|
+
import ListItemHeading from './ListItemHeading';
|
|
11
12
|
import ListItemHelperText from './ListItemHelperText';
|
|
12
13
|
import ListItemLeadingContent from './ListItemLeadingContent';
|
|
13
|
-
import ListItemText from './ListItemText';
|
|
14
14
|
import ListItemTrailingContent from './ListItemTrailingContent';
|
|
15
15
|
import ListItemTrailingIcon from './ListItemTrailingIcon';
|
|
16
16
|
|
|
@@ -27,10 +27,13 @@ const ListItemRoot = ({
|
|
|
27
27
|
badge,
|
|
28
28
|
badgePosition = 'bottom',
|
|
29
29
|
numericValue,
|
|
30
|
+
truncateHeading = false,
|
|
31
|
+
truncateHelperText = false,
|
|
30
32
|
...props
|
|
31
33
|
}: ListItemProps & { states?: { active?: boolean; disabled?: boolean } }) => {
|
|
32
34
|
const { onPress } = props;
|
|
33
35
|
const listContext = useListContext();
|
|
36
|
+
const isFirstContext = useListFirstItemContext();
|
|
34
37
|
const { active } = states || { active: false };
|
|
35
38
|
|
|
36
39
|
const getListContainer = (): ListItemProps['variant'] => {
|
|
@@ -56,8 +59,8 @@ const ListItemRoot = ({
|
|
|
56
59
|
showPressed,
|
|
57
60
|
active,
|
|
58
61
|
disabled: isDisabled || isLoading,
|
|
59
|
-
showDisabled: !listContext
|
|
60
|
-
isFirstChild:
|
|
62
|
+
showDisabled: !listContext.disabled && disabled,
|
|
63
|
+
isFirstChild: isFirstContext,
|
|
61
64
|
container: listContext?.container,
|
|
62
65
|
});
|
|
63
66
|
|
|
@@ -106,8 +109,10 @@ const ListItemRoot = ({
|
|
|
106
109
|
) : null}
|
|
107
110
|
<ListItemContent>
|
|
108
111
|
{badgePosition === 'top' && badge ? badge : null}
|
|
109
|
-
<
|
|
110
|
-
{helperText ?
|
|
112
|
+
<ListItemHeading truncated={truncateHeading}>{heading}</ListItemHeading>
|
|
113
|
+
{helperText ? (
|
|
114
|
+
<ListItemHelperText truncated={truncateHelperText}>{helperText}</ListItemHelperText>
|
|
115
|
+
) : null}
|
|
111
116
|
{badgePosition === 'bottom' && badge ? badge : null}
|
|
112
117
|
</ListItemContent>
|
|
113
118
|
{!!numericValue && <DetailText size="lg">{numericValue}</DetailText>}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import ListItemTrailingContent from "./ListItemTrailingContent"
|
|
3
|
+
import figma from "@figma/code-connect"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* -- This file was auto-generated by Code Connect --
|
|
7
|
+
* None of your props could be automatically mapped to Figma properties.
|
|
8
|
+
* You should update the `props` object to include a mapping from your
|
|
9
|
+
* code props to Figma properties, and update the `example` function to
|
|
10
|
+
* return the code example you'd like to see in Figma
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
figma.connect(
|
|
14
|
+
ListItemTrailingContent,
|
|
15
|
+
"https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=9852%3A9858",
|
|
16
|
+
{
|
|
17
|
+
props: {
|
|
18
|
+
// No matching props could be found for these Figma properties:
|
|
19
|
+
// "icon20": figma.instance('Icon-20'),
|
|
20
|
+
// "variant": figma.enum('Variant', {
|
|
21
|
+
// "Link": "link",
|
|
22
|
+
// "Button": "button"
|
|
23
|
+
// })
|
|
24
|
+
},
|
|
25
|
+
example: (props) => <ListItemTrailingContent />,
|
|
26
|
+
},
|
|
27
|
+
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as ListItem } from './ListItem';
|
|
2
2
|
export type { default as ListItemProps } from './ListItem.props';
|
|
3
3
|
export { default as ListItemContent } from './ListItemContent';
|
|
4
|
+
export { default as ListItemHeading, ListItemText } from './ListItemHeading';
|
|
4
5
|
export { default as ListItemHelperText } from './ListItemHelperText';
|
|
5
6
|
export { default as ListItemIcon } from './ListItemIcon';
|
|
6
7
|
export { default as ListItemLeadingContent } from './ListItemLeadingContent';
|
|
7
|
-
export { default as ListItemText } from './ListItemText';
|
|
8
8
|
export { default as ListItemTrailingContent } from './ListItemTrailingContent';
|
|
9
9
|
export { default as ListItemTrailingIcon } from './ListItemTrailingIcon';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Menu from "./Menu"
|
|
3
|
+
import figma from "@figma/code-connect"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* -- This file was auto-generated by Code Connect --
|
|
7
|
+
* `props` includes a mapping from your code props to Figma properties.
|
|
8
|
+
* You should check this is correct, and update the `example` function
|
|
9
|
+
* to return the code example you'd like to see in Figma
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
figma.connect(
|
|
13
|
+
Menu,
|
|
14
|
+
"https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3263%3A18832",
|
|
15
|
+
{
|
|
16
|
+
props: {
|
|
17
|
+
// These props were automatically mapped based on your linked code:
|
|
18
|
+
heading: figma.string("Heading"),
|
|
19
|
+
// No matching props could be found for these Figma properties:
|
|
20
|
+
// "heading": figma.string('Heading'),
|
|
21
|
+
// "heading": figma.boolean('Heading?'),
|
|
22
|
+
// "grabber": figma.boolean('Grabber?'),
|
|
23
|
+
// "deviceType": figma.enum('Device type', {
|
|
24
|
+
// "Web": "web",
|
|
25
|
+
// "App": "app"
|
|
26
|
+
// })
|
|
27
|
+
},
|
|
28
|
+
example: (props) => <Menu heading={props.heading} />,
|
|
29
|
+
},
|
|
30
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import MenuItem from './MenuItem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* -- This file was auto-generated by Code Connect --
|
|
6
|
+
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
+
* You should check this is correct, and update the `example` function
|
|
8
|
+
* to return the code example you'd like to see in Figma
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
figma.connect(
|
|
12
|
+
MenuItem,
|
|
13
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6416%3A11142',
|
|
14
|
+
{
|
|
15
|
+
props: {
|
|
16
|
+
// These props were automatically mapped based on your linked code:
|
|
17
|
+
disabled: figma.enum('State', {
|
|
18
|
+
Active: true,
|
|
19
|
+
}),
|
|
20
|
+
focusable: figma.enum('State', {
|
|
21
|
+
Focus: true,
|
|
22
|
+
}),
|
|
23
|
+
// No matching props could be found for these Figma properties:
|
|
24
|
+
// "number": figma.string('Number'),
|
|
25
|
+
// "selected": figma.boolean('Selected?')
|
|
26
|
+
},
|
|
27
|
+
example: props => (
|
|
28
|
+
<MenuItem text={null} disabled={props.disabled} focusable={props.focusable} />
|
|
29
|
+
),
|
|
30
|
+
}
|
|
31
|
+
);
|
|
@@ -87,26 +87,29 @@ const MyComponent = () => {
|
|
|
87
87
|
|
|
88
88
|
The Modal component extends the `BottomSheetModal` component and accepts all of its props, plus the following additional props:
|
|
89
89
|
|
|
90
|
-
| Property | Type
|
|
91
|
-
| ----------------------------- |
|
|
92
|
-
| `heading` | `string`
|
|
93
|
-
| `description` | `string`
|
|
94
|
-
| `showCloseButton` | `boolean`
|
|
95
|
-
| `primaryButtonText` | `string`
|
|
96
|
-
| `secondaryButtonText` | `string`
|
|
97
|
-
| `onPressPrimaryButton` | `() => void`
|
|
98
|
-
| `onPressSecondaryButton` | `() => void`
|
|
99
|
-
| `onPressCloseButton` | `() => void`
|
|
100
|
-
| `closeOnPrimaryButtonPress` | `boolean`
|
|
101
|
-
| `closeOnSecondaryButtonPress` | `boolean`
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
90
|
+
| Property | Type | Description | Default |
|
|
91
|
+
| ----------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ------- |
|
|
92
|
+
| `heading` | `string` | The heading text displayed at the top of the modal | - |
|
|
93
|
+
| `description` | `string` | The description text displayed below the heading | - |
|
|
94
|
+
| `showCloseButton` | `boolean` | Whether to show the close button in the top-right corner | `true` |
|
|
95
|
+
| `primaryButtonText` | `string` | Text for the primary action button | - |
|
|
96
|
+
| `secondaryButtonText` | `string` | Text for the secondary action button | - |
|
|
97
|
+
| `onPressPrimaryButton` | `() => void` | Callback function called when the primary button is pressed | - |
|
|
98
|
+
| `onPressSecondaryButton` | `() => void` | Callback function called when the secondary button is pressed | - |
|
|
99
|
+
| `onPressCloseButton` | `() => void` | Callback function called when the close button is pressed | - |
|
|
100
|
+
| `closeOnPrimaryButtonPress` | `boolean` | Whether to automatically close the modal when the primary button is pressed | `true` |
|
|
101
|
+
| `closeOnSecondaryButtonPress` | `boolean` | Whether to automatically close the modal when the secondary button is pressed | `true` |
|
|
102
|
+
| `onChange` | `(index: number, position: number, `<br />` type: number) => void` | Callback function called when the modal's position changes \* | - |
|
|
103
|
+
| `loading` | `boolean` | Whether to show a loading state with spinner | `false` |
|
|
104
|
+
| `image` | `ImageProps` | Image to display in the modal (shows as centered content with text below) | - |
|
|
105
|
+
| `children` | `ReactNode` | Custom content to display in the modal body | - |
|
|
106
|
+
| `primaryButtonProps` | `Omit<ButtonWithoutChildrenProps, 'children'>` | Additional props to pass to the primary button (colorScheme defaults to 'highlight', variant to 'solid') | - |
|
|
107
|
+
| `secondaryButtonProps` | `Omit<ButtonWithoutChildrenProps, 'children'>` | Additional props to pass to the secondary button (colorScheme defaults to 'functional', variant to 'outline') | - |
|
|
108
|
+
| `closeButtonProps` | `Omit<UnstyledIconButtonProps, 'children'>` | Additional props to pass to the close button | - |
|
|
109
|
+
| `fullscreen` | `boolean` | Whether the modal should take up the full screen height | `false` |
|
|
110
|
+
| `inNavModal` | `boolean` | Renders the modal correctly when used inside a navigation modal | `false` |
|
|
111
|
+
|
|
112
|
+
\* use this to detect if the modal has been opened or closed, index 0 indicates open state and -1 indicates closed state
|
|
110
113
|
|
|
111
114
|
### `ModalImage` Props
|
|
112
115
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Modal from "./Modal"
|
|
3
|
+
import figma from "@figma/code-connect"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* -- This file was auto-generated by Code Connect --
|
|
7
|
+
* `props` includes a mapping from your code props to Figma properties.
|
|
8
|
+
* You should check this is correct, and update the `example` function
|
|
9
|
+
* to return the code example you'd like to see in Figma
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
figma.connect(
|
|
13
|
+
Modal,
|
|
14
|
+
"https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6300%3A2825",
|
|
15
|
+
{
|
|
16
|
+
props: {
|
|
17
|
+
// These props were automatically mapped based on your linked code:
|
|
18
|
+
loading: figma.enum("State", {
|
|
19
|
+
Loading: true,
|
|
20
|
+
}),
|
|
21
|
+
image: figma.enum("Image?", {
|
|
22
|
+
False: false,
|
|
23
|
+
True: true,
|
|
24
|
+
}),
|
|
25
|
+
heading: figma.string("Heading"),
|
|
26
|
+
description: figma.string("Description"),
|
|
27
|
+
fullscreen: figma.boolean("Full screen?"),
|
|
28
|
+
showHandle: figma.boolean("Handle?"),
|
|
29
|
+
// No matching props could be found for these Figma properties:
|
|
30
|
+
// "heading": figma.string('Heading'),
|
|
31
|
+
// "description": figma.string('Description'),
|
|
32
|
+
// "customContent": figma.boolean('Custom content?'),
|
|
33
|
+
// "buttons": figma.boolean('Buttons?'),
|
|
34
|
+
// "close": figma.boolean('Close?'),
|
|
35
|
+
// "customContent": figma.instance('Custom content'),
|
|
36
|
+
// "homeIndicator": figma.boolean('Home indicator?'),
|
|
37
|
+
// "handle": figma.boolean('Handle?'),
|
|
38
|
+
// "loadingHeading": figma.string('Loading heading'),
|
|
39
|
+
// "deviceType": figma.enum('Device type', {
|
|
40
|
+
// "Desktop": "desktop",
|
|
41
|
+
// "Tablet": "tablet",
|
|
42
|
+
// "Mobile": "mobile"
|
|
43
|
+
// })
|
|
44
|
+
},
|
|
45
|
+
example: (props) => (
|
|
46
|
+
<Modal
|
|
47
|
+
loading={props.loading}
|
|
48
|
+
image={props.image}
|
|
49
|
+
heading={props.heading}
|
|
50
|
+
description={props.description}
|
|
51
|
+
fullscreen={props.fullscreen}
|
|
52
|
+
showHandle={props.showHandle}
|
|
53
|
+
/>
|
|
54
|
+
),
|
|
55
|
+
},
|
|
56
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Pill } from './Pill';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* -- This file was auto-generated by Code Connect --
|
|
6
|
+
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
+
* You should check this is correct, and update the `example` function
|
|
8
|
+
* to return the code example you'd like to see in Figma
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
figma.connect(Pill, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=4348%3A15595', {
|
|
12
|
+
props: {
|
|
13
|
+
// These props were automatically mapped based on your linked code:
|
|
14
|
+
label: figma.string('Label'),
|
|
15
|
+
focusable: figma.enum('State', {
|
|
16
|
+
Focus: true,
|
|
17
|
+
}),
|
|
18
|
+
// No matching props could be found for these Figma properties:
|
|
19
|
+
// "label": figma.string('Label'),
|
|
20
|
+
// "icon": figma.boolean('Icon?'),
|
|
21
|
+
// "icon20": figma.instance('Icon-20'),
|
|
22
|
+
// "selected": figma.boolean('Selected?')
|
|
23
|
+
},
|
|
24
|
+
example: props => <Pill value={null} label={props.label} focusable={props.focusable} />,
|
|
25
|
+
});
|