@lets-events/react 11.5.0 → 11.5.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/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +18 -20
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
- package/src/components/Alert.tsx +303 -303
- package/src/components/Avatar.tsx +55 -55
- package/src/components/Badge.tsx +125 -125
- package/src/components/Box.tsx +3 -3
- package/src/components/Button/index.tsx +16 -16
- package/src/components/Button/styledComponents.ts +287 -287
- package/src/components/ButtonGroup.tsx +484 -484
- package/src/components/Calendar/index.tsx +136 -136
- package/src/components/Calendar/styledComponents.ts +209 -209
- package/src/components/Card.tsx +48 -48
- package/src/components/CheckboxGroup.tsx +196 -196
- package/src/components/Container.tsx +39 -39
- package/src/components/Drawer/index.tsx +48 -48
- package/src/components/Drawer/styledComponents.ts +46 -46
- package/src/components/Dropdown.tsx +167 -167
- package/src/components/Filter.tsx +164 -164
- package/src/components/Flex.tsx +118 -118
- package/src/components/FormFields/ErrorFormMessage.tsx +36 -36
- package/src/components/FormFields/Form.tsx +25 -25
- package/src/components/FormFields/FormLabel.tsx +29 -29
- package/src/components/FormFields/MultiSelectFormField.tsx +59 -59
- package/src/components/FormFields/PhoneFormField.tsx +130 -130
- package/src/components/FormFields/TextAreaFormField.tsx +49 -46
- package/src/components/FormFields/TextFormField.tsx +46 -46
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/MenuDropdown/index.tsx +30 -30
- package/src/components/MenuDropdown/styledComponents.ts +31 -31
- package/src/components/Modal.tsx +90 -90
- package/src/components/MultiSelect.tsx +218 -218
- package/src/components/RadioGroup.tsx +210 -210
- package/src/components/Section.tsx +33 -33
- package/src/components/Step.tsx +164 -164
- package/src/components/Switch.tsx +108 -108
- package/src/components/Text.tsx +38 -38
- package/src/components/TextField.tsx +315 -315
- package/src/components/TextareaField.tsx +128 -128
- package/src/components/TimePicker.tsx +298 -298
- package/src/components/Toast/components/ToastItem.tsx +41 -41
- package/src/components/Toast/components/ToastProvider.tsx +63 -63
- package/src/components/Toast/hooks/useToast.ts +12 -12
- package/src/components/Toast/index.tsx +5 -5
- package/src/components/Toast/styles/index.ts +135 -135
- package/src/components/Toast/types/index.ts +46 -46
- package/src/components/Tooltip/index.tsx +66 -66
- package/src/components/Tooltip/styles.ts +77 -77
- package/src/hooks/useOnClickOutside.tsx +20 -20
- package/src/index.tsx +45 -45
- package/src/styles/index.ts +38 -38
- package/src/types/typographyValues.ts +178 -178
- package/tsconfig.json +3 -3
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import { useFormContext } from 'react-hook-form'
|
|
2
|
-
import { Flex } from '../Flex'
|
|
3
|
-
import { FormLabel } from './FormLabel'
|
|
4
|
-
import { ErrorFormMessage } from './ErrorFormMessage'
|
|
5
|
-
import { PhoneInput, PhoneInputProps } from 'react-international-phone'
|
|
6
|
-
import { styled } from '../../styles'
|
|
7
|
-
import { typographyValues } from '../../types/typographyValues'
|
|
8
|
-
import 'react-international-phone/style.css'
|
|
9
|
-
|
|
10
|
-
export type PhoneFormFieldProps = PhoneInputProps & {
|
|
11
|
-
name: string
|
|
12
|
-
label?: string
|
|
13
|
-
required?: boolean
|
|
14
|
-
defaultCountry?: string
|
|
15
|
-
}
|
|
16
|
-
const PhoneFormInput = styled(PhoneInput, {
|
|
17
|
-
$$borderColor: '$colors$neutral300',
|
|
18
|
-
boxSizing: 'border-box',
|
|
19
|
-
borderRadius: '$sm',
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flex: 1,
|
|
22
|
-
fontFamily: '$default',
|
|
23
|
-
color: '$dark500',
|
|
24
|
-
|
|
25
|
-
img: {
|
|
26
|
-
width: '$18',
|
|
27
|
-
height: '$18',
|
|
28
|
-
marginLeft: '$8',
|
|
29
|
-
},
|
|
30
|
-
ul: {
|
|
31
|
-
border: 'none',
|
|
32
|
-
},
|
|
33
|
-
input: {
|
|
34
|
-
height: '$40 !important',
|
|
35
|
-
flex: 1,
|
|
36
|
-
borderColor: '$$borderColor !important',
|
|
37
|
-
borderTopRightRadius: '$sm !important',
|
|
38
|
-
borderBottomRightRadius: '$sm !important',
|
|
39
|
-
fontSize: 'inherit !important',
|
|
40
|
-
'&:focus': {
|
|
41
|
-
$$borderColor: '$colors$brand300',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
button: {
|
|
45
|
-
height: '$40 !important',
|
|
46
|
-
borderRight: 'none',
|
|
47
|
-
borderTopLeftRadius: '$sm !important',
|
|
48
|
-
borderBottomLeftRadius: '$sm !important',
|
|
49
|
-
borderColor: '$$borderColor !important',
|
|
50
|
-
marginRight: '0 !important',
|
|
51
|
-
'&:active': {
|
|
52
|
-
$$borderColor: '$colors$brand300',
|
|
53
|
-
},
|
|
54
|
-
div: {
|
|
55
|
-
padding: 'auto $12',
|
|
56
|
-
gap: ' $8px',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
'&:has(input:disabled)': {
|
|
61
|
-
backgroundColor: '$dark100',
|
|
62
|
-
color: '$dark400',
|
|
63
|
-
$$borderColor: '$colors$dark200',
|
|
64
|
-
cursor: 'not-allowed',
|
|
65
|
-
img: {
|
|
66
|
-
opacity: 0.6,
|
|
67
|
-
},
|
|
68
|
-
button: {
|
|
69
|
-
$$borderColor: '$colors$dark200',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
variants: {
|
|
73
|
-
typography: typographyValues,
|
|
74
|
-
color: {
|
|
75
|
-
default: {
|
|
76
|
-
$$borderColor: '$colors$neutral300',
|
|
77
|
-
},
|
|
78
|
-
error: {
|
|
79
|
-
$$borderColor: '$colors$error600',
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
defaultVariants: {
|
|
84
|
-
typography: 'labelSmall',
|
|
85
|
-
color: 'default',
|
|
86
|
-
},
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
export const PhoneFormField = ({
|
|
90
|
-
name,
|
|
91
|
-
label,
|
|
92
|
-
required,
|
|
93
|
-
defaultCountry = 'br',
|
|
94
|
-
...props
|
|
95
|
-
}: PhoneFormFieldProps) => {
|
|
96
|
-
const {
|
|
97
|
-
register,
|
|
98
|
-
formState: { errors },
|
|
99
|
-
setValue,
|
|
100
|
-
watch,
|
|
101
|
-
} = useFormContext()
|
|
102
|
-
|
|
103
|
-
const haveError = !!errors[name]
|
|
104
|
-
const errorMsg = errors[name]?.message
|
|
105
|
-
|
|
106
|
-
const handlePhoneChange = (phone: string) => {
|
|
107
|
-
setValue(name, phone)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<Flex direction={'column'}>
|
|
112
|
-
<FormLabel
|
|
113
|
-
name={name}
|
|
114
|
-
label={label}
|
|
115
|
-
required={required}
|
|
116
|
-
haveError={haveError}
|
|
117
|
-
/>
|
|
118
|
-
<PhoneFormInput
|
|
119
|
-
{...register(name, { required })}
|
|
120
|
-
defaultCountry={defaultCountry}
|
|
121
|
-
value={watch(name)}
|
|
122
|
-
color={haveError ? 'error' : 'default'}
|
|
123
|
-
onChange={handlePhoneChange}
|
|
124
|
-
{...props}
|
|
125
|
-
aria-labelledby={`${name}-label`}
|
|
126
|
-
/>
|
|
127
|
-
<ErrorFormMessage message={errorMsg} />
|
|
128
|
-
</Flex>
|
|
129
|
-
)
|
|
130
|
-
}
|
|
1
|
+
import { useFormContext } from 'react-hook-form'
|
|
2
|
+
import { Flex } from '../Flex'
|
|
3
|
+
import { FormLabel } from './FormLabel'
|
|
4
|
+
import { ErrorFormMessage } from './ErrorFormMessage'
|
|
5
|
+
import { PhoneInput, PhoneInputProps } from 'react-international-phone'
|
|
6
|
+
import { styled } from '../../styles'
|
|
7
|
+
import { typographyValues } from '../../types/typographyValues'
|
|
8
|
+
import 'react-international-phone/style.css'
|
|
9
|
+
|
|
10
|
+
export type PhoneFormFieldProps = PhoneInputProps & {
|
|
11
|
+
name: string
|
|
12
|
+
label?: string
|
|
13
|
+
required?: boolean
|
|
14
|
+
defaultCountry?: string
|
|
15
|
+
}
|
|
16
|
+
const PhoneFormInput = styled(PhoneInput, {
|
|
17
|
+
$$borderColor: '$colors$neutral300',
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
borderRadius: '$sm',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flex: 1,
|
|
22
|
+
fontFamily: '$default',
|
|
23
|
+
color: '$dark500',
|
|
24
|
+
|
|
25
|
+
img: {
|
|
26
|
+
width: '$18',
|
|
27
|
+
height: '$18',
|
|
28
|
+
marginLeft: '$8',
|
|
29
|
+
},
|
|
30
|
+
ul: {
|
|
31
|
+
border: 'none',
|
|
32
|
+
},
|
|
33
|
+
input: {
|
|
34
|
+
height: '$40 !important',
|
|
35
|
+
flex: 1,
|
|
36
|
+
borderColor: '$$borderColor !important',
|
|
37
|
+
borderTopRightRadius: '$sm !important',
|
|
38
|
+
borderBottomRightRadius: '$sm !important',
|
|
39
|
+
fontSize: 'inherit !important',
|
|
40
|
+
'&:focus': {
|
|
41
|
+
$$borderColor: '$colors$brand300',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
button: {
|
|
45
|
+
height: '$40 !important',
|
|
46
|
+
borderRight: 'none',
|
|
47
|
+
borderTopLeftRadius: '$sm !important',
|
|
48
|
+
borderBottomLeftRadius: '$sm !important',
|
|
49
|
+
borderColor: '$$borderColor !important',
|
|
50
|
+
marginRight: '0 !important',
|
|
51
|
+
'&:active': {
|
|
52
|
+
$$borderColor: '$colors$brand300',
|
|
53
|
+
},
|
|
54
|
+
div: {
|
|
55
|
+
padding: 'auto $12',
|
|
56
|
+
gap: ' $8px',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
'&:has(input:disabled)': {
|
|
61
|
+
backgroundColor: '$dark100',
|
|
62
|
+
color: '$dark400',
|
|
63
|
+
$$borderColor: '$colors$dark200',
|
|
64
|
+
cursor: 'not-allowed',
|
|
65
|
+
img: {
|
|
66
|
+
opacity: 0.6,
|
|
67
|
+
},
|
|
68
|
+
button: {
|
|
69
|
+
$$borderColor: '$colors$dark200',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
variants: {
|
|
73
|
+
typography: typographyValues,
|
|
74
|
+
color: {
|
|
75
|
+
default: {
|
|
76
|
+
$$borderColor: '$colors$neutral300',
|
|
77
|
+
},
|
|
78
|
+
error: {
|
|
79
|
+
$$borderColor: '$colors$error600',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: {
|
|
84
|
+
typography: 'labelSmall',
|
|
85
|
+
color: 'default',
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export const PhoneFormField = ({
|
|
90
|
+
name,
|
|
91
|
+
label,
|
|
92
|
+
required,
|
|
93
|
+
defaultCountry = 'br',
|
|
94
|
+
...props
|
|
95
|
+
}: PhoneFormFieldProps) => {
|
|
96
|
+
const {
|
|
97
|
+
register,
|
|
98
|
+
formState: { errors },
|
|
99
|
+
setValue,
|
|
100
|
+
watch,
|
|
101
|
+
} = useFormContext()
|
|
102
|
+
|
|
103
|
+
const haveError = !!errors[name]
|
|
104
|
+
const errorMsg = errors[name]?.message
|
|
105
|
+
|
|
106
|
+
const handlePhoneChange = (phone: string) => {
|
|
107
|
+
setValue(name, phone)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Flex direction={'column'}>
|
|
112
|
+
<FormLabel
|
|
113
|
+
name={name}
|
|
114
|
+
label={label}
|
|
115
|
+
required={required}
|
|
116
|
+
haveError={haveError}
|
|
117
|
+
/>
|
|
118
|
+
<PhoneFormInput
|
|
119
|
+
{...register(name, { required })}
|
|
120
|
+
defaultCountry={defaultCountry}
|
|
121
|
+
value={watch(name)}
|
|
122
|
+
color={haveError ? 'error' : 'default'}
|
|
123
|
+
onChange={handlePhoneChange}
|
|
124
|
+
{...props}
|
|
125
|
+
aria-labelledby={`${name}-label`}
|
|
126
|
+
/>
|
|
127
|
+
<ErrorFormMessage message={errorMsg} />
|
|
128
|
+
</Flex>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
import { useFormContext } from
|
|
2
|
-
import { Flex } from
|
|
3
|
-
import { FormLabel } from
|
|
4
|
-
import { ErrorFormMessage } from
|
|
5
|
-
import { TextareaField } from
|
|
6
|
-
|
|
7
|
-
export type TextAreaFormFieldProps = {
|
|
8
|
-
name: string
|
|
9
|
-
label?: string
|
|
10
|
-
required?: boolean
|
|
11
|
-
placeholder?: string
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
1
|
+
import { useFormContext } from "react-hook-form";
|
|
2
|
+
import { Flex } from "../Flex";
|
|
3
|
+
import { FormLabel } from "./FormLabel";
|
|
4
|
+
import { ErrorFormMessage } from "./ErrorFormMessage";
|
|
5
|
+
import { TextareaField, TextareaFieldProps } from "../TextareaField";
|
|
6
|
+
|
|
7
|
+
export type TextAreaFormFieldProps = {
|
|
8
|
+
name: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
fieldProps?: TextareaFieldProps;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TextAreaFormField = ({
|
|
16
|
+
name,
|
|
17
|
+
label,
|
|
18
|
+
required,
|
|
19
|
+
placeholder,
|
|
20
|
+
fieldProps,
|
|
21
|
+
}: TextAreaFormFieldProps) => {
|
|
22
|
+
const {
|
|
23
|
+
register,
|
|
24
|
+
formState: { errors },
|
|
25
|
+
} = useFormContext();
|
|
26
|
+
|
|
27
|
+
const haveError = !!errors[name];
|
|
28
|
+
|
|
29
|
+
const errorMsg = errors[name]?.message;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Flex direction={"column"}>
|
|
33
|
+
<FormLabel
|
|
34
|
+
name={name}
|
|
35
|
+
label={label}
|
|
36
|
+
required={required}
|
|
37
|
+
haveError={haveError}
|
|
38
|
+
/>
|
|
39
|
+
<TextareaField
|
|
40
|
+
{...fieldProps}
|
|
41
|
+
{...register(name, { required })}
|
|
42
|
+
placeholder={placeholder}
|
|
43
|
+
color={haveError ? "error" : "default"}
|
|
44
|
+
aria-labelledby={`${name}-label`}
|
|
45
|
+
/>
|
|
46
|
+
<ErrorFormMessage message={errorMsg} />
|
|
47
|
+
</Flex>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { useFormContext } from "react-hook-form";
|
|
2
|
-
import { Flex } from "../Flex";
|
|
3
|
-
import { FormLabel } from "./FormLabel";
|
|
4
|
-
import { TextField } from "../TextField";
|
|
5
|
-
import { ErrorFormMessage } from "./ErrorFormMessage";
|
|
6
|
-
|
|
7
|
-
export type TextFormFieldProps = {
|
|
8
|
-
name: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const TextFormField = ({
|
|
15
|
-
name,
|
|
16
|
-
label,
|
|
17
|
-
required,
|
|
18
|
-
placeholder,
|
|
19
|
-
}: TextFormFieldProps) => {
|
|
20
|
-
const {
|
|
21
|
-
register,
|
|
22
|
-
formState: { errors },
|
|
23
|
-
} = useFormContext();
|
|
24
|
-
|
|
25
|
-
const haveError = !!errors[name];
|
|
26
|
-
|
|
27
|
-
const errorMsg = errors[name]?.message;
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Flex direction={"column"}>
|
|
31
|
-
<FormLabel
|
|
32
|
-
name={name}
|
|
33
|
-
label={label}
|
|
34
|
-
required={required}
|
|
35
|
-
haveError={haveError}
|
|
36
|
-
/>
|
|
37
|
-
<TextField
|
|
38
|
-
{...register(name, { required })}
|
|
39
|
-
placeholder={placeholder}
|
|
40
|
-
color={haveError ? "error" : "default"}
|
|
41
|
-
aria-labelledby={`${name}-label`}
|
|
42
|
-
/>
|
|
43
|
-
<ErrorFormMessage message={errorMsg} />
|
|
44
|
-
</Flex>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
1
|
+
import { useFormContext } from "react-hook-form";
|
|
2
|
+
import { Flex } from "../Flex";
|
|
3
|
+
import { FormLabel } from "./FormLabel";
|
|
4
|
+
import { TextField } from "../TextField";
|
|
5
|
+
import { ErrorFormMessage } from "./ErrorFormMessage";
|
|
6
|
+
|
|
7
|
+
export type TextFormFieldProps = {
|
|
8
|
+
name: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const TextFormField = ({
|
|
15
|
+
name,
|
|
16
|
+
label,
|
|
17
|
+
required,
|
|
18
|
+
placeholder,
|
|
19
|
+
}: TextFormFieldProps) => {
|
|
20
|
+
const {
|
|
21
|
+
register,
|
|
22
|
+
formState: { errors },
|
|
23
|
+
} = useFormContext();
|
|
24
|
+
|
|
25
|
+
const haveError = !!errors[name];
|
|
26
|
+
|
|
27
|
+
const errorMsg = errors[name]?.message;
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Flex direction={"column"}>
|
|
31
|
+
<FormLabel
|
|
32
|
+
name={name}
|
|
33
|
+
label={label}
|
|
34
|
+
required={required}
|
|
35
|
+
haveError={haveError}
|
|
36
|
+
/>
|
|
37
|
+
<TextField
|
|
38
|
+
{...register(name, { required })}
|
|
39
|
+
placeholder={placeholder}
|
|
40
|
+
color={haveError ? "error" : "default"}
|
|
41
|
+
aria-labelledby={`${name}-label`}
|
|
42
|
+
/>
|
|
43
|
+
<ErrorFormMessage message={errorMsg} />
|
|
44
|
+
</Flex>
|
|
45
|
+
);
|
|
46
|
+
};
|