igniteui-astro-components 0.0.2 → 0.0.4

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 (122) hide show
  1. package/README.md +21 -0
  2. package/package.json +3 -1
  3. package/src/assets/icons/angular-logo.svg +38 -0
  4. package/src/assets/icons/arrow-down.svg +3 -0
  5. package/src/assets/icons/arrow.svg +3 -0
  6. package/src/assets/icons/blazor-logo.svg +10 -0
  7. package/src/assets/icons/bullet-poiont.svg +3 -0
  8. package/src/assets/icons/chatGPT,.svg +4 -0
  9. package/src/assets/icons/check-circle.svg +3 -0
  10. package/src/assets/icons/check.svg +3 -0
  11. package/src/assets/icons/cheked.svg +3 -0
  12. package/src/assets/icons/chevron.svg +3 -0
  13. package/src/assets/icons/classes.svg +3 -0
  14. package/src/assets/icons/claude.svg +3 -0
  15. package/src/assets/icons/clear.svg +3 -0
  16. package/src/assets/icons/close.svg +3 -0
  17. package/src/assets/icons/code.svg +3 -0
  18. package/src/assets/icons/collapse.svg +5 -0
  19. package/src/assets/icons/command.svg +3 -0
  20. package/src/assets/icons/copy-clipboard.svg +3 -0
  21. package/src/assets/icons/copy.svg +3 -0
  22. package/src/assets/icons/crown.svg +3 -0
  23. package/src/assets/icons/dot.svg +3 -0
  24. package/src/assets/icons/download.svg +3 -0
  25. package/src/assets/icons/dropdown-indicator-bold.svg +3 -0
  26. package/src/assets/icons/dropdown-indicator.svg +3 -0
  27. package/src/assets/icons/enter-fullscreen.svg +3 -0
  28. package/src/assets/icons/enumerations.svg +3 -0
  29. package/src/assets/icons/exit-fullscreen.svg +3 -0
  30. package/src/assets/icons/expand-all.svg +5 -0
  31. package/src/assets/icons/expand-icon.svg +3 -0
  32. package/src/assets/icons/eye.svg +3 -0
  33. package/src/assets/icons/filter-clear.svg +1 -0
  34. package/src/assets/icons/filter.svg +3 -0
  35. package/src/assets/icons/functions.svg +5 -0
  36. package/src/assets/icons/github-logo.svg +3 -0
  37. package/src/assets/icons/hamburger-menu.svg +3 -0
  38. package/src/assets/icons/info.svg +3 -0
  39. package/src/assets/icons/interfaces.svg +3 -0
  40. package/src/assets/icons/link-blank.svg +3 -0
  41. package/src/assets/icons/link.svg +3 -0
  42. package/src/assets/icons/moon.svg +3 -0
  43. package/src/assets/icons/note.svg +3 -0
  44. package/src/assets/icons/open-link-blank.svg +3 -0
  45. package/src/assets/icons/page.svg +3 -0
  46. package/src/assets/icons/palette,.svg +3 -0
  47. package/src/assets/icons/pen.svg +3 -0
  48. package/src/assets/icons/play-circle.svg +10 -0
  49. package/src/assets/icons/premium.svg +3 -0
  50. package/src/assets/icons/react.svg +4 -0
  51. package/src/assets/icons/refresh.svg +3 -0
  52. package/src/assets/icons/rocket.svg +10 -0
  53. package/src/assets/icons/search.svg +10 -0
  54. package/src/assets/icons/shine.svg +3 -0
  55. package/src/assets/icons/show-more.svg +3 -0
  56. package/src/assets/icons/source-code.svg +3 -0
  57. package/src/assets/icons/start.svg +3 -0
  58. package/src/assets/icons/sub-directory-indicator.svg +3 -0
  59. package/src/assets/icons/sun.svg +3 -0
  60. package/src/assets/icons/system-theme.svg +3 -0
  61. package/src/assets/icons/system.svg +3 -0
  62. package/src/assets/icons/type-alias.svg +3 -0
  63. package/src/assets/icons/variables.svg +3 -0
  64. package/src/assets/icons/warning.svg +3 -0
  65. package/src/assets/icons/web-component-logo.svg +23 -0
  66. package/src/assets/icons/wrap-text.svg +3 -0
  67. package/src/assets/ig-logo.svg +33 -0
  68. package/src/assets/illustrations/classes.svg +3 -0
  69. package/src/assets/illustrations/enumerations.svg +3 -0
  70. package/src/assets/illustrations/functions.svg +5 -0
  71. package/src/assets/illustrations/interfaces.svg +3 -0
  72. package/src/assets/illustrations/type-alias.svg +3 -0
  73. package/src/assets/illustrations/variables.svg +3 -0
  74. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +57 -0
  75. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +51 -0
  76. package/src/components/DocsBreadcrumb/README.md +66 -0
  77. package/src/components/DocsSidebar/DocsSidebar.astro +38 -61
  78. package/src/components/DocsSidebar/DocsSidebar.scss +18 -0
  79. package/src/components/DocsSidebar/SidebarFilterInput.astro +22 -57
  80. package/src/components/DocsSidebar/SidebarFilterInput.scss +69 -0
  81. package/src/components/DocsSidebar/SidebarLabel.astro +2 -7
  82. package/src/components/DocsSidebar/toTreeNodes.ts +17 -5
  83. package/src/components/DocsSubHeader/DocsSubHeader.astro +60 -248
  84. package/src/components/DocsSubHeader/DocsSubHeader.scss +69 -0
  85. package/src/components/DocsSubHeader/README.md +6 -37
  86. package/src/components/DocsToc/DocsToc.astro +38 -83
  87. package/src/components/DocsToc/DocsToc.scss +33 -0
  88. package/src/components/DocsTree/DocsTree.astro +16 -2
  89. package/src/components/DocsTree/DocsTreeItem.astro +16 -13
  90. package/src/components/DocsTree/docs-tree.scss +185 -0
  91. package/src/components/GlobalFooter/GlobalFooter.astro +1 -1
  92. package/src/components/GlobalFooter/GlobalFooter.module.scss +1 -0
  93. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +217 -196
  94. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +2 -47
  95. package/src/components/MobileSidebarToggle/MobileSidebarToggle.scss +0 -0
  96. package/src/components/Search/Search.astro +14 -103
  97. package/src/components/Search/Search.scss +50 -0
  98. package/src/components/ThemingWidget/ThemingWidget.astro +1 -5
  99. package/src/components/ThemingWidget/ThemingWidget.scss +3 -0
  100. package/src/components/mdx/DocsAside/DocsAside.astro +15 -47
  101. package/src/components/mdx/DocsAside/DocsAside.scss +36 -0
  102. package/src/components/mdx/DocsAside/README.md +6 -6
  103. package/src/components/mdx/Sample/Sample.astro +1 -32
  104. package/src/components/mdx/Sample/Sample.scss +32 -0
  105. package/src/integration.ts +20 -8
  106. package/src/layouts/DocsLayout/DocsLayout.astro +88 -244
  107. package/src/layouts/DocsLayout/DocsLayout.scss +125 -0
  108. package/src/scripts/icon-registry.ts +57 -0
  109. package/src/styles/custom.scss +17 -251
  110. package/src/styles/global/_breakpoints.scss +48 -0
  111. package/src/styles/global/_code-blocks.scss +77 -0
  112. package/src/styles/global/_component-themes.scss +68 -0
  113. package/src/styles/global/_index.scss +9 -0
  114. package/src/styles/global/_markdown.scss +120 -0
  115. package/src/styles/global/_members.scss +85 -0
  116. package/src/styles/global/_palette.scss +131 -0
  117. package/src/styles/global/_type-scale.scss +182 -0
  118. package/src/styles/global/_variables.scss +71 -0
  119. package/src/styles/theme.scss +58 -0
  120. package/src/virtual-modules.d.ts +2 -0
  121. package/src/components/DocsTree/docs-tree.css +0 -226
  122. package/src/styles/ig-theme.scss +0 -43
