diff --git a/app/src/atoms/Chip/Chip.stories.tsx b/app/src/atoms/Chip/Chip.stories.tsx index c36cf187647..26cb9025911 100644 --- a/app/src/atoms/Chip/Chip.stories.tsx +++ b/app/src/atoms/Chip/Chip.stories.tsx @@ -1,10 +1,10 @@ import * as React from 'react' -import { Flex, COLORS, ICON_DATA_BY_NAME, SPACING } from '@opentrons/components' +import { Flex, COLORS, SPACING } from '@opentrons/components' import { touchScreenViewport } from '../../DesignTokens/constants' import { Chip } from '.' -import type { Story, Meta } from '@storybook/react' +import type { Meta, StoryObj } from '@storybook/react' -export default { +const meta: Meta = { title: 'ODD/Atoms/Chip', argTypes: { type: { @@ -28,7 +28,7 @@ export default { defaultValue: 'medium', }, iconName: { - options: Object.keys(ICON_DATA_BY_NAME), + options: ['connection-status', 'ot-check', 'ot-alert'], control: { type: 'select', }, @@ -37,27 +37,27 @@ export default { }, component: Chip, parameters: touchScreenViewport, -} as Meta - -interface ChipStorybookProps extends React.ComponentProps { - backgroundColor: string + decorators: [ + Story => ( + + + + ), + ], } -// Note: 59rem(944px) is the size of ODD -const Template: Story = ({ ...args }) => ( - - - -) +export default meta +type Story = StoryObj -export const ChipComponent = Template.bind({}) -ChipComponent.args = { - type: 'basic', - text: 'Chip component', - hasIcon: true, - chipSize: 'medium', +export const ChipComponent: Story = { + args: { + type: 'basic', + text: 'Chip component', + hasIcon: true, + chipSize: 'medium', + }, } diff --git a/app/src/atoms/Chip/__tests__/Chip.test.tsx b/app/src/atoms/Chip/__tests__/Chip.test.tsx index 194714b13ae..7f3b75f13c3 100644 --- a/app/src/atoms/Chip/__tests__/Chip.test.tsx +++ b/app/src/atoms/Chip/__tests__/Chip.test.tsx @@ -217,9 +217,7 @@ describe('Chip', () => { } render(props) const chip = screen.getByTestId('Chip_info') - expect(chip).toHaveStyle( - `padding: ${SPACING.spacing4} ${SPACING.spacing10}` - ) + expect(chip).toHaveStyle(`padding: ${SPACING.spacing4} ${SPACING.spacing8}`) const icon = screen.getByLabelText('icon_mockInfo') expect(icon).toHaveStyle(`width: 1.25rem`) }) diff --git a/app/src/atoms/Chip/index.tsx b/app/src/atoms/Chip/index.tsx index cf291572c76..06d26cf21c7 100644 --- a/app/src/atoms/Chip/index.tsx +++ b/app/src/atoms/Chip/index.tsx @@ -109,7 +109,7 @@ export function Chip(props: ChipProps): JSX.Element { ` const TOUCHSCREEN_SMALL_CONTAINER_STYLE = css` - padding: ${SPACING.spacing4} ${background === false ? 0 : SPACING.spacing10}; + padding: ${SPACING.spacing4} ${background === false ? 0 : SPACING.spacing8}; grid-gap: ${SPACING.spacing4}; `