@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,128 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaComboCounter, useComboCounter } from "./index"
3
+ import { Button } from "../button"
4
+ import * as React from "react"
5
+
6
+ const InteractiveDemo = () => {
7
+ const { combo, multiplier, timeRemaining, increment, reset } = useComboCounter({
8
+ timerDuration: 3000,
9
+ autoDecay: true,
10
+ })
11
+
12
+ return (
13
+ <div className="flex flex-col items-center gap-4">
14
+ <WakaComboCounter
15
+ combo={combo}
16
+ multiplier={multiplier}
17
+ timeRemaining={timeRemaining}
18
+ size="lg"
19
+ showTimer
20
+ showMultiplier
21
+ animated
22
+ />
23
+ <div className="flex gap-2">
24
+ <Button onClick={() => increment()}>+1 Combo</Button>
25
+ <Button onClick={() => increment(5)} variant="secondary">+5 Combo</Button>
26
+ <Button onClick={reset} variant="destructive">Reset</Button>
27
+ </div>
28
+ </div>
29
+ )
30
+ }
31
+
32
+ const meta: Meta<typeof WakaComboCounter> = {
33
+ title: "Components/Gamification/WakaComboCounter",
34
+ component: WakaComboCounter,
35
+ parameters: {
36
+ layout: "centered",
37
+ },
38
+ tags: ["autodocs"],
39
+ argTypes: {
40
+ size: {
41
+ control: "select",
42
+ options: ["sm", "md", "lg", "xl"],
43
+ description: "Size variant",
44
+ },
45
+ intensity: {
46
+ control: "select",
47
+ options: ["low", "medium", "high", "extreme"],
48
+ description: "Visual intensity",
49
+ },
50
+ showTimer: {
51
+ control: "boolean",
52
+ description: "Show timer bar",
53
+ },
54
+ showMultiplier: {
55
+ control: "boolean",
56
+ description: "Show multiplier badge",
57
+ },
58
+ animated: {
59
+ control: "boolean",
60
+ description: "Enable animations",
61
+ },
62
+ },
63
+ }
64
+
65
+ export default meta
66
+ type Story = StoryObj<typeof WakaComboCounter>
67
+
68
+ export const Default: Story = {
69
+ args: {
70
+ combo: 15,
71
+ multiplier: 2,
72
+ timeRemaining: 75,
73
+ size: "md",
74
+ intensity: "medium",
75
+ showTimer: true,
76
+ showMultiplier: true,
77
+ animated: true,
78
+ },
79
+ render: (args) => <WakaComboCounter {...args} />,
80
+ }
81
+
82
+ export const HighCombo: Story = {
83
+ args: {
84
+ combo: 50,
85
+ multiplier: 5,
86
+ timeRemaining: 60,
87
+ size: "lg",
88
+ intensity: "high",
89
+ showTimer: true,
90
+ showMultiplier: true,
91
+ animated: true,
92
+ },
93
+ render: (args) => <WakaComboCounter {...args} />,
94
+ }
95
+
96
+ export const Extreme: Story = {
97
+ args: {
98
+ combo: 100,
99
+ multiplier: 10,
100
+ maxMultiplier: 10,
101
+ timeRemaining: 40,
102
+ size: "xl",
103
+ intensity: "extreme",
104
+ showTimer: true,
105
+ showMultiplier: true,
106
+ animated: true,
107
+ },
108
+ render: (args) => <WakaComboCounter {...args} />,
109
+ }
110
+
111
+ export const Compact: Story = {
112
+ args: {
113
+ combo: 8,
114
+ multiplier: 1,
115
+ timeRemaining: 90,
116
+ size: "sm",
117
+ intensity: "low",
118
+ showTimer: true,
119
+ showMultiplier: false,
120
+ animated: true,
121
+ },
122
+ render: (args) => <WakaComboCounter {...args} />,
123
+ }
124
+
125
+ export const Interactive: Story = {
126
+ render: () => <InteractiveDemo />,
127
+ }
128
+
@@ -0,0 +1,45 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaCommandBar, type CommandItem } from "./index"
3
+ import { Settings, User, FileText, Search, Zap } from "lucide-react"
4
+
5
+ const meta: Meta<typeof WakaCommandBar> = {
6
+ title: "Navigation/WakaCommandBar",
7
+ component: WakaCommandBar,
8
+ parameters: { layout: "centered" },
9
+ tags: ["autodocs"],
10
+ argTypes: {
11
+ placeholder: { control: "text", description: "Placeholder" },
12
+ showShortcuts: { control: "boolean", description: "Raccourcis clavier" },
13
+ showCategories: { control: "boolean", description: "Afficher les catégories" },
14
+ },
15
+ }
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof WakaCommandBar>
19
+
20
+ const commands: CommandItem[] = [
21
+ { id: "search", label: "Rechercher", icon: <Search className="tw-h-4 tw-w-4" />, shortcut: ["⌘", "K"], category: "Navigation" },
22
+ { id: "settings", label: "Paramètres", icon: <Settings className="tw-h-4 tw-w-4" />, shortcut: ["⌘", ","], category: "Navigation" },
23
+ { id: "profile", label: "Mon profil", icon: <User className="tw-h-4 tw-w-4" />, category: "Compte" },
24
+ { id: "docs", label: "Documentation", icon: <FileText className="tw-h-4 tw-w-4" />, category: "Aide" },
25
+ { id: "actions", label: "Actions rapides", icon: <Zap className="tw-h-4 tw-w-4" />, category: "Actions" },
26
+ ]
27
+
28
+ export const Default: Story = {
29
+ args: { commands, placeholder: "Tapez une commande...", showShortcuts: true, showCategories: true },
30
+ render: (args) => (
31
+ <div style={{ width: 500 }}>
32
+ <WakaCommandBar {...args} />
33
+ </div>
34
+ ),
35
+ }
36
+
37
+ export const NoCategories: Story = {
38
+ args: { commands, placeholder: "Rechercher...", showCategories: false },
39
+ render: (args) => (
40
+ <div style={{ width: 500 }}>
41
+ <WakaCommandBar {...args} />
42
+ </div>
43
+ ),
44
+ }
45
+
@@ -0,0 +1,76 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaComparePeriod } from "./index"
3
+
4
+ const meta: Meta<typeof WakaComparePeriod> = {
5
+ title: "Admin/WakaComparePeriod",
6
+ component: WakaComparePeriod,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ preset: { control: "select", options: ["last_week", "last_month", "last_quarter", "last_year", "custom"], description: "Préréglage" },
11
+ showChart: { control: "boolean", description: "Afficher le graphique" },
12
+ showPercentage: { control: "boolean", description: "Afficher les pourcentages" },
13
+ },
14
+ }
15
+
16
+ export default meta
17
+ type Story = StoryObj<typeof WakaComparePeriod>
18
+
19
+ const metrics = [
20
+ { id: "revenue", label: "Revenu", current: 45000, previous: 38000, format: "currency" as const },
21
+ { id: "users", label: "Utilisateurs", current: 1250, previous: 1100, format: "number" as const },
22
+ { id: "conversion", label: "Conversion", current: 3.5, previous: 3.2, format: "percent" as const },
23
+ ]
24
+
25
+ export const Default: Story = {
26
+ args: {
27
+ metrics,
28
+ preset: "last_month",
29
+ currentPeriod: { start: new Date("2024-01-01"), end: new Date("2024-01-31") },
30
+ previousPeriod: { start: new Date("2023-12-01"), end: new Date("2023-12-31") },
31
+ showChart: true,
32
+ showPercentage: true,
33
+ },
34
+ render: (args) => (
35
+ <div style={{ width: 500 }}>
36
+ <WakaComparePeriod {...args} />
37
+ </div>
38
+ ),
39
+ }
40
+
41
+ export const WeekComparison: Story = {
42
+ args: {
43
+ metrics,
44
+ preset: "last_week",
45
+ showChart: true,
46
+ showPercentage: true,
47
+ },
48
+ render: (args) => (
49
+ <div style={{ width: 500 }}>
50
+ <WakaComparePeriod {...args} />
51
+ </div>
52
+ ),
53
+ }
54
+
55
+ export const NegativeTrend: Story = {
56
+ args: {
57
+ metrics: metrics.map(m => ({ ...m, current: m.previous * 0.9, previous: m.current })),
58
+ preset: "last_month",
59
+ showPercentage: true,
60
+ },
61
+ render: (args) => (
62
+ <div style={{ width: 500 }}>
63
+ <WakaComparePeriod {...args} />
64
+ </div>
65
+ ),
66
+ }
67
+
68
+ export const NoChart: Story = {
69
+ args: { metrics, preset: "last_quarter", showChart: false, showPercentage: true },
70
+ render: (args) => (
71
+ <div style={{ width: 400 }}>
72
+ <WakaComparePeriod {...args} />
73
+ </div>
74
+ ),
75
+ }
76
+
@@ -0,0 +1,143 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaConfigComparator, defaultConfigEnvironments, type ConfigEnvironment } from "./index"
3
+
4
+ const meta: Meta<typeof WakaConfigComparator> = {
5
+ title: "DevOps/WakaConfigComparator",
6
+ component: WakaConfigComparator,
7
+ parameters: { layout: "padded" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ showDiffsOnly: { control: "boolean", description: "Afficher uniquement les différences" },
11
+ title: { control: "text", description: "Titre du comparateur" },
12
+ },
13
+ }
14
+
15
+ export default meta
16
+ type Story = StoryObj<typeof WakaConfigComparator>
17
+
18
+ const environments: ConfigEnvironment[] = [
19
+ {
20
+ id: "dev",
21
+ name: "Development",
22
+ values: [
23
+ { key: "API_URL", value: "http://localhost:3000" },
24
+ { key: "DEBUG", value: true },
25
+ { key: "LOG_LEVEL", value: "debug" },
26
+ { key: "CACHE_TTL", value: 60 },
27
+ { key: "HOT_RELOAD", value: true },
28
+ ],
29
+ },
30
+ {
31
+ id: "staging",
32
+ name: "Staging",
33
+ values: [
34
+ { key: "API_URL", value: "https://staging.api.example.com" },
35
+ { key: "DEBUG", value: true },
36
+ { key: "LOG_LEVEL", value: "info" },
37
+ { key: "CACHE_TTL", value: 300 },
38
+ { key: "TEST_MODE", value: true },
39
+ ],
40
+ },
41
+ {
42
+ id: "prod",
43
+ name: "Production",
44
+ values: [
45
+ { key: "API_URL", value: "https://api.example.com" },
46
+ { key: "DEBUG", value: false },
47
+ { key: "LOG_LEVEL", value: "error" },
48
+ { key: "CACHE_TTL", value: 3600 },
49
+ { key: "MAX_CONNECTIONS", value: 100 },
50
+ ],
51
+ },
52
+ ]
53
+
54
+ export const Default: Story = {
55
+ args: {
56
+ environments,
57
+ leftEnvId: "dev",
58
+ rightEnvId: "prod",
59
+ title: "Configuration Comparison",
60
+ },
61
+ render: (args) => (
62
+ <div className="max-w-4xl">
63
+ <WakaConfigComparator {...args} />
64
+ </div>
65
+ ),
66
+ }
67
+
68
+ export const DiffOnly: Story = {
69
+ args: {
70
+ environments,
71
+ leftEnvId: "staging",
72
+ rightEnvId: "prod",
73
+ showDiffsOnly: true,
74
+ title: "Configuration Diff",
75
+ },
76
+ render: (args) => (
77
+ <div className="max-w-4xl">
78
+ <WakaConfigComparator {...args} />
79
+ </div>
80
+ ),
81
+ }
82
+
83
+ export const TwoEnvironments: Story = {
84
+ args: {
85
+ environments: environments.slice(0, 2),
86
+ leftEnvId: "dev",
87
+ rightEnvId: "staging",
88
+ title: "Dev vs Staging",
89
+ },
90
+ render: (args) => (
91
+ <div className="max-w-4xl">
92
+ <WakaConfigComparator {...args} />
93
+ </div>
94
+ ),
95
+ }
96
+
97
+ export const WithCallbacks: Story = {
98
+ args: {
99
+ environments,
100
+ leftEnvId: "dev",
101
+ rightEnvId: "prod",
102
+ onEnvironmentChange: (left, right) => console.log(`Changed: ${left} vs ${right}`),
103
+ onCopyValue: (key, value, from, to) => console.log(`Copy ${key}=${value} from ${from} to ${to}`),
104
+ },
105
+ render: (args) => (
106
+ <div className="max-w-4xl">
107
+ <WakaConfigComparator {...args} />
108
+ </div>
109
+ ),
110
+ }
111
+
112
+ export const UsingDefaultData: Story = {
113
+ args: {
114
+ environments: defaultConfigEnvironments,
115
+ leftEnvId: "production",
116
+ rightEnvId: "staging",
117
+ title: "Production vs Staging",
118
+ },
119
+ render: (args) => (
120
+ <div className="max-w-4xl">
121
+ <WakaConfigComparator {...args} />
122
+ </div>
123
+ ),
124
+ }
125
+
126
+ export const MultipleComparisons: Story = {
127
+ render: () => (
128
+ <div className="space-y-6 max-w-4xl">
129
+ <WakaConfigComparator
130
+ environments={defaultConfigEnvironments}
131
+ leftEnvId="production"
132
+ rightEnvId="staging"
133
+ title="Production vs Staging"
134
+ />
135
+ <WakaConfigComparator
136
+ environments={defaultConfigEnvironments}
137
+ leftEnvId="staging"
138
+ rightEnvId="development"
139
+ title="Staging vs Development"
140
+ />
141
+ </div>
142
+ ),
143
+ }
@@ -0,0 +1,52 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaConnectionMatrix, type Connection } from "./index"
3
+
4
+ const meta: Meta<typeof WakaConnectionMatrix> = {
5
+ title: "DevOps/WakaConnectionMatrix",
6
+ component: WakaConnectionMatrix,
7
+ parameters: { layout: "padded" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ showLegend: { control: "boolean", description: "Afficher la légende" },
11
+ showStats: { control: "boolean", description: "Afficher les stats" },
12
+ interactive: { control: "boolean", description: "Mode interactif" },
13
+ },
14
+ }
15
+
16
+ export default meta
17
+ type Story = StoryObj<typeof WakaConnectionMatrix>
18
+
19
+ const services = [
20
+ { id: "api", name: "API Gateway" },
21
+ { id: "auth", name: "Auth Service" },
22
+ { id: "user", name: "User Service" },
23
+ { id: "order", name: "Order Service" },
24
+ { id: "payment", name: "Payment Service" },
25
+ { id: "db", name: "Database" },
26
+ ]
27
+
28
+ const connections: Connection[] = [
29
+ { source: "api", target: "auth", weight: 90, type: "http", latency: 5 },
30
+ { source: "api", target: "user", weight: 75, type: "http", latency: 10 },
31
+ { source: "api", target: "order", weight: 60, type: "http", latency: 15 },
32
+ { source: "auth", target: "db", weight: 80, type: "database", latency: 2 },
33
+ { source: "user", target: "db", weight: 85, type: "database", latency: 3 },
34
+ { source: "order", target: "payment", weight: 50, type: "grpc", latency: 20 },
35
+ { source: "order", target: "db", weight: 70, type: "database", latency: 5 },
36
+ ]
37
+
38
+ export const Default: Story = {
39
+ args: { services, connections, showLegend: true, showStats: true, interactive: true },
40
+ render: (args) => <WakaConnectionMatrix {...args} />,
41
+ }
42
+
43
+ export const Simple: Story = {
44
+ args: { services: services.slice(0, 4), connections: connections.slice(0, 4), showLegend: false },
45
+ render: (args) => <WakaConnectionMatrix {...args} />,
46
+ }
47
+
48
+ export const Static: Story = {
49
+ args: { services, connections, interactive: false, showStats: true },
50
+ render: (args) => <WakaConnectionMatrix {...args} />,
51
+ }
52
+
@@ -0,0 +1,41 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaContentRecommendation } from "./index"
3
+
4
+ const meta: Meta<typeof WakaContentRecommendation> = {
5
+ title: "Sponsoring/WakaContentRecommendation",
6
+ component: WakaContentRecommendation,
7
+ parameters: { layout: "padded" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ layout: { control: "select", options: ["grid", "carousel", "list"], description: "Disposition" },
11
+ columns: { control: "select", options: [2, 3, 4], description: "Colonnes (grid)" },
12
+ showArrows: { control: "boolean", description: "Flèches navigation" },
13
+ autoScroll: { control: "boolean", description: "Défilement auto" },
14
+ },
15
+ }
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof WakaContentRecommendation>
19
+
20
+ const slotIds = ["rec-1", "rec-2", "rec-3", "rec-4"]
21
+
22
+ export const Default: Story = {
23
+ args: { title: "Recommandations", slotIds, layout: "grid", columns: 4 },
24
+ render: (args) => <WakaContentRecommendation {...args} />,
25
+ }
26
+
27
+ export const Carousel: Story = {
28
+ args: { title: "À découvrir", slotIds, layout: "carousel", showArrows: true, autoScroll: false },
29
+ render: (args) => <WakaContentRecommendation {...args} />,
30
+ }
31
+
32
+ export const List: Story = {
33
+ args: { title: "Articles suggérés", slotIds: slotIds.slice(0, 3), layout: "list" },
34
+ render: (args) => <WakaContentRecommendation {...args} />,
35
+ }
36
+
37
+ export const TwoColumns: Story = {
38
+ args: { title: "Pour vous", slotIds: slotIds.slice(0, 4), layout: "grid", columns: 2 },
39
+ render: (args) => <WakaContentRecommendation {...args} />,
40
+ }
41
+
@@ -0,0 +1,126 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaCouponInput, type Coupon } from "./index"
3
+ import { useState } from "react"
4
+
5
+ const meta: Meta<typeof WakaCouponInput> = {
6
+ title: "E-commerce/WakaCouponInput",
7
+ component: WakaCouponInput,
8
+ parameters: {
9
+ layout: "centered",
10
+ },
11
+ tags: ["autodocs"],
12
+ argTypes: {
13
+ placeholder: {
14
+ control: "text",
15
+ description: "Texte placeholder",
16
+ },
17
+ disabled: {
18
+ control: "boolean",
19
+ description: "État désactivé",
20
+ },
21
+ maxCoupons: {
22
+ control: "number",
23
+ description: "Nombre max de coupons",
24
+ },
25
+ showAppliedCoupons: {
26
+ control: "boolean",
27
+ description: "Afficher les coupons appliqués",
28
+ },
29
+ },
30
+ }
31
+
32
+ export default meta
33
+ type Story = StoryObj<typeof WakaCouponInput>
34
+
35
+ const appliedCoupons: Coupon[] = [
36
+ {
37
+ code: "SUMMER20",
38
+ discountValue: 20,
39
+ discountType: "percentage",
40
+ description: "Réduction été",
41
+ },
42
+ ]
43
+
44
+ const mockValidate = async (code: string) => {
45
+ await new Promise(r => setTimeout(r, 500))
46
+ if (code === "VALID10") {
47
+ return {
48
+ isValid: true,
49
+ coupon: { code, discountValue: 10, discountType: "percentage" as const },
50
+ }
51
+ }
52
+ if (code === "FLAT50") {
53
+ return {
54
+ isValid: true,
55
+ coupon: { code, discountValue: 50, discountType: "fixed" as const, description: "50€ de réduction" },
56
+ }
57
+ }
58
+ return { isValid: false, errorMessage: "Code coupon invalide" }
59
+ }
60
+
61
+ export const Default: Story = {
62
+ args: {
63
+ placeholder: "Entrez votre code promo",
64
+ showAppliedCoupons: true,
65
+ },
66
+ render: (args) => (
67
+ <div style={{ width: 350 }}>
68
+ <WakaCouponInput {...args} onValidate={mockValidate} />
69
+ </div>
70
+ ),
71
+ }
72
+
73
+ export const WithAppliedCoupon: Story = {
74
+ args: {
75
+ appliedCoupons,
76
+ placeholder: "Ajouter un autre code",
77
+ showAppliedCoupons: true,
78
+ },
79
+ render: (args) => (
80
+ <div style={{ width: 350 }}>
81
+ <WakaCouponInput {...args} onValidate={mockValidate} />
82
+ </div>
83
+ ),
84
+ }
85
+
86
+ export const MultipleCoupons: Story = {
87
+ args: {
88
+ appliedCoupons: [
89
+ ...appliedCoupons,
90
+ { code: "FLAT50", discountValue: 50, discountType: "fixed" as const },
91
+ ],
92
+ maxCoupons: 3,
93
+ showAppliedCoupons: true,
94
+ },
95
+ render: (args) => (
96
+ <div style={{ width: 350 }}>
97
+ <WakaCouponInput {...args} onValidate={mockValidate} />
98
+ </div>
99
+ ),
100
+ }
101
+
102
+ export const Disabled: Story = {
103
+ args: {
104
+ placeholder: "Code promo désactivé",
105
+ disabled: true,
106
+ },
107
+ render: (args) => (
108
+ <div style={{ width: 350 }}>
109
+ <WakaCouponInput {...args} />
110
+ </div>
111
+ ),
112
+ }
113
+
114
+ export const SingleCouponOnly: Story = {
115
+ args: {
116
+ maxCoupons: 1,
117
+ placeholder: "Un seul code autorisé",
118
+ showAppliedCoupons: true,
119
+ },
120
+ render: (args) => (
121
+ <div style={{ width: 350 }}>
122
+ <WakaCouponInput {...args} onValidate={mockValidate} />
123
+ </div>
124
+ ),
125
+ }
126
+