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

refactor(components): update parameter table stories #14815

Merged
merged 4 commits into from
Apr 8, 2024
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
6 changes: 1 addition & 5 deletions components/src/atoms/Chip/Chip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,23 @@ const meta: Meta<typeof Chip> = {
control: {
type: 'select',
},
defaultValue: 'basic',
},
hasIcon: {
control: {
type: 'boolean',
},
defaultValue: true,
},
chipSize: {
options: ['medium', 'small'],
control: {
type: 'select',
},
defaultValue: 'medium',
},
iconName: {
options: ['connection-status', 'ot-check', 'ot-alert'],
control: {
type: 'select',
},
defaultValue: 'ot-alert',
},
},
component: Chip,
Expand All @@ -57,7 +53,7 @@ type Story = StoryObj<typeof Chip>

export const ChipComponent: Story = {
args: {
type: 'basic',
type: 'success',
text: 'Chip component',
hasIcon: true,
chipSize: 'medium',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import * as React from 'react'
import { ParametersTable } from '@opentrons/components'
import type { Story, Meta } from '@storybook/react'
import type { RunTimeParameter } from '@opentrons/shared-data'

export default {
title: 'Library/Molecules/ParametersTable',
} as Meta
import * as React from 'react-remove-scroll'
import { Flex } from '../../primitives'
import { SPACING } from '../../ui-style-constants'
import { ParametersTable } from './index'

const Template: Story<React.ComponentProps<typeof ParametersTable>> = args => (
<ParametersTable {...args} />
)
import type { Meta, StoryObj } from '@storybook/react'
import type { RunTimeParameter } from '@opentrons/shared-data'

const runTimeParameters: RunTimeParameter[] = [
{
Expand Down Expand Up @@ -153,7 +148,24 @@ const runTimeParameters: RunTimeParameter[] = [
default: 'flex',
},
]
export const Default = Template.bind({})
Default.args = {
runTimeParameters: runTimeParameters,

const meta: Meta<typeof ParametersTable> = {
title: 'Library/Molecules/ParametersTable',
component: ParametersTable,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for updating this story!

decorators: [
Story => (
<Flex padding={SPACING.spacing16}>
<Story />
</Flex>
),
],
}
export default meta

type Story = StoryObj<typeof ParametersTable>

export const DefaultParameterTable: Story = {
args: {
runTimeParameters: runTimeParameters,
},
}
Loading