@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
@@ -0,0 +1,120 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaCreditCardInput } from "./index"
3
+ import { useState } from "react"
4
+
5
+ const meta: Meta<typeof WakaCreditCardInput> = {
6
+ title: "E-commerce/WakaCreditCardInput",
7
+ component: WakaCreditCardInput,
8
+ parameters: {
9
+ layout: "centered",
10
+ },
11
+ tags: ["autodocs"],
12
+ argTypes: {
13
+ showCardPreview: {
14
+ control: "boolean",
15
+ description: "Afficher l'aperçu de la carte",
16
+ },
17
+ showCardType: {
18
+ control: "boolean",
19
+ description: "Afficher le type de carte détecté",
20
+ },
21
+ disabled: {
22
+ control: "boolean",
23
+ description: "État désactivé",
24
+ },
25
+ layout: {
26
+ control: "select",
27
+ options: ["stacked", "inline"],
28
+ description: "Disposition des champs",
29
+ },
30
+ size: {
31
+ control: "select",
32
+ options: ["sm", "md", "lg"],
33
+ description: "Taille des champs",
34
+ },
35
+ },
36
+ }
37
+
38
+ export default meta
39
+ type Story = StoryObj<typeof WakaCreditCardInput>
40
+
41
+ export const Default: Story = {
42
+ args: {
43
+ showCardPreview: true,
44
+ showCardType: true,
45
+ layout: "stacked",
46
+ size: "md",
47
+ },
48
+ render: (args) => (
49
+ <div style={{ width: 400 }}>
50
+ <WakaCreditCardInput {...args} />
51
+ </div>
52
+ ),
53
+ }
54
+
55
+ export const InlineLayout: Story = {
56
+ args: {
57
+ showCardPreview: false,
58
+ showCardType: true,
59
+ layout: "inline",
60
+ size: "md",
61
+ },
62
+ render: (args) => (
63
+ <div style={{ width: 500 }}>
64
+ <WakaCreditCardInput {...args} />
65
+ </div>
66
+ ),
67
+ }
68
+
69
+ export const WithoutPreview: Story = {
70
+ args: {
71
+ showCardPreview: false,
72
+ showCardType: true,
73
+ layout: "stacked",
74
+ },
75
+ render: (args) => (
76
+ <div style={{ width: 400 }}>
77
+ <WakaCreditCardInput {...args} />
78
+ </div>
79
+ ),
80
+ }
81
+
82
+ export const SmallSize: Story = {
83
+ args: {
84
+ showCardPreview: true,
85
+ size: "sm",
86
+ layout: "stacked",
87
+ },
88
+ render: (args) => (
89
+ <div style={{ width: 350 }}>
90
+ <WakaCreditCardInput {...args} />
91
+ </div>
92
+ ),
93
+ }
94
+
95
+ export const LargeSize: Story = {
96
+ args: {
97
+ showCardPreview: true,
98
+ size: "lg",
99
+ layout: "stacked",
100
+ },
101
+ render: (args) => (
102
+ <div style={{ width: 450 }}>
103
+ <WakaCreditCardInput {...args} />
104
+ </div>
105
+ ),
106
+ }
107
+
108
+ export const Disabled: Story = {
109
+ args: {
110
+ showCardPreview: true,
111
+ disabled: true,
112
+ layout: "stacked",
113
+ },
114
+ render: (args) => (
115
+ <div style={{ width: 400 }}>
116
+ <WakaCreditCardInput {...args} />
117
+ </div>
118
+ ),
119
+ }
120
+
@@ -0,0 +1,79 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import * as React from "react"
3
+ import { useForm } from "react-hook-form"
4
+ import { WakaDateTimePickerForm } from "./index"
5
+
6
+ type FormValues = {
7
+ date: Date | null
8
+ range: { from: Date | undefined; to: Date | undefined } | null
9
+ }
10
+
11
+ const meta: Meta<typeof WakaDateTimePickerForm> = {
12
+ title: "Forms/WakaDateTimePickerForm",
13
+ component: WakaDateTimePickerForm,
14
+ parameters: {
15
+ layout: "centered",
16
+ },
17
+ tags: ["autodocs"],
18
+ argTypes: {
19
+ label: { control: "text", description: "Label du champ" },
20
+ placeholder: { control: "text", description: "Placeholder" },
21
+ variant: { control: "select", options: ["date", "datetime", "range"], description: "Variante" },
22
+ showPresets: { control: "boolean", description: "Afficher les presets" },
23
+ disabled: { control: "boolean", description: "Désactivé" },
24
+ },
25
+ }
26
+
27
+ export default meta
28
+ type Story = StoryObj<typeof WakaDateTimePickerForm>
29
+
30
+ const FormExample = (props: { variant: "date" | "datetime" | "range"; label: string }) => {
31
+ const { control } = useForm<FormValues>({
32
+ defaultValues: {
33
+ date: new Date(),
34
+ range: {
35
+ from: new Date(),
36
+ to: new Date(Date.now() + 3 * 24 * 60 * 60 * 1000),
37
+ },
38
+ },
39
+ })
40
+
41
+ const name = props.variant === "range" ? "range" : "date"
42
+
43
+ return (
44
+ <form className="tw-space-y-4">
45
+ <WakaDateTimePickerForm
46
+ name={name}
47
+ control={control}
48
+ label={props.label}
49
+ variant={props.variant}
50
+ showPresets
51
+ />
52
+ </form>
53
+ )
54
+ }
55
+
56
+ export const DateOnly: Story = {
57
+ args: {
58
+ label: "Date",
59
+ variant: "date",
60
+ },
61
+ render: (args) => <FormExample label={args.label ?? "Date"} variant="date" />,
62
+ }
63
+
64
+ export const DateTime: Story = {
65
+ args: {
66
+ label: "Date et heure",
67
+ variant: "datetime",
68
+ },
69
+ render: (args) => <FormExample label={args.label ?? "Date et heure"} variant="datetime" />,
70
+ }
71
+
72
+ export const Range: Story = {
73
+ args: {
74
+ label: "Période",
75
+ variant: "range",
76
+ },
77
+ render: (args) => <FormExample label={args.label ?? "Période"} variant="range" />,
78
+ }
79
+
@@ -0,0 +1,72 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaDependencyTree, type Dependency } from "./index"
3
+
4
+ const meta: Meta<typeof WakaDependencyTree> = {
5
+ title: "DevOps/WakaDependencyTree",
6
+ component: WakaDependencyTree,
7
+ parameters: { layout: "padded" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ showVulnerabilities: { control: "boolean", description: "Afficher les vulnérabilités" },
11
+ showOutdated: { control: "boolean", description: "Afficher les packages obsolètes" },
12
+ expandAll: { control: "boolean", description: "Tout déplier" },
13
+ },
14
+ }
15
+
16
+ export default meta
17
+ type Story = StoryObj<typeof WakaDependencyTree>
18
+
19
+ const dependencies: Dependency[] = [
20
+ {
21
+ id: "react",
22
+ name: "react",
23
+ version: "18.2.0",
24
+ type: "direct",
25
+ vulnerability: "none",
26
+ children: [
27
+ { id: "react-dom", name: "react-dom", version: "18.2.0", type: "direct", vulnerability: "none" },
28
+ ],
29
+ },
30
+ {
31
+ id: "lodash",
32
+ name: "lodash",
33
+ version: "4.17.20",
34
+ type: "direct",
35
+ vulnerability: "high",
36
+ latestVersion: "4.17.21",
37
+ },
38
+ {
39
+ id: "axios",
40
+ name: "axios",
41
+ version: "0.21.1",
42
+ type: "direct",
43
+ vulnerability: "critical",
44
+ latestVersion: "1.6.0",
45
+ children: [
46
+ { id: "follow-redirects", name: "follow-redirects", version: "1.14.0", type: "transitive", vulnerability: "medium" },
47
+ ],
48
+ },
49
+ {
50
+ id: "typescript",
51
+ name: "typescript",
52
+ version: "5.0.0",
53
+ type: "dev",
54
+ vulnerability: "none",
55
+ },
56
+ ]
57
+
58
+ export const Default: Story = {
59
+ args: { dependencies, showVulnerabilities: true, showOutdated: true },
60
+ render: (args) => <WakaDependencyTree {...args} />,
61
+ }
62
+
63
+ export const ExpandedAll: Story = {
64
+ args: { dependencies, showVulnerabilities: true, expandAll: true },
65
+ render: (args) => <WakaDependencyTree {...args} />,
66
+ }
67
+
68
+ export const VulnerabilitiesOnly: Story = {
69
+ args: { dependencies: dependencies.filter(d => d.vulnerability !== "none"), showVulnerabilities: true },
70
+ render: (args) => <WakaDependencyTree {...args} />,
71
+ }
72
+
@@ -0,0 +1,109 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaDeviceTrust, type TrustedDevice } from "./index"
3
+
4
+ const meta: Meta<typeof WakaDeviceTrust> = {
5
+ title: "Security/WakaDeviceTrust",
6
+ component: WakaDeviceTrust,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ size: { control: "select", options: ["sm", "md", "lg"], description: "Taille du composant" },
11
+ showDetails: { control: "boolean", description: "Afficher les details" },
12
+ loading: { control: "boolean", description: "Etat de chargement" },
13
+ },
14
+ }
15
+
16
+ export default meta
17
+ type Story = StoryObj<typeof WakaDeviceTrust>
18
+
19
+ const devices: TrustedDevice[] = [
20
+ {
21
+ id: "1",
22
+ name: "MacBook Pro",
23
+ type: "laptop",
24
+ status: "trusted",
25
+ trustedAt: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
26
+ lastUsedAt: new Date(),
27
+ isCurrentDevice: true,
28
+ os: "macOS 14.0",
29
+ browser: "Chrome 120",
30
+ },
31
+ {
32
+ id: "2",
33
+ name: "iPhone 15",
34
+ type: "mobile",
35
+ status: "trusted",
36
+ trustedAt: new Date(Date.now() - 15 * 24 * 60 * 60 * 1000),
37
+ lastUsedAt: new Date(Date.now() - 3600000),
38
+ os: "iOS 17",
39
+ browser: "Safari",
40
+ },
41
+ {
42
+ id: "3",
43
+ name: "Windows PC",
44
+ type: "desktop",
45
+ status: "pending",
46
+ trustedAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000),
47
+ lastUsedAt: new Date(Date.now() - 86400000),
48
+ os: "Windows 11",
49
+ browser: "Edge",
50
+ },
51
+ ]
52
+
53
+ export const Default: Story = {
54
+ args: {
55
+ devices,
56
+ currentDeviceId: "1",
57
+ onAddDevice: () => console.log("Add device clicked"),
58
+ onRemoveDevice: async (id) => {
59
+ console.log("Remove device:", id)
60
+ return true
61
+ },
62
+ },
63
+ render: (args) => (
64
+ <div style={{ width: 500 }}>
65
+ <WakaDeviceTrust {...args} />
66
+ </div>
67
+ ),
68
+ }
69
+
70
+ export const AllTrusted: Story = {
71
+ args: {
72
+ devices: devices.map((d) => ({ ...d, status: "trusted" as const })),
73
+ currentDeviceId: "1",
74
+ onRemoveDevice: async (id) => {
75
+ console.log("Remove device:", id)
76
+ return true
77
+ },
78
+ },
79
+ render: (args) => (
80
+ <div style={{ width: 500 }}>
81
+ <WakaDeviceTrust {...args} />
82
+ </div>
83
+ ),
84
+ }
85
+
86
+ export const SingleDevice: Story = {
87
+ args: {
88
+ devices: [devices[0]],
89
+ currentDeviceId: "1",
90
+ onAddDevice: () => console.log("Add device clicked"),
91
+ },
92
+ render: (args) => (
93
+ <div style={{ width: 500 }}>
94
+ <WakaDeviceTrust {...args} />
95
+ </div>
96
+ ),
97
+ }
98
+
99
+ export const Empty: Story = {
100
+ args: {
101
+ devices: [],
102
+ onAddDevice: () => console.log("Add device clicked"),
103
+ },
104
+ render: (args) => (
105
+ <div style={{ width: 500 }}>
106
+ <WakaDeviceTrust {...args} />
107
+ </div>
108
+ ),
109
+ }
@@ -0,0 +1,87 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaEmptyState } from "./index"
3
+ import { Inbox, Search, FileX, ShoppingCart } from "lucide-react"
4
+
5
+ const meta: Meta<typeof WakaEmptyState> = {
6
+ title: "UI/WakaEmptyState",
7
+ component: WakaEmptyState,
8
+ parameters: { layout: "centered" },
9
+ tags: ["autodocs"],
10
+ argTypes: {
11
+ variant: { control: "select", options: ["default", "search", "error"], description: "Variante" },
12
+ size: { control: "select", options: ["sm", "md", "lg"], description: "Taille" },
13
+ layout: { control: "select", options: ["vertical", "horizontal"], description: "Disposition" },
14
+ },
15
+ }
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof WakaEmptyState>
19
+
20
+ export const Default: Story = {
21
+ args: {
22
+ title: "Aucun élément",
23
+ description: "Commencez par ajouter votre premier élément",
24
+ icon: <Inbox className="tw-h-12 tw-w-12" />,
25
+ actionLabel: "Ajouter",
26
+ },
27
+ render: (args) => (
28
+ <div style={{ width: 400 }}>
29
+ <WakaEmptyState {...args} />
30
+ </div>
31
+ ),
32
+ }
33
+
34
+ export const SearchState: Story = {
35
+ args: {
36
+ variant: "search",
37
+ title: "Aucun résultat",
38
+ description: "Essayez avec d'autres termes de recherche",
39
+ icon: <Search className="tw-h-12 tw-w-12" />,
40
+ },
41
+ render: (args) => (
42
+ <div style={{ width: 400 }}>
43
+ <WakaEmptyState {...args} />
44
+ </div>
45
+ ),
46
+ }
47
+
48
+ SearchState.storyName = "Search"
49
+
50
+ export const Error: Story = {
51
+ args: {
52
+ variant: "error",
53
+ title: "Erreur de chargement",
54
+ description: "Impossible de charger les données",
55
+ icon: <FileX className="tw-h-12 tw-w-12" />,
56
+ actionLabel: "Réessayer",
57
+ },
58
+ render: (args) => (
59
+ <div style={{ width: 400 }}>
60
+ <WakaEmptyState {...args} />
61
+ </div>
62
+ ),
63
+ }
64
+
65
+ export const EmptyCart: Story = {
66
+ args: {
67
+ title: "Panier vide",
68
+ description: "Ajoutez des articles pour continuer",
69
+ icon: <ShoppingCart className="tw-h-12 tw-w-12" />,
70
+ actionLabel: "Voir les produits",
71
+ size: "lg",
72
+ },
73
+ render: (args) => (
74
+ <div style={{ width: 500 }}>
75
+ <WakaEmptyState {...args} />
76
+ </div>
77
+ ),
78
+ }
79
+
80
+ export const Small: Story = {
81
+ args: { title: "Rien ici", description: "Liste vide", size: "sm" },
82
+ render: (args) => (
83
+ <div style={{ width: 300 }}>
84
+ <WakaEmptyState {...args} />
85
+ </div>
86
+ ),
87
+ }
@@ -0,0 +1,47 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaFeatureAnnouncement } from "./index"
3
+
4
+ const meta: Meta<typeof WakaFeatureAnnouncement> = {
5
+ title: "UI/WakaFeatureAnnouncement",
6
+ component: WakaFeatureAnnouncement,
7
+ parameters: { layout: "centered" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ variant: { control: "select", options: ["modal", "banner", "tooltip", "spotlight"], description: "Variante" },
11
+ showDismiss: { control: "boolean", description: "Bouton fermer" },
12
+ showNavigation: { control: "boolean", description: "Navigation multi-features" },
13
+ autoPlay: { control: "boolean", description: "Lecture auto vidéo" },
14
+ },
15
+ }
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof WakaFeatureAnnouncement>
19
+
20
+ const features = [
21
+ { id: "1", title: "Nouveau Dashboard", description: "Découvrez notre interface entièrement repensée", media: { type: "image" as const, src: "https://picsum.photos/seed/feat1/600/400" }, tag: "Nouveau" },
22
+ { id: "2", title: "Mode sombre", description: "Travaillez confortablement de jour comme de nuit", media: { type: "image" as const, src: "https://picsum.photos/seed/feat2/600/400" }, tag: "Populaire" },
23
+ ]
24
+
25
+ export const Default: Story = {
26
+ args: { features, variant: "modal", showDismiss: true, showNavigation: true },
27
+ render: (args) => (
28
+ <div style={{ width: 500 }}>
29
+ <WakaFeatureAnnouncement {...args} />
30
+ </div>
31
+ ),
32
+ }
33
+
34
+ export const Banner: Story = {
35
+ args: { features: [features[0]], variant: "banner", showDismiss: true },
36
+ render: (args) => <WakaFeatureAnnouncement {...args} />,
37
+ }
38
+
39
+ export const SingleFeature: Story = {
40
+ args: { features: [features[0]], variant: "modal", showNavigation: false },
41
+ render: (args) => (
42
+ <div style={{ width: 450 }}>
43
+ <WakaFeatureAnnouncement {...args} />
44
+ </div>
45
+ ),
46
+ }
47
+
@@ -0,0 +1,188 @@
1
+ import type { Meta, StoryObj } from "@storybook/react"
2
+ import { WakaFeatureFlagRow, defaultFeatureFlags, type FeatureFlag } from "./index"
3
+
4
+ const meta: Meta<typeof WakaFeatureFlagRow> = {
5
+ title: "DevOps/WakaFeatureFlagRow",
6
+ component: WakaFeatureFlagRow,
7
+ parameters: { layout: "padded" },
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ readOnly: { control: "boolean", description: "Mode lecture seule" },
11
+ compact: { control: "boolean", description: "Mode compact" },
12
+ },
13
+ }
14
+
15
+ export default meta
16
+ type Story = StoryObj<typeof WakaFeatureFlagRow>
17
+
18
+ const sampleFlag: FeatureFlag = {
19
+ id: "new-dashboard",
20
+ key: "new_dashboard",
21
+ name: "New Dashboard",
22
+ description: "Nouvelle interface du tableau de bord avec des graphiques améliorés",
23
+ status: "percentage",
24
+ enabled: true,
25
+ percentage: 50,
26
+ createdAt: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
27
+ updatedAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000),
28
+ createdBy: "product-team",
29
+ environment: "staging",
30
+ tags: ["dashboard", "experiment"],
31
+ }
32
+
33
+ const disabledFlag: FeatureFlag = {
34
+ id: "beta-feature",
35
+ key: "beta_feature",
36
+ name: "Beta Feature",
37
+ description: "Fonctionnalité en cours de développement",
38
+ status: "disabled",
39
+ enabled: false,
40
+ createdAt: new Date(Date.now() - 60 * 24 * 60 * 60 * 1000),
41
+ updatedAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
42
+ environment: "development",
43
+ }
44
+
45
+ const fullRolloutFlag: FeatureFlag = {
46
+ id: "stable-feature",
47
+ key: "stable_feature",
48
+ name: "Stable Feature",
49
+ description: "Fonctionnalité entièrement déployée en production",
50
+ status: "enabled",
51
+ enabled: true,
52
+ createdAt: new Date(Date.now() - 90 * 24 * 60 * 60 * 1000),
53
+ updatedAt: new Date(Date.now() - 14 * 24 * 60 * 60 * 1000),
54
+ environment: "production",
55
+ tags: ["stable"],
56
+ }
57
+
58
+ const segmentFlag: FeatureFlag = {
59
+ id: "premium-feature",
60
+ key: "premium_feature",
61
+ name: "Premium Feature",
62
+ description: "Fonctionnalité réservée aux utilisateurs premium",
63
+ status: "segment",
64
+ enabled: true,
65
+ segments: [
66
+ { id: "s1", name: "Premium Users", description: "Utilisateurs avec abonnement premium" },
67
+ { id: "s2", name: "Beta Testers", description: "Testeurs beta approuvés" },
68
+ ],
69
+ createdAt: new Date(Date.now() - 45 * 24 * 60 * 60 * 1000),
70
+ updatedAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000),
71
+ createdBy: "engineering",
72
+ environment: "production",
73
+ tags: ["premium", "targeted"],
74
+ }
75
+
76
+ export const Default: Story = {
77
+ args: {
78
+ flag: sampleFlag,
79
+ onToggle: (enabled) => console.log("Toggle:", enabled),
80
+ onPercentageChange: (percentage) => console.log("Percentage:", percentage),
81
+ onEdit: () => console.log("Edit"),
82
+ onDelete: () => console.log("Delete"),
83
+ onViewHistory: () => console.log("View History"),
84
+ onDuplicate: () => console.log("Duplicate"),
85
+ },
86
+ render: (args) => (
87
+ <div className="max-w-2xl">
88
+ <WakaFeatureFlagRow {...args} />
89
+ </div>
90
+ ),
91
+ }
92
+
93
+ export const Disabled: Story = {
94
+ args: {
95
+ flag: disabledFlag,
96
+ onToggle: (enabled) => console.log("Toggle:", enabled),
97
+ onEdit: () => console.log("Edit"),
98
+ },
99
+ render: (args) => (
100
+ <div className="max-w-2xl">
101
+ <WakaFeatureFlagRow {...args} />
102
+ </div>
103
+ ),
104
+ }
105
+
106
+ export const FullRollout: Story = {
107
+ args: {
108
+ flag: fullRolloutFlag,
109
+ onToggle: (enabled) => console.log("Toggle:", enabled),
110
+ },
111
+ render: (args) => (
112
+ <div className="max-w-2xl">
113
+ <WakaFeatureFlagRow {...args} />
114
+ </div>
115
+ ),
116
+ }
117
+
118
+ export const WithSegments: Story = {
119
+ args: {
120
+ flag: segmentFlag,
121
+ onToggle: (enabled) => console.log("Toggle:", enabled),
122
+ onEdit: () => console.log("Edit"),
123
+ onViewHistory: () => console.log("View History"),
124
+ },
125
+ render: (args) => (
126
+ <div className="max-w-2xl">
127
+ <WakaFeatureFlagRow {...args} />
128
+ </div>
129
+ ),
130
+ }
131
+
132
+ export const Compact: Story = {
133
+ args: {
134
+ flag: sampleFlag,
135
+ compact: true,
136
+ onToggle: (enabled) => console.log("Toggle:", enabled),
137
+ },
138
+ render: (args) => (
139
+ <div className="max-w-md">
140
+ <WakaFeatureFlagRow {...args} />
141
+ </div>
142
+ ),
143
+ }
144
+
145
+ export const ReadOnly: Story = {
146
+ args: {
147
+ flag: sampleFlag,
148
+ readOnly: true,
149
+ },
150
+ render: (args) => (
151
+ <div className="max-w-2xl">
152
+ <WakaFeatureFlagRow {...args} />
153
+ </div>
154
+ ),
155
+ }
156
+
157
+ export const MultipleFlags: Story = {
158
+ render: () => (
159
+ <div className="max-w-2xl space-y-4">
160
+ {defaultFeatureFlags.map((flag) => (
161
+ <WakaFeatureFlagRow
162
+ key={flag.id}
163
+ flag={flag}
164
+ onToggle={(enabled) => console.log(`${flag.key}: ${enabled}`)}
165
+ onEdit={() => console.log(`Edit ${flag.key}`)}
166
+ onDelete={() => console.log(`Delete ${flag.key}`)}
167
+ onViewHistory={() => console.log(`History ${flag.key}`)}
168
+ onDuplicate={() => console.log(`Duplicate ${flag.key}`)}
169
+ />
170
+ ))}
171
+ </div>
172
+ ),
173
+ }
174
+
175
+ export const CompactList: Story = {
176
+ render: () => (
177
+ <div className="max-w-md border rounded-lg">
178
+ {defaultFeatureFlags.map((flag) => (
179
+ <WakaFeatureFlagRow
180
+ key={flag.id}
181
+ flag={flag}
182
+ compact
183
+ onToggle={(enabled) => console.log(`${flag.key}: ${enabled}`)}
184
+ />
185
+ ))}
186
+ </div>
187
+ ),
188
+ }