igniteui-astro-components 0.0.26 → 0.0.27

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
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": {
@@ -80,18 +80,12 @@
80
80
  },
81
81
  "peerDependencies": {
82
82
  "astro": "^5.0.0 || ^6.0.0",
83
- "igniteui-webcomponents": "^7.1.3"
84
- },
85
- "peerDependenciesMeta": {
86
- "igniteui-webcomponents": {
87
- "optional": true
88
- }
83
+ "igniteui-webcomponents": "^7.2.4"
89
84
  },
90
85
  "dependencies": {
91
86
  "@fontsource-variable/instrument-sans": "^5.2.8",
92
87
  "@fontsource-variable/inter": "^5.2.8",
93
88
  "@fontsource-variable/jetbrains-mono": "^5.2.8",
94
- "igniteui-webcomponents": "^7.1.3",
95
89
  "jsdom": "^29.0.1",
96
90
  "shiki": "^3.23.0"
97
91
  },
@@ -116,6 +116,7 @@ const packages = (rawPackages as PackageEntry[] | undefined)?.map((p: PackageEnt
116
116
  );
117
117
  const selectedPackage = selectedPackageProp ?? (virtualSelectedPackage || undefined) ?? packages?.[0]?.value;
118
118
  const platformIcon = PLATFORM_ICONS[selectedPackage ?? ''] ?? PLATFORM_ICONS[currentPlatform ?? ''] ?? null;
119
+ const selectedPackageLabel = packages?.find(p => p.value === selectedPackage)?.label ?? selectedPackage ?? '';
119
120
 
120
121
  const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
121
122
  const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
@@ -167,6 +168,7 @@ const platformLabel = currentPlatform ? (PLATFORM_LABELS[currentPlatform] ?? nul
167
168
  );
168
169
  })}
169
170
  </igc-select>
171
+ <igc-tooltip id="package-tooltip" class="igd-package-select-tooltip" anchor="package-select" placement="bottom" with-arrow>{selectedPackageLabel}</igc-tooltip>
170
172
  )}
171
173
 
172
174
  <!-- Version selector -->
@@ -243,7 +245,15 @@ const platformLabel = currentPlatform ? (PLATFORM_LABELS[currentPlatform] ?? nul
243
245
  }
244
246
  // Only show the package tooltip when the label is visually truncated
245
247
  if (packageTooltip && packageSelect) {
248
+ // Hide tooltip when the dropdown opens
249
+ packageSelect.addEventListener('igcOpening', () => packageTooltip.hide?.());
250
+
246
251
  packageTooltip.addEventListener('igcOpening', (e: Event) => {
252
+ // Never show tooltip while the dropdown is open
253
+ if ((packageSelect as any).open) {
254
+ e.preventDefault();
255
+ return;
256
+ }
247
257
  const igcInput = (packageSelect as any).shadowRoot?.querySelector('igc-input');
248
258
  const nativeInput = igcInput?.shadowRoot?.querySelector('input');
249
259
  // Show when we applied manual truncation (ends with '\u2026') or
@@ -288,9 +298,9 @@ const platformLabel = currentPlatform ? (PLATFORM_LABELS[currentPlatform] ?? nul
288
298
  </script>
289
299
 
290
300
  <script>
291
- import { defineComponents, IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent } from 'igniteui-webcomponents';
301
+ import { defineComponents, IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent, IgcTooltipComponent } from 'igniteui-webcomponents';
292
302
  import { registerIcons } from '../../scripts/icon-registry';
293
- defineComponents(IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent);
303
+ defineComponents(IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent, IgcTooltipComponent);
294
304
  registerIcons();
295
305
 
296
306
  function getPlatformIcon(text: string): string | null {
@@ -130,13 +130,21 @@
130
130
  }
131
131
  }
132
132
 
133
- .igd-version-select,
134
- .igd-package-select {
133
+ .igd-version-select {
135
134
  &::part(native-input) {
136
135
  field-sizing: content;
137
136
  }
138
137
  }
139
138
 
139
+ .igd-package-select {
140
+ &::part(native-input) {
141
+ min-width: 0;
142
+ overflow: hidden;
143
+ text-overflow: ellipsis;
144
+ white-space: nowrap;
145
+ }
146
+ }
147
+
140
148
  // Hidden by default. DocsLayout.scss reveals it on tablet/mobile (when the sidebar is hidden).
141
149
  .subheader-sidebar-toggle {
142
150
  display: none;
@@ -155,7 +163,8 @@
155
163
  --active-background: transparent;
156
164
  }
157
165
 
158
- #package-tooltip {
166
+ #package-tooltip,
167
+ .igd-package-select-tooltip {
159
168
  --ig-tooltip-background: #D2DBE8;
160
169
  --ig-tooltip-text-color: #112031;
161
170
  --ig-tooltip-border-radius: #{rem(4px)};
@@ -431,14 +431,29 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
431
431
 
432
432
  // Only show the scope tooltip when the label is visually truncated
433
433
  if (this.scopeTooltip && this.scopeSelect) {
434
+ // Hide tooltip when the dropdown opens
435
+ this.scopeSelect.addEventListener('igcOpening', () => (this.scopeTooltip as any)?.hide?.());
436
+
434
437
  this.scopeTooltip.addEventListener('igcOpening', (e: Event) => {
438
+ // Never show tooltip while the dropdown is open
439
+ if ((this.scopeSelect as any)?.open) {
440
+ e.preventDefault();
441
+ return;
442
+ }
435
443
  const igcInput = (this.scopeSelect as any).shadowRoot?.querySelector('igc-input');
436
444
  const nativeInput = igcInput?.shadowRoot?.querySelector('input');
437
445
  const truncated = nativeInput?.value?.endsWith('\u2026');
438
446
  const overflows = nativeInput && nativeInput.scrollWidth > nativeInput.clientWidth;
439
447
  if (!truncated && !overflows) {
440
448
  e.preventDefault();
449
+ return;
441
450
  }
451
+ // Refresh tooltip content here because igc-select.value may not be
452
+ // ready during connectedCallback (before the component's first LitElement
453
+ // render cycle), so the initial syncScopeTooltip() call may have set
454
+ // an empty string. By the time a hover triggers igcOpening the
455
+ // component is fully initialized and the value is reliable.
456
+ this.syncScopeTooltip();
442
457
  });
443
458
  }
444
459
  }
@@ -26,6 +26,15 @@ html {
26
26
  scroll-padding-top: calc(var(--igd-toc-subheader-bottom) + var(--igd-toc-scroll-offset));
27
27
  }
28
28
 
29
+ // Chromium scrolls a newly-focused element into view honoring scroll-padding-top.
30
+ // When an igc-select in the sticky subheader refocuses its trigger input after an
31
+ // item is selected, that padding offset nudges the page upward. Zero it out only
32
+ // while one of the subheader selects is focused so item selection never scrolls.
33
+ html:has(#package-select:focus),
34
+ html:has(#version-select:focus) {
35
+ scroll-padding-top: 0;
36
+ }
37
+
29
38
  body {
30
39
  scrollbar-gutter: stable;
31
40
  }