igniteui-astro-components 0.0.18 → 0.0.20

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 (48) hide show
  1. package/package.json +1 -1
  2. package/src/assets/icons/{chatGPT,.svg → chatgpt.svg} +0 -1
  3. package/src/assets/ig-logo.svg +1 -1
  4. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +1 -3
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +12 -3
  6. package/src/components/DocsSidebar/DocsSidebar.astro +26 -7
  7. package/src/components/DocsSidebar/DocsSidebar.scss +35 -28
  8. package/src/components/DocsSidebar/SidebarFilterInput.astro +2 -2
  9. package/src/components/DocsSidebar/SidebarFilterInput.scss +76 -51
  10. package/src/components/DocsSidebar/sidebar-filter.ts +3 -18
  11. package/src/components/DocsSubHeader/DocsSubHeader.astro +93 -114
  12. package/src/components/DocsSubHeader/DocsSubHeader.scss +69 -121
  13. package/src/components/DocsToc/DocsToc.astro +14 -10
  14. package/src/components/DocsToc/DocsToc.scss +7 -5
  15. package/src/components/DocsTree/docs-tree.scss +125 -54
  16. package/src/components/GlobalFooter/GlobalFooter.module.scss +1 -1
  17. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +1 -3
  18. package/src/components/Search/Search.astro +57 -23
  19. package/src/components/Search/Search.scss +15 -21
  20. package/src/components/SearchAdvanced/SearchAdvanced.astro +64 -49
  21. package/src/components/SearchAdvanced/SearchAdvanced.scss +22 -30
  22. package/src/components/mdx/ApiLink/ApiLink.astro +90 -149
  23. package/src/components/mdx/ApiLink/README.md +75 -73
  24. package/src/components/mdx/ApiLink/api-link-index.ts +223 -0
  25. package/src/components/mdx/DocsAside/DocsAside.scss +10 -14
  26. package/src/layouts/DocsLayout/DocsLayout.astro +5 -5
  27. package/src/layouts/DocsLayout/DocsLayout.scss +58 -97
  28. package/src/lib/types.ts +21 -7
  29. package/src/scripts/icon-manifest.ts +73 -0
  30. package/src/scripts/icon-registry.ts +4 -35
  31. package/src/styles/global/_breakpoints.scss +0 -1
  32. package/src/styles/global/_code-blocks.scss +1 -0
  33. package/src/styles/global/_component-themes.scss +133 -125
  34. package/src/styles/global/_icon-gallery.scss +108 -0
  35. package/src/styles/global/_index.scss +1 -0
  36. package/src/styles/global/_markdown.scss +127 -16
  37. package/src/styles/global/_palette.scss +101 -101
  38. package/src/styles/global/_search-shared.scss +302 -315
  39. package/src/styles/global/_type-scale.scss +17 -17
  40. package/src/styles/global/_variables.scss +15 -6
  41. package/src/styles/theme.scss +7 -61
  42. package/src/assets/icons/classes.svg +0 -3
  43. package/src/assets/icons/enumerations.svg +0 -3
  44. package/src/assets/icons/functions.svg +0 -5
  45. package/src/assets/icons/interfaces.svg +0 -3
  46. package/src/assets/icons/type-alias.svg +0 -3
  47. package/src/assets/icons/variables.svg +0 -3
  48. /package/src/assets/icons/{palette,.svg → palette.svg} +0 -0
@@ -18,60 +18,118 @@ igc-tree {
18
18
  --ig-size: 1;
19
19
 
20
20
  position: relative;
21
+ padding-inline: rem(12px);
21
22
  }
22
23
 
