Skip to content

armgit / ui

Public Imported from GitHub
0
TypeScript

Add Glide CSV viewer docs demo

Andrew Luo2919a66e4727
diff --git a/apps/v4/app/globals.css b/apps/v4/app/globals.css
index e4338e0..f347995 100644
--- a/apps/v4/app/globals.css
+++ b/apps/v4/app/globals.css
@@ -1,5 +1,6 @@
@import "tailwindcss";
@import "tw-animate-css";
+@import "../node_modules/@glideapps/glide-data-grid/dist/index.css";
@import "react-pdf/dist/Page/TextLayer.css";
@import "./shadcn-tailwind.css";
@import "./legacy-themes.css";
diff --git a/apps/v4/components/csv-viewer-docs.tsx b/apps/v4/components/csv-viewer-docs.tsx
new file mode 100644
index 0000000..cfbcc12
--- /dev/null
+++ b/apps/v4/components/csv-viewer-docs.tsx
@@ -0,0 +1,856 @@
+"use client"
+
+import * as React from "react"
+import type * as GlideDataGrid from "@glideapps/glide-data-grid"
+import type {
+ GridCell,
+ GridCellKind,
+ GridColumn,
+ Item,
+ Theme,
+} from "@glideapps/glide-data-grid"
+import {
+ MinusSignCircleIcon,
+ PlusSignCircleIcon,
+ TableIcon,
+ Upload01Icon,
+} from "@hugeicons/core-free-icons"
+import { HugeiconsIcon } from "@hugeicons/react"
+import Papa from "papaparse"
+
+import { HighlightedCodeBlock } from "@/components/highlighted-code-block"
+import { Button } from "@/registry/new-york-v4/ui/button"
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/registry/new-york-v4/ui/select"
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/registry/new-york-v4/ui/tooltip"
+
+const SAMPLE_CSV = `Invoice,Customer,Status,Amount,Submitted
+INV-1001,Northstar Supply,Approved,4280.50,2026-04-28
+INV-1002,Bluebird Medical,Needs review,1190.00,2026-04-29
+INV-1003,Aster Logistics,Approved,845.75,2026-04-30
+INV-1004,Juniper Foods,Exception,3499.99,2026-05-01
+INV-1005,Keystone Labs,Approved,920.10,2026-05-02
+INV-1006,Monarch Studio,Processing,1510.45,2026-05-03
+INV-1007,Orchard Bank,Approved,7820.00,2026-05-04
+INV-1008,Riverstone Energy,Needs review,632.25,2026-05-05
+INV-1009,Summit Health,Approved,2730.00,2026-05-06
+INV-1010,Westhaven Legal,Processing,410.80,2026-05-07`
+
+const ZOOM_OPTIONS = [0.75, 1, 1.25, 1.5, 2] as const
+type GlideDataGridModule = typeof GlideDataGrid
+
+function toDisplayString(value: unknown): string {
+ return value === null || value === undefined ? "" : String(value)
+}
+
+function normalizeHeaderTitle(header: string, index: number): string {
+ const trimmed = header.trim()
+ return trimmed.length > 0 ? trimmed : `Column ${index + 1}`
+}
+
+function parseDelimitedText(text: string): {
+ headers: string[]
+ rows: string[][]
+ error: string | null
+} {
+ const results = Papa.parse<Record<string, unknown>>(text, {
+ header: true,
+ skipEmptyLines: "greedy",
+ })
+
+ const objectRows = Array.isArray(results.data)
+ ? results.data.filter(
+ (row): row is Record<string, unknown> =>
+ !!row && typeof row === "object" && !Array.isArray(row)
+ )
+ : []
+ const metaFields = Array.isArray(results.meta.fields)
+ ? results.meta.fields.map((field) => String(field))
+ : []
+ const fieldKeys =
+ metaFields.length > 0
+ ? metaFields
+ : Object.keys(objectRows[0] ?? {}).filter(
+ (key) => key !== "__parsed_extra"
+ )
+ const extraColumnCount = objectRows.reduce((maxCount, row) => {
+ const extras = row.__parsed_extra
+ return Array.isArray(extras) ? Math.max(maxCount, extras.length) : maxCount
+ }, 0)
+ const headers = [
+ ...fieldKeys.map((field, index) => normalizeHeaderTitle(field, index)),
+ ...Array.from(
+ { length: extraColumnCount },
+ (_, index) => `Extra ${index + 1}`
+ ),
+ ]
+
+ const rows = objectRows.map((row) => {
+ const baseValues = fieldKeys.map((fieldKey) =>
+ toDisplayString(row[fieldKey])
+ )
+ const extras = Array.isArray(row.__parsed_extra)
+ ? row.__parsed_extra.map((value) => toDisplayString(value))
+ : []
+ const paddedExtras =
+ extras.length >= extraColumnCount
+ ? extras.slice(0, extraColumnCount)
+ : [
+ ...extras,
+ ...Array.from(
+ { length: extraColumnCount - extras.length },
+ () => ""
+ ),
+ ]
+
+ return [...baseValues, ...paddedExtras]
+ })
+
+ const firstError =
+ Array.isArray(results.errors) && results.errors.length > 0
+ ? results.errors[0]
+ : null
+
+ return {
+ headers,
+ rows,
+ error:
+ rows.length === 0 && firstError
+ ? String(firstError.message ?? "Could not parse CSV file.")
+ : null,
+ }
+}
+
+function useIsDarkTheme() {
+ const [isDark, setIsDark] = React.useState(false)
+
+ React.useEffect(() => {
+ const update = () =>
+ setIsDark(document.documentElement.classList.contains("dark"))
+ update()
+
+ const observer = new MutationObserver(update)
+ observer.observe(document.documentElement, {
+ attributeFilter: ["class"],
+ attributes: true,
+ })
+
+ return () => observer.disconnect()
+ }, [])
+
+ return isDark
+}
+
+function ToolbarTooltip({
+ label,
+ children,
+}: {
+ label: string
+ children: React.ReactNode
+}) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="inline-flex">{children}</span>
+ </TooltipTrigger>
+ <TooltipContent side="bottom">{label}</TooltipContent>
+ </Tooltip>
+ )
+}
+
+function CsvViewerPreviewClient() {
+ const inputRef = React.useRef<HTMLInputElement | null>(null)
+ const isDark = useIsDarkTheme()
+ const [glide, setGlide] = React.useState<GlideDataGridModule | null>(null)
+ const [fileName, setFileName] = React.useState("invoice-review.csv")
+ const [zoom, setZoom] = React.useState<(typeof ZOOM_OPTIONS)[number]>(1)
+ const [parsed, setParsed] = React.useState(() => parseDelimitedText(SAMPLE_CSV))
+ const [isPending, setIsPending] = React.useState(false)
+
+ React.useEffect(() => {
+ let mounted = true
+
+ void import("@glideapps/glide-data-grid").then((module) => {
+ if (mounted) {
+ setGlide(module)
+ }
+ })
+
+ return () => {
+ mounted = false
+ }
+ }, [])
+
+ const columnCount = Math.max(1, parsed.headers.length)
+ const scale = React.useCallback((value: number) => Math.round(value * zoom), [
+ zoom,
+ ])
+
+ const theme = React.useMemo<Partial<Theme>>(
+ () => ({
+ accentColor: isDark ? "#60a5fa" : "#2563eb",
+ accentLight: isDark ? "#1d4ed826" : "#dbeafe",
+ accentFg: "#ffffff",
+ textDark: isDark ? "#e5e5e5" : "#171717",
+ textMedium: isDark ? "#a3a3a3" : "#525252",
+ textLight: isDark ? "#737373" : "#a3a3a3",
+ textBubble: isDark ? "#f5f5f5" : "#171717",
+ textHeader: isDark ? "#f5f5f5" : "#171717",
+ textGroupHeader: isDark ? "#a3a3a3" : "#525252",
+ bgCell: isDark ? "#0a0a0a" : "#ffffff",
+ bgCellMedium: isDark ? "#171717" : "#fafafa",
+ bgHeader: isDark ? "#171717" : "#fafafa",
+ bgHeaderHasFocus: isDark ? "#262626" : "#f5f5f5",
+ bgHeaderHovered: isDark ? "#262626" : "#f5f5f5",
+ borderColor: isDark ? "#262626" : "#e5e5e5",
+ horizontalBorderColor: isDark ? "#262626" : "#e5e5e5",
+ baseFontStyle: `${scale(13)}px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,
+ headerFontStyle: `600 ${scale(13)}px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`,
+ }),
+ [isDark, scale]
+ )
+
+ const columns = React.useMemo<GridColumn[]>(
+ () =>
+ Array.from({ length: columnCount }, (_, index) => ({
+ id: `column-${index}`,
+ title: parsed.headers[index] ?? `Column ${index + 1}`,
+ width: scale(index === 0 ? 180 : 160),
+ })),
+ [columnCount, parsed.headers, scale]
+ )
+
+ const getCellContent = React.useCallback(
+ ([col, row]: Item): GridCell => {
+ const value = parsed.rows[row]?.[col] ?? ""
+ const textKind = glide?.GridCellKind.Text as GridCellKind.Text
+
+ return {
+ kind: textKind,
+ data: value,
+ displayData: value,
+ allowOverlay: true,
+ readonly: true,
+ }
+ },
+ [glide, parsed.rows]
+ )
+
+ async function handleUpload(event: React.ChangeEvent<HTMLInputElement>) {
+ const file = event.target.files?.[0]
+ if (!file) return
+
+ setIsPending(true)
+ try {
+ const text = await file.text()
+ setParsed(parseDelimitedText(text))
+ setFileName(file.name)
+ } catch (error) {
+ setParsed({
+ headers: [],
+ rows: [],
+ error:
+ error instanceof Error ? error.message : "Could not read CSV file.",
+ })
+ } finally {
+ event.target.value = ""
+ setIsPending(false)
+ }
+ }
+
+ function stepZoom(direction: -1 | 1) {
+ const index = ZOOM_OPTIONS.indexOf(zoom)
+ const nextIndex = Math.min(
+ ZOOM_OPTIONS.length - 1,
+ Math.max(0, index + direction)
+ )
+ setZoom(ZOOM_OPTIONS[nextIndex])
+ }
+
+ return (
+ <div className="flex h-[560px] w-full flex-col overflow-hidden bg-background">
+ <div className="flex min-h-12 items-center justify-between gap-3 border-b px-3">
+ <div className="flex min-w-0 items-center gap-3">
+ <div className="flex size-7 shrink-0 items-center justify-center rounded-md border bg-muted text-muted-foreground">
+ <HugeiconsIcon icon={TableIcon} className="size-4" />
+ </div>
+ <div className="min-w-0">
+ <div className="truncate text-sm font-medium text-foreground">
+ {fileName}
+ </div>
+ <div className="text-xs text-muted-foreground">
+ {parsed.rows.length.toLocaleString()} rows -{" "}
+ {parsed.headers.length.toLocaleString()} columns
+ </div>
+ </div>
+ </div>
+ <TooltipProvider>
+ <div className="ml-auto flex shrink-0 items-center gap-1">
+ <ToolbarTooltip label="Zoom out">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Zoom out"
+ disabled={zoom <= ZOOM_OPTIONS[0]}
+ onClick={() => stepZoom(-1)}
+ >
+ <HugeiconsIcon icon={MinusSignCircleIcon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ <Select
+ value={zoom.toString()}
+ onValueChange={(value) =>
+ setZoom(Number(value) as (typeof ZOOM_OPTIONS)[number])
+ }
+ >
+ <SelectTrigger
+ size="sm"
+ className="h-7 min-h-7 w-[74px] min-w-[74px] rounded-md"
+ aria-label="Zoom level"
+ >
+ <SelectValue>{Math.round(zoom * 100)}%</SelectValue>
+ </SelectTrigger>
+ <SelectContent align="end">
+ {ZOOM_OPTIONS.map((option) => (
+ <SelectItem key={option} value={option.toString()}>
+ {Math.round(option * 100)}%
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <ToolbarTooltip label="Zoom in">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Zoom in"
+ disabled={zoom >= ZOOM_OPTIONS[ZOOM_OPTIONS.length - 1]}
+ onClick={() => stepZoom(1)}
+ >
+ <HugeiconsIcon icon={PlusSignCircleIcon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ <input
+ ref={inputRef}
+ type="file"
+ accept=".csv,.tsv,text/csv,text/tab-separated-values"
+ className="hidden"
+ onChange={handleUpload}
+ />
+ <ToolbarTooltip label="Upload CSV">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Upload CSV"
+ loading={isPending}
+ onClick={() => inputRef.current?.click()}
+ >
+ <HugeiconsIcon icon={Upload01Icon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ </div>
+ </TooltipProvider>
+ </div>
+ <div className="min-h-0 flex-1">
+ {parsed.error ? (
+ <div className="flex h-full items-center justify-center px-4 text-center text-sm text-destructive">
+ {parsed.error}
+ </div>
+ ) : !glide ? (
+ <div className="flex h-full items-center justify-center text-sm text-muted-foreground">
+ Loading grid...
+ </div>
+ ) : (
+ <glide.DataEditor
+ key={zoom}
+ columns={columns}
+ rows={parsed.rows.length}
+ getCellContent={getCellContent}
+ rowMarkers="number"
+ rowSelectionMode="multi"
+ keybindings={{ search: true }}
+ smoothScrollX
+ smoothScrollY
+ getCellsForSelection
+ width="100%"
+ height="100%"
+ theme={theme}
+ rowHeight={scale(34)}
+ headerHeight={scale(36)}
+ />
+ )}
+ </div>
+ </div>
+ )
+}
+
+const csvViewerUsageCode = `"use client";
+
+import * as React from "react";
+import type * as GlideDataGrid from "@glideapps/glide-data-grid";
+import type {
+ GridCell,
+ GridCellKind,
+ GridColumn,
+ Item,
+ Theme,
+} from "@glideapps/glide-data-grid";
+import {
+ MinusSignCircleIcon,
+ PlusSignCircleIcon,
+ TableIcon,
+ Upload01Icon,
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import Papa from "papaparse";
+
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+
+type CsvViewerProps = {
+ csvText?: string;
+ fileName?: string;
+ className?: string;
+};
+
+const SAMPLE_CSV = "Invoice,Customer,Status,Amount,Submitted\\nINV-1001,Northstar Supply,Approved,4280.50,2026-04-28\\nINV-1002,Bluebird Medical,Needs review,1190.00,2026-04-29\\nINV-1003,Aster Logistics,Approved,845.75,2026-04-30";
+
+const ZOOM_OPTIONS = [0.75, 1, 1.25, 1.5, 2] as const;
+type GlideDataGridModule = typeof GlideDataGrid;
+
+function toDisplayString(value: unknown): string {
+ return value === null || value === undefined ? "" : String(value);
+}
+
+function normalizeHeaderTitle(header: string, index: number): string {
+ const trimmed = header.trim();
+ return trimmed.length > 0 ? trimmed : "Column " + (index + 1);
+}
+
+function parseDelimitedText(text: string): {
+ headers: string[];
+ rows: string[][];
+ error: string | null;
+} {
+ const results = Papa.parse<Record<string, unknown>>(text, {
+ header: true,
+ skipEmptyLines: "greedy",
+ });
+
+ const objectRows = Array.isArray(results.data)
+ ? results.data.filter(
+ (row): row is Record<string, unknown> =>
+ !!row && typeof row === "object" && !Array.isArray(row),
+ )
+ : [];
+ const metaFields = Array.isArray(results.meta.fields)
+ ? results.meta.fields.map((field) => String(field))
+ : [];
+ const fieldKeys =
+ metaFields.length > 0
+ ? metaFields
+ : Object.keys(objectRows[0] ?? {}).filter(
+ (key) => key !== "__parsed_extra",
+ );
+ const extraColumnCount = objectRows.reduce((maxCount, row) => {
+ const extras = row.__parsed_extra;
+ return Array.isArray(extras) ? Math.max(maxCount, extras.length) : maxCount;
+ }, 0);
+ const headers = [
+ ...fieldKeys.map((field, index) => normalizeHeaderTitle(field, index)),
+ ...Array.from(
+ { length: extraColumnCount },
+ (_, index) => "Extra " + (index + 1),
+ ),
+ ];
+
+ const rows = objectRows.map((row) => {
+ const baseValues = fieldKeys.map((fieldKey) =>
+ toDisplayString(row[fieldKey]),
+ );
+ const extras = Array.isArray(row.__parsed_extra)
+ ? row.__parsed_extra.map((value) => toDisplayString(value))
+ : [];
+ const paddedExtras =
+ extras.length >= extraColumnCount
+ ? extras.slice(0, extraColumnCount)
+ : [
+ ...extras,
+ ...Array.from(
+ { length: extraColumnCount - extras.length },
+ () => "",
+ ),
+ ];
+
+ return [...baseValues, ...paddedExtras];
+ });
+
+ const firstError =
+ Array.isArray(results.errors) && results.errors.length > 0
+ ? results.errors[0]
+ : null;
+
+ return {
+ headers,
+ rows,
+ error:
+ rows.length === 0 && firstError
+ ? String(firstError.message ?? "Could not parse CSV file.")
+ : null,
+ };
+}
+
+function useIsDarkTheme() {
+ const [isDark, setIsDark] = React.useState(false);
+
+ React.useEffect(() => {
+ const update = () =>
+ setIsDark(document.documentElement.classList.contains("dark"));
+ update();
+
+ const observer = new MutationObserver(update);
+ observer.observe(document.documentElement, {
+ attributeFilter: ["class"],
+ attributes: true,
+ });
+
+ return () => observer.disconnect();
+ }, []);
+
+ return isDark;
+}
+
+function ToolbarTooltip({
+ label,
+ children,
+}: {
+ label: string;
+ children: React.ReactNode;
+}) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="inline-flex">{children}</span>
+ </TooltipTrigger>
+ <TooltipContent side="bottom">{label}</TooltipContent>
+ </Tooltip>
+ );
+}
+
+export function CsvViewer({
+ csvText = SAMPLE_CSV,
+ fileName: initialFileName = "invoice-review.csv",
+ className,
+}: CsvViewerProps) {
+ const inputRef = React.useRef<HTMLInputElement | null>(null);
+ const isDark = useIsDarkTheme();
+ const [glide, setGlide] = React.useState<GlideDataGridModule | null>(null);
+ const [fileName, setFileName] = React.useState(initialFileName);
+ const [zoom, setZoom] = React.useState<(typeof ZOOM_OPTIONS)[number]>(1);
+ const [parsed, setParsed] = React.useState(() => parseDelimitedText(csvText));
+ const [isPending, setIsPending] = React.useState(false);
+
+ React.useEffect(() => {
+ let mounted = true;
+
+ void import("@glideapps/glide-data-grid").then((module) => {
+ if (mounted) {
+ setGlide(module);
+ }
+ });
+
+ return () => {
+ mounted = false;
+ };
+ }, []);
+
+ const columnCount = Math.max(1, parsed.headers.length);
+ const scale = React.useCallback(
+ (value: number) => Math.round(value * zoom),
+ [zoom],
+ );
+
+ const theme = React.useMemo<Partial<Theme>>(
+ () => ({
+ accentColor: isDark ? "#60a5fa" : "#2563eb",
+ accentLight: isDark ? "#1d4ed826" : "#dbeafe",
+ accentFg: "#ffffff",
+ textDark: isDark ? "#e5e5e5" : "#171717",
+ textMedium: isDark ? "#a3a3a3" : "#525252",
+ textLight: isDark ? "#737373" : "#a3a3a3",
+ textBubble: isDark ? "#f5f5f5" : "#171717",
+ textHeader: isDark ? "#f5f5f5" : "#171717",
+ textGroupHeader: isDark ? "#a3a3a3" : "#525252",
+ bgCell: isDark ? "#0a0a0a" : "#ffffff",
+ bgCellMedium: isDark ? "#171717" : "#fafafa",
+ bgHeader: isDark ? "#171717" : "#fafafa",
+ bgHeaderHasFocus: isDark ? "#262626" : "#f5f5f5",
+ bgHeaderHovered: isDark ? "#262626" : "#f5f5f5",
+ borderColor: isDark ? "#262626" : "#e5e5e5",
+ horizontalBorderColor: isDark ? "#262626" : "#e5e5e5",
+ baseFontStyle:
+ scale(13) + 'px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
+ headerFontStyle:
+ "600 " +
+ scale(13) +
+ 'px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
+ }),
+ [isDark, scale],
+ );
+
+ const columns = React.useMemo<GridColumn[]>(
+ () =>
+ Array.from({ length: columnCount }, (_, index) => ({
+ id: "column-" + index,
+ title: parsed.headers[index] ?? "Column " + (index + 1),
+ width: scale(index === 0 ? 180 : 160),
+ })),
+ [columnCount, parsed.headers, scale],
+ );
+
+ const getCellContent = React.useCallback(
+ ([col, row]: Item): GridCell => {
+ const value = parsed.rows[row]?.[col] ?? "";
+ const textKind = glide?.GridCellKind.Text as GridCellKind.Text;
+
+ return {
+ kind: textKind,
+ data: value,
+ displayData: value,
+ allowOverlay: true,
+ readonly: true,
+ };
+ },
+ [glide, parsed.rows],
+ );
+
+ async function handleUpload(event: React.ChangeEvent<HTMLInputElement>) {
+ const file = event.target.files?.[0];
+ if (!file) return;
+
+ setIsPending(true);
+ try {
+ const text = await file.text();
+ setParsed(parseDelimitedText(text));
+ setFileName(file.name);
+ } catch (error) {
+ setParsed({
+ headers: [],
+ rows: [],
+ error:
+ error instanceof Error ? error.message : "Could not read CSV file.",
+ });
+ } finally {
+ event.target.value = "";
+ setIsPending(false);
+ }
+ }
+
+ function stepZoom(direction: -1 | 1) {
+ const index = ZOOM_OPTIONS.indexOf(zoom);
+ const nextIndex = Math.min(
+ ZOOM_OPTIONS.length - 1,
+ Math.max(0, index + direction),
+ );
+ setZoom(ZOOM_OPTIONS[nextIndex]);
+ }
+
+ return (
+ <div
+ className={cn(
+ "flex h-[560px] w-full flex-col overflow-hidden rounded-xl border bg-background",
+ className,
+ )}
+ >
+ <div className="flex min-h-12 items-center justify-between gap-3 border-b px-3">
+ <div className="flex min-w-0 items-center gap-3">
+ <div className="flex size-7 shrink-0 items-center justify-center rounded-md border bg-muted text-muted-foreground">
+ <HugeiconsIcon icon={TableIcon} className="size-4" />
+ </div>
+ <div className="min-w-0">
+ <div className="truncate text-sm font-medium text-foreground">
+ {fileName}
+ </div>
+ <div className="text-xs text-muted-foreground">
+ {parsed.rows.length.toLocaleString()} rows -{" "}
+ {parsed.headers.length.toLocaleString()} columns
+ </div>
+ </div>
+ </div>
+ <TooltipProvider>
+ <div className="ml-auto flex shrink-0 items-center gap-1">
+ <ToolbarTooltip label="Zoom out">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Zoom out"
+ disabled={zoom <= ZOOM_OPTIONS[0]}
+ onClick={() => stepZoom(-1)}
+ >
+ <HugeiconsIcon icon={MinusSignCircleIcon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ <Select
+ value={zoom.toString()}
+ onValueChange={(value) =>
+ setZoom(Number(value) as (typeof ZOOM_OPTIONS)[number])
+ }
+ >
+ <SelectTrigger
+ size="sm"
+ className="h-7 min-h-7 w-[74px] min-w-[74px] rounded-md"
+ aria-label="Zoom level"
+ >
+ <SelectValue>{Math.round(zoom * 100)}%</SelectValue>
+ </SelectTrigger>
+ <SelectContent align="end">
+ {ZOOM_OPTIONS.map((option) => (
+ <SelectItem key={option} value={option.toString()}>
+ {Math.round(option * 100)}%
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <ToolbarTooltip label="Zoom in">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Zoom in"
+ disabled={zoom >= ZOOM_OPTIONS[ZOOM_OPTIONS.length - 1]}
+ onClick={() => stepZoom(1)}
+ >
+ <HugeiconsIcon icon={PlusSignCircleIcon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ <input
+ ref={inputRef}
+ type="file"
+ accept=".csv,.tsv,text/csv,text/tab-separated-values"
+ className="hidden"
+ onChange={handleUpload}
+ />
+ <ToolbarTooltip label="Upload CSV">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Upload CSV"
+ loading={isPending}
+ onClick={() => inputRef.current?.click()}
+ >
+ <HugeiconsIcon icon={Upload01Icon} className="size-4" />
+ </Button>
+ </ToolbarTooltip>
+ </div>
+ </TooltipProvider>
+ </div>
+ <div className="min-h-0 flex-1">
+ {parsed.error ? (
+ <div className="flex h-full items-center justify-center px-4 text-center text-sm text-destructive">
+ {parsed.error}
+ </div>
+ ) : !glide ? (
+ <div className="flex h-full items-center justify-center text-sm text-muted-foreground">
+ Loading grid...
+ </div>
+ ) : (
+ <glide.DataEditor
+ key={zoom}
+ columns={columns}
+ rows={parsed.rows.length}
+ getCellContent={getCellContent}
+ rowMarkers="number"
+ rowSelectionMode="multi"
+ keybindings={{ search: true }}
+ smoothScrollX
+ smoothScrollY
+ getCellsForSelection
+ width="100%"
+ height="100%"
+ theme={theme}
+ rowHeight={scale(34)}
+ headerHeight={scale(36)}
+ />
+ )}
+ </div>
+ </div>
+ );
+}`
+
+export function CsvViewerDemo() {
+ const [isCodeVisible, setIsCodeVisible] = React.useState(false)
+
+ return (
+ <div
+ data-slot="component-preview"
+ className="group relative mt-4 mb-12 flex flex-col overflow-hidden rounded-xl border"
+ >
+ <CsvViewerPreviewClient />
+ <div
+ data-slot="code"
+ data-mobile-code-visible={isCodeVisible}
+ className="relative overflow-hidden **:data-[slot=copy-button]:right-4 **:data-[slot=copy-button]:hidden data-[mobile-code-visible=true]:**:data-[slot=copy-button]:flex [&_[data-rehype-pretty-code-figure]]:m-0! [&_[data-rehype-pretty-code-figure]]:rounded-t-none [&_[data-rehype-pretty-code-figure]]:border-t [&_pre]:max-h-72"
+ >
+ {isCodeVisible ? (
+ <HighlightedCodeBlock
+ code={csvViewerUsageCode}
+ className="rounded-none border-x-0 border-b-0"
+ />
+ ) : (
+ <div className="relative">
+ <HighlightedCodeBlock
+ code={csvViewerUsageCode}
+ className="rounded-none border-x-0 border-b-0"
+ maxHeightClassName="max-h-56"
+ previewLines={10}
+ showCopy={false}
+ />
+ <div className="absolute inset-0 flex items-center justify-center pb-4">
+ <div
+ className="absolute inset-0"
+ style={{
+ background:
+ "linear-gradient(to top, var(--color-code), color-mix(in oklab, var(--color-code) 60%, transparent), transparent)",
+ }}
+ />
+ <Button
+ type="button"
+ size="sm"
+ variant="outline"
+ className="relative z-10 rounded-lg bg-background text-foreground shadow-none hover:bg-muted dark:bg-background dark:text-foreground dark:hover:bg-muted"
+ onClick={() => setIsCodeVisible(true)}
+ >
+ View Code
+ </Button>
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ )
+}
+
+export function CsvViewerSource() {
+ return <HighlightedCodeBlock code={csvViewerUsageCode} />
+}
diff --git a/apps/v4/content/docs/components/csv-tsv-viewer.mdx b/apps/v4/content/docs/components/csv-tsv-viewer.mdx
index d99db00..a582f97 100644
--- a/apps/v4/content/docs/components/csv-tsv-viewer.mdx
+++ b/apps/v4/content/docs/components/csv-tsv-viewer.mdx
@@ -6,17 +6,63 @@ component: true
The CSV Viewer covers exports, imports, tabular logs, and datasets that do not need full spreadsheet rendering.
+<CsvViewerDemo />
+
+## Installation
+
+<CodeTabs>
+
+<TabsList>
+ <TabsTrigger value="cli">Command</TabsTrigger>
+ <TabsTrigger value="manual">Manual</TabsTrigger>
+</TabsList>
+<TabsContent value="cli">
+
+```bash
+npx shadcn@latest add csv-viewer
+```
+
+</TabsContent>
+
+<TabsContent value="manual">
+
+<Steps className="mb-0 pt-2">
+
+<Step>Install the following dependencies:</Step>
+
+```bash
+npm install @glideapps/[email protected] papaparse marked lodash react-responsive-carousel
+```
+
+<Step>Copy and paste the following code into your project.</Step>
+
+<CsvViewerSource />
+
+<Step>Add the Glide Data Grid styles.</Step>
+
+```tsx
+import "@glideapps/glide-data-grid/dist/index.css"
+```
+
+<Step>Update the import paths to match your project setup.</Step>
+
+</Steps>
+
+</TabsContent>
+
+</CodeTabs>
+
## Useful behaviors
-- Encoding and delimiter detection.
-- Virtualized rows and columns for large files.
-- Sort, filter, resize, pin, and copy selected ranges.
-- Column type inference for dates, numbers, booleans, and empty values.
+- PapaParse-backed CSV and TSV parsing with empty-row handling.
+- Virtualized rows and columns through Glide Data Grid.
+- Header controls for upload, row and column counts, and zoom.
+- Grid zoom that scales row height, header height, column width, and cell text.
## Common slots
-| Slot | Purpose |
-| --- | --- |
-| `columnHeader` | Sort, filter, type, and resize controls. |
-| `statusBar` | Row count, selected range, and parse warnings. |
-| `parseErrors` | Malformed rows, encoding issues, and delimiter mismatches. |
+| Slot | Purpose |
+| -------------- | ------------------------------------------------------ |
+| `toolbar` | File summary, zoom controls, and CSV upload actions. |
+| `grid` | Virtualized Glide Data Grid table surface. |
+| `parseErrors` | Malformed rows, encoding issues, and delimiter errors. |
diff --git a/apps/v4/mdx-components.tsx b/apps/v4/mdx-components.tsx
index 142672e..c734955 100644
--- a/apps/v4/mdx-components.tsx
+++ b/apps/v4/mdx-components.tsx
@@ -11,6 +11,7 @@ import { CodeCollapsibleWrapper } from "@/components/code-collapsible-wrapper"
import { CodeTabs } from "@/components/code-tabs"
import { ComponentsList } from "@/components/components-list"
import { CopyButton } from "@/components/copy-button"
+import { CsvViewerDemo, CsvViewerSource } from "@/components/csv-viewer-docs"
import { getIconForLanguageExtension } from "@/components/icons"
import { PdfViewerDemo, PdfViewerSource } from "@/components/pdf-viewer-docs"
import {
@@ -352,6 +353,8 @@ export const mdxComponents = {
CodeTabs,
CodeCollapsibleWrapper,
ComponentsList: ComponentsListWrapper,
+ CsvViewerDemo,
+ CsvViewerSource,
PdfViewerDemo,
PdfViewerSource,
Link: ({ className, ...props }: React.ComponentProps<typeof Link>) => (
diff --git a/apps/v4/package.json b/apps/v4/package.json
index d102de2..6d1655d 100644
--- a/apps/v4/package.json
+++ b/apps/v4/package.json
@@ -17,6 +17,7 @@
},
"dependencies": {
"@base-ui/react": "^1.4.1",
+ "@glideapps/glide-data-grid": "6.0.4-alpha24",
"@hugeicons/core-free-icons": "^4.1.1",
"@hugeicons/react": "^1.1.6",
"@tabler/icons-react": "^3.31.0",
@@ -26,13 +27,17 @@
"fumadocs-core": "16.0.5",
"fumadocs-mdx": "13.0.2",
"jotai": "^2.15.0",
+ "lodash": "^4.18.1",
"lru-cache": "^11.2.4",
+ "marked": "^16.0.10",
"next": "16.2.6",
"next-themes": "0.4.6",
"nuqs": "^2.8.9",
+ "papaparse": "^5.5.3",
"react": "19.2.3",
"react-dom": "19.2.3",
"react-pdf": "^10.4.1",
+ "react-responsive-carousel": "^3.2.23",
"rehype-pretty-code": "^0.14.1",
"shiki": "^1.10.1",
"sonner": "^2.0.0",
@@ -43,6 +48,7 @@
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
"@tailwindcss/postcss": "^4.2.4",
"@types/node": "^20",
+ "@types/papaparse": "^5.5.2",
"@types/react": "19.2.2",
"@types/react-dom": "19.2.2",
"eslint": "^9",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 42c27a8..90d7277 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -21,6 +21,9 @@ importers:
'@base-ui/react':
specifier: ^1.4.1
+ '@glideapps/glide-data-grid':
+ specifier: 6.0.4-alpha24
'@hugeicons/core-free-icons':
specifier: ^4.1.1
version: 4.1.1
@@ -47,10 +50,16 @@ importers:
jotai:
specifier: ^2.15.0
+ lodash:
+ specifier: ^4.18.1
+ version: 4.18.1
lru-cache:
specifier: ^11.2.4
version: 11.2.4
+ marked:
+ specifier: ^16.0.10
+ version: 16.4.2
next:
specifier: 16.2.6
@@ -60,6 +69,9 @@ importers:
nuqs:
specifier: ^2.8.9
+ papaparse:
+ specifier: ^5.5.3
+ version: 5.5.3
react:
specifier: 19.2.3
version: 19.2.3
@@ -69,6 +81,9 @@ importers:
react-pdf:
specifier: ^10.4.1
+ react-responsive-carousel:
+ specifier: ^3.2.23
+ version: 3.2.23
rehype-pretty-code:
specifier: ^0.14.1
version: 0.14.1([email protected])
@@ -94,6 +109,9 @@ importers:
'@types/node':
specifier: ^20
version: 20.19.10
+ '@types/papaparse':
+ specifier: ^5.5.2
+ version: 5.5.2
'@types/react':
specifier: 19.2.2
version: 19.2.2
@@ -139,6 +157,10 @@ packages:
resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==}
engines: {node: '>=6.9.0'}
@@ -151,6 +173,10 @@ packages:
resolution: {integrity: sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==}
engines: {node: '>=6.9.0'}
@@ -177,6 +203,10 @@ packages:
resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==}
engines: {node: '>=6.9.0'}
@@ -190,6 +220,11 @@ packages:
engines: {node: '>=6.0.0'}
hasBin: true
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+
resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==}
engines: {node: '>=6.9.0'}
@@ -198,6 +233,10 @@ packages:
resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==}
+ engines: {node: '>=6.9.0'}
+
resolution: {integrity: sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==}
engines: {node: '>=6.9.0'}
@@ -206,6 +245,10 @@ packages:
resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==}
engines: {node: '>=6.9.0'}
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
+ engines: {node: '>=6.9.0'}
+
'@base-ui/[email protected]':
resolution: {integrity: sha512-Ab5/LIhcmL8BQcsBUYiOfkSDRdLpvgUBzMK30cu684JPcLclYlztharvCZyNNgzJtbAiREzI9q0pI5erHCMgCw==}
engines: {node: '>=14.0.0'}
@@ -242,6 +285,12 @@ packages:
'@emnapi/[email protected]':
resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==}
+ '@emotion/[email protected]':
+ resolution: {integrity: sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==}
+
+ '@emotion/[email protected]':
+ resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==}
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-Xt1dOL13m8u0WE8iplx9Ibbm+hFAO0GsU2P34UNoDGvZYkY8ifSiy6Zuc1lYxfG7svWE2fzqCUmFp5HCn51gJg==}
engines: {node: '>=18'}
@@ -610,6 +659,15 @@ packages:
'@formatjs/[email protected]':
resolution: {integrity: sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==}
+ '@glideapps/[email protected]':
+ resolution: {integrity: sha512-o3hq7n5XKS1R7lXZ5vGyTG6O/11qPmu9DQyxPnqOej3UMuQDEe4bJth75pcnYueLCAoffpa8vTB2hz5Q0qZLHg==}
+ peerDependencies:
+ lodash: ^4.17.19
+ marked: ^16.0.10
+ react: ^16.12.0 || 17.x || 18.x || 19.x
+ react-dom: ^16.12.0 || 17.x || 18.x || 19.x
+ react-responsive-carousel: ^3.2.7
+
resolution: {integrity: sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==}
engines: {node: '>=18.14.1'}
@@ -811,6 +869,16 @@ packages:
'@jridgewell/[email protected]':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
+ '@linaria/[email protected]':
+ resolution: {integrity: sha512-fs1aQyX4DmJpeGMyobuSznAo/Y02+Q8vhm+c/jr2WHDmqKHEJpCqH2Mhu1End+SdiUvZIUgb4MNiZryWtZLD5g==}
+ engines: {node: '>=16.0.0'}
+
+ '@linaria/[email protected]':
+ resolution: {integrity: sha512-CjdEPwQCIRB3BRecnwK0g9mEWow3M1zAJTKI7h/B6j3yRLQRelitcoLd19MxZNz89pc0NNPALqy2I+eBGH0lJA==}
+ engines: {node: '>=16.0.0'}
+ peerDependencies:
+ react: '>=16'
+
'@mdx-js/[email protected]':
resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==}
@@ -1479,6 +1547,9 @@ packages:
resolution: {integrity: sha512-iAFpG6DokED3roLSP0K+ybeDdIX6Bc0Vd3mLW5uDqThPWtNos3E+EqOM11mPQHKzfWHqEBuLjIlsBQQ8CsISmQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-gFnFp/JMzLHCwRf7tQHrNnfhN4eYBVYYI897CGX4MY1tzY9l2aLkVyx2IlKZ/SAqDbB3I1AOZW5gTMGGsqWliA==}
+
resolution: {integrity: sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw==}
peerDependencies:
@@ -1650,6 +1721,14 @@ packages:
cpu: [x64]
os: [win32]
+ '@wyw-in-js/[email protected]':
+ resolution: {integrity: sha512-5YAZMUmF+S2HaqheKfew6ybbYBMnF10PjIgI7ieyuFxCohyqJNF4xdo6oHftv2z5Z4vCQ0OZHtDOQyDImBYwmg==}
+ engines: {node: '>=16.0.0'}
+
+ '@wyw-in-js/[email protected]':
+ resolution: {integrity: sha512-BozBos29AuMWOvjjKf+bYYN+Vku0Nar6+y5oxrJXIZzUEKiWTVnIxO256vi8cUBGfo/DH44o+qZTkkdSN2pPXw==}
+ engines: {node: '>=16.0.0'}
+
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
engines: {node: '>= 0.6'}
@@ -1770,6 +1849,9 @@ packages:
resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}
+ resolution: {integrity: sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==}
+
resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==}
engines: {node: 18 || 20 || >=22}
@@ -1806,6 +1888,9 @@ packages:
resolution: {integrity: sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==}
+ resolution: {integrity: sha512-+VsMpRr64jYgKq2IeFUNel3vCZH/IzS+iXSHxmUV3IUH5dXlC9xHz4AwtPZisDxZ5MWcuK0V+TXgPKFPiZnxzg==}
+
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
@@ -1832,6 +1917,9 @@ packages:
resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
+ resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==}
+
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
@@ -2474,6 +2562,9 @@ packages:
resolution: {integrity: sha512-l7qMiNee7t82bH3SeyUCt9UF15EVmaBvsppY2zQtrbIhl/yzBTny+YUxsVjSjQ6gaqaeVtZmGocom8TzBlA4Yw==}
engines: {node: '>=16.9.0'}
+ resolution: {integrity: sha512-UrRKgp5sQmRnDy4TEwAUsu14XBUlzKB8U3hjIYDjcZ3Hbp86Jtftzxfgrv6E/ii/h78tsaZwAnAE8HwnHr0dPA==}
+
resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}
@@ -2808,6 +2899,9 @@ packages:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
+ resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==}
+
resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
@@ -2843,6 +2937,11 @@ packages:
resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==}
+ resolution: {integrity: sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==}
+ engines: {node: '>= 20'}
+ hasBin: true
+
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
@@ -3039,6 +3138,10 @@ packages:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+ resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==}
+ engines: {node: '>=16 || 14 >=14.17'}
+
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
@@ -3181,6 +3284,9 @@ packages:
resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
engines: {node: '>=10'}
+ resolution: {integrity: sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==}
+
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
engines: {node: '>=6'}
@@ -3345,9 +3451,22 @@ packages:
peerDependencies:
react: ^19.2.3
+ resolution: {integrity: sha512-OeR2jAxdoqUMHIn/nS9fgreI5hSpgGoL5ezdal4+oO7YSSgJR8ga+PkYGJrSrJ9MKlPcQjMQXnketrD7WNmNsg==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-uS3MmThNKFH2EZUQQw4k5pIcU7XIr208UE5dktrj/GOH1CMagqxDl4DCLpt3o2l9x+IB5nVYBeN3Cr4IutBXAg==}
+
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
+ resolution: {integrity: sha512-y8O2yHHj3w0aE9XO8d2BCcUOOdQTRSVq+WIuMlLVucAm5XNjJAy+BoOJiuQMldVYVOKTMyvVNfnbl2Oqp+YxGw==}
+ peerDependencies:
+ react: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+
resolution: {integrity: sha512-kS/35staVCBqS29verTQJQZXw7RfsRCPO3fdJoW1KXylcv7A9dw6DZ3vJXC2w+bIBgLw5FN4pOFvKSQtkQhPfA==}
peerDependencies:
@@ -3378,6 +3497,9 @@ packages:
'@types/react':
optional: true
+ resolution: {integrity: sha512-pqJLsBaKHWJhw/ItODgbVoziR2z4lpcJg+YwmRlSk4rKH32VE633mAtZZ9kDXjy4wFO+pgUZmDKPsPe1fPmHCg==}
+
resolution: {integrity: sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==}
engines: {node: '>=10'}
@@ -3727,6 +3849,10 @@ packages:
peerDependencies:
typescript: '>=4.8.4'
+ resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
@@ -4017,6 +4143,13 @@ snapshots:
js-tokens: 4.0.0
picocolors: 1.1.1
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/helper-validator-identifier': 7.28.5
+ js-tokens: 4.0.0
+ picocolors: 1.1.1
+ optional: true
+
'@babel/[email protected]': {}
@@ -4047,6 +4180,14 @@ snapshots:
'@jridgewell/trace-mapping': 0.3.31
jsesc: 3.1.0
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/parser': 7.29.3
+ '@babel/types': 7.29.0
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
+ jsesc: 3.1.0
+
dependencies:
'@babel/compat-data': 7.28.0
@@ -4077,6 +4218,8 @@ snapshots:
'@babel/[email protected]': {}
+ '@babel/[email protected]': {}
+
'@babel/[email protected]': {}
@@ -4088,6 +4231,10 @@ snapshots:
dependencies:
'@babel/types': 7.28.2
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/types': 7.29.0
+
'@babel/[email protected]': {}
@@ -4096,6 +4243,13 @@ snapshots:
'@babel/parser': 7.28.0
'@babel/types': 7.28.2
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/code-frame': 7.29.0
+ '@babel/parser': 7.29.3
+ '@babel/types': 7.29.0
+ optional: true
+
dependencies:
'@babel/code-frame': 7.27.1
@@ -4113,6 +4267,11 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/helper-string-parser': 7.27.1
+ '@babel/helper-validator-identifier': 7.28.5
+
dependencies:
'@babel/runtime': 7.29.2
@@ -4152,6 +4311,12 @@ snapshots:
tslib: 2.8.1
optional: true
+ '@emotion/[email protected]':
+ dependencies:
+ '@emotion/memoize': 0.9.0
+
+ '@emotion/[email protected]': {}
+
'@esbuild/[email protected]':
optional: true
@@ -4373,6 +4538,19 @@ snapshots:
dependencies:
tslib: 2.8.1
+ dependencies:
+ '@linaria/react': 6.3.0([email protected])
+ canvas-hypertxt: 1.0.3
+ lodash: 4.18.1
+ marked: 16.4.2
+ react: 19.2.3
+ react-dom: 19.2.3([email protected])
+ react-responsive-carousel: 3.2.23
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
hono: 4.11.7
@@ -4521,6 +4699,26 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5
+ '@linaria/[email protected]':
+ dependencies:
+ '@wyw-in-js/processor-utils': 0.6.0
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@emotion/is-prop-valid': 1.4.0
+ '@linaria/core': 6.3.0
+ '@wyw-in-js/processor-utils': 0.6.0
+ '@wyw-in-js/shared': 0.6.0
+ minimatch: 9.0.9
+ react: 19.2.3
+ react-html-attributes: 1.4.6
+ resolve: 1.22.10
+ ts-invariant: 0.10.3
+ transitivePeerDependencies:
+ - supports-color
+
'@mdx-js/[email protected]':
dependencies:
'@types/estree': 1.0.8
@@ -5112,6 +5310,10 @@ snapshots:
dependencies:
undici-types: 6.21.0
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.10
+
dependencies:
'@types/react': 19.2.2
@@ -5276,6 +5478,21 @@ snapshots:
optional: true
+ '@wyw-in-js/[email protected]':
+ dependencies:
+ '@babel/generator': 7.29.1
+ '@wyw-in-js/shared': 0.6.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@wyw-in-js/[email protected]':
+ dependencies:
+ debug: 4.4.3
+ find-up: 5.0.0
+ minimatch: 9.0.9
+ transitivePeerDependencies:
+ - supports-color
+
dependencies:
mime-types: 3.0.2
@@ -5425,6 +5642,10 @@ snapshots:
balanced-match: 1.0.2
concat-map: 0.0.1
+ dependencies:
+ balanced-match: 1.0.2
+
dependencies:
balanced-match: 4.0.4
@@ -5464,6 +5685,8 @@ snapshots:
+
@@ -5487,6 +5710,8 @@ snapshots:
dependencies:
clsx: 2.1.1
+
@@ -6420,6 +6645,8 @@ snapshots:
+
@@ -6602,10 +6829,10 @@ snapshots:
optionalDependencies:
'@babel/core': 7.28.0
- '@babel/template': 7.27.2
+ '@babel/template': 7.28.6
'@types/react': 19.2.2
react: 19.2.3
@@ -6710,6 +6937,8 @@ snapshots:
+
@@ -6739,6 +6968,8 @@ snapshots:
+
@@ -7197,6 +7428,10 @@ snapshots:
dependencies:
brace-expansion: 1.1.12
+ dependencies:
+ brace-expansion: 2.1.0
+
@@ -7337,6 +7572,8 @@ snapshots:
dependencies:
p-limit: 3.1.0
+
dependencies:
callsites: 3.1.0
@@ -7441,8 +7678,21 @@ snapshots:
react: 19.2.3
scheduler: 0.27.0
+ dependencies:
+ prop-types: 15.8.1
+
+ dependencies:
+ html-element-attributes: 1.3.1
+
+ dependencies:
+ react: 19.2.3
+ react-dom: 19.2.3([email protected])
+
dependencies:
clsx: 2.1.1
@@ -7477,6 +7727,12 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.2
+ dependencies:
+ classnames: 2.5.1
+ prop-types: 15.8.1
+ react-easy-swipe: 0.0.21
+
dependencies:
get-nonce: 1.0.1
@@ -8000,6 +8256,10 @@ snapshots:
dependencies:
typescript: 5.9.2
+ dependencies:
+ tslib: 2.8.1
+
dependencies:
'@types/json5': 0.0.29