@ssa-ui-kit/core 1.0.9 → 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.
- 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 +2 -1
- package/dist/components/SegmentedPieChart/SegmentedPieChart.d.ts +2 -0
- package/dist/components/SegmentedPieChart/colorPalettes.d.ts +2 -0
- package/dist/components/SegmentedPieChart/index.d.ts +1 -0
- package/dist/components/SegmentedPieChart/stories/fixtures.d.ts +3 -0
- package/dist/components/SegmentedPieChart/types.d.ts +37 -0
- package/dist/components/Typeahead/Typeahead.context.d.ts +0 -1
- package/dist/components/Typeahead/Typeahead.d.ts +1 -1
- package/dist/components/Typeahead/types.d.ts +2 -2
- package/dist/components/Typeahead/useTypeahead.d.ts +1 -2
- 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.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 +2 -1
- package/src/components/SegmentedPieChart/SegmentedPieChart.spec.tsx +29 -0
- package/src/components/SegmentedPieChart/SegmentedPieChart.tsx +154 -0
- package/src/components/SegmentedPieChart/colorPalettes.ts +13 -0
- package/src/components/SegmentedPieChart/index.ts +1 -0
- package/src/components/SegmentedPieChart/stories/SegmentedPieChart.stories.tsx +63 -0
- package/src/components/SegmentedPieChart/stories/fixtures.ts +147 -0
- package/src/components/SegmentedPieChart/types.ts +40 -0
- package/src/components/Typeahead/Typeahead.context.ts +0 -3
- package/src/components/Typeahead/Typeahead.stories.tsx +4 -4
- package/src/components/Typeahead/Typeahead.tsx +2 -2
- package/src/components/Typeahead/components/MultipleTrigger.tsx +0 -1
- package/src/components/Typeahead/components/SingleTrigger.tsx +0 -1
- package/src/components/Typeahead/types.ts +2 -2
- package/src/components/Typeahead/useTypeahead.tsx +10 -2
- 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
|
}, {}, {}>;
|
|
@@ -14,7 +14,8 @@ export type PieChartLegendItem = {
|
|
|
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, }: SegmentedPieChartProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SegmentedPieChart';
|
|
@@ -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 {};
|
|
@@ -32,7 +32,6 @@ export declare const TypeaheadContext: React.Context<{
|
|
|
32
32
|
handleInputChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
33
33
|
handleInputClick: React.MouseEventHandler<HTMLInputElement>;
|
|
34
34
|
handleInputKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
35
|
-
handleInputBlur: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
36
35
|
handleSelectedClick: React.MouseEventHandler<HTMLDivElement>;
|
|
37
36
|
handleRemoveSelectedClick: (selectedItem: string | number) => React.MouseEventHandler<HTMLButtonElement>;
|
|
38
37
|
}>;
|
|
@@ -8,4 +8,4 @@ import { TypeaheadProps } from './types';
|
|
|
8
8
|
* Aria attributes are set according to
|
|
9
9
|
* https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
10
10
|
**/
|
|
11
|
-
export declare const Typeahead: ({ name, label, initialSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, wrapperClassName, width, setValue, register, onChange,
|
|
11
|
+
export declare const Typeahead: ({ name, label, initialSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, wrapperClassName, width, setValue, register, onChange, onEmptyChange, renderOption, }: TypeaheadProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -27,14 +27,14 @@ export interface TypeaheadProps {
|
|
|
27
27
|
setValue?: UseFormSetValue<FieldValues>;
|
|
28
28
|
register?: UseFormReturn['register'];
|
|
29
29
|
onChange?: (selectedItem: TypeaheadValue, isSelected: boolean) => void;
|
|
30
|
-
|
|
30
|
+
onEmptyChange?: (isEmpty?: boolean) => void;
|
|
31
31
|
renderOption?: (data: {
|
|
32
32
|
value: string | number;
|
|
33
33
|
input: string;
|
|
34
34
|
label: string;
|
|
35
35
|
}) => React.ReactNode;
|
|
36
36
|
}
|
|
37
|
-
export type UseTypeaheadProps = Pick<TypeaheadProps, 'initialSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | '
|
|
37
|
+
export type UseTypeaheadProps = Pick<TypeaheadProps, 'initialSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'register' | 'setValue' | 'validationSchema' | 'error' | 'success' | 'placeholder'>;
|
|
38
38
|
export interface TypeaheadItemsListProps extends CommonProps {
|
|
39
39
|
children?: React.ReactNode;
|
|
40
40
|
noItemsMessage?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { MouseEventHandler } from 'react';
|
|
2
2
|
import { UseTypeaheadProps } from './types';
|
|
3
|
-
export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, register, setValue, onChange,
|
|
3
|
+
export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, register, setValue, onChange, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
isDisabled: boolean | undefined;
|
|
6
6
|
optionsWithKey: Record<string | number, Record<string, string | number>>;
|
|
@@ -31,7 +31,6 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedI
|
|
|
31
31
|
handleInputChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
32
32
|
handleInputClick: React.MouseEventHandler<HTMLInputElement>;
|
|
33
33
|
handleInputKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
34
|
-
handleInputBlur: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
35
34
|
handleSelectedClick: React.MouseEventHandler<HTMLDivElement>;
|
|
36
35
|
handleRemoveSelectedClick: (selectedItem: number | string) => MouseEventHandler<HTMLButtonElement>;
|
|
37
36
|
};
|
|
@@ -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';
|