@umami/shiso 0.21.0 → 0.22.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 +52 -18
- package/dist/index.mjs +64 -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,57 @@ 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
|
+
};
|
|
333
|
+
const MobileMenu = () => {
|
|
334
|
+
const handlePress = () => {
|
|
335
|
+
};
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Row, { justifyContent: "flex-end", display: menuDisplay, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.DialogTrigger, { children: [
|
|
337
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Button, { onPress: handlePress, variant: "quiet", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icons.Menu, {}) }) }),
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Modal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Dialog, { children: ({ close }) => {
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.Box, { minWidth: "calc(100vw - 60px)", minHeight: "calc(100vh - 60px)", children: [
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Row, { justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Button, { onPress: () => close(), variant: "quiet", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icons.Close, {}) }) }) }),
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SideNav, { tabs, navigation })
|
|
342
|
+
] });
|
|
343
|
+
} }) })
|
|
344
|
+
] }) });
|
|
345
|
+
};
|
|
320
346
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.Box, { flexGrow: "1", children: [
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MobileMenu, {}),
|
|
321
348
|
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
|
-
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
350
|
+
import_react_zen9.Grid,
|
|
351
|
+
{
|
|
352
|
+
gap: "6",
|
|
353
|
+
columns: { xs: "1fr", sm: "1fr", md: "1fr", lg: "240px 1fr 240px", xl: "240px 1fr 240px" },
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SideNav, { display: navDisplay, tabs, navigation, isSticky: true }),
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
357
|
+
ContentArea,
|
|
358
|
+
{
|
|
359
|
+
section,
|
|
360
|
+
title: meta?.title,
|
|
361
|
+
description: meta?.description,
|
|
362
|
+
code,
|
|
363
|
+
next,
|
|
364
|
+
prev
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PageLinks, { display: navDisplay, items: anchors, style: { top } })
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
)
|
|
337
371
|
] });
|
|
338
372
|
}
|
|
339
373
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -62,7 +62,18 @@ 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
|
+
Button,
|
|
70
|
+
Icon as Icon3,
|
|
71
|
+
Icons as Icons3,
|
|
72
|
+
Row as Row2,
|
|
73
|
+
Modal,
|
|
74
|
+
DialogTrigger,
|
|
75
|
+
Dialog
|
|
76
|
+
} from "@umami/react-zen";
|
|
66
77
|
|
|
67
78
|
// src/components/hooks/useShiso.ts
|
|
68
79
|
import { useContext } from "react";
|
|
@@ -171,15 +182,15 @@ import { usePathname } from "next/navigation";
|
|
|
171
182
|
import Link from "next/link";
|
|
172
183
|
|
|
173
184
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
|
|
174
|
-
var SideNav_default = { "nav": "
|
|
185
|
+
var SideNav_default = { "nav": "SideNav_nav__YTUyY", "sticky": "SideNav_sticky__NGNiY", "item": "SideNav_item__ZjUyN", "selected": "SideNav_selected__OWI5N", "items": "SideNav_items__OThkZ" };
|
|
175
186
|
|
|
176
187
|
// src/components/SideNav.tsx
|
|
177
188
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
178
|
-
function SideNav({ tabs, navigation, className, ...props }) {
|
|
189
|
+
function SideNav({ tabs, navigation, isSticky, className, ...props }) {
|
|
179
190
|
const pathname = usePathname();
|
|
180
191
|
const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
181
192
|
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 }) => {
|
|
193
|
+
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
194
|
return /* @__PURE__ */ jsx7(ListSection, { title: section, className: SideNav_default.items, children: pages.map(({ label: text, url }, index) => {
|
|
184
195
|
return /* @__PURE__ */ jsx7(
|
|
185
196
|
ListItem,
|
|
@@ -281,23 +292,57 @@ function Docs() {
|
|
|
281
292
|
config?.docs
|
|
282
293
|
);
|
|
283
294
|
const { top } = config?.docs || {};
|
|
295
|
+
const navDisplay = {
|
|
296
|
+
default: "none",
|
|
297
|
+
xs: "none",
|
|
298
|
+
sm: "none",
|
|
299
|
+
md: "none",
|
|
300
|
+
lg: "block",
|
|
301
|
+
xl: "block"
|
|
302
|
+
};
|
|
303
|
+
const menuDisplay = {
|
|
304
|
+
default: "flex",
|
|
305
|
+
lg: "none",
|
|
306
|
+
xl: "none"
|
|
307
|
+
};
|
|
308
|
+
const MobileMenu = () => {
|
|
309
|
+
const handlePress = () => {
|
|
310
|
+
};
|
|
311
|
+
return /* @__PURE__ */ jsx10(Row2, { justifyContent: "flex-end", display: menuDisplay, children: /* @__PURE__ */ jsxs6(DialogTrigger, { children: [
|
|
312
|
+
/* @__PURE__ */ jsx10(Button, { onPress: handlePress, variant: "quiet", children: /* @__PURE__ */ jsx10(Icon3, { children: /* @__PURE__ */ jsx10(Icons3.Menu, {}) }) }),
|
|
313
|
+
/* @__PURE__ */ jsx10(Modal, { children: /* @__PURE__ */ jsx10(Dialog, { children: ({ close }) => {
|
|
314
|
+
return /* @__PURE__ */ jsxs6(Box3, { minWidth: "calc(100vw - 60px)", minHeight: "calc(100vh - 60px)", children: [
|
|
315
|
+
/* @__PURE__ */ jsx10(Row2, { justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(Button, { onPress: () => close(), variant: "quiet", children: /* @__PURE__ */ jsx10(Icon3, { children: /* @__PURE__ */ jsx10(Icons3.Close, {}) }) }) }),
|
|
316
|
+
/* @__PURE__ */ jsx10(SideNav, { tabs, navigation })
|
|
317
|
+
] });
|
|
318
|
+
} }) })
|
|
319
|
+
] }) });
|
|
320
|
+
};
|
|
284
321
|
return /* @__PURE__ */ jsxs6(Box3, { flexGrow: "1", children: [
|
|
322
|
+
/* @__PURE__ */ jsx10(MobileMenu, {}),
|
|
285
323
|
tabs && /* @__PURE__ */ jsx10(TopNav, { tabs }),
|
|
286
|
-
/* @__PURE__ */ jsxs6(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
324
|
+
/* @__PURE__ */ jsxs6(
|
|
325
|
+
Grid,
|
|
326
|
+
{
|
|
327
|
+
gap: "6",
|
|
328
|
+
columns: { xs: "1fr", sm: "1fr", md: "1fr", lg: "240px 1fr 240px", xl: "240px 1fr 240px" },
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ jsx10(SideNav, { display: navDisplay, tabs, navigation, isSticky: true }),
|
|
331
|
+
/* @__PURE__ */ jsx10(
|
|
332
|
+
ContentArea,
|
|
333
|
+
{
|
|
334
|
+
section,
|
|
335
|
+
title: meta?.title,
|
|
336
|
+
description: meta?.description,
|
|
337
|
+
code,
|
|
338
|
+
next,
|
|
339
|
+
prev
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ jsx10(PageLinks, { display: navDisplay, items: anchors, style: { top } })
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
)
|
|
301
346
|
] });
|
|
302
347
|
}
|
|
303
348
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umami/shiso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.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.36.0",
|
|
50
50
|
"classnames": "^2.5.1",
|
|
51
51
|
"glob": "^10.3.10",
|
|
52
52
|
"gray-matter": "^4.0.3",
|