import type { Meta, StoryObj } from "@storybook/react-vite"; import React from "react"; /** * Display & Visibility Utilities * * CSS utility classes for showing/hiding elements at different breakpoints. * All classes use `!important` to override component specificity. * * Use the viewport toolbar to verify responsive variants. */ const meta: Meta = { title: "FP.React Components/Utilities/Display", tags: ["stable"], parameters: { docs: { description: { component: "Responsive display and visibility utilities. Switch viewports in the toolbar to verify breakpoint behavior.", }, }, }, }; export default meta; type Story = StoryObj; const boxStyle: React.CSSProperties = { padding: "0.75rem 1rem", background: "#e0f2fe", border: "1px solid #0ea5e9", borderRadius: "0.25rem", fontFamily: "monospace", fontSize: "0.875rem", }; const hiddenBoxStyle: React.CSSProperties = { ...boxStyle, background: "#fef9c3", border: "1px solid #ca8a04", }; /** `.hide` removes from layout + accessibility tree. `.show` restores it. */ export const HideShow: Story = { render: () => (
The text below is visually hidden but read by screen readers:
This text is only announced by screen readers Tab to focus me — .sr-only-focusable (skip link pattern)