igniteui-astro-components 0.0.27 → 0.0.28

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 (93) hide show
  1. package/README.md +82 -74
  2. package/package.json +15 -2
  3. package/src/components/CopyCode/CopyCode.astro +21 -7
  4. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +33 -21
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +44 -43
  6. package/src/components/DocsBreadcrumb/README.md +10 -14
  7. package/src/components/DocsSidebar/DocsSidebar.astro +47 -45
  8. package/src/components/DocsSidebar/DocsSidebar.scss +120 -122
  9. package/src/components/DocsSidebar/README.md +25 -21
  10. package/src/components/DocsSidebar/SidebarFilterInput.astro +24 -29
  11. package/src/components/DocsSidebar/SidebarFilterInput.scss +90 -89
  12. package/src/components/DocsSidebar/SidebarLabel.astro +35 -26
  13. package/src/components/DocsSidebar/sidebar-filter.ts +93 -56
  14. package/src/components/DocsSubHeader/DocsSubHeader.astro +256 -195
  15. package/src/components/DocsSubHeader/DocsSubHeader.scss +181 -178
  16. package/src/components/DocsSubHeader/README.md +18 -16
  17. package/src/components/DocsToc/DocsToc.astro +301 -280
  18. package/src/components/DocsToc/DocsToc.scss +20 -21
  19. package/src/components/DocsToc/README.md +11 -9
  20. package/src/components/DocsToc/toTreeNodes.ts +3 -8
  21. package/src/components/DocsTree/DocsTree.astro +32 -20
  22. package/src/components/DocsTree/DocsTreeItem.astro +35 -30
  23. package/src/components/DocsTree/README.md +16 -15
  24. package/src/components/DocsTree/docs-tree.scss +267 -268
  25. package/src/components/GlobalFooter/GlobalFooter.astro +10 -10
  26. package/src/components/GlobalFooter/README.md +3 -2
  27. package/src/components/GlobalNavBar/GlobalNavBar.astro +4 -2
  28. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +222 -222
  29. package/src/components/GlobalNavBar/README.md +3 -2
  30. package/src/components/LicenseIndicator/LicenseIndicator.astro +7 -5
  31. package/src/components/LicenseIndicator/LicenseIndicator.scss +3 -3
  32. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +16 -17
  33. package/src/components/MobileSidebarToggle/README.md +3 -2
  34. package/src/components/MobileTocToggle/MobileTocToggle.astro +75 -61
  35. package/src/components/MobileTocToggle/MobileTocToggle.scss +65 -59
  36. package/src/components/Search/README.md +1 -0
  37. package/src/components/Search/Search.astro +137 -109
  38. package/src/components/Search/Search.scss +20 -20
  39. package/src/components/SearchAdvanced/README.md +21 -15
  40. package/src/components/SearchAdvanced/SearchAdvanced.astro +205 -133
  41. package/src/components/SearchAdvanced/SearchAdvanced.scss +152 -153
  42. package/src/components/mdx/ApiLink/ApiLink.astro +133 -113
  43. package/src/components/mdx/ApiLink/ApiLink.scss +9 -9
  44. package/src/components/mdx/ApiLink/README.md +26 -22
  45. package/src/components/mdx/ApiLink/api-link-index.ts +196 -173
  46. package/src/components/mdx/ApiRef/ApiRef.astro +54 -51
  47. package/src/components/mdx/ApiRef/README.md +20 -15
  48. package/src/components/mdx/Badge/Badge.astro +14 -14
  49. package/src/components/mdx/Badge/Badge.scss +61 -56
  50. package/src/components/mdx/Badge/README.md +24 -19
  51. package/src/components/mdx/DocsAside/DocsAside.astro +30 -37
  52. package/src/components/mdx/DocsAside/DocsAside.scss +82 -82
  53. package/src/components/mdx/DocsAside/README.md +22 -22
  54. package/src/components/mdx/Faq/Faq.astro +86 -0
  55. package/src/components/mdx/Faq/Faq.scss +105 -0
  56. package/src/components/mdx/Faq/FaqItem.astro +117 -0
  57. package/src/components/mdx/Faq/README.md +223 -0
  58. package/src/components/mdx/Faq/types.ts +34 -0
  59. package/src/components/mdx/PlatformBlock/PlatformBlock.astro +3 -2
  60. package/src/components/mdx/PlatformBlock/README.md +6 -8
  61. package/src/components/mdx/Sample/README.md +21 -16
  62. package/src/components/mdx/Sample/Sample.astro +97 -74
  63. package/src/components/mdx/Sample/Sample.scss +132 -132
  64. package/src/content-helper.ts +71 -72
  65. package/src/content.config.ts +1 -6
  66. package/src/integration.ts +566 -512
  67. package/src/layouts/DocsLayout/DocsLayout.astro +228 -182
  68. package/src/layouts/DocsLayout/DocsLayout.scss +261 -261
  69. package/src/layouts/DocsLayout/README.md +24 -35
  70. package/src/lib/nav-helpers.ts +88 -82
  71. package/src/lib/types.ts +76 -76
  72. package/src/llms.ts +205 -166
  73. package/src/platform.ts +312 -162
  74. package/src/plugins/rehype-heading-anchors.ts +45 -45
  75. package/src/plugins/rehype-pagefind-ignore.ts +19 -19
  76. package/src/plugins/rehype-table-wrapper.ts +30 -30
  77. package/src/plugins/remark-docfx.ts +12 -0
  78. package/src/plugins/remark-env-vars.ts +12 -4
  79. package/src/plugins/remark-md-links.ts +10 -4
  80. package/src/scripts/icon-manifest.ts +13 -5
  81. package/src/scripts/sample-widget.ts +557 -501
  82. package/src/sidebar.ts +103 -97
  83. package/src/styles/global/_code-blocks.scss +43 -44
  84. package/src/styles/global/_component-themes.scss +151 -153
  85. package/src/styles/global/_icon-gallery.scss +81 -81
  86. package/src/styles/global/_index.scss +0 -1
  87. package/src/styles/global/_markdown.scss +816 -787
  88. package/src/styles/global/_palette.scss +456 -110
  89. package/src/styles/global/_search-shared.scss +402 -398
  90. package/src/styles/global/_type-scale.scss +127 -127
  91. package/src/styles/global/_variables.scss +138 -111
  92. package/src/styles/theme.scss +41 -41
  93. package/src/virtual-modules.d.ts +11 -2
