@utilitywarehouse/hearth-react-native 0.15.1 → 0.15.2

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.15.1 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.15.2 build /home/runner/work/hearth/hearth/packages/react-native
3
3
  > tsc
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.15.1 lint /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.15.2 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,11 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
3
9
  ## 0.15.1
4
10
 
5
11
  ### Patch Changes
@@ -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 { TextInputProps, ViewProps } from 'react-native';
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,6 +1,8 @@
1
- import type { TextInputProps, ViewProps } from 'react-native';
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,