@gearbox-protocol/ui-kit 4.0.0-next.57 → 4.0.0-next.58

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.
@@ -31,6 +31,27 @@ export interface SeriesConfig {
31
31
  }
32
32
  /** Chart-instance key: stable `id` when set, otherwise the display `label`. */
33
33
  export declare function seriesIdentity(series: Pick<SeriesConfig, "id" | "label">): string;
34
+ export interface VisibleLogicalRangeInput {
35
+ readonly lastIndex: number;
36
+ readonly width: number;
37
+ readonly padLeft: boolean;
38
+ readonly padRight: boolean;
39
+ readonly paddingPx?: number;
40
+ }
41
+ /**
42
+ * Logical range that shows every bar, plus optional plot-area air so a
43
+ * centred `dd MMM` date label is not clipped by the frame.
44
+ *
45
+ * Computed from the point count rather than `getVisibleLogicalRange()`:
46
+ * `setVisibleRange` in lightweight-charts is applied on the next animation
47
+ * frame, so reading the scale back immediately returns the previous (or
48
+ * default `barSpacing: 6`) window and a follow-up `setVisibleLogicalRange`
49
+ * would replace the full-period request with a truncated one.
50
+ */
51
+ export declare function visibleLogicalRangeFor({ lastIndex, width, padLeft, padRight, paddingPx, }: VisibleLogicalRangeInput): {
52
+ from: number;
53
+ to: number;
54
+ } | null;
34
55
  export type VerticalLineOptions = Partial<{
35
56
  color: string;
36
57
  labelText: string;
@@ -206,10 +227,10 @@ export interface GraphProps {
206
227
  */
207
228
  yScaleMinMultiple?: number;
208
229
  /**
209
- * Minimum visible time (unix seconds). When set, the X axis never zooms
210
- * in further than this value even if the current series data starts later.
211
- * Useful for keeping the full selected time range (e.g. 1Y) when switching
212
- * between series with different data coverage.
230
+ * Minimum visible time (unix seconds). When set, leading whitespace is
231
+ * injected so a later-starting series still occupies the selected window.
232
+ * It does not change the logical range applied below: `timeToIndex` with
233
+ * `findNearest` already snaps a time before the first point to index 0.
213
234
  */
214
235
  visibleTimeFrom?: number;
215
236
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "4.0.0-next.57",
3
+ "version": "4.0.0-next.58",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",