{"version":3,"file":"AreaChart.cjs","names":["createVarsResolver","getThemeColor","factory","useProps","useMantineTheme","useId","useState","useResolvedStylesApi","useStyles","classes","Area","Fragment","AreaGradient","PointLabel","ReferenceLine","ReferenceArea","ReferenceDot","Box","ResponsiveContainer","ReChartsAreaChart","ChartAnnouncer","Legend","ChartLegend","getLegendPosition","CartesianGrid","XAxis","Label","YAxis","Tooltip","ChartTooltip","AreaSplit","getDefaultSplitOffset","ChartBrush"],"sources":["../../src/AreaChart/AreaChart.tsx"],"sourcesContent":["import { Fragment, useId, useState } from 'react';\nimport {\n  Area,\n  AreaProps,\n  CartesianGrid,\n  Label,\n  Legend,\n  AreaChart as ReChartsAreaChart,\n  ReferenceArea,\n  ReferenceDot,\n  ReferenceLine,\n  ResponsiveContainer,\n  Tooltip,\n  XAxis,\n  YAxis,\n} from 'recharts';\nimport {\n  Box,\n  BoxProps,\n  createVarsResolver,\n  ElementProps,\n  factory,\n  Factory,\n  getThemeColor,\n  MantineColor,\n  StylesApiProps,\n  useMantineTheme,\n  useProps,\n  useResolvedStylesApi,\n  useStyles,\n} from '@mantine/core';\nimport { ChartAnnouncer } from '../ChartAnnouncer/ChartAnnouncer';\nimport { ChartBrush } from '../ChartBrush';\nimport { ChartLegend, ChartLegendStylesNames } from '../ChartLegend';\nimport { ChartTooltip, ChartTooltipStylesNames } from '../ChartTooltip';\nimport { PointLabel } from '../PointLabel/PointLabel';\nimport type {\n  BaseChartStylesNames,\n  ChartSeries,\n  GridChartBaseProps,\n  MantineChartDotProps,\n} from '../types';\nimport { getLegendPosition } from '../utils';\nimport { AreaGradient } from './AreaGradient';\nimport { AreaSplit } from './AreaSplit';\nimport { getDefaultSplitOffset } from './get-split-offset';\nimport classes from '../grid-chart.module.css';\n\nfunction valueToPercent(value: number) {\n  return `${(value * 100).toFixed(0)}%`;\n}\n\nexport interface AreaChartSeries extends ChartSeries {\n  strokeDasharray?: string | number;\n  color: MantineColor;\n  curveType?: AreaChartCurveType;\n}\n\nexport type AreaChartType = 'default' | 'stacked' | 'percent' | 'split' | 'stream';\n\nexport type AreaChartCurveType =\n  | 'bump'\n  | 'linear'\n  | 'natural'\n  | 'monotone'\n  | 'step'\n  | 'stepBefore'\n  | 'stepAfter';\n\nexport type AreaChartStylesNames =\n  | 'area'\n  | BaseChartStylesNames\n  | ChartLegendStylesNames\n  | ChartTooltipStylesNames;\n\nexport type AreaChartCSSVariables = {\n  root: '--chart-text-color' | '--chart-grid-color';\n};\n\nexport interface AreaChartProps\n  extends\n    BoxProps,\n    Omit<GridChartBaseProps, 'withXAxis' | 'withYAxis'>,\n    StylesApiProps<AreaChartFactory>,\n    ElementProps<'div'> {\n  /** An array of objects with `name` and `color` keys. Determines which data should be consumed from the `data` array. */\n  series: AreaChartSeries[];\n\n  /** Determines whether x-axis should be displayed. Defaults to `false` for `type=\"stream\"` with `orientation=\"vertical\"` – the floating baseline makes the values not meaningful to read off. @default true */\n  withXAxis?: boolean;\n\n  /** Determines whether y-axis should be displayed. Defaults to `false` for `type=\"stream\"` with `orientation=\"horizontal\"` – the floating baseline makes the values not meaningful to read off. @default true */\n  withYAxis?: boolean;\n\n  /** Controls how chart areas are positioned relative to each other. Set to `'stream'` to render a streamgraph. @default 'default' */\n  type?: AreaChartType;\n\n  /** Determines whether the chart area should be represented with a gradient instead of the solid color @default false */\n  withGradient?: boolean;\n\n  /** Type of the curve @default 'monotone' */\n  curveType?: AreaChartCurveType;\n\n  /** Determines whether dots should be displayed @default true */\n  withDots?: boolean;\n\n  /** Props passed down to all dots. Ignored if `withDots={false}` is set. */\n  dotProps?: MantineChartDotProps;\n\n  /** Props passed down to all active dots. Ignored if `withDots={false}` is set. */\n  activeDotProps?: MantineChartDotProps;\n\n  /** Stroke width for the chart areas @default 2 */\n  strokeWidth?: number;\n\n  /** Props passed down to recharts `AreaChart` component */\n  areaChartProps?: React.ComponentProps<typeof ReChartsAreaChart>;\n\n  /** Controls fill opacity of all areas @default 0.2 */\n  fillOpacity?: number;\n\n  /** A tuple of colors used when `type=\"split\"` is set, ignored in all other cases. A tuple may include theme colors reference or any valid CSS colors @default ['green.7', 'red.7'] */\n  splitColors?: [MantineColor, MantineColor];\n\n  /** Offset for the split gradient. By default, value is inferred from `data` and `series` if possible. Must be generated from the data array with `getSplitOffset` function. */\n  splitOffset?: number;\n\n  /** If set, points with `null` values are connected @default true */\n  connectNulls?: boolean;\n\n  /** Additional components that are rendered inside recharts `AreaChart` component */\n  children?: React.ReactNode;\n\n  /** Props passed down to recharts `Area` component */\n  areaProps?:\n    | ((series: AreaChartSeries) => Partial<Omit<AreaProps<any, any>, 'ref'>>)\n    | Partial<Omit<AreaProps<any, any>, 'ref'>>;\n\n  /** If set, each point has an associated label @default false */\n  withPointLabels?: boolean;\n}\n\nexport type AreaChartFactory = Factory<{\n  props: AreaChartProps;\n  ref: HTMLDivElement;\n  stylesNames: AreaChartStylesNames;\n  vars: AreaChartCSSVariables;\n}>;\n\nconst defaultProps = {\n  withDots: true,\n  withTooltip: true,\n  connectNulls: true,\n  strokeWidth: 2,\n  tooltipAnimationDuration: 0,\n  fillOpacity: 0.2,\n  tickLine: 'y',\n  strokeDasharray: '5 5',\n  curveType: 'monotone',\n  gridAxis: 'x',\n  type: 'default',\n  splitColors: ['green.7', 'red.7'],\n  orientation: 'horizontal',\n  accessibilityLayer: true,\n} satisfies Partial<AreaChartProps>;\n\nconst varsResolver = createVarsResolver<AreaChartFactory>((theme, { textColor, gridColor }) => ({\n  root: {\n    '--chart-text-color': textColor ? getThemeColor(textColor, theme) : undefined,\n    '--chart-grid-color': gridColor ? getThemeColor(gridColor, theme) : undefined,\n  },\n}));\n\nexport const AreaChart = factory<AreaChartFactory>((_props) => {\n  const props = useProps('AreaChart', defaultProps, _props);\n  const {\n    classNames,\n    className,\n    style,\n    styles,\n    unstyled,\n    vars,\n    data,\n    series,\n    withGradient,\n    dataKey,\n    withXAxis: withXAxisProp,\n    withYAxis: withYAxisProp,\n    curveType,\n    gridProps,\n    withDots,\n    tickLine,\n    strokeDasharray,\n    gridAxis,\n    unit,\n    yAxisProps,\n    xAxisProps,\n    dotProps,\n    activeDotProps,\n    strokeWidth,\n    tooltipAnimationDuration,\n    type,\n    legendProps,\n    tooltipProps,\n    withLegend,\n    withTooltip,\n    areaChartProps,\n    fillOpacity,\n    splitColors,\n    splitOffset,\n    connectNulls,\n    onMouseLeave,\n    orientation,\n    referenceLines,\n    referenceAreas,\n    referenceDots,\n    dir,\n    valueFormatter,\n    children,\n    areaProps,\n    xAxisLabel,\n    yAxisLabel,\n    withRightYAxis,\n    rightYAxisLabel,\n    rightYAxisProps,\n    withPointLabels,\n    gridColor,\n    textColor,\n    attributes,\n    accessibilityLayer,\n    withBrush,\n    brushProps,\n    ...others\n  } = props;\n\n  const theme = useMantineTheme();\n  const baseId = useId();\n  const splitId = `${baseId}-split`;\n  const withXTickLine = gridAxis !== 'none' && (tickLine === 'x' || tickLine === 'xy');\n  const withYTickLine = gridAxis !== 'none' && (tickLine === 'y' || tickLine === 'xy');\n  const isAnimationActive = (tooltipAnimationDuration || 0) > 0;\n  const _withGradient = typeof withGradient === 'boolean' ? withGradient : type === 'default';\n  const stacked = type === 'stacked' || type === 'percent' || type === 'stream';\n  const withXAxis = withXAxisProp ?? !(type === 'stream' && orientation === 'vertical');\n  const withYAxis = withYAxisProp ?? !(type === 'stream' && orientation === 'horizontal');\n  const [highlightedArea, setHighlightedArea] = useState<string | number | null>(null);\n  const shouldHighlight = highlightedArea !== null;\n  const handleMouseLeave = (event: React.MouseEvent<HTMLDivElement>) => {\n    setHighlightedArea(null);\n    onMouseLeave?.(event);\n  };\n\n  const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<AreaChartFactory>({\n    classNames,\n    styles,\n    props,\n  });\n\n  const getStyles = useStyles<AreaChartFactory>({\n    name: 'AreaChart',\n    classes: classes as any,\n    props,\n    className,\n    style,\n    classNames,\n    styles,\n    unstyled,\n    attributes,\n    vars,\n    varsResolver,\n  });\n\n  const dotsAreas = series.map((item) => {\n    const color = getThemeColor(item.color, theme);\n    const dimmed = shouldHighlight && highlightedArea !== item.name;\n    return (\n      <Area\n        {...getStyles('area')}\n        activeDot={{ fill: theme.white, stroke: color, strokeWidth: 2, r: 4, ...activeDotProps }}\n        dot={{ fill: color, fillOpacity: dimmed ? 0 : 1, strokeWidth: 2, r: 4, ...dotProps }}\n        key={item.name}\n        name={item.name}\n        type={curveType}\n        dataKey={item.name}\n        fill=\"none\"\n        strokeWidth={strokeWidth}\n        stroke=\"none\"\n        isAnimationActive={false}\n        connectNulls={connectNulls}\n        stackId={stacked ? 'stack-dots' : undefined}\n        yAxisId={item.yAxisId || undefined}\n        {...(typeof areaProps === 'function' ? areaProps(item) : areaProps)}\n      />\n    );\n  });\n\n  const areas = series.map((item) => {\n    const id = `${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g, '')}`;\n    const color = getThemeColor(item.color, theme);\n    const dimmed = shouldHighlight && highlightedArea !== item.name;\n\n    return (\n      <Fragment key={item.name}>\n        <defs>\n          <AreaGradient\n            color={color}\n            withGradient={_withGradient}\n            id={id}\n            fillOpacity={fillOpacity}\n          />\n        </defs>\n        <Area\n          {...getStyles('area')}\n          activeDot={false}\n          dot={false}\n          name={item.name}\n          type={item.curveType ?? curveType}\n          dataKey={item.name}\n          fill={type === 'split' ? `url(#${splitId})` : `url(#${id})`}\n          strokeWidth={strokeWidth}\n          stroke={color}\n          isAnimationActive={false}\n          connectNulls={connectNulls}\n          stackId={stacked ? 'stack' : undefined}\n          fillOpacity={dimmed ? 0 : 1}\n          strokeOpacity={dimmed ? 0.5 : 1}\n          strokeDasharray={item.strokeDasharray}\n          yAxisId={item.yAxisId || undefined}\n          label={withPointLabels ? <PointLabel valueFormatter={valueFormatter} /> : undefined}\n          {...(typeof areaProps === 'function' ? areaProps(item) : areaProps)}\n        />\n      </Fragment>\n    );\n  });\n\n  const referenceLinesItems = referenceLines?.map(\n    ({ color: lineColor, labelPosition, ...line }, index) => {\n      const color = getThemeColor(lineColor, theme);\n      return (\n        <ReferenceLine\n          key={index}\n          stroke={lineColor ? color : 'var(--chart-grid-color)'}\n          strokeWidth={1}\n          yAxisId={line.yAxisId || undefined}\n          {...line}\n          label={{\n            fill: lineColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'insideBottomLeft',\n            ...(typeof line.label === 'object' ? line.label : { value: line.label }),\n          }}\n          {...getStyles('referenceLine')}\n        />\n      );\n    }\n  );\n\n  const referenceAreasItems = referenceAreas?.map(\n    ({ color: areaColor, labelPosition, ...area }, index) => {\n      const color = getThemeColor(areaColor, theme);\n      return (\n        <ReferenceArea\n          key={index}\n          fill={areaColor ? color : 'var(--chart-grid-color)'}\n          fillOpacity={0.2}\n          stroke={areaColor ? color : 'var(--chart-grid-color)'}\n          strokeOpacity={0.6}\n          yAxisId={area.yAxisId || undefined}\n          {...area}\n          label={{\n            fill: areaColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'insideTop',\n            ...(typeof area.label === 'object' ? area.label : { value: area.label }),\n          }}\n          {...getStyles('referenceArea')}\n        />\n      );\n    }\n  );\n\n  const referenceDotsItems = referenceDots?.map(\n    ({ color: dotColor, labelPosition, ...dot }, index) => {\n      const color = getThemeColor(dotColor, theme);\n      return (\n        <ReferenceDot\n          key={index}\n          r={5}\n          fill={dotColor ? color : 'var(--chart-grid-color)'}\n          stroke=\"var(--mantine-color-body)\"\n          strokeWidth={2}\n          yAxisId={dot.yAxisId || undefined}\n          {...dot}\n          label={{\n            fill: dotColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'top',\n            ...(typeof dot.label === 'object' ? dot.label : { value: dot.label }),\n          }}\n          {...getStyles('referenceDot')}\n        />\n      );\n    }\n  );\n\n  const tickFormatter = type === 'percent' ? valueToPercent : valueFormatter;\n\n  const sharedYAxisProps = {\n    axisLine: false,\n    ...(orientation === 'vertical'\n      ? { dataKey, type: 'category' as const }\n      : { type: 'number' as const }),\n    tickLine: withYTickLine ? { stroke: 'currentColor' } : false,\n    allowDecimals: true,\n    unit,\n    tickFormatter: orientation === 'vertical' ? undefined : tickFormatter,\n    ...getStyles('axis'),\n  };\n\n  return (\n    <Box {...getStyles('root')} onMouseLeave={handleMouseLeave} dir={dir || 'ltr'} {...others}>\n      <ResponsiveContainer {...getStyles('container')}>\n        <ReChartsAreaChart\n          data={data}\n          stackOffset={type === 'percent' ? 'expand' : type === 'stream' ? 'wiggle' : undefined}\n          layout={orientation}\n          margin={{\n            bottom: xAxisLabel ? 30 : undefined,\n            left: yAxisLabel ? 10 : undefined,\n            right: yAxisLabel ? 5 : undefined,\n          }}\n          accessibilityLayer={accessibilityLayer}\n          {...areaChartProps}\n        >\n          {(areaChartProps?.accessibilityLayer ?? accessibilityLayer) && (\n            <ChartAnnouncer series={series} unit={unit} valueFormatter={valueFormatter} />\n          )}\n          {referenceAreasItems}\n          {withLegend && (\n            <Legend\n              verticalAlign=\"top\"\n              content={(payload) => (\n                <ChartLegend\n                  payload={payload.payload}\n                  onHighlight={setHighlightedArea}\n                  legendPosition={getLegendPosition(legendProps, 'top')}\n                  classNames={resolvedClassNames}\n                  styles={resolvedStyles}\n                  series={series}\n                  attributes={attributes}\n                />\n              )}\n              {...legendProps}\n            />\n          )}\n\n          <CartesianGrid\n            strokeDasharray={strokeDasharray as string}\n            vertical={gridAxis === 'y' || gridAxis === 'xy'}\n            horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n            {...getStyles('grid')}\n            {...gridProps}\n          />\n\n          <XAxis\n            hide={!withXAxis}\n            {...(orientation === 'vertical' ? { type: 'number' } : { dataKey })}\n            tick={{ transform: 'translate(0, 10)', fontSize: 12, fill: 'currentColor' }}\n            stroke=\"\"\n            interval=\"preserveStartEnd\"\n            tickLine={withXTickLine ? { stroke: 'currentColor' } : false}\n            minTickGap={5}\n            tickFormatter={orientation === 'vertical' ? tickFormatter : undefined}\n            {...getStyles('axis')}\n            {...xAxisProps}\n          >\n            {xAxisLabel && (\n              <Label position=\"insideBottom\" offset={-20} fontSize={12} {...getStyles('axisLabel')}>\n                {xAxisLabel}\n              </Label>\n            )}\n            {xAxisProps?.children}\n          </XAxis>\n\n          <YAxis\n            orientation=\"left\"\n            tick={{ transform: 'translate(-10, 0)', fontSize: 12, fill: 'currentColor' }}\n            hide={!withYAxis}\n            {...sharedYAxisProps}\n            {...yAxisProps}\n          >\n            {yAxisLabel && (\n              <Label\n                position=\"insideLeft\"\n                angle={-90}\n                textAnchor=\"middle\"\n                fontSize={12}\n                offset={-5}\n                {...getStyles('axisLabel')}\n              >\n                {yAxisLabel}\n              </Label>\n            )}\n            {yAxisProps?.children}\n          </YAxis>\n\n          <YAxis\n            yAxisId=\"right\"\n            orientation=\"right\"\n            tick={{ transform: 'translate(10, 0)', fontSize: 12, fill: 'currentColor' }}\n            hide={!withRightYAxis}\n            {...sharedYAxisProps}\n            {...rightYAxisProps}\n          >\n            {rightYAxisLabel && (\n              <Label\n                position=\"insideRight\"\n                angle={90}\n                textAnchor=\"middle\"\n                fontSize={12}\n                offset={-5}\n                {...getStyles('axisLabel')}\n              >\n                {rightYAxisLabel}\n              </Label>\n            )}\n            {rightYAxisProps?.children}\n          </YAxis>\n\n          {withTooltip && (\n            <Tooltip\n              animationDuration={tooltipAnimationDuration}\n              isAnimationActive={isAnimationActive}\n              position={orientation === 'vertical' ? {} : { y: 0 }}\n              cursor={{\n                stroke: 'var(--chart-grid-color)',\n                strokeWidth: 1,\n                strokeDasharray,\n              }}\n              content={({ label, payload, labelFormatter }) => (\n                <ChartTooltip\n                  label={labelFormatter && payload ? labelFormatter(label, payload) : label}\n                  payload={payload}\n                  unit={unit}\n                  classNames={resolvedClassNames}\n                  styles={resolvedStyles}\n                  series={series}\n                  valueFormatter={valueFormatter}\n                  attributes={attributes}\n                />\n              )}\n              {...tooltipProps}\n            />\n          )}\n\n          {type === 'split' && (\n            <defs>\n              <AreaSplit\n                colors={splitColors}\n                id={splitId}\n                offset={splitOffset ?? getDefaultSplitOffset({ data, series })}\n                fillOpacity={fillOpacity}\n              />\n            </defs>\n          )}\n\n          {areas}\n          {withDots && dotsAreas}\n          {referenceLinesItems}\n          {referenceDotsItems}\n          {withBrush && (\n            <ChartBrush\n              dataKey={dataKey}\n              classNames={resolvedClassNames}\n              styles={resolvedStyles}\n              {...brushProps}\n            />\n          )}\n          {children}\n        </ReChartsAreaChart>\n      </ResponsiveContainer>\n    </Box>\n  );\n});\n\nAreaChart.classes = classes;\nAreaChart.varsResolver = varsResolver;\nAreaChart.displayName = '@mantine/charts/AreaChart';\n\nexport namespace AreaChart {\n  export type Props = AreaChartProps;\n  export type StylesNames = AreaChartStylesNames;\n  export type Factory = AreaChartFactory;\n  export type Type = AreaChartType;\n  export type Series = AreaChartSeries;\n  export type CurveType = AreaChartCurveType;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgDA,SAAS,eAAe,OAAe;CACrC,OAAO,IAAI,QAAQ,IAAA,CAAK,QAAQ,CAAC,EAAE;AACrC;AAmGA,MAAM,eAAe;CACnB,UAAU;CACV,aAAa;CACb,cAAc;CACd,aAAa;CACb,0BAA0B;CAC1B,aAAa;CACb,UAAU;CACV,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,MAAM;CACN,aAAa,CAAC,WAAW,OAAO;CAChC,aAAa;CACb,oBAAoB;AACtB;AAEA,MAAM,gBAAA,GAAeA,cAAAA,mBAAAA,EAAsC,OAAO,EAAE,WAAW,iBAAiB,EAC9F,MAAM;CACJ,sBAAsB,aAAA,GAAYC,cAAAA,cAAAA,CAAc,WAAW,KAAK,IAAI,KAAA;CACpE,sBAAsB,aAAA,GAAYA,cAAAA,cAAAA,CAAc,WAAW,KAAK,IAAI,KAAA;AACtE,EACF,EAAE;AAEF,MAAa,aAAA,GAAYC,cAAAA,QAAAA,EAA2B,WAAW;CAC7D,MAAM,SAAA,GAAQC,cAAAA,SAAAA,CAAS,aAAa,cAAc,MAAM;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,QACA,cACA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