@papercraneai/cli 1.6.0-beta.2 → 1.6.1
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/bin/papercrane.js +38 -16
- package/components/dashboard-grid.tsx +1 -1
- package/package.json +1 -1
package/bin/papercrane.js
CHANGED
|
@@ -581,6 +581,7 @@ import { useEffect, useState } from 'react'
|
|
|
581
581
|
import * as actions from './action'
|
|
582
582
|
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
|
|
583
583
|
import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig } from '@/components/ui/chart'
|
|
584
|
+
import { DashboardGrid } from '@/components/dashboard-grid'
|
|
584
585
|
import { BarChart, Bar, XAxis, YAxis } from 'recharts'
|
|
585
586
|
|
|
586
587
|
// Use semantic chart colors: var(--chart-1) through var(--chart-5)
|
|
@@ -603,22 +604,28 @@ export default function MyDashboard() {
|
|
|
603
604
|
return (
|
|
604
605
|
<div className="min-h-screen p-6 bg-background text-foreground">
|
|
605
606
|
<h1 className="text-2xl font-bold mb-6">My Dashboard</h1>
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
<
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
607
|
+
<DashboardGrid cols={4} rowHeight={140} gap={16}>
|
|
608
|
+
<Card id="metric-card" className="col-start-1 col-span-2 row-start-1 row-span-1 bg-card border-border">
|
|
609
|
+
<CardHeader><CardTitle className="text-muted-foreground">Metric</CardTitle></CardHeader>
|
|
610
|
+
<CardContent>
|
|
611
|
+
<p className="text-2xl font-bold">1,234</p>
|
|
612
|
+
<span className="text-green-500 text-sm">↑ 12%</span>
|
|
613
|
+
</CardContent>
|
|
614
|
+
</Card>
|
|
615
|
+
<Card id="chart-card" className="col-start-1 col-span-4 row-start-2 row-span-2 bg-card border-border">
|
|
616
|
+
<CardHeader><CardTitle className="text-muted-foreground">Chart Title</CardTitle></CardHeader>
|
|
617
|
+
<CardContent>
|
|
618
|
+
<ChartContainer config={chartConfig} className="h-[300px] w-full">
|
|
619
|
+
<BarChart data={data}>
|
|
620
|
+
<XAxis dataKey="name" stroke="var(--muted-foreground)" />
|
|
621
|
+
<YAxis stroke="var(--muted-foreground)" />
|
|
622
|
+
<ChartTooltip content={<ChartTooltipContent />} />
|
|
623
|
+
<Bar dataKey="value" fill="var(--color-value)" />
|
|
624
|
+
</BarChart>
|
|
625
|
+
</ChartContainer>
|
|
626
|
+
</CardContent>
|
|
627
|
+
</Card>
|
|
628
|
+
</DashboardGrid>
|
|
622
629
|
</div>
|
|
623
630
|
)
|
|
624
631
|
}`)}
|
|
@@ -636,6 +643,18 @@ Use these Tailwind classes for theme-aware colors:
|
|
|
636
643
|
${chalk.green('Axis/Labels:')} var(--muted-foreground) for XAxis/YAxis stroke
|
|
637
644
|
`);
|
|
638
645
|
|
|
646
|
+
console.log(chalk.bold('DASHBOARD GRID LAYOUT'));
|
|
647
|
+
console.log(chalk.dim('─'.repeat(60)));
|
|
648
|
+
console.log(`
|
|
649
|
+
${chalk.green('✅')} Wrap dashboard widgets in ${chalk.cyan('<DashboardGrid cols={4} rowHeight={140} gap={16}>')}
|
|
650
|
+
${chalk.green('✅')} Give each child a unique ${chalk.cyan('id')} attribute (e.g. id="revenue-chart")
|
|
651
|
+
${chalk.green('✅')} Add grid placement classes: ${chalk.cyan('col-start-N col-span-N row-start-N row-span-N')}
|
|
652
|
+
${chalk.green('✅')} Grid is 4 columns. col-start: 1-4, col-span: 1-4, row-start: 1+, row-span: 1+
|
|
653
|
+
${chalk.red('❌')} Do NOT use responsive grid classes (grid-cols-2 md:grid-cols-4)
|
|
654
|
+
${chalk.red('❌')} Do NOT use sm:/md:/lg: breakpoint prefixes on grid placement classes
|
|
655
|
+
${chalk.dim(' Header/title sections above DashboardGrid are fine as plain divs')}
|
|
656
|
+
`);
|
|
657
|
+
|
|
639
658
|
console.log(chalk.bold('AVAILABLE COMPONENTS'));
|
|
640
659
|
console.log(chalk.dim('─'.repeat(60)));
|
|
641
660
|
console.log(`
|
|
@@ -643,6 +662,9 @@ Use these Tailwind classes for theme-aware colors:
|
|
|
643
662
|
Card, CardHeader, CardTitle, CardContent, CardDescription
|
|
644
663
|
Button, Input, Select, Table, Badge, Tabs
|
|
645
664
|
|
|
665
|
+
${chalk.green('Layout:')}
|
|
666
|
+
DashboardGrid (from @/components/dashboard-grid)
|
|
667
|
+
|
|
646
668
|
${chalk.green('Chart Components:')}
|
|
647
669
|
ChartContainer, ChartTooltip, ChartTooltipContent (from @/components/ui/chart)
|
|
648
670
|
BarChart, LineChart, AreaChart, PieChart (from recharts)
|
|
@@ -24,7 +24,7 @@ export function DashboardGrid(props: DashboardGridProps) {
|
|
|
24
24
|
async function loadPlugin() {
|
|
25
25
|
try {
|
|
26
26
|
const pkg = "@papercrane/" + "dashboard-grid/plugin"
|
|
27
|
-
const mod = await import(pkg)
|
|
27
|
+
const mod = await import(/* turbopackIgnore: true */ pkg)
|
|
28
28
|
if (mod.createPlugin) {
|
|
29
29
|
const plugin = mod.createPlugin()
|
|
30
30
|
pluginGrid = plugin.DashboardGrid
|