igniteui-astro-components 0.0.13 → 0.0.15

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 (31) hide show
  1. package/package.json +3 -1
  2. package/src/components/DocsSidebar/DocsSidebar.scss +16 -78
  3. package/src/components/DocsSidebar/SidebarFilterInput.scss +1 -2
  4. package/src/components/DocsSidebar/SidebarLabel.astro +3 -2
  5. package/src/components/DocsSubHeader/DocsSubHeader.astro +57 -4
  6. package/src/components/DocsSubHeader/DocsSubHeader.scss +42 -1
  7. package/src/components/DocsToc/DocsToc.scss +1 -1
  8. package/src/components/DocsTree/docs-tree.scss +139 -32
  9. package/src/components/LicenseIndicator/LicenseIndicator.astro +4 -3
  10. package/src/components/LicenseIndicator/LicenseIndicator.scss +4 -2
  11. package/src/components/Search/Search.scss +8 -0
  12. package/src/components/SearchAdvanced/SearchAdvanced.astro +48 -1
  13. package/src/components/SearchAdvanced/SearchAdvanced.scss +51 -6
  14. package/src/components/mdx/ApiLink/ApiLink.astro +57 -6
  15. package/src/components/mdx/ApiLink/ApiLink.scss +13 -0
  16. package/src/components/mdx/ApiLink/README.md +47 -2
  17. package/src/components/mdx/Badge/Badge.astro +30 -0
  18. package/src/components/mdx/Badge/Badge.scss +73 -0
  19. package/src/components/mdx/Badge/README.md +63 -0
  20. package/src/components/mdx/DocsAside/DocsAside.scss +4 -2
  21. package/src/components/mdx/Sample/Sample.scss +4 -3
  22. package/src/layouts/DocsLayout/DocsLayout.astro +2 -2
  23. package/src/layouts/DocsLayout/DocsLayout.scss +4 -8
  24. package/src/scripts/sample-widget.ts +3 -1
  25. package/src/styles/global/_code-blocks.scss +6 -20
  26. package/src/styles/global/_markdown.scss +98 -41
  27. package/src/styles/global/_search-shared.scss +2 -9
  28. package/src/styles/global/_type-scale.scss +17 -19
  29. package/src/styles/global/_variables.scss +7 -7
  30. package/src/styles/theme.scss +30 -2
  31. package/src/virtual-modules.d.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
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": {
@@ -62,6 +62,7 @@
62
62
  "./components/mdx/ApiRef.astro": "./src/components/mdx/ApiRef/ApiRef.astro",
63
63
  "./components/mdx/ApiLink.astro": "./src/components/mdx/ApiLink/ApiLink.astro",
64
64
  "./components/mdx/DocsAside.astro": "./src/components/mdx/DocsAside/DocsAside.astro",
65
+ "./components/mdx/Badge.astro": "./src/components/mdx/Badge/Badge.astro",
65
66
  "./components/mdx/PlatformBlock.astro": "./src/components/mdx/PlatformBlock/PlatformBlock.astro",
66
67
  "./components/mdx/Sample.astro": "./src/components/mdx/Sample/Sample.astro",
67
68
  "./lib/sidebar/types": "./src/lib/sidebar/types.ts",
@@ -86,6 +87,7 @@
86
87
  },
