aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/pagination.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-24 18:48:57 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:15:24 +0100
commit3f8ae3f558446aba3870e90c899db25ad9321499 (patch)
tree30824d02705337309d9223f8c5a6bd8fc41d482c /src/components/molecules/nav/pagination.stories.tsx
parent98044be08600daf6bd7c7e1a4adada319dbcbbaf (diff)
refactor(components): rewrite Pagination component
Diffstat (limited to 'src/components/molecules/nav/pagination.stories.tsx')
-rw-r--r--src/components/molecules/nav/pagination.stories.tsx171
1 files changed, 0 insertions, 171 deletions
diff --git a/src/components/molecules/nav/pagination.stories.tsx b/src/components/molecules/nav/pagination.stories.tsx
deleted file mode 100644
index 678c574..0000000
--- a/src/components/molecules/nav/pagination.stories.tsx
+++ /dev/null
@@ -1,171 +0,0 @@
-import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Pagination } from './pagination';
-
-/**
- * Pagination - Storybook Meta
- */
-export default {
- title: 'Molecules/Navigation/Pagination',
- component: Pagination,
- args: {
- baseUrl: '/page/',
- siblings: 1,
- },
- argTypes: {
- 'aria-label': {
- control: {
- type: 'text',
- },
- description: 'An accessible name for the pagination.',
- table: {
- category: 'Accessibility',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- baseUrl: {
- control: {
- type: 'text',
- },
- description: 'The url prefix.',
- table: {
- category: 'Options',
- defaultValue: { summary: '/page/' },
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- className: {
- control: {
- type: 'text',
- },
- description: 'Set additional classnames to the pagination wrapper.',
- table: {
- category: 'Styles',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- current: {
- control: {
- type: 'number',
- },
- description: 'The current page number.',
- type: {
- name: 'number',
- required: true,
- },
- },
- perPage: {
- control: {
- type: 'number',
- },
- description: 'The number of items per page.',
- type: {
- name: 'number',
- required: true,
- },
- },
- siblings: {
- control: {
- type: 'number',
- },
- description:
- 'The number of pages to show next to the current page for one side.',
- table: {
- category: 'Options',
- defaultValue: { summary: 1 },
- },
- type: {
- name: 'number',
- required: false,
- },
- },
- total: {
- control: {
- type: 'number',
- },
- description: 'The total number of items.',
- type: {
- name: 'number',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof Pagination>;
-
-const Template: ComponentStory<typeof Pagination> = (args) => (
- <Pagination {...args} />
-);
-
-/**
- * Pagination Stories - Less than 5 pages
- */
-export const WithoutDots = Template.bind({});
-WithoutDots.args = {
- current: 2,
- perPage: 10,
- siblings: 2,
- total: 50,
-};
-
-/**
- * Pagination Stories - Truncated to the right.
- */
-export const RightDots = Template.bind({});
-RightDots.args = {
- current: 2,
- perPage: 10,
- siblings: 2,
- total: 80,
-};
-
-/**
- * Pagination Stories - Truncated to the left.
- */
-export const LeftDots = Template.bind({});
-LeftDots.args = {
- current: 7,
- perPage: 10,
- siblings: 2,
- total: 80,
-};
-
-/**
- * Pagination Stories - Truncated both sides.
- */
-export const LeftAndRightDots = Template.bind({});
-LeftAndRightDots.args = {
- current: 6,
- perPage: 10,
- siblings: 2,
- total: 150,
-};
-
-/**
- * Pagination Stories - Without previous link
- */
-export const WithoutPreviousLink = Template.bind({});
-WithoutPreviousLink.args = {
- current: 1,
- perPage: 10,
- siblings: 2,
- total: 50,
-};
-
-/**
- * Pagination Stories - Without next link
- */
-export const WithoutNextLink = Template.bind({});
-WithoutNextLink.args = {
- current: 5,
- perPage: 10,
- siblings: 2,
- total: 50,
-};