@juspay/blend-design-system 0.0.36-beta.1 → 0.0.36
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/ChartsV2/chartV2.types.d.ts +9 -11
- package/dist/components/DataTable/dataTable.tokens.d.ts +11 -0
- package/dist/components/DataTable/types.d.ts +1 -0
- package/dist/components/KeyValuePairV2/KeyValuePairLayout.d.ts +24 -0
- package/dist/components/KeyValuePairV2/KeyValuePairV2.d.ts +23 -0
- package/dist/components/KeyValuePairV2/ResponsiveText.d.ts +20 -0
- package/dist/components/KeyValuePairV2/index.d.ts +3 -0
- package/dist/components/KeyValuePairV2/keyValuePairV2.dark.tokens.d.ts +3 -0
- package/dist/components/KeyValuePairV2/keyValuePairV2.light.tokens.d.ts +3 -0
- package/dist/components/KeyValuePairV2/keyValuePairV2.tokens.d.ts +28 -0
- package/dist/components/KeyValuePairV2/keyValuePairV2.types.d.ts +28 -0
- package/dist/components/KeyValuePairV2/responsiveTextStyles.d.ts +4 -0
- package/dist/components/KeyValuePairV2/utils.d.ts +15 -0
- package/dist/components/MultiSelectV2/MobileMultiSelectV2.d.ts +1 -0
- package/dist/components/MultiSelectV2/MultiSelectV2.d.ts +6 -0
- package/dist/components/MultiSelectV2/MultiSelectV2Menu.d.ts +6 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuActions.d.ts +23 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuHeader.d.ts +25 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuItem.d.ts +11 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuItems.d.ts +17 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuSearch.d.ts +14 -0
- package/dist/components/MultiSelectV2/MultiSelectV2MenuVirtualList.d.ts +22 -0
- package/dist/components/MultiSelectV2/MultiSelectV2SelectAllItem.d.ts +9 -0
- package/dist/components/MultiSelectV2/MultiSelectV2Skeleton.d.ts +8 -0
- package/dist/components/MultiSelectV2/MultiSelectV2SubMenu.d.ts +9 -0
- package/dist/components/MultiSelectV2/MultiSelectV2Trigger.d.ts +30 -0
- package/dist/components/MultiSelectV2/index.d.ts +14 -0
- package/dist/components/MultiSelectV2/mobile/MobileMultiSelectV2.d.ts +3 -0
- package/dist/components/MultiSelectV2/mobile/mobileMultiSelectV2.utils.d.ts +8 -0
- package/dist/components/MultiSelectV2/multiSelectV2.dark.tokens.d.ts +3 -0
- package/dist/components/MultiSelectV2/multiSelectV2.light.tokens.d.ts +3 -0
- package/dist/components/MultiSelectV2/multiSelectV2.tokens.d.ts +216 -0
- package/dist/components/MultiSelectV2/multiSelectV2.types.d.ts +124 -0
- package/dist/components/MultiSelectV2/utils.d.ts +23 -0
- package/dist/components/PopoverV2/MobilePopoverV2.d.ts +7 -0
- package/dist/components/PopoverV2/PopoverV2.d.ts +23 -0
- package/dist/components/PopoverV2/PopoverV2Footer.d.ts +12 -0
- package/dist/components/PopoverV2/PopoverV2Header.d.ts +14 -0
- package/dist/components/PopoverV2/PopoverV2Skeleton.d.ts +21 -0
- package/dist/components/PopoverV2/index.d.ts +3 -0
- package/dist/components/PopoverV2/popoverV2.dark.tokens.d.ts +3 -0
- package/dist/components/PopoverV2/popoverV2.light.tokens.d.ts +3 -0
- package/dist/components/PopoverV2/popoverV2.token.d.ts +72 -0
- package/dist/components/PopoverV2/popoverV2.types.d.ts +59 -0
- package/dist/components/Select/SelectItem/types.d.ts +2 -0
- package/dist/components/SelectV2/SelectItemV2.d.ts +3 -0
- package/dist/components/SelectV2/index.d.ts +4 -0
- package/dist/components/SelectV2/selectV2.constants.d.ts +7 -0
- package/dist/components/SelectV2/selectV2.shared.types.d.ts +96 -0
- package/dist/components/SelectV2/selectV2.tokenStates.d.ts +2 -0
- package/dist/components/SelectV2/types.d.ts +89 -0
- package/dist/components/SelectV2/useSelectV2MenuBehavior.d.ts +24 -0
- package/dist/components/SelectorV2/RadioV2/RadioV2.d.ts +22 -0
- package/dist/components/SelectorV2/RadioV2/StyledRadioV2.d.ts +9 -0
- package/dist/components/SelectorV2/RadioV2/index.d.ts +3 -0
- package/dist/components/SelectorV2/RadioV2/radioV2.dark.tokens.d.ts +3 -0
- package/dist/components/SelectorV2/RadioV2/radioV2.light.tokens.d.ts +3 -0
- package/dist/components/SelectorV2/RadioV2/radioV2.tokens.d.ts +83 -0
- package/dist/components/SelectorV2/RadioV2/radioV2.types.d.ts +39 -0
- package/dist/components/SelectorV2/SwitchV2/SwitchV2.d.ts +1 -1
- package/dist/components/SelectorV2/SwitchV2/switchV2.tokens.d.ts +5 -5
- package/dist/components/SelectorV2/SwitchV2/switchV2.types.d.ts +1 -2
- package/dist/components/SelectorsContent/SelectorsContent.types.d.ts +3 -4
- package/dist/components/SingleSelectV2/MobileSingleSelectV2.d.ts +5 -0
- package/dist/components/SingleSelectV2/SingleSelectV2.d.ts +6 -0
- package/dist/components/SingleSelectV2/SingleSelectV2List.d.ts +3 -0
- package/dist/components/SingleSelectV2/SingleSelectV2Menu.d.ts +6 -0
- package/dist/components/SingleSelectV2/SingleSelectV2MenuItems.d.ts +17 -0
- package/dist/components/SingleSelectV2/SingleSelectV2Search.d.ts +3 -0
- package/dist/components/SingleSelectV2/SingleSelectV2Skeleton.d.ts +8 -0
- package/dist/components/SingleSelectV2/SingleSelectV2Trigger.d.ts +28 -0
- package/dist/components/SingleSelectV2/SingleSelectV2VirtualList.d.ts +3 -0
- package/dist/components/SingleSelectV2/index.d.ts +11 -0
- package/dist/components/SingleSelectV2/mobile/SingleSelectV2MobileItem.d.ts +10 -0
- package/dist/components/SingleSelectV2/mobile/singleSelectV2.mobile.utils.d.ts +3 -0
- package/dist/components/SingleSelectV2/singleSelectV2.animations.d.ts +3 -0
- package/dist/components/SingleSelectV2/singleSelectV2.dark.tokens.d.ts +3 -0
- package/dist/components/SingleSelectV2/singleSelectV2.light.tokens.d.ts +3 -0
- package/dist/components/SingleSelectV2/singleSelectV2.tokens.d.ts +162 -0
- package/dist/components/SingleSelectV2/singleSelectV2.types.d.ts +142 -0
- package/dist/components/SingleSelectV2/utils.d.ts +78 -0
- package/dist/components/TooltipV2/TooltipV2.d.ts +3 -0
- package/dist/components/TooltipV2/index.d.ts +3 -0
- package/dist/components/TooltipV2/tooltipV2.animation.d.ts +1 -0
- package/dist/components/TooltipV2/tooltipV2.dark.tokens.d.ts +3 -0
- package/dist/components/TooltipV2/tooltipV2.light.tokens.d.ts +3 -0
- package/dist/components/TooltipV2/tooltipV2.tokens.d.ts +37 -0
- package/dist/components/TooltipV2/tooltipV2.types.d.ts +38 -0
- package/dist/components/common/index.d.ts +3 -0
- package/dist/context/ThemeContext.d.ts +12 -0
- package/dist/context/useComponentToken.d.ts +6 -1
- package/dist/global-utils/GlobalUtils.d.ts +5 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +35234 -31979
- package/dist/tokens/theme.token.d.ts +2 -0
- package/dist/tokens/zIndex.tokens.d.ts +11 -0
- package/package.json +2 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
|
+
import { MultiSelectV2Size, MultiSelectV2SelectionTagType, MultiSelectV2Variant } from './multiSelectV2.types';
|
|
5
|
+
import { Theme } from '../../context/theme.enum';
|
|
6
|
+
import { SelectV2ItemStates, SelectV2TriggerStates } from '../SelectV2/selectV2.tokenStates';
|
|
7
|
+
type StateToken<T> = Record<SelectV2ItemStates, T>;
|
|
8
|
+
type TriggerStateToken<T> = Record<SelectV2TriggerStates, T>;
|
|
9
|
+
type VariantToken<T> = Record<MultiSelectV2Variant, T>;
|
|
10
|
+
type SizeToken<T> = Record<MultiSelectV2Size, T>;
|
|
11
|
+
type SelectionTagTypeToken<T> = Record<MultiSelectV2SelectionTagType, T>;
|
|
12
|
+
export type MultiSelectV2TriggerStates = SelectV2TriggerStates;
|
|
13
|
+
export type MultiSelectV2ItemStates = SelectV2ItemStates;
|
|
14
|
+
export type MultiSelectV2TokensType = {
|
|
15
|
+
gap: CSSObject['gap'];
|
|
16
|
+
label: {
|
|
17
|
+
fontSize: CSSObject['fontSize'];
|
|
18
|
+
fontWeight: CSSObject['fontWeight'];
|
|
19
|
+
color: StateToken<CSSObject['color']>;
|
|
20
|
+
};
|
|
21
|
+
subLabel: {
|
|
22
|
+
fontSize: CSSObject['fontSize'];
|
|
23
|
+
fontWeight: CSSObject['fontWeight'];
|
|
24
|
+
color: StateToken<CSSObject['color']>;
|
|
25
|
+
};
|
|
26
|
+
hintText: {
|
|
27
|
+
fontSize: CSSObject['fontSize'];
|
|
28
|
+
fontWeight: CSSObject['fontWeight'];
|
|
29
|
+
color: StateToken<CSSObject['color']>;
|
|
30
|
+
};
|
|
31
|
+
errorMessage: {
|
|
32
|
+
fontSize: CSSObject['fontSize'];
|
|
33
|
+
fontWeight: CSSObject['fontWeight'];
|
|
34
|
+
color: CSSObject['color'];
|
|
35
|
+
};
|
|
36
|
+
required: {
|
|
37
|
+
color: CSSObject['color'];
|
|
38
|
+
};
|
|
39
|
+
trigger: {
|
|
40
|
+
height: SizeToken<VariantToken<CSSObject['height']>>;
|
|
41
|
+
padding: SizeToken<VariantToken<{
|
|
42
|
+
top: CSSObject['paddingTop'];
|
|
43
|
+
right: CSSObject['paddingRight'];
|
|
44
|
+
bottom: CSSObject['paddingBottom'];
|
|
45
|
+
left: CSSObject['paddingLeft'];
|
|
46
|
+
}>>;
|
|
47
|
+
borderRadius: SizeToken<VariantToken<CSSObject['borderRadius']>>;
|
|
48
|
+
boxShadow: VariantToken<CSSObject['boxShadow']>;
|
|
49
|
+
backgroundColor: VariantToken<TriggerStateToken<CSSObject['backgroundColor']>>;
|
|
50
|
+
outline: VariantToken<TriggerStateToken<CSSObject['outline']>>;
|
|
51
|
+
slot: {
|
|
52
|
+
gap: CSSObject['gap'];
|
|
53
|
+
width: CSSObject['width'];
|
|
54
|
+
};
|
|
55
|
+
selectionTag: VariantToken<SelectionTagTypeToken<{
|
|
56
|
+
color: CSSObject['color'];
|
|
57
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
58
|
+
fontWeight: CSSObject['fontWeight'];
|
|
59
|
+
paddingTop: CSSObject['paddingTop'];
|
|
60
|
+
paddingRight: CSSObject['paddingRight'];
|
|
61
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
62
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
63
|
+
}>> & {
|
|
64
|
+
marginLeft: CSSObject['margin'];
|
|
65
|
+
borderRadius: CSSObject['borderRadius'];
|
|
66
|
+
};
|
|
67
|
+
chevron: {
|
|
68
|
+
gap: CSSObject['gap'];
|
|
69
|
+
width: CSSObject['width'];
|
|
70
|
+
height: CSSObject['height'];
|
|
71
|
+
iconSize?: number;
|
|
72
|
+
};
|
|
73
|
+
clearButton?: {
|
|
74
|
+
backgroundColor: TriggerStateToken<CSSObject['backgroundColor']>;
|
|
75
|
+
outline: TriggerStateToken<CSSObject['outline']>;
|
|
76
|
+
color: CSSObject['color'];
|
|
77
|
+
width?: CSSObject['width'];
|
|
78
|
+
};
|
|
79
|
+
floatingLabel: {
|
|
80
|
+
paddingTop: CSSObject['paddingTop'];
|
|
81
|
+
paddingRight: CSSObject['paddingRight'];
|
|
82
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
83
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
84
|
+
};
|
|
85
|
+
placeholder: {
|
|
86
|
+
color: CSSObject['color'];
|
|
87
|
+
fontSize: CSSObject['fontSize'];
|
|
88
|
+
fontWeight: CSSObject['fontWeight'];
|
|
89
|
+
};
|
|
90
|
+
selectedValue: {
|
|
91
|
+
color: CSSObject['color'];
|
|
92
|
+
fontSize: CSSObject['fontSize'];
|
|
93
|
+
fontWeight: CSSObject['fontWeight'];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
menu: {
|
|
97
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
98
|
+
border: CSSObject['border'];
|
|
99
|
+
borderRadius: CSSObject['borderRadius'];
|
|
100
|
+
padding: SizeToken<VariantToken<{
|
|
101
|
+
top: CSSObject['paddingTop'];
|
|
102
|
+
right: CSSObject['paddingRight'];
|
|
103
|
+
bottom: CSSObject['paddingBottom'];
|
|
104
|
+
left: CSSObject['paddingLeft'];
|
|
105
|
+
}>>;
|
|
106
|
+
minWidth: CSSObject['minWidth'];
|
|
107
|
+
scroll: {
|
|
108
|
+
height: CSSObject['height'];
|
|
109
|
+
maxHeight: CSSObject['maxHeight'];
|
|
110
|
+
};
|
|
111
|
+
header: {
|
|
112
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
113
|
+
borderBottom: CSSObject['borderBottom'];
|
|
114
|
+
selectAllRowPaddingLeft: CSSObject['paddingLeft'];
|
|
115
|
+
selectAllRowPaddingRight: CSSObject['paddingRight'];
|
|
116
|
+
};
|
|
117
|
+
selectAll: {
|
|
118
|
+
paddingTop: CSSObject['paddingTop'];
|
|
119
|
+
paddingRight: CSSObject['paddingRight'];
|
|
120
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
121
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
122
|
+
borderRadius: CSSObject['borderRadius'];
|
|
123
|
+
};
|
|
124
|
+
list: {
|
|
125
|
+
paddingTop: CSSObject['paddingTop'];
|
|
126
|
+
paddingRight: CSSObject['paddingRight'];
|
|
127
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
128
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
129
|
+
};
|
|
130
|
+
actions: {
|
|
131
|
+
paddingTop: CSSObject['paddingTop'];
|
|
132
|
+
paddingRight: CSSObject['paddingRight'];
|
|
133
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
134
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
135
|
+
gap: CSSObject['gap'];
|
|
136
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
137
|
+
borderTop: CSSObject['borderTop'];
|
|
138
|
+
};
|
|
139
|
+
item: {
|
|
140
|
+
paddingTop: CSSObject['paddingTop'];
|
|
141
|
+
paddingRight: CSSObject['paddingRight'];
|
|
142
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
143
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
144
|
+
margin: CSSObject['margin'];
|
|
145
|
+
borderRadius: CSSObject['borderRadius'];
|
|
146
|
+
gap: CSSObject['gap'];
|
|
147
|
+
backgroundColor: StateToken<CSSObject['backgroundColor']>;
|
|
148
|
+
optionsLabel: {
|
|
149
|
+
fontSize: CSSObject['fontSize'];
|
|
150
|
+
fontWeight: CSSObject['fontWeight'];
|
|
151
|
+
color: StateToken<CSSObject['color']>;
|
|
152
|
+
paddingTop: CSSObject['paddingTop'];
|
|
153
|
+
paddingRight: CSSObject['paddingRight'];
|
|
154
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
155
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
156
|
+
};
|
|
157
|
+
option: {
|
|
158
|
+
fontSize: CSSObject['fontSize'];
|
|
159
|
+
fontWeight: CSSObject['fontWeight'];
|
|
160
|
+
color: StateToken<CSSObject['color']>;
|
|
161
|
+
};
|
|
162
|
+
description: {
|
|
163
|
+
fontSize: CSSObject['fontSize'];
|
|
164
|
+
fontWeight: CSSObject['fontWeight'];
|
|
165
|
+
color: StateToken<CSSObject['color']>;
|
|
166
|
+
};
|
|
167
|
+
seperator: {
|
|
168
|
+
color: CSSObject['color'];
|
|
169
|
+
height: CSSObject['height'];
|
|
170
|
+
margin: CSSObject['margin'];
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
subMenu: {
|
|
175
|
+
trigger: {
|
|
176
|
+
paddingTop: CSSObject['paddingTop'];
|
|
177
|
+
paddingRight: CSSObject['paddingRight'];
|
|
178
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
179
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
180
|
+
margin: CSSObject['margin'];
|
|
181
|
+
borderRadius: CSSObject['borderRadius'];
|
|
182
|
+
};
|
|
183
|
+
content: {
|
|
184
|
+
borderRadius: CSSObject['borderRadius'];
|
|
185
|
+
paddingTop: CSSObject['paddingTop'];
|
|
186
|
+
paddingRight: CSSObject['paddingRight'];
|
|
187
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
188
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
drawer: {
|
|
192
|
+
header: {
|
|
193
|
+
paddingTop: CSSObject['paddingTop'];
|
|
194
|
+
paddingRight: CSSObject['paddingRight'];
|
|
195
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
196
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
197
|
+
borderBottom: CSSObject['borderBottom'];
|
|
198
|
+
};
|
|
199
|
+
search: {
|
|
200
|
+
paddingTop: CSSObject['paddingTop'];
|
|
201
|
+
paddingRight: CSSObject['paddingRight'];
|
|
202
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
203
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
204
|
+
marginTop: CSSObject['margin'];
|
|
205
|
+
marginBottom: CSSObject['margin'];
|
|
206
|
+
};
|
|
207
|
+
content: {
|
|
208
|
+
gap: CSSObject['gap'];
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
export type ResponsiveMultiSelectV2Tokens = {
|
|
213
|
+
[key in keyof BreakpointType]: MultiSelectV2TokensType;
|
|
214
|
+
};
|
|
215
|
+
export declare const getMultiSelectV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveMultiSelectV2Tokens;
|
|
216
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { SelectV2FlattenedItemBase, SelectV2BaseItemType, SelectV2MenuRootPropsBase, SelectV2SkeletonProps, SelectV2Size, SelectV2Variant } from '../SelectV2/selectV2.shared.types';
|
|
4
|
+
import { SelectV2MenuDimensions, SelectV2TriggerDimensions, SelectV2MenuPosition, SelectV2ErrorState, SelectV2SearchConfig } from '../SingleSelectV2/singleSelectV2.types';
|
|
5
|
+
export { SelectV2Alignment as MultiSelectV2Alignment, SelectV2Variant as MultiSelectV2Variant, SelectV2Size as MultiSelectV2Size, SelectV2Side as MultiSelectV2Side, } from '../SelectV2/selectV2.shared.types';
|
|
6
|
+
export type { SelectV2SkeletonProps as MultiSelectV2SkeletonProps };
|
|
7
|
+
export type { SelectV2MenuDimensions, SelectV2TriggerDimensions, SelectV2MenuPosition, SelectV2ErrorState, SelectV2SearchConfig, };
|
|
8
|
+
export declare enum MultiSelectV2SelectionTagType {
|
|
9
|
+
COUNT = "count",
|
|
10
|
+
TEXT = "text"
|
|
11
|
+
}
|
|
12
|
+
export type MultiSelectV2ItemType = SelectV2BaseItemType & {
|
|
13
|
+
alwaysSelected?: boolean;
|
|
14
|
+
subMenu?: MultiSelectV2ItemType[];
|
|
15
|
+
};
|
|
16
|
+
export type MultiSelectV2GroupType = {
|
|
17
|
+
groupLabel?: string;
|
|
18
|
+
items: MultiSelectV2ItemType[];
|
|
19
|
+
showSeparator?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type FlattenedMultiSelectV2Item = SelectV2FlattenedItemBase<MultiSelectV2ItemType>;
|
|
22
|
+
export type MultiSelectV2MenuProps = {
|
|
23
|
+
items: MultiSelectV2GroupType[];
|
|
24
|
+
selected: string[];
|
|
25
|
+
onSelect: (value: string) => void;
|
|
26
|
+
trigger: ReactElement;
|
|
27
|
+
menuDimensions?: SelectV2MenuDimensions;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
search?: SelectV2SearchConfig;
|
|
30
|
+
enableSelectAll?: boolean;
|
|
31
|
+
selectAllText?: string;
|
|
32
|
+
onSelectAll?: (selectAll: boolean, filteredItems: MultiSelectV2GroupType[]) => void;
|
|
33
|
+
maxSelections?: number;
|
|
34
|
+
menuPosition?: SelectV2MenuPosition;
|
|
35
|
+
collisionBoundary?: DropdownMenuContentProps['collisionBoundary'];
|
|
36
|
+
open?: boolean;
|
|
37
|
+
onOpenChange?: (open: boolean) => void;
|
|
38
|
+
showActionButtons?: boolean;
|
|
39
|
+
primaryAction?: {
|
|
40
|
+
text: string;
|
|
41
|
+
onClick: (selectedValues: string[]) => void;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
};
|
|
45
|
+
secondaryAction?: {
|
|
46
|
+
text: string;
|
|
47
|
+
onClick: () => void;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
};
|
|
51
|
+
enableVirtualization?: boolean;
|
|
52
|
+
virtualListItemHeight?: number;
|
|
53
|
+
virtualListOverscan?: number;
|
|
54
|
+
onEndReached?: () => void;
|
|
55
|
+
endReachedThreshold?: number;
|
|
56
|
+
hasMore?: boolean;
|
|
57
|
+
loadingComponent?: ReactNode;
|
|
58
|
+
skeleton?: SelectV2SkeletonProps;
|
|
59
|
+
size?: SelectV2Size;
|
|
60
|
+
variant?: SelectV2Variant;
|
|
61
|
+
allowCustomValue?: boolean;
|
|
62
|
+
customValueLabel?: string;
|
|
63
|
+
menuId?: string;
|
|
64
|
+
};
|
|
65
|
+
export type MenuRootProps = SelectV2MenuRootPropsBase & {
|
|
66
|
+
onInteractOutside?: (e: Event) => void;
|
|
67
|
+
onPointerDownOutside?: (e: Event) => void;
|
|
68
|
+
};
|
|
69
|
+
export type MultiSelectV2Props = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'style' | 'className' | 'onChange' | 'slot'> & {
|
|
70
|
+
selectedValues: string[];
|
|
71
|
+
onChange: (value: string | string[]) => void;
|
|
72
|
+
items?: MultiSelectV2GroupType[];
|
|
73
|
+
label: string;
|
|
74
|
+
subLabel?: string;
|
|
75
|
+
helpIconText?: string;
|
|
76
|
+
required?: boolean;
|
|
77
|
+
variant?: SelectV2Variant;
|
|
78
|
+
selectionTagType?: MultiSelectV2SelectionTagType;
|
|
79
|
+
slot?: ReactNode;
|
|
80
|
+
hintText?: string;
|
|
81
|
+
placeholder: string;
|
|
82
|
+
size?: SelectV2Size;
|
|
83
|
+
search?: SelectV2SearchConfig;
|
|
84
|
+
enableSelectAll?: boolean;
|
|
85
|
+
selectAllText?: string;
|
|
86
|
+
maxSelections?: number;
|
|
87
|
+
customTrigger?: ReactElement;
|
|
88
|
+
usePanelOnMobile?: boolean;
|
|
89
|
+
triggerDimensions?: SelectV2TriggerDimensions;
|
|
90
|
+
menuDimensions?: SelectV2MenuDimensions;
|
|
91
|
+
menuPosition?: SelectV2MenuPosition;
|
|
92
|
+
inline?: boolean;
|
|
93
|
+
onOpenChange?: (open: boolean) => void;
|
|
94
|
+
error?: SelectV2ErrorState;
|
|
95
|
+
showActionButtons?: boolean;
|
|
96
|
+
primaryAction?: {
|
|
97
|
+
text: string;
|
|
98
|
+
onClick: (selectedValues: string[]) => void;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
loading?: boolean;
|
|
101
|
+
};
|
|
102
|
+
secondaryAction?: {
|
|
103
|
+
text: string;
|
|
104
|
+
onClick: () => void;
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
loading?: boolean;
|
|
107
|
+
};
|
|
108
|
+
showItemDividers?: boolean;
|
|
109
|
+
showHeaderBorder?: boolean;
|
|
110
|
+
enableVirtualization?: boolean;
|
|
111
|
+
virtualListItemHeight?: number;
|
|
112
|
+
virtualListOverscan?: number;
|
|
113
|
+
itemsToRender?: number;
|
|
114
|
+
onEndReached?: () => void;
|
|
115
|
+
endReachedThreshold?: number;
|
|
116
|
+
hasMore?: boolean;
|
|
117
|
+
loadingComponent?: ReactNode;
|
|
118
|
+
skeleton?: SelectV2SkeletonProps;
|
|
119
|
+
allowCustomValue?: boolean;
|
|
120
|
+
customValueLabel?: string;
|
|
121
|
+
showClearButton?: boolean;
|
|
122
|
+
onClearAllClick?: () => void;
|
|
123
|
+
multiSelectGroupPosition?: 'center' | 'left' | 'right';
|
|
124
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MultiSelectV2TokensType } from './multiSelectV2.tokens';
|
|
2
|
+
import { MultiSelectV2Size, MultiSelectV2Variant, FlattenedMultiSelectV2Item, MultiSelectV2GroupType, MultiSelectV2ItemType } from './multiSelectV2.types';
|
|
3
|
+
export declare const getSelectAllState: (selected: string[], availableValues: string[]) => {
|
|
4
|
+
allSelected: boolean;
|
|
5
|
+
someSelected: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getValueLabelMap: (groups: MultiSelectV2GroupType[]) => Record<string, string>;
|
|
8
|
+
export declare function getMultiSelectBorderRadius(size: MultiSelectV2Size, variant: MultiSelectV2Variant, multiSelectGroupPosition: 'center' | 'left' | 'right' | undefined, tokens: MultiSelectV2TokensType, shouldShowClearButton: boolean): string;
|
|
9
|
+
export declare function getMultiSelectCrossBorderRadius(size: MultiSelectV2Size, variant: MultiSelectV2Variant, multiSelectGroupPosition: 'center' | 'left' | 'right' | undefined, tokens: MultiSelectV2TokensType): {
|
|
10
|
+
borderRadius: string;
|
|
11
|
+
borderRight?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const getFilteredMenuItem: (item: MultiSelectV2ItemType, queryLower: string) => MultiSelectV2ItemType | null;
|
|
14
|
+
export declare const filterMenuGroups: (groups: MultiSelectV2GroupType[], searchText: string) => MultiSelectV2GroupType[];
|
|
15
|
+
export declare const getAllAvailableValues: (groups: MultiSelectV2GroupType[]) => string[];
|
|
16
|
+
export declare const handleSelectAll: (selectAll: boolean, items: MultiSelectV2GroupType[], selectedValues: string[], onChange: (value: string) => void) => void;
|
|
17
|
+
export declare const flattenMenuGroups: (groups: MultiSelectV2GroupType[]) => FlattenedMultiSelectV2Item[];
|
|
18
|
+
export declare const getTriggerLeftPadding: (tokens: MultiSelectV2TokensType, size: MultiSelectV2Size, variant: MultiSelectV2Variant) => number;
|
|
19
|
+
export declare const getTriggerTopPadding: (tokens: MultiSelectV2TokensType, size: MultiSelectV2Size, variant: MultiSelectV2Variant) => number;
|
|
20
|
+
/** @deprecated Use getTriggerLeftPadding */
|
|
21
|
+
export declare const getTriggerHorizontalPadding: (tokens: MultiSelectV2TokensType, size: MultiSelectV2Size, variant: MultiSelectV2Variant) => number;
|
|
22
|
+
/** @deprecated Use getTriggerTopPadding */
|
|
23
|
+
export declare const getTriggerVerticalPadding: (tokens: MultiSelectV2TokensType, size: MultiSelectV2Size, variant: MultiSelectV2Variant) => number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PopoverV2Props } from './popoverV2.types';
|
|
3
|
+
type MobilePopoverV2Props = PopoverV2Props & {
|
|
4
|
+
useDrawerOnMobile?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const MobilePopoverV2: React.FC<MobilePopoverV2Props>;
|
|
7
|
+
export default MobilePopoverV2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PopoverV2Align, PopoverV2Side, PopoverV2Size } from './popoverV2.types';
|
|
2
|
+
declare const PopoverV2: import('react').ForwardRefExoticComponent<{
|
|
3
|
+
heading?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
trigger: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
showCloseButton?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
asModal?: boolean;
|
|
11
|
+
primaryAction?: import('./popoverV2.types').PopoverV2ActionType;
|
|
12
|
+
secondaryAction?: import('./popoverV2.types').PopoverV2ActionType;
|
|
13
|
+
sideOffset?: number;
|
|
14
|
+
side?: PopoverV2Side;
|
|
15
|
+
align?: PopoverV2Align;
|
|
16
|
+
alignOffset?: number;
|
|
17
|
+
size?: PopoverV2Size;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
useDrawerOnMobile?: boolean;
|
|
20
|
+
avoidCollisions?: boolean;
|
|
21
|
+
skeleton?: import('./popoverV2.types').PopoverV2SkeletonProps;
|
|
22
|
+
} & import('./popoverV2.types').PopoverV2Dimensions & Omit<import('react').HTMLAttributes<HTMLDivElement>, "style" | "className" | "slot"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export default PopoverV2;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PopoverV2TokenType } from './popoverV2.token';
|
|
2
|
+
import { PopoverV2Props } from './popoverV2.types';
|
|
3
|
+
import { SkeletonVariant } from '../Skeleton';
|
|
4
|
+
declare const PopoverV2Footer: {
|
|
5
|
+
({ popoverTokens, primaryAction, secondaryAction, size, showSkeleton, skeletonVariant, }: Pick<PopoverV2Props, "primaryAction" | "secondaryAction" | "size"> & {
|
|
6
|
+
showSkeleton?: boolean;
|
|
7
|
+
skeletonVariant?: SkeletonVariant;
|
|
8
|
+
popoverTokens: PopoverV2TokenType;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default PopoverV2Footer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PopoverV2TokenType } from './popoverV2.token';
|
|
2
|
+
import { PopoverV2Props } from './popoverV2.types';
|
|
3
|
+
import { SkeletonVariant } from '../Skeleton';
|
|
4
|
+
declare const PopoverV2Header: {
|
|
5
|
+
({ popoverTokens, heading, description, showCloseButton, onClose, size, showSkeleton, skeletonVariant, headingId, descriptionId, }: Pick<PopoverV2Props, "heading" | "description" | "showCloseButton" | "size" | "onClose"> & {
|
|
6
|
+
showSkeleton?: boolean;
|
|
7
|
+
skeletonVariant?: SkeletonVariant;
|
|
8
|
+
headingId?: string;
|
|
9
|
+
descriptionId?: string;
|
|
10
|
+
popoverTokens: PopoverV2TokenType;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default PopoverV2Header;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SkeletonVariant } from '../Skeleton';
|
|
2
|
+
import { PopoverV2TokenType } from './popoverV2.token';
|
|
3
|
+
import { PopoverV2Size } from './popoverV2.types';
|
|
4
|
+
declare const PopoverV2Skeleton: ({ popoverTokens, size, headerSkeleton, bodySkeleton, footerSkeleton, skeletonVariant, }: {
|
|
5
|
+
popoverTokens: PopoverV2TokenType;
|
|
6
|
+
size: PopoverV2Size;
|
|
7
|
+
headerSkeleton?: {
|
|
8
|
+
show?: boolean | undefined;
|
|
9
|
+
showCloseButton?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
bodySkeleton?: {
|
|
12
|
+
show: boolean;
|
|
13
|
+
width: string;
|
|
14
|
+
height: string | number;
|
|
15
|
+
};
|
|
16
|
+
footerSkeleton?: {
|
|
17
|
+
show: boolean;
|
|
18
|
+
};
|
|
19
|
+
skeletonVariant: SkeletonVariant;
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
export default PopoverV2Skeleton;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { PopoverV2Size } from './popoverV2.types';
|
|
3
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
import { Theme } from '../../context/theme.enum';
|
|
6
|
+
export type PopoverV2TokenType = {
|
|
7
|
+
background: CSSObject['backgroundColor'];
|
|
8
|
+
border: CSSObject['border'];
|
|
9
|
+
shadow: FoundationTokenType['shadows'];
|
|
10
|
+
gap: {
|
|
11
|
+
[key in PopoverV2Size]: CSSObject['gap'];
|
|
12
|
+
};
|
|
13
|
+
zIndex: CSSObject['zIndex'];
|
|
14
|
+
borderRadius: {
|
|
15
|
+
[key in PopoverV2Size]: CSSObject['borderRadius'];
|
|
16
|
+
};
|
|
17
|
+
padding: {
|
|
18
|
+
left: {
|
|
19
|
+
[key in PopoverV2Size]: CSSObject['paddingLeft'];
|
|
20
|
+
};
|
|
21
|
+
right: {
|
|
22
|
+
[key in PopoverV2Size]: CSSObject['paddingRight'];
|
|
23
|
+
};
|
|
24
|
+
top: {
|
|
25
|
+
[key in PopoverV2Size]: CSSObject['paddingTop'];
|
|
26
|
+
};
|
|
27
|
+
bottom: {
|
|
28
|
+
[key in PopoverV2Size]: CSSObject['paddingBottom'];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
TopContainer: {
|
|
32
|
+
gap: {
|
|
33
|
+
[key in PopoverV2Size]: CSSObject['gap'];
|
|
34
|
+
};
|
|
35
|
+
heading: {
|
|
36
|
+
color: CSSObject['color'];
|
|
37
|
+
fontSize: {
|
|
38
|
+
[key in PopoverV2Size]: CSSObject['fontSize'];
|
|
39
|
+
};
|
|
40
|
+
fontWeight: {
|
|
41
|
+
[key in PopoverV2Size]: CSSObject['fontWeight'];
|
|
42
|
+
};
|
|
43
|
+
lineHeight: {
|
|
44
|
+
[key in PopoverV2Size]: CSSObject['lineHeight'];
|
|
45
|
+
};
|
|
46
|
+
IconSize: {
|
|
47
|
+
[key in PopoverV2Size]: CSSObject['size'];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
description: {
|
|
51
|
+
color: CSSObject['color'];
|
|
52
|
+
fontSize: {
|
|
53
|
+
[key in PopoverV2Size]: CSSObject['fontSize'];
|
|
54
|
+
};
|
|
55
|
+
fontWeight: {
|
|
56
|
+
[key in PopoverV2Size]: CSSObject['fontWeight'];
|
|
57
|
+
};
|
|
58
|
+
lineHeight: {
|
|
59
|
+
[key in PopoverV2Size]: CSSObject['lineHeight'];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
bottomContainer: {
|
|
64
|
+
gap: {
|
|
65
|
+
[key in PopoverV2Size]: CSSObject['gap'];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type ResponsivePopoverV2Tokens = {
|
|
70
|
+
[key in keyof BreakpointType]: PopoverV2TokenType;
|
|
71
|
+
};
|
|
72
|
+
export declare const getPopoverV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsivePopoverV2Tokens;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ButtonProps } from '../Button';
|
|
2
|
+
import { SkeletonVariant } from '../Skeleton';
|
|
3
|
+
export type PopoverV2ActionType = Omit<ButtonProps, 'buttonGroupPosition' | 'subType'>;
|
|
4
|
+
export declare enum PopoverV2Size {
|
|
5
|
+
SM = "sm",
|
|
6
|
+
MD = "md",
|
|
7
|
+
LG = "lg"
|
|
8
|
+
}
|
|
9
|
+
export declare enum PopoverV2Side {
|
|
10
|
+
TOP = "top",
|
|
11
|
+
RIGHT = "right",
|
|
12
|
+
BOTTOM = "bottom",
|
|
13
|
+
LEFT = "left"
|
|
14
|
+
}
|
|
15
|
+
export declare enum PopoverV2Align {
|
|
16
|
+
START = "start",
|
|
17
|
+
CENTER = "center",
|
|
18
|
+
END = "end"
|
|
19
|
+
}
|
|
20
|
+
type BodySkeletonV2Props = {
|
|
21
|
+
show?: boolean;
|
|
22
|
+
width?: string;
|
|
23
|
+
height?: string | number;
|
|
24
|
+
};
|
|
25
|
+
export type PopoverV2SkeletonProps = {
|
|
26
|
+
show?: boolean;
|
|
27
|
+
variant?: SkeletonVariant;
|
|
28
|
+
bodySkeletonProps?: BodySkeletonV2Props;
|
|
29
|
+
};
|
|
30
|
+
export type PopoverV2Dimensions = {
|
|
31
|
+
width?: number;
|
|
32
|
+
maxWidth?: number;
|
|
33
|
+
minWidth?: number;
|
|
34
|
+
height?: number;
|
|
35
|
+
minHeight?: number;
|
|
36
|
+
maxHeight?: number;
|
|
37
|
+
};
|
|
38
|
+
export type PopoverV2Props = {
|
|
39
|
+
heading?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
trigger: React.ReactNode;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
showCloseButton?: boolean;
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
open?: boolean;
|
|
46
|
+
asModal?: boolean;
|
|
47
|
+
primaryAction?: PopoverV2ActionType;
|
|
48
|
+
secondaryAction?: PopoverV2ActionType;
|
|
49
|
+
sideOffset?: number;
|
|
50
|
+
side?: PopoverV2Side;
|
|
51
|
+
align?: PopoverV2Align;
|
|
52
|
+
alignOffset?: number;
|
|
53
|
+
size?: PopoverV2Size;
|
|
54
|
+
onClose?: () => void;
|
|
55
|
+
useDrawerOnMobile?: boolean;
|
|
56
|
+
avoidCollisions?: boolean;
|
|
57
|
+
skeleton?: PopoverV2SkeletonProps;
|
|
58
|
+
} & PopoverV2Dimensions & Omit<React.HTMLAttributes<HTMLDivElement>, 'slot' | 'className' | 'style'>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as SelectItemV2 } from './SelectItemV2';
|
|
2
|
+
export type { SelectItemV2Props, SingleSelectItemV2Props, MultiSelectItemV2Props, SelectV2ItemType, SelectV2MenuItemTokensBase, } from './types';
|
|
3
|
+
export { SELECT_V2_MENU_Z_INDEX } from './selectV2.constants';
|
|
4
|
+
export * from './selectV2.shared.types';
|