feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
This commit is contained in:
42
frontend/src/shared/ui/IconButton.tsx
Normal file
42
frontend/src/shared/ui/IconButton.tsx
Normal file
@ -0,0 +1,42 @@
|
||||
/** IconButton — a square, icon-only button (close ×, toolbar actions) (LD). */
|
||||
|
||||
import { forwardRef } from "react";
|
||||
|
||||
import { cn } from "../lib/cn";
|
||||
|
||||
export type IconButtonSize = "sm" | "md";
|
||||
|
||||
export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
/** Required accessible name (icon-only buttons have no text). */
|
||||
"aria-label": string;
|
||||
/** Control size. Defaults to `md`. */
|
||||
size?: IconButtonSize;
|
||||
}
|
||||
|
||||
const SIZES: Record<IconButtonSize, string> = {
|
||||
sm: "h-6 w-6 text-xs",
|
||||
md: "h-8 w-8 text-sm",
|
||||
};
|
||||
|
||||
/** A compact, icon-only button styled as a ghost control. */
|
||||
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(
|
||||
{ size = "md", className, children, ...rest },
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<button
|
||||
ref={ref}
|
||||
type={rest.type ?? "button"}
|
||||
className={cn(
|
||||
"inline-flex items-center justify-center rounded-md text-muted transition-colors",
|
||||
"hover:bg-raised hover:text-content focus-visible:outline-none",
|
||||
"disabled:opacity-50 disabled:cursor-not-allowed",
|
||||
SIZES[size],
|
||||
className,
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user