@zendeskgarden/react-pagination 9.0.0-next.7 → 9.0.0-next.9

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 (29) hide show
  1. package/dist/esm/elements/CursorPagination/CursorPagination.js +32 -0
  2. package/dist/esm/elements/CursorPagination/components/First.js +33 -0
  3. package/dist/esm/elements/CursorPagination/components/Last.js +34 -0
  4. package/dist/esm/elements/CursorPagination/components/Next.js +34 -0
  5. package/dist/esm/elements/CursorPagination/components/Previous.js +34 -0
  6. package/dist/esm/elements/OffsetPagination/OffsetPagination.js +163 -0
  7. package/dist/esm/elements/OffsetPagination/components/Gap.js +29 -0
  8. package/dist/esm/elements/OffsetPagination/components/Next.js +35 -0
  9. package/dist/esm/elements/OffsetPagination/components/Page.js +31 -0
  10. package/dist/esm/elements/OffsetPagination/components/Previous.js +35 -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 +29 -0
  19. package/dist/esm/styled/OffsetPagination/StyledGapListItem.js +32 -0
  20. package/dist/esm/styled/OffsetPagination/StyledList.js +22 -0
  21. package/dist/esm/styled/OffsetPagination/StyledListItem.js +22 -0
  22. package/dist/esm/styled/OffsetPagination/StyledNav.js +22 -0
  23. package/dist/esm/styled/OffsetPagination/StyledNavigation.js +23 -0
  24. package/dist/esm/styled/OffsetPagination/StyledPage.js +27 -0
  25. package/dist/esm/styled/OffsetPagination/StyledPageBase.js +44 -0
  26. package/dist/index.cjs.js +32 -54
  27. package/dist/typings/styled/CursorPagination/StyledIcon.d.ts +2 -2
  28. package/package.json +5 -5
  29. package/dist/index.esm.js +0 -518