87
88
  "dependencies": {
88
89
  "@fontsource-variable/instrument-sans": "^5.2.8",
90
+ "@fontsource-variable/inter": "^5.2.8",
89
91
  "@fontsource-variable/jetbrains-mono": "^5.2.8",
90
92
  "igniteui-webcomponents": "^7.1.3",
91
93
  "jsdom": "^29.0.1"
@@ -8,8 +8,8 @@
8
8
  flex-direction: column;
9
9
  z-index: var(--igd-sidebar-z-index);
10
10
  border-inline-end: var(--igd-app-outline);
11
- padding-inline: var(--igd-padding-md);
12
- padding-block: calc(var(--igd-padding-lg) + rem(14px));
11
+ padding-inline: rem(16px);
12
+ padding-block: rem(24px);
13
13
  background-color: var(--igd-layout-sections-bg);
14
14
  position: sticky;
15
15
  top: var(--igd-header-height);
@@ -17,17 +17,16 @@
17
17
  max-height: 100dvh;
18
18
  align-self: start;
19
19
  gap: rem(24px);
20
+ view-transition-name: docs-sidebar;
20
21
 
21
22
  .sidebar-gutter {
22
23
  overflow-y: hidden;
23
- scrollbar-gutter: stable;
24
24
 
25
25
  // This Makes sure the input border is visible
26
26
  // This is the height of the input in fluent theme + 8px padding
27
27
  // TODO this can be made smart using a css variable to override the original height of the input and used here
28
28
  min-height: rem(40px);
29
29
 
30
-
31
30
  igc-icon {
32
31
  color: light-dark(var(--ig-gray-800), var(--ig-gray-300));
33
32
  }
@@ -62,67 +61,6 @@
62
61
  scrollbar-gutter: stable;
63
62
  }
64
63
 
65
- .sidebar-badge {
66
- --border-radius: #{rem(4px)};
67
- --elevation: none;
68
-
69
- &::part(base) {
70
- @include type-style('overline') {
71
- margin: 0;
72
- };
73
-
74
- border-radius: var(--border-radius);
75
- border-width: rem(1px);
76
- border-style: solid;
77
- border-color: var(--border-color);
78
- }
79
-
80
- igc-icon {
81
- --size: #{rem(18px)}
82
- }
83
-
84
- // TODO, This has to be fixed inside the component
85
- span {
86
- position: relative;
87
- padding-inline: rem(3px);
88
- }
89
- }
90
-
91
- .updated {
92
- --background-color: var(--igd-updated-bg);
93
- --text-color: var(--igd-updated-color);
94
- --icon-color: var(--igd-updated-color);
95
- --border-color: var(--igd-updated-border);
96
- }
97
-
98
- .new {
99
- --background-color: var(--igd-new-bg);
100
- --text-color: var(--igd-new-color);
101
- --icon-color: var(--igd-new-color);
102
- --border-color: var(--igd-new-border);
103
- }
104
-
105
- .preview {
106
- --background-color: var(--igd-preview-bg);
107
- --text-color: var(--igd-preview-color);
108
- --icon-color: var(--igd-preview-color);
109
- --border-color: var(--igd-preview-border);
110
- }
111
-
112
- .premium {
113
- --background-color: var(--igd-premium-bg);
114
- --text-color: var(--igd-premium-color);
115
- --icon-color: var(--igd-premium-color);
116
- --border-color: var(--igd-premium-border);
117
- }
118
-
119
- .opensource {
120
- --background-color: var(--igd-opensource-bg);
121
- --text-color: var(--igd-opensource-color);
122
- --icon-color: var(--igd-opensource-color);
123
- --border-color: var(--igd-opensource-border);
124
- }
125
-
126
64
  .sidebar-premium-icon {
127
65
  --size: #{rem(24px)};
128
66
 
@@ -135,37 +73,37 @@
135
73
  display: flex;
136
74
  align-items: center;
137
75
  gap: rem(8px);
76
+ padding: rem(4px);
138
77
 
139
78
  igc-badge {
140
79
  justify-self: end;
141
80
  }
81
+
142
82
  }
143
83
 
144
84
  .docs-tree-group {
145
85
  gap: rem(8px);
86
+ padding-inline-end: rem(4px);
146
87
  }
147
88
 
148
89
  .group-label-text {
149
90
  @include type-style('body-2') {
91
+ //font-weight: 600;
150
92
  margin-block: 0;
151
93
  };
152
94
 
153
- color: light-dark(var(--ig-gray-800), var(--ig-gray-600));
154
-
155
- &:hover {
156
- color: var(--igd-accent);
157
- }
158
- }
159
-
160
- igc-tree-item[active] {
161
- .group-label-text {
162
- color: var(--igd-accent);
163
- }
95
+ color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
96
+ user-select: none;
164
97
  }
165
98
 
166
99
  .group-label-count {
167
- color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
168
- margin-inline-start: rem(8px)
100
+ color: light-dark(var(--ig-gray-700), var(--ig-gray-600));
101
+ background: light-dark(var(--ig-gray-100), var(--ig-gray-200));
102
+ padding: rem(2px) rem(8px);
103
+ aspect-ratio: 1;
104
+ border-radius: rem(4px);
105
+ margin-inline-start: rem(8px);
106
+ font-size: 12px;
169
107
  }
170
108
 
171
109
  .igd-badge-container {
@@ -30,11 +30,10 @@ igc-input::part(container) {
30
30
  border-block-start: 0;
31
31
  border-block-end: rem(1px) solid light-dark(var(--ig-gray-200), var(--ig-gray-300));
32
32
  border-radius: 0;
33
- padding-inline: rem(16px);
34
33
 
35
34
  // TODO make this more stable using css vars
36
35
  // padding-inline-end is 8px(padding) - 5px(scrollbar width)
37
- padding-inline-end: rem(3px);
36
+ padding-inline-end: rem(12px);
38
37
 
39
38
  padding-block-end: rem(8px);
40
39
 
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import type { TreeNode } from '../DocsTree/types';
15
15
  import type { SidebarBadge } from '../../lib/sidebar/types';
16
+ import Badge from '../mdx/Badge/Badge.astro';
16
17
 
17
18
  interface Props {
18
19
  node: TreeNode;
@@ -34,7 +35,7 @@ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
34
35
  <div class="igd-badge-container">
35
36
  {badges.filter(b => b.variant !== 'premium').map((badge) => (
36
37
  <>
37
- <igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true"><span>{badge.text}</span></igc-badge>
38
+ <Badge variant={badge.variant} class="sidebar-badge" aria-hidden="true"><span>{badge.text}</span></Badge>
38
39
  <span class="visually-hidden">, {badge.text}</span>
39
40
  </>
40
41
  ))}
@@ -51,6 +52,6 @@ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
51
52
  ) : (
52
53
  <span class="group-label-text">
53
54
  <span>{node.label}</span>
54
- <span class="group-label-count">/{childCount}/</span>
55
+ <!--<span class="group-label-count">{childCount}</span>-->
55
56
  </span>
56
57
  )}
@@ -104,12 +104,12 @@ const currentPlatform = virtualPlatform ?? null;
104
104
  const resolvedLinks = (productLinksProp ?? productLinks) as ProductLink[];
105
105
  const filteredLinks = resolvedLinks.filter((l: ProductLink) => l.platform !== currentPlatform);
106
106
  type PackageEntry = string | { label: string; value?: string; href?: string };
107
- const rawPackages = packagesProp ?? (virtualPackages.length > 0 ? virtualPackages : undefined);
107
+ const rawPackages = packagesProp ?? (virtualPackages?.length > 0 ? virtualPackages : undefined);
108
108
  const packages = (rawPackages as PackageEntry[] | undefined)?.map((p: PackageEntry) =>
109
109
  typeof p === 'string' ? { label: p, value: p, href: undefined } : { label: p.label, value: p.value ?? p.label, href: p.href }
110
110
  );
111
111
  const selectedPackage = selectedPackageProp ?? (virtualSelectedPackage || undefined);
112
- const platformIcon = PLATFORM_ICONS[selectedPackage ?? currentPlatform ?? ''] ?? null;
112
+ const platformIcon = PLATFORM_ICONS[selectedPackage ?? ''] ?? PLATFORM_ICONS[currentPlatform ?? ''] ?? null;
113
113
 
114
114
  const resolvedSidebar = (sidebarItems ?? sidebarData) as SidebarEntry[];
115
115
  const sidebarCrumbs = currentSlug ? getBreadcrumb(resolvedSidebar, currentSlug) : [];
@@ -136,6 +136,11 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
136
136
  ))}
