@themodcraft/addon-docs 1.1.0 → 1.1.1
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.
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { LicenseGate } from "@themodcraft/license-client";
|
|
4
|
-
import styles from "./DocsSidebar.module.css";
|
|
5
|
-
function defaultNormalizeHref(href) {
|
|
6
|
-
return href.split("#")[0] || "/";
|
|
7
|
-
}
|
|
8
|
-
export function DocsSidebar({ className, currentPath, footer, groups, normalizeHref = defaultNormalizeHref, title, version, ...props }) {
|
|
9
|
-
return (_jsx(LicenseGate, { required: "addon-docs", children: _jsx("aside", { className: [styles.sidebar, className].filter(Boolean).join(" "), ...props, children: _jsxs("div", { className: styles.inner, children: [title || version ? (_jsxs("div", { className: styles.brand, children: [title ? _jsx("p", { className: styles.title, children: title }) : null, version ? _jsx("p", { className: styles.version, children: version }) : null] })) : null, _jsx("nav", { className: styles.nav, children: groups.map((group, groupIndex) => (_jsxs("section", { className: styles.group, children: [_jsx("p", { className: styles.groupLabel, children: group.label }), _jsx("div", { className: styles.groupItems, children: group.items.map((item) => {
|
|
10
|
-
const active = Boolean(currentPath && !item.href.includes("#") && normalizeHref(item.href) === currentPath);
|
|
11
|
-
return (_jsxs("a", { "aria-current": active ? "page" : undefined, className: [styles.link, active ? styles.linkActive : ""].filter(Boolean).join(" "), href: item.href, children: [_jsx("span", { className: styles.label, children: item.label }), item.badge ? _jsx("span", { className: styles.badge, children: item.badge }) : null] }, item.href));
|
|
12
|
-
}) })] }, `${String(group.label)}-${groupIndex}`))) }), footer ? _jsx("div", { className: styles.footer, children: footer }) : null] }) }) }));
|
|
13
|
-
}
|
|
1
|
+
"use client";import{jsx as l,jsxs as s}from"react/jsx-runtime";import{LicenseGate as t}from"@themodcraft/license-client";import e from"./DocsSidebar.module.css";function N(n){return n.split("#")[0]||"/"}function j({className:n,currentPath:d,footer:o,groups:m,normalizeHref:u=N,title:r,version:c,...f}){return l(t,{required:"addon-docs",children:l("aside",{className:[e.sidebar,n].filter(Boolean).join(" "),...f,children:s("div",{className:e.inner,children:[r||c?s("div",{className:e.brand,children:[r?l("p",{className:e.title,children:r}):null,c?l("p",{className:e.version,children:c}):null]}):null,l("nav",{className:e.nav,children:m.map((i,p)=>s("section",{className:e.group,children:[l("p",{className:e.groupLabel,children:i.label}),l("div",{className:e.groupItems,children:i.items.map(a=>{const h=!!(d&&!a.href.includes("#")&&u(a.href)===d);return s("a",{"aria-current":h?"page":void 0,className:[e.link,h?e.linkActive:""].filter(Boolean).join(" "),href:a.href,children:[l("span",{className:e.label,children:a.label}),a.badge?l("span",{className:e.badge,children:a.badge}):null]},a.href)})})]},`${String(i.label)}-${p}`))}),o?l("div",{className:e.footer,children:o}):null]})})})}export{j as DocsSidebar};
|
|
@@ -1,113 +1 @@
|
|
|
1
|
-
.sidebar {
|
|
2
|
-
--tmc-docs-sidebar-background: var(--tmc-color-surface-raised, #ffffff);
|
|
3
|
-
--tmc-docs-sidebar-border: var(--tmc-color-border, #d7dde5);
|
|
4
|
-
--tmc-docs-sidebar-card-background: var(--tmc-color-surface-raised, #ffffff);
|
|
5
|
-
--tmc-docs-sidebar-heading: var(--tmc-color-text, #151821);
|
|
6
|
-
--tmc-docs-sidebar-muted: var(--tmc-color-text-muted, #5f6b7a);
|
|
7
|
-
--tmc-docs-sidebar-link: var(--tmc-color-text-muted, #4a5565);
|
|
8
|
-
--tmc-docs-sidebar-link-active-background: var(--tmc-color-text, #151821);
|
|
9
|
-
--tmc-docs-sidebar-link-active-text: var(--tmc-color-surface, #ffffff);
|
|
10
|
-
--tmc-docs-sidebar-link-hover: var(--tmc-color-hover, color-mix(in srgb, var(--tmc-color-accent, #2454d6) 10%, transparent));
|
|
11
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
12
|
-
display: block;
|
|
13
|
-
width: 100%;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.inner {
|
|
17
|
-
max-height: calc(100vh - 96px);
|
|
18
|
-
overflow-y: auto;
|
|
19
|
-
padding-right: 1rem;
|
|
20
|
-
position: sticky;
|
|
21
|
-
top: 82px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.brand {
|
|
25
|
-
background: var(--tmc-docs-sidebar-card-background);
|
|
26
|
-
border: 1px solid var(--tmc-docs-sidebar-border);
|
|
27
|
-
border-radius: 8px;
|
|
28
|
-
box-shadow: 0 10px 26px rgb(20 24 33 / 0.06);
|
|
29
|
-
margin-bottom: 1.25rem;
|
|
30
|
-
padding: 0.75rem;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.title {
|
|
34
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
35
|
-
font-size: 0.92rem;
|
|
36
|
-
font-weight: 750;
|
|
37
|
-
margin: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.version {
|
|
41
|
-
color: var(--tmc-docs-sidebar-muted);
|
|
42
|
-
font-size: 0.78rem;
|
|
43
|
-
margin: 0.25rem 0 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.nav {
|
|
47
|
-
display: grid;
|
|
48
|
-
font-size: 0.9rem;
|
|
49
|
-
gap: 1.5rem;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.group {
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.groupLabel {
|
|
57
|
-
color: var(--tmc-docs-sidebar-muted);
|
|
58
|
-
font-size: 0.72rem;
|
|
59
|
-
font-weight: 800;
|
|
60
|
-
letter-spacing: 0.14em;
|
|
61
|
-
margin: 0 0 0.5rem;
|
|
62
|
-
padding: 0 0.5rem;
|
|
63
|
-
text-transform: uppercase;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.groupItems {
|
|
67
|
-
display: grid;
|
|
68
|
-
gap: 0.25rem;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.link {
|
|
72
|
-
align-items: center;
|
|
73
|
-
border-radius: 7px;
|
|
74
|
-
color: var(--tmc-docs-sidebar-link);
|
|
75
|
-
display: flex;
|
|
76
|
-
gap: 0.5rem;
|
|
77
|
-
justify-content: space-between;
|
|
78
|
-
min-height: 2rem;
|
|
79
|
-
padding: 0.4rem 0.5rem;
|
|
80
|
-
text-decoration: none;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.link:hover {
|
|
84
|
-
background: var(--tmc-docs-sidebar-link-hover);
|
|
85
|
-
color: var(--tmc-docs-sidebar-heading);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.linkActive {
|
|
89
|
-
background: var(--tmc-docs-sidebar-link-active-background);
|
|
90
|
-
color: var(--tmc-docs-sidebar-link-active-text);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.linkActive:hover {
|
|
94
|
-
background: var(--tmc-docs-sidebar-link-active-background);
|
|
95
|
-
color: var(--tmc-docs-sidebar-link-active-text);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.label {
|
|
99
|
-
overflow: hidden;
|
|
100
|
-
text-overflow: ellipsis;
|
|
101
|
-
white-space: nowrap;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.badge {
|
|
105
|
-
color: inherit;
|
|
106
|
-
flex: 0 0 auto;
|
|
107
|
-
font-size: 0.74rem;
|
|
108
|
-
opacity: 0.72;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.footer {
|
|
112
|
-
margin-top: 1.5rem;
|
|
113
|
-
}
|
|
1
|
+
.o{--tmc-docs-sidebar-background: var(--tmc-color-surface-raised, #ffffff);--tmc-docs-sidebar-border: var(--tmc-color-border, #d7dde5);--tmc-docs-sidebar-card-background: var(--tmc-color-surface-raised, #ffffff);--tmc-docs-sidebar-heading: var(--tmc-color-text, #151821);--tmc-docs-sidebar-muted: var(--tmc-color-text-muted, #5f6b7a);--tmc-docs-sidebar-link: var(--tmc-color-text-muted, #4a5565);--tmc-docs-sidebar-link-active-background: var(--tmc-color-text, #151821);--tmc-docs-sidebar-link-active-text: var(--tmc-color-surface, #ffffff);--tmc-docs-sidebar-link-hover: var(--tmc-color-hover, color-mix(in srgb, var(--tmc-color-accent, #2454d6) 10%, transparent));color:var(--tmc-docs-sidebar-heading);display:block;width:100%}.a{max-height:calc(100vh - 96px);overflow-y:auto;padding-right:1rem;position:sticky;top:82px}.c{background:var(--tmc-docs-sidebar-card-background);border:1px solid var(--tmc-docs-sidebar-border);border-radius:8px;box-shadow:0 10px 26px #1418210f;margin-bottom:1.25rem;padding:.75rem}.t{color:var(--tmc-docs-sidebar-heading);font-size:.92rem;font-weight:750;margin:0}.d{color:var(--tmc-docs-sidebar-muted);font-size:.78rem;margin:.25rem 0 0}.i{display:grid;font-size:.9rem;gap:1.5rem}.s{margin:0}.m{color:var(--tmc-docs-sidebar-muted);font-size:.72rem;font-weight:800;letter-spacing:.14em;margin:0 0 .5rem;padding:0 .5rem;text-transform:uppercase}.n{display:grid;gap:.25rem}.r{align-items:center;border-radius:7px;color:var(--tmc-docs-sidebar-link);display:flex;gap:.5rem;justify-content:space-between;min-height:2rem;padding:.4rem .5rem;text-decoration:none}.r:hover{background:var(--tmc-docs-sidebar-link-hover);color:var(--tmc-docs-sidebar-heading)}.e,.e:hover{background:var(--tmc-docs-sidebar-link-active-background);color:var(--tmc-docs-sidebar-link-active-text)}.l{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.b{color:inherit;flex:0 0 auto;font-size:.74rem;opacity:.72}.g{margin-top:1.5rem}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{DocsSidebar as e}from"./DocsSidebar";export{e as DocsSidebar};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export*from"./docs-sidebar";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themodcraft/addon-docs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@themodcraft/license-client": "1.1.
|
|
26
|
+
"@themodcraft/license-client": "1.1.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^19.0.0",
|