@juspay/blend-design-system 0.0.15 → 0.0.16-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/Charts/types.d.ts +5 -0
- package/dist/components/Checkbox/checkbox.token.d.ts +19 -4
- package/dist/components/Checkbox/types.d.ts +11 -2
- package/dist/components/KeyValuePair/KeyValuePair.d.ts +3 -0
- package/dist/components/KeyValuePair/KeyValuePair.tokens.d.ts +19 -0
- package/dist/components/KeyValuePair/index.d.ts +2 -0
- package/dist/components/KeyValuePair/types.d.ts +19 -0
- package/dist/components/Sidebar/types.d.ts +3 -0
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/types.d.ts +4 -0
- package/dist/components/Switch/types.d.ts +1 -1
- package/dist/components/Topbar/Topbar.d.ts +3 -0
- package/dist/components/Topbar/index.d.ts +2 -0
- package/dist/components/Topbar/topbar.tokens.d.ts +87 -0
- package/dist/components/Topbar/types.d.ts +26 -0
- package/dist/context/ThemeContext.d.ts +9 -5
- package/dist/context/useComponentToken.d.ts +3 -1
- package/dist/main.js +15104 -14530
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { ThemeType } from '../../tokens';
|
|
3
|
-
import {
|
|
3
|
+
import { CheckboxSize, CheckboxInteractionState } from './types';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
5
|
export type CheckboxTokensType = {
|
|
6
6
|
gap: CSSObject['gap'];
|
|
@@ -14,7 +14,13 @@ export type CheckboxTokensType = {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
background: {
|
|
17
|
-
|
|
17
|
+
checked?: {
|
|
18
|
+
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
19
|
+
};
|
|
20
|
+
unchecked?: {
|
|
21
|
+
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
22
|
+
};
|
|
23
|
+
indeterminate?: {
|
|
18
24
|
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
19
25
|
};
|
|
20
26
|
};
|
|
@@ -22,7 +28,13 @@ export type CheckboxTokensType = {
|
|
|
22
28
|
radius: CSSObject['borderRadius'];
|
|
23
29
|
width: CSSObject['borderWidth'];
|
|
24
30
|
color: {
|
|
25
|
-
|
|
31
|
+
checked?: {
|
|
32
|
+
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
33
|
+
};
|
|
34
|
+
unchecked?: {
|
|
35
|
+
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
36
|
+
};
|
|
37
|
+
indeterminate?: {
|
|
26
38
|
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
27
39
|
};
|
|
28
40
|
};
|
|
@@ -36,7 +48,10 @@ export type CheckboxTokensType = {
|
|
|
36
48
|
};
|
|
37
49
|
icon: {
|
|
38
50
|
color: {
|
|
39
|
-
|
|
51
|
+
checked?: {
|
|
52
|
+
[key in Extract<CheckboxInteractionState, 'default' | 'disabled'>]?: CSSObject['color'];
|
|
53
|
+
};
|
|
54
|
+
indeterminate?: {
|
|
40
55
|
[key in Extract<CheckboxInteractionState, 'default' | 'disabled'>]?: CSSObject['color'];
|
|
41
56
|
};
|
|
42
57
|
};
|
|
@@ -3,8 +3,17 @@ export declare enum CheckboxSize {
|
|
|
3
3
|
SMALL = "sm",
|
|
4
4
|
MEDIUM = "md"
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export declare enum CheckboxCheckedState {
|
|
7
|
+
CHECKED = "checked",
|
|
8
|
+
UNCHECKED = "unchecked",
|
|
9
|
+
INDETERMINATE = "indeterminate"
|
|
10
|
+
}
|
|
11
|
+
export declare enum CheckboxInteractionState {
|
|
12
|
+
DEFAULT = "default",
|
|
13
|
+
HOVER = "hover",
|
|
14
|
+
DISABLED = "disabled",
|
|
15
|
+
ERROR = "error"
|
|
16
|
+
}
|
|
8
17
|
export type CheckboxProps = {
|
|
9
18
|
id?: string;
|
|
10
19
|
value?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
3
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { KeyValuePairSize, KeyValuePairStateType } from './types';
|
|
5
|
+
export type KeyValuePairTokensType = {
|
|
6
|
+
gap: CSSObject['gap'];
|
|
7
|
+
keyColor: CSSObject['color'];
|
|
8
|
+
valueColor: CSSObject['color'];
|
|
9
|
+
keyFontSize: CSSObject['fontSize'];
|
|
10
|
+
valueFontSize: {
|
|
11
|
+
[key in KeyValuePairSize]: {
|
|
12
|
+
[key in KeyValuePairStateType]: CSSObject['fontSize'];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type ResponsiveKeyValuePairTokens = {
|
|
17
|
+
[key in keyof BreakpointType]: KeyValuePairTokensType;
|
|
18
|
+
};
|
|
19
|
+
export declare const getKeyValuePairTokens: (foundationToken: FoundationTokenType) => ResponsiveKeyValuePairTokens;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum KeyValuePairStateType {
|
|
2
|
+
vertical = 0,
|
|
3
|
+
horizontal = 1
|
|
4
|
+
}
|
|
5
|
+
export declare enum KeyValuePairSize {
|
|
6
|
+
SMALL = "sm",
|
|
7
|
+
MEDIUM = "md",
|
|
8
|
+
LARGE = "lg"
|
|
9
|
+
}
|
|
10
|
+
export type KeyValuePairPropTypes = {
|
|
11
|
+
keyString: string;
|
|
12
|
+
size?: KeyValuePairSize;
|
|
13
|
+
value?: string;
|
|
14
|
+
keySlot?: React.ReactNode;
|
|
15
|
+
valueLeftSlot?: React.ReactNode;
|
|
16
|
+
valueRightSlot?: React.ReactNode;
|
|
17
|
+
keyValuePairState?: KeyValuePairStateType;
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DirectoryData } from '../Directory/types';
|
|
3
|
+
import { MerchantInfo } from '../Topbar/types';
|
|
3
4
|
export type LeftPanelItem = {
|
|
4
5
|
label: string;
|
|
5
6
|
icon: ReactNode;
|
|
@@ -19,4 +20,6 @@ export type SidebarProps = {
|
|
|
19
20
|
footer?: ReactNode;
|
|
20
21
|
sidebarTopSlot?: ReactNode;
|
|
21
22
|
sidebarCollapseKey?: string;
|
|
23
|
+
merchantInfo?: MerchantInfo;
|
|
24
|
+
rightActions?: ReactNode;
|
|
22
25
|
};
|
|
@@ -2,5 +2,5 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { Toaster as Snackbar } from 'sonner';
|
|
3
3
|
import { AddToastOptions, CustomToastProps } from './types';
|
|
4
4
|
export declare const StyledToast: React.FC<CustomToastProps>;
|
|
5
|
-
export declare const addSnackbar: ({ header, description, variant, onClose, actionButton, }: AddToastOptions) => string | number;
|
|
5
|
+
export declare const addSnackbar: ({ header, description, variant, onClose, actionButton, duration, }: AddToastOptions) => string | number;
|
|
6
6
|
export default Snackbar;
|
|
@@ -12,7 +12,9 @@ export type AddToastOptions = {
|
|
|
12
12
|
actionButton?: {
|
|
13
13
|
label: string;
|
|
14
14
|
onClick: () => void;
|
|
15
|
+
autoDismiss?: boolean;
|
|
15
16
|
};
|
|
17
|
+
duration?: number;
|
|
16
18
|
};
|
|
17
19
|
export type CustomToastProps = {
|
|
18
20
|
header: string;
|
|
@@ -22,5 +24,7 @@ export type CustomToastProps = {
|
|
|
22
24
|
actionButton?: {
|
|
23
25
|
label: string;
|
|
24
26
|
onClick: () => void;
|
|
27
|
+
autoDismiss?: boolean;
|
|
25
28
|
};
|
|
29
|
+
toastId?: string | number;
|
|
26
30
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
export type TopbarState = 'default' | 'hover' | 'active';
|
|
5
|
+
export type TopbarTokensType = {
|
|
6
|
+
height: CSSObject['height'];
|
|
7
|
+
position: CSSObject['position'];
|
|
8
|
+
top: CSSObject['top'];
|
|
9
|
+
zIndex: CSSObject['zIndex'];
|
|
10
|
+
borderBottom: CSSObject['borderBottom'];
|
|
11
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
12
|
+
backdropFilter: CSSObject['backdropFilter'];
|
|
13
|
+
padding: CSSObject['padding'];
|
|
14
|
+
gap: CSSObject['gap'];
|
|
15
|
+
toggleButton: {
|
|
16
|
+
borderRadius: CSSObject['borderRadius'];
|
|
17
|
+
padding: CSSObject['padding'];
|
|
18
|
+
backgroundColor: {
|
|
19
|
+
[key in TopbarState]: CSSObject['backgroundColor'];
|
|
20
|
+
};
|
|
21
|
+
transition: CSSObject['transition'];
|
|
22
|
+
icon: {
|
|
23
|
+
size: CSSObject['width'];
|
|
24
|
+
color: CSSObject['color'];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
actionButton: {
|
|
28
|
+
borderRadius: CSSObject['borderRadius'];
|
|
29
|
+
padding: CSSObject['padding'];
|
|
30
|
+
minWidth: CSSObject['minWidth'];
|
|
31
|
+
height: CSSObject['height'];
|
|
32
|
+
backgroundColor: {
|
|
33
|
+
[key in TopbarState]: CSSObject['backgroundColor'];
|
|
34
|
+
};
|
|
35
|
+
transition: CSSObject['transition'];
|
|
36
|
+
icon: {
|
|
37
|
+
size: CSSObject['width'];
|
|
38
|
+
color: CSSObject['color'];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
tenantIconButton: {
|
|
42
|
+
borderRadius: CSSObject['borderRadius'];
|
|
43
|
+
minHeight: CSSObject['minHeight'];
|
|
44
|
+
backgroundColor: {
|
|
45
|
+
[key in TopbarState]: CSSObject['backgroundColor'];
|
|
46
|
+
};
|
|
47
|
+
transition: CSSObject['transition'];
|
|
48
|
+
};
|
|
49
|
+
merchantSelectTrigger: {
|
|
50
|
+
gap: CSSObject['gap'];
|
|
51
|
+
icon: {
|
|
52
|
+
size: CSSObject['width'];
|
|
53
|
+
color: CSSObject['color'];
|
|
54
|
+
};
|
|
55
|
+
text: {
|
|
56
|
+
fontSize: CSSObject['fontSize'];
|
|
57
|
+
fontWeight: CSSObject['fontWeight'];
|
|
58
|
+
color: CSSObject['color'];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
leftSection: {
|
|
62
|
+
gap: CSSObject['gap'];
|
|
63
|
+
maxHeight: CSSObject['maxHeight'];
|
|
64
|
+
divider: {
|
|
65
|
+
fontSize: CSSObject['fontSize'];
|
|
66
|
+
fontWeight: CSSObject['fontWeight'];
|
|
67
|
+
color: CSSObject['color'];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
centerSection: {
|
|
71
|
+
title: {
|
|
72
|
+
fontSize: CSSObject['fontSize'];
|
|
73
|
+
fontWeight: CSSObject['fontWeight'];
|
|
74
|
+
color: CSSObject['color'];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
rightSection: {
|
|
78
|
+
gap: CSSObject['gap'];
|
|
79
|
+
};
|
|
80
|
+
sidebarSection: {
|
|
81
|
+
gap: CSSObject['gap'];
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export type ResponsiveTopbarTokens = {
|
|
85
|
+
[key in keyof BreakpointType]: TopbarTokensType;
|
|
86
|
+
};
|
|
87
|
+
export declare const getTopbarTokens: (foundationToken: FoundationTokenType) => ResponsiveTopbarTokens;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LeftPanelInfo } from '../Sidebar/types';
|
|
3
|
+
export type MerchantInfo = {
|
|
4
|
+
items: Array<{
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
selected: string;
|
|
10
|
+
onSelect: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export type TopbarProps = {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
isExpanded?: boolean;
|
|
15
|
+
onToggleExpansion?: () => void;
|
|
16
|
+
showToggleButton?: boolean;
|
|
17
|
+
sidebarTopSlot?: ReactNode;
|
|
18
|
+
topbar?: ReactNode;
|
|
19
|
+
title?: string;
|
|
20
|
+
leftAction?: ReactNode;
|
|
21
|
+
rightActions?: ReactNode;
|
|
22
|
+
showBackButton?: boolean;
|
|
23
|
+
onBackClick?: () => void;
|
|
24
|
+
leftPanel?: LeftPanelInfo;
|
|
25
|
+
merchantInfo?: MerchantInfo;
|
|
26
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ThemeType } from '../tokens';
|
|
2
|
-
import { ResponsiveTagTokens } from '../components/Tags/tag.tokens';
|
|
3
1
|
import { SearchInputTokensType } from '../components/Inputs/SearchInput/searchInput.tokens';
|
|
2
|
+
import { ResponsiveTagTokens } from '../components/Tags/tag.tokens';
|
|
4
3
|
import { ResponsiveTextAreaTokens } from '../components/Inputs/TextArea/textarea.token';
|
|
5
4
|
import { ResponsiveRadioTokens } from '../components/Radio/radio.token';
|
|
6
5
|
import { ResponsiveSwitchTokens } from '../components/Switch/switch.token';
|
|
@@ -20,17 +19,20 @@ import { ResponsiveBreadcrumbTokens } from '../components/Breadcrumb/breadcrumb.
|
|
|
20
19
|
import { PopoverTokenType } from '../components/Popover/popover.tokens';
|
|
21
20
|
import { ResponsiveMenuTokensType } from '../components/Menu/menu.tokens';
|
|
22
21
|
import { ResponsiveMultiSelectTokens } from '../components/MultiSelect/multiSelect.tokens';
|
|
22
|
+
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.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
26
|
import { ResponsiveStatCardTokens } from '../components/StatCard/statcard.tokens';
|
|
27
27
|
import { ProgressBarTokenType } from '../components/ProgressBar/progressbar.tokens';
|
|
28
28
|
import { DrawerTokensType } from '../components/Drawer/drawer.tokens';
|
|
29
|
-
import { BreakpointType } from '../breakpoints/breakPoints';
|
|
30
|
-
import { ResponsiveSingleSelectTokens } from '../components/SingleSelect/singleSelect.tokens';
|
|
31
29
|
import { ResponsiveChartTokens } from '../components/Charts/chart.tokens';
|
|
32
30
|
import { ResponsiveSnackbarTokens } from '../components/Snackbar/snackbar.tokens';
|
|
31
|
+
import { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens';
|
|
33
32
|
import { ResponsiveCardTokens } from '../components/Card/card.tokens';
|
|
33
|
+
import { ResponsiveTopbarTokens } from '../components/Topbar/topbar.tokens';
|
|
34
|
+
import { ThemeType } from '../tokens';
|
|
35
|
+
import { BREAKPOINTS } from '../breakpoints/breakPoints';
|
|
34
36
|
export type ComponentTokenType = {
|
|
35
37
|
TAGS?: ResponsiveTagTokens;
|
|
36
38
|
SEARCH_INPUT?: SearchInputTokensType;
|
|
@@ -62,12 +64,14 @@ export type ComponentTokenType = {
|
|
|
62
64
|
DRAWER?: DrawerTokensType;
|
|
63
65
|
CHARTS?: ResponsiveChartTokens;
|
|
64
66
|
SNACKBAR?: ResponsiveSnackbarTokens;
|
|
67
|
+
KEYVALUEPAIR?: ResponsiveKeyValuePairTokens;
|
|
65
68
|
CARD?: ResponsiveCardTokens;
|
|
69
|
+
TOPBAR?: ResponsiveTopbarTokens;
|
|
66
70
|
};
|
|
67
71
|
type ThemeContextType = {
|
|
68
72
|
foundationTokens: ThemeType;
|
|
69
73
|
componentTokens: Required<ComponentTokenType>;
|
|
70
|
-
breakpoints:
|
|
74
|
+
breakpoints: typeof BREAKPOINTS;
|
|
71
75
|
};
|
|
72
76
|
declare const ThemeContext: import('react').Context<ThemeContextType>;
|
|
73
77
|
export declare const useTheme: () => ThemeContextType;
|
|
@@ -29,5 +29,7 @@ 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
|
+
import { ResponsiveKeyValuePairTokens } from '../components/KeyValuePair/KeyValuePair.tokens';
|
|
32
33
|
import { ResponsiveCardTokens } from '../components/Card/card.tokens';
|
|
33
|
-
|
|
34
|
+
import { ResponsiveTopbarTokens } from '../components/Topbar/topbar.tokens';
|
|
35
|
+
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 | ResponsiveKeyValuePairTokens | ResponsiveCardTokens | ResponsiveTopbarTokens;
|