@ubx/docs-ui 0.11.0 → 0.12.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/dist/Header.d.ts +0 -2
- package/dist/Header.js +2 -4
- package/dist/MobileNav.js +4 -2
- package/package.json +1 -1
package/dist/Header.d.ts
CHANGED
package/dist/Header.js
CHANGED
|
@@ -3,10 +3,8 @@ import Link from "next/link";
|
|
|
3
3
|
import { ThemeToggle } from "./ThemeToggle";
|
|
4
4
|
import { MobileNav } from "./MobileNav";
|
|
5
5
|
export function Header({ nav, tabs, activeTab, sidebar, sidebarLabel, search, showThemeToggle = true, githubUrl, }) {
|
|
6
|
-
return (_jsxs("header", { className: "border-b border-border bg-background", children: [_jsxs("div", { className: "relative mx-auto flex max-w-7xl items-center gap-3 px-6
|
|
7
|
-
const className =
|
|
8
|
-
? "text-sm text-primary"
|
|
9
|
-
: "text-sm text-foreground-muted hover:text-primary";
|
|
6
|
+
return (_jsxs("header", { className: "border-b border-border bg-background", children: [_jsxs("div", { className: "relative mx-auto flex h-16 max-w-7xl items-center gap-3 px-6", children: [_jsx("a", { href: "https://ubiquex.io", className: "flex shrink-0 items-center", children: _jsx("img", { src: "/logo/ubiquex.png", alt: "Ubiquex", className: "h-6 w-auto" }) }), _jsx("div", { className: "flex-1" }), _jsx("nav", { className: "absolute left-1/2 hidden -translate-x-1/2 items-center gap-5 md:flex", children: nav.map((item) => {
|
|
7
|
+
const className = "text-sm text-nav hover:text-nav-hover";
|
|
10
8
|
return item.href.startsWith("/") ? (_jsx(Link, { href: item.href, className: className, children: item.label }, item.label)) : (_jsx("a", { href: item.href, className: className, children: item.label }, item.label));
|
|
11
9
|
}) }), search ? _jsx("div", { className: "w-40 shrink-0 sm:w-56 lg:w-64", children: search }) : null, githubUrl ? (_jsxs("a", { href: githubUrl, className: "hidden shrink-0 items-center gap-2 rounded-full bg-primary px-4 py-[7px] text-sm text-primary-foreground transition-opacity hover:opacity-90 sm:flex", children: [_jsx("svg", { viewBox: "0 0 16 16", width: "16", height: "16", fill: "currentColor", "aria-hidden": "true", children: _jsx("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" }) }), "Star us on GitHub"] })) : null, showThemeToggle ? (_jsx("div", { className: "hidden md:block", children: _jsx(ThemeToggle, {}) })) : null, _jsx(MobileNav, { nav: nav, githubUrl: githubUrl, sidebar: sidebar, sidebarLabel: sidebarLabel, showThemeToggle: showThemeToggle })] }), tabs && tabs.length > 0 ? (_jsx("div", { className: "mx-auto max-w-7xl px-6", children: _jsx("nav", { className: "flex gap-6 overflow-x-auto", children: tabs.map((tab) => {
|
|
12
10
|
// Prefix match, so /concepts/ledger keeps the Concepts tab
|
package/dist/MobileNav.js
CHANGED
|
@@ -65,9 +65,11 @@ export function MobileNav({ nav, githubUrl, sidebar, sidebarLabel, showThemeTogg
|
|
|
65
65
|
setVisible(false);
|
|
66
66
|
setTimeout(() => setMounted(false), TRANSITION_MS);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
// Same rule as the desktop bar: one colour, and nothing changes with
|
|
69
|
+
// the current page.
|
|
70
|
+
const linkClass = "py-2 text-nav hover:text-nav-hover";
|
|
69
71
|
return (_jsxs(_Fragment, { children: [_jsx("button", { ref: buttonRef, type: "button", onClick: mounted ? close : open, "aria-label": mounted ? "Close navigation" : "Open navigation", "aria-expanded": mounted, className: "flex h-9 w-9 shrink-0 items-center justify-center rounded text-foreground-muted hover:bg-surface hover:text-primary md:hidden", children: mounted ? (_jsx("svg", { viewBox: "0 0 20 20", width: "20", height: "20", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) })) : (_jsx("svg", { viewBox: "0 0 20 20", width: "20", height: "20", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M3 5.5h14M3 10h14M3 14.5h14", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) })) }), mounted && (_jsxs("div", { role: "dialog", "aria-modal": "true", "aria-label": "Navigation", className: "fixed inset-x-0 bottom-0 z-50 md:hidden", style: { top }, children: [_jsx("button", { type: "button", "aria-label": "Close navigation", onClick: close, className: "absolute inset-0 bg-foreground/40 transition-opacity duration-200 motion-reduce:transition-none " +
|
|
70
72
|
(visible ? "opacity-100" : "opacity-0") }), _jsx("div", { className: "absolute inset-x-0 top-0 max-h-full overflow-hidden", children: _jsxs("div", { className: "flex max-h-[calc(100vh-8rem)] flex-col gap-1 overflow-y-auto border-b border-border bg-background px-6 pt-4 pb-6 shadow-lg " +
|
|
71
73
|
"transition-transform duration-200 ease-out motion-reduce:transition-none " +
|
|
72
|
-
(visible ? "translate-y-0" : "-translate-y-full"), children: [nav.map((item) => item.href.startsWith("/") ? (_jsx(Link, { href: item.href, onClick: close, className: linkClass
|
|
74
|
+
(visible ? "translate-y-0" : "-translate-y-full"), children: [nav.map((item) => item.href.startsWith("/") ? (_jsx(Link, { href: item.href, onClick: close, className: linkClass, children: item.label }, item.label)) : (_jsx("a", { href: item.href, onClick: close, className: linkClass, children: item.label }, item.label))), sidebar ? (_jsxs("div", { className: "mt-4 border-t border-border pt-4", children: [sidebarLabel ? (_jsx("div", { className: "mb-2 text-xs tracking-wide text-foreground-muted uppercase", children: sidebarLabel })) : null, _jsx("div", { onClick: close, children: sidebar })] })) : null, githubUrl ? (_jsx("a", { href: githubUrl, className: "mt-4 rounded-full bg-primary px-4 py-2 text-center text-sm text-primary-foreground", children: "Star us on GitHub" })) : null, showThemeToggle ? (_jsxs("div", { className: "mt-4 flex items-center justify-between border-t border-border pt-4", children: [_jsx("span", { className: "text-sm text-foreground-muted", children: "Theme" }), _jsx(ThemeToggle, {})] })) : null] }) })] }))] }));
|
|
73
75
|
}
|
package/package.json
CHANGED