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.
Files changed (96) hide show
  1. package/README.md +82 -74
  2. package/package.json +16 -2
  3. package/src/assets/images/anatomy-test.png +0 -0
  4. package/src/components/CopyCode/CopyCode.astro +21 -7
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
  6. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
  7. package/src/components/DocsBreadcrumb/README.md +10 -14
  8. package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
  9. package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
  10. package/src/components/DocsSidebar/README.md +25 -21
  11. package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
  12. package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
  13. package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
  14. package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
  15. package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
  16. package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
  17. package/src/components/DocsSubHeader/README.md +18 -16
  18. package/src/components/DocsToc/DocsToc.astro +301 -280
  19. package/src/components/DocsToc/DocsToc.scss +20 -21
  20. package/src/components/DocsToc/README.md +11 -9
  21. package/src/components/DocsToc/toTreeNodes.ts +3 -8
  22. package/src/components/DocsTree/DocsTree.astro +32 -20
  23. package/src/components/DocsTree/DocsTreeItem.astro +35 -30
  24. package/src/components/DocsTree/README.md +16 -15
  25. package/src/components/DocsTree/docs-tree.scss +267 -268
  26. package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
  27. package/src/components/GlobalFooter/README.md +3 -2
  28. package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
  29. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
  30. package/src/components/GlobalNavBar/README.md +3 -2
  31. package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
  32. package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
  33. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
  34. package/src/components/MobileSidebarToggle/README.md +3 -2
  35. package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
  36. package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
  37. package/src/components/Search/README.md +1 -0
  38. package/src/components/Search/Search.astro +137 -109
  39. package/src/components/Search/Search.scss +20 -20
  40. package/src/components/SearchAdvanced/README.md +21 -15
  41. package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
  42. package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
  43. package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
  44. package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
  45. package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
  46. package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
  47. package/src/components/mdx/ApiLink/README.md +26 -22
  48. package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
  49. package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
  50. package/src/components/mdx/ApiRef/README.md +20 -15
  51. package/src/components/mdx/Badge/Badge.astro +14 -14
  52. package/src/components/mdx/Badge/Badge.scss +61 -56
  53. package/src/components/mdx/Badge/README.md +24 -19
  54. package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
  55. package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
  56. package/src/components/mdx/DocsAside/README.md +22 -22
  57. package/src/components/mdx/Faq/Faq.astro +86 -0
  58. package/src/components/mdx/Faq/Faq.scss +105 -0
  59. package/src/components/mdx/Faq/FaqItem.astro +117 -0
  60. package/src/components/mdx/Faq/README.md +223 -0
  61. package/src/components/mdx/Faq/types.ts +34 -0
  62. package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
  63. package/src/components/mdx/PlatformBlock/README.md +6 -8
  64. package/src/components/mdx/Sample/README.md +21 -16
  65. package/src/components/mdx/Sample/Sample.astro +97 -74
  66. package/src/components/mdx/Sample/Sample.scss +132 -132
  67. package/src/content-helper.ts +71 -72
  68. package/src/content.config.ts +1 -6
  69. package/src/integration.ts +566 -512
  70. package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
  71. package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
  72. package/src/layouts/DocsLayout/README.md +24 -35
  73. package/src/lib/nav-helpers.ts +88 -82
  74. package/src/lib/types.ts +76 -76
  75. package/src/llms.ts +205 -166
  76. package/src/platform.ts +312 -162
  77. package/src/plugins/rehype-heading-anchors.ts +45 -45
  78. package/src/plugins/rehype-pagefind-ignore.ts +19 -19
  79. package/src/plugins/rehype-table-wrapper.ts +30 -30
  80. package/src/plugins/remark-docfx.ts +12 -0
  81. package/src/plugins/remark-env-vars.ts +12 -4
  82. package/src/plugins/remark-md-links.ts +10 -4
  83. package/src/scripts/icon-manifest.ts +13 -5
  84. package/src/scripts/sample-widget.ts +557 -501
  85. package/src/sidebar.ts +103 -97
  86. package/src/styles/global/_code-blocks.scss +43 -44
  87. package/src/styles/global/_component-themes.scss +151 -153
  88. package/src/styles/global/_icon-gallery.scss +81 -81
  89. package/src/styles/global/_index.scss +0 -1
  90. package/src/styles/global/_markdown.scss +816 -787
  91. package/src/styles/global/_palette.scss +456 -110
  92. package/src/styles/global/_search-shared.scss +402 -398
  93. package/src/styles/global/_type-scale.scss +127 -127
  94. package/src/styles/global/_variables.scss +138 -111
  95. package/src/styles/theme.scss +41 -41
  96. package/src/virtual-modules.d.ts +11 -2
