Skip to content

Commit

Permalink
Merge pull request #394 from lifeomic/csf3-s4
Browse files Browse the repository at this point in the history
Update fourth round of S- Components to Storybook CSF3
  • Loading branch information
MMFane authored Sep 1, 2023
2 parents 9578420 + bcaa29f commit 33d20d2
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 22 deletions.
21 changes: 9 additions & 12 deletions src/components/SpinButton/SpinButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import React, { useState } from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import React from 'react';
import { StoryObj, StoryFn, Meta } from '@storybook/react';

import { SpinButton } from './SpinButton';
import { Box } from '../Box';
import { TextField } from '../TextField';

export default {
title: 'Components/SpinButton',
const meta: Meta<typeof SpinButton> = {
component: SpinButton,
argTypes: {
onClick: { action: 'clicked' },
},
} as ComponentMeta<typeof SpinButton>;

const Template: ComponentStory<typeof SpinButton> = (args) => (
<SpinButton {...args}></SpinButton>
);
};
export default meta;
type Story = StoryObj<typeof SpinButton>;

export const Default = Template.bind({});
export const Default: Story = {};

export const KeyboardSupport = () => {
const [valueNow, setValueNow] = useState(0);
export const KeyboardSupport: StoryFn<typeof SpinButton> = () => {
const [valueNow, setValueNow] = React.useState(0);
return (
<Box style={{ overflow: 'auto', width: '80%' }} direction="row">
<TextField
Expand Down
71 changes: 61 additions & 10 deletions src/components/Stepper/Stepper.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,67 @@
import React from 'react';
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { StoryFn, Meta, StoryObj } from '@storybook/react';

import { Stepper } from './Stepper';
import { Step } from './Step';
import { Activity, Flag, User, Zap } from '@lifeomic/chromicons';

export default {
title: 'Components/Stepper',
const meta: Meta<typeof Stepper> = {
component: Stepper,
argTypes: {},
subcomponents: { Step },
} as ComponentMeta<typeof Stepper>;
argTypes: {
height: {
control: { type: 'number' },
},
width: {
control: { type: 'number' },
},
margin: {
control: { type: 'number' },
},
marginTop: {
control: { type: 'number' },
},
marginBottom: {
control: { type: 'number' },
},
marginLeft: {
control: { type: 'number' },
},
marginRight: {
control: { type: 'number' },
},
marginX: {
control: { type: 'number' },
},
marginY: {
control: { type: 'number' },
},
padding: {
control: { type: 'number' },
},
paddingTop: {
control: { type: 'number' },
},
paddingBottom: {
control: { type: 'number' },
},
paddingLeft: {
control: { type: 'number' },
},
paddingRight: {
control: { type: 'number' },
},
paddingX: {
control: { type: 'number' },
},
paddingY: {
control: { type: 'number' },
},
},
};
export default meta;
type Story = StoryObj<typeof Stepper>;

const Template: ComponentStory<typeof Stepper> = (args) => (
const Template: StoryFn<typeof Stepper> = (args) => (
<Stepper {...args}>
<Step icon={Zap} subTitle="950" title="Registered" />
<Step icon={Activity} subTitle="900" title="Consented" />
Expand All @@ -25,7 +74,9 @@ const Template: ComponentStory<typeof Stepper> = (args) => (
</Stepper>
);

export const Default = Template.bind({});
Default.args = {
activeStep: 1,
export const Default: Story = {
render: Template,
args: {
activeStep: 1,
},
};

0 comments on commit 33d20d2

Please sign in to comment.