@zendeskgarden/react-pagination 8.62.0 → 8.62.2

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 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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
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["default"] = e;
34
+ n.default = e;
37
35
  return Object.freeze(n);
38
36
  }
39
37
 
40
38
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
41
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
42
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
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["default"].ul.attrs({
58
+ const StyledPagination = styled__default.default.ul.attrs({
62
59
  'data-garden-id': COMPONENT_ID$6,
63
- 'data-garden-version': '8.62.0'
60
+ 'data-garden-version': '8.62.2'
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["default"].li.attrs({
90
+ const StyledPageBase = styled__default.default.li.attrs({
94
91
  'data-garden-id': COMPONENT_ID$5,
95
- 'data-garden-version': '8.62.0'
92
+ 'data-garden-version': '8.62.2'
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["default"](StyledPageBase).attrs({
106
+ const StyledPage = styled__default.default(StyledPageBase).attrs({
110
107
  'data-garden-id': COMPONENT_ID$4,
111
- 'data-garden-version': '8.62.0'
108
+ 'data-garden-version': '8.62.2'
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["default"].nav.attrs({
118
+ const StyledCursorPagination = styled__default.default.nav.attrs({
122
119
  'data-garden-id': COMPONENT_ID$3,
123
- 'data-garden-version': '8.62.0'
120
+ 'data-garden-version': '8.62.2'
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["default"](StyledPageBase).attrs({
130
+ const StyledCursor = styled__default.default(StyledPageBase).attrs({
134
131
  'data-garden-id': COMPONENT_ID$2,
135
- 'data-garden-version': '8.62.0',
132
+ 'data-garden-version': '8.62.2',
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["default"](_ref => {
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["default"](StyledPage).attrs({
174
+ const StyledGap = styled__default.default(StyledPage).attrs({
178
175
  'data-garden-id': COMPONENT_ID$1,
179
- 'data-garden-version': '8.62.0'
176
+ 'data-garden-version': '8.62.2'
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["default"](StyledPage).attrs({
186
+ const StyledNavigation = styled__default.default(StyledPage).attrs({
190
187
  'data-garden-id': COMPONENT_ID,
191
- 'data-garden-version': '8.62.0'
188
+ 'data-garden-version': '8.62.2'
192
189
  }).withConfig({
193
190
  displayName: "StyledNavigation",
194
191
  componentId: "sc-184uuwe-0"
@@ -238,10 +235,10 @@ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
238
235
  const PreviousComponent$1 = React.forwardRef((props, ref) => {
239
236
  const ariaLabel = reactTheming.useText(PreviousComponent$1, props, 'aria-label', 'Previous page');
240
237
  const theme = React.useContext(styled.ThemeContext);
241
- return React__default["default"].createElement(StyledNavigation, _extends$4({}, props, {
238
+ return React__namespace.default.createElement(StyledNavigation, _extends$4({}, props, {
242
239
  "aria-label": ariaLabel,
243
240
  ref: ref
244
- }), theme.rtl ? React__default["default"].createElement(SvgChevronRightStroke, null) : React__default["default"].createElement(SvgChevronLeftStroke, null));
241
+ }), theme.rtl ? React__namespace.default.createElement(SvgChevronRightStroke, null) : React__namespace.default.createElement(SvgChevronLeftStroke, null));
245
242
  });
246
243
  PreviousComponent$1.displayName = 'Pagination.Previous';
247
244
  const Previous$1 = PreviousComponent$1;
@@ -249,10 +246,10 @@ const Previous$1 = PreviousComponent$1;
249
246
  const NextComponent$1 = React.forwardRef((props, ref) => {
250
247
  const ariaLabel = reactTheming.useText(NextComponent$1, props, 'aria-label', 'Next page');
251
248
  const theme = React.useContext(styled.ThemeContext);
252
- return React__default["default"].createElement(StyledNavigation, _extends$4({}, props, {
249
+ return React__namespace.default.createElement(StyledNavigation, _extends$4({}, props, {
253
250
  "aria-label": ariaLabel,
254
251
  ref: ref
255
- }), theme.rtl ? React__default["default"].createElement(SvgChevronLeftStroke, null) : React__default["default"].createElement(SvgChevronRightStroke, null));
252
+ }), theme.rtl ? React__namespace.default.createElement(SvgChevronLeftStroke, null) : React__namespace.default.createElement(SvgChevronRightStroke, null));
256
253
  });
257
254
  NextComponent$1.displayName = 'Pagination.Next';
258
255
  const Next$1 = NextComponent$1;
@@ -260,7 +257,7 @@ const Next$1 = NextComponent$1;
260
257
  const PageComponent = React.forwardRef((props, ref) => {
261
258
  const text = props['aria-current'] ? `Current page, page ${props.children}` : `Page ${props.children}`;
262
259
  const ariaLabel = reactTheming.useText(PageComponent, props, 'aria-label', text);
263
- return React__default["default"].createElement(StyledPage, _extends$4({}, props, {
260
+ return React__namespace.default.createElement(StyledPage, _extends$4({}, props, {
264
261
  "aria-label": ariaLabel,
265
262
  ref: ref
266
263
  }));
@@ -268,7 +265,7 @@ const PageComponent = React.forwardRef((props, ref) => {
268
265
  PageComponent.displayName = 'Pagination.Page';
269
266
  const Page = PageComponent;
270
267
 
271
- const GapComponent = React.forwardRef((props, ref) => React__default["default"].createElement(StyledGap, _extends$4({}, props, {
268
+ const GapComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledGap, _extends$4({}, props, {
272
269
  ref: ref
273
270
  }), "\u2026"));
274
271
  GapComponent.displayName = 'Pagination.Gap';
@@ -333,7 +330,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
333
330
  };
334
331
  const renderPreviousPage = () => {
335
332
  const isFirstPageSelected = totalPages > 0 && currentPage === 1;
336
- const focusRef = React__default["default"].createRef();
333
+ const focusRef = React__namespace.default.createRef();
337
334
  const props = isFirstPageSelected ?
338
335
  {
339
336
  hidden: true
@@ -346,7 +343,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
346
343
  }),
347
344
  'aria-label': undefined
348
345
  };
349
- return React__default["default"].createElement(Previous$1, _extends$4({
346
+ return React__namespace.default.createElement(Previous$1, _extends$4({
350
347
  isFocused: focusedItem === PREVIOUS_KEY
351
348
  }, getTransformedProps('previous', props), {
352
349
  ref: focusRef
@@ -354,7 +351,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
354
351
  };
355
352
  const renderNextPage = () => {
356
353
  const isLastPageSelected = currentPage === totalPages;
357
- const focusRef = React__default["default"].createRef();
354
+ const focusRef = React__namespace.default.createRef();
358
355
  const props = isLastPageSelected ?
359
356
  {
360
357
  hidden: true
@@ -367,17 +364,17 @@ const Pagination = React.forwardRef((_ref, ref) => {
367
364
  }),
368
365
  'aria-label': undefined
369
366
  };
370
- return React__default["default"].createElement(Next$1, _extends$4({
367
+ return React__namespace.default.createElement(Next$1, _extends$4({
371
368
  isFocused: focusedItem === NEXT_KEY
372
369
  }, getTransformedProps('next', props), {
373
370
  ref: focusRef
374
371
  }));
375
372
  };
376
- const createGap = pageIndex => React__default["default"].createElement(Gap, _extends$4({
373
+ const createGap = pageIndex => React__namespace.default.createElement(Gap, _extends$4({
377
374
  key: `gap-${pageIndex}`
378
375
  }, getTransformedProps('gap')));
379
376
  const createPage = pageIndex => {
380
- const focusRef = React__default["default"].createRef();
377
+ const focusRef = React__namespace.default.createRef();
381
378
  const props = {
382
379
  ...getPageProps({
383
380
  'aria-label': '',
@@ -388,7 +385,7 @@ const Pagination = React.forwardRef((_ref, ref) => {
388
385
  'aria-label': undefined,
389
386
  title: pageIndex
390
387
  };
391
- return React__default["default"].createElement(Page, _extends$4({
388
+ return React__namespace.default.createElement(Page, _extends$4({
392
389
  key: pageIndex
393
390
  }, getTransformedProps('page', props, pageIndex), {
394
391
  ref: focusRef
@@ -438,19 +435,19 @@ const Pagination = React.forwardRef((_ref, ref) => {
438
435
  }
439
436
  return pages;
440
437
  };
441
- return React__default["default"].createElement(StyledPagination, _extends$4({}, getContainerProps({
438
+ return React__namespace.default.createElement(StyledPagination, _extends$4({}, getContainerProps({
442
439
  role: null
443
440
  }), otherProps, {
444
441
  ref: ref
445
442
  }), renderPreviousPage(), totalPages > 0 && renderPages(), renderNextPage());
446
443
  });
447
444
  Pagination.propTypes = {
448
- currentPage: PropTypes__default["default"].number.isRequired,
449
- totalPages: PropTypes__default["default"].number.isRequired,
450
- pagePadding: PropTypes__default["default"].number,
451
- pageGap: PropTypes__default["default"].number,
452
- onChange: PropTypes__default["default"].func,
453
- transformPageProps: PropTypes__default["default"].func
445
+ currentPage: PropTypes__default.default.number.isRequired,
446
+ totalPages: PropTypes__default.default.number.isRequired,
447
+ pagePadding: PropTypes__default.default.number,
448
+ pageGap: PropTypes__default.default.number,
449
+ onChange: PropTypes__default.default.func,
450
+ transformPageProps: PropTypes__default.default.func
454
451
  };
455
452
  Pagination.defaultProps = {
456
453
  pagePadding: 2,
@@ -482,11 +479,11 @@ const FirstComponent = React.forwardRef((_ref, ref) => {
482
479
  children,
483
480
  ...other
484
481
  } = _ref;
485
- return React__default["default"].createElement(StyledCursor, _extends$4({
482
+ return React__namespace.default.createElement(StyledCursor, _extends$4({
486
483
  ref: ref
487
- }, other), React__default["default"].createElement(StyledIcon, {
484
+ }, other), React__namespace.default.createElement(StyledIcon, {
488
485
  type: "first"
489
- }, React__default["default"].createElement(SvgChevronDoubleLeftStroke, null)), React__default["default"].createElement("span", null, children));
486
+ }, React__namespace.default.createElement(SvgChevronDoubleLeftStroke, null)), React__namespace.default.createElement("span", null, children));
490
487
  });
491
488
  FirstComponent.displayName = 'CursorPagination.First';
492
489
  const First = FirstComponent;
@@ -496,12 +493,12 @@ const NextComponent = React.forwardRef((_ref, ref) => {
496
493
  children,
497
494
  ...other
498
495
  } = _ref;
499
- return React__default["default"].createElement(StyledCursor, _extends$4({
496
+ return React__namespace.default.createElement(StyledCursor, _extends$4({
500
497
  ref: ref,
501
498
  as: "button"
502
- }, other), React__default["default"].createElement("span", null, children), React__default["default"].createElement(StyledIcon, {
499
+ }, other), React__namespace.default.createElement("span", null, children), React__namespace.default.createElement(StyledIcon, {
503
500
  type: "next"
504
- }, React__default["default"].createElement(SvgChevronRightStroke, null)));
501
+ }, React__namespace.default.createElement(SvgChevronRightStroke, null)));
505
502
  });
506
503
  NextComponent.displayName = 'CursorPagination.Next';
507
504
  const Next = NextComponent;
@@ -511,12 +508,12 @@ const PreviousComponent = React.forwardRef((_ref, ref) => {
511
508
  children,
512
509
  ...other
513
510
  } = _ref;
514
- return React__default["default"].createElement(StyledCursor, _extends$4({
511
+ return React__namespace.default.createElement(StyledCursor, _extends$4({
515
512
  ref: ref,
516
513
  as: "button"
517
- }, other), React__default["default"].createElement(StyledIcon, {
514
+ }, other), React__namespace.default.createElement(StyledIcon, {
518
515
  type: "previous"
519
- }, React__default["default"].createElement(SvgChevronLeftStroke, null)), React__default["default"].createElement("span", null, children));
516
+ }, React__namespace.default.createElement(SvgChevronLeftStroke, null)), React__namespace.default.createElement("span", null, children));
520
517
  });
521
518
  PreviousComponent.displayName = 'CursorPagination.Previous';
522
519
  const Previous = PreviousComponent;
@@ -545,17 +542,17 @@ const LastComponent = React.forwardRef((_ref, ref) => {
545
542
  children,
546
543
  ...other
547
544
  } = _ref;
548
- return React__default["default"].createElement(StyledCursor, _extends$4({
545
+ return React__namespace.default.createElement(StyledCursor, _extends$4({
549
546
  ref: ref,
550
547
  as: "button"
551
- }, other), React__default["default"].createElement("span", null, children), React__default["default"].createElement(StyledIcon, {
548
+ }, other), React__namespace.default.createElement("span", null, children), React__namespace.default.createElement(StyledIcon, {
552
549
  type: "last"
553
- }, React__default["default"].createElement(SvgChevronDoubleRightStroke, null)));
550
+ }, React__namespace.default.createElement(SvgChevronDoubleRightStroke, null)));
554
551
  });
555
552
  LastComponent.displayName = 'CursorPagination.Last';
556
553
  const Last = LastComponent;
557
554
 
558
- const CursorPaginationComponent = React.forwardRef((props, ref) => React__default["default"].createElement(StyledCursorPagination, _extends$4({
555
+ const CursorPaginationComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledCursorPagination, _extends$4({
559
556
  ref: ref
560
557
  }, props)));
561
558
  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.62.0'
35
+ 'data-garden-version': '8.62.2'
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.62.0'
67
+ 'data-garden-version': '8.62.2'
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.62.0'
83
+ 'data-garden-version': '8.62.2'
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.62.0'
95
+ 'data-garden-version': '8.62.2'
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.62.0',
107
+ 'data-garden-version': '8.62.2',
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.62.0'
151
+ 'data-garden-version': '8.62.2'
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.62.0'
163
+ 'data-garden-version': '8.62.2'
164
164
  }).withConfig({
165
165
  displayName: "StyledNavigation",
166
166
  componentId: "sc-184uuwe-0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-pagination",
3
- "version": "8.62.0",
3
+ "version": "8.62.2",
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.62.0",
36
+ "@zendeskgarden/react-theming": "^8.62.2",
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": "f8233a46d9732497578dbea9e88f82a3d4bb3678"
49
+ "gitHead": "27a7d6c021f3360396af60d51ecbf66e9076a405"
50
50
  }