@utilitywarehouse/hearth-react-native 0.35.6 → 0.35.8

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 (187) 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/Alert/Alert.figma.d.ts +33 -0
  7. package/build/components/Alert/Alert.figma.js +40 -0
  8. package/build/components/Avatar/Avatar.figma.d.ts +16 -0
  9. package/build/components/Avatar/Avatar.figma.js +29 -0
  10. package/build/components/Badge/Badge.figma.d.ts +21 -0
  11. package/build/components/Badge/Badge.figma.js +47 -0
  12. package/build/components/Banner/Banner.figma.d.ts +26 -0
  13. package/build/components/Banner/Banner.figma.js +47 -0
  14. package/build/components/Banner/BannerIllustration.figma.d.ts +11 -0
  15. package/build/components/Banner/BannerIllustration.figma.js +13 -0
  16. package/build/components/BottomSheet/BottomSheetModal.figma.d.ts +11 -0
  17. package/build/components/BottomSheet/BottomSheetModal.figma.js +11 -0
  18. package/build/components/Button/Button.figma.d.ts +38 -0
  19. package/build/components/Button/Button.figma.js +84 -0
  20. package/build/components/Card/Card.figma.d.ts +16 -0
  21. package/build/components/Card/Card.figma.js +49 -0
  22. package/build/components/Card/CardAction/CardAction.figma.d.ts +35 -0
  23. package/build/components/Card/CardAction/CardAction.figma.js +104 -0
  24. package/build/components/Carousel/Carousel.figma.d.ts +17 -0
  25. package/build/components/Carousel/Carousel.figma.js +18 -0
  26. package/build/components/Checkbox/Checkbox.figma.d.ts +22 -0
  27. package/build/components/Checkbox/Checkbox.figma.js +29 -0
  28. package/build/components/Checkbox/CheckboxGroup.figma.d.ts +26 -0
  29. package/build/components/Checkbox/CheckboxGroup.figma.js +46 -0
  30. package/build/components/Checkbox/CheckboxImage.figma.d.ts +11 -0
  31. package/build/components/Checkbox/CheckboxImage.figma.js +10 -0
  32. package/build/components/Checkbox/CheckboxTileRoot.figma.d.ts +20 -0
  33. package/build/components/Checkbox/CheckboxTileRoot.figma.js +22 -0
  34. package/build/components/Combobox/Combobox.figma.d.ts +23 -0
  35. package/build/components/Combobox/Combobox.figma.js +69 -0
  36. package/build/components/CurrencyInput/CurrencyInput.figma.d.ts +31 -0
  37. package/build/components/CurrencyInput/CurrencyInput.figma.js +51 -0
  38. package/build/components/DateInput/DateInput.figma.d.ts +41 -0
  39. package/build/components/DateInput/DateInput.figma.js +87 -0
  40. package/build/components/DatePicker/DatePicker.figma.d.ts +25 -0
  41. package/build/components/DatePicker/DatePicker.figma.js +23 -0
  42. package/build/components/DatePickerInput/DatePickerInput.figma.d.ts +25 -0
  43. package/build/components/DatePickerInput/DatePickerInput.figma.js +52 -0
  44. package/build/components/DescriptionList/DescriptionList.figma.d.ts +26 -0
  45. package/build/components/DescriptionList/DescriptionList.figma.js +59 -0
  46. package/build/components/DescriptionList/DescriptionListItem.figma.d.ts +22 -0
  47. package/build/components/DescriptionList/DescriptionListItem.figma.js +42 -0
  48. package/build/components/Divider/Divider.figma.d.ts +13 -0
  49. package/build/components/Divider/Divider.figma.js +14 -0
  50. package/build/components/ExpandableCard/ExpandableCard.figma.d.ts +28 -0
  51. package/build/components/ExpandableCard/ExpandableCard.figma.js +52 -0
  52. package/build/components/ExpandableCard/ExpandableCardGroup.figma.d.ts +23 -0
  53. package/build/components/ExpandableCard/ExpandableCardGroup.figma.js +55 -0
  54. package/build/components/Flex/Flex.props.d.ts +2 -2
  55. package/build/components/FormField/FormField.figma.d.ts +15 -0
  56. package/build/components/FormField/FormField.figma.js +27 -0
  57. package/build/components/Helper/HelperText.figma.d.ts +13 -0
  58. package/build/components/Helper/HelperText.figma.js +12 -0
  59. package/build/components/HighlightBanner/HighlightBanner.figma.d.ts +19 -0
  60. package/build/components/HighlightBanner/HighlightBanner.figma.js +45 -0
  61. package/build/components/IconButton/IconButton.figma.d.ts +22 -0
  62. package/build/components/IconButton/IconButton.figma.js +47 -0
  63. package/build/components/IconContainer/IconContainer.figma.d.ts +20 -0
  64. package/build/components/IconContainer/IconContainer.figma.js +43 -0
  65. package/build/components/IndicatorIconButton/IndicatorIconButton.figma.d.ts +17 -0
  66. package/build/components/IndicatorIconButton/IndicatorIconButton.figma.js +23 -0
  67. package/build/components/InlineLink/InlineLink.d.ts +1 -1
  68. package/build/components/InlineLink/InlineLink.js +7 -2
  69. package/build/components/InlineLink/InlineLink.props.d.ts +2 -0
  70. package/build/components/InlineLink/InlineLinkRoot.d.ts +1 -1
  71. package/build/components/InlineLink/InlineLinkRoot.js +8 -3
  72. package/build/components/Input/Input.figma.d.ts +28 -0
  73. package/build/components/Input/Input.figma.js +67 -0
  74. package/build/components/Input/Input_1.figma.d.ts +22 -0
  75. package/build/components/Input/Input_1.figma.js +54 -0
  76. package/build/components/Input/Input_2.figma.d.ts +17 -0
  77. package/build/components/Input/Input_2.figma.js +34 -0
  78. package/build/components/Label/Label.figma.d.ts +14 -0
  79. package/build/components/Label/Label.figma.js +19 -0
  80. package/build/components/Link/Link.d.ts +1 -1
  81. package/build/components/Link/Link.figma.d.ts +27 -0
  82. package/build/components/Link/Link.figma.js +45 -0
  83. package/build/components/Link/Link.js +7 -2
  84. package/build/components/Link/Link.props.d.ts +2 -0
  85. package/build/components/Link/LinkRoot.d.ts +1 -1
  86. package/build/components/Link/LinkRoot.js +8 -3
  87. package/build/components/List/List.figma.d.ts +21 -0
  88. package/build/components/List/List.figma.js +49 -0
  89. package/build/components/List/ListAction/ListAction.figma.d.ts +15 -0
  90. package/build/components/List/ListAction/ListAction.figma.js +17 -0
  91. package/build/components/List/ListItem/ListItem.figma.d.ts +33 -0
  92. package/build/components/List/ListItem/ListItem.figma.js +83 -0
  93. package/build/components/List/ListItem/ListItemLeadingContent.figma.d.ts +14 -0
  94. package/build/components/List/ListItem/ListItemLeadingContent.figma.js +17 -0
  95. package/build/components/List/ListItem/ListItemTrailingContent.figma.d.ts +13 -0
  96. package/build/components/List/ListItem/ListItemTrailingContent.figma.js +14 -0
  97. package/build/components/Menu/Menu.figma.d.ts +14 -0
  98. package/build/components/Menu/Menu.figma.js +33 -0
  99. package/build/components/Menu/MenuItem.figma.d.ts +29 -0
  100. package/build/components/Menu/MenuItem.figma.js +45 -0
  101. package/build/components/Modal/Modal.figma.d.ts +24 -0
  102. package/build/components/Modal/Modal.figma.js +64 -0
  103. package/build/components/NavModal/NavModal.figma.d.ts +19 -0
  104. package/build/components/NavModal/NavModal.figma.js +42 -0
  105. package/build/components/Pagination/Pagination.figma.d.ts +16 -0
  106. package/build/components/Pagination/Pagination.figma.js +20 -0
  107. package/build/components/PillGroup/Pill.figma.d.ts +17 -0
  108. package/build/components/PillGroup/Pill.figma.js +21 -0
  109. package/build/components/PillGroup/PillGroup.figma.d.ts +13 -0
  110. package/build/components/PillGroup/PillGroup.figma.js +18 -0
  111. package/build/components/ProgressBar/ProgressBar.circular.figma.d.ts +16 -0
  112. package/build/components/ProgressBar/ProgressBar.circular.figma.js +35 -0
  113. package/build/components/ProgressBar/ProgressBar.figma.d.ts +15 -0
  114. package/build/components/ProgressBar/ProgressBar.figma.js +31 -0
  115. package/build/components/ProgressStepper/ProgressStep.figma.d.ts +15 -0
  116. package/build/components/ProgressStepper/ProgressStep.figma.js +17 -0
  117. package/build/components/ProgressStepper/ProgressStepper.figma.d.ts +13 -0
  118. package/build/components/ProgressStepper/ProgressStepper.figma.js +14 -0
  119. package/build/components/Radio/Radio.figma.d.ts +15 -0
  120. package/build/components/Radio/Radio.figma.js +17 -0
  121. package/build/components/Radio/RadioGroup.figma.d.ts +19 -0
  122. package/build/components/Radio/RadioGroup.figma.js +45 -0
  123. package/build/components/Radio/RadioImage.figma.d.ts +11 -0
  124. package/build/components/Radio/RadioImage.figma.js +10 -0
  125. package/build/components/Radio/RadioTile.figma.d.ts +16 -0
  126. package/build/components/Radio/RadioTile.figma.js +23 -0
  127. package/build/components/RadioCard/RadioCard.figma.d.ts +16 -0
  128. package/build/components/RadioCard/RadioCard.figma.js +22 -0
  129. package/build/components/Rating/Rating.figma.d.ts +12 -0
  130. package/build/components/Rating/Rating.figma.js +18 -0
  131. package/build/components/Roundel/Roundel.figma.d.ts +13 -0
  132. package/build/components/Roundel/Roundel.figma.js +15 -0
  133. package/build/components/SectionHeader/SectionHeader.figma.d.ts +21 -0
  134. package/build/components/SectionHeader/SectionHeader.figma.js +50 -0
  135. package/build/components/SegmentedControl/SegmentedControl.figma.d.ts +16 -0
  136. package/build/components/SegmentedControl/SegmentedControl.figma.js +20 -0
  137. package/build/components/SegmentedControl/SegmentedControlOption.figma.d.ts +17 -0
  138. package/build/components/SegmentedControl/SegmentedControlOption.figma.js +23 -0
  139. package/build/components/Select/Select.figma.d.ts +24 -0
  140. package/build/components/Select/Select.figma.js +65 -0
  141. package/build/components/Select/SelectOption.figma.d.ts +15 -0
  142. package/build/components/Select/SelectOption.figma.js +27 -0
  143. package/build/components/Spinner/Spinner.figma.d.ts +13 -0
  144. package/build/components/Spinner/Spinner.figma.js +16 -0
  145. package/build/components/Spinner/Spinner.js +1 -1
  146. package/build/components/Spinner/Spinner.web.js +1 -1
  147. package/build/components/StepperInput/StepperInput.figma.d.ts +25 -0
  148. package/build/components/StepperInput/StepperInput.figma.js +32 -0
  149. package/build/components/Switch/Switch.figma.d.ts +15 -0
  150. package/build/components/Switch/Switch.figma.js +18 -0
  151. package/build/components/Table/Table.figma.d.ts +14 -0
  152. package/build/components/Table/Table.figma.js +38 -0
  153. package/build/components/Table/TableHeaderCell.figma.d.ts +15 -0
  154. package/build/components/Table/TableHeaderCell.figma.js +31 -0
  155. package/build/components/Tabs/Tab.figma.d.ts +14 -0
  156. package/build/components/Tabs/Tab.figma.js +14 -0
  157. package/build/components/Tabs/Tab.js +1 -1
  158. package/build/components/Tabs/Tabs.figma.d.ts +14 -0
  159. package/build/components/Tabs/Tabs.figma.js +21 -0
  160. package/build/components/Textarea/Textarea.figma.d.ts +27 -0
  161. package/build/components/Textarea/Textarea.figma.js +53 -0
  162. package/build/components/TimePicker/TimePicker.figma.d.ts +16 -0
  163. package/build/components/TimePicker/TimePicker.figma.js +30 -0
  164. package/build/components/TimePickerInput/TimePickerInput.figma.d.ts +29 -0
  165. package/build/components/TimePickerInput/TimePickerInput.figma.js +53 -0
  166. package/build/components/Timeline/Timeline.figma.d.ts +14 -0
  167. package/build/components/Timeline/Timeline.figma.js +23 -0
  168. package/build/components/Timeline/TimelineItemProgress.figma.d.ts +16 -0
  169. package/build/components/Timeline/TimelineItemProgress.figma.js +30 -0
  170. package/build/components/Timeline/TimelineItemStatic.figma.d.ts +16 -0
  171. package/build/components/Timeline/TimelineItemStatic.figma.js +30 -0
  172. package/build/components/Toast/ToastItem.figma.d.ts +20 -0
  173. package/build/components/Toast/ToastItem.figma.js +42 -0
  174. package/build/components/ToggleButtonCard/ToggleButtonCard.figma.d.ts +14 -0
  175. package/build/components/ToggleButtonCard/ToggleButtonCard.figma.js +28 -0
  176. package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +16 -3
  177. package/build/components/UnstyledIconButton/UnstyledIconButton.figma.d.ts +21 -0
  178. package/build/components/UnstyledIconButton/UnstyledIconButton.figma.js +32 -0
  179. package/build/components/VerificationInput/VerificationInput.figma.d.ts +19 -0
  180. package/build/components/VerificationInput/VerificationInput.figma.js +22 -0
  181. package/build/components/index.d.ts +1 -0
  182. package/build/components/index.js +1 -0
  183. package/build/types/utilityProps.d.ts +1 -1
  184. package/package.json +5 -4
  185. package/public/llms/components/list.md +6 -11
  186. package/public/llms/docs/ai-tooling.md +27 -5
  187. package/public/llms/docs/introduction.md +1 -1
