|
|
@ -1,15 +1,15 @@
|
|
|
|
import { ComponentMeta } from '@storybook/react';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { EnvelopeIcon } from '@heroicons/react/24/solid';
|
|
|
|
import {
|
|
|
|
import type { ComponentMeta } from '@storybook/react';
|
|
|
|
Button,
|
|
|
|
import type {
|
|
|
|
ButtonAddOnPosition,
|
|
|
|
ButtonAddOnPosition,
|
|
|
|
ButtonDisplay,
|
|
|
|
ButtonDisplay,
|
|
|
|
ButtonSize,
|
|
|
|
ButtonSize,
|
|
|
|
ButtonType,
|
|
|
|
ButtonType,
|
|
|
|
ButtonVariant,
|
|
|
|
ButtonVariant} from '@tih/ui';
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
Button
|
|
|
|
} from '@tih/ui';
|
|
|
|
} from '@tih/ui';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { EnvelopeIcon } from '@heroicons/react/24/solid';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const buttonTypes: ReadonlyArray<ButtonType> = ['button', 'reset', 'submit'];
|
|
|
|
const buttonTypes: ReadonlyArray<ButtonType> = ['button', 'reset', 'submit'];
|
|
|
|
const buttonSizes: ReadonlyArray<ButtonSize> = ['sm', 'md', 'lg'];
|
|
|
|
const buttonSizes: ReadonlyArray<ButtonSize> = ['sm', 'md', 'lg'];
|
|
|
@ -27,16 +27,14 @@ const buttonVariants: ReadonlyArray<ButtonVariant> = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
title: 'Button',
|
|
|
|
|
|
|
|
component: Button,
|
|
|
|
|
|
|
|
argTypes: {
|
|
|
|
argTypes: {
|
|
|
|
addonPosition: {
|
|
|
|
addonPosition: {
|
|
|
|
options: buttonAddOnPositions,
|
|
|
|
|
|
|
|
control: { type: 'select' },
|
|
|
|
control: { type: 'select' },
|
|
|
|
|
|
|
|
options: buttonAddOnPositions,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
display: {
|
|
|
|
display: {
|
|
|
|
options: buttonDisplays,
|
|
|
|
|
|
|
|
control: { type: 'select' },
|
|
|
|
control: { type: 'select' },
|
|
|
|
|
|
|
|
options: buttonDisplays,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isDisabled: {
|
|
|
|
isDisabled: {
|
|
|
|
control: 'boolean',
|
|
|
|
control: 'boolean',
|
|
|
@ -48,18 +46,20 @@ export default {
|
|
|
|
control: 'text',
|
|
|
|
control: 'text',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
size: {
|
|
|
|
size: {
|
|
|
|
options: buttonSizes,
|
|
|
|
|
|
|
|
control: { type: 'select' },
|
|
|
|
control: { type: 'select' },
|
|
|
|
|
|
|
|
options: buttonSizes,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: {
|
|
|
|
type: {
|
|
|
|
options: buttonTypes,
|
|
|
|
|
|
|
|
control: { type: 'select' },
|
|
|
|
control: { type: 'select' },
|
|
|
|
|
|
|
|
options: buttonTypes,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
variant: {
|
|
|
|
variant: {
|
|
|
|
options: buttonVariants,
|
|
|
|
|
|
|
|
control: { type: 'select' },
|
|
|
|
control: { type: 'select' },
|
|
|
|
|
|
|
|
options: buttonVariants,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
component: Button,
|
|
|
|
|
|
|
|
title: 'Button',
|
|
|
|
} as ComponentMeta<typeof Button>;
|
|
|
|
} as ComponentMeta<typeof Button>;
|
|
|
|
|
|
|
|
|
|
|
|
export const Basic = {
|
|
|
|
export const Basic = {
|
|
|
@ -111,8 +111,8 @@ export function Disabled() {
|
|
|
|
<div className="space-x-4">
|
|
|
|
<div className="space-x-4">
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
isDisabled={true}
|
|
|
|
|
|
|
|
key={variant}
|
|
|
|
key={variant}
|
|
|
|
|
|
|
|
isDisabled={true}
|
|
|
|
label="Click Me"
|
|
|
|
label="Click Me"
|
|
|
|
size="md"
|
|
|
|
size="md"
|
|
|
|
variant={variant}
|
|
|
|
variant={variant}
|
|
|
@ -128,8 +128,8 @@ export function Loading() {
|
|
|
|
<div className="space-x-4">
|
|
|
|
<div className="space-x-4">
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
isLoading={true}
|
|
|
|
|
|
|
|
key={variant}
|
|
|
|
key={variant}
|
|
|
|
|
|
|
|
isLoading={true}
|
|
|
|
label="Click Me"
|
|
|
|
label="Click Me"
|
|
|
|
size="md"
|
|
|
|
size="md"
|
|
|
|
variant={variant}
|
|
|
|
variant={variant}
|
|
|
@ -139,9 +139,9 @@ export function Loading() {
|
|
|
|
<div className="space-x-4">
|
|
|
|
<div className="space-x-4">
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
{buttonVariants.map((variant) => (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
|
|
|
|
key={variant}
|
|
|
|
isDisabled={true}
|
|
|
|
isDisabled={true}
|
|
|
|
isLoading={true}
|
|
|
|
isLoading={true}
|
|
|
|
key={variant}
|
|
|
|
|
|
|
|
label="Click Me"
|
|
|
|
label="Click Me"
|
|
|
|
size="md"
|
|
|
|
size="md"
|
|
|
|
variant={variant}
|
|
|
|
variant={variant}
|
|
|
|