@juspay/svelte-ui-components 2.31.0 → 2.32.0

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 (43) hide show
  1. package/dist/AreaChart/AreaChart.svelte +421 -0
  2. package/dist/AreaChart/AreaChart.svelte.d.ts +4 -0
  3. package/dist/AreaChart/properties.d.ts +62 -0
  4. package/dist/AreaChart/properties.js +1 -0
  5. package/dist/BarChart/BarChart.svelte +372 -0
  6. package/dist/BarChart/BarChart.svelte.d.ts +4 -0
  7. package/dist/BarChart/properties.d.ts +44 -0
  8. package/dist/BarChart/properties.js +1 -0
  9. package/dist/LineChart/LineChart.svelte +361 -0
  10. package/dist/LineChart/LineChart.svelte.d.ts +4 -0
  11. package/dist/LineChart/properties.d.ts +59 -0
  12. package/dist/LineChart/properties.js +1 -0
  13. package/dist/PieChart/PieChart.svelte +236 -0
  14. package/dist/PieChart/PieChart.svelte.d.ts +4 -0
  15. package/dist/PieChart/properties.d.ts +36 -0
  16. package/dist/PieChart/properties.js +1 -0
  17. package/dist/SankeyChart/SankeyChart.svelte +312 -0
  18. package/dist/SankeyChart/SankeyChart.svelte.d.ts +4 -0
  19. package/dist/SankeyChart/properties.d.ts +52 -0
  20. package/dist/SankeyChart/properties.js +1 -0
  21. package/dist/_chart/Axis.svelte +143 -0
  22. package/dist/_chart/Axis.svelte.d.ts +4 -0
  23. package/dist/_chart/ChartContainer.svelte +81 -0
  24. package/dist/_chart/ChartContainer.svelte.d.ts +4 -0
  25. package/dist/_chart/ChartTooltip.svelte +81 -0
  26. package/dist/_chart/ChartTooltip.svelte.d.ts +4 -0
  27. package/dist/_chart/Legend.svelte +59 -0
  28. package/dist/_chart/Legend.svelte.d.ts +4 -0
  29. package/dist/_chart/colors.d.ts +4 -0
  30. package/dist/_chart/colors.js +36 -0
  31. package/dist/_chart/format.d.ts +3 -0
  32. package/dist/_chart/format.js +28 -0
  33. package/dist/_chart/geometry.d.ts +24 -0
  34. package/dist/_chart/geometry.js +204 -0
  35. package/dist/_chart/paths.d.ts +4 -0
  36. package/dist/_chart/paths.js +138 -0
  37. package/dist/_chart/scales.d.ts +5 -0
  38. package/dist/_chart/scales.js +77 -0
  39. package/dist/_chart/types.d.ts +128 -0
  40. package/dist/_chart/types.js +1 -0
  41. package/dist/index.d.ts +10 -0
  42. package/dist/index.js +5 -0
  43. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { BarChartDataPoint } from '../BarChart/properties';
