@typeolymp/ui-components 1.5.8 → 1.7.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.
Files changed (40) hide show
  1. package/build/components/atoms/Button/index.d.ts +4 -2
  2. package/build/components/atoms/Button/stories.d.ts +1 -1
  3. package/build/components/atoms/Icon/index.d.ts +1 -1
  4. package/build/components/atoms/Input/Date.d.ts +0 -1
  5. package/build/components/atoms/Input/index.d.ts +1 -1
  6. package/build/components/atoms/Number/index.d.ts +2 -2
  7. package/build/components/atoms/Number/stories.d.ts +1 -1
  8. package/build/components/atoms/Radio/index.d.ts +2 -1
  9. package/build/components/atoms/Select/index.d.ts +1 -1
  10. package/build/components/atoms/Textarea/index.d.ts +14 -0
  11. package/build/components/atoms/Textarea/stories.d.ts +8 -0
  12. package/build/components/atoms/Textarea/styles.d.ts +1 -0
  13. package/build/components/atoms/Toggle/index.d.ts +1 -1
  14. package/build/components/molecules/Checkboxes/index.d.ts +3 -3
  15. package/build/components/molecules/Collapse/index.d.ts +9 -0
  16. package/build/components/molecules/Collapse/stories.d.ts +15 -0
  17. package/build/components/molecules/Collapse/styles.d.ts +2 -0
  18. package/build/components/molecules/DateInputField/index.d.ts +1 -1
  19. package/build/components/molecules/InputField/index.d.ts +2 -1
  20. package/build/components/molecules/LocaleSelect/index.d.ts +2 -2
  21. package/build/components/molecules/NumberField/index.d.ts +2 -2
  22. package/build/components/molecules/PasswordInputField/index.d.ts +3 -1
  23. package/build/components/molecules/PasswordInputField/styles.d.ts +2 -0
  24. package/build/components/molecules/PasswordInputField/translations.d.ts +11 -0
  25. package/build/components/molecules/RadioGroup/index.d.ts +1 -1
  26. package/build/components/molecules/SelectField/index.d.ts +1 -1
  27. package/build/components/molecules/Steps/index.d.ts +1 -1
  28. package/build/components/molecules/TextareaField/index.d.ts +16 -0
  29. package/build/components/molecules/TextareaField/styles.d.ts +2 -0
  30. package/build/components/molecules/ToggleField/index.d.ts +1 -1
  31. package/build/components/organisms/Form/index.d.ts +11 -4
  32. package/build/components/organisms/Form/stories.d.ts +3 -1
  33. package/build/components/organisms/Keyboard/keys.d.ts +14 -0
  34. package/build/components/organisms/Keyboard/stories.d.ts +1 -1
  35. package/build/index.d.ts +2 -1
  36. package/build/index.es.js +518 -252
  37. package/build/index.es.js.map +1 -1
  38. package/build/index.js +518 -251
  39. package/build/index.js.map +1 -1
  40. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
