@juspay/blend-design-system 0.0.37-beta.6 → 0.0.37-beta.7

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.
Files changed (39) hide show
  1. package/dist/components/DataTable/TableBody/types.d.ts +1 -0
  2. package/dist/components/DataTable/TableCell/types.d.ts +1 -0
  3. package/dist/components/DataTable/columnTypes.d.ts +5 -3
  4. package/dist/components/DataTable/dataTable.tokens.d.ts +4 -0
  5. package/dist/components/DataTable/types.d.ts +20 -2
  6. package/dist/components/DataTable/utils.d.ts +4 -3
  7. package/dist/components/Skeleton/hooks/useSkeletonBase.d.ts +7 -11
  8. package/dist/components/StatCardV2/StatCardV2.d.ts +1 -0
  9. package/dist/components/StatCardV2/StatCardV2NoData.d.ts +2 -2
  10. package/dist/components/StatCardV2/statcardV2.types.d.ts +1 -0
  11. package/dist/components/TabsV2/tabsV2.tokens.types.d.ts +3 -0
  12. package/dist/global-utils/GlobalUtils.d.ts +2 -1
  13. package/dist/main.js +24982 -24910
  14. package/dist/{node-CJ_Tft0g.js → node-C_DmV86X.js} +49 -25
  15. package/dist/node.js +1 -1
  16. package/dist/tokens.js +1 -1
  17. package/lib/components/Card/Card.tsx +1 -0
  18. package/lib/components/Charts/ChartHeader.tsx +4 -1
  19. package/lib/components/CodeBlock/CodeBlock.tsx +8 -4
  20. package/lib/components/DataTable/DataTable.tsx +2 -0
  21. package/lib/components/DataTable/TableBody/index.tsx +2 -0
  22. package/lib/components/DataTable/TableBody/types.ts +1 -0
  23. package/lib/components/DataTable/TableCell/index.tsx +45 -20
  24. package/lib/components/DataTable/TableCell/types.ts +1 -0
  25. package/lib/components/DataTable/columnTypes.ts +5 -3
  26. package/lib/components/DataTable/dataTable.tokens.ts +15 -0
  27. package/lib/components/DataTable/types.ts +33 -2
  28. package/lib/components/DataTable/utils.ts +91 -5
  29. package/lib/components/Skeleton/hooks/useSkeletonBase.ts +11 -1
  30. package/lib/components/StatCard/StatCard.tsx +10 -2
  31. package/lib/components/StatCardV2/StatCardV2.tsx +8 -6
  32. package/lib/components/StatCardV2/StatCardV2NoData.tsx +8 -6
  33. package/lib/components/StatCardV2/statcardV2.types.ts +1 -0
  34. package/lib/components/TabsV2/TabsV2List.tsx +5 -1
  35. package/lib/components/TabsV2/tabsV2.dark.tokens.ts +12 -0
  36. package/lib/components/TabsV2/tabsV2.light.tokens.ts +12 -0
  37. package/lib/components/TabsV2/tabsV2.tokens.types.ts +3 -0
  38. package/lib/global-utils/GlobalUtils.ts +10 -1
  39. package/package.json +1 -1
