@umami/shiso 0.26.0 → 0.27.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 CHANGED
@@ -34,45 +34,41 @@ pre.CodeBlock_container__YmFmN code {
34
34
  }
35
35
 
36
36
  /* virtual-css:css:0ed498f49b21d225f1b5a4e1685cf2e5 */
37
- .PageLinks_title__ZGY1Y {
38
- position: sticky;
39
- top: 0;
40
- }
41
- .PageLinks_links__ODM4N {
37
+ .PageLinks_links__MjgyM {
42
38
  position: sticky;
43
39
  top: 30px;
44
40
  height: max-content;
45
41
  }
46
- .PageLinks_links__ODM4N a.PageLinks_link__ZDE4O {
42
+ .PageLinks_links__MjgyM a.PageLinks_link__YWRjO {
47
43
  display: block;
48
44
  color: var(--font-color-muted);
49
45
  font-size: var(--font-size);
50
46
  text-wrap: nowrap;
51
47
  text-decoration: none;
52
48
  }
53
- .PageLinks_links__ODM4N a.PageLinks_link__ZDE4O:hover {
49
+ .PageLinks_links__MjgyM a.PageLinks_link__YWRjO:hover {
54
50
  color: var(--primary-color);
55
51
  text-decoration: none;
56
52
  }
57
- .PageLinks_indent-1__NGU3M {
53
+ .PageLinks_indent-1__MDcyM {
58
54
  margin-left: 0;
59
55
  }
60
- .PageLinks_indent-2__YjFlN {
56
+ .PageLinks_indent-2__OWYxZ {
61
57
  margin-left: 0;
62
58
  }
63
- .PageLinks_indent-3__NzQxY {
59
+ .PageLinks_indent-3__ZmYwM {
64
60
  margin-left: 10px;
65
61
  }
66
- .PageLinks_indent-4__NzRjN {
62
+ .PageLinks_indent-4__NzU2Y {
67
63
  margin-left: 20px;
68
64
  }
69
- .PageLinks_indent-5__ZmRhN {
65
+ .PageLinks_indent-5__NmVkY {
70
66
  margin-left: 30px;
71
67
  }
72
- .PageLinks_indent-6__YzQ3N {
68
+ .PageLinks_indent-6__NzQ4N {
73
69
  margin-left: 40px;
74
70
  }
75
- .PageLinks_links__ODM4N a.PageLinks_selected__NTViM {
71
+ .PageLinks_links__MjgyM a.PageLinks_selected__YmZhY {
76
72
  color: var(--primary-color);
77
73
  }
78
74
 
package/dist/index.js CHANGED
@@ -160,7 +160,7 @@ var import_react_zen5 = require("@umami/react-zen");
160
160
  var import_classnames = __toESM(require("classnames"));
161
161
 
162
162
  // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/PageLinks.module.css
163
- var PageLinks_default = { "title": "PageLinks_title__ZGY1Y", "links": "PageLinks_links__ODM4N", "link": "PageLinks_link__ZDE4O", "indent-1": "PageLinks_indent-1__NGU3M", "indent-2": "PageLinks_indent-2__YjFlN", "indent-3": "PageLinks_indent-3__NzQxY", "indent-4": "PageLinks_indent-4__NzRjN", "indent-5": "PageLinks_indent-5__ZmRhN", "indent-6": "PageLinks_indent-6__YzQ3N", "selected": "PageLinks_selected__NTViM" };
163
+ var PageLinks_default = { "links": "PageLinks_links__MjgyM", "link": "PageLinks_link__YWRjO", "indent-1": "PageLinks_indent-1__MDcyM", "indent-2": "PageLinks_indent-2__OWYxZ", "indent-3": "PageLinks_indent-3__ZmYwM", "indent-4": "PageLinks_indent-4__NzU2Y", "indent-5": "PageLinks_indent-5__NmVkY", "indent-6": "PageLinks_indent-6__NzQ4N", "selected": "PageLinks_selected__YmZhY" };
164
164
 
165
165
  // src/components/PageLinks.tsx
166
166
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -212,17 +212,27 @@ var SideNav_default = { "nav": "SideNav_nav__MDQ3Z", "sticky": "SideNav_sticky__
212
212
 
213
213
  // src/components/SideNav.tsx
214
214
  var import_jsx_runtime7 = require("react/jsx-runtime");
215
- function SideNav({ tabs, navigation, isSticky, className, style, ...props }) {
215
+ function SideNav({
216
+ tabs,
217
+ navigation,
218
+ isSticky,
219
+ autoHeight,
220
+ className,
221
+ style,
222
+ ...props
223
+ }) {
216
224
  const pathname = (0, import_navigation.usePathname)();
217
225
  const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
218
226
  const menu = navigation[tab?.id || "docs"];
219
227
  const [height, setHeight] = (0, import_react7.useState)();
220
228
  (0, import_react7.useEffect)(() => {
221
- const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
222
- if (rect) {
223
- setHeight(`${window.innerHeight - rect.top - 10}px`);
229
+ if (autoHeight) {
230
+ const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
231
+ if (rect) {
232
+ setHeight(`${window.innerHeight - rect.top - 10}px`);
233
+ }
224
234
  }
225
- }, []);
235
+ }, [autoHeight]);
226
236
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
227
237
  import_react_zen6.Box,
228
238
  {
@@ -347,8 +357,20 @@ function Docs() {
347
357
  lg: "none",
348
358
  xl: "none"
349
359
  };
360
+ const MobileMenuButton = () => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.DialogTrigger, { children: [
361
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.Button, { children: [
362
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icons.Menu, {}) }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Text, { children: "Menu" })
364
+ ] }),
365
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Modal, { position: "bottom", offset: "40px", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Dialog, { variant: "sheet", children: ({ close }) => {
366
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
367
+ /* @__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, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Icons.Close, {}) }) }) }),
368
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Box, { height: "100%", overflow: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SideNav, { tabs, navigation }) })
369
+ ] });
370
+ } }) })
371
+ ] });
350
372
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_zen9.Box, { flexGrow: "1", children: [
351
- /* @__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 }) }) }),
373
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_zen9.Row, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MobileMenuButton, {}) }),
352
374
  tabs && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TopNav, { tabs }),
353
375
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
354
376
  import_react_zen9.Grid,
@@ -363,7 +385,8 @@ function Docs() {
363
385
  tabs,
364
386
  navigation,
365
387
  style: { top },
366
- isSticky: true
388
+ isSticky: true,
389
+ autoHeight: true
367
390
  }
368
391
  ),
369
392
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
package/dist/index.mjs CHANGED
@@ -66,8 +66,14 @@ import {
66
66
  Grid,
67
67
  Box as Box4,
68
68
  Heading as Heading2,
69
+ Button,
70
+ Icon as Icon3,
71
+ Icons as Icons3,
69
72
  Row as Row2,
70
- MobileMenuButton
73
+ Modal,
74
+ DialogTrigger,
75
+ Dialog,
76
+ Text as Text3
71
77
  } from "@umami/react-zen";
72
78
 
73
79
  // src/components/hooks/useShiso.ts
@@ -130,7 +136,7 @@ import { Column as Column3, Text, Box } from "@umami/react-zen";
130
136
  import classNames from "classnames";
131
137
 
132
138
  // css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/PageLinks.module.css
133
- var PageLinks_default = { "title": "PageLinks_title__ZGY1Y", "links": "PageLinks_links__ODM4N", "link": "PageLinks_link__ZDE4O", "indent-1": "PageLinks_indent-1__NGU3M", "indent-2": "PageLinks_indent-2__YjFlN", "indent-3": "PageLinks_indent-3__NzQxY", "indent-4": "PageLinks_indent-4__NzRjN", "indent-5": "PageLinks_indent-5__ZmRhN", "indent-6": "PageLinks_indent-6__YzQ3N", "selected": "PageLinks_selected__NTViM" };
139
+ var PageLinks_default = { "links": "PageLinks_links__MjgyM", "link": "PageLinks_link__YWRjO", "indent-1": "PageLinks_indent-1__MDcyM", "indent-2": "PageLinks_indent-2__OWYxZ", "indent-3": "PageLinks_indent-3__ZmYwM", "indent-4": "PageLinks_indent-4__NzU2Y", "indent-5": "PageLinks_indent-5__NmVkY", "indent-6": "PageLinks_indent-6__NzQ4N", "selected": "PageLinks_selected__YmZhY" };
134
140
 
135
141
  // src/components/PageLinks.tsx
136
142
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
@@ -182,17 +188,27 @@ var SideNav_default = { "nav": "SideNav_nav__MDQ3Z", "sticky": "SideNav_sticky__
182
188
 
183
189
  // src/components/SideNav.tsx
184
190
  import { jsx as jsx7 } from "react/jsx-runtime";
185
- function SideNav({ tabs, navigation, isSticky, className, style, ...props }) {
191
+ function SideNav({
192
+ tabs,
193
+ navigation,
194
+ isSticky,
195
+ autoHeight,
196
+ className,
197
+ style,
198
+ ...props
199
+ }) {
186
200
  const pathname = usePathname();
187
201
  const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
188
202
  const menu = navigation[tab?.id || "docs"];
189
203
  const [height, setHeight] = useState3();
190
204
  useEffect2(() => {
191
- const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
192
- if (rect) {
193
- setHeight(`${window.innerHeight - rect.top - 10}px`);
205
+ if (autoHeight) {
206
+ const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
207
+ if (rect) {
208
+ setHeight(`${window.innerHeight - rect.top - 10}px`);
209
+ }
194
210
  }
195
- }, []);
211
+ }, [autoHeight]);
196
212
  return /* @__PURE__ */ jsx7(
197
213
  Box2,
198
214
  {
@@ -269,7 +285,7 @@ var NavigationButton = ({
269
285
  };
270
286
 
271
287
  // src/components/Docs.tsx
272
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
288
+ import { Fragment, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
273
289
  function parseContent(content, config = {}) {
274
290
  const { tabs, navigation } = config;
275
291
  const keys = Object.keys(navigation);
@@ -317,8 +333,20 @@ function Docs() {
317
333
  lg: "none",
318
334
  xl: "none"
319
335
  };
336
+ const MobileMenuButton = () => /* @__PURE__ */ jsxs6(DialogTrigger, { children: [
337
+ /* @__PURE__ */ jsxs6(Button, { children: [
338
+ /* @__PURE__ */ jsx10(Icon3, { children: /* @__PURE__ */ jsx10(Icons3.Menu, {}) }),
339
+ /* @__PURE__ */ jsx10(Text3, { children: "Menu" })
340
+ ] }),
341
+ /* @__PURE__ */ jsx10(Modal, { position: "bottom", offset: "40px", children: /* @__PURE__ */ jsx10(Dialog, { variant: "sheet", children: ({ close }) => {
342
+ return /* @__PURE__ */ jsxs6(Fragment, { children: [
343
+ /* @__PURE__ */ jsx10(Row2, { justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(Button, { onPress: () => close(), variant: "quiet", children: /* @__PURE__ */ jsx10(Icon3, { size: "sm", children: /* @__PURE__ */ jsx10(Icons3.Close, {}) }) }) }),
344
+ /* @__PURE__ */ jsx10(Box4, { height: "100%", overflow: "auto", children: /* @__PURE__ */ jsx10(SideNav, { tabs, navigation }) })
345
+ ] });
346
+ } }) })
347
+ ] });
320
348
  return /* @__PURE__ */ jsxs6(Box4, { flexGrow: "1", children: [
321
- /* @__PURE__ */ jsx10(Row2, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(MobileMenuButton, { children: /* @__PURE__ */ jsx10(SideNav, { tabs, navigation }) }) }),
349
+ /* @__PURE__ */ jsx10(Row2, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(MobileMenuButton, {}) }),
322
350
  tabs && /* @__PURE__ */ jsx10(TopNav, { tabs }),
323
351
  /* @__PURE__ */ jsxs6(
324
352
  Grid,
@@ -333,7 +361,8 @@ function Docs() {
333
361
  tabs,
334
362
  navigation,
335
363
  style: { top },
336
- isSticky: true
364
+ isSticky: true,
365
+ autoHeight: true
337
366
  }
338
367
  ),
339
368
  /* @__PURE__ */ jsx10(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/shiso",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "A content layer for Next.js",
5
5
  "homepage": "https://umami.is/shiso",
6
6
  "repository": {
@@ -46,12 +46,12 @@
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.39.0",
49
+ "@umami/react-zen": "^0.41.0",
50
50
  "classnames": "^2.5.1",
51
51
  "glob": "^10.3.10",
52
52
  "gray-matter": "^4.0.3",
53
- "highlight.js": "^11.11.0",
54
- "next": "15.1.2",
53
+ "highlight.js": "^11.11.1",
54
+ "next": "15.1.3",
55
55
  "next-mdx-remote": "^5.0.0",
56
56
  "react": "^19.0.0",
57
57
  "react-dom": "^19.0.0",
@@ -65,7 +65,7 @@
65
65
  "@svgr/webpack": "^8.1.0",
66
66
  "@types/css-modules": "^1.0.5",
67
67
  "@types/mdx": "^2.0.11",
68
- "@types/node": "^22.10.2",
68
+ "@types/node": "^22.10.4",
69
69
  "@types/react": "^19.0.2",
70
70
  "@types/react-dom": "^19.0.2",
71
71
  "@umami/esbuild-plugin-css-modules": "^0.4.0",
@@ -73,13 +73,13 @@
73
73
  "esbuild": "^0.24.2",
74
74
  "esbuild-plugin-css-modules": "^0.3.0",
75
75
  "eslint": "^8",
76
- "eslint-config-next": "15.0.2",
76
+ "eslint-config-next": "15.1.3",
77
77
  "eslint-config-prettier": "^9.1.0",
78
78
  "eslint-import-resolver-alias": "^1.1.2",
79
79
  "eslint-plugin-import": "^2.29.1",
80
80
  "eslint-plugin-prettier": "^5.1.3",
81
81
  "husky": "^9.1.1",
82
- "lint-staged": "^15.2.7",
82
+ "lint-staged": "^15.3.0",
83
83
  "npm-run-all": "^4.1.5",
84
84
  "prettier": "^3.2.5",
85
85
  "remark-frontmatter": "^5.0.0",