@widlarzgroup/docusaurus-ui 0.0.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.
- package/README.md +36 -0
- package/lib/components/PlatformsList/PlatformsList.d.ts +7 -0
- package/lib/components/PlatformsList/PlatformsList.d.ts.map +1 -0
- package/lib/components/PlatformsList/PlatformsList.js +14 -0
- package/lib/components/PlatformsList/PlatformsList.js.map +1 -0
- package/lib/components/PlatformsList/PlatformsList.module.css +10 -0
- package/lib/components/PlusBadge/PlusBadge.d.ts +6 -0
- package/lib/components/PlusBadge/PlusBadge.d.ts.map +1 -0
- package/lib/components/PlusBadge/PlusBadge.js +12 -0
- package/lib/components/PlusBadge/PlusBadge.js.map +1 -0
- package/lib/components/PlusBadge/PlusBadge.module.css +17 -0
- package/lib/components/ProBadge/ProBadge.d.ts +2 -0
- package/lib/components/ProBadge/ProBadge.d.ts.map +1 -0
- package/lib/components/ProBadge/ProBadge.js +12 -0
- package/lib/components/ProBadge/ProBadge.js.map +1 -0
- package/lib/components/ProBadge/ProBadge.module.css +8 -0
- package/lib/components/ProFeature/ProFeature.d.ts +7 -0
- package/lib/components/ProFeature/ProFeature.d.ts.map +1 -0
- package/lib/components/ProFeature/ProFeature.js +12 -0
- package/lib/components/ProFeature/ProFeature.js.map +1 -0
- package/lib/components/ProFeature/ProFeature.module.css +89 -0
- package/lib/components/StatusBadge/StatusBadge.d.ts +7 -0
- package/lib/components/StatusBadge/StatusBadge.d.ts.map +1 -0
- package/lib/components/StatusBadge/StatusBadge.js +26 -0
- package/lib/components/StatusBadge/StatusBadge.js.map +1 -0
- package/lib/components/StatusBadge/StatusBadge.module.css +26 -0
- package/lib/components/TWGBadge/TWGBadge.d.ts +6 -0
- package/lib/components/TWGBadge/TWGBadge.d.ts.map +1 -0
- package/lib/components/TWGBadge/TWGBadge.js +15 -0
- package/lib/components/TWGBadge/TWGBadge.js.map +1 -0
- package/lib/components/TWGBadge/TWGBadge.module.css +107 -0
- package/lib/css/custom.css +614 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/theme/DocItem/Footer/index.d.ts +3 -0
- package/lib/theme/DocItem/Footer/index.d.ts.map +1 -0
- package/lib/theme/DocItem/Footer/index.js +24 -0
- package/lib/theme/DocItem/Footer/index.js.map +1 -0
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts +3 -0
- package/lib/theme/DocItem/TOC/Desktop/index.d.ts.map +1 -0
- package/lib/theme/DocItem/TOC/Desktop/index.js +15 -0
- package/lib/theme/DocItem/TOC/Desktop/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Category/index.d.ts +5 -0
- package/lib/theme/DocSidebarItem/Category/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/Category/index.js +224 -0
- package/lib/theme/DocSidebarItem/Category/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Category/styles.module.css +119 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts +5 -0
- package/lib/theme/DocSidebarItem/Link/index.d.ts.map +1 -0
- package/lib/theme/DocSidebarItem/Link/index.js +35 -0
- package/lib/theme/DocSidebarItem/Link/index.js.map +1 -0
- package/lib/theme/DocSidebarItem/Link/styles.module.css +18 -0
- package/lib/theme/TOC/index.d.ts +4 -0
- package/lib/theme/TOC/index.d.ts.map +1 -0
- package/lib/theme/TOC/index.js +19 -0
- package/lib/theme/TOC/index.js.map +1 -0
- package/lib/theme/TOC/styles.module.css +16 -0
- package/lib/types/sidebar.d.ts +17 -0
- package/lib/types/sidebar.d.ts.map +1 -0
- package/lib/types/sidebar.js +3 -0
- package/lib/types/sidebar.js.map +1 -0
- package/package.json +41 -0
- package/src/components/PlatformsList/PlatformsList.module.css +10 -0
- package/src/components/PlatformsList/PlatformsList.tsx +28 -0
- package/src/components/PlusBadge/PlusBadge.module.css +17 -0
- package/src/components/PlusBadge/PlusBadge.tsx +23 -0
- package/src/components/ProBadge/ProBadge.module.css +8 -0
- package/src/components/ProBadge/ProBadge.tsx +21 -0
- package/src/components/ProFeature/ProFeature.module.css +89 -0
- package/src/components/ProFeature/ProFeature.tsx +51 -0
- package/src/components/StatusBadge/StatusBadge.module.css +26 -0
- package/src/components/StatusBadge/StatusBadge.tsx +32 -0
- package/src/components/TWGBadge/TWGBadge.module.css +107 -0
- package/src/components/TWGBadge/TWGBadge.tsx +27 -0
- package/src/css/custom.css +614 -0
- package/src/index.ts +22 -0
- package/src/theme/DocItem/Footer/index.tsx +51 -0
- package/src/theme/DocSidebarItem/Category/index.tsx +403 -0
- package/src/theme/DocSidebarItem/Category/styles.module.css +119 -0
- package/src/theme/DocSidebarItem/Link/index.tsx +85 -0
- package/src/theme/DocSidebarItem/Link/styles.module.css +18 -0
- package/src/theme/TOC/index.tsx +25 -0
- package/src/theme/TOC/styles.module.css +16 -0
- package/src/types/sidebar.ts +23 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = DocItemTOCDesktop;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
9
|
+
const client_1 = require("@docusaurus/plugin-content-docs/client");
|
|
10
|
+
const TOC_1 = __importDefault(require("@theme/TOC"));
|
|
11
|
+
function DocItemTOCDesktop() {
|
|
12
|
+
const { toc, frontMatter } = (0, client_1.useDoc)();
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TOC_1.default, { toc: toc, minHeadingLevel: frontMatter.toc_min_heading_level, maxHeadingLevel: frontMatter.toc_max_heading_level, className: theme_common_1.ThemeClassNames.docs.docTocDesktop }) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/theme/DocItem/TOC/Desktop/index.tsx"],"names":[],"mappings":";;;;;AAOA,oCAaC;;AAnBD,2DAAyD;AACzD,mEAA8D;AAE9D,qDAA6B;AAG7B,SAAwB,iBAAiB;IACvC,MAAM,EAAC,GAAG,EAAE,WAAW,EAAC,GAAG,IAAA,eAAM,GAAE,CAAC;IACpC,OAAO,CACL,2DACE,uBAAC,aAAG,IACF,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,WAAW,CAAC,qBAAqB,EAClD,eAAe,EAAE,WAAW,CAAC,qBAAqB,EAClD,SAAS,EAAE,8BAAe,CAAC,IAAI,CAAC,aAAa,GAC7C,GAED,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Props } from '@theme/DocSidebarItem/Category';
|
|
3
|
+
import type { WithCustomProps } from '../../../types/sidebar';
|
|
4
|
+
export default function DocSidebarItemCategory(props: WithCustomProps<Props>): ReactNode;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/DocSidebarItem/Category/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEZ,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAG5D,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AAiIzB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,GAC5B,SAAS,CAUX"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = DocSidebarItemCategory;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
10
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
11
|
+
const internal_1 = require("@docusaurus/theme-common/internal");
|
|
12
|
+
const client_1 = require("@docusaurus/plugin-content-docs/client");
|
|
13
|
+
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
14
|
+
const Translate_1 = require("@docusaurus/Translate");
|
|
15
|
+
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
16
|
+
const DocSidebarItems_1 = __importDefault(require("@theme-original/DocSidebarItems"));
|
|
17
|
+
const Link_2 = __importDefault(require("@theme-original/DocSidebarItem/Link"));
|
|
18
|
+
const ProBadge_1 = __importDefault(require("../../../components/ProBadge/ProBadge"));
|
|
19
|
+
const StatusBadge_1 = __importDefault(require("../../../components/StatusBadge/StatusBadge"));
|
|
20
|
+
const styles_module_css_1 = __importDefault(require("./styles.module.css"));
|
|
21
|
+
// If we navigate to a category and it becomes active, it should automatically
|
|
22
|
+
// expand itself
|
|
23
|
+
function useAutoExpandActiveCategory({ isActive, collapsed, updateCollapsed, activePath, }) {
|
|
24
|
+
const wasActive = (0, theme_common_1.usePrevious)(isActive);
|
|
25
|
+
const previousActivePath = (0, theme_common_1.usePrevious)(activePath);
|
|
26
|
+
(0, react_1.useEffect)(() => {
|
|
27
|
+
const justBecameActive = isActive && !wasActive;
|
|
28
|
+
const stillActiveButPathChanged = isActive && wasActive && activePath !== previousActivePath;
|
|
29
|
+
if ((justBecameActive || stillActiveButPathChanged) && collapsed) {
|
|
30
|
+
updateCollapsed(false);
|
|
31
|
+
}
|
|
32
|
+
}, [
|
|
33
|
+
isActive,
|
|
34
|
+
wasActive,
|
|
35
|
+
collapsed,
|
|
36
|
+
updateCollapsed,
|
|
37
|
+
activePath,
|
|
38
|
+
previousActivePath,
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* When a collapsible category has no link, we still link it to its first child
|
|
43
|
+
* during SSR as a temporary fallback. This allows to be able to navigate inside
|
|
44
|
+
* the category even when JS fails to load, is delayed or simply disabled
|
|
45
|
+
* React hydration becomes an optional progressive enhancement
|
|
46
|
+
* see https://github.com/facebookincubator/infima/issues/36#issuecomment-772543188
|
|
47
|
+
* see https://github.com/facebook/docusaurus/issues/3030
|
|
48
|
+
*/
|
|
49
|
+
function useCategoryHrefWithSSRFallback(item) {
|
|
50
|
+
const isBrowser = (0, useIsBrowser_1.default)();
|
|
51
|
+
return (0, react_1.useMemo)(() => {
|
|
52
|
+
if (item.href && !item.linkUnlisted) {
|
|
53
|
+
return item.href;
|
|
54
|
+
}
|
|
55
|
+
// In these cases, it's not necessary to render a fallback
|
|
56
|
+
// We skip the "findFirstCategoryLink" computation
|
|
57
|
+
if (isBrowser || !item.collapsible) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return (0, client_1.findFirstSidebarItemLink)(item);
|
|
61
|
+
}, [item, isBrowser]);
|
|
62
|
+
}
|
|
63
|
+
function CollapseButton({ collapsed, categoryLabel, onClick, }) {
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)("button", { "aria-label": collapsed
|
|
65
|
+
? (0, Translate_1.translate)({
|
|
66
|
+
id: 'theme.DocSidebarItem.expandCategoryAriaLabel',
|
|
67
|
+
message: "Expand sidebar category '{label}'",
|
|
68
|
+
description: 'The ARIA label to expand the sidebar category',
|
|
69
|
+
}, { label: categoryLabel })
|
|
70
|
+
: (0, Translate_1.translate)({
|
|
71
|
+
id: 'theme.DocSidebarItem.collapseCategoryAriaLabel',
|
|
72
|
+
message: "Collapse sidebar category '{label}'",
|
|
73
|
+
description: 'The ARIA label to collapse the sidebar category',
|
|
74
|
+
}, { label: categoryLabel }), "aria-expanded": !collapsed, type: "button", className: "clean-btn menu__caret", onClick: onClick }));
|
|
75
|
+
}
|
|
76
|
+
function CategoryLinkLabel({ label, isRootCategory, customProps, }) {
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { title: label, className: (0, clsx_1.default)(styles_module_css_1.default.categoryLinkLabel, {
|
|
78
|
+
[styles_module_css_1.default.categoryLinkLabelRoot]: isRootCategory,
|
|
79
|
+
[styles_module_css_1.default.categoryLinkLabelNested]: !isRootCategory,
|
|
80
|
+
}), children: label }), customProps?.plan === 'pro' && (0, jsx_runtime_1.jsx)(ProBadge_1.default, {}), customProps?.badgeType && (0, jsx_runtime_1.jsx)(StatusBadge_1.default, { type: customProps.badgeType })] }));
|
|
81
|
+
}
|
|
82
|
+
function DocSidebarItemCategory(props) {
|
|
83
|
+
const visibleChildren = (0, client_1.useVisibleSidebarItems)(props.item.items, props.activePath);
|
|
84
|
+
if (visibleChildren.length === 0) {
|
|
85
|
+
return (0, jsx_runtime_1.jsx)(DocSidebarItemCategoryEmpty, { ...props });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return (0, jsx_runtime_1.jsx)(DocSidebarItemCategoryCollapsible, { ...props });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function isCategoryWithHref(category) {
|
|
92
|
+
return typeof category.href === 'string';
|
|
93
|
+
}
|
|
94
|
+
// If a category doesn't have any visible children, we render it as a link
|
|
95
|
+
function DocSidebarItemCategoryEmpty({ item, ...props }) {
|
|
96
|
+
// If the category has no link, we don't render anything
|
|
97
|
+
// It's not super useful to render a category you can't open nor click
|
|
98
|
+
if (!isCategoryWithHref(item)) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
// We remove props that don't make sense for a link and forward the rest
|
|
102
|
+
const { type: _type, collapsed: _collapsed, collapsible: _collapsible, items: _items, linkUnlisted: _linkUnlisted, ...forwardableProps } = item;
|
|
103
|
+
const linkItem = {
|
|
104
|
+
type: 'link',
|
|
105
|
+
...forwardableProps,
|
|
106
|
+
};
|
|
107
|
+
return (0, jsx_runtime_1.jsx)(Link_2.default, { item: linkItem, ...props });
|
|
108
|
+
}
|
|
109
|
+
function DocSidebarItemCategoryCollapsible({ item, onItemClick, activePath, level, index, ...props }) {
|
|
110
|
+
const { items, label, collapsible, className, href, customProps } = item;
|
|
111
|
+
const { docs: { sidebar: { autoCollapseCategories }, }, } = (0, theme_common_1.useThemeConfig)();
|
|
112
|
+
const hrefWithSSRFallback = useCategoryHrefWithSSRFallback(item);
|
|
113
|
+
const isActive = (0, client_1.isActiveSidebarItem)(item, activePath);
|
|
114
|
+
const isCurrentPage = (0, internal_1.isSamePath)(href, activePath);
|
|
115
|
+
// Root categories (level === 1) are always expanded and non-collapsible
|
|
116
|
+
const isRootCategory = level === 1;
|
|
117
|
+
const { collapsed, setCollapsed } = (0, theme_common_1.useCollapsible)({
|
|
118
|
+
// Root categories (level === 1) are always expanded
|
|
119
|
+
// Level 2 categories respect the collapsed prop from sidebars.ts
|
|
120
|
+
// Deeper nested categories (level > 2) are collapsed by default, unless they are active
|
|
121
|
+
initialState: () => {
|
|
122
|
+
if (isRootCategory) {
|
|
123
|
+
return false; // Always expanded for root categories
|
|
124
|
+
}
|
|
125
|
+
if (!collapsible) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
// Level 2 categories: respect the collapsed prop from sidebars.ts
|
|
129
|
+
if (level === 2) {
|
|
130
|
+
return item.collapsed ?? false; // Use sidebar config, default to open
|
|
131
|
+
}
|
|
132
|
+
// Deeper nested categories (level > 2): only expand if active, otherwise collapse
|
|
133
|
+
return isActive ? false : true;
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
const { expandedItem, setExpandedItem } = (0, client_1.useDocSidebarItemsExpandedState)();
|
|
137
|
+
// Use this instead of `setCollapsed`, because it is also reactive
|
|
138
|
+
const updateCollapsed = (toCollapsed = !collapsed) => {
|
|
139
|
+
// Root categories cannot be collapsed
|
|
140
|
+
if (isRootCategory) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
setExpandedItem(toCollapsed ? null : index);
|
|
144
|
+
setCollapsed(toCollapsed);
|
|
145
|
+
};
|
|
146
|
+
// Only auto-expand for nested categories, not root
|
|
147
|
+
// We need to call the hook unconditionally (React rules), but make it a no-op for root categories
|
|
148
|
+
useAutoExpandActiveCategory({
|
|
149
|
+
isActive: isActive && !isRootCategory,
|
|
150
|
+
collapsed: isRootCategory ? false : collapsed,
|
|
151
|
+
updateCollapsed: isRootCategory ? () => { } : updateCollapsed,
|
|
152
|
+
activePath,
|
|
153
|
+
});
|
|
154
|
+
(0, react_1.useEffect)(() => {
|
|
155
|
+
// Root categories should never collapse - always keep them expanded
|
|
156
|
+
if (isRootCategory) {
|
|
157
|
+
setCollapsed(false);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Auto-collapse when other categories expand (only if autoCollapseCategories is enabled)
|
|
161
|
+
if (collapsible &&
|
|
162
|
+
expandedItem != null &&
|
|
163
|
+
expandedItem !== index &&
|
|
164
|
+
autoCollapseCategories) {
|
|
165
|
+
setCollapsed(true);
|
|
166
|
+
}
|
|
167
|
+
}, [
|
|
168
|
+
collapsible,
|
|
169
|
+
expandedItem,
|
|
170
|
+
index,
|
|
171
|
+
setCollapsed,
|
|
172
|
+
autoCollapseCategories,
|
|
173
|
+
isRootCategory,
|
|
174
|
+
]);
|
|
175
|
+
const handleItemClick = (e) => {
|
|
176
|
+
onItemClick?.(item);
|
|
177
|
+
// Root categories cannot be collapsed, so skip collapse logic
|
|
178
|
+
if (isRootCategory) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (collapsible) {
|
|
182
|
+
if (href) {
|
|
183
|
+
// When already on the category's page, we collapse it
|
|
184
|
+
// We don't use "isActive" because it would collapse the
|
|
185
|
+
// category even when we browse a children element
|
|
186
|
+
// See https://github.com/facebook/docusaurus/issues/11213
|
|
187
|
+
if (isCurrentPage) {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
updateCollapsed();
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// When navigating to a new category, we always expand
|
|
193
|
+
// see https://github.com/facebook/docusaurus/issues/10854#issuecomment-2609616182
|
|
194
|
+
updateCollapsed(false);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
updateCollapsed();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
// Dynamic indent for nested categories (level 3+)
|
|
204
|
+
const nestedIndent = level >= 3 ? (level - 2) * 0.05 : 0;
|
|
205
|
+
return ((0, jsx_runtime_1.jsxs)("li", { className: (0, clsx_1.default)(theme_common_1.ThemeClassNames.docs.docSidebarItemCategory, theme_common_1.ThemeClassNames.docs.docSidebarItemCategoryLevel(level), 'menu__list-item', {
|
|
206
|
+
'menu__list-item--collapsed': collapsed,
|
|
207
|
+
[styles_module_css_1.default.rootCategoryContainer]: isRootCategory,
|
|
208
|
+
}, className), children: [(0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)('menu__list-item-collapsible', {
|
|
209
|
+
'menu__list-item-collapsible--active': isCurrentPage,
|
|
210
|
+
}), children: (0, jsx_runtime_1.jsxs)(Link_1.default, { className: (0, clsx_1.default)(styles_module_css_1.default.categoryLink, 'menu__link', {
|
|
211
|
+
[styles_module_css_1.default.categoryLinkRoot]: isRootCategory,
|
|
212
|
+
'menu__link--sublist': collapsible && !isRootCategory,
|
|
213
|
+
'menu__link--sublist-caret': !href && collapsible && !isRootCategory,
|
|
214
|
+
'menu__link--active': isActive,
|
|
215
|
+
}), style: nestedIndent > 0
|
|
216
|
+
? { paddingLeft: `${nestedIndent + 0.5}rem` }
|
|
217
|
+
: undefined, onClick: handleItemClick, "aria-current": isCurrentPage ? 'page' : undefined, role: collapsible && !href && !isRootCategory ? 'button' : undefined, "aria-expanded": collapsible && !href && !isRootCategory ? !collapsed : undefined, href: collapsible && !isRootCategory
|
|
218
|
+
? (hrefWithSSRFallback ?? '#')
|
|
219
|
+
: hrefWithSSRFallback, ...props, children: [href && collapsible && !isRootCategory && ((0, jsx_runtime_1.jsx)(CollapseButton, { collapsed: collapsed, categoryLabel: label, onClick: (e) => {
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
updateCollapsed();
|
|
222
|
+
} })), (0, jsx_runtime_1.jsx)(CategoryLinkLabel, { label: label, isRootCategory: isRootCategory, customProps: customProps })] }) }), (0, jsx_runtime_1.jsx)(theme_common_1.Collapsible, { lazy: true, as: "ul", className: (0, clsx_1.default)('menu__list', isRootCategory && styles_module_css_1.default.categoryList), collapsed: collapsed, children: (0, jsx_runtime_1.jsx)(DocSidebarItems_1.default, { items: items, tabIndex: collapsed ? -1 : 0, onItemClick: onItemClick, activePath: activePath, level: level + 1 }) })] }));
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/DocSidebarItem/Category/index.tsx"],"names":[],"mappings":";;;;;AAiKA,yCAYC;;AA7KD,iCAKe;AACf,gDAAwB;AACxB,2DAMkC;AAClC,gEAA+D;AAC/D,mEAKgD;AAChD,4DAAoC;AACpC,qDAAkD;AAClD,4EAAoD;AACpD,sFAA8D;AAC9D,+EAAqE;AAErE,8EAAsD;AACtD,uFAA+D;AAU/D,4EAAyC;AAEzC,8EAA8E;AAC9E,gBAAgB;AAChB,SAAS,2BAA2B,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,GAMX;IACC,MAAM,SAAS,GAAG,IAAA,0BAAW,EAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,kBAAkB,GAA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4BACpB,CAAC,GACD,CACH,EACD,uBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,GACxB,IACG,GACH,EAEN,uBAAC,0BAAW,IACV,IAAI,QACJ,EAAE,EAAC,IAAI,EACP,SAAS,EAAE,IAAA,cAAI,EAAC,YAAY,EAAE,cAAc,IAAI,2BAAM,CAAC,YAAY,CAAC,EACpE,SAAS,EAAE,SAAS,YAEpB,uBAAC,yBAAe,IACd,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC5B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GAAG,CAAC,GAChB,GACU,IACX,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
.categoryLink {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding-left: 0;
|
|
6
|
+
gap: 0.1;
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.categoryLink::after {
|
|
11
|
+
order: -1;
|
|
12
|
+
margin-left: 1rem;
|
|
13
|
+
min-width: 1rem;
|
|
14
|
+
width: 1rem;
|
|
15
|
+
height: 1rem;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
background-size: contain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.categoryLinkLabel {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
display: -webkit-box;
|
|
23
|
+
line-clamp: 2;
|
|
24
|
+
-webkit-box-orient: vertical;
|
|
25
|
+
-webkit-line-clamp: 2;
|
|
26
|
+
color: var(--color-text-primary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.categoryLinkRoot {
|
|
30
|
+
padding-left: 1.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Root category container with full-height border */
|
|
34
|
+
.rootCategoryContainer {
|
|
35
|
+
position: relative;
|
|
36
|
+
margin-left: 1rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Circle outline at the top */
|
|
40
|
+
.rootCategoryContainer::before {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: calc(0.5rem - 4px);
|
|
44
|
+
top: 0.85rem;
|
|
45
|
+
width: 8px;
|
|
46
|
+
height: 8px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
border: 1px solid var(--ifm-toc-border-color);
|
|
49
|
+
background-color: var(--ifm-background-color);
|
|
50
|
+
z-index: 2;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
transition: border-color 0.15s ease, background-color 0.15s ease;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Circle outline turns blue on hover */
|
|
56
|
+
.rootCategoryContainer:has(> :global(.menu__list-item-collapsible) > :global(.menu__link):hover)::before {
|
|
57
|
+
border-color: var(--ifm-color-primary-light);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Circle outline turns blue when category has active item */
|
|
61
|
+
.rootCategoryContainer:has(:global(.menu__link--active))::before {
|
|
62
|
+
border-color: var(--ifm-color-primary-light);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Vertical line starting from the circle */
|
|
66
|
+
.rootCategoryContainer::after {
|
|
67
|
+
content: '';
|
|
68
|
+
position: absolute;
|
|
69
|
+
left: 0.5rem;
|
|
70
|
+
top: calc(0.85rem + 8px);
|
|
71
|
+
bottom: 0;
|
|
72
|
+
width: 1px;
|
|
73
|
+
background-color: var(--ifm-toc-border-color);
|
|
74
|
+
z-index: 1;
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.categoryLinkLabelRoot {
|
|
79
|
+
font-size: 1rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.categoryLinkLabelNested {
|
|
84
|
+
font-size: 0.85rem;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.categoryList {
|
|
89
|
+
position: relative;
|
|
90
|
+
margin-left: 0;
|
|
91
|
+
padding-left: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Reset margin for nested lists inside root category */
|
|
95
|
+
.categoryList :global(.menu__list) {
|
|
96
|
+
margin-left: 0;
|
|
97
|
+
padding-left: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Border indicator on nested items only (not on root category link itself) */
|
|
101
|
+
.rootCategoryContainer .categoryList :global(.menu__link) {
|
|
102
|
+
position: relative;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.rootCategoryContainer .categoryList :global(.menu__link)::before {
|
|
106
|
+
content: '';
|
|
107
|
+
position: absolute;
|
|
108
|
+
left: 0.5rem;
|
|
109
|
+
top: 0;
|
|
110
|
+
bottom: 0;
|
|
111
|
+
width: 2px;
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
z-index: 2;
|
|
114
|
+
transition: background-color 0.15s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rootCategoryContainer .categoryList :global(.menu__link:hover)::before {
|
|
118
|
+
background-color: var(--ifm-color-primary-light);
|
|
119
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Props } from '@theme/DocSidebarItem/Link';
|
|
3
|
+
import type { WithCustomProps } from '../../../types/sidebar';
|
|
4
|
+
export default function DocSidebarItemLink({ item, onItemClick, activePath, level, index: _index, ...props }: WithCustomProps<Props>): ReactNode;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/DocSidebarItem/Link/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAYvD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,IAAI,EACJ,WAAW,EACX,UAAU,EACV,KAAK,EACL,KAAK,EAAE,MAAM,EACb,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,SAAS,CAuDpC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = DocSidebarItemLink;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const theme_common_1 = require("@docusaurus/theme-common");
|
|
10
|
+
const client_1 = require("@docusaurus/plugin-content-docs/client");
|
|
11
|
+
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
12
|
+
const isInternalUrl_1 = __importDefault(require("@docusaurus/isInternalUrl"));
|
|
13
|
+
const ExternalLink_1 = __importDefault(require("@theme/Icon/ExternalLink"));
|
|
14
|
+
const ProBadge_1 = __importDefault(require("../../../components/ProBadge/ProBadge"));
|
|
15
|
+
const StatusBadge_1 = __importDefault(require("../../../components/StatusBadge/StatusBadge"));
|
|
16
|
+
const styles_module_css_1 = __importDefault(require("./styles.module.css"));
|
|
17
|
+
function LinkLabel({ label }) {
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("span", { title: label, className: styles_module_css_1.default.linkLabel, children: label }));
|
|
19
|
+
}
|
|
20
|
+
function DocSidebarItemLink({ item, onItemClick, activePath, level, index: _index, ...props }) {
|
|
21
|
+
const { href, label, className, autoAddBaseUrl, customProps } = item;
|
|
22
|
+
const isActive = (0, client_1.isActiveSidebarItem)(item, activePath);
|
|
23
|
+
const isInternalLink = (0, isInternalUrl_1.default)(href);
|
|
24
|
+
const isLink = item.type === 'link';
|
|
25
|
+
// Dynamic indent for nested items (level 3+)
|
|
26
|
+
const nestedIndent = level >= 3 ? (level - 2) * 0.05 : 0;
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("li", { className: (0, clsx_1.default)(theme_common_1.ThemeClassNames.docs.docSidebarItemLink, theme_common_1.ThemeClassNames.docs.docSidebarItemLinkLevel(level), 'menu__list-item', className), children: (0, jsx_runtime_1.jsxs)(Link_1.default, { className: (0, clsx_1.default)('menu__link', styles_module_css_1.default.menuLink, !isInternalLink && styles_module_css_1.default.menuExternalLink, {
|
|
28
|
+
'menu__link--active': isActive,
|
|
29
|
+
}), style: nestedIndent > 0
|
|
30
|
+
? { paddingLeft: `${nestedIndent + 2.5}rem` }
|
|
31
|
+
: undefined, autoAddBaseUrl: autoAddBaseUrl, "aria-current": isActive ? 'page' : undefined, to: href, ...(isInternalLink && {
|
|
32
|
+
onClick: onItemClick ? () => onItemClick(item) : undefined,
|
|
33
|
+
}), ...props, children: [(0, jsx_runtime_1.jsx)(LinkLabel, { label: label }), !isInternalLink && (0, jsx_runtime_1.jsx)(ExternalLink_1.default, {}), isLink && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [customProps?.plan === 'pro' && (0, jsx_runtime_1.jsx)(ProBadge_1.default, {}), customProps?.badgeType && ((0, jsx_runtime_1.jsx)(StatusBadge_1.default, { type: customProps.badgeType }))] }))] }) }, label));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/DocSidebarItem/Link/index.tsx"],"names":[],"mappings":";;;;;AAsB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AAK,EACH,YAAY,GAAG,CAAC;gBACd,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,YAAY,GAAG,GAAG,KAAK,EAAE;gBAC7C,CAAC,CAAC,SAAS,EAEf,cAAc,EAAE,cAAc,kBAChB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC3C,EAAE,EAAE,IAAI,KACJ,CAAC,cAAc,IAAI;gBACrB,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;aAC3D,CAAC,KACE,KAAK,aAET,uBAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,EAC1B,CAAC,cAAc,IAAI,uBAAC,sBAAgB,KAAG,EACvC,MAAM,IAAI,CACT,6DACG,WAAW,EAAE,IAAI,KAAK,KAAK,IAAI,uBAAC,kBAAQ,KAAG,EAC3C,WAAW,EAAE,SAAS,IAAI,CACzB,uBAAC,qBAAW,IAAC,IAAI,EAAE,WAAW,CAAC,SAAS,GAAI,CAC7C,IACA,CACJ,IACI,IAlCF,KAAK,CAmCP,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.menuExternalLink {
|
|
2
|
+
align-items: center;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.menuLink {
|
|
6
|
+
padding-left: 2rem;
|
|
7
|
+
padding-top: 0.25rem;
|
|
8
|
+
padding-bottom: 0.25rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.linkLabel {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
display: -webkit-box;
|
|
14
|
+
line-clamp: 2;
|
|
15
|
+
-webkit-box-orient: vertical;
|
|
16
|
+
-webkit-line-clamp: 2;
|
|
17
|
+
font-size: 0.8rem;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/TOC/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAUtC,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAC,EAAE,KAAK,GAAG,SAAS,CAWnE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = TOC;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const TOCItems_1 = __importDefault(require("@theme/TOCItems"));
|
|
10
|
+
const styles_module_css_1 = __importDefault(require("./styles.module.css"));
|
|
11
|
+
const TWGBadge_1 = __importDefault(require("../../components/TWGBadge/TWGBadge"));
|
|
12
|
+
// Using a custom className
|
|
13
|
+
// This prevents TOCInline/TOCCollapsible getting highlighted by mistake
|
|
14
|
+
const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight';
|
|
15
|
+
const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active';
|
|
16
|
+
function TOC({ className, ...props }) {
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)(styles_module_css_1.default.tableOfContents, 'thin-scrollbar', className), children: [(0, jsx_runtime_1.jsx)(TOCItems_1.default, { ...props, linkClassName: LINK_CLASS_NAME, linkActiveClassName: LINK_ACTIVE_CLASS_NAME }), (0, jsx_runtime_1.jsx)(TWGBadge_1.default, { visibleOnLarge: true })] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/TOC/index.tsx"],"names":[],"mappings":";;;;;AAaA,sBAWC;;AAvBD,gDAAwB;AACxB,+DAAuC;AAGvC,4EAAyC;AACzC,8EAAsD;AAEtD,2BAA2B;AAC3B,wEAAwE;AACxE,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE,MAAM,sBAAsB,GAAG,iCAAiC,CAAC;AAEjE,SAAwB,GAAG,CAAC,EAAC,SAAS,EAAE,GAAG,KAAK,EAAQ;IACtD,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,cAAI,EAAC,2BAAM,CAAC,eAAe,EAAE,gBAAgB,EAAE,SAAS,CAAC,aACvE,uBAAC,kBAAQ,OACH,KAAK,EACT,aAAa,EAAE,eAAe,EAC9B,mBAAmB,EAAE,sBAAsB,GAC3C,EACF,uBAAC,kBAAQ,IAAC,cAAc,EAAE,IAAI,GAAI,IAC9B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.tableOfContents {
|
|
2
|
+
max-height: calc(100vh - (var(--ifm-navbar-height) + 2rem));
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
position: sticky;
|
|
5
|
+
top: calc(var(--ifm-navbar-height) + 1rem);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (max-width: 996px) {
|
|
9
|
+
.tableOfContents {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.docItemContainer {
|
|
14
|
+
padding: 0 0.3rem;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
|
2
|
+
export interface CustomSidebarProps {
|
|
3
|
+
plan?: 'pro';
|
|
4
|
+
badgeType?: 'planned' | 'new';
|
|
5
|
+
}
|
|
6
|
+
export type AddCustomProps<T> = T extends readonly (infer U)[] ? Array<AddCustomProps<U>> : T extends object ? Omit<{
|
|
7
|
+
[K in keyof T]: AddCustomProps<T[K]>;
|
|
8
|
+
}, 'customProps'> & {
|
|
9
|
+
customProps?: CustomSidebarProps;
|
|
10
|
+
} : T;
|
|
11
|
+
export type TypedSidebarsConfig = AddCustomProps<SidebarsConfig>;
|
|
12
|
+
export type WithCustomProps<Props extends {
|
|
13
|
+
item: unknown;
|
|
14
|
+
}> = Omit<Props, 'item'> & {
|
|
15
|
+
item: AddCustomProps<Props['item']> & Props['item'];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/types/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CAC/B;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC1D,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,SAAS,MAAM,GACd,IAAI,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,EAAE,aAAa,CAAC,GAAG;IAC9D,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,GACD,CAAC,CAAC;AAER,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,IAAI,IAAI,CACjE,KAAK,EACL,MAAM,CACP,GAAG;IACF,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;CACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/types/sidebar.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@widlarzgroup/docusaurus-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"main": "./lib/index.js",
|
|
8
|
+
"types": "./lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"require": "./lib/index.js",
|
|
13
|
+
"import": "./lib/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"src"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"swizzle": "docusaurus swizzle",
|
|
22
|
+
"dev": "bun run build && tsc-watch -p tsconfig.build.json --onSuccess 'tsc-alias -p tsconfig.build.json && bun run copy-assets'",
|
|
23
|
+
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && bun run copy-assets",
|
|
24
|
+
"copy-assets": "find src -name '*.css' -exec sh -c 'mkdir -p lib/$(dirname ${1#src/}) && cp $1 lib/${1#src/}' _ {} \\;",
|
|
25
|
+
"prepublishOnly": "bun run build"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@docusaurus/tsconfig": "^3.9.2",
|
|
29
|
+
"@docusaurus/types": "^3.9.2",
|
|
30
|
+
"@types/react": "^19.0.0",
|
|
31
|
+
"@types/react-dom": "^19.0.0",
|
|
32
|
+
"tsc-alias": "^1.8.16",
|
|
33
|
+
"tsc-watch": "^6.2.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@docusaurus/core": "^3.9.2",
|
|
37
|
+
"@docusaurus/theme-classic": "^3.9.2",
|
|
38
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
39
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from './PlatformsList.module.css';
|
|
3
|
+
|
|
4
|
+
type Platform =
|
|
5
|
+
| 'Android'
|
|
6
|
+
| 'iOS'
|
|
7
|
+
| 'visionOS'
|
|
8
|
+
| 'tvOS'
|
|
9
|
+
| 'Windows UWP'
|
|
10
|
+
| 'Web'
|
|
11
|
+
| 'All';
|
|
12
|
+
|
|
13
|
+
interface Platforms {
|
|
14
|
+
types: Platform[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function PlatformsList({ types }: Platforms) {
|
|
18
|
+
return (
|
|
19
|
+
<p className={styles.paragraphStyle}>
|
|
20
|
+
{types.length === 1 && !types.includes('All')
|
|
21
|
+
? 'Platform:'
|
|
22
|
+
: 'Platforms:'}
|
|
23
|
+
<span className={styles.spanStyle}>{' ' + types.join(' | ')}</span>
|
|
24
|
+
</p>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default PlatformsList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
width: 18px;
|
|
6
|
+
height: 18px;
|
|
7
|
+
margin-left: 6px;
|
|
8
|
+
background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dim) 100%);
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.icon {
|
|
14
|
+
color: var(--color-bg-primary);
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
}
|
|
17
|
+
|