@utilitywarehouse/hearth-react-native 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +16 -0
  4. package/build/components/Accordion/AccordionTrigger.js +1 -1
  5. package/build/components/Banner/Banner.context.d.ts +7 -0
  6. package/build/components/Banner/Banner.context.js +8 -0
  7. package/build/components/Banner/Banner.js +10 -40
  8. package/build/components/Banner/Banner.props.d.ts +3 -5
  9. package/build/components/Banner/BannerIllustration.d.ts +4 -0
  10. package/build/components/Banner/BannerIllustration.js +53 -0
  11. package/build/components/Banner/BannerImage.d.ts +4 -0
  12. package/build/components/Banner/BannerImage.js +53 -0
  13. package/build/components/Banner/index.d.ts +2 -0
  14. package/build/components/Banner/index.js +2 -0
  15. package/build/components/Card/CardAction/CardAction.props.d.ts +2 -3
  16. package/build/components/Card/CardAction/CardActionRoot.js +1 -2
  17. package/build/components/Checkbox/Checkbox.js +1 -2
  18. package/build/components/Checkbox/Checkbox.props.d.ts +3 -3
  19. package/build/components/Checkbox/CheckboxImage.d.ts +2 -1
  20. package/build/components/Checkbox/CheckboxImage.js +8 -1
  21. package/build/components/Checkbox/CheckboxIndicator.js +3 -3
  22. package/build/components/DatePicker/DatePickerDay.js +3 -3
  23. package/build/components/ExpandableCard/ExpandableCard.props.d.ts +1 -2
  24. package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +4 -5
  25. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +1 -14
  26. package/build/components/HighlightBanner/HighlightBanner.js +2 -6
  27. package/build/components/HighlightBanner/HighlightBanner.props.d.ts +2 -3
  28. package/build/components/HighlightBanner/HighlightBannerImage.d.ts +4 -0
  29. package/build/components/HighlightBanner/HighlightBannerImage.js +18 -0
  30. package/build/components/HighlightBanner/index.d.ts +1 -0
  31. package/build/components/HighlightBanner/index.js +1 -0
  32. package/build/components/Input/Input.d.ts +5 -7
  33. package/build/components/Input/Input.js +11 -4
  34. package/build/components/Input/InputField.d.ts +4 -7
  35. package/build/components/Input/InputField.js +6 -5
  36. package/build/components/List/ListItem/ListItem.props.d.ts +2 -2
  37. package/build/components/List/ListItem/ListItemRoot.js +1 -2
  38. package/build/components/Modal/Modal.js +2 -6
  39. package/build/components/Modal/Modal.props.d.ts +3 -2
  40. package/build/components/Modal/Modal.web.js +2 -6
  41. package/build/components/Modal/ModalImage.d.ts +4 -0
  42. package/build/components/Modal/ModalImage.js +18 -0
  43. package/build/components/Modal/index.d.ts +1 -0
  44. package/build/components/Modal/index.js +1 -0
  45. package/build/components/PillGroup/Pill.js +2 -2
  46. package/build/components/Radio/Radio.js +1 -2
  47. package/build/components/Radio/Radio.props.d.ts +3 -3
  48. package/build/components/Radio/RadioImage.d.ts +2 -1
  49. package/build/components/Radio/RadioImage.js +8 -1
  50. package/build/components/Radio/RadioIndicator.js +3 -3
  51. package/build/components/RadioCard/RadioCardIndicator.js +3 -3
  52. package/build/components/RadioCard/RadioCardRoot.js +3 -3
  53. package/build/components/Tabs/Tab.js +5 -5
  54. package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
  55. package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +3 -3
  56. package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
  57. package/build/components/VerificationInput/VerificationInput.d.ts +6 -0
  58. package/build/components/VerificationInput/VerificationInput.js +35 -0
  59. package/build/components/VerificationInput/VerificationInput.props.d.ts +49 -0
  60. package/build/components/VerificationInput/VerificationInput.props.js +1 -0
  61. package/build/components/VerificationInput/VerificationInputSlot.d.ts +9 -0
  62. package/build/components/VerificationInput/VerificationInputSlot.js +72 -0
  63. package/build/components/VerificationInput/index.d.ts +4 -0
  64. package/build/components/VerificationInput/index.js +3 -0
  65. package/build/components/VerificationInput/useVerificationInput.d.ts +14 -0
  66. package/build/components/VerificationInput/useVerificationInput.js +58 -0
  67. package/build/components/index.d.ts +1 -0
  68. package/build/components/index.js +1 -0
  69. package/build/utils/index.d.ts +2 -1
  70. package/build/utils/index.js +2 -1
  71. package/build/utils/isThemedImageProps.d.ts +4 -0
  72. package/build/utils/isThemedImageProps.js +4 -0
  73. package/docs/components/AllComponents.web.tsx +9 -0
  74. package/package.json +11 -12
  75. package/src/components/Accordion/Accordion.figma.tsx +23 -0
  76. package/src/components/Accordion/AccordionItemRoot.figma.tsx +47 -0
  77. package/src/components/Accordion/AccordionTrigger.tsx +1 -1
  78. package/src/components/Alert/Alert.figma.tsx +47 -0
  79. package/src/components/Avatar/Avatar.figma.tsx +33 -0
  80. package/src/components/Badge/Badge.figma.tsx +48 -24
  81. package/src/components/Banner/Banner.context.ts +11 -0
  82. package/src/components/Banner/Banner.docs.mdx +55 -37
  83. package/src/components/Banner/Banner.figma.tsx +15 -0
  84. package/src/components/Banner/Banner.props.ts +3 -5
  85. package/src/components/Banner/Banner.stories.tsx +86 -57
  86. package/src/components/Banner/Banner.tsx +24 -67
  87. package/src/components/Banner/BannerIllustration.figma.tsx +30 -0
  88. package/src/components/Banner/BannerIllustration.tsx +63 -0
  89. package/src/components/Banner/BannerImage.tsx +63 -0
  90. package/src/components/Banner/index.ts +2 -0
  91. package/src/components/BottomSheet/BottomSheetModal.figma.tsx +20 -0
  92. package/src/components/Button/Button.figma.tsx +60 -229
  93. package/src/components/Card/Card.docs.mdx +4 -4
  94. package/src/components/Card/Card.figma.tsx +43 -71
  95. package/src/components/Card/CardAction/CardAction.figma.tsx +44 -0
  96. package/src/components/Card/CardAction/CardAction.props.ts +2 -3
  97. package/src/components/Card/CardAction/CardAction.stories.tsx +5 -4
  98. package/src/components/Card/CardAction/CardActionRoot.tsx +4 -5
  99. package/src/components/Carousel/Carousel.figma.tsx +19 -0
  100. package/src/components/Checkbox/Checkbox.docs.mdx +23 -4
  101. package/src/components/Checkbox/Checkbox.figma.tsx +26 -41
  102. package/src/components/Checkbox/Checkbox.props.ts +3 -3
  103. package/src/components/Checkbox/Checkbox.stories.tsx +14 -8
  104. package/src/components/Checkbox/Checkbox.tsx +1 -2
  105. package/src/components/Checkbox/CheckboxGroup.figma.tsx +20 -0
  106. package/src/components/Checkbox/CheckboxImage.figma.tsx +27 -0
  107. package/src/components/Checkbox/CheckboxImage.tsx +8 -3
  108. package/src/components/Checkbox/CheckboxIndicator.tsx +3 -3
  109. package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +32 -0
  110. package/src/components/CurrencyInput/CurrencyInput.figma.tsx +56 -0
  111. package/src/components/DateInput/DateInput.figma.tsx +75 -0
  112. package/src/components/DatePicker/DatePickerCalendar.figma.tsx +34 -0
  113. package/src/components/DatePicker/DatePickerDay.tsx +3 -3
  114. package/src/components/DatePickerInput/DatePickerInput.figma.tsx +62 -0
  115. package/src/components/DescriptionList/DescriptionList.figma.tsx +23 -0
  116. package/src/components/Divider/Divider.figma.tsx +23 -18
  117. package/src/components/ExpandableCard/ExpandableCard.docs.mdx +2 -2
  118. package/src/components/ExpandableCard/ExpandableCard.figma.tsx +54 -0
  119. package/src/components/ExpandableCard/ExpandableCard.props.ts +1 -2
  120. package/src/components/ExpandableCard/ExpandableCard.stories.tsx +3 -3
  121. package/src/components/ExpandableCard/ExpandableCardGroup.figma.tsx +23 -0
  122. package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +4 -5
  123. package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +2 -17
  124. package/src/components/FormField/FormField.figma.tsx +23 -0
  125. package/src/components/Helper/HelperText.figma.tsx +23 -0
  126. package/src/components/HighlightBanner/HighlightBanner.docs.mdx +73 -42
  127. package/src/components/HighlightBanner/HighlightBanner.props.ts +2 -3
  128. package/src/components/HighlightBanner/HighlightBanner.stories.tsx +85 -60
  129. package/src/components/HighlightBanner/HighlightBanner.tsx +3 -10
  130. package/src/components/HighlightBanner/HighlightBannerImage.tsx +20 -0
  131. package/src/components/HighlightBanner/index.ts +1 -0
  132. package/src/components/IconButton/IconButton.figma.tsx +55 -161
  133. package/src/components/IconContainer/IconContainer.figma.tsx +50 -0
  134. package/src/components/InlineLink/InlineLink.figma.tsx +33 -0
  135. package/src/components/Input/Input.figma.tsx +52 -110
  136. package/src/components/Input/Input.stories.tsx +76 -3
  137. package/src/components/Input/Input.tsx +110 -98
  138. package/src/components/Input/InputField.tsx +27 -26
  139. package/src/components/Label/Label.figma.tsx +24 -0
  140. package/src/components/Link/Link.figma.tsx +42 -0
  141. package/src/components/List/List.docs.mdx +15 -9
  142. package/src/components/List/List.figma.tsx +29 -108
  143. package/src/components/List/List.stories.tsx +2 -2
  144. package/src/components/List/ListAction/ListAction.figma.tsx +29 -0
  145. package/src/components/List/ListItem/ListItem.figma.tsx +40 -220
  146. package/src/components/List/ListItem/ListItem.props.ts +2 -2
  147. package/src/components/List/ListItem/ListItemLeadingContent.figma.tsx +29 -0
  148. package/src/components/List/ListItem/ListItemRoot.tsx +2 -3
  149. package/src/components/List/ListItem/ListItemTrailingContent.figma.tsx +27 -0
  150. package/src/components/Menu/Menu.figma.tsx +30 -0
  151. package/src/components/Menu/MenuItem.figma.tsx +31 -0
  152. package/src/components/Modal/Modal.docs.mdx +16 -4
  153. package/src/components/Modal/Modal.figma.tsx +56 -0
  154. package/src/components/Modal/Modal.props.ts +3 -2
  155. package/src/components/Modal/Modal.stories.tsx +2 -5
  156. package/src/components/Modal/Modal.tsx +2 -6
  157. package/src/components/Modal/Modal.web.tsx +2 -6
  158. package/src/components/Modal/ModalImage.tsx +20 -0
  159. package/src/components/Modal/index.ts +1 -0
  160. package/src/components/PillGroup/Pill.figma.tsx +25 -0
  161. package/src/components/PillGroup/Pill.tsx +3 -3
  162. package/src/components/PillGroup/PillGroup.figma.tsx +21 -0
  163. package/src/components/PillGroup/PillGroup.stories.tsx +1 -1
  164. package/src/components/ProgressStepper/ProgressStep.figma.tsx +30 -0
  165. package/src/components/ProgressStepper/ProgressStepper.figma.tsx +20 -0
  166. package/src/components/Radio/Radio.docs.mdx +21 -8
  167. package/src/components/Radio/Radio.figma.tsx +22 -42
  168. package/src/components/Radio/Radio.props.ts +3 -3
  169. package/src/components/Radio/Radio.stories.tsx +15 -11
  170. package/src/components/Radio/Radio.tsx +1 -2
  171. package/src/components/Radio/RadioGroup.figma.tsx +54 -0
  172. package/src/components/Radio/RadioImage.figma.tsx +27 -0
  173. package/src/components/Radio/RadioImage.tsx +8 -3
  174. package/src/components/Radio/RadioIndicator.tsx +3 -3
  175. package/src/components/Radio/RadioTileRoot.figma.tsx +31 -0
  176. package/src/components/RadioCard/RadioCardIndicator.tsx +3 -3
  177. package/src/components/RadioCard/RadioCardRoot.tsx +3 -3
  178. package/src/components/SectionHeader/SectionHeader.figma.tsx +30 -16
  179. package/src/components/Select/Select.figma.tsx +55 -0
  180. package/src/components/Select/SelectOption.figma.tsx +36 -0
  181. package/src/components/Spinner/Spinner.figma.tsx +20 -12
  182. package/src/components/Switch/Switch.figma.tsx +31 -23
  183. package/src/components/Tabs/Tab.tsx +5 -5
  184. package/src/components/Tabs/Tabs.figma.tsx +29 -0
  185. package/src/components/ThemedImage/ThemedImage.stories.tsx +1 -1
  186. package/src/components/Toast/ToastItem.figma.tsx +22 -0
  187. package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
  188. package/src/components/ToggleButtonCard/ToggleButtonCardRoot.tsx +3 -3
  189. package/src/components/UnstyledIconButton/UnstyledIconButton.figma.tsx +49 -0
  190. package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +1 -1
  191. package/src/components/VerificationInput/VerificationInput.docs.mdx +68 -0
  192. package/src/components/VerificationInput/VerificationInput.props.ts +52 -0
  193. package/src/components/VerificationInput/VerificationInput.stories.tsx +140 -0
  194. package/src/components/VerificationInput/VerificationInput.tsx +89 -0
  195. package/src/components/VerificationInput/VerificationInputSlot.tsx +94 -0
  196. package/src/components/VerificationInput/index.ts +5 -0
  197. package/src/components/VerificationInput/useVerificationInput.ts +72 -0
  198. package/src/components/index.ts +1 -0
  199. package/src/utils/index.ts +2 -1
  200. package/src/utils/isThemedImageProps.ts +8 -0
  201. package/src/components/Checkbox/CheckboxIndicator.figma.tsx +0 -19
  202. package/src/components/Radio/RadioIndicator.figma.tsx +0 -21
