@gardenfi/garden-book 0.3.0-beta.3 → 0.3.2
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 +33 -11
- package/dist/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Checkbox/Checkbox.js +33 -5
- package/dist/CookieConsent/CookieConsent.d.ts +18 -0
- package/dist/CookieConsent/CookieConsent.js +52 -0
- package/dist/CookieConsent/CookieConsentNotice.d.ts +8 -0
- package/dist/CookieConsent/CookieConsentNotice.js +55 -0
- package/dist/CookieConsent/CookieConsentPreferences.d.ts +10 -0
- package/dist/CookieConsent/CookieConsentPreferences.js +75 -0
- package/dist/CookieConsent/index.d.ts +5 -0
- package/dist/CookieConsent/index.js +8 -0
- package/dist/CookieConsent/store.d.ts +19 -0
- package/dist/CookieConsent/store.js +42 -0
- package/dist/CookieConsent/useCookieConsent.d.ts +23 -0
- package/dist/CookieConsent/useCookieConsent.js +31 -0
- package/dist/CookieConsent/utils.d.ts +58 -0
- package/dist/CookieConsent/utils.js +134 -0
- package/dist/DataTable/DataTable.d.ts +0 -9
- package/dist/DataTable/index.js +44 -44
- package/dist/Footer/index.js +16 -10
- package/dist/InfoTooltip/InfoTooltip.d.ts +0 -10
- package/dist/InfoTooltip/index.js +79 -71
- package/dist/Logo/Code4renaLogo.d.ts +5 -0
- package/dist/Logo/Code4renaLogo.js +45 -0
- package/dist/Logo/index.d.ts +1 -0
- package/dist/Logo/index.js +10 -8
- package/dist/Modal/Modal.d.ts +3 -0
- package/dist/Modal/index.js +21 -21
- package/dist/OTPInput/OTPInput.d.ts +2 -2
- package/dist/OTPInput/index.js +31 -31
- package/dist/ResponsiveModal/ResponsiveModal.d.ts +10 -0
- package/dist/ResponsiveModal/index.js +73 -50
- package/dist/index.d.ts +1 -0
- package/dist/index.js +198 -190
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +12 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -330
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +0 -11
package/dist/Modal/Modal.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ type ModalProps = VariantProps<typeof modalStyles> & {
|
|
|
9
9
|
onClose?: () => void;
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
disableScrollLock?: boolean;
|
|
12
|
+
/** Extra classes for the full-screen overlay — use to change alignment
|
|
13
|
+
* (e.g. `!gf-items-end !gf-justify-start` to dock the card bottom-left). */
|
|
14
|
+
overlayClassName?: string;
|
|
12
15
|
};
|
|
13
16
|
declare const Modal: React.FC<ModalProps> & {
|
|
14
17
|
Children: React.FC<ChildrenProps>;
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { cva as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Opacity as
|
|
5
|
-
import { RemoveScroll as
|
|
6
|
-
import { ClientOnly as
|
|
7
|
-
const
|
|
2
|
+
import { cva as c } from "class-variance-authority";
|
|
3
|
+
import { useState as g, useEffect as m } from "react";
|
|
4
|
+
import { Opacity as d } from "../Opacity/index.js";
|
|
5
|
+
import { RemoveScroll as p } from "react-remove-scroll";
|
|
6
|
+
import { ClientOnly as u } from "../ClientOnly/index.js";
|
|
7
|
+
const h = c(
|
|
8
8
|
[
|
|
9
9
|
"gf-fixed gf-inset-0 gf-z-50 gf-flex gf-items-center gf-justify-center gf-min-h-screen gf-transition-all"
|
|
10
10
|
],
|
|
@@ -19,37 +19,37 @@ const u = s(
|
|
|
19
19
|
open: !1
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
),
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
e &&
|
|
22
|
+
), v = ({ open: e, onClose: a, disableScrollLock: r, overlayClassName: o, children: i }) => {
|
|
23
|
+
const [n, f] = g(!1);
|
|
24
|
+
m(() => {
|
|
25
|
+
e && f(!0);
|
|
26
26
|
}, [e]);
|
|
27
|
-
const
|
|
28
|
-
a && (
|
|
27
|
+
const l = (s) => {
|
|
28
|
+
a && (s.stopPropagation(), a());
|
|
29
29
|
};
|
|
30
|
-
return /* @__PURE__ */ t(
|
|
30
|
+
return /* @__PURE__ */ t(u, { children: /* @__PURE__ */ t(p, { removeScrollBar: !1, enabled: !!e && !r, children: /* @__PURE__ */ t(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
|
-
className: `gf-bg-dark-grey gf-bg-opacity-40 ${
|
|
33
|
+
className: `gf-bg-dark-grey gf-bg-opacity-40 ${h({
|
|
34
34
|
open: e
|
|
35
|
-
})} ${
|
|
36
|
-
onClick:
|
|
35
|
+
})} ${n ? e ? "gf-animate-fade-in " : "gf-animate-fade-out" : ""} ${o ?? ""}`,
|
|
36
|
+
onClick: l,
|
|
37
37
|
children: /* @__PURE__ */ t(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
className: `gf-transform gf-transition-transform ${e ? "gf-animate-scale-in" : "gf-animate-scale-out"}`,
|
|
41
|
-
children:
|
|
41
|
+
children: i
|
|
42
42
|
}
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
) }) });
|
|
46
|
-
},
|
|
46
|
+
}, y = ({
|
|
47
47
|
children: e,
|
|
48
48
|
className: a,
|
|
49
49
|
opacityLevel: r,
|
|
50
50
|
...o
|
|
51
51
|
}) => /* @__PURE__ */ t(
|
|
52
|
-
|
|
52
|
+
d,
|
|
53
53
|
{
|
|
54
54
|
level: r,
|
|
55
55
|
onClick: (n) => {
|
|
@@ -60,7 +60,7 @@ const u = s(
|
|
|
60
60
|
children: e
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
|
|
63
|
+
v.Children = y;
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
v as Modal
|
|
66
66
|
};
|
|
@@ -5,7 +5,7 @@ export type OTPInputProps = {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
className?: string;
|
|
8
|
+
inputClassName?: string;
|
|
8
9
|
length?: number;
|
|
9
|
-
white?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const OTPInput: ({ value, onChange, onComplete, disabled, autoFocus, className,
|
|
11
|
+
export declare const OTPInput: ({ value, onChange, onComplete, disabled, autoFocus, className, inputClassName, length, }: OTPInputProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/OTPInput/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as R } from "react/jsx-runtime";
|
|
2
2
|
import { useState as T, useRef as l, useEffect as m } from "react";
|
|
3
3
|
import { cn as h } from "../utils/index.js";
|
|
4
|
-
const
|
|
4
|
+
const M = ({
|
|
5
5
|
value: p,
|
|
6
6
|
onChange: g,
|
|
7
7
|
onComplete: w,
|
|
8
8
|
disabled: a = !1,
|
|
9
9
|
autoFocus: y = !0,
|
|
10
10
|
className: k,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
inputClassName: A,
|
|
12
|
+
length: c = 6
|
|
13
13
|
}) => {
|
|
14
|
-
const [o, i] = T(Array(c).fill("")),
|
|
14
|
+
const [o, i] = T(Array(c).fill("")), n = l([]), D = l(!1), O = l(p), j = l(w);
|
|
15
15
|
m(() => {
|
|
16
16
|
j.current = w;
|
|
17
17
|
}, [w]), m(() => {
|
|
@@ -24,65 +24,65 @@ const L = ({
|
|
|
24
24
|
O.current = p;
|
|
25
25
|
}, [p, c, o]), m(() => {
|
|
26
26
|
var t;
|
|
27
|
-
y &&
|
|
27
|
+
y && n.current[0] && !a && ((t = n.current[0]) == null || t.focus());
|
|
28
28
|
}, [y, a]), m(() => {
|
|
29
29
|
const t = o.join("");
|
|
30
30
|
t.length === c && j.current && !a && !D.current && (D.current = !0, j.current(t));
|
|
31
31
|
}, [o, c, a]);
|
|
32
|
-
const I = (t,
|
|
32
|
+
const I = (t, e) => {
|
|
33
33
|
var u;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
}, P = (t,
|
|
39
|
-
var
|
|
40
|
-
if (
|
|
34
|
+
const r = e.replace(/\D/g, "");
|
|
35
|
+
if (r.length > 1) return;
|
|
36
|
+
const s = [...o];
|
|
37
|
+
s[t] = r, i(s), g(s.join("")), r && t < c - 1 && ((u = n.current[t + 1]) == null || u.focus());
|
|
38
|
+
}, P = (t, e) => {
|
|
39
|
+
var r, s, u;
|
|
40
|
+
if (e.key === "Backspace") {
|
|
41
41
|
if (o[t]) {
|
|
42
42
|
const f = [...o];
|
|
43
43
|
f[t] = "", i(f), g(f.join(""));
|
|
44
44
|
} else if (t > 0) {
|
|
45
45
|
const f = [...o];
|
|
46
|
-
f[t - 1] = "", i(f), g(f.join("")), (
|
|
46
|
+
f[t - 1] = "", i(f), g(f.join("")), (r = n.current[t - 1]) == null || r.focus();
|
|
47
47
|
}
|
|
48
|
-
} else
|
|
48
|
+
} else e.key === "ArrowLeft" && t > 0 ? (s = n.current[t - 1]) == null || s.focus() : e.key === "ArrowRight" && t < c - 1 && ((u = n.current[t + 1]) == null || u.focus());
|
|
49
49
|
}, S = (t) => {
|
|
50
50
|
var u;
|
|
51
51
|
t.preventDefault();
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
52
|
+
const e = t.clipboardData.getData("text").replace(/\D/g, "").slice(0, c);
|
|
53
|
+
if (e.length === 0) return;
|
|
54
|
+
const r = [...o];
|
|
55
55
|
for (let f = 0; f < c; f++)
|
|
56
|
-
|
|
57
|
-
i(
|
|
58
|
-
const
|
|
59
|
-
(u =
|
|
56
|
+
r[f] = e[f] || "";
|
|
57
|
+
i(r), g(r.join(""));
|
|
58
|
+
const s = Math.min(e.length - 1, c - 1);
|
|
59
|
+
(u = n.current[s]) == null || u.focus();
|
|
60
60
|
};
|
|
61
|
-
return /* @__PURE__ */ R("div", { className: h("gf-flex gf-gap-3 gf-items-center gf-w-full", k), children: o.map((t,
|
|
61
|
+
return /* @__PURE__ */ R("div", { className: h("gf-flex gf-gap-3 gf-items-center gf-w-full", k), children: o.map((t, e) => /* @__PURE__ */ R(
|
|
62
62
|
"input",
|
|
63
63
|
{
|
|
64
|
-
ref: (
|
|
65
|
-
|
|
64
|
+
ref: (r) => {
|
|
65
|
+
n.current[e] = r;
|
|
66
66
|
},
|
|
67
67
|
type: "text",
|
|
68
68
|
inputMode: "numeric",
|
|
69
69
|
maxLength: 1,
|
|
70
70
|
value: t,
|
|
71
|
-
onChange: (
|
|
72
|
-
onKeyDown: (
|
|
71
|
+
onChange: (r) => I(e, r.target.value),
|
|
72
|
+
onKeyDown: (r) => P(e, r),
|
|
73
73
|
onPaste: S,
|
|
74
74
|
disabled: a,
|
|
75
|
-
autoFocus: y &&
|
|
75
|
+
autoFocus: y && e === 0,
|
|
76
76
|
className: h(
|
|
77
77
|
"gf-flex-1 gf-min-w-0 gf-h-11 gf-text-center gf-text-[20px] gf-text-primaryIris gf-rounded-lg gf-bg-white/70",
|
|
78
78
|
"focus:gf-outline-none focus:gf-ring-0 focus:gf-ring-offset-0",
|
|
79
79
|
"disabled:gf-opacity-50 disabled:gf-cursor-not-allowed",
|
|
80
|
-
A
|
|
80
|
+
A
|
|
81
81
|
)
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
e
|
|
84
84
|
)) });
|
|
85
85
|
};
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
M as OTPInput
|
|
88
88
|
};
|
|
@@ -8,6 +8,16 @@ export type ResponsiveModalProps = {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
opacityLevel?: OpacityVariants;
|
|
10
10
|
className?: string;
|
|
11
|
+
/** Hide the close (X) button — for modals that must force a choice. Also makes
|
|
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;
|
|
11
21
|
};
|
|
12
22
|
/** Modal on desktop, vaul BottomSheet on mobile. Reads viewport from `ViewportProvider`. Portals into `document.body`. */
|
|
13
23
|
export declare const ResponsiveModal: FC<ResponsiveModalProps>;
|
|
@@ -1,62 +1,85 @@
|
|
|
1
|
-
import { jsx as e, jsxs 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
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useEffect as b } from "react";
|
|
3
|
+
import { createPortal as g } from "react-dom";
|
|
4
|
+
import { Modal as n } from "../Modal/index.js";
|
|
5
|
+
import { BottomSheet as v } from "../BottomSheet/index.js";
|
|
6
|
+
import { Typography as y } from "../Typography/index.js";
|
|
7
|
+
import { CloseIcon as l } from "../Icons/CloseIcon.js";
|
|
8
|
+
import { useViewport as M } from "../Viewport/index.js";
|
|
9
|
+
import { cn as N } from "../utils/index.js";
|
|
10
|
+
const V = ({
|
|
11
11
|
open: t,
|
|
12
12
|
onClose: r,
|
|
13
13
|
label: o,
|
|
14
|
-
children:
|
|
15
|
-
opacityLevel:
|
|
16
|
-
className:
|
|
14
|
+
children: f,
|
|
15
|
+
opacityLevel: c = "medium",
|
|
16
|
+
className: a,
|
|
17
|
+
hideCloseBtn: i,
|
|
18
|
+
overlayClassName: m,
|
|
19
|
+
bottomSheetAllowBackgroundInteraction: p,
|
|
20
|
+
disableScrollLock: u
|
|
17
21
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}, []),
|
|
22
|
-
/* @__PURE__ */ e(
|
|
22
|
+
const d = M() === "mobile", [h, w] = x(!1);
|
|
23
|
+
return b(() => {
|
|
24
|
+
w(!0);
|
|
25
|
+
}, []), h ? d ? t ? g(
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
v,
|
|
28
|
+
{
|
|
29
|
+
open: t,
|
|
30
|
+
onOpenChange: r,
|
|
31
|
+
overlayClassName: m,
|
|
32
|
+
dismissible: !i,
|
|
33
|
+
modal: !p,
|
|
34
|
+
children: f
|
|
35
|
+
}
|
|
36
|
+
),
|
|
23
37
|
document.body
|
|
24
|
-
) : null :
|
|
25
|
-
/* @__PURE__ */ e(
|
|
26
|
-
|
|
38
|
+
) : null : g(
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
n,
|
|
27
41
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
open: t,
|
|
43
|
+
onClose: r,
|
|
44
|
+
overlayClassName: m,
|
|
45
|
+
disableScrollLock: u,
|
|
46
|
+
children: /* @__PURE__ */ s(
|
|
47
|
+
n.Children,
|
|
48
|
+
{
|
|
49
|
+
opacityLevel: c,
|
|
50
|
+
className: N(
|
|
51
|
+
"gf-relative gf-flex gf-w-[500px] gf-flex-col gf-gap-4 gf-rounded-2xl gf-p-4",
|
|
52
|
+
a
|
|
53
|
+
),
|
|
54
|
+
children: [
|
|
55
|
+
o && /* @__PURE__ */ s("div", { className: "gf-flex gf-items-center gf-justify-between", children: [
|
|
56
|
+
/* @__PURE__ */ e(y, { size: "h4", weight: "medium", children: o }),
|
|
57
|
+
!i && /* @__PURE__ */ e(
|
|
58
|
+
l,
|
|
59
|
+
{
|
|
60
|
+
className: "gf-h-3 gf-w-3 gf-fill-primaryIris gf-cursor-pointer",
|
|
61
|
+
onClick: r
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }),
|
|
65
|
+
!o && !i && /* @__PURE__ */ e(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
onClick: r,
|
|
69
|
+
className: "gf-absolute gf-right-4 gf-top-4 gf-cursor-pointer gf-text-white/50 gf-transition-colors hover:gf-text-white",
|
|
70
|
+
"aria-label": "Close",
|
|
71
|
+
children: /* @__PURE__ */ e(l, { className: "gf-h-4 gf-w-4" })
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
f
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
55
78
|
}
|
|
56
|
-
)
|
|
79
|
+
),
|
|
57
80
|
document.body
|
|
58
81
|
) : null;
|
|
59
82
|
};
|
|
60
83
|
export {
|
|
61
|
-
|
|
84
|
+
V as ResponsiveModal
|
|
62
85
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export * from './components/organisms/QuestCard';
|
|
|
39
39
|
export * from './components/organisms/DataTable';
|
|
40
40
|
export * from './components/organisms/CardList';
|
|
41
41
|
export * from './components/organisms/DashboardLayout';
|
|
42
|
+
export * from './components/organisms/CookieConsent';
|
|
42
43
|
export * from './components/atoms/OTPInput';
|
|
43
44
|
export * from './components/atoms/DirectionalIconHover';
|
|
44
45
|
export * from './components/atoms/Skeleton';
|