import React from 'react'; import { ALIGN_ITEMS, COLORS, DISPLAY, FLEX_DIRECTION, SIZES, } from '../../../helpers/constants/design-system'; import Box from '../../ui/box/box'; import { ICON_NAMES } from '../icon'; import { BUTTON_ICON_SIZES } from './button-icon.constants'; import { ButtonIcon } from './button-icon'; 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/ButtonIcon', id: __filename, component: ButtonIcon, parameters: { docs: { page: README, }, }, argTypes: { ariaLabel: { control: 'text', }, as: { control: 'select', options: ['button', 'a'], }, className: { control: 'text', }, color: { control: 'select', options: Object.values(COLORS), }, disabled: { control: 'boolean', }, href: { control: 'string', }, icon: { control: 'select', options: Object.values(ICON_NAMES), }, size: { control: 'select', options: Object.values(BUTTON_ICON_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' }, }, }, }; export const DefaultStory = (args) => ; DefaultStory.args = { icon: ICON_NAMES.CLOSE_OUTLINE, ariaLabel: 'Close', }; DefaultStory.storyName = 'Default'; export const Icon = (args) => ( ); export const Size = (args) => ( ); export const AriaLabel = (args) => ( <> ); export const As = (args) => ( ); export const Href = (args) => ( ); Href.args = { href: 'https://metamask.io/', color: COLORS.PRIMARY_DEFAULT, }; export const Color = (args) => ( ); Color.args = { color: COLORS.PRIMARY_DEFAULT, }; export const Disabled = (args) => ( ); Disabled.args = { disabled: true, };