1
1
import type { Meta , StoryObj } from "@storybook/react" ;
2
2
import { ThemeProvider } from "next-themes" ;
3
3
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" ;
4
8
import { Header as HeaderComponent } from "./index.jsx" ;
5
9
6
10
const meta = {
@@ -26,6 +30,7 @@ const meta = {
26
30
} ,
27
31
} ,
28
32
} ,
33
+ tags : [ "autodocs" ] ,
29
34
} satisfies Meta < typeof HeaderComponent > ;
30
35
export default meta ;
31
36
@@ -34,3 +39,111 @@ export const Header = {
34
39
appName : "Component Library" ,
35
40
} ,
36
41
} 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