@@ -0,0 +1,27 @@
1
+ import React from "react"
2
+ import RadioImage from "./RadioImage"
3
+ import figma from "@figma/code-connect"
4
+
5
+ /**
6
+ * -- This file was auto-generated by Code Connect --
7
+ * None of your props could be automatically mapped to Figma properties.
8
+ * You should update the `props` object to include a mapping from your
9
+ * code props to Figma properties, and update the `example` function to
10
+ * return the code example you'd like to see in Figma
11
+ */
12
+
13
+ figma.connect(
14
+ RadioImage,
15
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7428%3A8535",
16
+ {
17
+ props: {
18
+ // No matching props could be found for these Figma properties:
19
+ // "customContent": figma.instance('Custom content'),
20
+ // "variant": figma.enum('Variant', {
21
+ // "Bank logo": "bank-logo",
22
+ // "Custom": "custom"
23
+ // })
24
+ },
25
+ example: (props) => <RadioImage />,
26
+ },
27
+ )
@@ -1,8 +1,13 @@
1
1
  import { Image, ImageProps } from 'react-native';
2
+ import { isThemedImageProps } from '../../utils';
3
+ import { ThemedImage, ThemedImageProps } from '../ThemedImage';
2
4
 
3
- const RadioImage = ({ source, style, ...props }: ImageProps) => (
4
- <Image source={source} style={style} {...props} />
5
- );
5
+ const RadioImage = ({ ...props }: ImageProps | ThemedImageProps) => {
6
+ if (isThemedImageProps(props)) {
7
+ return <ThemedImage {...props} />;
8
+ }
9
+ return <Image {...props} />;
10
+ };
6
11
 
