@e-burgos/tucu-ui 1.1.0 → 1.1.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/README.md +2 -2
- package/components/common/index.d.ts +0 -1
- package/components/dialog/drawer.d.ts +1 -1
- package/components/dialog/modal.d.ts +2 -0
- package/components/dialog/sidebar-menu.d.ts +1 -1
- package/components/forms/example/index.d.ts +4 -0
- package/components/forms/index.d.ts +5 -17
- package/components/forms/types/extend-react-hook-form.type.d.ts +19 -0
- package/components/forms/types/validations.type.d.ts +8 -0
- package/components/icons/chevron-left.d.ts +1 -0
- package/components/icons/index.d.ts +1 -0
- package/components/index.d.ts +2 -1
- package/components/inputs/checkbox.d.ts +42 -0
- package/components/inputs/helpers/field-error-text.d.ts +19 -0
- package/components/inputs/helpers/field-helper-text.d.ts +18 -0
- package/components/inputs/index.d.ts +15 -0
- package/components/inputs/input-searcher.d.ts +13 -0
- package/components/inputs/input.d.ts +22 -0
- package/components/inputs/pin-code.d.ts +97 -0
- package/components/inputs/radio.d.ts +84 -0
- package/components/inputs/select.d.ts +26 -0
- package/components/inputs/switch.d.ts +15 -0
- package/components/inputs/textarea.d.ts +16 -0
- package/components/layouts/{classic/layout.d.ts → admin-layout/index.d.ts} +4 -4
- package/components/layouts/{authentication/layout.d.ts → clean-layout/index.d.ts} +2 -2
- package/components/layouts/header/admin-header.d.ts +8 -0
- package/components/layouts/header/admin-right-area.d.ts +3 -0
- package/components/layouts/header/header.d.ts +1 -8
- package/components/layouts/header/horizontal-header.d.ts +10 -0
- package/components/layouts/header/horizontal-right-area.d.ts +9 -0
- package/components/layouts/horizontal/index.d.ts +16 -0
- package/components/layouts/menus/collapsible-menu.d.ts +2 -2
- package/components/layouts/menus/expandable-sidebar.d.ts +1 -1
- package/components/layouts/menus/horizontal-nav-menu.d.ts +5 -0
- package/components/{common → layouts/menus}/menu-item.d.ts +5 -3
- package/components/layouts/root-layout.d.ts +2 -2
- package/components/legacy/forms/form-system/example/error-container-example.d.ts +3 -0
- package/components/legacy/forms/form-system/example/form-example.d.ts +3 -0
- package/components/legacy/forms/form-system/example/form-methods-example.d.ts +3 -0
- package/components/legacy/forms/form-system/example/validations.d.ts +14 -0
- package/components/legacy/forms/form-system/form-field.d.ts +14 -0
- package/components/legacy/forms/form-system/form.d.ts +13 -0
- package/components/legacy/forms/form-system/hook-form.d.ts +3 -0
- package/components/legacy/forms/form-system/types/dependencies.type.d.ts +11 -0
- package/components/legacy/forms/form-system/types/index.d.ts +3 -0
- package/components/legacy/forms/input-label.d.ts +9 -0
- package/components/legacy/forms/radio-group.d.ts +56 -0
- package/components/links/active-link.d.ts +2 -1
- package/components/logos/AppLogo.d.ts +1 -0
- package/components/logos/index.d.ts +5 -1
- package/components/logos/logo-dark.d.ts +1 -0
- package/components/logos/logo-icon.d.ts +5 -0
- package/components/logos/logo-iso-dark.d.ts +1 -0
- package/components/logos/logo-iso-light.d.ts +1 -0
- package/components/logos/logo-light.d.ts +1 -0
- package/components/logos/logo.d.ts +3 -2
- package/components/typography/index.d.ts +26 -1
- package/demo/components/hero-card.d.ts +20 -0
- package/demo/components/index.d.ts +1 -0
- package/demo/index.d.ts +2 -0
- package/demo/utils/constants.d.ts +12 -0
- package/demo/utils/index.d.ts +1 -0
- package/index.css +1 -1
- package/index.d.ts +2 -1
- package/index.js +99 -53
- package/index.mjs +39422 -38332
- package/package.json +3 -4
- package/themes/auth/components/auth-provider.d.ts +5 -0
- package/themes/auth/components/index.d.ts +1 -0
- package/themes/auth/index.d.ts +1 -0
- package/themes/components/index.d.ts +2 -0
- package/themes/components/settings/index.d.ts +4 -0
- package/themes/components/settings/lang-selector.d.ts +6 -0
- package/themes/components/settings/switch-mode.d.ts +6 -0
- package/themes/components/theme-provider/index.d.ts +4 -23
- package/themes/components/theme-provider/mfe-app-theme-provider.d.ts +8 -0
- package/themes/components/theme-provider/single-app-theme-provider.d.ts +8 -0
- package/themes/components/theme-provider/theme-wrapper.d.ts +30 -0
- package/themes/config/index.d.ts +109 -0
- package/themes/hooks/index.d.ts +3 -0
- package/themes/hooks/use-theme-color.d.ts +17 -0
- package/themes/{use-theme.d.ts → hooks/use-theme.d.ts} +51 -21
- package/themes/index.d.ts +6 -8
- package/themes/pages/fallback-page.d.ts +8 -0
- package/themes/pages/index.d.ts +2 -0
- package/themes/pages/not-found.d.ts +5 -0
- package/themes/router/components/index.d.ts +2 -0
- package/themes/router/components/mfe-app-routes-provider.d.ts +14 -0
- package/themes/router/components/single-app-routes-provider.d.ts +17 -0
- package/themes/router/hooks/index.d.ts +1 -0
- package/themes/router/hooks/use-public-error-routes-config.d.ts +6 -0
- package/themes/router/index.d.ts +2 -0
- package/themes/types/index.d.ts +15 -0
- package/components/layouts/menus/minimal-nav-menu.d.ts +0 -5
- package/components/layouts/minimal/layout.d.ts +0 -24
- package/components/logos/logo-theme.d.ts +0 -5
- package/themes/components/pages/not-found.d.ts +0 -2
- package/themes/components/theme-provider/app-routes.d.ts +0 -17
- package/themes/config.d.ts +0 -106
- package/themes/use-theme-color.d.ts +0 -10
- /package/components/forms/{form-system/example → example}/error-container-example.d.ts +0 -0
- /package/components/forms/{form-system/example → example}/form-example.d.ts +0 -0
- /package/components/forms/{form-system/example → example}/form-methods-example.d.ts +0 -0
- /package/components/forms/{form-system/example → example}/validations.d.ts +0 -0
- /package/components/forms/{form-system/form-field.d.ts → form-field.d.ts} +0 -0
- /package/components/forms/{form-system/form.d.ts → form.d.ts} +0 -0
- /package/components/forms/{form-system/hook-form.d.ts → hook-form.d.ts} +0 -0
- /package/components/forms/{form-system/types → types}/dependencies.type.d.ts +0 -0
- /package/components/forms/{form-system/types → types}/index.d.ts +0 -0
- /package/components/{forms → inputs/helpers}/input-label.d.ts +0 -0
- /package/components/{forms → inputs}/radio-group.d.ts +0 -0
- /package/components/{forms → inputs}/toggle-bar.d.ts +0 -0
- /package/components/{forms → inputs}/uploader-two.d.ts +0 -0
- /package/components/{forms → inputs}/uploader.d.ts +0 -0
- /package/components/{forms → legacy/forms}/checkbox.d.ts +0 -0
- /package/components/{forms → legacy/forms}/field-error-text.d.ts +0 -0
- /package/components/{forms → legacy/forms}/field-helper-text.d.ts +0 -0
- /package/components/{forms → legacy/forms}/file-input.d.ts +0 -0
- /package/components/{forms → legacy/forms}/form-system/index.d.ts +0 -0
- /package/components/{forms → legacy/forms}/form-system/types/extend-react-hook-form.type.d.ts +0 -0
- /package/components/{forms → legacy/forms}/form-system/types/validations.type.d.ts +0 -0
- /package/components/{forms → legacy/forms}/input-searcher.d.ts +0 -0
- /package/components/{forms → legacy/forms}/input-select.d.ts +0 -0
- /package/components/{forms → legacy/forms}/input-switch.d.ts +0 -0
- /package/components/{forms → legacy/forms}/input.d.ts +0 -0
- /package/components/{forms → legacy/forms}/pin-code.d.ts +0 -0
- /package/components/{forms → legacy/forms}/radio.d.ts +0 -0
- /package/components/{forms → legacy/forms}/textarea.d.ts +0 -0
- /package/themes/components/{theme-provider → settings}/settings-button.d.ts +0 -0
- /package/themes/components/{theme-provider → settings}/settings-drawer.d.ts +0 -0
- /package/themes/{use-direction.d.ts → hooks/use-direction.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -409,7 +409,7 @@ function ThemeControls() {
|
|
|
409
409
|
### **Comprehensive Form Components**
|
|
410
410
|
|
|
411
411
|
```tsx
|
|
412
|
-
import { Form, FormField, Input, Textarea, Checkbox, RadioGroup,
|
|
412
|
+
import { Form, FormField, Input, Textarea, Checkbox, RadioGroup, Select, PinCode, FileInput, Button } from '@e-burgos/tucu-ui';
|
|
413
413
|
```
|
|
414
414
|
|
|
415
415
|
### **Centralized Validation**
|
|
@@ -469,7 +469,7 @@ function UserRegistrationForm() {
|
|
|
469
469
|
</FormField>
|
|
470
470
|
|
|
471
471
|
<FormField<UserFormData> name="country" label="Country">
|
|
472
|
-
<
|
|
472
|
+
<Select
|
|
473
473
|
options={[
|
|
474
474
|
{ name: 'United States', value: 'us' },
|
|
475
475
|
{ name: 'Canada', value: 'ca' },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { LogoPropTypes } from '../logos/logo';
|
|
3
|
-
import { IMenuItem } from '../
|
|
3
|
+
import { IMenuItem } from '../layouts/menus/menu-item';
|
|
4
4
|
export interface DrawerProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
type: 'sidebar' | 'sidebar-menu';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { LogoPropTypes } from '../logos/logo';
|
|
3
|
-
import { IMenuItem } from '../
|
|
3
|
+
import { IMenuItem } from '../layouts/menus/menu-item';
|
|
4
4
|
export declare function SidebarMenu({ className, menuItems, children, title, actionContent, onClose, logo, }: {
|
|
5
5
|
className?: string;
|
|
6
6
|
menuItems: IMenuItem[];
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './field
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './input-searcher';
|
|
7
|
-
export * from './input-switch';
|
|
8
|
-
export * from './input';
|
|
9
|
-
export * from './input-select';
|
|
10
|
-
export * from './pin-code';
|
|
11
|
-
export * from './radio';
|
|
12
|
-
export * from './radio-group';
|
|
13
|
-
export * from './textarea';
|
|
14
|
-
export * from './toggle-bar';
|
|
15
|
-
export * from './uploader-two';
|
|
16
|
-
export * from './uploader';
|
|
17
|
-
export * from './form-system';
|
|
1
|
+
export * from './example';
|
|
2
|
+
export * from './form-field';
|
|
3
|
+
export * from './form';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './hook-form';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
2
|
+
export type BrowserNativeObject = Date | FileList | File;
|
|
3
|
+
export type IsEqual<T1, T2> = T1 extends T2 ? (<G>() => G extends T1 ? 1 : 2) extends <G>() => G extends T2 ? 1 : 2 ? true : false : false;
|
|
4
|
+
export type IsTuple<T extends ReadonlyArray<unknown>> = number extends T['length'] ? false : true;
|
|
5
|
+
export type TupleKeys<T extends ReadonlyArray<unknown>> = Exclude<keyof T, keyof unknown[]>;
|
|
6
|
+
export type ValidateResult = string | boolean | undefined;
|
|
7
|
+
export type ArrayKey = '[number]';
|
|
8
|
+
type AnyIsEqual<T1, T2> = T1 extends T2 ? IsEqual<T1, T2> extends true ? true : never : never;
|
|
9
|
+
type PathImpl<K extends string | number, V, TraversedTypes, ArrayK extends string | number> = V extends Primitive | BrowserNativeObject ? `${K}` : true extends AnyIsEqual<TraversedTypes, V> ? `${K}` : `${K}` | `${K}.${FieldPathInternal<V, ArrayK, TraversedTypes | V>}`;
|
|
10
|
+
export type FieldPathInternal<T, ArrayK extends string | number, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
11
|
+
[K in TupleKeys<T>]-?: PathImpl<K & string, T[K], TraversedTypes, ArrayK>;
|
|
12
|
+
}[TupleKeys<T>] : PathImpl<ArrayK, V, TraversedTypes, ArrayK> : {
|
|
13
|
+
[K in keyof T]-?: PathImpl<K & string, T[K], TraversedTypes, ArrayK>;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
export type InternalValidate<TFieldValue, TFormValues> = (value: TFieldValue, formValues: TFormValues, options: {
|
|
16
|
+
index: number | null;
|
|
17
|
+
name: string | null;
|
|
18
|
+
}) => ValidateResult | Promise<ValidateResult>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldValues, RegisterOptions, FieldPath, FieldPathValue } from 'react-hook-form';
|
|
2
|
+
import { FieldPathInternal, ArrayKey, InternalValidate } from './extend-react-hook-form.type';
|
|
3
|
+
export type Rules<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<RegisterOptions<TFieldValues>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled' | 'validate'> & {
|
|
4
|
+
validate?: InternalValidate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<never, InternalValidate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
|
5
|
+
};
|
|
6
|
+
export type FormValidations<TFieldValues extends FieldValues = FieldValues> = {
|
|
7
|
+
[key in FieldPathInternal<TFieldValues, ArrayKey>]?: Rules<TFieldValues>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ChevronLeft(props: React.SVGAttributes<SVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ export * from './check';
|
|
|
15
15
|
export * from './checkmark';
|
|
16
16
|
export * from './chevron-down';
|
|
17
17
|
export * from './chevron-forward';
|
|
18
|
+
export * from './chevron-left';
|
|
18
19
|
export * from './chevron-right';
|
|
19
20
|
export * from './classic-layout-icon';
|
|
20
21
|
export * from './close';
|
package/components/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './cards';
|
|
|
5
5
|
export * from './carousel';
|
|
6
6
|
export * from './common';
|
|
7
7
|
export * from './dialog';
|
|
8
|
-
export * from './forms';
|
|
9
8
|
export * from './tabs';
|
|
10
9
|
export * from './icons';
|
|
11
10
|
export * from './links';
|
|
@@ -14,3 +13,5 @@ export * from './logos';
|
|
|
14
13
|
export * from './notifications';
|
|
15
14
|
export * from './typography';
|
|
16
15
|
export * from './utils';
|
|
16
|
+
export * from './forms';
|
|
17
|
+
export * from './inputs';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
2
|
+
/** The size of the component */
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
/** Change input color */
|
|
5
|
+
color?: 'primary' | 'secondary' | 'danger' | 'info' | 'success' | 'warning';
|
|
6
|
+
/** Available directions of the label are: */
|
|
7
|
+
labelPlacement?: 'start' | 'end';
|
|
8
|
+
/** Whether the input is disabled */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Set field label */
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
/** Show error message using this prop */
|
|
13
|
+
error?: string;
|
|
14
|
+
/** Add helper text. It could be string or a React component */
|
|
15
|
+
helperText?: React.ReactNode;
|
|
16
|
+
/** Use className prop to apply style for entire component */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Use activeClassName prop to apply style on active component from checkboxGroup */
|
|
19
|
+
activeClassName?: string;
|
|
20
|
+
/** Use containerClassName prop to apply some additional style for label and checkbox container */
|
|
21
|
+
containerClassName?: string;
|
|
22
|
+
/** Use iconClassName prop to apply some additonal style for check mark icon */
|
|
23
|
+
iconClassName?: string;
|
|
24
|
+
/** Use labelClassName prop to apply some addition style for the field label */
|
|
25
|
+
labelClassName?: string;
|
|
26
|
+
/** Add custom classes for the input filed extra style */
|
|
27
|
+
inputClassName?: string;
|
|
28
|
+
/** This prop allows you to customize the error message style */
|
|
29
|
+
errorClassName?: string;
|
|
30
|
+
/** This prop allows you to customize the helper message style */
|
|
31
|
+
helperClassName?: string;
|
|
32
|
+
/** The variant of the component */
|
|
33
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
34
|
+
/** The shape of the component */
|
|
35
|
+
shape?: 'rounded' | 'square';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A simplified checkbox component that uses a single color-based styling approach.
|
|
39
|
+
* The checkbox changes appearance based on its state (unchecked, checked, hover, focus, disabled).
|
|
40
|
+
*/
|
|
41
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
42
|
+
export default Checkbox;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const fieldErrorClasses: {
|
|
3
|
+
base: string;
|
|
4
|
+
size: {
|
|
5
|
+
sm: string;
|
|
6
|
+
md: string;
|
|
7
|
+
lg: string;
|
|
8
|
+
xl: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export interface FieldErrorProps extends React.HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
12
|
+
tag?: 'div' | 'span';
|
|
13
|
+
error: string | null | undefined;
|
|
14
|
+
size?: keyof typeof fieldErrorClasses.size;
|
|
15
|
+
className?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function FieldError({ tag, error, size, className, id, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default FieldError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const helperTextClasses: {
|
|
3
|
+
base: string;
|
|
4
|
+
size: {
|
|
5
|
+
sm: string;
|
|
6
|
+
md: string;
|
|
7
|
+
lg: string;
|
|
8
|
+
xl: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export interface FieldHelperTextProps extends React.HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
|
|
12
|
+
tag?: 'div' | 'span';
|
|
13
|
+
size?: keyof typeof helperTextClasses.size;
|
|
14
|
+
className?: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function FieldHelperText({ size, tag, children, className, id, ...props }: React.PropsWithChildren<FieldHelperTextProps>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default FieldHelperText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './checkbox';
|
|
2
|
+
export * from './helpers/field-error-text';
|
|
3
|
+
export * from './helpers/field-helper-text';
|
|
4
|
+
export * from './helpers/input-label';
|
|
5
|
+
export * from './input-searcher';
|
|
6
|
+
export * from './input';
|
|
7
|
+
export * from './pin-code';
|
|
8
|
+
export * from './radio-group';
|
|
9
|
+
export * from './radio';
|
|
10
|
+
export * from './select';
|
|
11
|
+
export * from './switch';
|
|
12
|
+
export * from './textarea';
|
|
13
|
+
export * from './toggle-bar';
|
|
14
|
+
export * from './uploader-two';
|
|
15
|
+
export * from './uploader';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectOption } from './select';
|
|
3
|
+
export declare function InputSearcher({ label, onOptionSelect, options, initialValue, noMatchesMessage, multiple, variant, disabled, ...props }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
initialValue?: string | number;
|
|
6
|
+
onOptionSelect?: (option: SelectOption | SelectOption[]) => void;
|
|
7
|
+
options?: SelectOption[];
|
|
8
|
+
noMatchesMessage?: string;
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default InputSearcher;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type DateFormat = 'DD-MM-YYYY' | 'MM-DD-YYYY' | 'YYYY-MM-DD' | 'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY/MM/DD';
|
|
2
|
+
export type InputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
6
|
+
className?: string;
|
|
7
|
+
inputClassName?: string;
|
|
8
|
+
labelClassName?: string;
|
|
9
|
+
useUppercaseLabel?: boolean;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
suffix?: React.ReactNode;
|
|
12
|
+
suffixClassName?: string;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
dateFormat?: DateFormat;
|
|
15
|
+
};
|
|
16
|
+
export declare const inputVariantClasses: {
|
|
17
|
+
ghost: string;
|
|
18
|
+
solid: string;
|
|
19
|
+
transparent: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const Input: import('react').ForwardRefExoticComponent<Omit<InputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
22
|
+
export default Input;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const inputClasses: {
|
|
3
|
+
base: string;
|
|
4
|
+
numberType: string;
|
|
5
|
+
error: string;
|
|
6
|
+
size: {
|
|
7
|
+
sm: string;
|
|
8
|
+
md: string;
|
|
9
|
+
lg: string;
|
|
10
|
+
xl: string;
|
|
11
|
+
};
|
|
12
|
+
rounded: {
|
|
13
|
+
none: string;
|
|
14
|
+
sm: string;
|
|
15
|
+
md: string;
|
|
16
|
+
lg: string;
|
|
17
|
+
full: string;
|
|
18
|
+
};
|
|
19
|
+
variant: {
|
|
20
|
+
ghost: {
|
|
21
|
+
base: string;
|
|
22
|
+
color: {
|
|
23
|
+
primary: string;
|
|
24
|
+
secondary: string;
|
|
25
|
+
danger: string;
|
|
26
|
+
info: string;
|
|
27
|
+
success: string;
|
|
28
|
+
warning: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
solid: {
|
|
32
|
+
base: string;
|
|
33
|
+
color: {
|
|
34
|
+
primary: string;
|
|
35
|
+
secondary: string;
|
|
36
|
+
danger: string;
|
|
37
|
+
info: string;
|
|
38
|
+
success: string;
|
|
39
|
+
warning: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
transparent: {
|
|
43
|
+
base: string;
|
|
44
|
+
color: {
|
|
45
|
+
primary: string;
|
|
46
|
+
secondary: string;
|
|
47
|
+
danger: string;
|
|
48
|
+
info: string;
|
|
49
|
+
success: string;
|
|
50
|
+
warning: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export interface PinCodeProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange'> {
|
|
56
|
+
/** Current value of the pin code */
|
|
57
|
+
value?: string;
|
|
58
|
+
/** Callback function called when pin code changes */
|
|
59
|
+
onChange?: (value: string) => void;
|
|
60
|
+
/** This Pin Code component only support these two types */
|
|
61
|
+
type?: 'text' | 'number';
|
|
62
|
+
/** Mask and unmask to hide and show pin code */
|
|
63
|
+
mask?: boolean;
|
|
64
|
+
/** Set pin code length */
|
|
65
|
+
length?: number;
|
|
66
|
+
/** Make pin code horizontally center */
|
|
67
|
+
center?: boolean;
|
|
68
|
+
/** Set placeholder text */
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
/** The size of the component. `"sm"` is equivalent to the dense input styling. */
|
|
71
|
+
size?: keyof typeof inputClasses.size;
|
|
72
|
+
/** The rounded variants are: */
|
|
73
|
+
rounded?: keyof typeof inputClasses.rounded;
|
|
74
|
+
/** The variants of the component are: */
|
|
75
|
+
variant?: keyof typeof inputClasses.variant;
|
|
76
|
+
/** Change input color */
|
|
77
|
+
color?: keyof (typeof inputClasses.variant)['ghost']['color'];
|
|
78
|
+
/** Show error message using this prop */
|
|
79
|
+
error?: string;
|
|
80
|
+
/** Add custom classes for the input filed extra style */
|
|
81
|
+
inputClassName?: string;
|
|
82
|
+
/** This prop allows you to customize the error message style */
|
|
83
|
+
errorClassName?: string;
|
|
84
|
+
/** This prop allows you to add a helper text to the pin code component */
|
|
85
|
+
helperText?: string;
|
|
86
|
+
/** This prop allows you to add a helper text to the pin code component */
|
|
87
|
+
helperTextClassName?: string;
|
|
88
|
+
/** This prop allows you to make the pin code component full width */
|
|
89
|
+
fullWidth?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A basic widget for getting pin code. Here is the API documentation of the Pin Code component.
|
|
93
|
+
* And the rest of the props of PinCode are the same as the original html input field.
|
|
94
|
+
* You can use props like `disabled`, `placeholder`, `defaultValue` etc.
|
|
95
|
+
*/
|
|
96
|
+
export declare function PinCode({ type, value, onChange, mask, length, center, size, rounded, variant, color, placeholder, error, className, inputClassName, errorClassName, helperText, helperTextClassName, fullWidth, ...props }: PinCodeProps): import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export default PinCode;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const inputClasses: {
|
|
3
|
+
base: string;
|
|
4
|
+
size: {
|
|
5
|
+
sm: string;
|
|
6
|
+
md: string;
|
|
7
|
+
lg: string;
|
|
8
|
+
xl: string;
|
|
9
|
+
};
|
|
10
|
+
variant: {
|
|
11
|
+
ghost: {
|
|
12
|
+
base: string;
|
|
13
|
+
color: {
|
|
14
|
+
primary: string;
|
|
15
|
+
secondary: string;
|
|
16
|
+
danger: string;
|
|
17
|
+
info: string;
|
|
18
|
+
success: string;
|
|
19
|
+
warning: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
solid: {
|
|
23
|
+
base: string;
|
|
24
|
+
color: {
|
|
25
|
+
primary: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
danger: string;
|
|
28
|
+
info: string;
|
|
29
|
+
success: string;
|
|
30
|
+
warning: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
transparent: {
|
|
34
|
+
base: string;
|
|
35
|
+
color: {
|
|
36
|
+
primary: string;
|
|
37
|
+
secondary: string;
|
|
38
|
+
danger: string;
|
|
39
|
+
info: string;
|
|
40
|
+
success: string;
|
|
41
|
+
warning: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
47
|
+
/** The variants of the component are: */
|
|
48
|
+
variant?: keyof typeof inputClasses.variant;
|
|
49
|
+
/** The size of the component. `"sm"` is equivalent to the dense input styling. */
|
|
50
|
+
size?: keyof typeof inputClasses.size;
|
|
51
|
+
/** Change radio button color */
|
|
52
|
+
color?: keyof typeof inputClasses.variant.ghost.color;
|
|
53
|
+
/** Available directions of the label are: */
|
|
54
|
+
labelPlacement?: 'start' | 'end';
|
|
55
|
+
/** Whether the input is disabled */
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/** Set field label */
|
|
58
|
+
label?: React.ReactNode;
|
|
59
|
+
/** Show error message using this prop */
|
|
60
|
+
error?: string;
|
|
61
|
+
/** Add helper text. It could be string or a React component */
|
|
62
|
+
helperText?: React.ReactNode;
|
|
63
|
+
/** Use className prop to apply style for entire component */
|
|
64
|
+
className?: string;
|
|
65
|
+
/** Use activeClassName prop to apply style on active component from radioGroup */
|
|
66
|
+
activeClassName?: string;
|
|
67
|
+
/** Use containerClassName prop to apply some additional style for label and radio container */
|
|
68
|
+
containerClassName?: string;
|
|
69
|
+
/** Use labelClassName prop to apply some addition style for the field label */
|
|
70
|
+
labelClassName?: string;
|
|
71
|
+
/** Add custom classes for the input filed extra style */
|
|
72
|
+
inputClassName?: string;
|
|
73
|
+
/** This prop allows you to customize the error message style */
|
|
74
|
+
errorClassName?: string;
|
|
75
|
+
/** This prop allows you to customize the helper message style */
|
|
76
|
+
helperClassName?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A basic widget for getting the user input of radio. Here is the API documentation of the Radio component.
|
|
80
|
+
* And the rest of the props of Checkbox are the same as the original html input field.
|
|
81
|
+
* You can use props like `value`, `disabled`, `onChange`, `onFocus`, `onBlur` etc.
|
|
82
|
+
*/
|
|
83
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
84
|
+
export default Radio;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type SelectOption = {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export interface SelectTypes {
|
|
7
|
+
options: SelectOption[];
|
|
8
|
+
selectedOption?: SelectOption;
|
|
9
|
+
onChange?: React.Dispatch<React.SetStateAction<SelectOption>> | ((value: SelectOption) => void);
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
onSelect?: (value: string) => void;
|
|
12
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
13
|
+
className?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
useUppercaseLabel?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
value?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
helperText?: string;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
buttonClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function Select({ options, onChange, onSelect, variant, selectedOption: propSelectedOption, className, children, disabled, label, useUppercaseLabel, required, value, name, errorMessage, helperText, placeholder, buttonClassName, }: SelectTypes): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default Select;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
label?: string | React.ReactNode;
|
|
4
|
+
offLabel?: string | React.ReactNode;
|
|
5
|
+
onLabel?: string | React.ReactNode;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
onChange: (checked: boolean) => void;
|
|
8
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
9
|
+
className?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
helperText?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const Switch: React.FC<SwitchProps>;
|
|
15
|
+
export default Switch;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const textareaVariantClasses: {
|
|
2
|
+
ghost: string;
|
|
3
|
+
solid: string;
|
|
4
|
+
transparent: string;
|
|
5
|
+
};
|
|
6
|
+
export type TextareaProps = React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
|
|
7
|
+
label?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
variant?: 'ghost' | 'solid' | 'transparent';
|
|
10
|
+
className?: string;
|
|
11
|
+
inputClassName?: string;
|
|
12
|
+
useUppercaseLabel?: boolean;
|
|
13
|
+
helperText?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
16
|
+
export default Textarea;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogoPropTypes } from '../../logos';
|
|
2
|
-
import { IMenuItem } from '
|
|
3
|
-
interface
|
|
2
|
+
import { IMenuItem } from '../menus/menu-item';
|
|
3
|
+
interface AdminLayoutProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
menuItems: IMenuItem[];
|
|
6
6
|
rightButton?: React.ReactNode;
|
|
@@ -12,5 +12,5 @@ interface ClassicLayoutProps {
|
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
setIsOpen: (isOpen: boolean) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare function
|
|
16
|
-
export default
|
|
15
|
+
export declare function AdminLayout({ logo, children, menuItems, rightButton, isOpen, className, headerClassName, contentClassName, fullWidth, setIsOpen, }: AdminLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default AdminLayout;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function CleanLayout({ children, className, }: {
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
className?: string;
|
|
4
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export default
|
|
5
|
+
export default CleanLayout;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
+
export declare function AdminHeader({ className, logo, rightButton, isOpen, setIsOpen, }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
logo?: LogoPropTypes;
|
|
5
|
+
rightButton?: React.ReactNode;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
setIsOpen?: (isOpen: boolean) => void;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
-
export declare function
|
|
3
|
-
className?: string;
|
|
4
|
-
logo?: LogoPropTypes;
|
|
5
|
-
rightButton?: React.ReactNode;
|
|
6
|
-
isOpen?: boolean;
|
|
7
|
-
setIsOpen?: (isOpen: boolean) => void;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default function Header({ logo, searchButton, isOpen, setIsOpen, className, rightButton, }: {
|
|
2
|
+
export declare function Header({ logo, searchButton, isOpen, setIsOpen, className, rightButton, }: {
|
|
10
3
|
logo?: LogoPropTypes;
|
|
11
4
|
searchButton?: React.ReactNode;
|
|
12
5
|
isOpen?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
+
import { IMenuItem } from '../menus/menu-item';
|
|
3
|
+
export declare function HorizontalHeader({ className, menuItems, rightButton, logo, isOpen, setIsOpen, }: {
|
|
4
|
+
className?: string;
|
|
5
|
+
menuItems: IMenuItem[];
|
|
6
|
+
rightButton?: React.ReactNode;
|
|
7
|
+
logo?: LogoPropTypes;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
+
import { IMenuItem } from '../menus/menu-item';
|
|
3
|
+
export declare function HorizontalRightArea({ rightButton, menuItems, isOpen, setIsOpen, logo, }: {
|
|
4
|
+
rightButton?: React.ReactNode;
|
|
5
|
+
menuItems: IMenuItem[];
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
8
|
+
logo?: LogoPropTypes;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
+
import { IMenuItem } from '../menus/menu-item';
|
|
3
|
+
interface HorizontalLayoutProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
menuItems: IMenuItem[];
|
|
6
|
+
rightButton?: React.ReactNode;
|
|
7
|
+
logo?: LogoPropTypes;
|
|
8
|
+
className?: string;
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
headerClassName?: string;
|
|
12
|
+
contentClassName?: string;
|
|
13
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function HorizontalLayout({ children, menuItems, rightButton, logo, className, isOpen, fullWidth, headerClassName, contentClassName, setIsOpen, }: HorizontalLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default HorizontalLayout;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IMenuItem } from '
|
|
2
|
-
export declare function CollapsibleMenu({ name, icon, href, dropdownItems, isActive, onClick, }: IMenuItem): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IMenuItem } from './menu-item';
|
|
2
|
+
export declare function CollapsibleMenu({ name, icon, href, path, dropdownItems, isActive, onClick, }: IMenuItem): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CollapsibleMenu;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogoPropTypes } from '../../logos/logo';
|
|
2
|
-
import { IMenuItem } from '
|
|
2
|
+
import { IMenuItem } from '../menus/menu-item';
|
|
3
3
|
export declare function ExpandableSidebar({ logo, className, menuItems, }: {
|
|
4
4
|
logo?: LogoPropTypes;
|
|
5
5
|
className?: string;
|