@mintlify/msft-sdk 0.1.7 → 1.1.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/components/content-components/code-block.js +45 -42
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/code-block.module.css.js +24 -20
- package/dist/components/content-components/code-block.module.css.js.map +1 -1
- package/dist/components/content-components/home.js +188 -0
- package/dist/components/content-components/home.js.map +1 -0
- package/dist/components/content-components/home.module.css.js +74 -0
- package/dist/components/content-components/home.module.css.js.map +1 -0
- package/dist/components/nav-tree/index.js +132 -72
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/components/nav-tree/mobile-nav.js +16 -14
- package/dist/components/nav-tree/mobile-nav.js.map +1 -1
- package/dist/components/nav-tree/nav-tree.module.css.js +40 -24
- package/dist/components/nav-tree/nav-tree.module.css.js.map +1 -1
- package/dist/components/page.js +79 -64
- package/dist/components/page.js.map +1 -1
- package/dist/components/page.module.css.js +28 -24
- package/dist/components/page.module.css.js.map +1 -1
- package/dist/components/toc/toc.module.css.js +8 -8
- package/dist/index.d.ts +16 -3
- package/dist/index.js +39 -37
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,44 +1,83 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { DropdownMenu as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f } from "react";
|
|
3
|
+
import { DropdownMenu as g } from "./dropdown-menu.js";
|
|
4
|
+
import e from "./nav-tree.module.css.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
function N() {
|
|
7
|
+
return /* @__PURE__ */ l("div", { className: e.externalIcon, children: [
|
|
8
|
+
/* @__PURE__ */ r(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
className: e.externalIconLight,
|
|
12
|
+
width: "12",
|
|
13
|
+
height: "12",
|
|
14
|
+
viewBox: "0 0 12 12",
|
|
15
|
+
fill: "none",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
children: /* @__PURE__ */ r(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M2.49999 1C1.67157 1 0.999995 1.67157 0.999995 2.5V9.5C0.999995 10.3284 1.67157 11 2.49999 11H9.49996C10.3284 11 10.9999 10.3284 10.9999 9.5V7.26923C10.9999 6.99309 11.2238 6.76923 11.4999 6.76923C11.7761 6.76923 11.9999 6.99309 11.9999 7.26923V9.5C11.9999 10.8807 10.8807 12 9.49996 12H2.49999C1.11928 12 0 10.8807 0 9.5V2.5C0 1.11929 1.11928 0 2.49999 0H4.73075C5.00689 0 5.23074 0.223858 5.23074 0.5C5.23074 0.776142 5.00689 1 4.73075 1H2.49999ZM6.76926 0.5C6.76926 0.223858 6.99311 0 7.26925 0H11.5C11.7761 0 12 0.223858 12 0.5V4.73077C12 5.00691 11.7761 5.23077 11.5 5.23077C11.2239 5.23077 11 5.00691 11 4.73077V1.70711L7.6228 5.08433C7.42754 5.27959 7.11096 5.27959 6.9157 5.08433C6.72044 4.88906 6.72044 4.57248 6.9157 4.37722L10.2929 1H7.26925C6.99311 1 6.76926 0.776142 6.76926 0.5Z",
|
|
21
|
+
fill: "#707070"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
className: e.externalIconDark,
|
|
30
|
+
width: "12",
|
|
31
|
+
height: "12",
|
|
32
|
+
viewBox: "0 0 12 12",
|
|
33
|
+
fill: "none",
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
children: /* @__PURE__ */ r(
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
d: "M2.49999 1C1.67157 1 0.999995 1.67157 0.999995 2.5V9.5C0.999995 10.3284 1.67157 11 2.49999 11H9.49996C10.3284 11 10.9999 10.3284 10.9999 9.5V7.26923C10.9999 6.99309 11.2238 6.76923 11.4999 6.76923C11.7761 6.76923 11.9999 6.99309 11.9999 7.26923V9.5C11.9999 10.8807 10.8807 12 9.49996 12H2.49999C1.11928 12 0 10.8807 0 9.5V2.5C0 1.11929 1.11928 0 2.49999 0H4.73075C5.00689 0 5.23074 0.223858 5.23074 0.5C5.23074 0.776142 5.00689 1 4.73075 1H2.49999ZM6.76926 0.5C6.76926 0.223858 6.99311 0 7.26925 0H11.5C11.7761 0 12 0.223858 12 0.5V4.73077C12 5.00691 11.7761 5.23077 11.5 5.23077C11.2239 5.23077 11 5.00691 11 4.73077V1.70711L7.6228 5.08433C7.42754 5.27959 7.11096 5.27959 6.9157 5.08433C6.72044 4.88906 6.72044 4.57248 6.9157 4.37722L10.2929 1H7.26925C6.99311 1 6.76926 0.776142 6.76926 0.5Z",
|
|
39
|
+
fill: "#999999"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
function u({ item: n, activeId: c, level: s = 0 }) {
|
|
47
|
+
const p = s === 0 ? !0 : n.expanded ?? !1, [t, m] = f(p), a = n.children && n.children.length > 0, o = a && !n.href, d = n.href && c === n.href, C = n.icon;
|
|
48
|
+
return o && s === 0 ? /* @__PURE__ */ l("div", { className: e.group, role: "group", "aria-label": n.toc_title, children: [
|
|
49
|
+
/* @__PURE__ */ l("div", { className: e.groupHeader, children: [
|
|
50
|
+
C && /* @__PURE__ */ r(C, { className: e.groupIcon, "aria-hidden": "true" }),
|
|
51
|
+
/* @__PURE__ */ r("span", { children: n.toc_title })
|
|
12
52
|
] }),
|
|
13
|
-
|
|
14
|
-
|
|
53
|
+
a && n.children && /* @__PURE__ */ r("ul", { className: e.list, role: "list", children: n.children.map((i, h) => /* @__PURE__ */ r(
|
|
54
|
+
u,
|
|
15
55
|
{
|
|
16
|
-
item:
|
|
56
|
+
item: i,
|
|
17
57
|
activeId: c,
|
|
18
|
-
level:
|
|
58
|
+
level: s + 1
|
|
19
59
|
},
|
|
20
|
-
`${
|
|
60
|
+
`${i.href}-${h}`
|
|
21
61
|
)) })
|
|
22
|
-
] }) :
|
|
23
|
-
/* @__PURE__ */
|
|
62
|
+
] }) : o && s > 0 ? /* @__PURE__ */ l("li", { className: e.listItem, children: [
|
|
63
|
+
/* @__PURE__ */ l(
|
|
24
64
|
"button",
|
|
25
65
|
{
|
|
26
|
-
onClick: () =>
|
|
27
|
-
"aria-expanded":
|
|
28
|
-
"aria-label": `${
|
|
29
|
-
className:
|
|
66
|
+
onClick: () => m(!t),
|
|
67
|
+
"aria-expanded": t,
|
|
68
|
+
"aria-label": `${t ? "Collapse" : "Expand"} ${n.toc_title} section`,
|
|
69
|
+
className: e.expandButton,
|
|
30
70
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */ n(
|
|
71
|
+
/* @__PURE__ */ r("span", { children: n.toc_title }),
|
|
72
|
+
/* @__PURE__ */ r(
|
|
34
73
|
"svg",
|
|
35
74
|
{
|
|
36
|
-
className: `${
|
|
75
|
+
className: `${e.chevron} ${t ? e.chevronExpanded : e.chevronCollapsed}`,
|
|
37
76
|
fill: "none",
|
|
38
77
|
stroke: "currentColor",
|
|
39
78
|
viewBox: "0 0 24 24",
|
|
40
79
|
"aria-hidden": "true",
|
|
41
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ r(
|
|
42
81
|
"path",
|
|
43
82
|
{
|
|
44
83
|
strokeLinecap: "round",
|
|
@@ -52,75 +91,96 @@ function p({ item: e, activeId: c, level: a = 0 }) {
|
|
|
52
91
|
]
|
|
53
92
|
}
|
|
54
93
|
),
|
|
55
|
-
|
|
56
|
-
|
|
94
|
+
a && t && n.children && /* @__PURE__ */ r("ul", { className: e.nestedList, role: "group", children: n.children.map((i, h) => /* @__PURE__ */ r(
|
|
95
|
+
u,
|
|
57
96
|
{
|
|
58
|
-
item:
|
|
97
|
+
item: i,
|
|
59
98
|
activeId: c,
|
|
60
|
-
level:
|
|
99
|
+
level: s + 1
|
|
61
100
|
},
|
|
62
|
-
`${
|
|
101
|
+
`${i.href}-${h}`
|
|
63
102
|
)) })
|
|
64
|
-
] }) : /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
103
|
+
] }) : /* @__PURE__ */ l("li", { className: e.listItem, children: [
|
|
104
|
+
/* @__PURE__ */ r(
|
|
66
105
|
"a",
|
|
67
106
|
{
|
|
68
|
-
href:
|
|
69
|
-
"aria-current":
|
|
70
|
-
className: `${
|
|
71
|
-
children:
|
|
72
|
-
/* @__PURE__ */ n("div", { className: r.hoverIndicator }),
|
|
73
|
-
e.toc_title
|
|
74
|
-
]
|
|
107
|
+
href: n.href,
|
|
108
|
+
"aria-current": d ? "page" : void 0,
|
|
109
|
+
className: `${e.link} ${d ? e.linkActive : ""}`,
|
|
110
|
+
children: n.toc_title
|
|
75
111
|
}
|
|
76
112
|
),
|
|
77
|
-
|
|
78
|
-
|
|
113
|
+
a && t && n.children && /* @__PURE__ */ r("ul", { className: e.nestedList, role: "group", children: n.children.map((i, h) => /* @__PURE__ */ r(
|
|
114
|
+
u,
|
|
79
115
|
{
|
|
80
|
-
item:
|
|
116
|
+
item: i,
|
|
81
117
|
activeId: c,
|
|
82
|
-
level:
|
|
118
|
+
level: s + 1
|
|
83
119
|
},
|
|
84
|
-
`${
|
|
120
|
+
`${i.href}-${h}`
|
|
85
121
|
)) })
|
|
86
122
|
] });
|
|
87
123
|
}
|
|
88
|
-
function
|
|
89
|
-
navTree:
|
|
124
|
+
function V({
|
|
125
|
+
navTree: n,
|
|
90
126
|
activeId: c,
|
|
91
|
-
className:
|
|
92
|
-
dropdown:
|
|
93
|
-
activeHref:
|
|
94
|
-
theme:
|
|
127
|
+
className: s = "",
|
|
128
|
+
dropdown: p,
|
|
129
|
+
activeHref: t,
|
|
130
|
+
theme: m,
|
|
131
|
+
bottomLinks: a
|
|
95
132
|
}) {
|
|
96
|
-
return !
|
|
133
|
+
return !n || n.items.length === 0 ? null : (console.log("bottomLinks", a), /* @__PURE__ */ l(
|
|
97
134
|
"nav",
|
|
98
135
|
{
|
|
99
|
-
className: `${
|
|
136
|
+
className: `${e.nav} ${s} ${m === "dark" ? "dark" : ""}`,
|
|
100
137
|
"aria-label": "Documentation navigation",
|
|
101
138
|
children: [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
/* @__PURE__ */ l("div", { className: e.navContent, children: [
|
|
140
|
+
p && /* @__PURE__ */ r(
|
|
141
|
+
g,
|
|
142
|
+
{
|
|
143
|
+
dropdown: p,
|
|
144
|
+
activeHref: t,
|
|
145
|
+
className: e.group
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
n.items.map((o, d) => /* @__PURE__ */ r(
|
|
149
|
+
u,
|
|
150
|
+
{
|
|
151
|
+
item: o,
|
|
152
|
+
activeId: c
|
|
153
|
+
},
|
|
154
|
+
`${o.href}-${d}`
|
|
155
|
+
))
|
|
156
|
+
] }),
|
|
157
|
+
a && a.length > 0 && /* @__PURE__ */ l("div", { className: e.bottomSection, children: [
|
|
158
|
+
/* @__PURE__ */ r("div", { className: e.divider }),
|
|
159
|
+
/* @__PURE__ */ r("div", { className: e.bottomLinks, children: a.map((o, d) => {
|
|
160
|
+
const C = o.icon;
|
|
161
|
+
return /* @__PURE__ */ l(
|
|
162
|
+
"a",
|
|
163
|
+
{
|
|
164
|
+
href: o.href,
|
|
165
|
+
target: "_blank",
|
|
166
|
+
rel: "noopener noreferrer",
|
|
167
|
+
className: e.bottomLink,
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ r(C, { className: e.bottomLinkIcon }),
|
|
170
|
+
/* @__PURE__ */ r("span", { children: o.label }),
|
|
171
|
+
/* @__PURE__ */ r(N, {})
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
d
|
|
175
|
+
);
|
|
176
|
+
}) })
|
|
177
|
+
] })
|
|
118
178
|
]
|
|
119
179
|
}
|
|
120
|
-
);
|
|
180
|
+
));
|
|
121
181
|
}
|
|
122
182
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
183
|
+
g as DropdownMenu,
|
|
184
|
+
V as NavTree
|
|
125
185
|
};
|
|
126
186
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/nav-tree/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { NavItem, NavTreeData } from \"../../types\";\nimport { DropdownConfig, DropdownMenu } from \"./dropdown-menu\";\nimport styles from \"./nav-tree.module.css\";\nexport { DropdownMenu } from \"./dropdown-menu\";\nexport type { DropdownConfig, DropdownItem } from \"./dropdown-menu\";\nexport { MobileNavTree } from \"./mobile-nav\";\nexport type { MobileNavTreeProps } from \"./mobile-nav\";\nimport \"../../styles.css\";\n\ninterface NavTreeProps {\n navTree: NavTreeData;\n activeId?: string;\n className?: string;\n dropdown?: DropdownConfig;\n activeHref?: string;\n theme?: \"light\" | \"dark\" | \"system\";\n}\n\ninterface TreeItemProps {\n item: NavItem;\n activeId?: string;\n level?: number;\n}\n\nfunction TreeItemComponent({ item, activeId, level = 0 }: TreeItemProps) {\n const defaultExpanded = level === 0 ? true : item.expanded ?? false;\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n const hasChildren = item.children && item.children.length > 0;\n const isGroup = hasChildren && !item.href;\n const isActive = item.href && activeId === item.href;\n const Icon = item.icon;\n\n if (isGroup && level === 0) {\n return (\n <div className={styles.group} role=\"group\" aria-label={item.toc_title}>\n <div className={styles.groupHeader}>\n {Icon && <Icon className={styles.groupIcon} aria-hidden=\"true\" />}\n <span>{item.toc_title}</span>\n </div>\n {hasChildren && item.children && (\n <ul className={styles.list} role=\"list\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </div>\n );\n }\n\n if (isGroup && level > 0) {\n return (\n <li className={styles.listItem}>\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n aria-expanded={isExpanded}\n aria-label={`${isExpanded ? \"Collapse\" : \"Expand\"} ${\n item.toc_title\n } section`}\n className={styles.expandButton}\n >\n <div className={styles.hoverIndicator} />\n <span>{item.toc_title}</span>\n <svg\n className={`${styles.chevron} ${\n isExpanded ? styles.chevronExpanded : styles.chevronCollapsed\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n {hasChildren && isExpanded && item.children && (\n <ul className={styles.nestedList} role=\"group\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </li>\n );\n }\n\n return (\n <li className={styles.listItem}>\n <a\n href={item.href}\n aria-current={isActive ? \"page\" : undefined}\n className={`${styles.link} ${isActive ? styles.linkActive : \"\"}`}\n >\n <div className={styles.hoverIndicator} />\n {item.toc_title}\n </a>\n {hasChildren && isExpanded && item.children && (\n <ul className={styles.nestedList} role=\"group\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function NavTree({\n navTree,\n activeId,\n className = \"\",\n dropdown,\n activeHref,\n theme,\n}: NavTreeProps) {\n if (!navTree || navTree.items.length === 0) {\n return null;\n }\n\n return (\n <nav\n className={`${styles.nav} ${className} ${theme === \"dark\" ? \"dark\" : \"\"}`}\n aria-label=\"Documentation navigation\"\n >\n {dropdown && (\n <DropdownMenu\n dropdown={dropdown}\n activeHref={activeHref}\n className={styles.group}\n />\n )}\n {navTree.items.map((item, index) => (\n <TreeItemComponent\n key={`${item.href}-${index}`}\n item={item}\n activeId={activeId}\n />\n ))}\n </nav>\n );\n}\n"],"names":["TreeItemComponent","item","activeId","level","defaultExpanded","isExpanded","setIsExpanded","useState","hasChildren","isGroup","isActive","Icon","jsxs","styles","jsx","child","index","NavTree","navTree","className","dropdown","activeHref","theme","DropdownMenu"],"mappings":";;;;;AAyBA,SAASA,EAAkB,EAAE,MAAAC,GAAM,UAAAC,GAAU,OAAAC,IAAQ,KAAoB;AACvE,QAAMC,IAAkBD,MAAU,IAAI,KAAOF,EAAK,YAAY,IACxD,CAACI,GAAYC,CAAa,IAAIC,EAASH,CAAe,GACtDI,IAAcP,EAAK,YAAYA,EAAK,SAAS,SAAS,GACtDQ,IAAUD,KAAe,CAACP,EAAK,MAC/BS,IAAWT,EAAK,QAAQC,MAAaD,EAAK,MAC1CU,IAAOV,EAAK;AAElB,SAAIQ,KAAWN,MAAU,IAErB,gBAAAS,EAAC,SAAI,WAAWC,EAAO,OAAO,MAAK,SAAQ,cAAYZ,EAAK,WAC1D,UAAA;AAAA,IAAA,gBAAAW,EAAC,OAAA,EAAI,WAAWC,EAAO,aACpB,UAAA;AAAA,MAAAF,uBAASA,GAAA,EAAK,WAAWE,EAAO,WAAW,eAAY,QAAO;AAAA,MAC/D,gBAAAC,EAAC,QAAA,EAAM,UAAAb,EAAK,UAAA,CAAU;AAAA,IAAA,GACxB;AAAA,IACCO,KAAeP,EAAK,YACnB,gBAAAa,EAAC,QAAG,WAA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AAS,SAAS,EAAE;AAAA,MACvE,cAAW;AAAA,MAEV,UAAA;AAAA,QAAAF,KACC,gBAAAN;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,UAAAH;AAAA,YACA,YAAAC;AAAA,YACA,WAAWR,EAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrBK,EAAQ,MAAM,IAAI,CAACjB,GAAMe,MACxB,gBAAAF;AAAA,UAACd;AAAA,UAAA;AAAA,YAEC,MAAAC;AAAA,YACA,UAAAC;AAAA,UAAA;AAAA,UAFK,GAAGD,EAAK,IAAI,IAAIe,CAAK;AAAA,QAAA,CAI7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/nav-tree/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport type { NavItem, NavTreeData } from \"../../types\";\nimport { DropdownConfig, DropdownMenu } from \"./dropdown-menu\";\nimport styles from \"./nav-tree.module.css\";\nexport { DropdownMenu } from \"./dropdown-menu\";\nexport type { DropdownConfig, DropdownItem } from \"./dropdown-menu\";\nexport { MobileNavTree } from \"./mobile-nav\";\nexport type { MobileNavTreeProps } from \"./mobile-nav\";\nimport \"../../styles.css\";\n\nexport interface BottomLinkConfig {\n href: string;\n label: string;\n icon: React.ComponentType<{ className?: string }>;\n}\n\ninterface NavTreeProps {\n navTree: NavTreeData;\n activeId?: string;\n className?: string;\n dropdown?: DropdownConfig;\n activeHref?: string;\n theme?: \"light\" | \"dark\" | \"system\";\n bottomLinks?: BottomLinkConfig[];\n}\n\ninterface TreeItemProps {\n item: NavItem;\n activeId?: string;\n level?: number;\n}\n\nfunction ExternalIcon() {\n return (\n <div className={styles.externalIcon}>\n <svg\n className={styles.externalIconLight}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2.49999 1C1.67157 1 0.999995 1.67157 0.999995 2.5V9.5C0.999995 10.3284 1.67157 11 2.49999 11H9.49996C10.3284 11 10.9999 10.3284 10.9999 9.5V7.26923C10.9999 6.99309 11.2238 6.76923 11.4999 6.76923C11.7761 6.76923 11.9999 6.99309 11.9999 7.26923V9.5C11.9999 10.8807 10.8807 12 9.49996 12H2.49999C1.11928 12 0 10.8807 0 9.5V2.5C0 1.11929 1.11928 0 2.49999 0H4.73075C5.00689 0 5.23074 0.223858 5.23074 0.5C5.23074 0.776142 5.00689 1 4.73075 1H2.49999ZM6.76926 0.5C6.76926 0.223858 6.99311 0 7.26925 0H11.5C11.7761 0 12 0.223858 12 0.5V4.73077C12 5.00691 11.7761 5.23077 11.5 5.23077C11.2239 5.23077 11 5.00691 11 4.73077V1.70711L7.6228 5.08433C7.42754 5.27959 7.11096 5.27959 6.9157 5.08433C6.72044 4.88906 6.72044 4.57248 6.9157 4.37722L10.2929 1H7.26925C6.99311 1 6.76926 0.776142 6.76926 0.5Z\"\n fill=\"#707070\"\n />\n </svg>\n <svg\n className={styles.externalIconDark}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2.49999 1C1.67157 1 0.999995 1.67157 0.999995 2.5V9.5C0.999995 10.3284 1.67157 11 2.49999 11H9.49996C10.3284 11 10.9999 10.3284 10.9999 9.5V7.26923C10.9999 6.99309 11.2238 6.76923 11.4999 6.76923C11.7761 6.76923 11.9999 6.99309 11.9999 7.26923V9.5C11.9999 10.8807 10.8807 12 9.49996 12H2.49999C1.11928 12 0 10.8807 0 9.5V2.5C0 1.11929 1.11928 0 2.49999 0H4.73075C5.00689 0 5.23074 0.223858 5.23074 0.5C5.23074 0.776142 5.00689 1 4.73075 1H2.49999ZM6.76926 0.5C6.76926 0.223858 6.99311 0 7.26925 0H11.5C11.7761 0 12 0.223858 12 0.5V4.73077C12 5.00691 11.7761 5.23077 11.5 5.23077C11.2239 5.23077 11 5.00691 11 4.73077V1.70711L7.6228 5.08433C7.42754 5.27959 7.11096 5.27959 6.9157 5.08433C6.72044 4.88906 6.72044 4.57248 6.9157 4.37722L10.2929 1H7.26925C6.99311 1 6.76926 0.776142 6.76926 0.5Z\"\n fill=\"#999999\"\n />\n </svg>\n </div>\n );\n}\n\nfunction TreeItemComponent({ item, activeId, level = 0 }: TreeItemProps) {\n const defaultExpanded = level === 0 ? true : item.expanded ?? false;\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\n const hasChildren = item.children && item.children.length > 0;\n const isGroup = hasChildren && !item.href;\n const isActive = item.href && activeId === item.href;\n const Icon = item.icon;\n\n if (isGroup && level === 0) {\n return (\n <div className={styles.group} role=\"group\" aria-label={item.toc_title}>\n <div className={styles.groupHeader}>\n {Icon && <Icon className={styles.groupIcon} aria-hidden=\"true\" />}\n <span>{item.toc_title}</span>\n </div>\n {hasChildren && item.children && (\n <ul className={styles.list} role=\"list\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </div>\n );\n }\n\n if (isGroup && level > 0) {\n return (\n <li className={styles.listItem}>\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n aria-expanded={isExpanded}\n aria-label={`${isExpanded ? \"Collapse\" : \"Expand\"} ${\n item.toc_title\n } section`}\n className={styles.expandButton}\n >\n <span>{item.toc_title}</span>\n <svg\n className={`${styles.chevron} ${\n isExpanded ? styles.chevronExpanded : styles.chevronCollapsed\n }`}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n {hasChildren && isExpanded && item.children && (\n <ul className={styles.nestedList} role=\"group\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </li>\n );\n }\n\n return (\n <li className={styles.listItem}>\n <a\n href={item.href}\n aria-current={isActive ? \"page\" : undefined}\n className={`${styles.link} ${isActive ? styles.linkActive : \"\"}`}\n >\n {item.toc_title}\n </a>\n {hasChildren && isExpanded && item.children && (\n <ul className={styles.nestedList} role=\"group\">\n {item.children.map((child, index) => (\n <TreeItemComponent\n key={`${child.href}-${index}`}\n item={child}\n activeId={activeId}\n level={level + 1}\n />\n ))}\n </ul>\n )}\n </li>\n );\n}\n\nexport function NavTree({\n navTree,\n activeId,\n className = \"\",\n dropdown,\n activeHref,\n theme,\n bottomLinks,\n}: NavTreeProps) {\n if (!navTree || navTree.items.length === 0) {\n return null;\n }\n\n console.log(\"bottomLinks\", bottomLinks);\n\n return (\n <nav\n className={`${styles.nav} ${className} ${theme === \"dark\" ? \"dark\" : \"\"}`}\n aria-label=\"Documentation navigation\"\n >\n <div className={styles.navContent}>\n {dropdown && (\n <DropdownMenu\n dropdown={dropdown}\n activeHref={activeHref}\n className={styles.group}\n />\n )}\n {navTree.items.map((item, index) => (\n <TreeItemComponent\n key={`${item.href}-${index}`}\n item={item}\n activeId={activeId}\n />\n ))}\n </div>\n {bottomLinks && bottomLinks.length > 0 && (\n <div className={styles.bottomSection}>\n <div className={styles.divider}></div>\n <div className={styles.bottomLinks}>\n {bottomLinks.map((link, index) => {\n const Icon = link.icon;\n return (\n <a\n key={index}\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles.bottomLink}\n >\n <Icon className={styles.bottomLinkIcon} />\n <span>{link.label}</span>\n <ExternalIcon />\n </a>\n );\n })}\n </div>\n </div>\n )}\n </nav>\n );\n}\n"],"names":["ExternalIcon","jsxs","styles","jsx","TreeItemComponent","item","activeId","level","defaultExpanded","isExpanded","setIsExpanded","useState","hasChildren","isGroup","isActive","Icon","child","index","NavTree","navTree","className","dropdown","activeHref","theme","bottomLinks","DropdownMenu","link"],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;AAIR;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as r, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog as
|
|
3
|
-
import { NavTree as
|
|
4
|
-
import { Dismiss16Regular as
|
|
2
|
+
import { Dialog as p, DialogBackdrop as u, DialogPanel as N } from "@headlessui/react";
|
|
3
|
+
import { NavTree as f } from "./index.js";
|
|
4
|
+
import { Dismiss16Regular as g } from "@fluentui/react-icons";
|
|
5
5
|
import o from "./mobile-nav.module.css.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
function
|
|
7
|
+
function y({
|
|
8
8
|
isOpen: e,
|
|
9
9
|
setIsOpen: l,
|
|
10
10
|
navTree: n,
|
|
@@ -12,27 +12,29 @@ function x({
|
|
|
12
12
|
className: t = "",
|
|
13
13
|
theme: s,
|
|
14
14
|
dropdown: c,
|
|
15
|
-
activeHref: m
|
|
15
|
+
activeHref: m,
|
|
16
|
+
bottomLinks: d
|
|
16
17
|
}) {
|
|
17
18
|
return /* @__PURE__ */ r(
|
|
18
|
-
|
|
19
|
+
p,
|
|
19
20
|
{
|
|
20
21
|
open: e,
|
|
21
22
|
onClose: () => l(!1),
|
|
22
23
|
className: `${o.dialog} ${s === "dark" ? "dark" : ""}`,
|
|
23
24
|
children: [
|
|
24
|
-
/* @__PURE__ */ a(
|
|
25
|
+
/* @__PURE__ */ a(u, { transition: !0, className: o.backdrop }),
|
|
25
26
|
/* @__PURE__ */ r("div", { className: o.container, children: [
|
|
26
|
-
e && /* @__PURE__ */ a(
|
|
27
|
-
/* @__PURE__ */ a(
|
|
28
|
-
|
|
27
|
+
e && /* @__PURE__ */ a(v, { setIsOpen: l }),
|
|
28
|
+
/* @__PURE__ */ a(N, { id: "mobile-nav", transition: !0, className: o.panel, children: /* @__PURE__ */ a("div", { className: o.content, children: /* @__PURE__ */ a(
|
|
29
|
+
f,
|
|
29
30
|
{
|
|
30
31
|
navTree: n,
|
|
31
32
|
activeId: i,
|
|
32
33
|
className: t,
|
|
33
34
|
dropdown: c,
|
|
34
35
|
activeHref: m,
|
|
35
|
-
theme: s
|
|
36
|
+
theme: s,
|
|
37
|
+
bottomLinks: d
|
|
36
38
|
}
|
|
37
39
|
) }) })
|
|
38
40
|
] })
|
|
@@ -40,7 +42,7 @@ function x({
|
|
|
40
42
|
}
|
|
41
43
|
);
|
|
42
44
|
}
|
|
43
|
-
const
|
|
45
|
+
const v = ({
|
|
44
46
|
setIsOpen: e
|
|
45
47
|
}) => /* @__PURE__ */ r(
|
|
46
48
|
"button",
|
|
@@ -50,11 +52,11 @@ const g = ({
|
|
|
50
52
|
className: o.closeButton,
|
|
51
53
|
children: [
|
|
52
54
|
/* @__PURE__ */ a("span", { className: o.srOnly, children: "Close navigation" }),
|
|
53
|
-
/* @__PURE__ */ a(
|
|
55
|
+
/* @__PURE__ */ a(g, { className: o.closeIcon })
|
|
54
56
|
]
|
|
55
57
|
}
|
|
56
58
|
);
|
|
57
59
|
export {
|
|
58
|
-
|
|
60
|
+
y as MobileNavTree
|
|
59
61
|
};
|
|
60
62
|
//# sourceMappingURL=mobile-nav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-nav.js","sources":["../../../src/components/nav-tree/mobile-nav.tsx"],"sourcesContent":["import { NavTreeData } from \"../../types\";\nimport { Dialog, DialogBackdrop, DialogPanel } from \"@headlessui/react\";\nimport { DropdownConfig, NavTree } from \"./index\";\nimport { Dismiss16Regular } from \"@fluentui/react-icons\";\nimport styles from \"./mobile-nav.module.css\";\nimport \"../../styles.css\";\n\nexport interface MobileNavTreeProps {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n navTree: NavTreeData;\n activeId?: string;\n className?: string;\n theme?: \"light\" | \"dark\" | \"system\";\n dropdown?: DropdownConfig;\n activeHref?: string;\n}\n\nexport function MobileNavTree({\n isOpen,\n setIsOpen,\n navTree,\n activeId,\n className = \"\",\n theme,\n dropdown,\n activeHref,\n}: MobileNavTreeProps) {\n return (\n <Dialog\n open={isOpen}\n onClose={() => setIsOpen(false)}\n className={`${styles.dialog} ${theme === \"dark\" ? \"dark\" : \"\"}`}\n >\n <DialogBackdrop transition className={styles.backdrop} />\n <div className={styles.container}>\n {isOpen && <CloseButton setIsOpen={setIsOpen} />}\n <DialogPanel id=\"mobile-nav\" transition className={styles.panel}>\n <div className={styles.content}>\n <NavTree\n navTree={navTree}\n activeId={activeId}\n className={className}\n dropdown={dropdown}\n activeHref={activeHref}\n theme={theme}\n />\n </div>\n </DialogPanel>\n </div>\n </Dialog>\n );\n}\n\nconst CloseButton = ({\n setIsOpen,\n}: {\n setIsOpen: (isOpen: boolean) => void;\n}) => {\n return (\n <button\n type=\"button\"\n onClick={() => setIsOpen(false)}\n className={styles.closeButton}\n >\n <span className={styles.srOnly}>Close navigation</span>\n <Dismiss16Regular className={styles.closeIcon} />\n </button>\n );\n};\n"],"names":["MobileNavTree","isOpen","setIsOpen","navTree","activeId","className","theme","dropdown","activeHref","jsxs","Dialog","styles","jsx","DialogBackdrop","CloseButton","DialogPanel","NavTree","Dismiss16Regular"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"mobile-nav.js","sources":["../../../src/components/nav-tree/mobile-nav.tsx"],"sourcesContent":["import { NavTreeData } from \"../../types\";\nimport { Dialog, DialogBackdrop, DialogPanel } from \"@headlessui/react\";\nimport { DropdownConfig, NavTree, BottomLinkConfig } from \"./index\";\nimport { Dismiss16Regular } from \"@fluentui/react-icons\";\nimport styles from \"./mobile-nav.module.css\";\nimport \"../../styles.css\";\n\nexport interface MobileNavTreeProps {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n navTree: NavTreeData;\n activeId?: string;\n className?: string;\n theme?: \"light\" | \"dark\" | \"system\";\n dropdown?: DropdownConfig;\n activeHref?: string;\n bottomLinks?: BottomLinkConfig[];\n}\n\nexport function MobileNavTree({\n isOpen,\n setIsOpen,\n navTree,\n activeId,\n className = \"\",\n theme,\n dropdown,\n activeHref,\n bottomLinks,\n}: MobileNavTreeProps) {\n return (\n <Dialog\n open={isOpen}\n onClose={() => setIsOpen(false)}\n className={`${styles.dialog} ${theme === \"dark\" ? \"dark\" : \"\"}`}\n >\n <DialogBackdrop transition className={styles.backdrop} />\n <div className={styles.container}>\n {isOpen && <CloseButton setIsOpen={setIsOpen} />}\n <DialogPanel id=\"mobile-nav\" transition className={styles.panel}>\n <div className={styles.content}>\n <NavTree\n navTree={navTree}\n activeId={activeId}\n className={className}\n dropdown={dropdown}\n activeHref={activeHref}\n theme={theme}\n bottomLinks={bottomLinks}\n />\n </div>\n </DialogPanel>\n </div>\n </Dialog>\n );\n}\n\nconst CloseButton = ({\n setIsOpen,\n}: {\n setIsOpen: (isOpen: boolean) => void;\n}) => {\n return (\n <button\n type=\"button\"\n onClick={() => setIsOpen(false)}\n className={styles.closeButton}\n >\n <span className={styles.srOnly}>Close navigation</span>\n <Dismiss16Regular className={styles.closeIcon} />\n </button>\n );\n};\n"],"names":["MobileNavTree","isOpen","setIsOpen","navTree","activeId","className","theme","dropdown","activeHref","bottomLinks","jsxs","Dialog","styles","jsx","DialogBackdrop","CloseButton","DialogPanel","NavTree","Dismiss16Regular"],"mappings":";;;;;;AAmBO,SAASA,EAAc;AAAA,EAC5B,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AACF,GAAuB;AACrB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMV;AAAA,MACN,SAAS,MAAMC,EAAU,EAAK;AAAA,MAC9B,WAAW,GAAGU,EAAO,MAAM,IAAIN,MAAU,SAAS,SAAS,EAAE;AAAA,MAE7D,UAAA;AAAA,QAAA,gBAAAO,EAACC,GAAA,EAAe,YAAU,IAAC,WAAWF,EAAO,UAAU;AAAA,QACvD,gBAAAF,EAAC,OAAA,EAAI,WAAWE,EAAO,WACpB,UAAA;AAAA,UAAAX,KAAU,gBAAAY,EAACE,KAAY,WAAAb,EAAA,CAAsB;AAAA,UAC9C,gBAAAW,EAACG,GAAA,EAAY,IAAG,cAAa,YAAU,IAAC,WAAWJ,EAAO,OACxD,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,SACrB,UAAA,gBAAAC;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,SAAAd;AAAA,cACA,UAAAC;AAAA,cACA,WAAAC;AAAA,cACA,UAAAE;AAAA,cACA,YAAAC;AAAA,cACA,OAAAF;AAAA,cACA,aAAAG;AAAA,YAAA;AAAA,UAAA,GAEJ,EAAA,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAMM,IAAc,CAAC;AAAA,EACnB,WAAAb;AACF,MAII,gBAAAQ;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAS,MAAMR,EAAU,EAAK;AAAA,IAC9B,WAAWU,EAAO;AAAA,IAElB,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,QAAQ,UAAA,oBAAgB;AAAA,MAChD,gBAAAC,EAACK,GAAA,EAAiB,WAAWN,EAAO,UAAA,CAAW;AAAA,IAAA;AAAA,EAAA;AAAA;"}
|
|
@@ -1,34 +1,50 @@
|
|
|
1
|
-
const n = "
|
|
1
|
+
const n = "_nav_kxe04_1", t = "_navContent_kxe04_9", o = "_group_kxe04_55", e = "_groupHeader_kxe04_59", _ = "_groupIcon_kxe04_74", c = "_list_kxe04_79", s = "_listItem_kxe04_85", k = "_expandButton_kxe04_89", i = "_chevron_kxe04_126", x = "_chevronExpanded_kxe04_137", r = "_chevronCollapsed_kxe04_141", a = "_link_kxe04_145", l = "_linkActive_kxe04_175", d = "_nestedList_kxe04_186", v = "_bottomSection_kxe04_195", p = "_divider_kxe04_206", I = "_bottomLinks_kxe04_217", m = "_bottomLink_kxe04_217", L = "_bottomLinkIcon_kxe04_245", u = "_externalIcon_kxe04_251", b = "_externalIconLight_kxe04_255", g = "_externalIconDark_kxe04_263", h = {
|
|
2
2
|
nav: n,
|
|
3
|
+
navContent: t,
|
|
3
4
|
group: o,
|
|
4
|
-
groupHeader:
|
|
5
|
-
groupIcon:
|
|
6
|
-
list:
|
|
7
|
-
listItem:
|
|
8
|
-
expandButton:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
link: x,
|
|
5
|
+
groupHeader: e,
|
|
6
|
+
groupIcon: _,
|
|
7
|
+
list: c,
|
|
8
|
+
listItem: s,
|
|
9
|
+
expandButton: k,
|
|
10
|
+
chevron: i,
|
|
11
|
+
chevronExpanded: x,
|
|
12
|
+
chevronCollapsed: r,
|
|
13
|
+
link: a,
|
|
14
14
|
linkActive: l,
|
|
15
|
-
nestedList:
|
|
15
|
+
nestedList: d,
|
|
16
|
+
bottomSection: v,
|
|
17
|
+
divider: p,
|
|
18
|
+
bottomLinks: I,
|
|
19
|
+
bottomLink: m,
|
|
20
|
+
bottomLinkIcon: L,
|
|
21
|
+
externalIcon: u,
|
|
22
|
+
externalIconLight: b,
|
|
23
|
+
externalIconDark: g
|
|
16
24
|
};
|
|
17
25
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
v as
|
|
22
|
-
|
|
26
|
+
m as bottomLink,
|
|
27
|
+
L as bottomLinkIcon,
|
|
28
|
+
I as bottomLinks,
|
|
29
|
+
v as bottomSection,
|
|
30
|
+
i as chevron,
|
|
31
|
+
r as chevronCollapsed,
|
|
32
|
+
x as chevronExpanded,
|
|
33
|
+
h as default,
|
|
34
|
+
p as divider,
|
|
35
|
+
k as expandButton,
|
|
36
|
+
u as externalIcon,
|
|
37
|
+
g as externalIconDark,
|
|
38
|
+
b as externalIconLight,
|
|
23
39
|
o as group,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
x as link,
|
|
40
|
+
e as groupHeader,
|
|
41
|
+
_ as groupIcon,
|
|
42
|
+
a as link,
|
|
28
43
|
l as linkActive,
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
c as list,
|
|
45
|
+
s as listItem,
|
|
31
46
|
n as nav,
|
|
32
|
-
|
|
47
|
+
t as navContent,
|
|
48
|
+
d as nestedList
|
|
33
49
|
};
|
|
34
50
|
//# sourceMappingURL=nav-tree.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-tree.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nav-tree.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|