import { html } from "lit"; type ButtonTheme = "light" | "dark" | "danger"; type ButtonType = "primary" | "secondary" | "tertiary"; type NonLightTheme = Exclude; export interface ButtonProps { label: string; type: ButtonType; theme: ButtonTheme; icon: boolean; } export const Button = ({ label, type = "primary", theme = "light", icon = false }: ButtonProps) => { const typeClasses: Record = { primary: "", secondary: "usa-button--outline", tertiary: "usa-button--unstyled", }; const themeClasses: Record> = { dark: { primary: "nj-button--primary-dark", secondary: "usa-button--inverse", tertiary: "nj-button--unstyled-dark", }, danger: { primary: "usa-button--secondary", secondary: "nj-button--outline-danger", tertiary: "nj-button--unstyled-danger", }, }; const buttonType = typeClasses[type]; const buttonTheme = theme !== "light" ? themeClasses[theme][type] : ""; const modeSetting = theme === "dark" ? "usa-dark-background padding-2" : ""; return html`
`; };