@utilitywarehouse/hearth-react-native 0.35.7 → 0.35.9

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 (203) hide show
  1. package/SKILL.md +129 -3
  2. package/build/components/Accordion/Accordion.figma.d.ts +15 -0
  3. package/build/components/Accordion/Accordion.figma.js +20 -0
  4. package/build/components/Accordion/AccordionItem.figma.d.ts +17 -0
  5. package/build/components/Accordion/AccordionItem.figma.js +26 -0
  6. package/build/components/Accordion/AccordionTrigger.js +1 -1
  7. package/build/components/Alert/Alert.figma.d.ts +33 -0
  8. package/build/components/Alert/Alert.figma.js +40 -0
  9. package/build/components/Avatar/Avatar.figma.d.ts +16 -0
  10. package/build/components/Avatar/Avatar.figma.js +29 -0
  11. package/build/components/Badge/Badge.figma.d.ts +21 -0
  12. package/build/components/Badge/Badge.figma.js +47 -0
  13. package/build/components/Banner/Banner.figma.d.ts +26 -0
  14. package/build/components/Banner/Banner.figma.js +47 -0
  15. package/build/components/Banner/BannerIllustration.figma.d.ts +11 -0
  16. package/build/components/Banner/BannerIllustration.figma.js +13 -0
  17. package/build/components/BottomSheet/BottomSheetModal.figma.d.ts +11 -0
  18. package/build/components/BottomSheet/BottomSheetModal.figma.js +11 -0
  19. package/build/components/Button/Button.figma.d.ts +38 -0
  20. package/build/components/Button/Button.figma.js +84 -0
  21. package/build/components/Card/Card.figma.d.ts +16 -0
  22. package/build/components/Card/Card.figma.js +49 -0
  23. package/build/components/Card/CardAction/CardAction.figma.d.ts +35 -0
  24. package/build/components/Card/CardAction/CardAction.figma.js +104 -0
  25. package/build/components/Card/CardAction/CardActionRoot.js +4 -0
  26. package/build/components/Card/CardRoot.js +5 -1
  27. package/build/components/Carousel/Carousel.figma.d.ts +17 -0
  28. package/build/components/Carousel/Carousel.figma.js +18 -0
  29. package/build/components/Checkbox/Checkbox.figma.d.ts +22 -0
  30. package/build/components/Checkbox/Checkbox.figma.js +29 -0
  31. package/build/components/Checkbox/CheckboxGroup.figma.d.ts +26 -0
  32. package/build/components/Checkbox/CheckboxGroup.figma.js +46 -0
  33. package/build/components/Checkbox/CheckboxImage.figma.d.ts +11 -0
  34. package/build/components/Checkbox/CheckboxImage.figma.js +10 -0
  35. package/build/components/Checkbox/CheckboxTileRoot.figma.d.ts +20 -0
  36. package/build/components/Checkbox/CheckboxTileRoot.figma.js +22 -0
  37. package/build/components/Combobox/Combobox.figma.d.ts +23 -0
  38. package/build/components/Combobox/Combobox.figma.js +69 -0
  39. package/build/components/CurrencyInput/CurrencyInput.figma.d.ts +31 -0
  40. package/build/components/CurrencyInput/CurrencyInput.figma.js +51 -0
  41. package/build/components/DateInput/DateInput.figma.d.ts +41 -0
  42. package/build/components/DateInput/DateInput.figma.js +87 -0
  43. package/build/components/DatePicker/DatePicker.figma.d.ts +25 -0
  44. package/build/components/DatePicker/DatePicker.figma.js +23 -0
  45. package/build/components/DatePicker/DatePickerDay.js +3 -3
  46. package/build/components/DatePickerInput/DatePickerInput.figma.d.ts +25 -0
  47. package/build/components/DatePickerInput/DatePickerInput.figma.js +52 -0
  48. package/build/components/DescriptionList/DescriptionList.figma.d.ts +26 -0
  49. package/build/components/DescriptionList/DescriptionList.figma.js +59 -0
  50. package/build/components/DescriptionList/DescriptionListItem.figma.d.ts +22 -0
  51. package/build/components/DescriptionList/DescriptionListItem.figma.js +42 -0
  52. package/build/components/Divider/Divider.figma.d.ts +13 -0
  53. package/build/components/Divider/Divider.figma.js +14 -0
  54. package/build/components/ExpandableCard/ExpandableCard.figma.d.ts +28 -0
  55. package/build/components/ExpandableCard/ExpandableCard.figma.js +52 -0
  56. package/build/components/ExpandableCard/ExpandableCardGroup.figma.d.ts +23 -0
  57. package/build/components/ExpandableCard/ExpandableCardGroup.figma.js +55 -0
  58. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +4 -0
  59. package/build/components/FormField/FormField.figma.d.ts +15 -0
  60. package/build/components/FormField/FormField.figma.js +27 -0
  61. package/build/components/Helper/HelperText.figma.d.ts +13 -0
  62. package/build/components/Helper/HelperText.figma.js +12 -0
  63. package/build/components/HighlightBanner/HighlightBanner.figma.d.ts +19 -0
  64. package/build/components/HighlightBanner/HighlightBanner.figma.js +45 -0
  65. package/build/components/IconButton/IconButton.figma.d.ts +22 -0
  66. package/build/components/IconButton/IconButton.figma.js +47 -0
  67. package/build/components/IconContainer/IconContainer.figma.d.ts +20 -0
  68. package/build/components/IconContainer/IconContainer.figma.js +43 -0
  69. package/build/components/IndicatorIconButton/IndicatorIconButton.figma.d.ts +17 -0
  70. package/build/components/IndicatorIconButton/IndicatorIconButton.figma.js +23 -0
  71. package/build/components/InlineLink/InlineLink.d.ts +1 -1
  72. package/build/components/InlineLink/InlineLink.js +7 -2
  73. package/build/components/InlineLink/InlineLink.props.d.ts +2 -0
  74. package/build/components/InlineLink/InlineLinkRoot.d.ts +1 -1
  75. package/build/components/InlineLink/InlineLinkRoot.js +8 -3
  76. package/build/components/Input/Input.figma.d.ts +28 -0
  77. package/build/components/Input/Input.figma.js +67 -0
  78. package/build/components/Input/Input_1.figma.d.ts +22 -0
  79. package/build/components/Input/Input_1.figma.js +54 -0
  80. package/build/components/Input/Input_2.figma.d.ts +17 -0
  81. package/build/components/Input/Input_2.figma.js +34 -0
  82. package/build/components/Label/Label.figma.d.ts +14 -0
  83. package/build/components/Label/Label.figma.js +19 -0
  84. package/build/components/Link/Link.d.ts +1 -1
  85. package/build/components/Link/Link.figma.d.ts +27 -0
  86. package/build/components/Link/Link.figma.js +45 -0
  87. package/build/components/Link/Link.js +7 -2
  88. package/build/components/Link/Link.props.d.ts +2 -0
  89. package/build/components/Link/LinkRoot.d.ts +1 -1
  90. package/build/components/Link/LinkRoot.js +8 -3
  91. package/build/components/List/List.figma.d.ts +21 -0
  92. package/build/components/List/List.figma.js +49 -0
  93. package/build/components/List/ListAction/ListAction.figma.d.ts +15 -0
  94. package/build/components/List/ListAction/ListAction.figma.js +17 -0
  95. package/build/components/List/ListAction/ListAction.js +1 -0
  96. package/build/components/List/ListItem/ListItem.figma.d.ts +33 -0
  97. package/build/components/List/ListItem/ListItem.figma.js +83 -0
  98. package/build/components/List/ListItem/ListItemHelperText.d.ts +1 -1
  99. package/build/components/List/ListItem/ListItemHelperText.js +2 -8
  100. package/build/components/List/ListItem/ListItemLeadingContent.figma.d.ts +14 -0
  101. package/build/components/List/ListItem/ListItemLeadingContent.figma.js +17 -0
  102. package/build/components/List/ListItem/ListItemRoot.js +1 -0
  103. package/build/components/List/ListItem/ListItemTrailingContent.figma.d.ts +13 -0
  104. package/build/components/List/ListItem/ListItemTrailingContent.figma.js +14 -0
  105. package/build/components/Menu/Menu.figma.d.ts +14 -0
  106. package/build/components/Menu/Menu.figma.js +33 -0
  107. package/build/components/Menu/MenuItem.figma.d.ts +29 -0
  108. package/build/components/Menu/MenuItem.figma.js +45 -0
  109. package/build/components/Modal/Modal.figma.d.ts +24 -0
  110. package/build/components/Modal/Modal.figma.js +64 -0
  111. package/build/components/NavModal/NavModal.figma.d.ts +19 -0
  112. package/build/components/NavModal/NavModal.figma.js +42 -0
  113. package/build/components/Pagination/Pagination.figma.d.ts +16 -0
  114. package/build/components/Pagination/Pagination.figma.js +20 -0
  115. package/build/components/PillGroup/Pill.figma.d.ts +17 -0
  116. package/build/components/PillGroup/Pill.figma.js +21 -0
  117. package/build/components/PillGroup/PillGroup.figma.d.ts +13 -0
  118. package/build/components/PillGroup/PillGroup.figma.js +18 -0
  119. package/build/components/ProgressBar/ProgressBar.circular.figma.d.ts +16 -0
  120. package/build/components/ProgressBar/ProgressBar.circular.figma.js +35 -0
  121. package/build/components/ProgressBar/ProgressBar.figma.d.ts +15 -0
  122. package/build/components/ProgressBar/ProgressBar.figma.js +31 -0
  123. package/build/components/ProgressStepper/ProgressStep.figma.d.ts +15 -0
  124. package/build/components/ProgressStepper/ProgressStep.figma.js +17 -0
  125. package/build/components/ProgressStepper/ProgressStepper.figma.d.ts +13 -0
  126. package/build/components/ProgressStepper/ProgressStepper.figma.js +14 -0
  127. package/build/components/Radio/Radio.figma.d.ts +15 -0
  128. package/build/components/Radio/Radio.figma.js +17 -0
  129. package/build/components/Radio/RadioGroup.figma.d.ts +19 -0
  130. package/build/components/Radio/RadioGroup.figma.js +45 -0
  131. package/build/components/Radio/RadioImage.figma.d.ts +11 -0
  132. package/build/components/Radio/RadioImage.figma.js +10 -0
  133. package/build/components/Radio/RadioTile.figma.d.ts +16 -0
  134. package/build/components/Radio/RadioTile.figma.js +23 -0
  135. package/build/components/RadioCard/RadioCard.figma.d.ts +16 -0
  136. package/build/components/RadioCard/RadioCard.figma.js +22 -0
  137. package/build/components/RadioCard/RadioCardIndicator.js +0 -3
  138. package/build/components/RadioCard/RadioCardRoot.js +3 -3
  139. package/build/components/Rating/Rating.figma.d.ts +12 -0
  140. package/build/components/Rating/Rating.figma.js +18 -0
  141. package/build/components/Roundel/Roundel.figma.d.ts +13 -0
  142. package/build/components/Roundel/Roundel.figma.js +15 -0
  143. package/build/components/SectionHeader/SectionHeader.figma.d.ts +21 -0
  144. package/build/components/SectionHeader/SectionHeader.figma.js +50 -0
  145. package/build/components/SegmentedControl/SegmentedControl.figma.d.ts +16 -0
  146. package/build/components/SegmentedControl/SegmentedControl.figma.js +20 -0
  147. package/build/components/SegmentedControl/SegmentedControlOption.figma.d.ts +17 -0
  148. package/build/components/SegmentedControl/SegmentedControlOption.figma.js +23 -0
  149. package/build/components/SegmentedControl/SegmentedControlOption.js +3 -0
  150. package/build/components/Select/Select.figma.d.ts +24 -0
  151. package/build/components/Select/Select.figma.js +65 -0
  152. package/build/components/Select/SelectOption.figma.d.ts +15 -0
  153. package/build/components/Select/SelectOption.figma.js +27 -0
  154. package/build/components/Spinner/Spinner.figma.d.ts +13 -0
  155. package/build/components/Spinner/Spinner.figma.js +16 -0
  156. package/build/components/Spinner/Spinner.js +1 -1
  157. package/build/components/Spinner/Spinner.web.js +1 -1
  158. package/build/components/StepperInput/StepperInput.figma.d.ts +25 -0
  159. package/build/components/StepperInput/StepperInput.figma.js +32 -0
  160. package/build/components/Switch/Switch.figma.d.ts +15 -0
  161. package/build/components/Switch/Switch.figma.js +18 -0
  162. package/build/components/Switch/Switch.js +25 -1
  163. package/build/components/Switch/Switch.web.js +25 -1
  164. package/build/components/Table/Table.figma.d.ts +14 -0
  165. package/build/components/Table/Table.figma.js +38 -0
  166. package/build/components/Table/TableHeaderCell.figma.d.ts +15 -0
  167. package/build/components/Table/TableHeaderCell.figma.js +31 -0
  168. package/build/components/Tabs/Tab.figma.d.ts +14 -0
  169. package/build/components/Tabs/Tab.figma.js +14 -0
  170. package/build/components/Tabs/Tab.js +6 -6
  171. package/build/components/Tabs/Tabs.figma.d.ts +14 -0
  172. package/build/components/Tabs/Tabs.figma.js +21 -0
  173. package/build/components/Textarea/Textarea.figma.d.ts +27 -0
  174. package/build/components/Textarea/Textarea.figma.js +53 -0
  175. package/build/components/TimePicker/TimePicker.figma.d.ts +16 -0
  176. package/build/components/TimePicker/TimePicker.figma.js +30 -0
  177. package/build/components/TimePickerInput/TimePickerInput.figma.d.ts +29 -0
  178. package/build/components/TimePickerInput/TimePickerInput.figma.js +53 -0
  179. package/build/components/Timeline/Timeline.figma.d.ts +14 -0
  180. package/build/components/Timeline/Timeline.figma.js +23 -0
  181. package/build/components/Timeline/TimelineItemProgress.figma.d.ts +16 -0
  182. package/build/components/Timeline/TimelineItemProgress.figma.js +30 -0
  183. package/build/components/Timeline/TimelineItemStatic.figma.d.ts +16 -0
  184. package/build/components/Timeline/TimelineItemStatic.figma.js +30 -0
  185. package/build/components/Toast/ToastItem.figma.d.ts +20 -0
  186. package/build/components/Toast/ToastItem.figma.js +42 -0
  187. package/build/components/ToggleButton/ToggleButtonRoot.js +1 -1
  188. package/build/components/ToggleButtonCard/ToggleButtonCard.figma.d.ts +14 -0
  189. package/build/components/ToggleButtonCard/ToggleButtonCard.figma.js +28 -0
  190. package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +16 -8
  191. package/build/components/UnstyledIconButton/UnstyledIconButton.figma.d.ts +21 -0
  192. package/build/components/UnstyledIconButton/UnstyledIconButton.figma.js +32 -0
  193. package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
  194. package/build/components/VerificationInput/VerificationInput.figma.d.ts +19 -0
  195. package/build/components/VerificationInput/VerificationInput.figma.js +22 -0
  196. package/build/components/index.d.ts +1 -0
  197. package/build/components/index.js +1 -0
  198. package/build/core/themes.d.ts +16 -16
  199. package/package.json +5 -4
  200. package/public/llms/components/list.md +6 -11
  201. package/public/llms/docs/{ai-tooling.md → ai-toolkit.md} +29 -7
  202. package/public/llms/docs/introduction.md +1 -1
  203. package/public/llms.txt +1 -1
