@atom-learning/components 2.54.3 → 2.56.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/CHANGELOG.md +15 -2
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/pagination/Pagination.d.ts +3 -0
- package/dist/components/pagination/Pagination.js +2 -0
- package/dist/components/pagination/Pagination.js.map +1 -0
- package/dist/components/pagination/PaginationItem.d.ts +3 -0
- package/dist/components/pagination/PaginationItem.js +2 -0
- package/dist/components/pagination/PaginationItem.js.map +1 -0
- package/dist/components/pagination/PaginationNextButton.d.ts +470 -0
- package/dist/components/pagination/PaginationNextButton.js +2 -0
- package/dist/components/pagination/PaginationNextButton.js.map +1 -0
- package/dist/components/pagination/PaginationPages.d.ts +2 -0
- package/dist/components/pagination/PaginationPages.js +2 -0
- package/dist/components/pagination/PaginationPages.js.map +1 -0
- package/dist/components/pagination/PaginationPopover.d.ts +2 -0
- package/dist/components/pagination/PaginationPopover.js +2 -0
- package/dist/components/pagination/PaginationPopover.js.map +1 -0
- package/dist/components/pagination/PaginationPreviousButton.d.ts +470 -0
- package/dist/components/pagination/PaginationPreviousButton.js +2 -0
- package/dist/components/pagination/PaginationPreviousButton.js.map +1 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/pagination-context/PaginationContext.d.ts +4 -0
- package/dist/components/pagination/pagination-context/PaginationContext.js +2 -0
- package/dist/components/pagination/pagination-context/PaginationContext.js.map +1 -0
- package/dist/components/pagination/pagination.constants.d.ts +5 -0
- package/dist/components/pagination/pagination.constants.js +2 -0
- package/dist/components/pagination/pagination.constants.js.map +1 -0
- package/dist/components/pagination/pagination.helper.d.ts +3 -0
- package/dist/components/pagination/pagination.helper.js +2 -0
- package/dist/components/pagination/pagination.helper.js.map +1 -0
- package/dist/components/pagination/types.d.ts +42 -0
- package/dist/components/pagination/usePagination.d.ts +2 -0
- package/dist/components/pagination/usePagination.js +2 -0
- package/dist/components/pagination/usePagination.js.map +1 -0
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TcolorScheme } from '../../experiments/color-scheme';
|
|
3
|
+
import { CSS } from '../../stitches';
|
|
4
|
+
import { Box } from '..';
|
|
5
|
+
interface ILabels {
|
|
6
|
+
popoverTriggerLabel?: string;
|
|
7
|
+
nextPageButtonLabel?: string;
|
|
8
|
+
previousPageButtonLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
interface TBasePaginationType {
|
|
11
|
+
visibleElementsCount: TVisibleElementsCount;
|
|
12
|
+
indicatedPages: number[];
|
|
13
|
+
disabledPages: number[];
|
|
14
|
+
onItemHover?: (pageNumber: number) => void;
|
|
15
|
+
labels?: ILabels;
|
|
16
|
+
}
|
|
17
|
+
export declare type TVisibleElementsCount = 6 | 8;
|
|
18
|
+
export declare type TPaginationProps = React.ComponentProps<typeof Box> & TPaginationProviderProps & {
|
|
19
|
+
colorScheme?: TcolorScheme;
|
|
20
|
+
indicatedPages?: number[];
|
|
21
|
+
disabledPages?: number[];
|
|
22
|
+
visibleElementsCount?: TVisibleElementsCount;
|
|
23
|
+
};
|
|
24
|
+
export declare type TPaginationProviderProps = {
|
|
25
|
+
onSelectedPageChange: (pageNumber: number) => void;
|
|
26
|
+
pagesCount: number;
|
|
27
|
+
selectedPage?: number;
|
|
28
|
+
} & TBasePaginationType;
|
|
29
|
+
export declare type TPaginationContext = {
|
|
30
|
+
goToPage: (pagenumber: number) => void;
|
|
31
|
+
goToPreviousPage: () => void;
|
|
32
|
+
goToNextPage: () => void;
|
|
33
|
+
currentPage: number;
|
|
34
|
+
pagesCount: number;
|
|
35
|
+
isMaxVisibleElementCount: boolean;
|
|
36
|
+
} & TBasePaginationType;
|
|
37
|
+
export interface IPaginationItemProps {
|
|
38
|
+
pageNumber: number;
|
|
39
|
+
css?: CSS;
|
|
40
|
+
onItemHover?: (pageNumber: number) => void;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as o from"react";import{PaginationContext as n}from"./pagination-context/PaginationContext.js";const r=()=>{const t=o.useContext(n);if(!t)throw new Error("Ensure that you wrap any components with the PaginationProvider component");return t};export{r as usePagination};
|
|
2
|
+
//# sourceMappingURL=usePagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.js","sources":["../../../src/components/pagination/usePagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { PaginationContext } from './pagination-context/PaginationContext'\nimport type { TPaginationContext } from './types'\n\nexport const usePagination = (): TPaginationContext => {\n const context = React.useContext(PaginationContext)\n\n if (!context) {\n throw new Error(\n 'Ensure that you wrap any components with the PaginationProvider component'\n )\n }\n\n return context\n}\n"],"names":["usePagination","context","React","PaginationContext"],"mappings":"sGAKa,MAAAA,EAAgB,IAA0B,CACrD,MAAMC,EAAUC,EAAM,WAAWC,CAAiB,EAElD,GAAI,CAACF,EACH,MAAM,IAAI,MACR,2EACF,EAGF,OAAOA,CACT"}
|