igniteui-astro-components 0.0.7 → 0.0.8

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 +4 -2
  2. package/src/assets/icons/open-link-blank.svg +1 -1
  3. package/src/assets/logos/code-sandbox.svg +14 -0
  4. package/src/assets/logos/stackblitz.svg +13 -0
  5. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +1 -1
  6. package/src/components/DocsSidebar/DocsSidebar.astro +15 -8
  7. package/src/components/DocsSidebar/DocsSidebar.scss +152 -2
  8. package/src/components/DocsSidebar/SidebarFilterInput.scss +7 -3
  9. package/src/components/DocsSidebar/SidebarLabel.astro +25 -4
  10. package/src/components/DocsSidebar/toTreeNodes.ts +1 -1
  11. package/src/components/DocsSubHeader/DocsSubHeader.astro +119 -302
  12. package/src/components/DocsSubHeader/DocsSubHeader.scss +111 -11
  13. package/src/components/DocsToc/DocsToc.astro +5 -2
  14. package/src/components/DocsTree/DocsTree.astro +9 -0
  15. package/src/components/DocsTree/docs-tree.scss +139 -118
  16. package/src/components/GlobalNavBar/GlobalNavBar.module.scss +16 -1
  17. package/src/components/LicenseIndicator/LicenseIndicator.astro +19 -0
  18. package/src/components/LicenseIndicator/LicenseIndicator.scss +5 -0
  19. package/src/components/Search/Search.astro +34 -15
  20. package/src/components/Search/Search.scss +10 -42
  21. package/src/components/SearchAdvanced/SearchAdvanced.astro +182 -355
  22. package/src/components/SearchAdvanced/SearchAdvanced.scss +177 -0
  23. package/src/components/mdx/ApiRef/README.md +1 -1
  24. package/src/components/mdx/DocsAside/DocsAside.astro +37 -32
  25. package/src/components/mdx/DocsAside/DocsAside.scss +123 -35
  26. package/src/components/mdx/Sample/Sample.astro +55 -45
  27. package/src/components/mdx/Sample/Sample.scss +173 -30
  28. package/src/integration.ts +7 -0
  29. package/src/layouts/DocsLayout/DocsLayout.astro +58 -16
  30. package/src/layouts/DocsLayout/DocsLayout.scss +51 -6
  31. package/src/lib/sidebar/helpers.ts +14 -1
  32. package/src/lib/sidebar/types.ts +5 -7
  33. package/src/plugins/rehype-heading-anchors.ts +74 -0
  34. package/src/plugins/rehype-table-wrapper.ts +49 -0
  35. package/src/plugins/remark-docfx.ts +0 -0
  36. package/src/scripts/sample-widget.ts +107 -114
  37. package/src/styles/global/_breakpoints.scss +4 -4
  38. package/src/styles/global/_code-blocks.scss +1 -1
  39. package/src/styles/global/_component-themes.scss +118 -18
  40. package/src/styles/global/_index.scss +2 -2
  41. package/src/styles/global/_markdown.scss +444 -32
  42. package/src/styles/global/_palette.scss +7 -0
  43. package/src/styles/global/_search-shared.scss +273 -0
  44. package/src/styles/global/_variables.scss +58 -3
  45. package/src/styles/theme.scss +80 -11
  46. package/src/assets/icons/copy-clipboard.svg +0 -3
  47. package/src/assets/icons/filter-clear.svg +0 -1
  48. package/src/styles/custom.scss +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-astro-components",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
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": {
@@ -47,6 +47,7 @@
47
47
  "./components/SearchAdvanced.astro": "./src/components/SearchAdvanced/SearchAdvanced.astro",
48
48
  "./components/ThemingWidget.astro": "./src/components/ThemingWidget/ThemingWidget.astro",
49
49
  "./components/MobileSidebarToggle.astro": "./src/components/MobileSidebarToggle/MobileSidebarToggle.astro",
50
+ "./components/MobileTocToggle.astro": "./src/components/MobileTocToggle/MobileTocToggle.astro",
50
51
  "./components/DocsToc.astro": "./src/components/DocsToc/DocsToc.astro",
