@zendeskgarden/react-pagination 8.75.1 → 8.76.1

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.
Files changed (26) hide show
  1. package/dist/esm/elements/CursorPagination/CursorPagination.js +30 -0
  2. package/dist/esm/elements/CursorPagination/components/First.js +31 -0
  3. package/dist/esm/elements/CursorPagination/components/Last.js +32 -0
  4. package/dist/esm/elements/CursorPagination/components/Next.js +32 -0
  5. package/dist/esm/elements/CursorPagination/components/Previous.js +32 -0
  6. package/dist/esm/elements/Pagination/Pagination.js +208 -0
  7. package/dist/esm/elements/Pagination/components/Gap.js +22 -0
  8. package/dist/esm/elements/Pagination/components/Next.js +31 -0
  9. package/dist/esm/elements/Pagination/components/Page.js +28 -0
  10. package/dist/esm/elements/Pagination/components/Previous.js +31 -0
  11. package/dist/esm/index.js +8 -0
  12. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-left-stroke.svg.js +25 -0
  13. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-right-stroke.svg.js +25 -0
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js +25 -0
  15. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js +25 -0
  16. package/dist/esm/styled/CursorPagination/StyledCursor.js +24 -0
  17. package/dist/esm/styled/CursorPagination/StyledCursorPagination.js +22 -0
  18. package/dist/esm/styled/CursorPagination/StyledIcon.js +36 -0
  19. package/dist/esm/styled/Pagination/StyledGap.js +30 -0
  20. package/dist/esm/styled/Pagination/StyledNavigation.js +23 -0
  21. package/dist/esm/styled/Pagination/StyledPage.js +28 -0
  22. package/dist/esm/styled/Pagination/StyledPageBase.js +44 -0
  23. package/dist/esm/styled/Pagination/StyledPagination.js +22 -0
  24. package/dist/index.cjs.js +26 -42
  25. package/package.json +5 -5
  26. package/dist/index.esm.js +0 -530
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import { First } from './components/First.js';
9
+ import { Next } from './components/Next.js';
10
+ import { Previous } from './components/Previous.js';
11
+ import { Last } from './components/Last.js';
12
+ import '../../styled/Pagination/StyledPagination.js';
13
+ import '../../styled/Pagination/StyledPage.js';
14
+ import { StyledCursorPagination } from '../../styled/CursorPagination/StyledCursorPagination.js';
15
+ import '../../styled/CursorPagination/StyledCursor.js';
16
+ import '../../styled/CursorPagination/StyledIcon.js';
17
+ import '../../styled/Pagination/StyledGap.js';
18
+ import '../../styled/Pagination/StyledNavigation.js';
19
+
20
+ const CursorPaginationComponent = forwardRef((props, ref) => React__default.createElement(StyledCursorPagination, Object.assign({
21
+ ref: ref
22
+ }, props)));
23
+ CursorPaginationComponent.displayName = 'CursorPagination';
24
+ const CursorPagination = CursorPaginationComponent;
25
+ CursorPagination.First = First;
26
+ CursorPagination.Next = Next;
27
+ CursorPagination.Previous = Previous;
28
+ CursorPagination.Last = Last;
29
+
30
+ export { CursorPagination, CursorPaginationComponent };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import SvgChevronDoubleLeftStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-left-stroke.svg.js';
9
+ import '../../../styled/Pagination/StyledPagination.js';
10
+ import '../../../styled/Pagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
13
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
14
+ import '../../../styled/Pagination/StyledGap.js';
15
+ import '../../../styled/Pagination/StyledNavigation.js';
16
+
17
+ const FirstComponent = forwardRef((_ref, ref) => {
18
+ let {
19
+ children,
20
+ ...other
21
+ } = _ref;
22
+ return React__default.createElement(StyledCursor, Object.assign({
23
+ ref: ref
24
+ }, other), React__default.createElement(StyledIcon, {
25
+ type: "first"
26
+ }, React__default.createElement(SvgChevronDoubleLeftStroke, null)), React__default.createElement("span", null, children));
27
+ });
28
+ FirstComponent.displayName = 'CursorPagination.First';
29
+ const First = FirstComponent;
30
+
31
+ export { First };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import SvgChevronDoubleRightStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-right-stroke.svg.js';
9
+ import '../../../styled/Pagination/StyledPagination.js';
10
+ import '../../../styled/Pagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
13
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
14
+ import '../../../styled/Pagination/StyledGap.js';
15
+ import '../../../styled/Pagination/StyledNavigation.js';
16
+
17
+ const LastComponent = forwardRef((_ref, ref) => {
18
+ let {
19
+ children,
20
+ ...other
21
+ } = _ref;
22
+ return React__default.createElement(StyledCursor, Object.assign({
23
+ ref: ref,
24
+ as: "button"
25
+ }, other), React__default.createElement("span", null, children), React__default.createElement(StyledIcon, {
26
+ type: "last"
27
+ }, React__default.createElement(SvgChevronDoubleRightStroke, null)));
28
+ });
29
+ LastComponent.displayName = 'CursorPagination.Last';
30
+ const Last = LastComponent;
31
+
32
+ export { Last };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import SvgChevronRightStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js';
9
+ import '../../../styled/Pagination/StyledPagination.js';
10
+ import '../../../styled/Pagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
13
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
14
+ import '../../../styled/Pagination/StyledGap.js';
15
+ import '../../../styled/Pagination/StyledNavigation.js';
16
+
17
+ const NextComponent = forwardRef((_ref, ref) => {
18
+ let {
19
+ children,
20
+ ...other
21
+ } = _ref;
22
+ return React__default.createElement(StyledCursor, Object.assign({
23
+ ref: ref,
24
+ as: "button"
25
+ }, other), React__default.createElement("span", null, children), React__default.createElement(StyledIcon, {
26
+ type: "next"
27
+ }, React__default.createElement(SvgChevronRightStroke, null)));
28
+ });
29
+ NextComponent.displayName = 'CursorPagination.Next';
30
+ const Next = NextComponent;
31
+
32
+ export { Next };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import SvgChevronLeftStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js';
9
+ import '../../../styled/Pagination/StyledPagination.js';
10
+ import '../../../styled/Pagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
13
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
14
+ import '../../../styled/Pagination/StyledGap.js';
15
+ import '../../../styled/Pagination/StyledNavigation.js';
16
+
17
+ const PreviousComponent = forwardRef((_ref, ref) => {
18
+ let {
19
+ children,
20
+ ...other
21
+ } = _ref;
22
+ return React__default.createElement(StyledCursor, Object.assign({
23
+ ref: ref,
24
+ as: "button"
25
+ }, other), React__default.createElement(StyledIcon, {
26
+ type: "previous"
27
+ }, React__default.createElement(SvgChevronLeftStroke, null)), React__default.createElement("span", null, children));
28
+ });
29
+ PreviousComponent.displayName = 'CursorPagination.Previous';
30
+ const Previous = PreviousComponent;
31
+
32
+ export { Previous };
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef, useState, useContext } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ import { ThemeContext } from 'styled-components';
10
+ import { usePagination } from '@zendeskgarden/container-pagination';
11
+ import { getControlledValue } from '@zendeskgarden/container-utilities';
12
+ import { StyledPagination } from '../../styled/Pagination/StyledPagination.js';
13
+ import '../../styled/Pagination/StyledPage.js';
14
+ import '../../styled/CursorPagination/StyledCursorPagination.js';
15
+ import '../../styled/CursorPagination/StyledCursor.js';
16
+ import '../../styled/CursorPagination/StyledIcon.js';
17
+ import '../../styled/Pagination/StyledGap.js';
18
+ import '../../styled/Pagination/StyledNavigation.js';
19
+ import { Previous } from './components/Previous.js';
20
+ import { Next } from './components/Next.js';
21
+ import { Page } from './components/Page.js';
22
+ import { Gap } from './components/Gap.js';
23
+
24
+ const PREVIOUS_KEY = 'previous';
25
+ const NEXT_KEY = 'next';
26
+ const Pagination = forwardRef((_ref, ref) => {
27
+ let {
28
+ currentPage: controlledCurrentPage,
29
+ transformPageProps,
30
+ totalPages,
31
+ pagePadding,
32
+ pageGap,
33
+ onChange,
34
+ ...otherProps
35
+ } = _ref;
36
+ const [focusedItem, setFocusedItem] = useState();
37
+ const [internalCurrentPage, setInternalCurrentPage] = useState(1);
38
+ const currentPage = getControlledValue(controlledCurrentPage, internalCurrentPage);
39
+ const theme = useContext(ThemeContext);
40
+ const {
41
+ getContainerProps,
42
+ getPageProps,
43
+ getPreviousPageProps,
44
+ getNextPageProps
45
+ } = usePagination({
46
+ rtl: theme.rtl,
47
+ focusedItem,
48
+ selectedItem: currentPage,
49
+ onFocus: item => {
50
+ setFocusedItem(item);
51
+ },
52
+ onSelect: item => {
53
+ let updatedCurrentPage = item;
54
+ let updatedFocusedKey = focusedItem;
55
+ if (updatedCurrentPage === PREVIOUS_KEY && currentPage > 1) {
56
+ updatedCurrentPage = currentPage - 1;
57
+ if (updatedCurrentPage === 1 && focusedItem === PREVIOUS_KEY) {
58
+ updatedFocusedKey = 1;
59
+ }
60
+ } else if (updatedCurrentPage === NEXT_KEY && currentPage < totalPages) {
61
+ updatedCurrentPage = currentPage + 1;
62
+ if (updatedCurrentPage === totalPages && updatedFocusedKey === NEXT_KEY) {
63
+ updatedFocusedKey = totalPages;
64
+ }
65
+ }
66
+ if (onChange && updatedCurrentPage !== undefined) {
67
+ onChange(updatedCurrentPage);
68
+ }
69
+ setFocusedItem(updatedFocusedKey);
70
+ setInternalCurrentPage(updatedCurrentPage);
71
+ }
72
+ });
73
+ const getTransformedProps = function (pageType) {
74
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
75
+ let pageNumber = arguments.length > 2 ? arguments[2] : undefined;
76
+ if (transformPageProps) {
77
+ return transformPageProps(pageType, props, pageNumber);
78
+ }
79
+ return props;
80
+ };
81
+ const renderPreviousPage = () => {
82
+ const isFirstPageSelected = totalPages > 0 && currentPage === 1;
83
+ const focusRef = React__default.createRef();
84
+ const props = isFirstPageSelected ?
85
+ {
86
+ hidden: true
87
+ } : {
88
+ ...getPreviousPageProps({
89
+ 'aria-label': '',
90
+ role: null,
91
+ item: PREVIOUS_KEY,
92
+ focusRef
93
+ }),
94
+ 'aria-label': undefined
95
+ };
96
+ return React__default.createElement(Previous, Object.assign({
97
+ isFocused: focusedItem === PREVIOUS_KEY
98
+ }, getTransformedProps('previous', props), {
99
+ ref: focusRef
100
+ }));
101
+ };
102
+ const renderNextPage = () => {
103
+ const isLastPageSelected = currentPage === totalPages;
104
+ const focusRef = React__default.createRef();
105
+ const props = isLastPageSelected ?
106
+ {
107
+ hidden: true
108
+ } : {
109
+ ...getNextPageProps({
110
+ 'aria-label': '',
111
+ role: null,
112
+ item: NEXT_KEY,
113
+ focusRef
114
+ }),
115
+ 'aria-label': undefined
116
+ };
117
+ return React__default.createElement(Next, Object.assign({
118
+ isFocused: focusedItem === NEXT_KEY
119
+ }, getTransformedProps('next', props), {
120
+ ref: focusRef
121
+ }));
122
+ };
123
+ const createGap = pageIndex => React__default.createElement(Gap, Object.assign({
124
+ key: `gap-${pageIndex}`
125
+ }, getTransformedProps('gap')));
126
+ const createPage = pageIndex => {
127
+ const focusRef = React__default.createRef();
128
+ const props = {
129
+ ...getPageProps({
130
+ 'aria-label': '',
131
+ role: null,
132
+ item: pageIndex,
133
+ focusRef
134
+ }),
135
+ 'aria-label': undefined,
136
+ title: pageIndex
137
+ };
138
+ return React__default.createElement(Page, Object.assign({
139
+ key: pageIndex
140
+ }, getTransformedProps('page', props, pageIndex), {
141
+ ref: focusRef
142
+ }), pageIndex);
143
+ };
144
+ const renderPages = () => {
145
+ const pages = [];
146
+ const PADDING = pagePadding;
147
+ const GAP = pageGap;
148
+ for (let pageIndex = 1; pageIndex <= totalPages; pageIndex++) {
149
+ if (pageIndex === currentPage || pageIndex < GAP || pageIndex > totalPages - GAP + 1) {
150
+ pages.push(createPage(pageIndex));
151
+ continue;
152
+ }
153
+ let minimum;
154
+ let maximum;
155
+ if (currentPage <= GAP + PADDING) {
156
+ minimum = GAP + 1;
157
+ maximum = minimum + PADDING * 2;
158
+ } else if (currentPage >= totalPages - GAP - PADDING) {
159
+ maximum = totalPages - GAP;
160
+ minimum = maximum - PADDING * 2;
161
+ } else {
162
+ minimum = currentPage - PADDING;
163
+ maximum = currentPage + PADDING;
164
+ }
165
+ if (pageIndex >= minimum && pageIndex <= currentPage || pageIndex >= currentPage && pageIndex <= maximum) {
166
+ pages.push(createPage(pageIndex));
167
+ continue;
168
+ }
169
+ if (pageIndex === GAP) {
170
+ if (minimum > GAP + 1 && currentPage > GAP + PADDING + 1) {
171
+ pages.push(createGap(pageIndex));
172
+ } else {
173
+ pages.push(createPage(pageIndex));
174
+ }
175
+ continue;
176
+ }
177
+ if (pageIndex === totalPages - GAP + 1) {
178
+ if (maximum < totalPages - GAP && currentPage < totalPages - GAP - PADDING) {
179
+ pages.push(createGap(pageIndex));
180
+ } else {
181
+ pages.push(createPage(pageIndex));
182
+ }
183
+ continue;
184
+ }
185
+ }
186
+ return pages;
187
+ };
188
+ return React__default.createElement(StyledPagination, Object.assign({}, getContainerProps({
189
+ role: null
190
+ }), otherProps, {
191
+ ref: ref
192
+ }), renderPreviousPage(), totalPages > 0 && renderPages(), renderNextPage());
193
+ });
194
+ Pagination.propTypes = {
195
+ currentPage: PropTypes.number.isRequired,
196
+ totalPages: PropTypes.number.isRequired,
197
+ pagePadding: PropTypes.number,
198
+ pageGap: PropTypes.number,
199
+ onChange: PropTypes.func,
200
+ transformPageProps: PropTypes.func
201
+ };
202
+ Pagination.defaultProps = {
203
+ pagePadding: 2,
204
+ pageGap: 2
205
+ };
206
+ Pagination.displayName = 'Pagination';
207
+
208
+ export { Pagination };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import '../../../styled/Pagination/StyledPagination.js';
9
+ import '../../../styled/Pagination/StyledPage.js';
10
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
11
+ import '../../../styled/CursorPagination/StyledCursor.js';
12
+ import '../../../styled/CursorPagination/StyledIcon.js';
13
+ import { StyledGap } from '../../../styled/Pagination/StyledGap.js';
14
+ import '../../../styled/Pagination/StyledNavigation.js';
15
+
16
+ const GapComponent = forwardRef((props, ref) => React__default.createElement(StyledGap, Object.assign({}, props, {
17
+ ref: ref
18
+ }), "\u2026"));
19
+ GapComponent.displayName = 'Pagination.Gap';
20
+ const Gap = GapComponent;
21
+
22
+ export { Gap };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef, useContext } from 'react';
8
+ import { ThemeContext } from 'styled-components';
9
+ import SvgChevronLeftStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js';
10
+ import SvgChevronRightStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js';
11
+ import { useText } from '@zendeskgarden/react-theming';
12
+ import '../../../styled/Pagination/StyledPagination.js';
13
+ import '../../../styled/Pagination/StyledPage.js';
14
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
15
+ import '../../../styled/CursorPagination/StyledCursor.js';
16
+ import '../../../styled/CursorPagination/StyledIcon.js';
17
+ import '../../../styled/Pagination/StyledGap.js';
18
+ import { StyledNavigation } from '../../../styled/Pagination/StyledNavigation.js';
19
+
20
+ const NextComponent = forwardRef((props, ref) => {
21
+ const ariaLabel = useText(NextComponent, props, 'aria-label', 'Next page');
22
+ const theme = useContext(ThemeContext);
23
+ return React__default.createElement(StyledNavigation, Object.assign({}, props, {
24
+ "aria-label": ariaLabel,
25
+ ref: ref
26
+ }), theme.rtl ? React__default.createElement(SvgChevronLeftStroke, null) : React__default.createElement(SvgChevronRightStroke, null));
27
+ });
28
+ NextComponent.displayName = 'Pagination.Next';
29
+ const Next = NextComponent;
30
+
31
+ export { Next };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef } from 'react';
8
+ import { useText } from '@zendeskgarden/react-theming';
9
+ import '../../../styled/Pagination/StyledPagination.js';
10
+ import { StyledPage } from '../../../styled/Pagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import '../../../styled/CursorPagination/StyledCursor.js';
13
+ import '../../../styled/CursorPagination/StyledIcon.js';
14
+ import '../../../styled/Pagination/StyledGap.js';
15
+ import '../../../styled/Pagination/StyledNavigation.js';
16
+
17
+ const PageComponent = forwardRef((props, ref) => {
18
+ const text = props['aria-current'] ? `Current page, page ${props.children}` : `Page ${props.children}`;
19
+ const ariaLabel = useText(PageComponent, props, 'aria-label', text);
20
+ return React__default.createElement(StyledPage, Object.assign({}, props, {
21
+ "aria-label": ariaLabel,
22
+ ref: ref
23
+ }));
24
+ });
25
+ PageComponent.displayName = 'Pagination.Page';
26
+ const Page = PageComponent;
27
+
28
+ export { Page };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import React__default, { forwardRef, useContext } from 'react';
8
+ import { ThemeContext } from 'styled-components';
9
+ import SvgChevronLeftStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js';
10
+ import SvgChevronRightStroke from '../../../node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js';
11
+ import { useText } from '@zendeskgarden/react-theming';
12
+ import '../../../styled/Pagination/StyledPagination.js';
13
+ import '../../../styled/Pagination/StyledPage.js';
14
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
15
+ import '../../../styled/CursorPagination/StyledCursor.js';
16
+ import '../../../styled/CursorPagination/StyledIcon.js';
17
+ import '../../../styled/Pagination/StyledGap.js';
18
+ import { StyledNavigation } from '../../../styled/Pagination/StyledNavigation.js';
19
+
20
+ const PreviousComponent = forwardRef((props, ref) => {
21
+ const ariaLabel = useText(PreviousComponent, props, 'aria-label', 'Previous page');
22
+ const theme = useContext(ThemeContext);
23
+ return React__default.createElement(StyledNavigation, Object.assign({}, props, {
24
+ "aria-label": ariaLabel,
25
+ ref: ref
26
+ }), theme.rtl ? React__default.createElement(SvgChevronRightStroke, null) : React__default.createElement(SvgChevronLeftStroke, null));
27
+ });
28
+ PreviousComponent.displayName = 'Pagination.Previous';
29
+ const Previous = PreviousComponent;
30
+
31
+ export { Previous };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export { Pagination } from './elements/Pagination/Pagination.js';
8
+ export { CursorPagination } from './elements/CursorPagination/CursorPagination.js';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ 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); }
11
+ var SvgChevronDoubleLeftStroke = function SvgChevronDoubleLeftStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "currentColor",
21
+ 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"
22
+ })));
23
+ };
24
+
25
+ export { SvgChevronDoubleLeftStroke as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ 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); }
11
+ var SvgChevronDoubleRightStroke = function SvgChevronDoubleRightStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "currentColor",
21
+ 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"
22
+ })));
23
+ };
24
+
25
+ export { SvgChevronDoubleRightStroke as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ 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); }
11
+ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "currentColor",
21
+ 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"
22
+ })));
23
+ };
24
+
25
+ export { SvgChevronLeftStroke as default };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import * as React from 'react';
8
+
9
+ var _path;
10
+ 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); }
11
+ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
12
+ return /*#__PURE__*/React.createElement("svg", _extends({
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: 16,
15
+ height: 16,
16
+ focusable: "false",
17
+ viewBox: "0 0 16 16",
18
+ "aria-hidden": "true"
19
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
20
+ fill: "currentColor",
21
+ 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"
22
+ })));
23
+ };
24
+
25
+ export { SvgChevronRightStroke as default };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledPageBase } from '../Pagination/StyledPageBase.js';
10
+
11
+ const COMPONENT_ID = 'cursor_pagination.cursor';
12
+ const StyledCursor = styled(StyledPageBase).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '8.76.1',
15
+ as: 'button'
16
+ }).withConfig({
17
+ displayName: "StyledCursor",
18
+ componentId: "sc-507ee-0"
19
+ })(["display:flex;align-items:center;border:none;background:transparent;padding:", ";overflow:visible;&:not(", "-of-type){margin-right:", "px;}", ";"], props => `0px ${props.theme.space.base * 2}px`, props => props.theme.rtl ? ':first' : ':last', props => props.theme.space.base, props => retrieveComponentStyles(COMPONENT_ID, props));
20
+ StyledCursor.defaultProps = {
21
+ theme: DEFAULT_THEME
22
+ };
23
+
24
+ export { StyledCursor };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'cursor_pagination';
11
+ const StyledCursorPagination = styled.nav.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '8.76.1'
14
+ }).withConfig({
15
+ displayName: "StyledCursorPagination",
16
+ componentId: "sc-qmfecg-0"
17
+ })(["display:flex;justify-content:center;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledCursorPagination.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledCursorPagination };