@gearbox-protocol/permissionless-ui 1.22.0-next.16 → 1.22.0-next.18
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/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/index.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-dialog-container/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-dialog-container/styled-dialog-container.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-container.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-modal-container.cjs +1 -1
- package/dist/cjs/components/dialog/index.cjs +1 -1
- package/dist/cjs/components/filter/filter-modal.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/vertical-list/vertical-list.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/z-index.cjs +1 -1
- package/dist/esm/components/checkbox/checkbox-labeled.js +2 -1
- package/dist/esm/components/client-adapters/index.js +4 -2
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +22 -12
- package/dist/esm/components/client-adapters/styled-dialog-container/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-dialog-container/styled-dialog-container.js +39 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -1
- package/dist/esm/components/dialog/dialog-container.js +55 -21
- package/dist/esm/components/dialog/dialog-modal-container.js +38 -17
- package/dist/esm/components/dialog/index.js +18 -18
- package/dist/esm/components/filter/filter-modal.js +1 -1
- package/dist/esm/components/index.js +458 -456
- package/dist/esm/components/modal/index.js +4 -0
- package/dist/esm/components/modal/modal.js +108 -0
- package/dist/esm/components/vertical-list/vertical-list.js +27 -27
- package/dist/esm/index.js +596 -594
- package/dist/esm/utils/z-index.js +1 -1
- package/dist/globals.css +1 -1
- package/dist/types/components/client-adapters/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-dialog-container/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-dialog-container/styled-dialog-container.d.ts +13 -0
- package/dist/types/components/dialog/dialog-container.d.ts +8 -3
- package/dist/types/components/dialog/dialog-modal-container.d.ts +9 -3
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/modal/index.d.ts +1 -0
- package/dist/types/components/modal/modal.d.ts +33 -0
- package/dist/types/components/skeleton/skeleton.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/z-index.d.ts +1 -1
- package/package.json +1 -1
- package/src/styles/base.css +9 -2
- package/src/styles/theme.css +19 -0
- package/dist/cjs/components/dialog/dialog-modal.cjs +0 -1
- package/dist/esm/components/dialog/dialog-modal.js +0 -70
- package/dist/types/components/dialog/dialog-modal.d.ts +0 -30
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-dialog";
|
|
3
|
+
import { cva as C } from "class-variance-authority";
|
|
4
|
+
import * as i from "react";
|
|
5
|
+
import { cn as o } from "../../utils/cn.js";
|
|
6
|
+
import "sonner";
|
|
7
|
+
import "@gearbox-protocol/sdk";
|
|
8
|
+
import { Z_INDEX as c } from "../../utils/z-index.js";
|
|
9
|
+
const f = "gb-modal-open";
|
|
10
|
+
let n = 0;
|
|
11
|
+
const m = "before:content-[''] before:absolute before:inset-0 after:z-[-1] before:opacity-40", v = C("", {
|
|
12
|
+
variants: {
|
|
13
|
+
colorTheme: {
|
|
14
|
+
default: "bg-black/30",
|
|
15
|
+
dark: "bg-black",
|
|
16
|
+
"dark-transparent": "bg-black/85"
|
|
17
|
+
},
|
|
18
|
+
backdrop: {
|
|
19
|
+
success: `${m} before:bg-[linear-gradient(180deg,rgba(146,255,176,0.85)_0%,rgba(146,255,176,0)_50%)]`,
|
|
20
|
+
failure: `${m} before:bg-[linear-gradient(180deg,rgba(255,61,64,0.85)_0%,rgba(255,61,64,0)_50%)]`,
|
|
21
|
+
default: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
colorTheme: "default",
|
|
26
|
+
backdrop: "default"
|
|
27
|
+
}
|
|
28
|
+
}), _ = i.forwardRef(
|
|
29
|
+
({
|
|
30
|
+
show: t = !0,
|
|
31
|
+
colorTheme: u = "default",
|
|
32
|
+
backdrop: b = "default",
|
|
33
|
+
onClickOutside: d,
|
|
34
|
+
className: p,
|
|
35
|
+
children: g,
|
|
36
|
+
...h
|
|
37
|
+
}, y) => {
|
|
38
|
+
i.useEffect(() => {
|
|
39
|
+
if (!(typeof document > "u") && t)
|
|
40
|
+
return n += 1, document.body.classList.add(f), () => {
|
|
41
|
+
n = Math.max(0, n - 1), n === 0 && document.body.classList.remove(f);
|
|
42
|
+
};
|
|
43
|
+
}, [t]);
|
|
44
|
+
const l = i.useCallback(
|
|
45
|
+
(e) => {
|
|
46
|
+
e || d?.();
|
|
47
|
+
},
|
|
48
|
+
[d]
|
|
49
|
+
);
|
|
50
|
+
return t ? /* @__PURE__ */ a(r.Root, { open: t, onOpenChange: l, modal: !0, children: /* @__PURE__ */ s(r.Portal, { children: [
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
|
+
r.Overlay,
|
|
53
|
+
{
|
|
54
|
+
className: o(
|
|
55
|
+
"fixed inset-0",
|
|
56
|
+
"pointer-events-auto",
|
|
57
|
+
c.MODAL,
|
|
58
|
+
v({ colorTheme: u, backdrop: b })
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
r.Content,
|
|
64
|
+
{
|
|
65
|
+
className: o("fixed inset-0", "overflow-y-auto", c.MODAL),
|
|
66
|
+
onClick: (e) => {
|
|
67
|
+
e.target === e.currentTarget && l(!1);
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ a(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: o(
|
|
73
|
+
"min-h-full",
|
|
74
|
+
"flex flex-col justify-center items-center",
|
|
75
|
+
"animate-[modalContentShow_225ms_cubic-bezier(0.4,0,0.2,1)]"
|
|
76
|
+
),
|
|
77
|
+
role: "presentation",
|
|
78
|
+
onClick: (e) => {
|
|
79
|
+
e.target === e.currentTarget && l(!1);
|
|
80
|
+
},
|
|
81
|
+
children: /* @__PURE__ */ s(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
ref: y,
|
|
85
|
+
className: o(
|
|
86
|
+
"relative",
|
|
87
|
+
"w-full sm:w-auto",
|
|
88
|
+
"m-auto py-0 px-0 sm:py-5",
|
|
89
|
+
p
|
|
90
|
+
),
|
|
91
|
+
...h,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ a(r.Title, { className: "sr-only", children: "Modal Window" }),
|
|
94
|
+
g
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }) }) : null;
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
_.displayName = "Modal";
|
|
106
|
+
export {
|
|
107
|
+
_ as Modal
|
|
108
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cva as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cva as c } from "class-variance-authority";
|
|
3
3
|
import * as r from "react";
|
|
4
4
|
import { cn as t } from "../../utils/cn.js";
|
|
5
5
|
import "sonner";
|
|
6
6
|
import "@gearbox-protocol/sdk";
|
|
7
|
-
const
|
|
7
|
+
const u = c("flex flex-col [&>li:empty]:hidden", {
|
|
8
8
|
variants: {
|
|
9
9
|
rowGap: {
|
|
10
|
-
xs: "gap-1",
|
|
11
|
-
default: "gap-4",
|
|
12
|
-
md: "gap-6"
|
|
10
|
+
xs: "gap-1 [&>li:empty+li]:-mt-1",
|
|
11
|
+
default: "gap-4 [&>li:empty+li]:-mt-4",
|
|
12
|
+
md: "gap-6 [&>li:empty+li]:-mt-6"
|
|
13
13
|
},
|
|
14
14
|
divided: {
|
|
15
15
|
true: "",
|
|
@@ -29,47 +29,47 @@ const c = u("flex flex-col", {
|
|
|
29
29
|
divided: !1,
|
|
30
30
|
nested: !1
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
32
|
+
}), y = r.forwardRef(
|
|
33
33
|
({
|
|
34
|
-
className:
|
|
35
|
-
rowGap:
|
|
36
|
-
divided:
|
|
37
|
-
nested:
|
|
34
|
+
className: s,
|
|
35
|
+
rowGap: f = "default",
|
|
36
|
+
divided: l = !1,
|
|
37
|
+
nested: m = !1,
|
|
38
38
|
children: p,
|
|
39
|
-
...
|
|
40
|
-
},
|
|
41
|
-
const
|
|
39
|
+
...n
|
|
40
|
+
}, d) => {
|
|
41
|
+
const a = r.Children.toArray(p).filter(
|
|
42
42
|
(e) => e != null
|
|
43
43
|
);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ i(
|
|
45
45
|
"ul",
|
|
46
46
|
{
|
|
47
|
-
ref:
|
|
47
|
+
ref: d,
|
|
48
48
|
className: t(
|
|
49
|
-
|
|
49
|
+
u({ rowGap: f, divided: l, nested: m }),
|
|
50
50
|
"list-none",
|
|
51
|
-
|
|
51
|
+
s
|
|
52
52
|
),
|
|
53
|
-
...
|
|
54
|
-
children:
|
|
55
|
-
const
|
|
56
|
-
return
|
|
53
|
+
...n,
|
|
54
|
+
children: a.map((e, o) => {
|
|
55
|
+
const b = r.isValidElement(e) && e.key ? e.key : `vertical-list-item-${o}`;
|
|
56
|
+
return /* @__PURE__ */ i(
|
|
57
57
|
"li",
|
|
58
58
|
{
|
|
59
59
|
className: t(
|
|
60
|
-
|
|
60
|
+
l && o !== a.length - 1 && "pb-3 border-b border-border"
|
|
61
61
|
),
|
|
62
62
|
children: e
|
|
63
63
|
},
|
|
64
|
-
|
|
64
|
+
b
|
|
65
65
|
);
|
|
66
66
|
})
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
|
|
71
|
+
y.displayName = "VerticalList";
|
|
72
72
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
y as VerticalList,
|
|
74
|
+
u as verticalListVariants
|
|
75
75
|
};
|