@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.
- package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
- package/dist/blocks/clamav-service-status/index.d.ts +35 -0
- package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
- package/dist/blocks/index.d.ts +18 -9
- package/dist/blocks/quarantine-manager/index.d.ts +27 -0
- package/dist/blocks/scan-history-log/index.d.ts +28 -0
- package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
- package/dist/blocks/scan-report-generator/index.d.ts +47 -0
- package/dist/blocks/signature-database-manager/index.d.ts +39 -0
- package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
- package/dist/components/index.d.ts +4 -4
- package/dist/components/waka-signature-pad/index.d.ts +1 -1
- package/dist/exceljs.min-BcLLX0PC.js +29 -0
- package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
- package/dist/export.cjs.js +1 -1
- package/dist/export.d.ts +2 -2
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +136 -136
- package/dist/index.es.js +29978 -27215
- package/dist/stories/Button.stories.d.ts +1 -1
- package/dist/stories/Header.stories.d.ts +1 -1
- package/dist/stories/Page.stories.d.ts +1 -1
- package/dist/useDataTableImport-COVnvslz.js +9 -0
- package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/package.json +6 -5
- package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
- package/src/blocks/antivirus-dashboard/index.tsx +525 -0
- package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
- package/src/blocks/clamav-service-status/index.tsx +370 -0
- package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
- package/src/blocks/file-scan-uploader/index.tsx +311 -0
- package/src/blocks/index.ts +163 -11
- package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
- package/src/blocks/quarantine-manager/index.tsx +435 -0
- package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
- package/src/blocks/scan-history-log/index.tsx +406 -0
- package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
- package/src/blocks/scan-policy-editor/index.tsx +418 -0
- package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
- package/src/blocks/scan-report-generator/index.tsx +612 -0
- package/src/blocks/sidebar/index.tsx +2 -1
- package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
- package/src/blocks/signature-database-manager/index.tsx +470 -0
- package/src/blocks/theme-creator-block/index.tsx +16 -2
- package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
- package/src/blocks/threat-alert-banner/index.tsx +320 -0
- package/src/components/DataTable/DataTable.stories.tsx +203 -0
- package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
- package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
- package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
- package/src/components/index.ts +45 -4
- package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
- package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
- package/src/components/toaster/Toaster.stories.tsx +67 -0
- package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
- package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
- package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
- package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
- package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
- package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
- package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
- package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
- package/src/components/waka-ad-sidebar/index.tsx +3 -2
- package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
- package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
- package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
- package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
- package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
- package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
- package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
- package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
- package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
- package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
- package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
- package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
- package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
- package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
- package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
- package/src/components/waka-cart-summary/index.tsx +19 -10
- package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
- package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
- package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
- package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
- package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
- package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
- package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
- package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
- package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
- package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
- package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
- package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
- package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
- package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
- package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
- package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
- package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
- package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
- package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
- package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
- package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
- package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
- package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
- package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
- package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
- package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
- package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
- package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
- package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
- package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
- package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
- package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
- package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
- package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
- package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
- package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
- package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
- package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
- package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
- package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
- package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
- package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
- package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
- package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
- package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
- package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
- package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
- package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
- package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
- package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
- package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
- package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
- package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
- package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
- package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
- package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
- package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
- package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
- package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
- package/src/components/waka-signature-pad/index.tsx +5 -3
- package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
- package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
- package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
- package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
- package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
- package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
- package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
- package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
- package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
- package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
- package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
- package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
- package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
- package/src/components/waka-theme-manager/index.tsx +6 -11
- package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
- package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
- package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
- package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
- package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
- package/src/components/waka-treemap-chart/index.tsx +2 -2
- package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
- package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
- package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
- package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
- package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
- package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
- package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
- package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
- package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
- package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
- 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
|
+
|