@utilitywarehouse/hearth-react-native 0.15.1 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +14 -0
- package/build/components/BottomSheet/BottomSheetScrollView.js +2 -0
- package/build/components/Checkbox/CheckboxTileRoot.js +3 -0
- package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/build/components/CurrencyInput/CurrencyInput.js +2 -2
- package/build/components/CurrencyInput/CurrencyInput.props.d.ts +3 -1
- package/build/components/Modal/Modal.js +9 -0
- package/docs/components/AllComponents.web.tsx +8 -6
- package/package.json +2 -2
- package/src/components/BottomSheet/BottomSheetScrollView.tsx +2 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +3 -0
- package/src/components/CurrencyInput/CurrencyInput.props.ts +3 -1
- package/src/components/CurrencyInput/CurrencyInput.tsx +2 -1
- package/src/components/Modal/Modal.tsx +9 -0
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @utilitywarehouse/hearth-react-native@0.15.
|
|
2
|
+
> @utilitywarehouse/hearth-react-native@0.15.3 lint /home/runner/work/hearth/hearth/packages/react-native
|
|
3
3
|
> TIMING=1 eslint --max-warnings 0
|
|
4
4
|
|
|
5
5
|
Rule | Time (ms) | Relative
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @utilitywarehouse/hearth-react-native
|
|
2
2
|
|
|
3
|
+
## 0.15.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#801](https://github.com/utilitywarehouse/hearth/pull/801) [`6d11339`](https://github.com/utilitywarehouse/hearth/commit/6d1133997b28efa104c282522a5708f1d4d8614c) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: `Modal` without handle heading padding issue
|
|
8
|
+
|
|
9
|
+
- [#796](https://github.com/utilitywarehouse/hearth/pull/796) [`f0ccadb`](https://github.com/utilitywarehouse/hearth/commit/f0ccadbb48fb7a7a70520d7521746a63421e01cc) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: `CheckboxTile` text wrapping issue
|
|
10
|
+
|
|
11
|
+
## 0.15.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#771](https://github.com/utilitywarehouse/hearth/pull/771) [`5320be5`](https://github.com/utilitywarehouse/hearth/commit/5320be544992c137e201be7750d30ea098a7d399) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Adds missing `ref` prop to the `CurrencyInput` component
|
|
16
|
+
|
|
3
17
|
## 0.15.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -14,6 +14,8 @@ const BottomSheetScrollView = ({ children, style, contentContainerStyle, isModal
|
|
|
14
14
|
const styles = StyleSheet.create((theme, rt) => ({
|
|
15
15
|
container: {
|
|
16
16
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
17
|
+
borderTopLeftRadius: theme.components.bottomSheet.borderTopLeftRadius,
|
|
18
|
+
borderTopRightRadius: theme.components.bottomSheet.borderTopRightRadius,
|
|
17
19
|
},
|
|
18
20
|
contentContainer: {
|
|
19
21
|
paddingHorizontal: theme.components.bottomSheet.padding,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type CurrencyInputProps from './CurrencyInput.props';
|
|
2
2
|
declare const CurrencyInput: {
|
|
3
|
-
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, disableGroupSeparator, value, onChangeText, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, disableGroupSeparator, value, onChangeText, ref, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default CurrencyInput;
|
|
@@ -5,7 +5,7 @@ import { formatThousands } from '../../utils';
|
|
|
5
5
|
import { DetailText } from '../DetailText';
|
|
6
6
|
import { useFormFieldContext } from '../FormField';
|
|
7
7
|
import { Input, InputField, InputSlot } from '../Input';
|
|
8
|
-
const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required, disableGroupSeparator = false, value, onChangeText, ...rest }) => {
|
|
8
|
+
const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required, disableGroupSeparator = false, value, onChangeText, ref, ...rest }) => {
|
|
9
9
|
const formFieldContext = useFormFieldContext();
|
|
10
10
|
const { disabled: formFieldDisabled } = formFieldContext;
|
|
11
11
|
const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
|
|
@@ -21,7 +21,7 @@ const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readon
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
const displayValue = !disableGroupSeparator && typeof value === 'string' ? formatThousands(value) : value;
|
|
24
|
-
return (_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: formFieldDisabled ?? disabled, readonly: readonly, focused: focused, style: styles.wrap, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
|
|
24
|
+
return (_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: formFieldDisabled ?? disabled, readonly: readonly, focused: focused, style: styles.wrap, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, accessible: false, children: "\u00A3" }) }), _jsx(InputField, { ref: ref, inputMode: "decimal", inBottomSheet: inBottomSheet, accessibilityHint: 'Enter the amount in pounds and pence, for example "10.99"', ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
|
|
25
25
|
};
|
|
26
26
|
CurrencyInput.displayName = 'CurrencyInput';
|
|
27
27
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { TextInput, TextInputProps, ViewProps } from 'react-native';
|
|
2
3
|
export interface CurrencyInputBaseProps {
|
|
4
|
+
ref?: Ref<TextInput>;
|
|
3
5
|
disabled?: boolean;
|
|
4
6
|
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
5
7
|
readonly?: boolean;
|
|
@@ -104,6 +104,7 @@ const Modal = ({ ref, children, heading, description, showCloseButton = true, pr
|
|
|
104
104
|
bothButtons: !!(onPressPrimaryButton && onPressSecondaryButton),
|
|
105
105
|
noButtons,
|
|
106
106
|
stickyFooter,
|
|
107
|
+
showHandle: props.showHandle,
|
|
107
108
|
});
|
|
108
109
|
const footer = (_jsxs(View, { style: styles.footer, children: [onPressPrimaryButton && primaryButtonText ? (_jsx(Button, { onPress: handlePrimaryButtonPress, text: primaryButtonText, ...primaryButtonProps, variant: primaryButtonProps?.variant ?? 'solid', colorScheme: primaryButtonProps?.colorScheme ?? 'highlight' })) : null, onPressSecondaryButton && secondaryButtonText ? (_jsx(Button, { onPress: handleSecondaryButtonPress, text: secondaryButtonText, ...secondaryButtonProps, variant: secondaryButtonProps?.variant ?? 'outline', colorScheme: secondaryButtonProps?.colorScheme ?? 'functional' })) : null] }));
|
|
109
110
|
const content = (_jsx(_Fragment, { children: loading ? (_jsxs(View, { style: styles.loadingContainer, accessible: Platform.OS === 'android' ? true : undefined, accessibilityLabel: Platform.OS === 'android' ? 'Loading' : undefined, screenReaderFocusable: true, ref: viewRef, children: [_jsx(Spinner, { size: "lg" }), _jsx(Heading, { size: "lg", textAlign: "center", children: "Loading..." })] })) : (_jsxs(View, { style: styles.container, accessible: Platform.OS === 'android' ? true : undefined, accessibilityLabel: Platform.OS === 'android' ? 'Modal content' : undefined, screenReaderFocusable: true, ref: viewRef, children: [_jsxs(View, { style: styles.header, children: [_jsxs(View, { style: styles.headerTextContent, children: [heading && !image ? (_jsx(Heading, { size: "lg", accessible: true, children: heading })) : null, description && !image ? _jsx(BodyText, { accessible: true, children: description }) : null] }), showCloseButton ? (_jsx(UnstyledIconButton, { icon: CloseMediumIcon, onPress: handleCloseButtonPress, accessibilityLabel: "Close modal", ...closeButtonProps })) : null] }), image ? (_jsxs(View, { style: styles.imageContainer, children: [image, _jsxs(View, { style: styles.textContent, children: [heading ? (_jsx(Heading, { size: "lg", textAlign: "center", accessible: true, children: heading })) : null, description ? (_jsx(BodyText, { textAlign: "center", accessible: true, children: description })) : null] })] })) : null, children, !stickyFooter && !noButtons ? footer : null] })) }));
|
|
@@ -159,6 +160,14 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
159
160
|
header: {
|
|
160
161
|
flexDirection: 'row',
|
|
161
162
|
gap: theme.components.modal.gap,
|
|
163
|
+
variants: {
|
|
164
|
+
showHandle: {
|
|
165
|
+
true: {},
|
|
166
|
+
false: {
|
|
167
|
+
marginTop: -6,
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
162
171
|
},
|
|
163
172
|
headerTextContent: {
|
|
164
173
|
flex: 1,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import SpotBillingLight from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-light.svg';
|
|
20
|
-
import { Pressable, ScrollView, View, ViewProps } from 'react-native';
|
|
20
|
+
import { Image, Pressable, ScrollView, View, ViewProps } from 'react-native';
|
|
21
21
|
import { StyleSheet } from 'react-native-unistyles';
|
|
22
22
|
import {
|
|
23
23
|
Accordion,
|
|
@@ -488,11 +488,13 @@ const AllComponents: React.FC = () => {
|
|
|
488
488
|
heading="Featured Content"
|
|
489
489
|
headingColor="energy"
|
|
490
490
|
imageContainerHeight={40}
|
|
491
|
-
image={
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
image={
|
|
492
|
+
<Image
|
|
493
|
+
source={{
|
|
494
|
+
uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
|
|
495
|
+
}}
|
|
496
|
+
/>
|
|
497
|
+
}
|
|
496
498
|
description="Banner description goes here."
|
|
497
499
|
/>
|
|
498
500
|
</Center>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"vite": "^7.1.3",
|
|
56
56
|
"vite-plugin-svgr": "^4.5.0",
|
|
57
57
|
"vitest": "^3.2.4",
|
|
58
|
-
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
59
58
|
"@utilitywarehouse/hearth-react-icons": "^0.7.4",
|
|
60
59
|
"@utilitywarehouse/hearth-react-native-icons": "^0.7.4",
|
|
60
|
+
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
61
61
|
"@utilitywarehouse/hearth-svg-assets": "^0.3.0",
|
|
62
62
|
"@utilitywarehouse/hearth-tokens": "^0.2.2"
|
|
63
63
|
},
|
|
@@ -34,6 +34,8 @@ const BottomSheetScrollView = ({
|
|
|
34
34
|
const styles = StyleSheet.create((theme, rt) => ({
|
|
35
35
|
container: {
|
|
36
36
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
37
|
+
borderTopLeftRadius: theme.components.bottomSheet.borderTopLeftRadius,
|
|
38
|
+
borderTopRightRadius: theme.components.bottomSheet.borderTopRightRadius,
|
|
37
39
|
},
|
|
38
40
|
contentContainer: {
|
|
39
41
|
paddingHorizontal: theme.components.bottomSheet.padding,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { TextInput, TextInputProps, ViewProps } from 'react-native';
|
|
2
3
|
|
|
3
4
|
export interface CurrencyInputBaseProps {
|
|
5
|
+
ref?: Ref<TextInput>;
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
6
8
|
readonly?: boolean;
|
|
@@ -17,6 +17,7 @@ const CurrencyInput = ({
|
|
|
17
17
|
disableGroupSeparator = false,
|
|
18
18
|
value,
|
|
19
19
|
onChangeText,
|
|
20
|
+
ref,
|
|
20
21
|
...rest
|
|
21
22
|
}: CurrencyInputProps) => {
|
|
22
23
|
const formFieldContext = useFormFieldContext();
|
|
@@ -52,6 +53,7 @@ const CurrencyInput = ({
|
|
|
52
53
|
</DetailText>
|
|
53
54
|
</InputSlot>
|
|
54
55
|
<InputField
|
|
56
|
+
ref={ref as any}
|
|
55
57
|
inputMode="decimal"
|
|
56
58
|
inBottomSheet={inBottomSheet}
|
|
57
59
|
accessibilityHint='Enter the amount in pounds and pence, for example "10.99"'
|
|
@@ -67,7 +69,6 @@ const CurrencyInput = ({
|
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
CurrencyInput.displayName = 'CurrencyInput';
|
|
70
|
-
|
|
71
72
|
const styles = StyleSheet.create(theme => ({
|
|
72
73
|
wrap: {
|
|
73
74
|
height: theme.components.input.currency.height,
|
|
@@ -168,6 +168,7 @@ const Modal = ({
|
|
|
168
168
|
bothButtons: !!(onPressPrimaryButton && onPressSecondaryButton),
|
|
169
169
|
noButtons,
|
|
170
170
|
stickyFooter,
|
|
171
|
+
showHandle: props.showHandle,
|
|
171
172
|
});
|
|
172
173
|
|
|
173
174
|
const footer = (
|
|
@@ -349,6 +350,14 @@ const styles = StyleSheet.create((theme, rt) => ({
|
|
|
349
350
|
header: {
|
|
350
351
|
flexDirection: 'row',
|
|
351
352
|
gap: theme.components.modal.gap,
|
|
353
|
+
variants: {
|
|
354
|
+
showHandle: {
|
|
355
|
+
true: {},
|
|
356
|
+
false: {
|
|
357
|
+
marginTop: -6,
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
352
361
|
},
|
|
353
362
|
headerTextContent: {
|
|
354
363
|
flex: 1,
|