igniteui-astro-components 0.0.5 → 0.0.7
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 +9 -8
- package/package.json +6 -5
- package/src/components/DocsSidebar/DocsSidebar.astro +10 -2
- package/src/components/DocsSidebar/sidebar-filter.ts +26 -12
- package/src/components/DocsSubHeader/DocsSubHeader.astro +348 -48
- package/src/components/DocsSubHeader/README.md +41 -0
- package/src/components/DocsToc/toTreeNodes.ts +1 -1
- package/src/components/GlobalFooter/GlobalFooter.astro +12 -62
- package/src/components/GlobalFooter/README.md +7 -10
- package/src/components/GlobalNavBar/GlobalNavBar.astro +8 -193
- package/src/components/GlobalNavBar/GlobalNavBar.module.scss +0 -5
- package/src/components/GlobalNavBar/README.md +8 -15
- package/src/components/SearchAdvanced/README.md +105 -0
- package/src/components/SearchAdvanced/SearchAdvanced.astro +1056 -0
- package/src/components/ThemingWidget/ThemingWidget.astro +5 -10
- package/src/content.config.ts +1 -1
- package/src/integration.ts +19 -142
- package/src/layouts/DocsLayout/DocsLayout.astro +16 -6
- package/src/lib/nav-helpers.ts +11 -4
- package/src/platform.ts +9 -16
- package/src/plugins/remark-env-vars.ts +110 -0
- package/src/plugins/remark-html-transforms.ts +32 -0
- package/src/plugins/remark-md-links.ts +75 -0
- package/src/scripts/sample-widget.ts +0 -2
- package/src/sidebar.ts +6 -7
- package/src/virtual-modules.d.ts +1 -13
- package/src/plugins/remark-docfx.ts +0 -368
package/README.md
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Reusable [Astro](https://astro.build) components, layouts, integrations, and
|
|
4
4
|
utilities used to build Infragistics / Ignite UI documentation sites.
|
|
5
5
|
|
|
6
|
-
This package
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for consumer repos.
|
|
6
|
+
This package provides the navbar, sidebar, search, page frame, and MDX
|
|
7
|
+
components for Infragistics documentation sites, keeping the integration
|
|
8
|
+
story simple for consumer repos.
|
|
10
9
|
|
|
11
10
|
> **Status:** internal — published from this repo as a parallel copy of the
|
|
12
11
|
> components living in `docs-template`. Both trees are kept in sync until
|
|
@@ -73,7 +72,7 @@ export { default as Sample } from 'igniteui-astro-components/components/md
|
|
|
73
72
|
Pull in the base styles once (e.g. from your root layout or `astro.config`):
|
|
74
73
|
|
|
75
74
|
```ts
|
|
76
|
-
import 'igniteui-astro-components/styles/custom.
|
|
75
|
+
import 'igniteui-astro-components/styles/custom.scss';
|
|
77
76
|
import 'igniteui-astro-components/styles/ig-theme.scss';
|
|
78
77
|
```
|
|
79
78
|
|
|
@@ -234,7 +233,7 @@ const sidebar: SidebarEntry[] = [/* … your tree … */];
|
|
|
234
233
|
|
|
235
234
|
| Export | Purpose | Docs |
|
|
236
235
|
| --- | --- | --- |
|
|
237
|
-
| `…/components/GlobalNavBar.astro` | IG
|
|
236
|
+
| `…/components/GlobalNavBar.astro` | IG global navigation bar | [README](src/components/GlobalNavBar/README.md) |
|
|
238
237
|
| `…/components/GlobalFooter.astro` | IG global footer | [README](src/components/GlobalFooter/README.md) |
|
|
239
238
|
| `…/components/DocsSubHeader.astro` | Secondary fixed bar — site title + breadcrumb + product links + search | [README](src/components/DocsSubHeader/README.md) |
|
|
240
239
|
| `…/components/Search.astro` | Pagefind-powered full-text search modal | [README](src/components/Search/README.md) |
|
|
@@ -272,13 +271,15 @@ const sidebar: SidebarEntry[] = [/* … your tree … */];
|
|
|
272
271
|
| `…/content` | Content collection helpers |
|
|
273
272
|
| `…/content-config` | Default content collection schema |
|
|
274
273
|
| `…/llms` | `llms.txt` manifest generator |
|
|
275
|
-
| `…/plugins/remark-
|
|
274
|
+
| `…/plugins/remark-env-vars` | Remark plugin — `{Environment.X}` token substitution |
|
|
275
|
+
| `…/plugins/remark-md-links` | Remark plugin — `.md` → slug link rewriting + `DOCS_BASE` prepending |
|
|
276
|
+
| `…/plugins/remark-html-transforms` | Remark plugin — divider→`<hr>`, code lang normalization, img src fixes |
|
|
276
277
|
|
|
277
278
|
### Styles
|
|
278
279
|
|
|
279
280
|
| Export | Purpose |
|
|
280
281
|
| --- | --- |
|
|
281
|
-
| `…/styles/custom.
|
|
282
|
+
| `…/styles/custom.scss` | Base tokens + sidebar/sample styles |
|
|
282
283
|
| `…/styles/ig-theme.scss` | IG color palette mapped to design tokens |
|
|
283
284
|
|
|
284
285
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-astro-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Reusable Astro components, layouts, and integrations for Infragistics / Ignite UI documentation sites. Replaces the Starlight defaults with project-specific implementations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"./components/GlobalFooter.astro": "./src/components/GlobalFooter/GlobalFooter.astro",
|
|
45
45
|
"./components/DocsSubHeader.astro": "./src/components/DocsSubHeader/DocsSubHeader.astro",
|
|
46
46
|
"./components/Search.astro": "./src/components/Search/Search.astro",
|
|
47
|
+
"./components/SearchAdvanced.astro": "./src/components/SearchAdvanced/SearchAdvanced.astro",
|
|
47
48
|
"./components/ThemingWidget.astro": "./src/components/ThemingWidget/ThemingWidget.astro",
|
|
48
49
|
"./components/MobileSidebarToggle.astro": "./src/components/MobileSidebarToggle/MobileSidebarToggle.astro",
|
|
49
50
|
"./components/DocsToc.astro": "./src/components/DocsToc/DocsToc.astro",
|
|
@@ -65,9 +66,11 @@
|
|
|
65
66
|
"./lib/sidebar/types": "./src/lib/sidebar/types.ts",
|
|
66
67
|
"./lib/sidebar/helpers": "./src/lib/sidebar/helpers.ts",
|
|
67
68
|
"./lib/types": "./src/lib/types.ts",
|
|
68
|
-
"./plugins/remark-
|
|
69
|
+
"./plugins/remark-env-vars": "./src/plugins/remark-env-vars.ts",
|
|
70
|
+
"./plugins/remark-md-links": "./src/plugins/remark-md-links.ts",
|
|
71
|
+
"./plugins/remark-html-transforms": "./src/plugins/remark-html-transforms.ts",
|
|
69
72
|
"./styles/custom.scss": "./src/styles/custom.scss",
|
|
70
|
-
"./styles/
|
|
73
|
+
"./styles/theme.scss": "./src/styles/theme.scss",
|
|
71
74
|
"./package.json": "./package.json"
|
|
72
75
|
},
|
|
73
76
|
"peerDependencies": {
|
|
@@ -83,11 +86,9 @@
|
|
|
83
86
|
"@fontsource-variable/instrument-sans": "^5.2.8",
|
|
84
87
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
85
88
|
"igniteui-webcomponents": "^7.1.3",
|
|
86
|
-
"js-yaml": "^4.1.0",
|
|
87
89
|
"jsdom": "^29.0.1"
|
|
88
90
|
},
|
|
89
91
|
"devDependencies": {
|
|
90
|
-
"@types/js-yaml": "^4.0.9",
|
|
91
92
|
"@types/jsdom": "^21.1.7",
|
|
92
93
|
"astro": "^6.1.6",
|
|
93
94
|
"igniteui-theming": "^26.0.1",
|
|
@@ -24,6 +24,8 @@ interface Props {
|
|
|
24
24
|
* Useful when consuming the component without `siteMetaIntegration`.
|
|
25
25
|
*/
|
|
26
26
|
items?: SidebarEntry[];
|
|
27
|
+
/** Show the filter input above the tree. Defaults to true. */
|
|
28
|
+
showFilter?: boolean;
|
|
27
29
|
/**
|
|
28
30
|
* Append trailing slash to sidebar links.
|
|
29
31
|
* Defaults to the value derived from the site's `trailingSlash` Astro config
|
|
@@ -33,14 +35,14 @@ interface Props {
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
const useTrailingSlash = configuredTrailingSlash !== 'never';
|
|
36
|
-
const { currentSlug = '', items: itemsProp, trailingSlash = useTrailingSlash } = Astro.props;
|
|
38
|
+
const { currentSlug = '', items: itemsProp, showFilter = true, trailingSlash = useTrailingSlash } = Astro.props;
|
|
37
39
|
const items = (itemsProp ?? sidebarData) as SidebarEntry[];
|
|
38
40
|
const nodes = toTreeNodes(items, currentSlug, { trailingSlash });
|
|
39
41
|
const activeId = normalizeSlug(currentSlug);
|
|
40
42
|
---
|
|
41
43
|
|
|
42
44
|
<sidebar-filter class="docs-sidebar" id="docs-sidebar" data-no-results="No topics match">
|
|
43
|
-
<SidebarFilterInput/>
|
|
45
|
+
{ showFilter && <SidebarFilterInput/> }
|
|
44
46
|
<div class="sidebar-scroll" data-sidebar-scroll>
|
|
45
47
|
<DocsTree
|
|
46
48
|
nodes={ nodes }
|
|
@@ -74,3 +76,9 @@ const activeId = normalizeSlug(currentSlug);
|
|
|
74
76
|
import './sidebar-filter';
|
|
75
77
|
</script>
|
|
76
78
|
|
|
79
|
+
{ showFilter === false && (
|
|
80
|
+
<style is:global>
|
|
81
|
+
#docs-sidebar [data-sidebar-filter-status] { display: none; }
|
|
82
|
+
</style>
|
|
83
|
+
) }
|
|
84
|
+
|
|
@@ -104,6 +104,7 @@ type FilterInputEl = HTMLElement & { value: string; focus(): void };
|
|
|
104
104
|
type FilterClearEl = HTMLElement & { hidden: boolean };
|
|
105
105
|
|
|
106
106
|
class SidebarFilter extends HTMLElement {
|
|
107
|
+
private hasFilter = false;
|
|
107
108
|
private input!: FilterInputEl;
|
|
108
109
|
private clearBtn!: FilterClearEl;
|
|
109
110
|
private status!: HTMLElement;
|
|
@@ -122,11 +123,15 @@ class SidebarFilter extends HTMLElement {
|
|
|
122
123
|
const input = this.querySelector<FilterInputEl>('[data-sidebar-filter-input]');
|
|
123
124
|
const clearBtn = this.querySelector<FilterClearEl>('[data-sidebar-filter-clear]');
|
|
124
125
|
const status = this.querySelector<HTMLElement>('[data-sidebar-filter-status]');
|
|
125
|
-
|
|
126
|
+
const hasFilter = !!(input && clearBtn && status);
|
|
127
|
+
this.hasFilter = hasFilter;
|
|
128
|
+
|
|
129
|
+
if (hasFilter) {
|
|
130
|
+
this.input = input;
|
|
131
|
+
this.clearBtn = clearBtn;
|
|
132
|
+
this.status = status;
|
|
133
|
+
}
|
|
126
134
|
|
|
127
|
-
this.input = input;
|
|
128
|
-
this.clearBtn = clearBtn;
|
|
129
|
-
this.status = status;
|
|
130
135
|
this.scrollEl = this.querySelector<HTMLElement>(SCROLL_SELECTOR);
|
|
131
136
|
this.items = [...this.querySelectorAll<HTMLElement>(ITEM_SELECTOR)];
|
|
132
137
|
this.groups = [...this.querySelectorAll<HTMLElement>(GROUP_SELECTOR)];
|
|
@@ -138,7 +143,7 @@ class SidebarFilter extends HTMLElement {
|
|
|
138
143
|
safeSet(DETAILS_KEY, collectExpandedKeys(this).join('\n'));
|
|
139
144
|
}
|
|
140
145
|
|
|
141
|
-
this.bindEvents();
|
|
146
|
+
if (hasFilter) this.bindEvents(); else this.bindTreeEvents();
|
|
142
147
|
this.restoreOnConnect();
|
|
143
148
|
}
|
|
144
149
|
|
|
@@ -150,6 +155,11 @@ class SidebarFilter extends HTMLElement {
|
|
|
150
155
|
this.input.addEventListener('keydown', this.onFilterKeydown);
|
|
151
156
|
this.clearBtn.addEventListener('click', this.onClearClick);
|
|
152
157
|
|
|
158
|
+
this.bindTreeEvents();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Bind only the tree expand/collapse events (no filter input). */
|
|
162
|
+
private bindTreeEvents(): void {
|
|
153
163
|
// igcItemExpanded / igcItemCollapsed are dispatched on <igc-tree> with
|
|
154
164
|
// the igc-tree-item instance in event.detail — NOT in e.target.
|
|
155
165
|
this.addEventListener('igcItemExpanded', this.onItemToggle as EventListener);
|
|
@@ -209,14 +219,16 @@ class SidebarFilter extends HTMLElement {
|
|
|
209
219
|
const isClientNav = _isClientSideNav;
|
|
210
220
|
_isClientSideNav = false;
|
|
211
221
|
|
|
212
|
-
|
|
213
|
-
|
|
222
|
+
if (this.hasFilter) {
|
|
223
|
+
const saved = isClientNav ? safeGet(FILTER_KEY) : '';
|
|
224
|
+
if (!isClientNav) safeRemove(FILTER_KEY);
|
|
214
225
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
226
|
+
if (saved) {
|
|
227
|
+
this.input.value = saved;
|
|
228
|
+
this.applyFilter(saved, 'restore');
|
|
229
|
+
} else {
|
|
230
|
+
this.syncClearButton('');
|
|
231
|
+
}
|
|
220
232
|
}
|
|
221
233
|
|
|
222
234
|
this.restoreScroll(isClientNav);
|
|
@@ -373,10 +385,12 @@ class SidebarFilter extends HTMLElement {
|
|
|
373
385
|
// ── UI sync ──────────────────────────────────────────────────────────────
|
|
374
386
|
|
|
375
387
|
private updateStatus(state: 'no-match' | null): void {
|
|
388
|
+
if (!this.hasFilter) return;
|
|
376
389
|
this.status.textContent = state === 'no-match' ? (this.dataset.noResults ?? 'No topics match') : '';
|
|
377
390
|
}
|
|
378
391
|
|
|
379
392
|
private syncClearButton(value: string): void {
|
|
393
|
+
if (!this.hasFilter) return;
|
|
380
394
|
this.clearBtn.hidden = value.length === 0;
|
|
381
395
|
}
|
|
382
396
|
|
|
@@ -13,8 +13,11 @@
|
|
|
13
13
|
* moved to the `DocsBreadcrumb` component, rendered inside the main frame.
|
|
14
14
|
*/
|
|
15
15
|
import { platform as virtualPlatform } from 'virtual:docs-template/nav-html';
|
|
16
|
-
import { productLinks } from 'virtual:docs-template/site-meta';
|
|
16
|
+
import { productLinks, sidebar as sidebarData, title as siteTitle } from 'virtual:docs-template/site-meta';
|
|
17
17
|
import Search from '../Search/Search.astro';
|
|
18
|
+
import type { SidebarEntry } from '../../lib/sidebar/types';
|
|
19
|
+
import { getBreadcrumb } from '../../lib/sidebar/helpers';
|
|
20
|
+
import logoRaw from '../../assets/ig-logo.svg?raw';
|
|
18
21
|
import './DocsSubHeader.scss';
|
|
19
22
|
|
|
20
23
|
interface ProductLink {
|
|
@@ -24,61 +27,154 @@ interface ProductLink {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
interface Props {
|
|
30
|
+
/** Fallback title if the slug is not present in the sidebar tree. */
|
|
31
|
+
pageTitle?: string | null;
|
|
32
|
+
/** Current page slug — used to derive the breadcrumb from the sidebar tree. */
|
|
33
|
+
currentSlug?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Override the site title shown on the left. Defaults to the virtual module value.
|
|
36
|
+
* Useful when consuming without `siteMetaIntegration`.
|
|
37
|
+
*/
|
|
38
|
+
siteTitle?: string;
|
|
27
39
|
/**
|
|
28
40
|
* Override the cross-product navigation links. Defaults to the virtual module value.
|
|
29
41
|
* Useful when consuming without `siteMetaIntegration`.
|
|
30
42
|
*/
|
|
31
43
|
productLinks?: ProductLink[];
|
|
44
|
+
/**
|
|
45
|
+
* Override the sidebar tree used for breadcrumb generation.
|
|
46
|
+
* Defaults to the virtual module value.
|
|
47
|
+
*/
|
|
48
|
+
sidebarItems?: SidebarEntry[];
|
|
49
|
+
/** Package names for the package selector dropdown. When omitted the selector is hidden. */
|
|
50
|
+
packages?: string[];
|
|
51
|
+
/** Currently selected package (must match one of `packages`). */
|
|
52
|
+
selectedPackage?: string;
|
|
53
|
+
/** Label rendered before the package selector. Defaults to `'Package'`. */
|
|
54
|
+
packageLabel?: string;
|
|
55
|
+
/** Version labels for the version selector dropdown. When omitted the selector is hidden. */
|
|
56
|
+
versions?: string[];
|
|
57
|
+
/** Currently selected version (must match one of `versions`). */
|
|
58
|
+
selectedVersion?: string;
|
|
59
|
+
/** Label rendered before the version selector. Defaults to `'Version'`. */
|
|
60
|
+
versionLabel?: string;
|
|
61
|
+
/** Show a light/dark theme toggle button. */
|
|
62
|
+
showThemeToggle?: boolean;
|
|
63
|
+
/** `localStorage` key for persisting the theme. Defaults to `'docs-theme'`. */
|
|
64
|
+
themeStorageKey?: string;
|
|
32
65
|
}
|
|
33
66
|
|
|
34
|
-
const {
|
|
67
|
+
const {
|
|
68
|
+
pageTitle = '',
|
|
69
|
+
currentSlug = '',
|
|
70
|
+
siteTitle: siteTitleProp,
|
|
71
|
+
productLinks: productLinksProp,
|
|
72
|
+
sidebarItems,
|
|
73
|
+
packages,
|
|
74
|
+
selectedPackage,
|
|
75
|
+
packageLabel = 'Package',
|
|
76
|
+
versions,
|
|
77
|
+
selectedVersion,
|
|
78
|
+
versionLabel = 'Version',
|
|
79
|
+
showThemeToggle = false,
|
|
80
|
+
themeStorageKey = 'docs-theme',
|
|
81
|
+
} = Astro.props;
|
|
82
|
+
const resolvedSiteTitle = siteTitleProp ?? siteTitle;
|
|
35
83
|
const currentPlatform = virtualPlatform ?? null;
|
|
36
84
|
const resolvedLinks = (productLinksProp ?? productLinks) as ProductLink[];
|
|
37
85
|
const filteredLinks = resolvedLinks.filter((l: ProductLink) => l.platform !== currentPlatform);
|
|
38
|
-
|
|
86
|
+
|
|
87
|
+
const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
|
|
88
|
+
const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
|
|
89
|
+
const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitle] : []);
|
|
39
90
|
---
|
|
40
91
|
|
|
41
|
-
<docs-subheader-menu
|
|
92
|
+
<docs-subheader-menu>
|
|
93
|
+
<div class="docs-subheader">
|
|
42
94
|
<div class="igd-logo">
|
|
43
95
|
<Fragment set:html={logoRaw} />
|
|
44
|
-
<h1 class="ig-typography__body-2">
|
|
96
|
+
<h1 class="ig-typography__body-2">{resolvedSiteTitle}</h1>
|
|
45
97
|
</div>
|
|
46
98
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<!--
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<!--
|
|
61
|
-
|
|
62
|
-
|
|
99
|
+
<div class="subheader-body">
|
|
100
|
+
|
|
101
|
+
<!-- Left: title area, takes all free space -->
|
|
102
|
+
<!-- <div class="subheader-context">
|
|
103
|
+
{resolvedSiteTitle && <span class="subheader-site-title">{resolvedSiteTitle}</span>}
|
|
104
|
+
{crumbs.map((label: string, i: number) => (
|
|
105
|
+
<>
|
|
106
|
+
<span class="subheader-sep" aria-hidden="true">{i === 0 ? '-' : '/'}</span>
|
|
107
|
+
<span class="subheader-crumb" title={label}>{label}</span>
|
|
108
|
+
</>
|
|
109
|
+
))}
|
|
110
|
+
</div> -->
|
|
111
|
+
|
|
112
|
+
<!-- Search (overridable via named slot) -->
|
|
113
|
+
<slot name="search"><Search /></slot>
|
|
114
|
+
|
|
115
|
+
<!-- Package selector (optional) -->
|
|
116
|
+
{packages && packages.length > 0 && (
|
|
117
|
+
<div class="selector-group">
|
|
118
|
+
<igc-select id="package-select" outlined value={selectedPackage} aria-label={packageLabel}>
|
|
119
|
+
{packages.map((p) => (
|
|
120
|
+
<igc-select-item value={p}>{p}</igc-select-item>
|
|
121
|
+
))}
|
|
122
|
+
</igc-select>
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
<!-- Version selector (optional) -->
|
|
127
|
+
{versions && versions.length > 0 && (
|
|
128
|
+
<div class="selector-group">
|
|
129
|
+
<igc-select id="version-select" outlined value={selectedVersion} aria-label={versionLabel}>
|
|
130
|
+
{versions.map((v) => (
|
|
131
|
+
<igc-select-item value={v}>{v}</igc-select-item>
|
|
132
|
+
))}
|
|
133
|
+
</igc-select>
|
|
134
|
+
</div>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
<!-- Right: theme toggle + product links. Desktop: flex row. Mobile: absolute dropdown. -->
|
|
138
|
+
<div class="subheader-right" id="docs-subheader-panel">
|
|
139
|
+
{showThemeToggle && (
|
|
140
|
+
<igc-icon-button class="subheader-theme-toggle" variant="flat" data-theme-toggle data-theme-key={themeStorageKey} aria-label="Toggle theme" title="Toggle light/dark theme">
|
|
141
|
+
<svg class="theme-icon-light" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>
|
|
142
|
+
<svg class="theme-icon-dark" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
|
|
143
|
+
</igc-icon-button>
|
|
144
|
+
)}
|
|
145
|
+
{filteredLinks.length > 0 && (
|
|
146
|
+
<div class="subheader-links">
|
|
147
|
+
{filteredLinks.map((link, i) => (
|
|
148
|
+
<>
|
|
149
|
+
{i > 0 && <span class="product-sep" aria-hidden="true">|</span>}
|
|
150
|
+
<a href={link.href} class="product-link">{link.label}</a>
|
|
151
|
+
</>
|
|
152
|
+
))}
|
|
153
|
+
</div>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
63
156
|
|
|
64
157
|
<!-- Mobile toggle (hidden on desktop) -->
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
158
|
+
<button
|
|
159
|
+
class="subheader-toggle"
|
|
160
|
+
data-docs-toggle
|
|
161
|
+
aria-expanded="false"
|
|
162
|
+
aria-controls="docs-subheader-panel"
|
|
163
|
+
aria-label="Toggle navigation"
|
|
164
|
+
>
|
|
165
|
+
<svg class="icon-open" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
166
|
+
<line x1="3" y1="6" x2="21" y2="6" />
|
|
167
|
+
<line x1="3" y1="12" x2="21" y2="12" />
|
|
168
|
+
<line x1="3" y1="18" x2="21" y2="18" />
|
|
169
|
+
</svg>
|
|
170
|
+
<svg class="icon-close" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
171
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
172
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
173
|
+
</svg>
|
|
174
|
+
</button>
|
|
175
|
+
|
|
176
|
+
</div>{/* subheader-body */}
|
|
177
|
+
</div>{/* docs-subheader */}
|
|
82
178
|
</docs-subheader-menu>
|
|
83
179
|
|
|
84
180
|
<script>
|
|
@@ -112,16 +208,16 @@ import logoRaw from '../../assets/ig-logo.svg?raw';
|
|
|
112
208
|
if (!this.contains(e.target as Node)) setExpanded(false);
|
|
113
209
|
});
|
|
114
210
|
|
|
115
|
-
//
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
211
|
+
// Theme toggle
|
|
212
|
+
const themeBtn = this.querySelector<HTMLElement>('[data-theme-toggle]');
|
|
213
|
+
if (themeBtn) {
|
|
214
|
+
themeBtn.addEventListener('click', () => {
|
|
215
|
+
const current = document.documentElement.getAttribute('data-theme');
|
|
216
|
+
const next = current === 'dark' ? 'light' : 'dark';
|
|
217
|
+
document.documentElement.setAttribute('data-theme', next);
|
|
218
|
+
const key = themeBtn.dataset.themeKey || 'docs-theme';
|
|
219
|
+
try { localStorage.setItem(key, next); } catch (_) {}
|
|
220
|
+
});
|
|
125
221
|
}
|
|
126
222
|
}
|
|
127
223
|
}
|
|
@@ -130,3 +226,207 @@ import logoRaw from '../../assets/ig-logo.svg?raw';
|
|
|
130
226
|
}
|
|
131
227
|
</script>
|
|
132
228
|
|
|
229
|
+
<script>
|
|
230
|
+
import {
|
|
231
|
+
defineComponents,
|
|
232
|
+
IgcSelectComponent,
|
|
233
|
+
IgcSelectItemComponent,
|
|
234
|
+
IgcIconButtonComponent,
|
|
235
|
+
} from 'igniteui-webcomponents';
|
|
236
|
+
|
|
237
|
+
defineComponents(IgcSelectComponent, IgcSelectItemComponent, IgcIconButtonComponent);
|
|
238
|
+
</script>
|
|
239
|
+
|
|
240
|
+
<style>
|
|
241
|
+
docs-subheader-menu {
|
|
242
|
+
display: contents;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* ── Body: flex row occupying grid column 2 ────────────────────────────── */
|
|
246
|
+
|
|
247
|
+
.subheader-body {
|
|
248
|
+
display: flex;
|
|
249
|
+
flex-direction: row;
|
|
250
|
+
align-items: center;
|
|
251
|
+
gap: 0.75rem;
|
|
252
|
+
padding-inline: 1rem;
|
|
253
|
+
overflow: visible;
|
|
254
|
+
min-width: 0;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* ── Context (left) ────────────────────────────────────────────────────── */
|
|
258
|
+
|
|
259
|
+
.subheader-context {
|
|
260
|
+
flex: 1;
|
|
261
|
+
min-width: 0;
|
|
262
|
+
display: flex;
|
|
263
|
+
flex-direction: row;
|
|
264
|
+
align-items: center;
|
|
265
|
+
gap: 0.375rem;
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.subheader-site-title {
|
|
270
|
+
flex-shrink: 0;
|
|
271
|
+
font-size: 0.875rem;
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
color: var(--sl-color-text-accent);
|
|
274
|
+
white-space: nowrap;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.subheader-page-title {
|
|
278
|
+
font-size: 0.875rem;
|
|
279
|
+
color: var(--sl-color-text);
|
|
280
|
+
white-space: nowrap;
|
|
281
|
+
overflow: hidden;
|
|
282
|
+
text-overflow: ellipsis;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.subheader-crumb {
|
|
286
|
+
flex-shrink: 0;
|
|
287
|
+
font-size: 0.875rem;
|
|
288
|
+
color: var(--sl-color-gray-4);
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
overflow: hidden;
|
|
291
|
+
text-overflow: ellipsis;
|
|
292
|
+
max-width: 14rem;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.subheader-sep {
|
|
296
|
+
flex-shrink: 0;
|
|
297
|
+
color: var(--sl-color-gray-3);
|
|
298
|
+
font-size: 0.875rem;
|
|
299
|
+
user-select: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* ── Selectors (optional) ──────────────────────────────────────────────── */
|
|
303
|
+
|
|
304
|
+
.selector-group {
|
|
305
|
+
flex-shrink: 0;
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
gap: 0.3rem;
|
|
309
|
+
white-space: nowrap;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.selector-group igc-select {
|
|
313
|
+
min-width: 100px;
|
|
314
|
+
--ig-size: 1;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* ── Theme toggle (optional) ────────────────────────────────────────────── */
|
|
318
|
+
|
|
319
|
+
.subheader-theme-toggle {
|
|
320
|
+
--ig-size: 1;
|
|
321
|
+
color: var(--sl-color-text);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.subheader-theme-toggle .theme-icon-dark { display: none; }
|
|
325
|
+
:global([data-theme='dark']) .subheader-theme-toggle .theme-icon-light { display: none; }
|
|
326
|
+
:global([data-theme='dark']) .subheader-theme-toggle .theme-icon-dark { display: block; }
|
|
327
|
+
|
|
328
|
+
/* ── Right side: links ──────────────────────────────────────────────────── */
|
|
329
|
+
|
|
330
|
+
.subheader-right {
|
|
331
|
+
flex-shrink: 0;
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: row;
|
|
334
|
+
align-items: center;
|
|
335
|
+
gap: 0.5rem;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.subheader-links {
|
|
339
|
+
display: flex;
|
|
340
|
+
flex-direction: row;
|
|
341
|
+
align-items: center;
|
|
342
|
+
flex-wrap: nowrap;
|
|
343
|
+
gap: 0;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.product-link {
|
|
347
|
+
font-size: 0.75rem;
|
|
348
|
+
color: var(--sl-color-gray-2);
|
|
349
|
+
text-decoration: none;
|
|
350
|
+
white-space: nowrap;
|
|
351
|
+
padding-inline: 0.25rem;
|
|
352
|
+
line-height: 1;
|
|
353
|
+
transition: color 0.15s;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.product-link:hover,
|
|
357
|
+
.product-link:focus-visible {
|
|
358
|
+
color: var(--sl-color-text-accent);
|
|
359
|
+
text-decoration: underline;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.product-sep {
|
|
363
|
+
flex-shrink: 0;
|
|
364
|
+
font-size: 0.6875rem;
|
|
365
|
+
color: var(--sl-color-gray-4);
|
|
366
|
+
padding-inline: 0.125rem;
|
|
367
|
+
line-height: 1;
|
|
368
|
+
user-select: none;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* ── Mobile toggle (hidden on desktop) ─────────────────────────────────── */
|
|
372
|
+
|
|
373
|
+
.subheader-toggle {
|
|
374
|
+
display: none;
|
|
375
|
+
flex-shrink: 0;
|
|
376
|
+
padding: 0.25rem;
|
|
377
|
+
background: none;
|
|
378
|
+
border: none;
|
|
379
|
+
border-radius: 0.25rem;
|
|
380
|
+
color: var(--sl-color-text);
|
|
381
|
+
cursor: pointer;
|
|
382
|
+
line-height: 0;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/* ══ Mobile (≤ 50rem) ══════════════════════════════════════════════════════ */
|
|
386
|
+
|
|
387
|
+
@media (max-width: 50rem) {
|
|
388
|
+
.selector-group { display: none; }
|
|
389
|
+
|
|
390
|
+
.subheader-right {
|
|
391
|
+
display: none;
|
|
392
|
+
position: absolute;
|
|
393
|
+
top: 100%;
|
|
394
|
+
left: 0;
|
|
395
|
+
right: 0;
|
|
396
|
+
flex-direction: column;
|
|
397
|
+
align-items: stretch;
|
|
398
|
+
gap: 0.5rem;
|
|
399
|
+
padding: 0.75rem 1rem;
|
|
400
|
+
background-color: var(--sl-color-bg-nav);
|
|
401
|
+
border-bottom: 1px solid var(--sl-color-hairline-shade);
|
|
402
|
+
box-shadow: var(--sl-shadow-md);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
docs-subheader-menu[aria-expanded='true'] .subheader-right {
|
|
406
|
+
display: flex;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.subheader-links {
|
|
410
|
+
flex-wrap: wrap;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.product-link {
|
|
414
|
+
font-size: 0.875rem;
|
|
415
|
+
padding-block: 0.25rem;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.subheader-toggle {
|
|
419
|
+
display: flex;
|
|
420
|
+
align-items: center;
|
|
421
|
+
justify-content: center;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.subheader-toggle:hover,
|
|
425
|
+
.subheader-toggle:focus-visible {
|
|
426
|
+
background-color: var(--sl-color-hairline);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
docs-subheader-menu[aria-expanded='true'] .subheader-toggle .icon-open { display: none; }
|
|
430
|
+
docs-subheader-menu:not([aria-expanded='true']) .subheader-toggle .icon-close { display: none; }
|
|
431
|
+
}
|
|
432
|
+
</style>
|