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
@@ -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
  };