@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,434 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { WakaModal, useModal } from './index'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Button } from '../button'
|
|
5
|
+
import { AlertTriangle, CheckCircle, Info, Trash2 } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof WakaModal> = {
|
|
8
|
+
title: 'Components/Display/WakaModal',
|
|
9
|
+
component: WakaModal,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'A modal dialog component with multiple sizes, animations, and customization options.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
argTypes: {
|
|
20
|
+
size: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['sm', 'md', 'lg', 'xl', 'full'],
|
|
23
|
+
description: 'Size of the modal',
|
|
24
|
+
},
|
|
25
|
+
animation: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['fade', 'slide', 'scale', 'none'],
|
|
28
|
+
description: 'Animation style',
|
|
29
|
+
},
|
|
30
|
+
centered: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
description: 'Center modal vertically',
|
|
33
|
+
},
|
|
34
|
+
showCloseButton: {
|
|
35
|
+
control: 'boolean',
|
|
36
|
+
description: 'Show close button',
|
|
37
|
+
},
|
|
38
|
+
closeOnOverlayClick: {
|
|
39
|
+
control: 'boolean',
|
|
40
|
+
description: 'Close when clicking overlay',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default meta
|
|
46
|
+
type Story = StoryObj<typeof WakaModal>
|
|
47
|
+
|
|
48
|
+
export const Default: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
title: 'Modal Title',
|
|
51
|
+
description: 'This is a modal description that provides context.',
|
|
52
|
+
},
|
|
53
|
+
render: (args) => {
|
|
54
|
+
const [open, setOpen] = React.useState(false)
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Button onClick={() => setOpen(true)}>Open Modal</Button>
|
|
58
|
+
<WakaModal
|
|
59
|
+
{...args}
|
|
60
|
+
open={open}
|
|
61
|
+
onOpenChange={setOpen}
|
|
62
|
+
>
|
|
63
|
+
<p>Modal content goes here. You can put any content inside.</p>
|
|
64
|
+
</WakaModal>
|
|
65
|
+
</>
|
|
66
|
+
)
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Sizes: Story = {
|
|
71
|
+
render: () => {
|
|
72
|
+
const [size, setSize] = React.useState<'sm' | 'md' | 'lg' | 'xl' | 'full'>('md')
|
|
73
|
+
const [open, setOpen] = React.useState(false)
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div className="space-y-4">
|
|
77
|
+
<div className="flex gap-2 flex-wrap">
|
|
78
|
+
{(['sm', 'md', 'lg', 'xl', 'full'] as const).map((s) => (
|
|
79
|
+
<Button
|
|
80
|
+
key={s}
|
|
81
|
+
variant={size === s ? 'default' : 'outline'}
|
|
82
|
+
onClick={() => {
|
|
83
|
+
setSize(s)
|
|
84
|
+
setOpen(true)
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{s.toUpperCase()}
|
|
88
|
+
</Button>
|
|
89
|
+
))}
|
|
90
|
+
</div>
|
|
91
|
+
<WakaModal
|
|
92
|
+
open={open}
|
|
93
|
+
onOpenChange={setOpen}
|
|
94
|
+
size={size}
|
|
95
|
+
title={`Size: ${size.toUpperCase()}`}
|
|
96
|
+
description="Demonstrating different modal sizes."
|
|
97
|
+
>
|
|
98
|
+
<p>This modal has size "{size}".</p>
|
|
99
|
+
</WakaModal>
|
|
100
|
+
</div>
|
|
101
|
+
)
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const Animations: Story = {
|
|
106
|
+
render: () => {
|
|
107
|
+
const [animation, setAnimation] = React.useState<'fade' | 'slide' | 'scale' | 'none'>('scale')
|
|
108
|
+
const [open, setOpen] = React.useState(false)
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div className="space-y-4">
|
|
112
|
+
<div className="flex gap-2 flex-wrap">
|
|
113
|
+
{(['fade', 'slide', 'scale', 'none'] as const).map((a) => (
|
|
114
|
+
<Button
|
|
115
|
+
key={a}
|
|
116
|
+
variant={animation === a ? 'default' : 'outline'}
|
|
117
|
+
onClick={() => {
|
|
118
|
+
setAnimation(a)
|
|
119
|
+
setOpen(true)
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
{a.charAt(0).toUpperCase() + a.slice(1)}
|
|
123
|
+
</Button>
|
|
124
|
+
))}
|
|
125
|
+
</div>
|
|
126
|
+
<WakaModal
|
|
127
|
+
open={open}
|
|
128
|
+
onOpenChange={setOpen}
|
|
129
|
+
animation={animation}
|
|
130
|
+
title={`Animation: ${animation}`}
|
|
131
|
+
description="Demonstrating different animation styles."
|
|
132
|
+
>
|
|
133
|
+
<p>This modal uses the "{animation}" animation.</p>
|
|
134
|
+
</WakaModal>
|
|
135
|
+
</div>
|
|
136
|
+
)
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const WithFooter: Story = {
|
|
141
|
+
render: () => {
|
|
142
|
+
const [open, setOpen] = React.useState(false)
|
|
143
|
+
return (
|
|
144
|
+
<>
|
|
145
|
+
<Button onClick={() => setOpen(true)}>Open with Footer</Button>
|
|
146
|
+
<WakaModal
|
|
147
|
+
open={open}
|
|
148
|
+
onOpenChange={setOpen}
|
|
149
|
+
title="Confirm Action"
|
|
150
|
+
description="Are you sure you want to proceed with this action?"
|
|
151
|
+
footer={
|
|
152
|
+
<>
|
|
153
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
154
|
+
Cancel
|
|
155
|
+
</Button>
|
|
156
|
+
<Button onClick={() => setOpen(false)}>
|
|
157
|
+
Confirm
|
|
158
|
+
</Button>
|
|
159
|
+
</>
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
<p>This action cannot be undone. Please make sure you want to continue.</p>
|
|
163
|
+
</WakaModal>
|
|
164
|
+
</>
|
|
165
|
+
)
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const DeleteConfirmation: Story = {
|
|
170
|
+
render: () => {
|
|
171
|
+
const [open, setOpen] = React.useState(false)
|
|
172
|
+
return (
|
|
173
|
+
<>
|
|
174
|
+
<Button variant="destructive" onClick={() => setOpen(true)}>
|
|
175
|
+
<Trash2 className="h-4 w-4 mr-2" />
|
|
176
|
+
Delete Item
|
|
177
|
+
</Button>
|
|
178
|
+
<WakaModal
|
|
179
|
+
open={open}
|
|
180
|
+
onOpenChange={setOpen}
|
|
181
|
+
size="sm"
|
|
182
|
+
title="Delete Item"
|
|
183
|
+
description="This action cannot be undone."
|
|
184
|
+
footer={
|
|
185
|
+
<>
|
|
186
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
187
|
+
Cancel
|
|
188
|
+
</Button>
|
|
189
|
+
<Button variant="destructive" onClick={() => setOpen(false)}>
|
|
190
|
+
Delete
|
|
191
|
+
</Button>
|
|
192
|
+
</>
|
|
193
|
+
}
|
|
194
|
+
>
|
|
195
|
+
<div className="flex items-center gap-3 p-4 bg-destructive/10 rounded-lg">
|
|
196
|
+
<AlertTriangle className="h-6 w-6 text-destructive" />
|
|
197
|
+
<p className="text-sm">
|
|
198
|
+
Are you sure you want to delete this item? This will permanently remove all associated data.
|
|
199
|
+
</p>
|
|
200
|
+
</div>
|
|
201
|
+
</WakaModal>
|
|
202
|
+
</>
|
|
203
|
+
)
|
|
204
|
+
},
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export const SuccessModal: Story = {
|
|
208
|
+
render: () => {
|
|
209
|
+
const [open, setOpen] = React.useState(false)
|
|
210
|
+
return (
|
|
211
|
+
<>
|
|
212
|
+
<Button onClick={() => setOpen(true)}>Show Success</Button>
|
|
213
|
+
<WakaModal
|
|
214
|
+
open={open}
|
|
215
|
+
onOpenChange={setOpen}
|
|
216
|
+
size="sm"
|
|
217
|
+
showCloseButton={false}
|
|
218
|
+
>
|
|
219
|
+
<div className="text-center py-6">
|
|
220
|
+
<div className="mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4">
|
|
221
|
+
<CheckCircle className="h-10 w-10 text-green-600" />
|
|
222
|
+
</div>
|
|
223
|
+
<h3 className="text-lg font-semibold mb-2">Success!</h3>
|
|
224
|
+
<p className="text-muted-foreground mb-6">
|
|
225
|
+
Your changes have been saved successfully.
|
|
226
|
+
</p>
|
|
227
|
+
<Button onClick={() => setOpen(false)} className="w-full">
|
|
228
|
+
Continue
|
|
229
|
+
</Button>
|
|
230
|
+
</div>
|
|
231
|
+
</WakaModal>
|
|
232
|
+
</>
|
|
233
|
+
)
|
|
234
|
+
},
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export const InfoModal: Story = {
|
|
238
|
+
render: () => {
|
|
239
|
+
const [open, setOpen] = React.useState(false)
|
|
240
|
+
return (
|
|
241
|
+
<>
|
|
242
|
+
<Button variant="outline" onClick={() => setOpen(true)}>
|
|
243
|
+
<Info className="h-4 w-4 mr-2" />
|
|
244
|
+
Learn More
|
|
245
|
+
</Button>
|
|
246
|
+
<WakaModal
|
|
247
|
+
open={open}
|
|
248
|
+
onOpenChange={setOpen}
|
|
249
|
+
size="lg"
|
|
250
|
+
title="Feature Overview"
|
|
251
|
+
description="Learn about the new features in this release."
|
|
252
|
+
>
|
|
253
|
+
<div className="space-y-4">
|
|
254
|
+
<div className="p-4 bg-muted rounded-lg">
|
|
255
|
+
<h4 className="font-medium mb-2">Dark Mode Support</h4>
|
|
256
|
+
<p className="text-sm text-muted-foreground">
|
|
257
|
+
Automatically adapts to your system preferences or can be manually toggled.
|
|
258
|
+
</p>
|
|
259
|
+
</div>
|
|
260
|
+
<div className="p-4 bg-muted rounded-lg">
|
|
261
|
+
<h4 className="font-medium mb-2">Keyboard Shortcuts</h4>
|
|
262
|
+
<p className="text-sm text-muted-foreground">
|
|
263
|
+
Navigate faster with our comprehensive keyboard shortcut system.
|
|
264
|
+
</p>
|
|
265
|
+
</div>
|
|
266
|
+
<div className="p-4 bg-muted rounded-lg">
|
|
267
|
+
<h4 className="font-medium mb-2">Export Options</h4>
|
|
268
|
+
<p className="text-sm text-muted-foreground">
|
|
269
|
+
Export your data in multiple formats including CSV, JSON, and PDF.
|
|
270
|
+
</p>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</WakaModal>
|
|
274
|
+
</>
|
|
275
|
+
)
|
|
276
|
+
},
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export const FormModal: Story = {
|
|
280
|
+
render: () => {
|
|
281
|
+
const [open, setOpen] = React.useState(false)
|
|
282
|
+
return (
|
|
283
|
+
<>
|
|
284
|
+
<Button onClick={() => setOpen(true)}>Add New Item</Button>
|
|
285
|
+
<WakaModal
|
|
286
|
+
open={open}
|
|
287
|
+
onOpenChange={setOpen}
|
|
288
|
+
title="Add New Item"
|
|
289
|
+
description="Fill in the details to create a new item."
|
|
290
|
+
stickyFooter
|
|
291
|
+
footer={
|
|
292
|
+
<>
|
|
293
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
294
|
+
Cancel
|
|
295
|
+
</Button>
|
|
296
|
+
<Button onClick={() => setOpen(false)}>
|
|
297
|
+
Create Item
|
|
298
|
+
</Button>
|
|
299
|
+
</>
|
|
300
|
+
}
|
|
301
|
+
>
|
|
302
|
+
<form className="space-y-4">
|
|
303
|
+
<div>
|
|
304
|
+
<label className="text-sm font-medium">Title</label>
|
|
305
|
+
<input
|
|
306
|
+
type="text"
|
|
307
|
+
className="w-full mt-1 px-3 py-2 border rounded-md"
|
|
308
|
+
placeholder="Enter title"
|
|
309
|
+
/>
|
|
310
|
+
</div>
|
|
311
|
+
<div>
|
|
312
|
+
<label className="text-sm font-medium">Category</label>
|
|
313
|
+
<select className="w-full mt-1 px-3 py-2 border rounded-md">
|
|
314
|
+
<option value="">Select a category</option>
|
|
315
|
+
<option value="work">Work</option>
|
|
316
|
+
<option value="personal">Personal</option>
|
|
317
|
+
<option value="other">Other</option>
|
|
318
|
+
</select>
|
|
319
|
+
</div>
|
|
320
|
+
<div>
|
|
321
|
+
<label className="text-sm font-medium">Description</label>
|
|
322
|
+
<textarea
|
|
323
|
+
className="w-full mt-1 px-3 py-2 border rounded-md"
|
|
324
|
+
rows={3}
|
|
325
|
+
placeholder="Enter description"
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
<div className="flex items-center gap-2">
|
|
329
|
+
<input type="checkbox" id="priority" />
|
|
330
|
+
<label htmlFor="priority" className="text-sm">
|
|
331
|
+
Mark as high priority
|
|
332
|
+
</label>
|
|
333
|
+
</div>
|
|
334
|
+
</form>
|
|
335
|
+
</WakaModal>
|
|
336
|
+
</>
|
|
337
|
+
)
|
|
338
|
+
},
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export const ScrollableContent: Story = {
|
|
342
|
+
render: () => {
|
|
343
|
+
const [open, setOpen] = React.useState(false)
|
|
344
|
+
return (
|
|
345
|
+
<>
|
|
346
|
+
<Button onClick={() => setOpen(true)}>Open Scrollable Modal</Button>
|
|
347
|
+
<WakaModal
|
|
348
|
+
open={open}
|
|
349
|
+
onOpenChange={setOpen}
|
|
350
|
+
title="Terms of Service"
|
|
351
|
+
description="Please read and accept our terms."
|
|
352
|
+
stickyHeader
|
|
353
|
+
stickyFooter
|
|
354
|
+
footer={
|
|
355
|
+
<>
|
|
356
|
+
<Button variant="outline" onClick={() => setOpen(false)}>
|
|
357
|
+
Decline
|
|
358
|
+
</Button>
|
|
359
|
+
<Button onClick={() => setOpen(false)}>
|
|
360
|
+
Accept
|
|
361
|
+
</Button>
|
|
362
|
+
</>
|
|
363
|
+
}
|
|
364
|
+
>
|
|
365
|
+
<div className="max-h-[300px] overflow-auto space-y-4 text-sm text-muted-foreground">
|
|
366
|
+
{Array.from({ length: 10 }).map((_, i) => (
|
|
367
|
+
<div key={i}>
|
|
368
|
+
<h4 className="font-medium text-foreground">Section {i + 1}</h4>
|
|
369
|
+
<p>
|
|
370
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
371
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
372
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
373
|
+
aliquip ex ea commodo consequat.
|
|
374
|
+
</p>
|
|
375
|
+
</div>
|
|
376
|
+
))}
|
|
377
|
+
</div>
|
|
378
|
+
</WakaModal>
|
|
379
|
+
</>
|
|
380
|
+
)
|
|
381
|
+
},
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const WithHook: Story = {
|
|
385
|
+
render: () => {
|
|
386
|
+
const modal = useModal({
|
|
387
|
+
onOpenChange: (open) => console.log('Modal state:', open),
|
|
388
|
+
})
|
|
389
|
+
|
|
390
|
+
return (
|
|
391
|
+
<div className="space-y-4">
|
|
392
|
+
<div className="flex gap-2">
|
|
393
|
+
<Button onClick={modal.open}>Open</Button>
|
|
394
|
+
<Button variant="outline" onClick={modal.toggle}>Toggle</Button>
|
|
395
|
+
</div>
|
|
396
|
+
<WakaModal
|
|
397
|
+
open={modal.isOpen}
|
|
398
|
+
onOpenChange={modal.onOpenChange}
|
|
399
|
+
title="Using useModal Hook"
|
|
400
|
+
description="This modal is controlled by the useModal hook."
|
|
401
|
+
>
|
|
402
|
+
<p>The modal state is managed by the hook.</p>
|
|
403
|
+
<Button
|
|
404
|
+
variant="outline"
|
|
405
|
+
className="mt-4"
|
|
406
|
+
onClick={modal.close}
|
|
407
|
+
>
|
|
408
|
+
Close Modal
|
|
409
|
+
</Button>
|
|
410
|
+
</WakaModal>
|
|
411
|
+
</div>
|
|
412
|
+
)
|
|
413
|
+
},
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export const NotCentered: Story = {
|
|
417
|
+
render: () => {
|
|
418
|
+
const [open, setOpen] = React.useState(false)
|
|
419
|
+
return (
|
|
420
|
+
<>
|
|
421
|
+
<Button onClick={() => setOpen(true)}>Open Top-Aligned Modal</Button>
|
|
422
|
+
<WakaModal
|
|
423
|
+
open={open}
|
|
424
|
+
onOpenChange={setOpen}
|
|
425
|
+
centered={false}
|
|
426
|
+
title="Top-Aligned Modal"
|
|
427
|
+
description="This modal appears near the top of the viewport."
|
|
428
|
+
>
|
|
429
|
+
<p>This positioning can be useful for modals that contain long content.</p>
|
|
430
|
+
</WakaModal>
|
|
431
|
+
</>
|
|
432
|
+
)
|
|
433
|
+
},
|
|
434
|
+
}
|