/* eslint-disable react/jsx-key */ import React from 'react'; import { storybookArgTypes, type StoryMetaType, type StoryType, } from '@lg-tools/storybook-utils'; import { glyphs, Icon } from '@leafygreen-ui/icon'; import { Spinner } from '@leafygreen-ui/loading-indicator'; import { BaseFontSize } from '@leafygreen-ui/tokens'; import { Size } from './types'; import Button, { ButtonProps, Variant } from '.'; const { updatedBaseFontSize, ...filteredStorybookArgTypes } = storybookArgTypes; const meta: StoryMetaType = { title: 'Components/Actions/Button', component: Button, parameters: { default: 'LiveExample', generate: { storyNames: [ 'LargeSize', 'DefaultSize', 'SmallSize', 'XSmallSize', 'InteractiveStates', ], combineArgs: { darkMode: [false, true], rightGlyph: [undefined, ], leftGlyph: [undefined, ], children: ['MongoDB', undefined], variant: Object.values(Variant), }, excludeCombinations: [ { children: undefined, rightGlyph: undefined, leftGlyph: undefined, }, { rightGlyph: , leftGlyph: , children: undefined, }, ], }, }, args: { children: 'MongoDB', loadingIndicator: , leftGlyph: undefined, rightGlyph: undefined, baseFontSize: BaseFontSize.Body1, }, argTypes: { ...filteredStorybookArgTypes, baseFontSize: storybookArgTypes.updatedBaseFontSize, disabled: { control: { type: 'boolean' }, }, darkMode: storybookArgTypes.darkMode, leftGlyph: { options: Object.keys(glyphs), control: { type: 'select' }, }, rightGlyph: { options: Object.keys(glyphs), control: { type: 'select' }, }, type: { control: 'select', options: ['button', 'submit'], defaultValue: 'button', }, size: { control: 'select', options: Object.values(Size), defaultValue: Size.Default, }, href: { control: 'text', }, isLoading: { control: 'boolean', }, loadingText: { control: 'text', }, variant: { options: Object.values(Variant), control: { type: 'select' }, defaultValue: Variant.Default, }, }, }; export default meta; export const LiveExample: StoryType = ({ leftGlyph, rightGlyph, ...args }: ButtonProps) => (