@lets-events/react 11.8.1 → 12.1.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/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +21 -18
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +139 -11
- package/dist/index.d.ts +139 -11
- package/dist/index.js +1260 -361
- package/dist/index.mjs +1251 -358
- package/package.json +7 -2
- 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 +288 -287
- package/src/components/ButtonGroup.tsx +484 -484
- package/src/components/Calendar/index.tsx +146 -136
- package/src/components/Calendar/styledComponents.ts +250 -209
- package/src/components/Card.tsx +48 -48
- package/src/components/CheckboxGroup.tsx +176 -176
- package/src/components/Container.tsx +39 -39
- package/src/components/Drawer/index.tsx +129 -55
- package/src/components/Drawer/styledComponents.ts +46 -46
- package/src/components/Dropdown.tsx +302 -302
- package/src/components/Filter.tsx +164 -164
- package/src/components/Flex.tsx +118 -118
- package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
- package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
- package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
- package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
- package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
- package/src/components/FormFields/BirthDateFormField.tsx +84 -84
- package/src/components/FormFields/CNPJFormField.tsx +87 -87
- package/src/components/FormFields/CPFFormField.tsx +78 -78
- package/src/components/FormFields/CalendarFormField.tsx +92 -0
- package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
- package/src/components/FormFields/EmailFormField.tsx +27 -27
- package/src/components/FormFields/Form.tsx +39 -39
- package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +37 -40
- package/src/components/FormFields/MultiSelectFormField.tsx +64 -55
- package/src/components/FormFields/PhoneFormField.tsx +40 -40
- package/src/components/FormFields/RadioGroupFormField.tsx +84 -84
- package/src/components/FormFields/RichEditorFormField.tsx +69 -0
- package/src/components/FormFields/SelectFormField.tsx +93 -93
- package/src/components/FormFields/TextAreaFormField.tsx +57 -48
- package/src/components/FormFields/TextFormField.tsx +112 -112
- package/src/components/FormFields/TimePickerFormField.tsx +88 -0
- package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
- package/src/components/FormFields/subComponents/FormLabel.tsx +29 -29
- package/src/components/FormFields/utils/validation.ts +23 -23
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/MenuDropdown/index.tsx +38 -38
- package/src/components/MenuDropdown/styledComponents.ts +31 -31
- package/src/components/Modal.tsx +90 -90
- package/src/components/MultiSelect.tsx +311 -267
- package/src/components/RadioGroup.tsx +210 -210
- package/src/components/RichEditor/QuillComponent.tsx +413 -0
- package/src/components/RichEditor/RichEditor.tsx +38 -0
- package/src/components/RichEditor/index.ts +2 -0
- package/src/components/RichEditor/styledComponents.ts +62 -0
- 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 +372 -365
- package/src/components/TextareaField.tsx +128 -128
- package/src/components/TimePicker.tsx +325 -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/useCountries.ts +41 -41
- package/src/hooks/useImageUpload.ts +139 -0
- package/src/hooks/useOnClickOutside.tsx +42 -20
- package/src/index.tsx +67 -55
- package/src/styles/index.ts +38 -38
- package/src/types/typographyValues.ts +178 -178
- package/src/utils/getNestedValue.ts +3 -3
- package/src/utils/states.ts +29 -29
- package/src/utils/uploadService.ts +180 -0
- package/tsconfig.json +3 -3
- package/tsup.config.ts +38 -0
- package/dist/index.css +0 -171
package/.eslintrc.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@lets-events/eslint-config"
|
|
1
|
+
{
|
|
2
|
+
"extends": "@lets-events/eslint-config"
|
|
3
3
|
}
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[34mCLI[39m
|
|
7
|
-
[34mCLI[39m
|
|
8
|
-
[34mCLI[39m
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[32mESM[39m
|
|
14
|
-
[
|
|
15
|
-
[32mCJS[39m
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @lets-events/react@12.1.0 build
|
|
4
|
+
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
5
|
+
|
|
6
|
+
[1G[0K[34mCLI[39m Building entry: src/index.tsx
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.0
|
|
9
|
+
[34mCLI[39m Using tsup config: /home/bia_c/lets/design-system/packages/react/tsup.config.ts
|
|
10
|
+
[34mCLI[39m Target: es6
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[34mCJS[39m Build start
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m350.46 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 306ms
|
|
15
|
+
[32mCJS[39m [1mdist/index.js [22m[32m364.05 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 316ms
|
|
17
|
+
DTS Build start
|
|
18
|
+
DTS ⚡️ Build success in 6185ms
|
|
19
|
+
DTS dist/index.d.mts 379.16 KB
|
|
20
|
+
DTS dist/index.d.ts 379.16 KB
|
|
21
|
+
[1G[0K⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { VariantProps } from '@stitches/react';
|
|
|
13
13
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
14
14
|
import { Dialog } from 'radix-ui';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
-
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm } from 'react-hook-form';
|
|
16
|
+
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm, RegisterOptions } from 'react-hook-form';
|
|
17
17
|
|
|
18
18
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
19
19
|
name: IconName;
|
|
@@ -2690,6 +2690,7 @@ type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
|
|
|
2690
2690
|
fontWeight?: "regular" | "medium" | "semibold" | "bold";
|
|
2691
2691
|
textAlign?: "left" | "right" | "center";
|
|
2692
2692
|
mask?: MaskOptions;
|
|
2693
|
+
hasError?: boolean;
|
|
2693
2694
|
};
|
|
2694
2695
|
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
|
|
2695
2696
|
placeholder?: string;
|
|
@@ -4289,7 +4290,9 @@ type MenuDropdownProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
4289
4290
|
};
|
|
4290
4291
|
declare function MenuDropdown({ children, isOpen, setIsOpen, }: MenuDropdownProps): react_jsx_runtime.JSX.Element;
|
|
4291
4292
|
|
|
4292
|
-
declare const CalendarStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4293
|
+
declare const CalendarStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4294
|
+
expand?: boolean | "true" | undefined;
|
|
4295
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
4293
4296
|
colors: {
|
|
4294
4297
|
brand50: string;
|
|
4295
4298
|
brand100: string;
|
|
@@ -4664,11 +4667,14 @@ type CalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
|
4664
4667
|
calendarLayout?: "label" | "dropdown" | "dropdown-months" | "dropdown-years";
|
|
4665
4668
|
selected: Date | undefined;
|
|
4666
4669
|
setSelected: React__default.Dispatch<React__default.SetStateAction<Date | undefined>>;
|
|
4667
|
-
position?: "top" | "bottom";
|
|
4670
|
+
position?: "top" | "bottom" | "top-right" | "bottom-right";
|
|
4668
4671
|
action?: boolean;
|
|
4669
4672
|
actionText?: string;
|
|
4673
|
+
hasError?: boolean;
|
|
4674
|
+
expand?: boolean;
|
|
4675
|
+
allowPastDates?: boolean;
|
|
4670
4676
|
};
|
|
4671
|
-
declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
4677
|
+
declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
4672
4678
|
|
|
4673
4679
|
declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
4674
4680
|
colors: {
|
|
@@ -5051,7 +5057,9 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
|
|
|
5051
5057
|
};
|
|
5052
5058
|
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
5053
5059
|
|
|
5054
|
-
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5060
|
+
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5061
|
+
expand?: boolean | "true" | undefined;
|
|
5062
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
5055
5063
|
colors: {
|
|
5056
5064
|
brand50: string;
|
|
5057
5065
|
brand100: string;
|
|
@@ -6901,7 +6909,9 @@ declare const InputStyled: _stitches_react_types_styled_component.StyledComponen
|
|
|
6901
6909
|
transition: "transitions";
|
|
6902
6910
|
zIndex: "zIndices";
|
|
6903
6911
|
}, {}>>;
|
|
6904
|
-
declare const TimePickerButtonStyled: _stitches_react_types_styled_component.StyledComponent<"button", {
|
|
6912
|
+
declare const TimePickerButtonStyled: _stitches_react_types_styled_component.StyledComponent<"button", {
|
|
6913
|
+
expand?: boolean | "true" | undefined;
|
|
6914
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
6905
6915
|
colors: {
|
|
6906
6916
|
brand50: string;
|
|
6907
6917
|
brand100: string;
|
|
@@ -7274,9 +7284,11 @@ declare const TimePickerButtonStyled: _stitches_react_types_styled_component.Sty
|
|
|
7274
7284
|
type TimePickerProps = {
|
|
7275
7285
|
selected: string | undefined;
|
|
7276
7286
|
setSelected: React__default.Dispatch<React__default.SetStateAction<string | undefined>>;
|
|
7277
|
-
position?: "bottom" | "top";
|
|
7287
|
+
position?: "bottom" | "top" | "top-right" | "bottom-right";
|
|
7288
|
+
hasError?: boolean;
|
|
7289
|
+
expand?: boolean;
|
|
7278
7290
|
};
|
|
7279
|
-
declare function TimePicker({ selected, setSelected, position, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
7291
|
+
declare function TimePicker({ selected, setSelected, position, hasError, expand, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
7280
7292
|
|
|
7281
7293
|
declare const AlertDialogSimpleStyled: _stitches_react_types_styled_component.StyledComponent<React$1.ForwardRefExoticComponent<AlertDialog.ContentProps & React$1.RefAttributes<HTMLDivElement>>, {
|
|
7282
7294
|
color?: "info" | "warning" | "error" | "success" | undefined;
|
|
@@ -12598,7 +12610,9 @@ type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
|
|
|
12598
12610
|
zIndex?: string;
|
|
12599
12611
|
showSelectedValues?: boolean;
|
|
12600
12612
|
singleSelect?: boolean;
|
|
12613
|
+
selectedOrientation?: "row" | "column";
|
|
12601
12614
|
disabled?: boolean;
|
|
12615
|
+
maxHeight?: string;
|
|
12602
12616
|
};
|
|
12603
12617
|
declare const MultiSelect: React__default.ForwardRefExoticComponent<Omit<MultiSelectProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
12604
12618
|
|
|
@@ -14152,8 +14166,10 @@ type TextAreaFormFieldProps = TextareaFieldProps & {
|
|
|
14152
14166
|
label?: string;
|
|
14153
14167
|
required?: boolean;
|
|
14154
14168
|
placeholder?: string;
|
|
14169
|
+
validate?: (value: string) => boolean | string;
|
|
14170
|
+
validationErrorMessage?: string;
|
|
14155
14171
|
};
|
|
14156
|
-
declare const TextAreaFormField: ({ name, label, required, placeholder, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14172
|
+
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14157
14173
|
|
|
14158
14174
|
type TextFormFieldProps = TextFieldProps & {
|
|
14159
14175
|
name: string;
|
|
@@ -14180,8 +14196,11 @@ type MultiSelectFormFieldProps = MultiSelectProps & {
|
|
|
14180
14196
|
name: string;
|
|
14181
14197
|
label?: string;
|
|
14182
14198
|
required?: boolean;
|
|
14199
|
+
selectedOrientation?: "row" | "column";
|
|
14200
|
+
zIndex?: string;
|
|
14201
|
+
maxHeight?: string;
|
|
14183
14202
|
};
|
|
14184
|
-
declare const MultiSelectFormField: ({ name, label, required, ...rest }: MultiSelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14203
|
+
declare const MultiSelectFormField: ({ name, label, required, selectedOrientation, zIndex, maxHeight, ...rest }: MultiSelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14185
14204
|
|
|
14186
14205
|
type PhoneFormFieldProps = {
|
|
14187
14206
|
name: string;
|
|
@@ -14308,4 +14327,113 @@ type EmailFormFieldProps = {
|
|
|
14308
14327
|
};
|
|
14309
14328
|
declare const EmailFormField: ({ name, label, required, placeholder, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14310
14329
|
|
|
14311
|
-
|
|
14330
|
+
interface UploadConfig$1 {
|
|
14331
|
+
apiUrl: string;
|
|
14332
|
+
s3Bucket: string;
|
|
14333
|
+
s3Region: string;
|
|
14334
|
+
s3Url: string;
|
|
14335
|
+
timeout?: number;
|
|
14336
|
+
maxFileSize?: number;
|
|
14337
|
+
endpoints?: {
|
|
14338
|
+
presignedUrl: string;
|
|
14339
|
+
upload: string;
|
|
14340
|
+
};
|
|
14341
|
+
}
|
|
14342
|
+
interface RichEditorProps {
|
|
14343
|
+
value?: string;
|
|
14344
|
+
onChange?: (value: string) => void;
|
|
14345
|
+
placeholder?: string;
|
|
14346
|
+
label?: string;
|
|
14347
|
+
required?: boolean;
|
|
14348
|
+
disabled?: boolean;
|
|
14349
|
+
className?: string;
|
|
14350
|
+
uploadConfig: UploadConfig$1;
|
|
14351
|
+
}
|
|
14352
|
+
declare const RichEditor: (props: RichEditorProps) => react_jsx_runtime.JSX.Element;
|
|
14353
|
+
|
|
14354
|
+
type RichEditorFormFieldProps = Omit<RichEditorProps, "value" | "onChange"> & {
|
|
14355
|
+
name: string;
|
|
14356
|
+
label?: string;
|
|
14357
|
+
required?: boolean;
|
|
14358
|
+
validate?: (value: string) => boolean | string;
|
|
14359
|
+
validationErrorMessage?: string;
|
|
14360
|
+
uploadConfig: RichEditorProps["uploadConfig"];
|
|
14361
|
+
};
|
|
14362
|
+
declare const RichEditorFormField: ({ name, label, required, validate, validationErrorMessage, ...props }: RichEditorFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14363
|
+
|
|
14364
|
+
type CalendarFormFieldProps = Omit<CalendarProps, "selected" | "setSelected"> & {
|
|
14365
|
+
name: string;
|
|
14366
|
+
label?: string;
|
|
14367
|
+
required?: boolean;
|
|
14368
|
+
validate?: (value: Date | undefined) => boolean | string;
|
|
14369
|
+
validationErrorMessage?: string;
|
|
14370
|
+
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
14371
|
+
allowPastDates?: boolean;
|
|
14372
|
+
};
|
|
14373
|
+
declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14374
|
+
|
|
14375
|
+
type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
|
|
14376
|
+
name: string;
|
|
14377
|
+
label?: string;
|
|
14378
|
+
required?: boolean;
|
|
14379
|
+
validate?: (value: string | undefined) => boolean | string;
|
|
14380
|
+
validationErrorMessage?: string;
|
|
14381
|
+
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
14382
|
+
};
|
|
14383
|
+
declare const TimePickerFormField: ({ name, label, required, validate, validationErrorMessage, rules, ...timePickerProps }: TimePickerFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14384
|
+
|
|
14385
|
+
interface UploadConfig {
|
|
14386
|
+
apiUrl: string;
|
|
14387
|
+
s3Bucket: string;
|
|
14388
|
+
s3Region: string;
|
|
14389
|
+
s3Url: string;
|
|
14390
|
+
timeout?: number;
|
|
14391
|
+
maxFileSize?: number;
|
|
14392
|
+
endpoints?: {
|
|
14393
|
+
presignedUrl: string;
|
|
14394
|
+
upload: string;
|
|
14395
|
+
};
|
|
14396
|
+
}
|
|
14397
|
+
interface UploadResponse {
|
|
14398
|
+
url: string;
|
|
14399
|
+
filename: string;
|
|
14400
|
+
size: number;
|
|
14401
|
+
type: string;
|
|
14402
|
+
}
|
|
14403
|
+
interface UploadProgress$1 {
|
|
14404
|
+
amount: number;
|
|
14405
|
+
message: string;
|
|
14406
|
+
}
|
|
14407
|
+
declare class UploadService {
|
|
14408
|
+
static getPresignedUrl(filename: string, contentType: string, config: UploadConfig): Promise<string>;
|
|
14409
|
+
static uploadToS3(file: File, config: UploadConfig, onProgress?: (progress: UploadProgress$1) => void): Promise<UploadResponse>;
|
|
14410
|
+
static uploadViaAPI(file: File, config: UploadConfig, onProgress?: (progress: UploadProgress$1) => void): Promise<UploadResponse>;
|
|
14411
|
+
}
|
|
14412
|
+
|
|
14413
|
+
interface UploadProgress {
|
|
14414
|
+
amount: number;
|
|
14415
|
+
message: string;
|
|
14416
|
+
}
|
|
14417
|
+
interface UploadedFile {
|
|
14418
|
+
url: string;
|
|
14419
|
+
filename: string;
|
|
14420
|
+
size: number;
|
|
14421
|
+
type: string;
|
|
14422
|
+
}
|
|
14423
|
+
interface UseImageUploadOptions {
|
|
14424
|
+
onSuccess?: (file: UploadedFile) => void;
|
|
14425
|
+
onError?: (error: string) => void;
|
|
14426
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
14427
|
+
maxFileSize?: number;
|
|
14428
|
+
allowedTypes?: string[];
|
|
14429
|
+
uploadConfig: UploadConfig;
|
|
14430
|
+
}
|
|
14431
|
+
declare const useImageUpload: (options: UseImageUploadOptions) => {
|
|
14432
|
+
uploadFile: (file: File) => Promise<UploadedFile | null>;
|
|
14433
|
+
isUploading: boolean;
|
|
14434
|
+
progress: UploadProgress | null;
|
|
14435
|
+
error: string | null;
|
|
14436
|
+
reset: () => void;
|
|
14437
|
+
};
|
|
14438
|
+
|
|
14439
|
+
export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { VariantProps } from '@stitches/react';
|
|
|
13
13
|
import { MaskOptions, format, unformat } from '@react-input/mask';
|
|
14
14
|
import { Dialog } from 'radix-ui';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
-
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm } from 'react-hook-form';
|
|
16
|
+
import { FieldError, Merge, FieldErrorsImpl, FieldValues, UseFormProps, SubmitHandler, UseFormReturn, useForm, RegisterOptions } from 'react-hook-form';
|
|
17
17
|
|
|
18
18
|
interface IconProps extends Omit<FontAwesomeIconProps, "icon" | "size"> {
|
|
19
19
|
name: IconName;
|
|
@@ -2690,6 +2690,7 @@ type TextFieldProps = ComponentProps<typeof TextFieldStyled> & {
|
|
|
2690
2690
|
fontWeight?: "regular" | "medium" | "semibold" | "bold";
|
|
2691
2691
|
textAlign?: "left" | "right" | "center";
|
|
2692
2692
|
mask?: MaskOptions;
|
|
2693
|
+
hasError?: boolean;
|
|
2693
2694
|
};
|
|
2694
2695
|
type TextFieldSlotProps = Omit<ComponentProps<typeof TextFieldStyled>, "color"> & {
|
|
2695
2696
|
placeholder?: string;
|
|
@@ -4289,7 +4290,9 @@ type MenuDropdownProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
4289
4290
|
};
|
|
4290
4291
|
declare function MenuDropdown({ children, isOpen, setIsOpen, }: MenuDropdownProps): react_jsx_runtime.JSX.Element;
|
|
4291
4292
|
|
|
4292
|
-
declare const CalendarStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4293
|
+
declare const CalendarStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
4294
|
+
expand?: boolean | "true" | undefined;
|
|
4295
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
4293
4296
|
colors: {
|
|
4294
4297
|
brand50: string;
|
|
4295
4298
|
brand100: string;
|
|
@@ -4664,11 +4667,14 @@ type CalendarProps = ComponentProps<typeof CalendarStyled> & {
|
|
|
4664
4667
|
calendarLayout?: "label" | "dropdown" | "dropdown-months" | "dropdown-years";
|
|
4665
4668
|
selected: Date | undefined;
|
|
4666
4669
|
setSelected: React__default.Dispatch<React__default.SetStateAction<Date | undefined>>;
|
|
4667
|
-
position?: "top" | "bottom";
|
|
4670
|
+
position?: "top" | "bottom" | "top-right" | "bottom-right";
|
|
4668
4671
|
action?: boolean;
|
|
4669
4672
|
actionText?: string;
|
|
4673
|
+
hasError?: boolean;
|
|
4674
|
+
expand?: boolean;
|
|
4675
|
+
allowPastDates?: boolean;
|
|
4670
4676
|
};
|
|
4671
|
-
declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
4677
|
+
declare function Calendar({ action, actionText, calendarLayout, selected, setSelected, position, hasError, expand, allowPastDates, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
4672
4678
|
|
|
4673
4679
|
declare const DrawerOverlayStyled: _stitches_react_types_styled_component.StyledComponent<"div", {}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
4674
4680
|
colors: {
|
|
@@ -5051,7 +5057,9 @@ type DrawerProps = ComponentProps<typeof DrawerOverlayStyled> & {
|
|
|
5051
5057
|
};
|
|
5052
5058
|
declare function Drawer({ isOpen, onClose, width, backgroundColor, title, children, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
5053
5059
|
|
|
5054
|
-
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5060
|
+
declare const TimePickerStyled: _stitches_react_types_styled_component.StyledComponent<"div", {
|
|
5061
|
+
expand?: boolean | "true" | undefined;
|
|
5062
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
5055
5063
|
colors: {
|
|
5056
5064
|
brand50: string;
|
|
5057
5065
|
brand100: string;
|
|
@@ -6901,7 +6909,9 @@ declare const InputStyled: _stitches_react_types_styled_component.StyledComponen
|
|
|
6901
6909
|
transition: "transitions";
|
|
6902
6910
|
zIndex: "zIndices";
|
|
6903
6911
|
}, {}>>;
|
|
6904
|
-
declare const TimePickerButtonStyled: _stitches_react_types_styled_component.StyledComponent<"button", {
|
|
6912
|
+
declare const TimePickerButtonStyled: _stitches_react_types_styled_component.StyledComponent<"button", {
|
|
6913
|
+
expand?: boolean | "true" | undefined;
|
|
6914
|
+
}, {}, _stitches_react_types_css_util.CSS<{}, {
|
|
6905
6915
|
colors: {
|
|
6906
6916
|
brand50: string;
|
|
6907
6917
|
brand100: string;
|
|
@@ -7274,9 +7284,11 @@ declare const TimePickerButtonStyled: _stitches_react_types_styled_component.Sty
|
|
|
7274
7284
|
type TimePickerProps = {
|
|
7275
7285
|
selected: string | undefined;
|
|
7276
7286
|
setSelected: React__default.Dispatch<React__default.SetStateAction<string | undefined>>;
|
|
7277
|
-
position?: "bottom" | "top";
|
|
7287
|
+
position?: "bottom" | "top" | "top-right" | "bottom-right";
|
|
7288
|
+
hasError?: boolean;
|
|
7289
|
+
expand?: boolean;
|
|
7278
7290
|
};
|
|
7279
|
-
declare function TimePicker({ selected, setSelected, position, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
7291
|
+
declare function TimePicker({ selected, setSelected, position, hasError, expand, }: TimePickerProps): react_jsx_runtime.JSX.Element;
|
|
7280
7292
|
|
|
7281
7293
|
declare const AlertDialogSimpleStyled: _stitches_react_types_styled_component.StyledComponent<React$1.ForwardRefExoticComponent<AlertDialog.ContentProps & React$1.RefAttributes<HTMLDivElement>>, {
|
|
7282
7294
|
color?: "info" | "warning" | "error" | "success" | undefined;
|
|
@@ -12598,7 +12610,9 @@ type MultiSelectProps = ComponentProps<typeof StyledTrigger> & {
|
|
|
12598
12610
|
zIndex?: string;
|
|
12599
12611
|
showSelectedValues?: boolean;
|
|
12600
12612
|
singleSelect?: boolean;
|
|
12613
|
+
selectedOrientation?: "row" | "column";
|
|
12601
12614
|
disabled?: boolean;
|
|
12615
|
+
maxHeight?: string;
|
|
12602
12616
|
};
|
|
12603
12617
|
declare const MultiSelect: React__default.ForwardRefExoticComponent<Omit<MultiSelectProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
12604
12618
|
|
|
@@ -14152,8 +14166,10 @@ type TextAreaFormFieldProps = TextareaFieldProps & {
|
|
|
14152
14166
|
label?: string;
|
|
14153
14167
|
required?: boolean;
|
|
14154
14168
|
placeholder?: string;
|
|
14169
|
+
validate?: (value: string) => boolean | string;
|
|
14170
|
+
validationErrorMessage?: string;
|
|
14155
14171
|
};
|
|
14156
|
-
declare const TextAreaFormField: ({ name, label, required, placeholder, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14172
|
+
declare const TextAreaFormField: ({ name, label, required, placeholder, validate, validationErrorMessage, ...props }: TextAreaFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14157
14173
|
|
|
14158
14174
|
type TextFormFieldProps = TextFieldProps & {
|
|
14159
14175
|
name: string;
|
|
@@ -14180,8 +14196,11 @@ type MultiSelectFormFieldProps = MultiSelectProps & {
|
|
|
14180
14196
|
name: string;
|
|
14181
14197
|
label?: string;
|
|
14182
14198
|
required?: boolean;
|
|
14199
|
+
selectedOrientation?: "row" | "column";
|
|
14200
|
+
zIndex?: string;
|
|
14201
|
+
maxHeight?: string;
|
|
14183
14202
|
};
|
|
14184
|
-
declare const MultiSelectFormField: ({ name, label, required, ...rest }: MultiSelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14203
|
+
declare const MultiSelectFormField: ({ name, label, required, selectedOrientation, zIndex, maxHeight, ...rest }: MultiSelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14185
14204
|
|
|
14186
14205
|
type PhoneFormFieldProps = {
|
|
14187
14206
|
name: string;
|
|
@@ -14308,4 +14327,113 @@ type EmailFormFieldProps = {
|
|
|
14308
14327
|
};
|
|
14309
14328
|
declare const EmailFormField: ({ name, label, required, placeholder, }: EmailFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14310
14329
|
|
|
14311
|
-
|
|
14330
|
+
interface UploadConfig$1 {
|
|
14331
|
+
apiUrl: string;
|
|
14332
|
+
s3Bucket: string;
|
|
14333
|
+
s3Region: string;
|
|
14334
|
+
s3Url: string;
|
|
14335
|
+
timeout?: number;
|
|
14336
|
+
maxFileSize?: number;
|
|
14337
|
+
endpoints?: {
|
|
14338
|
+
presignedUrl: string;
|
|
14339
|
+
upload: string;
|
|
14340
|
+
};
|
|
14341
|
+
}
|
|
14342
|
+
interface RichEditorProps {
|
|
14343
|
+
value?: string;
|
|
14344
|
+
onChange?: (value: string) => void;
|
|
14345
|
+
placeholder?: string;
|
|
14346
|
+
label?: string;
|
|
14347
|
+
required?: boolean;
|
|
14348
|
+
disabled?: boolean;
|
|
14349
|
+
className?: string;
|
|
14350
|
+
uploadConfig: UploadConfig$1;
|
|
14351
|
+
}
|
|
14352
|
+
declare const RichEditor: (props: RichEditorProps) => react_jsx_runtime.JSX.Element;
|
|
14353
|
+
|
|
14354
|
+
type RichEditorFormFieldProps = Omit<RichEditorProps, "value" | "onChange"> & {
|
|
14355
|
+
name: string;
|
|
14356
|
+
label?: string;
|
|
14357
|
+
required?: boolean;
|
|
14358
|
+
validate?: (value: string) => boolean | string;
|
|
14359
|
+
validationErrorMessage?: string;
|
|
14360
|
+
uploadConfig: RichEditorProps["uploadConfig"];
|
|
14361
|
+
};
|
|
14362
|
+
declare const RichEditorFormField: ({ name, label, required, validate, validationErrorMessage, ...props }: RichEditorFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14363
|
+
|
|
14364
|
+
type CalendarFormFieldProps = Omit<CalendarProps, "selected" | "setSelected"> & {
|
|
14365
|
+
name: string;
|
|
14366
|
+
label?: string;
|
|
14367
|
+
required?: boolean;
|
|
14368
|
+
validate?: (value: Date | undefined) => boolean | string;
|
|
14369
|
+
validationErrorMessage?: string;
|
|
14370
|
+
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
14371
|
+
allowPastDates?: boolean;
|
|
14372
|
+
};
|
|
14373
|
+
declare const CalendarFormField: ({ name, label, required, validate, validationErrorMessage, rules, onChange, allowPastDates, ...calendarProps }: CalendarFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14374
|
+
|
|
14375
|
+
type TimePickerFormFieldProps = Omit<TimePickerProps, "selected" | "setSelected"> & {
|
|
14376
|
+
name: string;
|
|
14377
|
+
label?: string;
|
|
14378
|
+
required?: boolean;
|
|
14379
|
+
validate?: (value: string | undefined) => boolean | string;
|
|
14380
|
+
validationErrorMessage?: string;
|
|
14381
|
+
rules?: Omit<RegisterOptions<FieldValues, string>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
14382
|
+
};
|
|
14383
|
+
declare const TimePickerFormField: ({ name, label, required, validate, validationErrorMessage, rules, ...timePickerProps }: TimePickerFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
14384
|
+
|
|
14385
|
+
interface UploadConfig {
|
|
14386
|
+
apiUrl: string;
|
|
14387
|
+
s3Bucket: string;
|
|
14388
|
+
s3Region: string;
|
|
14389
|
+
s3Url: string;
|
|
14390
|
+
timeout?: number;
|
|
14391
|
+
maxFileSize?: number;
|
|
14392
|
+
endpoints?: {
|
|
14393
|
+
presignedUrl: string;
|
|
14394
|
+
upload: string;
|
|
14395
|
+
};
|
|
14396
|
+
}
|
|
14397
|
+
interface UploadResponse {
|
|
14398
|
+
url: string;
|
|
14399
|
+
filename: string;
|
|
14400
|
+
size: number;
|
|
14401
|
+
type: string;
|
|
14402
|
+
}
|
|
14403
|
+
interface UploadProgress$1 {
|
|
14404
|
+
amount: number;
|
|
14405
|
+
message: string;
|
|
14406
|
+
}
|
|
14407
|
+
declare class UploadService {
|
|
14408
|
+
static getPresignedUrl(filename: string, contentType: string, config: UploadConfig): Promise<string>;
|
|
14409
|
+
static uploadToS3(file: File, config: UploadConfig, onProgress?: (progress: UploadProgress$1) => void): Promise<UploadResponse>;
|
|
14410
|
+
static uploadViaAPI(file: File, config: UploadConfig, onProgress?: (progress: UploadProgress$1) => void): Promise<UploadResponse>;
|
|
14411
|
+
}
|
|
14412
|
+
|
|
14413
|
+
interface UploadProgress {
|
|
14414
|
+
amount: number;
|
|
14415
|
+
message: string;
|
|
14416
|
+
}
|
|
14417
|
+
interface UploadedFile {
|
|
14418
|
+
url: string;
|
|
14419
|
+
filename: string;
|
|
14420
|
+
size: number;
|
|
14421
|
+
type: string;
|
|
14422
|
+
}
|
|
14423
|
+
interface UseImageUploadOptions {
|
|
14424
|
+
onSuccess?: (file: UploadedFile) => void;
|
|
14425
|
+
onError?: (error: string) => void;
|
|
14426
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
14427
|
+
maxFileSize?: number;
|
|
14428
|
+
allowedTypes?: string[];
|
|
14429
|
+
uploadConfig: UploadConfig;
|
|
14430
|
+
}
|
|
14431
|
+
declare const useImageUpload: (options: UseImageUploadOptions) => {
|
|
14432
|
+
uploadFile: (file: File) => Promise<UploadedFile | null>;
|
|
14433
|
+
isUploading: boolean;
|
|
14434
|
+
progress: UploadProgress | null;
|
|
14435
|
+
error: string | null;
|
|
14436
|
+
reset: () => void;
|
|
14437
|
+
};
|
|
14438
|
+
|
|
14439
|
+
export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
|