@treeseed/core 0.1.2
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.
- package/README.md +145 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/registry-helper.js +14 -0
- package/dist/agents/registry.js +88 -0
- package/dist/components/DevWatchReload.astro +45 -0
- package/dist/components/SiteTitle.astro +51 -0
- package/dist/components/content/ContentStatusLegend.astro +18 -0
- package/dist/components/content/StatusBadge.astro +11 -0
- package/dist/components/docs/BookFontControls.astro +180 -0
- package/dist/components/docs/DesktopSidebarToggle.astro +88 -0
- package/dist/components/docs/DownloadBook.astro +34 -0
- package/dist/components/docs/Footer.astro +196 -0
- package/dist/components/docs/Header.astro +150 -0
- package/dist/components/docs/PageFrame.astro +260 -0
- package/dist/components/docs/PageSidebar.astro +63 -0
- package/dist/components/docs/PageTitle.astro +39 -0
- package/dist/components/docs/Sidebar.astro +41 -0
- package/dist/components/docs/ThemeSelect.astro +3 -0
- package/dist/components/forms/ContactForm.astro +234 -0
- package/dist/components/forms/FooterSubscribeForm.astro +189 -0
- package/dist/components/site/BookList.astro +27 -0
- package/dist/components/site/CTASection.astro +24 -0
- package/dist/components/site/ChronicleList.astro +33 -0
- package/dist/components/site/Hero.astro +18 -0
- package/dist/components/site/NotesList.astro +18 -0
- package/dist/components/site/PathCard.astro +16 -0
- package/dist/components/site/ProfileList.astro +30 -0
- package/dist/components/site/SectionIntro.astro +9 -0
- package/dist/components/site/StageBanner.astro +8 -0
- package/dist/components/site/TrustCallout.astro +9 -0
- package/dist/components/starlight.js +6 -0
- package/dist/config.js +8 -0
- package/dist/content-config.js +9 -0
- package/dist/content.js +230 -0
- package/dist/contracts.d.ts +130 -0
- package/dist/contracts.js +0 -0
- package/dist/deploy/config.d.ts +4 -0
- package/dist/deploy/config.js +154 -0
- package/dist/deploy/runtime.js +77 -0
- package/dist/env.yaml +322 -0
- package/dist/environment.d.ts +130 -0
- package/dist/environment.js +324 -0
- package/dist/index.js +81 -0
- package/dist/layouts/AuthoredEntryLayout.astro +87 -0
- package/dist/layouts/BookLayout.astro +35 -0
- package/dist/layouts/BridgeLayout.astro +11 -0
- package/dist/layouts/ContentLayout.astro +24 -0
- package/dist/layouts/MainLayout.astro +203 -0
- package/dist/layouts/NoteLayout.astro +26 -0
- package/dist/layouts/ProfileLayout.astro +81 -0
- package/dist/middleware/starlightRouteData.js +45 -0
- package/dist/pages/404.astro +29 -0
- package/dist/pages/[slug].astro +30 -0
- package/dist/pages/agents/[slug].astro +29 -0
- package/dist/pages/agents/index.astro +27 -0
- package/dist/pages/api/form/submit.js +14 -0
- package/dist/pages/books/[slug].astro +19 -0
- package/dist/pages/books/index.astro +28 -0
- package/dist/pages/contact.astro +27 -0
- package/dist/pages/feed.xml.js +34 -0
- package/dist/pages/index.astro +290 -0
- package/dist/pages/notes/[slug].astro +19 -0
- package/dist/pages/notes/index.astro +21 -0
- package/dist/pages/objectives/[slug].astro +31 -0
- package/dist/pages/objectives/index.astro +30 -0
- package/dist/pages/people/[slug].astro +29 -0
- package/dist/pages/people/index.astro +28 -0
- package/dist/pages/questions/[slug].astro +31 -0
- package/dist/pages/questions/index.astro +30 -0
- package/dist/plugin-default.js +4 -0
- package/dist/plugins/builtin/default-plugin.d.ts +21 -0
- package/dist/plugins/builtin/default-plugin.js +32 -0
- package/dist/plugins/constants.d.ts +21 -0
- package/dist/plugins/constants.js +28 -0
- package/dist/plugins/plugin.d.ts +42 -0
- package/dist/plugins/plugin.js +6 -0
- package/dist/plugins/runtime.d.ts +31 -0
- package/dist/plugins/runtime.js +120 -0
- package/dist/scripts/aggregate-book.js +112 -0
- package/dist/scripts/assert-release-tag-version.js +21 -0
- package/dist/scripts/build-dist.js +384 -0
- package/dist/scripts/build-tenant-worker.js +36 -0
- package/dist/scripts/package-tools.js +88 -0
- package/dist/scripts/patch-starlight-content-path.js +172 -0
- package/dist/scripts/paths.js +11 -0
- package/dist/scripts/publish-package.js +20 -0
- package/dist/scripts/release-verify.js +52 -0
- package/dist/scripts/run-fixture-astro-command.js +21 -0
- package/dist/scripts/tenant-astro-command.js +3 -0
- package/dist/scripts/tenant-build.js +16 -0
- package/dist/scripts/tenant-check.js +7 -0
- package/dist/scripts/test-smoke.js +105 -0
- package/dist/server.js +53 -0
- package/dist/site-resources.d.ts +29 -0
- package/dist/site-resources.js +127 -0
- package/dist/site.js +313 -0
- package/dist/styles/global.css +683 -0
- package/dist/styles/prose.css +89 -0
- package/dist/styles/tokens.css +24 -0
- package/dist/tenant/bridge.js +5 -0
- package/dist/tenant/config.d.ts +9 -0
- package/dist/tenant/config.js +124 -0
- package/dist/tenant/runtime-config.js +20 -0
- package/dist/tsconfigs/strict.json +3 -0
- package/dist/types/agents.d.ts +1 -0
- package/dist/types/agents.js +1 -0
- package/dist/types/astro-build.d.js +0 -0
- package/dist/types/cloudflare-sockets.d.js +0 -0
- package/dist/types/cloudflare.d.ts +1 -0
- package/dist/types/cloudflare.js +1 -0
- package/dist/types/forms.js +4 -0
- package/dist/utils/agents/adapters/execution.js +90 -0
- package/dist/utils/agents/adapters/mutations.js +30 -0
- package/dist/utils/agents/adapters/notification.js +16 -0
- package/dist/utils/agents/adapters/repository.js +61 -0
- package/dist/utils/agents/adapters/research.js +25 -0
- package/dist/utils/agents/adapters/verification.js +62 -0
- package/dist/utils/agents/cli-tools.js +5 -0
- package/dist/utils/agents/contracts/messages.d.ts +88 -0
- package/dist/utils/agents/contracts/messages.js +138 -0
- package/dist/utils/agents/contracts/run.d.ts +20 -0
- package/dist/utils/agents/contracts/run.js +0 -0
- package/dist/utils/agents/runtime-types.d.ts +117 -0
- package/dist/utils/agents/runtime-types.js +4 -0
- package/dist/utils/books-data.js +82 -0
- package/dist/utils/content-status.js +38 -0
- package/dist/utils/forms/config.js +87 -0
- package/dist/utils/forms/constants.js +27 -0
- package/dist/utils/forms/contact-submissions-local.js +19 -0
- package/dist/utils/forms/contact-submissions.js +72 -0
- package/dist/utils/forms/crypto.js +64 -0
- package/dist/utils/forms/guard.js +76 -0
- package/dist/utils/forms/http.js +51 -0
- package/dist/utils/forms/provider-core.js +88 -0
- package/dist/utils/forms/routing-core.js +7 -0
- package/dist/utils/forms/routing.js +13 -0
- package/dist/utils/forms/runtime-core.js +17 -0
- package/dist/utils/forms/runtime.js +27 -0
- package/dist/utils/forms/service-core.js +256 -0
- package/dist/utils/forms/service.js +55 -0
- package/dist/utils/forms/session.js +57 -0
- package/dist/utils/forms/smtp-cloudflare.js +107 -0
- package/dist/utils/forms/smtp-node.js +27 -0
- package/dist/utils/forms/smtp.js +10 -0
- package/dist/utils/forms/subscribers-local.js +21 -0
- package/dist/utils/forms/subscribers.js +53 -0
- package/dist/utils/forms/turnstile.js +31 -0
- package/dist/utils/forms/validation.js +58 -0
- package/dist/utils/hub-content.js +28 -0
- package/dist/utils/plugin-runtime.js +158 -0
- package/dist/utils/routes.js +17 -0
- package/dist/utils/seo.js +4 -0
- package/dist/utils/site-config-schema.js +282 -0
- package/dist/utils/site-config.js +122 -0
- package/dist/utils/starlight-nav.js +62 -0
- package/dist/utils/theme.js +49 -0
- package/dist/vendor/starlight/components/AnchorHeading.astro +53 -0
- package/dist/vendor/starlight/components/Banner.astro +23 -0
- package/dist/vendor/starlight/components/ContentNotice.astro +33 -0
- package/dist/vendor/starlight/components/ContentPanel.astro +27 -0
- package/dist/vendor/starlight/components/DraftContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/EditLink.astro +28 -0
- package/dist/vendor/starlight/components/FallbackContentNotice.astro +5 -0
- package/dist/vendor/starlight/components/Footer.astro +61 -0
- package/dist/vendor/starlight/components/Head.astro +5 -0
- package/dist/vendor/starlight/components/Header.astro +94 -0
- package/dist/vendor/starlight/components/Hero.astro +143 -0
- package/dist/vendor/starlight/components/Icons.js +121 -0
- package/dist/vendor/starlight/components/LanguageSelect.astro +57 -0
- package/dist/vendor/starlight/components/LastUpdated.astro +14 -0
- package/dist/vendor/starlight/components/MarkdownContent.astro +5 -0
- package/dist/vendor/starlight/components/MobileMenuFooter.astro +35 -0
- package/dist/vendor/starlight/components/MobileMenuToggle.astro +107 -0
- package/dist/vendor/starlight/components/MobileTableOfContents.astro +151 -0
- package/dist/vendor/starlight/components/Page.astro +126 -0
- package/dist/vendor/starlight/components/PageFrame.astro +97 -0
- package/dist/vendor/starlight/components/PageSidebar.astro +59 -0
- package/dist/vendor/starlight/components/PageTitle.astro +17 -0
- package/dist/vendor/starlight/components/Pagination.astro +79 -0
- package/dist/vendor/starlight/components/Search.astro +488 -0
- package/dist/vendor/starlight/components/Select.astro +99 -0
- package/dist/vendor/starlight/components/Sidebar.astro +15 -0
- package/dist/vendor/starlight/components/SidebarPersistState.js +43 -0
- package/dist/vendor/starlight/components/SidebarPersister.astro +78 -0
- package/dist/vendor/starlight/components/SidebarRestorePoint.astro +12 -0
- package/dist/vendor/starlight/components/SidebarSublist.astro +154 -0
- package/dist/vendor/starlight/components/SiteTitle.astro +59 -0
- package/dist/vendor/starlight/components/SkipLink.astro +26 -0
- package/dist/vendor/starlight/components/SocialIcons.astro +32 -0
- package/dist/vendor/starlight/components/StarlightPage.astro +17 -0
- package/dist/vendor/starlight/components/TableOfContents/TableOfContentsList.astro +79 -0
- package/dist/vendor/starlight/components/TableOfContents/starlight-toc.js +93 -0
- package/dist/vendor/starlight/components/TableOfContents.astro +18 -0
- package/dist/vendor/starlight/components/ThemeProvider.astro +38 -0
- package/dist/vendor/starlight/components/ThemeSelect.astro +73 -0
- package/dist/vendor/starlight/components/TwoColumnContent.astro +54 -0
- package/dist/vendor/starlight/components.js +26 -0
- package/dist/vendor/starlight/constants.js +4 -0
- package/dist/vendor/starlight/expressive-code.d.js +1 -0
- package/dist/vendor/starlight/global.d.js +0 -0
- package/dist/vendor/starlight/i18n.d.js +1 -0
- package/dist/vendor/starlight/index.js +119 -0
- package/dist/vendor/starlight/integrations/asides-error.js +12 -0
- package/dist/vendor/starlight/integrations/asides.js +179 -0
- package/dist/vendor/starlight/integrations/code-rtl-support.js +21 -0
- package/dist/vendor/starlight/integrations/expressive-code/hast.d.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/index.js +63 -0
- package/dist/vendor/starlight/integrations/expressive-code/preprocessor.js +92 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc +1796 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc +1695 -0
- package/dist/vendor/starlight/integrations/expressive-code/themes/night-owl-light.jsonc.js +1 -0
- package/dist/vendor/starlight/integrations/expressive-code/theming.js +62 -0
- package/dist/vendor/starlight/integrations/expressive-code/translations.js +29 -0
- package/dist/vendor/starlight/integrations/heading-links.js +61 -0
- package/dist/vendor/starlight/integrations/pagefind.js +43 -0
- package/dist/vendor/starlight/integrations/remark-rehype.js +68 -0
- package/dist/vendor/starlight/integrations/shared/absolutePathToLang.js +15 -0
- package/dist/vendor/starlight/integrations/shared/localeToLang.js +9 -0
- package/dist/vendor/starlight/integrations/shared/slugToLocale.js +10 -0
- package/dist/vendor/starlight/integrations/sitemap.js +20 -0
- package/dist/vendor/starlight/integrations/virtual-user-config.js +110 -0
- package/dist/vendor/starlight/integrations/vite-layer-order.js +42 -0
- package/dist/vendor/starlight/internal.js +6 -0
- package/dist/vendor/starlight/loaders.js +36 -0
- package/dist/vendor/starlight/locals.d.js +0 -0
- package/dist/vendor/starlight/locals.js +30 -0
- package/dist/vendor/starlight/package.json +231 -0
- package/dist/vendor/starlight/package.json.js +248 -0
- package/dist/vendor/starlight/props.js +0 -0
- package/dist/vendor/starlight/route-data.js +6 -0
- package/dist/vendor/starlight/routes/common.astro +23 -0
- package/dist/vendor/starlight/routes/ssr/404.astro +7 -0
- package/dist/vendor/starlight/routes/ssr/index.astro +14 -0
- package/dist/vendor/starlight/routes/static/404.astro +7 -0
- package/dist/vendor/starlight/routes/static/index.astro +12 -0
- package/dist/vendor/starlight/schema.js +102 -0
- package/dist/vendor/starlight/schemas/badge.js +26 -0
- package/dist/vendor/starlight/schemas/components.js +235 -0
- package/dist/vendor/starlight/schemas/expressiveCode.js +12 -0
- package/dist/vendor/starlight/schemas/favicon.js +33 -0
- package/dist/vendor/starlight/schemas/head.js +32 -0
- package/dist/vendor/starlight/schemas/hero.js +57 -0
- package/dist/vendor/starlight/schemas/i18n.js +101 -0
- package/dist/vendor/starlight/schemas/icon.js +7 -0
- package/dist/vendor/starlight/schemas/logo.js +24 -0
- package/dist/vendor/starlight/schemas/pagefind.js +108 -0
- package/dist/vendor/starlight/schemas/prevNextLink.js +14 -0
- package/dist/vendor/starlight/schemas/sidebar.js +80 -0
- package/dist/vendor/starlight/schemas/site-title.js +19 -0
- package/dist/vendor/starlight/schemas/social.js +19 -0
- package/dist/vendor/starlight/schemas/tableOfContents.js +16 -0
- package/dist/vendor/starlight/style/anchor-links.css +131 -0
- package/dist/vendor/starlight/style/asides.css +51 -0
- package/dist/vendor/starlight/style/layers.css +1 -0
- package/dist/vendor/starlight/style/markdown.css +253 -0
- package/dist/vendor/starlight/style/print.css +175 -0
- package/dist/vendor/starlight/style/props.css +188 -0
- package/dist/vendor/starlight/style/reset.css +52 -0
- package/dist/vendor/starlight/style/util.css +63 -0
- package/dist/vendor/starlight/translations/ar.json +30 -0
- package/dist/vendor/starlight/translations/ar.json.js +32 -0
- package/dist/vendor/starlight/translations/ca.json +43 -0
- package/dist/vendor/starlight/translations/ca.json.js +45 -0
- package/dist/vendor/starlight/translations/cs.json +43 -0
- package/dist/vendor/starlight/translations/cs.json.js +45 -0
- package/dist/vendor/starlight/translations/da.json +30 -0
- package/dist/vendor/starlight/translations/da.json.js +32 -0
- package/dist/vendor/starlight/translations/de.json +30 -0
- package/dist/vendor/starlight/translations/de.json.js +32 -0
- package/dist/vendor/starlight/translations/el.json +30 -0
- package/dist/vendor/starlight/translations/el.json.js +32 -0
- package/dist/vendor/starlight/translations/en.json +30 -0
- package/dist/vendor/starlight/translations/en.json.js +32 -0
- package/dist/vendor/starlight/translations/es.json +43 -0
- package/dist/vendor/starlight/translations/es.json.js +45 -0
- package/dist/vendor/starlight/translations/fa.json +30 -0
- package/dist/vendor/starlight/translations/fa.json.js +32 -0
- package/dist/vendor/starlight/translations/fi.json +30 -0
- package/dist/vendor/starlight/translations/fi.json.js +32 -0
- package/dist/vendor/starlight/translations/fr.json +33 -0
- package/dist/vendor/starlight/translations/fr.json.js +35 -0
- package/dist/vendor/starlight/translations/gl.json +43 -0
- package/dist/vendor/starlight/translations/gl.json.js +45 -0
- package/dist/vendor/starlight/translations/he.json +30 -0
- package/dist/vendor/starlight/translations/he.json.js +32 -0
- package/dist/vendor/starlight/translations/hi.json +30 -0
- package/dist/vendor/starlight/translations/hi.json.js +32 -0
- package/dist/vendor/starlight/translations/hu.json +43 -0
- package/dist/vendor/starlight/translations/hu.json.js +45 -0
- package/dist/vendor/starlight/translations/id.json +30 -0
- package/dist/vendor/starlight/translations/id.json.js +32 -0
- package/dist/vendor/starlight/translations/index.js +77 -0
- package/dist/vendor/starlight/translations/it.json +30 -0
- package/dist/vendor/starlight/translations/it.json.js +32 -0
- package/dist/vendor/starlight/translations/ja.json +30 -0
- package/dist/vendor/starlight/translations/ja.json.js +32 -0
- package/dist/vendor/starlight/translations/ko.json +30 -0
- package/dist/vendor/starlight/translations/ko.json.js +32 -0
- package/dist/vendor/starlight/translations/lv.json +30 -0
- package/dist/vendor/starlight/translations/lv.json.js +32 -0
- package/dist/vendor/starlight/translations/nb.json +30 -0
- package/dist/vendor/starlight/translations/nb.json.js +32 -0
- package/dist/vendor/starlight/translations/nl.json +30 -0
- package/dist/vendor/starlight/translations/nl.json.js +32 -0
- package/dist/vendor/starlight/translations/pl.json +33 -0
- package/dist/vendor/starlight/translations/pl.json.js +35 -0
- package/dist/vendor/starlight/translations/pt.json +30 -0
- package/dist/vendor/starlight/translations/pt.json.js +32 -0
- package/dist/vendor/starlight/translations/ro.json +30 -0
- package/dist/vendor/starlight/translations/ro.json.js +32 -0
- package/dist/vendor/starlight/translations/ru.json +33 -0
- package/dist/vendor/starlight/translations/ru.json.js +35 -0
- package/dist/vendor/starlight/translations/sk.json +30 -0
- package/dist/vendor/starlight/translations/sk.json.js +32 -0
- package/dist/vendor/starlight/translations/sv.json +30 -0
- package/dist/vendor/starlight/translations/sv.json.js +32 -0
- package/dist/vendor/starlight/translations/th.json +30 -0
- package/dist/vendor/starlight/translations/th.json.js +32 -0
- package/dist/vendor/starlight/translations/tr.json +30 -0
- package/dist/vendor/starlight/translations/tr.json.js +32 -0
- package/dist/vendor/starlight/translations/uk.json +30 -0
- package/dist/vendor/starlight/translations/uk.json.js +32 -0
- package/dist/vendor/starlight/translations/vi.json +30 -0
- package/dist/vendor/starlight/translations/vi.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-CN.json +30 -0
- package/dist/vendor/starlight/translations/zh-CN.json.js +32 -0
- package/dist/vendor/starlight/translations/zh-TW.json +30 -0
- package/dist/vendor/starlight/translations/zh-TW.json.js +32 -0
- package/dist/vendor/starlight/types.js +0 -0
- package/dist/vendor/starlight/user-components/Aside.astro +40 -0
- package/dist/vendor/starlight/user-components/Badge.astro +148 -0
- package/dist/vendor/starlight/user-components/Card.astro +68 -0
- package/dist/vendor/starlight/user-components/CardGrid.astro +38 -0
- package/dist/vendor/starlight/user-components/FileTree.astro +137 -0
- package/dist/vendor/starlight/user-components/Icon.astro +42 -0
- package/dist/vendor/starlight/user-components/LinkButton.astro +78 -0
- package/dist/vendor/starlight/user-components/LinkCard.astro +78 -0
- package/dist/vendor/starlight/user-components/Steps.astro +90 -0
- package/dist/vendor/starlight/user-components/TabItem.astro +19 -0
- package/dist/vendor/starlight/user-components/Tabs.astro +268 -0
- package/dist/vendor/starlight/user-components/file-tree-icons.js +608 -0
- package/dist/vendor/starlight/user-components/rehype-file-tree.js +160 -0
- package/dist/vendor/starlight/user-components/rehype-steps.js +53 -0
- package/dist/vendor/starlight/user-components/rehype-tabs.js +73 -0
- package/dist/vendor/starlight/utils/base.js +14 -0
- package/dist/vendor/starlight/utils/canonical.js +13 -0
- package/dist/vendor/starlight/utils/collection-fs.js +13 -0
- package/dist/vendor/starlight/utils/collection.js +16 -0
- package/dist/vendor/starlight/utils/createPathFormatter.js +39 -0
- package/dist/vendor/starlight/utils/createTranslationSystem.js +60 -0
- package/dist/vendor/starlight/utils/error-map.js +110 -0
- package/dist/vendor/starlight/utils/format-path.js +9 -0
- package/dist/vendor/starlight/utils/generateToC.js +18 -0
- package/dist/vendor/starlight/utils/git.js +92 -0
- package/dist/vendor/starlight/utils/gitInlined.js +13 -0
- package/dist/vendor/starlight/utils/head.js +156 -0
- package/dist/vendor/starlight/utils/i18n.js +121 -0
- package/dist/vendor/starlight/utils/localizedUrl.js +37 -0
- package/dist/vendor/starlight/utils/navigation.js +320 -0
- package/dist/vendor/starlight/utils/path.js +52 -0
- package/dist/vendor/starlight/utils/plugins.js +355 -0
- package/dist/vendor/starlight/utils/routing/data.js +116 -0
- package/dist/vendor/starlight/utils/routing/index.js +107 -0
- package/dist/vendor/starlight/utils/routing/middleware.js +40 -0
- package/dist/vendor/starlight/utils/routing/types.js +0 -0
- package/dist/vendor/starlight/utils/routing.js +1 -0
- package/dist/vendor/starlight/utils/slugs.js +70 -0
- package/dist/vendor/starlight/utils/starlight-page.js +123 -0
- package/dist/vendor/starlight/utils/translations-fs.js +31 -0
- package/dist/vendor/starlight/utils/translations.js +31 -0
- package/dist/vendor/starlight/utils/types.js +0 -0
- package/dist/vendor/starlight/utils/url.js +5 -0
- package/dist/vendor/starlight/utils/user-config.js +255 -0
- package/dist/vendor/starlight/utils/validateLogoImports.js +22 -0
- package/dist/vendor/starlight/virtual-internal.d.js +0 -0
- package/dist/vendor/starlight/virtual.d.js +0 -0
- package/dist/worker/forms-worker.js +141 -0
- package/package.json +156 -0
- package/style/anchor-links.css +131 -0
- package/templates/github/deploy.workflow.yml +47 -0
- package/tsconfigs/strict.json +3 -0
- package/utils/git.ts +121 -0
- package/utils/gitInlined.ts +20 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { AstroError } from 'astro/errors';
|
|
3
|
+
import Icon from './Icon.astro';
|
|
4
|
+
import { Icons, type StarlightIcon } from '../components/Icons';
|
|
5
|
+
import { throwInvalidAsideIconError } from '../integrations/asides-error';
|
|
6
|
+
|
|
7
|
+
const asideVariants = ['note', 'tip', 'caution', 'danger'] as const;
|
|
8
|
+
const icons = { note: 'information', tip: 'rocket', caution: 'warning', danger: 'error' } as const;
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
type?: (typeof asideVariants)[number];
|
|
12
|
+
title?: string;
|
|
13
|
+
icon?: StarlightIcon;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { type = 'note', title, icon } = Astro.props;
|
|
17
|
+
|
|
18
|
+
if (!asideVariants.includes(type)) {
|
|
19
|
+
throw new AstroError(
|
|
20
|
+
'Invalid `type` prop passed to the `<Aside>` component.\n',
|
|
21
|
+
`Received: ${JSON.stringify(type)}\n` +
|
|
22
|
+
`Expected one of ${asideVariants.map((i) => JSON.stringify(i)).join(', ')}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (icon && !Icons[icon]) throwInvalidAsideIconError(icon);
|
|
27
|
+
|
|
28
|
+
if (!title) {
|
|
29
|
+
title = Astro.locals.t(`aside.${type}`);
|
|
30
|
+
}
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<aside aria-label={title} class={`starlight-aside starlight-aside--${type}`}>
|
|
34
|
+
<p class="starlight-aside__title" aria-hidden="true">
|
|
35
|
+
<Icon name={icon || icons[type]} class="starlight-aside__icon" />{title}
|
|
36
|
+
</p>
|
|
37
|
+
<div class="starlight-aside__content">
|
|
38
|
+
<slot />
|
|
39
|
+
</div>
|
|
40
|
+
</aside>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { BadgeComponentSchema, type BadgeComponentProps } from '../schemas/badge';
|
|
3
|
+
import { parseWithFriendlyErrors } from '../utils/error-map';
|
|
4
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
5
|
+
|
|
6
|
+
type Props = BadgeComponentProps & HTMLAttributes<'span'>;
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
text,
|
|
10
|
+
variant,
|
|
11
|
+
size,
|
|
12
|
+
class: customClass,
|
|
13
|
+
...attrs
|
|
14
|
+
} = parseWithFriendlyErrors(
|
|
15
|
+
BadgeComponentSchema,
|
|
16
|
+
Astro.props,
|
|
17
|
+
'Invalid prop passed to the `<Badge/>` component.'
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The fragment around the element is used as a workaround to avoid a trailing whitespace in the output.
|
|
22
|
+
* @see https://github.com/withastro/compiler/issues/1003
|
|
23
|
+
*/
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<><span class:list={['sl-badge', variant, size, customClass]} {...attrs}>{text}</span></>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
@layer starlight.components {
|
|
30
|
+
:global(:root) {
|
|
31
|
+
--sl-badge-default-border: var(--sl-color-accent);
|
|
32
|
+
--sl-badge-default-bg: var(--sl-color-accent-low);
|
|
33
|
+
--sl-badge-default-text: #fff;
|
|
34
|
+
|
|
35
|
+
--sl-badge-note-border: var(--sl-color-blue);
|
|
36
|
+
--sl-badge-note-bg: var(--sl-color-blue-low);
|
|
37
|
+
--sl-badge-note-text: #fff;
|
|
38
|
+
|
|
39
|
+
--sl-badge-danger-border: var(--sl-color-red);
|
|
40
|
+
--sl-badge-danger-bg: var(--sl-color-red-low);
|
|
41
|
+
--sl-badge-danger-text: #fff;
|
|
42
|
+
|
|
43
|
+
--sl-badge-success-border: var(--sl-color-green);
|
|
44
|
+
--sl-badge-success-bg: var(--sl-color-green-low);
|
|
45
|
+
--sl-badge-success-text: #fff;
|
|
46
|
+
|
|
47
|
+
--sl-badge-caution-border: var(--sl-color-orange);
|
|
48
|
+
--sl-badge-caution-bg: var(--sl-color-orange-low);
|
|
49
|
+
--sl-badge-caution-text: #fff;
|
|
50
|
+
|
|
51
|
+
--sl-badge-tip-border: var(--sl-color-purple);
|
|
52
|
+
--sl-badge-tip-bg: var(--sl-color-purple-low);
|
|
53
|
+
--sl-badge-tip-text: #fff;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:global([data-theme='light']:root) {
|
|
57
|
+
--sl-badge-default-bg: var(--sl-color-accent-high);
|
|
58
|
+
--sl-badge-note-bg: var(--sl-color-blue-high);
|
|
59
|
+
--sl-badge-danger-bg: var(--sl-color-red-high);
|
|
60
|
+
--sl-badge-success-bg: var(--sl-color-green-high);
|
|
61
|
+
--sl-badge-caution-bg: var(--sl-color-orange-high);
|
|
62
|
+
--sl-badge-tip-bg: var(--sl-color-purple-high);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.sl-badge {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
border: 1px solid var(--sl-color-border-badge);
|
|
68
|
+
border-radius: 0.25rem;
|
|
69
|
+
font-family: var(--sl-font-system-mono);
|
|
70
|
+
line-height: normal;
|
|
71
|
+
color: var(--sl-color-text-badge);
|
|
72
|
+
background-color: var(--sl-color-bg-badge);
|
|
73
|
+
overflow-wrap: anywhere;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Sidebar overrides */
|
|
77
|
+
:global(.sidebar-content) .sl-badge {
|
|
78
|
+
line-height: 1;
|
|
79
|
+
font-size: var(--sl-text-xs);
|
|
80
|
+
padding: 0.125rem 0.375rem;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* outline variant */
|
|
84
|
+
:global(.sidebar-content a[aria-current='page']) > .sl-badge {
|
|
85
|
+
--sl-color-bg-badge: transparent;
|
|
86
|
+
--sl-color-border-badge: currentColor;
|
|
87
|
+
color: inherit;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Color variants */
|
|
91
|
+
.default {
|
|
92
|
+
--sl-color-bg-badge: var(--sl-badge-default-bg);
|
|
93
|
+
--sl-color-border-badge: var(--sl-badge-default-border);
|
|
94
|
+
--sl-color-text-badge: var(--sl-badge-default-text);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.note {
|
|
98
|
+
--sl-color-bg-badge: var(--sl-badge-note-bg);
|
|
99
|
+
--sl-color-border-badge: var(--sl-badge-note-border);
|
|
100
|
+
--sl-color-text-badge: var(--sl-badge-note-text);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.danger {
|
|
104
|
+
--sl-color-bg-badge: var(--sl-badge-danger-bg);
|
|
105
|
+
--sl-color-border-badge: var(--sl-badge-danger-border);
|
|
106
|
+
--sl-color-text-badge: var(--sl-badge-danger-text);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.success {
|
|
110
|
+
--sl-color-bg-badge: var(--sl-badge-success-bg);
|
|
111
|
+
--sl-color-border-badge: var(--sl-badge-success-border);
|
|
112
|
+
--sl-color-text-badge: var(--sl-badge-success-text);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.tip {
|
|
116
|
+
--sl-color-bg-badge: var(--sl-badge-tip-bg);
|
|
117
|
+
--sl-color-border-badge: var(--sl-badge-tip-border);
|
|
118
|
+
--sl-color-text-badge: var(--sl-badge-tip-text);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.caution {
|
|
122
|
+
--sl-color-bg-badge: var(--sl-badge-caution-bg);
|
|
123
|
+
--sl-color-border-badge: var(--sl-badge-caution-border);
|
|
124
|
+
--sl-color-text-badge: var(--sl-badge-caution-text);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Size variants */
|
|
128
|
+
.small {
|
|
129
|
+
font-size: var(--sl-text-xs);
|
|
130
|
+
padding: 0.125rem 0.25rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.medium {
|
|
134
|
+
font-size: var(--sl-text-sm);
|
|
135
|
+
padding: 0.175rem 0.35rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.large {
|
|
139
|
+
font-size: var(--sl-text-base);
|
|
140
|
+
padding: 0.225rem 0.45rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Badge in headings */
|
|
144
|
+
:global(.sl-markdown-content :is(h1, h2, h3, h4, h5, h6)) .sl-badge {
|
|
145
|
+
vertical-align: middle;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from './Icon.astro';
|
|
3
|
+
import type { StarlightIcon } from '../components/Icons';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
icon?: StarlightIcon;
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { icon, title } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<article class="card sl-flex">
|
|
14
|
+
<p class="title sl-flex">
|
|
15
|
+
{icon && <Icon name={icon} class="icon" size="1.333em" />}
|
|
16
|
+
<span set:html={title} />
|
|
17
|
+
</p>
|
|
18
|
+
<div class="body"><slot /></div>
|
|
19
|
+
</article>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
@layer starlight.components {
|
|
23
|
+
.card {
|
|
24
|
+
--sl-card-border: var(--sl-color-purple);
|
|
25
|
+
--sl-card-bg: var(--sl-color-purple-low);
|
|
26
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
27
|
+
background-color: var(--sl-color-black);
|
|
28
|
+
padding: clamp(1rem, calc(0.125rem + 3vw), 2.5rem);
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: clamp(0.5rem, calc(0.125rem + 1vw), 1rem);
|
|
31
|
+
}
|
|
32
|
+
.card:nth-child(4n + 1) {
|
|
33
|
+
--sl-card-border: var(--sl-color-orange);
|
|
34
|
+
--sl-card-bg: var(--sl-color-orange-low);
|
|
35
|
+
}
|
|
36
|
+
.card:nth-child(4n + 3) {
|
|
37
|
+
--sl-card-border: var(--sl-color-green);
|
|
38
|
+
--sl-card-bg: var(--sl-color-green-low);
|
|
39
|
+
}
|
|
40
|
+
.card:nth-child(4n + 4) {
|
|
41
|
+
--sl-card-border: var(--sl-color-red);
|
|
42
|
+
--sl-card-bg: var(--sl-color-red-low);
|
|
43
|
+
}
|
|
44
|
+
.card:nth-child(4n + 5) {
|
|
45
|
+
--sl-card-border: var(--sl-color-blue);
|
|
46
|
+
--sl-card-bg: var(--sl-color-blue-low);
|
|
47
|
+
}
|
|
48
|
+
.title {
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
font-size: var(--sl-text-h4);
|
|
51
|
+
color: var(--sl-color-white);
|
|
52
|
+
line-height: var(--sl-line-height-headings);
|
|
53
|
+
gap: 1rem;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
.card .icon {
|
|
57
|
+
border: 1px solid var(--sl-card-border);
|
|
58
|
+
background-color: var(--sl-card-bg);
|
|
59
|
+
padding: 0.2em;
|
|
60
|
+
border-radius: 0.25rem;
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
}
|
|
63
|
+
.card .body {
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-size: clamp(var(--sl-text-sm), calc(0.5rem + 1vw), var(--sl-text-body));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
stagger?: boolean;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { stagger = false } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div class:list={['card-grid', { stagger }]}><slot /></div>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
@layer starlight.components {
|
|
13
|
+
.card-grid {
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: 100%;
|
|
16
|
+
gap: 1rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.card-grid > :global(*) {
|
|
20
|
+
margin-top: 0 !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (min-width: 50rem) {
|
|
24
|
+
.card-grid {
|
|
25
|
+
grid-template-columns: 1fr 1fr;
|
|
26
|
+
gap: 1.5rem;
|
|
27
|
+
}
|
|
28
|
+
.stagger {
|
|
29
|
+
--stagger-height: 5rem;
|
|
30
|
+
padding-bottom: var(--stagger-height);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.stagger > :global(*):nth-child(2n) {
|
|
34
|
+
transform: translateY(var(--stagger-height));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { processFileTree } from './rehype-file-tree';
|
|
3
|
+
|
|
4
|
+
const fileTreeHtml = await Astro.slots.render('default');
|
|
5
|
+
const html = processFileTree(fileTreeHtml, Astro.locals.t('fileTree.directory'));
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<starlight-file-tree set:html={html} class="not-content" data-pagefind-ignore />
|
|
9
|
+
|
|
10
|
+
<style>
|
|
11
|
+
@layer starlight.components {
|
|
12
|
+
starlight-file-tree {
|
|
13
|
+
--x-space: 1.5rem;
|
|
14
|
+
--y-space: 0.125rem;
|
|
15
|
+
--y-pad: 0;
|
|
16
|
+
|
|
17
|
+
display: block;
|
|
18
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
19
|
+
padding: 1rem;
|
|
20
|
+
background-color: var(--sl-color-gray-6);
|
|
21
|
+
font-size: var(--sl-text-xs);
|
|
22
|
+
font-family: var(--__sl-font-mono);
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
starlight-file-tree :global(.directory > details) {
|
|
27
|
+
border: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
padding-inline-start: var(--x-space);
|
|
30
|
+
background: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
starlight-file-tree :global(.directory > details > summary) {
|
|
34
|
+
margin-inline-start: calc(-1 * var(--x-space));
|
|
35
|
+
border: 0;
|
|
36
|
+
padding: var(--y-pad) 0.625rem;
|
|
37
|
+
font-weight: normal;
|
|
38
|
+
color: var(--sl-color-white);
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
starlight-file-tree :global(.directory > details > summary::marker),
|
|
43
|
+
starlight-file-tree :global(.directory > details > summary::-webkit-details-marker) {
|
|
44
|
+
color: var(--sl-color-gray-3);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
starlight-file-tree :global(.directory > details > summary:hover),
|
|
48
|
+
starlight-file-tree :global(.directory > details > summary:hover .tree-icon) {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
color: var(--sl-color-text-accent);
|
|
51
|
+
fill: currentColor;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
starlight-file-tree :global(.directory > details > summary:hover ~ ul) {
|
|
55
|
+
border-color: var(--sl-color-gray-4);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
starlight-file-tree :global(.directory > details > summary:hover .highlight .tree-icon) {
|
|
59
|
+
color: var(--sl-color-text-invert);
|
|
60
|
+
fill: currentColor;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
starlight-file-tree :global(ul) {
|
|
64
|
+
margin-inline-start: 0.5rem;
|
|
65
|
+
border-inline-start: 1px solid var(--sl-color-gray-5);
|
|
66
|
+
padding: 0;
|
|
67
|
+
padding-inline-start: 0.125rem;
|
|
68
|
+
list-style: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
starlight-file-tree > :global(ul) {
|
|
72
|
+
margin: 0;
|
|
73
|
+
border: 0;
|
|
74
|
+
padding: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
starlight-file-tree :global(li) {
|
|
78
|
+
margin: var(--y-space) 0;
|
|
79
|
+
padding: var(--y-pad) 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
starlight-file-tree :global(.file) {
|
|
83
|
+
margin-inline-start: calc(var(--x-space) - 0.125rem);
|
|
84
|
+
color: var(--sl-color-white);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
starlight-file-tree :global(.tree-entry) {
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
max-width: calc(100% - 1rem);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (min-width: 30em) {
|
|
95
|
+
starlight-file-tree :global(.tree-entry) {
|
|
96
|
+
flex-wrap: nowrap;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
starlight-file-tree :global(.tree-entry > :first-child) {
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
starlight-file-tree :global(.empty) {
|
|
105
|
+
color: var(--sl-color-gray-3);
|
|
106
|
+
padding-inline-start: 0.375rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
starlight-file-tree :global(.comment) {
|
|
110
|
+
color: var(--sl-color-gray-3);
|
|
111
|
+
padding-inline-start: 1.625rem;
|
|
112
|
+
max-width: 24rem;
|
|
113
|
+
min-width: 12rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
starlight-file-tree :global(.highlight) {
|
|
117
|
+
display: inline-block;
|
|
118
|
+
border-radius: 0.25rem;
|
|
119
|
+
padding-inline-end: 0.5rem;
|
|
120
|
+
color: var(--sl-color-text-invert);
|
|
121
|
+
background-color: var(--sl-color-text-accent);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
starlight-file-tree :global(svg) {
|
|
125
|
+
display: inline;
|
|
126
|
+
fill: var(--sl-color-gray-3);
|
|
127
|
+
vertical-align: middle;
|
|
128
|
+
margin-inline: 0.25rem 0.375rem;
|
|
129
|
+
width: 0.875rem;
|
|
130
|
+
height: 0.875rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
starlight-file-tree :global(.highlight svg.tree-icon) {
|
|
134
|
+
fill: currentColor;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Icons, type StarlightIcon } from '../components/Icons';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
name: StarlightIcon;
|
|
6
|
+
label?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
size?: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { name, label, size = '1em', color } = Astro.props;
|
|
13
|
+
const a11yAttrs = label ? ({ 'aria-label': label } as const) : ({ 'aria-hidden': 'true' } as const);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The fragment around the element is used as a workaround to avoid a trailing whitespace in the output.
|
|
17
|
+
* @see https://github.com/withastro/compiler/issues/1003
|
|
18
|
+
*/
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<>
|
|
22
|
+
<svg
|
|
23
|
+
{...a11yAttrs}
|
|
24
|
+
class={Astro.props.class}
|
|
25
|
+
width="16"
|
|
26
|
+
height="16"
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
fill="currentColor"
|
|
29
|
+
set:html={Icons[name]}
|
|
30
|
+
/>
|
|
31
|
+
</>
|
|
32
|
+
|
|
33
|
+
<style define:vars={{ 'sl-icon-color': color, 'sl-icon-size': size }}>
|
|
34
|
+
@layer starlight.components {
|
|
35
|
+
svg {
|
|
36
|
+
color: var(--sl-icon-color);
|
|
37
|
+
font-size: var(--sl-icon-size, 1em);
|
|
38
|
+
width: 1em;
|
|
39
|
+
height: 1em;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
import type { StarlightIcon } from '../components/Icons';
|
|
4
|
+
import Icon from './Icon.astro';
|
|
5
|
+
|
|
6
|
+
interface Props extends Omit<HTMLAttributes<'a'>, 'href'> {
|
|
7
|
+
href: string | URL;
|
|
8
|
+
icon?: StarlightIcon | undefined;
|
|
9
|
+
iconPlacement?: 'start' | 'end' | undefined;
|
|
10
|
+
variant?: 'primary' | 'secondary' | 'minimal';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
class: className,
|
|
15
|
+
icon,
|
|
16
|
+
iconPlacement = 'end',
|
|
17
|
+
variant = 'primary',
|
|
18
|
+
...attrs
|
|
19
|
+
} = Astro.props;
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<a class:list={['sl-link-button not-content', variant, className]} {...attrs}>
|
|
23
|
+
{icon && iconPlacement === 'start' && <Icon name={icon} size="1.5rem" />}
|
|
24
|
+
<slot />
|
|
25
|
+
{icon && iconPlacement === 'end' && <Icon name={icon} size="1.5rem" />}
|
|
26
|
+
</a>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
@layer starlight.components {
|
|
30
|
+
.sl-link-button {
|
|
31
|
+
align-items: center;
|
|
32
|
+
border: 1px solid transparent;
|
|
33
|
+
border-radius: 999rem;
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
font-size: var(--sl-text-sm);
|
|
36
|
+
gap: 0.5em;
|
|
37
|
+
line-height: 1.1875;
|
|
38
|
+
outline-offset: 0.25rem;
|
|
39
|
+
padding: 0.4375rem 1.125rem;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sl-link-button.primary {
|
|
44
|
+
background: var(--sl-color-text-accent);
|
|
45
|
+
border-color: var(--sl-color-text-accent);
|
|
46
|
+
color: var(--sl-color-black);
|
|
47
|
+
}
|
|
48
|
+
.sl-link-button.primary:hover {
|
|
49
|
+
color: var(--sl-color-black);
|
|
50
|
+
}
|
|
51
|
+
.sl-link-button.secondary {
|
|
52
|
+
border-color: inherit;
|
|
53
|
+
color: var(--sl-color-white);
|
|
54
|
+
}
|
|
55
|
+
.sl-link-button.minimal {
|
|
56
|
+
color: var(--sl-color-white);
|
|
57
|
+
padding-inline: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.sl-link-button :global(svg) {
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media (min-width: 50rem) {
|
|
65
|
+
.sl-link-button {
|
|
66
|
+
font-size: var(--sl-text-base);
|
|
67
|
+
padding: 0.9375rem 1.25rem;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:global(.sl-markdown-content) .sl-link-button {
|
|
72
|
+
margin-inline-end: 1rem;
|
|
73
|
+
}
|
|
74
|
+
:global(.sl-markdown-content) .sl-link-button:not(:where(p *)) {
|
|
75
|
+
margin-block: 1rem;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Icon from './Icon.astro';
|
|
3
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
4
|
+
|
|
5
|
+
interface Props extends Omit<HTMLAttributes<'a'>, 'title'> {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { title, description, ...attributes } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<div class="sl-link-card">
|
|
14
|
+
<span class="sl-flex stack">
|
|
15
|
+
<a {...attributes}>
|
|
16
|
+
<span class="title" set:html={title} />
|
|
17
|
+
</a>
|
|
18
|
+
{description && <span class="description" set:html={description} />}
|
|
19
|
+
</span>
|
|
20
|
+
<Icon name="right-arrow" size="1.333em" class="icon rtl:flip" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
@layer starlight.components {
|
|
25
|
+
.sl-link-card {
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: 1fr auto;
|
|
28
|
+
gap: 0.5rem;
|
|
29
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
30
|
+
border-radius: 0.5rem;
|
|
31
|
+
padding: 1rem;
|
|
32
|
+
box-shadow: var(--sl-shadow-sm);
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
a {
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
line-height: var(--sl-line-height-headings);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* a11y fix for https://github.com/withastro/starlight/issues/487 */
|
|
42
|
+
a::before {
|
|
43
|
+
content: '';
|
|
44
|
+
position: absolute;
|
|
45
|
+
inset: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stack {
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 0.5rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.title {
|
|
54
|
+
color: var(--sl-color-white);
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
font-size: var(--sl-text-lg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.description {
|
|
60
|
+
color: var(--sl-color-gray-3);
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.icon {
|
|
65
|
+
color: var(--sl-color-gray-3);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Hover state */
|
|
69
|
+
.sl-link-card:hover {
|
|
70
|
+
background: var(--sl-color-gray-7, var(--sl-color-gray-6));
|
|
71
|
+
border-color: var(--sl-color-gray-2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.sl-link-card:hover .icon {
|
|
75
|
+
color: var(--sl-color-white);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|