@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
|
@@ -1,40 +1,54 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { WakaFileUpload } from
|
|
3
|
-
import * as React from 'react'
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaFileUpload } from "./index"
|
|
4
3
|
|
|
5
4
|
const meta: Meta<typeof WakaFileUpload> = {
|
|
6
|
-
title:
|
|
5
|
+
title: "Forms/WakaFileUpload",
|
|
7
6
|
component: WakaFileUpload,
|
|
8
7
|
parameters: {
|
|
9
|
-
layout:
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: 'A file upload component with drag & drop, preview, and progress tracking.',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
8
|
+
layout: "centered",
|
|
15
9
|
},
|
|
16
|
-
tags: [
|
|
10
|
+
tags: ["autodocs"],
|
|
17
11
|
argTypes: {
|
|
18
12
|
variant: {
|
|
19
|
-
control:
|
|
20
|
-
options: [
|
|
21
|
-
description:
|
|
13
|
+
control: "select",
|
|
14
|
+
options: ["dropzone", "button", "inline"],
|
|
15
|
+
description: "Variante d'affichage",
|
|
16
|
+
},
|
|
17
|
+
accept: {
|
|
18
|
+
control: "text",
|
|
19
|
+
description: "Types de fichiers acceptés",
|
|
20
|
+
},
|
|
21
|
+
maxSize: {
|
|
22
|
+
control: "number",
|
|
23
|
+
description: "Taille max par fichier en bytes",
|
|
24
|
+
},
|
|
25
|
+
maxFiles: {
|
|
26
|
+
control: "number",
|
|
27
|
+
description: "Nombre max de fichiers",
|
|
22
28
|
},
|
|
23
29
|
multiple: {
|
|
24
|
-
control:
|
|
25
|
-
description:
|
|
30
|
+
control: "boolean",
|
|
31
|
+
description: "Upload multiple",
|
|
26
32
|
},
|
|
27
33
|
showPreview: {
|
|
28
|
-
control:
|
|
29
|
-
description:
|
|
34
|
+
control: "boolean",
|
|
35
|
+
description: "Afficher la prévisualisation",
|
|
30
36
|
},
|
|
31
37
|
showProgress: {
|
|
32
|
-
control:
|
|
33
|
-
description:
|
|
38
|
+
control: "boolean",
|
|
39
|
+
description: "Afficher la barre de progression",
|
|
34
40
|
},
|
|
35
41
|
disabled: {
|
|
36
|
-
control:
|
|
37
|
-
description:
|
|
42
|
+
control: "boolean",
|
|
43
|
+
description: "État désactivé",
|
|
44
|
+
},
|
|
45
|
+
placeholder: {
|
|
46
|
+
control: "text",
|
|
47
|
+
description: "Texte placeholder",
|
|
48
|
+
},
|
|
49
|
+
label: {
|
|
50
|
+
control: "text",
|
|
51
|
+
description: "Label du champ",
|
|
38
52
|
},
|
|
39
53
|
},
|
|
40
54
|
}
|
|
@@ -43,197 +57,127 @@ export default meta
|
|
|
43
57
|
type Story = StoryObj<typeof WakaFileUpload>
|
|
44
58
|
|
|
45
59
|
// Mock upload function
|
|
46
|
-
const mockUpload = (file: File, onProgress: (progress: number) => void): Promise<string> => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (progress >= 100) {
|
|
53
|
-
clearInterval(interval)
|
|
54
|
-
resolve(`https://example.com/uploads/${file.name}`)
|
|
55
|
-
}
|
|
56
|
-
}, 200)
|
|
57
|
-
})
|
|
60
|
+
const mockUpload = async (file: File, onProgress: (progress: number) => void): Promise<string> => {
|
|
61
|
+
for (let i = 0; i <= 100; i += 10) {
|
|
62
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
63
|
+
onProgress(i)
|
|
64
|
+
}
|
|
65
|
+
return `https://example.com/uploads/${file.name}`
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
export const Default: Story = {
|
|
61
69
|
args: {
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
variant: "dropzone",
|
|
71
|
+
placeholder: "Glissez vos fichiers ici ou cliquez pour sélectionner",
|
|
72
|
+
label: "Téléverser des fichiers",
|
|
73
|
+
multiple: true,
|
|
74
|
+
showPreview: true,
|
|
75
|
+
showProgress: true,
|
|
64
76
|
},
|
|
65
77
|
render: (args) => (
|
|
66
|
-
<div
|
|
67
|
-
<WakaFileUpload
|
|
68
|
-
{...args}
|
|
69
|
-
onUpload={mockUpload}
|
|
70
|
-
onComplete={(files) => console.log('Uploaded:', files)}
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
),
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const Dropzone: Story = {
|
|
77
|
-
render: () => (
|
|
78
|
-
<div className="w-[400px]">
|
|
79
|
-
<WakaFileUpload
|
|
80
|
-
variant="dropzone"
|
|
81
|
-
label="Documents"
|
|
82
|
-
placeholder="Drop your documents here"
|
|
83
|
-
onUpload={mockUpload}
|
|
84
|
-
/>
|
|
78
|
+
<div style={{ width: 400 }}>
|
|
79
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
85
80
|
</div>
|
|
86
81
|
),
|
|
87
82
|
}
|
|
88
83
|
|
|
89
84
|
export const ButtonVariant: Story = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
args: {
|
|
86
|
+
variant: "button",
|
|
87
|
+
placeholder: "Sélectionner des fichiers",
|
|
88
|
+
multiple: true,
|
|
89
|
+
},
|
|
90
|
+
render: (args) => (
|
|
91
|
+
<div style={{ width: 300 }}>
|
|
92
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
93
|
+
</div>
|
|
96
94
|
),
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
export const InlineVariant: Story = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
args: {
|
|
99
|
+
variant: "inline",
|
|
100
|
+
placeholder: "Choisir un fichier",
|
|
101
|
+
multiple: false,
|
|
102
|
+
},
|
|
103
|
+
render: (args) => (
|
|
104
|
+
<div style={{ width: 400 }}>
|
|
105
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
107
106
|
</div>
|
|
108
107
|
),
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
export const ImagesOnly: Story = {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
args: {
|
|
112
|
+
variant: "dropzone",
|
|
113
|
+
accept: "image/*",
|
|
114
|
+
placeholder: "Glissez vos images ici",
|
|
115
|
+
label: "Téléverser des images",
|
|
116
|
+
multiple: true,
|
|
117
|
+
showPreview: true,
|
|
118
|
+
},
|
|
119
|
+
render: (args) => (
|
|
120
|
+
<div style={{ width: 400 }}>
|
|
121
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
120
122
|
</div>
|
|
121
123
|
),
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
export const PDFOnly: Story = {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
args: {
|
|
128
|
+
variant: "dropzone",
|
|
129
|
+
accept: ".pdf",
|
|
130
|
+
placeholder: "Glissez vos fichiers PDF ici",
|
|
131
|
+
label: "Téléverser des PDF",
|
|
132
|
+
multiple: true,
|
|
133
|
+
},
|
|
134
|
+
render: (args) => (
|
|
135
|
+
<div style={{ width: 400 }}>
|
|
136
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
133
137
|
</div>
|
|
134
138
|
),
|
|
135
139
|
}
|
|
136
140
|
|
|
137
|
-
export const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
export const SingleFile: Story = {
|
|
142
|
+
args: {
|
|
143
|
+
variant: "dropzone",
|
|
144
|
+
placeholder: "Glissez un fichier ici",
|
|
145
|
+
label: "Fichier unique",
|
|
146
|
+
multiple: false,
|
|
147
|
+
maxFiles: 1,
|
|
148
|
+
},
|
|
149
|
+
render: (args) => (
|
|
150
|
+
<div style={{ width: 400 }}>
|
|
151
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
147
152
|
</div>
|
|
148
153
|
),
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
export const WithSizeLimit: Story = {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export const NoPreview: Story = {
|
|
165
|
-
render: () => (
|
|
166
|
-
<div className="w-[400px]">
|
|
167
|
-
<WakaFileUpload
|
|
168
|
-
label="Upload"
|
|
169
|
-
showPreview={false}
|
|
170
|
-
onUpload={mockUpload}
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
),
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export const NoProgress: Story = {
|
|
177
|
-
render: () => (
|
|
178
|
-
<div className="w-[400px]">
|
|
179
|
-
<WakaFileUpload
|
|
180
|
-
label="Quick Upload"
|
|
181
|
-
showProgress={false}
|
|
182
|
-
onUpload={mockUpload}
|
|
183
|
-
/>
|
|
157
|
+
args: {
|
|
158
|
+
variant: "dropzone",
|
|
159
|
+
placeholder: "Max 5 MB par fichier",
|
|
160
|
+
label: "Fichiers limités",
|
|
161
|
+
multiple: true,
|
|
162
|
+
maxSize: 5 * 1024 * 1024, // 5MB
|
|
163
|
+
},
|
|
164
|
+
render: (args) => (
|
|
165
|
+
<div style={{ width: 400 }}>
|
|
166
|
+
<WakaFileUpload {...args} onUpload={mockUpload} />
|
|
184
167
|
</div>
|
|
185
168
|
),
|
|
186
169
|
}
|
|
187
170
|
|
|
188
171
|
export const Disabled: Story = {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export const ProfilePicture: Story = {
|
|
200
|
-
render: () => (
|
|
201
|
-
<div className="w-[400px] space-y-4">
|
|
202
|
-
<h3 className="font-semibold">Profile Picture</h3>
|
|
203
|
-
<WakaFileUpload
|
|
204
|
-
accept="image/*"
|
|
205
|
-
maxSize={5 * 1024 * 1024}
|
|
206
|
-
maxFiles={1}
|
|
207
|
-
placeholder="Upload a profile picture (max 5MB)"
|
|
208
|
-
onUpload={mockUpload}
|
|
209
|
-
/>
|
|
210
|
-
</div>
|
|
211
|
-
),
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export const DocumentUpload: Story = {
|
|
215
|
-
render: () => (
|
|
216
|
-
<div className="w-[400px] space-y-4 p-4 border rounded-lg">
|
|
217
|
-
<div>
|
|
218
|
-
<h3 className="font-semibold">Document Submission</h3>
|
|
219
|
-
<p className="text-sm text-muted-foreground">
|
|
220
|
-
Upload your required documents
|
|
221
|
-
</p>
|
|
222
|
-
</div>
|
|
223
|
-
<WakaFileUpload
|
|
224
|
-
label="ID Document"
|
|
225
|
-
accept=".pdf,.jpg,.png"
|
|
226
|
-
maxSize={10 * 1024 * 1024}
|
|
227
|
-
placeholder="Upload ID (PDF, JPG, PNG)"
|
|
228
|
-
onUpload={mockUpload}
|
|
229
|
-
/>
|
|
230
|
-
<WakaFileUpload
|
|
231
|
-
label="Proof of Address"
|
|
232
|
-
accept=".pdf,.jpg,.png"
|
|
233
|
-
maxSize={10 * 1024 * 1024}
|
|
234
|
-
placeholder="Upload proof of address"
|
|
235
|
-
onUpload={mockUpload}
|
|
236
|
-
/>
|
|
172
|
+
args: {
|
|
173
|
+
variant: "dropzone",
|
|
174
|
+
placeholder: "Upload désactivé",
|
|
175
|
+
label: "Fichiers",
|
|
176
|
+
disabled: true,
|
|
177
|
+
},
|
|
178
|
+
render: (args) => (
|
|
179
|
+
<div style={{ width: 400 }}>
|
|
180
|
+
<WakaFileUpload {...args} />
|
|
237
181
|
</div>
|
|
238
182
|
),
|
|
239
183
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaFloatingNav, type FloatingNavItem } from "./index"
|
|
3
|
+
import { Home, Search, Bell, User, Settings } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WakaFloatingNav> = {
|
|
6
|
+
title: "Navigation/WakaFloatingNav",
|
|
7
|
+
component: WakaFloatingNav,
|
|
8
|
+
parameters: { layout: "centered" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
position: { control: "select", options: ["bottom", "top", "left", "right"], description: "Position" },
|
|
12
|
+
variant: { control: "select", options: ["pill", "bar", "floating"], description: "Variante" },
|
|
13
|
+
showLabels: { control: "boolean", description: "Afficher les labels" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof WakaFloatingNav>
|
|
19
|
+
|
|
20
|
+
const items: FloatingNavItem[] = [
|
|
21
|
+
{ id: "home", label: "Accueil", icon: <Home className="tw-h-5 tw-w-5" />, active: true },
|
|
22
|
+
{ id: "search", label: "Recherche", icon: <Search className="tw-h-5 tw-w-5" /> },
|
|
23
|
+
{ id: "notifications", label: "Notifications", icon: <Bell className="tw-h-5 tw-w-5" /> },
|
|
24
|
+
{ id: "profile", label: "Profil", icon: <User className="tw-h-5 tw-w-5" /> },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: { items, position: "bottom", variant: "pill", showLabels: false },
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<div style={{ position: "relative", width: 400, height: 200 }}>
|
|
31
|
+
<WakaFloatingNav {...args} />
|
|
32
|
+
</div>
|
|
33
|
+
),
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const WithLabels: Story = {
|
|
37
|
+
args: { items, position: "bottom", variant: "bar", showLabels: true },
|
|
38
|
+
render: (args) => (
|
|
39
|
+
<div style={{ position: "relative", width: 500, height: 200 }}>
|
|
40
|
+
<WakaFloatingNav {...args} />
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const TopPosition: Story = {
|
|
46
|
+
args: { items, position: "top", variant: "pill" },
|
|
47
|
+
render: (args) => (
|
|
48
|
+
<div style={{ position: "relative", width: 400, height: 200 }}>
|
|
49
|
+
<WakaFloatingNav {...args} />
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaGoalProgress, WakaGoalCard } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaGoalProgress> = {
|
|
5
|
+
title: "Components/Gamification/WakaGoalProgress",
|
|
6
|
+
component: WakaGoalProgress,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: {
|
|
13
|
+
control: "select",
|
|
14
|
+
options: ["sm", "default", "lg"],
|
|
15
|
+
description: "Size variant",
|
|
16
|
+
},
|
|
17
|
+
theme: {
|
|
18
|
+
control: "select",
|
|
19
|
+
options: ["default", "success", "warning", "danger", "purple", "blue"],
|
|
20
|
+
description: "Color theme",
|
|
21
|
+
},
|
|
22
|
+
goalType: {
|
|
23
|
+
control: "select",
|
|
24
|
+
options: ["revenue", "users", "sales", "engagement", "custom"],
|
|
25
|
+
description: "Goal type for formatting",
|
|
26
|
+
},
|
|
27
|
+
showPercentage: {
|
|
28
|
+
control: "boolean",
|
|
29
|
+
description: "Show percentage",
|
|
30
|
+
},
|
|
31
|
+
showValues: {
|
|
32
|
+
control: "boolean",
|
|
33
|
+
description: "Show current/target values",
|
|
34
|
+
},
|
|
35
|
+
showTimeRemaining: {
|
|
36
|
+
control: "boolean",
|
|
37
|
+
description: "Show time remaining",
|
|
38
|
+
},
|
|
39
|
+
animated: {
|
|
40
|
+
control: "boolean",
|
|
41
|
+
description: "Enable animations",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default meta
|
|
47
|
+
type Story = StoryObj<typeof WakaGoalProgress>
|
|
48
|
+
|
|
49
|
+
export const Default: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
currentValue: 7500,
|
|
52
|
+
targetValue: 10000,
|
|
53
|
+
title: "Monthly Revenue Goal",
|
|
54
|
+
description: "Reach $10K in monthly revenue",
|
|
55
|
+
goalType: "revenue",
|
|
56
|
+
theme: "default",
|
|
57
|
+
showPercentage: true,
|
|
58
|
+
showValues: true,
|
|
59
|
+
animated: true,
|
|
60
|
+
},
|
|
61
|
+
render: (args) => (
|
|
62
|
+
<div className="max-w-md">
|
|
63
|
+
<WakaGoalProgress {...args} />
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const WithDeadline: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
currentValue: 450,
|
|
71
|
+
targetValue: 1000,
|
|
72
|
+
title: "New Users Goal",
|
|
73
|
+
goalType: "users",
|
|
74
|
+
startDate: new Date(Date.now() - 15 * 24 * 60 * 60 * 1000),
|
|
75
|
+
endDate: new Date(Date.now() + 15 * 24 * 60 * 60 * 1000),
|
|
76
|
+
showTimeRemaining: true,
|
|
77
|
+
theme: "purple",
|
|
78
|
+
},
|
|
79
|
+
render: (args) => (
|
|
80
|
+
<div className="max-w-md">
|
|
81
|
+
<WakaGoalProgress {...args} />
|
|
82
|
+
</div>
|
|
83
|
+
),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const WithMilestones: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
currentValue: 65,
|
|
89
|
+
targetValue: 100,
|
|
90
|
+
title: "Engagement Rate",
|
|
91
|
+
goalType: "engagement",
|
|
92
|
+
milestones: [
|
|
93
|
+
{ value: 25, label: "25%" },
|
|
94
|
+
{ value: 50, label: "Halfway!" },
|
|
95
|
+
{ value: 75, label: "Almost there" },
|
|
96
|
+
],
|
|
97
|
+
theme: "success",
|
|
98
|
+
},
|
|
99
|
+
render: (args) => (
|
|
100
|
+
<div className="max-w-md">
|
|
101
|
+
<WakaGoalProgress {...args} />
|
|
102
|
+
</div>
|
|
103
|
+
),
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const Completed: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
currentValue: 10500,
|
|
109
|
+
targetValue: 10000,
|
|
110
|
+
title: "Sales Target",
|
|
111
|
+
goalType: "sales",
|
|
112
|
+
theme: "success",
|
|
113
|
+
},
|
|
114
|
+
render: (args) => (
|
|
115
|
+
<div className="max-w-md">
|
|
116
|
+
<WakaGoalProgress {...args} />
|
|
117
|
+
</div>
|
|
118
|
+
),
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const AsCard: Story = {
|
|
122
|
+
args: {
|
|
123
|
+
currentValue: 3200,
|
|
124
|
+
targetValue: 5000,
|
|
125
|
+
title: "Community Growth",
|
|
126
|
+
description: "Grow our community to 5000 members",
|
|
127
|
+
goalType: "users",
|
|
128
|
+
unit: "members",
|
|
129
|
+
theme: "blue",
|
|
130
|
+
},
|
|
131
|
+
render: (args) => (
|
|
132
|
+
<div className="max-w-md">
|
|
133
|
+
<WakaGoalCard {...args} bordered />
|
|
134
|
+
</div>
|
|
135
|
+
),
|
|
136
|
+
}
|
|
137
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaHotspot } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaHotspot> = {
|
|
5
|
+
title: "UI/WakaHotspot",
|
|
6
|
+
component: WakaHotspot,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: { control: "select", options: ["dot", "icon", "badge"], description: "Variante" },
|
|
11
|
+
size: { control: "select", options: ["sm", "default", "lg"], description: "Taille" },
|
|
12
|
+
trigger: { control: "select", options: ["click", "hover", "both"], description: "Déclencheur" },
|
|
13
|
+
position: { control: "select", options: ["top", "bottom", "left", "right"], description: "Position tooltip" },
|
|
14
|
+
iconType: { control: "select", options: ["help", "info", "lightbulb", "star", "zap", "alert"], description: "Icône" },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof WakaHotspot>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: { id: "hotspot-1", content: "Cliquez ici pour plus d'informations", variant: "dot", trigger: "click" },
|
|
23
|
+
render: (args) => (
|
|
24
|
+
<div style={{ padding: 50 }}>
|
|
25
|
+
<WakaHotspot {...args} />
|
|
26
|
+
</div>
|
|
27
|
+
),
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const IconVariant: Story = {
|
|
31
|
+
args: { id: "hotspot-2", content: "Aide contextuelle", title: "Astuce", variant: "icon", iconType: "info", trigger: "hover" },
|
|
32
|
+
render: (args) => (
|
|
33
|
+
<div style={{ padding: 50 }}>
|
|
34
|
+
<WakaHotspot {...args} />
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Badge: Story = {
|
|
40
|
+
args: { id: "hotspot-3", content: "Nouvelle fonctionnalité disponible !", variant: "badge", size: "lg" },
|
|
41
|
+
render: (args) => (
|
|
42
|
+
<div style={{ padding: 50 }}>
|
|
43
|
+
<WakaHotspot {...args} />
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Small: Story = {
|
|
49
|
+
args: { id: "hotspot-4", content: "Info rapide", variant: "dot", size: "sm", trigger: "hover" },
|
|
50
|
+
render: (args) => (
|
|
51
|
+
<div style={{ padding: 50 }}>
|
|
52
|
+
<WakaHotspot {...args} />
|
|
53
|
+
</div>
|
|
54
|
+
),
|
|
55
|
+
}
|
|
56
|
+
|