@wakastellar/ui 2.4.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
- package/dist/blocks/clamav-service-status/index.d.ts +35 -0
- package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
- package/dist/blocks/index.d.ts +18 -9
- package/dist/blocks/quarantine-manager/index.d.ts +27 -0
- package/dist/blocks/scan-history-log/index.d.ts +28 -0
- package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
- package/dist/blocks/scan-report-generator/index.d.ts +47 -0
- package/dist/blocks/signature-database-manager/index.d.ts +39 -0
- package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
- package/dist/components/index.d.ts +4 -4
- package/dist/components/waka-signature-pad/index.d.ts +1 -1
- package/dist/exceljs.min-BcLLX0PC.js +29 -0
- package/dist/exceljs.min-KOayaaQ4.mjs +23013 -0
- package/dist/export.cjs.js +1 -1
- package/dist/export.d.ts +2 -2
- package/dist/export.es.js +1 -1
- package/dist/index.cjs.js +136 -136
- package/dist/index.es.js +29978 -27215
- package/dist/stories/Button.stories.d.ts +1 -1
- package/dist/stories/Header.stories.d.ts +1 -1
- package/dist/stories/Page.stories.d.ts +1 -1
- package/dist/useDataTableImport-COVnvslz.js +9 -0
- package/dist/useDataTableImport-DAlxBY8w.mjs +237 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/package.json +6 -5
- package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +291 -0
- package/src/blocks/antivirus-dashboard/index.tsx +525 -0
- package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +195 -0
- package/src/blocks/clamav-service-status/index.tsx +370 -0
- package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +257 -0
- package/src/blocks/file-scan-uploader/index.tsx +311 -0
- package/src/blocks/index.ts +163 -11
- package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +209 -0
- package/src/blocks/quarantine-manager/index.tsx +435 -0
- package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +231 -0
- package/src/blocks/scan-history-log/index.tsx +406 -0
- package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +106 -0
- package/src/blocks/scan-policy-editor/index.tsx +418 -0
- package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +232 -0
- package/src/blocks/scan-report-generator/index.tsx +612 -0
- package/src/blocks/sidebar/index.tsx +2 -1
- package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +279 -0
- package/src/blocks/signature-database-manager/index.tsx +470 -0
- package/src/blocks/theme-creator-block/index.tsx +16 -2
- package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +152 -0
- package/src/blocks/threat-alert-banner/index.tsx +320 -0
- package/src/components/DataTable/DataTable.stories.tsx +203 -0
- package/src/components/DataTable/hooks/useDataTableExport.ts +38 -31
- package/src/components/DataTable/hooks/useDataTableImport.ts +31 -20
- package/src/components/error-boundary/ErrorBoundary.stories.tsx +125 -0
- package/src/components/index.ts +45 -4
- package/src/components/language-selector/LanguageSelector.stories.tsx +112 -0
- package/src/components/theme-selector/ThemeSelector.stories.tsx +77 -0
- package/src/components/toaster/Toaster.stories.tsx +67 -0
- package/src/components/waka-activity-feed/WakaActivityFeed.stories.tsx +116 -0
- package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +102 -0
- package/src/components/waka-ad-fallback/WakaAdFallback.stories.tsx +117 -0
- package/src/components/waka-ad-inline/WakaAdInline.stories.tsx +105 -0
- package/src/components/waka-ad-interstitial/WakaAdInterstitial.stories.tsx +92 -0
- package/src/components/waka-ad-placeholder/WakaAdPlaceholder.stories.tsx +89 -0
- package/src/components/waka-ad-provider/WakaAdProvider.stories.tsx +110 -0
- package/src/components/waka-ad-sidebar/WakaAdSidebar.stories.tsx +89 -0
- package/src/components/waka-ad-sidebar/index.tsx +3 -2
- package/src/components/waka-ad-sticky-footer/WakaAdStickyFooter.stories.tsx +88 -0
- package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +46 -0
- package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +166 -0
- package/src/components/waka-alert-panel/WakaAlertPanel.stories.tsx +45 -0
- package/src/components/waka-alert-stack/WakaAlertStack.stories.tsx +62 -0
- package/src/components/waka-allocation-matrix/WakaAllocationMatrix.stories.tsx +68 -0
- package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +63 -0
- package/src/components/waka-audit-log/WakaAuditLog.stories.tsx +73 -0
- package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +132 -172
- package/src/components/waka-biometric-prompt/WakaBiometricPrompt.stories.tsx +48 -0
- package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +74 -191
- package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +40 -0
- package/src/components/waka-budget-burn/WakaBudgetBurn.stories.tsx +86 -0
- package/src/components/waka-capacity-planner/WakaCapacityPlanner.stories.tsx +273 -0
- package/src/components/waka-cart-summary/WakaCartSummary.stories.tsx +176 -0
- package/src/components/waka-cart-summary/index.tsx +19 -10
- package/src/components/waka-challenge-timer/WakaChallengeTimer.stories.tsx +98 -0
- package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +118 -0
- package/src/components/waka-checklist/WakaChecklist.stories.tsx +71 -0
- package/src/components/waka-checkout-stepper/WakaCheckoutStepper.stories.tsx +102 -0
- package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +56 -0
- package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +99 -155
- package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +128 -0
- package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +45 -0
- package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +76 -0
- package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +143 -0
- package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +52 -0
- package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +41 -0
- package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +126 -0
- package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +120 -0
- package/src/components/waka-datetime-picker.form-integration/WakaDateTimePickerForm.stories.tsx +79 -0
- package/src/components/waka-dependency-tree/WakaDependencyTree.stories.tsx +72 -0
- package/src/components/waka-device-trust/WakaDeviceTrust.stories.tsx +109 -0
- package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +87 -0
- package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +47 -0
- package/src/components/waka-feature-flag-row/WakaFeatureFlagRow.stories.tsx +188 -0
- package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +118 -174
- package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +53 -0
- package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +137 -0
- package/src/components/waka-hotspot/WakaHotspot.stories.tsx +56 -0
- package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +169 -0
- package/src/components/waka-kpi-dashboard/WakaKpiDashboard.stories.tsx +46 -0
- package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +94 -75
- package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +45 -0
- package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +61 -0
- package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +40 -0
- package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +140 -0
- package/src/components/waka-milestone-road/WakaMilestoneRoad.stories.tsx +143 -0
- package/src/components/waka-orbital-menu/WakaOrbitalMenu.stories.tsx +54 -0
- package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +163 -0
- package/src/components/waka-outstream-video/WakaOutstreamVideo.stories.tsx +94 -0
- package/src/components/waka-pagination/WakaPagination.stories.tsx +110 -280
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +132 -268
- package/src/components/waka-payment-method-picker/WakaPaymentMethodPicker.stories.tsx +141 -0
- package/src/components/waka-permission-matrix/WakaPermissionMatrix.stories.tsx +124 -0
- package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +56 -0
- package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +96 -0
- package/src/components/waka-power-up/WakaPowerUp.stories.tsx +121 -0
- package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +49 -0
- package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +159 -0
- package/src/components/waka-product-card/WakaProductCard.stories.tsx +202 -0
- package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +57 -0
- package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +51 -0
- package/src/components/waka-rank-badge/WakaRankBadge.stories.tsx +108 -0
- package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +51 -0
- package/src/components/waka-reaction-picker/WakaReactionPicker.stories.tsx +52 -0
- package/src/components/waka-region-map/WakaRegionMap.stories.tsx +181 -0
- package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +70 -0
- package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +108 -197
- package/src/components/waka-rollback-slider/WakaRollbackSlider.stories.tsx +41 -0
- package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +64 -0
- package/src/components/waka-season-pass/WakaSeasonPass.stories.tsx +107 -0
- package/src/components/waka-security-scan-result/WakaSecurityScanResult.stories.tsx +146 -0
- package/src/components/waka-security-score/WakaSecurityScore.stories.tsx +63 -0
- package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +68 -0
- package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +159 -0
- package/src/components/waka-signature-pad/index.tsx +5 -3
- package/src/components/waka-sla-tracker/WakaSlaTracker.stories.tsx +65 -0
- package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +66 -0
- package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +60 -0
- package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +64 -0
- package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +58 -0
- package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +53 -0
- package/src/components/waka-stats-hexagon/WakaStatsHexagon.stories.tsx +161 -0
- package/src/components/waka-stepper/WakaStepper.stories.tsx +137 -410
- package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +51 -0
- package/src/components/waka-tag-input/WakaTagInput.stories.tsx +224 -0
- package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +50 -0
- package/src/components/waka-theme-creator/WakaThemeCreator.stories.tsx +58 -0
- package/src/components/waka-theme-manager/WakaThemeManager.stories.tsx +298 -0
- package/src/components/waka-theme-manager/index.tsx +6 -11
- package/src/components/waka-thread-view/WakaThreadView.stories.tsx +143 -0
- package/src/components/waka-timeline/WakaTimeline.stories.tsx +171 -324
- package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +92 -0
- package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +89 -0
- package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +234 -129
- package/src/components/waka-treemap-chart/index.tsx +2 -2
- package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +142 -0
- package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +134 -0
- package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +138 -0
- package/src/components/waka-video-call/WakaVideoCall.stories.tsx +186 -0
- package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +100 -0
- package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +190 -0
- package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +87 -0
- package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +29 -29
- package/dist/useDataTableImport-D8R2HQl6.mjs +0 -229
- package/dist/useDataTableImport-S_hhA5Wo.js +0 -9
- package/src/components/DataTable/README.md +0 -446
|
@@ -1,39 +1,27 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from
|
|
2
|
-
import { WakaBreadcrumb } from
|
|
3
|
-
import
|
|
4
|
-
import * as React from 'react'
|
|
5
|
-
import { Home, Settings, User, FileText, Folder } from 'lucide-react'
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaBreadcrumb, type BreadcrumbItem } from "./index"
|
|
3
|
+
import { Home, Folder, File, Settings, User } from "lucide-react"
|
|
6
4
|
|
|
7
5
|
const meta: Meta<typeof WakaBreadcrumb> = {
|
|
8
|
-
title:
|
|
6
|
+
title: "Navigation/WakaBreadcrumb",
|
|
9
7
|
component: WakaBreadcrumb,
|
|
10
8
|
parameters: {
|
|
11
|
-
layout:
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: 'A breadcrumb navigation component for showing the current page location within a hierarchy.',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
9
|
+
layout: "padded",
|
|
17
10
|
},
|
|
18
|
-
tags: [
|
|
11
|
+
tags: ["autodocs"],
|
|
19
12
|
argTypes: {
|
|
20
|
-
size: {
|
|
21
|
-
control: 'select',
|
|
22
|
-
options: ['sm', 'md', 'lg'],
|
|
23
|
-
description: 'Size of the breadcrumb',
|
|
24
|
-
},
|
|
25
|
-
variant: {
|
|
26
|
-
control: 'select',
|
|
27
|
-
options: ['default', 'ghost', 'outline'],
|
|
28
|
-
description: 'Visual variant',
|
|
29
|
-
},
|
|
30
13
|
showHomeIcon: {
|
|
31
|
-
control:
|
|
32
|
-
description: '
|
|
14
|
+
control: "boolean",
|
|
15
|
+
description: "Afficher l'icône Home pour le premier élément",
|
|
33
16
|
},
|
|
34
17
|
maxItems: {
|
|
35
|
-
control:
|
|
36
|
-
description:
|
|
18
|
+
control: { type: "number", min: 2, max: 10 },
|
|
19
|
+
description: "Nombre maximum d'éléments visibles",
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
control: "select",
|
|
23
|
+
options: ["sm", "md", "lg"],
|
|
24
|
+
description: "Taille du breadcrumb",
|
|
37
25
|
},
|
|
38
26
|
},
|
|
39
27
|
}
|
|
@@ -42,196 +30,91 @@ export default meta
|
|
|
42
30
|
type Story = StoryObj<typeof WakaBreadcrumb>
|
|
43
31
|
|
|
44
32
|
const basicItems: BreadcrumbItem[] = [
|
|
45
|
-
{ label:
|
|
46
|
-
{ label:
|
|
47
|
-
{ label:
|
|
48
|
-
{ label:
|
|
33
|
+
{ label: "Accueil", href: "/" },
|
|
34
|
+
{ label: "Produits", href: "/products" },
|
|
35
|
+
{ label: "Électronique", href: "/products/electronics" },
|
|
36
|
+
{ label: "Smartphones" },
|
|
49
37
|
]
|
|
50
38
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
}
|
|
39
|
+
const itemsWithIcons: BreadcrumbItem[] = [
|
|
40
|
+
{ label: "Accueil", href: "/", icon: <Home className="tw-h-4 tw-w-4" /> },
|
|
41
|
+
{ label: "Paramètres", href: "/settings", icon: <Settings className="tw-h-4 tw-w-4" /> },
|
|
42
|
+
{ label: "Profil", href: "/settings/profile", icon: <User className="tw-h-4 tw-w-4" /> },
|
|
43
|
+
{ label: "Éditer" },
|
|
44
|
+
]
|
|
56
45
|
|
|
57
|
-
|
|
46
|
+
const longItems: BreadcrumbItem[] = [
|
|
47
|
+
{ label: "Accueil", href: "/" },
|
|
48
|
+
{ label: "Documents", href: "/documents" },
|
|
49
|
+
{ label: "Projets", href: "/documents/projects" },
|
|
50
|
+
{ label: "2024", href: "/documents/projects/2024" },
|
|
51
|
+
{ label: "Q1", href: "/documents/projects/2024/q1" },
|
|
52
|
+
{ label: "Rapports", href: "/documents/projects/2024/q1/reports" },
|
|
53
|
+
{ label: "Rapport final" },
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {
|
|
58
57
|
args: {
|
|
59
58
|
items: basicItems,
|
|
60
59
|
showHomeIcon: true,
|
|
61
60
|
},
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const Sizes: Story = {
|
|
65
|
-
render: () => (
|
|
66
|
-
<div className="space-y-6">
|
|
67
|
-
<div>
|
|
68
|
-
<p className="text-sm text-muted-foreground mb-2">Small</p>
|
|
69
|
-
<WakaBreadcrumb items={basicItems} size="sm" />
|
|
70
|
-
</div>
|
|
71
|
-
<div>
|
|
72
|
-
<p className="text-sm text-muted-foreground mb-2">Medium (Default)</p>
|
|
73
|
-
<WakaBreadcrumb items={basicItems} size="md" />
|
|
74
|
-
</div>
|
|
75
|
-
<div>
|
|
76
|
-
<p className="text-sm text-muted-foreground mb-2">Large</p>
|
|
77
|
-
<WakaBreadcrumb items={basicItems} size="lg" />
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
),
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const Variants: Story = {
|
|
84
|
-
render: () => (
|
|
85
|
-
<div className="space-y-6">
|
|
86
|
-
<div>
|
|
87
|
-
<p className="text-sm text-muted-foreground mb-2">Default</p>
|
|
88
|
-
<WakaBreadcrumb items={basicItems} variant="default" />
|
|
89
|
-
</div>
|
|
90
|
-
<div>
|
|
91
|
-
<p className="text-sm text-muted-foreground mb-2">Ghost</p>
|
|
92
|
-
<WakaBreadcrumb items={basicItems} variant="ghost" />
|
|
93
|
-
</div>
|
|
94
|
-
<div>
|
|
95
|
-
<p className="text-sm text-muted-foreground mb-2">Outline</p>
|
|
96
|
-
<WakaBreadcrumb items={basicItems} variant="outline" />
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
),
|
|
61
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
100
62
|
}
|
|
101
63
|
|
|
102
64
|
export const WithIcons: Story = {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{ label: 'Settings', href: '/settings', icon: <Settings className="h-4 w-4" /> },
|
|
107
|
-
{ label: 'Profile', href: '/settings/profile', icon: <User className="h-4 w-4" /> },
|
|
108
|
-
{ label: 'Edit', icon: <FileText className="h-4 w-4" /> },
|
|
109
|
-
]
|
|
110
|
-
|
|
111
|
-
return <WakaBreadcrumb items={itemsWithIcons} />
|
|
65
|
+
args: {
|
|
66
|
+
items: itemsWithIcons,
|
|
67
|
+
showHomeIcon: false,
|
|
112
68
|
},
|
|
69
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
113
70
|
}
|
|
114
71
|
|
|
115
72
|
export const Collapsed: Story = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{ label: 'Work', href: '/documents/work' },
|
|
121
|
-
{ label: 'Projects', href: '/documents/work/projects' },
|
|
122
|
-
{ label: '2024', href: '/documents/work/projects/2024' },
|
|
123
|
-
{ label: 'Q1', href: '/documents/work/projects/2024/q1' },
|
|
124
|
-
{ label: 'Reports' },
|
|
125
|
-
]
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<div className="space-y-6">
|
|
129
|
-
<div>
|
|
130
|
-
<p className="text-sm text-muted-foreground mb-2">Max 4 items (collapsed)</p>
|
|
131
|
-
<WakaBreadcrumb items={longPath} maxItems={4} />
|
|
132
|
-
</div>
|
|
133
|
-
<div>
|
|
134
|
-
<p className="text-sm text-muted-foreground mb-2">All items visible</p>
|
|
135
|
-
<WakaBreadcrumb items={longPath} />
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
)
|
|
73
|
+
args: {
|
|
74
|
+
items: longItems,
|
|
75
|
+
maxItems: 4,
|
|
76
|
+
showHomeIcon: true,
|
|
139
77
|
},
|
|
78
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
140
79
|
}
|
|
141
80
|
|
|
142
81
|
export const CustomSeparator: Story = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<WakaBreadcrumb
|
|
148
|
-
items={basicItems}
|
|
149
|
-
separator={<span className="text-muted-foreground mx-2">/</span>}
|
|
150
|
-
/>
|
|
151
|
-
</div>
|
|
152
|
-
<div>
|
|
153
|
-
<p className="text-sm text-muted-foreground mb-2">Arrow separator</p>
|
|
154
|
-
<WakaBreadcrumb
|
|
155
|
-
items={basicItems}
|
|
156
|
-
separator={<span className="text-muted-foreground mx-2">→</span>}
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
<div>
|
|
160
|
-
<p className="text-sm text-muted-foreground mb-2">Dot separator</p>
|
|
161
|
-
<WakaBreadcrumb
|
|
162
|
-
items={basicItems}
|
|
163
|
-
separator={<span className="text-muted-foreground mx-2">•</span>}
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
),
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export const WithClickHandler: Story = {
|
|
171
|
-
render: () => {
|
|
172
|
-
const handleClick = (item: BreadcrumbItem, index: number) => {
|
|
173
|
-
alert(`Clicked: ${item.label} at index ${index}`)
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<WakaBreadcrumb
|
|
178
|
-
items={basicItems}
|
|
179
|
-
onItemClick={handleClick}
|
|
180
|
-
/>
|
|
181
|
-
)
|
|
82
|
+
args: {
|
|
83
|
+
items: basicItems,
|
|
84
|
+
separator: "/",
|
|
85
|
+
showHomeIcon: false,
|
|
182
86
|
},
|
|
87
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
183
88
|
}
|
|
184
89
|
|
|
185
|
-
export const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
{ label:
|
|
189
|
-
{ label:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
]
|
|
193
|
-
|
|
194
|
-
return <WakaBreadcrumb items={itemsWithDisabled} />
|
|
90
|
+
export const TwoItems: Story = {
|
|
91
|
+
args: {
|
|
92
|
+
items: [
|
|
93
|
+
{ label: "Tableau de bord", href: "/dashboard" },
|
|
94
|
+
{ label: "Statistiques" },
|
|
95
|
+
],
|
|
96
|
+
showHomeIcon: true,
|
|
195
97
|
},
|
|
98
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
196
99
|
}
|
|
197
100
|
|
|
198
|
-
export const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{ label: 'Users', href: '/users', icon: <Folder className="h-4 w-4" /> },
|
|
203
|
-
{ label: 'john', href: '/users/john', icon: <Folder className="h-4 w-4" /> },
|
|
204
|
-
{ label: 'Documents', href: '/users/john/documents', icon: <Folder className="h-4 w-4" /> },
|
|
205
|
-
{ label: 'report.pdf', icon: <FileText className="h-4 w-4" /> },
|
|
206
|
-
]
|
|
207
|
-
|
|
208
|
-
return (
|
|
209
|
-
<div className="border rounded-lg p-4 w-[500px]">
|
|
210
|
-
<div className="bg-muted/50 rounded p-2">
|
|
211
|
-
<WakaBreadcrumb items={filePath} showHomeIcon={false} size="sm" />
|
|
212
|
-
</div>
|
|
213
|
-
<div className="mt-4 text-sm text-muted-foreground">
|
|
214
|
-
Current location: /users/john/documents/report.pdf
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
)
|
|
101
|
+
export const SingleItem: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
items: [{ label: "Accueil" }],
|
|
104
|
+
showHomeIcon: true,
|
|
218
105
|
},
|
|
106
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
219
107
|
}
|
|
220
108
|
|
|
221
|
-
export const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
{ label:
|
|
225
|
-
{ label:
|
|
226
|
-
{ label:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<div className="border-b pb-4 w-[600px]">
|
|
231
|
-
<WakaBreadcrumb items={dashboardPath} showHomeIcon />
|
|
232
|
-
<h1 className="text-2xl font-bold mt-4">User Metrics</h1>
|
|
233
|
-
<p className="text-muted-foreground">View detailed user engagement metrics</p>
|
|
234
|
-
</div>
|
|
235
|
-
)
|
|
109
|
+
export const WithDisabledItem: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
items: [
|
|
112
|
+
{ label: "Accueil", href: "/" },
|
|
113
|
+
{ label: "Archive", href: "/archive", disabled: true },
|
|
114
|
+
{ label: "2023", href: "/archive/2023" },
|
|
115
|
+
{ label: "Document" },
|
|
116
|
+
],
|
|
117
|
+
showHomeIcon: true,
|
|
236
118
|
},
|
|
119
|
+
render: (args) => <WakaBreadcrumb {...args} />,
|
|
237
120
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaBreadcrumbPath, type BreadcrumbPathItem } from "./index"
|
|
3
|
+
import { Home, Folder, File } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WakaBreadcrumbPath> = {
|
|
6
|
+
title: "Navigation/WakaBreadcrumbPath",
|
|
7
|
+
component: WakaBreadcrumbPath,
|
|
8
|
+
parameters: { layout: "padded" },
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
maxItems: { control: "number", description: "Items max visibles" },
|
|
12
|
+
showIcons: { control: "boolean", description: "Afficher les icônes" },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof WakaBreadcrumbPath>
|
|
18
|
+
|
|
19
|
+
const items: BreadcrumbPathItem[] = [
|
|
20
|
+
{ id: "1", label: "Accueil", href: "/", icon: <Home className="tw-h-4 tw-w-4" /> },
|
|
21
|
+
{ id: "2", label: "Documents", href: "/docs", icon: <Folder className="tw-h-4 tw-w-4" /> },
|
|
22
|
+
{ id: "3", label: "Projets", href: "/docs/projects", icon: <Folder className="tw-h-4 tw-w-4" /> },
|
|
23
|
+
{ id: "4", label: "Rapport.pdf", icon: <File className="tw-h-4 tw-w-4" /> },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export const Default: Story = {
|
|
27
|
+
args: { items, showIcons: true },
|
|
28
|
+
render: (args) => <WakaBreadcrumbPath {...args} />,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Collapsed: Story = {
|
|
32
|
+
args: { items, maxItems: 3, showIcons: true },
|
|
33
|
+
render: (args) => <WakaBreadcrumbPath {...args} />,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const NoIcons: Story = {
|
|
37
|
+
args: { items, showIcons: false },
|
|
38
|
+
render: (args) => <WakaBreadcrumbPath {...args} />,
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
|
+
import { WakaBudgetBurn, type SpendDataPoint, type BudgetCategory } from "./index"
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaBudgetBurn> = {
|
|
5
|
+
title: "DevOps/WakaBudgetBurn",
|
|
6
|
+
component: WakaBudgetBurn,
|
|
7
|
+
parameters: { layout: "centered" },
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
budget: { control: "number", description: "Budget total" },
|
|
11
|
+
currency: { control: "text", description: "Devise" },
|
|
12
|
+
showProjection: { control: "boolean", description: "Afficher la projection" },
|
|
13
|
+
showIdealLine: { control: "boolean", description: "Afficher la ligne ideale" },
|
|
14
|
+
showCategories: { control: "boolean", description: "Afficher les categories" },
|
|
15
|
+
showTrends: { control: "boolean", description: "Afficher les tendances" },
|
|
16
|
+
animated: { control: "boolean", description: "Animations activees" },
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default meta
|
|
21
|
+
type Story = StoryObj<typeof WakaBudgetBurn>
|
|
22
|
+
|
|
23
|
+
const spendHistory: SpendDataPoint[] = Array.from({ length: 30 }, (_, i) => ({
|
|
24
|
+
date: new Date(Date.now() - (30 - i) * 24 * 60 * 60 * 1000),
|
|
25
|
+
amount: 300 + Math.random() * 200,
|
|
26
|
+
}))
|
|
27
|
+
|
|
28
|
+
const categories: BudgetCategory[] = [
|
|
29
|
+
{ id: "compute", name: "Compute", budget: 5000, spent: 3200, color: "#3b82f6" },
|
|
30
|
+
{ id: "storage", name: "Storage", budget: 2000, spent: 1800, color: "#10b981" },
|
|
31
|
+
{ id: "network", name: "Network", budget: 1000, spent: 600, color: "#f59e0b" },
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
budget: 10000,
|
|
37
|
+
spendHistory,
|
|
38
|
+
categories,
|
|
39
|
+
startDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
|
|
40
|
+
endDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
|
|
41
|
+
showProjection: true,
|
|
42
|
+
showIdealLine: true,
|
|
43
|
+
showCategories: true,
|
|
44
|
+
showTrends: true,
|
|
45
|
+
currency: "EUR",
|
|
46
|
+
},
|
|
47
|
+
render: (args) => (
|
|
48
|
+
<div style={{ width: 500 }}>
|
|
49
|
+
<WakaBudgetBurn {...args} />
|
|
50
|
+
</div>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const OverBudget: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
budget: 5000,
|
|
57
|
+
spendHistory: spendHistory.map(p => ({ ...p, amount: p.amount * 1.5 })),
|
|
58
|
+
startDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
|
|
59
|
+
endDate: new Date(Date.now() + 10 * 24 * 60 * 60 * 1000),
|
|
60
|
+
showProjection: true,
|
|
61
|
+
showIdealLine: true,
|
|
62
|
+
currency: "EUR",
|
|
63
|
+
},
|
|
64
|
+
render: (args) => (
|
|
65
|
+
<div style={{ width: 500 }}>
|
|
66
|
+
<WakaBudgetBurn {...args} />
|
|
67
|
+
</div>
|
|
68
|
+
),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const UnderBudget: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
budget: 10000,
|
|
74
|
+
spendHistory: spendHistory.slice(0, 10).map(p => ({ ...p, amount: p.amount * 0.3 })),
|
|
75
|
+
startDate: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
|
|
76
|
+
endDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
|
|
77
|
+
showProjection: true,
|
|
78
|
+
showIdealLine: true,
|
|
79
|
+
currency: "$",
|
|
80
|
+
},
|
|
81
|
+
render: (args) => (
|
|
82
|
+
<div style={{ width: 500 }}>
|
|
83
|
+
<WakaBudgetBurn {...args} />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
}
|