// // Copyright 2026 DXOS.org // import '../theme/index.css'; import { type Meta, type StoryObj } from '@storybook/react-vite'; import React from 'react'; import { expect, userEvent } from 'storybook/test'; import { Block } from '../components/Block/Block.tsx'; import { Button } from '../components/Button/Button.tsx'; import { Checkbox } from '../components/Checkbox/Checkbox.tsx'; import * as Collapsible from '../components/Collapsible/Collapsible.tsx'; import * as Combobox from '../components/Combobox/Combobox.tsx'; import { Container } from '../components/Container/Container.tsx'; import * as Field from '../components/Field/Field.tsx'; import * as Icon from '../components/Icon/Icon.tsx'; import { Input } from '../components/Input/Input.tsx'; import { Label } from '../components/Label/Label.tsx'; import * as Select from '../components/Select/Select.tsx'; import { Switch } from '../components/Switch/Switch.tsx'; import { Textarea } from '../components/Textarea/Textarea.tsx'; import { Toggle } from '../components/Toggle/Toggle.tsx'; import * as Toolbar from '../components/Toolbar/Toolbar.tsx'; import * as Typography from '../components/Typography/Typography.tsx'; import * as UiInput from '../namespaces/Input.ts'; import { type Size, SIZES } from '../sizes.ts'; import { withTheme } from './index.ts'; import { SIZE_ARG_TYPES, type SizeArgs } from './stories.tsx'; const LABEL_COLUMNS = 'auto [field-start] minmax(0, 1fr)'; const OPTIONS: Select.Option[] = [ { value: 'red', label: 'Red' }, { value: 'green', label: 'Green' }, { value: 'blue', label: 'Blue' }, ]; const SizeSection = ({ size }: { size: Size }) => ( {OPTIONS.map((item) => ( ))} Email We never share it. Website Enter a valid URL. Typography centres its first line in the block, so the icon beside it lines up however far it wraps. ); /** Every size by default; pick one in the properties panel by turning `allSizes` off. */ const DefaultStory = ({ size = 'md', allSizes = true }: SizeArgs) => (
{(allSizes ? SIZES : [size]).map((size) => ( ))}
); const meta = { title: 'ui/react-ui-core/testing/components', render: DefaultStory, args: { size: 'md', allSizes: true }, argTypes: { ...SIZE_ARG_TYPES, allSizes: { control: 'boolean' } }, decorators: [withTheme()], parameters: { layout: 'centered' }, } satisfies Meta; export default meta; type Story = StoryObj; /** Cross-component gallery; per-component assertions live in each component's own stories. */ export const Default: Story = {}; /** A recognisable ring colour, so the audit can tell Next's ring from the browser's or Tailwind's. */ const AUDIT_RING = 'rgb(255, 0, 255)'; /** Tailwind forms' focus blue and the browser's default focus outline must never show on a Next part. */ const FOREIGN_RING = 'rgb(37, 99, 235)'; /** Every focusable Next control, themed with the audit ring colour. */ const FocusRingsStory = () => (
Input Textarea