igniteui-astro-components 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +82 -74
  2. package/package.json +16 -2
  3. package/src/assets/images/anatomy-test.png +0 -0
  4. package/src/components/CopyCode/CopyCode.astro +21 -7
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
  6. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
  7. package/src/components/DocsBreadcrumb/README.md +10 -14
  8. package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
  9. package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
  10. package/src/components/DocsSidebar/README.md +25 -21
  11. package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
  12. package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
  13. package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
  14. package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
  15. package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
  16. package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
  17. package/src/components/DocsSubHeader/README.md +18 -16
  18. package/src/components/DocsToc/DocsToc.astro +301 -280
  19. package/src/components/DocsToc/DocsToc.scss +20 -21
  20. package/src/components/DocsToc/README.md +11 -9
  21. package/src/components/DocsToc/toTreeNodes.ts +3 -8
  22. package/src/components/DocsTree/DocsTree.astro +32 -20
  23. package/src/components/DocsTree/DocsTreeItem.astro +35 -30
  24. package/src/components/DocsTree/README.md +16 -15
  25. package/src/components/DocsTree/docs-tree.scss +267 -268
  26. package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
  27. package/src/components/GlobalFooter/README.md +3 -2
  28. package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
  29. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
  30. package/src/components/GlobalNavBar/README.md +3 -2
  31. package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
  32. package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
  33. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
  34. package/src/components/MobileSidebarToggle/README.md +3 -2
  35. package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
  36. package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
  37. package/src/components/Search/README.md +1 -0
  38. package/src/components/Search/Search.astro +137 -109
  39. package/src/components/Search/Search.scss +20 -20
  40. package/src/components/SearchAdvanced/README.md +21 -15
  41. package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
  42. package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
  43. package/src/components/mdx/Anatomy/Anatomy.astro +51 -0
  44. package/src/components/mdx/Anatomy/Anatomy.scss +40 -0
  45. package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
  46. package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
  47. package/src/components/mdx/ApiLink/README.md +26 -22
  48. package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
  49. package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
  50. package/src/components/mdx/ApiRef/README.md +20 -15
  51. package/src/components/mdx/Badge/Badge.astro +14 -14
  52. package/src/components/mdx/Badge/Badge.scss +61 -56
  53. package/src/components/mdx/Badge/README.md +24 -19
  54. package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
  55. package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
  56. package/src/components/mdx/DocsAside/README.md +22 -22
  57. package/src/components/mdx/Faq/Faq.astro +86 -0
  58. package/src/components/mdx/Faq/Faq.scss +105 -0
  59. package/src/components/mdx/Faq/FaqItem.astro +117 -0
  60. package/src/components/mdx/Faq/README.md +223 -0
  61. package/src/components/mdx/Faq/types.ts +34 -0
  62. package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
  63. package/src/components/mdx/PlatformBlock/README.md +6 -8
  64. package/src/components/mdx/Sample/README.md +21 -16
  65. package/src/components/mdx/Sample/Sample.astro +97 -74
  66. package/src/components/mdx/Sample/Sample.scss +132 -132
  67. package/src/content-helper.ts +71 -72
  68. package/src/content.config.ts +1 -6
  69. package/src/integration.ts +566 -512
  70. package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
  71. package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
  72. package/src/layouts/DocsLayout/README.md +24 -35
  73. package/src/lib/nav-helpers.ts +88 -82
  74. package/src/lib/types.ts +76 -76
  75. package/src/llms.ts +205 -166
  76. package/src/platform.ts +312 -162
  77. package/src/plugins/rehype-heading-anchors.ts +45 -45
  78. package/src/plugins/rehype-pagefind-ignore.ts +19 -19
  79. package/src/plugins/rehype-table-wrapper.ts +30 -30
  80. package/src/plugins/remark-docfx.ts +12 -0
  81. package/src/plugins/remark-env-vars.ts +12 -4
  82. package/src/plugins/remark-md-links.ts +10 -4
  83. package/src/scripts/icon-manifest.ts +13 -5
  84. package/src/scripts/sample-widget.ts +557 -501
  85. package/src/sidebar.ts +103 -97
  86. package/src/styles/global/_code-blocks.scss +43 -44
  87. package/src/styles/global/_component-themes.scss +151 -153
  88. package/src/styles/global/_icon-gallery.scss +81 -81
  89. package/src/styles/global/_index.scss +0 -1
  90. package/src/styles/global/_markdown.scss +816 -787
  91. package/src/styles/global/_palette.scss +456 -110
  92. package/src/styles/global/_search-shared.scss +402 -398
  93. package/src/styles/global/_type-scale.scss +127 -127
  94. package/src/styles/global/_variables.scss +138 -111
  95. package/src/styles/theme.scss +41 -41
  96. package/src/virtual-modules.d.ts +11 -2