@@ -24,6 +24,7 @@
24
24
 
25
25
  import { themeApiUrl } from 'virtual:docs-template/nav-html';
26
26
  import type { NavLang } from '../../platform.ts';
27
+ import './ThemingWidget.scss';
27
28
 
28
29
  interface Props {
29
30
  language?: NavLang;
@@ -145,8 +146,3 @@ const lang = language === 'jp' ? 'ja' : undefined;
145
146
  initThemingWidget();
146
147
  </script>
147
148
 
148
- <style>
149
- .theming-widget-container {
150
- display: block;
151
- }
152
- </style>
@@ -0,0 +1,3 @@
1
+ .theming-widget-container {
2
+ display: block;
3
+ }
@@ -1,14 +1,12 @@
1
1
  ---
2
- import noteIcon from './icons/note.svg?raw';
3
- import tipIcon from './icons/tip.svg?raw';
4
- import cautionIcon from './icons/caution.svg?raw';
5
- import dangerIcon from './icons/danger.svg?raw';
2
+ import './DocsAside.scss';
6
3
 
7
4
  interface Props {
8
- type?: 'note' | 'tip' | 'caution' | 'danger';
5
+ type?: 'note' | 'tip' | 'warning' | 'danger';
9
6
  title?: string;
10
7
  color?: string;
11
8
  class?: string;
9
+ /** Override icon name from the 'docs' collection. */
12
10
  icon?: string;
13
11
  }
14
12
 
@@ -17,15 +15,15 @@ const { type = 'note', title, color, icon, class: className } = Astro.props;
17
15
  const defaultLabels: Record<string, string> = {
18
16
  note: 'Note',
19
17
  tip: 'Tip',
20
- caution: 'Caution',
18
+ warning: 'Warning',
21
19
  danger: 'Danger',
22
20
  };
23
21
 
24
22
  const defaultIcons: Record<string, string> = {
25
- note: noteIcon,
26
- tip: tipIcon,
27
- caution: cautionIcon,
28
- danger: dangerIcon,
23
+ note: 'info',
24
+ tip: 'rocket',
25
+ warning: 'warning',
26
+ danger: 'warning',
29
27
  };
30
28
 
31
29
  const label = title ?? defaultLabels[type];
@@ -39,7 +37,7 @@ const inlineStyle = color ? `--aside-color: ${color};` : undefined;
39
37
  style={inlineStyle}
40
38
  >
41
39
  <p class="aside-title" aria-hidden="true">
42
- {resolvedIcon && <span class="aside-icon" aria-hidden="true" set:html={resolvedIcon} />}
40
+ {resolvedIcon && <igc-icon class="aside-icon" name={resolvedIcon} collection="docs" aria-hidden="true"></igc-icon>}
43
41
  {label}
44
42
  </p>
45
43
  <section class="aside-content">
@@ -47,40 +45,10 @@ const inlineStyle = color ? `--aside-color: ${color};` : undefined;
47
45
  </section>
48
46
  </aside>
49
47
 
50
- <style>
51
- .aside {
52
- --aside-color: hsl(234, 90%, 60%);
53
- border-inline-start: 0.25rem solid var(--aside-color);
54
- padding: 1rem 1.25rem;
55
- background-color: color-mix(in srgb, var(--aside-color) 8%, transparent);
56
- border-radius: 0 0.375rem 0.375rem 0;
57
- margin: 1.5rem 0;
58
- }
59
- .aside--note { --aside-color: hsl(234, 90%, 60%); }
60
- .aside--tip { --aside-color: hsl(134, 70%, 38%); }
61
- .aside--caution { --aside-color: hsl(40, 90%, 45%); }
62
- .aside--danger { --aside-color: hsl(0, 85%, 52%); }
48
+ <script>
49
+ import { defineComponents, IgcIconComponent } from 'igniteui-webcomponents';
50
+ import '../../../scripts/icon-registry';
51
+
52
+ defineComponents(IgcIconComponent);
53
+ </script>
63
54
 
64
- .aside-title {
65
- display: flex;
66
- align-items: center;
67
- gap: 0.4em;
68
- font-weight: 700;
69
- font-size: 1rem;
70
- text-transform: uppercase;
71
- letter-spacing: 0.06em;
72
- color: var(--aside-color);
73
- margin: 0 0 0.5rem;
74
- }
75
- .aside-icon {
76
- display: inline-flex;
77
- flex-shrink: 0;
78
- }
79
- .aside-icon :global(svg) {
80
- width: 1.4em;
81
- height: 1.4em;
82
- fill: currentColor;
83
- }
84
- .aside-content > :first-child { margin-top: 0; }
85
- .aside-content > :last-child { margin-bottom: 0; }
86
- </style>
@@ -0,0 +1,36 @@
1
+ .aside {
2
+ --aside-color: hsl(234, 90%, 60%);
3
+ border-inline-start: 0.25rem solid var(--aside-color);
4
+ padding: 1rem 1.25rem;
5
+ background-color: color-mix(in srgb, var(--aside-color) 8%, transparent);
6
+ border-radius: 0 0.375rem 0.375rem 0;
7
+ margin: 1.5rem 0;
8
+ }
9
+
10
+ .aside--note { --aside-color: hsl(234, 90%, 60%); }
11
+ .aside--tip { --aside-color: hsl(134, 70%, 38%); }
12
+ .aside--warning { --aside-color: hsl(40, 90%, 45%); }
13
+ .aside--danger { --aside-color: hsl(0, 85%, 52%); }
14
+
15
+ .aside-title {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: 0.4em;
19
+ font-weight: 700;
20
+ font-size: 1rem;
21
+ text-transform: uppercase;
22
+ letter-spacing: 0.06em;
23
+ color: var(--aside-color);
24
+ margin: 0 0 0.5rem;
25
+ }
26
+
27
+ .aside-icon {
28
+ width: 1.4em;
29
+ aspect-ratio: 1;
30
+ flex-shrink: 0;
31
+ }
32
+
33
+ .aside-content {
34
+ > :first-child { margin-top: 0; }
35
+ > :last-child { margin-bottom: 0; }
36
+ }
@@ -1,6 +1,6 @@
1
1
  # DocsAside
2
2
 
3
- Renders a styled callout block (note, tip, caution, 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, tip, warning, or danger) with a type-specific icon, color accent, and accessible label. Use it in MDX pages to surface important information inline.
4
4
 
5
5
  ## Import
6
6
 
@@ -12,8 +12,8 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
12
12
 
13
13
  | Prop | Type | Default | Description |
14
14
  |------|------|---------|-------------|
15
- | `type` | `'note' \| 'tip' \| 'caution' \| '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`, `Caution`, `Danger`). |
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
17
  | `color` | `string` | — | Override the accent color via the `--aside-color` CSS custom property. Accepts any valid CSS color value. |
