@gearbox-protocol/ui-kit 3.14.0-next.1 → 3.14.0-next.2

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),q="ui-kit:tradingview-series-colors:";function E(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(q+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(q+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function O(e,t){if(t.size===0)return;const c=E(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:N,range:T,rangeList:M,setRange:V,onGraphExpanded:y,isGraphExpanded:F,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:z,noDataMessage:I="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),R=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),C=ne.useIsMobile(),Z=x.useCallback((w,p)=>{re.toast.error(I)},[I]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!C&&y||M.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:N,graphsWithNoData:D,loadingGraphs:z,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:T,rangeList:M,setRange:V}),!C&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:F?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),k=x.useRef(!1);if(m&&m.length>0&&!k.current){k.current=!0;const w=u?E(u):new Map,p=String(m[0].value);s.current.set(p,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&O(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=E(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const p=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,A=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(A)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const S=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(S)){l=S;break}}s.current.set(A,l),f.current=l+1}const ee=s.current.get(A)??0,_=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),S=typeof l.time=="number"?l.time:Number(l.time);return d-S}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),L=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...L!=null?{lineColor:L,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:_.line,topColor:_.top,bottomColor:_.bottom}}});return u&&s.current.size>0&&O(u,s.current),p},[v,r,t,u]),G=R&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:R,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),N="ui-kit:tradingview-series-colors:";function M(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(N+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(N+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function q(e,t){if(t.size===0)return;const c=M(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:T,range:V,rangeList:I,setRange:F,onGraphExpanded:y,isGraphExpanded:z,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:A,noDataMessage:R="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),C=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),k=ne.useIsMobile(),Z=x.useCallback((w,S)=>{re.toast.error(R)},[R]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!k&&y||I.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:T,graphsWithNoData:D,loadingGraphs:A,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:V,rangeList:I,setRange:F}),!k&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:z?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),L=x.useRef(!1);if(m&&m.length>0&&!L.current){L.current=!0;const w=u?M(u):new Map,S=String(m[0].value);s.current.set(S,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&q(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=M(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const S=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,_=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(_)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const p=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(p)){l=p;break}}s.current.set(_,l),f.current=l+1}const ee=s.current.get(_)??0,E=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),p=typeof l.time=="number"?l.time:Number(l.time);return d-p}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),O=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...O!=null?{lineColor:O,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:E.line,topColor:E.top,bottomColor:E.bottom}}});return u&&s.current.size>0&&q(u,s.current),S},[v,r,t,u]),G=A!==void 0?A.size>0:C&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:C,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as l } from "react/jsx-runtime";
2
- import { useMemo as y, useCallback as ne, useRef as M } from "react";
2
+ import { useMemo as y, useCallback as ne, useRef as E } from "react";
3
3
  import { toast as ie } from "sonner";
4
4
  import { useIsMobile as le } from "../../hooks/use-media-query.js";
5
5
  import "@gearbox-protocol/sdk";
@@ -8,7 +8,7 @@ import "@gearbox-protocol/sdk/common-utils";
8
8
  import "luxon";
9
9
  import "../../utils/z-index.js";
10
10
  import { RangeButtons as ce } from "../buttons/range-buttons/range-buttons.js";
11
- import { DEFAULT_SERIES_COLORS as E, getSeriesColorPalette as ue } from "../graph/graph.js";
11
+ import { DEFAULT_SERIES_COLORS as k, getSeriesColorPalette as ue } from "../graph/graph.js";
12
12
  import { GraphViewWithData as me } from "../graph/graph-view.js";
13
13
  import { GraphDropdown as fe } from "./graph-dropdown.js";
14
14
  const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
@@ -45,17 +45,17 @@ const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
45
45
  /* @__PURE__ */ l("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" })
46
46
  ]
47
47
  }
