// buttonSchema.ts
import { z } from "zod";

const ButtonSize = z.enum(["2xs", "xs", "sm", "md", "lg", "xl"]);
const ButtonColor = z.enum([
  "error",
  "primary",
  "secondary",
  "success",
  "info",
  "warning",
  "neutral",
]);
const ButtonVariant = z.enum(["solid", "outline", "soft", "ghost", "link"]);

export const ButtonPropsSchema = z.object({
  size: ButtonSize.optional().default("sm"),
  type: z.enum(["button", "submit", "reset"]).optional().default("button"),
  label: z.string().optional().default(""),
  color: ButtonColor.optional().default("primary"),
  variant: ButtonVariant.optional().default("solid"),
  icon: z.string().optional().default(""),
  leading: z.boolean().optional().default(false),
  trailing: z.boolean().optional().default(false),
  disabled: z.boolean().optional().default(false),
  loading: z.boolean().optional().default(false),
  loadingIcon: z.string().optional().default("i-heroicons-arrow-path-20-solid"),
  block: z.boolean().optional().default(false),
  to: z.string().optional().default(""),
  target: z.string().optional().default(""),
  padded: z.boolean().optional().default(true),
  square: z.boolean().optional().default(false),
  truncate: z.boolean().optional().default(false),
  attrs: z.record(z.any()).optional().default({}),
});

export type ButtonProps = z.infer<typeof ButtonPropsSchema>;
