@wakastellar/ui 2.3.4 → 2.4.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/dashboard/index.d.ts +4 -1
- package/dist/blocks/empty-states/index.d.ts +4 -1
- package/dist/blocks/error-pages/index.d.ts +4 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/landing/index.d.ts +4 -1
- package/dist/blocks/pricing/index.d.ts +5 -1
- package/dist/blocks/sidebar/index.d.ts +5 -1
- package/dist/index.cjs.js +130 -130
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +7905 -7856
- package/dist/stories/Button.d.ts +14 -0
- package/dist/stories/Button.stories.d.ts +8 -0
- package/dist/stories/Header.d.ts +11 -0
- package/dist/stories/Header.stories.d.ts +6 -0
- package/dist/stories/Page.d.ts +2 -0
- package/dist/stories/Page.stories.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/link.d.ts +23 -0
- package/package.json +11 -3
- package/src/blocks/activity-timeline/ActivityTimeline.stories.tsx +460 -0
- package/src/blocks/apm-overview/APMOverview.stories.tsx +435 -0
- package/src/blocks/auth-2fa/Auth2FA.stories.tsx +308 -0
- package/src/blocks/calendar-view/CalendarView.stories.tsx +398 -0
- package/src/blocks/chat/Chat.stories.tsx +466 -0
- package/src/blocks/chat-interface/ChatInterface.stories.tsx +412 -0
- package/src/blocks/checkout-flow/CheckoutFlow.stories.tsx +408 -0
- package/src/blocks/cicd-builder/CICDBuilder.stories.tsx +499 -0
- package/src/blocks/cloud-cost-dashboard/CloudCostDashboard.stories.tsx +356 -0
- package/src/blocks/container-orchestrator/ContainerOrchestrator.stories.tsx +461 -0
- package/src/blocks/dashboard/Dashboard.stories.tsx +559 -0
- package/src/blocks/dashboard/index.tsx +68 -27
- package/src/blocks/dashboard-kpi/DashboardKPI.stories.tsx +422 -0
- package/src/blocks/database-admin/DatabaseAdmin.stories.tsx +393 -0
- package/src/blocks/deployment-dashboard/DeploymentDashboard.stories.tsx +457 -0
- package/src/blocks/empty-states/EmptyStates.stories.tsx +467 -0
- package/src/blocks/empty-states/index.tsx +26 -8
- package/src/blocks/error-pages/ErrorPages.stories.tsx +401 -0
- package/src/blocks/error-pages/index.tsx +26 -8
- package/src/blocks/faq/FAQ.stories.tsx +416 -0
- package/src/blocks/file-manager/FileManager.stories.tsx +413 -0
- package/src/blocks/footer/Footer.stories.tsx +328 -0
- package/src/blocks/gitops-sync-status/GitOpsSyncStatus.stories.tsx +529 -0
- package/src/blocks/header/WakaHeader.stories.tsx +455 -0
- package/src/blocks/headtab/Headtab.stories.tsx +369 -0
- package/src/blocks/i18n-editor/I18nEditor.stories.tsx +451 -0
- package/src/blocks/incident-manager/IncidentManager.stories.tsx +464 -0
- package/src/blocks/index.ts +1 -1
- package/src/blocks/infrastructure-map/InfrastructureMap.stories.tsx +533 -0
- package/src/blocks/kanban-board/KanbanBoard.stories.tsx +494 -0
- package/src/blocks/landing/WakaLanding.stories.tsx +449 -0
- package/src/blocks/landing/index.tsx +125 -66
- package/src/blocks/language-selector/LanguageSelector.stories.tsx +345 -0
- package/src/blocks/layout/Layout.stories.tsx +373 -0
- package/src/blocks/login/Login.stories.tsx +443 -0
- package/src/blocks/on-call-schedule/OnCallSchedule.stories.tsx +381 -0
- package/src/blocks/player-profile/PlayerProfile.stories.tsx +316 -0
- package/src/blocks/pricing/WakaPricing.stories.tsx +530 -0
- package/src/blocks/pricing/index.tsx +38 -4
- package/src/blocks/profile/Profile.stories.tsx +371 -0
- package/src/blocks/release-notes/ReleaseNotes.stories.tsx +431 -0
- package/src/blocks/settings/Settings.stories.tsx +520 -0
- package/src/blocks/sidebar/WakaSidebar.stories.tsx +513 -0
- package/src/blocks/sidebar/index.tsx +49 -20
- package/src/blocks/theme-creator-block/ThemeCreatorBlock.stories.tsx +370 -0
- package/src/blocks/user-management/UserManagement.stories.tsx +411 -0
- package/src/blocks/wizard/Wizard.stories.tsx +683 -0
- package/src/components/accordion/Accordion.stories.tsx +93 -0
- package/src/components/alert/Alert.stories.tsx +95 -0
- package/src/components/alert-dialog/AlertDialog.stories.tsx +126 -0
- package/src/components/aspect-ratio/AspectRatio.stories.tsx +118 -0
- package/src/components/avatar/Avatar.stories.tsx +104 -0
- package/src/components/button/Button.stories.tsx +12 -1
- package/src/components/calendar/Calendar.stories.tsx +102 -0
- package/src/components/card/Card.stories.tsx +125 -0
- package/src/components/checkbox/Checkbox.stories.tsx +100 -0
- package/src/components/code/Code.stories.tsx +402 -0
- package/src/components/collapsible/Collapsible.stories.tsx +123 -0
- package/src/components/command/Command.stories.tsx +207 -0
- package/src/components/context-menu/ContextMenu.stories.tsx +220 -0
- package/src/components/dialog/Dialog.stories.tsx +157 -0
- package/src/components/dropdown-menu/DropdownMenu.stories.tsx +225 -0
- package/src/components/form/Form.stories.tsx +413 -0
- package/src/components/hover-card/HoverCard.stories.tsx +148 -0
- package/src/components/input-otp/InputOTP.stories.tsx +255 -0
- package/src/components/label/Label.stories.tsx +68 -0
- package/src/components/menubar/Menubar.stories.tsx +278 -0
- package/src/components/navigation-menu/NavigationMenu.stories.tsx +202 -0
- package/src/components/popover/Popover.stories.tsx +199 -0
- package/src/components/progress/Progress.stories.tsx +104 -0
- package/src/components/radio-group/RadioGroup.stories.tsx +138 -0
- package/src/components/scroll-area/ScrollArea.stories.tsx +153 -0
- package/src/components/select/Select.stories.tsx +146 -0
- package/src/components/separator/Separator.stories.tsx +117 -0
- package/src/components/sheet/Sheet.stories.tsx +195 -0
- package/src/components/skeleton/Skeleton.stories.tsx +114 -0
- package/src/components/slider/Slider.stories.tsx +157 -0
- package/src/components/switch/Switch.stories.tsx +114 -0
- package/src/components/table/Table.stories.tsx +153 -0
- package/src/components/tabs/Tabs.stories.tsx +155 -0
- package/src/components/textarea/Textarea.stories.tsx +116 -0
- package/src/components/toast/Toast.stories.tsx +160 -0
- package/src/components/toggle/Toggle.stories.tsx +125 -0
- package/src/components/tooltip/Tooltip.stories.tsx +133 -0
- package/src/components/typography/Typography.stories.tsx +207 -0
- package/src/components/waka-3d-pie-chart/Waka3DPieChart.stories.tsx +308 -0
- package/src/components/waka-achievement-unlock/WakaAchievementUnlock.stories.tsx +353 -0
- package/src/components/waka-artifact-list/WakaArtifactList.stories.tsx +258 -0
- package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +224 -0
- package/src/components/waka-badge-showcase/WakaBadgeShowcase.stories.tsx +269 -0
- package/src/components/waka-barcode/WakaBarcode.stories.tsx +227 -0
- package/src/components/waka-bottom-sheet/WakaBottomSheet.stories.tsx +408 -0
- package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +237 -0
- package/src/components/waka-build-matrix/WakaBuildMatrix.stories.tsx +328 -0
- package/src/components/waka-carousel/WakaCarousel.stories.tsx +296 -0
- package/src/components/waka-charts/WakaCharts.stories.tsx +519 -0
- package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +200 -0
- package/src/components/waka-combobox/WakaCombobox.stories.tsx +250 -0
- package/src/components/waka-container-list/WakaContainerList.stories.tsx +315 -0
- package/src/components/waka-contribution-graph/WakaContributionGraph.stories.tsx +354 -0
- package/src/components/waka-cost-breakdown/WakaCostBreakdown.stories.tsx +348 -0
- package/src/components/waka-daily-reward/WakaDailyReward.stories.tsx +365 -0
- package/src/components/waka-database-card/WakaDatabaseCard.stories.tsx +306 -0
- package/src/components/waka-date-range-picker/WakaDateRangePicker.stories.tsx +339 -0
- package/src/components/waka-datetime-picker/WakaDateTimePicker.stories.tsx +317 -0
- package/src/components/waka-deployment-lane/WakaDeploymentLane.stories.tsx +292 -0
- package/src/components/waka-dock/WakaDock.stories.tsx +332 -0
- package/src/components/waka-drawer/WakaDrawer.stories.tsx +437 -0
- package/src/components/waka-env-var-editor/WakaEnvVarEditor.stories.tsx +263 -0
- package/src/components/waka-error-shake/WakaErrorShake.stories.tsx +410 -0
- package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +239 -0
- package/src/components/waka-flow-diagram/WakaFlowDiagram.stories.tsx +365 -0
- package/src/components/waka-funnel-chart/WakaFunnelChart.stories.tsx +281 -0
- package/src/components/waka-glow-card/WakaGlowCard.stories.tsx +274 -0
- package/src/components/waka-haptic-button/WakaHapticButton.stories.tsx +349 -0
- package/src/components/waka-health-pulse/WakaHealthPulse.stories.tsx +293 -0
- package/src/components/waka-heatmap/WakaHeatmap.stories.tsx +376 -0
- package/src/components/waka-image/WakaImage.stories.tsx +255 -0
- package/src/components/waka-incident-timeline/WakaIncidentTimeline.stories.tsx +300 -0
- package/src/components/waka-kanban/WakaKanban.stories.tsx +399 -0
- package/src/components/waka-kubernetes-overview/WakaKubernetesOverview.stories.tsx +281 -0
- package/src/components/waka-leaderboard/WakaLeaderboard.stories.tsx +300 -0
- package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +313 -0
- package/src/components/waka-loading-orbit/WakaLoadingOrbit.stories.tsx +413 -0
- package/src/components/waka-log-viewer/WakaLogViewer.stories.tsx +312 -0
- package/src/components/waka-loot-box/WakaLootBox.stories.tsx +374 -0
- package/src/components/waka-metric-sparkline/WakaMetricSparkline.stories.tsx +312 -0
- package/src/components/waka-migration-list/WakaMigrationList.stories.tsx +289 -0
- package/src/components/waka-modal/WakaModal.stories.tsx +434 -0
- package/src/components/waka-morph-button/WakaMorphButton.stories.tsx +405 -0
- package/src/components/waka-network-topology/WakaNetworkTopology.stories.tsx +364 -0
- package/src/components/waka-notifications/WakaNotifications.stories.tsx +290 -0
- package/src/components/waka-number-input/WakaNumberInput.stories.tsx +282 -0
- package/src/components/waka-pagination/WakaPagination.stories.tsx +328 -0
- package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +318 -0
- package/src/components/waka-pipeline-view/WakaPipelineView.stories.tsx +386 -0
- package/src/components/waka-player-card/WakaPlayerCard.stories.tsx +333 -0
- package/src/components/waka-pod-card/WakaPodCard.stories.tsx +435 -0
- package/src/components/waka-qrcode/WakaQRCode.stories.tsx +232 -0
- package/src/components/waka-query-explain/WakaQueryExplain.stories.tsx +407 -0
- package/src/components/waka-quest-card/WakaQuestCard.stories.tsx +394 -0
- package/src/components/waka-quota-bar/WakaQuotaBar.stories.tsx +435 -0
- package/src/components/waka-radar-score/WakaRadarScore.stories.tsx +372 -0
- package/src/components/waka-resource-gauge/WakaResourceGauge.stories.tsx +366 -0
- package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +238 -0
- package/src/components/waka-sankey-diagram/WakaSankeyDiagram.stories.tsx +389 -0
- package/src/components/waka-scratch-card/WakaScratchCard.stories.tsx +388 -0
- package/src/components/waka-secret-card/WakaSecretCard.stories.tsx +314 -0
- package/src/components/waka-segmented-control/WakaSegmentedControl.stories.tsx +309 -0
- package/src/components/waka-server-rack/WakaServerRack.stories.tsx +382 -0
- package/src/components/waka-service-graph/WakaServiceGraph.stories.tsx +262 -0
- package/src/components/waka-skeleton-wave/WakaSkeletonWave.stories.tsx +321 -0
- package/src/components/waka-skill-tree/WakaSkillTree.stories.tsx +308 -0
- package/src/components/waka-spin-wheel/WakaSpinWheel.stories.tsx +368 -0
- package/src/components/waka-spinner/WakaSpinner.stories.tsx +156 -0
- package/src/components/waka-stat/WakaStat.stories.tsx +334 -0
- package/src/components/waka-status-matrix/WakaStatusMatrix.stories.tsx +331 -0
- package/src/components/waka-stepper/WakaStepper.stories.tsx +468 -0
- package/src/components/waka-streak-counter/WakaStreakCounter.stories.tsx +235 -0
- package/src/components/waka-success-explosion/WakaSuccessExplosion.stories.tsx +389 -0
- package/src/components/waka-tabs-morph/WakaTabsMorph.stories.tsx +471 -0
- package/src/components/waka-terminal-output/WakaTerminalOutput.stories.tsx +351 -0
- package/src/components/waka-test-report/WakaTestReport.stories.tsx +322 -0
- package/src/components/waka-tilt-card/WakaTiltCard.stories.tsx +300 -0
- package/src/components/waka-time-picker/WakaTimePicker.stories.tsx +227 -0
- package/src/components/waka-timeline/WakaTimeline.stories.tsx +383 -0
- package/src/components/waka-tournament-bracket/WakaTournamentBracket.stories.tsx +375 -0
- package/src/components/waka-trace-viewer/WakaTraceViewer.stories.tsx +445 -0
- package/src/components/waka-tree/WakaTree.stories.tsx +359 -0
- package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +378 -0
- package/src/components/waka-typewriter/WakaTypewriter.stories.tsx +366 -0
- package/src/components/waka-versus-card/WakaVersusCard.stories.tsx +530 -0
- package/src/components/waka-video/WakaVideo.stories.tsx +203 -0
- package/src/components/waka-virtual-list/WakaVirtualList.stories.tsx +273 -0
- package/src/components/waka-xp-bar/WakaXPBar.stories.tsx +305 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { WakaRadarScore, WakaRadarScoreSimple, WakaRadarScoreCompare, useRadarScore } from './index'
|
|
3
|
+
import type { RadarDataSet, RadarDataPoint } from './index'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
const skillsData: RadarDataPoint[] = [
|
|
7
|
+
{ label: 'Frontend', value: 85 },
|
|
8
|
+
{ label: 'Backend', value: 70 },
|
|
9
|
+
{ label: 'Database', value: 65 },
|
|
10
|
+
{ label: 'DevOps', value: 55 },
|
|
11
|
+
{ label: 'Testing', value: 75 },
|
|
12
|
+
{ label: 'Design', value: 60 },
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
const performanceAxes = ['Speed', 'Reliability', 'Scalability', 'Security', 'Usability', 'Cost']
|
|
16
|
+
const performanceDatasets: RadarDataSet[] = [
|
|
17
|
+
{
|
|
18
|
+
id: 'current',
|
|
19
|
+
label: 'Current',
|
|
20
|
+
data: [75, 85, 65, 90, 70, 60],
|
|
21
|
+
color: '#3b82f6',
|
|
22
|
+
fillOpacity: 0.2,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'target',
|
|
26
|
+
label: 'Target',
|
|
27
|
+
data: [90, 90, 85, 95, 85, 70],
|
|
28
|
+
color: '#22c55e',
|
|
29
|
+
fillOpacity: 0.1,
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
const playerStatsAxes = ['Attack', 'Defense', 'Speed', 'Stamina', 'Technique', 'Mental']
|
|
34
|
+
const playerA: RadarDataSet = {
|
|
35
|
+
id: 'playerA',
|
|
36
|
+
label: 'Player A',
|
|
37
|
+
data: [90, 60, 75, 80, 85, 70],
|
|
38
|
+
color: '#ef4444',
|
|
39
|
+
fillOpacity: 0.2,
|
|
40
|
+
}
|
|
41
|
+
const playerB: RadarDataSet = {
|
|
42
|
+
id: 'playerB',
|
|
43
|
+
label: 'Player B',
|
|
44
|
+
data: [70, 85, 90, 75, 65, 80],
|
|
45
|
+
color: '#3b82f6',
|
|
46
|
+
fillOpacity: 0.2,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const meta: Meta<typeof WakaRadarScore> = {
|
|
50
|
+
title: 'Components/Charts/WakaRadarScore',
|
|
51
|
+
component: WakaRadarScore,
|
|
52
|
+
parameters: {
|
|
53
|
+
layout: 'centered',
|
|
54
|
+
docs: {
|
|
55
|
+
description: {
|
|
56
|
+
component: 'A radar/spider chart for visualizing multi-dimensional data with support for multiple datasets and comparison views.',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
tags: ['autodocs'],
|
|
61
|
+
argTypes: {
|
|
62
|
+
size: {
|
|
63
|
+
control: { type: 'range', min: 200, max: 500, step: 50 },
|
|
64
|
+
description: 'Chart size in pixels',
|
|
65
|
+
},
|
|
66
|
+
levels: {
|
|
67
|
+
control: { type: 'range', min: 3, max: 10, step: 1 },
|
|
68
|
+
description: 'Number of grid levels',
|
|
69
|
+
},
|
|
70
|
+
showGrid: {
|
|
71
|
+
control: 'boolean',
|
|
72
|
+
description: 'Show grid lines',
|
|
73
|
+
},
|
|
74
|
+
showLabels: {
|
|
75
|
+
control: 'boolean',
|
|
76
|
+
description: 'Show axis labels',
|
|
77
|
+
},
|
|
78
|
+
showPoints: {
|
|
79
|
+
control: 'boolean',
|
|
80
|
+
description: 'Show data points',
|
|
81
|
+
},
|
|
82
|
+
showTooltip: {
|
|
83
|
+
control: 'boolean',
|
|
84
|
+
description: 'Show tooltips on hover',
|
|
85
|
+
},
|
|
86
|
+
animated: {
|
|
87
|
+
control: 'boolean',
|
|
88
|
+
description: 'Enable animations',
|
|
89
|
+
},
|
|
90
|
+
legendPosition: {
|
|
91
|
+
control: 'select',
|
|
92
|
+
options: ['none', 'top', 'bottom', 'left', 'right'],
|
|
93
|
+
description: 'Legend position',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export default meta
|
|
99
|
+
type Story = StoryObj<typeof WakaRadarScore>
|
|
100
|
+
|
|
101
|
+
export const Default: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
axes: performanceAxes,
|
|
104
|
+
datasets: [performanceDatasets[0]],
|
|
105
|
+
size: 350,
|
|
106
|
+
},
|
|
107
|
+
render: (args) => <WakaRadarScore {...args} />,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const SimpleAPI: Story = {
|
|
111
|
+
render: () => (
|
|
112
|
+
<WakaRadarScoreSimple
|
|
113
|
+
data={skillsData}
|
|
114
|
+
size={350}
|
|
115
|
+
color="#8b5cf6"
|
|
116
|
+
/>
|
|
117
|
+
),
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const MultipleDatasets: Story = {
|
|
121
|
+
render: () => (
|
|
122
|
+
<WakaRadarScore
|
|
123
|
+
axes={performanceAxes}
|
|
124
|
+
datasets={performanceDatasets}
|
|
125
|
+
size={400}
|
|
126
|
+
legendPosition="bottom"
|
|
127
|
+
/>
|
|
128
|
+
),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const Comparison: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<WakaRadarScoreCompare
|
|
134
|
+
axes={playerStatsAxes}
|
|
135
|
+
dataA={{ label: 'Player A', data: playerA.data, color: '#ef4444' }}
|
|
136
|
+
dataB={{ label: 'Player B', data: playerB.data, color: '#3b82f6' }}
|
|
137
|
+
size={400}
|
|
138
|
+
/>
|
|
139
|
+
),
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const Sizes: Story = {
|
|
143
|
+
render: () => (
|
|
144
|
+
<div className="flex items-end gap-8">
|
|
145
|
+
<div className="text-center">
|
|
146
|
+
<WakaRadarScoreSimple data={skillsData} size={200} />
|
|
147
|
+
<p className="text-sm text-muted-foreground mt-2">200px</p>
|
|
148
|
+
</div>
|
|
149
|
+
<div className="text-center">
|
|
150
|
+
<WakaRadarScoreSimple data={skillsData} size={300} />
|
|
151
|
+
<p className="text-sm text-muted-foreground mt-2">300px</p>
|
|
152
|
+
</div>
|
|
153
|
+
<div className="text-center">
|
|
154
|
+
<WakaRadarScoreSimple data={skillsData} size={400} />
|
|
155
|
+
<p className="text-sm text-muted-foreground mt-2">400px</p>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
),
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const GridLevels: Story = {
|
|
162
|
+
render: () => (
|
|
163
|
+
<div className="flex gap-8">
|
|
164
|
+
<div className="text-center">
|
|
165
|
+
<WakaRadarScoreSimple data={skillsData} size={250} />
|
|
166
|
+
<p className="text-sm text-muted-foreground mt-2">5 levels (default)</p>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="text-center">
|
|
169
|
+
<WakaRadarScore
|
|
170
|
+
axes={skillsData.map((d) => d.label)}
|
|
171
|
+
datasets={[{ id: 'main', label: 'Score', data: skillsData.map((d) => d.value), color: '#3b82f6' }]}
|
|
172
|
+
size={250}
|
|
173
|
+
levels={3}
|
|
174
|
+
legendPosition="none"
|
|
175
|
+
/>
|
|
176
|
+
<p className="text-sm text-muted-foreground mt-2">3 levels</p>
|
|
177
|
+
</div>
|
|
178
|
+
<div className="text-center">
|
|
179
|
+
<WakaRadarScore
|
|
180
|
+
axes={skillsData.map((d) => d.label)}
|
|
181
|
+
datasets={[{ id: 'main', label: 'Score', data: skillsData.map((d) => d.value), color: '#3b82f6' }]}
|
|
182
|
+
size={250}
|
|
183
|
+
levels={10}
|
|
184
|
+
legendPosition="none"
|
|
185
|
+
/>
|
|
186
|
+
<p className="text-sm text-muted-foreground mt-2">10 levels</p>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
),
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const LegendPositions: Story = {
|
|
193
|
+
render: () => (
|
|
194
|
+
<div className="space-y-8">
|
|
195
|
+
<div>
|
|
196
|
+
<p className="text-sm text-muted-foreground mb-2">Legend Bottom</p>
|
|
197
|
+
<WakaRadarScore axes={performanceAxes} datasets={performanceDatasets} size={300} legendPosition="bottom" />
|
|
198
|
+
</div>
|
|
199
|
+
<div>
|
|
200
|
+
<p className="text-sm text-muted-foreground mb-2">Legend Right</p>
|
|
201
|
+
<WakaRadarScore axes={performanceAxes} datasets={performanceDatasets} size={300} legendPosition="right" />
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
),
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export const NoLabels: Story = {
|
|
208
|
+
render: () => (
|
|
209
|
+
<div className="flex gap-8">
|
|
210
|
+
<div className="text-center">
|
|
211
|
+
<WakaRadarScoreSimple data={skillsData} size={250} />
|
|
212
|
+
<p className="text-sm text-muted-foreground mt-2">With labels</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div className="text-center">
|
|
215
|
+
<WakaRadarScore
|
|
216
|
+
axes={skillsData.map((d) => d.label)}
|
|
217
|
+
datasets={[{ id: 'main', label: 'Score', data: skillsData.map((d) => d.value), color: '#3b82f6' }]}
|
|
218
|
+
size={250}
|
|
219
|
+
showLabels={false}
|
|
220
|
+
legendPosition="none"
|
|
221
|
+
/>
|
|
222
|
+
<p className="text-sm text-muted-foreground mt-2">Without labels</p>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
),
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export const NoGrid: Story = {
|
|
229
|
+
render: () => (
|
|
230
|
+
<WakaRadarScore
|
|
231
|
+
axes={performanceAxes}
|
|
232
|
+
datasets={[performanceDatasets[0]]}
|
|
233
|
+
size={350}
|
|
234
|
+
showGrid={false}
|
|
235
|
+
legendPosition="none"
|
|
236
|
+
/>
|
|
237
|
+
),
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const NoPoints: Story = {
|
|
241
|
+
render: () => (
|
|
242
|
+
<WakaRadarScore
|
|
243
|
+
axes={performanceAxes}
|
|
244
|
+
datasets={performanceDatasets}
|
|
245
|
+
size={350}
|
|
246
|
+
showPoints={false}
|
|
247
|
+
/>
|
|
248
|
+
),
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export const NoAnimation: Story = {
|
|
252
|
+
render: () => (
|
|
253
|
+
<WakaRadarScoreSimple data={skillsData} size={300} animated={false} />
|
|
254
|
+
),
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export const CustomColors: Story = {
|
|
258
|
+
render: () => {
|
|
259
|
+
const customDatasets: RadarDataSet[] = [
|
|
260
|
+
{
|
|
261
|
+
id: 'team1',
|
|
262
|
+
label: 'Team Alpha',
|
|
263
|
+
data: [80, 65, 90, 75, 85, 70],
|
|
264
|
+
color: '#8b5cf6',
|
|
265
|
+
fillOpacity: 0.3,
|
|
266
|
+
strokeWidth: 3,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: 'team2',
|
|
270
|
+
label: 'Team Beta',
|
|
271
|
+
data: [70, 80, 75, 85, 65, 90],
|
|
272
|
+
color: '#f59e0b',
|
|
273
|
+
fillOpacity: 0.3,
|
|
274
|
+
strokeWidth: 3,
|
|
275
|
+
},
|
|
276
|
+
]
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<WakaRadarScore
|
|
280
|
+
axes={performanceAxes}
|
|
281
|
+
datasets={customDatasets}
|
|
282
|
+
size={400}
|
|
283
|
+
legendPosition="bottom"
|
|
284
|
+
/>
|
|
285
|
+
)
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export const WithHook: Story = {
|
|
290
|
+
render: () => {
|
|
291
|
+
const { activeDataset, setActiveDataset, hoveredPoint, setHoveredPoint } = useRadarScore(performanceDatasets)
|
|
292
|
+
|
|
293
|
+
return (
|
|
294
|
+
<div className="space-y-4">
|
|
295
|
+
<div className="flex gap-2 flex-wrap">
|
|
296
|
+
{performanceDatasets.map((dataset) => (
|
|
297
|
+
<button
|
|
298
|
+
key={dataset.id}
|
|
299
|
+
onClick={() => setActiveDataset(activeDataset === dataset.id ? null : dataset.id)}
|
|
300
|
+
className={`px-3 py-1 text-sm border rounded transition-colors ${
|
|
301
|
+
activeDataset === dataset.id ? 'bg-primary text-primary-foreground' : 'hover:bg-muted'
|
|
302
|
+
}`}
|
|
303
|
+
>
|
|
304
|
+
{dataset.label}
|
|
305
|
+
</button>
|
|
306
|
+
))}
|
|
307
|
+
</div>
|
|
308
|
+
<WakaRadarScore
|
|
309
|
+
axes={performanceAxes}
|
|
310
|
+
datasets={performanceDatasets}
|
|
311
|
+
size={350}
|
|
312
|
+
legendPosition="none"
|
|
313
|
+
/>
|
|
314
|
+
<p className="text-sm text-muted-foreground">
|
|
315
|
+
Active: {activeDataset || 'None'}
|
|
316
|
+
</p>
|
|
317
|
+
</div>
|
|
318
|
+
)
|
|
319
|
+
},
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export const DeveloperSkillsCard: Story = {
|
|
323
|
+
render: () => (
|
|
324
|
+
<div className="w-[450px] p-6 border rounded-lg">
|
|
325
|
+
<div className="flex items-center gap-4 mb-4">
|
|
326
|
+
<div className="w-12 h-12 rounded-full bg-gradient-to-br from-blue-500 to-purple-600" />
|
|
327
|
+
<div>
|
|
328
|
+
<h3 className="font-semibold">Jane Developer</h3>
|
|
329
|
+
<p className="text-sm text-muted-foreground">Full Stack Engineer</p>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
<WakaRadarScoreSimple
|
|
333
|
+
data={skillsData}
|
|
334
|
+
size={350}
|
|
335
|
+
color="#8b5cf6"
|
|
336
|
+
fillOpacity={0.25}
|
|
337
|
+
/>
|
|
338
|
+
<div className="mt-4 grid grid-cols-2 gap-2">
|
|
339
|
+
{skillsData.map((skill) => (
|
|
340
|
+
<div key={skill.label} className="flex justify-between text-sm">
|
|
341
|
+
<span className="text-muted-foreground">{skill.label}</span>
|
|
342
|
+
<span className="font-medium">{skill.value}%</span>
|
|
343
|
+
</div>
|
|
344
|
+
))}
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
),
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export const PlayerComparisonCard: Story = {
|
|
351
|
+
render: () => (
|
|
352
|
+
<div className="w-[500px] p-6 border rounded-lg">
|
|
353
|
+
<h3 className="text-lg font-semibold mb-4 text-center">Player Comparison</h3>
|
|
354
|
+
<WakaRadarScoreCompare
|
|
355
|
+
axes={playerStatsAxes}
|
|
356
|
+
dataA={{ label: 'Player A', data: playerA.data, color: '#ef4444' }}
|
|
357
|
+
dataB={{ label: 'Player B', data: playerB.data, color: '#3b82f6' }}
|
|
358
|
+
size={400}
|
|
359
|
+
/>
|
|
360
|
+
<div className="mt-4 flex justify-center gap-8">
|
|
361
|
+
<div className="flex items-center gap-2">
|
|
362
|
+
<div className="w-3 h-3 rounded-full bg-red-500" />
|
|
363
|
+
<span className="text-sm">Player A</span>
|
|
364
|
+
</div>
|
|
365
|
+
<div className="flex items-center gap-2">
|
|
366
|
+
<div className="w-3 h-3 rounded-full bg-blue-500" />
|
|
367
|
+
<span className="text-sm">Player B</span>
|
|
368
|
+
</div>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
),
|
|
372
|
+
}
|