Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ consider additional positioning prop support on a case-by-case basis.

- `TooltipModal`: removed `popperModifiers` prop (see [note](#breaking-changes))

#### @zendeskgarden/react-pagination

- `Pagination`: renamed to `OffsetPagination`
- changed type export from `HTMLAttributes<HTMLUListElement>` to `HTMLAttributes<HTMLElement>`
- removed `transformPageProps` prop
- added `labels` prop

#### @zendeskgarden/react-theming

- Utility function `isRtl` has been removed. Use `props.theme.rtl` instead.
Expand Down
42 changes: 0 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/pagination/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm install react react-dom styled-components @zendeskgarden/react-theming

```jsx
import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Pagination } from '@zendeskgarden/react-pagination';
import { OffsetPagination } from '@zendeskgarden/react-pagination';

initialState = {
currentPage: 1
Expand All @@ -28,7 +28,7 @@ initialState = {
* Place a `ThemeProvider` at the root of your React application
*/
<ThemeProvider>
<Pagination
<OffsetPagination
totalPages={11}
currentPage={state.currentPage}
onChange={currentPage => setState({ currentPage })}
Expand Down
54 changes: 54 additions & 0 deletions packages/pagination/demo/offsetPagination.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { Meta, ArgsTable, Canvas, Story, Markdown } from '@storybook/addon-docs';
import { useArgs } from '@storybook/client-api';
import { OffsetPagination } from '@zendeskgarden/react-pagination';
import README from '../README.md';

<Meta title="Packages/Pagination/OffsetPagination" component={OffsetPagination} />

# API

<ArgsTable />

# Demo

<Canvas>
<Story
name="OffsetPagination"
args={{
currentPage: 1,
totalPages: 11,
'aria-label': 'Pagination',
gap: 'Ellipsis indicating non-visible pages',
page: 'Page',
next: 'Next page',
previous: 'Previous page'
}}
argTypes={{
gap: { table: { category: 'Label' } },
page: { table: { category: 'Label' } },
next: { table: { category: 'Label' } },
previous: { table: { category: 'Label' } }
}}
parameters={{
design: {
allowFullscreen: true,
type: 'figma',
url: 'https://www.figma.com/file/6g87L4FdKZTA3knt3Rsfdx/Garden?node-id=172%3A13037'
}
}}
>
{args => {
const labels = {
renderPage: n => `${args.page} ${n}`,
gap: args.gap,
next: args.next,
previous: args.previous
};
const updateArgs = useArgs()[1];
const handleChange = currentPage => updateArgs({ currentPage });
return <OffsetPagination {...args} labels={labels} onChange={handleChange} />;
}}
</Story>
</Canvas>

<Markdown>{README}</Markdown>
35 changes: 0 additions & 35 deletions packages/pagination/demo/pagination.stories.mdx

This file was deleted.

4 changes: 2 additions & 2 deletions packages/pagination/demo/stories/CursorPaginationStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import { Story } from '@storybook/react';
import { StoryFn } from '@storybook/react';
import { CursorPagination, IPaginationProps } from '@zendeskgarden/react-pagination';

interface IArgs extends IPaginationProps {
Expand All @@ -16,7 +16,7 @@ interface IArgs extends IPaginationProps {
last: string;
}

export const CursorPaginationStory: Story<IArgs> = ({
export const CursorPaginationStory: StoryFn<IArgs> = ({
currentPage,
totalPages,
onChange,
Expand Down
47 changes: 0 additions & 47 deletions packages/pagination/demo/stories/PaginationStory.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"sideEffects": false,
"types": "dist/typings/index.d.ts",
"dependencies": {
"@zendeskgarden/container-pagination": "^1.0.0",
"@zendeskgarden/container-utilities": "^2.0.0",
"polished": "^4.0.0",
"prop-types": "^15.5.7"
Expand Down
Loading