@@ -0,0 +1,105 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+
3
+ // STRUCTURE STYLES
4
+
5
+ .igd-faq {
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: var(--igd-faq-gap);
9
+ margin-block-end: var(--igd-faq-margin-bottom);
10
+ }
11
+
12
+ .igd-faq__item {
13
+ // Bridge: every igd-* FAQ token feeds the matching igc-expansion-panel
14
+ // theme property, so consumers only ever set --igd-faq-* variables.
15
+ //
16
+ // Geometry is deliberately NOT overridden here. igc-expansion-panel derives
17
+ // its header padding, body padding, and indicator margin from the layout
18
+ // scale (--ig-size / --ig-spacing); hard-coding padding on ::part(header)
19
+ // and ::part(content) would freeze the component at one density and — for
20
+ // the body — double up, because the real body padding lives on the inner
21
+ // `[part~=content] > slot`, which is not an exposed part. Scale the density
22
+ // through --igd-faq-spacing instead.
23
+ --ig-spacing: var(--igd-faq-spacing);
24
+
25
+ --ig-expansion-panel-header-background: var(--igd-faq-header-bg);
26
+ --ig-expansion-panel-header-focus-background: var(--igd-faq-header-focus-bg);
27
+ --ig-expansion-panel-header-title-color: var(--igd-faq-question-color);
28
+ --ig-expansion-panel-header-description-color: var(--igd-faq-subtitle-color);
29
+ --ig-expansion-panel-header-icon-color: var(--igd-faq-indicator-color);
30
+ --ig-expansion-panel-body-background: var(--igd-faq-body-bg);
31
+ --ig-expansion-panel-body-color: var(--igd-faq-answer-color);
32
+ --ig-expansion-panel-disabled-text-color: var(--igd-faq-disabled-color);
33
+ --ig-expansion-panel-disabled-description-color: var(--igd-faq-disabled-color);
34
+ --ig-expansion-panel-border-radius: var(--igd-faq-border-radius);
35
+ // The accordion's own gap owns the vertical rhythm — see .igd-faq { gap }.
36
+ --ig-expansion-panel-expanded-margin: 0;
37
+
38
+ border: var(--igd-faq-border-width) var(--igd-faq-border-style) var(--igd-faq-border-color);
39
+ border-radius: var(--igd-faq-border-radius);
40
+ background: var(--igd-faq-header-bg);
41
+
42
+ // Clip the header/body backgrounds to the rounded corners.
43
+ overflow: hidden;
44
+
45
+ // NOTE: do not colour ::part(indicator) / the slotted title from here. The
46
+ // panel already paints them from the bridged tokens above, and it swaps them
47
+ // for --disabled-text-color under :host([disabled]). An outer-tree ::part()
48
+ // rule always beats the shadow tree's own rules, so re-stating the colour
49
+ // here would silently defeat the disabled state.
50
+ }
51
+
52
+ // Wrapper around a caller-supplied indicator — must not affect the layout the
53
+ // panel's own indicator part sets up.
54
+ .igd-faq__indicator {
55
+ display: contents;
56
+ }
57
+
58
+ // THEME STYLES
59
+
60
+ .igd-faq__item[open] {
61
+ border-color: var(--igd-faq-open-border-color);
62
+ }
63
+
64
+ // The panel only greys its own text under [disabled] — mute the card the docs
65
+ // theme draws around it too, otherwise a disabled question still reads as live.
66
+ .igd-faq__item[disabled] {
67
+ --ig-expansion-panel-header-background: var(--igd-faq-disabled-bg);
68
+ --ig-expansion-panel-body-background: var(--igd-faq-disabled-bg);
69
+
70
+ border-color: var(--igd-faq-disabled-border-color);
71
+ }
72
+
73
+ // TYPOGRAPHY STYLES
74
+
75
+ // Type only — colour is inherited from the panel's [part=title] / [part=subtitle],
76
+ // which is what lets the disabled state grey them out. Setting `color` here
77
+ // would win over that inheritance and pin the text to its enabled colour.
78
+ .igd-faq__question {
79
+ @include type-style('h6') {
80
+ margin: 0;
81
+ }
82
+ }
83
+
84
+ .igd-faq__subtitle {
85
+ @include type-style('caption') {
86
+ margin: 0;
87
+ }
88
+ }
89
+
90
+ .igd-faq__answer {
91
+ @include type-style('body-2') {
92
+ margin: 0;
93
+ font-weight: 400;
94
+ }
95
+
96
+ // Colour inherited from :host { color: var(--body-color) } — bridged from
97
+ // --igd-faq-answer-color above.
98
+
99
+ // Long links / wide code samples must not stretch the panel.
100
+ overflow: auto;
101
+
102
+ > :last-child {
103
+ margin-block-end: 0;
104
+ }
105
+ }
@@ -0,0 +1,117 @@
1
+ ---
2
+ /**
3
+ * FaqItem — a single question / answer pair.
4
+ *
5
+ * Wraps <igc-expansion-panel> and exposes its public properties as props
6
+ * (`open`, `disabled`, `indicatorPosition`). Intended to be nested inside
7
+ * <Faq>, which owns the <igc-accordion> and the keyboard navigation.
8
+ *
9
+ * The question goes into the panel's `title` slot as a plain <span>: the
10
+ * panel header already carries `role="button"`, and a heading nested inside
11
+ * a button role is dropped from the accessibility tree anyway.
12
+ *
13
+ * The default slot is the answer. Pass `answer` instead when the content is
14
+ * a static HTML string (used by <Faq items={…}>).
15
+ */
16
+ import './Faq.scss';
17
+ import type { FaqIndicatorPosition } from './types';
18
+
19
+ export interface Props {
20
+ /** Header text — the question. Required. */
21
+ question: string;
22
+ /** Secondary header line rendered under the question. */
23
+ subtitle?: string;
24
+ /**
25
+ * Answer body as an HTML string. Rendered as the default slot's fallback,
26
+ * so slotted content always wins.
27
+ *
28
+ * SECURITY: injected verbatim via `set:html` — it is NOT sanitized. Only
29
+ * pass trusted, author-controlled markup. For untrusted or user-generated
30
+ * content use the default slot, which Astro escapes.
31
+ */
32
+ answer?: string;
33
+ /** Renders the panel expanded. @default false */
34
+ open?: boolean;
35
+ /** Non-interactive panel — skipped by accordion keyboard navigation. @default false */
36
+ disabled?: boolean;
37
+ /** Where the expand indicator sits. @default 'end' */
38
+ indicatorPosition?: FaqIndicatorPosition;
39
+ /** Extra CSS classes forwarded to the igc-expansion-panel element. */
40
+ class?: string;
41
+
42
+ // Pass-through attributes, enumerated rather than an open
43
+ // `[key: string]: unknown` index signature so a misspelt named prop
44
+ // (`indicatorPostion`) is still a type error.
45
+ /** Forwarded to the igc-expansion-panel element. */
46
+ id?: string;
47
+ 'aria-label'?: string;
48
+ 'aria-labelledby'?: string;
49
+ 'aria-describedby'?: string;
50
+ [key: `data-${string}`]: string | number | boolean | undefined;
51
+ }
52
+
53
+ const {
54
+ question,
55
+ subtitle,
56
+ answer,
57
+ open = false,
58
+ disabled = false,
59
+ indicatorPosition,
60
+ class: className,
61
+ ...rest
62
+ } = Astro.props;
63
+ ---
64
+
65
+ <igc-expansion-panel
66
+ class:list={['igd-faq__item', className]}
67
+ open={open ? '' : undefined}
68
+ disabled={disabled ? '' : undefined}
69
+ indicator-position={indicatorPosition ?? 'end'}
70
+ {...rest}
71
+ >
72
+ <span slot="title" class="igd-faq__question">{question}</span>
73
+ {
74
+ subtitle && (
75
+ <span slot="subtitle" class="igd-faq__subtitle">
76
+ {subtitle}
77
+ </span>
78
+ )
79
+ }
80
+
81
+ {
82
+ /*
83
+ Forward the panel's indicator slots so callers can swap the chevron.
84
+ The wrapper is required: `slot=` on an Astro <slot> only forwards to another
85
+ Astro component, not to a custom element's light DOM. It is rendered only
86
+ when content was passed — an empty wrapper would count as assigned content
87
+ and suppress the panel's default indicator.
88
+ */
89
+ }
90
+ {
91
+ Astro.slots.has('indicator') && (
92
+ <div slot="indicator" class="igd-faq__indicator">
93
+ <slot name="indicator" />
94
+ </div>
95
+ )
96
+ }
97
+ {
98
+ Astro.slots.has('indicator-expanded') && (
99
+ <div slot="indicator-expanded" class="igd-faq__indicator">
100
+ <slot name="indicator-expanded" />
101
+ </div>
102
+ )
103
+ }
104
+
105
+ {/* Slot content wins; `answer` is the fallback the data-driven API renders. */}
106
+ <div class="igd-faq__answer">
107
+ <slot>{answer && <Fragment set:html={answer} />}</slot>
108
+ </div>
109
+ </igc-expansion-panel>
110
+
111
+ <script>
112
+ // Only the panel — Faq.astro registers the accordion. Splitting the two
113
+ // keeps Astro from emitting two identical hoisted script bundles.
114
+ import { defineComponents, IgcExpansionPanelComponent } from 'igniteui-webcomponents';
115
+
116
+ defineComponents(IgcExpansionPanelComponent);
117
+ </script>
@@ -0,0 +1,223 @@
1
+ # Faq
2
+
3
+ Question / answer list built on `<igc-accordion>` +
4
+ `<igc-expansion-panel>` from `igniteui-webcomponents`.
5
+
6
+ Two components ship together:
7
+
8
+ - **`Faq.astro`** — owns the `<igc-accordion>` (grouping + keyboard navigation).
9
+ - **`FaqItem.astro`** — one `<igc-expansion-panel>`; the question is the header,
10
+ the default slot is the answer.
11
+
12
+ Styling is driven entirely by `--igd-faq-*` custom properties declared in
13
+ `src/styles/global/_variables.scss`. `Faq.scss` maps each of them onto the
14
+ corresponding `--ig-expansion-panel-*` theme property, so consumers never
15
+ touch the Ignite UI variables directly.
16
+
17
+ ## Usage — slot mode (preferred)
18
+
19
+ Rich answers: markdown, links, code blocks, other components.
20
+
21
+ ```astro
22
+ ---
23
+ import Faq from 'igniteui-astro-components/components/mdx/Faq.astro';
24
+ import FaqItem from 'igniteui-astro-components/components/mdx/FaqItem.astro';
25
+ ---
26
+
27
+ <Faq singleExpand>
28
+ <FaqItem question="How do I install the package?" open>
29
+ Run <code>npm install igniteui-webcomponents</code>.
30
+ </FaqItem>
31
+ <FaqItem question="Is it free?" subtitle="Licensing" indicatorPosition="end">
32
+ The core components are open source; some are part of a paid license.
33
+ </FaqItem>
34
+ </Faq>
35
+ ```
36
+
37
+ ## Usage — data mode
38
+
39
+ Short, static copy. `answer` is injected as an HTML string.
40
+
41
+ > **`answer` is not sanitized.** It goes straight through `set:html`, so pass
42
+ > only trusted, author-controlled markup. Anything untrusted or user-generated
43
+ > belongs in the default slot (slot mode), which Astro escapes.
44
+
45
+ ```astro
46
+ ---
47
+ import Faq from 'igniteui-astro-components/components/mdx/Faq.astro';
48
+ import type { FaqEntry } from 'igniteui-astro-components/components/mdx/Faq/types';
49
+
50
+ const items: FaqEntry[] = [
51
+ { question: 'How do I install the package?', answer: 'Run <code>npm i</code>.' },
52
+ { question: 'Is it free?', answer: 'The core components are open source.' },
53
+ ];
54
+ ---
55
+
56
+ <Faq {items} singleExpand indicatorPosition="end" />
57
+ ```
58
+
59
+ Both modes render into the same accordion, so they can be mixed — `items`
60
+ entries render first, slotted `<FaqItem>`s after.
61
+
62
+ ## Usage in MDX
63
+
64
+ Import the components in the MDX body, then use them as JSX. Leave a blank
65
+ line around markdown content so it is parsed as markdown rather than raw text.
66
+
67
+ ````mdx
68
+ ---
69
+ title: FAQ
70
+ ---
71
+
72
+ import Faq from 'igniteui-astro-components/components/mdx/Faq.astro';
73
+ import FaqItem from 'igniteui-astro-components/components/mdx/FaqItem.astro';
74
+
75
+ ## Frequently asked questions
76
+
77
+ <Faq singleExpand>
78
+ <FaqItem question="How do I install the package?" open>
79
+
80
+ Install it from npm:
81
+
82
+ ```bash
83
+ npm install igniteui-webcomponents
84
+ ```
85
+
86
+ </FaqItem>
87
+
88
+ <FaqItem question="Which browsers are supported?">
89
+
90
+ The last two versions of every evergreen browser. See the
91
+ [browser support](/getting-started) page.
92
+
93
+ </FaqItem>
94
+ </Faq>
95
+ ````
96
+
97
+ ## Props — `Faq`
98
+
99
+ | Prop | Type | Default | Notes |
100
+ | --------------------------------------------------- | ----------------------------- | ------- | -------------------------------------------------------------------------------- |
101
+ | `items` | `FaqEntry[]` | — | Data-driven entries. Omit for slot mode. |
102
+ | `singleExpand` | `boolean` | `false` | → `igc-accordion[single-expand]`. Only one answer open at once. |
103
+ | `indicatorPosition` | `'start' \| 'end' \| 'none'` | `end` | Applies to `items` entries only — see the note below. |
104
+ | `class` | `string` | — | Forwarded to `<igc-accordion>`. |
105
+ | `id` | `string` | — | Spread onto `<igc-accordion>`. |
106
+ | `aria-label`, `aria-labelledby`, `aria-describedby` | `string` | — | Spread onto `<igc-accordion>`. Typed for autocomplete — see the caveat below. |
107
+ | `data-*` | `string \| number \| boolean` | — | Spread onto `<igc-accordion>` via a ``[key: `data-${string}`]`` index signature. |
108
+
109
+ ## Props — `FaqItem`
110
+
111
+ | Prop | Type | Default | Notes |
112
+ | --------------------------------------------------- | ----------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
113
+ | `question` | `string` | — | Required. Rendered in the panel's `title` slot. |
114
+ | `subtitle` | `string` | — | Optional second header line (`subtitle` slot). |
115
+ | `answer` | `string` | — | HTML string answer, rendered as the slot's fallback — slotted content always wins. **Not sanitized**, see above. |
116
+ | `open` | `boolean` | `false` | → `igc-expansion-panel[open]`. |
117
+ | `disabled` | `boolean` | `false` | → `igc-expansion-panel[disabled]`. Skipped by keyboard nav. |
118
+ | `indicatorPosition` | `'start' \| 'end' \| 'none'` | `end` | → `igc-expansion-panel[indicator-position]`. |
119
+ | `class` | `string` | — | Forwarded to `<igc-expansion-panel>`. |
120
+ | `id` | `string` | — | Spread onto `<igc-expansion-panel>`. |
121
+ | `aria-label`, `aria-labelledby`, `aria-describedby` | `string` | — | Spread onto `<igc-expansion-panel>`. Typed for autocomplete — see the caveat below. |
122
+ | `data-*` | `string \| number \| boolean` | — | Spread onto `<igc-expansion-panel>` via a ``[key: `data-${string}`]`` index signature. |
123
+
124
+ `Props` deliberately has **no** open `[key: string]: unknown` index signature —
125
+ that is what keeps a misspelt `indicatorPostion` (or a stray `datatestid`) a
126
+ type error. Anything outside the rows above needs adding to `Props` first.
127
+
128
+ **Caveat:** TypeScript exempts JSX attribute names that are not valid JS
129
+ identifiers — i.e. every hyphenated name, so all `aria-*` and `data-*` — from
130
+ excess-property checking. A misspelt `aria-describedbyy` therefore passes
131
+ silently no matter what `Props` declares. The enumerated ARIA props exist for
132
+ autocomplete and intent, not enforcement; only identifier-style props
133
+ (`singleExpand`, `indicatorPosition`, `question`, …) are spell-checked by the
134
+ compiler.
135
+
136
+ The `indicator` and `indicator-expanded` slots are forwarded, so the default
137
+ chevron can be replaced per item:
138
+
139
+ ```astro
140
+ <FaqItem question="Custom indicator">
141
+ <igc-icon slot="indicator" name="chevron" collection="docs"></igc-icon>
142
+ Answer body.
143
+ </FaqItem>
144
+ ```
145
+
146
+ ### Why `indicatorPosition` on `Faq` only covers `items`
147
+
148
+ `indicator-position` is a property of each panel, and Astro cannot pass props
149
+ into slotted children at build time. In slot mode set it on each `<FaqItem>`;
150
+ in data mode `Faq` forwards its value (an entry's own `indicatorPosition`
151
+ wins).
152
+
153
+ ## Runtime API
154
+
155
+ `Faq` renders a real `<igc-accordion>`, so the library API is available on the
156
+ element itself:
157
+
158
+ ```ts
159
+ const faq = document.querySelector('igc-accordion.igd-faq')!;
160
+ faq.showAll();
161
+ faq.hideAll();
162
+ faq.singleExpand = true;
163
+ faq.panels; // IgcExpansionPanelComponent[]
164
+ ```
165
+
166
+ Each panel emits `igcOpening` / `igcOpened` / `igcClosing` / `igcClosed`.
167
+
168
+ ## Theming tokens
169
+
170
+ | Token | Purpose |
171
+ | --------------------------------- | ------------------------------------------ |
172
+ | `--igd-faq-gap` | Vertical gap between questions. |
173
+ | `--igd-faq-margin-bottom` | Space below the whole list. |
174
+ | `--igd-faq-spacing` | Density — see below. |
175
+ | `--igd-faq-border-*` | Width / style / colour / radius of a card. |
176
+ | `--igd-faq-open-border-color` | Border colour while a panel is open. |
177
+ | `--igd-faq-header-bg` | Question row background. |
178
+ | `--igd-faq-header-focus-bg` | Question row background on focus. |
179
+ | `--igd-faq-body-bg` | Answer background. |
180
+ | `--igd-faq-question-color` | Question text colour. |
181
+ | `--igd-faq-subtitle-color` | Subtitle text colour. |
182
+ | `--igd-faq-answer-color` | Answer text colour. |
183
+ | `--igd-faq-indicator-color` | Chevron colour. |
184
+ | `--igd-faq-disabled-color` | Question / chevron colour when disabled. |
185
+ | `--igd-faq-disabled-bg` | Card background when disabled. |
186
+ | `--igd-faq-disabled-border-color` | Card border when disabled. |
187
+
188
+ ### Never re-state a bridged colour in the light DOM
189
+
190
+ `Faq.scss` sets colours **only** as `--ig-expansion-panel-*` bridge values. The
191
+ panel paints `[part=title]`, `[part=subtitle]`, and `[part~=indicator]` from
192
+ those, and swaps them for `--disabled-text-color` under `:host([disabled])`.
193
+
194
+ Two things silently defeat that disabled state, so both are avoided:
195
+
196
+ - `color` on the slotted `.igd-faq__question` / `.igd-faq__subtitle` — an
197
+ explicit colour beats the inheritance coming from `[part=title]`.
198
+ - `::part(indicator) { color }` — outer-tree `::part()` rules always win over
199
+ the shadow tree's own rules, regardless of specificity.
200
+
201
+ If a colour looks wrong, change the `--igd-faq-*` token, never add a
202
+ declaration to the light-DOM element.
203
+
204
+ ### Density — why there is no padding token
205
+
206
+ `igc-expansion-panel` derives its header padding, body padding, and indicator
207
+ margin from the Ignite UI layout scale (`--ig-size`, `--ig-spacing`), and its
208
+ real body padding lives on `[part~=content] > slot` — an element that is not
209
+ an exposed CSS part. Overriding `::part(content) { padding }` therefore stacks
210
+ on top of the built-in padding instead of replacing it, and any hard-coded
211
+ `::part(header) { padding }` freezes the component at one density.
212
+
213
+ So the FAQ scales density instead of setting padding:
214
+
215
+ ```css
216
+ .my-faq {
217
+ --igd-faq-spacing: 0.75; /* 0 = flush, 1 = default, 2 = double */
218
+ }
219
+ ```
220
+
221
+ `--igd-faq-spacing` feeds `--ig-spacing` on each panel; `--ig-size` on the
222
+ panel (or an ancestor) still works as usual. Verified against the
223
+ `igniteui-theming` MCP (`theming://docs/spacing-and-sizing`).
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared types for the Faq / FaqItem pair.
3
+ *
4
+ * Kept in a plain module (instead of exported from Faq.astro) so FaqItem can
5
+ * import them without creating a circular component import.
6
+ */
7
+
8
+ /** Mirrors `ExpansionPanelIndicatorPosition` from igniteui-webcomponents. */
9
+ export type FaqIndicatorPosition = 'start' | 'end' | 'none';
10
+
11
+ /** A single question / answer pair in the data-driven `items` API. */
12
+ export interface FaqEntry {
13
+ /** Header text — the question. */
14
+ question: string;
15
+ /**
16
+ * Answer body as an HTML string. Rendered as the default slot's fallback,
17
+ * so slotted content always wins. Use slot mode for rich content.
18
+ *
19
+ * SECURITY: injected verbatim via `set:html` — it is NOT sanitized. Only
20
+ * pass trusted, author-controlled markup. For untrusted or user-generated
21
+ * content use the default slot, which Astro escapes.
22
+ */
23
+ answer?: string;
24
+ /** Secondary header line rendered under the question. */
25
+ subtitle?: string;
26
+ /** Renders the panel expanded. @default false */
27
+ open?: boolean;
28
+ /** Non-interactive panel. @default false */
29
+ disabled?: boolean;
30
+ /** Overrides the list-level `indicatorPosition` for this entry. */
31
+ indicatorPosition?: FaqIndicatorPosition;
32
+ /** Forwarded to the `<igc-expansion-panel>` element. */
33
+ id?: string;
34
+ }
@@ -13,12 +13,13 @@
13
13
  import type { PlatformContext } from '../../../lib/types';
