@wakastellar/ui 2.4.0 → 3.1.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 (173) hide show
  1. package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
  2. package/dist/blocks/clamav-service-status/index.d.ts +35 -0
  3. package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
  4. package/dist/blocks/index.d.ts +18 -9
  5. package/dist/blocks/quarantine-manager/index.d.ts +27 -0
  6. package/dist/blocks/scan-history-log/index.d.ts +28 -0
  7. package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
  8. package/dist/blocks/scan-report-generator/index.d.ts +47 -0
  9. package/dist/blocks/signature-database-manager/index.d.ts +39 -0
  10. package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
  11. package/dist/components/index.d.ts +4 -4
  12. package/dist/components/waka-signature-pad/index.d.ts +1 -1
  13. package/dist/exceljs.min-BcLLX0PC.js +29 -0
  14. package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
  15. package/dist/export.cjs.js +1 -1
  16. package/dist/export.d.ts +2 -2
  17. package/dist/export.es.js +1 -1
  18. package/dist/index.cjs.js +136 -136
  19. package/dist/index.es.js +29978 -27215
  20. package/dist/stories/Button.stories.d.ts +1 -1
  21. package/dist/stories/Header.stories.d.ts +1 -1
  22. package/dist/stories/Page.stories.d.ts +1 -1
  23. package/dist/useDataTableImport-COVnvslz.js +9 -0
  24. package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
  25. package/dist/utils/index.d.ts +1 -0
  26. package/dist/utils/logger.d.ts +9 -0
  27. package/package.json +6 -5
  28. package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
  29. package/src/blocks/antivirus-dashboard/index.tsx +525 -0
  30. package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
  31. package/src/blocks/clamav-service-status/index.tsx +370 -0
  32. package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
  33. package/src/blocks/file-scan-uploader/index.tsx +311 -0
  34. package/src/blocks/index.ts +163 -11
  35. package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
  36. package/src/blocks/quarantine-manager/index.tsx +435 -0
  37. package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
  38. package/src/blocks/scan-history-log/index.tsx +406 -0
  39. package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
  40. package/src/blocks/scan-policy-editor/index.tsx +418 -0
  41. package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
  42. package/src/blocks/scan-report-generator/index.tsx +612 -0
  43. package/src/blocks/sidebar/index.tsx +2 -1
  44. package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
  45. package/src/blocks/signature-database-manager/index.tsx +470 -0
  46. package/src/blocks/theme-creator-block/index.tsx +16 -2
  47. package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
  48. package/src/blocks/threat-alert-banner/index.tsx +320 -0
  49. package/src/components/DataTable/DataTable.stories.tsx +203 -0
  50. package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
  51. package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
  52. package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
  53. package/src/components/index.ts +45 -4
  54. package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
  55. package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
  56. package/src/components/toaster/Toaster.stories.tsx +67 -0
  57. package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
  58. package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
  59. package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
  60. package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
  61. package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
  62. package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
  63. package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
  64. package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
  65. package/src/components/waka-ad-sidebar/index.tsx +3 -2
  66. package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
  67. package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
  68. package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
  69. package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
  70. package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
  71. package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
  72. package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
  73. package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
  74. package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
  75. package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
  76. package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
  77. package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
  78. package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
  79. package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
  80. package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
  81. package/src/components/waka-cart-summary/index.tsx +19 -10
  82. package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
  83. package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
  84. package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
  85. package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
  86. package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
  87. package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
  88. package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
  89. package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
  90. package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
  91. package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
  92. package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
  93. package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
  94. package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
  95. package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
  96. package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
  97. package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
  98. package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
  99. package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
  100. package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
  101. package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
  102. package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
  103. package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
  104. package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
  105. package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
  106. package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
  107. package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
  108. package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
  109. package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
  110. package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
  111. package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
  112. package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
  113. package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
  114. package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
  115. package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
  116. package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
  117. package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
  118. package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
  119. package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
  120. package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
  121. package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
  122. package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
  123. package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
  124. package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
  125. package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
  126. package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
  127. package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
  128. package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
  129. package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
  130. package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
  131. package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
  132. package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
  133. package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
  134. package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
  135. package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
  136. package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
  137. package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
  138. package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
  139. package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
  140. package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
  141. package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
  142. package/src/components/waka-signature-pad/index.tsx +5 -3
  143. package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
  144. package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
  145. package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
  146. package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
  147. package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
  148. package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
  149. package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
  150. package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
  151. package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
  152. package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
  153. package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
  154. package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
  155. package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
  156. package/src/components/waka-theme-manager/index.tsx +6 -11
  157. package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
  158. package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
  159. package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
  160. package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
  161. package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
  162. package/src/components/waka-treemap-chart/index.tsx +2 -2
  163. package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
  164. package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
  165. package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
  166. package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
  167. package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
  168. package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
  169. package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
  170. package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
  171. package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
  172. package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
  173. package/src/components/DataTable/README.md +0 -446
