@gearbox-protocol/ui-kit 4.6.0 → 4.6.1
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 n=require("react/jsx-runtime"),b=require("@gearbox-protocol/static"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("@gearbox-protocol/static"),N=require("class-variance-authority"),g=require("../base-link/base-link.cjs"),h=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/onchain");require("../../utils/z-index.cjs");const k=N.cva("[&_.icon-wrap]:-mt-px [&_.icon-wrap]:pl-1.5 [&_.icon-wrap]:leading-none [&_.icon-wrap]:text-secondary-foreground hover:[&_.icon-wrap]:text-foreground",{variants:{variant:{default:"[&_.content-wrap]:border-b [&_.content-wrap]:border-transparent hover:[&_.content-wrap]:border-foreground",underlined:"[&_.content-wrap]:border-b [&_.content-wrap]:border-gray-110 hover:[&_.content-wrap]:border-foreground",unset:"[&_.content-wrap]:border-0"}},defaultVariants:{variant:"default"}});function p({className:d,children:e,href:u,target:m,variant:r="default",size:x="default",color:w="main",external:t=!1,asChild:f=!1,leadingIcon:c,...j}){const a=t?n.jsx("span",{className:"icon-wrap -mt-px pl-1.5 leading-none",children:n.jsx(b.IconExternal,{size:14})}):null,o=c?n.jsx("span",{className:"icon-wrap-start -mt-px pr-1.5 leading-none",children:c}):null,i=o?n.jsxs("span",{className:"inline-flex items-center",children:[o,n.jsx("span",{className:"content-wrap",children:e}),a]}):t&&typeof e=="string"?(()=>{const s=e.trimEnd().lastIndexOf(" "),l=s===-1?"":e.slice(0,s+1),_=s===-1?e:e.slice(s+1);return n.jsxs(n.Fragment,{children:[l?n.jsx("span",{className:"content-wrap",children:l}):null,n.jsxs("span",{className:"inline-flex items-center whitespace-nowrap",children:[n.jsx("span",{className:"pb-px",children:n.jsx("span",{className:"content-wrap",children:_})}),a]})]})})():a?n.jsxs("span",{className:"inline-flex items-center",children:[n.jsx("span",{className:"content-wrap",children:e}),a]}):n.jsx("span",{className:"content-wrap",children:e});return n.jsx(g.BaseLink,{href:u,target:m,external:t,variant:r==="underlined"?"default":r,size:x,color:w,className:h.cn(k({variant:r}),d),...j,children:f?n.jsx("span",{children:i}):i})}p.displayName="Link";exports.Link=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as t, jsx as n, Fragment as
|
|
2
|
-
import { IconExternal as
|
|
1
|
+
import { jsxs as t, jsx as n, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { IconExternal as g } from "@gearbox-protocol/static";
|
|
3
3
|
import { cva as h } from "class-variance-authority";
|
|
4
4
|
import { BaseLink as v } from "../base-link/base-link.js";
|
|
5
5
|
import { cn as k } from "../../utils/cn.js";
|
|
@@ -27,15 +27,15 @@ function L({
|
|
|
27
27
|
children: e,
|
|
28
28
|
href: d,
|
|
29
29
|
target: f,
|
|
30
|
-
variant:
|
|
30
|
+
variant: s = "default",
|
|
31
31
|
size: w = "default",
|
|
32
32
|
color: u = "main",
|
|
33
|
-
external:
|
|
33
|
+
external: o = !1,
|
|
34
34
|
asChild: N = !1,
|
|
35
35
|
leadingIcon: c,
|
|
36
|
-
...
|
|
36
|
+
...x
|
|
37
37
|
}) {
|
|
38
|
-
const a =
|
|
38
|
+
const a = o ? /* @__PURE__ */ n("span", { className: "icon-wrap -mt-px pl-1.5 leading-none", children: /* @__PURE__ */ n(g, { size: 14 }) }) : null, p = c ? /* @__PURE__ */ n("span", { className: "icon-wrap-start -mt-px pr-1.5 leading-none", children: c }) : null, i = p ? (
|
|
39
39
|
// A leading icon takes the flex row unconditionally: the string arm below
|
|
40
40
|
// exists only to glue the trailing icon to the last word, and it has no
|
|
41
41
|
// say over what sits before the first one.
|
|
@@ -44,12 +44,12 @@ function L({
|
|
|
44
44
|
/* @__PURE__ */ n("span", { className: "content-wrap", children: e }),
|
|
45
45
|
a
|
|
46
46
|
] })
|
|
47
|
-
) :
|
|
48
|
-
const r = e.trimEnd().lastIndexOf(" "), l = r === -1 ? "" : e.slice(0, r + 1),
|
|
49
|
-
return /* @__PURE__ */ t(
|
|
47
|
+
) : o && typeof e == "string" ? (() => {
|
|
48
|
+
const r = e.trimEnd().lastIndexOf(" "), l = r === -1 ? "" : e.slice(0, r + 1), _ = r === -1 ? e : e.slice(r + 1);
|
|
49
|
+
return /* @__PURE__ */ t(b, { children: [
|
|
50
50
|
l ? /* @__PURE__ */ n("span", { className: "content-wrap", children: l }) : null,
|
|
51
51
|
/* @__PURE__ */ t("span", { className: "inline-flex items-center whitespace-nowrap", children: [
|
|
52
|
-
/* @__PURE__ */ n("span", { className: "content-wrap", children:
|
|
52
|
+
/* @__PURE__ */ n("span", { className: "pb-px", children: /* @__PURE__ */ n("span", { className: "content-wrap", children: _ }) }),
|
|
53
53
|
a
|
|
54
54
|
] })
|
|
55
55
|
] });
|
|
@@ -72,12 +72,12 @@ function L({
|
|
|
72
72
|
{
|
|
73
73
|
href: d,
|
|
74
74
|
target: f,
|
|
75
|
-
external:
|
|
76
|
-
variant:
|
|
75
|
+
external: o,
|
|
76
|
+
variant: s === "underlined" ? "default" : s,
|
|
77
77
|
size: w,
|
|
78
78
|
color: u,
|
|
79
|
-
className: k(y({ variant:
|
|
80
|
-
...
|
|
79
|
+
className: k(y({ variant: s }), m),
|
|
80
|
+
...x,
|
|
81
81
|
children: N ? /* @__PURE__ */ n("span", { children: i }) : i
|
|
82
82
|
}
|
|
83
83
|
);
|