@foris/avocado-suite 0.4.0 → 0.5.1-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. package/dist/avocado-suite/src/components/button/Button.d.ts +2 -0
  2. package/dist/avocado-suite/src/components/card/Card.d.ts +6 -4
  3. package/dist/avocado-suite/src/components/divider/Divider.d.ts +9 -0
  4. package/dist/avocado-suite/src/components/divider/Divider.test.d.ts +0 -0
  5. package/dist/avocado-suite/src/components/pager/Page.test.d.ts +0 -0
  6. package/dist/avocado-suite/src/components/pager/Pager.d.ts +49 -0
  7. package/dist/avocado-suite/src/components/pager/components/ArrowPager.d.ts +9 -0
  8. package/dist/avocado-suite/src/components/pager/components/ButtonPager.d.ts +11 -0
  9. package/dist/avocado-suite/src/components/pager/utils/generateArrayOfPages.d.ts +2 -0
  10. package/dist/avocado-suite/src/components/radio-button/RadioButton.d.ts +17 -0
  11. package/dist/avocado-suite/src/components/radio-button/RadioButton.test.d.ts +0 -0
  12. package/dist/avocado-suite/src/components/select/Select.d.ts +24 -0
  13. package/dist/avocado-suite/src/components/select/Select.test.d.ts +0 -0
  14. package/dist/avocado-suite/src/components/select/components/SelectIndicators.d.ts +8 -0
  15. package/dist/avocado-suite/src/components/select-pagination/SelectPagination.d.ts +26 -0
  16. package/dist/avocado-suite/src/components/select-pagination/SelectPagination.test.d.ts +0 -0
  17. package/dist/avocado-suite/src/components/text-field/TextField.d.ts +17 -0
  18. package/dist/avocado-suite/src/components/text-field/TextField.test.d.ts +0 -0
  19. package/dist/avocado-suite/src/components/text-field/components/StatusIcon.d.ts +7 -0
  20. package/dist/avocado-suite/src/index.d.ts +7 -1
  21. package/dist/avocado-suite.es.js +6086 -796
  22. package/dist/avocado-suite.umd.js +83 -12
  23. package/dist/style.css +1 -1
  24. package/package.json +9 -3
@@ -6,6 +6,8 @@ export interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAtt
6
6
  children: React.ReactNode | string;
7
7
  /** Overwrite className */
8
8
  className?: string;
9
+ /** Loading state */
10
+ loading?: boolean;
9
11
  /** Show icon on the left */
10
12
  leftIcon?: IconTypes;
11
13
  /** Show icon on the right */
@@ -4,10 +4,12 @@ interface CardProps {
4
4
  children: ReactNode;
5
5
  /** Overwrite className */
6
6
  className?: string;
7
- /** disabled state */
8
- isDisabled?: boolean;
9
- /** Clickable effect */
10
- isClickable?: boolean;
7
+ /** Overwrite content className */
8
+ classNameContent?: string;
9
+ /** Disabled state */
10
+ disabled?: boolean;
11
+ /** OnClick event */
12
+ onClick?: () => void;
11
13
  }
12
14
  declare const Card: FC<CardProps>;
