Files
stack/packages/ui/src/components/Button.tsx
Jason Woltje f47dd8bc92 feat: add domains, ideas, layouts, widgets API modules
- Add DomainsModule with full CRUD, search, and activity logging
- Add IdeasModule with quick capture endpoint
- Add LayoutsModule for user dashboard layouts
- Add WidgetsModule for widget definitions (read-only)
- Update ActivityService with domain/idea logging methods
- Register all new modules in AppModule
2026-01-29 13:47:03 -06:00

41 lines
1.1 KiB
TypeScript

import type { ButtonHTMLAttributes, ReactNode } from "react";
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: "primary" | "secondary" | "danger" | "ghost";
size?: "sm" | "md" | "lg";
children: ReactNode;
}
export function Button({
variant = "primary",
size = "md",
children,
className = "",
...props
}: ButtonProps) {
const baseStyles = "inline-flex items-center justify-center font-medium rounded-md";
const variantStyles = {
primary: "bg-blue-600 text-white hover:bg-blue-700",
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300",
danger: "bg-red-600 text-white hover:bg-red-700",
ghost: "bg-transparent text-gray-700 hover:bg-gray-100 border border-gray-300",
};
const sizeStyles = {
sm: "px-3 py-1.5 text-sm",
md: "px-4 py-2 text-base",
lg: "px-6 py-3 text-lg",
};
const combinedClassName = [baseStyles, variantStyles[variant], sizeStyles[size], className]
.filter(Boolean)
.join(" ");
return (
<button className={combinedClassName} {...props}>
{children}
</button>
);
}