@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,207 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Text, Heading, Blockquote, Kbd } from './index'
|
|
3
|
+
|
|
4
|
+
const meta: Meta = {
|
|
5
|
+
title: 'Components/Typography',
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: 'centered',
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: 'A collection of typography components for consistent text styling.',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj
|
|
19
|
+
|
|
20
|
+
export const Headings: Story = {
|
|
21
|
+
render: () => (
|
|
22
|
+
<div className="space-y-4 w-[600px]">
|
|
23
|
+
<Heading level="h1">Heading 1</Heading>
|
|
24
|
+
<Heading level="h2">Heading 2</Heading>
|
|
25
|
+
<Heading level="h3">Heading 3</Heading>
|
|
26
|
+
<Heading level="h4">Heading 4</Heading>
|
|
27
|
+
<Heading level="h5">Heading 5</Heading>
|
|
28
|
+
<Heading level="h6">Heading 6</Heading>
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const HeadingVariants: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<div className="space-y-4 w-[600px]">
|
|
36
|
+
<Heading level="h2" variant="default">Default Heading</Heading>
|
|
37
|
+
<Heading level="h2" variant="gradient">Gradient Heading</Heading>
|
|
38
|
+
<Heading level="h2" variant="muted">Muted Heading</Heading>
|
|
39
|
+
</div>
|
|
40
|
+
),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const TextVariants: Story = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<div className="space-y-2 w-[400px]">
|
|
46
|
+
<Text variant="default">Default text style</Text>
|
|
47
|
+
<Text variant="muted">Muted text for secondary content</Text>
|
|
48
|
+
<Text variant="destructive">Destructive text for errors</Text>
|
|
49
|
+
<Text variant="success">Success text for confirmations</Text>
|
|
50
|
+
<Text variant="warning">Warning text for cautions</Text>
|
|
51
|
+
<Text variant="link">Link text style</Text>
|
|
52
|
+
</div>
|
|
53
|
+
),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const TextSizes: Story = {
|
|
57
|
+
render: () => (
|
|
58
|
+
<div className="space-y-2 w-[400px]">
|
|
59
|
+
<Text size="xs">Extra small text (xs)</Text>
|
|
60
|
+
<Text size="sm">Small text (sm)</Text>
|
|
61
|
+
<Text size="base">Base text (base)</Text>
|
|
62
|
+
<Text size="lg">Large text (lg)</Text>
|
|
63
|
+
<Text size="xl">Extra large text (xl)</Text>
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const TextWeights: Story = {
|
|
69
|
+
render: () => (
|
|
70
|
+
<div className="space-y-2 w-[400px]">
|
|
71
|
+
<Text weight="normal">Normal weight text</Text>
|
|
72
|
+
<Text weight="medium">Medium weight text</Text>
|
|
73
|
+
<Text weight="semibold">Semibold weight text</Text>
|
|
74
|
+
<Text weight="bold">Bold weight text</Text>
|
|
75
|
+
</div>
|
|
76
|
+
),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const TextAlignment: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<div className="space-y-4 w-[400px]">
|
|
82
|
+
<Text align="left" className="border p-2">Left aligned text</Text>
|
|
83
|
+
<Text align="center" className="border p-2">Center aligned text</Text>
|
|
84
|
+
<Text align="right" className="border p-2">Right aligned text</Text>
|
|
85
|
+
<Text align="justify" className="border p-2">
|
|
86
|
+
Justified text that spans multiple lines to demonstrate the justify alignment properly across the full width of the container.
|
|
87
|
+
</Text>
|
|
88
|
+
</div>
|
|
89
|
+
),
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const TruncatedText: Story = {
|
|
93
|
+
render: () => (
|
|
94
|
+
<div className="w-[200px]">
|
|
95
|
+
<Text truncate>
|
|
96
|
+
This is a very long text that will be truncated with an ellipsis at the end.
|
|
97
|
+
</Text>
|
|
98
|
+
</div>
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const Blockquotes: Story = {
|
|
103
|
+
render: () => (
|
|
104
|
+
<div className="space-y-6 w-[500px]">
|
|
105
|
+
<Blockquote>
|
|
106
|
+
A simple blockquote without attribution.
|
|
107
|
+
</Blockquote>
|
|
108
|
+
<Blockquote author="Oscar Wilde">
|
|
109
|
+
Be yourself; everyone else is already taken.
|
|
110
|
+
</Blockquote>
|
|
111
|
+
<Blockquote variant="primary" author="Albert Einstein">
|
|
112
|
+
Imagination is more important than knowledge.
|
|
113
|
+
</Blockquote>
|
|
114
|
+
</div>
|
|
115
|
+
),
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const BlockquoteVariants: Story = {
|
|
119
|
+
render: () => (
|
|
120
|
+
<div className="space-y-6 w-[500px]">
|
|
121
|
+
<Blockquote variant="default">Default blockquote style</Blockquote>
|
|
122
|
+
<Blockquote variant="primary">Primary blockquote style</Blockquote>
|
|
123
|
+
<Blockquote variant="success">Success blockquote style</Blockquote>
|
|
124
|
+
<Blockquote variant="warning">Warning blockquote style</Blockquote>
|
|
125
|
+
<Blockquote variant="destructive">Destructive blockquote style</Blockquote>
|
|
126
|
+
</div>
|
|
127
|
+
),
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const KeyboardKeys: Story = {
|
|
131
|
+
render: () => (
|
|
132
|
+
<div className="space-y-4">
|
|
133
|
+
<div className="flex items-center gap-2">
|
|
134
|
+
<span className="text-sm">Copy:</span>
|
|
135
|
+
<Kbd>⌘</Kbd>
|
|
136
|
+
<span className="text-muted-foreground">+</span>
|
|
137
|
+
<Kbd>C</Kbd>
|
|
138
|
+
</div>
|
|
139
|
+
<div className="flex items-center gap-2">
|
|
140
|
+
<span className="text-sm">Paste:</span>
|
|
141
|
+
<Kbd>⌘</Kbd>
|
|
142
|
+
<span className="text-muted-foreground">+</span>
|
|
143
|
+
<Kbd>V</Kbd>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="flex items-center gap-2">
|
|
146
|
+
<span className="text-sm">Save:</span>
|
|
147
|
+
<Kbd>⌘</Kbd>
|
|
148
|
+
<span className="text-muted-foreground">+</span>
|
|
149
|
+
<Kbd>S</Kbd>
|
|
150
|
+
</div>
|
|
151
|
+
<div className="flex items-center gap-2">
|
|
152
|
+
<span className="text-sm">Search:</span>
|
|
153
|
+
<Kbd>⌘</Kbd>
|
|
154
|
+
<span className="text-muted-foreground">+</span>
|
|
155
|
+
<Kbd>K</Kbd>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
),
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const KbdSizes: Story = {
|
|
162
|
+
render: () => (
|
|
163
|
+
<div className="flex items-center gap-4">
|
|
164
|
+
<div className="text-center">
|
|
165
|
+
<Kbd size="sm">Ctrl</Kbd>
|
|
166
|
+
<p className="text-xs text-muted-foreground mt-1">Small</p>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="text-center">
|
|
169
|
+
<Kbd size="default">Ctrl</Kbd>
|
|
170
|
+
<p className="text-xs text-muted-foreground mt-1">Default</p>
|
|
171
|
+
</div>
|
|
172
|
+
<div className="text-center">
|
|
173
|
+
<Kbd size="lg">Ctrl</Kbd>
|
|
174
|
+
<p className="text-xs text-muted-foreground mt-1">Large</p>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
),
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const FullExample: Story = {
|
|
181
|
+
render: () => (
|
|
182
|
+
<article className="prose dark:prose-invert max-w-[600px] space-y-6">
|
|
183
|
+
<Heading level="h1">Welcome to Typography</Heading>
|
|
184
|
+
<Text variant="muted" size="lg">
|
|
185
|
+
A comprehensive set of typography components for your application.
|
|
186
|
+
</Text>
|
|
187
|
+
|
|
188
|
+
<Heading level="h2">Getting Started</Heading>
|
|
189
|
+
<Text>
|
|
190
|
+
Typography is the art and technique of arranging type to make written language legible, readable and appealing when displayed.
|
|
191
|
+
</Text>
|
|
192
|
+
|
|
193
|
+
<Blockquote author="Robert Bringhurst" variant="primary">
|
|
194
|
+
Typography exists to honor content.
|
|
195
|
+
</Blockquote>
|
|
196
|
+
|
|
197
|
+
<Heading level="h3">Keyboard Shortcuts</Heading>
|
|
198
|
+
<Text>
|
|
199
|
+
Use <Kbd>⌘</Kbd> + <Kbd>B</Kbd> for bold and <Kbd>⌘</Kbd> + <Kbd>I</Kbd> for italic.
|
|
200
|
+
</Text>
|
|
201
|
+
|
|
202
|
+
<Text variant="muted" size="sm">
|
|
203
|
+
These typography components support dark mode and are fully customizable.
|
|
204
|
+
</Text>
|
|
205
|
+
</article>
|
|
206
|
+
),
|
|
207
|
+
}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Waka3DPieChart, WakaPieChart, WakaDonutChart, use3DPieChart } from './index'
|
|
3
|
+
import type { PieSlice } from './index'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
const browserData: PieSlice[] = [
|
|
7
|
+
{ id: 'chrome', label: 'Chrome', value: 45 },
|
|
8
|
+
{ id: 'safari', label: 'Safari', value: 25 },
|
|
9
|
+
{ id: 'firefox', label: 'Firefox', value: 15 },
|
|
10
|
+
{ id: 'edge', label: 'Edge', value: 10 },
|
|
11
|
+
{ id: 'other', label: 'Other', value: 5 },
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
const salesData: PieSlice[] = [
|
|
15
|
+
{ id: 'electronics', label: 'Electronics', value: 35000, color: '#3b82f6' },
|
|
16
|
+
{ id: 'clothing', label: 'Clothing', value: 25000, color: '#22c55e' },
|
|
17
|
+
{ id: 'food', label: 'Food & Beverages', value: 20000, color: '#f59e0b' },
|
|
18
|
+
{ id: 'furniture', label: 'Furniture', value: 15000, color: '#8b5cf6' },
|
|
19
|
+
{ id: 'books', label: 'Books', value: 5000, color: '#ec4899' },
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const trafficData: PieSlice[] = [
|
|
23
|
+
{ id: 'organic', label: 'Organic', value: 40 },
|
|
24
|
+
{ id: 'direct', label: 'Direct', value: 25 },
|
|
25
|
+
{ id: 'referral', label: 'Referral', value: 20 },
|
|
26
|
+
{ id: 'social', label: 'Social', value: 10 },
|
|
27
|
+
{ id: 'email', label: 'Email', value: 5 },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const meta: Meta<typeof Waka3DPieChart> = {
|
|
31
|
+
title: 'Components/Charts/Waka3DPieChart',
|
|
32
|
+
component: Waka3DPieChart,
|
|
33
|
+
parameters: {
|
|
34
|
+
layout: 'centered',
|
|
35
|
+
docs: {
|
|
36
|
+
description: {
|
|
37
|
+
component: 'A 3D pie/donut chart with rotation, explosion effects, and interactive features.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
tags: ['autodocs'],
|
|
42
|
+
argTypes: {
|
|
43
|
+
size: {
|
|
44
|
+
control: { type: 'range', min: 200, max: 500, step: 50 },
|
|
45
|
+
description: 'Chart size in pixels',
|
|
46
|
+
},
|
|
47
|
+
depth: {
|
|
48
|
+
control: { type: 'range', min: 0, max: 60, step: 5 },
|
|
49
|
+
description: '3D depth in pixels',
|
|
50
|
+
},
|
|
51
|
+
rotation: {
|
|
52
|
+
control: { type: 'range', min: -180, max: 180, step: 15 },
|
|
53
|
+
description: 'Initial rotation angle',
|
|
54
|
+
},
|
|
55
|
+
innerRadius: {
|
|
56
|
+
control: { type: 'range', min: 0, max: 100, step: 10 },
|
|
57
|
+
description: 'Inner radius for donut',
|
|
58
|
+
},
|
|
59
|
+
rotateOnHover: {
|
|
60
|
+
control: 'boolean',
|
|
61
|
+
description: 'Rotate on hover',
|
|
62
|
+
},
|
|
63
|
+
explodeOnClick: {
|
|
64
|
+
control: 'boolean',
|
|
65
|
+
description: 'Explode slice on click',
|
|
66
|
+
},
|
|
67
|
+
showTooltip: {
|
|
68
|
+
control: 'boolean',
|
|
69
|
+
description: 'Show tooltips',
|
|
70
|
+
},
|
|
71
|
+
showLegend: {
|
|
72
|
+
control: 'boolean',
|
|
73
|
+
description: 'Show legend',
|
|
74
|
+
},
|
|
75
|
+
legendPosition: {
|
|
76
|
+
control: 'select',
|
|
77
|
+
options: ['right', 'bottom'],
|
|
78
|
+
description: 'Legend position',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default meta
|
|
84
|
+
type Story = StoryObj<typeof Waka3DPieChart>
|
|
85
|
+
|
|
86
|
+
export const Default: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
data: browserData,
|
|
89
|
+
},
|
|
90
|
+
render: (args) => <Waka3DPieChart {...args} />,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const ThreeDDepths: Story = {
|
|
94
|
+
render: () => (
|
|
95
|
+
<div className="flex flex-wrap gap-8">
|
|
96
|
+
<div className="text-center">
|
|
97
|
+
<Waka3DPieChart data={browserData} depth={0} showLegend={false} size={200} />
|
|
98
|
+
<p className="text-sm text-muted-foreground mt-2">Flat (0px)</p>
|
|
99
|
+
</div>
|
|
100
|
+
<div className="text-center">
|
|
101
|
+
<Waka3DPieChart data={browserData} depth={20} showLegend={false} size={200} />
|
|
102
|
+
<p className="text-sm text-muted-foreground mt-2">Light 3D (20px)</p>
|
|
103
|
+
</div>
|
|
104
|
+
<div className="text-center">
|
|
105
|
+
<Waka3DPieChart data={browserData} depth={40} showLegend={false} size={200} />
|
|
106
|
+
<p className="text-sm text-muted-foreground mt-2">Deep 3D (40px)</p>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
),
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const Sizes: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<div className="flex items-end gap-8">
|
|
115
|
+
<div className="text-center">
|
|
116
|
+
<Waka3DPieChart data={browserData} size={200} showLegend={false} />
|
|
117
|
+
<p className="text-sm text-muted-foreground mt-2">200px</p>
|
|
118
|
+
</div>
|
|
119
|
+
<div className="text-center">
|
|
120
|
+
<Waka3DPieChart data={browserData} size={300} showLegend={false} />
|
|
121
|
+
<p className="text-sm text-muted-foreground mt-2">300px</p>
|
|
122
|
+
</div>
|
|
123
|
+
<div className="text-center">
|
|
124
|
+
<Waka3DPieChart data={browserData} size={400} showLegend={false} />
|
|
125
|
+
<p className="text-sm text-muted-foreground mt-2">400px</p>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
),
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const RotationAngles: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<div className="flex gap-8">
|
|
134
|
+
<div className="text-center">
|
|
135
|
+
<Waka3DPieChart data={browserData} rotation={-60} showLegend={false} size={200} />
|
|
136
|
+
<p className="text-sm text-muted-foreground mt-2">-60°</p>
|
|
137
|
+
</div>
|
|
138
|
+
<div className="text-center">
|
|
139
|
+
<Waka3DPieChart data={browserData} rotation={0} showLegend={false} size={200} />
|
|
140
|
+
<p className="text-sm text-muted-foreground mt-2">0°</p>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="text-center">
|
|
143
|
+
<Waka3DPieChart data={browserData} rotation={60} showLegend={false} size={200} />
|
|
144
|
+
<p className="text-sm text-muted-foreground mt-2">+60°</p>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
),
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const WithCustomColors: Story = {
|
|
151
|
+
render: () => <Waka3DPieChart data={salesData} size={350} />,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export const ExplodeOnClick: Story = {
|
|
155
|
+
render: () => (
|
|
156
|
+
<div className="space-y-4">
|
|
157
|
+
<p className="text-sm text-muted-foreground text-center">Click slices to explode them</p>
|
|
158
|
+
<Waka3DPieChart
|
|
159
|
+
data={browserData}
|
|
160
|
+
explodeOnClick
|
|
161
|
+
explodeDistance={25}
|
|
162
|
+
size={350}
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
),
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const LegendPositions: Story = {
|
|
169
|
+
render: () => (
|
|
170
|
+
<div className="space-y-8">
|
|
171
|
+
<div>
|
|
172
|
+
<p className="text-sm text-muted-foreground mb-2">Legend Right</p>
|
|
173
|
+
<Waka3DPieChart data={browserData} legendPosition="right" size={250} />
|
|
174
|
+
</div>
|
|
175
|
+
<div>
|
|
176
|
+
<p className="text-sm text-muted-foreground mb-2">Legend Bottom</p>
|
|
177
|
+
<Waka3DPieChart data={browserData} legendPosition="bottom" size={250} />
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
),
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const NoLegend: Story = {
|
|
184
|
+
render: () => <Waka3DPieChart data={browserData} showLegend={false} size={300} />,
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export const FlatPieChart: Story = {
|
|
188
|
+
render: () => <WakaPieChart data={browserData} size={300} />,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const DonutChart: Story = {
|
|
192
|
+
render: () => (
|
|
193
|
+
<WakaDonutChart
|
|
194
|
+
data={browserData}
|
|
195
|
+
thickness={40}
|
|
196
|
+
size={300}
|
|
197
|
+
centerContent={
|
|
198
|
+
<div className="text-center">
|
|
199
|
+
<p className="text-2xl font-bold">100%</p>
|
|
200
|
+
<p className="text-xs text-muted-foreground">Total</p>
|
|
201
|
+
</div>
|
|
202
|
+
}
|
|
203
|
+
/>
|
|
204
|
+
),
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export const DonutThicknesses: Story = {
|
|
208
|
+
render: () => (
|
|
209
|
+
<div className="flex gap-8">
|
|
210
|
+
<div className="text-center">
|
|
211
|
+
<WakaDonutChart data={browserData} thickness={20} size={200} showLegend={false} />
|
|
212
|
+
<p className="text-sm text-muted-foreground mt-2">20% thickness</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div className="text-center">
|
|
215
|
+
<WakaDonutChart data={browserData} thickness={40} size={200} showLegend={false} />
|
|
216
|
+
<p className="text-sm text-muted-foreground mt-2">40% thickness</p>
|
|
217
|
+
</div>
|
|
218
|
+
<div className="text-center">
|
|
219
|
+
<WakaDonutChart data={browserData} thickness={60} size={200} showLegend={false} />
|
|
220
|
+
<p className="text-sm text-muted-foreground mt-2">60% thickness</p>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
),
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export const WithHook: Story = {
|
|
227
|
+
render: () => {
|
|
228
|
+
const { explodedSlice, hoveredSlice, toggleExplode, setHoveredSlice, reset } = use3DPieChart()
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<div className="space-y-4">
|
|
232
|
+
<div className="flex gap-2 flex-wrap">
|
|
233
|
+
{browserData.map((slice) => (
|
|
234
|
+
<button
|
|
235
|
+
key={slice.id}
|
|
236
|
+
onClick={() => toggleExplode(slice.id)}
|
|
237
|
+
onMouseEnter={() => setHoveredSlice(slice.id)}
|
|
238
|
+
onMouseLeave={() => setHoveredSlice(null)}
|
|
239
|
+
className={`px-3 py-1 text-sm border rounded transition-colors ${
|
|
240
|
+
explodedSlice === slice.id ? 'bg-primary text-primary-foreground' : 'hover:bg-muted'
|
|
241
|
+
}`}
|
|
242
|
+
>
|
|
243
|
+
{slice.label}
|
|
244
|
+
</button>
|
|
245
|
+
))}
|
|
246
|
+
<button onClick={reset} className="px-3 py-1 text-sm border rounded hover:bg-muted">
|
|
247
|
+
Reset
|
|
248
|
+
</button>
|
|
249
|
+
</div>
|
|
250
|
+
<Waka3DPieChart data={browserData} size={300} explodeOnClick={false} />
|
|
251
|
+
<p className="text-sm text-muted-foreground">
|
|
252
|
+
Hovered: {hoveredSlice || 'None'} | Exploded: {explodedSlice || 'None'}
|
|
253
|
+
</p>
|
|
254
|
+
</div>
|
|
255
|
+
)
|
|
256
|
+
},
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export const TrafficSourcesDashboard: Story = {
|
|
260
|
+
render: () => {
|
|
261
|
+
const [selectedSlice, setSelectedSlice] = React.useState<PieSlice | null>(null)
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<div className="w-[600px] p-6 border rounded-lg">
|
|
265
|
+
<h3 className="text-lg font-semibold mb-4">Traffic Sources</h3>
|
|
266
|
+
<div className="flex gap-6">
|
|
267
|
+
<Waka3DPieChart
|
|
268
|
+
data={trafficData}
|
|
269
|
+
size={300}
|
|
270
|
+
onSliceClick={(slice) => setSelectedSlice(slice)}
|
|
271
|
+
explodeOnClick
|
|
272
|
+
/>
|
|
273
|
+
{selectedSlice && (
|
|
274
|
+
<div className="flex-1 p-4 border rounded-lg bg-muted/30">
|
|
275
|
+
<h4 className="font-medium text-lg">{selectedSlice.label}</h4>
|
|
276
|
+
<p className="text-3xl font-bold text-primary mt-2">
|
|
277
|
+
{selectedSlice.value}%
|
|
278
|
+
</p>
|
|
279
|
+
<p className="text-sm text-muted-foreground mt-1">of total traffic</p>
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
)
|
|
285
|
+
},
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export const Comparison: Story = {
|
|
289
|
+
render: () => (
|
|
290
|
+
<div className="space-y-8">
|
|
291
|
+
<h3 className="text-lg font-semibold text-center">Pie vs Donut vs 3D Pie</h3>
|
|
292
|
+
<div className="flex gap-8">
|
|
293
|
+
<div className="text-center">
|
|
294
|
+
<WakaPieChart data={browserData} size={200} showLegend={false} />
|
|
295
|
+
<p className="text-sm text-muted-foreground mt-2">Flat Pie</p>
|
|
296
|
+
</div>
|
|
297
|
+
<div className="text-center">
|
|
298
|
+
<WakaDonutChart data={browserData} size={200} thickness={35} showLegend={false} />
|
|
299
|
+
<p className="text-sm text-muted-foreground mt-2">Donut</p>
|
|
300
|
+
</div>
|
|
301
|
+
<div className="text-center">
|
|
302
|
+
<Waka3DPieChart data={browserData} size={200} depth={30} showLegend={false} />
|
|
303
|
+
<p className="text-sm text-muted-foreground mt-2">3D Pie</p>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
),
|
|
308
|
+
}
|