Files
Stirling-PDF/frontend/shared/components/PanelHeader.stories.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-06-02 17:08:24 +01:00
import type { Meta, StoryObj } from "@storybook/react-vite";
2026-06-23 14:57:17 +01:00
import ShieldOutlinedIcon from "@mui/icons-material/ShieldOutlined";
import DeleteSweepIcon from "@mui/icons-material/DeleteSweep";
2026-06-02 17:08:24 +01:00
import { PanelHeader } from "@shared/components/PanelHeader";
import { StatusBadge } from "@shared/components/StatusBadge";
const meta: Meta<typeof PanelHeader> = {
title: "Primitives/PanelHeader",
component: PanelHeader,
tags: ["autodocs"],
parameters: { layout: "padded" },
args: {
2026-06-23 14:57:17 +01:00
icon: <ShieldOutlinedIcon sx={{ fontSize: "1rem" }} />,
title: "Security",
closeLabel: "Close",
2026-06-02 17:08:24 +01:00
},
2026-06-23 14:57:17 +01:00
argTypes: { onClose: { action: "close" } },
2026-06-02 17:08:24 +01:00
};
export default meta;
type Story = StoryObj<typeof PanelHeader>;
2026-06-23 14:57:17 +01:00
/** Plain header pill with a trailing close button. */
2026-06-02 17:08:24 +01:00
export const Playground: Story = {};
2026-06-23 14:57:17 +01:00
/** Category-accented icon badge (blue / purple / green / amber / red). */
export const Accented: Story = {
args: { accent: "purple" },
};
/** Dropdown trigger — a disclosure chevron appears and clicking the pill opens
* the menu (e.g. the chat header's "Clear chat"). */
export const WithMenu: Story = {
2026-06-02 17:08:24 +01:00
args: {
2026-06-23 14:57:17 +01:00
title: "Stirling",
menuLabel: "Stirling agent options",
menuItems: [
{
key: "clear",
icon: <DeleteSweepIcon sx={{ fontSize: 18 }} />,
label: "Clear chat",
onClick: () => {},
},
],
2026-06-02 17:08:24 +01:00
},
};
2026-06-23 14:57:17 +01:00
/** Loading state — pulsing status dot on the icon + a tinted border. */
export const Loading: Story = {
args: { title: "Stirling", loading: true },
};
/** Right-aligned actions rendered before the close button. */
export const WithActions: Story = {
2026-06-02 17:08:24 +01:00
args: {
2026-06-23 14:57:17 +01:00
accent: "purple",
2026-06-02 17:08:24 +01:00
actions: (
2026-06-23 14:57:17 +01:00
<StatusBadge tone="success" showDot pulse>
Active
</StatusBadge>
2026-06-02 17:08:24 +01:00
),
},
};