{"version":3,"file":"createBorder.cjs","sources":["../../src/themes/createBorder.ts"],"sourcesContent":["import { merge } from '../libs/lodash'\n\nimport { type ColorProperty, defaultColor } from './createColor'\n\nconst defaultLineWidth = '1px'\nconst defaultLineStyle = 'solid'\nconst defaultLineColor = defaultColor.BORDER\nconst highContrastBorderColor = defaultColor.GREY_100\n\nexport type BorderProperty = {\n  lineWidth?: string\n  lineStyle?: string\n  shorthand?: string\n}\n\nexport type CreatedBorderTheme = {\n  lineWidth: string\n  lineStyle: string\n  shorthand: string\n  highContrast: string\n}\n\nexport const defaultBorder: CreatedBorderTheme = {\n  lineWidth: defaultLineWidth,\n  lineStyle: defaultLineStyle,\n  shorthand: `${defaultLineWidth} ${defaultLineStyle} ${defaultLineColor}`,\n  highContrast: `${defaultLineWidth} ${defaultLineStyle} ${highContrastBorderColor}`,\n}\n\nexport const createBorder = (\n  userBorder?: BorderProperty,\n  userColor?: ColorProperty,\n): CreatedBorderTheme => {\n  const color = userColor?.BORDER || defaultColor.BORDER\n  const borders = {\n    ...defaultBorder,\n    shorthand: `${defaultLineWidth} ${defaultLineStyle} ${color}`,\n  }\n\n  if (!userBorder) {\n    return borders\n  }\n\n  return merge(borders, userBorder)\n}\n"],"names":["defaultColor","merge"],"mappings":";;;;;AAIA,MAAM,gBAAgB,GAAG,KAAK;AAC9B,MAAM,gBAAgB,GAAG,OAAO;AAChC,MAAM,gBAAgB,GAAGA,+BAAY,CAAC,MAAM;AAC5C,MAAM,uBAAuB,GAAGA,+BAAY,CAAC,QAAQ;AAe9C,MAAM,aAAa,GAAuB;AAC/C,IAAA,SAAS,EAAE,gBAAgB;AAC3B,IAAA,SAAS,EAAE,gBAAgB;AAC3B,IAAA,SAAS,EAAE,CAAA,EAAG,gBAAgB,IAAI,gBAAgB,CAAA,CAAA,EAAI,gBAAgB,CAAA,CAAE;AACxE,IAAA,YAAY,EAAE,CAAA,EAAG,gBAAgB,IAAI,gBAAgB,CAAA,CAAA,EAAI,uBAAuB,CAAA,CAAE;;MAGvE,YAAY,GAAG,CAC1B,UAA2B,EAC3B,SAAyB,KACH;IACtB,MAAM,KAAK,GAAG,SAAS,EAAE,MAAM,IAAIA,+BAAY,CAAC,MAAM;AACtD,IAAA,MAAM,OAAO,GAAG;AACd,QAAA,GAAG,aAAa;AAChB,QAAA,SAAS,EAAE,CAAA,EAAG,gBAAgB,IAAI,gBAAgB,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE;KAC9D;IAED,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,OAAO;IAChB;AAEA,IAAA,OAAOC,iBAAK,CAAC,OAAO,EAAE,UAAU,CAAC;AACnC;;;;;"}