Skip to content

Commit 9330881

Browse files
committed
docs: add additional stories for Header component
1 parent 9ef2c44 commit 9330881

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

packages/component-library/src/Header/index.stories.tsx

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import { ThemeProvider } from "next-themes";
33

4+
import { TabRoot } from "../AppShell/tabs.jsx";
5+
import { Badge } from "../Badge/index.jsx";
6+
import { Button } from "../Button/index.jsx";
7+
import { MainNavTabs } from "../MainNavTabs/index.jsx";
48
import { Header as HeaderComponent } from "./index.jsx";
59

610
const meta = {
@@ -26,6 +30,7 @@ const meta = {
2630
},
2731
},
2832
},
33+
tags: ["autodocs"],
2934
} satisfies Meta<typeof HeaderComponent>;
3035
export default meta;
3136

@@ -34,3 +39,111 @@ export const Header = {
3439
appName: "Component Library",
3540
},
3641
} satisfies StoryObj<typeof HeaderComponent>;
42+
43+
type Story = StoryObj<typeof HeaderComponent>;
44+
45+
export const Default: Story = {
46+
args: {
47+
appName: "Price Feeds",
48+
},
49+
};
50+
51+
export const WithCustomCTA: Story = {
52+
args: {
53+
appName: "Benchmarks",
54+
mainCta: {
55+
label: "Get Started",
56+
href: "https://pyth.network",
57+
},
58+
},
59+
};
60+
61+
export const WithMainMenu: Story = {
62+
args: {
63+
appName: "Developer Hub",
64+
},
65+
decorators: [
66+
(Story) => (
67+
<TabRoot>
68+
<Story />
69+
</TabRoot>
70+
),
71+
],
72+
render: (args) => (
73+
<HeaderComponent
74+
{...args}
75+
mainMenu={
76+
<MainNavTabs
77+
tabs={[
78+
{ children: "Overview", segment: "" },
79+
{ children: "Price Feeds", segment: "price-feeds" },
80+
{ children: "Benchmarks", segment: "benchmarks" },
81+
{ children: "API Reference", segment: "api" },
82+
]}
83+
/>
84+
}
85+
/>
86+
),
87+
};
88+
89+
export const WithExtraCTA: Story = {
90+
args: {
91+
appName: "Pyth Network",
92+
extraCta: (
93+
<>
94+
<Badge variant="info">Beta</Badge>
95+
<Button size="sm" variant="outline" rounded>
96+
Connect Wallet
97+
</Button>
98+
</>
99+
),
100+
},
101+
};
102+
103+
export const CompleteExample: Story = {
104+
args: {
105+
appName: "Oracle Dashboard",
106+
mainCta: {
107+
label: "Documentation",
108+
href: "https://docs.pyth.network",
109+
},
110+
},
111+
decorators: [
112+
(Story) => (
113+
<TabRoot>
114+
<Story />
115+
</TabRoot>
116+
),
117+
],
118+
render: (args) => (
119+
<HeaderComponent
120+
{...args}
121+
mainMenu={
122+
<MainNavTabs
123+
tabs={[
124+
{ children: "Dashboard", segment: "" },
125+
{ children: "Analytics", segment: "analytics" },
126+
{ children: "Settings", segment: "settings" },
127+
]}
128+
/>
129+
}
130+
extraCta={
131+
<>
132+
<Badge variant="success">Live</Badge>
133+
<Button size="sm" variant="ghost" rounded>
134+
0x1234...5678
135+
</Button>
136+
</>
137+
}
138+
/>
139+
),
140+
};
141+
142+
export const MinimalHeader: Story = {
143+
args: {
144+
appName: "Pyth App",
145+
mainCta: undefined,
146+
mainMenu: undefined,
147+
extraCta: undefined,
148+
},
149+
};

0 commit comments

Comments
 (0)