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,254 @@
1
+ @use 'igniteui-theming' as *;
2
+
3
+ /*
4
+ * Establish cascade layer priority.
5
+ * Bootstrap is loaded via @import layer(bootstrap) — placing it first
6
+ * gives it the lowest priority so our own unlayered rules always win.
7
+ */
8
+ @layer bootstrap;
9
+
10
+ :root {
11
+ --sl-nav-pad-x: 0;
12
+ --sl-nav-pad-y: 0;
13
+
14
+ /* Height of the GlobalNavBar (shadow-DOM fixed bar at top: 0).
15
+ Design-derived value; JS ResizeObserver overrides it with the measured px. */
16
+ --docs-global-nav-height: #{rem(75.2px)};
17
+ /* Height of the DocsSubHeader utility bar below the GlobalNavBar. */
18
+ --docs-subheader-height: #{rem(40px)};
19
+ /* Combined total — drives sidebar inset-block-start and main-frame padding-top. */
20
+ --sl-nav-height: calc(var(--docs-global-nav-height) + var(--docs-subheader-height));
21
+ /* Height of the MobileSidebarToggle bar (hidden at ≥ 50rem). Used only
22
+ in the two consumers that sit below it on mobile. */
23
+ --docs-mobile-toggle-height: #{rem(36px)};
24
+ font-size: 16px;
25
+ }
26
+
27
+ /* ── Bootstrap kbd reset ── */
28
+
29
+ kbd {
30
+ background-color: var(--sl-color-gray-6);
31
+ color: var(--sl-color-text);
32
+ box-shadow: none;
33
+ }
34
+
35
+ .sidebar-content .group-label {
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: space-between;
39
+ flex-grow: 1;
40
+ gap: rem(8px);
41
+ }
42
+
43
+ /* Star shape shared between the premium-only badge and the combined case. */
44
+ .sidebar-content .sl-badge.tip::before,
45
+ .sidebar-content a[data-premium]:has(.sl-badge:not(.tip))::after {
46
+ content: '';
47
+ display: block;
48
+ mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0ibTYgMTYgNC0zLjA1TDE0IDE2bC0xLjUtNC45NSA0LTIuODVoLTQuOUwxMCAzIDguNCA4LjJIMy41bDQgMi44NUw2IDE2Wm00IDRhOS43MzggOS43MzggMCAwIDEtMy45LS43ODggMTAuMDk5IDEwLjA5OSAwIDAgMS0zLjE3NS0yLjEzN2MtLjktLjktMS42MTItMS45NTgtMi4xMzctMy4xNzVBOS43MzggOS43MzggMCAwIDEgMCAxMGMwLTEuMzgzLjI2My0yLjY4My43ODctMy45YTEwLjA5OSAxMC4wOTkgMCAwIDEgMi4xMzgtMy4xNzVjLjkuOSAxLjYxMyAxLjk1OCAyLjEzNyAzLjE3NUE5LjczOCA5LjczOCAwIDAgMSAyMCAxMGE5LjczOCA5LjczOCAwIDAgMS0uNzg4IDMuOSAxMC4wOTggMTAuMDk4IDAgMCAxLTIuMTM3IDMuMTc1Yy0uOS45LTEuOTU4IDEuNjEzLTMuMTc1IDIuMTM3QTkuNzM4IDkuNzM4IDAgMCAxIDEwIDIwWiIvPjwvc3ZnPg==");
49
+ mask-size: contain;
50
+ mask-repeat: no-repeat;
51
+ background-color: #f63;
52
+ width: rem(16px);
53
+ height: rem(16px);
54
+ aspect-ratio: 1;
55
+ }
56
+
57
+ .sidebar-content .sl-badge.tip {
58
+ border: none;
59
+ background: transparent;
60
+ padding: 0;
61
+ font-size: 0;
62
+ line-height: 0;
63
+ }
64
+
65
+ /* When a status badge is present alongside premium, the badge slot is taken,
66
+ so the star is appended via ::after on the [data-premium] anchor instead. */
67
+ .sidebar-content a[data-premium]:has(.sl-badge:not(.tip))::after {
68
+ display: inline-block;
69
+ flex-shrink: 0;
70
+ }
71
+
72
+ /* ── Code-view widget ─────────────────────────────────────────────────────────
73
+ Ported from igniteui-docfx-template/src/styles/shared/components/_code-view.scss
74
+ ─────────────────────────────────────────────────────────────────────────── */
75
+
76
+ .ig-code-view,
77
+ .code-view {
78
+ display: block;
79
+ outline: 1px solid var(--sl-color-gray-5);
80
+ line-height: rem(24px);
81
+ margin: rem(24px) 0;
82
+ }
83
+
84
+ .code-view ::-webkit-scrollbar { width: rem(4px); height: rem(4px); }
85
+ .code-view ::-webkit-scrollbar-button { width: 0; height: 0; }
86
+ .code-view ::-webkit-scrollbar-thumb {
87
+ background: var(--sl-color-gray-4);
88
+ border-radius: rem(50px);
89
+ }
90
+ .code-view ::-webkit-scrollbar-thumb:hover { background: var(--sl-color-gray-3); }
91
+ .code-view ::-webkit-scrollbar-track {
92
+ background: var(--sl-color-gray-6);
93
+ border-radius: rem(44px);
94
+ }
95
+ .code-view ::-webkit-scrollbar-corner { background: transparent; }
96
+
97
+ .code-view .code-views-container { background-color: transparent; }
98
+
99
+ .code-view .sample-container { padding: 0.1rem; }
100
+
101
+ /* Code-tab panes (2nd child onward = source-file tabs) */
102
+ .code-view .code-view-tab-content:nth-child(n + 2) {
103
+ overflow: auto;
104
+ background: var(--sl-color-bg-sidebar);
105
+ min-height: rem(100px);
106
+ max-height: rem(600px);
107
+ }
108
+
109
+ /* Code blocks inside the widget */
110
+ .code-view pre.code-wrapper {
111
+ position: relative;
112
+ padding: 0;
113
+ margin: 0;
114
+ }
115
+ .code-view pre.code-wrapper:hover { box-shadow: none; }
116
+ .code-view pre.code-wrapper code { border-radius: 0; padding: 0.5em; }
117
+
118
+ .code-view .cv-hljs-code-copy {
119
+ position: absolute;
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ padding: rem(8px);
124
+ top: 0;
125
+ right: 0;
126
+ width: rem(100px);
127
+ height: rem(40px);
128
+ background: var(--sl-color-bg-sidebar);
129
+ color: var(--sl-color-text-accent);
130
+ border: 1px solid var(--sl-color-gray-5);
131
+ font-size: rem(12px);
132
+ font-weight: bold;
133
+ cursor: pointer;
134
+ transition: color 0.25s ease-in-out;
135
+ }
136
+ .code-view .cv-hljs-code-copy.hidden { display: none; }
137
+ .code-view .cv-hljs-code-copy:hover { border-color: var(--sl-color-accent); color: var(--sl-color-accent); }
138
+
139
+ /* ── Navbar ──────────────────────────────────────────────────────────────── */
140
+
141
+ .code-view-navbar {
142
+ overflow-x: auto;
143
+ background-color: var(--sl-color-bg-nav);
144
+ display: flex;
145
+ align-items: stretch;
146
+ }
147
+ .code-view-navbar::-webkit-scrollbar { width: rem(2px); }
148
+ .code-view-navbar::-webkit-scrollbar-track { background: var(--sl-color-gray-6); }
149
+ .code-view-navbar::-webkit-scrollbar-thumb { background: var(--sl-color-gray-4); }
150
+
151
+ .code-view-tab,
152
+ .code-view-tab--active {
153
+ position: relative;
154
+ background-color: transparent;
155
+ border: none;
156
+ min-width: rem(88px);
157
+ height: rem(48px);
158
+ padding: 0.7rem;
159
+ text-align: center;
160
+ font-size: 0.8rem;
161
+ font-weight: 600;
162
+ cursor: pointer;
163
+ color: var(--sl-color-text);
164
+ white-space: nowrap;
165
+ }
166
+ .code-view-tab:hover { color: var(--sl-color-accent); }
167
+
168
+ .code-view-tab--active {
169
+ background-color: var(--sl-color-bg);
170
+ color: var(--sl-color-accent);
171
+ }
172
+ .code-view-tab--active::after {
173
+ content: '';
174
+ height: 2.5px;
175
+ background: var(--sl-color-accent);
176
+ position: absolute;
177
+ left: 0;
178
+ right: 0;
179
+ top: 0;
180
+ }
181
+
182
+ /* Fullscreen button (last child of navbar) */
183
+ .fs-button-container {
184
+ margin-left: auto;
185
+ display: flex;
186
+ align-items: center;
187
+ padding: 0 rem(12px);
188
+ cursor: pointer;
189
+ font-size: 1.1rem;
190
+ color: var(--sl-color-text-accent);
191
+ flex-shrink: 0;
192
+ }
193
+ .fs-button-container::before {
194
+ /* Material Icons "open_in_full" via unicode — fallback to ⛶ */
195
+ font-family: 'Material Icons', sans-serif;
196
+ content: 'open_in_full';
197
+ }
198
+ .fs-button-container:hover { color: var(--sl-color-accent); }
199
+
200
+ /* ── Loading state ───────────────────────────────────────────────────────── */
201
+
202
+ .sample-container.loading::before {
203
+ content: '';
204
+ position: absolute;
205
+ top: 0; bottom: 0; left: 0; right: 0;
206
+ background-color: var(--sl-color-bg);
207
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23999' stroke-width='4' stroke-dasharray='31.4 31.4' transform='rotate(-90 25 25)'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E");
208
+ background-repeat: no-repeat;
209
+ background-position: center center;
210
+ z-index: 9999;
211
+ backface-visibility: hidden;
212
+ }
213
+
214
+ /* ── Live-editing footer ─────────────────────────────────────────────────── */
215
+
216
+ .editing-buttons-container {
217
+ padding: rem(8px);
218
+ border-top: 2px solid var(--sl-color-gray-5);
219
+ font-size: 0.8rem;
220
+ display: flex;
221
+ align-items: center;
222
+ }
223
+ .editing-buttons-container::before {
224
+ font-family: 'Material Icons', sans-serif;
225
+ content: 'open_in_new';
226
+ margin-right: rem(4px);
227
+ font-size: 1rem;
228
+ overflow: hidden;
229
+ }
230
+ .editing-label { margin-right: 0.4rem; }
231
+
232
+ .stackblitz-btn,
233
+ .codesandbox-btn {
234
+ display: inline-flex;
235
+ align-items: center;
236
+ padding: 0.2rem 0.4rem;
237
+ margin: 0 0 0 0.2rem;
238
+ min-width: rem(100px);
239
+ font-size: 0.7rem;
240
+ font-weight: 500;
241
+ cursor: pointer;
242
+ border: 1px solid var(--sl-color-gray-5);
243
+ background: var(--sl-color-bg);
244
+ color: var(--sl-color-text);
245
+ border-radius: rem(3px);
246
+ transition: border-color 0.15s;
247
+ }
248
+ .stackblitz-btn:hover,
249
+ .codesandbox-btn:hover { border-color: var(--sl-color-accent); color: var(--sl-color-accent); }
250
+ .codesandbox-btn { min-width: rem(120px); }
251
+
252
+ .sample-container {
253
+ position: relative;
254
+ }
@@ -0,0 +1,43 @@
1
+ // =============================================================================
2
+ // Ignite UI Design Tokens
3
+ //
4
+ // Uses the official igniteui-theming Sass library to generate --ig-* CSS
5
+ // custom properties. ONLY palette variables are emitted — no IG component
6
+ // styles are included. Changing the palette() values here updates every shade
7
+ // automatically on the next build.
8
+ // =============================================================================
9
+
10
+ @use 'igniteui-theming' as *;
11
+
12
+ $ig-palette: palette(
13
+ $primary: #0099ff,
14
+ $secondary: #e41c77,
15
+ $surface: #ffffff,
16
+ $gray: #9e9e9e,
17
+ );
18
+
19
+ @include palette($ig-palette);
20
+
21
+ // Starlight accent bridge — maps IG palette shades to Starlight accent vars
22
+ [data-theme='light'] {
23
+ --sl-color-accent-low: var(--ig-primary-200);
24
+ --sl-color-accent: var(--ig-primary-500);
25
+ --sl-color-accent-high: var(--ig-primary-800);
26
+ }
27
+
28
+ // Dark mode — re-emit palette with lighter primary/secondary for legibility
29
+ // on dark surfaces. Starlight writes [data-theme='dark'] on <html>.
30
+ [data-theme='dark'] {
31
+ $ig-palette-dark: palette(
32
+ $primary: #4db8ff,
33
+ $secondary: #f06ea3,
34
+ $surface: #1e2e23,
35
+ $gray: #9e9e9e,
36
+ );
37
+
38
+ @include palette($ig-palette-dark);
39
+
40
+ --sl-color-accent-low: var(--ig-primary-900);
41
+ --sl-color-accent: var(--ig-primary-400);
42
+ --sl-color-accent-high: var(--ig-primary-200);
43
+ }
@@ -0,0 +1,35 @@
1
+ declare module 'virtual:docs-template/site-meta' {
2
+ export const sidebar: { label: string; slug?: string; items?: unknown[] }[];
3
+ export const title: string;
4
+ /** Cross-product navigation links for the DocsSubHeader. */
5
+ export const productLinks: Array<{
6
+ label: string;
7
+ href: string;
8
+ platform?: string;
9
+ }>;
10
+ /** Extra <head> entries injected by siteMetaIntegration (platform CDN, highlight.js, etc.). */
11
+ export const headEntries: Array<{
12
+ tag: string;
13
+ attrs?: Record<string, string | boolean | undefined>;
14
+ content?: string;
15
+ }>;
16
+ }
17
+
18
+ import type { NavLang, NavTheme } from './platform.ts';
19
+
20
+ declare module 'virtual:docs-template/nav-html' {
21
+ export const platform: 'igniteui' | 'angular' | 'react' | 'blazor' | 'web-components' | 'slingshot' | 'appbuilder' | null;
22
+ export const navLang: NavLang;
23
+ export const themeApiUrl: string;
24
+ export const widgetScriptSrc: string;
25
+ export const prefetched: boolean;
26
+ export const headerHtml: string;
27
+ export const uiFooterHtml: string;
28
+ export const footerHtml: string;
29
+ export const abPrefetched: boolean;
30
+ export const abHeaderHtml: string;
31
+ export const abFooterHtml: string;
32
+ export const abFooterUtilsHtml: string;
33
+ export const abFooterCopyrightHtml: string;
34
+ export const abContactSalesHtml: string;
35
+ }