@gearbox-protocol/ui-kit 4.6.1 → 4.7.0
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.
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/review-button/constants.cjs +1 -1
- package/dist/cjs/components/base/review-button/index.cjs +1 -1
- package/dist/cjs/components/base/review-button/review-button.cjs +1 -1
- package/dist/cjs/components/base/review-button/review-solution.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/base/index.js +94 -92
- package/dist/esm/components/base/review-button/constants.js +2 -1
- package/dist/esm/components/base/review-button/index.js +6 -4
- package/dist/esm/components/base/review-button/review-button.js +31 -35
- package/dist/esm/components/base/review-button/review-solution.js +56 -0
- package/dist/esm/components/index.js +366 -364
- package/dist/esm/index.js +443 -441
- package/dist/types/components/base/review-button/constants.d.ts +1 -0
- package/dist/types/components/base/review-button/index.d.ts +1 -0
- package/dist/types/components/base/review-button/review-button.d.ts +1 -4
- package/dist/types/components/base/review-button/review-solution.d.ts +35 -0
- package/package.json +1 -1
|
@@ -1,52 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { TipCard as
|
|
1
|
+
import { jsxs as o, jsx as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as d } from "../stack/stack.js";
|
|
3
|
+
import { Button as f } from "../../buttons/button/button.js";
|
|
4
|
+
import { TipCard as g } from "../../tip-card/tip-card.js";
|
|
5
5
|
import { FormattedMessageTyped as e } from "../../typed-intl/index.js";
|
|
6
|
-
import { ReviewButtonTest as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { ReviewButtonTest as a } from "./constants.js";
|
|
7
|
+
import { ReviewSolution as n } from "./review-solution.js";
|
|
8
|
+
function C({
|
|
9
|
+
disabled: l,
|
|
10
|
+
error: m,
|
|
11
|
+
tip: r,
|
|
11
12
|
solution: i,
|
|
12
|
-
onClick:
|
|
13
|
-
label:
|
|
13
|
+
onClick: s,
|
|
14
|
+
label: p = "dialogs.common.review"
|
|
14
15
|
}) {
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return /* @__PURE__ */ o(d, { gap: "sm", children: [
|
|
17
|
+
r ? /* @__PURE__ */ t(
|
|
18
|
+
g,
|
|
18
19
|
{
|
|
19
20
|
textColor: "light",
|
|
20
21
|
attributeColor: "alert",
|
|
21
22
|
className: "w-full",
|
|
22
|
-
"data-testid":
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */ t(e, { ...
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"data-testid": r.solution,
|
|
32
|
-
children: /* @__PURE__ */ t(e, { ...i.label })
|
|
33
|
-
}
|
|
34
|
-
) : null
|
|
35
|
-
] })
|
|
23
|
+
"data-testid": a.tip,
|
|
24
|
+
children: /* @__PURE__ */ t(d, { gap: "sm", align: "start", children: i?.kind === "link" ? /* @__PURE__ */ o("div", { children: [
|
|
25
|
+
/* @__PURE__ */ t(e, { ...r }),
|
|
26
|
+
" ",
|
|
27
|
+
/* @__PURE__ */ t(n, { solution: i })
|
|
28
|
+
] }) : /* @__PURE__ */ o(c, { children: [
|
|
29
|
+
/* @__PURE__ */ t(e, { ...r }),
|
|
30
|
+
/* @__PURE__ */ t(n, { solution: i })
|
|
31
|
+
] }) })
|
|
36
32
|
}
|
|
37
33
|
) : null,
|
|
38
34
|
/* @__PURE__ */ t(
|
|
39
|
-
|
|
35
|
+
f,
|
|
40
36
|
{
|
|
41
|
-
disabled:
|
|
42
|
-
onClick:
|
|
43
|
-
"data-testid":
|
|
44
|
-
children:
|
|
37
|
+
disabled: l,
|
|
38
|
+
onClick: s,
|
|
39
|
+
"data-testid": a.root,
|
|
40
|
+
children: m ? /* @__PURE__ */ t("span", { "data-testid": a.error, children: /* @__PURE__ */ t(e, { messageId: m }) }) : /* @__PURE__ */ t(e, { messageId: p })
|
|
45
41
|
}
|
|
46
42
|
)
|
|
47
43
|
] });
|
|
48
44
|
}
|
|
49
45
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
C as ReviewButton,
|
|
47
|
+
a as ReviewButtonTest
|
|
52
48
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Button as s } from "../../buttons/button/button.js";
|
|
3
|
+
import { Link as c } from "../../link/link.js";
|
|
4
|
+
import { FormattedMessageTyped as n } from "../../typed-intl/index.js";
|
|
5
|
+
import { ReviewButtonTest as a } from "./constants.js";
|
|
6
|
+
function b({
|
|
7
|
+
solution: e,
|
|
8
|
+
testId: l = a.solution
|
|
9
|
+
}) {
|
|
10
|
+
switch (e?.kind) {
|
|
11
|
+
case "button":
|
|
12
|
+
return /* @__PURE__ */ r(
|
|
13
|
+
s,
|
|
14
|
+
{
|
|
15
|
+
type: "button",
|
|
16
|
+
variant: "outline",
|
|
17
|
+
size: "sm",
|
|
18
|
+
"data-testid": l,
|
|
19
|
+
onClick: e.onClick,
|
|
20
|
+
children: /* @__PURE__ */ r(n, { ...e.label })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
case "link": {
|
|
24
|
+
const i = e.links.map((t) => /* @__PURE__ */ r(
|
|
25
|
+
c,
|
|
26
|
+
{
|
|
27
|
+
href: t.href,
|
|
28
|
+
variant: "underlined",
|
|
29
|
+
size: "unset",
|
|
30
|
+
color: "secondary",
|
|
31
|
+
"data-testid": a.solutionLink,
|
|
32
|
+
onClick: t.onClick,
|
|
33
|
+
children: /* @__PURE__ */ r(n, { ...t.label })
|
|
34
|
+
},
|
|
35
|
+
t.href
|
|
36
|
+
));
|
|
37
|
+
return /* @__PURE__ */ r("span", { children: e.label ? /* @__PURE__ */ r(
|
|
38
|
+
n,
|
|
39
|
+
{
|
|
40
|
+
...e.label,
|
|
41
|
+
values: {
|
|
42
|
+
...e.label.values,
|
|
43
|
+
...Object.fromEntries(
|
|
44
|
+
i.map((t, o) => [`link${o}`, t])
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
) : i });
|
|
49
|
+
}
|
|
50
|
+
case void 0:
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
b as ReviewSolution
|
|
56
|
+
};
|