igniteui-astro-components 1.7.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 (60) 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/README.md +58 -30
  12. package/src/components/DocsSidebar/SidebarLabel.astro +34 -36
  13. package/src/components/DocsSubHeader/README.md +24 -31
  14. package/src/components/DocsToc/DocsToc.astro +12 -14
  15. package/src/components/DocsToc/README.md +7 -7
  16. package/src/components/DocsTree/DocsTree.astro +9 -11
  17. package/src/components/DocsTree/DocsTreeItem.astro +36 -40
  18. package/src/components/DocsTree/README.md +12 -9
  19. package/src/components/GlobalFooter/GlobalFooter.astro +6 -8
  20. package/src/components/GlobalNavBar/GlobalNavBar.astro +2 -4
  21. package/src/components/LicenseIndicator/LicenseIndicator.astro +6 -8
  22. package/src/components/MobileTocToggle/MobileTocToggle.astro +31 -33
  23. package/src/components/MobileTocToggle/README.md +45 -0
  24. package/src/components/Search/README.md +10 -10
  25. package/src/components/Search/Search.astro +12 -6
  26. package/src/components/SearchAdvanced/README.md +15 -8
  27. package/src/components/SearchAdvanced/SearchAdvanced.astro +17 -15
  28. package/src/components/ThemingWidget/ThemingWidget.astro +62 -60
  29. package/src/components/mdx/Anatomy/Anatomy.scss +1 -1
  30. package/src/components/mdx/Anatomy/README.md +40 -0
  31. package/src/components/mdx/ApiLink/ApiLink.astro +7 -9
  32. package/src/components/mdx/ApiLink/README.md +1 -0
  33. package/src/components/mdx/ApiRef/ApiRef.astro +7 -9
  34. package/src/components/mdx/ApiRef/README.md +1 -1
  35. package/src/components/mdx/Badge/Badge.astro +3 -1
  36. package/src/components/mdx/Badge/README.md +1 -3
  37. package/src/components/mdx/DocsAside/DocsAside.astro +3 -5
  38. package/src/components/mdx/DocsAside/README.md +47 -29
  39. package/src/components/mdx/Faq/Faq.astro +11 -13
  40. package/src/components/mdx/Faq/FaqItem.astro +20 -26
  41. package/src/components/mdx/FigmaUiKits/FigmaUiKits.astro +126 -0
  42. package/src/components/mdx/FigmaUiKits/FigmaUiKits.scss +165 -0
  43. package/src/components/mdx/FigmaUiKits/README.md +115 -0
  44. package/src/components/mdx/FigmaUiKits/kits.ts +26 -0
  45. package/src/components/mdx/PlatformBlock/README.md +5 -18
  46. package/src/components/mdx/Sample/README.md +67 -50
  47. package/src/components/mdx/Sample/Sample.astro +108 -33
  48. package/src/components/mdx/Sample/Sample.scss +38 -17
  49. package/src/integration.ts +6 -21
  50. package/src/layouts/DocsLayout/README.md +63 -28
  51. package/src/lib/warn-once.ts +8 -0
  52. package/src/scripts/copy-status.ts +35 -0
  53. package/src/scripts/icon-manifest.ts +1 -0
  54. package/src/scripts/sample-widget.ts +109 -42
  55. package/src/styles/global/_code-blocks.scss +58 -36
  56. package/src/styles/global/_copy-button.scss +18 -25
  57. package/src/styles/global/_markdown.scss +15 -8
  58. package/src/styles/global/_variables.scss +57 -0
  59. package/src/styles/theme.scss +4 -1
  60. package/src/virtual-modules.d.ts +1 -1
@@ -11,12 +11,10 @@ const { license } = Astro.props;
11
11
  const label = license === 'premium' ? 'Premium' : 'Open Source';
12
12
  ---
13
13
 
14
- {
15
- license && (
16
- <Badge variant={license} class="license-indicator-badge">
17
- <span>{label}</span>
14
+ {license && (
15
+ <Badge variant={license} class="license-indicator-badge">
16
+ <span>{label}</span>
18
17
 
19
- {license === 'premium' && <igc-icon name="premium" collection="docs" aria-hidden="true" />}
20
- </Badge>
21
- )
22
- }
18
+ {license === 'premium' && <igc-icon name="premium" collection="docs" aria-hidden="true" />}
19
+ </Badge>
20
+ )}
@@ -23,42 +23,40 @@ const { headings = [], tocConfig, label = 'On this page' } = Astro.props;
23
23
  const nodes = headingsToTreeNodes(headings, tocConfig);
