@typeolymp/ui-components 1.0.1 → 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/build/components/atoms/Button/index.d.ts +1 -0
- package/build/components/atoms/Checkbox/index.d.ts +5 -3
- package/build/components/atoms/Flag/index.d.ts +1 -1
- package/build/components/atoms/Flag/stories.d.ts +1 -1
- package/build/components/atoms/Input/index.d.ts +2 -2
- package/build/components/atoms/Input/stories.d.ts +1 -1
- package/build/components/atoms/Medal/index.d.ts +2 -1
- package/build/components/atoms/Medal/stories.d.ts +1 -1
- package/build/components/atoms/Number/index.d.ts +14 -0
- package/build/components/atoms/Number/stories.d.ts +19 -0
- package/build/components/atoms/Number/styles.d.ts +2 -0
- package/build/components/atoms/Radio/index.d.ts +5 -3
- package/build/components/atoms/Radio/styles.d.ts +0 -1
- package/build/components/atoms/Select/index.d.ts +7 -2
- package/build/components/atoms/Toggle/index.d.ts +12 -0
- package/build/components/atoms/Toggle/stories.d.ts +7 -0
- package/build/components/atoms/Toggle/styles.d.ts +1 -0
- package/build/components/molecules/Card/index.d.ts +1 -1
- package/build/components/molecules/Checkboxes/index.d.ts +16 -0
- package/build/components/molecules/Checkboxes/styles.d.ts +4 -0
- package/build/components/molecules/FormField/index.d.ts +4 -8
- package/build/components/molecules/FormField/styles.d.ts +2 -0
- package/build/components/molecules/InputField/index.d.ts +15 -0
- package/build/components/molecules/InputField/styles.d.ts +2 -0
- package/build/components/molecules/Loading/index.d.ts +1 -1
- package/build/components/molecules/NumberField/index.d.ts +15 -0
- package/build/components/molecules/NumberField/styles.d.ts +2 -0
- package/build/components/molecules/RadioGroup/index.d.ts +16 -0
- package/build/components/molecules/RadioGroup/styles.d.ts +4 -0
- package/build/components/molecules/SelectField/index.d.ts +17 -0
- package/build/components/molecules/SelectField/styles.d.ts +2 -0
- package/build/components/molecules/ToggleField/index.d.ts +12 -0
- package/build/components/molecules/ToggleField/styles.d.ts +2 -0
- package/build/components/organisms/Form/WithValidation/index.d.ts +4 -0
- package/build/components/organisms/Form/WithValidation/styles.d.ts +2 -0
- package/build/components/organisms/Form/index.d.ts +48 -5
- package/build/components/organisms/Form/stories.d.ts +11 -2
- package/build/index.d.ts +9 -2
- package/build/index.es.js +429 -219
- package/build/index.es.js.map +1 -1
- package/build/index.js +437 -219
- package/build/index.js.map +1 -1
- package/build/lib/theme/index.d.ts +3 -0
- package/build/lib/theme/types.d.ts +72 -0
- package/package.json +4 -2
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
export declare type PropsType = {
|
|
3
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
autoFocus?: boolean;
|
|
6
|
-
|
|
7
|
-
onChange?(value:
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
onChange?(value: string): void;
|
|
8
10
|
onBlur?(): void;
|
|
9
11
|
};
|
|
10
12
|
declare const Checkbox: FC<PropsType>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
export declare type PropsType = {
|
|
3
|
+
id: string;
|
|
3
4
|
initialValue?: string;
|
|
4
5
|
placeholder?: string;
|
|
5
|
-
|
|
6
|
+
autocomplete?: string;
|
|
6
7
|
autoFocus?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
8
|
-
id?: string;
|
|
9
9
|
onChange?(value: string): void;
|
|
10
10
|
onBlur?(): void;
|
|
11
11
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
initialValue?: number;
|
|
4
|
+
autocomplete?: string;
|
|
5
|
+
autoFocus?: boolean;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
onChange?(value: string): void;
|
|
11
|
+
onBlur?(): void;
|
|
12
|
+
};
|
|
13
|
+
declare const Number: FC<PropsType>;
|
|
14
|
+
export default Number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PropsType } from ".";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.FC<PropsType>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Overview: () => JSX.Element;
|
|
9
|
+
export declare const Playground: {
|
|
10
|
+
(args: any): JSX.Element;
|
|
11
|
+
args: {
|
|
12
|
+
initialValue: number;
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
argTypes: {};
|
|
19
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
export declare type PropsType = {
|
|
3
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
autoFocus?: boolean;
|
|
6
|
-
|
|
7
|
-
onChange?(value:
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
onChange?(value: string): void;
|
|
8
10
|
onBlur?(): void;
|
|
9
11
|
};
|
|
10
12
|
declare const Radio: FC<PropsType>;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
export declare type PropsType = {
|
|
3
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
4
5
|
disabled?: boolean;
|
|
5
|
-
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
autoFocus?: boolean;
|
|
9
|
+
onChange?(value: string): void;
|
|
10
|
+
onBlur?(): void;
|
|
6
11
|
};
|
|
7
12
|
declare const Select: FC<PropsType>;
|
|
8
13
|
export default Select;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
8
|
+
onChange?(value: boolean): void;
|
|
9
|
+
onBlur?(): void;
|
|
10
|
+
};
|
|
11
|
+
declare const Toggle: FC<PropsType>;
|
|
12
|
+
export default Toggle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Container: any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
legend: string | null;
|
|
5
|
+
items: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
value: string;
|
|
8
|
+
label: string | JSX.Element;
|
|
9
|
+
}>;
|
|
10
|
+
initialValue?: Array<string>;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
onChange?(field: string, value: Array<string>): void;
|
|
13
|
+
onBlur?(fieldName: string): void;
|
|
14
|
+
};
|
|
15
|
+
declare const Checkboxes: FC<PropsType>;
|
|
16
|
+
export default Checkboxes;
|
|
@@ -6,7 +6,6 @@ export declare type FeedbackType = {
|
|
|
6
6
|
};
|
|
7
7
|
declare type FieldBaseType = {
|
|
8
8
|
name: string;
|
|
9
|
-
label: string;
|
|
10
9
|
initialValue?: ValueType;
|
|
11
10
|
autocomplete?: string;
|
|
12
11
|
autoFocus?: boolean;
|
|
@@ -15,19 +14,16 @@ declare type FieldBaseType = {
|
|
|
15
14
|
};
|
|
16
15
|
declare type InputFieldType = {
|
|
17
16
|
type: "text" | "password";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type: "checkbox";
|
|
21
|
-
} & FieldBaseType;
|
|
22
|
-
declare type RadioFieldType = {
|
|
23
|
-
type: "radio";
|
|
17
|
+
label: string | JSX.Element;
|
|
18
|
+
placeholder?: string;
|
|
24
19
|
} & FieldBaseType;
|
|
25
20
|
declare type NumberFieldType = {
|
|
26
21
|
type: "number";
|
|
22
|
+
label: string | JSX.Element;
|
|
27
23
|
min?: number;
|
|
28
24
|
max?: number;
|
|
29
25
|
} & FieldBaseType;
|
|
30
|
-
export declare type PropsType = InputFieldType |
|
|
26
|
+
export declare type PropsType = InputFieldType | NumberFieldType;
|
|
31
27
|
declare const FormField: FC<PropsType & {
|
|
32
28
|
onChange?(field: string, value: ValueType): void;
|
|
33
29
|
onBlur?(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string | JSX.Element;
|
|
5
|
+
autocomplete?: string;
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
isPassword?: boolean;
|
|
11
|
+
onChange?(fieldName: string, value: string): void;
|
|
12
|
+
onBlur?(fieldName: string): void;
|
|
13
|
+
};
|
|
14
|
+
declare const InputField: FC<PropsType>;
|
|
15
|
+
export default InputField;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string | JSX.Element;
|
|
5
|
+
autocomplete?: string;
|
|
6
|
+
initialValue?: number;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
disabled?: any;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
onChange?(field: string, value: string): void;
|
|
12
|
+
onBlur?(fieldName: string): void;
|
|
13
|
+
};
|
|
14
|
+
declare const NumberField: FC<PropsType>;
|
|
15
|
+
export default NumberField;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
legend: string | null;
|
|
5
|
+
items: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
value: string;
|
|
8
|
+
label: string | JSX.Element;
|
|
9
|
+
}>;
|
|
10
|
+
initialValue?: string;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
onChange?(fieldName: string, value: string): void;
|
|
13
|
+
onBlur?(fieldName: string): void;
|
|
14
|
+
};
|
|
15
|
+
declare const RadioGroup: FC<PropsType>;
|
|
16
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string | JSX.Element;
|
|
5
|
+
options: Array<{
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
initialValue?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
autoFocus?: boolean;
|
|
13
|
+
onChange?(fieldName: string, value: string): void;
|
|
14
|
+
onBlur?(fieldName: string): void;
|
|
15
|
+
};
|
|
16
|
+
declare const SelectField: FC<PropsType>;
|
|
17
|
+
export default SelectField;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare type PropsType = {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string | JSX.Element;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
initialValue?: boolean;
|
|
7
|
+
autoFocus?: boolean;
|
|
8
|
+
onChange?(fieldName: string, value: boolean): void;
|
|
9
|
+
onBlur?(fieldName: string): void;
|
|
10
|
+
};
|
|
11
|
+
declare const ToggleField: FC<PropsType>;
|
|
12
|
+
export default ToggleField;
|
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { PropsType as ButtonPropsType } from "../../atoms/Button";
|
|
3
|
-
import { PropsType as
|
|
3
|
+
import { PropsType as InputFieldPropsType } from "../../molecules/InputField";
|
|
4
|
+
import { PropsType as RadioGroupPropsType } from "../../molecules/RadioGroup";
|
|
5
|
+
import { PropsType as NumberFieldPropsType } from "../../molecules/NumberField";
|
|
6
|
+
import { PropsType as CheckboxesPropsType } from "../../molecules/Checkboxes";
|
|
7
|
+
import { PropsType as SelectFieldPropsType } from "../../molecules/SelectField";
|
|
8
|
+
import { PropsType as ToggleFieldPropsType } from "../../molecules/ToggleField";
|
|
9
|
+
declare type ValueType = string | number | boolean | Array<string>;
|
|
10
|
+
export declare type FeedbackType = {
|
|
11
|
+
message: string;
|
|
12
|
+
status: "error" | "success" | "";
|
|
13
|
+
};
|
|
14
|
+
declare type ValidationType = {
|
|
15
|
+
validateTrigger?: Array<"onBlur" | "onChange">;
|
|
16
|
+
validator?(value: ValueType): FeedbackType;
|
|
17
|
+
feedback?: FeedbackType;
|
|
18
|
+
};
|
|
19
|
+
declare type InputFieldType = {
|
|
20
|
+
type: "text" | "password";
|
|
21
|
+
} & InputFieldPropsType & ValidationType;
|
|
22
|
+
declare type RadioGroupFieldType = {
|
|
23
|
+
type: "radio";
|
|
24
|
+
} & RadioGroupPropsType & ValidationType;
|
|
25
|
+
declare type NumberFieldType = {
|
|
26
|
+
type: "number";
|
|
27
|
+
} & NumberFieldPropsType & ValidationType;
|
|
28
|
+
declare type CheckboxesFieldType = {
|
|
29
|
+
type: "checkbox";
|
|
30
|
+
} & CheckboxesPropsType & ValidationType;
|
|
31
|
+
declare type SelectFieldType = {
|
|
32
|
+
type: "select";
|
|
33
|
+
} & SelectFieldPropsType & ValidationType;
|
|
34
|
+
declare type ToggleFieldType = {
|
|
35
|
+
type: "toggle";
|
|
36
|
+
} & ToggleFieldPropsType & ValidationType;
|
|
37
|
+
export declare type FormFieldType = InputFieldType | RadioGroupFieldType | NumberFieldType | CheckboxesFieldType | SelectFieldType | ToggleFieldType;
|
|
4
38
|
export declare type PropsType = {
|
|
5
39
|
title?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
40
|
+
description?: string;
|
|
41
|
+
fields: Array<FormFieldType>;
|
|
42
|
+
button?: ButtonPropsType;
|
|
43
|
+
onChangeFields?(newValues: {
|
|
44
|
+
[key: string]: ValueType;
|
|
45
|
+
}, oldValues: {
|
|
46
|
+
[key: string]: ValueType;
|
|
47
|
+
}): void;
|
|
48
|
+
onSubmit?(values: {
|
|
49
|
+
[key: string]: ValueType;
|
|
50
|
+
}): void;
|
|
51
|
+
onError?(feedback: {
|
|
52
|
+
[key: string]: FeedbackType;
|
|
10
53
|
}): void;
|
|
11
54
|
};
|
|
12
55
|
declare const Form: FC<PropsType>;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: React.FC<import("
|
|
4
|
+
component: React.FC<import("../../organisms/Form").PropsType>;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const AllTogether: () => JSX.Element;
|
|
8
|
+
export declare const Input: () => JSX.Element;
|
|
9
|
+
export declare const Radio: () => JSX.Element;
|
|
10
|
+
export declare const Number: () => JSX.Element;
|
|
11
|
+
export declare const Checkbox: () => JSX.Element;
|
|
12
|
+
export declare const Select: () => JSX.Element;
|
|
13
|
+
export declare const Toggle: () => JSX.Element;
|
|
14
|
+
export declare const ValidationOnSubmit: () => JSX.Element;
|
|
15
|
+
export declare const ValidationOnBlur: () => JSX.Element;
|
|
16
|
+
export declare const ValidationOnChange: () => JSX.Element;
|
package/build/index.d.ts
CHANGED
|
@@ -8,24 +8,31 @@ import Illustration from "./components/atoms/Illustration";
|
|
|
8
8
|
import Input from "./components/atoms/Input";
|
|
9
9
|
import Logo from "./components/atoms/Logo";
|
|
10
10
|
import Medal from "./components/atoms/Medal";
|
|
11
|
+
import Number from "./components/atoms/Number";
|
|
11
12
|
import Paragraph from "./components/atoms/Paragraph";
|
|
12
13
|
import Radio from "./components/atoms/Radio";
|
|
13
14
|
import Select from "./components/atoms/Select";
|
|
14
15
|
import Spacer from "./components/atoms/Spacer";
|
|
15
16
|
import Subheading from "./components/atoms/Subheading";
|
|
17
|
+
import Toggle from "./components/atoms/Toggle";
|
|
16
18
|
import Trophy from "./components/atoms/Trophy";
|
|
17
19
|
import Alert from "./components/molecules/Alert";
|
|
18
20
|
import Card from "./components/molecules/Card";
|
|
19
|
-
import
|
|
21
|
+
import Checkboxes from "./components/molecules/Checkboxes";
|
|
20
22
|
import IconButton from "./components/molecules/IconButton";
|
|
23
|
+
import InputField from "./components/molecules/InputField";
|
|
21
24
|
import Link from "./components/molecules/Link";
|
|
22
25
|
import Loading from "./components/molecules/Loading";
|
|
23
26
|
import Medals from "./components/molecules/Medals";
|
|
24
27
|
import Notification from "./components/molecules/Notification";
|
|
28
|
+
import NumberField from "./components/molecules/NumberField";
|
|
25
29
|
import Popup from "./components/molecules/Popup";
|
|
26
30
|
import ProgressBar from "./components/molecules/ProgressBar";
|
|
31
|
+
import RadioGroup from "./components/molecules/RadioGroup";
|
|
32
|
+
import SelectField from "./components/molecules/SelectField";
|
|
33
|
+
import ToggleField from "./components/molecules/ToggleField";
|
|
27
34
|
import Tooltip from "./components/molecules/Tooltip";
|
|
28
35
|
import Form from "./components/organisms/Form";
|
|
29
36
|
import Keyboard from "./components/organisms/Keyboard";
|
|
30
37
|
import Modal from "./components/organisms/Modal";
|
|
31
|
-
export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Paragraph, Radio, Select, Spacer, Subheading, Trophy, Alert, Card,
|
|
38
|
+
export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Number, Paragraph, Radio, Select, Spacer, Subheading, Toggle, Trophy, Alert, Card, Checkboxes, IconButton, InputField, Link, Loading, Medals, Notification, NumberField, Popup, ProgressBar, RadioGroup, SelectField, ToggleField, Tooltip, Form, Keyboard, Modal, };
|