Skip to content

Commit f9cef50

Browse files
style: auto-fix formatting
1 parent 593895c commit f9cef50

64 files changed

Lines changed: 582 additions & 564 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

showcase/integrations/langgraph-python/src/app/demos/a2ui-fixed-schema/_components/button.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ const sizeClasses: Record<Size, string> = {
2626
lg: "h-11 rounded-md px-6",
2727
};
2828

29-
export interface ButtonProps
30-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
29+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3130
variant?: Variant;
3231
size?: Size;
3332
}

showcase/integrations/langgraph-python/src/app/demos/agent-config/demo-layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export function DemoLayout({
2828
onResponseLengthChange={onResponseLengthChange}
2929
/>
3030
<div className="flex-1 overflow-hidden rounded-md border border-[var(--border)]">
31-
<CopilotChat agentId="agent-config-demo" className="h-full rounded-md" />
31+
<CopilotChat
32+
agentId="agent-config-demo"
33+
className="h-full rounded-md"
34+
/>
3235
</div>
3336
</div>
3437
);

showcase/integrations/langgraph-python/src/app/demos/byoc-hashbrown/hashbrown-renderer.tsx

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,30 @@ function parseChartData(data: string): ChartSlice[] | null {
3838
}
3939
}
4040

41-
function PieChartWithStringData({ title, data }: { title: string; data: string }) {
41+
function PieChartWithStringData({
42+
title,
43+
data,
44+
}: {
45+
title: string;
46+
data: string;
47+
}) {
4248
const parsed = parseChartData(data);
43-
return parsed ? <PieChart title={title} description="" data={parsed} /> : null;
49+
return parsed ? (
50+
<PieChart title={title} description="" data={parsed} />
51+
) : null;
4452
}
4553

46-
function BarChartWithStringData({ title, data }: { title: string; data: string }) {
54+
function BarChartWithStringData({
55+
title,
56+
data,
57+
}: {
58+
title: string;
59+
data: string;
60+
}) {
4761
const parsed = parseChartData(data);
48-
return parsed ? <BarChart title={title} description="" data={parsed} /> : null;
62+
return parsed ? (
63+
<BarChart title={title} description="" data={parsed} />
64+
) : null;
4965
}
5066

5167
const STAGE_COLORS: Record<SalesStage, string> = {
@@ -171,7 +187,11 @@ function useSalesDashboardKit() {
171187
type Kit = ReturnType<typeof useSalesDashboardKit>;
172188
const HashBrownKitContext = createContext<Kit | null>(null);
173189

174-
export function HashBrownDashboard({ children }: { children?: React.ReactNode }) {
190+
export function HashBrownDashboard({
191+
children,
192+
}: {
193+
children?: React.ReactNode;
194+
}) {
175195
const kit = useSalesDashboardKit();
176196
return (
177197
<HashBrownKitContext.Provider value={kit}>
@@ -211,7 +231,9 @@ export function HashBrownRenderMessage({
211231
}) {
212232
const kit = useContext(HashBrownKitContext);
213233
if (!kit)
214-
throw new Error("HashBrownRenderMessage must be used within HashBrownDashboard");
234+
throw new Error(
235+
"HashBrownRenderMessage must be used within HashBrownDashboard",
236+
);
215237
if (message.role !== "assistant") return null;
216238
return <AssistantMessage content={message.content ?? ""} kit={kit} />;
217239
}

showcase/integrations/langgraph-python/src/app/demos/byoc-json-render/charts/bar-chart.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export function BarChart({ title, description, data }: BarChartComponentProps) {
6363
{title}
6464
</h3>
6565
{description ? (
66-
<p className="text-sm text-[var(--muted-foreground)]">{description}</p>
66+
<p className="text-sm text-[var(--muted-foreground)]">
67+
{description}
68+
</p>
6769
) : null}
6870
</div>
6971
<div className="p-6 pt-2">
@@ -73,7 +75,11 @@ export function BarChart({ title, description, data }: BarChartComponentProps) {
7375
data={data}
7476
margin={{ top: 12, right: 12, bottom: 4, left: -8 }}
7577
>
76-
<CartesianGrid strokeDasharray="3 3" stroke="var(--border)" vertical={false} />
78+
<CartesianGrid
79+
strokeDasharray="3 3"
80+
stroke="var(--border)"
81+
vertical={false}
82+
/>
7783
<XAxis
7884
dataKey="label"
7985
tick={{ fontSize: 12, fill: "var(--muted-foreground)" }}
@@ -98,7 +104,9 @@ export function BarChart({ title, description, data }: BarChartComponentProps) {
98104
maxBarSize={48}
99105
shape={(props: unknown) => {
100106
const p = props as Record<string, unknown>;
101-
return <AnimatedBar {...p} isNew={isNew(p.index as number)} />;
107+
return (
108+
<AnimatedBar {...p} isNew={isNew(p.index as number)} />
109+
);
102110
}}
103111
>
104112
{data.map((_, i) => (

showcase/integrations/langgraph-python/src/app/demos/byoc-json-render/charts/pie-chart.tsx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export interface PieChartComponentProps {
1313
data: PieChartDatum[];
1414
}
1515

16-
function DonutChart({ data, size = 240, strokeWidth = 40 }: {
16+
function DonutChart({
17+
data,
18+
size = 240,
19+
strokeWidth = 40,
20+
}: {
1721
data: PieChartDatum[];
1822
size?: number;
1923
strokeWidth?: number;
@@ -25,10 +29,16 @@ function DonutChart({ data, size = 240, strokeWidth = 40 }: {
2529

2630
let accumulated = 0;
2731
const slices = data.map((item, i) => {
28-
const arc = (total > 0 ? (Number(item.value) || 0) / total : 0) * circumference;
32+
const arc =
33+
(total > 0 ? (Number(item.value) || 0) / total : 0) * circumference;
2934
const dashoffset = -accumulated;
3035
accumulated += arc;
31-
return { arc, gap: circumference - arc, dashoffset, color: CHART_COLORS[i % CHART_COLORS.length] };
36+
return {
37+
arc,
38+
gap: circumference - arc,
39+
dashoffset,
40+
color: CHART_COLORS[i % CHART_COLORS.length],
41+
};
3242
});
3343

3444
return (
@@ -38,7 +48,14 @@ function DonutChart({ data, size = 240, strokeWidth = 40 }: {
3848
className="block mx-auto"
3949
style={{ maxWidth: size, transform: "scaleX(-1)" }}
4050
>
41-
<circle cx={center} cy={center} r={radius} fill="none" stroke="var(--secondary)" strokeWidth={strokeWidth} />
51+
<circle
52+
cx={center}
53+
cy={center}
54+
r={radius}
55+
fill="none"
56+
stroke="var(--secondary)"
57+
strokeWidth={strokeWidth}
58+
/>
4259
{slices.map((s, i) => (
4360
<circle
4461
key={i}
@@ -60,7 +77,9 @@ function DonutChart({ data, size = 240, strokeWidth = 40 }: {
6077

6178
export function PieChart({ title, description, data }: PieChartComponentProps) {
6279
const hasData = Array.isArray(data) && data.length > 0;
63-
const total = hasData ? data.reduce((sum, d) => sum + (Number(d.value) || 0), 0) : 0;
80+
const total = hasData
81+
? data.reduce((sum, d) => sum + (Number(d.value) || 0), 0)
82+
: 0;
6483

6584
return (
6685
<div
@@ -72,7 +91,9 @@ export function PieChart({ title, description, data }: PieChartComponentProps) {
7291
{title}
7392
</h3>
7493
{description ? (
75-
<p className="text-sm text-[var(--muted-foreground)]">{description}</p>
94+
<p className="text-sm text-[var(--muted-foreground)]">
95+
{description}
96+
</p>
7697
) : null}
7798
</div>
7899
<div className="p-6 pt-4">
@@ -87,9 +108,13 @@ export function PieChart({ title, description, data }: PieChartComponentProps) {
87108
<div key={i} className="flex items-center gap-3 text-sm">
88109
<span
89110
className="inline-block h-3 w-3 rounded-full shrink-0"
90-
style={{ backgroundColor: CHART_COLORS[i % CHART_COLORS.length] }}
111+
style={{
112+
backgroundColor: CHART_COLORS[i % CHART_COLORS.length],
113+
}}
91114
/>
92-
<span className="flex-1 text-[var(--foreground)] truncate">{item.label}</span>
115+
<span className="flex-1 text-[var(--foreground)] truncate">
116+
{item.label}
117+
</span>
93118
<span className="text-[var(--muted-foreground)] tabular-nums">
94119
{val.toLocaleString()}
95120
</span>

showcase/integrations/langgraph-python/src/app/demos/byoc-json-render/json-render-renderer.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import type { JsonRenderSpec } from "./types";
1111

1212
const ALLOWED_TYPES = new Set(["MetricCard", "BarChart", "PieChart"]);
1313

14-
export function JsonRenderAssistantMessage(props: CopilotChatAssistantMessageProps) {
14+
export function JsonRenderAssistantMessage(
15+
props: CopilotChatAssistantMessageProps,
16+
) {
1517
const content =
1618
typeof props.message.content === "string" ? props.message.content : "";
1719
const spec = useMemo(() => parseSpec(content), [content]);
@@ -77,13 +79,19 @@ function extractJsonObject(raw: string): string | null {
7779
let escape = false;
7880
for (let i = start; i < candidate.length; i++) {
7981
const ch = candidate[i];
80-
if (escape) { escape = false; continue; }
82+
if (escape) {
83+
escape = false;
84+
continue;
85+
}
8186
if (inString) {
8287
if (ch === "\\") escape = true;
8388
else if (ch === '"') inString = false;
8489
continue;
8590
}
86-
if (ch === '"') { inString = true; continue; }
91+
if (ch === '"') {
92+
inString = true;
93+
continue;
94+
}
8795
if (ch === "{") depth++;
8896
else if (ch === "}" && --depth === 0) return candidate.slice(start, i + 1);
8997
}

showcase/integrations/langgraph-python/src/app/demos/byoc-json-render/metric-card.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export function MetricCard({ label, value, trend }: MetricCardComponentProps) {
3131
);
3232
}
3333

34-
function inferTrendDirection(trend: string | null | undefined): "up" | "down" | "neutral" {
34+
function inferTrendDirection(
35+
trend: string | null | undefined,
36+
): "up" | "down" | "neutral" {
3537
const t = trend?.trim();
3638
if (!t) return "neutral";
3739
if (t.startsWith("+")) return "up";

showcase/integrations/langgraph-python/src/app/demos/byoc-json-render/registry.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export const { registry } = defineRegistry(catalog, {
1313
{children}
1414
</div>
1515
),
16-
BarChart: ({ props }) => <BarChart {...(props as BarChartComponentProps)} />,
17-
PieChart: ({ props }) => <PieChart {...(props as PieChartComponentProps)} />,
16+
BarChart: ({ props }) => (
17+
<BarChart {...(props as BarChartComponentProps)} />
18+
),
19+
PieChart: ({ props }) => (
20+
<PieChart {...(props as PieChartComponentProps)} />
21+
),
1822
},
1923
});
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export interface JsonRenderSpec {
22
root: string;
3-
elements: Record<string, { type: string; props: Record<string, unknown>; children?: string[] }>;
3+
elements: Record<
4+
string,
5+
{ type: string; props: Record<string, unknown>; children?: string[] }
6+
>;
47
}

showcase/integrations/langgraph-python/src/app/demos/chat-customization-css/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ You'll see:
7575
- Fonts load from Google Fonts via `@import` at the top of `theme.css`
7676
so the demo is self-contained — copy the file into another project and
7777
the theme works end-to-end
78-
- Reach for slots (see `chat-slots`) when you need to change *what* a
78+
- Reach for slots (see `chat-slots`) when you need to change _what_ a
7979
piece renders, not just how it looks; reach for CSS — like this demo —
8080
when the default structure is fine and you only need a different
8181
visual identity

0 commit comments

Comments
 (0)