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
|
@@ -23,10 +23,12 @@ const resolvedLang = lang;
|
|
|
23
23
|
const igNav = await fetchIgNav(resolvedLang);
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
{
|
|
26
|
+
{
|
|
27
|
+
/* ============================================================
|
|
27
28
|
IG-family global nav (angular, react, blazor, web-components,
|
|
28
29
|
slingshot, igniteui)
|
|
29
|
-
============================================================ */
|
|
30
|
+
============================================================ */
|
|
31
|
+
}
|
|
30
32
|
<div class={styles.navBar} transition:persist="global-nav-bar">
|
|
31
33
|
{/* IG nav — fetched directly via fetchIgNav(); falls back to static markup */}
|
|
32
34
|
{igNav?.prefetched && <Fragment set:html={igNav.headerHtml} />}
|
|
@@ -19,226 +19,226 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
.navBar {
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
22
|
+
--nav-bg: #222;
|
|
23
|
+
--nav-color: #fff;
|
|
24
|
+
--nav-border: #333;
|
|
25
|
+
--nav-link: #fff;
|
|
26
|
+
--nav-link-hover: #eee;
|
|
27
|
+
--nav-btn-bg: #09f;
|
|
28
|
+
--nav-btn-color: #fff;
|
|
29
|
+
--nav-btn-border: #09f;
|
|
30
|
+
--nav-btn-hover-color: #09f;
|
|
31
|
+
--nav-btn-hover-bg: transparent;
|
|
32
|
+
--nav-height: auto;
|
|
33
|
+
|
|
34
|
+
background: var(--igd-layout-sections-bg);
|
|
35
|
+
color: var(--nav-color, inherit);
|
|
36
|
+
|
|
37
|
+
// Element selectors are never hashed by CSS Modules — no :global() needed.
|
|
38
|
+
header {
|
|
39
|
+
top: 0;
|
|
40
|
+
left: 0;
|
|
41
|
+
right: 0;
|
|
42
|
+
font-family: aktiv-grotesk, sans-serif;
|
|
43
|
+
|
|
44
|
+
:global(.navbar) {
|
|
45
|
+
border-width: 0 0 1px;
|
|
46
|
+
border-radius: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:global(.globalnav__mobile-menu) {
|
|
51
|
+
top: -1px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Class names below come from the injected headerHtml / static fallback markup.
|
|
55
|
+
// CSS Modules would hash them, breaking the match — :global() prevents that.
|
|
56
|
+
:global(.globalnav__primary) {
|
|
57
|
+
padding-inline: rem(9px);
|
|
58
|
+
border-bottom: var(--igd-app-outline) !important;
|
|
59
|
+
|
|
60
|
+
@media (max-width: #{$bp-tablet-max}) {
|
|
61
|
+
padding-inline-end: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:global(.navbar-inverse) {
|
|
66
|
+
background: var(--nav-bg, inherit);
|
|
67
|
+
min-height: 86px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:global(.fixed_header) {
|
|
71
|
+
position: fixed;
|
|
72
|
+
width: 100%;
|
|
73
|
+
padding-bottom: 10px;
|
|
74
|
+
padding-top: 10px;
|
|
75
|
+
margin: 0;
|
|
76
|
+
top: 0;
|
|
77
|
+
z-index: 9999;
|
|
78
|
+
left: 0;
|
|
79
|
+
background-color: #fff;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:global(.navbar) {
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
border-bottom-color: var(--nav-border, #333);
|
|
85
|
+
border: inset;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:global(.navbar-brand) {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
font-family: 'aktiv-grotesk', sans-serif;
|
|
92
|
+
color: var(--nav-color, #fff);
|
|
93
|
+
font-size: 18px;
|
|
94
|
+
padding: 0;
|
|
95
|
+
|
|
96
|
+
span {
|
|
97
|
+
color: var(--nav-color, #fff);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:global(.navbar-wrapper) {
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
align-items: center;
|
|
105
|
+
height: var(--nav-height, auto);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:global(.navbar) :global(.navbar-nav) {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:global(.navbar) :global(.nav.navbar-nav) {
|
|
113
|
+
width: 100%;
|
|
114
|
+
padding: 16px;
|
|
115
|
+
font-size: 0.75rem;
|
|
116
|
+
font-weight: 400;
|
|
117
|
+
|
|
118
|
+
li > a {
|
|
119
|
+
transition: all 0.25s ease-in-out;
|
|
120
|
+
text-align: center;
|
|
121
|
+
color: var(--nav-link, #fff);
|
|
122
|
+
|
|
123
|
+
&:hover,
|
|
124
|
+
&:focus {
|
|
125
|
+
color: var(--nav-link-hover, #eee);
|
|
126
|
+
background-color: transparent;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:global(li.active) > a {
|
|
131
|
+
background-color: transparent !important;
|
|
132
|
+
font-weight: 500;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:global(li.nav__cta) > a {
|
|
136
|
+
color: var(--nav-btn-color, #fff);
|
|
137
|
+
background-color: var(--nav-btn-bg, #09f);
|
|
138
|
+
text-transform: uppercase;
|
|
139
|
+
font-weight: bold;
|
|
140
|
+
font-size: inherit;
|
|
141
|
+
margin-left: 10px;
|
|
142
|
+
padding: 0.5em 1.5em;
|
|
143
|
+
border: 1px solid var(--nav-btn-border, #09f);
|
|
144
|
+
border-radius: 0;
|
|
145
|
+
transition: all 250ms ease-in-out;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
|
|
148
|
+
&:hover,
|
|
149
|
+
&:focus {
|
|
150
|
+
color: var(--nav-btn-hover-color, #09f);
|
|
151
|
+
background-color: var(--nav-btn-hover-bg, transparent);
|
|
152
|
+
border-color: var(--nav-btn-border, #09f);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:global(.navbar-frameworks) {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
|
|
161
|
+
a {
|
|
162
|
+
padding-right: 8px;
|
|
163
|
+
color: #9d9d9d;
|
|
164
|
+
font-size: 0.875rem;
|
|
165
|
+
text-decoration: none;
|
|
166
|
+
|
|
167
|
+
&:hover,
|
|
168
|
+
&:focus {
|
|
169
|
+
color: #eee;
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:global(.logo-breadcrumb) {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:global(.globalnav__logo) {
|
|
182
|
+
max-height: 48px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:global(.globalnav__menu) {
|
|
186
|
+
list-style: none;
|
|
187
|
+
margin: 0;
|
|
188
|
+
padding: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:global(.globalnav__brand) {
|
|
192
|
+
@media (max-width: #{$bp-tablet-max}) {
|
|
193
|
+
margin-inline-start: 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media only screen and (min-width: 961px) {
|
|
198
|
+
[data-mega-menu='true'] :global(.globalnav__primary) :global(.globalnav__wrapper) {
|
|
199
|
+
position: static;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
:global(.globalnav__wrapper) {
|
|
203
|
+
max-width: 100%;
|
|
204
|
+
margin: auto 15px;
|
|
205
|
+
padding: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:global(.navbar) :global(.nav.navbar-nav) {
|
|
209
|
+
display: flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
padding: 0;
|
|
212
|
+
width: auto;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@media only screen and (max-width: 1200px) {
|
|
217
|
+
:global(.navbar-frameworks) {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@media only screen and (max-width: 965px) {
|
|
223
|
+
:global(.navbar-frameworks) {
|
|
224
|
+
display: none;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@media only screen and (max-width: 767px) {
|
|
229
|
+
:global(.navbar-frameworks) {
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
padding-top: 10px;
|
|
233
|
+
|
|
234
|
+
a {
|
|
235
|
+
font-size: 1rem !important;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:global(.navbar) :global(.nav.navbar-nav) :global(li.nav__cta) > a {
|
|
240
|
+
margin-left: 0;
|
|
241
|
+
margin-top: 10px;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
244
|
}
|
|
@@ -10,8 +10,8 @@ import GlobalNavBar from 'igniteui-astro-components/components/GlobalNavBar.astr
|
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
|
|
13
|
-
| Prop
|
|
14
|
-
|
|
13
|
+
| Prop | Type | Description |
|
|
14
|
+
| ------ | --------- | -------------------------------------------------- |
|
|
15
15
|
| `lang` | `NavLang` | **Required.** Locale — `'en'` \| `'jp'` \| `'kr'`. |
|
|
16
16
|
|
|
17
17
|
`NavLang`: `'en' | 'jp' | 'kr'`
|
|
@@ -27,6 +27,7 @@ import GlobalNavBar from 'igniteui-astro-components/components/GlobalNavBar.astr
|
|
|
27
27
|
---
|
|
28
28
|
import GlobalNavBar from 'igniteui-astro-components/components/GlobalNavBar.astro';
|
|
29
29
|
---
|
|
30
|
+
|
|
30
31
|
<GlobalNavBar lang="en" />
|
|
31
32
|
```
|
|
32
33
|
|
|
@@ -11,10 +11,12 @@ const { license } = Astro.props;
|
|
|
11
11
|
const label = license === 'premium' ? 'Premium' : 'Open Source';
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
{
|
|
15
|
-
|
|
14
|
+
{
|
|
15
|
+
license && (
|
|
16
|
+
<Badge variant={license} class="license-indicator-badge">
|
|
16
17
|
<span>{label}</span>
|
|
17
18
|
|
|
18
|
-
{license === 'premium' && <igc-icon name="premium" collection="docs" aria-hidden="true"
|
|
19
|
-
|
|
20
|
-
)
|
|
19
|
+
{license === 'premium' && <igc-icon name="premium" collection="docs" aria-hidden="true" />}
|
|
20
|
+
</Badge>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -11,7 +11,7 @@ import './MobileSidebarToggle.scss';
|
|
|
11
11
|
interface Props {
|
|
12
12
|
label?: string;
|
|
13
13
|
}
|
|
14
|
-
const { label =
|
|
14
|
+
const { label = 'Components List' } = Astro.props;
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
<button
|
|
@@ -40,28 +40,27 @@ const { label = "Components List" } = Astro.props;
|
|
|
40
40
|
</button>
|
|
41
41
|
|
|
42
42
|
<script>
|
|
43
|
-
document.addEventListener(
|
|
44
|
-
const trigger = (e.target as Element).closest<HTMLElement>(
|
|
43
|
+
document.addEventListener('click', (e) => {
|
|
44
|
+
const trigger = (e.target as Element).closest<HTMLElement>('#mobile-sidebar-toggle');
|
|
45
45
|
if (!trigger) return;
|
|
46
|
-
const expanded = trigger.getAttribute(
|
|
47
|
-
trigger.setAttribute(
|
|
48
|
-
document.body.toggleAttribute(
|
|
46
|
+
const expanded = trigger.getAttribute('aria-expanded') === 'true';
|
|
47
|
+
trigger.setAttribute('aria-expanded', String(!expanded));
|
|
48
|
+
document.body.toggleAttribute('data-mobile-menu-expanded', !expanded);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
-
document.addEventListener(
|
|
52
|
-
if (e.key !==
|
|
53
|
-
const trigger = document.getElementById(
|
|
54
|
-
if (trigger && trigger.getAttribute(
|
|
55
|
-
trigger.setAttribute(
|
|
56
|
-
document.body.removeAttribute(
|
|
51
|
+
document.addEventListener('keyup', (e) => {
|
|
52
|
+
if (e.key !== 'Escape') return;
|
|
53
|
+
const trigger = document.getElementById('mobile-sidebar-toggle');
|
|
54
|
+
if (trigger && trigger.getAttribute('aria-expanded') === 'true') {
|
|
55
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
56
|
+
document.body.removeAttribute('data-mobile-menu-expanded');
|
|
57
57
|
trigger.focus();
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
document.addEventListener(
|
|
62
|
-
const trigger = document.getElementById(
|
|
63
|
-
if (trigger) trigger.setAttribute(
|
|
64
|
-
document.body.removeAttribute(
|
|
61
|
+
document.addEventListener('astro:page-load', () => {
|
|
62
|
+
const trigger = document.getElementById('mobile-sidebar-toggle');
|
|
63
|
+
if (trigger) trigger.setAttribute('aria-expanded', 'false');
|
|
64
|
+
document.body.removeAttribute('data-mobile-menu-expanded');
|
|
65
65
|
});
|
|
66
66
|
</script>
|
|
67
|
-
|
|
@@ -10,8 +10,8 @@ import MobileSidebarToggle from 'igniteui-astro-components/components/MobileSide
|
|
|
10
10
|
|
|
11
11
|
## Props
|
|
12
12
|
|
|
13
|
-
| Prop
|
|
14
|
-
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| ------- | -------- | ------------------- | ----------------------------------------------------------------------------- |
|
|
15
15
|
| `label` | `string` | `'Components List'` | Visible button text and aria-label suffix. Typically the active section name. |
|
|
16
16
|
|
|
17
17
|
## Behaviour
|
|
@@ -25,6 +25,7 @@ import MobileSidebarToggle from 'igniteui-astro-components/components/MobileSide
|
|
|
25
25
|
---
|
|
26
26
|
import MobileSidebarToggle from 'igniteui-astro-components/components/MobileSidebarToggle.astro';
|
|
27
27
|
---
|
|
28
|
+
|
|
28
29
|
<MobileSidebarToggle label="Components" />
|
|
29
30
|
```
|
|
30
31
|
|