// @flow
import { getSpacingRules } from '../../../mixins/spacing';
import { getPaletteColor } from '../../../mixins/branding';
import type { ThemeProps } from '../../../types';
import type { SpaceProps } from '../../../mixins/spacing';
import { getFontSize } from '../../../mixins/typography';
import { fadeColor } from '../../../utils/color';

export const getCardSpacingRules = ({
  theme,
  spacing,
}: {|
  ...ThemeProps,
  ...SpaceProps,
|}) => getSpacingRules({ theme, spacing: spacing || 'mb2' });

export const getBoxShadowColor = ({ theme }: ThemeProps) =>
  fadeColor(getPaletteColor('greyscale-black')({ theme }), 0.95);

export const getCardFontSize = ({ theme }: ThemeProps) =>
  getFontSize({ theme, fontSize: 'f1' });

export const getCardBorderRadius = ({ theme }: ThemeProps) =>
  theme.cardBorderRadius;
