@utilitywarehouse/hearth-react-native 0.19.0 → 0.20.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 (54) hide show
  1. package/.storybook/preview.tsx +1 -0
  2. package/.turbo/turbo-build.log +1 -1
  3. package/.turbo/turbo-lint.log +16 -16
  4. package/CHANGELOG.md +74 -2
  5. package/build/components/Menu/Menu.d.ts +1 -1
  6. package/build/components/Menu/Menu.js +2 -2
  7. package/build/components/Menu/Menu.props.d.ts +2 -6
  8. package/build/components/Modal/Modal.d.ts +1 -1
  9. package/build/components/Modal/Modal.js +2 -2
  10. package/build/components/Modal/Modal.props.d.ts +1 -0
  11. package/build/components/Modal/Modal.web.d.ts +1 -1
  12. package/build/components/Modal/Modal.web.js +2 -2
  13. package/build/components/Select/Select.d.ts +1 -1
  14. package/build/components/Select/Select.js +9 -10
  15. package/build/components/Select/Select.props.d.ts +16 -0
  16. package/build/components/Toast/ToastItem.js +3 -1
  17. package/docs/changelog.mdx +687 -0
  18. package/package.json +6 -6
  19. package/scripts/copyChangelog.js +50 -0
  20. package/src/components/Checkbox/CheckboxGroup.figma.tsx +21 -1
  21. package/src/components/Menu/Menu.docs.mdx +8 -5
  22. package/src/components/Menu/Menu.figma.tsx +27 -27
  23. package/src/components/Menu/Menu.props.ts +2 -6
  24. package/src/components/Menu/Menu.tsx +3 -6
  25. package/src/components/Menu/MenuItem.figma.tsx +26 -18
  26. package/src/components/Modal/Modal.docs.mdx +22 -21
  27. package/src/components/Modal/Modal.figma.tsx +58 -47
  28. package/src/components/Modal/Modal.props.ts +1 -0
  29. package/src/components/Modal/Modal.stories.tsx +4 -0
  30. package/src/components/Modal/Modal.tsx +2 -1
  31. package/src/components/Modal/Modal.web.tsx +2 -1
  32. package/src/components/PillGroup/Pill.figma.tsx +4 -17
  33. package/src/components/PillGroup/PillGroup.figma.tsx +8 -9
  34. package/src/components/ProgressStepper/ProgressStep.figma.tsx +4 -15
  35. package/src/components/ProgressStepper/ProgressStepper.figma.tsx +9 -16
  36. package/src/components/Radio/Radio.figma.tsx +35 -22
  37. package/src/components/Radio/RadioGroup.figma.tsx +69 -41
  38. package/src/components/Radio/RadioTile.figma.tsx +34 -0
  39. package/src/components/RadioCard/RadioCard.figma.tsx +24 -0
  40. package/src/components/SectionHeader/SectionHeader.figma.tsx +31 -25
  41. package/src/components/Select/Select.docs.mdx +76 -28
  42. package/src/components/Select/Select.figma.tsx +44 -43
  43. package/src/components/Select/Select.props.ts +16 -0
  44. package/src/components/Select/Select.tsx +42 -35
  45. package/src/components/Select/SelectOption.figma.tsx +3 -21
  46. package/src/components/Spinner/Spinner.figma.tsx +12 -25
  47. package/src/components/Switch/Switch.figma.tsx +2 -23
  48. package/src/components/Tabs/Tab.figma.tsx +21 -0
  49. package/src/components/Tabs/Tabs.figma.tsx +18 -27
  50. package/src/components/Textarea/Textarea.figma.tsx +64 -0
  51. package/src/components/Toast/ToastItem.tsx +3 -1
  52. package/src/components/ToggleButtonCard/ToggleButtonCard.figma.tsx +24 -0
  53. package/src/components/VerificationInput/VerificationInput.figma.tsx +53 -0
  54. package/src/components/Radio/RadioTileRoot.figma.tsx +0 -31
@@ -10,10 +10,9 @@ import {
10
10
  BottomSheetView,
11
11
  } from '../BottomSheet';
12
12
  import { DetailText } from '../DetailText';
13
- import { useFormFieldContext } from '../FormField';
13
+ import { FormField, useFormFieldContext } from '../FormField';
14
14
  import { Icon } from '../Icon';
15
15
  import { Input } from '../Input';
16
- import { Label } from '../Label';
17
16
  import { SelectContext } from './Select.context';
