igniteui-astro-components 0.0.10 → 0.0.11
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 +1 -1
- package/src/components/DocsSidebar/DocsSidebar.scss +18 -2
- package/src/components/DocsSidebar/SidebarLabel.astro +1 -1
- package/src/components/DocsTree/docs-tree.scss +4 -1
- package/src/components/Search/Search.astro +160 -87
- package/src/components/Search/Search.scss +10 -22
- package/src/components/SearchAdvanced/SearchAdvanced.scss +3 -110
- package/src/components/mdx/DocsAside/DocsAside.scss +4 -0
- package/src/components/mdx/Sample/Sample.scss +3 -3
- package/src/layouts/DocsLayout/DocsLayout.astro +4 -2
- package/src/layouts/DocsLayout/DocsLayout.scss +6 -0
- package/src/styles/global/_markdown.scss +15 -2
- package/src/styles/global/_search-shared.scss +145 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "igniteui-astro-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
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": {
|
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
border-style: solid;
|
|
78
78
|
border-color: var(--border-color);
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
igc-icon {
|
|
82
|
+
--size: #{rem(18px)}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// TODO, This has to be fixed inside the component
|
|
86
|
+
span {
|
|
87
|
+
position: relative;
|
|
88
|
+
padding-inline: rem(3px);
|
|
89
|
+
}
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
.updated {
|
|
@@ -116,6 +126,8 @@
|
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
.sidebar-premium-icon {
|
|
129
|
+
--size: #{rem(24px)};
|
|
130
|
+
|
|
119
131
|
justify-self: end;
|
|
120
132
|
color: var(--igd-premium-color);
|
|
121
133
|
flex-shrink: 0;
|
|
@@ -124,16 +136,20 @@
|
|
|
124
136
|
.igd-lable-and-badge {
|
|
125
137
|
display: flex;
|
|
126
138
|
align-items: center;
|
|
127
|
-
gap: rem(
|
|
139
|
+
gap: rem(8px);
|
|
128
140
|
|
|
129
141
|
igc-badge {
|
|
130
142
|
justify-self: end;
|
|
131
143
|
}
|
|
132
144
|
}
|
|
133
145
|
|
|
146
|
+
.docs-tree-group {
|
|
147
|
+
gap: rem(8px);
|
|
148
|
+
}
|
|
149
|
+
|
|
134
150
|
.group-label-text {
|
|
135
151
|
@include type-style('body-2') {
|
|
136
|
-
margin: 0;
|
|
152
|
+
margin-block: 0;
|
|
137
153
|
};
|
|
138
154
|
|
|
139
155
|
color: light-dark(var(--ig-gray-800), var(--ig-gray-600));
|
|
@@ -34,7 +34,7 @@ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
|
|
|
34
34
|
<div class="igd-badge-container">
|
|
35
35
|
{badges.filter(b => b.variant !== 'premium').map((badge) => (
|
|
36
36
|
<>
|
|
37
|
-
<igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true">{badge.text}</igc-badge>
|
|
37
|
+
<igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true"><span>{badge.text}</span></igc-badge>
|
|
38
38
|
<span class="visually-hidden">, {badge.text}</span>
|
|
39
39
|
</>
|
|
40
40
|
))}
|
|
@@ -124,6 +124,10 @@ igc-tree-item::part(label) {
|
|
|
124
124
|
width: 100%;
|
|
125
125
|
max-height: 100%;
|
|
126
126
|
padding-block: rem(6px);
|
|
127
|
+
text-overflow: unset;
|
|
128
|
+
white-space: unset;
|
|
129
|
+
word-break: break-all;
|
|
130
|
+
overflow: unset;
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
igc-tree-item[data-has-children] {
|
|
@@ -136,7 +140,6 @@ igc-tree-item[data-has-children] {
|
|
|
136
140
|
|
|
137
141
|
.tree-expand-icon {
|
|
138
142
|
margin-inline-start: auto;
|
|
139
|
-
//margin-inline-end: rem(4px);
|
|
140
143
|
flex-shrink: 0;
|
|
141
144
|
color: inherit;
|
|
142
145
|
transform: rotate(-90deg);
|
|
@@ -23,91 +23,151 @@ import './Search.scss';
|
|
|
23
23
|
<kbd class="search-trigger__hint" style="display:none;"><kbd>Ctrl</kbd><kbd>K</kbd></kbd>
|
|
24
24
|
</button>
|
|
25
25
|
|
|
26
|
+
<igc-dialog id="search-dialog" class="igd-search-dialog" aria-label="Search" hide-default-action close-on-outside-click>
|
|
27
|
+
<div class="igd-search-shell">
|
|
28
|
+
<header class="igd-search-header">
|
|
29
|
+
<igc-input
|
|
30
|
+
type="text"
|
|
31
|
+
class="igd-search-input"
|
|
32
|
+
placeholder="Search documentation"
|
|
33
|
+
autocomplete="off"
|
|
34
|
+
outlined
|
|
35
|
+
aria-label="Search documentation"
|
|
36
|
+
>
|
|
37
|
+
<igc-icon class="igd-search-icon" name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
|
|
38
|
+
<igc-icon-button
|
|
39
|
+
slot="suffix"
|
|
40
|
+
class="igd-search-clear"
|
|
41
|
+
variant="flat"
|
|
42
|
+
type="button"
|
|
43
|
+
aria-label="Clear search"
|
|
44
|
+
name="clear"
|
|
45
|
+
collection="docs"
|
|
46
|
+
hidden
|
|
47
|
+
></igc-icon-button>
|
|
48
|
+
</igc-input>
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
class="search-trigger search-close"
|
|
52
|
+
aria-label="Close search"
|
|
53
|
+
>
|
|
54
|
+
<igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
|
|
55
|
+
</button>
|
|
56
|
+
</header>
|
|
57
|
+
<igc-divider></igc-divider>
|
|
58
|
+
<div class="igd-search-status" aria-live="polite"></div>
|
|
59
|
+
<igc-list class="igd-search-results" hidden></igc-list>
|
|
60
|
+
</div>
|
|
61
|
+
</igc-dialog>
|
|
62
|
+
|
|
26
63
|
<script>
|
|
27
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
defineComponents,
|
|
66
|
+
IgcIconComponent,
|
|
67
|
+
IgcIconButtonComponent,
|
|
68
|
+
IgcDialogComponent,
|
|
69
|
+
IgcInputComponent,
|
|
70
|
+
IgcListComponent,
|
|
71
|
+
IgcListItemComponent,
|
|
72
|
+
IgcDividerComponent,
|
|
73
|
+
} from 'igniteui-webcomponents';
|
|
28
74
|
import '../../scripts/icon-registry';
|
|
29
|
-
defineComponents(IgcIconComponent);
|
|
30
|
-
</script>
|
|
31
75
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
>
|
|
42
|
-
<igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
|
|
43
|
-
</button>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="igd-search-status" aria-live="polite"></div>
|
|
46
|
-
<div id="search-pagefind"></div>
|
|
47
|
-
</div>
|
|
48
|
-
</dialog>
|
|
76
|
+
defineComponents(
|
|
77
|
+
IgcIconComponent,
|
|
78
|
+
IgcIconButtonComponent,
|
|
79
|
+
IgcDialogComponent,
|
|
80
|
+
IgcInputComponent,
|
|
81
|
+
IgcListComponent,
|
|
82
|
+
IgcListItemComponent,
|
|
83
|
+
IgcDividerComponent,
|
|
84
|
+
);
|
|
49
85
|
|
|
50
|
-
<script>
|
|
51
|
-
// BASE_URL accounts for non-root deployments, e.g. /products/ignite-ui-angular/...
|
|
52
86
|
const base = import.meta.env.BASE_URL.replace(/\/$/, '');
|
|
87
|
+
const _w = window as any;
|
|
88
|
+
|
|
89
|
+
const INPUT_DEBOUNCE_MS = 150;
|
|
90
|
+
const MAX_RESULTS = 10;
|
|
91
|
+
|
|
92
|
+
async function loadPagefind() {
|
|
93
|
+
if (_w.__pagefind) return _w.__pagefind;
|
|
94
|
+
try {
|
|
95
|
+
const pf = await import(/* @vite-ignore */ `${base}/pagefind/pagefind.js`);
|
|
96
|
+
await pf.init();
|
|
97
|
+
_w.__pagefind = pf;
|
|
98
|
+
return pf;
|
|
99
|
+
} catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
53
103
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
104
|
+
function escapeHtml(s: string): string {
|
|
105
|
+
return s
|
|
106
|
+
.replace(/&/g, '&')
|
|
107
|
+
.replace(/</g, '<')
|
|
108
|
+
.replace(/>/g, '>')
|
|
109
|
+
.replace(/"/g, '"');
|
|
110
|
+
}
|
|
57
111
|
|
|
58
|
-
async function
|
|
59
|
-
const
|
|
60
|
-
|
|
112
|
+
async function runSearch(query: string) {
|
|
113
|
+
const statusEl = document.querySelector<HTMLElement>('.igd-search-status');
|
|
114
|
+
const listEl = document.querySelector<any>('igc-list.igd-search-results');
|
|
115
|
+
const clearBtn = document.querySelector<any>('.igd-search-clear');
|
|
116
|
+
const input = document.querySelector<any>('igc-input.igd-search-input');
|
|
61
117
|
|
|
62
|
-
if (!
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
s.src = `${base}/pagefind/pagefind-ui.js`;
|
|
73
|
-
s.onload = () => resolve();
|
|
74
|
-
s.onerror = () => reject(new Error('Failed to load pagefind-ui.js'));
|
|
75
|
-
document.head.appendChild(s);
|
|
76
|
-
});
|
|
77
|
-
} catch (err) {
|
|
78
|
-
console.error('[Search] pagefind failed to load:', err);
|
|
79
|
-
const el = document.getElementById('search-pagefind');
|
|
80
|
-
if (el) el.textContent = 'Search index not available — run a production build first.';
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
118
|
+
if (!statusEl || !listEl) return;
|
|
119
|
+
|
|
120
|
+
if (clearBtn) clearBtn.hidden = !query;
|
|
121
|
+
input?.requestUpdate?.();
|
|
122
|
+
|
|
123
|
+
if (!query.trim()) {
|
|
124
|
+
statusEl.textContent = '';
|
|
125
|
+
listEl.innerHTML = '';
|
|
126
|
+
listEl.hidden = true;
|
|
127
|
+
return;
|
|
83
128
|
}
|
|
84
129
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
showImages: false,
|
|
92
|
-
resetStyles: false,
|
|
93
|
-
baseUrl: base || '/',
|
|
94
|
-
bundlePath: `${base}/pagefind/`,
|
|
95
|
-
});
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.error('[Search] PagefindUI init failed:', err);
|
|
98
|
-
}
|
|
130
|
+
statusEl.textContent = 'Searching…';
|
|
131
|
+
|
|
132
|
+
const pf = await loadPagefind();
|
|
133
|
+
if (!pf) {
|
|
134
|
+
statusEl.textContent = 'Search index not available — run a production build first.';
|
|
135
|
+
return;
|
|
99
136
|
}
|
|
100
137
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
138
|
+
const search = await pf.search(query.trim());
|
|
139
|
+
const results = await Promise.all(
|
|
140
|
+
search.results.slice(0, MAX_RESULTS).map((r: any) => r.data()),
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (results.length === 0) {
|
|
144
|
+
statusEl.innerHTML = `No results for “<strong class="igd-search-query">${escapeHtml(query)}</strong>”.`;
|
|
145
|
+
listEl.innerHTML = '';
|
|
146
|
+
listEl.hidden = true;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const total = search.results.length;
|
|
151
|
+
statusEl.textContent = total > MAX_RESULTS
|
|
152
|
+
? `Showing ${MAX_RESULTS} of ${total} results`
|
|
153
|
+
: `${total} result${total === 1 ? '' : 's'}`;
|
|
154
|
+
listEl.innerHTML = results.map((r: any) => `<igc-list-item>
|
|
155
|
+
<a href="${escapeHtml(r.url)}" class="igd-search-link">
|
|
156
|
+
<span class="igd-search-result-title">${escapeHtml(r.meta?.title ?? r.url)}</span>
|
|
157
|
+
<span class="igd-search-result-excerpt">${r.excerpt ?? ''}</span>
|
|
158
|
+
</a>
|
|
159
|
+
</igc-list-item>`).join('');
|
|
160
|
+
listEl.hidden = false;
|
|
104
161
|
}
|
|
105
162
|
|
|
106
163
|
async function openSearch() {
|
|
107
|
-
const dialog = document.
|
|
164
|
+
const dialog = document.querySelector<any>('igc-dialog.igd-search-dialog');
|
|
108
165
|
if (!dialog) return;
|
|
109
|
-
await
|
|
110
|
-
|
|
166
|
+
await dialog.show();
|
|
167
|
+
loadPagefind();
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
document.querySelector<any>('igc-input.igd-search-input')?.focus();
|
|
170
|
+
});
|
|
111
171
|
}
|
|
112
172
|
|
|
113
173
|
if (!_w.__searchListeners) {
|
|
@@ -118,39 +178,52 @@ import './Search.scss';
|
|
|
118
178
|
if (!hint) return;
|
|
119
179
|
const isMac = /Mac|iPhone|iPod|iPad/i.test(navigator.userAgent);
|
|
120
180
|
const modKey = hint.querySelector('kbd');
|
|
121
|
-
if (modKey) modKey.textContent = isMac ? '
|
|
181
|
+
if (modKey) modKey.textContent = isMac ? '⌘' : 'Ctrl';
|
|
122
182
|
const btn = document.getElementById('search-trigger');
|
|
123
183
|
btn?.setAttribute('aria-keyshortcuts', isMac ? 'Meta+K' : 'Control+K');
|
|
124
|
-
btn?.setAttribute('title',
|
|
184
|
+
btn?.setAttribute('title', isMac ? 'Search (⌘K)' : 'Search (Ctrl+K)');
|
|
125
185
|
hint.style.display = '';
|
|
126
186
|
}
|
|
127
187
|
updateSearchHint();
|
|
128
188
|
|
|
129
|
-
document.getElementById('search-trigger')?.addEventListener('click', () =>
|
|
130
|
-
openSearch();
|
|
131
|
-
});
|
|
189
|
+
document.getElementById('search-trigger')?.addEventListener('click', () => openSearch());
|
|
132
190
|
|
|
133
|
-
// Keyboard shortcut
|
|
134
191
|
document.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
135
192
|
if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
|
|
136
193
|
e.preventDefault();
|
|
137
|
-
const dialog = document.
|
|
138
|
-
if (dialog?.open) dialog.
|
|
194
|
+
const dialog = document.querySelector<any>('igc-dialog.igd-search-dialog');
|
|
195
|
+
if (dialog?.open) dialog.hide(); else openSearch();
|
|
139
196
|
}
|
|
140
197
|
});
|
|
141
198
|
|
|
142
|
-
// Backdrop click closes the dialog
|
|
143
|
-
document.addEventListener('click', (e: MouseEvent) => {
|
|
144
|
-
const dialog = document.getElementById('search-dialog') as HTMLDialogElement | null;
|
|
145
|
-
if (dialog && e.target === dialog) dialog.close();
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
// Close on navigation
|
|
149
199
|
document.addEventListener('astro:page-load', () => {
|
|
150
|
-
|
|
151
|
-
dialog?.close();
|
|
200
|
+
document.querySelector<any>('igc-dialog.igd-search-dialog')?.hide();
|
|
152
201
|
updateSearchHint();
|
|
153
202
|
});
|
|
203
|
+
|
|
204
|
+
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
|
|
205
|
+
document.querySelector('igc-input.igd-search-input')?.addEventListener('igcInput', () => {
|
|
206
|
+
if (debounceTimer !== null) clearTimeout(debounceTimer);
|
|
207
|
+
const val = (document.querySelector<any>('igc-input.igd-search-input')?.value as string) ?? '';
|
|
208
|
+
debounceTimer = setTimeout(() => runSearch(val), INPUT_DEBOUNCE_MS);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
document.querySelector('.igd-search-clear')?.addEventListener('click', () => {
|
|
212
|
+
const input = document.querySelector<any>('igc-input.igd-search-input');
|
|
213
|
+
if (!input) return;
|
|
214
|
+
input.value = '';
|
|
215
|
+
input.focus();
|
|
216
|
+
runSearch('');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
document.querySelector('.igd-search-shell .search-close')?.addEventListener('click', () => {
|
|
220
|
+
document.querySelector<any>('igc-dialog.igd-search-dialog')?.hide();
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
document.querySelector('.igd-search-shell')?.addEventListener('click', (e: Event) => {
|
|
224
|
+
if ((e.target as Element).closest('a[href]')) {
|
|
225
|
+
document.querySelector<any>('igc-dialog.igd-search-dialog')?.hide();
|
|
226
|
+
}
|
|
227
|
+
});
|
|
154
228
|
}
|
|
155
229
|
</script>
|
|
156
|
-
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
@use 'igniteui-theming' as *;
|
|
2
2
|
@use '../../styles/global/search-shared' as *;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@include search-dialog-base-styles;
|
|
8
|
-
background: var(--igd-layout-sections-bg);
|
|
9
|
-
color: inherit;
|
|
10
|
-
border: none;
|
|
11
|
-
padding: 0;
|
|
12
|
-
|
|
13
|
-
&:focus-visible {
|
|
14
|
-
outline: none;
|
|
4
|
+
.igd-search-result-excerpt {
|
|
5
|
+
@include type-style('caption') {
|
|
6
|
+
margin: 0;
|
|
15
7
|
}
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
@include search-dialog-backdrop;
|
|
19
|
-
@include search-dialog-backdrop-open;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
border-bottom: rem(1px) solid var(--igd-app-outline-color);
|
|
28
|
-
min-height: rem(48px);
|
|
11
|
+
mark {
|
|
12
|
+
background: transparent;
|
|
13
|
+
color: var(--igd-accent);
|
|
14
|
+
}
|
|
29
15
|
}
|
|
30
16
|
|
|
17
|
+
.igd-search-results {
|
|
18
|
+
padding-inline-end: rem(26px);
|
|
31
19
|
}
|
|
@@ -4,62 +4,13 @@
|
|
|
4
4
|
@layer components {
|
|
5
5
|
api-search-advanced { display: contents; }
|
|
6
6
|
|
|
7
|
-
.igd-search-dialog {
|
|
8
|
-
--border-radius: 0;
|
|
9
|
-
--background: var(--igd-layout-sections-bg);
|
|
10
|
-
--transition-duration: 150ms;
|
|
11
|
-
|
|
12
|
-
border: none;
|
|
13
|
-
|
|
14
|
-
&::part(base) {
|
|
15
|
-
@include search-dialog-base-styles;
|
|
16
|
-
|
|
17
|
-
&:focus-visible {
|
|
18
|
-
outline: none;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&::part(content) {
|
|
23
|
-
padding: 0;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&::part(backdrop) {
|
|
30
|
-
@include search-dialog-backdrop;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&[open]::part(backdrop) {
|
|
34
|
-
@include search-dialog-backdrop-open;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
igc-input {
|
|
38
|
-
height: 100%;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
igc-input::part(container) {
|
|
42
|
-
border: 0;
|
|
43
|
-
height: 100%;
|
|
44
|
-
padding: 0 rem(16px) !important;
|
|
45
|
-
border-block-end: none !important;
|
|
46
|
-
|
|
47
|
-
&:focus-within {
|
|
48
|
-
box-shadow:
|
|
49
|
-
0 0 0 1px var(--igd-accent),
|
|
50
|
-
inset 0 1px 0 var(--igd-accent),
|
|
51
|
-
inset 0 -1px 0 var(--igd-accent),
|
|
52
|
-
inset -1px 0 0 var(--igd-accent);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
7
|
.search-trigger {
|
|
58
8
|
color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
59
9
|
}
|
|
60
10
|
|
|
61
|
-
|
|
62
|
-
|
|
11
|
+
// Advanced header has a scope selector before the input, needs start padding
|
|
12
|
+
.igd-search-header {
|
|
13
|
+
padding-inline-start: rem(16px);
|
|
63
14
|
}
|
|
64
15
|
|
|
65
16
|
// TODO BUG IN THE TAB COMPONENT
|
|
@@ -139,64 +90,6 @@
|
|
|
139
90
|
}
|
|
140
91
|
}
|
|
141
92
|
|
|
142
|
-
.igd-search-header {
|
|
143
|
-
display: flex;
|
|
144
|
-
min-height: rem(75px);
|
|
145
|
-
padding-inline-start: rem(16px);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.igd-search-scope {
|
|
149
|
-
flex-shrink: 0;
|
|
150
|
-
align-self: center;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.igd-search-input {
|
|
154
|
-
--input-prefix-background: transparent;
|
|
155
|
-
--input-prefix-background--focused: transparent;
|
|
156
|
-
--input-prefix-background--filled: transparent;
|
|
157
|
-
|
|
158
|
-
--input-suffix-background: transparent;
|
|
159
|
-
--input-suffix-background--focused: transparent;
|
|
160
|
-
--input-suffix-background--filled: transparent;
|
|
161
|
-
|
|
162
|
-
width: 100%;
|
|
163
|
-
min-width: 0;
|
|
164
|
-
flex: 1 1 auto;
|
|
165
|
-
|
|
166
|
-
&::part(input) {
|
|
167
|
-
@include type-style('body-2') {
|
|
168
|
-
margin: 0;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.igd-search-clear {
|
|
174
|
-
--foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
175
|
-
--backgroind-hover: transparent;
|
|
176
|
-
--hover-foreground: var(--igd-accent);
|
|
177
|
-
--focus-hover-foreground: var(--igd-accent);
|
|
178
|
-
--focus-foreground: var(--igd-accent);
|
|
179
|
-
--active-foreground: var(--igd-accent);
|
|
180
|
-
--shadow-color: transparent;
|
|
181
|
-
--background: transparent;
|
|
182
|
-
--hover-background: transparent;
|
|
183
|
-
--focus-background: transparent;
|
|
184
|
-
--focus-hover-background: transparent;
|
|
185
|
-
--active-background: transparent;
|
|
186
|
-
--border-color: transparent;
|
|
187
|
-
--border-radius: 0;
|
|
188
|
-
|
|
189
|
-
&::part(base) {
|
|
190
|
-
&::after {
|
|
191
|
-
display: none;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&::part(focused) {
|
|
196
|
-
--foreground: var(--igd-accent);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
93
|
.igd-search-tab-count {
|
|
201
94
|
color: light-dark(var(--ig-gray-500), var(--ig-gray-300));
|
|
202
95
|
}
|
|
@@ -9,7 +9,7 @@ igc-tabs {
|
|
|
9
9
|
flex-grow: 1;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
--item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-
|
|
12
|
+
--item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
13
13
|
--item-hover-color: var(--igd-accent);
|
|
14
14
|
--item-background: var(--igd-layout-sections-bg);
|
|
15
15
|
--item-hover-background: var(--igd-layout-sections-bg);
|
|
@@ -20,7 +20,7 @@ igc-tabs {
|
|
|
20
20
|
--item-active-hover-background: var(--igd-layout-sections-bg);
|
|
21
21
|
--indicator-color: var(--igd-accent);
|
|
22
22
|
|
|
23
|
-
--button-color: light-dark(var(--ig-gray-900), var(--ig-gray-
|
|
23
|
+
--button-color: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
24
24
|
--button-hover-color: var(--igd-accent);
|
|
25
25
|
--button-background: var(--igd-layout-sections-bg);
|
|
26
26
|
--button-hover-background: var(--igd-layout-sections-bg);
|
|
@@ -86,7 +86,7 @@ igc-tab::part(content) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
igc-tab::part(tab-header) {
|
|
89
|
-
min-height:
|
|
89
|
+
min-height: rem(60px);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.igd-code-view {
|
|
@@ -33,9 +33,11 @@ export interface Props {
|
|
|
33
33
|
* 'commercial' → Premium badge, 'MIT' → Open Source badge, omit → no badge.
|
|
34
34
|
*/
|
|
35
35
|
license?: string;
|
|
36
|
+
/** Set to true on 404 pages to add the `igd-page-layout--404` modifier class. */
|
|
37
|
+
is404?: boolean;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
const { title, description, keywords, hasToc = true, hasSidebar = true, currentSlug = '', siteTitle: siteTitleProp, license } = Astro.props;
|
|
40
|
+
const { title, description, keywords, hasToc = true, hasSidebar = true, currentSlug = '', siteTitle: siteTitleProp, license, is404 = false } = Astro.props;
|
|
39
41
|
const resolvedSiteTitle = siteTitleProp ?? siteTitle;
|
|
40
42
|
const licenseType = license === 'commercial' ? 'premium' : license === 'MIT' ? 'opensource' : false;
|
|
41
43
|
const navTheme = (virtualPlatform ?? import.meta.env.VITE_NAV_THEME ?? 'igniteui') as string;
|
|
@@ -218,7 +220,7 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
|
|
|
218
220
|
the .igd-page-layout not on the body.
|
|
219
221
|
Any igc component rendered dynamically on body level should have .ig-typography in order to have proper type styles.
|
|
220
222
|
-->
|
|
221
|
-
<div class=
|
|
223
|
+
<div class={`igd-page-layout${is404 ? ' igd-page-layout--404' : ''}`}>
|
|
222
224
|
<!-- TODO: WE DONT NEED TO CALCULAtE THE IG HEADER HEIGHT ANYMORE - REMOVE IT -->
|
|
223
225
|
<!-- <DocsSubHeader style={ `--docs-global-nav-height: ${ showGlobalNav ? '4.7rem': '0' }` } data-nav-height-wrapper/> -->
|
|
224
226
|
<slot name="subheader">
|
|
@@ -315,6 +315,12 @@
|
|
|
315
315
|
|
|
316
316
|
// ── Tablet + Desktop (≥ 768px) ─────────────────────────────────────────────
|
|
317
317
|
@media (min-width: #{$bp-tablet-min}) {
|
|
318
|
+
.sidebar-gutter {
|
|
319
|
+
&:has(.sidebar-logo:only-child) {
|
|
320
|
+
display: none;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
318
324
|
.igd-page-layout {
|
|
319
325
|
justify-content: center;
|
|
320
326
|
}
|
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
// generated by typography() but type-style() only accepts standard names.
|
|
6
6
|
// Read the generated --ig-* vars directly to avoid the warning.
|
|
7
7
|
.igd-main-content__markdown {
|
|
8
|
+
.sidebar-badge {
|
|
9
|
+
margin-block-end: rem(26px);
|
|
10
|
+
|
|
11
|
+
// TODO, This has to be fixed inside the component
|
|
12
|
+
span {
|
|
13
|
+
top:1px
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
p {
|
|
9
18
|
@include type-style('body-1');
|
|
10
19
|
}
|
|
@@ -39,7 +48,7 @@
|
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
|
|
42
|
-
color: light-dark(var(--ig-gray-
|
|
51
|
+
color: light-dark(var(--ig-gray-800), var(--ig-gray-500));
|
|
43
52
|
|
|
44
53
|
padding: var(--igd-page-padding);
|
|
45
54
|
min-width: 0;
|
|
@@ -82,7 +91,7 @@
|
|
|
82
91
|
};
|
|
83
92
|
|
|
84
93
|
background: light-dark(var(--ig-primary-50), #112031);
|
|
85
|
-
color: light-dark(var(--ig-
|
|
94
|
+
color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
|
|
86
95
|
border: rem(1px) solid light-dark(var(--ig-gray-300), #1A314A);
|
|
87
96
|
|
|
88
97
|
padding: rem(4px) rem(8px);
|
|
@@ -175,12 +184,16 @@
|
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
a {
|
|
187
|
+
font-size: inherit;
|
|
178
188
|
color: inherit;
|
|
179
189
|
text-decoration: underline;
|
|
180
190
|
|
|
181
191
|
&:hover,
|
|
182
192
|
&:focus {
|
|
183
193
|
color: light-dark(var(--ig-primary-600), var(--ig-primary-100));
|
|
194
|
+
outline-offset: rem(2px);
|
|
195
|
+
outline: solid rem(1px);
|
|
196
|
+
outline-color: inherit;
|
|
184
197
|
}
|
|
185
198
|
}
|
|
186
199
|
|
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
|
|
3
|
-
@layer components {
|
|
4
3
|
|
|
4
|
+
|
|
5
|
+
// Centered-card sizing for both igc-dialog::part(base) and native <dialog>.
|
|
6
|
+
// DocsLayout.scss flips this to fullscreen on mobile.
|
|
7
|
+
@mixin search-dialog-base-styles {
|
|
8
|
+
margin: auto;
|
|
9
|
+
padding: 0;
|
|
10
|
+
width: 90%;
|
|
11
|
+
max-width: rem(672px);
|
|
12
|
+
height: calc(100vh - #{rem(128px)});
|
|
13
|
+
max-height: rem(768px);
|
|
14
|
+
box-shadow: none;
|
|
15
|
+
border: none;
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Backdrop base state (before open animation).
|
|
20
|
+
@mixin search-dialog-backdrop {
|
|
21
|
+
background-color: light-dark(var(--ig-gray-800), var(--ig-gray-50));
|
|
22
|
+
will-change: backdrop-filter, opacity;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Backdrop visible/open state.
|
|
26
|
+
@mixin search-dialog-backdrop-open {
|
|
27
|
+
opacity: .6;
|
|
28
|
+
-webkit-backdrop-filter: blur(10px);
|
|
29
|
+
backdrop-filter: blur(10px);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// @layer components block (mixin definitions stay un-nested)
|
|
33
|
+
@layer components {
|
|
5
34
|
.search-trigger {
|
|
6
35
|
--ig-size: 1;
|
|
7
|
-
|
|
36
|
+
|
|
8
37
|
width: 100%;
|
|
9
38
|
max-width: rem(330px);
|
|
10
39
|
display: flex;
|
|
@@ -15,11 +44,11 @@
|
|
|
15
44
|
padding-inline: var(--igd-padding-sm);
|
|
16
45
|
gap: rem(8px);
|
|
17
46
|
white-space: nowrap;
|
|
18
|
-
|
|
47
|
+
|
|
19
48
|
// Override native button styles
|
|
20
49
|
background-color: transparent;
|
|
21
50
|
box-shadow: none;
|
|
22
|
-
|
|
51
|
+
|
|
23
52
|
&:focus-visible {
|
|
24
53
|
outline: none;
|
|
25
54
|
box-shadow: inset 0 0 0 1px var(--igd-accent);
|
|
@@ -38,12 +67,12 @@
|
|
|
38
67
|
background: transparent;
|
|
39
68
|
box-shadow: none;
|
|
40
69
|
border: none;
|
|
41
|
-
|
|
70
|
+
|
|
42
71
|
kbd {
|
|
43
72
|
@include type-style('subtitle-1') {
|
|
44
73
|
margin: 0;
|
|
45
74
|
};
|
|
46
|
-
|
|
75
|
+
|
|
47
76
|
background: transparent;
|
|
48
77
|
box-shadow: none;
|
|
49
78
|
border: none;
|
|
@@ -55,7 +84,7 @@
|
|
|
55
84
|
@include type-style('body-2') {
|
|
56
85
|
margin: 0;
|
|
57
86
|
};
|
|
58
|
-
|
|
87
|
+
|
|
59
88
|
color: var(--ig-gray-600);
|
|
60
89
|
}
|
|
61
90
|
|
|
@@ -66,43 +95,12 @@
|
|
|
66
95
|
|
|
67
96
|
border-inline-start: rem(1px) solid light-dark(var(--ig-gray-400), var(--ig-gray-300));
|
|
68
97
|
border-inline-end: 0;
|
|
69
|
-
|
|
98
|
+
|
|
70
99
|
igc-icon {
|
|
71
100
|
--size: #{rem(32px)};
|
|
72
101
|
}
|
|
73
102
|
}
|
|
74
103
|
|
|
75
|
-
} // close first @layer components block (mixin definitions stay un-nested below)
|
|
76
|
-
|
|
77
|
-
// Centered-card sizing for both igc-dialog::part(base) and native <dialog>.
|
|
78
|
-
// DocsLayout.scss flips this to fullscreen on mobile.
|
|
79
|
-
@mixin search-dialog-base-styles {
|
|
80
|
-
margin: auto;
|
|
81
|
-
padding: 0;
|
|
82
|
-
width: 90%;
|
|
83
|
-
max-width: rem(672px);
|
|
84
|
-
height: calc(100vh - #{rem(128px)});
|
|
85
|
-
max-height: rem(768px);
|
|
86
|
-
box-shadow: none;
|
|
87
|
-
border: none;
|
|
88
|
-
border-radius: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/// Backdrop base state (before open animation).
|
|
92
|
-
@mixin search-dialog-backdrop {
|
|
93
|
-
background-color: light-dark(var(--ig-gray-800), var(--ig-gray-50));
|
|
94
|
-
will-change: backdrop-filter, opacity;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Backdrop visible/open state.
|
|
98
|
-
@mixin search-dialog-backdrop-open {
|
|
99
|
-
opacity: .6;
|
|
100
|
-
-webkit-backdrop-filter: blur(10px);
|
|
101
|
-
backdrop-filter: blur(10px);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@layer components {
|
|
105
|
-
|
|
106
104
|
// Shared dialog chrome
|
|
107
105
|
[data-search-modal-open] { overflow: hidden; }
|
|
108
106
|
|
|
@@ -268,5 +266,112 @@
|
|
|
268
266
|
color: light-dark(var(--ig-gray-900), var(--ig-gray-300));
|
|
269
267
|
}
|
|
270
268
|
|
|
271
|
-
|
|
269
|
+
// Dialog chrome — shared by both Search and SearchAdvanced
|
|
270
|
+
.igd-search-dialog {
|
|
271
|
+
--border-radius: 0;
|
|
272
|
+
--background: var(--igd-layout-sections-bg);
|
|
273
|
+
--transition-duration: 150ms;
|
|
274
|
+
border: none;
|
|
275
|
+
|
|
276
|
+
&::part(base) {
|
|
277
|
+
@include search-dialog-base-styles;
|
|
278
|
+
|
|
279
|
+
&:focus-visible {
|
|
280
|
+
outline: none;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&::part(content) {
|
|
285
|
+
padding: 0;
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
height: 100%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&::part(backdrop) {
|
|
292
|
+
@include search-dialog-backdrop;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&[open]::part(backdrop) {
|
|
296
|
+
@include search-dialog-backdrop-open;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
igc-input {
|
|
300
|
+
height: 100%;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
igc-input::part(container) {
|
|
304
|
+
border: 0;
|
|
305
|
+
height: 100%;
|
|
306
|
+
padding: 0 rem(16px) !important;
|
|
307
|
+
border-block-end: none !important;
|
|
308
|
+
|
|
309
|
+
&:focus-within {
|
|
310
|
+
box-shadow:
|
|
311
|
+
0 0 0 1px var(--igd-accent),
|
|
312
|
+
inset 0 1px 0 var(--igd-accent),
|
|
313
|
+
inset 0 -1px 0 var(--igd-accent),
|
|
314
|
+
inset -1px 0 0 var(--igd-accent);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Search dialog header bar (input + optional scope + close)
|
|
320
|
+
.igd-search-header {
|
|
321
|
+
display: flex;
|
|
322
|
+
min-height: rem(75px);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.igd-search-scope {
|
|
326
|
+
flex-shrink: 0;
|
|
327
|
+
align-self: center;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.igd-search-input {
|
|
331
|
+
--input-prefix-background: transparent;
|
|
332
|
+
--input-prefix-background--focused: transparent;
|
|
333
|
+
--input-prefix-background--filled: transparent;
|
|
334
|
+
|
|
335
|
+
--input-suffix-background: transparent;
|
|
336
|
+
--input-suffix-background--focused: transparent;
|
|
337
|
+
--input-suffix-background--filled: transparent;
|
|
338
|
+
|
|
339
|
+
width: 100%;
|
|
340
|
+
min-width: 0;
|
|
341
|
+
flex: 1 1 auto;
|
|
342
|
+
|
|
343
|
+
&::part(input) {
|
|
344
|
+
@include type-style('body-2') {
|
|
345
|
+
margin: 0;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.igd-search-clear {
|
|
351
|
+
--foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
|
|
352
|
+
--hover-foreground: var(--igd-accent);
|
|
353
|
+
--focus-hover-foreground: var(--igd-accent);
|
|
354
|
+
--focus-foreground: var(--igd-accent);
|
|
355
|
+
--active-foreground: var(--igd-accent);
|
|
356
|
+
--shadow-color: transparent;
|
|
357
|
+
--background: transparent;
|
|
358
|
+
--hover-background: transparent;
|
|
359
|
+
--focus-background: transparent;
|
|
360
|
+
--focus-hover-background: transparent;
|
|
361
|
+
--active-background: transparent;
|
|
362
|
+
--border-color: transparent;
|
|
363
|
+
--border-radius: 0;
|
|
364
|
+
|
|
365
|
+
&::part(base) {
|
|
366
|
+
&::after {
|
|
367
|
+
display: none;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.igd-search-icon {
|
|
373
|
+
color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
}
|
|
272
377
|
|