@foris/avocado-suite 0.5.1-beta.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/avocado-suite/src/components/divider/Divider.d.ts +3 -1
- package/dist/avocado-suite/src/components/link/Link.d.ts +22 -0
- package/dist/avocado-suite/src/components/link/Link.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/menu/Menu.d.ts +13 -0
- package/dist/avocado-suite/src/components/menu/Menu.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/round-button/RoundButton.d.ts +16 -0
- package/dist/avocado-suite/src/components/round-button/RoundButton.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/stepper/Stepper.d.ts +13 -0
- package/dist/avocado-suite/src/components/stepper/Stepper.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/tag/Tag.d.ts +26 -0
- package/dist/avocado-suite/src/components/tag/Tag.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/timer/Timer.d.ts +48 -0
- package/dist/avocado-suite/src/components/timer/Timer.test.d.ts +0 -0
- package/dist/avocado-suite/src/components/timer/timer.util.d.ts +8 -0
- package/dist/avocado-suite/src/components/tooltip/Tooltip.d.ts +23 -0
- package/dist/avocado-suite/src/components/tooltip/Tooltip.test.d.ts +0 -0
- package/dist/avocado-suite/src/hooks/useClickOutside.d.ts +7 -0
- package/dist/avocado-suite/src/index.d.ts +14 -6
- package/dist/avocado-suite/src/types/menu.types.d.ts +7 -0
- package/dist/avocado-suite.es.js +3437 -2766
- package/dist/avocado-suite.umd.js +22 -22
- package/dist/style.css +1 -1
- package/package.json +3 -3
@@ -0,0 +1,22 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
import { IconTypes } from '../../../../avocado-icons/src/types/icons.type';
|
3
|
+
export interface LinkProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
4
|
+
/** Render content link */
|
5
|
+
children: React.ReactNode | string;
|
6
|
+
/** Overwrite className */
|
7
|
+
className?: string;
|
8
|
+
/** Set disabled value */
|
9
|
+
disabled?: boolean;
|
10
|
+
/** Set icon left */
|
11
|
+
iconLeft?: IconTypes;
|
12
|
+
/** Set icon right */
|
13
|
+
iconRight?: IconTypes;
|
14
|
+
/** Use when the background is dark */
|
15
|
+
inverse?: boolean;
|
16
|
+
/** Use size 'sm' or 'md'. Default 'md' */
|
17
|
+
size?: 'sm' | 'md';
|
18
|
+
/** Handle onClock event */
|
19
|
+
onClick?: () => void;
|
20
|
+
}
|
21
|
+
declare const Link: FC<LinkProps>;
|
22
|
+
export default Link;
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { MenuItem } from '../../types/menu.types.ts';
|
2
|
+
interface MenuProps {
|
3
|
+
/** Control if you want to close the list after clicking one of the options or not */
|
4
|
+
closeOnClick?: boolean;
|
5
|
+
/** From where to start to render the list */
|
6
|
+
listOrigin?: 'left' | 'right';
|
7
|
+
/** List of the items to render when the menu is open */
|
8
|
+
items: MenuItem[];
|
9
|
+
/** Overwrite className */
|
10
|
+
className?: string;
|
11
|
+
}
|
12
|
+
declare const Menu: (props: MenuProps) => JSX.Element;
|
13
|
+
export default Menu;
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { ButtonVariant } from '../button/Button';
|
2
|
+
import { IconTypes } from '../../../../../../../../avocado-icons/src/types/icons.type.ts';
|
3
|
+
interface RoundButtonProps extends Partial<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>> {
|
4
|
+
/** Icon name */
|
5
|
+
icon: IconTypes;
|
6
|
+
/** Variant of the button */
|
7
|
+
variant?: ButtonVariant;
|
8
|
+
/** Overwrite className */
|
9
|
+
className?: string;
|
10
|
+
/** Loading state */
|
11
|
+
loading?: boolean;
|
12
|
+
/** Disabled state */
|
13
|
+
disabled?: boolean;
|
14
|
+
}
|
15
|
+
declare const RoundButton: (props: RoundButtonProps) => JSX.Element;
|
16
|
+
export default RoundButton;
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
interface StepperProps {
|
3
|
+
/** overwrite className */
|
4
|
+
className?: string;
|
5
|
+
/** Use dark colors palette*/
|
6
|
+
darkMode?: boolean;
|
7
|
+
/** the steps you will have */
|
8
|
+
items: string[];
|
9
|
+
/** index of the active item */
|
10
|
+
itemActive: number;
|
11
|
+
}
|
12
|
+
declare const Stepper: FC<StepperProps>;
|
13
|
+
export default Stepper;
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { IconTypes } from '../../../../avocado-icons/src/types/icons.type';
|
3
|
+
declare const variants: {
|
4
|
+
readonly Outlined: "outlined";
|
5
|
+
readonly Filled: "filled";
|
6
|
+
};
|
7
|
+
export type TagType = typeof variants[keyof typeof variants];
|
8
|
+
export type TagSize = 'sm' | 'lg';
|
9
|
+
export interface ITag {
|
10
|
+
/** Content of the component tag */
|
11
|
+
children?: React.ReactNode;
|
12
|
+
/** Overwrite className */
|
13
|
+
className?: string;
|
14
|
+
/** Disabled state */
|
15
|
+
disabled?: boolean;
|
16
|
+
/** Tag variant type */
|
17
|
+
type?: TagType;
|
18
|
+
/** Icon name */
|
19
|
+
icon?: IconTypes;
|
20
|
+
/** Action when clicking on the component */
|
21
|
+
onClick?: () => void;
|
22
|
+
/** Action when clicking on the icon of the component */
|
23
|
+
onIconClick?: () => void;
|
24
|
+
}
|
25
|
+
declare const Tag: React.FC<ITag>;
|
26
|
+
export default Tag;
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
export interface TimeHTML {
|
3
|
+
days0: string;
|
4
|
+
days1: string;
|
5
|
+
daysBack0: string;
|
6
|
+
daysBack1: string;
|
7
|
+
hours0: string;
|
8
|
+
hours1: string;
|
9
|
+
hoursBack0: string;
|
10
|
+
hoursBack1: string;
|
11
|
+
minutes0: string;
|
12
|
+
minutes1: string;
|
13
|
+
minutesBack0: string;
|
14
|
+
minutesBack1: string;
|
15
|
+
}
|
16
|
+
export interface TimeValues {
|
17
|
+
days: number;
|
18
|
+
hours: number;
|
19
|
+
minutes: number;
|
20
|
+
}
|
21
|
+
export interface TimeObject {
|
22
|
+
/** set label */
|
23
|
+
label: string;
|
24
|
+
/** set value */
|
25
|
+
value: number;
|
26
|
+
}
|
27
|
+
export interface Time {
|
28
|
+
/** set remaining days */
|
29
|
+
days: TimeObject;
|
30
|
+
/** set remaining hours between 0 and 23*/
|
31
|
+
hours: TimeObject;
|
32
|
+
/** set remaining minutes between 0 and 59 */
|
33
|
+
minutes: TimeObject;
|
34
|
+
}
|
35
|
+
export interface TimerProps {
|
36
|
+
/** overwrite className */
|
37
|
+
className?: string;
|
38
|
+
/** set milliSeconds interval */
|
39
|
+
milliSecondsInterval?: number;
|
40
|
+
/** set startCountDown */
|
41
|
+
startCountDown?: boolean;
|
42
|
+
/** set remaining time */
|
43
|
+
time: Time;
|
44
|
+
/** event when finish */
|
45
|
+
onFinish?: () => void;
|
46
|
+
}
|
47
|
+
declare const Timer: FC<TimerProps>;
|
48
|
+
export default Timer;
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Time, TimeHTML } from './Timer';
|
2
|
+
export declare const getTimeValues: (time: Time) => {
|
3
|
+
days: number;
|
4
|
+
hours: number;
|
5
|
+
minutes: number;
|
6
|
+
};
|
7
|
+
export declare const getTotalTime: (data: Time) => number;
|
8
|
+
export declare const defaultTimerHTML: (data: Time) => TimeHTML;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
2
|
+
declare enum PlacementEnum {
|
3
|
+
bottom = "bottom",
|
4
|
+
bottomLeft = "bottomLeft",
|
5
|
+
bottomRight = "bottomRight",
|
6
|
+
top = "top",
|
7
|
+
topLeft = "topLeft",
|
8
|
+
topRight = "topRight",
|
9
|
+
left = "left",
|
10
|
+
right = "right"
|
11
|
+
}
|
12
|
+
export interface TooltipProps {
|
13
|
+
/** Children component */
|
14
|
+
children: ReactNode;
|
15
|
+
/** Overwrite className */
|
16
|
+
className?: string;
|
17
|
+
/** The label of the tooltip */
|
18
|
+
label: string;
|
19
|
+
/** The placement of the popper relative to its reference */
|
20
|
+
placement?: keyof typeof PlacementEnum;
|
21
|
+
}
|
22
|
+
declare const Tooltip: FC<TooltipProps>;
|
23
|
+
export default Tooltip;
|
File without changes
|
@@ -1,14 +1,22 @@
|
|
1
|
+
import { ThemeProvider } from './contexts/theme/ThemeProvider';
|
2
|
+
import Box from './components/box/Box';
|
1
3
|
import Breadcrumbs from './components/breadcrumbs/Breadcrumbs';
|
2
4
|
import Button from './components/button/Button';
|
3
|
-
import Box from './components/box/Box';
|
4
5
|
import Card from './components/card/Card';
|
5
|
-
import Heading from './components/heading/Heading';
|
6
|
-
import Text from './components/text/Text';
|
7
6
|
import Checkbox from './components/checkbox/Checkbox';
|
7
|
+
import Divider from './components/divider/Divider';
|
8
|
+
import Heading from './components/heading/Heading';
|
9
|
+
import Link from './components/link/Link';
|
10
|
+
import Pager from './components/pager/Pager';
|
8
11
|
import RadioButton from './components/radio-button/RadioButton';
|
12
|
+
import RoundButton from './components/round-button/RoundButton';
|
9
13
|
import Select from './components/select/Select';
|
10
14
|
import SelectPagination from './components/select-pagination/SelectPagination';
|
11
|
-
import
|
15
|
+
import Stepper from './components/stepper/Stepper';
|
16
|
+
import Tag from './components/tag/Tag';
|
17
|
+
import Text from './components/text/Text';
|
12
18
|
import TextField from './components/text-field/TextField';
|
13
|
-
import
|
14
|
-
|
19
|
+
import Timer from './components/timer/Timer';
|
20
|
+
import Tooltip from './components/tooltip/Tooltip';
|
21
|
+
import Menu from './components/menu/Menu';
|
22
|
+
export { Box, Breadcrumbs, Button, Card, Checkbox, Divider, Heading, Link, Pager, RadioButton, RoundButton, Select, SelectPagination, Stepper, Tag, Text, TextField, ThemeProvider, Timer, Tooltip, Menu };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { IconTypes } from '../../../../../../avocado-icons/src/types/icons.type.ts';
|
3
|
+
export interface MenuItem {
|
4
|
+
icon?: IconTypes;
|
5
|
+
label: ReactNode;
|
6
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
7
|
+
}
|