@homefile/components-v2 1.0.5 → 1.0.7

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.
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { InputGroup, Input, InputRightElement, IconButton, FormControl, Text, } from '@chakra-ui/react';
4
4
  import { Eye, EyeOff } from '..';
5
- export const PasswordInput = ({ errorMessage, id, handleChange, hasError, placeholder = 'password', value = '', }) => {
5
+ export const PasswordInput = ({ errorMessage, id, handleChange, hasError, placeholder, value = '', }) => {
6
6
  const [show, setShow] = useState(false);
7
7
  const handleClick = () => setShow(!show);
8
8
  const ViewIcon = show ? _jsx(Eye, { size: 20 }) : _jsx(EyeOff, { size: 20 });
9
- return (_jsxs(FormControl, { isInvalid: hasError, children: [_jsxs(InputGroup, { children: [_jsx(Input, { autoCapitalize: "none", autoCorrect: "off", id: id, placeholder: placeholder, type: show ? 'text' : 'password', value: value, onChange: handleChange }), _jsx(InputRightElement, { width: "3rem", children: _jsx(IconButton, { variant: "icon", "aria-label": "Enter password", icon: ViewIcon, onClick: handleClick, _hover: {
9
+ return (_jsxs(FormControl, { isInvalid: hasError, children: [_jsxs(InputGroup, { children: [_jsx(Input, { autoComplete: "current-password", autoCapitalize: "none", autoCorrect: "off", id: id, placeholder: placeholder, type: show ? 'text' : 'password', value: value, onChange: handleChange }), _jsx(InputRightElement, { width: "3rem", children: _jsx(IconButton, { variant: "icon", "aria-label": "Enter password", icon: ViewIcon, onClick: handleClick, _hover: {
10
10
  svg: {
11
11
  fill: 'blue.3',
12
12
  },
@@ -15,7 +15,7 @@ import { isEmptyField } from '../../../utils';
15
15
  import { useSignIn } from '../../../hooks';
16
16
  export const SignIn = ({ isLoading, handleForgotPassword, handleSignIn, handleSignUp, loginError, values = { email: '', password: '' }, }) => {
17
17
  const { inputs, handleInputChange, isValidated, setIsValidated } = useSignIn(values);
18
- return (_jsxs(Box, { w: "container.full", mt: "onboarding.top", zIndex: "2", position: "relative", children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signin.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsxs(Stack, { spacing: "input.sm", children: [_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: loginError
18
+ return (_jsxs(Box, { w: "container.full", mt: "onboarding.top", zIndex: "2", position: "relative", children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signin.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsxs(Stack, { spacing: "base", as: "form", children: [_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: loginError
19
19
  ? t('forms.errorLogin')
20
20
  : t('forms.email') + ' ' + t('forms.required'), hasError: isValidated && (loginError || isEmptyField(inputs.email)), id: "email", placeholder: t('forms.email'), value: values.email || inputs.email, handleChange: (event) => {
21
21
  values.email = event.target.value;
@@ -61,7 +61,7 @@ export const formFieldsMock = [
61
61
  name: '$ Amount Paid',
62
62
  description: faker.lorem.sentence(),
63
63
  comments: faker.lorem.sentence(),
64
- value: faker.finance.amount(),
64
+ value: faker.finance.amount({ min: 10, max: 100 }),
65
65
  type: 'currency',
66
66
  visible: true,
67
67
  },
@@ -12,7 +12,7 @@ export const receiptsReceivedMock = [
12
12
  store: '',
13
13
  receiptOrigin: 'homeDepot',
14
14
  storePhone: faker.phone.number(),
15
- total: faker.finance.amount(1, 100),
15
+ total: faker.finance.amount({ min: 1, max: 100 }),
16
16
  },
17
17
  {
18
18
  assignStatus: 'filing',
@@ -26,7 +26,7 @@ export const receiptsReceivedMock = [
26
26
  store: faker.company.name(),
27
27
  receiptOrigin: 'lowes',
28
28
  storePhone: faker.phone.number(),
29
- total: faker.finance.amount(1, 100),
29
+ total: faker.finance.amount({ min: 1, max: 100 }),
30
30
  },
31
31
  {
32
32
  _id: faker.database.mongodbObjectId(),
@@ -39,7 +39,7 @@ export const receiptsReceivedMock = [
39
39
  store: faker.company.name(),
40
40
  receiptOrigin: 'lowes',
41
41
  storePhone: faker.phone.number(),
42
- total: faker.finance.amount(1, 100),
42
+ total: faker.finance.amount({ min: 1, max: 100 }),
43
43
  },
44
44
  {
45
45
  _id: faker.database.mongodbObjectId(),
@@ -52,7 +52,7 @@ export const receiptsReceivedMock = [
52
52
  store: faker.company.name(),
53
53
  receiptOrigin: 'homeDepot',
54
54
  storePhone: faker.phone.number(),
55
- total: faker.finance.amount(1, 100),
55
+ total: faker.finance.amount({ min: 1, max: 100 }),
56
56
  },
57
57
  {
58
58
  _id: faker.database.mongodbObjectId(),
@@ -65,7 +65,7 @@ export const receiptsReceivedMock = [
65
65
  store: faker.company.name(),
66
66
  receiptOrigin: 'homeDepot',
67
67
  storePhone: faker.phone.number(),
68
- total: faker.finance.amount(1, 100),
68
+ total: faker.finance.amount({ min: 1, max: 100 }),
69
69
  },
70
70
  {
71
71
  _id: faker.database.mongodbObjectId(),
@@ -78,6 +78,6 @@ export const receiptsReceivedMock = [
78
78
  store: faker.company.name(),
79
79
  receiptOrigin: 'lowes',
80
80
  storePhone: faker.phone.number(),
81
- total: faker.finance.amount(1, 100),
81
+ total: faker.finance.amount({ min: 1, max: 100 }),
82
82
  },
83
83
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -15,7 +15,7 @@ export const PasswordInput = ({
15
15
  id,
16
16
  handleChange,
17
17
  hasError,
18
- placeholder = 'password',
18
+ placeholder,
19
19
  value = '',
20
20
  }: InputI) => {
21
21
  const [show, setShow] = useState(false)
@@ -25,6 +25,7 @@ export const PasswordInput = ({
25
25
  <FormControl isInvalid={hasError}>
26
26
  <InputGroup>
27
27
  <Input
28
+ autoComplete="current-password"
28
29
  autoCapitalize="none"
29
30
  autoCorrect="off"
30
31
  id={id}
@@ -31,7 +31,8 @@ export const SignIn = ({
31
31
  <PageTitle title={t('signin.title')} />
32
32
  <Box px={['container.sm', 'container.md', 'container.lg']} mb={6}>
33
33
  <Stack spacing={8}>
34
- <Stack spacing="input.sm">
34
+ <Stack spacing="base" as="form">
35
+
35
36
  <TextInput
36
37
  autoCapitalize="none"
37
38
  autoCorrect="off"
@@ -68,6 +69,7 @@ export const SignIn = ({
68
69
  handleInputChange(event)
69
70
  }}
70
71
  />
72
+
71
73
  </Stack>
72
74
  <Stack spacing={4}>
73
75
  <Button
@@ -63,7 +63,7 @@ export const formFieldsMock: ReportI[] = [
63
63
  name: '$ Amount Paid',
64
64
  description: faker.lorem.sentence(),
65
65
  comments: faker.lorem.sentence(),
66
- value: faker.finance.amount(),
66
+ value: faker.finance.amount({ min: 10, max: 100 }),
67
67
  type: 'currency',
68
68
  visible: true,
69
69
  },
@@ -14,7 +14,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
14
14
  store: '',
15
15
  receiptOrigin: 'homeDepot',
16
16
  storePhone: faker.phone.number(),
17
- total: faker.finance.amount(1, 100),
17
+ total: faker.finance.amount({ min: 1, max: 100 }),
18
18
  },
19
19
  {
20
20
  assignStatus: 'filing',
@@ -28,7 +28,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
28
28
  store: faker.company.name(),
29
29
  receiptOrigin: 'lowes',
30
30
  storePhone: faker.phone.number(),
31
- total: faker.finance.amount(1, 100),
31
+ total: faker.finance.amount({ min: 1, max: 100 }),
32
32
  },
33
33
  {
34
34
  _id: faker.database.mongodbObjectId(),
@@ -41,7 +41,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
41
41
  store: faker.company.name(),
42
42
  receiptOrigin: 'lowes',
43
43
  storePhone: faker.phone.number(),
44
- total: faker.finance.amount(1, 100),
44
+ total: faker.finance.amount({ min: 1, max: 100 }),
45
45
  },
46
46
  {
47
47
  _id: faker.database.mongodbObjectId(),
@@ -54,7 +54,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
54
54
  store: faker.company.name(),
55
55
  receiptOrigin: 'homeDepot',
56
56
  storePhone: faker.phone.number(),
57
- total: faker.finance.amount(1, 100),
57
+ total: faker.finance.amount({ min: 1, max: 100 }),
58
58
  },
59
59
  {
60
60
  _id: faker.database.mongodbObjectId(),
@@ -67,7 +67,7 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
67
67
  store: faker.company.name(),
68
68
  receiptOrigin: 'homeDepot',
69
69
  storePhone: faker.phone.number(),
70
- total: faker.finance.amount(1, 100),
70
+ total: faker.finance.amount({ min: 1, max: 100 }),
71
71
  },
72
72
  {
73
73
  _id: faker.database.mongodbObjectId(),
@@ -80,6 +80,6 @@ export const receiptsReceivedMock: ReceiptDetailsDBI[] = [
80
80
  store: faker.company.name(),
81
81
  receiptOrigin: 'lowes',
82
82
  storePhone: faker.phone.number(),
83
- total: faker.finance.amount(1, 100),
83
+ total: faker.finance.amount({ min: 1, max: 100 }),
84
84
  },
85
85
  ]