@@ -41,18 +41,18 @@ const SKIP_TITLE = '\x00skip';
41
41
  */
42
42
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
43
  function withTitleFilter(baseLoader: any): any {
44
- return {
45
- ...baseLoader,
46
- load: async (ctx: any) => {
47
- await baseLoader.load(ctx);
48
- for (const id of [...ctx.store.keys()]) {
49
- const entry = ctx.store.get(id);
50
- if (!entry?.data?.title || entry.data.title === SKIP_TITLE) {
51
- ctx.store.delete(id);
52
- }
53
- }
54
- },
55
- };
44
+ return {
45
+ ...baseLoader,
46
+ load: async (ctx: any) => {
47
+ await baseLoader.load(ctx);
48
+ for (const id of ctx.store.keys()) {
49
+ const entry = ctx.store.get(id);
50
+ if (!entry?.data?.title || entry.data.title === SKIP_TITLE) {
51
+ ctx.store.delete(id);
52
+ }
53
+ }
54
+ },
55
+ };
56
56
  }
57
57
 
58
58
  /**
@@ -61,41 +61,38 @@ function withTitleFilter(baseLoader: any): any {
61
61
  * missing one so the glob loader doesn't throw InvalidContentEntryDataError.
62
62
  */
63
63
  function makeDocsSchema(extend?: z.ZodObject<z.ZodRawShape>) {
64
- const base = z.object({
65
- title: z.string(),
66
- description: z.string().optional().nullable(),
67
- keywords: z.string().optional().nullable(),
68
- draft: z.boolean().optional(),
69
- license: z.string().optional(),
70
- });
64
+ const base = z.object({
65
+ title: z.string(),
66
+ description: z.string().optional().nullable(),
67
+ keywords: z.string().optional().nullable(),
68
+ draft: z.boolean().optional(),
69
+ license: z.string().optional(),
70
+ });
71
71
 
72
- const schema = extend ? base.merge(extend) : base;
72
+ const schema = extend ? base.merge(extend) : base;
73
73
 
74
- return z.preprocess(
75
- (data: unknown) => {
76
- if (typeof data === 'object' && data !== null) {
77
- const d = data as Record<string, unknown>;
78
- if (d['description'] === null) delete d['description'];
79
- if (!d['title']) return { ...d, title: SKIP_TITLE };
80
- }
81
- return data;
82
- },
83
- schema,
84
- );
74
+ return z.preprocess((data: unknown) => {
75
+ if (typeof data === 'object' && data !== null) {
76
+ const d = data as Record<string, unknown>;
77
+ if (d['description'] === null) delete d['description'];
78
+ if (!d['title']) return { ...d, title: SKIP_TITLE };
79
+ }
80
+ return data;
81
+ }, schema);
85
82
  }
86
83
 