3
+ export type Margin = {
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ left: number;
8
+ };
9
+ export type Point = {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ export type ChartDimensions = {
14
+ width: number;
15
+ height: number;
16
+ margin: Margin;
17
+ innerWidth: number;
18
+ innerHeight: number;
19
+ };
20
+ export type LinearScale = {
21
+ (value: number): number;
22
+ domain: [number, number];
23
+ range: [number, number];
24
+ ticks: (count?: number) => number[];
25
+ invert: (pixel: number) => number;
26
+ };
27
+ export type BandScale = {
28
+ (label: string): number;
29
+ domain: string[];
30
+ range: [number, number];
31
+ bandwidth: number;
32
+ step: number;
33
+ };
34
+ export type CurveType = 'linear' | 'monotone' | 'step' | 'natural';
35
+ export type AxisOrientation = 'top' | 'right' | 'bottom' | 'left';
36
+ export type PieSliceLayout = {
37
+ index: number;
38
+ startAngle: number;
39
+ endAngle: number;
40
+ midAngle: number;
41
+ value: number;
42
+ percentage: number;
43
+ label: string;
44
+ color?: string;
45
+ };
46
+ export type ComputedSankeyNode = {
47
+ id: string;
48
+ label: string;
49
+ x: number;
50
+ y: number;
51
+ width: number;
52
+ height: number;
53
+ value: number;
54
+ color?: string;
55
+ column: number;
56
+ };
57
+ export type ComputedSankeyLink = {
58
+ source: string;
59
+ target: string;
60
+ value: number;
61
+ color?: string;
62
+ sourceX: number;
63
+ sourceY: number;
64
+ targetX: number;
65
+ targetY: number;
66
+ width: number;
67
+ path: string;
68
+ };
69
+ export type BarRect = {
70
+ x: number;
71
+ y: number;
72
+ width: number;
73
+ height: number;
74
+ color: string;
75
+ si: number;
76
+ pi: number;
77
+ dataPoint: BarChartDataPoint;
78
+ seriesName: string;
79
+ };
80
+ export type StackedPoint = {
81
+ x: number;
82
+ y0: number;
83
+ y1: number;
84
+ };
85
+ export type TooltipData = {
86
+ title?: string;
87
+ items: Array<{
88
+ label: string;
89
+ value: string;
90
+ color?: string;
91
+ }>;
92
+ };
93
+ export type LegendItem = {
94
+ label: string;
95
+ color: string;
96
+ };
97
+ export type ChartContainerProperties = {
98
+ width?: number;
99
+ height?: number;
100
+ aspectRatio?: number;
101
+ minHeight?: number;
102
+ testId?: string;
103
+ classes?: string;
104
+ children: Snippet;
105
+ };
106
+ export type AxisProperties = {
107
+ orientation: AxisOrientation;
108
+ scale: LinearScale | BandScale;
109
+ tickCount?: number;
110
+ tickFormat?: (value: number | string) => string;
111
+ showGridlines?: boolean;
112
+ gridlineLength?: number;
113
+ label?: string;
114
+ classes?: string;
115
+ };
116
+ export type ChartTooltipProperties = {
117
+ data: TooltipData | null;
118
+ mouseX?: number;
119
+ mouseY?: number;
120
+ customSnippet?: Snippet<[TooltipData]>;
121
+ classes?: string;
122
+ };
123
+ export type LegendProperties = {
124
+ items: LegendItem[];
125
+ position?: 'top' | 'bottom';
126
+ customSnippet?: Snippet<[LegendItem[]]>;
127
+ classes?: string;
128
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -59,6 +59,11 @@ export { default as SplitInput } from './SplitInput/SplitInput.svelte';
59
59
  export { default as FileInput } from './FileInput/FileInput.svelte';
60
60
  export { default as DateRangePicker } from './DateRangePicker/DateRangePicker.svelte';
61
61
  export { default as Breadcrumb } from './Breadcrumb/Breadcrumb.svelte';
62
+ export { default as LineChart } from './LineChart/LineChart.svelte';
63
+ export { default as AreaChart } from './AreaChart/AreaChart.svelte';
64
+ export { default as BarChart } from './BarChart/BarChart.svelte';
65
+ export { default as PieChart } from './PieChart/PieChart.svelte';
66
+ export { default as SankeyChart } from './SankeyChart/SankeyChart.svelte';
62
67
  export type * from './Button/properties';
63
68
  export type * from './Modal/properties';
64
69
  export type * from './Input/properties';
@@ -114,4 +119,9 @@ export type * from './SplitInput/properties';
114
119
  export type * from './FileInput/properties';
115
120
  export type * from './DateRangePicker/properties';
116
121
  export type * from './Breadcrumb/properties';
122
+ export type * from './LineChart/properties';
123
+ export type * from './AreaChart/properties';
124
+ export type * from './BarChart/properties';
125
+ export type * from './PieChart/properties';
126
+ export type * from './SankeyChart/properties';
117
127
  export { validateInput } from './utils';
package/dist/index.js CHANGED
@@ -59,4 +59,9 @@ export { default as SplitInput } from './SplitInput/SplitInput.svelte';
59
59
  export { default as FileInput } from './FileInput/FileInput.svelte';
60
60
  export { default as DateRangePicker } from './DateRangePicker/DateRangePicker.svelte';
61
61
  export { default as Breadcrumb } from './Breadcrumb/Breadcrumb.svelte';
62
+ export { default as LineChart } from './LineChart/LineChart.svelte';
63
+ export { default as AreaChart } from './AreaChart/AreaChart.svelte';
64
+ export { default as BarChart } from './BarChart/BarChart.svelte';
65
+ export { default as PieChart } from './PieChart/PieChart.svelte';
66
+ export { default as SankeyChart } from './SankeyChart/SankeyChart.svelte';
62
67
  export { validateInput } from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.31.0",
3
+ "version": "2.32.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",