@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,431 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { ReleaseNotes, defaultReleases } from './index'
|
|
3
|
+
import type { Release, ChangeItem, Contributor, ChangeType, ReleaseType, ReleaseStatus } from './index'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof ReleaseNotes> = {
|
|
7
|
+
title: 'Blocks/ReleaseNotes',
|
|
8
|
+
component: ReleaseNotes,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'A release notes component for managing and displaying software releases with changelog, contributors, filtering, and publishing workflow.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
argTypes: {
|
|
20
|
+
showEditor: {
|
|
21
|
+
control: 'boolean',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof ReleaseNotes>
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<div className="p-6">
|
|
32
|
+
<ReleaseNotes
|
|
33
|
+
releases={defaultReleases}
|
|
34
|
+
onCreateRelease={() => console.log('Create release')}
|
|
35
|
+
onEditRelease={(release) => console.log('Edit:', release)}
|
|
36
|
+
onPublishRelease={(release) => console.log('Publish:', release)}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
),
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const SingleRelease: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<div className="p-6">
|
|
45
|
+
<ReleaseNotes
|
|
46
|
+
releases={[defaultReleases[0]]}
|
|
47
|
+
onEditRelease={(release) => console.log('Edit:', release)}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const ManyReleases: Story = {
|
|
54
|
+
render: () => {
|
|
55
|
+
const manyReleases: Release[] = [
|
|
56
|
+
...defaultReleases,
|
|
57
|
+
{
|
|
58
|
+
id: '4',
|
|
59
|
+
version: 'v2.4.0',
|
|
60
|
+
releaseType: 'minor',
|
|
61
|
+
status: 'published',
|
|
62
|
+
publishedAt: new Date(Date.now() - 30 * 24 * 3600000),
|
|
63
|
+
createdAt: new Date(Date.now() - 32 * 24 * 3600000),
|
|
64
|
+
contributors: [],
|
|
65
|
+
changes: [
|
|
66
|
+
{ id: 'c14', type: 'feature', title: 'Added export to CSV functionality' },
|
|
67
|
+
{ id: 'c15', type: 'improvement', title: 'Improved table sorting performance' },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: '5',
|
|
72
|
+
version: 'v2.3.2',
|
|
73
|
+
releaseType: 'patch',
|
|
74
|
+
status: 'published',
|
|
75
|
+
publishedAt: new Date(Date.now() - 45 * 24 * 3600000),
|
|
76
|
+
createdAt: new Date(Date.now() - 46 * 24 * 3600000),
|
|
77
|
+
contributors: [],
|
|
78
|
+
changes: [
|
|
79
|
+
{ id: 'c16', type: 'fix', title: 'Fixed tooltip position on mobile' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: '6',
|
|
84
|
+
version: 'v2.3.1',
|
|
85
|
+
releaseType: 'patch',
|
|
86
|
+
status: 'published',
|
|
87
|
+
publishedAt: new Date(Date.now() - 60 * 24 * 3600000),
|
|
88
|
+
createdAt: new Date(Date.now() - 61 * 24 * 3600000),
|
|
89
|
+
contributors: [],
|
|
90
|
+
changes: [
|
|
91
|
+
{ id: 'c17', type: 'fix', title: 'Fixed login redirect issue' },
|
|
92
|
+
{ id: 'c18', type: 'fix', title: 'Fixed form validation messages' },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<div className="p-6">
|
|
99
|
+
<ReleaseNotes
|
|
100
|
+
releases={manyReleases}
|
|
101
|
+
onCreateRelease={() => console.log('Create release')}
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const WithBreakingChanges: Story = {
|
|
109
|
+
render: () => {
|
|
110
|
+
const breakingRelease: Release = {
|
|
111
|
+
id: 'breaking',
|
|
112
|
+
version: 'v4.0.0',
|
|
113
|
+
name: 'Major Update',
|
|
114
|
+
releaseType: 'major',
|
|
115
|
+
status: 'published',
|
|
116
|
+
publishedAt: new Date(),
|
|
117
|
+
createdAt: new Date(Date.now() - 7 * 24 * 3600000),
|
|
118
|
+
summary: 'This major release contains breaking changes. Please review the upgrade notes carefully.',
|
|
119
|
+
upgradeNotes: 'Before upgrading, ensure you have migrated all deprecated API calls to the new format. Database schema changes are required - run the migration script before deploying.',
|
|
120
|
+
contributors: [
|
|
121
|
+
{ id: '1', name: 'John Doe', username: 'johndoe' },
|
|
122
|
+
{ id: '2', name: 'Jane Smith', username: 'janesmith' },
|
|
123
|
+
],
|
|
124
|
+
changes: [
|
|
125
|
+
{
|
|
126
|
+
id: 'b1',
|
|
127
|
+
type: 'breaking',
|
|
128
|
+
title: 'Removed deprecated v1 API endpoints',
|
|
129
|
+
description: 'All v1 endpoints have been removed. Use v2 endpoints instead.',
|
|
130
|
+
breaking: true,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'b2',
|
|
134
|
+
type: 'breaking',
|
|
135
|
+
title: 'Changed authentication token format',
|
|
136
|
+
description: 'Tokens now use JWT format. Old tokens will be invalidated on upgrade.',
|
|
137
|
+
breaking: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'b3',
|
|
141
|
+
type: 'feature',
|
|
142
|
+
title: 'New plugin architecture',
|
|
143
|
+
description: 'Extensible plugin system for custom integrations',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'b4',
|
|
147
|
+
type: 'security',
|
|
148
|
+
title: 'Enhanced encryption for sensitive data',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<div className="p-6">
|
|
155
|
+
<ReleaseNotes releases={[breakingRelease]} />
|
|
156
|
+
</div>
|
|
157
|
+
)
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const DraftRelease: Story = {
|
|
162
|
+
render: () => {
|
|
163
|
+
const draftRelease: Release = {
|
|
164
|
+
id: 'draft',
|
|
165
|
+
version: 'v2.6.0',
|
|
166
|
+
name: 'Upcoming Release',
|
|
167
|
+
releaseType: 'minor',
|
|
168
|
+
status: 'draft',
|
|
169
|
+
createdAt: new Date(),
|
|
170
|
+
contributors: [
|
|
171
|
+
{ id: '1', name: 'John Doe', username: 'johndoe' },
|
|
172
|
+
],
|
|
173
|
+
changes: [
|
|
174
|
+
{ id: 'd1', type: 'feature', title: 'New feature in progress' },
|
|
175
|
+
{ id: 'd2', type: 'improvement', title: 'Performance improvements' },
|
|
176
|
+
],
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<div className="p-6">
|
|
181
|
+
<ReleaseNotes
|
|
182
|
+
releases={[draftRelease]}
|
|
183
|
+
onEditRelease={(release) => console.log('Edit:', release)}
|
|
184
|
+
onPublishRelease={(release) => console.log('Publish:', release)}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
)
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const ScheduledRelease: Story = {
|
|
192
|
+
render: () => {
|
|
193
|
+
const scheduledRelease: Release = {
|
|
194
|
+
id: 'scheduled',
|
|
195
|
+
version: 'v2.5.1',
|
|
196
|
+
releaseType: 'patch',
|
|
197
|
+
status: 'scheduled',
|
|
198
|
+
scheduledAt: new Date(Date.now() + 3 * 24 * 3600000),
|
|
199
|
+
createdAt: new Date(),
|
|
200
|
+
contributors: [],
|
|
201
|
+
changes: [
|
|
202
|
+
{ id: 's1', type: 'fix', title: 'Bug fix for date handling' },
|
|
203
|
+
{ id: 's2', type: 'fix', title: 'Fixed memory leak in background worker' },
|
|
204
|
+
],
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<div className="p-6">
|
|
209
|
+
<ReleaseNotes
|
|
210
|
+
releases={[scheduledRelease]}
|
|
211
|
+
onEditRelease={(release) => console.log('Edit:', release)}
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
)
|
|
215
|
+
},
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const AllChangeTypes: Story = {
|
|
219
|
+
render: () => {
|
|
220
|
+
const allTypesRelease: Release = {
|
|
221
|
+
id: 'all-types',
|
|
222
|
+
version: 'v3.0.0',
|
|
223
|
+
releaseType: 'major',
|
|
224
|
+
status: 'published',
|
|
225
|
+
publishedAt: new Date(),
|
|
226
|
+
createdAt: new Date(Date.now() - 7 * 24 * 3600000),
|
|
227
|
+
contributors: [
|
|
228
|
+
{ id: '1', name: 'Developer', username: 'dev' },
|
|
229
|
+
],
|
|
230
|
+
changes: [
|
|
231
|
+
{ id: 't1', type: 'feature', title: 'New authentication module', description: 'Added OAuth2 and SAML support' },
|
|
232
|
+
{ id: 't2', type: 'fix', title: 'Fixed login redirect loop' },
|
|
233
|
+
{ id: 't3', type: 'improvement', title: 'Improved dashboard loading speed' },
|
|
234
|
+
{ id: 't4', type: 'breaking', title: 'Changed API response format', breaking: true },
|
|
235
|
+
{ id: 't5', type: 'security', title: 'Patched XSS vulnerability in comments' },
|
|
236
|
+
{ id: 't6', type: 'performance', title: 'Reduced bundle size by 40%' },
|
|
237
|
+
{ id: 't7', type: 'docs', title: 'Updated API documentation' },
|
|
238
|
+
{ id: 't8', type: 'deprecation', title: 'Deprecated legacy theme system' },
|
|
239
|
+
],
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
<div className="p-6">
|
|
244
|
+
<ReleaseNotes releases={[allTypesRelease]} />
|
|
245
|
+
</div>
|
|
246
|
+
)
|
|
247
|
+
},
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export const WithPullRequests: Story = {
|
|
251
|
+
render: () => {
|
|
252
|
+
const prRelease: Release = {
|
|
253
|
+
id: 'pr-release',
|
|
254
|
+
version: 'v2.5.2',
|
|
255
|
+
releaseType: 'patch',
|
|
256
|
+
status: 'published',
|
|
257
|
+
publishedAt: new Date(),
|
|
258
|
+
createdAt: new Date(Date.now() - 2 * 24 * 3600000),
|
|
259
|
+
compareUrl: 'https://github.com/example/repo/compare/v2.5.1...v2.5.2',
|
|
260
|
+
contributors: [
|
|
261
|
+
{ id: '1', name: 'Alice', username: 'alice' },
|
|
262
|
+
{ id: '2', name: 'Bob', username: 'bob' },
|
|
263
|
+
],
|
|
264
|
+
changes: [
|
|
265
|
+
{
|
|
266
|
+
id: 'pr1',
|
|
267
|
+
type: 'fix',
|
|
268
|
+
title: 'Fixed date picker timezone issue',
|
|
269
|
+
pullRequest: { number: 456, url: 'https://github.com/example/repo/pull/456' },
|
|
270
|
+
contributors: [{ id: '1', name: 'Alice', username: 'alice' }],
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: 'pr2',
|
|
274
|
+
type: 'fix',
|
|
275
|
+
title: 'Fixed modal close animation',
|
|
276
|
+
pullRequest: { number: 458, url: 'https://github.com/example/repo/pull/458' },
|
|
277
|
+
contributors: [{ id: '2', name: 'Bob', username: 'bob' }],
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return (
|
|
283
|
+
<div className="p-6">
|
|
284
|
+
<ReleaseNotes releases={[prRelease]} />
|
|
285
|
+
</div>
|
|
286
|
+
)
|
|
287
|
+
},
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export const EmptyState: Story = {
|
|
291
|
+
render: () => (
|
|
292
|
+
<div className="p-6">
|
|
293
|
+
<ReleaseNotes
|
|
294
|
+
releases={[]}
|
|
295
|
+
onCreateRelease={() => console.log('Create first release')}
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
),
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export const ReadOnly: Story = {
|
|
302
|
+
render: () => (
|
|
303
|
+
<div className="p-6">
|
|
304
|
+
<ReleaseNotes releases={defaultReleases} />
|
|
305
|
+
</div>
|
|
306
|
+
),
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export const Interactive: Story = {
|
|
310
|
+
render: () => {
|
|
311
|
+
const [releases, setReleases] = React.useState<Release[]>(defaultReleases)
|
|
312
|
+
|
|
313
|
+
const handleCreateRelease = () => {
|
|
314
|
+
const newRelease: Release = {
|
|
315
|
+
id: `release-${Date.now()}`,
|
|
316
|
+
version: 'v2.6.0',
|
|
317
|
+
releaseType: 'minor',
|
|
318
|
+
status: 'draft',
|
|
319
|
+
createdAt: new Date(),
|
|
320
|
+
contributors: [],
|
|
321
|
+
changes: [],
|
|
322
|
+
}
|
|
323
|
+
setReleases(prev => [newRelease, ...prev])
|
|
324
|
+
alert('New draft release created!')
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const handlePublish = (release: Release) => {
|
|
328
|
+
setReleases(prev =>
|
|
329
|
+
prev.map(r =>
|
|
330
|
+
r.id === release.id
|
|
331
|
+
? { ...r, status: 'published' as ReleaseStatus, publishedAt: new Date() }
|
|
332
|
+
: r
|
|
333
|
+
)
|
|
334
|
+
)
|
|
335
|
+
alert(`Published ${release.version}!`)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const handleEdit = (release: Release) => {
|
|
339
|
+
alert(`Editing ${release.version}...`)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return (
|
|
343
|
+
<div className="p-6">
|
|
344
|
+
<ReleaseNotes
|
|
345
|
+
releases={releases}
|
|
346
|
+
onCreateRelease={handleCreateRelease}
|
|
347
|
+
onEditRelease={handleEdit}
|
|
348
|
+
onPublishRelease={handlePublish}
|
|
349
|
+
/>
|
|
350
|
+
</div>
|
|
351
|
+
)
|
|
352
|
+
},
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export const ProjectChangelog: Story = {
|
|
356
|
+
render: () => (
|
|
357
|
+
<div className="min-h-screen bg-muted/30">
|
|
358
|
+
<header className="bg-background border-b px-6 py-4">
|
|
359
|
+
<div className="flex items-center justify-between max-w-5xl mx-auto">
|
|
360
|
+
<div>
|
|
361
|
+
<h1 className="font-bold text-xl">Changelog</h1>
|
|
362
|
+
<p className="text-sm text-muted-foreground">@wakastellar/ui</p>
|
|
363
|
+
</div>
|
|
364
|
+
<nav className="flex gap-4 text-sm">
|
|
365
|
+
<a href="#" className="text-muted-foreground hover:text-foreground">Documentation</a>
|
|
366
|
+
<a href="#" className="text-foreground font-medium">Changelog</a>
|
|
367
|
+
<a href="#" className="text-muted-foreground hover:text-foreground">GitHub</a>
|
|
368
|
+
</nav>
|
|
369
|
+
</div>
|
|
370
|
+
</header>
|
|
371
|
+
<main className="max-w-5xl mx-auto p-6">
|
|
372
|
+
<ReleaseNotes releases={defaultReleases} />
|
|
373
|
+
</main>
|
|
374
|
+
</div>
|
|
375
|
+
),
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const WithFilters: Story = {
|
|
379
|
+
render: () => {
|
|
380
|
+
const mixedReleases: Release[] = [
|
|
381
|
+
{
|
|
382
|
+
id: '1',
|
|
383
|
+
version: 'v3.0.0-beta.2',
|
|
384
|
+
releaseType: 'prerelease',
|
|
385
|
+
status: 'draft',
|
|
386
|
+
createdAt: new Date(),
|
|
387
|
+
contributors: [],
|
|
388
|
+
changes: [{ id: 'c1', type: 'feature', title: 'Beta feature' }],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
id: '2',
|
|
392
|
+
version: 'v2.5.0',
|
|
393
|
+
releaseType: 'minor',
|
|
394
|
+
status: 'published',
|
|
395
|
+
publishedAt: new Date(Date.now() - 7 * 24 * 3600000),
|
|
396
|
+
createdAt: new Date(Date.now() - 10 * 24 * 3600000),
|
|
397
|
+
contributors: [],
|
|
398
|
+
changes: [{ id: 'c2', type: 'feature', title: 'New feature' }],
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: '3',
|
|
402
|
+
version: 'v2.4.1',
|
|
403
|
+
releaseType: 'patch',
|
|
404
|
+
status: 'published',
|
|
405
|
+
publishedAt: new Date(Date.now() - 14 * 24 * 3600000),
|
|
406
|
+
createdAt: new Date(Date.now() - 15 * 24 * 3600000),
|
|
407
|
+
contributors: [],
|
|
408
|
+
changes: [{ id: 'c3', type: 'fix', title: 'Bug fix' }],
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
id: '4',
|
|
412
|
+
version: 'v2.0.0',
|
|
413
|
+
releaseType: 'major',
|
|
414
|
+
status: 'published',
|
|
415
|
+
publishedAt: new Date(Date.now() - 60 * 24 * 3600000),
|
|
416
|
+
createdAt: new Date(Date.now() - 65 * 24 * 3600000),
|
|
417
|
+
contributors: [],
|
|
418
|
+
changes: [{ id: 'c4', type: 'breaking', title: 'Breaking change', breaking: true }],
|
|
419
|
+
},
|
|
420
|
+
]
|
|
421
|
+
|
|
422
|
+
return (
|
|
423
|
+
<div className="p-6">
|
|
424
|
+
<ReleaseNotes
|
|
425
|
+
releases={mixedReleases}
|
|
426
|
+
onCreateRelease={() => console.log('Create')}
|
|
427
|
+
/>
|
|
428
|
+
</div>
|
|
429
|
+
)
|
|
430
|
+
},
|
|
431
|
+
}
|