import { html, type PropertyValues } from "lit";
import { styles } from "./styles.ts";
import { property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { consume } from "@lit/context";
import { BaseElement } from "../../core/base-element.ts";
import { oneOf } from "../../core/property-guards.ts";
import {
applyThemeToElement,
type CFTheme,
cfThemeContext,
type ColorIntent,
type ComponentSize,
defaultTheme,
} from "../theme-context.ts";
/**
* CFButton - Interactive button element with multiple variants and sizes
*
* @element cf-button
*
* @attr {string} color - Color intent: "neutral" | "primary" | "accent" | "danger"
* @attr {string} variant - Visual style variant: "solid" | "outline" | "ghost"
* @attr {string} size - Button size: "xs" | "sm" | "md" | "lg" | "xl" | "icon"
* @attr {boolean} disabled - Whether the button is disabled
* @attr {string} type - Button type: "button" | "submit" | "reset"
*
* @slot - Default slot for button content
*
* @example
* console.log('Button clicked')}>Click Me
*/
export type ButtonVariant = "solid" | "outline" | "ghost";
export type ButtonSize = ComponentSize | "icon";
const buttonVariants = ["solid", "outline", "ghost"] as const;
const buttonColors = ["neutral", "primary", "accent", "danger"] as const;
const buttonSizes = ["xs", "sm", "md", "lg", "xl", "icon"] as const;
const buttonTypes = ["button", "submit", "reset"] as const;
// ── Accessibility strategy ───────────────────────────────────────────
//
// The host carries role="button" so agents can find it via getByRole.
// The shadow DOM contains a