@wakastellar/ui 2.4.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
  2. package/dist/blocks/clamav-service-status/index.d.ts +35 -0
  3. package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
  4. package/dist/blocks/index.d.ts +18 -9
  5. package/dist/blocks/quarantine-manager/index.d.ts +27 -0
  6. package/dist/blocks/scan-history-log/index.d.ts +28 -0
  7. package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
  8. package/dist/blocks/scan-report-generator/index.d.ts +47 -0
  9. package/dist/blocks/signature-database-manager/index.d.ts +39 -0
  10. package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
  11. package/dist/components/index.d.ts +4 -4
  12. package/dist/components/waka-signature-pad/index.d.ts +1 -1
  13. package/dist/exceljs.min-BcLLX0PC.js +29 -0
  14. package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
  15. package/dist/export.cjs.js +1 -1
  16. package/dist/export.d.ts +2 -2
  17. package/dist/export.es.js +1 -1
  18. package/dist/index.cjs.js +136 -136
  19. package/dist/index.es.js +29978 -27215
  20. package/dist/stories/Button.stories.d.ts +1 -1
  21. package/dist/stories/Header.stories.d.ts +1 -1
  22. package/dist/stories/Page.stories.d.ts +1 -1
  23. package/dist/useDataTableImport-COVnvslz.js +9 -0
  24. package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
  25. package/dist/utils/index.d.ts +1 -0
  26. package/dist/utils/logger.d.ts +9 -0
  27. package/package.json +6 -5
  28. package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
  29. package/src/blocks/antivirus-dashboard/index.tsx +525 -0
  30. package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
  31. package/src/blocks/clamav-service-status/index.tsx +370 -0
  32. package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
  33. package/src/blocks/file-scan-uploader/index.tsx +311 -0
  34. package/src/blocks/index.ts +163 -11
  35. package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
  36. package/src/blocks/quarantine-manager/index.tsx +435 -0
  37. package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
  38. package/src/blocks/scan-history-log/index.tsx +406 -0
  39. package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
  40. package/src/blocks/scan-policy-editor/index.tsx +418 -0
  41. package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
  42. package/src/blocks/scan-report-generator/index.tsx +612 -0
  43. package/src/blocks/sidebar/index.tsx +2 -1
  44. package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
  45. package/src/blocks/signature-database-manager/index.tsx +470 -0
  46. package/src/blocks/theme-creator-block/index.tsx +16 -2
  47. package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
  48. package/src/blocks/threat-alert-banner/index.tsx +320 -0
  49. package/src/components/DataTable/DataTable.stories.tsx +203 -0
  50. package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
  51. package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
  52. package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
  53. package/src/components/index.ts +45 -4
  54. package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
  55. package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
  56. package/src/components/toaster/Toaster.stories.tsx +67 -0
  57. package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
  58. package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
  59. package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
  60. package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
  61. package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
  62. package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
  63. package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
  64. package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
  65. package/src/components/waka-ad-sidebar/index.tsx +3 -2
  66. package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
  67. package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
  68. package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
  69. package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
  70. package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
  71. package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
  72. package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
  73. package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
  74. package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
  75. package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
  76. package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
  77. package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
  78. package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
  79. package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
  80. package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
  81. package/src/components/waka-cart-summary/index.tsx +19 -10
  82. package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
  83. package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
  84. package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
  85. package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
  86. package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
  87. package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
  88. package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
  89. package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
  90. package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
  91. package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
  92. package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
  93. package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
  94. package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
  95. package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
  96. package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
  97. package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
  98. package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
  99. package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
  100. package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
  101. package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
  102. package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
  103. package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
  104. package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
  105. package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
  106. package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
  107. package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
  108. package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
  109. package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
  110. package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
  111. package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
  112. package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
  113. package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
  114. package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
  115. package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
  116. package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
  117. package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
  118. package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
  119. package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
  120. package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
  121. package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
  122. package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
  123. package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
  124. package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
  125. package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
  126. package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
  127. package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
  128. package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
  129. package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
  130. package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
  131. package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
  132. package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
  133. package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
  134. package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
  135. package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
  136. package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
  137. package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
  138. package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
  139. package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
  140. package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
  141. package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
  142. package/src/components/waka-signature-pad/index.tsx +5 -3
  143. package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
  144. package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
  145. package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
  146. package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
  147. package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
  148. package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
  149. package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
  150. package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
  151. package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
  152. package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
  153. package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
  154. package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
  155. package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
  156. package/src/components/waka-theme-manager/index.tsx +6 -11
  157. package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
  158. package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
  159. package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
  160. package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
  161. package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
  162. package/src/components/waka-treemap-chart/index.tsx +2 -2
  163. package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
  164. package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
  165. package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
  166. package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
  167. package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
  168. package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
  169. package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
  170. package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
  171. package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
  172. package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
  173. package/src/components/DataTable/README.md +0 -446
