@utilitywarehouse/hearth-react-native 0.17.0 → 0.19.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 +21 -18
- package/CHANGELOG.md +144 -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/BodyText/BodyText.js +2 -2
- 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/IconButton/IconButton.props.d.ts +19 -0
- package/build/components/IconButton/IconButtonRoot.d.ts +1 -1
- package/build/components/IconButton/IconButtonRoot.js +43 -2
- package/build/components/List/ListItem/ListItemHelperText.d.ts +1 -1
- package/build/components/List/ListItem/ListItemHelperText.js +2 -2
- package/build/components/Modal/Modal.js +14 -4
- 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 +2 -1
- 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/components/AllComponents.web.tsx +9 -9
- package/docs/layout-components.docs.mdx +3 -3
- package/package.json +4 -4
- 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/BodyText/BodyText.tsx +2 -2
- 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.docs.mdx +91 -9
- package/src/components/IconButton/IconButton.props.ts +19 -0
- package/src/components/IconButton/IconButton.stories.tsx +60 -4
- package/src/components/IconButton/IconButtonRoot.tsx +54 -1
- 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/List/ListItem/ListItemHelperText.tsx +2 -2
- package/src/components/Modal/Modal.tsx +18 -4
- 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 +4 -1
- 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
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @utilitywarehouse/hearth-react-native@0.
|
|
2
|
+
> @utilitywarehouse/hearth-react-native@0.19.0 lint /home/runner/work/hearth/hearth/packages/react-native
|
|
3
3
|
> TIMING=1 eslint .
|
|
4
4
|
|
|
5
5
|
|
|
@@ -50,20 +50,23 @@
|
|
|
50
50
|
45:6 warning React Hook useEffect has a missing dependency: 'formFieldContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
|
|
51
51
|
|
|
52
52
|
/home/runner/work/hearth/hearth/packages/react-native/src/components/Toast/Toast.context.tsx
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
no-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
no-
|
|
67
|
-
|
|
68
|
-
no-regex-spaces
|
|
69
|
-
|
|
53
|
+
14:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
|
|
54
|
+
106:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
|
|
55
|
+
|
|
56
|
+
/home/runner/work/hearth/hearth/packages/react-native/src/components/VerificationInput/VerificationInput.tsx
|
|
57
|
+
58:7 warning React Hook useImperativeHandle has a missing dependency: 'inputRefs'. Either include it or remove the dependency array react-hooks/exhaustive-deps
|
|
58
|
+
|
|
59
|
+
✖ 25 problems (0 errors, 25 warnings)
|
|
60
|
+
|
|
61
|
+
Rule | Time (ms) | Relative
|
|
62
|
+
:------------------------------------------|----------:|--------:
|
|
63
|
+
@typescript-eslint/no-unused-vars | 1284.680 | 57.7%
|
|
64
|
+
react-hooks/exhaustive-deps | 121.666 | 5.5%
|
|
65
|
+
react-hooks/rules-of-hooks | 80.650 | 3.6%
|
|
66
|
+
no-global-assign | 65.650 | 2.9%
|
|
67
|
+
@typescript-eslint/ban-ts-comment | 55.037 | 2.5%
|
|
68
|
+
no-regex-spaces | 46.626 | 2.1%
|
|
69
|
+
no-loss-of-precision | 42.743 | 1.9%
|
|
70
|
+
no-misleading-character-class | 41.075 | 1.8%
|
|
71
|
+
no-unexpected-multiline | 38.229 | 1.7%
|
|
72
|
+
@typescript-eslint/no-unsafe-function-type | 27.456 | 1.2%
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,149 @@
|
|
|
1
1
|
# @utilitywarehouse/hearth-react-native
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#882](https://github.com/utilitywarehouse/hearth/pull/882) [`7e5338c`](https://github.com/utilitywarehouse/hearth/commit/7e5338c75bf051897a5384fe4ce0f65533b7e1a7) Thanks [@jordmccord](https://github.com/jordmccord)! - 💅 [ENHANCEMENT]: Add `safeAreaPadding` option to `ToastProvider`
|
|
8
|
+
|
|
9
|
+
`ToastProvider` now supports an optional `safeAreaPadding` prop to control whether toasts respect safe-area inset padding. This can be useful when you want to disable additional safe-area inset space while keeping the base toast padding.
|
|
10
|
+
|
|
11
|
+
**Components affected**:
|
|
12
|
+
- `ToastProvider`
|
|
13
|
+
|
|
14
|
+
**Developer changes**:
|
|
15
|
+
|
|
16
|
+
No changes required. To disable safe-area inset padding (while preserving the base bottom padding), set `safeAreaPadding` to `false`:
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<ToastProvider safeAreaPadding={false}>{children}</ToastProvider>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- [`da893ff`](https://github.com/utilitywarehouse/hearth/commit/da893ff8a9d576a6ca69021737056c7289f8c6aa) Thanks [@jordmccord](https://github.com/jordmccord)! - 💅 [ENHANCEMENT]: Unify spacing prop naming across layout components
|
|
23
|
+
|
|
24
|
+
The `space` prop has been renamed to `spacing` across all layout components for improved consistency and clarity. The `space` prop is now deprecated but will continue to work alongside the new `spacing` prop to maintain backward compatibility.
|
|
25
|
+
|
|
26
|
+
**Components affected**:
|
|
27
|
+
- `Box`
|
|
28
|
+
- `ButtonGroup`
|
|
29
|
+
- `Card`
|
|
30
|
+
- `Container`
|
|
31
|
+
- `Divider`
|
|
32
|
+
- `Flex`
|
|
33
|
+
- `Grid`
|
|
34
|
+
|
|
35
|
+
**Developer changes**:
|
|
36
|
+
|
|
37
|
+
No immediate changes are required. The `space` prop will continue to work as before. However, we recommend migrating to the `spacing` prop at your convenience:
|
|
38
|
+
|
|
39
|
+
```diff
|
|
40
|
+
- <Flex space="md">
|
|
41
|
+
+ <Flex spacing="md">
|
|
42
|
+
<Box>...</Box>
|
|
43
|
+
<Box>...</Box>
|
|
44
|
+
</Flex>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```diff
|
|
48
|
+
- <Grid columns={2} space="lg">
|
|
49
|
+
+ <Grid columns={2} spacing="lg">
|
|
50
|
+
<Box>...</Box>
|
|
51
|
+
<Box>...</Box>
|
|
52
|
+
</Grid>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```diff
|
|
56
|
+
- <Container space="xl">
|
|
57
|
+
+ <Container spacing="xl">
|
|
58
|
+
<Box>...</Box>
|
|
59
|
+
</Container>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The deprecated `space` prop will be removed in a future major version release.
|
|
63
|
+
|
|
64
|
+
- [#877](https://github.com/utilitywarehouse/hearth/pull/877) [`2cdf3a2`](https://github.com/utilitywarehouse/hearth/commit/2cdf3a2f4251b24f34c260f3f5da39f8c330fff5) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `autoFocus` prop to `VerificationInput`
|
|
65
|
+
|
|
66
|
+
`VerificationInput` now supports an `autoFocus` prop to control whether the first slot should focus on mount.
|
|
67
|
+
Default is `false` to avoid unexpected focus when the component is used.
|
|
68
|
+
|
|
69
|
+
**Developer changes**:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<VerificationInput autoFocus={false} />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- [#877](https://github.com/utilitywarehouse/hearth/pull/877) [`2cdf3a2`](https://github.com/utilitywarehouse/hearth/commit/2cdf3a2f4251b24f34c260f3f5da39f8c330fff5) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `VerificationInput` ref methods and improve rapid input handling
|
|
76
|
+
|
|
77
|
+
`VerificationInput` now forwards a ref with `focus`, `blur`, `clear`, and `focusIndex` helpers. Input updates also use the latest value to avoid dropped digits when typing quickly.
|
|
78
|
+
|
|
79
|
+
**Developer changes**:
|
|
80
|
+
|
|
81
|
+
If you want to control focus programmatically, pass a ref:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { useRef } from 'react';
|
|
85
|
+
import {
|
|
86
|
+
VerificationInput,
|
|
87
|
+
type VerificationInputHandle,
|
|
88
|
+
} from '@utilitywarehouse/hearth-react-native';
|
|
89
|
+
|
|
90
|
+
const inputRef = useRef<VerificationInputHandle>(null);
|
|
91
|
+
|
|
92
|
+
<VerificationInput ref={inputRef} onChangeText={setCode} />;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- [#880](https://github.com/utilitywarehouse/hearth/pull/880) [`a52bb03`](https://github.com/utilitywarehouse/hearth/commit/a52bb03352dd8b83c9cfd3311aaa390e96e75662) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Remove the unsupported `colorScheme` prop from `Banner` types so the API matches the `Card` component.
|
|
98
|
+
|
|
99
|
+
- [#879](https://github.com/utilitywarehouse/hearth/pull/879) [`383b686`](https://github.com/utilitywarehouse/hearth/commit/383b6860c1b68da139f10a67cd001dd884143df0) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Make `Banner` button full width in vertical layout
|
|
100
|
+
|
|
101
|
+
- [#878](https://github.com/utilitywarehouse/hearth/pull/878) [`b31b8c3`](https://github.com/utilitywarehouse/hearth/commit/b31b8c3d37d4d1ec3df2f187ec18d00b3e663b49) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Fix `Modal` bottom padding
|
|
102
|
+
|
|
103
|
+
- [#881](https://github.com/utilitywarehouse/hearth/pull/881) [`5681b8f`](https://github.com/utilitywarehouse/hearth/commit/5681b8fd4bcc73ad532229018049f959f06f77ec) Thanks [@jordmccord](https://github.com/jordmccord)! - 📦 [DEPS]: Bump `@utilitywarehouse/hearth-react-native-icons` peerDependency to 0.8.0
|
|
104
|
+
|
|
105
|
+
## 0.18.0
|
|
106
|
+
|
|
107
|
+
### Minor Changes
|
|
108
|
+
|
|
109
|
+
- [#869](https://github.com/utilitywarehouse/hearth/pull/869) [`89231c8`](https://github.com/utilitywarehouse/hearth/commit/89231c818dfd694f53b50f4cc961a38d0a50999e) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add color override props to `IconButton` for service-specific branding
|
|
110
|
+
|
|
111
|
+
The `IconButton` component now supports custom color overrides through three new optional props: `backgroundColor`, `activeBackgroundColor`, and `shadowColor`. These props enable service-specific branding for use cases like service buttons (Electricity, Broadband, Mobile, Insurance, Cashback Card).
|
|
112
|
+
|
|
113
|
+
⚠️ **Important**: These props should be used sparingly and only for specific use cases where brand-specific colors are required. For most use cases, continue using the standard `colorScheme` and `variant` props to maintain design system consistency.
|
|
114
|
+
|
|
115
|
+
**Components affected**:
|
|
116
|
+
- `IconButton`
|
|
117
|
+
|
|
118
|
+
**Developer changes**:
|
|
119
|
+
|
|
120
|
+
You can now customize `IconButton` colors for service-specific branding:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { IconButton } from '@utilitywarehouse/hearth-react-native';
|
|
124
|
+
import { ElectricityMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
125
|
+
|
|
126
|
+
<IconButton
|
|
127
|
+
icon={ElectricityMediumIcon}
|
|
128
|
+
backgroundColor="energyBlue200"
|
|
129
|
+
activeBackgroundColor="energyBlue300"
|
|
130
|
+
shadowColor="energyBlue300"
|
|
131
|
+
variant="emphasis"
|
|
132
|
+
onPress={handlePress}
|
|
133
|
+
/>;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The new props are:
|
|
137
|
+
- `backgroundColor` - Sets the base background color, overriding the color scheme's default
|
|
138
|
+
- `activeBackgroundColor` - Sets the background color when pressed or in an active state
|
|
139
|
+
- `shadowColor` - Sets the shadow/elevation color
|
|
140
|
+
|
|
141
|
+
These overrides work alongside the existing `variant` and `colorScheme` props, allowing you to maintain structural styling while customizing colors for specific branding requirements.
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- [#871](https://github.com/utilitywarehouse/hearth/pull/871) [`8984335`](https://github.com/utilitywarehouse/hearth/commit/89843355d268aaa184bea75784e6841568c4784f) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Fix style ordering in `BodyText` to ensure color props properly override custom styles
|
|
146
|
+
|
|
3
147
|
## 0.17.0
|
|
4
148
|
|
|
5
149
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type BannerProps from './Banner.props';
|
|
2
2
|
declare const Banner: {
|
|
3
|
-
({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant,
|
|
3
|
+
({ icon, iconContainerVariant, iconContainerSize, iconContainerColor, illustration, image, heading, description, direction, link, button, onPress, onClose, variant, style, ...props }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default Banner;
|
|
@@ -9,9 +9,7 @@ import { Heading } from '../Heading';
|
|
|
9
9
|
import { IconContainer } from '../IconContainer';
|
|
10
10
|
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
11
11
|
import BannerContext from './Banner.context';
|
|
12
|
-
const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle',
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
-
colorScheme: _, style, ...props }) => {
|
|
12
|
+
const Banner = ({ icon, iconContainerVariant = 'subtle', iconContainerSize = 'md', iconContainerColor = 'pig', illustration, image, heading, description, direction = 'horizontal', link, button, onPress, onClose, variant = 'subtle', style, ...props }) => {
|
|
15
13
|
const hasIllustration = Boolean(illustration);
|
|
16
14
|
styles.useVariants({ direction, hasIllustration });
|
|
17
15
|
const context = useMemo(() => ({
|
|
@@ -34,7 +32,7 @@ colorScheme: _, style, ...props }) => {
|
|
|
34
32
|
return _jsx(View, { style: styles.action, children: link });
|
|
35
33
|
}
|
|
36
34
|
if (button) {
|
|
37
|
-
return _jsx(View, { style: styles.action, children: button });
|
|
35
|
+
return (_jsx(View, { style: [styles.action, styles.buttonWrap], children: _jsx(View, { style: styles.buttonInner, children: button }) }));
|
|
38
36
|
}
|
|
39
37
|
return null;
|
|
40
38
|
};
|
|
@@ -152,6 +150,28 @@ const styles = StyleSheet.create(theme => ({
|
|
|
152
150
|
action: {
|
|
153
151
|
alignSelf: 'flex-start',
|
|
154
152
|
},
|
|
153
|
+
buttonWrap: {
|
|
154
|
+
variants: {
|
|
155
|
+
direction: {
|
|
156
|
+
horizontal: {},
|
|
157
|
+
vertical: {
|
|
158
|
+
flexDirection: 'row',
|
|
159
|
+
justifyContent: 'center',
|
|
160
|
+
alignItems: 'stretch',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
buttonInner: {
|
|
166
|
+
variants: {
|
|
167
|
+
direction: {
|
|
168
|
+
horizontal: {},
|
|
169
|
+
vertical: {
|
|
170
|
+
flex: 1,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
155
175
|
chevron: {
|
|
156
176
|
alignSelf: 'center',
|
|
157
177
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type CardProps from '../Card/Card.props';
|
|
3
3
|
export type BannerDirection = 'horizontal' | 'vertical';
|
|
4
|
-
export interface BannerProps extends Omit<CardProps, 'noPadding' | 'variant' | '
|
|
4
|
+
export interface BannerProps extends Omit<CardProps, 'noPadding' | 'variant' | 'space' | 'gap' | 'rowGap' | 'columnGap' | 'flexDirection' | 'flexWrap' | 'alignItems' | 'justifyContent'> {
|
|
5
5
|
/**
|
|
6
6
|
* Icon component to display in the banner
|
|
7
7
|
* Mutually exclusive with image
|
|
@@ -66,10 +66,5 @@ export interface BannerProps extends Omit<CardProps, 'noPadding' | 'variant' | '
|
|
|
66
66
|
* @default 'subtle'
|
|
67
67
|
*/
|
|
68
68
|
variant?: 'subtle' | 'emphasis';
|
|
69
|
-
/**
|
|
70
|
-
* Color scheme for the banner
|
|
71
|
-
* @default 'pig'
|
|
72
|
-
*/
|
|
73
|
-
colorScheme?: 'pig' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'highlight';
|
|
74
69
|
}
|
|
75
70
|
export default BannerProps;
|
|
@@ -18,7 +18,7 @@ const BodyText = ({ children, color, size = 'md', truncated, weight = 'regular',
|
|
|
18
18
|
}
|
|
19
19
|
: {}), style: [
|
|
20
20
|
styles.text,
|
|
21
|
-
|
|
21
|
+
props.style,
|
|
22
22
|
{
|
|
23
23
|
...(textTransform && { textTransform }),
|
|
24
24
|
...(textAlign && { textAlign }),
|
|
@@ -27,7 +27,7 @@ const BodyText = ({ children, color, size = 'md', truncated, weight = 'regular',
|
|
|
27
27
|
...(userSelect && { userSelect }),
|
|
28
28
|
...(textAlignVertical && { textAlignVertical }),
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
styles.getColours(color, textDecorationColor),
|
|
31
31
|
], children: children }));
|
|
32
32
|
};
|
|
33
33
|
BodyText.displayName = 'BodyText';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps, ViewStyle } from 'react-native';
|
|
3
|
-
import type { BorderRadiusValue, BordeWidthValue, ColorValue, OpacityValue, SpaceValue } from '../../types';
|
|
3
|
+
import type { BorderRadiusValue, BordeWidthValue, ColorValue, OpacityValue, SpaceValue, SpacingValues } from '../../types';
|
|
4
4
|
export type OmittedStyles = Omit<ViewStyle, 'backgroundColor' | 'borderBlockColor' | 'borderBlockEndColor' | 'borderBlockStartColor' | 'borderBottomColor' | 'borderBottomEndRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderBottomStartRadius' | 'borderBottomWidth' | 'borderColor' | 'borderEndColor' | 'borderEndEndRadius' | 'borderEndStartRadius' | 'borderEndWidth' | 'borderLeftColor' | 'borderLeftWidth' | 'borderRadius' | 'borderRightColor' | 'borderRightWidth' | 'borderStartColor' | 'borderStartEndRadius' | 'borderStartStartRadius' | 'borderStartWidth' | 'borderTopColor' | 'borderTopEndRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderTopStartRadius' | 'borderTopWidth' | 'borderWidth' | 'bottom' | 'columnGap' | 'end' | 'gap' | 'height' | 'left' | 'margin' | 'marginBottom' | 'marginEnd' | 'marginHorizontal' | 'marginLeft' | 'marginRight' | 'marginStart' | 'marginTop' | 'marginVertical' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'opacity' | 'outlineColor' | 'padding' | 'paddingBottom' | 'paddingEnd' | 'paddingHorizontal' | 'paddingLeft' | 'paddingRight' | 'paddingStart' | 'paddingTop' | 'paddingVertical' | 'right' | 'rowGap' | 'shadowColor' | 'start' | 'top' | 'width' | 'rotation' | 'scaleX' | 'scaleY' | 'transformMatrix' | 'translateX' | 'translateY'>;
|
|
5
5
|
export type OtherBoxViewStyles = Pick<OmittedStyles, 'alignContent' | 'alignItems' | 'alignSelf' | 'aspectRatio' | 'backfaceVisibility' | 'borderCurve' | 'borderStyle' | 'cursor' | 'direction' | 'display' | 'elevation' | 'flex' | 'flexBasis' | 'flexDirection' | 'flexGrow' | 'flexShrink' | 'flexWrap' | 'justifyContent' | 'boxShadow' | 'outlineOffset' | 'outlineStyle' | 'outlineWidth' | 'overflow' | 'pointerEvents' | 'position' | 'shadowOffset' | 'shadowOpacity' | 'shadowRadius' | 'transform' | 'transformOrigin' | 'zIndex'>;
|
|
6
6
|
export interface BoxStyleMappingValues {
|
|
@@ -93,7 +93,10 @@ export interface ThemedBoxViewStyleProps {
|
|
|
93
93
|
borderTopWidth?: BordeWidthValue;
|
|
94
94
|
borderWidth?: BordeWidthValue;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
interface CustomBoxProps {
|
|
97
97
|
as?: React.ElementType;
|
|
98
|
+
spacing?: SpacingValues;
|
|
99
|
+
}
|
|
100
|
+
export interface BoxProps extends BoxStyleMappingValues, ThemedBoxViewStyleProps, OtherBoxViewStyles, ViewProps, CustomBoxProps {
|
|
98
101
|
}
|
|
99
102
|
export default BoxProps;
|
|
@@ -7,11 +7,13 @@ export declare const ButtonGroupComponent: import("react").ForwardRefExoticCompo
|
|
|
7
7
|
reversed?: boolean;
|
|
8
8
|
attached?: boolean;
|
|
9
9
|
space?: import("../../types").SpacingValues;
|
|
10
|
+
spacing?: import("../../types").SpacingValues;
|
|
10
11
|
}> & import("react-native").ViewProps & {
|
|
11
12
|
flexDirection?: import("react-native").ViewStyle["flexDirection"];
|
|
12
13
|
reversed?: boolean;
|
|
13
14
|
attached?: boolean;
|
|
14
15
|
space?: import("../../types").SpacingValues;
|
|
16
|
+
spacing?: import("../../types").SpacingValues;
|
|
15
17
|
} & import("@gluestack-ui/button/lib/typescript/types").IButtonGroupProps>;
|
|
16
18
|
declare const Button: {
|
|
17
19
|
({ children, disabled, pressed, text, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type ViewProps, type ViewStyle } from 'react-native';
|
|
2
2
|
import { SpacingValues } from '../../types';
|
|
3
3
|
declare const ButtonGroupRoot: {
|
|
4
|
-
({ children, attached, flexDirection, reversed, space, ...props }: ViewProps & {
|
|
4
|
+
({ children, attached, flexDirection, reversed, spacing, space, ...props }: ViewProps & {
|
|
5
5
|
flexDirection?: ViewStyle["flexDirection"];
|
|
6
6
|
reversed?: boolean;
|
|
7
7
|
attached?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `spacing` instead. The `space` prop will be removed in a future release
|
|
10
|
+
*/
|
|
8
11
|
space?: SpacingValues;
|
|
12
|
+
spacing?: SpacingValues;
|
|
9
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
displayName: string;
|
|
11
15
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
-
const ButtonGroupRoot = ({ children, attached = false, flexDirection = 'row', reversed = false,
|
|
4
|
+
const ButtonGroupRoot = ({ children, attached = false, flexDirection = 'row', reversed = false, spacing = 'md', space, ...props }) => {
|
|
5
5
|
let direction = flexDirection;
|
|
6
6
|
if (reversed) {
|
|
7
7
|
if (flexDirection === 'row')
|
|
@@ -15,7 +15,7 @@ const ButtonGroupRoot = ({ children, attached = false, flexDirection = 'row', re
|
|
|
15
15
|
}
|
|
16
16
|
styles.useVariants({
|
|
17
17
|
attached,
|
|
18
|
-
space,
|
|
18
|
+
spacing: space ?? spacing,
|
|
19
19
|
});
|
|
20
20
|
return (_jsx(View, { ...props, style: [styles.text, styles.extraStyles(direction), props.style], children: children }));
|
|
21
21
|
};
|
|
@@ -23,7 +23,7 @@ ButtonGroupRoot.displayName = 'ButtonGroupRoot';
|
|
|
23
23
|
const styles = StyleSheet.create(theme => ({
|
|
24
24
|
text: {
|
|
25
25
|
variants: {
|
|
26
|
-
|
|
26
|
+
spacing: {
|
|
27
27
|
none: {
|
|
28
28
|
gap: theme.layout.mobile.spacing.none,
|
|
29
29
|
},
|
|
@@ -5,7 +5,7 @@ interface CardContextProps {
|
|
|
5
5
|
hasActions?: boolean;
|
|
6
6
|
hasContent?: boolean;
|
|
7
7
|
hasOnlyActions?: boolean;
|
|
8
|
-
|
|
8
|
+
spacing?: CardProps['spacing'];
|
|
9
9
|
variant?: CardProps['variant'];
|
|
10
10
|
}
|
|
11
11
|
export declare const CardContext: import("react").Context<CardContextProps>;
|
|
@@ -6,6 +6,8 @@ interface CardProps extends PressableProps {
|
|
|
6
6
|
shadowColor?: 'functional' | 'brand' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'pig';
|
|
7
7
|
noPadding?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
spacing?: SpacingValues;
|
|
10
|
+
/** @deprecated Use `spacing` instead. The `gap` prop will be removed in a future release. */
|
|
9
11
|
space?: SpacingValues;
|
|
10
12
|
alignItems?: ViewStyle['alignItems'];
|
|
11
13
|
justifyContent?: ViewStyle['justifyContent'];
|
|
@@ -3,10 +3,10 @@ import { View } from 'react-native';
|
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
import { useCardContext } from './Card.context';
|
|
5
5
|
const CardContent = ({ children, style, ...props }) => {
|
|
6
|
-
const { noPadding,
|
|
6
|
+
const { noPadding, spacing } = useCardContext();
|
|
7
7
|
styles.useVariants({
|
|
8
8
|
noPadding,
|
|
9
|
-
|
|
9
|
+
spacing,
|
|
10
10
|
});
|
|
11
11
|
return (_jsx(View, { style: [styles.container, style], ...props, children: children }));
|
|
12
12
|
};
|
|
@@ -14,7 +14,7 @@ CardContent.displayName = 'CardContent';
|
|
|
14
14
|
const styles = StyleSheet.create(theme => ({
|
|
15
15
|
container: {
|
|
16
16
|
variants: {
|
|
17
|
-
|
|
17
|
+
spacing: theme.globalStyle.variants.spacing,
|
|
18
18
|
noPadding: {
|
|
19
19
|
true: {
|
|
20
20
|
padding: theme.components.card.mobile.paddingNone,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import CardProps from './Card.props';
|
|
2
2
|
declare const Card: {
|
|
3
|
-
({ children, variant, colorScheme, shadowColor, noPadding, style, states, space, disabled, onPress, ...rest }: CardProps & {
|
|
3
|
+
({ children, variant, colorScheme, shadowColor, noPadding, style, states, spacing, space, disabled, onPress, ...rest }: CardProps & {
|
|
4
4
|
states?: {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -7,7 +7,7 @@ import { CardContext } from './Card.context';
|
|
|
7
7
|
import CardActions from './CardActions';
|
|
8
8
|
import CardContent from './CardContent';
|
|
9
9
|
import { checkForComponentType, collectChildActionHandlers, extractCardActions, filterChildren, hasOnlyPotentialActions, } from './helpers';
|
|
10
|
-
const Card = ({ children, variant = 'subtle', colorScheme = 'neutralStrong', shadowColor, noPadding = false, style, states, space, disabled = false, onPress, ...rest }) => {
|
|
10
|
+
const Card = ({ children, variant = 'subtle', colorScheme = 'neutralStrong', shadowColor, noPadding = false, style, states, spacing, space, disabled = false, onPress, ...rest }) => {
|
|
11
11
|
const { active } = states || { active: false };
|
|
12
12
|
const childActionHandlers = collectChildActionHandlers(children);
|
|
13
13
|
const hasActions = checkForComponentType(children, CardActions);
|
|
@@ -31,9 +31,19 @@ const Card = ({ children, variant = 'subtle', colorScheme = 'neutralStrong', sha
|
|
|
31
31
|
hasActions,
|
|
32
32
|
hasContent,
|
|
33
33
|
hasOnlyActions,
|
|
34
|
+
spacing: space ?? spacing,
|
|
35
|
+
variant,
|
|
36
|
+
}), [
|
|
37
|
+
showPressed,
|
|
38
|
+
active,
|
|
39
|
+
hasActions,
|
|
40
|
+
hasContent,
|
|
41
|
+
hasOnlyActions,
|
|
42
|
+
noPadding,
|
|
34
43
|
space,
|
|
44
|
+
spacing,
|
|
35
45
|
variant,
|
|
36
|
-
|
|
46
|
+
]);
|
|
37
47
|
styles.useVariants({
|
|
38
48
|
variant,
|
|
39
49
|
colorScheme,
|
|
@@ -41,7 +51,7 @@ const Card = ({ children, variant = 'subtle', colorScheme = 'neutralStrong', sha
|
|
|
41
51
|
active,
|
|
42
52
|
showPressed,
|
|
43
53
|
disabled,
|
|
44
|
-
|
|
54
|
+
spacing: hasActions || hasContent || hasOnlyActions ? 'none' : spacing,
|
|
45
55
|
shadowColor,
|
|
46
56
|
});
|
|
47
57
|
const renderChildren = () => {
|
|
@@ -63,7 +73,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
63
73
|
alignItems: 'flex-start',
|
|
64
74
|
borderRadius: theme.components.card.borderRadius,
|
|
65
75
|
variants: {
|
|
66
|
-
|
|
76
|
+
spacing: theme.globalStyle.variants.spacing,
|
|
67
77
|
variant: {
|
|
68
78
|
subtle: {
|
|
69
79
|
borderWidth: theme.components.card.neutral.subtle.borderWidth,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Flex } from '../Flex';
|
|
3
3
|
const CheckboxGroupTextContent = ({ children, ...props }) => {
|
|
4
|
-
return (_jsx(Flex, { direction: "column",
|
|
4
|
+
return (_jsx(Flex, { direction: "column", spacing: "none", ...props, children: children }));
|
|
5
5
|
};
|
|
6
6
|
CheckboxGroupTextContent.displayName = 'CheckboxGroupTextContent';
|
|
7
7
|
export default CheckboxGroupTextContent;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
3
|
import { Flex } from '../Flex';
|
|
4
4
|
const CheckboxTextContent = ({ children, style, ...props }) => {
|
|
5
|
-
return (_jsx(Flex, { style: [styles.content, style], direction: "column",
|
|
5
|
+
return (_jsx(Flex, { style: [styles.content, style], direction: "column", spacing: "none", ...props, children: children }));
|
|
6
6
|
};
|
|
7
7
|
const styles = StyleSheet.create({
|
|
8
8
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type ContainerProps from './Container.props';
|
|
2
2
|
declare const Container: {
|
|
3
|
-
({ style, children, space, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ style, children, spacing, space, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default Container;
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
import { useStyleProps } from '../../hooks';
|
|
5
|
-
const Container = ({ style, children,
|
|
5
|
+
const Container = ({ style, children, spacing = 'md', space, ...props }) => {
|
|
6
6
|
const { computedStyles, remainingProps } = useStyleProps(props);
|
|
7
|
-
styles.useVariants({ space });
|
|
7
|
+
styles.useVariants({ spacing: space ?? spacing });
|
|
8
8
|
return (_jsx(View, { style: [styles.container(computedStyles), style], ...remainingProps, children: children }));
|
|
9
9
|
};
|
|
10
10
|
Container.displayName = 'Container';
|
|
@@ -33,7 +33,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
33
33
|
: undefined,
|
|
34
34
|
...extra,
|
|
35
35
|
variants: {
|
|
36
|
-
|
|
36
|
+
spacing: theme.globalStyle.variants.spacing,
|
|
37
37
|
},
|
|
38
38
|
}),
|
|
39
39
|
}));
|
|
@@ -71,8 +71,13 @@ interface ContainerProps extends ViewProps {
|
|
|
71
71
|
mb?: SpaceValue;
|
|
72
72
|
ml?: SpaceValue;
|
|
73
73
|
mr?: SpaceValue;
|
|
74
|
+
/**
|
|
75
|
+
* The spacing between child elements (gap).
|
|
76
|
+
*/
|
|
77
|
+
spacing?: SpacingValues;
|
|
74
78
|
/**
|
|
75
79
|
* The space between child elements (gap).
|
|
80
|
+
* @deprecated Use `spacing` instead. The `space` prop will be removed in a future release.
|
|
76
81
|
*/
|
|
77
82
|
space?: SpacingValues;
|
|
78
83
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type DividerProps from './Divider.props';
|
|
2
2
|
declare const Divider: {
|
|
3
|
-
({ orientation, color, space, height, width, flexItem, ...props }: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ orientation, color, spacing, space, height, width, flexItem, ...props }: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default Divider;
|