// // Copyright 2026 DXOS.org // import '../../theme/index.css'; import { type Meta, type StoryObj } from '@storybook/react-vite'; import React from 'react'; import { expect, userEvent, waitFor, within } from 'storybook/test'; import { SIZES } from '../../sizes.ts'; import { GEOMETRY, byTestId, centreY, controlSize, expectDecorativeIconsHidden, expectNoTooltip, expectScoped, expectTooltip, realHover, sizeRow, } from '../../testing/geometry.ts'; import { withLayout, withTheme } from '../../testing/index.ts'; import { SIZE_ARG_TYPES, type SizeArgs, withSizes } from '../../testing/stories.tsx'; import { Group } from '../Group/Group.tsx'; import { Toggle } from '../Toggle/Toggle.tsx'; import * as ToggleGroup from '../ToggleGroup/ToggleGroup.tsx'; import * as Toolbar from '../Toolbar/Toolbar.tsx'; import { Button, type ButtonHue, type ButtonValence, type ButtonVariant } from './Button.tsx'; /** Every variant, with the `valence` variant once bare and once per valence. */ const VARIANTS: { name: string; variant: ButtonVariant; valence?: ButtonValence }[] = [ { name: 'default', variant: 'default' }, { name: 'primary', variant: 'primary' }, { name: 'ghost', variant: 'ghost' }, { name: 'outline', variant: 'outline' }, { name: 'destructive', variant: 'destructive' }, { name: 'valence', variant: 'valence' }, ...(['neutral', 'info', 'success', 'warning', 'error'] as const).map((valence) => ({ name: `valence-${valence}`, variant: 'valence' as const, valence, })), ]; const HUES: ButtonHue[] = ['neutral', 'red', 'amber', 'emerald', 'sky', 'error']; type StoryArgs = SizeArgs & { /** Also show every variant, icon-only then as text. */ variants?: boolean; }; /** * A toolbar of icon-only, text, disabled, leading-icon and trailing-icon buttons over a row with a rail Block, so the * first button's icon can be compared with the rail's; then caret, compact, tooltip-side and hue buttons. */ const DefaultStory = ({ size, variants }: StoryArgs) => ( <> ))} )} ))}