@juspay/blend-design-system 0.0.17-beta → 0.0.17

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.
@@ -1,5 +1,11 @@
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;
@@ -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",
@@ -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;
@@ -90,6 +95,7 @@ export type DateRangePickerProps = {
90
95
  triggerElement?: ReactNode;
91
96
  useDrawerOnMobile?: boolean;
92
97
  skipQuickFiltersOnMobile?: boolean;
98
+ size?: DateRangePickerSize;
93
99
  formatConfig?: DateFormatConfig;
94
100
  triggerConfig?: TriggerConfig;
95
101
  };
@@ -206,9 +206,11 @@ export declare const getMonthName: (monthIndex: number) => string;
206
206
  export declare const getDayNames: () => string[];
207
207
  /**
208
208
  * Calculates the height of a single month in the calendar
209
+ * @param year The year of the month
210
+ * @param month The month (0-based)
209
211
  * @returns Height in pixels
210
212
  */
211
- export declare const getMonthHeight: () => number;
213
+ export declare const getMonthHeight: (year?: number, month?: number) => number;
212
214
  /**
213
215
  * Calculates which months should be visible in the viewport
214
216
  * @param scrollTop Current scroll position
@@ -1,16 +1,36 @@
1
1
  import { CSSObject } from 'styled-components';
2
- import { BreakpointType } from '../../breakpoints/breakPoints';
2
+ import { KeyValuePairSize } from './types';
3
3
  import { FoundationTokenType } from '../../tokens/theme.token';
4
- import { KeyValuePairSize, KeyValuePairStateType } from './types';
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: 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'];
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 = {
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { SidebarProps } from './types';
3
- declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
2
+ declare const Sidebar: import('react').ForwardRefExoticComponent<SidebarProps & import('react').RefAttributes<HTMLDivElement>>;
4
3
  export default Sidebar;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ type SidebarFooterProps = {
3
+ footer?: React.ReactNode;
4
+ };
5
+ declare const SidebarFooter: React.FC<SidebarFooterProps>;
6
+ export default SidebarFooter;
@@ -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'];