48
- ), F = "ui-kit:tradingview-series-colors:";
49
- function k(e) {
48
+ ), V = "ui-kit:tradingview-series-colors:";
49
+ function j(e) {
50
50
  if (typeof window > "u" || !window.localStorage)
51
51
  return /* @__PURE__ */ new Map();
52
52
  try {
53
- const t = window.localStorage.getItem(F + e);
53
+ const t = window.localStorage.getItem(V + e);
54
54
  if (!t) return /* @__PURE__ */ new Map();
55
55
  const c = JSON.parse(t);
56
56
  return c == null || typeof c != "object" ? /* @__PURE__ */ new Map() : new Map(
57
57
  Object.entries(c).filter(
58
- ([, o]) => typeof o == "number" && o >= 0 && o < E.length
58
+ ([, o]) => typeof o == "number" && o >= 0 && o < k.length
59
59
  )
60
60
  );
61
61
  } catch {
@@ -66,17 +66,17 @@ function we(e, t) {
66
66
  if (!(typeof window > "u" || !window.localStorage))
67
67
  try {
68
68
  window.localStorage.setItem(
69
- F + e,
69
+ V + e,
70
70
  JSON.stringify(Object.fromEntries(t))
71
71
  );
72
72
  } catch {
73
73
  }
74
74
  }
75
- function z(e, t) {
75
+ function F(e, t) {
76
76
  if (t.size === 0) return;
77
- const c = k(e);
78
- for (const [o, p] of t)
79
- c.set(o, p);
77
+ const c = j(e);
78
+ for (const [o, v] of t)
79
+ c.set(o, v);
80
80
  we(e, c);
81
81
  }
82
82
  function Re({
@@ -84,18 +84,18 @@ function Re({
84
84
  yMeasureUnit: t,
85
85
  height: c = 306,
86
86
  defaultGraph: o,
87
- onGraphSelected: p,
87
+ onGraphSelected: v,
88
88
  graphs: d,
89
- isMultipleSelect: V,
90
- range: B,
91
- rangeList: j,
92
- setRange: T,
89
+ isMultipleSelect: B,
90
+ range: T,
91
+ rangeList: N,
92
+ setRange: D,
93
93
  onGraphExpanded: A,
94
- isGraphExpanded: D,
95
- onUnselectSeries: W,
96
- graphsWithNoData: H,
97
- loadingGraphs: J,
98
- noDataMessage: N = "No data available for this graph",
94
+ isGraphExpanded: W,
95
+ onUnselectSeries: H,
96
+ graphsWithNoData: J,
97
+ loadingGraphs: I,
98
+ noDataMessage: R = "No data available for this graph",
99
99
  currentValueDecimals: $,
100
100
  containerClassName: X,
101
101
  useSharedPriceScale: q,
@@ -105,51 +105,51 @@ function Re({
105
105
  seriesColorPersistenceKey: u,
106
106
  ...U
107
107
  }) {
108
- const v = y(() => Array.isArray(e) ? e : e ? [e] : [], [e]), R = y(() => Array.isArray(e) && e.length > 1, [e]), L = le(), K = ne(
108
+ const b = y(() => Array.isArray(e) ? e : e ? [e] : [], [e]), L = y(() => Array.isArray(e) && e.length > 1, [e]), O = le(), K = ne(
109
109
  (w, g) => {
110
- ie.error(N);
110
+ ie.error(R);
111
111
  },
112
- [N]
112
+ [R]
113
113
  ), P = y(() => {
114
114
  if (t)
115
115
  return Array.isArray(t) ? t[0] : t;
116
- }, [t]), G = (!L && A || j.length > 0 || p && d && o) && /* @__PURE__ */ S("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
117
- /* @__PURE__ */ l("div", { children: p && d && o && /* @__PURE__ */ l(
116
+ }, [t]), G = (!O && A || N.length > 0 || v && d && o) && /* @__PURE__ */ S("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
117
+ /* @__PURE__ */ l("div", { children: v && d && o && /* @__PURE__ */ l(
118
118
  fe,
119
119
  {
120
- onSelected: p,
120
+ onSelected: v,
121
121
  items: d,
122
122
  defaultItem: o,
123
- multiple: V,
124
- graphsWithNoData: H,
125
- loadingGraphs: J,
123
+ multiple: B,
124
+ graphsWithNoData: J,
125
+ loadingGraphs: I,
126
126
  onNoDataSelected: K
127
127
  }
128
128
  ) }),
129
129
  /* @__PURE__ */ S("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
130
- /* @__PURE__ */ l(ce, { range: B, rangeList: j, setRange: T }),
131
- !L && A && /* @__PURE__ */ l(
130
+ /* @__PURE__ */ l(ce, { range: T, rangeList: N, setRange: D }),
131
+ !O && A && /* @__PURE__ */ l(
132
132
  "button",
133
133
  {
134
134
  type: "button",
135
135
  className: "px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",
136
136
  onClick: A,
137
- children: D ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
137
+ children: W ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
138
138
  }
139
139
  )
140
140
  ] })
141
- ] }), i = M(/* @__PURE__ */ new Map()), a = M(0), O = M(!1);
142
- if (d && d.length > 0 && !O.current) {
143
- O.current = !0;
144
- const w = u ? k(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
141
+ ] }), i = E(/* @__PURE__ */ new Map()), a = E(0), _ = E(!1);
142
+ if (d && d.length > 0 && !_.current) {
143
+ _.current = !0;
144
+ const w = u ? j(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
145
145
  i.current.set(g, 0), a.current = 1;
146
146
  for (let r = 1; r < d.length; r++) {
147
147
  const m = String(d[r].value);
148
148
  if (i.current.has(m)) continue;
149
- const b = w.get(m) ?? r;
150
- i.current.set(m, b), a.current = Math.max(a.current, b + 1);
149
+ const p = w.get(m) ?? r;
150
+ i.current.set(m, p), a.current = Math.max(a.current, p + 1);
151
151
  }
152
- u && z(
152
+ u && F(
153
153
  u,
154
154
  i.current
155
155
  );
@@ -157,42 +157,42 @@ function Re({
157
157
  const ee = y(() => {
158
158
  const w = Array.isArray(t) ? t : void 0;
159
159
  if (u) {
160
- const r = k(u);
160
+ const r = j(u);
161
161
  for (const [m, x] of r)
162
162
  i.current.has(m) || (i.current.set(m, x), a.current = Math.max(
163
163
  a.current,
164
164
  x + 1
165
165
  ));
166
166
  }
167
- const g = v.map((r, m) => {
168
- const x = r?.title || `Series ${m + 1}`, b = o != null ? Array.isArray(o) ? o[0]?.value ?? o[0] : typeof o == "object" && "value" in o ? o.value : o : null, I = v.length === 1 ? b != null ? String(b) : "single" : r?.id || x;
169
- if (!i.current.has(I)) {
167
+ const g = b.map((r, m) => {
168
+ const x = r?.title || `Series ${m + 1}`, p = o != null ? Array.isArray(o) ? o[0]?.value ?? o[0] : typeof o == "object" && "value" in o ? o.value : o : null, C = b.length === 1 ? p != null ? String(p) : "single" : r?.id || x;
169
+ if (!i.current.has(C)) {
170
170
  const n = new Set(
171
171
  Array.from(i.current.values())
172
172
  );
173
173
  let s = a.current;
174
- for (let f = 0; f < E.length; f++) {
175
- const h = (a.current + f) % E.length;
174
+ for (let f = 0; f < k.length; f++) {
175
+ const h = (a.current + f) % k.length;
176
176
  if (!n.has(h)) {
177
177
  s = h;
178
178
  break;
179
179
  }
180
180
  }
181
- i.current.set(I, s), a.current = s + 1;
181
+ i.current.set(C, s), a.current = s + 1;
182
182
  }
183
- const oe = i.current.get(I) ?? 0, C = ue(oe), re = [...r?.data || []].sort((n, s) => {
183
+ const oe = i.current.get(C) ?? 0, M = ue(oe), re = [...r?.data || []].sort((n, s) => {
184
184
  const f = typeof n.time == "number" ? n.time : Number(n.time), h = typeof s.time == "number" ? s.time : Number(s.time);
185
185
  return f - h;
186
186
  }).reduce((n, s) => {
187
187
  const f = s.time;
188
188
  return n.length === 0 || n[n.length - 1].time !== f ? n.push({ time: f, value: s.value }) : n[n.length - 1] = { time: f, value: s.value }, n;
189
- }, []), _ = r?.lineColor ?? r?.color ?? void 0;
189
+ }, []), z = r?.lineColor ?? r?.color ?? void 0;
190
190
  return {
191
191
  data: re,
192
192
  label: x,
193
193
  yMeasureUnit: w?.[m] ?? (Array.isArray(t) ? void 0 : t),
194
- ..._ != null ? {
195
- lineColor: _,
194
+ ...z != null ? {
195
+ lineColor: z,
196
196
  ...r?.topColor != null && {
197
197
  topColor: r.topColor
198
198
  },
@@ -200,17 +200,17 @@ function Re({
200
200
  bottomColor: r.bottomColor
201
201
  }
202
202
  } : {
203
- color: C.line,
204
- topColor: C.top,
205
- bottomColor: C.bottom
203
+ color: M.line,
204
+ topColor: M.top,
205
+ bottomColor: M.bottom
206
206
  }
207
207
  };
208
208
  });
209
- return u && i.current.size > 0 && z(
209
+ return u && i.current.size > 0 && F(
210
210
  u,
211
211
  i.current
212
212
  ), g;
213
- }, [v, o, t, u]), te = R && v.length > 0 ? v.some((w) => !w) : !e;
213
+ }, [b, o, t, u]), te = I !== void 0 ? I.size > 0 : L && b.length > 0 ? b.some((w) => !w) : !e;
214
214
  return /* @__PURE__ */ l(
215
215
  "div",
216
216
  {
@@ -227,8 +227,8 @@ function Re({
227
227
  toolbar: G,
228
228
  size: c ? "full" : "default",
229
229
  containerClassName: se("h-full", X),
230
- showLegend: R,
231
- onUnselectSeries: W,
230
+ showLegend: L,
231
+ onUnselectSeries: H,
232
232
  yMeasureUnit: P,
233
233
  currentValueDecimals: $,
234
234
  useSharedPriceScale: q,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.14.0-next.1",
3
+ "version": "3.14.0-next.2",
4
4
  "description": "Internal UI components",
5
5
  "repository": "https://github.com/gearbox-protocol/ui-kit",
6
6
  "license": "MIT",