igniteui-astro-components 0.0.1 → 0.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Reusable Astro components, layouts, and integrations for Infragistics / Ignite UI documentation sites. Replaces the Starlight defaults with project-specific implementations.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -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,7 +48,6 @@ 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 ? (
@@ -66,19 +66,18 @@ igc-tree-item::part(indicator) {
66
66
  }
67
67
 
68
68
  /*
69
- * Keyboard focus and SSR active state are gated on host-level state and
70
- * styled through the wrapper part:
71
- * • :focus-visible — keyboard focus on the item host (roving tabindex
72
- * means only one item is focused at a time; not used for mouse).
73
- * • [active] — DocsTreeItem sets the `active` attribute on
74
- * <igc-tree-item> whenever activeId matches the node's id.
69
+ * Keyboard focus and active state are styled through the wrapper part:
70
+ * • :focus-visible — keyboard focus on the item host.
71
+ * • :has(a[aria-current]) — active page link (set at SSR time on the <a>).
72
+ * Using aria-current instead of the igc `active` attribute avoids
73
+ * triggering IgcTreeItemComponent.activeChange() during registration.
75
74
  */
76
75
  igc-tree-item:focus-visible::part(wrapper) {
77
76
  outline: 2px solid var(--sl-color-accent, #3b82f6);
78
77
  outline-offset: -2px;
79
78
  border-radius: var(--docs-tree-row-radius);
80
79
  }
81
- igc-tree-item[active]::part(wrapper) {
80
+ igc-tree-item:has(a[aria-current])::part(wrapper) {
82
81
  border-radius: var(--docs-tree-row-radius);
83
82
  background: color-mix(in srgb, var(--sl-color-accent) 5%, transparent);
84
83
  }
@@ -68,7 +68,7 @@ const { label = "Components List" } = Astro.props;
68
68
  position: fixed;
69
69
  top: var(--sl-nav-height);
70
70
  inset-inline-start: 0;
71
- z-index: calc(var(--sl-z-index-navbar) - 1);
71
+ z-index: calc(var(--sl-z-index-navbar) - 2);
72
72
  display: flex;
73
73
  align-items: center;
74
74
  justify-content: space-between;
@@ -189,6 +189,7 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
189
189
  color: var(--sl-color-text);
190
190
  background-color: var(--sl-color-bg);
191
191
  line-height: 1.625;
192
+ overflow-x: clip;
192
193
  }
193
194
 
194
195
  a {
@@ -294,11 +295,50 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
294
295
  padding: 0.125rem 0.25rem;
295
296
  font-size: 0.875em;
296
297
  }
298
+
299
+ .sl-markdown-content :not(pre) > code {
300
+ white-space: pre-wrap;
301
+ overflow-wrap: anywhere;
302
+ }
303
+
297
304
  .sl-markdown-content pre code {
298
305
  background: transparent;
299
306
  padding: 0;
300
307
  }
301
308
 
309
+ /* Responsive images */
310
+ .sl-markdown-content img {
311
+ max-width: 100%;
312
+ height: auto;
313
+ }
314
+
315
+ /* Responsive tables */
316
+
317
+ .sl-markdown-content table {
318
+ display: block;
319
+ overflow-x: auto;
320
+ border-collapse: collapse;
321
+ font-size: var(--sl-text-sm);
322
+ width: 100%;
323
+ }
324
+
325
+ .sl-markdown-content th,
326
+ .sl-markdown-content td {
327
+ padding: 0.5rem 0.75rem;
328
+ border: 1px solid var(--sl-color-hairline);
329
+ text-align: start;
330
+ overflow-wrap: anywhere;
331
+ }
332
+
333
+ .sl-markdown-content thead th {
334
+ background-color: var(--sl-color-bg-sidebar);
335
+ font-weight: 600;
336
+ }
337
+
338
+ .sl-markdown-content tbody tr:nth-child(even) {
339
+ background-color: var(--sl-color-bg-sidebar);
340
+ }
341
+
302
342
  /* ── Utility ─────────────────────────────────────────────────────────────── */
303
343
 
304
344
  @media print {