@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,124 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPermissionMatrix, type Permission, type Role, type PermissionCategory, type PermissionValue } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaPermissionMatrix> = {
|
|
5
|
+
title: "Security/WakaPermissionMatrix",
|
|
6
|
+
component: WakaPermissionMatrix,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
readOnly: { control: "boolean", description: "Mode lecture seule" },
|
|
11
|
+
enableSearch: { control: "boolean", description: "Activer la recherche" },
|
|
12
|
+
showInheritance: { control: "boolean", description: "Afficher l'heritage" },
|
|
13
|
+
enableComparison: { control: "boolean", description: "Activer la comparaison" },
|
|
14
|
+
enableBulkOperations: { control: "boolean", description: "Activer les operations en masse" },
|
|
15
|
+
cellSize: { control: "select", options: ["sm", "md", "lg"], description: "Taille des cellules" },
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof WakaPermissionMatrix>
|
|
21
|
+
|
|
22
|
+
const categories: PermissionCategory[] = [
|
|
23
|
+
{ id: "data", name: "Donnees", order: 1 },
|
|
24
|
+
{ id: "system", name: "Systeme", order: 2 },
|
|
25
|
+
{ id: "users", name: "Utilisateurs", order: 3 },
|
|
26
|
+
{ id: "finance", name: "Finance", order: 4 },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const permissions: Permission[] = [
|
|
30
|
+
{ id: "read", name: "Lecture", categoryId: "data", description: "Lire les donnees" },
|
|
31
|
+
{ id: "write", name: "Ecriture", categoryId: "data", description: "Modifier les donnees" },
|
|
32
|
+
{ id: "delete", name: "Suppression", categoryId: "data", description: "Supprimer les donnees" },
|
|
33
|
+
{ id: "admin", name: "Administration", categoryId: "system", description: "Acces administrateur" },
|
|
34
|
+
{ id: "invite", name: "Inviter des utilisateurs", categoryId: "users", description: "Inviter de nouveaux utilisateurs" },
|
|
35
|
+
{ id: "billing", name: "Facturation", categoryId: "finance", description: "Gerer la facturation" },
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
const roles: Role[] = [
|
|
39
|
+
{ id: "admin", name: "Administrateur", order: 1, color: "#ef4444" },
|
|
40
|
+
{ id: "manager", name: "Manager", order: 2, color: "#3b82f6" },
|
|
41
|
+
{ id: "user", name: "Utilisateur", order: 3, color: "#22c55e" },
|
|
42
|
+
{ id: "viewer", name: "Lecteur", order: 4, color: "#a855f7" },
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
const initialValues: PermissionValue[] = [
|
|
46
|
+
// Admin has all permissions
|
|
47
|
+
{ roleId: "admin", permissionId: "read", granted: true },
|
|
48
|
+
{ roleId: "admin", permissionId: "write", granted: true },
|
|
49
|
+
{ roleId: "admin", permissionId: "delete", granted: true },
|
|
50
|
+
{ roleId: "admin", permissionId: "admin", granted: true },
|
|
51
|
+
{ roleId: "admin", permissionId: "invite", granted: true },
|
|
52
|
+
{ roleId: "admin", permissionId: "billing", granted: true },
|
|
53
|
+
// Manager has read, write, invite
|
|
54
|
+
{ roleId: "manager", permissionId: "read", granted: true },
|
|
55
|
+
{ roleId: "manager", permissionId: "write", granted: true },
|
|
56
|
+
{ roleId: "manager", permissionId: "invite", granted: true },
|
|
57
|
+
// User has read only
|
|
58
|
+
{ roleId: "user", permissionId: "read", granted: true },
|
|
59
|
+
// Viewer has read only
|
|
60
|
+
{ roleId: "viewer", permissionId: "read", granted: true },
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
permissions,
|
|
66
|
+
roles,
|
|
67
|
+
categories,
|
|
68
|
+
initialValues,
|
|
69
|
+
readOnly: true,
|
|
70
|
+
enableSearch: true,
|
|
71
|
+
},
|
|
72
|
+
render: (args) => <WakaPermissionMatrix {...args} />,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Editable: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
permissions,
|
|
78
|
+
roles,
|
|
79
|
+
categories,
|
|
80
|
+
initialValues,
|
|
81
|
+
readOnly: false,
|
|
82
|
+
enableSearch: true,
|
|
83
|
+
enableBulkOperations: true,
|
|
84
|
+
onPermissionChange: (roleId, permissionId, granted) => {
|
|
85
|
+
console.log(`Permission changed: ${roleId} - ${permissionId} = ${granted}`)
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
render: (args) => <WakaPermissionMatrix {...args} />,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const WithInheritance: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
permissions,
|
|
94
|
+
roles: roles.map((r, i) => ({
|
|
95
|
+
...r,
|
|
96
|
+
inheritsFrom: i > 0 ? roles[i - 1].id : undefined,
|
|
97
|
+
})),
|
|
98
|
+
categories,
|
|
99
|
+
initialValues: [
|
|
100
|
+
...initialValues,
|
|
101
|
+
// Add some inherited values
|
|
102
|
+
{ roleId: "manager", permissionId: "admin", granted: false, inherited: true, inheritedFrom: "admin" },
|
|
103
|
+
{ roleId: "user", permissionId: "write", granted: false, inherited: true, inheritedFrom: "manager" },
|
|
104
|
+
],
|
|
105
|
+
showInheritance: true,
|
|
106
|
+
},
|
|
107
|
+
render: (args) => <WakaPermissionMatrix {...args} />,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const Compact: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
permissions: permissions.slice(0, 4),
|
|
113
|
+
roles: roles.slice(0, 3),
|
|
114
|
+
categories: categories.slice(0, 2),
|
|
115
|
+
initialValues: initialValues.filter(
|
|
116
|
+
(v) =>
|
|
117
|
+
["read", "write", "delete", "admin"].includes(v.permissionId) &&
|
|
118
|
+
["admin", "manager", "user"].includes(v.roleId)
|
|
119
|
+
),
|
|
120
|
+
enableSearch: false,
|
|
121
|
+
cellSize: "sm",
|
|
122
|
+
},
|
|
123
|
+
render: (args) => <WakaPermissionMatrix {...args} />,
|
|
124
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPhoneInput } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaPhoneInput> = {
|
|
5
|
+
title: "Forms/WakaPhoneInput",
|
|
6
|
+
component: WakaPhoneInput,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
defaultCountry: { control: "text", description: "Pays par défaut" },
|
|
11
|
+
placeholder: { control: "text", description: "Placeholder" },
|
|
12
|
+
disabled: { control: "boolean", description: "Désactivé" },
|
|
13
|
+
showCountrySelect: { control: "boolean", description: "Sélecteur de pays" },
|
|
14
|
+
showFlag: { control: "boolean", description: "Afficher le drapeau" },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default meta
|
|
19
|
+
type Story = StoryObj<typeof WakaPhoneInput>
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: { defaultCountry: "FR", placeholder: "Numéro de téléphone", showCountrySelect: true, showFlag: true },
|
|
23
|
+
render: (args) => (
|
|
24
|
+
<div style={{ width: 350 }}>
|
|
25
|
+
<WakaPhoneInput {...args} />
|
|
26
|
+
</div>
|
|
27
|
+
),
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const USDefault: Story = {
|
|
31
|
+
args: { defaultCountry: "US", placeholder: "Phone number", showCountrySelect: true },
|
|
32
|
+
render: (args) => (
|
|
33
|
+
<div style={{ width: 350 }}>
|
|
34
|
+
<WakaPhoneInput {...args} />
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const NoCountrySelect: Story = {
|
|
40
|
+
args: { defaultCountry: "FR", placeholder: "06 00 00 00 00", showCountrySelect: false, showFlag: true },
|
|
41
|
+
render: (args) => (
|
|
42
|
+
<div style={{ width: 300 }}>
|
|
43
|
+
<WakaPhoneInput {...args} />
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Disabled: Story = {
|
|
49
|
+
args: { defaultCountry: "FR", disabled: true, value: "+33 6 12 34 56 78" },
|
|
50
|
+
render: (args) => (
|
|
51
|
+
<div style={{ width: 350 }}>
|
|
52
|
+
<WakaPhoneInput {...args} />
|
|
53
|
+
</div>
|
|
54
|
+
),
|
|
55
|
+
}
|
|
56
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPointsPopup, usePointsPopup } from "./index"
|
|
3
|
+
import { Button } from "../button"
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
|
|
6
|
+
const InteractiveDemo = () => {
|
|
7
|
+
const { trigger, PopupContainer } = usePointsPopup()
|
|
8
|
+
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
9
|
+
|
|
10
|
+
const handleClick = (points: number, e: React.MouseEvent) => {
|
|
11
|
+
const rect = containerRef.current?.getBoundingClientRect()
|
|
12
|
+
if (rect) {
|
|
13
|
+
trigger(points, {
|
|
14
|
+
x: e.clientX - rect.left,
|
|
15
|
+
y: e.clientY - rect.top,
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
ref={containerRef}
|
|
23
|
+
className="relative w-[400px] h-[300px] bg-card border rounded-lg flex flex-col items-center justify-center gap-4"
|
|
24
|
+
>
|
|
25
|
+
<PopupContainer />
|
|
26
|
+
<p className="text-muted-foreground text-sm">Click buttons to trigger popups</p>
|
|
27
|
+
<div className="flex gap-2">
|
|
28
|
+
<Button onClick={(e) => handleClick(10, e)} variant="default">+10 XP</Button>
|
|
29
|
+
<Button onClick={(e) => handleClick(50, e)} variant="secondary">+50 XP</Button>
|
|
30
|
+
<Button onClick={(e) => handleClick(100, e)} variant="outline">+100 XP</Button>
|
|
31
|
+
<Button onClick={(e) => handleClick(-25, e)} variant="destructive">-25 XP</Button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const meta: Meta<typeof WakaPointsPopup> = {
|
|
38
|
+
title: "Components/Gamification/WakaPointsPopup",
|
|
39
|
+
component: WakaPointsPopup,
|
|
40
|
+
parameters: {
|
|
41
|
+
layout: "centered",
|
|
42
|
+
},
|
|
43
|
+
tags: ["autodocs"],
|
|
44
|
+
argTypes: {
|
|
45
|
+
points: {
|
|
46
|
+
control: "number",
|
|
47
|
+
description: "Points value to display",
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
control: "select",
|
|
51
|
+
options: ["sm", "md", "lg"],
|
|
52
|
+
description: "Size variant",
|
|
53
|
+
},
|
|
54
|
+
prefix: {
|
|
55
|
+
control: "text",
|
|
56
|
+
description: "Prefix text (e.g., XP)",
|
|
57
|
+
},
|
|
58
|
+
duration: {
|
|
59
|
+
control: "number",
|
|
60
|
+
description: "Animation duration (ms)",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default meta
|
|
66
|
+
type Story = StoryObj<typeof WakaPointsPopup>
|
|
67
|
+
|
|
68
|
+
export const Interactive: Story = {
|
|
69
|
+
render: () => <InteractiveDemo />,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const Positive: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
points: 100,
|
|
75
|
+
size: "lg",
|
|
76
|
+
prefix: "XP",
|
|
77
|
+
},
|
|
78
|
+
render: (args) => (
|
|
79
|
+
<div className="relative w-[200px] h-[200px] bg-card border rounded-lg flex items-center justify-center">
|
|
80
|
+
<WakaPointsPopup {...args} />
|
|
81
|
+
</div>
|
|
82
|
+
),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Negative: Story = {
|
|
86
|
+
args: {
|
|
87
|
+
points: -50,
|
|
88
|
+
size: "lg",
|
|
89
|
+
},
|
|
90
|
+
render: (args) => (
|
|
91
|
+
<div className="relative w-[200px] h-[200px] bg-card border rounded-lg flex items-center justify-center">
|
|
92
|
+
<WakaPointsPopup {...args} />
|
|
93
|
+
</div>
|
|
94
|
+
),
|
|
95
|
+
}
|
|
96
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPowerUp, PowerUp } from "./index"
|
|
3
|
+
|
|
4
|
+
const speedPowerUp: PowerUp = {
|
|
5
|
+
id: "speed-1",
|
|
6
|
+
type: "speed",
|
|
7
|
+
name: "Speed Boost",
|
|
8
|
+
description: "Move 2x faster for 30 seconds",
|
|
9
|
+
duration: 30000,
|
|
10
|
+
multiplier: 2,
|
|
11
|
+
isActive: true,
|
|
12
|
+
activatedAt: Date.now(),
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const shieldPowerUp: PowerUp = {
|
|
16
|
+
id: "shield-1",
|
|
17
|
+
type: "shield",
|
|
18
|
+
name: "Protection Shield",
|
|
19
|
+
description: "Blocks the next 3 attacks",
|
|
20
|
+
duration: 60000,
|
|
21
|
+
multiplier: 3,
|
|
22
|
+
stackCount: 3,
|
|
23
|
+
maxStack: 3,
|
|
24
|
+
isActive: true,
|
|
25
|
+
activatedAt: Date.now(),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const coinsPowerUp: PowerUp = {
|
|
29
|
+
id: "coins-1",
|
|
30
|
+
type: "coins",
|
|
31
|
+
name: "Coin Magnet",
|
|
32
|
+
description: "Automatically collect nearby coins",
|
|
33
|
+
duration: 45000,
|
|
34
|
+
multiplier: 1,
|
|
35
|
+
isActive: true,
|
|
36
|
+
activatedAt: Date.now(),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const meta: Meta<typeof WakaPowerUp> = {
|
|
40
|
+
title: "Components/Gamification/WakaPowerUp",
|
|
41
|
+
component: WakaPowerUp,
|
|
42
|
+
parameters: {
|
|
43
|
+
layout: "centered",
|
|
44
|
+
},
|
|
45
|
+
tags: ["autodocs"],
|
|
46
|
+
argTypes: {
|
|
47
|
+
size: {
|
|
48
|
+
control: "select",
|
|
49
|
+
options: ["sm", "md", "lg"],
|
|
50
|
+
description: "Size variant",
|
|
51
|
+
},
|
|
52
|
+
variant: {
|
|
53
|
+
control: "select",
|
|
54
|
+
options: ["card", "badge", "compact"],
|
|
55
|
+
description: "Visual variant",
|
|
56
|
+
},
|
|
57
|
+
showCountdown: {
|
|
58
|
+
control: "boolean",
|
|
59
|
+
description: "Show countdown timer",
|
|
60
|
+
},
|
|
61
|
+
showDescription: {
|
|
62
|
+
control: "boolean",
|
|
63
|
+
description: "Show description",
|
|
64
|
+
},
|
|
65
|
+
glowEnabled: {
|
|
66
|
+
control: "boolean",
|
|
67
|
+
description: "Enable glow animation",
|
|
68
|
+
},
|
|
69
|
+
pulseEnabled: {
|
|
70
|
+
control: "boolean",
|
|
71
|
+
description: "Enable pulse animation",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default meta
|
|
77
|
+
type Story = StoryObj<typeof WakaPowerUp>
|
|
78
|
+
|
|
79
|
+
export const Card: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
powerUp: speedPowerUp,
|
|
82
|
+
variant: "card",
|
|
83
|
+
size: "md",
|
|
84
|
+
showCountdown: true,
|
|
85
|
+
showDescription: true,
|
|
86
|
+
glowEnabled: true,
|
|
87
|
+
},
|
|
88
|
+
render: (args) => <WakaPowerUp {...args} />,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const Badge: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
powerUp: shieldPowerUp,
|
|
94
|
+
variant: "badge",
|
|
95
|
+
size: "md",
|
|
96
|
+
showCountdown: true,
|
|
97
|
+
glowEnabled: true,
|
|
98
|
+
},
|
|
99
|
+
render: (args) => <WakaPowerUp {...args} />,
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const Compact: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
powerUp: coinsPowerUp,
|
|
105
|
+
variant: "compact",
|
|
106
|
+
size: "sm",
|
|
107
|
+
showCountdown: true,
|
|
108
|
+
},
|
|
109
|
+
render: (args) => <WakaPowerUp {...args} />,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const MultiplePowerUps: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<div className="flex gap-4">
|
|
115
|
+
<WakaPowerUp powerUp={speedPowerUp} variant="badge" showCountdown glowEnabled />
|
|
116
|
+
<WakaPowerUp powerUp={shieldPowerUp} variant="badge" showCountdown glowEnabled />
|
|
117
|
+
<WakaPowerUp powerUp={coinsPowerUp} variant="badge" showCountdown glowEnabled />
|
|
118
|
+
</div>
|
|
119
|
+
),
|
|
120
|
+
}
|
|
121
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPresenceIndicator } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaPresenceIndicator> = {
|
|
5
|
+
title: "UI/WakaPresenceIndicator",
|
|
6
|
+
component: WakaPresenceIndicator,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
status: { control: "select", options: ["online", "offline", "away", "busy", "dnd"], description: "Statut" },
|
|
11
|
+
size: { control: "select", options: ["sm", "md", "lg"], description: "Taille" },
|
|
12
|
+
showLabel: { control: "boolean", description: "Afficher le label" },
|
|
13
|
+
animated: { control: "boolean", description: "Animation" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof WakaPresenceIndicator>
|
|
19
|
+
|
|
20
|
+
export const Online: Story = {
|
|
21
|
+
args: { status: "online", size: "md", showLabel: true, animated: true },
|
|
22
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Offline: Story = {
|
|
26
|
+
args: { status: "offline", size: "md", showLabel: true },
|
|
27
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Away: Story = {
|
|
31
|
+
args: { status: "away", size: "md", showLabel: true },
|
|
32
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Busy: Story = {
|
|
36
|
+
args: { status: "busy", size: "md", showLabel: true },
|
|
37
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const DoNotDisturb: Story = {
|
|
41
|
+
args: { status: "dnd", size: "lg", showLabel: true },
|
|
42
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Small: Story = {
|
|
46
|
+
args: { status: "online", size: "sm", showLabel: false },
|
|
47
|
+
render: (args) => <WakaPresenceIndicator {...args} />,
|
|
48
|
+
}
|
|
49
|
+
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaPricingTable, type PricingTier, type PricingFeature } from "./index"
|
|
3
|
+
import { useState } from "react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WakaPricingTable> = {
|
|
6
|
+
title: "E-commerce/WakaPricingTable",
|
|
7
|
+
component: WakaPricingTable,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "padded",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
billingPeriod: {
|
|
14
|
+
control: "select",
|
|
15
|
+
options: ["monthly", "annual"],
|
|
16
|
+
description: "Période de facturation",
|
|
17
|
+
},
|
|
18
|
+
showToggle: {
|
|
19
|
+
control: "boolean",
|
|
20
|
+
description: "Afficher le toggle mensuel/annuel",
|
|
21
|
+
},
|
|
22
|
+
highlightPopular: {
|
|
23
|
+
control: "boolean",
|
|
24
|
+
description: "Mettre en avant le plan populaire",
|
|
25
|
+
},
|
|
26
|
+
currency: {
|
|
27
|
+
control: "text",
|
|
28
|
+
description: "Symbole de devise",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default meta
|
|
34
|
+
type Story = StoryObj<typeof WakaPricingTable>
|
|
35
|
+
|
|
36
|
+
const features: PricingFeature[] = [
|
|
37
|
+
{ name: "Utilisateurs", tooltip: "Nombre d'utilisateurs inclus" },
|
|
38
|
+
{ name: "Stockage", tooltip: "Espace de stockage cloud" },
|
|
39
|
+
{ name: "Projets", tooltip: "Nombre de projets simultanés" },
|
|
40
|
+
{ name: "Support", tooltip: "Type de support inclus" },
|
|
41
|
+
{ name: "API Access" },
|
|
42
|
+
{ name: "Analytics avancés" },
|
|
43
|
+
{ name: "SSO" },
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
const tiers: PricingTier[] = [
|
|
47
|
+
{
|
|
48
|
+
id: "free",
|
|
49
|
+
name: "Gratuit",
|
|
50
|
+
description: "Pour démarrer",
|
|
51
|
+
monthlyPrice: 0,
|
|
52
|
+
annualPrice: 0,
|
|
53
|
+
features: [
|
|
54
|
+
{ name: "Utilisateurs", included: true, value: "1" },
|
|
55
|
+
{ name: "Stockage", included: true, value: "1 GB" },
|
|
56
|
+
{ name: "Projets", included: true, value: "3" },
|
|
57
|
+
{ name: "Support", included: true, value: "Email" },
|
|
58
|
+
{ name: "API Access", included: false },
|
|
59
|
+
{ name: "Analytics avancés", included: false },
|
|
60
|
+
{ name: "SSO", included: false },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "pro",
|
|
65
|
+
name: "Pro",
|
|
66
|
+
description: "Pour les équipes",
|
|
67
|
+
monthlyPrice: 2900,
|
|
68
|
+
annualPrice: 24900,
|
|
69
|
+
isPopular: true,
|
|
70
|
+
features: [
|
|
71
|
+
{ name: "Utilisateurs", included: true, value: "10" },
|
|
72
|
+
{ name: "Stockage", included: true, value: "100 GB" },
|
|
73
|
+
{ name: "Projets", included: true, value: "Illimité" },
|
|
74
|
+
{ name: "Support", included: true, value: "Prioritaire" },
|
|
75
|
+
{ name: "API Access", included: true },
|
|
76
|
+
{ name: "Analytics avancés", included: true },
|
|
77
|
+
{ name: "SSO", included: false },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "enterprise",
|
|
82
|
+
name: "Enterprise",
|
|
83
|
+
description: "Pour les grandes organisations",
|
|
84
|
+
monthlyPrice: null,
|
|
85
|
+
annualPrice: null,
|
|
86
|
+
customPriceLabel: "Sur devis",
|
|
87
|
+
features: [
|
|
88
|
+
{ name: "Utilisateurs", included: true, value: "Illimité" },
|
|
89
|
+
{ name: "Stockage", included: true, value: "Illimité" },
|
|
90
|
+
{ name: "Projets", included: true, value: "Illimité" },
|
|
91
|
+
{ name: "Support", included: true, value: "24/7 dédié" },
|
|
92
|
+
{ name: "API Access", included: true },
|
|
93
|
+
{ name: "Analytics avancés", included: true },
|
|
94
|
+
{ name: "SSO", included: true },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
export const Default: Story = {
|
|
100
|
+
args: {
|
|
101
|
+
tiers,
|
|
102
|
+
features,
|
|
103
|
+
billingPeriod: "monthly",
|
|
104
|
+
showToggle: true,
|
|
105
|
+
highlightPopular: true,
|
|
106
|
+
currency: "€",
|
|
107
|
+
},
|
|
108
|
+
render: (args) => <WakaPricingTable {...args} />,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const Annual: Story = {
|
|
112
|
+
args: {
|
|
113
|
+
tiers,
|
|
114
|
+
features,
|
|
115
|
+
billingPeriod: "annual",
|
|
116
|
+
showToggle: true,
|
|
117
|
+
highlightPopular: true,
|
|
118
|
+
currency: "€",
|
|
119
|
+
},
|
|
120
|
+
render: (args) => <WakaPricingTable {...args} />,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const WithoutToggle: Story = {
|
|
124
|
+
args: {
|
|
125
|
+
tiers,
|
|
126
|
+
features,
|
|
127
|
+
billingPeriod: "monthly",
|
|
128
|
+
showToggle: false,
|
|
129
|
+
currency: "€",
|
|
130
|
+
},
|
|
131
|
+
render: (args) => <WakaPricingTable {...args} />,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const TwoTiers: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
tiers: tiers.slice(0, 2),
|
|
137
|
+
features: features.slice(0, 5),
|
|
138
|
+
billingPeriod: "monthly",
|
|
139
|
+
showToggle: true,
|
|
140
|
+
currency: "€",
|
|
141
|
+
},
|
|
142
|
+
render: (args) => <WakaPricingTable {...args} />,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const USD: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
tiers: tiers.map(t => ({
|
|
148
|
+
...t,
|
|
149
|
+
monthlyPrice: t.monthlyPrice ? Math.round(t.monthlyPrice * 1.1) : null,
|
|
150
|
+
annualPrice: t.annualPrice ? Math.round(t.annualPrice * 1.1) : null,
|
|
151
|
+
})),
|
|
152
|
+
features,
|
|
153
|
+
billingPeriod: "monthly",
|
|
154
|
+
showToggle: true,
|
|
155
|
+
currency: "$",
|
|
156
|
+
},
|
|
157
|
+
render: (args) => <WakaPricingTable {...args} />,
|
|
158
|
+
}
|
|
159
|
+
|