24
24
  ---
25
25
 
26
- {
27
- nodes.length > 0 && (
28
- <div class="mobile-toc">
29
- <button
30
- class="mobile-toc__trigger"
31
- id="mobile-toc-trigger"
32
- aria-expanded="false"
33
- aria-controls="mobile-toc-dropdown"
26
+ {nodes.length > 0 && (
27
+ <div class="mobile-toc">
28
+ <button
29
+ class="mobile-toc__trigger"
30
+ id="mobile-toc-trigger"
31
+ aria-expanded="false"
32
+ aria-controls="mobile-toc-dropdown"
33
+ >
34
+ <span class="mobile-toc__label">{label}</span>
35
+ <span class="mobile-toc__active" id="mobile-toc-active" aria-hidden="true" />
36
+ <svg
37
+ class="mobile-toc__chevron"
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ width="16"
40
+ height="16"
41
+ viewBox="0 0 24 24"
42
+ fill="none"
43
+ stroke="currentColor"
44
+ stroke-width="2.5"
45
+ stroke-linecap="round"
46
+ stroke-linejoin="round"
47
+ aria-hidden="true"
34
48
  >
35
- <span class="mobile-toc__label">{label}</span>
36
- <span class="mobile-toc__active" id="mobile-toc-active" aria-hidden="true" />
37
- <svg
38
- class="mobile-toc__chevron"
39
- xmlns="http://www.w3.org/2000/svg"
40
- width="16"
41
- height="16"
42
- viewBox="0 0 24 24"
43
- fill="none"
44
- stroke="currentColor"
45
- stroke-width="2.5"
46
- stroke-linecap="round"
47
- stroke-linejoin="round"
48
- aria-hidden="true"
49
- >
50
- <polyline points="6 9 12 15 18 9" />
51
- </svg>
52
- </button>
49
+ <polyline points="6 9 12 15 18 9" />
50
+ </svg>
51
+ </button>
53
52
 
54
- <div class="mobile-toc__dropdown" id="mobile-toc-dropdown" aria-hidden="true">
55
- <nav aria-label={label}>
56
- <DocsTree nodes={nodes} variant="toc" />
57
- </nav>
58
- </div>
53
+ <div class="mobile-toc__dropdown" id="mobile-toc-dropdown" aria-hidden="true">
54
+ <nav aria-label={label}>
55
+ <DocsTree nodes={nodes} variant="toc" />
56
+ </nav>
59
57
  </div>
60
- )
61
- }
58
+ </div>
59
+ )}
62
60
 
63
61
  <script>
