//
// 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';

// ButtonSetWithOverflow uses the following Carbon components:
// ButtonSet, Button
@import 'carbon-components/scss/components/button/button';

// ButtonSetWithOverflow uses the following IBM Products components:
// ButtonMenu, ButtonMenuItem
@import '../ButtonMenu/button-menu';

$block-class: #{$pkg-prefix}--button-set-with-overflow;

@mixin button-set-with-overflow {
  @include block-wrap($block-class) {
    &.#{$block-class} {
      display: flex;
      width: 100%;
    }

    .#{$block-class}__space {
      position: relative;
      display: block;
      width: 100%;
      white-space: nowrap;
    }

    .#{$block-class}__button-container {
      display: inline-flex; // needed to register a width
    }

    .#{$block-class}__button-container--hidden {
      // This button-set container is used to measure the width of all displayable button-sets
      @include measuring-container;
    }

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

@include exports('button-set-with-overflow') {
  @include button-set-with-overflow;
}
