@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,413 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { WakaFileManager, defaultFiles, defaultBreadcrumbs } from './index'
|
|
3
|
+
import type { FileItem, BreadcrumbItem } from './index'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof WakaFileManager> = {
|
|
7
|
+
title: 'Blocks/FileManager',
|
|
8
|
+
component: WakaFileManager,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'A file manager component with grid/list views, breadcrumb navigation, file operations (rename, delete, download), search, and folder creation.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
argTypes: {
|
|
20
|
+
viewMode: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['grid', 'list'],
|
|
23
|
+
},
|
|
24
|
+
showSearch: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
},
|
|
27
|
+
showHeader: {
|
|
28
|
+
control: 'boolean',
|
|
29
|
+
},
|
|
30
|
+
showActions: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
loading: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default meta
|
|
40
|
+
type Story = StoryObj<typeof WakaFileManager>
|
|
41
|
+
|
|
42
|
+
export const Default: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<div className="p-6">
|
|
45
|
+
<WakaFileManager
|
|
46
|
+
files={defaultFiles}
|
|
47
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
48
|
+
onNavigate={(path, folderId) => console.log('Navigate:', path, folderId)}
|
|
49
|
+
onFileOpen={(file) => console.log('Open file:', file)}
|
|
50
|
+
onDownload={(fileIds) => console.log('Download:', fileIds)}
|
|
51
|
+
onDelete={(fileIds) => console.log('Delete:', fileIds)}
|
|
52
|
+
onRename={(fileId, newName) => console.log('Rename:', fileId, newName)}
|
|
53
|
+
onCreateFolder={(name, path) => console.log('Create folder:', name, path)}
|
|
54
|
+
onRefresh={() => console.log('Refresh')}
|
|
55
|
+
onSearch={(query) => console.log('Search:', query)}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const GridView: Story = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<div className="p-6">
|
|
64
|
+
<WakaFileManager
|
|
65
|
+
files={defaultFiles}
|
|
66
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
67
|
+
viewMode="grid"
|
|
68
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
69
|
+
onFileOpen={(file) => console.log('Open:', file)}
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const ListView: Story = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<div className="p-6">
|
|
78
|
+
<WakaFileManager
|
|
79
|
+
files={defaultFiles}
|
|
80
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
81
|
+
viewMode="list"
|
|
82
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
83
|
+
onFileOpen={(file) => console.log('Open:', file)}
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const WithSelection: Story = {
|
|
90
|
+
render: () => {
|
|
91
|
+
const [selectedFiles, setSelectedFiles] = React.useState<string[]>([])
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div className="p-6">
|
|
95
|
+
<WakaFileManager
|
|
96
|
+
files={defaultFiles}
|
|
97
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
98
|
+
selectedFiles={selectedFiles}
|
|
99
|
+
onSelectionChange={setSelectedFiles}
|
|
100
|
+
onDownload={(fileIds) => console.log('Download:', fileIds)}
|
|
101
|
+
onDelete={(fileIds) => {
|
|
102
|
+
console.log('Delete:', fileIds)
|
|
103
|
+
setSelectedFiles([])
|
|
104
|
+
}}
|
|
105
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
)
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const ManyFiles: Story = {
|
|
113
|
+
render: () => {
|
|
114
|
+
const manyFiles: FileItem[] = [
|
|
115
|
+
// Folders
|
|
116
|
+
...['Documents', 'Images', 'Videos', 'Music', 'Downloads', 'Projects'].map((name, i) => ({
|
|
117
|
+
id: `folder-${i}`,
|
|
118
|
+
name,
|
|
119
|
+
type: 'folder' as const,
|
|
120
|
+
path: `/${name}`,
|
|
121
|
+
createdAt: new Date('2024-01-01'),
|
|
122
|
+
modifiedAt: new Date('2024-01-15'),
|
|
123
|
+
})),
|
|
124
|
+
// Files
|
|
125
|
+
...Array.from({ length: 20 }, (_, i) => ({
|
|
126
|
+
id: `file-${i}`,
|
|
127
|
+
name: `Document ${i + 1}.pdf`,
|
|
128
|
+
type: 'document' as const,
|
|
129
|
+
path: `/Document ${i + 1}.pdf`,
|
|
130
|
+
size: Math.floor(Math.random() * 10000000),
|
|
131
|
+
createdAt: new Date('2024-01-01'),
|
|
132
|
+
modifiedAt: new Date(Date.now() - Math.random() * 1000 * 60 * 60 * 24 * 30),
|
|
133
|
+
})),
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<div className="p-6">
|
|
138
|
+
<WakaFileManager
|
|
139
|
+
files={manyFiles}
|
|
140
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
141
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
142
|
+
onFileOpen={(file) => console.log('Open:', file)}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
)
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const MixedFileTypes: Story = {
|
|
150
|
+
render: () => {
|
|
151
|
+
const mixedFiles: FileItem[] = [
|
|
152
|
+
{ id: '1', name: 'Documents', type: 'folder', path: '/Documents', createdAt: new Date(), modifiedAt: new Date() },
|
|
153
|
+
{ id: '2', name: 'report.pdf', type: 'document', path: '/report.pdf', size: 2456000, createdAt: new Date(), modifiedAt: new Date() },
|
|
154
|
+
{ id: '3', name: 'photo.jpg', type: 'image', path: '/photo.jpg', size: 5670000, createdAt: new Date(), modifiedAt: new Date() },
|
|
155
|
+
{ id: '4', name: 'video.mp4', type: 'video', path: '/video.mp4', size: 125000000, createdAt: new Date(), modifiedAt: new Date() },
|
|
156
|
+
{ id: '5', name: 'music.mp3', type: 'audio', path: '/music.mp3', size: 8900000, createdAt: new Date(), modifiedAt: new Date() },
|
|
157
|
+
{ id: '6', name: 'archive.zip', type: 'archive', path: '/archive.zip', size: 45000000, createdAt: new Date(), modifiedAt: new Date() },
|
|
158
|
+
{ id: '7', name: 'script.js', type: 'code', path: '/script.js', size: 12000, createdAt: new Date(), modifiedAt: new Date() },
|
|
159
|
+
{ id: '8', name: 'unknown.xyz', type: 'other', path: '/unknown.xyz', size: 1000, createdAt: new Date(), modifiedAt: new Date() },
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div className="p-6">
|
|
164
|
+
<WakaFileManager
|
|
165
|
+
files={mixedFiles}
|
|
166
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
167
|
+
viewMode="grid"
|
|
168
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
)
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const WithStarredFiles: Story = {
|
|
176
|
+
render: () => {
|
|
177
|
+
const starredFiles: FileItem[] = [
|
|
178
|
+
{ id: '1', name: 'Important Doc.pdf', type: 'document', path: '/Important Doc.pdf', size: 2456000, starred: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
179
|
+
{ id: '2', name: 'Photos', type: 'folder', path: '/Photos', starred: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
180
|
+
{ id: '3', name: 'Project Brief.docx', type: 'document', path: '/Project Brief.docx', size: 156000, starred: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
181
|
+
{ id: '4', name: 'Regular File.txt', type: 'document', path: '/Regular File.txt', size: 5000, createdAt: new Date(), modifiedAt: new Date() },
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<div className="p-6">
|
|
186
|
+
<WakaFileManager
|
|
187
|
+
files={starredFiles}
|
|
188
|
+
breadcrumbs={[{ id: 'starred', name: 'Favoris', path: '/starred' }]}
|
|
189
|
+
onToggleStar={(fileId) => console.log('Toggle star:', fileId)}
|
|
190
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
)
|
|
194
|
+
},
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export const WithSharedFiles: Story = {
|
|
198
|
+
render: () => {
|
|
199
|
+
const sharedFiles: FileItem[] = [
|
|
200
|
+
{ id: '1', name: 'Shared Document.pdf', type: 'document', path: '/Shared Document.pdf', size: 2456000, shared: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
201
|
+
{ id: '2', name: 'Team Folder', type: 'folder', path: '/Team Folder', shared: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
202
|
+
{ id: '3', name: 'Private File.docx', type: 'document', path: '/Private File.docx', size: 156000, createdAt: new Date(), modifiedAt: new Date() },
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div className="p-6">
|
|
207
|
+
<WakaFileManager
|
|
208
|
+
files={sharedFiles}
|
|
209
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
210
|
+
viewMode="list"
|
|
211
|
+
onShare={(fileId) => console.log('Share:', fileId)}
|
|
212
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
)
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export const DeepNavigation: Story = {
|
|
220
|
+
render: () => {
|
|
221
|
+
const deepBreadcrumbs: BreadcrumbItem[] = [
|
|
222
|
+
{ id: 'root', name: 'Mes fichiers', path: '/' },
|
|
223
|
+
{ id: 'projects', name: 'Projects', path: '/Projects' },
|
|
224
|
+
{ id: 'webapp', name: 'WebApp', path: '/Projects/WebApp' },
|
|
225
|
+
{ id: 'src', name: 'src', path: '/Projects/WebApp/src' },
|
|
226
|
+
{ id: 'components', name: 'components', path: '/Projects/WebApp/src/components' },
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
const componentFiles: FileItem[] = [
|
|
230
|
+
{ id: '1', name: 'Button.tsx', type: 'code', path: '/Projects/WebApp/src/components/Button.tsx', size: 2500, createdAt: new Date(), modifiedAt: new Date() },
|
|
231
|
+
{ id: '2', name: 'Input.tsx', type: 'code', path: '/Projects/WebApp/src/components/Input.tsx', size: 3200, createdAt: new Date(), modifiedAt: new Date() },
|
|
232
|
+
{ id: '3', name: 'Card.tsx', type: 'code', path: '/Projects/WebApp/src/components/Card.tsx', size: 1800, createdAt: new Date(), modifiedAt: new Date() },
|
|
233
|
+
{ id: '4', name: 'index.ts', type: 'code', path: '/Projects/WebApp/src/components/index.ts', size: 500, createdAt: new Date(), modifiedAt: new Date() },
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<div className="p-6">
|
|
238
|
+
<WakaFileManager
|
|
239
|
+
files={componentFiles}
|
|
240
|
+
breadcrumbs={deepBreadcrumbs}
|
|
241
|
+
currentPath="/Projects/WebApp/src/components"
|
|
242
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
245
|
+
)
|
|
246
|
+
},
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export const EmptyFolder: Story = {
|
|
250
|
+
render: () => (
|
|
251
|
+
<div className="p-6">
|
|
252
|
+
<WakaFileManager
|
|
253
|
+
files={[]}
|
|
254
|
+
breadcrumbs={[
|
|
255
|
+
{ id: 'root', name: 'Mes fichiers', path: '/' },
|
|
256
|
+
{ id: 'empty', name: 'Dossier vide', path: '/Dossier vide' },
|
|
257
|
+
]}
|
|
258
|
+
onCreateFolder={(name, path) => console.log('Create folder:', name, path)}
|
|
259
|
+
onUpload={(files, path) => console.log('Upload:', files, path)}
|
|
260
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
),
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const Loading: Story = {
|
|
267
|
+
render: () => (
|
|
268
|
+
<div className="p-6">
|
|
269
|
+
<WakaFileManager
|
|
270
|
+
files={[]}
|
|
271
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
272
|
+
loading
|
|
273
|
+
/>
|
|
274
|
+
</div>
|
|
275
|
+
),
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export const NoHeader: Story = {
|
|
279
|
+
render: () => (
|
|
280
|
+
<div className="p-6">
|
|
281
|
+
<WakaFileManager
|
|
282
|
+
files={defaultFiles}
|
|
283
|
+
breadcrumbs={defaultBreadcrumbs}
|
|
284
|
+
showHeader={false}
|
|
285
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
286
|
+
/>
|
|
287
|
+
</div>
|
|
288
|
+
),
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const Interactive: Story = {
|
|
292
|
+
render: () => {
|
|
293
|
+
const [files, setFiles] = React.useState<FileItem[]>(defaultFiles)
|
|
294
|
+
const [selectedFiles, setSelectedFiles] = React.useState<string[]>([])
|
|
295
|
+
const [viewMode, setViewMode] = React.useState<'grid' | 'list'>('grid')
|
|
296
|
+
const [currentPath, setCurrentPath] = React.useState('/')
|
|
297
|
+
const [breadcrumbs, setBreadcrumbs] = React.useState<BreadcrumbItem[]>(defaultBreadcrumbs)
|
|
298
|
+
|
|
299
|
+
const handleNavigate = (path: string, folderId?: string) => {
|
|
300
|
+
console.log('Navigate to:', path)
|
|
301
|
+
setCurrentPath(path)
|
|
302
|
+
setSelectedFiles([])
|
|
303
|
+
|
|
304
|
+
if (path === '/') {
|
|
305
|
+
setBreadcrumbs(defaultBreadcrumbs)
|
|
306
|
+
setFiles(defaultFiles)
|
|
307
|
+
} else {
|
|
308
|
+
const folder = files.find((f) => f.id === folderId)
|
|
309
|
+
if (folder) {
|
|
310
|
+
setBreadcrumbs([
|
|
311
|
+
...defaultBreadcrumbs,
|
|
312
|
+
{ id: folder.id, name: folder.name, path: folder.path },
|
|
313
|
+
])
|
|
314
|
+
// Simulate loading folder contents
|
|
315
|
+
setFiles([
|
|
316
|
+
{ id: 'sub-1', name: 'Subfolder', type: 'folder', path: `${path}/Subfolder`, createdAt: new Date(), modifiedAt: new Date() },
|
|
317
|
+
{ id: 'sub-2', name: 'File in folder.txt', type: 'document', path: `${path}/File.txt`, size: 1234, createdAt: new Date(), modifiedAt: new Date() },
|
|
318
|
+
])
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const handleDelete = (fileIds: string[]) => {
|
|
324
|
+
setFiles((prev) => prev.filter((f) => !fileIds.includes(f.id)))
|
|
325
|
+
setSelectedFiles([])
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const handleRename = (fileId: string, newName: string) => {
|
|
329
|
+
setFiles((prev) =>
|
|
330
|
+
prev.map((f) => (f.id === fileId ? { ...f, name: newName } : f))
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const handleCreateFolder = (name: string) => {
|
|
335
|
+
const newFolder: FileItem = {
|
|
336
|
+
id: `folder-${Date.now()}`,
|
|
337
|
+
name,
|
|
338
|
+
type: 'folder',
|
|
339
|
+
path: `${currentPath}/${name}`,
|
|
340
|
+
createdAt: new Date(),
|
|
341
|
+
modifiedAt: new Date(),
|
|
342
|
+
}
|
|
343
|
+
setFiles((prev) => [...prev, newFolder])
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return (
|
|
347
|
+
<div className="p-6">
|
|
348
|
+
<WakaFileManager
|
|
349
|
+
files={files}
|
|
350
|
+
breadcrumbs={breadcrumbs}
|
|
351
|
+
currentPath={currentPath}
|
|
352
|
+
selectedFiles={selectedFiles}
|
|
353
|
+
onSelectionChange={setSelectedFiles}
|
|
354
|
+
viewMode={viewMode}
|
|
355
|
+
onViewModeChange={setViewMode}
|
|
356
|
+
onNavigate={handleNavigate}
|
|
357
|
+
onFileOpen={(file) => alert(`Opening: ${file.name}`)}
|
|
358
|
+
onDownload={(fileIds) => alert(`Downloading: ${fileIds.join(', ')}`)}
|
|
359
|
+
onDelete={handleDelete}
|
|
360
|
+
onRename={handleRename}
|
|
361
|
+
onCreateFolder={handleCreateFolder}
|
|
362
|
+
onSearch={(query) => console.log('Search:', query)}
|
|
363
|
+
onRefresh={() => console.log('Refresh')}
|
|
364
|
+
onToggleStar={(fileId) => {
|
|
365
|
+
setFiles((prev) =>
|
|
366
|
+
prev.map((f) => (f.id === fileId ? { ...f, starred: !f.starred } : f))
|
|
367
|
+
)
|
|
368
|
+
}}
|
|
369
|
+
/>
|
|
370
|
+
</div>
|
|
371
|
+
)
|
|
372
|
+
},
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export const CloudStorage: Story = {
|
|
376
|
+
render: () => {
|
|
377
|
+
const cloudFiles: FileItem[] = [
|
|
378
|
+
{ id: '1', name: 'Documents', type: 'folder', path: '/Documents', createdAt: new Date(), modifiedAt: new Date() },
|
|
379
|
+
{ id: '2', name: 'Photos', type: 'folder', path: '/Photos', starred: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
380
|
+
{ id: '3', name: 'Shared with me', type: 'folder', path: '/Shared', shared: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
381
|
+
{ id: '4', name: 'Budget 2024.xlsx', type: 'document', path: '/Budget 2024.xlsx', size: 45000, starred: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
382
|
+
{ id: '5', name: 'Meeting Notes.docx', type: 'document', path: '/Meeting Notes.docx', size: 12000, shared: true, createdAt: new Date(), modifiedAt: new Date() },
|
|
383
|
+
]
|
|
384
|
+
|
|
385
|
+
return (
|
|
386
|
+
<div className="min-h-screen bg-muted/30">
|
|
387
|
+
<header className="bg-background border-b px-6 py-4">
|
|
388
|
+
<div className="flex items-center justify-between">
|
|
389
|
+
<span className="font-bold text-xl">Cloud Drive</span>
|
|
390
|
+
<span className="text-sm text-muted-foreground">2.5 GB / 15 GB used</span>
|
|
391
|
+
</div>
|
|
392
|
+
</header>
|
|
393
|
+
<main className="p-6">
|
|
394
|
+
<WakaFileManager
|
|
395
|
+
files={cloudFiles}
|
|
396
|
+
breadcrumbs={[{ id: 'root', name: 'Mon Drive', path: '/' }]}
|
|
397
|
+
onNavigate={(path) => console.log('Navigate:', path)}
|
|
398
|
+
onFileOpen={(file) => console.log('Open:', file)}
|
|
399
|
+
onDownload={(fileIds) => console.log('Download:', fileIds)}
|
|
400
|
+
onDelete={(fileIds) => console.log('Delete:', fileIds)}
|
|
401
|
+
onRename={(fileId, newName) => console.log('Rename:', fileId, newName)}
|
|
402
|
+
onCreateFolder={(name) => console.log('Create folder:', name)}
|
|
403
|
+
onUpload={(files) => console.log('Upload:', files)}
|
|
404
|
+
onShare={(fileId) => console.log('Share:', fileId)}
|
|
405
|
+
onToggleStar={(fileId) => console.log('Toggle star:', fileId)}
|
|
406
|
+
onRefresh={() => console.log('Refresh')}
|
|
407
|
+
onSearch={(query) => console.log('Search:', query)}
|
|
408
|
+
/>
|
|
409
|
+
</main>
|
|
410
|
+
</div>
|
|
411
|
+
)
|
|
412
|
+
},
|
|
413
|
+
}
|