igniteui-astro-components 0.0.1 → 0.0.3

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 (120) 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 +28 -58
  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/DocsSubHeader/DocsSubHeader.astro +60 -248
  83. package/src/components/DocsSubHeader/DocsSubHeader.scss +69 -0
  84. package/src/components/DocsSubHeader/README.md +6 -37
  85. package/src/components/DocsToc/DocsToc.astro +38 -83
  86. package/src/components/DocsToc/DocsToc.scss +33 -0
  87. package/src/components/DocsTree/DocsTree.astro +16 -2
  88. package/src/components/DocsTree/DocsTreeItem.astro +21 -16
  89. package/src/components/DocsTree/docs-tree.scss +185 -0
  90. package/src/components/GlobalFooter/GlobalFooter.astro +1 -1
  91. package/src/components/GlobalFooter/GlobalFooter.module.scss +1 -0
  92. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +217 -196
  93. package/src/components/MobileSidebarToggle/MobileSidebarToggle.astro +2 -47
  94. package/src/components/MobileSidebarToggle/MobileSidebarToggle.scss +0 -0
  95. package/src/components/Search/Search.astro +14 -103
  96. package/src/components/Search/Search.scss +50 -0
  97. package/src/components/ThemingWidget/ThemingWidget.astro +1 -5
  98. package/src/components/ThemingWidget/ThemingWidget.scss +3 -0
  99. package/src/components/mdx/DocsAside/DocsAside.astro +15 -47
  100. package/src/components/mdx/DocsAside/DocsAside.scss +36 -0
  101. package/src/components/mdx/DocsAside/README.md +6 -6
  102. package/src/components/mdx/Sample/Sample.astro +1 -32
  103. package/src/components/mdx/Sample/Sample.scss +32 -0
  104. package/src/integration.ts +9 -0
  105. package/src/layouts/DocsLayout/DocsLayout.astro +88 -204
  106. package/src/layouts/DocsLayout/DocsLayout.scss +125 -0
  107. package/src/scripts/icon-registry.ts +57 -0
  108. package/src/styles/custom.scss +17 -251
  109. package/src/styles/global/_breakpoints.scss +48 -0
  110. package/src/styles/global/_code-blocks.scss +77 -0
  111. package/src/styles/global/_component-themes.scss +68 -0
  112. package/src/styles/global/_index.scss +9 -0
  113. package/src/styles/global/_markdown.scss +120 -0
  114. package/src/styles/global/_members.scss +85 -0
  115. package/src/styles/global/_palette.scss +131 -0
  116. package/src/styles/global/_type-scale.scss +182 -0
  117. package/src/styles/global/_variables.scss +71 -0
  118. package/src/styles/theme.scss +58 -0
  119. package/src/components/DocsTree/docs-tree.css +0 -227
  120. package/src/styles/ig-theme.scss +0 -43
@@ -0,0 +1,33 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+
3
+ :root {
4
+ --ig-toc-width: #{rem(330px)};
5
+ }
6
+
7
+ .toc-sidebar {
8
+ display: block;
9
+ position: sticky;
10
+ top: var(--igd-header-height);
11
+ max-width: var(--ig-toc-width);
12
+ width: 100%;
13
+ min-width: rem(280px);
14
+ max-height: calc(100vh - var(--igd-header-height));
15
+ overflow-y: auto;
16
+ padding: rem(46px) rem(24px);
17
+ border-inline: var(--igd-app-outline);
18
+ border-block-end: var(--igd-app-outline);
19
+ background-color: var(--igd-layout-sections-bg);
20
+ }
21
+
22
+ .ig-typography {
23
+ .toc-sidebar__heading {
24
+ @include type-style('body-2') {
25
+ margin: 0;
26
+ };
27
+
28
+ color: var(--ig-gray-500);
29
+ padding-block-end: rem(8px);
30
+ padding-inline: rem(24px) 0;
31
+ text-transform: uppercase;
32
+ }
33
+ }
@@ -17,7 +17,7 @@
17
17
  */
18
18
  import type { TreeNode, TreeVariant } from './types';
