@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,227 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { WakaBarcode } from './index'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof WakaBarcode> = {
|
|
5
|
+
title: 'Components/Display/WakaBarcode',
|
|
6
|
+
component: WakaBarcode,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'A barcode generator component supporting multiple formats with customizable appearance.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
format: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['CODE128', 'CODE39', 'EAN13', 'EAN8', 'UPC', 'ITF14'],
|
|
20
|
+
description: 'Barcode format',
|
|
21
|
+
},
|
|
22
|
+
width: {
|
|
23
|
+
control: { type: 'range', min: 100, max: 400, step: 20 },
|
|
24
|
+
description: 'Width in pixels',
|
|
25
|
+
},
|
|
26
|
+
height: {
|
|
27
|
+
control: { type: 'range', min: 40, max: 150, step: 10 },
|
|
28
|
+
description: 'Height in pixels',
|
|
29
|
+
},
|
|
30
|
+
displayValue: {
|
|
31
|
+
control: 'boolean',
|
|
32
|
+
description: 'Show text below barcode',
|
|
33
|
+
},
|
|
34
|
+
lineColor: {
|
|
35
|
+
control: 'color',
|
|
36
|
+
description: 'Bar color',
|
|
37
|
+
},
|
|
38
|
+
background: {
|
|
39
|
+
control: 'color',
|
|
40
|
+
description: 'Background color',
|
|
41
|
+
},
|
|
42
|
+
showActions: {
|
|
43
|
+
control: 'boolean',
|
|
44
|
+
description: 'Show download and copy actions',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default meta
|
|
50
|
+
type Story = StoryObj<typeof WakaBarcode>
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
value: 'ABC-12345',
|
|
55
|
+
format: 'CODE128',
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const WithActions: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
value: 'ABC-12345',
|
|
62
|
+
format: 'CODE128',
|
|
63
|
+
showActions: true,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const Formats: Story = {
|
|
68
|
+
render: () => (
|
|
69
|
+
<div className="space-y-6">
|
|
70
|
+
<div className="text-center">
|
|
71
|
+
<WakaBarcode value="HELLO123" format="CODE128" />
|
|
72
|
+
<p className="text-xs text-muted-foreground mt-2">CODE128</p>
|
|
73
|
+
</div>
|
|
74
|
+
<div className="text-center">
|
|
75
|
+
<WakaBarcode value="HELLO123" format="CODE39" />
|
|
76
|
+
<p className="text-xs text-muted-foreground mt-2">CODE39</p>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
),
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const Sizes: Story = {
|
|
83
|
+
render: () => (
|
|
84
|
+
<div className="space-y-6">
|
|
85
|
+
<div className="text-center">
|
|
86
|
+
<WakaBarcode value="ABC-123" width={150} height={50} />
|
|
87
|
+
<p className="text-xs text-muted-foreground mt-2">Small (150x50)</p>
|
|
88
|
+
</div>
|
|
89
|
+
<div className="text-center">
|
|
90
|
+
<WakaBarcode value="ABC-123" width={200} height={80} />
|
|
91
|
+
<p className="text-xs text-muted-foreground mt-2">Medium (200x80)</p>
|
|
92
|
+
</div>
|
|
93
|
+
<div className="text-center">
|
|
94
|
+
<WakaBarcode value="ABC-123" width={300} height={100} />
|
|
95
|
+
<p className="text-xs text-muted-foreground mt-2">Large (300x100)</p>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const CustomColors: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="grid grid-cols-2 gap-6">
|
|
104
|
+
<div className="text-center">
|
|
105
|
+
<WakaBarcode value="ABC-123" lineColor="#000000" background="#FFFFFF" />
|
|
106
|
+
<p className="text-xs text-muted-foreground mt-2">Default</p>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="text-center">
|
|
109
|
+
<WakaBarcode value="ABC-123" lineColor="#1E40AF" background="#DBEAFE" />
|
|
110
|
+
<p className="text-xs text-muted-foreground mt-2">Blue</p>
|
|
111
|
+
</div>
|
|
112
|
+
<div className="text-center">
|
|
113
|
+
<WakaBarcode value="ABC-123" lineColor="#15803D" background="#DCFCE7" />
|
|
114
|
+
<p className="text-xs text-muted-foreground mt-2">Green</p>
|
|
115
|
+
</div>
|
|
116
|
+
<div className="text-center">
|
|
117
|
+
<WakaBarcode value="ABC-123" lineColor="#DC2626" background="#FEE2E2" />
|
|
118
|
+
<p className="text-xs text-muted-foreground mt-2">Red</p>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
),
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const NoText: Story = {
|
|
125
|
+
render: () => (
|
|
126
|
+
<div className="flex gap-8">
|
|
127
|
+
<div className="text-center">
|
|
128
|
+
<WakaBarcode value="ABC-123" displayValue={true} />
|
|
129
|
+
<p className="text-xs text-muted-foreground mt-2">With Text</p>
|
|
130
|
+
</div>
|
|
131
|
+
<div className="text-center">
|
|
132
|
+
<WakaBarcode value="ABC-123" displayValue={false} />
|
|
133
|
+
<p className="text-xs text-muted-foreground mt-2">No Text</p>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
),
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const FontSizes: Story = {
|
|
140
|
+
render: () => (
|
|
141
|
+
<div className="space-y-6">
|
|
142
|
+
<div className="text-center">
|
|
143
|
+
<WakaBarcode value="ABC-123" fontSize={10} />
|
|
144
|
+
<p className="text-xs text-muted-foreground mt-2">Font Size 10</p>
|
|
145
|
+
</div>
|
|
146
|
+
<div className="text-center">
|
|
147
|
+
<WakaBarcode value="ABC-123" fontSize={14} />
|
|
148
|
+
<p className="text-xs text-muted-foreground mt-2">Font Size 14 (Default)</p>
|
|
149
|
+
</div>
|
|
150
|
+
<div className="text-center">
|
|
151
|
+
<WakaBarcode value="ABC-123" fontSize={18} height={100} />
|
|
152
|
+
<p className="text-xs text-muted-foreground mt-2">Font Size 18</p>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
),
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const ProductLabel: Story = {
|
|
159
|
+
render: () => (
|
|
160
|
+
<div className="border rounded-lg p-4 w-[280px]">
|
|
161
|
+
<div className="text-center">
|
|
162
|
+
<h3 className="font-semibold">Product Name</h3>
|
|
163
|
+
<p className="text-sm text-muted-foreground">SKU: PRD-001</p>
|
|
164
|
+
<div className="mt-4">
|
|
165
|
+
<WakaBarcode value="PRD-001-2024" width={240} height={70} />
|
|
166
|
+
</div>
|
|
167
|
+
<p className="text-lg font-bold mt-2">$29.99</p>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
),
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const ShippingLabel: Story = {
|
|
174
|
+
render: () => (
|
|
175
|
+
<div className="border-2 border-dashed rounded-lg p-6 w-[350px]">
|
|
176
|
+
<div className="border-b pb-4 mb-4">
|
|
177
|
+
<p className="text-xs text-muted-foreground">FROM:</p>
|
|
178
|
+
<p className="font-medium">Warehouse A</p>
|
|
179
|
+
<p className="text-sm">123 Industrial Ave, City</p>
|
|
180
|
+
</div>
|
|
181
|
+
<div className="border-b pb-4 mb-4">
|
|
182
|
+
<p className="text-xs text-muted-foreground">TO:</p>
|
|
183
|
+
<p className="font-medium">John Doe</p>
|
|
184
|
+
<p className="text-sm">456 Main St, Town</p>
|
|
185
|
+
</div>
|
|
186
|
+
<div className="flex justify-center">
|
|
187
|
+
<WakaBarcode value="SHIP-2024-001234" width={280} height={80} />
|
|
188
|
+
</div>
|
|
189
|
+
<p className="text-xs text-muted-foreground text-center mt-2">
|
|
190
|
+
Tracking: SHIP-2024-001234
|
|
191
|
+
</p>
|
|
192
|
+
</div>
|
|
193
|
+
),
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const InventoryTag: Story = {
|
|
197
|
+
render: () => (
|
|
198
|
+
<div className="border rounded p-3 w-[200px] bg-yellow-50">
|
|
199
|
+
<div className="text-center">
|
|
200
|
+
<p className="text-xs font-bold text-yellow-800">INVENTORY</p>
|
|
201
|
+
<WakaBarcode
|
|
202
|
+
value="INV-A1-001"
|
|
203
|
+
width={160}
|
|
204
|
+
height={50}
|
|
205
|
+
fontSize={10}
|
|
206
|
+
margin={5}
|
|
207
|
+
/>
|
|
208
|
+
<div className="flex justify-between text-xs mt-2">
|
|
209
|
+
<span>Loc: A1</span>
|
|
210
|
+
<span>Qty: 50</span>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
),
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export const BatchGeneration: Story = {
|
|
218
|
+
render: () => (
|
|
219
|
+
<div className="grid grid-cols-2 gap-4">
|
|
220
|
+
{['ITEM-001', 'ITEM-002', 'ITEM-003', 'ITEM-004'].map((code) => (
|
|
221
|
+
<div key={code} className="border rounded p-2 text-center">
|
|
222
|
+
<WakaBarcode value={code} width={150} height={50} fontSize={10} />
|
|
223
|
+
</div>
|
|
224
|
+
))}
|
|
225
|
+
</div>
|
|
226
|
+
),
|
|
227
|
+
}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { WakaBottomSheet, useBottomSheet } from './index'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Button } from '../button'
|
|
5
|
+
import { MapPin, Navigation, Clock, Star, Phone, Share2, Heart, MessageSquare } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof WakaBottomSheet> = {
|
|
8
|
+
title: 'Components/Display/WakaBottomSheet',
|
|
9
|
+
component: WakaBottomSheet,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'fullscreen',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'A mobile-friendly bottom sheet component with snap points, drag gestures, and customization options.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
argTypes: {
|
|
20
|
+
variant: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['default', 'flat', 'glass'],
|
|
23
|
+
description: 'Visual variant',
|
|
24
|
+
},
|
|
25
|
+
showHandle: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'Show drag handle',
|
|
28
|
+
},
|
|
29
|
+
showBackdrop: {
|
|
30
|
+
control: 'boolean',
|
|
31
|
+
description: 'Show backdrop overlay',
|
|
32
|
+
},
|
|
33
|
+
closeOnBackdropClick: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'Close when clicking backdrop',
|
|
36
|
+
},
|
|
37
|
+
blockScroll: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Block page scroll when open',
|
|
40
|
+
},
|
|
41
|
+
hapticFeedback: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
description: 'Enable haptic feedback',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default meta
|
|
49
|
+
type Story = StoryObj<typeof WakaBottomSheet>
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
snapPoints: [25, 50, 90],
|
|
54
|
+
},
|
|
55
|
+
render: (args) => {
|
|
56
|
+
const [open, setOpen] = React.useState(false)
|
|
57
|
+
return (
|
|
58
|
+
<div className="h-[600px] bg-muted/30 p-8">
|
|
59
|
+
<Button onClick={() => setOpen(true)}>Open Bottom Sheet</Button>
|
|
60
|
+
<WakaBottomSheet
|
|
61
|
+
{...args}
|
|
62
|
+
open={open}
|
|
63
|
+
onOpenChange={setOpen}
|
|
64
|
+
>
|
|
65
|
+
<div className="space-y-4">
|
|
66
|
+
<h3 className="font-semibold text-lg">Bottom Sheet</h3>
|
|
67
|
+
<p className="text-muted-foreground">
|
|
68
|
+
Drag the handle to resize or swipe down to close.
|
|
69
|
+
</p>
|
|
70
|
+
<div className="space-y-2">
|
|
71
|
+
{Array.from({ length: 10 }).map((_, i) => (
|
|
72
|
+
<div key={i} className="p-3 bg-muted rounded-lg">
|
|
73
|
+
Item {i + 1}
|
|
74
|
+
</div>
|
|
75
|
+
))}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</WakaBottomSheet>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const Variants: Story = {
|
|
85
|
+
render: () => {
|
|
86
|
+
const [variant, setVariant] = React.useState<'default' | 'flat' | 'glass'>('default')
|
|
87
|
+
const [open, setOpen] = React.useState(false)
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div className="h-[600px] bg-gradient-to-br from-blue-500 to-purple-600 p-8">
|
|
91
|
+
<div className="flex gap-2">
|
|
92
|
+
{(['default', 'flat', 'glass'] as const).map((v) => (
|
|
93
|
+
<Button
|
|
94
|
+
key={v}
|
|
95
|
+
variant={variant === v ? 'default' : 'secondary'}
|
|
96
|
+
onClick={() => {
|
|
97
|
+
setVariant(v)
|
|
98
|
+
setOpen(true)
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
{v.charAt(0).toUpperCase() + v.slice(1)}
|
|
102
|
+
</Button>
|
|
103
|
+
))}
|
|
104
|
+
</div>
|
|
105
|
+
<WakaBottomSheet
|
|
106
|
+
open={open}
|
|
107
|
+
onOpenChange={setOpen}
|
|
108
|
+
variant={variant}
|
|
109
|
+
snapPoints={[30, 60]}
|
|
110
|
+
>
|
|
111
|
+
<div className="space-y-4">
|
|
112
|
+
<h3 className="font-semibold text-lg">Variant: {variant}</h3>
|
|
113
|
+
<p className="text-muted-foreground">
|
|
114
|
+
This sheet uses the "{variant}" variant style.
|
|
115
|
+
</p>
|
|
116
|
+
</div>
|
|
117
|
+
</WakaBottomSheet>
|
|
118
|
+
</div>
|
|
119
|
+
)
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const LocationCard: Story = {
|
|
124
|
+
render: () => {
|
|
125
|
+
const [open, setOpen] = React.useState(false)
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div className="h-[600px] bg-gray-200 p-8">
|
|
129
|
+
<p className="text-center text-muted-foreground mb-4">
|
|
130
|
+
Simulating a map view
|
|
131
|
+
</p>
|
|
132
|
+
<Button onClick={() => setOpen(true)}>
|
|
133
|
+
<MapPin className="h-4 w-4 mr-2" />
|
|
134
|
+
View Location Details
|
|
135
|
+
</Button>
|
|
136
|
+
<WakaBottomSheet
|
|
137
|
+
open={open}
|
|
138
|
+
onOpenChange={setOpen}
|
|
139
|
+
snapPoints={[35, 70, 95]}
|
|
140
|
+
defaultSnapPoint={0}
|
|
141
|
+
header={
|
|
142
|
+
<div className="flex items-center justify-between">
|
|
143
|
+
<div className="flex items-center gap-2">
|
|
144
|
+
<div className="flex">
|
|
145
|
+
{[1, 2, 3, 4, 5].map((star) => (
|
|
146
|
+
<Star key={star} className={`h-4 w-4 ${star <= 4 ? 'text-yellow-500 fill-yellow-500' : 'text-muted'}`} />
|
|
147
|
+
))}
|
|
148
|
+
</div>
|
|
149
|
+
<span className="text-sm text-muted-foreground">(128 reviews)</span>
|
|
150
|
+
</div>
|
|
151
|
+
<div className="flex gap-2">
|
|
152
|
+
<Button variant="ghost" size="icon">
|
|
153
|
+
<Heart className="h-4 w-4" />
|
|
154
|
+
</Button>
|
|
155
|
+
<Button variant="ghost" size="icon">
|
|
156
|
+
<Share2 className="h-4 w-4" />
|
|
157
|
+
</Button>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
}
|
|
161
|
+
footer={
|
|
162
|
+
<div className="flex gap-2">
|
|
163
|
+
<Button variant="outline" className="flex-1">
|
|
164
|
+
<Phone className="h-4 w-4 mr-2" />
|
|
165
|
+
Call
|
|
166
|
+
</Button>
|
|
167
|
+
<Button className="flex-1">
|
|
168
|
+
<Navigation className="h-4 w-4 mr-2" />
|
|
169
|
+
Directions
|
|
170
|
+
</Button>
|
|
171
|
+
</div>
|
|
172
|
+
}
|
|
173
|
+
>
|
|
174
|
+
<div className="space-y-4">
|
|
175
|
+
<div>
|
|
176
|
+
<h2 className="font-bold text-xl">Central Park Coffee</h2>
|
|
177
|
+
<p className="text-muted-foreground">Specialty Coffee Shop</p>
|
|
178
|
+
</div>
|
|
179
|
+
<div className="flex items-center gap-2 text-sm">
|
|
180
|
+
<Clock className="h-4 w-4 text-green-600" />
|
|
181
|
+
<span className="text-green-600">Open</span>
|
|
182
|
+
<span className="text-muted-foreground">· Closes 9:00 PM</span>
|
|
183
|
+
</div>
|
|
184
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
185
|
+
<MapPin className="h-4 w-4" />
|
|
186
|
+
<span>123 Park Avenue, New York, NY 10001</span>
|
|
187
|
+
</div>
|
|
188
|
+
<div className="border-t pt-4">
|
|
189
|
+
<h3 className="font-semibold mb-2">About</h3>
|
|
190
|
+
<p className="text-sm text-muted-foreground">
|
|
191
|
+
A cozy coffee shop located in the heart of the city, offering artisan
|
|
192
|
+
coffee, fresh pastries, and a peaceful atmosphere for work or relaxation.
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
<div className="border-t pt-4">
|
|
196
|
+
<h3 className="font-semibold mb-2">Popular Items</h3>
|
|
197
|
+
<div className="space-y-2">
|
|
198
|
+
<div className="flex justify-between">
|
|
199
|
+
<span>House Blend Coffee</span>
|
|
200
|
+
<span className="text-muted-foreground">$4.50</span>
|
|
201
|
+
</div>
|
|
202
|
+
<div className="flex justify-between">
|
|
203
|
+
<span>Avocado Toast</span>
|
|
204
|
+
<span className="text-muted-foreground">$12.00</span>
|
|
205
|
+
</div>
|
|
206
|
+
<div className="flex justify-between">
|
|
207
|
+
<span>Matcha Latte</span>
|
|
208
|
+
<span className="text-muted-foreground">$6.00</span>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</WakaBottomSheet>
|
|
214
|
+
</div>
|
|
215
|
+
)
|
|
216
|
+
},
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export const ActionSheet: Story = {
|
|
220
|
+
render: () => {
|
|
221
|
+
const [open, setOpen] = React.useState(false)
|
|
222
|
+
|
|
223
|
+
const actions = [
|
|
224
|
+
{ icon: <Share2 className="h-5 w-5" />, label: 'Share', onClick: () => console.log('Share') },
|
|
225
|
+
{ icon: <Heart className="h-5 w-5" />, label: 'Add to Favorites', onClick: () => console.log('Favorite') },
|
|
226
|
+
{ icon: <MessageSquare className="h-5 w-5" />, label: 'Send Message', onClick: () => console.log('Message') },
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
<div className="h-[600px] bg-muted/30 p-8">
|
|
231
|
+
<Button onClick={() => setOpen(true)}>Show Actions</Button>
|
|
232
|
+
<WakaBottomSheet
|
|
233
|
+
open={open}
|
|
234
|
+
onOpenChange={setOpen}
|
|
235
|
+
snapPoints={[40]}
|
|
236
|
+
showBackdrop
|
|
237
|
+
>
|
|
238
|
+
<div className="space-y-1">
|
|
239
|
+
{actions.map((action) => (
|
|
240
|
+
<button
|
|
241
|
+
key={action.label}
|
|
242
|
+
onClick={() => {
|
|
243
|
+
action.onClick()
|
|
244
|
+
setOpen(false)
|
|
245
|
+
}}
|
|
246
|
+
className="w-full flex items-center gap-3 p-4 hover:bg-muted rounded-lg transition-colors"
|
|
247
|
+
>
|
|
248
|
+
{action.icon}
|
|
249
|
+
<span className="font-medium">{action.label}</span>
|
|
250
|
+
</button>
|
|
251
|
+
))}
|
|
252
|
+
<div className="border-t my-2" />
|
|
253
|
+
<button
|
|
254
|
+
onClick={() => setOpen(false)}
|
|
255
|
+
className="w-full flex items-center justify-center p-4 text-destructive hover:bg-destructive/10 rounded-lg transition-colors"
|
|
256
|
+
>
|
|
257
|
+
Cancel
|
|
258
|
+
</button>
|
|
259
|
+
</div>
|
|
260
|
+
</WakaBottomSheet>
|
|
261
|
+
</div>
|
|
262
|
+
)
|
|
263
|
+
},
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const WithHook: Story = {
|
|
267
|
+
render: () => {
|
|
268
|
+
const sheet = useBottomSheet({
|
|
269
|
+
defaultSnapPoint: 0,
|
|
270
|
+
onOpenChange: (open) => console.log('Sheet open:', open),
|
|
271
|
+
onSnapPointChange: (index) => console.log('Snap point:', index),
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<div className="h-[600px] bg-muted/30 p-8 space-y-4">
|
|
276
|
+
<div className="flex gap-2">
|
|
277
|
+
<Button onClick={() => sheet.openSheet()}>Open</Button>
|
|
278
|
+
<Button variant="outline" onClick={() => sheet.openSheet(1)}>
|
|
279
|
+
Open at 50%
|
|
280
|
+
</Button>
|
|
281
|
+
<Button variant="outline" onClick={sheet.toggleSheet}>
|
|
282
|
+
Toggle
|
|
283
|
+
</Button>
|
|
284
|
+
</div>
|
|
285
|
+
<p className="text-sm text-muted-foreground">
|
|
286
|
+
Current snap point: {sheet.snapPoint}
|
|
287
|
+
</p>
|
|
288
|
+
<WakaBottomSheet
|
|
289
|
+
open={sheet.open}
|
|
290
|
+
onOpenChange={sheet.onOpenChange}
|
|
291
|
+
snapPoint={sheet.snapPoint}
|
|
292
|
+
onSnapPointChange={sheet.onSnapPointChange}
|
|
293
|
+
snapPoints={[25, 50, 90]}
|
|
294
|
+
>
|
|
295
|
+
<div className="space-y-4">
|
|
296
|
+
<h3 className="font-semibold text-lg">Using useBottomSheet Hook</h3>
|
|
297
|
+
<p className="text-muted-foreground">
|
|
298
|
+
This sheet is controlled programmatically via the hook.
|
|
299
|
+
</p>
|
|
300
|
+
<div className="flex gap-2 flex-wrap">
|
|
301
|
+
<Button variant="outline" size="sm" onClick={() => sheet.onSnapPointChange(0)}>
|
|
302
|
+
25%
|
|
303
|
+
</Button>
|
|
304
|
+
<Button variant="outline" size="sm" onClick={() => sheet.onSnapPointChange(1)}>
|
|
305
|
+
50%
|
|
306
|
+
</Button>
|
|
307
|
+
<Button variant="outline" size="sm" onClick={() => sheet.onSnapPointChange(2)}>
|
|
308
|
+
90%
|
|
309
|
+
</Button>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</WakaBottomSheet>
|
|
313
|
+
</div>
|
|
314
|
+
)
|
|
315
|
+
},
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export const ProductQuickView: Story = {
|
|
319
|
+
render: () => {
|
|
320
|
+
const [open, setOpen] = React.useState(false)
|
|
321
|
+
|
|
322
|
+
return (
|
|
323
|
+
<div className="h-[600px] bg-muted/30 p-8">
|
|
324
|
+
<div className="grid grid-cols-2 gap-4 max-w-md">
|
|
325
|
+
{[1, 2, 3, 4].map((i) => (
|
|
326
|
+
<div
|
|
327
|
+
key={i}
|
|
328
|
+
className="border rounded-lg p-4 bg-background cursor-pointer hover:shadow-md transition-shadow"
|
|
329
|
+
onClick={() => setOpen(true)}
|
|
330
|
+
>
|
|
331
|
+
<div className="aspect-square bg-muted rounded mb-2" />
|
|
332
|
+
<p className="font-medium">Product {i}</p>
|
|
333
|
+
<p className="text-muted-foreground text-sm">$99.00</p>
|
|
334
|
+
</div>
|
|
335
|
+
))}
|
|
336
|
+
</div>
|
|
337
|
+
<WakaBottomSheet
|
|
338
|
+
open={open}
|
|
339
|
+
onOpenChange={setOpen}
|
|
340
|
+
snapPoints={[60, 95]}
|
|
341
|
+
footer={
|
|
342
|
+
<Button className="w-full">Add to Cart - $99.00</Button>
|
|
343
|
+
}
|
|
344
|
+
>
|
|
345
|
+
<div className="space-y-4">
|
|
346
|
+
<div className="aspect-video bg-muted rounded-lg" />
|
|
347
|
+
<div>
|
|
348
|
+
<h2 className="font-bold text-xl">Premium Wireless Headphones</h2>
|
|
349
|
+
<p className="text-2xl font-bold text-primary mt-2">$99.00</p>
|
|
350
|
+
</div>
|
|
351
|
+
<div className="flex items-center gap-2">
|
|
352
|
+
<div className="flex">
|
|
353
|
+
{[1, 2, 3, 4, 5].map((star) => (
|
|
354
|
+
<Star key={star} className={`h-4 w-4 ${star <= 4 ? 'text-yellow-500 fill-yellow-500' : 'text-muted'}`} />
|
|
355
|
+
))}
|
|
356
|
+
</div>
|
|
357
|
+
<span className="text-sm text-muted-foreground">(256 reviews)</span>
|
|
358
|
+
</div>
|
|
359
|
+
<div>
|
|
360
|
+
<h3 className="font-semibold mb-2">Description</h3>
|
|
361
|
+
<p className="text-sm text-muted-foreground">
|
|
362
|
+
Experience crystal-clear audio with our premium wireless headphones.
|
|
363
|
+
Features active noise cancellation, 30-hour battery life, and
|
|
364
|
+
comfortable over-ear design for all-day listening.
|
|
365
|
+
</p>
|
|
366
|
+
</div>
|
|
367
|
+
<div>
|
|
368
|
+
<h3 className="font-semibold mb-2">Color</h3>
|
|
369
|
+
<div className="flex gap-2">
|
|
370
|
+
{['bg-black', 'bg-white border', 'bg-blue-600', 'bg-rose-500'].map((color) => (
|
|
371
|
+
<button
|
|
372
|
+
key={color}
|
|
373
|
+
className={`w-8 h-8 rounded-full ${color}`}
|
|
374
|
+
/>
|
|
375
|
+
))}
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
379
|
+
</WakaBottomSheet>
|
|
380
|
+
</div>
|
|
381
|
+
)
|
|
382
|
+
},
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export const NoBackdrop: Story = {
|
|
386
|
+
render: () => {
|
|
387
|
+
const [open, setOpen] = React.useState(false)
|
|
388
|
+
return (
|
|
389
|
+
<div className="h-[600px] bg-muted/30 p-8">
|
|
390
|
+
<Button onClick={() => setOpen(true)}>Open Without Backdrop</Button>
|
|
391
|
+
<WakaBottomSheet
|
|
392
|
+
open={open}
|
|
393
|
+
onOpenChange={setOpen}
|
|
394
|
+
snapPoints={[30, 60]}
|
|
395
|
+
showBackdrop={false}
|
|
396
|
+
>
|
|
397
|
+
<div className="space-y-4">
|
|
398
|
+
<h3 className="font-semibold text-lg">No Backdrop</h3>
|
|
399
|
+
<p className="text-muted-foreground">
|
|
400
|
+
This sheet doesn't have a backdrop overlay.
|
|
401
|
+
You can still interact with the content behind.
|
|
402
|
+
</p>
|
|
403
|
+
</div>
|
|
404
|
+
</WakaBottomSheet>
|
|
405
|
+
</div>
|
|
406
|
+
)
|
|
407
|
+
},
|
|
408
|
+
}
|