@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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +16 -0
- package/build/components/Accordion/AccordionTrigger.js +1 -1
- package/build/components/Banner/Banner.context.d.ts +7 -0
- package/build/components/Banner/Banner.context.js +8 -0
- package/build/components/Banner/Banner.js +10 -40
- package/build/components/Banner/Banner.props.d.ts +3 -5
- package/build/components/Banner/BannerIllustration.d.ts +4 -0
- package/build/components/Banner/BannerIllustration.js +53 -0
- package/build/components/Banner/BannerImage.d.ts +4 -0
- package/build/components/Banner/BannerImage.js +53 -0
- package/build/components/Banner/index.d.ts +2 -0
- package/build/components/Banner/index.js +2 -0
- package/build/components/Card/CardAction/CardAction.props.d.ts +2 -3
- package/build/components/Card/CardAction/CardActionRoot.js +1 -2
- package/build/components/Checkbox/Checkbox.js +1 -2
- package/build/components/Checkbox/Checkbox.props.d.ts +3 -3
- package/build/components/Checkbox/CheckboxImage.d.ts +2 -1
- package/build/components/Checkbox/CheckboxImage.js +8 -1
- package/build/components/Checkbox/CheckboxIndicator.js +3 -3
- package/build/components/DatePicker/DatePickerDay.js +3 -3
- package/build/components/ExpandableCard/ExpandableCard.props.d.ts +1 -2
- package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +4 -5
- package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +1 -14
- package/build/components/HighlightBanner/HighlightBanner.js +2 -6
- package/build/components/HighlightBanner/HighlightBanner.props.d.ts +2 -3
- package/build/components/HighlightBanner/HighlightBannerImage.d.ts +4 -0
- package/build/components/HighlightBanner/HighlightBannerImage.js +18 -0
- package/build/components/HighlightBanner/index.d.ts +1 -0
- package/build/components/HighlightBanner/index.js +1 -0
- package/build/components/Input/Input.d.ts +5 -7
- package/build/components/Input/Input.js +11 -4
- package/build/components/Input/InputField.d.ts +4 -7
- package/build/components/Input/InputField.js +6 -5
- package/build/components/List/ListItem/ListItem.props.d.ts +2 -2
- package/build/components/List/ListItem/ListItemRoot.js +1 -2
- package/build/components/Modal/Modal.js +2 -6
- package/build/components/Modal/Modal.props.d.ts +3 -2
- package/build/components/Modal/Modal.web.js +2 -6
- package/build/components/Modal/ModalImage.d.ts +4 -0
- package/build/components/Modal/ModalImage.js +18 -0
- package/build/components/Modal/index.d.ts +1 -0
- package/build/components/Modal/index.js +1 -0
- package/build/components/PillGroup/Pill.js +2 -2
- package/build/components/Radio/Radio.js +1 -2
- package/build/components/Radio/Radio.props.d.ts +3 -3
- package/build/components/Radio/RadioImage.d.ts +2 -1
- package/build/components/Radio/RadioImage.js +8 -1
- package/build/components/Radio/RadioIndicator.js +3 -3
- package/build/components/RadioCard/RadioCardIndicator.js +3 -3
- package/build/components/RadioCard/RadioCardRoot.js +3 -3
- package/build/components/Tabs/Tab.js +5 -5
- package/build/components/ToggleButton/ToggleButtonRoot.js +2 -2
- package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +3 -3
- package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
- package/build/components/VerificationInput/VerificationInput.d.ts +6 -0
- package/build/components/VerificationInput/VerificationInput.js +35 -0
- package/build/components/VerificationInput/VerificationInput.props.d.ts +49 -0
- package/build/components/VerificationInput/VerificationInput.props.js +1 -0
- package/build/components/VerificationInput/VerificationInputSlot.d.ts +9 -0
- package/build/components/VerificationInput/VerificationInputSlot.js +72 -0
- package/build/components/VerificationInput/index.d.ts +4 -0
- package/build/components/VerificationInput/index.js +3 -0
- package/build/components/VerificationInput/useVerificationInput.d.ts +14 -0
- package/build/components/VerificationInput/useVerificationInput.js +58 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/utils/index.d.ts +2 -1
- package/build/utils/index.js +2 -1
- package/build/utils/isThemedImageProps.d.ts +4 -0
- package/build/utils/isThemedImageProps.js +4 -0
- package/docs/components/AllComponents.web.tsx +9 -0
- package/package.json +11 -12
- package/src/components/Accordion/Accordion.figma.tsx +23 -0
- package/src/components/Accordion/AccordionItemRoot.figma.tsx +47 -0
- package/src/components/Accordion/AccordionTrigger.tsx +1 -1
- package/src/components/Alert/Alert.figma.tsx +47 -0
- package/src/components/Avatar/Avatar.figma.tsx +33 -0
- package/src/components/Badge/Badge.figma.tsx +48 -24
- package/src/components/Banner/Banner.context.ts +11 -0
- package/src/components/Banner/Banner.docs.mdx +55 -37
- package/src/components/Banner/Banner.figma.tsx +15 -0
- package/src/components/Banner/Banner.props.ts +3 -5
- package/src/components/Banner/Banner.stories.tsx +86 -57
- package/src/components/Banner/Banner.tsx +24 -67
- package/src/components/Banner/BannerIllustration.figma.tsx +30 -0
- package/src/components/Banner/BannerIllustration.tsx +63 -0
- package/src/components/Banner/BannerImage.tsx +63 -0
- package/src/components/Banner/index.ts +2 -0
- package/src/components/BottomSheet/BottomSheetModal.figma.tsx +20 -0
- package/src/components/Button/Button.figma.tsx +60 -229
- package/src/components/Card/Card.docs.mdx +4 -4
- package/src/components/Card/Card.figma.tsx +43 -71
- package/src/components/Card/CardAction/CardAction.figma.tsx +44 -0
- package/src/components/Card/CardAction/CardAction.props.ts +2 -3
- package/src/components/Card/CardAction/CardAction.stories.tsx +5 -4
- package/src/components/Card/CardAction/CardActionRoot.tsx +4 -5
- package/src/components/Carousel/Carousel.figma.tsx +19 -0
- package/src/components/Checkbox/Checkbox.docs.mdx +23 -4
- package/src/components/Checkbox/Checkbox.figma.tsx +26 -41
- package/src/components/Checkbox/Checkbox.props.ts +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +14 -8
- package/src/components/Checkbox/Checkbox.tsx +1 -2
- package/src/components/Checkbox/CheckboxGroup.figma.tsx +20 -0
- package/src/components/Checkbox/CheckboxImage.figma.tsx +27 -0
- package/src/components/Checkbox/CheckboxImage.tsx +8 -3
- package/src/components/Checkbox/CheckboxIndicator.tsx +3 -3
- package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +32 -0
- package/src/components/CurrencyInput/CurrencyInput.figma.tsx +56 -0
- package/src/components/DateInput/DateInput.figma.tsx +75 -0
- package/src/components/DatePicker/DatePickerCalendar.figma.tsx +34 -0
- package/src/components/DatePicker/DatePickerDay.tsx +3 -3
- package/src/components/DatePickerInput/DatePickerInput.figma.tsx +62 -0
- package/src/components/DescriptionList/DescriptionList.figma.tsx +23 -0
- package/src/components/Divider/Divider.figma.tsx +23 -18
- package/src/components/ExpandableCard/ExpandableCard.docs.mdx +2 -2
- package/src/components/ExpandableCard/ExpandableCard.figma.tsx +54 -0
- package/src/components/ExpandableCard/ExpandableCard.props.ts +1 -2
- package/src/components/ExpandableCard/ExpandableCard.stories.tsx +3 -3
- package/src/components/ExpandableCard/ExpandableCardGroup.figma.tsx +23 -0
- package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +4 -5
- package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +2 -17
- package/src/components/FormField/FormField.figma.tsx +23 -0
- package/src/components/Helper/HelperText.figma.tsx +23 -0
- package/src/components/HighlightBanner/HighlightBanner.docs.mdx +73 -42
- package/src/components/HighlightBanner/HighlightBanner.props.ts +2 -3
- package/src/components/HighlightBanner/HighlightBanner.stories.tsx +85 -60
- package/src/components/HighlightBanner/HighlightBanner.tsx +3 -10
- package/src/components/HighlightBanner/HighlightBannerImage.tsx +20 -0
- package/src/components/HighlightBanner/index.ts +1 -0
- package/src/components/IconButton/IconButton.figma.tsx +55 -161
- package/src/components/IconContainer/IconContainer.figma.tsx +50 -0
- package/src/components/InlineLink/InlineLink.figma.tsx +33 -0
- package/src/components/Input/Input.figma.tsx +52 -110
- package/src/components/Input/Input.stories.tsx +76 -3
- package/src/components/Input/Input.tsx +110 -98
- package/src/components/Input/InputField.tsx +27 -26
- package/src/components/Label/Label.figma.tsx +24 -0
- package/src/components/Link/Link.figma.tsx +42 -0
- package/src/components/List/List.docs.mdx +15 -9
- package/src/components/List/List.figma.tsx +29 -108
- package/src/components/List/List.stories.tsx +2 -2
- package/src/components/List/ListAction/ListAction.figma.tsx +29 -0
- package/src/components/List/ListItem/ListItem.figma.tsx +40 -220
- package/src/components/List/ListItem/ListItem.props.ts +2 -2
- package/src/components/List/ListItem/ListItemLeadingContent.figma.tsx +29 -0
- package/src/components/List/ListItem/ListItemRoot.tsx +2 -3
- package/src/components/List/ListItem/ListItemTrailingContent.figma.tsx +27 -0
- package/src/components/Menu/Menu.figma.tsx +30 -0
- package/src/components/Menu/MenuItem.figma.tsx +31 -0
- package/src/components/Modal/Modal.docs.mdx +16 -4
- package/src/components/Modal/Modal.figma.tsx +56 -0
- package/src/components/Modal/Modal.props.ts +3 -2
- package/src/components/Modal/Modal.stories.tsx +2 -5
- package/src/components/Modal/Modal.tsx +2 -6
- package/src/components/Modal/Modal.web.tsx +2 -6
- package/src/components/Modal/ModalImage.tsx +20 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/PillGroup/Pill.figma.tsx +25 -0
- package/src/components/PillGroup/Pill.tsx +3 -3
- package/src/components/PillGroup/PillGroup.figma.tsx +21 -0
- package/src/components/PillGroup/PillGroup.stories.tsx +1 -1
- package/src/components/ProgressStepper/ProgressStep.figma.tsx +30 -0
- package/src/components/ProgressStepper/ProgressStepper.figma.tsx +20 -0
- package/src/components/Radio/Radio.docs.mdx +21 -8
- package/src/components/Radio/Radio.figma.tsx +22 -42
- package/src/components/Radio/Radio.props.ts +3 -3
- package/src/components/Radio/Radio.stories.tsx +15 -11
- package/src/components/Radio/Radio.tsx +1 -2
- package/src/components/Radio/RadioGroup.figma.tsx +54 -0
- package/src/components/Radio/RadioImage.figma.tsx +27 -0
- package/src/components/Radio/RadioImage.tsx +8 -3
- package/src/components/Radio/RadioIndicator.tsx +3 -3
- package/src/components/Radio/RadioTileRoot.figma.tsx +31 -0
- package/src/components/RadioCard/RadioCardIndicator.tsx +3 -3
- package/src/components/RadioCard/RadioCardRoot.tsx +3 -3
- package/src/components/SectionHeader/SectionHeader.figma.tsx +30 -16
- package/src/components/Select/Select.figma.tsx +55 -0
- package/src/components/Select/SelectOption.figma.tsx +36 -0
- package/src/components/Spinner/Spinner.figma.tsx +20 -12
- package/src/components/Switch/Switch.figma.tsx +31 -23
- package/src/components/Tabs/Tab.tsx +5 -5
- package/src/components/Tabs/Tabs.figma.tsx +29 -0
- package/src/components/ThemedImage/ThemedImage.stories.tsx +1 -1
- package/src/components/Toast/ToastItem.figma.tsx +22 -0
- package/src/components/ToggleButton/ToggleButtonRoot.tsx +2 -2
- package/src/components/ToggleButtonCard/ToggleButtonCardRoot.tsx +3 -3
- package/src/components/UnstyledIconButton/UnstyledIconButton.figma.tsx +49 -0
- package/src/components/UnstyledIconButton/UnstyledIconButtonRoot.tsx +1 -1
- package/src/components/VerificationInput/VerificationInput.docs.mdx +68 -0
- package/src/components/VerificationInput/VerificationInput.props.ts +52 -0
- package/src/components/VerificationInput/VerificationInput.stories.tsx +140 -0
- package/src/components/VerificationInput/VerificationInput.tsx +89 -0
- package/src/components/VerificationInput/VerificationInputSlot.tsx +94 -0
- package/src/components/VerificationInput/index.ts +5 -0
- package/src/components/VerificationInput/useVerificationInput.ts +72 -0
- package/src/components/index.ts +1 -0
- package/src/utils/index.ts +2 -1
- package/src/utils/isThemedImageProps.ts +8 -0
- package/src/components/Checkbox/CheckboxIndicator.figma.tsx +0 -19
- 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 = ({
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
40
|
-
},
|
|
38
|
+
// '_focus-within': {
|
|
39
|
+
// ...theme.helpers.focusVisible,
|
|
40
|
+
// },
|
|
41
41
|
_active: {
|
|
42
42
|
outlineColor: theme.components.radio.outlineColorActive,
|
|
43
43
|
},
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react"
|
|
2
|
+
import SectionHeader from "./SectionHeader"
|
|
3
|
+
import figma from "@figma/code-connect"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
|
|
14
|
+
"https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A195",
|
|
8
15
|
{
|
|
9
16
|
props: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: (
|
|
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
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
|
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
|
},
|
|
@@ -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
|
+
);
|
|
@@ -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
|
+
|