@gardenfi/garden-book 0.3.2 → 0.3.3
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/BottomSheet/BottomSheet.d.ts +4 -0
- package/dist/BottomSheet/index.js +38 -26
- package/dist/CookieConsent/CookieConsent.d.ts +7 -0
- package/dist/CookieConsent/CookieConsent.js +58 -35
- package/dist/CookieConsent/store.js +19 -19
- package/dist/CookieConsent/utils.d.ts +8 -0
- package/dist/CookieConsent/utils.js +41 -25
- package/dist/DashboardLayout/DashboardSidebar.js +5 -5
- package/dist/DashboardLayout/MobileMenu.js +74 -66
- package/dist/ResponsiveModal/ResponsiveModal.d.ts +29 -11
- package/dist/ResponsiveModal/index.js +53 -54
- package/dist/index.d.ts +44 -44
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,117 +1,125 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
1
|
+
import { jsxs as a, Fragment as O, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m } from "react";
|
|
3
|
-
import { HamburgerIcon as
|
|
3
|
+
import { HamburgerIcon as C } from "../HamburgerIcon/index.js";
|
|
4
4
|
import { ResponsiveModal as w } from "../ResponsiveModal/index.js";
|
|
5
5
|
import { Typography as t } from "../Typography/index.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as S } from "../Button/index.js";
|
|
7
7
|
import { cn as j } from "../utils/index.js";
|
|
8
8
|
import I from "../node_modules/lucide-react/dist/esm/icons/log-out.js";
|
|
9
|
-
const R = ({ title: i, isOpen:
|
|
10
|
-
/* @__PURE__ */ e("span", { onClick:
|
|
9
|
+
const R = ({ title: i, isOpen: s, onToggle: f, children: n }) => /* @__PURE__ */ a("div", { children: [
|
|
10
|
+
/* @__PURE__ */ e("span", { onClick: f, className: "gf-block gf-cursor-pointer", children: /* @__PURE__ */ e(t, { size: "h3", weight: "medium", children: i }) }),
|
|
11
11
|
/* @__PURE__ */ e(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
className: j(
|
|
15
15
|
"gf-grid gf-transition-[grid-template-rows,opacity] gf-duration-500 gf-ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
16
|
-
|
|
16
|
+
s ? "gf-grid-rows-[1fr] gf-opacity-100" : "gf-grid-rows-[0fr] gf-opacity-0"
|
|
17
17
|
),
|
|
18
|
-
children: /* @__PURE__ */ e("div", { className: "gf-overflow-hidden", children: /* @__PURE__ */ e("div", { className: "gf-ml-6 gf-flex gf-flex-col", children:
|
|
18
|
+
children: /* @__PURE__ */ e("div", { className: "gf-overflow-hidden", children: /* @__PURE__ */ e("div", { className: "gf-ml-6 gf-flex gf-flex-col", children: n }) })
|
|
19
19
|
}
|
|
20
20
|
)
|
|
21
21
|
] }), A = ({
|
|
22
22
|
navGroups: i,
|
|
23
|
-
activePath:
|
|
24
|
-
onNavigate:
|
|
25
|
-
onLogout:
|
|
23
|
+
activePath: s,
|
|
24
|
+
onNavigate: f,
|
|
25
|
+
onLogout: n,
|
|
26
26
|
showLogoutConfirm: N = !1,
|
|
27
27
|
onLogoutConfirmClose: c
|
|
28
28
|
}) => {
|
|
29
29
|
var b;
|
|
30
|
-
const [
|
|
30
|
+
const [p, h] = m(!1), [y, g] = m(!1), [k, u] = m(
|
|
31
31
|
((b = i[0]) == null ? void 0 : b.label) ?? "group-0"
|
|
32
32
|
), d = () => {
|
|
33
33
|
var l;
|
|
34
|
-
|
|
34
|
+
h(!1), u(((l = i[0]) == null ? void 0 : l.label) ?? "group-0");
|
|
35
35
|
}, v = () => {
|
|
36
|
-
d(), N ? g(!0) :
|
|
36
|
+
d(), N ? g(!0) : n();
|
|
37
37
|
}, z = () => {
|
|
38
38
|
g(!1), c == null || c();
|
|
39
39
|
};
|
|
40
|
-
return /* @__PURE__ */ a(
|
|
40
|
+
return /* @__PURE__ */ a(O, { children: [
|
|
41
41
|
/* @__PURE__ */ e(
|
|
42
42
|
"button",
|
|
43
43
|
{
|
|
44
44
|
type: "button",
|
|
45
|
-
onClick: () =>
|
|
45
|
+
onClick: () => h((l) => !l),
|
|
46
46
|
"aria-label": "Open menu",
|
|
47
47
|
className: "gf-shrink-0",
|
|
48
|
-
children: /* @__PURE__ */ e(
|
|
48
|
+
children: /* @__PURE__ */ e(C, { isOpen: p })
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
/* @__PURE__ */ a(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
t,
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
|
+
w,
|
|
53
|
+
{
|
|
54
|
+
open: p,
|
|
55
|
+
onClose: d,
|
|
56
|
+
desktopModal: { className: "gf-w-full" },
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ e("nav", { className: "gf-flex gf-flex-col gf-gap-4 gf-p-6 gf-bg-white/30 gf-rounded-xl", children: i.map((l, M) => {
|
|
59
|
+
const o = l.label ?? `group-${M}`;
|
|
60
|
+
return /* @__PURE__ */ e(
|
|
61
|
+
R,
|
|
62
|
+
{
|
|
63
|
+
title: l.label ?? "Navigation",
|
|
64
|
+
isOpen: k === o,
|
|
65
|
+
onToggle: () => u((r) => r === o ? "" : o),
|
|
66
|
+
children: l.items.map((r) => {
|
|
67
|
+
const x = s === r.href || s === `${r.href}/`;
|
|
68
|
+
return /* @__PURE__ */ e(
|
|
69
|
+
"div",
|
|
71
70
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
71
|
+
className: "gf-cursor-pointer gf-pt-4",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
f(r.href), d();
|
|
74
|
+
},
|
|
75
|
+
children: /* @__PURE__ */ e(
|
|
76
|
+
t,
|
|
77
|
+
{
|
|
78
|
+
size: "h3",
|
|
79
|
+
weight: x ? "medium" : "regular",
|
|
80
|
+
className: x ? "gf-text-primaryIris" : "gf-text-dark-grey",
|
|
81
|
+
children: r.title
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
},
|
|
85
|
+
r.href
|
|
86
|
+
);
|
|
87
|
+
})
|
|
88
|
+
},
|
|
89
|
+
o
|
|
90
|
+
);
|
|
91
|
+
}) }),
|
|
92
|
+
/* @__PURE__ */ e("nav", { className: "gf-py-5 gf-px-6 gf-bg-white/30 gf-rounded-xl", children: /* @__PURE__ */ a(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: v,
|
|
97
|
+
className: "gf-flex gf-w-full gf-cursor-pointer gf-items-center gf-gap-2 focus:gf-outline-none",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ e(I, { className: "gf-h-5 gf-w-5" }),
|
|
100
|
+
/* @__PURE__ */ e(t, { size: "h3", weight: "medium", children: "Log out" })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
),
|
|
99
107
|
/* @__PURE__ */ a(
|
|
100
108
|
w,
|
|
101
109
|
{
|
|
102
110
|
open: y,
|
|
103
111
|
onClose: z,
|
|
104
112
|
label: "Ready to sign out?",
|
|
105
|
-
className: "gf-max-w-sm",
|
|
113
|
+
desktopModal: { className: "gf-max-w-sm" },
|
|
106
114
|
children: [
|
|
107
115
|
/* @__PURE__ */ e("div", { className: "gf-flex gf-flex-col gf-gap-2", children: /* @__PURE__ */ e(t, { size: "h5", weight: "regular", children: "You'll be signed out and redirected to the login page." }) }),
|
|
108
116
|
/* @__PURE__ */ e(
|
|
109
|
-
|
|
117
|
+
S,
|
|
110
118
|
{
|
|
111
119
|
variant: "primary",
|
|
112
120
|
className: "gf-w-full",
|
|
113
121
|
onClick: () => {
|
|
114
|
-
g(!1),
|
|
122
|
+
g(!1), n();
|
|
115
123
|
},
|
|
116
124
|
children: "Sign out"
|
|
117
125
|
}
|
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type OpacityVariants = "extra-light" | "light" | "medium" | "semi-dark" | "full";
|
|
4
|
+
/** Desktop Modal config. Defaults: dimmed overlay, closes on outside
|
|
5
|
+
* click, X shown, page scroll-locked. */
|
|
6
|
+
export type DesktopModalConfig = {
|
|
7
|
+
/** Classes for the modal card. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Classes for the full-screen overlay */
|
|
10
|
+
overlayClassName?: string;
|
|
11
|
+
/** When `true`, force a choice — hide the close (X) button AND don't close on
|
|
12
|
+
* outside click. */
|
|
13
|
+
preventClose?: boolean;
|
|
14
|
+
/** When `true`, the page is NOT scroll-locked while open. */
|
|
15
|
+
disableScrollLock?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Mobile BottomSheet config. Defaults: dim backdrop, dismissible
|
|
18
|
+
* by tap-outside / drag, page behind blocked, scroll-locked. */
|
|
19
|
+
export type MobileBottomSheetConfig = {
|
|
20
|
+
/** Classes for the sheet content panel. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Classes for the backdrop */
|
|
23
|
+
overlayClassName?: string;
|
|
24
|
+
/** When `true`, the sheet can't be dismissed by tap-outside / drag — force a choice. */
|
|
25
|
+
preventClose?: boolean;
|
|
26
|
+
/** When `true`, the page behind the sheet stays interactive. */
|
|
27
|
+
allowBackgroundInteraction?: boolean;
|
|
28
|
+
/** When `true`, the page is NOT scroll-locked while open. */
|
|
29
|
+
disableScrollLock?: boolean;
|
|
30
|
+
};
|
|
4
31
|
export type ResponsiveModalProps = {
|
|
5
32
|
open: boolean;
|
|
6
33
|
onClose: () => void;
|
|
7
34
|
label?: string;
|
|
8
35
|
children: ReactNode;
|
|
9
36
|
opacityLevel?: OpacityVariants;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* the mobile BottomSheet non-dismissible (no tap-outside / drag-to-close). */
|
|
13
|
-
hideCloseBtn?: boolean;
|
|
14
|
-
/** Extra classes for the overlay/backdrop — desktop Modal and mobile
|
|
15
|
-
* BottomSheet alike */
|
|
16
|
-
overlayClassName?: string;
|
|
17
|
-
/** Mobile BottomSheet only. When `true`, the page behind stays interactive. Default `false`. */
|
|
18
|
-
bottomSheetAllowBackgroundInteraction?: boolean;
|
|
19
|
-
/** When `true`, the page is NOT scroll-locked while open. */
|
|
20
|
-
disableScrollLock?: boolean;
|
|
37
|
+
desktopModal?: DesktopModalConfig;
|
|
38
|
+
mobileBottomSheet?: MobileBottomSheetConfig;
|
|
21
39
|
};
|
|
22
40
|
/** Modal on desktop, vaul BottomSheet on mobile. Reads viewport from `ViewportProvider`. Portals into `document.body`. */
|
|
23
41
|
export declare const ResponsiveModal: FC<ResponsiveModalProps>;
|
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Modal as
|
|
5
|
-
import { BottomSheet as
|
|
6
|
-
import { Typography as
|
|
7
|
-
import { CloseIcon as
|
|
8
|
-
import { useViewport as
|
|
9
|
-
import { cn as
|
|
10
|
-
const
|
|
11
|
-
open:
|
|
12
|
-
onClose:
|
|
13
|
-
label:
|
|
14
|
-
children:
|
|
15
|
-
opacityLevel:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
overlayClassName: m,
|
|
19
|
-
bottomSheetAllowBackgroundInteraction: p,
|
|
20
|
-
disableScrollLock: u
|
|
1
|
+
import { jsx as c, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as L } from "react";
|
|
3
|
+
import { createPortal as a } from "react-dom";
|
|
4
|
+
import { Modal as v } from "../Modal/index.js";
|
|
5
|
+
import { BottomSheet as j } from "../BottomSheet/index.js";
|
|
6
|
+
import { Typography as I } from "../Typography/index.js";
|
|
7
|
+
import { CloseIcon as C } from "../Icons/CloseIcon.js";
|
|
8
|
+
import { useViewport as z } from "../Viewport/index.js";
|
|
9
|
+
import { cn as E } from "../utils/index.js";
|
|
10
|
+
const H = ({
|
|
11
|
+
open: i,
|
|
12
|
+
onClose: n,
|
|
13
|
+
label: s,
|
|
14
|
+
children: g,
|
|
15
|
+
opacityLevel: N = "medium",
|
|
16
|
+
desktopModal: r,
|
|
17
|
+
mobileBottomSheet: f
|
|
21
18
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
}, []),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
19
|
+
const w = z() === "mobile", [x, y] = l(!1);
|
|
20
|
+
return L(() => {
|
|
21
|
+
y(!0);
|
|
22
|
+
}, []), x ? w ? i ? a(
|
|
23
|
+
/* @__PURE__ */ c(
|
|
24
|
+
j,
|
|
28
25
|
{
|
|
29
|
-
open:
|
|
30
|
-
onOpenChange:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
open: i,
|
|
27
|
+
onOpenChange: n,
|
|
28
|
+
className: f == null ? void 0 : f.className,
|
|
29
|
+
overlayClassName: f == null ? void 0 : f.overlayClassName,
|
|
30
|
+
dismissible: !(f != null && f.preventClose),
|
|
31
|
+
modal: !(f != null && f.allowBackgroundInteraction),
|
|
32
|
+
disableScrollLock: f == null ? void 0 : f.disableScrollLock,
|
|
33
|
+
children: g
|
|
35
34
|
}
|
|
36
35
|
),
|
|
37
36
|
document.body
|
|
38
|
-
) : null :
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
37
|
+
) : null : a(
|
|
38
|
+
/* @__PURE__ */ c(
|
|
39
|
+
v,
|
|
41
40
|
{
|
|
42
|
-
open:
|
|
43
|
-
onClose: r,
|
|
44
|
-
overlayClassName:
|
|
45
|
-
disableScrollLock:
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
|
|
41
|
+
open: i,
|
|
42
|
+
onClose: r != null && r.preventClose ? void 0 : n,
|
|
43
|
+
overlayClassName: r == null ? void 0 : r.overlayClassName,
|
|
44
|
+
disableScrollLock: r == null ? void 0 : r.disableScrollLock,
|
|
45
|
+
children: /* @__PURE__ */ u(
|
|
46
|
+
v.Children,
|
|
48
47
|
{
|
|
49
|
-
opacityLevel:
|
|
50
|
-
className:
|
|
48
|
+
opacityLevel: N,
|
|
49
|
+
className: E(
|
|
51
50
|
"gf-relative gf-flex gf-w-[500px] gf-flex-col gf-gap-4 gf-rounded-2xl gf-p-4",
|
|
52
|
-
|
|
51
|
+
r == null ? void 0 : r.className
|
|
53
52
|
),
|
|
54
53
|
children: [
|
|
55
|
-
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
!
|
|
58
|
-
|
|
54
|
+
s && /* @__PURE__ */ u("div", { className: "gf-flex gf-items-center gf-justify-between", children: [
|
|
55
|
+
/* @__PURE__ */ c(I, { size: "h4", weight: "medium", children: s }),
|
|
56
|
+
!(r != null && r.preventClose) && /* @__PURE__ */ c(
|
|
57
|
+
C,
|
|
59
58
|
{
|
|
60
59
|
className: "gf-h-3 gf-w-3 gf-fill-primaryIris gf-cursor-pointer",
|
|
61
|
-
onClick:
|
|
60
|
+
onClick: n
|
|
62
61
|
}
|
|
63
62
|
)
|
|
64
63
|
] }),
|
|
65
|
-
!
|
|
64
|
+
!s && !(r != null && r.preventClose) && /* @__PURE__ */ c(
|
|
66
65
|
"button",
|
|
67
66
|
{
|
|
68
|
-
onClick:
|
|
67
|
+
onClick: n,
|
|
69
68
|
className: "gf-absolute gf-right-4 gf-top-4 gf-cursor-pointer gf-text-white/50 gf-transition-colors hover:gf-text-white",
|
|
70
69
|
"aria-label": "Close",
|
|
71
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ c(C, { className: "gf-h-4 gf-w-4" })
|
|
72
71
|
}
|
|
73
72
|
),
|
|
74
|
-
|
|
73
|
+
g
|
|
75
74
|
]
|
|
76
75
|
}
|
|
77
76
|
)
|
|
@@ -81,5 +80,5 @@ const V = ({
|
|
|
81
80
|
) : null;
|
|
82
81
|
};
|
|
83
82
|
export {
|
|
84
|
-
|
|
83
|
+
H as ResponsiveModal
|
|
85
84
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
|
|
2
2
|
export * from './animations';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './
|
|
41
|
-
export * from './
|
|
42
|
-
export * from './
|
|
43
|
-
export * from './
|
|
44
|
-
export * from './
|
|
45
|
-
export * from './
|
|
46
|
-
export * from './
|
|
3
|
+
export * from './Typography';
|
|
4
|
+
export * from './Button';
|
|
5
|
+
export * from './Checkbox';
|
|
6
|
+
export * from './BottomSheet';
|
|
7
|
+
export * from './Container';
|
|
8
|
+
export * from './Icons';
|
|
9
|
+
export * from './Logo';
|
|
10
|
+
export * from './Modal';
|
|
11
|
+
export * from './Opacity';
|
|
12
|
+
export * from './Sidebar';
|
|
13
|
+
export * from './ClientOnly';
|
|
14
|
+
export * from './Input';
|
|
15
|
+
export * from './Field';
|
|
16
|
+
export * from './StatCard';
|
|
17
|
+
export * from './ToggleGroup';
|
|
18
|
+
export * from './Pagination';
|
|
19
|
+
export * from './HamburgerIcon';
|
|
20
|
+
export * from './BulletList';
|
|
21
|
+
export * from './Portal';
|
|
22
|
+
export * from './Viewport';
|
|
23
|
+
export * from './Chip';
|
|
24
|
+
export * from './GradientScroll';
|
|
25
|
+
export * from './InfoBadge';
|
|
26
|
+
export * from './TokenInfo';
|
|
27
|
+
export * from './TokenNetworkLogos';
|
|
28
|
+
export * from './StatusChip';
|
|
29
|
+
export * from './StateContainer';
|
|
30
|
+
export * from './EmptyState';
|
|
31
|
+
export * from './ErrorState';
|
|
32
|
+
export * from './InfoTooltip';
|
|
33
|
+
export * from './SelectDropdown';
|
|
34
|
+
export * from './ResponsiveModal';
|
|
35
|
+
export * from './Toast';
|
|
36
|
+
export * from './BlogCard';
|
|
37
|
+
export * from './Footer';
|
|
38
|
+
export * from './QuestCard';
|
|
39
|
+
export * from './DataTable';
|
|
40
|
+
export * from './CardList';
|
|
41
|
+
export * from './DashboardLayout';
|
|
42
|
+
export * from './CookieConsent';
|
|
43
|
+
export * from './OTPInput';
|
|
44
|
+
export * from './DirectionalIconHover';
|
|
45
|
+
export * from './Skeleton';
|
|
46
|
+
export * from './Switch';
|