<!-- Local nav. -->
<kbn-top-nav name="visualize">
  <!-- Transcluded elements. -->
  <div data-transclude-slots>
    <!-- Breadcrumbs. -->
    <bread-crumbs
      data-transclude-slot="topLeftCorner"
      use-links="true"
      omit-current-page="true"
      page-title="'New'"
    ></bread-crumbs>
  </div>
</kbn-top-nav>

<div class="kuiViewContent kuiViewContent--constrainedWidth kuiViewContentItem" data-test-subj="visualizeSelectTypePage">
  <div class="kuiViewContentItem">
    <!-- Header -->
    <div class="visualizeViewContentHeader kuiVerticalRhythm kuiVerticalRhythm--medium">
      <h1 class="kuiTitle">
        Select visualization type
      </h1>
    </div>

    <!-- Search -->
    <div class="kuiSearchInput kuiVerticalRhythm kuiVerticalRhythm--medium fullWidth" role="search">
      <icon class="kuiSearchInput__icon kuiIcon fa-search"></icon>
      <input
        class="kuiSearchInput__input"
        type="text"
        placeholder="Search visualization types..."
        ng-model="searchTerm"
      >
    </div>
    <div
      class="kuiVerticalRhythm kuiVerticalRhythm--medium"
      ng-repeat="category in filteredVisTypeCategories"
    >

      <!-- Title for each category -->
      <h2 class="kuiSubTitle kuiVerticalRhythm">
        {{ category.label }}
      </h2>

      <!-- Gallery of buttons for each vis type -->
      <div class="kuiGallery kuiVerticalRhythm">
        <a
          class="kuiGalleryItem"
          ng-repeat="type in category.list"
          ng-href="{{ getVisTypeUrl(type) }}"
          tooltip="{{ getVisTypeTooltip(type) }}"
          tooltip-placement="{{ getVisTypeTooltipPosition($parent.$index) }}"
          aria-describedby="visDescription_{{ ::getVisTypeId(type) }}"
          data-test-subj="visType-{{::type.name}}"
        >
          <div class="kuiGalleryItem__image">
            <img
              class="visWizard__visTypeImage"
              ng-if="type.image"
              aria-hidden="true"
              ng-src="{{ type.image }}"
            />

            <!-- Allowing legacyIcon to hold a CSS name, will be removed in 7.0 -->
            <span
              ng-if="!type.image && !type.icon"
              aria-hidden="true"
              class="kuiIcon visWizard__visTypeIcon"
              ng-class="type.legacyIcon"
            ></span>

            <!-- If there's no image, default to an icon, for BWC. -->
            <icon
              ng-if="!type.image && type.icon"
              aria-hidden="true"
              class="kuiIcon visWizard__visTypeIcon"
              type="type.icon"
              size="'xxl'"
            ></icon>
          </div>

          <div
            class="kuiGalleryItem__label"
            data-test-subj="visualizeWizardChartTypeTitle"
          >
            {{ type.title }}
          </div>

          <div
            class="kuiGalleryItem__icon kuiIcon fa-flask"
            ng-if="type.shouldMarkAsExperimentalInUI()"
          ></div>

          <span
            class="euiScreenReaderOnly"
            aria-hidden="true"
            id="visDescription_{{ ::getVisTypeId(type) }}"
          >{{::getVisTypeTooltip(type)}}</span>
        </a>
      </div>
    </div>
  </div>
</div>
