@juspay/blend-design-system 0.0.17 → 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.
@@ -9,7 +9,7 @@ export declare function transformScatterData(data: NewNestedDataPoint[], selecte
9
9
  export declare function lightenHexColor(hex: string, amount?: number): string;
10
10
  export declare const formatNumber: (value: number | string) => string;
11
11
  export declare const capitaliseCamelCase: (text: string) => string;
12
- export declare const createSmartDateTimeFormatter: (timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
13
- 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);
14
14
  export declare const createStableSmartFormatter: (xAxisConfig: XAxisConfig, flattenedData: FlattenedDataPoint[]) => ((value: string | number) => string) | undefined;
15
15
  export declare const getAxisFormatter: (axisType: AxisType, timeZone?: string, hour12?: boolean) => ((value: string | number) => string);
@@ -70,6 +70,7 @@ export type AxisConfig = {
70
70
  smart?: boolean;
71
71
  timeZone?: string;
72
72
  hour12?: boolean;
73
+ showYear?: boolean;
73
74
  };
74
75
  export type XAxisConfig = AxisConfig;
75
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>>;
@@ -92,6 +92,8 @@ export type DateRangePickerProps = {
92
92
  allowSingleDateSelection?: boolean;
93
93
  disableFutureDates?: boolean;
94
94
  disablePastDates?: boolean;
95
+ hideFutureDates?: boolean;
96
+ hidePastDates?: boolean;
95
97
  triggerElement?: ReactNode;
96
98
  useDrawerOnMobile?: boolean;
97
99
  skipQuickFiltersOnMobile?: boolean;
@@ -120,6 +122,8 @@ export type ActionButtonsProps = {
120
122
  onCancel: () => void;
121
123
  onApply: () => void;
122
124
  isDisabled?: boolean;
125
+ isApplyDisabled?: boolean;
126
+ applyDisabledMessage?: string;
123
127
  };
124
128
  export type ScrollablePickerProps = {
125
129
  items: (string | number)[];
@@ -140,6 +144,8 @@ export type DatePickerComponentProps = {
140
144
  setStartDate: (date: string) => void;
141
145
  setEndDate: (date: string) => void;
142
146
  isDisabled?: boolean;
147
+ disableFutureDates?: boolean;
148
+ disablePastDates?: boolean;
143
149
  };
144
150
  export type MobileDrawerPresetsProps = {
145
151
  drawerOpen: boolean;
@@ -162,4 +168,8 @@ export type MobileDrawerPresetsProps = {
162
168
  handleApply: () => void;
163
169
  showCustomDropdownOnly?: boolean;
164
170
  isDisabled?: boolean;
171
+ isApplyDisabled?: boolean;
172
+ applyDisabledMessage?: string;
173
+ disableFutureDates?: boolean;
174
+ disablePastDates?: boolean;
165
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
- * Handles date click logic for calendar
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
@@ -326,9 +332,11 @@ export type DateRangePickerTokens = {
326
332
  * Validates date format and date values
327
333
  * @param value The input value to validate
328
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
329
337
  * @returns Validation result with specific error type
330
338
  */
331
- export declare const validateDateInput: (value: string, format: string) => DateValidationResult;
339
+ export declare const validateDateInput: (value: string, format: string, disableFutureDates?: boolean, disablePastDates?: boolean) => DateValidationResult;
332
340
  /**
333
341
  * Formats date input as user types, adding slashes automatically
334
342
  * @param value The input value to format
@@ -356,9 +364,12 @@ export declare const formatDateDisplay: (selectedRange: DateRange, allowSingleDa
356
364
  * @param dateFormat Date format string
357
365
  * @param currentRange Current selected range
358
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
359
370
  * @returns Object with formatted value, validation result, and updated range
360
371
  */
361
- 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) => {
362
373
  formattedValue: string;
363
374
  validation: DateValidationResult;
364
375
  updatedRange?: DateRange;
@@ -658,3 +669,37 @@ export declare const isValidTimeInput: (input: string) => boolean;
658
669
  * @returns Formatted time string
659
670
  */
660
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;
@@ -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
  };