<template>
  <kbd :class="[ui.base, ui.size[size], ui.padding, ui.rounded, ui.font, ui.background, ui.ring]">
    <slot>{{ value }}</slot>
  </kbd>
</template>

<script>
import { defineComponent, computed } from "vue";
import { defu } from "defu";
import { useAppConfig } from "#imports";
import appConfig from "#build/app.config";
export default defineComponent({
  props: {
    value: {
      type: String,
      default: null
    },
    size: {
      type: String,
      default: () => appConfig.ui.kbd.default.size,
      validator(value) {
        return Object.keys(appConfig.ui.kbd.size).includes(value);
      }
    },
    ui: {
      type: Object,
      default: () => appConfig.ui.kbd
    }
  },
  setup(props) {
    const appConfig2 = useAppConfig();
    const ui = computed(() => defu({}, props.ui, appConfig2.ui.kbd));
    return {
      // eslint-disable-next-line vue/no-dupe-keys
      ui
    };
  }
});
</script>
