igniteui-astro-components 0.0.1

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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +374 -0
  3. package/package.json +109 -0
  4. package/src/components/DocsSidebar/DocsSidebar.astro +99 -0
  5. package/src/components/DocsSidebar/README.md +166 -0
  6. package/src/components/DocsSidebar/SidebarFilterInput.astro +74 -0
  7. package/src/components/DocsSidebar/SidebarLabel.astro +40 -0
  8. package/src/components/DocsSidebar/sidebar-filter.ts +393 -0
  9. package/src/components/DocsSidebar/toTreeNodes.ts +66 -0
  10. package/src/components/DocsSubHeader/DocsSubHeader.astro +320 -0
  11. package/src/components/DocsSubHeader/README.md +74 -0
  12. package/src/components/DocsToc/DocsToc.astro +307 -0
  13. package/src/components/DocsToc/README.md +68 -0
  14. package/src/components/DocsToc/toTreeNodes.ts +57 -0
  15. package/src/components/DocsTree/DocsTree.astro +66 -0
  16. package/src/components/DocsTree/DocsTreeItem.astro +84 -0
  17. package/src/components/DocsTree/README.md +105 -0
  18. package/src/components/DocsTree/docs-tree.css +227 -0
  19. package/src/components/DocsTree/types.ts +47 -0
  20. package/src/components/GlobalFooter/GlobalFooter.astro +90 -0
  21. package/src/components/GlobalFooter/GlobalFooter.module.scss +23 -0
  22. package/src/components/GlobalFooter/README.md +35 -0
  23. package/src/components/GlobalNavBar/GlobalNavBar.astro +218 -0
  24. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +215 -0
  25. package/src/components/GlobalNavBar/README.md +49 -0
  26. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +112 -0
  27. package/src/components/MobileSidebarToggle/README.md +31 -0
  28. package/src/components/Search/README.md +43 -0
  29. package/src/components/Search/Search.astro +222 -0
  30. package/src/components/ThemingWidget/README.md +35 -0
  31. package/src/components/ThemingWidget/ThemingWidget.astro +152 -0
  32. package/src/components/mdx/ApiLink/ApiLink.astro +121 -0
  33. package/src/components/mdx/ApiLink/README.md +68 -0
  34. package/src/components/mdx/ApiRef/ApiRef.astro +92 -0
  35. package/src/components/mdx/ApiRef/README.md +50 -0
  36. package/src/components/mdx/DocsAside/DocsAside.astro +86 -0
  37. package/src/components/mdx/DocsAside/README.md +66 -0
  38. package/src/components/mdx/DocsAside/icons/caution.svg +3 -0
  39. package/src/components/mdx/DocsAside/icons/danger.svg +3 -0
  40. package/src/components/mdx/DocsAside/icons/note.svg +3 -0
  41. package/src/components/mdx/DocsAside/icons/tip.svg +4 -0
  42. package/src/components/mdx/PlatformBlock/PlatformBlock.astro +24 -0
  43. package/src/components/mdx/PlatformBlock/README.md +57 -0
  44. package/src/components/mdx/Sample/README.md +59 -0
  45. package/src/components/mdx/Sample/Sample.astro +142 -0
  46. package/src/content-helper.ts +159 -0
  47. package/src/content.config.ts +17 -0
  48. package/src/index.ts +42 -0
  49. package/src/integration.ts +841 -0
  50. package/src/layouts/DocsLayout/DocsLayout.astro +307 -0
  51. package/src/layouts/DocsLayout/README.md +124 -0
  52. package/src/lib/nav-helpers.ts +155 -0
  53. package/src/lib/platform-context.ts +305 -0
  54. package/src/lib/sidebar/helpers.ts +81 -0
  55. package/src/lib/sidebar/types.ts +36 -0
  56. package/src/llms.ts +315 -0
  57. package/src/platform.ts +281 -0
  58. package/src/plugins/remark-docfx.ts +368 -0
  59. package/src/scripts/sample-widget.ts +516 -0
  60. package/src/sidebar.ts +167 -0
  61. package/src/styles/custom.scss +254 -0
  62. package/src/styles/ig-theme.scss +43 -0
  63. package/src/virtual-modules.d.ts +35 -0