14
14
 
15
15
  interface Props {
16
- /** Comma-separated list of platform names to show content for. */
17
- for: string;
16
+ /** Comma-separated list of platform names to show content for. */
17
+ for: string;
18
18
  }
19
19
 
20
20
  const { for: forProp } = Astro.props;
21
21
  const allowed = forProp.split(',').map((s) => s.trim());
22
22
  const { name } = Astro.locals.platformContext as PlatformContext;
23
23
  ---
24
+
24
25
  {allowed.includes(name) && <slot />}
@@ -10,8 +10,8 @@ import PlatformBlock from 'igniteui-astro-components/components/mdx/PlatformBloc
10
10
 
11
11
  ## Props
12
12
 
13
- | Prop | Type | Description |
14
- |------|------|-------------|
13
+ | Prop | Type | Description |
14
+ | ----- | -------- | ----------------------------------------------------------- |
15
15
  | `for` | `string` | Comma-separated list of platform names to show content for. |
16
16
 
17
17
  Valid platform names: `Angular`, `React`, `WebComponents`, `Blazor`
@@ -20,14 +20,12 @@ Valid platform names: `Angular`, `React`, `WebComponents`, `Blazor`
20
20
 
21
21
  ```mdx
22
22
  {/* Single platform */}
23
- <PlatformBlock for="Angular">
24
- This paragraph only appears in Angular docs.
25
- </PlatformBlock>
23
+
24
+ <PlatformBlock for="Angular">This paragraph only appears in Angular docs.</PlatformBlock>
26
25
 
27
26
  {/* Multiple platforms */}
28
- <PlatformBlock for="Angular, React">
29
- Visible in Angular and React docs only.
30
- </PlatformBlock>
27
+
28
+ <PlatformBlock for="Angular, React">Visible in Angular and React docs only.</PlatformBlock>
31
29
 
32
30
  {/* All platforms (just write the content without PlatformBlock) */}
33
31
  ```
