import type { Meta, StoryObj } from '@storybook/nextjs-vite'; import { OSTypeIcon } from '../components/features/os-type-badge'; import { OPENFRAME_DOCTOR_COMMANDS, PathsDisplay } from '../components/features/paths-display'; import { WarningBlock } from '../components/features/warning-block'; const meta = { title: 'Features/WarningBlock', component: WarningBlock, parameters: { docs: { description: { component: 'A card with a highlighted "attention / warning" banner header followed by composable body content. Body is passed as children, so a single block can mix description paragraphs with one or more `PathsDisplay` lists (see the New Device warning blocks). Typography is responsive via ODS tokens (14px on mobile, 18px from `md` up).', }, }, }, argTypes: { title: { control: 'text' }, }, decorators: [ (Story) => (
), ], } satisfies Meta; export default meta; type Story = StoryObj; const copyPath = (path: string) => { if (typeof navigator !== 'undefined' && navigator.clipboard) { void navigator.clipboard.writeText(path); } }; /** Minimal usage — a banner title with a single description paragraph. */ export const Default: Story = { args: { title: 'Administrator privileges are required to install the OpenFrame agent.', children: (

Run the command with the appropriate permissions for your platform.

), }, }; /** * Antivirus warning from the New Device screen — description, a `PathsDisplay` * list of exclusion folders, then a closing paragraph. */ export const AntivirusWarning: Story = { args: { title: 'Your antivirus may block OpenFrame installation. This is a false positive.', children: ( <>

Or temporarily disable protection during installation. OpenFrame is safe open-source software. Blocks happen because new software needs time to build reputation with security vendors.

), }, }; /** * Doctor mode warning from the New Device screen — description plus a single * copyable command row. */ export const DoctorMode: Story = { args: { title: 'Device not appearing or stuck pending?', children: ( <>

Run the doctor command to diagnose installation issues and repair the agent. It works even if the agent didn't install correctly.

), }, }; /** * Administrator privileges warning — a platform-specific instruction row (no * copy button) framed by description paragraphs. */ export const AdministratorPrivileges: Story = { args: { title: 'Administrator privileges are required to install the OpenFrame agent.', children: ( <>

Run the command with the appropriate permissions for your platform:

} />

Without elevated privileges, the installation will fail silently. Right-click PowerShell and select "Run as administrator," or contact your IT admin if you don't have local admin rights.

), }, }; /** All three New Device warning blocks stacked, matching the Figma layout. */ export const NewDeviceBlocks: Story = { args: { title: '' }, render: () => (

Run the command with the appropriate permissions for your platform:

} />

Without elevated privileges, the installation will fail silently. Right-click PowerShell and select "Run as administrator," or contact your IT admin if you don't have local admin rights.

Or temporarily disable protection during installation. OpenFrame is safe open-source software. Blocks happen because new software needs time to build reputation with security vendors.

Run the doctor command to diagnose installation issues and repair the agent. It works even if the agent didn't install correctly.

), };