@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
|
@@ -10,35 +10,91 @@ declare enum UnitInputState {
|
|
|
10
10
|
DISABLED = "disabled"
|
|
11
11
|
}
|
|
12
12
|
export type UnitInputTokensType = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
gap: CSSObject['gap'];
|
|
14
|
+
label: {
|
|
15
|
+
fontSize: CSSObject['fontSize'];
|
|
16
|
+
fontWeight: CSSObject['fontWeight'];
|
|
17
|
+
color: {
|
|
18
|
+
[key in UnitInputState]: CSSObject['color'];
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
};
|
|
21
|
+
subLabel: {
|
|
22
|
+
fontSize: CSSObject['fontSize'];
|
|
23
|
+
fontWeight: CSSObject['fontWeight'];
|
|
24
|
+
color: {
|
|
25
|
+
[key in UnitInputState]: CSSObject['color'];
|
|
21
26
|
};
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
};
|
|
28
|
+
helpIcon: {
|
|
29
|
+
width: CSSObject['width'];
|
|
30
|
+
color: {
|
|
31
|
+
[key in UnitInputState]: CSSObject['color'];
|
|
24
32
|
};
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
};
|
|
34
|
+
hintText: {
|
|
35
|
+
fontSize: CSSObject['fontSize'];
|
|
36
|
+
fontWeight: CSSObject['fontWeight'];
|
|
37
|
+
color: {
|
|
38
|
+
[key in UnitInputState]: CSSObject['color'];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
errorMessage: {
|
|
42
|
+
fontSize: CSSObject['fontSize'];
|
|
43
|
+
fontWeight: CSSObject['fontWeight'];
|
|
44
|
+
color: CSSObject['color'];
|
|
45
|
+
};
|
|
46
|
+
required: {
|
|
47
|
+
color: CSSObject['color'];
|
|
48
|
+
};
|
|
49
|
+
inputContainer: {
|
|
50
|
+
fontSize: {
|
|
51
|
+
[key in UnitInputSize]: CSSObject['fontSize'];
|
|
52
|
+
};
|
|
53
|
+
fontWeight: {
|
|
54
|
+
[key in UnitInputSize]: CSSObject['fontWeight'];
|
|
27
55
|
};
|
|
28
56
|
color: {
|
|
29
57
|
[key in UnitInputState]: CSSObject['color'];
|
|
30
58
|
};
|
|
31
|
-
|
|
32
|
-
[key in
|
|
59
|
+
borderRadius: {
|
|
60
|
+
[key in UnitInputSize]: CSSObject['borderRadius'];
|
|
61
|
+
};
|
|
62
|
+
boxShadow: CSSObject['boxShadow'];
|
|
63
|
+
padding: {
|
|
64
|
+
x: {
|
|
65
|
+
[key in UnitInputSize]: CSSObject['padding'];
|
|
66
|
+
};
|
|
67
|
+
y: {
|
|
68
|
+
[key in UnitInputSize]: CSSObject['padding'];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
border: {
|
|
72
|
+
[key in UnitInputState]: CSSObject['border'];
|
|
33
73
|
};
|
|
34
74
|
backgroundColor: {
|
|
35
75
|
[key in UnitInputState]: CSSObject['backgroundColor'];
|
|
36
76
|
};
|
|
77
|
+
unit: {
|
|
78
|
+
fontSize: {
|
|
79
|
+
[key in UnitInputSize]: CSSObject['fontSize'];
|
|
80
|
+
};
|
|
81
|
+
fontWeight: {
|
|
82
|
+
[key in UnitInputSize]: CSSObject['fontWeight'];
|
|
83
|
+
};
|
|
84
|
+
color: {
|
|
85
|
+
[key in UnitInputState]: CSSObject['color'];
|
|
86
|
+
};
|
|
87
|
+
padding: {
|
|
88
|
+
[key in UnitInputSize]: CSSObject['padding'];
|
|
89
|
+
};
|
|
90
|
+
backgroundColor: {
|
|
91
|
+
[key in UnitInputState]: CSSObject['backgroundColor'];
|
|
92
|
+
};
|
|
93
|
+
};
|
|
37
94
|
};
|
|
38
95
|
};
|
|
39
|
-
declare const unitInputTokens: UnitInputTokensType;
|
|
40
96
|
export type ResponsiveUnitInputTokens = {
|
|
41
97
|
[key in keyof BreakpointType]: UnitInputTokensType;
|
|
42
98
|
};
|
|
43
|
-
export declare const getUnitInputTokens: (
|
|
44
|
-
export
|
|
99
|
+
export declare const getUnitInputTokens: (foundationTokens: FoundationTokenType) => ResponsiveUnitInputTokens;
|
|
100
|
+
export {};
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
+
type InputFooterTokens = {
|
|
2
|
+
hintText?: {
|
|
3
|
+
fontWeight?: number | string;
|
|
4
|
+
fontSize?: number | string;
|
|
5
|
+
color?: {
|
|
6
|
+
default?: string;
|
|
7
|
+
disabled?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
errorMessage?: {
|
|
11
|
+
fontWeight?: number | string;
|
|
12
|
+
fontSize?: number | string;
|
|
13
|
+
color?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
1
16
|
type InputFooterProps = {
|
|
2
17
|
error?: boolean;
|
|
3
18
|
errorMessage?: string;
|
|
4
19
|
hintText?: string;
|
|
5
20
|
disabled?: boolean;
|
|
21
|
+
tokens?: InputFooterTokens;
|
|
6
22
|
};
|
|
7
|
-
declare const InputFooter: ({ error, errorMessage, hintText, disabled, }: InputFooterProps) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
23
|
+
declare const InputFooter: ({ error, errorMessage, hintText, disabled, tokens, }: InputFooterProps) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
8
24
|
export default InputFooter;
|
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
type
|
|
1
|
+
type InputLabelTokens = {
|
|
2
|
+
label?: {
|
|
3
|
+
fontWeight?: number | string;
|
|
4
|
+
fontSize?: number | string;
|
|
5
|
+
color?: {
|
|
6
|
+
default?: string;
|
|
7
|
+
disabled?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
subLabel?: {
|
|
11
|
+
fontWeight?: number | string;
|
|
12
|
+
fontSize?: number | string;
|
|
13
|
+
color?: {
|
|
14
|
+
default?: string;
|
|
15
|
+
disabled?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
required?: {
|
|
19
|
+
color?: string;
|
|
20
|
+
};
|
|
21
|
+
helpIcon?: {
|
|
22
|
+
width?: number | string;
|
|
23
|
+
color?: {
|
|
24
|
+
default?: string;
|
|
25
|
+
disabled?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type InputLabelsProps<TTokens extends InputLabelTokens = InputLabelTokens> = {
|
|
2
30
|
label?: string;
|
|
3
31
|
sublabel?: string;
|
|
4
32
|
disabled?: boolean;
|
|
5
33
|
helpIconHintText?: string;
|
|
6
34
|
name?: string;
|
|
7
35
|
required?: boolean;
|
|
36
|
+
tokens?: Partial<TTokens>;
|
|
8
37
|
};
|
|
9
38
|
/**
|
|
10
39
|
* @description InputLabels is a component that displays a label and sublabel for an input field.
|
|
@@ -14,5 +43,5 @@ type InputLabelsProps = {
|
|
|
14
43
|
* @param {string} helpIconHintText - The hint text for the help icon.
|
|
15
44
|
* @param {boolean} required - Whether the input field is required.
|
|
16
45
|
*/
|
|
17
|
-
declare const InputLabels: ({ label, sublabel, disabled, helpIconHintText, name, required, }: InputLabelsProps) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
46
|
+
declare const InputLabels: <TTokens extends InputLabelTokens>({ label, sublabel, disabled, helpIconHintText, name, required, tokens, }: InputLabelsProps<TTokens>) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
18
47
|
export default InputLabels;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuProps } from './types';
|
|
3
3
|
export declare const contentBaseStyle: CSSObject;
|
|
4
4
|
declare const Menu: {
|
|
5
|
-
({ trigger, items, asModal, alignment, side, sideOffset, alignOffset, collisonBoundaryRef, maxHeight, enableSearch, searchPlaceholder, minWidth, maxWidth, open, onOpenChange, enableVirtualScrolling, virtualItemHeight, virtualOverscan, virtualScrollThreshold, }:
|
|
5
|
+
({ trigger, items, asModal, alignment, side, sideOffset, alignOffset, collisonBoundaryRef, maxHeight, enableSearch, searchPlaceholder, minWidth, maxWidth, open, onOpenChange, enableVirtualScrolling, virtualItemHeight, virtualOverscan, virtualScrollThreshold, }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
8
8
|
export default Menu;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MenuItemType } from './types';
|
|
2
2
|
declare const MenuItem: {
|
|
3
3
|
({ item, idx, maxHeight, }: {
|
|
4
|
-
item:
|
|
4
|
+
item: MenuItemType;
|
|
5
5
|
idx: number;
|
|
6
6
|
maxHeight?: number;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MenuItemType } from './types';
|
|
2
2
|
export declare const SubMenu: ({ item, idx, maxHeight, }: {
|
|
3
|
-
item:
|
|
3
|
+
item: MenuItemType;
|
|
4
4
|
idx: number;
|
|
5
5
|
maxHeight?: number;
|
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuItemActionType, MenuItemVariant } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
5
|
export type MenuItemStates = 'default' | 'hover' | 'active' | 'focus' | 'focusVisible' | 'disabled';
|
|
6
6
|
export type MenuTokensType = {
|
|
7
|
-
|
|
7
|
+
boxShadow: CSSObject['boxShadow'];
|
|
8
8
|
backgroundColor: CSSObject['backgroundColor'];
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
padding: {
|
|
10
|
+
x: CSSObject['padding'];
|
|
11
|
+
y: CSSObject['padding'];
|
|
12
|
+
};
|
|
11
13
|
border: CSSObject['border'];
|
|
12
|
-
outline: CSSObject['outline'];
|
|
13
14
|
borderRadius: CSSObject['borderRadius'];
|
|
14
15
|
item: {
|
|
15
|
-
padding:
|
|
16
|
-
|
|
16
|
+
padding: {
|
|
17
|
+
x: CSSObject['padding'];
|
|
18
|
+
y: CSSObject['padding'];
|
|
19
|
+
};
|
|
20
|
+
margin: {
|
|
21
|
+
x: CSSObject['margin'];
|
|
22
|
+
y: CSSObject['margin'];
|
|
23
|
+
};
|
|
17
24
|
borderRadius: CSSObject['borderRadius'];
|
|
18
25
|
backgroundColor: {
|
|
19
|
-
[
|
|
26
|
+
[MenuItemVariant.DEFAULT]: {
|
|
20
27
|
enabled: {
|
|
21
28
|
[key in MenuItemStates]: CSSObject['backgroundColor'];
|
|
22
29
|
};
|
|
@@ -24,8 +31,8 @@ export type MenuTokensType = {
|
|
|
24
31
|
[key in MenuItemStates]: CSSObject['backgroundColor'];
|
|
25
32
|
};
|
|
26
33
|
};
|
|
27
|
-
[
|
|
28
|
-
[key in
|
|
34
|
+
[MenuItemVariant.ACTION]: {
|
|
35
|
+
[key in MenuItemActionType]: {
|
|
29
36
|
enabled: {
|
|
30
37
|
[key in MenuItemStates]: CSSObject['backgroundColor'];
|
|
31
38
|
};
|
|
@@ -35,13 +42,25 @@ export type MenuTokensType = {
|
|
|
35
42
|
};
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
|
-
cursor: CSSObject['cursor'];
|
|
39
45
|
gap: CSSObject['gap'];
|
|
40
|
-
|
|
46
|
+
optionsLabel: {
|
|
47
|
+
fontSize: CSSObject['fontSize'];
|
|
48
|
+
fontWeight: CSSObject['fontWeight'];
|
|
49
|
+
color: CSSObject['color'];
|
|
50
|
+
padding: {
|
|
51
|
+
x: CSSObject['padding'];
|
|
52
|
+
y: CSSObject['padding'];
|
|
53
|
+
};
|
|
54
|
+
margin: {
|
|
55
|
+
x: CSSObject['margin'];
|
|
56
|
+
y: CSSObject['margin'];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
option: {
|
|
41
60
|
fontSize: CSSObject['fontSize'];
|
|
42
61
|
fontWeight: CSSObject['fontWeight'];
|
|
43
62
|
color: {
|
|
44
|
-
[
|
|
63
|
+
[MenuItemVariant.DEFAULT]: {
|
|
45
64
|
enabled: {
|
|
46
65
|
[key in MenuItemStates]: CSSObject['color'];
|
|
47
66
|
};
|
|
@@ -49,8 +68,8 @@ export type MenuTokensType = {
|
|
|
49
68
|
[key in MenuItemStates]: CSSObject['color'];
|
|
50
69
|
};
|
|
51
70
|
};
|
|
52
|
-
[
|
|
53
|
-
[key in
|
|
71
|
+
[MenuItemVariant.ACTION]: {
|
|
72
|
+
[key in MenuItemActionType]: {
|
|
54
73
|
enabled: {
|
|
55
74
|
[key in MenuItemStates]: CSSObject['color'];
|
|
56
75
|
};
|
|
@@ -61,11 +80,11 @@ export type MenuTokensType = {
|
|
|
61
80
|
};
|
|
62
81
|
};
|
|
63
82
|
};
|
|
64
|
-
|
|
83
|
+
description: {
|
|
65
84
|
fontSize: CSSObject['fontSize'];
|
|
66
85
|
fontWeight: CSSObject['fontWeight'];
|
|
67
86
|
color: {
|
|
68
|
-
[
|
|
87
|
+
[MenuItemVariant.DEFAULT]: {
|
|
69
88
|
enabled: {
|
|
70
89
|
[key in MenuItemStates]: CSSObject['color'];
|
|
71
90
|
};
|
|
@@ -73,8 +92,8 @@ export type MenuTokensType = {
|
|
|
73
92
|
[key in MenuItemStates]: CSSObject['color'];
|
|
74
93
|
};
|
|
75
94
|
};
|
|
76
|
-
[
|
|
77
|
-
[key in
|
|
95
|
+
[MenuItemVariant.ACTION]: {
|
|
96
|
+
[key in MenuItemActionType]: {
|
|
78
97
|
enabled: {
|
|
79
98
|
[key in MenuItemStates]: CSSObject['color'];
|
|
80
99
|
};
|
|
@@ -85,16 +104,17 @@ export type MenuTokensType = {
|
|
|
85
104
|
};
|
|
86
105
|
};
|
|
87
106
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
seperator: {
|
|
108
|
+
color: CSSObject['color'];
|
|
109
|
+
height: CSSObject['height'];
|
|
110
|
+
margin: {
|
|
111
|
+
x: CSSObject['margin'];
|
|
112
|
+
y: CSSObject['margin'];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
93
115
|
};
|
|
94
116
|
};
|
|
95
117
|
export type ResponsiveMenuTokensType = {
|
|
96
118
|
[key in keyof BreakpointType]: MenuTokensType;
|
|
97
119
|
};
|
|
98
|
-
declare const menuTokens: MenuTokensType;
|
|
99
120
|
export declare const getMenuTokens: (foundationToken: FoundationTokenType) => ResponsiveMenuTokensType;
|
|
100
|
-
export default menuTokens;
|
|
@@ -10,9 +10,9 @@ export declare enum MenuSide {
|
|
|
10
10
|
RIGHT = "right",
|
|
11
11
|
BOTTOM = "bottom"
|
|
12
12
|
}
|
|
13
|
-
export type
|
|
13
|
+
export type MenuProps = {
|
|
14
14
|
trigger: React.ReactNode;
|
|
15
|
-
items?:
|
|
15
|
+
items?: MenuGroupType[];
|
|
16
16
|
maxHeight?: number;
|
|
17
17
|
minHeight?: number;
|
|
18
18
|
maxWidth?: number;
|
|
@@ -20,7 +20,7 @@ export type MenuV2Props = {
|
|
|
20
20
|
enableSearch?: boolean;
|
|
21
21
|
searchPlaceholder?: string;
|
|
22
22
|
enableVirtualScrolling?: boolean;
|
|
23
|
-
virtualItemHeight?: number | ((item:
|
|
23
|
+
virtualItemHeight?: number | ((item: MenuItemType, index: number) => number);
|
|
24
24
|
virtualOverscan?: number;
|
|
25
25
|
virtualScrollThreshold?: number;
|
|
26
26
|
open?: boolean;
|
|
@@ -32,26 +32,26 @@ export type MenuV2Props = {
|
|
|
32
32
|
alignOffset?: number;
|
|
33
33
|
collisonBoundaryRef?: Element | null | Array<Element | null>;
|
|
34
34
|
};
|
|
35
|
-
export declare enum
|
|
35
|
+
export declare enum MenuItemVariant {
|
|
36
36
|
DEFAULT = "default",
|
|
37
37
|
ACTION = "action"
|
|
38
38
|
}
|
|
39
|
-
export declare enum
|
|
39
|
+
export declare enum MenuItemActionType {
|
|
40
40
|
PRIMARY = "primary",
|
|
41
41
|
DANGER = "danger"
|
|
42
42
|
}
|
|
43
|
-
export type
|
|
43
|
+
export type MenuItemType = {
|
|
44
44
|
label: string;
|
|
45
45
|
subLabel?: string;
|
|
46
46
|
slot1?: React.ReactNode;
|
|
47
47
|
slot2?: React.ReactNode;
|
|
48
48
|
slot3?: React.ReactNode;
|
|
49
49
|
slot4?: React.ReactNode;
|
|
50
|
-
variant?:
|
|
51
|
-
actionType?:
|
|
50
|
+
variant?: MenuItemVariant;
|
|
51
|
+
actionType?: MenuItemActionType;
|
|
52
52
|
disabled?: boolean;
|
|
53
53
|
onClick?: () => void;
|
|
54
|
-
subMenu?:
|
|
54
|
+
subMenu?: MenuItemType[];
|
|
55
55
|
enableSubMenuSearch?: boolean;
|
|
56
56
|
subMenuSearchPlaceholder?: string;
|
|
57
57
|
tooltip?: string | React.ReactNode;
|
|
@@ -64,8 +64,8 @@ export type MenuItemV2Type = {
|
|
|
64
64
|
offset?: number;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
export type
|
|
67
|
+
export type MenuGroupType = {
|
|
68
68
|
label?: string;
|
|
69
|
-
items:
|
|
69
|
+
items: MenuItemType[];
|
|
70
70
|
showSeparator?: boolean;
|
|
71
71
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const filterMenuGroups: (groups:
|
|
3
|
-
export declare const filterMenuItem: (item:
|
|
1
|
+
import { MenuGroupType, MenuItemType } from './types';
|
|
2
|
+
export declare const filterMenuGroups: (groups: MenuGroupType[], searchText: string) => MenuGroupType[];
|
|
3
|
+
export declare const filterMenuItem: (item: MenuItemType, lower: string) => MenuItemType | null;
|
|
@@ -1,48 +1,74 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
export type ModalState = 'default';
|
|
5
|
+
/**
|
|
6
|
+
* Modal Tokens following the pattern: [target].CSSProp.[state]
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: container | header | body | footer (defines what element the token applies to)
|
|
10
|
+
* - CSSProp: shadow | zIndex | borderRadius | padding | border | backgroundColor | fontSize | fontWeight | color | gap | alignItems
|
|
11
|
+
* - state: default (modal doesn't have interactive states)
|
|
12
|
+
*
|
|
13
|
+
* Pattern examples:
|
|
14
|
+
* - container.shadow
|
|
15
|
+
* - container.zIndex
|
|
16
|
+
* - container.borderRadius
|
|
17
|
+
* - header.padding
|
|
18
|
+
* - header.border
|
|
19
|
+
* - header.backgroundColor
|
|
20
|
+
* - header.text.title.fontSize
|
|
21
|
+
* - header.text.title.fontWeight
|
|
22
|
+
* - header.text.title.color
|
|
23
|
+
* - header.text.subtitle.fontSize
|
|
24
|
+
* - header.text.subtitle.color
|
|
25
|
+
* - body.padding
|
|
26
|
+
* - body.border
|
|
27
|
+
* - body.backgroundColor
|
|
28
|
+
* - footer.padding
|
|
29
|
+
* - footer.border
|
|
30
|
+
* - footer.backgroundColor
|
|
31
|
+
* - footer.alignItems
|
|
32
|
+
* - footer.gap
|
|
33
|
+
*/
|
|
3
34
|
export type ModalTokensType = {
|
|
4
|
-
|
|
5
|
-
zIndex: CSSObject['zIndex'];
|
|
35
|
+
boxShadow: CSSObject['boxShadow'];
|
|
6
36
|
borderRadius: CSSObject['borderRadius'];
|
|
7
|
-
|
|
8
|
-
padding:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
borderLeft: CSSObject['borderLeft'];
|
|
12
|
-
borderRight: CSSObject['borderRight'];
|
|
13
|
-
borderRadius: CSSObject['borderRadius'];
|
|
14
|
-
backgroundColor: CSSObject['backgroundColor'];
|
|
15
|
-
header: {
|
|
16
|
-
color: CSSObject['color'];
|
|
17
|
-
fontSize: CSSObject['fontSize'];
|
|
18
|
-
fontWeight: CSSObject['fontWeight'];
|
|
37
|
+
header: {
|
|
38
|
+
padding: {
|
|
39
|
+
x: CSSObject['padding'];
|
|
40
|
+
y: CSSObject['padding'];
|
|
19
41
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
42
|
+
borderBottom: CSSObject['border'];
|
|
43
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
44
|
+
text: {
|
|
45
|
+
title: {
|
|
46
|
+
color: CSSObject['color'];
|
|
47
|
+
fontSize: CSSObject['fontSize'];
|
|
48
|
+
fontWeight: CSSObject['fontWeight'];
|
|
49
|
+
};
|
|
50
|
+
subtitle: {
|
|
51
|
+
color: CSSObject['color'];
|
|
52
|
+
fontSize: CSSObject['fontSize'];
|
|
53
|
+
fontWeight: CSSObject['fontWeight'];
|
|
54
|
+
};
|
|
23
55
|
};
|
|
24
56
|
};
|
|
25
|
-
|
|
57
|
+
body: {
|
|
26
58
|
padding: CSSObject['padding'];
|
|
27
|
-
borderBottom: CSSObject['borderBottom'];
|
|
28
|
-
borderTop: CSSObject['borderTop'];
|
|
29
|
-
borderLeft: CSSObject['borderLeft'];
|
|
30
|
-
borderRight: CSSObject['borderRight'];
|
|
31
|
-
borderRadius: CSSObject['borderRadius'];
|
|
32
59
|
backgroundColor: CSSObject['backgroundColor'];
|
|
33
60
|
};
|
|
34
|
-
|
|
61
|
+
footer: {
|
|
35
62
|
padding: CSSObject['padding'];
|
|
36
|
-
|
|
37
|
-
borderTop: CSSObject['borderTop'];
|
|
38
|
-
borderLeft: CSSObject['borderLeft'];
|
|
39
|
-
borderRight: CSSObject['borderRight'];
|
|
40
|
-
borderRadius: CSSObject['borderRadius'];
|
|
63
|
+
borderTop: CSSObject['border'];
|
|
41
64
|
backgroundColor: CSSObject['backgroundColor'];
|
|
42
|
-
alignItems: CSSObject['alignItems'];
|
|
43
65
|
gap: CSSObject['gap'];
|
|
44
66
|
};
|
|
67
|
+
closeButton: {
|
|
68
|
+
color: CSSObject['color'];
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type ResponsiveModalTokens = {
|
|
72
|
+
[key in keyof BreakpointType]: ModalTokensType;
|
|
45
73
|
};
|
|
46
|
-
export declare const
|
|
47
|
-
export declare const getModalComponentTokens: (foundationToken: FoundationTokenType) => ModalTokensType;
|
|
48
|
-
export default modalTokens;
|
|
74
|
+
export declare const getModalComponentTokens: (foundationToken: FoundationTokenType) => ResponsiveModalTokens;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type ModalButtonAction = Omit<
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
|
+
type ModalButtonAction = Omit<ButtonProps, 'buttonGroupPosition'>;
|
|
4
4
|
export type ModalProps = {
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
onClose: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiSelectMenuProps } from './types';
|
|
2
|
-
declare const MultiSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, disabled, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, onSelectAll, alignment, side, sideOffset, alignOffset, open, onOpenChange, showActionButtons, primaryAction, secondaryAction, enableVirtualization, virtualListItemHeight, virtualListOverscan,
|
|
2
|
+
declare const MultiSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, disabled, enableSearch, searchPlaceholder, enableSelectAll, selectAllText, maxSelections, onSelectAll, alignment, side, sideOffset, alignOffset, open, onOpenChange, showActionButtons, primaryAction, secondaryAction, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, }: MultiSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultiSelectMenu;
|