package/README.md CHANGED
@@ -35,11 +35,11 @@ export default createDocsSite({
35
35
  site: 'https://my-org.github.io/my-docs',
36
36
  title: 'My Library',
37
37
  description: 'Reference docs for My Library.',
38
- platform: 'angular', // 'angular' | 'react' | 'web-components' | 'blazor' | …
39
- navLang: 'en', // 'en' | 'jp' | 'kr'
38
+ platform: 'angular', // 'angular' | 'react' | 'web-components' | 'blazor' | …
39
+ navLang: 'en', // 'en' | 'jp' | 'kr'
40
40
  source: {
41
- tocPath: './my-docs/toc.yml',
42
- docsDir: './my-docs/en/components',
41
+ tocPath: './my-docs/toc.yml',
42
+ docsDir: './my-docs/en/components',
43
43
  imagesDir: './my-docs/en/images',
44
44
  },
45
45
  });
@@ -54,6 +54,7 @@ import DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSideba
54
54
 
55
55
  const { slug } = Astro.params;
56
56
  ---
57
+
57
58
  <DocsLayout title="Hello" hasSidebar currentSlug={slug}>
58
59
  <DocsSidebar slot="sidebar" currentSlug={slug} />
59
60
  <slot />
@@ -63,10 +64,10 @@ const { slug } = Astro.params;
63
64
  Import MDX components in a page or `mdx-components.ts`:
64
65
 
65
66
  ```ts
66
- export { default as ApiLink } from 'igniteui-astro-components/components/mdx/ApiLink.astro';
67
- export { default as ApiRef } from 'igniteui-astro-components/components/mdx/ApiRef.astro';
67
+ export { default as ApiLink } from 'igniteui-astro-components/components/mdx/ApiLink.astro';
68
+ export { default as ApiRef } from 'igniteui-astro-components/components/mdx/ApiRef.astro';
68
69
  export { default as PlatformBlock } from 'igniteui-astro-components/components/mdx/PlatformBlock.astro';
69
- export { default as Sample } from 'igniteui-astro-components/components/mdx/Sample.astro';
70
+ export { default as Sample } from 'igniteui-astro-components/components/mdx/Sample.astro';
70
71
  ```
71
72
 
72
73
  Pull in the base styles once (e.g. from your root layout or `astro.config`):
@@ -91,8 +92,20 @@ import 'igniteui-astro-components/styles/ig-theme.scss';
91
92
  >
92
93
  > export default defineConfig({
93
94
  > fonts: [
94
- > { provider: fontProviders.google(), name: 'Instrument Sans', cssVariable: '--font-sans', weights: ['400..700'], styles: ['normal', 'italic'] },
95
- > { provider: fontProviders.google(), name: 'JetBrains Mono', cssVariable: '--font-mono', weights: ['100..800'], styles: ['normal', 'italic'] },
95
+ > {
96
+ > provider: fontProviders.google(),
97
+ > name: 'Instrument Sans',
98
+ > cssVariable: '--font-sans',
99
+ > weights: ['400..700'],
100
+ > styles: ['normal', 'italic'],
101
+ > },
102
+ > {
103
+ > provider: fontProviders.google(),
104
+ > name: 'JetBrains Mono',
105
+ > cssVariable: '--font-mono',
106
+ > weights: ['100..800'],
107
+ > styles: ['normal', 'italic'],
108
+ > },
96
109
  > ],
97
110
  > });
98
111
  > ```
@@ -107,14 +120,15 @@ If you are not using the integration — for example when consuming the package
107
120
 
108
121
  ### DocsLayout
109
122
 
110
- | Prop | Overrides |
111
- |------|-----------|
123
+ | Prop | Overrides |
124
+ | ----------- | ------------------------------------------- |
112
125
  | `siteTitle` | `virtual:docs-template/site-meta` → `title` |
113
126
 
114
127
  ```astro
115
128
  ---
116
129
  import DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';
117
130
  ---
131
+
118
132
  <DocsLayout title="Toast" siteTitle="My Library" hasSidebar currentSlug="components/toast">
119
133
  <slot />
120
134
  </DocsLayout>
