mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
"use client"
|
|
|
|
import { Monitor, Smartphone, Tablet } from "lucide-react"
|
|
|
|
import {
|
|
ToggleGroup,
|
|
ToggleGroupItem,
|
|
} from "@/registry/new-york-v4/ui/toggle-group"
|
|
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"
|
|
|
|
export function PreviewControls() {
|
|
const [params, setParams] = useDesignSystemSearchParams({
|
|
history: "replace",
|
|
})
|
|
|
|
return (
|
|
<div className="flex h-8 items-center gap-1.5 rounded-md border p-1">
|
|
<ToggleGroup
|
|
type="single"
|
|
value={params.size.toString()}
|
|
onValueChange={(newValue) => {
|
|
if (newValue) {
|
|
setParams({ size: parseInt(newValue) })
|
|
}
|
|
}}
|
|
className="gap-1 *:data-[slot=toggle-group-item]:!size-6 *:data-[slot=toggle-group-item]:!rounded-sm"
|
|
>
|
|
<ToggleGroupItem value="100" title="Desktop">
|
|
<Monitor />
|
|
</ToggleGroupItem>
|
|
<ToggleGroupItem value="60" title="Tablet">
|
|
<Tablet />
|
|
</ToggleGroupItem>
|
|
<ToggleGroupItem value="30" title="Mobile">
|
|
<Smartphone />
|
|
</ToggleGroupItem>
|
|
</ToggleGroup>
|
|
</div>
|
|
)
|
|
}
|