{"version":3,"file":"Axis-CqJmtvWi.cjs","names":[],"sources":["../src/Components/Elements/Axes/Axis.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\n\r\ninterface Props {\r\n  label?: string;\r\n  labelPos?: { x: number; y: number; dy: string | number; dx: string | number };\r\n  y1: number;\r\n  x1: number;\r\n  y2: number;\r\n  x2: number;\r\n  classNames?: { axis?: string; label?: string };\r\n  styles?: { axis?: React.CSSProperties; label?: React.CSSProperties };\r\n  hideAxisLine?: boolean;\r\n}\r\n\r\nexport function Axis(props: Props) {\r\n  const { label, x2, y2, x1, y1, classNames, styles, labelPos, hideAxisLine } = props;\r\n  return (\r\n    <>\r\n      {hideAxisLine ? null : (\r\n        <line\r\n          y1={y1}\r\n          y2={y2}\r\n          x1={x1}\r\n          x2={x2}\r\n          style={styles?.axis}\r\n          className={cn('stroke-1 stroke-foreground-soft', classNames?.axis)}\r\n        />\r\n      )}\r\n      {!checkIfNullOrUndefined(label) ? (\r\n        <text\r\n          x={labelPos?.x}\r\n          y={labelPos?.y}\r\n          style={{\r\n            textAnchor: 'start',\r\n            ...(styles?.label || ''),\r\n          }}\r\n          className={cn('fill-foreground text-xs', classNames?.label)}\r\n          dy={labelPos?.dy}\r\n          dx={labelPos?.dx}\r\n        >\r\n          {label}\r\n        </text>\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n"],"mappings":"sIAgBA,SAAgB,EAAK,EAAc,CACjC,GAAM,CAAE,QAAO,KAAI,KAAI,KAAI,KAAI,aAAY,SAAQ,WAAU,gBAAiB,EAC9E,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,EAAe,MACd,EAAA,EAAA,KAAC,OAAD,CACM,KACA,KACA,KACA,KACJ,MAAO,GAAQ,KACf,WAAA,EAAA,EAAA,IAAc,kCAAmC,GAAY,IAAI,CAClE,CAAA,EAED,EAAA,EAAuB,CAAK,EAc1B,MAbF,EAAA,EAAA,KAAC,OAAD,CACE,EAAG,GAAU,EACb,EAAG,GAAU,EACb,MAAO,CACL,WAAY,QACZ,GAAI,GAAQ,OAAS,EACvB,EACA,WAAA,EAAA,EAAA,IAAc,0BAA2B,GAAY,KAAK,EAC1D,GAAI,GAAU,GACd,GAAI,GAAU,YAEb,CACG,CAAA,CAER,CAAA,CAAA,CAEN"}