@@ -0,0 +1,125 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { ErrorBoundary, ErrorFallbackProps } from "./index"
3
+ import { Button } from "../button"
4
+ import * as React from "react"
5
+
6
+ // Component that throws an error
7
+ const BuggyComponent = ({ shouldThrow }: { shouldThrow: boolean }) => {
8
+ if (shouldThrow) {
9
+ throw new Error("This is a simulated error!")
10
+ }
11
+ return (
12
+ <div className="p-4 border rounded-lg bg-green-50 text-green-800">
13
+ ✅ Component rendered successfully
14
+ </div>
15
+ )
16
+ }
17
+
18
+ // Interactive demo
19
+ const ErrorBoundaryDemo = () => {
20
+ const [shouldThrow, setShouldThrow] = React.useState(false)
21
+ const [key, setKey] = React.useState(0)
22
+
23
+ return (
24
+ <div className="space-y-4">
25
+ <div className="flex gap-2">
26
+ <Button onClick={() => setShouldThrow(true)} variant="destructive">
27
+ Trigger Error
28
+ </Button>
29
+ <Button
30
+ onClick={() => {
31
+ setShouldThrow(false)
32
+ setKey((k) => k + 1)
33
+ }}
34
+ variant="outline"
35
+ >
36
+ Reset
37
+ </Button>
38
+ </div>
39
+
40
+ <ErrorBoundary
41
+ key={key}
42
+ componentName="BuggyComponent"
43
+ onError={(error) => console.log("Error caught:", error)}
44
+ onReset={() => console.log("Boundary reset")}
45
+ >
46
+ <BuggyComponent shouldThrow={shouldThrow} />
47
+ </ErrorBoundary>
48
+ </div>
49
+ )
50
+ }
51
+
52
+ // Custom fallback demo
53
+ const CustomFallback = ({ error, resetErrorBoundary }: ErrorFallbackProps) => (
54
+ <div className="p-6 bg-red-50 border-2 border-red-200 rounded-xl text-center space-y-4">
55
+ <div className="text-4xl">💥</div>
56
+ <h3 className="text-lg font-bold text-red-700">Oops! Something broke</h3>
57
+ <p className="text-sm text-red-600">{error.message}</p>
58
+ <Button onClick={resetErrorBoundary} variant="outline" size="sm">
59
+ Try Again
60
+ </Button>
61
+ </div>
62
+ )
63
+
64
+ const meta: Meta<typeof ErrorBoundary> = {
65
+ title: "Components/Feedback/ErrorBoundary",
66
+ component: ErrorBoundary,
67
+ parameters: {
68
+ layout: "centered",
69
+ },
70
+ tags: ["autodocs"],
71
+ argTypes: {
72
+ componentName: {
73
+ control: "text",
74
+ description: "Name of the component for error context",
75
+ },
76
+ className: {
77
+ control: "text",
78
+ description: "Additional CSS classes",
79
+ },
80
+ },
81
+ }
82
+
83
+ export default meta
84
+ type Story = StoryObj<typeof ErrorBoundary>
85
+
86
+ export const Default: Story = {
87
+ render: () => <ErrorBoundaryDemo />,
88
+ }
89
+
90
+ export const WithCustomFallback: Story = {
91
+ render: () => {
92
+ const [shouldThrow, setShouldThrow] = React.useState(false)
93
+ const [key, setKey] = React.useState(0)
94
+
95
+ return (
96
+ <div className="space-y-4">
97
+ <Button onClick={() => setShouldThrow(true)} variant="destructive">
98
+ Trigger Error
99
+ </Button>
100
+
101
+ <ErrorBoundary
102
+ key={key}
103
+ fallback={(props) => <CustomFallback {...props} />}
104
+ onReset={() => {
105
+ setShouldThrow(false)
106
+ setKey((k) => k + 1)
107
+ }}
108
+ >
109
+ <BuggyComponent shouldThrow={shouldThrow} />
110
+ </ErrorBoundary>
111
+ </div>
112
+ )
113
+ },
114
+ }
115
+
116
+ export const WithComponentName: Story = {
117
+ render: () => (
118
+ <ErrorBoundary componentName="UserProfile">
119
+ <div className="p-4 border rounded-lg">
120
+ Content that could potentially throw an error
121
+ </div>
122
+ </ErrorBoundary>
123
+ ),
124
+ }
125
+
@@ -303,12 +303,33 @@ export * from './waka-permission-matrix'
303
303
  export * from './waka-audit-log'