7
12
  RadioImage.displayName = 'RadioImage';
8
13
 
@@ -35,9 +35,9 @@ const styles = StyleSheet.create(theme => ({
35
35
  _hover: {
36
36
  outlineColor: theme.components.radio.outlineColorHover,
37
37
  },
38
- '_focus-within': {
39
- ...theme.helpers.focusVisible,
40
- },
38
+ // '_focus-within': {
39
+ // ...theme.helpers.focusVisible,
40
+ // },
41
41
  _active: {
42
42
  outlineColor: theme.components.radio.outlineColorActive,
43
43
  },
@@ -0,0 +1,31 @@
1
+ import React from "react"
2
+ import RadioTileRoot from "./RadioTileRoot"
3
+ import figma from "@figma/code-connect"
4
+
5
+ /**
6
+ * -- This file was auto-generated by Code Connect --
7
+ * None of your props could be automatically mapped to Figma properties.
8
+ * You should update the `props` object to include a mapping from your
9
+ * code props to Figma properties, and update the `example` function to
10
+ * return the code example you'd like to see in Figma
11
+ */
12
+
13
+ figma.connect(
14
+ RadioTileRoot,
15
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3138%3A13222",
16
+ {
17
+ props: {
18
+ // No matching props could be found for these Figma properties:
19
+ // "helperText": figma.boolean('Helper text?'),
20
+ // "helperText": figma.string('Helper text'),
21
+ // "label": figma.string('Label'),
22
+ // "image": figma.boolean('Image?'),
23
+ // "state": figma.enum('State', {
24
+ // "Default": "default",
25
+ // "Focus": "focus"
26
+ // }),
27
+ // "checked": figma.boolean('Checked?')
28
+ },
29
+ example: (props) => <RadioTileRoot />,
30
+ },
31
+ )
@@ -35,9 +35,9 @@ const styles = StyleSheet.create(theme => ({
35
35
  _hover: {
36
36
  outlineColor: theme.components.radio.outlineColorHover,
37
37
  },
38
- '_focus-within': {
39
- ...theme.helpers.focusVisible,
40
- },
38
+ // '_focus-within': {
39
+ // ...theme.helpers.focusVisible,
40
+ // },
41
41
  _active: {
42
42
  outlineColor: theme.components.radio.outlineColorActive,
43
43
  },
@@ -75,9 +75,9 @@ const styles = StyleSheet.create(theme => ({
75
75
  },
76
76
  },
77
77
  _web: {
78
- '_focus-visible': {
79
- ...theme.helpers.focusVisible,
80
- },
78
+ // '_focus-visible': {
79
+ // ...theme.helpers.focusVisible,
80
+ // },
81
81
  },
82
82
  },
83
83
  }));
@@ -1,17 +1,31 @@
1
- //
2
- // import { SectionHeader } from './';
3
- // import figma from '@figma/code-connect';
1
+ import React from "react"
2
+ import SectionHeader from "./SectionHeader"
3
+ import figma from "@figma/code-connect"
4
4
 
5
- // figma.connect(
6
- // SectionHeader,
7
- // 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=4763-8266&t=q4qCzh74a2av1MqM-4',
8
- // {
9
- // props: {
10
- // helperText: figma.string('Supporting text'),
11
- // text: figma.string('heading'),
12
- // },
13
- // example: ({ helperText, text }) => (
14
- // <SectionHeader text={text} helperText={helperText} />
15
- // ),
16
- // }
17
- // );
5
+ /**
6
+ * -- This file was auto-generated by Code Connect --
7
+ * None of your props could be automatically mapped to Figma properties.
8
+ * You should update the `props` object to include a mapping from your
9
+ * code props to Figma properties, and update the `example` function to
10
+ * return the code example you'd like to see in Figma
11
+ */
12
+
13
+ figma.connect(
14
+ SectionHeader,
15
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=9092%3A3352",
16
+ {
17
+ props: {
18
+ // No matching props could be found for these Figma properties:
19
+ // "trailingContent": figma.boolean('Trailing content?'),
20
+ // "helperText": figma.boolean('Helper text?'),
21
+ // "helperText": figma.string('Helper text'),
22
+ // "heading": figma.string('Heading'),
23
+ // "badge": figma.boolean('Badge?'),
24
+ // "state": figma.enum('State', {
25
+ // "Invalid": "invalid",
26
+ // "Default": "default"
27
+ // })
28
+ },
29
+ example: (props) => <SectionHeader />,
30
+ },
31
+ )
@@ -0,0 +1,55 @@
1
+ import figma from '@figma/code-connect';
2
+ import Select from './Select';
3
+
4
+ /**
5
+ * -- This file was auto-generated by Code Connect --
6
+ * `props` includes a mapping from your code props to Figma properties.
7
+ * You should check this is correct, and update the `example` function
8
+ * to return the code example you'd like to see in Figma
9
+ */
10
+
11
+ figma.connect(Select, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3224%3A995', {
12
+ props: {
13
+ // These props were automatically mapped based on your linked code:
14
+ label: figma.string('Label'),
15
+ placeholder: figma.string('Label'),
16
+ disabled: figma.enum('Variant', {
17
+ Disabled: true,
18
+ }),
19
+ emptyText: figma.string('Helper text'),
20
+ readonly: figma.enum('Variant', {
21
+ 'Read-only': true,
22
+ }),
23
+ collapsable: figma.boolean('Dropdown?'),
24
+ focusable: figma.boolean('Focus?'),
25
+ hasTVPreferredFocus: figma.boolean('Focus?'),
26
+ 'aria-disabled': figma.enum('Variant', {
27
+ Disabled: true,
28
+ }),
29
+ // No matching props could be found for these Figma properties:
30
+ // "helperText": figma.boolean('Helper text?'),
31
+ // "label": figma.string('Label'),
32
+ // "validation": figma.string('Validation'),
33
+ // "helperText": figma.string('Helper text'),
34
+ // "value": figma.string('Value'),
35
+ // "dropdown": figma.boolean('Dropdown?'),
36
+ // "optional": figma.boolean('Optional?'),
37
+ // "valueType": figma.enum('Value type', {
38
+ // "Empty": "empty",
39
+ // "Placeholder": "placeholder",
40
+ // "Selected": "selected"
41
+ // })
42
+ },
43
+ example: props => (
44
+ <Select
45
+ label={props.label}
46
+ placeholder={props.placeholder}
47
+ disabled={props.disabled}
48
+ emptyText={props.emptyText}
49
+ readonly={props.readonly}
50
+ collapsable={props.collapsable}
51
+ focusable={props.focusable}
52
+ hasTVPreferredFocus={props.hasTVPreferredFocus}
53
+ />
54
+ ),
55
+ });
@@ -0,0 +1,36 @@
1
+ import figma from '@figma/code-connect';
2
+ import SelectOption from './SelectOption';
3
+
4
+ /**
5
+ * -- This file was auto-generated by Code Connect --
6
+ * `props` includes a mapping from your code props to Figma properties.
7
+ * You should check this is correct, and update the `example` function
8
+ * to return the code example you'd like to see in Figma
9
+ */
10
+
11
+ figma.connect(
12
+ SelectOption,
13
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=4340%3A1252',
14
+ {
15
+ props: {
16
+ // These props were automatically mapped based on your linked code:
17
+ label: figma.string('Label'),
18
+ selected: figma.boolean('Selected?'),
19
+ disabled: figma.enum('State', {
20
+ Active: true,
21
+ }),
22
+ // No matching props could be found for these Figma properties:
23
+ // "label": figma.string('Label'),
24
+ // "icon": figma.boolean('Icon?'),
25
+ // "icon20": figma.instance('Icon-20')
26
+ },
27
+ example: props => (
28
+ <SelectOption
29
+ label={props.label}
30
+ value={null}
31
+ selected={props.selected}
32
+ disabled={props.disabled}
33
+ />
34
+ ),
35
+ }
36
+ );
@@ -1,19 +1,27 @@
1
- import figma from '@figma/code-connect';
2
- import { color } from '@utilitywarehouse/hearth-tokens/js';
3
- import { Spinner } from './';
1
+ import React from "react"
2
+ import Spinner from "./Spinner"
3
+ import figma from "@figma/code-connect"
4
+
5
+ /**
6
+ * -- This file was auto-generated by Code Connect --
7
+ * `props` includes a mapping from your code props to Figma properties.
8
+ * You should check this is correct, and update the `example` function
9
+ * to return the code example you'd like to see in Figma
10
+ */
4
11
 
5
12
  figma.connect(
6
13
  Spinner,
7
- 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components?node-id=61-195&t=j6vWFfxRVLbnAYhY-4',
14
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A195",
8
15
  {
9
16
  props: {
10
- size: figma.enum('Size', {
11
- 'XS-20': 'xs',
12
- 'SM-24': 'sm',
13
- 'MD-32': 'md',
14
- 'LG-44': 'lg',
17
+ // These props were automatically mapped based on your linked code:
18
+ size: figma.enum("Size", {
19
+ "XS-20": "xs",
20
+ "SM-24": "sm",
21
+ "MD-32": "md",
22
+ "LG-44": "lg",
15
23
  }),
16
24
  },
17
- example: ({ size }) => <Spinner size={size} color={color.purple['700']} />,
18
- }
19
- );
25
+ example: (props) => <Spinner size={props.size} />,
26
+ },
27
+ )
@@ -1,29 +1,37 @@
1
- import { Switch } from './';
2
1
  import figma from '@figma/code-connect';
2
+ import Switch from './Switch';
3
3
 
4
4
  /**
5
5
  * -- This file was auto-generated by Code Connect --
6
- * `props` includes a mapping from Figma properties and variants to
7
- * suggested values. You should update this to match the props of your
8
- * code component, and update the `example` function to return the
9
- * code example you'd like to see in Figma
6
+ * `props` includes a mapping from your code props to Figma properties.
7
+ * You should check this is correct, and update the `example` function
8
+ * to return the code example you'd like to see in Figma
10
9
  */
11
10
 
12
- figma.connect(
13
- Switch,
14
- 'https://www.figma.com/design/3RY3OvLA88yZksRjOfjQJm/UW-App-UI?node-id=9551-7352&t=fDsV1m42i8hVbZo3-4',
15
- {
16
- props: {
17
- value: figma.boolean('checked'),
18
- state: figma.enum('state', {
19
- default: 'default',
20
- }),
21
- size: figma.enum('size', {
22
- 'medium - 32': 'medium',
23
- 'small - 24': 'small',
24
- }),
25
- disabled: figma.boolean('disabled'),
26
- },
27
- example: props => <Switch {...props} />,
28
- }
29
- );
11
+ figma.connect(Switch, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3044%3A243', {
12
+ props: {
13
+ // These props were automatically mapped based on your linked code:
14
+ disabled: figma.enum('State', {
15
+ Disabled: true,
16
+ }),
17
+ 'aria-disabled': figma.enum('State', {
18
+ Disabled: true,
19
+ }),
20
+ focusable: figma.enum('State', {
21
+ Focus: true,
22
+ }),
23
+ checked: figma.boolean('Checked?'),
24
+ size: figma.enum('Size', {
25
+ 'MD-32': 'medium',
26
+ 'SM-24': 'small',
27
+ }),
28
+ },
29
+ example: props => (
30
+ <Switch
31
+ value={props.checked}
32
+ disabled={props.disabled}
33
+ focusable={props.focusable}
34
+ size={props.size}
35
+ />
36
+ ),
37
+ });
@@ -76,11 +76,11 @@ const styles = StyleSheet.create(theme => ({
76
76
  _hover: {
77
77
  backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
78
78
  },
79
- '_focus-visible': {
80
- ...theme.helpers.focusVisible,
81
- outlineOffset: -2,
82
- borderRadius: theme.borderRadius.sm,
83
- },
79
+ // '_focus-visible': {
80
+ // ...theme.helpers.focusVisible,
81
+ // outlineOffset: -2,
82
+ // borderRadius: theme.borderRadius.sm,
83
+ // },
84
84
  _active: {
85
85
  backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
86
86
  },
@@ -0,0 +1,29 @@
1
+ import React from "react"
2
+ import Tabs from "./Tabs"
3
+ import figma from "@figma/code-connect"
4
+
5
+ /**
6
+ * -- This file was auto-generated by Code Connect --
7
+ * `props` includes a mapping from your code props to Figma properties.
8
+ * You should check this is correct, and update the `example` function
9
+ * to return the code example you'd like to see in Figma
10
+ */
11
+
12
+ figma.connect(
13
+ Tabs,
14
+ "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6464%3A8744",
15
+ {
16
+ props: {
17
+ // These props were automatically mapped based on your linked code:
18
+ size: figma.enum("Size", {
19
+ "MD-56": "md",
20
+ "LG-64": "lg",
21
+ }),
22
+ // No matching props could be found for these Figma properties:
23
+ // "arrowLeft": figma.boolean('Arrow left?'),
24
+ // "arrowRight": figma.boolean('Arrow right?'),
25
+ // "condensed": figma.boolean('Condensed?')
26
+ },
27
+ example: (props) => <Tabs size={props.size} />,
28
+ },
29
+ )
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
1
+ import type { Meta, StoryObj } from '@storybook/react-native';
2
2
  import MascotEnergyDark from '@utilitywarehouse/hearth-svg-assets/lib/mascot-energy-dark.svg';
3
3
  import MascotEnergyLight from '@utilitywarehouse/hearth-svg-assets/lib/mascot-energy-light.svg';
4
4
  import SceneBroadbandDark from '@utilitywarehouse/hearth-svg-assets/lib/scene-broadband-dark.svg';
@@ -0,0 +1,22 @@
1
+ import figma from '@figma/code-connect';
2
+ import ToastItem from './ToastItem';
3
+
4
+ /**
5
+ * -- This file was auto-generated by Code Connect --
6
+ * None of your props could be automatically mapped to Figma properties.
7
+ * You should update the `props` object to include a mapping from your
8
+ * code props to Figma properties, and update the `example` function to
9
+ * return the code example you'd like to see in Figma
10
+ */
11
+
12
+ figma.connect(ToastItem, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7072%3A913', {
13
+ props: {
14
+ // No matching props could be found for these Figma properties:
15
+ // "link": figma.boolean('Link?'),
16
+ // "text": figma.string('Text'),
17
+ // "icon": figma.boolean('Icon?'),
18
+ // "icon24": figma.instance('Icon-24'),
19
+ // "dismiss": figma.boolean('Dismiss?')
20
+ },
21
+ example: props => <ToastItem toast={null} onClose={null} />,
22
+ });
@@ -16,7 +16,7 @@ const ButtonRoot = ({
16
16
 
17
17
  styles.useVariants({
18
18
  toggled,
19
- active: active || pressed,
19
+ active,
20
20
  });
21
21
 
22
22
  const handlePress = (e: GestureResponderEvent) => {
@@ -56,7 +56,7 @@ const styles = StyleSheet.create(theme => ({
56
56
  borderColor: theme.color.interactive.neutral.border.subtle,
57
57
  height: theme.components.toggleButton.height,
58
58
  _web: {
59
- '_focus-visible': theme.helpers.focusVisible,
59
+ // '_focus-visible': theme.helpers.focusVisible,
60
60
  _hover: {
61
61
  backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
62
62
  },
@@ -77,9 +77,9 @@ const styles = StyleSheet.create(theme => ({
77
77
  },
78
78
  },
79
79
  _web: {
80
- '_focus-visible': {
81
- ...theme.helpers.focusVisible,
82
- },
80
+ // '_focus-visible': {
81
+ // ...theme.helpers.focusVisible,
82
+ // },
83
83
  },
84
84
  },
85
85
  buttonContainer: {
@@ -0,0 +1,49 @@
1
+ import figma from '@figma/code-connect';
2
+ import UnstyledIconButton from './UnstyledIconButton';
3
+
4
+ /**
5
+ * -- This file was auto-generated by Code Connect --
6
+ * `props` includes a mapping from your code props to Figma properties.
7
+ * You should check this is correct, and update the `example` function
8
+ * to return the code example you'd like to see in Figma
9
+ */
10
+
11
+ figma.connect(
12
+ UnstyledIconButton,
13
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2926%3A2430',
14
+ {
15
+ props: {
16
+ // These props were automatically mapped based on your linked code:
17
+ disabled: figma.enum('State', {
18
+ Disabled: true,
19
+ }),
20
+ loading: figma.enum('State', {
21
+ Loading: true,
22
+ }),
23
+ size: figma.enum('Size', {
24
+ 'SM-20': 'sm',
25
+ 'MD-24': 'md',
26
+ }),
27
+ inverted: figma.boolean('Inverted?'),
28
+ 'aria-disabled': figma.enum('State', {
29
+ Disabled: true,
30
+ }),
31
+ focusable: figma.enum('State', {
32
+ Focus: true,
33
+ }),
34
+ // No matching props could be found for these Figma properties:
35
+ // "icon24": figma.instance('Icon-24'),
36
+ // "icon20": figma.instance('Icon-20')
37
+ },
38
+ example: props => (
39
+ <UnstyledIconButton
40
+ disabled={props.disabled}
41
+ icon={null}
42
+ loading={props.loading}
43
+ size={props.size}
44
+ inverted={props.inverted}
45
+ focusable={props.focusable}
46
+ />
47
+ ),
48
+ }
49
+ );
@@ -36,7 +36,7 @@ const styles = StyleSheet.create(theme => ({
36
36
  alignItems: 'center',
37
37
  borderRadius: theme.borderRadius.sm,
38
38
  _web: {
39
- '_focus-visible': theme.helpers.focusVisible,
39
+ // '_focus-visible': theme.helpers.focusVisible,
40
40
  },
41
41
  variants: {
42
42
  disabled: {
@@ -0,0 +1,68 @@
1
+ import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
2
+ import { InfoMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
3
+ import { VerificationInput } from '../../';
4
+ import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
5
+ import * as Stories from './VerificationInput.stories';
6
+
7
+ <Meta title="Forms / Verification Input" />
8
+
9
+ <BackToTopButton />
10
+
11
+ <ViewFigmaButton url="https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=4049-3615&t=m0WHtPBmyE9YVP8Q-0" />
12
+
13
+ # Verification Input
14
+
15
+ The verification input component is used to capture OTP (One Time Password) or other verification codes.
16
+
17
+ - [Playground](#playground)
18
+ - [Usage](#usage)
19
+ - [Props](#props)
20
+ - [Variants](#variants)
21
+ - [States](#states)
22
+ - [Secure Text Entry](#secure-text-entry)
23
+
24
+ ## Playground
25
+
26
+ <Canvas of={Stories.Playground} />
27
+
28
+ <Controls of={Stories.Playground} />
29
+
30
+ ## Usage
31
+
32
+ <UsageWrap>
33
+ <VerificationInput label="Enter Code" onChangeText={code => console.log(code)} />
34
+ </UsageWrap>
35
+
36
+ ```tsx
37
+ import { VerificationInput } from '@utilitywarehouse/hearth-react-native';
38
+
39
+ const MyComponent = () => {
40
+ const [code, setCode] = useState('');
41
+
42
+ return <VerificationInput label="Enter Code" value={code} onChangeText={setCode} />;
43
+ };
44
+ ```
45
+
46
+ ## Props
47
+
48
+ ### `VerificationInput`
49
+
50
+ The component accepts the following props:
51
+
52
+ | Prop | Type | Default | Description |
53
+ | :----------------- | :---------------------------------- | :---------- | :----------------------------------------------------------- |
54
+ | `value` | `string` | - | The value of the input. |
55
+ | `onChangeText` | `(text: string) => void` | - | Callback when the value changes. |
56
+ | `label` | `string` | - | The label for the input. |
57
+ | `helperText` | `string` | - | Helper text to display below the input. |
58
+ | `helperIcon` | `ComponentType` | - | Icon to display alongside the helper text. |
59
+ | `validationStatus` | `'initial' \| 'valid' \| 'invalid'` | `'initial'` | The validation status of the input. |
60
+ | `validText` | `string` | - | Text to display when validation status is 'valid'. |
61
+ | `invalidText` | `string` | - | Text to display when validation status is 'invalid'. |
62
+ | `disabled` | `boolean` | `false` | Whether the input is disabled. |
63
+ | `readonly` | `boolean` | `false` | Whether the input is read-only. |
64
+ | `secureTextEntry` | `boolean` | `false` | Whether to obscure the text entry (e.g. for passwords/OTPs). |
65
+
66
+ ## Variants
67
+
68
+ <Canvas of={Stories.Variants} />
@@ -0,0 +1,52 @@
1
+ import type { ComponentType } from 'react';
2
+ import { ViewProps } from 'react-native';
3
+
4
+ export interface VerificationInputProps extends ViewProps {
5
+ /**
6
+ * The value of the input.
7
+ */
8
+ value?: string;
9
+ /**
10
+ * Callback when the value changes.
11
+ */
12
+ onChangeText?: (text: string) => void;
13
+ /**
14
+ * The label for the input.
15
+ */
16
+ label?: string;
17
+ /**
18
+ * Helper text to display below the input.
19
+ */
20
+ helperText?: string;
21
+ /**
22
+ * Icon to display alongside the helper text.
23
+ */
24
+ helperIcon?: ComponentType;
25
+ /**
26
+ * The validation status of the input.
27
+ */
28
+ validationStatus?: 'initial' | 'valid' | 'invalid';
29
+ /**
30
+ * Text to display when validation status is 'valid'.
31
+ */
32
+ validText?: string;
33
+ /**
34
+ * Text to display when validation status is 'invalid'.
35
+ */
36
+ invalidText?: string;
37
+ /**
38
+ * Whether the input is disabled.
39
+ */
40
+ disabled?: boolean;
41
+ /**
42
+ * Whether the input is read-only.
43
+ */
44
+ readonly?: boolean;
45
+ /**
46
+ * Whether to obscure the text entry (e.g. for passwords/OTPs).
47
+ */
48
+ secureTextEntry?: boolean;
49
+ }
50
+
51
+ export default VerificationInputProps;
52
+