@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
@@ -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
+ radio: {
10
+ label: string | undefined;
11
+ };
12
+ content: figma.ResultSection[][];
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,22 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2164-727&t=Uq6QfQcygdNGv5lM-4
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/RadioCard/RadioCard.tsx
3
+ // component=RadioCard
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const radio = (function () {
7
+ const nestedLayer0 = instance.findText('Label');
8
+ return {
9
+ label: nestedLayer0.type !== 'ERROR' ? nestedLayer0.textContent : undefined,
10
+ };
11
+ })();
12
+ const contentSlot = instance.getSlot('Content');
13
+ const content = contentSlot?.connectedInstances.map(item => item.executeTemplate().example) ?? [];
14
+ export default {
15
+ id: 'RadioCard',
16
+ imports: ["import { RadioCard } from '@utilitywarehouse/hearth-react-native';"],
17
+ example: figma.code `// This should be wrapped in a RadioCardGroup, see docs
18
+ <RadioCard${figma.helpers.react.renderProp('label', radio.label)} value="someValue">
19
+ ${figma.helpers.react.renderChildren(content.flat())}
20
+ </RadioCard>`,
21
+ metadata: { nestable: true, props: { radio, content } },
22
+ };
@@ -30,9 +30,6 @@ const styles = StyleSheet.create(theme => ({
30
30
  _hover: {
31
31
  outlineColor: theme.components.radio.outlineColorHover,
32
32
  },
33
- // '_focus-within': {
34
- // ...theme.helpers.focusVisible,
35
- // },
36
33
  _active: {
37
34
  outlineColor: theme.components.radio.outlineColorActive,
38
35
  },
@@ -59,9 +59,9 @@ const styles = StyleSheet.create(theme => ({
59
59
  },
60
60
  },
61
61
  _web: {
62
- // '_focus-visible': {
63
- // ...theme.helpers.focusVisible,
64
- // },
62
+ '_focus-visible': {
63
+ ...theme.helpers.focusVisible,
64
+ },
65
65
  },
66
66
  },
67
67
  }));