64
62
  function initMobileToc() {
@@ -0,0 +1,45 @@
1
+ # MobileTocToggle
2
+
3
+ Mobile-only sticky row rendered below the sub-header. Shows "On this page"
4
+ with the current active heading and a chevron; tapping it opens a dropdown with
5
+ the table-of-contents links rendered through `DocsTree`. Hidden on tablet and
6
+ above, where the full `DocsToc` sidebar is shown instead.
7
+
8
+ ## Import
9
+
10
+ ```astro
11
+ import MobileTocToggle from 'igniteui-astro-components/components/MobileTocToggle.astro';
12
+ ```
13
+
14
+ ## Props
15
+
16
+ | Prop | Type | Default | Description |
17
+ | ----------- | ------------------- | ---------------- | ------------------------------------------------------------------------------ |
18
+ | `headings` | `MarkdownHeading[]` | `[]` | Astro's `headings` for the page. Renders nothing when empty. |
19
+ | `tocConfig` | `TocConfig` | — | Depth filter, same shape `DocsToc` accepts (`components/DocsToc/toTreeNodes`). |
20
+ | `label` | `string` | `'On this page'` | Trigger text. |
21
+
22
+ ## Example
23
+
24
+ ```astro
25
+ ---
26
+ import DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';
27
+ import DocsToc from 'igniteui-astro-components/components/DocsToc.astro';
28
+ import MobileTocToggle from 'igniteui-astro-components/components/MobileTocToggle.astro';
29
+
30
+ const { headings } = Astro.props;
31
+ ---
32
+
33
+ <DocsLayout title="Grid">
34
+ <MobileTocToggle slot="mobile-toc" headings={headings} />
35
+ <DocsToc slot="toc" headings={headings} />
36
+ <slot />
37
+ </DocsLayout>
38
+ ```
39
+
40
+ ## Markup
41
+
42
+ `.mobile-toc` → `button.mobile-toc__trigger#mobile-toc-trigger` (`aria-expanded`,
43
+ `aria-controls="mobile-toc-dropdown"`) with `.mobile-toc__label`,
44
+ `.mobile-toc__active` and `.mobile-toc__chevron`, followed by the dropdown.
45
+ Styles are in `MobileTocToggle.scss`.
@@ -1,6 +1,6 @@
1
1
  # Search
2
2
 
3
- Pagefind-powered full-text search modal. Renders a trigger button (`Ctrl+K`) and a `<dialog>` container that is populated client-side by the Pagefind UI library.
3
+ Pagefind-powered full-text search modal. Renders a trigger button (`Ctrl+K`) and an `<igc-dialog>` whose results are rendered client-side from the Pagefind JS API (`/pagefind/pagefind.js`), not the Pagefind UI library.
4
4
 
5
5
  ## Import
6
6
 
@@ -14,7 +14,7 @@ None — the component is self-contained.
14
14
 
15
15
  ## Behaviour
16
16
 
17
- - The search index (`/pagefind/`) is generated by running `pagefind --site <outDir>` after a production build. This is wired automatically by `siteMetaIntegration`.
17
+ - The search index (`/pagefind/`) is written by `siteMetaIntegration`'s `astro:build:done` hook through the Pagefind JS API (`createIndex` → `addDirectory({ rootSelector: 'main' })`). Only `<main data-pagefind-body>` content is indexed; `DocsToc` and code blocks carry `data-pagefind-ignore`.
18
18
  - In development the button renders but the dynamic Pagefind import resolves as a no-op — no runtime errors.
19
19
  - Keyboard shortcut: `Ctrl+K` / `⌘K` to open, `Escape` to close.
20
20
 
@@ -32,13 +32,13 @@ import Search from 'igniteui-astro-components/components/Search.astro';
32
32
 
33
33
  ## Build setup
34
34
 
35
- Ensure Pagefind runs after `astro build`:
35
+ The package imports `pagefind` but does not declare it as a dependency (issue #157), so the
36
+ host site must install it:
36
37
 
37
- ```json
38
- // package.json
39
- {
40
- "scripts": {
41
- "build": "astro build && pagefind --site dist"
42
- }
43
- }
38
+ ```sh
39
+ npm install --save-dev pagefind
44
40
  ```
41
+
42
+ If you do not use `siteMetaIntegration`, build the index yourself after
43
+ `astro build`, for example `pagefind --site dist`, or call the JS API from your
44
+ own integration.
@@ -35,9 +35,10 @@ import './Search.scss';
35
35
  title="Search (Ctrl+K)"
36
36
  >
37
37
  <igc-icon name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
38
- <kbd class="search-trigger__hint" slot="suffix" style="display:none;"
39
- ><kbd>Ctrl</kbd><kbd>K</kbd></kbd
40
- >
38
+ <kbd class="search-trigger__hint" slot="suffix" style="display:none;">
39
+ <kbd>Ctrl</kbd>
40
+ <kbd>K</kbd>
41
+ </kbd>
41
42
  </igc-input>
42
43
  </div>
43
44
 
@@ -63,7 +64,8 @@ import './Search.scss';
63
64
  name="search"
64
65
  collection="docs"
65
66
  slot="prefix"
66
- aria-hidden="true"></igc-icon>
67
+ aria-hidden="true"
68
+ ></igc-icon>
67
69
  <igc-icon-button
68
70
  slot="suffix"
69
71
  class="igd-search-clear"
@@ -72,7 +74,8 @@ import './Search.scss';
72
74
  aria-label="Clear search"
73
75
  name="clear"
74
76
  collection="docs"
75
- hidden></igc-icon-button>
77
+ hidden
78
+ ></igc-icon-button>
76
79
  </igc-input>
77
80
  </header>
78
81
  <div class="igd-search-content">
@@ -83,7 +86,10 @@ import './Search.scss';
83
86
  </igc-button>
84
87
  </div>
85
88
  <footer class="igd-search-footer">
86
- <igc-button class="search-close" variant="outlined"> Close </igc-button>
89
+ <igc-button class="search-close" variant="outlined">
90
+ {' '}
91
+ Close{' '}
92
+ </igc-button>
87
93
  </footer>
88
94
  </div>
89
95
  </igc-dialog>
@@ -10,14 +10,21 @@ import SearchAdvanced from 'igniteui-astro-components/components/SearchAdvanced.
10
10
 
11
11
  ## Props
12
12
 
13
- | Prop | Type | Default | Description |
14
- | ------------- | ------------- | ---------------------------------- | ----------------------------------------------------- |
15
- | `class` | `string` | — | CSS class for the outer element |
16
- | `indexUrl` | `string` | `${BASE_URL}api-search-index.json` | URL to the JSON search index |
17
- | `placeholder` | `string` | `"Search"` | Search input placeholder text |
18
- | `showScope` | `boolean` | `false` | Show scope selector (current package / all packages) |
19
- | `tabs` | `SearchTab[]` | `[]` | Tab categories (besides the always-present "All" tab) |
20
- | `allTabLimit` | `number` | `10` | Max results per category in the "All" tab |
13
+ | Prop | Type | Default | Description |
14
+ | ------------- | ------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
+ | `class` | `string` | — | CSS class for the outer element |
16
+ | `indexUrl` | `string` | `${BASE_URL}api-search-index/manifest.json` | URL of the search index: a single JSON file or a manifest (see "Index format") |
17
+ | `placeholder` | `string` | `"Search"` | Search input placeholder text |
18
+ | `showScope` | `boolean` | `false` | Show scope selector (current package / all packages) |
19
+ | `tabs` | `SearchTab[]` | `[]` | Tab categories (besides the always-present "All" tab) |
20
+ | `allTabLimit` | `number` | `10` | Max results per category in the "All" tab |
21
+ | `platform` | `string` | — | Platform key (`angular`, `react`, `blazor`, `web-components`) for the logo icon in the scope selector; auto-detected from the enclosing `DocsSubHeader` when omitted. The scope itself comes from the URL path under `BASE_URL` (`<platform>/<package>/<version>`). |
22
+
23
+ `indexUrl` accepts two shapes. A **single file** is a JSON document with
24
+ `{ pages: [...] }`. A **manifest** is `{ files: ["pkg/version.json", ...] }`;
25
+ every listed file is fetched relative to the manifest URL and their `pages`
26
+ are merged. The host generates and serves the index; `playground/public/api-search-index/`
27
+ holds a sample manifest.
21
28
 
22
29
  ### `SearchTab`
23
30
 
@@ -121,7 +121,8 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
121
121
  >
122
122
  <igc-icon name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
123
123
  <kbd class="search-trigger__hint" slot="suffix" style="display: none;">
124
- <kbd>Ctrl</kbd><kbd>K</kbd>
124
+ <kbd>Ctrl</kbd>
125
+ <kbd>K</kbd>
125
126
  </kbd>
126
127
  </igc-input>
127
128
  </div>
@@ -147,7 +148,8 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
147
148
  name="search"
148
149
  collection="docs"
149
150
  slot="prefix"
150
- aria-hidden="true"></igc-icon>
151
+ aria-hidden="true"
152
+ ></igc-icon>
151
153
  <igc-icon-button
152
154
  slot="suffix"
153
155
  class="igd-search-clear"
@@ -156,7 +158,8 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
156
158
  aria-label="Clear search"
157
159
  name="clear"
158
160
  collection="docs"
159
- hidden></igc-icon-button>
161
+ hidden
162
+ ></igc-icon-button>
160
163
  </igc-input>
161
164
 
162
165
  <igc-select
@@ -169,17 +172,15 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
169
172
  aria-label="Search scope"
170
173
  value="current"
171
174
  >
172
- {
173
- platformIcon && (
174
- <igc-icon
175
- id="search-scope-trigger-icon"
176
- name={platformIcon}
177
- collection="docs"
178
- slot="prefix"
179
- aria-hidden="true"
180
- />
181
- )
182
- }
175
+ {platformIcon && (
176
+ <igc-icon
177
+ id="search-scope-trigger-icon"
178
+ name={platformIcon}
179
+ collection="docs"
180
+ slot="prefix"
181
+ aria-hidden="true"
182
+ />
183
+ )}
183
184
  <igc-select-item value="current">
184
185
  <span data-scope-label>Current package</span>
185
186
  </igc-select-item>
@@ -189,7 +190,8 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
189
190
  anchor="search-scope-select"
190
191
  class="igd-search-scope-tooltip"
191
192
  placement="bottom"
192
- with-arrow></igc-tooltip>
193
+ with-arrow
194
+ ></igc-tooltip>
193
195
  </header>
194
196
  <div class="igd-search-content">
195
197
  <div class="igd-search-status" aria-live="polite"></div>
@@ -144,76 +144,78 @@ const modeLabels: Record<ThemeMode, string> = {
144
144
  name="chevron"
145
145
  collection="theming-widget"
146
146
  class="igd-theming__toggle-icon igd-theming__toggle-icon--collapsed"
147
- aria-hidden="true"></igc-icon>
147
+ aria-hidden="true"
148
+ ></igc-icon>
148
149
  <igc-icon
149
150
  slot="toggle-icon-expanded"
150
151
  name="chevron"
151
152
  collection="theming-widget"
152
153
  class="igd-theming__toggle-icon"
153
- aria-hidden="true"></igc-icon>
154
+ aria-hidden="true"
155
+ ></igc-icon>
154
156
  <span slot="prefix" class="igd-theming__swatch" data-swatch>
155
- {active?.swatch.map((c) => <span class="igd-theming__dot" style={`--dot: ${c}`} />)}
157
+ {active?.swatch.map((c) => (
158
+ <span class="igd-theming__dot" style={`--dot: ${c}`} />
159
+ ))}
156
160
  </span>
157
- {
158
- showMode && (
159
- <igc-select-header slot="header" class="igd-theming__mode-row">
160
- <span class="igd-theming__section-label">Mode</span>
161
- <div class="igd-theming__mode-buttons" role="group" aria-label="Color mode">
162
- {MODES.map((m) => (
163
- <igc-icon-button
164
- variant="flat"
165
- name={m === 'light' ? 'sun' : 'moon'}
166
- collection="theming-widget"
167
- class="igd-theming__mode-btn"
168
- id={modeButtonId(m)}
169
- data-mode-btn={m}
170
- aria-pressed={m === mode ? 'true' : 'false'}
171
- aria-label={modeLabels[m]}
172
- />
161
+ {showMode && (
162
+ <igc-select-header slot="header" class="igd-theming__mode-row">
163
+ <span class="igd-theming__section-label">Mode</span>
164
+ <div class="igd-theming__mode-buttons" role="group" aria-label="Color mode">
165
+ {MODES.map((m) => (
166
+ <igc-icon-button
167
+ variant="flat"
168
+ name={m === 'light' ? 'sun' : 'moon'}
169
+ collection="theming-widget"
170
+ class="igd-theming__mode-btn"
171
+ id={modeButtonId(m)}
172
+ data-mode-btn={m}
173
+ aria-pressed={m === mode ? 'true' : 'false'}
174
+ aria-label={modeLabels[m]}
175
+ />
176
+ ))}
177
+ </div>
178
+ </igc-select-header>
179
+ )}
180
+ {themes.map((t) => {
181
+ const name = t.label ?? titleCase(t.name);
182
+ return (
183
+ <igc-select-item
184
+ class="igd-theming__option"
185
+ value={t.name}
186
+ data-option={t.name}
187
+ data-label={name}
188
+ data-swatch={t.swatch.join(',')}
189
+ >
190
+ <span slot="prefix" class="igd-theming__swatch">
191
+ {t.swatch.map((c) => (
192
+ <span class="igd-theming__dot" style={`--dot: ${c}`} />
173
193
  ))}
174
- </div>
175
- </igc-select-header>
176
- )
177
- }
178
- {
179
- themes.map((t) => {
180
- const name = t.label ?? titleCase(t.name);
181
- return (
182
- <igc-select-item
183
- class="igd-theming__option"
184
- value={t.name}
185
- data-option={t.name}
186
- data-label={name}
187
- data-swatch={t.swatch.join(',')}
188
- >
189
- <span slot="prefix" class="igd-theming__swatch">
190
- {t.swatch.map((c) => (
191
- <span class="igd-theming__dot" style={`--dot: ${c}`} />
192
- ))}
193
- </span>
194
- <span class="igd-theming__option-name">{name}</span>
195
- <igc-icon slot="suffix" name="check" collection="theming-widget" aria-hidden="true" />
196
- </igc-select-item>
197
- );
198
- })
199
- }
194
+ </span>
195
+ <span class="igd-theming__option-name">{name}</span>
196
+ <igc-icon slot="suffix" name="check" collection="theming-widget" aria-hidden="true" />
197
+ </igc-select-item>
198
+ );
199
+ })}
200
200
  </igc-select>
201
- {
202
- showMode &&
203
- MODES.map((m) => (
204
- <igc-tooltip
205
- anchor={modeButtonId(m)}
206
- class="igd-theming__mode-tooltip"
207
- placement="bottom"
208
- with-arrow
209
- >
210
- {modeLabels[m]}
211
- </igc-tooltip>
212
- ))
213
- }
201
+ {showMode &&
202
+ MODES.map((m) => (
203
+ <igc-tooltip
204
+ anchor={modeButtonId(m)}
205
+ class="igd-theming__mode-tooltip"
206
+ placement="bottom"
207
+ with-arrow
208
+ >
209
+ {modeLabels[m]}
210
+ </igc-tooltip>
211
+ ))}
214
212
  <span class="igd-theming__selected-value" aria-hidden="true">
215
- <span class="igd-theming__selected-theme" data-selected-theme>{activeLabel}</span>
216
- <span class="igd-theming__selected-mode" data-selected-mode>{modeLabels[mode]}</span>
213
+ <span class="igd-theming__selected-theme" data-selected-theme>
214
+ {activeLabel}
215
+ </span>
216
+ <span class="igd-theming__selected-mode" data-selected-mode>
217
+ {modeLabels[mode]}
218
+ </span>
217
219
  </span>
218
220
  </div>
219
221
 
@@ -6,7 +6,7 @@
6
6
  // because the image's max-width is 100% of the content box (inside the padding)
7
7
  // and there is no negative margin to break out of it.
8
8
  .igd-anatomy {
9
- // Retunable from any ancestor, e.g. :root { --igd-anatomy-padding: 32px; }
9
+ // Declared here, so overrides target .igd-anatomy: .igd-anatomy { --igd-anatomy-padding: 32px; }
10
10
  --igd-anatomy-padding: #{rem(60px)} #{rem(24px)};
11
11
  --igd-anatomy-bg: light-dark(
12
12
  #{color($color: gray, $variant: 100, $opacity: 0.8)},
@@ -0,0 +1,40 @@
1
+ # Anatomy
2
+
3
+ Framed, padded container for a component anatomy diagram. Use it in MDX pages
4
+ where a labelled screenshot explains the parts of a component.
5
+
6
+ ## Import
7
+
8
+ ```astro
9
+ import Anatomy from 'igniteui-astro-components/components/mdx/Anatomy.astro';
10
+ ```
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Default | Description |
15
+ | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------ |
16
+ | `src` | `string` | _(required)_ | Image URL. |
17
+ | `alt` | `string` | _(required)_ | Accessible description, forwarded to the `<img>`. Describe the parts the diagram labels, not the name. |
18
+ | `class` | `string` | — | Extra class(es) on the frame. |
19
+
20
+ ## Example
21
+
22
+ ```mdx
23
+ import Anatomy from 'igniteui-astro-components/components/mdx/Anatomy.astro';
24
+
25
+ <Anatomy
26
+ src="/images/button-anatomy.png"
27
+ alt="Button anatomy: label text, optional prefix icon, optional suffix icon"
28
+ />
29
+ ```
30
+
31
+ ## Styling
32
+
33
+ Tokens are declared on `.igd-anatomy` itself, so a value set on `:root` or another ancestor is overridden. Retune them on `.igd-anatomy` (or a more specific selector):
34
+
35
+ ```
36
+ --igd-anatomy-padding (60px 24px)
37
+ --igd-anatomy-bg light-dark() surface
38
+ --igd-anatomy-border-color light-dark(gray-300, surface-700)
39
+ --igd-anatomy-radius (4px)
40
+ ```
@@ -169,12 +169,10 @@ if (Astro.props.kind === 'sass') {
169
169
  }
170
170
  ---
171
171
 
172
- {
173
- renderLink ? (
174
- <a href={url}>{renderCode ? <code>{displayLabel}</code> : displayLabel}</a>
175
- ) : renderCode ? (
176
- <code>{displayLabel}</code>
177
- ) : (
178
- displayLabel
179
- )
180
- }
172
+ {renderLink ? (
173
+ <a href={url}>{renderCode ? <code>{displayLabel}</code> : displayLabel}</a>
174
+ ) : renderCode ? (
175
+ <code>{displayLabel}</code>
176
+ ) : (
177
+ displayLabel
178
+ )}
@@ -43,6 +43,7 @@ the index is unavailable, `ApiLink` renders code text and does not guess a URL.
43
43
  | `kind` | `'class' \| 'interface' \| 'enum' \| 'type' \| 'variable' \| 'function'` | auto | Optional narrowing. Usually unnecessary when the index is available. |
44
44
  | `prefixed` | `boolean` | `true` | Candidate-name override for symbols that are never platform-prefixed. Avoid for new docs when the index can resolve the symbol. |
45
45
  | `suffix` | `boolean` | `true` | Candidate-name override for symbols that never use the platform class suffix. Avoid for new docs when the index can resolve the symbol. |
46
+ | `raw` | `boolean` | `false` | Marks a deliberately authored raw link in strict xplat documentation, so tooling does not flag it. |
46
47
 
47
48
  Platform names use `PlatformContext.name`: `Angular`, `React`,
48
49
  `WebComponents`, or `Blazor`.
@@ -83,13 +83,11 @@ const items = types.map((t) => {
83
83
  ---
84
84
 
85
85
  <ul>
86
- {
87
- items.map(({ label, url }) => (
88
- <li>
89
- <a href={url}>
90
- <code>{label}</code>
91
- </a>
92
- </li>
93
- ))
94
- }
86
+ {items.map(({ label, url }) => (
87
+ <li>
88
+ <a href={url}>
89
+ <code>{label}</code>
90
+ </a>
91
+ </li>
92
+ ))}
95
93
  </ul>
@@ -44,7 +44,7 @@ import ApiRef from 'igniteui-astro-components/components/mdx/ApiRef.astro';
44
44
 
45
45
  ## Platform context
46
46
 
47
- Same as `ApiLink` — resolved from the `Platform` env var via `getPlatformContext()`.
47
+ Same as `ApiLink` — read from `Astro.locals.platformContext` (`PlatformContext` from `igniteui-astro-components/lib/types`), which the host site's middleware must set. Without it the render throws, because the component destructures the context.
48
48
 
49
49
  When a page mixes types from different packages or different kinds, use separate `<ApiRef>` blocks:
50
50
 
@@ -21,7 +21,9 @@ const defaultText =
21
21
  ---
22
22
 
23
23
  <igc-badge class:list={['igd-badge', variant, className]} {...rest}>
24
- <slot><span>{defaultText}</span></slot>
24
+ <slot>
25
+ <span>{defaultText}</span>
26
+ </slot>
25
27
  </igc-badge>
26
28
 
27
29
  <script>
@@ -31,9 +31,7 @@ import Badge from 'igniteui-astro-components/components/mdx/Badge.astro';
31
31
  <Badge variant="premium" />
32
32
  <Badge variant="opensource" />
33
33
 
34
- {/* Inside a heading */}
35
-
36
- ## My Feature <Badge variant="new" />
34
+ {/* Inside a heading: `### My Feature <Badge variant="new" />` */}
37
35
 
38
36
  {/* Custom slot content */}
39
37
 
@@ -29,11 +29,9 @@ const resolvedIcon = icon !== undefined ? icon : defaultIcons[type];
29
29
  ---
30
30
 
31
31
  <div class:list={['igd-aside', `igd-aside--${type}`, className]} aria-label={label} role="note">
32
- {
33
- resolvedIcon && (
34
- <igc-icon class="igd-aside__icon" name={resolvedIcon} collection="docs" aria-hidden="true" />
35
- )
36
- }
32
+ {resolvedIcon && (
33
+ <igc-icon class="igd-aside__icon" name={resolvedIcon} collection="docs" aria-hidden="true" />
34
+ )}
37
35
 
38
36
  <span class="igd-aside__title" aria-hidden="true">
39
37
  {label}