@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,142 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaTwoFactorSetup, type TwoFactorSetupConfig, type BackupCode } from "./index"
3
+
4
+ const meta: Meta<typeof WakaTwoFactorSetup> = {
5
+ title: "Security/WakaTwoFactorSetup",
6
+ component: WakaTwoFactorSetup,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ initialStep: {
11
+ control: "select",
12
+ options: ["intro", "qr-code", "backup-codes", "verify", "success"],
13
+ description: "Etape initiale",
14
+ },
15
+ showStepIndicator: { control: "boolean", description: "Afficher l'indicateur d'etapes" },
16
+ allowSkipBackupCodes: { control: "boolean", description: "Permettre de sauter les codes de secours" },
17
+ isLoading: { control: "boolean", description: "Etat de chargement" },
18
+ },
19
+ }
20
+
21
+ export default meta
22
+ type Story = StoryObj<typeof WakaTwoFactorSetup>
23
+
24
+ const backupCodes: BackupCode[] = [
25
+ { code: "ABCD-1234", used: false },
26
+ { code: "EFGH-5678", used: false },
27
+ { code: "IJKL-9012", used: false },
28
+ { code: "MNOP-3456", used: false },
29
+ { code: "QRST-7890", used: false },
30
+ { code: "UVWX-1234", used: false },
31
+ ]
32
+
33
+ const config: TwoFactorSetupConfig = {
34
+ secretKey: "JBSWY3DPEHPK3PXP",
35
+ qrCodeUrl: "https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=otpauth://totp/WakaStart:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=WakaStart",
36
+ issuer: "WakaStart",
37
+ accountName: "user@example.com",
38
+ backupCodes,
39
+ }
40
+
41
+ const mockVerify = async (code: string): Promise<boolean> => {
42
+ // Simulate API call
43
+ await new Promise((resolve) => setTimeout(resolve, 1000))
44
+ return code === "123456"
45
+ }
46
+
47
+ export const Default: Story = {
48
+ args: {
49
+ config,
50
+ initialStep: "intro",
51
+ onVerify: mockVerify,
52
+ onComplete: () => console.log("2FA setup completed"),
53
+ onCancel: () => console.log("2FA setup cancelled"),
54
+ },
55
+ render: (args) => (
56
+ <div style={{ width: 400 }}>
57
+ <WakaTwoFactorSetup {...args} />
58
+ </div>
59
+ ),
60
+ }
61
+
62
+ export const QRCodeStep: Story = {
63
+ args: {
64
+ config,
65
+ initialStep: "qr-code",
66
+ onVerify: mockVerify,
67
+ },
68
+ render: (args) => (
69
+ <div style={{ width: 400 }}>
70
+ <WakaTwoFactorSetup {...args} />
71
+ </div>
72
+ ),
73
+ }
74
+
75
+ export const BackupCodesStep: Story = {
76
+ args: {
77
+ config,
78
+ initialStep: "backup-codes",
79
+ onVerify: mockVerify,
80
+ },
81
+ render: (args) => (
82
+ <div style={{ width: 400 }}>
83
+ <WakaTwoFactorSetup {...args} />
84
+ </div>
85
+ ),
86
+ }
87
+
88
+ export const VerifyStep: Story = {
89
+ args: {
90
+ config,
91
+ initialStep: "verify",
92
+ onVerify: mockVerify,
93
+ },
94
+ render: (args) => (
95
+ <div style={{ width: 400 }}>
96
+ <WakaTwoFactorSetup {...args} />
97
+ </div>
98
+ ),
99
+ }
100
+
101
+ export const SuccessStep: Story = {
102
+ args: {
103
+ config,
104
+ initialStep: "success",
105
+ onVerify: mockVerify,
106
+ onComplete: () => console.log("Done clicked"),
107
+ },
108
+ render: (args) => (
109
+ <div style={{ width: 400 }}>
110
+ <WakaTwoFactorSetup {...args} />
111
+ </div>
112
+ ),
113
+ }
114
+
115
+ export const Loading: Story = {
116
+ args: {
117
+ config,
118
+ initialStep: "intro",
119
+ onVerify: mockVerify,
120
+ isLoading: true,
121
+ },
122
+ render: (args) => (
123
+ <div style={{ width: 400 }}>
124
+ <WakaTwoFactorSetup {...args} />
125
+ </div>
126
+ ),
127
+ }
128
+
129
+ export const WithError: Story = {
130
+ args: {
131
+ config,
132
+ initialStep: "intro",
133
+ onVerify: mockVerify,
134
+ error: "Failed to initialize two-factor authentication. Please try again.",
135
+ onCancel: () => console.log("Go back clicked"),
136
+ },
137
+ render: (args) => (
138
+ <div style={{ width: 400 }}>
139
+ <WakaTwoFactorSetup {...args} />
140
+ </div>
141
+ ),
142
+ }
@@ -0,0 +1,134 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaTypingIndicator, type TypingUser } from "./index"
3
+
4
+ const meta: Meta<typeof WakaTypingIndicator> = {
5
+ title: "Communication/WakaTypingIndicator",
6
+ component: WakaTypingIndicator,
7
+ parameters: {
8
+ layout: "centered",
9
+ },
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ variant: {
13
+ control: "select",
14
+ options: ["dots", "text", "pulse"],
15
+ description: "Style de l'indicateur",
16
+ },
17
+ size: {
18
+ control: "select",
19
+ options: ["sm", "md", "lg"],
20
+ description: "Taille de l'indicateur",
21
+ },
22
+ animationSpeed: {
23
+ control: { type: "number", min: 100, max: 1000 },
24
+ description: "Vitesse d'animation en ms",
25
+ },
26
+ autoHideTimeout: {
27
+ control: "number",
28
+ description: "Timeout auto-hide en ms (0 pour désactiver)",
29
+ },
30
+ showAvatars: {
31
+ control: "boolean",
32
+ description: "Afficher les avatars",
33
+ },
34
+ maxAvatars: {
35
+ control: "number",
36
+ description: "Nombre maximum d'avatars",
37
+ },
38
+ visible: {
39
+ control: "boolean",
40
+ description: "Visibilité de l'indicateur",
41
+ },
42
+ customText: {
43
+ control: "text",
44
+ description: "Texte personnalisé",
45
+ },
46
+ },
47
+ }
48
+
49
+ export default meta
50
+ type Story = StoryObj<typeof WakaTypingIndicator>
51
+
52
+ const typingUsers: TypingUser[] = [
53
+ { id: "1", name: "Alice", avatar: "https://i.pravatar.cc/150?u=alice" },
54
+ { id: "2", name: "Bob", avatar: "https://i.pravatar.cc/150?u=bob" },
55
+ { id: "3", name: "Charlie", avatar: "https://i.pravatar.cc/150?u=charlie" },
56
+ ]
57
+
58
+ export const Default: Story = {
59
+ args: {
60
+ users: [typingUsers[0]],
61
+ variant: "dots",
62
+ size: "md",
63
+ visible: true,
64
+ showAvatars: true,
65
+ },
66
+ render: (args) => <WakaTypingIndicator {...args} />,
67
+ }
68
+
69
+ export const MultipleUsers: Story = {
70
+ args: {
71
+ users: typingUsers,
72
+ variant: "dots",
73
+ size: "md",
74
+ visible: true,
75
+ showAvatars: true,
76
+ maxAvatars: 3,
77
+ },
78
+ render: (args) => <WakaTypingIndicator {...args} />,
79
+ }
80
+
81
+ export const TextVariant: Story = {
82
+ args: {
83
+ users: [typingUsers[0]],
84
+ variant: "text",
85
+ size: "md",
86
+ visible: true,
87
+ showAvatars: true,
88
+ },
89
+ render: (args) => <WakaTypingIndicator {...args} />,
90
+ }
91
+
92
+ export const PulseVariant: Story = {
93
+ args: {
94
+ users: [typingUsers[0], typingUsers[1]],
95
+ variant: "pulse",
96
+ size: "md",
97
+ visible: true,
98
+ showAvatars: false,
99
+ },
100
+ render: (args) => <WakaTypingIndicator {...args} />,
101
+ }
102
+
103
+ export const CustomText: Story = {
104
+ args: {
105
+ users: typingUsers,
106
+ variant: "dots",
107
+ size: "lg",
108
+ visible: true,
109
+ customText: "Plusieurs personnes écrivent...",
110
+ },
111
+ render: (args) => <WakaTypingIndicator {...args} />,
112
+ }
113
+
114
+ export const SmallSize: Story = {
115
+ args: {
116
+ users: [typingUsers[0]],
117
+ variant: "dots",
118
+ size: "sm",
119
+ visible: true,
120
+ },
121
+ render: (args) => <WakaTypingIndicator {...args} />,
122
+ }
123
+
124
+ export const LargeSize: Story = {
125
+ args: {
126
+ users: [typingUsers[0]],
127
+ variant: "dots",
128
+ size: "lg",
129
+ visible: true,
130
+ showAvatars: true,
131
+ },
132
+ render: (args) => <WakaTypingIndicator {...args} />,
133
+ }
134
+
@@ -0,0 +1,138 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaVideoAd } from "./index"
3
+ import { WakaAdProvider } from "../waka-ad-provider"
4
+
5
+ const mockAdConfig = {
6
+ network: "custom" as const,
7
+ testMode: true,
8
+ debugMode: true,
9
+ }
10
+
11
+ const meta: Meta<typeof WakaVideoAd> = {
12
+ title: "Components/Ads/WakaVideoAd",
13
+ component: WakaVideoAd,
14
+ parameters: {
15
+ layout: "centered",
16
+ },
17
+ tags: ["autodocs"],
18
+ decorators: [
19
+ (Story) => (
20
+ <WakaAdProvider config={mockAdConfig}>
21
+ <Story />
22
+ </WakaAdProvider>
23
+ ),
24
+ ],
25
+ argTypes: {
26
+ width: {
27
+ control: "number",
28
+ description: "Video width",
29
+ },
30
+ height: {
31
+ control: "number",
32
+ description: "Video height",
33
+ },
34
+ aspectRatio: {
35
+ control: "select",
36
+ options: ["16/9", "4/3", "1/1", "9/16"],
37
+ description: "Aspect ratio",
38
+ },
39
+ autoplay: {
40
+ control: "boolean",
41
+ description: "Autoplay when visible",
42
+ },
43
+ muted: {
44
+ control: "boolean",
45
+ description: "Mute by default",
46
+ },
47
+ showControls: {
48
+ control: "boolean",
49
+ description: "Show video controls",
50
+ },
51
+ skipAfter: {
52
+ control: "number",
53
+ description: "Skip time in seconds (0 = no skip)",
54
+ },
55
+ showProgress: {
56
+ control: "boolean",
57
+ description: "Show progress bar",
58
+ },
59
+ ctaPosition: {
60
+ control: "select",
61
+ options: ["bottom", "overlay", "end"],
62
+ description: "CTA button position",
63
+ },
64
+ },
65
+ }
66
+
67
+ export default meta
68
+ type Story = StoryObj<typeof WakaVideoAd>
69
+
70
+ export const Default: Story = {
71
+ args: {
72
+ slotId: "video-ad-1",
73
+ width: 640,
74
+ aspectRatio: "16/9",
75
+ autoplay: true,
76
+ muted: true,
77
+ showControls: true,
78
+ skipAfter: 5,
79
+ showProgress: true,
80
+ ctaPosition: "bottom",
81
+ },
82
+ render: (args) => <WakaVideoAd {...args} />,
83
+ }
84
+
85
+ export const OverlayCTA: Story = {
86
+ args: {
87
+ slotId: "video-ad-2",
88
+ width: 640,
89
+ aspectRatio: "16/9",
90
+ autoplay: true,
91
+ muted: true,
92
+ showControls: true,
93
+ skipAfter: 5,
94
+ ctaPosition: "overlay",
95
+ },
96
+ render: (args) => <WakaVideoAd {...args} />,
97
+ }
98
+
99
+ export const EndScreenCTA: Story = {
100
+ args: {
101
+ slotId: "video-ad-3",
102
+ width: 640,
103
+ aspectRatio: "16/9",
104
+ autoplay: true,
105
+ muted: true,
106
+ skipAfter: 0,
107
+ ctaPosition: "end",
108
+ },
109
+ render: (args) => <WakaVideoAd {...args} />,
110
+ }
111
+
112
+ export const Square: Story = {
113
+ args: {
114
+ slotId: "video-ad-4",
115
+ width: 400,
116
+ aspectRatio: "1/1",
117
+ autoplay: true,
118
+ muted: true,
119
+ showControls: true,
120
+ skipAfter: 3,
121
+ },
122
+ render: (args) => <WakaVideoAd {...args} />,
123
+ }
124
+
125
+ export const NoSkip: Story = {
126
+ args: {
127
+ slotId: "video-ad-5",
128
+ width: 640,
129
+ aspectRatio: "16/9",
130
+ autoplay: true,
131
+ muted: true,
132
+ showControls: true,
133
+ skipAfter: 0,
134
+ showProgress: true,
135
+ },
136
+ render: (args) => <WakaVideoAd {...args} />,
137
+ }
138
+
@@ -0,0 +1,186 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaVideoCall, type Participant } from "./index"
3
+
4
+ const meta: Meta<typeof WakaVideoCall> = {
5
+ title: "Communication/WakaVideoCall",
6
+ component: WakaVideoCall,
7
+ parameters: {
8
+ layout: "fullscreen",
9
+ },
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ layout: {
13
+ control: "select",
14
+ options: ["grid", "speaker", "sidebar"],
15
+ description: "Disposition des participants",
16
+ },
17
+ isRecording: {
18
+ control: "boolean",
19
+ description: "Enregistrement en cours",
20
+ },
21
+ showChat: {
22
+ control: "boolean",
23
+ description: "Afficher le chat",
24
+ },
25
+ showParticipantsList: {
26
+ control: "boolean",
27
+ description: "Afficher la liste des participants",
28
+ },
29
+ isPictureInPicture: {
30
+ control: "boolean",
31
+ description: "Mode picture-in-picture",
32
+ },
33
+ isFullscreen: {
34
+ control: "boolean",
35
+ description: "Mode plein écran",
36
+ },
37
+ },
38
+ }
39
+
40
+ export default meta
41
+ type Story = StoryObj<typeof WakaVideoCall>
42
+
43
+ const participants: Participant[] = [
44
+ {
45
+ id: "local",
46
+ name: "Vous",
47
+ avatar: "https://i.pravatar.cc/150?u=local",
48
+ isMuted: false,
49
+ isVideoOff: false,
50
+ isScreenSharing: false,
51
+ hasRaisedHand: false,
52
+ isSpeaking: false,
53
+ isPinned: false,
54
+ isLocal: true,
55
+ connectionQuality: "excellent",
56
+ },
57
+ {
58
+ id: "2",
59
+ name: "Alice Martin",
60
+ avatar: "https://i.pravatar.cc/150?u=alice",
61
+ isMuted: false,
62
+ isVideoOff: false,
63
+ isScreenSharing: false,
64
+ hasRaisedHand: false,
65
+ isSpeaking: true,
66
+ isPinned: false,
67
+ connectionQuality: "good",
68
+ },
69
+ {
70
+ id: "3",
71
+ name: "Bob Dupont",
72
+ avatar: "https://i.pravatar.cc/150?u=bob",
73
+ isMuted: true,
74
+ isVideoOff: true,
75
+ isScreenSharing: false,
76
+ hasRaisedHand: false,
77
+ isSpeaking: false,
78
+ isPinned: false,
79
+ connectionQuality: "fair",
80
+ },
81
+ {
82
+ id: "4",
83
+ name: "Charlie Bernard",
84
+ avatar: "https://i.pravatar.cc/150?u=charlie",
85
+ isMuted: false,
86
+ isVideoOff: false,
87
+ isScreenSharing: false,
88
+ hasRaisedHand: true,
89
+ isSpeaking: false,
90
+ isPinned: false,
91
+ connectionQuality: "excellent",
92
+ },
93
+ ]
94
+
95
+ export const Default: Story = {
96
+ args: {
97
+ participants,
98
+ localParticipantId: "local",
99
+ layout: "grid",
100
+ isRecording: false,
101
+ callStartTime: new Date(),
102
+ },
103
+ render: (args) => (
104
+ <div style={{ height: "100vh" }}>
105
+ <WakaVideoCall {...args} />
106
+ </div>
107
+ ),
108
+ }
109
+
110
+ export const SpeakerView: Story = {
111
+ args: {
112
+ participants,
113
+ localParticipantId: "local",
114
+ layout: "speaker",
115
+ isRecording: false,
116
+ callStartTime: new Date(),
117
+ },
118
+ render: (args) => (
119
+ <div style={{ height: "100vh" }}>
120
+ <WakaVideoCall {...args} />
121
+ </div>
122
+ ),
123
+ }
124
+
125
+ export const SidebarView: Story = {
126
+ args: {
127
+ participants,
128
+ localParticipantId: "local",
129
+ layout: "sidebar",
130
+ showChat: true,
131
+ callStartTime: new Date(),
132
+ },
133
+ render: (args) => (
134
+ <div style={{ height: "100vh" }}>
135
+ <WakaVideoCall {...args} />
136
+ </div>
137
+ ),
138
+ }
139
+
140
+ export const Recording: Story = {
141
+ args: {
142
+ participants: participants.slice(0, 2),
143
+ localParticipantId: "local",
144
+ layout: "grid",
145
+ isRecording: true,
146
+ callStartTime: new Date(Date.now() - 300000),
147
+ },
148
+ render: (args) => (
149
+ <div style={{ height: "100vh" }}>
150
+ <WakaVideoCall {...args} />
151
+ </div>
152
+ ),
153
+ }
154
+
155
+ export const ScreenSharing: Story = {
156
+ args: {
157
+ participants: [
158
+ participants[0],
159
+ { ...participants[1], isScreenSharing: true },
160
+ ...participants.slice(2),
161
+ ],
162
+ localParticipantId: "local",
163
+ layout: "speaker",
164
+ callStartTime: new Date(),
165
+ },
166
+ render: (args) => (
167
+ <div style={{ height: "100vh" }}>
168
+ <WakaVideoCall {...args} />
169
+ </div>
170
+ ),
171
+ }
172
+
173
+ export const TwoParticipants: Story = {
174
+ args: {
175
+ participants: participants.slice(0, 2),
176
+ localParticipantId: "local",
177
+ layout: "grid",
178
+ callStartTime: new Date(),
179
+ },
180
+ render: (args) => (
181
+ <div style={{ height: "100vh" }}>
182
+ <WakaVideoCall {...args} />
183
+ </div>
184
+ ),
185
+ }
186
+
@@ -0,0 +1,100 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import * as React from "react"
3
+ import { WakaVideoOverlay } from "./index"
4
+ import { WakaAdProvider } from "../waka-ad-provider"
5
+
6
+ const meta: Meta<typeof WakaVideoOverlay> = {
7
+ title: "Sponsoring/WakaVideoOverlay",
8
+ component: WakaVideoOverlay,
9
+ parameters: { layout: "centered" },
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ position: { control: "select", options: ["bottom", "top", "corner"], description: "Position" },
13
+ trigger: { control: "select", options: ["start", "pause", "time", "manual"], description: "Trigger" },
14
+ triggerTime: { control: "number", description: "Temps de déclenchement (sec)" },
15
+ dismissable: { control: "boolean", description: "Fermeture possible" },
16
+ hideAfter: { control: "number", description: "Masquer après (sec)" },
17
+ visible: { control: "boolean", description: "Visible" },
18
+ },
19
+ }
20
+
21
+ export default meta
22
+ type Story = StoryObj<typeof WakaVideoOverlay>
23
+
24
+ const mockAd = {
25
+ id: "mock-ad-1",
26
+ imageUrl: "https://picsum.photos/seed/ad-video/600/300",
27
+ targetUrl: "https://example.com",
28
+ title: "Offre spéciale partenaires",
29
+ description: "Découvrez nos solutions pour booster votre croissance.",
30
+ sponsor: "WakaStart",
31
+ cta: "En savoir plus",
32
+ }
33
+
34
+ const MockedOverlay = (props: React.ComponentProps<typeof WakaVideoOverlay>) => {
35
+ React.useEffect(() => {
36
+ if (typeof window === "undefined") return
37
+ const originalFetch = window.fetch.bind(window)
38
+ window.fetch = async (input: RequestInfo, init?: RequestInit) => {
39
+ if (typeof input === "string" && input.startsWith("https://mock-ads.local")) {
40
+ return new Response(JSON.stringify(mockAd), {
41
+ status: 200,
42
+ headers: { "Content-Type": "application/json" },
43
+ })
44
+ }
45
+ return originalFetch(input, init)
46
+ }
47
+ return () => {
48
+ window.fetch = originalFetch
49
+ }
50
+ }, [])
51
+
52
+ return (
53
+ <WakaAdProvider
54
+ config={{
55
+ network: "custom",
56
+ customAdServer: "https://mock-ads.local",
57
+ enableConsent: false,
58
+ testMode: true,
59
+ }}
60
+ >
61
+ <div style={{ width: 640, height: 360, position: "relative", background: "#0f172a" }}>
62
+ <WakaVideoOverlay {...props} />
63
+ </div>
64
+ </WakaAdProvider>
65
+ )
66
+ }
67
+
68
+ export const Corner: Story = {
69
+ args: {
70
+ slotId: "video-ad-1",
71
+ position: "corner",
72
+ trigger: "manual",
73
+ visible: true,
74
+ dismissable: true,
75
+ },
76
+ render: (args) => <MockedOverlay {...args} />,
77
+ }
78
+
79
+ export const TopBanner: Story = {
80
+ args: {
81
+ slotId: "video-ad-2",
82
+ position: "top",
83
+ trigger: "manual",
84
+ visible: true,
85
+ dismissable: true,
86
+ },
87
+ render: (args) => <MockedOverlay {...args} />,
88
+ }
89
+
90
+ export const BottomBanner: Story = {
91
+ args: {
92
+ slotId: "video-ad-3",
93
+ position: "bottom",
94
+ trigger: "manual",
95
+ visible: true,
96
+ dismissable: true,
97
+ },
98
+ render: (args) => <MockedOverlay {...args} />,
99
+ }
100
+