@@ -0,0 +1,84 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Button/Button.tsx
3
+ // component=Button
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const disabled = instance.getEnum('State', {
7
+ Disabled: true,
8
+ });
9
+ const size = instance.getEnum('Size', {
10
+ 'SM-32': 'sm',
11
+ 'MD-48': 'md',
12
+ });
13
+ const paddingNone = instance.getEnum('Padding None?', {
14
+ True: true,
15
+ False: false,
16
+ });
17
+ const colorScheme = instance.getEnum('Color Scheme', {
18
+ Affirmative: 'affirmative',
19
+ Destructive: 'destructive',
20
+ Functional: 'functional',
21
+ Highlight: 'highlight',
22
+ });
23
+ const loading = instance.getEnum('State', {
24
+ Loading: true,
25
+ });
26
+ const text = instance.getString('Text');
27
+ const ghostText = instance.getString('Ghost Text');
28
+ const iconPosition = instance.getBoolean('Show icon left?', {
29
+ true: undefined,
30
+ false: instance.getBoolean('Show icon right?', {
31
+ true: 'right',
32
+ false: undefined,
33
+ }),
34
+ });
35
+ const iconName = instance.getBoolean('Show icon left?', {
36
+ true: instance.getInstanceSwap('Icon left-20')?.executeTemplate().metadata?.props
37
+ ?.componentName,
38
+ false: instance.getBoolean('Show icon right?', {
39
+ true: instance.getInstanceSwap('Icon right-20')?.executeTemplate().metadata?.props
40
+ ?.componentName,
41
+ false: undefined,
42
+ }),
43
+ });
44
+ const icon = iconName ? figma.helpers.react.reactComponent(iconName) : undefined;
45
+ const variant = instance.getEnum('Variant', {
46
+ Emphasis: 'emphasis',
47
+ Solid: 'solid',
48
+ Outline: 'outline',
49
+ Ghost: 'ghost',
50
+ });
51
+ const inverted = instance.getEnum('Inverted?', {
52
+ True: true,
53
+ False: false,
54
+ });
55
+ // Use ghostText for Ghost variant, text for all others
56
+ const childrenContent = variant === 'ghost' ? ghostText : text;
57
+ export default {
58
+ id: 'Button',
59
+ imports: [
60
+ "import { Button } from '@utilitywarehouse/hearth-react-native';",
61
+ ...(iconName
62
+ ? [`import { ${iconName} } from '@utilitywarehouse/hearth-react-native-icons';`]
63
+ : []),
64
+ ],
65
+ example: figma.code `<Button${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('size', size)}${figma.helpers.react.renderProp('variant', variant)}${figma.helpers.react.renderProp('inverted', inverted)}${figma.helpers.react.renderProp('paddingNone', paddingNone)}${figma.helpers.react.renderProp('colorScheme', colorScheme)}${figma.helpers.react.renderProp('loading', loading)}${figma.helpers.react.renderProp('icon', icon)}${figma.helpers.react.renderProp('iconPosition', iconPosition)}>
66
+ ${figma.helpers.react.renderChildren(childrenContent)}
67
+ </Button>`,
68
+ metadata: {
69
+ nestable: true,
70
+ props: {
71
+ disabled,
72
+ size,
73
+ paddingNone,
74
+ colorScheme,
75
+ loading,
76
+ text,
77
+ ghostText,
78
+ iconPosition,
79
+ icon,
80
+ variant,
81
+ inverted,
82
+ },
83
+ },
84
+ };
@@ -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
+ variant: string | undefined;
10
+ colorScheme: string | undefined;
11
+ noPadding: boolean;
12
+ content: figma.ResultSection[][];
13
+ };
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,49 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2160%3A11
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Card/CardRoot.tsx
3
+ // component=Card
4
+ import figma from 'figma';
5
+ const variant = figma.selectedInstance.getEnum('Variant', {
6
+ Emphasis: 'emphasis',
7
+ Subtle: 'subtle',
8
+ });
9
+ const colorScheme = figma.selectedInstance.getEnum('Color Scheme', {
10
+ 'Neutral Strong': 'neutralStrong',
11
+ 'Neutral Subtle': 'neutralSubtle',
12
+ Brand: 'brand',
13
+ Energy: 'energy',
14
+ Broadband: 'broadband',
15
+ Mobile: 'mobile',
16
+ Insurance: 'insurance',
17
+ Cashback: 'cashback',
18
+ Pig: 'pig',
19
+ Highlight: 'highlight',
20
+ });
21
+ const noPadding = figma.selectedInstance.getBoolean('Padding None?');
22
+ const contentResults = (figma.selectedInstance.getSlot('Content')?.connectedInstances ?? []).map(i => i.executeTemplate());
23
+ const content = contentResults.map(r => r.example);
24
+ // Banner and HighlightBanner already wrap themselves in a Card, so when Card's Content slot is
25
+ // swapped directly to one of them, render just that component rather than nesting it in another.
26
+ // Detected from the rendered code itself (custom metadata.props fields that aren't referenced in
27
+ // a template's own `example` don't survive publish/resolve, so componentName-style flags can't be
28
+ // used here) — strip any leading comment lines, then check the JSX tag.
29
+ const rootCode = (contentResults.length === 1 ? contentResults[0].example : [])
30
+ .filter(section => section.type === 'CODE')
31
+ .map(section => section.code)
32
+ .join('')
33
+ .replace(/^\s*\/\/.*$/gm, '')
34
+ .trim();
35
+ const standaloneContent = /^<(Banner|HighlightBanner)[\s/>]/.test(rootCode)
36
+ ? contentResults[0].example
37
+ : undefined;
38
+ export default {
39
+ id: 'Card',
40
+ imports: standaloneContent
41
+ ? []
42
+ : ["import { Card } from '@utilitywarehouse/hearth-react-native';"],
43
+ example: standaloneContent
44
+ ? figma.code `${standaloneContent}`
45
+ : figma.code `<Card${figma.helpers.react.renderProp('variant', variant)}${figma.helpers.react.renderProp('colorScheme', colorScheme)}${figma.helpers.react.renderProp('noPadding', noPadding)}>
46
+ ${content.flat()}
47
+ </Card>`,
48
+ metadata: { nestable: true, props: { variant, colorScheme, noPadding, content } },
49
+ };
@@ -0,0 +1,35 @@
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
+ size: string | undefined;
11
+ loading: boolean;
12
+ disabled: boolean;
13
+ heading: string;
14
+ helperTextEnabled: boolean;
15
+ helperText: string | undefined;
16
+ leadingIconEnabled: boolean;
17
+ leadingIcon: {
18
+ $value: string;
19
+ $type: "react-component";
20
+ } | undefined;
21
+ iconContainerVariant: string | undefined;
22
+ iconContainerColor: string | undefined;
23
+ trailingIcon: {
24
+ $value: string;
25
+ $type: "react-component";
26
+ } | undefined;
27
+ iconContainerEnabled: boolean;
28
+ badgeBottomEnabled: boolean;
29
+ badgeRightEnabled: boolean;
30
+ badgeMiddleEnabled: boolean;
31
+ badgePosition: string | undefined;
32
+ };
33
+ };
34
+ };
35
+ export default _default;
@@ -0,0 +1,104 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=8154%3A4346
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Card/CardAction/CardActionRoot.tsx
3
+ // component=CardAction
4
+ import figma from 'figma';
5
+ const state = figma.selectedInstance.getEnum('State', {
6
+ Default: 'default',
7
+ Hover: 'hover',
8
+ Active: 'active',
9
+ Disabled: 'disabled',
10
+ Loading: 'loading',
11
+ });
12
+ const size = figma.selectedInstance.getEnum('Size', {
13
+ Default: 'md',
14
+ Large: 'lg',
15
+ });
16
+ const loading = state === 'loading';
17
+ const disabled = state === 'disabled';
18
+ const heading = figma.selectedInstance.getString('List heading');
19
+ const helperTextEnabled = figma.selectedInstance.getBoolean('Helper text?');
20
+ const helperText = helperTextEnabled ? figma.selectedInstance.getString('Helper text') : undefined;
21
+ const iconContainerEnabled = figma.selectedInstance.getBoolean('Icon container?');
22
+ const iconContainerInstance = figma.selectedInstance.findInstance('Icon Container');
23
+ // When "Icon container?" is on, the leading icon and its container styling come from this
24
+ // nested Icon Container instance rather than the bare "Leading icon-24" swap below.
25
+ const iconContainer = iconContainerEnabled && iconContainerInstance.type !== 'ERROR'
26
+ ? iconContainerInstance
27
+ : undefined;
28
+ const iconContainerSize = iconContainer?.getEnum('Size', {
29
+ 'SM-32': 'sm',
30
+ 'MD-48': 'md',
31
+ 'LG-64': 'lg',
32
+ });
33
+ const iconContainerIconName = iconContainer
34
+ ?.getInstanceSwap(iconContainerSize === 'sm' ? 'Icon-20' : 'Icon-24')
35
+ ?.executeTemplate().metadata?.props?.componentName;
36
+ const iconContainerVariant = iconContainer?.getEnum('Variant', {
37
+ Subtle: 'subtle',
38
+ Emphasis: 'emphasis',
39
+ });
40
+ const iconContainerColor = iconContainer?.getEnum('Color', {
41
+ Pig: 'pig',
42
+ Energy: 'energy',
43
+ Broadband: 'broadband',
44
+ Mobile: 'mobile',
45
+ Insurance: 'insurance',
46
+ Cashback: 'cashback',
47
+ Highlight: 'highlight',
48
+ });
49
+ const leadingIconEnabled = figma.selectedInstance.getBoolean('Leading Icon?');
50
+ const leadingIconName = iconContainer
51
+ ? iconContainerIconName
52
+ : leadingIconEnabled
53
+ ? figma.selectedInstance.getInstanceSwap('Leading icon-24')?.executeTemplate().metadata?.props
54
+ ?.componentName
55
+ : undefined;
56
+ const leadingIcon = leadingIconName
57
+ ? figma.helpers.react.reactComponent(leadingIconName)
58
+ : undefined;
59
+ const trailingIconName = figma.selectedInstance
60
+ .getInstanceSwap('Trailing icon-20')
61
+ ?.executeTemplate().metadata?.props?.componentName;
62
+ const trailingIcon = trailingIconName
63
+ ? figma.helpers.react.reactComponent(trailingIconName)
64
+ : undefined;
65
+ const badgeBottomEnabled = figma.selectedInstance.getBoolean('Badge bottom?');
66
+ const badgeRightEnabled = figma.selectedInstance.getBoolean('Badge right?');
67
+ const badgeMiddleEnabled = figma.selectedInstance.getBoolean('Badge middle?');
68
+ const badgePosition = badgeRightEnabled
69
+ ? 'right'
70
+ : badgeMiddleEnabled
71
+ ? 'middle'
72
+ : badgeBottomEnabled
73
+ ? 'bottom'
74
+ : undefined;
75
+ export default {
76
+ id: 'CardAction',
77
+ imports: [
78
+ "import { CardAction } from '@utilitywarehouse/hearth-react-native';",
79
+ ...[...new Set([leadingIconName, trailingIconName].filter(Boolean))].map(name => `import { ${name} } from '@utilitywarehouse/hearth-react-native-icons';`),
80
+ ],
81
+ example: figma.code `<CardAction${figma.helpers.react.renderProp('loading', loading)}${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('size', size)}${figma.helpers.react.renderProp('heading', heading)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('badgePosition', badgePosition)}${figma.helpers.react.renderProp('iconContainer', iconContainerEnabled)}${figma.helpers.react.renderProp('leadingIcon', leadingIcon)}${figma.helpers.react.renderProp('iconContainerVariant', iconContainerVariant)}${figma.helpers.react.renderProp('iconContainerColor', iconContainerColor)}${figma.helpers.react.renderProp('trailingIcon', trailingIcon)} />`,
82
+ metadata: {
83
+ nestable: true,
84
+ props: {
85
+ state,
86
+ size,
87
+ loading,
88
+ disabled,
89
+ heading,
90
+ helperTextEnabled,
91
+ helperText,
92
+ leadingIconEnabled,
93
+ leadingIcon,
94
+ iconContainerVariant,
95
+ iconContainerColor,
96
+ trailingIcon,
97
+ iconContainerEnabled,
98
+ badgeBottomEnabled,
99
+ badgeRightEnabled,
100
+ badgeMiddleEnabled,
101
+ badgePosition,
102
+ },
103
+ },
104
+ };
@@ -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
+ inverted: figma.EnumOptionsValues<{
10
+ False: boolean;
11
+ True: boolean;
12
+ }> | undefined;
13
+ showNavigation: boolean;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
@@ -0,0 +1,18 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=5191-3220&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Carousel/Carousel.tsx
3
+ // component=Carousel
4
+ import figma from 'figma';
5
+ const inverted = figma.selectedInstance.getEnum('Inverted?', { False: false, True: true });
6
+ const showNavigation = figma.selectedInstance.getBoolean('Arrows?');
7
+ export default {
8
+ id: 'Carousel',
9
+ imports: ["import { Carousel, CarouselItem } from '@utilitywarehouse/hearth-react-native';"],
10
+ example: figma.code `// Example usage of the Carousel component
11
+ // See https://hearth.prod.uw.systems/react-native/?path=/docs/components-carousel--docs
12
+ <Carousel width={300}${figma.helpers.react.renderProp('inverted', inverted)}${figma.helpers.react.renderProp('showNavigation', showNavigation)}>
13
+ <CarouselItem>Item 1</CarouselItem>
14
+ <CarouselItem>Item 2</CarouselItem>
15
+ <CarouselItem>Item 3</CarouselItem>
16
+ </Carousel>`,
17
+ metadata: { nestable: true, props: { inverted, showNavigation } },
18
+ };
@@ -0,0 +1,22 @@
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: string | undefined;
11
+ checked: boolean;
12
+ label: string;
13
+ helperText: figma.EnumOptionsValues<{
14
+ true: string;
15
+ false: undefined;
16
+ }>;
17
+ invalidText: string;
18
+ image: figma.ResultSection[] | undefined;
19
+ };
20
+ };
21
+ };
22
+ export default _default;
@@ -0,0 +1,29 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3087-7316
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Checkbox/Checkbox.tsx
3
+ // component=Checkbox
4
+ import figma from 'figma';
5
+ const disabled = figma.selectedInstance.getEnum('State', {
6
+ Disabled: true,
7
+ });
8
+ const validationStatus = figma.selectedInstance.getEnum('State', {
9
+ Invalid: 'invalid',
10
+ });
11
+ const checked = figma.selectedInstance.getBoolean('Checked?');
12
+ const label = figma.selectedInstance.getString('Label');
13
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
14
+ true: figma.selectedInstance.getString('Helper text'),
15
+ false: undefined,
16
+ });
17
+ const invalidText = figma.selectedInstance.getString('Validation text');
18
+ const showImage = figma.selectedInstance.getBoolean('Image?');
19
+ const imageInstance = figma.selectedInstance.findInstance('Checkbox Image');
20
+ const image = showImage ? imageInstance?.executeTemplate().example : undefined;
21
+ export default {
22
+ id: 'Checkbox',
23
+ imports: ["import { Checkbox } from '@utilitywarehouse/hearth-react-native';"],
24
+ example: figma.code `<Checkbox${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('checked', checked)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('image', image)}/>`,
25
+ metadata: {
26
+ nestable: true,
27
+ props: { disabled, validationStatus, checked, label, helperText, invalidText, image },
28
+ },
29
+ };
@@ -0,0 +1,26 @@
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
+ helperText: figma.EnumOptionsValues<{
12
+ true: string;
13
+ false: undefined;
14
+ }>;
15
+ direction: figma.EnumOptionsValues<{
16
+ Column: undefined;
17
+ Row: string;
18
+ }>;
19
+ validationStatus: string | undefined;
20
+ invalidText: string;
21
+ tiles: figma.ResultSection[];
22
+ checkboxes: figma.ResultSection[];
23
+ };
24
+ };
25
+ };
26
+ export default _default;
@@ -0,0 +1,46 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=3141-4275&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Checkbox/CheckboxGroup.tsx
3
+ // component=CheckboxGroup
4
+ import figma from 'figma';
5
+ const label = figma.selectedInstance.getString('Group label');
6
+ const labelVariant = figma.selectedInstance.getEnum('Label variant', {
7
+ Heading: 'heading',
8
+ Body: 'body',
9
+ });
10
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
11
+ true: figma.selectedInstance.getString('Helper text'),
12
+ false: undefined,
13
+ });
14
+ const direction = figma.selectedInstance.getEnum('Direction', {
15
+ Column: undefined,
16
+ Row: 'row',
17
+ });
18
+ const validationStatus = figma.selectedInstance.getEnum('State', {
19
+ Invalid: 'invalid',
20
+ });
21
+ const invalidText = figma.selectedInstance.getString('Validation text');
22
+ const content = figma.selectedInstance.getPropertyValue('Content');
23
+ const tiles = figma.properties.children(['Checkbox Tile']);
24
+ const checkboxes = figma.properties.children(['Checkbox']);
25
+ const isTile = content === 'Checkbox Tile';
26
+ const children = isTile ? tiles : checkboxes;
27
+ export default {
28
+ id: 'CheckboxGroup',
29
+ imports: ["import { CheckboxGroup } from '@utilitywarehouse/hearth-react-native';"],
30
+ example: figma.code `<CheckboxGroup${isTile ? ` type="tile"` : ''}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('labelVariant', labelVariant)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('direction', direction)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('invalidText', invalidText)}>
31
+ ${figma.helpers.react.renderChildren(children)}
32
+ </CheckboxGroup>`,
33
+ metadata: {
34
+ nestable: true,
35
+ props: {
36
+ label,
37
+ labelVariant,
38
+ helperText,
39
+ direction,
40
+ validationStatus,
41
+ invalidText,
42
+ tiles,
43
+ checkboxes,
44
+ },
45
+ },
46
+ };
@@ -0,0 +1,11 @@
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
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,10 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7428%3A3207
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Checkbox/CheckboxImage.tsx
3
+ // component=CheckboxImage
4
+ import figma from 'figma';
5
+ export default {
6
+ id: 'CheckboxImage',
7
+ imports: ["import { CheckboxImage } from '@utilitywarehouse/hearth-react-native';"],
8
+ example: figma.code `<CheckboxImage source={require('./image.png')} style={{ width: 40, height: 24, resizeMode: 'contain' }} />`,
9
+ metadata: { nestable: true, props: {} },
10
+ };
@@ -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
+ validationStatus: string | undefined;
10
+ checked: boolean;
11
+ label: string;
12
+ helperText: figma.EnumOptionsValues<{
13
+ true: string;
14
+ false: undefined;
15
+ }>;
16
+ image: figma.ResultSection[] | undefined;
17
+ };
18
+ };
19
+ };
20
+ export default _default;
@@ -0,0 +1,22 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=4961-23797&m=dev
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Checkbox/Checkbox.tsx
3
+ // component=Checkbox
4
+ import figma from 'figma';
5
+ const validationStatus = figma.selectedInstance.getEnum('State', {
6
+ Invalid: 'invalid',
7
+ });
8
+ const checked = figma.selectedInstance.getBoolean('Checked?');
9
+ const label = figma.selectedInstance.getString('Label');
10
+ const helperText = figma.selectedInstance.getBoolean('Helper text?', {
11
+ true: figma.selectedInstance.getString('Helper text'),
12
+ false: undefined,
13
+ });
14
+ const showImage = figma.selectedInstance.getBoolean('Image?');
15
+ const imageInstance = figma.selectedInstance.findInstance('Checkbox Image');
16
+ const image = showImage ? imageInstance?.executeTemplate().example : undefined;
17
+ export default {
18
+ id: 'CheckboxTile',
19
+ imports: ["import { Checkbox } from '@utilitywarehouse/hearth-react-native';"],
20
+ example: figma.code `<Checkbox type="tile"${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('checked', checked)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('image', image)}/>`,
21
+ metadata: { nestable: true, props: { validationStatus, checked, label, helperText, image } },
22
+ };
@@ -0,0 +1,23 @@
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
+ placeholder: string | undefined;
11
+ validationStatus: string | undefined;
12
+ invalidText: string | undefined;
13
+ helperText: string;
14
+ required: figma.EnumOptionsValues<{
15
+ true: boolean;
16
+ false: boolean;
17
+ }>;
18
+ loading: boolean | undefined;
19
+ value: string | undefined;
20
+ };
21
+ };
22
+ };
23
+ export default _default;
@@ -0,0 +1,69 @@
1
+ // url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=9359%3A2923
2
+ // source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Combobox/Combobox.tsx
3
+ // component=Combobox
4
+ import figma from 'figma';
5
+ const instance = figma.selectedInstance;
6
+ const label = instance.getString('Label');
7
+ const placeholder = instance.getEnum('Value type', {
8
+ Empty: '',
9
+ Placeholder: instance.getString('Value'),
10
+ Filled: instance.getString('Value'),
11
+ });
12
+ const validationStatus = instance.getEnum('Variant', {
13
+ Default: 'initial',
14
+ Invalid: 'invalid',
15
+ Loading: 'initial',
16
+ });
17
+ const invalidText = instance.getEnum('Variant', {
18
+ Invalid: instance.getString('Validation'),
19
+ });
20
+ const helperText = instance.getBoolean('Helper text?', {
21
+ true: instance.getString('Helper text'),
22
+ });
23
+ const required = instance.getBoolean('Optional?', {
24
+ true: false,
25
+ false: true,
26
+ });
27
+ const loading = instance.getEnum('Variant', {
28
+ Loading: true,
29
+ });
30
+ const value = instance.getEnum('Value type', {
31
+ Filled: instance.getString('Value'),
32
+ });
33
+ export default {
34
+ id: 'combobox',
35
+ imports: [
36
+ 'import { Combobox } from "@utilitywarehouse/hearth-react-native";',
37
+ 'import { useState } from "react";',
38
+ ],
39
+ example: figma.code `function Example() {
40
+ const [value, setValue] = useState<string | null>(${value ? "'1'" : 'null'});
41
+
42
+ return (
43
+ <Combobox
44
+ label="${label}"
45
+ placeholder="${placeholder}"${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('required', required)}${figma.helpers.react.renderProp('loading', loading)}
46
+ options={[
47
+ { label: 'Option 1', value: '1' },
48
+ { label: 'Option 2', value: '2' },
49
+ { label: 'Option 3', value: '3' },
50
+ ]}
51
+ value={value}
52
+ onValueChange={setValue}
53
+ />
54
+ );
55
+ }`,
56
+ metadata: {
57
+ nestable: true,
58
+ props: {
59
+ label,
60
+ placeholder,
61
+ validationStatus,
62
+ invalidText,
63
+ helperText,
64
+ required,
65
+ loading,
66
+ value,
67
+ },
68
+ },
69
+ };
@@ -0,0 +1,31 @@
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
+ valueType: string | undefined;
10
+ value: string;
11
+ label: string;
12
+ helperText: figma.EnumOptionsValues<{
13
+ true: string;
14
+ false: undefined;
15
+ }>;
16
+ invalidText: figma.EnumOptionsValues<{
17
+ Default: undefined;
18
+ Invalid: string;
19
+ }>;
20
+ validationStatus: figma.EnumOptionsValues<{
21
+ Default: undefined;
22
+ Invalid: string;
23
+ }>;
24
+ focused: boolean;
25
+ labelVariant: string | undefined;
26
+ placeholder: string | undefined;
27
+ displayValue: string | undefined;
28
+ };
29
+ };
30
+ };
31
+ export default _default;