87
84
  interface CreateDocsCollectionOptions {
88
- /**
89
- * Glob patterns to exclude (relative to `sourceDir`). A leading `!` is
90
- * added automatically when missing, so `'internal/**'` and
91
- * `'!internal/**'` are both accepted.
92
- */
93
- exclude?: string[];
94
- /**
95
- * Additional Zod object fields merged into the docs schema.
96
- * Useful for repo-specific frontmatter fields.
97
- */
98
- extendSchema?: z.ZodObject<z.ZodRawShape>;
85
+ /**
86
+ * Glob patterns to exclude (relative to `sourceDir`). A leading `!` is
87
+ * added automatically when missing, so `'internal/**'` and
88
+ * `'!internal/**'` are both accepted.
89
+ */
90
+ exclude?: string[];
91
+ /**
92
+ * Additional Zod object fields merged into the docs schema.
93
+ * Useful for repo-specific frontmatter fields.
94
+ */
95
+ extendSchema?: z.ZodObject<z.ZodRawShape>;
99
96
  }
100
97
 
101
98
  /**
@@ -107,38 +104,40 @@ interface CreateDocsCollectionOptions {
107
104
  * @param options - Optional exclude patterns and schema extension.
108
105
  */
109
106
  export function createDocsCollection(
110
- sourceDir?: string,
111
- { exclude = [], extendSchema }: CreateDocsCollectionOptions = {},
107
+ sourceDir?: string,
108
+ { exclude = [], extendSchema }: CreateDocsCollectionOptions = {},
112
109
  ) {
113
- const dir = sourceDir ?? process.env.DOCS_SOURCE_PATH;
114
- if (!dir) {
115
- throw new Error(
116
- '[docs-template] createDocsCollection: no source directory provided. ' +
117
- 'Pass a path as the first argument or set the DOCS_SOURCE_PATH env variable.'
118
- );
119
- }
110
+ const dir = sourceDir ?? process.env.DOCS_SOURCE_PATH;
111
+ if (!dir) {
112
+ throw new Error(
113
+ '[docs-template] createDocsCollection: no source directory provided. ' +
114
+ 'Pass a path as the first argument or set the DOCS_SOURCE_PATH env variable.',
115
+ );
116
+ }
120
117
 
121
- const excludePatterns = exclude.map(p => (p.startsWith('!') ? p : `!${p}`));
118
+ const excludePatterns = exclude.map((p) => (p.startsWith('!') ? p : `!${p}`));
122
119
 
123
- return defineCollection({
124
- loader: withTitleFilter(glob({
125
- base: pathToFileURL(dir.endsWith('/') ? dir : dir + '/'),
126
- pattern: [
127
- '*.{md,mdx}',
128
- '**/*.{md,mdx}',
129
- '!**/_*.{md,mdx}',
130
- '!**/toc.yml',
131
- '!**/*.json',
132
- '!readme.md',
133
- '!README.md',
134
- '!CHANGELOG.md',
135
- '!LICENSE.md',
136
- ...excludePatterns,
137
- ],
138
- })),
139
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
140
- schema: makeDocsSchema(extendSchema) as any,
141
- });
120
+ return defineCollection({
121
+ loader: withTitleFilter(
122
+ glob({
123
+ base: pathToFileURL(dir.endsWith('/') ? dir : dir + '/'),
124
+ pattern: [
125
+ '*.{md,mdx}',
126
+ '**/*.{md,mdx}',
127
+ '!**/_*.{md,mdx}',
128
+ '!**/toc.yml',
129
+ '!**/*.json',
130
+ '!readme.md',
131
+ '!README.md',
132
+ '!CHANGELOG.md',
133
+ '!LICENSE.md',
134
+ ...excludePatterns,
135
+ ],
136
+ }),
137
+ ),
138
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
+ schema: makeDocsSchema(extendSchema) as any,
140
+ });
142
141
  }
143
142
 
144
143
  // ---------------------------------------------------------------------------
@@ -155,5 +154,5 @@ export function createDocsCollection(
155
154
  * export { collections };
156
155
  */
157
156
  export const collections = {
158
- docs: createDocsCollection(process.env.DOCS_SOURCE_PATH),
157
+ docs: createDocsCollection(process.env.DOCS_SOURCE_PATH),
159
158
  };
@@ -7,11 +7,6 @@ import { createDocsCollection } from './content-helper.ts';
7
7
  // proper frontmatter to these files (no `title` → fail schema).
8
8
  export const collections = {
9
9
  docs: createDocsCollection(process.env.DOCS_SOURCE_PATH, {
10
- exclude: [
11
- 'grids_templates/**',
12
- 'style-guide.md',
13
- 'themes/sass/presets/**',
14
- 'themes.md',
15
- ],
10
+ exclude: ['grids_templates/**', 'style-guide.md', 'themes/sass/presets/**', 'themes.md'],
16
11
  }),
17
12
  };