@datability/8ui 1.5.1 → 1.5.3

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.
Files changed (44) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.es.js +1445 -1361
  3. package/dist/index.es.js.map +1 -1
  4. package/dist/index.umd.js +3 -3
  5. package/dist/index.umd.js.map +1 -1
  6. package/dist/types/components/input/auto-complete/index.d.ts +2 -2
  7. package/dist/types/components/input/auto-complete/index.type.d.ts +2 -1
  8. package/dist/types/components/input/checkbox/index.d.ts +2 -2
  9. package/dist/types/components/input/checkbox/index.type.d.ts +4 -4
  10. package/dist/types/components/input/date-input/index.d.ts +2 -2
  11. package/dist/types/components/input/date-input/index.type.d.ts +2 -1
  12. package/dist/types/components/input/date-range-input/index.d.ts +2 -2
  13. package/dist/types/components/input/date-range-input/index.type.d.ts +2 -1
  14. package/dist/types/components/input/date-time-input/index.d.ts +2 -2
  15. package/dist/types/components/input/date-time-input/index.type.d.ts +2 -1
  16. package/dist/types/components/input/input-base/index.type.d.ts +4 -4
  17. package/dist/types/components/input/multi-select/index.d.ts +2 -2
  18. package/dist/types/components/input/multi-select/index.type.d.ts +2 -1
  19. package/dist/types/components/input/number-input/index.d.ts +2 -2
  20. package/dist/types/components/input/number-input/index.type.d.ts +2 -1
  21. package/dist/types/components/input/password-input/index.d.ts +2 -2
  22. package/dist/types/components/input/password-input/index.type.d.ts +2 -1
  23. package/dist/types/components/input/phone-input/index.d.ts +2 -2
  24. package/dist/types/components/input/phone-input/index.type.d.ts +2 -1
  25. package/dist/types/components/input/radio-button/index.d.ts +2 -2
  26. package/dist/types/components/input/radio-button/index.type.d.ts +4 -4
  27. package/dist/types/components/input/range-slider/index.d.ts +2 -2
  28. package/dist/types/components/input/range-slider/index.type.d.ts +4 -4
  29. package/dist/types/components/input/select/index.d.ts +2 -2
  30. package/dist/types/components/input/select/index.type.d.ts +2 -1
  31. package/dist/types/components/input/slider/index.d.ts +2 -2
  32. package/dist/types/components/input/slider/index.type.d.ts +4 -4
  33. package/dist/types/components/input/text-input/index.d.ts +2 -2
  34. package/dist/types/components/input/text-input/index.type.d.ts +2 -1
  35. package/dist/types/components/input/textarea/index.d.ts +2 -2
  36. package/dist/types/components/input/textarea/index.type.d.ts +2 -1
  37. package/dist/types/components/input/toggle/index.d.ts +2 -2
  38. package/dist/types/components/input/toggle/index.type.d.ts +4 -4
  39. package/dist/types/components/quantity/index.d.ts +2 -2
  40. package/dist/types/components/quantity/index.type.d.ts +4 -4
  41. package/dist/types/components/search-bar/index.d.ts +2 -2
  42. package/dist/types/components/search-bar/index.type.d.ts +4 -4
  43. package/dist/types/index.d.ts +2 -0
  44. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsAutoComplete } from './index.type';
3
- declare const AutoComplete: React.FC<PropsAutoComplete>;
3
+ declare const AutoComplete: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, options, loading, emptyText, children, }: PropsAutoComplete<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default AutoComplete;
@@ -1,11 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
4
  import { TSelectOption } from '../select/index.type';
4
5
  export type AutoCompleteRenderProps = {
5
6
  query: string;
6
7
  onSelect: (value: string | number) => void;
7
8
  };
