@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,64 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaSponsoredCard } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaSponsoredCard> = {
|
|
5
|
+
title: "Sponsoring/WakaSponsoredCard",
|
|
6
|
+
component: WakaSponsoredCard,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: { control: "select", options: ["article", "product", "compact", "horizontal"], description: "Variante" },
|
|
11
|
+
showImage: { control: "boolean", description: "Afficher l'image" },
|
|
12
|
+
showDescription: { control: "boolean", description: "Afficher la description" },
|
|
13
|
+
showCta: { control: "boolean", description: "Afficher le CTA" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof WakaSponsoredCard>
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
args: { slotId: "slot-1", variant: "article", showImage: true, showDescription: true, showCta: true },
|
|
22
|
+
render: (args) => (
|
|
23
|
+
<div style={{ width: 350 }}>
|
|
24
|
+
<WakaSponsoredCard {...args} />
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Product: Story = {
|
|
30
|
+
args: { slotId: "slot-2", variant: "product", showImage: true, showDescription: true, showCta: true },
|
|
31
|
+
render: (args) => (
|
|
32
|
+
<div style={{ width: 300 }}>
|
|
33
|
+
<WakaSponsoredCard {...args} />
|
|
34
|
+
</div>
|
|
35
|
+
),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Compact: Story = {
|
|
39
|
+
args: { slotId: "slot-3", variant: "compact", showImage: true, showDescription: false },
|
|
40
|
+
render: (args) => (
|
|
41
|
+
<div style={{ width: 250 }}>
|
|
42
|
+
<WakaSponsoredCard {...args} />
|
|
43
|
+
</div>
|
|
44
|
+
),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Horizontal: Story = {
|
|
48
|
+
args: { slotId: "slot-4", variant: "horizontal", showImage: true, showDescription: true, showCta: true },
|
|
49
|
+
render: (args) => (
|
|
50
|
+
<div style={{ width: 600 }}>
|
|
51
|
+
<WakaSponsoredCard {...args} />
|
|
52
|
+
</div>
|
|
53
|
+
),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const NoImage: Story = {
|
|
57
|
+
args: { slotId: "slot-5", variant: "article", showImage: false, showDescription: true, showCta: true },
|
|
58
|
+
render: (args) => (
|
|
59
|
+
<div style={{ width: 350 }}>
|
|
60
|
+
<WakaSponsoredCard {...args} />
|
|
61
|
+
</div>
|
|
62
|
+
),
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaSponsoredFeed } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaSponsoredFeed> = {
|
|
5
|
+
title: "Sponsoring/WakaSponsoredFeed",
|
|
6
|
+
component: WakaSponsoredFeed,
|
|
7
|
+
parameters: { layout: "padded" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
adFrequency: { control: "number", description: "Fréquence des pubs" },
|
|
11
|
+
adStartPosition: { control: "number", description: "Position de départ" },
|
|
12
|
+
maxAds: { control: "number", description: "Max pubs affichées" },
|
|
13
|
+
adVariant: { control: "select", options: ["article", "product", "compact", "horizontal"], description: "Variante des pubs" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof WakaSponsoredFeed>
|
|
19
|
+
|
|
20
|
+
const items = Array.from({ length: 10 }, (_, i) => ({
|
|
21
|
+
id: `item-${i}`,
|
|
22
|
+
title: `Article ${i + 1}`,
|
|
23
|
+
content: `Contenu de l'article numéro ${i + 1}`,
|
|
24
|
+
}))
|
|
25
|
+
|
|
26
|
+
const adSlots = [
|
|
27
|
+
{ slotId: "feed-ad-1" },
|
|
28
|
+
{ slotId: "feed-ad-2" },
|
|
29
|
+
{ slotId: "feed-ad-3" },
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
const renderItem = (item: typeof items[0]) => (
|
|
33
|
+
<div key={item.id} className="tw-p-4 tw-border tw-rounded-lg tw-bg-card">
|
|
34
|
+
<h3 className="tw-font-semibold">{item.title}</h3>
|
|
35
|
+
<p className="tw-text-sm tw-text-muted-foreground">{item.content}</p>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export const Default: Story = {
|
|
40
|
+
args: { items, adSlots, renderItem, adFrequency: 3, adStartPosition: 2, adVariant: "compact" },
|
|
41
|
+
render: (args) => <WakaSponsoredFeed {...args} />,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const HighFrequency: Story = {
|
|
45
|
+
args: { items, adSlots, renderItem, adFrequency: 2, adStartPosition: 1, maxAds: 3 },
|
|
46
|
+
render: (args) => <WakaSponsoredFeed {...args} />,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const LowFrequency: Story = {
|
|
50
|
+
args: { items, adSlots, renderItem, adFrequency: 5, adStartPosition: 4, maxAds: 2 },
|
|
51
|
+
render: (args) => <WakaSponsoredFeed {...args} />,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const ArticleVariant: Story = {
|
|
55
|
+
args: { items: items.slice(0, 6), adSlots, renderItem, adFrequency: 3, adVariant: "article" },
|
|
56
|
+
render: (args) => <WakaSponsoredFeed {...args} />,
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaSpotlight } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaSpotlight> = {
|
|
5
|
+
title: "Navigation/WakaSpotlight",
|
|
6
|
+
component: WakaSpotlight,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
isOpen: { control: "boolean", description: "Ouvert" },
|
|
11
|
+
placeholder: { control: "text", description: "Placeholder" },
|
|
12
|
+
showRecentSearches: { control: "boolean", description: "Recherches récentes" },
|
|
13
|
+
showCategories: { control: "boolean", description: "Catégories" },
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof WakaSpotlight>
|
|
19
|
+
|
|
20
|
+
const items = [
|
|
21
|
+
{ id: "1", title: "Accueil", category: "Pages", action: () => {} },
|
|
22
|
+
{ id: "2", title: "Paramètres", category: "Pages", action: () => {} },
|
|
23
|
+
{ id: "3", title: "Mon profil", category: "Compte", action: () => {} },
|
|
24
|
+
{ id: "4", title: "Déconnexion", category: "Compte", action: () => {} },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: { isOpen: true, items, placeholder: "Rechercher...", showRecentSearches: true, showCategories: true },
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<div style={{ width: 500, height: 400 }}>
|
|
31
|
+
<WakaSpotlight {...args} />
|
|
32
|
+
</div>
|
|
33
|
+
),
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const NoCategories: Story = {
|
|
37
|
+
args: { isOpen: true, items, placeholder: "Que cherchez-vous ?", showCategories: false },
|
|
38
|
+
render: (args) => (
|
|
39
|
+
<div style={{ width: 500, height: 400 }}>
|
|
40
|
+
<WakaSpotlight {...args} />
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Empty: Story = {
|
|
46
|
+
args: { isOpen: true, items: [], placeholder: "Rechercher..." },
|
|
47
|
+
render: (args) => (
|
|
48
|
+
<div style={{ width: 500, height: 300 }}>
|
|
49
|
+
<WakaSpotlight {...args} />
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaStatsHexagon, HexagonStat, HexagonProfile } from "./index"
|
|
3
|
+
|
|
4
|
+
const playerStats: HexagonStat[] = [
|
|
5
|
+
{ id: "strength", label: "Strength", value: 85, description: "Physical power" },
|
|
6
|
+
{ id: "speed", label: "Speed", value: 70, description: "Movement speed" },
|
|
7
|
+
{ id: "defense", label: "Defense", value: 60, description: "Damage resistance" },
|
|
8
|
+
{ id: "magic", label: "Magic", value: 45, description: "Magical power" },
|
|
9
|
+
{ id: "luck", label: "Luck", value: 90, description: "Critical hit chance" },
|
|
10
|
+
{ id: "stamina", label: "Stamina", value: 75, description: "Energy reserves" },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
const playerProfile: HexagonProfile = {
|
|
14
|
+
id: "player-1",
|
|
15
|
+
name: "Current Stats",
|
|
16
|
+
stats: [85, 70, 60, 45, 90, 75],
|
|
17
|
+
color: "#3b82f6",
|
|
18
|
+
fillOpacity: 0.3,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const comparisonProfile: HexagonProfile = {
|
|
22
|
+
id: "player-2",
|
|
23
|
+
name: "Opponent Stats",
|
|
24
|
+
stats: [60, 85, 70, 80, 50, 65],
|
|
25
|
+
color: "#ef4444",
|
|
26
|
+
fillOpacity: 0.2,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const meta: Meta<typeof WakaStatsHexagon> = {
|
|
30
|
+
title: "Components/Gamification/WakaStatsHexagon",
|
|
31
|
+
component: WakaStatsHexagon,
|
|
32
|
+
parameters: {
|
|
33
|
+
layout: "centered",
|
|
34
|
+
},
|
|
35
|
+
tags: ["autodocs"],
|
|
36
|
+
argTypes: {
|
|
37
|
+
size: {
|
|
38
|
+
control: { type: "number", min: 200, max: 500 },
|
|
39
|
+
description: "Hexagon size in pixels",
|
|
40
|
+
},
|
|
41
|
+
theme: {
|
|
42
|
+
control: "select",
|
|
43
|
+
options: ["default", "blue", "green", "purple", "orange", "pink", "cyan", "gradient"],
|
|
44
|
+
description: "Color theme",
|
|
45
|
+
},
|
|
46
|
+
levels: {
|
|
47
|
+
control: { type: "number", min: 2, max: 6 },
|
|
48
|
+
description: "Number of grid levels",
|
|
49
|
+
},
|
|
50
|
+
showGrid: {
|
|
51
|
+
control: "boolean",
|
|
52
|
+
description: "Show grid lines",
|
|
53
|
+
},
|
|
54
|
+
showLabels: {
|
|
55
|
+
control: "boolean",
|
|
56
|
+
description: "Show stat labels",
|
|
57
|
+
},
|
|
58
|
+
showValues: {
|
|
59
|
+
control: "boolean",
|
|
60
|
+
description: "Show values in labels",
|
|
61
|
+
},
|
|
62
|
+
showPoints: {
|
|
63
|
+
control: "boolean",
|
|
64
|
+
description: "Show data points",
|
|
65
|
+
},
|
|
66
|
+
showTooltips: {
|
|
67
|
+
control: "boolean",
|
|
68
|
+
description: "Enable tooltips",
|
|
69
|
+
},
|
|
70
|
+
animated: {
|
|
71
|
+
control: "boolean",
|
|
72
|
+
description: "Enable animations",
|
|
73
|
+
},
|
|
74
|
+
showLegend: {
|
|
75
|
+
control: "boolean",
|
|
76
|
+
description: "Show legend",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default meta
|
|
82
|
+
type Story = StoryObj<typeof WakaStatsHexagon>
|
|
83
|
+
|
|
84
|
+
export const Default: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
stats: playerStats,
|
|
87
|
+
profile: playerProfile,
|
|
88
|
+
size: 350,
|
|
89
|
+
theme: "default",
|
|
90
|
+
levels: 4,
|
|
91
|
+
showGrid: true,
|
|
92
|
+
showLabels: true,
|
|
93
|
+
showValues: true,
|
|
94
|
+
showPoints: true,
|
|
95
|
+
showTooltips: true,
|
|
96
|
+
animated: true,
|
|
97
|
+
},
|
|
98
|
+
render: (args) => <WakaStatsHexagon {...args} />,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const WithComparison: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
stats: playerStats,
|
|
104
|
+
profile: playerProfile,
|
|
105
|
+
comparisonProfile: comparisonProfile,
|
|
106
|
+
size: 400,
|
|
107
|
+
theme: "default",
|
|
108
|
+
showGrid: true,
|
|
109
|
+
showLabels: true,
|
|
110
|
+
showPoints: true,
|
|
111
|
+
showLegend: true,
|
|
112
|
+
animated: true,
|
|
113
|
+
},
|
|
114
|
+
render: (args) => <WakaStatsHexagon {...args} />,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const Purple: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
stats: playerStats,
|
|
120
|
+
profile: { ...playerProfile, color: "#8b5cf6" },
|
|
121
|
+
size: 300,
|
|
122
|
+
theme: "purple",
|
|
123
|
+
showGrid: true,
|
|
124
|
+
showLabels: true,
|
|
125
|
+
showValues: false,
|
|
126
|
+
animated: true,
|
|
127
|
+
},
|
|
128
|
+
render: (args) => <WakaStatsHexagon {...args} />,
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const Minimal: Story = {
|
|
132
|
+
args: {
|
|
133
|
+
stats: playerStats,
|
|
134
|
+
profile: playerProfile,
|
|
135
|
+
size: 250,
|
|
136
|
+
theme: "cyan",
|
|
137
|
+
showGrid: false,
|
|
138
|
+
showLabels: true,
|
|
139
|
+
showValues: false,
|
|
140
|
+
showPoints: false,
|
|
141
|
+
animated: true,
|
|
142
|
+
},
|
|
143
|
+
render: (args) => <WakaStatsHexagon {...args} />,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const Large: Story = {
|
|
147
|
+
args: {
|
|
148
|
+
stats: playerStats,
|
|
149
|
+
profile: playerProfile,
|
|
150
|
+
size: 450,
|
|
151
|
+
theme: "gradient",
|
|
152
|
+
levels: 5,
|
|
153
|
+
showGrid: true,
|
|
154
|
+
showLabels: true,
|
|
155
|
+
showValues: true,
|
|
156
|
+
showPoints: true,
|
|
157
|
+
animated: true,
|
|
158
|
+
},
|
|
159
|
+
render: (args) => <WakaStatsHexagon {...args} />,
|
|
160
|
+
}
|
|
161
|
+
|