@juspay/blend-design-system 0.0.35 → 0.0.36-beta.1

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 (69) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Charts/chart.tokens.d.ts +1 -1
  3. package/dist/components/Charts/renderChart.d.ts +1 -1
  4. package/dist/components/Charts/types.d.ts +5 -0
  5. package/dist/components/ChartsV2/ChartContainerV2.d.ts +6 -0
  6. package/dist/components/ChartsV2/ChartHeaderV2.d.ts +6 -0
  7. package/dist/components/ChartsV2/ChartV2.d.ts +3 -0
  8. package/dist/components/ChartsV2/ChartV2Fullscreen.d.ts +14 -0
  9. package/dist/components/ChartsV2/ChartV2Legend.d.ts +6 -0
  10. package/dist/components/ChartsV2/ChartV2NoData.d.ts +6 -0
  11. package/dist/components/ChartsV2/ChartV2Skeleton.d.ts +10 -0
  12. package/dist/components/ChartsV2/chartV2.dark.tokens.d.ts +3 -0
  13. package/dist/components/ChartsV2/chartV2.light.tokens.d.ts +3 -0
  14. package/dist/components/ChartsV2/chartV2.sankey.d.ts +1 -0
  15. package/dist/components/ChartsV2/chartV2.tokens.d.ts +102 -0
  16. package/dist/components/ChartsV2/chartV2.types.d.ts +72 -0
  17. package/dist/components/ChartsV2/index.d.ts +9 -0
  18. package/dist/components/ChartsV2/useChartLegend.d.ts +9 -0
  19. package/dist/components/ChartsV2/useChartLegendHover.d.ts +7 -0
  20. package/dist/components/ChartsV2/useChartRefs.d.ts +6 -0
  21. package/dist/components/ChartsV2/utils.d.ts +3 -0
  22. package/dist/components/ChatInput/ChatInput.d.ts +1 -0
  23. package/dist/components/ChatInput/MobileChatInput.d.ts +1 -0
  24. package/dist/components/ChatInput/chatInput.tokens.d.ts +8 -6
  25. package/dist/components/ChatInput/types.d.ts +1 -0
  26. package/dist/components/DataTable/TableBody/types.d.ts +2 -0
  27. package/dist/components/DataTable/TableHeader/types.d.ts +4 -0
  28. package/dist/components/DataTable/TableHeader/utils.d.ts +4 -2
  29. package/dist/components/DateRangePicker/CalendarGrid.d.ts +1 -0
  30. package/dist/components/DateRangePicker/types.d.ts +3 -0
  31. package/dist/components/DateRangePicker/utils.d.ts +2 -2
  32. package/dist/components/MultiSelect/types.d.ts +1 -1
  33. package/dist/components/SelectorV2/CheckboxV2/CheckboxV2.d.ts +19 -0
  34. package/dist/components/SelectorV2/CheckboxV2/StyledCheckboxV2.d.ts +11 -0
  35. package/dist/components/SelectorV2/CheckboxV2/checkboxV2.animations.d.ts +2 -0
  36. package/dist/components/SelectorV2/CheckboxV2/checkboxV2.dark.tokens.d.ts +3 -0
  37. package/dist/components/SelectorV2/CheckboxV2/checkboxV2.light.tokens.d.ts +3 -0
  38. package/dist/components/SelectorV2/CheckboxV2/checkboxV2.tokens.d.ts +94 -0
  39. package/dist/components/SelectorV2/CheckboxV2/checkboxV2.types.d.ts +64 -0
  40. package/dist/components/SelectorV2/CheckboxV2/index.d.ts +3 -0
  41. package/dist/components/SelectorV2/CheckboxV2/utils.d.ts +67 -0
  42. package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/SwitchV2.d.ts +3 -3
  43. package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/switchV2.dark.tokens.d.ts +1 -1
  44. package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/switchV2.light.tokens.d.ts +1 -1
  45. package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/switchV2.tokens.d.ts +16 -15
  46. package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/switchV2.types.d.ts +5 -8
  47. package/dist/components/SelectorV2/selectorV2.types.d.ts +12 -0
  48. package/dist/components/SelectorsContent/SelectorsContent.types.d.ts +5 -2
  49. package/dist/components/SelectorsContent/SelectorsLabel.d.ts +1 -1
  50. package/dist/components/SelectorsContent/SelectorsSubLabel.d.ts +1 -1
  51. package/dist/components/Timeline/Timeline.d.ts +41 -0
  52. package/dist/components/Timeline/TimelineHeader.d.ts +10 -0
  53. package/dist/components/Timeline/TimelineLabel.d.ts +3 -0
  54. package/dist/components/Timeline/TimelineNode.d.ts +17 -0
  55. package/dist/components/Timeline/TimelineShowMore.d.ts +3 -0
  56. package/dist/components/Timeline/TimelineSubstep.d.ts +11 -0
  57. package/dist/components/Timeline/index.d.ts +8 -0
  58. package/dist/components/Timeline/timeline.dark.token.d.ts +8 -0
  59. package/dist/components/Timeline/timeline.light.token.d.ts +8 -0
  60. package/dist/components/Timeline/timeline.token.d.ts +132 -0
  61. package/dist/components/Timeline/types.d.ts +104 -0
  62. package/dist/components/Timeline/utils.d.ts +6 -0
  63. package/dist/components/common/Seperator.d.ts +4 -3
  64. package/dist/context/ThemeContext.d.ts +7 -1
  65. package/dist/context/useComponentToken.d.ts +5 -2
  66. package/dist/main.d.ts +2 -0
  67. package/dist/main.js +36601 -32999
  68. package/package.json +2 -2
  69. /package/dist/components/{SwitchV2 → SelectorV2/SwitchV2}/index.d.ts +0 -0