19
19
  import DocsTreeItem from './DocsTreeItem.astro';
20
- import './docs-tree.css';
20
+ import './docs-tree.scss';
21
21
 
22
22
  interface Props {
23
23
  nodes: TreeNode[];
@@ -60,7 +60,21 @@ const { nodes, variant, activeId, toggleNodeOnClick, ariaLabel, renderLabel } =
60
60
  defineComponents,
61
61
  IgcTreeComponent,
62
62
  IgcTreeItemComponent,
63
+ IgcIconComponent,
63
64
  } from 'igniteui-webcomponents';
65
+ import '../../scripts/icon-registry';
64
66
 
65
- defineComponents(IgcTreeComponent, IgcTreeItemComponent);
67
+ defineComponents(IgcTreeComponent, IgcTreeItemComponent, IgcIconComponent);
68
+
69
+ function selectActiveTreeItem() {
70
+ customElements.whenDefined('igc-tree-item').then(() => {
71
+ document.querySelectorAll<IgcTreeItemComponent>('igc-tree-item').forEach((item) => {
72
+ const isActive = !!item.querySelector('a[aria-current="page"]');
73
+ item.selected = isActive;
74
+ });
75
+ });
76
+ }
77
+
78
+ selectActiveTreeItem();
79
+ document.addEventListener('astro:page-load', selectActiveTreeItem);
66
80
  </script>
@@ -10,8 +10,11 @@
10
10
  * Sets `data-tree-id`, `data-depth`, and `data-has-children` (when applicable).
11
11
  * Any extra `data-*` attributes come from `node.itemData` (kebab-cased keys).
12
12
  *
13
- * The native `active` attribute is set when `activeId` matches `node.id`,
14
- * which drives the `::part(wrapper active)` row highlight in docs-tree.css.
13
+ * The `active` attribute is intentionally NOT set on <igc-tree-item>:
14
+ * setting it triggers IgcTreeItemComponent.activeChange() synchronously
15
+ * during defineComponents(), before the tree is upgraded, crashing on
16
+ * `this.tree?.expandToItem`. Active-row highlight is CSS-driven via
17
+ * `igc-tree-item:has(a[aria-current])` instead.
15
18
  * The default expand indicator is hidden globally via `::part(indicator)`.
16
19
  */
17
20
  import type { TreeNode, TreeVariant } from './types';
