@foodpilot/foods 2.4.3 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,5 +13,8 @@ export type ChartLegendProps = {
13
13
  children?: ReactNode;
14
14
  chartRef?: React.RefObject<HTMLElement>;
15
15
  isLoading?: boolean;
16
+ maxScore?: number | number[];
17
+ separator?: string;
18
+ valuesFormatterFn?: (value: number, precision?: number) => string;
16
19
  };
17
20
  export declare const Legend: (props: ChartLegendProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -13,6 +13,9 @@ type ChartLegendVariantProps = {
13
13
  chartRef?: React.RefObject<HTMLElement>;
14
14
  hidePercentage?: boolean;
15
15
  isLoading?: boolean;
16
+ maxScore?: number | number[];
17
+ separator?: string;
18
+ valuesFormatterFn?: (value: number, precision?: number) => string;
16
19
  };
17
20
  export declare const LegendBottom: (props: ChartLegendVariantProps) => import("react/jsx-runtime").JSX.Element;
18
21
  export {};
@@ -0,0 +1,7 @@
1
+ import { ChartLegend } from './types';
2
+ export type LegendBottomSkeletonProps = {
3
+ count: number;
4
+ hidePercentage?: boolean;
5
+ legend?: ChartLegend;
6
+ };
7
+ export declare const LegendBottomSkeleton: ({ count, hidePercentage, legend }: LegendBottomSkeletonProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,6 +13,9 @@ type ChartLegendVariantProps = {
13
13
  chartRef?: React.RefObject<HTMLElement>;
14
14
  hidePercentage?: boolean;
15
15
  isLoading?: boolean;
16
+ maxScore?: number | number[];
17
+ separator?: string;
18
+ valuesFormatterFn?: (value: number, precision?: number) => string;
16
19
  };
17
20
  export declare const LegendRight: (props: ChartLegendVariantProps) => import("react/jsx-runtime").JSX.Element;
18
21
  export {};
@@ -0,0 +1,8 @@
1
+ export type LegendRightSkeletonProps = {
2
+ count: number;
3
+ hidePercentage?: boolean;
4
+ twoColumns?: boolean;
5
+ leftCount?: number;
6
+ rightCount?: number;
7
+ };
8
+ export declare const LegendRightSkeleton: ({ count, hidePercentage, twoColumns, leftCount, rightCount, }: LegendRightSkeletonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { TypographyProps } from '@mui/material';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { ReactNode } from 'react';
4
+ import { Property } from 'csstype';
5
+ export type LegendRowProps = {
6
+ index: number;
7
+ label: string;
8
+ colors: Property.Color[];
9
+ icons: ReactNode[];
10
+ values: number[];
11
+ hovered: boolean;
12
+ onMouseEnter: (e: React.MouseEvent<HTMLElement>) => void;
13
+ onMouseLeave: () => void;
14
+ onClick?: () => void;
15
+ children?: ReactNode;
16
+ labelVariant?: TypographyProps["variant"];
17
+ labelSx?: SxProps<Theme>;
18
+ containerSx?: SxProps<Theme>;
19
+ showMarker?: boolean;
20
+ };
21
+ export declare const LegendRow: (props: LegendRowProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ import { ReactNode } from 'react';
3
+ export type LegendValueBadgeProps = {
4
+ children: ReactNode;
5
+ sx?: SxProps<Theme>;
6
+ };
7
+ export declare const LegendValueBadge: ({ children, sx }: LegendValueBadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,4 +2,5 @@ export type ChartLegend = {
2
2
  position: "bottom" | "top" | "left" | "right";
3
3
  actions?: Array<(() => void) | undefined>;
4
4
  seeMore?: string;
5
+ mode?: "default" | "raw";
5
6
  };
@@ -0,0 +1,12 @@
1
+ export type UseLegendHoverHandlersOptions = {
2
+ onLegendHover?: (index: number | null, event?: React.MouseEvent<HTMLElement>) => void;
3
+ chartRef?: React.RefObject<HTMLElement>;
4
+ move?: {
5
+ xFactor?: number;
6
+ yFactor?: number;
7
+ };
8
+ };
9
+ export declare const useLegendHoverHandlers: (options: UseLegendHoverHandlersOptions) => {
10
+ handleMouseEnter: (index: number, defined: boolean, event: React.MouseEvent<HTMLElement>) => void;
11
+ handleMouseLeave: () => void;
12
+ };
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { TypographyProps } from '@mui/material';
3
3
  import { Property } from 'csstype';
4
4
  import { ChartLegend } from '../Legend';
5
- export type ChartType = "donut" | "bar" | "line" | "pie" | "radar" | "table";
5
+ export type ChartType = "donut" | "bar" | "line" | "pie" | "radar" | "table" | "raw";
6
6
  export type PolymorphicChartProps = {
7
7
  chartType: ChartType;
8
8
  values?: number[];
@@ -26,5 +26,7 @@ export type PolymorphicChartProps = {
26
26
  showTooltip?: boolean;
27
27
  width?: string;
28
28
  height?: number;
29
+ maxScore?: number | number[];
30
+ separator?: string;
29
31
  };
30
32
  export declare const PolymorphicChart: (props: PolymorphicChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -25,6 +25,8 @@ type PolymorphicChartRendererProps = {
25
25
  onMouseEnter: (event: RechartsMouseEventHandler, index: number) => void;
26
26
  onMouseLeave: () => void;
27
27
  onLegendAction?: (index: number) => void;
28
+ maxScore?: number | number[];
29
+ separator?: string;
28
30
  };
29
31
  export declare const PolymorphicChartRenderer: (props: PolymorphicChartRendererProps) => import("react/jsx-runtime").JSX.Element;
30
32
  export {};
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { DoughnutChartData } from '../../DoughnutChart/utils';
3
+ export type PolymorphicRawChartProps = {
4
+ data: DoughnutChartData[];
5
+ valuesFormatterFn?: (value: number, precision?: number) => string;
6
+ icons?: ReactNode[];
7
+ isLoading?: boolean;
8
+ onLegendAction?: (index: number) => void;
9
+ maxScore?: number | number[];
10
+ separator?: string;
11
+ };
12
+ export declare const PolymorphicRawChart: (props: PolymorphicRawChartProps) => import("react/jsx-runtime").JSX.Element;