@@ -0,0 +1,12 @@
1
+ import figma from 'figma';
2
+ declare const _default: {
3
+ id: string;
4
+ imports: string[];
5
+ example: figma.TemplateStringResult;
6
+ metadata: {
7
+ props: {
8
+ value: number | undefined;
9
+ };
10
+ };
11
+ };
12
+ export default _default;
@@ -0,0 +1,18 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10620-4185
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Rating/Rating.tsx
3
+ // component=Rating
4
+ import figma from 'figma';
5
+ const value = figma.selectedInstance.getEnum('Rating', {
6
+ '0 Star': 0,
7
+ '1 Star': 1,
8
+ '2 Star': 2,
9
+ '3 Star': 3,
10
+ '4 Star': 4,
11
+ '5 Star': 5,
12
+ });
13
+ export default {
14
+ id: 'rating',
15
+ imports: ["import { Rating } from '@utilitywarehouse/hearth-react-native';"],
16
+ example: figma.code `<Rating${figma.helpers.react.renderProp('value', value)} />`,
17
+ metadata: { props: { value } },
18
+ };
@@ -0,0 +1,13 @@
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
+ };
11
+ };
12
+ };
13
+ export default _default;
@@ -0,0 +1,15 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6414%3A8697&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Roundel/Roundel.tsx
3
+ // component=Roundel
4
+ import figma from 'figma';
5
+ const variant = figma.selectedInstance.getEnum('Variant', {
6
+ Success: 'success',
7
+ Pending: 'pending',
8
+ Error: 'error',
9
+ });
10
+ export default {
11
+ id: 'Roundel',
12
+ imports: ["import { Roundel } from '@utilitywarehouse/hearth-react-native';"],
13
+ example: figma.code `<Roundel${figma.helpers.react.renderProp('variant', variant)} />`,
14
+ metadata: { nestable: true, props: { variant } },
15
+ };
@@ -0,0 +1,21 @@
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
+ state: string | undefined;
10
+ heading: string;
11
+ helperTextVisible: boolean;
12
+ helperText: string | undefined;
13
+ badgeVisible: boolean;
14
+ badge: figma.ResultSection[] | undefined;
15
+ trailingContentVisible: boolean;
16
+ trailingContent: figma.ResultSection[] | undefined;
17
+ invalidText: string | undefined;
18
+ };
19
+ };
20
+ };
21
+ export default _default;
@@ -0,0 +1,50 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=9092%3A3352
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/SectionHeader/SectionHeader.tsx
3
+ // component=SectionHeader
4
+ import figma from 'figma';
5
+ const state = figma.selectedInstance.getEnum('State', {
6
+ Invalid: 'invalid',
7
+ Default: 'default',
8
+ });
9
+ const heading = figma.selectedInstance.getString('Heading');
10
+ const helperTextVisible = figma.selectedInstance.getBoolean('Helper text?');
11
+ const helperText = helperTextVisible ? figma.selectedInstance.getString('Helper text') : undefined;
12
+ const badgeVisible = figma.selectedInstance.getBoolean('Badge?');
13
+ const badge = badgeVisible
14
+ ? figma.selectedInstance.findInstance('Badge')?.executeTemplate().example
15
+ : undefined;
16
+ const trailingContentVisible = figma.selectedInstance.getBoolean('Trailing content?');
17
+ const trailingContent = trailingContentVisible
18
+ ? (() => {
19
+ const trailingContentInstance = figma.selectedInstance.findInstance('Trailing content');
20
+ const link = trailingContentInstance.type === 'INSTANCE'
21
+ ? trailingContentInstance.findInstance('Link')
22
+ : undefined;
23
+ return link?.executeTemplate().example;
24
+ })()
25
+ : undefined;
26
+ const invalidText = state === 'invalid'
27
+ ? (() => {
28
+ const validationText = figma.selectedInstance.findInstance('Validation Text');
29
+ return validationText.type === 'INSTANCE' ? validationText.getString('Text') : undefined;
30
+ })()
31
+ : undefined;
32
+ export default {
33
+ id: 'section-header',
34
+ imports: ["import { SectionHeader } from '@utilitywarehouse/hearth-react-native';"],
35
+ example: figma.code `<SectionHeader${figma.helpers.react.renderProp('heading', heading)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('badge', badge)}${figma.helpers.react.renderProp('trailingContent', trailingContent)}${figma.helpers.react.renderProp('invalidText', invalidText)}/>`,
36
+ metadata: {
37
+ nestable: true,
38
+ props: {
39
+ state,
40
+ heading,
41
+ helperTextVisible,
42
+ helperText,
43
+ badgeVisible,
44
+ badge,
45
+ trailingContentVisible,
46
+ trailingContent,
47
+ invalidText,
48
+ },
49
+ },
50
+ };
@@ -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
+ size: string | undefined;
10
+ option0: figma.ResultSection[] | undefined;
11
+ option1: figma.ResultSection[] | undefined;
12
+ option2: figma.ResultSection[] | undefined;
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,20 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6185-1021&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/SegmentedControl/SegmentedControl.tsx
3
+ // component=SegmentedControl
4
+ import figma from 'figma';
5
+ const size = figma.selectedInstance.getEnum('Size', {
6
+ 'SM-32': 'sm',
7
+ 'MD-48': 'md',
8
+ });
9
+ const optionLayers = figma.selectedInstance.findLayers(n => n.type === 'INSTANCE');
10
+ const option0 = optionLayers[0]?.type === 'INSTANCE' ? optionLayers[0].executeTemplate().example : undefined;
11
+ const option1 = optionLayers[1]?.type === 'INSTANCE' ? optionLayers[1].executeTemplate().example : undefined;
12
+ const option2 = optionLayers[2]?.type === 'INSTANCE' ? optionLayers[2].executeTemplate().example : undefined;
13
+ export default {
14
+ id: 'segmented-control',
15
+ imports: ["import { SegmentedControl } from '@utilitywarehouse/hearth-react-native';"],
16
+ example: figma.code `<SegmentedControl defaultValue="option-1"${figma.helpers.react.renderProp('size', size)}>
17
+ ${option0}${option1}${option2}
18
+ </SegmentedControl>`,
19
+ metadata: { nestable: true, props: { size, option0, option1, option2 } },
20
+ };
@@ -0,0 +1,17 @@
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: {
11
+ $value: string;
12
+ $type: "react-component";
13
+ } | undefined;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
@@ -0,0 +1,23 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=4340-1252&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/SegmentedControl/SegmentedControlOption.tsx
3
+ // component=SegmentedControlOption
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Label');
6
+ const iconName = figma.selectedInstance.getBoolean('Icon?', {
7
+ true: figma.selectedInstance.getInstanceSwap('Icon-20')?.executeTemplate().metadata?.props
8
+ ?.componentName,
9
+ });
10
+ const icon = iconName ? figma.helpers.react.reactComponent(iconName) : undefined;
11
+ export default {
12
+ id: 'segmented-control-option',
13
+ imports: [
14
+ "import { SegmentedControlOption } from '@utilitywarehouse/hearth-react-native';",
15
+ ...(iconName
16
+ ? [`import { ${iconName} } from '@utilitywarehouse/hearth-react-native-icons';`]
17
+ : []),
18
+ ],
19
+ example: figma.code `<SegmentedControlOption value={'option'}${figma.helpers.react.renderProp('icon', icon)}>
20
+ ${figma.helpers.react.renderChildren(label)}
21
+ </SegmentedControlOption>`,
22
+ metadata: { nestable: true, props: { label, icon } },
23
+ };
@@ -51,6 +51,9 @@ const styles = StyleSheet.create(theme => ({
51
51
  alignItems: 'center',
52
52
  backgroundColor: 'transparent',
53
53
  zIndex: 1,
54
+ _web: {
55
+ '_focus-visible': theme.helpers.focusVisible,
56
+ },
54
57
  variants: {
55
58
  size: {
56
59
  sm: {
@@ -0,0 +1,24 @@
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
+ labelVariant: string | undefined;
11
+ variant: string | undefined;
12
+ disabled: boolean | undefined;
13
+ validationStatus: string | undefined;
14
+ invalidText: string | undefined;
15
+ validText: string | undefined;
16
+ helperText: string;
17
+ required: boolean;
18
+ valueType: string | undefined;
19
+ placeholder: string | undefined;
20
+ value: string | undefined;
21
+ };
22
+ };
23
+ };
24
+ export default _default;
@@ -0,0 +1,65 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3224%3A995
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Select/Select.tsx
3
+ // component=Select
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Label');
6
+ const labelVariant = figma.selectedInstance.getEnum('Label variant', {
7
+ Body: 'body',
8
+ Heading: 'heading',
9
+ });
10
+ const variant = figma.selectedInstance.getEnum('Variant', {
11
+ Disabled: 'disabled',
12
+ Invalid: 'invalid',
13
+ Valid: 'valid',
14
+ Default: 'default',
15
+ 'Read-only': 'readonly',
16
+ });
17
+ const disabled = variant === 'disabled' ? true : undefined;
18
+ const validationStatus = variant === 'invalid' ? 'invalid' : variant === 'valid' ? 'valid' : undefined;
19
+ const invalidText = variant === 'invalid' ? figma.selectedInstance.getString('Validation') : undefined;
20
+ const validText = variant === 'valid' ? figma.selectedInstance.getString('Validation') : undefined;
21
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
22
+ true: figma.selectedInstance.getString('Helper text'),
23
+ });
24
+ const required = !figma.selectedInstance.getBoolean('Optional?', {
25
+ true: false,
26
+ });
27
+ const valueType = figma.selectedInstance.getEnum('Value type', {
28
+ Placeholder: 'placeholder',
29
+ Selected: 'selected',
30
+ Empty: 'empty',
31
+ });
32
+ const placeholder = valueType === 'placeholder' ? figma.selectedInstance.getString('Value') : undefined;
33
+ const value = valueType === 'selected' ? figma.selectedInstance.getString('Value') : undefined;
34
+ export default {
35
+ id: 'Select',
36
+ imports: [
37
+ "import { Select } from '@utilitywarehouse/hearth-react-native';",
38
+ "import { useState } from 'react';",
39
+ ],
40
+ example: figma.code `function Example() {
41
+ const [value, setValue] = useState(null);
42
+ return (<Select${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('labelVariant', labelVariant)}${figma.helpers.react.renderProp('placeholder', placeholder)}${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('validText', validText)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('required', required)} options={[
43
+ { label: 'Option 1', value: '1' },
44
+ { label: 'Option 2', value: '2' },
45
+ { label: 'Option 3', value: '3' },
46
+ ]} value={value} onValueChange={value => setValue(value)}/>);
47
+ }`,
48
+ metadata: {
49
+ nestable: false,
50
+ props: {
51
+ label,
52
+ labelVariant,
53
+ variant,
54
+ disabled,
55
+ validationStatus,
56
+ invalidText,
57
+ validText,
58
+ helperText,
59
+ required,
60
+ valueType,
61
+ placeholder,
62
+ value,
63
+ },
64
+ },
65
+ };
@@ -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
+ label: string;
10
+ disabled: boolean | undefined;
11
+ selected: boolean;
12
+ };
13
+ };
14
+ };
15
+ export default _default;
@@ -0,0 +1,27 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=3394-3663&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Select/SelectOption.tsx
3
+ // component=SelectOption
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Text');
6
+ const disabled = figma.selectedInstance.getEnum('State', {
7
+ Disabled: true,
8
+ });
9
+ const rawSelected = figma.selectedInstance.getBoolean('Selected?#3481:0');
10
+ // getBoolean() can resolve to a non-boolean sentinel when the property can't be cleanly
11
+ // matched (this node has a duplicate "Selected?" property disambiguated by id) — always fall
12
+ // back to a real boolean rather than pass that sentinel through to renderProp, which renders
13
+ // it as broken, unparseable syntax.
14
+ const selected = typeof rawSelected === 'boolean' ? rawSelected : false;
15
+ export default {
16
+ id: 'SelectOption',
17
+ imports: ["import { SelectOption } from '@utilitywarehouse/hearth-react-native';"],
18
+ example: figma.code `<SelectOption${figma.helpers.react.renderProp('label', label)} value="some value"${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('selected', selected)}/>`,
19
+ metadata: {
20
+ nestable: true,
21
+ props: {
22
+ label,
23
+ disabled,
24
+ selected,
25
+ },
26
+ },
27
+ };
@@ -0,0 +1,13 @@
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
+ };
11
+ };
12
+ };
13
+ export default _default;
@@ -0,0 +1,16 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A195
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Spinner/Spinner.tsx
3
+ // component=Spinner
4
+ import figma from 'figma';
5
+ const size = figma.selectedInstance.getEnum('Size', {
6
+ 'XS-20': 'xs',
7
+ 'SM-24': 'sm',
8
+ 'MD-32': 'md',
9
+ 'LG-44': 'lg',
10
+ });
11
+ export default {
12
+ id: 'Spinner',
13
+ imports: ["import { Spinner } from '@utilitywarehouse/hearth-react-native';"],
14
+ example: figma.code `<Spinner${figma.helpers.react.renderProp('size', size)}/>`,
15
+ metadata: { nestable: true, props: { size } },
16
+ };
@@ -50,7 +50,7 @@ const SpinnerRoot = ({ size = 'md', color, ...props }) => {
50
50
  [color, colorMode, themeColor]);
