@ssa-ui-kit/core 1.0.10 → 1.0.11

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.
Files changed (28) hide show
  1. package/dist/components/PieChart/PieChart.d.ts +1 -1
  2. package/dist/components/PieChart/PieChartLegend.d.ts +1 -1
  3. package/dist/components/PieChart/PieChartLegendMarker.d.ts +2 -0
  4. package/dist/components/PieChart/types.d.ts +2 -1
  5. package/dist/components/SegmentedPieChart/SegmentedPieChart.d.ts +2 -0
  6. package/dist/components/SegmentedPieChart/colorPalettes.d.ts +2 -0
  7. package/dist/components/SegmentedPieChart/index.d.ts +1 -0
  8. package/dist/components/SegmentedPieChart/stories/fixtures.d.ts +3 -0
  9. package/dist/components/SegmentedPieChart/types.d.ts +37 -0
  10. package/dist/components/index.d.ts +1 -0
  11. package/dist/index.js +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/components/LinksTabBar/LinksTabBar.spec.tsx +0 -1
  15. package/src/components/PieChart/PieChart.tsx +1 -3
  16. package/src/components/PieChart/PieChartBases.tsx +1 -0
  17. package/src/components/PieChart/PieChartLegend.tsx +7 -1
  18. package/src/components/PieChart/PieChartLegendMarker.tsx +3 -1
  19. package/src/components/PieChart/types.ts +2 -1
  20. package/src/components/SegmentedPieChart/SegmentedPieChart.spec.tsx +29 -0
  21. package/src/components/SegmentedPieChart/SegmentedPieChart.tsx +154 -0
  22. package/src/components/SegmentedPieChart/colorPalettes.ts +13 -0
  23. package/src/components/SegmentedPieChart/index.ts +1 -0
  24. package/src/components/SegmentedPieChart/stories/SegmentedPieChart.stories.tsx +63 -0
  25. package/src/components/SegmentedPieChart/stories/fixtures.ts +147 -0
  26. package/src/components/SegmentedPieChart/types.ts +40 -0
  27. package/src/components/index.ts +1 -0
  28. package/tsbuildcache +1 -1
@@ -1,2 +1,2 @@
1
1
  import { PieChartProps } from './types';
2
- export declare const PieChart: ({ data, as, className, title, children, ...chartProps }: PieChartProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
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
  }, {}, {}>;
@@ -14,7 +14,8 @@ export type PieChartLegendItem = {
14
14
  };
15
15
  export interface PieChartLegendProps {
16
16
  data: Array<PieChartLegendItem>;
17
- colors: Array<keyof MainColors>;
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, }: SegmentedPieChartProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const defaultLegendBackgrounds: string[];
2
+ export declare const defaultPieChartColors: string[][];
@@ -0,0 +1 @@
1
+ export * from './SegmentedPieChart';
@@ -0,0 +1,3 @@
1
+ import { BalanceData } from '../types';
2
+ export declare const balanceData: BalanceData;
3
+ export declare const balanceMissedPartsData: BalanceData;
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { CommonProps } from '../../types/emotion';
3
+ import { MayHaveLabel } from '@nivo/pie';
4
+ import { PieChartLegend, PieChartProps } from '../index';
5
+ type BalanceDataPartsItem = {
6
+ label: string;
7
+ percentage: number;
8
+ value: number;
9
+ };
10
+ type BalanceDataItem = {
11
+ id: number;
12
+ value: number;
13
+ label: string;
14
+ percentage: number;
15
+ parts?: BalanceDataPartsItem[];
16
+ };
17
+ export type BalanceData = Array<BalanceDataItem>;
18
+ export interface SegmentedPieChartProps extends CommonProps {
19
+ data: BalanceData;
20
+ pieChartProps?: Partial<PieChartProps>;
21
+ pieChartLegendProps?: Partial<React.ComponentProps<typeof PieChartLegend>>;
22
+ legendBackgrounds?: string[];
23
+ pieChartColors?: string[][];
24
+ currency?: string;
25
+ otherLabel?: string;
26
+ }
27
+ export interface BalanceDataForGraph extends MayHaveLabel {
28
+ mainLabel: string;
29
+ mainPercentage: number;
30
+ partLabel?: string;
31
+ partPercentage?: number;
32
+ id: number | string;
33
+ mainId: number;
34
+ value: number | string;
35
+ color: string;
36
+ }
37
+ export {};
@@ -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';