2021-08-18 20:08:14 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { PropsType } from './Checkbox';
|
|
|
|
import { Checkbox } from './Checkbox';
|
2021-08-18 20:08:14 +00:00
|
|
|
|
|
|
|
const createProps = (): PropsType => ({
|
|
|
|
checked: false,
|
|
|
|
label: 'Check Me!',
|
|
|
|
name: 'check-me',
|
|
|
|
onChange: action('onChange'),
|
|
|
|
});
|
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export default {
|
|
|
|
title: 'Components/Checkbox',
|
|
|
|
};
|
2021-08-18 20:08:14 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Normal = (): JSX.Element => <Checkbox {...createProps()} />;
|
|
|
|
export const Checked = (): JSX.Element => (
|
|
|
|
<Checkbox {...createProps()} checked />
|
|
|
|
);
|
2021-08-18 20:08:14 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Description = (): JSX.Element => (
|
2021-08-18 20:08:14 +00:00
|
|
|
<Checkbox {...createProps()} description="This is a checkbox" />
|
2022-06-07 00:48:02 +00:00
|
|
|
);
|
2021-08-18 20:08:14 +00:00
|
|
|
|
2022-06-07 00:48:02 +00:00
|
|
|
export const Disabled = (): JSX.Element => (
|
|
|
|
<Checkbox {...createProps()} disabled />
|
|
|
|
);
|