@@ -46,6 +46,7 @@ export type TableBodyProps<T extends Record<string, unknown>> = {
46
46
  getColumnWidth: (column: ColumnDefinition<T>, index: number) => React.CSSProperties;
47
47
  getRowStyle?: (row: T, index: number) => React.CSSProperties;
48
48
  getDisplayValue?: (value: unknown, column: ColumnDefinition<T>) => unknown;
49
+ dateLabel?: string;
49
50
  isLoading?: boolean;
50
51
  showSkeleton?: boolean;
51
52
  skeletonVariant?: SkeletonVariant;
@@ -14,6 +14,7 @@ export type TableCellProps<T extends Record<string, unknown>> = {
14
14
  hasCustomBackground?: boolean;
15
15
  onFieldChange: (value: unknown) => void;
16
16
  getDisplayValue?: (value: unknown, column: ColumnDefinition<T>) => unknown;
17
+ dateLabel?: string;
17
18
  'data-row-index'?: number;
18
19
  'data-col-index'?: number;
19
20
  tabIndex?: number;
@@ -1,4 +1,4 @@
1
- import { FilterType, ColumnType } from './types';
1
+ import { FilterType, ColumnType, DateFormat } from './types';
2
2
  export type ColumnFilterOption = {
3
3
  id: string;
4
4
  label: string;
@@ -36,12 +36,14 @@ export type MultiSelectData = {
36
36
  };
37
37
  export type DateData = {
38
38
  date: Date | string;
39
- format?: string;
39
+ format?: DateFormat;
40
+ dateLabel?: string;
40
41
  };
41
42
  export type DateRangeData = {
42
43
  startDate: Date | string;
43
44
  endDate: Date | string;
44
- format?: string;
45
+ format?: DateFormat;
46
+ dateLabel?: string;
45
47
  };
46
48
  export type ColumnDataTypeMap = {
47
49
  [ColumnType.TEXT]: string | number;
@@ -194,6 +194,10 @@ export type TableTokenType = BasicCSSProps & {
194
194
  color: CSSObject['color'];
195
195
  fontSize: CSSObject['fontSize'];
196
196
  borderTop: CSSObject['borderTop'];
197
+ dateLabel: {
198
+ fontSize: CSSObject['fontSize'];
199
+ color: CSSObject['color'];
200
+ };
197
201
  expandable: {
198
202
  padding: CSSObject['padding'];
199
203
  borderTop: CSSObject['borderTop'];
@@ -73,10 +73,18 @@ export type DropdownColumnProps = {
73
73
  placeholder?: string;
74
74
  onSelect?: (value: unknown) => void;
75
75
  };
76
+ /**
77
+ * Format string for date display in DataTable DATE columns.
78
+ * @example 'DD MMM YYYY' → "24 Jun 2026"
79
+ * @example 'DD/MM/YYYY' → "24/06/2026"
80
+ * @example 'DD MMM YYYY, hh:mm A' → "24 Jun 2026, 10:30 AM"
81
+ */
82
+ export type DateFormat = 'DD MMM YYYY' | 'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY-MM-DD' | 'DD MMM YYYY, hh:mm A' | 'DD MMM YYYY, HH:mm' | 'MMM DD, YYYY' | 'YYYY/MM/DD HH:mm' | 'HH:mm:ss' | (string & {});
76
83
  export type DateColumnProps = {
77
84
  date: Date | string;
78
- format?: string;
85
+ format?: DateFormat;
79
86
  showTime?: boolean;
87
+ dateLabel?: string;
80
88
  };
81
89
  export type SliderColumnProps = {
82
90
  min: number;
@@ -204,8 +212,13 @@ export type ColumnDefinition<T> = (BaseColumnDefinition<T> & {
204
212
  }) | (BaseColumnDefinition<T> & {
205
213
  type: ColumnType.DATE;
206
214
  renderCell?: (value: DateColumnProps, row: T, index: number) => ReactNode;
207
- dateFormat?: string;
215
+ dateFormat?: DateFormat;
208
216
  showTime?: boolean;
217
+ /**
218
+ * Optional label appended after the formatted date, e.g. "(IST)".
219
+ * Column-level value can be overridden per-cell via DateColumnProps.dateLabel.
220
+ */
221
+ dateLabel?: string;
209
222
  }) | (BaseColumnDefinition<T> & {
210
223
  type: ColumnType.SLIDER;
211
224
  renderCell?: (value: number, row: T, index: number) => ReactNode;
@@ -365,6 +378,11 @@ export type DataTableProps<T extends Record<string, unknown>> = {
365
378
  getRowStyle?: (row: T, index: number) => React.CSSProperties;
366
379
  tableBodyHeight?: string | number;
367
380
  mobileColumnsToShow?: number;
381
+ /**
382
+ * Optional label appended after formatted dates in DATE columns,
383
+ * e.g. "(IST)". Can be overridden per-column or per-cell.
384
+ */
385
+ dateLabel?: string;
368
386
  enablePivotTable?: boolean;
369
387
  pivotTableConfig?: {
370
388
  triggerButton?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { SortConfig, ColumnFilter, SearchConfig, FilterType, ColumnDefinition, PivotAggregationType } from './types';
1
+ import { SortConfig, ColumnFilter, SearchConfig, FilterType, ColumnDefinition, PivotAggregationType, DateFormat } from './types';
2
2
  import { AvatarData, TagData, SelectData, MultiSelectData, DateData, DateRangeData } from './columnTypes';
3
3
  export declare const isDateOnlyString: (value: string) => boolean;
4
4
  /**
@@ -20,6 +20,7 @@ export declare const getDefaultColumnWidth: <T extends Record<string, unknown>>(
20
20
  };
21
21
  export declare const getColumnStyles: <T extends Record<string, unknown>>(column: ColumnDefinition<T>) => React.CSSProperties;
22
22
  export declare const formatDate: (dateString: string) => string;
23
+ export declare const formatDateString: (date: Date, format: string) => string;
23
24
  export declare const updateColumnFilter: (currentFilters: ColumnFilter[], field: keyof Record<string, unknown>, type: FilterType, value: string | string[] | {
24
25
  min: number;
25
26
  max: number;
@@ -48,8 +49,8 @@ export declare const createSelectData: (value: string, options?: {
48
49
  disabled?: boolean;
49
50
  }) => SelectData;
50
51
  export declare const createMultiSelectData: (values: string[], labels?: string[]) => MultiSelectData;
51
- export declare const createDateData: (date: Date | string, format?: string) => DateData;
52
- export declare const createDateRangeData: (startDate: Date | string, endDate: Date | string, format?: string) => DateRangeData;
52
+ export declare const createDateData: (date: Date | string, format?: DateFormat) => DateData;
53
+ export declare const createDateRangeData: (startDate: Date | string, endDate: Date | string, format?: DateFormat) => DateRangeData;
53
54
  export declare const validateDataForColumnType: <T extends Record<string, unknown>>(data: T, columns: ColumnDefinition<T>[]) => {
54
55
  isValid: boolean;
55
56
  errors: string[];
@@ -1,17 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { SkeletonTokensType } from '../skeleton.tokens';
3
+ export type UseSkeletonBaseResult = {
4
+ shouldRender: boolean;
5
+ fallback: ReactNode | null;
6
+ tokens: SkeletonTokensType | null;
7
+ prefersReducedMotion: boolean;
8
+ };
3
9
  /**
4
10
  * Shared hook for all skeleton components to eliminate code duplication
5
11
  * Handles token fetching, loading state, and motion preferences
6
12
  */
7
- export declare const useSkeletonBase: (loading: boolean, children?: ReactNode) => {
8
- shouldRender: boolean;
9
- fallback: string | number | bigint | true | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null;
10
- tokens: null;
11
- prefersReducedMotion: boolean;
12
- } | {
13
- shouldRender: boolean;
14
- fallback: null;
15
- tokens: SkeletonTokensType;
16
- prefersReducedMotion: boolean;
17
- };
13
+ export declare const useSkeletonBase: (loading: boolean, children?: ReactNode) => UseSkeletonBaseResult;
@@ -13,5 +13,6 @@ declare const StatCardV2: import('react').ForwardRefExoticComponent<{
13
13
  options?: import('../ChartsV2').ChartV2Options;
14
14
  skeleton?: import('./statcardV2.types').StatCardV2SkeletonProps;
15
15
  dropdownProps?: import('../SingleSelect').SingleSelectProps;
16
+ showBorder?: boolean;
16
17
  } & import('react').HTMLAttributes<HTMLDivElement> & import('./statcardV2.types').StatCardV2Dimensions & import('react').RefAttributes<HTMLDivElement>>;
17
18
  export default StatCardV2;
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { StatCardV2Props } from './statcardV2.types';
3
3
  import { StatCardV2TokensType } from './statcardV2.tokens';
4
- type StatCardV2NoDataProps = Pick<StatCardV2Props, 'title' | 'titleIcon' | 'helpIconText' | 'subtitle' | 'dropdownProps' | 'maxWidth' | 'minWidth' | 'width' | 'height'> & {
4
+ type StatCardV2NoDataProps = Pick<StatCardV2Props, 'title' | 'titleIcon' | 'helpIconText' | 'subtitle' | 'dropdownProps' | 'maxWidth' | 'minWidth' | 'width' | 'height' | 'showBorder'> & {
5
5
  tokens: StatCardV2TokensType;
6
6
  isSmallScreen: boolean;
7
7
  filteredProps: React.ComponentProps<'div'>;
8
8
  };
9
- declare const StatCardV2NoData: ({ title, titleIcon, helpIconText, subtitle, dropdownProps, maxWidth, minWidth, width, height, tokens, isSmallScreen, filteredProps, }: StatCardV2NoDataProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const StatCardV2NoData: ({ title, titleIcon, helpIconText, subtitle, dropdownProps, maxWidth, minWidth, width, height, showBorder, tokens, isSmallScreen, filteredProps, }: StatCardV2NoDataProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export default StatCardV2NoData;
@@ -70,4 +70,5 @@ export type StatCardV2Props = {
70
70
  options?: ChartV2Options;
71
71
  skeleton?: StatCardV2SkeletonProps;
72
72
  dropdownProps?: SingleSelectProps;
73
+ showBorder?: boolean;
73
74
  } & HTMLAttributes<HTMLDivElement> & StatCardV2Dimensions;
@@ -24,6 +24,9 @@ export type TabsV2TokensType = {
24
24
  };
25
25
  };
26
26
  };
27
+ borderBottom: {
28
+ [key in TabsV2Variant]: CSSObject['borderBottom'];
29
+ };
27
30
  activeIndicator: {
28
31
  height: CSSObject['height'];
29
32
  color: CSSObject['color'];
@@ -1,11 +1,12 @@
1
1
  import { default as React, ReactNode } from 'react';
2
2
  export declare const toPixels: (value: string | number | undefined) => number;
3
3
  export declare const capitalizeFirstLetter: (string: string) => string;
4
- export declare const getTruncatedText: (text: string, limit?: number) => {
4
+ export type TruncatedTextResult = {
5
5
  truncatedValue: string;
6
6
  fullValue: string;
7
7
  isTruncated: boolean;
8
8
  };
9
+ export declare const getTruncatedText: (text: string, limit?: number) => TruncatedTextResult;
9
10
  export declare const formatTextWithLineBreaks: (content: ReactNode | string) => ReactNode;
10
11
  /**
11
12
  * Composes multiple refs (forwarded ref + trigger's ref) so both receive the same DOM instance.