igniteui-astro-components 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -74
- package/package.json +16 -2
- package/src/assets/images/anatomy-test.png +0 -0
- package/src/components/CopyCode/CopyCode.astro +21 -7
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
- package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
- package/src/components/DocsBreadcrumb/README.md +10 -14
- package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
- package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
- package/src/components/DocsSidebar/README.md +25 -21
- package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
- package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
- package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
- package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
- package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
- package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
- package/src/components/DocsSubHeader/README.md +18 -16
- package/src/components/DocsToc/DocsToc.astro +301 -280
- package/src/components/DocsToc/DocsToc.scss +20 -21
- package/src/components/DocsToc/README.md +11 -9
- package/src/components/DocsToc/toTreeNodes.ts +3 -8
- package/src/components/DocsTree/DocsTree.astro +32 -20
- package/src/components/DocsTree/DocsTreeItem.astro +35 -30
- package/src/components/DocsTree/README.md +16 -15
- package/src/components/DocsTree/docs-tree.scss +267 -268
- package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
- package/src/components/GlobalFooter/README.md +3 -2
- package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
- package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
- package/src/components/GlobalNavBar/README.md +3 -2
- package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
- package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
- package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
- package/src/components/MobileSidebarToggle/README.md +3 -2
- package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
- package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
- package/src/components/Search/README.md +1 -0
- package/src/components/Search/Search.astro +137 -109
- package/src/components/Search/Search.scss +20 -20
- package/src/components/SearchAdvanced/README.md +21 -15
- package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
- package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
- package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
- package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
- package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
- package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
- package/src/components/mdx/ApiLink/README.md +26 -22
- package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
- package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
- package/src/components/mdx/ApiRef/README.md +20 -15
- package/src/components/mdx/Badge/Badge.astro +14 -14
- package/src/components/mdx/Badge/Badge.scss +61 -56
- package/src/components/mdx/Badge/README.md +24 -19
- package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
- package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
- package/src/components/mdx/DocsAside/README.md +22 -22
- package/src/components/mdx/Faq/Faq.astro +86 -0
- package/src/components/mdx/Faq/Faq.scss +105 -0
- package/src/components/mdx/Faq/FaqItem.astro +117 -0
- package/src/components/mdx/Faq/README.md +223 -0
- package/src/components/mdx/Faq/types.ts +34 -0
- package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
- package/src/components/mdx/PlatformBlock/README.md +6 -8
- package/src/components/mdx/Sample/README.md +21 -16
- package/src/components/mdx/Sample/Sample.astro +97 -74
- package/src/components/mdx/Sample/Sample.scss +132 -132
- package/src/content-helper.ts +71 -72
- package/src/content.config.ts +1 -6
- package/src/integration.ts +566 -512
- package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
- package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
- package/src/layouts/DocsLayout/README.md +24 -35
- package/src/lib/nav-helpers.ts +88 -82
- package/src/lib/types.ts +76 -76
- package/src/llms.ts +205 -166
- package/src/platform.ts +312 -162
- package/src/plugins/rehype-heading-anchors.ts +45 -45
- package/src/plugins/rehype-pagefind-ignore.ts +19 -19
- package/src/plugins/rehype-table-wrapper.ts +30 -30
- package/src/plugins/remark-docfx.ts +12 -0
- package/src/plugins/remark-env-vars.ts +12 -4
- package/src/plugins/remark-md-links.ts +10 -4
- package/src/scripts/icon-manifest.ts +13 -5
- package/src/scripts/sample-widget.ts +557 -501
- package/src/sidebar.ts +103 -97
- package/src/styles/global/_code-blocks.scss +43 -44
- package/src/styles/global/_component-themes.scss +151 -153
- package/src/styles/global/_icon-gallery.scss +81 -81
- package/src/styles/global/_index.scss +0 -1
- package/src/styles/global/_markdown.scss +816 -787
- package/src/styles/global/_palette.scss +456 -110
- package/src/styles/global/_search-shared.scss +402 -398
- package/src/styles/global/_type-scale.scss +127 -127
- package/src/styles/global/_variables.scss +138 -111
- package/src/styles/theme.scss +41 -41
- package/src/virtual-modules.d.ts +11 -2
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
* Package: igniteui-webcomponents (public, MIT) — change the import path
|
|
9
9
|
* in the <script> block below to use @infragistics/igniteui-webcomponents.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
sidebar as sidebarData,
|
|
13
|
+
trailingSlash as configuredTrailingSlash,
|
|
14
|
+
} from 'virtual:docs-template/site-meta';
|
|
12
15
|
import { platform as virtualPlatform } from 'virtual:docs-template/nav-html';
|
|
13
16
|
import SidebarFilterInput from './SidebarFilterInput.astro';
|
|
14
17
|
import './DocsSidebar.scss';
|
|
@@ -58,58 +61,57 @@ const {
|
|
|
58
61
|
const items = (itemsProp ?? sidebarData) as SidebarEntry[];
|
|
59
62
|
const nodes = toTreeNodes(items, currentSlug, { trailingSlash });
|
|
60
63
|
const activeId = normalizeSlug(currentSlug);
|
|
61
|
-
---
|
|
64
|
+
---
|
|
62
65
|
|
|
63
66
|
<sidebar-filter class="docs-sidebar" id="docs-sidebar" data-no-results="No topics match">
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
67
|
+
<div class="igd-sidebar-logo">
|
|
68
|
+
{/* Keep as <span>, not <h1> — avoids competing with the page <h1> in search. */}
|
|
69
|
+
<span class="igd-logo-text">{logoText}</span>
|
|
70
|
+
{platformLabel && <span class="igd-logo__platform">for {platformLabel}</span>}
|
|
71
|
+
</div>
|
|
72
|
+
<div class="sidebar-gutter">
|
|
73
|
+
{showFilter && <SidebarFilterInput />}
|
|
74
|
+
</div>
|
|
75
|
+
<div class="sidebar-scroll" data-sidebar-scroll>
|
|
76
|
+
<DocsTree
|
|
77
|
+
nodes={nodes}
|
|
78
|
+
variant="sidebar"
|
|
79
|
+
activeId={activeId}
|
|
80
|
+
toggleNodeOnClick
|
|
81
|
+
ariaLabel="Sidebar navigation"
|
|
82
|
+
renderLabel={SidebarLabel}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
82
85
|
</sidebar-filter>
|
|
83
86
|
<div class="docs-sidebar-backdrop" id="docs-sidebar-backdrop" aria-hidden="true"></div>
|
|
84
87
|
|
|
85
88
|
<script>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
// Register Ignite UI Web Components used by the sidebar filter input.
|
|
90
|
+
// (DocsTree registers IgcTreeComponent / IgcTreeItemComponent itself.)
|
|
91
|
+
// To use the licensed package, change the import to:
|
|
92
|
+
// import { ... } from '@infragistics/igniteui-webcomponents';
|
|
93
|
+
import {
|
|
94
|
+
defineComponents,
|
|
95
|
+
IgcBadgeComponent,
|
|
96
|
+
IgcInputComponent,
|
|
97
|
+
IgcButtonComponent,
|
|
98
|
+
IgcIconComponent,
|
|
99
|
+
} from 'igniteui-webcomponents';
|
|
97
100
|
|
|
98
|
-
|
|
101
|
+
defineComponents(IgcBadgeComponent, IgcInputComponent, IgcButtonComponent, IgcIconComponent);
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
// Icons (sidebar-filter-search, sidebar-filter-clear) are registered via
|
|
104
|
+
// the icon registry which picks up all SVGs from src/assets/icons/.
|
|
105
|
+
import '../../scripts/icon-registry';
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
import './sidebar-filter';
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
// Close the sidebar overlay when the backdrop is clicked.
|
|
110
|
+
document.addEventListener('click', (e) => {
|
|
111
|
+
if ((e.target as Element | null)?.closest('#docs-sidebar-backdrop')) {
|
|
112
|
+
document.body.removeAttribute('data-sidebar-open');
|
|
113
|
+
const toggle = document.querySelector<HTMLElement>('[data-sidebar-toggle]');
|
|
114
|
+
toggle?.setAttribute('aria-expanded', 'false');
|
|
115
|
+
}
|
|
116
|
+
});
|
|
114
117
|
</script>
|
|
115
|
-
|
|
@@ -1,126 +1,124 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
|
|
3
3
|
@layer components {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
justify-self: end;
|
|
75
|
-
color: var(--igd-premium-color);
|
|
76
|
-
flex-shrink: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.igd-label-and-badge {
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
gap: rem(8px);
|
|
83
|
-
|
|
84
|
-
igc-badge {
|
|
85
|
-
justify-self: end;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.docs-tree-group {
|
|
91
|
-
gap: rem(8px);
|
|
92
|
-
padding: rem(12px) rem(8px);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.group-label-text {
|
|
96
|
-
@include type-style('body-2') {
|
|
97
|
-
font-weight: 700;
|
|
98
|
-
margin-block: 0;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
|
|
102
|
-
user-select: none;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.group-label-count {
|
|
106
|
-
color: light-dark(var(--ig-gray-700), var(--ig-gray-600));
|
|
107
|
-
background: light-dark(var(--ig-gray-100), var(--ig-gray-200));
|
|
108
|
-
padding: rem(2px) rem(8px);
|
|
109
|
-
aspect-ratio: 1;
|
|
110
|
-
border-radius: rem(4px);
|
|
111
|
-
margin-inline-start: rem(8px);
|
|
112
|
-
font-size: 12px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.igd-badge-container {
|
|
116
|
-
display: flex;
|
|
117
|
-
align-items: center;
|
|
118
|
-
gap: rem(4px);
|
|
119
|
-
margin-left: auto;
|
|
120
|
-
|
|
121
|
-
igc-badge::part(base) {
|
|
122
|
-
max-height: 20px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
4
|
+
// Desktop base. On tablet/mobile DocsLayout.scss turns this into a slide-in overlay.
|
|
5
|
+
.docs-sidebar {
|
|
6
|
+
--igd-sidebar-z-index: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
z-index: var(--igd-sidebar-z-index);
|
|
10
|
+
border-inline-end: var(--igd-app-outline);
|
|
11
|
+
padding: 0;
|
|
12
|
+
background-color: var(--igd-layout-sections-bg);
|
|
13
|
+
position: sticky;
|
|
14
|
+
top: var(--igd-header-height);
|
|
15
|
+
height: calc(100dvh - var(--igd-header-height));
|
|
16
|
+
max-height: 100dvh;
|
|
17
|
+
align-self: start;
|
|
18
|
+
view-transition-name: docs-sidebar;
|
|
19
|
+
|
|
20
|
+
.sidebar-gutter {
|
|
21
|
+
display: grid;
|
|
22
|
+
gap: rem(16px);
|
|
23
|
+
overflow-y: hidden;
|
|
24
|
+
padding: rem(16px);
|
|
25
|
+
border-bottom: var(--igd-app-outline);
|
|
26
|
+
min-height: rem(73px);
|
|
27
|
+
|
|
28
|
+
&:empty {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Hidden by default. DocsLayout.scss reveals it on tablet/mobile when the sidebar is open.
|
|
35
|
+
.docs-sidebar-backdrop {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hidden by default; shown on mobile/tablet where the sidebar is a slide-in overlay.
|
|
40
|
+
.igd-sidebar-logo {
|
|
41
|
+
display: none;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
padding: rem(16px) rem(20px) rem(8px);
|
|
45
|
+
|
|
46
|
+
.igd-logo-text {
|
|
47
|
+
@include type-style('h3') {
|
|
48
|
+
margin-block-end: rem(4px);
|
|
49
|
+
line-height: 1;
|
|
50
|
+
}
|
|
51
|
+
color: var(--ig-gray-800);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.igd-logo__platform {
|
|
55
|
+
@include type-style('subtitle', false) {
|
|
56
|
+
line-height: 1;
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
color: var(--ig-gray-500);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sidebar-scroll {
|
|
64
|
+
overflow-y: auto;
|
|
65
|
+
min-height: 0;
|
|
66
|
+
padding-block: rem(12px);
|
|
67
|
+
scroll-behavior: smooth;
|
|
68
|
+
overscroll-behavior: contain;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sidebar-premium-icon {
|
|
72
|
+
--size: #{rem(20px)};
|
|
126
73
|
|
|
74
|
+
justify-self: end;
|
|
75
|
+
color: var(--igd-premium-color);
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.igd-label-and-badge {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: rem(8px);
|
|
83
|
+
|
|
84
|
+
igc-badge {
|
|
85
|
+
justify-self: end;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.docs-tree-group {
|
|
90
|
+
gap: rem(8px);
|
|
91
|
+
padding: rem(12px) rem(8px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.group-label-text {
|
|
95
|
+
@include type-style('body-2') {
|
|
96
|
+
font-weight: 700;
|
|
97
|
+
margin-block: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
|
|
101
|
+
user-select: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.group-label-count {
|
|
105
|
+
color: light-dark(var(--ig-gray-700), var(--ig-gray-600));
|
|
106
|
+
background: light-dark(var(--ig-gray-100), var(--ig-gray-200));
|
|
107
|
+
padding: rem(2px) rem(8px);
|
|
108
|
+
aspect-ratio: 1;
|
|
109
|
+
border-radius: rem(4px);
|
|
110
|
+
margin-inline-start: rem(8px);
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.igd-badge-container {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: rem(4px);
|
|
118
|
+
margin-left: auto;
|
|
119
|
+
|
|
120
|
+
igc-badge::part(base) {
|
|
121
|
+
max-height: 20px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
The sidebar is composed of four focused components and a custom element:
|
|
4
4
|
|
|
5
|
-
| File
|
|
6
|
-
|
|
7
|
-
| `DocsSidebar.astro`
|
|
8
|
-
| `SidebarFilterInput.astro` | `…/components/sidebar/SidebarFilterInput.astro` | Filter `<input>` markup
|
|
9
|
-
| `SidebarTree.astro`
|
|
10
|
-
| `SidebarItem.astro`
|
|
11
|
-
| `sidebar-filter.ts`
|
|
5
|
+
| File | Export path | Description |
|
|
6
|
+
| -------------------------- | ----------------------------------------------- | ------------------------------------------- |
|
|
7
|
+
| `DocsSidebar.astro` | `…/components/sidebar/DocsSidebar.astro` | Composition root — filter + scrollable tree |
|
|
8
|
+
| `SidebarFilterInput.astro` | `…/components/sidebar/SidebarFilterInput.astro` | Filter `<input>` markup |
|
|
9
|
+
| `SidebarTree.astro` | `…/components/sidebar/SidebarTree.astro` | Recursive `<ul>` renderer |
|
|
10
|
+
| `SidebarItem.astro` | `…/components/sidebar/SidebarItem.astro` | Single link or `<details>` group |
|
|
11
|
+
| `sidebar-filter.ts` | `…/components/sidebar/sidebar-filter` | `<sidebar-filter>` custom element |
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -24,10 +24,10 @@ import DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSideba
|
|
|
24
24
|
|
|
25
25
|
### Props
|
|
26
26
|
|
|
27
|
-
| Prop
|
|
28
|
-
|
|
29
|
-
| `currentSlug` | `string`
|
|
30
|
-
| `items`
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| ------------- | ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `currentSlug` | `string` | `''` | Slug of the active page. Highlights the matching link and auto-expands ancestor groups. |
|
|
30
|
+
| `items` | `SidebarEntry[]` | virtual module | Sidebar tree to render. **Overrides** the `virtual:docs-template/site-meta` value when provided. Use this when not running `siteMetaIntegration`. |
|
|
31
31
|
|
|
32
32
|
### Example
|
|
33
33
|
|
|
@@ -53,11 +53,16 @@ const sidebar: SidebarEntry[] = [
|
|
|
53
53
|
collapsed: false,
|
|
54
54
|
items: [
|
|
55
55
|
{ label: 'Toast', slug: 'components/toast' },
|
|
56
|
-
{
|
|
56
|
+
{
|
|
57
|
+
label: 'Calendar',
|
|
58
|
+
slug: 'components/calendar',
|
|
59
|
+
badge: { text: 'New', variant: 'success' },
|
|
60
|
+
},
|
|
57
61
|
],
|
|
58
62
|
},
|
|
59
63
|
];
|
|
60
64
|
---
|
|
65
|
+
|
|
61
66
|
<DocsSidebar items={sidebar} currentSlug="components/toast" />
|
|
62
67
|
```
|
|
63
68
|
|
|
@@ -79,6 +84,7 @@ When `createDocsSite()` / `siteMetaIntegration()` is configured, omit
|
|
|
79
84
|
---
|
|
80
85
|
import DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSidebar.astro';
|
|
81
86
|
---
|
|
87
|
+
|
|
82
88
|
<DocsSidebar currentSlug="components/toast" />
|
|
83
89
|
```
|
|
84
90
|
|
|
@@ -93,14 +99,13 @@ A good pattern is to define the tree in a shared config file:
|
|
|
93
99
|
// src/site-config.ts
|
|
94
100
|
import type { SidebarEntry } from 'igniteui-astro-components/lib/sidebar/types';
|
|
95
101
|
|
|
96
|
-
export const SIDEBAR: SidebarEntry[] = [
|
|
102
|
+
export const SIDEBAR: SidebarEntry[] = [/* … */];
|
|
97
103
|
```
|
|
98
104
|
|
|
99
105
|
Then import it in every layout/page:
|
|
100
106
|
|
|
101
107
|
```astro
|
|
102
|
-
import {
|
|
103
|
-
// …
|
|
108
|
+
import {SIDEBAR} from '../site-config'; // …
|
|
104
109
|
<DocsSidebar items={SIDEBAR} currentSlug={slug} />
|
|
105
110
|
```
|
|
106
111
|
|
|
@@ -117,9 +122,7 @@ import { buildSidebarFromToc, siteMetaIntegration } from 'igniteui-astro-compone
|
|
|
117
122
|
const sidebar = buildSidebarFromToc({ tocPath: './docs/toc.yml', docsDir: './docs/en' });
|
|
118
123
|
|
|
119
124
|
export default defineConfig({
|
|
120
|
-
integrations: [
|
|
121
|
-
siteMetaIntegration({ title: 'My Docs', sidebar }),
|
|
122
|
-
],
|
|
125
|
+
integrations: [siteMetaIntegration({ title: 'My Docs', sidebar })],
|
|
123
126
|
});
|
|
124
127
|
```
|
|
125
128
|
|
|
@@ -135,7 +138,7 @@ type SidebarLink = {
|
|
|
135
138
|
|
|
136
139
|
type SidebarGroup = {
|
|
137
140
|
label: string;
|
|
138
|
-
collapsed?: boolean;
|
|
141
|
+
collapsed?: boolean; // false = open by default; true = closed by default
|
|
139
142
|
items: SidebarEntry[];
|
|
140
143
|
};
|
|
141
144
|
|
|
@@ -145,6 +148,7 @@ type SidebarEntry = SidebarLink | SidebarGroup;
|
|
|
145
148
|
### Filter behaviour
|
|
146
149
|
|
|
147
150
|
The `<sidebar-filter>` custom element handles live filtering:
|
|
151
|
+
|
|
148
152
|
- Typing in the input adds `data-filtering` to the host element.
|
|
149
153
|
- Items that match get `data-filter-match`; non-matching items are hidden via CSS.
|
|
150
154
|
- "No results" text is set via `data-no-results` on the host element.
|
|
@@ -157,8 +161,8 @@ The `<sidebar-filter>` custom element handles live filtering:
|
|
|
157
161
|
These are used internally by `DocsSidebar`. Import them directly only when building a fully custom sidebar layout.
|
|
158
162
|
|
|
159
163
|
```astro
|
|
160
|
-
import SidebarTree from 'igniteui-astro-components/components/sidebar/SidebarTree.astro';
|
|
161
|
-
|
|
164
|
+
import SidebarTree from 'igniteui-astro-components/components/sidebar/SidebarTree.astro'; import
|
|
165
|
+
SidebarItem from 'igniteui-astro-components/components/sidebar/SidebarItem.astro';
|
|
162
166
|
```
|
|
163
167
|
|
|
164
168
|
`SidebarTree` props: `items: SidebarEntry[]`, `currentSlug: string`, `ancestors?: string[]`
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
* Filter input UI for the docs sidebar.
|
|
4
|
+
* Markup-only — behavior lives in `./sidebar-filter.ts`.
|
|
5
|
+
* Uses igc-input / igc-button / igc-icon from igniteui-webcomponents.
|
|
6
|
+
* Icons are registered via the icon registry (src/scripts/icon-registry.ts).
|
|
7
|
+
*/
|
|
8
8
|
import './SidebarFilterInput.scss';
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
<igc-input
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
id="sidebar-filter-input"
|
|
13
|
+
type="search"
|
|
14
|
+
autocomplete="off"
|
|
15
|
+
spellcheck="false"
|
|
16
|
+
placeholder="Filter topics…"
|
|
17
|
+
aria-label="Filter navigation topics"
|
|
18
|
+
aria-controls="docs-sidebar"
|
|
19
|
+
data-sidebar-filter-input
|
|
20
20
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
<igc-icon-button
|
|
22
|
+
slot="suffix"
|
|
23
|
+
variant="flat"
|
|
24
|
+
aria-label="Clear filter"
|
|
25
|
+
data-sidebar-filter-clear
|
|
26
|
+
hidden
|
|
27
|
+
>
|
|
28
|
+
<igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
|
|
29
|
+
</igc-icon-button>
|
|
30
|
+
<igc-icon slot="suffix" name="filter" collection="docs" aria-hidden="true"></igc-icon>
|
|
31
31
|
</igc-input>
|
|
32
32
|
|
|
33
|
-
<p role="status"
|
|
34
|
-
aria-atomic="true"
|
|
35
|
-
class="sidebar-filter-status"
|
|
36
|
-
data-sidebar-filter-status></p>
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
<p role="status" aria-atomic="true" class="sidebar-filter-status" data-sidebar-filter-status></p>
|