@@ -0,0 +1,132 @@
1
+ import { CSSObject } from 'styled-components';
2
+ import { TimelineNodeStatus } from './types';
3
+ import { FoundationTokenType } from '../../tokens/theme.token';
4
+ import { BreakpointType } from '../../breakpoints/breakPoints';
5
+ import { Theme } from '../../context/theme.enum';
6
+ export type TimelineStatusColors = {
7
+ [key in TimelineNodeStatus]: CSSObject['backgroundColor'];
8
+ };
9
+ export type TimelineTokensType = {
10
+ track: {
11
+ width: CSSObject['width'];
12
+ backgroundColor: CSSObject['backgroundColor'];
13
+ left: CSSObject['left'];
14
+ };
15
+ indicator: {
16
+ left: CSSObject['left'];
17
+ width: CSSObject['width'];
18
+ height: CSSObject['height'];
19
+ };
20
+ statusColors: TimelineStatusColors;
21
+ label: {
22
+ paddingLeft: CSSObject['paddingLeft'];
23
+ marginBottom: CSSObject['marginBottom'];
24
+ circle: {
25
+ left: CSSObject['left'];
26
+ width: CSSObject['width'];
27
+ height: CSSObject['height'];
28
+ backgroundColor: CSSObject['backgroundColor'];
29
+ border: CSSObject['border'];
30
+ };
31
+ mask: {
32
+ backgroundColor: CSSObject['backgroundColor'];
33
+ height: CSSObject['height'];
34
+ };
35
+ text: {
36
+ fontSize: CSSObject['fontSize'];
37
+ fontWeight: CSSObject['fontWeight'];
38
+ color: CSSObject['color'];
39
+ };
40
+ };
41
+ header: {
42
+ row: {
43
+ paddingLeft: CSSObject['paddingLeft'];
44
+ marginBottom: CSSObject['marginBottom'];
45
+ gap: CSSObject['gap'];
46
+ };
47
+ section: {
48
+ marginBottom: CSSObject['marginBottom'];
49
+ };
50
+ title: {
51
+ fontSize: CSSObject['fontSize'];
52
+ fontWeight: CSSObject['fontWeight'];
53
+ color: CSSObject['color'];
54
+ };
55
+ timestamp: {
56
+ fontSize: CSSObject['fontSize'];
57
+ color: CSSObject['color'];
58
+ gap: CSSObject['gap'];
59
+ };
60
+ };
61
+ subsection: {
62
+ paddingLeft: CSSObject['paddingLeft'];
63
+ marginTop: CSSObject['marginTop'];
64
+ marginBottom: CSSObject['marginBottom'];
65
+ marginLeft: CSSObject['marginLeft'];
66
+ rootIndicator: {
67
+ top: CSSObject['top'];
68
+ };
69
+ headerRow: {
70
+ gap: CSSObject['gap'];
71
+ };
72
+ titleRow: {
73
+ gap: CSSObject['gap'];
74
+ };
75
+ datetimeGroup: {
76
+ gap: CSSObject['gap'];
77
+ };
78
+ title: {
79
+ fontSize: CSSObject['fontSize'];
80
+ fontWeight: CSSObject['fontWeight'];
81
+ color: CSSObject['color'];
82
+ gap: CSSObject['gap'];
83
+ };
84
+ description: {
85
+ fontSize: CSSObject['fontSize'];
86
+ color: CSSObject['color'];
87
+ marginTop: CSSObject['marginTop'];
88
+ marginBottom: CSSObject['marginBottom'];
89
+ lineHeight: CSSObject['lineHeight'];
90
+ };
91
+ datetime: {
92
+ fontSize: CSSObject['fontSize'];
93
+ color: CSSObject['color'];
94
+ gap: CSSObject['gap'];
95
+ };
96
+ connector: {
97
+ left: CSSObject['left'];
98
+ width: CSSObject['width'];
99
+ height: CSSObject['height'];
100
+ color: CSSObject['color'];
101
+ };
102
+ avatar: {
103
+ width: CSSObject['width'];
104
+ height: CSSObject['height'];
105
+ marginTop: CSSObject['marginTop'];
106
+ };
107
+ user: {
108
+ fontSize: CSSObject['fontSize'];
109
+ color: CSSObject['color'];
110
+ marginLeft: CSSObject['marginLeft'];
111
+ };
112
+ time: {
113
+ fontSize: CSSObject['fontSize'];
114
+ color: CSSObject['color'];
115
+ };
116
+ separator: {
117
+ width: CSSObject['width'];
118
+ height: CSSObject['height'];
119
+ color: CSSObject['color'];
120
+ marginLeft: CSSObject['marginLeft'];
121
+ marginRight: CSSObject['marginRight'];
122
+ };
123
+ };
124
+ showMore: {
125
+ paddingLeft: CSSObject['paddingLeft'];
126
+ marginTop: CSSObject['marginTop'];
127
+ };
128
+ };
129
+ export type ResponsiveTimelineTokens = {
130
+ [key in keyof BreakpointType]: TimelineTokensType;
131
+ };
132
+ export declare const getTimelineTokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveTimelineTokens;
@@ -0,0 +1,104 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { AvatarV2Props } from '../AvatarV2/avatarV2.types';
3
+ import { ButtonV2Props } from '../ButtonV2/buttonV2.types';
4
+ export declare enum TimelineNodeStatus {
5
+ SUCCESS = "success",
6
+ WARNING = "warning",
7
+ ERROR = "error",
8
+ NEUTRAL = "neutral"
9
+ }
10
+ export type TimelineUser = {
11
+ name: string;
12
+ avatar?: AvatarV2Props['src'];
13
+ fallbackText?: string;
14
+ };
15
+ export type LinePositionOptions = {
16
+ indicatorHeightPx: number;
17
+ indicatorTopPx: number;
18
+ labelCircleHeightPx: number;
19
+ };
20
+ export type LineLayout = {
21
+ top: number;
22
+ height: number;
23
+ };
24
+ export type TimelineRootProps = {
25
+ children: ReactNode;
26
+ className?: string;
27
+ } & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>;
28
+ export type TimelineLabelProps = {
29
+ text: string;
30
+ };
31
+ export type TimelineHeaderProps = HTMLAttributes<HTMLDivElement> & {
32
+ title: string;
33
+ status?: TimelineNodeStatus;
34
+ timestamp?: string;
35
+ children?: ReactNode;
36
+ leftSlot?: ReactNode;
37
+ rightSlot?: ReactNode;
38
+ };
39
+ export type TimelineSubstepProps = HTMLAttributes<HTMLDivElement> & {
40
+ title: string;
41
+ isNestedUnderHeader?: boolean;
42
+ showIndicator?: boolean;
43
+ description?: string;
44
+ timestamp?: string;
45
+ rightSlot?: ReactNode;
46
+ datetimeLeftSlot?: ReactNode;
47
+ datetimeRightSlot?: ReactNode;
48
+ };
49
+ export type TimelineNodeProps = HTMLAttributes<HTMLDivElement> & {
50
+ title?: string;
51
+ leftSlot?: ReactNode;
52
+ headerRightSlot?: ReactNode;
53
+ datetime?: string;
54
+ datetimeLeftSlot?: ReactNode;
55
+ datetimeRightSlot?: ReactNode;
56
+ text?: string;
57
+ maxLines?: number;
58
+ user?: TimelineUser;
59
+ avatarProps?: Partial<Omit<AvatarV2Props, 'src' | 'fallbackText'>>;
60
+ time?: string;
61
+ status?: TimelineNodeStatus;
62
+ children?: ReactNode;
63
+ };
64
+ export type TimelineShowMoreProps = {
65
+ count: number;
66
+ label?: string;
67
+ onShowMore?: () => void;
68
+ buttonProps?: Partial<Omit<ButtonV2Props, 'text' | 'onClick'>>;
69
+ };
70
+ export type TimelineCommentData = {
71
+ id: string;
72
+ text: string;
73
+ user: {
74
+ name: string;
75
+ avatar?: string;
76
+ fallbackText?: string;
77
+ };
78
+ timestamp: string;
79
+ };
80
+ export type TimelineSubstepData = {
81
+ id: string;
82
+ title: string;
83
+ description?: string;
84
+ timestamp: string;
85
+ };
86
+ export type TimelineHeaderData = {
87
+ id: string;
88
+ title: string;
89
+ status?: string;
90
+ timestamp: string;
91
+ substeps?: TimelineSubstepData[];
92
+ comments?: TimelineCommentData[];
93
+ };
94
+ export type TimelineLabelData = {
95
+ id: string;
96
+ date: string;
97
+ headers?: TimelineHeaderData[];
98
+ comments?: TimelineCommentData[];
99
+ };
100
+ export type TimelineItemData = {
101
+ label?: TimelineLabelData;
102
+ header?: TimelineHeaderData;
103
+ comment?: TimelineCommentData;
104
+ };
@@ -0,0 +1,6 @@
1
+ import { LineLayout, LinePositionOptions, TimelineItemData, TimelineLabelData } from './types';
2
+ export declare function parsePx(value: string | number | undefined): number;
3
+ export declare function getLineTop(container: HTMLElement, options: LinePositionOptions): number;
4
+ export declare function getLineBottom(container: HTMLElement, options: LinePositionOptions): number | null;
5
+ export declare function clampLineHeight(lineTop: number, lineBottom: number | null): LineLayout | null;
6
+ export declare const organizeTimelineItems: (items: TimelineItemData[]) => TimelineLabelData[];
@@ -1,8 +1,9 @@
1
+ import { CSSObject } from 'styled-components';
1
2
  type SeperatorProps = {
2
3
  orientation?: 'horizontal' | 'vertical';
3
- height?: string;
4
- width?: string;
5
- color?: string;
4
+ height?: CSSObject['height'];
5
+ width?: CSSObject['width'];
6
+ color?: CSSObject['color'];
6
7
  };
