@wakastellar/ui 2.3.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/dashboard/index.d.ts +4 -1
- package/dist/blocks/empty-states/index.d.ts +4 -1
- package/dist/blocks/error-pages/index.d.ts +4 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/landing/index.d.ts +4 -1
- package/dist/blocks/pricing/index.d.ts +5 -1
- package/dist/blocks/sidebar/index.d.ts +5 -1
- package/dist/index.cjs.js +130 -130
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +7905 -7856
- package/dist/stories/Button.d.ts +14 -0
- package/dist/stories/Button.stories.d.ts +8 -0
- package/dist/stories/Header.d.ts +11 -0
- package/dist/stories/Header.stories.d.ts +6 -0
- package/dist/stories/Page.d.ts +2 -0
- package/dist/stories/Page.stories.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/link.d.ts +23 -0
- package/package.json +11 -3
- package/src/blocks/activity-timeline/ActivityTimeline.stories.tsx +460 -0
- package/src/blocks/apm-overview/APMOverview.stories.tsx +435 -0
- package/src/blocks/auth-2fa/Auth2FA.stories.tsx +308 -0
- package/src/blocks/calendar-view/CalendarView.stories.tsx +398 -0
- package/src/blocks/chat/Chat.stories.tsx +466 -0
- package/src/blocks/chat-interface/ChatInterface.stories.tsx +412 -0
- package/src/blocks/checkout-flow/CheckoutFlow.stories.tsx +408 -0
- package/src/blocks/cicd-builder/CICDBuilder.stories.tsx +499 -0
- package/src/blocks/cloud-cost-dashboard/CloudCostDashboard.stories.tsx +356 -0
- package/src/blocks/container-orchestrator/ContainerOrchestrator.stories.tsx +461 -0
- package/src/blocks/dashboard/Dashboard.stories.tsx +559 -0
- package/src/blocks/dashboard/index.tsx +68 -27
- package/src/blocks/dashboard-kpi/DashboardKPI.stories.tsx +422 -0
- package/src/blocks/database-admin/DatabaseAdmin.stories.tsx +393 -0
- package/src/blocks/deployment-dashboard/DeploymentDashboard.stories.tsx +457 -0
- package/src/blocks/empty-states/EmptyStates.stories.tsx +467 -0
- package/src/blocks/empty-states/index.tsx +26 -8
- package/src/blocks/error-pages/ErrorPages.stories.tsx +401 -0
- package/src/blocks/error-pages/index.tsx +26 -8
- package/src/blocks/faq/FAQ.stories.tsx +416 -0
- package/src/blocks/file-manager/FileManager.stories.tsx +413 -0
- package/src/blocks/footer/Footer.stories.tsx +328 -0
- package/src/blocks/gitops-sync-status/GitOpsSyncStatus.stories.tsx +529 -0
- package/src/blocks/header/WakaHeader.stories.tsx +455 -0
- package/src/blocks/headtab/Headtab.stories.tsx +369 -0
- package/src/blocks/i18n-editor/I18nEditor.stories.tsx +451 -0
- package/src/blocks/incident-manager/IncidentManager.stories.tsx +464 -0
- package/src/blocks/index.ts +1 -1
- package/src/blocks/infrastructure-map/InfrastructureMap.stories.tsx +533 -0
- package/src/blocks/kanban-board/KanbanBoard.stories.tsx +494 -0
- package/src/blocks/landing/WakaLanding.stories.tsx +449 -0
- package/src/blocks/landing/index.tsx +125 -66
- package/src/blocks/language-selector/LanguageSelector.stories.tsx +345 -0
- package/src/blocks/layout/Layout.stories.tsx +373 -0
- package/src/blocks/login/Login.stories.tsx +443 -0
- package/src/blocks/on-call-schedule/OnCallSchedule.stories.tsx +381 -0
- package/src/blocks/player-profile/PlayerProfile.stories.tsx +316 -0
- package/src/blocks/pricing/WakaPricing.stories.tsx +530 -0
- package/src/blocks/pricing/index.tsx +38 -4
- package/src/blocks/profile/Profile.stories.tsx +371 -0
- package/src/blocks/release-notes/ReleaseNotes.stories.tsx +431 -0
- package/src/blocks/settings/Settings.stories.tsx +520 -0
- package/src/blocks/sidebar/WakaSidebar.stories.tsx +513 -0
- package/src/blocks/sidebar/index.tsx +49 -20
- package/src/blocks/theme-creator-block/ThemeCreatorBlock.stories.tsx +370 -0
- package/src/blocks/user-management/UserManagement.stories.tsx +411 -0
- package/src/blocks/wizard/Wizard.stories.tsx +683 -0
- package/src/components/accordion/Accordion.stories.tsx +93 -0
- package/src/components/alert/Alert.stories.tsx +95 -0
- package/src/components/alert-dialog/AlertDialog.stories.tsx +126 -0
- package/src/components/aspect-ratio/AspectRatio.stories.tsx +118 -0
- package/src/components/avatar/Avatar.stories.tsx +104 -0
- package/src/components/button/Button.stories.tsx +12 -1
- package/src/components/calendar/Calendar.stories.tsx +102 -0
- package/src/components/card/Card.stories.tsx +125 -0
- package/src/components/checkbox/Checkbox.stories.tsx +100 -0
- package/src/components/code/Code.stories.tsx +402 -0
- package/src/components/collapsible/Collapsible.stories.tsx +123 -0
- package/src/components/command/Command.stories.tsx +207 -0
- package/src/components/context-menu/ContextMenu.stories.tsx +220 -0
- package/src/components/dialog/Dialog.stories.tsx +157 -0
- package/src/components/dropdown-menu/DropdownMenu.stories.tsx +225 -0
- package/src/components/form/Form.stories.tsx +413 -0
- package/src/components/hover-card/HoverCard.stories.tsx +148 -0
- package/src/components/input-otp/InputOTP.stories.tsx +255 -0
- package/src/components/label/Label.stories.tsx +68 -0
- package/src/components/menubar/Menubar.stories.tsx +278 -0
- package/src/components/navigation-menu/NavigationMenu.stories.tsx +202 -0
- package/src/components/popover/Popover.stories.tsx +199 -0
- package/src/components/progress/Progress.stories.tsx +104 -0
- package/src/components/radio-group/RadioGroup.stories.tsx +138 -0
- package/src/components/scroll-area/ScrollArea.stories.tsx +153 -0
- package/src/components/select/Select.stories.tsx +146 -0
- package/src/components/separator/Separator.stories.tsx +117 -0
- package/src/components/sheet/Sheet.stories.tsx +195 -0
- package/src/components/skeleton/Skeleton.stories.tsx +114 -0
- package/src/components/slider/Slider.stories.tsx +157 -0
- package/src/components/switch/Switch.stories.tsx +114 -0
- package/src/components/table/Table.stories.tsx +153 -0
- package/src/components/tabs/Tabs.stories.tsx +155 -0
- package/src/components/textarea/Textarea.stories.tsx +116 -0
- package/src/components/toast/Toast.stories.tsx +160 -0
- package/src/components/toggle/Toggle.stories.tsx +125 -0
- package/src/components/tooltip/Tooltip.stories.tsx +133 -0
- package/src/components/typography/Typography.stories.tsx +207 -0
- package/src/components/waka-3d-pie-chart/Waka3DPieChart.stories.tsx +308 -0
- package/src/components/waka-achievement-unlock/WakaAchievementUnlock.stories.tsx +353 -0
- package/src/components/waka-artifact-list/WakaArtifactList.stories.tsx +258 -0
- package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +224 -0
- package/src/components/waka-badge-showcase/WakaBadgeShowcase.stories.tsx +269 -0
- package/src/components/waka-barcode/WakaBarcode.stories.tsx +227 -0
- package/src/components/waka-bottom-sheet/WakaBottomSheet.stories.tsx +408 -0
- package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +237 -0
- package/src/components/waka-build-matrix/WakaBuildMatrix.stories.tsx +328 -0
- package/src/components/waka-carousel/WakaCarousel.stories.tsx +296 -0
- package/src/components/waka-charts/WakaCharts.stories.tsx +519 -0
- package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +200 -0
- package/src/components/waka-combobox/WakaCombobox.stories.tsx +250 -0
- package/src/components/waka-container-list/WakaContainerList.stories.tsx +315 -0
- package/src/components/waka-contribution-graph/WakaContributionGraph.stories.tsx +354 -0
- package/src/components/waka-cost-breakdown/WakaCostBreakdown.stories.tsx +348 -0
- package/src/components/waka-daily-reward/WakaDailyReward.stories.tsx +365 -0
- package/src/components/waka-database-card/WakaDatabaseCard.stories.tsx +306 -0
- package/src/components/waka-date-range-picker/WakaDateRangePicker.stories.tsx +339 -0
- package/src/components/waka-datetime-picker/WakaDateTimePicker.stories.tsx +317 -0
- package/src/components/waka-deployment-lane/WakaDeploymentLane.stories.tsx +292 -0
- package/src/components/waka-dock/WakaDock.stories.tsx +332 -0
- package/src/components/waka-drawer/WakaDrawer.stories.tsx +437 -0
- package/src/components/waka-env-var-editor/WakaEnvVarEditor.stories.tsx +263 -0
- package/src/components/waka-error-shake/WakaErrorShake.stories.tsx +410 -0
- package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +239 -0
- package/src/components/waka-flow-diagram/WakaFlowDiagram.stories.tsx +365 -0
- package/src/components/waka-funnel-chart/WakaFunnelChart.stories.tsx +281 -0
- package/src/components/waka-glow-card/WakaGlowCard.stories.tsx +274 -0
- package/src/components/waka-haptic-button/WakaHapticButton.stories.tsx +349 -0
- package/src/components/waka-health-pulse/WakaHealthPulse.stories.tsx +293 -0
- package/src/components/waka-heatmap/WakaHeatmap.stories.tsx +376 -0
- package/src/components/waka-image/WakaImage.stories.tsx +255 -0
- package/src/components/waka-incident-timeline/WakaIncidentTimeline.stories.tsx +300 -0
- package/src/components/waka-kanban/WakaKanban.stories.tsx +399 -0
- package/src/components/waka-kubernetes-overview/WakaKubernetesOverview.stories.tsx +281 -0
- package/src/components/waka-leaderboard/WakaLeaderboard.stories.tsx +300 -0
- package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +313 -0
- package/src/components/waka-loading-orbit/WakaLoadingOrbit.stories.tsx +413 -0
- package/src/components/waka-log-viewer/WakaLogViewer.stories.tsx +312 -0
- package/src/components/waka-loot-box/WakaLootBox.stories.tsx +374 -0
- package/src/components/waka-metric-sparkline/WakaMetricSparkline.stories.tsx +312 -0
- package/src/components/waka-migration-list/WakaMigrationList.stories.tsx +289 -0
- package/src/components/waka-modal/WakaModal.stories.tsx +434 -0
- package/src/components/waka-morph-button/WakaMorphButton.stories.tsx +405 -0
- package/src/components/waka-network-topology/WakaNetworkTopology.stories.tsx +364 -0
- package/src/components/waka-notifications/WakaNotifications.stories.tsx +290 -0
- package/src/components/waka-number-input/WakaNumberInput.stories.tsx +282 -0
- package/src/components/waka-pagination/WakaPagination.stories.tsx +328 -0
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +318 -0
- package/src/components/waka-pipeline-view/WakaPipelineView.stories.tsx +386 -0
- package/src/components/waka-player-card/WakaPlayerCard.stories.tsx +333 -0
- package/src/components/waka-pod-card/WakaPodCard.stories.tsx +435 -0
- package/src/components/waka-qrcode/WakaQRCode.stories.tsx +232 -0
- package/src/components/waka-query-explain/WakaQueryExplain.stories.tsx +407 -0
- package/src/components/waka-quest-card/WakaQuestCard.stories.tsx +394 -0
- package/src/components/waka-quota-bar/WakaQuotaBar.stories.tsx +435 -0
- package/src/components/waka-radar-score/WakaRadarScore.stories.tsx +372 -0
- package/src/components/waka-resource-gauge/WakaResourceGauge.stories.tsx +366 -0
- package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +238 -0
- package/src/components/waka-sankey-diagram/WakaSankeyDiagram.stories.tsx +389 -0
- package/src/components/waka-scratch-card/WakaScratchCard.stories.tsx +388 -0
- package/src/components/waka-secret-card/WakaSecretCard.stories.tsx +314 -0
- package/src/components/waka-segmented-control/WakaSegmentedControl.stories.tsx +309 -0
- package/src/components/waka-server-rack/WakaServerRack.stories.tsx +382 -0
- package/src/components/waka-service-graph/WakaServiceGraph.stories.tsx +262 -0
- package/src/components/waka-skeleton-wave/WakaSkeletonWave.stories.tsx +321 -0
- package/src/components/waka-skill-tree/WakaSkillTree.stories.tsx +308 -0
- package/src/components/waka-spin-wheel/WakaSpinWheel.stories.tsx +368 -0
- package/src/components/waka-spinner/WakaSpinner.stories.tsx +156 -0
- package/src/components/waka-stat/WakaStat.stories.tsx +334 -0
- package/src/components/waka-status-matrix/WakaStatusMatrix.stories.tsx +331 -0
- package/src/components/waka-stepper/WakaStepper.stories.tsx +468 -0
- package/src/components/waka-streak-counter/WakaStreakCounter.stories.tsx +235 -0
- package/src/components/waka-success-explosion/WakaSuccessExplosion.stories.tsx +389 -0
- package/src/components/waka-tabs-morph/WakaTabsMorph.stories.tsx +471 -0
- package/src/components/waka-terminal-output/WakaTerminalOutput.stories.tsx +351 -0
- package/src/components/waka-test-report/WakaTestReport.stories.tsx +322 -0
- package/src/components/waka-tilt-card/WakaTiltCard.stories.tsx +300 -0
- package/src/components/waka-time-picker/WakaTimePicker.stories.tsx +227 -0
- package/src/components/waka-timeline/WakaTimeline.stories.tsx +383 -0
- package/src/components/waka-tournament-bracket/WakaTournamentBracket.stories.tsx +375 -0
- package/src/components/waka-trace-viewer/WakaTraceViewer.stories.tsx +445 -0
- package/src/components/waka-tree/WakaTree.stories.tsx +359 -0
- package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +378 -0
- package/src/components/waka-typewriter/WakaTypewriter.stories.tsx +366 -0
- package/src/components/waka-versus-card/WakaVersusCard.stories.tsx +530 -0
- package/src/components/waka-video/WakaVideo.stories.tsx +203 -0
- package/src/components/waka-virtual-list/WakaVirtualList.stories.tsx +273 -0
- package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +305 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Layout, Sidebar, SidebarItem, Header } from './index'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Home, Users, Settings, FileText, BarChart3, Mail, HelpCircle } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
const MockSidebar = () => (
|
|
7
|
+
<Sidebar>
|
|
8
|
+
<SidebarItem href="/dashboard" active>
|
|
9
|
+
<Home className="h-4 w-4 mr-2" />
|
|
10
|
+
Dashboard
|
|
11
|
+
</SidebarItem>
|
|
12
|
+
<SidebarItem href="/users">
|
|
13
|
+
<Users className="h-4 w-4 mr-2" />
|
|
14
|
+
Users
|
|
15
|
+
</SidebarItem>
|
|
16
|
+
<SidebarItem href="/documents">
|
|
17
|
+
<FileText className="h-4 w-4 mr-2" />
|
|
18
|
+
Documents
|
|
19
|
+
</SidebarItem>
|
|
20
|
+
<SidebarItem href="/analytics">
|
|
21
|
+
<BarChart3 className="h-4 w-4 mr-2" />
|
|
22
|
+
Analytics
|
|
23
|
+
</SidebarItem>
|
|
24
|
+
<SidebarItem href="/messages">
|
|
25
|
+
<Mail className="h-4 w-4 mr-2" />
|
|
26
|
+
Messages
|
|
27
|
+
</SidebarItem>
|
|
28
|
+
<SidebarItem href="/settings">
|
|
29
|
+
<Settings className="h-4 w-4 mr-2" />
|
|
30
|
+
Settings
|
|
31
|
+
</SidebarItem>
|
|
32
|
+
<SidebarItem href="/help">
|
|
33
|
+
<HelpCircle className="h-4 w-4 mr-2" />
|
|
34
|
+
Help
|
|
35
|
+
</SidebarItem>
|
|
36
|
+
</Sidebar>
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const MockHeader = () => (
|
|
40
|
+
<Header className="w-full">
|
|
41
|
+
<div className="flex items-center gap-4">
|
|
42
|
+
<span className="text-lg font-bold">MyApp</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="flex items-center gap-2">
|
|
45
|
+
<button className="px-3 py-1.5 text-sm rounded-md hover:bg-accent">
|
|
46
|
+
Sign In
|
|
47
|
+
</button>
|
|
48
|
+
<button className="px-3 py-1.5 text-sm bg-primary text-primary-foreground rounded-md">
|
|
49
|
+
Sign Up
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
</Header>
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
const MockFooter = () => (
|
|
56
|
+
<div className="flex items-center justify-between text-sm text-muted-foreground">
|
|
57
|
+
<span>© 2024 MyApp Inc.</span>
|
|
58
|
+
<div className="flex gap-4">
|
|
59
|
+
<a href="/privacy" className="hover:text-foreground">Privacy</a>
|
|
60
|
+
<a href="/terms" className="hover:text-foreground">Terms</a>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
const meta: Meta<typeof Layout> = {
|
|
66
|
+
title: 'Blocks/Layout',
|
|
67
|
+
component: Layout,
|
|
68
|
+
parameters: {
|
|
69
|
+
layout: 'fullscreen',
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
component:
|
|
73
|
+
'A flexible layout component with optional header, sidebar, and footer. Supports collapsible mobile navigation.',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
tags: ['autodocs'],
|
|
78
|
+
argTypes: {
|
|
79
|
+
collapsible: {
|
|
80
|
+
control: 'boolean',
|
|
81
|
+
description: 'Enable collapsible sidebar for mobile',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default meta
|
|
87
|
+
type Story = StoryObj<typeof Layout>
|
|
88
|
+
|
|
89
|
+
export const Default: Story = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<Layout
|
|
92
|
+
header={<MockHeader />}
|
|
93
|
+
sidebar={<MockSidebar />}
|
|
94
|
+
footer={<MockFooter />}
|
|
95
|
+
>
|
|
96
|
+
<div className="space-y-6">
|
|
97
|
+
<h1 className="text-3xl font-bold">Dashboard</h1>
|
|
98
|
+
<p className="text-muted-foreground">
|
|
99
|
+
Welcome to your dashboard. Here you can manage your content.
|
|
100
|
+
</p>
|
|
101
|
+
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
|
102
|
+
{['Revenue', 'Users', 'Orders', 'Growth'].map((label) => (
|
|
103
|
+
<div key={label} className="p-4 border rounded-lg bg-card">
|
|
104
|
+
<p className="text-sm text-muted-foreground">{label}</p>
|
|
105
|
+
<p className="text-2xl font-bold">$12,345</p>
|
|
106
|
+
</div>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</Layout>
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const WithHeaderOnly: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<Layout header={<MockHeader />}>
|
|
117
|
+
<div className="space-y-6">
|
|
118
|
+
<h1 className="text-3xl font-bold">Header Only Layout</h1>
|
|
119
|
+
<p className="text-muted-foreground">
|
|
120
|
+
This layout only has a header, no sidebar or footer.
|
|
121
|
+
</p>
|
|
122
|
+
<div className="grid gap-4 md:grid-cols-3">
|
|
123
|
+
{[1, 2, 3, 4, 5, 6].map((i) => (
|
|
124
|
+
<div key={i} className="p-6 border rounded-lg bg-card">
|
|
125
|
+
<h3 className="font-semibold mb-2">Card {i}</h3>
|
|
126
|
+
<p className="text-sm text-muted-foreground">
|
|
127
|
+
Some content for card {i}.
|
|
128
|
+
</p>
|
|
129
|
+
</div>
|
|
130
|
+
))}
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</Layout>
|
|
134
|
+
),
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const WithSidebarOnly: Story = {
|
|
138
|
+
render: () => (
|
|
139
|
+
<Layout sidebar={<MockSidebar />}>
|
|
140
|
+
<div className="space-y-6">
|
|
141
|
+
<h1 className="text-3xl font-bold">Sidebar Only Layout</h1>
|
|
142
|
+
<p className="text-muted-foreground">
|
|
143
|
+
This layout has a sidebar but no header or footer.
|
|
144
|
+
</p>
|
|
145
|
+
<div className="space-y-4">
|
|
146
|
+
{[1, 2, 3, 4, 5].map((i) => (
|
|
147
|
+
<div key={i} className="p-4 border rounded-lg bg-card">
|
|
148
|
+
Content block {i}
|
|
149
|
+
</div>
|
|
150
|
+
))}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</Layout>
|
|
154
|
+
),
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const CollapsibleSidebar: Story = {
|
|
158
|
+
render: () => (
|
|
159
|
+
<Layout
|
|
160
|
+
header={<MockHeader />}
|
|
161
|
+
sidebar={<MockSidebar />}
|
|
162
|
+
footer={<MockFooter />}
|
|
163
|
+
collapsible
|
|
164
|
+
>
|
|
165
|
+
<div className="space-y-6">
|
|
166
|
+
<h1 className="text-3xl font-bold">Collapsible Layout</h1>
|
|
167
|
+
<p className="text-muted-foreground">
|
|
168
|
+
On mobile, the sidebar collapses into a hamburger menu in the header.
|
|
169
|
+
Resize the window to see it in action.
|
|
170
|
+
</p>
|
|
171
|
+
<div className="p-6 border rounded-lg bg-card">
|
|
172
|
+
<h2 className="text-xl font-semibold mb-2">Main Content</h2>
|
|
173
|
+
<p className="text-muted-foreground">
|
|
174
|
+
The sidebar is hidden on mobile and accessible via the menu button.
|
|
175
|
+
</p>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</Layout>
|
|
179
|
+
),
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export const NoSidebar: Story = {
|
|
183
|
+
render: () => (
|
|
184
|
+
<Layout
|
|
185
|
+
header={<MockHeader />}
|
|
186
|
+
footer={<MockFooter />}
|
|
187
|
+
>
|
|
188
|
+
<div className="max-w-4xl mx-auto space-y-6">
|
|
189
|
+
<h1 className="text-3xl font-bold">Full Width Layout</h1>
|
|
190
|
+
<p className="text-muted-foreground">
|
|
191
|
+
This layout has header and footer but no sidebar, giving full width to content.
|
|
192
|
+
</p>
|
|
193
|
+
<div className="prose">
|
|
194
|
+
<p>
|
|
195
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
196
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
|
197
|
+
quis nostrud exercitation ullamco laboris.
|
|
198
|
+
</p>
|
|
199
|
+
<p>
|
|
200
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
|
|
201
|
+
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.
|
|
202
|
+
</p>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</Layout>
|
|
206
|
+
),
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export const MinimalLayout: Story = {
|
|
210
|
+
render: () => (
|
|
211
|
+
<Layout>
|
|
212
|
+
<div className="min-h-[400px] flex items-center justify-center">
|
|
213
|
+
<div className="text-center">
|
|
214
|
+
<h1 className="text-4xl font-bold mb-4">Minimal Layout</h1>
|
|
215
|
+
<p className="text-muted-foreground">
|
|
216
|
+
Just the content, no header, sidebar, or footer.
|
|
217
|
+
</p>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</Layout>
|
|
221
|
+
),
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const InteractiveSidebar: Story = {
|
|
225
|
+
render: () => {
|
|
226
|
+
const [activeItem, setActiveItem] = React.useState('dashboard')
|
|
227
|
+
|
|
228
|
+
const items = [
|
|
229
|
+
{ id: 'dashboard', label: 'Dashboard', icon: Home },
|
|
230
|
+
{ id: 'users', label: 'Users', icon: Users },
|
|
231
|
+
{ id: 'documents', label: 'Documents', icon: FileText },
|
|
232
|
+
{ id: 'analytics', label: 'Analytics', icon: BarChart3 },
|
|
233
|
+
{ id: 'settings', label: 'Settings', icon: Settings },
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<Layout
|
|
238
|
+
header={<MockHeader />}
|
|
239
|
+
sidebar={
|
|
240
|
+
<Sidebar>
|
|
241
|
+
{items.map((item) => (
|
|
242
|
+
<SidebarItem
|
|
243
|
+
key={item.id}
|
|
244
|
+
active={activeItem === item.id}
|
|
245
|
+
onClick={() => setActiveItem(item.id)}
|
|
246
|
+
>
|
|
247
|
+
<item.icon className="h-4 w-4 mr-2" />
|
|
248
|
+
{item.label}
|
|
249
|
+
</SidebarItem>
|
|
250
|
+
))}
|
|
251
|
+
</Sidebar>
|
|
252
|
+
}
|
|
253
|
+
>
|
|
254
|
+
<div className="space-y-4">
|
|
255
|
+
<h1 className="text-3xl font-bold capitalize">{activeItem}</h1>
|
|
256
|
+
<p className="text-muted-foreground">
|
|
257
|
+
You selected: <strong>{activeItem}</strong>
|
|
258
|
+
</p>
|
|
259
|
+
<div className="p-6 border rounded-lg bg-card">
|
|
260
|
+
Content for {activeItem} page would go here.
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</Layout>
|
|
264
|
+
)
|
|
265
|
+
},
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export const WithFooterOnly: Story = {
|
|
269
|
+
render: () => (
|
|
270
|
+
<Layout footer={<MockFooter />}>
|
|
271
|
+
<div className="min-h-[600px] space-y-6">
|
|
272
|
+
<h1 className="text-3xl font-bold">Footer Only Layout</h1>
|
|
273
|
+
<p className="text-muted-foreground">
|
|
274
|
+
This layout only has a footer at the bottom.
|
|
275
|
+
</p>
|
|
276
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
277
|
+
{[1, 2, 3, 4].map((i) => (
|
|
278
|
+
<div key={i} className="p-6 border rounded-lg bg-card h-48 flex items-center justify-center">
|
|
279
|
+
Content Area {i}
|
|
280
|
+
</div>
|
|
281
|
+
))}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</Layout>
|
|
285
|
+
),
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export const DashboardExample: Story = {
|
|
289
|
+
render: () => (
|
|
290
|
+
<Layout
|
|
291
|
+
header={
|
|
292
|
+
<Header className="w-full">
|
|
293
|
+
<div className="flex items-center gap-4">
|
|
294
|
+
<div className="h-8 w-8 rounded-lg bg-primary flex items-center justify-center text-primary-foreground font-bold">
|
|
295
|
+
A
|
|
296
|
+
</div>
|
|
297
|
+
<span className="text-lg font-bold">Analytics Pro</span>
|
|
298
|
+
</div>
|
|
299
|
+
<div className="flex items-center gap-2">
|
|
300
|
+
<div className="relative">
|
|
301
|
+
<input
|
|
302
|
+
type="search"
|
|
303
|
+
placeholder="Search..."
|
|
304
|
+
className="h-9 w-64 rounded-md border bg-background px-3 text-sm"
|
|
305
|
+
/>
|
|
306
|
+
</div>
|
|
307
|
+
<div className="h-8 w-8 rounded-full bg-muted" />
|
|
308
|
+
</div>
|
|
309
|
+
</Header>
|
|
310
|
+
}
|
|
311
|
+
sidebar={<MockSidebar />}
|
|
312
|
+
>
|
|
313
|
+
<div className="space-y-6">
|
|
314
|
+
<div className="flex items-center justify-between">
|
|
315
|
+
<div>
|
|
316
|
+
<h1 className="text-3xl font-bold">Dashboard</h1>
|
|
317
|
+
<p className="text-muted-foreground">Welcome back, John!</p>
|
|
318
|
+
</div>
|
|
319
|
+
<button className="px-4 py-2 bg-primary text-primary-foreground rounded-md text-sm">
|
|
320
|
+
New Report
|
|
321
|
+
</button>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
|
325
|
+
{[
|
|
326
|
+
{ label: 'Total Revenue', value: '$45,231', change: '+20.1%' },
|
|
327
|
+
{ label: 'Active Users', value: '2,350', change: '+15.2%' },
|
|
328
|
+
{ label: 'Pending Orders', value: '12', change: '-4.5%' },
|
|
329
|
+
{ label: 'Conversion Rate', value: '3.2%', change: '+2.1%' },
|
|
330
|
+
].map((stat) => (
|
|
331
|
+
<div key={stat.label} className="p-4 border rounded-lg bg-card">
|
|
332
|
+
<p className="text-sm text-muted-foreground">{stat.label}</p>
|
|
333
|
+
<p className="text-2xl font-bold">{stat.value}</p>
|
|
334
|
+
<p className={`text-xs ${stat.change.startsWith('+') ? 'text-green-500' : 'text-red-500'}`}>
|
|
335
|
+
{stat.change} from last month
|
|
336
|
+
</p>
|
|
337
|
+
</div>
|
|
338
|
+
))}
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
342
|
+
<div className="p-6 border rounded-lg bg-card">
|
|
343
|
+
<h2 className="text-lg font-semibold mb-4">Recent Activity</h2>
|
|
344
|
+
<div className="space-y-3">
|
|
345
|
+
{[1, 2, 3, 4, 5].map((i) => (
|
|
346
|
+
<div key={i} className="flex items-center gap-3 py-2 border-b last:border-0">
|
|
347
|
+
<div className="h-8 w-8 rounded-full bg-muted" />
|
|
348
|
+
<div className="flex-1">
|
|
349
|
+
<p className="text-sm font-medium">User action {i}</p>
|
|
350
|
+
<p className="text-xs text-muted-foreground">{i} hours ago</p>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
))}
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
<div className="p-6 border rounded-lg bg-card">
|
|
357
|
+
<h2 className="text-lg font-semibold mb-4">Quick Actions</h2>
|
|
358
|
+
<div className="grid gap-2">
|
|
359
|
+
{['Create Report', 'Add User', 'Export Data', 'View Logs'].map((action) => (
|
|
360
|
+
<button
|
|
361
|
+
key={action}
|
|
362
|
+
className="w-full p-3 text-left text-sm border rounded-md hover:bg-accent"
|
|
363
|
+
>
|
|
364
|
+
{action}
|
|
365
|
+
</button>
|
|
366
|
+
))}
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
</Layout>
|
|
372
|
+
),
|
|
373
|
+
}
|