@@ -122,8 +136,8 @@ import DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';
122
136
 
123
137
  ### DocsSidebar
124
138
 
125
- | Prop | Overrides |
126
- |------|-----------|
139
+ | Prop | Overrides |
140
+ | ------- | --------------------------------------------- |
127
141
  | `items` | `virtual:docs-template/site-meta` → `sidebar` |
128
142
 
129
143
  ```astro
@@ -143,21 +157,20 @@ const sidebar: SidebarEntry[] = [
143
157
  {
144
158
  label: 'Components',
145
159
  collapsed: false,
146
- items: [
147
- { label: 'Toast', slug: 'components/toast' },
148
- ],
160
+ items: [{ label: 'Toast', slug: 'components/toast' }],
149
161
  },
150
162
  ];
151
163
  ---
164
+
152
165
  <DocsSidebar items={sidebar} currentSlug="components/toast" />
153
166
  ```
154
167
 
155
168
  ### DocsSubHeader
156
169
 
157
- | Prop | Overrides |
158
- |------|-----------|
159
- | `siteTitle` | `virtual:docs-template/site-meta` → `title` |
160
- | `productLinks` | `virtual:docs-template/site-meta` → `productLinks` |
170
+ | Prop | Overrides |
171
+ | -------------- | ------------------------------------------------------------------- |
172
+ | `siteTitle` | `virtual:docs-template/site-meta` → `title` |
173
+ | `productLinks` | `virtual:docs-template/site-meta` → `productLinks` |
161
174
  | `sidebarItems` | `virtual:docs-template/site-meta` → `sidebar` (used for breadcrumb) |
162
175
 
163
176
  ```astro
@@ -166,14 +179,11 @@ import DocsSubHeader from 'igniteui-astro-components/components/DocsSubHeader.as
166
179
 
167
180
  const productLinks = [
168
181
  { label: 'Angular', href: '/angular/', platform: 'angular' },
169
- { label: 'React', href: '/react/', platform: 'react' },
182
+ { label: 'React', href: '/react/', platform: 'react' },
170
183
  ];
171
184
  ---
172
- <DocsSubHeader
173
- siteTitle="My Library"
174
- productLinks={productLinks}
175
- currentSlug="components/toast"
176
- />
185
+
186
+ <DocsSubHeader siteTitle="My Library" productLinks={productLinks} currentSlug="components/toast" />
177
187
  ```
178
188
 
179
189
  ### Combining prop-driven components without the integration
@@ -199,12 +209,8 @@ const { title, currentSlug, headings } = Astro.props;
199
209
 
200
210
  const sidebar: SidebarEntry[] = [/* … your tree … */];
201
211
  ---
202
- <DocsLayout
203
- title={title}
204
- siteTitle="My Library"
205
- hasSidebar
206
- currentSlug={currentSlug}
207
- >
212
+
213
+ <DocsLayout title={title} siteTitle="My Library" hasSidebar currentSlug={currentSlug}>
208
214
  <DocsSidebar slot="sidebar" items={sidebar} currentSlug={currentSlug} />
209
215
  {headings && <DocsToc slot="toc" headings={headings} offsetTarget=".docs-subheader" />}
210
216
  <slot />
@@ -219,67 +225,67 @@ const sidebar: SidebarEntry[] = [/* … your tree … */];
219
225
 
220
226
  ### Astro integration
221
227
 
222
- | Export | Purpose |
223
- | --- | --- |
228
+ | Export | Purpose |
229
+ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
224
230
  | `igniteui-astro-components/integration` | `createDocsSite()`, `siteMetaIntegration()`, `staticImagesIntegration()`, `buildSidebarFromToc()` re-export |
225
231
 
226
232
  ### Layouts
227
233
 
228
- | Export | Purpose | Docs |
229
- | --- | --- | --- |
234
+ | Export | Purpose | Docs |
235
+ | ---------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------ |
230
236
  | `igniteui-astro-components/layouts/DocsLayout.astro` | Top-level page shell — global nav + sub-header + optional sidebar + main frame + footer | [README](src/layouts/DocsLayout/README.md) |
231
237
 
232
238
  ### Chrome components
233
239
 
