@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.
Files changed (40) hide show
  1. package/dist/BottomSheet/BottomSheet.d.ts +4 -0
  2. package/dist/BottomSheet/index.js +33 -11
  3. package/dist/Checkbox/Checkbox.d.ts +1 -0
  4. package/dist/Checkbox/Checkbox.js +33 -5
  5. package/dist/CookieConsent/CookieConsent.d.ts +18 -0
  6. package/dist/CookieConsent/CookieConsent.js +52 -0
  7. package/dist/CookieConsent/CookieConsentNotice.d.ts +8 -0
  8. package/dist/CookieConsent/CookieConsentNotice.js +55 -0
  9. package/dist/CookieConsent/CookieConsentPreferences.d.ts +10 -0
  10. package/dist/CookieConsent/CookieConsentPreferences.js +75 -0
  11. package/dist/CookieConsent/index.d.ts +5 -0
  12. package/dist/CookieConsent/index.js +8 -0
  13. package/dist/CookieConsent/store.d.ts +19 -0
  14. package/dist/CookieConsent/store.js +42 -0
  15. package/dist/CookieConsent/useCookieConsent.d.ts +23 -0
  16. package/dist/CookieConsent/useCookieConsent.js +31 -0
  17. package/dist/CookieConsent/utils.d.ts +58 -0
  18. package/dist/CookieConsent/utils.js +134 -0
  19. package/dist/DataTable/DataTable.d.ts +0 -9
  20. package/dist/DataTable/index.js +44 -44
  21. package/dist/Footer/index.js +16 -10
  22. package/dist/InfoTooltip/InfoTooltip.d.ts +0 -10
  23. package/dist/InfoTooltip/index.js +79 -71
  24. package/dist/Logo/Code4renaLogo.d.ts +5 -0
  25. package/dist/Logo/Code4renaLogo.js +45 -0
  26. package/dist/Logo/index.d.ts +1 -0
  27. package/dist/Logo/index.js +10 -8
  28. package/dist/Modal/Modal.d.ts +3 -0
  29. package/dist/Modal/index.js +21 -21
  30. package/dist/OTPInput/OTPInput.d.ts +2 -2
  31. package/dist/OTPInput/index.js +31 -31
  32. package/dist/ResponsiveModal/ResponsiveModal.d.ts +10 -0
  33. package/dist/ResponsiveModal/index.js +73 -50
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +198 -190
  36. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +12 -14
  37. package/dist/style.css +1 -1
  38. package/package.json +1 -1
  39. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -330
  40. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +0 -11
