@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.
Files changed (194) hide show
  1. package/dist/blocks/dashboard/index.d.ts +4 -1
  2. package/dist/blocks/empty-states/index.d.ts +4 -1
  3. package/dist/blocks/error-pages/index.d.ts +4 -1
  4. package/dist/blocks/index.d.ts +1 -1
  5. package/dist/blocks/landing/index.d.ts +4 -1
  6. package/dist/blocks/pricing/index.d.ts +5 -1
  7. package/dist/blocks/sidebar/index.d.ts +5 -1
  8. package/dist/index.cjs.js +130 -130
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.es.js +7905 -7856
  11. package/dist/stories/Button.d.ts +14 -0
  12. package/dist/stories/Button.stories.d.ts +8 -0
  13. package/dist/stories/Header.d.ts +11 -0
  14. package/dist/stories/Header.stories.d.ts +6 -0
  15. package/dist/stories/Page.d.ts +2 -0
  16. package/dist/stories/Page.stories.d.ts +6 -0
  17. package/dist/types/index.d.ts +1 -0
  18. package/dist/types/link.d.ts +23 -0
  19. package/package.json +11 -3
  20. package/src/blocks/activity-timeline/ActivityTimeline.stories.tsx +460 -0
  21. package/src/blocks/apm-overview/APMOverview.stories.tsx +435 -0
  22. package/src/blocks/auth-2fa/Auth2FA.stories.tsx +308 -0
  23. package/src/blocks/calendar-view/CalendarView.stories.tsx +398 -0
  24. package/src/blocks/chat/Chat.stories.tsx +466 -0
  25. package/src/blocks/chat-interface/ChatInterface.stories.tsx +412 -0
  26. package/src/blocks/checkout-flow/CheckoutFlow.stories.tsx +408 -0
  27. package/src/blocks/cicd-builder/CICDBuilder.stories.tsx +499 -0
  28. package/src/blocks/cloud-cost-dashboard/CloudCostDashboard.stories.tsx +356 -0
  29. package/src/blocks/container-orchestrator/ContainerOrchestrator.stories.tsx +461 -0
  30. package/src/blocks/dashboard/Dashboard.stories.tsx +559 -0
  31. package/src/blocks/dashboard/index.tsx +68 -27
  32. package/src/blocks/dashboard-kpi/DashboardKPI.stories.tsx +422 -0
  33. package/src/blocks/database-admin/DatabaseAdmin.stories.tsx +393 -0
  34. package/src/blocks/deployment-dashboard/DeploymentDashboard.stories.tsx +457 -0
  35. package/src/blocks/empty-states/EmptyStates.stories.tsx +467 -0
  36. package/src/blocks/empty-states/index.tsx +26 -8
  37. package/src/blocks/error-pages/ErrorPages.stories.tsx +401 -0
  38. package/src/blocks/error-pages/index.tsx +26 -8
  39. package/src/blocks/faq/FAQ.stories.tsx +416 -0
  40. package/src/blocks/file-manager/FileManager.stories.tsx +413 -0
  41. package/src/blocks/footer/Footer.stories.tsx +328 -0
  42. package/src/blocks/gitops-sync-status/GitOpsSyncStatus.stories.tsx +529 -0
  43. package/src/blocks/header/WakaHeader.stories.tsx +455 -0
  44. package/src/blocks/headtab/Headtab.stories.tsx +369 -0
  45. package/src/blocks/i18n-editor/I18nEditor.stories.tsx +451 -0
  46. package/src/blocks/incident-manager/IncidentManager.stories.tsx +464 -0
  47. package/src/blocks/index.ts +1 -1
  48. package/src/blocks/infrastructure-map/InfrastructureMap.stories.tsx +533 -0
  49. package/src/blocks/kanban-board/KanbanBoard.stories.tsx +494 -0
  50. package/src/blocks/landing/WakaLanding.stories.tsx +449 -0
  51. package/src/blocks/landing/index.tsx +125 -66
  52. package/src/blocks/language-selector/LanguageSelector.stories.tsx +345 -0
  53. package/src/blocks/layout/Layout.stories.tsx +373 -0
  54. package/src/blocks/login/Login.stories.tsx +443 -0
  55. package/src/blocks/on-call-schedule/OnCallSchedule.stories.tsx +381 -0
  56. package/src/blocks/player-profile/PlayerProfile.stories.tsx +316 -0
  57. package/src/blocks/pricing/WakaPricing.stories.tsx +530 -0
  58. package/src/blocks/pricing/index.tsx +38 -4
  59. package/src/blocks/profile/Profile.stories.tsx +371 -0
  60. package/src/blocks/release-notes/ReleaseNotes.stories.tsx +431 -0
  61. package/src/blocks/settings/Settings.stories.tsx +520 -0
  62. package/src/blocks/sidebar/WakaSidebar.stories.tsx +513 -0
  63. package/src/blocks/sidebar/index.tsx +49 -20
  64. package/src/blocks/theme-creator-block/ThemeCreatorBlock.stories.tsx +370 -0
  65. package/src/blocks/user-management/UserManagement.stories.tsx +411 -0
  66. package/src/blocks/wizard/Wizard.stories.tsx +683 -0
  67. package/src/components/accordion/Accordion.stories.tsx +93 -0
  68. package/src/components/alert/Alert.stories.tsx +95 -0
  69. package/src/components/alert-dialog/AlertDialog.stories.tsx +126 -0
  70. package/src/components/aspect-ratio/AspectRatio.stories.tsx +118 -0
  71. package/src/components/avatar/Avatar.stories.tsx +104 -0
  72. package/src/components/button/Button.stories.tsx +12 -1
  73. package/src/components/calendar/Calendar.stories.tsx +102 -0
  74. package/src/components/card/Card.stories.tsx +125 -0
  75. package/src/components/checkbox/Checkbox.stories.tsx +100 -0
  76. package/src/components/code/Code.stories.tsx +402 -0
  77. package/src/components/collapsible/Collapsible.stories.tsx +123 -0
  78. package/src/components/command/Command.stories.tsx +207 -0
  79. package/src/components/context-menu/ContextMenu.stories.tsx +220 -0
  80. package/src/components/dialog/Dialog.stories.tsx +157 -0
  81. package/src/components/dropdown-menu/DropdownMenu.stories.tsx +225 -0
  82. package/src/components/form/Form.stories.tsx +413 -0
  83. package/src/components/hover-card/HoverCard.stories.tsx +148 -0
  84. package/src/components/input-otp/InputOTP.stories.tsx +255 -0
  85. package/src/components/label/Label.stories.tsx +68 -0
  86. package/src/components/menubar/Menubar.stories.tsx +278 -0
  87. package/src/components/navigation-menu/NavigationMenu.stories.tsx +202 -0
  88. package/src/components/popover/Popover.stories.tsx +199 -0
  89. package/src/components/progress/Progress.stories.tsx +104 -0
  90. package/src/components/radio-group/RadioGroup.stories.tsx +138 -0
  91. package/src/components/scroll-area/ScrollArea.stories.tsx +153 -0
  92. package/src/components/select/Select.stories.tsx +146 -0
  93. package/src/components/separator/Separator.stories.tsx +117 -0
  94. package/src/components/sheet/Sheet.stories.tsx +195 -0
  95. package/src/components/skeleton/Skeleton.stories.tsx +114 -0
  96. package/src/components/slider/Slider.stories.tsx +157 -0
  97. package/src/components/switch/Switch.stories.tsx +114 -0
  98. package/src/components/table/Table.stories.tsx +153 -0
  99. package/src/components/tabs/Tabs.stories.tsx +155 -0
  100. package/src/components/textarea/Textarea.stories.tsx +116 -0
  101. package/src/components/toast/Toast.stories.tsx +160 -0
  102. package/src/components/toggle/Toggle.stories.tsx +125 -0
  103. package/src/components/tooltip/Tooltip.stories.tsx +133 -0
  104. package/src/components/typography/Typography.stories.tsx +207 -0
  105. package/src/components/waka-3d-pie-chart/Waka3DPieChart.stories.tsx +308 -0
  106. package/src/components/waka-achievement-unlock/WakaAchievementUnlock.stories.tsx +353 -0
  107. package/src/components/waka-artifact-list/WakaArtifactList.stories.tsx +258 -0
  108. package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +224 -0
  109. package/src/components/waka-badge-showcase/WakaBadgeShowcase.stories.tsx +269 -0
  110. package/src/components/waka-barcode/WakaBarcode.stories.tsx +227 -0
  111. package/src/components/waka-bottom-sheet/WakaBottomSheet.stories.tsx +408 -0
  112. package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +237 -0
  113. package/src/components/waka-build-matrix/WakaBuildMatrix.stories.tsx +328 -0
  114. package/src/components/waka-carousel/WakaCarousel.stories.tsx +296 -0
  115. package/src/components/waka-charts/WakaCharts.stories.tsx +519 -0
  116. package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +200 -0
  117. package/src/components/waka-combobox/WakaCombobox.stories.tsx +250 -0
  118. package/src/components/waka-container-list/WakaContainerList.stories.tsx +315 -0
  119. package/src/components/waka-contribution-graph/WakaContributionGraph.stories.tsx +354 -0
  120. package/src/components/waka-cost-breakdown/WakaCostBreakdown.stories.tsx +348 -0
  121. package/src/components/waka-daily-reward/WakaDailyReward.stories.tsx +365 -0
  122. package/src/components/waka-database-card/WakaDatabaseCard.stories.tsx +306 -0
  123. package/src/components/waka-date-range-picker/WakaDateRangePicker.stories.tsx +339 -0
  124. package/src/components/waka-datetime-picker/WakaDateTimePicker.stories.tsx +317 -0
  125. package/src/components/waka-deployment-lane/WakaDeploymentLane.stories.tsx +292 -0
  126. package/src/components/waka-dock/WakaDock.stories.tsx +332 -0
  127. package/src/components/waka-drawer/WakaDrawer.stories.tsx +437 -0
  128. package/src/components/waka-env-var-editor/WakaEnvVarEditor.stories.tsx +263 -0
  129. package/src/components/waka-error-shake/WakaErrorShake.stories.tsx +410 -0
  130. package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +239 -0
  131. package/src/components/waka-flow-diagram/WakaFlowDiagram.stories.tsx +365 -0
  132. package/src/components/waka-funnel-chart/WakaFunnelChart.stories.tsx +281 -0
  133. package/src/components/waka-glow-card/WakaGlowCard.stories.tsx +274 -0
  134. package/src/components/waka-haptic-button/WakaHapticButton.stories.tsx +349 -0
  135. package/src/components/waka-health-pulse/WakaHealthPulse.stories.tsx +293 -0
  136. package/src/components/waka-heatmap/WakaHeatmap.stories.tsx +376 -0
  137. package/src/components/waka-image/WakaImage.stories.tsx +255 -0
  138. package/src/components/waka-incident-timeline/WakaIncidentTimeline.stories.tsx +300 -0
  139. package/src/components/waka-kanban/WakaKanban.stories.tsx +399 -0
  140. package/src/components/waka-kubernetes-overview/WakaKubernetesOverview.stories.tsx +281 -0
  141. package/src/components/waka-leaderboard/WakaLeaderboard.stories.tsx +300 -0
  142. package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +313 -0
  143. package/src/components/waka-loading-orbit/WakaLoadingOrbit.stories.tsx +413 -0
  144. package/src/components/waka-log-viewer/WakaLogViewer.stories.tsx +312 -0
  145. package/src/components/waka-loot-box/WakaLootBox.stories.tsx +374 -0
  146. package/src/components/waka-metric-sparkline/WakaMetricSparkline.stories.tsx +312 -0
  147. package/src/components/waka-migration-list/WakaMigrationList.stories.tsx +289 -0
  148. package/src/components/waka-modal/WakaModal.stories.tsx +434 -0
  149. package/src/components/waka-morph-button/WakaMorphButton.stories.tsx +405 -0
  150. package/src/components/waka-network-topology/WakaNetworkTopology.stories.tsx +364 -0
  151. package/src/components/waka-notifications/WakaNotifications.stories.tsx +290 -0
  152. package/src/components/waka-number-input/WakaNumberInput.stories.tsx +282 -0
  153. package/src/components/waka-pagination/WakaPagination.stories.tsx +328 -0
  154. package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +318 -0
  155. package/src/components/waka-pipeline-view/WakaPipelineView.stories.tsx +386 -0
  156. package/src/components/waka-player-card/WakaPlayerCard.stories.tsx +333 -0
  157. package/src/components/waka-pod-card/WakaPodCard.stories.tsx +435 -0
  158. package/src/components/waka-qrcode/WakaQRCode.stories.tsx +232 -0
  159. package/src/components/waka-query-explain/WakaQueryExplain.stories.tsx +407 -0
  160. package/src/components/waka-quest-card/WakaQuestCard.stories.tsx +394 -0
  161. package/src/components/waka-quota-bar/WakaQuotaBar.stories.tsx +435 -0
  162. package/src/components/waka-radar-score/WakaRadarScore.stories.tsx +372 -0
  163. package/src/components/waka-resource-gauge/WakaResourceGauge.stories.tsx +366 -0
  164. package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +238 -0
  165. package/src/components/waka-sankey-diagram/WakaSankeyDiagram.stories.tsx +389 -0
  166. package/src/components/waka-scratch-card/WakaScratchCard.stories.tsx +388 -0
  167. package/src/components/waka-secret-card/WakaSecretCard.stories.tsx +314 -0
  168. package/src/components/waka-segmented-control/WakaSegmentedControl.stories.tsx +309 -0
  169. package/src/components/waka-server-rack/WakaServerRack.stories.tsx +382 -0
  170. package/src/components/waka-service-graph/WakaServiceGraph.stories.tsx +262 -0
  171. package/src/components/waka-skeleton-wave/WakaSkeletonWave.stories.tsx +321 -0
  172. package/src/components/waka-skill-tree/WakaSkillTree.stories.tsx +308 -0
  173. package/src/components/waka-spin-wheel/WakaSpinWheel.stories.tsx +368 -0
  174. package/src/components/waka-spinner/WakaSpinner.stories.tsx +156 -0
  175. package/src/components/waka-stat/WakaStat.stories.tsx +334 -0
  176. package/src/components/waka-status-matrix/WakaStatusMatrix.stories.tsx +331 -0
  177. package/src/components/waka-stepper/WakaStepper.stories.tsx +468 -0
  178. package/src/components/waka-streak-counter/WakaStreakCounter.stories.tsx +235 -0
  179. package/src/components/waka-success-explosion/WakaSuccessExplosion.stories.tsx +389 -0
  180. package/src/components/waka-tabs-morph/WakaTabsMorph.stories.tsx +471 -0
  181. package/src/components/waka-terminal-output/WakaTerminalOutput.stories.tsx +351 -0
  182. package/src/components/waka-test-report/WakaTestReport.stories.tsx +322 -0
  183. package/src/components/waka-tilt-card/WakaTiltCard.stories.tsx +300 -0
  184. package/src/components/waka-time-picker/WakaTimePicker.stories.tsx +227 -0
  185. package/src/components/waka-timeline/WakaTimeline.stories.tsx +383 -0
  186. package/src/components/waka-tournament-bracket/WakaTournamentBracket.stories.tsx +375 -0
  187. package/src/components/waka-trace-viewer/WakaTraceViewer.stories.tsx +445 -0
  188. package/src/components/waka-tree/WakaTree.stories.tsx +359 -0
  189. package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +378 -0
  190. package/src/components/waka-typewriter/WakaTypewriter.stories.tsx +366 -0
  191. package/src/components/waka-versus-card/WakaVersusCard.stories.tsx +530 -0
  192. package/src/components/waka-video/WakaVideo.stories.tsx +203 -0
  193. package/src/components/waka-virtual-list/WakaVirtualList.stories.tsx +273 -0
  194. package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +305 -0