234
- | Export | Purpose | Docs |
235
- | --- | --- | --- |
236
- | `…/components/GlobalNavBar.astro` | IG global navigation bar | [README](src/components/GlobalNavBar/README.md) |
237
- | `…/components/GlobalFooter.astro` | IG global footer | [README](src/components/GlobalFooter/README.md) |
238
- | `…/components/DocsSubHeader.astro` | Secondary fixed bar — site title + breadcrumb + product links + search | [README](src/components/DocsSubHeader/README.md) |
239
- | `…/components/Search.astro` | Pagefind-powered full-text search modal | [README](src/components/Search/README.md) |
240
- | `…/components/ThemingWidget.astro` | Theming widget | [README](src/components/ThemingWidget/README.md) |
241
- | `…/components/MobileSidebarToggle.astro` | Mobile-only sidebar disclosure button | [README](src/components/MobileSidebarToggle/README.md) |
242
- | `…/components/DocsToc.astro` | "On this page" table of contents with scroll-spy | [README](src/components/DocsToc/README.md) |
240
+ | Export | Purpose | Docs |
241
+ | ---------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------ |
242
+ | `…/components/GlobalNavBar.astro` | IG global navigation bar | [README](src/components/GlobalNavBar/README.md) |
243
+ | `…/components/GlobalFooter.astro` | IG global footer | [README](src/components/GlobalFooter/README.md) |
244
+ | `…/components/DocsSubHeader.astro` | Secondary fixed bar — site title + breadcrumb + product links + search | [README](src/components/DocsSubHeader/README.md) |
245
+ | `…/components/Search.astro` | Pagefind-powered full-text search modal | [README](src/components/Search/README.md) |
246
+ | `…/components/ThemingWidget.astro` | Theming widget | [README](src/components/ThemingWidget/README.md) |
247
+ | `…/components/MobileSidebarToggle.astro` | Mobile-only sidebar disclosure button | [README](src/components/MobileSidebarToggle/README.md) |
248
+ | `…/components/DocsToc.astro` | "On this page" table of contents with scroll-spy | [README](src/components/DocsToc/README.md) |
243
249
 
244
250
  ### Sidebar suite
245
251
 
246
- | Export | Purpose | Docs |
247
- | --- | --- | --- |
248
- | `…/components/sidebar/DocsSidebar.astro` | Composition root — filter input + recursive tree | [README](src/components/sidebar/README.md) |
249
- | `…/components/sidebar/SidebarTree.astro` | Recursive `<ul>` of items | [README](src/components/sidebar/README.md) |
250
- | `…/components/sidebar/SidebarItem.astro` | One link or `<details>` group | [README](src/components/sidebar/README.md) |
251
- | `…/components/sidebar/SidebarFilterInput.astro` | Filter input markup | [README](src/components/sidebar/README.md) |
252
- | `…/components/sidebar/sidebar-filter` | `<sidebar-filter>` custom element + cross-navigation hooks | [README](src/components/sidebar/README.md) |
253
- | `…/lib/sidebar/types` | `SidebarEntry`, `SidebarGroup`, `SidebarLink`, `SidebarBadge` | — |
254
- | `…/lib/sidebar/helpers` | `isActive`, `isGroup`, `isInitiallyOpen`, `getBreadcrumb`, `joinPath`, … | — |
255
- | `…/sidebar` | `buildSidebarFromToc()` — TOC → sidebar tree converter (build-time) | — |
252
+ | Export | Purpose | Docs |
253
+ | ----------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------ |
254
+ | `…/components/sidebar/DocsSidebar.astro` | Composition root — filter input + recursive tree | [README](src/components/sidebar/README.md) |
255
+ | `…/components/sidebar/SidebarTree.astro` | Recursive `<ul>` of items | [README](src/components/sidebar/README.md) |
256
+ | `…/components/sidebar/SidebarItem.astro` | One link or `<details>` group | [README](src/components/sidebar/README.md) |
257
+ | `…/components/sidebar/SidebarFilterInput.astro` | Filter input markup | [README](src/components/sidebar/README.md) |
258
+ | `…/components/sidebar/sidebar-filter` | `<sidebar-filter>` custom element + cross-navigation hooks | [README](src/components/sidebar/README.md) |
259
+ | `…/lib/sidebar/types` | `SidebarEntry`, `SidebarGroup`, `SidebarLink`, `SidebarBadge` | — |
260
+ | `…/lib/sidebar/helpers` | `isActive`, `isGroup`, `isInitiallyOpen`, `getBreadcrumb`, `joinPath`, … | — |
261
+ | `…/sidebar` | `buildSidebarFromToc()` — TOC → sidebar tree converter (build-time) | — |
256
262
 
257
263
  ### MDX components
