@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,153 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { ScrollArea, ScrollBar } from './index'
|
|
3
|
+
import { Separator } from '../separator'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof ScrollArea> = {
|
|
6
|
+
title: 'Components/ScrollArea',
|
|
7
|
+
component: ScrollArea,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Augments native scroll functionality for custom, cross-browser styling.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof ScrollArea>
|
|
21
|
+
|
|
22
|
+
const tags = Array.from({ length: 50 }).map(
|
|
23
|
+
(_, i, a) => `v1.2.0-beta.${a.length - i}`
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export const Default: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
className: 'h-72 w-48 rounded-md border',
|
|
29
|
+
},
|
|
30
|
+
render: (args) => (
|
|
31
|
+
<ScrollArea {...args}>
|
|
32
|
+
<div className="p-4">
|
|
33
|
+
<h4 className="mb-4 text-sm font-medium leading-none">Tags</h4>
|
|
34
|
+
{tags.map((tag) => (
|
|
35
|
+
<div key={tag}>
|
|
36
|
+
<div className="text-sm">{tag}</div>
|
|
37
|
+
<Separator className="my-2" />
|
|
38
|
+
</div>
|
|
39
|
+
))}
|
|
40
|
+
</div>
|
|
41
|
+
</ScrollArea>
|
|
42
|
+
),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const works = [
|
|
46
|
+
{ artist: "Ornella Binni", art: "Artwork 1" },
|
|
47
|
+
{ artist: "Tom Byrom", art: "Artwork 2" },
|
|
48
|
+
{ artist: "Vladimir Malyutin", art: "Artwork 3" },
|
|
49
|
+
{ artist: "Jane Doe", art: "Artwork 4" },
|
|
50
|
+
{ artist: "John Smith", art: "Artwork 5" },
|
|
51
|
+
{ artist: "Alice Brown", art: "Artwork 6" },
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
export const Horizontal: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<ScrollArea className="w-96 whitespace-nowrap rounded-md border">
|
|
57
|
+
<div className="flex w-max space-x-4 p-4">
|
|
58
|
+
{works.map((work) => (
|
|
59
|
+
<figure key={work.artist} className="shrink-0">
|
|
60
|
+
<div className="h-32 w-48 rounded-md bg-muted" />
|
|
61
|
+
<figcaption className="pt-2 text-xs text-muted-foreground">
|
|
62
|
+
Photo by{" "}
|
|
63
|
+
<span className="font-semibold text-foreground">
|
|
64
|
+
{work.artist}
|
|
65
|
+
</span>
|
|
66
|
+
</figcaption>
|
|
67
|
+
</figure>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
<ScrollBar orientation="horizontal" />
|
|
71
|
+
</ScrollArea>
|
|
72
|
+
),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const items = Array.from({ length: 20 }).map((_, i) => ({
|
|
76
|
+
id: i + 1,
|
|
77
|
+
title: `Item ${i + 1}`,
|
|
78
|
+
description: `Description for item ${i + 1}`,
|
|
79
|
+
}))
|
|
80
|
+
|
|
81
|
+
export const List: Story = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<ScrollArea className="h-[300px] w-[350px] rounded-md border p-4">
|
|
84
|
+
<h4 className="mb-4 text-sm font-medium leading-none">Items</h4>
|
|
85
|
+
<div className="space-y-4">
|
|
86
|
+
{items.map((item) => (
|
|
87
|
+
<div key={item.id} className="flex items-center space-x-4">
|
|
88
|
+
<div className="h-8 w-8 rounded-full bg-muted flex items-center justify-center text-xs">
|
|
89
|
+
{item.id}
|
|
90
|
+
</div>
|
|
91
|
+
<div>
|
|
92
|
+
<p className="text-sm font-medium">{item.title}</p>
|
|
93
|
+
<p className="text-xs text-muted-foreground">{item.description}</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
</ScrollArea>
|
|
99
|
+
),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const Card: Story = {
|
|
103
|
+
render: () => (
|
|
104
|
+
<div className="rounded-lg border w-[350px]">
|
|
105
|
+
<div className="p-4 border-b">
|
|
106
|
+
<h3 className="font-medium">Notifications</h3>
|
|
107
|
+
<p className="text-sm text-muted-foreground">You have 20 unread messages.</p>
|
|
108
|
+
</div>
|
|
109
|
+
<ScrollArea className="h-[200px]">
|
|
110
|
+
<div className="p-4 space-y-4">
|
|
111
|
+
{Array.from({ length: 10 }).map((_, i) => (
|
|
112
|
+
<div key={i} className="flex items-start space-x-3">
|
|
113
|
+
<div className="h-8 w-8 rounded-full bg-primary/10" />
|
|
114
|
+
<div className="flex-1">
|
|
115
|
+
<p className="text-sm font-medium">Notification {i + 1}</p>
|
|
116
|
+
<p className="text-xs text-muted-foreground">2 minutes ago</p>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
</ScrollArea>
|
|
122
|
+
</div>
|
|
123
|
+
),
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const CodeBlock: Story = {
|
|
127
|
+
render: () => (
|
|
128
|
+
<ScrollArea className="h-[200px] w-[400px] rounded-md border bg-muted/50 p-4">
|
|
129
|
+
<pre className="text-sm">
|
|
130
|
+
<code>{`function fibonacci(n) {
|
|
131
|
+
if (n <= 1) return n;
|
|
132
|
+
return fibonacci(n - 1) + fibonacci(n - 2);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Example usage
|
|
136
|
+
console.log(fibonacci(10)); // 55
|
|
137
|
+
|
|
138
|
+
// More complex example
|
|
139
|
+
const memoFib = (function() {
|
|
140
|
+
const cache = {};
|
|
141
|
+
return function fib(n) {
|
|
142
|
+
if (n in cache) return cache[n];
|
|
143
|
+
if (n <= 1) return n;
|
|
144
|
+
cache[n] = fib(n - 1) + fib(n - 2);
|
|
145
|
+
return cache[n];
|
|
146
|
+
};
|
|
147
|
+
})();
|
|
148
|
+
|
|
149
|
+
console.log(memoFib(100));`}</code>
|
|
150
|
+
</pre>
|
|
151
|
+
</ScrollArea>
|
|
152
|
+
),
|
|
153
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import {
|
|
3
|
+
Select,
|
|
4
|
+
SelectContent,
|
|
5
|
+
SelectGroup,
|
|
6
|
+
SelectItem,
|
|
7
|
+
SelectLabel,
|
|
8
|
+
SelectTrigger,
|
|
9
|
+
SelectValue,
|
|
10
|
+
SelectSeparator,
|
|
11
|
+
} from './index'
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Select> = {
|
|
14
|
+
title: 'Components/Select',
|
|
15
|
+
component: Select,
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: 'centered',
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component: 'Displays a list of options for the user to pick from, triggered by a button.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
tags: ['autodocs'],
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof Select>
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
args: {},
|
|
32
|
+
render: (args) => (
|
|
33
|
+
<Select {...args}>
|
|
34
|
+
<SelectTrigger className="w-[180px]">
|
|
35
|
+
<SelectValue placeholder="Select a fruit" />
|
|
36
|
+
</SelectTrigger>
|
|
37
|
+
<SelectContent>
|
|
38
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
39
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
40
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
41
|
+
<SelectItem value="grape">Grape</SelectItem>
|
|
42
|
+
<SelectItem value="mango">Mango</SelectItem>
|
|
43
|
+
</SelectContent>
|
|
44
|
+
</Select>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const WithGroups: Story = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<Select>
|
|
51
|
+
<SelectTrigger className="w-[200px]">
|
|
52
|
+
<SelectValue placeholder="Select a timezone" />
|
|
53
|
+
</SelectTrigger>
|
|
54
|
+
<SelectContent>
|
|
55
|
+
<SelectGroup>
|
|
56
|
+
<SelectLabel>North America</SelectLabel>
|
|
57
|
+
<SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
|
|
58
|
+
<SelectItem value="cst">Central Standard Time (CST)</SelectItem>
|
|
59
|
+
<SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
|
|
60
|
+
</SelectGroup>
|
|
61
|
+
<SelectSeparator />
|
|
62
|
+
<SelectGroup>
|
|
63
|
+
<SelectLabel>Europe</SelectLabel>
|
|
64
|
+
<SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
|
|
65
|
+
<SelectItem value="cet">Central European Time (CET)</SelectItem>
|
|
66
|
+
</SelectGroup>
|
|
67
|
+
</SelectContent>
|
|
68
|
+
</Select>
|
|
69
|
+
),
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const WithDefaultValue: Story = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<Select defaultValue="banana">
|
|
75
|
+
<SelectTrigger className="w-[180px]">
|
|
76
|
+
<SelectValue />
|
|
77
|
+
</SelectTrigger>
|
|
78
|
+
<SelectContent>
|
|
79
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
80
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
81
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
82
|
+
</SelectContent>
|
|
83
|
+
</Select>
|
|
84
|
+
),
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const Disabled: Story = {
|
|
88
|
+
render: () => (
|
|
89
|
+
<div className="flex flex-col gap-4">
|
|
90
|
+
<Select disabled>
|
|
91
|
+
<SelectTrigger className="w-[180px]">
|
|
92
|
+
<SelectValue placeholder="Disabled select" />
|
|
93
|
+
</SelectTrigger>
|
|
94
|
+
<SelectContent>
|
|
95
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
96
|
+
</SelectContent>
|
|
97
|
+
</Select>
|
|
98
|
+
<Select>
|
|
99
|
+
<SelectTrigger className="w-[180px]">
|
|
100
|
+
<SelectValue placeholder="Select a fruit" />
|
|
101
|
+
</SelectTrigger>
|
|
102
|
+
<SelectContent>
|
|
103
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
104
|
+
<SelectItem value="banana" disabled>Banana (out of stock)</SelectItem>
|
|
105
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
106
|
+
</SelectContent>
|
|
107
|
+
</Select>
|
|
108
|
+
</div>
|
|
109
|
+
),
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const WithForm: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<form className="space-y-4 w-[300px]">
|
|
115
|
+
<div className="space-y-2">
|
|
116
|
+
<label className="text-sm font-medium">Country</label>
|
|
117
|
+
<Select>
|
|
118
|
+
<SelectTrigger>
|
|
119
|
+
<SelectValue placeholder="Select a country" />
|
|
120
|
+
</SelectTrigger>
|
|
121
|
+
<SelectContent>
|
|
122
|
+
<SelectItem value="us">United States</SelectItem>
|
|
123
|
+
<SelectItem value="uk">United Kingdom</SelectItem>
|
|
124
|
+
<SelectItem value="fr">France</SelectItem>
|
|
125
|
+
<SelectItem value="de">Germany</SelectItem>
|
|
126
|
+
<SelectItem value="jp">Japan</SelectItem>
|
|
127
|
+
</SelectContent>
|
|
128
|
+
</Select>
|
|
129
|
+
</div>
|
|
130
|
+
<div className="space-y-2">
|
|
131
|
+
<label className="text-sm font-medium">Language</label>
|
|
132
|
+
<Select defaultValue="en">
|
|
133
|
+
<SelectTrigger>
|
|
134
|
+
<SelectValue />
|
|
135
|
+
</SelectTrigger>
|
|
136
|
+
<SelectContent>
|
|
137
|
+
<SelectItem value="en">English</SelectItem>
|
|
138
|
+
<SelectItem value="fr">French</SelectItem>
|
|
139
|
+
<SelectItem value="de">German</SelectItem>
|
|
140
|
+
<SelectItem value="ja">Japanese</SelectItem>
|
|
141
|
+
</SelectContent>
|
|
142
|
+
</Select>
|
|
143
|
+
</div>
|
|
144
|
+
</form>
|
|
145
|
+
),
|
|
146
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { Separator } from './index'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Separator> = {
|
|
5
|
+
title: 'Components/Separator',
|
|
6
|
+
component: Separator,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'Visually or semantically separates content.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
orientation: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['horizontal', 'vertical'],
|
|
20
|
+
description: 'The orientation of the separator',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
26
|
+
type Story = StoryObj<typeof Separator>
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
className: 'my-4',
|
|
31
|
+
},
|
|
32
|
+
render: (args) => (
|
|
33
|
+
<div className="w-[300px]">
|
|
34
|
+
<div className="space-y-1">
|
|
35
|
+
<h4 className="text-sm font-medium leading-none">Radix Primitives</h4>
|
|
36
|
+
<p className="text-sm text-muted-foreground">
|
|
37
|
+
An open-source UI component library.
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
<Separator {...args} />
|
|
41
|
+
<div className="flex h-5 items-center space-x-4 text-sm">
|
|
42
|
+
<div>Blog</div>
|
|
43
|
+
<Separator orientation="vertical" />
|
|
44
|
+
<div>Docs</div>
|
|
45
|
+
<Separator orientation="vertical" />
|
|
46
|
+
<div>Source</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
),
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Horizontal: Story = {
|
|
53
|
+
render: () => (
|
|
54
|
+
<div className="w-[300px] space-y-4">
|
|
55
|
+
<p className="text-sm">Section 1 content goes here.</p>
|
|
56
|
+
<Separator />
|
|
57
|
+
<p className="text-sm">Section 2 content goes here.</p>
|
|
58
|
+
<Separator />
|
|
59
|
+
<p className="text-sm">Section 3 content goes here.</p>
|
|
60
|
+
</div>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Vertical: Story = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<div className="flex h-10 items-center space-x-4">
|
|
67
|
+
<span className="text-sm">Home</span>
|
|
68
|
+
<Separator orientation="vertical" />
|
|
69
|
+
<span className="text-sm">About</span>
|
|
70
|
+
<Separator orientation="vertical" />
|
|
71
|
+
<span className="text-sm">Contact</span>
|
|
72
|
+
</div>
|
|
73
|
+
),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const InCard: Story = {
|
|
77
|
+
render: () => (
|
|
78
|
+
<div className="w-[350px] rounded-lg border p-4">
|
|
79
|
+
<div className="flex items-center justify-between">
|
|
80
|
+
<div>
|
|
81
|
+
<h3 className="font-medium">Subscription</h3>
|
|
82
|
+
<p className="text-sm text-muted-foreground">Manage your plan</p>
|
|
83
|
+
</div>
|
|
84
|
+
<span className="text-sm font-medium text-primary">Pro Plan</span>
|
|
85
|
+
</div>
|
|
86
|
+
<Separator className="my-4" />
|
|
87
|
+
<div className="space-y-2">
|
|
88
|
+
<div className="flex justify-between text-sm">
|
|
89
|
+
<span className="text-muted-foreground">Next billing date</span>
|
|
90
|
+
<span>January 1, 2024</span>
|
|
91
|
+
</div>
|
|
92
|
+
<div className="flex justify-between text-sm">
|
|
93
|
+
<span className="text-muted-foreground">Amount</span>
|
|
94
|
+
<span>$29/month</span>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const WithIcons: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<div className="flex items-center space-x-2">
|
|
104
|
+
<div className="flex items-center space-x-1">
|
|
105
|
+
<span className="text-sm">10 likes</span>
|
|
106
|
+
</div>
|
|
107
|
+
<Separator orientation="vertical" className="h-4" />
|
|
108
|
+
<div className="flex items-center space-x-1">
|
|
109
|
+
<span className="text-sm">5 comments</span>
|
|
110
|
+
</div>
|
|
111
|
+
<Separator orientation="vertical" className="h-4" />
|
|
112
|
+
<div className="flex items-center space-x-1">
|
|
113
|
+
<span className="text-sm">3 shares</span>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
),
|
|
117
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import {
|
|
3
|
+
Sheet,
|
|
4
|
+
SheetContent,
|
|
5
|
+
SheetDescription,
|
|
6
|
+
SheetHeader,
|
|
7
|
+
SheetTitle,
|
|
8
|
+
SheetTrigger,
|
|
9
|
+
SheetFooter,
|
|
10
|
+
SheetClose,
|
|
11
|
+
} from './index'
|
|
12
|
+
import { Button } from '../button'
|
|
13
|
+
import { Input } from '../input'
|
|
14
|
+
import { Label } from '../label'
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof Sheet> = {
|
|
17
|
+
title: 'Components/Sheet',
|
|
18
|
+
component: Sheet,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'centered',
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component: 'Extends the Dialog component to display content that complements the main content of the screen. Slides in from the edge of the screen.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default meta
|
|
31
|
+
type Story = StoryObj<typeof Sheet>
|
|
32
|
+
|
|
33
|
+
export const Default: Story = {
|
|
34
|
+
args: {},
|
|
35
|
+
render: (args) => (
|
|
36
|
+
<Sheet {...args}>
|
|
37
|
+
<SheetTrigger asChild>
|
|
38
|
+
<Button variant="outline">Open Sheet</Button>
|
|
39
|
+
</SheetTrigger>
|
|
40
|
+
<SheetContent>
|
|
41
|
+
<SheetHeader>
|
|
42
|
+
<SheetTitle>Edit profile</SheetTitle>
|
|
43
|
+
<SheetDescription>
|
|
44
|
+
Make changes to your profile here. Click save when you're done.
|
|
45
|
+
</SheetDescription>
|
|
46
|
+
</SheetHeader>
|
|
47
|
+
<div className="grid gap-4 py-4">
|
|
48
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
49
|
+
<Label htmlFor="name" className="text-right">
|
|
50
|
+
Name
|
|
51
|
+
</Label>
|
|
52
|
+
<Input id="name" value="Pedro Duarte" className="col-span-3" />
|
|
53
|
+
</div>
|
|
54
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
55
|
+
<Label htmlFor="username" className="text-right">
|
|
56
|
+
Username
|
|
57
|
+
</Label>
|
|
58
|
+
<Input id="username" value="@peduarte" className="col-span-3" />
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<SheetFooter>
|
|
62
|
+
<SheetClose asChild>
|
|
63
|
+
<Button type="submit">Save changes</Button>
|
|
64
|
+
</SheetClose>
|
|
65
|
+
</SheetFooter>
|
|
66
|
+
</SheetContent>
|
|
67
|
+
</Sheet>
|
|
68
|
+
),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Sides: Story = {
|
|
72
|
+
render: () => (
|
|
73
|
+
<div className="flex gap-4">
|
|
74
|
+
<Sheet>
|
|
75
|
+
<SheetTrigger asChild>
|
|
76
|
+
<Button variant="outline">Left</Button>
|
|
77
|
+
</SheetTrigger>
|
|
78
|
+
<SheetContent side="left">
|
|
79
|
+
<SheetHeader>
|
|
80
|
+
<SheetTitle>Left Sheet</SheetTitle>
|
|
81
|
+
<SheetDescription>This sheet slides in from the left.</SheetDescription>
|
|
82
|
+
</SheetHeader>
|
|
83
|
+
</SheetContent>
|
|
84
|
+
</Sheet>
|
|
85
|
+
<Sheet>
|
|
86
|
+
<SheetTrigger asChild>
|
|
87
|
+
<Button variant="outline">Right</Button>
|
|
88
|
+
</SheetTrigger>
|
|
89
|
+
<SheetContent side="right">
|
|
90
|
+
<SheetHeader>
|
|
91
|
+
<SheetTitle>Right Sheet</SheetTitle>
|
|
92
|
+
<SheetDescription>This sheet slides in from the right.</SheetDescription>
|
|
93
|
+
</SheetHeader>
|
|
94
|
+
</SheetContent>
|
|
95
|
+
</Sheet>
|
|
96
|
+
<Sheet>
|
|
97
|
+
<SheetTrigger asChild>
|
|
98
|
+
<Button variant="outline">Top</Button>
|
|
99
|
+
</SheetTrigger>
|
|
100
|
+
<SheetContent side="top">
|
|
101
|
+
<SheetHeader>
|
|
102
|
+
<SheetTitle>Top Sheet</SheetTitle>
|
|
103
|
+
<SheetDescription>This sheet slides in from the top.</SheetDescription>
|
|
104
|
+
</SheetHeader>
|
|
105
|
+
</SheetContent>
|
|
106
|
+
</Sheet>
|
|
107
|
+
<Sheet>
|
|
108
|
+
<SheetTrigger asChild>
|
|
109
|
+
<Button variant="outline">Bottom</Button>
|
|
110
|
+
</SheetTrigger>
|
|
111
|
+
<SheetContent side="bottom">
|
|
112
|
+
<SheetHeader>
|
|
113
|
+
<SheetTitle>Bottom Sheet</SheetTitle>
|
|
114
|
+
<SheetDescription>This sheet slides in from the bottom.</SheetDescription>
|
|
115
|
+
</SheetHeader>
|
|
116
|
+
</SheetContent>
|
|
117
|
+
</Sheet>
|
|
118
|
+
</div>
|
|
119
|
+
),
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const WithForm: Story = {
|
|
123
|
+
render: () => (
|
|
124
|
+
<Sheet>
|
|
125
|
+
<SheetTrigger asChild>
|
|
126
|
+
<Button>Create Account</Button>
|
|
127
|
+
</SheetTrigger>
|
|
128
|
+
<SheetContent>
|
|
129
|
+
<SheetHeader>
|
|
130
|
+
<SheetTitle>Create account</SheetTitle>
|
|
131
|
+
<SheetDescription>
|
|
132
|
+
Fill in the details below to create your account.
|
|
133
|
+
</SheetDescription>
|
|
134
|
+
</SheetHeader>
|
|
135
|
+
<form className="space-y-4 py-4">
|
|
136
|
+
<div className="space-y-2">
|
|
137
|
+
<Label htmlFor="email">Email</Label>
|
|
138
|
+
<Input id="email" type="email" placeholder="m@example.com" />
|
|
139
|
+
</div>
|
|
140
|
+
<div className="space-y-2">
|
|
141
|
+
<Label htmlFor="password">Password</Label>
|
|
142
|
+
<Input id="password" type="password" />
|
|
143
|
+
</div>
|
|
144
|
+
<div className="space-y-2">
|
|
145
|
+
<Label htmlFor="confirm">Confirm Password</Label>
|
|
146
|
+
<Input id="confirm" type="password" />
|
|
147
|
+
</div>
|
|
148
|
+
</form>
|
|
149
|
+
<SheetFooter>
|
|
150
|
+
<SheetClose asChild>
|
|
151
|
+
<Button variant="outline">Cancel</Button>
|
|
152
|
+
</SheetClose>
|
|
153
|
+
<Button type="submit">Create</Button>
|
|
154
|
+
</SheetFooter>
|
|
155
|
+
</SheetContent>
|
|
156
|
+
</Sheet>
|
|
157
|
+
),
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const Navigation: Story = {
|
|
161
|
+
render: () => (
|
|
162
|
+
<Sheet>
|
|
163
|
+
<SheetTrigger asChild>
|
|
164
|
+
<Button variant="ghost" size="icon">
|
|
165
|
+
<svg
|
|
166
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
167
|
+
width="24"
|
|
168
|
+
height="24"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
fill="none"
|
|
171
|
+
stroke="currentColor"
|
|
172
|
+
strokeWidth="2"
|
|
173
|
+
strokeLinecap="round"
|
|
174
|
+
strokeLinejoin="round"
|
|
175
|
+
>
|
|
176
|
+
<line x1="4" x2="20" y1="12" y2="12" />
|
|
177
|
+
<line x1="4" x2="20" y1="6" y2="6" />
|
|
178
|
+
<line x1="4" x2="20" y1="18" y2="18" />
|
|
179
|
+
</svg>
|
|
180
|
+
</Button>
|
|
181
|
+
</SheetTrigger>
|
|
182
|
+
<SheetContent side="left">
|
|
183
|
+
<SheetHeader>
|
|
184
|
+
<SheetTitle>Navigation</SheetTitle>
|
|
185
|
+
</SheetHeader>
|
|
186
|
+
<nav className="grid gap-2 py-4">
|
|
187
|
+
<a href="#" className="block px-2 py-1 text-lg hover:underline">Home</a>
|
|
188
|
+
<a href="#" className="block px-2 py-1 text-lg hover:underline">About</a>
|
|
189
|
+
<a href="#" className="block px-2 py-1 text-lg hover:underline">Services</a>
|
|
190
|
+
<a href="#" className="block px-2 py-1 text-lg hover:underline">Contact</a>
|
|
191
|
+
</nav>
|
|
192
|
+
</SheetContent>
|
|
193
|
+
</Sheet>
|
|
194
|
+
),
|
|
195
|
+
}
|