@juspay/blend-design-system 0.0.13 → 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/DataTable/types.d.ts +1 -0
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +0 -1
- package/dist/components/Drawer/components/DrawerBase.d.ts +2 -0
- package/dist/components/Inputs/DropdownInput/DropdownInput.d.ts +1 -1
- package/dist/components/Inputs/DropdownInput/types.d.ts +8 -2
- package/dist/components/Inputs/OTPInput/OTPInput.d.ts +1 -1
- package/dist/components/Inputs/OTPInput/otpInput.tokens.d.ts +6 -3
- package/dist/components/Inputs/OTPInput/types.d.ts +3 -1
- package/dist/components/MultiSelect/types.d.ts +11 -0
- package/dist/components/Popover/popover.tokens.d.ts +5 -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/components/Tabs/Tabs.d.ts +8 -0
- package/dist/components/Tabs/TabsList.d.ts +10 -0
- package/dist/components/Tabs/TabsTrigger.d.ts +2 -0
- package/dist/components/Tabs/types.d.ts +27 -0
- package/dist/components/Tabs/utils.d.ts +40 -0
- package/dist/context/ThemeContext.d.ts +2 -2
- package/dist/context/useComponentToken.d.ts +2 -2
- package/dist/main.js +40231 -39436
- package/package.json +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +0 -9
- /package/dist/components/Avatar/{token.d.ts → avatar.tokens.d.ts} +0 -0
- /package/dist/components/AvatarGroup/{token.d.ts → avatarGroup.tokens.d.ts} +0 -0
|
@@ -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
|
};
|
|
@@ -225,6 +225,7 @@ export type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
225
225
|
onPageSizeChange?: (pageSize: number) => void;
|
|
226
226
|
isLoading?: boolean;
|
|
227
227
|
showToolbar?: boolean;
|
|
228
|
+
showSettings?: boolean;
|
|
228
229
|
headerSlot1?: ReactNode;
|
|
229
230
|
headerSlot2?: ReactNode;
|
|
230
231
|
enableInlineEdit?: boolean;
|
|
@@ -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,3 @@
|
|
|
1
1
|
import { DropdownInputProps } from './types';
|
|
2
|
-
declare const DropdownInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, onChange, slot, size, placeholder, dropDownValue, onDropDownChange, dropDownItems, dropdownName, onDropdownOpen, onDropdownClose, onBlur, onFocus, maxDropdownHeight, ...rest }: DropdownInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DropdownInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, onChange, slot, size, dropdownPosition, placeholder, dropDownValue, onDropDownChange, dropDownItems, dropdownName, onDropdownOpen, onDropdownClose, onBlur, onFocus, maxDropdownHeight, ...rest }: DropdownInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DropdownInput;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TextInputSize } from '../TextInput/types';
|
|
2
2
|
import { SelectMenuGroupType } from '../../Select/types';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
export declare enum DropdownInputSize {
|
|
4
5
|
SM = "sm",
|
|
5
6
|
MD = "md",
|
|
@@ -12,6 +13,10 @@ export declare enum DropdownInputState {
|
|
|
12
13
|
ERROR = "error",
|
|
13
14
|
DISABLED = "disabled"
|
|
14
15
|
}
|
|
16
|
+
export declare enum DropdownPosition {
|
|
17
|
+
LEFT = "left",
|
|
18
|
+
RIGHT = "right"
|
|
19
|
+
}
|
|
15
20
|
export type DropdownInputProps = {
|
|
16
21
|
label?: string;
|
|
17
22
|
sublabel?: string;
|
|
@@ -21,7 +26,7 @@ export type DropdownInputProps = {
|
|
|
21
26
|
hintText?: string;
|
|
22
27
|
value?: string;
|
|
23
28
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
24
|
-
slot?:
|
|
29
|
+
slot?: ReactNode;
|
|
25
30
|
size?: TextInputSize;
|
|
26
31
|
dropDownValue?: string;
|
|
27
32
|
onDropDownChange?: (value: string) => void;
|
|
@@ -32,4 +37,5 @@ export type DropdownInputProps = {
|
|
|
32
37
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
33
38
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
34
39
|
maxDropdownHeight?: number;
|
|
35
|
-
|
|
40
|
+
dropdownPosition?: DropdownPosition;
|
|
41
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'onBlur' | 'onFocus' | 'slot'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OTPProps } from './types';
|
|
2
|
-
declare const OTPInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, onChange, form, ...rest }: OTPProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const OTPInput: ({ label, sublabel, disabled, helpIconHintText, name, required, error, errorMessage, hintText, value, length, autoFocus, onChange, form, ...rest }: OTPProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default OTPInput;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
3
4
|
declare enum OTPInputState {
|
|
4
5
|
DEFAULT = "default",
|
|
5
6
|
HOVER = "hover",
|
|
@@ -29,6 +30,8 @@ export type OTPInputTokensType = {
|
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export type ResponsiveOTPInputTokens = {
|
|
34
|
+
[key in keyof BreakpointType]: OTPInputTokensType;
|
|
35
|
+
};
|
|
36
|
+
export declare const getOTPInputTokens: (foundationToken: FoundationTokenType) => ResponsiveOTPInputTokens;
|
|
37
|
+
export {};
|
|
@@ -6,6 +6,8 @@ export type OTPProps = {
|
|
|
6
6
|
errorMessage?: string;
|
|
7
7
|
hintText?: string;
|
|
8
8
|
value?: string;
|
|
9
|
+
length?: number;
|
|
10
|
+
autoFocus?: boolean;
|
|
9
11
|
onChange?: (value: string) => void;
|
|
10
12
|
form?: string;
|
|
11
|
-
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className'>;
|
|
13
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'onChange'>;
|
|
@@ -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;
|
|
@@ -8,6 +8,11 @@ export type PopoverTokenType = {
|
|
|
8
8
|
gap: CSSObject['gap'];
|
|
9
9
|
zIndex: CSSObject['zIndex'];
|
|
10
10
|
borderRadius: CSSObject['borderRadius'];
|
|
11
|
+
padding: {
|
|
12
|
+
horizontal: CSSObject['paddingLeft'];
|
|
13
|
+
top: CSSObject['paddingTop'];
|
|
14
|
+
bottom: CSSObject['paddingBottom'];
|
|
15
|
+
};
|
|
11
16
|
headerContainer: {
|
|
12
17
|
heading: {
|
|
13
18
|
fontSize: {
|
|
@@ -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
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
declare const Tabs: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-tabs').TabsProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
2
2
|
variant?: import('./types').TabsVariant;
|
|
3
3
|
size?: import('./types').TabsSize;
|
|
4
|
+
items?: import('./types').TabItem[];
|
|
5
|
+
onTabClose?: (value: string) => void;
|
|
6
|
+
onTabAdd?: () => void;
|
|
7
|
+
showDropdown?: boolean;
|
|
8
|
+
showAddButton?: boolean;
|
|
9
|
+
dropdownTooltip?: string;
|
|
10
|
+
addButtonTooltip?: string;
|
|
11
|
+
maxDisplayTabs?: number;
|
|
4
12
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
13
|
export default Tabs;
|
|
@@ -4,5 +4,15 @@ declare const TabsList: import('react').ForwardRefExoticComponent<Omit<import('@
|
|
|
4
4
|
size?: TabsSize;
|
|
5
5
|
expanded?: boolean;
|
|
6
6
|
fitContent?: boolean;
|
|
7
|
+
items?: import('./types').TabItem[];
|
|
8
|
+
onTabClose?: (value: string) => void;
|
|
9
|
+
onTabAdd?: () => void;
|
|
10
|
+
showDropdown?: boolean;
|
|
11
|
+
showAddButton?: boolean;
|
|
12
|
+
dropdownTooltip?: string;
|
|
13
|
+
addButtonTooltip?: string;
|
|
14
|
+
maxDisplayTabs?: number;
|
|
15
|
+
onTabChange?: (value: string) => void;
|
|
16
|
+
activeTab?: string;
|
|
7
17
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
18
|
export default TabsList;
|
|
@@ -6,5 +6,7 @@ declare const TabsTrigger: import('react').ForwardRefExoticComponent<Omit<import
|
|
|
6
6
|
leftSlot?: import('react').ReactNode;
|
|
7
7
|
rightSlot?: import('react').ReactNode;
|
|
8
8
|
children: string | number;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
9
11
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
12
|
export default TabsTrigger;
|
|
@@ -10,15 +10,40 @@ export declare enum TabsSize {
|
|
|
10
10
|
MD = "md",
|
|
11
11
|
LG = "lg"
|
|
12
12
|
}
|
|
13
|
+
export type TabItem = {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
content: ReactNode;
|
|
17
|
+
closable?: boolean;
|
|
18
|
+
isDefault?: boolean;
|
|
19
|
+
};
|
|
13
20
|
export type TabsProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
|
|
14
21
|
variant?: TabsVariant;
|
|
15
22
|
size?: TabsSize;
|
|
23
|
+
items?: TabItem[];
|
|
24
|
+
onTabClose?: (value: string) => void;
|
|
25
|
+
onTabAdd?: () => void;
|
|
26
|
+
showDropdown?: boolean;
|
|
27
|
+
showAddButton?: boolean;
|
|
28
|
+
dropdownTooltip?: string;
|
|
29
|
+
addButtonTooltip?: string;
|
|
30
|
+
maxDisplayTabs?: number;
|
|
16
31
|
};
|
|
17
32
|
export type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
|
|
18
33
|
variant?: TabsVariant;
|
|
19
34
|
size?: TabsSize;
|
|
20
35
|
expanded?: boolean;
|
|
21
36
|
fitContent?: boolean;
|
|
37
|
+
items?: TabItem[];
|
|
38
|
+
onTabClose?: (value: string) => void;
|
|
39
|
+
onTabAdd?: () => void;
|
|
40
|
+
showDropdown?: boolean;
|
|
41
|
+
showAddButton?: boolean;
|
|
42
|
+
dropdownTooltip?: string;
|
|
43
|
+
addButtonTooltip?: string;
|
|
44
|
+
maxDisplayTabs?: number;
|
|
45
|
+
onTabChange?: (value: string) => void;
|
|
46
|
+
activeTab?: string;
|
|
22
47
|
};
|
|
23
48
|
export type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
|
|
24
49
|
value: string;
|
|
@@ -27,6 +52,8 @@ export type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Tri
|
|
|
27
52
|
leftSlot?: ReactNode;
|
|
28
53
|
rightSlot?: ReactNode;
|
|
29
54
|
children: string | number;
|
|
55
|
+
closable?: boolean;
|
|
56
|
+
onClose?: () => void;
|
|
30
57
|
};
|
|
31
58
|
export type TabsContentProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
|
|
32
59
|
export type TabsStyles = {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TabItem } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Groups tabs by content and concatenates labels for tabs with identical content.
|
|
5
|
+
* Maximum 3 items can be concatenated.
|
|
6
|
+
*
|
|
7
|
+
* @param tabs - Array of tab items to process
|
|
8
|
+
* @returns Processed tabs with concatenation applied
|
|
9
|
+
*/
|
|
10
|
+
export declare const processTabsWithConcatenation: (tabs: TabItem[]) => TabItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Sorts tabs to ensure default tabs appear first
|
|
13
|
+
*/
|
|
14
|
+
export declare const sortTabsByDefault: (tabs: TabItem[]) => TabItem[];
|
|
15
|
+
/**
|
|
16
|
+
* Filters available items that haven't been added as tabs yet
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAvailableItems: <T extends {
|
|
19
|
+
value: string;
|
|
20
|
+
}>(availableItems: T[], existingTabs: TabItem[]) => T[];
|
|
21
|
+
/**
|
|
22
|
+
* Creates tab items from selected values with shared content
|
|
23
|
+
*/
|
|
24
|
+
export declare const createTabsFromSelection: <T extends {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
}>(selectedValues: string[], availableItems: T[], content: ReactNode) => TabItem[];
|
|
28
|
+
/**
|
|
29
|
+
* Prepares items for SingleSelect dropdown (all tabs including scrolled-out)
|
|
30
|
+
*/
|
|
31
|
+
export declare const prepareDropdownItems: (tabs: TabItem[]) => {
|
|
32
|
+
items: {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}[];
|
|
36
|
+
}[];
|
|
37
|
+
/**
|
|
38
|
+
* Returns all tabs for display (no limiting - let horizontal scroll handle overflow)
|
|
39
|
+
*/
|
|
40
|
+
export declare const getDisplayTabs: (tabs: TabItem[]) => TabItem[];
|
|
@@ -7,7 +7,7 @@ import { ResponsiveSwitchTokens } from '../components/Switch/switch.token';
|
|
|
7
7
|
import { ResponsiveTextInputTokens } from '../components/Inputs/TextInput/textInput.tokens';
|
|
8
8
|
import { ResponsiveNumberInputTokens } from '../components/Inputs/NumberInput/numberInput.tokens';
|
|
9
9
|
import { ResponsiveAlertTokens } from '../components/Alert/alert.tokens';
|
|
10
|
-
import {
|
|
10
|
+
import { ResponsiveOTPInputTokens } from '../components/Inputs/OTPInput/otpInput.tokens';
|
|
11
11
|
import { ResponsiveTooltipTokens } from '../components/Tooltip/tooltip.tokens';
|
|
12
12
|
import { ResponsiveUnitInputTokens } from '../components/Inputs/UnitInput/unitInput.tokens';
|
|
13
13
|
import { MultiValueInputTokensType } from '../components/Inputs/MultiValueInput/multiValueInput.tokens';
|
|
@@ -39,7 +39,7 @@ export type ComponentTokenType = {
|
|
|
39
39
|
TEXT_INPUT?: ResponsiveTextInputTokens;
|
|
40
40
|
NUMBER_INPUT?: ResponsiveNumberInputTokens;
|
|
41
41
|
ALERT?: ResponsiveAlertTokens;
|
|
42
|
-
OTP_INPUT?:
|
|
42
|
+
OTP_INPUT?: ResponsiveOTPInputTokens;
|
|
43
43
|
TOOLTIP?: ResponsiveTooltipTokens;
|
|
44
44
|
UNIT_INPUT?: ResponsiveUnitInputTokens;
|
|
45
45
|
MULTI_VALUE_INPUT?: MultiValueInputTokensType;
|
|
@@ -9,7 +9,7 @@ import { ComponentTokenType } from './ThemeContext';
|
|
|
9
9
|
import { ResponsiveTextInputTokens } from '../components/Inputs/TextInput/textInput.tokens';
|
|
10
10
|
import { ResponsiveNumberInputTokens } from '../components/Inputs/NumberInput/numberInput.tokens';
|
|
11
11
|
import { ResponsiveAlertTokens } from '../components/Alert/alert.tokens';
|
|
12
|
-
import {
|
|
12
|
+
import { ResponsiveOTPInputTokens } from '../components/Inputs/OTPInput/otpInput.tokens';
|
|
13
13
|
import { ResponsiveTooltipTokens } from '../components/Tooltip/tooltip.tokens';
|
|
14
14
|
import { ResponsiveUnitInputTokens } from '../components/Inputs/UnitInput/unitInput.tokens';
|
|
15
15
|
import { MultiValueInputTokensType } from '../components/Inputs/MultiValueInput/multiValueInput.tokens';
|
|
@@ -29,4 +29,4 @@ import { DrawerTokensType } from '../components/Drawer/drawer.tokens';
|
|
|
29
29
|
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.tokens';
|
|
30
30
|
import { ResponsiveChartTokens } from '../components/Charts/chart.tokens';
|
|
31
31
|
import { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens';
|
|
32
|
-
export declare const useComponentToken: (component: keyof ComponentTokenType) => SearchInputTokensType | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens |
|
|
32
|
+
export declare const useComponentToken: (component: keyof ComponentTokenType) => SearchInputTokensType | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens | ResponsiveOTPInputTokens | ResponsiveUnitInputTokens | MultiValueInputTokensType | ResponsiveSwitchTokens | ResponsiveCheckboxTokens | ResponsiveTabsTokens | ResponsiveTooltipTokens | ResponsiveDropdownInputTokens | ResponsiveButtonTokens | ModalTokensType | ResponsiveBreadcrumbTokens | PopoverTokenType | ResponsiveMenuTokensType | ResponsiveMultiSelectTokens | ResponsiveSingleSelectTokens | ResponsiveTableTokens | ResponsiveCalendarTokens | ResponsiveAccordionTokens | ResponsiveStatCardTokens | ProgressBarTokenType | DrawerTokensType | ResponsiveChartTokens | ResponsiveSnackbarTokens;
|