@@ -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>;
@@ -1,10 +1,10 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { cva as s } from "class-variance-authority";
3
- import { useState as c, useEffect as g } from "react";
4
- import { Opacity as m } from "../Opacity/index.js";
5
- import { RemoveScroll as d } from "react-remove-scroll";
6
- import { ClientOnly as p } from "../ClientOnly/index.js";
7
- const u = s(
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
- ), h = ({ open: e, onClose: a, disableScrollLock: r, children: o }) => {
23
- const [i, n] = c(!1);
24
- g(() => {
25
- e && n(!0);
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 f = (l) => {
28
- a && (l.stopPropagation(), a());
27
+ const l = (s) => {
28
+ a && (s.stopPropagation(), a());
29
29
  };
30
- return /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(d, { removeScrollBar: !1, enabled: !!e && !r, children: /* @__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 ${u({
33
+ className: `gf-bg-dark-grey gf-bg-opacity-40 ${h({
34
34
  open: e
35
- })} ${i ? e ? "gf-animate-fade-in " : "gf-animate-fade-out" : ""}`,
36
- onClick: f,
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: o
41
+ children: i
42
42
  }
43
43
  )
44
44
  }
45
45
  ) }) });
46
- }, v = ({
46
+ }, y = ({
47
47
  children: e,
48
48
  className: a,
49
49
  opacityLevel: r,
50
50
  ...o
51
51
  }) => /* @__PURE__ */ t(
52
- m,
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
- h.Children = v;
63
+ v.Children = y;
64
64
  export {
65
- h as Modal
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, length, white, }: OTPInputProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const OTPInput: ({ value, onChange, onComplete, disabled, autoFocus, className, inputClassName, length, }: OTPInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -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 L = ({
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
- length: c = 6,
12
- white: A = !1
11
+ inputClassName: A,
12
+ length: c = 6
13
13
  }) => {
14
- const [o, i] = T(Array(c).fill("")), s = l([]), D = l(!1), O = l(p), j = l(w);
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 && s.current[0] && !a && ((t = s.current[0]) == null || t.focus());
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, r) => {
32
+ const I = (t, e) => {
33
33
  var u;
34
- const e = r.replace(/\D/g, "");
35
- if (e.length > 1) return;
36
- const n = [...o];
37
- n[t] = e, i(n), g(n.join("")), e && t < c - 1 && ((u = s.current[t + 1]) == null || u.focus());
38
- }, P = (t, r) => {
39
- var e, n, u;
40
- if (r.key === "Backspace") {
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("")), (e = s.current[t - 1]) == null || e.focus();
46
+ f[t - 1] = "", i(f), g(f.join("")), (r = n.current[t - 1]) == null || r.focus();
47
47
  }
48
- } else r.key === "ArrowLeft" && t > 0 ? (n = s.current[t - 1]) == null || n.focus() : r.key === "ArrowRight" && t < c - 1 && ((u = s.current[t + 1]) == null || u.focus());
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 r = t.clipboardData.getData("text").replace(/\D/g, "").slice(0, c);
53
- if (r.length === 0) return;
54
- const e = [...o];
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
- e[f] = r[f] || "";
57
- i(e), g(e.join(""));
58
- const n = Math.min(r.length - 1, c - 1);
59
- (u = s.current[n]) == null || u.focus();
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, r) => /* @__PURE__ */ R(
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: (e) => {
65
- s.current[r] = e;
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: (e) => I(r, e.target.value),
72
- onKeyDown: (e) => P(r, e),
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 && r === 0,
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 && "gf-bg-white/50"
80
+ A
81
81
  )
82
82
  },
83
- r
83
+ e
84
84
  )) });
85
85
  };
86
86
  export {
87
- L as OTPInput
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 f } from "react/jsx-runtime";
2
- import { useState as u, useEffect as d } from "react";
3
- import { createPortal as m } from "react-dom";
4
- import { Modal as s } from "../Modal/index.js";
5
- import { BottomSheet as h } from "../BottomSheet/index.js";
6
- import { Typography as w } from "../Typography/index.js";
7
- import { CloseIcon as n } from "../Icons/CloseIcon.js";
8
- import { useViewport as x } from "../Viewport/index.js";
9
- import { cn as b } from "../utils/index.js";
10
- const B = ({
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: i,
15
- opacityLevel: l = "medium",
16
- className: g
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 c = x() === "mobile", [a, p] = u(!1);
19
- return d(() => {
20
- p(!0);
21
- }, []), a ? c ? t ? m(
22
- /* @__PURE__ */ e(h, { open: t, onOpenChange: r, children: i }),
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 : m(
25
- /* @__PURE__ */ e(s, { open: t, onClose: r, children: /* @__PURE__ */ f(
26
- s.Children,
38
+ ) : null : g(
39
+ /* @__PURE__ */ e(
40
+ n,
27
41
  {
28
- opacityLevel: l,
29
- className: b(
30
- "gf-relative gf-flex gf-w-[500px] gf-flex-col gf-gap-4 gf-rounded-2xl gf-p-4",
31
- g
32
- ),
33
- children: [
34
- o && /* @__PURE__ */ f("div", { className: "gf-flex gf-items-center gf-justify-between", children: [
35
- /* @__PURE__ */ e(w, { size: "h4", weight: "medium", children: o }),
36
- /* @__PURE__ */ e(
37
- n,
38
- {
39
- className: "gf-h-3 gf-w-3 gf-fill-primaryIris gf-cursor-pointer",
40
- onClick: r
41
- }
42
- )
43
- ] }),
44
- !o && /* @__PURE__ */ e(
45
- "button",
46
- {
47
- onClick: r,
48
- className: "gf-absolute gf-right-4 gf-top-4 gf-cursor-pointer gf-text-white/50 gf-transition-colors hover:gf-text-white",
49
- "aria-label": "Close",
50
- children: /* @__PURE__ */ e(n, { className: "gf-h-4 gf-w-4" })
51
- }
52
- ),
53
- i
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
- B as ResponsiveModal
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';