@umami/shiso 0.25.0 → 0.26.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 +7 -8
- package/dist/index.js +38 -21
- package/dist/index.mjs +46 -29
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -77,33 +77,32 @@ pre.CodeBlock_container__YmFmN code {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/* virtual-css:css:72ce2cfbba7b635b2ff1a5f4f5eeabf3 */
|
|
80
|
-
.
|
|
81
|
-
height: max-content;
|
|
80
|
+
.SideNav_nav__MDQ3Z {
|
|
82
81
|
overflow-y: auto;
|
|
83
82
|
}
|
|
84
|
-
.
|
|
83
|
+
.SideNav_nav__MDQ3Z.SideNav_sticky__ZjQ5Y {
|
|
85
84
|
position: sticky;
|
|
86
85
|
}
|
|
87
|
-
.
|
|
86
|
+
.SideNav_nav__MDQ3Z .SideNav_item__ZWU3Z {
|
|
88
87
|
color: var(--font-color-muted);
|
|
89
88
|
padding: 0;
|
|
90
89
|
border-radius: 0;
|
|
91
90
|
border-left: var(--border-size-1) solid var(--border-color);
|
|
92
91
|
}
|
|
93
|
-
.
|
|
92
|
+
.SideNav_nav__MDQ3Z .SideNav_item__ZWU3Z a {
|
|
94
93
|
color: currentColor;
|
|
95
94
|
width: 100%;
|
|
96
95
|
padding: var(--padding-y) var(--padding-x);
|
|
97
96
|
text-decoration: none;
|
|
98
97
|
}
|
|
99
|
-
.
|
|
98
|
+
.SideNav_nav__MDQ3Z .SideNav_item__ZWU3Z a:hover {
|
|
100
99
|
color: var(--primary-color);
|
|
101
100
|
}
|
|
102
|
-
.
|
|
101
|
+
.SideNav_nav__MDQ3Z .SideNav_item__ZWU3Z.SideNav_selected__NDgxN {
|
|
103
102
|
color: var(--font-color);
|
|
104
103
|
border-color: var(--primary-color);
|
|
105
104
|
}
|
|
106
|
-
.
|
|
105
|
+
.SideNav_items__MzBhY header {
|
|
107
106
|
padding: var(--padding-y) 0;
|
|
108
107
|
}
|
|
109
108
|
|
package/dist/index.js
CHANGED
|
@@ -182,7 +182,7 @@ function PageLinks({ items = [], className, ...props }) {
|
|
|
182
182
|
if (!items?.length) {
|
|
183
183
|
return null;
|
|
184
184
|
}
|
|
185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen5.Box, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_zen5.Column, { gap: "3", minWidth: "240px", className: (0, import_classnames.default)(PageLinks_default.links, className), children: [
|
|
186
186
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen5.Text, { size: "2", weight: "bold", children: "On this page" }),
|
|
187
187
|
items.map(({ name, id, size }) => {
|
|
188
188
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -197,38 +197,55 @@ function PageLinks({ items = [], className, ...props }) {
|
|
|
197
197
|
id
|
|
198
198
|
);
|
|
199
199
|
})
|
|
200
|
-
] });
|
|
200
|
+
] }) });
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// src/components/SideNav.tsx
|
|
204
|
+
var import_react7 = require("react");
|
|
204
205
|
var import_react_zen6 = require("@umami/react-zen");
|
|
205
206
|
var import_classnames2 = __toESM(require("classnames"));
|
|
206
207
|
var import_navigation = require("next/navigation");
|
|
207
208
|
var import_link = __toESM(require("next/link"));
|
|
208
209
|
|
|
209
210
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
|
|
210
|
-
var SideNav_default = { "nav": "
|
|
211
|
+
var SideNav_default = { "nav": "SideNav_nav__MDQ3Z", "sticky": "SideNav_sticky__ZjQ5Y", "item": "SideNav_item__ZWU3Z", "selected": "SideNav_selected__NDgxN", "items": "SideNav_items__MzBhY" };
|
|
211
212
|
|
|
212
213
|
// src/components/SideNav.tsx
|
|
213
214
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
214
|
-
function SideNav({ tabs, navigation, isSticky, className, ...props }) {
|
|
215
|
+
function SideNav({ tabs, navigation, isSticky, className, style, ...props }) {
|
|
215
216
|
const pathname = (0, import_navigation.usePathname)();
|
|
216
217
|
const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
217
218
|
const menu = navigation[tab?.id || "docs"];
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
const [height, setHeight] = (0, import_react7.useState)();
|
|
220
|
+
(0, import_react7.useEffect)(() => {
|
|
221
|
+
const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
|
|
222
|
+
if (rect) {
|
|
223
|
+
setHeight(`${window.innerHeight - rect.top - 10}px`);
|
|
224
|
+
}
|
|
225
|
+
}, []);
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
227
|
+
import_react_zen6.Box,
|
|
228
|
+
{
|
|
229
|
+
...props,
|
|
230
|
+
id: "shiso_docs_sidenav",
|
|
231
|
+
className: (0, import_classnames2.default)(SideNav_default.nav, isSticky && SideNav_default.sticky, className),
|
|
232
|
+
style: { ...style, height },
|
|
233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_zen6.ListSection, { title: section, className: SideNav_default.items, children: pages.map(({ label: text, url }, index) => {
|
|
235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
236
|
+
import_react_zen6.ListItem,
|
|
237
|
+
{
|
|
238
|
+
className: (0, import_classnames2.default)(SideNav_default.item, {
|
|
239
|
+
[SideNav_default.selected]: url === pathname
|
|
240
|
+
}),
|
|
241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_link.default, { href: url, prefetch: false, children: text })
|
|
242
|
+
},
|
|
243
|
+
index
|
|
244
|
+
);
|
|
245
|
+
}) }, section);
|
|
246
|
+
}) })
|
|
247
|
+
}
|
|
248
|
+
);
|
|
232
249
|
}
|
|
233
250
|
|
|
234
251
|
// src/components/TopNav.tsx
|
|
@@ -322,11 +339,11 @@ function Docs() {
|
|
|
322
339
|
xs: "none",
|
|
323
340
|
sm: "none",
|
|
324
341
|
md: "none",
|
|
325
|
-
lg: "
|
|
326
|
-
xl: "
|
|
342
|
+
lg: "block",
|
|
343
|
+
xl: "block"
|
|
327
344
|
};
|
|
328
345
|
const menuDisplay = {
|
|
329
|
-
default: "
|
|
346
|
+
default: "block",
|
|
330
347
|
lg: "none",
|
|
331
348
|
xl: "none"
|
|
332
349
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -64,7 +64,7 @@ function Blog({ content }) {
|
|
|
64
64
|
// src/components/Docs.tsx
|
|
65
65
|
import {
|
|
66
66
|
Grid,
|
|
67
|
-
Box as
|
|
67
|
+
Box as Box4,
|
|
68
68
|
Heading as Heading2,
|
|
69
69
|
Row as Row2,
|
|
70
70
|
MobileMenuButton
|
|
@@ -126,7 +126,7 @@ function useShiso() {
|
|
|
126
126
|
|
|
127
127
|
// src/components/PageLinks.tsx
|
|
128
128
|
import { useEffect, useState as useState2 } from "react";
|
|
129
|
-
import { Column as Column3, Text } from "@umami/react-zen";
|
|
129
|
+
import { Column as Column3, Text, Box } from "@umami/react-zen";
|
|
130
130
|
import classNames from "classnames";
|
|
131
131
|
|
|
132
132
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/PageLinks.module.css
|
|
@@ -152,7 +152,7 @@ function PageLinks({ items = [], className, ...props }) {
|
|
|
152
152
|
if (!items?.length) {
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
155
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ jsx6(Box, { ...props, children: /* @__PURE__ */ jsxs4(Column3, { gap: "3", minWidth: "240px", className: classNames(PageLinks_default.links, className), children: [
|
|
156
156
|
/* @__PURE__ */ jsx6(Text, { size: "2", weight: "bold", children: "On this page" }),
|
|
157
157
|
items.map(({ name, id, size }) => {
|
|
158
158
|
return /* @__PURE__ */ jsx6(
|
|
@@ -167,38 +167,55 @@ function PageLinks({ items = [], className, ...props }) {
|
|
|
167
167
|
id
|
|
168
168
|
);
|
|
169
169
|
})
|
|
170
|
-
] });
|
|
170
|
+
] }) });
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
// src/components/SideNav.tsx
|
|
174
|
-
import {
|
|
174
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
175
|
+
import { Box as Box2, List, ListItem, ListSection } from "@umami/react-zen";
|
|
175
176
|
import classNames2 from "classnames";
|
|
176
177
|
import { usePathname } from "next/navigation";
|
|
177
178
|
import Link from "next/link";
|
|
178
179
|
|
|
179
180
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/SideNav.module.css
|
|
180
|
-
var SideNav_default = { "nav": "
|
|
181
|
+
var SideNav_default = { "nav": "SideNav_nav__MDQ3Z", "sticky": "SideNav_sticky__ZjQ5Y", "item": "SideNav_item__ZWU3Z", "selected": "SideNav_selected__NDgxN", "items": "SideNav_items__MzBhY" };
|
|
181
182
|
|
|
182
183
|
// src/components/SideNav.tsx
|
|
183
184
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
184
|
-
function SideNav({ tabs, navigation, isSticky, className, ...props }) {
|
|
185
|
+
function SideNav({ tabs, navigation, isSticky, className, style, ...props }) {
|
|
185
186
|
const pathname = usePathname();
|
|
186
187
|
const tab = tabs?.find(({ url, id }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
187
188
|
const menu = navigation[tab?.id || "docs"];
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
189
|
+
const [height, setHeight] = useState3();
|
|
190
|
+
useEffect2(() => {
|
|
191
|
+
const rect = document.getElementById("shiso_docs_sidenav")?.getBoundingClientRect();
|
|
192
|
+
if (rect) {
|
|
193
|
+
setHeight(`${window.innerHeight - rect.top - 10}px`);
|
|
194
|
+
}
|
|
195
|
+
}, []);
|
|
196
|
+
return /* @__PURE__ */ jsx7(
|
|
197
|
+
Box2,
|
|
198
|
+
{
|
|
199
|
+
...props,
|
|
200
|
+
id: "shiso_docs_sidenav",
|
|
201
|
+
className: classNames2(SideNav_default.nav, isSticky && SideNav_default.sticky, className),
|
|
202
|
+
style: { ...style, height },
|
|
203
|
+
children: /* @__PURE__ */ jsx7(List, { items: navigation, "aria-label": "nav", children: menu.map(({ section, pages }) => {
|
|
204
|
+
return /* @__PURE__ */ jsx7(ListSection, { title: section, className: SideNav_default.items, children: pages.map(({ label: text, url }, index) => {
|
|
205
|
+
return /* @__PURE__ */ jsx7(
|
|
206
|
+
ListItem,
|
|
207
|
+
{
|
|
208
|
+
className: classNames2(SideNav_default.item, {
|
|
209
|
+
[SideNav_default.selected]: url === pathname
|
|
210
|
+
}),
|
|
211
|
+
children: /* @__PURE__ */ jsx7(Link, { href: url, prefetch: false, children: text })
|
|
212
|
+
},
|
|
213
|
+
index
|
|
214
|
+
);
|
|
215
|
+
}) }, section);
|
|
216
|
+
}) })
|
|
217
|
+
}
|
|
218
|
+
);
|
|
202
219
|
}
|
|
203
220
|
|
|
204
221
|
// src/components/TopNav.tsx
|
|
@@ -216,7 +233,7 @@ function TopNav({ tabs }) {
|
|
|
216
233
|
}
|
|
217
234
|
|
|
218
235
|
// src/components/ContentArea.tsx
|
|
219
|
-
import { Heading, Box as
|
|
236
|
+
import { Heading, Box as Box3, Text as Text2, Row, Icon as Icon2, Icons as Icons2 } from "@umami/react-zen";
|
|
220
237
|
|
|
221
238
|
// css-modules:/Users/mikecao/Development/umami-software/shiso/src/components/ContentArea.module.css
|
|
222
239
|
var ContentArea_default = { "content": "ContentArea_content__NDVhM" };
|
|
@@ -225,11 +242,11 @@ var ContentArea_default = { "content": "ContentArea_content__NDVhM" };
|
|
|
225
242
|
import Link3 from "next/link";
|
|
226
243
|
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
227
244
|
function ContentArea({ section, title, description, code, next, prev }) {
|
|
228
|
-
return /* @__PURE__ */ jsxs5(
|
|
245
|
+
return /* @__PURE__ */ jsxs5(Box3, { flexGrow: 1, children: [
|
|
229
246
|
section && /* @__PURE__ */ jsx9(Text2, { color: "primary", weight: "bold", children: section }),
|
|
230
247
|
title && /* @__PURE__ */ jsx9(Heading, { size: "2", as: "h1", children: title }),
|
|
231
248
|
description && /* @__PURE__ */ jsx9(Text2, { color: "muted", children: description }),
|
|
232
|
-
/* @__PURE__ */ jsx9(
|
|
249
|
+
/* @__PURE__ */ jsx9(Box3, { className: ContentArea_default.content, children: /* @__PURE__ */ jsx9(Markdown, { code }) }),
|
|
233
250
|
/* @__PURE__ */ jsxs5(Row, { justifyContent: "space-between", children: [
|
|
234
251
|
/* @__PURE__ */ jsx9(NavigationButton, { ...prev, isPrev: true }),
|
|
235
252
|
/* @__PURE__ */ jsx9(NavigationButton, { ...next })
|
|
@@ -242,7 +259,7 @@ var NavigationButton = ({
|
|
|
242
259
|
isPrev
|
|
243
260
|
}) => {
|
|
244
261
|
if (!url || !label) {
|
|
245
|
-
return /* @__PURE__ */ jsx9(
|
|
262
|
+
return /* @__PURE__ */ jsx9(Box3, {});
|
|
246
263
|
}
|
|
247
264
|
return /* @__PURE__ */ jsx9(Link3, { href: url, children: /* @__PURE__ */ jsxs5(Row, { alignItems: "center", gap: "3", marginY: "3", children: [
|
|
248
265
|
isPrev && /* @__PURE__ */ jsx9(Icon2, { size: "sm", rotate: 180, children: /* @__PURE__ */ jsx9(Icons2.Chevron, {}) }),
|
|
@@ -292,15 +309,15 @@ function Docs() {
|
|
|
292
309
|
xs: "none",
|
|
293
310
|
sm: "none",
|
|
294
311
|
md: "none",
|
|
295
|
-
lg: "
|
|
296
|
-
xl: "
|
|
312
|
+
lg: "block",
|
|
313
|
+
xl: "block"
|
|
297
314
|
};
|
|
298
315
|
const menuDisplay = {
|
|
299
|
-
default: "
|
|
316
|
+
default: "block",
|
|
300
317
|
lg: "none",
|
|
301
318
|
xl: "none"
|
|
302
319
|
};
|
|
303
|
-
return /* @__PURE__ */ jsxs6(
|
|
320
|
+
return /* @__PURE__ */ jsxs6(Box4, { flexGrow: "1", children: [
|
|
304
321
|
/* @__PURE__ */ jsx10(Row2, { display: menuDisplay, justifyContent: "flex-end", children: /* @__PURE__ */ jsx10(MobileMenuButton, { children: /* @__PURE__ */ jsx10(SideNav, { tabs, navigation }) }) }),
|
|
305
322
|
tabs && /* @__PURE__ */ jsx10(TopNav, { tabs }),
|
|
306
323
|
/* @__PURE__ */ jsxs6(
|