@juspay/blend-design-system 0.0.17-beta → 0.0.18-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/Charts/ChartUtils.d.ts +8 -2
- package/dist/components/Charts/types.d.ts +3 -1
- package/dist/components/DataTable/ColumnManager.d.ts +1 -1
- package/dist/components/DataTable/TableHeader/types.d.ts +12 -0
- package/dist/components/DataTable/types.d.ts +24 -0
- package/dist/components/DateRangePicker/CalendarGrid.d.ts +2 -0
- package/dist/components/DateRangePicker/QuickRangeSelector.d.ts +2 -1
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +20 -5
- package/dist/components/DateRangePicker/types.d.ts +16 -0
- package/dist/components/DateRangePicker/utils.d.ts +53 -6
- package/dist/components/KeyValuePair/KeyValuePair.tokens.d.ts +29 -9
- package/dist/components/MultiSelect/types.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.d.ts +1 -2
- package/dist/components/Sidebar/SidebarFooter.d.ts +6 -0
- package/dist/components/Sidebar/SidebarHeader.d.ts +12 -0
- package/dist/components/Sidebar/TenantPanel.d.ts +15 -0
- package/dist/components/Sidebar/types.d.ts +15 -0
- package/dist/components/Sidebar/utils.d.ts +25 -0
- package/dist/components/Topbar/topbar.tokens.d.ts +0 -1
- package/dist/main.js +16265 -14861
- package/package.json +1 -1
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { NewNestedDataPoint, FlattenedDataPoint, AxisType, XAxisConfig } from './types';
|
|
2
2
|
export declare function transformNestedData(data: NewNestedDataPoint[], selectedKeys?: string[]): FlattenedDataPoint[];
|
|
3
|
+
export declare function transformScatterData(data: NewNestedDataPoint[], selectedKeys?: string[]): Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
seriesKey: string;
|
|
8
|
+
}>;
|
|
3
9
|
export declare function lightenHexColor(hex: string, amount?: number): string;
|
|
4
10
|
export declare const formatNumber: (value: number | string) => string;
|
|
5
11
|
export declare const capitaliseCamelCase: (text: string) => string;
|
|
6
|
-
export declare const createSmartDateTimeFormatter: (timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
|
|
7
|
-
export declare const getAxisFormatterWithConfig: (axisType: AxisType, dateOnly?: boolean, smart?: boolean, timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
|
|
12
|
+
export declare const createSmartDateTimeFormatter: (timeZone?: string, hour12?: boolean, showYear?: boolean) => ((value: string | number) => string);
|
|
13
|
+
export declare const getAxisFormatterWithConfig: (axisType: AxisType, dateOnly?: boolean, smart?: boolean, timeZone?: string, hour12?: boolean, showYear?: boolean, forTooltip?: boolean) => ((value: string | number) => string);
|
|
8
14
|
export declare const createStableSmartFormatter: (xAxisConfig: XAxisConfig, flattenedData: FlattenedDataPoint[]) => ((value: string | number) => string) | undefined;
|
|
9
15
|
export declare const getAxisFormatter: (axisType: AxisType, timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
|
|
@@ -24,7 +24,8 @@ export declare enum ChartLegendPosition {
|
|
|
24
24
|
export declare enum ChartType {
|
|
25
25
|
LINE = "line",
|
|
26
26
|
BAR = "bar",
|
|
27
|
-
PIE = "pie"
|
|
27
|
+
PIE = "pie",
|
|
28
|
+
SCATTER = "scatter"
|
|
28
29
|
}
|
|
29
30
|
export declare enum LegendsChangeType {
|
|
30
31
|
INCREASE = "increase",
|
|
@@ -69,6 +70,7 @@ export type AxisConfig = {
|
|
|
69
70
|
smart?: boolean;
|
|
70
71
|
timeZone?: string;
|
|
71
72
|
hour12?: boolean;
|
|
73
|
+
showYear?: boolean;
|
|
72
74
|
};
|
|
73
75
|
export type XAxisConfig = AxisConfig;
|
|
74
76
|
export type YAxisConfig = AxisConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnManagerProps } from './types';
|
|
2
2
|
export declare const ColumnManager: {
|
|
3
|
-
<T extends Record<string, unknown>>({ columns, visibleColumns, onColumnChange, maxSelections, alwaysSelectedColumns, }: ColumnManagerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
<T extends Record<string, unknown>>({ columns, visibleColumns, onColumnChange, maxSelections, alwaysSelectedColumns, columnManagerPrimaryAction, columnManagerSecondaryAction, }: ColumnManagerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -9,6 +9,18 @@ export type TableHeaderProps<T extends Record<string, unknown>> = {
|
|
|
9
9
|
enableColumnManager?: boolean;
|
|
10
10
|
columnManagerMaxSelections?: number;
|
|
11
11
|
columnManagerAlwaysSelected?: string[];
|
|
12
|
+
columnManagerPrimaryAction?: {
|
|
13
|
+
text: string;
|
|
14
|
+
onClick: (selectedColumns: string[]) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
};
|
|
18
|
+
columnManagerSecondaryAction?: {
|
|
19
|
+
text: string;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
};
|
|
12
24
|
enableRowExpansion?: boolean;
|
|
13
25
|
enableRowSelection?: boolean;
|
|
14
26
|
rowActions?: RowActionsConfig<T>;
|
|
@@ -87,6 +87,18 @@ export type ColumnManagerProps<T extends Record<string, unknown>> = {
|
|
|
87
87
|
onColumnChange: (columns: ColumnDefinition<T>[]) => void;
|
|
88
88
|
maxSelections?: number;
|
|
89
89
|
alwaysSelectedColumns?: string[];
|
|
90
|
+
columnManagerPrimaryAction?: {
|
|
91
|
+
text: string;
|
|
92
|
+
onClick: (selectedColumns: string[]) => void;
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
loading?: boolean;
|
|
95
|
+
};
|
|
96
|
+
columnManagerSecondaryAction?: {
|
|
97
|
+
text: string;
|
|
98
|
+
onClick: () => void;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
loading?: boolean;
|
|
101
|
+
};
|
|
90
102
|
};
|
|
91
103
|
export type AdvancedFilterProps = {
|
|
92
104
|
filters: unknown[];
|
|
@@ -223,6 +235,18 @@ export type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
223
235
|
enableColumnManager?: boolean;
|
|
224
236
|
columnManagerMaxSelections?: number;
|
|
225
237
|
columnManagerAlwaysSelected?: (keyof T)[];
|
|
238
|
+
columnManagerPrimaryAction?: {
|
|
239
|
+
text: string;
|
|
240
|
+
onClick: (selectedColumns: string[]) => void;
|
|
241
|
+
disabled?: boolean;
|
|
242
|
+
loading?: boolean;
|
|
243
|
+
};
|
|
244
|
+
columnManagerSecondaryAction?: {
|
|
245
|
+
text: string;
|
|
246
|
+
onClick: () => void;
|
|
247
|
+
disabled?: boolean;
|
|
248
|
+
loading?: boolean;
|
|
249
|
+
};
|
|
226
250
|
pagination?: PaginationConfig;
|
|
227
251
|
serverSidePagination?: boolean;
|
|
228
252
|
onPageChange?: (page: number) => void;
|
|
@@ -6,6 +6,8 @@ type CalendarGridProps = {
|
|
|
6
6
|
allowSingleDateSelection?: boolean;
|
|
7
7
|
disableFutureDates?: boolean;
|
|
8
8
|
disablePastDates?: boolean;
|
|
9
|
+
hideFutureDates?: boolean;
|
|
10
|
+
hidePastDates?: boolean;
|
|
9
11
|
showDateTimePicker?: boolean;
|
|
10
12
|
};
|
|
11
13
|
declare const CalendarGrid: import('react').ForwardRefExoticComponent<CalendarGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateRangePreset } from './types';
|
|
1
|
+
import { DateRangePreset, DateRangePickerSize } from './types';
|
|
2
2
|
type QuickRangeSelectorProps = {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
onToggle: () => void;
|
|
@@ -9,6 +9,7 @@ type QuickRangeSelectorProps = {
|
|
|
9
9
|
disableFutureDates?: boolean;
|
|
10
10
|
disablePastDates?: boolean;
|
|
11
11
|
isDisabled?: boolean;
|
|
12
|
+
size?: DateRangePickerSize;
|
|
12
13
|
};
|
|
13
14
|
declare const QuickRangeSelector: import('react').ForwardRefExoticComponent<QuickRangeSelectorProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
15
|
export default QuickRangeSelector;
|
|
@@ -4,13 +4,11 @@ import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
|
4
4
|
export type CalendarTokenType = {
|
|
5
5
|
quickRange: {
|
|
6
6
|
trigger: {
|
|
7
|
-
height: CSSObject['height'];
|
|
8
7
|
borderLeft: CSSObject['borderLeft'];
|
|
9
8
|
borderTop: CSSObject['borderTop'];
|
|
10
9
|
borderBottom: CSSObject['borderBottom'];
|
|
11
10
|
borderTopLeftRadius: CSSObject['borderTopLeftRadius'];
|
|
12
11
|
borderBottomLeftRadius: CSSObject['borderBottomLeftRadius'];
|
|
13
|
-
padding: CSSObject['padding'];
|
|
14
12
|
display: CSSObject['display'];
|
|
15
13
|
justifyContent: CSSObject['justifyContent'];
|
|
16
14
|
alignItems: CSSObject['alignItems'];
|
|
@@ -20,6 +18,16 @@ export type CalendarTokenType = {
|
|
|
20
18
|
iconSize: CSSObject['iconSize'];
|
|
21
19
|
text: CSSObject;
|
|
22
20
|
gap: CSSObject['gap'];
|
|
21
|
+
padding: {
|
|
22
|
+
sm: CSSObject['padding'];
|
|
23
|
+
md: CSSObject['padding'];
|
|
24
|
+
lg: CSSObject['padding'];
|
|
25
|
+
};
|
|
26
|
+
fontSize: {
|
|
27
|
+
sm: CSSObject['fontSize'];
|
|
28
|
+
md: CSSObject['fontSize'];
|
|
29
|
+
lg: CSSObject['fontSize'];
|
|
30
|
+
};
|
|
23
31
|
};
|
|
24
32
|
content: {
|
|
25
33
|
padding: CSSObject['padding'];
|
|
@@ -144,16 +152,13 @@ export type CalendarTokenType = {
|
|
|
144
152
|
};
|
|
145
153
|
};
|
|
146
154
|
trigger: {
|
|
147
|
-
height: CSSObject['height'];
|
|
148
155
|
display: CSSObject['display'];
|
|
149
156
|
alignItems: CSSObject['alignItems'];
|
|
150
157
|
justifyContent: CSSObject['justifyContent'];
|
|
151
|
-
padding: CSSObject['padding'];
|
|
152
158
|
border: CSSObject['border'];
|
|
153
159
|
borderRadius: CSSObject['borderRadius'];
|
|
154
160
|
boxShadow: CSSObject['boxShadow'];
|
|
155
161
|
backgroundColor: CSSObject['backgroundColor'];
|
|
156
|
-
fontSize: CSSObject['fontSize'];
|
|
157
162
|
color: CSSObject['color'];
|
|
158
163
|
cursor: CSSObject['cursor'];
|
|
159
164
|
disabled: {
|
|
@@ -162,6 +167,16 @@ export type CalendarTokenType = {
|
|
|
162
167
|
};
|
|
163
168
|
borderRadiusWithPresets: CSSObject['borderRadius'];
|
|
164
169
|
borderRadiusWithoutPresets: CSSObject['borderRadius'];
|
|
170
|
+
padding: {
|
|
171
|
+
sm: CSSObject['padding'];
|
|
172
|
+
md: CSSObject['padding'];
|
|
173
|
+
lg: CSSObject['padding'];
|
|
174
|
+
};
|
|
175
|
+
fontSize: {
|
|
176
|
+
sm: CSSObject['fontSize'];
|
|
177
|
+
md: CSSObject['fontSize'];
|
|
178
|
+
lg: CSSObject['fontSize'];
|
|
179
|
+
};
|
|
165
180
|
};
|
|
166
181
|
calendar: {
|
|
167
182
|
minWidth: CSSObject['minWidth'];
|
|
@@ -15,6 +15,11 @@ export declare enum DateRangePreset {
|
|
|
15
15
|
NEXT_3_MONTHS = "next3Months",
|
|
16
16
|
NEXT_12_MONTHS = "next12Months"
|
|
17
17
|
}
|
|
18
|
+
export declare enum DateRangePickerSize {
|
|
19
|
+
SMALL = "sm",
|
|
20
|
+
MEDIUM = "md",
|
|
21
|
+
LARGE = "lg"
|
|
22
|
+
}
|
|
18
23
|
export type DateRange = {
|
|
19
24
|
startDate: Date;
|
|
20
25
|
endDate: Date;
|
|
@@ -87,9 +92,12 @@ export type DateRangePickerProps = {
|
|
|
87
92
|
allowSingleDateSelection?: boolean;
|
|
88
93
|
disableFutureDates?: boolean;
|
|
89
94
|
disablePastDates?: boolean;
|
|
95
|
+
hideFutureDates?: boolean;
|
|
96
|
+
hidePastDates?: boolean;
|
|
90
97
|
triggerElement?: ReactNode;
|
|
91
98
|
useDrawerOnMobile?: boolean;
|
|
92
99
|
skipQuickFiltersOnMobile?: boolean;
|
|
100
|
+
size?: DateRangePickerSize;
|
|
93
101
|
formatConfig?: DateFormatConfig;
|
|
94
102
|
triggerConfig?: TriggerConfig;
|
|
95
103
|
};
|
|
@@ -114,6 +122,8 @@ export type ActionButtonsProps = {
|
|
|
114
122
|
onCancel: () => void;
|
|
115
123
|
onApply: () => void;
|
|
116
124
|
isDisabled?: boolean;
|
|
125
|
+
isApplyDisabled?: boolean;
|
|
126
|
+
applyDisabledMessage?: string;
|
|
117
127
|
};
|
|
118
128
|
export type ScrollablePickerProps = {
|
|
119
129
|
items: (string | number)[];
|
|
@@ -134,6 +144,8 @@ export type DatePickerComponentProps = {
|
|
|
134
144
|
setStartDate: (date: string) => void;
|
|
135
145
|
setEndDate: (date: string) => void;
|
|
136
146
|
isDisabled?: boolean;
|
|
147
|
+
disableFutureDates?: boolean;
|
|
148
|
+
disablePastDates?: boolean;
|
|
137
149
|
};
|
|
138
150
|
export type MobileDrawerPresetsProps = {
|
|
139
151
|
drawerOpen: boolean;
|
|
@@ -156,4 +168,8 @@ export type MobileDrawerPresetsProps = {
|
|
|
156
168
|
handleApply: () => void;
|
|
157
169
|
showCustomDropdownOnly?: boolean;
|
|
158
170
|
isDisabled?: boolean;
|
|
171
|
+
isApplyDisabled?: boolean;
|
|
172
|
+
applyDisabledMessage?: string;
|
|
173
|
+
disableFutureDates?: boolean;
|
|
174
|
+
disablePastDates?: boolean;
|
|
159
175
|
};
|
|
@@ -109,10 +109,10 @@ export declare const generateCalendarGrid: (year: number, month: number) => (num
|
|
|
109
109
|
*/
|
|
110
110
|
export declare const isStartDate: (date: Date, selectedRange: DateRange) => boolean;
|
|
111
111
|
/**
|
|
112
|
-
* Checks if a date is the end date of a range
|
|
112
|
+
* Checks if a date is the end date of a range (but not if it's the same as start date)
|
|
113
113
|
* @param date The date to check
|
|
114
114
|
* @param selectedRange The selected date range
|
|
115
|
-
* @returns True if the date is the end date
|
|
115
|
+
* @returns True if the date is the end date and different from start date
|
|
116
116
|
*/
|
|
117
117
|
export declare const isEndDate: (date: Date, selectedRange: DateRange) => boolean;
|
|
118
118
|
/**
|
|
@@ -130,7 +130,13 @@ export declare const isInSelectedRange: (date: Date, selectedRange: DateRange) =
|
|
|
130
130
|
*/
|
|
131
131
|
export declare const isDateToday: (date: Date, today: Date) => boolean;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* Creates a proper single date range (24-hour selection within the same day)
|
|
134
|
+
* @param date The date to create a range for
|
|
135
|
+
* @returns DateRange spanning the entire day (same date, different times)
|
|
136
|
+
*/
|
|
137
|
+
export declare const createSingleDateRange: (date: Date) => DateRange;
|
|
138
|
+
/**
|
|
139
|
+
* Handles date click logic for calendar with clean first click = start, second click = end pattern
|
|
134
140
|
* @param clickedDate The date that was clicked
|
|
135
141
|
* @param selectedRange Current selected range
|
|
136
142
|
* @param allowSingleDateSelection Whether single date selection is allowed
|
|
@@ -206,9 +212,11 @@ export declare const getMonthName: (monthIndex: number) => string;
|
|
|
206
212
|
export declare const getDayNames: () => string[];
|
|
207
213
|
/**
|
|
208
214
|
* Calculates the height of a single month in the calendar
|
|
215
|
+
* @param year The year of the month
|
|
216
|
+
* @param month The month (0-based)
|
|
209
217
|
* @returns Height in pixels
|
|
210
218
|
*/
|
|
211
|
-
export declare const getMonthHeight: () => number;
|
|
219
|
+
export declare const getMonthHeight: (year?: number, month?: number) => number;
|
|
212
220
|
/**
|
|
213
221
|
* Calculates which months should be visible in the viewport
|
|
214
222
|
* @param scrollTop Current scroll position
|
|
@@ -324,9 +332,11 @@ export type DateRangePickerTokens = {
|
|
|
324
332
|
* Validates date format and date values
|
|
325
333
|
* @param value The input value to validate
|
|
326
334
|
* @param format The expected format (e.g., 'dd/MM/yyyy')
|
|
335
|
+
* @param disableFutureDates Whether future dates should be disabled
|
|
336
|
+
* @param disablePastDates Whether past dates should be disabled
|
|
327
337
|
* @returns Validation result with specific error type
|
|
328
338
|
*/
|
|
329
|
-
export declare const validateDateInput: (value: string, format: string) => DateValidationResult;
|
|
339
|
+
export declare const validateDateInput: (value: string, format: string, disableFutureDates?: boolean, disablePastDates?: boolean) => DateValidationResult;
|
|
330
340
|
/**
|
|
331
341
|
* Formats date input as user types, adding slashes automatically
|
|
332
342
|
* @param value The input value to format
|
|
@@ -354,9 +364,12 @@ export declare const formatDateDisplay: (selectedRange: DateRange, allowSingleDa
|
|
|
354
364
|
* @param dateFormat Date format string
|
|
355
365
|
* @param currentRange Current selected range
|
|
356
366
|
* @param timeValue Current time value (HH:mm)
|
|
367
|
+
* @param isStartDate Whether this is start date or end date
|
|
368
|
+
* @param disableFutureDates Whether future dates should be disabled
|
|
369
|
+
* @param disablePastDates Whether past dates should be disabled
|
|
357
370
|
* @returns Object with formatted value, validation result, and updated range
|
|
358
371
|
*/
|
|
359
|
-
export declare const handleDateInputChange: (value: string, dateFormat: string, currentRange: DateRange, timeValue: string, isStartDate?: boolean) => {
|
|
372
|
+
export declare const handleDateInputChange: (value: string, dateFormat: string, currentRange: DateRange, timeValue: string, isStartDate?: boolean, disableFutureDates?: boolean, disablePastDates?: boolean) => {
|
|
360
373
|
formattedValue: string;
|
|
361
374
|
validation: DateValidationResult;
|
|
362
375
|
updatedRange?: DateRange;
|
|
@@ -656,3 +669,37 @@ export declare const isValidTimeInput: (input: string) => boolean;
|
|
|
656
669
|
* @returns Formatted time string
|
|
657
670
|
*/
|
|
658
671
|
export declare const formatTimeInput: (input: string) => string;
|
|
672
|
+
/**
|
|
673
|
+
* Validates if a date range has valid date/time combinations
|
|
674
|
+
* @param range The date range to validate
|
|
675
|
+
* @param allowSingleDateSelection Whether single date selection is allowed
|
|
676
|
+
* @returns Validation result with specific error information
|
|
677
|
+
*/
|
|
678
|
+
export declare const validateDateTimeRange: (range: DateRange) => {
|
|
679
|
+
isValid: boolean;
|
|
680
|
+
error: "none" | "invalid-time-order" | "missing-dates" | "invalid-single-date";
|
|
681
|
+
message?: string;
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* Checks if a date should be hidden from calendar view
|
|
685
|
+
* @param date The date to check
|
|
686
|
+
* @param today Today's date
|
|
687
|
+
* @param disableFutureDates Whether future dates should be hidden
|
|
688
|
+
* @param disablePastDates Whether past dates should be hidden
|
|
689
|
+
* @param hideFutureDates Whether to completely hide future dates (not just disable)
|
|
690
|
+
* @param hidePastDates Whether to completely hide past dates (not just disable)
|
|
691
|
+
* @returns True if the date should be hidden
|
|
692
|
+
*/
|
|
693
|
+
export declare const shouldHideDateFromCalendar: (date: Date, today: Date, hideFutureDates?: boolean, hidePastDates?: boolean) => boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Enhanced calendar date click handler with proper single date selection
|
|
696
|
+
* @param clickedDate The date that was clicked
|
|
697
|
+
* @param selectedRange Current selected range
|
|
698
|
+
* @param allowSingleDateSelection Whether single date selection is allowed
|
|
699
|
+
* @param today Today's date for validation
|
|
700
|
+
* @param disableFutureDates Whether future dates are disabled
|
|
701
|
+
* @param disablePastDates Whether past dates are disabled
|
|
702
|
+
* @param isDoubleClick Whether this is a double-click event
|
|
703
|
+
* @returns New date range or null if click should be ignored
|
|
704
|
+
*/
|
|
705
|
+
export declare const handleEnhancedCalendarDateClick: (clickedDate: Date, selectedRange: DateRange, allowSingleDateSelection: boolean | undefined, today: Date, disableFutureDates?: boolean, disablePastDates?: boolean, isDoubleClick?: boolean) => DateRange | null;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { KeyValuePairSize } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
|
-
import {
|
|
4
|
+
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
+
/**
|
|
6
|
+
* KeyValuePair Tokens following the pattern: [target].CSSProp.[size].[state]
|
|
7
|
+
* component.CSSProp.[size].[variant].[subType].[state].value
|
|
8
|
+
* Structure:
|
|
9
|
+
* - target: container | key | value (defines what element the token applies to)
|
|
10
|
+
* - CSSProp: gap | color | fontSize
|
|
11
|
+
* - size: sm | md | lg (only for size-dependent properties like value fontSize)
|
|
12
|
+
* - state: vertical | horizontal (layout state)
|
|
13
|
+
*
|
|
14
|
+
* Size-independent properties: gap, key color, key fontSize, value color
|
|
15
|
+
* Size-dependent properties: value fontSize
|
|
16
|
+
*/
|
|
5
17
|
export type KeyValuePairTokensType = {
|
|
6
|
-
gap:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
|
|
18
|
+
gap: {
|
|
19
|
+
[key in 'vertical' | 'horizontal']: CSSObject['gap'];
|
|
20
|
+
};
|
|
21
|
+
key: {
|
|
22
|
+
color: CSSObject['color'];
|
|
23
|
+
fontSize: CSSObject['fontSize'];
|
|
24
|
+
fontWeight: CSSObject['fontWeight'];
|
|
25
|
+
gap: CSSObject['gap'];
|
|
26
|
+
};
|
|
27
|
+
value: {
|
|
28
|
+
color: CSSObject['color'];
|
|
29
|
+
fontSize: {
|
|
30
|
+
[key in KeyValuePairSize]: CSSObject['fontSize'];
|
|
13
31
|
};
|
|
32
|
+
fontWeight: CSSObject['fontWeight'];
|
|
33
|
+
gap: CSSObject['gap'];
|
|
14
34
|
};
|
|
15
35
|
};
|
|
16
36
|
export type ResponsiveKeyValuePairTokens = {
|
|
@@ -91,7 +91,7 @@ export type MultiSelectProps = {
|
|
|
91
91
|
showActionButtons?: boolean;
|
|
92
92
|
primaryAction?: {
|
|
93
93
|
text: string;
|
|
94
|
-
onClick: () => void;
|
|
94
|
+
onClick: (selectedValues: string[]) => void;
|
|
95
95
|
disabled?: boolean;
|
|
96
96
|
loading?: boolean;
|
|
97
97
|
};
|
|
@@ -129,7 +129,7 @@ export type MultiSelectMenuProps = {
|
|
|
129
129
|
showActionButtons?: boolean;
|
|
130
130
|
primaryAction?: {
|
|
131
131
|
text: string;
|
|
132
|
-
onClick: () => void;
|
|
132
|
+
onClick: (selectedValues: string[]) => void;
|
|
133
133
|
disabled?: boolean;
|
|
134
134
|
loading?: boolean;
|
|
135
135
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { SidebarProps } from './types';
|
|
3
|
-
declare const Sidebar:
|
|
2
|
+
declare const Sidebar: import('react').ForwardRefExoticComponent<SidebarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
3
|
export default Sidebar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SidebarMerchantInfo } from './types';
|
|
3
|
+
type SidebarHeaderProps = {
|
|
4
|
+
sidebarTopSlot?: React.ReactNode;
|
|
5
|
+
merchantInfo?: SidebarMerchantInfo;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
isScrolled: boolean;
|
|
8
|
+
sidebarCollapseKey: string;
|
|
9
|
+
onToggle: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const SidebarHeader: React.FC<SidebarHeaderProps>;
|
|
12
|
+
export default SidebarHeader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TenantItem } from './types';
|
|
3
|
+
type TenantPanelProps = {
|
|
4
|
+
items: TenantItem[];
|
|
5
|
+
selected: string;
|
|
6
|
+
onSelect: (label: string) => void;
|
|
7
|
+
maxVisibleItems?: number;
|
|
8
|
+
};
|
|
9
|
+
declare const TenantPanel: React.FC<TenantPanelProps>;
|
|
10
|
+
declare const TenantItem: React.FC<{
|
|
11
|
+
tenant: TenantItem;
|
|
12
|
+
isSelected: boolean;
|
|
13
|
+
onSelect: () => void;
|
|
14
|
+
}>;
|
|
15
|
+
export default TenantPanel;
|
|
@@ -12,6 +12,20 @@ export type LeftPanelInfo = {
|
|
|
12
12
|
onSelect: (value: string) => void;
|
|
13
13
|
maxVisibleItems?: number;
|
|
14
14
|
};
|
|
15
|
+
export type TenantItem = {
|
|
16
|
+
label: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
icon: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export type SidebarMerchantInfo = {
|
|
21
|
+
items: Array<{
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
selected: string;
|
|
27
|
+
onSelect: (value: string) => void;
|
|
28
|
+
};
|
|
15
29
|
export type SidebarProps = {
|
|
16
30
|
children: ReactNode;
|
|
17
31
|
data: DirectoryData[];
|
|
@@ -22,4 +36,5 @@ export type SidebarProps = {
|
|
|
22
36
|
sidebarCollapseKey?: string;
|
|
23
37
|
merchantInfo?: MerchantInfo;
|
|
24
38
|
rightActions?: ReactNode;
|
|
39
|
+
enableTopbarAutoHide?: boolean;
|
|
25
40
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TenantItem } from './types';
|
|
2
|
+
export declare const arrangeTenants: (tenants: TenantItem[], selectedLabel: string, maxVisible: number) => {
|
|
3
|
+
visibleTenants: TenantItem[];
|
|
4
|
+
hiddenTenants: TenantItem[];
|
|
5
|
+
hasMoreTenants: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getSidebarWidth: (isExpanded: boolean, isHovering: boolean, hasLeftPanel: boolean) => string;
|
|
8
|
+
export declare const getSidebarBorder: (isExpanded: boolean, isHovering: boolean) => string;
|
|
9
|
+
export declare const getTopbarStyles: (enableAutoHide: boolean, showTopbar: boolean) => {
|
|
10
|
+
transform?: undefined;
|
|
11
|
+
transition?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
transform: string;
|
|
14
|
+
transition: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const getDefaultMerchantInfo: () => {
|
|
17
|
+
items: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
icon: null;
|
|
21
|
+
}[];
|
|
22
|
+
selected: string;
|
|
23
|
+
onSelect: (value: string) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const useTopbarAutoHide: (enableTopbarAutoHide: boolean) => boolean;
|
|
@@ -3,7 +3,6 @@ import { FoundationTokenType } from '../../tokens/theme.token';
|
|
|
3
3
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
4
|
export type TopbarState = 'default' | 'hover' | 'active';
|
|
5
5
|
export type TopbarTokensType = {
|
|
6
|
-
height: CSSObject['height'];
|
|
7
6
|
position: CSSObject['position'];
|
|
8
7
|
top: CSSObject['top'];
|
|
9
8
|
zIndex: CSSObject['zIndex'];
|