igniteui-astro-components 1.7.0 → 1.8.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 (60) hide show
  1. package/README.md +322 -158
  2. package/llms-full.txt +3216 -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 +77 -0
  7. package/src/code-theme/index.ts +76 -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 +71 -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 +162 -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
@@ -1,6 +1,6 @@
1
1
  # DocsAside
2
2
 
3
- Renders a styled callout block (note, tip, warning, or danger) with a type-specific icon, color accent, and accessible label. Use it in MDX pages to surface important information inline.
3
+ Renders a styled callout block (note, info or warning) with a type-specific icon, colour accent and accessible label. Use it in MDX pages to surface important information inline.
4
4
 
5
5
  ## Import
6
6
 
@@ -10,13 +10,15 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
10
10
 
11
11
  ## Props
12
12
 
13
- | Prop | Type | Default | Description |
14
- | ------- | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------- |
15
- | `type` | `'note' \| 'tip' \| 'warning' \| '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`, `Warning`, `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. |
13
+ | Prop | Type | Default | Description |
14
+ | ------- | ------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
15
+ | `type` | `'note' \| 'info' \| 'warning'` | `'note'` | Semantic variant — controls the colour accent, the default title and the default icon. |
16
+ | `title` | `string` | auto | Override the heading text. Defaults to `Note`, `Info` or `Warning`. |
17
+ | `icon` | `string` | auto | Name of an icon registered in the `docs` collection (`src/scripts/icon-manifest.ts`). Pass `""` to hide the icon. |
18
+ | `class` | `string` | — | Additional CSS class(es) added to the container. |
19
+
20
+ The component also declares a `color` prop, but nothing reads it (issue #162); use the CSS
21
+ custom properties below to change the accent instead.
20
22
 
21
23
  ## Examples
22
24
 
@@ -25,9 +27,9 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
25
27
 
26
28
  <DocsAside>This is a general note.</DocsAside>
27
29
 
28
- {/* Tip variant */}
30
+ {/* Info */}
29
31
 
30
- <DocsAside type="tip">Use keyboard shortcuts to speed up your workflow.</DocsAside>
32
+ <DocsAside type="info">The grid virtualises rows by default.</DocsAside>
31
33
 
32
34
  {/* Warning with custom title */}
33
35
 
@@ -35,32 +37,48 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
35
37
  The `foo` prop was removed in v2. Use `bar` instead.
36
38
  </DocsAside>
37
39
 
38
- {/* Danger */}
40
+ {/* No icon */}
39
41
 
40
- <DocsAside type="danger">Deleting this record is irreversible.</DocsAside>
42
+ <DocsAside type="info" icon="">
43
+ This callout has no icon.
44
+ </DocsAside>
45
+ ```
41
46
 
42
- {/* Custom accent color */}
47
+ ## Variants
43
48
 
44
- <DocsAside type="note" color="hsl(280, 80%, 50%)">
45
- A purple-accented callout.
46
- </DocsAside>
49
+ | `type` | Accent | Default title |
50
+ | --------- | ----------------- | ------------- |
51
+ | `note` | Gray | Note |
52
+ | `info` | Primary (blue) | Info |
53
+ | `warning` | Secondary (amber) | Warning |
47
54
 
48
- {/* No icon */}
55
+ ## Markup
49
56
 
50
- <DocsAside type="tip" icon="">
51
- This tip has no icon.
52
- </DocsAside>
57
+ ```html
58
+ <div class="igd-aside igd-aside--info" role="note" aria-label="Info">
59
+ <igc-icon class="igd-aside__icon" name="info" collection="docs" aria-hidden="true"></igc-icon>
60
+ <span class="igd-aside__title" aria-hidden="true">Info</span>
61
+ <div class="igd-aside__content">…</div>
62
+ </div>
53
63
  ```
54
64
 
55
- ## Variants
65
+ ## Styling
66
+
67
+ Layout tokens, defined on `:root` in `src/styles/global/_variables.scss`:
68
+
69
+ ```
70
+ --igd-aside-padding --igd-aside-row-gap --igd-aside-column-gap
71
+ --igd-aside-border-width --igd-aside-border-style --igd-aside-border-radius
72
+ --igd-aside-margin-bottom
73
+ ```
74
+
75
+ Per-variant colour tokens, one set each for `note`, `info` and `warning`:
56
76
 