258
264
 
259
- | Export | Purpose | Docs |
260
- | --- | --- | --- |
261
- | `…/components/mdx/ApiLink.astro` | Inline link to an API symbol with platform-aware URLs | [README](src/components/mdx/ApiLink/README.md) |
262
- | `…/components/mdx/ApiRef.astro` | Block API reference card | [README](src/components/mdx/ApiRef/README.md) |
263
- | `…/components/mdx/PlatformBlock.astro` | Show content only on selected platforms | [README](src/components/mdx/PlatformBlock/README.md) |
264
- | `…/components/mdx/Sample.astro` | Embedded code-view sample widget | [README](src/components/mdx/Sample/README.md) |
265
+ | Export | Purpose | Docs |
266
+ | -------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------- |
267
+ | `…/components/mdx/ApiLink.astro` | Inline link to an API symbol with platform-aware URLs | [README](src/components/mdx/ApiLink/README.md) |
268
+ | `…/components/mdx/ApiRef.astro` | Block API reference card | [README](src/components/mdx/ApiRef/README.md) |
269
+ | `…/components/mdx/PlatformBlock.astro` | Show content only on selected platforms | [README](src/components/mdx/PlatformBlock/README.md) |
270
+ | `…/components/mdx/Sample.astro` | Embedded code-view sample widget | [README](src/components/mdx/Sample/README.md) |
265
271
 
266
272
  ### Build helpers
267
273
 
268
- | Export | Purpose |
269
- | --- | --- |
270
- | `…/platform` | Platform / nav-language types |
271
- | `…/content` | Content collection helpers |
272
- | `…/content-config` | Default content collection schema |
273
- | `…/llms` | `llms.txt` manifest generator |
274
- | `…/plugins/remark-env-vars` | Remark plugin — `{Environment.X}` token substitution |
275
- | `…/plugins/remark-md-links` | Remark plugin — `.md` → slug link rewriting + `DOCS_BASE` prepending |
274
+ | Export | Purpose |
275
+ | ---------------------------------- | ---------------------------------------------------------------------- |
276
+ | `…/platform` | Platform / nav-language types |
277
+ | `…/content` | Content collection helpers |
278
+ | `…/content-config` | Default content collection schema |
279
+ | `…/llms` | `llms.txt` manifest generator |
280
+ | `…/plugins/remark-env-vars` | Remark plugin — `{Environment.X}` token substitution |
281
+ | `…/plugins/remark-md-links` | Remark plugin — `.md` → slug link rewriting + `DOCS_BASE` prepending |
276
282
  | `…/plugins/remark-html-transforms` | Remark plugin — divider→`<hr>`, code lang normalization, img src fixes |
277
283
 
278
284
  ### Styles
279
285
 
280
- | Export | Purpose |
281
- | --- | --- |
282
- | `…/styles/custom.scss` | Base tokens + sidebar/sample styles |
286
+ | Export | Purpose |
287
+ | ------------------------ | ---------------------------------------- |
288
+ | `…/styles/custom.scss` | Base tokens + sidebar/sample styles |
283
289
  | `…/styles/ig-theme.scss` | IG color palette mapped to design tokens |
284
290
 
285
291
  ---
@@ -327,18 +333,20 @@ npm install ../path/to/astro-components
327
333
  Add a path alias in the consumer's `tsconfig.json` and `astro.config.ts` that maps the package name to the local source:
328
334
 
329
335
  **`tsconfig.json`**
336
+
330
337
  ```json
331
338
  {
332
339
  "compilerOptions": {
333
340
  "paths": {
334
- "igniteui-astro-components": ["../astro-components/src/index.ts"],
335
- "igniteui-astro-components/*": ["../astro-components/src/*"]
341
+ "igniteui-astro-components": ["../astro-components/src/index.ts"],
342
+ "igniteui-astro-components/*": ["../astro-components/src/*"]
336
343
  }
337
344
  }
338
345
  }
339
346
  ```
340
347
 
341
348
  **`astro.config.ts`**
