@gardenfi/garden-book 0.3.2 → 0.3.4
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 +61 -37
- 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/Footer/Footer.d.ts +33 -0
- package/dist/Footer/index.js +129 -98
- 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,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';
|