@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,169 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaInvoicePreview, type Address, type CompanyInfo, type InvoiceStatus } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaInvoicePreview> = {
|
|
5
|
+
title: "E-commerce/WakaInvoicePreview",
|
|
6
|
+
component: WakaInvoicePreview,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {
|
|
12
|
+
status: {
|
|
13
|
+
control: "select",
|
|
14
|
+
options: ["paid", "pending", "overdue", "draft"],
|
|
15
|
+
description: "Statut de la facture",
|
|
16
|
+
},
|
|
17
|
+
showDownload: {
|
|
18
|
+
control: "boolean",
|
|
19
|
+
description: "Afficher le bouton télécharger",
|
|
20
|
+
},
|
|
21
|
+
showPrint: {
|
|
22
|
+
control: "boolean",
|
|
23
|
+
description: "Afficher le bouton imprimer",
|
|
24
|
+
},
|
|
25
|
+
currency: {
|
|
26
|
+
control: "select",
|
|
27
|
+
options: ["EUR", "USD", "GBP"],
|
|
28
|
+
description: "Devise",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default meta
|
|
34
|
+
type Story = StoryObj<typeof WakaInvoicePreview>
|
|
35
|
+
|
|
36
|
+
const companyInfo: CompanyInfo = {
|
|
37
|
+
name: "WakaStart SAS",
|
|
38
|
+
logo: "https://via.placeholder.com/150x50?text=Logo",
|
|
39
|
+
address: {
|
|
40
|
+
name: "WakaStart SAS",
|
|
41
|
+
street1: "123 Avenue de la Tech",
|
|
42
|
+
city: "Paris",
|
|
43
|
+
postalCode: "75001",
|
|
44
|
+
country: "France",
|
|
45
|
+
},
|
|
46
|
+
email: "contact@wakastart.com",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const customerAddress: Address = {
|
|
50
|
+
name: "Client Entreprise",
|
|
51
|
+
street1: "456 Rue du Commerce",
|
|
52
|
+
city: "Lyon",
|
|
53
|
+
postalCode: "69001",
|
|
54
|
+
country: "France",
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const invoiceItems = [
|
|
58
|
+
{ description: "Licence Pro - Annuel", quantity: 1, unitPrice: 599, total: 599 },
|
|
59
|
+
{ description: "Support Premium", quantity: 1, unitPrice: 199, total: 199 },
|
|
60
|
+
{ description: "Formation (heures)", quantity: 4, unitPrice: 100, total: 400 },
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
invoiceNumber: "INV-2024-001",
|
|
66
|
+
date: new Date("2024-01-15"),
|
|
67
|
+
dueDate: new Date("2024-02-15"),
|
|
68
|
+
status: "pending",
|
|
69
|
+
company: companyInfo,
|
|
70
|
+
customer: customerAddress,
|
|
71
|
+
items: invoiceItems,
|
|
72
|
+
subtotal: 1198,
|
|
73
|
+
tax: 239.6,
|
|
74
|
+
total: 1437.6,
|
|
75
|
+
currency: "EUR",
|
|
76
|
+
showDownload: true,
|
|
77
|
+
showPrint: true,
|
|
78
|
+
},
|
|
79
|
+
render: (args) => (
|
|
80
|
+
<div style={{ maxWidth: 800 }}>
|
|
81
|
+
<WakaInvoicePreview {...args} />
|
|
82
|
+
</div>
|
|
83
|
+
),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const Paid: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
invoiceNumber: "INV-2024-002",
|
|
89
|
+
date: new Date("2024-01-01"),
|
|
90
|
+
dueDate: new Date("2024-01-31"),
|
|
91
|
+
paidDate: new Date("2024-01-25"),
|
|
92
|
+
status: "paid",
|
|
93
|
+
company: companyInfo,
|
|
94
|
+
customer: customerAddress,
|
|
95
|
+
items: invoiceItems,
|
|
96
|
+
subtotal: 1198,
|
|
97
|
+
tax: 239.6,
|
|
98
|
+
total: 1437.6,
|
|
99
|
+
currency: "EUR",
|
|
100
|
+
},
|
|
101
|
+
render: (args) => (
|
|
102
|
+
<div style={{ maxWidth: 800 }}>
|
|
103
|
+
<WakaInvoicePreview {...args} />
|
|
104
|
+
</div>
|
|
105
|
+
),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Overdue: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
invoiceNumber: "INV-2023-099",
|
|
111
|
+
date: new Date("2023-11-01"),
|
|
112
|
+
dueDate: new Date("2023-12-01"),
|
|
113
|
+
status: "overdue",
|
|
114
|
+
company: companyInfo,
|
|
115
|
+
customer: customerAddress,
|
|
116
|
+
items: invoiceItems,
|
|
117
|
+
subtotal: 1198,
|
|
118
|
+
tax: 239.6,
|
|
119
|
+
total: 1437.6,
|
|
120
|
+
currency: "EUR",
|
|
121
|
+
},
|
|
122
|
+
render: (args) => (
|
|
123
|
+
<div style={{ maxWidth: 800 }}>
|
|
124
|
+
<WakaInvoicePreview {...args} />
|
|
125
|
+
</div>
|
|
126
|
+
),
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const Draft: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
invoiceNumber: "DRAFT-001",
|
|
132
|
+
date: new Date(),
|
|
133
|
+
status: "draft",
|
|
134
|
+
company: companyInfo,
|
|
135
|
+
customer: customerAddress,
|
|
136
|
+
items: invoiceItems.slice(0, 2),
|
|
137
|
+
subtotal: 798,
|
|
138
|
+
tax: 159.6,
|
|
139
|
+
total: 957.6,
|
|
140
|
+
currency: "EUR",
|
|
141
|
+
},
|
|
142
|
+
render: (args) => (
|
|
143
|
+
<div style={{ maxWidth: 800 }}>
|
|
144
|
+
<WakaInvoicePreview {...args} />
|
|
145
|
+
</div>
|
|
146
|
+
),
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const USDCurrency: Story = {
|
|
150
|
+
args: {
|
|
151
|
+
invoiceNumber: "INV-US-001",
|
|
152
|
+
date: new Date(),
|
|
153
|
+
dueDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
|
|
154
|
+
status: "pending",
|
|
155
|
+
company: { ...companyInfo, name: "WakaStart Inc." },
|
|
156
|
+
customer: { ...customerAddress, country: "United States" },
|
|
157
|
+
items: invoiceItems.map(i => ({ ...i, unitPrice: i.unitPrice * 1.1, total: i.total * 1.1 })),
|
|
158
|
+
subtotal: 1317.8,
|
|
159
|
+
tax: 0,
|
|
160
|
+
total: 1317.8,
|
|
161
|
+
currency: "USD",
|
|
162
|
+
},
|
|
163
|
+
render: (args) => (
|
|
164
|
+
<div style={{ maxWidth: 800 }}>
|
|
165
|
+
<WakaInvoicePreview {...args} />
|
|
166
|
+
</div>
|
|
167
|
+
),
|
|
168
|
+
}
|
|
169
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaKPIDashboard, type KPIData } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaKPIDashboard> = {
|
|
5
|
+
title: "DevOps/WakaKpiDashboard",
|
|
6
|
+
component: WakaKPIDashboard,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
columns: { control: { type: "number", min: 1, max: 6 }, description: "Nombre de colonnes" },
|
|
11
|
+
showSparklines: { control: "boolean", description: "Afficher les sparklines" },
|
|
12
|
+
draggable: { control: "boolean", description: "KPIs réorganisables" },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof WakaKPIDashboard>
|
|
18
|
+
|
|
19
|
+
const kpis: KPIData[] = [
|
|
20
|
+
{ id: "revenue", title: "Revenu", value: "€45,231", trend: "up", trendValue: "+12.5%", sparkline: [30, 40, 35, 50, 49, 60, 70] },
|
|
21
|
+
{ id: "users", title: "Utilisateurs actifs", value: "2,350", trend: "up", trendValue: "+5.2%", sparkline: [100, 120, 110, 130, 140, 145, 150] },
|
|
22
|
+
{ id: "conversion", title: "Taux de conversion", value: "3.2%", previousValue: "2.8%", trend: "up", trendValue: "+0.4%" },
|
|
23
|
+
{ id: "bounce", title: "Taux de rebond", value: "42%", trend: "down", trendValue: "-3.1%", sparkline: [50, 48, 46, 45, 44, 43, 42] },
|
|
24
|
+
{ id: "latency", title: "Latence moyenne", value: "45ms", trend: "down", trendValue: "-15ms" },
|
|
25
|
+
{ id: "uptime", title: "Uptime", value: "99.98%", trend: "stable", trendValue: "0%" },
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: { kpis, columns: 3, showSparklines: true },
|
|
30
|
+
render: (args) => <WakaKPIDashboard {...args} />,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const TwoColumns: Story = {
|
|
34
|
+
args: { kpis: kpis.slice(0, 4), columns: 2, showSparklines: true },
|
|
35
|
+
render: (args) => <WakaKPIDashboard {...args} />,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Draggable: Story = {
|
|
39
|
+
args: { kpis, columns: 3, showSparklines: true, draggable: true },
|
|
40
|
+
render: (args) => <WakaKPIDashboard {...args} />,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const NoSparklines: Story = {
|
|
44
|
+
args: { kpis, columns: 4, showSparklines: false },
|
|
45
|
+
render: (args) => <WakaKPIDashboard {...args} />,
|
|
46
|
+
}
|
|
@@ -15,29 +15,33 @@ const meta: Meta<typeof WakaLevelProgress> = {
|
|
|
15
15
|
},
|
|
16
16
|
tags: ['autodocs'],
|
|
17
17
|
argTypes: {
|
|
18
|
-
|
|
18
|
+
currentLevel: {
|
|
19
19
|
control: { type: 'number', min: 1, max: 100 },
|
|
20
20
|
description: 'Current level',
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
control: { type: 'range', min: 0, max:
|
|
24
|
-
description: '
|
|
22
|
+
currentXp: {
|
|
23
|
+
control: { type: 'range', min: 0, max: 5000, step: 100 },
|
|
24
|
+
description: 'Current XP amount',
|
|
25
|
+
},
|
|
26
|
+
xpForNextLevel: {
|
|
27
|
+
control: { type: 'range', min: 1000, max: 10000, step: 500 },
|
|
28
|
+
description: 'XP required for next level',
|
|
25
29
|
},
|
|
26
30
|
theme: {
|
|
27
31
|
control: 'select',
|
|
28
|
-
options: ['default', 'gold', '
|
|
32
|
+
options: ['default', 'gold', 'purple', 'green', 'blue'],
|
|
29
33
|
description: 'Color theme',
|
|
30
34
|
},
|
|
31
35
|
size: {
|
|
32
36
|
control: 'select',
|
|
33
|
-
options: ['sm', '
|
|
37
|
+
options: ['sm', 'default', 'lg'],
|
|
34
38
|
description: 'Size variant',
|
|
35
39
|
},
|
|
36
|
-
|
|
40
|
+
showXpNumbers: {
|
|
37
41
|
control: 'boolean',
|
|
38
|
-
description: 'Show
|
|
42
|
+
description: 'Show XP numbers',
|
|
39
43
|
},
|
|
40
|
-
|
|
44
|
+
animate: {
|
|
41
45
|
control: 'boolean',
|
|
42
46
|
description: 'Enable animations',
|
|
43
47
|
},
|
|
@@ -49,12 +53,12 @@ type Story = StoryObj<typeof WakaLevelProgress>
|
|
|
49
53
|
|
|
50
54
|
export const Default: Story = {
|
|
51
55
|
args: {
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
currentLevel: 15,
|
|
57
|
+
currentXp: 650,
|
|
58
|
+
xpForNextLevel: 1000,
|
|
54
59
|
theme: 'default',
|
|
55
|
-
size: '
|
|
56
|
-
|
|
57
|
-
animated: true,
|
|
60
|
+
size: 'default',
|
|
61
|
+
animate: true,
|
|
58
62
|
},
|
|
59
63
|
render: (args) => (
|
|
60
64
|
<div className="w-[350px]">
|
|
@@ -68,27 +72,23 @@ export const Themes: Story = {
|
|
|
68
72
|
<div className="w-[350px] space-y-6">
|
|
69
73
|
<div>
|
|
70
74
|
<p className="text-sm text-muted-foreground mb-2">Default</p>
|
|
71
|
-
<WakaLevelProgress
|
|
75
|
+
<WakaLevelProgress currentLevel={10} currentXp={500} xpForNextLevel={1000} theme="default" />
|
|
72
76
|
</div>
|
|
73
77
|
<div>
|
|
74
78
|
<p className="text-sm text-muted-foreground mb-2">Gold</p>
|
|
75
|
-
<WakaLevelProgress
|
|
76
|
-
</div>
|
|
77
|
-
<div>
|
|
78
|
-
<p className="text-sm text-muted-foreground mb-2">Silver</p>
|
|
79
|
-
<WakaLevelProgress level={15} progress={40} theme="silver" />
|
|
79
|
+
<WakaLevelProgress currentLevel={25} currentXp={750} xpForNextLevel={1000} theme="gold" />
|
|
80
80
|
</div>
|
|
81
81
|
<div>
|
|
82
|
-
<p className="text-sm text-muted-foreground mb-2">
|
|
83
|
-
<WakaLevelProgress
|
|
82
|
+
<p className="text-sm text-muted-foreground mb-2">Purple</p>
|
|
83
|
+
<WakaLevelProgress currentLevel={15} currentXp={400} xpForNextLevel={1000} theme="purple" />
|
|
84
84
|
</div>
|
|
85
85
|
<div>
|
|
86
|
-
<p className="text-sm text-muted-foreground mb-2">
|
|
87
|
-
<WakaLevelProgress
|
|
86
|
+
<p className="text-sm text-muted-foreground mb-2">Green</p>
|
|
87
|
+
<WakaLevelProgress currentLevel={30} currentXp={850} xpForNextLevel={1000} theme="green" />
|
|
88
88
|
</div>
|
|
89
89
|
<div>
|
|
90
|
-
<p className="text-sm text-muted-foreground mb-2">
|
|
91
|
-
<WakaLevelProgress
|
|
90
|
+
<p className="text-sm text-muted-foreground mb-2">Blue</p>
|
|
91
|
+
<WakaLevelProgress currentLevel={50} currentXp={300} xpForNextLevel={1000} theme="blue" />
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
94
94
|
),
|
|
@@ -99,15 +99,15 @@ export const Sizes: Story = {
|
|
|
99
99
|
<div className="w-[400px] space-y-6">
|
|
100
100
|
<div>
|
|
101
101
|
<p className="text-sm text-muted-foreground mb-2">Small</p>
|
|
102
|
-
<WakaLevelProgress
|
|
102
|
+
<WakaLevelProgress currentLevel={8} currentXp={450} xpForNextLevel={1000} size="sm" />
|
|
103
103
|
</div>
|
|
104
104
|
<div>
|
|
105
|
-
<p className="text-sm text-muted-foreground mb-2">
|
|
106
|
-
<WakaLevelProgress
|
|
105
|
+
<p className="text-sm text-muted-foreground mb-2">Default</p>
|
|
106
|
+
<WakaLevelProgress currentLevel={15} currentXp={600} xpForNextLevel={1000} size="default" />
|
|
107
107
|
</div>
|
|
108
108
|
<div>
|
|
109
109
|
<p className="text-sm text-muted-foreground mb-2">Large</p>
|
|
110
|
-
<WakaLevelProgress
|
|
110
|
+
<WakaLevelProgress currentLevel={25} currentXp={800} xpForNextLevel={1000} size="lg" />
|
|
111
111
|
</div>
|
|
112
112
|
</div>
|
|
113
113
|
),
|
|
@@ -118,11 +118,20 @@ export const WithMilestones: Story = {
|
|
|
118
118
|
<div className="w-[400px] space-y-6">
|
|
119
119
|
<div>
|
|
120
120
|
<p className="text-sm text-muted-foreground mb-2">With Milestones</p>
|
|
121
|
-
<WakaLevelProgress
|
|
121
|
+
<WakaLevelProgress
|
|
122
|
+
currentLevel={12}
|
|
123
|
+
currentXp={700}
|
|
124
|
+
xpForNextLevel={1000}
|
|
125
|
+
milestones={[
|
|
126
|
+
{ level: 10, label: 'Bronze', icon: '🥉' },
|
|
127
|
+
{ level: 25, label: 'Silver', icon: '🥈' },
|
|
128
|
+
{ level: 50, label: 'Gold', icon: '🥇' },
|
|
129
|
+
]}
|
|
130
|
+
/>
|
|
122
131
|
</div>
|
|
123
132
|
<div>
|
|
124
133
|
<p className="text-sm text-muted-foreground mb-2">Without Milestones</p>
|
|
125
|
-
<WakaLevelProgress
|
|
134
|
+
<WakaLevelProgress currentLevel={12} currentXp={700} xpForNextLevel={1000} />
|
|
126
135
|
</div>
|
|
127
136
|
</div>
|
|
128
137
|
),
|
|
@@ -133,23 +142,23 @@ export const ProgressStages: Story = {
|
|
|
133
142
|
<div className="w-[400px] space-y-6">
|
|
134
143
|
<div>
|
|
135
144
|
<p className="text-sm text-muted-foreground mb-2">Just Started (10%)</p>
|
|
136
|
-
<WakaLevelProgress
|
|
145
|
+
<WakaLevelProgress currentLevel={1} currentXp={100} xpForNextLevel={1000} theme="default" />
|
|
137
146
|
</div>
|
|
138
147
|
<div>
|
|
139
148
|
<p className="text-sm text-muted-foreground mb-2">Quarter Way (25%)</p>
|
|
140
|
-
<WakaLevelProgress
|
|
149
|
+
<WakaLevelProgress currentLevel={5} currentXp={250} xpForNextLevel={1000} theme="purple" />
|
|
141
150
|
</div>
|
|
142
151
|
<div>
|
|
143
152
|
<p className="text-sm text-muted-foreground mb-2">Halfway (50%)</p>
|
|
144
|
-
<WakaLevelProgress
|
|
153
|
+
<WakaLevelProgress currentLevel={10} currentXp={500} xpForNextLevel={1000} theme="blue" />
|
|
145
154
|
</div>
|
|
146
155
|
<div>
|
|
147
156
|
<p className="text-sm text-muted-foreground mb-2">Almost There (90%)</p>
|
|
148
|
-
<WakaLevelProgress
|
|
157
|
+
<WakaLevelProgress currentLevel={24} currentXp={900} xpForNextLevel={1000} theme="gold" />
|
|
149
158
|
</div>
|
|
150
159
|
<div>
|
|
151
160
|
<p className="text-sm text-muted-foreground mb-2">Max Level</p>
|
|
152
|
-
<WakaLevelProgress
|
|
161
|
+
<WakaLevelProgress currentLevel={100} currentXp={1000} xpForNextLevel={1000} theme="green" />
|
|
153
162
|
</div>
|
|
154
163
|
</div>
|
|
155
164
|
),
|
|
@@ -158,31 +167,38 @@ export const ProgressStages: Story = {
|
|
|
158
167
|
export const Interactive: Story = {
|
|
159
168
|
render: () => {
|
|
160
169
|
const [level, setLevel] = React.useState(5)
|
|
161
|
-
const [
|
|
170
|
+
const [xp, setXp] = React.useState(300)
|
|
171
|
+
const xpForNextLevel = 1000
|
|
162
172
|
|
|
163
173
|
const gainXP = () => {
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
174
|
+
const newXp = xp + 150
|
|
175
|
+
if (newXp >= xpForNextLevel) {
|
|
166
176
|
setLevel((prev) => prev + 1)
|
|
167
|
-
|
|
177
|
+
setXp(newXp - xpForNextLevel)
|
|
168
178
|
} else {
|
|
169
|
-
|
|
179
|
+
setXp(newXp)
|
|
170
180
|
}
|
|
171
181
|
}
|
|
172
182
|
|
|
173
183
|
return (
|
|
174
184
|
<div className="w-[400px] space-y-4">
|
|
175
|
-
<WakaLevelProgress
|
|
185
|
+
<WakaLevelProgress
|
|
186
|
+
currentLevel={level}
|
|
187
|
+
currentXp={xp}
|
|
188
|
+
xpForNextLevel={xpForNextLevel}
|
|
189
|
+
theme="gold"
|
|
190
|
+
animate
|
|
191
|
+
/>
|
|
176
192
|
|
|
177
193
|
<div className="flex gap-2">
|
|
178
194
|
<button
|
|
179
195
|
onClick={gainXP}
|
|
180
196
|
className="flex-1 px-4 py-2 rounded-lg bg-amber-500 text-white font-medium hover:bg-amber-600"
|
|
181
197
|
>
|
|
182
|
-
Gain XP (+
|
|
198
|
+
Gain XP (+150)
|
|
183
199
|
</button>
|
|
184
200
|
<button
|
|
185
|
-
onClick={() => { setLevel(5);
|
|
201
|
+
onClick={() => { setLevel(5); setXp(300) }}
|
|
186
202
|
className="px-4 py-2 rounded-lg border font-medium hover:bg-muted"
|
|
187
203
|
>
|
|
188
204
|
Reset
|
|
@@ -190,7 +206,7 @@ export const Interactive: Story = {
|
|
|
190
206
|
</div>
|
|
191
207
|
|
|
192
208
|
<p className="text-sm text-muted-foreground text-center">
|
|
193
|
-
Level {level} • {
|
|
209
|
+
Level {level} • {xp} / {xpForNextLevel} XP ({Math.round((xp / xpForNextLevel) * 100)}%)
|
|
194
210
|
</p>
|
|
195
211
|
</div>
|
|
196
212
|
)
|
|
@@ -200,50 +216,53 @@ export const Interactive: Story = {
|
|
|
200
216
|
export const WithHook: Story = {
|
|
201
217
|
render: () => {
|
|
202
218
|
const {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
219
|
+
currentLevel,
|
|
220
|
+
currentXp,
|
|
221
|
+
xpForNextLevel,
|
|
222
|
+
addXp,
|
|
207
223
|
reset,
|
|
208
|
-
|
|
209
|
-
progressToNextLevel,
|
|
224
|
+
progressPercent,
|
|
210
225
|
} = useLevelProgress({
|
|
211
|
-
|
|
212
|
-
|
|
226
|
+
initialXp: 9450, // Level 10 + 450 XP (9 full levels * 1000 + 450)
|
|
227
|
+
xpPerLevel: 1000,
|
|
213
228
|
})
|
|
214
229
|
|
|
215
230
|
return (
|
|
216
231
|
<div className="w-[400px] space-y-4">
|
|
217
|
-
<WakaLevelProgress
|
|
232
|
+
<WakaLevelProgress
|
|
233
|
+
currentLevel={currentLevel}
|
|
234
|
+
currentXp={currentXp}
|
|
235
|
+
xpForNextLevel={xpForNextLevel}
|
|
236
|
+
theme="green"
|
|
237
|
+
/>
|
|
218
238
|
|
|
219
239
|
<div className="grid grid-cols-2 gap-4 text-center">
|
|
220
240
|
<div className="p-3 rounded-lg border">
|
|
221
|
-
<p className="text-2xl font-bold">{
|
|
241
|
+
<p className="text-2xl font-bold">{currentLevel}</p>
|
|
222
242
|
<p className="text-xs text-muted-foreground">Current Level</p>
|
|
223
243
|
</div>
|
|
224
244
|
<div className="p-3 rounded-lg border">
|
|
225
|
-
<p className="text-2xl font-bold">{
|
|
245
|
+
<p className="text-2xl font-bold">{Math.round(progressPercent)}%</p>
|
|
226
246
|
<p className="text-xs text-muted-foreground">To Next Level</p>
|
|
227
247
|
</div>
|
|
228
248
|
</div>
|
|
229
249
|
|
|
230
250
|
<div className="flex gap-2 flex-wrap">
|
|
231
251
|
<button
|
|
232
|
-
onClick={() =>
|
|
252
|
+
onClick={() => addXp(100)}
|
|
233
253
|
className="px-3 py-1.5 text-sm rounded bg-green-500 text-white hover:bg-green-600"
|
|
234
254
|
>
|
|
235
|
-
+
|
|
255
|
+
+100 XP
|
|
236
256
|
</button>
|
|
237
257
|
<button
|
|
238
|
-
onClick={() =>
|
|
258
|
+
onClick={() => addXp(250)}
|
|
239
259
|
className="px-3 py-1.5 text-sm rounded bg-blue-500 text-white hover:bg-blue-600"
|
|
240
260
|
>
|
|
241
|
-
+
|
|
261
|
+
+250 XP
|
|
242
262
|
</button>
|
|
243
263
|
<button
|
|
244
|
-
onClick={
|
|
245
|
-
|
|
246
|
-
className="px-3 py-1.5 text-sm rounded bg-amber-500 text-white hover:bg-amber-600 disabled:opacity-50"
|
|
264
|
+
onClick={() => addXp(xpForNextLevel - currentXp)}
|
|
265
|
+
className="px-3 py-1.5 text-sm rounded bg-amber-500 text-white hover:bg-amber-600"
|
|
247
266
|
>
|
|
248
267
|
Level Up
|
|
249
268
|
</button>
|
|
@@ -272,33 +291,33 @@ export const RankSystem: Story = {
|
|
|
272
291
|
<p className="text-xs text-muted-foreground">Elite Player</p>
|
|
273
292
|
</div>
|
|
274
293
|
</div>
|
|
275
|
-
<WakaLevelProgress
|
|
294
|
+
<WakaLevelProgress currentLevel={25} currentXp={780} xpForNextLevel={1000} theme="gold" />
|
|
276
295
|
</div>
|
|
277
296
|
|
|
278
|
-
<div className="p-4 rounded-xl border bg-gradient-to-r from-
|
|
297
|
+
<div className="p-4 rounded-xl border bg-gradient-to-r from-purple-900/20 to-violet-900/20">
|
|
279
298
|
<div className="flex items-center gap-3 mb-3">
|
|
280
|
-
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-
|
|
281
|
-
<span className="text-white font-bold text-sm">
|
|
299
|
+
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-purple-400 to-violet-600 flex items-center justify-center">
|
|
300
|
+
<span className="text-white font-bold text-sm">P</span>
|
|
282
301
|
</div>
|
|
283
302
|
<div>
|
|
284
|
-
<p className="font-bold text-
|
|
303
|
+
<p className="font-bold text-purple-400">Purple Rank</p>
|
|
285
304
|
<p className="text-xs text-muted-foreground">Skilled Player</p>
|
|
286
305
|
</div>
|
|
287
306
|
</div>
|
|
288
|
-
<WakaLevelProgress
|
|
307
|
+
<WakaLevelProgress currentLevel={15} currentXp={450} xpForNextLevel={1000} theme="purple" />
|
|
289
308
|
</div>
|
|
290
309
|
|
|
291
|
-
<div className="p-4 rounded-xl border bg-gradient-to-r from-
|
|
310
|
+
<div className="p-4 rounded-xl border bg-gradient-to-r from-blue-900/20 to-cyan-900/20">
|
|
292
311
|
<div className="flex items-center gap-3 mb-3">
|
|
293
|
-
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-
|
|
312
|
+
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-blue-500 to-cyan-700 flex items-center justify-center">
|
|
294
313
|
<span className="text-white font-bold text-sm">B</span>
|
|
295
314
|
</div>
|
|
296
315
|
<div>
|
|
297
|
-
<p className="font-bold text-
|
|
316
|
+
<p className="font-bold text-blue-500">Blue Rank</p>
|
|
298
317
|
<p className="text-xs text-muted-foreground">Rising Player</p>
|
|
299
318
|
</div>
|
|
300
319
|
</div>
|
|
301
|
-
<WakaLevelProgress
|
|
320
|
+
<WakaLevelProgress currentLevel={5} currentXp={200} xpForNextLevel={1000} theme="blue" />
|
|
302
321
|
</div>
|
|
303
322
|
</div>
|
|
304
323
|
),
|
|
@@ -307,7 +326,7 @@ export const RankSystem: Story = {
|
|
|
307
326
|
export const NoAnimation: Story = {
|
|
308
327
|
render: () => (
|
|
309
328
|
<div className="w-[350px]">
|
|
310
|
-
<WakaLevelProgress
|
|
329
|
+
<WakaLevelProgress currentLevel={15} currentXp={650} xpForNextLevel={1000} animate={false} />
|
|
311
330
|
</div>
|
|
312
331
|
),
|
|
313
332
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaLiquidButton } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaLiquidButton> = {
|
|
5
|
+
title: "UI/WakaLiquidButton",
|
|
6
|
+
component: WakaLiquidButton,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: { control: "select", options: ["default", "secondary", "destructive", "success", "gradient", "neon"], description: "Variante" },
|
|
11
|
+
size: { control: "select", options: ["sm", "default", "lg", "xl"], description: "Taille" },
|
|
12
|
+
liquidEffect: { control: "boolean", description: "Effet liquide" },
|
|
13
|
+
liquidIntensity: { control: { type: "range", min: 0, max: 1, step: 0.1 }, description: "Intensité" },
|
|
14
|
+
liquidSpeed: { control: "number", description: "Vitesse (ms)" },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof WakaLiquidButton>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: { children: "Liquid Button", variant: "default", size: "default", liquidEffect: true },
|
|
23
|
+
render: (args) => <WakaLiquidButton {...args} />,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Gradient: Story = {
|
|
27
|
+
args: { children: "Gradient Effect", variant: "gradient", size: "lg", liquidEffect: true, liquidIntensity: 0.8 },
|
|
28
|
+
render: (args) => <WakaLiquidButton {...args} />,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Neon: Story = {
|
|
32
|
+
args: { children: "Neon Glow", variant: "neon", size: "lg", liquidEffect: true },
|
|
33
|
+
render: (args) => <WakaLiquidButton {...args} />,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Success: Story = {
|
|
37
|
+
args: { children: "Success", variant: "success", liquidEffect: true },
|
|
38
|
+
render: (args) => <WakaLiquidButton {...args} />,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const NoEffect: Story = {
|
|
42
|
+
args: { children: "Sans effet", variant: "default", liquidEffect: false },
|
|
43
|
+
render: (args) => <WakaLiquidButton {...args} />,
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaMagicLink } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaMagicLink> = {
|
|
5
|
+
title: "Security/WakaMagicLink",
|
|
6
|
+
component: WakaMagicLink,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
placeholder: { control: "text", description: "Placeholder de l'email" },
|
|
11
|
+
countdownDuration: { control: "number", description: "Durée avant renvoi (sec)" },
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
type Story = StoryObj<typeof WakaMagicLink>
|
|
17
|
+
|
|
18
|
+
const mockSubmit = async (email: string) => {
|
|
19
|
+
await new Promise(r => setTimeout(r, 1500))
|
|
20
|
+
console.log("Magic link sent to:", email)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
placeholder: "Entrez votre email",
|
|
26
|
+
buttonText: { idle: "Envoyer le lien magique", loading: "Envoi...", sent: "Lien envoyé !" },
|
|
27
|
+
successMessage: "Un lien de connexion a été envoyé à votre email",
|
|
28
|
+
countdownDuration: 60,
|
|
29
|
+
},
|
|
30
|
+
render: (args) => (
|
|
31
|
+
<div style={{ width: 350 }}>
|
|
32
|
+
<WakaMagicLink {...args} onSubmit={mockSubmit} />
|
|
33
|
+
</div>
|
|
34
|
+
),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const CustomText: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
placeholder: "votre@email.com",
|
|
40
|
+
buttonText: { idle: "Connexion sans mot de passe", loading: "Patientez...", sent: "Email envoyé" },
|
|
41
|
+
successMessage: "Vérifiez votre boîte mail",
|
|
42
|
+
},
|
|
43
|
+
render: (args) => (
|
|
44
|
+
<div style={{ width: 350 }}>
|
|
45
|
+
<WakaMagicLink {...args} onSubmit={mockSubmit} />
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const NoCountdown: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
placeholder: "Email",
|
|
53
|
+
countdownDuration: 0,
|
|
54
|
+
},
|
|
55
|
+
render: (args) => (
|
|
56
|
+
<div style={{ width: 350 }}>
|
|
57
|
+
<WakaMagicLink {...args} onSubmit={mockSubmit} />
|
|
58
|
+
</div>
|
|
59
|
+
),
|
|
60
|
+
}
|
|
61
|
+
|