@gearbox-protocol/permissionless-ui 1.22.0-next.34 → 1.22.0-next.36

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 (57) hide show
  1. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  2. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  3. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  4. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  5. package/dist/cjs/components/complex-input/index.cjs +1 -1
  6. package/dist/cjs/components/formatted-number/formatted-number.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -1
  8. package/dist/cjs/components/input/input.cjs +1 -1
  9. package/dist/cjs/components/input/use-icon-slot-widths.cjs +1 -0
  10. package/dist/cjs/components/short-string/short-string.cjs +1 -1
  11. package/dist/cjs/components/status-elements/index.cjs +1 -0
  12. package/dist/cjs/components/status-elements/status-elements.cjs +1 -0
  13. package/dist/cjs/components/tip-card/tip-card.cjs +1 -1
  14. package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
  15. package/dist/cjs/components/token-template/token-template.cjs +1 -1
  16. package/dist/cjs/components/tooltip/simple-tooltip.cjs +1 -1
  17. package/dist/cjs/components/with-title/with-title.cjs +1 -1
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/locale/en.json.cjs +1 -0
  20. package/dist/cjs/locale/index.cjs +1 -0
  21. package/dist/esm/components/block-sync/block-sync.js +34 -36
  22. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -1
  23. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -1
  24. package/dist/esm/components/complex-input/complex-input.js +211 -55
  25. package/dist/esm/components/complex-input/index.js +3 -2
  26. package/dist/esm/components/formatted-number/formatted-number.js +41 -8
  27. package/dist/esm/components/index.js +456 -452
  28. package/dist/esm/components/input/input.js +28 -22
  29. package/dist/esm/components/input/use-icon-slot-widths.js +41 -0
  30. package/dist/esm/components/short-string/short-string.js +10 -14
  31. package/dist/esm/components/status-elements/index.js +5 -0
  32. package/dist/esm/components/status-elements/status-elements.js +48 -0
  33. package/dist/esm/components/tip-card/tip-card.js +5 -5
  34. package/dist/esm/components/token-symbol/token-symbol.js +34 -38
  35. package/dist/esm/components/token-template/token-template.js +24 -16
  36. package/dist/esm/components/tooltip/simple-tooltip.js +12 -11
  37. package/dist/esm/components/with-title/with-title.js +27 -14
  38. package/dist/esm/index.js +594 -588
  39. package/dist/esm/locale/en.json.js +54 -0
  40. package/dist/esm/locale/index.js +4 -0
  41. package/dist/globals.css +1 -1
  42. package/dist/types/components/complex-input/complex-input.d.ts +10 -14
  43. package/dist/types/components/compound-apy/compound-apy.d.ts +1 -1
  44. package/dist/types/components/formatted-number/formatted-number.d.ts +14 -4
  45. package/dist/types/components/index.d.ts +1 -0
  46. package/dist/types/components/input/use-icon-slot-widths.d.ts +12 -0
  47. package/dist/types/components/status-elements/index.d.ts +1 -0
  48. package/dist/types/components/status-elements/status-elements.d.ts +16 -0
  49. package/dist/types/components/text-button/text-button.d.ts +1 -1
  50. package/dist/types/components/token-template/token-template.d.ts +7 -28
  51. package/dist/types/components/typed-intl/index.d.ts +1 -1
  52. package/dist/types/components/with-title/with-title.d.ts +6 -6
  53. package/dist/types/index.d.ts +5 -0
  54. package/dist/types/locale/en.json.d.ts +68 -0
  55. package/dist/types/locale/index.d.ts +10 -0
  56. package/package.json +3 -3
  57. package/src/styles/base.css +1 -1
@@ -1,85 +1,241 @@
1
- import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
- import { Input as T } from "../input/input.js";
1
+ import { jsxs as x, jsx as t } from "react/jsx-runtime";
2
+ import { Input as S } from "../input/input.js";
3
+ import { TextButton as y } from "../text-button/text-button.js";
3
4
  import { WithTitle as k } from "../with-title/with-title.js";
