import { splitProps } from '../helpers.mjs';
import { createRecipe } from './create-recipe.mjs';

const buttonFn = /* @__PURE__ */ createRecipe('btn', {
  "colorPalette": "gray",
  "variant": "solid",
  "size": "md"
}, [
  {
    "variant": "ghost",
    "colorPalette": "gray",
    "css": {
      "color": {
        "base": "gray.800",
        "_dark": "whiteAlpha.900"
      },
      "_hover": {
        "bg": {
          "base": "gray.100",
          "_dark": "whiteAlpha.200"
        }
      },
      "_active": {
        "bg": {
          "base": "gray.200",
          "_dark": "whiteAlpha.300"
        }
      }
    }
  },
  {
    "variant": "outline",
    "colorPalette": "gray",
    "css": {
      "borderColor": {
        "base": "gray.200",
        "_dark": "whiteAlpha.300"
      }
    }
  },
  {
    "variant": "solid",
    "colorPalette": "gray",
    "css": {
      "bg": {
        "base": "gray.100",
        "_dark": "whiteAlpha.200"
      },
      "color": {
        "base": "gray.800",
        "_dark": "whiteAlpha.900"
      },
      "_hover": {
        "bg": {
          "base": "gray.200",
          "_dark": "whiteAlpha.300"
        },
        "_disabled": {
          "bg": {
            "base": "gray.100",
            "_dark": "whiteAlpha.200"
          }
        }
      },
      "_active": {
        "bg": {
          "base": "gray.300",
          "_dark": "whiteAlpha.400"
        }
      }
    }
  }
])

const buttonVariantMap = {
  "colorPalette": [
    "gray",
    "blue",
    "teal",
    "inkeepPrimary"
  ],
  "size": [
    "lg",
    "md",
    "sm",
    "xs"
  ],
  "variant": [
    "ghost",
    "solid",
    "link",
    "unstyled",
    "outlinePrimary",
    "outlineFilled",
    "outlineFilledActive",
    "filledCTA",
    "primaryFilled",
    "outline",
    "iconButton"
  ]
}

const buttonVariantKeys = Object.keys(buttonVariantMap)

export const button = /* @__PURE__ */ Object.assign(buttonFn, {
  __recipe__: true,
  __name__: 'button',
  raw: (props) => props,
  variantKeys: buttonVariantKeys,
  variantMap: buttonVariantMap,
  splitVariantProps(props) {
    return splitProps(props, buttonVariantKeys)
  },
})