Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix show code on some stories and remove button migration doc #2857

Merged
merged 1 commit into from
Sep 4, 2023
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
29 changes: 0 additions & 29 deletions packages/ui/src/__stories__/ButtonMigration/Sizes.tsx

This file was deleted.

131 changes: 0 additions & 131 deletions packages/ui/src/__stories__/ButtonMigration/Variants.tsx

This file was deleted.

48 changes: 0 additions & 48 deletions packages/ui/src/__stories__/ButtonMigration/index.stories.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { StoryFn } from '@storybook/react'
import { Banner } from '..'

export const Directions: StoryFn = () => (
export const Directions: StoryFn = args => (
<>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand All @@ -14,6 +15,7 @@ export const Directions: StoryFn = () => (
business and limit your expenses.
</Banner>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { StoryFn } from '@storybook/react'
import { Banner } from '..'

export const Sizes: StoryFn = () => (
export const Sizes: StoryFn = args => (
<>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand All @@ -14,6 +15,7 @@ export const Sizes: StoryFn = () => (
your expenses.
</Banner>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand All @@ -25,6 +27,7 @@ export const Sizes: StoryFn = () => (
your expenses.
</Banner>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand All @@ -36,6 +39,7 @@ export const Sizes: StoryFn = () => (
your expenses.
</Banner>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { StoryFn } from '@storybook/react'
import { Banner } from '..'

export const Variants: StoryFn = () => (
export const Variants: StoryFn = args => (
<>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand All @@ -14,6 +15,7 @@ export const Variants: StoryFn = () => (
business and limit your expenses.
</Banner>
<Banner
{...args}
title="Apply to Scaleway Startup programs"
buttonText="Apply now"
linkText="Learn more"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import type { StoryFn } from '@storybook/react'
import { Button, buttonVariants } from '..'
import { Stack } from '../..'

export const AsLink: StoryFn<typeof Button> = () => (
// @ts-expect-error we can't use args as it leads to a type error
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const AsLink: StoryFn<typeof Button> = args => (
<Stack alignItems="center" gap={2} direction="row">
{buttonVariants.map(variant => (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { StoryFn } from '@storybook/react'
import { Button } from '..'
import { Stack } from '../..'

export const IconPosition: StoryFn<typeof Button> = () => (
export const IconPosition: StoryFn<typeof Button> = args => (
<Stack alignItems="center" gap={2} direction="row">
<Button icon="pencil" onClick={() => {}} iconPosition="left">
<Button icon="pencil" onClick={() => {}} iconPosition="left" {...args}>
Left
</Button>
<Button icon="pencil" onClick={() => {}} iconPosition="right">
<Button icon="pencil" onClick={() => {}} iconPosition="right" {...args}>
Right
</Button>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const COLUMNS = [
})),
]

export const Showcase: StoryFn<typeof Button> = () => {
export const Showcase: StoryFn<typeof Button> = args => {
const onClick = () => {}

return (
Expand All @@ -27,6 +27,7 @@ export const Showcase: StoryFn<typeof Button> = () => {
<Table.Cell key={variant}>
<Stack direction="row" gap={2}>
<Button
{...args}
onClick={onClick}
variant={variant}
sentiment={sentiment}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { StoryFn } from '@storybook/react'
import { Button, buttonSizes } from '..'
import { Stack } from '../..'

export const Size: StoryFn<typeof Button> = () => (
export const Size: StoryFn<typeof Button> = args => (
<Stack alignItems="center" gap={2} direction="row">
{buttonSizes.map(size => (
<Button key={size} icon="pencil" onClick={() => {}} size={size}>
<Button {...args} key={size} icon="pencil" onClick={() => {}} size={size}>
{size}
</Button>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Stack } from '../../Stack'
import { Text } from '../../Text'
import { Card } from '../index'

export const AdvancedHeader: StoryFn = () => {
export const AdvancedHeader: StoryFn = args => {
const CustomHeader = (
<Stack gap={1}>
<Stack gap={1} direction="row" alignItems="center">
Expand All @@ -20,7 +20,11 @@ export const AdvancedHeader: StoryFn = () => {
</Stack>
)

return <Card header={CustomHeader}>This is the content of a Card</Card>
return (
<Card {...args} header={CustomHeader}>
This is the content of a Card
</Card>
)
}

AdvancedHeader.parameters = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Stack } from '../../Stack'
import { Text } from '../../Text'
import { Card } from '../index'

export const Disabled: StoryFn = () => (
<Card header="Disabled Card" disabled>
export const Disabled: StoryFn = args => (
<Card {...args} header="Disabled Card" disabled>
<Stack gap={1}>
<Text as="p" variant="body" disabled>
This is a disabled card children.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { Stack } from '../../Stack'
import { Text } from '../../Text'
import { Card } from '../index'

export const IsActive: StoryFn = () => {
export const IsActive: StoryFn = args => {
const [active, setActive] = useState(true)

return (
<Card header="Active Card" isActive={active}>
<Card {...args} header="Active Card" isActive={active}>
<Stack gap={6} direction="row" justifyContent="space-between">
<Text as="p" variant="body" color={active ? 'primary' : 'neutral'}>
This card is currently highlighted through isActive prop. In this
Expand Down
Loading
Loading