@nendlabs/docpage 0.1.3 → 0.1.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/docpage.d.ts.map +1 -1
- package/dist/docpage.js +2 -2
- package/dist/styles/docpage.css +19 -0
- package/package.json +1 -1
- package/styles/docpage-theme.css +17 -0
package/dist/docpage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docpage.d.ts","sourceRoot":"","sources":["../src/docpage.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAKV,YAAY,EAIb,MAAM,SAAS,CAAC;AA6OjB,KAAK,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAiBF,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,2CAmBjD;
|
|
1
|
+
{"version":3,"file":"docpage.d.ts","sourceRoot":"","sources":["../src/docpage.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAKV,YAAY,EAIb,MAAM,SAAS,CAAC;AA6OjB,KAAK,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAiBF,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,2CAmBjD;AAyPD,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,2CAsD1D"}
|
package/dist/docpage.js
CHANGED
|
@@ -192,7 +192,7 @@ function Nav({ config }) {
|
|
|
192
192
|
const signInHref = config.nav?.signInHref ?? "/login";
|
|
193
193
|
const signInTarget = config.nav?.signInTarget;
|
|
194
194
|
const signInRel = config.nav?.signInRel ?? (signInTarget === "_blank" ? "noreferrer" : undefined);
|
|
195
|
-
return (_jsx("div", { className: cn("sticky top-0 z-40 w-full backdrop-blur", scrolled ? "border-b border-border/80 bg-background/80" : "bg-background/60"), "data-docpage-nav": true, children: _jsx(Container, { children: _jsxs("div", { className: "flex h-14 items-center justify-between", children: [_jsx(Brand, { brand: config.brand }), config.nav?.rightSlot ? (config.nav.rightSlot) : (_jsxs("a", { href: signInHref, target: signInTarget, rel: signInRel, className: cn("group inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-xs font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
195
|
+
return (_jsx("div", { className: cn("sticky top-0 z-40 w-full backdrop-blur", scrolled ? "border-b border-border/80 bg-background/80" : "bg-background/60"), "data-docpage-nav": true, children: _jsx(Container, { children: _jsxs("div", { className: "flex h-14 items-center justify-between", children: [_jsx(Brand, { brand: config.brand }), config.nav?.rightSlot ? (config.nav.rightSlot) : (_jsxs("a", { href: signInHref, target: signInTarget, rel: signInRel, className: cn("docpage-nav-button group inline-flex h-8 items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-xs font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"), "data-docpage-signin": true, children: [signInLabel, _jsx(ArrowRight, { className: "ml-1 h-4 w-4 transition-transform group-hover:translate-x-0.5" })] }))] }) }) }));
|
|
196
196
|
}
|
|
197
197
|
function Brand({ brand }) {
|
|
198
198
|
const content = brand.logo ? (_jsx("div", { className: "flex items-center gap-2", children: brand.logo })) : (_jsx("span", { className: "text-sm font-semibold tracking-[0.2em] uppercase", children: brand.name }));
|
|
@@ -250,5 +250,5 @@ export function DocPage({ config, className }) {
|
|
|
250
250
|
const scheme = useColorScheme();
|
|
251
251
|
const themeStyle = themeToStyle(config);
|
|
252
252
|
const mergedStyle = { ...themeStyle, ...(config.style ?? {}) };
|
|
253
|
-
return (_jsxs("div", { className: cn("docpage min-h-[100dvh] overflow-x-hidden bg-background text-foreground", config.className, className), style: mergedStyle, "data-docpage": true, "data-docpage-theme": scheme, children: [_jsx(Nav, { config: config }), _jsx(Header, { config: config }), _jsx(Container, { children: _jsxs("div", { className: "grid grid-cols-1 gap-10 md:grid-cols-[260px_minmax(0,1fr)]", "data-docpage-body": true, children: [_jsx("aside", { className: "hidden max-h-[calc(100vh-7rem)] overflow-auto pr-4 md:sticky md:top-24 md:block", style: isWide ? undefined : { display: "none" }, children: _jsx(Toc, { entries: tocEntries, activeId: tocActiveId, title: tocTitle }) }), _jsx("main", { className: "min-w-0 pb-24", children: _jsx(Prose, { children: config.sections.map((section) => renderSection(section, tocMap)) }) })] }) }), _jsx(Footer, { config: config })] }));
|
|
253
|
+
return (_jsxs("div", { className: cn("docpage min-h-[100dvh] overflow-x-hidden bg-background text-foreground", config.className, className), style: mergedStyle, "data-docpage": true, "data-docpage-theme": scheme, children: [_jsx(Nav, { config: config }), _jsx(Header, { config: config }), _jsx(Container, { children: _jsxs("div", { className: "grid grid-cols-1 gap-10 md:grid-cols-[260px_minmax(0,1fr)]", "data-docpage-body": true, children: [_jsx("aside", { className: "hidden max-h-[calc(100vh-7rem)] overflow-auto pr-4 md:sticky md:top-24 md:block md:self-start", style: isWide ? undefined : { display: "none" }, "data-docpage-toc-rail": true, children: _jsx(Toc, { entries: tocEntries, activeId: tocActiveId, title: tocTitle }) }), _jsx("main", { className: "min-w-0 pb-24", children: _jsx(Prose, { children: config.sections.map((section) => renderSection(section, tocMap)) }) })] }) }), _jsx(Footer, { config: config })] }));
|
|
254
254
|
}
|
package/dist/styles/docpage.css
CHANGED
|
@@ -608,6 +608,11 @@
|
|
|
608
608
|
align-items: flex-end;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
+
.md\:self-start {
|
|
612
|
+
@media (width >= 48rem) {
|
|
613
|
+
align-self: flex-start;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
611
616
|
.lg\:px-8 {
|
|
612
617
|
@media (width >= 64rem) {
|
|
613
618
|
padding-inline: calc(var(--spacing) * 8);
|
|
@@ -770,6 +775,20 @@
|
|
|
770
775
|
.docpage .docpage-prose a:hover {
|
|
771
776
|
opacity: 0.85;
|
|
772
777
|
}
|
|
778
|
+
.docpage [data-docpage-signin] {
|
|
779
|
+
background-color: hsl(var(--primary));
|
|
780
|
+
color: hsl(var(--primary-foreground));
|
|
781
|
+
}
|
|
782
|
+
.docpage [data-docpage-signin]:hover {
|
|
783
|
+
background-color: hsl(var(--primary) / 0.9);
|
|
784
|
+
}
|
|
785
|
+
@media (min-width: 768px) {
|
|
786
|
+
.docpage [data-docpage-toc-rail] {
|
|
787
|
+
position: sticky;
|
|
788
|
+
top: 6rem;
|
|
789
|
+
align-self: start;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
773
792
|
.docpage .docpage-prose :where(h3, h4) {
|
|
774
793
|
margin-top: 1.75rem;
|
|
775
794
|
margin-bottom: 0.75rem;
|
package/package.json
CHANGED
package/styles/docpage-theme.css
CHANGED
|
@@ -102,6 +102,23 @@
|
|
|
102
102
|
opacity: 0.85;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
.docpage [data-docpage-signin] {
|
|
106
|
+
background-color: hsl(var(--primary));
|
|
107
|
+
color: hsl(var(--primary-foreground));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.docpage [data-docpage-signin]:hover {
|
|
111
|
+
background-color: hsl(var(--primary) / 0.9);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@media (min-width: 768px) {
|
|
115
|
+
.docpage [data-docpage-toc-rail] {
|
|
116
|
+
position: sticky;
|
|
117
|
+
top: 6rem;
|
|
118
|
+
align-self: start;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
105
122
|
.docpage .docpage-prose :where(h3, h4) {
|
|
106
123
|
margin-top: 1.75rem;
|
|
107
124
|
margin-bottom: 0.75rem;
|