@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,44 +1,54 @@
1
- import type { Meta, StoryObj } from '@storybook/react'
2
- import { WakaPasswordStrength, WakaPasswordStrengthIndicator } from './index'
3
- import * as React from 'react'
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaPasswordStrength } from "./index"
3
+ import { useState } from "react"
4
4
 
5
5
  const meta: Meta<typeof WakaPasswordStrength> = {
6
- title: 'Components/Forms/WakaPasswordStrength',
6
+ title: "Forms/WakaPasswordStrength",
7
7
  component: WakaPasswordStrength,
8
8
  parameters: {
9
- layout: 'centered',
10
- docs: {
11
- description: {
12
- component: 'A password strength indicator with animated bar, checklist, and configurable requirements.',
13
- },
14
- },
9
+ layout: "centered",
15
10
  },
16
- tags: ['autodocs'],
11
+ tags: ["autodocs"],
17
12
  argTypes: {
18
- size: {
19
- control: 'select',
20
- options: ['sm', 'default', 'lg'],
21
- description: 'Size of the component',
13
+ password: {
14
+ control: "text",
15
+ description: "Mot de passe à évaluer",
22
16
  },
23
17
  showInput: {
24
- control: 'boolean',
25
- description: 'Show password input',
18
+ control: "boolean",
19
+ description: "Afficher le champ de saisie",
26
20
  },
27
- showStrengthBar: {
28
- control: 'boolean',
29
- description: 'Show strength bar',
21
+ showRequirements: {
22
+ control: "boolean",
23
+ description: "Afficher les exigences",
30
24
  },
31
- showChecklist: {
32
- control: 'boolean',
33
- description: 'Show requirements checklist',
25
+ showStrengthBar: {
26
+ control: "boolean",
27
+ description: "Afficher la barre de force",
34
28
  },
35
29
  showStrengthLabel: {
36
- control: 'boolean',
37
- description: 'Show strength label',
30
+ control: "boolean",
31
+ description: "Afficher le label de force",
32
+ },
33
+ minLength: {
34
+ control: "number",
35
+ description: "Longueur minimale requise",
38
36
  },
39
- animated: {
40
- control: 'boolean',
41
- description: 'Enable animations',
37
+ requireUppercase: {
38
+ control: "boolean",
39
+ description: "Exiger une majuscule",
40
+ },
41
+ requireLowercase: {
42
+ control: "boolean",
43
+ description: "Exiger une minuscule",
44
+ },
45
+ requireNumber: {
46
+ control: "boolean",
47
+ description: "Exiger un chiffre",
48
+ },
49
+ requireSpecial: {
50
+ control: "boolean",
51
+ description: "Exiger un caractère spécial",
42
52
  },
43
53
  },
44
54
  }
@@ -47,272 +57,126 @@ export default meta
47
57
  type Story = StoryObj<typeof WakaPasswordStrength>
48
58
 
49
59
  export const Default: Story = {
50
- render: function PasswordStrengthDemo() {
51
- const [password, setPassword] = React.useState('')
52
-
53
- return (
54
- <div className="w-[350px]">
55
- <WakaPasswordStrength
56
- password={password}
57
- onPasswordChange={setPassword}
58
- label="Password"
59
- placeholder="Enter password"
60
- />
61
- </div>
62
- )
60
+ args: {
61
+ showInput: true,
62
+ showRequirements: true,
63
+ showStrengthBar: true,
64
+ showStrengthLabel: true,
65
+ minLength: 8,
66
+ requireUppercase: true,
67
+ requireLowercase: true,
68
+ requireNumber: true,
69
+ requireSpecial: true,
63
70
  },
71
+ render: (args) => (
72
+ <div style={{ width: 350 }}>
73
+ <WakaPasswordStrength {...args} />
74
+ </div>
75
+ ),
64
76
  }
65
77
 
66
- export const WithInitialValue: Story = {
67
- render: function InitialValueDemo() {
68
- const [password, setPassword] = React.useState('MyP@ssw0rd!')
69
-
70
- return (
71
- <div className="w-[350px]">
72
- <WakaPasswordStrength
73
- password={password}
74
- onPasswordChange={setPassword}
75
- label="Password"
76
- />
77
- </div>
78
- )
78
+ export const WeakPassword: Story = {
79
+ args: {
80
+ password: "abc",
81
+ showInput: false,
82
+ showRequirements: true,
83
+ showStrengthBar: true,
84
+ showStrengthLabel: true,
79
85
  },
86
+ render: (args) => (
87
+ <div style={{ width: 350 }}>
88
+ <WakaPasswordStrength {...args} />
89
+ </div>
90
+ ),
80
91
  }
81
92
 
82
- export const BarOnly: Story = {
83
- render: function BarOnlyDemo() {
84
- const [password, setPassword] = React.useState('')
85
-
86
- return (
87
- <div className="w-[350px]">
88
- <WakaPasswordStrength
89
- password={password}
90
- onPasswordChange={setPassword}
91
- label="Password"
92
- showChecklist={false}
93
- />
94
- </div>
95
- )
93
+ export const FairPassword: Story = {
94
+ args: {
95
+ password: "Password1",
96
+ showInput: false,
97
+ showRequirements: true,
98
+ showStrengthBar: true,
99
+ showStrengthLabel: true,
96
100
  },
97
- }
98
-
99
- export const ChecklistOnly: Story = {
100
- render: function ChecklistOnlyDemo() {
101
- const [password, setPassword] = React.useState('')
102
-
103
- return (
104
- <div className="w-[350px]">
105
- <WakaPasswordStrength
106
- password={password}
107
- onPasswordChange={setPassword}
108
- label="Password"
109
- showStrengthBar={false}
110
- />
101
+ render: (args) => (
102
+ <div style={{ width: 350 }}>
103
+ <WakaPasswordStrength {...args} />
111
104
  </div>
112
- )
113
- },
105
+ ),
114
106
  }
115
107
 
116
- export const CustomRequirements: Story = {
117
- render: function CustomRequirementsDemo() {
118
- const [password, setPassword] = React.useState('')
119
-
120
- return (
121
- <div className="w-[350px]">
122
- <WakaPasswordStrength
123
- password={password}
124
- onPasswordChange={setPassword}
125
- label="Password"
126
- minLength={10}
127
- requireUppercase
128
- requireLowercase
129
- requireNumber
130
- requireSpecialChar={false}
131
- customRequirements={[
132
- {
133
- key: 'noSpaces',
134
- label: 'No spaces allowed',
135
- validate: (p) => !p.includes(' '),
136
- required: true,
137
- },
138
- ]}
139
- />
140
- </div>
141
- )
108
+ export const GoodPassword: Story = {
109
+ args: {
110
+ password: "Password123!",
111
+ showInput: false,
112
+ showRequirements: true,
113
+ showStrengthBar: true,
114
+ showStrengthLabel: true,
142
115
  },
143
- }
144
-
145
- export const Sizes: Story = {
146
- render: function SizesDemo() {
147
- const [password, setPassword] = React.useState('Test123!')
148
-
149
- return (
150
- <div className="space-y-8 w-[350px]">
151
- <div>
152
- <p className="text-sm text-muted-foreground mb-2">Small</p>
153
- <WakaPasswordStrength
154
- password={password}
155
- onPasswordChange={setPassword}
156
- size="sm"
157
- />
116
+ render: (args) => (
117
+ <div style={{ width: 350 }}>
118
+ <WakaPasswordStrength {...args} />
158
119
  </div>
159
- <div>
160
- <p className="text-sm text-muted-foreground mb-2">Default</p>
161
- <WakaPasswordStrength
162
- password={password}
163
- onPasswordChange={setPassword}
164
- size="default"
165
- />
166
- </div>
167
- <div>
168
- <p className="text-sm text-muted-foreground mb-2">Large</p>
169
- <WakaPasswordStrength
170
- password={password}
171
- onPasswordChange={setPassword}
172
- size="lg"
173
- />
174
- </div>
175
- </div>
176
- )
177
- },
120
+ ),
178
121
  }
179
122
 
180
- export const WithError: Story = {
181
- render: function ErrorDemo() {
182
- const [password, setPassword] = React.useState('weak')
183
-
184
- return (
185
- <div className="w-[350px]">
186
- <WakaPasswordStrength
187
- password={password}
188
- onPasswordChange={setPassword}
189
- label="Password"
190
- error="Password does not meet requirements"
191
- />
192
- </div>
193
- )
123
+ export const StrongPassword: Story = {
124
+ args: {
125
+ password: "MyStr0ng!P@ssword2024",
126
+ showInput: false,
127
+ showRequirements: true,
128
+ showStrengthBar: true,
129
+ showStrengthLabel: true,
194
130
  },
195
- }
196
-
197
- export const Disabled: Story = {
198
- render: () => (
199
- <div className="w-[350px]">
200
- <WakaPasswordStrength
201
- password="SecureP@ss123"
202
- label="Password"
203
- disabled
204
- />
131
+ render: (args) => (
132
+ <div style={{ width: 350 }}>
133
+ <WakaPasswordStrength {...args} />
205
134
  </div>
206
135
  ),
207
136
  }
208
137
 
209
- export const NoAnimation: Story = {
210
- render: function NoAnimationDemo() {
211
- const [password, setPassword] = React.useState('')
212
-
213
- return (
214
- <div className="w-[350px]">
215
- <WakaPasswordStrength
216
- password={password}
217
- onPasswordChange={setPassword}
218
- label="Password"
219
- animated={false}
220
- />
221
- </div>
222
- )
138
+ export const BarOnly: Story = {
139
+ args: {
140
+ showInput: true,
141
+ showRequirements: false,
142
+ showStrengthBar: true,
143
+ showStrengthLabel: true,
223
144
  },
145
+ render: (args) => (
146
+ <div style={{ width: 350 }}>
147
+ <WakaPasswordStrength {...args} />
148
+ </div>
149
+ ),
224
150
  }
225
151
 
226
- export const IndicatorOnly: Story = {
227
- render: function IndicatorOnlyDemo() {
228
- const [password, setPassword] = React.useState('')
229
-
230
- return (
231
- <div className="w-[350px] space-y-4">
232
- <div>
233
- <label className="text-sm font-medium">Password</label>
234
- <input
235
- type="password"
236
- value={password}
237
- onChange={(e) => setPassword(e.target.value)}
238
- className="w-full mt-1 px-3 py-2 border rounded-md"
239
- placeholder="Enter password"
240
- />
241
- </div>
242
- <WakaPasswordStrengthIndicator password={password} />
243
- </div>
244
- )
152
+ export const RequirementsOnly: Story = {
153
+ args: {
154
+ showInput: true,
155
+ showRequirements: true,
156
+ showStrengthBar: false,
157
+ showStrengthLabel: false,
245
158
  },
246
- }
247
-
248
- export const StrengthLevels: Story = {
249
- render: () => (
250
- <div className="w-[350px] space-y-6">
251
- <div>
252
- <p className="text-sm text-muted-foreground mb-2">Weak</p>
253
- <WakaPasswordStrength password="abc" showInput={false} showChecklist={false} />
254
- </div>
255
- <div>
256
- <p className="text-sm text-muted-foreground mb-2">Fair</p>
257
- <WakaPasswordStrength password="abc12345" showInput={false} showChecklist={false} />
258
- </div>
259
- <div>
260
- <p className="text-sm text-muted-foreground mb-2">Good</p>
261
- <WakaPasswordStrength password="Abc12345" showInput={false} showChecklist={false} />
262
- </div>
263
- <div>
264
- <p className="text-sm text-muted-foreground mb-2">Strong</p>
265
- <WakaPasswordStrength password="Abc12345!" showInput={false} showChecklist={false} />
266
- </div>
267
- <div>
268
- <p className="text-sm text-muted-foreground mb-2">Very Strong</p>
269
- <WakaPasswordStrength password="Abc12345!@#$XYZ" showInput={false} showChecklist={false} />
270
- </div>
159
+ render: (args) => (
160
+ <div style={{ width: 350 }}>
161
+ <WakaPasswordStrength {...args} />
271
162
  </div>
272
163
  ),
273
164
  }
274
165
 
275
- export const RegistrationForm: Story = {
276
- render: function RegistrationDemo() {
277
- const [password, setPassword] = React.useState('')
278
- const [confirmPassword, setConfirmPassword] = React.useState('')
279
- const [isValid, setIsValid] = React.useState(false)
280
-
281
- return (
282
- <div className="w-[400px] space-y-6 p-6 border rounded-lg">
283
- <div>
284
- <h3 className="font-semibold">Create Account</h3>
285
- <p className="text-sm text-muted-foreground">Choose a strong password</p>
286
- </div>
287
-
288
- <WakaPasswordStrength
289
- password={password}
290
- onPasswordChange={setPassword}
291
- label="Password"
292
- onStrengthChange={(result) => setIsValid(result.isValid)}
293
- />
294
-
295
- <div className="space-y-2">
296
- <label className="text-sm font-medium">Confirm Password</label>
297
- <input
298
- type="password"
299
- value={confirmPassword}
300
- onChange={(e) => setConfirmPassword(e.target.value)}
301
- className="w-full px-3 py-2 border rounded-md"
302
- placeholder="Confirm password"
303
- />
304
- {confirmPassword && password !== confirmPassword && (
305
- <p className="text-sm text-destructive">Passwords do not match</p>
306
- )}
307
- </div>
308
-
309
- <button
310
- className="w-full py-2 px-4 bg-primary text-primary-foreground rounded-md disabled:opacity-50"
311
- disabled={!isValid || password !== confirmPassword}
312
- >
313
- Create Account
314
- </button>
315
- </div>
316
- )
166
+ export const SimpleRequirements: Story = {
167
+ args: {
168
+ showInput: true,
169
+ showRequirements: true,
170
+ showStrengthBar: true,
171
+ minLength: 6,
172
+ requireUppercase: false,
173
+ requireLowercase: true,
174
+ requireNumber: true,
175
+ requireSpecial: false,
317
176
  },
177
+ render: (args) => (
178
+ <div style={{ width: 350 }}>
179
+ <WakaPasswordStrength {...args} />
180
+ </div>
181
+ ),
318
182
  }
@@ -0,0 +1,141 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaPaymentMethodPicker } from "./index"
3
+ import { useState } from "react"
4
+
5
+ const meta: Meta<typeof WakaPaymentMethodPicker> = {
6
+ title: "E-commerce/WakaPaymentMethodPicker",
7
+ component: WakaPaymentMethodPicker,
8
+ parameters: {
9
+ layout: "centered",
10
+ },
11
+ tags: ["autodocs"],
12
+ argTypes: {
13
+ showAddNew: {
14
+ control: "boolean",
15
+ description: "Afficher le bouton ajouter",
16
+ },
17
+ showDelete: {
18
+ control: "boolean",
19
+ description: "Afficher le bouton supprimer",
20
+ },
21
+ disabled: {
22
+ control: "boolean",
23
+ description: "État désactivé",
24
+ },
25
+ orientation: {
26
+ control: "select",
27
+ options: ["vertical", "horizontal"],
28
+ description: "Orientation des cartes",
29
+ },
30
+ },
31
+ }
32
+
33
+ export default meta
34
+ type Story = StoryObj<typeof WakaPaymentMethodPicker>
35
+
36
+ const paymentMethods = [
37
+ {
38
+ id: "1",
39
+ type: "card" as const,
40
+ brand: "visa" as const,
41
+ last4: "4242",
42
+ expiryMonth: 12,
43
+ expiryYear: 2025,
44
+ isDefault: true,
45
+ },
46
+ {
47
+ id: "2",
48
+ type: "card" as const,
49
+ brand: "mastercard" as const,
50
+ last4: "8888",
51
+ expiryMonth: 6,
52
+ expiryYear: 2026,
53
+ isDefault: false,
54
+ },
55
+ {
56
+ id: "3",
57
+ type: "bank" as const,
58
+ bankName: "BNP Paribas",
59
+ last4: "1234",
60
+ isDefault: false,
61
+ },
62
+ ]
63
+
64
+ export const Default: Story = {
65
+ args: {
66
+ methods: paymentMethods,
67
+ selectedId: "1",
68
+ showAddNew: true,
69
+ showDelete: true,
70
+ orientation: "vertical",
71
+ },
72
+ render: (args) => (
73
+ <div style={{ width: 400 }}>
74
+ <WakaPaymentMethodPicker {...args} />
75
+ </div>
76
+ ),
77
+ }
78
+
79
+ export const Horizontal: Story = {
80
+ args: {
81
+ methods: paymentMethods,
82
+ selectedId: "1",
83
+ showAddNew: true,
84
+ orientation: "horizontal",
85
+ },
86
+ render: (args) => <WakaPaymentMethodPicker {...args} />,
87
+ }
88
+
89
+ export const SingleCard: Story = {
90
+ args: {
91
+ methods: [paymentMethods[0]],
92
+ selectedId: "1",
93
+ showAddNew: true,
94
+ showDelete: false,
95
+ },
96
+ render: (args) => (
97
+ <div style={{ width: 400 }}>
98
+ <WakaPaymentMethodPicker {...args} />
99
+ </div>
100
+ ),
101
+ }
102
+
103
+ export const Empty: Story = {
104
+ args: {
105
+ methods: [],
106
+ showAddNew: true,
107
+ },
108
+ render: (args) => (
109
+ <div style={{ width: 400 }}>
110
+ <WakaPaymentMethodPicker {...args} />
111
+ </div>
112
+ ),
113
+ }
114
+
115
+ export const ReadOnly: Story = {
116
+ args: {
117
+ methods: paymentMethods,
118
+ selectedId: "1",
119
+ showAddNew: false,
120
+ showDelete: false,
121
+ },
122
+ render: (args) => (
123
+ <div style={{ width: 400 }}>
124
+ <WakaPaymentMethodPicker {...args} />
125
+ </div>
126
+ ),
127
+ }
128
+
129
+ export const Disabled: Story = {
130
+ args: {
131
+ methods: paymentMethods,
132
+ selectedId: "1",
133
+ disabled: true,
134
+ },
135
+ render: (args) => (
136
+ <div style={{ width: 400 }}>
137
+ <WakaPaymentMethodPicker {...args} />
138
+ </div>
139
+ ),
140
+ }
141
+