@zendeskgarden/react-pagination 8.62.1 → 8.63.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/dist/index.cjs.js +56 -71
- package/dist/index.esm.js +11 -23
- package/dist/typings/types/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var styled = require('styled-components');
|
|
@@ -17,7 +15,7 @@ var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
|
17
15
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
18
16
|
var polished = require('polished');
|
|
19
17
|
|
|
20
|
-
function
|
|
18
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
19
|
|
|
22
20
|
function _interopNamespace(e) {
|
|
23
21
|
if (e && e.__esModule) return e;
|
|
@@ -33,14 +31,13 @@ function _interopNamespace(e) {
|
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
|
-
n
|
|
34
|
+
n.default = e;
|
|
37
35
|
return Object.freeze(n);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
39
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
40
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
44
41
|
|
|
45
42
|
function _extends$4() {
|
|
46
43
|
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -58,9 +55,9 @@ function _extends$4() {
|
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
const COMPONENT_ID$6 = 'pagination.pagination_view';
|
|
61
|
-
const StyledPagination = styled__default
|
|
58
|
+
const StyledPagination = styled__default.default.ul.attrs({
|
|
62
59
|
'data-garden-id': COMPONENT_ID$6,
|
|
63
|
-
'data-garden-version': '8.
|
|
60
|
+
'data-garden-version': '8.63.0'
|
|
64
61
|
}).withConfig({
|
|
65
62
|
displayName: "StyledPagination",
|
|
66
63
|
componentId: "sc-1b7nye9-0"
|
|
@@ -90,9 +87,9 @@ const sizeStyles$2 = props => {
|
|
|
90
87
|
const padding = `${props.theme.space.base * 1.5}px`;
|
|
91
88
|
return styled.css(["padding:0 ", ";height:", ";line-height:", ";font-size:", ";"], padding, height, lineHeight, fontSize);
|
|
92
89
|
};
|
|
93
|
-
const StyledPageBase = styled__default
|
|
90
|
+
const StyledPageBase = styled__default.default.li.attrs({
|
|
94
91
|
'data-garden-id': COMPONENT_ID$5,
|
|
95
|
-
'data-garden-version': '8.
|
|
92
|
+
'data-garden-version': '8.63.0'
|
|
96
93
|
}).withConfig({
|
|
97
94
|
displayName: "StyledPageBase",
|
|
98
95
|
componentId: "sc-lw1w9j-0"
|
|
@@ -106,9 +103,9 @@ const sizeStyles$1 = props => {
|
|
|
106
103
|
const height = `${props.theme.space.base * 8}px`;
|
|
107
104
|
return styled.css(["min-width:", ";max-width:", ";&[aria-current='true']{max-width:none;}"], height, polished.math(`${height} * 2`));
|
|
108
105
|
};
|
|
109
|
-
const StyledPage = styled__default
|
|
106
|
+
const StyledPage = styled__default.default(StyledPageBase).attrs({
|
|
110
107
|
'data-garden-id': COMPONENT_ID$4,
|
|
111
|
-
'data-garden-version': '8.
|
|
108
|
+
'data-garden-version': '8.63.0'
|
|
112
109
|
}).withConfig({
|
|
113
110
|
displayName: "StyledPage",
|
|
114
111
|
componentId: "sc-1k0een3-0"
|
|
@@ -118,9 +115,9 @@ StyledPage.defaultProps = {
|
|
|
118
115
|
};
|
|
119
116
|
|
|
120
117
|
const COMPONENT_ID$3 = 'cursor_pagination';
|
|
121
|
-
const StyledCursorPagination = styled__default
|
|
118
|
+
const StyledCursorPagination = styled__default.default.nav.attrs({
|
|
122
119
|
'data-garden-id': COMPONENT_ID$3,
|
|
123
|
-
'data-garden-version': '8.
|
|
120
|
+
'data-garden-version': '8.63.0'
|
|
124
121
|
}).withConfig({
|
|
125
122
|
displayName: "StyledCursorPagination",
|
|
126
123
|
componentId: "sc-qmfecg-0"
|
|
@@ -130,9 +127,9 @@ StyledCursorPagination.defaultProps = {
|
|
|
130
127
|
};
|
|
131
128
|
|
|
132
129
|
const COMPONENT_ID$2 = 'cursor_pagination.cursor';
|
|
133
|
-
const StyledCursor = styled__default
|
|
130
|
+
const StyledCursor = styled__default.default(StyledPageBase).attrs({
|
|
134
131
|
'data-garden-id': COMPONENT_ID$2,
|
|
135
|
-
'data-garden-version': '8.
|
|
132
|
+
'data-garden-version': '8.63.0',
|
|
136
133
|
as: 'button'
|
|
137
134
|
}).withConfig({
|
|
138
135
|
displayName: "StyledCursor",
|
|
@@ -153,7 +150,7 @@ const marginStyles = props => {
|
|
|
153
150
|
}
|
|
154
151
|
return styled.css(["margin-", ":", "px;"], type === 'first' || type === 'previous' ? 'right' : 'left', margin);
|
|
155
152
|
};
|
|
156
|
-
const StyledIcon = styled__default
|
|
153
|
+
const StyledIcon = styled__default.default(_ref => {
|
|
157
154
|
let {
|
|
158
155
|
children,
|
|
159
156
|
...props
|
|
@@ -174,9 +171,9 @@ const sizeStyles = props => {
|
|
|
174
171
|
const fontSize = polished.math(`${props.theme.fontSizes.md} + ${shift}`);
|
|
175
172
|
return styled.css(["margin-top:", ";font-size:", ";"], marginTop, fontSize);
|
|
176
173
|
};
|
|
177
|
-
const StyledGap = styled__default
|
|
174
|
+
const StyledGap = styled__default.default(StyledPage).attrs({
|
|
178
175
|
'data-garden-id': COMPONENT_ID$1,
|
|
179
|
-
'data-garden-version': '8.
|
|
176
|
+
'data-garden-version': '8.63.0'
|
|
180
177
|
}).withConfig({
|
|
181
178
|
displayName: "StyledGap",
|
|
182
179
|
componentId: "sc-1hqjltf-0"
|
|
@@ -186,9 +183,9 @@ StyledGap.defaultProps = {
|
|
|
186
183
|
};
|
|
187
184
|
|
|
188
185
|
const COMPONENT_ID = 'pagination.navigation';
|
|
189
|
-
const StyledNavigation = styled__default
|
|
186
|
+
const StyledNavigation = styled__default.default(StyledPage).attrs({
|
|
190
187
|
'data-garden-id': COMPONENT_ID,
|
|
191
|
-
'data-garden-version': '8.
|
|
188
|
+
'data-garden-version': '8.63.0'
|
|
192
189
|
}).withConfig({
|
|
193
190
|
displayName: "StyledNavigation",
|
|
194
191
|
componentId: "sc-184uuwe-0"
|
|
@@ -198,9 +195,7 @@ StyledNavigation.defaultProps = {
|
|
|
198
195
|
};
|
|
199
196
|
|
|
200
197
|
var _path$3;
|
|
201
|
-
|
|
202
198
|
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
203
|
-
|
|
204
199
|
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
205
200
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
206
201
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -208,8 +203,7 @@ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
|
208
203
|
height: 16,
|
|
209
204
|
focusable: "false",
|
|
210
205
|
viewBox: "0 0 16 16",
|
|
211
|
-
"aria-hidden": "true"
|
|
212
|
-
role: "img"
|
|
206
|
+
"aria-hidden": "true"
|
|
213
207
|
}, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
214
208
|
fill: "currentColor",
|
|
215
209
|
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
@@ -217,9 +211,7 @@ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
|
217
211
|
};
|
|
218
212
|
|
|
219
213
|
var _path$2;
|
|
220
|
-
|
|
221
214
|
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
222
|
-
|
|
223
215
|
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
224
216
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
225
217
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -227,8 +219,7 @@ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
|
227
219
|
height: 16,
|
|
228
220
|
focusable: "false",
|
|
229
221
|
viewBox: "0 0 16 16",
|
|
230
|
-
"aria-hidden": "true"
|
|
231
|
-
role: "img"
|
|
222
|
+
"aria-hidden": "true"
|
|
232
223
|
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
233
224
|
fill: "currentColor",
|
|
234
225
|
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
@@ -238,10 +229,10 @@ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
|
238
229
|
const PreviousComponent$1 = React.forwardRef((props, ref) => {
|
|
239
230
|
const ariaLabel = reactTheming.useText(PreviousComponent$1, props, 'aria-label', 'Previous page');
|
|
240
231
|
const theme = React.useContext(styled.ThemeContext);
|
|
241
|
-
return
|
|
232
|
+
return React__namespace.default.createElement(StyledNavigation, _extends$4({}, props, {
|
|
242
233
|
"aria-label": ariaLabel,
|
|
243
234
|
ref: ref
|
|
244
|
-
}), theme.rtl ?
|
|
235
|
+
}), theme.rtl ? React__namespace.default.createElement(SvgChevronRightStroke, null) : React__namespace.default.createElement(SvgChevronLeftStroke, null));
|
|
245
236
|
});
|
|
246
237
|
PreviousComponent$1.displayName = 'Pagination.Previous';
|
|
247
238
|
const Previous$1 = PreviousComponent$1;
|
|
@@ -249,10 +240,10 @@ const Previous$1 = PreviousComponent$1;
|
|
|
249
240
|
const NextComponent$1 = React.forwardRef((props, ref) => {
|
|
250
241
|
const ariaLabel = reactTheming.useText(NextComponent$1, props, 'aria-label', 'Next page');
|
|
251
242
|
const theme = React.useContext(styled.ThemeContext);
|
|
252
|
-
return
|
|
243
|
+
return React__namespace.default.createElement(StyledNavigation, _extends$4({}, props, {
|
|
253
244
|
"aria-label": ariaLabel,
|
|
254
245
|
ref: ref
|
|
255
|
-
}), theme.rtl ?
|
|
246
|
+
}), theme.rtl ? React__namespace.default.createElement(SvgChevronLeftStroke, null) : React__namespace.default.createElement(SvgChevronRightStroke, null));
|
|
256
247
|
});
|
|
257
248
|
NextComponent$1.displayName = 'Pagination.Next';
|
|
258
249
|
const Next$1 = NextComponent$1;
|
|
@@ -260,7 +251,7 @@ const Next$1 = NextComponent$1;
|
|
|
260
251
|
const PageComponent = React.forwardRef((props, ref) => {
|
|
261
252
|
const text = props['aria-current'] ? `Current page, page ${props.children}` : `Page ${props.children}`;
|
|
262
253
|
const ariaLabel = reactTheming.useText(PageComponent, props, 'aria-label', text);
|
|
263
|
-
return
|
|
254
|
+
return React__namespace.default.createElement(StyledPage, _extends$4({}, props, {
|
|
264
255
|
"aria-label": ariaLabel,
|
|
265
256
|
ref: ref
|
|
266
257
|
}));
|
|
@@ -268,7 +259,7 @@ const PageComponent = React.forwardRef((props, ref) => {
|
|
|
268
259
|
PageComponent.displayName = 'Pagination.Page';
|
|
269
260
|
const Page = PageComponent;
|
|
270
261
|
|
|
271
|
-
const GapComponent = React.forwardRef((props, ref) =>
|
|
262
|
+
const GapComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledGap, _extends$4({}, props, {
|
|
272
263
|
ref: ref
|
|
273
264
|
}), "\u2026"));
|
|
274
265
|
GapComponent.displayName = 'Pagination.Gap';
|
|
@@ -333,7 +324,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
333
324
|
};
|
|
334
325
|
const renderPreviousPage = () => {
|
|
335
326
|
const isFirstPageSelected = totalPages > 0 && currentPage === 1;
|
|
336
|
-
const focusRef =
|
|
327
|
+
const focusRef = React__namespace.default.createRef();
|
|
337
328
|
const props = isFirstPageSelected ?
|
|
338
329
|
{
|
|
339
330
|
hidden: true
|
|
@@ -346,7 +337,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
346
337
|
}),
|
|
347
338
|
'aria-label': undefined
|
|
348
339
|
};
|
|
349
|
-
return
|
|
340
|
+
return React__namespace.default.createElement(Previous$1, _extends$4({
|
|
350
341
|
isFocused: focusedItem === PREVIOUS_KEY
|
|
351
342
|
}, getTransformedProps('previous', props), {
|
|
352
343
|
ref: focusRef
|
|
@@ -354,7 +345,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
354
345
|
};
|
|
355
346
|
const renderNextPage = () => {
|
|
356
347
|
const isLastPageSelected = currentPage === totalPages;
|
|
357
|
-
const focusRef =
|
|
348
|
+
const focusRef = React__namespace.default.createRef();
|
|
358
349
|
const props = isLastPageSelected ?
|
|
359
350
|
{
|
|
360
351
|
hidden: true
|
|
@@ -367,17 +358,17 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
367
358
|
}),
|
|
368
359
|
'aria-label': undefined
|
|
369
360
|
};
|
|
370
|
-
return
|
|
361
|
+
return React__namespace.default.createElement(Next$1, _extends$4({
|
|
371
362
|
isFocused: focusedItem === NEXT_KEY
|
|
372
363
|
}, getTransformedProps('next', props), {
|
|
373
364
|
ref: focusRef
|
|
374
365
|
}));
|
|
375
366
|
};
|
|
376
|
-
const createGap = pageIndex =>
|
|
367
|
+
const createGap = pageIndex => React__namespace.default.createElement(Gap, _extends$4({
|
|
377
368
|
key: `gap-${pageIndex}`
|
|
378
369
|
}, getTransformedProps('gap')));
|
|
379
370
|
const createPage = pageIndex => {
|
|
380
|
-
const focusRef =
|
|
371
|
+
const focusRef = React__namespace.default.createRef();
|
|
381
372
|
const props = {
|
|
382
373
|
...getPageProps({
|
|
383
374
|
'aria-label': '',
|
|
@@ -388,7 +379,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
388
379
|
'aria-label': undefined,
|
|
389
380
|
title: pageIndex
|
|
390
381
|
};
|
|
391
|
-
return
|
|
382
|
+
return React__namespace.default.createElement(Page, _extends$4({
|
|
392
383
|
key: pageIndex
|
|
393
384
|
}, getTransformedProps('page', props, pageIndex), {
|
|
394
385
|
ref: focusRef
|
|
@@ -438,19 +429,19 @@ const Pagination = React.forwardRef((_ref, ref) => {
|
|
|
438
429
|
}
|
|
439
430
|
return pages;
|
|
440
431
|
};
|
|
441
|
-
return
|
|
432
|
+
return React__namespace.default.createElement(StyledPagination, _extends$4({}, getContainerProps({
|
|
442
433
|
role: null
|
|
443
434
|
}), otherProps, {
|
|
444
435
|
ref: ref
|
|
445
436
|
}), renderPreviousPage(), totalPages > 0 && renderPages(), renderNextPage());
|
|
446
437
|
});
|
|
447
438
|
Pagination.propTypes = {
|
|
448
|
-
currentPage: PropTypes__default
|
|
449
|
-
totalPages: PropTypes__default
|
|
450
|
-
pagePadding: PropTypes__default
|
|
451
|
-
pageGap: PropTypes__default
|
|
452
|
-
onChange: PropTypes__default
|
|
453
|
-
transformPageProps: PropTypes__default
|
|
439
|
+
currentPage: PropTypes__default.default.number.isRequired,
|
|
440
|
+
totalPages: PropTypes__default.default.number.isRequired,
|
|
441
|
+
pagePadding: PropTypes__default.default.number,
|
|
442
|
+
pageGap: PropTypes__default.default.number,
|
|
443
|
+
onChange: PropTypes__default.default.func,
|
|
444
|
+
transformPageProps: PropTypes__default.default.func
|
|
454
445
|
};
|
|
455
446
|
Pagination.defaultProps = {
|
|
456
447
|
pagePadding: 2,
|
|
@@ -459,9 +450,7 @@ Pagination.defaultProps = {
|
|
|
459
450
|
Pagination.displayName = 'Pagination';
|
|
460
451
|
|
|
461
452
|
var _path$1;
|
|
462
|
-
|
|
463
453
|
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
464
|
-
|
|
465
454
|
var SvgChevronDoubleLeftStroke = function SvgChevronDoubleLeftStroke(props) {
|
|
466
455
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
467
456
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -469,8 +458,7 @@ var SvgChevronDoubleLeftStroke = function SvgChevronDoubleLeftStroke(props) {
|
|
|
469
458
|
height: 16,
|
|
470
459
|
focusable: "false",
|
|
471
460
|
viewBox: "0 0 16 16",
|
|
472
|
-
"aria-hidden": "true"
|
|
473
|
-
role: "img"
|
|
461
|
+
"aria-hidden": "true"
|
|
474
462
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
475
463
|
fill: "currentColor",
|
|
476
464
|
d: "M7.812 13.39a.5.5 0 01-.64-.012l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L4.141 8l3.75 4.688a.5.5 0 01-.079.702zm5 0a.5.5 0 01-.64-.012l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L9.141 8l3.75 4.688a.5.5 0 01-.079.702z"
|
|
@@ -482,11 +470,11 @@ const FirstComponent = React.forwardRef((_ref, ref) => {
|
|
|
482
470
|
children,
|
|
483
471
|
...other
|
|
484
472
|
} = _ref;
|
|
485
|
-
return
|
|
473
|
+
return React__namespace.default.createElement(StyledCursor, _extends$4({
|
|
486
474
|
ref: ref
|
|
487
|
-
}, other),
|
|
475
|
+
}, other), React__namespace.default.createElement(StyledIcon, {
|
|
488
476
|
type: "first"
|
|
489
|
-
},
|
|
477
|
+
}, React__namespace.default.createElement(SvgChevronDoubleLeftStroke, null)), React__namespace.default.createElement("span", null, children));
|
|
490
478
|
});
|
|
491
479
|
FirstComponent.displayName = 'CursorPagination.First';
|
|
492
480
|
const First = FirstComponent;
|
|
@@ -496,12 +484,12 @@ const NextComponent = React.forwardRef((_ref, ref) => {
|
|
|
496
484
|
children,
|
|
497
485
|
...other
|
|
498
486
|
} = _ref;
|
|
499
|
-
return
|
|
487
|
+
return React__namespace.default.createElement(StyledCursor, _extends$4({
|
|
500
488
|
ref: ref,
|
|
501
489
|
as: "button"
|
|
502
|
-
}, other),
|
|
490
|
+
}, other), React__namespace.default.createElement("span", null, children), React__namespace.default.createElement(StyledIcon, {
|
|
503
491
|
type: "next"
|
|
504
|
-
},
|
|
492
|
+
}, React__namespace.default.createElement(SvgChevronRightStroke, null)));
|
|
505
493
|
});
|
|
506
494
|
NextComponent.displayName = 'CursorPagination.Next';
|
|
507
495
|
const Next = NextComponent;
|
|
@@ -511,20 +499,18 @@ const PreviousComponent = React.forwardRef((_ref, ref) => {
|
|
|
511
499
|
children,
|
|
512
500
|
...other
|
|
513
501
|
} = _ref;
|
|
514
|
-
return
|
|
502
|
+
return React__namespace.default.createElement(StyledCursor, _extends$4({
|
|
515
503
|
ref: ref,
|
|
516
504
|
as: "button"
|
|
517
|
-
}, other),
|
|
505
|
+
}, other), React__namespace.default.createElement(StyledIcon, {
|
|
518
506
|
type: "previous"
|
|
519
|
-
},
|
|
507
|
+
}, React__namespace.default.createElement(SvgChevronLeftStroke, null)), React__namespace.default.createElement("span", null, children));
|
|
520
508
|
});
|
|
521
509
|
PreviousComponent.displayName = 'CursorPagination.Previous';
|
|
522
510
|
const Previous = PreviousComponent;
|
|
523
511
|
|
|
524
512
|
var _path;
|
|
525
|
-
|
|
526
513
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
527
|
-
|
|
528
514
|
var SvgChevronDoubleRightStroke = function SvgChevronDoubleRightStroke(props) {
|
|
529
515
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
530
516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -532,8 +518,7 @@ var SvgChevronDoubleRightStroke = function SvgChevronDoubleRightStroke(props) {
|
|
|
532
518
|
height: 16,
|
|
533
519
|
focusable: "false",
|
|
534
520
|
viewBox: "0 0 16 16",
|
|
535
|
-
"aria-hidden": "true"
|
|
536
|
-
role: "img"
|
|
521
|
+
"aria-hidden": "true"
|
|
537
522
|
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
538
523
|
fill: "currentColor",
|
|
539
524
|
d: "M8.188 2.61a.5.5 0 01.64.013l.062.065 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L11.859 8l-3.75-4.688a.5.5 0 01.079-.702zm-5 0a.5.5 0 01.64.013l.062.065 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L6.859 8l-3.75-4.688a.5.5 0 01.079-.702z"
|
|
@@ -545,17 +530,17 @@ const LastComponent = React.forwardRef((_ref, ref) => {
|
|
|
545
530
|
children,
|
|
546
531
|
...other
|
|
547
532
|
} = _ref;
|
|
548
|
-
return
|
|
533
|
+
return React__namespace.default.createElement(StyledCursor, _extends$4({
|
|
549
534
|
ref: ref,
|
|
550
535
|
as: "button"
|
|
551
|
-
}, other),
|
|
536
|
+
}, other), React__namespace.default.createElement("span", null, children), React__namespace.default.createElement(StyledIcon, {
|
|
552
537
|
type: "last"
|
|
553
|
-
},
|
|
538
|
+
}, React__namespace.default.createElement(SvgChevronDoubleRightStroke, null)));
|
|
554
539
|
});
|
|
555
540
|
LastComponent.displayName = 'CursorPagination.Last';
|
|
556
541
|
const Last = LastComponent;
|
|
557
542
|
|
|
558
|
-
const CursorPaginationComponent = React.forwardRef((props, ref) =>
|
|
543
|
+
const CursorPaginationComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledCursorPagination, _extends$4({
|
|
559
544
|
ref: ref
|
|
560
545
|
}, props)));
|
|
561
546
|
CursorPaginationComponent.displayName = 'CursorPagination';
|
package/dist/index.esm.js
CHANGED
|
@@ -32,7 +32,7 @@ function _extends$4() {
|
|
|
32
32
|
const COMPONENT_ID$6 = 'pagination.pagination_view';
|
|
33
33
|
const StyledPagination = styled.ul.attrs({
|
|
34
34
|
'data-garden-id': COMPONENT_ID$6,
|
|
35
|
-
'data-garden-version': '8.
|
|
35
|
+
'data-garden-version': '8.63.0'
|
|
36
36
|
}).withConfig({
|
|
37
37
|
displayName: "StyledPagination",
|
|
38
38
|
componentId: "sc-1b7nye9-0"
|
|
@@ -64,7 +64,7 @@ const sizeStyles$2 = props => {
|
|
|
64
64
|
};
|
|
65
65
|
const StyledPageBase = styled.li.attrs({
|
|
66
66
|
'data-garden-id': COMPONENT_ID$5,
|
|
67
|
-
'data-garden-version': '8.
|
|
67
|
+
'data-garden-version': '8.63.0'
|
|
68
68
|
}).withConfig({
|
|
69
69
|
displayName: "StyledPageBase",
|
|
70
70
|
componentId: "sc-lw1w9j-0"
|
|
@@ -80,7 +80,7 @@ const sizeStyles$1 = props => {
|
|
|
80
80
|
};
|
|
81
81
|
const StyledPage = styled(StyledPageBase).attrs({
|
|
82
82
|
'data-garden-id': COMPONENT_ID$4,
|
|
83
|
-
'data-garden-version': '8.
|
|
83
|
+
'data-garden-version': '8.63.0'
|
|
84
84
|
}).withConfig({
|
|
85
85
|
displayName: "StyledPage",
|
|
86
86
|
componentId: "sc-1k0een3-0"
|
|
@@ -92,7 +92,7 @@ StyledPage.defaultProps = {
|
|
|
92
92
|
const COMPONENT_ID$3 = 'cursor_pagination';
|
|
93
93
|
const StyledCursorPagination = styled.nav.attrs({
|
|
94
94
|
'data-garden-id': COMPONENT_ID$3,
|
|
95
|
-
'data-garden-version': '8.
|
|
95
|
+
'data-garden-version': '8.63.0'
|
|
96
96
|
}).withConfig({
|
|
97
97
|
displayName: "StyledCursorPagination",
|
|
98
98
|
componentId: "sc-qmfecg-0"
|
|
@@ -104,7 +104,7 @@ StyledCursorPagination.defaultProps = {
|
|
|
104
104
|
const COMPONENT_ID$2 = 'cursor_pagination.cursor';
|
|
105
105
|
const StyledCursor = styled(StyledPageBase).attrs({
|
|
106
106
|
'data-garden-id': COMPONENT_ID$2,
|
|
107
|
-
'data-garden-version': '8.
|
|
107
|
+
'data-garden-version': '8.63.0',
|
|
108
108
|
as: 'button'
|
|
109
109
|
}).withConfig({
|
|
110
110
|
displayName: "StyledCursor",
|
|
@@ -148,7 +148,7 @@ const sizeStyles = props => {
|
|
|
148
148
|
};
|
|
149
149
|
const StyledGap = styled(StyledPage).attrs({
|
|
150
150
|
'data-garden-id': COMPONENT_ID$1,
|
|
151
|
-
'data-garden-version': '8.
|
|
151
|
+
'data-garden-version': '8.63.0'
|
|
152
152
|
}).withConfig({
|
|
153
153
|
displayName: "StyledGap",
|
|
154
154
|
componentId: "sc-1hqjltf-0"
|
|
@@ -160,7 +160,7 @@ StyledGap.defaultProps = {
|
|
|
160
160
|
const COMPONENT_ID = 'pagination.navigation';
|
|
161
161
|
const StyledNavigation = styled(StyledPage).attrs({
|
|
162
162
|
'data-garden-id': COMPONENT_ID,
|
|
163
|
-
'data-garden-version': '8.
|
|
163
|
+
'data-garden-version': '8.63.0'
|
|
164
164
|
}).withConfig({
|
|
165
165
|
displayName: "StyledNavigation",
|
|
166
166
|
componentId: "sc-184uuwe-0"
|
|
@@ -170,9 +170,7 @@ StyledNavigation.defaultProps = {
|
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
var _path$3;
|
|
173
|
-
|
|
174
173
|
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
175
|
-
|
|
176
174
|
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
177
175
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
178
176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -180,8 +178,7 @@ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
|
180
178
|
height: 16,
|
|
181
179
|
focusable: "false",
|
|
182
180
|
viewBox: "0 0 16 16",
|
|
183
|
-
"aria-hidden": "true"
|
|
184
|
-
role: "img"
|
|
181
|
+
"aria-hidden": "true"
|
|
185
182
|
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
186
183
|
fill: "currentColor",
|
|
187
184
|
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
@@ -189,9 +186,7 @@ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
|
189
186
|
};
|
|
190
187
|
|
|
191
188
|
var _path$2;
|
|
192
|
-
|
|
193
189
|
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
194
|
-
|
|
195
190
|
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
196
191
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
197
192
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -199,8 +194,7 @@ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
|
199
194
|
height: 16,
|
|
200
195
|
focusable: "false",
|
|
201
196
|
viewBox: "0 0 16 16",
|
|
202
|
-
"aria-hidden": "true"
|
|
203
|
-
role: "img"
|
|
197
|
+
"aria-hidden": "true"
|
|
204
198
|
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
205
199
|
fill: "currentColor",
|
|
206
200
|
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
@@ -431,9 +425,7 @@ Pagination.defaultProps = {
|
|
|
431
425
|
Pagination.displayName = 'Pagination';
|
|
432
426
|
|
|
433
427
|
var _path$1;
|
|
434
|
-
|
|
435
428
|
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
436
|
-
|
|
437
429
|
var SvgChevronDoubleLeftStroke = function SvgChevronDoubleLeftStroke(props) {
|
|
438
430
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
439
431
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -441,8 +433,7 @@ var SvgChevronDoubleLeftStroke = function SvgChevronDoubleLeftStroke(props) {
|
|
|
441
433
|
height: 16,
|
|
442
434
|
focusable: "false",
|
|
443
435
|
viewBox: "0 0 16 16",
|
|
444
|
-
"aria-hidden": "true"
|
|
445
|
-
role: "img"
|
|
436
|
+
"aria-hidden": "true"
|
|
446
437
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
447
438
|
fill: "currentColor",
|
|
448
439
|
d: "M7.812 13.39a.5.5 0 01-.64-.012l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L4.141 8l3.75 4.688a.5.5 0 01-.079.702zm5 0a.5.5 0 01-.64-.012l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L9.141 8l3.75 4.688a.5.5 0 01-.079.702z"
|
|
@@ -494,9 +485,7 @@ PreviousComponent.displayName = 'CursorPagination.Previous';
|
|
|
494
485
|
const Previous = PreviousComponent;
|
|
495
486
|
|
|
496
487
|
var _path;
|
|
497
|
-
|
|
498
488
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
499
|
-
|
|
500
489
|
var SvgChevronDoubleRightStroke = function SvgChevronDoubleRightStroke(props) {
|
|
501
490
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
502
491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -504,8 +493,7 @@ var SvgChevronDoubleRightStroke = function SvgChevronDoubleRightStroke(props) {
|
|
|
504
493
|
height: 16,
|
|
505
494
|
focusable: "false",
|
|
506
495
|
viewBox: "0 0 16 16",
|
|
507
|
-
"aria-hidden": "true"
|
|
508
|
-
role: "img"
|
|
496
|
+
"aria-hidden": "true"
|
|
509
497
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
510
498
|
fill: "currentColor",
|
|
511
499
|
d: "M8.188 2.61a.5.5 0 01.64.013l.062.065 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L11.859 8l-3.75-4.688a.5.5 0 01.079-.702zm-5 0a.5.5 0 01.64.013l.062.065 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L6.859 8l-3.75-4.688a.5.5 0 01.079-.702z"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLAttributes } from 'react';
|
|
8
8
|
export declare const PAGE_TYPE: readonly ["next", "page", "gap", "previous"];
|
|
9
|
-
export
|
|
9
|
+
export type PageType = (typeof PAGE_TYPE)[number];
|
|
10
10
|
export interface IPaginationProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
11
11
|
/**
|
|
12
12
|
* Sets the current page. Pages start at 1.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-pagination",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.63.0",
|
|
4
4
|
"description": "Components relating to pagination in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^8.
|
|
36
|
+
"@zendeskgarden/react-theming": "^8.63.0",
|
|
37
37
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "4b8715305a769881b143c7195c5b31e687422926"
|
|
50
50
|
}
|