304
304
  export * from './waka-security-score'
305
305
  export * from './waka-biometric-prompt'
306
- export * from './waka-device-trust'
306
+ // waka-device-trust: Explicit export to avoid DeviceType conflict with waka-session-manager
307
+ export {
308
+ WakaDeviceTrust,
309
+ useDeviceTrust,
310
+ type TrustedDevice,
311
+ type TrustStatus,
312
+ type ExpiryPeriod,
313
+ type DeviceTrustConfig,
314
+ type DeviceType as DeviceTrustDeviceType,
315
+ type WakaDeviceTrustProps,
316
+ type UseDeviceTrustOptions,
317
+ } from './waka-device-trust'
307
318
 
308
319
  // Communication & Collaboration Components
309
320
  export * from './waka-chat-bubble'
310
321
  export * from './waka-typing-indicator'
311
- export * from './waka-video-call'
322
+ // waka-video-call: Explicit export to avoid Participant conflict with waka-tournament-bracket
323
+ export {
324
+ WakaVideoCall,
325
+ useVideoCall,
326
+ type Participant as VideoCallParticipant,
327
+ type ConnectionQuality,
328
+ type VideoCallLayout,
329
+ type VideoCallState,
330
+ type WakaVideoCallProps,
331
+ type UseVideoCallOptions,
332
+ } from './waka-video-call'
312
333
  export * from './waka-thread-view'
313
334
  export * from './waka-reaction-picker'
314
335
  export * from './waka-voice-message'
@@ -318,7 +339,19 @@ export * from './waka-funnel-chart'
318
339
  export * from './waka-cohort-table'
319
340
  export * from './waka-kpi-dashboard'
320
341
  export * from './waka-goal-progress'
321
- export * from './waka-heatmap'
342
+ // waka-heatmap: Explicit export to avoid ColorScheme conflict with waka-status-matrix
343
+ export {
344
+ WakaHeatmap,
345
+ useHeatmap,
346
+ type WakaHeatmapProps,
347
+ type HeatmapCell,
348
+ type HeatmapData,
349
+ type HeatmapSelection,
350
+ type ColorScheme as HeatmapColorScheme,
351
+ type ColorSchemeType as HeatmapColorSchemeType,
352
+ type UseHeatmapOptions,
353
+ type UseHeatmapReturn,
354
+ } from './waka-heatmap'
322
355
  export * from './waka-sankey-diagram'
323
356
  export * from './waka-treemap-chart'
324
357
 
