@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
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaTagInput, type Tag, type TagSuggestion, type TagCategory } from "./index"
|
|
3
|
+
import { useState } from "react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WakaTagInput> = {
|
|
6
|
+
title: "Forms/WakaTagInput",
|
|
7
|
+
component: WakaTagInput,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
tags: ["autodocs"],
|
|
12
|
+
argTypes: {
|
|
13
|
+
placeholder: {
|
|
14
|
+
control: "text",
|
|
15
|
+
description: "Texte placeholder",
|
|
16
|
+
},
|
|
17
|
+
maxTags: {
|
|
18
|
+
control: "number",
|
|
19
|
+
description: "Nombre maximum de tags",
|
|
20
|
+
},
|
|
21
|
+
minTags: {
|
|
22
|
+
control: "number",
|
|
23
|
+
description: "Nombre minimum de tags",
|
|
24
|
+
},
|
|
25
|
+
allowDuplicates: {
|
|
26
|
+
control: "boolean",
|
|
27
|
+
description: "Autoriser les doublons",
|
|
28
|
+
},
|
|
29
|
+
allowCreate: {
|
|
30
|
+
control: "boolean",
|
|
31
|
+
description: "Permettre la création de nouveaux tags",
|
|
32
|
+
},
|
|
33
|
+
draggable: {
|
|
34
|
+
control: "boolean",
|
|
35
|
+
description: "Tags réorganisables par drag & drop",
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
control: "boolean",
|
|
39
|
+
description: "État désactivé",
|
|
40
|
+
},
|
|
41
|
+
readOnly: {
|
|
42
|
+
control: "boolean",
|
|
43
|
+
description: "Mode lecture seule",
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
control: "select",
|
|
47
|
+
options: ["sm", "md", "lg"],
|
|
48
|
+
description: "Taille des tags",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default meta
|
|
54
|
+
type Story = StoryObj<typeof WakaTagInput>
|
|
55
|
+
|
|
56
|
+
const initialTags: Tag[] = [
|
|
57
|
+
{ id: "1", value: "React" },
|
|
58
|
+
{ id: "2", value: "TypeScript" },
|
|
59
|
+
{ id: "3", value: "Tailwind" },
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
const categorizedTags: Tag[] = [
|
|
63
|
+
{ id: "1", value: "React", category: "frontend" },
|
|
64
|
+
{ id: "2", value: "Node.js", category: "backend" },
|
|
65
|
+
{ id: "3", value: "Docker", category: "devops" },
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
const suggestions: TagSuggestion[] = [
|
|
69
|
+
{ value: "React", category: "frontend", description: "JavaScript library" },
|
|
70
|
+
{ value: "Vue.js", category: "frontend", description: "Progressive framework" },
|
|
71
|
+
{ value: "Angular", category: "frontend", description: "TypeScript framework" },
|
|
72
|
+
{ value: "Node.js", category: "backend", description: "JavaScript runtime" },
|
|
73
|
+
{ value: "Python", category: "backend", description: "Programming language" },
|
|
74
|
+
{ value: "Docker", category: "devops", description: "Container platform" },
|
|
75
|
+
{ value: "Kubernetes", category: "devops", description: "Container orchestration" },
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
const categories: TagCategory[] = [
|
|
79
|
+
{ name: "frontend", bgColor: "#dbeafe", textColor: "#1e40af", borderColor: "#93c5fd" },
|
|
80
|
+
{ name: "backend", bgColor: "#dcfce7", textColor: "#166534", borderColor: "#86efac" },
|
|
81
|
+
{ name: "devops", bgColor: "#fef3c7", textColor: "#92400e", borderColor: "#fcd34d" },
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
const ControlledTagInput = (props: any) => {
|
|
85
|
+
const [tags, setTags] = useState<Tag[]>(props.tags || initialTags)
|
|
86
|
+
return <WakaTagInput {...props} tags={tags} onChange={setTags} />
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const Default: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
tags: initialTags,
|
|
92
|
+
placeholder: "Ajouter un tag...",
|
|
93
|
+
allowCreate: true,
|
|
94
|
+
},
|
|
95
|
+
render: (args) => (
|
|
96
|
+
<div style={{ width: 400 }}>
|
|
97
|
+
<ControlledTagInput {...args} />
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const WithSuggestions: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
tags: [],
|
|
105
|
+
suggestions,
|
|
106
|
+
placeholder: "Tapez pour rechercher...",
|
|
107
|
+
allowCreate: true,
|
|
108
|
+
},
|
|
109
|
+
render: (args) => (
|
|
110
|
+
<div style={{ width: 400 }}>
|
|
111
|
+
<ControlledTagInput {...args} />
|
|
112
|
+
</div>
|
|
113
|
+
),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const WithCategories: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
tags: categorizedTags,
|
|
119
|
+
suggestions,
|
|
120
|
+
categories,
|
|
121
|
+
placeholder: "Ajouter une technologie...",
|
|
122
|
+
allowCreate: true,
|
|
123
|
+
},
|
|
124
|
+
render: (args) => (
|
|
125
|
+
<div style={{ width: 400 }}>
|
|
126
|
+
<ControlledTagInput {...args} />
|
|
127
|
+
</div>
|
|
128
|
+
),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const Draggable: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
tags: initialTags,
|
|
134
|
+
placeholder: "Glissez pour réorganiser...",
|
|
135
|
+
draggable: true,
|
|
136
|
+
allowCreate: true,
|
|
137
|
+
},
|
|
138
|
+
render: (args) => (
|
|
139
|
+
<div style={{ width: 400 }}>
|
|
140
|
+
<ControlledTagInput {...args} />
|
|
141
|
+
</div>
|
|
142
|
+
),
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const MaxTags: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
tags: initialTags,
|
|
148
|
+
placeholder: "Max 5 tags",
|
|
149
|
+
maxTags: 5,
|
|
150
|
+
allowCreate: true,
|
|
151
|
+
},
|
|
152
|
+
render: (args) => (
|
|
153
|
+
<div style={{ width: 400 }}>
|
|
154
|
+
<ControlledTagInput {...args} />
|
|
155
|
+
</div>
|
|
156
|
+
),
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export const ReadOnly: Story = {
|
|
160
|
+
args: {
|
|
161
|
+
tags: initialTags,
|
|
162
|
+
readOnly: true,
|
|
163
|
+
},
|
|
164
|
+
render: (args) => (
|
|
165
|
+
<div style={{ width: 400 }}>
|
|
166
|
+
<WakaTagInput {...args} onChange={() => {}} />
|
|
167
|
+
</div>
|
|
168
|
+
),
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export const Disabled: Story = {
|
|
172
|
+
args: {
|
|
173
|
+
tags: initialTags,
|
|
174
|
+
disabled: true,
|
|
175
|
+
},
|
|
176
|
+
render: (args) => (
|
|
177
|
+
<div style={{ width: 400 }}>
|
|
178
|
+
<WakaTagInput {...args} onChange={() => {}} />
|
|
179
|
+
</div>
|
|
180
|
+
),
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const SmallSize: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
tags: initialTags,
|
|
186
|
+
placeholder: "Tags compacts",
|
|
187
|
+
size: "sm",
|
|
188
|
+
allowCreate: true,
|
|
189
|
+
},
|
|
190
|
+
render: (args) => (
|
|
191
|
+
<div style={{ width: 350 }}>
|
|
192
|
+
<ControlledTagInput {...args} />
|
|
193
|
+
</div>
|
|
194
|
+
),
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export const LargeSize: Story = {
|
|
198
|
+
args: {
|
|
199
|
+
tags: initialTags,
|
|
200
|
+
placeholder: "Grands tags",
|
|
201
|
+
size: "lg",
|
|
202
|
+
allowCreate: true,
|
|
203
|
+
},
|
|
204
|
+
render: (args) => (
|
|
205
|
+
<div style={{ width: 450 }}>
|
|
206
|
+
<ControlledTagInput {...args} />
|
|
207
|
+
</div>
|
|
208
|
+
),
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export const NoDuplicates: Story = {
|
|
212
|
+
args: {
|
|
213
|
+
tags: initialTags,
|
|
214
|
+
placeholder: "Pas de doublons",
|
|
215
|
+
allowDuplicates: false,
|
|
216
|
+
allowCreate: true,
|
|
217
|
+
},
|
|
218
|
+
render: (args) => (
|
|
219
|
+
<div style={{ width: 400 }}>
|
|
220
|
+
<ControlledTagInput {...args} />
|
|
221
|
+
</div>
|
|
222
|
+
),
|
|
223
|
+
}
|
|
224
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaTeamBanner } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaTeamBanner> = {
|
|
5
|
+
title: "UI/WakaTeamBanner",
|
|
6
|
+
component: WakaTeamBanner,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: { control: "select", options: ["default", "compact", "hero"], description: "Variante" },
|
|
11
|
+
showMembers: { control: "boolean", description: "Afficher les membres" },
|
|
12
|
+
showStats: { control: "boolean", description: "Afficher les stats" },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof WakaTeamBanner>
|
|
18
|
+
|
|
19
|
+
const team = {
|
|
20
|
+
name: "Équipe Alpha",
|
|
21
|
+
description: "Une équipe passionnée par l'innovation",
|
|
22
|
+
logo: "https://picsum.photos/seed/team/100/100",
|
|
23
|
+
members: [
|
|
24
|
+
{ id: "1", name: "Alice", avatar: "https://i.pravatar.cc/150?u=alice", role: "Lead" },
|
|
25
|
+
{ id: "2", name: "Bob", avatar: "https://i.pravatar.cc/150?u=bob", role: "Dev" },
|
|
26
|
+
{ id: "3", name: "Charlie", avatar: "https://i.pravatar.cc/150?u=charlie", role: "Design" },
|
|
27
|
+
],
|
|
28
|
+
stats: { projects: 12, members: 8, achievements: 24 },
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Default: Story = {
|
|
32
|
+
args: { team, variant: "default", showMembers: true, showStats: true },
|
|
33
|
+
render: (args) => <WakaTeamBanner {...args} />,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Compact: Story = {
|
|
37
|
+
args: { team, variant: "compact", showMembers: true, showStats: false },
|
|
38
|
+
render: (args) => <WakaTeamBanner {...args} />,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Hero: Story = {
|
|
42
|
+
args: { team, variant: "hero", showMembers: true, showStats: true },
|
|
43
|
+
render: (args) => <WakaTeamBanner {...args} />,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const NoMembers: Story = {
|
|
47
|
+
args: { team, variant: "default", showMembers: false, showStats: true },
|
|
48
|
+
render: (args) => <WakaTeamBanner {...args} />,
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaThemeCreator } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaThemeCreator> = {
|
|
5
|
+
title: "Themes/WakaThemeCreator",
|
|
6
|
+
component: WakaThemeCreator,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
showPreview: { control: "boolean", description: "Afficher l'aperçu" },
|
|
11
|
+
showExport: { control: "boolean", description: "Permettre l'export" },
|
|
12
|
+
showImport: { control: "boolean", description: "Permettre l'import" },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof WakaThemeCreator>
|
|
18
|
+
|
|
19
|
+
const defaultColors = {
|
|
20
|
+
primary: "#3b82f6",
|
|
21
|
+
secondary: "#6366f1",
|
|
22
|
+
background: "#ffffff",
|
|
23
|
+
foreground: "#0f172a",
|
|
24
|
+
muted: "#f1f5f9",
|
|
25
|
+
accent: "#f59e0b",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: { initialColors: defaultColors, showPreview: true, showExport: true, showImport: true },
|
|
30
|
+
render: (args) => <WakaThemeCreator {...args} />,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const DarkTheme: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
initialColors: {
|
|
36
|
+
primary: "#8b5cf6",
|
|
37
|
+
secondary: "#ec4899",
|
|
38
|
+
background: "#0f172a",
|
|
39
|
+
foreground: "#f8fafc",
|
|
40
|
+
muted: "#1e293b",
|
|
41
|
+
accent: "#22c55e",
|
|
42
|
+
},
|
|
43
|
+
showPreview: true,
|
|
44
|
+
showExport: true,
|
|
45
|
+
},
|
|
46
|
+
render: (args) => <WakaThemeCreator {...args} />,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const MinimalUI: Story = {
|
|
50
|
+
args: { initialColors: defaultColors, showPreview: false, showExport: false, showImport: false },
|
|
51
|
+
render: (args) => <WakaThemeCreator {...args} />,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const WithPreviewOnly: Story = {
|
|
55
|
+
args: { initialColors: defaultColors, showPreview: true, showExport: false },
|
|
56
|
+
render: (args) => <WakaThemeCreator {...args} />,
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaThemeManager, type TweakCNTheme } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaThemeManager> = {
|
|
5
|
+
title: "Themes/WakaThemeManager",
|
|
6
|
+
component: WakaThemeManager,
|
|
7
|
+
parameters: { layout: "fullscreen" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
showPreview: {
|
|
11
|
+
control: "boolean",
|
|
12
|
+
description: "Afficher la prévisualisation",
|
|
13
|
+
},
|
|
14
|
+
showExport: {
|
|
15
|
+
control: "boolean",
|
|
16
|
+
description: "Permettre l'export du thème",
|
|
17
|
+
},
|
|
18
|
+
showImport: {
|
|
19
|
+
control: "boolean",
|
|
20
|
+
description: "Permettre l'import de thème",
|
|
21
|
+
},
|
|
22
|
+
allowCustomColors: {
|
|
23
|
+
control: "boolean",
|
|
24
|
+
description: "Permettre la modification des couleurs",
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
control: "select",
|
|
28
|
+
options: ["sm", "base", "lg", "full"],
|
|
29
|
+
description: "Taille du composant",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default meta
|
|
35
|
+
type Story = StoryObj<typeof WakaThemeManager>
|
|
36
|
+
|
|
37
|
+
const defaultTheme: TweakCNTheme = {
|
|
38
|
+
name: "Mon thème personnalisé",
|
|
39
|
+
description: "Un thème moderne et élégant",
|
|
40
|
+
author: "Wakastart",
|
|
41
|
+
version: "1.0.0",
|
|
42
|
+
colors: {
|
|
43
|
+
background: "#ffffff",
|
|
44
|
+
foreground: "#0a0a0a",
|
|
45
|
+
card: "#ffffff",
|
|
46
|
+
cardForeground: "#0a0a0a",
|
|
47
|
+
popover: "#ffffff",
|
|
48
|
+
popoverForeground: "#0a0a0a",
|
|
49
|
+
primary: "#0a0a0a",
|
|
50
|
+
primaryForeground: "#fafafa",
|
|
51
|
+
secondary: "#f4f4f5",
|
|
52
|
+
secondaryForeground: "#0a0a0a",
|
|
53
|
+
muted: "#f4f4f5",
|
|
54
|
+
mutedForeground: "#737373",
|
|
55
|
+
accent: "#f4f4f5",
|
|
56
|
+
accentForeground: "#0a0a0a",
|
|
57
|
+
destructive: "#ef4444",
|
|
58
|
+
destructiveForeground: "#fafafa",
|
|
59
|
+
border: "#e4e4e7",
|
|
60
|
+
input: "#e4e4e7",
|
|
61
|
+
ring: "#0a0a0a",
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const oceanTheme: TweakCNTheme = {
|
|
66
|
+
name: "Océan",
|
|
67
|
+
description: "Thème inspiré de l'océan",
|
|
68
|
+
author: "Wakastart",
|
|
69
|
+
version: "1.0.0",
|
|
70
|
+
colors: {
|
|
71
|
+
background: "#f0f9ff",
|
|
72
|
+
foreground: "#0c4a6e",
|
|
73
|
+
card: "#ffffff",
|
|
74
|
+
cardForeground: "#0c4a6e",
|
|
75
|
+
popover: "#ffffff",
|
|
76
|
+
popoverForeground: "#0c4a6e",
|
|
77
|
+
primary: "#0284c7",
|
|
78
|
+
primaryForeground: "#ffffff",
|
|
79
|
+
secondary: "#e0f2fe",
|
|
80
|
+
secondaryForeground: "#0369a1",
|
|
81
|
+
muted: "#f0f9ff",
|
|
82
|
+
mutedForeground: "#64748b",
|
|
83
|
+
accent: "#bae6fd",
|
|
84
|
+
accentForeground: "#0c4a6e",
|
|
85
|
+
destructive: "#ef4444",
|
|
86
|
+
destructiveForeground: "#ffffff",
|
|
87
|
+
border: "#bae6fd",
|
|
88
|
+
input: "#e0f2fe",
|
|
89
|
+
ring: "#0284c7",
|
|
90
|
+
chart1: "#0284c7",
|
|
91
|
+
chart2: "#0ea5e9",
|
|
92
|
+
chart3: "#38bdf8",
|
|
93
|
+
chart4: "#7dd3fc",
|
|
94
|
+
chart5: "#bae6fd",
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const sunsetTheme: TweakCNTheme = {
|
|
99
|
+
name: "Coucher de soleil",
|
|
100
|
+
description: "Thème aux couleurs chaudes",
|
|
101
|
+
author: "Wakastart",
|
|
102
|
+
version: "1.0.0",
|
|
103
|
+
colors: {
|
|
104
|
+
background: "#fffbeb",
|
|
105
|
+
foreground: "#78350f",
|
|
106
|
+
card: "#ffffff",
|
|
107
|
+
cardForeground: "#78350f",
|
|
108
|
+
popover: "#ffffff",
|
|
109
|
+
popoverForeground: "#78350f",
|
|
110
|
+
primary: "#f97316",
|
|
111
|
+
primaryForeground: "#ffffff",
|
|
112
|
+
secondary: "#fed7aa",
|
|
113
|
+
secondaryForeground: "#9a3412",
|
|
114
|
+
muted: "#fef3c7",
|
|
115
|
+
mutedForeground: "#92400e",
|
|
116
|
+
accent: "#fdba74",
|
|
117
|
+
accentForeground: "#78350f",
|
|
118
|
+
destructive: "#dc2626",
|
|
119
|
+
destructiveForeground: "#ffffff",
|
|
120
|
+
border: "#fed7aa",
|
|
121
|
+
input: "#fef3c7",
|
|
122
|
+
ring: "#f97316",
|
|
123
|
+
chart1: "#f97316",
|
|
124
|
+
chart2: "#fb923c",
|
|
125
|
+
chart3: "#fdba74",
|
|
126
|
+
chart4: "#fed7aa",
|
|
127
|
+
chart5: "#ffedd5",
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const Default: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
showPreview: true,
|
|
134
|
+
showExport: true,
|
|
135
|
+
showImport: true,
|
|
136
|
+
allowCustomColors: true,
|
|
137
|
+
size: "base",
|
|
138
|
+
},
|
|
139
|
+
render: (args) => (
|
|
140
|
+
<div className="p-6">
|
|
141
|
+
<WakaThemeManager {...args} />
|
|
142
|
+
</div>
|
|
143
|
+
),
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const WithInitialTheme: Story = {
|
|
147
|
+
args: {
|
|
148
|
+
initialTheme: oceanTheme,
|
|
149
|
+
showPreview: true,
|
|
150
|
+
showExport: true,
|
|
151
|
+
showImport: true,
|
|
152
|
+
allowCustomColors: true,
|
|
153
|
+
},
|
|
154
|
+
render: (args) => (
|
|
155
|
+
<div className="p-6">
|
|
156
|
+
<WakaThemeManager {...args} />
|
|
157
|
+
</div>
|
|
158
|
+
),
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const SunsetTheme: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
initialTheme: sunsetTheme,
|
|
164
|
+
showPreview: true,
|
|
165
|
+
showExport: true,
|
|
166
|
+
showImport: true,
|
|
167
|
+
allowCustomColors: true,
|
|
168
|
+
},
|
|
169
|
+
render: (args) => (
|
|
170
|
+
<div className="p-6">
|
|
171
|
+
<WakaThemeManager {...args} />
|
|
172
|
+
</div>
|
|
173
|
+
),
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export const ExportOnly: Story = {
|
|
177
|
+
args: {
|
|
178
|
+
initialTheme: defaultTheme,
|
|
179
|
+
showPreview: true,
|
|
180
|
+
showExport: true,
|
|
181
|
+
showImport: false,
|
|
182
|
+
allowCustomColors: false,
|
|
183
|
+
},
|
|
184
|
+
render: (args) => (
|
|
185
|
+
<div className="p-6">
|
|
186
|
+
<WakaThemeManager {...args} />
|
|
187
|
+
</div>
|
|
188
|
+
),
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const ImportOnly: Story = {
|
|
192
|
+
args: {
|
|
193
|
+
showPreview: true,
|
|
194
|
+
showExport: false,
|
|
195
|
+
showImport: true,
|
|
196
|
+
allowCustomColors: false,
|
|
197
|
+
},
|
|
198
|
+
render: (args) => (
|
|
199
|
+
<div className="p-6">
|
|
200
|
+
<WakaThemeManager {...args} />
|
|
201
|
+
</div>
|
|
202
|
+
),
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export const NoColorEditor: Story = {
|
|
206
|
+
args: {
|
|
207
|
+
initialTheme: oceanTheme,
|
|
208
|
+
showPreview: true,
|
|
209
|
+
showExport: true,
|
|
210
|
+
showImport: true,
|
|
211
|
+
allowCustomColors: false,
|
|
212
|
+
},
|
|
213
|
+
render: (args) => (
|
|
214
|
+
<div className="p-6">
|
|
215
|
+
<WakaThemeManager {...args} />
|
|
216
|
+
</div>
|
|
217
|
+
),
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const NoPreview: Story = {
|
|
221
|
+
args: {
|
|
222
|
+
showPreview: false,
|
|
223
|
+
showExport: true,
|
|
224
|
+
showImport: true,
|
|
225
|
+
allowCustomColors: true,
|
|
226
|
+
},
|
|
227
|
+
render: (args) => (
|
|
228
|
+
<div className="p-6">
|
|
229
|
+
<WakaThemeManager {...args} />
|
|
230
|
+
</div>
|
|
231
|
+
),
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export const SmallSize: Story = {
|
|
235
|
+
args: {
|
|
236
|
+
initialTheme: defaultTheme,
|
|
237
|
+
showPreview: true,
|
|
238
|
+
showExport: true,
|
|
239
|
+
showImport: true,
|
|
240
|
+
allowCustomColors: true,
|
|
241
|
+
size: "sm",
|
|
242
|
+
},
|
|
243
|
+
render: (args) => (
|
|
244
|
+
<div className="p-6">
|
|
245
|
+
<WakaThemeManager {...args} />
|
|
246
|
+
</div>
|
|
247
|
+
),
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export const LargeSize: Story = {
|
|
251
|
+
args: {
|
|
252
|
+
initialTheme: defaultTheme,
|
|
253
|
+
showPreview: true,
|
|
254
|
+
showExport: true,
|
|
255
|
+
showImport: true,
|
|
256
|
+
allowCustomColors: true,
|
|
257
|
+
size: "lg",
|
|
258
|
+
},
|
|
259
|
+
render: (args) => (
|
|
260
|
+
<div className="p-6">
|
|
261
|
+
<WakaThemeManager {...args} />
|
|
262
|
+
</div>
|
|
263
|
+
),
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const FullWidth: Story = {
|
|
267
|
+
args: {
|
|
268
|
+
initialTheme: defaultTheme,
|
|
269
|
+
showPreview: true,
|
|
270
|
+
showExport: true,
|
|
271
|
+
showImport: true,
|
|
272
|
+
allowCustomColors: true,
|
|
273
|
+
size: "full",
|
|
274
|
+
},
|
|
275
|
+
render: (args) => (
|
|
276
|
+
<div className="p-6">
|
|
277
|
+
<WakaThemeManager {...args} />
|
|
278
|
+
</div>
|
|
279
|
+
),
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export const WithCallbacks: Story = {
|
|
283
|
+
args: {
|
|
284
|
+
initialTheme: defaultTheme,
|
|
285
|
+
showPreview: true,
|
|
286
|
+
showExport: true,
|
|
287
|
+
showImport: true,
|
|
288
|
+
allowCustomColors: true,
|
|
289
|
+
onThemeChange: (theme) => console.log("Theme changed:", theme),
|
|
290
|
+
onThemeSave: (theme) => console.log("Theme saved:", theme),
|
|
291
|
+
onThemeLoad: (theme) => console.log("Theme loaded:", theme),
|
|
292
|
+
},
|
|
293
|
+
render: (args) => (
|
|
294
|
+
<div className="p-6">
|
|
295
|
+
<WakaThemeManager {...args} />
|
|
296
|
+
</div>
|
|
297
|
+
),
|
|
298
|
+
}
|
|
@@ -132,9 +132,9 @@ const WakaThemeManager = React.forwardRef<HTMLDivElement, WakaThemeManagerProps>
|
|
|
132
132
|
}, ref) => {
|
|
133
133
|
// Utiliser le contexte de thème (optionnel)
|
|
134
134
|
const themeContext = useThemeSafe()
|
|
135
|
-
const contextTheme = themeContext?.
|
|
135
|
+
const contextTheme = themeContext?.currentTheme
|
|
136
136
|
const themes = themeContext?.themes || []
|
|
137
|
-
const
|
|
137
|
+
const changeTheme = themeContext?.changeTheme
|
|
138
138
|
|
|
139
139
|
const [currentTheme, setCurrentTheme] = useState<TweakCNTheme>(
|
|
140
140
|
initialTheme || {
|
|
@@ -180,17 +180,12 @@ const WakaThemeManager = React.forwardRef<HTMLDivElement, WakaThemeManagerProps>
|
|
|
180
180
|
})
|
|
181
181
|
|
|
182
182
|
// Mettre à jour le contexte de thème si disponible
|
|
183
|
-
if (
|
|
183
|
+
if (changeTheme) {
|
|
184
184
|
// Créer un thème compatible avec le contexte
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
label: theme.name,
|
|
188
|
-
description: theme.description || "",
|
|
189
|
-
previewColor: theme.colors.primary
|
|
190
|
-
}
|
|
191
|
-
setTheme(contextTheme.id)
|
|
185
|
+
const themeId = theme.name.toLowerCase().replace(/\s+/g, '-')
|
|
186
|
+
changeTheme(themeId)
|
|
192
187
|
}
|
|
193
|
-
}, [
|
|
188
|
+
}, [changeTheme])
|
|
194
189
|
|
|
195
190
|
// Charger un thème depuis une URL JSON
|
|
196
191
|
const loadThemeFromUrl = async (url: string) => {
|