@gearbox-protocol/permissionless-ui 1.22.0-next.40 → 1.22.0-next.41

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 (37) 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/fadeout-loading/fadeout-loading.cjs +1 -1
  6. package/dist/cjs/components/health-factor/health-factor.cjs +1 -1
  7. package/dist/cjs/components/help-tip/help-tip.cjs +1 -1
  8. package/dist/cjs/components/index.cjs +1 -1
  9. package/dist/cjs/components/liquidation-price/index.cjs +1 -0
  10. package/dist/cjs/components/liquidation-price/liquidation-price.cjs +1 -0
  11. package/dist/cjs/components/status-elements/status-elements.cjs +1 -1
  12. package/dist/cjs/components/vertical-indicator/vertical-indicator.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/esm/components/block-sync/block-sync.js +4 -2
  15. package/dist/esm/components/checkbox/checkbox-labeled.js +2 -0
  16. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -0
  17. package/dist/esm/components/complex-input/complex-input.js +4 -2
  18. package/dist/esm/components/fadeout-loading/fadeout-loading.js +12 -12
  19. package/dist/esm/components/health-factor/health-factor.js +53 -42
  20. package/dist/esm/components/help-tip/help-tip.js +113 -64
  21. package/dist/esm/components/index.js +241 -239
  22. package/dist/esm/components/liquidation-price/index.js +4 -0
  23. package/dist/esm/components/liquidation-price/liquidation-price.js +43 -0
  24. package/dist/esm/components/status-elements/status-elements.js +46 -28
  25. package/dist/esm/components/vertical-indicator/vertical-indicator.js +90 -90
  26. package/dist/esm/index.js +398 -396
  27. package/dist/globals.css +1 -1
  28. package/dist/types/components/fadeout-loading/fadeout-loading.d.ts +5 -13
  29. package/dist/types/components/health-factor/health-factor.d.ts +16 -35
  30. package/dist/types/components/help-tip/help-tip.d.ts +33 -44
  31. package/dist/types/components/index.d.ts +1 -0
  32. package/dist/types/components/liquidation-price/index.d.ts +1 -0
  33. package/dist/types/components/liquidation-price/liquidation-price.d.ts +41 -0
  34. package/dist/types/components/status-elements/status-elements.d.ts +11 -1
  35. package/dist/types/components/vertical-indicator/vertical-indicator.d.ts +24 -51
  36. package/dist/types/index.d.ts +1 -0
  37. package/package.json +1 -1
@@ -1,48 +1,66 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
+ import { cva as u } from "class-variance-authority";
2
3
  import "react";
3
4
  import "@gearbox-protocol/sdk";
4
5
  import { cn as o } from "../../utils/cn.js";
5
6
  import "sonner";
