igniteui-astro-components 0.0.17 → 0.0.19

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 (44) 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 +87 -53
  21. package/src/components/SearchAdvanced/SearchAdvanced.scss +22 -30
  22. package/src/components/mdx/DocsAside/DocsAside.scss +10 -14
  23. package/src/layouts/DocsLayout/DocsLayout.astro +5 -5
  24. package/src/layouts/DocsLayout/DocsLayout.scss +58 -97
  25. package/src/scripts/icon-manifest.ts +73 -0
  26. package/src/scripts/icon-registry.ts +4 -35
  27. package/src/styles/global/_breakpoints.scss +0 -1
  28. package/src/styles/global/_code-blocks.scss +1 -0
  29. package/src/styles/global/_component-themes.scss +133 -125
  30. package/src/styles/global/_icon-gallery.scss +108 -0
  31. package/src/styles/global/_index.scss +1 -0
  32. package/src/styles/global/_markdown.scss +127 -16
  33. package/src/styles/global/_palette.scss +101 -101
  34. package/src/styles/global/_search-shared.scss +302 -315
  35. package/src/styles/global/_type-scale.scss +17 -17
  36. package/src/styles/global/_variables.scss +15 -6
  37. package/src/styles/theme.scss +7 -61
  38. package/src/assets/icons/classes.svg +0 -3
  39. package/src/assets/icons/enumerations.svg +0 -3
  40. package/src/assets/icons/functions.svg +0 -5
  41. package/src/assets/icons/interfaces.svg +0 -3
  42. package/src/assets/icons/type-alias.svg +0 -3
  43. package/src/assets/icons/variables.svg +0 -3
  44. /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
  }