@@ -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 { 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/OffsetPagination/StyledList.js';
13
+ import '../../styled/OffsetPagination/StyledListItem.js';
14
+ import '../../styled/OffsetPagination/StyledPage.js';
15
+ import { StyledCursorPagination } from '../../styled/CursorPagination/StyledCursorPagination.js';
16
+ import '../../styled/CursorPagination/StyledCursor.js';
17
+ import '../../styled/CursorPagination/StyledIcon.js';
18
+ import '../../styled/OffsetPagination/StyledGapListItem.js';
19
+ import '../../styled/OffsetPagination/StyledNavigation.js';
20
+ import '../../styled/OffsetPagination/StyledNav.js';
21
+
22
+ const CursorPaginationComponent = forwardRef((props, ref) => React__default.createElement(StyledCursorPagination, Object.assign({
23
+ ref: ref
24
+ }, props)));
25
+ CursorPaginationComponent.displayName = 'CursorPagination';
26
+ const CursorPagination = CursorPaginationComponent;
27
+ CursorPagination.First = First;
28
+ CursorPagination.Next = Next;
29
+ CursorPagination.Previous = Previous;
30
+ CursorPagination.Last = Last;
31
+
32
+ export { CursorPagination, CursorPaginationComponent };
@@ -0,0 +1,33 @@
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/OffsetPagination/StyledList.js';
10
+ import '../../../styled/OffsetPagination/StyledListItem.js';
11
+ import '../../../styled/OffsetPagination/StyledPage.js';
12
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
13
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
14
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
15
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
16
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
17
+ import '../../../styled/OffsetPagination/StyledNav.js';
18
+
19
+ const FirstComponent = forwardRef((_ref, ref) => {
20
+ let {
21
+ children,
22
+ ...other
23
+ } = _ref;
24
+ return React__default.createElement(StyledCursor, Object.assign({
25
+ ref: ref
26
+ }, other), React__default.createElement(StyledIcon, {
27
+ $type: "first"
28
+ }, React__default.createElement(SvgChevronDoubleLeftStroke, null)), React__default.createElement("span", null, children));
29
+ });
30
+ FirstComponent.displayName = 'CursorPagination.First';
31
+ const First = FirstComponent;
32
+
33
+ export { First };
@@ -0,0 +1,34 @@
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/OffsetPagination/StyledList.js';
10
+ import '../../../styled/OffsetPagination/StyledListItem.js';
11
+ import '../../../styled/OffsetPagination/StyledPage.js';
12
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
13
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
14
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
15
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
16
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
17
+ import '../../../styled/OffsetPagination/StyledNav.js';
18
+
19
+ const LastComponent = forwardRef((_ref, ref) => {
20
+ let {
21
+ children,
22
+ ...other
23
+ } = _ref;
24
+ return React__default.createElement(StyledCursor, Object.assign({
25
+ ref: ref,
26
+ as: "button"
27
+ }, other), React__default.createElement("span", null, children), React__default.createElement(StyledIcon, {
28
+ $type: "last"
29
+ }, React__default.createElement(SvgChevronDoubleRightStroke, null)));
30
+ });
31
+ LastComponent.displayName = 'CursorPagination.Last';
32
+ const Last = LastComponent;
33
+
34
+ export { Last };
@@ -0,0 +1,34 @@
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/OffsetPagination/StyledList.js';
10
+ import '../../../styled/OffsetPagination/StyledListItem.js';
11
+ import '../../../styled/OffsetPagination/StyledPage.js';
12
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
13
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
14
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
15
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
16
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
17
+ import '../../../styled/OffsetPagination/StyledNav.js';
18
+
19
+ const NextComponent = forwardRef((_ref, ref) => {
20
+ let {
21
+ children,
22
+ ...other
23
+ } = _ref;
24
+ return React__default.createElement(StyledCursor, Object.assign({
25
+ ref: ref,
26
+ as: "button"
27
+ }, other), React__default.createElement("span", null, children), React__default.createElement(StyledIcon, {
28
+ $type: "next"
29
+ }, React__default.createElement(SvgChevronRightStroke, null)));
30
+ });
31
+ NextComponent.displayName = 'CursorPagination.Next';
32
+ const Next = NextComponent;
33
+
34
+ export { Next };
@@ -0,0 +1,34 @@
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/OffsetPagination/StyledList.js';
10
+ import '../../../styled/OffsetPagination/StyledListItem.js';
11
+ import '../../../styled/OffsetPagination/StyledPage.js';
12
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
13
+ import { StyledCursor } from '../../../styled/CursorPagination/StyledCursor.js';
14
+ import { StyledIcon } from '../../../styled/CursorPagination/StyledIcon.js';
15
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
16
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
17
+ import '../../../styled/OffsetPagination/StyledNav.js';
18
+
19
+ const PreviousComponent = forwardRef((_ref, ref) => {
20
+ let {
21
+ children,
22
+ ...other
23
+ } = _ref;
24
+ return React__default.createElement(StyledCursor, Object.assign({
25
+ ref: ref,
26
+ as: "button"
27
+ }, other), React__default.createElement(StyledIcon, {
28
+ $type: "previous"
29
+ }, React__default.createElement(SvgChevronLeftStroke, null)), React__default.createElement("span", null, children));
30
+ });
31
+ PreviousComponent.displayName = 'CursorPagination.Previous';
32
+ const Previous = PreviousComponent;
33
+
34
+ export { Previous };
@@ -0,0 +1,163 @@
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, useCallback } from 'react';
8
+ import PropTypes from 'prop-types';
9
+ import { getControlledValue } from '@zendeskgarden/container-utilities';
10
+ import { useText } from '@zendeskgarden/react-theming';
11
+ import { StyledList } from '../../styled/OffsetPagination/StyledList.js';
12
+ import { StyledListItem } from '../../styled/OffsetPagination/StyledListItem.js';
13
+ import '../../styled/OffsetPagination/StyledPage.js';
14
+ import '../../styled/CursorPagination/StyledCursorPagination.js';
15
+ import '../../styled/CursorPagination/StyledCursor.js';
16
+ import '../../styled/CursorPagination/StyledIcon.js';
17
+ import '../../styled/OffsetPagination/StyledGapListItem.js';
18
+ import '../../styled/OffsetPagination/StyledNavigation.js';
19
+ import { StyledNav } from '../../styled/OffsetPagination/StyledNav.js';
20
+ import { Previous } from './components/Previous.js';
21
+ import { Next } from './components/Next.js';
22
+ import { Page } from './components/Page.js';
23
+ import { Gap } from './components/Gap.js';
24
+
25
+ const PREVIOUS_KEY = 'previous';
26
+ const NEXT_KEY = 'next';
27
+ const OffsetPagination = forwardRef((_ref, ref) => {
28
+ let {
29
+ currentPage: controlledCurrentPage,
30
+ totalPages,
31
+ pagePadding,
32
+ pageGap,
33
+ onChange,
34
+ 'aria-label': ariaLabel,
35
+ labels,
36
+ ...otherProps
37
+ } = _ref;
38
+ const [focusedItem, setFocusedItem] = useState();
39
+ const [internalCurrentPage, setInternalCurrentPage] = useState(1);
40
+ const navigationLabel = useText(OffsetPagination, {
41
+ 'aria-label': ariaLabel
42
+ }, 'aria-label', 'Pagination');
43
+ const currentPage = getControlledValue(controlledCurrentPage, internalCurrentPage);
44
+ const handleFocus = useCallback(item => {
45
+ setFocusedItem(item);
46
+ }, []);
47
+ const handleSelect = useCallback(item => {
48
+ let updatedCurrentPage = item;
49
+ let updatedFocusedKey = focusedItem;
50
+ if (updatedCurrentPage === PREVIOUS_KEY && currentPage > 1) {
51
+ updatedCurrentPage = currentPage - 1;
52
+ if (updatedCurrentPage === 1 && focusedItem === PREVIOUS_KEY) {
53
+ updatedFocusedKey = 1;
54
+ }
55
+ } else if (updatedCurrentPage === NEXT_KEY && currentPage < totalPages) {
56
+ updatedCurrentPage = currentPage + 1;
57
+ if (updatedCurrentPage === totalPages && updatedFocusedKey === NEXT_KEY) {
58
+ updatedFocusedKey = totalPages;
59
+ }
60
+ }
61
+ if (onChange && updatedCurrentPage !== undefined) {
62
+ onChange(updatedCurrentPage);
63
+ }
64
+ setFocusedItem(updatedFocusedKey);
65
+ setInternalCurrentPage(updatedCurrentPage);
66
+ }, [currentPage, focusedItem, onChange, totalPages]);
67
+ const renderPreviousPage = () => {
68
+ const isFirstPageSelected = totalPages > 0 && currentPage === 1;
69
+ return React__default.createElement(StyledListItem, null, React__default.createElement(Previous, {
70
+ hidden: isFirstPageSelected,
71
+ onFocus: () => handleFocus('previous'),
72
+ onClick: () => handleSelect('previous'),
73
+ "aria-label": labels?.previous
74
+ }));
75
+ };
76
+ const renderNextPage = () => {
77
+ const isLastPageSelected = currentPage === totalPages;
78
+ return React__default.createElement(StyledListItem, null, React__default.createElement(Next, {
79
+ hidden: isLastPageSelected,
80
+ onFocus: () => handleFocus('next'),
81
+ onClick: () => handleSelect('next'),
82
+ "aria-label": labels?.next
83
+ }));
84
+ };
85
+ const createGap = pageIndex => React__default.createElement(Gap, {
86
+ key: `gap-${pageIndex}`,
87
+ "aria-label": labels?.gap
88
+ });
89
+ const createPage = pageIndex => {
90
+ return React__default.createElement(StyledListItem, {
91
+ key: pageIndex
92
+ }, React__default.createElement(Page, {
93
+ onFocus: () => handleFocus(pageIndex),
94
+ onClick: () => handleSelect(pageIndex),
95
+ "aria-current": currentPage === pageIndex ? 'page' : undefined,
96
+ "aria-label": labels?.renderPage?.(pageIndex)
97
+ }, pageIndex));
98
+ };
99
+ const renderPages = () => {
100
+ const pages = [];
101
+ const PADDING = pagePadding;
102
+ const GAP = pageGap;
103
+ for (let pageIndex = 1; pageIndex <= totalPages; pageIndex++) {
104
+ if (pageIndex === currentPage || pageIndex < GAP || pageIndex > totalPages - GAP + 1) {
105
+ pages.push(createPage(pageIndex));
106
+ continue;
107
+ }
108
+ let minimum;
109
+ let maximum;
110
+ if (currentPage <= GAP + PADDING) {
111
+ minimum = GAP + 1;
112
+ maximum = minimum + PADDING * 2;
113
+ } else if (currentPage >= totalPages - GAP - PADDING) {
114
+ maximum = totalPages - GAP;
115
+ minimum = maximum - PADDING * 2;
116
+ } else {
117
+ minimum = currentPage - PADDING;
118
+ maximum = currentPage + PADDING;
119
+ }
120
+ if (pageIndex >= minimum && pageIndex <= currentPage || pageIndex >= currentPage && pageIndex <= maximum) {
121
+ pages.push(createPage(pageIndex));
122
+ continue;
123
+ }
124
+ if (pageIndex === GAP) {
125
+ if (minimum > GAP + 1 && currentPage > GAP + PADDING + 1) {
126
+ pages.push(createGap(pageIndex));
127
+ } else {
128
+ pages.push(createPage(pageIndex));
129
+ }
130
+ continue;
131
+ }
132
+ if (pageIndex === totalPages - GAP + 1) {
133
+ if (maximum < totalPages - GAP && currentPage < totalPages - GAP - PADDING) {
134
+ pages.push(createGap(pageIndex));
135
+ } else {
136
+ pages.push(createPage(pageIndex));
137
+ }
138
+ continue;
139
+ }
140
+ }
141
+ return pages;
142
+ };
143
+ return React__default.createElement(StyledNav, {
144
+ "aria-label": navigationLabel
145
+ }, React__default.createElement(StyledList, Object.assign({}, otherProps, {
146
+ ref: ref
147
+ }), renderPreviousPage(), totalPages > 0 && renderPages(), renderNextPage()));
148
+ });
149
+ OffsetPagination.propTypes = {
150
+ currentPage: PropTypes.number.isRequired,
151
+ totalPages: PropTypes.number.isRequired,
152
+ pagePadding: PropTypes.number,
153
+ pageGap: PropTypes.number,
154
+ onChange: PropTypes.func,
155
+ labels: PropTypes.any
156
+ };
157
+ OffsetPagination.defaultProps = {
158
+ pagePadding: 2,
159
+ pageGap: 2
160
+ };
161
+ OffsetPagination.displayName = 'OffsetPagination';
162
+
163
+ export { OffsetPagination };
@@ -0,0 +1,29 @@
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/OffsetPagination/StyledList.js';
9
+ import '../../../styled/OffsetPagination/StyledListItem.js';
10
+ import '../../../styled/OffsetPagination/StyledPage.js';
11
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
12
+ import '../../../styled/CursorPagination/StyledCursor.js';
13
+ import '../../../styled/CursorPagination/StyledIcon.js';
14
+ import { StyledGapListItem } from '../../../styled/OffsetPagination/StyledGapListItem.js';
15
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
16
+ import '../../../styled/OffsetPagination/StyledNav.js';
17
+ import { useText } from '@zendeskgarden/react-theming';
18
+
19
+ const GapComponent = forwardRef((props, ref) => {
20
+ const ariaLabel = useText(GapComponent, props, 'aria-label', 'Ellipsis indicating non-visible pages');
21
+ return React__default.createElement(StyledGapListItem, Object.assign({}, props, {
22
+ "aria-label": ariaLabel,
23
+ ref: ref
24
+ }), "\u2026");
25
+ });
26
+ GapComponent.displayName = 'Pagination.Gap';
27
+ const Gap = GapComponent;
28
+
29
+ export { Gap };
@@ -0,0 +1,35 @@
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/OffsetPagination/StyledList.js';
13
+ import '../../../styled/OffsetPagination/StyledListItem.js';
14
+ import '../../../styled/OffsetPagination/StyledPage.js';
15
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
16
+ import '../../../styled/CursorPagination/StyledCursor.js';
17
+ import '../../../styled/CursorPagination/StyledIcon.js';
18
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
19
+ import { StyledNavigation } from '../../../styled/OffsetPagination/StyledNavigation.js';
20
+ import '../../../styled/OffsetPagination/StyledNav.js';
21
+
22
+ const NextComponent = forwardRef((props, ref) => {
23
+ const ariaLabel = useText(NextComponent, props, 'aria-label', 'Next page');
24
+ const theme = useContext(ThemeContext);
25
+ return React__default.createElement(StyledNavigation, Object.assign({
26
+ type: "button"
27
+ }, props, {
28
+ "aria-label": ariaLabel,
29
+ ref: ref
30
+ }), theme.rtl ? React__default.createElement(SvgChevronLeftStroke, null) : React__default.createElement(SvgChevronRightStroke, null));
31
+ });
32
+ NextComponent.displayName = 'Pagination.Next';
33
+ const Next = NextComponent;
34
+
35
+ export { Next };
@@ -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 { useText } from '@zendeskgarden/react-theming';
9
+ import '../../../styled/OffsetPagination/StyledList.js';
10
+ import '../../../styled/OffsetPagination/StyledListItem.js';
11
+ import { StyledPage } from '../../../styled/OffsetPagination/StyledPage.js';
12
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
13
+ import '../../../styled/CursorPagination/StyledCursor.js';
14
+ import '../../../styled/CursorPagination/StyledIcon.js';
15
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
16
+ import '../../../styled/OffsetPagination/StyledNavigation.js';
17
+ import '../../../styled/OffsetPagination/StyledNav.js';
18
+
19
+ const PageComponent = forwardRef((props, ref) => {
20
+ const ariaLabel = useText(PageComponent, props, 'aria-label', `Page ${props.children}`);
21
+ return React__default.createElement(StyledPage, Object.assign({
22
+ type: "button"
23
+ }, props, {
24
+ "aria-label": ariaLabel,
25
+ ref: ref
26
+ }));
27
+ });
28
+ PageComponent.displayName = 'Pagination.Page';
29
+ const Page = PageComponent;
30
+
31
+ export { Page };
@@ -0,0 +1,35 @@
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/OffsetPagination/StyledList.js';
13
+ import '../../../styled/OffsetPagination/StyledListItem.js';
14
+ import '../../../styled/OffsetPagination/StyledPage.js';
15
+ import '../../../styled/CursorPagination/StyledCursorPagination.js';
16
+ import '../../../styled/CursorPagination/StyledCursor.js';
17
+ import '../../../styled/CursorPagination/StyledIcon.js';
18
+ import '../../../styled/OffsetPagination/StyledGapListItem.js';
19
+ import { StyledNavigation } from '../../../styled/OffsetPagination/StyledNavigation.js';
20
+ import '../../../styled/OffsetPagination/StyledNav.js';
21
+
22
+ const PreviousComponent = forwardRef((props, ref) => {
23
+ const ariaLabel = useText(PreviousComponent, props, 'aria-label', 'Previous page');
24
+ const theme = useContext(ThemeContext);
25
+ return React__default.createElement(StyledNavigation, Object.assign({
26
+ type: "button"
27
+ }, props, {
28
+ "aria-label": ariaLabel,
29
+ ref: ref
30
+ }), theme.rtl ? React__default.createElement(SvgChevronRightStroke, null) : React__default.createElement(SvgChevronLeftStroke, null));
31
+ });
32
+ PreviousComponent.displayName = 'Pagination.Previous';
33
+ const Previous = PreviousComponent;
34
+
35
+ 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 { OffsetPagination } from './elements/OffsetPagination/OffsetPagination.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 '../OffsetPagination/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': '9.0.0-next.9',
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': '9.0.0-next.9'
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 };