@juspay/blend-design-system 0.0.24-beta → 0.0.25-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/StyledAvatar.d.ts +0 -7
- package/dist/components/Avatar/avatar.tokens.d.ts +6 -4
- package/dist/components/Avatar/avatarUtils.d.ts +7 -0
- package/dist/components/Avatar/types.d.ts +1 -1
- package/dist/components/Breadcrumb/types.d.ts +6 -0
- package/dist/components/Button/Button.d.ts +3 -0
- package/dist/components/Button/ButtonBase.d.ts +11 -0
- package/dist/components/Button/button.tokens.d.ts +4 -1
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/ChatInput/ChatInput.d.ts +23 -2
- package/dist/components/ChatInput/types.d.ts +3 -4
- package/dist/components/ChatInput/utils.d.ts +0 -4
- package/dist/components/Checkbox/checkbox.animations.d.ts +2 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +3 -0
- package/dist/components/CodeEditor/CodeEditorHeader.d.ts +13 -0
- package/dist/components/CodeEditor/MonacoEditorWrapper.d.ts +18 -0
- package/dist/components/CodeEditor/index.d.ts +2 -0
- package/dist/components/CodeEditor/types.d.ts +27 -0
- package/dist/components/CodeEditor/utils.d.ts +9 -0
- package/dist/components/DataTable/types.d.ts +23 -6
- package/dist/components/DateRangePicker/TimeSelector.d.ts +0 -2
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +7 -19
- package/dist/components/Directory/types.d.ts +5 -0
- package/dist/components/Inputs/MultiValueInput/MultiValueInput.d.ts +1 -1
- package/dist/components/Inputs/MultiValueInput/types.d.ts +2 -1
- package/dist/components/Menu/menu.animations.d.ts +8 -0
- package/dist/components/Modal/modal.animations.d.ts +3 -0
- package/dist/components/Modal/modal.utils.d.ts +2 -0
- package/dist/components/Modal/useModal.d.ts +5 -0
- package/dist/components/MultiSelect/multiSelect.animations.d.ts +12 -0
- package/dist/components/Popover/popover.animations.d.ts +1 -0
- package/dist/components/Primitives/PrimitiveInput/PrimitiveInput.d.ts +5 -0
- package/dist/components/Primitives/PrimitiveTextArea.d.ts +5 -0
- package/dist/components/Radio/radio.animations.d.ts +1 -0
- package/dist/components/Sidebar/SidebarMobile/MobileNavigationItem.d.ts +11 -0
- package/dist/components/Sidebar/SidebarMobile/MoreButton.d.ts +7 -0
- package/dist/components/Sidebar/SidebarMobile/PrimaryActionButton.d.ts +8 -0
- package/dist/components/Sidebar/SidebarMobile/hooks.d.ts +24 -0
- package/dist/components/Sidebar/SidebarMobile/index.d.ts +3 -0
- package/dist/components/Sidebar/SidebarMobile/mobile.tokens.d.ts +81 -0
- package/dist/components/Sidebar/SidebarMobile/utils.d.ts +29 -0
- package/dist/components/Sidebar/types.d.ts +35 -1
- package/dist/components/Sidebar/utils.d.ts +39 -1
- package/dist/components/SingleSelect/singleSelect.animations.d.ts +3 -0
- package/dist/components/Skeleton/SkeletonCompound.d.ts +0 -15
- package/dist/components/Skeleton/hooks/useSkeletonBase.d.ts +0 -4
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Skeleton/types.d.ts +0 -12
- package/dist/components/Skeleton/utils.d.ts +18 -0
- package/dist/components/Snackbar/Snackbar.d.ts +6 -3
- package/dist/components/Snackbar/types.d.ts +9 -0
- package/dist/components/StatCard/statcard.tokens.d.ts +1 -1
- package/dist/components/Switch/switch.animations.d.ts +2 -0
- package/dist/components/Tags/Tag.d.ts +15 -0
- package/dist/components/Tags/TagBase.d.ts +20 -0
- package/dist/components/Tags/Tags.d.ts +11 -2
- package/dist/components/Tags/index.d.ts +1 -1
- package/dist/components/Tags/tag.tokens.d.ts +2 -1
- package/dist/components/Tags/types.d.ts +7 -2
- package/dist/components/Tooltip/tooltip.animations.d.ts +1 -0
- package/dist/components/Topbar/types.d.ts +7 -0
- package/dist/components/animations/ChevronAnimation/ChevronAnimation.d.ts +3 -0
- package/dist/components/animations/ChevronAnimation/index.d.ts +3 -0
- package/dist/components/animations/ChevronAnimation/types.d.ts +28 -0
- package/dist/components/animations/ChevronAnimation/utils.d.ts +3 -0
- package/dist/components/animations/Ripple/RippleContainer.d.ts +7 -0
- package/dist/components/animations/Ripple/index.d.ts +2 -0
- package/dist/components/common/error.animations.d.ts +4 -0
- package/dist/components/common/index.d.ts +2 -0
- package/dist/components/common/useErrorShake.d.ts +6 -0
- package/dist/context/ThemeContext.d.ts +4 -0
- package/dist/context/ThemeProvider.d.ts +6 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/initComponentTokens.d.ts +2 -1
- package/dist/context/useComponentToken.d.ts +2 -1
- package/dist/hooks/useRipple.d.ts +11 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +29842 -25999
- package/package.json +4 -2
- package/dist/components/Skeleton/SkeletonButton.d.ts +0 -13
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
|
+
export type MobileNavigationState = 'default' | 'active';
|
|
5
|
+
/**
|
|
6
|
+
* Mobile Navigation Tokens following the pattern: [target].CSSProp.[variant].[state]
|
|
7
|
+
*
|
|
8
|
+
* Structure matches Sidebar pattern for consistency:
|
|
9
|
+
* - Base properties: backgroundColor, drawer.*
|
|
10
|
+
* - Layout surfaces: padding/gap (container), row.*
|
|
11
|
+
* - Interactive elements: item.*, primaryAction.*
|
|
12
|
+
* - Interactive elements have state-based styling: [state] = default | active
|
|
13
|
+
*
|
|
14
|
+
* Note: This is mobile-only, so no responsive breakpoints needed.
|
|
15
|
+
* All navigation items (including the More button) use the same item tokens.
|
|
16
|
+
*
|
|
17
|
+
* Pattern examples:
|
|
18
|
+
* - padding.[axis] (wrapper spacing for all rows)
|
|
19
|
+
* - row.padding.[axis] (individual row spacing)
|
|
20
|
+
* - item.backgroundColor.[state] (item background per state)
|
|
21
|
+
* - primaryAction.width (primary action button dimensions)
|
|
22
|
+
*/
|
|
23
|
+
export type MobileNavigationTokenType = {
|
|
24
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
25
|
+
drawer: {
|
|
26
|
+
borderRadius: CSSObject['borderRadius'];
|
|
27
|
+
borderTop: CSSObject['border'];
|
|
28
|
+
};
|
|
29
|
+
padding: {
|
|
30
|
+
x: CSSObject['padding'];
|
|
31
|
+
y: CSSObject['padding'];
|
|
32
|
+
};
|
|
33
|
+
gap: CSSObject['gap'];
|
|
34
|
+
row: {
|
|
35
|
+
padding: {
|
|
36
|
+
x: CSSObject['padding'];
|
|
37
|
+
y: CSSObject['padding'];
|
|
38
|
+
};
|
|
39
|
+
gap: CSSObject['gap'];
|
|
40
|
+
item: {
|
|
41
|
+
width: CSSObject['width'];
|
|
42
|
+
height: CSSObject['height'];
|
|
43
|
+
borderRadius: CSSObject['borderRadius'];
|
|
44
|
+
gap: CSSObject['gap'];
|
|
45
|
+
backgroundColor: {
|
|
46
|
+
[key in MobileNavigationState]: CSSObject['backgroundColor'];
|
|
47
|
+
};
|
|
48
|
+
color: {
|
|
49
|
+
[key in MobileNavigationState]: CSSObject['color'];
|
|
50
|
+
};
|
|
51
|
+
fontWeight: CSSObject['fontWeight'];
|
|
52
|
+
icon: {
|
|
53
|
+
width: CSSObject['width'];
|
|
54
|
+
height: CSSObject['height'];
|
|
55
|
+
borderRadius: CSSObject['borderRadius'];
|
|
56
|
+
transition: CSSObject['transition'];
|
|
57
|
+
};
|
|
58
|
+
text: {
|
|
59
|
+
fontSize: CSSObject['fontSize'];
|
|
60
|
+
fontWeight: CSSObject['fontWeight'];
|
|
61
|
+
textAlign: CSSObject['textAlign'];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
primaryAction: {
|
|
65
|
+
width: CSSObject['width'];
|
|
66
|
+
height: CSSObject['height'];
|
|
67
|
+
borderRadius: CSSObject['borderRadius'];
|
|
68
|
+
background: CSSObject['background'];
|
|
69
|
+
boxShadow: CSSObject['boxShadow'];
|
|
70
|
+
color: CSSObject['color'];
|
|
71
|
+
icon: {
|
|
72
|
+
width: CSSObject['width'];
|
|
73
|
+
height: CSSObject['height'];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export type ResponsiveMobileNavigationTokens = {
|
|
79
|
+
[key in keyof BreakpointType]: MobileNavigationTokenType;
|
|
80
|
+
};
|
|
81
|
+
export declare const getMobileNavigationTokens: (foundationToken: FoundationTokenType) => ResponsiveMobileNavigationTokens;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MobileNavigationItem } from '../types';
|
|
2
|
+
import { MobileNavigationTokenType } from './mobile.tokens';
|
|
3
|
+
export declare const calculateMobileNavigationSnapPoints: (secondaryRowCount: number, viewportHeight: number | undefined, tokens: MobileNavigationTokenType, viewportHeightMultiplier: number) => Array<string | number>;
|
|
4
|
+
export declare const getMobileNavigationLayout: (items: MobileNavigationItem[], viewportHeight: number | undefined, tokens: MobileNavigationTokenType, primaryVisibleLimit: number, viewportHeightMultiplier: number, options?: {
|
|
5
|
+
primaryReservedSlots?: number;
|
|
6
|
+
}) => {
|
|
7
|
+
primaryItems: MobileNavigationItem[];
|
|
8
|
+
secondaryItems: MobileNavigationItem[];
|
|
9
|
+
hasSecondaryItems: boolean;
|
|
10
|
+
snapPoints: (string | number)[];
|
|
11
|
+
};
|
|
12
|
+
export declare const getMobileNavigationSecondaryRows: (secondaryItems: MobileNavigationItem[], primaryVisibleLimit: number) => MobileNavigationItem[][];
|
|
13
|
+
export declare const getMobileNavigationFillerCount: (itemsInRow: number, primaryVisibleLimit: number) => number;
|
|
14
|
+
export declare const splitPrimaryItems: (primaryItems: MobileNavigationItem[], showPrimaryAction: boolean) => {
|
|
15
|
+
leftItems: MobileNavigationItem[];
|
|
16
|
+
rightItems: MobileNavigationItem[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Swap two items in an array by their labels
|
|
20
|
+
*/
|
|
21
|
+
export declare const swapItemsByLabel: <T extends {
|
|
22
|
+
label: string;
|
|
23
|
+
}>(items: T[], itemLabel1: string, itemLabel2: string) => T[];
|
|
24
|
+
/**
|
|
25
|
+
* Update item properties without changing order
|
|
26
|
+
*/
|
|
27
|
+
export declare const updateItemProperties: <T extends {
|
|
28
|
+
label: string;
|
|
29
|
+
}>(orderedItems: T[], newItems: T[]) => T[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DirectoryData } from '../Directory/types';
|
|
2
|
+
import { DirectoryData, NavbarItem } from '../Directory/types';
|
|
3
3
|
import { MerchantInfo } from '../Topbar/types';
|
|
4
4
|
export type LeftPanelItem = {
|
|
5
5
|
label: string;
|
|
@@ -37,6 +37,22 @@ export type SidebarProps = {
|
|
|
37
37
|
merchantInfo?: MerchantInfo;
|
|
38
38
|
rightActions?: ReactNode;
|
|
39
39
|
enableTopbarAutoHide?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Controlled state: Show/hide topbar
|
|
42
|
+
* When provided, topbar operates in controlled mode - parent must handle visibility updates
|
|
43
|
+
*/
|
|
44
|
+
isTopbarVisible?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Callback fired when topbar visibility should change
|
|
47
|
+
* In controlled mode: Parent should update isTopbarVisible prop based on this callback
|
|
48
|
+
* In uncontrolled mode: Optional callback for visibility change notifications
|
|
49
|
+
*/
|
|
50
|
+
onTopbarVisibilityChange?: (isVisible: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Uncontrolled mode: Initial topbar visibility (defaults to true)
|
|
53
|
+
* Only used when isTopbarVisible is not provided
|
|
54
|
+
*/
|
|
55
|
+
defaultIsTopbarVisible?: boolean;
|
|
40
56
|
/**
|
|
41
57
|
* Controlled state: Current expanded state of the sidebar
|
|
42
58
|
* When provided, sidebar operates in controlled mode - parent must handle state updates
|
|
@@ -53,4 +69,22 @@ export type SidebarProps = {
|
|
|
53
69
|
* Only used when isExpanded is not provided
|
|
54
70
|
*/
|
|
55
71
|
defaultIsExpanded?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Show primary action button in mobile navigation
|
|
74
|
+
*/
|
|
75
|
+
showPrimaryActionButton?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Props for the primary action button in mobile navigation
|
|
78
|
+
* Extends HTML button attributes
|
|
79
|
+
*/
|
|
80
|
+
primaryActionButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
81
|
+
};
|
|
82
|
+
export type MobileNavigationItem = NavbarItem & {
|
|
83
|
+
sectionLabel?: string;
|
|
84
|
+
};
|
|
85
|
+
export type SidebarMobileNavigationProps = {
|
|
86
|
+
items: MobileNavigationItem[];
|
|
87
|
+
onHeightChange?: (height: string) => void;
|
|
88
|
+
showPrimaryActionButton?: boolean;
|
|
89
|
+
primaryActionButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
56
90
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TenantItem } from './types';
|
|
1
|
+
import { MobileNavigationItem, TenantItem } from './types';
|
|
2
2
|
import { SidebarTokenType } from './sidebar.tokens';
|
|
3
|
+
import { DirectoryData } from '../Directory/types';
|
|
3
4
|
export declare const arrangeTenants: (tenants: TenantItem[], selectedLabel: string, maxVisible: number) => {
|
|
4
5
|
visibleTenants: TenantItem[];
|
|
5
6
|
hiddenTenants: TenantItem[];
|
|
@@ -25,3 +26,40 @@ export declare const getDefaultMerchantInfo: () => {
|
|
|
25
26
|
};
|
|
26
27
|
export declare const useTopbarAutoHide: (enableTopbarAutoHide: boolean) => boolean;
|
|
27
28
|
export declare const isControlledSidebar: (isExpanded: boolean | undefined) => boolean;
|
|
29
|
+
export declare const getMobileNavigationItems: (directory: DirectoryData[]) => MobileNavigationItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Parse CSS unit values to numbers (e.g., "16px" -> 16)
|
|
32
|
+
* Returns 0 for invalid values
|
|
33
|
+
*/
|
|
34
|
+
export declare const parseUnitValue: (value: string | number | undefined) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Parse CSS values to numbers, allowing null for invalid values
|
|
37
|
+
* Returns null for invalid values (more flexible than parseUnitValue)
|
|
38
|
+
*/
|
|
39
|
+
export declare const parseCssValue: (value: string | number | null | undefined) => number | null;
|
|
40
|
+
export declare const MOBILE_NAVIGATION_COLLAPSED_HEIGHT: string;
|
|
41
|
+
export declare const MOBILE_NAVIGATION_SAFE_AREA: string;
|
|
42
|
+
export declare const getMobileNavigationLayout: (items: MobileNavigationItem[], viewportHeight?: number, options?: {
|
|
43
|
+
primaryReservedSlots?: number;
|
|
44
|
+
}) => {
|
|
45
|
+
primaryItems: MobileNavigationItem[];
|
|
46
|
+
secondaryItems: MobileNavigationItem[];
|
|
47
|
+
hasSecondaryItems: boolean;
|
|
48
|
+
snapPoints: (string | number)[];
|
|
49
|
+
};
|
|
50
|
+
export declare const getMobileNavigationSecondaryRows: (secondaryItems: MobileNavigationItem[]) => MobileNavigationItem[][];
|
|
51
|
+
export declare const getMobileNavigationFillerCount: (itemsInRow: number) => number;
|
|
52
|
+
export declare const getMobileNavigationRowPadding: ({ isSecondary, isLastRow, }: {
|
|
53
|
+
isSecondary: boolean;
|
|
54
|
+
isLastRow: boolean;
|
|
55
|
+
}) => {
|
|
56
|
+
paddingTop: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
57
|
+
paddingRight: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
58
|
+
paddingBottom: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
59
|
+
paddingLeft: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
60
|
+
};
|
|
61
|
+
export declare const MOBILE_NAVIGATION_BUTTON_DIMENSIONS: {
|
|
62
|
+
width: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
63
|
+
height: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
64
|
+
};
|
|
65
|
+
export declare const MOBILE_NAVIGATION_GAP: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
@@ -6,7 +6,6 @@ import { SkeletonProps } from './types';
|
|
|
6
6
|
* <Skeleton loading={true}>
|
|
7
7
|
* <Skeleton.Avatar size="md" />
|
|
8
8
|
* <Skeleton.Text lines={2} />
|
|
9
|
-
* <Skeleton.Button />
|
|
10
9
|
* </Skeleton>
|
|
11
10
|
*
|
|
12
11
|
* Or traditional:
|
|
@@ -26,20 +25,6 @@ declare const SkeletonCompound: import('react').ForwardRefExoticComponent<import
|
|
|
26
25
|
size?: import('./types').SkeletonSize;
|
|
27
26
|
shape?: "circle" | "square";
|
|
28
27
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
29
|
-
/**
|
|
30
|
-
* Button skeleton with perfect token mirroring and dynamic sizing
|
|
31
|
-
*/
|
|
32
|
-
Button: import('react').ForwardRefExoticComponent<import('./types').BaseSkeletonProps & Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
33
|
-
buttonType?: import('../Button').ButtonType;
|
|
34
|
-
size?: import('../Button').ButtonSize;
|
|
35
|
-
subType?: import('../Button').ButtonSubType;
|
|
36
|
-
width?: string | number;
|
|
37
|
-
fullWidth?: boolean;
|
|
38
|
-
buttonGroupPosition?: "center" | "left" | "right";
|
|
39
|
-
text?: string;
|
|
40
|
-
hasLeadingIcon?: boolean;
|
|
41
|
-
hasTrailingIcon?: boolean;
|
|
42
|
-
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
43
28
|
/**
|
|
44
29
|
* Card skeleton with default layout or custom children
|
|
45
30
|
*/
|
|
@@ -15,7 +15,3 @@ export declare const useSkeletonBase: (loading: boolean, children?: ReactNode) =
|
|
|
15
15
|
tokens: SkeletonTokensType;
|
|
16
16
|
prefersReducedMotion: boolean;
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Common skeleton component props validation and defaults
|
|
20
|
-
*/
|
|
21
|
-
export declare const useSkeletonDefaults: <T extends Record<string, unknown>>(props: T, defaults: Partial<T>) => T;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { default as Skeleton } from './SkeletonCompound';
|
|
2
2
|
export { default as SkeletonBase } from './Skeleton';
|
|
3
3
|
export { default as SkeletonAvatar } from './SkeletonAvatar';
|
|
4
|
-
export { default as SkeletonButton } from './SkeletonButton';
|
|
5
4
|
export { default as SkeletonCard } from './SkeletonCard';
|
|
6
5
|
export { useSkeletonBase } from './hooks/useSkeletonBase';
|
|
7
|
-
export
|
|
6
|
+
export { getSkeletonState, mergeSkeletonProps, getSkeletonDefaults, } from './utils';
|
|
7
|
+
export type { SkeletonProps, SkeletonAvatarProps, SkeletonCardProps, SkeletonSize, BaseSkeletonProps, SkeletonVariant, SkeletonShape, } from './types';
|
|
8
8
|
export type { SkeletonTokensType, ResponsiveSkeletonTokens, } from './skeleton.tokens';
|
|
9
9
|
export { getSkeletonTokens } from './skeleton.tokens';
|
|
10
10
|
export { default } from './SkeletonCompound';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BlockProps } from '../Primitives/Block/Block';
|
|
3
3
|
import { SkeletonVariant, SkeletonShape } from './skeleton.tokens';
|
|
4
|
-
import { ButtonType, ButtonSize, ButtonSubType } from '../Button/types';
|
|
5
4
|
export type SkeletonSize = 'sm' | 'md' | 'lg';
|
|
6
5
|
export type BaseSkeletonProps = {
|
|
7
6
|
variant?: SkeletonVariant;
|
|
@@ -19,17 +18,6 @@ export type SkeletonAvatarProps = BaseSkeletonProps & Omit<BlockProps, 'children
|
|
|
19
18
|
size?: SkeletonSize;
|
|
20
19
|
shape?: 'circle' | 'square';
|
|
21
20
|
};
|
|
22
|
-
export type SkeletonButtonProps = BaseSkeletonProps & Omit<BlockProps, 'children'> & {
|
|
23
|
-
buttonType?: ButtonType;
|
|
24
|
-
size?: ButtonSize;
|
|
25
|
-
subType?: ButtonSubType;
|
|
26
|
-
width?: string | number;
|
|
27
|
-
fullWidth?: boolean;
|
|
28
|
-
buttonGroupPosition?: 'center' | 'left' | 'right';
|
|
29
|
-
text?: string;
|
|
30
|
-
hasLeadingIcon?: boolean;
|
|
31
|
-
hasTrailingIcon?: boolean;
|
|
32
|
-
};
|
|
33
21
|
export type SkeletonCardProps = BaseSkeletonProps & Omit<BlockProps, 'children'> & {
|
|
34
22
|
children?: ReactNode;
|
|
35
23
|
padding?: string | number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple utility function for skeleton state logic
|
|
3
|
+
* Not a hook since it doesn't call any React hooks internally
|
|
4
|
+
*/
|
|
5
|
+
export declare function getSkeletonState(showSkeleton: boolean): {
|
|
6
|
+
shouldShowSkeleton: boolean;
|
|
7
|
+
shouldShowContent: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Helper function for merging component props with skeleton props
|
|
11
|
+
* Not a hook since it's just a pure utility function
|
|
12
|
+
*/
|
|
13
|
+
export declare function mergeSkeletonProps<TComponentProps, TSkeletonProps>(componentProps: TComponentProps, skeletonProps?: Partial<TSkeletonProps>): TComponentProps & Partial<TSkeletonProps>;
|
|
14
|
+
/**
|
|
15
|
+
* Common skeleton component props validation and defaults
|
|
16
|
+
* Renamed from useSkeletonDefaults since it's not a hook
|
|
17
|
+
*/
|
|
18
|
+
export declare function getSkeletonDefaults<T extends Record<string, unknown>>(props: T, defaults: Partial<T>): T;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { AddToastOptions, CustomToastProps } from './types';
|
|
2
|
+
import { AddToastOptions, CustomToastProps, SnackbarPosition } from './types';
|
|
4
3
|
export declare const StyledToast: React.FC<CustomToastProps>;
|
|
5
|
-
export declare const addSnackbar: ({ header, description, variant, onClose, actionButton, duration, }: AddToastOptions) => string | number;
|
|
4
|
+
export declare const addSnackbar: ({ header, description, variant, onClose, actionButton, duration, position, }: AddToastOptions) => string | number;
|
|
5
|
+
type SnackbarProps = {
|
|
6
|
+
position?: SnackbarPosition;
|
|
7
|
+
};
|
|
8
|
+
declare const Snackbar: React.FC<SnackbarProps>;
|
|
6
9
|
export default Snackbar;
|
|
@@ -4,6 +4,14 @@ export declare enum SnackbarVariant {
|
|
|
4
4
|
WARNING = "warning",
|
|
5
5
|
ERROR = "error"
|
|
6
6
|
}
|
|
7
|
+
export declare enum SnackbarPosition {
|
|
8
|
+
TOP_LEFT = "top-left",
|
|
9
|
+
TOP_RIGHT = "top-right",
|
|
10
|
+
BOTTOM_LEFT = "bottom-left",
|
|
11
|
+
BOTTOM_RIGHT = "bottom-right",
|
|
12
|
+
TOP_CENTER = "top-center",
|
|
13
|
+
BOTTOM_CENTER = "bottom-center"
|
|
14
|
+
}
|
|
7
15
|
export type AddToastOptions = {
|
|
8
16
|
header: string;
|
|
9
17
|
description?: string;
|
|
@@ -15,6 +23,7 @@ export type AddToastOptions = {
|
|
|
15
23
|
autoDismiss?: boolean;
|
|
16
24
|
};
|
|
17
25
|
duration?: number;
|
|
26
|
+
position?: SnackbarPosition;
|
|
18
27
|
};
|
|
19
28
|
export type CustomToastProps = {
|
|
20
29
|
header: string;
|
|
@@ -2,7 +2,7 @@ import { CSSObject } from 'styled-components';
|
|
|
2
2
|
import { ChangeType, StatCardVariant } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
-
export type StatCardState = 'default' | 'hover'
|
|
5
|
+
export type StatCardState = 'default' | 'hover';
|
|
6
6
|
export type StatCardTokenType = {
|
|
7
7
|
height: CSSObject['height'];
|
|
8
8
|
maxWidth: CSSObject['maxWidth'];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
2
|
+
declare const Tag: import('react').ForwardRefExoticComponent<Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
3
|
+
text: string;
|
|
4
|
+
variant?: TagVariant;
|
|
5
|
+
color?: TagColor;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
shape?: TagShape;
|
|
8
|
+
leftSlot?: import('react').ReactNode;
|
|
9
|
+
rightSlot?: import('react').ReactNode;
|
|
10
|
+
splitTagPosition?: "left" | "right";
|
|
11
|
+
} & {
|
|
12
|
+
showSkeleton?: boolean;
|
|
13
|
+
skeletonVariant?: import('../Skeleton').SkeletonVariant;
|
|
14
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export default Tag;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TagTokensType } from './tag.tokens';
|
|
2
|
+
import { TagProps, TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
3
|
+
export type TagBaseProps = TagProps & {
|
|
4
|
+
isSkeleton?: boolean;
|
|
5
|
+
tokens?: TagTokensType;
|
|
6
|
+
};
|
|
7
|
+
declare const TagBase: import('react').ForwardRefExoticComponent<Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
8
|
+
text: string;
|
|
9
|
+
variant?: TagVariant;
|
|
10
|
+
color?: TagColor;
|
|
11
|
+
size?: TagSize;
|
|
12
|
+
shape?: TagShape;
|
|
13
|
+
leftSlot?: import('react').ReactNode;
|
|
14
|
+
rightSlot?: import('react').ReactNode;
|
|
15
|
+
splitTagPosition?: "left" | "right";
|
|
16
|
+
} & {
|
|
17
|
+
isSkeleton?: boolean;
|
|
18
|
+
tokens?: TagTokensType;
|
|
19
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export default TagBase;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Tag: import('react').ForwardRefExoticComponent<
|
|
1
|
+
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
2
|
+
declare const Tag: import('react').ForwardRefExoticComponent<Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
3
|
+
text: string;
|
|
4
|
+
variant?: TagVariant;
|
|
5
|
+
color?: TagColor;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
shape?: TagShape;
|
|
8
|
+
leftSlot?: import('react').ReactNode;
|
|
9
|
+
rightSlot?: import('react').ReactNode;
|
|
10
|
+
splitTagPosition?: "left" | "right";
|
|
11
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
12
|
export default Tag;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Tag } from './
|
|
1
|
+
export { default as Tag } from './Tag';
|
|
2
2
|
export * from './types';
|
|
@@ -2,6 +2,7 @@ import { CSSObject } from 'styled-components';
|
|
|
2
2
|
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
3
3
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
4
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
5
|
+
import { Theme } from '../../context/ThemeProvider';
|
|
5
6
|
/**
|
|
6
7
|
* Tag Tokens following the pattern: [target].CSSProp.[size].[variant].[subType]
|
|
7
8
|
*
|
|
@@ -52,5 +53,5 @@ export type TagTokensType = Readonly<{
|
|
|
52
53
|
export type ResponsiveTagTokens = {
|
|
53
54
|
[key in keyof BreakpointType]: TagTokensType;
|
|
54
55
|
};
|
|
55
|
-
export declare const getTagTokens: (foundationToken: FoundationTokenType) => ResponsiveTagTokens;
|
|
56
|
+
export declare const getTagTokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveTagTokens;
|
|
56
57
|
export default getTagTokens;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { SkeletonVariant } from '../Skeleton/skeleton.tokens';
|
|
3
|
+
import { BlockProps } from '../Primitives/Block/Block';
|
|
2
4
|
export declare enum TagVariant {
|
|
3
5
|
NO_FILL = "noFill",
|
|
4
6
|
ATTENTIVE = "attentive",
|
|
@@ -22,7 +24,7 @@ export declare enum TagShape {
|
|
|
22
24
|
ROUNDED = "rounded",
|
|
23
25
|
SQUARICAL = "squarical"
|
|
24
26
|
}
|
|
25
|
-
export type TagProps = {
|
|
27
|
+
export type TagProps = Omit<BlockProps, 'children'> & {
|
|
26
28
|
text: string;
|
|
27
29
|
variant?: TagVariant;
|
|
28
30
|
color?: TagColor;
|
|
@@ -30,6 +32,9 @@ export type TagProps = {
|
|
|
30
32
|
shape?: TagShape;
|
|
31
33
|
leftSlot?: ReactNode;
|
|
32
34
|
rightSlot?: ReactNode;
|
|
33
|
-
onClick?: () => void;
|
|
34
35
|
splitTagPosition?: 'left' | 'right';
|
|
35
36
|
};
|
|
37
|
+
export type TagWithSkeletonProps = TagProps & {
|
|
38
|
+
showSkeleton?: boolean;
|
|
39
|
+
skeletonVariant?: SkeletonVariant;
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tooltipContentAnimations: import('styled-components').RuleSet<object>;
|
|
@@ -11,9 +11,16 @@ export type MerchantInfo = {
|
|
|
11
11
|
};
|
|
12
12
|
export type TopbarProps = {
|
|
13
13
|
children?: ReactNode;
|
|
14
|
+
/** Sidebar expansion state */
|
|
14
15
|
isExpanded?: boolean;
|
|
15
16
|
onToggleExpansion?: () => void;
|
|
16
17
|
showToggleButton?: boolean;
|
|
18
|
+
/** Controlled mode: Show/hide topbar */
|
|
19
|
+
isVisible?: boolean;
|
|
20
|
+
/** Callback when visibility changes (controlled mode) */
|
|
21
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
22
|
+
/** Uncontrolled mode: Initial topbar visibility (defaults to true) */
|
|
23
|
+
defaultIsVisible?: boolean;
|
|
17
24
|
sidebarTopSlot?: ReactNode;
|
|
18
25
|
topbar?: ReactNode;
|
|
19
26
|
title?: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare enum ChevronAnimationDirection {
|
|
3
|
+
DOWN = "down",
|
|
4
|
+
RIGHT = "right",
|
|
5
|
+
UP = "up",
|
|
6
|
+
LEFT = "left"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ChevronAnimationVariant {
|
|
9
|
+
ROTATE_180 = "rotate-180",
|
|
10
|
+
ROTATE_90 = "rotate-90",
|
|
11
|
+
ROTATE_270 = "rotate-270"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ChevronAnimationSize {
|
|
14
|
+
SMALL = "sm",
|
|
15
|
+
MEDIUM = "md",
|
|
16
|
+
LARGE = "lg"
|
|
17
|
+
}
|
|
18
|
+
export interface ChevronAnimationProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
isOpen?: boolean;
|
|
21
|
+
direction?: ChevronAnimationDirection;
|
|
22
|
+
variant?: ChevronAnimationVariant;
|
|
23
|
+
size?: ChevronAnimationSize;
|
|
24
|
+
color?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
animationDuration?: number;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ChevronAnimationSize, ChevronAnimationVariant, ChevronAnimationDirection } from './types';
|
|
2
|
+
export declare const getChevronTransform: (direction: ChevronAnimationDirection, variant: ChevronAnimationVariant, isOpen: boolean) => string;
|
|
3
|
+
export declare const getChevronSize: (size: ChevronAnimationSize) => string;
|
|
@@ -39,8 +39,10 @@ import { ResponsiveCodeBlockTokens } from '../components/CodeBlock/codeBlock.tok
|
|
|
39
39
|
import { ThemeType } from '../tokens';
|
|
40
40
|
import { ResponsiveSkeletonTokens } from '../components/Skeleton/skeleton.tokens';
|
|
41
41
|
import { BREAKPOINTS } from '../breakpoints/breakPoints';
|
|
42
|
+
import { ResponsiveMobileNavigationTokens } from '../components/Sidebar/SidebarMobile/mobile.tokens';
|
|
42
43
|
import { ResponsiveStepperTokens } from '../components/Stepper/stepper.tokens';
|
|
43
44
|
import { ResponsiveWorkflowTokens } from '../components/WorkflowCanvas/workflow.tokens';
|
|
45
|
+
import { Theme } from './ThemeProvider';
|
|
44
46
|
export type ComponentTokenType = {
|
|
45
47
|
TAGS?: ResponsiveTagTokens;
|
|
46
48
|
SEARCH_INPUT?: ResponsiveSearchInputTokens;
|
|
@@ -80,6 +82,7 @@ export type ComponentTokenType = {
|
|
|
80
82
|
AVATAR?: ResponsiveAvatarTokens;
|
|
81
83
|
AVATAR_GROUP?: ResponsiveAvatarGroupTokens;
|
|
82
84
|
SIDEBAR?: ResponsiveSidebarTokens;
|
|
85
|
+
MOBILE_NAVIGATION?: ResponsiveMobileNavigationTokens;
|
|
83
86
|
UPLOAD?: ResponsiveUploadTokens;
|
|
84
87
|
CODE_BLOCK?: ResponsiveCodeBlockTokens;
|
|
85
88
|
WORKFLOW_CANVAS?: ResponsiveWorkflowTokens;
|
|
@@ -88,6 +91,7 @@ type ThemeContextType = {
|
|
|
88
91
|
foundationTokens: ThemeType;
|
|
89
92
|
componentTokens: Required<ComponentTokenType>;
|
|
90
93
|
breakpoints: typeof BREAKPOINTS;
|
|
94
|
+
theme: Theme | string;
|
|
91
95
|
};
|
|
92
96
|
declare const ThemeContext: import('react').Context<ThemeContextType>;
|
|
93
97
|
export declare const useTheme: () => ThemeContextType;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { BreakpointType } from '../breakpoints/breakPoints';
|
|
2
2
|
import { ThemeType } from '../tokens';
|
|
3
3
|
import { ComponentTokenType } from './ThemeContext';
|
|
4
|
+
export declare enum Theme {
|
|
5
|
+
LIGHT = "light",
|
|
6
|
+
DARK = "dark"
|
|
7
|
+
}
|
|
4
8
|
type ThemeProviderProps = {
|
|
5
9
|
foundationTokens?: ThemeType;
|
|
6
10
|
componentTokens?: ComponentTokenType;
|
|
7
11
|
breakpoints?: BreakpointType;
|
|
12
|
+
theme?: Theme | string;
|
|
8
13
|
children: React.ReactNode;
|
|
9
14
|
};
|
|
10
|
-
declare const ThemeProvider: ({ foundationTokens, componentTokens, breakpoints, children, }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const ThemeProvider: ({ foundationTokens, componentTokens, breakpoints, theme, children, }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
16
|
export default ThemeProvider;
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as ThemeProvider } from './ThemeProvider';
|
|
1
|
+
export { default as ThemeProvider, Theme } from './ThemeProvider';
|
|
2
2
|
export { useTheme } from './ThemeContext';
|
|
3
3
|
export type { ComponentTokenType } from './ThemeContext';
|
|
4
4
|
export type { ThemeType } from '../tokens';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ThemeType } from '../tokens';
|
|
2
2
|
import { ComponentTokenType } from './ThemeContext';
|
|
3
|
-
|
|
3
|
+
import { Theme } from './ThemeProvider';
|
|
4
|
+
declare const initTokens: (componentTokens: ComponentTokenType, foundationTokens: ThemeType, theme?: Theme | string) => Required<ComponentTokenType>;
|
|
4
5
|
export default initTokens;
|