8
- export type PropsAutoComplete = PropsInputField & {
9
+ export type PropsAutoComplete<T extends FieldValues = FieldValues> = PropsInputField<T> & {
9
10
  options: TSelectOption[];
10
11
  loading?: boolean;
11
12
  emptyText?: string;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsCheckbox } from './index.type';
3
- declare const Checkbox: React.FC<PropsCheckbox>;
3
+ declare const Checkbox: <T extends FieldValues = FieldValues>({ control, name, label, caption, disabled, require, fullWidth, size, isVertical, hint, isSuccess, options, }: PropsCheckbox<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Checkbox;
@@ -1,4 +1,4 @@
1
- import { Control } from 'react-hook-form';
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
2
  import { InputBaseSize } from '../input-base/index.type';
3
3
  export type CheckboxOption = {
4
4
  label: string;
@@ -6,9 +6,9 @@ export type CheckboxOption = {
6
6
  description?: string;
7
7
  indeterminate?: boolean;
8
8
  };
9
- export type PropsCheckbox = {
10
- control: Control<any>;
11
- name: string;
9
+ export type PropsCheckbox<T extends FieldValues = FieldValues> = {
10
+ control: Control<T>;
11
+ name: Path<T>;
12
12
  label?: string;
13
13
  caption?: string;
14
14
  disabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsDateInput } from './index.type';
3
- declare const DateInput: React.FC<PropsDateInput>;
3
+ declare const DateInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, min, max, }: PropsDateInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default DateInput;
@@ -1,5 +1,6 @@
1
+ import { FieldValues } from 'react-hook-form';
1
2
  import { PropsInputField } from '../input-base/index.type';
2
- export type PropsDateInput = PropsInputField & {
3
+ export type PropsDateInput<T extends FieldValues = FieldValues> = PropsInputField<T> & {
3
4
  min?: string;
4
5
  max?: string;
5
6
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsDateRangeInput } from './index.type';
3
- declare const DateRangeInput: React.FC<PropsDateRangeInput>;
3
+ declare const DateRangeInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, startPlaceholder, endPlaceholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, min, max, }: PropsDateRangeInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default DateRangeInput;
@@ -1,9 +1,10 @@
1
+ import { FieldValues } from 'react-hook-form';
1
2
  import { PropsInputField } from '../input-base/index.type';
2
3
  export type DateRangeValue = {
3
4
  start: string;
4
5
  end: string;
5
6
  };
6
- export type PropsDateRangeInput = Omit<PropsInputField, "placeholder"> & {
7
+ export type PropsDateRangeInput<T extends FieldValues = FieldValues> = Omit<PropsInputField<T>, "placeholder"> & {
7
8
  min?: string;
8
9
  max?: string;
9
10
  startPlaceholder?: string;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsDateTimeInput } from './index.type';
3
- declare const DateTimeInput: React.FC<PropsDateTimeInput>;
3
+ declare const DateTimeInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, min, max, }: PropsDateTimeInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default DateTimeInput;
@@ -1,5 +1,6 @@
1
+ import { FieldValues } from 'react-hook-form';
1
2
  import { PropsInputField } from '../input-base/index.type';
2
- export type PropsDateTimeInput = PropsInputField & {
3
+ export type PropsDateTimeInput<T extends FieldValues = FieldValues> = PropsInputField<T> & {
3
4
  min?: string;
4
5
  max?: string;
5
6
  };
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { Control, FieldError, FieldErrorsImpl, Merge } from 'react-hook-form';
2
+ import { Control, FieldError, FieldErrorsImpl, FieldValues, Merge, Path } from 'react-hook-form';
3
3
  export type InputBaseSize = "sm" | "md" | "lg" | "xl";
4
4
  export type PropsInputBase = {
5
5
  name: string;
@@ -14,9 +14,9 @@ export type PropsInputBase = {
14
14
  hint?: string;
15
15
  errorMessage: string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
16
16
  };
17
- export type PropsInputField = {
18
- control: Control<any>;
19
- name: string;
17
+ export type PropsInputField<T extends FieldValues = FieldValues> = {
18
+ control: Control<T>;
19
+ name: Path<T>;
20
20
  label?: string;
21
21
  caption?: string;
22
22
  placeholder?: string;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsMultiSelect } from './index.type';
3
- declare const MultiSelect: React.FC<PropsMultiSelect>;
3
+ declare const MultiSelect: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, require, fullWidth, size, hint, isSuccess, options, loading, children, }: PropsMultiSelect<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default MultiSelect;
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
4
  import { TSelectOption, MultiSelectRenderProps } from '../select/index.type';
4
- export type PropsMultiSelect = Omit<PropsInputField, "readOnly"> & {
5
+ export type PropsMultiSelect<T extends FieldValues = FieldValues> = Omit<PropsInputField<T>, "readOnly"> & {
5
6
  options: TSelectOption[];
6
7
  loading?: boolean;
7
8
  children?: (props: MultiSelectRenderProps) => ReactNode;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsNumberInput } from './index.type';
3
- declare const NumberInput: React.FC<PropsNumberInput>;
3
+ declare const NumberInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, icon, iconText, isSuccess, }: PropsNumberInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default NumberInput;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
- export type PropsNumberInput = PropsInputField & {
4
+ export type PropsNumberInput<T extends FieldValues = FieldValues> = PropsInputField<T> & {
4
5
  icon?: ReactNode;
5
6
  iconText?: string;
6
7
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsPasswordInput } from './index.type';
3
- declare const PasswordInput: React.FC<PropsPasswordInput>;
3
+ declare const PasswordInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, }: PropsPasswordInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default PasswordInput;
@@ -1,2 +1,3 @@
1
+ import { FieldValues } from 'react-hook-form';
1
2
  import { PropsInputField } from '../input-base/index.type';
2
- export type PropsPasswordInput = PropsInputField;
3
+ export type PropsPasswordInput<T extends FieldValues = FieldValues> = PropsInputField<T>;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsPhoneInput } from './index.type';
3
- declare const PhoneInput: React.FC<PropsPhoneInput>;
3
+ declare const PhoneInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, icon, iconText, isSuccess, }: PropsPhoneInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default PhoneInput;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
- export type PropsPhoneInput = PropsInputField & {
4
+ export type PropsPhoneInput<T extends FieldValues = FieldValues> = PropsInputField<T> & {
4
5
  icon?: ReactNode;
5
6
  iconText?: string;
6
7
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsRadioButton } from './index.type';
3
- declare const RadioButton: React.FC<PropsRadioButton>;
3
+ declare const RadioButton: <T extends FieldValues = FieldValues>({ control, name, label, caption, disabled, require, fullWidth, size, isVertical, hint, isSuccess, options, }: PropsRadioButton<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default RadioButton;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Control } from 'react-hook-form';
2
+ import { Control, FieldValues, Path } from 'react-hook-form';
3
3
  import { InputBaseSize } from '../input-base/index.type';
4
4
  export type RadioOption = {
5
5
  label: string;
@@ -7,9 +7,9 @@ export type RadioOption = {
7
7
  description?: string;
8
8
  image?: React.ReactNode;
9
9
  };
10
- export type PropsRadioButton = {
11
- control: Control<any>;
12
- name: string;
10
+ export type PropsRadioButton<T extends FieldValues = FieldValues> = {
11
+ control: Control<T>;
12
+ name: Path<T>;
13
13
  label?: string;
14
14
  caption?: string;
15
15
  disabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsRangeSliderInput } from './index.type';
3
- declare const RangeSliderInput: React.FC<PropsRangeSliderInput>;
3
+ declare const RangeSliderInput: <T extends FieldValues = FieldValues>({ control, name, min, max, disabled, className }: PropsRangeSliderInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default RangeSliderInput;
@@ -1,7 +1,7 @@
1
- import { Control } from 'react-hook-form';
2
- export type PropsRangeSliderInput = {
3
- control: Control<any>;
4
- name: string;
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
+ export type PropsRangeSliderInput<T extends FieldValues = FieldValues> = {
3
+ control: Control<T>;
4
+ name: Path<T>;
5
5
  min?: number;
6
6
  max?: number;
7
7
  disabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsSelect } from './index.type';
3
- declare const Select: React.FC<PropsSelect>;
3
+ declare const Select: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, options, loading, children, }: PropsSelect<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Select;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
4
  export type TSelectOption = {
4
5
  label: string;
@@ -12,7 +13,7 @@ export type MultiSelectRenderProps = {
12
13
  values: (string | number)[];
13
14
  onToggle: (value: string | number) => void;
14
15
  };
15
- export type PropsSelect = PropsInputField & {
16
+ export type PropsSelect<T extends FieldValues = FieldValues> = PropsInputField<T> & {
16
17
  options: TSelectOption[];
17
18
  loading?: boolean;
18
19
  children?: (props: SelectRenderProps) => ReactNode;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsSliderInput } from './index.type';
3
- declare const SliderInput: React.FC<PropsSliderInput>;
3
+ declare const SliderInput: <T extends FieldValues = FieldValues>({ control, name, min, max, disabled, className }: PropsSliderInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SliderInput;
@@ -1,7 +1,7 @@
1
- import { Control } from 'react-hook-form';
2
- export type PropsSliderInput = {
3
- control: Control<any>;
4
- name: string;
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
+ export type PropsSliderInput<T extends FieldValues = FieldValues> = {
3
+ control: Control<T>;
4
+ name: Path<T>;
5
5
  min?: number;
6
6
  max?: number;
7
7
  disabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsTextInput } from './index.type';
3
- declare const TextInput: React.FC<PropsTextInput>;
3
+ declare const TextInput: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, icon, iconText, isSuccess, }: PropsTextInput<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default TextInput;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
2
3
  import { PropsInputField } from '../input-base/index.type';
3
- export type PropsTextInput = PropsInputField & {
4
+ export type PropsTextInput<T extends FieldValues = FieldValues> = PropsInputField<T> & {
4
5
  icon?: ReactNode;
5
6
  iconText?: string;
6
7
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsTextarea } from './index.type';
3
- declare const Textarea: React.FC<PropsTextarea>;
3
+ declare const Textarea: <T extends FieldValues = FieldValues>({ control, name, label, caption, placeholder, disabled, readOnly, require, fullWidth, size, hint, isSuccess, rows, cols, }: PropsTextarea<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Textarea;
@@ -1,5 +1,6 @@
1
+ import { FieldValues } from 'react-hook-form';
1
2
  import { PropsInputField } from '../input-base/index.type';
2
- export type PropsTextarea = PropsInputField & {
3
+ export type PropsTextarea<T extends FieldValues = FieldValues> = PropsInputField<T> & {
3
4
  rows?: number;
4
5
  cols?: number;
5
6
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsToggle } from './index.type';
3
- declare const Toggle: React.FC<PropsToggle>;
3
+ declare const Toggle: <T extends FieldValues = FieldValues>({ control, name, disabled, size }: PropsToggle<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Toggle;
@@ -1,8 +1,8 @@
1
- import { Control } from 'react-hook-form';
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
2
  export type ToggleSize = "sm" | "md" | "lg";
3
- export type PropsToggle = {
4
- control: Control<any>;
5
- name: string;
3
+ export type PropsToggle<T extends FieldValues = FieldValues> = {
4
+ control: Control<T>;
5
+ name: Path<T>;
6
6
  disabled?: boolean;
7
7
  size?: ToggleSize;
8
8
  };
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsQuantity } from './index.type';
3
- declare const Quantity: React.FC<PropsQuantity>;
3
+ declare const Quantity: <T extends FieldValues = FieldValues>({ control, name, min, max, size, variant, disabled, }: PropsQuantity<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Quantity;
@@ -1,9 +1,9 @@
1
- import { Control } from 'react-hook-form';
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
2
  export type QuantitySize = "sm" | "md";
3
3
  export type QuantityVariant = "quantity" | "cart";
4
- export type PropsQuantity = {
5
- control: Control<any>;
6
- name: string;
4
+ export type PropsQuantity<T extends FieldValues = FieldValues> = {
5
+ control: Control<T>;
6
+ name: Path<T>;
7
7
  min?: number;
8
8
  max?: number;
9
9
  size?: QuantitySize;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { FieldValues } from 'react-hook-form';
2
2
  import { PropsSearchBar } from './index.type';
3
- declare const SearchBar: React.FC<PropsSearchBar>;
3
+ declare const SearchBar: <T extends FieldValues = FieldValues>({ control, name, placeholder, showIcon, size, disabled, onClear, className, }: PropsSearchBar<T>) => import("react/jsx-runtime").JSX.Element;
4
4
  export default SearchBar;
@@ -1,8 +1,8 @@
1
- import { Control } from 'react-hook-form';
1
+ import { Control, FieldValues, Path } from 'react-hook-form';
2
2
  export type SearchBarSize = "sm" | "md" | "lg" | "xl";
3
- export type PropsSearchBar = {
4
- control: Control<any>;
5
- name: string;
3
+ export type PropsSearchBar<T extends FieldValues = FieldValues> = {
4
+ control: Control<T>;
5
+ name: Path<T>;
6
6
  placeholder?: string;
7
7
  showIcon?: boolean;
8
8
  size?: SearchBarSize;
@@ -14,6 +14,8 @@ export { default as NumberInput } from './components/input/number-input';
14
14
  export type { PropsNumberInput } from './components/input/number-input/index.type';
15
15
  export { default as PhoneInput } from './components/input/phone-input';
16
16
  export type { PropsPhoneInput } from './components/input/phone-input/index.type';
17
+ export { default as PasswordInput } from './components/input/password-input';
18
+ export type { PropsPasswordInput } from './components/input/password-input/index.type';
17
19
  export { default as Textarea } from './components/input/textarea';
18
20
  export type { PropsTextarea } from './components/input/textarea/index.type';
19
21
  export { default as Calendar } from './components/calendar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datability/8ui",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {