igniteui-astro-components 1.6.0 → 1.8.0

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 (64) hide show
  1. package/README.md +322 -158
  2. package/llms-full.txt +3207 -0
  3. package/llms.txt +103 -0
  4. package/package.json +17 -5
  5. package/src/assets/icons/figma-logo.svg +10 -0
  6. package/src/code-theme/README.md +72 -0
  7. package/src/code-theme/index.ts +57 -0
  8. package/src/components/CopyCode/CopyCode.astro +6 -1
  9. package/src/components/CopyCode/README.md +38 -0
  10. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +28 -30
  11. package/src/components/DocsSidebar/DocsSidebar.astro +14 -2
  12. package/src/components/DocsSidebar/README.md +58 -30
  13. package/src/components/DocsSidebar/SidebarLabel.astro +34 -36
  14. package/src/components/DocsSidebar/sidebar-filter.ts +53 -5
  15. package/src/components/DocsSidebar/toTreeNodes.ts +21 -5
  16. package/src/components/DocsSubHeader/DocsSubHeader.astro +22 -9
  17. package/src/components/DocsSubHeader/README.md +37 -31
  18. package/src/components/DocsToc/DocsToc.astro +12 -14
  19. package/src/components/DocsToc/README.md +7 -7
  20. package/src/components/DocsTree/DocsTree.astro +9 -11
  21. package/src/components/DocsTree/DocsTreeItem.astro +36 -40
  22. package/src/components/DocsTree/README.md +12 -9
  23. package/src/components/GlobalFooter/GlobalFooter.astro +6 -8
  24. package/src/components/GlobalNavBar/GlobalNavBar.astro +2 -4
  25. package/src/components/LicenseIndicator/LicenseIndicator.astro +6 -8
  26. package/src/components/MobileTocToggle/MobileTocToggle.astro +31 -33
  27. package/src/components/MobileTocToggle/README.md +45 -0
  28. package/src/components/Search/README.md +10 -10
  29. package/src/components/Search/Search.astro +12 -6
  30. package/src/components/SearchAdvanced/README.md +15 -8
  31. package/src/components/SearchAdvanced/SearchAdvanced.astro +17 -15
  32. package/src/components/ThemingWidget/ThemingWidget.astro +62 -60
  33. package/src/components/mdx/Anatomy/Anatomy.scss +1 -1
  34. package/src/components/mdx/Anatomy/README.md +40 -0
  35. package/src/components/mdx/ApiLink/ApiLink.astro +7 -9
  36. package/src/components/mdx/ApiLink/README.md +1 -0
  37. package/src/components/mdx/ApiRef/ApiRef.astro +7 -9
  38. package/src/components/mdx/ApiRef/README.md +1 -1
  39. package/src/components/mdx/Badge/Badge.astro +3 -1
  40. package/src/components/mdx/Badge/README.md +1 -3
  41. package/src/components/mdx/DocsAside/DocsAside.astro +3 -5
  42. package/src/components/mdx/DocsAside/README.md +47 -29
  43. package/src/components/mdx/Faq/Faq.astro +11 -13
  44. package/src/components/mdx/Faq/FaqItem.astro +20 -26
  45. package/src/components/mdx/FigmaUiKits/FigmaUiKits.astro +126 -0
  46. package/src/components/mdx/FigmaUiKits/FigmaUiKits.scss +165 -0
  47. package/src/components/mdx/FigmaUiKits/README.md +115 -0
  48. package/src/components/mdx/FigmaUiKits/kits.ts +26 -0
  49. package/src/components/mdx/PlatformBlock/README.md +5 -18
  50. package/src/components/mdx/Sample/README.md +67 -50
  51. package/src/components/mdx/Sample/Sample.astro +108 -33
  52. package/src/components/mdx/Sample/Sample.scss +38 -17
  53. package/src/integration.ts +6 -21
  54. package/src/layouts/DocsLayout/README.md +63 -28
  55. package/src/lib/warn-once.ts +8 -0
  56. package/src/scripts/copy-status.ts +35 -0
  57. package/src/scripts/icon-manifest.ts +1 -0
  58. package/src/scripts/sample-widget.ts +109 -42
  59. package/src/styles/global/_code-blocks.scss +58 -36
  60. package/src/styles/global/_copy-button.scss +18 -25
  61. package/src/styles/global/_markdown.scss +15 -8
  62. package/src/styles/global/_variables.scss +57 -0
  63. package/src/styles/theme.scss +4 -1
  64. package/src/virtual-modules.d.ts +2 -2