@@ -10,33 +10,38 @@ import Sample from 'igniteui-astro-components/components/mdx/Sample.astro';
10
10
 
11
11
  ## Props
12
12
 
13
- | Prop | Type | Default | Description |
14
- |------|------|---------|-------------|
15
- | `src` | `string` | *(required)* | Sample path relative to the demos base URL, e.g. `"/charts/data-chart/axis-crossing"`. |
16
- | `height` | `number` | `400` | iframe height in pixels. |
17
- | `alt` | `string` | `''` | `title` attribute for the iframe (accessibility). |
18
- | `lob` | `boolean` | `false` | Use `lobDemosBaseUrl` instead of `demosBaseUrl` (LOB/grid-dynamic demos). |
19
- | `dv` | `boolean` | `false` | Force use of `dvDemosBaseUrl` (data-viz demos). Auto-detected for paths starting with `charts/`, `gauges/`, `maps/`, `excel/`. |
20
- | `crm` | `boolean` | `false` | Use `crmDemoBaseUrl` (CRM demo samples). |
21
- | `iframeOnly` | `boolean` | `false` | Render only the iframe — no navbar, no code tabs, no live-edit footer. |
22
- | `fullscreenBtn` | `boolean` | `false` | When `iframeOnly={true}`, also renders a "View in full screen" button below the iframe. |
13
+ | Prop | Type | Default | Description |
14
+ | --------------- | --------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
15
+ | `src` | `string` | _(required)_ | Sample path relative to the demos base URL, e.g. `"/charts/data-chart/axis-crossing"`. |
16
+ | `height` | `number` | `400` | iframe height in pixels. |
17
+ | `alt` | `string` | `''` | `title` attribute for the iframe (accessibility). |
18
+ | `lob` | `boolean` | `false` | Use `lobDemosBaseUrl` instead of `demosBaseUrl` (LOB/grid-dynamic demos). |
19
+ | `dv` | `boolean` | `false` | Force use of `dvDemosBaseUrl` (data-viz demos). Auto-detected for paths starting with `charts/`, `gauges/`, `maps/`, `excel/`. |
20
+ | `crm` | `boolean` | `false` | Use `crmDemoBaseUrl` (CRM demo samples). |
21
+ | `iframeOnly` | `boolean` | `false` | Render only the iframe — no navbar, no code tabs, no live-edit footer. |
22
+ | `fullscreenBtn` | `boolean` | `false` | When `iframeOnly={true}`, also renders a "View in full screen" button below the iframe. |
23
23
 
