@juspay/blend-design-system 0.0.33 → 0.0.34
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/AccordionV2/AccordionV2.d.ts +12 -0
- package/dist/components/AccordionV2/AccordionV2Chevron.d.ts +11 -0
- package/dist/components/AccordionV2/AccordionV2Item.d.ts +10 -0
- package/dist/components/AccordionV2/AccordionV2TriggerContent.d.ts +17 -0
- package/dist/components/AccordionV2/accordionV2.animations.d.ts +3 -0
- package/dist/components/AccordionV2/accordionV2.dark.tokens.d.ts +3 -0
- package/dist/components/AccordionV2/accordionV2.light.tokens.d.ts +3 -0
- package/dist/components/AccordionV2/accordionV2.tokens.d.ts +70 -0
- package/dist/components/AccordionV2/accordionV2.types.d.ts +34 -0
- package/dist/components/AccordionV2/index.d.ts +4 -0
- package/dist/components/AlertV2/AlertV2.d.ts +19 -0
- package/dist/components/AlertV2/alertV2.dark.tokens.d.ts +3 -0
- package/dist/components/AlertV2/alertV2.light.tokens.d.ts +3 -0
- package/dist/components/AlertV2/alertV2.tokens.d.ts +87 -0
- package/dist/components/AlertV2/alertV2.types.d.ts +54 -0
- package/dist/components/AlertV2/index.d.ts +3 -0
- package/dist/components/ButtonV2/utils.d.ts +46 -0
- package/dist/components/Drawer/components/DrawerBase.d.ts +1 -0
- package/dist/components/Inputs/TextInput/TextInput.d.ts +1 -1
- package/dist/components/Inputs/TextInput/types.d.ts +6 -0
- package/dist/components/Inputs/TextInput/utils.d.ts +6 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelectMenu.d.ts +1 -1
- package/dist/components/MultiSelect/types.d.ts +2 -0
- package/dist/components/MultiSelect/utils.d.ts +7 -1
- package/dist/components/MultiSelectGroup/MultiSelectGroup.d.ts +3 -0
- package/dist/components/MultiSelectGroup/MultiselectGroupProps.types.d.ts +7 -0
- package/dist/components/MultiSelectGroup/index.d.ts +3 -0
- package/dist/components/Primitives/Block/Block.d.ts +17 -3
- package/dist/components/Primitives/PrimitiveButton/PrimitiveButton.d.ts +20 -4
- package/dist/components/SelectorsContent/SelectorsContent.types.d.ts +45 -0
- package/dist/components/SelectorsContent/SelectorsLabel.d.ts +3 -0
- package/dist/components/SelectorsContent/SelectorsSubLabel.d.ts +6 -0
- package/dist/components/SelectorsContent/index.d.ts +3 -0
- package/dist/components/Sidebar/SidebarContent.d.ts +24 -0
- package/dist/components/Sidebar/SidebarFooter.d.ts +1 -0
- package/dist/components/Sidebar/SidebarHeader.d.ts +1 -0
- package/dist/components/Sidebar/TenantPanel.d.ts +1 -1
- package/dist/components/Sidebar/types.d.ts +1 -72
- package/dist/components/Sidebar/utils.d.ts +1 -7
- package/dist/components/SingleSelect/SingleSelect.d.ts +1 -1
- package/dist/components/SingleSelect/SingleSelectMenu.d.ts +2 -1
- package/dist/components/SingleSelect/types.d.ts +1 -0
- package/dist/components/SingleSelect/utils.d.ts +6 -4
- package/dist/components/SingleSelectGroup/SingleSelectGroup.d.ts +3 -0
- package/dist/components/SingleSelectGroup/SingleSelectGroupProps.types.d.ts +7 -0
- package/dist/components/SingleSelectGroup/index.d.ts +3 -0
- package/dist/components/SnackbarV2/SnackbarV2.d.ts +6 -0
- package/dist/components/SnackbarV2/index.d.ts +4 -0
- package/dist/components/SnackbarV2/snackbarV2.dark.tokens.d.ts +3 -0
- package/dist/components/SnackbarV2/snackbarV2.light.tokens.d.ts +3 -0
- package/dist/components/SnackbarV2/snackbarV2.tokens.d.ts +73 -0
- package/dist/components/SnackbarV2/snackbarV2.types.d.ts +56 -0
- package/dist/components/Switch/switch.token.d.ts +0 -1
- package/dist/components/SwitchV2/SwitchV2.d.ts +19 -0
- package/dist/components/SwitchV2/index.d.ts +3 -0
- package/dist/components/SwitchV2/switchV2.dark.tokens.d.ts +3 -0
- package/dist/components/SwitchV2/switchV2.light.tokens.d.ts +3 -0
- package/dist/components/SwitchV2/switchV2.tokens.d.ts +76 -0
- package/dist/components/SwitchV2/switchV2.types.d.ts +53 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Tabs/TabsList.d.ts +1 -0
- package/dist/components/Tabs/types.d.ts +2 -0
- package/dist/components/TagV2/TagV2.d.ts +4 -4
- package/dist/components/TagV2/TagV2.types.d.ts +11 -5
- package/dist/components/TagV2/tagV2.tokens.d.ts +2 -3
- package/dist/components/Tags/tag.dark.tokens.d.ts +3 -0
- package/dist/components/Tags/tag.light.tokens.d.ts +3 -0
- package/dist/components/TextInputGroup/TextInputGroup.d.ts +3 -0
- package/dist/components/TextInputGroup/TextInputGroupProps.types.d.ts +7 -0
- package/dist/components/TextInputGroup/index.d.ts +3 -0
- package/dist/components/Upload/utils.d.ts +3 -10
- package/dist/components/common/Seperator.d.ts +8 -0
- package/dist/context/ThemeContext.d.ts +10 -2
- package/dist/context/useComponentToken.d.ts +5 -1
- package/dist/global-utils/GlobalUtils.d.ts +2 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/usePreventParentScroll.d.ts +3 -0
- package/dist/main.js +33058 -31079
- package/dist/tokens/font.tokens.d.ts +2 -0
- package/dist/tokens/unit.tokens.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SwitchV2Size, SwitchV2State } from '../SwitchV2/switchV2.types';
|
|
2
|
+
export type SelectorsSize = SwitchV2Size;
|
|
3
|
+
export type SelectorsLabelTokensType = {
|
|
4
|
+
content: {
|
|
5
|
+
label: {
|
|
6
|
+
fontSize: Record<SelectorsSize, string | number>;
|
|
7
|
+
fontWeight: Record<SelectorsSize, string | number>;
|
|
8
|
+
lineHeight: Record<SelectorsSize, string | number>;
|
|
9
|
+
color: Record<SwitchV2State, string>;
|
|
10
|
+
};
|
|
11
|
+
required: {
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type SelectorsSubLabelTokensType = {
|
|
17
|
+
content: {
|
|
18
|
+
subLabel: {
|
|
19
|
+
fontSize: Record<SelectorsSize, string | number>;
|
|
20
|
+
fontWeight: Record<SelectorsSize, string | number>;
|
|
21
|
+
lineHeight: Record<SelectorsSize, string | number>;
|
|
22
|
+
color: Record<SwitchV2State, string>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type SelectorsLabelProps = {
|
|
27
|
+
id?: string;
|
|
28
|
+
uniqueId: string;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
error: boolean;
|
|
31
|
+
required: boolean;
|
|
32
|
+
size: SelectorsSize;
|
|
33
|
+
label: string;
|
|
34
|
+
tokens: SelectorsLabelTokensType;
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
};
|
|
37
|
+
export type SelectorsSubLabelProps = {
|
|
38
|
+
id?: string;
|
|
39
|
+
subLabel: string;
|
|
40
|
+
size: SelectorsSize;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
error: boolean;
|
|
43
|
+
tokens: SelectorsSubLabelTokensType;
|
|
44
|
+
maxLength?: number;
|
|
45
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SelectorsLabelProps } from './SelectorsContent.types';
|
|
2
|
+
declare const SelectorsLabel: ({ id, uniqueId, disabled, error, required, size, label, tokens, maxLength, }: SelectorsLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export default SelectorsLabel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectorsSubLabelProps } from './SelectorsContent.types';
|
|
2
|
+
declare const SelectorsSubLabel: {
|
|
3
|
+
({ id, subLabel, size, disabled, error, tokens, maxLength, }: SelectorsSubLabelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default SelectorsSubLabel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DirectoryData } from '../Directory/types';
|
|
3
|
+
import { SidebarMerchantInfo } from './types';
|
|
4
|
+
export type SidebarContentProps = {
|
|
5
|
+
sidebarTopSlot?: React.ReactNode;
|
|
6
|
+
merchantInfo?: SidebarMerchantInfo;
|
|
7
|
+
isExpanded: boolean;
|
|
8
|
+
isScrolled: boolean;
|
|
9
|
+
sidebarCollapseKey: string;
|
|
10
|
+
onToggle: () => void;
|
|
11
|
+
sidebarNavId?: string;
|
|
12
|
+
showTopBlur: boolean;
|
|
13
|
+
showBottomBlur: boolean;
|
|
14
|
+
data: DirectoryData[];
|
|
15
|
+
idPrefix: string;
|
|
16
|
+
activeItem?: string | null;
|
|
17
|
+
onActiveItemChange?: (item: string | null) => void;
|
|
18
|
+
defaultActiveItem?: string | null;
|
|
19
|
+
iconOnlyMode?: boolean;
|
|
20
|
+
footer?: React.ReactNode;
|
|
21
|
+
setIsHovering?: (isHovering: boolean) => void;
|
|
22
|
+
};
|
|
23
|
+
declare const SidebarContent: React.FC<SidebarContentProps>;
|
|
24
|
+
export default SidebarContent;
|
|
@@ -8,7 +8,7 @@ type TenantPanelProps = {
|
|
|
8
8
|
tenantSlot2?: React.ReactNode;
|
|
9
9
|
tenantFooter?: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
declare const TenantPanel: React.
|
|
11
|
+
declare const TenantPanel: React.ForwardRefExoticComponent<TenantPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const TenantItem: React.FC<{
|
|
13
13
|
tenant: TenantItem;
|
|
14
14
|
isSelected: boolean;
|
|
@@ -5,10 +5,6 @@ export type LeftPanelItem = {
|
|
|
5
5
|
label: string;
|
|
6
6
|
icon: ReactNode;
|
|
7
7
|
value?: string;
|
|
8
|
-
/**
|
|
9
|
-
* When true, item appears in main panel. When false or undefined, item appears in overflow menu (3-dots)
|
|
10
|
-
* Defaults to false (hidden in overflow)
|
|
11
|
-
*/
|
|
12
8
|
showInPanel?: boolean;
|
|
13
9
|
};
|
|
14
10
|
export type LeftPanelInfo = {
|
|
@@ -23,10 +19,6 @@ export type TenantItem = {
|
|
|
23
19
|
label: string;
|
|
24
20
|
value?: string;
|
|
25
21
|
icon: ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* When true, item appears in main panel. When false or undefined, item appears in overflow menu (3-dots)
|
|
28
|
-
* Defaults to false (hidden in overflow)
|
|
29
|
-
*/
|
|
30
22
|
showInPanel?: boolean;
|
|
31
23
|
};
|
|
32
24
|
export type SidebarMerchantInfo = {
|
|
@@ -39,6 +31,7 @@ export type SidebarMerchantInfo = {
|
|
|
39
31
|
onSelect: (value: string) => void;
|
|
40
32
|
};
|
|
41
33
|
export type SidebarProps = {
|
|
34
|
+
showLeftPanel?: boolean;
|
|
42
35
|
children: ReactNode;
|
|
43
36
|
data: DirectoryData[];
|
|
44
37
|
leftPanel?: LeftPanelInfo;
|
|
@@ -49,81 +42,17 @@ export type SidebarProps = {
|
|
|
49
42
|
merchantInfo?: MerchantInfo;
|
|
50
43
|
rightActions?: ReactNode;
|
|
51
44
|
enableTopbarAutoHide?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Controlled state: Show/hide topbar
|
|
54
|
-
* When provided, topbar operates in controlled mode - parent must handle visibility updates
|
|
55
|
-
*/
|
|
56
45
|
isTopbarVisible?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Callback fired when topbar visibility should change
|
|
59
|
-
* In controlled mode: Parent should update isTopbarVisible prop based on this callback
|
|
60
|
-
* In uncontrolled mode: Optional callback for visibility change notifications
|
|
61
|
-
*/
|
|
62
46
|
onTopbarVisibilityChange?: (isVisible: boolean) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Uncontrolled mode: Initial topbar visibility (defaults to true)
|
|
65
|
-
* Only used when isTopbarVisible is not provided
|
|
66
|
-
*/
|
|
67
47
|
defaultIsTopbarVisible?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Controlled state: Current expanded state of the sidebar
|
|
70
|
-
* When provided, sidebar operates in controlled mode - parent must handle state updates
|
|
71
|
-
*/
|
|
72
48
|
isExpanded?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Callback fired when sidebar expand/collapse state should change
|
|
75
|
-
* In controlled mode: Parent should update isExpanded prop based on this callback
|
|
76
|
-
* In uncontrolled mode: Optional callback for state change notifications
|
|
77
|
-
*/
|
|
78
49
|
onExpandedChange?: (isExpanded: boolean) => void;
|
|
79
|
-
/**
|
|
80
|
-
* Uncontrolled mode: Initial expanded state (defaults to true)
|
|
81
|
-
* Only used when isExpanded is not provided
|
|
82
|
-
*/
|
|
83
50
|
defaultIsExpanded?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* When true, shows only the left panel without any sidebar content
|
|
86
|
-
* In this mode:
|
|
87
|
-
* - Only left panel is visible (no directory, header, footer, toggle)
|
|
88
|
-
* - Left panel is always shown (no intermediate/hover states)
|
|
89
|
-
* - Sidebar cannot be expanded
|
|
90
|
-
* Only applies when leftPanel is provided
|
|
91
|
-
*/
|
|
92
51
|
panelOnlyMode?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* When true, disables the intermediate state that appears on hover
|
|
95
|
-
* When false or undefined, hovering over the collapsed sidebar will temporarily show it in an intermediate/expanded state
|
|
96
|
-
* The intermediate state allows users to see the sidebar content without fully expanding it
|
|
97
|
-
* Defaults to false (intermediate state enabled)
|
|
98
|
-
*/
|
|
99
52
|
disableIntermediateState?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* When true, shows only icons (52px width) with tooltips on hover
|
|
102
|
-
* In this mode:
|
|
103
|
-
* - Directory items show only their icons
|
|
104
|
-
* - Tooltips appear on hover showing the item label
|
|
105
|
-
* - Sections render as horizontal dividers
|
|
106
|
-
* - Merchant switcher moves to topbar
|
|
107
|
-
* - Intermediate/hover state expansion is disabled
|
|
108
|
-
* - Toggle button appears at the top of the icon-only panel
|
|
109
|
-
* Defaults to false
|
|
110
|
-
*/
|
|
111
53
|
iconOnlyMode?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* When true, clicking the toggle button in icon-only mode will completely hide the sidebar.
|
|
114
|
-
* When false, clicking the toggle button will expand to full sidebar view.
|
|
115
|
-
* Only applies when iconOnlyMode is true
|
|
116
|
-
* @default false
|
|
117
|
-
*/
|
|
118
54
|
hideOnIconOnlyToggle?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Show primary action button in mobile navigation
|
|
121
|
-
*/
|
|
122
55
|
showPrimaryActionButton?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Props for the primary action button in mobile navigation
|
|
125
|
-
* Extends HTML button attributes
|
|
126
|
-
*/
|
|
127
56
|
primaryActionButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
128
57
|
activeItem?: string | null;
|
|
129
58
|
onActiveItemChange?: (item: string | null) => void;
|
|
@@ -8,13 +8,7 @@ export declare const arrangeTenants: (tenants: TenantItem[], selectedLabel: stri
|
|
|
8
8
|
};
|
|
9
9
|
export declare const getSidebarWidth: (isExpanded: boolean, isHovering: boolean, hasLeftPanel: boolean, tokens: SidebarTokenType, iconOnlyMode?: boolean) => string;
|
|
10
10
|
export declare const getSidebarBorder: (isExpanded: boolean, isHovering: boolean, tokens: SidebarTokenType) => string;
|
|
11
|
-
export declare const getTopbarStyles: (enableAutoHide: boolean, showTopbar: boolean) => {
|
|
12
|
-
transform?: undefined;
|
|
13
|
-
transition?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
transform: string;
|
|
16
|
-
transition: string;
|
|
17
|
-
};
|
|
11
|
+
export declare const getTopbarStyles: (enableAutoHide: boolean, showTopbar: boolean) => {};
|
|
18
12
|
export declare const getDefaultMerchantInfo: () => {
|
|
19
13
|
items: {
|
|
20
14
|
label: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SingleSelectProps } from './types';
|
|
2
|
-
declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, onBlur, onFocus, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, ...rest }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const SingleSelect: ({ label, subLabel, hintText, required, helpIconText, placeholder, error, errorMessage, size, items, name, variant, disabled, selected, onSelect, enableSearch, searchPlaceholder, slot, customTrigger, useDrawerOnMobile, alignment, side, sideOffset, alignOffset, minMenuWidth, maxMenuWidth, maxMenuHeight, onBlur, onFocus, inline, fullWidth, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, loadingComponent, skeleton, maxTriggerWidth, minTriggerWidth, allowCustomValue, customValueLabel, singleSelectGroupPosition, ...rest }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default SingleSelect;
|
|
@@ -16,6 +16,7 @@ type SingleSelectMenuProps = {
|
|
|
16
16
|
side?: SelectMenuSide;
|
|
17
17
|
sideOffset?: number;
|
|
18
18
|
alignOffset?: number;
|
|
19
|
+
collisionBoundary?: Element | null | Array<Element | null>;
|
|
19
20
|
open: boolean;
|
|
20
21
|
onOpenChange: (open: boolean) => void;
|
|
21
22
|
size?: SelectMenuSize;
|
|
@@ -32,5 +33,5 @@ type SingleSelectMenuProps = {
|
|
|
32
33
|
customValueLabel?: string;
|
|
33
34
|
menuId?: string;
|
|
34
35
|
};
|
|
35
|
-
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, enableSearch, searchPlaceholder, disabled, alignment, side, sideOffset, alignOffset, open, onOpenChange, size, variant, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, allowCustomValue, customValueLabel, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare const SingleSelectMenu: ({ items, selected, onSelect, trigger, minMenuWidth, maxMenuWidth, maxMenuHeight, enableSearch, searchPlaceholder, disabled, alignment, side, sideOffset, alignOffset, collisionBoundary, open, onOpenChange, size, variant, enableVirtualization, virtualListItemHeight, virtualListOverscan, onEndReached, endReachedThreshold, hasMore, skeleton, allowCustomValue, customValueLabel, }: SingleSelectMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
export default SingleSelectMenu;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* WCAG 4.1.2 (Name, Role, Value), 3.3.2 (Labels or Instructions), 4.1.3 (Status Messages)
|
|
4
|
-
*/
|
|
1
|
+
import { SingleSelectTokensType } from './singleSelect.tokens';
|
|
2
|
+
import { SelectMenuSize, SelectMenuVariant } from './types';
|
|
5
3
|
export type AriaAttributes = {
|
|
6
4
|
'aria-describedby'?: string;
|
|
7
5
|
'aria-label'?: string;
|
|
@@ -15,6 +13,10 @@ export type ExtractedAriaProps = {
|
|
|
15
13
|
'aria-labelledby'?: string;
|
|
16
14
|
restProps: Record<string, unknown>;
|
|
17
15
|
};
|
|
16
|
+
export declare function getBorderRadius(size: SelectMenuSize, varient: SelectMenuVariant, singleSelectGroupPosition: 'center' | 'left' | 'right' | undefined, tokens: SingleSelectTokensType): {
|
|
17
|
+
borderRadius: string;
|
|
18
|
+
borderRight?: string;
|
|
19
|
+
};
|
|
18
20
|
export type AccessibilitySetupOptions = {
|
|
19
21
|
name?: string;
|
|
20
22
|
generatedId: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SingleSelectProps } from '../SingleSelect/types';
|
|
3
|
+
export type SingleSelectGroupProps = {
|
|
4
|
+
stacked?: boolean;
|
|
5
|
+
gap?: string | number;
|
|
6
|
+
children: ReactElement<SingleSelectProps> | ReactElement<SingleSelectProps>[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SnackbarV2ToastOptions, SnackbarV2ToastProps, SnackbarV2Props } from './snackbarV2.types';
|
|
3
|
+
export declare const StyledToast: React.FC<SnackbarV2ToastProps>;
|
|
4
|
+
export declare const addSnackbarV2: ({ header, description, variant, slot, onClose, actionButton, duration, position, width, maxWidth, minWidth, }: SnackbarV2ToastOptions) => string | number;
|
|
5
|
+
declare const SnackbarV2: React.ForwardRefExoticComponent<SnackbarV2Props & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export default SnackbarV2;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { SnackbarV2Variant } from './snackbarV2.types';
|
|
3
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
import { Theme } from '../../context/theme.enum';
|
|
6
|
+
export declare enum SnackbarV2PaddingDirection {
|
|
7
|
+
TOP = "top",
|
|
8
|
+
BOTTOM = "bottom",
|
|
9
|
+
LEFT = "left",
|
|
10
|
+
RIGHT = "right"
|
|
11
|
+
}
|
|
12
|
+
export type SnackbarV2TokensType = {
|
|
13
|
+
width: CSSObject['width'];
|
|
14
|
+
maxWidth: CSSObject['maxWidth'];
|
|
15
|
+
minWidth: CSSObject['minWidth'];
|
|
16
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
17
|
+
borderRadius: CSSObject['borderRadius'];
|
|
18
|
+
padding: CSSObject['padding'];
|
|
19
|
+
boxShadow: CSSObject['boxShadow'];
|
|
20
|
+
gap: CSSObject['gap'];
|
|
21
|
+
slot: {
|
|
22
|
+
height: CSSObject['height'];
|
|
23
|
+
width: CSSObject['width'];
|
|
24
|
+
color: {
|
|
25
|
+
[key in SnackbarV2Variant]: CSSObject['color'];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
mainContainer: {
|
|
29
|
+
gap: CSSObject['gap'];
|
|
30
|
+
content: {
|
|
31
|
+
gap: CSSObject['gap'];
|
|
32
|
+
textContainer: {
|
|
33
|
+
gap: CSSObject['gap'];
|
|
34
|
+
header: {
|
|
35
|
+
color: {
|
|
36
|
+
[key in SnackbarV2Variant]: CSSObject['color'];
|
|
37
|
+
};
|
|
38
|
+
fontSize: CSSObject['fontSize'];
|
|
39
|
+
fontWeight: CSSObject['fontWeight'];
|
|
40
|
+
lineHeight: CSSObject['lineHeight'];
|
|
41
|
+
};
|
|
42
|
+
description: {
|
|
43
|
+
color: {
|
|
44
|
+
[key in SnackbarV2Variant]: CSSObject['color'];
|
|
45
|
+
};
|
|
46
|
+
fontSize: CSSObject['fontSize'];
|
|
47
|
+
fontWeight: CSSObject['fontWeight'];
|
|
48
|
+
lineHeight: CSSObject['lineHeight'];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
actionContainer: {
|
|
52
|
+
primaryAction: {
|
|
53
|
+
color: {
|
|
54
|
+
[key in SnackbarV2Variant]: CSSObject['color'];
|
|
55
|
+
};
|
|
56
|
+
fontSize: CSSObject['fontSize'];
|
|
57
|
+
fontWeight: CSSObject['fontWeight'];
|
|
58
|
+
lineHeight: CSSObject['lineHeight'];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
closeButton: {
|
|
63
|
+
height: CSSObject['height'];
|
|
64
|
+
color: {
|
|
65
|
+
[key in SnackbarV2Variant]: CSSObject['color'];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type ResponsiveSnackbarV2Tokens = {
|
|
71
|
+
[key in keyof BreakpointType]: SnackbarV2TokensType;
|
|
72
|
+
};
|
|
73
|
+
export declare const getSnackbarV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveSnackbarV2Tokens;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
export declare enum SnackbarV2Variant {
|
|
4
|
+
INFO = "info",
|
|
5
|
+
SUCCESS = "success",
|
|
6
|
+
WARNING = "warning",
|
|
7
|
+
ERROR = "error"
|
|
8
|
+
}
|
|
9
|
+
export declare enum SnackbarV2Position {
|
|
10
|
+
TOP_LEFT = "top-left",
|
|
11
|
+
TOP_RIGHT = "top-right",
|
|
12
|
+
BOTTOM_LEFT = "bottom-left",
|
|
13
|
+
BOTTOM_RIGHT = "bottom-right",
|
|
14
|
+
TOP_CENTER = "top-center",
|
|
15
|
+
BOTTOM_CENTER = "bottom-center"
|
|
16
|
+
}
|
|
17
|
+
export type SnackbarV2Action = {
|
|
18
|
+
label: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
autoDismiss?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type SnackbarV2Dimensions = {
|
|
23
|
+
width?: CSSObject['width'];
|
|
24
|
+
maxWidth?: CSSObject['maxWidth'];
|
|
25
|
+
minWidth?: CSSObject['minWidth'];
|
|
26
|
+
};
|
|
27
|
+
export type SnackbarV2ToastOptions = {
|
|
28
|
+
header: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
variant?: SnackbarV2Variant;
|
|
31
|
+
slot?: ReactElement;
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
actionButton?: SnackbarV2Action;
|
|
34
|
+
duration?: number;
|
|
35
|
+
position?: SnackbarV2Position;
|
|
36
|
+
maxWidth?: string | number;
|
|
37
|
+
width?: string | number;
|
|
38
|
+
minWidth?: string | number;
|
|
39
|
+
};
|
|
40
|
+
export type SnackbarV2Props = {
|
|
41
|
+
position?: SnackbarV2Position;
|
|
42
|
+
dismissOnClickAway?: boolean;
|
|
43
|
+
maxWidth?: string | number;
|
|
44
|
+
};
|
|
45
|
+
export type SnackbarV2ToastProps = {
|
|
46
|
+
header: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
variant: SnackbarV2Variant;
|
|
49
|
+
slot?: ReactElement;
|
|
50
|
+
onClose?: () => void;
|
|
51
|
+
actionButton?: SnackbarV2Action;
|
|
52
|
+
toastId?: string | number;
|
|
53
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'slot' | 'className' | 'style'> & SnackbarV2Dimensions;
|
|
54
|
+
export type SnackbarV2IconProps = {
|
|
55
|
+
variant: SnackbarV2Variant;
|
|
56
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SwitchV2Size } from './switchV2.types';
|
|
2
|
+
declare const SwitchV2: import('react').ForwardRefExoticComponent<{
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
subLabel?: string;
|
|
9
|
+
size?: SwitchV2Size;
|
|
10
|
+
slot?: {
|
|
11
|
+
slot: import('react').ReactElement;
|
|
12
|
+
maxHeight?: import('styled-components').CSSObject["maxHeight"];
|
|
13
|
+
};
|
|
14
|
+
maxLength?: {
|
|
15
|
+
label?: number;
|
|
16
|
+
subLabel?: number;
|
|
17
|
+
};
|
|
18
|
+
} & Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "style" | "className" | "slot" | "onChange"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export default SwitchV2;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Theme } from '../../context/theme.enum';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import { SwitchV2Size, SwitchV2State, SwitchV2Variant } from './switchV2.types';
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
6
|
+
export type SwitchV2TokensType = {
|
|
7
|
+
gap: CSSObject['gap'];
|
|
8
|
+
switch: {
|
|
9
|
+
height: {
|
|
10
|
+
[key in SwitchV2Size]: CSSObject['height'];
|
|
11
|
+
};
|
|
12
|
+
width: {
|
|
13
|
+
[key in SwitchV2Size]: CSSObject['width'];
|
|
14
|
+
};
|
|
15
|
+
backgroundColor: {
|
|
16
|
+
[key in SwitchV2Variant]: {
|
|
17
|
+
[key in SwitchV2State]: CSSObject['backgroundColor'];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
thumb: {
|
|
21
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
22
|
+
border: CSSObject['border'];
|
|
23
|
+
width: {
|
|
24
|
+
[key in SwitchV2Size]: CSSObject['width'];
|
|
25
|
+
};
|
|
26
|
+
height: {
|
|
27
|
+
[key in SwitchV2Size]: CSSObject['height'];
|
|
28
|
+
};
|
|
29
|
+
outline: CSSObject['outline'];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
content: {
|
|
33
|
+
gap: CSSObject['gap'];
|
|
34
|
+
label: {
|
|
35
|
+
gap: CSSObject['gap'];
|
|
36
|
+
color: {
|
|
37
|
+
[key in SwitchV2State]: CSSObject['color'];
|
|
38
|
+
};
|
|
39
|
+
fontSize: {
|
|
40
|
+
[key in SwitchV2Size]: CSSObject['fontSize'];
|
|
41
|
+
};
|
|
42
|
+
fontWeight: {
|
|
43
|
+
[key in SwitchV2Size]: CSSObject['fontWeight'];
|
|
44
|
+
};
|
|
45
|
+
lineHeight: {
|
|
46
|
+
[key in SwitchV2Size]: CSSObject['lineHeight'];
|
|
47
|
+
};
|
|
48
|
+
slot: {
|
|
49
|
+
maxHeight: {
|
|
50
|
+
[key in SwitchV2Size]: CSSObject['maxHeight'];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
subLabel: {
|
|
55
|
+
color: {
|
|
56
|
+
[key in SwitchV2State]: CSSObject['color'];
|
|
57
|
+
};
|
|
58
|
+
fontSize: {
|
|
59
|
+
[key in SwitchV2Size]: CSSObject['fontSize'];
|
|
60
|
+
};
|
|
61
|
+
fontWeight: {
|
|
62
|
+
[key in SwitchV2Size]: CSSObject['fontWeight'];
|
|
63
|
+
};
|
|
64
|
+
lineHeight: {
|
|
65
|
+
[key in SwitchV2Size]: CSSObject['lineHeight'];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
required: {
|
|
69
|
+
color: CSSObject['color'];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type ResponsiveSwitchV2Tokens = {
|
|
74
|
+
[key in keyof BreakpointType]: SwitchV2TokensType;
|
|
75
|
+
};
|
|
76
|
+
export declare const getSwitchV2Tokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveSwitchV2Tokens;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
import { SwitchV2TokensType } from './switchV2.tokens';
|
|
3
|
+
import { CSSObject } from 'styled-components';
|
|
4
|
+
export declare enum SwitchV2Size {
|
|
5
|
+
SM = "sm",
|
|
6
|
+
MD = "md"
|
|
7
|
+
}
|
|
8
|
+
export type SwitchV2State = 'default' | 'hover' | 'disabled' | 'error';
|
|
9
|
+
export type SwitchV2Variant = 'checked' | 'unchecked';
|
|
10
|
+
export type SwitchV2ButtonProps = {
|
|
11
|
+
id: string;
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
size: SwitchV2Size;
|
|
15
|
+
tokens: SwitchV2TokensType;
|
|
16
|
+
onToggle: () => void;
|
|
17
|
+
buttonProps?: Record<string, unknown>;
|
|
18
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
19
|
+
};
|
|
20
|
+
export type SwitchV2ContentProps = {
|
|
21
|
+
uniqueId: string;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
error: boolean;
|
|
24
|
+
required: boolean;
|
|
25
|
+
size: SwitchV2Size;
|
|
26
|
+
label?: string;
|
|
27
|
+
subLabel?: string;
|
|
28
|
+
slot?: {
|
|
29
|
+
slot: ReactElement;
|
|
30
|
+
maxHeight?: CSSObject['maxHeight'];
|
|
31
|
+
};
|
|
32
|
+
tokens: SwitchV2TokensType;
|
|
33
|
+
labelMaxLength?: number;
|
|
34
|
+
subLabelMaxLength?: number;
|
|
35
|
+
subLabelId?: string;
|
|
36
|
+
};
|
|
37
|
+
export type SwitchV2Props = {
|
|
38
|
+
checked?: boolean;
|
|
39
|
+
onChange?: (checked: boolean) => void;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
error?: boolean;
|
|
42
|
+
label?: string;
|
|
43
|
+
subLabel?: string;
|
|
44
|
+
size?: SwitchV2Size;
|
|
45
|
+
slot?: {
|
|
46
|
+
slot: ReactElement;
|
|
47
|
+
maxHeight?: CSSObject['maxHeight'];
|
|
48
|
+
};
|
|
49
|
+
maxLength?: {
|
|
50
|
+
label?: number;
|
|
51
|
+
subLabel?: number;
|
|
52
|
+
};
|
|
53
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'style' | 'slot' | 'onChange'>;
|
|
@@ -15,5 +15,6 @@ declare const Tabs: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react
|
|
|
15
15
|
showSkeleton?: boolean;
|
|
16
16
|
skeletonVariant?: import('../Skeleton').SkeletonVariant;
|
|
17
17
|
stickyHeader?: boolean;
|
|
18
|
+
offsetTop?: number;
|
|
18
19
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
19
20
|
export default Tabs;
|