13
15
  export default Card;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ interface DividerProps {
3
+ /** Overwrite className */
4
+ className?: string;
5
+ /** Set the position vertical */
6
+ vertical?: boolean;
7
+ }
8
+ declare const Divider: FC<DividerProps>;
9
+ export default Divider;
@@ -0,0 +1,49 @@
1
+ import { FC } from 'react';
2
+ export type PagerProps = {
3
+ /** Overwrite children classNames */
4
+ classname?: {
5
+ global?: string;
6
+ nav?: string;
7
+ arrow?: string;
8
+ button?: string;
9
+ };
10
+ /**
11
+ * Current page
12
+ */
13
+ page: number;
14
+ /**
15
+ * Size per page
16
+ */
17
+ size: number;
18
+ /**
19
+ * Total number of items
20
+ */
21
+ total: number;
22
+ /**
23
+ * Total number of pages
24
+ */
25
+ totalPages?: number;
26
+ /**
27
+ * Callback: Action `onClick` on page
28
+ * @param page number of page
29
+ * @returns
30
+ */
31
+ onChange?: (page: number) => void;
32
+ /**
33
+ * Deprecated use "onChange" prop.
34
+ * @deprecated use "onChange" prop.
35
+ */
36
+ onPageChange?: (page: number) => void;
37
+ /**
38
+ * Deprecated is not used in the component
39
+ * @deprecated is not used in the component
40
+ */
41
+ hasPreviousPage?: boolean;
42
+ /**
43
+ * Deprecated is not used in the component
44
+ * @deprecated is not used in the component
45
+ */
46
+ hasNextPage?: boolean;
47
+ };
48
+ declare const Pager: FC<PagerProps>;
49
+ export default Pager;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ interface ArrowProps {
3
+ className?: string;
4
+ onClick: () => void;
5
+ icon: 'chevron-left' | 'chevron-right' | 'chevrons-left' | 'chevrons-right';
6
+ disabled: boolean;
7
+ }
8
+ declare const Arrow: FC<ArrowProps>;
9
+ export default Arrow;
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ interface ButtonPagerProps {
3
+ className?: string;
4
+ onClick: () => void;
5
+ page: number;
6
+ currentPage: number;
7
+ ellipsisAsNumber: number;
8
+ disabled?: boolean;
9
+ }
10
+ declare const ButtonPager: FC<ButtonPagerProps>;
11
+ export default ButtonPager;
@@ -0,0 +1,2 @@
1
+ declare const generateArrayOfPages: (currentPage: number, numberOfPages: number, ellipsisAsNumber: number) => number[];
2
+ export default generateArrayOfPages;
@@ -0,0 +1,17 @@
1
+ import { FC, ReactNode, DetailedHTMLProps, InputHTMLAttributes } from 'react';
2
+ export interface RadioButtonProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
3
+ /** overwrite className */
4
+ className?: string;
5
+ /** overwrite className in RadioButton */
6
+ classNameRadioButton?: string;
7
+ /** Text or ReactNode to be displayed at the left of the radio input */
8
+ labelLeft?: ReactNode | string;
9
+ /** Label Right side RadioButton*/
10
+ labelRight?: ReactNode | string;
11
+ /** disabled state */
12
+ disabled?: boolean;
13
+ /** Reference used on the input component */
14
+ ref?: any;
15
+ }
16
+ declare const RadioButton: FC<RadioButtonProps>;
17
+ export default RadioButton;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { Props } from 'react-select';
3
+ export interface SelectProps extends Props {
4
+ /** Overwrite className */
5
+ className?: string;
6
+ /** Disabled state */
7
+ disabled?: boolean;
8
+ /** Error option */
9
+ error?: string | boolean;
10
+ /** Text to be displayed representing the option */
11
+ label?: string;
12
+ /** [react-select] Array of options that populate the select menu */
13
+ options?: any[];
14
+ /** [react-select] Placeholder for the select value */
15
+ placeholder?: string;
16
+ /** [react-select] The value of the select; reflected by the selected option */
17
+ value?: any;
18
+ /** [react-select] Handle change events on the select */
19
+ onChange?: (e: any) => void;
20
+ /** [react-select] Handle change events on the input */
21
+ onInputChange?: (e: any) => void;
22
+ }
23
+ declare const Select: React.FC<SelectProps>;
24
+ export default Select;
@@ -0,0 +1,8 @@
1
+ import { ClearIndicatorProps, DropdownIndicatorProps } from 'react-select';
2
+ export declare const ClearIndicator: (props: ClearIndicatorProps) => JSX.Element;
3
+ export declare const DropdownIndicator: (props: DropdownIndicatorProps) => JSX.Element;
4
+ interface ErrorIndicator {
5
+ message: string;
6
+ }
7
+ export declare const ErrorIndicator: (props: ErrorIndicator) => JSX.Element;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Props } from 'react-select';
3
+ export interface SelectPaginationProps extends Props {
4
+ /** Overwrite className */
5
+ className?: string;
6
+ /** Disabled state */
7
+ disabled?: boolean;
8
+ /** Error option */
9
+ error?: string | boolean;
10
+ /** Text to be displayed representing the option */
11
+ label?: string;
12
+ /** [react-select] Default additional for first request for every search. */
13
+ additional?: any;
14
+ /** [react-select] Debounce timeout for loadOptions calls. 0 by default. */
15
+ debounceTimeout?: any;
16
+ /** [react-select] Function. Async function that take next arguments. */
17
+ loadOptions: any;
18
+ /** [react-select] Placeholder for the select value */
19
+ placeholder?: string;
20
+ /** [react-select] The value of the select; reflected by the selected option */
21
+ value?: any;
22
+ /** [react-select] Function. */
23
+ onChange?: any;
24
+ }
25
+ declare const SelectPagination: React.FC<SelectPaginationProps>;
26
+ export default SelectPagination;
@@ -0,0 +1,17 @@
1
+ import { DetailedHTMLProps, InputHTMLAttributes, FC } from 'react';
2
+ export interface TextFieldProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
3
+ /** Overwrite className */
4
+ className?: string;
5
+ /** If allow to remove input content with clear icon */
6
+ allowClear?: boolean;
7
+ /** Set top label */
8
+ label?: string;
9
+ /** Set validation status */
10
+ status?: 'error' | 'warning' | 'blocked' | 'unsaved';
11
+ /** Set display for validation status */
12
+ statusDisplay?: 'inline' | 'icon';
13
+ /** Set helper text for validation status */
14
+ statusText?: string;
15
+ }
16
+ declare const TextField: FC<TextFieldProps>;
17
+ export default TextField;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ interface StatusIconProps {
3
+ status: 'error' | 'warning' | 'blocked' | 'unsaved';
4
+ size?: 'sm' | 'md' | 'lg';
5
+ }
6
+ declare const StatusIcon: FC<StatusIconProps>;
7
+ export default StatusIcon;
@@ -5,5 +5,11 @@ import Card from './components/card/Card';
5
5
  import Heading from './components/heading/Heading';
6
6
  import Text from './components/text/Text';
7
7
  import Checkbox from './components/checkbox/Checkbox';
8
+ import Pager from './components/pager/Pager';
9
+ import RadioButton from './components/radio-button/RadioButton';
10
+ import Select from './components/select/Select';
11
+ import SelectPagination from './components/select-pagination/SelectPagination';
12
+ import Divider from './components/divider/Divider';
13
+ import TextField from './components/text-field/TextField';
8
14
  import { ThemeProvider } from './contexts/theme/ThemeProvider';
9
- export { Breadcrumbs, Button, Box, Card, Checkbox, Heading, Text, ThemeProvider };
15
+ export { Box, Breadcrumbs, Button, Card, Checkbox, Heading, Text, Pager, RadioButton, Select, SelectPagination, Divider, TextField, ThemeProvider, };