@wakastellar/ui 2.4.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
- package/dist/blocks/clamav-service-status/index.d.ts +35 -0
- package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
- package/dist/blocks/index.d.ts +18 -9
- package/dist/blocks/quarantine-manager/index.d.ts +27 -0
- package/dist/blocks/scan-history-log/index.d.ts +28 -0
- package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
- package/dist/blocks/scan-report-generator/index.d.ts +47 -0
- package/dist/blocks/signature-database-manager/index.d.ts +39 -0
- package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
- package/dist/components/index.d.ts +4 -4
- package/dist/components/waka-signature-pad/index.d.ts +1 -1
- package/dist/exceljs.min-BcLLX0PC.js +29 -0
- package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
- package/dist/export.cjs.js +1 -1
- package/dist/export.d.ts +2 -2
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +136 -136
- package/dist/index.es.js +29978 -27215
- package/dist/stories/Button.stories.d.ts +1 -1
- package/dist/stories/Header.stories.d.ts +1 -1
- package/dist/stories/Page.stories.d.ts +1 -1
- package/dist/useDataTableImport-COVnvslz.js +9 -0
- package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/package.json +6 -5
- package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
- package/src/blocks/antivirus-dashboard/index.tsx +525 -0
- package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
- package/src/blocks/clamav-service-status/index.tsx +370 -0
- package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
- package/src/blocks/file-scan-uploader/index.tsx +311 -0
- package/src/blocks/index.ts +163 -11
- package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
- package/src/blocks/quarantine-manager/index.tsx +435 -0
- package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
- package/src/blocks/scan-history-log/index.tsx +406 -0
- package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
- package/src/blocks/scan-policy-editor/index.tsx +418 -0
- package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
- package/src/blocks/scan-report-generator/index.tsx +612 -0
- package/src/blocks/sidebar/index.tsx +2 -1
- package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
- package/src/blocks/signature-database-manager/index.tsx +470 -0
- package/src/blocks/theme-creator-block/index.tsx +16 -2
- package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
- package/src/blocks/threat-alert-banner/index.tsx +320 -0
- package/src/components/DataTable/DataTable.stories.tsx +203 -0
- package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
- package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
- package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
- package/src/components/index.ts +45 -4
- package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
- package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
- package/src/components/toaster/Toaster.stories.tsx +67 -0
- package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
- package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
- package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
- package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
- package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
- package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
- package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
- package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
- package/src/components/waka-ad-sidebar/index.tsx +3 -2
- package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
- package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
- package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
- package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
- package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
- package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
- package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
- package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
- package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
- package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
- package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
- package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
- package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
- package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
- package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
- package/src/components/waka-cart-summary/index.tsx +19 -10
- package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
- package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
- package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
- package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
- package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
- package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
- package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
- package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
- package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
- package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
- package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
- package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
- package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
- package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
- package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
- package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
- package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
- package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
- package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
- package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
- package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
- package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
- package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
- package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
- package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
- package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
- package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
- package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
- package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
- package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
- package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
- package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
- package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
- package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
- package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
- package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
- package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
- package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
- package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
- package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
- package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
- package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
- package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
- package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
- package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
- package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
- package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
- package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
- package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
- package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
- package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
- package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
- package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
- package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
- package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
- package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
- package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
- package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
- package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
- package/src/components/waka-signature-pad/index.tsx +5 -3
- package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
- package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
- package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
- package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
- package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
- package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
- package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
- package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
- package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
- package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
- package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
- package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
- package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
- package/src/components/waka-theme-manager/index.tsx +6 -11
- package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
- package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
- package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
- package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
- package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
- package/src/components/waka-treemap-chart/index.tsx +2 -2
- package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
- package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
- package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
- package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
- package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
- package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
- package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
- package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
- package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
- package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
- package/src/components/DataTable/README.md +0 -446
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { WakaPasswordStrength
|
|
3
|
-
import
|
|
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:
|
|
6
|
+
title: "Forms/WakaPasswordStrength",
|
|
7
7
|
component: WakaPasswordStrength,
|
|
8
8
|
parameters: {
|
|
9
|
-
layout:
|
|
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: [
|
|
11
|
+
tags: ["autodocs"],
|
|
17
12
|
argTypes: {
|
|
18
|
-
|
|
19
|
-
control:
|
|
20
|
-
|
|
21
|
-
description: 'Size of the component',
|
|
13
|
+
password: {
|
|
14
|
+
control: "text",
|
|
15
|
+
description: "Mot de passe à évaluer",
|
|
22
16
|
},
|
|
23
17
|
showInput: {
|
|
24
|
-
control:
|
|
25
|
-
description:
|
|
18
|
+
control: "boolean",
|
|
19
|
+
description: "Afficher le champ de saisie",
|
|
26
20
|
},
|
|
27
|
-
|
|
28
|
-
control:
|
|
29
|
-
description:
|
|
21
|
+
showRequirements: {
|
|
22
|
+
control: "boolean",
|
|
23
|
+
description: "Afficher les exigences",
|
|
30
24
|
},
|
|
31
|
-
|
|
32
|
-
control:
|
|
33
|
-
description:
|
|
25
|
+
showStrengthBar: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
description: "Afficher la barre de force",
|
|
34
28
|
},
|
|
35
29
|
showStrengthLabel: {
|
|
36
|
-
control:
|
|
37
|
-
description:
|
|
30
|
+
control: "boolean",
|
|
31
|
+
description: "Afficher le label de force",
|
|
32
|
+
},
|
|
33
|
+
minLength: {
|
|
34
|
+
control: "number",
|
|
35
|
+
description: "Longueur minimale requise",
|
|
38
36
|
},
|
|
39
|
-
|
|
40
|
-
control:
|
|
41
|
-
description:
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
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
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
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
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
+
|