23
- igc-tree[data-variant='toc'] {
24
- &::before {
25
- content: '';
26
- position: absolute;
27
- position-anchor: --selected-tree-item;
28
- top: anchor(top);
29
- height: anchor-size(height);
30
- inset-inline-start: 0;
31
- width: rem(2px);
32
- background-color: var(--igd-accent);
33
- transition: top 0.2s ease, height 0.2s ease;
34
- z-index: 1;
24
+ // TODO KEEP THIS IF WEE NEED ADDITIONAL VISUAL INDICATOR FOR THE TOC
25
+ //igc-tree[data-variant='toc'] {
26
+ // &::before {
27
+ // content: '';
28
+ // position: absolute;
29
+ // position-anchor: --selected-tree-item;
30
+ // top: anchor(top);
31
+ // height: anchor-size(height);
32
+ // inset-inline-start: 0;
33
+ // width: rem(2px);
34
+ // background-color: var(--igd-accent);
35
+ // transition: top 0.2s ease, height 0.2s ease;
36
+ // z-index: 1;
37
+ // }
38
+ //
39
+ // body.is-resizing &::before {
40
+ // transition: none;
41
+ // }
42
+ //
43
+ // &::after {
44
+ // content: '';
45
+ // position: absolute;
46
+ // width: rem(1px);
47
+ // inset-inline-start: 0;
48
+ // top: 0;
49
+ // z-index: 0;
50
+ // height: 100%;
51
+ // background: light-dark(var(--ig-gray-200), var(--ig-gray-300));
52
+ // }
53
+ //}
54
+
55
+ /* TOC: groups can be selected (h2 with h3 children); anchor to the label div
56
+ so height tracks only the row, not the expanded children below */
57
+ //igc-tree[data-variant='toc'] igc-tree-item[selected] > [slot='label'] {
58
+ // anchor-name: --selected-tree-item;
59
+ //}
60
+
61
+
62
+ igc-tree[data-variant='sidebar'] {
63
+ igc-tree-item + igc-tree-item[data-has-children] {
64
+ margin-block-start: rem(4px);
35
65
  }
36
66
 
37
- body.is-resizing &::before {
38
- transition: none;
67
+ .docs-tree-label {
68
+ @include type-style('body-2') {
69
+ margin-block: 0;
70
+ line-height: rem(20px);
71
+ }
39
72
  }
40
73
 
41
- &::after {
42
- content: '';
43
- position: absolute;
44
- width: rem(1px);
45
- inset-inline-start: 0;
46
- top: 0;
47
- z-index: 0;
48
- height: 100%;
49
- background: light-dark(var(--ig-gray-200), var(--ig-gray-300));
74
+ igc-tree-item[aria-expanded] {
75
+ &::part(wrapper) {
76
+ border-radius: rem(4px);
77
+
78
+ &:hover {
79
+ background-color: var(--ig-gray-50);
80
+ }
81
+ }
82
+
83
+ .docs-tree-group {
84
+ padding-block: rem(8px);
85
+ }
86
+
87
+ }
88
+
89
+ igc-tree-item[aria-expanded][active] {
90
+ &::part(wrapper) {
91
+ background-color: var(--ig-gray-50);
92
+ }
50
93
  }
51
94
  }
52
95
 
53
- /* TOC: groups can be selected (h2 with h3 children); anchor to the label div
54
- so height tracks only the row, not the expanded children below */
55
- igc-tree[data-variant='toc'] igc-tree-item[selected] > [slot='label'] {
56
- anchor-name: --selected-tree-item;
57
- }
58
-
59
- igc-tree-item + igc-tree-item[data-has-children] {
60
- margin-block-start: rem(4px);
61
- }
62
-
63
- igc-tree-item[data-has-children] {
64
- margin-block-end: rem(4px);
96
+ igc-tree[data-variant='toc'] {
97
+ igc-tree-item[data-depth='0']::part(label) {
98
+ font-weight: 600 !important;
99
+ color: var(--ig-gray-900);
100
+ }
101
+
102
+ igc-tree-item:not([data-has-children]) {
103
+ margin-block: rem(6px);
104
+ }
105
+
106
+ igc-tree-item:not([data-depth='0'], [data-has-children]) {
107
+ margin-left: rem(16px);
108
+ }
109
+
110
+ igc-tree-item[data-depth='0'] {
111
+ margin-block: rem(16px) 0;
112
+ }
113
+
114
+ igc-tree-item::part(wrapper) {
115
+ line-height: 22.75px !important;
116
+ margin: 0 !important;
117
+ }
118
+
119
+ > igc-tree-item:first-of-type {
120
+ margin-block-start: 0;
121
+ }
65
122
  }
66
123
 
67
124
  igc-tree-item {
68
- --igc-tree-indentation-size: #{rem(12px)};
125
+ --igc-tree-indentation-size: 0;
69
126
  --background: transparent;
70
127
  --foreground: light-dark(var(--ig-gray-600), var(--ig-gray-400));
71
128
  --background-selected: transparent;
72
129
  --background-active: transparent;
73
130
  --foreground-active: light-dark(var(--ig-gray-600), var(--ig-gray-400));
74
- --foreground-hover: var(--igd-on-accent);
131
+ --foreground-hover: light-dark(var(--ig-gray-600), var(--ig-gray-400));
132
+ --hover-background: light-dark(var(--ig-gray-600), var(--ig-gray-400));
75
133
  --background-disabled: transparent;
76
134
  --hover-color: transparent;
77
135
  --hover-selected-color: transparent;
@@ -112,9 +170,6 @@ igc-tree[data-variant='toc'] {
112
170
  @include type-style('body-2') {
113
171
  margin-block: 0;
114
172
  }
115
-
116
- padding-inline-start: rem(24px);
117
- padding-inline-end: rem(8px);
118
173
  }
119
174
 
120
175
  igc-tree-item[active] {
@@ -157,6 +212,7 @@ igc-tree-item[data-has-children] {
157
212
  color: inherit;
158
213
  transform: rotate(-90deg);
159
214
  transition: transform 0.2s ease;
215
+ margin-inline-end: rem(1px);
160
216
  }
161
217
 
162
218
  igc-tree-item[aria-expanded='false'] > [slot='label'] {
@@ -184,6 +240,21 @@ igc-tree-item[data-has-children] {
184
240
  --foreground-hover: light-dark(var(--ig-gray-900), var(--ig-gray-50));
185
241
  }
186
242
 
243
+ // This are the igc-tree-item that dont have igc-tree-item inside
244
+ igc-tree-item:not([data-has-children]) {
245
+ &::part(wrapper) {
246
+ --size: auto;
247
+
248
+ margin-block: rem(2px) !important;
249
+ }
250
+ }
251
+
252
+ igc-tree-item:not([data-depth='0'], [data-has-children]) {
253
+ .docs-tree-label {
254
+ font-weight: 400;
255
+ }
256
+ }
257
+
187
258
  .docs-tree-label {
188
259
  display: -webkit-box;
189
260
  -webkit-line-clamp: 2;
@@ -202,28 +273,29 @@ igc-tree-item:not([data-has-children]):hover .docs-tree-label {
202
273
  .igd-label-and-badge {
203
274
  position: relative;
204
275
  border-radius: rem(4px);
205
- padding-inline: rem(8px) rem(4px);
276
+ padding-block: rem(8px);
277
+ padding-inline-start: rem(12px);
278
+ padding-inline-end: rem(8px);
206
279
  height: 100%;
207
280
  z-index: -1;
208
281
 
209
- &::before {
210
- content: '';
211
- position: absolute;
212
- inset-block-start: 0;
213
- inset-inline-end: calc(100% + (var(--igc-tree-indentation-size) / 2));
214
- width: rem(1px);
215
- height: calc(100% + rem(4px));
216
- border-radius: 0;
217
- background: light-dark(var(--ig-gray-300), var(--ig-gray-300));
218
- }
282
+ //&::before {
283
+ // content: '';
284
+ // position: absolute;
285
+ // inset-block-start: 0;
286
+ // inset-inline-end: calc(100% + (var(--igc-tree-indentation-size) / 2));
287
+ // width: rem(1px);
288
+ // height: calc(100% + rem(4px));
289
+ // border-radius: 0;
290
+ // background: light-dark(var(--ig-gray-300), var(--ig-gray-300));
291
+ //}
219
292
  }
220
293
 
221
294
  .docs-tree-link {
222
295
  &:hover,
223
296
  &:focus {
224
297
  + .igd-label-and-badge {
225
- color: var(--igd-accent);
226
- background-color: var(--ig-gray-100);
298
+ background-color: var(--ig-gray-50);
227
299
  }
228
300
  }
229
301
  }
@@ -300,7 +372,6 @@ igc-tree[data-variant='sidebar'] {
300
372
  --foreground-selected: light-dark(var(--ig-gray-900), var(--ig-gray-600));
301
373
  --foreground-active-selected: light-dark(var(--ig-gray-900), var(--ig-gray-600));
302
374
  --foreground-active: light-dark(var(--ig-gray-900), var(--ig-gray-50));
303
- --foreground-hover: light-dark(var(--ig-gray-900), var(--ig-gray-50));
304
375
  }
305
376
  }
306
377
 
@@ -12,7 +12,7 @@
12
12
  // Element selector — not hashed by CSS Modules.
13
13
  footer {
14
14
  position: relative;
15
- z-index: 1000;
15
+ z-index: 0;
16
16
  }
17
17
 
18
18
  // .footer is a class name from injected footerHtml — must use :global()
@@ -36,11 +36,9 @@
36
36
 
37
37
  // Element selectors are never hashed by CSS Modules — no :global() needed.
38
38
  header {
39
- position: static;
40
39
  top: 0;
41
40
  left: 0;
42
41
  right: 0;
43
- z-index: 1000;
44
42
  font-family: aktiv-grotesk, sans-serif;
45
43
 
46
44
  :global(.navbar) {
@@ -56,7 +54,7 @@
56
54
  // Class names below come from the injected headerHtml / static fallback markup.
57
55
  // CSS Modules would hash them, breaking the match — :global() prevents that.
58
56
  :global(.globalnav__primary) {
59
- padding-inline: rem(16px);
57
+ padding-inline: rem(9px);
60
58
  border-bottom: var(--igd-app-outline) !important;
61
59
 
62
60
  @media (max-width: #{$bp-tablet-max}) {
@@ -12,16 +12,32 @@
12
12
  import './Search.scss';
13
13
  ---
14
14
 
15
- <button
16
- id="search-trigger"
17
- class="search-trigger"
18
- aria-label="Search documentation"
19
- title="Search (Ctrl+K)"
20
- >
21
- <igc-icon name="search" collection="docs" aria-hidden="true"></igc-icon>
22
- <span class="search-trigger__label">Search</span>
23
- <kbd class="search-trigger__hint" style="display:none;"><kbd>Ctrl</kbd><kbd>K</kbd></kbd>
24
- </button>
15
+ <div class="search-decoration">
16
+ <igc-icon-button
17
+ class="search-trigger-mobile"
18
+ variant="flat"
19
+ aria-label="Search documentation"
20
+ aria-haspopup="dialog"
21
+ aria-controls="search-dialog"
22
+ >
23
+ <igc-icon name="search" collection="docs" aria-hidden="true"></igc-icon>
24
+ </igc-icon-button>
25
+ <igc-input
26
+ id="search-trigger"
27
+ class="search-trigger"
28
+ type="text"
29
+ placeholder="Search"
30
+ readonly
31
+ role="button"
32
+ aria-haspopup="dialog"
33
+ aria-controls="search-dialog"
34
+ aria-label="Search documentation"
35
+ title="Search (Ctrl+K)"
36
+ >
37
+ <igc-icon name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
38
+ <kbd class="search-trigger__hint" slot="suffix" style="display:none;"><kbd>Ctrl</kbd><kbd>K</kbd></kbd>
39
+ </igc-input>
40
+ </div>
25
41
 
26
42
  <igc-dialog id="search-dialog" class="igd-search-dialog" aria-label="Search" hide-default-action close-on-outside-click>
27
43
  <div class="igd-search-shell">
@@ -46,17 +62,16 @@ import './Search.scss';
46
62
  hidden
47
63
  ></igc-icon-button>
48
64
  </igc-input>
49
- <button
50
- type="button"
51
- class="search-trigger search-close"
52
- aria-label="Close search"
53
- >
54
- <igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
55
- </button>
56
65
  </header>
57
- <igc-divider></igc-divider>
58
- <div class="igd-search-status" aria-live="polite"></div>
59
- <igc-list class="igd-search-results" hidden></igc-list>
66
+ <div class="igd-search-content">
67
+ <div class="igd-search-status" aria-live="polite"></div>
68
+ <igc-list class="igd-search-results" hidden></igc-list>
69
+ </div>
70
+ <footer class="igd-search-footer">
71
+ <igc-button class="search-close" variant="outlined">
72
+ Close
73
+ </igc-button>
74
+ </footer>
60
75
  </div>
61
76
  </igc-dialog>
62
77
 
@@ -65,6 +80,7 @@ import './Search.scss';
65
80
  defineComponents,
66
81
  IgcIconComponent,
67
82
  IgcIconButtonComponent,
83
+ IgcButtonComponent,
68
84
  IgcDialogComponent,
69
85
  IgcInputComponent,
70
86
  IgcListComponent,
@@ -76,6 +92,7 @@ import './Search.scss';
76
92
  defineComponents(
77
93
  IgcIconComponent,
78
94
  IgcIconButtonComponent,
95
+ IgcButtonComponent,
79
96
  IgcDialogComponent,
80
97
  IgcInputComponent,
81
98
  IgcListComponent,
@@ -141,7 +158,7 @@ import './Search.scss';
141
158
  );
142
159
 
143
160
  if (results.length === 0) {
144
- statusEl.innerHTML = `No results for “<strong class="igd-search-query">${escapeHtml(query)}</strong>”.`;
161
+ statusEl.innerHTML = `<span>No results for “<strong class="igd-search-query">${escapeHtml(query)}</strong>”.</span>`;
145
162
  listEl.innerHTML = '';
146
163
  listEl.hidden = true;
147
164
  return;
@@ -163,6 +180,9 @@ import './Search.scss';
163
180
  async function openSearch() {
164
181
  const dialog = document.querySelector<any>('igc-dialog.igd-search-dialog');
165
182
  if (!dialog) return;
183
+ const sw = window.innerWidth - document.documentElement.clientWidth;
184
+ if (sw) document.body.style.paddingRight = `${sw}px`;
185
+ document.body.toggleAttribute('data-search-modal-open', true);
166
186
  await dialog.show();
167
187
  loadPagefind();
168
188
  requestAnimationFrame(() => {
@@ -173,6 +193,13 @@ import './Search.scss';
173
193
  if (!_w.__searchListeners) {
174
194
  _w.__searchListeners = true;
175
195
 
196
+ document.addEventListener('igcClosed', (e: Event) => {
197
+ if ((e.target as Element).matches('igc-dialog.igd-search-dialog')) {
198
+ document.body.toggleAttribute('data-search-modal-open', false);
199
+ document.body.style.paddingRight = '';
200
+ }
201
+ });
202
+
176
203
  function updateSearchHint() {
177
204
  const hint = document.querySelector<HTMLElement>('kbd.search-trigger__hint');
178
205
  if (!hint) return;
@@ -187,7 +214,14 @@ import './Search.scss';
187
214
  updateSearchHint();
188
215
 
189
216
  document.addEventListener('click', (e: Event) => {
190
- if ((e.target as Element).closest('#search-trigger')) openSearch();
217
+ if ((e.target as Element).closest('#search-trigger') || (e.target as Element).closest('.search-trigger-mobile')) openSearch();
218
+ });
219
+
220
+ document.addEventListener('keydown', (e: KeyboardEvent) => {
221
+ if ((e.key === 'Enter' || e.key === ' ') && document.activeElement?.id === 'search-trigger') {
222
+ e.preventDefault();
223
+ openSearch();
224
+ }
191
225
  });
192
226
 
193
227
  document.addEventListener('keydown', (e: KeyboardEvent) => {
@@ -219,7 +253,7 @@ import './Search.scss';
219
253
  input.value = '';
220
254
  input.focus();
221
255
  runSearch('');
222
- } else if (target.closest('.igd-search-shell .search-close')) {
256
+ } else if (target.closest('.search-close')) {
223
257
  document.querySelector<any>('igc-dialog.igd-search-dialog')?.hide();
224
258
  } else if (target.closest('.igd-search-shell') && target.closest('a[href]')) {
225
259
  document.querySelector<any>('igc-dialog.igd-search-dialog')?.hide();
@@ -1,27 +1,21 @@
1
1
  @use 'igniteui-theming' as *;
2
2
  @use '../../styles/global/search-shared' as *;
3
3
 
4
- .igd-search-result-excerpt {
5
- @include type-style('caption') {
6
- margin: 0;
7
- }
8
-
9
- color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
10
-
11
- mark {
12
- background: transparent;
13
- color: var(--igd-accent);
14
- }
15
- }
16
-
17
- .igd-search-results {
18
- padding-inline-end: rem(26px);
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)
4
+ @layer components {
5
+ .igd-search-result-excerpt {
6
+ @include type-style('caption') {
7
+ margin: 0;
25
8
  }
9
+
10
+ color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
11
+
12
+ mark {
13
+ background: transparent;
14
+ color: var(--igd-accent);
15
+ }
16
+ }
17
+
18
+ .igd-search-shell {
19
+ grid-template-rows: auto 1fr auto;
26
20
  }
27
21
  }
@@ -95,36 +95,36 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
95
95
  data-show-scope={showScope ? 'true' : 'false'}
96
96
  data-platform-icon={platformIcon ?? ''}
97
97
  >
98
- <button
99
- data-open-modal
100
- disabled
101
- aria-label={placeholder}
102
- aria-keyshortcuts="Control+K"
103
- class="search-trigger"
104
-
105
- >
106
- <igc-icon name="search" collection="docs" aria-hidden="true"></igc-icon>
107
- <span class="search-trigger__lable" aria-hidden="true">{placeholder}</span>
108
-
109
- <kbd class="search-trigger__hint" style="display: none;">
110
- <kbd>Ctrl</kbd><kbd>K</kbd>
111
- </kbd>
112
- </button>
98
+ <div class="search-decoration">
99
+ <igc-icon-button
100
+ class="search-trigger-mobile"
101
+ variant="flat"
102
+ aria-label={placeholder}
103
+ aria-haspopup="dialog"
104
+ data-open-modal
105
+ >
106
+ <igc-icon name="search" collection="docs" aria-hidden="true"></igc-icon>
107
+ </igc-icon-button>
108
+ <igc-input
109
+ data-open-modal
110
+ readonly
111
+ placeholder={placeholder}
112
+ aria-label={placeholder}
113
+ aria-keyshortcuts="Control+K"
114
+ aria-haspopup="dialog"
115
+ role="button"
116
+ class="search-trigger"
117
+ >
118
+ <igc-icon name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
119
+ <kbd class="search-trigger__hint" slot="suffix" style="display: none;">
120
+ <kbd>Ctrl</kbd><kbd>K</kbd>
121
+ </kbd>
122
+ </igc-input>
123
+ </div>
113
124
 
114
125
  <igc-dialog aria-label={placeholder} class="igd-search-dialog" hide-default-action close-on-outside-click>
115
126
  <div class="igd-search-shell">
116
127
  <header class="igd-search-header">
117
- <igc-select placement="bottom-start" distance="17" id="search-scope-select" slot="prefix" class="igd-search-scope" outlined aria-label="Search scope" value="current">
118
- {platformIcon && <igc-icon id="search-scope-trigger-icon" name={platformIcon} collection="docs" slot="prefix" aria-hidden="true"></igc-icon>}
119
- <igc-select-item value="current">
120
- <span data-scope-label>Current package</span>
121
- </igc-select-item>
122
- <igc-select-item value="all">All packages</igc-select-item>
123
- </igc-select>
124
- <igc-tooltip anchor="search-scope-select" class="igd-search-scope-tooltip" placement="bottom" with-arrow></igc-tooltip>
125
-
126
- <igc-divider vertical></igc-divider>
127
-
128
128
  <igc-input
129
129
  type="text"
130
130
  class="igd-search-input"
@@ -137,22 +137,26 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
137
137
  <igc-icon-button slot="suffix" class="igd-search-clear" variant="flat" type="button" aria-label="Clear search" name="clear" collection="docs" hidden></igc-icon-button>
138
138
  </igc-input>
139
139
 
140
- <button
141
- type="button"
142
- data-close-modal
143
- class="search-trigger search-close"
144
- aria-label="Close search"
145
- >
146
- <igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
147
- </button>
148
- </header>
149
-
150
- <igc-divider></igc-divider>
151
-
152
- <div class="igd-search-status" aria-live="polite"></div>
140
+ <igc-select placement="bottom-start" distance="17" id="search-scope-select" slot="prefix" class="igd-search-scope" outlined aria-label="Search scope" value="current">
141
+ {platformIcon && <igc-icon id="search-scope-trigger-icon" name={platformIcon} collection="docs" slot="prefix" aria-hidden="true"></igc-icon>}
142
+ <igc-select-item value="current">
143
+ <span data-scope-label>Current package</span>
144
+ </igc-select-item>
145
+ <igc-select-item value="all">All packages</igc-select-item>
146
+ </igc-select>
147
+ <igc-tooltip anchor="search-scope-select" class="igd-search-scope-tooltip" placement="bottom" with-arrow></igc-tooltip>
153
148
 
154
- <igc-tabs class="igd-search-tabs" activation="manual" hidden></igc-tabs>
155
- <igc-list class="igd-search-results--flat" hidden></igc-list>
149
+ </header>
150
+ <div class="igd-search-content">
151
+ <div class="igd-search-status" aria-live="polite"></div>
152
+ <igc-tabs class="igd-search-tabs"></igc-tabs>
153
+ <igc-list class="igd-search-results--flat" hidden></igc-list>
154
+ </div>
155
+ <footer class="igd-search-footer">
156
+ <igc-button slot="footer" data-close-modal class="search-close" variant="outlined">
157
+ Close
158
+ </igc-button>
159
+ </footer>
156
160
  </div>
157
161
  </igc-dialog>
158
162
  </api-search-advanced>
@@ -162,6 +166,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
162
166
  defineComponents,
163
167
  IgcInputComponent,
164
168
  IgcDialogComponent,
169
+ IgcButtonComponent,
165
170
  IgcSelectComponent,
166
171
  IgcSelectItemComponent,
167
172
  IgcIconButtonComponent,
@@ -178,6 +183,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
178
183
  defineComponents(
179
184
  IgcInputComponent,
180
185
  IgcDialogComponent,
186
+ IgcButtonComponent,
181
187
  IgcSelectComponent,
182
188
  IgcSelectItemComponent,
183
189
  IgcIconButtonComponent,
@@ -295,8 +301,9 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
295
301
  }
296
302
  }
297
303
 
298
- const openBtn = this.querySelector<HTMLButtonElement>('button[data-open-modal]')!;
299
- const closeBtn = this.querySelector<HTMLButtonElement>('button[data-close-modal]')!;
304
+ const openBtn = this.querySelector<HTMLElement>('igc-input[data-open-modal]')!;
305
+ const openBtns = this.querySelectorAll<HTMLElement>('[data-open-modal]');
306
+ const closeBtn = this.querySelector<HTMLElement>('[data-close-modal]')!;
300
307
  this.dialog = this.querySelector<IgcDialogComponent>('igc-dialog')!;
301
308
  this.input = this.querySelector<IgcInputComponent>('igc-input.igd-search-input')!;
302
309
  this.clearBtn = this.querySelector<IgcIconButtonComponent>('.igd-search-clear')!;
@@ -350,19 +357,27 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
350
357
  }
351
358
 
352
359
  const open = async () => {
353
- await this.dialog.show();
360
+ const sw = window.innerWidth - document.documentElement.clientWidth;
361
+ if (sw) document.body.style.paddingRight = `${sw}px`;
354
362
  document.body.toggleAttribute('data-search-modal-open', true);
363
+ await this.dialog.show();
355
364
  this.loadIndex();
356
365
  this.input.focus();
357
366
  };
358
367
 
359
- openBtn.addEventListener('click', open);
360
- openBtn.disabled = false;
368
+ openBtns.forEach(btn => btn.addEventListener('click', open));
369
+ openBtns.forEach(btn => btn.addEventListener('keydown', (e: KeyboardEvent) => {
370
+ if (e.key === 'Enter' || e.key === ' ') {
371
+ e.preventDefault();
372
+ open();
373
+ }
374
+ }));
361
375
 
362
376
  closeBtn.addEventListener('click', () => this.closeModal());
363
377
 
364
378
  this.dialog.addEventListener('igcClosed', () => {
365
379
  document.body.toggleAttribute('data-search-modal-open', false);
380
+ document.body.style.paddingRight = '';
366
381
  });
367
382
 
368
383
  // Close dialog when a result link is clicked — covers both tab panels and the flat list
@@ -854,7 +869,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
854
869
  }
855
870
  tabsHtml.push(
856
871
  `<igc-tab data-tab-id="all" label="All"${this.currentTab === 'all' ? ' selected' : ''}>` +
857
- `<span slot="suffix" class="igd-search-tab-count">/${totalCount}/</span>` +
872
+ `<span slot="suffix" class="igd-search-tab-count">${totalCount}</span>` +
858
873
  allContent.join('') +
859
874
  `</igc-tab>`
860
875
  );
@@ -870,7 +885,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
870
885
  const hasMore = list.length > MAX_PER_CATEGORY_TAB;
871
886
  tabsHtml.push(
872
887
  `<igc-tab data-tab-id="${cat.id}" label="${escapeHtml(cat.label)}"${isSelected ? ' selected' : ''}>` +
873
- `<span slot="suffix" class="igd-search-tab-count">/${list.length}/</span>` +
888
+ `<span slot="suffix" class="igd-search-tab-count">${list.length}</span>` +
874
889
  `<igc-list class="igd-search-results">${displayList.map(m => this.matchHtml(m)).join('')}</igc-list>` +
875
890
  (hasMore ? `<p class="igd-search-refine-hint">Showing first ${MAX_PER_CATEGORY_TAB} of ${list.length} matches &mdash; refine your search to narrow results.</p>` : '') +
876
891
  `</igc-tab>`
@@ -895,7 +910,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
895
910
  const totalCount = Array.from(this.currentMatches.values()).reduce((s, l) => s + l.length, 0);
896
911
  if (totalCount === 0) {
897
912
  this.statusEl.innerHTML = this.currentQuery
898
- ? `No results for "<strong class="igd-search-query">${escapeHtml(this.currentQuery)}</strong>".`
913
+ ? `<span>No results for "<strong class="igd-search-query">${escapeHtml(this.currentQuery)}</strong>".</span>`
899
914
  : 'No results.';
900
915
  } else {
901
916
  this.statusEl.textContent = '';