1
+ import React from "react";
2
2
  export declare type PropsType = {
3
3
  label: string | JSX.Element;
4
4
  color?: "blue" | "green" | "white";
@@ -7,7 +7,9 @@ export declare type PropsType = {
7
7
  disabled?: boolean;
8
8
  type?: "button" | "submit" | "reset";
9
9
  tabIndex?: number;
10
+ href?: string;
11
+ asAnchor?: boolean;
10
12
  onClick?(): void;
11
13
  };
12
- declare const Button: FC<PropsType>;
14
+ declare const Button: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
13
15
  export default Button;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { PropsType } from ".";
3
3
  declare const _default: {
4
4
  title: string;
5
- component: React.FC<PropsType>;
5
+ component: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
6
6
  };
7
7
  export default _default;
8
8
  export declare const Overview: () => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  export declare type PropsType = {
3
- type: "check" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "eye" | "eyeInvisible" | "warning" | "questionCircle" | "play" | "lock" | "cross" | "bulb" | "star" | "setting" | "reload" | "expand" | "calendar";
3
+ type: "check" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "eye" | "eyeInvisible" | "warning" | "questionCircle" | "play" | "lock" | "cross" | "bulb" | "star" | "setting" | "reload" | "expand" | "calendar" | "menuAlt";
4
4
  size?: "tiny" | "small" | "medium" | "large";
5
5
  color?: "blue" | "green" | "orange" | "red" | "purple" | "gray" | "darkGray" | "lightGray" | "white";
6
6
  onClick?(e?: MouseEvent): void;
@@ -1,7 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { PropsType as InputPropsType } from ".";
3
3
  export declare type PropsType = InputPropsType & {
4
- value?: string;
5
4
  min?: string;
6
5
  max?: string;
7
6
  };
@@ -3,7 +3,7 @@ import { PropsType as PasswordInputPropsType } from "./Password";
3
3
  import { PropsType as DateInputPropsType } from "./Date";
4
4
  export declare type PropsType = {
5
5
  id: string;
6
- initialValue?: string;
6
+ defaultValue?: string;
7
7
  placeholder?: string;
8
8
  autoComplete?: string;
9
9
  autoFocus?: boolean;
@@ -1,13 +1,13 @@
1
1
  import { FC } from "react";
2
2
  export declare type PropsType = {
3
- initialValue?: number;
3
+ defaultValue?: number;
4
4
  autoComplete?: string;
5
5
  autoFocus?: boolean;
6
6
  min?: number;
7
7
  max?: number;
8
8
  disabled?: boolean;
9
9
  id?: string;
10
- onChange?(value: string): void;
10
+ onChange?(value: number): void;
11
11
  onBlur?(): void;
12
12
  };
13
13
  declare const Number: FC<PropsType>;
@@ -9,7 +9,7 @@ export declare const Overview: () => JSX.Element;
9
9
  export declare const Playground: {
10
10
  (args: any): JSX.Element;
11
11
  args: {
12
- initialValue: number;
12
+ defaultValue: number;
13
13
  min: number;
14
14
  max: number;
15
15
  disabled: boolean;
@@ -5,7 +5,8 @@ export declare type PropsType = {
5
5
  value: string;
6
6
  disabled?: boolean;
7
7
  autoFocus?: boolean;
8
- defaultChecked?: boolean;
8
+ checked?: boolean;
9
+ defaultValue?: boolean;
9
10
  onChange?(value: string): void;
10
11
  onBlur?(): void;
11
12
  };
@@ -3,7 +3,7 @@ export declare type PropsType = {
3
3
  id: string;
4
4
  name: string;
5
5
  disabled?: boolean;
6
- initialValue?: string;
6
+ defaultValue?: string;
7
7
  placeholder?: string;
8
8
  autoFocus?: boolean;
9
9
  onChange?(value: string): void;
@@ -0,0 +1,14 @@
1
+ import { FC } from "react";
2
+ export declare type PropsType = {
3
+ id: string;
4
+ defaultValue?: string;
5
+ placeholder?: string;
6
+ autoComplete?: string;
7
+ autoFocus?: boolean;
8
+ disabled?: boolean;
9
+ rows?: number;
10
+ onChange?(value: string): void;
11
+ onBlur?(): void;
12
+ };
13
+ declare const Textarea: FC<PropsType>;
14
+ export default Textarea;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1 @@
1
+ export declare const StyledTextarea: any;
@@ -4,7 +4,7 @@ export declare type PropsType = {
4
4
  name: string;
5
5
  disabled?: boolean;
6
6
  autoFocus?: boolean;
7
- defaultChecked?: boolean;
7
+ defaultValue?: boolean;
8
8
  onChange?(value: boolean): void;
9
9
  onBlur?(): void;
10
10
  };
@@ -5,11 +5,11 @@ export declare type PropsType = {
5
5
  items: Array<{
6
6
  id: string;
7
7
  value: string;
8
- label: string | JSX.Element;
8
+ label: string | JSX.Element | JSX.Element[];
9
9
  }>;
10
- initialValue?: Array<string>;
10
+ defaultValue?: string[];
11
11
  autoFocus?: boolean;
12
- onChange?(field: string, value: Array<string>): void;
12
+ onChange?(field: string, value: string[]): void;
13
13
  onBlur?(fieldName: string): void;
14
14
  };
15
15
  declare const Checkboxes: FC<PropsType>;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ export declare type PropsType = {
3
+ items: Array<{
4
+ title: string;
5
+ content: string;
6
+ }>;
7
+ };
8
+ declare const Collapse: FC<PropsType>;
9
+ export default Collapse;
@@ -0,0 +1,15 @@
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: {
9
+ (): JSX.Element;
10
+ parameters: {
11
+ backgrounds: {
12
+ default: string;
13
+ };
14
+ };
15
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Container: any;
2
+ export declare const Item: any;
@@ -3,7 +3,7 @@ export declare type PropsType = {
3
3
  name: string;
4
4
  label: string | JSX.Element;
5
5
  autoComplete?: string;
6
- initialValue?: string;
6
+ defaultValue?: string;
7
7
  min?: string;
8
8
  max?: string;
9
9
  autoFocus?: boolean;
@@ -2,8 +2,9 @@ import { FC } from "react";
2
2
  export declare type PropsType = {
3
3
  name: string;
4
4
  label: string | JSX.Element;
5
+ tips?: string[];
5
6
  autoComplete?: string;
6
- initialValue?: string;
7
+ defaultValue?: string;
7
8
  autoFocus?: boolean;
8
9
  disabled?: boolean;
9
10
  placeholder?: string;
@@ -2,8 +2,8 @@ import { FC } from "react";
2
2
  import { LocaleType } from "@typeolymp/utility/build/types";
3
3
  export declare type PropsType = {
4
4
  color?: "light" | "dark";
5
- locales: Array<LocaleType>;
6
- initialValue: LocaleType;
5
+ locales: LocaleType[];
6
+ defaultValue: LocaleType;
7
7
  onChange(locale: LocaleType): void;
8
8
  };
9
9
  declare const LocaleSelect: FC<PropsType>;
@@ -3,12 +3,12 @@ export declare type PropsType = {
3
3
  name: string;
4
4
  label: string | JSX.Element;
5
5
  autoComplete?: string;
6
- initialValue?: number;
6
+ defaultValue?: number;
7
7
  autoFocus?: boolean;
8
8
  disabled?: any;
9
9
  min?: number;
10
10
  max?: number;
11
- onChange?(field: string, value: string): void;
11
+ onChange?(field: string, value: number): void;
12
12
  onBlur?(fieldName: string): void;
13
13
  };
14
14
  declare const NumberField: FC<PropsType>;
@@ -1,12 +1,14 @@
1
1
  import { FC } from "react";
2
+ import { LocaleType } from "@typeolymp/utility/build/types";
2
3
  export declare type PropsType = {
3
4
  name: string;
4
5
  label: string | JSX.Element;
5
6
  autoComplete?: string;
6
- initialValue?: string;
7
+ defaultValue?: string;
7
8
  autoFocus?: boolean;
8
9
  disabled?: boolean;
9
10
  placeholder?: string;
11
+ helper?: LocaleType;
10
12
  onChange?(fieldName: string, value: string): void;
11
13
  onKeyPress?(e: KeyboardEvent): void;
12
14
  onBlur?(fieldName: string): void;
@@ -1,2 +1,4 @@
1
1
  export declare const Container: any;
2
2
  export declare const Label: any;
3
+ export declare const HelperContainer: any;
4
+ export declare const Helper: any;
@@ -0,0 +1,11 @@
1
+ import { LocaleType } from "@typeolymp/utility/build/types";
2
+ declare type TranslationsType = {
3
+ capitalLetter: string;
4
+ number: string;
5
+ specialCharacter: string;
6
+ length: string;
7
+ };
8
+ declare const translations: {
9
+ [key in LocaleType]: TranslationsType;
10
+ };
11
+ export default translations;
@@ -7,7 +7,7 @@ export declare type PropsType = {
7
7
  value: string;
8
8
  label: string | JSX.Element;
9
9
  }>;
10
- initialValue?: string;
10
+ defaultValue?: string;
11
11
  autoFocus?: boolean;
12
12
  onChange?(fieldName: string, value: string): void;
13
13
  onBlur?(fieldName: string): void;
@@ -7,7 +7,7 @@ export declare type PropsType = {
7
7
  label: string;
8
8
  }>;
9
9
  disabled?: boolean;
10
- initialValue?: string;
10
+ defaultValue?: string;
11
11
  placeholder?: string;
12
12
  autoFocus?: boolean;
13
13
  onChange?(fieldName: string, value: string): void;
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  declare type StepType = {
3
- title: string;
3
+ title?: string;
4
4
  onClick?(step: number): void;
5
5
  };
6
6
  export declare type PropsType = {
@@ -0,0 +1,16 @@
1
+ import { FC } from "react";
2
+ export declare type PropsType = {
3
+ name: string;
4
+ label: string | JSX.Element;
5
+ tips?: string[];
6
+ autoComplete?: string;
7
+ defaultValue?: string;
8
+ autoFocus?: boolean;
9
+ disabled?: boolean;
10
+ placeholder?: string;
11
+ rows?: number;
12
+ onChange?(fieldName: string, value: string): void;
13
+ onBlur?(fieldName: string): void;
14
+ };
15
+ declare const TextareaField: FC<PropsType>;
16
+ export default TextareaField;
@@ -0,0 +1,2 @@
1
+ export declare const Container: any;
2
+ export declare const Label: any;
@@ -3,7 +3,7 @@ export declare type PropsType = {
3
3
  name: string;
4
4
  label: string | JSX.Element;
5
5
  disabled?: boolean;
6
- initialValue?: boolean;
6
+ defaultValue?: boolean;
7
7
  autoFocus?: boolean;
8
8
  onChange?(fieldName: string, value: boolean): void;
9
9
  onBlur?(fieldName: string): void;
@@ -1,8 +1,9 @@
1
- import { FC } from "react";
1
+ import React from "react";
2
2
  import { PropsType as ButtonPropsType } from "../../atoms/Button";
3
3
  import { PropsType as InputFieldPropsType } from "../../molecules/InputField";
4
4
  import { PropsType as PasswordInputFieldPropsType } from "../../molecules/PasswordInputField";
5
5
  import { PropsType as DateInputFieldPropsType } from "../../molecules/DateInputField";
6
+ import { PropsType as TextareaFieldPropsType } from "../../molecules/TextareaField";
6
7
  import { PropsType as RadioGroupPropsType } from "../../molecules/RadioGroup";
7
8
  import { PropsType as NumberFieldPropsType } from "../../molecules/NumberField";
8
9
  import { PropsType as CheckboxesPropsType } from "../../molecules/Checkboxes";
@@ -28,6 +29,9 @@ declare type PasswordInputFieldType = {
28
29
  declare type DateInputFieldType = {
29
30
  type: "date";
30
31
  } & DateInputFieldPropsType & ValidationType;
32
+ declare type TextareaFieldType = {
33
+ type: "textarea";
34
+ } & TextareaFieldPropsType & ValidationType;
31
35
  declare type RadioGroupFieldType = {
32
36
  type: "radio";
33
37
  } & RadioGroupPropsType & ValidationType;
@@ -43,11 +47,11 @@ declare type SelectFieldType = {
43
47
  declare type ToggleFieldType = {
44
48
  type: "toggle";
45
49
  } & ToggleFieldPropsType & ValidationType;
46
- export declare type FormFieldType = InputFieldType | PasswordInputFieldType | DateInputFieldType | RadioGroupFieldType | NumberFieldType | CheckboxesFieldType | SelectFieldType | ToggleFieldType;
50
+ export declare type FormFieldType = InputFieldType | PasswordInputFieldType | DateInputFieldType | TextareaFieldType | RadioGroupFieldType | NumberFieldType | CheckboxesFieldType | SelectFieldType | ToggleFieldType;
47
51
  export declare type PropsType = {
48
52
  title?: string;
49
53
  description?: string;
50
- fields: Array<FormFieldType>;
54
+ fields: FormFieldType[];
51
55
  button?: ButtonPropsType;
52
56
  onChangeFields?(newValues: {
53
57
  [key: string]: ValueType;
@@ -61,5 +65,8 @@ export declare type PropsType = {
61
65
  [key: string]: FeedbackType;
62
66
  }): void;
63
67
  };
64
- declare const Form: FC<PropsType>;
68
+ export declare type FormType = {
69
+ resetForm(): void;
70
+ };
71
+ declare const Form: React.ForwardRefExoticComponent<PropsType & React.RefAttributes<FormType>>;
65
72
  export default Form;
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
+ import { FormType } from "../../organisms/Form";
2
3
  declare const _default: {
3
4
  title: string;
4
- component: React.FC<import("../../organisms/Form").PropsType>;
5
+ component: React.ForwardRefExoticComponent<import("../../organisms/Form").PropsType & React.RefAttributes<FormType>>;
5
6
  };
6
7
  export default _default;
7
8
  export declare const AllTogether: () => JSX.Element;
9
+ export declare const ResetForm: () => JSX.Element;
8
10
  export declare const Input: () => JSX.Element;
9
11
  export declare const Date: () => JSX.Element;
10
12
  export declare const Radio: () => JSX.Element;
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ _id: {
3
+ $oid: string;
4
+ };
5
+ key: string;
6
+ keyboardLayout: string;
7
+ index: number;
8
+ hand: string;
9
+ finger: string;
10
+ color: string;
11
+ isShiftKey: boolean;
12
+ __v: number;
13
+ }[];
14
+ export default _default;
@@ -13,7 +13,7 @@ export declare const Playground: {
13
13
  };
14
14
  argTypes: {
15
15
  layout: {
16
- options: string[];
16
+ options: import("@typeolymp/utility/build/types/KeyboardLayout").default[];
17
17
  control: {
18
18
  type: string;
19
19
  };
package/build/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import Trophy from "./components/atoms/Trophy";
19
19
  import Alert from "./components/molecules/Alert";
20
20
  import Card from "./components/molecules/Card";
21
21
  import Checkboxes from "./components/molecules/Checkboxes";
22
+ import Collapse from "./components/molecules/Collapse";
22
23
  import DateInputField from "./components/molecules/DateInputField";
23
24
  import IconButton from "./components/molecules/IconButton";
24
25
  import InputField from "./components/molecules/InputField";
@@ -39,4 +40,4 @@ import Tooltip from "./components/molecules/Tooltip";
39
40
  import Form from "./components/organisms/Form";
40
41
  import Keyboard from "./components/organisms/Keyboard";
41
42
  import Modal from "./components/organisms/Modal";
42
- export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Number, Paragraph, Radio, Select, Spacer, Subheading, Toggle, Trophy, Alert, Card, Checkboxes, DateInputField, IconButton, InputField, Link, Loading, LocaleSelect, Medals, Notification, NumberField, PasswordInputField, Popup, ProgressBar, Steps, RadioGroup, SelectField, ToggleField, Tooltip, Form, Keyboard, Modal, };
43
+ export { theme, Button, Checkbox, Flag, Heading, Icon, Illustration, Input, Logo, Medal, Number, Paragraph, Radio, Select, Spacer, Subheading, Toggle, Trophy, Alert, Card, Checkboxes, Collapse, DateInputField, IconButton, InputField, Link, Loading, LocaleSelect, Medals, Notification, NumberField, PasswordInputField, Popup, ProgressBar, Steps, RadioGroup, SelectField, ToggleField, Tooltip, Form, Keyboard, Modal, };