import styled, { css } from 'styled-components';
import { color } from '../../constants/style';

const staticStyles = css`
  border-radius: 4px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 16px;
  font-size: 14px;
  z-index: 1400;
  min-width: 288px;
  max-width: 330px;
  flex-grow: initial;
  width: auto;

  transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2), 0px 4px 12px 0px rgba(0,0,0,0.14), 0px 1px 8px 0px rgba(0,0,0,0.12);
`;

const theme: {[index: string]:any} = {
  default: css`
    color: ${color.black87};
    background-color: white;
  `,
  success: css`
    color: ${color.black87};
    background-color: ${color.success};
  `,
  error: css`
    color: ${color.black87};
    background-color: ${color.error};
  `,
  warning: css`
    color: ${color.black87};
    background-color: ${color.warning};
  `,
};

export const Wrapper = styled('div')<{appearance: string}>`
  ${staticStyles}
  ${props => theme[props.appearance]}
`;

export const Message =styled.div`
  padding: 8px 0;
`;

export const Action = styled.div`
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 16px;
  margin-right: -8px;
`;
