@gearbox-protocol/ui-kit 4.0.0-next.15 → 4.0.0-next.17

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 (51) hide show
  1. package/dist/cjs/components/base/index.cjs +1 -1
  2. package/dist/cjs/components/base/info-list/info-list.cjs +1 -1
  3. package/dist/cjs/components/base/position-assets/constants.cjs +1 -0
  4. package/dist/cjs/components/base/position-assets/index.cjs +1 -0
  5. package/dist/cjs/components/base/position-assets/position-assets.cjs +1 -0
  6. package/dist/cjs/components/base/stat-badge/constants.cjs +1 -1
  7. package/dist/cjs/components/base/stat-badge/stat-badge.cjs +1 -1
  8. package/dist/cjs/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.cjs +1 -1
  9. package/dist/cjs/components/base/tabber/tabber.cjs +1 -1
  10. package/dist/cjs/components/base/values/scalars.cjs +1 -1
  11. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  12. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  13. package/dist/cjs/components/index.cjs +1 -1
  14. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  15. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  16. package/dist/cjs/index.cjs +1 -1
  17. package/dist/cjs/locale/en.json.cjs +1 -1
  18. package/dist/cjs/utils/index.cjs +1 -1
  19. package/dist/cjs/utils/strategy-apy.cjs +1 -0
  20. package/dist/esm/components/base/index.js +112 -108
  21. package/dist/esm/components/base/info-list/info-list.js +7 -6
  22. package/dist/esm/components/base/position-assets/constants.js +8 -0
  23. package/dist/esm/components/base/position-assets/index.js +6 -0
  24. package/dist/esm/components/base/position-assets/position-assets.js +73 -0
  25. package/dist/esm/components/base/stat-badge/constants.js +1 -0
  26. package/dist/esm/components/base/stat-badge/stat-badge.js +87 -52
  27. package/dist/esm/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.js +130 -110
  28. package/dist/esm/components/base/tabber/tabber.js +67 -64
  29. package/dist/esm/components/base/values/scalars.js +52 -33
  30. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -1
  31. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -1
  32. package/dist/esm/components/index.js +662 -658
  33. package/dist/esm/components/with-copy/with-copy.js +1 -1
  34. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +20 -19
  35. package/dist/esm/index.js +858 -850
  36. package/dist/esm/locale/en.json.js +2 -1
  37. package/dist/esm/utils/index.js +64 -60
  38. package/dist/esm/utils/strategy-apy.js +41 -0
  39. package/dist/types/components/base/index.d.ts +1 -0
  40. package/dist/types/components/base/position-assets/constants.d.ts +5 -0
  41. package/dist/types/components/base/position-assets/index.d.ts +2 -0
  42. package/dist/types/components/base/position-assets/position-assets.d.ts +49 -0
  43. package/dist/types/components/base/stat-badge/constants.d.ts +1 -0
  44. package/dist/types/components/base/stat-badge/stat-badge.d.ts +11 -1
  45. package/dist/types/components/base/strategy-apy-breakdown-card/strategy-apy-breakdown-card.d.ts +12 -0
  46. package/dist/types/components/base/tabber/tabber.d.ts +2 -2
  47. package/dist/types/components/base/values/scalars.d.ts +4 -0
  48. package/dist/types/locale/en.json.d.ts +2 -1
  49. package/dist/types/utils/index.d.ts +1 -0
  50. package/dist/types/utils/strategy-apy.d.ts +37 -0
  51. package/package.json +1 -1
@@ -1,174 +1,194 @@
1
- import { jsxs as a, jsx as n, Fragment as I } from "react/jsx-runtime";
2
- import { PointsIcon as P } from "../../points-icon/points-icon.js";
3
- import { TokenIcon as L } from "../../token-icon/token-icon.js";
4
- import { FormattedMessageTyped as p } from "../../typed-intl/index.js";
1
+ import { jsxs as u, jsx as l, Fragment as M } from "react/jsx-runtime";
2
+ import { PointsIcon as $ } from "../../points-icon/points-icon.js";
3
+ import { TokenIcon as q } from "../../token-icon/token-icon.js";
4
+ import { FormattedMessageTyped as d } from "../../typed-intl/index.js";
5
5
  import "react";