51
52
  "./components/DocsSidebar/DocsSidebar.astro": "./src/components/DocsSidebar/DocsSidebar.astro",
52
53
  "./components/DocsSidebar/SidebarFilterInput.astro": "./src/components/DocsSidebar/SidebarFilterInput.astro",
@@ -69,7 +70,8 @@
69
70
  "./plugins/remark-env-vars": "./src/plugins/remark-env-vars.ts",
70
71
  "./plugins/remark-md-links": "./src/plugins/remark-md-links.ts",
71
72
  "./plugins/remark-html-transforms": "./src/plugins/remark-html-transforms.ts",
72
- "./styles/custom.scss": "./src/styles/custom.scss",
73
+ "./plugins/rehype-table-wrapper": "./src/plugins/rehype-table-wrapper.ts",
74
+ "./plugins/rehype-heading-anchors": "./src/plugins/rehype-heading-anchors.ts",
73
75
  "./styles/theme.scss": "./src/styles/theme.scss",
74
76
  "./package.json": "./package.json"
75
77
  },
@@ -1,3 +1,3 @@
1
- <svg width="18" height="18" viewBox="-3 -3 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M4.21162 15C3.86637 15 3.57812 14.8844 3.34688 14.6531C3.11563 14.4219 3 14.1336 3 13.7884V4.21162C3 3.86637 3.11563 3.57812 3.34688 3.34688C3.57812 3.11563 3.86637 3 4.21162 3H8.42306V3.75H4.21162C4.09613 3.75 3.99031 3.79806 3.89419 3.89419C3.79806 3.99031 3.75 4.09613 3.75 4.21162V13.7884C3.75 13.9039 3.79806 14.0097 3.89419 14.1058C3.99031 14.2019 4.09613 14.25 4.21162 14.25H13.7884C13.9039 14.25 14.0097 14.2019 14.1058 14.1058C14.2019 14.0097 14.25 13.9039 14.25 13.7884V9.57694H15V13.7884C15 14.1336 14.8844 14.4219 14.6531 14.6531C14.4219 14.8844 14.1336 15 13.7884 15H4.21162ZM7.30388 11.2269L6.77306 10.6961L13.7192 3.75H10.5V3H15V7.5H14.25V4.28081L7.30388 11.2269Z" fill="currentColor"/>
3
3
  </svg>
