@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,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
+ };
@@ -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
+ };
@@ -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';
@@ -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;