mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
The UI package is pkg/ui. CI said pkgs/ui, so three steps ran `cd` into a directory that is not there: /var/run/act/workflow/7: line 2: cd: pkgs/ui: No such file or directory and it called two scripts pkg/ui does not define — build:full and test:coverage. It builds with `build` and tests with `test`. The codecov step uploaded ./pkgs/ui/coverage/lcov.info; pkg/ui has no coverage config and no @vitest/coverage-* dependency, so nothing has ever written that file. Dropped. The typecheck job checks app AND pkg/ui but built only app's dependencies. @hanzo/data is not one of app's, so it stayed unbuilt — and its exports name ./types/index.d.ts, which nothing had produced. Bundler resolution fell through to the next condition, ./src/index.ts, and pkg/ui typechecked another package's source: 90 errors in ../data/src/board/BoardView.tsx and its neighbours. It builds both dependency sets now, and pkg/ui reads declarations. That was invisible until now: the step is one `run:` block under `bash -e`, and `cd app && pnpm run typecheck` failed first, so the pkg/ui line never ran. The ten animation and pattern demos imported @hanzo/ui/animation/* and @hanzo/ui/pattern/*. Neither subpath is in the package's exports, so each was an untyped any: error TS7016: Could not find a declaration file for module '@hanzo/ui/animation/animated-beam' Those components live in this app, at registry/default/ui/, which is where their 390 sibling demos already import from. @hanzo/cd was an optional peer only, but src/gitops.ts re-exports it unconditionally, so typechecking pkg/ui requires it present. It is a devDependency now — the same shape @hanzo/data already had, optional for consumers and present here. ResizablePanelGroup requires a direction; the render test rendered it without one. app/__tests__/hanzo-ui-imports.test.tsx is gone. Fifty-two lines whose three assertions were each expect(true).toBe(true) — it could not fail, so it was not checking the exports its name claims. Verified: install, turbo build of both dependency sets, app typecheck, and pkg/ui tc — all exit 0, zero TS errors.
194 lines
7.5 KiB
TypeScript
194 lines
7.5 KiB
TypeScript
"use client"
|
|
|
|
import { GridPattern, GridPatternPresets } from "@/registry/default/ui/grid-pattern"
|
|
|
|
import {
|
|
Tabs,
|
|
TabsContent,
|
|
TabsList,
|
|
TabsTrigger,
|
|
} from "@/registry/default/ui/tabs"
|
|
|
|
export default function GridPatternDemo() {
|
|
return (
|
|
<div className="space-y-8">
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Basic Grid Patterns</h3>
|
|
<Tabs defaultValue="dots" className="w-full">
|
|
<TabsList className="grid w-full grid-cols-5">
|
|
<TabsTrigger value="dots">Dots</TabsTrigger>
|
|
<TabsTrigger value="lines">Lines</TabsTrigger>
|
|
<TabsTrigger value="crosses">Crosses</TabsTrigger>
|
|
<TabsTrigger value="plus">Plus</TabsTrigger>
|
|
<TabsTrigger value="squares">Squares</TabsTrigger>
|
|
</TabsList>
|
|
<TabsContent value="dots">
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern variant="dots" size={4} gap={30} opacity={0.4} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Dot Pattern</span>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
<TabsContent value="lines">
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern
|
|
variant="lines"
|
|
strokeWidth={1}
|
|
gap={40}
|
|
opacity={0.3}
|
|
/>
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Line Grid</span>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
<TabsContent value="crosses">
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern
|
|
variant="crosses"
|
|
size={10}
|
|
gap={25}
|
|
opacity={0.35}
|
|
/>
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Cross Pattern</span>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
<TabsContent value="plus">
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern variant="plus" size={8} gap={30} opacity={0.3} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Plus Pattern</span>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
<TabsContent value="squares">
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern
|
|
variant="squares"
|
|
size={20}
|
|
gap={35}
|
|
opacity={0.25}
|
|
/>
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Square Grid</span>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
</Tabs>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Fade Effects</h3>
|
|
<div className="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern variant="dots" fade="edges" />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Edge Fade</span>
|
|
</div>
|
|
</div>
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern variant="dots" fade="center" />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Center Fade</span>
|
|
</div>
|
|
</div>
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern variant="dots" fade="radial" />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Radial Fade</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Gradient Overlay</h3>
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern
|
|
variant="lines"
|
|
gradient={{
|
|
from: "#ec4899",
|
|
via: "#8b5cf6",
|
|
to: "#3b82f6",
|
|
opacity: 0.2,
|
|
}}
|
|
/>
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Gradient Grid</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Animated Pattern</h3>
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern
|
|
variant="dots"
|
|
size={2}
|
|
gap={20}
|
|
opacity={0.3}
|
|
animation={{
|
|
duration: 10,
|
|
timing: "linear",
|
|
direction: "normal",
|
|
}}
|
|
/>
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Animated Grid</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Presets</h3>
|
|
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern {...GridPatternPresets.blueprint} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Blueprint</span>
|
|
</div>
|
|
</div>
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern {...GridPatternPresets.graph} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Graph Paper</span>
|
|
</div>
|
|
</div>
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern {...GridPatternPresets.dotMatrix} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Dot Matrix</span>
|
|
</div>
|
|
</div>
|
|
<div className="relative h-48 rounded-lg border bg-background">
|
|
<GridPattern {...GridPatternPresets.isometric} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="font-medium">Isometric</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<h3 className="mb-4 text-lg font-semibold">Multi-Layer Pattern</h3>
|
|
<div className="relative h-64 w-full rounded-lg border bg-background">
|
|
<GridPattern variant="lines" gap={80} strokeWidth={1} opacity={0.1} />
|
|
<GridPattern
|
|
variant="lines"
|
|
gap={40}
|
|
strokeWidth={0.5}
|
|
opacity={0.05}
|
|
/>
|
|
<GridPattern variant="dots" size={1} gap={10} opacity={0.03} />
|
|
<div className="relative z-10 flex h-full items-center justify-center">
|
|
<span className="text-xl font-medium">Multi-Layer Depth</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|