@@ -1,40 +1,46 @@
1
- import type { Meta, StoryObj } from '@storybook/react'
2
- import { WakaStepper, StepperNavigation } from './index'
3
- import type { Step } from './index'
4
- import * as React from 'react'
5
- import { User, CreditCard, CheckCircle, Package, Truck, MapPin } from 'lucide-react'
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaStepper, type Step } from "./index"
3
+ import { useState } from "react"
4
+ import { User, CreditCard, CheckCircle, Settings } from "lucide-react"
6
5
 
7
6
  const meta: Meta<typeof WakaStepper> = {
8
- title: 'Components/Display/WakaStepper',
7
+ title: "Forms/WakaStepper",
9
8
  component: WakaStepper,
10
9
  parameters: {
11
- layout: 'centered',
12
- docs: {
13
- description: {
14
- component: 'A step wizard component for multi-step forms and processes with progress tracking.',
15
- },
16
- },
10
+ layout: "padded",
17
11
  },
18
- tags: ['autodocs'],
12
+ tags: ["autodocs"],
19
13
  argTypes: {
14
+ currentStep: {
15
+ control: { type: "number", min: 0, max: 4 },
16
+ description: "Index de l'étape courante",
17
+ },
20
18
  orientation: {
21
- control: 'select',
22
- options: ['horizontal', 'vertical'],
23
- description: 'Stepper orientation',
19
+ control: "select",
20
+ options: ["horizontal", "vertical"],
21
+ description: "Orientation du stepper",
24
22
  },
25
23
  variant: {
26
- control: 'select',
27
- options: ['default', 'simple', 'numbered'],
28
- description: 'Visual variant',
24
+ control: "select",
25
+ options: ["default", "simple", "numbered"],
26
+ description: "Variante visuelle",
29
27
  },
30
28
  size: {
31
- control: 'select',
32
- options: ['sm', 'md', 'lg'],
33
- description: 'Size of the stepper',
29
+ control: "select",
30
+ options: ["sm", "md", "lg"],
31
+ description: "Taille du stepper",
34
32
  },
35
33
  clickable: {
36
- control: 'boolean',
37
- description: 'Allow clicking on steps',
34
+ control: "boolean",
35
+ description: "Navigation en cliquant sur les étapes",
36
+ },
37
+ allowPrevious: {
38
+ control: "boolean",
39
+ description: "Navigation vers les étapes précédentes uniquement",
40
+ },
41
+ showContent: {
42
+ control: "boolean",
43
+ description: "Afficher le contenu de l'étape",
38
44
  },
39
45
  },
40
46
  }
@@ -43,426 +49,147 @@ export default meta
43
49
  type Story = StoryObj<typeof WakaStepper>
44
50
 
