igniteui-astro-components 0.0.14 → 0.0.16
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/package.json +2 -1
- package/src/components/CopyCode/CopyCode.astro +73 -0
- package/src/components/DocsSidebar/DocsSidebar.scss +19 -18
- package/src/components/DocsSidebar/SidebarFilterInput.scss +2 -3
- package/src/components/DocsSidebar/SidebarLabel.astro +1 -1
- package/src/components/DocsSidebar/sidebar-filter.ts +54 -13
- package/src/components/DocsSubHeader/DocsSubHeader.astro +35 -2
- package/src/components/DocsSubHeader/DocsSubHeader.scss +3 -1
- package/src/components/DocsToc/DocsToc.scss +1 -1
- package/src/components/DocsTree/docs-tree.scss +138 -32
- package/src/components/Search/Search.scss +8 -0
- package/src/components/SearchAdvanced/SearchAdvanced.astro +48 -1
- package/src/components/SearchAdvanced/SearchAdvanced.scss +44 -2
- package/src/components/mdx/ApiLink/ApiLink.astro +1 -0
- package/src/components/mdx/ApiLink/ApiLink.scss +13 -0
- package/src/components/mdx/Sample/Sample.scss +4 -3
- package/src/layouts/DocsLayout/DocsLayout.astro +5 -2
- package/src/styles/global/_code-blocks.scss +41 -42
- package/src/styles/global/_markdown.scss +83 -34
- package/src/styles/global/_search-shared.scss +2 -9
- package/src/styles/global/_type-scale.scss +17 -19
- package/src/styles/global/_variables.scss +7 -7
- package/src/styles/theme.scss +30 -2
- package/src/virtual-modules.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-astro-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
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": {
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@fontsource-variable/instrument-sans": "^5.2.8",
|
|
90
|
+
"@fontsource-variable/inter": "^5.2.8",
|
|
90
91
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
91
92
|
"igniteui-webcomponents": "^7.1.3",
|
|
92
93
|
"jsdom": "^29.0.1"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import '../../scripts/icon-registry';
|
|
3
|
+
import { defineComponents, IgcIconButtonComponent, IgcIconComponent } from 'igniteui-webcomponents';
|
|
4
|
+
|
|
5
|
+
defineComponents(IgcIconButtonComponent, IgcIconComponent);
|
|
6
|
+
|
|
7
|
+
function initCopyButtons(): void {
|
|
8
|
+
document.querySelectorAll<HTMLPreElement>('pre.astro-code, pre.shiki').forEach((pre) => {
|
|
9
|
+
if (pre.closest('.copy-code-wrapper')) return;
|
|
10
|
+
|
|
11
|
+
const wrapper = document.createElement('div');
|
|
12
|
+
wrapper.className = 'copy-code-wrapper';
|
|
13
|
+
pre.parentNode!.insertBefore(wrapper, pre);
|
|
14
|
+
wrapper.appendChild(pre);
|
|
15
|
+
|
|
16
|
+
const btn = document.createElement('igc-icon-button') as HTMLElement;
|
|
17
|
+
btn.setAttribute('variant', 'flat');
|
|
18
|
+
btn.setAttribute('aria-label', 'Copy code');
|
|
19
|
+
btn.className = 'copy-btn';
|
|
20
|
+
|
|
21
|
+
const icon = document.createElement('igc-icon') as HTMLElement;
|
|
22
|
+
icon.setAttribute('name', 'copy');
|
|
23
|
+
icon.setAttribute('collection', 'docs');
|
|
24
|
+
btn.appendChild(icon);
|
|
25
|
+
|
|
26
|
+
btn.addEventListener('click', () => {
|
|
27
|
+
const code = pre.querySelector('code');
|
|
28
|
+
const text = code ? (code.textContent ?? '') : (pre.textContent ?? '');
|
|
29
|
+
|
|
30
|
+
const resetState = () => {
|
|
31
|
+
icon.setAttribute('name', 'copy');
|
|
32
|
+
btn.setAttribute('aria-label', 'Copy code');
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const showCopied = () => {
|
|
36
|
+
icon.setAttribute('name', 'check');
|
|
37
|
+
btn.setAttribute('aria-label', 'Copied!');
|
|
38
|
+
setTimeout(resetState, 1500);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const showFailed = () => {
|
|
42
|
+
btn.setAttribute('aria-label', 'Copy failed');
|
|
43
|
+
setTimeout(resetState, 1500);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const fallback = (value: string): boolean => {
|
|
47
|
+
const ta = document.createElement('textarea');
|
|
48
|
+
ta.value = value;
|
|
49
|
+
ta.setAttribute('readonly', '');
|
|
50
|
+
ta.style.cssText = 'position:fixed;opacity:0;pointer-events:none';
|
|
51
|
+
document.body.appendChild(ta);
|
|
52
|
+
ta.select();
|
|
53
|
+
ta.setSelectionRange(0, value.length);
|
|
54
|
+
try { return document.execCommand('copy'); } catch { return false; }
|
|
55
|
+
finally { document.body.removeChild(ta); }
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
if (navigator.clipboard?.writeText) {
|
|
59
|
+
navigator.clipboard.writeText(text).then(showCopied).catch(() => {
|
|
60
|
+
fallback(text) ? showCopied() : showFailed();
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
fallback(text) ? showCopied() : showFailed();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
wrapper.appendChild(btn);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
initCopyButtons();
|
|
72
|
+
document.addEventListener('astro:page-load', initCopyButtons);
|
|
73
|
+
</script>
|
|
@@ -8,26 +8,27 @@
|
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
z-index: var(--igd-sidebar-z-index);
|
|
10
10
|
border-inline-end: var(--igd-app-outline);
|
|
11
|
-
padding-inline:
|
|
12
|
-
padding-block:
|
|
11
|
+
padding-inline: rem(16px);
|
|
12
|
+
padding-block: rem(24px);
|
|
13
13
|
background-color: var(--igd-layout-sections-bg);
|
|
14
14
|
position: sticky;
|
|
15
15
|
top: var(--igd-header-height);
|
|
16
16
|
height: calc(100dvh - var(--igd-header-height));
|
|
17
17
|
max-height: 100dvh;
|
|
18
18
|
align-self: start;
|
|
19
|
-
gap: rem(
|
|
19
|
+
gap: rem(8px);
|
|
20
|
+
view-transition-name: docs-sidebar;
|
|
20
21
|
|
|
21
22
|
.sidebar-gutter {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: rem(8px);
|
|
22
25
|
overflow-y: hidden;
|
|
23
|
-
scrollbar-gutter: stable;
|
|
24
26
|
|
|
25
27
|
// This Makes sure the input border is visible
|
|
26
28
|
// This is the height of the input in fluent theme + 8px padding
|
|
27
29
|
// TODO this can be made smart using a css variable to override the original height of the input and used here
|
|
28
30
|
min-height: rem(40px);
|
|
29
31
|
|
|
30
|
-
|
|
31
32
|
igc-icon {
|
|
32
33
|
color: light-dark(var(--ig-gray-800), var(--ig-gray-300));
|
|
33
34
|
}
|
|
@@ -74,37 +75,37 @@
|
|
|
74
75
|
display: flex;
|
|
75
76
|
align-items: center;
|
|
76
77
|
gap: rem(8px);
|
|
78
|
+
padding: rem(4px);
|
|
77
79
|
|
|
78
80
|
igc-badge {
|
|
79
81
|
justify-self: end;
|
|
80
82
|
}
|
|
83
|
+
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
.docs-tree-group {
|
|
84
87
|
gap: rem(8px);
|
|
88
|
+
padding-inline-end: rem(4px);
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
.group-label-text {
|
|
88
92
|
@include type-style('body-2') {
|
|
93
|
+
//font-weight: 600;
|
|
89
94
|
margin-block: 0;
|
|
90
95
|
};
|
|
91
96
|
|
|
92
|
-
color: light-dark(var(--ig-gray-
|
|
93
|
-
|
|
94
|
-
&:hover {
|
|
95
|
-
color: var(--igd-accent);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
igc-tree-item[active] {
|
|
100
|
-
.group-label-text {
|
|
101
|
-
color: var(--igd-accent);
|
|
102
|
-
}
|
|
97
|
+
color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
|
|
98
|
+
user-select: none;
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
.group-label-count {
|
|
106
|
-
color: light-dark(var(--ig-gray-
|
|
107
|
-
|
|
102
|
+
color: light-dark(var(--ig-gray-700), var(--ig-gray-600));
|
|
103
|
+
background: light-dark(var(--ig-gray-100), var(--ig-gray-200));
|
|
104
|
+
padding: rem(2px) rem(8px);
|
|
105
|
+
aspect-ratio: 1;
|
|
106
|
+
border-radius: rem(4px);
|
|
107
|
+
margin-inline-start: rem(8px);
|
|
108
|
+
font-size: 12px;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.igd-badge-container {
|
|
@@ -30,11 +30,10 @@ igc-input::part(container) {
|
|
|
30
30
|
border-block-start: 0;
|
|
31
31
|
border-block-end: rem(1px) solid light-dark(var(--ig-gray-200), var(--ig-gray-300));
|
|
32
32
|
border-radius: 0;
|
|
33
|
-
padding-inline: rem(16px);
|
|
34
33
|
|
|
35
34
|
// TODO make this more stable using css vars
|
|
36
35
|
// padding-inline-end is 8px(padding) - 5px(scrollbar width)
|
|
37
|
-
padding-inline-end: rem(
|
|
36
|
+
padding-inline-end: rem(12px);
|
|
38
37
|
|
|
39
38
|
padding-block-end: rem(8px);
|
|
40
39
|
|
|
@@ -64,7 +63,7 @@ igc-button {
|
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
color: light-dark(var(--ig-gray-600), var(--ig-gray-700));
|
|
67
|
-
padding-inline:
|
|
66
|
+
padding-inline: 0;
|
|
68
67
|
|
|
69
68
|
&:empty {
|
|
70
69
|
display: none;
|
|
@@ -52,6 +52,6 @@ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
|
|
|
52
52
|
) : (
|
|
53
53
|
<span class="group-label-text">
|
|
54
54
|
<span>{node.label}</span>
|
|
55
|
-
|
|
55
|
+
<!--<span class="group-label-count">{childCount}</span>-->
|
|
56
56
|
</span>
|
|
57
57
|
)}
|
|
@@ -150,11 +150,9 @@ class SidebarFilter extends HTMLElement {
|
|
|
150
150
|
// ── Events ───────────────────────────────────────────────────────────────
|
|
151
151
|
|
|
152
152
|
private bindEvents(): void {
|
|
153
|
-
|
|
154
|
-
this.input.addEventListener('igcInput', this.onFilterInput as EventListener);
|
|
153
|
+
this.input.addEventListener('igcInput', this.onFilterInput as EventListener);
|
|
155
154
|
this.input.addEventListener('keydown', this.onFilterKeydown);
|
|
156
155
|
this.clearBtn.addEventListener('click', this.onClearClick);
|
|
157
|
-
|
|
158
156
|
this.bindTreeEvents();
|
|
159
157
|
}
|
|
160
158
|
|
|
@@ -167,14 +165,43 @@ class SidebarFilter extends HTMLElement {
|
|
|
167
165
|
}
|
|
168
166
|
|
|
169
167
|
private onFilterInput = (): void => {
|
|
168
|
+
this.pinScrollY();
|
|
170
169
|
safeSet(FILTER_KEY, this.input.value);
|
|
171
170
|
this.applyFilter(this.input.value, 'user');
|
|
172
171
|
};
|
|
173
172
|
|
|
174
173
|
private onFilterKeydown = (e: KeyboardEvent): void => {
|
|
174
|
+
this.pinScrollY();
|
|
175
175
|
if (e.key === 'Escape' && this.input.value) this.resetFilter();
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Chrome-only: filter mutations trigger a browser-internal scroll. Pin
|
|
180
|
+
* scrollY via rAF for ~200ms (before-paint, invisible) and force
|
|
181
|
+
* `scroll-behavior: auto` so it's an instant jump, not a smooth animation
|
|
182
|
+
* we'd have to fight each frame. Prior inline value is restored at end.
|
|
183
|
+
*/
|
|
184
|
+
private pinFrames = 0;
|
|
185
|
+
private prevScrollBehavior: string | null = null;
|
|
186
|
+
private pinScrollY = (): void => {
|
|
187
|
+
const wasActive = this.pinFrames > 0;
|
|
188
|
+
const y = window.scrollY;
|
|
189
|
+
this.pinFrames = 10;
|
|
190
|
+
if (wasActive) return;
|
|
191
|
+
this.prevScrollBehavior = document.documentElement.style.getPropertyValue('scroll-behavior');
|
|
192
|
+
document.documentElement.style.setProperty('scroll-behavior', 'auto', 'important');
|
|
193
|
+
const tick = (): void => {
|
|
194
|
+
if (window.scrollY !== y) window.scrollTo({ top: y, behavior: 'instant' as ScrollBehavior });
|
|
195
|
+
if (--this.pinFrames > 0) requestAnimationFrame(tick);
|
|
196
|
+
else {
|
|
197
|
+
if (this.prevScrollBehavior) document.documentElement.style.setProperty('scroll-behavior', this.prevScrollBehavior);
|
|
198
|
+
else document.documentElement.style.removeProperty('scroll-behavior');
|
|
199
|
+
this.prevScrollBehavior = null;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
tick();
|
|
203
|
+
};
|
|
204
|
+
|
|
178
205
|
private onClearClick = (): void => {
|
|
179
206
|
this.resetFilter();
|
|
180
207
|
this.input.focus();
|
|
@@ -237,22 +264,35 @@ class SidebarFilter extends HTMLElement {
|
|
|
237
264
|
private restoreScroll(isClientNav: boolean): void {
|
|
238
265
|
const sc = this.scrollEl;
|
|
239
266
|
if (!sc) return;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
267
|
+
if (isClientNav) {
|
|
268
|
+
// igc-tree-item is already defined; one rAF is enough for layout.
|
|
269
|
+
requestAnimationFrame(() => {
|
|
270
|
+
// Snap to the pre-navigation position first so the sidebar appears
|
|
271
|
+
// where the user last saw it, then smooth-scroll the short remaining
|
|
272
|
+
// distance to center the active item.
|
|
273
|
+
sc.scrollTop = parseInt(safeGet(SCROLL_KEY) || '0', 10) || 0;
|
|
274
|
+
sc.style.visibility = '';
|
|
275
|
+
sc.scrollTo({ top: this.activeScrollOffset(sc), behavior: 'smooth' });
|
|
276
|
+
});
|
|
277
|
+
} else {
|
|
278
|
+
// Hard page load: wait for igc-tree-item so Lit microtasks drain first.
|
|
279
|
+
customElements.whenDefined('igc-tree-item').then(() =>
|
|
280
|
+
requestAnimationFrame(() => {
|
|
281
|
+
sc.scrollTop = this.activeScrollOffset(sc);
|
|
282
|
+
sc.style.visibility = '';
|
|
283
|
+
})
|
|
284
|
+
);
|
|
285
|
+
}
|
|
246
286
|
}
|
|
247
287
|
|
|
248
288
|
private activeScrollOffset(sc: HTMLElement): number {
|
|
249
|
-
const active
|
|
289
|
+
const active = this.querySelector<HTMLAnchorElement>('a[aria-current="page"]');
|
|
250
290
|
if (!active) return 0;
|
|
251
291
|
const linkRect = active.getBoundingClientRect();
|
|
252
292
|
const cRect = sc.getBoundingClientRect();
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return sc.
|
|
293
|
+
// Center the active item in the scroll container.
|
|
294
|
+
const itemTop = sc.scrollTop + (linkRect.top - cRect.top);
|
|
295
|
+
return itemTop - (sc.clientHeight / 2) + (linkRect.height / 2);
|
|
256
296
|
}
|
|
257
297
|
|
|
258
298
|
// ── Filter ───────────────────────────────────────────────────────────────
|
|
@@ -395,6 +435,7 @@ class SidebarFilter extends HTMLElement {
|
|
|
395
435
|
}
|
|
396
436
|
|
|
397
437
|
private resetFilter(): void {
|
|
438
|
+
this.pinScrollY();
|
|
398
439
|
this.input.value = '';
|
|
399
440
|
this.syncClearButton('');
|
|
400
441
|
safeRemove(FILTER_KEY);
|
|
@@ -104,7 +104,7 @@ const currentPlatform = virtualPlatform ?? null;
|
|
|
104
104
|
const resolvedLinks = (productLinksProp ?? productLinks) as ProductLink[];
|
|
105
105
|
const filteredLinks = resolvedLinks.filter((l: ProductLink) => l.platform !== currentPlatform);
|
|
106
106
|
type PackageEntry = string | { label: string; value?: string; href?: string };
|
|
107
|
-
const rawPackages = packagesProp ?? (virtualPackages
|
|
107
|
+
const rawPackages = packagesProp ?? (virtualPackages?.length > 0 ? virtualPackages : undefined);
|
|
108
108
|
const packages = (rawPackages as PackageEntry[] | undefined)?.map((p: PackageEntry) =>
|
|
109
109
|
typeof p === 'string' ? { label: p, value: p, href: undefined } : { label: p.label, value: p.value ?? p.label, href: p.href }
|
|
110
110
|
);
|
|
@@ -199,6 +199,35 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
|
|
|
199
199
|
const packageSelect = this.querySelector('#package-select');
|
|
200
200
|
const packageTooltip = this.querySelector<any>('#package-tooltip');
|
|
201
201
|
if (packageSelect) {
|
|
202
|
+
// Truncates the native input value directly so the '\u2026' is baked in,
|
|
203
|
+
// Keep the full package label in the native input and apply truncation
|
|
204
|
+
// only as a visual style so assistive technologies still get the full text.
|
|
205
|
+
function applyTriggerTruncation() {
|
|
206
|
+
const igcInput = (packageSelect as any).shadowRoot?.querySelector('igc-input');
|
|
207
|
+
const nativeInput = igcInput?.shadowRoot?.querySelector('input') as HTMLInputElement | null;
|
|
208
|
+
if (!nativeInput || !nativeInput.value) return;
|
|
209
|
+
|
|
210
|
+
const text = nativeInput.value;
|
|
211
|
+
|
|
212
|
+
// Preserve the full label for accessibility and hover disclosure.
|
|
213
|
+
nativeInput.setAttribute('aria-label', text);
|
|
214
|
+
nativeInput.title = text;
|
|
215
|
+
|
|
216
|
+
// Apply truncation only to the rendered text.
|
|
217
|
+
nativeInput.style.overflow = 'hidden';
|
|
218
|
+
nativeInput.style.textOverflow = 'ellipsis';
|
|
219
|
+
nativeInput.style.whiteSpace = 'nowrap';
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Run after igcInput's Lit render cycle settles (two rAFs = after microtasks + first paint)
|
|
223
|
+
requestAnimationFrame(() => requestAnimationFrame(() => applyTriggerTruncation()));
|
|
224
|
+
|
|
225
|
+
// igcInput re-renders with the full text each time the dropdown closes;
|
|
226
|
+
// re-apply truncation afterwards.
|
|
227
|
+
packageSelect.addEventListener('igcClosed', () =>
|
|
228
|
+
requestAnimationFrame(() => applyTriggerTruncation())
|
|
229
|
+
);
|
|
230
|
+
|
|
202
231
|
packageSelect.addEventListener('igcChange', (e: Event) => {
|
|
203
232
|
const val = (e as CustomEvent).detail?.value ?? (packageSelect as any).value;
|
|
204
233
|
const item = packageSelect.querySelector<HTMLElement>(`igc-select-item[value="${val}"]`);
|
|
@@ -215,7 +244,11 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
|
|
|
215
244
|
packageTooltip.addEventListener('igcOpening', (e: Event) => {
|
|
216
245
|
const igcInput = (packageSelect as any).shadowRoot?.querySelector('igc-input');
|
|
217
246
|
const nativeInput = igcInput?.shadowRoot?.querySelector('input');
|
|
218
|
-
|
|
247
|
+
// Show when we applied manual truncation (ends with '\u2026') or
|
|
248
|
+
// when there is natural CSS overflow.
|
|
249
|
+
const truncated = nativeInput?.value?.endsWith('\u2026');
|
|
250
|
+
const overflows = nativeInput && nativeInput.scrollWidth > nativeInput.clientWidth;
|
|
251
|
+
if (!truncated && !overflows) {
|
|
219
252
|
e.preventDefault();
|
|
220
253
|
}
|
|
221
254
|
});
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
border-block-end: var(--igd-app-outline);
|
|
19
19
|
z-index: 1;
|
|
20
20
|
background-color: var(--igd-layout-sections-bg);
|
|
21
|
+
view-transition-name: docs-subheader;
|
|
21
22
|
|
|
22
23
|
.igd-logo {
|
|
23
24
|
display: flex;
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
flex-shrink: 0;
|
|
92
93
|
position: relative;
|
|
93
94
|
width: fit-content;
|
|
94
|
-
max-width: rem(
|
|
95
|
+
max-width: rem(250px);
|
|
95
96
|
|
|
96
97
|
&::part(base) {
|
|
97
98
|
position: absolute;
|
|
@@ -121,6 +122,7 @@
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
&::part(native-input) {
|
|
125
|
+
field-sizing: content;
|
|
124
126
|
min-width: 0;
|
|
125
127
|
overflow: hidden;
|
|
126
128
|
text-overflow: ellipsis;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
min-width: rem(280px);
|
|
14
14
|
max-height: calc(100vh - var(--igd-header-height));
|
|
15
15
|
overflow-y: auto;
|
|
16
|
-
padding: rem(
|
|
16
|
+
padding: rem(24px);
|
|
17
17
|
border-inline-end: var(--igd-app-outline);
|
|
18
18
|
border-block-end: var(--igd-app-outline);
|
|
19
19
|
background-color: var(--igd-layout-sections-bg);
|
|
@@ -18,7 +18,9 @@ igc-tree {
|
|
|
18
18
|
--ig-size: 1;
|
|
19
19
|
|
|
20
20
|
position: relative;
|
|
21
|
+
}
|
|
21
22
|
|
|
23
|
+
igc-tree[data-variant='toc'] {
|
|
22
24
|
&::before {
|
|
23
25
|
content: '';
|
|
24
26
|
position: absolute;
|
|
@@ -26,16 +28,16 @@ igc-tree {
|
|
|
26
28
|
top: anchor(top);
|
|
27
29
|
height: anchor-size(height);
|
|
28
30
|
inset-inline-start: 0;
|
|
29
|
-
width: rem(
|
|
31
|
+
width: rem(2px);
|
|
30
32
|
background-color: var(--igd-accent);
|
|
31
33
|
transition: top 0.2s ease, height 0.2s ease;
|
|
32
|
-
display: none;
|
|
33
34
|
z-index: 1;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
|
|
36
37
|
body.is-resizing &::before {
|
|
37
38
|
transition: none;
|
|
38
39
|
}
|
|
40
|
+
|
|
39
41
|
&::after {
|
|
40
42
|
content: '';
|
|
41
43
|
position: absolute;
|
|
@@ -46,15 +48,6 @@ igc-tree {
|
|
|
46
48
|
height: 100%;
|
|
47
49
|
background: light-dark(var(--ig-gray-200), var(--ig-gray-300));
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
&:has(igc-tree-item[selected])::before {
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* Sidebar: only leaf items get selected, so item height = single row */
|
|
56
|
-
igc-tree[data-variant='sidebar'] igc-tree-item[selected] {
|
|
57
|
-
anchor-name: --selected-tree-item;
|
|
58
51
|
}
|
|
59
52
|
|
|
60
53
|
/* TOC: groups can be selected (h2 with h3 children); anchor to the label div
|
|
@@ -63,21 +56,29 @@ igc-tree[data-variant='toc'] igc-tree-item[selected] > [slot='label'] {
|
|
|
63
56
|
anchor-name: --selected-tree-item;
|
|
64
57
|
}
|
|
65
58
|
|
|
59
|
+
igc-tree-item + igc-tree-item[data-has-children] {
|
|
60
|
+
margin-block-start: rem(4px);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
igc-tree-item[data-has-children] {
|
|
64
|
+
margin-block-end: rem(4px);
|
|
65
|
+
}
|
|
66
|
+
|
|
66
67
|
igc-tree-item {
|
|
67
|
-
--igc-tree-indentation-size: #{rem(
|
|
68
|
+
--igc-tree-indentation-size: #{rem(12px)};
|
|
68
69
|
--background: transparent;
|
|
69
70
|
--foreground: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
70
71
|
--background-selected: transparent;
|
|
71
72
|
--background-active: transparent;
|
|
72
|
-
--foreground-active: var(--
|
|
73
|
-
--foreground-hover: var(--igd-accent);
|
|
73
|
+
--foreground-active: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
74
|
+
--foreground-hover: var(--igd-on-accent);
|
|
74
75
|
--background-disabled: transparent;
|
|
75
76
|
--hover-color: transparent;
|
|
76
77
|
--hover-selected-color: transparent;
|
|
77
78
|
--background-active-selected: transparent;
|
|
78
|
-
--foreground-selected:
|
|
79
|
-
--foreground-active-selected: var(--
|
|
80
|
-
|
|
79
|
+
--foreground-selected: transparent;
|
|
80
|
+
--foreground-active-selected: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
81
|
+
//--ig-tree-size: #{rem(32px)};
|
|
81
82
|
|
|
82
83
|
a {
|
|
83
84
|
position: absolute;
|
|
@@ -94,22 +95,33 @@ igc-tree-item {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
cursor: default;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
igc-tree:not([data-variant='toc']) {
|
|
101
|
+
igc-tree-item::part(wrapper) {
|
|
102
|
+
@include type-style('body-2') {
|
|
103
|
+
margin-block: 0;
|
|
102
104
|
}
|
|
105
|
+
|
|
106
|
+
padding-inline: 0;
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
igc-tree-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
igc-tree[data-variant='toc'] {
|
|
111
|
+
igc-tree-item::part(wrapper) {
|
|
112
|
+
@include type-style('body-2') {
|
|
113
|
+
margin-block: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
padding-inline-start: rem(24px);
|
|
117
|
+
padding-inline-end: rem(8px);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
igc-tree-item[active] {
|
|
121
|
+
.group-label-text {
|
|
122
|
+
color: var(--igd-accent);
|
|
123
|
+
}
|
|
109
124
|
}
|
|
110
|
-
;
|
|
111
|
-
padding-inline-start: rem(24px);
|
|
112
|
-
padding-inline-end: rem(8px);
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
igc-tree-item::part(focused) {
|
|
@@ -123,11 +135,12 @@ igc-tree-item::part(indicator) {
|
|
|
123
135
|
igc-tree-item::part(label) {
|
|
124
136
|
width: 100%;
|
|
125
137
|
max-height: 100%;
|
|
126
|
-
padding-block:
|
|
138
|
+
padding-block: 0;
|
|
127
139
|
text-overflow: unset;
|
|
128
140
|
white-space: unset;
|
|
129
|
-
word-break: break-
|
|
141
|
+
word-break: break-word;
|
|
130
142
|
overflow: unset;
|
|
143
|
+
|
|
131
144
|
}
|
|
132
145
|
|
|
133
146
|
igc-tree-item[data-has-children] {
|
|
@@ -181,11 +194,104 @@ igc-tree-item[data-has-children] {
|
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
/* Hover accent applies to leaf items (sidebar) and all linked items (TOC) */
|
|
184
|
-
|
|
197
|
+
//.docs-tree-link:hover ~ .docs-tree-label,
|
|
185
198
|
igc-tree-item:not([data-has-children]):hover .docs-tree-label {
|
|
186
199
|
color: var(--igd-accent);
|
|
187
200
|
}
|
|
188
201
|
|
|
202
|
+
.igd-label-and-badge {
|
|
203
|
+
position: relative;
|
|
204
|
+
border-radius: rem(4px);
|
|
205
|
+
padding-inline: rem(8px) rem(4px);
|
|
206
|
+
height: 100%;
|
|
207
|
+
z-index: -1;
|
|
208
|
+
|
|
209
|
+
&::before {
|
|
210
|
+
content: '';
|
|
211
|
+
position: absolute;
|
|
212
|
+
inset-block-start: 0;
|
|
213
|
+
inset-inline-end: calc(100% + (var(--igc-tree-indentation-size) / 2));
|
|
214
|
+
width: rem(1px);
|
|
215
|
+
height: calc(100% + rem(4px));
|
|
216
|
+
border-radius: 0;
|
|
217
|
+
background: light-dark(var(--ig-gray-300), var(--ig-gray-300));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.docs-tree-link {
|
|
222
|
+
&:hover,
|
|
223
|
+
&:focus {
|
|
224
|
+
+ .igd-label-and-badge {
|
|
225
|
+
color: var(--igd-accent);
|
|
226
|
+
background-color: var(--ig-gray-100);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
igc-tree-item[selected] {
|
|
232
|
+
igc-tree-item[selected]:not([aria-expanded]) {
|
|
233
|
+
.igd-label-and-badge {
|
|
234
|
+
color: var(--igd-on-accent);
|
|
235
|
+
background-color: var(--igd-accent);
|
|
236
|
+
|
|
237
|
+
.docs-tree-label {
|
|
238
|
+
color: var(--igd-on-accent);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&:has(.igd-label-and-badge) {
|
|
243
|
+
&:hover,
|
|
244
|
+
&:focus {
|
|
245
|
+
.igd-label-and-badge {
|
|
246
|
+
background-color: var(--igd-accent);
|
|
247
|
+
|
|
248
|
+
.docs-tree-label {
|
|
249
|
+
color: #fff;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.sidebar-premium-icon {
|
|
256
|
+
color: var(--igd-on-accent);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
igc-badge {
|
|
260
|
+
&.preview {
|
|
261
|
+
--border-color: var(--igd-on-accent);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&.new {
|
|
265
|
+
--background-color: var(--igd-new-bg);
|
|
266
|
+
--text-color: var(--igd-new-color);
|
|
267
|
+
--icon-color: var(--igd-new-color);
|
|
268
|
+
--border-color: var(--igd-on-accent);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
&.updated {
|
|
272
|
+
--background-color: var(--igd-updated-bg);
|
|
273
|
+
--text-color: var(--igd-updated-color);
|
|
274
|
+
--icon-color: var(--igd-updated-color);
|
|
275
|
+
--border-color: var(--igd-on-accent);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
&.premium {
|
|
279
|
+
--background-color: var(--igd-premium-bg);
|
|
280
|
+
--text-color: var(--igd-premium-color);
|
|
281
|
+
--icon-color: var(--igd-premium-color);
|
|
282
|
+
--border-color: var(--igd-on-accent);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&.opensource {
|
|
286
|
+
--background-color: var(--igd-opensource-bg);
|
|
287
|
+
--text-color: var(--igd-opensource-color);
|
|
288
|
+
--icon-color: var(--igd-opensource-color);
|
|
289
|
+
--border-color: var(--igd-on-accent);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
189
295
|
igc-tree[data-variant='sidebar'] {
|
|
190
296
|
overflow: hidden;
|
|
191
297
|
|