@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,416 @@
1
+ import type { Meta, StoryObj } from '@storybook/react'
2
+ import { WakaFAQ, defaultFAQItems, defaultFAQCategories } from './index'
3
+ import type { FAQItem, FAQCategory } from './index'
4
+ import * as React from 'react'
5
+ import { CreditCard, HelpCircle, Settings, Shield, Code, Rocket } from 'lucide-react'
6
+
7
+ const meta: Meta<typeof WakaFAQ> = {
8
+ title: 'Blocks/FAQ',
9
+ component: WakaFAQ,
10
+ parameters: {
11
+ layout: 'centered',
12
+ docs: {
13
+ description: {
14
+ component:
15
+ 'A FAQ component with search, category filtering, accordion layout, and optional feedback (helpful/not helpful). Supports default, cards, and grouped layouts.',
16
+ },
17
+ },
18
+ },
19
+ tags: ['autodocs'],
20
+ argTypes: {
21
+ layout: {
22
+ control: 'select',
23
+ options: ['default', 'cards', 'grouped'],
24
+ },
25
+ size: {
26
+ control: 'select',
27
+ options: ['sm', 'md', 'lg'],
28
+ },
29
+ showSearch: {
30
+ control: 'boolean',
31
+ },
32
+ showCategoryFilter: {
33
+ control: 'boolean',
34
+ },
35
+ showFeedback: {
36
+ control: 'boolean',
37
+ },
38
+ allowMultiple: {
39
+ control: 'boolean',
40
+ },
41
+ },
42
+ }
43
+
44
+ export default meta
45
+ type Story = StoryObj<typeof WakaFAQ>
46
+
47
+ export const Default: Story = {
48
+ render: () => (
49
+ <div className="w-[800px]">
50
+ <WakaFAQ
51
+ items={defaultFAQItems}
52
+ categories={defaultFAQCategories}
53
+ />
54
+ </div>
55
+ ),
56
+ }
57
+
58
+ export const WithCategories: Story = {
59
+ render: () => (
60
+ <div className="w-[800px]">
61
+ <WakaFAQ
62
+ items={defaultFAQItems}
63
+ categories={defaultFAQCategories}
64
+ showCategoryFilter
65
+ />
66
+ </div>
67
+ ),
68
+ }
69
+
70
+ export const CardsLayout: Story = {
71
+ render: () => (
72
+ <div className="w-[800px]">
73
+ <WakaFAQ
74
+ items={defaultFAQItems}
75
+ layout="cards"
76
+ />
77
+ </div>
78
+ ),
79
+ }
80
+
81
+ export const GroupedLayout: Story = {
82
+ render: () => (
83
+ <div className="w-[800px]">
84
+ <WakaFAQ
85
+ items={defaultFAQItems}
86
+ categories={defaultFAQCategories}
87
+ layout="grouped"
88
+ showCategoryFilter={false}
89
+ />
90
+ </div>
91
+ ),
92
+ }
93
+
94
+ export const WithFeedback: Story = {
95
+ render: () => (
96
+ <div className="w-[800px]">
97
+ <WakaFAQ
98
+ items={defaultFAQItems.map((item) => ({
99
+ ...item,
100
+ helpful: Math.floor(Math.random() * 50),
101
+ notHelpful: Math.floor(Math.random() * 10),
102
+ }))}
103
+ showFeedback
104
+ onFeedback={(itemId, helpful) => {
105
+ console.log(`Feedback for ${itemId}: ${helpful ? 'helpful' : 'not helpful'}`)
106
+ }}
107
+ />
108
+ </div>
109
+ ),
110
+ }
111
+
112
+ export const AllowMultiple: Story = {
113
+ render: () => (
114
+ <div className="w-[800px]">
115
+ <WakaFAQ
116
+ items={defaultFAQItems}
117
+ allowMultiple
118
+ defaultOpen={['1', '2']}
119
+ />
120
+ </div>
121
+ ),
122
+ }
123
+
124
+ export const NoSearch: Story = {
125
+ render: () => (
126
+ <div className="w-[800px]">
127
+ <WakaFAQ
128
+ items={defaultFAQItems}
129
+ showSearch={false}
130
+ />
131
+ </div>
132
+ ),
133
+ }
134
+
135
+ export const SmallSize: Story = {
136
+ render: () => (
137
+ <div className="w-[600px]">
138
+ <WakaFAQ
139
+ items={defaultFAQItems.slice(0, 3)}
140
+ size="sm"
141
+ showSearch={false}
142
+ />
143
+ </div>
144
+ ),
145
+ }
146
+
147
+ export const LargeSize: Story = {
148
+ render: () => (
149
+ <div className="w-[900px]">
150
+ <WakaFAQ
151
+ items={defaultFAQItems}
152
+ size="lg"
153
+ />
154
+ </div>
155
+ ),
156
+ }
157
+
158
+ export const CustomCategories: Story = {
159
+ render: () => {
160
+ const customCategories: FAQCategory[] = [
161
+ { id: 'getting-started', name: 'Getting Started', icon: <Rocket className="h-4 w-4" /> },
162
+ { id: 'billing', name: 'Billing & Plans', icon: <CreditCard className="h-4 w-4" /> },
163
+ { id: 'security', name: 'Security', icon: <Shield className="h-4 w-4" /> },
164
+ { id: 'api', name: 'API & Developers', icon: <Code className="h-4 w-4" /> },
165
+ ]
166
+
167
+ const customItems: FAQItem[] = [
168
+ {
169
+ id: '1',
170
+ question: 'How do I get started?',
171
+ answer: 'Sign up for a free account, then follow our quick start guide to set up your first project in under 5 minutes.',
172
+ category: 'getting-started',
173
+ tags: ['setup', 'beginner'],
174
+ },
175
+ {
176
+ id: '2',
177
+ question: 'What features are included in the free plan?',
178
+ answer: 'The free plan includes 3 projects, 1GB storage, basic analytics, and community support.',
179
+ category: 'billing',
180
+ tags: ['pricing', 'free'],
181
+ },
182
+ {
183
+ id: '3',
184
+ question: 'How do I upgrade to Pro?',
185
+ answer: 'Go to Settings > Billing and select the Pro plan. You can pay monthly or yearly with a 20% discount.',
186
+ category: 'billing',
187
+ tags: ['upgrade', 'pro'],
188
+ },
189
+ {
190
+ id: '4',
191
+ question: 'Is my data secure?',
192
+ answer: 'Yes! We use bank-level encryption (AES-256) and are SOC 2 Type II certified. All data is encrypted at rest and in transit.',
193
+ category: 'security',
194
+ tags: ['encryption', 'compliance'],
195
+ },
196
+ {
197
+ id: '5',
198
+ question: 'How do I enable two-factor authentication?',
199
+ answer: 'Go to Settings > Security > Two-Factor Authentication and follow the setup wizard to enable 2FA using an authenticator app.',
200
+ category: 'security',
201
+ tags: ['2fa', 'authentication'],
202
+ },
203
+ {
204
+ id: '6',
205
+ question: 'Is the API available on all plans?',
206
+ answer: 'API access is available on Pro and Enterprise plans. Free plans have read-only access with rate limits.',
207
+ category: 'api',
208
+ tags: ['api', 'access'],
209
+ },
210
+ {
211
+ id: '7',
212
+ question: 'Where can I find the API documentation?',
213
+ answer: 'Our comprehensive API documentation is available at docs.example.com/api. It includes examples, SDKs, and interactive playground.',
214
+ category: 'api',
215
+ tags: ['documentation', 'sdk'],
216
+ },
217
+ ]
218
+
219
+ return (
220
+ <div className="w-[800px]">
221
+ <WakaFAQ
222
+ items={customItems}
223
+ categories={customCategories}
224
+ title="Help Center"
225
+ description="Find answers to commonly asked questions"
226
+ />
227
+ </div>
228
+ )
229
+ },
230
+ }
231
+
232
+ export const WithRichAnswer: Story = {
233
+ render: () => {
234
+ const itemsWithRichContent: FAQItem[] = [
235
+ {
236
+ id: '1',
237
+ question: 'What payment methods do you accept?',
238
+ answer: (
239
+ <div className="space-y-4">
240
+ <p>We accept the following payment methods:</p>
241
+ <ul className="list-disc pl-5 space-y-1">
242
+ <li><strong>Credit Cards:</strong> Visa, Mastercard, American Express</li>
243
+ <li><strong>Digital Wallets:</strong> PayPal, Apple Pay, Google Pay</li>
244
+ <li><strong>Bank Transfers:</strong> SEPA (EU), ACH (US), Wire transfers</li>
245
+ </ul>
246
+ <p className="text-sm bg-muted p-3 rounded">
247
+ <strong>Note:</strong> Enterprise customers can also pay via invoice with NET 30 terms.
248
+ </p>
249
+ </div>
250
+ ),
251
+ category: 'billing',
252
+ },
253
+ {
254
+ id: '2',
255
+ question: 'How do I reset my password?',
256
+ answer: (
257
+ <div className="space-y-4">
258
+ <p>Follow these steps to reset your password:</p>
259
+ <ol className="list-decimal pl-5 space-y-2">
260
+ <li>Click "Forgot Password" on the login page</li>
261
+ <li>Enter your email address</li>
262
+ <li>Check your inbox for the reset link</li>
263
+ <li>Click the link and create a new password</li>
264
+ </ol>
265
+ <p className="text-sm text-muted-foreground">
266
+ The reset link expires after 24 hours for security reasons.
267
+ </p>
268
+ </div>
269
+ ),
270
+ category: 'general',
271
+ },
272
+ ]
273
+
274
+ return (
275
+ <div className="w-[800px]">
276
+ <WakaFAQ
277
+ items={itemsWithRichContent}
278
+ showCategoryFilter={false}
279
+ />
280
+ </div>
281
+ )
282
+ },
283
+ }
284
+
285
+ export const Interactive: Story = {
286
+ render: () => {
287
+ const [activeCategory, setActiveCategory] = React.useState<string | null>(null)
288
+
289
+ return (
290
+ <div className="w-[800px]">
291
+ <div className="mb-4 text-sm text-muted-foreground">
292
+ Active category: {activeCategory || 'All'}
293
+ </div>
294
+ <WakaFAQ
295
+ items={defaultFAQItems}
296
+ categories={defaultFAQCategories}
297
+ activeCategory={activeCategory ?? undefined}
298
+ onCategoryChange={setActiveCategory}
299
+ showFeedback
300
+ onFeedback={(itemId, helpful) => {
301
+ console.log(`Feedback: ${itemId} - ${helpful ? '👍' : '👎'}`)
302
+ }}
303
+ />
304
+ </div>
305
+ )
306
+ },
307
+ }
308
+
309
+ export const Empty: Story = {
310
+ render: () => (
311
+ <div className="w-[800px]">
312
+ <WakaFAQ
313
+ items={[]}
314
+ title="FAQ"
315
+ description="No questions yet"
316
+ />
317
+ </div>
318
+ ),
319
+ }
320
+
321
+ export const ManyItems: Story = {
322
+ render: () => {
323
+ const manyItems: FAQItem[] = Array.from({ length: 20 }, (_, i) => ({
324
+ id: String(i + 1),
325
+ question: `Question ${i + 1}: Lorem ipsum dolor sit amet?`,
326
+ answer: `Answer ${i + 1}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.`,
327
+ category: ['general', 'billing', 'technical'][i % 3],
328
+ tags: [`tag${i}`, `topic${i % 5}`],
329
+ }))
330
+
331
+ return (
332
+ <div className="w-[800px] max-h-[600px] overflow-auto">
333
+ <WakaFAQ
334
+ items={manyItems}
335
+ categories={defaultFAQCategories}
336
+ />
337
+ </div>
338
+ )
339
+ },
340
+ }
341
+
342
+ export const InPageContext: Story = {
343
+ render: () => (
344
+ <div className="min-h-screen bg-muted/30">
345
+ <header className="bg-background border-b px-6 py-4">
346
+ <div className="max-w-4xl mx-auto flex items-center justify-between">
347
+ <span className="font-bold text-xl">MyApp</span>
348
+ <nav className="flex gap-4 text-sm">
349
+ <a href="#" className="text-muted-foreground hover:text-foreground">Home</a>
350
+ <a href="#" className="text-muted-foreground hover:text-foreground">Pricing</a>
351
+ <a href="#" className="text-foreground font-medium">FAQ</a>
352
+ <a href="#" className="text-muted-foreground hover:text-foreground">Contact</a>
353
+ </nav>
354
+ </div>
355
+ </header>
356
+ <main className="py-12 px-6">
357
+ <WakaFAQ
358
+ items={defaultFAQItems}
359
+ categories={defaultFAQCategories}
360
+ title="Frequently Asked Questions"
361
+ description="Can't find what you're looking for? Contact our support team."
362
+ showFeedback
363
+ onFeedback={(itemId, helpful) => console.log(itemId, helpful)}
364
+ />
365
+ </main>
366
+ <footer className="border-t py-8 text-center text-sm text-muted-foreground">
367
+ <p>Still have questions? <a href="#" className="text-primary hover:underline">Contact Support</a></p>
368
+ </footer>
369
+ </div>
370
+ ),
371
+ }
372
+
373
+ export const SupportPage: Story = {
374
+ render: () => {
375
+ const supportCategories: FAQCategory[] = [
376
+ { id: 'account', name: 'Account', icon: <Settings className="h-4 w-4" /> },
377
+ { id: 'billing', name: 'Billing', icon: <CreditCard className="h-4 w-4" /> },
378
+ { id: 'technical', name: 'Technical', icon: <Code className="h-4 w-4" /> },
379
+ { id: 'other', name: 'Other', icon: <HelpCircle className="h-4 w-4" /> },
380
+ ]
381
+
382
+ const supportItems: FAQItem[] = [
383
+ { id: '1', question: 'How do I change my email?', answer: 'Go to Settings > Account > Email and enter your new email address.', category: 'account' },
384
+ { id: '2', question: 'How do I delete my account?', answer: 'Go to Settings > Account > Danger Zone and click "Delete Account".', category: 'account' },
385
+ { id: '3', question: 'How do I update my payment method?', answer: 'Go to Settings > Billing > Payment Methods and add a new card.', category: 'billing' },
386
+ { id: '4', question: 'Can I get a refund?', answer: 'Yes, we offer a 30-day money-back guarantee on all plans.', category: 'billing' },
387
+ { id: '5', question: 'Why is my build failing?', answer: 'Check the build logs for specific errors. Common issues include missing dependencies or syntax errors.', category: 'technical' },
388
+ { id: '6', question: 'How do I contact support?', answer: 'You can reach us at support@example.com or via the chat widget.', category: 'other' },
389
+ ]
390
+
391
+ return (
392
+ <div className="w-[800px] p-6 border rounded-lg bg-card">
393
+ <div className="text-center mb-8">
394
+ <h1 className="text-3xl font-bold mb-2">Support Center</h1>
395
+ <p className="text-muted-foreground">
396
+ Search our knowledge base or browse by category
397
+ </p>
398
+ </div>
399
+ <WakaFAQ
400
+ items={supportItems}
401
+ categories={supportCategories}
402
+ showFeedback
403
+ onFeedback={(itemId, helpful) => console.log(itemId, helpful)}
404
+ />
405
+ <div className="mt-8 pt-6 border-t text-center">
406
+ <p className="text-muted-foreground mb-4">
407
+ Couldn't find what you were looking for?
408
+ </p>
409
+ <button className="px-4 py-2 bg-primary text-primary-foreground rounded-md">
410
+ Contact Support
411
+ </button>
412
+ </div>
413
+ </div>
414
+ )
415
+ },
416
+ }