import { expect, fn, screen, userEvent, within } from "storybook/test"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { DotsThreeVerticalRegularIcon } from "alouette-icons/phosphor-icons/DotsThreeVertical"; import { MagnifyingGlassRegularIcon } from "alouette-icons/phosphor-icons/MagnifyingGlass"; import { PlusRegularIcon } from "alouette-icons/phosphor-icons/Plus"; import { RowsRegularIcon } from "alouette-icons/phosphor-icons/Rows"; import { SquaresFourRegularIcon } from "alouette-icons/phosphor-icons/SquaresFour"; import type { ReactNode } from "react"; import type { Density } from "../../controlSizes"; import { Button } from "../actions/Button"; import { IconButton } from "../actions/IconButton"; import { Menu } from "../actions/Menu"; import { MenuItem } from "../actions/MenuItem"; import { SplitButton } from "../actions/SplitButton"; import { SplitButtonOption } from "../actions/SplitButtonOption"; import { Checkbox } from "../inputs/Checkbox"; import { InputText } from "../inputs/InputText"; import { RadioButton } from "../inputs/RadioButton"; import { RadioButtonGroup } from "../inputs/RadioButtonGroup"; import { Select } from "../inputs/Select"; import { Tab } from "../navigation/Tab"; import { Tabs } from "../navigation/Tabs"; import { Icon } from "../primitives/Icon"; import { View } from "../primitives/View"; import { Story } from "../story-components/Story"; import { DensityScope } from "./DensityScope"; type ThisStory = StoryObj; export default { title: "alouette/Containers/DensityScope", component: DensityScope, parameters: { componentSubtitle: "Sets the size of every control in its subtree: comfortable for touch, compact for an interface driven by a mouse", docs: { description: { component: `### Densities - \`comfortable\` (default, outside any scope): every control keeps the 44px touch target — \`Button\` sizes 38 / 44 / 52px - \`compact\`: 36px controls — \`Button\` sizes 32 / 36 / 44px — for a desktop-only interface (WCAG 2.5.8 asks 24px for a pointer target) The scope swaps the \`--spacing-control-*\` tokens, so a control written with \`min-h-control-md\` follows it; type sizes do not change. \`useDensity()\` reads it for a size set from JS, and \`controlHeightsPx\` gives the heights in px. Scopes nest, and a \`Popover\`, \`Menu\` or \`Modal\` keeps the density of the element that opened it. ### Usage ~~~tsx ~~~`, }, }, }, } satisfies Meta; function Toolbar(): ReactNode { return ( } className="text-muted" /> } />