18
18
  | `icon` | `string` | auto | Override the icon with raw SVG markup. Pass an empty string `""` to suppress the icon entirely. |
19
19
  | `class` | `string` | — | Additional CSS class(es) to add to the `<aside>` element. |
@@ -31,8 +31,8 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
31
31
  Use keyboard shortcuts to speed up your workflow.
32
32
  </DocsAside>
33
33
 
34
- {/* Caution with custom title */}
35
- <DocsAside type="caution" title="Breaking change">
34
+ {/* Warning with custom title */}
35
+ <DocsAside type="warning" title="Breaking change">
36
36
  The `foo` prop was removed in v2. Use `bar` instead.
37
37
  </DocsAside>
38
38
 
@@ -58,7 +58,7 @@ import DocsAside from 'igniteui-astro-components/components/mdx/DocsAside.astro'
58
58
  |--------|-------------|---------------|
59
59
  | `note` | Blue | Note |
60
60
  | `tip` | Green | Tip |
61
- | `caution` | Amber | Caution |
61
+ | `warning` | Amber | Warning |
62
62
  | `danger` | Red | Danger |
63
63
 
64
64
  ## Icons
@@ -15,6 +15,7 @@
15
15
  * when a separate demosBaseUrl is present in the environment config.
16
16
  */
