/*
 * CloudBeaver - Cloud Database Manager
 * Copyright (C) 2020-2024 DBeaver Corp and others
 *
 * Licensed under the Apache License, Version 2.0.
 * you may not use this file except in compliance with the License.
 */

@import '@material/radio/mixins';

@mixin radio-core-styles($query: mdc-feature-all()) {
  @include mdc-radio-core-styles;

  .theme-radio {
    @extend .mdc-radio;
  }

  .theme-radio_native-control {
    @extend .mdc-radio__native-control;

    &:disabled {
      opacity: 0;
    }
  }

  .theme-radio_background {
    @extend .mdc-radio__background;
  }

  .theme-radio_outer-circle {
    @extend .mdc-radio__outer-circle;
  }

  .theme-radio_inner-circle {
    @extend .mdc-radio__inner-circle;
  }

  .theme-radio_ripple {
    @extend .mdc-radio__ripple;
  }

  .theme-radio--disabled {
    @extend .mdc-radio--disabled;
  }

  .theme-radio_primary {
    $mdc-radio-baseline-theme-color: primary;
    $mdc-radio-unchecked-color: rgba(mdc-theme-prop-value(on-surface), 0.54);
    $mdc-radio-disabled-circle-color: rgba(mdc-theme-prop-value(on-surface), 0.26);

    @include mdc-radio-unchecked-stroke-color($mdc-radio-unchecked-color, $query: $query);
    @include mdc-radio-checked-stroke-color($mdc-radio-baseline-theme-color, $query: $query);
    @include mdc-radio-ink-color($mdc-radio-baseline-theme-color, $query: $query);
    @include mdc-radio-disabled-unchecked-stroke-color($mdc-radio-disabled-circle-color, $query: $query);
    @include mdc-radio-disabled-checked-stroke-color($mdc-radio-disabled-circle-color, $query: $query);
    @include mdc-radio-disabled-ink-color($mdc-radio-disabled-circle-color, $query: $query);
    @include mdc-radio-focus-indicator-color($mdc-radio-baseline-theme-color, $query: $query);
  }

  .theme-radio_small {
    @include mdc-radio-density(-3);
  }

  .theme-radio_no-ripple {
    @include mdc-radio-ripple-size(0);
  }
}
