@juspay/blend-design-system 0.0.14-beta → 0.0.14
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/Charts/ChartUtils.d.ts +4 -1
- package/dist/components/Charts/CustomTooltip.d.ts +1 -1
- package/dist/components/Charts/renderChart.d.ts +1 -1
- package/dist/components/Charts/types.d.ts +42 -4
- package/dist/components/Drawer/components/DrawerBase.d.ts +2 -0
- package/dist/components/MultiSelect/types.d.ts +11 -0
- package/dist/components/Select/SelectItem/SelectItem.d.ts +3 -0
- package/dist/components/Select/SelectItem/index.d.ts +5 -0
- package/dist/components/Select/SelectItem/types.d.ts +37 -0
- package/dist/components/Select/SelectItem/utils.d.ts +22 -0
- package/dist/components/Select/types.d.ts +11 -0
- package/dist/components/Sidebar/types.d.ts +1 -0
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +2 -1
- package/dist/components/SingleSelect/types.d.ts +11 -0
- package/dist/components/StatCard/StatCard.d.ts +1 -1
- package/dist/components/StatCard/types.d.ts +10 -0
- package/dist/main.js +31264 -30883
- package/package.json +1 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { NewNestedDataPoint, FlattenedDataPoint } from './types';
|
|
1
|
+
import { NewNestedDataPoint, FlattenedDataPoint, AxisType } from './types';
|
|
2
2
|
export declare function transformNestedData(data: NewNestedDataPoint[], selectedKeys?: string[]): FlattenedDataPoint[];
|
|
3
3
|
export declare function lightenHexColor(hex: string, amount?: number): string;
|
|
4
4
|
export declare const formatNumber: (value: number | string) => string;
|
|
5
5
|
export declare const capitaliseCamelCase: (text: string) => string;
|
|
6
|
+
export declare const createSmartDateTimeFormatter: () => ((value: string | number) => string);
|
|
7
|
+
export declare const getAxisFormatterWithConfig: (axisType: AxisType, dateOnly?: boolean, smart?: boolean) => ((value: string | number) => string);
|
|
8
|
+
export declare const getAxisFormatter: (axisType: AxisType) => ((value: string | number) => string);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CustomTooltipProps } from './types';
|
|
2
|
-
export declare const CustomTooltip: ({ active, payload, label, hoveredKey, originalData, setHoveredKey, chartType, selectedKeys, }: CustomTooltipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare const CustomTooltip: ({ active, payload, label, hoveredKey, originalData, setHoveredKey, chartType, selectedKeys, xAxis, yAxis, }: CustomTooltipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RenderChartProps } from './types';
|
|
2
|
-
export declare const renderChart: ({ flattenedData, chartType, hoveredKey, lineKeys, colors, setHoveredKey,
|
|
2
|
+
export declare const renderChart: ({ flattenedData, chartType, hoveredKey, lineKeys, colors, setHoveredKey, data: originalData, selectedKeys, isSmallScreen, barsize, xAxis, yAxis, }: RenderChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,6 +24,40 @@ export declare enum LegendsChangeType {
|
|
|
24
24
|
INCREASE = "increase",
|
|
25
25
|
DECREASE = "decrease"
|
|
26
26
|
}
|
|
27
|
+
export declare enum AxisIntervalType {
|
|
28
|
+
PRESERVE_START = "preserveStart",
|
|
29
|
+
PRESERVE_END = "preserveEnd",
|
|
30
|
+
PRESERVE_START_END = "preserveStartEnd"
|
|
31
|
+
}
|
|
32
|
+
export declare enum AxisType {
|
|
33
|
+
DATE_TIME = "dateTime",
|
|
34
|
+
CURRENCY = "currency",
|
|
35
|
+
PERCENTAGE = "percentage",
|
|
36
|
+
NUMBER = "number"
|
|
37
|
+
}
|
|
38
|
+
export type TickProps = {
|
|
39
|
+
x?: number;
|
|
40
|
+
y?: number;
|
|
41
|
+
payload?: {
|
|
42
|
+
value: string | number;
|
|
43
|
+
index?: number;
|
|
44
|
+
coordinate?: number;
|
|
45
|
+
};
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
export type AxisConfig = {
|
|
49
|
+
label?: string;
|
|
50
|
+
showLabel?: boolean;
|
|
51
|
+
interval?: number | AxisIntervalType;
|
|
52
|
+
show?: boolean;
|
|
53
|
+
type?: AxisType;
|
|
54
|
+
tickFormatter?: (value: string | number) => string;
|
|
55
|
+
customTick?: React.ComponentType<TickProps>;
|
|
56
|
+
dateOnly?: boolean;
|
|
57
|
+
smart?: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type XAxisConfig = AxisConfig;
|
|
60
|
+
export type YAxisConfig = AxisConfig;
|
|
27
61
|
export type NewNestedDataPoint = {
|
|
28
62
|
name: string;
|
|
29
63
|
data: {
|
|
@@ -42,18 +76,17 @@ export type RenderChartProps = {
|
|
|
42
76
|
lineKeys: string[];
|
|
43
77
|
colors: string[];
|
|
44
78
|
setHoveredKey: (key: string | null) => void;
|
|
45
|
-
xAxisLabel?: string;
|
|
46
|
-
yAxisLabel?: string;
|
|
47
79
|
data: NewNestedDataPoint[];
|
|
48
80
|
selectedKeys: string[];
|
|
49
81
|
isSmallScreen?: boolean;
|
|
82
|
+
barsize?: number;
|
|
83
|
+
xAxis?: XAxisConfig;
|
|
84
|
+
yAxis?: YAxisConfig;
|
|
50
85
|
};
|
|
51
86
|
export type ChartsProps = {
|
|
52
87
|
chartType?: ChartType;
|
|
53
88
|
data: NewNestedDataPoint[];
|
|
54
89
|
colors?: string[];
|
|
55
|
-
xAxisLabel?: string;
|
|
56
|
-
yAxisLabel?: string;
|
|
57
90
|
slot1?: ReactNode;
|
|
58
91
|
slot2?: ReactNode;
|
|
59
92
|
slot3?: ReactNode;
|
|
@@ -61,6 +94,9 @@ export type ChartsProps = {
|
|
|
61
94
|
chartHeaderSlot: ReactNode;
|
|
62
95
|
stackedLegends?: boolean;
|
|
63
96
|
stackedLegendsData?: StackedLegendsDataPoint[];
|
|
97
|
+
barsize?: number;
|
|
98
|
+
xAxis?: XAxisConfig;
|
|
99
|
+
yAxis?: YAxisConfig;
|
|
64
100
|
};
|
|
65
101
|
export type FlattenedDataPoint = {
|
|
66
102
|
name: string;
|
|
@@ -99,4 +135,6 @@ export type CustomTooltipProps = TooltipProps<ValueType, NameType> & {
|
|
|
99
135
|
setHoveredKey: (key: string) => void;
|
|
100
136
|
chartType: ChartType;
|
|
101
137
|
selectedKeys: string[];
|
|
138
|
+
xAxis?: XAxisConfig;
|
|
139
|
+
yAxis?: YAxisConfig;
|
|
102
140
|
};
|
|
@@ -12,6 +12,8 @@ export declare const DrawerContent: React.ForwardRefExoticComponent<DrawerConten
|
|
|
12
12
|
handle?: React.ReactNode;
|
|
13
13
|
hasSnapPoints?: boolean;
|
|
14
14
|
contentDriven?: boolean;
|
|
15
|
+
width?: string | number;
|
|
16
|
+
maxWidth?: string | number;
|
|
15
17
|
mobileOffset?: {
|
|
16
18
|
top?: string;
|
|
17
19
|
bottom?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
1
2
|
export declare enum MultiSelectVariant {
|
|
2
3
|
CONTAINER = "container",
|
|
3
4
|
NO_CONTAINER = "no-container"
|
|
@@ -34,6 +35,16 @@ export type MultiSelectMenuItemType = {
|
|
|
34
35
|
disabled?: boolean;
|
|
35
36
|
onClick?: () => void;
|
|
36
37
|
subMenu?: MultiSelectMenuItemType[];
|
|
38
|
+
tooltip?: string | React.ReactNode;
|
|
39
|
+
tooltipProps?: {
|
|
40
|
+
side?: TooltipSide;
|
|
41
|
+
align?: TooltipAlign;
|
|
42
|
+
size?: TooltipSize;
|
|
43
|
+
showArrow?: boolean;
|
|
44
|
+
delayDuration?: number;
|
|
45
|
+
offset?: number;
|
|
46
|
+
};
|
|
47
|
+
disableTruncation?: boolean;
|
|
37
48
|
};
|
|
38
49
|
export type MultiSelectMenuGroupType = {
|
|
39
50
|
groupLabel?: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SelectItemProps } from './types';
|
|
2
|
+
declare const SelectItem: import('react').ForwardRefExoticComponent<SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export default SelectItem;
|
|
4
|
+
export { SelectItemType } from './types';
|
|
5
|
+
export type { SelectItemProps, BaseSelectItemType } from './types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../../Tooltip/types';
|
|
3
|
+
export declare enum SelectItemType {
|
|
4
|
+
SINGLE = "single",
|
|
5
|
+
MULTI = "multi"
|
|
6
|
+
}
|
|
7
|
+
export type BaseSelectItemType = {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
subLabel?: string;
|
|
12
|
+
slot1?: ReactNode;
|
|
13
|
+
slot2?: ReactNode;
|
|
14
|
+
slot3?: ReactNode;
|
|
15
|
+
slot4?: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
subMenu?: BaseSelectItemType[];
|
|
19
|
+
tooltip?: string | ReactNode;
|
|
20
|
+
tooltipProps?: {
|
|
21
|
+
side?: TooltipSide;
|
|
22
|
+
align?: TooltipAlign;
|
|
23
|
+
size?: TooltipSize;
|
|
24
|
+
showArrow?: boolean;
|
|
25
|
+
delayDuration?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
};
|
|
28
|
+
disableTruncation?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type SelectItemProps = {
|
|
31
|
+
item: BaseSelectItemType;
|
|
32
|
+
onSelect: (value: string) => void;
|
|
33
|
+
selected: string | string[];
|
|
34
|
+
type: SelectItemType;
|
|
35
|
+
showCheckmark?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { SelectItemType } from './types';
|
|
3
|
+
export declare const checkIfTruncated: (element: HTMLElement | null) => boolean;
|
|
4
|
+
export declare const useTruncationDetection: (ref: RefObject<HTMLElement>) => () => boolean;
|
|
5
|
+
export declare const isItemSelected: (itemValue: string, selected: string | string[], type: SelectItemType) => boolean;
|
|
6
|
+
export declare const getRightSlotConfig: (isSelected: boolean, type: SelectItemType, item: {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}) => {
|
|
9
|
+
type: "checkbox";
|
|
10
|
+
props: {
|
|
11
|
+
disabled: boolean | undefined;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
size?: undefined;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
type: "icon";
|
|
17
|
+
props: {
|
|
18
|
+
size: number;
|
|
19
|
+
disabled?: undefined;
|
|
20
|
+
checked?: undefined;
|
|
21
|
+
};
|
|
22
|
+
} | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
1
2
|
export declare enum SelectMenuAlignment {
|
|
2
3
|
START = "start",
|
|
3
4
|
CENTER = "center",
|
|
@@ -51,5 +52,15 @@ export type SelectMenuItemType = {
|
|
|
51
52
|
disabled?: boolean;
|
|
52
53
|
onClick?: () => void;
|
|
53
54
|
subMenu?: SelectMenuItemType[];
|
|
55
|
+
tooltip?: string | React.ReactNode;
|
|
56
|
+
tooltipProps?: {
|
|
57
|
+
side?: TooltipSide;
|
|
58
|
+
align?: TooltipAlign;
|
|
59
|
+
size?: TooltipSize;
|
|
60
|
+
showArrow?: boolean;
|
|
61
|
+
delayDuration?: number;
|
|
62
|
+
offset?: number;
|
|
63
|
+
};
|
|
64
|
+
disableTruncation?: boolean;
|
|
54
65
|
};
|
|
55
66
|
export declare const dummyMenuItemsLong: SelectMenuGroupType[];
|
|
@@ -9,6 +9,7 @@ type SingleSelectMenuProps = {
|
|
|
9
9
|
maxWidth?: number;
|
|
10
10
|
maxHeight?: number;
|
|
11
11
|
enableSearch?: boolean;
|
|
12
|
+
searchPlaceholder?: string;
|
|
12
13
|
disabled?: boolean;
|
|
13
14
|
alignment?: SelectMenuAlignment;
|
|
14
15
|
side?: SelectMenuSide;
|
|
@@ -17,5 +18,5 @@ type SingleSelectMenuProps = {
|
|
|
17
18
|
open: boolean;
|
|
18
19
|
onOpenChange: (open: boolean) => void;
|
|
19
20
|
};
|
|
20
|
-
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minWidth, maxWidth, maxHeight, enableSearch, disabled, alignment, side, sideOffset, alignOffset, open, onOpenChange, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minWidth, maxWidth, maxHeight, enableSearch, searchPlaceholder, disabled, alignment, side, sideOffset, alignOffset, open, onOpenChange, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export default SingleSelectMenu;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
1
2
|
export declare enum SelectMenuAlignment {
|
|
2
3
|
START = "start",
|
|
3
4
|
CENTER = "center",
|
|
@@ -51,6 +52,16 @@ export type SelectMenuItemType = {
|
|
|
51
52
|
disabled?: boolean;
|
|
52
53
|
onClick?: () => void;
|
|
53
54
|
subMenu?: SelectMenuItemType[];
|
|
55
|
+
tooltip?: string | React.ReactNode;
|
|
56
|
+
tooltipProps?: {
|
|
57
|
+
side?: TooltipSide;
|
|
58
|
+
align?: TooltipAlign;
|
|
59
|
+
size?: TooltipSize;
|
|
60
|
+
showArrow?: boolean;
|
|
61
|
+
delayDuration?: number;
|
|
62
|
+
offset?: number;
|
|
63
|
+
};
|
|
64
|
+
disableTruncation?: boolean;
|
|
54
65
|
};
|
|
55
66
|
export type SingleSelectProps = {
|
|
56
67
|
label?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StatCardProps } from './types';
|
|
2
2
|
declare const StatCard: {
|
|
3
|
-
({ title, value, valueTooltip, change, subtitle, variant, chartData, progressValue, titleIcon, actionIcon, helpIconText, dropdownProps, maxWidth, }: StatCardProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ title, value, valueTooltip, change, subtitle, variant, chartData, progressValue, titleIcon, actionIcon, helpIconText, dropdownProps, maxWidth, xAxis, yAxis, valueFormatter, }: StatCardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default StatCard;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SingleSelectProps } from '../SingleSelect';
|
|
3
|
+
import { AxisType } from '../Charts/types';
|
|
3
4
|
export declare enum StatCardVariant {
|
|
4
5
|
LINE = "line",
|
|
5
6
|
PROGRESS_BAR = "progress",
|
|
@@ -19,6 +20,12 @@ export type StatCardChange = {
|
|
|
19
20
|
valueType: ChangeType;
|
|
20
21
|
tooltip?: ReactNode;
|
|
21
22
|
};
|
|
23
|
+
export type StatCardAxisConfig = {
|
|
24
|
+
type?: AxisType;
|
|
25
|
+
tickFormatter?: (value: string | number) => string;
|
|
26
|
+
dateOnly?: boolean;
|
|
27
|
+
smart?: boolean;
|
|
28
|
+
};
|
|
22
29
|
export type StatCardProps = {
|
|
23
30
|
title: string;
|
|
24
31
|
value: string | number;
|
|
@@ -33,4 +40,7 @@ export type StatCardProps = {
|
|
|
33
40
|
helpIconText?: string;
|
|
34
41
|
dropdownProps?: SingleSelectProps;
|
|
35
42
|
maxWidth?: string;
|
|
43
|
+
xAxis?: StatCardAxisConfig;
|
|
44
|
+
yAxis?: StatCardAxisConfig;
|
|
45
|
+
valueFormatter?: AxisType;
|
|
36
46
|
};
|