package/llms.txt ADDED
@@ -0,0 +1,103 @@
1
+ # igniteui-astro-components
2
+
3
+ > Astro components, layouts, plugins and styles that build the Infragistics / Ignite UI documentation sites. No build step: `.astro`, `.ts` and `.scss` sources ship as-is and are imported by subpath.
4
+
5
+ ## How to use this file
6
+
7
+ - Links are relative to the package root. In a consumer that root is `node_modules/igniteui-astro-components/` (a symlink to a checkout when installed with a `file:` dependency); on GitHub prefix them with `https://raw.githubusercontent.com/IgniteUI/igniteui-astro-components/master/`. Prefer the local copy: it matches the installed version (`package.json#version` beside this file).
8
+ - Each line below gives the import specifier, what the component does, its prop names (`*` = required) and the README that documents it. The `export interface Props` at the top of each `.astro` file is the authority when a README disagrees.
9
+ - `llms-full.txt` next to this file (in the published package; generated, not committed) contains every README verbatim for one-shot ingestion.
10
+
11
+ ## Consumer prerequisites
12
+
13
+ - Peers: `astro ^7.3.5`, `igniteui-theming ^29`, `igniteui-webcomponents ^7.4.1`, plus `@astrojs/mdx` for the MDX components and `@astrojs/markdown-satteri` for the Markdown pipeline. Sass: `vite.css.preprocessorOptions.scss.loadPaths: ['node_modules']` is not enough under Vite 8 (igniteui-theming's export map rejects `@use 'igniteui-theming/sass/typography'`); add the `importers` entry from [README.md](README.md#quick-start) step 1, which maps `igniteui-theming/...` to files in the package.
14
+ - Styles: `igniteui-astro-components/styles/theme.scss` is the only stylesheet. `DocsLayout` imports it (and the JetBrains Mono font); import it yourself only without the layout. Theme by overriding `--igd-*` custom properties (see [Styles](#styles)).
15
+ - Virtual modules: `DocsLayout`, `DocsSidebar`, `DocsSubHeader`, `DocsBreadcrumb`, `DoDont` and `FigmaUiKits` import `virtual:docs-template/site-meta`; `DocsLayout`, `DocsSidebar` and `DocsSubHeader` also import `virtual:docs-template/nav-html`. `GlobalNavBar` and `GlobalFooter` import neither. Stub both with a Vite plugin (complete snippet in [README.md](README.md#quick-start) step 2). `site-meta` must export every one of `title`, `sidebar`, `productLinks`, `headEntries`, `trailingSlash`, `navLang`, `packages`, `selectedPackage`; `nav-html` must export `platform`. `siteMetaIntegration()` omits `packages` and `selectedPackage`, so it cannot provide the module. Contract: [src/virtual-modules.d.ts](src/virtual-modules.d.ts).
16
+ - Middleware: `ApiLink`, `ApiRef`, `PlatformBlock` and `Sample` read `Astro.locals.platformContext` (`PlatformContext` from `igniteui-astro-components/lib/types`) and throw without it. `Sample` and `ThemingWidget` read `Astro.locals.envVars`, optional (`{}` when unset). Set both in `src/middleware.ts`; complete example in [README.md](README.md#quick-start) step 3.
17
+ - MDX components are not auto-registered: import each one at the top of the MDX file, or pass a `components` map to `<Content />`.
18
+ - Markdown pipeline: the plugins are Sätteri plugins, so `markdown.remarkPlugins` / `rehypePlugins` reject them. Use `markdown: { processor: satteri({ mdastPlugins: [...], hastPlugins: [...] }) }` from `@astrojs/markdown-satteri`: remark-style plugins (`remarkEnvVars`, `remarkMdLinks`, `remarkHtmlTransforms`, for the docs repos' content conventions) go in `mdastPlugins`; rehype-style plugins (`rehypeHeadingAnchors` for every consumer, `rehypeTableWrapper`, `rehypePagefindIgnore`) go in `hastPlugins`.
19
+ - `createDocsSite()` / `siteMetaIntegration()` in `igniteui-astro-components/integration` is reference code, not used by any consumer: it injects routes the package does not ship (#158), imports `pagefind` without declaring it (#157), omits `packages` / `selectedPackage` from `site-meta`, and registers no middleware. See [README.md](README.md#the-reference-integration).
20
+ - Local checkout instead of npm: `"igniteui-astro-components": "file:../astro-components"` (symlink; Vite 8 may need `vite.resolve.preserveSymlinks: true`), or a `tsconfig` path alias. See [README.md](README.md#using-from-another-repo-without-publishing-a-package).
21
+
22
+ ## Common tasks
23
+
24
+ 1. Import a component: `import X from 'igniteui-astro-components/<subpath>.astro'` using the specifiers listed below; `.astro` files are never reachable from the bare package name.
25
+ 2. Find a component's props: its line here, then its README, then `interface Props` in the `.astro` file.
26
+ 3. Embed a live demo in MDX: `<Sample src="/grids/grid/overview" height={600} alt="..." />` ([Sample](src/components/mdx/Sample/README.md)).
27
+ 4. Link an API symbol: `<ApiLink type="Grid" member="sortingExpressions" />` ([ApiLink](src/components/mdx/ApiLink/README.md)).
28
+ 5. Callout: `<DocsAside type="info" title="...">...</DocsAside>`; `type` is `note`, `info` or `warning`.
29
+ 6. Platform-specific MDX: `<PlatformBlock for="Angular, React">...</PlatformBlock>`; names are exactly `Angular`, `React`, `WebComponents`, `Blazor`, `WinUI`, `Uno` (`PlatformName` in `igniteui-astro-components/lib/types`).
30
+ 7. Build a page: `DocsLayout` with `DocsSidebar` in `slot="sidebar"`, `DocsToc` in `slot="toc"`, `MobileTocToggle` in `slot="mobile-toc"` ([DocsLayout](src/layouts/DocsLayout/README.md)).
31
+ 8. Highlight code in the brand theme: `markdown: { shikiConfig: igShikiConfig }` in `astro.config`, or `<Code theme={igCodeTheme} wrap />`, both from `igniteui-astro-components/code-theme` ([Code theme](src/code-theme/README.md)). `createDocsSite()` sets it already.
32
+ 9. Change colours, fonts or spacing: override `--igd-*` custom properties in the host stylesheet; no Sass variables are configurable.
33
+ 10. Sidebar data: `SidebarEntry[]` from `igniteui-astro-components/lib/sidebar/types`; groups have `items`, links have `slug` and optional `badges`.
34
+ 11. Report a problem with the package: [CONTRIBUTING.md](CONTRIBUTING.md#filing-issues). Problems with docs *content* belong in IgniteUI/igniteui-documentation.
35
+
36
+ ## MDX components
37
+
38
+ - [ApiLink](src/components/mdx/ApiLink/README.md): `igniteui-astro-components/components/mdx/ApiLink.astro` — inline link to an API symbol, URL resolved per platform. Props (TypeDoc): `type`*, `member`, `label`, `pkg`, `kind`, `prefixed`, `suffix`, `raw`; (Sass): `kind="sass"`*, `module`, `type`, `label`, `code`. Needs `platformContext`.
39
+ - [ApiRef](src/components/mdx/ApiRef/README.md): `igniteui-astro-components/components/mdx/ApiRef.astro` — "API References" list for several symbols. Props: `types`*, `kind`, `pkg`, `prefixed`, `suffix`. Needs `platformContext`.
40
+ - [Sample](src/components/mdx/Sample/README.md): `igniteui-astro-components/components/mdx/Sample.astro` — live demo iframe with code tabs and live-edit buttons. Props: `src`*, `height`, `alt`, `lob`, `dv`, `crm`, `wc`, `chrome` (`widget` | `demo` | `bare`), `showThemePicker`, `fullscreenBtn`, `fitContent`, `spacing`, `position`, `resizable`, `noBorder`, `noBackground`, `whiteBackground`, `iframeOnly` and `hideCode` (deprecated: `chrome="bare"` and `chrome="demo"`). Needs `platformContext` and `envVars` (`demosBaseUrl`, `dvDemosBaseUrl`, `lobDemosBaseUrl`, `crmDemoBaseUrl`, `wcDemosBaseUrl`, `defaultSampleTheme`).
41
+ - [PlatformBlock](src/components/mdx/PlatformBlock/README.md): `igniteui-astro-components/components/mdx/PlatformBlock.astro` — renders children only on the listed platforms. Props: `for`* (comma list). Needs `platformContext`.
42
+ - [DocsAside](src/components/mdx/DocsAside/README.md): `igniteui-astro-components/components/mdx/DocsAside.astro` — callout. Props: `type` (`note` | `info` | `warning`), `title`, `icon`, `class`, `color` (declared, not read: #162). Default slot is the body.
43
+ - [Badge](src/components/mdx/Badge/README.md): `igniteui-astro-components/components/mdx/Badge.astro` — status chip on `igc-badge`. Props: `variant` (`preview` | `new` | `updated` | `premium` | `opensource`), `class`, `aria-label`, `aria-hidden`. Default slot overrides the text.
44
+ - [Anatomy](src/components/mdx/Anatomy/README.md): `igniteui-astro-components/components/mdx/Anatomy.astro` — framed anatomy diagram. Props: `src`*, `alt`*, `class`.
45
+ - [DoDont](src/components/mdx/DoDont/README.md): `igniteui-astro-components/components/mdx/DoDont.astro` — side-by-side Do / Don't image panels. Props: `doSrc`*, `doAlt`*, `dontSrc`*, `dontAlt`*, `doLabel`, `dontLabel`, `loading`, `errorText`, `class`. Slots `do`*, `dont`* (an empty slot throws at build). Imports `virtual:docs-template/site-meta` (`navLang`).
46
+ - [FigmaUiKits](src/components/mdx/FigmaUiKits/README.md): `igniteui-astro-components/components/mdx/FigmaUiKits.astro` — "Check it out in our free Figma UI kits" banner linking to the four Indigo.Design UI kits. Props: `kits`, `title`, `compactTitle`, `variant` (`auto` | `compact`), `class`. An empty `kits` array or a kit with an empty `label` or `href` throws at build. `igniteui-astro-components/components/mdx/FigmaUiKits/kits` exports `FigmaUiKit` and `DEFAULT_FIGMA_UI_KITS`. Imports `virtual:docs-template/site-meta` (`navLang`).
47
+ - [Faq](src/components/mdx/Faq/README.md): `igniteui-astro-components/components/mdx/Faq.astro` — accordion of questions on `igc-accordion`. Props: `items`, `singleExpand`, `indicatorPosition`, `class`, `id`, aria/data pass-through. `igniteui-astro-components/components/mdx/FaqItem.astro` — one panel; props: `question`*, `subtitle`, `answer`, `open`, `disabled`, `indicatorPosition`, `class`, `id`. Types: `igniteui-astro-components/components/mdx/Faq/types` (`FaqEntry`, `FaqIndicatorPosition`).
48
+
49
+ ## Layout and chrome
50
+
51
+ - [DocsLayout](src/layouts/DocsLayout/README.md): `igniteui-astro-components/layouts/DocsLayout.astro` — full page shell (nav bar, sub-header, breadcrumb, sidebar, content, TOC, footer). Props: `title`, `description`, `keywords`, `hasSidebar`, `currentSlug`, `siteTitle`, `license`, `is404`, `packages`, `selectedPackage`, `packageLabel`, `versions`, `selectedVersion`, `versionLabel`, `showThemeToggle` and `themeStorageKey` (both forwarded to `DocsSubHeader` and unused) (+ runtime-only `hasToc`, #161). Slots: default, `sidebar`, `toc`, `mobile-toc`, `subheader`, `head`. Imports `styles/theme.scss`; needs both virtual modules.
52
+ - [DocsSubHeader](src/components/DocsSubHeader/README.md): `igniteui-astro-components/components/DocsSubHeader.astro` — sticky bar with logo, package/version selectors (`igc-select`, fire `igcChange`) and search. Props: `logoText`, `packages`, `selectedPackage`, `packageLabel`, `versions`, `selectedVersion`, `versionLabel`; accepted but not rendered: `siteTitle`, `pageTitle`, `currentSlug`, `productLinks`, `sidebarItems`, `showThemeToggle`, `themeStorageKey`. Slot `search`.
53
+ - [GlobalNavBar](src/components/GlobalNavBar/README.md): `igniteui-astro-components/components/GlobalNavBar.astro` — legacy Infragistics header fetched from `/navigation` at build. Props: `lang`*.
54
+ - [GlobalFooter](src/components/GlobalFooter/README.md): `igniteui-astro-components/components/GlobalFooter.astro` — legacy Infragistics footer. Props: `lang`*.
55
+ - [Search](src/components/Search/README.md): `igniteui-astro-components/components/Search.astro` — full-text search in an `igc-dialog` (Ctrl/⌘+K) over the Pagefind JS API. No props; the host must install `pagefind` and build the index.
56
+ - [SearchAdvanced](src/components/SearchAdvanced/README.md): `igniteui-astro-components/components/SearchAdvanced.astro` — client-side API symbol search over a JSON index. Props: `indexUrl`, `placeholder`, `showScope`, `tabs`, `allTabLimit`, `platform` (logo icon only; the scope comes from the URL path under `BASE_URL`), `class`.
57
+ - [ThemingWidget](src/components/ThemingWidget/README.md): `igniteui-astro-components/components/ThemingWidget.astro` — theme and colour-mode picker, emits `igd-theme-change`. Props: `themes`, `selectedTheme`, `mode`, `showMode`, `id`, `class`, `label`, `target`.
58
+ - [CopyCode](src/components/CopyCode/README.md): `igniteui-astro-components/components/CopyCode.astro` — adds a copy button to every Shiki `<pre>`. No props; `DocsLayout` mounts it.
59
+ - [MobileSidebarToggle](src/components/MobileSidebarToggle/README.md): `igniteui-astro-components/components/MobileSidebarToggle.astro` — mobile disclosure button for the sidebar. Props: `label` (default `Components List`).
60
+ - [MobileTocToggle](src/components/MobileTocToggle/README.md): `igniteui-astro-components/components/MobileTocToggle.astro` — mobile "On this page" dropdown. Props: `headings`, `tocConfig`, `label`.
61
+ - [DocsBreadcrumb](src/components/DocsBreadcrumb/README.md): rendered by `DocsLayout` above the content; not exported yet. `LicenseIndicator` likewise.
62
+
63
+ ## Sidebar, TOC and tree
64
+
65
+ - [DocsSidebar](src/components/DocsSidebar/README.md): `igniteui-astro-components/components/DocsSidebar/DocsSidebar.astro` — logo, filter and navigation tree. Props: `currentSlug`, `items`, `showFilter`, `trailingSlash`, `logoText`, `platformLabel`, `singleBranchExpand` (default `true`; then a group's `collapsed` is ignored). Companions: `igniteui-astro-components/components/DocsSidebar/SidebarFilterInput.astro`, `igniteui-astro-components/components/DocsSidebar/SidebarLabel.astro` (`node`, `depth`, `isLeaf`, `isActive`), `igniteui-astro-components/components/DocsSidebar/toTreeNodes` (`toTreeNodes(entries, currentSlug, { trailingSlash, singleBranch })`), `igniteui-astro-components/components/DocsSidebar/sidebar-filter` (`<sidebar-filter>` element).
66
+ - [DocsToc](src/components/DocsToc/README.md): `igniteui-astro-components/components/DocsToc.astro` — "On this page" list with scroll-spy. Props: `headings`, `tocConfig`, `label`, `offsetTarget`. Adapter: `igniteui-astro-components/components/DocsToc/toTreeNodes` (`headingsToTreeNodes`, `TocConfig`).
67
+ - [DocsTree](src/components/DocsTree/README.md): `igniteui-astro-components/components/DocsTree/DocsTree.astro` — generic `<igc-tree>` renderer used by both. Props: `nodes`*, `variant`* (`sidebar` | `toc`), `activeId`, `toggleNodeOnClick`, `ariaLabel`, `renderLabel`. Also `igniteui-astro-components/components/DocsTree/DocsTreeItem.astro`, `igniteui-astro-components/components/DocsTree/types` (`TreeNode`, `TreeVariant`) and `igniteui-astro-components/components/DocsTree/docs-tree.css` (export broken, see issue #159; the file is `docs-tree.scss`). Tokens `--docs-tree-*`.
68
+ - Types and helpers: `igniteui-astro-components/lib/sidebar/types` (`SidebarEntry`, `SidebarGroup`, `SidebarLink`, `SidebarBadge`, `SIDEBAR_BADGE_VARIANTS`), `igniteui-astro-components/lib/sidebar/helpers` (`isGroup`, `isActive`, `hasActive`, `joinPath`, `isInitiallyOpen`, `getBreadcrumb`, `getActiveLink`, …), `igniteui-astro-components/lib/types` (`PlatformName`, `ApiPackageConfig`, `PlatformContext`).
69
+ - `igniteui-astro-components/sidebar` — `buildSidebarFromToc({ tocPath, docsDir, exclude })`, converts a JSON TOC to `SidebarEntry[]` at config time.
70
+
71
+ ## Plugins and build helpers
72
+
73
+ - Rehype: `igniteui-astro-components/plugins/rehype-heading-anchors` (anchor links on headings), `igniteui-astro-components/plugins/rehype-table-wrapper` (scrollable table wrapper), `igniteui-astro-components/plugins/rehype-pagefind-ignore` (`data-pagefind-ignore` on code).
74
+ - Remark: `igniteui-astro-components/plugins/remark-env-vars` (`{Environment.X}` substitution), `igniteui-astro-components/plugins/remark-md-links` (`.md` → slug links, `DOCS_BASE` prefix), `igniteui-astro-components/plugins/remark-html-transforms` (dividers, code language normalisation, image paths).
75
+ - `igniteui-astro-components/platform` — `PlatformKey`, `NavLang`, `PLATFORM_DEFS`, `getPlatformHead(platform, lang, { legacyChrome })`, `getNavConfig()`, `platformLabelFor()`.
76
+ - `igniteui-astro-components/content` — `createDocsCollection(sourceDir, { exclude, extendSchema })`; `igniteui-astro-components/content-config` — default content collections.
77
+ - `igniteui-astro-components` (bare) — barrel of the runtime helpers above (`integration`, `sidebar`, `platform`, `content`, sidebar types and helpers); never `.astro` files. Avoid it: it re-exports `integration`, which imports the undeclared `pagefind` (#157), so the bare import fails unless the host installs `pagefind`. Import the subpaths instead.
78
+
79
+ ## Code theme
80
+
81
+ - [Code theme](src/code-theme/README.md): `igniteui-astro-components/code-theme` — `igCodeTheme` (Shiki theme `ig-dark`: Rosé Pine Moon recoloured with `colorReplacements`) and `igShikiConfig` (`{ theme: igCodeTheme, wrap: true }`) for `markdown.shikiConfig`. Shiki writes colours inline; the surface comes from `--igd-code-*` tokens.
82
+
83
+ ## Styles
84
+
85
+ - `igniteui-astro-components/styles/theme.scss` — igniteui-theming setup (`--ig-theme: fluent`), cascade layers, `--font-mono`, and the `global/` partials: palette, variables, type scale, markdown, code blocks (always dark), copy button, component overrides.
86
+ - Tokens on `:root` in [src/styles/global/_variables.scss](src/styles/global/_variables.scss): fonts `--igd-font-sans`, `--igd-font-mono`; brand `--igd-accent`, `--igd-on-accent`, `--igd-logo-type`, `--igd-illustration`; surfaces `--igd-app-bg`, `--igd-on-app-bg`, `--igd-layout-sections-bg`, `--igd-app-outline*`; shape `--igd-border-radius`, `--igd-border-radius-xl`, `--igd-padding-{sm,md,lg}`, `--igd-page-padding`, `--igd-sidebar-spacing`; layout `--igd-header-height`, `--igd-page-layout-grid`, `--igd-toc-*`; badges `--igd-{preview,new,updated,premium,opensource}-{bg,color,border}`; asides `--igd-aside-*`; FAQ `--igd-faq-*`; tables `--igd-table-*`; code snippets `--igd-code-*` (border, radius, padding, font, copy button).
87
+ - Component-scoped tokens: `--igd-theming-*` (ThemingWidget), `--igd-anatomy-*` (Anatomy), `--igd-dodont-*` (DoDont), `--igd-figma-kits-*` (FigmaUiKits), `--docs-tree-*` (DocsTree), `--ig-toc-width` (DocsToc). `--igd-anatomy-*` are declared on `.igd-anatomy` itself, so override them on that selector, not on `:root`.
88
+
89
+ ## Contributing
90
+
91
+ Repository files, not in the npm package:
92
+
93
+ - [AGENTS.md](AGENTS.md): commands, layout, conventions, issue and PR rules for agents working in this repo.
94
+ - [CONTRIBUTING.md](CONTRIBUTING.md): the same for people, with reasons, plus release and consumer-testing procedures.
95
+ - [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md): the PR body a CI check enforces.
96
+
97
+ ## Optional
98
+
99
+ - `llms-full.txt`: this index plus every README, generated by `npm run build:llms` (at `prepack`, so it is in the published package, not in the repository).
100
+ - `igniteui-astro-components/integration` — `createDocsSite()`, `siteMetaIntegration()`, `staticImagesIntegration()`; reference only (see prerequisites).
101
+ - `igniteui-astro-components/chrome` (`igChrome({ snapshot })`) and `igniteui-astro-components/chrome/contract` (`parseFragment()`, `CHROME_CONTRACT`) — render the marketing site's header/footer from a synced snapshot. See [README.md](README.md#the-infragistics-header-and-footer).
102
+ - `igniteui-astro-components/llms` — `buildLlmsTxt()` and `LlmsSet`: generates `llms.txt` files for a docs *site*; unrelated to this file.
103
+ - [playground/README.md](playground/README.md) (repository only): the in-repo site that renders every component for manual testing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
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": {
@@ -26,7 +26,9 @@
26
26
  "files": [
27
27
  "src",
28
28
  "README.md",
29
- "LICENSE"
29
+ "LICENSE",
30
+ "llms.txt",
31
+ "llms-full.txt"
30
32
  ],
31
33
  "exports": {
32
34
  ".": {
@@ -39,6 +41,7 @@
39
41
  "./content": "./src/content-helper.ts",
40
42
  "./content-config": "./src/content.config.ts",
41
43
  "./llms": "./src/llms.ts",
44
+ "./code-theme": "./src/code-theme/index.ts",
42
45
  "./layouts/DocsLayout.astro": "./src/layouts/DocsLayout/DocsLayout.astro",
43
46
  "./chrome": "./src/chrome/integration.ts",
44
47
  "./chrome/contract": "./src/chrome/contract.mjs",
@@ -68,6 +71,8 @@
68
71
  "./components/mdx/DocsAside.astro": "./src/components/mdx/DocsAside/DocsAside.astro",
69
72
  "./components/mdx/DoDont.astro": "./src/components/mdx/DoDont/DoDont.astro",
70
73
  "./components/mdx/Badge.astro": "./src/components/mdx/Badge/Badge.astro",
74
+ "./components/mdx/FigmaUiKits.astro": "./src/components/mdx/FigmaUiKits/FigmaUiKits.astro",
75
+ "./components/mdx/FigmaUiKits/kits": "./src/components/mdx/FigmaUiKits/kits.ts",
71
76
  "./components/mdx/Faq.astro": "./src/components/mdx/Faq/Faq.astro",
72
77
  "./components/mdx/FaqItem.astro": "./src/components/mdx/Faq/FaqItem.astro",
73
78
  "./components/mdx/Faq/types": "./src/components/mdx/Faq/types.ts",
@@ -91,11 +96,12 @@
91
96
  "igniteui-webcomponents": "^7.4.1"
92
97
  },
93
98
  "dependencies": {
94
- "@astrojs/mdx": "^8.0.2",
95
99
  "@astrojs/markdown-satteri": "^0.4.2",
100
+ "@astrojs/mdx": "^8.0.2",
96
101
  "@fontsource-variable/instrument-sans": "^5.3.0",
97
102
  "@fontsource-variable/inter": "^5.3.0",
98
103
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
104
+ "@shikijs/themes": "^4.4.3",
99
105
  "github-slugger": "^2.0.0",
100
106
  "jsdom": "^30.1.1",
101
107
  "satteri": "^0.10.5",
@@ -113,14 +119,20 @@
113
119
  "prettier": "^3.9.9",
114
120
  "prettier-plugin-astro": "^1.1.0",
115
121
  "sass": "^1.105.0",
116
- "typescript": "~6.0.3"
122
+ "typescript": "~6.0.3",
123
+ "vitest": "^5.0.5"
117
124
  },
118
125
  "publishConfig": {
119
126
  "access": "public"
120
127
  },
121
128
  "scripts": {
122
- "test": "node --test \"scripts/**/*.test.mjs\"",
129
+ "test": "npm run test:scripts && npm run test:components",
130
+ "test:scripts": "node --test \"scripts/**/*.test.mjs\"",
131
+ "test:components": "vitest run",
132
+ "test:watch": "vitest",
123
133
  "test:sample-widget": "node --test scripts/sample-widget.test.mjs",
134
+ "build:llms": "node scripts/build-llms.mjs",
135
+ "prepack": "npm run build:llms",
124
136
  "playground": "npm run playground:dev",
125
137
  "playground:dev": "astro sync --root playground && astro dev --root playground --port 4567",
126
138
  "playground:build": "astro sync --root playground && astro build --root playground",
@@ -0,0 +1,10 @@
1
+ <svg width="27" height="31" viewBox="0 0 27 31" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="27" height="31" rx="4" fill="#FFFFFF"/>
3
+ <g transform="translate(5.74 4.135)">
4
+ <path d="M0 18.95c0-2.1 1.74-3.79 3.88-3.79h3.88v3.79c0 2.09-1.74 3.78-3.88 3.78S0 21.04 0 18.95Z" fill="#24CB71"/>
5
+ <path d="M7.76 0v7.58h3.88c2.14 0 3.88-1.7 3.88-3.79S13.78 0 11.64 0H7.76Z" fill="#FF7237"/>
6
+ <path d="M11.61 15.16c2.14 0 3.88-1.7 3.88-3.8 0-2.09-1.74-3.78-3.88-3.78s-3.88 1.7-3.88 3.79 1.74 3.79 3.88 3.79Z" fill="#00B6FF"/>
7
+ <path d="M0 3.79c0 2.09 1.74 3.79 3.88 3.79h3.88V0H3.88C1.74 0 0 1.7 0 3.79Z" fill="#FF3737"/>
8
+ <path d="M0 11.37c0 2.09 1.74 3.79 3.88 3.79h3.88V7.58H3.88C1.74 7.58 0 9.27 0 11.37Z" fill="#874FFF"/>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,72 @@
1
+ # Code theme
2
+
3
+ Brand syntax-highlighting theme for code snippets: Shiki's bundled **Rosé Pine
4
+ Moon** recoloured with Shiki's `colorReplacements` to match the API Docs Figma
5
+ design (`api-snippet`, dark). Fenced Markdown/MDX blocks, Astro's `<Code>` and
6
+ the Sample component's code tabs all use it.
7
+
8
+ | Export | What it is |
9
+ | --------------- | ------------------------------------------------------------ |
10
+ | `igCodeTheme` | The Shiki theme object (`ig-dark`). |
11
+ | `igShikiConfig` | Drop-in Astro `markdown.shikiConfig`: `igCodeTheme`, `wrap`. |
12
+
13
+ Import them from `igniteui-astro-components/code-theme`.
14
+
15
+ ## Quick start
16
+
17
+ Sites built with `createDocsSite()` get it automatically. Any other Astro site:
18
+
19
+ ```js
20
+ // astro.config.mjs
21
+ import { defineConfig } from 'astro/config';
22
+ import { igShikiConfig } from 'igniteui-astro-components/code-theme';
23
+
24
+ export default defineConfig({
25
+ markdown: { shikiConfig: igShikiConfig },
26
+ });
27
+ ```
28
+
29
+ `<Code>` component:
30
+
31
+ ```astro
32
+ ---
33
+ import { Code } from 'astro:components';
34
+ import { igCodeTheme } from 'igniteui-astro-components/code-theme';
35
+ ---
36
+
37
+ <Code code={snippet} lang="ts" theme={igCodeTheme} wrap />
38
+ ```
39
+
40
+ Shiki directly:
41
+
42
+ ```ts
43
+ import { createHighlighter } from 'shiki';
44
+ import { igCodeTheme } from 'igniteui-astro-components/code-theme';
45
+
46
+ const highlighter = await createHighlighter({ themes: [igCodeTheme], langs: ['ts'] });
47
+ const html = highlighter.codeToHtml(code, { lang: 'ts', theme: igCodeTheme.name });
48
+ ```
49
+
50
+ Shiki writes the background, default text and token colours inline. The
51
+ surface (border, radius, padding, font, copy button) comes from the package
52
+ stylesheet (`igniteui-astro-components/styles/theme.scss`).
53
+
54
+ ## Tokens
55
+
56
+ Set on `:root` in `src/styles/global/_variables.scss`; override them from any
57
+ stylesheet loaded after the package theme.
58
+
59
+ | Token | Default | Purpose |
60
+ | ------------------------------- | -------------------------- | ---------------------------------------- |
61
+ | `--igd-code-border` | `1px solid #002b5c` | Snippet border. |
62
+ | `--igd-code-radius` | `var(--igd-border-radius)` | Corner radius. |
63
+ | `--igd-code-padding` | `36px` (`20px` on mobile) | Inner padding. |
64
+ | `--igd-code-font-family` | `var(--font-mono)` | Code font. |
65
+ | `--igd-code-font-size` | `14px` | Code font size. |
66
+ | `--igd-code-line-height` | `24px` | Code line height. |
67
+ | `--igd-code-margin-bottom` | `26px` | Space below a snippet. |
68
+ | `--igd-code-copy-color` | `#d2dbe8` | Copy button icon. |
69
+ | `--igd-code-copy-hover-color` | `#0176ff` | Copy button icon on hover / focus. |
70
+ | `--igd-code-copy-hover-bg` | `#002b5c` | Copy button background on hover / focus. |
71
+ | `--igd-code-copy-success-color` | `var(--ig-success-500)` | Icon colour after a successful copy. |
72
+ | `--igd-code-copy-inset` | `12px` | Copy button offset from the corner. |
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Brand Shiki theme for code snippets: Rosé Pine Moon recoloured with the
3
+ * API Docs Figma palette (`api-snippet`, mode=dark).
4
+ *
5
+ * `createDocsSite()` applies `igShikiConfig` by default. See README.md in this
6
+ * folder for manual usage (`<Code>`, `codeToHtml`).
7
+ */
8
+ import type { ShikiConfig } from 'astro';
9
+ import type { ThemeRegistration } from 'shiki';
10
+ import rosePineMoon from '@shikijs/themes/rose-pine-moon';
11
+
12
+ /** Object-literal, JSON and YAML keys and `obj.prop` access: Rosé Pine leaves them on the default text colour. */
13
+ const PROPERTY_KEY_SCOPES = [
14
+ 'meta.object-literal.key',
15
+ 'support.type.property-name.json',
16
+ 'entity.name.tag.yaml',
17
+ 'variable.other.property',
18
+ 'variable.other.object.property',
19
+ ];
20
+
21
+ /** Dark brand theme. Rosé Pine colour → brand colour, scopes and font styles unchanged. */
22
+ export const igCodeTheme: ThemeRegistration = {
23
+ ...rosePineMoon,
24
+ name: 'ig-dark',
25
+ displayName: 'Ignite UI Dark',
26
+ colors: {
27
+ ...rosePineMoon.colors,
28
+ 'editor.background': '#00142b',
29
+ 'editor.foreground': '#d2dbe8',
30
+ },
31
+ colorReplacements: {
32
+ '#e0def4': '#a9b8cc', // text: identifiers
33
+ '#908caa': '#d2dbe8', // subtle: punctuation
34
+ '#6e6a86': '#7d91ab', // muted: comments
35
+ '#3e8fb0': '#0a7aff', // pine: keywords (Figma #0176ff, lightened to pass AA)
36
+ '#f6c177': '#f95924', // gold: strings
37
+ '#ea9a97': '#ffa685', // rose: numbers, booleans, declared names
38
+ '#9ccfd8': '#66adff', // foam: tags, types
39
+ '#c4a7e7': '#99c9ff', // iris: attributes, parameters
40
+ '#eb6f92': '#ff4d25', // love: invalid, built-in functions
41
+ },
42
+ tokenColors: [
43
+ ...(rosePineMoon.tokenColors ?? []),
44
+ { scope: PROPERTY_KEY_SCOPES, settings: { foreground: '#66adff' } },
45
+ // Keep a comment's `//` / `/* */` as muted as its text.
46
+ {
47
+ scope: ['punctuation.definition.comment'],
48
+ settings: { foreground: '#7d91ab', fontStyle: 'italic' },
49
+ },
50
+ ],
51
+ };
52
+
53
+ /** Drop-in `markdown.shikiConfig` for Astro. */
54
+ export const igShikiConfig: ShikiConfig = {
55
+ theme: igCodeTheme,
56
+ wrap: true,
57
+ };
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import '../../scripts/icon-registry';
3
+ import { announceCopyStatus, clearCopyStatus } from '../../scripts/copy-status';
3
4
  import {
4
5
  defineComponents,
5
6
  IgcIconButtonComponent,
@@ -9,8 +10,9 @@
9
10
  defineComponents(IgcIconButtonComponent, IgcIconComponent);
10
11
 
11
12
  function initCopyButtons(): void {
13
+ // Adds a copy button to fenced blocks and <Code>; skips Sample code tabs.
12
14
  document.querySelectorAll<HTMLPreElement>('pre.astro-code, pre.shiki').forEach((pre) => {
13
- if (pre.closest('.copy-code-wrapper')) return;
15
+ if (pre.closest('.copy-code-wrapper, .code-wrapper')) return;
14
16
 
15
17
  const wrapper = document.createElement('div');
16
18
  wrapper.className = 'copy-code-wrapper';
@@ -34,16 +36,19 @@
34
36
  const resetState = () => {
35
37
  icon.setAttribute('name', 'copy');
36
38
  btn.setAttribute('aria-label', 'Copy code');
39
+ clearCopyStatus(wrapper);
37
40
  };
38
41
 
39
42
  const showCopied = () => {
40
43
  icon.setAttribute('name', 'check');
41
44
  btn.setAttribute('aria-label', 'Copied!');
45
+ announceCopyStatus(wrapper, 'Code copied to clipboard');
42
46
  setTimeout(resetState, 1500);
43
47
  };
44
48
 
45
49
  const showFailed = () => {
46
50
  btn.setAttribute('aria-label', 'Copy failed');
51
+ announceCopyStatus(wrapper, 'Copy failed');
47
52
  setTimeout(resetState, 1500);
48
53
  };
49
54
 
@@ -0,0 +1,38 @@
1
+ # CopyCode
2
+
3
+ Adds a "Copy code" icon button to every Shiki code block on the page. The
4
+ component renders no markup of its own: a client script wraps each
5
+ `pre.astro-code, pre.shiki` in `.copy-code-wrapper` and appends an
6
+ `igc-icon-button.copy-btn` that copies the block's text to the clipboard.
7
+
8
+ ## Import
9
+
10
+ ```astro
11
+ import CopyCode from 'igniteui-astro-components/components/CopyCode.astro';
12
+ ```
13
+
14
+ ## Props
15
+
16
+ None.
17
+
18
+ ## Behaviour
19
+
20
+ - Runs on `astro:page-load`, so it also covers pages reached through view
21
+ transitions. Blocks that already have a wrapper are skipped.
22
+ - Copies `<code>` text (falls back to the `<pre>` text). Uses
23
+ `navigator.clipboard.writeText` with a hidden-textarea fallback.
24
+ - The icon switches to a check mark and the `aria-label` to "Copied!" for
25
+ 1.5 s, or to "Copy failed".
26
+ - Button styles live in `src/styles/global/_copy-button.scss`.
27
+
28
+ ## Example
29
+
30
+ `DocsLayout` mounts it already. Mount it yourself only in a custom page shell:
31
+
32
+ ```astro
33
+ ---
34
+ import CopyCode from 'igniteui-astro-components/components/CopyCode.astro';
35
+ ---
36
+
37
+ <CopyCode />
38
+ ```
@@ -40,33 +40,31 @@ const breadcrumbPath = crumbs.join(' › ');
40
40
  const breadcrumbMeta = breadcrumbPath.replace(/,/g, '');
41
41
  ---
42
42
 
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
- }
43
+ {(resolvedSiteTitle || crumbs.length > 0) && (
44
+ <nav
45
+ class="docs-breadcrumb"
46
+ aria-label="Breadcrumb"
47
+ data-pagefind-meta={breadcrumbMeta ? `breadcrumb:${breadcrumbMeta}` : undefined}
48
+ >
49
+ <ol class="docs-breadcrumb-list">
50
+ {resolvedSiteTitle && (
51
+ <li class="docs-breadcrumb-item docs-breadcrumb-home">
52
+ <span>{resolvedSiteTitle}</span>
53
+ </li>
54
+ )}
55
+ {crumbs.map((label, i) => (
56
+ <li class="docs-breadcrumb-item">
57
+ <igc-icon
58
+ name="chevron"
59
+ collection="docs"
60
+ class="docs-breadcrumb-sep"
61
+ aria-hidden="true"
62
+ />
63
+ <span class="docs-breadcrumb-crumb" title={label}>
64
+ {label}
65
+ </span>
66
+ </li>
67
+ ))}
68
+ </ol>
69
+ </nav>
70
+ )}
@@ -41,6 +41,12 @@ interface Props {
41
41
  logoText?: string;
42
42
  /** Platform label shown below logoText (e.g. 'Angular'). Auto-detected from virtual module when omitted. */
43
43
  platformLabel?: string | null;
44
+ /**
45
+ * Keep one branch of the tree open at a time: only the current page's
46
+ * groups are open on load, and expanding a group collapses the others.
47
+ * The filter still opens every group with a match. Defaults to true.
48
+ */
49
+ singleBranchExpand?: boolean;
44
50
  }
45
51
 
46
52
  const useTrailingSlash = configuredTrailingSlash !== 'never';
@@ -51,13 +57,19 @@ const {
51
57
  trailingSlash = useTrailingSlash,
52
58
  logoText = ULTIMATE_UI_PLATFORMS.has(virtualPlatform ?? '') ? 'Ultimate UI' : 'Ignite UI',
53
59
  platformLabel = platformLabelFor(virtualPlatform),
60
+ singleBranchExpand = true,
54
61
  } = Astro.props;
55
62
  const items = (itemsProp ?? sidebarData) as SidebarEntry[];
56
- const nodes = toTreeNodes(items, currentSlug, { trailingSlash });
63
+ const nodes = toTreeNodes(items, currentSlug, { trailingSlash, singleBranch: singleBranchExpand });
57
64
  const activeId = normalizeSlug(currentSlug);
58
65
  ---
59
66
 
60
- <sidebar-filter class="docs-sidebar" id="docs-sidebar" data-no-results="No topics match">
67
+ <sidebar-filter
68
+ class="docs-sidebar"
69
+ id="docs-sidebar"
70
+ data-no-results="No topics match"
71
+ data-single-branch-expand={singleBranchExpand ? '' : undefined}
72
+ >
61
73
  <div class="igd-sidebar-logo">
62
74
  {/* Keep as <span>, not <h1> — avoids competing with the page <h1> in search. */}
63
75
  <span class="igd-logo-text">{logoText}</span>