@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
import { DiffLineType } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* CodeBlock Tokens following the pattern: [target].CSSProp.[variant].[state]
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: container | header | gutter | code | syntax (defines what element the token applies to)
|
|
10
|
+
* - CSSProp: backgroundColor | border | borderRadius | padding | color | fontSize | fontFamily | lineHeight
|
|
11
|
+
* - variant: default | removed | added (for diff-specific styles)
|
|
12
|
+
* - state: default | hover | active (for interactive elements)
|
|
13
|
+
* Need to check for this — Rust, Haskel, resript, python
|
|
14
|
+
* Size-independent properties: all properties are size-independent for CodeBlock
|
|
15
|
+
*/
|
|
16
|
+
export type CodeBlockTokenType = {
|
|
17
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
18
|
+
border: CSSObject['border'];
|
|
19
|
+
borderRadius: CSSObject['borderRadius'];
|
|
20
|
+
boxShadow: CSSObject['boxShadow'];
|
|
21
|
+
header: {
|
|
22
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
23
|
+
borderBottom: CSSObject['borderBottom'];
|
|
24
|
+
padding: {
|
|
25
|
+
x: CSSObject['padding'];
|
|
26
|
+
y: CSSObject['padding'];
|
|
27
|
+
};
|
|
28
|
+
gap: CSSObject['gap'];
|
|
29
|
+
icon: {
|
|
30
|
+
width: CSSObject['width'];
|
|
31
|
+
};
|
|
32
|
+
text: {
|
|
33
|
+
fontSize: CSSObject['fontSize'];
|
|
34
|
+
fontWeight: CSSObject['fontWeight'];
|
|
35
|
+
lineHeight: CSSObject['lineHeight'];
|
|
36
|
+
color: CSSObject['color'];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
body: {
|
|
40
|
+
padding: {
|
|
41
|
+
x: CSSObject['padding'];
|
|
42
|
+
y: CSSObject['padding'];
|
|
43
|
+
};
|
|
44
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
45
|
+
gutter: {
|
|
46
|
+
width: CSSObject['width'];
|
|
47
|
+
color: CSSObject['color'];
|
|
48
|
+
backgroundColor: {
|
|
49
|
+
[key in DiffLineType]: CSSObject['backgroundColor'];
|
|
50
|
+
};
|
|
51
|
+
borderLeft: {
|
|
52
|
+
[key in DiffLineType]: CSSObject['borderLeft'];
|
|
53
|
+
};
|
|
54
|
+
borderColor: {
|
|
55
|
+
[key in DiffLineType]: CSSObject['color'];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
code: {
|
|
59
|
+
fontFamily: CSSObject['fontFamily'];
|
|
60
|
+
fontSize: CSSObject['fontSize'];
|
|
61
|
+
lineHeight: CSSObject['lineHeight'];
|
|
62
|
+
padding: {
|
|
63
|
+
x: {
|
|
64
|
+
left: CSSObject['paddingLeft'];
|
|
65
|
+
right: CSSObject['paddingRight'];
|
|
66
|
+
};
|
|
67
|
+
y: CSSObject['padding'];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
highlightedLine: {
|
|
71
|
+
backgroundColor: {
|
|
72
|
+
[key in DiffLineType]: CSSObject['backgroundColor'];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
syntax: {
|
|
76
|
+
keyword: CSSObject['color'];
|
|
77
|
+
function: CSSObject['color'];
|
|
78
|
+
string: CSSObject['color'];
|
|
79
|
+
number: CSSObject['color'];
|
|
80
|
+
operator: CSSObject['color'];
|
|
81
|
+
variable: CSSObject['color'];
|
|
82
|
+
comment: CSSObject['color'];
|
|
83
|
+
text: CSSObject['color'];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export type ResponsiveCodeBlockTokens = {
|
|
88
|
+
[key in keyof BreakpointType]: CodeBlockTokenType;
|
|
89
|
+
};
|
|
90
|
+
export declare const getCodeBlockTokens: (foundationToken: FoundationTokenType) => ResponsiveCodeBlockTokens;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare enum CodeBlockVariant {
|
|
3
|
+
DEFAULT = "default",
|
|
4
|
+
NO_GUTTER = "no-gutter",
|
|
5
|
+
DIFF = "diff"
|
|
6
|
+
}
|
|
7
|
+
export declare enum DiffLineType {
|
|
8
|
+
ADDED = "added",
|
|
9
|
+
REMOVED = "removed",
|
|
10
|
+
UNCHANGED = "unchanged"
|
|
11
|
+
}
|
|
12
|
+
export interface DiffLine {
|
|
13
|
+
content: string;
|
|
14
|
+
type: DiffLineType;
|
|
15
|
+
}
|
|
16
|
+
export type CodeBlockProps = {
|
|
17
|
+
code: string;
|
|
18
|
+
variant?: CodeBlockVariant;
|
|
19
|
+
showLineNumbers?: boolean;
|
|
20
|
+
showHeader?: boolean;
|
|
21
|
+
header?: string;
|
|
22
|
+
headerLeftSlot?: ReactNode;
|
|
23
|
+
headerRightSlot?: ReactNode;
|
|
24
|
+
diffLines?: DiffLine[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CodeBlockTokenType } from './codeBlock.token';
|
|
2
|
+
import { DiffLineType, DiffLine } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Token interface for syntax highlighting
|
|
5
|
+
*/
|
|
6
|
+
export interface SyntaxToken {
|
|
7
|
+
type: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Tokenizes a line of code for syntax highlighting
|
|
12
|
+
* Supports multiple languages: JavaScript/TypeScript, Python, Rust, Haskell
|
|
13
|
+
*/
|
|
14
|
+
export declare const tokenizeLine: (line: string) => SyntaxToken[];
|
|
15
|
+
/**
|
|
16
|
+
* Gets the color for a token type based on syntax highlighting rules
|
|
17
|
+
*/
|
|
18
|
+
export declare const getTokenColor: (type: string, syntaxTokens: CodeBlockTokenType["body"]["syntax"]) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the gutter (line number) styling for diff mode
|
|
21
|
+
*/
|
|
22
|
+
export declare const getDiffGutterStyle: (lineType: DiffLineType | undefined, isDiffMode: boolean, gutterTokens: CodeBlockTokenType["body"]["gutter"]) => React.CSSProperties;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the highlighted line background styling for diff mode
|
|
25
|
+
*/
|
|
26
|
+
export declare const getDiffLineBackground: (lineType: DiffLineType | undefined, isDiffMode: boolean, highlightedLineTokens: CodeBlockTokenType["body"]["highlightedLine"]) => React.CSSProperties;
|
|
27
|
+
/**
|
|
28
|
+
* Determines if line numbers should be shown based on variant and explicit prop
|
|
29
|
+
*/
|
|
30
|
+
export declare const shouldShowLineNumbers: (showLineNumbers: boolean | undefined, variant: string) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a copy to clipboard function with state management
|
|
33
|
+
*/
|
|
34
|
+
export declare const createCopyToClipboard: (code: string, setIsCopied: (copied: boolean) => void) => () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Processes lines for diff or normal mode
|
|
37
|
+
*/
|
|
38
|
+
export declare const processLines: (isDiffMode: boolean, diffLines: DiffLine[] | undefined, code: string) => string[] | undefined;
|
|
@@ -2,6 +2,7 @@ import { ColumnDefinition, SearchConfig, AdvancedFilterProps } from '../types';
|
|
|
2
2
|
export type DataTableHeaderProps<T extends Record<string, unknown>> = {
|
|
3
3
|
title?: string;
|
|
4
4
|
description?: string;
|
|
5
|
+
showHeader?: boolean;
|
|
5
6
|
showToolbar?: boolean;
|
|
6
7
|
enableSearch?: boolean;
|
|
7
8
|
searchPlaceholder?: string;
|
|
@@ -7,6 +7,7 @@ export type TableCellProps<T extends Record<string, unknown>> = {
|
|
|
7
7
|
currentValue: unknown;
|
|
8
8
|
width: React.CSSProperties;
|
|
9
9
|
frozenStyles?: React.CSSProperties;
|
|
10
|
+
isFirstRow?: boolean;
|
|
10
11
|
onFieldChange: (value: unknown) => void;
|
|
11
12
|
getDisplayValue?: (value: unknown, column: ColumnDefinition<T>) => unknown;
|
|
12
13
|
};
|
|
@@ -254,6 +254,7 @@ export type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
254
254
|
onPageChange?: (page: number) => void;
|
|
255
255
|
onPageSizeChange?: (pageSize: number) => void;
|
|
256
256
|
isLoading?: boolean;
|
|
257
|
+
showHeader?: boolean;
|
|
257
258
|
showToolbar?: boolean;
|
|
258
259
|
showSettings?: boolean;
|
|
259
260
|
headerSlot1?: ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DateRangePreset, DateRangePickerSize, CustomPresetConfig } from './types';
|
|
2
|
+
import { CalendarTokenType } from './dateRangePicker.tokens';
|
|
2
3
|
type QuickRangeSelectorProps = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
onToggle: () => void;
|
|
@@ -13,6 +14,7 @@ type QuickRangeSelectorProps = {
|
|
|
13
14
|
size?: DateRangePickerSize;
|
|
14
15
|
maxMenuHeight?: number;
|
|
15
16
|
isStandalone?: boolean;
|
|
17
|
+
calendarToken?: CalendarTokenType;
|
|
16
18
|
};
|
|
17
19
|
declare const QuickRangeSelector: import('react').ForwardRefExoticComponent<QuickRangeSelectorProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
20
|
export default QuickRangeSelector;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { CalendarTokenType } from './dateRangePicker.tokens';
|
|
2
3
|
type TimeSelectorProps = {
|
|
3
4
|
value: string;
|
|
4
5
|
onChange: (time: string) => void;
|
|
5
6
|
className?: string;
|
|
6
7
|
autoFocus?: boolean;
|
|
7
8
|
tabIndex?: number;
|
|
9
|
+
calendarToken?: CalendarTokenType;
|
|
8
10
|
};
|
|
9
11
|
declare const TimeSelector: React.ForwardRefExoticComponent<TimeSelectorProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
12
|
export default TimeSelector;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
|
+
/**
|
|
5
|
+
* Mobile DateRangePicker Tokens for mobile-specific components
|
|
6
|
+
*
|
|
7
|
+
* Separate tokens for mobile components that have different styling requirements
|
|
8
|
+
* These tokens are used by ScrollablePicker, ActionButtons, and DatePickerComponent
|
|
9
|
+
*
|
|
10
|
+
* Note: PresetItem now uses SelectItem tokens, tabs use existing Tabs component tokens
|
|
11
|
+
*/
|
|
12
|
+
export type MobileTokenType = {
|
|
13
|
+
picker: {
|
|
14
|
+
itemHeight: CSSObject['height'];
|
|
15
|
+
containerHeight: CSSObject['height'];
|
|
16
|
+
divider: {
|
|
17
|
+
width: CSSObject['width'];
|
|
18
|
+
strokeColor: CSSObject['color'];
|
|
19
|
+
strokeColorEnd: CSSObject['color'];
|
|
20
|
+
};
|
|
21
|
+
text: {
|
|
22
|
+
selected: {
|
|
23
|
+
fontSize: CSSObject['fontSize'];
|
|
24
|
+
fontWeight: CSSObject['fontWeight'];
|
|
25
|
+
color: CSSObject['color'];
|
|
26
|
+
opacity: CSSObject['opacity'];
|
|
27
|
+
};
|
|
28
|
+
unselected: {
|
|
29
|
+
fontSize: CSSObject['fontSize'];
|
|
30
|
+
fontWeight: CSSObject['fontWeight'];
|
|
31
|
+
color: CSSObject['color'];
|
|
32
|
+
opacity: CSSObject['opacity'];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
title: {
|
|
36
|
+
padding: {
|
|
37
|
+
x: CSSObject['padding'];
|
|
38
|
+
y: CSSObject['padding'];
|
|
39
|
+
};
|
|
40
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
41
|
+
text: {
|
|
42
|
+
fontSize: CSSObject['fontSize'];
|
|
43
|
+
fontWeight: CSSObject['fontWeight'];
|
|
44
|
+
color: CSSObject['color'];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
footer: {
|
|
49
|
+
gap: CSSObject['gap'];
|
|
50
|
+
padding: {
|
|
51
|
+
x: CSSObject['padding'];
|
|
52
|
+
y: CSSObject['padding'];
|
|
53
|
+
};
|
|
54
|
+
borderTop: CSSObject['borderTop'];
|
|
55
|
+
};
|
|
56
|
+
padding: {
|
|
57
|
+
x: CSSObject['padding'];
|
|
58
|
+
y: CSSObject['padding'];
|
|
59
|
+
};
|
|
60
|
+
gap: CSSObject['gap'];
|
|
61
|
+
header: {
|
|
62
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
63
|
+
padding: {
|
|
64
|
+
x: CSSObject['padding'];
|
|
65
|
+
y: CSSObject['padding'];
|
|
66
|
+
};
|
|
67
|
+
text: {
|
|
68
|
+
fontSize: CSSObject['fontSize'];
|
|
69
|
+
fontWeight: CSSObject['fontWeight'];
|
|
70
|
+
color: CSSObject['color'];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export type ResponsiveMobileTokens = {
|
|
75
|
+
[key in keyof BreakpointType]: MobileTokenType;
|
|
76
|
+
};
|
|
77
|
+
export declare const getMobileToken: (foundationToken: FoundationTokenType) => ResponsiveMobileTokens;
|