@@ -45,23 +48,24 @@ if (node.itemData) {
45
48
  data-depth={String(depth)}
46
49
  data-has-children={hasChildren ? '' : undefined}
47
50
  expanded={node.expanded ? '' : undefined}
48
- active={isActive ? '' : undefined}
49
51
  {...dataAttrs}
50
52
  >
51
53
  {node.href ? (
52
- <a
53
- slot="label"
54
- href={node.href}
55
- aria-current={isActive ? 'page' : undefined}
56
- class="docs-tree-link"
57
- {...node.linkAttrs}
58
- >
59
- {RenderLabel ? (
60
- <RenderLabel node={node} depth={depth} isLeaf={isLeaf} isActive={isActive} />
61
- ) : (
62
- <span class="docs-tree-label">{node.label}</span>
63
- )}
64
- </a>
54
+ <div slot="label">
55
+ <!-- The anchor is used only for navigation purpose it behave as an overlay on the ::part(wrapper) -->
56
+ <a
57
+ href={node.href}
58
+ aria-current={isActive ? 'page' : undefined}
59
+ class="docs-tree-link"
60
+ {...node.linkAttrs}
61
+ ></a>
62
+ {RenderLabel ? (
63
+ <RenderLabel node={node} depth={depth} isLeaf={isLeaf} isActive={isActive} />
64
+ ) : (
65
+ <span class="docs-tree-label">{node.label}</span>
66
+ )}
67
+ {hasChildren && <igc-icon name="chevron" collection="docs" class="tree-expand-icon"></igc-icon>}
68
+ </div>
65
69
  ) : (
66
70
  <div slot="label" class="docs-tree-group">
67
71
  {RenderLabel ? (
@@ -69,6 +73,7 @@ if (node.itemData) {
69
73
  ) : (
70
74
  <span class="docs-tree-label">{node.label}</span>
71
75
  )}
76
+ <igc-icon name="chevron" collection="docs" class="tree-expand-icon"></igc-icon>
72
77
  </div>
73
78
  )}
74
79
 
@@ -0,0 +1,185 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+
3
+ /*
4
+ * if we need to modify the toc or the sidebar in any way we can use:
5
+ * [data-variant="sidebar"]
6
+ * [data-variant="toc"]
7
+ *
8
+ * Designers tune values via the `--docs-tree-*` variables. Structural rules
9
+ * live below the variables; per-variant tweaks at the bottom.
10
+ *
11
+ * Layout rules that don't belong to the tree itself (sidebar-filter-igc,
12
+ * .sidebar-scroll, .toc-sidebar, docs-toc h2) stay in their owning component
13
+ * .astro files.
14
+ */
15
+
16
+ igc-tree {
17
+ --ig-tree-background: transparent;
18
+ --ig-size: 1;
19
+
20
+ position: relative;
21
+
22
+ &::before {
23
+ content: '';
24
+ position: absolute;
25
+ position-anchor: --selected-tree-item;
26
+ top: anchor(top);
27
+ height: anchor-size(height);
28
+ inset-inline-start: 0;
29
+ width: rem(1px);
30
+ background-color: var(--igd-accent);
31
+ transition: top 0.2s ease, height 0.2s ease;
32
+ display: none;
33
+ z-index: 1;
34
+ }
35
+
36
+ &::after {
37
+ content: '';
38
+ position: absolute;
39
+ width: rem(1px);
40
+ inset-inline-start: 0;
41
+ top: 0;
42
+ z-index: 0;
43
+ height: 100%;
44
+ background: light-dark(var(--ig-gray-200), var(--ig-gray-300));
45
+ }
46
+
47
+ &:has(igc-tree-item[selected])::before {
48
+ display: block;
49
+ }
50
+ }
51
+
52
+ /* Sidebar: only leaf items get selected, so item height = single row */
53
+ igc-tree[data-variant='sidebar'] igc-tree-item[selected] {
54
+ anchor-name: --selected-tree-item;
55
+ }
56
+
57
+ /* TOC: groups can be selected (h2 with h3 children); anchor to the label div
58
+ so height tracks only the row, not the expanded children below */
59
+ igc-tree[data-variant='toc'] igc-tree-item[selected] > [slot='label'] {
60
+ anchor-name: --selected-tree-item;
61
+ }
62
+
63
+ igc-tree-item {
64
+ --igc-tree-indentation-size: #{rem(20px)};
65
+
66
+ --background: transparent;
67
+ --foreground: light-dark(var(--ig-gray-600), var(--ig-gray-500));
68
+ --background-selected: transparent;
69
+ --background-active: transparent;
70
+ --foreground-active: var(--igd-accent);
71
+ --foreground-hover: var(--igd-accent);
72
+ --background-disabled: transparent;
73
+ --hover-color: transparent;
74
+ --hover-selected-color: transparent;
75
+ --background-active-selected: transparent;
76
+ --foreground-selected: var(--igd-accent);
77
+ --foreground-active-selected: var(--igd-accent);
78
+
79
+ a {
80
+ position: absolute;
81
+ inset: 0;
82
+ align-items: center;
83
+ color: inherit;
84
+ text-decoration: none;
85
+ width: 100%;
86
+ height: 100%;
87
+
88
+ &:focus {
89
+ outline: none;
90
+ }
91
+ }
92
+
93
+ cursor: default;
94
+
95
+ &:hover,
96
+ &:focus {
97
+ > a {
98
+ color: var(--igd-accent);
99
+ }
100
+ }
101
+ }
102
+
103
+ igc-tree-item::part(wrapper) {
104
+ @include type-style('body-2') {
105
+ margin-block: 0;
106
+ };
107
+ padding-inline-start: rem(24px);
108
+ padding-inline-end: rem(8px);
109
+ }
110
+
111
+ igc-tree-item::part(focused) {
112
+ box-shadow: none;
113
+ }
114
+
115
+ igc-tree-item::part(indicator) {
116
+ display: none;
117
+ }
118
+
119
+ igc-tree-item::part(label) {
120
+ width: 100%;
121
+ }
122
+
123
+ igc-tree-item[data-has-children] > [slot='label'] {
124
+ display: flex;
125
+ align-items: center;
126
+ width: 100%;
127
+ }
128
+
129
+ .tree-expand-icon {
130
+ margin-inline-start: auto;
131
+ flex-shrink: 0;
132
+ color: inherit;
133
+ transform: rotate(-90deg);
134
+ transition: transform 0.2s ease;
135
+ }
136
+
137
+ igc-tree-item[aria-expanded='true'] .tree-expand-icon {
138
+ transform: rotate(0deg);
139
+ color: var(--igd-accent);
140
+ }
141
+
142
+ igc-tree-item[data-has-children][data-depth='0'] {
143
+ --igc-tree-indentation-size: 0;
144
+ }
145
+
146
+ igc-tree-item[data-has-children] {
147
+ --foreground: light-dark(var(--ig-gray-900), var(--ig-gray-50));
148
+ --foreground-selected: light-dark(var(--ig-gray-900), var(--ig-gray-50));
149
+ --foreground-active-selected: light-dark(var(--ig-gray-900), var(--ig-gray-50));
150
+ --foreground-active: light-dark(var(--ig-gray-900), var(--ig-gray-50));
151
+ --foreground-hover: light-dark(var(--ig-gray-900), var(--ig-gray-50));
152
+ }
153
+
154
+ /* Hover accent applies to any linked item (leaf in sidebar, all items in TOC) */
155
+ .docs-tree-link:hover ~ .docs-tree-label {
156
+ color: var(--igd-accent);
157
+ }
158
+
159
+ igc-tree[data-variant='sidebar'] {
160
+ igc-tree-item[data-has-children] {
161
+ --foreground: light-dark(var(--ig-gray-900), var(--ig-gray-50));
162
+ --foreground-selected: light-dark(var(--ig-gray-900), var(--ig-gray-50));
163
+ --foreground-active-selected: light-dark(var(--ig-gray-900), var(--ig-gray-50));
164
+ --foreground-active: light-dark(var(--ig-gray-900), var(--ig-gray-50));
165
+ --foreground-hover: light-dark(var(--ig-gray-900), var(--ig-gray-50));
166
+ }
167
+ }
168
+
169
+ igc-tree[data-variant='toc'] {
170
+ /* No expand/collapse icons in the TOC — all items are links */
171
+ .tree-expand-icon {
172
+ display: none;
173
+ }
174
+ }
175
+
176
+ /* TOC variant — active link highlighted by scroll-spy via aria-current="true". */
177
+ igc-tree[data-variant='toc'] .docs-tree-link[aria-current='true'] {
178
+ color: var(--igd-accent);
179
+ }
180
+
181
+ /* Filter visibility — driven by <sidebar-filter>. */
182
+ // Removing this will break the filter in the sidebar
183
+ sidebar-filter[data-filtering] igc-tree[data-variant='sidebar'] igc-tree-item[data-path]:not([data-filter-match]) {
184
+ display: none;
185
+ }
@@ -39,7 +39,7 @@ const isIgPlatform = !isAppBuilder;
39
39
  // For IG platforms, fetch footer HTML directly (cached per locale per build).
40
40
  const igNav = isIgPlatform ? await fetchIgNav(resolvedLang) : null;
41
41
  ---
42
- <div class={styles.footer}>
42
+ <div class={styles.footer} data-igd-footer>
43
43
 
44
44
  {/* === IgniteUI / default Infragistics footer — fetched via fetchIgNav() === */}
45
45
  {
@@ -7,6 +7,7 @@
7
7
 
8
8
  .footer {
9
9
  --footer-bg: #f8f8f8;
10
+ grid-column: 1 / -1;
10
11
 
11
12
  // Element selector — not hashed by CSS Modules.
12
13
  footer {