137
137
  </igc-select>
138
138
  )}
139
+ {packages && packages.length > 0 && (
140
+ <igc-tooltip anchor="package-select" id="package-tooltip" placement="bottom-end" with-arrow>
141
+ {packages.find(p => p.value === selectedPackage)?.label ?? selectedPackage ?? ''}
142
+ </igc-tooltip>
143
+ )}
139
144
 
140
145
  <!-- Version selector (optional) -->
141
146
  {versions && versions.length > 0 && (
@@ -192,12 +197,60 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
192
197
  connectedCallback() {
193
198
  // Package selector navigation
194
199
  const packageSelect = this.querySelector('#package-select');
200
+ const packageTooltip = this.querySelector<any>('#package-tooltip');
195
201
  if (packageSelect) {
202
+ // Truncates the native input value directly so the '\u2026' is baked in,
203
+ // Keep the full package label in the native input and apply truncation
204
+ // only as a visual style so assistive technologies still get the full text.
205
+ function applyTriggerTruncation() {
206
+ const igcInput = (packageSelect as any).shadowRoot?.querySelector('igc-input');
207
+ const nativeInput = igcInput?.shadowRoot?.querySelector('input') as HTMLInputElement | null;
208
+ if (!nativeInput || !nativeInput.value) return;
209
+
210
+ const text = nativeInput.value;
211
+
212
+ // Preserve the full label for accessibility and hover disclosure.
213
+ nativeInput.setAttribute('aria-label', text);
214
+ nativeInput.title = text;
215
+
216
+ // Apply truncation only to the rendered text.
217
+ nativeInput.style.overflow = 'hidden';
218
+ nativeInput.style.textOverflow = 'ellipsis';
219
+ nativeInput.style.whiteSpace = 'nowrap';
220
+ }
221
+
222
+ // Run after igcInput's Lit render cycle settles (two rAFs = after microtasks + first paint)
223
+ requestAnimationFrame(() => requestAnimationFrame(() => applyTriggerTruncation()));
224
+
225
+ // igcInput re-renders with the full text each time the dropdown closes;
226
+ // re-apply truncation afterwards.
227
+ packageSelect.addEventListener('igcClosed', () =>
228
+ requestAnimationFrame(() => applyTriggerTruncation())
229
+ );
230
+
196
231
  packageSelect.addEventListener('igcChange', (e: Event) => {
197
232
  const val = (e as CustomEvent).detail?.value ?? (packageSelect as any).value;
198
233
  const item = packageSelect.querySelector<HTMLElement>(`igc-select-item[value="${val}"]`);
199
234
  const href = item?.dataset?.href;
200
235
  if (href) window.location.href = href;
236
+ // Sync tooltip content with the new selection label
237
+ if (packageTooltip) {
238
+ packageTooltip.textContent = item?.textContent?.trim() ?? val;
239
+ }
240
+ });
241
+ }
242
+ // Only show the package tooltip when the label is visually truncated
243
+ if (packageTooltip && packageSelect) {
244
+ packageTooltip.addEventListener('igcOpening', (e: Event) => {
245
+ const igcInput = (packageSelect as any).shadowRoot?.querySelector('igc-input');
246
+ const nativeInput = igcInput?.shadowRoot?.querySelector('input');
247
+ // Show when we applied manual truncation (ends with '\u2026') or
248
+ // when there is natural CSS overflow.
249
+ const truncated = nativeInput?.value?.endsWith('\u2026');
250
+ const overflows = nativeInput && nativeInput.scrollWidth > nativeInput.clientWidth;
251
+ if (!truncated && !overflows) {
252
+ e.preventDefault();
253
+ }
201
254
  });
202
255
  }
203
256
 
@@ -298,8 +351,8 @@ const crumbs = sidebarCrumbs.length > 0 ? sidebarCrumbs : (pageTitle ? [pageTitl
298
351
  </script>
299
352
 
300
353
  <script>
301
- import { defineComponents, IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent } from 'igniteui-webcomponents';
354
+ import { defineComponents, IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent, IgcTooltipComponent } from 'igniteui-webcomponents';
302
355
  import '../../scripts/icon-registry';
303
- defineComponents(IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent);
356
+ defineComponents(IgcIconComponent, IgcIconButtonComponent, IgcSelectComponent, IgcSelectItemComponent, IgcTooltipComponent);
304
357
  </script>
305
358
 
@@ -18,6 +18,7 @@
18
18
  border-block-end: var(--igd-app-outline);
19
19
  z-index: 1;
20
20
  background-color: var(--igd-layout-sections-bg);
21
+ view-transition-name: docs-subheader;
21
22
 
22
23
  .igd-logo {
23
24
  display: flex;
@@ -91,7 +92,7 @@
91
92
  flex-shrink: 0;
92
93
  position: relative;
93
94
  width: fit-content;
94
- max-width: rem(180px);
95
+ max-width: rem(250px);
95
96
 
96
97
  &::part(base) {
97
98
  position: absolute;
@@ -103,6 +104,32 @@
103
104
  }
104
105
  }
105
106
 
107
+ .igd-version-select {
108
+ &::part(native-input) {
109
+ field-sizing: content;
110
+ }
111
+ }
112
+
113
+ .igd-package-select {
114
+ &::part(prefix),
115
+ &::part(toggle-icon) {
116
+ flex-shrink: 0;
117
+ }
118
+
119
+ &::part(input) {
120
+ min-width: 0;
121
+ overflow: hidden;
122
+ }
123
+
124
+ &::part(native-input) {
125
+ field-sizing: content;
126
+ min-width: 0;
127
+ overflow: hidden;
128
+ text-overflow: ellipsis;
129
+ white-space: nowrap;
130
+ }
131
+ }
132
+
106
133
  // Hidden by default. DocsLayout.scss reveals it on tablet/mobile (when the sidebar is hidden).
107
134
  .subheader-sidebar-toggle {
108
135
  display: none;
@@ -180,5 +207,19 @@
180
207
  }
181
208
  }
182
209
 
210
+ #package-tooltip {
211
+ --ig-tooltip-background: #D2DBE8;
212
+ --ig-tooltip-text-color: #112031;
213
+ --ig-tooltip-border-radius: #{rem(4px)};
214
+
215
+ &::part(base) {
216
+ font-family: var(--igd-font-sans);
217
+ font-size: #{rem(12px)};
218
+ font-weight: 500;
219
+ line-height: #{rem(18px)};
220
+ letter-spacing: 0;
221
+ }
222
+ }
223
+
183
224
  }
184
225
 
@@ -13,7 +13,7 @@
13
13
  min-width: rem(280px);
14
14
  max-height: calc(100vh - var(--igd-header-height));
15
15
  overflow-y: auto;
16
- padding: rem(46px) rem(24px);
16
+ padding: rem(24px);
17
17
  border-inline-end: var(--igd-app-outline);
18
18
  border-block-end: var(--igd-app-outline);
19
19
  background-color: var(--igd-layout-sections-bg);
@@ -18,7 +18,9 @@ igc-tree {
18
18
  --ig-size: 1;
19
19
 
20
20
  position: relative;
21
+ }
21
22
 
23
+ igc-tree[data-variant='toc'] {
22
24
  &::before {
23
25
  content: '';
24
26
  position: absolute;
@@ -26,16 +28,16 @@ igc-tree {
26
28
  top: anchor(top);
27
29
  height: anchor-size(height);
28
30
  inset-inline-start: 0;
29
- width: rem(1px);
31
+ width: rem(2px);
30
32
  background-color: var(--igd-accent);
31
33
  transition: top 0.2s ease, height 0.2s ease;
32
- display: none;
33
34
  z-index: 1;
34
35
  }
35
-
36
+
36
37
  body.is-resizing &::before {
37
38
  transition: none;
38
39
  }
40
+
39
41
  &::after {
40
42
  content: '';
41
43
  position: absolute;
@@ -46,15 +48,6 @@ igc-tree {
46
48
  height: 100%;
47
49
  background: light-dark(var(--ig-gray-200), var(--ig-gray-300));
48
50
  }
49
-
50
- &:has(igc-tree-item[selected])::before {
51
- display: block;
52
- }
53
- }
54
-
55
- /* Sidebar: only leaf items get selected, so item height = single row */
56
- igc-tree[data-variant='sidebar'] igc-tree-item[selected] {
57
- anchor-name: --selected-tree-item;
58
51
  }
59
52
 
60
53
  /* TOC: groups can be selected (h2 with h3 children); anchor to the label div
@@ -63,21 +56,25 @@ igc-tree[data-variant='toc'] igc-tree-item[selected] > [slot='label'] {
63
56
  anchor-name: --selected-tree-item;
64
57
  }
65
58
 
59
+ igc-tree-item[data-has-children] {
60
+ margin-block-end: rem(8px);
61
+ }
62
+
66
63
  igc-tree-item {
67
- --igc-tree-indentation-size: #{rem(20px)};
64
+ --igc-tree-indentation-size: #{rem(12px)};
68
65
  --background: transparent;
69
66
  --foreground: light-dark(var(--ig-gray-600), var(--ig-gray-400));
70
67
  --background-selected: transparent;
71
68
  --background-active: transparent;
72
- --foreground-active: var(--igd-accent);
73
- --foreground-hover: var(--igd-accent);
69
+ --foreground-active: light-dark(var(--ig-gray-600), var(--ig-gray-400));
70
+ --foreground-hover: var(--igd-on-accent);
74
71
  --background-disabled: transparent;
75
72
  --hover-color: transparent;
76
73
  --hover-selected-color: transparent;
77
74
  --background-active-selected: transparent;
78
- --foreground-selected: var(--igd-accent);
79
- --foreground-active-selected: var(--igd-accent);
80
-
75
+ --foreground-selected: transparent;
76
+ --foreground-active-selected: light-dark(var(--ig-gray-600), var(--ig-gray-400));
77
+ //--ig-tree-size: #{rem(32px)};
81
78
 
82
79
  a {
83
80
  position: absolute;
@@ -94,22 +91,33 @@ igc-tree-item {
94
91
  }
95
92
 
96
93
  cursor: default;
97
-
98
- &:hover,
99
- &:focus {
100
- > a {
101
- color: var(--igd-accent);
94
+ }
95
+
96
+ igc-tree:not([data-variant='toc']) {
97
+ igc-tree-item::part(wrapper) {
98
+ @include type-style('body-2') {
99
+ margin-block: 0;
102
100
  }
101
+
102
+ padding-inline: 0;
103
103
  }
104
104
  }
105
105
 
106
- igc-tree-item::part(wrapper) {
107
- @include type-style('body-2') {
108
- margin-block: 0;
106
+ igc-tree[data-variant='toc'] {
107
+ igc-tree-item::part(wrapper) {
108
+ @include type-style('body-2') {
109
+ margin-block: 0;
110
+ }
111
+
112
+ padding-inline-start: rem(24px);
113
+ padding-inline-end: rem(8px);
114
+ }
115
+
116
+ igc-tree-item[active] {
117
+ .group-label-text {
118
+ color: var(--igd-accent);
119
+ }
109
120
  }
110
- ;
111
- padding-inline-start: rem(24px);
112
- padding-inline-end: rem(8px);
113
121
  }
114
122
 
115
123
  igc-tree-item::part(focused) {
@@ -123,11 +131,12 @@ igc-tree-item::part(indicator) {
123
131
  igc-tree-item::part(label) {
124
132
  width: 100%;
125
133
  max-height: 100%;
126
- padding-block: rem(6px);
134
+ padding-block: 0;
127
135
  text-overflow: unset;
128
136
  white-space: unset;
129
- word-break: break-all;
137
+ word-break: break-word;
130
138
  overflow: unset;
139
+
131
140
  }
132
141
 
133
142
  igc-tree-item[data-has-children] {
@@ -172,15 +181,113 @@ igc-tree-item[data-has-children] {
172
181
  }
173
182
 
174
183
  .docs-tree-label {
184
+ display: -webkit-box;
185
+ -webkit-line-clamp: 2;
186
+ -webkit-box-orient: vertical;
187
+ overflow: hidden;
175
188
  white-space: normal;
189
+ word-break: break-word;
176
190
  }
177
191
 
178
192
  /* Hover accent applies to leaf items (sidebar) and all linked items (TOC) */
179
- .docs-tree-link:hover ~ .docs-tree-label,
193
+ //.docs-tree-link:hover ~ .docs-tree-label,
180
194
  igc-tree-item:not([data-has-children]):hover .docs-tree-label {
181
195
  color: var(--igd-accent);
182
196
  }
183
197
 
198
+ .igd-label-and-badge {
199
+ position: relative;
200
+ border-radius: rem(4px);
201
+ padding-inline: rem(8px) rem(4px);
202
+ height: 100%;
203
+ z-index: -1;
204
+
205
+ &::before {
206
+ content: '';
207
+ position: absolute;
208
+ inset-block-start: 0;
209
+ inset-inline-end: calc(100% + (var(--igc-tree-indentation-size) / 2));
210
+ width: rem(1px);
211
+ height: calc(100% + rem(4px));
212
+ border-radius: 0;
213
+ background: light-dark(var(--ig-gray-300), var(--ig-gray-300));
214
+ }
215
+ }
216
+
217
+ .docs-tree-link {
218
+ &:hover,
219
+ &:focus {
220
+ + .igd-label-and-badge {
221
+ color: var(--igd-accent);
222
+ background-color: var(--ig-gray-100);
223
+ }
224
+ }
225
+ }
226
+
227
+ igc-tree-item[selected] {
228
+ igc-tree-item[selected]:not([aria-expanded]) {
229
+ .igd-label-and-badge {
230
+ color: var(--igd-on-accent);
231
+ background-color: var(--igd-accent);
232
+
233
+ .docs-tree-label {
234
+ color: var(--igd-on-accent);
235
+ }
236
+ }
237
+
238
+ &:has(.igd-label-and-badge) {
239
+ &:hover,
240
+ &:focus {
241
+ .igd-label-and-badge {
242
+ background-color: var(--igd-accent);
243
+
244
+ .docs-tree-label {
245
+ color: #fff;
246
+ }
247
+ }
248
+ }
249
+ }
250
+
251
+ .sidebar-premium-icon {
252
+ color: var(--igd-on-accent);
253
+ }
254
+
255
+ igc-badge {
256
+ &.preview {
257
+ --border-color: var(--igd-on-accent);
258
+ }
259
+
260
+ &.new {
261
+ --background-color: var(--igd-new-bg);
262
+ --text-color: var(--igd-new-color);
263
+ --icon-color: var(--igd-new-color);
264
+ --border-color: var(--igd-on-accent);
265
+ }
266
+
267
+ &.updated {
268
+ --background-color: var(--igd-updated-bg);
269
+ --text-color: var(--igd-updated-color);
270
+ --icon-color: var(--igd-updated-color);
271
+ --border-color: var(--igd-on-accent);
272
+ }
273
+
274
+ &.premium {
275
+ --background-color: var(--igd-premium-bg);
276
+ --text-color: var(--igd-premium-color);
277
+ --icon-color: var(--igd-premium-color);
278
+ --border-color: var(--igd-on-accent);
279
+ }
280
+
281
+ &.opensource {
282
+ --background-color: var(--igd-opensource-bg);
283
+ --text-color: var(--igd-opensource-color);
284
+ --icon-color: var(--igd-opensource-color);
285
+ --border-color: var(--igd-on-accent);
286
+ }
287
+ }
288
+ }
289
+ }
290
+
184
291
  igc-tree[data-variant='sidebar'] {
185
292
  overflow: hidden;
186
293
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import './LicenseIndicator.scss';
3
+ import Badge from '../mdx/Badge/Badge.astro';
3
4
 
4
5
  export interface Props {
5
6
  /** 'premium' shows a purple Premium badge; 'opensource' shows a green Open Source badge; false/undefined hides the badge. */
@@ -11,9 +12,9 @@ const label = license === 'premium' ? 'Premium' : 'Open Source';
11
12
  ---
12
13
 
13
14
  {license && (
14
- <igc-badge class={`sidebar-badge ${license}`}>
15
+ <Badge variant={license} class="license-indicator-badge">
15
16
  <span>{label}</span>
16
17
 
17
- {license === 'premium' && <igc-icon name="premium" collection="docs" class="sidebar-premium-icon" aria-hidden="true"></igc-icon>}
18
- </igc-badge>
18
+ {license === 'premium' && <igc-icon name="premium" collection="docs" aria-hidden="true"></igc-icon>}
19
+ </Badge>
19
20
  )}
@@ -1,5 +1,7 @@
1
1
  @use 'igniteui-theming/sass/typography/functions' as *;
2
2
 
3
- .sidebar-badge::part(base) {
4
- padding-inline: rem(4px);
3
+ .license-indicator-badge {
4
+ &::part(base) {
5
+ padding-inline: rem(4px);
6
+ }
5
7
  }
@@ -17,3 +17,11 @@
17
17
  .igd-search-results {
18
18
  padding-inline-end: rem(26px);
19
19
  }
20
+
21
+ .igd-search-shell {
22
+ igc-input::part(container) {
23
+ &:focus-within {
24
+ box-shadow: inset 0 0 0 1px var(--igd-accent)
25
+ }
26
+ }
27
+ }