260703_01_FST: First Commit

This commit is contained in:
2026-07-03 10:40:45 +09:00
commit b11d47b14e
65 changed files with 11002 additions and 0 deletions

12
.tooling/lib/as-child.tsx Normal file
View File

@@ -0,0 +1,12 @@
import { cloneElement, isValidElement, type HTMLAttributes, type ReactNode } from "react";
export function renderAsChild(
asChild: boolean | undefined,
children: ReactNode,
props: HTMLAttributes<HTMLElement>
) {
if (asChild && isValidElement<HTMLAttributes<HTMLElement>>(children)) {
return cloneElement(children, { ...props, ...children.props });
}
return <span {...props}>{children}</span>;
}