6
- const s = {
7
+ const d = {
7
8
  good: "bg-success",
8
9
  medium: "bg-warning",
9
10
  bad: "bg-destructive",
10
11
  critical: "bg-destructive",
11
12
  liquidation: "bg-liquidation"
12
- }, l = {
13
- good: 3,
14
- medium: 2,
15
- bad: 1,
16
- critical: 1,
17
- liquidation: 1
18
- }, u = 3;
19
- function b({ zone: t, size: i = 8 }) {
13
+ };
14
+ function O({ zone: i, size: t = 8 }) {
20
15
  return /* @__PURE__ */ a(
21
16
  "div",
22
17
  {
23
- className: o("rounded-full shrink-0", s[t]),
24
- style: { width: i, height: i },
18
+ className: o("rounded-full shrink-0", d[i]),
19
+ style: { width: t, height: t },
25
20
  "aria-hidden": !0
26
21
  }
27
22
  );
28
23
  }
29
- function v({ zone: t }) {
30
- const i = l[t], n = s[t], c = ["first", "second", "third"], d = Array.from({ length: u }, (e, r) => ({
31
- key: c[r],
32
- isActive: r < i
33
- })).reverse();
34
- return /* @__PURE__ */ a("div", { className: "flex w-2 flex-wrap gap-0.5", "aria-hidden": !0, children: d.map(({ key: e, isActive: r }) => /* @__PURE__ */ a(
35
- "div",
36
- {
37
- className: o(
38
- "h-[3px] w-full min-w-[3px] flex-1 rounded-[1.5px]",
39
- r ? n : "bg-gray-50"
40
- )
41
- },
42
- e
43
- )) });
24
+ const l = {
25
+ good: 3,
26
+ medium: 2,
27
+ bad: 1,
28
+ critical: 1,
29
+ liquidation: 1
30
+ }, g = 3, m = {
31
+ good: "success",
32
+ medium: "warning",
33
+ bad: "destructive",
34
+ critical: "destructive",
35
+ liquidation: "liquidation"
36
+ }, b = u(
37
+ [
38
+ "h-[3px] rounded-[1.5px]",
39
+ "w-full max-w-full grow-0 shrink-0 basis-full"
40
+ ].join(" "),
41
+ {
42
+ variants: {
43
+ color: {
44
+ success: "bg-success",
45
+ warning: "bg-warning",
46
+ destructive: "bg-destructive",
47
+ liquidation: "bg-liquidation",
48
+ "gray-50": "bg-gray-50"
49
+ }
50
+ }
51
+ }
52
+ );
53
+ function B({ zone: i }) {
54
+ const t = l[i], e = m[i], n = Array.from({ length: g }, (s, r) => {
55
+ const c = r < t;
56
+ return {
57
+ key: r,
58
+ color: c ? e : "gray-50"
59
+ };
60
+ }).reverse();
61
+ return /* @__PURE__ */ a("div", { className: o("flex flex-wrap gap-0.5 w-2"), "aria-hidden": !0, children: n.map(({ key: s, color: r }) => /* @__PURE__ */ a("div", { className: b({ color: r }) }, s)) });
44
62
  }
45
63
  export {
46
- b as HealthDot,
47
- v as StatusBars
64
+ O as HealthDot,
65
+ B as StatusBars
48
66
  };
@@ -1,55 +1,60 @@
1
- import { jsxs as e, jsx as t, Fragment as v } from "react/jsx-runtime";
2
- import { cva as m } from "class-variance-authority";
3
- import * as w from "react";
4
- import { faArrowRight as V } from "@fortawesome/free-solid-svg-icons";
5
- import { FaIcon as y } from "../icons/fa-icon.js";
1
+ import { jsxs as t, jsx as e, Fragment as b } from "react/jsx-runtime";
2
+ import { cva as l } from "class-variance-authority";
3
+ import * as V from "react";
6
4
  import "@gearbox-protocol/sdk";
7
- import { cn as r } from "../../utils/cn.js";
5
+ import { cn as a } from "../../utils/cn.js";
8
6
  import "sonner";
9
- import { HelpTip as I } from "../help-tip/help-tip.js";
10
- const j = m("flex flex-nowrap gap-3 items-center", {
11
- variants: {
12
- align: {
13
- start: "items-start",
14
- center: "items-center",
15
- end: "items-end"
16
- }
17
- },
18
- defaultVariants: {
19
- align: "start"
7
+ import { Description as f } from "../description/description.js";
8
+ import { HelpTip as v } from "../help-tip/help-tip.js";
9
+ const y = l(
10
+ ["flex flex-nowrap", "w-full max-w-full grow-0 shrink-0 basis-full"].join(
11
+ " "
12
+ ),
13
+ {
14
+ variants: {
15
+ align: {
16
+ start: "items-start",
17
+ center: "items-center",
18
+ end: "items-end",
19
+ baseline: "items-baseline"
20
+ }
21
+ },
22
+ defaultVariants: { align: "start" }
20
23
  }
21
- }), z = m("text-foreground", {
22
- variants: {
23
- size: {
24
- xs: "text-xs",
25
- sm: "text-sm",
26
- default: "text-base",
27
- unset: ""
28
- }
29
- },
30
- defaultVariants: {
31
- size: "default"
24
+ ), k = l(
25
+ "flex items-center grow shrink-0 basis-[0%] text-left text-foreground",
26
+ {
27
+ variants: {
28
+ size: {
29
+ xs: "text-xs leading-[14px]",
30
+ sm: "text-sm leading-[17px]",
31
+ default: "text-base leading-[19px]",
32
+ unset: "text-[length:unset] leading-[unset]"
33
+ }
34
+ },
35
+ defaultVariants: { size: "default" }
32
36
  }
33
- }), x = m("text-right", {
37
+ ), u = l("text-right font-medium", {
34
38
  variants: {
35
39
  size: {
36
- xs: "text-xs",
37
- sm: "text-sm",
38
- default: "text-base",
39
- unset: ""
40
+ xs: "text-xs leading-[14px]",
41
+ sm: "text-sm leading-[17px]",
42
+ default: "text-base leading-[19px]",
43
+ unset: "text-[length:unset] leading-[unset]"
40
44
  },
41
45
  weight: {
42
46
  normal: "font-normal",
43
47
  medium: "font-medium",
44
- unset: ""
48
+ unset: "[font-weight:unset]"
45
49
  },
46
50
  color: {
47
51
  default: "text-foreground",
48
- muted: "text-muted-foreground",
49
- success: "text-green-500",
50
- warning: "text-yellow-500",
52
+ muted: "text-gray-70",
53
+ success: "text-success",
54
+ warning: "text-warning",
51
55
  alert: "text-destructive",
52
- primary: "text-primary"
56
+ primary: "text-primary",
57
+ secondary: "text-secondary-foreground"
53
58
  }
54
59
  },
55
60
  defaultVariants: {
@@ -57,75 +62,70 @@ const j = m("flex flex-nowrap gap-3 items-center", {
57
62
  weight: "medium",
58
63
  color: "default"
59
64
  }
60
- }), R = w.forwardRef(
65
+ }), j = V.forwardRef(
61
66
  ({
62
- className: u,
63
- align: p,
64
- label: a,
65
- description: s,
66
- valueDescription: l,
67
- tip: o,
68
- value: d,
69
- valueTo: i,
70
- size: n = "default",
67
+ className: g,
68
+ align: h,
69
+ label: s,
70
+ description: n,
71
+ valueDescription: m,
72
+ tip: d,
73
+ value: o,
74
+ valueTo: r,
75
+ size: i = "sm",
71
76
  weight: c = "medium",
72
- color: f = "default",
73
- onPointerEnterTip: g,
74
- ...h
75
- }, N) => /* @__PURE__ */ e(
77
+ color: x = "default",
78
+ onPointerEnterTip: p,
79
+ ...w
80
+ }, N) => /* @__PURE__ */ t(
76
81
  "div",
77
82
  {
78
83
  ref: N,
79
- className: r(j({ align: p }), u),
80
- ...h,
84
+ className: a(y({ align: h }), g),
85
+ ...w,
81
86
  children: [
82
- (a || s) && /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 h-min", children: [
83
- a && /* @__PURE__ */ e(
87
+ (s || n) && /* @__PURE__ */ t("div", { className: "grow shrink-0 basis-[0%] h-min flex flex-col", children: [
88
+ s && /* @__PURE__ */ t("div", { className: a(k({ size: i })), children: [
89
+ s,
90
+ d && /* @__PURE__ */ e("span", { className: "ml-2 inline-block leading-none", children: /* @__PURE__ */ e(v, { onPointerEnter: p, children: d }) })
91
+ ] }),
92
+ n && /* @__PURE__ */ e(f, { className: "text-left", children: n })
93
+ ] }),
94
+ o && /* @__PURE__ */ t("div", { className: "w-auto grow-0 shrink-0 basis-auto flex flex-col", children: [
95
+ /* @__PURE__ */ t(
84
96
  "div",
85
97
  {
86
- className: r(
87
- "flex items-center gap-2 whitespace-nowrap",
88
- z({ size: n })
98
+ className: a(
99
+ "flex flex-nowrap",
100
+ "w-full max-w-full grow-0 shrink-0 basis-full",
101
+ "justify-end items-center"
89
102
  ),
90
103
  children: [
91
- a,
92
- o && /* @__PURE__ */ t(I, { onPointerEnter: g, children: o })
104
+ /* @__PURE__ */ e(
105
+ "span",
106
+ {
107
+ className: a(
108
+ u({ size: i, weight: c, color: x }),
109
+ r && "line-through [&>*]:line-through"
110
+ ),
111
+ children: o
112
+ }
113
+ ),
114
+ r && /* @__PURE__ */ t(b, { children: [
115
+ /* @__PURE__ */ e("span", { className: "px-1.5 text-gray-70", children: "→" }),
116
+ /* @__PURE__ */ e("span", { className: a(u({ size: i, weight: c, color: x })), children: r })
117
+ ] })
93
118
  ]
94
119
  }
95
120
  ),
96
- s && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground text-left", children: s })
97
- ] }),
98
- d && /* @__PURE__ */ e("div", { className: "flex flex-col flex-auto", children: [
99
- /* @__PURE__ */ e("div", { className: "flex flex-nowrap gap-3 justify-end items-center", children: [
100
- /* @__PURE__ */ t(
101
- "span",
102
- {
103
- className: r(
104
- x({ size: n, weight: c, color: f }),
105
- i && "line-through opacity-60"
106
- ),
107
- children: d
108
- }
109
- ),
110
- i && /* @__PURE__ */ e(v, { children: [
111
- /* @__PURE__ */ t(
112
- y,
113
- {
114
- icon: V,
115
- className: "size-3 text-muted-foreground"
116
- }
117
- ),
118
- /* @__PURE__ */ t("span", { className: r(x({ size: n, weight: c, color: f })), children: i })
119
- ] })
120
- ] }),
121
- l && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground text-right", children: l })
121
+ m && /* @__PURE__ */ e(f, { className: "text-right", children: m })
122
122
  ] })
123
123
  ]
124
124
  }
125
125
  )
126
126
  );
127
- R.displayName = "VerticalIndicator";
127
+ j.displayName = "VerticalIndicator";
128
128
  export {
129
- R as VerticalIndicator,
130
- j as verticalIndicatorVariants
129
+ j as VerticalIndicator,
130
+ y as verticalIndicatorVariants
131
131
  };