51
51
  const defaultColor = colorValue || components.spinner.defaultFill;
52
52
  styles.useVariants({ size });
53
- return (_jsx(View, { ...props, style: [styles.container, props.style], "aria-busy": true, "aria-live": "polite", role: "status", children: _jsx(AnimatedSvg, { width: width, height: width, viewBox: `0 0 ${DIAMETER} ${DIAMETER}`, style: animatedSvgStyle, color: defaultColor, children: _jsx(G, { origin: `${HALF_CIRCLE}, ${HALF_CIRCLE}`, rotation: -90, children: _jsx(AnimatedCircle, { fill: "transparent", stroke: "currentColor", strokeWidth: STROKE_WIDTH, cx: "50%", cy: "50%", r: R, strokeLinecap: "round", animatedProps: animatedCircleProps, strokeDasharray: CIRCUMFERENCE }) }) }) }));
53
+ return (_jsx(View, { ...props, "aria-label": props['aria-label'] ?? props.accessibilityLabel ?? 'loading', accessibilityLabel: props.accessibilityLabel ?? props['aria-label'] ?? 'loading', style: [styles.container, props.style], "aria-busy": true, "aria-live": "polite", role: "status", tabIndex: props.tabIndex ?? 0, children: _jsx(AnimatedSvg, { width: width, height: width, viewBox: `0 0 ${DIAMETER} ${DIAMETER}`, style: animatedSvgStyle, color: defaultColor, children: _jsx(G, { origin: `${HALF_CIRCLE}, ${HALF_CIRCLE}`, rotation: -90, children: _jsx(AnimatedCircle, { fill: "transparent", stroke: "currentColor", strokeWidth: STROKE_WIDTH, cx: "50%", cy: "50%", r: R, strokeLinecap: "round", animatedProps: animatedCircleProps, strokeDasharray: CIRCUMFERENCE }) }) }) }));
54
54
  };
