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

change alert and actions to tsx instead of mdx #284

Merged
merged 2 commits into from
Sep 22, 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
64 changes: 0 additions & 64 deletions src/components/action/Actions.stories.mdx

This file was deleted.

70 changes: 70 additions & 0 deletions src/components/action/Actions.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import {
Controls,
Markdown,
Primary,
Stories,
Subheading,
Title,
} from '@storybook/addon-docs'
import { Meta, StoryObj } from '@storybook/react'
import { Button, ButtonVariant } from '../button'
import { Tone } from '../types'
import { Theme } from '../../../.storybook/components'
import { Actions } from './Actions'

const children = {
options: ['One button', 'Two buttons'],
mapping: {
'One button': <Button>Save</Button>,
'Two buttons': (
<>
<Button tone={Tone.Success}>Save</Button>
<Button variant={ButtonVariant.Ghost} tone={Tone.Neutral}>
Cancel
</Button>
</>
),
},
control: { type: 'select' },
}

const meta = {
component: Actions,
title: 'Components/Actions/Actions',
args: {
children: children.mapping['One button'],
},
argTypes: {
children,
},
parameters: {
docs: {
page: () => (
<>
<Title />
<Markdown>
The `Actions` component positions children in a flex container. It
makes sure that there is space between each item and that they stack
on mobile. This is very handy in a content area or a dialog, where
you have two buttons next to each other.
</Markdown>
<Primary />
<Subheading>Props</Subheading>
<Controls />
<Theme component="action" />
<Stories />
</>
),
},
},
} satisfies Meta<typeof Actions>

export default meta
type Story = StoryObj<typeof Actions>

export const Default: Story = {}
export const MultipleChildren: Story = {
args: {
children: { ...children.mapping['Two buttons'] },
},
}
2 changes: 1 addition & 1 deletion src/components/action/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type ActionsProps = ClassNameProps & {
**/
position?: ActionsPosition
/**
* Defineds the children to be rendered.
* Defines the children to be rendered.
*/
children?: ReactNode
}
Expand Down
243 changes: 0 additions & 243 deletions src/components/alert/Alert.stories.mdx

This file was deleted.

Loading