@juspay/blend-design-system 0.0.20-beta → 0.0.21-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.
- package/dist/components/Accordion/accordion.tokens.d.ts +39 -20
- package/dist/components/Alert/alert.tokens.d.ts +63 -4
- package/dist/components/Avatar/avatar.tokens.d.ts +64 -53
- package/dist/components/Avatar/types.d.ts +1 -0
- package/dist/components/AvatarGroup/avatarGroup.tokens.d.ts +41 -67
- package/dist/components/Breadcrumb/breadcrumb.tokens.d.ts +26 -16
- package/dist/components/Button/Button.d.ts +2 -3
- package/dist/components/Button/button.tokens.d.ts +38 -13
- package/dist/components/Button/types.d.ts +8 -3
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/dist/components/ButtonGroup/types.d.ts +2 -2
- package/dist/components/Card/card.tokens.d.ts +80 -56
- package/dist/components/Card/types.d.ts +3 -3
- package/dist/components/Card/utils.d.ts +21 -24
- package/dist/components/Charts/chart.tokens.d.ts +24 -82
- package/dist/components/Charts/types.d.ts +7 -2
- package/dist/components/Checkbox/checkbox.token.d.ts +41 -68
- package/dist/components/CodeBlock/CodeBlock.d.ts +3 -0
- package/dist/components/CodeBlock/codeBlock.token.d.ts +90 -0
- package/dist/components/CodeBlock/index.d.ts +2 -0
- package/dist/components/CodeBlock/types.d.ts +25 -0
- package/dist/components/CodeBlock/utils.d.ts +38 -0
- package/dist/components/DataTable/DataTableHeader/types.d.ts +1 -0
- package/dist/components/DataTable/TableCell/types.d.ts +1 -0
- package/dist/components/DataTable/types.d.ts +1 -0
- package/dist/components/DateRangePicker/QuickRangeSelector.d.ts +2 -0
- package/dist/components/DateRangePicker/TimeSelector.d.ts +2 -0
- package/dist/components/DateRangePicker/components/mobile.tokens.d.ts +77 -0
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +132 -249
- package/dist/components/DateRangePicker/utils.d.ts +9 -1
- package/dist/components/Directory/types.d.ts +1 -0
- package/dist/components/Drawer/drawer.tokens.d.ts +43 -44
- package/dist/components/Drawer/types.d.ts +3 -3
- package/dist/components/Inputs/DropdownInput/DropdownInput.d.ts +1 -1
- package/dist/components/Inputs/DropdownInput/dropdownInput.tokens.d.ts +55 -16
- package/dist/components/Inputs/DropdownInput/types.d.ts +3 -1
- package/dist/components/Inputs/MultiValueInput/multiValueInput.tokens.d.ts +55 -12
- package/dist/components/Inputs/NumberInput/numberInput.tokens.d.ts +74 -21
- package/dist/components/Inputs/OTPInput/OTPInput.d.ts +1 -1
- package/dist/components/Inputs/OTPInput/otpInput.tokens.d.ts +48 -12
- package/dist/components/Inputs/OTPInput/types.d.ts +1 -0
- package/dist/components/Inputs/SearchInput/searchInput.tokens.d.ts +52 -27
- package/dist/components/Inputs/TextArea/textarea.token.d.ts +58 -17
- package/dist/components/Inputs/TextInput/textInput.tokens.d.ts +54 -14
- package/dist/components/Inputs/UnitInput/unitInput.tokens.d.ts +72 -16
- package/dist/components/Inputs/utils/InputFooter/InputFooter.d.ts +17 -1
- package/dist/components/Inputs/utils/InputLabels/InputLabels.d.ts +31 -2
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/MenuItem.d.ts +2 -2
- package/dist/components/Menu/SubMenu.d.ts +2 -2
- package/dist/components/Menu/menu.tokens.d.ts +46 -26
- package/dist/components/Menu/types.d.ts +11 -11
- package/dist/components/Menu/utils.d.ts +3 -3
- package/dist/components/Modal/modal.tokens.d.ts +59 -33
- package/dist/components/Modal/types.d.ts +2 -2
- package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
- package/dist/components/MultiSelect/multiSelect.tokens.d.ts +72 -28
- package/dist/components/Popover/PopoverFooter.d.ts +1 -1
- package/dist/components/Popover/popover.tokens.d.ts +49 -13
- package/dist/components/Popover/types.d.ts +2 -2
- package/dist/components/ProgressBar/index.d.ts +0 -1
- package/dist/components/ProgressBar/progressbar.tokens.d.ts +54 -41
- package/dist/components/Radio/radio.token.d.ts +21 -24
- package/dist/components/Sidebar/sidebar.tokens.d.ts +77 -0
- package/dist/components/Sidebar/utils.d.ts +3 -2
- package/dist/components/SingleSelect/SingleSelect.d.ts +1 -1
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +4 -2
- package/dist/components/SingleSelect/singleSelect.tokens.d.ts +67 -23
- package/dist/components/SingleSelect/types.d.ts +0 -1
- package/dist/components/Snackbar/snackbar.tokens.d.ts +51 -26
- package/dist/components/StatCard/StatCard.d.ts +1 -1
- package/dist/components/StatCard/statcard.tokens.d.ts +51 -66
- package/dist/components/StatCard/types.d.ts +5 -0
- package/dist/components/Switch/switch.token.d.ts +57 -74
- package/dist/components/Tabs/tabs.token.d.ts +62 -40
- package/dist/components/Tags/tag.tokens.d.ts +35 -36
- package/dist/components/Tooltip/tooltip.tokens.d.ts +24 -10
- package/dist/components/VirtualList/VirtualList.d.ts +10 -1
- package/dist/components/VirtualList/index.d.ts +1 -2
- package/dist/components/VirtualList/types.d.ts +10 -62
- package/dist/components/VirtualList/utils.d.ts +31 -22
- package/dist/context/ThemeContext.d.ts +20 -12
- package/dist/context/useComponentToken.d.ts +12 -8
- package/dist/main.js +31374 -28273
- package/dist/tokens/unit.tokens.d.ts +3 -0
- package/package.json +1 -1
- package/dist/components/Menu/MenuPlayground.d.ts +0 -3
- package/dist/components/Menu/MenuPlaygroundComprehensive.d.ts +0 -3
- package/dist/components/ProgressBar/utils.d.ts +0 -7
|
@@ -3,64 +3,86 @@ import { ThemeType } from '../../tokens';
|
|
|
3
3
|
import { TabsVariant, TabsSize } from './types';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
5
|
export type TabsState = 'default' | 'hover' | 'active' | 'disabled';
|
|
6
|
+
/**
|
|
7
|
+
* Tabs Tokens following the pattern: [target].CSSProp.[size].[variant].[state]
|
|
8
|
+
*
|
|
9
|
+
* Structure:
|
|
10
|
+
* - target: container | trigger | text | underline (defines what element the token applies to)
|
|
11
|
+
* - CSSProp: backgroundColor | borderRadius | padding | border | color | fontSize | fontWeight | gap | height
|
|
12
|
+
* - size: md | lg (only for size-dependent properties)
|
|
13
|
+
* - variant: underline | boxed | floating | pills (tabs variant)
|
|
14
|
+
* - state: default | hover | active | disabled (interaction state)
|
|
15
|
+
*
|
|
16
|
+
* Size-independent properties: backgroundColor, border, color
|
|
17
|
+
* Size-dependent properties: borderRadius, padding, fontSize, fontWeight
|
|
18
|
+
*/
|
|
6
19
|
export type TabsTokensType = {
|
|
7
|
-
gap:
|
|
20
|
+
gap: CSSObject['gap'];
|
|
21
|
+
backgroundColor: {
|
|
22
|
+
[key in TabsVariant]: {
|
|
23
|
+
[key in TabsState]: CSSObject['backgroundColor'];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
borderRadius: {
|
|
8
27
|
[key in TabsSize]: {
|
|
9
|
-
[key in TabsVariant]: CSSObject['
|
|
28
|
+
[key in TabsVariant]: CSSObject['borderRadius'];
|
|
10
29
|
};
|
|
11
30
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[key in TabsVariant]:
|
|
31
|
+
padding: {
|
|
32
|
+
[key in TabsSize]: {
|
|
33
|
+
[key in TabsVariant]: {
|
|
34
|
+
top: CSSObject['paddingTop'];
|
|
35
|
+
right: CSSObject['paddingRight'];
|
|
36
|
+
bottom: CSSObject['paddingBottom'];
|
|
37
|
+
left: CSSObject['paddingLeft'];
|
|
38
|
+
};
|
|
15
39
|
};
|
|
40
|
+
};
|
|
41
|
+
border: {
|
|
42
|
+
[key in TabsVariant]: CSSObject['border'];
|
|
43
|
+
};
|
|
44
|
+
borderBottom: {
|
|
45
|
+
[key in TabsVariant]: CSSObject['borderBottom'];
|
|
46
|
+
};
|
|
47
|
+
container: {
|
|
16
48
|
backgroundColor: {
|
|
17
49
|
[key in TabsVariant]: CSSObject['backgroundColor'];
|
|
18
50
|
};
|
|
19
51
|
borderRadius: {
|
|
20
|
-
[key in
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[key in TabsVariant]: CSSObject['borderBottom'];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
trigger: {
|
|
27
|
-
height: {
|
|
28
|
-
[key in TabsSize]: CSSObject['height'];
|
|
52
|
+
[key in TabsSize]: {
|
|
53
|
+
[key in TabsVariant]: CSSObject['borderRadius'];
|
|
54
|
+
};
|
|
29
55
|
};
|
|
30
56
|
padding: {
|
|
31
|
-
[key in
|
|
32
|
-
[key in
|
|
57
|
+
[key in TabsSize]: {
|
|
58
|
+
[key in TabsVariant]: {
|
|
59
|
+
top: CSSObject['paddingTop'];
|
|
60
|
+
right: CSSObject['paddingRight'];
|
|
61
|
+
bottom: CSSObject['paddingBottom'];
|
|
62
|
+
left: CSSObject['paddingLeft'];
|
|
63
|
+
};
|
|
33
64
|
};
|
|
34
65
|
};
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
};
|
|
67
|
+
trigger: {
|
|
68
|
+
gap: CSSObject['gap'];
|
|
69
|
+
activeIndicator: {
|
|
70
|
+
height: CSSObject['height'];
|
|
71
|
+
color: CSSObject['color'];
|
|
37
72
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
text: {
|
|
74
|
+
color: {
|
|
75
|
+
[key in TabsVariant]: {
|
|
76
|
+
[key in TabsState]: CSSObject['color'];
|
|
77
|
+
};
|
|
42
78
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
[key in TabsVariant]: {
|
|
46
|
-
[key in TabsState]?: CSSObject['color'];
|
|
79
|
+
fontSize: {
|
|
80
|
+
[key in TabsSize]: CSSObject['fontSize'];
|
|
47
81
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[key in TabsVariant]: {
|
|
51
|
-
[key in TabsState]?: CSSObject['backgroundColor'];
|
|
82
|
+
fontWeight: {
|
|
83
|
+
[key in TabsSize]: CSSObject['fontWeight'];
|
|
52
84
|
};
|
|
53
85
|
};
|
|
54
|
-
borderRadius: {
|
|
55
|
-
[key in TabsVariant]: CSSObject['borderRadius'];
|
|
56
|
-
};
|
|
57
|
-
border: {
|
|
58
|
-
[key in TabsVariant]: CSSObject['border'];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
underline: {
|
|
62
|
-
height: CSSObject['height'];
|
|
63
|
-
color: CSSObject['color'];
|
|
64
86
|
};
|
|
65
87
|
};
|
|
66
88
|
export type ResponsiveTabsTokens = {
|
|
@@ -1,57 +1,56 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
|
-
import { ThemeType } from '../../tokens';
|
|
3
2
|
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
4
3
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
5
|
+
/**
|
|
6
|
+
* Tag Tokens following the pattern: [target].CSSProp.[size].[variant].[subType]
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: container | text (defines what element the token applies to)
|
|
10
|
+
* - CSSProp: backgroundColor | borderRadius | padding | border | color | fontSize | fontWeight | gap | height
|
|
11
|
+
* - size: xs | sm | md | lg (only for size-dependent properties like padding, fontSize, height)
|
|
12
|
+
* - variant: noFill | attentive | subtle (tag variant)
|
|
13
|
+
* - subType: neutral | primary | success | error | warning | purple (tag color)
|
|
14
|
+
*
|
|
15
|
+
* Size-independent properties: backgroundColor, border, color
|
|
16
|
+
* Size-dependent properties: borderRadius, padding, fontSize, fontWeight, gap, height
|
|
17
|
+
*/
|
|
5
18
|
export type TagTokensType = Readonly<{
|
|
6
|
-
|
|
19
|
+
gap: CSSObject['gap'];
|
|
20
|
+
backgroundColor: {
|
|
7
21
|
[key in TagVariant]: {
|
|
8
|
-
[key in TagColor]: CSSObject['
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
color: {
|
|
12
|
-
[key in TagVariant]: {
|
|
13
|
-
[key in TagColor]: CSSObject['color'];
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
borderColor: {
|
|
17
|
-
[key in TagVariant]: {
|
|
18
|
-
[key in TagColor]: CSSObject['color'];
|
|
22
|
+
[key in TagColor]: CSSObject['backgroundColor'];
|
|
19
23
|
};
|
|
20
24
|
};
|
|
21
25
|
borderRadius: {
|
|
22
|
-
[key in TagShape]: {
|
|
23
|
-
[key in TagSize]: CSSObject['borderRadius'];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
borderWidth: {
|
|
27
|
-
[key in TagVariant]: {
|
|
28
|
-
[key in TagColor]: CSSObject['borderWidth'];
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
font: {
|
|
32
26
|
[key in TagSize]: {
|
|
33
|
-
|
|
34
|
-
fontWeight: CSSObject['fontWeight'];
|
|
27
|
+
[key in TagShape]: CSSObject['borderRadius'];
|
|
35
28
|
};
|
|
36
29
|
};
|
|
37
|
-
gap: {
|
|
38
|
-
[key in TagSize]: CSSObject['gap'];
|
|
39
|
-
};
|
|
40
30
|
padding: {
|
|
41
31
|
[key in TagSize]: CSSObject['padding'];
|
|
42
32
|
};
|
|
43
|
-
|
|
44
|
-
[key in
|
|
33
|
+
border: {
|
|
34
|
+
[key in TagVariant]: {
|
|
35
|
+
[key in TagColor]: CSSObject['border'];
|
|
36
|
+
};
|
|
45
37
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
[key in
|
|
38
|
+
text: {
|
|
39
|
+
color: {
|
|
40
|
+
[key in TagVariant]: {
|
|
41
|
+
[key in TagColor]: CSSObject['color'];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
fontSize: {
|
|
45
|
+
[key in TagSize]: CSSObject['fontSize'];
|
|
46
|
+
};
|
|
47
|
+
fontWeight: {
|
|
48
|
+
[key in TagSize]: CSSObject['fontWeight'];
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
52
|
export type ResponsiveTagTokens = {
|
|
53
53
|
[key in keyof BreakpointType]: TagTokensType;
|
|
54
54
|
};
|
|
55
|
-
declare const
|
|
56
|
-
export
|
|
57
|
-
export default tagTokens;
|
|
55
|
+
export declare const getTagTokens: (foundationToken: FoundationTokenType) => ResponsiveTagTokens;
|
|
56
|
+
export default getTagTokens;
|
|
@@ -2,12 +2,20 @@ import { CSSObject } from 'styled-components';
|
|
|
2
2
|
import { TooltipSize } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
/**
|
|
6
|
+
* Tooltip Tokens following the pattern: [target].CSSProp.[size]
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: text (defines what element the token applies to)
|
|
10
|
+
* - CSSProp: background | borderRadius | maxWidth | padding | gap | color | fontWeight | fontSize | lineHeight
|
|
11
|
+
* - size: sm | lg (tooltip size)
|
|
12
|
+
*
|
|
13
|
+
* Notes:
|
|
14
|
+
* - Size-independent properties: background, text.color
|
|
15
|
+
* - Size-dependent properties: borderRadius, maxWidth, padding, gap, text.fontWeight, text.fontSize, text.lineHeight
|
|
16
|
+
*/
|
|
5
17
|
export type TooltipTokensType = {
|
|
6
18
|
background: CSSObject['backgroundColor'];
|
|
7
|
-
color: CSSObject['color'];
|
|
8
|
-
fontWeight: {
|
|
9
|
-
[key in TooltipSize]: CSSObject['fontWeight'];
|
|
10
|
-
};
|
|
11
19
|
borderRadius: {
|
|
12
20
|
[key in TooltipSize]: CSSObject['borderRadius'];
|
|
13
21
|
};
|
|
@@ -17,15 +25,21 @@ export type TooltipTokensType = {
|
|
|
17
25
|
padding: {
|
|
18
26
|
[key in TooltipSize]: CSSObject['padding'];
|
|
19
27
|
};
|
|
20
|
-
fontSize: {
|
|
21
|
-
[key in TooltipSize]: CSSObject['fontSize'];
|
|
22
|
-
};
|
|
23
|
-
lineHeight: {
|
|
24
|
-
[key in TooltipSize]: CSSObject['lineHeight'];
|
|
25
|
-
};
|
|
26
28
|
gap: {
|
|
27
29
|
[key in TooltipSize]: CSSObject['gap'];
|
|
28
30
|
};
|
|
31
|
+
text: {
|
|
32
|
+
color: CSSObject['color'];
|
|
33
|
+
fontWeight: {
|
|
34
|
+
[key in TooltipSize]: CSSObject['fontWeight'];
|
|
35
|
+
};
|
|
36
|
+
fontSize: {
|
|
37
|
+
[key in TooltipSize]: CSSObject['fontSize'];
|
|
38
|
+
};
|
|
39
|
+
lineHeight: {
|
|
40
|
+
[key in TooltipSize]: CSSObject['lineHeight'];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
29
43
|
};
|
|
30
44
|
export type ResponsiveTooltipTokens = {
|
|
31
45
|
[key in keyof BreakpointType]: TooltipTokensType;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { VirtualListProps, VirtualListRef, VirtualListItem } from './types';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A simple, performant virtual list component that only renders visible items.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
declare function VirtualListInner<T extends VirtualListItem>({ items, renderItem, height, itemHeight, overscan, onScroll, onEndReached, endReachedThreshold, isLoading, hasMore, className, style, }: VirtualListProps<T>, ref: React.Ref<VirtualListRef>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const VirtualList: (<T extends VirtualListItem>(props: VirtualListProps<T> & {
|
|
9
|
+
ref?: React.Ref<VirtualListRef>;
|
|
10
|
+
}) => ReturnType<typeof VirtualListInner>) & {
|
|
11
|
+
displayName?: string;
|
|
12
|
+
};
|
|
4
13
|
export default VirtualList;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { default as VirtualList } from './VirtualList';
|
|
2
|
-
export {
|
|
3
|
-
export type { VirtualListItem, VirtualListProps, VirtualListRef, VirtualListRenderParams, UseVirtualListParams, UseVirtualListReturn, } from './types';
|
|
2
|
+
export type { VirtualListItem, VirtualListProps, VirtualListRef, VirtualListRenderParams, } from './types';
|
|
@@ -1,79 +1,27 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export type VirtualListItem = {
|
|
3
3
|
id: string | number;
|
|
4
|
-
|
|
5
|
-
data?: Record<string, unknown>;
|
|
4
|
+
[key: string]: unknown;
|
|
6
5
|
};
|
|
7
|
-
export type VirtualListRenderParams<T
|
|
6
|
+
export type VirtualListRenderParams<T> = {
|
|
8
7
|
item: T;
|
|
9
8
|
index: number;
|
|
10
|
-
style: React.CSSProperties;
|
|
11
9
|
};
|
|
12
|
-
export type
|
|
13
|
-
export type VisibleRange = {
|
|
14
|
-
startIndex: number;
|
|
15
|
-
endIndex: number;
|
|
16
|
-
};
|
|
17
|
-
export type VirtualListProps<T extends VirtualListItem> = {
|
|
10
|
+
export type VirtualListProps<T> = {
|
|
18
11
|
items: T[];
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
renderItem: (params: VirtualListRenderParams<T>) => React.ReactNode;
|
|
13
|
+
height?: number | string;
|
|
14
|
+
itemHeight?: number;
|
|
21
15
|
overscan?: number;
|
|
22
16
|
onScroll?: (scrollTop: number) => void;
|
|
23
|
-
renderItem: (params: VirtualListRenderParams<T>) => React.ReactNode;
|
|
24
|
-
className?: string;
|
|
25
|
-
style?: React.CSSProperties;
|
|
26
|
-
getItemHeight?: (item: T, index: number) => number;
|
|
27
|
-
dynamicHeight?: boolean;
|
|
28
|
-
estimatedItemHeight?: number;
|
|
29
|
-
ssrMode?: boolean;
|
|
30
|
-
ariaRole?: 'listbox' | 'menu' | 'table' | 'list';
|
|
31
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
32
|
-
emptyState?: React.ReactNode;
|
|
33
|
-
throttleScrollMs?: number;
|
|
34
17
|
onEndReached?: () => void;
|
|
35
18
|
endReachedThreshold?: number;
|
|
36
19
|
isLoading?: boolean;
|
|
37
|
-
loadingComponent?: React.ReactNode;
|
|
38
20
|
hasMore?: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
initialScrollIndex?: number;
|
|
42
|
-
scrollAlignment?: ScrollAlignment;
|
|
43
|
-
itemsToRender?: number;
|
|
44
|
-
minHeight?: number;
|
|
45
|
-
maxHeight?: number;
|
|
46
|
-
maintainScrollPosition?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
47
23
|
};
|
|
48
24
|
export type VirtualListRef = {
|
|
49
|
-
scrollTo: (
|
|
50
|
-
scrollToIndex: (index: number
|
|
51
|
-
getScrollOffset: () => number;
|
|
52
|
-
recalculateHeights: () => void;
|
|
53
|
-
getVisibleRange: () => VisibleRange;
|
|
54
|
-
measureItem: (index: number) => void;
|
|
55
|
-
};
|
|
56
|
-
export type UseVirtualListParams<T extends VirtualListItem> = {
|
|
57
|
-
items: T[];
|
|
58
|
-
itemHeight?: number | ((item: T, index: number) => number);
|
|
59
|
-
containerHeight: number;
|
|
60
|
-
overscan?: number;
|
|
61
|
-
getItemHeight?: (item: T, index: number) => number;
|
|
62
|
-
dynamicHeight?: boolean;
|
|
63
|
-
ssrMode?: boolean;
|
|
64
|
-
estimatedItemHeight?: number;
|
|
65
|
-
itemsToRender?: number;
|
|
66
|
-
minHeight?: number;
|
|
67
|
-
maxHeight?: number;
|
|
68
|
-
};
|
|
69
|
-
export type UseVirtualListReturn = {
|
|
70
|
-
scrollTop: number;
|
|
71
|
-
setScrollTop: React.Dispatch<React.SetStateAction<number>>;
|
|
72
|
-
totalHeight: number;
|
|
73
|
-
itemOffsets: number[];
|
|
74
|
-
itemHeights: number[];
|
|
75
|
-
recalculateHeights: () => void;
|
|
76
|
-
startIndex: number;
|
|
77
|
-
endIndex: number;
|
|
78
|
-
measureItem: (index: number, height: number) => void;
|
|
25
|
+
scrollTo: (offset: number) => void;
|
|
26
|
+
scrollToIndex: (index: number) => void;
|
|
79
27
|
};
|
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
import { VirtualListItem, UseVirtualListParams, UseVirtualListReturn, ScrollAlignment } from './types';
|
|
2
|
-
export declare function throttle<T extends (...args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
3
1
|
export declare const isBrowser: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Binary search to find the first visible node
|
|
4
|
+
*/
|
|
5
|
+
export declare function findStartNode(scrollTop: number, nodePositions: number[], itemCount: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* Find the last visible node
|
|
8
|
+
*/
|
|
9
|
+
export declare function findEndNode(nodePositions: number[], startNode: number, itemCount: number, viewportHeight: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Calculate which items should be visible based on scroll position
|
|
12
|
+
*/
|
|
13
|
+
export declare function calculateVisibleRange(scrollTop: number, containerHeight: number, itemOffsets: number[], itemsLength: number, overscan: number): {
|
|
6
14
|
startIndex: number;
|
|
7
15
|
endIndex: number;
|
|
8
16
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Calculate child positions for virtual list items
|
|
19
|
+
*/
|
|
20
|
+
export declare function calculateChildPositions(itemsLength: number, itemHeight: number | undefined, defaultHeight?: number): number[];
|
|
21
|
+
/**
|
|
22
|
+
* Calculate total height based on child positions and item height
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateTotalHeight(childPositions: number[], itemsLength: number, itemHeight: number | undefined, defaultHeight?: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate visible range with overscan
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateVisibleNodes(firstVisibleNode: number, lastVisibleNode: number, itemsLength: number, overscan: number): {
|
|
29
|
+
startNode: number;
|
|
30
|
+
endNode: number;
|
|
31
|
+
visibleNodeCount: number;
|
|
12
32
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Calculate total height and offsets for all items
|
|
35
|
+
*/
|
|
36
|
+
export declare function calculateItemPositions(itemsLength: number, itemHeight: number | undefined, measuredHeights: Map<number, number>, defaultHeight?: number): {
|
|
16
37
|
totalHeight: number;
|
|
17
38
|
itemOffsets: number[];
|
|
18
39
|
};
|
|
19
|
-
export declare function useVirtualList<T extends VirtualListItem>({ items, itemHeight, containerHeight, overscan, getItemHeight, ssrMode, estimatedItemHeight, itemsToRender, minHeight, maxHeight, }: UseVirtualListParams<T>): UseVirtualListReturn;
|
|
20
|
-
export declare const handleVirtualListKeyDown: (e: React.KeyboardEvent<HTMLDivElement>, ariaRole: string, totalHeight: number, containerRef: React.RefObject<HTMLDivElement | null>, onKeyDown?: (event: React.KeyboardEvent) => void) => void;
|
|
21
|
-
export declare const calculateScrollForAlignment: (index: number, alignment: ScrollAlignment, containerHeight: number, itemOffsets: number[], itemHeights: number[], itemsLength: number) => number;
|
|
22
|
-
export declare const scrollToPosition: (containerRef: React.RefObject<HTMLDivElement | null>, scrollTop: number, smooth?: boolean) => void;
|
|
23
|
-
export declare const scrollToIndex: (containerRef: React.RefObject<HTMLDivElement | null>, index: number, itemOffsets: number[], itemHeights: number[], itemsLength: number, containerHeight: number, alignment?: ScrollAlignment, smooth?: boolean) => void;
|
|
24
|
-
export declare const createVirtualItemStyle: (top: number, height: number, useAbsolute?: boolean) => React.CSSProperties;
|
|
25
|
-
export declare const setupResizeObserver: (dynamicHeight: boolean, isMounted: boolean, containerRef: React.RefObject<HTMLDivElement | null>, measureItem: (index: number, height: number) => void) => (() => void) | undefined;
|
|
26
|
-
export declare const checkEndReached: (scrollTop: number, totalHeight: number, containerHeight: number, threshold: number) => boolean;
|
|
27
|
-
export declare const usePreviousRange: (startIndex: number, endIndex: number, onRangeChange?: (range: {
|
|
28
|
-
startIndex: number;
|
|
29
|
-
endIndex: number;
|
|
30
|
-
}) => void) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResponsiveSearchInputTokens } from '../components/Inputs/SearchInput/searchInput.tokens';
|
|
2
2
|
import { ResponsiveTagTokens } from '../components/Tags/tag.tokens';
|
|
3
3
|
import { ResponsiveTextAreaTokens } from '../components/Inputs/TextArea/textarea.token';
|
|
4
4
|
import { ResponsiveRadioTokens } from '../components/Radio/radio.token';
|
|
@@ -9,14 +9,14 @@ import { ResponsiveAlertTokens } from '../components/Alert/alert.tokens';
|
|
|
9
9
|
import { ResponsiveOTPInputTokens } from '../components/Inputs/OTPInput/otpInput.tokens';
|
|
10
10
|
import { ResponsiveTooltipTokens } from '../components/Tooltip/tooltip.tokens';
|
|
11
11
|
import { ResponsiveUnitInputTokens } from '../components/Inputs/UnitInput/unitInput.tokens';
|
|
12
|
-
import {
|
|
12
|
+
import { ResponsiveMultiValueInputTokens } from '../components/Inputs/MultiValueInput/multiValueInput.tokens';
|
|
13
13
|
import { ResponsiveDropdownInputTokens } from '../components/Inputs/DropdownInput/dropdownInput.tokens';
|
|
14
14
|
import { ResponsiveCheckboxTokens } from '../components/Checkbox/checkbox.token';
|
|
15
15
|
import { ResponsiveTabsTokens } from '../components/Tabs/tabs.token';
|
|
16
16
|
import { ResponsiveButtonTokens } from '../components/Button/button.tokens';
|
|
17
|
-
import {
|
|
17
|
+
import { ResponsiveModalTokens } from '../components/Modal/modal.tokens';
|
|
18
18
|
import { ResponsiveBreadcrumbTokens } from '../components/Breadcrumb/breadcrumb.tokens';
|
|
19
|
-
import {
|
|
19
|
+
import { ResponsivePopoverTokens } from '../components/Popover/popover.tokens';
|
|
20
20
|
import { ResponsiveMenuTokensType } from '../components/Menu/menu.tokens';
|
|
21
21
|
import { ResponsiveMultiSelectTokens } from '../components/MultiSelect/multiSelect.tokens';
|
|
22
22
|
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.tokens';
|
|
@@ -24,19 +24,23 @@ import { ResponsiveTableTokens } from '../components/DataTable/dataTable.tokens'
|
|
|
24
24
|
import { ResponsiveCalendarTokens } from '../components/DateRangePicker/dateRangePicker.tokens';
|
|
25
25
|
import { ResponsiveAccordionTokens } from '../components/Accordion/accordion.tokens';
|
|
26
26
|
import { ResponsiveStatCardTokens } from '../components/StatCard/statcard.tokens';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
27
|
+
import { ResponsiveProgressBarTokens } from '../components/ProgressBar/progressbar.tokens';
|
|
28
|
+
import { ResponsiveDrawerTokens } from '../components/Drawer/drawer.tokens';
|
|
29
29
|
import { ResponsiveChartTokens } from '../components/Charts/chart.tokens';
|
|
30
30
|
import { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens';
|
|
31
31
|
import { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens';
|
|
32
32
|
import { ResponsiveCardTokens } from '../components/Card/card.tokens';
|
|
33
33
|
import { ResponsiveTopbarTokens } from '../components/Topbar/topbar.tokens';
|
|
34
|
+
import { ResponsiveAvatarTokens } from '../components/Avatar/avatar.tokens';
|
|
35
|
+
import { ResponsiveAvatarGroupTokens } from '../components/AvatarGroup/avatarGroup.tokens';
|
|
36
|
+
import { ResponsiveSidebarTokens } from '../components/Sidebar/sidebar.tokens';
|
|
37
|
+
import { ResponsiveCodeBlockTokens } from '../components/CodeBlock/codeBlock.token';
|
|
34
38
|
import { ThemeType } from '../tokens';
|
|
35
39
|
import { BREAKPOINTS } from '../breakpoints/breakPoints';
|
|
36
40
|
import { ResponsiveSkeletonTokens } from '../components/Skeleton/skeleton.tokens';
|
|
37
41
|
export type ComponentTokenType = {
|
|
38
42
|
TAGS?: ResponsiveTagTokens;
|
|
39
|
-
SEARCH_INPUT?:
|
|
43
|
+
SEARCH_INPUT?: ResponsiveSearchInputTokens;
|
|
40
44
|
TEXT_AREA?: ResponsiveTextAreaTokens;
|
|
41
45
|
RADIO?: ResponsiveRadioTokens;
|
|
42
46
|
SWITCH?: ResponsiveSwitchTokens;
|
|
@@ -46,14 +50,14 @@ export type ComponentTokenType = {
|
|
|
46
50
|
OTP_INPUT?: ResponsiveOTPInputTokens;
|
|
47
51
|
TOOLTIP?: ResponsiveTooltipTokens;
|
|
48
52
|
UNIT_INPUT?: ResponsiveUnitInputTokens;
|
|
49
|
-
MULTI_VALUE_INPUT?:
|
|
53
|
+
MULTI_VALUE_INPUT?: ResponsiveMultiValueInputTokens;
|
|
50
54
|
DROPDOWN_INPUT?: ResponsiveDropdownInputTokens;
|
|
51
55
|
CHECKBOX?: ResponsiveCheckboxTokens;
|
|
52
56
|
TABS?: ResponsiveTabsTokens;
|
|
53
57
|
BUTTON?: ResponsiveButtonTokens;
|
|
54
|
-
MODAL?:
|
|
58
|
+
MODAL?: ResponsiveModalTokens;
|
|
55
59
|
BREADCRUMB?: ResponsiveBreadcrumbTokens;
|
|
56
|
-
POPOVER?:
|
|
60
|
+
POPOVER?: ResponsivePopoverTokens;
|
|
57
61
|
MENU?: ResponsiveMenuTokensType;
|
|
58
62
|
MULTI_SELECT?: ResponsiveMultiSelectTokens;
|
|
59
63
|
SINGLE_SELECT?: ResponsiveSingleSelectTokens;
|
|
@@ -61,14 +65,18 @@ export type ComponentTokenType = {
|
|
|
61
65
|
CALENDAR?: ResponsiveCalendarTokens;
|
|
62
66
|
ACCORDION?: ResponsiveAccordionTokens;
|
|
63
67
|
STAT_CARD?: ResponsiveStatCardTokens;
|
|
64
|
-
PROGRESS_BAR?:
|
|
65
|
-
DRAWER?:
|
|
68
|
+
PROGRESS_BAR?: ResponsiveProgressBarTokens;
|
|
69
|
+
DRAWER?: ResponsiveDrawerTokens;
|
|
66
70
|
CHARTS?: ResponsiveChartTokens;
|
|
67
71
|
SNACKBAR?: ResponsiveSnackbarTokens;
|
|
68
72
|
KEYVALUEPAIR?: ResponsiveKeyValuePairTokens;
|
|
69
73
|
CARD?: ResponsiveCardTokens;
|
|
70
74
|
SKELETON?: ResponsiveSkeletonTokens;
|
|
71
75
|
TOPBAR?: ResponsiveTopbarTokens;
|
|
76
|
+
AVATAR?: ResponsiveAvatarTokens;
|
|
77
|
+
AVATAR_GROUP?: ResponsiveAvatarGroupTokens;
|
|
78
|
+
SIDEBAR?: ResponsiveSidebarTokens;
|
|
79
|
+
CODE_BLOCK?: ResponsiveCodeBlockTokens;
|
|
72
80
|
};
|
|
73
81
|
type ThemeContextType = {
|
|
74
82
|
foundationTokens: ThemeType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResponsiveSearchInputTokens } from '../components/Inputs/SearchInput/searchInput.tokens';
|
|
2
2
|
import { ResponsiveTextAreaTokens } from '../components/Inputs/TextArea/textarea.token';
|
|
3
3
|
import { ResponsiveTagTokens } from '../components/Tags/tag.tokens';
|
|
4
4
|
import { ResponsiveRadioTokens } from '../components/Radio/radio.token';
|
|
@@ -12,20 +12,19 @@ import { ResponsiveAlertTokens } from '../components/Alert/alert.tokens';
|
|
|
12
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
|
-
import {
|
|
15
|
+
import { ResponsiveMultiValueInputTokens } from '../components/Inputs/MultiValueInput/multiValueInput.tokens';
|
|
16
16
|
import { ResponsiveDropdownInputTokens } from '../components/Inputs/DropdownInput/dropdownInput.tokens';
|
|
17
17
|
import { ResponsiveButtonTokens } from '../components/Button/button.tokens';
|
|
18
|
-
import {
|
|
18
|
+
import { ResponsiveModalTokens } from '../components/Modal/modal.tokens';
|
|
19
19
|
import { ResponsiveBreadcrumbTokens } from '../components/Breadcrumb/breadcrumb.tokens';
|
|
20
|
-
import {
|
|
20
|
+
import { ResponsivePopoverTokens } from '../components/Popover/popover.tokens';
|
|
21
21
|
import { ResponsiveMenuTokensType } from '../components/Menu/menu.tokens';
|
|
22
22
|
import { ResponsiveMultiSelectTokens } from '../components/MultiSelect/multiSelect.tokens';
|
|
23
23
|
import { ResponsiveTableTokens } from '../components/DataTable/dataTable.tokens';
|
|
24
24
|
import { ResponsiveCalendarTokens } from '../components/DateRangePicker/dateRangePicker.tokens';
|
|
25
25
|
import { ResponsiveAccordionTokens } from '../components/Accordion/accordion.tokens';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { DrawerTokensType } from '../components/Drawer/drawer.tokens';
|
|
26
|
+
import { ResponsiveProgressBarTokens } from '../components/ProgressBar/progressbar.tokens';
|
|
27
|
+
import { ResponsiveDrawerTokens } from '../components/Drawer/drawer.tokens';
|
|
29
28
|
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.tokens';
|
|
30
29
|
import { ResponsiveChartTokens } from '../components/Charts/chart.tokens';
|
|
31
30
|
import { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens';
|
|
@@ -33,4 +32,9 @@ import { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValu
|
|
|
33
32
|
import { ResponsiveCardTokens } from '../components/Card/card.tokens';
|
|
34
33
|
import { ResponsiveSkeletonTokens } from '../components/Skeleton/skeleton.tokens';
|
|
35
34
|
import { ResponsiveTopbarTokens } from '../components/Topbar/topbar.tokens';
|
|
36
|
-
|
|
35
|
+
import { ResponsiveAvatarTokens } from '../components/Avatar/avatar.tokens';
|
|
36
|
+
import { ResponsiveAvatarGroupTokens } from '../components/AvatarGroup/avatarGroup.tokens';
|
|
37
|
+
import { ResponsiveStatCardTokens } from '../components/StatCard/statcard.tokens';
|
|
38
|
+
import { ResponsiveSidebarTokens } from '../components/Sidebar/sidebar.tokens';
|
|
39
|
+
import { ResponsiveCodeBlockTokens } from '../components/CodeBlock/codeBlock.token';
|
|
40
|
+
export declare const useComponentToken: (component: keyof ComponentTokenType) => ResponsiveSearchInputTokens | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens | ResponsiveOTPInputTokens | ResponsiveUnitInputTokens | ResponsiveMultiValueInputTokens | ResponsiveSwitchTokens | ResponsiveCheckboxTokens | ResponsiveTabsTokens | ResponsiveTooltipTokens | ResponsiveDropdownInputTokens | ResponsiveButtonTokens | ResponsiveModalTokens | ResponsiveBreadcrumbTokens | ResponsivePopoverTokens | ResponsiveMenuTokensType | ResponsiveMultiSelectTokens | ResponsiveSingleSelectTokens | ResponsiveTableTokens | ResponsiveCalendarTokens | ResponsiveAccordionTokens | ResponsiveStatCardTokens | ResponsiveProgressBarTokens | ResponsiveDrawerTokens | ResponsiveChartTokens | ResponsiveSnackbarTokens | ResponsiveKeyValuePairTokens | ResponsiveCardTokens | ResponsiveSkeletonTokens | ResponsiveTopbarTokens | ResponsiveAvatarTokens | ResponsiveAvatarGroupTokens | ResponsiveSidebarTokens | ResponsiveCodeBlockTokens;
|