@ssa-ui-kit/core 1.0.10 → 1.0.12
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.
- package/dist/components/PieChart/PieChart.d.ts +1 -1
- package/dist/components/PieChart/PieChartLegend.d.ts +1 -1
- package/dist/components/PieChart/PieChartLegendMarker.d.ts +2 -0
- package/dist/components/PieChart/types.d.ts +5 -4
- package/dist/components/SegmentedPieChart/SegmentedPieChart.d.ts +2 -0
- package/dist/components/SegmentedPieChart/colorPalettes.d.ts +2 -0
- package/dist/components/SegmentedPieChart/components/ChartTitle.d.ts +4 -0
- package/dist/components/SegmentedPieChart/components/ChartTooltip.d.ts +5 -0
- package/dist/components/SegmentedPieChart/components/LegendItem.d.ts +2 -0
- package/dist/components/SegmentedPieChart/components/index.d.ts +3 -0
- package/dist/components/SegmentedPieChart/hooks/index.d.ts +1 -0
- package/dist/components/SegmentedPieChart/hooks/useData.d.ts +5 -0
- package/dist/components/SegmentedPieChart/index.d.ts +1 -0
- package/dist/components/SegmentedPieChart/stories/fixtures.d.ts +5 -0
- package/dist/components/SegmentedPieChart/types.d.ts +50 -0
- package/dist/components/SegmentedPieChart/utils.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LinksTabBar/LinksTabBar.spec.tsx +0 -1
- package/src/components/PieChart/PieChart.stories.tsx +2 -2
- package/src/components/PieChart/PieChart.tsx +1 -3
- package/src/components/PieChart/PieChartBases.tsx +1 -0
- package/src/components/PieChart/PieChartLegend.tsx +7 -1
- package/src/components/PieChart/PieChartLegendMarker.tsx +3 -1
- package/src/components/PieChart/types.ts +5 -4
- package/src/components/SegmentedPieChart/SegmentedPieChart.spec.tsx +31 -0
- package/src/components/SegmentedPieChart/SegmentedPieChart.tsx +89 -0
- package/src/components/SegmentedPieChart/colorPalettes.ts +13 -0
- package/src/components/SegmentedPieChart/components/ChartTitle.tsx +34 -0
- package/src/components/SegmentedPieChart/components/ChartTooltip.tsx +85 -0
- package/src/components/SegmentedPieChart/components/LegendItem.tsx +36 -0
- package/src/components/SegmentedPieChart/components/index.ts +3 -0
- package/src/components/SegmentedPieChart/hooks/index.ts +1 -0
- package/src/components/SegmentedPieChart/hooks/useData.ts +71 -0
- package/src/components/SegmentedPieChart/index.ts +1 -0
- package/src/components/SegmentedPieChart/stories/SegmentedPieChart.stories.tsx +100 -0
- package/src/components/SegmentedPieChart/stories/fixtures.ts +174 -0
- package/src/components/SegmentedPieChart/types.ts +61 -0
- package/src/components/SegmentedPieChart/utils.ts +2 -0
- package/src/components/index.ts +1 -0
- package/tsbuildcache +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PieChartProps } from './types';
|
|
2
|
-
export declare const PieChart: ({
|
|
2
|
+
export declare const PieChart: ({ as, className, title, children, ...chartProps }: PieChartProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PieChartLegendProps } from './types';
|
|
2
|
-
export declare const PieChartLegend: ({ data, colors, renderLabel, renderValue, markerStyles, currency, labelListStyles, valueListStyles, variant, }: PieChartLegendProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
2
|
+
export declare const PieChartLegend: ({ data, colors, backgroundColors, renderLabel, renderValue, markerStyles, currency, labelListStyles, valueListStyles, variant, }: PieChartLegendProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const PieChartLegendMarker: import("@emotion/styled").StyledComponent<import("../Badge/types").BadgeProps & import("react").RefAttributes<HTMLDivElement> & {
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
background?: string | undefined;
|
|
4
6
|
}, {}, {}>;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SerializedStyles } from '@emotion/react';
|
|
3
|
-
import { ResponsivePie } from '@nivo/pie';
|
|
3
|
+
import { ResponsivePie, MayHaveLabel } from '@nivo/pie';
|
|
4
4
|
import { CommonProps } from '../..';
|
|
5
5
|
export interface PieChartProps extends CommonProps, React.ComponentProps<typeof ResponsivePie> {
|
|
6
6
|
title?: React.ReactNode;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export interface PieChartLegendItem extends MayHaveLabel {
|
|
10
10
|
id: string | number;
|
|
11
11
|
value: string | number;
|
|
12
12
|
label: string;
|
|
13
13
|
[key: string | number | symbol]: unknown;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export interface PieChartLegendProps {
|
|
16
16
|
data: Array<PieChartLegendItem>;
|
|
17
|
-
colors
|
|
17
|
+
colors?: Array<keyof MainColors>;
|
|
18
|
+
backgroundColors?: Array<string>;
|
|
18
19
|
renderValue?: (item: PieChartLegendItem) => NonNullable<React.ReactNode>;
|
|
19
20
|
renderLabel?: (item: PieChartLegendItem) => NonNullable<React.ReactNode>;
|
|
20
21
|
className?: string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SegmentedPieChartProps } from './types';
|
|
2
|
+
export declare const SegmentedPieChart: ({ data, pieChartProps, pieChartLegendProps, legendBackgrounds, pieChartColors, currency, otherLabel, totalAmount, totalDimension, legendValueRoundingDigits, legendPercentageRoundingDigits, showDimensions, showPercentage, }: SegmentedPieChartProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MayHaveLabel, PieTooltipProps } from '@nivo/pie';
|
|
2
|
+
export declare const ChartTooltip: ({ point, legendPercentageRoundingDigits, }: {
|
|
3
|
+
point: PieTooltipProps<MayHaveLabel>;
|
|
4
|
+
legendPercentageRoundingDigits: number;
|
|
5
|
+
}) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { LegendItemProps } from '../types';
|
|
2
|
+
export declare const LegendItem: ({ label, legendLabel, percentage, legendValue, legendValueRoundingDigits, legendPercentageRoundingDigits, showDimensions, showPercentage, otherLabel, currency, }: LegendItemProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useData';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BalanceDataForGraph, SegmentedPieChartProps } from '../types';
|
|
2
|
+
export declare const useData: ({ data, pieChartColors, legendValueRoundingDigits, }: Pick<SegmentedPieChartProps, 'data' | 'pieChartColors' | 'legendValueRoundingDigits'>) => {
|
|
3
|
+
balanceDataForTheGraph: BalanceDataForGraph[];
|
|
4
|
+
balanceDataForTheLegend: BalanceDataForGraph[];
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SegmentedPieChart';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SegmentedDataSet } from '../types';
|
|
2
|
+
export declare const balanceData: SegmentedDataSet;
|
|
3
|
+
export declare const balanceTotalAmount: number;
|
|
4
|
+
export declare const balanceMissedPartsData: SegmentedDataSet;
|
|
5
|
+
export declare const balanceMissedPartsDataTotalAmount: number;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from '../../types/emotion';
|
|
3
|
+
import { PieChartLegend, PieChartLegendItem, PieChartProps } from '../index';
|
|
4
|
+
type SegmentedDataMainInfo = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
legendValue: number;
|
|
8
|
+
};
|
|
9
|
+
export interface SegmentedDataItem extends PieChartLegendItem {
|
|
10
|
+
legendValue: number;
|
|
11
|
+
legendLabel?: string;
|
|
12
|
+
parts?: SegmentedDataMainInfo[];
|
|
13
|
+
}
|
|
14
|
+
export type SegmentedDataSet = Array<SegmentedDataItem>;
|
|
15
|
+
export interface SegmentedPieChartProps extends CommonProps {
|
|
16
|
+
data: SegmentedDataSet;
|
|
17
|
+
totalAmount: number;
|
|
18
|
+
totalDimension: string;
|
|
19
|
+
pieChartProps?: Partial<PieChartProps>;
|
|
20
|
+
pieChartLegendProps?: Partial<React.ComponentProps<typeof PieChartLegend>>;
|
|
21
|
+
legendBackgrounds?: string[];
|
|
22
|
+
pieChartColors?: string[][];
|
|
23
|
+
currency?: string;
|
|
24
|
+
otherLabel?: string;
|
|
25
|
+
legendValueRoundingDigits?: number;
|
|
26
|
+
legendPercentageRoundingDigits?: number;
|
|
27
|
+
showDimensions?: boolean;
|
|
28
|
+
showPercentage?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface BalanceDataForGraph extends PieChartLegendItem {
|
|
31
|
+
label: string;
|
|
32
|
+
legendLabel?: string;
|
|
33
|
+
legendValueRoundingDigits: number;
|
|
34
|
+
percentage: number;
|
|
35
|
+
partIndex?: number;
|
|
36
|
+
partLabel?: string;
|
|
37
|
+
partPercentage?: number;
|
|
38
|
+
id: number | string;
|
|
39
|
+
mainId: number;
|
|
40
|
+
value: number | string;
|
|
41
|
+
color: string;
|
|
42
|
+
}
|
|
43
|
+
export type LegendItemProps = {
|
|
44
|
+
label: string;
|
|
45
|
+
legendLabel?: string;
|
|
46
|
+
percentage?: number;
|
|
47
|
+
legendValue?: number;
|
|
48
|
+
legendValueRoundingDigits: number;
|
|
49
|
+
} & Pick<SegmentedPieChartProps, 'showDimensions' | 'legendPercentageRoundingDigits' | 'otherLabel' | 'currency' | 'showPercentage'>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRoundedNumber: (number: unknown, roundingDigits: number) => number;
|
|
@@ -97,6 +97,7 @@ export * from './SearchBox';
|
|
|
97
97
|
export * from './UserProfile';
|
|
98
98
|
export * from './AddNewAccountCard';
|
|
99
99
|
export * from './PieChart';
|
|
100
|
+
export * from './SegmentedPieChart';
|
|
100
101
|
export * from './CollapsibleNavBar';
|
|
101
102
|
export * from './Filters';
|
|
102
103
|
export * from './TableFilters';
|