@gearbox-protocol/permissionless-ui 1.22.0-next.13 → 1.22.0-next.15

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 (30) hide show
  1. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  2. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  3. package/dist/cjs/components/short-string/short-string.cjs +1 -1
  4. package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
  5. package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
  6. package/dist/cjs/index.cjs +1 -1
  7. package/dist/cjs/utils/index.cjs +1 -1
  8. package/dist/cjs/utils/network-icons.cjs +1 -1
  9. package/dist/cjs/utils/shorten-string.cjs +1 -1
  10. package/dist/cjs/utils/z-index.cjs +1 -0
  11. package/dist/esm/components/buttons/button/button.js +2 -0
  12. package/dist/esm/components/checkbox/checkbox-labeled.js +1 -0
  13. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +1 -0
  14. package/dist/esm/components/short-string/short-string.js +19 -23
  15. package/dist/esm/components/token-icon/token-icon.js +23 -22
  16. package/dist/esm/components/token-symbol/token-symbol.js +98 -40
  17. package/dist/esm/index.js +208 -208
  18. package/dist/esm/utils/index.js +68 -68
  19. package/dist/esm/utils/network-icons.js +4 -53
  20. package/dist/esm/utils/shorten-string.js +7 -3
  21. package/dist/esm/utils/z-index.js +7 -0
  22. package/dist/globals.css +1 -1
  23. package/dist/types/components/short-string/short-string.d.ts +4 -4
  24. package/dist/types/components/token-icon/token-icon.d.ts +1 -1
  25. package/dist/types/components/token-symbol/token-symbol.d.ts +9 -4
  26. package/dist/types/utils/index.d.ts +1 -0
  27. package/dist/types/utils/network-icons.d.ts +3 -32
  28. package/dist/types/utils/shorten-string.d.ts +2 -1
  29. package/dist/types/utils/z-index.d.ts +8 -0
  30. package/package.json +1 -1
@@ -1,50 +1,108 @@
1
- import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import { TokenIcon as d } from "../token-icon/token-icon.js";
3
- import "react";
4
- import { cn as u } from "../../utils/cn.js";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { cva as T } from "class-variance-authority";
3
+ import N from "react";
4
+ import { RoundedImage as y } from "../rounded-image/rounded-image.js";
5
+ import { ShortString as x } from "../short-string/short-string.js";
6
+ import { TokenIcon as s } from "../token-icon/token-icon.js";
7
+ import { TooltipProvider as I, Tooltip as S, TooltipTrigger as b, TooltipContent as _ } from "../tooltip/tooltip.js";
8
+ import { cn as O } from "../../utils/cn.js";
5
9
  import "sonner";
6
10
  import "@gearbox-protocol/sdk";
7
- function p(e) {
8
- if (e)
9
- return typeof e == "string" ? e : e.symbol;
11
+ import { getNetworkIcon as R } from "../../utils/network-icons.js";
12
+ import { Z_INDEX as j } from "../../utils/z-index.js";
13
+ const z = T("", {
14
+ variants: {
15
+ marginSize: {
16
+ sm: "gap-1",
17
+ md: "gap-2",
18
+ lg: "gap-3"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ marginSize: "md"
23
+ }
24
+ });
25
+ function C(r) {
26
+ if (r)
27
+ return typeof r == "string" ? r : r.icon ? { icon: r.icon } : r.symbol;
10
28
  }
11
- function g(e) {
12
- if (e)
13
- return typeof e == "string" ? e : e.title;
29
+ function D(r) {
30
+ if (r)
31
+ return typeof r == "string" ? r : r.title;
14
32
  }
15
- function I({
16
- token: e,
17
- title: m,
18
- className: o,
19
- comment: r,
20
- showIcon: l = !0,
21
- showSymbol: c = !1,
22
- size: a = 24,
23
- chainId: x,
24
- network: h,
25
- maxLength: v,
26
- ...f
27
- }) {
28
- const i = p(e), n = m || g(e);
29
- return /* @__PURE__ */ t("div", { className: u("flex items-center gap-3", o), ...f, children: [
30
- l && i && /* @__PURE__ */ s(
31
- d,
33
+ const P = N.forwardRef(
34
+ ({
35
+ className: r,
36
+ marginSize: d = "lg",
37
+ token: n,
38
+ title: l,
39
+ size: a = 24,
40
+ showSymbol: f = !1,
41
+ showIcon: p = !0,
42
+ maxLength: g,
43
+ chainId: V,
44
+ comment: m,
45
+ network: t,
46
+ ...u
47
+ }, h) => {
48
+ const o = C(n), v = l || D(n), c = () => t ? /* @__PURE__ */ i("div", { className: "relative", children: [
49
+ /* @__PURE__ */ e(
50
+ s,
51
+ {
52
+ symbol: o,
53
+ size: a,
54
+ className: "shrink-0 self-center"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ e("div", { className: "absolute -top-[10px] -right-[7px]", children: /* @__PURE__ */ e(
58
+ y,
59
+ {
60
+ src: R(t),
61
+ alt: t,
62
+ size: 14,
63
+ rounded: !0
64
+ }
65
+ ) })
66
+ ] }) : /* @__PURE__ */ e(
67
+ s,
32
68
  {
33
- symbol: i,
69
+ symbol: o,
34
70
  size: a,
35
71
  className: "shrink-0 self-center"
36
72
  }
37
- ),
38
- c && n && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 self-center", children: [
39
- /* @__PURE__ */ s("div", { className: "text-xs sm:text-sm md:text-base font-medium truncate whitespace-pre-wrap leading-tight", children: n }),
40
- r && /* @__PURE__ */ t("div", { className: "text-md text-muted-foreground leading-tight", children: [
41
- "(",
42
- r,
43
- ")"
44
- ] })
45
- ] })
46
- ] });
47
- }
73
+ );
74
+ return /* @__PURE__ */ i(
75
+ "div",
76
+ {
77
+ ref: h,
78
+ className: O(
79
+ "flex items-center",
80
+ z({ marginSize: d }),
81
+ r
82
+ ),
83
+ ...u,
84
+ children: [
85
+ p && o && (t !== void 0 ? /* @__PURE__ */ e(I, { delayDuration: 200, children: /* @__PURE__ */ i(S, { children: [
86
+ /* @__PURE__ */ e(b, { asChild: !0, children: c() }),
87
+ /* @__PURE__ */ e(_, { className: j.TOOLTIP, children: /* @__PURE__ */ i("p", { children: [
88
+ "Network: ",
89
+ t
90
+ ] }) })
91
+ ] }) }) : c()),
92
+ (l || f) && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 self-center", children: [
93
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(x, { maxLength: g, children: v }) }),
94
+ m && /* @__PURE__ */ i("div", { className: "text-md text-muted-foreground leading-tight", children: [
95
+ "(",
96
+ m,
97
+ ")"
98
+ ] })
99
+ ] })
100
+ ]
101
+ }
102
+ );
103
+ }
104
+ );
105
+ P.displayName = "TokenSymbol";
48
106
  export {
49
- I as TokenSymbol
107
+ P as TokenSymbol
50
108
  };