45
51
  const basicSteps: Step[] = [
46
- {
47
- id: 'step-1',
48
- title: 'Account',
49
- description: 'Create your account',
50
- },
51
- {
52
- id: 'step-2',
53
- title: 'Profile',
54
- description: 'Set up your profile',
55
- },
56
- {
57
- id: 'step-3',
58
- title: 'Preferences',
59
- description: 'Configure settings',
60
- },
61
- {
62
- id: 'step-4',
63
- title: 'Complete',
64
- description: 'Review and finish',
52
+ { id: "1", title: "Informations personnelles", description: "Renseignez vos coordonnées" },
53
+ { id: "2", title: "Adresse", description: "Adresse de livraison" },
54
+ { id: "3", title: "Paiement", description: "Choisissez votre mode de paiement" },
55
+ { id: "4", title: "Confirmation", description: "Vérifiez et validez" },
56
+ ]
57
+
58
+ const stepsWithIcons: Step[] = [
59
+ { id: "1", title: "Compte", description: "Créez votre compte", icon: <User className="tw-h-4 tw-w-4" /> },
60
+ { id: "2", title: "Paramètres", description: "Configurez vos préférences", icon: <Settings className="tw-h-4 tw-w-4" /> },
61
+ { id: "3", title: "Paiement", description: "Ajoutez un moyen de paiement", icon: <CreditCard className="tw-h-4 tw-w-4" /> },
62
+ { id: "4", title: "Terminé", description: "Tout est prêt", icon: <CheckCircle className="tw-h-4 tw-w-4" /> },
63
+ ]
64
+
65
+ const stepsWithContent: Step[] = [
66
+ {
67
+ id: "1",
68
+ title: "Étape 1",
69
+ description: "Première étape",
70
+ content: <div className="tw-p-4 tw-bg-muted tw-rounded-lg">Contenu de l'étape 1</div>
71
+ },
72
+ {
73
+ id: "2",
74
+ title: "Étape 2",
75
+ description: "Deuxième étape",
76
+ content: <div className="tw-p-4 tw-bg-muted tw-rounded-lg">Contenu de l'étape 2</div>
77
+ },
78
+ {
79
+ id: "3",
80
+ title: "Étape 3",
81
+ description: "Troisième étape",
82
+ content: <div className="tw-p-4 tw-bg-muted tw-rounded-lg">Contenu de l'étape 3</div>
65
83
  },
66
84
  ]
67
85
 
68
86
  export const Default: Story = {
69
87
  args: {
70
88
  steps: basicSteps,
89
+ currentStep: 1,
90
+ orientation: "horizontal",
91
+ variant: "default",
92
+ size: "md",
93
+ clickable: false,
71
94
  },
72
- render: (args) => {
73
- const [currentStep, setCurrentStep] = React.useState(1)
74
- return (
75
- <div className="w-[700px]">
76
- <WakaStepper
77
- {...args}
78
- currentStep={currentStep}
79
- onStepChange={setCurrentStep}
80
- />
81
- <div className="mt-8 flex justify-between">
82
- <button
83
- onClick={() => setCurrentStep(Math.max(0, currentStep - 1))}
84
- disabled={currentStep === 0}
85
- className="px-4 py-2 border rounded disabled:opacity-50"
86
- >
87
- Previous
88
- </button>
89
- <button
90
- onClick={() => setCurrentStep(Math.min(basicSteps.length - 1, currentStep + 1))}
91
- disabled={currentStep === basicSteps.length - 1}
92
- className="px-4 py-2 bg-primary text-primary-foreground rounded disabled:opacity-50"
93
- >
94
- Next
95
- </button>
96
- </div>
97
- </div>
98
- )
99
- },
95
+ render: (args) => <WakaStepper {...args} />,
100
96
  }
101
97
 
102
98
  export const Vertical: Story = {
103
- render: () => {
104
- const [currentStep, setCurrentStep] = React.useState(1)
105
- return (
106
- <div className="w-[400px]">
107
- <WakaStepper
108
- steps={basicSteps}
109
- currentStep={currentStep}
110
- onStepChange={setCurrentStep}
111
- orientation="vertical"
112
- clickable
113
- allowPrevious
114
- />
115
- </div>
116
- )
117
- },
99
+ args: {
100
+ steps: basicSteps,
101
+ currentStep: 2,
102
+ orientation: "vertical",
103
+ variant: "default",
104
+ size: "md",
105
+ },
106
+ render: (args) => (
107
+ <div style={{ maxHeight: 400 }}>
108
+ <WakaStepper {...args} />
109
+ </div>
110
+ ),
118
111
  }
119
112
 
120
- export const Variants: Story = {
121
- render: () => {
122
- const [currentStep, setCurrentStep] = React.useState(1)
123
- return (
124
- <div className="space-y-12 w-[700px]">
125
- <div>
126
- <p className="text-sm text-muted-foreground mb-4">Default (Numbered)</p>
127
- <WakaStepper
128
- steps={basicSteps}
129
- currentStep={currentStep}
130
- variant="default"
131
- />
132
- </div>
133
- <div>
134
- <p className="text-sm text-muted-foreground mb-4">Simple (Dots)</p>
135
- <WakaStepper
136
- steps={basicSteps}
137
- currentStep={currentStep}
138
- variant="simple"
139
- />
140
- </div>
141
- <div>
142
- <p className="text-sm text-muted-foreground mb-4">Numbered</p>
143
- <WakaStepper
144
- steps={basicSteps}
145
- currentStep={currentStep}
146
- variant="numbered"
147
- />
148
- </div>
149
- </div>
150
- )
113
+ export const WithIcons: Story = {
114
+ args: {
115
+ steps: stepsWithIcons,
116
+ currentStep: 1,
117
+ orientation: "horizontal",
118
+ variant: "default",
151
119
  },
120
+ render: (args) => <WakaStepper {...args} />,
152
121
  }
153
122
 
154
- export const Sizes: Story = {
155
- render: () => {
156
- const [currentStep, setCurrentStep] = React.useState(1)
157
- return (
158
- <div className="space-y-12 w-[700px]">
159
- <div>
160
- <p className="text-sm text-muted-foreground mb-4">Small</p>
161
- <WakaStepper
162
- steps={basicSteps}
163
- currentStep={currentStep}
164
- size="sm"
165
- />
166
- </div>
167
- <div>
168
- <p className="text-sm text-muted-foreground mb-4">Medium</p>
169
- <WakaStepper
170
- steps={basicSteps}
171
- currentStep={currentStep}
172
- size="md"
173
- />
174
- </div>
175
- <div>
176
- <p className="text-sm text-muted-foreground mb-4">Large</p>
177
- <WakaStepper
178
- steps={basicSteps}
179
- currentStep={currentStep}
180
- size="lg"
181
- />
182
- </div>
183
- </div>
184
- )
123
+ export const Numbered: Story = {
124
+ args: {
125
+ steps: basicSteps,
126
+ currentStep: 0,
127
+ orientation: "horizontal",
128
+ variant: "numbered",
185
129
  },
130
+ render: (args) => <WakaStepper {...args} />,
186
131
  }
187
132
 
188
- export const WithIcons: Story = {
189
- render: () => {
190
- const stepsWithIcons: Step[] = [
191
- {
192
- id: 'account',
193
- title: 'Account',
194
- description: 'Create account',
195
- icon: <User className="h-4 w-4" />,
196
- },
197
- {
198
- id: 'payment',
199
- title: 'Payment',
200
- description: 'Add payment method',
201
- icon: <CreditCard className="h-4 w-4" />,
202
- },
203
- {
204
- id: 'confirm',
205
- title: 'Confirm',
206
- description: 'Review order',
207
- icon: <CheckCircle className="h-4 w-4" />,
208
- },
209
- ]
210
-
211
- const [currentStep, setCurrentStep] = React.useState(1)
212
- return (
213
- <div className="w-[600px]">
214
- <WakaStepper
215
- steps={stepsWithIcons}
216
- currentStep={currentStep}
217
- onStepChange={setCurrentStep}
218
- />
219
- </div>
220
- )
133
+ export const SimpleVariant: Story = {
134
+ args: {
135
+ steps: basicSteps,
136
+ currentStep: 2,
137
+ orientation: "horizontal",
138
+ variant: "simple",
221
139
  },
140
+ render: (args) => <WakaStepper {...args} />,
222
141
  }
223
142
 
224
143
  export const Clickable: Story = {
225
- render: () => {
226
- const [currentStep, setCurrentStep] = React.useState(2)
227
- return (
228
- <div className="w-[700px]">
229
- <p className="text-sm text-muted-foreground mb-4">Click on any completed step to navigate</p>
230
- <WakaStepper
231
- steps={basicSteps}
232
- currentStep={currentStep}
233
- onStepChange={setCurrentStep}
234
- clickable
235
- allowPrevious
236
- />
237
- </div>
238
- )
144
+ args: {
145
+ steps: basicSteps,
146
+ currentStep: 1,
147
+ orientation: "horizontal",
148
+ variant: "default",
149
+ clickable: true,
239
150
  },
151
+ render: (args) => <WakaStepper {...args} />,
240
152
  }
241
153
 
242
154
  export const WithContent: Story = {
243
- render: () => {
244
- const stepsWithContent: Step[] = [
245
- {
246
- id: 'step-1',
247
- title: 'Personal Info',
248
- description: 'Enter your details',
249
- content: (
250
- <div className="space-y-4">
251
- <div>
252
- <label className="text-sm font-medium">Name</label>
253
- <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="John Doe" />
254
- </div>
255
- <div>
256
- <label className="text-sm font-medium">Email</label>
257
- <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="john@example.com" />
258
- </div>
259
- </div>
260
- ),
261
- },
262
- {
263
- id: 'step-2',
264
- title: 'Address',
265
- description: 'Shipping address',
266
- content: (
267
- <div className="space-y-4">
268
- <div>
269
- <label className="text-sm font-medium">Street</label>
270
- <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="123 Main St" />
271
- </div>
272
- <div className="grid grid-cols-2 gap-4">
273
- <div>
274
- <label className="text-sm font-medium">City</label>
275
- <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="City" />
276
- </div>
277
- <div>
278
- <label className="text-sm font-medium">ZIP</label>
279
- <input className="w-full mt-1 px-3 py-2 border rounded-md" placeholder="12345" />
280
- </div>
281
- </div>
282
- </div>
283
- ),
284
- },
285
- {
286
- id: 'step-3',
287
- title: 'Review',
288
- description: 'Confirm details',
289
- content: (
290
- <div className="text-center py-8">
291
- <CheckCircle className="h-12 w-12 text-green-500 mx-auto mb-4" />
292
- <h3 className="font-semibold">All set!</h3>
293
- <p className="text-muted-foreground">Review your information and submit.</p>
294
- </div>
295
- ),
296
- },
297
- ]
298
-
299
- const [currentStep, setCurrentStep] = React.useState(0)
300
- return (
301
- <div className="w-[600px]">
302
- <WakaStepper
303
- steps={stepsWithContent}
304
- currentStep={currentStep}
305
- onStepChange={setCurrentStep}
306
- showContent
307
- />
308
- <StepperNavigation
309
- onFinish={currentStep === stepsWithContent.length - 1 ? () => alert('Submitted!') : undefined}
310
- finishLabel="Submit"
311
- />
312
- </div>
313
- )
155
+ args: {
156
+ steps: stepsWithContent,
157
+ currentStep: 1,
158
+ orientation: "horizontal",
159
+ variant: "default",
160
+ showContent: true,
314
161
  },
162
+ render: (args) => <WakaStepper {...args} />,
315
163
  }
316
164
 
317
- export const OrderTracking: Story = {
318
- render: () => {
319
- const orderSteps: Step[] = [
320
- {
321
- id: 'ordered',
322
- title: 'Order Placed',
323
- description: 'Jan 15, 2024',
324
- icon: <Package className="h-4 w-4" />,
325
- },
326
- {
327
- id: 'shipped',
328
- title: 'Shipped',
329
- description: 'Jan 16, 2024',
330
- icon: <Truck className="h-4 w-4" />,
331
- },
332
- {
333
- id: 'delivery',
334
- title: 'Out for Delivery',
335
- description: 'Jan 18, 2024',
336
- icon: <MapPin className="h-4 w-4" />,
337
- },
338
- {
339
- id: 'delivered',
340
- title: 'Delivered',
341
- description: 'Expected Jan 18',
342
- icon: <CheckCircle className="h-4 w-4" />,
343
- },
344
- ]
345
-
346
- return (
347
- <div className="border rounded-lg p-6 w-[700px]">
348
- <h3 className="font-semibold text-lg mb-6">Order #ORD-2024-001</h3>
349
- <WakaStepper
350
- steps={orderSteps}
351
- currentStep={2}
352
- />
353
- </div>
354
- )
165
+ export const SmallSize: Story = {
166
+ args: {
167
+ steps: basicSteps,
168
+ currentStep: 2,
169
+ orientation: "horizontal",
170
+ variant: "default",
171
+ size: "sm",
355
172
  },
173
+ render: (args) => <WakaStepper {...args} />,
356
174
  }
357
175
 
358
- export const VerticalWithContent: Story = {
359
- render: () => {
360
- const setupSteps: Step[] = [
361
- {
362
- id: 'connect',
363
- title: 'Connect Repository',
364
- description: 'Link your GitHub repo',
365
- content: (
366
- <button className="w-full py-2 border rounded-md hover:bg-muted">
367
- Connect GitHub
368
- </button>
369
- ),
370
- },
371
- {
372
- id: 'configure',
373
- title: 'Configure Build',
374
- description: 'Set build settings',
375
- content: (
376
- <div className="space-y-2">
377
- <input className="w-full px-3 py-2 border rounded-md" placeholder="Build command" />
378
- <input className="w-full px-3 py-2 border rounded-md" placeholder="Output directory" />
379
- </div>
380
- ),
381
- },
382
- {
383
- id: 'deploy',
384
- title: 'Deploy',
385
- description: 'Launch your project',
386
- content: (
387
- <button className="w-full py-2 bg-primary text-primary-foreground rounded-md">
388
- Deploy Now
389
- </button>
390
- ),
391
- },
392
- ]
393
-
394
- const [currentStep, setCurrentStep] = React.useState(1)
395
- return (
396
- <div className="w-[400px]">
397
- <WakaStepper
398
- steps={setupSteps}
399
- currentStep={currentStep}
400
- onStepChange={setCurrentStep}
401
- orientation="vertical"
402
- showContent
403
- clickable
404
- />
405
- </div>
406
- )
176
+ export const LargeSize: Story = {
177
+ args: {
178
+ steps: basicSteps,
179
+ currentStep: 1,
180
+ orientation: "horizontal",
181
+ variant: "default",
182
+ size: "lg",
407
183
  },
184
+ render: (args) => <WakaStepper {...args} />,
408
185
  }
409
186
 
410
- export const OptionalSteps: Story = {
411
- render: () => {
412
- const stepsWithOptional: Step[] = [
413
- {
414
- id: 'required-1',
415
- title: 'Basic Info',
416
- description: 'Required',
417
- },
418
- {
419
- id: 'optional-1',
420
- title: 'Additional Details',
421
- description: 'Optional step',
422
- optional: true,
423
- },
424
- {
425
- id: 'required-2',
426
- title: 'Confirmation',
427
- description: 'Required',
428
- },
429
- ]
430
-
431
- const [currentStep, setCurrentStep] = React.useState(0)
432
- return (
433
- <div className="w-[600px]">
434
- <WakaStepper
435
- steps={stepsWithOptional}
436
- currentStep={currentStep}
437
- onStepChange={setCurrentStep}
438
- />
439
- <div className="mt-8 flex justify-between">
440
- <button
441
- onClick={() => setCurrentStep(Math.max(0, currentStep - 1))}
442
- disabled={currentStep === 0}
443
- className="px-4 py-2 border rounded disabled:opacity-50"
444
- >
445
- Back
446
- </button>
447
- <div className="flex gap-2">
448
- {stepsWithOptional[currentStep]?.optional && (
449
- <button
450
- onClick={() => setCurrentStep(currentStep + 1)}
451
- className="px-4 py-2 border rounded"
452
- >
453
- Skip
454
- </button>
455
- )}
456
- <button
457
- onClick={() => setCurrentStep(currentStep + 1)}
458
- disabled={currentStep === stepsWithOptional.length - 1}
459
- className="px-4 py-2 bg-primary text-primary-foreground rounded disabled:opacity-50"
460
- >
461
- Continue
462
- </button>
463
- </div>
464
- </div>
465
- </div>
466
- )
187
+ export const AllCompleted: Story = {
188
+ args: {
189
+ steps: basicSteps,
190
+ currentStep: 4,
191
+ orientation: "horizontal",
192
+ variant: "default",
467
193
  },
194
+ render: (args) => <WakaStepper {...args} />,
468
195
  }
@@ -0,0 +1,51 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaSwipeCard } from "./index"
3
+
4
+ const meta: Meta<typeof WakaSwipeCard> = {
5
+ title: "UI/WakaSwipeCard",
6
+ component: WakaSwipeCard,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ showIndicators: { control: "boolean", description: "Indicateurs de swipe" },
11
+ swipeThreshold: { control: "number", description: "Seuil de swipe (px)" },
12
+ rotationFactor: { control: "number", description: "Facteur de rotation" },
13
+ },
14
+ }
15
+
16
+ export default meta
17
+ type Story = StoryObj<typeof WakaSwipeCard>
18
+
19
+ const cards = [
20
+ { id: "1", title: "Card 1", image: "https://picsum.photos/seed/card1/300/400" },
21
+ { id: "2", title: "Card 2", image: "https://picsum.photos/seed/card2/300/400" },
22
+ { id: "3", title: "Card 3", image: "https://picsum.photos/seed/card3/300/400" },
23
+ ]
24
+
25
+ export const Default: Story = {
26
+ args: { cards, showIndicators: true, swipeThreshold: 100 },
27
+ render: (args) => (
28
+ <div style={{ width: 350, height: 500 }}>
29
+ <WakaSwipeCard {...args} />
30
+ </div>
31
+ ),
32
+ }
33
+
34
+ export const NoIndicators: Story = {
35
+ args: { cards, showIndicators: false },
36
+ render: (args) => (
37
+ <div style={{ width: 350, height: 500 }}>
38
+ <WakaSwipeCard {...args} />
39
+ </div>
40
+ ),
41
+ }
42
+
43
+ export const HighThreshold: Story = {
44
+ args: { cards, showIndicators: true, swipeThreshold: 200 },
45
+ render: (args) => (
46
+ <div style={{ width: 350, height: 500 }}>
47
+ <WakaSwipeCard {...args} />
48
+ </div>
49
+ ),
50
+ }
51
+