@atom-learning/components 2.55.0 → 2.57.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 +10 -2
- package/dist/components/data-table/DataTable.d.ts +5 -0
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTable.types.d.ts +1 -0
- package/dist/components/data-table/DataTable.types.js.map +1 -1
- package/dist/components/data-table/DataTableContext.js +1 -1
- package/dist/components/data-table/DataTableContext.js.map +1 -1
- package/dist/components/data-table/DataTableMetaData.d.ts +14 -0
- package/dist/components/data-table/DataTableMetaData.js +2 -0
- package/dist/components/data-table/DataTableMetaData.js.map +1 -0
- 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,470 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const StyledActionIcon: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<Pick<Omit<Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
3
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
4
|
+
}, "appearance" | "size" | "css" | "theme" | "isRounded"> & import("@stitches/react/types/styled-component").TransformProps<{
|
|
5
|
+
theme?: "primary" | "success" | "danger" | "warning" | "neutral" | undefined;
|
|
6
|
+
appearance?: "outline" | "solid" | "simple" | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
8
|
+
isRounded?: boolean | "true" | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
sm: string;
|
|
11
|
+
md: string;
|
|
12
|
+
lg: string;
|
|
13
|
+
xl: string;
|
|
14
|
+
reducedMotion: string;
|
|
15
|
+
allowMotion: string;
|
|
16
|
+
hover: string;
|
|
17
|
+
}> & {
|
|
18
|
+
css?: import("@stitches/react/types/css-util").CSS<{
|
|
19
|
+
sm: string;
|
|
20
|
+
md: string;
|
|
21
|
+
lg: string;
|
|
22
|
+
xl: string;
|
|
23
|
+
reducedMotion: string;
|
|
24
|
+
allowMotion: string;
|
|
25
|
+
hover: string;
|
|
26
|
+
}, {
|
|
27
|
+
colors: {
|
|
28
|
+
textForeground: any;
|
|
29
|
+
textSubtle: any;
|
|
30
|
+
textPlaceholder: any;
|
|
31
|
+
background: any;
|
|
32
|
+
backgroundAccent: any;
|
|
33
|
+
grey100: any;
|
|
34
|
+
grey200: any;
|
|
35
|
+
grey300: any;
|
|
36
|
+
grey400: any;
|
|
37
|
+
grey500: any;
|
|
38
|
+
grey600: any;
|
|
39
|
+
grey700: any;
|
|
40
|
+
grey800: any;
|
|
41
|
+
grey900: any;
|
|
42
|
+
grey1000: any;
|
|
43
|
+
grey1100: any;
|
|
44
|
+
grey1200: any;
|
|
45
|
+
blue100: any;
|
|
46
|
+
blue200: any;
|
|
47
|
+
blue300: any;
|
|
48
|
+
blue400: any;
|
|
49
|
+
blue500: any;
|
|
50
|
+
blue600: any;
|
|
51
|
+
blue700: any;
|
|
52
|
+
blue800: any;
|
|
53
|
+
blue900: any;
|
|
54
|
+
blue1000: any;
|
|
55
|
+
blue1100: any;
|
|
56
|
+
blue1200: any;
|
|
57
|
+
purple100: any;
|
|
58
|
+
purple200: any;
|
|
59
|
+
purple300: any;
|
|
60
|
+
purple400: any;
|
|
61
|
+
purple500: any;
|
|
62
|
+
purple600: any;
|
|
63
|
+
purple700: any;
|
|
64
|
+
purple800: any;
|
|
65
|
+
purple900: any;
|
|
66
|
+
purple1000: any;
|
|
67
|
+
purple1100: any;
|
|
68
|
+
purple1200: any;
|
|
69
|
+
tonal50: any;
|
|
70
|
+
tonal100: any;
|
|
71
|
+
tonal200: any;
|
|
72
|
+
tonal300: any;
|
|
73
|
+
tonal400: any;
|
|
74
|
+
tonal500: any;
|
|
75
|
+
tonal600: any;
|
|
76
|
+
alpha100: any;
|
|
77
|
+
alpha150: any;
|
|
78
|
+
alpha200: any;
|
|
79
|
+
alpha250: any;
|
|
80
|
+
alpha600: any;
|
|
81
|
+
primaryLight: any;
|
|
82
|
+
primary: any;
|
|
83
|
+
primaryMid: any;
|
|
84
|
+
primaryDark: any;
|
|
85
|
+
secondary: any;
|
|
86
|
+
brandRed: any;
|
|
87
|
+
brandRedAccent: any;
|
|
88
|
+
brandGreen: any;
|
|
89
|
+
brandGreenAccent: any;
|
|
90
|
+
brandPurple: any;
|
|
91
|
+
brandPurpleAccent: any;
|
|
92
|
+
brandYellow: any;
|
|
93
|
+
brandYellowAccent: any;
|
|
94
|
+
successLight: any;
|
|
95
|
+
success: any;
|
|
96
|
+
successMid: any;
|
|
97
|
+
successDark: any;
|
|
98
|
+
dangerLight: any;
|
|
99
|
+
danger: any;
|
|
100
|
+
dangerMid: any;
|
|
101
|
+
dangerDark: any;
|
|
102
|
+
warningLight: any;
|
|
103
|
+
warning: any;
|
|
104
|
+
warningMid: any;
|
|
105
|
+
warningDark: any;
|
|
106
|
+
warningText: any;
|
|
107
|
+
subjectEnglish: any;
|
|
108
|
+
subjectMaths: any;
|
|
109
|
+
subjectScience: any;
|
|
110
|
+
subjectVerbalReasoning: any;
|
|
111
|
+
subjectNonVerbalReasoning: any;
|
|
112
|
+
subjectCreativeWriting: any;
|
|
113
|
+
subjectExamSkills: any;
|
|
114
|
+
};
|
|
115
|
+
space: {
|
|
116
|
+
"0": any;
|
|
117
|
+
"1": any;
|
|
118
|
+
"2": any;
|
|
119
|
+
"3": any;
|
|
120
|
+
"4": any;
|
|
121
|
+
"5": any;
|
|
122
|
+
"6": any;
|
|
123
|
+
"7": any;
|
|
124
|
+
"8": any;
|
|
125
|
+
"9": any;
|
|
126
|
+
"24": any;
|
|
127
|
+
};
|
|
128
|
+
fontSizes: {
|
|
129
|
+
xs: any;
|
|
130
|
+
sm: any;
|
|
131
|
+
md: any;
|
|
132
|
+
lg: any;
|
|
133
|
+
xl: any;
|
|
134
|
+
"2xl": any;
|
|
135
|
+
"3xl": any;
|
|
136
|
+
"4xl": any;
|
|
137
|
+
};
|
|
138
|
+
fonts: {
|
|
139
|
+
sans: any;
|
|
140
|
+
mono: any;
|
|
141
|
+
display: any;
|
|
142
|
+
body: any;
|
|
143
|
+
};
|
|
144
|
+
sizes: {
|
|
145
|
+
"0": any;
|
|
146
|
+
"1": any;
|
|
147
|
+
"2": any;
|
|
148
|
+
"3": any;
|
|
149
|
+
"4": any;
|
|
150
|
+
"5": any;
|
|
151
|
+
"6": any;
|
|
152
|
+
"7": any;
|
|
153
|
+
"8": any;
|
|
154
|
+
};
|
|
155
|
+
radii: {
|
|
156
|
+
"0": any;
|
|
157
|
+
"1": any;
|
|
158
|
+
"2": any;
|
|
159
|
+
"3": any;
|
|
160
|
+
round: any;
|
|
161
|
+
};
|
|
162
|
+
shadows: {
|
|
163
|
+
"0": any;
|
|
164
|
+
"1": any;
|
|
165
|
+
"2": any;
|
|
166
|
+
"3": any;
|
|
167
|
+
};
|
|
168
|
+
ratios: {
|
|
169
|
+
"16-9": any;
|
|
170
|
+
"3-2": any;
|
|
171
|
+
"4-3": any;
|
|
172
|
+
"1-1": any;
|
|
173
|
+
"3-4": any;
|
|
174
|
+
};
|
|
175
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
176
|
+
bg: (value: import("@stitches/react/types/css-util").WithPropertyValue<"background">) => {
|
|
177
|
+
background: import("@stitches/react/types/css-util").WithPropertyValue<"background">;
|
|
178
|
+
};
|
|
179
|
+
size: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">) => {
|
|
180
|
+
height: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">;
|
|
181
|
+
width: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">;
|
|
182
|
+
};
|
|
183
|
+
p: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
184
|
+
padding: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
185
|
+
};
|
|
186
|
+
pt: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
187
|
+
paddingTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
188
|
+
};
|
|
189
|
+
pr: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
190
|
+
paddingRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
191
|
+
};
|
|
192
|
+
pb: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
193
|
+
paddingBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
194
|
+
};
|
|
195
|
+
pl: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
196
|
+
paddingLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
197
|
+
};
|
|
198
|
+
px: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
199
|
+
paddingLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
200
|
+
paddingRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
201
|
+
};
|
|
202
|
+
py: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
203
|
+
paddingTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
204
|
+
paddingBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
205
|
+
};
|
|
206
|
+
m: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
207
|
+
margin: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
208
|
+
};
|
|
209
|
+
mt: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
210
|
+
marginTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
211
|
+
};
|
|
212
|
+
mr: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
213
|
+
marginRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
214
|
+
};
|
|
215
|
+
mb: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
216
|
+
marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
217
|
+
};
|
|
218
|
+
ml: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
219
|
+
marginLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
220
|
+
};
|
|
221
|
+
mx: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
222
|
+
marginLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
223
|
+
marginRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
224
|
+
};
|
|
225
|
+
my: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
226
|
+
marginTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
227
|
+
marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
228
|
+
};
|
|
229
|
+
}> | undefined;
|
|
230
|
+
}, "appearance" | "size" | "theme" | "label" | "children" | "as" | "isRounded" | "hasTooltip" | "tooltipSide" | keyof import("../../types").NavigatorActions> & import("@stitches/react/types/styled-component").TransformProps<{
|
|
231
|
+
theme?: "primary" | "success" | "danger" | "warning" | "neutral" | undefined;
|
|
232
|
+
appearance?: "outline" | "solid" | "simple" | undefined;
|
|
233
|
+
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
234
|
+
isRounded?: boolean | "true" | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
sm: string;
|
|
237
|
+
md: string;
|
|
238
|
+
lg: string;
|
|
239
|
+
xl: string;
|
|
240
|
+
reducedMotion: string;
|
|
241
|
+
allowMotion: string;
|
|
242
|
+
hover: string;
|
|
243
|
+
}> & {
|
|
244
|
+
as?: React.ReactNode;
|
|
245
|
+
children: React.ReactNode;
|
|
246
|
+
label: string;
|
|
247
|
+
hasTooltip?: boolean | undefined;
|
|
248
|
+
tooltipSide?: "bottom" | "left" | "right" | "top" | undefined;
|
|
249
|
+
} & import("../../types").NavigatorActions, "appearance" | "color" | "translate" | "size" | "css" | "theme" | "onBlur" | "onChange" | "onSubmit" | "form" | "label" | "slot" | "style" | "title" | "key" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as" | "disabled" | "value" | "type" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "isRounded" | "hasTooltip" | "tooltipSide" | keyof import("../../types").NavigatorActions> & React.RefAttributes<HTMLButtonElement>>, {}, {
|
|
250
|
+
sm: string;
|
|
251
|
+
md: string;
|
|
252
|
+
lg: string;
|
|
253
|
+
xl: string;
|
|
254
|
+
reducedMotion: string;
|
|
255
|
+
allowMotion: string;
|
|
256
|
+
hover: string;
|
|
257
|
+
}, import("@stitches/react/types/css-util").CSS<{
|
|
258
|
+
sm: string;
|
|
259
|
+
md: string;
|
|
260
|
+
lg: string;
|
|
261
|
+
xl: string;
|
|
262
|
+
reducedMotion: string;
|
|
263
|
+
allowMotion: string;
|
|
264
|
+
hover: string;
|
|
265
|
+
}, {
|
|
266
|
+
colors: {
|
|
267
|
+
textForeground: any;
|
|
268
|
+
textSubtle: any;
|
|
269
|
+
textPlaceholder: any;
|
|
270
|
+
background: any;
|
|
271
|
+
backgroundAccent: any;
|
|
272
|
+
grey100: any;
|
|
273
|
+
grey200: any;
|
|
274
|
+
grey300: any;
|
|
275
|
+
grey400: any;
|
|
276
|
+
grey500: any;
|
|
277
|
+
grey600: any;
|
|
278
|
+
grey700: any;
|
|
279
|
+
grey800: any;
|
|
280
|
+
grey900: any;
|
|
281
|
+
grey1000: any;
|
|
282
|
+
grey1100: any;
|
|
283
|
+
grey1200: any;
|
|
284
|
+
blue100: any;
|
|
285
|
+
blue200: any;
|
|
286
|
+
blue300: any;
|
|
287
|
+
blue400: any;
|
|
288
|
+
blue500: any;
|
|
289
|
+
blue600: any;
|
|
290
|
+
blue700: any;
|
|
291
|
+
blue800: any;
|
|
292
|
+
blue900: any;
|
|
293
|
+
blue1000: any;
|
|
294
|
+
blue1100: any;
|
|
295
|
+
blue1200: any;
|
|
296
|
+
purple100: any;
|
|
297
|
+
purple200: any;
|
|
298
|
+
purple300: any;
|
|
299
|
+
purple400: any;
|
|
300
|
+
purple500: any;
|
|
301
|
+
purple600: any;
|
|
302
|
+
purple700: any;
|
|
303
|
+
purple800: any;
|
|
304
|
+
purple900: any;
|
|
305
|
+
purple1000: any;
|
|
306
|
+
purple1100: any;
|
|
307
|
+
purple1200: any;
|
|
308
|
+
tonal50: any;
|
|
309
|
+
tonal100: any;
|
|
310
|
+
tonal200: any;
|
|
311
|
+
tonal300: any;
|
|
312
|
+
tonal400: any;
|
|
313
|
+
tonal500: any;
|
|
314
|
+
tonal600: any;
|
|
315
|
+
alpha100: any;
|
|
316
|
+
alpha150: any;
|
|
317
|
+
alpha200: any;
|
|
318
|
+
alpha250: any;
|
|
319
|
+
alpha600: any;
|
|
320
|
+
primaryLight: any;
|
|
321
|
+
primary: any;
|
|
322
|
+
primaryMid: any;
|
|
323
|
+
primaryDark: any;
|
|
324
|
+
secondary: any;
|
|
325
|
+
brandRed: any;
|
|
326
|
+
brandRedAccent: any;
|
|
327
|
+
brandGreen: any;
|
|
328
|
+
brandGreenAccent: any;
|
|
329
|
+
brandPurple: any;
|
|
330
|
+
brandPurpleAccent: any;
|
|
331
|
+
brandYellow: any;
|
|
332
|
+
brandYellowAccent: any;
|
|
333
|
+
successLight: any;
|
|
334
|
+
success: any;
|
|
335
|
+
successMid: any;
|
|
336
|
+
successDark: any;
|
|
337
|
+
dangerLight: any;
|
|
338
|
+
danger: any;
|
|
339
|
+
dangerMid: any;
|
|
340
|
+
dangerDark: any;
|
|
341
|
+
warningLight: any;
|
|
342
|
+
warning: any;
|
|
343
|
+
warningMid: any;
|
|
344
|
+
warningDark: any;
|
|
345
|
+
warningText: any;
|
|
346
|
+
subjectEnglish: any;
|
|
347
|
+
subjectMaths: any;
|
|
348
|
+
subjectScience: any;
|
|
349
|
+
subjectVerbalReasoning: any;
|
|
350
|
+
subjectNonVerbalReasoning: any;
|
|
351
|
+
subjectCreativeWriting: any;
|
|
352
|
+
subjectExamSkills: any;
|
|
353
|
+
};
|
|
354
|
+
space: {
|
|
355
|
+
"0": any;
|
|
356
|
+
"1": any;
|
|
357
|
+
"2": any;
|
|
358
|
+
"3": any;
|
|
359
|
+
"4": any;
|
|
360
|
+
"5": any;
|
|
361
|
+
"6": any;
|
|
362
|
+
"7": any;
|
|
363
|
+
"8": any;
|
|
364
|
+
"9": any;
|
|
365
|
+
"24": any;
|
|
366
|
+
};
|
|
367
|
+
fontSizes: {
|
|
368
|
+
xs: any;
|
|
369
|
+
sm: any;
|
|
370
|
+
md: any;
|
|
371
|
+
lg: any;
|
|
372
|
+
xl: any;
|
|
373
|
+
"2xl": any;
|
|
374
|
+
"3xl": any;
|
|
375
|
+
"4xl": any;
|
|
376
|
+
};
|
|
377
|
+
fonts: {
|
|
378
|
+
sans: any;
|
|
379
|
+
mono: any;
|
|
380
|
+
display: any;
|
|
381
|
+
body: any;
|
|
382
|
+
};
|
|
383
|
+
sizes: {
|
|
384
|
+
"0": any;
|
|
385
|
+
"1": any;
|
|
386
|
+
"2": any;
|
|
387
|
+
"3": any;
|
|
388
|
+
"4": any;
|
|
389
|
+
"5": any;
|
|
390
|
+
"6": any;
|
|
391
|
+
"7": any;
|
|
392
|
+
"8": any;
|
|
393
|
+
};
|
|
394
|
+
radii: {
|
|
395
|
+
"0": any;
|
|
396
|
+
"1": any;
|
|
397
|
+
"2": any;
|
|
398
|
+
"3": any;
|
|
399
|
+
round: any;
|
|
400
|
+
};
|
|
401
|
+
shadows: {
|
|
402
|
+
"0": any;
|
|
403
|
+
"1": any;
|
|
404
|
+
"2": any;
|
|
405
|
+
"3": any;
|
|
406
|
+
};
|
|
407
|
+
ratios: {
|
|
408
|
+
"16-9": any;
|
|
409
|
+
"3-2": any;
|
|
410
|
+
"4-3": any;
|
|
411
|
+
"1-1": any;
|
|
412
|
+
"3-4": any;
|
|
413
|
+
};
|
|
414
|
+
}, import("@stitches/react/types/config").DefaultThemeMap, {
|
|
415
|
+
bg: (value: import("@stitches/react/types/css-util").WithPropertyValue<"background">) => {
|
|
416
|
+
background: import("@stitches/react/types/css-util").WithPropertyValue<"background">;
|
|
417
|
+
};
|
|
418
|
+
size: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">) => {
|
|
419
|
+
height: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">;
|
|
420
|
+
width: string | number | import("@stitches/react/types/css-util").WithScaleValue<"size">;
|
|
421
|
+
};
|
|
422
|
+
p: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
423
|
+
padding: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
424
|
+
};
|
|
425
|
+
pt: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
426
|
+
paddingTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
427
|
+
};
|
|
428
|
+
pr: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
429
|
+
paddingRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
430
|
+
};
|
|
431
|
+
pb: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
432
|
+
paddingBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
433
|
+
};
|
|
434
|
+
pl: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
435
|
+
paddingLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
436
|
+
};
|
|
437
|
+
px: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
438
|
+
paddingLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
439
|
+
paddingRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
440
|
+
};
|
|
441
|
+
py: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
442
|
+
paddingTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
443
|
+
paddingBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
444
|
+
};
|
|
445
|
+
m: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
446
|
+
margin: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
447
|
+
};
|
|
448
|
+
mt: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
449
|
+
marginTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
450
|
+
};
|
|
451
|
+
mr: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
452
|
+
marginRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
453
|
+
};
|
|
454
|
+
mb: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
455
|
+
marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
456
|
+
};
|
|
457
|
+
ml: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
458
|
+
marginLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
459
|
+
};
|
|
460
|
+
mx: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
461
|
+
marginLeft: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
462
|
+
marginRight: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
463
|
+
};
|
|
464
|
+
my: (value: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">) => {
|
|
465
|
+
marginTop: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
466
|
+
marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
|
|
467
|
+
};
|
|
468
|
+
}>>;
|
|
469
|
+
export declare const PaginationPreviousButton: (props: Partial<React.ComponentProps<typeof StyledActionIcon>>) => JSX.Element;
|
|
470
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ChevronLeft as u}from"@atom-learning/icons";import*as t from"react";import{styled as c}from"../../stitches.js";import{ActionIcon as p}from"../action-icon/ActionIcon.js";import{Icon as d}from"../icon/Icon.js";import{TRUNCATED_THRESHOLD as g}from"./pagination.constants.js";import{getPaginationItemsToRender as P}from"./pagination.helper.js";import{usePagination as f}from"./usePagination.js";const b=c(p,{mr:"$1","&:disabled":{opacity:"0.3"}}),v=i=>{const{goToPreviousPage:r,currentPage:e,labels:o,disabledPages:n,pagesCount:a,isMaxVisibleElementCount:s}=f(),m=P(e,a,g,s),l=e===1||n.includes(1)&&m.includes(1);return t.createElement(b,{hasTooltip:!1,size:"md",theme:"neutral",onClick:r,disabled:l,...i,label:(o==null?void 0:o.previousPageButtonLabel)||"Previous page"},t.createElement(d,{is:u}))};export{v as PaginationPreviousButton};
|
|
2
|
+
//# sourceMappingURL=PaginationPreviousButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPreviousButton.js","sources":["../../../src/components/pagination/PaginationPreviousButton.tsx"],"sourcesContent":["import { ChevronLeft } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { ActionIcon } from '../action-icon'\nimport { Icon } from '../icon'\nimport { TRUNCATED_THRESHOLD } from './pagination.constants'\nimport { getPaginationItemsToRender } from './pagination.helper'\nimport { usePagination } from './usePagination'\n\nconst StyledActionIcon = styled(ActionIcon, {\n mr: '$1',\n '&:disabled': {\n opacity: '0.3'\n }\n})\n\nexport const PaginationPreviousButton = (\n props: Partial<React.ComponentProps<typeof StyledActionIcon>>\n) => {\n const {\n goToPreviousPage,\n currentPage,\n labels,\n disabledPages,\n pagesCount,\n isMaxVisibleElementCount\n } = usePagination()\n\n const paginationItemsInview = getPaginationItemsToRender(\n currentPage,\n pagesCount,\n TRUNCATED_THRESHOLD,\n isMaxVisibleElementCount\n )\n // Check if we are on the first page or if the first page is disabled and the page number is rendered\n const isDisabled =\n currentPage === 1 ||\n (disabledPages.includes(1) && paginationItemsInview.includes(1))\n\n return (\n <StyledActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n onClick={goToPreviousPage}\n disabled={isDisabled}\n {...props}\n label={labels?.previousPageButtonLabel || 'Previous page'}\n >\n <Icon is={ChevronLeft} />\n </StyledActionIcon>\n )\n}\n"],"names":["StyledActionIcon","styled","ActionIcon","PaginationPreviousButton","props","goToPreviousPage","currentPage","labels","disabledPages","pagesCount","isMaxVisibleElementCount","usePagination","paginationItemsInview","getPaginationItemsToRender","TRUNCATED_THRESHOLD","isDisabled","React","Icon","ChevronLeft"],"mappings":"8YAWA,MAAMA,EAAmBC,EAAOC,EAAY,CAC1C,GAAI,KACJ,aAAc,CACZ,QAAS,KACX,CACF,CAAC,EAEYC,EACXC,GACG,CACH,KAAM,CACJ,iBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,cAAAC,EACA,WAAAC,EACA,yBAAAC,CACF,EAAIC,EAEEC,EAAAA,EAAwBC,EAC5BP,EACAG,EACAK,EACAJ,CACF,EAEMK,EACJT,IAAgB,GACfE,EAAc,SAAS,CAAC,GAAKI,EAAsB,SAAS,CAAC,EAEhE,OACEI,EAAA,cAAChB,EAAA,CACC,WAAY,GACZ,KAAK,KACL,MAAM,UACN,QAASK,EACT,SAAUU,EACT,GAAGX,EACJ,OAAOG,GAAA,KAAA,OAAAA,EAAQ,0BAA2B,eAE1CS,EAAAA,EAAA,cAACC,EAAA,CAAK,GAAIC,CAAa,CAAA,CACzB,CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as a from"react";import{VisibleElementsAmount as g}from"../pagination.constants.js";import{findPreviousAvailablePage as S,findNextAvailablePage as T}from"../pagination.helper.js";const C=a.createContext({goToPage:()=>null,goToPreviousPage:()=>null,goToNextPage:()=>null,currentPage:1,visibleElementsCount:g.LESS,pagesCount:0,onItemHover:()=>null,labels:{},isMaxVisibleElementCount:!1,indicatedPages:[],disabledPages:[]}),A=({onSelectedPageChange:u,selectedPage:v,visibleElementsCount:i=g.LESS,pagesCount:l,indicatedPages:r=[],disabledPages:t=[],onItemHover:P,labels:d,children:E})=>{const[x,p]=a.useState(1),m=i===g.MORE,e=v||x,o=a.useCallback(n=>{p(n),u==null||u(n)},[]),b=a.useCallback(()=>{if(e===1)return;const n=e-1,s=S(n,t);s<1||o(s)},[e,t,o]),c=a.useCallback(()=>{if(e===l)return;const n=e+1,s=T(n,t);s>l||o(s)},[e,t,o,l]),f=a.useMemo(()=>({goToNextPage:c,goToPreviousPage:b,goToPage:o,currentPage:e,visibleElementsCount:i,indicatedPages:r,disabledPages:t,pagesCount:l,onItemHover:P,labels:d,isMaxVisibleElementCount:m}),[c,b,o,e,i,r,t,l,P,d,m]);return a.createElement(C.Provider,{value:f},E)};export{C as PaginationContext,A as PaginationProvider};
|
|
2
|
+
//# sourceMappingURL=PaginationContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationContext.js","sources":["../../../../src/components/pagination/pagination-context/PaginationContext.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { VisibleElementsAmount } from '../pagination.constants'\nimport {\n findNextAvailablePage,\n findPreviousAvailablePage\n} from '../pagination.helper'\nimport type { TPaginationContext, TPaginationProviderProps } from '../types'\n\nexport const PaginationContext = React.createContext<TPaginationContext>({\n goToPage: () => null,\n goToPreviousPage: () => null,\n goToNextPage: () => null,\n currentPage: 1,\n visibleElementsCount: VisibleElementsAmount.LESS,\n pagesCount: 0,\n onItemHover: () => null,\n labels: {},\n isMaxVisibleElementCount: false,\n indicatedPages: [],\n disabledPages: []\n})\n\nexport const PaginationProvider: React.FC<TPaginationProviderProps> = ({\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount = VisibleElementsAmount.LESS,\n pagesCount,\n indicatedPages = [],\n disabledPages = [],\n onItemHover,\n labels,\n children\n}) => {\n const [internalCurrentPage, setInternalCurrentPage] = React.useState(1)\n const isMaxVisibleElementCount =\n visibleElementsCount === VisibleElementsAmount.MORE\n\n const currentPage = selectedPage || internalCurrentPage\n\n const goToPage = React.useCallback((pageNumber: number) => {\n setInternalCurrentPage(pageNumber)\n onSelectedPageChange?.(pageNumber)\n }, [])\n\n const goToPreviousPage = React.useCallback(() => {\n if (currentPage === 1) {\n return\n }\n const previousPage = currentPage - 1\n const previousAvailablePage = findPreviousAvailablePage(\n previousPage,\n disabledPages\n )\n\n if (previousAvailablePage < 1) return\n goToPage(previousAvailablePage)\n }, [currentPage, disabledPages, goToPage])\n\n const goToNextPage = React.useCallback(() => {\n if (currentPage === pagesCount) {\n return\n }\n const nextPage = currentPage + 1\n const nextAvailablePage = findNextAvailablePage(nextPage, disabledPages)\n\n if (nextAvailablePage > pagesCount) return\n goToPage(nextAvailablePage)\n }, [currentPage, disabledPages, goToPage, pagesCount])\n\n const value = React.useMemo(() => {\n return {\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n visibleElementsCount,\n indicatedPages,\n disabledPages,\n pagesCount,\n onItemHover,\n labels,\n isMaxVisibleElementCount\n }\n }, [\n goToNextPage,\n goToPreviousPage,\n goToPage,\n currentPage,\n visibleElementsCount,\n indicatedPages,\n disabledPages,\n pagesCount,\n onItemHover,\n labels,\n isMaxVisibleElementCount\n ])\n\n return (\n <PaginationContext.Provider value={value}>\n {children}\n </PaginationContext.Provider>\n )\n}\n"],"names":["PaginationContext","React","VisibleElementsAmount","PaginationProvider","onSelectedPageChange","selectedPage","visibleElementsCount","pagesCount","indicatedPages","disabledPages","onItemHover","labels","children","internalCurrentPage","setInternalCurrentPage","isMaxVisibleElementCount","currentPage","goToPage","pageNumber","goToPreviousPage","previousPage","previousAvailablePage","findPreviousAvailablePage","goToNextPage","nextPage","nextAvailablePage","findNextAvailablePage","value"],"mappings":"gMASaA,EAAoBC,EAAM,cAAkC,CACvE,SAAU,IAAM,KAChB,iBAAkB,IAAM,KACxB,aAAc,IAAM,KACpB,YAAa,EACb,qBAAsBC,EAAsB,KAC5C,WAAY,EACZ,YAAa,IAAM,KACnB,OAAQ,CACR,EAAA,yBAA0B,GAC1B,eAAgB,CAChB,EAAA,cAAe,CAAA,CACjB,CAAC,EAEYC,EAAyD,CAAC,CACrE,qBAAAC,EACA,aAAAC,EACA,qBAAAC,EAAuBJ,EAAsB,KAC7C,WAAAK,EACA,eAAAC,EAAiB,CAAA,EACjB,cAAAC,EAAgB,GAChB,YAAAC,EACA,OAAAC,EACA,SAAAC,CACF,IAAM,CACJ,KAAM,CAACC,EAAqBC,CAAsB,EAAIb,EAAM,SAAS,CAAC,EAChEc,EACJT,IAAyBJ,EAAsB,KAE3Cc,EAAcX,GAAgBQ,EAE9BI,EAAWhB,EAAM,YAAaiB,GAAuB,CACzDJ,EAAuBI,CAAU,EACjCd,GAAA,MAAAA,EAAuBc,CACzB,CAAA,EAAG,EAAE,EAECC,EAAmBlB,EAAM,YAAY,IAAM,CAC/C,GAAIe,IAAgB,EAClB,OAEF,MAAMI,EAAeJ,EAAc,EAC7BK,EAAwBC,EAC5BF,EACAX,CACF,EAEIY,EAAwB,GAC5BJ,EAASI,CAAqB,CAChC,EAAG,CAACL,EAAaP,EAAeQ,CAAQ,CAAC,EAEnCM,EAAetB,EAAM,YAAY,IAAM,CAC3C,GAAIe,IAAgBT,EAClB,OAEF,MAAMiB,EAAWR,EAAc,EACzBS,EAAoBC,EAAsBF,EAAUf,CAAa,EAEnEgB,EAAoBlB,GACxBU,EAASQ,CAAiB,CAC5B,EAAG,CAACT,EAAaP,EAAeQ,EAAUV,CAAU,CAAC,EAE/CoB,EAAQ1B,EAAM,QAAQ,KACnB,CACL,aAAAsB,EACA,iBAAAJ,EACA,SAAAF,EACA,YAAAD,EACA,qBAAAV,EACA,eAAAE,EACA,cAAAC,EACA,WAAAF,EACA,YAAAG,EACA,OAAAC,EACA,yBAAAI,CACF,GACC,CACDQ,EACAJ,EACAF,EACAD,EACAV,EACAE,EACAC,EACAF,EACAG,EACAC,EACAI,CACF,CAAC,EAED,OACEd,EAAA,cAACD,EAAkB,SAAlB,CAA2B,MAAO2B,CAChCf,EAAAA,CACH,CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.constants.js","sources":["../../../src/components/pagination/pagination.constants.ts"],"sourcesContent":["export const TRUNCATED_THRESHOLD = 4\n\nexport enum VisibleElementsAmount {\n LESS = 6,\n MORE = 8\n}\n"],"names":["TRUNCATED_THRESHOLD","VisibleElementsAmount"],"mappings":"AAAO,MAAMA,EAAsB,EAEvB,IAAAC,GAAAA,IACVA,EAAAA,EAAA,KAAO,GAAP,OACAA,EAAAA,EAAA,KAAO,GAAP,OAFUA,IAAAA,GAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getPaginationItemsToRender: (currentPage: number, pagesCount: number, truncatedThreshold: number, isMaxVisibleElementCount: boolean) => number[];
|
|
2
|
+
export declare const findNextAvailablePage: (startPage: number, disabledPages: number[]) => number;
|
|
3
|
+
export declare const findPreviousAvailablePage: (startPage: number, disabledPages: number[]) => number;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const a=(t,l,e,n)=>{const i=Array.from({length:l-1},(c,r)=>r+1);return l<=e?i:t<e-1?i.slice(0,n?4:2):t>=i.length-(n?3:1)?i.slice(n?-4:-2):i.slice(t+(n?-3:-2),t+(n?1:0))},o=(t,l)=>{let e=t;for(;l.includes(e);)e++;return e},s=(t,l)=>{let e=t;for(;l.includes(e);)e--;return e};export{o as findNextAvailablePage,s as findPreviousAvailablePage,a as getPaginationItemsToRender};
|
|
2
|
+
//# sourceMappingURL=pagination.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.helper.js","sources":["../../../src/components/pagination/pagination.helper.ts"],"sourcesContent":["export const getPaginationItemsToRender = (\n currentPage: number,\n pagesCount: number,\n truncatedThreshold: number,\n isMaxVisibleElementCount: boolean\n): number[] => {\n const listOfPages = Array.from(\n { length: pagesCount - 1 },\n (_, index) => index + 1\n )\n\n if (pagesCount <= truncatedThreshold) return listOfPages\n\n // If the current page is before the 3rd page\n // Render pagination items from 1 to 4 or 1 to 2\n if (currentPage < truncatedThreshold - 1) {\n return listOfPages.slice(0, isMaxVisibleElementCount ? 4 : 2)\n } else if (\n currentPage >=\n listOfPages.length - (isMaxVisibleElementCount ? 3 : 1)\n ) {\n // If the current page is within the last 3 pages or the last page\n // Render the last 4 or 2 pagination items\n return listOfPages.slice(isMaxVisibleElementCount ? -4 : -2)\n }\n // Otherwise render pagination items from the range of n-3 to n+1 or n-2 to n\n return listOfPages.slice(\n currentPage + (isMaxVisibleElementCount ? -3 : -2),\n currentPage + (isMaxVisibleElementCount ? 1 : 0)\n )\n}\n\nexport const findNextAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number => {\n let nextPage = startPage\n while (disabledPages.includes(nextPage)) {\n nextPage++\n }\n return nextPage\n}\n\nexport const findPreviousAvailablePage = (\n startPage: number,\n disabledPages: number[]\n): number => {\n let previousPage = startPage\n while (disabledPages.includes(previousPage)) {\n previousPage--\n }\n return previousPage\n}\n"],"names":["getPaginationItemsToRender","currentPage","pagesCount","truncatedThreshold","isMaxVisibleElementCount","listOfPages","_","index","findNextAvailablePage","startPage","disabledPages","nextPage","findPreviousAvailablePage","previousPage"],"mappings":"AAAa,MAAAA,EAA6B,CACxCC,EACAC,EACAC,EACAC,IACa,CACb,MAAMC,EAAc,MAAM,KACxB,CAAE,OAAQH,EAAa,CAAE,EACzB,CAACI,EAAGC,IAAUA,EAAQ,CACxB,EAEA,OAAIL,GAAcC,EAA2BE,EAIzCJ,EAAcE,EAAqB,EAC9BE,EAAY,MAAM,EAAGD,EAA2B,EAAI,CAAC,EAE5DH,GACAI,EAAY,QAAUD,EAA2B,EAAI,GAI9CC,EAAY,MAAMD,EAA2B,GAAK,EAAE,EAGtDC,EAAY,MACjBJ,GAAeG,EAA2B,GAAK,IAC/CH,GAAeG,EAA2B,EAAI,EAChD,CACF,EAEaI,EAAwB,CACnCC,EACAC,IACW,CACX,IAAIC,EAAWF,EACf,KAAOC,EAAc,SAASC,CAAQ,GACpCA,IAEF,OAAOA,CACT,EAEaC,EAA4B,CACvCH,EACAC,IACW,CACX,IAAIG,EAAeJ,EACnB,KAAOC,EAAc,SAASG,CAAY,GACxCA,IAEF,OAAOA,CACT"}
|
|
@@ -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"}
|