@utilitywarehouse/hearth-react-native 0.11.0 → 0.13.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 (202) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +16 -0
  4. package/build/components/Accordion/AccordionTrigger.js +1 -1
  5. package/build/components/Banner/Banner.context.d.ts +7 -0
  6. package/build/components/Banner/Banner.context.js +8 -0
  7. package/build/components/Banner/Banner.js +10 -40
  8. package/build/components/Banner/Banner.props.d.ts +3 -5
  9. package/build/components/Banner/BannerIllustration.d.ts +4 -0
  10. package/build/components/Banner/BannerIllustration.js +53 -0
  11. package/build/components/Banner/BannerImage.d.ts +4 -0
  12. package/build/components/Banner/BannerImage.js +53 -0
  13. package/build/components/Banner/index.d.ts +2 -0
  14. package/build/components/Banner/index.js +2 -0
  15. package/build/components/Card/CardAction/CardAction.props.d.ts +2 -3
  16. package/build/components/Card/CardAction/CardActionRoot.js +1 -2
  17. package/build/components/Checkbox/Checkbox.js +1 -2
  18. package/build/components/Checkbox/Checkbox.props.d.ts +3 -3
  19. package/build/components/Checkbox/CheckboxImage.d.ts +2 -1
  20. package/build/components/Checkbox/CheckboxImage.js +8 -1
  21. package/build/components/Checkbox/CheckboxIndicator.js +3 -3
  22. package/build/components/DatePicker/DatePickerDay.js +3 -3
  23. package/build/components/ExpandableCard/ExpandableCard.props.d.ts +1 -2
  24. package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +4 -5
  25. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +1 -14
  26. package/build/components/HighlightBanner/HighlightBanner.js +2 -6
  27. package/build/components/HighlightBanner/HighlightBanner.props.d.ts +2 -3
  28. package/build/components/HighlightBanner/HighlightBannerImage.d.ts +4 -0
  29. package/build/components/HighlightBanner/HighlightBannerImage.js +18 -0
  30. package/build/components/HighlightBanner/index.d.ts +1 -0
  31. package/build/components/HighlightBanner/index.js +1 -0
  32. package/build/components/Input/Input.d.ts +5 -7
  33. package/build/components/Input/Input.js +11 -4
  34. package/build/components/Input/InputField.d.ts +4 -7
  35. package/build/components/Input/InputField.js +6 -5
  36. package/build/components/List/ListItem/ListItem.props.d.ts +2 -2
  37. package/build/components/List/ListItem/ListItemRoot.js +1 -2
  38. package/build/components/Modal/Modal.js +2 -6
  39. package/build/components/Modal/Modal.props.d.ts +3 -2
  40. package/build/components/Modal/Modal.web.js +2 -6
  41. package/build/components/Modal/ModalImage.d.ts +4 -0
  42. package/build/components/Modal/ModalImage.js +18 -0
  43. package/build/components/Modal/index.d.ts +1 -0
  44. package/build/components/Modal/index.js +1 -0
  45. package/build/components/PillGroup/Pill.js +2 -2
  46. package/build/components/Radio/Radio.js +1 -2
  47. package/build/components/Radio/Radio.props.d.ts +3 -3
  48. package/build/components/Radio/RadioImage.d.ts +2 -1
  49. package/build/components/Radio/RadioImage.js +8 -1
  50. package/build/components/Radio/RadioIndicator.js +3 -3
  51. package/build/components/RadioCard/RadioCardIndicator.js +3 -3
  52. package/build/components/RadioCard/RadioCardRoot.js +3 -3
  53. package/build/components/Tabs/Tab.js +5 -5
  54. package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
  55. package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +3 -3
  56. package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
  57. package/build/components/VerificationInput/VerificationInput.d.ts +6 -0
  58. package/build/components/VerificationInput/VerificationInput.js +35 -0
  59. package/build/components/VerificationInput/VerificationInput.props.d.ts +49 -0
  60. package/build/components/VerificationInput/VerificationInput.props.js +1 -0
  61. package/build/components/VerificationInput/VerificationInputSlot.d.ts +9 -0
  62. package/build/components/VerificationInput/VerificationInputSlot.js +72 -0
  63. package/build/components/VerificationInput/index.d.ts +4 -0
  64. package/build/components/VerificationInput/index.js +3 -0
  65. package/build/components/VerificationInput/useVerificationInput.d.ts +14 -0
  66. package/build/components/VerificationInput/useVerificationInput.js +58 -0
  67. package/build/components/index.d.ts +1 -0
  68. package/build/components/index.js +1 -0
  69. package/build/utils/index.d.ts +2 -1
  70. package/build/utils/index.js +2 -1
  71. package/build/utils/isThemedImageProps.d.ts +4 -0
  72. package/build/utils/isThemedImageProps.js +4 -0
  73. package/docs/components/AllComponents.web.tsx +9 -0
  74. package/package.json +11 -12
  75. package/src/components/Accordion/Accordion.figma.tsx +23 -0
  76. package/src/components/Accordion/AccordionItemRoot.figma.tsx +47 -0
  77. package/src/components/Accordion/AccordionTrigger.tsx +1 -1
  78. package/src/components/Alert/Alert.figma.tsx +47 -0
  79. package/src/components/Avatar/Avatar.figma.tsx +33 -0
  80. package/src/components/Badge/Badge.figma.tsx +48 -24
  81. package/src/components/Banner/Banner.context.ts +11 -0
  82. package/src/components/Banner/Banner.docs.mdx +55 -37
  83. package/src/components/Banner/Banner.figma.tsx +15 -0
  84. package/src/components/Banner/Banner.props.ts +3 -5
  85. package/src/components/Banner/Banner.stories.tsx +86 -57
  86. package/src/components/Banner/Banner.tsx +24 -67
  87. package/src/components/Banner/BannerIllustration.figma.tsx +30 -0
  88. package/src/components/Banner/BannerIllustration.tsx +63 -0
  89. package/src/components/Banner/BannerImage.tsx +63 -0
  90. package/src/components/Banner/index.ts +2 -0
  91. package/src/components/BottomSheet/BottomSheetModal.figma.tsx +20 -0
  92. package/src/components/Button/Button.figma.tsx +60 -229
  93. package/src/components/Card/Card.docs.mdx +4 -4
  94. package/src/components/Card/Card.figma.tsx +43 -71
  95. package/src/components/Card/CardAction/CardAction.figma.tsx +44 -0
  96. package/src/components/Card/CardAction/CardAction.props.ts +2 -3
  97. package/src/components/Card/CardAction/CardAction.stories.tsx +5 -4
  98. package/src/components/Card/CardAction/CardActionRoot.tsx +4 -5
  99. package/src/components/Carousel/Carousel.figma.tsx +19 -0
  100. package/src/components/Checkbox/Checkbox.docs.mdx +23 -4
  101. package/src/components/Checkbox/Checkbox.figma.tsx +26 -41
  102. package/src/components/Checkbox/Checkbox.props.ts +3 -3
  103. package/src/components/Checkbox/Checkbox.stories.tsx +14 -8
  104. package/src/components/Checkbox/Checkbox.tsx +1 -2
  105. package/src/components/Checkbox/CheckboxGroup.figma.tsx +20 -0
  106. package/src/components/Checkbox/CheckboxImage.figma.tsx +27 -0
  107. package/src/components/Checkbox/CheckboxImage.tsx +8 -3
  108. package/src/components/Checkbox/CheckboxIndicator.tsx +3 -3
  109. package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +32 -0
  110. package/src/components/CurrencyInput/CurrencyInput.figma.tsx +56 -0
  111. package/src/components/DateInput/DateInput.figma.tsx +75 -0
  112. package/src/components/DatePicker/DatePickerCalendar.figma.tsx +34 -0
  113. package/src/components/DatePicker/DatePickerDay.tsx +3 -3
  114. package/src/components/DatePickerInput/DatePickerInput.figma.tsx +62 -0
  115. package/src/components/DescriptionList/DescriptionList.figma.tsx +23 -0
  116. package/src/components/Divider/Divider.figma.tsx +23 -18
  117. package/src/components/ExpandableCard/ExpandableCard.docs.mdx +2 -2
  118. package/src/components/ExpandableCard/ExpandableCard.figma.tsx +54 -0
  119. package/src/components/ExpandableCard/ExpandableCard.props.ts +1 -2
  120. package/src/components/ExpandableCard/ExpandableCard.stories.tsx +3 -3
  121. package/src/components/ExpandableCard/ExpandableCardGroup.figma.tsx +23 -0
  122. package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +4 -5
  123. package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +2 -17
  124. package/src/components/FormField/FormField.figma.tsx +23 -0
  125. package/src/components/Helper/HelperText.figma.tsx +23 -0
  126. package/src/components/HighlightBanner/HighlightBanner.docs.mdx +73 -42
  127. package/src/components/HighlightBanner/HighlightBanner.props.ts +2 -3
  128. package/src/components/HighlightBanner/HighlightBanner.stories.tsx +85 -60
  129. package/src/components/HighlightBanner/HighlightBanner.tsx +3 -10
  130. package/src/components/HighlightBanner/HighlightBannerImage.tsx +20 -0
  131. package/src/components/HighlightBanner/index.ts +1 -0
  132. package/src/components/IconButton/IconButton.figma.tsx +55 -161
  133. package/src/components/IconContainer/IconContainer.figma.tsx +50 -0
  134. package/src/components/InlineLink/InlineLink.figma.tsx +33 -0
  135. package/src/components/Input/Input.figma.tsx +52 -110
  136. package/src/components/Input/Input.stories.tsx +76 -3
  137. package/src/components/Input/Input.tsx +110 -98
  138. package/src/components/Input/InputField.tsx +27 -26
  139. package/src/components/Label/Label.figma.tsx +24 -0
  140. package/src/components/Link/Link.figma.tsx +42 -0
  141. package/src/components/List/List.docs.mdx +15 -9
  142. package/src/components/List/List.figma.tsx +29 -108
  143. package/src/components/List/List.stories.tsx +2 -2
  144. package/src/components/List/ListAction/ListAction.figma.tsx +29 -0
  145. package/src/components/List/ListItem/ListItem.figma.tsx +40 -220
  146. package/src/components/List/ListItem/ListItem.props.ts +2 -2
  147. package/src/components/List/ListItem/ListItemLeadingContent.figma.tsx +29 -0
  148. package/src/components/List/ListItem/ListItemRoot.tsx +2 -3
  149. package/src/components/List/ListItem/ListItemTrailingContent.figma.tsx +27 -0
  150. package/src/components/Menu/Menu.figma.tsx +30 -0
  151. package/src/components/Menu/MenuItem.figma.tsx +31 -0
  152. package/src/components/Modal/Modal.docs.mdx +16 -4
  153. package/src/components/Modal/Modal.figma.tsx +56 -0
  154. package/src/components/Modal/Modal.props.ts +3 -2
  155. package/src/components/Modal/Modal.stories.tsx +2 -5
  156. package/src/components/Modal/Modal.tsx +2 -6
  157. package/src/components/Modal/Modal.web.tsx +2 -6
  158. package/src/components/Modal/ModalImage.tsx +20 -0
  159. package/src/components/Modal/index.ts +1 -0
  160. package/src/components/PillGroup/Pill.figma.tsx +25 -0
  161. package/src/components/PillGroup/Pill.tsx +3 -3
  162. package/src/components/PillGroup/PillGroup.figma.tsx +21 -0
  163. package/src/components/PillGroup/PillGroup.stories.tsx +1 -1
  164. package/src/components/ProgressStepper/ProgressStep.figma.tsx +30 -0
  165. package/src/components/ProgressStepper/ProgressStepper.figma.tsx +20 -0
  166. package/src/components/Radio/Radio.docs.mdx +21 -8
  167. package/src/components/Radio/Radio.figma.tsx +22 -42
  168. package/src/components/Radio/Radio.props.ts +3 -3
  169. package/src/components/Radio/Radio.stories.tsx +15 -11
  170. package/src/components/Radio/Radio.tsx +1 -2
  171. package/src/components/Radio/RadioGroup.figma.tsx +54 -0
  172. package/src/components/Radio/RadioImage.figma.tsx +27 -0
  173. package/src/components/Radio/RadioImage.tsx +8 -3
  174. package/src/components/Radio/RadioIndicator.tsx +3 -3
  175. package/src/components/Radio/RadioTileRoot.figma.tsx +31 -0
  176. package/src/components/RadioCard/RadioCardIndicator.tsx +3 -3
  177. package/src/components/RadioCard/RadioCardRoot.tsx +3 -3
  178. package/src/components/SectionHeader/SectionHeader.figma.tsx +30 -16
  179. package/src/components/Select/Select.figma.tsx +55 -0
  180. package/src/components/Select/SelectOption.figma.tsx +36 -0
  181. package/src/components/Spinner/Spinner.figma.tsx +20 -12
  182. package/src/components/Switch/Switch.figma.tsx +31 -23
  183. package/src/components/Tabs/Tab.tsx +5 -5
  184. package/src/components/Tabs/Tabs.figma.tsx +29 -0
  185. package/src/components/ThemedImage/ThemedImage.stories.tsx +1 -1
  186. package/src/components/Toast/ToastItem.figma.tsx +22 -0
  187. package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
  188. package/src/components/ToggleButtonCard/ToggleButtonCardRoot.tsx +3 -3
  189. package/src/components/UnstyledIconButton/UnstyledIconButton.figma.tsx +49 -0
  190. package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +1 -1
  191. package/src/components/VerificationInput/VerificationInput.docs.mdx +68 -0
  192. package/src/components/VerificationInput/VerificationInput.props.ts +52 -0
  193. package/src/components/VerificationInput/VerificationInput.stories.tsx +140 -0
  194. package/src/components/VerificationInput/VerificationInput.tsx +89 -0
  195. package/src/components/VerificationInput/VerificationInputSlot.tsx +94 -0
  196. package/src/components/VerificationInput/index.ts +5 -0
  197. package/src/components/VerificationInput/useVerificationInput.ts +72 -0
  198. package/src/components/index.ts +1 -0
  199. package/src/utils/index.ts +2 -1
  200. package/src/utils/isThemedImageProps.ts +8 -0
  201. package/src/components/Checkbox/CheckboxIndicator.figma.tsx +0 -19
  202. package/src/components/Radio/RadioIndicator.figma.tsx +0 -21
