igniteui-astro-components 0.0.2 → 0.0.4

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.
Files changed (122) hide show
  1. package/README.md +21 -0
  2. package/package.json +3 -1
  3. package/src/assets/icons/angular-logo.svg +38 -0
  4. package/src/assets/icons/arrow-down.svg +3 -0
  5. package/src/assets/icons/arrow.svg +3 -0
  6. package/src/assets/icons/blazor-logo.svg +10 -0
  7. package/src/assets/icons/bullet-poiont.svg +3 -0
  8. package/src/assets/icons/chatGPT,.svg +4 -0
  9. package/src/assets/icons/check-circle.svg +3 -0
  10. package/src/assets/icons/check.svg +3 -0
  11. package/src/assets/icons/cheked.svg +3 -0
  12. package/src/assets/icons/chevron.svg +3 -0
  13. package/src/assets/icons/classes.svg +3 -0
  14. package/src/assets/icons/claude.svg +3 -0
  15. package/src/assets/icons/clear.svg +3 -0
  16. package/src/assets/icons/close.svg +3 -0
  17. package/src/assets/icons/code.svg +3 -0
  18. package/src/assets/icons/collapse.svg +5 -0
  19. package/src/assets/icons/command.svg +3 -0
  20. package/src/assets/icons/copy-clipboard.svg +3 -0
  21. package/src/assets/icons/copy.svg +3 -0
  22. package/src/assets/icons/crown.svg +3 -0
  23. package/src/assets/icons/dot.svg +3 -0
  24. package/src/assets/icons/download.svg +3 -0
  25. package/src/assets/icons/dropdown-indicator-bold.svg +3 -0
  26. package/src/assets/icons/dropdown-indicator.svg +3 -0
  27. package/src/assets/icons/enter-fullscreen.svg +3 -0
  28. package/src/assets/icons/enumerations.svg +3 -0
  29. package/src/assets/icons/exit-fullscreen.svg +3 -0
  30. package/src/assets/icons/expand-all.svg +5 -0
  31. package/src/assets/icons/expand-icon.svg +3 -0
  32. package/src/assets/icons/eye.svg +3 -0
  33. package/src/assets/icons/filter-clear.svg +1 -0
  34. package/src/assets/icons/filter.svg +3 -0
  35. package/src/assets/icons/functions.svg +5 -0
  36. package/src/assets/icons/github-logo.svg +3 -0
  37. package/src/assets/icons/hamburger-menu.svg +3 -0
  38. package/src/assets/icons/info.svg +3 -0
  39. package/src/assets/icons/interfaces.svg +3 -0
  40. package/src/assets/icons/link-blank.svg +3 -0
  41. package/src/assets/icons/link.svg +3 -0
  42. package/src/assets/icons/moon.svg +3 -0
  43. package/src/assets/icons/note.svg +3 -0
  44. package/src/assets/icons/open-link-blank.svg +3 -0
  45. package/src/assets/icons/page.svg +3 -0
  46. package/src/assets/icons/palette,.svg +3 -0
  47. package/src/assets/icons/pen.svg +3 -0
  48. package/src/assets/icons/play-circle.svg +10 -0
  49. package/src/assets/icons/premium.svg +3 -0
  50. package/src/assets/icons/react.svg +4 -0
  51. package/src/assets/icons/refresh.svg +3 -0
  52. package/src/assets/icons/rocket.svg +10 -0
  53. package/src/assets/icons/search.svg +10 -0
  54. package/src/assets/icons/shine.svg +3 -0
  55. package/src/assets/icons/show-more.svg +3 -0
  56. package/src/assets/icons/source-code.svg +3 -0
  57. package/src/assets/icons/start.svg +3 -0
  58. package/src/assets/icons/sub-directory-indicator.svg +3 -0
  59. package/src/assets/icons/sun.svg +3 -0
  60. package/src/assets/icons/system-theme.svg +3 -0
  61. package/src/assets/icons/system.svg +3 -0
  62. package/src/assets/icons/type-alias.svg +3 -0
  63. package/src/assets/icons/variables.svg +3 -0
  64. package/src/assets/icons/warning.svg +3 -0
  65. package/src/assets/icons/web-component-logo.svg +23 -0
  66. package/src/assets/icons/wrap-text.svg +3 -0
  67. package/src/assets/ig-logo.svg +33 -0
  68. package/src/assets/illustrations/classes.svg +3 -0
  69. package/src/assets/illustrations/enumerations.svg +3 -0
  70. package/src/assets/illustrations/functions.svg +5 -0
  71. package/src/assets/illustrations/interfaces.svg +3 -0
  72. package/src/assets/illustrations/type-alias.svg +3 -0
  73. package/src/assets/illustrations/variables.svg +3 -0
  74. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +57 -0
  75. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +51 -0
  76. package/src/components/DocsBreadcrumb/README.md +66 -0
  77. package/src/components/DocsSidebar/DocsSidebar.astro +38 -61
  78. package/src/components/DocsSidebar/DocsSidebar.scss +18 -0
  79. package/src/components/DocsSidebar/SidebarFilterInput.astro +22 -57
  80. package/src/components/DocsSidebar/SidebarFilterInput.scss +69 -0
  81. package/src/components/DocsSidebar/SidebarLabel.astro +2 -7
  82. package/src/components/DocsSidebar/toTreeNodes.ts +17 -5
  83. package/src/components/DocsSubHeader/DocsSubHeader.astro +60 -248
  84. package/src/components/DocsSubHeader/DocsSubHeader.scss +69 -0
  85. package/src/components/DocsSubHeader/README.md +6 -37
  86. package/src/components/DocsToc/DocsToc.astro +38 -83
  87. package/src/components/DocsToc/DocsToc.scss +33 -0
  88. package/src/components/DocsTree/DocsTree.astro +16 -2
  89. package/src/components/DocsTree/DocsTreeItem.astro +16 -13
  90. package/src/components/DocsTree/docs-tree.scss +185 -0
  91. package/src/components/GlobalFooter/GlobalFooter.astro +1 -1
  92. package/src/components/GlobalFooter/GlobalFooter.module.scss +1 -0
  93. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +217 -196
  94. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +2 -47
  95. package/src/components/MobileSidebarToggle/MobileSidebarToggle.scss +0 -0
  96. package/src/components/Search/Search.astro +14 -103
  97. package/src/components/Search/Search.scss +50 -0
  98. package/src/components/ThemingWidget/ThemingWidget.astro +1 -5
  99. package/src/components/ThemingWidget/ThemingWidget.scss +3 -0
  100. package/src/components/mdx/DocsAside/DocsAside.astro +15 -47
  101. package/src/components/mdx/DocsAside/DocsAside.scss +36 -0
  102. package/src/components/mdx/DocsAside/README.md +6 -6
  103. package/src/components/mdx/Sample/Sample.astro +1 -32
  104. package/src/components/mdx/Sample/Sample.scss +32 -0
  105. package/src/integration.ts +20 -8
  106. package/src/layouts/DocsLayout/DocsLayout.astro +88 -244
  107. package/src/layouts/DocsLayout/DocsLayout.scss +125 -0
  108. package/src/scripts/icon-registry.ts +57 -0
  109. package/src/styles/custom.scss +17 -251
  110. package/src/styles/global/_breakpoints.scss +48 -0
  111. package/src/styles/global/_code-blocks.scss +77 -0
  112. package/src/styles/global/_component-themes.scss +68 -0
  113. package/src/styles/global/_index.scss +9 -0
  114. package/src/styles/global/_markdown.scss +120 -0
  115. package/src/styles/global/_members.scss +85 -0
  116. package/src/styles/global/_palette.scss +131 -0
  117. package/src/styles/global/_type-scale.scss +182 -0
  118. package/src/styles/global/_variables.scss +71 -0
  119. package/src/styles/theme.scss +58 -0
  120. package/src/virtual-modules.d.ts +2 -0
  121. package/src/components/DocsTree/docs-tree.css +0 -226
  122. package/src/styles/ig-theme.scss +0 -43