57
- | `type` | Accent color | Default title |
58
- | --------- | ------------ | ------------- |
59
- | `note` | Blue | Note |
60
- | `tip` | Green | Tip |
61
- | `warning` | Amber | Warning |
62
- | `danger` | Red | Danger |
77
+ ```
78
+ --igd-aside-{type}-bg --igd-aside-{type}-border --igd-aside-{type}-title
79
+ --igd-aside-{type}-content --igd-aside-{type}-icon
80
+ ```
63
81
 
64
- ## Icons
82
+ `--igd-aside-{type}-code-background` is declared in `_variables.scss` but no stylesheet reads it yet.
65
83
 
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`.
84
+ Each colour token uses `light-dark()` so it follows the page's `data-theme`.
@@ -62,19 +62,17 @@ const { items, singleExpand = false, indicatorPosition, class: className, ...res
62
62
  single-expand={singleExpand ? '' : undefined}
63
63
  {...rest}
64
64
  >
65
- {
66
- items?.map((item) => (
67
- <FaqItem
68
- question={item.question}
69
- subtitle={item.subtitle}
70
- answer={item.answer}
71
- open={item.open}
72
- disabled={item.disabled}
73
- indicatorPosition={item.indicatorPosition ?? indicatorPosition}
74
- id={item.id}
75
- />
76
- ))
77
- }
65
+ {items?.map((item) => (
66
+ <FaqItem
67
+ question={item.question}
68
+ subtitle={item.subtitle}
69
+ answer={item.answer}
70
+ open={item.open}
71
+ disabled={item.disabled}
72
+ indicatorPosition={item.indicatorPosition ?? indicatorPosition}
73
+ id={item.id}
74
+ />
75
+ ))}
78
76
  <slot />
79
77
  </igc-accordion>
80
78
 
@@ -69,38 +69,32 @@ const {
69
69
  indicator-position={indicatorPosition ?? 'end'}
70
70
  {...rest}
71
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
- }
72
+ <span slot="title" class="igd-faq__question">
73
+ {question}
74
+ </span>
75
+ {subtitle && (
76
+ <span slot="subtitle" class="igd-faq__subtitle">
77
+ {subtitle}
78
+ </span>
79
+ )}
80
80
 
81
- {
82
- /*
81
+ {/*
83
82
  Forward the panel's indicator slots so callers can swap the chevron.
84
83
  The wrapper is required: `slot=` on an Astro <slot> only forwards to another
85
84
  Astro component, not to a custom element's light DOM. It is rendered only
86
85
  when content was passed — an empty wrapper would count as assigned content
87
86
  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
- }
87
+ */}
88
+ {Astro.slots.has('indicator') && (
89
+ <div slot="indicator" class="igd-faq__indicator">
90
+ <slot name="indicator" />
91
+ </div>
92
+ )}
93
+ {Astro.slots.has('indicator-expanded') && (
94
+ <div slot="indicator-expanded" class="igd-faq__indicator">
95
+ <slot name="indicator-expanded" />
96
+ </div>
97
+ )}
104
98
 
105
99
  {/* Slot content wins; `answer` is the fallback the data-driven API renders. */}
106
100
  <div class="igd-faq__answer">
@@ -0,0 +1,126 @@
1
+ ---
2
+ /** "Check it out in our free Figma UI kits" banner that links a topic to the Ignite UI kits in Figma. */
3
+ import { navLang } from 'virtual:docs-template/site-meta';
4
+ import figmaLogo from '../../../assets/icons/figma-logo.svg?raw';
5
+ import openLinkIcon from '../../../assets/icons/open-link-blank.svg?raw';
6
+ import { DEFAULT_FIGMA_UI_KITS, type FigmaUiKit } from './kits';
7
+ import './FigmaUiKits.scss';
8
+
9
+ interface Props {
10
+ /**
11
+ * One link per kit, in display order.
12
+ * @default the Material, Fluent, Bootstrap and Indigo kits (`DEFAULT_FIGMA_UI_KITS`)
13
+ */
14
+ kits?: FigmaUiKit[];
15
+ /**
16
+ * Text before the links.
17
+ * @default 'Check it out in our free Figma UI kits' (localized for jp / kr)
18
+ */
19
+ title?: string;
20
+ /**
21
+ * Text for the compact (mobile) layout. Defaults to `title` when that is set.
22
+ * @default 'Check it in our free Figma UI kits' (jp / kr: same as `title`)
23
+ */
24
+ compactTitle?: string;
25
+ /**
26
+ * `'auto'` wraps to fit and uses the compact layout below 480px; `'compact'` always does.
27
+ * @default 'auto'
28
+ */
29
+ variant?: 'auto' | 'compact';
30
+ /** Extra class(es) for the container. */
31
+ class?: string;
32
+ }
33
+
34
+ interface Text {
35
+ title: string;
36
+ compactTitle: string;
37
+ kit: string;
38
+ newTab: string;
39
+ }
40
+
41
+ const JAPANESE: Text = {
42
+ title: '無料の Figma UI キットでチェック',
43
+ compactTitle: '無料の Figma UI キットでチェック',
44
+ kit: 'Figma UI キット',
45
+ newTab: '(新しいタブで開きます)',
46
+ };
47
+
48
+ const KOREAN: Text = {
49
+ title: '무료 Figma UI 키트에서 확인하세요',
50
+ compactTitle: '무료 Figma UI 키트에서 확인하세요',
51
+ kit: 'Figma UI 키트',
52
+ newTab: '(새 탭에서 열림)',
53
+ };
54
+
55
+ // Default copy per site language; unknown languages use English.
56
+ const DEFAULT_TEXT: Record<string, Text> = {
57
+ en: {
58
+ title: 'Check it out in our free Figma UI kits',
59
+ compactTitle: 'Check it in our free Figma UI kits',
60
+ kit: 'Figma UI kit',
61
+ newTab: '(opens in a new tab)',
62
+ },
63
+ jp: JAPANESE,
64
+ ja: JAPANESE,
65
+ kr: KOREAN,
66
+ ko: KOREAN,
67
+ };
68
+
69
+ const lang = (navLang ?? Astro.currentLocale ?? 'en').toLowerCase();
70
+ const defaults = DEFAULT_TEXT[lang] ?? DEFAULT_TEXT.en;
71
+
72
+ const {
73
+ kits = DEFAULT_FIGMA_UI_KITS,
74
+ title = defaults.title,
75
+ variant = 'auto',
76
+ class: className,
77
+ } = Astro.props;
78
+ const compactTitle =
79
+ Astro.props.compactTitle ?? (Astro.props.title === undefined ? defaults.compactTitle : title);
80
+
81
+ if (kits.length === 0) {
82
+ throw new Error('<FigmaUiKits> requires at least one kit.');
83
+ }
84
+ for (const kit of kits) {
85
+ if (!kit.label?.trim() || !kit.href?.trim()) {
86
+ throw new Error('<FigmaUiKits> requires every kit to have a non-empty `label` and `href`.');
87
+ }
88
+ }
89
+ ---
90
+
91
+ <div class:list={['igd-figma-kits', className]} data-variant={variant}>
92
+ <div class="igd-figma-kits__banner">
93
+ <p class="igd-figma-kits__heading">
94
+ <span class="igd-figma-kits__logo" aria-hidden="true" set:html={figmaLogo} />
95
+ <span class="igd-figma-kits__text">
96
+ {/* Both texts render when they differ; CSS shows one per layout. */}
97
+ <span class="igd-figma-kits__title">
98
+ {compactTitle === title ? (
99
+ title
100
+ ) : (
101
+ <>
102
+ <span class="igd-figma-kits__title-full">{title}</span>
103
+ <span class="igd-figma-kits__title-compact">{compactTitle}</span>
104
+ </>
105
+ )}
106
+ </span>
107
+ </span>
108
+ </p>
109
+
110
+ {/* role="list" keeps the list announced in Safari VoiceOver. */}
111
+ <ul class="igd-figma-kits__list" role="list">
112
+ {kits.map((kit) => (
113
+ <li class="igd-figma-kits__item">
114
+ <a class="igd-figma-kits__link" href={kit.href} target="_blank" rel="noopener noreferrer">
115
+ {kit.label}
116
+ <span class="igd-figma-kits__sr-only">
117
+ {' '}
118
+ {defaults.kit} {defaults.newTab}
119
+ </span>
120
+ <span class="igd-figma-kits__icon" aria-hidden="true" set:html={openLinkIcon} />
121
+ </a>
122
+ </li>
123
+ ))}
124
+ </ul>
125
+ </div>
126
+ </div>
@@ -0,0 +1,165 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+
3
+ // Values come from the --igd-figma-kits-* tokens in global/_variables.scss.
4
+
5
+ .igd-figma-kits {
6
+ container: igd-figma-kits / inline-size;
7
+ inline-size: 100%;
8
+ margin: 0 0 var(--igd-figma-kits-margin-bottom);
9
+ }
10
+
11
+ .igd-figma-kits__banner {
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ gap: var(--igd-figma-kits-row-gap) var(--igd-figma-kits-gap);
17
+ padding: var(--igd-figma-kits-padding-block) var(--igd-figma-kits-padding-inline);
18
+ background: var(--igd-figma-kits-bg);
19
+ border: var(--igd-figma-kits-border-width) var(--igd-figma-kits-border-style)
20
+ var(--igd-figma-kits-border-color);
21
+ border-radius: var(--igd-figma-kits-radius);
22
+ }
23
+
24
+ .igd-figma-kits__heading {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: var(--igd-figma-kits-item-gap);
28
+ margin: 0;
29
+ min-inline-size: 0;
30
+ }
31
+
32
+ // Logo and link icon: the SVG fills the wrapper's height, width follows its viewBox.
33
+ .igd-figma-kits__logo,
34
+ .igd-figma-kits__icon {
35
+ display: block;
36
+ flex: none;
37
+
38
+ svg {
39
+ display: block;
40
+ inline-size: auto;
41
+ block-size: 100%;
42
+ }
43
+ }
44
+
45
+ .igd-figma-kits__logo {
46
+ block-size: var(--igd-figma-kits-logo-size);
47
+ }
48
+
49
+ .igd-figma-kits__icon {
50
+ block-size: 1lh;
51
+ }
52
+
53
+ .igd-figma-kits__text {
54
+ min-inline-size: 0;
55
+ }
56
+
57
+ .igd-figma-kits__list {
58
+ display: flex;
59
+ flex-wrap: wrap;
60
+ align-items: center;
61
+ gap: var(--igd-figma-kits-row-gap) var(--igd-figma-kits-gap);
62
+ margin: 0;
63
+ padding: 0;
64
+ list-style: none;
65
+ }
66
+
67
+ .igd-figma-kits__item {
68
+ margin: 0;
69
+ padding: 0;
70
+ }
71
+
72
+ .igd-figma-kits__link {
73
+ display: inline-flex;
74
+ align-items: center;
75
+ gap: var(--igd-figma-kits-item-gap);
76
+ min-block-size: var(--igd-figma-kits-target-size);
77
+ vertical-align: middle;
78
+ border-radius: var(--igd-figma-kits-radius);
79
+ text-decoration: none;
80
+
81
+ // Hide the markdown external-link icon; the link renders its own.
82
+ &::after {
83
+ content: none;
84
+ }
85
+
86
+ &:hover {
87
+ text-decoration: underline;
88
+ text-underline-offset: var(--igd-figma-kits-underline-offset);
89
+ }
90
+
91
+ &:focus-visible {
92
+ outline: var(--igd-figma-kits-focus-width) solid currentColor;
93
+ outline-offset: var(--igd-figma-kits-focus-offset);
94
+ }
95
+ }
96
+
97
+ // Visually hidden, still read by screen readers.
98
+ .igd-figma-kits__sr-only {
99
+ position: absolute;
100
+ inline-size: 1px;
101
+ block-size: 1px;
102
+ padding: 0;
103
+ margin: -1px;
104
+ overflow: hidden;
105
+ clip-path: inset(50%);
106
+ white-space: nowrap;
107
+ border: 0;
108
+ }
109
+
110
+ .igd-figma-kits__title-compact {
111
+ display: none;
112
+ }
113
+
114
+ // Compact layout: title over links, compact padding, mobile text.
115
+ @mixin compact {
116
+ .igd-figma-kits__banner {
117
+ flex-direction: column;
118
+ align-items: stretch;
119
+ padding: var(--igd-figma-kits-compact-padding-block)
120
+ var(--igd-figma-kits-compact-padding-inline);
121
+ }
122
+
123
+ .igd-figma-kits__title-full {
124
+ display: none;
125
+ }
126
+
127
+ .igd-figma-kits__title-compact {
128
+ display: inline;
129
+ }
130
+ }
131
+
132
+ .igd-figma-kits[data-variant='compact'] {
133
+ @include compact;
134
+ }
135
+
136
+ // Phone layout: title over links, tighter padding, mobile text.
137
+ @container igd-figma-kits (width < 480px) {
138
+ .igd-figma-kits {
139
+ @include compact;
140
+ }
141
+ }
142
+
143
+ // TYPOGRAPHY
144
+
145
+ .igd-figma-kits__title {
146
+ @include type-style('body-1') {
147
+ margin: 0;
148
+ }
149
+
150
+ color: var(--igd-figma-kits-title-color);
151
+ }
152
+
153
+ .igd-figma-kits__link {
154
+ @include type-style('body-2') {
155
+ margin: 0;
156
+ font-weight: var(--igd-figma-kits-link-weight);
157
+ }
158
+
159
+ color: var(--igd-figma-kits-link-color);
160
+
161
+ &:hover,
162
+ &:focus-visible {
163
+ color: var(--igd-figma-kits-link-hover-color);
164
+ }
165
+ }
@@ -0,0 +1,115 @@
1
+ # FigmaUiKits
2
+
3
+ Renders the "Check it out in our free Figma UI kits" call-to-action banner that links a component topic to the Ignite UI kits in Figma. It belongs between a topic's description and its live demo.
4
+
5
+ It links to the Indigo.Design UI kits for Material, Fluent, Bootstrap and Indigo out of the box, so a topic only needs `<FigmaUiKits />`. When a kit is republished, update its URL once in `kits.ts` (`DEFAULT_FIGMA_UI_KITS`) and every topic picks it up.
6
+
7
+ ## Import
8
+
9
+ ```astro
10
+ import FigmaUiKits from 'igniteui-astro-components/components/mdx/FigmaUiKits.astro';
11
+ ```
12
+
13
+ ## Props
14
+
15
+ | Prop | Type | Default | Description |
16
+ | -------------- | --------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------ |
17
+ | `kits` | `FigmaUiKit[]` | `DEFAULT_FIGMA_UI_KITS` | One link per kit, in display order. Each is `{ label: string; href: string }`. |
18
+ | `title` | `string` | `'Check it out in our free Figma UI kits'` | Text before the links. Localized by default. |
19
+ | `compactTitle` | `string` | `'Check it in our free Figma UI kits'` | Text for the compact (mobile) layout. Defaults to `title` when that is set. |
20
+ | `variant` | `'auto' \| 'compact'` | `'auto'` | `'auto'` wraps to fit and uses the compact layout on narrow containers; `'compact'` always does. |
21
+ | `class` | `string` | — | Extra CSS classes for the container. |
22
+
23
+ It throws at build time when `kits` is an empty array or a kit has an empty `label` or `href`.
24
+
25
+ `kits.ts` exports the `FigmaUiKit` type and `DEFAULT_FIGMA_UI_KITS`. Pass `kits` only to show a different set, for example a single kit on a theme-specific topic:
26
+
27
+ ```astro
28
+ ---
29
+ import FigmaUiKits from 'igniteui-astro-components/components/mdx/FigmaUiKits.astro';
30
+ import { DEFAULT_FIGMA_UI_KITS } from 'igniteui-astro-components/components/mdx/FigmaUiKits/kits';
31
+
32
+ const materialOnly = DEFAULT_FIGMA_UI_KITS.filter((kit) => kit.label === 'Material');
33
+ ---
34
+
35
+ <FigmaUiKits kits={materialOnly} />
36
+ ```
37
+
38
+ Give every kit its own URL: several links with different names but the same destination fail WCAG 2.4.4 (link purpose).
39
+
40
+ ## Layout
41
+
42
+ - **One row** when it fits: the Figma logo and title at the start, the links at the end.
43
+ - **Wrapped** when it doesn't: flexbox moves the whole link list to a second row. Nothing switches at a fixed width, so the banner adapts to the copy, the font and the language. For example, the English row needs about 744px, Japanese 737px and Korean 717px.
44
+ - **Compact** below 480px (a phone): the text changes to "Check it in our free Figma UI kits", the links stack under it, and the padding tightens. This is a container query on the banner, so it follows the width the banner is given, not the viewport. `variant="compact"` uses this layout at any width.
45
+
46
+ The outer `.igd-figma-kits` element is the query container and the inner `.igd-figma-kits__banner` is the visible frame, because a container can't restyle itself from its own query. The container has `inline-size: 100%` because size containment ignores its content's width, so it would otherwise collapse inside a shrink-to-fit parent.
47
+
48
+ ## Examples
49
+
50
+ ```mdx
51
+ {/* Default: the four kits */}
52
+
53
+ <FigmaUiKits />
54
+
55
+ {/* Always compact */}
56
+
57
+ <FigmaUiKits variant="compact" />
58
+
59
+ {/* Custom wording */}
60
+
61
+ <FigmaUiKits title="Start from a ready-made kit" />
62
+ ```
63
+
64
+ ## Localization
65
+
66
+ The default `title` and `compactTitle` and the hidden link text follow the site language. The language comes from the docs integration's `navLang` (from `virtual:docs-template/site-meta`), then `Astro.currentLocale`, then English. Kit names are product names and are not translated.
67
+
68
+ | Language | `title` | `compactTitle` | Kit link name read out |
69
+ | -------------- | -------------------------------------- | ---------------------------------- | ----------------------------------------------- |
70
+ | `en` (default) | Check it out in our free Figma UI kits | Check it in our free Figma UI kits | Material Figma UI kit (opens in a new tab) |
71
+ | `jp` / `ja` | 無料の Figma UI キットでチェック | Same as `title` | Material Figma UI キット (新しいタブで開きます) |
72
+ | `kr` / `ko` | 무료 Figma UI 키트에서 확인하세요 | Same as `title` | Material Figma UI 키트 (새 탭에서 열림) |
73
+
74
+ ## Accessibility
75
+
76
+ - Every link opens in a new tab and says so in visually hidden text. Each link also names what it opens, so "Material Figma UI kit (opens in a new tab)" makes sense in a screen reader's links list. The external-link icon and the Figma logo are `aria-hidden`.
77
+ - The links are a real `<ul>` with `role="list"`, so assistive tech announces how many there are. The explicit role is needed because Safari drops list semantics from a list styled with `list-style: none`.
78
+ - The banner is a plain `<div>`, not an `<aside>` or `<nav>`. It repeats on every topic, and a landmark on every page would clutter the landmark list.
79
+ - Links meet the WCAG 2.2 target size and have a visible `:focus-visible` outline. They use the same colours as markdown links (`--igd-link-color`: 5.25:1 on the page and 4.77:1 on the banner in light mode, 12.5:1 or more in dark mode).
80
+ - In forced-colors mode the frame keeps a `CanvasText` border.
81
+ - The hidden-text class is a local copy of the standard sr-only pattern. Switch to the shared `.visually-hidden` once #177 is fixed.
82
+
83
+ ## Icons
84
+
85
+ Both icons come from `src/assets/icons/` and are inlined at build time with `?raw` and `set:html`, so the banner needs no client JavaScript:
86
+
87
+ - `open-link-blank.svg` is the same external-link icon that markdown links use.
88
+ - `figma-logo.svg` draws the logo on its white tile, so the brand colours stay in the asset. It is listed under Brand in the icon gallery.
89
+
90
+ ## Styling
91
+
92
+ The styles are unlayered, so they win over the `@layer components` markdown styles. Those style every `p`, `ul`, `li` and `a`, and add an icon after `a[target=_blank]`.
93
+
94
+ All values are `--igd-figma-kits-*` tokens on `:root` in `src/styles/global/_variables.scss`. Override them on an ancestor or through `class`:
95
+
96
+ | Token | Default |
97
+ | ---------------------------------------------------- | ------------------------------------------------------------------------- |
98
+ | `--igd-figma-kits-padding-block` / `-inline` | Regular padding; inline is `--igd-padding-sm` |
99
+ | `--igd-figma-kits-compact-padding-block` / `-inline` | Compact (phone) padding |
100
+ | `--igd-figma-kits-gap` | `--igd-padding-md`, between links and title ↔ links |
101
+ | `--igd-figma-kits-row-gap` | Gap between rows once the banner wraps |
102
+ | `--igd-figma-kits-item-gap` | Logo ↔ title and label ↔ icon |
103
+ | `--igd-figma-kits-margin-bottom` | Same as the other blocks (aside, FAQ, code) |
104
+ | `--igd-figma-kits-radius` | `--igd-border-radius` |
105
+ | `--igd-figma-kits-border-width` / `-style` | `--igd-app-outline-size` / `-style` |
106
+ | `--igd-figma-kits-logo-size` | Logo height |
107
+ | `--igd-figma-kits-target-size` | Minimum link height |
108
+ | `--igd-figma-kits-underline-offset` | Hover underline offset |
109
+ | `--igd-figma-kits-focus-width` / `-offset` | Focus outline |
110
+ | `--igd-figma-kits-link-weight` | Link font weight |
111
+ | `--igd-figma-kits-bg` / `-border-color` | `gray-100` / `gray-300` light, `gray-50` / `gray-200` dark |
112
+ | `--igd-figma-kits-title-color` | `gray-600` |
113
+ | `--igd-figma-kits-link-color` / `-link-hover-color` | `--igd-link-color` / `--igd-link-hover-color`, shared with markdown links |
114
+
115
+ The dark gray scale is inverted, so `gray-50` and `gray-200` are the dark counterparts of the light `gray-100` and `gray-300`.
@@ -0,0 +1,26 @@
1
+ export interface FigmaUiKit {
2
+ /** Visible link text: the theme name, e.g. `Material`. */
3
+ label: string;
4
+ /** Absolute URL of that kit's Figma Community file. */
5
+ href: string;
6
+ }
7
+
8
+ /** The Indigo.Design UI kits in the Figma Community, one per theme. */
9
+ export const DEFAULT_FIGMA_UI_KITS: FigmaUiKit[] = [
10
+ {
11
+ label: 'Material',
12
+ href: 'https://www.figma.com/community/file/1185626590778033159/indigo-design-ui-kit-for-material-1-6',
13
+ },
14
+ {
15
+ label: 'Fluent',
16
+ href: 'https://www.figma.com/community/file/1462017953809232530/indigo-design-ui-kit-for-fluent-1-6',
17
+ },
18
+ {
19
+ label: 'Bootstrap',
20
+ href: 'https://www.figma.com/community/file/1462018085772322451/indigo-design-ui-kit-for-bootstrap-1-6',
21
+ },
22
+ {
23
+ label: 'Indigo',
24
+ href: 'https://www.figma.com/community/file/1462018383079963285/indigo-design-ui-kit-for-indigo-1-6',
25
+ },
26
+ ];
@@ -32,24 +32,11 @@ Valid platform names: `Angular`, `React`, `WebComponents`, `Blazor`
32
32
 
33
33
  ## Platform context
34
34
 
35
- The active platform is read from the `PLATFORM` environment variable via `getPlatformContext()`. Set it in `astro.config.ts`:
35
+ The active platform is `Astro.locals.platformContext.name`, set by the host site's middleware (see the root README, Quick start step 3). Names in `for` must match `platformContext.name` exactly (`Angular`, `React`, `WebComponents`, `Blazor`, `WinUI`, `Uno`). Without the middleware the render throws, because the component destructures the context.
36
36
 
37
- ```ts
38
- createDocsSite({ platform: 'angular' });
39
- // → only <PlatformBlock for="Angular"> blocks render
40
- ```
41
-
42
- Or in the environment directly:
43
-
44
- ```sh
45
- PLATFORM=React astro build
46
- ```
47
-
48
- ## MDX global registration
37
+ The xplat docs build additionally inlines and strips `<PlatformBlock>` at build time (a Vite plugin in that repo), so the component never reaches the browser there.
49
38
 
50
- To avoid importing `PlatformBlock` in every MDX file, register it globally in `mdx-components.ts`:
39
+ ## Registering in MDX
51
40
 
52
- ```ts
53
- // src/mdx-components.ts
54
- export { default as PlatformBlock } from 'igniteui-astro-components/components/mdx/PlatformBlock.astro';
55
- ```
41
+ Nothing is registered automatically. Import the component at the top of each
42
+ MDX file, or pass it through the `components` map of a `<Content />` render.