Skip to content

Commit

Permalink
change alert and actions to tsx instead of mdx (#284)
Browse files Browse the repository at this point in the history
* change alert and actions to tsx instead of mdx

* lint fix
  • Loading branch information
mollpo authored Sep 22, 2023
1 parent 8a33872 commit 98b1801
Show file tree
Hide file tree
Showing 6 changed files with 413 additions and 308 deletions.
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

0 comments on commit 98b1801

Please sign in to comment.