@stoa-dev/kit 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +80 -2
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useOnlineStatus/index.js +14 -0
- package/dist/hooks/useOnlineStatus/index.js.map +1 -0
- package/dist/hooks/useRouting/index.js +17 -0
- package/dist/hooks/useRouting/index.js.map +1 -0
- package/dist/i18n/index.js +30 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/at.json.js +16 -0
- package/dist/i18n/locales/at.json.js.map +1 -0
- package/dist/i18n/locales/de.json.js +16 -0
- package/dist/i18n/locales/de.json.js.map +1 -0
- package/dist/i18n/locales/en.json.js +16 -0
- package/dist/i18n/locales/en.json.js.map +1 -0
- package/dist/i18n/locales/it.json.js +16 -0
- package/dist/i18n/locales/it.json.js.map +1 -0
- package/dist/i18n/namespace.js +5 -0
- package/dist/i18n/namespace.js.map +1 -0
- package/dist/kit.css +1 -0
- package/dist/licensing/LicenseActivation/index.js +101 -0
- package/dist/licensing/LicenseActivation/index.js.map +1 -0
- package/dist/licensing/LicenseCard/index.js +149 -0
- package/dist/licensing/LicenseCard/index.js.map +1 -0
- package/dist/licensing/LicenseGate/index.js +72 -0
- package/dist/licensing/LicenseGate/index.js.map +1 -0
- package/dist/licensing/LicenseProvider/index.js +137 -0
- package/dist/licensing/LicenseProvider/index.js.map +1 -0
- package/dist/licensing/LicenseStatusBanner/index.js +135 -0
- package/dist/licensing/LicenseStatusBanner/index.js.map +1 -0
- package/dist/licensing/api.js +57 -0
- package/dist/licensing/api.js.map +1 -0
- package/dist/licensing/index.js +23 -0
- package/dist/licensing/index.js.map +1 -0
- package/dist/shell/AppNavigation/AppNavigation.module.scss.js +16 -0
- package/dist/shell/AppNavigation/AppNavigation.module.scss.js.map +1 -0
- package/dist/shell/AppNavigation/index.js +136 -0
- package/dist/shell/AppNavigation/index.js.map +1 -0
- package/dist/shell/BackHomeButton/index.js +23 -0
- package/dist/shell/BackHomeButton/index.js.map +1 -0
- package/dist/shell/BrandLines/BrandLines.module.scss.js +10 -0
- package/dist/shell/BrandLines/BrandLines.module.scss.js.map +1 -0
- package/dist/shell/BrandLines/index.js +25 -0
- package/dist/shell/BrandLines/index.js.map +1 -0
- package/dist/shell/ConfirmDialog/index.js +53 -0
- package/dist/shell/ConfirmDialog/index.js.map +1 -0
- package/dist/shell/DatePicker/index.js +219 -0
- package/dist/shell/DatePicker/index.js.map +1 -0
- package/dist/shell/ErrorBoundary/index.js +29 -0
- package/dist/shell/ErrorBoundary/index.js.map +1 -0
- package/dist/shell/NativeSelect/index.js +24 -0
- package/dist/shell/NativeSelect/index.js.map +1 -0
- package/dist/shell/PageHeading/PageHeading.module.scss.js +8 -0
- package/dist/shell/PageHeading/PageHeading.module.scss.js.map +1 -0
- package/dist/shell/PageHeading/index.js +14 -0
- package/dist/shell/PageHeading/index.js.map +1 -0
- package/dist/shell/SectionNavigation/index.js +116 -0
- package/dist/shell/SectionNavigation/index.js.map +1 -0
- package/dist/shell/Spinner/index.js +16 -0
- package/dist/shell/Spinner/index.js.map +1 -0
- package/dist/shell/UploadButton/index.js +44 -0
- package/dist/shell/UploadButton/index.js.map +1 -0
- package/dist/shell/index.js +29 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/types/hooks/index.d.ts +3 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useOnlineStatus/index.d.ts +2 -0
- package/dist/types/hooks/useOnlineStatus/index.d.ts.map +1 -0
- package/dist/types/hooks/useRouting/index.d.ts +14 -0
- package/dist/types/hooks/useRouting/index.d.ts.map +1 -0
- package/dist/types/i18n/index.d.ts +582 -0
- package/dist/types/i18n/index.d.ts.map +1 -0
- package/dist/types/i18n/namespace.d.ts +3 -0
- package/dist/types/i18n/namespace.d.ts.map +1 -0
- package/dist/types/licensing/LicenseActivation/index.d.ts +8 -0
- package/dist/types/licensing/LicenseActivation/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseCard/index.d.ts +2 -0
- package/dist/types/licensing/LicenseCard/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseGate/index.d.ts +11 -0
- package/dist/types/licensing/LicenseGate/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseProvider/index.d.ts +20 -0
- package/dist/types/licensing/LicenseProvider/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseStatusBanner/index.d.ts +4 -0
- package/dist/types/licensing/LicenseStatusBanner/index.d.ts.map +1 -0
- package/dist/types/licensing/api.d.ts +28 -0
- package/dist/types/licensing/api.d.ts.map +1 -0
- package/dist/types/licensing/index.d.ts +7 -0
- package/dist/types/licensing/index.d.ts.map +1 -0
- package/dist/types/shell/AppNavigation/index.d.ts +45 -0
- package/dist/types/shell/AppNavigation/index.d.ts.map +1 -0
- package/dist/types/shell/BackHomeButton/index.d.ts +7 -0
- package/dist/types/shell/BackHomeButton/index.d.ts.map +1 -0
- package/dist/types/shell/BrandLines/index.d.ts +6 -0
- package/dist/types/shell/BrandLines/index.d.ts.map +1 -0
- package/dist/types/shell/ConfirmDialog/index.d.ts +21 -0
- package/dist/types/shell/ConfirmDialog/index.d.ts.map +1 -0
- package/dist/types/shell/DatePicker/index.d.ts +14 -0
- package/dist/types/shell/DatePicker/index.d.ts.map +1 -0
- package/dist/types/shell/ErrorBoundary/index.d.ts +20 -0
- package/dist/types/shell/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/types/shell/NativeSelect/index.d.ts +3 -0
- package/dist/types/shell/NativeSelect/index.d.ts.map +1 -0
- package/dist/types/shell/PageHeading/index.d.ts +9 -0
- package/dist/types/shell/PageHeading/index.d.ts.map +1 -0
- package/dist/types/shell/SectionNavigation/index.d.ts +12 -0
- package/dist/types/shell/SectionNavigation/index.d.ts.map +1 -0
- package/dist/types/shell/Spinner/index.d.ts +6 -0
- package/dist/types/shell/Spinner/index.d.ts.map +1 -0
- package/dist/types/shell/UploadButton/index.d.ts +6 -0
- package/dist/types/shell/UploadButton/index.d.ts.map +1 -0
- package/dist/types/shell/index.d.ts +12 -0
- package/dist/types/shell/index.d.ts.map +1 -0
- package/dist/types/ui/accordion/index.d.ts +8 -0
- package/dist/types/ui/accordion/index.d.ts.map +1 -0
- package/dist/types/ui/button/index.d.ts +11 -0
- package/dist/types/ui/button/index.d.ts.map +1 -0
- package/dist/types/ui/calendar/index.d.ts +11 -0
- package/dist/types/ui/calendar/index.d.ts.map +1 -0
- package/dist/types/ui/card/index.d.ts +12 -0
- package/dist/types/ui/card/index.d.ts.map +1 -0
- package/dist/types/ui/dialog/index.d.ts +18 -0
- package/dist/types/ui/dialog/index.d.ts.map +1 -0
- package/dist/types/ui/dropdown-menu/index.d.ts +30 -0
- package/dist/types/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/ui/field/index.d.ts +25 -0
- package/dist/types/ui/field/index.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +21 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/types/ui/input/index.d.ts +4 -0
- package/dist/types/ui/input/index.d.ts.map +1 -0
- package/dist/types/ui/input-group/index.d.ts +17 -0
- package/dist/types/ui/input-group/index.d.ts.map +1 -0
- package/dist/types/ui/label/index.d.ts +5 -0
- package/dist/types/ui/label/index.d.ts.map +1 -0
- package/dist/types/ui/popover/index.d.ts +11 -0
- package/dist/types/ui/popover/index.d.ts.map +1 -0
- package/dist/types/ui/radio-group/index.d.ts +6 -0
- package/dist/types/ui/radio-group/index.d.ts.map +1 -0
- package/dist/types/ui/scroll-area/index.d.ts +6 -0
- package/dist/types/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/types/ui/select/index.d.ts +16 -0
- package/dist/types/ui/select/index.d.ts.map +1 -0
- package/dist/types/ui/separator/index.d.ts +5 -0
- package/dist/types/ui/separator/index.d.ts.map +1 -0
- package/dist/types/ui/sonner/index.d.ts +4 -0
- package/dist/types/ui/sonner/index.d.ts.map +1 -0
- package/dist/types/ui/switch/index.d.ts +7 -0
- package/dist/types/ui/switch/index.d.ts.map +1 -0
- package/dist/types/ui/textarea/index.d.ts +4 -0
- package/dist/types/ui/textarea/index.d.ts.map +1 -0
- package/dist/types/ui/toggle/index.d.ts +10 -0
- package/dist/types/ui/toggle/index.d.ts.map +1 -0
- package/dist/types/ui/tooltip/index.d.ts +8 -0
- package/dist/types/ui/tooltip/index.d.ts.map +1 -0
- package/dist/types/utils/cn.d.ts +3 -0
- package/dist/types/utils/cn.d.ts.map +1 -0
- package/dist/types/utils/colors.d.ts +3 -0
- package/dist/types/utils/colors.d.ts.map +1 -0
- package/dist/types/utils/dates.d.ts +9 -0
- package/dist/types/utils/dates.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/ui/accordion/index.js +65 -0
- package/dist/ui/accordion/index.js.map +1 -0
- package/dist/ui/button/index.js +57 -0
- package/dist/ui/button/index.js.map +1 -0
- package/dist/ui/calendar/index.js +179 -0
- package/dist/ui/calendar/index.js.map +1 -0
- package/dist/ui/card/index.js +102 -0
- package/dist/ui/card/index.js.map +1 -0
- package/dist/ui/dialog/index.js +158 -0
- package/dist/ui/dialog/index.js.map +1 -0
- package/dist/ui/dropdown-menu/index.js +252 -0
- package/dist/ui/dropdown-menu/index.js.map +1 -0
- package/dist/ui/field/index.js +209 -0
- package/dist/ui/field/index.js.map +1 -0
- package/dist/ui/index.js +112 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input/index.js +20 -0
- package/dist/ui/input/index.js.map +1 -0
- package/dist/ui/input-group/index.js +143 -0
- package/dist/ui/input-group/index.js.map +1 -0
- package/dist/ui/label/index.js +23 -0
- package/dist/ui/label/index.js.map +1 -0
- package/dist/ui/popover/index.js +81 -0
- package/dist/ui/popover/index.js.map +1 -0
- package/dist/ui/radio-group/index.js +45 -0
- package/dist/ui/radio-group/index.js.map +1 -0
- package/dist/ui/scroll-area/index.js +60 -0
- package/dist/ui/scroll-area/index.js.map +1 -0
- package/dist/ui/select/index.js +182 -0
- package/dist/ui/select/index.js.map +1 -0
- package/dist/ui/separator/index.js +27 -0
- package/dist/ui/separator/index.js.map +1 -0
- package/dist/ui/sonner/index.js +37 -0
- package/dist/ui/sonner/index.js.map +1 -0
- package/dist/ui/switch/index.js +32 -0
- package/dist/ui/switch/index.js.map +1 -0
- package/dist/ui/textarea/index.js +19 -0
- package/dist/ui/textarea/index.js.map +1 -0
- package/dist/ui/toggle/index.js +44 -0
- package/dist/ui/toggle/index.js.map +1 -0
- package/dist/ui/tooltip/index.js +56 -0
- package/dist/ui/tooltip/index.js.map +1 -0
- package/dist/utils/cn.js +9 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/colors.js +8 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/dates.js +28 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +112 -4
- package/scss/_index.scss +4 -0
- package/scss/_tools.scss +21 -0
- package/styles/theme.css +192 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../utils/cn.js";
|
|
3
|
+
import { BrandLines as s } from "../BrandLines/index.js";
|
|
4
|
+
import t from "./PageHeading.module.scss.js";
|
|
5
|
+
function d({ children: r, className: e, plain: i }) {
|
|
6
|
+
return /* @__PURE__ */ n("h2", { className: m(t.pageHeading, "shrink-0", e), children: [
|
|
7
|
+
!i && /* @__PURE__ */ o(s, {}),
|
|
8
|
+
r
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
d as PageHeading
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/shell/PageHeading/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '../../utils/cn'\nimport { BrandLines } from '../BrandLines'\nimport styles from './PageHeading.module.scss'\n\nexport interface PageHeadingProps {\n\tchildren: ReactNode\n\tclassName?: string\n\t/** Hide the brand accent in front of the heading. */\n\tplain?: boolean\n}\n\nexport function PageHeading({ children, className, plain }: PageHeadingProps) {\n\treturn (\n\t\t<h2 className={cn(styles.pageHeading, 'shrink-0', className)}>\n\t\t\t{!plain && <BrandLines />}\n\t\t\t{children}\n\t\t</h2>\n\t)\n}\n"],"names":["PageHeading","children","className","plain","jsxs","cn","styles","BrandLines"],"mappings":";;;;AAYO,SAASA,EAAY,EAAE,UAAAC,GAAU,WAAAC,GAAW,OAAAC,KAA2B;AAC7E,SACC,gBAAAC,EAAC,QAAG,WAAWC,EAAGC,EAAO,aAAa,YAAYJ,CAAS,GACzD,UAAA;AAAA,IAAA,CAACC,uBAAUI,GAAA,EAAW;AAAA,IACtBN;AAAA,EAAA,GACF;AAEF;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsxs as R, jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { useReducedMotion as z, motion as A } from "motion/react";
|
|
3
|
+
import { useState as w, useRef as N, useCallback as O, useEffect as B } from "react";
|
|
4
|
+
import { useTranslation as F } from "react-i18next";
|
|
5
|
+
import { useLocation as $, Link as j } from "react-router";
|
|
6
|
+
import { STOA_NS as I } from "../../i18n/namespace.js";
|
|
7
|
+
const q = 125, U = 75;
|
|
8
|
+
function S(r) {
|
|
9
|
+
let t = r?.parentElement;
|
|
10
|
+
for (; t; ) {
|
|
11
|
+
if (/(auto|scroll)/.test(getComputedStyle(t).overflowY)) return t;
|
|
12
|
+
t = t.parentElement;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function K({
|
|
17
|
+
scrollContainerRef: r,
|
|
18
|
+
sections: t,
|
|
19
|
+
label: k
|
|
20
|
+
}) {
|
|
21
|
+
const [E, T] = w(!1), H = z() ?? !1, { t: M } = F(I), { hash: d } = $(), m = N(null), [g, y] = w(
|
|
22
|
+
t[0]?.id ?? ""
|
|
23
|
+
), f = O(
|
|
24
|
+
(e) => {
|
|
25
|
+
const o = S(r.current), a = m.current, n = document.getElementById(e);
|
|
26
|
+
if (!o || !a || !n) return;
|
|
27
|
+
const l = o.scrollTop + n.getBoundingClientRect().top - o.getBoundingClientRect().top - a.offsetHeight - 16;
|
|
28
|
+
o.scrollTo({ top: Math.max(0, l) }), n.focus({ preventScroll: !0 });
|
|
29
|
+
},
|
|
30
|
+
[r]
|
|
31
|
+
);
|
|
32
|
+
return B(() => {
|
|
33
|
+
const e = S(r.current), o = m.current;
|
|
34
|
+
if (!e || !o) return;
|
|
35
|
+
const a = t.map(({ id: i }) => document.getElementById(i));
|
|
36
|
+
let n;
|
|
37
|
+
function l() {
|
|
38
|
+
if (n = void 0, !e || !o) return;
|
|
39
|
+
T(
|
|
40
|
+
(s) => s ? e.scrollTop > U : e.scrollTop >= q
|
|
41
|
+
);
|
|
42
|
+
let i = t[0]?.id ?? "", p = 0;
|
|
43
|
+
const v = e.getBoundingClientRect(), C = Math.max(
|
|
44
|
+
v.top,
|
|
45
|
+
o.getBoundingClientRect().bottom
|
|
46
|
+
), L = Math.min(v.bottom, window.innerHeight);
|
|
47
|
+
for (const s of a) {
|
|
48
|
+
if (!s) continue;
|
|
49
|
+
const h = s.getBoundingClientRect(), b = Math.max(
|
|
50
|
+
0,
|
|
51
|
+
Math.min(h.bottom, L) - Math.max(h.top, C)
|
|
52
|
+
);
|
|
53
|
+
b > p && (p = b, i = s.id);
|
|
54
|
+
}
|
|
55
|
+
e.scrollHeight > e.clientHeight && e.scrollHeight - e.clientHeight - e.scrollTop <= 2 && (i = t[t.length - 1]?.id ?? ""), y(i);
|
|
56
|
+
}
|
|
57
|
+
function c() {
|
|
58
|
+
n === void 0 && (n = requestAnimationFrame(l));
|
|
59
|
+
}
|
|
60
|
+
document.addEventListener("scroll", c, {
|
|
61
|
+
capture: !0,
|
|
62
|
+
passive: !0
|
|
63
|
+
}), window.addEventListener("resize", c);
|
|
64
|
+
const u = new ResizeObserver(c);
|
|
65
|
+
u.observe(e), u.observe(o);
|
|
66
|
+
for (const i of a) i && u.observe(i);
|
|
67
|
+
return l(), () => {
|
|
68
|
+
document.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c), n !== void 0 && cancelAnimationFrame(n), u.disconnect();
|
|
69
|
+
};
|
|
70
|
+
}, [r, t]), B(() => {
|
|
71
|
+
const e = d.slice(1);
|
|
72
|
+
t.some((o) => o.id === e) && f(e);
|
|
73
|
+
}, [d, f, t]), t.length === 0 ? null : /* @__PURE__ */ R(
|
|
74
|
+
"nav",
|
|
75
|
+
{
|
|
76
|
+
ref: m,
|
|
77
|
+
"aria-label": k ?? M("app.navigation"),
|
|
78
|
+
className: "sticky top-1 z-20 isolate m-1 mt-4 flex flex-wrap gap-1 rounded-xl p-2",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ x(
|
|
81
|
+
A.div,
|
|
82
|
+
{
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
className: "pointer-events-none absolute inset-0 -z-10 rounded-xl bg-background/25 shadow-sm backdrop-blur-xs",
|
|
85
|
+
initial: !1,
|
|
86
|
+
animate: { opacity: E ? 1 : 0 },
|
|
87
|
+
transition: { duration: H ? 0 : 0.2, ease: "easeOut" }
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
t.map(({ id: e, label: o }) => /* @__PURE__ */ x(
|
|
91
|
+
j,
|
|
92
|
+
{
|
|
93
|
+
to: `#${e}`,
|
|
94
|
+
replace: !0,
|
|
95
|
+
"aria-current": g === e ? "location" : void 0,
|
|
96
|
+
onClick: () => {
|
|
97
|
+
d === `#${e}` && f(e);
|
|
98
|
+
},
|
|
99
|
+
className: `
|
|
100
|
+
rounded-full px-3 py-2
|
|
101
|
+
text-sm font-medium transition-colors
|
|
102
|
+
outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
103
|
+
${g === e ? "bg-(--section-active) text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}
|
|
104
|
+
`,
|
|
105
|
+
children: o
|
|
106
|
+
},
|
|
107
|
+
e
|
|
108
|
+
))
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
K as SectionNavigation
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/shell/SectionNavigation/index.tsx"],"sourcesContent":["import { motion, useReducedMotion } from 'motion/react'\nimport { type RefObject, useCallback, useEffect, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Link, useLocation } from 'react-router'\nimport { STOA_NS } from '../../i18n/namespace'\n\nexport type NavigationSection = { id: string; label: string }\n\nconst showBackgroundOffset = 125\nconst hideBackgroundOffset = 75\n\nfunction getScrollContainer(content: HTMLElement | null) {\n\tlet parent = content?.parentElement\n\twhile (parent) {\n\t\tif (/(auto|scroll)/.test(getComputedStyle(parent).overflowY)) return parent\n\t\tparent = parent.parentElement\n\t}\n\treturn null\n}\n\nexport interface SectionNavigationProps {\n\tsections: readonly NavigationSection[]\n\tlabel?: string\n\tscrollContainerRef: RefObject<HTMLDivElement | null>\n}\n\nexport function SectionNavigation({\n\tscrollContainerRef,\n\tsections,\n\tlabel,\n}: SectionNavigationProps) {\n\tconst [showBackground, setShowBackground] = useState(false)\n\tconst reducedMotion = useReducedMotion() ?? false\n\tconst { t } = useTranslation(STOA_NS)\n\tconst { hash } = useLocation()\n\tconst navigationRef = useRef<HTMLElement>(null)\n\tconst [activeSection, setActiveSection] = useState<string>(\n\t\tsections[0]?.id ?? '',\n\t)\n\n\tconst scrollToSection = useCallback(\n\t\t(id: string) => {\n\t\t\tconst container = getScrollContainer(scrollContainerRef.current)\n\t\t\tconst navigation = navigationRef.current\n\t\t\tconst section = document.getElementById(id)\n\n\t\t\tif (!container || !navigation || !section) return\n\n\t\t\tconst top =\n\t\t\t\tcontainer.scrollTop +\n\t\t\t\tsection.getBoundingClientRect().top -\n\t\t\t\tcontainer.getBoundingClientRect().top -\n\t\t\t\tnavigation.offsetHeight -\n\t\t\t\t16\n\t\t\tcontainer.scrollTo({ top: Math.max(0, top) })\n\t\t\tsection.focus({ preventScroll: true })\n\t\t},\n\t\t[scrollContainerRef],\n\t)\n\n\tuseEffect(() => {\n\t\tconst container = getScrollContainer(scrollContainerRef.current)\n\t\tconst navigation = navigationRef.current\n\n\t\tif (!container || !navigation) return\n\n\t\tconst targets = sections.map(({ id }) => document.getElementById(id))\n\t\tlet animationFrame: number | undefined\n\n\t\tfunction updateActiveSection() {\n\t\t\tanimationFrame = undefined\n\n\t\t\tif (!container || !navigation) return\n\n\t\t\tsetShowBackground((visible) =>\n\t\t\t\tvisible\n\t\t\t\t\t? container.scrollTop > hideBackgroundOffset\n\t\t\t\t\t: container.scrollTop >= showBackgroundOffset,\n\t\t\t)\n\n\t\t\tlet active: string = sections[0]?.id ?? ''\n\t\t\tlet largestVisibleHeight = 0\n\t\t\tconst viewport = container.getBoundingClientRect()\n\t\t\tconst visibleTop = Math.max(\n\t\t\t\tviewport.top,\n\t\t\t\tnavigation.getBoundingClientRect().bottom,\n\t\t\t)\n\t\t\tconst visibleBottom = Math.min(viewport.bottom, window.innerHeight)\n\n\t\t\tfor (const section of targets) {\n\t\t\t\tif (!section) continue\n\t\t\t\tconst bounds = section.getBoundingClientRect()\n\t\t\t\tconst visibleHeight = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.min(bounds.bottom, visibleBottom) -\n\t\t\t\t\t\tMath.max(bounds.top, visibleTop),\n\t\t\t\t)\n\t\t\t\tif (visibleHeight > largestVisibleHeight) {\n\t\t\t\t\tlargestVisibleHeight = visibleHeight\n\t\t\t\t\tactive = section.id\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcontainer.scrollHeight > container.clientHeight &&\n\t\t\t\tcontainer.scrollHeight - container.clientHeight - container.scrollTop <=\n\t\t\t\t\t2\n\t\t\t) {\n\t\t\t\tactive = sections[sections.length - 1]?.id ?? ''\n\t\t\t}\n\t\t\tsetActiveSection(active)\n\t\t}\n\n\t\tfunction scheduleUpdate() {\n\t\t\tif (animationFrame === undefined)\n\t\t\t\tanimationFrame = requestAnimationFrame(updateActiveSection)\n\t\t}\n\n\t\t// Capture scrolls from the page and its ancestors, including native WebView scrolling.\n\t\tdocument.addEventListener('scroll', scheduleUpdate, {\n\t\t\tcapture: true,\n\t\t\tpassive: true,\n\t\t})\n\n\t\twindow.addEventListener('resize', scheduleUpdate)\n\t\tconst observer = new ResizeObserver(scheduleUpdate)\n\t\tobserver.observe(container)\n\t\tobserver.observe(navigation)\n\t\tfor (const target of targets) if (target) observer.observe(target)\n\t\tupdateActiveSection()\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('scroll', scheduleUpdate, true)\n\t\t\twindow.removeEventListener('resize', scheduleUpdate)\n\t\t\tif (animationFrame !== undefined) cancelAnimationFrame(animationFrame)\n\t\t\tobserver.disconnect()\n\t\t}\n\t}, [scrollContainerRef, sections])\n\n\tuseEffect(() => {\n\t\tconst id = hash.slice(1)\n\t\tif (sections.some((section) => section.id === id)) scrollToSection(id)\n\t}, [hash, scrollToSection, sections])\n\n\tif (sections.length === 0) return null\n\n\treturn (\n\t\t<nav\n\t\t\tref={navigationRef}\n\t\t\taria-label={label ?? t('app.navigation')}\n\t\t\tclassName='sticky top-1 z-20 isolate m-1 mt-4 flex flex-wrap gap-1 rounded-xl p-2'\n\t\t>\n\t\t\t<motion.div\n\t\t\t\taria-hidden='true'\n\t\t\t\tclassName='pointer-events-none absolute inset-0 -z-10 rounded-xl bg-background/25 shadow-sm backdrop-blur-xs'\n\t\t\t\tinitial={false}\n\t\t\t\tanimate={{ opacity: showBackground ? 1 : 0 }}\n\t\t\t\ttransition={{ duration: reducedMotion ? 0 : 0.2, ease: 'easeOut' }}\n\t\t\t/>\n\t\t\t{sections.map(({ id, label }) => (\n\t\t\t\t<Link\n\t\t\t\t\tkey={id}\n\t\t\t\t\tto={`#${id}`}\n\t\t\t\t\treplace\n\t\t\t\t\taria-current={activeSection === id ? 'location' : undefined}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tif (hash === `#${id}`) scrollToSection(id)\n\t\t\t\t\t}}\n\t\t\t\t\tclassName={`\n\t\t\t\t\t\trounded-full px-3 py-2\n\t\t\t\t\t\ttext-sm font-medium transition-colors\n\t\t\t\t\t\toutline-none focus-visible:ring-2 focus-visible:ring-ring\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\tactiveSection === id\n\t\t\t\t\t\t\t\t? 'bg-(--section-active) text-foreground'\n\t\t\t\t\t\t\t\t: 'text-muted-foreground hover:bg-muted hover:text-foreground'\n\t\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Link>\n\t\t\t))}\n\t\t</nav>\n\t)\n}\n"],"names":["showBackgroundOffset","hideBackgroundOffset","getScrollContainer","content","parent","SectionNavigation","scrollContainerRef","sections","label","showBackground","setShowBackground","useState","reducedMotion","useReducedMotion","t","useTranslation","STOA_NS","hash","useLocation","navigationRef","useRef","activeSection","setActiveSection","scrollToSection","useCallback","id","container","navigation","section","top","useEffect","targets","animationFrame","updateActiveSection","visible","active","largestVisibleHeight","viewport","visibleTop","visibleBottom","bounds","visibleHeight","scheduleUpdate","observer","target","jsxs","jsx","motion","Link"],"mappings":";;;;;;AAQA,MAAMA,IAAuB,KACvBC,IAAuB;AAE7B,SAASC,EAAmBC,GAA6B;AACxD,MAAIC,IAASD,GAAS;AACtB,SAAOC,KAAQ;AACd,QAAI,gBAAgB,KAAK,iBAAiBA,CAAM,EAAE,SAAS,EAAG,QAAOA;AACrE,IAAAA,IAASA,EAAO;AAAA,EACjB;AACA,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../i18n/namespace.js";
|
|
4
|
+
import { cn as a } from "../../utils/cn.js";
|
|
5
|
+
import { BrandLines as m } from "../BrandLines/index.js";
|
|
6
|
+
function u({ label: n, className: o }) {
|
|
7
|
+
const { t: s } = i(t);
|
|
8
|
+
return /* @__PURE__ */ e("span", { role: "status", className: a("inline-flex items-center", o), children: [
|
|
9
|
+
/* @__PURE__ */ r(m, { loading: !0 }),
|
|
10
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: n ?? s("app.loadingApp") })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
u as Spinner
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/shell/Spinner/index.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { cn } from '../../utils/cn'\nimport { BrandLines } from '../BrandLines'\n\nexport interface SpinnerProps {\n\tlabel?: string\n\tclassName?: string\n}\n\nexport function Spinner({ label, className }: SpinnerProps) {\n\tconst { t } = useTranslation(STOA_NS)\n\treturn (\n\t\t<span role='status' className={cn('inline-flex items-center', className)}>\n\t\t\t<BrandLines loading />\n\t\t\t<span className='sr-only'>{label ?? t('app.loadingApp')}</span>\n\t\t</span>\n\t)\n}\n"],"names":["Spinner","label","className","t","useTranslation","STOA_NS","jsxs","cn","jsx","BrandLines"],"mappings":";;;;;AAUO,SAASA,EAAQ,EAAE,OAAAC,GAAO,WAAAC,KAA2B;AAC3D,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAeC,CAAO;AACpC,SACC,gBAAAC,EAAC,UAAK,MAAK,UAAS,WAAWC,EAAG,4BAA4BL,CAAS,GACtE,UAAA;AAAA,IAAA,gBAAAM,EAACC,GAAA,EAAW,SAAO,GAAA,CAAC;AAAA,sBACnB,QAAA,EAAK,WAAU,WAAW,UAAAR,KAASE,EAAE,gBAAgB,EAAA,CAAE;AAAA,EAAA,GACzD;AAEF;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Upload as u } from "lucide-react";
|
|
3
|
+
import { useRef as p } from "react";
|
|
4
|
+
import { Button as c } from "../../ui/button/index.js";
|
|
5
|
+
function g({
|
|
6
|
+
label: t,
|
|
7
|
+
acceptedFileTypes: o,
|
|
8
|
+
onFilesSelected: a
|
|
9
|
+
}) {
|
|
10
|
+
const e = p(null);
|
|
11
|
+
return /* @__PURE__ */ i(l, { children: [
|
|
12
|
+
/* @__PURE__ */ i(
|
|
13
|
+
c,
|
|
14
|
+
{
|
|
15
|
+
type: "button",
|
|
16
|
+
variant: "outline",
|
|
17
|
+
className: "justify-start",
|
|
18
|
+
onClick: () => e.current?.click(),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ n(u, {}),
|
|
21
|
+
t
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ n(
|
|
26
|
+
"input",
|
|
27
|
+
{
|
|
28
|
+
ref: e,
|
|
29
|
+
type: "file",
|
|
30
|
+
accept: o,
|
|
31
|
+
multiple: !0,
|
|
32
|
+
className: "hidden",
|
|
33
|
+
"aria-label": t,
|
|
34
|
+
onChange: (r) => {
|
|
35
|
+
a(r.target.files), r.target.value = "";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
g as UploadButton
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/shell/UploadButton/index.tsx"],"sourcesContent":["import { Upload } from 'lucide-react'\nimport { useRef } from 'react'\nimport { Button } from '../../ui/button'\n\nexport function UploadButton({\n\tlabel,\n\tacceptedFileTypes,\n\tonFilesSelected,\n}: {\n\tlabel: string\n\tacceptedFileTypes: string\n\tonFilesSelected: (files: FileList | null) => void\n}) {\n\tconst inputRef = useRef<HTMLInputElement>(null)\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\ttype='button'\n\t\t\t\tvariant='outline'\n\t\t\t\tclassName='justify-start'\n\t\t\t\tonClick={() => inputRef.current?.click()}\n\t\t\t>\n\t\t\t\t<Upload />\n\t\t\t\t{label}\n\t\t\t</Button>\n\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\ttype='file'\n\t\t\t\taccept={acceptedFileTypes}\n\t\t\t\tmultiple\n\t\t\t\tclassName='hidden'\n\t\t\t\taria-label={label}\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tonFilesSelected(event.target.files)\n\t\t\t\t\tevent.target.value = ''\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t)\n}\n"],"names":["UploadButton","label","acceptedFileTypes","onFilesSelected","inputRef","useRef","jsxs","Fragment","Button","jsx","Upload","event"],"mappings":";;;;AAIO,SAASA,EAAa;AAAA,EAC5B,OAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAC;AACD,GAIG;AACF,QAAMC,IAAWC,EAAyB,IAAI;AAE9C,SACC,gBAAAC,EAAAC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAU;AAAA,QACV,SAAS,MAAMJ,EAAS,SAAS,MAAA;AAAA,QAEjC,UAAA;AAAA,UAAA,gBAAAK,EAACC,GAAA,EAAO;AAAA,UACPT;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAGF,gBAAAQ;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,KAAKL;AAAA,QACL,MAAK;AAAA,QACL,QAAQF;AAAA,QACR,UAAQ;AAAA,QACR,WAAU;AAAA,QACV,cAAYD;AAAA,QACZ,UAAU,CAACU,MAAU;AACpB,UAAAR,EAAgBQ,EAAM,OAAO,KAAK,GAClCA,EAAM,OAAO,QAAQ;AAAA,QACtB;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,GACD;AAEF;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AppNavigation as t, AppNavigationButton as e, AppNavigationDivider as p, AppNavigationItem as i, AppNavigationThemeToggle as a } from "./AppNavigation/index.js";
|
|
2
|
+
import { BackHomeButton as m } from "./BackHomeButton/index.js";
|
|
3
|
+
import { BrandLines as g } from "./BrandLines/index.js";
|
|
4
|
+
import { ConfirmDialog as v } from "./ConfirmDialog/index.js";
|
|
5
|
+
import { DatePickerInput as B } from "./DatePicker/index.js";
|
|
6
|
+
import { ErrorBoundary as u } from "./ErrorBoundary/index.js";
|
|
7
|
+
import { NativeSelect as c } from "./NativeSelect/index.js";
|
|
8
|
+
import { PageHeading as D } from "./PageHeading/index.js";
|
|
9
|
+
import { SectionNavigation as k } from "./SectionNavigation/index.js";
|
|
10
|
+
import { Spinner as I } from "./Spinner/index.js";
|
|
11
|
+
import { UploadButton as T } from "./UploadButton/index.js";
|
|
12
|
+
export {
|
|
13
|
+
t as AppNavigation,
|
|
14
|
+
e as AppNavigationButton,
|
|
15
|
+
p as AppNavigationDivider,
|
|
16
|
+
i as AppNavigationItem,
|
|
17
|
+
a as AppNavigationThemeToggle,
|
|
18
|
+
m as BackHomeButton,
|
|
19
|
+
g as BrandLines,
|
|
20
|
+
v as ConfirmDialog,
|
|
21
|
+
B as DatePickerInput,
|
|
22
|
+
u as ErrorBoundary,
|
|
23
|
+
c as NativeSelect,
|
|
24
|
+
D as PageHeading,
|
|
25
|
+
k as SectionNavigation,
|
|
26
|
+
I as Spinner,
|
|
27
|
+
T as UploadButton
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useOnlineStatus/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,IAAI,OAAO,CAiBzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed navigation helper. Apps bind their own route union once:
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* export const useAppRouting = () => useRouting<RegisteredRoutes>('/')
|
|
6
|
+
* ```
|
|
7
|
+
*/
|
|
8
|
+
export declare function useRouting<Route extends string = string>(defaultRoute?: Route): {
|
|
9
|
+
routeTo: (route: Route, options?: {
|
|
10
|
+
replace?: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
routeToDefault: () => void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useRouting/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACvD,YAAY,GAAU,KAAK;qBAKlB,KAAK,YAAY;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;EAW/C"}
|