import { Component } from '@angular/core';
import { NgpMenu } from 'ng-primitives/menu';

@Component({
  selector: '<% if (prefix) { %><%= prefix %>-<% } %>menu',
  hostDirectives: [NgpMenu],
  template: `
    <ng-content />
  `,
  styles: `
/* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */

    :host {
      position: fixed;
      display: flex;
      flex-direction: column;
      width: max-content;
      background: var(--ngp-background);
      border: 1px solid var(--ngp-border);
      box-shadow: var(--ngp-shadow);
      border-radius: 8px;
      padding: 4px;
      animation: menu-show 300ms ease-out;
    }

    :host[data-exit] {
      animation: menu-hide 300ms ease-out;
    }

    @keyframes menu-show {
      0% {
        opacity: 0;
        transform: scale(0.9);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }

    @keyframes menu-hide {
      0% {
        opacity: 1;
        transform: scale(1);
      }
      100% {
        opacity: 0;
        transform: scale(0.9);
      }
    }

    /* Reduce motion for users who prefer reduced motion. */
    @media (prefers-reduced-motion: reduce) {
      :host,
      :host[data-exit] {
        animation-duration: 0s;
      }
    }
  `,
})
export class Menu<%= componentSuffix %> {}