@@ -0,0 +1,152 @@
1
+ ---
2
+ /**
3
+ * ThemingWidget
4
+ *
5
+ * Renders the `<igniteui-theming-widget>` web component. Mirrors the
6
+ * behaviour from igniteui-docfx-template:
7
+ * template/partials/themeselect*.tmpl.partial
8
+ * src/app/handlers/theming.ts
9
+ *
10
+ * Behaviour:
11
+ * - `themeApiUrl` and `widgetVersion` are resolved from environment.json at
12
+ * build time via the `virtual:docs-template/nav-html` virtual module
13
+ * (same step as the header/footer prefetch in siteMetaIntegration).
14
+ * - Renders nothing when `themeApiUrl` is unavailable.
15
+ * - The widget container starts hidden and is revealed client-side only
16
+ * when at least one themeable `<iframe>` is found on the page.
17
+ * - Forwards `themeChange` events from the widget to every themeable frame
18
+ * via `postMessage`.
19
+ * - Re-initialises on Astro View-Transitions navigation (`astro:page-load`).
20
+ *
21
+ * Props:
22
+ * language – locale passed to the web component. Defaults to 'en'.
23
+ */
24
+
25
+ import { themeApiUrl } from 'virtual:docs-template/nav-html';
26
+ import type { NavLang } from '../../platform.ts';
27
+
28
+ interface Props {
29
+ language?: NavLang;
30
+ }
31
+
32
+ const { language = 'en' } = Astro.props;
33
+
34
+ // Only add the `language` attribute for japanese, which the widget currently supports. For the other languages the widget falls back to english.
35
+ const lang = language === 'jp' ? 'ja' : undefined;
36
+ ---
37
+
38
+ {themeApiUrl && (
39
+ <>
40
+ {/*
41
+ Widget container — always visible when themeApiUrl is set.
42
+ The client script below wires up theme→iframe forwarding.
43
+ */}
44
+ <div id="theming-widget-container" class="theming-widget-container" transition:persist transition:animate="none">
45
+ {lang
46
+ ? <igniteui-theming-widget theme-url={themeApiUrl} language={lang} />
47
+ : <igniteui-theming-widget theme-url={themeApiUrl} />
48
+ }
49
+ </div>
50
+ </>
51
+ )}
52
+
53
+ {/*
54
+ Init script — always bundled by Astro but self-guards by checking the
55
+ container element. When themeApiUrl was empty at build time the container
56
+ is absent, so this script becomes a no-op.
57
+ */}
58
+ <script>
59
+ // Module-level cleanup reference so re-init on View Transitions tears down
60
+ // the previous observer + event listener before creating new ones.
61
+ let _cleanup: (() => void) | null = null;
62
+
63
+ function initThemingWidget() {
64
+ if (_cleanup) { _cleanup(); _cleanup = null; }
65
+
66
+ const container = document.getElementById('theming-widget-container');
67
+ if (!container) return;
68
+
69
+ // Must query the widget element directly — themeChange is likely non-bubbling,
70
+ // so attaching to the parent container div would miss it.
71
+ const widget = container.querySelector('igniteui-theming-widget') as
72
+ (HTMLElement & { theme?: { globalTheme: string } }) | null;
73
+ if (!widget) return;
74
+
75
+ // ── postMessage helper ───────────────────────────────────────────────────
76
+ // Uses the iframe's origin (not the full URL path) as targetOrigin.
77
+ function postToIframe(iframe: HTMLIFrameElement, themeStyle: string) {
78
+ const src = iframe.src;
79
+ if (!src || src.startsWith('about:') || src.startsWith('javascript:')) return;
80
+ try {
81
+ const targetOrigin = new URL(src).origin;
82
+ iframe.contentWindow?.postMessage(
83
+ { themeStyle, origin: location.origin, themeName: widget?.theme?.globalTheme ?? '' },
84
+ targetOrigin,
85
+ );
86
+ } catch { /* cross-origin or invalid URL — ignore */ }
87
+ }
88
+
89
+ // ── Replay theme into a newly loaded iframe ──────────────────────────────
90
+ // Mirrors docfx's onSampleIframeContentLoaded: when an iframe finishes
91
+ // loading we immediately push the persisted themeStyle into it so samples
92
+ // that loaded after a theme was already selected pick it up.
93
+ function onIframeLoad(e: Event) {
94
+ const iframe = e.target as HTMLIFrameElement;
95
+ if (iframe.classList.contains('no-theming')) return;
96
+ const stored = sessionStorage.getItem('themeStyle');
97
+ if (stored) postToIframe(iframe, stored);
98
+ }
99
+
100
+ function attachLoadListener(node: Element) {
101
+ if (node instanceof HTMLIFrameElement && !node.classList.contains('no-theming')) {
102
+ node.addEventListener('load', onIframeLoad, { once: true });
103
+ }
104
+ node.querySelectorAll?.('iframe:not(.no-theming)').forEach(iframe => {
105
+ (iframe as HTMLIFrameElement).addEventListener('load', onIframeLoad, { once: true });
106
+ });
107
+ }
108
+
109
+ // Attach to iframes already in the DOM (e.g. first load, frame 0 queued immediately).
110
+ document.querySelectorAll<HTMLIFrameElement>('iframe:not(.no-theming)')
111
+ .forEach(iframe => iframe.addEventListener('load', onIframeLoad, { once: true }));
112
+
113
+ // ── themeChange → broadcast to all loaded iframes ───────────────────────
114
+ function onThemeChange(e: Event) {
115
+ const themeStyle = (e as CustomEvent<string>).detail;
116
+ sessionStorage.setItem('themeStyle', themeStyle);
117
+ document.querySelectorAll<HTMLIFrameElement>('iframe:not(.no-theming)').forEach(iframe => {
118
+ if (!iframe.src || iframe.src.startsWith('about:')) return;
119
+ // Skip lazy iframes that haven't received a real src yet.
120
+ if (iframe.classList.contains('lazyload') && !iframe.classList.contains('lazyloaded')) return;
121
+ postToIframe(iframe, themeStyle);
122
+ });
123
+ }
124
+
125
+ widget.addEventListener('themeChange', onThemeChange);
126
+
127
+ // ── MutationObserver: watch for iframes injected after init ──────────────
128
+ const observer = new MutationObserver((mutations) => {
129
+ for (const mut of mutations) {
130
+ mut.addedNodes.forEach(node => {
131
+ if (node instanceof Element) attachLoadListener(node);
132
+ });
133
+ }
134
+ });
135
+ observer.observe(document.body, { childList: true, subtree: true });
136
+
137
+ _cleanup = () => {
138
+ observer.disconnect();
139
+ widget.removeEventListener('themeChange', onThemeChange);
140
+ };
141
+ }
142
+
143
+ // Run on initial load and after every View-Transitions navigation.
144
+ document.addEventListener('astro:page-load', initThemingWidget);
145
+ initThemingWidget();
146
+ </script>
147
+
148
+ <style>
149
+ .theming-widget-container {
150
+ display: block;
151
+ }
152
+ </style>
@@ -0,0 +1,121 @@
1
+ ---
2
+ /**
3
+ * Inline API documentation link.
4
+ *
5
+ * Renders a <code> link pointing to the TypeDoc API reference for a class,
6
+ * interface, enum, type alias, variable, or function — and optionally a
7
+ * specific member (property / method) on a class or interface.
8
+ *
9
+ * Usage:
10
+ * <!-- core package — class (default kind) -->
11
+ * <ApiLink type="Toast" />
12
+ * → <a href="…/classes/igniteui-react.igrtoast.html"><code>IgrToast</code></a>
13
+ *
14
+ * <!-- class member -->
15
+ * <ApiLink type="Toast" member="show" label="Show" />
16
+ * → <a href="…/classes/igniteui-react.igrtoast.html#show"><code>Show</code></a>
17
+ *
18
+ * <!-- sub-package class -->
19
+ * <ApiLink pkg="charts" type="CategoryChart" />
20
+ *
21
+ * <!-- function (no platform prefix) -->
22
+ * <ApiLink kind="function" type="configureTheme" prefixed={false} />
23
+ * → <a href="…/functions/igniteui-react.configureTheme.html"><code>configureTheme</code></a>
24
+ *
25
+ * <!-- variable (fully-qualified) -->
26
+ * <ApiLink kind="variable" type="IgrCalendarResourceStringEN" prefixed={false} />
27
+ * → <a href="…/variables/igniteui-react.IgrCalendarResourceStringEN.html">…</a>
28
+ *
29
+ * <!-- type alias -->
30
+ * <ApiLink kind="type" type="AbsolutePosition" prefixed={false} />
31
+ * → <a href="…/types/igniteui-react.AbsolutePosition.html"><code>AbsolutePosition</code></a>
32
+ *
33
+ * <!-- interface -->
34
+ * <ApiLink kind="interface" type="ComboTemplateProps" prefixed={false} />
35
+ * → <a href="…/interfaces/igniteui-react.ComboTemplateProps.html">…</a>
36
+ *
37
+ * <!-- enum -->
38
+ * <ApiLink kind="enum" type="CalendarSelection" />
39
+ * → <a href="…/enums/igniteui-react.igrcalendarselection.html">…</a>
40
+ */
41
+ import { getPlatformContext } from '../../../lib/platform-context.ts';
42
+
43
+ type ApiKind = 'class' | 'interface' | 'enum' | 'type' | 'variable' | 'function';
44
+
45
+ interface Props {
46
+ /** Short type / symbol name without platform prefix, e.g. "Toast". */
47
+ type: string;
48
+ /**
49
+ * TypeDoc symbol kind. Determines the URL segment used.
50
+ * @default "class"
51
+ */
52
+ kind?: ApiKind;
53
+ /** Optional member name (property / method), e.g. "show". Appended as #anchor. */
54
+ member?: string;
55
+ /**
56
+ * Package key as defined in platform-context apiPackages.
57
+ * Defaults to "core" (the main component package).
58
+ * Use "charts", "grids", "gauges", "maps", "inputs", "layouts",
59
+ * "excel", "spreadsheet", "datasources" for sub-packages.
60
+ */
61
+ pkg?: string;
62
+ /**
63
+ * Override the display text. Defaults to the (prefixed) name,
64
+ * optionally suffixed with ".member".
65
+ */
66
+ label?: string;
67
+ /**
68
+ * When true (default) the platform prefix (Igr/Igx/Igc/Igb) is
69
+ * prepended to `type` automatically. Set to false when passing a
70
+ * fully-qualified name or a non-prefixed symbol like a function name.
71
+ */
72
+ prefixed?: boolean;
73
+ /**
74
+ * When true (default) the package classSuffix (e.g. "Component" for Angular)
75
+ * is appended to the class name. Set to false for utility/non-component classes
76
+ * that do not carry the platform class suffix (e.g. FilteringOperand, SortingStrategy).
77
+ * @default true
78
+ */
79
+ suffix?: boolean;
80
+ }
81
+
82
+ const KIND_SEGMENT: Record<ApiKind, string> = {
83
+ class: 'classes',
84
+ interface: 'interfaces',
85
+ enum: 'enums',
86
+ type: 'types',
87
+ variable: 'variables',
88
+ function: 'functions',
89
+ };
90
+
91
+ const { type, kind = 'class', member, pkg = 'core', label, prefixed = true, suffix = true } = Astro.props;
92
+ const { prefix, apiPackages } = getPlatformContext();
93
+
94
+ const pkgConfig = apiPackages[pkg] ?? apiPackages['core'];
95
+ const baseType = prefixed ? `${prefix}${type}` : type;
96
+ const segment = KIND_SEGMENT[kind];
97
+ let url: string;
98
+ if (kind === 'class') {
99
+ const fullType = (suffix && pkgConfig.classSuffix) ? `${baseType}${pkgConfig.classSuffix}` : baseType;
100
+ const cased = pkgConfig.preserveCase ? fullType : fullType.toLowerCase();
101
+ const classSlug = pkgConfig.noPackagePrefix
102
+ ? cased
103
+ : `${pkgConfig.packageId}.${cased}`;
104
+ const memberAnchor = member
105
+ ? `#${pkgConfig.pascalCaseMembers ? member.charAt(0).toUpperCase() + member.slice(1) : member}`
106
+ : '';
107
+ url = `${pkgConfig.docRoot}/classes/${classSlug}${memberAnchor}`;
108
+ } else {
109
+ // Non-class kinds: preserve original casing, no classSuffix
110
+ const slug = pkgConfig.noPackagePrefix
111
+ ? baseType
112
+ : `${pkgConfig.packageId}.${baseType}`;
113
+ const memberAnchorNonClass = member
114
+ ? `#${pkgConfig.pascalCaseMembers ? member.charAt(0).toUpperCase() + member.slice(1) : member.toLowerCase()}`
115
+ : '';
116
+ url = `${pkgConfig.docRoot}/${segment}/${slug}${memberAnchorNonClass}`;
117
+ }
118
+
119
+ const displayLabel = label ?? (member ? `${baseType}.${member}` : baseType);
120
+ ---
121
+ <a href={url}><code>{displayLabel}</code></a>
@@ -0,0 +1,68 @@
1
+ # ApiLink
2
+
3
+ Renders an inline `<a><code>` link pointing to the TypeDoc API reference for a class, interface, enum, type alias, variable, or function — with platform-aware URL generation.
4
+
5
+ ## Import
6
+
7
+ ```astro
8
+ import ApiLink from 'igniteui-astro-components/components/mdx/ApiLink.astro';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `type` | `string` | *(required)* | Short symbol name without platform prefix, e.g. `"Toast"`. |
16
+ | `kind` | `'class' \| 'interface' \| 'enum' \| 'type' \| 'variable' \| 'function'` | `'class'` | TypeDoc symbol kind — determines the URL path segment. |
17
+ | `member` | `string` | — | Optional member name (property/method). Appended as a `#anchor`. |
18
+ | `pkg` | `string` | `'core'` | Package key: `'core'` \| `'charts'` \| `'grids'` \| `'gauges'` \| `'maps'` \| `'inputs'` \| `'layouts'` \| `'excel'` \| `'spreadsheet'` \| `'datasources'`. |
19
+ | `label` | `string` | auto | Override the display text. Defaults to the prefixed name (+ `.member` when provided). |
20
+ | `prefixed` | `boolean` | `true` | When `true`, prepends the platform prefix (`Igr`/`Igx`/`Igc`/`Igb`) to `type`. Set `false` for already-qualified names or non-prefixed symbols like function names. |
21
+ | `suffix` | `boolean` | `true` | When `true`, appends the platform class suffix (e.g. `Component` for Angular). Set `false` for utility classes that do not carry a suffix. |
22
+
23
+ ## Examples
24
+
25
+ ```mdx
26
+ {/* Core class — auto-prefix applied */}
27
+ <ApiLink type="Toast" />
28
+ {/* → <a href="…/classes/igniteui-react.igrtoast.html"><code>IgrToast</code></a> */}
29
+
30
+ {/* Class member */}
31
+ <ApiLink type="Toast" member="show" label="Show" />
32
+
33
+ {/* Sub-package */}
34
+ <ApiLink pkg="charts" type="CategoryChart" />
35
+
36
+ {/* Function — no prefix, no suffix */}
37
+ <ApiLink kind="function" type="configureTheme" prefixed={false} />
38
+
39
+ {/* Type alias */}
40
+ <ApiLink kind="type" type="AbsolutePosition" prefixed={false} />
41
+
42
+ {/* Interface */}
43
+ <ApiLink kind="interface" type="ComboTemplateProps" prefixed={false} />
44
+
45
+ {/* Enum */}
46
+ <ApiLink kind="enum" type="CalendarSelection" />
47
+
48
+ {/* Utility class without platform suffix */}
49
+ <ApiLink type="SortingStrategy" suffix={false} />
50
+ ```
51
+
52
+ ## Platform context
53
+
54
+ The current platform is read from the `PLATFORM` environment variable (set at build time). Use `siteMetaIntegration({ platform })` or `createDocsSite({ platform })` in `astro.config.ts`:
55
+
56
+ ```ts
57
+ createDocsSite({ platform: 'react' });
58
+ // prefix → 'Igr', docRoot → 'https://www.infragistics.com/products/ignite-ui-react/docs/typescript/latest'
59
+ ```
60
+
61
+ Supported platforms and their prefixes:
62
+
63
+ | Platform | Prefix | Class suffix |
64
+ |----------|--------|--------------|
65
+ | `Angular` | `Igx` | `Component` (DV pkgs only) |
66
+ | `React` | `Igr` | — |
67
+ | `WebComponents` | `Igc` | — |
68
+ | `Blazor` | `Igb` | — |
@@ -0,0 +1,92 @@
1
+ ---
2
+ /**
3
+ * Renders the "API References" section with resolved hyperlinks.
4
+ *
5
+ * Usage:
6
+ * <!-- core package — classes (default) -->
7
+ * <ApiRef types={["Toast"]} />
8
+ *
9
+ * <!-- charts sub-package -->
10
+ * <ApiRef pkg="charts" types={["CategoryChart", "FinancialChart"]} />
11
+ *
12
+ * <!-- mixed kinds on the same page (separate ApiRef blocks per kind/package) -->
13
+ * <ApiRef types={["Toast"]} />
14
+ * <ApiRef kind="interface" types={["ComboTemplateProps"]} prefixed={false} />
15
+ * <ApiRef kind="enum" types={["CalendarSelection"]} />
16
+ *
17
+ * <!-- skip auto-prefix for fully-qualified names -->
18
+ * <ApiRef types={["IgbToast"]} prefixed={false} />
19
+ */
20
+ import { getPlatformContext } from '../../../lib/platform-context.ts';
21
+
22
+ type ApiKind = 'class' | 'interface' | 'enum' | 'type' | 'variable' | 'function';
23
+
24
+ interface Props {
25
+ /** Short type / symbol names without platform prefix. */
26
+ types: string[];
27
+ /**
28
+ * TypeDoc symbol kind. Determines the URL segment used.
29
+ * @default "class"
30
+ */
31
+ kind?: ApiKind;
32
+ /**
33
+ * Package key as defined in platform-context apiPackages.
34
+ * Defaults to "core". All types in one call must be from the same package.
35
+ */
36
+ pkg?: string;
37
+ /**
38
+ * When true (default) the platform prefix is prepended automatically.
39
+ * Set to false for fully-qualified names or non-prefixed symbols.
40
+ */
41
+ prefixed?: boolean;
42
+ /**
43
+ * When true (default) the package classSuffix (e.g. "Component" for Angular)
44
+ * is appended. Set to false for utility/non-component classes that do not carry
45
+ * the platform class suffix (e.g. SummaryOperand, SortingStrategy).
46
+ * @default true
47
+ */
48
+ suffix?: boolean;
49
+ }
50
+
51
+ const KIND_SEGMENT: Record<ApiKind, string> = {
52
+ class: 'classes',
53
+ interface: 'interfaces',
54
+ enum: 'enums',
55
+ type: 'types',
56
+ variable: 'variables',
57
+ function: 'functions',
58
+ };
59
+
60
+ const { types, kind = 'class', pkg = 'core', prefixed = true, suffix = true } = Astro.props;
61
+ const { prefix, apiPackages } = getPlatformContext();
62
+
63
+ const pkgConfig = apiPackages[pkg] ?? apiPackages['core'];
64
+ const segment = KIND_SEGMENT[kind];
65
+ const items = types.map((t) => {
66
+ const baseName = prefixed ? `${prefix}${t}` : t;
67
+
68
+ let url: string;
69
+ if (kind === 'class') {
70
+ const fullName = (suffix && pkgConfig.classSuffix) ? `${baseName}${pkgConfig.classSuffix}` : baseName;
71
+ const cased = pkgConfig.preserveCase ? fullName : fullName.toLowerCase();
72
+ const classSlug = pkgConfig.noPackagePrefix
73
+ ? cased
74
+ : `${pkgConfig.packageId}.${cased}`;
75
+ url = `${pkgConfig.docRoot}/classes/${classSlug}`;
76
+ } else {
77
+ // Non-class kinds: preserve original casing, no classSuffix
78
+ const slug = pkgConfig.noPackagePrefix
79
+ ? baseName
80
+ : `${pkgConfig.packageId}.${baseName}`;
81
+ url = `${pkgConfig.docRoot}/${segment}/${slug}`;
82
+ }
83
+
84
+ return { label: baseName, url };
85
+ });
86
+ ---
87
+
88
+ <ul>
89
+ {items.map(({ label, url }) => (
90
+ <li><a href={url}><code>{label}</code></a></li>
91
+ ))}
92
+ </ul>
@@ -0,0 +1,50 @@
1
+ # ApiRef
2
+
3
+ Renders a block "API References" section listing one or more types as hyperlinks. Typically placed at the bottom of a component documentation page.
4
+
5
+ ## Import
6
+
7
+ ```astro
8
+ import ApiRef from 'igniteui-astro-components/components/mdx/ApiRef.astro';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `types` | `string[]` | *(required)* | Short symbol names without platform prefix. All types must be from the same package. |
16
+ | `kind` | `'class' \| 'interface' \| 'enum' \| 'type' \| 'variable' \| 'function'` | `'class'` | TypeDoc symbol kind shared by all `types` in this call. |
17
+ | `pkg` | `string` | `'core'` | Package key — same options as `ApiLink`. |
18
+ | `prefixed` | `boolean` | `true` | Prepend the platform prefix automatically. Set `false` for already-qualified names. |
19
+ | `suffix` | `boolean` | `true` | Append the platform class suffix. Set `false` for utility classes. |
20
+
21
+ ## Examples
22
+
23
+ ```mdx
24
+ {/* Core classes */}
25
+ <ApiRef types={["Toast", "Combo", "Calendar"]} />
26
+
27
+ {/* Charts sub-package */}
28
+ <ApiRef pkg="charts" types={["CategoryChart", "FinancialChart"]} />
29
+
30
+ {/* Interface — no prefix */}
31
+ <ApiRef kind="interface" types={["ComboTemplateProps"]} prefixed={false} />
32
+
33
+ {/* Enum */}
34
+ <ApiRef kind="enum" types={["CalendarSelection"]} />
35
+
36
+ {/* Fully-qualified names (Blazor) */}
37
+ <ApiRef types={["IgbToast"]} prefixed={false} />
38
+ ```
39
+
40
+ ## Platform context
41
+
42
+ Same as `ApiLink` — resolved from the `PLATFORM` env var via `getPlatformContext()`.
43
+
44
+ When a page mixes types from different packages or different kinds, use separate `<ApiRef>` blocks:
45
+
46
+ ```mdx
47
+ <ApiRef types={["Toast"]} />
48
+ <ApiRef kind="enum" types={["CalendarSelection"]} />
49
+ <ApiRef pkg="charts" types={["CategoryChart"]} />
50
+ ```
@@ -0,0 +1,86 @@
1
+ ---
2
+ import noteIcon from './icons/note.svg?raw';
3
+ import tipIcon from './icons/tip.svg?raw';
4
+ import cautionIcon from './icons/caution.svg?raw';
5
+ import dangerIcon from './icons/danger.svg?raw';
6
+
7
+ interface Props {
8
+ type?: 'note' | 'tip' | 'caution' | 'danger';
9
+ title?: string;
10
+ color?: string;
11
+ class?: string;
12
+ icon?: string;
13
+ }
14
+
15
+ const { type = 'note', title, color, icon, class: className } = Astro.props;
16
+
17
+ const defaultLabels: Record<string, string> = {
18
+ note: 'Note',
19
+ tip: 'Tip',
20
+ caution: 'Caution',
21
+ danger: 'Danger',
22
+ };
23
+
24
+ const defaultIcons: Record<string, string> = {
25
+ note: noteIcon,
26
+ tip: tipIcon,
27
+ caution: cautionIcon,
28
+ danger: dangerIcon,
29
+ };
30
+
31
+ const label = title ?? defaultLabels[type];
32
+ const resolvedIcon = icon !== undefined ? icon : defaultIcons[type];
33
+ const inlineStyle = color ? `--aside-color: ${color};` : undefined;
34
+ ---
35
+
36
+ <aside
37
+ class:list={['aside', `aside--${type}`, className]}
38
+ aria-label={label}
39
+ style={inlineStyle}
40
+ >
41
+ <p class="aside-title" aria-hidden="true">
42
+ {resolvedIcon && <span class="aside-icon" aria-hidden="true" set:html={resolvedIcon} />}
43
+ {label}
44
+ </p>
45
+ <section class="aside-content">
46
+ <slot />
47
+ </section>
48
+ </aside>
49
+
50
+ <style>
51
+ .aside {
52
+ --aside-color: hsl(234, 90%, 60%);
53
+ border-inline-start: 0.25rem solid var(--aside-color);
54
+ padding: 1rem 1.25rem;
55
+ background-color: color-mix(in srgb, var(--aside-color) 8%, transparent);
56
+ border-radius: 0 0.375rem 0.375rem 0;
57
+ margin: 1.5rem 0;
58
+ }
59
+ .aside--note { --aside-color: hsl(234, 90%, 60%); }
60
+ .aside--tip { --aside-color: hsl(134, 70%, 38%); }
61
+ .aside--caution { --aside-color: hsl(40, 90%, 45%); }
62
+ .aside--danger { --aside-color: hsl(0, 85%, 52%); }
63
+
64
+ .aside-title {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 0.4em;
68
+ font-weight: 700;
69
+ font-size: 1rem;
70
+ text-transform: uppercase;
71
+ letter-spacing: 0.06em;
72
+ color: var(--aside-color);
73
+ margin: 0 0 0.5rem;
74
+ }
75
+ .aside-icon {
76
+ display: inline-flex;
77
+ flex-shrink: 0;
78
+ }
79
+ .aside-icon :global(svg) {
80
+ width: 1.4em;
81
+ height: 1.4em;
82
+ fill: currentColor;
83
+ }
84
+ .aside-content > :first-child { margin-top: 0; }
85
+ .aside-content > :last-child { margin-bottom: 0; }
86
+ </style>
@@ -0,0 +1,66 @@
1
+ # DocsAside
2
+
3
+ Renders a styled callout block (note, tip, caution, or danger) with a type-specific icon, color accent, and accessible label. Use it in MDX pages to surface important information inline.
4
+
5
+ ## Import
6
+
7
+ ```astro
8
+ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `type` | `'note' \| 'tip' \| 'caution' \| 'danger'` | `'note'` | Semantic variant — controls the color accent and default icon. |
16
+ | `title` | `string` | auto | Override the heading text. Defaults to the capitalised `type` name (`Note`, `Tip`, `Caution`, `Danger`). |
17
+ | `color` | `string` | — | Override the accent color via the `--aside-color` CSS custom property. Accepts any valid CSS color value. |
18
+ | `icon` | `string` | auto | Override the icon with raw SVG markup. Pass an empty string `""` to suppress the icon entirely. |
19
+ | `class` | `string` | — | Additional CSS class(es) to add to the `<aside>` element. |
20
+
21
+ ## Examples
22
+
23
+ ```mdx
24
+ {/* Default note */}
25
+ <DocsAside>
26
+ This is a general note.
27
+ </DocsAside>
28
+
29
+ {/* Tip variant */}
30
+ <DocsAside type="tip">
31
+ Use keyboard shortcuts to speed up your workflow.
32
+ </DocsAside>
33
+
34
+ {/* Caution with custom title */}
35
+ <DocsAside type="caution" title="Breaking change">
36
+ The `foo` prop was removed in v2. Use `bar` instead.
37
+ </DocsAside>
38
+
39
+ {/* Danger */}
40
+ <DocsAside type="danger">
41
+ Deleting this record is irreversible.
42
+ </DocsAside>
43
+
44
+ {/* Custom accent color */}
45
+ <DocsAside type="note" color="hsl(280, 80%, 50%)">
46
+ A purple-accented callout.
47
+ </DocsAside>
48
+
49
+ {/* No icon */}
50
+ <DocsAside type="tip" icon="">
51
+ This tip has no icon.
52
+ </DocsAside>
53
+ ```
54
+
55
+ ## Variants
56
+
57
+ | `type` | Accent color | Default title |
58
+ |--------|-------------|---------------|
59
+ | `note` | Blue | Note |
60
+ | `tip` | Green | Tip |
61
+ | `caution` | Amber | Caution |
62
+ | `danger` | Red | Danger |
63
+
64
+ ## Icons
65
+
66
+ The built-in icons live in `src/icons/aside/` as raw SVG files. They are imported with Astro's `?raw` query and injected inline so they inherit the current `color` via `fill: currentColor`.
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2
+ <path d="M12 16C11.8022 16 11.6089 16.0587 11.4444 16.1686C11.28 16.2784 11.1518 16.4346 11.0761 16.6173C11.0004 16.8001 10.9806 17.0011 11.0192 17.1951C11.0578 17.3891 11.153 17.5673 11.2929 17.7071C11.4327 17.847 11.6109 17.9422 11.8049 17.9808C11.9989 18.0194 12.2 17.9996 12.3827 17.9239C12.5654 17.8482 12.7216 17.72 12.8315 17.5556C12.9413 17.3911 13 17.1978 13 17C13 16.7348 12.8946 16.4805 12.7071 16.2929C12.5196 16.1054 12.2652 16 12 16ZM22.67 17.47L14.62 3.47003C14.3598 3.00354 13.9798 2.61498 13.5192 2.3445C13.0586 2.07401 12.5341 1.9314 12 1.9314C11.4659 1.9314 10.9414 2.07401 10.4808 2.3445C10.0202 2.61498 9.64019 3.00354 9.38 3.47003L1.38 17.47C1.11079 17.924 0.966141 18.441 0.960643 18.9688C0.955144 19.4966 1.089 20.0166 1.34868 20.4761C1.60837 20.9356 1.9847 21.3185 2.43968 21.5861C2.89466 21.8536 3.41218 21.9964 3.94 22H20.06C20.5921 22.0053 21.1159 21.8689 21.5779 21.6049C22.0399 21.341 22.4234 20.9589 22.689 20.4978C22.9546 20.0368 23.0928 19.5134 23.0895 18.9814C23.0862 18.4493 22.9414 17.9277 22.67 17.47ZM20.94 19.47C20.8523 19.626 20.7245 19.7556 20.5697 19.8453C20.4149 19.935 20.2389 19.9815 20.06 19.98H3.94C3.76111 19.9815 3.5851 19.935 3.43032 19.8453C3.27553 19.7556 3.14765 19.626 3.06 19.47C2.97223 19.318 2.92602 19.1456 2.92602 18.97C2.92602 18.7945 2.97223 18.622 3.06 18.47L11.06 4.47003C11.1439 4.30623 11.2714 4.16876 11.4284 4.07277C11.5855 3.97678 11.766 3.92599 11.95 3.92599C12.134 3.92599 12.3145 3.97678 12.4716 4.07277C12.6286 4.16876 12.7561 4.30623 12.84 4.47003L20.89 18.47C20.9892 18.6199 21.0462 18.7937 21.055 18.9732C21.0638 19.1527 21.0241 19.3312 20.94 19.49V19.47ZM12 8.00003C11.7348 8.00003 11.4804 8.10538 11.2929 8.29292C11.1054 8.48046 11 8.73481 11 9.00003V13C11 13.2652 11.1054 13.5196 11.2929 13.7071C11.4804 13.8947 11.7348 14 12 14C12.2652 14 12.5196 13.8947 12.7071 13.7071C12.8946 13.5196 13 13.2652 13 13V9.00003C13 8.73481 12.8946 8.48046 12.7071 8.29292C12.5196 8.10538 12.2652 8.00003 12 8.00003Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2
+ <path d="M12 7C11.7348 7 11.4804 7.10536 11.2929 7.29289C11.1054 7.48043 11 7.73478 11 8V12C11 12.2652 11.1054 12.5196 11.2929 12.7071C11.4804 12.8946 11.7348 13 12 13C12.2652 13 12.5196 12.8946 12.7071 12.7071C12.8946 12.5196 13 12.2652 13 12V8C13 7.73478 12.8946 7.48043 12.7071 7.29289C12.5196 7.10536 12.2652 7 12 7ZM12 15C11.8022 15 11.6089 15.0586 11.4444 15.1685C11.28 15.2784 11.1518 15.4346 11.0761 15.6173C11.0004 15.8 10.9806 16.0011 11.0192 16.1951C11.0578 16.3891 11.153 16.5673 11.2929 16.7071C11.4327 16.847 11.6109 16.9422 11.8049 16.9808C11.9989 17.0194 12.2 16.9996 12.3827 16.9239C12.5654 16.8482 12.7216 16.72 12.8315 16.5556C12.9414 16.3911 13 16.1978 13 16C13 15.7348 12.8946 15.4804 12.7071 15.2929C12.5196 15.1054 12.2652 15 12 15ZM21.71 7.56L16.44 2.29C16.2484 2.10727 15.9948 2.00368 15.73 2H8.27C8.00523 2.00368 7.75163 2.10727 7.56 2.29L2.29 7.56C2.10727 7.75163 2.00368 8.00523 2 8.27V15.73C2.00368 15.9948 2.10727 16.2484 2.29 16.44L7.56 21.71C7.75163 21.8927 8.00523 21.9963 8.27 22H15.73C15.9948 21.9963 16.2484 21.8927 16.44 21.71L21.71 16.44C21.8927 16.2484 21.9963 15.9948 22 15.73V8.27C21.9963 8.00523 21.8927 7.75163 21.71 7.56ZM20 15.31L15.31 20H8.69L4 15.31V8.69L8.69 4H15.31L20 8.69V15.31Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2
+ <path d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.43909 8.85483L1.44039 8.85354L4.96668 5.33815C5.30653 4.99386 5.7685 4.79662 6.2524 4.78972L6.26553 4.78963L12.9014 4.78962L13.8479 3.84308C16.9187 0.772319 20.0546 0.770617 21.4678 0.975145C21.8617 1.02914 22.2271 1.21053 22.5083 1.4917C22.7894 1.77284 22.9708 2.13821 23.0248 2.53199C23.2294 3.94517 23.2278 7.08119 20.1569 10.1521L19.2107 11.0983V17.7338L19.2106 17.7469C19.2037 18.2308 19.0067 18.6933 18.6624 19.0331L15.1456 22.5608C14.9095 22.7966 14.6137 22.964 14.29 23.0449C13.9663 23.1259 13.6267 23.1174 13.3074 23.0204C12.9881 22.9235 12.7011 22.7417 12.4771 22.4944C12.2533 22.2473 12.1006 21.9441 12.0355 21.6171L11.1783 17.3417L6.65869 12.822L4.34847 12.3589L2.38351 11.965C2.05664 11.8998 1.75272 11.747 1.50564 11.5232C1.25835 11.2992 1.07653 11.0122 0.979561 10.6929C0.882595 10.3736 0.874125 10.034 0.955057 9.7103C1.03599 9.38659 1.20328 9.09092 1.43909 8.85483ZM6.8186 10.8724L2.94619 10.096L6.32006 6.73268H10.9583L6.8186 10.8724ZM15.2219 5.21703C17.681 2.75787 20.0783 2.75376 21.1124 2.8876C21.2462 3.92172 21.2421 6.31895 18.783 8.77812L12.0728 15.4883L8.51172 11.9272L15.2219 5.21703ZM13.9042 21.0538L13.1279 17.1811L17.2676 13.0414V17.68L13.9042 21.0538Z"/>
3
+ <path d="M9.31827 18.3446C9.45046 17.8529 9.17864 17.3369 8.68945 17.1724C8.56178 17.1294 8.43145 17.1145 8.30512 17.1243C8.10513 17.1398 7.91519 17.2172 7.76181 17.3434C7.62613 17.455 7.51905 17.6048 7.45893 17.7835C6.97634 19.2186 5.77062 19.9878 4.52406 20.4029C4.08525 20.549 3.6605 20.644 3.29471 20.7053C3.35607 20.3395 3.45098 19.9148 3.59711 19.476C4.01221 18.2294 4.78141 17.0237 6.21648 16.5411C6.39528 16.481 6.54504 16.3739 6.65665 16.2382C6.85126 16.0016 6.92988 15.678 6.84417 15.3647C6.83922 15.3466 6.83373 15.3286 6.82767 15.3106C6.74106 15.053 6.55701 14.8557 6.33037 14.7459C6.10949 14.6389 5.84816 14.615 5.59715 14.6994C5.47743 14.7397 5.36103 14.7831 5.24786 14.8294C3.22626 15.6569 2.2347 17.4173 1.75357 18.8621C1.49662 19.6337 1.36993 20.3554 1.30679 20.8818C1.27505 21.1464 1.25893 21.3654 1.25072 21.5213C1.24662 21.5993 1.24448 21.6618 1.24337 21.7066L1.243 21.7226L1.24235 21.7605L1.2422 21.7771L1.24217 21.7827L1.24217 21.7856C1.24217 22.3221 1.67703 22.7579 2.2137 22.7579L2.2155 22.7579L2.22337 22.7578L2.23956 22.7577C2.25293 22.7575 2.27096 22.7572 2.29338 22.7567C2.33821 22.7555 2.40073 22.7534 2.47876 22.7493C2.63466 22.7411 2.85361 22.725 3.11822 22.6932C3.64462 22.6301 4.36636 22.5034 5.13797 22.2464C6.58274 21.7653 8.3431 20.7738 9.17063 18.7522C9.21696 18.639 9.26037 18.5226 9.30064 18.4029C9.30716 18.3835 9.31304 18.364 9.31827 18.3446Z"/>
4
+ </svg>