@umami/shiso 0.21.0 → 0.24.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/index.css +10 -8
- package/dist/index.js +39 -18
- package/dist/index.mjs +46 -19
- package/package.json +2 -2
package/dist/index.css
CHANGED
|
@@ -77,32 +77,34 @@ pre.CodeBlock_container__YmFmN code {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/* virtual-css:css:72ce2cfbba7b635b2ff1a5f4f5eeabf3 */
|
|
80
|
-
.
|
|
80
|
+
.SideNav_nav__YTUyY {
|
|
81
|
+
height: max-content;
|
|
82
|
+
overflow-y: auto;
|
|
83
|
+
}
|
|
84
|
+
.SideNav_nav__YTUyY.SideNav_sticky__NGNiY {
|
|
81
85
|
position: sticky;
|
|
82
86
|
top: 30px;
|
|
83
|
-
height: 100vh;
|
|
84
|
-
overflow-y: auto;
|
|
85
87
|
}
|
|
86
|
-
.
|
|
88
|
+
.SideNav_nav__YTUyY .SideNav_item__ZjUyN {
|
|
87
89
|
color: var(--font-color-muted);
|
|
88
90
|
padding: 0;
|
|
89
91
|
border-radius: 0;
|
|
90
92
|
border-left: var(--border-size-1) solid var(--border-color);
|
|
91
93
|
}
|
|
92
|
-
.
|
|
94
|
+
.SideNav_nav__YTUyY .SideNav_item__ZjUyN a {
|
|
93
95
|
color: currentColor;
|
|
94
96
|
width: 100%;
|
|
95
97
|
padding: var(--padding-y) var(--padding-x);
|
|
96
98
|
text-decoration: none;
|
|
97
99
|
}
|
|
98
|
-
.
|
|
100
|
+
.SideNav_nav__YTUyY .SideNav_item__ZjUyN a:hover {
|
|
99
101
|
color: var(--primary-color);
|
|
100
102
|
}
|
|
101
|
-
.
|
|
103
|
+
.SideNav_nav__YTUyY .SideNav_item__ZjUyN.SideNav_selected__OWI5N {
|
|
102
104
|
color: var(--font-color);
|
|
103
105
|
border-color: var(--primary-color);
|
|
104
106
|
}
|
|
105
|
-
.
|
|
107
|
+
.SideNav_items__OThkZ header {
|
|
106
108
|
padding: var(--padding-y) 0;
|
|
107
109
|
}
|
|
108
110
|
|
package/dist/index.js
CHANGED
|
@@ -207,15 +207,15 @@ var import_navigation = require("next/navigation");
|
|
|
207
207
|
var import_link = __toESM(require("next/link"));
|
|
208
208
|
|
|
209
209
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
|
|
210
|
-
var SideNav_default = { "nav": "
|
|
210
|
+
var SideNav_default = { "nav": "SideNav_nav__YTUyY", "sticky": "SideNav_sticky__NGNiY", "item": "SideNav_item__ZjUyN", "selected": "SideNav_selected__OWI5N", "items": "SideNav_items__OThkZ" };
|
|
211
211
|
|
|
212
212
|
// src/components/SideNav.tsx
|
|
213
213
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
214
|
-
function SideNav({ tabs, navigation, className, ...props }) {
|
|
214
|
+
function SideNav({ tabs, navigation, isSticky, className, ...props }) {
|
|
215
215
|
const pathname = (0, import_navigation.usePathname)();
|
|
216
216
|
const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
217
217
|
const menu = navigation[tab?.id || "docs"];
|
|
218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.Box, { ...props, className: (0, import_classnames2.default)(SideNav_default.nav, className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.Box, { ...props, className: (0, import_classnames2.default)(SideNav_default.nav, isSticky && SideNav_default.sticky, className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
219
219
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.ListSection, { title: section, className: SideNav_default.items, children: pages.map(({ label: text, url }, index) => {
|
|
220
220
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
221
221
|
import_react_zen6.ListItem,
|
|
@@ -317,23 +317,44 @@ function Docs() {
|
|
|
317
317
|
config?.docs
|
|
318
318
|
);
|
|
319
319
|
const { top } = config?.docs || {};
|
|
320
|
+
const navDisplay = {
|
|
321
|
+
default: "none",
|
|
322
|
+
xs: "none",
|
|
323
|
+
sm: "none",
|
|
324
|
+
md: "none",
|
|
325
|
+
lg: "block",
|
|
326
|
+
xl: "block"
|
|
327
|
+
};
|
|
328
|
+
const menuDisplay = {
|
|
329
|
+
default: "flex",
|
|
330
|
+
lg: "none",
|
|
331
|
+
xl: "none"
|
|
332
|
+
};
|
|
320
333
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.Box, { flexGrow: "1", children: [
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Row, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.MobileMenuButton, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SideNav, { tabs, navigation }) }) }),
|
|
321
335
|
tabs && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TopNav, { tabs }),
|
|
322
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
337
|
+
import_react_zen9.Grid,
|
|
338
|
+
{
|
|
339
|
+
gap: "6",
|
|
340
|
+
columns: { xs: "1fr", sm: "1fr", md: "1fr", lg: "240px 1fr 240px", xl: "240px 1fr 240px" },
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SideNav, { display: navDisplay, tabs, navigation, isSticky: true }),
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
344
|
+
ContentArea,
|
|
345
|
+
{
|
|
346
|
+
section,
|
|
347
|
+
title: meta?.title,
|
|
348
|
+
description: meta?.description,
|
|
349
|
+
code,
|
|
350
|
+
next,
|
|
351
|
+
prev
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PageLinks, { display: navDisplay, items: anchors, style: { top } })
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
)
|
|
337
358
|
] });
|
|
338
359
|
}
|
|
339
360
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -62,7 +62,13 @@ function Blog({ content }) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// src/components/Docs.tsx
|
|
65
|
-
import {
|
|
65
|
+
import {
|
|
66
|
+
Grid,
|
|
67
|
+
Box as Box3,
|
|
68
|
+
Heading as Heading2,
|
|
69
|
+
Row as Row2,
|
|
70
|
+
MobileMenuButton
|
|
71
|
+
} from "@umami/react-zen";
|
|
66
72
|
|
|
67
73
|
// src/components/hooks/useShiso.ts
|
|
68
74
|
import { useContext } from "react";
|
|
@@ -171,15 +177,15 @@ import { usePathname } from "next/navigation";
|
|
|
171
177
|
import Link from "next/link";
|
|
172
178
|
|
|
173
179
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
|
|
174
|
-
var SideNav_default = { "nav": "
|
|
180
|
+
var SideNav_default = { "nav": "SideNav_nav__YTUyY", "sticky": "SideNav_sticky__NGNiY", "item": "SideNav_item__ZjUyN", "selected": "SideNav_selected__OWI5N", "items": "SideNav_items__OThkZ" };
|
|
175
181
|
|
|
176
182
|
// src/components/SideNav.tsx
|
|
177
183
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
178
|
-
function SideNav({ tabs, navigation, className, ...props }) {
|
|
184
|
+
function SideNav({ tabs, navigation, isSticky, className, ...props }) {
|
|
179
185
|
const pathname = usePathname();
|
|
180
186
|
const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
181
187
|
const menu = navigation[tab?.id || "docs"];
|
|
182
|
-
return /* @__PURE__ */ jsx7(Box, { ...props, className: classNames2(SideNav_default.nav, className), children: /* @__PURE__ */ jsx7(List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
188
|
+
return /* @__PURE__ */ jsx7(Box, { ...props, className: classNames2(SideNav_default.nav, isSticky && SideNav_default.sticky, className), children: /* @__PURE__ */ jsx7(List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
183
189
|
return /* @__PURE__ */ jsx7(ListSection, { title: section, className: SideNav_default.items, children: pages.map(({ label: text, url }, index) => {
|
|
184
190
|
return /* @__PURE__ */ jsx7(
|
|
185
191
|
ListItem,
|
|
@@ -281,23 +287,44 @@ function Docs() {
|
|
|
281
287
|
config?.docs
|
|
282
288
|
);
|
|
283
289
|
const { top } = config?.docs || {};
|
|
290
|
+
const navDisplay = {
|
|
291
|
+
default: "none",
|
|
292
|
+
xs: "none",
|
|
293
|
+
sm: "none",
|
|
294
|
+
md: "none",
|
|
295
|
+
lg: "block",
|
|
296
|
+
xl: "block"
|
|
297
|
+
};
|
|
298
|
+
const menuDisplay = {
|
|
299
|
+
default: "flex",
|
|
300
|
+
lg: "none",
|
|
301
|
+
xl: "none"
|
|
302
|
+
};
|
|
284
303
|
return /* @__PURE__ */ jsxs6(Box3, { flexGrow: "1", children: [
|
|
304
|
+
/* @__PURE__ */ jsx10(Row2, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(MobileMenuButton, { children: /* @__PURE__ */ jsx10(SideNav, { tabs, navigation }) }) }),
|
|
285
305
|
tabs && /* @__PURE__ */ jsx10(TopNav, { tabs }),
|
|
286
|
-
/* @__PURE__ */ jsxs6(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
/* @__PURE__ */ jsxs6(
|
|
307
|
+
Grid,
|
|
308
|
+
{
|
|
309
|
+
gap: "6",
|
|
310
|
+
columns: { xs: "1fr", sm: "1fr", md: "1fr", lg: "240px 1fr 240px", xl: "240px 1fr 240px" },
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ jsx10(SideNav, { display: navDisplay, tabs, navigation, isSticky: true }),
|
|
313
|
+
/* @__PURE__ */ jsx10(
|
|
314
|
+
ContentArea,
|
|
315
|
+
{
|
|
316
|
+
section,
|
|
317
|
+
title: meta?.title,
|
|
318
|
+
description: meta?.description,
|
|
319
|
+
code,
|
|
320
|
+
next,
|
|
321
|
+
prev
|
|
322
|
+
}
|
|
323
|
+
),
|
|
324
|
+
/* @__PURE__ */ jsx10(PageLinks, { display: navDisplay, items: anchors, style: { top } })
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
)
|
|
301
328
|
] });
|
|
302
329
|
}
|
|
303
330
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umami/shiso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "A content layer for Next.js",
|
|
5
5
|
"homepage": "https://umami.is/shiso",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@mdx-js/loader": "^3.0.0",
|
|
47
47
|
"@mdx-js/mdx": "^3.1.0",
|
|
48
48
|
"@mdx-js/react": "^3.0.0",
|
|
49
|
-
"@umami/react-zen": "^0.
|
|
49
|
+
"@umami/react-zen": "^0.39.0",
|
|
50
50
|
"classnames": "^2.5.1",
|
|
51
51
|
"glob": "^10.3.10",
|
|
52
52
|
"gray-matter": "^4.0.3",
|