import { mode, getColor, transparentize } from './../tools';

function getBg(props) {
  const {
    theme,
    status
  } = props;
  const lightBg = getColor(theme, "".concat(status, ".50"), status);
  const darkBg = transparentize("".concat(status, ".200"), 0.5)(theme);
  return mode(lightBg, darkBg)(props);
}

const variantSubtle = props => {
  let {
    status
  } = props;
  status = status === 'info' ? 'default' : status;
  let a = {
    border: 6,
    borderColor: 'transparent',
    bg: getBg(props),
    iconColor: mode("".concat(status, ".400"), "".concat(status, ".50"))(props),
    textColor: mode('gray', 'white')(props)
  };
  return a;
};

const variantSolid = props => {
  let {
    status
  } = props;
  status = status === 'info' ? 'default' : status;
  return {
    border: 6,
    borderColor: 'transparent',
    bg: getBg(props),
    iconColor: mode("".concat(status, ".400"), "".concat(status, ".50"))(props),
    textColor: mode('gray', 'white')(props)
  };
};

const variantLeftAccent = props => {
  let {
    status,
    theme
  } = props;
  status = status === 'info' ? 'default' : status;
  return {
    border: 6,
    bg: getBg(props),
    iconColor: mode("".concat(status, ".400"), "".concat(status, ".50"))(props),
    textColor: mode('gray', 'white')(props),
    borderColor: 'transparent',
    borderLeftColor: theme.colors[status][100]
  };
};

const variantTopAccent = props => {
  let {
    status,
    theme
  } = props;
  status = status === 'info' ? 'default' : status;
  return {
    border: 6,
    borderColor: 'transparent',
    borderTopColor: theme.colors[status][100],
    bg: getBg(props),
    iconColor: mode("".concat(status, ".400"), "".concat(status, ".50"))(props),
    textColor: mode('gray', 'white')(props)
  };
};

const variants = {
  subtle: variantSubtle,
  solid: variantSolid,
  'left-accent': variantLeftAccent,
  'top-accent': variantTopAccent
};
const defaultAlertProps = {
  status: 'default',
  variant: 'subtle',
  p: 3,
  borderRadius: 'md'
};
export const Alert = {
  defaultProps: defaultAlertProps,
  variants
}; // AlertTitle

const defaultAlertTitleProps = {
  fontSize: 'lg',
  fontWeight: 'bold'
};
export const AlertTitle = {
  defaultProps: defaultAlertTitleProps
}; // AlertDescription

const defaultAlertDescriptionProps = {
  fontSize: 'lg'
};
export const AlertDescription = {
  defaultProps: defaultAlertDescriptionProps
};
//# sourceMappingURL=alert.js.map