@juspay/blend-design-system 0.0.14-beta → 0.0.15-beta

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.
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ChartContainerProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare const ChartContainer: React.FC<ChartContainerProps>;
6
+ export default ChartContainer;
@@ -1,2 +1,3 @@
1
1
  import { ChartHeaderProps } from './types';
2
- export declare const ChartHeader: React.FC<ChartHeaderProps>;
2
+ declare const ChartHeader: React.FC<ChartHeaderProps>;
3
+ export default ChartHeader;
@@ -1,3 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { ChartLegendsProps } from './types';
3
- export declare const ChartLegends: React.NamedExoticComponent<ChartLegendsProps>;
3
+ declare const _default: React.NamedExoticComponent<ChartLegendsProps>;
4
+ export default _default;
@@ -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: (timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
7
+ export declare const getAxisFormatterWithConfig: (axisType: AxisType, dateOnly?: boolean, smart?: boolean, timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
8
+ export declare const getAxisFormatter: (axisType: AxisType, timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { CoreChartProps } from './types';
3
+ export declare const CoreChart: React.FC<CoreChartProps>;
4
+ export default CoreChart;
@@ -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,6 @@
1
1
  export { default as Charts } from './Charts';
2
+ export { default as CoreChart } from './CoreChart';
3
+ export { default as ChartContainer } from './ChartContainer';
4
+ export { default as ChartHeader } from './ChartHeader';
5
+ export { default as ChartLegends } from './ChartLegend';
2
6
  export * from './types';
@@ -1,2 +1,2 @@
1
1
  import { RenderChartProps } from './types';
2
- export declare const renderChart: ({ flattenedData, chartType, hoveredKey, lineKeys, colors, setHoveredKey, xAxisLabel, yAxisLabel, data: originalData, selectedKeys, isSmallScreen, }: RenderChartProps) => import("react/jsx-runtime").JSX.Element;
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,42 @@ 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
+ timeZone?: string;
59
+ hour12?: boolean;
60
+ };
61
+ export type XAxisConfig = AxisConfig;
62
+ export type YAxisConfig = AxisConfig;
27
63
  export type NewNestedDataPoint = {
28
64
  name: string;
29
65
  data: {
@@ -42,18 +78,32 @@ export type RenderChartProps = {
42
78
  lineKeys: string[];
43
79
  colors: string[];
44
80
  setHoveredKey: (key: string | null) => void;
45
- xAxisLabel?: string;
46
- yAxisLabel?: string;
47
81
  data: NewNestedDataPoint[];
48
82
  selectedKeys: string[];
49
83
  isSmallScreen?: boolean;
84
+ barsize?: number;
85
+ xAxis?: XAxisConfig;
86
+ yAxis?: YAxisConfig;
87
+ };
88
+ export type CoreChartProps = {
89
+ chartType?: ChartType;
90
+ data: NewNestedDataPoint[];
91
+ colors?: string[];
92
+ barsize?: number;
93
+ xAxis?: XAxisConfig;
94
+ yAxis?: YAxisConfig;
95
+ height?: number | string;
96
+ width?: number | string;
97
+ isSmallScreen?: boolean;
98
+ hoveredKey?: string | null;
99
+ onHoveredKeyChange?: (key: string | null) => void;
100
+ selectedKeys?: string[];
101
+ enableHover?: boolean;
50
102
  };
51
103
  export type ChartsProps = {
52
104
  chartType?: ChartType;
53
105
  data: NewNestedDataPoint[];
54
106
  colors?: string[];
55
- xAxisLabel?: string;
56
- yAxisLabel?: string;
57
107
  slot1?: ReactNode;
58
108
  slot2?: ReactNode;
59
109
  slot3?: ReactNode;
@@ -61,6 +111,9 @@ export type ChartsProps = {
61
111
  chartHeaderSlot: ReactNode;
62
112
  stackedLegends?: boolean;
63
113
  stackedLegendsData?: StackedLegendsDataPoint[];
114
+ barsize?: number;
115
+ xAxis?: XAxisConfig;
116
+ yAxis?: YAxisConfig;
64
117
  };
65
118
  export type FlattenedDataPoint = {
66
119
  name: string;
@@ -99,4 +152,6 @@ export type CustomTooltipProps = TooltipProps<ValueType, NameType> & {
99
152
  setHoveredKey: (key: string) => void;
100
153
  chartType: ChartType;
101
154
  selectedKeys: string[];
155
+ xAxis?: XAxisConfig;
156
+ yAxis?: YAxisConfig;
102
157
  };
@@ -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,8 @@
1
- import { SearchInputProps } from './types';
2
- declare const SearchInput: ({ leftSlot, rightSlot, error, placeholder, value, onChange, name, ...rest }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
1
+ declare const SearchInput: import('react').ForwardRefExoticComponent<{
2
+ leftSlot?: React.ReactNode;
3
+ rightSlot?: React.ReactNode;
4
+ error?: boolean;
5
+ value?: string;
6
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
+ } & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "style" | "className"> & import('react').RefAttributes<HTMLInputElement>>;
3
8
  export default SearchInput;
@@ -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,3 @@
1
+ export { default } from './index';
2
+ export * from './index';
3
+ export * from './types';
@@ -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 @@ export type LeftPanelInfo = {
9
9
  items: LeftPanelItem[];
10
10
  selected: string;
11
11
  onSelect: (value: string) => void;
12
+ maxVisibleItems?: number;
12
13
  };
13
14
  export type SidebarProps = {
14
15
  children: ReactNode;
@@ -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,14 @@ 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
+ timeZone?: string;
29
+ hour12?: boolean;
30
+ };
22
31
  export type StatCardProps = {
23
32
  title: string;
24
33
  value: string | number;
@@ -33,4 +42,7 @@ export type StatCardProps = {
33
42
  helpIconText?: string;
34
43
  dropdownProps?: SingleSelectProps;
35
44
  maxWidth?: string;
45
+ xAxis?: StatCardAxisConfig;
46
+ yAxis?: StatCardAxisConfig;
47
+ valueFormatter?: AxisType;
36
48
  };