@@ -67,7 +67,7 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
67
67
  const onPressOut = () => {
68
68
  scale.value = withSpring(1);
69
69
  };
70
- return (_jsx(Pressable, { onPress: toggleSwitch, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, "aria-checked": value, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, accessibilityLabel: accessibilityProps.accessibilityLabel, accessibilityHint: accessibilityProps.accessibilityHint, ...accessibilityProps, children: _jsx(AnimatedView, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(AnimatedView, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(AnimatedView, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
70
+ return (_jsx(Pressable, { onPress: toggleSwitch, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, "aria-checked": value, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, accessibilityLabel: accessibilityProps.accessibilityLabel, accessibilityHint: accessibilityProps.accessibilityHint, style: styles.pressable, ...accessibilityProps, children: _jsx(AnimatedView, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(AnimatedView, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(AnimatedView, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
71
71
  const IconAny = Icon;
72
72
  return _jsx(IconAny, { as: TickSmallIcon, style: styles.icon });
73
73
  })() }), _jsx(AnimatedView, { style: [styles.iconWrap, animatedCrossStyle], children: (() => {
@@ -76,6 +76,20 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
76
76
  })() })] }) }) }));
77
77
  };
78
78
  const styles = StyleSheet.create(theme => ({
79
+ pressable: {
80
+ variants: {
81
+ disabled: {
82
+ false: {
83
+ _web: {
84
+ '_focus-visible': { outline: 'none' },
85
+ '_focus-visible > div:nth-child(1)': {
86
+ ...theme.helpers.focusVisible,
87
+ },
88
+ },
89
+ },
90
+ },
91
+ },
92
+ },
79
93
  switch: {
80
94
  justifyContent: 'center',
81
95
  variants: {
@@ -96,9 +110,19 @@ const styles = StyleSheet.create(theme => ({
96
110
  value: {
97
111
  true: {
98
112
  backgroundColor: theme.color.interactive.brand.surface.strong.default,
113
+ _web: {
114
+ _hover: {
115
+ backgroundColor: theme.color.interactive.brand.surface.strong.hover,
116
+ },
117
+ },
99
118
  },
100
119
  false: {
101
120
  backgroundColor: theme.color.interactive.functional.surface.strong.default,
121
+ _web: {
122
+ _hover: {
123
+ backgroundColor: theme.color.interactive.functional.surface.strong.hover,
124
+ },
125
+ },
102
126
  },
103
127
  },
104
128
  disabled: {
@@ -0,0 +1,14 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ container: string | undefined;
10
+ pagination: boolean;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,38 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6403-17515&t=pZwKJYFo1y1QRQD1-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Table/Table.tsx
3
+ // component=Table
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const container = instance.getEnum('Container', {
7
+ Subtle: 'subtle',
8
+ Emphasis: 'emphasis',
9
+ None: 'none',
10
+ });
11
+ const pagination = instance.getBoolean('Pagination?');
12
+ export default {
13
+ id: 'Table',
14
+ imports: [
15
+ "import { ExpandSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';",
16
+ "import { UnstyledIconButton, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from '@utilitywarehouse/hearth-react-native';",
17
+ ],
18
+ example: figma.code `<Table${figma.helpers.react.renderProp('container', container)}${figma.helpers.react.renderProp('pagination', pagination)}>
19
+ <TableHeader color="purple">
20
+ <TableHeaderCell trailingContent={<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} inverted size="sm" />}>
21
+ Header
22
+ </TableHeaderCell>
23
+ <TableHeaderCell trailingContent={<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} inverted size="sm" />}>
24
+ Header
25
+ </TableHeaderCell>
26
+ </TableHeader>
27
+ <TableBody>
28
+ <TableRow>
29
+ <TableHeaderCell row>Row title</TableHeaderCell>
30
+ <TableCell>Value</TableCell>
31
+ </TableRow>
32
+ </TableBody>
33
+ </Table>`,
34
+ metadata: {
35
+ nestable: true,
36
+ props: { container, pagination },
37
+ },
38
+ };
@@ -0,0 +1,15 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ sort: boolean;
10
+ color: string | undefined;
11
+ variant: string | undefined;
12
+ };
13
+ };
14
+ };
15
+ export default _default;
@@ -0,0 +1,31 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6414-6728&t=pZwKJYFo1y1QRQD1-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Table/TableHeaderCell.tsx
3
+ // component=TableHeaderCell
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const sort = instance.getBoolean('Sort?');
7
+ const color = instance.getEnum('Color', {
8
+ Purple: 'purple',
9
+ White: 'white',
10
+ });
11
+ const variant = instance.getEnum('Variant', {
12
+ Text: 'text',
13
+ Blank: 'blank',
14
+ });
15
+ const trailingContent = sort
16
+ ? figma.code `<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} size="sm" />`
17
+ : '';
18
+ export default {
19
+ id: 'TableHeaderCell',
20
+ imports: [
21
+ "import { ExpandSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';",
22
+ "import { UnstyledIconButton, TableHeaderCell } from '@utilitywarehouse/hearth-react-native';",
23
+ ],
24
+ example: figma.code `<TableHeaderCell${figma.helpers.react.renderProp('color', color)}${trailingContent ? ` trailingContent={${trailingContent}}` : ''}>
25
+ Header
26
+ </TableHeaderCell>`,
27
+ metadata: {
28
+ nestable: true,
29
+ props: { sort, color, variant },
30
+ },
31
+ };
@@ -0,0 +1,14 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ label: string;
10
+ icon: figma.ResultSection[] | undefined;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,14 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6464-2288&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Tabs/Tab.tsx
3
+ // component=Tab
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Label');
6
+ const icon = figma.selectedInstance.getBoolean('Icon?', {
7
+ true: figma.selectedInstance.getInstanceSwap('Icon-20')?.executeTemplate().example,
8
+ });
9
+ export default {
10
+ id: 'Tab',
11
+ imports: ["import { Tab } from '@utilitywarehouse/hearth-react-native';"],
12
+ example: figma.code `<Tab${figma.helpers.react.renderProp('value', label)}${figma.helpers.react.renderProp('icon', icon)}>${figma.helpers.react.renderChildren(label)}</Tab>`,
13
+ metadata: { nestable: true, props: { label, icon } },
14
+ };
@@ -22,7 +22,7 @@ const Tab = ({ value, children, icon, disabled, style, states, ...props }) => {
22
22
  registerTabLayout(value, { x, y, width, height });
23
23
  }, [value, registerTabLayout]);
24
24
  return (_jsx(Pressable, { ref: ref, accessibilityRole: "tab", accessibilityState: { selected: isActive, disabled: !!(disabled || allDisabled) }, onPress: handlePress, onLayout: handleLayout, style: [styles.tab, style], ...(Platform.OS === 'web'
25
- ? { id: `tab-${value}`, 'aria-controls': `tabpanel-${value}` }
25
+ ? { id: `tab-${value}`, 'aria-controls': `tabpanel-${value}`, 'aria-selected': isActive }
26
26
  : null), ...props, children: _jsxs(View, { style: styles.content, children: [icon ? _jsx(Icon, { as: icon }) : null, _jsx(BodyText, { size: size, weight: "semibold", children: children })] }) }));
27
27
  };
28
28
  Tab.displayName = 'Tab';
@@ -38,11 +38,11 @@ const styles = StyleSheet.create(theme => ({
38
38
  _hover: {
39
39
  backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
40
40
  },
41
- // '_focus-visible': {
42
- // ...theme.helpers.focusVisible,
43
- // outlineOffset: -2,
44
- // borderRadius: theme.borderRadius.sm,
45
- // },
41
+ '_focus-visible': {
42
+ ...theme.helpers.focusVisible,
43
+ outlineOffset: -2,
44
+ borderRadius: theme.borderRadius.sm,
45
+ },
46
46
  _active: {
47
47
  backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
48
48
  },
@@ -0,0 +1,14 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ size: string | undefined;
10
+ tabs: figma.ResultSection[];
11
+ };
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,21 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6464%3A8744
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Tabs/Tabs.tsx
3
+ // component=Tabs
4
+ import figma from 'figma';
5
+ const size = figma.selectedInstance.getEnum('Size', {
6
+ 'MD-56': 'md',
7
+ 'LG-64': 'lg',
8
+ });
9
+ const tabs = figma.properties.children(['Tab item']);
10
+ export default {
11
+ id: 'Tabs',
12
+ imports: ["import { TabPanel, Tabs, TabsList } from '@utilitywarehouse/hearth-react-native';"],
13
+ example: figma.code `<Tabs${figma.helpers.react.renderProp('size', size)}>
14
+ <TabsList>${figma.helpers.react.renderChildren(tabs)}</TabsList>
15
+ {/* Example TabPanel content, make sure they match the value of your Tab items */}
16
+ <TabPanel value="account">Account content</TabPanel>
17
+ <TabPanel value="billing">Billing content</TabPanel>
18
+ <TabPanel value="usage">Usage content</TabPanel>
19
+ </Tabs>`,
20
+ metadata: { nestable: true, props: { size, tabs } },
21
+ };
@@ -0,0 +1,27 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ disabled: boolean | undefined;
10
+ readonly: boolean | undefined;
11
+ placeholder: string | undefined;
12
+ value: string | undefined;
13
+ label: string;
14
+ labelVariant: string | undefined;
15
+ helperText: string;
16
+ validationStatus: string | undefined;
17
+ invalidText: string | undefined;
18
+ validText: string | undefined;
19
+ required: figma.EnumOptionsValues<{
20
+ true: boolean;
21
+ false: boolean;
22
+ }>;
23
+ focused: boolean | undefined;
24
+ };
25
+ };
26
+ };
27
+ export default _default;
@@ -0,0 +1,53 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2356:5180
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Textarea/Textarea.tsx
3
+ // component=Textarea
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const disabled = instance.getEnum('State', { Disabled: true });
7
+ const readonly = instance.getEnum('State', { 'Read-only': true });
8
+ const placeholder = instance.getEnum('Value type', {
9
+ Placeholder: instance.getString('Value'),
10
+ });
11
+ const value = instance.getEnum('Value type', { Filled: instance.getString('Value') });
12
+ const label = instance.getString('Label');
13
+ const labelVariant = instance.getEnum('Label variant', { Body: 'body', Heading: 'heading' });
14
+ const helperText = instance.getBoolean('Helper text?', {
15
+ true: instance.getString('Helper text'),
16
+ });
17
+ const validationStatus = instance.getEnum('State', {
18
+ Invalid: 'invalid',
19
+ Valid: 'valid',
20
+ });
21
+ const invalidText = instance.getEnum('State', {
22
+ Invalid: instance.getString('Validation'),
23
+ });
24
+ const validText = instance.getEnum('State', {
25
+ Valid: instance.getString('Validation'),
26
+ });
27
+ const required = instance.getBoolean('Optional?', {
28
+ true: false,
29
+ false: true,
30
+ });
31
+ const focused = instance.getEnum('Focus?', { True: true });
32
+ export default {
33
+ id: 'textarea',
34
+ imports: ['import { Textarea } from "@utilitywarehouse/hearth-react-native";'],
35
+ example: figma.code `<Textarea${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('readonly', readonly)}${figma.helpers.react.renderProp('placeholder', placeholder)}${figma.helpers.react.renderProp('value', value)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('labelVariant', labelVariant)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('validText', validText)}${figma.helpers.react.renderProp('required', required)}${figma.helpers.react.renderProp('focused', focused)} />`,
36
+ metadata: {
37
+ nestable: true,
38
+ props: {
39
+ disabled,
40
+ readonly,
41
+ placeholder,
42
+ value,
43
+ label,
44
+ labelVariant,
45
+ helperText,
46
+ validationStatus,
47
+ invalidText,
48
+ validText,
49
+ required,
50
+ focused,
51
+ },
52
+ },
53
+ };
@@ -0,0 +1,16 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ hideFooter: figma.EnumOptionsValues<{
10
+ true: boolean;
11
+ false: boolean;
12
+ }>;
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,30 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10334-16770&t=Jg2fPJPQNzOyspmQ-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/TimePicker/TimePicker.tsx
3
+ // component=TimePicker
4
+ import figma from 'figma';
5
+ const hideFooter = figma.selectedInstance.getBoolean('Footer?', {
6
+ true: false,
7
+ false: true,
8
+ });
9
+ export default {
10
+ id: 'time-picker',
11
+ imports: [
12
+ "import { useRef, useState } from 'react';",
13
+ "import { BottomSheetModalProvider, Button, TimePicker } from '@utilitywarehouse/hearth-react-native';",
14
+ "import type { DateType } from '@utilitywarehouse/hearth-react-native';",
15
+ ],
16
+ example: figma.code `const pickerRef = useRef(null);
17
+ const [time, setTime] = useState<DateType>();
18
+
19
+ <BottomSheetModalProvider>
20
+ <Button onPress={() => pickerRef.current?.present()}>Choose time</Button>
21
+ <TimePicker
22
+ ref={pickerRef}
23
+ date={time}
24
+ onChange={({ date }) => setTime(date)}
25
+ onCancel={() => setTime(undefined)}
26
+ use12Hours={false}${figma.helpers.react.renderProp('hideFooter', hideFooter)}
27
+ />
28
+ </BottomSheetModalProvider>`,
29
+ metadata: { nestable: true, props: { hideFooter } },
30
+ };
@@ -0,0 +1,29 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ disabled: boolean | undefined;
10
+ validationStatus: figma.EnumOptionsValues<{
11
+ Default: undefined;
12
+ Valid: string;
13
+ Invalid: string;
14
+ }>;
15
+ readonly: boolean | undefined;
16
+ label: string;
17
+ validText: string | undefined;
18
+ invalidText: string | undefined;
19
+ placeholder: string | undefined;
20
+ value: string | undefined;
21
+ helperText: figma.EnumOptionsValues<{
22
+ true: string;
23
+ false: undefined;
24
+ }>;
25
+ focused: boolean | undefined;
26
+ };
27
+ };
28
+ };
29
+ export default _default;
@@ -0,0 +1,53 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10334-6212&t=Jg2fPJPQNzOyspmQ-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/TimePickerInput/TimePickerInput.tsx
3
+ // component=TimePickerInput
4
+ import figma from 'figma';
5
+ const disabled = figma.selectedInstance.getEnum('Variant', {
6
+ Disabled: true,
7
+ });
8
+ const validationStatus = figma.selectedInstance.getEnum('Variant', {
9
+ Default: undefined,
10
+ Valid: 'valid',
11
+ Invalid: 'invalid',
12
+ });
13
+ const readonly = figma.selectedInstance.getEnum('Variant', {
14
+ 'Read-only': true,
15
+ });
16
+ const label = figma.selectedInstance.getString('Label');
17
+ const validText = figma.selectedInstance.getEnum('Variant', {
18
+ Valid: figma.selectedInstance.getString('Validation'),
19
+ });
20
+ const invalidText = figma.selectedInstance.getEnum('Variant', {
21
+ Invalid: figma.selectedInstance.getString('Validation'),
22
+ });
23
+ const placeholder = figma.selectedInstance.getEnum('Value type', {
24
+ Placeholder: figma.selectedInstance.getString('Value'),
25
+ });
26
+ const value = figma.selectedInstance.getEnum('Value type', {
27
+ Filled: figma.selectedInstance.getString('Value'),
28
+ });
29
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
30
+ true: figma.selectedInstance.getString('Helper text'),
31
+ false: undefined,
32
+ });
33
+ const focused = figma.selectedInstance.getEnum('Focus?', { Yes: true });
34
+ export default {
35
+ id: 'TimePickerInput',
36
+ imports: ["import { TimePickerInput } from '@utilitywarehouse/hearth-react-native';"],
37
+ example: figma.code `<TimePickerInput${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('readonly', readonly)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('validText', validText)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('placeholder', placeholder)}${figma.helpers.react.renderProp('value', value)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('focused', focused)}/>`,
38
+ metadata: {
39
+ nestable: true,
40
+ props: {
41
+ disabled,
42
+ validationStatus,
43
+ readonly,
44
+ label,
45
+ validText,
46
+ invalidText,
47
+ placeholder,
48
+ value,
49
+ helperText,
50
+ focused,
51
+ },
52
+ },
53
+ };
@@ -0,0 +1,14 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ variant: string | undefined;
10
+ items: figma.ResultSection[][];
11
+ };
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,23 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10592-5483&t=pZwKJYFo1y1QRQD1-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/Timeline.tsx
3
+ // component=Timeline
4
+ import figma from 'figma';
5
+ const variant = figma.selectedInstance.getEnum('Variant', {
6
+ Progress: 'progress',
7
+ Static: 'static',
8
+ });
9
+ const itemLayers = figma.selectedInstance
10
+ .findLayers(n => n.type === 'INSTANCE')
11
+ .filter((layer) => layer.type === 'INSTANCE');
12
+ const items = itemLayers
13
+ .filter(layer => layer.hasCodeConnect())
14
+ .map(layer => layer.executeTemplate().example);
15
+ export default {
16
+ id: 'Timeline',
17
+ imports: ['import { Timeline } from "@utilitywarehouse/hearth-react-native";'],
18
+ example: figma.code `<Timeline${figma.helpers.react.renderProp('variant', variant)}>${figma.helpers.react.renderChildren(items.flat())}</Timeline>`,
19
+ metadata: {
20
+ nestable: true,
21
+ props: { variant, items },
22
+ },
23
+ };
@@ -0,0 +1,16 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ label: string;
10
+ helperText: string;
11
+ state: string | undefined;
12
+ customContent: figma.ResultSection[][];
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,30 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10562-2810&t=pZwKJYFo1y1QRQD1-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/TimelineItem.tsx
3
+ // component=TimelineItem
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Label');
6
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
7
+ true: figma.selectedInstance.getString('Helper text'),
8
+ });
9
+ const state = figma.selectedInstance.getEnum('State', {
10
+ Complete: 'complete',
11
+ Active: 'active',
12
+ Incomplete: 'incomplete',
13
+ });
14
+ const slot = figma.selectedInstance.getSlot('Slot');
15
+ const customContentInstance = figma.selectedInstance.getBoolean('Custom content?', {
16
+ true: figma.selectedInstance.getInstanceSwap('Custom content')?.executeTemplate().example,
17
+ });
18
+ const customContent = [
19
+ ...(slot?.connectedInstances.map(i => i.executeTemplate().example) ?? []),
20
+ ...(customContentInstance ? [customContentInstance] : []),
21
+ ];
22
+ export default {
23
+ id: 'TimelineItem',
24
+ imports: ['import { TimelineItem } from "@utilitywarehouse/hearth-react-native";'],
25
+ example: figma.code `<TimelineItem variant="progress" position="middle"${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('state', state)}>${figma.helpers.react.renderChildren(customContent.flat())}</TimelineItem>`,
26
+ metadata: {
27
+ nestable: true,
28
+ props: { label, helperText, state, customContent },
29
+ },
30
+ };
@@ -0,0 +1,16 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ label: string;
10
+ helperText: string;
11
+ position: string | undefined;
12
+ customContent: figma.ResultSection[][];
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,30 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10592-5189&t=pZwKJYFo1y1QRQD1-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/TimelineItem.tsx
3
+ // component=TimelineItem
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Label');
6
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
7
+ true: figma.selectedInstance.getString('Helper text'),
8
+ });
9
+ const position = figma.selectedInstance.getEnum('Variant', {
10
+ Start: 'start',
11
+ Middle: 'middle',
12
+ End: 'end',
13
+ });
14
+ const slot = figma.selectedInstance.getSlot('Slot');
15
+ const customContentInstance = figma.selectedInstance.getBoolean('Custom content?', {
16
+ true: figma.selectedInstance.getInstanceSwap('Custom content')?.executeTemplate().example,
17
+ });
18
+ const customContent = [
19
+ ...(slot?.connectedInstances.map(i => i.executeTemplate().example) ?? []),
20
+ ...(customContentInstance ? [customContentInstance] : []),
21
+ ];
22
+ export default {
23
+ id: 'TimelineItem',
24
+ imports: ['import { TimelineItem } from "@utilitywarehouse/hearth-react-native";'],
25
+ example: figma.code `<TimelineItem variant="static"${figma.helpers.react.renderProp('position', position)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}>${figma.helpers.react.renderChildren(customContent.flat())}</TimelineItem>`,
26
+ metadata: {
27
+ nestable: true,
28
+ props: { label, helperText, position, customContent },
29
+ },
30
+ };
@@ -0,0 +1,20 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ nestable: boolean;
8
+ props: {
9
+ text: string;
10
+ hasIcon: boolean;
11
+ icon: figma.EnumOptionsValues<{
12
+ true: figma.ResultSection[] | undefined;
13
+ false: string;
14
+ }>;
15
+ hasLink: boolean;
16
+ hasDismiss: boolean;
17
+ };
18
+ };
19
+ };
20
+ export default _default;