@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,96 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, CSSProperties, KeyboardEvent, RefObject } from 'react';
|
|
2
|
+
import { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import { SkeletonVariant } from '../Skeleton';
|
|
4
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
5
|
+
export declare enum SelectV2Alignment {
|
|
6
|
+
START = "start",
|
|
7
|
+
CENTER = "center",
|
|
8
|
+
END = "end"
|
|
9
|
+
}
|
|
10
|
+
export declare enum SelectV2Variant {
|
|
11
|
+
CONTAINER = "container",
|
|
12
|
+
NO_CONTAINER = "no-container"
|
|
13
|
+
}
|
|
14
|
+
export declare enum SelectV2Size {
|
|
15
|
+
SM = "sm",
|
|
16
|
+
MD = "md",
|
|
17
|
+
LG = "lg"
|
|
18
|
+
}
|
|
19
|
+
export declare enum SelectV2Side {
|
|
20
|
+
TOP = "top",
|
|
21
|
+
LEFT = "left",
|
|
22
|
+
RIGHT = "right",
|
|
23
|
+
BOTTOM = "bottom"
|
|
24
|
+
}
|
|
25
|
+
export type SelectV2SkeletonProps = {
|
|
26
|
+
count?: number;
|
|
27
|
+
show?: boolean;
|
|
28
|
+
variant?: SkeletonVariant;
|
|
29
|
+
};
|
|
30
|
+
export type SelectV2TooltipProps = {
|
|
31
|
+
side?: TooltipSide;
|
|
32
|
+
align?: TooltipAlign;
|
|
33
|
+
size?: TooltipSize;
|
|
34
|
+
showArrow?: boolean;
|
|
35
|
+
delayDuration?: number;
|
|
36
|
+
offset?: number;
|
|
37
|
+
};
|
|
38
|
+
export type SelectV2BaseItemType = {
|
|
39
|
+
label: string;
|
|
40
|
+
value: string;
|
|
41
|
+
checked?: boolean;
|
|
42
|
+
subLabel?: string;
|
|
43
|
+
slot1?: ReactNode;
|
|
44
|
+
slot2?: ReactNode;
|
|
45
|
+
slot3?: ReactNode;
|
|
46
|
+
slot4?: ReactNode;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
onClick?: () => void;
|
|
49
|
+
tooltip?: string | ReactNode;
|
|
50
|
+
tooltipProps?: SelectV2TooltipProps;
|
|
51
|
+
disableTruncation?: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type SelectV2FlattenedItemBase<T = unknown> = {
|
|
54
|
+
id: string;
|
|
55
|
+
type: 'item' | 'label' | 'separator';
|
|
56
|
+
item?: T;
|
|
57
|
+
label?: string;
|
|
58
|
+
groupId?: number;
|
|
59
|
+
};
|
|
60
|
+
export type SelectV2PopoverPositioningProps = {
|
|
61
|
+
alignment?: SelectV2Alignment;
|
|
62
|
+
side?: SelectV2Side;
|
|
63
|
+
sideOffset?: number;
|
|
64
|
+
alignOffset?: number;
|
|
65
|
+
collisionBoundary?: DropdownMenuContentProps['collisionBoundary'];
|
|
66
|
+
minPopoverWidth?: number;
|
|
67
|
+
maxPopoverWidth?: number;
|
|
68
|
+
maxPopoverHeight?: number;
|
|
69
|
+
};
|
|
70
|
+
export type SelectV2VirtualizationProps = {
|
|
71
|
+
enableVirtualization?: boolean;
|
|
72
|
+
virtualListItemHeight?: number;
|
|
73
|
+
virtualListOverscan?: number;
|
|
74
|
+
};
|
|
75
|
+
export type SelectV2InfiniteScrollProps = {
|
|
76
|
+
onEndReached?: () => void;
|
|
77
|
+
endReachedThreshold?: number;
|
|
78
|
+
hasMore?: boolean;
|
|
79
|
+
loadingComponent?: ReactNode;
|
|
80
|
+
};
|
|
81
|
+
export type SelectV2MenuRootPropsBase = {
|
|
82
|
+
open: boolean;
|
|
83
|
+
onOpenChange: (open: boolean) => void;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
trigger: ReactElement;
|
|
86
|
+
menuId?: string;
|
|
87
|
+
alignment: SelectV2Alignment;
|
|
88
|
+
side: SelectV2Side;
|
|
89
|
+
sideOffset: number;
|
|
90
|
+
alignOffset: number;
|
|
91
|
+
collisionBoundary?: DropdownMenuContentProps['collisionBoundary'];
|
|
92
|
+
contentStyle: CSSProperties;
|
|
93
|
+
onContentKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
94
|
+
contentRef?: RefObject<HTMLDivElement | null>;
|
|
95
|
+
children: ReactNode;
|
|
96
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
3
|
+
import { SingleSelectV2MenuItemTokensType } from '../SingleSelectV2/singleSelectV2.tokens';
|
|
4
|
+
import { MultiSelectV2TokensType } from '../MultiSelectV2/multiSelectV2.tokens';
|
|
5
|
+
import { CSSObject } from 'styled-components';
|
|
6
|
+
/** Item type for SelectV2-family components. */
|
|
7
|
+
export type SelectV2ItemType = {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
subLabel?: string;
|
|
12
|
+
slot1?: ReactNode;
|
|
13
|
+
slot2?: ReactNode;
|
|
14
|
+
slot3?: ReactNode;
|
|
15
|
+
slot4?: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
subMenu?: SelectV2ItemType[];
|
|
19
|
+
tooltip?: string | ReactNode;
|
|
20
|
+
tooltipProps?: {
|
|
21
|
+
side?: TooltipSide;
|
|
22
|
+
align?: TooltipAlign;
|
|
23
|
+
size?: TooltipSize;
|
|
24
|
+
showArrow?: boolean;
|
|
25
|
+
delayDuration?: number;
|
|
26
|
+
offset?: number;
|
|
27
|
+
};
|
|
28
|
+
disableTruncation?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type SelectV2ItemStateToken<T> = {
|
|
31
|
+
default: T;
|
|
32
|
+
hover: T;
|
|
33
|
+
active: T;
|
|
34
|
+
focus: T;
|
|
35
|
+
focusVisible: T;
|
|
36
|
+
disabled: T;
|
|
37
|
+
selected: T;
|
|
38
|
+
};
|
|
39
|
+
export type SelectV2MenuItemTokensBase = {
|
|
40
|
+
paddingTop: CSSObject['paddingTop'];
|
|
41
|
+
paddingRight: CSSObject['paddingRight'];
|
|
42
|
+
paddingBottom: CSSObject['paddingBottom'];
|
|
43
|
+
paddingLeft: CSSObject['paddingLeft'];
|
|
44
|
+
margin: CSSObject['margin'];
|
|
45
|
+
borderRadius: CSSObject['borderRadius'];
|
|
46
|
+
gap: CSSObject['gap'];
|
|
47
|
+
backgroundColor: SelectV2ItemStateToken<CSSObject['backgroundColor']>;
|
|
48
|
+
/** Option label text styles. Key is `option` in both V2 token types. */
|
|
49
|
+
option: {
|
|
50
|
+
fontSize: CSSObject['fontSize'];
|
|
51
|
+
fontWeight: CSSObject['fontWeight'];
|
|
52
|
+
color: SelectV2ItemStateToken<CSSObject['color']>;
|
|
53
|
+
};
|
|
54
|
+
description: {
|
|
55
|
+
fontSize: CSSObject['fontSize'];
|
|
56
|
+
fontWeight: CSSObject['fontWeight'];
|
|
57
|
+
color: SelectV2ItemStateToken<CSSObject['color']>;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
type SelectItemV2BaseProps = {
|
|
61
|
+
item: SelectV2ItemType;
|
|
62
|
+
onSelect: (value: string) => void;
|
|
63
|
+
itemTokens: SelectV2MenuItemTokensBase;
|
|
64
|
+
index?: number;
|
|
65
|
+
selectedPosition?: 'first' | 'middle' | 'last' | 'only' | 'none';
|
|
66
|
+
className?: string;
|
|
67
|
+
};
|
|
68
|
+
/** Single-select mode: one value selected at a time; optional checkmark. */
|
|
69
|
+
export type SingleSelectItemV2Props = SelectItemV2BaseProps & {
|
|
70
|
+
mode: 'single';
|
|
71
|
+
selected: string;
|
|
72
|
+
showCheckmark?: boolean;
|
|
73
|
+
};
|
|
74
|
+
/** Multi-select mode: multiple values; renders a Checkbox. */
|
|
75
|
+
export type MultiSelectItemV2Props = SelectItemV2BaseProps & {
|
|
76
|
+
mode: 'multi';
|
|
77
|
+
selectedValues: string[];
|
|
78
|
+
};
|
|
79
|
+
/** Discriminated union: covers both single and multi selection modes. */
|
|
80
|
+
export type SelectItemV2Props = SingleSelectItemV2Props | MultiSelectItemV2Props;
|
|
81
|
+
/** @deprecated Use SelectItemV2Props with mode="single" */
|
|
82
|
+
export type SelectItemV2SingleProps = SingleSelectItemV2Props & {
|
|
83
|
+
itemTokens: SingleSelectV2MenuItemTokensType;
|
|
84
|
+
};
|
|
85
|
+
/** @deprecated Use SelectItemV2Props with mode="multi" */
|
|
86
|
+
export type MultiSelectItemV2LegacyProps = MultiSelectItemV2Props & {
|
|
87
|
+
itemTokens: MultiSelectV2TokensType['menu']['item'];
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export type UseSelectV2MenuBehaviorParams = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
enableSearch?: boolean;
|
|
5
|
+
searchText: string;
|
|
6
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
7
|
+
searchContainerRef?: RefObject<HTMLDivElement | null>;
|
|
8
|
+
shouldMeasureSearchHeight?: boolean;
|
|
9
|
+
focusSearchOnOpen?: boolean;
|
|
10
|
+
focusSearchDelayMs?: number;
|
|
11
|
+
refocusSearchOnTextChange?: boolean;
|
|
12
|
+
menuContainerSelector?: string;
|
|
13
|
+
enableVirtualization?: boolean;
|
|
14
|
+
onVirtualizedSearchChange?: () => void;
|
|
15
|
+
virtualScrollRef?: RefObject<HTMLDivElement | null>;
|
|
16
|
+
onEndReached?: () => void;
|
|
17
|
+
hasMore?: boolean;
|
|
18
|
+
endReachedThreshold?: number;
|
|
19
|
+
};
|
|
20
|
+
type UseSelectV2MenuBehaviorResult = {
|
|
21
|
+
searchHeight: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function useSelectV2MenuBehavior({ open, enableSearch, searchText, searchInputRef, searchContainerRef, shouldMeasureSearchHeight, focusSearchOnOpen, focusSearchDelayMs, refocusSearchOnTextChange, menuContainerSelector, enableVirtualization, onVirtualizedSearchChange, virtualScrollRef, onEndReached, hasMore, endReachedThreshold, }: UseSelectV2MenuBehaviorParams): UseSelectV2MenuBehaviorResult;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RadioV2ContentProps } from './radioV2.types';
|
|
2
|
+
import { SelectorV2Size } from '../selectorV2.types';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
declare const RadioV2: React.ForwardRefExoticComponent<{
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
onCheckedChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
subLabel?: string;
|
|
11
|
+
size?: SelectorV2Size;
|
|
12
|
+
slot?: {
|
|
13
|
+
slot: React.ReactElement;
|
|
14
|
+
maxHeight?: import('styled-components').CSSObject["maxHeight"];
|
|
15
|
+
};
|
|
16
|
+
maxLength?: {
|
|
17
|
+
label?: number;
|
|
18
|
+
subLabel?: number;
|
|
19
|
+
};
|
|
20
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "style" | "className" | "slot" | "children" | "maxLength"> & React.RefAttributes<HTMLInputElement>>;
|
|
21
|
+
export default RadioV2;
|
|
22
|
+
export declare const RadioV2Content: ({ uniqueId, disabled, error, required, size, label, subLabel, slot, tokens, labelMaxLength, subLabelMaxLength, subLabelId, }: RadioV2ContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectorV2Size } from '../selectorV2.types';
|
|
2
|
+
import { RadioV2TokensType } from './radioV2.tokens';
|
|
3
|
+
export declare const StyledRadioV2Root: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {
|
|
4
|
+
size: SelectorV2Size;
|
|
5
|
+
$isDisabled: boolean;
|
|
6
|
+
$isChecked: boolean;
|
|
7
|
+
$error?: boolean;
|
|
8
|
+
$tokens: RadioV2TokensType;
|
|
9
|
+
}>> & string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Theme } from '../../../context/theme.enum';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import { RadioV2IndicatorState } from './radioV2.types';
|
|
4
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
5
|
+
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
6
|
+
import { SelectorV2Size, SelectorV2InteractionState } from '../selectorV2.types';
|
|
7
|
+
export type RadioV2TokensType = {
|
|
8
|
+
gap: CSSObject['gap'];
|
|
9
|
+
group: {
|
|
10
|
+
gap: CSSObject['gap'];
|
|
11
|
+
};
|
|
12
|
+
radio: {
|
|
13
|
+
indicator: {
|
|
14
|
+
[key in RadioV2IndicatorState]: {
|
|
15
|
+
backgroundColor: {
|
|
16
|
+
[key in SelectorV2InteractionState]: CSSObject['backgroundColor'];
|
|
17
|
+
};
|
|
18
|
+
borderColor: {
|
|
19
|
+
[key in SelectorV2InteractionState]: CSSObject['borderColor'];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
activeIndicator: {
|
|
24
|
+
active: {
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
[key in Exclude<SelectorV2InteractionState, 'hover' | 'error'>]: CSSObject['backgroundColor'];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
height: {
|
|
31
|
+
[key in SelectorV2Size]: CSSObject['height'];
|
|
32
|
+
};
|
|
33
|
+
borderWidth: {
|
|
34
|
+
[key in RadioV2IndicatorState]: {
|
|
35
|
+
[key in SelectorV2InteractionState]: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
content: {
|
|
40
|
+
gap: CSSObject['gap'];
|
|
41
|
+
label: {
|
|
42
|
+
gap: CSSObject['gap'];
|
|
43
|
+
color: {
|
|
44
|
+
[key in SelectorV2InteractionState]: CSSObject['color'];
|
|
45
|
+
};
|
|
46
|
+
fontSize: {
|
|
47
|
+
[key in SelectorV2Size]: CSSObject['fontSize'];
|
|
48
|
+
};
|
|
49
|
+
fontWeight: {
|
|
50
|
+
[key in SelectorV2Size]: CSSObject['fontWeight'];
|
|
51
|
+
};
|
|
52
|
+
lineHeight: {
|
|
53
|
+
[key in SelectorV2Size]: CSSObject['lineHeight'];
|
|
54
|
+
};
|
|
55
|
+
slot: {
|
|
56
|
+
maxHeight: {
|
|
57
|
+
[key in SelectorV2Size]: CSSObject['maxHeight'];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
subLabel: {
|
|
62
|
+
color: {
|
|
63
|
+
[key in SelectorV2InteractionState]: CSSObject['color'];
|
|
64
|
+
};
|
|
65
|
+
fontSize: {
|
|
66
|
+
[key in SelectorV2Size]: CSSObject['fontSize'];
|
|
67
|
+
};
|
|
68
|
+
fontWeight: {
|
|
69
|
+
[key in SelectorV2Size]: CSSObject['fontWeight'];
|
|
70
|
+
};
|
|
71
|
+
lineHeight: {
|
|
72
|
+
[key in SelectorV2Size]: CSSObject['lineHeight'];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
required: {
|
|
76
|
+
color: CSSObject['color'];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export type ResponsiveRadioV2Tokens = {
|
|
81
|
+
[key in keyof BreakpointType]: RadioV2TokensType;
|
|
82
|
+
};
|
|
83
|
+
export declare const getRadioV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveRadioV2Tokens;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
import { RadioV2TokensType } from './radioV2.tokens';
|
|
3
|
+
import { CSSObject } from 'styled-components';
|
|
4
|
+
import { SelectorV2Size } from '../selectorV2.types';
|
|
5
|
+
export type RadioV2IndicatorState = 'active' | 'inactive';
|
|
6
|
+
export type RadioV2ContentProps = {
|
|
7
|
+
uniqueId: string;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
error: boolean;
|
|
10
|
+
required: boolean;
|
|
11
|
+
size: SelectorV2Size;
|
|
12
|
+
label?: string;
|
|
13
|
+
subLabel?: string;
|
|
14
|
+
slot?: {
|
|
15
|
+
slot: ReactElement;
|
|
16
|
+
maxHeight?: CSSObject['maxHeight'];
|
|
17
|
+
};
|
|
18
|
+
tokens: RadioV2TokensType;
|
|
19
|
+
labelMaxLength?: number;
|
|
20
|
+
subLabelMaxLength?: number;
|
|
21
|
+
subLabelId?: string;
|
|
22
|
+
};
|
|
23
|
+
export type RadioV2Props = {
|
|
24
|
+
checked?: boolean;
|
|
25
|
+
onCheckedChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
error?: boolean;
|
|
28
|
+
label?: string;
|
|
29
|
+
subLabel?: string;
|
|
30
|
+
size?: SelectorV2Size;
|
|
31
|
+
slot?: {
|
|
32
|
+
slot: ReactElement;
|
|
33
|
+
maxHeight?: CSSObject['maxHeight'];
|
|
34
|
+
};
|
|
35
|
+
maxLength?: {
|
|
36
|
+
label?: number;
|
|
37
|
+
subLabel?: number;
|
|
38
|
+
};
|
|
39
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style' | 'slot' | 'size' | 'maxLength' | 'children'>;
|
|
@@ -15,5 +15,5 @@ declare const SwitchV2: import('react').ForwardRefExoticComponent<{
|
|
|
15
15
|
label?: number;
|
|
16
16
|
subLabel?: number;
|
|
17
17
|
};
|
|
18
|
-
} & Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "style" | "className" | "slot"
|
|
18
|
+
} & Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "style" | "className" | "slot"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
export default SwitchV2;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Theme } from '../../../context/theme.enum';
|
|
2
2
|
import { CSSObject } from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import { SwitchV2Variant } from './switchV2.types';
|
|
4
4
|
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
5
5
|
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
6
|
-
import { SelectorV2Size } from '../selectorV2.types';
|
|
6
|
+
import { SelectorV2Size, SelectorV2InteractionState } from '../selectorV2.types';
|
|
7
7
|
export type SwitchV2TokensType = {
|
|
8
8
|
gap: CSSObject['gap'];
|
|
9
9
|
switch: {
|
|
@@ -15,7 +15,7 @@ export type SwitchV2TokensType = {
|
|
|
15
15
|
};
|
|
16
16
|
backgroundColor: {
|
|
17
17
|
[key in SwitchV2Variant]: {
|
|
18
|
-
[key in
|
|
18
|
+
[key in SelectorV2InteractionState]: CSSObject['backgroundColor'];
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
thumb: {
|
|
@@ -35,7 +35,7 @@ export type SwitchV2TokensType = {
|
|
|
35
35
|
label: {
|
|
36
36
|
gap: CSSObject['gap'];
|
|
37
37
|
color: {
|
|
38
|
-
[key in
|
|
38
|
+
[key in SelectorV2InteractionState]: CSSObject['color'];
|
|
39
39
|
};
|
|
40
40
|
fontSize: {
|
|
41
41
|
[key in SelectorV2Size]: CSSObject['fontSize'];
|
|
@@ -54,7 +54,7 @@ export type SwitchV2TokensType = {
|
|
|
54
54
|
};
|
|
55
55
|
subLabel: {
|
|
56
56
|
color: {
|
|
57
|
-
[key in
|
|
57
|
+
[key in SelectorV2InteractionState]: CSSObject['color'];
|
|
58
58
|
};
|
|
59
59
|
fontSize: {
|
|
60
60
|
[key in SelectorV2Size]: CSSObject['fontSize'];
|
|
@@ -2,7 +2,6 @@ import { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
|
2
2
|
import { SwitchV2TokensType } from './switchV2.tokens';
|
|
3
3
|
import { CSSObject } from 'styled-components';
|
|
4
4
|
import { SelectorV2Size } from '../selectorV2.types';
|
|
5
|
-
export type SwitchV2State = 'default' | 'hover' | 'disabled' | 'error';
|
|
6
5
|
export type SwitchV2Variant = 'checked' | 'unchecked';
|
|
7
6
|
export type SwitchV2ButtonProps = {
|
|
8
7
|
id: string;
|
|
@@ -47,4 +46,4 @@ export type SwitchV2Props = {
|
|
|
47
46
|
label?: number;
|
|
48
47
|
subLabel?: number;
|
|
49
48
|
};
|
|
50
|
-
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'style' | 'slot'
|
|
49
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'style' | 'slot'>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SelectorV2Size } from '../SelectorV2/selectorV2.types';
|
|
1
|
+
import { SelectorV2InteractionState, SelectorV2Size } from '../SelectorV2/selectorV2.types';
|
|
3
2
|
export type SelectorsSize = SelectorV2Size;
|
|
4
3
|
export type SelectorsLabelTokensType = {
|
|
5
4
|
content: {
|
|
@@ -7,7 +6,7 @@ export type SelectorsLabelTokensType = {
|
|
|
7
6
|
fontSize: Record<SelectorsSize, string | number>;
|
|
8
7
|
fontWeight: Record<SelectorsSize, string | number>;
|
|
9
8
|
lineHeight: Record<SelectorsSize, string | number>;
|
|
10
|
-
color: Record<
|
|
9
|
+
color: Record<SelectorV2InteractionState, string>;
|
|
11
10
|
};
|
|
12
11
|
required: {
|
|
13
12
|
color: string;
|
|
@@ -20,7 +19,7 @@ export type SelectorsSubLabelTokensType = {
|
|
|
20
19
|
fontSize: Record<SelectorsSize, string | number>;
|
|
21
20
|
fontWeight: Record<SelectorsSize, string | number>;
|
|
22
21
|
lineHeight: Record<SelectorsSize, string | number>;
|
|
23
|
-
color: Record<
|
|
22
|
+
color: Record<SelectorV2InteractionState, string>;
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
25
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SingleSelectV2Props } from './singleSelectV2.types';
|
|
3
|
+
type MobileSingleSelectV2Props = SingleSelectV2Props;
|
|
4
|
+
declare const MobileSingleSelectV2: React.FC<MobileSingleSelectV2Props>;
|
|
5
|
+
export default MobileSingleSelectV2;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SingleSelectV2Props } from './singleSelectV2.types';
|
|
2
|
+
declare const SingleSelectV2: {
|
|
3
|
+
({ label, subLabel, hintText, required, helpIconText, placeholder, error, size, items, variant, open: controlledOpen, onOpenChange: onControlledOpenChange, selected, onSelect, search, slot, customTrigger, usePanelOnMobile, menuPosition, menuDimensions, triggerDimensions, inline, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, allowCustomValue, customValueLabel, singleSelectGroupPosition, ...rest }: SingleSelectV2Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default SingleSelectV2;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MenuListProps } from './singleSelectV2.types';
|
|
2
|
+
declare const SingleSelectV2List: ({ filteredItems, selected, onSelect, singleSelectTokens, size, variant, enableSearch, }: MenuListProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default SingleSelectV2List;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SingleSelectV2MenuProps } from './singleSelectV2.types';
|
|
2
|
+
declare const SingleSelectV2Menu: {
|
|
3
|
+
({ items, selected, onSelect, trigger, menuDimensions, search, disabled, menuPosition, collisionBoundary, open, onOpenChange, size, variant, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, allowCustomValue, customValueLabel, menuId, }: SingleSelectV2MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default SingleSelectV2Menu;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SingleSelectV2ItemType } from './singleSelectV2.types';
|
|
2
|
+
import { SingleSelectV2TokensType } from './singleSelectV2.tokens';
|
|
3
|
+
export type SubMenuProps = {
|
|
4
|
+
item: SingleSelectV2ItemType;
|
|
5
|
+
selected: string;
|
|
6
|
+
onSelect: (value: string) => void;
|
|
7
|
+
singleSelectTokens: SingleSelectV2TokensType;
|
|
8
|
+
};
|
|
9
|
+
export declare const SubMenu: ({ item, onSelect, selected, singleSelectTokens, }: SubMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export type MenuItemProps = {
|
|
11
|
+
item: SingleSelectV2ItemType;
|
|
12
|
+
selected: string;
|
|
13
|
+
onSelect: (value: string) => void;
|
|
14
|
+
singleSelectTokens?: SingleSelectV2TokensType;
|
|
15
|
+
index?: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const MenuItem: ({ item, onSelect, selected, singleSelectTokens, index, }: MenuItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MenuSearchProps } from './singleSelectV2.types';
|
|
2
|
+
declare const SingleSelectV2Search: ({ enabled, hasItems, backgroundColor, searchPlaceholder, searchText, onSearchTextChange, searchInputRef, containerRef, }: MenuSearchProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export default SingleSelectV2Search;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SingleSelectV2SkeletonProps } from './singleSelectV2.types';
|
|
2
|
+
import { SingleSelectV2TokensType } from './singleSelectV2.tokens';
|
|
3
|
+
export type SingleSelectV2SkeletonComponentProps = {
|
|
4
|
+
singleSelectTokens: SingleSelectV2TokensType;
|
|
5
|
+
skeleton: SingleSelectV2SkeletonProps;
|
|
6
|
+
};
|
|
7
|
+
declare const SingleSelectV2Skeleton: import('react').ForwardRefExoticComponent<SingleSelectV2SkeletonComponentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default SingleSelectV2Skeleton;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SingleSelectV2Size, SingleSelectV2Variant, SelectV2TriggerDimensions } from './singleSelectV2.types';
|
|
3
|
+
import { SingleSelectV2TokensType } from './singleSelectV2.tokens';
|
|
4
|
+
export type SingleSelectV2TriggerProps = {
|
|
5
|
+
size: SingleSelectV2Size;
|
|
6
|
+
selected: string;
|
|
7
|
+
label: string;
|
|
8
|
+
name: string;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
valueLabelMap: Record<string, string>;
|
|
12
|
+
open: boolean;
|
|
13
|
+
slot?: React.ReactNode;
|
|
14
|
+
variant: SingleSelectV2Variant;
|
|
15
|
+
isSmallScreenWithLargeSize: boolean;
|
|
16
|
+
isItemSelected: boolean;
|
|
17
|
+
singleSelectTokens: SingleSelectV2TokensType;
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
triggerDimensions?: SelectV2TriggerDimensions;
|
|
22
|
+
singleSelectGroupPosition?: 'center' | 'left' | 'right';
|
|
23
|
+
borderRadius?: string;
|
|
24
|
+
borderRight?: string;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
declare const SingleSelectV2Trigger: ({ triggerDimensions, size, selected, label, name, placeholder, required, valueLabelMap, open, slot, variant, isSmallScreenWithLargeSize, isItemSelected, singleSelectTokens, inline, error, disabled, singleSelectGroupPosition: _singleSelectGroupPosition, borderRadius, borderRight, ...rest }: SingleSelectV2TriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export default SingleSelectV2Trigger;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { VirtualListProps } from './singleSelectV2.types';
|
|
2
|
+
declare const SingleSelectV2VirtualList: ({ flattenedItems, selected, onSelect, singleSelectTokens, size, variant, virtualViewportHeight, virtualItems, totalSize, measureElement, loadingComponent, hasMore, virtualScrollRef, }: VirtualListProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default SingleSelectV2VirtualList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as SingleSelectV2 } from './SingleSelectV2';
|
|
2
|
+
export { default as MobileSingleSelectV2 } from './MobileSingleSelectV2';
|
|
3
|
+
export { default as SingleSelectV2Trigger } from './SingleSelectV2Trigger';
|
|
4
|
+
export { default as SingleSelectV2Menu } from './SingleSelectV2Menu';
|
|
5
|
+
export { default as SingleSelectV2List } from './SingleSelectV2List';
|
|
6
|
+
export { default as SingleSelectV2VirtualList } from './SingleSelectV2VirtualList';
|
|
7
|
+
export { default as SingleSelectV2Search } from './SingleSelectV2Search';
|
|
8
|
+
export { default as SingleSelectV2Skeleton } from './SingleSelectV2Skeleton';
|
|
9
|
+
export * from './singleSelectV2.types';
|
|
10
|
+
export * from './singleSelectV2.tokens';
|
|
11
|
+
export * from './utils';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SingleSelectV2TokensType } from '../singleSelectV2.tokens';
|
|
2
|
+
import { SingleSelectV2ItemType } from '../singleSelectV2.types';
|
|
3
|
+
type SingleSelectV2MobileItemProps = {
|
|
4
|
+
item: SingleSelectV2ItemType;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
onSelect: (value: string) => void;
|
|
7
|
+
itemTokens: SingleSelectV2TokensType['menu']['item'];
|
|
8
|
+
};
|
|
9
|
+
declare const SingleSelectV2MobileItem: ({ item, isSelected, onSelect, itemTokens, }: SingleSelectV2MobileItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default SingleSelectV2MobileItem;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SingleSelectV2GroupType, SingleSelectV2ItemType } from '../singleSelectV2.types';
|
|
2
|
+
export declare const filterMobileMenuItem: (item: SingleSelectV2ItemType, searchText: string) => SingleSelectV2ItemType | null;
|
|
3
|
+
export declare const filterMobileMenuGroups: (groups: SingleSelectV2GroupType[], searchText: string) => SingleSelectV2GroupType[];
|