6
- import { positiveTokenRewardsOf as R, pointProgramsOf as M } from "../../../utils/apy-breakdown.js";
6
+ import { positiveTokenRewardsOf as F, pointProgramsOf as T, totalApyOf as R } from "../../../utils/apy-breakdown.js";
7
7
  import "@gearbox-protocol/sdk";
8
- import { bpsToPercent as T } from "../../../utils/bps.js";
8
+ import { bpsToPercent as j } from "../../../utils/bps.js";
9
9
  import { cn as w } from "../../../utils/cn.js";
10
10
  import "sonner";
11
- import { formatLeverage as g } from "../../../utils/format-leverage.js";
12
- import { formatCompactPercent as $ } from "../../../utils/format-money.js";
13
- import { formatChipLeverage as C } from "../../../utils/leverage-presets.js";
11
+ import { formatLeverage as s } from "../../../utils/format-leverage.js";
12
+ import { formatCompactPercent as S } from "../../../utils/format-money.js";
13
+ import { strategyApyPartsAtLeverage as O } from "../../../utils/strategy-apy.js";
14
14
  import "@gearbox-protocol/sdk/common-utils";
15
15
  import "luxon";
16
16
  import "../../../utils/z-index.js";
17
- import { StrategyApyBreakdownCardTest as A } from "./constants.js";
18
- const u = "—";
19
- function m(r) {
20
- const t = T(r);
21
- if (Math.abs(t) >= 1e3) {
22
- const i = $(Math.abs(t));
23
- return t < 0 ? `−${i}` : i;
17
+ import { StrategyApyBreakdownCardTest as h } from "./constants.js";
18
+ const i = "—";
19
+ function a(e) {
20
+ const r = j(e);
21
+ if (Math.abs(r) >= 1e3) {
22
+ const p = S(Math.abs(r));
23
+ return r < 0 ? `−${p}` : p;
24
24
  }
25
- const l = Math.abs(t), s = l % 1 === 0 ? String(l) : l.toFixed(1);
26
- return t < 0 ? `−${s}%` : `${s}%`;
25
+ const m = Math.abs(r).toFixed(2);
26
+ return r < 0 ? `−${m}%` : `${m}%`;
27
27
  }
28
- function F(r) {
29
- return r == null || r <= 0 ? "bg-muted text-muted-foreground" : "bg-success/20 text-success";
28
+ function z(e) {
29
+ return e == null || e <= 0 ? "bg-muted text-muted-foreground" : "bg-success/20 text-success";
30
30
  }
31
- function y({
32
- base: r,
33
- leverage: t
31
+ function g({
32
+ base: e,
33
+ leverage: r
34
34
  }) {
35
- return /* @__PURE__ */ n(
36
- p,
35
+ return /* @__PURE__ */ l(
36
+ d,
37
37
  {
38
38
  messageId: "components.strategyApyBreakdownCard.formula",
39
- values: { base: r, leverage: t }
39
+ values: { base: e, leverage: r }
40
40
  }
41
41
  );
42
42
  }
43
- function Z({
44
- data: r,
45
- leverage: t
43
+ function oe({
44
+ data: e,
45
+ leverage: r
46
46
  }) {
47
- const l = t ?? (r.maxLeverage != null && r.maxLeverage > 0 ? r.maxLeverage : void 0), s = l != null ? g(l) : u, i = r.collateralApy ? R(r.collateralApy) : [], k = r.collateralApy ? M(r.collateralApy) : [], N = r.borrowApy != null || r.additionalBorrowApy != null, f = N ? (r.borrowApy ?? 0) + (r.additionalBorrowApy ?? 0) : void 0, B = l != null ? Math.max(l - 1, 0) : void 0, v = r.collateralApy?.organicApy, d = v != null && l != null ? v * l : void 0, c = i.map(
48
- (e) => e.supplyApr != null && l != null ? e.supplyApr * l : void 0
49
- ), b = f != null && B != null ? -(f * B) : void 0, h = d != null && b != null && c.every((e) => e != null) ? d + c.reduce((e, o) => e + (o ?? 0), 0) + b : d != null && c.every((e) => e != null) && !N ? d + c.reduce((e, o) => e + (o ?? 0), 0) : void 0;
50
- return /* @__PURE__ */ a(
47
+ const t = r ?? (e.maxLeverage != null && e.maxLeverage > 0 ? e.maxLeverage : void 0), m = t != null ? s(t) : i, p = e.collateralApy ? F(e.collateralApy) : [], k = e.collateralApy ? T(e.collateralApy) : [], n = t != null ? O({
48
+ leverage: t,
49
+ maxLeverage: e.maxLeverage,
50
+ borrowApy: e.borrowApy,
51
+ additionalBorrowApy: e.additionalBorrowApy
52
+ }) : void 0, y = e.collateralApy?.organicApy, b = y != null && t != null ? y * t : void 0, f = p.map(
53
+ (o) => o.supplyApr != null && t != null ? o.supplyApr * t : void 0
54
+ ), N = e.borrowApy != null && n != null ? -n.borrowCost : void 0, L = e.additionalBorrowApy, x = L != null && L !== 0, B = x && n != null ? n.quotaRate : void 0, C = x && n != null ? -n.quotaCost : void 0, I = b != null && n != null && f.every((o) => o != null) ? b + f.reduce((o, c) => o + (c ?? 0), 0) - n.totalCost : void 0, P = t != null && e.maxLeverage != null && e.maxLeverage > 0 && Math.abs(t - e.maxLeverage) < 1e-9, A = e.netApy != null ? R(e.netApy) : P && e.maxLeverageApy != null ? R(e.maxLeverageApy) : I;
55
+ return /* @__PURE__ */ u(
51
56
  "div",
52
57
  {
53
58
  className: "flex w-full min-w-0 flex-col gap-4 rounded-xl border border-border bg-card p-4",
54
- "data-testid": A.root,
59
+ "data-testid": h.root,
55
60
  children: [
56
- /* @__PURE__ */ a("div", { className: "flex h-6 items-center justify-between gap-3", children: [
57
- /* @__PURE__ */ n("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ n(
58
- p,
61
+ /* @__PURE__ */ u("div", { className: "flex h-6 items-center justify-between gap-3", children: [
62
+ /* @__PURE__ */ l("span", { className: "text-base font-semibold leading-4 text-foreground", children: /* @__PURE__ */ l(
63
+ d,
59
64
  {
60
65
  messageId: "components.strategyApyBreakdownCard.titleAtLeverage",
61
- values: { leverage: s }
66
+ values: { leverage: m }
62
67
  }
63
68
  ) }),
64
- /* @__PURE__ */ n(
69
+ /* @__PURE__ */ l(
65
70
  "span",
66
71
  {
67
72
  className: w(
68
73
  "rounded-md px-2 py-0.5 text-sm font-semibold tabular-nums",
69
- F(h)
74
+ z(A)
70
75
  ),
71
- "data-testid": A.net,
72
- children: h == null ? u : m(h)
76
+ "data-testid": h.net,
77
+ children: A == null ? i : a(A)
73
78
  }
74
79
  )
75
80
  ] }),
76
- /* @__PURE__ */ a("div", { className: "flex flex-col gap-3", children: [
77
- /* @__PURE__ */ n(
78
- x,
81
+ /* @__PURE__ */ u("div", { className: "flex flex-col gap-3", children: [
82
+ /* @__PURE__ */ l(
83
+ v,
79
84
  {
80
- label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.collateralApy" }),
81
- value: d == null ? u : m(d),
82
- subtext: v != null && l != null ? /* @__PURE__ */ n(
83
- y,
85
+ label: /* @__PURE__ */ l(d, { messageId: "components.strategyApyBreakdownCard.collateralApy" }),
86
+ value: b == null ? i : a(b),
87
+ subtext: y != null && t != null ? /* @__PURE__ */ l(
88
+ g,
84
89
  {
85
- base: m(v),
86
- leverage: g(l)
90
+ base: a(y),
91
+ leverage: s(t)
87
92
  }
88
93
  ) : void 0
89
94
  }
90
95
  ),
91
- i.map((e, o) => /* @__PURE__ */ n(
92
- x,
96
+ p.map((o, c) => /* @__PURE__ */ l(
97
+ v,
93
98
  {
94
- label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
95
- /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
96
- p,
99
+ label: /* @__PURE__ */ u("span", { className: "inline-flex items-center gap-1.5", children: [
100
+ /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(
101
+ d,
97
102
  {
98
103
  messageId: "components.apyParts.extraAPY",
99
- values: { symbol: e.token.symbol }
104
+ values: { symbol: o.token.symbol }
100
105
  }
101
106
  ) }),
102
- /* @__PURE__ */ n(
103
- L,
107
+ /* @__PURE__ */ l(
108
+ q,
104
109
  {
105
- token: e.token,
106
- symbol: e.token.symbol,
110
+ token: o.token,
111
+ symbol: o.token.symbol,
107
112
  size: 16,
108
113
  className: "shrink-0"
109
114
  }
110
115
  )
111
116
  ] }),
112
- value: c[o] == null ? u : m(c[o]),
113
- subtext: e.supplyApr != null && l != null ? /* @__PURE__ */ n(
114
- y,
117
+ value: f[c] == null ? i : a(f[c]),
118
+ subtext: o.supplyApr != null && t != null ? /* @__PURE__ */ l(
119
+ g,
115
120
  {
116
- base: m(e.supplyApr),
117
- leverage: g(l)
121
+ base: a(o.supplyApr),
122
+ leverage: s(t)
118
123
  }
119
124
  ) : void 0
120
125
  },
121
- `incentive-${e.token.address}-${e.supplyApr ?? 0}`
126
+ `incentive-${o.token.address}-${o.supplyApr ?? 0}`
122
127
  )),
123
- /* @__PURE__ */ n(
124
- x,
128
+ /* @__PURE__ */ l(
129
+ v,
125
130
  {
126
131
  muted: !0,
127
- label: /* @__PURE__ */ n(p, { messageId: "components.strategyApyBreakdownCard.borrowRate" }),
128
- value: b == null ? u : m(b),
129
- subtext: f != null && l != null ? /* @__PURE__ */ n(
130
- y,
132
+ label: /* @__PURE__ */ l(d, { messageId: "components.strategyApyBreakdownCard.borrowRate" }),
133
+ value: N == null ? i : a(N),
134
+ subtext: e.borrowApy != null && n != null ? /* @__PURE__ */ l(
135
+ g,
131
136
  {
132
- base: m(f),
133
- leverage: g(l)
137
+ base: a(-e.borrowApy),
138
+ leverage: s(n.debtMultiplier)
134
139
  }
135
140
  ) : void 0
136
141
  }
137
142
  ),
138
- k.length > 0 ? /* @__PURE__ */ a(I, { children: [
139
- /* @__PURE__ */ n("div", { className: "h-px w-full bg-divider" }),
140
- k.map((e) => {
141
- const o = e.multiplier != null && l != null ? e.multiplier * l : void 0;
142
- return /* @__PURE__ */ n(
143
- x,
143
+ x ? /* @__PURE__ */ l(
144
+ v,
145
+ {
146
+ muted: !0,
147
+ label: /* @__PURE__ */ l(d, { messageId: "components.strategyApyBreakdownCard.quotaRate" }),
148
+ value: C == null ? i : a(C),
149
+ subtext: B != null && t != null ? /* @__PURE__ */ l(
150
+ g,
151
+ {
152
+ base: a(-B),
153
+ leverage: s(t)
154
+ }
155
+ ) : void 0
156
+ }
157
+ ) : null,
158
+ k.length > 0 ? /* @__PURE__ */ u(M, { children: [
159
+ /* @__PURE__ */ l("div", { className: "h-px w-full bg-divider" }),
160
+ k.map((o) => {
161
+ const c = o.multiplier != null && t != null ? o.multiplier * t : void 0;
162
+ return /* @__PURE__ */ l(
163
+ v,
144
164
  {
145
- label: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
146
- /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
147
- p,
165
+ label: /* @__PURE__ */ u("span", { className: "inline-flex items-center gap-1.5", children: [
166
+ /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(
167
+ d,
148
168
  {
149
169
  messageId: "components.yieldBreakdown.programPoints",
150
- values: { name: e.name }
170
+ values: { name: o.name }
151
171
  }
152
172
  ) }),
153
- /* @__PURE__ */ n(
154
- P,
173
+ /* @__PURE__ */ l(
174
+ $,
155
175
  {
156
- reward: { name: e.name, type: e.id },
176
+ reward: { name: o.name, type: o.id },
157
177
  size: 16,
158
178
  className: "shrink-0"
159
179
  }
160
180
  )
161
181
  ] }),
162
- value: o != null ? `${C(o)}×` : u,
163
- subtext: e.multiplier != null && l != null ? /* @__PURE__ */ n(
164
- y,
182
+ value: c != null ? `${s(c)}×` : i,
183
+ subtext: o.multiplier != null && t != null ? /* @__PURE__ */ l(
184
+ g,
165
185
  {
166
- base: C(e.multiplier),
167
- leverage: g(l)
186
+ base: s(o.multiplier),
187
+ leverage: s(t)
168
188
  }
169
189
  ) : void 0
170
190
  },
171
- e.id
191
+ o.id
172
192
  );
173
193
  })
174
194
  ] }) : null
@@ -177,38 +197,38 @@ function Z({
177
197
  }
178
198
  );
179
199
  }
180
- function x({
181
- label: r,
182
- value: t,
183
- subtext: l,
184
- muted: s = !1
200
+ function v({
201
+ label: e,
202
+ value: r,
203
+ subtext: t,
204
+ muted: m = !1
185
205
  }) {
186
- const i = s ? "text-muted-foreground" : "text-foreground";
187
- return /* @__PURE__ */ a(
206
+ const p = m ? "text-muted-foreground" : "text-foreground";
207
+ return /* @__PURE__ */ u(
188
208
  "div",
189
209
  {
190
210
  className: "flex items-start justify-between gap-3",
191
- "data-testid": A.row,
211
+ "data-testid": h.row,
192
212
  children: [
193
- /* @__PURE__ */ n("span", { className: w("min-w-0 text-sm font-semibold leading-5", i), children: r }),
194
- /* @__PURE__ */ a("span", { className: "flex shrink-0 flex-col items-end", children: [
195
- /* @__PURE__ */ n(
213
+ /* @__PURE__ */ l("span", { className: w("min-w-0 text-sm font-semibold leading-5", p), children: e }),
214
+ /* @__PURE__ */ u("span", { className: "flex shrink-0 flex-col items-end", children: [
215
+ /* @__PURE__ */ l(
196
216
  "span",
197
217
  {
198
218
  className: w(
199
219
  "text-sm font-semibold leading-5 tabular-nums",
200
- t === u || s ? "text-muted-foreground" : "text-foreground"
220
+ r === i || m ? "text-muted-foreground" : "text-foreground"
201
221
  ),
202
- children: t
222
+ children: r
203
223
  }
204
224
  ),
205
- l != null ? /* @__PURE__ */ n("span", { className: "text-xs leading-4 text-muted-foreground", children: l }) : null
225
+ t != null ? /* @__PURE__ */ l("span", { className: "text-xs leading-4 text-muted-foreground", children: t }) : null
206
226
  ] })
207
227
  ]
208
228
  }
209
229
  );
210
230
  }
211
231
  export {
212
- Z as StrategyApyBreakdownCard,
213
- A as StrategyApyBreakdownCardTest
232
+ oe as StrategyApyBreakdownCard,
233
+ h as StrategyApyBreakdownCardTest
214
234
  };
@@ -1,124 +1,127 @@
1
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
- import { createContext as O, useContext as E, useMemo as x, Children as B, useRef as T, useEffect as q, isValidElement as N } from "react";
3
- import { SectionHeading as D } from "../section-heading/section-heading.js";
4
- import { Stack as f } from "../stack/stack.js";
5
- import { StickyBar as F } from "../sticky-bar/sticky-bar.js";
6
- import { useTitleText as R } from "../text/use-title-text.js";
7
- import { TabItem as M, TabControl as P } from "../../tab-control/tab-control.js";
1
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
2
+ import { createContext as E, useContext as q, useMemo as d, Children as N, useRef as T, useEffect as D, isValidElement as R } from "react";
3
+ import { SectionHeading as F } from "../section-heading/section-heading.js";
4
+ import { Stack as u } from "../stack/stack.js";
5
+ import { StickyBar as M } from "../sticky-bar/sticky-bar.js";
6
+ import { useTitleText as j } from "../text/use-title-text.js";
7
+ import { TabItem as P, TabControl as V } from "../../tab-control/tab-control.js";
8
8
  import { TabberTest as S } from "./constants.js";
9
- import { useDetailScrollSpy as V } from "./use-detail-scroll-spy.js";
10
- const j = O({});
11
- function k({
9
+ import { useDetailScrollSpy as W } from "./use-detail-scroll-spy.js";
10
+ const k = E({});
11
+ function A({
12
12
  id: e,
13
13
  title: o,
14
- heading: c = o,
15
- actions: a,
14
+ heading: s = o,
15
+ actions: c,
16
16
  children: m,
17
- hideHeading: l = !1
17
+ hideHeading: a = !1
18
18
  }) {
19
- const i = E(j), n = R(), s = !l;
19
+ const l = q(k), i = j(), n = !a;
20
20
  return /* @__PURE__ */ r(
21
21
  "section",
22
22
  {
23
- ref: i[e],
23
+ ref: l[e],
24
24
  className: "scroll-mt-28",
25
25
  "data-scroll-section": e,
26
26
  "data-testid": S.section,
27
- children: /* @__PURE__ */ u(f, { gap: "md", children: [
28
- s || a ? /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-3", children: [
29
- s ? /* @__PURE__ */ r(D, { children: n(c) }) : /* @__PURE__ */ r("span", {}),
30
- a
27
+ children: /* @__PURE__ */ p(u, { gap: "md", children: [
28
+ n || c ? /* @__PURE__ */ p("div", { className: "flex items-center justify-between gap-3", children: [
29
+ n ? /* @__PURE__ */ r(F, { children: i(s) }) : /* @__PURE__ */ r("span", {}),
30
+ c
31
31
  ] }) : null,
32
32
  m
33
33
  ] })
34
34
  }
35
35
  );
36
36
  }
37
- k.displayName = "TabberSection";
37
+ A.displayName = "TabberSection";
38
38
  function g(e) {
39
- return N(e) && e.type === k;
39
+ return R(e) && e.type === A;
40
40
  }
41
- function W({
41
+ function z({
42
42
  item: e,
43
43
  ...o
44
44
  }) {
45
- return /* @__PURE__ */ u("div", { className: "flex items-stretch overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:h-0 [scrollbar-width:none]", children: [
46
- /* @__PURE__ */ r("div", { className: "min-w-0 basis-0 grow pb-px", children: /* @__PURE__ */ r(P, { ...o, showBorder: !0 }) }),
45
+ return /* @__PURE__ */ p("div", { className: "flex items-stretch overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:h-0 [scrollbar-width:none]", children: [
46
+ /* @__PURE__ */ r("div", { className: "min-w-0 basis-0 grow pb-px", children: /* @__PURE__ */ r(V, { ...o, showBorder: !0 }) }),
47
47
  e && /* @__PURE__ */ r("div", { className: "w-auto shrink-0 grow-0 basis-auto", children: e })
48
48
  ] });
49
49
  }
50
- function z({
50
+ function G({
51
51
  children: e,
52
52
  observeKey: o,
53
- initialSection: c,
54
- testId: a,
53
+ initialSection: s,
54
+ testId: c,
55
55
  mobileManagePane: m
56
56
  }) {
57
- const l = x(
58
- () => B.toArray(e).filter(g),
57
+ const a = d(
58
+ () => N.toArray(e).filter(g),
59
59
  [e]
60
- ), i = l.map((t) => t.props.id).join("|"), n = x(
60
+ ), l = d(
61
+ () => a.filter((t) => t.props.beforeBar !== !0),
62
+ [a]
63
+ ), i = l.map((t) => t.props.id).join("|"), n = d(
61
64
  () => i === "" ? [] : i.split("|"),
62
65
  [i]
63
- ), s = T({}), d = x(() => {
66
+ ), w = T({}), f = d(() => {
64
67
  const t = {
65
- ...s.current
68
+ ...w.current
66
69
  };
67
- for (const y of n)
68
- t[y] === void 0 && (t[y] = { current: null });
69
- return s.current = t, t;
70
- }, [n]), A = R(), { activeSection: p, scrollToSection: b } = V(
71
- d,
70
+ for (const B of n)
71
+ t[B] === void 0 && (t[B] = { current: null });
72
+ return w.current = t, t;
73
+ }, [n]), I = j(), { activeSection: b, scrollToSection: h } = W(
74
+ f,
72
75
  n,
73
76
  o
74
- ), h = T(!1), w = T(o);
75
- q(() => {
76
- if (o !== w.current && (w.current = o, h.current = !1), h.current || !o) return;
77
- const t = c ?? n[0];
78
- h.current = !0, !(t === void 0 || t === n[0]) && d[t] !== void 0 && requestAnimationFrame(() => {
79
- b(t);
77
+ ), x = T(!1), v = T(o);
78
+ D(() => {
79
+ if (o !== v.current && (v.current = o, x.current = !1), x.current || !o) return;
80
+ const t = s ?? n[0];
81
+ x.current = !0, !(t === void 0 || t === n[0]) && f[t] !== void 0 && requestAnimationFrame(() => {
82
+ h(t);
80
83
  });
81
- }, [o, c, b, n, d]);
82
- const I = l.map((t) => ({
84
+ }, [o, s, h, n, f]);
85
+ const H = l.map((t) => ({
83
86
  id: t.props.id,
84
87
  item: /* @__PURE__ */ r(
85
- M,
88
+ P,
86
89
  {
87
- selected: p === t.props.id,
88
- label: A(t.props.title)
90
+ selected: b === t.props.id,
91
+ label: I(t.props.title)
89
92
  }
90
93
  )
91
- })), C = B.toArray(e), v = C.filter(
94
+ })), C = N.toArray(e), y = C.filter(
92
95
  (t) => g(t) && t.props.beforeBar === !0
93
- ), H = C.filter(
96
+ ), O = C.filter(
94
97
  (t) => !(g(t) && t.props.beforeBar === !0)
95
98
  );
96
- return /* @__PURE__ */ r(f, { gap: "lg", "data-testid": a ?? S.root, children: /* @__PURE__ */ u(j.Provider, { value: d, children: [
97
- v.length > 0 ? /* @__PURE__ */ r(f, { gap: "xl", children: v }) : null,
99
+ return /* @__PURE__ */ r(u, { gap: "lg", "data-testid": c ?? S.root, children: /* @__PURE__ */ p(k.Provider, { value: f, children: [
100
+ y.length > 0 ? /* @__PURE__ */ r(u, { gap: "xl", children: y }) : null,
98
101
  m,
99
- /* @__PURE__ */ r(F, { testId: S.bar, children: /* @__PURE__ */ r(
100
- W,
102
+ /* @__PURE__ */ r(M, { testId: S.bar, children: /* @__PURE__ */ r(
103
+ z,
101
104
  {
102
105
  state: {
103
- id: p,
104
- index: n.indexOf(p),
106
+ id: b,
107
+ index: n.indexOf(b),
105
108
  handleTabChange: (t) => {
106
- b(t);
109
+ h(t);
107
110
  }
108
111
  },
109
- tabs: I,
112
+ tabs: H,
110
113
  item: null
111
114
  }
112
115
  ) }),
113
- /* @__PURE__ */ r(f, { gap: "xl", children: H })
116
+ /* @__PURE__ */ r(u, { gap: "xl", children: O })
114
117
  ] }) });
115
118
  }
116
- function $(e) {
117
- return N(e) && e.type === z;
119
+ function K(e) {
120
+ return R(e) && e.type === G;
118
121
  }
119
122
  export {
120
- z as Tabber,
121
- k as TabberSection,
123
+ G as Tabber,
124
+ A as TabberSection,
122
125
  S as TabberTest,
123
- $ as isTabber
126
+ K as isTabber
124
127
  };