@juspay/blend-design-system 0.0.15 → 0.0.16
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/Card/utils.d.ts +86 -0
- package/dist/components/Charts/types.d.ts +5 -0
- package/dist/components/Checkbox/checkbox.token.d.ts +19 -4
- package/dist/components/Checkbox/types.d.ts +11 -2
- package/dist/components/DateRangePicker/MobileDrawerPresets.d.ts +1 -22
- package/dist/components/DateRangePicker/QuickRangeSelector.d.ts +1 -0
- package/dist/components/DateRangePicker/components/ActionButtons.d.ts +4 -0
- package/dist/components/DateRangePicker/components/DatePickerComponent.d.ts +4 -0
- package/dist/components/DateRangePicker/components/PresetItem.d.ts +4 -0
- package/dist/components/DateRangePicker/components/ScrollablePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +2 -1
- package/dist/components/DateRangePicker/types.d.ts +119 -0
- package/dist/components/DateRangePicker/utils.d.ts +143 -21
- package/dist/components/KeyValuePair/KeyValuePair.d.ts +3 -0
- package/dist/components/KeyValuePair/KeyValuePair.tokens.d.ts +19 -0
- package/dist/components/KeyValuePair/index.d.ts +2 -0
- package/dist/components/KeyValuePair/types.d.ts +19 -0
- package/dist/components/Menu/MenuItem.d.ts +2 -1
- package/dist/components/Menu/SubMenu.d.ts +2 -1
- package/dist/components/Menu/types.d.ts +2 -0
- package/dist/components/Sidebar/types.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.d.ts +8 -0
- package/dist/components/Skeleton/SkeletonAvatar.d.ts +5 -0
- package/dist/components/Skeleton/SkeletonButton.d.ts +13 -0
- package/dist/components/Skeleton/SkeletonCard.d.ts +5 -0
- package/dist/components/Skeleton/SkeletonCompound.d.ts +64 -0
- package/dist/components/Skeleton/hooks/useSkeletonBase.d.ts +21 -0
- package/dist/components/Skeleton/index.d.ts +10 -0
- package/dist/components/Skeleton/skeleton.tokens.d.ts +56 -0
- package/dist/components/Skeleton/types.d.ts +37 -0
- package/dist/components/Snackbar/Snackbar.d.ts +1 -1
- package/dist/components/Snackbar/types.d.ts +4 -0
- package/dist/components/Switch/types.d.ts +1 -1
- package/dist/components/Topbar/Topbar.d.ts +3 -0
- package/dist/components/Topbar/index.d.ts +2 -0
- package/dist/components/Topbar/topbar.tokens.d.ts +87 -0
- package/dist/components/Topbar/types.d.ts +26 -0
- package/dist/context/ThemeContext.d.ts +11 -5
- package/dist/context/useComponentToken.d.ts +4 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +16611 -14952
- package/package.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CardVariant, CardAlignment } from './types';
|
|
3
|
+
import { CardTokenType } from './card.tokens';
|
|
4
|
+
import { ButtonSubType } from '../Button/types';
|
|
5
|
+
/**
|
|
6
|
+
* Determines the card variant type
|
|
7
|
+
*/
|
|
8
|
+
export declare const getCardVariant: (variant?: CardVariant) => CardVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if card is default variant
|
|
11
|
+
*/
|
|
12
|
+
export declare const isDefaultCard: (variant?: CardVariant) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if card is aligned variant
|
|
15
|
+
*/
|
|
16
|
+
export declare const isAlignedCard: (variant?: CardVariant) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Checks if card is custom variant
|
|
19
|
+
*/
|
|
20
|
+
export declare const isCustomCard: (variant?: CardVariant) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Gets header box styles for default card
|
|
23
|
+
*/
|
|
24
|
+
export declare const getHeaderBoxStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
25
|
+
/**
|
|
26
|
+
* Gets header title styles
|
|
27
|
+
*/
|
|
28
|
+
export declare const getHeaderTitleStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
29
|
+
/**
|
|
30
|
+
* Gets sub header styles
|
|
31
|
+
*/
|
|
32
|
+
export declare const getSubHeaderStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
33
|
+
/**
|
|
34
|
+
* Gets body title styles
|
|
35
|
+
*/
|
|
36
|
+
export declare const getBodyTitleStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
37
|
+
/**
|
|
38
|
+
* Gets body content styles
|
|
39
|
+
*/
|
|
40
|
+
export declare const getBodyContentStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
41
|
+
/**
|
|
42
|
+
* Gets body container styles
|
|
43
|
+
*/
|
|
44
|
+
export declare const getBodyStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
45
|
+
/**
|
|
46
|
+
* Gets spacing between header slots
|
|
47
|
+
*/
|
|
48
|
+
export declare const getHeaderSlotSpacing: (cardToken: CardTokenType) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Gets margin bottom for header based on what follows
|
|
51
|
+
*/
|
|
52
|
+
export declare const getHeaderMarginBottom: (hasSubHeader: boolean, cardToken: CardTokenType) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Gets margin bottom for sub header
|
|
55
|
+
*/
|
|
56
|
+
export declare const getSubHeaderMarginBottom: (cardToken: CardTokenType) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Gets margin bottom for body slot 1
|
|
59
|
+
*/
|
|
60
|
+
export declare const getBodySlot1MarginBottom: (hasBodyTitle: boolean, cardToken: CardTokenType) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Gets margin bottom for body title
|
|
63
|
+
*/
|
|
64
|
+
export declare const getBodyTitleMarginBottom: (hasContent: boolean, cardToken: CardTokenType) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Gets margin bottom for content
|
|
67
|
+
*/
|
|
68
|
+
export declare const getContentMarginBottom: (hasBodySlot2: boolean, cardToken: CardTokenType) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Gets margin bottom for body slot 2
|
|
71
|
+
*/
|
|
72
|
+
export declare const getBodySlot2MarginBottom: (hasActionButton: boolean, isInlineButton: boolean, cardToken: CardTokenType) => string;
|
|
73
|
+
/**
|
|
74
|
+
* Gets alignment styles for aligned cards
|
|
75
|
+
*/
|
|
76
|
+
export declare const getAlignmentStyles: (alignment: CardAlignment, centerAlign: boolean, cardToken: CardTokenType) => React.CSSProperties;
|
|
77
|
+
/**
|
|
78
|
+
* Gets custom card styles (simple wrapper with padding)
|
|
79
|
+
*/
|
|
80
|
+
export declare const getCustomCardStyles: (cardToken: CardTokenType) => React.CSSProperties;
|
|
81
|
+
/**
|
|
82
|
+
* Determines if action button is inline type
|
|
83
|
+
*/
|
|
84
|
+
export declare const isInlineActionButton: (actionButton?: {
|
|
85
|
+
subType?: ButtonSubType;
|
|
86
|
+
}) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { ThemeType } from '../../tokens';
|
|
3
|
-
import {
|
|
3
|
+
import { CheckboxSize, CheckboxInteractionState } from './types';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
5
|
export type CheckboxTokensType = {
|
|
6
6
|
gap: CSSObject['gap'];
|
|
@@ -14,7 +14,13 @@ export type CheckboxTokensType = {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
background: {
|
|
17
|
-
|
|
17
|
+
checked?: {
|
|
18
|
+
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
19
|
+
};
|
|
20
|
+
unchecked?: {
|
|
21
|
+
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
22
|
+
};
|
|
23
|
+
indeterminate?: {
|
|
18
24
|
[key in CheckboxInteractionState]?: CSSObject['backgroundColor'];
|
|
19
25
|
};
|
|
20
26
|
};
|
|
@@ -22,7 +28,13 @@ export type CheckboxTokensType = {
|
|
|
22
28
|
radius: CSSObject['borderRadius'];
|
|
23
29
|
width: CSSObject['borderWidth'];
|
|
24
30
|
color: {
|
|
25
|
-
|
|
31
|
+
checked?: {
|
|
32
|
+
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
33
|
+
};
|
|
34
|
+
unchecked?: {
|
|
35
|
+
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
36
|
+
};
|
|
37
|
+
indeterminate?: {
|
|
26
38
|
[key in CheckboxInteractionState]?: CSSObject['borderColor'];
|
|
27
39
|
};
|
|
28
40
|
};
|
|
@@ -36,7 +48,10 @@ export type CheckboxTokensType = {
|
|
|
36
48
|
};
|
|
37
49
|
icon: {
|
|
38
50
|
color: {
|
|
39
|
-
|
|
51
|
+
checked?: {
|
|
52
|
+
[key in Extract<CheckboxInteractionState, 'default' | 'disabled'>]?: CSSObject['color'];
|
|
53
|
+
};
|
|
54
|
+
indeterminate?: {
|
|
40
55
|
[key in Extract<CheckboxInteractionState, 'default' | 'disabled'>]?: CSSObject['color'];
|
|
41
56
|
};
|
|
42
57
|
};
|
|
@@ -3,8 +3,17 @@ export declare enum CheckboxSize {
|
|
|
3
3
|
SMALL = "sm",
|
|
4
4
|
MEDIUM = "md"
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export declare enum CheckboxCheckedState {
|
|
7
|
+
CHECKED = "checked",
|
|
8
|
+
UNCHECKED = "unchecked",
|
|
9
|
+
INDETERMINATE = "indeterminate"
|
|
10
|
+
}
|
|
11
|
+
export declare enum CheckboxInteractionState {
|
|
12
|
+
DEFAULT = "default",
|
|
13
|
+
HOVER = "hover",
|
|
14
|
+
DISABLED = "disabled",
|
|
15
|
+
ERROR = "error"
|
|
16
|
+
}
|
|
8
17
|
export type CheckboxProps = {
|
|
9
18
|
id?: string;
|
|
10
19
|
value?: string;
|
|
@@ -1,25 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
type MobileDrawerPresetsProps = {
|
|
4
|
-
drawerOpen: boolean;
|
|
5
|
-
setDrawerOpen: (open: boolean) => void;
|
|
6
|
-
renderTrigger: () => React.ReactNode;
|
|
7
|
-
showPresets: boolean;
|
|
8
|
-
availablePresets: DateRangePreset[];
|
|
9
|
-
activePreset: DateRangePreset;
|
|
10
|
-
selectedRange: DateRange;
|
|
11
|
-
startTime: string;
|
|
12
|
-
endTime: string;
|
|
13
|
-
dateFormat: string;
|
|
14
|
-
handlePresetSelect: (preset: DateRangePreset) => void;
|
|
15
|
-
handleStartTimeChange: (time: string) => void;
|
|
16
|
-
handleEndTimeChange: (time: string) => void;
|
|
17
|
-
setSelectedRange: (range: DateRange) => void;
|
|
18
|
-
setStartDate: (date: string) => void;
|
|
19
|
-
setEndDate: (date: string) => void;
|
|
20
|
-
handleCancel: () => void;
|
|
21
|
-
handleApply: () => void;
|
|
22
|
-
showCustomDropdownOnly?: boolean;
|
|
23
|
-
};
|
|
2
|
+
import { MobileDrawerPresetsProps } from './types';
|
|
24
3
|
declare const MobileDrawerPresets: React.FC<MobileDrawerPresetsProps>;
|
|
25
4
|
export default MobileDrawerPresets;
|
|
@@ -8,6 +8,7 @@ type QuickRangeSelectorProps = {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
disableFutureDates?: boolean;
|
|
10
10
|
disablePastDates?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
11
12
|
};
|
|
12
13
|
declare const QuickRangeSelector: import('react').ForwardRefExoticComponent<QuickRangeSelectorProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export default QuickRangeSelector;
|
|
@@ -3,7 +3,6 @@ import { FoundationTokenType } from '../../tokens/theme.token';
|
|
|
3
3
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
4
|
export type CalendarTokenType = {
|
|
5
5
|
quickRange: {
|
|
6
|
-
width: CSSObject['width'];
|
|
7
6
|
trigger: {
|
|
8
7
|
height: CSSObject['height'];
|
|
9
8
|
borderLeft: CSSObject['borderLeft'];
|
|
@@ -20,10 +19,12 @@ export type CalendarTokenType = {
|
|
|
20
19
|
backgroundColor: CSSObject['backgroundColor'];
|
|
21
20
|
iconSize: CSSObject['iconSize'];
|
|
22
21
|
text: CSSObject;
|
|
22
|
+
gap: CSSObject['gap'];
|
|
23
23
|
};
|
|
24
24
|
content: {
|
|
25
25
|
padding: CSSObject['padding'];
|
|
26
26
|
width: CSSObject['width'];
|
|
27
|
+
maxHeight: CSSObject['maxHeight'];
|
|
27
28
|
zIndex: CSSObject['zIndex'];
|
|
28
29
|
backgroundColor: CSSObject['backgroundColor'];
|
|
29
30
|
borderRadius: CSSObject['borderRadius'];
|
|
@@ -20,6 +20,59 @@ export type DateRange = {
|
|
|
20
20
|
endDate: Date;
|
|
21
21
|
showTimePicker?: boolean;
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Predefined format presets for common date display patterns
|
|
25
|
+
*/
|
|
26
|
+
export declare enum DateFormatPreset {
|
|
27
|
+
SHORT_RANGE = "short-range",// "Sep 3-5 2025"
|
|
28
|
+
MEDIUM_RANGE = "medium-range",// "Sep 3 - Sep 5 2025"
|
|
29
|
+
LONG_RANGE = "long-range",// "Sep 3 2025 - Sep 5 2025"
|
|
30
|
+
SHORT_SINGLE = "short-single",// "Sep 3 2025"
|
|
31
|
+
MEDIUM_SINGLE = "medium-single",// "September 3, 2025"
|
|
32
|
+
LONG_SINGLE = "long-single",// "September 3rd, 2025"
|
|
33
|
+
ISO_RANGE = "iso-range",// "2025-09-03 - 2025-09-05"
|
|
34
|
+
US_RANGE = "us-range",// "09/03/2025 - 09/05/2025"
|
|
35
|
+
CUSTOM = "custom"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Custom format function type for advanced formatting
|
|
39
|
+
*/
|
|
40
|
+
export type CustomFormatFunction = (range: DateRange, options?: {
|
|
41
|
+
includeTime?: boolean;
|
|
42
|
+
includeYear?: boolean;
|
|
43
|
+
separator?: string;
|
|
44
|
+
locale?: string;
|
|
45
|
+
}) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Format configuration for date display
|
|
48
|
+
*/
|
|
49
|
+
export type DateFormatConfig = {
|
|
50
|
+
preset?: DateFormatPreset;
|
|
51
|
+
customFormat?: CustomFormatFunction;
|
|
52
|
+
includeTime?: boolean;
|
|
53
|
+
includeYear?: boolean;
|
|
54
|
+
separator?: string;
|
|
55
|
+
locale?: string;
|
|
56
|
+
timeFormat?: '12h' | '24h';
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Custom trigger configuration
|
|
60
|
+
*/
|
|
61
|
+
export type TriggerConfig = {
|
|
62
|
+
element?: ReactNode;
|
|
63
|
+
placeholder?: string;
|
|
64
|
+
showIcon?: boolean;
|
|
65
|
+
icon?: ReactNode;
|
|
66
|
+
className?: string;
|
|
67
|
+
style?: React.CSSProperties;
|
|
68
|
+
renderTrigger?: (props: {
|
|
69
|
+
selectedRange: DateRange | undefined;
|
|
70
|
+
isOpen: boolean;
|
|
71
|
+
isDisabled: boolean;
|
|
72
|
+
formattedValue: string;
|
|
73
|
+
onClick: () => void;
|
|
74
|
+
}) => ReactNode;
|
|
75
|
+
};
|
|
23
76
|
export type DateRangePickerProps = {
|
|
24
77
|
value?: DateRange;
|
|
25
78
|
onChange?: (range: DateRange) => void;
|
|
@@ -37,4 +90,70 @@ export type DateRangePickerProps = {
|
|
|
37
90
|
triggerElement?: ReactNode;
|
|
38
91
|
useDrawerOnMobile?: boolean;
|
|
39
92
|
skipQuickFiltersOnMobile?: boolean;
|
|
93
|
+
formatConfig?: DateFormatConfig;
|
|
94
|
+
triggerConfig?: TriggerConfig;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Haptic feedback types for different interactions
|
|
98
|
+
*/
|
|
99
|
+
export declare enum HapticFeedbackType {
|
|
100
|
+
SELECTION = "selection",
|
|
101
|
+
IMPACT = "impact",
|
|
102
|
+
NOTIFICATION = "notification"
|
|
103
|
+
}
|
|
104
|
+
export type PresetItemProps = {
|
|
105
|
+
preset: DateRangePreset;
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
isCustomExpanded?: boolean;
|
|
108
|
+
onPresetSelect: (preset: DateRangePreset) => void;
|
|
109
|
+
onCustomToggle?: () => void;
|
|
110
|
+
setDrawerOpen?: (open: boolean) => void;
|
|
111
|
+
isDisabled?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type ActionButtonsProps = {
|
|
114
|
+
onCancel: () => void;
|
|
115
|
+
onApply: () => void;
|
|
116
|
+
isDisabled?: boolean;
|
|
117
|
+
};
|
|
118
|
+
export type ScrollablePickerProps = {
|
|
119
|
+
items: (string | number)[];
|
|
120
|
+
selectedIndex: number;
|
|
121
|
+
onSelect: (index: number) => void;
|
|
122
|
+
isTimeColumn?: boolean;
|
|
123
|
+
columnId: string;
|
|
124
|
+
isDisabled?: boolean;
|
|
125
|
+
};
|
|
126
|
+
export type DatePickerComponentProps = {
|
|
127
|
+
selectedRange: DateRange;
|
|
128
|
+
startTime: string;
|
|
129
|
+
endTime: string;
|
|
130
|
+
dateFormat: string;
|
|
131
|
+
handleStartTimeChange: (time: string) => void;
|
|
132
|
+
handleEndTimeChange: (time: string) => void;
|
|
133
|
+
setSelectedRange: (range: DateRange) => void;
|
|
134
|
+
setStartDate: (date: string) => void;
|
|
135
|
+
setEndDate: (date: string) => void;
|
|
136
|
+
isDisabled?: boolean;
|
|
137
|
+
};
|
|
138
|
+
export type MobileDrawerPresetsProps = {
|
|
139
|
+
drawerOpen: boolean;
|
|
140
|
+
setDrawerOpen: (open: boolean) => void;
|
|
141
|
+
renderTrigger: () => React.ReactNode;
|
|
142
|
+
showPresets: boolean;
|
|
143
|
+
availablePresets: DateRangePreset[];
|
|
144
|
+
activePreset: DateRangePreset;
|
|
145
|
+
selectedRange: DateRange;
|
|
146
|
+
startTime: string;
|
|
147
|
+
endTime: string;
|
|
148
|
+
dateFormat: string;
|
|
149
|
+
handlePresetSelect: (preset: DateRangePreset) => void;
|
|
150
|
+
handleStartTimeChange: (time: string) => void;
|
|
151
|
+
handleEndTimeChange: (time: string) => void;
|
|
152
|
+
setSelectedRange: (range: DateRange) => void;
|
|
153
|
+
setStartDate: (date: string) => void;
|
|
154
|
+
setEndDate: (date: string) => void;
|
|
155
|
+
handleCancel: () => void;
|
|
156
|
+
handleApply: () => void;
|
|
157
|
+
showCustomDropdownOnly?: boolean;
|
|
158
|
+
isDisabled?: boolean;
|
|
40
159
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateRange, DateRangePreset } from './types';
|
|
1
|
+
import { DateRange, DateRangePreset, DateFormatConfig, CustomFormatFunction, HapticFeedbackType } from './types';
|
|
2
2
|
import { CalendarTokenType } from './dateRangePicker.tokens';
|
|
3
3
|
/**
|
|
4
4
|
* Formats a date according to the specified format
|
|
@@ -468,26 +468,6 @@ export declare const calculateDayCellProps: (date: Date, selectedRange: DateRang
|
|
|
468
468
|
textColor: string | unknown;
|
|
469
469
|
showTodayIndicator: boolean;
|
|
470
470
|
};
|
|
471
|
-
/**
|
|
472
|
-
* Constants for mobile date picker
|
|
473
|
-
*/
|
|
474
|
-
export declare const MOBILE_PICKER_CONSTANTS: {
|
|
475
|
-
readonly ITEM_HEIGHT: 44;
|
|
476
|
-
readonly VISIBLE_ITEMS: 3;
|
|
477
|
-
readonly SCROLL_DEBOUNCE: 50;
|
|
478
|
-
};
|
|
479
|
-
/**
|
|
480
|
-
* Validates time input - only allows numbers and colon
|
|
481
|
-
* @param input The input string to validate
|
|
482
|
-
* @returns True if input is valid
|
|
483
|
-
*/
|
|
484
|
-
export declare const isValidTimeInput: (input: string) => boolean;
|
|
485
|
-
/**
|
|
486
|
-
* Formats time input as HH:MM
|
|
487
|
-
* @param input The input string to format
|
|
488
|
-
* @returns Formatted time string
|
|
489
|
-
*/
|
|
490
|
-
export declare const formatTimeInput: (input: string) => string;
|
|
491
471
|
/**
|
|
492
472
|
* Generates picker data for date/time selection
|
|
493
473
|
* @param tabType Whether this is for start or end date
|
|
@@ -534,3 +514,145 @@ export declare const createSelectionHandler: (tabType: "start" | "end", type: "y
|
|
|
534
514
|
* @returns Display label for the preset
|
|
535
515
|
*/
|
|
536
516
|
export declare const getPresetDisplayLabel: (preset: DateRangePreset) => string;
|
|
517
|
+
/**
|
|
518
|
+
* Enhanced date range formatting with preset patterns
|
|
519
|
+
* @param range The date range to format
|
|
520
|
+
* @param config Format configuration
|
|
521
|
+
* @returns Formatted date range string
|
|
522
|
+
*/
|
|
523
|
+
export declare const formatDateRangeWithConfig: (range: DateRange, config?: DateFormatConfig) => string;
|
|
524
|
+
/**
|
|
525
|
+
* Creates a custom trigger element with enhanced formatting
|
|
526
|
+
* @param range Current selected date range
|
|
527
|
+
* @param config Format configuration
|
|
528
|
+
* @param placeholder Placeholder text when no range is selected
|
|
529
|
+
* @returns Formatted display string for trigger
|
|
530
|
+
*/
|
|
531
|
+
export declare const formatTriggerDisplay: (range: DateRange | undefined, config?: DateFormatConfig, placeholder?: string) => string;
|
|
532
|
+
/**
|
|
533
|
+
* Predefined format configurations for common use cases
|
|
534
|
+
*/
|
|
535
|
+
export declare const FORMAT_PRESETS: {
|
|
536
|
+
readonly COMPACT_NO_TIME: DateFormatConfig;
|
|
537
|
+
readonly COMPACT_NO_YEAR: DateFormatConfig;
|
|
538
|
+
readonly MEDIUM_NO_TIME: DateFormatConfig;
|
|
539
|
+
readonly MEDIUM_WITH_TIME: DateFormatConfig;
|
|
540
|
+
readonly VERBOSE_NO_TIME: DateFormatConfig;
|
|
541
|
+
readonly VERBOSE_WITH_TIME: DateFormatConfig;
|
|
542
|
+
readonly ISO_FORMAT: DateFormatConfig;
|
|
543
|
+
readonly ISO_WITH_TIME: DateFormatConfig;
|
|
544
|
+
readonly US_FORMAT: DateFormatConfig;
|
|
545
|
+
readonly US_WITH_TIME: DateFormatConfig;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* Helper function to create custom format functions
|
|
549
|
+
* @param formatFn Custom formatting function
|
|
550
|
+
* @returns DateFormatConfig with custom format
|
|
551
|
+
*/
|
|
552
|
+
export declare const createCustomFormat: (formatFn: CustomFormatFunction) => DateFormatConfig;
|
|
553
|
+
/**
|
|
554
|
+
* Example custom format functions
|
|
555
|
+
*/
|
|
556
|
+
export declare const CUSTOM_FORMAT_EXAMPLES: {
|
|
557
|
+
RELATIVE: DateFormatConfig;
|
|
558
|
+
BUSINESS: DateFormatConfig;
|
|
559
|
+
MINIMAL: DateFormatConfig;
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* Enhanced haptic feedback utility with better error handling
|
|
563
|
+
* @param type The type of haptic feedback to trigger
|
|
564
|
+
*/
|
|
565
|
+
export declare const triggerHapticFeedback: (type?: HapticFeedbackType) => void;
|
|
566
|
+
/**
|
|
567
|
+
* Optimized Apple Calendar-style haptic manager
|
|
568
|
+
*/
|
|
569
|
+
export declare class AppleCalendarHapticManager {
|
|
570
|
+
private lastHapticTime;
|
|
571
|
+
private lastHapticIndex;
|
|
572
|
+
private readonly hapticCooldown;
|
|
573
|
+
private isDestroyed;
|
|
574
|
+
/**
|
|
575
|
+
* Triggers haptic feedback when scrolling to a new item
|
|
576
|
+
* @param currentIndex The current selected index
|
|
577
|
+
*/
|
|
578
|
+
triggerScrollHaptic(currentIndex: number): void;
|
|
579
|
+
triggerSelectionHaptic(): void;
|
|
580
|
+
reset(): void;
|
|
581
|
+
destroy(): void;
|
|
582
|
+
}
|
|
583
|
+
export declare const APPLE_CALENDAR_CONSTANTS: {
|
|
584
|
+
readonly SNAP_DURATION: 300;
|
|
585
|
+
readonly MOMENTUM_THRESHOLD: 0.03;
|
|
586
|
+
readonly DECELERATION_RATE: 0.95;
|
|
587
|
+
readonly MIN_VELOCITY: 0.01;
|
|
588
|
+
readonly MAX_MOMENTUM_DISTANCE: 2;
|
|
589
|
+
readonly VELOCITY_MULTIPLIER: 0.15;
|
|
590
|
+
readonly VELOCITY_SMOOTHING: 0.8;
|
|
591
|
+
readonly SCROLL_RESISTANCE: 0.9;
|
|
592
|
+
readonly SCALE_SELECTED: 1.02;
|
|
593
|
+
readonly SCALE_UNSELECTED: 0.98;
|
|
594
|
+
readonly OPACITY_SELECTED: 1;
|
|
595
|
+
readonly OPACITY_UNSELECTED: 0.9;
|
|
596
|
+
readonly TRANSITION_DURATION: "180ms";
|
|
597
|
+
readonly EASING: "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
|
|
598
|
+
readonly ANIMATION_FRAME_LIMIT: 60;
|
|
599
|
+
readonly VELOCITY_HISTORY_SIZE: 3;
|
|
600
|
+
};
|
|
601
|
+
export declare const MOBILE_PICKER_CONSTANTS: {
|
|
602
|
+
readonly ITEM_HEIGHT: 44;
|
|
603
|
+
readonly VISIBLE_ITEMS: 3;
|
|
604
|
+
readonly SCROLL_DEBOUNCE: 80;
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* Safely gets an item from an array with comprehensive bounds checking
|
|
608
|
+
* @param items The array of items
|
|
609
|
+
* @param index The index to access
|
|
610
|
+
* @returns The item at the index or empty string if out of bounds
|
|
611
|
+
*/
|
|
612
|
+
export declare const safeGetPickerItem: (items: (string | number)[], index: number) => string;
|
|
613
|
+
/**
|
|
614
|
+
* Calculates the visible items for the picker with robust bounds checking
|
|
615
|
+
* @param items The array of items
|
|
616
|
+
* @param selectedIndex The currently selected index
|
|
617
|
+
* @returns Object with top, center, and bottom items plus availability flags
|
|
618
|
+
*/
|
|
619
|
+
export declare const getPickerVisibleItems: (items: (string | number)[], selectedIndex: number) => {
|
|
620
|
+
topItem: string;
|
|
621
|
+
centerItem: string;
|
|
622
|
+
bottomItem: string;
|
|
623
|
+
hasTopItem: boolean;
|
|
624
|
+
hasBottomItem: boolean;
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* Validates and clamps an index to array bounds with safety checks
|
|
628
|
+
* @param index The index to validate
|
|
629
|
+
* @param arrayLength The length of the array
|
|
630
|
+
* @returns Clamped index within bounds
|
|
631
|
+
*/
|
|
632
|
+
export declare const clampPickerIndex: (index: number, arrayLength: number) => number;
|
|
633
|
+
/**
|
|
634
|
+
* Calculates scroll position for a given index with validation
|
|
635
|
+
* @param index The target index
|
|
636
|
+
* @param itemHeight Height of each item
|
|
637
|
+
* @returns Scroll position in pixels
|
|
638
|
+
*/
|
|
639
|
+
export declare const calculateScrollPosition: (index: number, itemHeight: number) => number;
|
|
640
|
+
/**
|
|
641
|
+
* Calculates index from scroll position with bounds checking
|
|
642
|
+
* @param scrollTop Current scroll position
|
|
643
|
+
* @param itemHeight Height of each item
|
|
644
|
+
* @returns Calculated index
|
|
645
|
+
*/
|
|
646
|
+
export declare const calculateIndexFromScroll: (scrollTop: number, itemHeight: number) => number;
|
|
647
|
+
/**
|
|
648
|
+
* Validates time input with comprehensive checks
|
|
649
|
+
* @param input The input string to validate
|
|
650
|
+
* @returns True if input is valid
|
|
651
|
+
*/
|
|
652
|
+
export declare const isValidTimeInput: (input: string) => boolean;
|
|
653
|
+
/**
|
|
654
|
+
* Formats time input with better validation
|
|
655
|
+
* @param input The input string to format
|
|
656
|
+
* @returns Formatted time string
|
|
657
|
+
*/
|
|
658
|
+
export declare const formatTimeInput: (input: string) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
3
|
+
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
+
import { KeyValuePairSize, KeyValuePairStateType } from './types';
|
|
5
|
+
export type KeyValuePairTokensType = {
|
|
6
|
+
gap: CSSObject['gap'];
|
|
7
|
+
keyColor: CSSObject['color'];
|
|
8
|
+
valueColor: CSSObject['color'];
|
|
9
|
+
keyFontSize: CSSObject['fontSize'];
|
|
10
|
+
valueFontSize: {
|
|
11
|
+
[key in KeyValuePairSize]: {
|
|
12
|
+
[key in KeyValuePairStateType]: CSSObject['fontSize'];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type ResponsiveKeyValuePairTokens = {
|
|
17
|
+
[key in keyof BreakpointType]: KeyValuePairTokensType;
|
|
18
|
+
};
|
|
19
|
+
export declare const getKeyValuePairTokens: (foundationToken: FoundationTokenType) => ResponsiveKeyValuePairTokens;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum KeyValuePairStateType {
|
|
2
|
+
vertical = 0,
|
|
3
|
+
horizontal = 1
|
|
4
|
+
}
|
|
5
|
+
export declare enum KeyValuePairSize {
|
|
6
|
+
SMALL = "sm",
|
|
7
|
+
MEDIUM = "md",
|
|
8
|
+
LARGE = "lg"
|
|
9
|
+
}
|
|
10
|
+
export type KeyValuePairPropTypes = {
|
|
11
|
+
keyString: string;
|
|
12
|
+
size?: KeyValuePairSize;
|
|
13
|
+
value?: string;
|
|
14
|
+
keySlot?: React.ReactNode;
|
|
15
|
+
valueLeftSlot?: React.ReactNode;
|
|
16
|
+
valueRightSlot?: React.ReactNode;
|
|
17
|
+
keyValuePairState?: KeyValuePairStateType;
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
};
|
|
@@ -48,6 +48,8 @@ export type MenuItemV2Type = {
|
|
|
48
48
|
disabled?: boolean;
|
|
49
49
|
onClick?: () => void;
|
|
50
50
|
subMenu?: MenuItemV2Type[];
|
|
51
|
+
enableSubMenuSearch?: boolean;
|
|
52
|
+
subMenuSearchPlaceholder?: string;
|
|
51
53
|
tooltip?: string | React.ReactNode;
|
|
52
54
|
tooltipProps?: {
|
|
53
55
|
side?: TooltipSide;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DirectoryData } from '../Directory/types';
|
|
3
|
+
import { MerchantInfo } from '../Topbar/types';
|
|
3
4
|
export type LeftPanelItem = {
|
|
4
5
|
label: string;
|
|
5
6
|
icon: ReactNode;
|
|
@@ -19,4 +20,6 @@ export type SidebarProps = {
|
|
|
19
20
|
footer?: ReactNode;
|
|
20
21
|
sidebarTopSlot?: ReactNode;
|
|
21
22
|
sidebarCollapseKey?: string;
|
|
23
|
+
merchantInfo?: MerchantInfo;
|
|
24
|
+
rightActions?: ReactNode;
|
|
22
25
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const Skeleton: import('react').ForwardRefExoticComponent<import('./types').BaseSkeletonProps & Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
2
|
+
children?: import('react').ReactNode;
|
|
3
|
+
animate?: boolean;
|
|
4
|
+
width?: string | number;
|
|
5
|
+
height?: string | number;
|
|
6
|
+
shape?: import('./skeleton.tokens').SkeletonShape;
|
|
7
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default Skeleton;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const SkeletonAvatar: import('react').ForwardRefExoticComponent<import('./types').BaseSkeletonProps & Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
2
|
+
size?: import('./types').SkeletonSize;
|
|
3
|
+
shape?: "circle" | "square";
|
|
4
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export default SkeletonAvatar;
|