igniteui-astro-components 0.0.6 → 0.0.8
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 +7 -5
- package/src/assets/icons/open-link-blank.svg +1 -1
- package/src/assets/logos/code-sandbox.svg +14 -0
- package/src/assets/logos/stackblitz.svg +13 -0
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +1 -1
- package/src/components/DocsSidebar/DocsSidebar.astro +15 -8
- package/src/components/DocsSidebar/DocsSidebar.scss +152 -2
- package/src/components/DocsSidebar/SidebarFilterInput.scss +7 -3
- package/src/components/DocsSidebar/SidebarLabel.astro +25 -4
- package/src/components/DocsSidebar/toTreeNodes.ts +1 -1
- package/src/components/DocsSubHeader/DocsSubHeader.astro +119 -302
- package/src/components/DocsSubHeader/DocsSubHeader.scss +111 -11
- package/src/components/DocsToc/DocsToc.astro +5 -2
- package/src/components/DocsToc/toTreeNodes.ts +1 -1
- package/src/components/DocsTree/DocsTree.astro +9 -0
- package/src/components/DocsTree/docs-tree.scss +139 -118
- 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 +16 -6
- package/src/components/GlobalNavBar/README.md +8 -15
- package/src/components/LicenseIndicator/LicenseIndicator.astro +19 -0
- package/src/components/LicenseIndicator/LicenseIndicator.scss +5 -0
- package/src/components/Search/Search.astro +34 -15
- package/src/components/Search/Search.scss +10 -42
- package/src/components/SearchAdvanced/SearchAdvanced.astro +202 -366
- package/src/components/SearchAdvanced/SearchAdvanced.scss +177 -0
- package/src/components/ThemingWidget/ThemingWidget.astro +5 -10
- package/src/components/mdx/ApiRef/README.md +1 -1
- package/src/components/mdx/DocsAside/DocsAside.astro +37 -32
- package/src/components/mdx/DocsAside/DocsAside.scss +123 -35
- package/src/components/mdx/Sample/Sample.astro +55 -45
- package/src/components/mdx/Sample/Sample.scss +173 -30
- package/src/content.config.ts +1 -1
- package/src/integration.ts +25 -141
- package/src/layouts/DocsLayout/DocsLayout.astro +61 -20
- package/src/layouts/DocsLayout/DocsLayout.scss +51 -6
- package/src/lib/nav-helpers.ts +11 -4
- package/src/lib/sidebar/helpers.ts +14 -1
- package/src/lib/sidebar/types.ts +5 -7
- package/src/platform.ts +9 -16
- package/src/plugins/rehype-heading-anchors.ts +74 -0
- package/src/plugins/rehype-table-wrapper.ts +49 -0
- package/src/plugins/remark-docfx.ts +0 -368
- 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 +107 -116
- package/src/sidebar.ts +6 -7
- package/src/styles/global/_breakpoints.scss +4 -4
- package/src/styles/global/_code-blocks.scss +1 -1
- package/src/styles/global/_component-themes.scss +118 -18
- package/src/styles/global/_index.scss +2 -2
- package/src/styles/global/_markdown.scss +444 -32
- package/src/styles/global/_palette.scss +7 -0
- package/src/styles/global/_search-shared.scss +273 -0
- package/src/styles/global/_variables.scss +58 -3
- package/src/styles/theme.scss +80 -11
- package/src/virtual-modules.d.ts +1 -13
- package/src/assets/icons/copy-clipboard.svg +0 -3
- package/src/assets/icons/filter-clear.svg +0 -1
- package/src/styles/custom.scss +0 -20
|
@@ -18,8 +18,17 @@ import Search from '../Search/Search.astro';
|
|
|
18
18
|
import type { SidebarEntry } from '../../lib/sidebar/types';
|
|
19
19
|
import { getBreadcrumb } from '../../lib/sidebar/helpers';
|
|
20
20
|
import logoRaw from '../../assets/ig-logo.svg?raw';
|
|
21
|
+
import moonRaw from '../../assets/icons/moon.svg?raw';
|
|
22
|
+
import sunRaw from '../../assets/icons/sun.svg?raw';
|
|
21
23
|
import './DocsSubHeader.scss';
|
|
22
24
|
|
|
25
|
+
const PLATFORM_ICONS: Record<string, string> = {
|
|
26
|
+
angular: 'angular-logo',
|
|
27
|
+
react: 'react-logo',
|
|
28
|
+
blazor: 'blazor-logo',
|
|
29
|
+
'web-components': 'wc-logo',
|
|
30
|
+
};
|
|
31
|
+
|
|
23
32
|
interface ProductLink {
|
|
24
33
|
label: string;
|
|
25
34
|
href: string;
|
|
@@ -62,6 +71,12 @@ interface Props {
|
|
|
62
71
|
showThemeToggle?: boolean;
|
|
63
72
|
/** `localStorage` key for persisting the theme. Defaults to `'docs-theme'`. */
|
|
64
73
|
themeStorageKey?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Text label shown in the logo area when the GlobalNavBar is visible.
|
|
76
|
+
* Fades out and is replaced by the SVG logo once the subheader becomes sticky.
|
|
77
|
+
* Defaults to `'IgniteUI'`.
|
|
78
|
+
*/
|
|
79
|
+
logoText?: string;
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
const {
|
|
@@ -78,9 +93,11 @@ const {
|
|
|
78
93
|
versionLabel = 'Version',
|
|
79
94
|
showThemeToggle = false,
|
|
80
95
|
themeStorageKey = 'docs-theme',
|
|
96
|
+
logoText = 'IgniteUI',
|
|
81
97
|
} = Astro.props;
|
|
82
98
|
const resolvedSiteTitle = siteTitleProp ?? siteTitle;
|
|
83
99
|
const currentPlatform = virtualPlatform ?? null;
|
|
100
|
+
const platformIcon = currentPlatform ? (PLATFORM_ICONS[currentPlatform] ?? null) : null;
|
|
84
101
|
const resolvedLinks = (productLinksProp ?? productLinks) as ProductLink[];
|
|
85
102
|
const filteredLinks = resolvedLinks.filter((l: ProductLink) => l.platform !== currentPlatform);
|
|
86
103
|
|
|
@@ -89,123 +106,102 @@ const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug)
|
|
|
89
106
|
const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitle] : []);
|
|
90
107
|
---
|
|
91
108
|
|
|
92
|
-
<docs-subheader-menu>
|
|
93
|
-
<div class="docs-subheader">
|
|
94
|
-
<div class="igd-logo">
|
|
95
|
-
<Fragment set:html={logoRaw} />
|
|
96
|
-
<h1 class="ig-typography__body-2">{resolvedSiteTitle}</h1>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
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> -->
|
|
109
|
+
<docs-subheader-menu class="igd-docs-subheader" data-platform={currentPlatform ?? ''}>
|
|
111
110
|
|
|
112
|
-
|
|
113
|
-
|
|
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>
|
|
111
|
+
<div class="igd-logo">
|
|
112
|
+
<Fragment set:html={logoRaw} />
|
|
113
|
+
<h1 class="ig-typography__body-2">{logoText}</h1>
|
|
134
114
|
</div>
|
|
135
|
-
)}
|
|
136
115
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
116
|
+
<div class="igd-docs-subheader__content">
|
|
117
|
+
<!-- Search (overridable via named slot) -->
|
|
118
|
+
<slot name="search"><Search /></slot>
|
|
119
|
+
|
|
120
|
+
<!-- Package selector (optional) -->
|
|
121
|
+
{packages && packages.length > 0 && (
|
|
122
|
+
<igc-select id="package-select" class="igd-package-select" outlined value={selectedPackage} aria-label={packageLabel}>
|
|
123
|
+
{platformIcon && <igc-icon name={platformIcon} collection="docs" slot="prefix" aria-hidden="true"></igc-icon>}
|
|
124
|
+
{packages.map((p) => (
|
|
125
|
+
<igc-select-item value={p}>{p}</igc-select-item>
|
|
126
|
+
))}
|
|
127
|
+
</igc-select>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
<!-- Version selector (optional) -->
|
|
131
|
+
{versions && versions.length > 0 && (
|
|
132
|
+
<igc-select class="igd-version-select" id="version-select" outlined value={selectedVersion} aria-label={versionLabel}>
|
|
133
|
+
{versions.map((v) => (
|
|
134
|
+
<igc-select-item value={v}>{v}</igc-select-item>
|
|
135
|
+
))}
|
|
136
|
+
</igc-select>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
<!-- Toggle Astro light/dark mode -->
|
|
140
|
+
{showThemeToggle && (
|
|
141
|
+
<igc-icon-button
|
|
142
|
+
class="subheader-theme-toggle"
|
|
143
|
+
variant="flat"
|
|
144
|
+
data-theme-toggle
|
|
145
|
+
data-theme-key={themeStorageKey}
|
|
146
|
+
aria-label="Toggle theme"
|
|
147
|
+
title="Toggle light/dark theme">
|
|
148
|
+
<span class="theme-icon theme-icon--sun" aria-hidden="true"><Fragment set:html={sunRaw} /></span>
|
|
149
|
+
<span class="theme-icon theme-icon--moon" aria-hidden="true"><Fragment set:html={moonRaw} /></span>
|
|
150
|
+
</igc-icon-button>
|
|
151
|
+
)}
|
|
152
|
+
|
|
153
|
+
<!-- Hamburger — visible only when the sidebar is hidden (tablet + mobile) -->
|
|
154
|
+
<igc-icon-button
|
|
155
|
+
class="subheader-sidebar-toggle"
|
|
156
|
+
variant="flat"
|
|
157
|
+
data-sidebar-toggle
|
|
158
|
+
aria-label="Toggle sidebar navigation"
|
|
159
|
+
aria-expanded="false"
|
|
160
|
+
title="Toggle sidebar">
|
|
161
|
+
<igc-icon name="hamburger-menu" collection="docs" aria-hidden="true"></igc-icon>
|
|
143
162
|
</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>
|
|
156
163
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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 */}
|
|
164
|
+
<!-- TODO WHY WE NEED THIS? -->
|
|
165
|
+
<!--{filteredLinks.length > 0 && (-->
|
|
166
|
+
<!-- <div class="subheader-links">-->
|
|
167
|
+
<!-- {filteredLinks.map((link, i) => (-->
|
|
168
|
+
<!-- <>-->
|
|
169
|
+
<!-- {i > 0 && <span class="product-sep" aria-hidden="true">|</span>}-->
|
|
170
|
+
<!-- <a href={link.href} class="product-link">{link.label}</a>-->
|
|
171
|
+
<!-- </>-->
|
|
172
|
+
<!-- ))}-->
|
|
173
|
+
<!-- </div>-->
|
|
174
|
+
<!--)}-->
|
|
175
|
+
</div>
|
|
178
176
|
</docs-subheader-menu>
|
|
179
177
|
|
|
180
178
|
<script>
|
|
181
179
|
if (!customElements.get('docs-subheader-menu')) {
|
|
182
180
|
class DocsSubHeaderMenu extends HTMLElement {
|
|
183
181
|
connectedCallback() {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
setExpanded(this.getAttribute('aria-expanded') !== 'true');
|
|
194
|
-
});
|
|
182
|
+
// Sidebar toggle
|
|
183
|
+
const sidebarBtn = this.querySelector<HTMLButtonElement>('[data-sidebar-toggle]');
|
|
184
|
+
if (sidebarBtn) {
|
|
185
|
+
sidebarBtn.addEventListener('click', () => {
|
|
186
|
+
const expanded = document.body.hasAttribute('data-sidebar-open');
|
|
187
|
+
document.body.toggleAttribute('data-sidebar-open', !expanded);
|
|
188
|
+
sidebarBtn.setAttribute('aria-expanded', String(!expanded));
|
|
189
|
+
});
|
|
190
|
+
}
|
|
195
191
|
|
|
192
|
+
// Close sidebar on Escape
|
|
196
193
|
document.addEventListener('keyup', (e: KeyboardEvent) => {
|
|
197
|
-
if (e.key === 'Escape' &&
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
if (e.key === 'Escape' && document.body.hasAttribute('data-sidebar-open')) {
|
|
195
|
+
document.body.removeAttribute('data-sidebar-open');
|
|
196
|
+
sidebarBtn?.setAttribute('aria-expanded', 'false');
|
|
197
|
+
sidebarBtn?.focus();
|
|
200
198
|
}
|
|
201
199
|
});
|
|
202
200
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
document.addEventListener('click', (e: MouseEvent) => {
|
|
208
|
-
if (!this.contains(e.target as Node)) setExpanded(false);
|
|
201
|
+
// Close sidebar on page navigation
|
|
202
|
+
document.addEventListener('astro:page-load', () => {
|
|
203
|
+
document.body.removeAttribute('data-sidebar-open');
|
|
204
|
+
sidebarBtn?.setAttribute('aria-expanded', 'false');
|
|
209
205
|
});
|
|
210
206
|
|
|
211
207
|
// Theme toggle
|
|
@@ -219,6 +215,25 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
|
|
|
219
215
|
try { localStorage.setItem(key, next); } catch (_) {}
|
|
220
216
|
});
|
|
221
217
|
}
|
|
218
|
+
|
|
219
|
+
// Swap text → logo when the GlobalNavBar scrolls out of view.
|
|
220
|
+
const globalNav = document.querySelector('[data-astro-transition-persist="global-nav-bar"]');
|
|
221
|
+
if (globalNav) {
|
|
222
|
+
const observer = new IntersectionObserver(
|
|
223
|
+
([entry]) => {
|
|
224
|
+
this.classList.toggle('docs-subheader--pinned', !entry.isIntersecting);
|
|
225
|
+
},
|
|
226
|
+
{ threshold: 0 }
|
|
227
|
+
);
|
|
228
|
+
observer.observe(globalNav);
|
|
229
|
+
|
|
230
|
+
// On page navigation, always reset to the unpinned state.
|
|
231
|
+
// The observer fires mid-transition (GlobalNavBar briefly clipped)
|
|
232
|
+
// and would leave --pinned set when the new page loads at scroll=0.
|
|
233
|
+
document.addEventListener('astro:before-swap', () => {
|
|
234
|
+
this.classList.remove('docs-subheader--pinned');
|
|
235
|
+
});
|
|
236
|
+
}
|
|
222
237
|
}
|
|
223
238
|
}
|
|
224
239
|
|
|
@@ -227,206 +242,8 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
|
|
|
227
242
|
</script>
|
|
228
243
|
|
|
229
244
|
<script>
|
|
230
|
-
import {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
IgcSelectItemComponent,
|
|
234
|
-
IgcIconButtonComponent,
|
|
235
|
-
} from 'igniteui-webcomponents';
|
|
236
|
-
|
|
237
|
-
defineComponents(IgcSelectComponent, IgcSelectItemComponent, IgcIconButtonComponent);
|
|
245
|
+
import { defineComponents, IgcIconComponent, IgcIconButtonComponent } from 'igniteui-webcomponents';
|
|
246
|
+
import '../../scripts/icon-registry';
|
|
247
|
+
defineComponents(IgcIconComponent, IgcIconButtonComponent);
|
|
238
248
|
</script>
|
|
239
249
|
|
|
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>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
@use '../../styles/global/breakpoints' as *;
|
|
3
3
|
|
|
4
|
-
.docs-subheader {
|
|
4
|
+
.igd-docs-subheader {
|
|
5
5
|
position: sticky;
|
|
6
6
|
inset: 0;
|
|
7
7
|
display: grid;
|
|
@@ -14,39 +14,50 @@
|
|
|
14
14
|
border-block-end: var(--igd-app-outline);
|
|
15
15
|
z-index: 1;
|
|
16
16
|
background-color: var(--igd-layout-sections-bg);
|
|
17
|
+
|
|
18
|
+
// On tablet the sidebar column collapses — logo+toggle share their column,
|
|
19
|
+
// search fills the remainder. No extra column needed.
|
|
20
|
+
@media (max-width: #{$bp-mobile-horizontal-max}) {
|
|
21
|
+
.igd-docs-subheader {
|
|
22
|
+
--igd-page-layout-grid: 1fr;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
padding-inline-end: rem(16px);
|
|
26
|
+
}
|
|
17
27
|
|
|
18
28
|
.igd-logo {
|
|
19
29
|
display: flex;
|
|
20
30
|
align-items: center;
|
|
21
31
|
height: 100%;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
padding-inline: rem(32px) rem(16px);
|
|
33
|
+
|
|
34
|
+
@media (max-width: #{$bp-mobile-horizontal-max}) {
|
|
35
|
+
display: none;
|
|
25
36
|
}
|
|
26
|
-
|
|
27
|
-
svg {
|
|
37
|
+
|
|
38
|
+
> svg {
|
|
28
39
|
min-width: rem(79px);
|
|
29
40
|
height: rem(22px);
|
|
30
41
|
opacity: 0;
|
|
31
42
|
transform: translateY(-4px);
|
|
32
43
|
transition: opacity 200ms ease, transform 200ms ease;
|
|
33
44
|
position: absolute;
|
|
34
|
-
|
|
45
|
+
|
|
35
46
|
.logo-type {
|
|
36
47
|
fill: var(--igd-logo-type);
|
|
37
48
|
}
|
|
38
49
|
}
|
|
39
|
-
|
|
50
|
+
|
|
40
51
|
h1 {
|
|
41
52
|
opacity: 1;
|
|
42
53
|
transform: translateY(0);
|
|
43
54
|
transition: opacity 200ms ease, transform 200ms ease;
|
|
44
55
|
margin: 0;
|
|
45
56
|
}
|
|
46
|
-
|
|
57
|
+
|
|
47
58
|
border-inline-end: var(--igd-app-outline);
|
|
48
59
|
}
|
|
49
|
-
|
|
60
|
+
|
|
50
61
|
// Logo area: text visible by default, logo hidden.
|
|
51
62
|
// When the GlobalNavBar scrolls out of view, .docs-subheader--pinned is added
|
|
52
63
|
// and the logo fades in while the text fades out.
|
|
@@ -57,7 +68,7 @@
|
|
|
57
68
|
transform: translateY(0);
|
|
58
69
|
position: relative;
|
|
59
70
|
}
|
|
60
|
-
|
|
71
|
+
|
|
61
72
|
h1 {
|
|
62
73
|
opacity: 0;
|
|
63
74
|
transform: translateY(4px);
|
|
@@ -67,3 +78,92 @@
|
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
80
|
}
|
|
81
|
+
|
|
82
|
+
.igd-docs-subheader__content {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
height: 100%;
|
|
86
|
+
gap: rem(16px);
|
|
87
|
+
|
|
88
|
+
> igc-select:first-of-type {
|
|
89
|
+
margin-inline-start: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:last-child {
|
|
93
|
+
margin-inline-end: rem(32px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (max-width: #{$bp-mobile-horizontal-max}) {
|
|
97
|
+
&:last-child {
|
|
98
|
+
margin-inline-end: 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Sidebar toggle button — only visible on tablet/mobile (when the sidebar is hidden).
|
|
104
|
+
// Rendered as igc-icon-button; styled via CSS custom properties.
|
|
105
|
+
.subheader-sidebar-toggle {
|
|
106
|
+
display: none;
|
|
107
|
+
|
|
108
|
+
--foreground: light-dark(var(--ig-gray-700), var(--ig-gray-300));
|
|
109
|
+
--background: transparent;
|
|
110
|
+
--border-color: transparent;
|
|
111
|
+
|
|
112
|
+
--hover-foreground: var(--igd-accent);
|
|
113
|
+
--hover-background: transparent;
|
|
114
|
+
|
|
115
|
+
--focus-foreground: var(--igd-accent);
|
|
116
|
+
--focus-background: transparent;
|
|
117
|
+
|
|
118
|
+
--active-foreground: var(--igd-accent);
|
|
119
|
+
--active-background: transparent;
|
|
120
|
+
|
|
121
|
+
@media (max-width: #{$bp-tablet-max}) {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-shrink: 0;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Theme toggle: show sun in dark mode, moon in light mode.
|
|
128
|
+
.subheader-theme-toggle {
|
|
129
|
+
--foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
130
|
+
--background: transparent;
|
|
131
|
+
--border-color: transparent;
|
|
132
|
+
|
|
133
|
+
--hover-foreground: var(--ig-primary-100);
|
|
134
|
+
--hover-background: transparent;
|
|
135
|
+
|
|
136
|
+
--focus-foreground: var(--ig-primary-100);
|
|
137
|
+
--focus-background: transparent;
|
|
138
|
+
|
|
139
|
+
--active-foreground: var(--ig-primary-100);
|
|
140
|
+
--active-background: transparent;
|
|
141
|
+
|
|
142
|
+
.theme-icon {
|
|
143
|
+
display: flex;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.theme-icon--moon {
|
|
147
|
+
display: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
:root[data-theme='dark'] & {
|
|
151
|
+
.theme-icon--sun {
|
|
152
|
+
display: flex;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.theme-icon--moon {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
:root:not([data-theme='dark']) & {
|
|
161
|
+
.theme-icon--sun {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.theme-icon--moon {
|
|
166
|
+
display: flex;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -144,8 +144,11 @@ const nodes = headingsToTreeNodes(headings, tocConfig);
|
|
|
144
144
|
|
|
145
145
|
private bindOffsetTarget() {
|
|
146
146
|
const selector = this.dataset.offsetTarget ?? null;
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
// If an explicit selector is given, use it; otherwise fall back to
|
|
148
|
+
// the docs subheader which is always present in the layout.
|
|
149
|
+
this.offsetEl = (selector ? document.querySelector(selector) : null)
|
|
150
|
+
?? document.querySelector('docs-subheader-menu')
|
|
151
|
+
?? null;
|
|
149
152
|
if (!this.offsetEl) return;
|
|
150
153
|
|
|
151
154
|
this.syncScrollPadding();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter: Astro `MarkdownHeading[]` → TreeNode[] for the shared DocsTree.
|
|
3
3
|
*
|
|
4
|
-
* Filters headings by `min`/`max` heading level (matching
|
|
4
|
+
* Filters headings by `min`/`max` heading level (matching the TOC
|
|
5
5
|
* config), nests them by depth, and emits TreeNodes whose `href` points
|
|
6
6
|
* at the heading's anchor (`#slug`).
|
|
7
7
|
*
|