17
17
  import { getPlatformContext, getEnvVars } from '../../../lib/platform-context.ts';
18
+ import './Sample.scss';
18
19
 
19
20
  interface Props {
20
21
  src: string;
@@ -108,35 +109,3 @@ const exampleTabId = `${widgetId}-example`;
108
109
  </>
109
110
  )}
110
111
 
111
- <style>
112
- .full-screen-btn {
113
- display: inline-flex;
114
- align-items: center;
115
- font-size: 0.8rem;
116
- font-weight: 400;
117
- color: #fff;
118
- border: 0;
119
- text-transform: uppercase;
120
- padding: 0.5rem 1rem;
121
- margin: 1.5rem 0;
122
- outline-style: none;
123
- transition: all 0.25s ease-out;
124
- background: #0099ff;
125
- cursor: pointer;
126
- }
127
- .full-screen-btn:hover,
128
- .full-screen-btn:focus {
129
- color: white;
130
- box-shadow: 0 5px 5px -3px rgba(0,0,0,.26), 0 8px 10px 1px rgba(0,0,0,.12), 0 3px 14px 2px rgba(0,0,0,.08);
131
- }
132
- .full-screen-btn::before {
133
- content: "";
134
- display: inline-block;
135
- width: 1.75rem;
136
- height: 1.75rem;
137
- margin-right: 0.5rem;
138
- background-image: url("/images/general/fullscreen-white-18dp.svg");
139
- background-size: 100%;
140
- background-repeat: no-repeat;
141
- }
142
- </style>
@@ -0,0 +1,32 @@
1
+ .full-screen-btn {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ font-size: 0.8rem;
5
+ font-weight: 400;
6
+ color: #fff;
7
+ border: 0;
8
+ text-transform: uppercase;
9
+ padding: 0.5rem 1rem;
10
+ margin: 1.5rem 0;
11
+ outline-style: none;
12
+ transition: all 0.25s ease-out;
13
+ background: #0099ff;
14
+ cursor: pointer;
15
+
16
+ &:hover,
17
+ &:focus {
18
+ color: white;
19
+ box-shadow: 0 5px 5px -3px rgba(0,0,0,.26), 0 8px 10px 1px rgba(0,0,0,.12), 0 3px 14px 2px rgba(0,0,0,.08);
20
+ }
21
+
22
+ &::before {
23
+ content: "";
24
+ display: inline-block;
25
+ width: 1.75rem;
26
+ height: 1.75rem;
27
+ margin-right: 0.5rem;
28
+ background-image: url("/images/general/fullscreen-white-18dp.svg");
29
+ background-size: 100%;
30
+ background-repeat: no-repeat;
31
+ }
32
+ }
@@ -212,20 +212,23 @@ export function siteMetaIntegration({
212
212
 
213
213
  // Navigation buckets for this platform — stripped from ancestor paths during label generation.
214
214
  const broadSections = getBroadSectionsForPlatform(effectivePlatform);
215
- const moduleCode = `export const title = ${JSON.stringify(title)};
216
- export const sidebar = ${JSON.stringify(sidebar ?? [])};
217
- export const productLinks = ${JSON.stringify(productLinks)};
218
- export const headEntries = ${JSON.stringify(head ?? [])};
219
- `;
220
-
221
- // Captured from astro:config:done; used to generate llms.txt content.
215
+ // Captured from astro:config:done; used to generate llms.txt content and virtual module.
222
216
  let configuredSite = '';
217
+ // Cached virtual module source — built once in astro:config:done after
218
+ // trailingSlash is known and reused on every subsequent Vite load() call.
219
+ let siteMetaCode = '';
223
220
 
224
221
  return {
225
222
  name: 'docs-template:site-meta',
226
223
  hooks: {
227
224
  'astro:config:done'({ config }) {
228
225
  configuredSite = (config.site?.toString() ?? '').replace(/\/$/, '');
226
+ siteMetaCode = `export const title = ${JSON.stringify(title)};
227
+ export const sidebar = ${JSON.stringify(sidebar ?? [])};
228
+ export const productLinks = ${JSON.stringify(productLinks)};
229
+ export const headEntries = ${JSON.stringify(head ?? [])};
230
+ export const trailingSlash = ${JSON.stringify(config.trailingSlash)};
231
+ `;
229
232
  },
230
233
  'astro:config:setup'({ updateConfig, injectRoute }) {
231
234
  injectRoute({
@@ -283,7 +286,7 @@ export const headEntries = ${JSON.stringify(head ?? [])};
283
286
  if (id === navVirtualId) return navResolvedId;
284
287
  },
285
288
  async load(id: string) {
286
- if (id === resolvedId) return moduleCode;
289
+ if (id === resolvedId) return siteMetaCode;
287
290
  if (id !== navResolvedId) return;
288
291
 
289
292
  // Return cached module code — fetched at most once per build.
@@ -712,6 +715,15 @@ export interface CreateDocsSiteOptions {
712
715
  * All individual helpers (`buildSidebarFromToc`, `staticImagesIntegration`,
713
716
  * `siteMetaIntegration`) remain independently importable for cases that
714
717
  * need finer control.
718
+ *
719
+ * ### Fonts
720
+ *
721
+ * `DocsLayout` imports **Instrument Sans Variable** (UI text) and
722
+ * **JetBrains Mono Variable** (code) directly from the `@fontsource-variable`
723
+ * npm packages — no CDN request is made at runtime. The CSS custom properties
724
+ * `--font-sans` and `--font-mono` are defined in `theme.scss` so components
725
+ * and consumers can reference or override them.
726
+ *
715
727
  * @param options - Configuration options.
716
728
  */
717
729
  export function createDocsSite(options: CreateDocsSiteOptions = {} as CreateDocsSiteOptions): ReturnType<typeof defineConfig> {