@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,31 +1,50 @@
1
- import type { Meta, StoryObj } from '@storybook/react'
2
- import { WakaAutocomplete, type AutocompleteOption } from './index'
3
- import * as React from 'react'
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: 'Components/Forms/WakaAutocomplete',
6
+ title: "Forms/WakaAutocomplete",
7
7
  component: WakaAutocomplete,
8
8
  parameters: {
9
- layout: 'centered',
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: ['autodocs'],
11
+ tags: ["autodocs"],
17
12
  argTypes: {
13
+ placeholder: {
14
+ control: "text",
15
+ description: "Texte placeholder",
16
+ },
18
17
  multiple: {
19
- control: 'boolean',
20
- description: 'Enable multi-select mode',
18
+ control: "boolean",
19
+ description: "Mode sélection multiple",
21
20
  },
22
21
  creatable: {
23
- control: 'boolean',
24
- description: 'Allow creating new options',
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: 'boolean',
28
- description: 'Disable the component',
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 fruits: AutocompleteOption[] = [
37
- { value: 'apple', label: 'Apple' },
38
- { value: 'banana', label: 'Banana' },
39
- { value: 'cherry', label: 'Cherry' },
40
- { value: 'date', label: 'Date' },
41
- { value: 'elderberry', label: 'Elderberry' },
42
- { value: 'fig', label: 'Fig' },
43
- { value: 'grape', label: 'Grape' },
44
- { value: 'honeydew', label: 'Honeydew' },
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: 'apple', label: 'Apple', group: 'Fruits' },
49
- { value: 'banana', label: 'Banana', group: 'Fruits' },
50
- { value: 'cherry', label: 'Cherry', group: 'Fruits' },
51
- { value: 'carrot', label: 'Carrot', group: 'Vegetables' },
52
- { value: 'broccoli', label: 'Broccoli', group: 'Vegetables' },
53
- { value: 'spinach', label: 'Spinach', group: 'Vegetables' },
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
- render: function AutocompleteDemo() {
58
- const [value, setValue] = React.useState<string | string[] | null>(null)
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
- return (
61
- <div className="w-[300px]">
62
- <WakaAutocomplete
63
- options={fruits}
64
- value={value as string | undefined}
65
- onChange={setValue}
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
- render: function MultipleDemo() {
76
- const [value, setValue] = React.useState<string | string[] | null>([])
77
-
78
- return (
79
- <div className="w-[300px]">
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
- render: function CreatableDemo() {
96
- const [value, setValue] = React.useState<string | string[] | null>(null)
97
-
98
- return (
99
- <div className="w-[300px]">
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
- render: function GroupedDemo() {
116
- const [value, setValue] = React.useState<string | string[] | null>(null)
117
-
118
- return (
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 WithMaxSelections: Story = {
160
- render: function MaxSelectionsDemo() {
161
- const [value, setValue] = React.useState<string | string[] | null>([])
162
-
163
- return (
164
- <div className="w-[300px]">
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
- render: function ErrorDemo() {
182
- const [value, setValue] = React.useState<string | string[] | null>(null)
183
-
184
- return (
185
- <div className="w-[300px]">
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
- export const Disabled: Story = {
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 Loading: Story = {
214
- render: () => (
215
- <div className="w-[300px]">
216
- <WakaAutocomplete
217
- options={fruits}
218
- loading
219
- placeholder="Loading..."
220
- label="Loading State"
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
+