@@ -4,18 +4,20 @@ import {
4
4
  ChevronRightSmallIcon,
5
5
  ElectricityMediumIcon,
6
6
  GasMediumIcon,
7
- InfoMediumIcon as HomeMediumIcon,
8
- // HomeMediumIcon,
7
+ HomeMediumIcon,
9
8
  PaymentMediumIcon,
10
9
  UserMediumIcon,
11
10
  } from '@utilitywarehouse/hearth-react-native-icons';
12
11
  import {
13
12
  Badge,
14
13
  BadgeText,
14
+ BodyText,
15
15
  Box,
16
16
  FlatList,
17
17
  Image,
18
+ Link,
18
19
  List,
20
+ ListAction,
19
21
  ListItem,
20
22
  ListItemContent,
21
23
  ListItemHelperText,
@@ -26,9 +28,6 @@ import {
26
28
  ListItemTrailingIcon,
27
29
  SectionHeader,
28
30
  Switch,
29
- Link,
30
- ListAction,
31
- BodyText,
32
31
  } from '../../';
33
32
  import { BackToTopButton, BadgeList, UsageWrap, ViewFigmaButton } from '../../../docs/components';
34
33
  import * as Stories from './List.stories';
@@ -116,7 +115,7 @@ const MyComponent = () => (
116
115
  | variant | `'subtle' \| 'emphasis'` | | The variant style of the list item. |
117
116
  | disabled | `boolean` | `false` | Whether to disable the list item. |
118
117
  | loading | `boolean` | `false` | Whether to show the list item in loading state. |
119
- | badge | `BadgeProps` | | Props to pass to the Badge component. |
118
+ | badge | `ReactNode` | | The badge component to display in the list item. |
120
119
  | badgePosition | `'top' \| 'bottom'` | `bottom` | Position of the badge in the list item. |
121
120
  | numericValue | `string \| number` | | A numeric value to display on the right side of the item. |
122
121
 
@@ -197,7 +196,14 @@ parts like `ListItemLeadingContent`, `ListItemContent`, and `ListItemTrailingCon
197
196
  <Canvas of={Stories.WithBadge} />
198
197
 
199
198
  ```tsx
200
- import { List, ListItem, IconContainer, Flex, Box } from '@utilitywarehouse/hearth-react-native';
199
+ import {
200
+ List,
201
+ ListItem,
202
+ IconContainer,
203
+ Flex,
204
+ Box,
205
+ Badge,
206
+ } from '@utilitywarehouse/hearth-react-native';
201
207
 
202
208
  import { ElectricityMediumIcon, GasMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
203
209
 
@@ -211,7 +217,7 @@ const BadgeList = () => {
211
217
  leadingContent={
212
218
  <IconContainer icon={ElectricityMediumIcon} size="md" variant="emphasis" color="energy" />
213
219
  }
214
- badge={{ text: 'Text' }}
220
+ badge={<Badge text="Text" />}
215
221
  />
216
222
  <ListItem
217
223
  heading="Gas"
@@ -220,7 +226,7 @@ const BadgeList = () => {
220
226
  leadingContent={
221
227
  <IconContainer icon={GasMediumIcon} size="md" variant="emphasis" color="energy" />
222
228
  }
223
- badge={{ text: 'Smart Meter' }}
229
+ badge={<Badge text="Smart Meter" />}
224
230
  />
225
231
  </List>
226
232
  );
@@ -1,110 +1,31 @@
1
- // /* eslint-disable react/jsx-no-undef */
2
- //
3
- // import { List } from './';
4
- // import figma from '@figma/code-connect';
5
- // import { Card } from '../Card';
1
+ import React from "react"
2
+ import List from "./List"
3
+ import figma from "@figma/code-connect"
6
4
 
7
- // const props = {
8
- // heading: figma.nestedProps('List Heading', {
9
- // text: figma.string('heading'),
10
- // helperText: figma.string('Supporting text'),
11
- // }),
12
- // listItem: figma.children('List Item'),
13
- // listItems: figma.children('List Items'),
14
- // cardProps: figma.nestedProps('Card', {
15
- // variant: figma.enum('variant', {
16
- // dashed: 'dashed',
17
- // elevated: 'elevated',
18
- // outline: 'outline',
19
- // filled: 'filled',
20
- // }),
21
- // padding: figma.enum('padding', {
22
- // large: 'large',
23
- // medium: 'medium',
24
- // small: 'small',
25
- // none: 'none',
26
- // }),
27
- // colorScheme: figma.enum('colorScheme', {
28
- // base: 'base',
29
- // grey: 'grey',
30
- // purple: 'purple',
31
- // }),
32
- // surface: figma.enum('surface', {
33
- // base: 'base',
34
- // purple: 'purple',
35
- // }),
36
- // }),
37
- // };
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
+ */
38
11
 
39
- // figma.connect(
40
- // List,
41
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4643-17907&m=dev',
42
- // {
43
- // props,
44
- // example: ({ listItems }) => <List>{listItems}</List>,
45
- // }
46
- // );
47
-
48
- // figma.connect(
49
- // List,
50
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4643-17907&m=dev',
51
- // {
52
- // props,
53
- // variant: {
54
- // 'Heading?': true,
55
- // },
56
- // example: ({ heading, listItems }) => (
57
- // <List headingText={heading.text} headingHelperText={heading.helperText}>
58
- // {listItems}
59
- // </List>
60
- // ),
61
- // }
62
- // );
63
-
64
- // figma.connect(
65
- // List,
66
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4643-17907&m=dev',
67
- // {
68
- // props,
69
- // variant: {
70
- // container: 'tile',
71
- // 'Heading?': true,
72
- // },
73
- // example: ({ heading, listItems, cardProps }) => (
74
- // <List
75
- // container="card"
76
- // headingText={heading.text}
77
- // headingHelperText={heading.helperText}
78
- // >
79
- // <Card {...cardProps}>{listItems}</Card>
80
- // </List>
81
- // ),
82
- // }
83
- // );
84
-
85
- // figma.connect(
86
- // List,
87
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4643-17907&m=dev',
88
- // {
89
- // props,
90
- // variant: {
91
- // container: 'tile',
92
- // 'Heading?': false,
93
- // },
94
- // example: ({ listItems, cardProps }) => (
95
- // <List container="card">
96
- // <Card {...cardProps}>{listItems}</Card>
97
- // </List>
98
- // ),
99
- // }
100
- // );
101
-
102
- // figma.connect(
103
- // List,
104
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4623-14698&m=dev',
105
- // {
106
- // props,
107
- // imports: [],
108
- // example: ({ listItem }) => <>{listItem}</>,
109
- // }
110
- // );
12
+ figma.connect(
13
+ List,
14
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2437%3A621",
15
+ {
16
+ props: {
17
+ // These props were automatically mapped based on your linked code:
18
+ container: figma.enum("Container", {
19
+ None: "none",
20
+ "Subtle White": "subtleWhite",
21
+ "Emphasis White": "emphasisWhite",
22
+ "Subtle Warm White": "subtleWarmWhite",
23
+ "Emphasis Warm White": "emphasisWarmWhite",
24
+ }),
25
+ // No matching props could be found for these Figma properties:
26
+ // "sectionHeader": figma.boolean('Section header?'),
27
+ // "listAction": figma.boolean('List action?')
28
+ },
29
+ example: (props) => <List container={props.container} />,
30
+ },
31
+ )
@@ -126,7 +126,7 @@ export const WithBadge: Story = {
126
126
  leadingContent={
127
127
  <IconContainer icon={ElectricityMediumIcon} size="md" variant="emphasis" color="energy" />
128
128
  }
129
- badge={{ text: 'Text' }}
129
+ badge={<Badge text="Text" />}
130
130
  />
131
131
  <ListItem
132
132
  heading="Gas"
@@ -135,7 +135,7 @@ export const WithBadge: Story = {
135
135
  leadingContent={
136
136
  <IconContainer icon={GasMediumIcon} size="md" variant="emphasis" color="energy" />
137
137
  }
138
- badge={{ text: 'Smart Meter' }}
138
+ badge={<Badge text="Smart Meter" />}
139
139
  />
140
140
  </List>
141
141
  ),
@@ -0,0 +1,29 @@
1
+ import figma from '@figma/code-connect';
2
+ import ListAction from './ListAction';
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
+ ListAction,
13
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=9661%3A5128',
14
+ {
15
+ props: {
16
+ // These props were automatically mapped based on your linked code:
17
+ heading: figma.string('Action heading'),
18
+ disabled: figma.enum('State', {
19
+ Disabled: true,
20
+ }),
21
+ 'aria-disabled': figma.enum('State', {
22
+ Disabled: true,
23
+ }),
24
+ // No matching props could be found for these Figma properties:
25
+ // "actionHeading": figma.string('Action heading')
26
+ },
27
+ example: props => <ListAction heading={props.heading} disabled={props.disabled} />,
28
+ }
29
+ );
@@ -1,220 +1,40 @@
1
- // /* eslint-disable react/jsx-no-undef */
2
- //
3
- // import { ListItem } from './';
4
- // import figma from '@figma/code-connect';
5
-
6
- // const props = {
7
- // divider: figma.boolean('Divider?'),
8
- // disabled: figma.enum('state', {
9
- // disabled: true,
10
- // }),
11
- // loading: figma.enum('state', {
12
- // loading: true,
13
- // }),
14
- // trailingIcon: figma.instance('Trailing Icon'),
15
- // leadingIcon: figma.instance('Leading Icon'),
16
- // text: figma.nestedProps('.Parts/List Item Text', {
17
- // text: figma.string('list item text'),
18
- // helperText: figma.string('Supporting Text'),
19
- // }),
20
- // };
21
-
22
- // figma.connect(
23
- // ListItem,
24
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4283-3401&m=dev',
25
- // {
26
- // props: props,
27
- // example: ({ disabled, divider, loading, text }) => (
28
- // <ListItem
29
- // text={text.text}
30
- // helperText={text.helperText}
31
- // disabled={disabled}
32
- // divider={divider}
33
- // loading={loading}
34
- // />
35
- // ),
36
- // }
37
- // );
38
-
39
- // figma.connect(
40
- // ListItem,
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
+ });
@@ -1,5 +1,5 @@
1
+ import { ReactNode } from 'react';
1
2
  import type { PressableProps, ViewProps } from 'react-native';
2
- import BadgeProps from '../../Badge/Badge.props';
3
3
 
4
4
  interface ListItemBaseProps extends Omit<PressableProps, 'children'> {
5
5
  loading?: boolean;
@@ -26,7 +26,7 @@ export interface ListItemWithoutChildren extends ListItemBaseProps {
26
26
  leadingContent?: ViewProps['children'];
27
27
  trailingContent?: ViewProps['children'];
28
28
  numericValue?: string | number;
29
- badge?: BadgeProps;
29
+ badge?: ReactNode;
30
30
  badgePosition?: 'top' | 'bottom';
31
31
  }
32
32
 
@@ -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
+ )
@@ -2,7 +2,6 @@ import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-ico
2
2
  import { useMemo } from 'react';
3
3
  import { Pressable, ViewStyle } from 'react-native';
4
4
  import { StyleSheet } from 'react-native-unistyles';
5
- import { Badge } from '../../Badge';
6
5
  import { DetailText } from '../../DetailText';
7
6
  import { Skeleton } from '../../Skeleton';
8
7
  import { useListContext } from '../List.context';
@@ -106,10 +105,10 @@ const ListItemRoot = ({
106
105
  <ListItemLeadingContent>{leadingContent}</ListItemLeadingContent>
107
106
  ) : null}
108
107
  <ListItemContent>
109
- {badgePosition === 'top' && badge ? <Badge {...badge} /> : null}
108
+ {badgePosition === 'top' && badge ? badge : null}
110
109
  <ListItemText>{heading}</ListItemText>
111
110
  {helperText ? <ListItemHelperText>{helperText}</ListItemHelperText> : null}
112
- {badgePosition === 'bottom' && badge ? <Badge {...badge} /> : null}
111
+ {badgePosition === 'bottom' && badge ? badge : null}
113
112
  </ListItemContent>
114
113
  {!!numericValue && <DetailText size="lg">{numericValue}</DetailText>}
115
114
  {trailingContent ? (
@@ -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
+ )
@@ -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
+ )