Skip to content

Commit

Permalink
refactor(components): update parameter table stories (#14815)
Browse files Browse the repository at this point in the history
* refactor(components): update parameter table stories
  • Loading branch information
koji authored and Carlos-fernandez committed May 20, 2024
1 parent e2aa482 commit 10ed99d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
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,
decorators: [
Story => (
<Flex padding={SPACING.spacing16}>
<Story />
</Flex>
),
],
}
export default meta

type Story = StoryObj<typeof ParametersTable>

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

0 comments on commit 10ed99d

Please sign in to comment.