@dsbtek/component-library 1.0.3 → 1.2.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/README.md +840 -235
- package/dist/index.d.mts +167 -2
- package/dist/index.d.ts +167 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,11 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
import { DropzoneOptions } from 'react-dropzone';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
|
-
import React__default from 'react';
|
|
5
|
+
import React__default, { Dispatch, SetStateAction, Context } from 'react';
|
|
6
6
|
import { CountryCode, E164Number, CountryCallingCode, CarrierCode, NationalNumber, NumberType } from 'libphonenumber-js';
|
|
7
|
+
import * as react_hook_form from 'react-hook-form';
|
|
8
|
+
import { FieldValues, UseFormReturn, SubmitHandler, SubmitErrorHandler } from 'react-hook-form';
|
|
9
|
+
import { ZodSchema } from 'zod';
|
|
7
10
|
|
|
8
11
|
type DateValue = Date | undefined;
|
|
9
12
|
type RangeValue = {
|
|
@@ -866,4 +869,166 @@ interface MultiSelectProps {
|
|
|
866
869
|
declare const MAX_VISIBLE_TAGS = 2;
|
|
867
870
|
declare function MultiSelect({ options, selected, onChange, placeholder, className, multiple, onLoadMore, hasMore, isDialog, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
868
871
|
|
|
869
|
-
|
|
872
|
+
type Form$1<T> = {
|
|
873
|
+
id: number;
|
|
874
|
+
label: string;
|
|
875
|
+
fields: (keyof T)[];
|
|
876
|
+
form: React__default.FC;
|
|
877
|
+
};
|
|
878
|
+
type UseMultiStepFormTypeOptions$1<T extends FieldValues> = {
|
|
879
|
+
schema: ZodSchema<T>;
|
|
880
|
+
currentStep: number;
|
|
881
|
+
setCurrentStep: Dispatch<SetStateAction<number>>;
|
|
882
|
+
form?: UseFormReturn<T>;
|
|
883
|
+
forms: Form$1<T>[];
|
|
884
|
+
saveFormData: SubmitHandler<T>;
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
type Form<T> = {
|
|
888
|
+
id: number;
|
|
889
|
+
label: string;
|
|
890
|
+
fields: (keyof T)[];
|
|
891
|
+
form: React__default.FC;
|
|
892
|
+
};
|
|
893
|
+
type UseMultiStepFormTypeOptions<T extends FieldValues> = {
|
|
894
|
+
schema: ZodSchema<T>;
|
|
895
|
+
currentStep: number;
|
|
896
|
+
setCurrentStep: Dispatch<SetStateAction<number>>;
|
|
897
|
+
form?: UseFormReturn<T>;
|
|
898
|
+
forms: Form<T>[];
|
|
899
|
+
saveFormData: SubmitHandler<T>;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Custom hook for managing a multistep form.
|
|
904
|
+
*
|
|
905
|
+
* @template T - The type of the multistep form options.
|
|
906
|
+
* @param {Context<T>} context - The React context containing the form state and methods.
|
|
907
|
+
* @returns {Object} An object containing methods and properties for managing the multistep form.
|
|
908
|
+
* @throws {Error} If the form is not defined in the context.
|
|
909
|
+
*/
|
|
910
|
+
declare function useMultiStepForm<T extends UseMultiStepFormTypeOptions<any>>(context: Context<T>): {
|
|
911
|
+
form: react_hook_form.UseFormReturn<any>;
|
|
912
|
+
currentStep: number;
|
|
913
|
+
steps: number;
|
|
914
|
+
nextStep: () => void;
|
|
915
|
+
previousStep: () => void;
|
|
916
|
+
goToStep: (index: number) => void;
|
|
917
|
+
isFirstStep: boolean;
|
|
918
|
+
isLastStep: boolean;
|
|
919
|
+
labels: string[];
|
|
920
|
+
currentStepLabel: string;
|
|
921
|
+
CurrentForm: React__default.FC<{}>;
|
|
922
|
+
onSubmit: SubmitHandler<any>;
|
|
923
|
+
onErrors: SubmitErrorHandler<any>;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
interface MultiStepNavBarProps<T> extends React__default.HTMLAttributes<HTMLElement> {
|
|
927
|
+
context: Context<T>;
|
|
928
|
+
}
|
|
929
|
+
declare function MultiStepNavbar<T extends UseMultiStepFormTypeOptions$1<any>>({ className, context, ...props }: MultiStepNavBarProps<T>): react_jsx_runtime.JSX.Element;
|
|
930
|
+
|
|
931
|
+
interface MultiStepNavButtonsProps<T> {
|
|
932
|
+
previousLabel: string;
|
|
933
|
+
nextLabel: string;
|
|
934
|
+
endStepLabel: string;
|
|
935
|
+
context: Context<T>;
|
|
936
|
+
debug?: boolean;
|
|
937
|
+
isLoading?: boolean;
|
|
938
|
+
}
|
|
939
|
+
declare function MultiStepNavButtons<T extends UseMultiStepFormTypeOptions$1<any>>({ previousLabel, nextLabel, endStepLabel, debug, context, isLoading, }: MultiStepNavButtonsProps<T>): react_jsx_runtime.JSX.Element;
|
|
940
|
+
|
|
941
|
+
declare const containerCurrentForm: {
|
|
942
|
+
hidden: {
|
|
943
|
+
opacity: number;
|
|
944
|
+
y: number;
|
|
945
|
+
};
|
|
946
|
+
visible: {
|
|
947
|
+
opacity: number;
|
|
948
|
+
y: number;
|
|
949
|
+
transition: {
|
|
950
|
+
delay: number;
|
|
951
|
+
ease: string;
|
|
952
|
+
type: string;
|
|
953
|
+
stiffness: number;
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
exit: {
|
|
957
|
+
opacity: number;
|
|
958
|
+
y: number;
|
|
959
|
+
transition: {
|
|
960
|
+
ease: string;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
declare const containerSignUpForm: {
|
|
965
|
+
hidden: {
|
|
966
|
+
opacity: number;
|
|
967
|
+
x: number;
|
|
968
|
+
};
|
|
969
|
+
visible: {
|
|
970
|
+
opacity: number;
|
|
971
|
+
x: number;
|
|
972
|
+
transition: {
|
|
973
|
+
delay: number;
|
|
974
|
+
ease: string;
|
|
975
|
+
type: string;
|
|
976
|
+
stiffness: number;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
exit: {
|
|
980
|
+
opacity: number;
|
|
981
|
+
x: number;
|
|
982
|
+
transition: {
|
|
983
|
+
ease: string;
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
declare const containerMultiStepForm: {
|
|
988
|
+
hidden: {
|
|
989
|
+
opacity: number;
|
|
990
|
+
x: number;
|
|
991
|
+
};
|
|
992
|
+
visible: {
|
|
993
|
+
opacity: number;
|
|
994
|
+
x: number;
|
|
995
|
+
transition: {
|
|
996
|
+
delay: number;
|
|
997
|
+
ease: string;
|
|
998
|
+
type: string;
|
|
999
|
+
stiffness: number;
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
exit: {
|
|
1003
|
+
opacity: number;
|
|
1004
|
+
x: number;
|
|
1005
|
+
transition: {
|
|
1006
|
+
ease: string;
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
declare const containerMultiStepNavbar: {
|
|
1011
|
+
hidden: {
|
|
1012
|
+
opacity: number;
|
|
1013
|
+
x: number;
|
|
1014
|
+
};
|
|
1015
|
+
visible: {
|
|
1016
|
+
opacity: number;
|
|
1017
|
+
x: number;
|
|
1018
|
+
transition: {
|
|
1019
|
+
delay: number;
|
|
1020
|
+
ease: string;
|
|
1021
|
+
type: string;
|
|
1022
|
+
stiffness: number;
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
exit: {
|
|
1026
|
+
opacity: number;
|
|
1027
|
+
x: number;
|
|
1028
|
+
transition: {
|
|
1029
|
+
ease: string;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
export { type AdvancedFilter, AdvancedFilterBuilder, type AdvancedFilterBuilderProps, type AdvancedSort, AdvancedSortBuilder, type AdvancedSortBuilderProps, Breadcrumbs, type BreadcrumbsProps, ColorPicker, type ColorPickerProps, type ColumnDef, type Country, DIRECTIONS, DataTable, DataTableBody, type DataTableBodyProps, type DataTableFeatures, DataTableGridView, type DataTableGridViewProps, DataTableHeader, type DataTableHeaderProps, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DataTableViewState, DateTimePicker, type DateTimePickerProps, type DateValue, FileInput, type FileInputProps, type FileWithPreview, type Form$1 as Form, type HSL, MAX_VISIBLE_TAGS, MultiSelect, type MultiSelectProps, type MultiStepNavBarProps, MultiStepNavButtons, type MultiStepNavButtonsProps, MultiStepNavbar, OPERATORS, type OptionType, PasswordInput, type PasswordInputProps, type PhoneData, PhoneInput, type PickerValue, type RGB, type RangeValue, ResizableHeader, type ResizableHeaderProps, ResponsiveAlertDialog, type ResponsiveAlertDialogProps, ResponsiveDialog, type ResponsiveDialogProps, TagInput, type TagInputProps, type UseMultiStepFormTypeOptions$1 as UseMultiStepFormTypeOptions, containerCurrentForm, containerMultiStepForm, containerMultiStepNavbar, containerSignUpForm, defaultFeatures, getPhoneData, useMultiStepForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
import { DropzoneOptions } from 'react-dropzone';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
|
-
import React__default from 'react';
|
|
5
|
+
import React__default, { Dispatch, SetStateAction, Context } from 'react';
|
|
6
6
|
import { CountryCode, E164Number, CountryCallingCode, CarrierCode, NationalNumber, NumberType } from 'libphonenumber-js';
|
|
7
|
+
import * as react_hook_form from 'react-hook-form';
|
|
8
|
+
import { FieldValues, UseFormReturn, SubmitHandler, SubmitErrorHandler } from 'react-hook-form';
|
|
9
|
+
import { ZodSchema } from 'zod';
|
|
7
10
|
|
|
8
11
|
type DateValue = Date | undefined;
|
|
9
12
|
type RangeValue = {
|
|
@@ -866,4 +869,166 @@ interface MultiSelectProps {
|
|
|
866
869
|
declare const MAX_VISIBLE_TAGS = 2;
|
|
867
870
|
declare function MultiSelect({ options, selected, onChange, placeholder, className, multiple, onLoadMore, hasMore, isDialog, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
868
871
|
|
|
869
|
-
|
|
872
|
+
type Form$1<T> = {
|
|
873
|
+
id: number;
|
|
874
|
+
label: string;
|
|
875
|
+
fields: (keyof T)[];
|
|
876
|
+
form: React__default.FC;
|
|
877
|
+
};
|
|
878
|
+
type UseMultiStepFormTypeOptions$1<T extends FieldValues> = {
|
|
879
|
+
schema: ZodSchema<T>;
|
|
880
|
+
currentStep: number;
|
|
881
|
+
setCurrentStep: Dispatch<SetStateAction<number>>;
|
|
882
|
+
form?: UseFormReturn<T>;
|
|
883
|
+
forms: Form$1<T>[];
|
|
884
|
+
saveFormData: SubmitHandler<T>;
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
type Form<T> = {
|
|
888
|
+
id: number;
|
|
889
|
+
label: string;
|
|
890
|
+
fields: (keyof T)[];
|
|
891
|
+
form: React__default.FC;
|
|
892
|
+
};
|
|
893
|
+
type UseMultiStepFormTypeOptions<T extends FieldValues> = {
|
|
894
|
+
schema: ZodSchema<T>;
|
|
895
|
+
currentStep: number;
|
|
896
|
+
setCurrentStep: Dispatch<SetStateAction<number>>;
|
|
897
|
+
form?: UseFormReturn<T>;
|
|
898
|
+
forms: Form<T>[];
|
|
899
|
+
saveFormData: SubmitHandler<T>;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Custom hook for managing a multistep form.
|
|
904
|
+
*
|
|
905
|
+
* @template T - The type of the multistep form options.
|
|
906
|
+
* @param {Context<T>} context - The React context containing the form state and methods.
|
|
907
|
+
* @returns {Object} An object containing methods and properties for managing the multistep form.
|
|
908
|
+
* @throws {Error} If the form is not defined in the context.
|
|
909
|
+
*/
|
|
910
|
+
declare function useMultiStepForm<T extends UseMultiStepFormTypeOptions<any>>(context: Context<T>): {
|
|
911
|
+
form: react_hook_form.UseFormReturn<any>;
|
|
912
|
+
currentStep: number;
|
|
913
|
+
steps: number;
|
|
914
|
+
nextStep: () => void;
|
|
915
|
+
previousStep: () => void;
|
|
916
|
+
goToStep: (index: number) => void;
|
|
917
|
+
isFirstStep: boolean;
|
|
918
|
+
isLastStep: boolean;
|
|
919
|
+
labels: string[];
|
|
920
|
+
currentStepLabel: string;
|
|
921
|
+
CurrentForm: React__default.FC<{}>;
|
|
922
|
+
onSubmit: SubmitHandler<any>;
|
|
923
|
+
onErrors: SubmitErrorHandler<any>;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
interface MultiStepNavBarProps<T> extends React__default.HTMLAttributes<HTMLElement> {
|
|
927
|
+
context: Context<T>;
|
|
928
|
+
}
|
|
929
|
+
declare function MultiStepNavbar<T extends UseMultiStepFormTypeOptions$1<any>>({ className, context, ...props }: MultiStepNavBarProps<T>): react_jsx_runtime.JSX.Element;
|
|
930
|
+
|
|
931
|
+
interface MultiStepNavButtonsProps<T> {
|
|
932
|
+
previousLabel: string;
|
|
933
|
+
nextLabel: string;
|
|
934
|
+
endStepLabel: string;
|
|
935
|
+
context: Context<T>;
|
|
936
|
+
debug?: boolean;
|
|
937
|
+
isLoading?: boolean;
|
|
938
|
+
}
|
|
939
|
+
declare function MultiStepNavButtons<T extends UseMultiStepFormTypeOptions$1<any>>({ previousLabel, nextLabel, endStepLabel, debug, context, isLoading, }: MultiStepNavButtonsProps<T>): react_jsx_runtime.JSX.Element;
|
|
940
|
+
|
|
941
|
+
declare const containerCurrentForm: {
|
|
942
|
+
hidden: {
|
|
943
|
+
opacity: number;
|
|
944
|
+
y: number;
|
|
945
|
+
};
|
|
946
|
+
visible: {
|
|
947
|
+
opacity: number;
|
|
948
|
+
y: number;
|
|
949
|
+
transition: {
|
|
950
|
+
delay: number;
|
|
951
|
+
ease: string;
|
|
952
|
+
type: string;
|
|
953
|
+
stiffness: number;
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
exit: {
|
|
957
|
+
opacity: number;
|
|
958
|
+
y: number;
|
|
959
|
+
transition: {
|
|
960
|
+
ease: string;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
declare const containerSignUpForm: {
|
|
965
|
+
hidden: {
|
|
966
|
+
opacity: number;
|
|
967
|
+
x: number;
|
|
968
|
+
};
|
|
969
|
+
visible: {
|
|
970
|
+
opacity: number;
|
|
971
|
+
x: number;
|
|
972
|
+
transition: {
|
|
973
|
+
delay: number;
|
|
974
|
+
ease: string;
|
|
975
|
+
type: string;
|
|
976
|
+
stiffness: number;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
exit: {
|
|
980
|
+
opacity: number;
|
|
981
|
+
x: number;
|
|
982
|
+
transition: {
|
|
983
|
+
ease: string;
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
declare const containerMultiStepForm: {
|
|
988
|
+
hidden: {
|
|
989
|
+
opacity: number;
|
|
990
|
+
x: number;
|
|
991
|
+
};
|
|
992
|
+
visible: {
|
|
993
|
+
opacity: number;
|
|
994
|
+
x: number;
|
|
995
|
+
transition: {
|
|
996
|
+
delay: number;
|
|
997
|
+
ease: string;
|
|
998
|
+
type: string;
|
|
999
|
+
stiffness: number;
|
|
1000
|
+
};
|
|
1001
|
+
};
|
|
1002
|
+
exit: {
|
|
1003
|
+
opacity: number;
|
|
1004
|
+
x: number;
|
|
1005
|
+
transition: {
|
|
1006
|
+
ease: string;
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
declare const containerMultiStepNavbar: {
|
|
1011
|
+
hidden: {
|
|
1012
|
+
opacity: number;
|
|
1013
|
+
x: number;
|
|
1014
|
+
};
|
|
1015
|
+
visible: {
|
|
1016
|
+
opacity: number;
|
|
1017
|
+
x: number;
|
|
1018
|
+
transition: {
|
|
1019
|
+
delay: number;
|
|
1020
|
+
ease: string;
|
|
1021
|
+
type: string;
|
|
1022
|
+
stiffness: number;
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
exit: {
|
|
1026
|
+
opacity: number;
|
|
1027
|
+
x: number;
|
|
1028
|
+
transition: {
|
|
1029
|
+
ease: string;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
export { type AdvancedFilter, AdvancedFilterBuilder, type AdvancedFilterBuilderProps, type AdvancedSort, AdvancedSortBuilder, type AdvancedSortBuilderProps, Breadcrumbs, type BreadcrumbsProps, ColorPicker, type ColorPickerProps, type ColumnDef, type Country, DIRECTIONS, DataTable, DataTableBody, type DataTableBodyProps, type DataTableFeatures, DataTableGridView, type DataTableGridViewProps, DataTableHeader, type DataTableHeaderProps, DataTablePagination, type DataTablePaginationProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DataTableViewState, DateTimePicker, type DateTimePickerProps, type DateValue, FileInput, type FileInputProps, type FileWithPreview, type Form$1 as Form, type HSL, MAX_VISIBLE_TAGS, MultiSelect, type MultiSelectProps, type MultiStepNavBarProps, MultiStepNavButtons, type MultiStepNavButtonsProps, MultiStepNavbar, OPERATORS, type OptionType, PasswordInput, type PasswordInputProps, type PhoneData, PhoneInput, type PickerValue, type RGB, type RangeValue, ResizableHeader, type ResizableHeaderProps, ResponsiveAlertDialog, type ResponsiveAlertDialogProps, ResponsiveDialog, type ResponsiveDialogProps, TagInput, type TagInputProps, type UseMultiStepFormTypeOptions$1 as UseMultiStepFormTypeOptions, containerCurrentForm, containerMultiStepForm, containerMultiStepNavbar, containerSignUpForm, defaultFeatures, getPhoneData, useMultiStepForm };
|