import React from 'react'; import { ALIGN_ITEMS, DISPLAY, FLEX_DIRECTION, SIZES, TEXT, } from '../../../helpers/constants/design-system'; import Box from '../../ui/box/box'; import { ICON_NAMES } from '../icon'; import { Text } from '../text'; import { BUTTON_SIZES } from './button.constants'; import { ButtonBase } from './button-base'; import README from './README.mdx'; const marginSizeControlOptions = [ undefined, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 'auto', ]; export default { title: 'Components/ComponentLibrary/ButtonBase', id: __filename, component: ButtonBase, parameters: { docs: { page: README, }, }, argTypes: { as: { control: 'select', options: ['button', 'a'], }, block: { control: 'boolean', }, children: { control: 'text', }, className: { control: 'text', }, disabled: { control: 'boolean', }, icon: { control: 'select', options: Object.values(ICON_NAMES), }, loading: { control: 'boolean', }, size: { control: 'select', options: Object.values(BUTTON_SIZES), }, marginTop: { options: marginSizeControlOptions, control: 'select', table: { category: 'box props' }, }, marginRight: { options: marginSizeControlOptions, control: 'select', table: { category: 'box props' }, }, marginBottom: { options: marginSizeControlOptions, control: 'select', table: { category: 'box props' }, }, marginLeft: { options: marginSizeControlOptions, control: 'select', table: { category: 'box props' }, }, }, args: { children: 'Button Base', }, }; export const DefaultStory = (args) => ; DefaultStory.storyName = 'Default'; export const Size = (args) => ( <> Button SM Button MD Button LG Button Auto {' '} inherits the font-size of the parent element. ); export const Block = (args) => ( <> Default Button Block Button ); export const As = (args) => ( Button Element Anchor Element ); export const Disabled = (args) => ( Disabled Button ); Disabled.args = { disabled: true, }; export const Loading = (args) => ( Loading Button ); Loading.args = { loading: true, }; export const Icon = (args) => ( Button );