@zendeskgarden/react-pagination 9.0.0-next.2 → 9.0.0-next.21

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 (32) 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 +41 -0
  20. package/dist/esm/styled/OffsetPagination/StyledList.js +31 -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 +93 -0
  26. package/dist/index.cjs.js +117 -72
  27. package/dist/typings/elements/CursorPagination/CursorPagination.d.ts +0 -1
  28. package/dist/typings/index.d.ts +1 -1
  29. package/dist/typings/styled/CursorPagination/StyledIcon.d.ts +2 -2
  30. package/dist/typings/styled/OffsetPagination/StyledList.d.ts +2 -1
  31. package/package.json +8 -8
  32. package/dist/index.esm.js +0 -518
@@ -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 styled, { css } from 'styled-components';
8
+ import { StyledBaseIcon, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const marginStyles = props => {
11
+ const {
12
+ $type,
13
+ theme
14
+ } = props;
15
+ const margin = theme.space.base;
16
+ if (theme.rtl) {
17
+ return css(["margin-", ":", "px;"], $type === 'last' || $type === 'next' ? 'right' : 'left', margin);
18
+ }
19
+ return css(["margin-", ":", "px;"], $type === 'first' || $type === 'previous' ? 'right' : 'left', margin);
20
+ };
21
+ const StyledIcon = styled(StyledBaseIcon).withConfig({
22
+ displayName: "StyledIcon",
23
+ componentId: "sc-2vzk6e-0"
24
+ })(["", " transform:", ";"], marginStyles, props => props.theme.rtl && 'rotate(180deg)');
25
+ StyledIcon.defaultProps = {
26
+ theme: DEFAULT_THEME
27
+ };
28
+
29
+ export { StyledIcon };
@@ -0,0 +1,41 @@
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, { css } from 'styled-components';
8
+ import { math } from 'polished';
9
+ import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor } from '@zendeskgarden/react-theming';
10
+ import { StyledListItem } from './StyledListItem.js';
11
+
12
+ const COMPONENT_ID = 'pagination.gap';
13
+ const sizeStyles = props => {
14
+ const shift = 2;
15
+ const fontSize = math(`${props.theme.fontSizes.md} + ${shift}`);
16
+ const height = `${props.theme.space.base * 8}px`;
17
+ const lineHeight = getLineHeight(height, fontSize);
18
+ const padding = `${props.theme.space.base * 1.5}px`;
19
+ return css(["padding:0 ", ";min-width:", ";max-width:", ";height:", ";line-height:", ";font-size:", ";"], padding, height, math(`${height} * 2`), height, lineHeight, fontSize);
20
+ };
21
+ const colorStyles = _ref => {
22
+ let {
23
+ theme
24
+ } = _ref;
25
+ return css(["color:", ";"], getColor({
26
+ variable: 'foreground.subtle',
27
+ theme
28
+ }));
29
+ };
30
+ const StyledGapListItem = styled(StyledListItem).attrs({
31
+ 'data-garden-id': COMPONENT_ID,
32
+ 'data-garden-version': '9.0.0-next.21'
33
+ }).withConfig({
34
+ displayName: "StyledGapListItem",
35
+ componentId: "sc-10wd0iz-0"
36
+ })(["display:inline-block;text-align:center;", ";", " &:hover{color:inherit;}", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
37
+ StyledGapListItem.defaultProps = {
38
+ theme: DEFAULT_THEME
39
+ };
40
+
41
+ export { StyledGapListItem };
@@ -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 styled, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'pagination.list';
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme
14
+ } = _ref;
15
+ return css(["color:", ";"], getColor({
16
+ variable: 'foreground.subtle',
17
+ theme
18
+ }));
19
+ };
20
+ const StyledList = styled.ul.attrs({
21
+ 'data-garden-id': COMPONENT_ID,
22
+ 'data-garden-version': '9.0.0-next.21'
23
+ }).withConfig({
24
+ displayName: "StyledList",
25
+ componentId: "sc-1uz2jxo-0"
26
+ })(["direction:", ";display:flex;justify-content:center;margin:0;padding:0;list-style:none;white-space:nowrap;", " :focus{outline:none;}", ";"], p => p.theme.rtl && 'rtl', colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
27
+ StyledList.defaultProps = {
28
+ theme: DEFAULT_THEME
29
+ };
30
+
31
+ export { StyledList };
@@ -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 = 'pagination.list_item';
11
+ const StyledListItem = styled.li.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.21'
14
+ }).withConfig({
15
+ displayName: "StyledListItem",
16
+ componentId: "sc-16j4sju-0"
17
+ })(["box-sizing:border-box;margin-left:", ";user-select:none;&", "{margin-left:0;}", ";"], props => `${props.theme.space.base}px`, props => props.theme.rtl ? ':last-of-type' : ':first-of-type', props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledListItem.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledListItem };
@@ -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 = 'pagination.pagination_view';
11
+ const StyledNav = styled.nav.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.21'
14
+ }).withConfig({
15
+ displayName: "StyledNav",
16
+ componentId: "sc-ppnpkw-0"
17
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledNav.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ export { StyledNav };
@@ -0,0 +1,23 @@
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 { StyledPage } from './StyledPage.js';
10
+
11
+ const COMPONENT_ID = 'pagination.navigation';
12
+ const StyledNavigation = styled(StyledPage).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.0.0-next.21'
15
+ }).withConfig({
16
+ displayName: "StyledNavigation",
17
+ componentId: "sc-1lpl8pp-0"
18
+ })(["display:flex;align-items:center;justify-content:center;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
+ StyledNavigation.defaultProps = {
20
+ theme: DEFAULT_THEME
21
+ };
22
+
23
+ export { StyledNavigation };
@@ -0,0 +1,27 @@
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, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { StyledPageBase } from './StyledPageBase.js';
10
+
11
+ const COMPONENT_ID = 'pagination.page';
12
+ const sizeStyles = props => {
13
+ const height = props.theme.space.base * 8;
14
+ return css(["min-width:", "px;max-width:", "px;&[aria-current='true']{max-width:none;}"], height, height * 2);
15
+ };
16
+ const StyledPage = styled(StyledPageBase).attrs({
17
+ 'data-garden-id': COMPONENT_ID,
18
+ 'data-garden-version': '9.0.0-next.21'
19
+ }).withConfig({
20
+ displayName: "StyledPage",
21
+ componentId: "sc-sxjfwy-0"
22
+ })(["", ";&[aria-current=\"true\"]{font-weight:", ";}", ";"], props => sizeStyles(props), props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID, props));
23
+ StyledPage.defaultProps = {
24
+ theme: DEFAULT_THEME
25
+ };
26
+
27
+ export { StyledPage };
@@ -0,0 +1,93 @@
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, { css } from 'styled-components';
8
+ import { retrieveComponentStyles, DEFAULT_THEME, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'pagination.page';
11
+ const colorStyles = _ref => {
12
+ let {
13
+ theme
14
+ } = _ref;
15
+ const disabledColor = getColor({
16
+ variable: 'foreground.disabled',
17
+ theme
18
+ });
19
+ const defaultColor = getColor({
20
+ variable: 'foreground.subtle',
21
+ theme
22
+ });
23
+ const hoverForegroundColor = getColor({
24
+ variable: 'foreground.subtle',
25
+ light: {
26
+ offset: 100
27
+ },
28
+ dark: {
29
+ offset: -100
30
+ },
31
+ theme
32
+ });
33
+ const hoverBackgroundColor = getColor({
34
+ variable: 'background.primaryEmphasis',
35
+ transparency: theme.opacity[100],
36
+ dark: {
37
+ offset: -100
38
+ },
39
+ theme
40
+ });
41
+ const activeForegroundColor = getColor({
42
+ variable: 'foreground.subtle',
43
+ light: {
44
+ offset: 200
45
+ },
46
+ dark: {
47
+ offset: -200
48
+ },
49
+ theme
50
+ });
51
+ const activeBackgroundColor = getColor({
52
+ variable: 'background.primaryEmphasis',
53
+ transparency: theme.opacity[200],
54
+ dark: {
55
+ offset: -100
56
+ },
57
+ theme
58
+ });
59
+ const currentForegroundColor = activeForegroundColor;
60
+ const currentBackgroundColor = hoverBackgroundColor;
61
+ const currentHoverBackgroundColor = activeBackgroundColor;
62
+ const currentActiveBackgroundColor = getColor({
63
+ variable: 'background.primaryEmphasis',
64
+ transparency: theme.opacity[300],
65
+ dark: {
66
+ offset: -100
67
+ },
68
+ theme
69
+ });
70
+ return css(["border:none;background:transparent;color:", ";&:hover{background-color:", ";color:", ";}", " &:active,&:focus-visible:active{background-color:", ";color:", ";}&[aria-current='page']{background-color:", ";color:", ";}&[aria-current='page']:hover{background-color:", ";}&[aria-current='page']:active{background-color:", ";}:disabled,[aria-disabled='true']{background-color:transparent;color:", ";}"], defaultColor, hoverBackgroundColor, hoverForegroundColor, focusStyles({
71
+ theme,
72
+ inset: true
73
+ }), activeBackgroundColor, activeForegroundColor, currentBackgroundColor, currentForegroundColor, currentHoverBackgroundColor, currentActiveBackgroundColor, disabledColor);
74
+ };
75
+ const sizeStyles = props => {
76
+ const fontSize = props.theme.fontSizes.md;
77
+ const height = `${props.theme.space.base * 8}px`;
78
+ const lineHeight = getLineHeight(height, fontSize);
79
+ const padding = `${props.theme.space.base * 1.5}px`;
80
+ return css(["padding:0 ", ";height:", ";line-height:", ";font-size:", ";"], padding, height, lineHeight, fontSize);
81
+ };
82
+ const StyledPageBase = styled.button.attrs({
83
+ 'data-garden-id': COMPONENT_ID,
84
+ 'data-garden-version': '9.0.0-next.21'
85
+ }).withConfig({
86
+ displayName: "StyledPageBase",
87
+ componentId: "sc-ttwj4u-0"
88
+ })(["box-sizing:border-box;display:inline-block;transition:box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out;visibility:", ";border-radius:", ";cursor:pointer;overflow:hidden;text-align:center;text-overflow:ellipsis;font-family:inherit;user-select:none;", ";&[aria-current='page']{font-weight:", ";}&::-moz-focus-inner{border:0;}:disabled,[aria-disabled='true']{cursor:default;}", ";", ";"], props => props.hidden && 'hidden', props => props.theme.borderRadii.md, props => sizeStyles(props), props => props.theme.fontWeights.semibold, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
89
+ StyledPageBase.defaultProps = {
90
+ theme: DEFAULT_THEME
91
+ };
92
+
93
+ export { StyledPageBase };