@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,31 +1,50 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { WakaAutocomplete, type AutocompleteOption } from
|
|
3
|
-
import
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaAutocomplete, type AutocompleteOption } from "./index"
|
|
3
|
+
import { useState } from "react"
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof WakaAutocomplete> = {
|
|
6
|
-
title:
|
|
6
|
+
title: "Forms/WakaAutocomplete",
|
|
7
7
|
component: WakaAutocomplete,
|
|
8
8
|
parameters: {
|
|
9
|
-
layout:
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: 'An autocomplete component with async search, multi-select, and creatable options.',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
9
|
+
layout: "centered",
|
|
15
10
|
},
|
|
16
|
-
tags: [
|
|
11
|
+
tags: ["autodocs"],
|
|
17
12
|
argTypes: {
|
|
13
|
+
placeholder: {
|
|
14
|
+
control: "text",
|
|
15
|
+
description: "Texte placeholder",
|
|
16
|
+
},
|
|
18
17
|
multiple: {
|
|
19
|
-
control:
|
|
20
|
-
description:
|
|
18
|
+
control: "boolean",
|
|
19
|
+
description: "Mode sélection multiple",
|
|
21
20
|
},
|
|
22
21
|
creatable: {
|
|
23
|
-
control:
|
|
24
|
-
description:
|
|
22
|
+
control: "boolean",
|
|
23
|
+
description: "Permet de créer de nouvelles options",
|
|
24
|
+
},
|
|
25
|
+
loading: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
description: "État de chargement",
|
|
25
28
|
},
|
|
26
29
|
disabled: {
|
|
27
|
-
control:
|
|
28
|
-
description:
|
|
30
|
+
control: "boolean",
|
|
31
|
+
description: "État désactivé",
|
|
32
|
+
},
|
|
33
|
+
error: {
|
|
34
|
+
control: "text",
|
|
35
|
+
description: "Message d'erreur",
|
|
36
|
+
},
|
|
37
|
+
label: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description: "Label du champ",
|
|
40
|
+
},
|
|
41
|
+
description: {
|
|
42
|
+
control: "text",
|
|
43
|
+
description: "Description du champ",
|
|
44
|
+
},
|
|
45
|
+
emptyMessage: {
|
|
46
|
+
control: "text",
|
|
47
|
+
description: "Message quand aucun résultat",
|
|
29
48
|
},
|
|
30
49
|
},
|
|
31
50
|
}
|
|
@@ -33,192 +52,133 @@ const meta: Meta<typeof WakaAutocomplete> = {
|
|
|
33
52
|
export default meta
|
|
34
53
|
type Story = StoryObj<typeof WakaAutocomplete>
|
|
35
54
|
|
|
36
|
-
const
|
|
37
|
-
{ value:
|
|
38
|
-
{ value:
|
|
39
|
-
{ value:
|
|
40
|
-
{ value:
|
|
41
|
-
{ value:
|
|
42
|
-
{ value:
|
|
43
|
-
{ value:
|
|
44
|
-
{ value:
|
|
55
|
+
const options: AutocompleteOption[] = [
|
|
56
|
+
{ value: "react", label: "React" },
|
|
57
|
+
{ value: "vue", label: "Vue.js" },
|
|
58
|
+
{ value: "angular", label: "Angular" },
|
|
59
|
+
{ value: "svelte", label: "Svelte" },
|
|
60
|
+
{ value: "nextjs", label: "Next.js" },
|
|
61
|
+
{ value: "nuxt", label: "Nuxt" },
|
|
62
|
+
{ value: "remix", label: "Remix" },
|
|
63
|
+
{ value: "astro", label: "Astro" },
|
|
45
64
|
]
|
|
46
65
|
|
|
47
66
|
const groupedOptions: AutocompleteOption[] = [
|
|
48
|
-
{ value:
|
|
49
|
-
{ value:
|
|
50
|
-
{ value:
|
|
51
|
-
{ value:
|
|
52
|
-
{ value:
|
|
53
|
-
{ value:
|
|
67
|
+
{ value: "react", label: "React", group: "Frameworks" },
|
|
68
|
+
{ value: "vue", label: "Vue.js", group: "Frameworks" },
|
|
69
|
+
{ value: "angular", label: "Angular", group: "Frameworks" },
|
|
70
|
+
{ value: "typescript", label: "TypeScript", group: "Languages" },
|
|
71
|
+
{ value: "javascript", label: "JavaScript", group: "Languages" },
|
|
72
|
+
{ value: "python", label: "Python", group: "Languages" },
|
|
54
73
|
]
|
|
55
74
|
|
|
56
75
|
export const Default: Story = {
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
args: {
|
|
77
|
+
options,
|
|
78
|
+
placeholder: "Sélectionner un framework...",
|
|
79
|
+
label: "Framework",
|
|
80
|
+
},
|
|
81
|
+
render: (args) => (
|
|
82
|
+
<div style={{ width: 300 }}>
|
|
83
|
+
<WakaAutocomplete {...args} />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
}
|
|
59
87
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
placeholder="Select a fruit..."
|
|
67
|
-
label="Favorite Fruit"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
)
|
|
88
|
+
export const WithDescription: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
options,
|
|
91
|
+
placeholder: "Sélectionner...",
|
|
92
|
+
label: "Framework préféré",
|
|
93
|
+
description: "Choisissez votre framework frontend préféré",
|
|
71
94
|
},
|
|
95
|
+
render: (args) => (
|
|
96
|
+
<div style={{ width: 300 }}>
|
|
97
|
+
<WakaAutocomplete {...args} />
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
72
100
|
}
|
|
73
101
|
|
|
74
102
|
export const Multiple: Story = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<WakaAutocomplete
|
|
81
|
-
options={fruits}
|
|
82
|
-
value={value as string[]}
|
|
83
|
-
onChange={setValue}
|
|
84
|
-
multiple
|
|
85
|
-
placeholder="Select fruits..."
|
|
86
|
-
label="Favorite Fruits"
|
|
87
|
-
description="You can select multiple options"
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
)
|
|
103
|
+
args: {
|
|
104
|
+
options,
|
|
105
|
+
placeholder: "Sélectionner plusieurs...",
|
|
106
|
+
label: "Frameworks",
|
|
107
|
+
multiple: true,
|
|
91
108
|
},
|
|
109
|
+
render: (args) => (
|
|
110
|
+
<div style={{ width: 300 }}>
|
|
111
|
+
<WakaAutocomplete {...args} />
|
|
112
|
+
</div>
|
|
113
|
+
),
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
export const Creatable: Story = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<WakaAutocomplete
|
|
101
|
-
options={fruits}
|
|
102
|
-
value={value as string | undefined}
|
|
103
|
-
onChange={setValue}
|
|
104
|
-
creatable
|
|
105
|
-
placeholder="Select or create..."
|
|
106
|
-
label="Fruit"
|
|
107
|
-
description="Type to create a new option"
|
|
108
|
-
/>
|
|
109
|
-
</div>
|
|
110
|
-
)
|
|
117
|
+
args: {
|
|
118
|
+
options,
|
|
119
|
+
placeholder: "Sélectionner ou créer...",
|
|
120
|
+
label: "Framework",
|
|
121
|
+
creatable: true,
|
|
111
122
|
},
|
|
123
|
+
render: (args) => (
|
|
124
|
+
<div style={{ width: 300 }}>
|
|
125
|
+
<WakaAutocomplete {...args} />
|
|
126
|
+
</div>
|
|
127
|
+
),
|
|
112
128
|
}
|
|
113
129
|
|
|
114
130
|
export const WithGroups: Story = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<div className="w-[300px]">
|
|
120
|
-
<WakaAutocomplete
|
|
121
|
-
options={groupedOptions}
|
|
122
|
-
value={value as string | undefined}
|
|
123
|
-
onChange={setValue}
|
|
124
|
-
placeholder="Select an item..."
|
|
125
|
-
label="Food"
|
|
126
|
-
/>
|
|
127
|
-
</div>
|
|
128
|
-
)
|
|
129
|
-
},
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export const AsyncSearch: Story = {
|
|
133
|
-
render: function AsyncDemo() {
|
|
134
|
-
const [value, setValue] = React.useState<string | string[] | null>(null)
|
|
135
|
-
|
|
136
|
-
const searchFn = async (query: string): Promise<AutocompleteOption[]> => {
|
|
137
|
-
await new Promise((resolve) => setTimeout(resolve, 500))
|
|
138
|
-
return fruits.filter((f) =>
|
|
139
|
-
f.label.toLowerCase().includes(query.toLowerCase())
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<div className="w-[300px]">
|
|
145
|
-
<WakaAutocomplete
|
|
146
|
-
options={[]}
|
|
147
|
-
value={value as string | undefined}
|
|
148
|
-
onChange={setValue}
|
|
149
|
-
onSearch={searchFn}
|
|
150
|
-
placeholder="Search fruits..."
|
|
151
|
-
label="Async Search"
|
|
152
|
-
description="Type to search"
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
)
|
|
131
|
+
args: {
|
|
132
|
+
options: groupedOptions,
|
|
133
|
+
placeholder: "Sélectionner...",
|
|
134
|
+
label: "Technologie",
|
|
156
135
|
},
|
|
136
|
+
render: (args) => (
|
|
137
|
+
<div style={{ width: 300 }}>
|
|
138
|
+
<WakaAutocomplete {...args} />
|
|
139
|
+
</div>
|
|
140
|
+
),
|
|
157
141
|
}
|
|
158
142
|
|
|
159
|
-
export const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<WakaAutocomplete
|
|
166
|
-
options={fruits}
|
|
167
|
-
value={value as string[]}
|
|
168
|
-
onChange={setValue}
|
|
169
|
-
multiple
|
|
170
|
-
maxSelections={3}
|
|
171
|
-
placeholder="Select up to 3 fruits..."
|
|
172
|
-
label="Limited Selection"
|
|
173
|
-
description="Maximum 3 selections allowed"
|
|
174
|
-
/>
|
|
175
|
-
</div>
|
|
176
|
-
)
|
|
143
|
+
export const Loading: Story = {
|
|
144
|
+
args: {
|
|
145
|
+
options: [],
|
|
146
|
+
placeholder: "Chargement...",
|
|
147
|
+
label: "Framework",
|
|
148
|
+
loading: true,
|
|
177
149
|
},
|
|
150
|
+
render: (args) => (
|
|
151
|
+
<div style={{ width: 300 }}>
|
|
152
|
+
<WakaAutocomplete {...args} />
|
|
153
|
+
</div>
|
|
154
|
+
),
|
|
178
155
|
}
|
|
179
156
|
|
|
180
157
|
export const WithError: Story = {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
<WakaAutocomplete
|
|
187
|
-
options={fruits}
|
|
188
|
-
value={value as string | undefined}
|
|
189
|
-
onChange={setValue}
|
|
190
|
-
placeholder="Select a fruit..."
|
|
191
|
-
label="Required Field"
|
|
192
|
-
error="This field is required"
|
|
193
|
-
/>
|
|
194
|
-
</div>
|
|
195
|
-
)
|
|
158
|
+
args: {
|
|
159
|
+
options,
|
|
160
|
+
placeholder: "Sélectionner...",
|
|
161
|
+
label: "Framework",
|
|
162
|
+
error: "Ce champ est obligatoire",
|
|
196
163
|
},
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
render: () => (
|
|
201
|
-
<div className="w-[300px]">
|
|
202
|
-
<WakaAutocomplete
|
|
203
|
-
options={fruits}
|
|
204
|
-
value="apple"
|
|
205
|
-
disabled
|
|
206
|
-
placeholder="Select a fruit..."
|
|
207
|
-
label="Disabled"
|
|
208
|
-
/>
|
|
164
|
+
render: (args) => (
|
|
165
|
+
<div style={{ width: 300 }}>
|
|
166
|
+
<WakaAutocomplete {...args} />
|
|
209
167
|
</div>
|
|
210
168
|
),
|
|
211
169
|
}
|
|
212
170
|
|
|
213
|
-
export const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
171
|
+
export const Disabled: Story = {
|
|
172
|
+
args: {
|
|
173
|
+
options,
|
|
174
|
+
placeholder: "Désactivé",
|
|
175
|
+
label: "Framework",
|
|
176
|
+
disabled: true,
|
|
177
|
+
value: "react",
|
|
178
|
+
},
|
|
179
|
+
render: (args) => (
|
|
180
|
+
<div style={{ width: 300 }}>
|
|
181
|
+
<WakaAutocomplete {...args} />
|
|
222
182
|
</div>
|
|
223
183
|
),
|
|
224
184
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaBiometricPrompt } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaBiometricPrompt> = {
|
|
5
|
+
title: "Security/WakaBiometricPrompt",
|
|
6
|
+
component: WakaBiometricPrompt,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
type: { control: "select", options: ["fingerprint", "face", "iris", "voice"], description: "Type biométrique" },
|
|
11
|
+
state: { control: "select", options: ["idle", "scanning", "success", "error"], description: "État" },
|
|
12
|
+
showFallback: { control: "boolean", description: "Afficher option de secours" },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof WakaBiometricPrompt>
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: { type: "fingerprint", state: "idle", title: "Authentification biométrique", subtitle: "Placez votre doigt sur le capteur" },
|
|
21
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const FaceID: Story = {
|
|
25
|
+
args: { type: "face", state: "idle", title: "Face ID", subtitle: "Regardez vers la caméra" },
|
|
26
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Scanning: Story = {
|
|
30
|
+
args: { type: "fingerprint", state: "scanning", title: "Scan en cours...", subtitle: "Ne bougez pas" },
|
|
31
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Success: Story = {
|
|
35
|
+
args: { type: "fingerprint", state: "success", title: "Authentifié !", subtitle: "Accès autorisé" },
|
|
36
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Error: Story = {
|
|
40
|
+
args: { type: "fingerprint", state: "error", title: "Échec", subtitle: "Empreinte non reconnue", showFallback: true },
|
|
41
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const WithFallback: Story = {
|
|
45
|
+
args: { type: "face", state: "idle", title: "Face ID", showFallback: true, fallbackLabel: "Utiliser le code PIN" },
|
|
46
|
+
render: (args) => <WakaBiometricPrompt {...args} />,
|
|
47
|
+
}
|
|
48
|
+
|