@juspay/svelte-ui-components 2.85.0 → 2.87.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.
@@ -39,7 +39,7 @@ export type LinearScale = {
39
39
  (value: number): number;
40
40
  domain: [number, number];
41
41
  range: [number, number];
42
- ticks: (count?: number) => number[];
42
+ ticks: (count?: number, integer?: boolean) => number[];
43
43
  invert: (pixel: number) => number;
44
44
  };
45
45
  export type BandScale = {
@@ -124,6 +124,14 @@ export type TooltipData = {
124
124
  export type LegendItem = {
125
125
  label: string;
126
126
  color: string;
127
+ /** True when the series is toggled off via an interactive legend. */
128
+ hidden?: boolean;
129
+ };
130
+ /** Data-space anchor for point/category-anchored tooltips (coords are container px). */
131
+ export type TooltipAnchor = {
132
+ x: number;
133
+ y: number;
134
+ side: 'top' | 'right' | 'bottom' | 'left';
127
135
  };
128
136
  export type ChartContainerProperties = {
129
137
  width?: number;
@@ -143,18 +151,38 @@ export type AxisProperties = {
143
151
  showGridlines?: boolean;
144
152
  gridlineLength?: number;
145
153
  label?: string;
154
+ /** Rotate horizontal-axis tick labels -45° (crowding fallback). */
155
+ rotateTicks?: boolean;
156
+ /** Render every Nth tick label (tick marks always render). */
157
+ tickEvery?: number;
158
+ /** y-offset of the bottom axis title (grows when tick labels rotate). */
159
+ labelOffset?: number;
160
+ /** Clamp linear tick steps to whole numbers (category axes). */
161
+ integerTicks?: boolean;
146
162
  classes?: string;
147
163
  };
148
164
  export type ChartTooltipProperties = {
149
165
  data: TooltipData | null;
150
166
  mouseX?: number;
151
167
  mouseY?: number;
168
+ /** When set, the tooltip anchors to this point instead of following the cursor. */
169
+ anchor?: TooltipAnchor | null;
170
+ /** Render into document.body with position:fixed, clamped to the viewport. */
171
+ portal?: boolean;
172
+ /** The positioned chart wrapper; required to convert coords in portal mode. */
173
+ originEl?: HTMLElement | null;
174
+ /** Strip the tooltip card chrome (used when `content` supplies its own UI). */
175
+ unstyled?: boolean;
176
+ /** Custom content rendered inside the positioned (and clamped) wrapper. */
177
+ content?: Snippet;
152
178
  customSnippet?: Snippet<[TooltipData]>;
153
179
  classes?: string;
154
180
  };
155
181
  export type LegendProperties = {
156
182
  items: LegendItem[];
157
183
  position?: 'top' | 'bottom';
184
+ /** When provided, items render as toggle buttons and call back with their index. */
185
+ onToggle?: (index: number) => void;
158
186
  customSnippet?: Snippet<[LegendItem[]]>;
159
187
  classes?: string;
160
188
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.85.0",
3
+ "version": "2.87.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",