@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,369 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Headtab, Breadcrumb } from './index'
|
|
3
|
+
import type { HeadtabItem, BreadcrumbItem } from './index'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
const defaultItems: HeadtabItem[] = [
|
|
7
|
+
{
|
|
8
|
+
id: 'overview',
|
|
9
|
+
label: 'Overview',
|
|
10
|
+
content: (
|
|
11
|
+
<div className="p-4 border rounded-lg bg-card">
|
|
12
|
+
<h3 className="text-lg font-semibold mb-2">Overview</h3>
|
|
13
|
+
<p className="text-muted-foreground">
|
|
14
|
+
This is the overview tab content. It provides a general summary of the information.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'details',
|
|
21
|
+
label: 'Details',
|
|
22
|
+
content: (
|
|
23
|
+
<div className="p-4 border rounded-lg bg-card">
|
|
24
|
+
<h3 className="text-lg font-semibold mb-2">Details</h3>
|
|
25
|
+
<p className="text-muted-foreground">
|
|
26
|
+
Detailed information about the selected item goes here.
|
|
27
|
+
</p>
|
|
28
|
+
<ul className="mt-4 space-y-2 text-sm">
|
|
29
|
+
<li>• Detail item 1</li>
|
|
30
|
+
<li>• Detail item 2</li>
|
|
31
|
+
<li>• Detail item 3</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'settings',
|
|
38
|
+
label: 'Settings',
|
|
39
|
+
content: (
|
|
40
|
+
<div className="p-4 border rounded-lg bg-card">
|
|
41
|
+
<h3 className="text-lg font-semibold mb-2">Settings</h3>
|
|
42
|
+
<p className="text-muted-foreground">
|
|
43
|
+
Configure your preferences and settings here.
|
|
44
|
+
</p>
|
|
45
|
+
<div className="mt-4 space-y-3">
|
|
46
|
+
<div className="flex items-center justify-between">
|
|
47
|
+
<span className="text-sm">Enable notifications</span>
|
|
48
|
+
<div className="h-5 w-10 bg-muted rounded-full" />
|
|
49
|
+
</div>
|
|
50
|
+
<div className="flex items-center justify-between">
|
|
51
|
+
<span className="text-sm">Dark mode</span>
|
|
52
|
+
<div className="h-5 w-10 bg-primary rounded-full" />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
const manyItems: HeadtabItem[] = [
|
|
61
|
+
{ id: 'tab1', label: 'General', content: <div className="p-4">General content</div> },
|
|
62
|
+
{ id: 'tab2', label: 'Profile', content: <div className="p-4">Profile content</div> },
|
|
63
|
+
{ id: 'tab3', label: 'Security', content: <div className="p-4">Security content</div> },
|
|
64
|
+
{ id: 'tab4', label: 'Notifications', content: <div className="p-4">Notifications content</div> },
|
|
65
|
+
{ id: 'tab5', label: 'Integrations', content: <div className="p-4">Integrations content</div> },
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
const defaultBreadcrumbs: BreadcrumbItem[] = [
|
|
69
|
+
{ label: 'Home', href: '/' },
|
|
70
|
+
{ label: 'Products', href: '/products' },
|
|
71
|
+
{ label: 'Electronics', href: '/products/electronics' },
|
|
72
|
+
{ label: 'Laptops' },
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
const meta: Meta<typeof Headtab> = {
|
|
76
|
+
title: 'Blocks/Headtab',
|
|
77
|
+
component: Headtab,
|
|
78
|
+
parameters: {
|
|
79
|
+
layout: 'centered',
|
|
80
|
+
docs: {
|
|
81
|
+
description: {
|
|
82
|
+
component:
|
|
83
|
+
'A header tab navigation component with multiple variants (default, pills, underline) and sizes.',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
tags: ['autodocs'],
|
|
88
|
+
argTypes: {
|
|
89
|
+
variant: {
|
|
90
|
+
control: 'select',
|
|
91
|
+
options: ['default', 'pills', 'underline'],
|
|
92
|
+
},
|
|
93
|
+
size: {
|
|
94
|
+
control: 'select',
|
|
95
|
+
options: ['sm', 'md', 'lg'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default meta
|
|
101
|
+
type Story = StoryObj<typeof Headtab>
|
|
102
|
+
|
|
103
|
+
export const Default: Story = {
|
|
104
|
+
render: () => (
|
|
105
|
+
<div className="w-[600px]">
|
|
106
|
+
<Headtab
|
|
107
|
+
items={defaultItems}
|
|
108
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const PillsVariant: Story = {
|
|
115
|
+
render: () => (
|
|
116
|
+
<div className="w-[600px]">
|
|
117
|
+
<Headtab
|
|
118
|
+
items={defaultItems}
|
|
119
|
+
variant="pills"
|
|
120
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
),
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const UnderlineVariant: Story = {
|
|
127
|
+
render: () => (
|
|
128
|
+
<div className="w-[600px]">
|
|
129
|
+
<Headtab
|
|
130
|
+
items={defaultItems}
|
|
131
|
+
variant="underline"
|
|
132
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
),
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const SmallSize: Story = {
|
|
139
|
+
render: () => (
|
|
140
|
+
<div className="w-[600px]">
|
|
141
|
+
<Headtab
|
|
142
|
+
items={defaultItems}
|
|
143
|
+
size="sm"
|
|
144
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
),
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const LargeSize: Story = {
|
|
151
|
+
render: () => (
|
|
152
|
+
<div className="w-[600px]">
|
|
153
|
+
<Headtab
|
|
154
|
+
items={defaultItems}
|
|
155
|
+
size="lg"
|
|
156
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
),
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export const ManyTabs: Story = {
|
|
163
|
+
render: () => (
|
|
164
|
+
<div className="w-[700px]">
|
|
165
|
+
<Headtab
|
|
166
|
+
items={manyItems}
|
|
167
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
),
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const WithDisabled: Story = {
|
|
174
|
+
render: () => {
|
|
175
|
+
const itemsWithDisabled: HeadtabItem[] = [
|
|
176
|
+
...defaultItems,
|
|
177
|
+
{
|
|
178
|
+
id: 'premium',
|
|
179
|
+
label: 'Premium',
|
|
180
|
+
disabled: true,
|
|
181
|
+
content: <div>Premium content</div>,
|
|
182
|
+
},
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<div className="w-[600px]">
|
|
187
|
+
<Headtab
|
|
188
|
+
items={itemsWithDisabled}
|
|
189
|
+
onTabChange={(id) => console.log('Tab changed:', id)}
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
)
|
|
193
|
+
},
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const ControlledActive: Story = {
|
|
197
|
+
render: () => {
|
|
198
|
+
const [activeTab, setActiveTab] = React.useState('details')
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<div className="w-[600px]">
|
|
202
|
+
<div className="mb-4 flex gap-2">
|
|
203
|
+
{defaultItems.map((item) => (
|
|
204
|
+
<button
|
|
205
|
+
key={item.id}
|
|
206
|
+
onClick={() => setActiveTab(item.id)}
|
|
207
|
+
className={`px-3 py-1 text-sm rounded ${
|
|
208
|
+
activeTab === item.id ? 'bg-primary text-primary-foreground' : 'bg-muted'
|
|
209
|
+
}`}
|
|
210
|
+
>
|
|
211
|
+
Go to {item.label}
|
|
212
|
+
</button>
|
|
213
|
+
))}
|
|
214
|
+
</div>
|
|
215
|
+
<Headtab
|
|
216
|
+
items={defaultItems}
|
|
217
|
+
defaultActiveId={activeTab}
|
|
218
|
+
onTabChange={setActiveTab}
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
)
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const AllVariants: Story = {
|
|
226
|
+
render: () => (
|
|
227
|
+
<div className="space-y-8 w-[600px]">
|
|
228
|
+
<div>
|
|
229
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Default</h3>
|
|
230
|
+
<Headtab items={defaultItems} variant="default" />
|
|
231
|
+
</div>
|
|
232
|
+
<div>
|
|
233
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Pills</h3>
|
|
234
|
+
<Headtab items={defaultItems} variant="pills" />
|
|
235
|
+
</div>
|
|
236
|
+
<div>
|
|
237
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Underline</h3>
|
|
238
|
+
<Headtab items={defaultItems} variant="underline" />
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
),
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const AllSizes: Story = {
|
|
245
|
+
render: () => (
|
|
246
|
+
<div className="space-y-8 w-[600px]">
|
|
247
|
+
<div>
|
|
248
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Small</h3>
|
|
249
|
+
<Headtab items={defaultItems} size="sm" />
|
|
250
|
+
</div>
|
|
251
|
+
<div>
|
|
252
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Medium (default)</h3>
|
|
253
|
+
<Headtab items={defaultItems} size="md" />
|
|
254
|
+
</div>
|
|
255
|
+
<div>
|
|
256
|
+
<h3 className="text-sm font-medium mb-2 text-muted-foreground">Large</h3>
|
|
257
|
+
<Headtab items={defaultItems} size="lg" />
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
),
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Breadcrumb stories
|
|
264
|
+
export const BreadcrumbDefault: Story = {
|
|
265
|
+
render: () => (
|
|
266
|
+
<div className="w-[600px]">
|
|
267
|
+
<Breadcrumb items={defaultBreadcrumbs} />
|
|
268
|
+
</div>
|
|
269
|
+
),
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export const BreadcrumbCustomSeparator: Story = {
|
|
273
|
+
render: () => (
|
|
274
|
+
<div className="space-y-4 w-[600px]">
|
|
275
|
+
<div>
|
|
276
|
+
<p className="text-sm text-muted-foreground mb-2">Arrow separator</p>
|
|
277
|
+
<Breadcrumb items={defaultBreadcrumbs} separator="›" />
|
|
278
|
+
</div>
|
|
279
|
+
<div>
|
|
280
|
+
<p className="text-sm text-muted-foreground mb-2">Chevron separator</p>
|
|
281
|
+
<Breadcrumb items={defaultBreadcrumbs} separator="»" />
|
|
282
|
+
</div>
|
|
283
|
+
<div>
|
|
284
|
+
<p className="text-sm text-muted-foreground mb-2">Pipe separator</p>
|
|
285
|
+
<Breadcrumb items={defaultBreadcrumbs} separator="|" />
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
),
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const BreadcrumbShort: Story = {
|
|
292
|
+
render: () => (
|
|
293
|
+
<div className="w-[600px]">
|
|
294
|
+
<Breadcrumb
|
|
295
|
+
items={[
|
|
296
|
+
{ label: 'Home', href: '/' },
|
|
297
|
+
{ label: 'Settings' },
|
|
298
|
+
]}
|
|
299
|
+
/>
|
|
300
|
+
</div>
|
|
301
|
+
),
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export const PageWithTabsAndBreadcrumb: Story = {
|
|
305
|
+
render: () => (
|
|
306
|
+
<div className="w-[700px] p-6 border rounded-lg bg-card">
|
|
307
|
+
<Breadcrumb
|
|
308
|
+
items={[
|
|
309
|
+
{ label: 'Dashboard', href: '/' },
|
|
310
|
+
{ label: 'Users', href: '/users' },
|
|
311
|
+
{ label: 'User Settings' },
|
|
312
|
+
]}
|
|
313
|
+
className="mb-4"
|
|
314
|
+
/>
|
|
315
|
+
<h1 className="text-2xl font-bold mb-6">User Settings</h1>
|
|
316
|
+
<Headtab
|
|
317
|
+
items={[
|
|
318
|
+
{
|
|
319
|
+
id: 'profile',
|
|
320
|
+
label: 'Profile',
|
|
321
|
+
content: (
|
|
322
|
+
<div className="space-y-4">
|
|
323
|
+
<div>
|
|
324
|
+
<label className="text-sm font-medium">Name</label>
|
|
325
|
+
<input className="w-full mt-1 p-2 border rounded-md" placeholder="John Doe" />
|
|
326
|
+
</div>
|
|
327
|
+
<div>
|
|
328
|
+
<label className="text-sm font-medium">Email</label>
|
|
329
|
+
<input className="w-full mt-1 p-2 border rounded-md" placeholder="john@example.com" />
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
),
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: 'security',
|
|
336
|
+
label: 'Security',
|
|
337
|
+
content: (
|
|
338
|
+
<div className="space-y-4">
|
|
339
|
+
<div>
|
|
340
|
+
<label className="text-sm font-medium">Current Password</label>
|
|
341
|
+
<input type="password" className="w-full mt-1 p-2 border rounded-md" />
|
|
342
|
+
</div>
|
|
343
|
+
<div>
|
|
344
|
+
<label className="text-sm font-medium">New Password</label>
|
|
345
|
+
<input type="password" className="w-full mt-1 p-2 border rounded-md" />
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
),
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: 'notifications',
|
|
352
|
+
label: 'Notifications',
|
|
353
|
+
content: (
|
|
354
|
+
<div className="space-y-3">
|
|
355
|
+
{['Email notifications', 'Push notifications', 'SMS alerts'].map((label) => (
|
|
356
|
+
<div key={label} className="flex items-center justify-between py-2">
|
|
357
|
+
<span className="text-sm">{label}</span>
|
|
358
|
+
<div className="h-5 w-10 bg-muted rounded-full" />
|
|
359
|
+
</div>
|
|
360
|
+
))}
|
|
361
|
+
</div>
|
|
362
|
+
),
|
|
363
|
+
},
|
|
364
|
+
]}
|
|
365
|
+
variant="underline"
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
),
|
|
369
|
+
}
|