349
+
342
350
  ```ts
343
351
  import path from 'node:path';
344
352
  import { defineConfig } from 'astro/config';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
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": {
@@ -60,10 +60,14 @@
60
60
  "./components/DocsTree/DocsTreeItem.astro": "./src/components/DocsTree/DocsTreeItem.astro",
61
61
  "./components/DocsTree/types": "./src/components/DocsTree/types.ts",
62
62
  "./components/DocsTree/docs-tree.css": "./src/components/DocsTree/docs-tree.css",
63
+ "./components/mdx/Anatomy.astro": "./src/components/mdx/Anatomy/Anatomy.astro",
63
64
  "./components/mdx/ApiRef.astro": "./src/components/mdx/ApiRef/ApiRef.astro",
64
65
  "./components/mdx/ApiLink.astro": "./src/components/mdx/ApiLink/ApiLink.astro",
65
66
  "./components/mdx/DocsAside.astro": "./src/components/mdx/DocsAside/DocsAside.astro",
66
67
  "./components/mdx/Badge.astro": "./src/components/mdx/Badge/Badge.astro",
68
+ "./components/mdx/Faq.astro": "./src/components/mdx/Faq/Faq.astro",
69
+ "./components/mdx/FaqItem.astro": "./src/components/mdx/Faq/FaqItem.astro",
70
+ "./components/mdx/Faq/types": "./src/components/mdx/Faq/types.ts",
67
71
  "./components/mdx/PlatformBlock.astro": "./src/components/mdx/PlatformBlock/PlatformBlock.astro",
68
72
  "./components/mdx/Sample.astro": "./src/components/mdx/Sample/Sample.astro",
69
73
  "./lib/sidebar/types": "./src/lib/sidebar/types.ts",
@@ -92,7 +96,12 @@
92
96
  "devDependencies": {
93
97
  "@types/jsdom": "^21.1.7",
94
98
  "astro": "^6.1.6",
99
+ "husky": "^9.1.7",
95
100
  "igniteui-theming": "^26.0.1",
101
+ "lint-staged": "^17.0.8",
102
+ "oxlint": "^1.72.0",
103
+ "prettier": "^3.9.4",
104
+ "prettier-plugin-astro": "^0.14.1",
96
105
  "sass": "^1.83.0",
97
106
  "typescript": "^5.6.0"
98
107
  },
@@ -108,6 +117,11 @@
108
117
  "playground:build": "npm --prefix playground run build",
109
118
  "playground:preview": "npm --prefix playground run preview",
110
119
  "playground:clean": "npm --prefix playground run clean",
111
- "playground:check": "npm --prefix playground run check"
120
+ "playground:check": "npm --prefix playground run check",
121
+ "lint": "oxlint .",
122
+ "lint:fix": "oxlint . --fix",
123
+ "format": "prettier --write .",
124
+ "format:check": "prettier --check .",
125
+ "prepare": "husky"
112
126
  }
113
127
  }
@@ -1,6 +1,10 @@
1
1
  <script>
2
2
  import '../../scripts/icon-registry';
3
- import { defineComponents, IgcIconButtonComponent, IgcIconComponent } from 'igniteui-webcomponents';
3
+ import {
4
+ defineComponents,
5
+ IgcIconButtonComponent,
6
+ IgcIconComponent,
7
+ } from 'igniteui-webcomponents';
4
8
 
5
9
  defineComponents(IgcIconButtonComponent, IgcIconComponent);
6
10
 
@@ -51,16 +55,26 @@
51
55
  document.body.appendChild(ta);
52
56
  ta.select();
53
57
  ta.setSelectionRange(0, value.length);
54
- try { return document.execCommand('copy'); } catch { return false; }
55
- finally { document.body.removeChild(ta); }
58
+ try {
59
+ return document.execCommand('copy');
60
+ } catch {
61
+ return false;
62
+ } finally {
63
+ document.body.removeChild(ta);
64
+ }
56
65
  };
57
66
 
58
67
  if (navigator.clipboard?.writeText) {
59
- navigator.clipboard.writeText(text).then(showCopied).catch(() => {
60
- fallback(text) ? showCopied() : showFailed();
61
- });
68
+ navigator.clipboard
69
+ .writeText(text)
70
+ .then(showCopied)
71
+ .catch(() => {
72
+ if (fallback(text)) showCopied();
73
+ else showFailed();
74
+ });
62
75
  } else {
63
- fallback(text) ? showCopied() : showFailed();
76
+ if (fallback(text)) showCopied();
77
+ else showFailed();
64
78
  }
65
79
  });
66
80
 
@@ -30,9 +30,9 @@ interface Props {
30
30
  const { currentSlug = '', pageTitle = '', siteTitle: siteTitleProp, sidebarItems } = Astro.props;
31
31
 
32
32
  const resolvedSiteTitle = siteTitleProp ?? siteTitleVirtual;
33
- const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
34
- const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
35
- const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitle] : []);
33
+ const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
34
+ const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
35
+ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : pageTitle ? [pageTitle] : [];
36
36
 
37
37
  // Expose the crumb trail as Pagefind `breadcrumb` meta (this nav is inside <main>)
38
38
  // for the location line under each search result. Commas split inline meta — strip them.
@@ -40,21 +40,33 @@ const breadcrumbPath = crumbs.join(' › ');
40
40
  const breadcrumbMeta = breadcrumbPath.replace(/,/g, '');
41
41
  ---
42
42
 
43
- {(resolvedSiteTitle || crumbs.length > 0) && (
44
- <nav class="docs-breadcrumb" aria-label="Breadcrumb" data-pagefind-meta={breadcrumbMeta ? `breadcrumb:${breadcrumbMeta}` : undefined}>
45
- <ol class="docs-breadcrumb-list">
46
- { resolvedSiteTitle && (
47
- <li class="docs-breadcrumb-item docs-breadcrumb-home">
48
- <span>{ resolvedSiteTitle }</span>
49
- </li>
50
- ) }
51
- { crumbs.map((label, i) => (
52
- <li class="docs-breadcrumb-item">
53
- <igc-icon name="chevron" collection="docs" class="docs-breadcrumb-sep" aria-hidden="true"></igc-icon>
54
- <span class="docs-breadcrumb-crumb" title={ label }>{ label }</span>
55
- </li>
56
- )) }
57
- </ol>
58
- </nav>
59
- )}
60
-
43
+ {
44
+ (resolvedSiteTitle || crumbs.length > 0) && (
45
+ <nav
46
+ class="docs-breadcrumb"
47
+ aria-label="Breadcrumb"
48
+ data-pagefind-meta={breadcrumbMeta ? `breadcrumb:${breadcrumbMeta}` : undefined}
49
+ >
50
+ <ol class="docs-breadcrumb-list">
51
+ {resolvedSiteTitle && (
52
+ <li class="docs-breadcrumb-item docs-breadcrumb-home">
53
+ <span>{resolvedSiteTitle}</span>
54
+ </li>
55
+ )}
56
+ {crumbs.map((label, i) => (
57
+ <li class="docs-breadcrumb-item">
58
+ <igc-icon
59
+ name="chevron"
60
+ collection="docs"
61
+ class="docs-breadcrumb-sep"
62
+ aria-hidden="true"
63
+ />
64
+ <span class="docs-breadcrumb-crumb" title={label}>
65
+ {label}
66
+ </span>
67
+ </li>
68
+ ))}
69
+ </ol>
70
+ </nav>
71
+ )
72
+ }
@@ -1,69 +1,70 @@
1
1
  @use 'igniteui-theming/sass/typography' as *;
2
2
 
3
3
  .docs-breadcrumb {
4
- width: 100%;
5
- padding: 0;
6
- margin-block-end: rem(16px);
7
-
8
- ul, ol {
9
- margin-block-end: 0 !important;
10
- }
4
+ width: 100%;
5
+ padding: 0;
6
+ margin-block-end: rem(16px);
7
+
8
+ ul,
9
+ ol {
10
+ margin-block-end: 0 !important;
11
+ }
11
12
  }
12
13
 
13
14
  .docs-breadcrumb-list {
14
- @include type-style('body-2') {
15
- margin: 0;
16
- };
17
-
18
- display: flex;
19
- flex-wrap: wrap;
20
- align-items: center;
21
- list-style: none;
22
- padding: 0;
23
- gap: 6px;
24
- color: light-dark(var(--ig-gray-700), var(--ig-gray-400));
15
+ @include type-style('body-2') {
16
+ margin: 0;
17
+ }
18
+
19
+ display: flex;
20
+ flex-wrap: wrap;
21
+ align-items: center;
22
+ list-style: none;
23
+ padding: 0;
24
+ gap: 6px;
25
+ color: light-dark(var(--ig-gray-700), var(--ig-gray-400));
25
26
  }
26
27
 
27
28
  [data-theme='dark'] {
28
- .docs-breadcrumb-list {
29
- color: var(--ig-gray-600);
30
- }
31
-
32
- .docs-breadcrumb-home {
33
- color: var(--ig-gray-400);
34
- }
29
+ .docs-breadcrumb-list {
30
+ color: var(--ig-gray-600);
31
+ }
32
+
33
+ .docs-breadcrumb-home {
34
+ color: var(--ig-gray-400);
35
+ }
35
36
  }
36
37
 
37
38
  .docs-breadcrumb-item {
38
- display: flex;
39
- align-items: center;
40
- gap: rem(4px);
41
- white-space: nowrap;
42
- overflow: hidden;
43
- padding: 0;
39
+ display: flex;
40
+ align-items: center;
41
+ gap: rem(4px);
42
+ white-space: nowrap;
43
+ overflow: hidden;
44
+ padding: 0;
44
45
  }
45
46
 
46
47
  .docs-breadcrumb-home {
47
- color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
48
- flex-shrink: 0;
48
+ color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
49
+ flex-shrink: 0;
49
50
  }
50
51
 
51
52
  .docs-breadcrumb-sep {
52
- --size: #{rem(16px)};
53
-
54
- flex-shrink: 0;
55
- user-select: none;
56
- rotate: -90deg;
57
- color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
53
+ --size: #{rem(16px)};
54
+
55
+ flex-shrink: 0;
56
+ user-select: none;
57
+ rotate: -90deg;
58
+ color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
58
59
  }
59
60
 
60
61
  .docs-breadcrumb-crumb {
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- max-width: 18rem;
62
+ overflow: hidden;
63
+ text-overflow: ellipsis;
64
+ max-width: 18rem;
64
65
  }
65
66
 
66
67
  /* Last crumb = current page — emphasise slightly */
67
68
  .docs-breadcrumb-item:last-child .docs-breadcrumb-crumb {
68
- font-weight: 500;
69
+ font-weight: 500;
69
70
  }
@@ -14,12 +14,12 @@ import DocsBreadcrumb from 'igniteui-astro-components/components/DocsBreadcrumb.
14
14
 
15
15
  ## Props
16
16
 
17
- | Prop | Type | Default | Description |
18
- |------|------|---------|-------------|
19
- | `currentSlug` | `string` | `''` | Slug of the current page — used to derive the crumb path from the sidebar tree. |
20
- | `pageTitle` | `string \| null` | — | Fallback label shown as the last crumb when `currentSlug` is not found in the tree. |
21
- | `siteTitle` | `string` | virtual module | Override the site name shown as the first crumb. |
22
- | `sidebarItems` | `SidebarEntry[]` | virtual module | Override the sidebar tree used for crumb generation. |
17
+ | Prop | Type | Default | Description |
18
+ | -------------- | ---------------- | -------------- | ----------------------------------------------------------------------------------- |
19
+ | `currentSlug` | `string` | `''` | Slug of the current page — used to derive the crumb path from the sidebar tree. |
20
+ | `pageTitle` | `string \| null` | — | Fallback label shown as the last crumb when `currentSlug` is not found in the tree. |
21
+ | `siteTitle` | `string` | virtual module | Override the site name shown as the first crumb. |
22
+ | `sidebarItems` | `SidebarEntry[]` | virtual module | Override the sidebar tree used for crumb generation. |
23
23
 
24
24
  ## Behaviour
25
25
 
@@ -39,16 +39,11 @@ import DocsBreadcrumb from 'igniteui-astro-components/components/DocsBreadcrumb.
39
39
  import type { SidebarEntry } from 'igniteui-astro-components/lib/sidebar/types';
40
40
 
41
41
  const sidebar: SidebarEntry[] = [
42
- { label: 'Components', collapsed: false, items: [
43
- { label: 'Toast', slug: 'components/toast' },
44
- ]},
42
+ { label: 'Components', collapsed: false, items: [{ label: 'Toast', slug: 'components/toast' }] },
45
43
  ];
46
44
  ---
47
- <DocsBreadcrumb
48
- siteTitle="My Library"
49
- currentSlug="components/toast"
50
- sidebarItems={sidebar}
51
- />
45
+
46
+ <DocsBreadcrumb siteTitle="My Library" currentSlug="components/toast" sidebarItems={sidebar} />
52
47
  ```
53
48
 
54
49
  ### With `siteMetaIntegration` (integration-driven)
@@ -59,6 +54,7 @@ All props are optional when the virtual module provides the data:
59
54
  ---
60
55
  import DocsBreadcrumb from 'igniteui-astro-components/components/DocsBreadcrumb.astro';
61
56
  ---
57
+
62
58
  <DocsBreadcrumb currentSlug="components/toast" pageTitle="Toast" />
63
59
  ```
64
60