24
24
  ## Examples
25
25
 
26
26
  ```mdx
27
27
  {/* Standard widget */}
28
+
28
29
  <Sample src="/charts/data-chart/axis-crossing" height={500} alt="Angular Data Chart Example" />
29
30
 
30
31
  {/* DV sample (auto-detected) */}
32
+
31
33
  <Sample src="/gauges/radial-gauge/needle" height={350} />
32
34
 
33
35
  {/* LOB demo */}
36
+
34
37
  <Sample src="/grid/grid/filtering" lob />
35
38
 
36
39
  {/* Bare iframe for embedding */}
40
+
37
41
  <Sample src="/charts/bar-chart/overview" iframeOnly height={300} />
38
42
 
39
43
  {/* Bare iframe + fullscreen link */}
44
+
40
45
  <Sample src="/charts/bar-chart/overview" iframeOnly fullscreenBtn height={300} />
41
46
  ```
42
47
 
@@ -44,12 +49,12 @@ import Sample from 'igniteui-astro-components/components/mdx/Sample.astro';
44
49
 
45
50
  The base URLs are resolved from `environment.json` at build time via `siteMetaIntegration` and exposed through `getPlatformContext().getEnvVars()`:
46
51
 
47
- | Key | Used by |
48
- |-----|---------|
49
- | `demosBaseUrl` | Default demos |
50
- | `dvDemosBaseUrl` | Charts / gauges / maps / excel |
51
- | `lobDemosBaseUrl` | LOB / grids |
52
- | `crmDemoBaseUrl` | CRM demos |
52
+ | Key | Used by |
53
+ | ----------------- | ------------------------------ |
54
+ | `demosBaseUrl` | Default demos |
55
+ | `dvDemosBaseUrl` | Charts / gauges / maps / excel |
56
+ | `lobDemosBaseUrl` | LOB / grids |
57
+ | `crmDemoBaseUrl` | CRM demos |
53
58
 
54
59
  ## Code highlighting
55
60