igniteui-astro-components 0.0.26 → 0.0.28
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 -9
- 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 -185
- package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -169
- 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 +220 -133
- package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
- 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 +49 -40
- package/src/virtual-modules.d.ts +11 -2
|
@@ -14,83 +14,97 @@ import { headingsToTreeNodes, type TocConfig } from '../DocsToc/toTreeNodes';
|
|
|
14
14
|
import './MobileTocToggle.scss';
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
headings?: MarkdownHeading[];
|
|
18
|
+
tocConfig?: TocConfig;
|
|
19
|
+
label?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const { headings = [], tocConfig, label = 'On this page' } = Astro.props;
|
|
23
23
|
const nodes = headingsToTreeNodes(headings, tocConfig);
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
{
|
|
26
|
+
{
|
|
27
|
+
nodes.length > 0 && (
|
|
27
28
|
<div class="mobile-toc">
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
<button
|
|
30
|
+
class="mobile-toc__trigger"
|
|
31
|
+
id="mobile-toc-trigger"
|
|
32
|
+
aria-expanded="false"
|
|
33
|
+
aria-controls="mobile-toc-dropdown"
|
|
34
|
+
>
|
|
35
|
+
<span class="mobile-toc__label">{label}</span>
|
|
36
|
+
<span class="mobile-toc__active" id="mobile-toc-active" aria-hidden="true" />
|
|
37
|
+
<svg
|
|
38
|
+
class="mobile-toc__chevron"
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
width="16"
|
|
41
|
+
height="16"
|
|
42
|
+
viewBox="0 0 24 24"
|
|
43
|
+
fill="none"
|
|
44
|
+
stroke="currentColor"
|
|
45
|
+
stroke-width="2.5"
|
|
46
|
+
stroke-linecap="round"
|
|
47
|
+
stroke-linejoin="round"
|
|
48
|
+
aria-hidden="true"
|
|
33
49
|
>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<polyline points="6 9 12 15 18 9"></polyline>
|
|
38
|
-
</svg>
|
|
39
|
-
</button>
|
|
50
|
+
<polyline points="6 9 12 15 18 9" />
|
|
51
|
+
</svg>
|
|
52
|
+
</button>
|
|
40
53
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
<div class="mobile-toc__dropdown" id="mobile-toc-dropdown" aria-hidden="true">
|
|
55
|
+
<nav aria-label={label}>
|
|
56
|
+
<DocsTree nodes={nodes} variant="toc" />
|
|
57
|
+
</nav>
|
|
58
|
+
</div>
|
|
46
59
|
</div>
|
|
47
|
-
)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
48
62
|
|
|
49
63
|
<script>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
function initMobileToc() {
|
|
65
|
+
const trigger = document.getElementById('mobile-toc-trigger');
|
|
66
|
+
const dropdown = document.getElementById('mobile-toc-dropdown');
|
|
67
|
+
const activeLabel = document.getElementById('mobile-toc-active');
|
|
68
|
+
if (!trigger || !dropdown) return;
|
|
55
69
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
// Toggle open/close
|
|
71
|
+
trigger.addEventListener('click', () => {
|
|
72
|
+
const isOpen = dropdown.getAttribute('aria-hidden') === 'false';
|
|
73
|
+
dropdown.setAttribute('aria-hidden', String(isOpen));
|
|
74
|
+
trigger.setAttribute('aria-expanded', String(!isOpen));
|
|
75
|
+
});
|
|
62
76
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
// Close on link click
|
|
78
|
+
dropdown.addEventListener('click', (e) => {
|
|
79
|
+
if ((e.target as Element | null)?.closest('a')) {
|
|
80
|
+
dropdown.setAttribute('aria-hidden', 'true');
|
|
81
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
82
|
+
}
|
|
83
|
+
});
|
|
70
84
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
// Close on Escape
|
|
86
|
+
document.addEventListener('keyup', (e) => {
|
|
87
|
+
if (e.key === 'Escape' && dropdown.getAttribute('aria-hidden') === 'false') {
|
|
88
|
+
dropdown.setAttribute('aria-hidden', 'true');
|
|
89
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
90
|
+
trigger.focus();
|
|
91
|
+
}
|
|
92
|
+
});
|
|
79
93
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
// Sync active heading text from the desktop TOC scroll-spy.
|
|
95
|
+
// DocsToc sets aria-current="true" on the active anchor — observe that.
|
|
96
|
+
const syncActive = () => {
|
|
97
|
+
if (!activeLabel) return;
|
|
98
|
+
const active = document.querySelector<HTMLAnchorElement>(
|
|
99
|
+
'#mobile-toc-dropdown a[aria-current="true"]',
|
|
100
|
+
);
|
|
101
|
+
activeLabel.textContent = active?.textContent?.trim() ?? '';
|
|
102
|
+
};
|
|
89
103
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
const observer = new MutationObserver(syncActive);
|
|
105
|
+
observer.observe(dropdown, { subtree: true, attributeFilter: ['aria-current'] });
|
|
106
|
+
syncActive();
|
|
107
|
+
}
|
|
94
108
|
|
|
95
|
-
|
|
109
|
+
document.addEventListener('astro:page-load', initMobileToc);
|
|
96
110
|
</script>
|
|
@@ -1,74 +1,80 @@
|
|
|
1
1
|
@use 'igniteui-theming/sass/typography' as *;
|
|
2
2
|
|
|
3
3
|
@layer components {
|
|
4
|
+
// Hidden by default. DocsLayout.scss reveals it on mobile-horizontal viewports.
|
|
5
|
+
.mobile-toc {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
padding-block: rem(12px);
|
|
17
|
-
background: transparent;
|
|
18
|
-
border: none;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
color: light-dark(var(--ig-gray-700), var(--ig-gray-300));
|
|
9
|
+
.mobile-toc__trigger {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
width: 100%;
|
|
13
|
+
gap: rem(8px);
|
|
14
|
+
padding-inline: var(--igd-padding-md);
|
|
15
|
+
padding-block: rem(12px);
|
|
16
|
+
background: transparent;
|
|
17
|
+
border: none;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
color: light-dark(var(--ig-gray-700), var(--ig-gray-300));
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
&[aria-expanded='true'] .mobile-toc__chevron {
|
|
28
|
-
transform: rotate(180deg);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
21
|
+
&:focus-visible {
|
|
22
|
+
outline: none;
|
|
23
|
+
box-shadow: inset 0 0 0 1px var(--igd-accent);
|
|
24
|
+
}
|
|
31
25
|
|
|
32
|
-
.mobile-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
26
|
+
&[aria-expanded='true'] .mobile-toc__chevron {
|
|
27
|
+
transform: rotate(180deg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
37
30
|
|
|
38
|
-
.mobile-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
text-align: start;
|
|
31
|
+
.mobile-toc__label {
|
|
32
|
+
@include type-style('body-2') {
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
}
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
.mobile-toc__active {
|
|
40
|
+
@include type-style('body-2') {
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
color: var(--igd-accent);
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
flex: 1;
|
|
48
|
+
text-align: start;
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
&:empty {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
54
|
+
&::before {
|
|
55
|
+
content: '— ';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
.mobile-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
.mobile-toc__chevron {
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
margin-inline-start: auto;
|
|
62
|
+
transition: transform 200ms ease;
|
|
63
|
+
}
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
.mobile-toc__dropdown {
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
max-height: 0;
|
|
68
|
+
transition: max-height 300ms ease;
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
70
|
+
&[aria-hidden='false'] {
|
|
71
|
+
max-height: 75dvh;
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
}
|
|
73
74
|
|
|
75
|
+
nav {
|
|
76
|
+
padding-inline: var(--igd-padding-md);
|
|
77
|
+
padding-block-end: rem(16px);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
74
80
|
}
|