react-artasys-ui 0.1.20 → 0.1.22
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/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/lib/Button/Button.d.ts +12 -10
- package/lib/Button/index.d.ts +3 -2
- package/lib/Checkbox/Checkbox.d.ts +7 -7
- package/lib/Components/Arrow/Arrow.d.ts +6 -6
- package/lib/Dropdown/Dropdown.d.ts +18 -16
- package/lib/Dropdown/Item.d.ts +11 -11
- package/lib/Dropdown/Items.d.ts +6 -6
- package/lib/File/File.d.ts +18 -17
- package/lib/FileInput/FileInput.d.ts +13 -0
- package/lib/FileInput/index.d.ts +3 -0
- package/lib/Form/Element/Element.d.ts +16 -15
- package/lib/Form/Form.d.ts +10 -11
- package/lib/Input/Input.d.ts +11 -8
- package/lib/Loading/Loading.d.ts +6 -0
- package/lib/Loading/index.d.ts +3 -0
- package/lib/Progress/Progress.d.ts +7 -7
- package/lib/Provider/Provider.d.ts +7 -0
- package/lib/Provider/ProviderContext.d.ts +1 -0
- package/lib/Provider/index.d.ts +2 -0
- package/lib/Select/Optgroup.d.ts +7 -8
- package/lib/Select/Option.d.ts +8 -8
- package/lib/Select/Select.d.ts +18 -18
- package/lib/Spinner/Spinner.d.ts +8 -7
- package/lib/Spinner/index.d.ts +3 -3
- package/lib/TextArea/TextArea.d.ts +10 -7
- package/lib/UploadImages/Image.d.ts +16 -16
- package/lib/UploadImages/UploadImages.d.ts +9 -9
- package/lib/index.d.ts +19 -16
- package/lib/src/Button/Button.d.ts +12 -0
- package/lib/src/Button/index.d.ts +3 -0
- package/lib/src/Checkbox/Checkbox.d.ts +7 -0
- package/{src/Checkbox/index.tsx → lib/src/Checkbox/index.d.ts} +2 -2
- package/lib/src/Components/Arrow/Arrow.d.ts +6 -0
- package/{src/Components/Arrow/index.tsx → lib/src/Components/Arrow/index.d.ts} +2 -3
- package/lib/src/Dropdown/Dropdown.d.ts +18 -0
- package/lib/src/Dropdown/Item.d.ts +11 -0
- package/lib/src/Dropdown/Items.d.ts +6 -0
- package/lib/src/Dropdown/index.d.ts +9 -0
- package/lib/src/File/File.d.ts +18 -0
- package/lib/src/File/index.d.ts +3 -0
- package/lib/src/FileInput/FileInput.d.ts +14 -0
- package/lib/src/FileInput/index.d.ts +3 -0
- package/lib/src/Form/Element/Element.d.ts +16 -0
- package/lib/src/Form/Element/index.d.ts +3 -0
- package/lib/src/Form/Form.d.ts +10 -0
- package/{src/Form/index.tsx → lib/src/Form/index.d.ts} +5 -8
- package/{src/Form/types.ts → lib/src/Form/types.d.ts} +11 -17
- package/lib/src/Form/useForm.d.ts +17 -0
- package/lib/src/Input/Input.d.ts +11 -0
- package/{src/Input/index.tsx → lib/src/Input/index.d.ts} +2 -3
- package/lib/src/Loading/Loading.d.ts +6 -0
- package/lib/src/Loading/index.d.ts +3 -0
- package/lib/src/Progress/Progress.d.ts +7 -0
- package/{src/Progress/index.tsx → lib/src/Progress/index.d.ts} +2 -3
- package/lib/src/Provider/Provider.d.ts +7 -0
- package/lib/src/Provider/ProviderContext.d.ts +1 -0
- package/lib/src/Provider/index.d.ts +2 -0
- package/lib/src/Select/Optgroup.d.ts +7 -0
- package/lib/src/Select/Option.d.ts +8 -0
- package/lib/src/Select/Select.d.ts +18 -0
- package/lib/src/Select/index.d.ts +11 -0
- package/lib/src/Spinner/Spinner.d.ts +8 -0
- package/lib/src/Spinner/index.d.ts +3 -0
- package/lib/src/TextArea/TextArea.d.ts +9 -0
- package/{src/TextArea/index.tsx → lib/src/TextArea/index.d.ts} +2 -3
- package/lib/src/UploadImages/Image.d.ts +16 -0
- package/lib/src/UploadImages/UploadImages.d.ts +9 -0
- package/lib/src/UploadImages/index.d.ts +5 -0
- package/lib/src/index.d.ts +19 -0
- package/lib/src/ui-types.d.ts +3 -0
- package/lib/stories/Button.stories.d.ts +6 -0
- package/lib/stories/Checkbox.stories.d.ts +6 -0
- package/lib/stories/Dropdown/Dropdown.stories.d.ts +6 -0
- package/lib/stories/Dropdown/Item.stories.d.ts +6 -0
- package/lib/stories/Dropdown/Items.stories.d.ts +6 -0
- package/lib/stories/File.stories.d.ts +6 -0
- package/lib/stories/FileInput.stories.d.ts +9 -0
- package/lib/stories/Form/Element/Element.stories.d.ts +6 -0
- package/lib/stories/Form/Form.stories.d.ts +6 -0
- package/lib/stories/Input.stories.d.ts +6 -0
- package/lib/stories/Loading.stories.d.ts +6 -0
- package/lib/stories/Progress.stories.d.ts +6 -0
- package/lib/stories/Select/Select.stories.d.ts +6 -0
- package/lib/stories/Spinner.stories.d.ts +6 -0
- package/lib/stories/TextArea.stories.d.ts +6 -0
- package/lib/ui-types.d.ts +3 -0
- package/package.json +26 -5
- package/__tests__/static.test.js +0 -0
- package/babel.config.json +0 -3
- package/src/Button/Button.tsx +0 -29
- package/src/Button/index.tsx +0 -3
- package/src/Button/style.module.css +0 -45
- package/src/Checkbox/Checkbox.tsx +0 -22
- package/src/Checkbox/style.module.css +0 -74
- package/src/Components/Arrow/Arrow.tsx +0 -18
- package/src/Components/Arrow/style.module.css +0 -40
- package/src/Dropdown/Dropdown.tsx +0 -113
- package/src/Dropdown/Item.tsx +0 -42
- package/src/Dropdown/Items.tsx +0 -38
- package/src/Dropdown/index.tsx +0 -28
- package/src/Dropdown/style.module.css +0 -89
- package/src/File/File.tsx +0 -85
- package/src/File/index.tsx +0 -9
- package/src/Form/Element/Element.tsx +0 -54
- package/src/Form/Element/index.tsx +0 -7
- package/src/Form/Element/style.module.css +0 -119
- package/src/Form/Form.tsx +0 -40
- package/src/Form/style.module.css +0 -30
- package/src/Form/useForm.tsx +0 -76
- package/src/Input/Input.tsx +0 -49
- package/src/Input/style.module.css +0 -16
- package/src/Progress/Progress.tsx +0 -28
- package/src/Progress/style.module.css +0 -72
- package/src/Select/Optgroup.tsx +0 -19
- package/src/Select/Option.tsx +0 -47
- package/src/Select/Select.tsx +0 -143
- package/src/Select/index.tsx +0 -33
- package/src/Select/style.module.css +0 -117
- package/src/Spinner/Spinner.tsx +0 -21
- package/src/Spinner/index.tsx +0 -8
- package/src/Spinner/style.module.css +0 -65
- package/src/TextArea/TextArea.tsx +0 -57
- package/src/UploadImages/Image.tsx +0 -86
- package/src/UploadImages/UploadImages.tsx +0 -57
- package/src/UploadImages/index.tsx +0 -13
- package/src/UploadImages/style.module.css +0 -108
- package/src/index.ts +0 -62
- package/tsconfig.json +0 -118
- package/types.d.ts +0 -1
- package/webpack.config.js +0 -59
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefAttributes, ForwardRefExoticComponent, FC } from "react";
|
|
2
|
+
import { IDropdown } from "./Dropdown";
|
|
3
|
+
import Item, { IItem } from "./Item";
|
|
4
|
+
interface StaticComponent extends ForwardRefExoticComponent<IDropdown & RefAttributes<HTMLInputElement>> {
|
|
5
|
+
Item: FC<IItem>;
|
|
6
|
+
}
|
|
7
|
+
declare const Dropdown: StaticComponent;
|
|
8
|
+
export { Item as DropdownItem };
|
|
9
|
+
export default Dropdown;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AllHTMLAttributes } from "react";
|
|
2
|
+
import { UIComponent } from "../ui-types";
|
|
3
|
+
export type TFileMime = 'image/png' | 'image/jpg' | 'image/jpeg' | 'image/gif';
|
|
4
|
+
export type TFileData = {
|
|
5
|
+
name: string;
|
|
6
|
+
type: TFileMime;
|
|
7
|
+
size: number;
|
|
8
|
+
mime: TFileMime;
|
|
9
|
+
data: string;
|
|
10
|
+
base64?: string | null | ArrayBuffer;
|
|
11
|
+
};
|
|
12
|
+
export interface TFile<T = any> extends UIComponent<Omit<AllHTMLAttributes<T>, 'onChange' | 'accept'>> {
|
|
13
|
+
onChange?: (data: TFileData) => void;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
accept?: TFileMime[];
|
|
16
|
+
}
|
|
17
|
+
declare const File: ({ onChange, children, multiple, accept, ...props }: TFile) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default File;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IElement } from '../Form/Element';
|
|
3
|
+
import { UIComponent } from '../ui-types';
|
|
4
|
+
export interface IFileInput extends UIComponent<IElement<HTMLInputElement>> {
|
|
5
|
+
onChangeFiles?: (files: FileList | null) => void;
|
|
6
|
+
accept?: string;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
wait?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
icon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const FileInput: ({ onChange, onChangeFiles, accept, multiple, wait, children, className, icon, ...props }: IFileInput) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FileInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AllHTMLAttributes, ReactElement } from "react";
|
|
2
|
+
export interface IElement<T = any> extends Omit<AllHTMLAttributes<T>, 'children'> {
|
|
3
|
+
children?: ((props: AllHTMLAttributes<T>) => ReactElement) | AllHTMLAttributes<T>["children"];
|
|
4
|
+
error?: string;
|
|
5
|
+
formValue?: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
styleContainer?: React.HTMLAttributes<T>["style"];
|
|
9
|
+
classNameContainer?: string;
|
|
10
|
+
beforeElement?: React.ReactElement;
|
|
11
|
+
afterElement?: React.ReactElement;
|
|
12
|
+
hiddenContainer?: boolean;
|
|
13
|
+
wait?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Element: ({ children, beforeElement, afterElement, error, placeholder, styleContainer, classNameContainer, hiddenContainer, formValue, wait, ...props }: IElement) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FormHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { UIComponent } from '../ui-types';
|
|
3
|
+
export interface IForm extends UIComponent<FormHTMLAttributes<HTMLFormElement>> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
wait?: boolean;
|
|
6
|
+
progress?: number;
|
|
7
|
+
progressRadius?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Form: ({ children, wait, progress, progressRadius, className, onSubmit, ...props }: IForm) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Form;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import Form from "./Form";
|
|
2
|
-
import useForm from "./useForm";
|
|
3
|
-
import Element from "./Element";
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
Element as FormElement
|
|
7
|
-
};
|
|
8
|
-
export default Form;
|
|
1
|
+
import Form from "./Form";
|
|
2
|
+
import useForm from "./useForm";
|
|
3
|
+
import Element from "./Element";
|
|
4
|
+
export { useForm, Element as FormElement };
|
|
5
|
+
export default Form;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export type TError<TFieldValues extends FieldValues> = {
|
|
13
|
-
errors?: {
|
|
14
|
-
[key in keyof TFieldValues]: string[];
|
|
15
|
-
};
|
|
16
|
-
message: string;
|
|
17
|
-
}
|
|
1
|
+
import type { FieldValues, UseFormRegisterReturn, FieldPath } from "react-hook-form";
|
|
2
|
+
export type TUseFormRegisterReturn<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseFormRegisterReturn<TFieldName> & {
|
|
3
|
+
error?: string;
|
|
4
|
+
formValue: TFieldValues;
|
|
5
|
+
};
|
|
6
|
+
export type TError<TFieldValues extends FieldValues> = {
|
|
7
|
+
errors?: {
|
|
8
|
+
[key in keyof TFieldValues]: string[];
|
|
9
|
+
};
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FunctionComponent } from "react";
|
|
2
|
+
import type { TError } from "./types";
|
|
3
|
+
import { UseFormReturn, FieldValues } from "react-hook-form";
|
|
4
|
+
type TuseErrors<TFieldValues extends FieldValues = FieldValues> = UseFormReturn<TFieldValues> & {
|
|
5
|
+
GlobalError: FunctionComponent;
|
|
6
|
+
setErrors: (e: TError<TFieldValues>) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const useForm: <TFieldValues extends FieldValues = FieldValues>() => TuseErrors<TFieldValues>;
|
|
9
|
+
export declare const validate: {
|
|
10
|
+
email: {
|
|
11
|
+
pattern: {
|
|
12
|
+
value: RegExp;
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default useForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type HTMLInputTypeAttribute } from "react";
|
|
2
|
+
import { IElement } from "../Form/Element";
|
|
3
|
+
import { UIComponent } from "../ui-types";
|
|
4
|
+
export interface IInput extends UIComponent<IElement<HTMLInputElement>> {
|
|
5
|
+
onChangeText?: (text: string) => void;
|
|
6
|
+
type?: HTMLInputTypeAttribute;
|
|
7
|
+
wait?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const Input: import("react").ForwardRefExoticComponent<IInput & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export default Input;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import Input from "./Input";
|
|
2
|
-
|
|
3
|
-
export default Input;
|
|
1
|
+
import Input from "./Input";
|
|
2
|
+
export default Input;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AllHTMLAttributes } from 'react';
|
|
2
|
+
export interface LoadingProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'color'> {
|
|
3
|
+
color?: 'primary' | 'light' | 'secondary' | 'secondary-light' | 'tertiary';
|
|
4
|
+
}
|
|
5
|
+
declare const Loading: ({ color, ...props }: LoadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default Loading;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import Progress from "./Progress";
|
|
2
|
-
|
|
3
|
-
export default Progress;
|
|
1
|
+
import Progress from "./Progress";
|
|
2
|
+
export default Progress;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UIComponent } from "../ui-types";
|
|
3
|
+
interface ProviderProps extends UIComponent {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const Provider: ({ children }: ProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Provider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProviderContext: import("react").Context<{}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TOptionElement } from "./Select";
|
|
2
|
+
export interface IOptgroup {
|
|
3
|
+
children?: TOptionElement;
|
|
4
|
+
label?: string | React.ReactElement;
|
|
5
|
+
}
|
|
6
|
+
declare const Optgroup: ({ children, label }: IOptgroup) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Optgroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LiHTMLAttributes } from "react";
|
|
2
|
+
export interface IOption extends LiHTMLAttributes<HTMLLIElement> {
|
|
3
|
+
value?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
children?: string | React.ReactElement;
|
|
6
|
+
}
|
|
7
|
+
declare const Option: ({ children, value, disabled, hidden, onClick, ...props }: IOption) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default Option;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FunctionComponentElement, ReactNode } from "react";
|
|
2
|
+
import { IElement } from "../Form/Element";
|
|
3
|
+
import type { IOptgroup } from "./Optgroup";
|
|
4
|
+
import type { IOption } from "./Option";
|
|
5
|
+
export declare const Context: import("react").Context<{
|
|
6
|
+
selected: string;
|
|
7
|
+
emptyValue: React.MutableRefObject<boolean>;
|
|
8
|
+
setSelect: (value: string) => void;
|
|
9
|
+
setSelected: (value: string) => void;
|
|
10
|
+
setTitle: (title: IOption["children"]) => void;
|
|
11
|
+
}>;
|
|
12
|
+
export type TOptionElement = FunctionComponentElement<IOption> | FunctionComponentElement<IOption>[] | ReactNode;
|
|
13
|
+
export interface ISelect extends Omit<IElement, 'children'> {
|
|
14
|
+
children?: TOptionElement | FunctionComponentElement<IOptgroup> | FunctionComponentElement<IOptgroup>[];
|
|
15
|
+
onChangeSelect?: (value: string) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Select: import("react").ForwardRefExoticComponent<ISelect & import("react").RefAttributes<HTMLInputElement>>;
|
|
18
|
+
export default Select;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, FC, RefAttributes } from "react";
|
|
2
|
+
import { ISelect } from "./Select";
|
|
3
|
+
import Option, { IOption } from "./Option";
|
|
4
|
+
import Optgroup, { IOptgroup } from "./Optgroup";
|
|
5
|
+
interface StaticComponent extends ForwardRefExoticComponent<ISelect & RefAttributes<HTMLInputElement>> {
|
|
6
|
+
Option: FC<IOption>;
|
|
7
|
+
Optgroup: FC<IOptgroup>;
|
|
8
|
+
}
|
|
9
|
+
declare const Select: StaticComponent;
|
|
10
|
+
export { Option as SelectOption, Optgroup as SelectOptgroup };
|
|
11
|
+
export default Select;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AllHTMLAttributes } from "react";
|
|
2
|
+
import type { UIComponent } from "../ui-types";
|
|
3
|
+
export interface SpinnerProps extends UIComponent<Omit<AllHTMLAttributes<HTMLDivElement>, 'size'>> {
|
|
4
|
+
size?: 'small' | 'middle' | 'large';
|
|
5
|
+
contrast?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const Spinner: ({ size, contrast, ...props }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Spinner;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IElement } from "../Form/Element";
|
|
3
|
+
import { UIComponent } from "../ui-types";
|
|
4
|
+
export interface ITextArea extends UIComponent<IElement<HTMLTextAreaElement>> {
|
|
5
|
+
onChangeText?: (text: string) => void;
|
|
6
|
+
wait?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const TextArea: React.ForwardRefExoticComponent<ITextArea & React.RefAttributes<HTMLTextAreaElement>>;
|
|
9
|
+
export default TextArea;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import TextArea from "./TextArea";
|
|
2
|
-
|
|
3
|
-
export default TextArea;
|
|
1
|
+
import TextArea from "./TextArea";
|
|
2
|
+
export default TextArea;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TFileData } from "../File";
|
|
2
|
+
export type TImageData = TFileData & {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
setWait: (status: boolean) => void;
|
|
5
|
+
setId: (id: string | number) => void;
|
|
6
|
+
};
|
|
7
|
+
export interface IImage extends TFileData {
|
|
8
|
+
onChange?: (data: TImageData) => void;
|
|
9
|
+
onId?: (id: string | number) => void;
|
|
10
|
+
onRemove?: () => void;
|
|
11
|
+
onClick?: (data: TImageData) => void;
|
|
12
|
+
id?: string | number;
|
|
13
|
+
src?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const Image: ({ onChange, onClick, onId, onRemove, ...props }: IImage) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default Image;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TImageData, IImage } from "./Image";
|
|
2
|
+
export interface IUploadImages {
|
|
3
|
+
onChange?: (data: TImageData) => void;
|
|
4
|
+
onChangeArray?: (data: IImage[]) => void;
|
|
5
|
+
onClick?: (data: TImageData) => void;
|
|
6
|
+
imagesArray?: TImageData[];
|
|
7
|
+
}
|
|
8
|
+
declare const UploadImages: ({ imagesArray, onChange, onChangeArray, onClick }: IUploadImages) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default UploadImages;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Form, { useForm, FormElement } from "./Form";
|
|
2
|
+
import Element, { IElement } from "./Form/Element";
|
|
3
|
+
import Input from "./Input";
|
|
4
|
+
import TextArea from "./TextArea";
|
|
5
|
+
import Spinner from "./Spinner";
|
|
6
|
+
import Loading from "./Loading";
|
|
7
|
+
import FileInput, { IFileInput } from "./FileInput";
|
|
8
|
+
import File, { TFileData, TFileMime } from "./File";
|
|
9
|
+
import Button, { ButtonProps } from "./Button";
|
|
10
|
+
import UploadImages, { IUploadImages, TImageData, IImage } from "./UploadImages";
|
|
11
|
+
import Checkbox from "./Checkbox";
|
|
12
|
+
import Progress from "./Progress";
|
|
13
|
+
import Select, { SelectOption, SelectOptgroup } from "./Select";
|
|
14
|
+
import Dropdown, { DropdownItem } from "./Dropdown";
|
|
15
|
+
import './brands/brands.css';
|
|
16
|
+
declare const UI: {};
|
|
17
|
+
export { Form, FormElement, Element, useForm, Input, TextArea, Spinner, Loading, File, Button, UploadImages, Checkbox, Progress, Select, SelectOption, SelectOptgroup, Dropdown, DropdownItem, FileInput, };
|
|
18
|
+
export type { TFileData, TFileMime, IUploadImages, IImage, TImageData, IElement, ButtonProps, IFileInput, };
|
|
19
|
+
export default UI;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { ButtonProps } from '../src/Button';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ButtonProps>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ButtonProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { ICheckbox } from '../src/Checkbox/Checkbox';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ICheckbox>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ICheckbox>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IDropdown } from '../../src/Dropdown/Dropdown';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IDropdown>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IDropdown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IItem } from '../../src/Dropdown/Item';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IItem>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IItem>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IItems } from '../../src/Dropdown/Items';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IItems>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IItems>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { TFile } from '../src/File/File';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, TFile<any>>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, TFile<any>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
import FileInput, { IFileInput } from "../src/FileInput/FileInput";
|
|
3
|
+
declare const _default: Meta<typeof FileInput>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IFileInput>;
|
|
6
|
+
export declare const MultipleFiles: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IFileInput>;
|
|
7
|
+
export declare const AcceptImages: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IFileInput>;
|
|
8
|
+
export declare const WithLoading: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IFileInput>;
|
|
9
|
+
export declare const CustomChildren: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IFileInput>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IElement } from '../../../src/Form/Element/Element';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IElement<any>>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IElement<any>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IForm } from '../../src/Form/Form';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IForm>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IForm>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IInput } from '../src/Input/Input';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IInput>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IInput>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { type LoadingProps } from '../src/Loading';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, LoadingProps>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, LoadingProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IProgress } from '../src/Progress/Progress';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IProgress>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, IProgress>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { ISelect } from '../../src/Select/Select';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ISelect>;
|
|
6
|
+
export declare const WithOptgroup: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ISelect>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { type SpinnerProps } from '../src/Spinner';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SpinnerProps>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SpinnerProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { ITextArea } from '../src/TextArea/TextArea';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ITextArea>;
|
|
6
|
+
export declare const Secondary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ITextArea>;
|
package/package.json
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-artasys-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "jest",
|
|
9
9
|
"build": "webpack",
|
|
10
|
-
"copy-css": "copyfiles -u 1 src/**/*.module.css lib/"
|
|
10
|
+
"copy-css": "copyfiles -u 1 src/**/*.module.css lib/",
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build"
|
|
11
13
|
},
|
|
12
14
|
"jest": {
|
|
13
15
|
"transform": {
|
|
14
16
|
"^.+\\.[t|j]sx?$": "babel-jest"
|
|
15
17
|
}
|
|
16
18
|
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"lib"
|
|
22
|
+
],
|
|
17
23
|
"repository": {
|
|
18
24
|
"type": "git",
|
|
19
25
|
"url": "git+https://github.com/SergoMorello/react.artasys.ui.git"
|
|
@@ -27,22 +33,37 @@
|
|
|
27
33
|
"homepage": "https://github.com/SergoMorello/react.artasys.ui#readme",
|
|
28
34
|
"devDependencies": {
|
|
29
35
|
"@babel/preset-env": "^7.22.20",
|
|
36
|
+
"@babel/preset-react": "^7.26.3",
|
|
37
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
38
|
+
"@chromatic-com/storybook": "^3.2.3",
|
|
39
|
+
"@storybook/addon-essentials": "^8.4.7",
|
|
40
|
+
"@storybook/addon-interactions": "^8.4.7",
|
|
41
|
+
"@storybook/addon-onboarding": "^8.4.7",
|
|
42
|
+
"@storybook/addon-webpack5-compiler-swc": "^2.0.0",
|
|
43
|
+
"@storybook/blocks": "^8.4.7",
|
|
44
|
+
"@storybook/react": "^8.4.7",
|
|
45
|
+
"@storybook/react-webpack5": "^8.4.7",
|
|
46
|
+
"@storybook/test": "^8.4.7",
|
|
30
47
|
"@types/jest": "^29.5.0",
|
|
31
|
-
"@types/react": "^18.2.0",
|
|
32
48
|
"@types/react-dom": "^18.2.0",
|
|
33
49
|
"autoprefixer": "^10.4.16",
|
|
34
50
|
"babel-jest": "^29.5.0",
|
|
51
|
+
"babel-loader": "^9.2.1",
|
|
35
52
|
"copyfiles": "^2.4.1",
|
|
36
53
|
"css-loader": "^6.8.1",
|
|
37
54
|
"jest": "^29.5.0",
|
|
38
55
|
"postcss-loader": "^7.3.3",
|
|
56
|
+
"sass": "^1.83.1",
|
|
57
|
+
"sass-loader": "^16.0.4",
|
|
58
|
+
"storybook": "^8.4.7",
|
|
39
59
|
"style-loader": "^3.3.3",
|
|
40
|
-
"ts-loader": "^9.5.
|
|
41
|
-
"typescript": "^5.
|
|
60
|
+
"ts-loader": "^9.5.2",
|
|
61
|
+
"typescript": "^5.7.3",
|
|
42
62
|
"typescript-plugin-css-modules": "^5.0.1",
|
|
43
63
|
"webpack-cli": "^5.1.4"
|
|
44
64
|
},
|
|
45
65
|
"dependencies": {
|
|
66
|
+
"@types/react": "^18.2.0",
|
|
46
67
|
"react-hook-form": "^7.47.0"
|
|
47
68
|
},
|
|
48
69
|
"peerDependencies": {
|
package/__tests__/static.test.js
DELETED
|
File without changes
|
package/babel.config.json
DELETED
package/src/Button/Button.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import styles from "./style.module.css";
|
|
3
|
-
import Spinner,{
|
|
4
|
-
TSpinner
|
|
5
|
-
} from "../Spinner";
|
|
6
|
-
|
|
7
|
-
interface IButton extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
-
wait?: boolean;
|
|
9
|
-
classNameContainer?: string;
|
|
10
|
-
styleContainer?: React.HTMLAttributes<HTMLDivElement>['style'];
|
|
11
|
-
spinnerColor?: TSpinner['color'];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Button = ({children, className, classNameContainer, styleContainer, spinnerColor = 'contrast', wait = false, ...props}: IButton) => {
|
|
15
|
-
|
|
16
|
-
const classes = ['ui-button-container'];
|
|
17
|
-
|
|
18
|
-
classes.push(styles['container']);
|
|
19
|
-
if (classNameContainer) classes.push(classNameContainer);
|
|
20
|
-
|
|
21
|
-
return(<div className={classes.join(' ')} style={styleContainer}>
|
|
22
|
-
<button {...props} className={'ui-button' + (className ? ' ' + className : '')}>{children}</button>
|
|
23
|
-
<div className={'ui-button-spinner ' + styles['wait-indicator'] + (wait ? ' ' + styles['active'] : '')}>
|
|
24
|
-
<Spinner size="small" color={spinnerColor}/>
|
|
25
|
-
</div>
|
|
26
|
-
</div>)
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default Button;
|
package/src/Button/index.tsx
DELETED