import { colorToString } from "../components/utils/colorToString";
function borderPropertyDataToStyle(data, defaultValue = {}) {
  const borderTop = data.borderTop ?? defaultValue.borderTop;
  const borderRight = data.borderRight ?? defaultValue.borderRight;
  const borderBottom = data.borderBottom ?? defaultValue.borderBottom;
  const borderLeft = data.borderLeft ?? defaultValue.borderLeft;
  const style = {};
  if (borderTop != null)
    style.borderTop = borderSideToString(borderTop);
  if (borderRight != null)
    style.borderRight = borderSideToString(borderRight);
  if (borderBottom != null)
    style.borderBottom = borderSideToString(borderBottom);
  if (borderLeft != null)
    style.borderLeft = borderSideToString(borderLeft);
  return style;
}
function borderSideToString(borderSide) {
  if (typeof borderSide === "string")
    return borderSide;
  if (typeof borderSide === "number")
    return `${borderSide}px`;
  const { width, color, style } = borderSide;
  return `${width != null ? width : 0}px ${style} ${color != null ? colorToString(color) : "black"}`;
}
export {
  borderPropertyDataToStyle
};
//# sourceMappingURL=border.js.map