@foris/avocado-suite 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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;
@@ -5,5 +5,6 @@ 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';
8
9
  import { ThemeProvider } from './contexts/theme/ThemeProvider';
9
- export { Breadcrumbs, Button, Box, Card, Checkbox, Heading, Text, ThemeProvider };
10
+ export { Breadcrumbs, Button, Box, Card, Checkbox, Heading, Text, Pager, ThemeProvider, };