import { Icon } from 'astro-icon/components';
import { type SidebarEntry } from 'starlight-ion-theme/utils/navigation.js';
import Badge from './Badge.astro';
import { icons } from 'ion:globals';
const { sublist, nested, nestedCount } = Astro.props;
<ul class:list={{ 'top-level': !nested }}>
<li class:list={[{ nested: nested && nestedCount > 1, active: entry.type === 'link' && entry.isCurrent }, entry.label.includes("[") && "has-icon"]}>
{entry.type === 'link' ? (
aria-current={entry.isCurrent && 'page'}
class:list={[{ individual: !nested }, entry.attrs.class, "flex-link"]}
{icons && entry.label.includes("[") && (
<Icon name={entry.label.split("[").pop()?.split("]")[0] || ""} />
<span>{entry.label.split("]").pop()?.trim()}</span>
variant={entry.isCurrent ? 'outline' : entry.badge.variant}
<summary style="pointer-events: none;" class={nested ? "hidden" : ""}>
<div class="group-label">
{icons && entry.label.includes("[") && (
<Icon name={entry.label.split("[").pop()?.split("]")[0] || ""} />
<span class="large">{entry.label.split("]").pop()?.trim()}</span>
<Badge text={entry.badge.text} variant={entry.badge.variant} />
<Astro.self sublist={entry.entries} nested nestedCount={nestedCount + 1} />
color: var(--sl-color-gray-2);
margin-inline-start: var(--sl-sidebar-item-padding-inline);
/* border-inline-start: 1px solid var(--sl-color-hairline-light); */
padding-inline-start: var(--sl-sidebar-item-padding-inline);
font-size: var(--sl-text-lg);
/* color: var(--sl-color-white); */
transition: all 0.1s ease;
font-size: var(--sl-text-md);
transition: all 0.1s ease;
ul:not(.top-level) > li > details {
margin-inline-start: 0.5rem;
padding-inline-start: 0.5rem;
justify-content: space-between;
padding: 0.2em var(--sl-sidebar-item-padding-inline);
border-top: 1px solid var(--sl-color-hairline-light);
font-family: "Space Mono", monospace;
font-weight: 400 !important;
.top-level li:first-of-type > details > summary {
summary::-webkit-details-marker {
display: none !important;
background-image: none !important;
-webkit-appearance: none !important;
transition: transform 0.2s ease-in-out;
:global([dir='rtl']) .caret {
transform: rotateZ(180deg);
[open] > summary .caret {
transform: rotateZ(90deg);
color: var(--sl-color-gray-2);
padding: 0.3em var(--sl-sidebar-item-padding-inline);
color: var(--sl-color-white);
transition: all 0.1s ease;
[aria-current='page']:hover,
[aria-current='page']:focus {
color: var(--sl-color-accent) !important;
filter: drop-shadow(0 0 8px var(--sl-color-accent));
color: var(--sl-color-white) !important;
/* background-color: var(--sl-color-text-accent); */
.group-label, .flex-link {
.group-label > *:not(:last-child) {
margin-inline-end: 0.25em;
@media (min-width: 50rem) {
font-size: var(--sl-text-base);
font-size: var(--sl-text-sm);