@@ -18,15 +18,21 @@ import { isGroup, isInitiallyOpen, joinPath, normalizeSlug } from '../../lib/sid
18
18
 
19
19
  const base = import.meta.env.BASE_URL.replace(/\/$/, '');
20
20
 
21
- const linkHref = (slug: string): string => {
21
+ const linkHref = (slug: string, trailingSlash: boolean): string => {
22
22
  const normalized = normalizeSlug(slug);
23
- return normalized ? `${base}/${normalized}/` : `${base}/`;
23
+ const suffix = trailingSlash ? '/' : '';
24
+ if (!normalized) {
25
+ // Root (docs index): ensure href is at least '/' when base is empty.
26
+ return `${base}${suffix}` || '/';
27
+ }
28
+ return `${base}/${normalized}${suffix}`;
24
29
  };
25
30
 
26
31
  const toNode = (
27
32
  entry: SidebarEntry,
28
33
  ancestors: string[],
29
34
  currentSlug: string,
35
+ trailingSlash: boolean,
30
36
  ): TreeNode => {
31
37
  const path = joinPath(ancestors, entry.label);
32
38
 
@@ -36,7 +42,7 @@ const toNode = (
36
42
  label: entry.label,
37
43
  expanded: isInitiallyOpen(entry, currentSlug) || undefined,
38
44
  children: entry.items.map((child) =>
39
- toNode(child, [...ancestors, entry.label], currentSlug),
45
+ toNode(child, [...ancestors, entry.label], currentSlug, trailingSlash),
40
46
  ),
41
47
  itemData: {
42
48
  path,
@@ -49,7 +55,7 @@ const toNode = (
49
55
  return {
50
56
  id: normalizeSlug(entry.slug),
51
57
  label: entry.label,
52
- href: linkHref(entry.slug),
58
+ href: linkHref(entry.slug, trailingSlash),
53
59
  itemData: {
54
60
  path,
55
61
  label: entry.label,
@@ -60,7 +66,13 @@ const toNode = (
60
66
  };
61
67
  };
62
68
 
69
+ export interface ToTreeNodesOptions {
70
+ /** Append trailing slash to sidebar links. Defaults to `true`. */
71
+ trailingSlash?: boolean;
72
+ }
73
+
63
74
  export const toTreeNodes = (
64
75
  entries: SidebarEntry[],
65
76
  currentSlug: string,
66
- ): TreeNode[] => entries.map((entry) => toNode(entry, [], currentSlug));
77
+ { trailingSlash = true }: ToTreeNodesOptions = {},
78
+ ): TreeNode[] => entries.map((entry) => toNode(entry, [], currentSlug, trailingSlash));
@@ -3,16 +3,19 @@
3
3
  * DocsSubHeader
4
4
  *
5
5
  * A secondary fixed header bar rendered below the GlobalNavBar.
6
+ * Contains the search input and cross-product navigation links.
6
7
  *
7
8
  * Positioning (set in DocsLayout / custom.css):
8
9
  * --docs-global-nav-height height of the GlobalNavBar above (default 86px)
9
10
  * --docs-subheader-height height of this bar (default 40px)
11
+ *
12
+ * Note: The breadcrumb that previously lived in `.subheader-context` has been
13
+ * moved to the `DocsBreadcrumb` component, rendered inside the main frame.
10
14
  */
11
15
  import { platform as virtualPlatform } from 'virtual:docs-template/nav-html';
12
- import { productLinks, sidebar as sidebarData, title as siteTitle } from 'virtual:docs-template/site-meta';
16
+ import { productLinks } from 'virtual:docs-template/site-meta';
13
17
  import Search from '../Search/Search.astro';
14
- import type { SidebarEntry } from '../../lib/sidebar/types';
15
- import { getBreadcrumb } from '../../lib/sidebar/helpers';
18
+ import './DocsSubHeader.scss';
16
19
 
17
20
  interface ProductLink {
18
21
  label: string;
@@ -21,92 +24,61 @@ interface ProductLink {
21
24
  }
22
25
 
23
26
  interface Props {
24
- /** Fallback title if the slug is not present in the sidebar tree. */
25
- pageTitle?: string | null;
26
- /** Current page slug — used to derive the breadcrumb from the sidebar tree. */
27
- currentSlug?: string;
28
- /**
29
- * Override the site title shown on the left. Defaults to the virtual module value.
30
- * Useful when consuming without `siteMetaIntegration`.
31
- */
32
- siteTitle?: string;
33
27
  /**
34
28
  * Override the cross-product navigation links. Defaults to the virtual module value.
35
29
  * Useful when consuming without `siteMetaIntegration`.
36
30
  */
37
31
  productLinks?: ProductLink[];
38
- /**
39
- * Override the sidebar tree used for breadcrumb generation.
40
- * Defaults to the virtual module value.
41
- */
42
- sidebarItems?: SidebarEntry[];
43
32
  }
44
33
 
45
- const { pageTitle = '', currentSlug = '', siteTitle: siteTitleProp, productLinks: productLinksProp, sidebarItems } = Astro.props;
46
- const resolvedSiteTitle = siteTitleProp ?? siteTitle;
34
+ const { productLinks: productLinksProp } = Astro.props;
47
35
  const currentPlatform = virtualPlatform ?? null;
48
36
  const resolvedLinks = (productLinksProp ?? productLinks) as ProductLink[];
49
37
  const filteredLinks = resolvedLinks.filter((l: ProductLink) => l.platform !== currentPlatform);
50
-
51
- // Breadcrumb of sidebar labels for the current page (root group dropped),
52
- // ending with the active item's own sidebar label. Falls back to `pageTitle`
53
- // if the slug is not in the sidebar tree.
54
- const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
55
- const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
56
- const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitle] : []);
38
+ import logoRaw from '../../assets/ig-logo.svg?raw';
57
39
  ---
58
40
 
59
- <docs-subheader-menu>
60
- <div class="docs-subheader">
61
-
62
- <!-- Left: title area, takes all free space -->
63
- <div class="subheader-context">
64
- {resolvedSiteTitle && <span class="subheader-site-title">{resolvedSiteTitle}</span>}
65
- {crumbs.map((label, i) => (
66
- <>
67
- <span class="subheader-sep" aria-hidden="true">{i === 0 ? '-' : '/'}</span>
68
- <span class="subheader-crumb" title={label}>{label}</span>
69
- </>
70
- ))}
71
- </div>
72
-
73
- <!-- Search -->
74
- <Search />
75
-
76
- <!-- Right: product links. Desktop: flex row. Mobile: absolute dropdown. -->
77
- <div class="subheader-right" id="docs-subheader-panel">
78
- {filteredLinks.length > 0 && (
79
- <div class="subheader-links">
80
- {filteredLinks.map((link, i) => (
81
- <>
82
- {i > 0 && <span class="product-sep" aria-hidden="true">|</span>}
83
- <a href={link.href} class="product-link">{link.label}</a>
84
- </>
85
- ))}
86
- </div>
87
- )}
88
- </div>
89
-
90
- <!-- Mobile toggle (hidden on desktop) -->
91
- <button
92
- class="subheader-toggle"
93
- data-docs-toggle
94
- aria-expanded="false"
95
- aria-controls="docs-subheader-panel"
96
- aria-label="Toggle navigation"
97
- >
98
- <svg class="icon-open" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
99
- <line x1="3" y1="6" x2="21" y2="6" />
100
- <line x1="3" y1="12" x2="21" y2="12" />
101
- <line x1="3" y1="18" x2="21" y2="18" />
102
- </svg>
103
- <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">
104
- <line x1="18" y1="6" x2="6" y2="18" />
105
- <line x1="6" y1="6" x2="18" y2="18" />
106
- </svg>
107
- </button>
108
-
41
+ <docs-subheader-menu class="docs-subheader">
42
+ <div class="igd-logo">
43
+ <Fragment set:html={logoRaw} />
44
+ <h1 class="ig-typography__body-2">IgniteUI</h1>
109
45
  </div>
46
+
47
+ <!-- Search -->
48
+ <Search />
49
+
50
+ <!-- Right: product links. Desktop: flex row. Mobile: absolute dropdown. -->
51
+ <!--<div class="subheader-right" id="docs-subheader-panel">-->
52
+ <!-- {filteredLinks.length > 0 && (-->
53
+ <!-- <div class="subheader-links">-->
54
+ <!-- {filteredLinks.map((link, i) => (-->
55
+ <!-- <>-->
56
+ <!-- {i > 0 && <span class="product-sep" aria-hidden="true">|</span>}-->
57
+ <!-- <a href={link.href} class="product-link">{link.label}</a>-->
58
+ <!-- </>-->
59
+ <!-- ))}-->
60
+ <!-- </div>-->
61
+ <!-- )}-->
62
+ <!--</div>-->
63
+
64
+ <!-- Mobile toggle (hidden on desktop) -->
65
+ <!--<button-->
66
+ <!-- class="subheader-toggle"-->
67
+ <!-- data-docs-toggle-->
68
+ <!-- aria-expanded="false"-->
69
+ <!-- aria-controls="docs-subheader-panel"-->
70
+ <!-- aria-label="Toggle navigation"-->
71
+ <!--&gt;-->
72
+ <!-- <svg class="icon-open" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">-->
73
+ <!-- <line x1="3" y1="6" x2="21" y2="6" />-->
74
+ <!-- <line x1="3" y1="12" x2="21" y2="12" />-->
75
+ <!-- <line x1="3" y1="18" x2="21" y2="18" />-->
76
+ <!-- </svg>-->
77
+ <!-- <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">-->
78
+ <!-- <line x1="18" y1="6" x2="6" y2="18" />-->
79
+ <!-- <line x1="6" y1="6" x2="18" y2="18" />-->
80
+ <!-- </svg>-->
81
+ <!--</button>-->
110
82
  </docs-subheader-menu>
111
83
 
112
84
  <script>
@@ -139,6 +111,18 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
139
111
  document.addEventListener('click', (e: MouseEvent) => {
140
112
  if (!this.contains(e.target as Node)) setExpanded(false);
141
113
  });
114
+
115
+ // Swap text → logo when the GlobalNavBar scrolls out of view.
116
+ const globalNav = document.querySelector('[data-astro-transition-persist="global-nav-bar"]');
117
+ if (globalNav) {
118
+ const observer = new IntersectionObserver(
119
+ ([entry]) => {
120
+ this.classList.toggle('docs-subheader--pinned', !entry.isIntersecting);
121
+ },
122
+ { threshold: 0 }
123
+ );
124
+ observer.observe(globalNav);
125
+ }
142
126
  }
143
127
  }
144
128
 
@@ -146,175 +130,3 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
146
130
  }
147
131
  </script>
148
132
 
149
- <style>
150
- docs-subheader-menu {
151
- display: contents;
152
- }
153
-
154
- /* ── Fixed bar ─────────────────────────────────────────────────────────── */
155
-
156
- .docs-subheader {
157
- position: fixed;
158
- inset-inline-start: 0;
159
- inset-block-start: var(--docs-global-nav-height, 4.7rem);
160
- width: 100%;
161
- height: var(--docs-subheader-height, 2.5rem);
162
- z-index: calc(var(--sl-z-index-navbar) - 1);
163
- display: flex;
164
- flex-direction: row;
165
- align-items: center;
166
- gap: 0.75rem;
167
- padding-inline: 1rem;
168
- background-color: var(--sl-color-bg-nav);
169
- border-bottom: 1px solid var(--sl-color-hairline-shade);
170
- overflow: visible;
171
- }
172
-
173
- /* ── Context (left) ────────────────────────────────────────────────────── */
174
-
175
- .subheader-context {
176
- flex: 1;
177
- min-width: 0;
178
- display: flex;
179
- flex-direction: row;
180
- align-items: center;
181
- gap: 0.375rem;
182
- overflow: hidden;
183
- }
184
-
185
- .subheader-site-title {
186
- flex-shrink: 0;
187
- font-size: 0.875rem;
188
- font-weight: 600;
189
- color: var(--sl-color-text-accent);
190
- white-space: nowrap;
191
- }
192
-
193
- .subheader-page-title {
194
- font-size: 0.875rem;
195
- color: var(--sl-color-text);
196
- white-space: nowrap;
197
- overflow: hidden;
198
- text-overflow: ellipsis;
199
- }
200
-
201
- .subheader-crumb {
202
- flex-shrink: 0;
203
- font-size: 0.875rem;
204
- color: var(--sl-color-gray-4);
205
- white-space: nowrap;
206
- overflow: hidden;
207
- text-overflow: ellipsis;
208
- max-width: 14rem;
209
- }
210
-
211
- .subheader-sep {
212
- flex-shrink: 0;
213
- color: var(--sl-color-gray-3);
214
- font-size: 0.875rem;
215
- user-select: none;
216
- }
217
-
218
- /* ── Right side: links ──────────────────────────────────────────────────── */
219
-
220
- .subheader-right {
221
- flex-shrink: 0;
222
- display: flex;
223
- flex-direction: row;
224
- align-items: center;
225
- gap: 0.5rem;
226
- }
227
-
228
- .subheader-links {
229
- display: flex;
230
- flex-direction: row;
231
- align-items: center;
232
- flex-wrap: nowrap;
233
- gap: 0;
234
- }
235
-
236
- .product-link {
237
- font-size: 0.75rem;
238
- color: var(--sl-color-gray-2);
239
- text-decoration: none;
240
- white-space: nowrap;
241
- padding-inline: 0.25rem;
242
- line-height: 1;
243
- transition: color 0.15s;
244
- }
245
-
246
- .product-link:hover,
247
- .product-link:focus-visible {
248
- color: var(--sl-color-text-accent);
249
- text-decoration: underline;
250
- }
251
-
252
- .product-sep {
253
- flex-shrink: 0;
254
- font-size: 0.6875rem;
255
- color: var(--sl-color-gray-4);
256
- padding-inline: 0.125rem;
257
- line-height: 1;
258
- user-select: none;
259
- }
260
-
261
- /* ── Mobile toggle (hidden on desktop) ─────────────────────────────────── */
262
-
263
- .subheader-toggle {
264
- display: none;
265
- flex-shrink: 0;
266
- padding: 0.25rem;
267
- background: none;
268
- border: none;
269
- border-radius: 0.25rem;
270
- color: var(--sl-color-text);
271
- cursor: pointer;
272
- line-height: 0;
273
- }
274
-
275
- /* ══ Mobile (≤ 50rem) ══════════════════════════════════════════════════════ */
276
-
277
- @media (max-width: 50rem) {
278
- .subheader-right {
279
- display: none;
280
- position: absolute;
281
- top: 100%;
282
- left: 0;
283
- right: 0;
284
- flex-direction: column;
285
- align-items: stretch;
286
- gap: 0.5rem;
287
- padding: 0.75rem 1rem;
288
- background-color: var(--sl-color-bg-nav);
289
- border-bottom: 1px solid var(--sl-color-hairline-shade);
290
- box-shadow: var(--sl-shadow-md);
291
- }
292
-
293
- docs-subheader-menu[aria-expanded='true'] .subheader-right {
294
- display: flex;
295
- }
296
-
297
- .subheader-links {
298
- flex-wrap: wrap;
299
- }
300
-
301
- .product-link {
302
- font-size: 0.875rem;
303
- padding-block: 0.25rem;
304
- }
305
-
306
- .subheader-toggle {
307
- display: flex;
308
- align-items: center;
309
- justify-content: center;
310
- }
311
-
312
- .subheader-toggle:hover,
313
- .subheader-toggle:focus-visible {
314
- background-color: var(--sl-color-hairline);
315
- }
316
-
317
- docs-subheader-menu[aria-expanded='true'] .subheader-toggle .icon-open { display: none; }
318
- docs-subheader-menu:not([aria-expanded='true']) .subheader-toggle .icon-close { display: none; }
319
- }
320
- </style>
@@ -0,0 +1,69 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+ @use '../../styles/global/breakpoints' as *;
3
+
4
+ .docs-subheader {
5
+ position: sticky;
6
+ inset: 0;
7
+ display: grid;
8
+ grid-template-columns: var(--igd-page-layout-grid);
9
+ align-items: center;
10
+ width: 100%;
11
+ min-height: var(--igd-header-height);
12
+ grid-column: 1 / -1;
13
+ grid-row: 1;
14
+ border-block-end: var(--igd-app-outline);
15
+ z-index: 1;
16
+ background-color: var(--igd-layout-sections-bg);
17
+
18
+ .igd-logo {
19
+ display: flex;
20
+ align-items: center;
21
+ height: 100%;
22
+
23
+ @media (min-width: #{$bp-mobile-horizontal-max}) {
24
+ padding-inline: var(--igd-padding-lg);
25
+ }
26
+
27
+ svg {
28
+ min-width: rem(79px);
29
+ height: rem(22px);
30
+ opacity: 0;
31
+ transform: translateY(-4px);
32
+ transition: opacity 200ms ease, transform 200ms ease;
33
+ position: absolute;
34
+
35
+ .logo-type {
36
+ fill: var(--igd-logo-type);
37
+ }
38
+ }
39
+
40
+ h1 {
41
+ opacity: 1;
42
+ transform: translateY(0);
43
+ transition: opacity 200ms ease, transform 200ms ease;
44
+ margin: 0;
45
+ }
46
+
47
+ border-inline-end: var(--igd-app-outline);
48
+ }
49
+
50
+ // Logo area: text visible by default, logo hidden.
51
+ // When the GlobalNavBar scrolls out of view, .docs-subheader--pinned is added
52
+ // and the logo fades in while the text fades out.
53
+ &--pinned {
54
+ .igd-logo {
55
+ svg {
56
+ opacity: 1;
57
+ transform: translateY(0);
58
+ position: relative;
59
+ }
60
+
61
+ h1 {
62
+ opacity: 0;
63
+ transform: translateY(4px);
64
+ position: absolute;
65
+ pointer-events: none;
66
+ }
67
+ }
68
+ }
69
+ }
@@ -1,6 +1,8 @@
1
1
  # DocsSubHeader
2
2
 
3
- Secondary fixed header bar rendered below the `GlobalNavBar`. Contains the site title, breadcrumb trail derived from the sidebar tree, the Pagefind search button, and platform product-switch links.
3
+ Secondary fixed header bar rendered below the `GlobalNavBar`. Contains the Pagefind search button and platform product-switch links.
4
+
5
+ > **Note:** The breadcrumb trail was extracted into the standalone [`DocsBreadcrumb`](../DocsBreadcrumb/README.md) component and is now rendered inside the main content frame, above the page body — not in this bar.
4
6
 
5
7
  ## Import
6
8
 
@@ -12,38 +14,21 @@ import DocsSubHeader from 'igniteui-astro-components/components/DocsSubHeader.as
12
14
 
13
15
  | Prop | Type | Default | Description |
14
16
  |------|------|---------|-------------|
15
- | `pageTitle` | `string \| null` | — | Fallback label shown when `currentSlug` is not found in the sidebar tree. |
16
- | `currentSlug` | `string` | `''` | Current page slug — used to derive the breadcrumb from the sidebar. |
17
- | `siteTitle` | `string` | virtual module | Override the site name shown on the left. |
18
17
  | `productLinks` | `{ label: string; href: string; platform?: string }[]` | virtual module | Override the cross-product navigation links. |
19
- | `sidebarItems` | `SidebarEntry[]` | virtual module | Override the sidebar tree used for breadcrumb generation. |
20
18
 
21
19
  ## Behaviour
22
20
 
23
- - The breadcrumb is built by walking `sidebarData` (from `virtual:docs-template/site-meta`) with `getBreadcrumb()`.
24
21
  - Product links from the virtual module are shown; the currently active platform link is hidden.
25
22
  - The search button opens the Pagefind dialog (see `Search` component).
26
23
  - CSS custom properties used for positioning:
27
- - `--docs-global-nav-height` (default `86px`) — height of the bar above
28
- - `--docs-subheader-height` (default `40px`) — height of this bar
24
+ - `--docs-global-nav-height` (default `4.7rem`) — height of the `GlobalNavBar` above
25
+ - `--docs-subheader-height` (default `2.5rem`) — height of this bar
29
26
 
30
27
  ## Example
31
28
 
32
- ### Prop-driven (no `siteMetaIntegration` required)
33
-
34
29
  ```astro
35
30
  ---
36
31
  import DocsSubHeader from 'igniteui-astro-components/components/DocsSubHeader.astro';
37
- import type { SidebarEntry } from 'igniteui-astro-components/lib/sidebar/types';
38
-
39
- const sidebar: SidebarEntry[] = [
40
- { label: 'Getting Started', collapsed: false, items: [
41
- { label: 'Introduction', slug: '' },
42
- ]},
43
- { label: 'Components', collapsed: false, items: [
44
- { label: 'Toast', slug: 'components/toast' },
45
- ]},
46
- ];
47
32
 
48
33
  const productLinks = [
49
34
  { label: 'Angular', href: '/angular/', platform: 'angular' },
@@ -51,23 +36,7 @@ const productLinks = [
51
36
  { label: 'Web Components', href: '/web-components/', platform: 'web-components' },
52
37
  ];
53
38
  ---
54
- <DocsSubHeader
55
- siteTitle="My Library"
56
- productLinks={productLinks}
57
- sidebarItems={sidebar}
58
- currentSlug="components/toast"
59
- />
60
- ```
61
-
62
- ### With `siteMetaIntegration` (integration-driven)
63
-
64
- All props are optional when the virtual module provides the data:
65
-
66
- ```astro
67
- ---
68
- import DocsSubHeader from 'igniteui-astro-components/components/DocsSubHeader.astro';
69
- ---
70
- <DocsSubHeader pageTitle="Toast" currentSlug="components/toast" />
39
+ <DocsSubHeader productLinks={productLinks} />
71
40
  ```
72
41
 
73
42
  This component is used automatically inside `DocsLayout` — you only need to