7
8
  declare const Seperator: ({ height, width, color, }: SeperatorProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export default Seperator;
@@ -49,9 +49,12 @@ import { ResponsiveTagV2Tokens } from '../components/TagV2/tagV2.tokens';
49
49
  import { ResponsiveAlertV2Tokens } from '../components/AlertV2/alertV2.tokens';
50
50
  import { ResponsiveAccordionV2Tokens } from '../components/AccordionV2/accordionV2.tokens';
51
51
  import { ResponsiveSnackbarV2Tokens } from '../components/SnackbarV2/snackbarV2.tokens';
52
- import { ResponsiveSwitchV2Tokens } from '../components/SwitchV2/switchV2.tokens';
52
+ import { ResponsiveSwitchV2Tokens } from '../components/SelectorV2/SwitchV2/switchV2.tokens';
53
53
  import { ResponsiveAvatarV2Tokens } from '../components/AvatarV2/avatarV2.tokens';
54
54
  import { ResponsiveTextInputV2Tokens } from '../components/InputsV2/TextInputV2/TextInputV2.tokens';
55
+ import { ResponsiveChartV2Tokens } from '../components/ChartsV2/chartV2.tokens';
56
+ import { ResponsiveTimelineTokens } from '../components/Timeline/timeline.token';
57
+ import { ResponsiveCheckboxV2Tokens } from '../components/SelectorV2/CheckboxV2/checkboxV2.tokens';
55
58
  export type ComponentTokenType = {
56
59
  TAGS?: ResponsiveTagTokens;
57
60
  SEARCH_INPUT?: ResponsiveSearchInputTokens;
@@ -96,6 +99,7 @@ export type ComponentTokenType = {
96
99
  UPLOAD?: ResponsiveUploadTokens;
97
100
  CODE_BLOCK?: ResponsiveCodeBlockTokens;
98
101
  CHAT_INPUT?: ResponsiveChatInputTokensType;
102
+ TIMELINE?: ResponsiveTimelineTokens;
99
103
  BUTTONV2?: ResponsiveButtonV2Tokens;
100
104
  TAGV2?: ResponsiveTagV2Tokens;
101
105
  ALERTV2?: ResponsiveAlertV2Tokens;
@@ -104,6 +108,8 @@ export type ComponentTokenType = {
104
108
  SWITCHV2?: ResponsiveSwitchV2Tokens;
105
109
  AVATARV2?: ResponsiveAvatarV2Tokens;
106
110
  TEXT_INPUTV2?: ResponsiveTextInputV2Tokens;
111
+ CHARTSV2?: ResponsiveChartV2Tokens;
112
+ CHECKBOXV2?: ResponsiveCheckboxV2Tokens;
107
113
  };
108
114
  type ThemeContextType = {
109
115
  foundationTokens: ThemeType;
@@ -47,7 +47,10 @@ import { ResponsiveTagV2Tokens } from '../components/TagV2/tagV2.tokens';
47
47
  import { ResponsiveAlertV2Tokens } from '../components/AlertV2';
48
48
  import { ResponsiveAccordionV2Tokens } from '../components/AccordionV2';
49
49
  import { ResponsiveSnackbarV2Tokens } from '../components/SnackbarV2';
50
- import { ResponsiveSwitchV2Tokens } from '../components/SwitchV2/switchV2.tokens';
50
+ import { ResponsiveSwitchV2Tokens } from '../components/SelectorV2/SwitchV2/switchV2.tokens';
51
51
  import { ResponsiveAvatarV2Tokens } from '../components/AvatarV2/avatarV2.tokens';
52
52
  import { ResponsiveTextInputV2Tokens } from '../components/InputsV2/TextInputV2/TextInputV2.tokens';
53
- export declare const useComponentToken: (component: keyof ComponentTokenType) => ResponsiveSearchInputTokens | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens | ResponsiveOTPInputTokens | ResponsiveUnitInputTokens | ResponsiveMultiValueInputTokens | ResponsiveSwitchTokens | ResponsiveCheckboxTokens | ResponsiveTabsTokens | ResponsiveTooltipTokens | ResponsiveDropdownInputTokens | ResponsiveModalTokens | ResponsiveBreadcrumbTokens | ResponsivePopoverTokens | ResponsiveMenuTokensType | ResponsiveMultiSelectTokens | ResponsiveSingleSelectTokens | ResponsiveTableTokens | ResponsiveCalendarTokens | ResponsiveAccordionTokens | ResponsiveStatCardTokens | ResponsiveProgressBarTokens | ResponsiveDrawerTokens | ResponsiveChartTokens | ResponsiveSnackbarTokens | ResponsiveStepperTokens | ResponsiveKeyValuePairTokens | ResponsiveCardTokens | ResponsiveSkeletonTokens | ResponsiveTopbarTokens | ResponsiveAvatarTokens | ResponsiveAvatarGroupTokens | ResponsiveSidebarTokens | ResponsiveUploadTokens | ResponsiveCodeBlockTokens | ResponsiveMobileNavigationTokens | ResponsiveDirectoryTokens | ResponsiveChatInputTokensType | ResponsiveButtonTokens | ResponsiveButtonV2Tokens | ResponsiveChatInputTokensType | ResponsiveTagV2Tokens | ResponsiveAlertV2Tokens | ResponsiveAccordionV2Tokens | ResponsiveSnackbarV2Tokens | ResponsiveSwitchV2Tokens | ResponsiveAvatarV2Tokens | ResponsiveTextInputV2Tokens;
53
+ import { ResponsiveChartV2Tokens } from '../components/ChartsV2/chartV2.tokens';
54
+ import { ResponsiveTimelineTokens } from '../components/Timeline/timeline.token';
55
+ import { ResponsiveCheckboxV2Tokens } from '../components/SelectorV2/CheckboxV2/checkboxV2.tokens';
56
+ export declare const useComponentToken: (component: keyof ComponentTokenType) => ResponsiveSearchInputTokens | ResponsiveTagTokens | ResponsiveTextAreaTokens | ResponsiveTextInputTokens | ResponsiveNumberInputTokens | ResponsiveAlertTokens | ResponsiveRadioTokens | ResponsiveOTPInputTokens | ResponsiveUnitInputTokens | ResponsiveMultiValueInputTokens | ResponsiveSwitchTokens | ResponsiveCheckboxTokens | ResponsiveTabsTokens | ResponsiveTooltipTokens | ResponsiveDropdownInputTokens | ResponsiveModalTokens | ResponsiveBreadcrumbTokens | ResponsivePopoverTokens | ResponsiveMenuTokensType | ResponsiveMultiSelectTokens | ResponsiveSingleSelectTokens | ResponsiveTableTokens | ResponsiveCalendarTokens | ResponsiveAccordionTokens | ResponsiveStatCardTokens | ResponsiveProgressBarTokens | ResponsiveDrawerTokens | ResponsiveChartTokens | ResponsiveSnackbarTokens | ResponsiveStepperTokens | ResponsiveKeyValuePairTokens | ResponsiveCardTokens | ResponsiveSkeletonTokens | ResponsiveTopbarTokens | ResponsiveAvatarTokens | ResponsiveAvatarGroupTokens | ResponsiveSidebarTokens | ResponsiveUploadTokens | ResponsiveCodeBlockTokens | ResponsiveMobileNavigationTokens | ResponsiveDirectoryTokens | ResponsiveChatInputTokensType | ResponsiveButtonTokens | ResponsiveButtonV2Tokens | ResponsiveChatInputTokensType | ResponsiveTagV2Tokens | ResponsiveAlertV2Tokens | ResponsiveAccordionV2Tokens | ResponsiveSnackbarV2Tokens | ResponsiveSwitchV2Tokens | ResponsiveTextInputV2Tokens | ResponsiveChartV2Tokens | ResponsiveAvatarV2Tokens | ResponsiveTextInputV2Tokens | ResponsiveTimelineTokens | ResponsiveCheckboxV2Tokens | ResponsiveTextInputV2Tokens;
package/dist/main.d.ts CHANGED
@@ -42,3 +42,5 @@ export * from './components/ButtonGroup';
42
42
  export * from './components/Button';
43
43
  export * from './context';
44
44
  export * from './tokens';
45
+ export * from './components/ChartsV2';
46
+ export * from './components/Timeline';