@zendeskgarden/react-pagination 9.0.0-next.0 → 9.0.0-next.10

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 (45) hide show
  1. package/README.md +2 -2
  2. package/dist/esm/elements/CursorPagination/CursorPagination.js +32 -0
  3. package/dist/esm/elements/CursorPagination/components/First.js +33 -0
  4. package/dist/esm/elements/CursorPagination/components/Last.js +34 -0
  5. package/dist/esm/elements/CursorPagination/components/Next.js +34 -0
  6. package/dist/esm/elements/CursorPagination/components/Previous.js +34 -0
  7. package/dist/esm/elements/OffsetPagination/OffsetPagination.js +163 -0
  8. package/dist/esm/elements/OffsetPagination/components/Gap.js +29 -0
  9. package/dist/esm/elements/OffsetPagination/components/Next.js +35 -0
  10. package/dist/esm/elements/OffsetPagination/components/Page.js +31 -0
  11. package/dist/esm/elements/OffsetPagination/components/Previous.js +35 -0
  12. package/dist/esm/index.js +8 -0
  13. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-left-stroke.svg.js +25 -0
  14. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-double-right-stroke.svg.js +25 -0
  15. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-left-stroke.svg.js +25 -0
  16. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-right-stroke.svg.js +25 -0
  17. package/dist/esm/styled/CursorPagination/StyledCursor.js +24 -0
  18. package/dist/esm/styled/CursorPagination/StyledCursorPagination.js +22 -0
  19. package/dist/esm/styled/CursorPagination/StyledIcon.js +29 -0
  20. package/dist/esm/styled/OffsetPagination/StyledGapListItem.js +32 -0
  21. package/dist/esm/styled/OffsetPagination/StyledList.js +22 -0
  22. package/dist/esm/styled/OffsetPagination/StyledListItem.js +22 -0
  23. package/dist/esm/styled/OffsetPagination/StyledNav.js +22 -0
  24. package/dist/esm/styled/OffsetPagination/StyledNavigation.js +23 -0
  25. package/dist/esm/styled/OffsetPagination/StyledPage.js +27 -0
  26. package/dist/esm/styled/OffsetPagination/StyledPageBase.js +44 -0
  27. package/dist/index.cjs.js +169 -203
  28. package/dist/typings/elements/{Pagination/Pagination.d.ts → OffsetPagination/OffsetPagination.d.ts} +1 -1
  29. package/dist/typings/elements/{Pagination → OffsetPagination}/components/Next.d.ts +2 -2
  30. package/dist/typings/elements/{Pagination → OffsetPagination}/components/Page.d.ts +2 -2
  31. package/dist/typings/elements/{Pagination → OffsetPagination}/components/Previous.d.ts +2 -2
  32. package/dist/typings/index.d.ts +2 -2
  33. package/dist/typings/styled/CursorPagination/StyledIcon.d.ts +2 -2
  34. package/dist/typings/styled/{Pagination/StyledGap.d.ts → OffsetPagination/StyledGapListItem.d.ts} +1 -4
  35. package/dist/typings/styled/{Pagination/StyledPagination.d.ts → OffsetPagination/StyledList.d.ts} +1 -1
  36. package/dist/typings/styled/OffsetPagination/StyledListItem.d.ts +10 -0
  37. package/dist/typings/styled/OffsetPagination/StyledNav.d.ts +10 -0
  38. package/dist/typings/styled/{Pagination → OffsetPagination}/StyledNavigation.d.ts +1 -1
  39. package/dist/typings/styled/{Pagination → OffsetPagination}/StyledPage.d.ts +1 -1
  40. package/dist/typings/styled/{Pagination → OffsetPagination}/StyledPageBase.d.ts +5 -1
  41. package/dist/typings/styled/index.d.ts +6 -4
  42. package/dist/typings/types/index.d.ts +6 -8
  43. package/package.json +6 -7
  44. package/dist/index.esm.js +0 -530
  45. /package/dist/typings/elements/{Pagination → OffsetPagination}/components/Gap.d.ts +0 -0
@@ -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,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 styled, { css } from 'styled-components';
8
+ import { math } from 'polished';
9
+ import { getColorV8, retrieveComponentStyles, DEFAULT_THEME, getLineHeight } 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 StyledGapListItem = styled(StyledListItem).attrs({
22
+ 'data-garden-id': COMPONENT_ID,
23
+ 'data-garden-version': '9.0.0-next.10'
24
+ }).withConfig({
25
+ displayName: "StyledGapListItem",
26
+ componentId: "sc-10wd0iz-0"
27
+ })(["display:inline-block;text-align:center;color:", ";", ";&:hover{color:inherit;}", ";"], p => getColorV8('neutralHue', 600, p.theme), props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
28
+ StyledGapListItem.defaultProps = {
29
+ theme: DEFAULT_THEME
30
+ };
31
+
32
+ export { StyledGapListItem };
@@ -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 { getColorV8, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'pagination.list';
11
+ const StyledList = styled.ul.attrs({
12
+ 'data-garden-id': COMPONENT_ID,
13
+ 'data-garden-version': '9.0.0-next.10'
14
+ }).withConfig({
15
+ displayName: "StyledList",
16
+ componentId: "sc-1uz2jxo-0"
17
+ })(["direction:", ";display:flex;justify-content:center;margin:0;padding:0;list-style:none;white-space:nowrap;color:", ";:focus{outline:none;}", ";"], props => props.theme.rtl && 'rtl', props => getColorV8('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID, props));
18
+ StyledList.defaultProps = {
19
+ theme: DEFAULT_THEME
20
+ };
21
+
22
+ 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.10'
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.10'
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.10'
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.10'
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,44 @@
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, getColorV8, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
9
+
10
+ const COMPONENT_ID = 'pagination.page';
11
+ const colorStyles = props => {
12
+ const defaultColor = getColorV8('neutralHue', 600, props.theme);
13
+ const hoverForegroundColor = getColorV8('neutralHue', 700, props.theme);
14
+ const hoverBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.08);
15
+ const activeForegroundColor = getColorV8('neutralHue', 800, props.theme);
16
+ const activeBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.2);
17
+ const currentForegroundColor = activeForegroundColor;
18
+ const currentBackgroundColor = hoverBackgroundColor;
19
+ const currentHoverBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.16);
20
+ const currentActiveBackgroundColor = getColorV8('primaryHue', 600, props.theme, 0.28);
21
+ 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({
22
+ theme: props.theme,
23
+ inset: true
24
+ }), activeBackgroundColor, activeForegroundColor, currentBackgroundColor, currentForegroundColor, currentHoverBackgroundColor, currentActiveBackgroundColor, getColorV8('grey', 300, props.theme));
25
+ };
26
+ const sizeStyles = props => {
27
+ const fontSize = props.theme.fontSizes.md;
28
+ const height = `${props.theme.space.base * 8}px`;
29
+ const lineHeight = getLineHeight(height, fontSize);
30
+ const padding = `${props.theme.space.base * 1.5}px`;
31
+ return css(["padding:0 ", ";height:", ";line-height:", ";font-size:", ";"], padding, height, lineHeight, fontSize);
32
+ };
33
+ const StyledPageBase = styled.button.attrs({
34
+ 'data-garden-id': COMPONENT_ID,
35
+ 'data-garden-version': '9.0.0-next.10'
36
+ }).withConfig({
37
+ displayName: "StyledPageBase",
38
+ componentId: "sc-ttwj4u-0"
39
+ })(["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));
40
+ StyledPageBase.defaultProps = {
41
+ theme: DEFAULT_THEME
42
+ };
43
+
44
+ export { StyledPageBase };