@utilitywarehouse/hearth-react-native 0.18.0 → 0.19.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/.storybook/preview.tsx +1 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +24 -21
- package/CHANGELOG.md +128 -0
- package/build/components/Banner/Banner.d.ts +1 -1
- package/build/components/Banner/Banner.js +24 -4
- package/build/components/Banner/Banner.props.d.ts +1 -6
- package/build/components/Box/Box.props.d.ts +5 -2
- package/build/components/Button/Button.d.ts +2 -0
- package/build/components/Button/ButtonGroupRoot.d.ts +5 -1
- package/build/components/Button/ButtonGroupRoot.js +3 -3
- package/build/components/Card/Card.context.d.ts +1 -1
- package/build/components/Card/Card.props.d.ts +2 -0
- package/build/components/Card/CardContent.js +3 -3
- package/build/components/Card/CardRoot.d.ts +1 -1
- package/build/components/Card/CardRoot.js +14 -4
- package/build/components/Checkbox/CheckboxGroupTextContent.js +1 -1
- package/build/components/Checkbox/CheckboxTextContent.js +1 -1
- package/build/components/Container/Container.d.ts +1 -1
- package/build/components/Container/Container.js +3 -3
- package/build/components/Container/Container.props.d.ts +5 -0
- package/build/components/Divider/Divider.d.ts +1 -1
- package/build/components/Divider/Divider.js +19 -19
- package/build/components/Divider/Divider.props.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardExpandedContent.js +1 -1
- package/build/components/Flex/Flex.d.ts +1 -1
- package/build/components/Flex/Flex.js +3 -3
- package/build/components/Flex/Flex.props.d.ts +5 -0
- package/build/components/Grid/Grid.d.ts +1 -1
- package/build/components/Grid/Grid.js +4 -4
- package/build/components/Grid/Grid.props.d.ts +5 -0
- package/build/components/Menu/Menu.d.ts +1 -1
- package/build/components/Menu/Menu.js +2 -2
- package/build/components/Menu/Menu.props.d.ts +2 -6
- package/build/components/Modal/Modal.d.ts +1 -1
- package/build/components/Modal/Modal.js +16 -6
- package/build/components/Modal/Modal.props.d.ts +1 -0
- package/build/components/Modal/Modal.web.d.ts +1 -1
- package/build/components/Modal/Modal.web.js +2 -2
- package/build/components/Radio/RadioGroupTextContent.js +1 -1
- package/build/components/Radio/RadioTextContent.js +1 -1
- package/build/components/Toast/Toast.context.d.ts +2 -4
- package/build/components/Toast/Toast.context.js +14 -2
- package/build/components/Toast/Toast.props.d.ts +4 -0
- package/build/components/Toast/ToastItem.js +5 -2
- package/build/components/VerificationInput/VerificationInput.d.ts +2 -5
- package/build/components/VerificationInput/VerificationInput.js +20 -7
- package/build/components/VerificationInput/VerificationInput.props.d.ts +10 -0
- package/build/components/VerificationInput/index.d.ts +1 -1
- package/build/components/VerificationInput/useVerificationInput.d.ts +1 -0
- package/build/components/VerificationInput/useVerificationInput.js +24 -9
- package/build/core/themes.d.ts +4 -4
- package/build/core/themes.js +1 -1
- package/build/types/values.d.ts +1 -1
- package/docs/changelog.mdx +687 -0
- package/docs/components/AllComponents.web.tsx +9 -9
- package/docs/layout-components.docs.mdx +3 -3
- package/package.json +7 -7
- package/scripts/copyChangelog.js +50 -0
- package/src/components/Alert/Alert.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +4 -5
- package/src/components/Badge/Badge.stories.tsx +3 -3
- package/src/components/Banner/Banner.docs.mdx +1 -1
- package/src/components/Banner/Banner.props.ts +13 -20
- package/src/components/Banner/Banner.stories.tsx +83 -15
- package/src/components/Banner/Banner.tsx +27 -3
- package/src/components/Box/Box.props.ts +11 -4
- package/src/components/Button/Button.docs.mdx +2 -2
- package/src/components/Button/Button.stories.tsx +4 -4
- package/src/components/Button/ButtonGroupRoot.tsx +8 -3
- package/src/components/Card/Card.context.ts +1 -1
- package/src/components/Card/Card.docs.mdx +1 -1
- package/src/components/Card/Card.props.ts +2 -0
- package/src/components/Card/Card.stories.tsx +9 -9
- package/src/components/Card/CardAction/CardAction.stories.tsx +2 -2
- package/src/components/Card/CardContent.tsx +3 -3
- package/src/components/Card/CardRoot.tsx +15 -5
- package/src/components/Checkbox/CheckboxGroupTextContent.tsx +2 -2
- package/src/components/Checkbox/CheckboxTextContent.tsx +1 -1
- package/src/components/Container/Container.docs.mdx +2 -2
- package/src/components/Container/Container.props.ts +5 -0
- package/src/components/Container/Container.stories.tsx +2 -2
- package/src/components/Container/Container.tsx +3 -3
- package/src/components/CurrencyInput/CurrencyInput.docs.mdx +1 -1
- package/src/components/CurrencyInput/CurrencyInput.stories.tsx +2 -2
- package/src/components/DateInput/DateInput.stories.tsx +3 -3
- package/src/components/DatePickerInput/DatePickerInput.stories.tsx +1 -1
- package/src/components/DescriptionList/DescriptionList.stories.tsx +1 -1
- package/src/components/Divider/Divider.docs.mdx +6 -6
- package/src/components/Divider/Divider.props.ts +6 -0
- package/src/components/Divider/Divider.tsx +19 -18
- package/src/components/ExpandableCard/ExpandableCardExpandedContent.tsx +1 -1
- package/src/components/Flex/Flex.docs.mdx +3 -3
- package/src/components/Flex/Flex.props.ts +5 -0
- package/src/components/Flex/Flex.stories.tsx +2 -2
- package/src/components/Flex/Flex.tsx +4 -3
- package/src/components/FormField/FormField.docs.mdx +1 -1
- package/src/components/FormField/FormField.stories.tsx +1 -1
- package/src/components/Grid/Grid.docs.mdx +5 -5
- package/src/components/Grid/Grid.props.ts +6 -0
- package/src/components/Grid/Grid.stories.tsx +8 -8
- package/src/components/Grid/Grid.tsx +4 -3
- package/src/components/HighlightBanner/HighlightBanner.docs.mdx +1 -1
- package/src/components/HighlightBanner/HighlightBanner.stories.tsx +2 -2
- package/src/components/Icon/Icon.docs.mdx +3 -3
- package/src/components/IconButton/IconButton.stories.tsx +5 -5
- package/src/components/IconContainer/IconContainer.docs.mdx +1 -1
- package/src/components/IconContainer/IconContainer.stories.tsx +3 -3
- package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +17 -9
- package/src/components/InlineLink/InlineLink.stories.tsx +2 -2
- package/src/components/Input/Input.stories.tsx +4 -4
- package/src/components/List/List.stories.tsx +1 -1
- package/src/components/Menu/Menu.docs.mdx +8 -5
- package/src/components/Menu/Menu.figma.tsx +27 -27
- package/src/components/Menu/Menu.props.ts +2 -6
- package/src/components/Menu/Menu.tsx +3 -6
- package/src/components/Menu/MenuItem.figma.tsx +26 -18
- package/src/components/Modal/Modal.docs.mdx +22 -21
- package/src/components/Modal/Modal.figma.tsx +58 -47
- package/src/components/Modal/Modal.props.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +4 -0
- package/src/components/Modal/Modal.tsx +20 -5
- package/src/components/Modal/Modal.web.tsx +2 -1
- package/src/components/PillGroup/PillGroup.stories.tsx +7 -7
- package/src/components/ProgressStepper/ProgressStepper.stories.tsx +7 -8
- package/src/components/Radio/Radio.stories.tsx +1 -1
- package/src/components/Radio/RadioGroup.stories.tsx +1 -1
- package/src/components/Radio/RadioGroupTextContent.tsx +2 -2
- package/src/components/Radio/RadioTextContent.tsx +1 -1
- package/src/components/SectionHeader/SectionHeader.stories.tsx +1 -1
- package/src/components/Switch/Switch.docs.mdx +8 -8
- package/src/components/Switch/Switch.stories.tsx +2 -2
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Textarea/Textarea.docs.mdx +3 -3
- package/src/components/Toast/Toast.context.tsx +24 -3
- package/src/components/Toast/Toast.props.ts +5 -0
- package/src/components/Toast/Toast.stories.tsx +29 -0
- package/src/components/Toast/ToastItem.tsx +7 -2
- package/src/components/UnstyledIconButton/UnstyledIconButton.stories.tsx +5 -5
- package/src/components/VerificationInput/VerificationInput.docs.mdx +31 -8
- package/src/components/VerificationInput/VerificationInput.props.ts +11 -0
- package/src/components/VerificationInput/VerificationInput.stories.tsx +79 -3
- package/src/components/VerificationInput/VerificationInput.tsx +94 -62
- package/src/components/VerificationInput/index.ts +4 -2
- package/src/components/VerificationInput/useVerificationInput.ts +26 -10
- package/src/core/themes.ts +1 -1
- package/src/types/values.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
3
|
import { BodyText } from '../BodyText';
|
|
4
|
-
import { BottomSheetModal,
|
|
4
|
+
import { BottomSheetModal, BottomSheetScrollView } from '../BottomSheet';
|
|
5
5
|
import { MenuContext } from './Menu.context';
|
|
6
6
|
import type MenuProps from './Menu.props';
|
|
7
7
|
import type { MenuMethods } from './Menu.props';
|
|
8
8
|
|
|
9
|
-
const Menu = forwardRef<MenuMethods, MenuProps>(({ heading, children,
|
|
9
|
+
const Menu = forwardRef<MenuMethods, MenuProps>(({ heading, children, ...props }, ref) => {
|
|
10
10
|
const bottomSheetModalRef = useRef<BottomSheetModal>(null);
|
|
11
11
|
|
|
12
12
|
useImperativeHandle(
|
|
@@ -25,10 +25,7 @@ const Menu = forwardRef<MenuMethods, MenuProps>(({ heading, children, bottomShee
|
|
|
25
25
|
const contextValue = useMemo(() => ({ close: handleClose }), [handleClose]);
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
|
-
<BottomSheetModal
|
|
29
|
-
ref={bottomSheetModalRef}
|
|
30
|
-
{...(bottomSheetProps as Partial<BottomSheetProps>)}
|
|
31
|
-
>
|
|
28
|
+
<BottomSheetModal ref={bottomSheetModalRef} {...props}>
|
|
32
29
|
<BottomSheetScrollView contentContainerStyle={styles.container}>
|
|
33
30
|
<MenuContext.Provider value={contextValue}>
|
|
34
31
|
{heading && (
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
|
-
import MenuItem from '
|
|
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 { MenuItem } from '../';
|
|
10
3
|
|
|
11
4
|
figma.connect(
|
|
12
5
|
MenuItem,
|
|
13
|
-
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=3253-8193',
|
|
14
7
|
{
|
|
15
8
|
props: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
text: figma.string('Text'),
|
|
10
|
+
icon: figma.boolean('Icon left?', {
|
|
11
|
+
true: figma.instance('Icon left-20'),
|
|
12
|
+
false: figma.boolean('Icon right?', {
|
|
13
|
+
true: figma.instance('Icon right-20'),
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
iconPosition: figma.boolean('Icon left?', {
|
|
17
|
+
true: 'left',
|
|
18
|
+
false: figma.boolean('Icon right?', {
|
|
19
|
+
true: 'right',
|
|
20
|
+
}),
|
|
19
21
|
}),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
colorScheme: figma.enum('Color Scheme', {
|
|
23
|
+
Destructive: 'destructive',
|
|
24
|
+
}),
|
|
25
|
+
disabled: figma.enum('State', {
|
|
26
|
+
Disabled: true,
|
|
22
27
|
}),
|
|
23
|
-
// No matching props could be found for these Figma properties:
|
|
24
|
-
// "number": figma.string('Number'),
|
|
25
|
-
// "selected": figma.boolean('Selected?')
|
|
26
28
|
},
|
|
27
29
|
example: props => (
|
|
28
|
-
<MenuItem
|
|
30
|
+
<MenuItem
|
|
31
|
+
text={props.text}
|
|
32
|
+
disabled={props.disabled}
|
|
33
|
+
colorScheme={props.colorScheme}
|
|
34
|
+
icon={props.icon}
|
|
35
|
+
iconPosition={props.iconPosition}
|
|
36
|
+
/>
|
|
29
37
|
),
|
|
30
38
|
}
|
|
31
39
|
);
|
|
@@ -87,27 +87,28 @@ const MyComponent = () => {
|
|
|
87
87
|
|
|
88
88
|
The Modal component extends the `BottomSheetModal` component and accepts all of its props, plus the following additional props:
|
|
89
89
|
|
|
90
|
-
| Property | Type | Description | Default
|
|
91
|
-
| ----------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
92
|
-
| `heading` | `string` | The heading text displayed at the top of the modal | -
|
|
93
|
-
| `description` | `string` | The description text displayed below the heading | -
|
|
94
|
-
| `showCloseButton` | `boolean` | Whether to show the close button in the top-right corner | `true`
|
|
95
|
-
| `primaryButtonText` | `string` | Text for the primary action button | -
|
|
96
|
-
| `secondaryButtonText` | `string` | Text for the secondary action button | -
|
|
97
|
-
| `onPressPrimaryButton` | `() => void` | Callback function called when the primary button is pressed | -
|
|
98
|
-
| `onPressSecondaryButton` | `() => void` | Callback function called when the secondary button is pressed | -
|
|
99
|
-
| `onPressCloseButton` | `() => void` | Callback function called when the close button is pressed | -
|
|
100
|
-
| `closeOnPrimaryButtonPress` | `boolean` | Whether to automatically close the modal when the primary button is pressed | `true`
|
|
101
|
-
| `closeOnSecondaryButtonPress` | `boolean` | Whether to automatically close the modal when the secondary button is pressed | `true`
|
|
102
|
-
| `onChange` | `(index: number, position: number, `<br />` type: number) => void` | Callback function called when the modal's position changes \* | -
|
|
103
|
-
| `loading` | `boolean` | Whether to show a loading state with spinner | `false`
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
90
|
+
| Property | Type | Description | Default |
|
|
91
|
+
| ----------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
92
|
+
| `heading` | `string` | The heading text displayed at the top of the modal | - |
|
|
93
|
+
| `description` | `string` | The description text displayed below the heading | - |
|
|
94
|
+
| `showCloseButton` | `boolean` | Whether to show the close button in the top-right corner | `true` |
|
|
95
|
+
| `primaryButtonText` | `string` | Text for the primary action button | - |
|
|
96
|
+
| `secondaryButtonText` | `string` | Text for the secondary action button | - |
|
|
97
|
+
| `onPressPrimaryButton` | `() => void` | Callback function called when the primary button is pressed | - |
|
|
98
|
+
| `onPressSecondaryButton` | `() => void` | Callback function called when the secondary button is pressed | - |
|
|
99
|
+
| `onPressCloseButton` | `() => void` | Callback function called when the close button is pressed | - |
|
|
100
|
+
| `closeOnPrimaryButtonPress` | `boolean` | Whether to automatically close the modal when the primary button is pressed | `true` |
|
|
101
|
+
| `closeOnSecondaryButtonPress` | `boolean` | Whether to automatically close the modal when the secondary button is pressed | `true` |
|
|
102
|
+
| `onChange` | `(index: number, position: number, `<br />` type: number) => void` | Callback function called when the modal's position changes \* | - |
|
|
103
|
+
| `loading` | `boolean` | Whether to show a loading state with spinner | `false` |
|
|
104
|
+
| `loadingHeading` | `string` | The heading text to be displayed when loading is true. If not provided, the regular heading will be shown. | `'Loading...'` |
|
|
105
|
+
| `image` | `ImageProps` | Image to display in the modal (shows as centered content with text below) | - |
|
|
106
|
+
| `children` | `ReactNode` | Custom content to display in the modal body | - |
|
|
107
|
+
| `primaryButtonProps` | `Omit<ButtonWithoutChildrenProps, 'children'>` | Additional props to pass to the primary button (colorScheme defaults to 'highlight', variant to 'solid') | - |
|
|
108
|
+
| `secondaryButtonProps` | `Omit<ButtonWithoutChildrenProps, 'children'>` | Additional props to pass to the secondary button (colorScheme defaults to 'functional', variant to 'outline') | - |
|
|
109
|
+
| `closeButtonProps` | `Omit<UnstyledIconButtonProps, 'children'>` | Additional props to pass to the close button | - |
|
|
110
|
+
| `fullscreen` | `boolean` | Whether the modal should take up the full screen height | `false` |
|
|
111
|
+
| `inNavModal` | `boolean` | Renders the modal correctly when used inside a navigation modal | `false` |
|
|
111
112
|
|
|
112
113
|
\* use this to detect if the modal has been opened or closed, index 0 indicates open state and -1 indicates closed state
|
|
113
114
|
|
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
*/
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { useCallback, useRef } from 'react';
|
|
3
|
+
import { BottomSheetModal, Button, Modal } from '../';
|
|
11
4
|
|
|
12
5
|
figma.connect(
|
|
13
6
|
Modal,
|
|
14
|
-
|
|
7
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6300-2825',
|
|
15
8
|
{
|
|
16
9
|
props: {
|
|
17
|
-
|
|
18
|
-
loading: figma.enum("State", {
|
|
10
|
+
loading: figma.enum('State', {
|
|
19
11
|
Loading: true,
|
|
20
12
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
heading: figma.string('Heading'),
|
|
14
|
+
description: figma.string('Description'),
|
|
15
|
+
fullscreen: figma.boolean('Full screen?'),
|
|
16
|
+
showHandle: figma.boolean('Handle?'),
|
|
17
|
+
customContent: figma.boolean('Custom content?', {
|
|
18
|
+
true: figma.instance('Custom content'),
|
|
19
|
+
}),
|
|
20
|
+
buttons: figma.boolean('Buttons?', {
|
|
21
|
+
true: figma.nestedProps('Button', {
|
|
22
|
+
primaryButtonText: figma.string('Text'),
|
|
23
|
+
}),
|
|
24
24
|
}),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
close: figma.boolean('Close?'),
|
|
26
|
+
image: figma.boolean('Image?', {
|
|
27
|
+
true: figma.instance('Modal illustration'),
|
|
28
|
+
}),
|
|
29
|
+
loadingHeading: figma.string('Loading heading'),
|
|
30
|
+
},
|
|
31
|
+
example: props => {
|
|
32
|
+
const modalRef = useRef<BottomSheetModal>(null);
|
|
33
|
+
|
|
34
|
+
const handleOpenModal = useCallback(() => {
|
|
35
|
+
modalRef.current?.present();
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
const handleCloseModal = useCallback(() => {
|
|
39
|
+
modalRef.current?.dismiss();
|
|
40
|
+
}, []);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<Button onPress={handleOpenModal}>Open Modal</Button>
|
|
45
|
+
|
|
46
|
+
<Modal
|
|
47
|
+
ref={modalRef}
|
|
48
|
+
heading={props.heading}
|
|
49
|
+
description={props.description}
|
|
50
|
+
loading={props.loading}
|
|
51
|
+
loadingHeading={props.loadingHeading}
|
|
52
|
+
showCloseButton={props.close}
|
|
53
|
+
fullscreen={props.fullscreen}
|
|
54
|
+
image={props.image}
|
|
55
|
+
showHandle={props.showHandle}
|
|
56
|
+
primaryButtonText={props.buttons.primaryButtonText}
|
|
57
|
+
secondaryButtonText={props.buttons.primaryButtonText}
|
|
58
|
+
onPressPrimaryButton={handleCloseModal}
|
|
59
|
+
onPressSecondaryButton={handleCloseModal}
|
|
60
|
+
>
|
|
61
|
+
{props.customContent}
|
|
62
|
+
</Modal>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
44
65
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
loading={props.loading}
|
|
48
|
-
image={props.image}
|
|
49
|
-
heading={props.heading}
|
|
50
|
-
description={props.description}
|
|
51
|
-
fullscreen={props.fullscreen}
|
|
52
|
-
showHandle={props.showHandle}
|
|
53
|
-
/>
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
@@ -41,6 +41,10 @@ const meta = {
|
|
|
41
41
|
control: 'boolean',
|
|
42
42
|
description: 'Whether the modal is in a loading state.',
|
|
43
43
|
},
|
|
44
|
+
loadingHeading: {
|
|
45
|
+
control: 'text',
|
|
46
|
+
description: 'The heading text to be displayed when loading is true.',
|
|
47
|
+
},
|
|
44
48
|
fullscreen: {
|
|
45
49
|
control: 'boolean',
|
|
46
50
|
description: 'Whether the modal should take up the full screen height.',
|
|
@@ -42,6 +42,7 @@ const Modal = ({
|
|
|
42
42
|
closeOnPrimaryButtonPress = true,
|
|
43
43
|
closeOnSecondaryButtonPress = true,
|
|
44
44
|
loading,
|
|
45
|
+
loadingHeading = 'Loading...',
|
|
45
46
|
fullscreen = false,
|
|
46
47
|
image,
|
|
47
48
|
primaryButtonProps,
|
|
@@ -206,7 +207,7 @@ const Modal = ({
|
|
|
206
207
|
>
|
|
207
208
|
<Spinner size="lg" />
|
|
208
209
|
<Heading size="lg" textAlign="center">
|
|
209
|
-
|
|
210
|
+
{loadingHeading}
|
|
210
211
|
</Heading>
|
|
211
212
|
</View>
|
|
212
213
|
) : (
|
|
@@ -328,21 +329,35 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
328
329
|
variants: {
|
|
329
330
|
bothButtons: {
|
|
330
331
|
true: {
|
|
331
|
-
paddingBottom:
|
|
332
|
+
paddingBottom:
|
|
333
|
+
166 +
|
|
334
|
+
rt.insets.bottom -
|
|
335
|
+
theme.components.modal.padding +
|
|
336
|
+
theme.components.bottomSheet.padding,
|
|
332
337
|
},
|
|
333
338
|
false: {
|
|
334
|
-
paddingBottom:
|
|
339
|
+
paddingBottom:
|
|
340
|
+
102 +
|
|
341
|
+
rt.insets.bottom -
|
|
342
|
+
theme.components.modal.padding +
|
|
343
|
+
theme.components.bottomSheet.padding,
|
|
335
344
|
},
|
|
336
345
|
},
|
|
337
346
|
noButtons: {
|
|
338
347
|
true: {
|
|
339
|
-
paddingBottom:
|
|
348
|
+
paddingBottom:
|
|
349
|
+
rt.insets.bottom +
|
|
350
|
+
theme.components.modal.padding +
|
|
351
|
+
theme.components.bottomSheet.padding,
|
|
340
352
|
},
|
|
341
353
|
},
|
|
342
354
|
stickyFooter: {
|
|
343
355
|
true: {},
|
|
344
356
|
false: {
|
|
345
|
-
paddingBottom:
|
|
357
|
+
paddingBottom:
|
|
358
|
+
rt.insets.bottom +
|
|
359
|
+
theme.components.modal.padding +
|
|
360
|
+
theme.components.bottomSheet.padding,
|
|
346
361
|
},
|
|
347
362
|
},
|
|
348
363
|
},
|
|
@@ -37,6 +37,7 @@ const Modal = ({
|
|
|
37
37
|
closeOnPrimaryButtonPress = true,
|
|
38
38
|
closeOnSecondaryButtonPress = true,
|
|
39
39
|
loading,
|
|
40
|
+
loadingHeading = 'Loading...',
|
|
40
41
|
image,
|
|
41
42
|
primaryButtonProps,
|
|
42
43
|
secondaryButtonProps,
|
|
@@ -166,7 +167,7 @@ const Modal = ({
|
|
|
166
167
|
>
|
|
167
168
|
<Spinner size="lg" />
|
|
168
169
|
<Heading size="lg" textAlign="center">
|
|
169
|
-
|
|
170
|
+
{loadingHeading}
|
|
170
171
|
</Heading>
|
|
171
172
|
</View>
|
|
172
173
|
) : (
|
|
@@ -54,30 +54,30 @@ export const PillStates: Story = {
|
|
|
54
54
|
const selectedValue = '2';
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
|
-
<Flex
|
|
57
|
+
<Flex spacing="xl" direction="column" align="center">
|
|
58
58
|
<VariantTitle title="Unselected">
|
|
59
|
-
<Flex direction="row"
|
|
59
|
+
<Flex direction="row" spacing="sm">
|
|
60
60
|
<PillGroup value={selectedValue} onChange={() => {}}>
|
|
61
61
|
<Pill value="1" label="Label" />
|
|
62
62
|
</PillGroup>
|
|
63
63
|
</Flex>
|
|
64
64
|
</VariantTitle>
|
|
65
65
|
<VariantTitle title="Selected">
|
|
66
|
-
<Flex direction="row"
|
|
66
|
+
<Flex direction="row" spacing="sm">
|
|
67
67
|
<PillGroup value={selectedValue} onChange={() => {}}>
|
|
68
68
|
<Pill value="2" label="Label" />
|
|
69
69
|
</PillGroup>
|
|
70
70
|
</Flex>
|
|
71
71
|
</VariantTitle>
|
|
72
72
|
<VariantTitle title="With Icon - Unselected">
|
|
73
|
-
<Flex direction="row"
|
|
73
|
+
<Flex direction="row" spacing="sm">
|
|
74
74
|
<PillGroup value={selectedValue} onChange={() => {}}>
|
|
75
75
|
<Pill value="1" label="New" icon={HeartMediumIcon} />
|
|
76
76
|
</PillGroup>
|
|
77
77
|
</Flex>
|
|
78
78
|
</VariantTitle>
|
|
79
79
|
<VariantTitle title="With Icon - Selected">
|
|
80
|
-
<Flex direction="row"
|
|
80
|
+
<Flex direction="row" spacing="sm">
|
|
81
81
|
<PillGroup value={selectedValue} onChange={() => {}}>
|
|
82
82
|
<Pill value="2" label="New" icon={HeartMediumIcon} />
|
|
83
83
|
</PillGroup>
|
|
@@ -101,7 +101,7 @@ export const WrapBehavior: Story = {
|
|
|
101
101
|
const [value2, setValue2] = useState<string>('7');
|
|
102
102
|
|
|
103
103
|
return (
|
|
104
|
-
<Flex
|
|
104
|
+
<Flex spacing="xl" direction="column" align="center">
|
|
105
105
|
<VariantTitle title="Wrap: False">
|
|
106
106
|
<PillGroup wrap={false} value={value1} onChange={setValue1}>
|
|
107
107
|
<Pill value="1" label="New" />
|
|
@@ -139,7 +139,7 @@ export const Multiple: Story = {
|
|
|
139
139
|
const [selectedCategories, setSelectedCategories] = useState<string[]>(['new', 'read']);
|
|
140
140
|
|
|
141
141
|
return (
|
|
142
|
-
<Flex
|
|
142
|
+
<Flex spacing="lg" direction="column" align="center" style={{ maxWidth: 400 }}>
|
|
143
143
|
<PillGroup wrap={true} multiple value={selectedCategories} onChange={setSelectedCategories}>
|
|
144
144
|
<Pill value="unread" label="Unread" />
|
|
145
145
|
<Pill value="new" label="New" icon={HeartMediumIcon} />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
-
import {
|
|
2
|
+
import { ProgressStep, ProgressStepper } from '.';
|
|
4
3
|
import { VariantTitle } from '../../../docs/components';
|
|
5
4
|
import { BodyText } from '../BodyText';
|
|
6
5
|
import { Flex } from '../Flex';
|
|
@@ -20,20 +19,20 @@ type Story = StoryObj<typeof meta>;
|
|
|
20
19
|
export const Playground: Story = {
|
|
21
20
|
args: {
|
|
22
21
|
children: (
|
|
23
|
-
<Flex
|
|
22
|
+
<Flex spacing="xl" direction="column" align="center" style={{ flex: 1, minWidth: 200 }}>
|
|
24
23
|
<ProgressStepper>
|
|
25
24
|
<ProgressStep id={'1'} status="complete" />
|
|
26
25
|
<ProgressStep id={'2'} status="complete" />
|
|
27
26
|
<ProgressStep id={'3'} status="active" />
|
|
28
27
|
<ProgressStep id={'4'} status="incomplete" />
|
|
29
28
|
</ProgressStepper>
|
|
30
|
-
<Flex direction="row"
|
|
29
|
+
<Flex direction="row" spacing="lg" style={{ width: '100%' }}>
|
|
31
30
|
<ProgressStep id={'1'} status="complete" />
|
|
32
31
|
</Flex>
|
|
33
|
-
<Flex direction="row"
|
|
32
|
+
<Flex direction="row" spacing="lg" style={{ width: '100%' }}>
|
|
34
33
|
<ProgressStep id={'3'} status="active" />
|
|
35
34
|
</Flex>
|
|
36
|
-
<Flex direction="row"
|
|
35
|
+
<Flex direction="row" spacing="lg" style={{ width: '100%' }}>
|
|
37
36
|
<ProgressStep id={'5'} status="incomplete" />
|
|
38
37
|
</Flex>
|
|
39
38
|
</Flex>
|
|
@@ -50,7 +49,7 @@ export const StepStatuses: Story = {
|
|
|
50
49
|
},
|
|
51
50
|
render: props => {
|
|
52
51
|
return (
|
|
53
|
-
<Flex
|
|
52
|
+
<Flex spacing="xl" direction="column" align="center">
|
|
54
53
|
<VariantTitle title="All Uncompleted Steps">
|
|
55
54
|
<ProgressStepper {...props}>
|
|
56
55
|
<ProgressStep id={'1'} status="incomplete" />
|
|
@@ -91,7 +90,7 @@ export const BasicExample: Story = {
|
|
|
91
90
|
},
|
|
92
91
|
render: props => {
|
|
93
92
|
return (
|
|
94
|
-
<Flex
|
|
93
|
+
<Flex spacing="lg" direction="column" align="center">
|
|
95
94
|
<Heading size="md">Progress Stepper</Heading>
|
|
96
95
|
<BodyText>Shows progress through multi-step processes</BodyText>
|
|
97
96
|
<ProgressStepper {...props}>
|
|
@@ -147,7 +147,7 @@ export const Variants: Story = {
|
|
|
147
147
|
render: ({ value: _, children: __, label: ___, disabled: _____, onChange: ______, ...args }) => {
|
|
148
148
|
const [value, setValue] = useState('Option 1');
|
|
149
149
|
return (
|
|
150
|
-
<Flex
|
|
150
|
+
<Flex spacing="lg">
|
|
151
151
|
<VariantTitle title="Default">
|
|
152
152
|
<RadioGroup
|
|
153
153
|
aria-label="Radio Group"
|
|
@@ -96,7 +96,7 @@ export const WithGrid: Story = {
|
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
97
97
|
render: ({ value: _, ...args }) => (
|
|
98
98
|
<RadioGroup {...args}>
|
|
99
|
-
<Grid columns={2}
|
|
99
|
+
<Grid columns={2} spacing="md">
|
|
100
100
|
<Radio aria-label="Label 1" label="Option 1" value="Option 1" nativeID="Radio-1" />
|
|
101
101
|
<Radio
|
|
102
102
|
aria-label="Label 2 (with added option)"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import FlexProps from '../Flex/Flex.props';
|
|
2
1
|
import { Flex } from '../Flex';
|
|
2
|
+
import FlexProps from '../Flex/Flex.props';
|
|
3
3
|
|
|
4
4
|
const RadioGroupTextContent = ({ children, ...props }: FlexProps) => {
|
|
5
5
|
return (
|
|
6
|
-
<Flex direction="column"
|
|
6
|
+
<Flex direction="column" spacing="none" {...props}>
|
|
7
7
|
{children}
|
|
8
8
|
</Flex>
|
|
9
9
|
);
|
|
@@ -4,7 +4,7 @@ import FlexProps from '../Flex/Flex.props';
|
|
|
4
4
|
|
|
5
5
|
const RadioTextContent = ({ children, style, ...props }: FlexProps) => {
|
|
6
6
|
return (
|
|
7
|
-
<Flex direction="column"
|
|
7
|
+
<Flex direction="column" spacing="none" style={[styles.content, style]} {...props}>
|
|
8
8
|
{children}
|
|
9
9
|
</Flex>
|
|
10
10
|
);
|
|
@@ -39,7 +39,7 @@ export const KitchenSink: Story = {
|
|
|
39
39
|
},
|
|
40
40
|
render: () => {
|
|
41
41
|
return (
|
|
42
|
-
<Flex
|
|
42
|
+
<Flex spacing="xl" direction="column" style={{ width: '100%' }}>
|
|
43
43
|
<VariantTitle title="Default SectionHeader with helper text and link">
|
|
44
44
|
<SectionHeader
|
|
45
45
|
heading="Heading"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { Center, Switch, Flex, Label, FormField, FormFieldLabel, FormFieldLabelText } from '../../';
|
|
1
|
+
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { Center, Flex, FormField, FormFieldLabel, FormFieldLabelText, Label, Switch } from '../../';
|
|
4
3
|
import {
|
|
5
|
-
ViewFigmaButton,
|
|
6
4
|
BackToTopButton,
|
|
7
|
-
UsageWrap,
|
|
8
|
-
SwitchList,
|
|
9
5
|
SwitchExample,
|
|
6
|
+
SwitchList,
|
|
7
|
+
UsageWrap,
|
|
8
|
+
ViewFigmaButton,
|
|
10
9
|
} from '../../../docs/components';
|
|
10
|
+
import * as Stories from './Switch.stories';
|
|
11
11
|
|
|
12
12
|
<Meta title="Components / Switch" />
|
|
13
13
|
|
|
@@ -76,7 +76,7 @@ the [`FormField` docs](/?path=/docs/native-ui-components-form-field--docs) for m
|
|
|
76
76
|
|
|
77
77
|
<UsageWrap>
|
|
78
78
|
<FormField>
|
|
79
|
-
<Flex
|
|
79
|
+
<Flex spacing="sm" direction="row" align="center" justify="center">
|
|
80
80
|
<SwitchExample />
|
|
81
81
|
<FormFieldLabel>
|
|
82
82
|
<FormFieldLabelText>Enable notifications</FormFieldLabelText>
|
|
@@ -95,7 +95,7 @@ const MyComponent = () => {
|
|
|
95
95
|
|
|
96
96
|
return (
|
|
97
97
|
<FormField>
|
|
98
|
-
<Flex
|
|
98
|
+
<Flex spacing="sm" direction="row" align="center">
|
|
99
99
|
<Switch value={notifications} onValueChange={handleChange} />
|
|
100
100
|
<FormFieldLabel>
|
|
101
101
|
<FormFieldLabelText>Enable notifications</FormFieldLabelText>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
1
2
|
import React, { useEffect } from 'react';
|
|
2
3
|
import { Switch } from '.';
|
|
3
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
4
|
import { VariantTitle } from '../../../docs/components';
|
|
5
5
|
import { Flex } from '../Flex';
|
|
6
6
|
|
|
@@ -50,7 +50,7 @@ export const Playground: Story = {
|
|
|
50
50
|
|
|
51
51
|
export const Variants: Story = {
|
|
52
52
|
render: () => (
|
|
53
|
-
<Flex direction="column"
|
|
53
|
+
<Flex direction="column" spacing="sm">
|
|
54
54
|
<VariantTitle title="Off - medium">
|
|
55
55
|
<Switch value={false} />
|
|
56
56
|
</VariantTitle>
|
|
@@ -245,7 +245,7 @@ export const Controlled: Story = {
|
|
|
245
245
|
setValue(tabs[nextIndex]);
|
|
246
246
|
};
|
|
247
247
|
return (
|
|
248
|
-
<Flex align={Platform.OS === 'web' ? 'flex-start' : 'stretch'}
|
|
248
|
+
<Flex align={Platform.OS === 'web' ? 'flex-start' : 'stretch'} spacing="lg">
|
|
249
249
|
<Tabs value={value}>
|
|
250
250
|
<TabsList>
|
|
251
251
|
<Tab value="account">Account</Tab>
|
|
@@ -115,8 +115,8 @@ import { Textarea } from '@utilitywarehouse/hearth-react-native';
|
|
|
115
115
|
|
|
116
116
|
const MyComponent = () => {
|
|
117
117
|
const [value, setValue] = useState('');
|
|
118
|
-
const handleChange =
|
|
119
|
-
setValue(
|
|
118
|
+
const handleChange = text => {
|
|
119
|
+
setValue(text);
|
|
120
120
|
};
|
|
121
121
|
return (
|
|
122
122
|
<Textarea
|
|
@@ -124,7 +124,7 @@ const MyComponent = () => {
|
|
|
124
124
|
helperText="Provide a detailed description"
|
|
125
125
|
placeholder="Enter your text here..."
|
|
126
126
|
value={value}
|
|
127
|
-
|
|
127
|
+
onChangeText={handleChange}
|
|
128
128
|
/>
|
|
129
129
|
);
|
|
130
130
|
};
|