55
55
  SpinnerRoot.displayName = 'Spinner';
56
56
  const styles = StyleSheet.create(theme => ({
@@ -47,7 +47,7 @@ const SpinnerRoot = ({ size = 'md', color, ...props }) => {
47
47
  const colorValue = useMemo(() => getFlattenedColorValue(color, themeColor), [color, colorMode, themeColor]);
48
48
  const defaultColor = colorValue || components.spinner.defaultFill;
49
49
  styles.useVariants({ size });
50
- return (_jsx(View, { ...props, style: [styles.container, props.style], "aria-busy": true, "aria-live": "polite", role: "status", children: _jsx(AnimatedSvg, { width: width, height: width, viewBox: `0 0 ${DIAMETER} ${DIAMETER}`, animatedProps: animatedSvgProps, color: defaultColor, children: _jsx(G, { origin: `${HALF_CIRCLE}, ${HALF_CIRCLE}`, rotation: -90, children: _jsx(AnimatedCircle, { fill: "transparent", stroke: "currentColor", strokeWidth: STROKE_WIDTH, cx: "50%", cy: "50%", r: R, strokeLinecap: "round", animatedProps: animatedCircleProps, strokeDasharray: CIRCUMFERENCE }) }) }) }));
50
+ return (_jsx(View, { ...props, "aria-label": props['aria-label'] ?? props.accessibilityLabel ?? 'loading', accessibilityLabel: props.accessibilityLabel ?? props['aria-label'] ?? 'loading', style: [styles.container, props.style], "aria-busy": true, "aria-live": "polite", role: "status", tabIndex: props.tabIndex ?? 0, children: _jsx(AnimatedSvg, { width: width, height: width, viewBox: `0 0 ${DIAMETER} ${DIAMETER}`, animatedProps: animatedSvgProps, color: defaultColor, children: _jsx(G, { origin: `${HALF_CIRCLE}, ${HALF_CIRCLE}`, rotation: -90, children: _jsx(AnimatedCircle, { fill: "transparent", stroke: "currentColor", strokeWidth: STROKE_WIDTH, cx: "50%", cy: "50%", r: R, strokeLinecap: "round", animatedProps: animatedCircleProps, strokeDasharray: CIRCUMFERENCE }) }) }) }));
51
51
  };
52
52
  const styles = StyleSheet.create(theme => ({
53
53
  container: {
@@ -0,0 +1,25 @@
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
+ value: string;
10
+ label: string;
11
+ labelVariant: string | undefined;
12
+ helperText: figma.EnumOptionsValues<{
13
+ true: string;
14
+ false: undefined;
15
+ }>;
16
+ validationStatus: string | undefined;
17
+ invalidText: figma.EnumOptionsValues<{
18
+ Default: undefined;
19
+ Invalid: string;
20
+ }>;
21
+ focused: boolean | undefined;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -0,0 +1,32 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10612%3A1860&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/StepperInput/StepperInput.tsx
3
+ // component=StepperInput
4
+ import figma from 'figma';
5
+ const value = figma.selectedInstance.getString('Value');
6
+ const label = figma.selectedInstance.getString('Label');
7
+ const labelVariant = figma.selectedInstance.getEnum('Label variant', {
8
+ Body: 'body',
9
+ Heading: 'heading',
10
+ });
11
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
12
+ true: figma.selectedInstance.getString('Helper text'),
13
+ false: undefined,
14
+ });
15
+ const validationStatus = figma.selectedInstance.getEnum('State', {
16
+ Default: 'initial',
17
+ Invalid: 'invalid',
18
+ });
19
+ const invalidText = figma.selectedInstance.getEnum('State', {
20
+ Default: undefined,
21
+ Invalid: figma.selectedInstance.getString('Validation'),
22
+ });
23
+ const focused = figma.selectedInstance.getEnum('Focus?', { True: true });
24
+ export default {
25
+ id: 'StepperInput',
26
+ imports: ["import { StepperInput } from '@utilitywarehouse/hearth-react-native';"],
27
+ example: figma.code `<StepperInput${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('focused', focused)} onChangeText={() => {}}/>`,
28
+ metadata: {
29
+ nestable: true,
30
+ props: { value, label, labelVariant, helperText, validationStatus, invalidText, focused },
31
+ },
32
+ };
@@ -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
+ disabled: boolean | undefined;
10
+ checked: boolean;
11
+ size: string | undefined;
12
+ };
13
+ };
14
+ };
15
+ export default _default;
@@ -0,0 +1,18 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3044%3A243
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Switch/Switch.tsx
3
+ // component=Switch
4
+ import figma from 'figma';
5
+ const disabled = figma.selectedInstance.getEnum('State', {
6
+ Disabled: true,
7
+ });
8
+ const checked = figma.selectedInstance.getBoolean('Checked?');
9
+ const size = figma.selectedInstance.getEnum('Size', {
10
+ 'MD-32': 'md',
11
+ 'SM-24': 'sm',
12
+ });
13
+ export default {
14
+ id: 'switch',
15
+ imports: ["import { Switch } from '@utilitywarehouse/hearth-react-native';"],
16
+ example: figma.code `<Switch${figma.helpers.react.renderProp('value', checked)}${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('size', size)}/>`,
17
+ metadata: { nestable: true, props: { disabled, checked, size } },
18
+ };
@@ -68,7 +68,7 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
68
68
  const onPressOut = () => {
69
69
  scale.value = withSpring(1);
70
70
  };
71
- 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(Animated.View, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(Animated.View, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(Animated.View, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
71
+ 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(Animated.View, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(Animated.View, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(Animated.View, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
72
72
  const IconAny = Icon;
73
73
  return _jsx(IconAny, { as: TickSmallIcon, style: styles.icon });
74
74
  })() }), _jsx(Animated.View, { style: [styles.iconWrap, animatedCrossStyle], children: (() => {
@@ -77,6 +77,20 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
77
77
  })() })] }) }) }));
78
78
  };
79
79
  const styles = StyleSheet.create(theme => ({
80
+ pressable: {
81
+ variants: {
82
+ disabled: {
83
+ false: {
84
+ _web: {
85
+ '_focus-visible': { outline: 'none' },
86
+ '_focus-visible > div:nth-child(1)': {
87
+ ...theme.helpers.focusVisible,
88
+ },
89
+ },
90
+ },
91
+ },
92
+ },
93
+ },
80
94
  switch: {
81
95
  justifyContent: 'center',
82
96
  variants: {
@@ -97,9 +111,19 @@ const styles = StyleSheet.create(theme => ({
97
111
  value: {
98
112
  true: {
99
113
  backgroundColor: theme.color.interactive.brand.surface.strong.default,
114
+ _web: {
115
+ _hover: {
116
+ backgroundColor: theme.color.interactive.brand.surface.strong.hover,
117
+ },
118
+ },
100
119
  },
101
120
  false: {
102
121
  backgroundColor: theme.color.interactive.functional.surface.strong.default,
122
+ _web: {
123
+ _hover: {
124
+ backgroundColor: theme.color.interactive.functional.surface.strong.hover,
125
+ },
126
+ },
103
127
  },
104
128
  },
105
129
  disabled: {