Skip to content

Commit

Permalink
stories: checkbox story to verify no margin without label
Browse files Browse the repository at this point in the history
  • Loading branch information
evad1n committed May 23, 2024
1 parent ff18856 commit ef7f3c1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/components/checkbox/__stories__/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useState } from 'react';
import type { Meta, StoryFn, StoryObj } from '@storybook/react';

import { type CheckboxProps, Checkbox } from 'src/components/checkbox/Checkbox';
import { Flex } from 'src/components/flex/Flex';
import { Text } from 'src/components/text/Text';
import { Default } from 'src/icons/flags/Default';

import styles from './Checkbox.stories.module.scss';
Expand All @@ -13,11 +15,14 @@ const Template: StoryFn<CheckboxProps> = ({
}: CheckboxProps) => {
const [isChecked, setIsChecked] = useState(checked);
return (
<Checkbox
{...props}
checked={isChecked}
onChange={() => setIsChecked(!isChecked)}
/>
<Flex>
<Checkbox
{...props}
checked={isChecked}
onChange={() => setIsChecked(!isChecked)}
/>
<Text>Some text</Text>
</Flex>
);
};

Expand All @@ -33,7 +38,6 @@ const CheckboxMeta: Meta<CheckboxProps> = {
};

export default CheckboxMeta;

export const BasicCheckbox: StoryObj<CheckboxProps> = {
args: {
icon: <Default height={12} width={16} />,
Expand All @@ -42,6 +46,10 @@ export const BasicCheckbox: StoryObj<CheckboxProps> = {
},
};

export const NoLabel: StoryObj<CheckboxProps> = {
args: {},
};

export const DisabledBasicCheckbox: StoryObj<CheckboxProps> = {
args: {
disabled: true,
Expand Down

0 comments on commit ef7f3c1

Please sign in to comment.