//
// Copyright IBM Corp. 2020, 2021
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

// Standard imports.
@import '../../global/styles/project-settings';
@import '../../global/styles/mixins';

// ActionBar uses the following Carbon components:
// Button, OverflowMenu, OverflowMenuItem
@import 'carbon-components/scss/components/button/button';
@import 'carbon-components/scss/components/overflow-menu/overflow-menu';

// Define all component styles in a mixin which is then exported using
// the Carbon import-once mechanism.
@mixin action-bar {
  $block-class: #{$pkg-prefix}--action-bar;
  $block-class-overflow-items: #{$block-class}-overflow-items;

  @include block-wrap($block-class) {
    &.#{$block-class} {
      display: block;
    }

    .#{$block-class}__displayed-items {
      display: inline-flex;
      width: 100%;
      white-space: nowrap;
    }

    .#{$block-class}__displayed-items--right {
      justify-content: flex-end;
    }

    .#{$block-class-overflow-items} {
      display: inline-block;
    }

    .#{$block-class}__hidden-sizing-items {
      // This breadcrumb container is used to measure the width of all displayable breadcrumbs
      @include measuring-container;
    }
  }

  @include block-wrap($block-class-overflow-items + '__options') {
    .#{$block-class-overflow-items}__item {
      padding: 0 $spacing-03;
    }

    .#{$block-class-overflow-items}__item-content {
      display: flex;
      width: 100%;
      justify-content: space-between;
    }

    .#{$block-class-overflow-items}__item svg {
      margin: 0 $spacing-02;
    }
  }
}

@include exports('action-bar') {
  @include action-bar;
}
