/**
 * This file is auto-generated by prepare-build.js script
 * Do not edit this file manually
 */
import type { App, Component, DefineComponent } from 'vue';
import type { PrimitiveProps as RekaPrimitiveProps } from 'reka-ui';
export * from './components';
export * from './patterns';
export * from './templates';
export * from './directives';
export { Primitive } from 'reka-ui';
export type PrimitiveProps = RekaPrimitiveProps;

import { vHover } from './directives/vHover';

/**
 * Vue SFC module shape used by the library installer.
 */
type InstallableComponent = DefineComponent & {
  /** Compiler-generated component name. */
  __name?: string;
  /** Explicit component name fallback. */
  name?: string;
};

/**
 * Module shape returned for eagerly imported Vue components.
 */
type ComponentModule = {
  /** Default Vue component export. */
  default: InstallableComponent;
};

/**
 * Eagerly loaded Vue components registered by the plugin installer.
 */
const components = import.meta.glob<ComponentModule>(
  ['@/components/**/*.vue', '@/patterns/**/*.vue', '@/templates/**/*.vue'],
  {
    eager: true,
  },
);

export default {
  install(app: App) {
    app.directive('hover', vHover);
    Object.values(components).forEach((component) => {
      const componentName = component.default.__name ?? component.default.name;
      if (componentName) {
        app.component(componentName, component.default as Component);
      }
    });
  },
};
  