@@ -328,7 +361,15 @@ export * from './waka-address-autocomplete'
328
361
  export * from './waka-phone-input'
329
362
  export * from './waka-credit-card-input'
330
363
  export * from './waka-tag-input'
331
- export * from './waka-slider-range'
364
+ // waka-slider-range: Explicit export to avoid ValueFormat conflict with waka-funnel-chart
365
+ export {
366
+ WakaSliderRange,
367
+ useSliderRange,
368
+ type WakaSliderRangeProps,
369
+ type ValueFormat as SliderValueFormat,
370
+ type UseSliderRangeOptions,
371
+ type UseSliderRangeReturn,
372
+ } from './waka-slider-range'
332
373
  export * from './waka-rating-input'
333
374
  export * from './waka-schedule-picker'
334
375
 
@@ -0,0 +1,112 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { LanguageSelector, Language } from "./index"
3
+
4
+ const sampleLanguages: Language[] = [
5
+ { code: "en", label: "English", flagEmoji: "🇺🇸" },
6
+ { code: "fr", label: "Français", flagEmoji: "🇫🇷" },
7
+ { code: "de", label: "Deutsch", flagEmoji: "🇩🇪" },
8
+ { code: "es", label: "Español", flagEmoji: "🇪🇸" },
9
+ { code: "it", label: "Italiano", flagEmoji: "🇮🇹" },
10
+ { code: "pt", label: "Português", flagEmoji: "🇵🇹" },
11
+ { code: "ja", label: "日本語", flagEmoji: "🇯🇵" },
12
+ ]
13
+
14
+ const meta: Meta<typeof LanguageSelector> = {
15
+ title: "Components/UI/LanguageSelector",
16
+ component: LanguageSelector,
17
+ parameters: {
18
+ layout: "centered",
19
+ },
20
+ tags: ["autodocs"],
21
+ argTypes: {
22
+ variant: {
23
+ control: "select",
24
+ options: ["default", "compact", "minimal"],
25
+ description: "Style variant of the selector",
26
+ },
27
+ showFlags: {
28
+ control: "boolean",
29
+ description: "Show flag icons",
30
+ },
31
+ showLabels: {
32
+ control: "boolean",
33
+ description: "Show language labels",
34
+ },
35
+ isLoading: {
36
+ control: "boolean",
37
+ description: "Loading state",
38
+ },
39
+ placeholder: {
40
+ control: "text",
41
+ description: "Placeholder text",
42
+ },
43
+ },
44
+ }
45
+
46
+ export default meta
47
+ type Story = StoryObj<typeof LanguageSelector>
48
+
49
+ export const Default: Story = {
50
+ args: {
51
+ languages: sampleLanguages,
52
+ value: "en",
53
+ showFlags: true,
54
+ showLabels: true,
55
+ variant: "default",
56
+ },
57
+ render: (args) => <LanguageSelector {...args} />,
58
+ }
59
+
60
+ export const Compact: Story = {
61
+ args: {
62
+ languages: sampleLanguages,
63
+ value: "fr",
64
+ showFlags: true,
65
+ showLabels: true,
66
+ variant: "compact",
67
+ },
68
+ render: (args) => <LanguageSelector {...args} />,
69
+ }
70
+
71
+ export const Minimal: Story = {
72
+ args: {
73
+ languages: sampleLanguages,
74
+ value: "de",
75
+ showFlags: true,
76
+ variant: "minimal",
77
+ },
78
+ render: (args) => <LanguageSelector {...args} />,
79
+ }
80
+
81
+ export const WithoutFlags: Story = {
82
+ args: {
83
+ languages: sampleLanguages,
84
+ value: "es",
85
+ showFlags: false,
86
+ showLabels: true,
87
+ variant: "default",
88
+ },
89
+ render: (args) => <LanguageSelector {...args} />,
90
+ }
91
+
92
+ export const IconOnly: Story = {
93
+ args: {
94
+ languages: sampleLanguages,
95
+ value: "ja",
96
+ showFlags: true,
97
+ showLabels: false,
98
+ variant: "compact",
99
+ },
100
+ render: (args) => <LanguageSelector {...args} />,
101
+ }
102
+
103
+ export const Loading: Story = {
104
+ args: {
105
+ languages: sampleLanguages,
106
+ value: "en",
107
+ isLoading: true,
108
+ variant: "default",
109
+ },
110
+ render: (args) => <LanguageSelector {...args} />,
111
+ }
112
+
@@ -0,0 +1,77 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { ThemeSelector, ThemeSelectorProps } from "./index"
3
+ import { ThemeProvider } from "../../context/theme-provider"
4
+
5
+ const meta: Meta<typeof ThemeSelector> = {
6
+ title: "Components/UI/ThemeSelector",
7
+ component: ThemeSelector,
8
+ parameters: {
9
+ layout: "centered",
10
+ },
11
+ tags: ["autodocs"],
12
+ decorators: [
13
+ (Story) => (
14
+ <ThemeProvider
15
+ themes={[
16
+ { id: "default", label: "Default", previewColor: "#6366f1" },
17
+ { id: "dark", label: "Dark", previewColor: "#1e293b" },
18
+ { id: "sunset", label: "Sunset", previewColor: "#f97316" },
19
+ { id: "ocean", label: "Ocean", previewColor: "#0ea5e9" },
20
+ { id: "forest", label: "Forest", previewColor: "#22c55e" },
21
+ ]}
22
+ defaultTheme="default"
23
+ >
24
+ <Story />
25
+ </ThemeProvider>
26
+ ),
27
+ ],
28
+ argTypes: {
29
+ variant: {
30
+ control: "select",
31
+ options: ["default", "full", "compact", "select"],
32
+ description: "Style variant of the selector",
33
+ },
34
+ ariaLabel: {
35
+ control: "text",
36
+ description: "Accessibility label",
37
+ },
38
+ className: {
39
+ control: "text",
40
+ description: "Additional CSS classes",
41
+ },
42
+ },
43
+ }
44
+
45
+ export default meta
46
+ type Story = StoryObj<typeof ThemeSelector>
47
+
48
+ export const Default: Story = {
49
+ args: {
50
+ variant: "default",
51
+ },
52
+ render: (args) => <ThemeSelector {...args} />,
53
+ }
54
+
55
+ export const Compact: Story = {
56
+ args: {
57
+ variant: "compact",
58
+ },
59
+ render: (args) => <ThemeSelector {...args} />,
60
+ }
61
+
62
+ export const Select: Story = {
63
+ args: {
64
+ variant: "select",
65
+ className: "w-[200px]",
66
+ },
67
+ render: (args) => <ThemeSelector {...args} />,
68
+ }
69
+
70
+ export const Full: Story = {
71
+ args: {
72
+ variant: "full",
73
+ className: "w-[400px]",
74
+ },
75
+ render: (args) => <ThemeSelector {...args} />,
76
+ }
77
+
@@ -0,0 +1,67 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { Toaster } from "./index"
3
+ import { useToast } from "../../hooks/useToast"
4
+ import { Button } from "../button"
5
+
6
+ const ToasterDemo = () => {
7
+ const { toast } = useToast()
8
+
9
+ return (
10
+ <div className="flex flex-col gap-4">
11
+ <Button
12
+ onClick={() =>
13
+ toast({
14
+ title: "Success!",
15
+ description: "Your action was completed successfully.",
16
+ })
17
+ }
18
+ >
19
+ Show Default Toast
20
+ </Button>
21
+
22
+ <Button
23
+ variant="destructive"
24
+ onClick={() =>
25
+ toast({
26
+ title: "Error!",
27
+ description: "Something went wrong.",
28
+ variant: "destructive",
29
+ })
30
+ }
31
+ >
32
+ Show Error Toast
33
+ </Button>
34
+
35
+ <Button
36
+ variant="outline"
37
+ onClick={() =>
38
+ toast({
39
+ title: "Scheduled",
40
+ description: "Event has been scheduled for tomorrow.",
41
+ })
42
+ }
43
+ >
44
+ Show Info Toast
45
+ </Button>
46
+
47
+ <Toaster />
48
+ </div>
49
+ )
50
+ }
51
+
52
+ const meta: Meta<typeof Toaster> = {
53
+ title: "Components/Feedback/Toaster",
54
+ component: Toaster,
55
+ parameters: {
56
+ layout: "centered",
57
+ },
58
+ tags: ["autodocs"],
59
+ }
60
+
61
+ export default meta
62
+ type Story = StoryObj<typeof Toaster>
63
+
64
+ export const Default: Story = {
65
+ render: () => <ToasterDemo />,
66
+ }
67
+
@@ -0,0 +1,116 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaActivityFeed, Activity, ActivityType } from "./index"
3
+
4
+ const sampleActivities: Activity[] = [
5
+ {
6
+ id: "1",
7
+ type: "achievement",
8
+ user: { id: "u1", name: "Alice Johnson", avatar: "https://i.pravatar.cc/150?u=alice" },
9
+ content: "Unlocked the 'Early Bird' achievement",
10
+ timestamp: new Date(Date.now() - 5 * 60 * 1000),
11
+ likes: 12,
12
+ liked: false,
13
+ },
14
+ {
15
+ id: "2",
16
+ type: "level_up",
17
+ user: { id: "u2", name: "Bob Smith" },
18
+ content: "Reached Level 25",
19
+ timestamp: new Date(Date.now() - 15 * 60 * 1000),
20
+ likes: 8,
21
+ liked: true,
22
+ },
23
+ {
24
+ id: "3",
25
+ type: "challenge",
26
+ user: { id: "u3", name: "Carol White", avatar: "https://i.pravatar.cc/150?u=carol" },
27
+ content: "Completed the Weekly Challenge",
28
+ timestamp: new Date(Date.now() - 60 * 60 * 1000),
29
+ likes: 24,
30
+ },
31
+ {
32
+ id: "4",
33
+ type: "purchase",
34
+ user: { id: "u4", name: "Dave Brown" },
35
+ content: "Purchased Premium Subscription",
36
+ timestamp: new Date(Date.now() - 2 * 60 * 60 * 1000),
37
+ likes: 3,
38
+ },
39
+ {
40
+ id: "5",
41
+ type: "milestone",
42
+ user: { id: "u5", name: "Eve Davis", avatar: "https://i.pravatar.cc/150?u=eve" },
43
+ content: "Reached 1000 XP milestone",
44
+ timestamp: new Date(Date.now() - 24 * 60 * 60 * 1000),
45
+ likes: 45,
46
+ },
47
+ ]
48
+
49
+ const meta: Meta<typeof WakaActivityFeed> = {
50
+ title: "Components/Gamification/WakaActivityFeed",
51
+ component: WakaActivityFeed,
52
+ parameters: {
53
+ layout: "padded",
54
+ },
55
+ tags: ["autodocs"],
56
+ argTypes: {
57
+ showLikes: {
58
+ control: "boolean",
59
+ description: "Show like button and count",
60
+ },
61
+ groupSimilar: {
62
+ control: "boolean",
63
+ description: "Group similar activities",
64
+ },
65
+ animated: {
66
+ control: "boolean",
67
+ description: "Enable animations",
68
+ },
69
+ hasMore: {
70
+ control: "boolean",
71
+ description: "Show load more button",
72
+ },
73
+ loading: {
74
+ control: "boolean",
75
+ description: "Loading state",
76
+ },
77
+ },
78
+ }
79
+
80
+ export default meta
81
+ type Story = StoryObj<typeof WakaActivityFeed>
82
+
83
+ export const Default: Story = {
84
+ args: {
85
+ activities: sampleActivities,
86
+ showLikes: true,
87
+ animated: true,
88
+ hasMore: true,
89
+ },
90
+ render: (args) => <WakaActivityFeed {...args} />,
91
+ }
92
+
93
+ export const WithoutLikes: Story = {
94
+ args: {
95
+ activities: sampleActivities,
96
+ showLikes: false,
97
+ animated: true,
98
+ },
99
+ render: (args) => <WakaActivityFeed {...args} />,
100
+ }
101
+
102
+ export const Loading: Story = {
103
+ args: {
104
+ activities: sampleActivities.slice(0, 2),
105
+ loading: true,
106
+ },
107
+ render: (args) => <WakaActivityFeed {...args} />,
108
+ }
109
+
110
+ export const Empty: Story = {
111
+ args: {
112
+ activities: [],
113
+ },
114
+ render: (args) => <WakaActivityFeed {...args} />,
115
+ }
116
+
@@ -0,0 +1,102 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaAdBanner } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ customAdServer: "https://ads.example.com",
8
+ testMode: true,
9
+ debugMode: true,
10
+ }
11
+
12
+ const meta: Meta<typeof WakaAdBanner> = {
13
+ title: "Components/Ads/WakaAdBanner",
14
+ component: WakaAdBanner,
15
+ parameters: {
16
+ layout: "centered",
17
+ },
18
+ tags: ["autodocs"],
19
+ decorators: [
20
+ (Story) => (
21
+ <WakaAdProvider config={mockAdConfig}>
22
+ <Story />
23
+ </WakaAdProvider>
24
+ ),
25
+ ],
26
+ argTypes: {
27
+ size: {
28
+ control: "select",
29
+ options: ["leaderboard", "rectangle", "skyscraper", "billboard", "mobile-banner", "custom"],
30
+ description: "Ad size preset",
31
+ },
32
+ showBadge: {
33
+ control: "boolean",
34
+ description: "Show sponsored badge",
35
+ },
36
+ badgePosition: {
37
+ control: "select",
38
+ options: ["top-left", "top-right", "bottom-left", "bottom-right"],
39
+ description: "Position of the sponsored badge",
40
+ },
41
+ lazyLoad: {
42
+ control: "boolean",
43
+ description: "Enable lazy loading",
44
+ },
45
+ refreshInterval: {
46
+ control: "number",
47
+ description: "Auto-refresh interval in seconds",
48
+ },
49
+ },
50
+ }
51
+
52
+ export default meta
53
+ type Story = StoryObj<typeof WakaAdBanner>
54
+
55
+ export const Rectangle: Story = {
56
+ args: {
57
+ slotId: "ad-rectangle-1",
58
+ size: "rectangle",
59
+ showBadge: true,
60
+ badgePosition: "top-right",
61
+ },
62
+ render: (args) => <WakaAdBanner {...args} />,
63
+ }
64
+
65
+ export const Leaderboard: Story = {
66
+ args: {
67
+ slotId: "ad-leaderboard-1",
68
+ size: "leaderboard",
69
+ showBadge: true,
70
+ },
71
+ render: (args) => <WakaAdBanner {...args} />,
72
+ }
73
+
74
+ export const Skyscraper: Story = {
75
+ args: {
76
+ slotId: "ad-skyscraper-1",
77
+ size: "skyscraper",
78
+ showBadge: true,
79
+ },
80
+ render: (args) => <WakaAdBanner {...args} />,
81
+ }
82
+
83
+ export const MobileBanner: Story = {
84
+ args: {
85
+ slotId: "ad-mobile-1",
86
+ size: "mobile-banner",
87
+ showBadge: false,
88
+ },
89
+ render: (args) => <WakaAdBanner {...args} />,
90
+ }
91
+
92
+ export const Custom: Story = {
93
+ args: {
94
+ slotId: "ad-custom-1",
95
+ size: "custom",
96
+ customWidth: 400,
97
+ customHeight: 150,
98
+ showBadge: true,
99
+ },
100
+ render: (args) => <WakaAdBanner {...args} />,
101
+ }
102
+