@@ -0,0 +1,468 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { WakaStepper, StepperNavigation } from './index'
3
+ import type { Step } from './index'
4
+ import * as React from 'react'
5
+ import { User, CreditCard, CheckCircle, Package, Truck, MapPin } from 'lucide-react'
6
+
7
+ const meta: Meta<typeof WakaStepper> = {
8
+ title: 'Components/Display/WakaStepper',
9
+ component: WakaStepper,
10
+ parameters: {
11
+ layout: 'centered',
12
+ docs: {
13
+ description: {
14
+ component: 'A step wizard component for multi-step forms and processes with progress tracking.',
15
+ },
16
+ },
17
+ },
18
+ tags: ['autodocs'],
19
+ argTypes: {
20
+ orientation: {
21
+ control: 'select',
22
+ options: ['horizontal', 'vertical'],
23
+ description: 'Stepper orientation',
24
+ },
25
+ variant: {
26
+ control: 'select',
27
+ options: ['default', 'simple', 'numbered'],
28
+ description: 'Visual variant',
29
+ },
30
+ size: {
31
+ control: 'select',
32
+ options: ['sm', 'md', 'lg'],
33
+ description: 'Size of the stepper',
34
+ },
35
+ clickable: {
36
+ control: 'boolean',
37
+ description: 'Allow clicking on steps',
38
+ },
39
+ },
40
+ }
41
+
42
+ export default meta
43
+ type Story = StoryObj<typeof WakaStepper>
44
+
45
+ const basicSteps: Step[] = [
46
+ {
47
+ id: 'step-1',
48
+ title: 'Account',
49
+ description: 'Create your account',
50
+ },
51
+ {
52
+ id: 'step-2',
53
+ title: 'Profile',
54
+ description: 'Set up your profile',
55
+ },
56
+ {
57
+ id: 'step-3',
58
+ title: 'Preferences',
59
+ description: 'Configure settings',
60
+ },
61
+ {
62
+ id: 'step-4',
63
+ title: 'Complete',
64
+ description: 'Review and finish',
65
+ },
66
+ ]
67
+
68
+ export const Default: Story = {
69
+ args: {
70
+ steps: basicSteps,
71
+ },
72
+ render: (args) => {
73
+ const [currentStep, setCurrentStep] = React.useState(1)
74
+ return (
75
+ <div className="w-[700px]">
76
+ <WakaStepper
77
+ {...args}
78
+ currentStep={currentStep}
79
+ onStepChange={setCurrentStep}
80
+ />
81
+ <div className="mt-8 flex justify-between">
82
+ <button
83
+ onClick={() => setCurrentStep(Math.max(0, currentStep - 1))}
84
+ disabled={currentStep === 0}
85
+ className="px-4 py-2 border rounded disabled:opacity-50"
86
+ >
87
+ Previous
88
+ </button>
89
+ <button
90
+ onClick={() => setCurrentStep(Math.min(basicSteps.length - 1, currentStep + 1))}
91
+ disabled={currentStep === basicSteps.length - 1}
92
+ className="px-4 py-2 bg-primary text-primary-foreground rounded disabled:opacity-50"
93
+ >
94
+ Next
95
+ </button>
96
+ </div>
97
+ </div>
98
+ )
99
+ },
100
+ }
101
+
102
+ export const Vertical: Story = {
103
+ render: () => {
104
+ const [currentStep, setCurrentStep] = React.useState(1)
105
+ return (
106
+ <div className="w-[400px]">
107
+ <WakaStepper
108
+ steps={basicSteps}
109
+ currentStep={currentStep}
110
+ onStepChange={setCurrentStep}
111
+ orientation="vertical"
112
+ clickable
113
+ allowPrevious
114
+ />
115
+ </div>
116
+ )
117
+ },
118
+ }
119
+
120
+ export const Variants: Story = {
121
+ render: () => {
122
+ const [currentStep, setCurrentStep] = React.useState(1)
123
+ return (
124
+ <div className="space-y-12 w-[700px]">
125
+ <div>
126
+ <p className="text-sm text-muted-foreground mb-4">Default (Numbered)</p>
127
+ <WakaStepper
128
+ steps={basicSteps}
129
+ currentStep={currentStep}
130
+ variant="default"
131
+ />
132
+ </div>
133
+ <div>
134
+ <p className="text-sm text-muted-foreground mb-4">Simple (Dots)</p>
135
+ <WakaStepper
136
+ steps={basicSteps}
137
+ currentStep={currentStep}
138
+ variant="simple"
139
+ />
140
+ </div>
141
+ <div>
142
+ <p className="text-sm text-muted-foreground mb-4">Numbered</p>
143
+ <WakaStepper
144
+ steps={basicSteps}
145
+ currentStep={currentStep}
146
+ variant="numbered"
147
+ />
148
+ </div>
149
+ </div>
150
+ )
151
+ },
152
+ }
153
+
154
+ export const Sizes: Story = {
155
+ render: () => {
156
+ const [currentStep, setCurrentStep] = React.useState(1)
157
+ return (
158
+ <div className="space-y-12 w-[700px]">
159
+ <div>
160
+ <p className="text-sm text-muted-foreground mb-4">Small</p>
161
+ <WakaStepper
162
+ steps={basicSteps}
163
+ currentStep={currentStep}
164
+ size="sm"
165
+ />
166
+ </div>
167
+ <div>
168
+ <p className="text-sm text-muted-foreground mb-4">Medium</p>
169
+ <WakaStepper
170
+ steps={basicSteps}
171
+ currentStep={currentStep}
172
+ size="md"
173
+ />
174
+ </div>
175
+ <div>
176
+ <p className="text-sm text-muted-foreground mb-4">Large</p>
177
+ <WakaStepper
178
+ steps={basicSteps}
179
+ currentStep={currentStep}
180
+ size="lg"
181
+ />
182
+ </div>
183
+ </div>
184
+ )
185
+ },
186
+ }
187
+
188
+ export const WithIcons: Story = {
189
+ render: () => {
190
+ const stepsWithIcons: Step[] = [
191
+ {
192
+ id: 'account',
193
+ title: 'Account',
194
+ description: 'Create account',
195
+ icon: <User className="h-4 w-4" />,
196
+ },
197
+ {
198
+ id: 'payment',
199
+ title: 'Payment',
200
+ description: 'Add payment method',
201
+ icon: <CreditCard className="h-4 w-4" />,
202
+ },
203
+ {
204
+ id: 'confirm',
205
+ title: 'Confirm',
206
+ description: 'Review order',
207
+ icon: <CheckCircle className="h-4 w-4" />,
208
+ },
209
+ ]
210
+
211
+ const [currentStep, setCurrentStep] = React.useState(1)
212
+ return (
213
+ <div className="w-[600px]">
214
+ <WakaStepper
215
+ steps={stepsWithIcons}
216
+ currentStep={currentStep}
217
+ onStepChange={setCurrentStep}
218
+ />
219
+ </div>
220
+ )
221
+ },
222
+ }
223
+
224
+ export const Clickable: Story = {
225
+ render: () => {
226
+ const [currentStep, setCurrentStep] = React.useState(2)
227
+ return (
228
+ <div className="w-[700px]">
229
+ <p className="text-sm text-muted-foreground mb-4">Click on any completed step to navigate</p>
230
+ <WakaStepper
231
+ steps={basicSteps}
232
+ currentStep={currentStep}
233
+ onStepChange={setCurrentStep}
234
+ clickable
235
+ allowPrevious
236
+ />
237
+ </div>
238
+ )
239
+ },
240
+ }
241
+
242
+ export const WithContent: Story = {
243
+ render: () => {
244
+ const stepsWithContent: Step[] = [
245
+ {
246
+ id: 'step-1',
247
+ title: 'Personal Info',
248
+ description: 'Enter your details',
249
+ content: (
250
+ <div className="space-y-4">
251
+ <div>
252
+ <label className="text-sm font-medium">Name</label>
253
+ <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="John Doe" />
254
+ </div>
255
+ <div>
256
+ <label className="text-sm font-medium">Email</label>
257
+ <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="john@example.com" />
258
+ </div>
259
+ </div>
260
+ ),
261
+ },
262
+ {
263
+ id: 'step-2',
264
+ title: 'Address',
265
+ description: 'Shipping address',
266
+ content: (
267
+ <div className="space-y-4">
268
+ <div>
269
+ <label className="text-sm font-medium">Street</label>
270
+ <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="123 Main St" />
271
+ </div>
272
+ <div className="grid grid-cols-2 gap-4">
273
+ <div>
274
+ <label className="text-sm font-medium">City</label>
275
+ <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="City" />
276
+ </div>
277
+ <div>
278
+ <label className="text-sm font-medium">ZIP</label>
279
+ <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="12345" />
280
+ </div>
281
+ </div>
282
+ </div>
283
+ ),
284
+ },
285
+ {
286
+ id: 'step-3',
287
+ title: 'Review',
288
+ description: 'Confirm details',
289
+ content: (
290
+ <div className="text-center py-8">
291
+ <CheckCircle className="h-12 w-12 text-green-500 mx-auto mb-4" />
292
+ <h3 className="font-semibold">All set!</h3>
293
+ <p className="text-muted-foreground">Review your information and submit.</p>
294
+ </div>
295
+ ),
296
+ },
297
+ ]
298
+
299
+ const [currentStep, setCurrentStep] = React.useState(0)
300
+ return (
301
+ <div className="w-[600px]">
302
+ <WakaStepper
303
+ steps={stepsWithContent}
304
+ currentStep={currentStep}
305
+ onStepChange={setCurrentStep}
306
+ showContent
307
+ />
308
+ <StepperNavigation
309
+ onFinish={currentStep === stepsWithContent.length - 1 ? () => alert('Submitted!') : undefined}
310
+ finishLabel="Submit"
311
+ />
312
+ </div>
313
+ )
314
+ },
315
+ }
316
+
317
+ export const OrderTracking: Story = {
318
+ render: () => {
319
+ const orderSteps: Step[] = [
320
+ {
321
+ id: 'ordered',
322
+ title: 'Order Placed',
323
+ description: 'Jan 15, 2024',
324
+ icon: <Package className="h-4 w-4" />,
325
+ },
326
+ {
327
+ id: 'shipped',
328
+ title: 'Shipped',
329
+ description: 'Jan 16, 2024',
330
+ icon: <Truck className="h-4 w-4" />,
331
+ },
332
+ {
333
+ id: 'delivery',
334
+ title: 'Out for Delivery',
335
+ description: 'Jan 18, 2024',
336
+ icon: <MapPin className="h-4 w-4" />,
337
+ },
338
+ {
339
+ id: 'delivered',
340
+ title: 'Delivered',
341
+ description: 'Expected Jan 18',
342
+ icon: <CheckCircle className="h-4 w-4" />,
343
+ },
344
+ ]
345
+
346
+ return (
347
+ <div className="border rounded-lg p-6 w-[700px]">
348
+ <h3 className="font-semibold text-lg mb-6">Order #ORD-2024-001</h3>
349
+ <WakaStepper
350
+ steps={orderSteps}
351
+ currentStep={2}
352
+ />
353
+ </div>
354
+ )
355
+ },
356
+ }
357
+
358
+ export const VerticalWithContent: Story = {
359
+ render: () => {
360
+ const setupSteps: Step[] = [
361
+ {
362
+ id: 'connect',
363
+ title: 'Connect Repository',
364
+ description: 'Link your GitHub repo',
365
+ content: (
366
+ <button className="w-full py-2 border rounded-md hover:bg-muted">
367
+ Connect GitHub
368
+ </button>
369
+ ),
370
+ },
371
+ {
372
+ id: 'configure',
373
+ title: 'Configure Build',
374
+ description: 'Set build settings',
375
+ content: (
376
+ <div className="space-y-2">
377
+ <input className="w-full px-3 py-2 border rounded-md" placeholder="Build command" />
378
+ <input className="w-full px-3 py-2 border rounded-md" placeholder="Output directory" />
379
+ </div>
380
+ ),
381
+ },
382
+ {
383
+ id: 'deploy',
384
+ title: 'Deploy',
385
+ description: 'Launch your project',
386
+ content: (
387
+ <button className="w-full py-2 bg-primary text-primary-foreground rounded-md">
388
+ Deploy Now
389
+ </button>
390
+ ),
391
+ },
392
+ ]
393
+
394
+ const [currentStep, setCurrentStep] = React.useState(1)
395
+ return (
396
+ <div className="w-[400px]">
397
+ <WakaStepper
398
+ steps={setupSteps}
399
+ currentStep={currentStep}
400
+ onStepChange={setCurrentStep}
401
+ orientation="vertical"
402
+ showContent
403
+ clickable
404
+ />
405
+ </div>
406
+ )
407
+ },
408
+ }
409
+
410
+ export const OptionalSteps: Story = {
411
+ render: () => {
412
+ const stepsWithOptional: Step[] = [
413
+ {
414
+ id: 'required-1',
415
+ title: 'Basic Info',
416
+ description: 'Required',
417
+ },
418
+ {
419
+ id: 'optional-1',
420
+ title: 'Additional Details',
421
+ description: 'Optional step',
422
+ optional: true,
423
+ },
424
+ {
425
+ id: 'required-2',
426
+ title: 'Confirmation',
427
+ description: 'Required',
428
+ },
429
+ ]
430
+
431
+ const [currentStep, setCurrentStep] = React.useState(0)
432
+ return (
433
+ <div className="w-[600px]">
434
+ <WakaStepper
435
+ steps={stepsWithOptional}
436
+ currentStep={currentStep}
437
+ onStepChange={setCurrentStep}
438
+ />
439
+ <div className="mt-8 flex justify-between">
440
+ <button
441
+ onClick={() => setCurrentStep(Math.max(0, currentStep - 1))}
442
+ disabled={currentStep === 0}
443
+ className="px-4 py-2 border rounded disabled:opacity-50"
444
+ >
445
+ Back
446
+ </button>
447
+ <div className="flex gap-2">
448
+ {stepsWithOptional[currentStep]?.optional && (
449
+ <button
450
+ onClick={() => setCurrentStep(currentStep + 1)}
451
+ className="px-4 py-2 border rounded"
452
+ >
453
+ Skip
454
+ </button>
455
+ )}
456
+ <button
457
+ onClick={() => setCurrentStep(currentStep + 1)}
458
+ disabled={currentStep === stepsWithOptional.length - 1}
459
+ className="px-4 py-2 bg-primary text-primary-foreground rounded disabled:opacity-50"
460
+ >
461
+ Continue
462
+ </button>
463
+ </div>
464
+ </div>
465
+ </div>
466
+ )
467
+ },
468
+ }
@@ -0,0 +1,235 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { WakaStreakCounter } from './index'
3
+ import * as React from 'react'
4
+
5
+ const meta: Meta<typeof WakaStreakCounter> = {
6
+ title: 'Components/Gamification/WakaStreakCounter',
7
+ component: WakaStreakCounter,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component: 'A streak counter with flame animation, confetti celebration, and milestone tracking for gamification.',
13
+ },
14
+ },
15
+ },
16
+ tags: ['autodocs'],
17
+ argTypes: {
18
+ streak: {
19
+ control: { type: 'number', min: 0, max: 365 },
20
+ description: 'Current streak count',
21
+ },
22
+ maxStreak: {
23
+ control: { type: 'number', min: 0, max: 365 },
24
+ description: 'Best streak achieved',
25
+ },
26
+ size: {
27
+ control: 'select',
28
+ options: ['sm', 'md', 'lg'],
29
+ description: 'Size variant',
30
+ },
31
+ variant: {
32
+ control: 'select',
33
+ options: ['default', 'compact', 'detailed'],
34
+ description: 'Display variant',
35
+ },
36
+ animated: {
37
+ control: 'boolean',
38
+ description: 'Enable animations',
39
+ },
40
+ showFlame: {
41
+ control: 'boolean',
42
+ description: 'Show flame animation',
43
+ },
44
+ },
45
+ }
46
+
47
+ export default meta
48
+ type Story = StoryObj<typeof WakaStreakCounter>
49
+
50
+ export const Default: Story = {
51
+ args: {
52
+ streak: 7,
53
+ maxStreak: 14,
54
+ size: 'md',
55
+ variant: 'default',
56
+ animated: true,
57
+ showFlame: true,
58
+ },
59
+ render: (args) => <WakaStreakCounter {...args} />,
60
+ }
61
+
62
+ export const Variants: Story = {
63
+ render: () => (
64
+ <div className="flex flex-wrap gap-6 items-start">
65
+ <div className="text-center">
66
+ <p className="text-sm text-muted-foreground mb-2">Default</p>
67
+ <WakaStreakCounter streak={14} variant="default" />
68
+ </div>
69
+ <div className="text-center">
70
+ <p className="text-sm text-muted-foreground mb-2">Compact</p>
71
+ <WakaStreakCounter streak={14} variant="compact" />
72
+ </div>
73
+ <div className="text-center">
74
+ <p className="text-sm text-muted-foreground mb-2">Detailed</p>
75
+ <WakaStreakCounter streak={14} maxStreak={30} variant="detailed" />
76
+ </div>
77
+ </div>
78
+ ),
79
+ }
80
+
81
+ export const Sizes: Story = {
82
+ render: () => (
83
+ <div className="flex items-end gap-6">
84
+ <div className="text-center">
85
+ <p className="text-sm text-muted-foreground mb-2">Small</p>
86
+ <WakaStreakCounter streak={5} size="sm" />
87
+ </div>
88
+ <div className="text-center">
89
+ <p className="text-sm text-muted-foreground mb-2">Medium</p>
90
+ <WakaStreakCounter streak={10} size="md" />
91
+ </div>
92
+ <div className="text-center">
93
+ <p className="text-sm text-muted-foreground mb-2">Large</p>
94
+ <WakaStreakCounter streak={15} size="lg" />
95
+ </div>
96
+ </div>
97
+ ),
98
+ }
99
+
100
+ export const StreakLevels: Story = {
101
+ render: () => (
102
+ <div className="grid grid-cols-2 gap-6">
103
+ <div className="p-4 rounded-lg border text-center">
104
+ <p className="text-sm text-muted-foreground mb-2">No Streak</p>
105
+ <WakaStreakCounter streak={0} />
106
+ </div>
107
+ <div className="p-4 rounded-lg border text-center">
108
+ <p className="text-sm text-muted-foreground mb-2">Starting (3 days)</p>
109
+ <WakaStreakCounter streak={3} />
110
+ </div>
111
+ <div className="p-4 rounded-lg border text-center">
112
+ <p className="text-sm text-muted-foreground mb-2">Week (7 days)</p>
113
+ <WakaStreakCounter streak={7} />
114
+ </div>
115
+ <div className="p-4 rounded-lg border text-center">
116
+ <p className="text-sm text-muted-foreground mb-2">Month (30 days)</p>
117
+ <WakaStreakCounter streak={30} />
118
+ </div>
119
+ <div className="p-4 rounded-lg border text-center">
120
+ <p className="text-sm text-muted-foreground mb-2">Quarter (90 days)</p>
121
+ <WakaStreakCounter streak={90} />
122
+ </div>
123
+ <div className="p-4 rounded-lg border text-center">
124
+ <p className="text-sm text-muted-foreground mb-2">Year (365 days)</p>
125
+ <WakaStreakCounter streak={365} />
126
+ </div>
127
+ </div>
128
+ ),
129
+ }
130
+
131
+ export const WithMaxStreak: Story = {
132
+ render: () => (
133
+ <div className="space-y-6">
134
+ <div className="p-4 rounded-lg border">
135
+ <p className="text-sm text-muted-foreground mb-2">Current vs Best</p>
136
+ <WakaStreakCounter streak={12} maxStreak={45} variant="detailed" />
137
+ </div>
138
+ <div className="p-4 rounded-lg border">
139
+ <p className="text-sm text-muted-foreground mb-2">New Personal Best!</p>
140
+ <WakaStreakCounter streak={50} maxStreak={45} variant="detailed" />
141
+ </div>
142
+ </div>
143
+ ),
144
+ }
145
+
146
+ export const Interactive: Story = {
147
+ render: () => {
148
+ const [streak, setStreak] = React.useState(5)
149
+ const [maxStreak, setMaxStreak] = React.useState(10)
150
+
151
+ const incrementStreak = () => {
152
+ const newStreak = streak + 1
153
+ setStreak(newStreak)
154
+ if (newStreak > maxStreak) {
155
+ setMaxStreak(newStreak)
156
+ }
157
+ }
158
+
159
+ const breakStreak = () => {
160
+ setStreak(0)
161
+ }
162
+
163
+ return (
164
+ <div className="space-y-6">
165
+ <WakaStreakCounter streak={streak} maxStreak={maxStreak} variant="detailed" size="lg" />
166
+
167
+ <div className="flex gap-2 justify-center">
168
+ <button
169
+ onClick={incrementStreak}
170
+ className="px-4 py-2 rounded-lg bg-orange-500 text-white font-medium hover:bg-orange-600"
171
+ >
172
+ +1 Day
173
+ </button>
174
+ <button
175
+ onClick={breakStreak}
176
+ className="px-4 py-2 rounded-lg bg-red-500 text-white font-medium hover:bg-red-600"
177
+ >
178
+ Break Streak
179
+ </button>
180
+ <button
181
+ onClick={() => { setStreak(5); setMaxStreak(10) }}
182
+ className="px-4 py-2 rounded-lg border font-medium hover:bg-muted"
183
+ >
184
+ Reset
185
+ </button>
186
+ </div>
187
+ </div>
188
+ )
189
+ },
190
+ }
191
+
192
+ export const DashboardWidget: Story = {
193
+ render: () => (
194
+ <div className="w-[350px] p-4 rounded-xl border bg-gradient-to-br from-orange-500/10 to-red-500/10">
195
+ <div className="flex items-center justify-between mb-4">
196
+ <h3 className="font-semibold">Daily Streak</h3>
197
+ <span className="text-xs text-muted-foreground">Keep it going!</span>
198
+ </div>
199
+ <WakaStreakCounter streak={21} maxStreak={35} variant="detailed" />
200
+ <div className="mt-4 pt-4 border-t">
201
+ <div className="flex justify-between text-sm">
202
+ <span className="text-muted-foreground">Next milestone</span>
203
+ <span className="font-medium">30 days (9 to go)</span>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ ),
208
+ }
209
+
210
+ export const MultipleUsers: Story = {
211
+ render: () => (
212
+ <div className="space-y-4 w-[400px]">
213
+ <h3 className="font-semibold">Leaderboard - Streaks</h3>
214
+ {[
215
+ { name: 'Alice', streak: 45, avatar: 'A' },
216
+ { name: 'Bob', streak: 32, avatar: 'B' },
217
+ { name: 'Carol', streak: 28, avatar: 'C' },
218
+ { name: 'David', streak: 14, avatar: 'D' },
219
+ ].map((user, index) => (
220
+ <div key={user.name} className="flex items-center gap-3 p-3 rounded-lg border">
221
+ <span className="text-lg font-bold text-muted-foreground w-6">#{index + 1}</span>
222
+ <div className="w-8 h-8 rounded-full bg-gradient-to-br from-primary to-primary/60 flex items-center justify-center text-white font-bold text-sm">
223
+ {user.avatar}
224
+ </div>
225
+ <span className="font-medium flex-1">{user.name}</span>
226
+ <WakaStreakCounter streak={user.streak} variant="compact" size="sm" />
227
+ </div>
228
+ ))}
229
+ </div>
230
+ ),
231
+ }
232
+
233
+ export const NoAnimation: Story = {
234
+ render: () => <WakaStreakCounter streak={15} animated={false} showFlame={false} />,
235
+ }