18
17
  import SelectProps, { SelectOptionItemProps } from './Select.props';
19
18
  import SelectOption from './SelectOption';
@@ -28,6 +27,10 @@ const Select = ({
28
27
  disabled = false,
29
28
  leadingIcon: LeadingIcon,
30
29
  validationStatus = 'initial',
30
+ helperText,
31
+ helperIcon,
32
+ invalidText,
33
+ validText,
31
34
  required = true,
32
35
  children,
33
36
  bottomSheetProps,
@@ -122,42 +125,46 @@ const Select = ({
122
125
 
123
126
  return (
124
127
  <View {...rest} style={[styles.container, rest.style]}>
125
- {!!label && (
126
- <View>
127
- <Label variant={labelVariant}>
128
- {label}
129
- {!isRequired && <Label variant={labelVariant}> (Optional)</Label>}
130
- </Label>
131
- </View>
132
- )}
133
- <Pressable
134
- onPress={openBottomSheet}
135
- disabled={isDisabled || isReadonly}
136
- style={({ pressed }) => [
137
- styles.selectContainer,
138
- styles.pressedContainer(pressed || isOpen),
139
- ]}
128
+ <FormField
129
+ label={label}
130
+ labelVariant={labelVariant}
131
+ helperText={helperText}
132
+ helperIcon={helperIcon}
133
+ validationStatus={validationStatusFromContext}
134
+ required={isRequired}
135
+ disabled={isDisabled}
136
+ readonly={isReadonly}
137
+ invalidText={invalidText}
138
+ validText={validText}
140
139
  >
141
- {!!LeadingIcon && (
142
- <View>
143
- {(() => {
144
- const IconAny = Icon as any;
145
- return <IconAny as={LeadingIcon} style={styles.icon as any} />;
146
- })()}
147
- </View>
148
- )}
149
-
150
- <View style={styles.optionContainer}>
151
- <BodyText numberOfLines={1} style={styles.placeholderText}>
152
- {selectedOption?.label || selectedLabel || placeholder}
153
- </BodyText>
154
- </View>
140
+ <Pressable
141
+ onPress={openBottomSheet}
142
+ disabled={isDisabled || isReadonly}
143
+ style={({ pressed }) => [
144
+ styles.selectContainer,
145
+ styles.pressedContainer(pressed || isOpen),
146
+ ]}
147
+ >
148
+ {!!LeadingIcon && (
149
+ <View>
150
+ {(() => {
151
+ const IconAny = Icon as any;
152
+ return <IconAny as={LeadingIcon} style={styles.icon as any} />;
153
+ })()}
154
+ </View>
155
+ )}
155
156
 
156
- <View>
157
- <Icon as={ExpandSmallIcon} style={styles.icon} />
158
- </View>
159
- </Pressable>
157
+ <View style={styles.optionContainer}>
158
+ <BodyText numberOfLines={1} style={styles.placeholderText}>
159
+ {selectedOption?.label || selectedLabel || placeholder}
160
+ </BodyText>
161
+ </View>
160
162
 
163
+ <View>
164
+ <Icon as={ExpandSmallIcon} style={styles.icon} />
165
+ </View>
166
+ </Pressable>
167
+ </FormField>
161
168
  <BottomSheetModal
162
169
  ref={bottomSheetModalRef}
163
170
  snapPoints={['25%', '40%', '80%']}
@@ -1,36 +1,18 @@
1
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
- */
2
+ import { SelectOption } from '../';
10
3
 
11
4
  figma.connect(
12
5
  SelectOption,
13
6
  'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=4340%3A1252',
14
7
  {
15
8
  props: {
16
- // These props were automatically mapped based on your linked code:
17
9
  label: figma.string('Label'),
18
- selected: figma.boolean('Selected?'),
19
10
  disabled: figma.enum('State', {
20
- Active: true,
11
+ Disabled: true,
21
12
  }),
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
13
  },
27
14
  example: props => (
28
- <SelectOption
29
- label={props.label}
30
- value={null}
31
- selected={props.selected}
32
- disabled={props.disabled}
33
- />
15
+ <SelectOption label={props.label} value="some value" disabled={props.disabled} />
34
16
  ),
35
17
  }
36
18
  );
@@ -1,27 +1,14 @@
1
- import React from "react"
2
- import Spinner from "./Spinner"
3
- import figma from "@figma/code-connect"
1
+ import figma from '@figma/code-connect';
2
+ import { Spinner } from '../';
4
3
 
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
- Spinner,
14
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A195",
15
- {
16
- props: {
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",
23
- }),
24
- },
25
- example: (props) => <Spinner size={props.size} />,
4
+ figma.connect(Spinner, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A195', {
5
+ props: {
6
+ size: figma.enum('Size', {
7
+ 'XS-20': 'xs',
8
+ 'SM-24': 'sm',
9
+ 'MD-32': 'md',
10
+ 'LG-44': 'lg',
11
+ }),
26
12
  },
27
- )
13
+ example: props => <Spinner size={props.size} />,
14
+ });
@@ -1,37 +1,16 @@
1
1
  import figma from '@figma/code-connect';
2
- import Switch from './Switch';
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
- */
2
+ import { Switch } from '../';
10
3
 
11
4
  figma.connect(Switch, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3044%3A243', {
12
5
  props: {
13
- // These props were automatically mapped based on your linked code:
14
6
  disabled: figma.enum('State', {
15
7
  Disabled: true,
16
8
  }),
17
- 'aria-disabled': figma.enum('State', {
18
- Disabled: true,
19
- }),
20
- focusable: figma.enum('State', {
21
- Focus: true,
22
- }),
23
9
  checked: figma.boolean('Checked?'),
24
10
  size: figma.enum('Size', {
25
11
  'MD-32': 'medium',
26
12
  'SM-24': 'small',
27
13
  }),
28
14
  },
29
- example: props => (
30
- <Switch
31
- value={props.checked}
32
- disabled={props.disabled}
33
- focusable={props.focusable}
34
- size={props.size}
35
- />
36
- ),
15
+ example: props => <Switch value={props.checked} disabled={props.disabled} size={props.size} />,
37
16
  });
@@ -0,0 +1,21 @@
1
+ import figma from '@figma/code-connect';
2
+ import { Tab } from '..';
3
+
4
+ figma.connect(
5
+ Tab,
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6464-2288&m=dev',
7
+ {
8
+ props: {
9
+ label: figma.string('Label'),
10
+ icon: figma.boolean('Icon?', {
11
+ true: figma.instance('Icon-20'),
12
+ }),
13
+ tabs: figma.children('Tab item'),
14
+ },
15
+ example: props => (
16
+ <Tab value={props.label} icon={props.icon}>
17
+ {props.label}
18
+ </Tab>
19
+ ),
20
+ }
21
+ );
@@ -1,29 +1,20 @@
1
- import React from "react"
2
- import Tabs from "./Tabs"
3
- import figma from "@figma/code-connect"
1
+ import figma from '@figma/code-connect';
2
+ import { TabPanel, Tabs, TabsList } from '../';
4
3
 
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} />,
4
+ figma.connect(Tabs, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6464%3A8744', {
5
+ props: {
6
+ size: figma.enum('Size', {
7
+ 'LG-64': 'lg',
8
+ }),
9
+ tabs: figma.children('Tab item'),
28
10
  },
29
- )
11
+ example: props => (
12
+ <Tabs size={props.size}>
13
+ <TabsList>{props.tabs}</TabsList>
14
+ {/* Example TabPanel content, make sure they match the value of your Tab items */}
15
+ <TabPanel value="account">Account content</TabPanel>
16
+ <TabPanel value="billing">Billing content</TabPanel>
17
+ <TabPanel value="usage">Usage content</TabPanel>
18
+ </Tabs>
19
+ ),
20
+ });
@@ -0,0 +1,64 @@
1
+ import figma from '@figma/code-connect';
2
+ import { Textarea } from '..';
3
+
4
+ const props = {
5
+ disabled: figma.enum('State', {
6
+ Disabled: true,
7
+ }),
8
+ readonly: figma.enum('State', {
9
+ 'Read-only': true,
10
+ }),
11
+ placeholder: figma.enum('Value type', {
12
+ Placeholder: figma.string('Value'),
13
+ }),
14
+ value: figma.enum('Value type', {
15
+ Filled: figma.string('Value'),
16
+ }),
17
+ label: figma.string('Label'),
18
+ labelVariant: figma.enum('Label variant', {
19
+ Body: 'body',
20
+ Heading: 'heading',
21
+ }),
22
+ helperText: figma.boolean('Helper text?', {
23
+ true: figma.string('Helper text'),
24
+ }),
25
+ validationStatus: figma.enum('State', {
26
+ Invalid: 'invalid',
27
+ Valid: 'valid',
28
+ }),
29
+ invalidText: figma.enum('State', {
30
+ Invalid: figma.string('Validation'),
31
+ }),
32
+ validText: figma.enum('State', {
33
+ Valid: figma.string('Validation'),
34
+ }),
35
+ };
36
+
37
+ figma.connect(
38
+ Textarea,
39
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2356-5180&m=dev',
40
+ {
41
+ props: {
42
+ ...props,
43
+ required: figma.boolean('Optional?', {
44
+ true: false,
45
+ false: true,
46
+ }),
47
+ },
48
+ example: props => (
49
+ <Textarea
50
+ disabled={props.disabled}
51
+ readonly={props.readonly}
52
+ placeholder={props.placeholder}
53
+ value={props.value}
54
+ label={props.label}
55
+ labelVariant={props.labelVariant}
56
+ helperText={props.helperText}
57
+ required={props.required}
58
+ validationStatus={props.validationStatus}
59
+ invalidText={props.invalidText}
60
+ validText={props.validText}
61
+ />
62
+ ),
63
+ }
64
+ );
@@ -181,7 +181,8 @@ const styles = StyleSheet.create(theme => ({
181
181
  width: 24,
182
182
  height: 24,
183
183
  justifyContent: 'center',
184
- alignItems: 'center',
184
+ alignSelf: 'flex-start',
185
+ alignItems: 'flex-start',
185
186
  flexShrink: 0,
186
187
  },
187
188
  icon: {
@@ -197,6 +198,7 @@ const styles = StyleSheet.create(theme => ({
197
198
  text: { flexShrink: 1 },
198
199
  actions: {
199
200
  flexShrink: 0,
201
+ alignSelf: 'flex-start',
200
202
  },
201
203
  }));
202
204
 
@@ -0,0 +1,24 @@
1
+ import figma from '@figma/code-connect';
2
+ import { ToggleButtonCard } from '../';
3
+
4
+ figma.connect(
5
+ ToggleButtonCard,
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2164-727&t=Uq6QfQcygdNGv5lM-4',
7
+ {
8
+ variant: {
9
+ Variant: 'Toggle Button',
10
+ },
11
+ props: {
12
+ radio: figma.nestedProps('Radio', {
13
+ label: figma.string('Label'),
14
+ }),
15
+ content: figma.instance('Content'),
16
+ },
17
+ example: props => (
18
+ // This should be wrapped in a ToggleButtonCardGroup, see docs
19
+ <ToggleButtonCard label={props.radio.label} value="someValue">
20
+ {props.content}
21
+ </ToggleButtonCard>
22
+ ),
23
+ }
24
+ );
@@ -0,0 +1,53 @@
1
+ import figma from '@figma/code-connect';
2
+ import { VerificationInput } from '..';
3
+
4
+ const props = {
5
+ disabled: figma.enum('State', {
6
+ Disabled: true,
7
+ }),
8
+ placeholder: figma.enum('Value type', {
9
+ Placeholder: figma.string('Value'),
10
+ }),
11
+ value: figma.enum('Value type', {
12
+ Filled: figma.string('Value 1'),
13
+ }),
14
+ label: figma.string('Label'),
15
+ labelVariant: figma.enum('Label variant', {
16
+ Body: 'body',
17
+ Heading: 'heading',
18
+ }),
19
+ helperText: figma.boolean('Helper text?', {
20
+ true: figma.string('Helper text'),
21
+ }),
22
+ validationStatus: figma.enum('State', {
23
+ Invalid: 'invalid',
24
+ Valid: 'valid',
25
+ }),
26
+ invalidText: figma.enum('State', {
27
+ Invalid: figma.string('Validation'),
28
+ }),
29
+ validText: figma.enum('State', {
30
+ Valid: figma.string('Validation'),
31
+ }),
32
+ };
33
+
34
+ figma.connect(
35
+ VerificationInput,
36
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=4049-3615&m=dev',
37
+ {
38
+ props,
39
+ example: props => (
40
+ <VerificationInput
41
+ disabled={props.disabled}
42
+ placeholder={props.placeholder}
43
+ value={props.value}
44
+ label={props.label}
45
+ labelVariant={props.labelVariant}
46
+ helperText={props.helperText}
47
+ validationStatus={props.validationStatus}
48
+ invalidText={props.invalidText}
49
+ validText={props.validText}
50
+ />
51
+ ),
52
+ }
53
+ );
@@ -1,31 +0,0 @@
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
- )