4
5
  import "react";
5
- import { bnToInputView as y } from "../../utils/bn-to-input-view.js";
6
+ import { bnToInputView as z } from "../../utils/bn-to-input-view.js";
6
7
  import "@gearbox-protocol/sdk";
7
- import { parseInputToBN as M } from "../../utils/parse-input-to-bn.js";
8
- import { cn as N } from "../../utils/cn.js";
8
+ import { parseInputToBN as V } from "../../utils/parse-input-to-bn.js";
9
+ import { cn as f } from "../../utils/cn.js";
9
10
  import "sonner";
10
- function P({
11
- title: i = "Max",
12
- maxAmount: r,
11
+ import "../accordion/accordion.js";
12
+ import "@gearbox-protocol/static";
13
+ import "@fortawesome/free-solid-svg-icons";
14
+ import "../icons/fa-icon.js";
15
+ import "../alert-badge/alert-badge.js";
16
+ import "../alert-dialog/alert-dialog.js";
17
+ import "../tooltip/simple-tooltip.js";
18
+ import "../tooltip/tooltip.js";
19
+ import "../asset-line/asset-line.js";
20
+ import "../buttons/back-button/back-button.js";
21
+ import "../buttons/button/button.js";
22
+ import "../buttons/copy-button/copy-button.js";
23
+ import "../buttons/external-button/external-button.js";
24
+ import "../buttons/filter-button/filter-button.js";
25
+ import "../buttons/navigation-button/navigation-button.js";
26
+ import "../buttons/tab-button/tab-button.js";
27
+ import "../token-icon/token-icon.js";
28
+ import "connectkit";
29
+ import "wagmi";
30
+ import "viem/siwe";
31
+ import "../avatar/avatar.js";
32
+ import "../badge/badge.js";
33
+ import "../base-link/base-link.js";
34
+ import "react-router-dom";
35
+ import "../card-grid/card-grid.js";
36
+ import "../cards/card/card.js";
37
+ import "../carousel/carousel.js";
38
+ import "../checkbox/checkbox.js";
39
+ import "../checkbox/checkbox-labeled.js";
40
+ import "../checkbox-item/checkbox-item.js";
41
+ import "../client-adapters/styled-button/styled-button.js";
42
+ import "../client-adapters/styled-dialog-container/styled-dialog-container.js";
43
+ import "../client-adapters/styled-rounded-image/styled-rounded-image.js";
44
+ import "../colored-text/colored-text.js";
45
+ import "../description/description.js";
46
+ import "react-intl";
47
+ import "../icon-button/icon-button.js";
48
+ import "../token-symbol/token-symbol.js";
49
+ import "../skeleton/skeleton.js";
50
+ import "../dropdown-menu/dropdown-menu.js";
51
+ import "../dropdown-menu/dropdown-menu-checkbox-item.js";
52
+ import "../dropdown-menu/dropdown-menu-content.js";
53
+ import "../dropdown-menu/dropdown-menu-item.js";
54
+ import "../dropdown-menu/dropdown-menu-label.js";
55
+ import "../dropdown-menu/dropdown-menu-radio-item.js";
56
+ import "../dropdown-menu/dropdown-menu-separator.js";
57
+ import "../dropdown-menu/dropdown-menu-shortcut.js";
58
+ import "../dropdown-menu/dropdown-menu-sub-content.js";
59
+ import "../dropdown-menu/dropdown-menu-sub-trigger.js";
60
+ import "../page-title/page-title.js";
61
+ import "../modal/modal.js";
62
+ import "@radix-ui/react-dialog";
63
+ import "../dialog/dialog-container.js";
64
+ import "../dialog/dialog-content.js";
65
+ import "../dialog/dialog-description.js";
66
+ import "../dialog/dialog-footer.js";
67
+ import "../dialog/dialog-header.js";
68
+ import "../dialog/dialog-title.js";
69
+ import "../dialog/dialog-modal-container.js";
70
+ import "../dialog/dialog-overlay.js";
71
+ import "viem";
72
+ import "../label/label.js";
73
+ import "../edit-input/edit-input.js";
74
+ import "../fadeout-loading/fadeout-loading.js";
75
+ import "../filter/filter-block.js";
76
+ import "../filter/filter-checkbox-item.js";
77
+ import "../filter/filter-chip.js";
78
+ import "../filter/filter-chips.js";
79
+ import "../filter/filter-dropdown-item.js";
80
+ import "../filter/filter-group.js";
81
+ import "../filter/filter-label.js";
82
+ import "../search-line/search-line.js";
83
+ import "../tabs/tabs.js";
84
+ import "../filter/filter-modal-item.js";
85
+ import "../filter/filter-radio-item.js";
86
+ import "../filter/filter-separator.js";
87
+ import "../filter/variants.js";
88
+ import "../graph/formatters.js";
89
+ import "lightweight-charts";
90
+ import "../graph/graph-view.js";
91
+ import "../help-tip/help-tip.js";
92
+ import "../horizontal-indicator/horizontal-indicator.js";
93
+ import "../layout/col/col.js";
94
+ import "../layout/container/container.js";
95
+ import "../layout/footer/footer.js";
96
+ import "../layout/grid/grid.js";
97
+ import "../layout/header/header.js";
98
+ import "../layout/layout/layout.js";
99
+ import "../../utils/reactochart-compat.js";
100
+ import { ShortString as j } from "../short-string/short-string.js";
101
+ import "react-markdown";
102
+ import "remark-gfm";
103
+ import "../navbar/navbar.js";
104
+ import "../navbar/navbar-indicator-context.js";
105
+ import "../navitem/navitem.js";
106
+ import "../points-icon/points-icon.js";
107
+ import "../progress/progress.js";
108
+ import "../radio-group/radio-group.js";
109
+ import "../rounded-image/rounded-image.js";
110
+ import "../search-bar/search-bar.js";
111
+ import "../segmented-control/segmented-control.js";
112
+ import "../select/select.js";
113
+ import "../separator/separator.js";
114
+ import "../slider/slider.js";
115
+ import "../smart-number-input/smart-number-input.js";
116
+ import "../spinner/spinner.js";
117
+ import "../stat-badge/stat-badge.js";
118
+ import "../status-dot/status-dot.js";
119
+ import "../stepper/stepper.js";
120
+ import "../switch/switch.js";
121
+ import "../table/grid-table.js";
122
+ import "../table/table.js";
123
+ import "../table/grid-table-loader.js";
124
+ import "../textarea/textarea.js";
125
+ import "../theme-provider.js";
126
+ import "../tip-card/tip-card.js";
127
+ import { TokenTemplate as M } from "../token-template/token-template.js";
128
+ import "../typography/typography.js";
129
+ import "../vertical-indicator/vertical-indicator.js";
130
+ import "../vertical-list/vertical-list.js";
131
+ import "../with-filter-button/with-filter-button.js";
132
+ const P = {
133
+ sm: "text-xs",
134
+ md: "text-sm"
135
+ };
136
+ function A({
137
+ title: e = "Balance",
138
+ maxAmount: n,
13
139
  token: s,
14
- disabled: a,
15
- maxButton: t = !0,
16
- onMaxButtonClick: l
140
+ disabled: l,
141
+ maxButton: a = !0,
142
+ onMaxButtonClick: r,
143
+ size: o = "sm"
17
144
  }) {
18
- const { decimals: c = 18 } = s || {}, m = y(r, c);
19
- return /* @__PURE__ */ p("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
20
- /* @__PURE__ */ p("span", { children: [
21
- "Balance: ",
22
- m
23
- ] }),
24
- t && /* @__PURE__ */ o(
145
+ const i = !l && a, m = /* @__PURE__ */ t(M, { value: n, token: s, showSymbol: !1 });
146
+ return /* @__PURE__ */ x("div", { className: "flex flex-nowrap items-center", children: [
147
+ /* @__PURE__ */ x(
148
+ "span",
149
+ {
150
+ className: f(
151
+ "leading-[130%] font-normal",
152
+ P[o],
153
+ "text-foreground"
154
+ ),
155
+ children: [
156
+ e,
157
+ ": ",
158
+ i && o === "sm" ? /* @__PURE__ */ t(y, { onClick: r, children: m }) : m
159
+ ]
160
+ }
161
+ ),
162
+ i && o !== "sm" && /* @__PURE__ */ t("div", { className: "ml-2", children: /* @__PURE__ */ t(
25
163
  "button",
26
164
  {
27
165
  type: "button",
28
- onClick: l,
29
- disabled: a,
30
- className: N(
31
- "px-1.5 py-0.5 text-xs font-medium rounded",
32
- "bg-secondary hover:bg-secondary/80 text-secondary-foreground",
33
- "disabled:opacity-50 disabled:cursor-not-allowed"
166
+ onClick: r,
167
+ className: f(
168
+ "py-[3px] px-1 text-[11px] leading-[13px] text-center uppercase",
169
+ "text-foreground bg-gray-70 hover:bg-gray-90 border-0 rounded-[6px]",
170
+ "transition-colors"
34
171
  ),
35
- children: i
172
+ children: "max"
36
173
  }
37
- )
174
+ ) })
38
175
  ] });
39
176
  }
40
- function G({
41
- titleProps: i,
42
- inputProps: r,
177
+ function pr({
178
+ titleProps: e,
179
+ inputProps: n,
43
180
  balanceIndicatorProps: s
44
181
  }) {
45
- const { title: a, size: t = "sm", ...l } = i, {
46
- size: c = "sm",
182
+ const {
183
+ title: l,
184
+ className: a,
185
+ size: r = "md",
186
+ ...o
187
+ } = e, {
188
+ size: i = "sm",
47
189
  title: m = "Max",
48
- maxButton: z = !0,
49
- token: f,
190
+ maxButton: T = !0,
191
+ token: c,
50
192
  maxAmount: u,
51
- ...B
52
- } = s, { decimals: x = 18 } = f || {}, { onChange: g, inputSize: e, ...C } = r, I = (n) => {
53
- const d = n.target.value, [h, b] = M(d, x);
54
- h === null || b === null || g?.(h, b);
55
- }, v = () => {
56
- const n = u || 0n, d = y(n, x);
57
- g?.(n, d);
58
- }, w = typeof e == "string" && (e === "sm" || e === "lg" || e === "default") ? e : t === "sm" ? "sm" : t === "lg" ? "lg" : "default";
59
- return /* @__PURE__ */ o(
193
+ ...v
194
+ } = s, { decimals: h = 18 } = c || {}, {
195
+ colorTheme: C = "filledLight",
196
+ onChange: g,
197
+ ...I
198
+ } = n, N = (p) => {
199
+ const d = p.target.value, [b, w] = V(d, h);
200
+ b === null || w === null || g?.(b, w);
201
+ }, B = () => {
202
+ const p = u || 0n, d = z(p, h);
203
+ g?.(p, d);
204
+ };
205
+ return /* @__PURE__ */ t(
60
206
  k,
61
207
  {
62
- size: t,
63
- title: /* @__PURE__ */ p("div", { className: "flex justify-between items-center", children: [
64
- a,
65
- u !== void 0 && /* @__PURE__ */ o(
66
- P,
208
+ className: f(a),
209
+ size: r,
210
+ title: /* @__PURE__ */ x("div", { className: "flex flex-nowrap justify-between items-center", children: [
211
+ l,
212
+ u !== void 0 && /* @__PURE__ */ t(
213
+ A,
67
214
  {
68
- token: f,
215
+ token: c,
69
216
  title: m,
70
- size: c,
71
- maxButton: z,
217
+ size: i,
218
+ maxButton: T,
72
219
  maxAmount: u,
73
- onMaxButtonClick: v,
74
- ...B
220
+ onMaxButtonClick: B,
221
+ ...v
75
222
  }
76
223
  )
77
224
  ] }),
78
- ...l,
79
- children: /* @__PURE__ */ o(T, { onChange: I, size: w, ...C })
225
+ ...o,
226
+ children: /* @__PURE__ */ t(
227
+ S,
228
+ {
229
+ colorTheme: C,
230
+ onChange: N,
231
+ endingIcon: /* @__PURE__ */ t(j, { maxLength: 15, children: c?.title }),
232
+ ...I
233
+ }
234
+ )
80
235
  }
81
236
  );
82
237
  }
83
238
  export {
84
- G as ComplexInput
239
+ A as BalanceIndicator,
240
+ pr as ComplexInput
85
241
  };
@@ -1,4 +1,5 @@
1
- import { ComplexInput as e } from "./complex-input.js";
1
+ import { BalanceIndicator as e, ComplexInput as n } from "./complex-input.js";
2
2
  export {
3
- e as ComplexInput
3
+ e as BalanceIndicator,
4
+ n as ComplexInput
4
5
  };
@@ -1,15 +1,48 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as i, Fragment as o } from "react/jsx-runtime";
2
+ import { SimpleTooltip as g } from "../tooltip/simple-tooltip.js";
3
+ import "../tooltip/tooltip.js";
2
4
  import "react";
3
5
  import "@gearbox-protocol/sdk";
4
- import { cn as i } from "../../utils/cn.js";
6
+ import { cn as u } from "../../utils/cn.js";
5
7
  import "sonner";
6
- function u({
7
- value: r,
8
- className: t,
9
- ...m
8
+ function S({
9
+ value: t,
10
+ decimalPartLength: r = 4,
11
+ hideZerosIfMore: p = 3,
12
+ className: m,
13
+ ...s
10
14
  }) {
11
- return /* @__PURE__ */ o("span", { className: i("tabular-nums", t), ...m, children: r });
15
+ const d = () => {
16
+ if (t === void 0 || typeof t == "string")
17
+ return t;
18
+ const e = t;
19
+ if ("originalValue" in e)
20
+ return e.originalValue;
21
+ const [a, c] = e.repeat > 0 && e.repeat > p ? ["0", e.repeat] : ["0".repeat(e.repeat), void 0], l = e.decimal && e.decimal.length > 0, h = /* @__PURE__ */ i("span", { children: [
22
+ e.integer,
23
+ l && /* @__PURE__ */ i(o, { children: [
24
+ ".",
25
+ a.repeat(c || 0),
26
+ e.decimal
27
+ ] })
28
+ ] }), f = /* @__PURE__ */ i("span", { children: [
29
+ e.integer,
30
+ l && /* @__PURE__ */ i(o, { children: [
31
+ ".",
32
+ /* @__PURE__ */ n(x, { zeroPart: a, repeats: c }),
33
+ (e.decimal?.slice(0, r) ?? "").replace(/0+$/, "")
34
+ ] })
35
+ ] });
36
+ return /* @__PURE__ */ n(g, { placement: "top", title: f, children: h });
37
+ };
38
+ return /* @__PURE__ */ n("span", { className: u("relative", m), ...s, children: d() });
39
+ }
40
+ function x({ zeroPart: t, repeats: r }) {
41
+ return /* @__PURE__ */ i(o, { children: [
42
+ t,
43
+ r !== void 0 && r > 0 && /* @__PURE__ */ n("span", { className: "relative -bottom-[3px] text-[calc(1em-2px)]", children: r })
44
+ ] });
12
45
  }
13
46
  export {
14
- u as FormattedNumberString
47
+ S as FormattedNumberString
15
48
  };