mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-10-21 06:30:33 +08:00
* add react-email workspace dependencies * add react-email package * add react-email example with Vercel Invite, Stripe Welcome and Nike Receipt * add render tests for react-email package * fix missing style prop on stripe-welcome logo Image * add react email documentation * add json render react email skill * fix @internal/react-state alias in vitest config Pre-existing issue: vitest could not resolve @internal/react-state, causing 6 test suites in packages/react and packages/react-pdf to fail. * fix PR review feedback - fix tsconfig: remove rootDir, expand include for test imports - fix render tests: add non-null assertions for noUncheckedIndexedAccess - fix dev script: add portless to match other examples - fix .env.example: correct comment from video to email generation - fix docs: add blank line before heading in installation page * merge latest * fix: update tsconfig extends from @repo to @internal/typescript-config * fixes * fixes --------- Co-authored-by: WManzoli <willmanzoli@gmail.com> Co-authored-by: Chris Tate <chris@ctate.dev>
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
import { GripVerticalIcon } from "lucide-react";
|
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
function ResizablePanelGroup({
|
|
className,
|
|
...props
|
|
}: ResizablePrimitive.GroupProps) {
|
|
return (
|
|
<ResizablePrimitive.Group
|
|
data-slot="resizable-panel-group"
|
|
className={cn(
|
|
"flex h-full w-full aria-[orientation=vertical]:flex-col",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
|
|
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
|
|
}
|
|
|
|
function ResizableHandle({
|
|
withHandle,
|
|
className,
|
|
...props
|
|
}: ResizablePrimitive.SeparatorProps & {
|
|
withHandle?: boolean;
|
|
}) {
|
|
return (
|
|
<ResizablePrimitive.Separator
|
|
data-slot="resizable-handle"
|
|
className={cn(
|
|
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{withHandle && (
|
|
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
|
<GripVerticalIcon className="size-2.5" />
|
|
</div>
|
|
)}
|
|
</ResizablePrimitive.Separator>
|
|
);
|
|
}
|
|
|
|
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|