@@ -0,0 +1,14 @@
1
+ <svg width="87" height="12" viewBox="0 0 87 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0 12H12.2882V0H0V12ZM11.0454 10.7863V1.23328H1.2629V10.7863H11.0454Z" fill="currentColor"/>
3
+ <path d="M25.0376 7.06688H23.7145C23.5141 8.24144 22.7122 8.90701 21.6097 8.90701C20.1463 8.90701 19.1841 7.79119 19.1841 6.00979C19.1841 4.22838 20.1062 3.11256 21.5295 3.11256C22.6922 3.11256 23.4339 3.77814 23.6544 4.97227H24.9774C24.7168 3.23002 23.2735 2.09462 21.4894 2.09462C19.3244 2.09462 17.841 3.83687 17.841 6.00979C17.841 8.18271 19.3645 9.92496 21.5295 9.92496C23.3136 9.92496 24.7569 8.80914 25.0376 7.06688Z" fill="currentColor"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M31.1115 7.06688C31.1115 5.57912 30.0491 4.18923 28.3452 4.18923C26.6412 4.18923 25.5788 5.57912 25.5788 7.06688C25.5788 8.55465 26.6412 9.94454 28.3452 9.94454C30.0491 9.92496 31.1115 8.55465 31.1115 7.06688ZM26.8618 7.06688C26.8618 5.89233 27.403 5.08972 28.3251 5.08972C29.2472 5.08972 29.8085 5.89233 29.8085 7.06688C29.8085 8.24144 29.2673 9.04405 28.3251 9.04405C27.383 9.04405 26.8618 8.24144 26.8618 7.06688Z" fill="currentColor"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M35.9226 8.6721H35.8825C35.6018 9.43556 34.9604 9.94454 34.0984 9.94454C32.5548 9.94454 31.7129 8.61338 31.7129 7.06688C31.7129 5.52039 32.5749 4.18923 34.0984 4.18923C34.9604 4.18923 35.6219 4.67863 35.8825 5.44209H35.9226V2.1925H37.1253V9.8075H35.9226V8.6721ZM34.4993 5.08972C33.5571 5.08972 33.0359 5.89233 33.0359 7.06688C33.0359 8.24144 33.5772 9.04405 34.4993 9.04405C35.4214 9.04405 35.9627 8.24144 35.9627 7.06688C35.9627 5.89233 35.4415 5.08972 34.4993 5.08972Z" fill="currentColor"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M43.2194 8.10441H41.9765C41.8362 8.55465 41.5154 9.02447 40.7938 9.02447C39.9318 9.02447 39.3304 8.43719 39.2703 7.43883H43.3196C43.48 5.52039 42.3774 4.16966 40.6936 4.16966C39.0097 4.16966 38.0475 5.52039 38.0475 7.04731C38.0475 8.57423 39.0297 9.92496 40.7136 9.92496C42.0968 9.92496 42.9788 9.20065 43.2194 8.10441ZM40.6936 5.08972C41.5154 5.08972 41.9965 5.65742 42.0767 6.55791H39.2903C39.3705 5.65742 39.8717 5.08972 40.6936 5.08972Z" fill="currentColor"/>
7
+ <path d="M48.0906 5.44209C49.5539 5.77488 50.2956 6.51876 50.2956 7.73246C50.2956 8.94617 49.0327 9.94453 47.2085 9.94453C45.1438 9.94453 44.0212 8.53507 43.9009 7.14519H45.224C45.3041 8.14356 46.126 8.90701 47.2286 8.90701C48.2309 8.90701 48.9525 8.49592 48.9525 7.77162C48.9525 7.14519 48.4714 6.8124 47.4691 6.59706L46.3465 6.34258C44.823 5.99021 44.0613 5.28548 44.0613 4.22838C44.0613 2.95595 45.3442 2.07504 46.9279 2.07504C48.9124 2.07504 49.9348 3.13214 50.0751 4.44372H48.7521C48.6518 3.54323 47.87 3.09299 46.9479 3.09299C46.0258 3.09299 45.4044 3.46493 45.4044 4.11093C45.4044 4.63948 45.8053 4.87439 46.9479 5.12887L48.0906 5.44209Z" fill="currentColor"/>
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M55.0465 8.6721H55.0866V9.82708H56.2894V4.30669H55.0866V5.46166H55.0465C54.7659 4.69821 54.1244 4.20881 53.2624 4.20881C51.759 4.20881 50.877 5.53997 50.877 7.08646C50.877 8.63295 51.7189 9.96411 53.2624 9.96411C54.1244 9.92496 54.7859 9.41599 55.0465 8.6721ZM52.2 7.06688C52.2 5.89233 52.7412 5.08972 53.6634 5.08972C54.5855 5.08972 55.1468 5.89233 55.1468 7.06688C55.1468 8.24144 54.5855 9.04405 53.6634 9.04405C52.7412 9.04405 52.2 8.24144 52.2 7.06688Z" fill="currentColor"/>
9
+ <path d="M58.7751 6.49918V9.8075H57.5323V4.28711H58.735V5.36378H58.7551C58.9956 4.58075 59.577 4.16966 60.3988 4.16966C61.6417 4.16966 62.2631 4.99184 62.2631 6.20555V9.78793H61.0203V6.55791C61.0203 5.53997 60.6394 5.07015 59.8977 5.07015C59.156 5.07015 58.7751 5.5987 58.7751 6.49918Z" fill="currentColor"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M67.3147 8.6721H67.3548V9.82708H68.5576V2.21207H67.3548V5.46166H67.3147C67.0341 4.6982 66.3926 4.20881 65.5306 4.20881C64.0272 4.20881 63.1452 5.53997 63.1452 7.08646C63.1452 8.63295 63.9871 9.96411 65.5306 9.96411C66.3726 9.92496 67.0341 9.41599 67.3147 8.6721ZM64.4482 7.06688C64.4482 5.89233 64.9894 5.08972 65.9115 5.08972C66.8336 5.08972 67.3749 5.89233 67.3749 7.06688C67.3749 8.24144 66.8537 9.04405 65.9115 9.04405C64.9694 9.04405 64.4482 8.24144 64.4482 7.06688Z" fill="currentColor"/>
11
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M72.8274 4.18923C74.3309 4.18923 75.2129 5.52039 75.2129 7.06688C75.2129 8.61338 74.371 9.94454 72.8274 9.94454C71.9654 9.94454 71.3039 9.43556 71.0433 8.6721H71.0032V9.82708H69.8005V2.21207H71.0032V5.46166H71.0433C71.3039 4.67863 71.9654 4.18923 72.8274 4.18923ZM72.4265 5.08972C71.4843 5.08972 70.9631 5.89233 70.9631 7.06688C70.9631 8.24144 71.4843 9.04405 72.4265 9.04405C73.3687 9.04405 73.8899 8.24144 73.8899 7.06688C73.8899 5.87276 73.3687 5.08972 72.4265 5.08972Z" fill="currentColor"/>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M81.3671 7.06688C81.3671 5.57912 80.3046 4.18923 78.6007 4.18923C76.8968 4.18923 75.8343 5.57912 75.8343 7.06688C75.8343 8.55465 76.8767 9.94454 78.6007 9.94454C80.3247 9.94454 81.3671 8.55465 81.3671 7.06688ZM77.1173 7.06688C77.1173 5.89233 77.6585 5.08972 78.5807 5.08972C79.5028 5.08972 80.0641 5.89233 80.0641 7.06688C80.0641 8.24144 79.5228 9.04405 78.5807 9.04405C77.6585 9.04405 77.1173 8.24144 77.1173 7.06688Z" fill="currentColor"/>
13
+ <path d="M84.1134 7.67374L82.6099 9.82708H81.2267L83.3917 6.85155L81.5074 4.30669H82.8906L84.1134 6.02936L85.3362 4.30669H86.7194L84.835 6.85155L87 9.82708H85.6168L84.1134 7.67374Z" fill="currentColor"/>
14
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg width="68" height="13" viewBox="0 0 68 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.88622 8.03861C3.9469 7.92194 3.82553 7.80527 3.70417 7.80527H0.18451C0.0024587 7.80527 -0.0582248 7.63027 0.0631424 7.51361L6.79901 0.0469632C6.92038 -0.0697064 7.16312 0.0469632 7.10243 0.221963L5.464 5.0053C5.40331 5.12196 5.464 5.23861 5.58536 5.23861H9.105C9.28705 5.23861 9.34773 5.41361 9.22637 5.53027L2.49049 12.9386C2.36912 13.0553 2.12639 12.9386 2.18707 12.7636L3.88622 8.03861Z" fill="currentColor"/>
3
+ <path d="M17.2971 10.4302C19.0569 10.4302 20.3313 9.49688 20.3313 7.98022C20.3313 6.28855 18.9355 5.88022 17.6005 5.47188C16.3261 5.12188 16.0227 4.83022 16.0227 4.30522C16.0227 3.83855 16.4475 3.48855 17.115 3.48855C17.9646 3.48855 18.4501 3.89688 18.6928 4.53855L20.0885 3.78022C19.5424 2.61355 18.4501 1.97188 17.115 1.97188C15.6586 1.97188 14.3842 2.84688 14.3842 4.42188C14.3842 5.99688 15.6586 6.52188 16.933 6.87188C18.2073 7.22188 18.7535 7.45521 18.7535 8.03855C18.7535 8.50522 18.3894 8.91355 17.4184 8.91355C16.3868 8.91355 15.78 8.44688 15.4765 7.68855L14.0808 8.50522C14.4449 9.67188 15.5979 10.4302 17.2971 10.4302Z" fill="currentColor"/>
4
+ <path d="M24.5794 4.48022H23.2443V2.84688L21.7272 3.31355V4.48022H20.6956V5.93855H21.7272V8.38855C21.7272 9.96355 22.4554 10.6052 24.64 10.3719V9.03022C23.7298 9.08855 23.305 9.08855 23.305 8.44688V5.99688H24.5794V4.48022Z" fill="currentColor"/>
5
+ <path d="M30.0408 4.48022V5.18022C29.616 4.65522 28.9485 4.30522 28.099 4.30522C26.5212 4.30522 25.1861 5.64688 25.1861 7.39688C25.1861 9.14688 26.5212 10.4885 28.099 10.4885C28.9485 10.4885 29.616 10.1385 30.0408 9.61355V10.3135H31.5579V4.48022H30.0408ZM28.4024 9.03022C27.4314 9.03022 26.7639 8.38855 26.7639 7.39688C26.7639 6.40522 27.4921 5.76355 28.4024 5.76355C29.3733 5.76355 30.0408 6.40522 30.0408 7.39688C30.0408 8.38855 29.3733 9.03022 28.4024 9.03022Z" fill="currentColor"/>
6
+ <path d="M35.8664 10.4303C37.0194 10.4303 38.051 9.84694 38.5972 8.91361L37.2621 8.15527C37.0194 8.62194 36.5339 8.91361 35.8664 8.91361C34.9562 8.91361 34.2886 8.27194 34.2886 7.33861C34.2886 6.40527 34.9562 5.76361 35.8664 5.76361C36.4733 5.76361 37.0194 6.05527 37.2015 6.52194L38.5365 5.76361C38.051 4.88864 37.0194 4.24697 35.8664 4.24697C34.0459 4.24697 32.7109 5.58861 32.7109 7.33861C32.7109 9.08861 34.0459 10.4303 35.8664 10.4303Z" fill="currentColor"/>
7
+ <path d="M44.9083 10.3136L42.4203 7.33861L44.8476 4.48024H43.0271L40.9639 7.04694V2.14691H39.3861V10.3136H40.9032V7.68861L43.0878 10.3136H44.9083Z" fill="currentColor"/>
8
+ <path d="M50.7946 6.05527C51.2801 5.64694 51.5835 5.12191 51.5835 4.42191C51.5835 3.08024 50.4305 2.14691 49.0348 2.14691H45.7579V10.3136H49.3382C50.7946 10.3136 51.9476 9.32194 51.9476 7.92194C51.8869 7.04694 51.4621 6.40527 50.7946 6.05527ZM49.0348 3.60524C49.5809 3.60524 49.945 4.01358 49.945 4.48024C49.945 4.94691 49.5809 5.35527 49.0348 5.35527H47.3963V3.60524H49.0348ZM49.2775 8.79694H47.3963V6.87194H49.2775C49.8237 6.87194 50.2485 7.28027 50.2485 7.80527C50.2485 8.38861 49.8237 8.79694 49.2775 8.79694Z" fill="currentColor"/>
9
+ <path d="M52.9184 10.3137H54.4355V1.797H52.9184V10.3137Z" fill="currentColor"/>
10
+ <path d="M56.6201 3.7803C57.1663 3.7803 57.5911 3.37197 57.5911 2.84697C57.5911 2.32197 57.1663 1.91364 56.6201 1.91364C56.1347 1.91364 55.6492 2.32197 55.6492 2.84697C55.6492 3.37197 56.1347 3.7803 56.6201 3.7803ZM55.8919 10.3136H57.409V4.4803H55.8919V10.3136Z" fill="currentColor"/>
11
+ <path d="M62.2639 4.48022H60.9288V2.84688L59.4116 3.31355V4.48022H58.38V5.93855H59.4116V8.38855C59.4116 9.96355 60.1398 10.6052 62.3245 10.3719V9.03022C61.4143 9.08855 60.9895 9.08855 60.9895 8.44688V5.99688H62.2639V4.48022Z" fill="currentColor"/>
12
+ <path d="M65.1767 8.85527L67.7254 5.41361V4.48024H63.2348V5.88027H65.6621L63.1134 9.32194V10.3136H67.8468V8.91361H65.1767V8.85527Z" fill="currentColor"/>
13
+ </svg>
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  .docs-breadcrumb-list {
10
- @include type-style('subtitle-2') {
10
+ @include type-style('overline') {
11
11
  margin: 0;
12
12
  };
13
13
 
@@ -42,7 +42,9 @@ const activeId = normalizeSlug(currentSlug);
42
42
  ---
43
43
 
44
44
  <sidebar-filter class="docs-sidebar" id="docs-sidebar" data-no-results="No topics match">
45
- { showFilter && <SidebarFilterInput/> }
45
+ <div class="sidebar-gutter">
46
+ { showFilter && <SidebarFilterInput/> }
47
+ </div>
46
48
  <div class="sidebar-scroll" data-sidebar-scroll>
47
49
  <DocsTree
48
50
  nodes={ nodes }
@@ -54,6 +56,7 @@ const activeId = normalizeSlug(currentSlug);
54
56
  />
55
57
  </div>
56
58
  </sidebar-filter>
59
+ <div class="docs-sidebar-backdrop" id="docs-sidebar-backdrop" aria-hidden="true"></div>
57
60
 
58
61
  <script>
59
62
  // Register Ignite UI Web Components used by the sidebar filter input.
@@ -62,23 +65,27 @@ const activeId = normalizeSlug(currentSlug);
62
65
  // import { ... } from '@infragistics/igniteui-webcomponents';
63
66
  import {
64
67
  defineComponents,
68
+ IgcBadgeComponent,
65
69
  IgcInputComponent,
66
70
  IgcButtonComponent,
67
71
  IgcIconComponent,
68
72
  } from 'igniteui-webcomponents';
69
73
 
70
- defineComponents(IgcInputComponent, IgcButtonComponent, IgcIconComponent);
74
+ defineComponents(IgcBadgeComponent, IgcInputComponent, IgcButtonComponent, IgcIconComponent);
71
75
 
72
76
  // Icons (sidebar-filter-search, sidebar-filter-clear) are registered via
73
77
  // the icon registry which picks up all SVGs from src/assets/icons/.
74
78
  import '../../scripts/icon-registry';
75
79
 
76
80
  import './sidebar-filter';
77
- </script>
78
81
 
79
- { showFilter === false && (
80
- <style is:global>
81
- #docs-sidebar [data-sidebar-filter-status] { display: none; }
82
- </style>
83
- ) }
82
+ // Close the sidebar overlay when the backdrop is clicked.
83
+ document.addEventListener('click', (e) => {
84
+ if ((e.target as Element | null)?.closest('#docs-sidebar-backdrop')) {
85
+ document.body.removeAttribute('data-sidebar-open');
86
+ const toggle = document.querySelector<HTMLElement>('[data-sidebar-toggle]');
87
+ toggle?.setAttribute('aria-expanded', 'false');
88
+ }
89
+ });
90
+ </script>
84
91
 
@@ -1,18 +1,168 @@
1
1
  @use 'igniteui-theming/sass/typography' as *;
2
+ @use '../../styles/global/breakpoints' as *;
2
3
 
3
4
  .docs-sidebar {
4
5
  display: flex;
5
6
  flex-direction: column;
6
7
  z-index: 0;
7
8
  border-inline-end: var(--igd-app-outline);
8
- padding-inline: var(--igd-padding-lg);
9
+ padding-inline: var(--igd-padding-md);
9
10
  padding-block: calc(var(--igd-padding-lg) + rem(14px));
10
11
  background-color: var(--igd-layout-sections-bg);
11
- overflow-y: auto;
12
12
  position: sticky;
13
13
  top: var(--igd-header-height);
14
14
  height: calc(100dvh - var(--igd-header-height));
15
15
  max-height: 100dvh;
16
16
  align-self: start;
17
17
  gap: rem(24px);
18
+
19
+ // On tablet/mobile: sidebar becomes a full-height fixed overlay, hidden off-screen by default.
20
+ @media (max-width: #{$bp-tablet-max}) {
21
+ position: fixed;
22
+ inset-block: 0;
23
+ inset-inline-start: 0;
24
+ height: 100dvh;
25
+ max-height: 100dvh;
26
+ width: min(rem(360px), 85vw);
27
+ z-index: 100;
28
+ transform: translateX(-100%);
29
+ transition: transform 250ms ease, box-shadow 250ms ease;
30
+ box-shadow: none;
31
+ }
32
+
33
+ .sidebar-gutter {
34
+ overflow-y: hidden;
35
+ scrollbar-gutter: stable;
36
+
37
+ // This Makes sure the input border is visible
38
+ // This is the height of the input in fluent theme + 8px padding
39
+ // TODO this can be made smart using a css variable to override the original height of the input and used here
40
+ min-height: rem(40px);
41
+ }
42
+ }
43
+
44
+ // Overlay backdrop — only visible on tablet when sidebar is open.
45
+ .docs-sidebar-backdrop {
46
+ display: none;
47
+
48
+ @media (max-width: #{$bp-tablet-max}) {
49
+ display: block;
50
+ position: fixed;
51
+ inset: 0;
52
+ z-index: 99;
53
+ background: rgba(0, 0, 0, 0.4);
54
+ opacity: 0;
55
+ pointer-events: none;
56
+ transition: opacity 250ms ease;
57
+ }
58
+ }
59
+
60
+ // Open state — driven by data-sidebar-open on <body>
61
+ body[data-sidebar-open] {
62
+ @media (max-width: #{$bp-tablet-max}) {
63
+ overflow: hidden;
64
+
65
+ .docs-sidebar {
66
+ transform: translateX(0);
67
+ box-shadow: var(--ig-elevation-8);
68
+ }
69
+
70
+ .docs-sidebar-backdrop {
71
+ opacity: 1;
72
+ pointer-events: auto;
73
+ }
74
+ }
75
+ }
76
+
77
+ .sidebar-scroll {
78
+ overflow-y: auto;
79
+ scrollbar-gutter: stable;
80
+ }
81
+
82
+ .sidebar-badge {
83
+ --border-radius: #{rem(4px)};
84
+ --elevation: none;
85
+
86
+ &::part(base) {
87
+ @include type-style('overline') {
88
+ margin: 0;
89
+ };
90
+
91
+ border-radius: var(--border-radius);
92
+ border-width: rem(1px);
93
+ border-style: solid;
94
+ border-color: var(--border-color);
95
+ }
96
+ }
97
+
98
+ .updated {
99
+ --background-color: var(--igd-updated-bg);
100
+ --text-color: var(--igd-updated-color);
101
+ --icon-color: var(--igd-updated-color);
102
+ --border-color: var(--igd-updated-border);
103
+ }
104
+
105
+ .new {
106
+ --background-color: var(--igd-new-bg);
107
+ --text-color: var(--igd-new-color);
108
+ --icon-color: var(--igd-new-color);
109
+ --border-color: var(--igd-new-border);
110
+ }
111
+
112
+ .preview {
113
+ --background-color: var(--igd-preview-bg);
114
+ --text-color: var(--igd-preview-color);
115
+ --icon-color: var(--igd-preview-color);
116
+ --border-color: var(--igd-preview-border);
117
+ }
118
+
119
+
120
+ .premium {
121
+ --background-color: var(--igd-premium-bg);
122
+ --text-color: var(--igd-premium-color);
123
+ --icon-color: var(--igd-premium-color);
124
+ --border-color: var(--igd-premium-border);
125
+ }
126
+
127
+ .opensource {
128
+ --background-color: var(--igd-opensource-bg);
129
+ --text-color: var(--igd-opensource-color);
130
+ --icon-color: var(--igd-opensource-color);
131
+ --border-color: var(--igd-opensource-border);
132
+ }
133
+
134
+ .sidebar-premium-icon {
135
+ justify-self: end;
136
+ color: var(--igd-premium-color);
137
+ flex-shrink: 0;
138
+ }
139
+
140
+ .igd-lable-and-badge {
141
+ display: flex;
142
+ align-items: center;
143
+ gap: rem(4px);
144
+
145
+ igc-badge {
146
+ justify-self: end;
147
+ }
148
+ }
149
+
150
+ .group-label-text {
151
+ @include type-style('body-2') {
152
+ margin: 0;
153
+ };
154
+
155
+ color: light-dark(var(--ig-gray-800), var(--ig-gray-600));
156
+ }
157
+
158
+ .group-label-count {
159
+ color: light-dark(var(--ig-gray-500), var(--ig-gray-600));
160
+ margin-inline-start: rem(8px)
161
+ }
162
+
163
+ .igd-badge-container {
164
+ display: flex;
165
+ align-items: center;
166
+ gap: rem(4px);
167
+ margin-left: auto;
18
168
  }
@@ -31,8 +31,12 @@ igc-input::part(container) {
31
31
  border-block-end: rem(1px) solid light-dark(var(--ig-gray-200), var(--ig-gray-300));
32
32
 
33
33
  border-radius: 0;
34
- padding-inline-start: rem(16px);
35
- padding-inline-end: rem(8px);
34
+ padding-inline: rem(16px);
35
+
36
+ // TODO make this more stable using css vars
37
+ // padding-inline-end is 8px(padding) - 5px(scrollbar width)
38
+ padding-inline-end: rem(3px);
39
+
36
40
  padding-block-end: rem(8px);
37
41
 
38
42
  &::before {
@@ -61,7 +65,7 @@ igc-button {
61
65
  }
62
66
 
63
67
  color: light-dark(var(--ig-gray-600), var(--ig-gray-700));
64
- padding: rem(16px) rem(24px);
68
+ padding-inline: rem(24px);
65
69
 
66
70
  &:empty {
67
71
  display: none;
@@ -22,14 +22,35 @@ interface Props {
22
22
  }
23
23
 
24
24
  const { node, isLeaf } = Astro.props;
25
- const badge = (node.meta?.badge ?? null) as SidebarBadge | null;
25
+ const childCount = !isLeaf ? (node.children?.length ?? 0) : 0;
26
+ const badges = (node.meta?.badges ?? []) as SidebarBadge[];
26
27
  ---
27
28
 
28
29
  {isLeaf ? (
29
30
  <>
30
- <span class="docs-tree-label">{node.label}</span>
31
- {badge && <span class={`sl-badge ${badge.variant}`}>{badge.text}</span>}
31
+ <div class="igd-lable-and-badge">
32
+ <span class="docs-tree-label">{node.label}</span>
33
+ {badges.length > 0 && (
34
+ <div class="igd-badge-container">
35
+ {badges.filter(b => b.variant !== 'premium').map((badge) => (
36
+ <>
37
+ <igc-badge class={`sidebar-badge ${badge.variant}`} aria-hidden="true">{badge.text}</igc-badge>
38
+ <span class="visually-hidden">, {badge.text}</span>
39
+ </>
40
+ ))}
41
+ {badges.some(b => b.variant === 'premium') && (
42
+ <>
43
+ <igc-icon name="premium" collection="docs" class="sidebar-premium-icon" aria-hidden="true"></igc-icon>
44
+ <span class="visually-hidden">, Premium</span>
45
+ </>
46
+ )}
47
+ </div>
48
+ )}
49
+ </div>
32
50
  </>
33
51
  ) : (
34
- <span class="group-label-text">{node.label}</span>
52
+ <span class="group-label-text">
53
+ <span>{node.label}</span>
54
+ <span class="group-label-count">/{childCount}/</span>
55
+ </span>
35
56
  )}
@@ -62,7 +62,7 @@ const toNode = (
62
62
  slug: entry.slug,
63
63
  },
64
64
  linkAttrs: entry.attrs,
65
- meta: entry.badge ? { badge: entry.badge } : undefined,
65
+ meta: entry.badges?.length ? { badges: entry.badges } : undefined,
66
66
  };
67
67
  };
68
68