.c-modal

scss
.c-modal {
  background-color: use-color('base', 'true-white');
  border: solid 1px use-color('grey', 'light-i');
  border-radius: 8px;
  box-sizing: border-box;
  height: auto;
  left: 50%;
  max-height: 100%;
  max-width: 90%;
  padding: 16px;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  z-index: use-layer('modal-2');

  @include media-breakpoint-up('tablet') {
    box-sizing: unset;
  }

  @include element('close-icon') {
    color: use-color('grey', 'light');
    position: absolute;
    right: 16px;
    text-decoration: none;
    z-index: use-layer('modal');

    [class^='icon-'],
    [class*=' icon-'] {
      font-size: 16px;
    }
  }

  @include element('header') {
    margin: 32px 0 16px;
    padding: 0 8px;
    width: fit-content;

    @include media-breakpoint-up('tablet') {
      margin: 36px 0 28px;
      padding: 0 24px;
    }

    @include if-block-has-modifier('c-modal', 'small') {
      margin: 16px 0 20px;
      padding: 0 8px;
    }
    
    @include if-block-has-modifier('c-modal', 'padding-less') {
      margin: 0 0 20px;
      padding: 0 16px;
    }

    &::first-letter {
      text-transform: uppercase;
    }
  }

  @include element('content') {
    // height: 68%;
    height: fit-content;
    overflow: hidden;
    overflow-y: scroll;
    padding: 0 8px 8px;

    @include media-breakpoint-up('tablet') {
      padding: 0 24px 24px;
    }

    @include if-block-has-modifier('c-modal', 'loader') {
      overflow-y: auto;
      padding: 7px;
    }

    @include if-block-has-modifier('c-modal', 'small') {
      min-height: 100px;
      overflow: auto;
      padding: 0 8px 8px;
    }
    
    @include if-block-has-modifier('c-modal', 'padding-less') {
      padding: 0;
    }
    
    @include if-block-has-modifier('c-modal', 'with-footer') {
      height: 80%;
      margin-bottom: 40px;
    }
    
    @include if-block-has-modifier('c-modal', 'datetime-picker') {
      display: flex;
      flex-direction: row;
      padding: 0;

      @include media-breakpoint-down('tablet') {
        flex-direction: column;
      }
    }

    // overrides
    .c-campaign-visibility {
      margin: 0;
      width: 100%;
    }

    .c-indicator-group,
    .c-transferable-user {
      margin: 0 0 16px;
    }
  
    img {
      width: 100%;
    }
  }

  @include element('footer') {
    background-color: use-color('base', true-white);
    border-radius: 0 0 8px 8px;
    bottom: 0;
    box-shadow: $box-shadow-card-lvl-1;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 16px;
    position: absolute;
    width: 92%;
    z-index: use-layer('modal-3');

    @include media-breakpoint-up('webchat') {
      width: inherit;
    }
    
    @include media-breakpoint-between('webchat', 'tablet') {
      width: 95%;
    }

    .c-button {
      max-width: 270px;
    }
  }

  @include element('action-area') {
    background-color: use-color('grey', 'light-iii');
    border-top: solid 1px use-color('grey', 'light-i');
    cursor: pointer;
    display: flex;
    padding: 12px 16px;
    text-decoration: none;

    @include modifier('data') {
      color: use-color('grey');
      display: flex;
      flex-direction: column;
      margin-left: 8px;
      
      span {
        margin-bottom: 8px;

        &::first-letter {
          text-transform: uppercase;
        }
      } 
    }

    [class^='icon-'],
    [class*=' icon-'] {
      color: use-color('primary');
      font-size: 21px;
    }
  }

  @include element('overlay') {
    background-color: transparentize($color: use-color('base', 'black'), $amount: 0.2);
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: use-layer('modal');
  }

  @include modifier('small') {
    height: fit-content;
    width: 329px;
  }

  @include modifier('auto-height') {
    height: fit-content;
  }

  @include modifier('with-footer') {
    box-sizing: unset;
    height: 90%;
  }

  @include modifier('padding-less') {
    padding: 16px 0 0;
    width: 391px;
  }
  
  @include modifier('datetime-picker') {
    padding-right: 0;
  }

  @include modifier('loader') {
    width: auto;
  }
}

TODO: add docs

Examples

html
<div class="u-widget-example-margin"> <!-- this div is just for the example -->

  <div class="c-modal">
    <a href="#" class="c-modal__close-icon">
      <span class="icon-close"></span>
    </a>
  
    <div class="c-modal__header">
      Dummy header
    </div>
  
    <div class="c-modal__content">
      // some content
    </div>
  </div>

  <div class="c-modal__overlay"></div>

