-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add transparent variant to section footer with pagination (#300)
* add transparent variant to section footer with pagination * add section footer types to index
- Loading branch information
Showing
12 changed files
with
216 additions
and
120 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
src/components/section/SectionFooter/SectionFooterArea.stories.mdx
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/components/section/SectionFooter/SectionFooterArea.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import { | ||
Controls, | ||
Primary, | ||
Stories, | ||
Subheading, | ||
Title, | ||
Description, | ||
} from '@storybook/addon-docs' | ||
import { Theme } from '../../../../.storybook/components' | ||
import { SectionFooterArea } from '../index' | ||
import { SectionFooterVariant } from './types' | ||
|
||
const meta = { | ||
component: SectionFooterArea, | ||
parameters: { | ||
docs: { | ||
page: () => ( | ||
<> | ||
<Title /> | ||
<Description /> | ||
<Primary /> | ||
<Subheading>Props</Subheading> | ||
<Controls /> | ||
<Theme component="section" items={['footerArea']} /> | ||
<Stories /> | ||
</> | ||
), | ||
}, | ||
}, | ||
} satisfies Meta<typeof SectionFooterArea> | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = {} | ||
|
||
export const VariantTransparent: Story = { | ||
args: { | ||
variant: SectionFooterVariant.Transparent, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...omponents/section/SectionFooter/SectionFooterWithPaginationInMemory.stories.mdx
This file was deleted.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
src/components/section/SectionFooter/SectionFooterWithPaginationInMemory.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import { | ||
Controls, | ||
Primary, | ||
Stories, | ||
Subheading, | ||
Title, | ||
Description, | ||
} from '@storybook/addon-docs' | ||
import { IndexType } from '@aboutbits/pagination' | ||
import { useState } from 'react' | ||
import { SectionFooterVariant } from './types' | ||
import { | ||
SectionFooterWithPaginationInMemory, | ||
SectionFooterWithPaginationInMemoryProps, | ||
} from './SectionFooterWithPaginationInMemory' | ||
|
||
const Template = (args: SectionFooterWithPaginationInMemoryProps) => { | ||
const [page, setPage] = useState(args.page) | ||
return ( | ||
<SectionFooterWithPaginationInMemory | ||
{...args} | ||
page={page} | ||
onChangePage={setPage} | ||
/> | ||
) | ||
} | ||
|
||
const meta = { | ||
component: SectionFooterWithPaginationInMemory, | ||
parameters: { | ||
docs: { | ||
page: () => ( | ||
<> | ||
<Title /> | ||
<Description /> | ||
<Primary /> | ||
<Subheading>Props</Subheading> | ||
<Controls /> | ||
<Stories /> | ||
</> | ||
), | ||
}, | ||
}, | ||
render: (args) => <Template {...args} />, | ||
} satisfies Meta<typeof SectionFooterWithPaginationInMemory> | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = { | ||
args: { | ||
page: 0, | ||
size: 10, | ||
total: 60, | ||
config: { indexType: IndexType.ZERO_BASED }, | ||
}, | ||
} | ||
|
||
export const VariantTransparent: Story = { | ||
args: { | ||
...Default.args, | ||
variant: SectionFooterVariant.Transparent, | ||
}, | ||
} |
17 changes: 13 additions & 4 deletions
17
src/components/section/SectionFooter/SectionFooterWithPaginationInMemory.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
src/components/section/SectionFooter/SectionFooterWithPaginationRouter.stories.mdx
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
src/components/section/SectionFooter/SectionFooterWithPaginationRouter.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import { | ||
Controls, | ||
Primary, | ||
Stories, | ||
Subheading, | ||
Title, | ||
Description, | ||
} from '@storybook/addon-docs' | ||
import { IndexType } from '@aboutbits/pagination' | ||
import { SectionFooterWithPaginationRouter } from './SectionFooterWithPaginationRouter' | ||
import { SectionFooterVariant } from './types' | ||
|
||
const meta = { | ||
component: SectionFooterWithPaginationRouter, | ||
parameters: { | ||
docs: { | ||
page: () => ( | ||
<> | ||
<Title /> | ||
<Description /> | ||
<Primary /> | ||
<Subheading>Props</Subheading> | ||
<Controls /> | ||
<Stories /> | ||
</> | ||
), | ||
}, | ||
}, | ||
render: (args) => { | ||
const currentParams = new URLSearchParams(window.parent.location.search) | ||
const pageParam = currentParams.get('page') | ||
const currentPage = pageParam ? parseInt(pageParam) : 0 | ||
return <SectionFooterWithPaginationRouter {...args} page={currentPage} /> | ||
}, | ||
} satisfies Meta<typeof SectionFooterWithPaginationRouter> | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = { | ||
args: { | ||
page: 0, | ||
size: 10, | ||
total: 60, | ||
config: { indexType: IndexType.ZERO_BASED }, | ||
}, | ||
} | ||
|
||
export const VariantTransparent: Story = { | ||
args: { | ||
...Default.args, | ||
variant: SectionFooterVariant.Transparent, | ||
}, | ||
} |
17 changes: 13 additions & 4 deletions
17
src/components/section/SectionFooter/SectionFooterWithPaginationRouter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum SectionFooterVariant { | ||
Solid = 'SOLID', | ||
Transparent = 'TRANSPARENT', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.