@utilitywarehouse/hearth-react-native 0.28.0 → 0.28.1
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 +11 -11
- package/CHANGELOG.md +6 -0
- package/build/components/Select/Select.d.ts +1 -1
- package/build/components/Select/Select.js +4 -4
- package/build/components/Select/Select.props.d.ts +4 -0
- package/build/components/Select/SelectOption.d.ts +1 -1
- package/build/components/Select/SelectOption.js +2 -2
- package/build/components/VerificationInput/VerificationInput.js +3 -3
- package/docs/all-components.mdx +2 -2
- package/docs/changelog.mdx +172 -1
- package/docs/components/AllComponents.web.tsx +65 -125
- package/docs/components/NextPrevPage.tsx +28 -44
- package/docs/components/index.ts +1 -0
- package/docs/getting-started.mdx +3 -3
- package/docs/hooks.mdx +2 -2
- package/docs/introduction.mdx +1 -1
- package/docs/layout-components.docs.mdx +11 -2
- package/docs/styling.mdx +3 -3
- package/package.json +2 -2
- package/scripts/copyChangelog.js +8 -1
- package/src/components/Banner/Banner.docs.mdx +2 -1
- package/src/components/Center/Center.docs.mdx +6 -5
- package/src/components/Checkbox/Checkbox.docs.mdx +2 -1
- package/src/components/CurrencyInput/CurrencyInput.docs.mdx +2 -1
- package/src/components/HighlightBanner/HighlightBanner.docs.mdx +2 -1
- package/src/components/Input/Input.docs.mdx +2 -1
- package/src/components/Menu/Menu.docs.mdx +2 -1
- package/src/components/Modal/Modal.docs.mdx +2 -1
- package/src/components/Radio/Radio.docs.mdx +2 -1
- package/src/components/Select/Select.docs.mdx +2 -1
- package/src/components/Select/Select.props.ts +4 -0
- package/src/components/Select/Select.tsx +5 -1
- package/src/components/Select/SelectOption.tsx +2 -0
- package/src/components/Switch/Switch.docs.mdx +3 -2
- package/src/components/VerificationInput/VerificationInput.tsx +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChevronLeftSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import StorybookLink from '../../../../shared/storybook/StorybookLink';
|
|
3
4
|
import { Card, CardPressHandler, Heading, Link } from '../../src';
|
|
4
|
-
import { addReactNativePrefix } from '../heplers';
|
|
5
5
|
|
|
6
6
|
type NextPrevPageProps = {
|
|
7
7
|
nextLink?: string;
|
|
@@ -15,49 +15,33 @@ const NextPrevPage: React.FC<NextPrevPageProps> = ({
|
|
|
15
15
|
nextTitle,
|
|
16
16
|
prevLink,
|
|
17
17
|
prevTitle,
|
|
18
|
-
}) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</CardPressHandler>
|
|
46
|
-
</Card>
|
|
47
|
-
)}
|
|
48
|
-
<div />
|
|
49
|
-
{!!nextLink && (
|
|
50
|
-
<Card gap="100" alignItems="flex-start">
|
|
51
|
-
{!!nextTitle && <Heading size="sm">{nextTitle}</Heading>}
|
|
52
|
-
<CardPressHandler>
|
|
53
|
-
<Link onPress={() => openLink(nextLink)}>Next Page</Link>
|
|
54
|
-
</CardPressHandler>
|
|
55
|
-
</Card>
|
|
56
|
-
)}
|
|
57
|
-
</View>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
18
|
+
}) => (
|
|
19
|
+
<div className="sb-unstyled">
|
|
20
|
+
<View style={styles.container}>
|
|
21
|
+
{!!prevLink && (
|
|
22
|
+
<Card gap="100" alignItems="flex-start">
|
|
23
|
+
{!!prevTitle && <Heading size="sm">{prevTitle}</Heading>}
|
|
24
|
+
<CardPressHandler>
|
|
25
|
+
<StorybookLink as={Link} to={prevLink} iconPosition="left" icon={ChevronLeftSmallIcon}>
|
|
26
|
+
Prev Page
|
|
27
|
+
</StorybookLink>
|
|
28
|
+
</CardPressHandler>
|
|
29
|
+
</Card>
|
|
30
|
+
)}
|
|
31
|
+
<div />
|
|
32
|
+
{!!nextLink && (
|
|
33
|
+
<Card gap="100" alignItems="flex-start">
|
|
34
|
+
{!!nextTitle && <Heading size="sm">{nextTitle}</Heading>}
|
|
35
|
+
<CardPressHandler>
|
|
36
|
+
<StorybookLink as={Link} to={nextLink}>
|
|
37
|
+
Next Page
|
|
38
|
+
</StorybookLink>
|
|
39
|
+
</CardPressHandler>
|
|
40
|
+
</Card>
|
|
41
|
+
)}
|
|
42
|
+
</View>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
61
45
|
|
|
62
46
|
const styles = StyleSheet.create({
|
|
63
47
|
container: {
|
package/docs/components/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as StorybookLink } from '../../../../shared/storybook/StorybookLink';
|
|
1
2
|
export { default as AdvancedInputExample } from './AdvancedInputExample';
|
|
2
3
|
export { default as BackToTopButton } from './BackToTopButton';
|
|
3
4
|
export { default as BadgeList } from './BadgeList';
|
package/docs/getting-started.mdx
CHANGED
|
@@ -67,8 +67,8 @@ const App: React.FC = () => {
|
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
<NextPrevPage
|
|
70
|
-
prevLink="
|
|
70
|
+
prevLink="introduction"
|
|
71
71
|
prevTitle="Introduction"
|
|
72
|
-
nextLink="
|
|
73
|
-
nextTitle="
|
|
72
|
+
nextLink="changelog"
|
|
73
|
+
nextTitle="Changelog"
|
|
74
74
|
/>
|
package/docs/hooks.mdx
CHANGED
|
@@ -519,8 +519,8 @@ function ResponsiveGrid({ items }) {
|
|
|
519
519
|
```
|
|
520
520
|
|
|
521
521
|
<NextPrevPage
|
|
522
|
-
prevLink="
|
|
522
|
+
prevLink="theme-tokens"
|
|
523
523
|
prevTitle="Theme Tokens"
|
|
524
|
-
nextLink="
|
|
524
|
+
nextLink="layout-components"
|
|
525
525
|
nextTitle="Layout Components"
|
|
526
526
|
/>
|
package/docs/introduction.mdx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ArgTypes, Canvas, Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import StorybookLink from '../../../shared/storybook/StorybookLink';
|
|
2
3
|
import * as BoxStories from '../src/components/Box/Box.stories';
|
|
3
4
|
import * as ContainerStories from '../src/components/Container/Container.stories';
|
|
4
5
|
import * as FlexStories from '../src/components/Flex/Flex.stories';
|
|
@@ -28,6 +29,8 @@ apply design decisions coherently.
|
|
|
28
29
|
size and colour to elements. It can be used to control behaviour of child
|
|
29
30
|
elements within `Flex` and `Grid` containers.
|
|
30
31
|
|
|
32
|
+
You can view the <StorybookLink to="primitives-box">`Box` docs here</StorybookLink>.
|
|
33
|
+
|
|
31
34
|
```tsx
|
|
32
35
|
<Box
|
|
33
36
|
padding="400"
|
|
@@ -47,6 +50,8 @@ spacing using the design system's responsive layout tokens. It automatically app
|
|
|
47
50
|
appropriate margin and padding based on the current breakpoint, making it ideal for
|
|
48
51
|
wrapping page content or major sections.
|
|
49
52
|
|
|
53
|
+
You can view the <StorybookLink to="primitives-container">`Container` docs here</StorybookLink>.
|
|
54
|
+
|
|
50
55
|
```tsx
|
|
51
56
|
<Container spacing="lg">
|
|
52
57
|
<Box>{...}</Box>
|
|
@@ -74,6 +79,8 @@ the convenience of the component:
|
|
|
74
79
|
component is useful for defining layouts along an axis, and replaces the `HStack` and `VStack`
|
|
75
80
|
component you may have used in other libraries.
|
|
76
81
|
|
|
82
|
+
You can view the <StorybookLink to="primitives-flex">`Flex` docs here</StorybookLink>.
|
|
83
|
+
|
|
77
84
|
```tsx
|
|
78
85
|
<Flex
|
|
79
86
|
padding="400"
|
|
@@ -95,6 +102,8 @@ styling props, and to all the properties needed to build a grid layout.
|
|
|
95
102
|
|
|
96
103
|
You can easily build responsive layouts using Design System defaults.
|
|
97
104
|
|
|
105
|
+
You can view the <StorybookLink to="primitives-grid">`Grid` docs here</StorybookLink>.
|
|
106
|
+
|
|
98
107
|
```tsx
|
|
99
108
|
<Grid columns={2} spacing="md">
|
|
100
109
|
<Box>{...}</Box>
|
|
@@ -104,8 +113,8 @@ You can easily build responsive layouts using Design System defaults.
|
|
|
104
113
|
```
|
|
105
114
|
|
|
106
115
|
<NextPrevPage
|
|
107
|
-
prevLink="
|
|
116
|
+
prevLink="hooks"
|
|
108
117
|
prevTitle="Hooks"
|
|
109
|
-
nextLink="
|
|
118
|
+
nextLink="all-components"
|
|
110
119
|
nextTitle="All Components"
|
|
111
120
|
/>
|
package/docs/styling.mdx
CHANGED
|
@@ -876,8 +876,8 @@ const styles = StyleSheet.create(theme => ({
|
|
|
876
876
|
By following these patterns and using the design tokens provided by Hearth React Native, you'll create consistent, maintainable, and accessible user interfaces that work seamlessly across different platforms and screen sizes.
|
|
877
877
|
|
|
878
878
|
<NextPrevPage
|
|
879
|
-
prevLink="
|
|
880
|
-
prevTitle="
|
|
881
|
-
nextLink="
|
|
879
|
+
prevLink="changelog"
|
|
880
|
+
prevTitle="Changelog"
|
|
881
|
+
nextLink="theme-tokens"
|
|
882
882
|
nextTitle="Theme Tokens"
|
|
883
883
|
/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"vite-plugin-svgr": "^4.5.0",
|
|
58
58
|
"vitest": "^3.2.4",
|
|
59
59
|
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
60
|
+
"@utilitywarehouse/hearth-react-native-icons": "^0.8.0",
|
|
60
61
|
"@utilitywarehouse/hearth-react-icons": "^0.8.0",
|
|
61
62
|
"@utilitywarehouse/hearth-svg-assets": "^0.5.0",
|
|
62
|
-
"@utilitywarehouse/hearth-react-native-icons": "^0.8.0",
|
|
63
63
|
"@utilitywarehouse/hearth-tokens": "^0.2.4"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
package/scripts/copyChangelog.js
CHANGED
|
@@ -29,7 +29,7 @@ changelogContent = changelogContent.split('\n').slice(1).join('\n');
|
|
|
29
29
|
|
|
30
30
|
// Create the MDX content with imports and components
|
|
31
31
|
const mdxContent = `import { Meta } from '@storybook/addon-docs/blocks';
|
|
32
|
-
import { BackToTopButton } from './components';
|
|
32
|
+
import { BackToTopButton, NextPrevPage } from './components';
|
|
33
33
|
|
|
34
34
|
<Meta title="Changelog" />
|
|
35
35
|
<BackToTopButton />
|
|
@@ -39,6 +39,13 @@ import { BackToTopButton } from './components';
|
|
|
39
39
|
The changelog for the Hearth React Native library. Here you can find all the changes, improvements, and bug fixes for each version.
|
|
40
40
|
|
|
41
41
|
${changelogContent}
|
|
42
|
+
|
|
43
|
+
<NextPrevPage
|
|
44
|
+
prevLink="getting-started"
|
|
45
|
+
prevTitle="Getting Started"
|
|
46
|
+
nextLink="styling"
|
|
47
|
+
nextTitle="Styling"
|
|
48
|
+
/>
|
|
42
49
|
`;
|
|
43
50
|
|
|
44
51
|
// Write the new MDX file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { ElectricityMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import { Banner, Button, Center, Link } from '../../';
|
|
4
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
4
5
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
5
6
|
import * as Stories from './Banner.stories';
|
|
6
7
|
|
|
@@ -94,7 +95,7 @@ The `BannerImage` & `BannerIllustration` component can be used to display an ima
|
|
|
94
95
|
| `dark` | `ImageSourcePropType` | The source of the image to display in dark mode (use instead of source) |
|
|
95
96
|
| `...rest` | `ImageProps` | Additional props to pass to the underlying Image component |
|
|
96
97
|
|
|
97
|
-
For more details about the ThemedImage component used internally, refer to the
|
|
98
|
+
For more details about the ThemedImage component used internally, refer to the <StorybookLink to="utility-components-themed-image">`ThemedImage` documentation</StorybookLink>.
|
|
98
99
|
|
|
99
100
|
## Layout Options
|
|
100
101
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Stories from './Center.stories';
|
|
3
|
-
import { Center, Pressable, Box, BodyText } from '../..';
|
|
4
|
-
import { UsageWrap, BackToTopButton, ViewFigmaButton } from '../../../docs/components';
|
|
1
|
+
import { Canvas, Controls, Meta, Primary, Story } from '@storybook/addon-docs/blocks';
|
|
5
2
|
import { color } from '@utilitywarehouse/hearth-tokens';
|
|
3
|
+
import { BodyText, Box, Center, Pressable } from '../..';
|
|
4
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
5
|
+
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
6
|
+
import * as Stories from './Center.stories';
|
|
6
7
|
|
|
7
8
|
<Meta title="Primitives / Center" />
|
|
8
9
|
|
|
@@ -38,4 +39,4 @@ const MyComponent = () => (
|
|
|
38
39
|
|
|
39
40
|
## Props
|
|
40
41
|
|
|
41
|
-
The `Center` component extends the
|
|
42
|
+
The `Center` component extends the <StorybookLink to="components-box">`Box`</StorybookLink> component, so it has all the same props as <StorybookLink to="components-box">`Box`</StorybookLink>.
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
CheckboxTile,
|
|
11
11
|
FormField,
|
|
12
12
|
} from '../../';
|
|
13
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
13
14
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
14
15
|
import * as Stories from './Checkbox.stories';
|
|
15
16
|
|
|
@@ -219,7 +220,7 @@ const MyComponent = () => {
|
|
|
219
220
|
| `dark` | `ImageSourcePropType` | The source of the image to display in dark mode (use instead of source) |
|
|
220
221
|
| `...rest` | `ImageProps` | Additional props to pass to the underlying Image component |
|
|
221
222
|
|
|
222
|
-
For more details about the ThemedImage component used internally, refer to the
|
|
223
|
+
For more details about the ThemedImage component used internally, refer to the <StorybookLink to="utility-components-themed-image">`ThemedImage` documentation</StorybookLink>.
|
|
223
224
|
|
|
224
225
|
The `CheckboxImage` component is used to display an image next to the checkbox label. It inherits all the properties of React Native's `Image` component.
|
|
225
226
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { Center, CurrencyInput, FormField } from '../../';
|
|
3
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
3
4
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
4
5
|
import * as Stories from './CurrencyInput.stories';
|
|
5
6
|
|
|
@@ -108,7 +109,7 @@ const MyComponent = () => {
|
|
|
108
109
|
### With `FormField`
|
|
109
110
|
|
|
110
111
|
The `CurrencyInput` component can be used with the `FormField` component to create a custom input field.
|
|
111
|
-
For more information on the `FormField` component view the
|
|
112
|
+
For more information on the `FormField` component view the <StorybookLink to="forms-form-field">`FormField` documentation</StorybookLink>.
|
|
112
113
|
|
|
113
114
|
<UsageWrap>
|
|
114
115
|
<Center>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { Button, Center, HighlightBanner, HighlightBannerImage, Link } from '../../';
|
|
3
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
3
4
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
4
5
|
import * as Stories from './HighlightBanner.stories';
|
|
5
6
|
|
|
@@ -96,7 +97,7 @@ The `HighlightBannerImage` component can be used to display an image within the
|
|
|
96
97
|
| `dark` | `ImageSourcePropType` | The source of the image to display in dark mode (use instead of source) |
|
|
97
98
|
| `...rest` | `ImageProps` | Additional props to pass to the underlying Image component |
|
|
98
99
|
|
|
99
|
-
For more details about the ThemedImage component used internally, refer to the
|
|
100
|
+
For more details about the ThemedImage component used internally, refer to the <StorybookLink to="utility-components-themed-image">`ThemedImage` documentation</StorybookLink>.
|
|
100
101
|
|
|
101
102
|
## Variants
|
|
102
103
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { EmailMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import { Center, FormField, Input, InputField, InputIcon, InputSlot, Pressable } from '../../';
|
|
4
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
4
5
|
import {
|
|
5
6
|
AdvancedInputExample,
|
|
6
7
|
BackToTopButton,
|
|
@@ -276,7 +277,7 @@ const MyComponent = () => {
|
|
|
276
277
|
### With `FormField`
|
|
277
278
|
|
|
278
279
|
The `Input` component can be used with the `FormField` component to create a custom input field.
|
|
279
|
-
For more information on the `FormField`
|
|
280
|
+
For more information on the `FormField` component view the <StorybookLink to="forms-form-field">`FormField` documentation</StorybookLink>.
|
|
280
281
|
|
|
281
282
|
<UsageWrap>
|
|
282
283
|
<Center>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
2
3
|
import { BackToTopButton, ViewFigmaButton } from '../../../docs/components';
|
|
3
4
|
import * as Stories from './Menu.stories';
|
|
4
5
|
|
|
@@ -74,7 +75,7 @@ const MyComponent = () => {
|
|
|
74
75
|
|
|
75
76
|
The rest of the props are passed down to the underlying `BottomSheetModal` component, so you can use any of its
|
|
76
77
|
props for additional configuration (e.g. `snapPoints`, `backgroundStyle`, etc.).
|
|
77
|
-
See the
|
|
78
|
+
See the <StorybookLink to="components-bottomsheet">`BottomSheetModal` documentation</StorybookLink> for more details.
|
|
78
79
|
|
|
79
80
|
### MenuItem
|
|
80
81
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { BodyText, BottomSheetModal, Box, Button, Center, Heading, Modal } from '../../';
|
|
3
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
3
4
|
import modalAndroidVideo from '../../../docs/assets/modal-android.mp4';
|
|
4
5
|
import modaliOSVideo from '../../../docs/assets/modal-ios.mp4';
|
|
5
6
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
@@ -125,7 +126,7 @@ The `ModalImage` component can be used to display an image within the Modal. It
|
|
|
125
126
|
| `dark` | `ImageSourcePropType` | The source of the image to display in dark mode (use instead of source) |
|
|
126
127
|
| `...rest` | `ImageProps` | Additional props to pass to the underlying Image component |
|
|
127
128
|
|
|
128
|
-
For more details about the ThemedImage component used internally, refer to the
|
|
129
|
+
For more details about the ThemedImage component used internally, refer to the <StorybookLink to="utility-components-themed-image">`ThemedImage` documentation</StorybookLink>.
|
|
129
130
|
|
|
130
131
|
## Features
|
|
131
132
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
RadioLabel,
|
|
12
12
|
RadioTile,
|
|
13
13
|
} from '../../';
|
|
14
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
14
15
|
import mastercardLogo from '../../../docs/assets/bank-logo.png';
|
|
15
16
|
import visaLogo from '../../../docs/assets/bank-logo1.png';
|
|
16
17
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
@@ -159,7 +160,7 @@ Contains all Group related layout style props and actions. It inherits all the p
|
|
|
159
160
|
| `dark` | `ImageSourcePropType` | The source of the image to display in dark mode (use instead of source) |
|
|
160
161
|
| `...rest` | `ImageProps` | Additional props to pass to the underlying Image component |
|
|
161
162
|
|
|
162
|
-
For more details about the ThemedImage component used internally, refer to the
|
|
163
|
+
For more details about the ThemedImage component used internally, refer to the <StorybookLink to="utility-components-themed-image">`ThemedImage` documentation</StorybookLink>.
|
|
163
164
|
|
|
164
165
|
Contains all Image related layout style props and actions. It inherits all the properties of React Native's [Image component](https://reactnative.dev/docs/image).
|
|
165
166
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { UserSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import { Center, FormField, Select, SelectOption } from '../../';
|
|
4
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
4
5
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
5
6
|
import * as Stories from './Select.stories';
|
|
6
7
|
|
|
@@ -164,7 +165,7 @@ const MyComponent = () => {
|
|
|
164
165
|
### With `FormField`
|
|
165
166
|
|
|
166
167
|
The `Select` component can be used with the `FormField` component for additional functionality like validation messages and helper text.
|
|
167
|
-
For more information on the `FormField` component, view the
|
|
168
|
+
For more information on the `FormField` component, view the <StorybookLink to="forms-form-field">`FormField` documentation</StorybookLink>.
|
|
168
169
|
|
|
169
170
|
<Canvas of={Stories.WithValidationStatus} />
|
|
170
171
|
|
|
@@ -41,6 +41,7 @@ const Select = ({
|
|
|
41
41
|
listProps,
|
|
42
42
|
searchable = false,
|
|
43
43
|
searchPlaceholder = 'Search',
|
|
44
|
+
testID,
|
|
44
45
|
...rest
|
|
45
46
|
}: SelectProps) => {
|
|
46
47
|
const formFieldContext = useFormFieldContext();
|
|
@@ -110,9 +111,10 @@ const Select = ({
|
|
|
110
111
|
disabled={item.disabled}
|
|
111
112
|
leadingIcon={item.leadingIcon}
|
|
112
113
|
trailingIcon={item.trailingIcon}
|
|
114
|
+
testID={testID ? `${testID}-option-${item.label}` : undefined}
|
|
113
115
|
/>
|
|
114
116
|
),
|
|
115
|
-
[]
|
|
117
|
+
[testID]
|
|
116
118
|
);
|
|
117
119
|
|
|
118
120
|
const renderEmptyComponent = useCallback(
|
|
@@ -141,6 +143,7 @@ const Select = ({
|
|
|
141
143
|
<Pressable
|
|
142
144
|
onPress={openBottomSheet}
|
|
143
145
|
disabled={isDisabled || isReadonly}
|
|
146
|
+
testID={testID}
|
|
144
147
|
style={({ pressed }) => [
|
|
145
148
|
styles.selectContainer,
|
|
146
149
|
styles.pressedContainer(pressed || isOpen),
|
|
@@ -194,6 +197,7 @@ const Select = ({
|
|
|
194
197
|
inBottomSheet
|
|
195
198
|
onChangeText={setSearch}
|
|
196
199
|
type="search"
|
|
200
|
+
testID={testID ? `${testID}-search` : undefined}
|
|
197
201
|
/>
|
|
198
202
|
</View>
|
|
199
203
|
)}
|
|
@@ -14,6 +14,7 @@ const SelectOption = ({
|
|
|
14
14
|
selected,
|
|
15
15
|
disabled,
|
|
16
16
|
onPress,
|
|
17
|
+
testID,
|
|
17
18
|
}: SelectOptionProps) => {
|
|
18
19
|
const { selectedValue, onValueChange, close } = useSelectContext();
|
|
19
20
|
const isSelected = selected !== undefined ? selected : selectedValue === value;
|
|
@@ -38,6 +39,7 @@ const SelectOption = ({
|
|
|
38
39
|
<Pressable
|
|
39
40
|
onPress={handlePress}
|
|
40
41
|
disabled={disabled}
|
|
42
|
+
testID={testID}
|
|
41
43
|
style={({ pressed }) => [styles.container, pressed && styles.pressed]}
|
|
42
44
|
>
|
|
43
45
|
{!!LeftIcon && (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { Center, Flex, FormField, FormFieldLabel, FormFieldLabelText, Label, Switch } from '../../';
|
|
3
|
+
import StorybookLink from '../../../../../shared/storybook/StorybookLink';
|
|
3
4
|
import {
|
|
4
5
|
BackToTopButton,
|
|
5
6
|
SwitchExample,
|
|
@@ -72,7 +73,7 @@ const MyComponent = () => {
|
|
|
72
73
|
### Switch with Label
|
|
73
74
|
|
|
74
75
|
When the Switch is not placed in a List Item, you should use the `Label` component next to it. See
|
|
75
|
-
the
|
|
76
|
+
the <StorybookLink to="forms-form-field">`FormField` documentation</StorybookLink> for more information.
|
|
76
77
|
|
|
77
78
|
<UsageWrap>
|
|
78
79
|
<FormField>
|
|
@@ -109,7 +110,7 @@ const MyComponent = () => {
|
|
|
109
110
|
### List with Switch
|
|
110
111
|
|
|
111
112
|
You can also use the list to display a list of switches. You can achieve this by using the `Switch`
|
|
112
|
-
component as the `trailingContent` of the `ListItem`. See the
|
|
113
|
+
component as the `trailingContent` of the `ListItem`. See the <StorybookLink to="native-ui-components-list">`List` documentation</StorybookLink>
|
|
113
114
|
for more information.
|
|
114
115
|
|
|
115
116
|
<UsageWrap>
|
|
@@ -23,6 +23,7 @@ const VerificationInput = forwardRef<VerificationInputHandle, VerificationInputP
|
|
|
23
23
|
secureTextEntry = false,
|
|
24
24
|
autoFocus = false,
|
|
25
25
|
style,
|
|
26
|
+
testID,
|
|
26
27
|
...props
|
|
27
28
|
},
|
|
28
29
|
ref
|
|
@@ -239,6 +240,7 @@ const VerificationInput = forwardRef<VerificationInputHandle, VerificationInputP
|
|
|
239
240
|
maxLength={length}
|
|
240
241
|
caretHidden
|
|
241
242
|
style={styles.hiddenInput}
|
|
243
|
+
testID={testID}
|
|
242
244
|
/>
|
|
243
245
|
{slots.map(index => {
|
|
244
246
|
const char = displayValue[index] || '';
|
|
@@ -260,6 +262,7 @@ const VerificationInput = forwardRef<VerificationInputHandle, VerificationInputP
|
|
|
260
262
|
inputRef.current?.focus();
|
|
261
263
|
setSelectionIndex(index);
|
|
262
264
|
}}
|
|
265
|
+
testID={testID ? `${testID}-${index}` : undefined}
|
|
263
266
|
/>
|
|
264
267
|
);
|
|
265
268
|
})}
|