</div>
html small
<div class="u-widget-example-margin"> <!-- this div is just for the example -->

  <div class="c-modal c-modal--small">
    <a href="#" class="c-modal__close-icon">
      <span class="icon-close"></span>
    </a>
  
    <div class="c-modal__header">
      Dummy header
    </div>
  
    <div class="c-modal__content">
      // some content
    </div>
  </div>

  <div class="c-modal__overlay"></div>

</div>
html with footer
<div class="u-widget-example-margin"> <!-- this div is just for the example -->

  <div class="c-modal c-modal--with-footer">
    <a href="#" class="c-modal__close-icon">
      <span class="icon-close"></span>
    </a>
  
    <div class="c-modal__header">
      Dummy header
    </div>
  
    <div class="c-modal__content">
      // some content
    </div>

    <div class="c-modal__footer">
      <a class="c-button">
        transferir chat
      </a>
    </div>

  </div>

  <div class="c-modal__overlay"></div>

</div>
html padding-less
<div class="u-widget-example-margin"> <!-- this div is just for the example -->

  <div class="c-modal c-modal--padding-less">
    <a href="#" class="c-modal__close-icon">
      <span class="icon-close"></span>
    </a>
  
    <div class="c-modal__header">
      Dummy header
    </div>
  
    <div class="c-modal__content">
      // some content
    </div>

  </div>

  <div class="c-modal__overlay"></div>

</div>

.c-datetime-modal

scss
.c-datetime-modal {
  @include element('section') {
    position: relative;
    width: 100%;

    @include modifier('time') {
      border-left: solid 1px use-color('grey', 'light-i');
      // display: flex;
      // flex-direction: column;
      // justify-content: space-between;
      max-width: 232px;

      @include media-breakpoint-down('tablet') {
        border-left: 0;
        max-width: inherit;
        padding-right: 16px;
      }
    }
  }

  @include element('header') {
    @include use-font('subheading');
    color: use-color('grey');
    padding-left: 8px;
  }

  @include element('content') {
    padding: 0 8px;
  }

  @include element('action-area') {
    align-content: center;
    border-top: solid 1px use-color('grey', 'light-i');
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding: 0 8px;

    @include media-breakpoint-down('tablet') {
      border-top: 0;
      padding: 0 16px 0 0;
    }
  }

  @include element('message') {
    @include use-font('body-alt');
    margin: 12px 0;
    padding: 0 14px;
    text-align: center;
    
    @include media-breakpoint-down('tablet') {
      color: use-color('grey');
      padding: 0;
    }

    @include modifier('error') {
      @include use-font('caption');
      color: use-color('event', 'error');
      line-height: 14px;
    }
  }
}
  • c-datetime-modal__section
    • c-datetime-modal__header
    • c-datetime-modal__content
      • c-datetime-modal__action-area
        • c-datetime-modal__message
        • c-datetime-modal__message–error

Example

html datetime-picker
<div class="u-widget-example-margin"> <!-- this div is just for the example -->

  <div class="c-modal c-modal--datetime-picker">
    <a href="#" class="c-modal__close-icon">
      <span class="icon-close"></span>
    </a>
  
    <div class="c-modal__content">        
      <div class="c-datetime-modal__section">
        <div class="c-datetime-modal__header">
          Día
        </div>
        
        <div class="c-datetime-modal__content">
    
        </div>
      </div>
      
      <div class="c-datetime-modal__section c-datetime-modal__section--time">
        <div class="c-datetime-modal__header">
          Horario
        </div>
        <!-- inline style only for example porpouse -->
        <div class="c-datetime-modal__content" style="min-height: 100px">
    
        </div>
    
        <div class="c-datetime-modal__action-area">
          <p class="c-datetime-modal__message">
            El envío será programado para el 
            <strong>17 de Junio del 2020</strong> 
            a las 
            <strong>12:43 PM</strong>
          </p>
    
          <a href="#" class="c-button c-button--secondary c-button--thin">
            Programar
          </a>
          
          <p class="c-datetime-modal__message c-datetime-modal__message--error">
            El horario programado debe ser posterior a la fecha actual
          </p>
        </div>
      </div>
    </div>

  </div>

  <div class="c-modal__overlay"></div>

</div>

.c-modal--campaign-list

scss
.c-modal {
  @include modifier('campaign-list') {
    // height: 468px;
    height: fit-content;
    
    // overrides
    .c-modal {
      @include element('content') {
        display: contents;
        height: 90%;
      }
    }

    .c-list {
      margin: 16px 0 0 16px;
    }
  }
}

Clase modificadora con los cambios necesarios para la lista de campañas