@sypnia/ui 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +95 -2
- package/astro/ActionCard.astro +17 -0
- package/astro/ActionCardSkeleton.astro +10 -0
- package/astro/Actions.astro +6 -0
- package/astro/AgentInstall.astro +13 -0
- package/astro/Alert.astro +20 -0
- package/astro/Announcement.astro +7 -0
- package/astro/ApiReference.astro +29 -0
- package/astro/ArticleHead.astro +24 -0
- package/astro/Aside.astro +17 -0
- package/astro/AspectRatio.astro +7 -0
- package/astro/AuthLayout.astro +31 -0
- package/astro/AuthLayoutSkeleton.astro +19 -0
- package/astro/Avatar.astro +7 -0
- package/astro/AvatarGroup.astro +16 -0
- package/astro/AvatarGroupSkeleton.astro +7 -0
- package/astro/AvatarSkeleton.astro +6 -0
- package/astro/Badge.astro +8 -0
- package/astro/BadgeSkeleton.astro +6 -0
- package/astro/Banner.astro +6 -0
- package/astro/Button.astro +26 -0
- package/astro/ButtonGroup.astro +6 -0
- package/astro/CallToAction.astro +10 -0
- package/astro/Callout.astro +13 -0
- package/astro/CalloutSkeleton.astro +10 -0
- package/astro/Card.astro +11 -0
- package/astro/CardGrid.astro +9 -0
- package/astro/CardGridSkeleton.astro +7 -0
- package/astro/CardSkeleton.astro +11 -0
- package/astro/Cards.astro +16 -0
- package/astro/CardsSkeleton.astro +5 -0
- package/astro/CaseMap.astro +72 -0
- package/astro/Center.astro +7 -0
- package/astro/Changelog.astro +23 -0
- package/astro/Character.astro +7 -0
- package/astro/Checklist.astro +27 -0
- package/astro/ChecklistSkeleton.astro +10 -0
- package/astro/Chip.astro +10 -0
- package/astro/ChipSkeleton.astro +4 -0
- package/astro/Cli.astro +10 -0
- package/astro/CodeBlock.astro +20 -0
- package/astro/CodeBlockSkeleton.astro +9 -0
- package/astro/CodeTabs.astro +31 -0
- package/astro/Columns.astro +7 -0
- package/astro/Compare.astro +16 -0
- package/astro/CompareTable.astro +29 -0
- package/astro/CompareTableSkeleton.astro +12 -0
- package/astro/Container.astro +6 -0
- package/astro/CopyButton.astro +15 -0
- package/astro/Count.astro +9 -0
- package/astro/CountSkeleton.astro +4 -0
- package/astro/Delta.astro +20 -0
- package/astro/DeltaSkeleton.astro +4 -0
- package/astro/DescriptionList.astro +8 -0
- package/astro/DescriptionListSkeleton.astro +7 -0
- package/astro/Divider.astro +6 -0
- package/astro/DocsArticleSkeleton.astro +25 -0
- package/astro/DocsHead.astro +33 -0
- package/astro/DocsHeader.astro +44 -0
- package/astro/DocsHero.astro +13 -0
- package/astro/DocsShell.astro +79 -0
- package/astro/EditLink.astro +9 -0
- package/astro/EmptyState.astro +14 -0
- package/astro/Endpoint.astro +21 -0
- package/astro/ErrorItem.astro +5 -0
- package/astro/ErrorList.astro +8 -0
- package/astro/Expected.astro +8 -0
- package/astro/Faq.astro +11 -0
- package/astro/FeatureGrid.astro +11 -0
- package/astro/FeatureGridSkeleton.astro +8 -0
- package/astro/FeatureList.astro +18 -0
- package/astro/FeatureListSkeleton.astro +7 -0
- package/astro/Figure.astro +17 -0
- package/astro/FigureSkeleton.astro +9 -0
- package/astro/Fireflies.astro +8 -0
- package/astro/Glossary.astro +8 -0
- package/astro/Grid.astro +7 -0
- package/astro/Heading.astro +7 -0
- package/astro/Hero.astro +21 -0
- package/astro/Icon.astro +17 -0
- package/astro/IconButton.astro +21 -0
- package/astro/Identity.astro +7 -0
- package/astro/IdentitySkeleton.astro +10 -0
- package/astro/Install.astro +7 -0
- package/astro/Kbd.astro +4 -0
- package/astro/KeyValue.astro +6 -0
- package/astro/KeyValueSkeleton.astro +7 -0
- package/astro/Ledger.astro +6 -0
- package/astro/Logo.astro +9 -0
- package/astro/Mark.astro +1 -0
- package/astro/McpTool.astro +13 -0
- package/astro/NewCard.astro +7 -0
- package/astro/Option.astro +6 -0
- package/astro/Options.astro +6 -0
- package/astro/PackageTabs.astro +12 -0
- package/astro/Page.astro +5 -0
- package/astro/PageFeedback.astro +20 -0
- package/astro/PageHeader.astro +14 -0
- package/astro/PageHeaderSkeleton.astro +12 -0
- package/astro/PageSkeleton.astro +19 -0
- package/astro/PaginationSkeleton.astro +17 -0
- package/astro/Panel.astro +11 -0
- package/astro/PanelSkeleton.astro +10 -0
- package/astro/Param.astro +15 -0
- package/astro/Params.astro +12 -0
- package/astro/ParamsSkeleton.astro +5 -0
- package/astro/Phone.astro +6 -0
- package/astro/PlanCard.astro +27 -0
- package/astro/PlanCardSkeleton.astro +13 -0
- package/astro/PrevNext.astro +15 -0
- package/astro/PricingTable.astro +41 -0
- package/astro/PricingTableSkeleton.astro +9 -0
- package/astro/ProductGrid.astro +10 -0
- package/astro/ProductMark.astro +10 -0
- package/astro/Progress.astro +12 -0
- package/astro/ProgressSkeleton.astro +9 -0
- package/astro/Prose.astro +7 -0
- package/astro/Quote.astro +10 -0
- package/astro/QuoteSkeleton.astro +10 -0
- package/astro/Releases.astro +6 -0
- package/astro/RequestExample.astro +8 -0
- package/astro/ResponseExample.astro +9 -0
- package/astro/Row.astro +7 -0
- package/astro/Says.astro +6 -0
- package/astro/ScrollArea.astro +7 -0
- package/astro/Search.astro +36 -0
- package/astro/SearchResult.astro +8 -0
- package/astro/SearchResultSkeleton.astro +5 -0
- package/astro/Section.astro +17 -0
- package/astro/SectionSkeleton.astro +9 -0
- package/astro/Setting.astro +19 -0
- package/astro/Show.astro +6 -0
- package/astro/SideNav.astro +40 -0
- package/astro/SideNavSkeleton.astro +13 -0
- package/astro/SiteFooter.astro +14 -0
- package/astro/SiteHeader.astro +28 -0
- package/astro/Skeleton.astro +8 -0
- package/astro/SkeletonText.astro +6 -0
- package/astro/Spacer.astro +7 -0
- package/astro/Split.astro +17 -0
- package/astro/Stack.astro +7 -0
- package/astro/Stage.astro +12 -0
- package/astro/Stat.astro +10 -0
- package/astro/StatGroup.astro +1 -0
- package/astro/StatGroupSkeleton.astro +7 -0
- package/astro/StatSkeleton.astro +10 -0
- package/astro/Status.astro +6 -0
- package/astro/StatusSkeleton.astro +4 -0
- package/astro/Step.astro +5 -0
- package/astro/Steps.astro +4 -0
- package/astro/Sticky.astro +7 -0
- package/astro/TableOfContents.astro +16 -0
- package/astro/TableOfContentsSkeleton.astro +5 -0
- package/astro/TableSkeleton.astro +16 -0
- package/astro/Tabs.astro +31 -0
- package/astro/TabsSkeleton.astro +6 -0
- package/astro/Term.astro +8 -0
- package/astro/Terms.astro +4 -0
- package/astro/Text.astro +6 -0
- package/astro/TextSkeleton.astro +9 -0
- package/astro/Toolbar.astro +7 -0
- package/astro/ToolbarGroup.astro +5 -0
- package/astro/ToolbarSeparator.astro +1 -0
- package/astro/ToolbarSkeleton.astro +6 -0
- package/astro/VersionBadge.astro +8 -0
- package/astro/_gap.ts +5 -0
- package/astro/_id.ts +3 -0
- package/astro/_locale.ts +9 -0
- package/css/base.css +92 -0
- package/css/components/actions.css +36 -0
- package/css/components/brand.css +28 -0
- package/css/components/button.css +84 -0
- package/css/components/charts-more.css +89 -0
- package/css/components/charts.css +83 -0
- package/css/components/code.css +86 -0
- package/css/components/data-display.css +105 -0
- package/css/components/data-more.css +323 -0
- package/css/components/data-table.css +146 -0
- package/css/components/docs.css +451 -0
- package/css/components/feedback.css +103 -0
- package/css/components/field.css +92 -0
- package/css/components/fields-advanced.css +158 -0
- package/css/components/fields-more.css +93 -0
- package/css/components/floating.css +55 -0
- package/css/components/forms.css +109 -0
- package/css/components/layout.css +97 -0
- package/css/components/nav.css +105 -0
- package/css/components/navigation.css +133 -0
- package/css/components/overlay.css +112 -0
- package/css/components/primitives.css +15 -0
- package/css/components/screens.css +42 -0
- package/css/components/shell.css +118 -0
- package/css/components/site.css +114 -0
- package/css/components/status.css +81 -0
- package/css/components/surface.css +69 -0
- package/css/components/table.css +49 -0
- package/css/components/viz.css +117 -0
- package/css/fonts.css +8 -0
- package/css/index.css +34 -0
- package/css/tokens.css +409 -0
- package/dist/chunk-6X3IJPUY.js +699 -0
- package/dist/chunk-AXIJDECU.js +97 -0
- package/dist/chunk-O5ZNXHSV.js +86 -0
- package/dist/dom/elements.d.ts +2 -0
- package/dist/dom/elements.js +539 -0
- package/dist/dom/index.d.ts +51 -0
- package/dist/dom/index.js +2 -0
- package/dist/i18n/index.d.ts +659 -0
- package/dist/i18n/index.js +1 -0
- package/dist/react/index.d.ts +4455 -0
- package/dist/react/index.js +8208 -0
- package/dist/tokens/index.d.ts +64 -0
- package/dist/tokens/index.js +49 -0
- package/fonts/LICENSE-instrument-sans.txt +93 -0
- package/fonts/LICENSE-literata.txt +93 -0
- package/fonts/LICENSE-martian-mono.txt +93 -0
- package/fonts/instrument-sans.woff2 +0 -0
- package/fonts/literata-italic.woff2 +0 -0
- package/fonts/literata-roman.woff2 +0 -0
- package/fonts/martian-mono.woff2 +0 -0
- package/icons/sprite.svg +1 -0
- package/icons/svg/accessibility.svg +1 -0
- package/icons/svg/agent.svg +1 -0
- package/icons/svg/alert.svg +1 -0
- package/icons/svg/align-center.svg +1 -0
- package/icons/svg/align-left.svg +1 -0
- package/icons/svg/align-right.svg +1 -0
- package/icons/svg/api.svg +1 -0
- package/icons/svg/archive.svg +1 -0
- package/icons/svg/arrow-down-left.svg +1 -0
- package/icons/svg/arrow-down-right.svg +1 -0
- package/icons/svg/arrow-down.svg +1 -0
- package/icons/svg/arrow-left.svg +1 -0
- package/icons/svg/arrow-right.svg +1 -0
- package/icons/svg/arrow-up-left.svg +1 -0
- package/icons/svg/arrow-up-right.svg +1 -0
- package/icons/svg/arrow-up.svg +1 -0
- package/icons/svg/at.svg +1 -0
- package/icons/svg/audit.svg +1 -0
- package/icons/svg/award.svg +1 -0
- package/icons/svg/backend.svg +1 -0
- package/icons/svg/backup.svg +1 -0
- package/icons/svg/bag.svg +1 -0
- package/icons/svg/ban.svg +1 -0
- package/icons/svg/bank.svg +1 -0
- package/icons/svg/bell-off.svg +1 -0
- package/icons/svg/bell.svg +1 -0
- package/icons/svg/bold.svg +1 -0
- package/icons/svg/bolt.svg +1 -0
- package/icons/svg/book-open.svg +1 -0
- package/icons/svg/book.svg +1 -0
- package/icons/svg/bookmark.svg +1 -0
- package/icons/svg/box.svg +1 -0
- package/icons/svg/braces.svg +1 -0
- package/icons/svg/brackets.svg +1 -0
- package/icons/svg/browser.svg +1 -0
- package/icons/svg/brush.svg +1 -0
- package/icons/svg/bug.svg +1 -0
- package/icons/svg/calendar-check.svg +1 -0
- package/icons/svg/calendar-plus.svg +1 -0
- package/icons/svg/calendar.svg +1 -0
- package/icons/svg/camera.svg +1 -0
- package/icons/svg/cards.svg +1 -0
- package/icons/svg/cart.svg +1 -0
- package/icons/svg/certificate.svg +1 -0
- package/icons/svg/chart-area.svg +1 -0
- package/icons/svg/chart-bar.svg +1 -0
- package/icons/svg/chart-line.svg +1 -0
- package/icons/svg/chart-parts.svg +1 -0
- package/icons/svg/chart-scatter.svg +1 -0
- package/icons/svg/chat.svg +1 -0
- package/icons/svg/chats.svg +1 -0
- package/icons/svg/check-small.svg +1 -0
- package/icons/svg/check.svg +1 -0
- package/icons/svg/chevron-down.svg +1 -0
- package/icons/svg/chevron-left.svg +1 -0
- package/icons/svg/chevron-right.svg +1 -0
- package/icons/svg/chevron-up.svg +1 -0
- package/icons/svg/chevrons-down.svg +1 -0
- package/icons/svg/chevrons-left.svg +1 -0
- package/icons/svg/chevrons-right.svg +1 -0
- package/icons/svg/chevrons-up-down.svg +1 -0
- package/icons/svg/chevrons-up.svg +1 -0
- package/icons/svg/clipboard-check.svg +1 -0
- package/icons/svg/clipboard.svg +1 -0
- package/icons/svg/clock.svg +1 -0
- package/icons/svg/close-small.svg +1 -0
- package/icons/svg/close.svg +1 -0
- package/icons/svg/cloud-download.svg +1 -0
- package/icons/svg/cloud-off.svg +1 -0
- package/icons/svg/cloud-upload.svg +1 -0
- package/icons/svg/cloud.svg +1 -0
- package/icons/svg/code.svg +1 -0
- package/icons/svg/coins.svg +1 -0
- package/icons/svg/collapse.svg +1 -0
- package/icons/svg/columns.svg +1 -0
- package/icons/svg/comment.svg +1 -0
- package/icons/svg/commit.svg +1 -0
- package/icons/svg/compass.svg +1 -0
- package/icons/svg/contact.svg +1 -0
- package/icons/svg/container.svg +1 -0
- package/icons/svg/copy.svg +1 -0
- package/icons/svg/cpu.svg +1 -0
- package/icons/svg/credit-card.svg +1 -0
- package/icons/svg/cron.svg +1 -0
- package/icons/svg/crop.svg +1 -0
- package/icons/svg/crown.svg +1 -0
- package/icons/svg/csv.svg +1 -0
- package/icons/svg/cursor.svg +1 -0
- package/icons/svg/dark-mode.svg +1 -0
- package/icons/svg/dashboard.svg +1 -0
- package/icons/svg/data.svg +1 -0
- package/icons/svg/dead-click.svg +1 -0
- package/icons/svg/density.svg +1 -0
- package/icons/svg/deploy.svg +1 -0
- package/icons/svg/desktop.svg +1 -0
- package/icons/svg/disk.svg +1 -0
- package/icons/svg/dns.svg +1 -0
- package/icons/svg/dollar.svg +1 -0
- package/icons/svg/domain.svg +1 -0
- package/icons/svg/dot-off.svg +1 -0
- package/icons/svg/dot.svg +1 -0
- package/icons/svg/download.svg +1 -0
- package/icons/svg/duplicate.svg +1 -0
- package/icons/svg/edit.svg +1 -0
- package/icons/svg/engine.svg +1 -0
- package/icons/svg/enter.svg +1 -0
- package/icons/svg/environment.svg +1 -0
- package/icons/svg/equal.svg +1 -0
- package/icons/svg/eraser.svg +1 -0
- package/icons/svg/error.svg +1 -0
- package/icons/svg/expand.svg +1 -0
- package/icons/svg/export.svg +1 -0
- package/icons/svg/external.svg +1 -0
- package/icons/svg/eye-off.svg +1 -0
- package/icons/svg/failure.svg +1 -0
- package/icons/svg/fast-forward.svg +1 -0
- package/icons/svg/file-check.svg +1 -0
- package/icons/svg/file-code.svg +1 -0
- package/icons/svg/file-lock.svg +1 -0
- package/icons/svg/file-plus.svg +1 -0
- package/icons/svg/file-table.svg +1 -0
- package/icons/svg/file-text.svg +1 -0
- package/icons/svg/file.svg +1 -0
- package/icons/svg/files.svg +1 -0
- package/icons/svg/filter.svg +1 -0
- package/icons/svg/fingerprint.svg +1 -0
- package/icons/svg/fire.svg +1 -0
- package/icons/svg/firewall.svg +1 -0
- package/icons/svg/fix.svg +1 -0
- package/icons/svg/flag.svg +1 -0
- package/icons/svg/folder-open.svg +1 -0
- package/icons/svg/folder-plus.svg +1 -0
- package/icons/svg/folder.svg +1 -0
- package/icons/svg/fork.svg +1 -0
- package/icons/svg/fullscreen-exit.svg +1 -0
- package/icons/svg/fullscreen.svg +1 -0
- package/icons/svg/function.svg +1 -0
- package/icons/svg/funnel.svg +1 -0
- package/icons/svg/gauge.svg +1 -0
- package/icons/svg/gift.svg +1 -0
- package/icons/svg/git-branch.svg +1 -0
- package/icons/svg/globe.svg +1 -0
- package/icons/svg/grid.svg +1 -0
- package/icons/svg/grip.svg +1 -0
- package/icons/svg/hand.svg +1 -0
- package/icons/svg/handshake.svg +1 -0
- package/icons/svg/hash.svg +1 -0
- package/icons/svg/heading.svg +1 -0
- package/icons/svg/heart.svg +1 -0
- package/icons/svg/heatmap.svg +1 -0
- package/icons/svg/help.svg +1 -0
- package/icons/svg/highlight.svg +1 -0
- package/icons/svg/history.svg +1 -0
- package/icons/svg/home.svg +1 -0
- package/icons/svg/hourglass.svg +1 -0
- package/icons/svg/id-card.svg +1 -0
- package/icons/svg/idea.svg +1 -0
- package/icons/svg/image.svg +1 -0
- package/icons/svg/import.svg +1 -0
- package/icons/svg/inbox.svg +1 -0
- package/icons/svg/incognito.svg +1 -0
- package/icons/svg/indent.svg +1 -0
- package/icons/svg/index.svg +1 -0
- package/icons/svg/info.svg +1 -0
- package/icons/svg/invoice.svg +1 -0
- package/icons/svg/italic.svg +1 -0
- package/icons/svg/json.svg +1 -0
- package/icons/svg/kanban.svg +1 -0
- package/icons/svg/key.svg +1 -0
- package/icons/svg/keyboard.svg +1 -0
- package/icons/svg/laptop.svg +1 -0
- package/icons/svg/layers.svg +1 -0
- package/icons/svg/layout.svg +1 -0
- package/icons/svg/leaf.svg +1 -0
- package/icons/svg/light.svg +1 -0
- package/icons/svg/link.svg +1 -0
- package/icons/svg/list-checks.svg +1 -0
- package/icons/svg/list-ordered.svg +1 -0
- package/icons/svg/list.svg +1 -0
- package/icons/svg/load-balancer.svg +1 -0
- package/icons/svg/lock.svg +1 -0
- package/icons/svg/log-in.svg +1 -0
- package/icons/svg/logs.svg +1 -0
- package/icons/svg/mail-open.svg +1 -0
- package/icons/svg/mail.svg +1 -0
- package/icons/svg/map.svg +1 -0
- package/icons/svg/mcp.svg +1 -0
- package/icons/svg/megaphone.svg +1 -0
- package/icons/svg/memory.svg +1 -0
- package/icons/svg/menu.svg +1 -0
- package/icons/svg/merge.svg +1 -0
- package/icons/svg/mic-off.svg +1 -0
- package/icons/svg/mic.svg +1 -0
- package/icons/svg/migrate.svg +1 -0
- package/icons/svg/minus-circle.svg +1 -0
- package/icons/svg/minus.svg +1 -0
- package/icons/svg/mobile.svg +1 -0
- package/icons/svg/moon.svg +1 -0
- package/icons/svg/more-vertical.svg +1 -0
- package/icons/svg/more.svg +1 -0
- package/icons/svg/mouse.svg +1 -0
- package/icons/svg/move.svg +1 -0
- package/icons/svg/mute.svg +1 -0
- package/icons/svg/network.svg +1 -0
- package/icons/svg/notebook.svg +1 -0
- package/icons/svg/null.svg +1 -0
- package/icons/svg/open-source.svg +1 -0
- package/icons/svg/organization.svg +1 -0
- package/icons/svg/outdent.svg +1 -0
- package/icons/svg/p-agent.svg +1 -0
- package/icons/svg/p-ai.svg +1 -0
- package/icons/svg/p-app.svg +1 -0
- package/icons/svg/p-cases.svg +1 -0
- package/icons/svg/p-data.svg +1 -0
- package/icons/svg/p-design.svg +1 -0
- package/icons/svg/p-domains.svg +1 -0
- package/icons/svg/p-files.svg +1 -0
- package/icons/svg/p-git.svg +1 -0
- package/icons/svg/p-learn.svg +1 -0
- package/icons/svg/p-mail.svg +1 -0
- package/icons/svg/p-run.svg +1 -0
- package/icons/svg/p-skills.svg +1 -0
- package/icons/svg/p-telemetry.svg +1 -0
- package/icons/svg/p-ui.svg +1 -0
- package/icons/svg/palette.svg +1 -0
- package/icons/svg/panel-bottom.svg +1 -0
- package/icons/svg/paperclip.svg +1 -0
- package/icons/svg/paragraph.svg +1 -0
- package/icons/svg/password.svg +1 -0
- package/icons/svg/paste.svg +1 -0
- package/icons/svg/pause.svg +1 -0
- package/icons/svg/pending.svg +1 -0
- package/icons/svg/percent.svg +1 -0
- package/icons/svg/performance.svg +1 -0
- package/icons/svg/phone.svg +1 -0
- package/icons/svg/picture-in-picture.svg +1 -0
- package/icons/svg/pin.svg +1 -0
- package/icons/svg/pipeline.svg +1 -0
- package/icons/svg/plan.svg +1 -0
- package/icons/svg/play.svg +1 -0
- package/icons/svg/plug.svg +1 -0
- package/icons/svg/plus-circle.svg +1 -0
- package/icons/svg/plus.svg +1 -0
- package/icons/svg/pointer.svg +1 -0
- package/icons/svg/policy.svg +1 -0
- package/icons/svg/power.svg +1 -0
- package/icons/svg/primary-key.svg +1 -0
- package/icons/svg/print.svg +1 -0
- package/icons/svg/prompt.svg +1 -0
- package/icons/svg/pull-request.svg +1 -0
- package/icons/svg/puzzle.svg +1 -0
- package/icons/svg/qr-code.svg +1 -0
- package/icons/svg/query.svg +1 -0
- package/icons/svg/queue.svg +1 -0
- package/icons/svg/quote.svg +1 -0
- package/icons/svg/rage-click.svg +1 -0
- package/icons/svg/receipt.svg +1 -0
- package/icons/svg/record.svg +1 -0
- package/icons/svg/redo.svg +1 -0
- package/icons/svg/refresh.svg +1 -0
- package/icons/svg/region.svg +1 -0
- package/icons/svg/relation.svg +1 -0
- package/icons/svg/release.svg +1 -0
- package/icons/svg/replay.svg +1 -0
- package/icons/svg/rewind.svg +1 -0
- package/icons/svg/robot.svg +1 -0
- package/icons/svg/rocket.svg +1 -0
- package/icons/svg/role.svg +1 -0
- package/icons/svg/rollback.svg +1 -0
- package/icons/svg/route.svg +1 -0
- package/icons/svg/rows.svg +1 -0
- package/icons/svg/rss.svg +1 -0
- package/icons/svg/ruler.svg +1 -0
- package/icons/svg/save.svg +1 -0
- package/icons/svg/scan.svg +1 -0
- package/icons/svg/scissors.svg +1 -0
- package/icons/svg/sdk.svg +1 -0
- package/icons/svg/search.svg +1 -0
- package/icons/svg/secret.svg +1 -0
- package/icons/svg/seed.svg +1 -0
- package/icons/svg/select.svg +1 -0
- package/icons/svg/self-host.svg +1 -0
- package/icons/svg/send.svg +1 -0
- package/icons/svg/server.svg +1 -0
- package/icons/svg/settings.svg +1 -0
- package/icons/svg/share.svg +1 -0
- package/icons/svg/shield-alert.svg +1 -0
- package/icons/svg/shield-off.svg +1 -0
- package/icons/svg/shield-user.svg +1 -0
- package/icons/svg/shield.svg +1 -0
- package/icons/svg/sidebar-left.svg +1 -0
- package/icons/svg/sidebar-right.svg +1 -0
- package/icons/svg/sign-out.svg +1 -0
- package/icons/svg/signals-in.svg +1 -0
- package/icons/svg/skip-back.svg +1 -0
- package/icons/svg/skip-forward.svg +1 -0
- package/icons/svg/slash.svg +1 -0
- package/icons/svg/sleep.svg +1 -0
- package/icons/svg/sliders.svg +1 -0
- package/icons/svg/sort.svg +1 -0
- package/icons/svg/sparkle.svg +1 -0
- package/icons/svg/sparkline.svg +1 -0
- package/icons/svg/split.svg +1 -0
- package/icons/svg/star.svg +1 -0
- package/icons/svg/stop.svg +1 -0
- package/icons/svg/strikethrough.svg +1 -0
- package/icons/svg/success.svg +1 -0
- package/icons/svg/suggestion.svg +1 -0
- package/icons/svg/sum.svg +1 -0
- package/icons/svg/summary.svg +1 -0
- package/icons/svg/sun.svg +1 -0
- package/icons/svg/support.svg +1 -0
- package/icons/svg/swap-vertical.svg +1 -0
- package/icons/svg/swap.svg +1 -0
- package/icons/svg/table.svg +1 -0
- package/icons/svg/tablet.svg +1 -0
- package/icons/svg/tag.svg +1 -0
- package/icons/svg/target.svg +1 -0
- package/icons/svg/team.svg +1 -0
- package/icons/svg/terminal.svg +1 -0
- package/icons/svg/test.svg +1 -0
- package/icons/svg/text.svg +1 -0
- package/icons/svg/theme.svg +1 -0
- package/icons/svg/thumbs-down.svg +1 -0
- package/icons/svg/thumbs-up.svg +1 -0
- package/icons/svg/timer.svg +1 -0
- package/icons/svg/toggle.svg +1 -0
- package/icons/svg/traces.svg +1 -0
- package/icons/svg/translate.svg +1 -0
- package/icons/svg/trash.svg +1 -0
- package/icons/svg/trend-down.svg +1 -0
- package/icons/svg/trend-up.svg +1 -0
- package/icons/svg/two-factor.svg +1 -0
- package/icons/svg/underline.svg +1 -0
- package/icons/svg/undo.svg +1 -0
- package/icons/svg/unlink.svg +1 -0
- package/icons/svg/unlock.svg +1 -0
- package/icons/svg/upgrade.svg +1 -0
- package/icons/svg/upload.svg +1 -0
- package/icons/svg/uptime.svg +1 -0
- package/icons/svg/usage.svg +1 -0
- package/icons/svg/user-check.svg +1 -0
- package/icons/svg/user-circle.svg +1 -0
- package/icons/svg/user-minus.svg +1 -0
- package/icons/svg/user-plus.svg +1 -0
- package/icons/svg/user-x.svg +1 -0
- package/icons/svg/user.svg +1 -0
- package/icons/svg/users.svg +1 -0
- package/icons/svg/variable.svg +1 -0
- package/icons/svg/verified.svg +1 -0
- package/icons/svg/video.svg +1 -0
- package/icons/svg/volume.svg +1 -0
- package/icons/svg/wallet.svg +1 -0
- package/icons/svg/wand.svg +1 -0
- package/icons/svg/warning.svg +1 -0
- package/icons/svg/watch.svg +1 -0
- package/icons/svg/wave.svg +1 -0
- package/icons/svg/web.svg +1 -0
- package/icons/svg/webhook.svg +1 -0
- package/icons/svg/wifi-off.svg +1 -0
- package/icons/svg/wifi.svg +1 -0
- package/icons/svg/window.svg +1 -0
- package/icons/svg/zoom-in.svg +1 -0
- package/icons/svg/zoom-out.svg +1 -0
- package/package.json +108 -4
- package/src/characters/data.ts +13 -0
- package/src/characters/index.ts +23 -0
- package/src/dom/search.ts +59 -0
- package/src/i18n/index.ts +140 -0
- package/src/icons/data.ts +760 -0
- package/tokens/tokens.json +625 -0
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { isPlainVisit, copyText, searchEntries, highlight } from '../chunk-O5ZNXHSV.js';
|
|
2
|
+
import { attachSplit, cullFireflies } from '../chunk-AXIJDECU.js';
|
|
3
|
+
|
|
4
|
+
// src/dom/docs-elements.ts
|
|
5
|
+
var save = (k, v, store = globalThis.localStorage) => {
|
|
6
|
+
try {
|
|
7
|
+
store?.setItem(k, v);
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var load = (k, store = globalThis.localStorage) => {
|
|
12
|
+
try {
|
|
13
|
+
return store?.getItem(k) ?? null;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var norm = (p) => decodeURI(p).replace(/\/$/, "") || "/";
|
|
19
|
+
function markCurrentPage(nav, path = location.pathname) {
|
|
20
|
+
const here = norm(path);
|
|
21
|
+
let current = null;
|
|
22
|
+
for (const a of nav.querySelectorAll(".sy-snav a[href]")) {
|
|
23
|
+
const on = norm(new URL(a.href, location.href).pathname) === here;
|
|
24
|
+
if (on) {
|
|
25
|
+
a.setAttribute("aria-current", "page");
|
|
26
|
+
current = a;
|
|
27
|
+
} else a.removeAttribute("aria-current");
|
|
28
|
+
}
|
|
29
|
+
const sec = current?.closest("details");
|
|
30
|
+
if (sec && !sec.open) sec.open = true;
|
|
31
|
+
return current;
|
|
32
|
+
}
|
|
33
|
+
var docs = () => document.querySelector("sy-docs");
|
|
34
|
+
var routed = () => !!document.querySelector('meta[name="astro-view-transitions-enabled"]');
|
|
35
|
+
if (typeof document !== "undefined" && !globalThis.__syDocsWired) {
|
|
36
|
+
globalThis.__syDocsWired = true;
|
|
37
|
+
document.addEventListener("click", (e) => {
|
|
38
|
+
if (routed()) return;
|
|
39
|
+
const a = e.target.closest?.("a[href]");
|
|
40
|
+
if (!a || !isPlainVisit(e, a)) return;
|
|
41
|
+
docs()?.showSkeleton(a.dataset.nextSkeleton);
|
|
42
|
+
docs()?.closeNav();
|
|
43
|
+
});
|
|
44
|
+
document.addEventListener("astro:before-preparation", (e) => {
|
|
45
|
+
const source = e.sourceElement;
|
|
46
|
+
const a = source?.closest?.("a");
|
|
47
|
+
docs()?.showSkeleton(a?.dataset.nextSkeleton);
|
|
48
|
+
docs()?.closeNav();
|
|
49
|
+
});
|
|
50
|
+
let fromSide = false;
|
|
51
|
+
document.addEventListener("pointerdown", (e) => {
|
|
52
|
+
fromSide = !!e.target.closest?.(".sy-dside");
|
|
53
|
+
}, true);
|
|
54
|
+
document.addEventListener("astro:after-swap", () => {
|
|
55
|
+
const side = document.querySelector(".sy-dside");
|
|
56
|
+
if (!side) return;
|
|
57
|
+
const current = markCurrentPage(side);
|
|
58
|
+
const moved = !fromSide;
|
|
59
|
+
fromSide = false;
|
|
60
|
+
if (current && moved) {
|
|
61
|
+
const r = current.getBoundingClientRect(), b = side.getBoundingClientRect();
|
|
62
|
+
if (r.top < b.top || r.bottom > b.bottom) current.scrollIntoView({ block: "nearest" });
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
addEventListener("pageshow", () => docs()?.hideSkeleton());
|
|
66
|
+
document.addEventListener("toggle", (e) => {
|
|
67
|
+
const d = e.target;
|
|
68
|
+
if (!(d instanceof HTMLDetailsElement) || !d.classList.contains("sy-snav__sec")) return;
|
|
69
|
+
const key = d.dataset.key;
|
|
70
|
+
if (!key) return;
|
|
71
|
+
try {
|
|
72
|
+
const open = JSON.parse(localStorage.getItem("sy-snav") ?? "{}");
|
|
73
|
+
open[key] = d.open;
|
|
74
|
+
localStorage.setItem("sy-snav", JSON.stringify(open));
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
}, true);
|
|
78
|
+
matchMedia("(min-width: 60rem)").addEventListener("change", (m) => {
|
|
79
|
+
if (m.matches) docs()?.closeNav();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
var SyDocs = class extends HTMLElement {
|
|
83
|
+
#wired = false;
|
|
84
|
+
#lastFocus = null;
|
|
85
|
+
connectedCallback() {
|
|
86
|
+
if (this.#wired) return;
|
|
87
|
+
this.#wired = true;
|
|
88
|
+
document.documentElement.classList.add("sy-js");
|
|
89
|
+
this.addEventListener("click", (e) => {
|
|
90
|
+
const t = e.target;
|
|
91
|
+
if (t.closest("[data-nav-open]")) this.openNav();
|
|
92
|
+
else if (t.closest("[data-nav-close]")) this.closeNav(true);
|
|
93
|
+
else if (t.closest("[data-nav-fold]")) {
|
|
94
|
+
const root = document.documentElement, hidden = root.dataset.nav !== "hidden";
|
|
95
|
+
if (hidden) root.dataset.nav = "hidden";
|
|
96
|
+
else delete root.dataset.nav;
|
|
97
|
+
save("sy-nav", hidden ? "hidden" : "");
|
|
98
|
+
this.querySelectorAll("[data-nav-fold]").forEach((b) => b.setAttribute("aria-expanded", String(!hidden)));
|
|
99
|
+
} else if (t.closest("[data-surface-toggle]")) {
|
|
100
|
+
const root = document.documentElement;
|
|
101
|
+
const now = root.dataset.surface ?? (matchMedia("(prefers-color-scheme: light)").matches ? "paper" : "night");
|
|
102
|
+
root.dataset.surface = now === "night" ? "paper" : "night";
|
|
103
|
+
save("sy-surface", root.dataset.surface);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
this.addEventListener("keydown", (e) => {
|
|
107
|
+
if (e.key === "Escape" && this.querySelector(".sy-dside[data-open]")) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
this.closeNav(true);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const fold = document.documentElement.dataset.nav === "hidden";
|
|
113
|
+
this.querySelectorAll("[data-nav-fold]").forEach((b) => b.setAttribute("aria-expanded", String(!fold)));
|
|
114
|
+
const side = this.querySelector(".sy-dside");
|
|
115
|
+
if (side && !side.dataset.restored) {
|
|
116
|
+
side.dataset.restored = "";
|
|
117
|
+
const y = Number(load("sy-dside-y", globalThis.sessionStorage));
|
|
118
|
+
if (y) side.scrollTop = y;
|
|
119
|
+
const current = side.querySelector('[aria-current="page"]');
|
|
120
|
+
if (current) {
|
|
121
|
+
const r = current.getBoundingClientRect(), s = side.getBoundingClientRect();
|
|
122
|
+
if (r.top < s.top || r.bottom > s.bottom) current.scrollIntoView({ block: "nearest" });
|
|
123
|
+
}
|
|
124
|
+
addEventListener("pagehide", () => save("sy-dside-y", String(side.scrollTop), globalThis.sessionStorage));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
openNav() {
|
|
128
|
+
const side = this.querySelector(".sy-dside");
|
|
129
|
+
if (!side) return;
|
|
130
|
+
side.toggleAttribute("data-open", true);
|
|
131
|
+
this.querySelector(".sy-dscrim")?.toggleAttribute("data-open", true);
|
|
132
|
+
this.querySelector("[data-nav-open]")?.setAttribute("aria-expanded", "true");
|
|
133
|
+
this.#lastFocus = document.activeElement;
|
|
134
|
+
side.querySelector("[data-nav-close]")?.focus();
|
|
135
|
+
}
|
|
136
|
+
closeNav(returnFocus = false) {
|
|
137
|
+
const side = this.querySelector(".sy-dside");
|
|
138
|
+
if (!side?.hasAttribute("data-open")) return;
|
|
139
|
+
side.removeAttribute("data-open");
|
|
140
|
+
this.querySelector(".sy-dscrim")?.removeAttribute("data-open");
|
|
141
|
+
this.querySelector("[data-nav-open]")?.setAttribute("aria-expanded", "false");
|
|
142
|
+
if (returnFocus) this.#lastFocus?.focus?.();
|
|
143
|
+
}
|
|
144
|
+
/** Puts the skeleton named `name` in place of the article. */
|
|
145
|
+
showSkeleton(name = "article") {
|
|
146
|
+
const main = this.querySelector(".sy-dmain");
|
|
147
|
+
if (!main) return;
|
|
148
|
+
const tpl = this.querySelector(`template[data-skeleton-name="${CSS.escape(name)}"]`) ?? this.querySelector('template[data-skeleton-name="article"]');
|
|
149
|
+
let holder = main.querySelector(":scope > .sy-dloading");
|
|
150
|
+
if (!holder) {
|
|
151
|
+
holder = document.createElement("div");
|
|
152
|
+
holder.className = "sy-dloading";
|
|
153
|
+
holder.setAttribute("aria-hidden", "true");
|
|
154
|
+
main.prepend(holder);
|
|
155
|
+
}
|
|
156
|
+
holder.replaceChildren(tpl ? tpl.content.cloneNode(true) : document.createTextNode(""));
|
|
157
|
+
main.setAttribute("aria-busy", "true");
|
|
158
|
+
}
|
|
159
|
+
hideSkeleton() {
|
|
160
|
+
const main = this.querySelector(".sy-dmain");
|
|
161
|
+
main?.removeAttribute("aria-busy");
|
|
162
|
+
main?.querySelector(":scope > .sy-dloading")?.replaceChildren();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var SyToc = class extends HTMLElement {
|
|
166
|
+
#io = null;
|
|
167
|
+
connectedCallback() {
|
|
168
|
+
const links = [...this.querySelectorAll('a[href^="#"]')];
|
|
169
|
+
const targets = links.map((a) => document.getElementById(decodeURIComponent(a.hash.slice(1)))).filter((x) => !!x);
|
|
170
|
+
if (!targets.length || typeof IntersectionObserver === "undefined") return;
|
|
171
|
+
const visible = /* @__PURE__ */ new Set();
|
|
172
|
+
const light = () => {
|
|
173
|
+
let id = targets.find((t) => visible.has(t))?.id;
|
|
174
|
+
if (!id) {
|
|
175
|
+
const above = targets.filter((t) => t.getBoundingClientRect().top < 120);
|
|
176
|
+
id = above[above.length - 1]?.id ?? targets[0].id;
|
|
177
|
+
}
|
|
178
|
+
for (const a of links) a.setAttribute("aria-current", String(decodeURIComponent(a.hash.slice(1)) === id));
|
|
179
|
+
};
|
|
180
|
+
this.#io = new IntersectionObserver((entries) => {
|
|
181
|
+
for (const e of entries) e.isIntersecting ? visible.add(e.target) : visible.delete(e.target);
|
|
182
|
+
light();
|
|
183
|
+
}, { rootMargin: "-64px 0px -55% 0px" });
|
|
184
|
+
targets.forEach((t) => this.#io.observe(t));
|
|
185
|
+
light();
|
|
186
|
+
}
|
|
187
|
+
disconnectedCallback() {
|
|
188
|
+
this.#io?.disconnect();
|
|
189
|
+
this.#io = null;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var SySearch = class extends HTMLElement {
|
|
193
|
+
#entries = null;
|
|
194
|
+
#hits = [];
|
|
195
|
+
#sel = 0;
|
|
196
|
+
#wired = false;
|
|
197
|
+
get dialog() {
|
|
198
|
+
return this.querySelector("dialog");
|
|
199
|
+
}
|
|
200
|
+
connectedCallback() {
|
|
201
|
+
if (this.#wired) return;
|
|
202
|
+
this.#wired = true;
|
|
203
|
+
const dialog = this.dialog, input = this.querySelector("input[type=search]"), list = this.querySelector("[data-results]");
|
|
204
|
+
if (!dialog || !input || !list) return;
|
|
205
|
+
const first = () => document.querySelector("sy-search") === this;
|
|
206
|
+
document.addEventListener("click", (e) => {
|
|
207
|
+
const b = e.target.closest?.("[data-search-open]");
|
|
208
|
+
if (!b) return;
|
|
209
|
+
const want = b.dataset.searchOpen;
|
|
210
|
+
if (want ? want === this.id : first()) {
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
this.open();
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
document.addEventListener("keydown", (e) => {
|
|
216
|
+
if (!first()) return;
|
|
217
|
+
const typing = e.target.closest?.('input, textarea, select, [contenteditable="true"]');
|
|
218
|
+
if ((e.key === "k" || e.key === "K") && (e.metaKey || e.ctrlKey)) {
|
|
219
|
+
e.preventDefault();
|
|
220
|
+
dialog.open ? dialog.close() : this.open();
|
|
221
|
+
} else if (e.key === "/" && !typing && !dialog.open) {
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
this.open();
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
dialog.addEventListener("click", (e) => {
|
|
227
|
+
if (e.target === dialog) dialog.close();
|
|
228
|
+
});
|
|
229
|
+
input.addEventListener("input", () => this.#run(input.value));
|
|
230
|
+
input.addEventListener("keydown", (e) => {
|
|
231
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
232
|
+
e.preventDefault();
|
|
233
|
+
this.#select(this.#sel + (e.key === "ArrowDown" ? 1 : -1));
|
|
234
|
+
} else if (e.key === "Enter") {
|
|
235
|
+
const hit = this.#hits[this.#sel];
|
|
236
|
+
if (hit) {
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
list.querySelectorAll("a")[this.#sel]?.click();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
async open() {
|
|
244
|
+
const dialog = this.dialog, input = this.querySelector("input[type=search]");
|
|
245
|
+
if (!dialog || !input) return;
|
|
246
|
+
if (!dialog.open) dialog.showModal();
|
|
247
|
+
input.select();
|
|
248
|
+
if (!this.#entries) {
|
|
249
|
+
try {
|
|
250
|
+
const src = this.getAttribute("index");
|
|
251
|
+
this.#entries = src ? await (await fetch(src)).json() : JSON.parse(this.querySelector('script[type="application/json"]')?.textContent ?? "[]");
|
|
252
|
+
} catch {
|
|
253
|
+
this.#entries = [];
|
|
254
|
+
}
|
|
255
|
+
this.#run(input.value);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/** Gives the search its entries directly (instead of the index URL). */
|
|
259
|
+
set entries(v) {
|
|
260
|
+
this.#entries = v;
|
|
261
|
+
}
|
|
262
|
+
#run(q) {
|
|
263
|
+
const list = this.querySelector("[data-results]"), empty = this.querySelector("[data-empty]"), hint = this.querySelector("[data-hint]");
|
|
264
|
+
if (!list) return;
|
|
265
|
+
this.#hits = searchEntries(this.#entries ?? [], q);
|
|
266
|
+
this.#sel = 0;
|
|
267
|
+
const has = q.trim().length > 0;
|
|
268
|
+
if (hint) hint.hidden = has;
|
|
269
|
+
if (empty) {
|
|
270
|
+
empty.hidden = !has || this.#hits.length > 0;
|
|
271
|
+
const title = empty.querySelector("[data-empty-title]");
|
|
272
|
+
if (title) title.textContent = (empty.dataset.template ?? "\xAB{query}\xBB").replace("{query}", q.trim());
|
|
273
|
+
}
|
|
274
|
+
const groups = /* @__PURE__ */ new Map();
|
|
275
|
+
for (const h of this.#hits) {
|
|
276
|
+
const g = h.group ?? "";
|
|
277
|
+
groups.set(g, [...groups.get(g) ?? [], h]);
|
|
278
|
+
}
|
|
279
|
+
let i = 0, html = "";
|
|
280
|
+
for (const [g, hits] of groups) {
|
|
281
|
+
if (g) html += `<li class="sy-dsearch__group" role="presentation">${highlight(g, "")}</li>`;
|
|
282
|
+
for (const h of hits) {
|
|
283
|
+
html += `<li role="presentation"><a class="sy-hit" role="option" id="${this.id || "sy-search"}-o${i}" aria-selected="${i === 0}" href="${h.url.replace(/"/g, """)}"><b>${highlight(h.title, q)}</b>${h.text ? `<span>${highlight(h.text, q)}</span>` : ""}</a></li>`;
|
|
284
|
+
i++;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
list.innerHTML = html;
|
|
288
|
+
this.#select(0);
|
|
289
|
+
}
|
|
290
|
+
#select(n) {
|
|
291
|
+
const opts = [...this.querySelectorAll("[data-results] [role=option]")];
|
|
292
|
+
const input = this.querySelector("input[type=search]");
|
|
293
|
+
if (!opts.length) {
|
|
294
|
+
input?.removeAttribute("aria-activedescendant");
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
this.#sel = (n + opts.length) % opts.length;
|
|
298
|
+
opts.forEach((o, i) => o.setAttribute("aria-selected", String(i === this.#sel)));
|
|
299
|
+
input?.setAttribute("aria-activedescendant", opts[this.#sel].id);
|
|
300
|
+
opts[this.#sel].scrollIntoView({ block: "nearest" });
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var SyTerms = class extends HTMLElement {
|
|
304
|
+
#tip = null;
|
|
305
|
+
#wired = false;
|
|
306
|
+
connectedCallback() {
|
|
307
|
+
if (this.#wired) return;
|
|
308
|
+
this.#wired = true;
|
|
309
|
+
const show = (el) => {
|
|
310
|
+
const tip = this.#tip ?? (this.#tip = Object.assign(document.createElement("div"), { className: "sy-termtip", role: "tooltip", id: "sy-termtip" }));
|
|
311
|
+
if (!tip.isConnected) document.body.append(tip);
|
|
312
|
+
tip.innerHTML = "";
|
|
313
|
+
tip.append(Object.assign(document.createElement("b"), { textContent: el.dataset.term ?? "" }), document.createTextNode(el.dataset.def ?? ""));
|
|
314
|
+
el.setAttribute("aria-describedby", tip.id);
|
|
315
|
+
const r = el.getBoundingClientRect();
|
|
316
|
+
tip.style.left = `${Math.max(16, Math.min(r.left, innerWidth - tip.offsetWidth - 16))}px`;
|
|
317
|
+
const below = r.bottom + 8 + tip.offsetHeight < innerHeight;
|
|
318
|
+
tip.style.top = `${below ? r.bottom + 8 : r.top - tip.offsetHeight - 8}px`;
|
|
319
|
+
tip.toggleAttribute("data-show", true);
|
|
320
|
+
};
|
|
321
|
+
const hide = () => this.#tip?.removeAttribute("data-show");
|
|
322
|
+
const term = (e) => e.target.closest?.("[data-term][data-def]");
|
|
323
|
+
this.addEventListener("pointerover", (e) => {
|
|
324
|
+
const t = term(e);
|
|
325
|
+
if (t) show(t);
|
|
326
|
+
});
|
|
327
|
+
this.addEventListener("pointerout", (e) => {
|
|
328
|
+
if (term(e)) hide();
|
|
329
|
+
});
|
|
330
|
+
this.addEventListener("focusin", (e) => {
|
|
331
|
+
const t = term(e);
|
|
332
|
+
if (t) show(t);
|
|
333
|
+
});
|
|
334
|
+
this.addEventListener("focusout", hide);
|
|
335
|
+
addEventListener("scroll", hide, { passive: true });
|
|
336
|
+
document.addEventListener("keydown", (e) => {
|
|
337
|
+
if (e.key === "Escape") hide();
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
var SyFeedback = class extends HTMLElement {
|
|
342
|
+
#wired = false;
|
|
343
|
+
connectedCallback() {
|
|
344
|
+
if (this.#wired) return;
|
|
345
|
+
this.#wired = true;
|
|
346
|
+
this.addEventListener("click", (e) => {
|
|
347
|
+
const b = e.target.closest("button[data-useful]");
|
|
348
|
+
if (!b) return;
|
|
349
|
+
const root = this.querySelector(".sy-feedback") ?? this;
|
|
350
|
+
root.toggleAttribute("data-sent", true);
|
|
351
|
+
this.dispatchEvent(new CustomEvent("sy-feedback", { bubbles: true, detail: { page: this.getAttribute("page") ?? location.pathname, useful: b.dataset.useful === "yes" } }));
|
|
352
|
+
root.querySelector(".sy-feedback__done")?.focus();
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/dom/elements.ts
|
|
358
|
+
var SyCopy = class extends HTMLElement {
|
|
359
|
+
#wired = false;
|
|
360
|
+
connectedCallback() {
|
|
361
|
+
if (this.#wired) return;
|
|
362
|
+
this.#wired = true;
|
|
363
|
+
this.addEventListener("click", async (e) => {
|
|
364
|
+
const btn = e.target.closest("button");
|
|
365
|
+
if (!btn || btn.hasAttribute("data-done")) return;
|
|
366
|
+
const value = this.getAttribute("value") ?? document.getElementById(this.getAttribute("for") ?? "")?.textContent ?? "";
|
|
367
|
+
if (!await copyText(value)) return;
|
|
368
|
+
const done = this.getAttribute("done") ?? "Copied";
|
|
369
|
+
const label = btn.querySelector("[data-label]");
|
|
370
|
+
const before = label ? label.textContent : btn.getAttribute("aria-label");
|
|
371
|
+
if (label) label.textContent = done;
|
|
372
|
+
else btn.setAttribute("aria-label", done);
|
|
373
|
+
btn.setAttribute("data-done", "");
|
|
374
|
+
setTimeout(() => {
|
|
375
|
+
if (label) label.textContent = before;
|
|
376
|
+
else if (before !== null) btn.setAttribute("aria-label", before);
|
|
377
|
+
btn.removeAttribute("data-done");
|
|
378
|
+
}, 1600);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
var SyTabs = class extends HTMLElement {
|
|
383
|
+
#wired = false;
|
|
384
|
+
connectedCallback() {
|
|
385
|
+
if (this.#wired) {
|
|
386
|
+
if (this.#follow) document.addEventListener("sy-tabs-sync", this.#follow);
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
this.#wired = true;
|
|
390
|
+
const tabs = () => [...this.querySelectorAll(":scope > [role=tablist] > [role=tab]")];
|
|
391
|
+
const select = (tab, focus = false, save2 = true) => {
|
|
392
|
+
for (const t of tabs()) {
|
|
393
|
+
const on = t === tab;
|
|
394
|
+
t.setAttribute("aria-selected", String(on));
|
|
395
|
+
t.tabIndex = on ? 0 : -1;
|
|
396
|
+
const panel = document.getElementById(t.getAttribute("aria-controls") ?? "");
|
|
397
|
+
if (panel) panel.hidden = !on;
|
|
398
|
+
}
|
|
399
|
+
if (focus) tab.focus();
|
|
400
|
+
const group2 = this.getAttribute("sync");
|
|
401
|
+
if (group2 && save2) {
|
|
402
|
+
try {
|
|
403
|
+
localStorage.setItem(`sy-tabs:${group2}`, tab.dataset.value ?? "");
|
|
404
|
+
} catch {
|
|
405
|
+
}
|
|
406
|
+
document.dispatchEvent(new CustomEvent("sy-tabs-sync", { detail: { group: group2, value: tab.dataset.value, from: this } }));
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
this.#follow = (e) => {
|
|
410
|
+
const { group: group2, value, from } = e.detail ?? {};
|
|
411
|
+
if (from === this || group2 !== this.getAttribute("sync")) return;
|
|
412
|
+
const t = tabs().find((x) => x.dataset.value === value);
|
|
413
|
+
if (t) select(t, false, false);
|
|
414
|
+
};
|
|
415
|
+
document.addEventListener("sy-tabs-sync", this.#follow);
|
|
416
|
+
this.addEventListener("click", (e) => {
|
|
417
|
+
const t = e.target.closest("[role=tab]");
|
|
418
|
+
if (t && tabs().includes(t)) select(t);
|
|
419
|
+
});
|
|
420
|
+
this.addEventListener("keydown", (e) => {
|
|
421
|
+
const all = tabs(), i = all.indexOf(document.activeElement);
|
|
422
|
+
if (i < 0) return;
|
|
423
|
+
const next = e.key === "ArrowRight" ? all[(i + 1) % all.length] : e.key === "ArrowLeft" ? all[(i - 1 + all.length) % all.length] : e.key === "Home" ? all[0] : e.key === "End" ? all[all.length - 1] : null;
|
|
424
|
+
if (next) {
|
|
425
|
+
e.preventDefault();
|
|
426
|
+
select(next, true);
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
const group = this.getAttribute("sync");
|
|
430
|
+
let saved = null;
|
|
431
|
+
if (group) {
|
|
432
|
+
try {
|
|
433
|
+
saved = localStorage.getItem(`sy-tabs:${group}`);
|
|
434
|
+
} catch {
|
|
435
|
+
saved = null;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const first = tabs().find((t) => saved && t.dataset.value === saved) ?? tabs().find((t) => t.getAttribute("aria-selected") === "true") ?? tabs()[0];
|
|
439
|
+
if (first) select(first, false, false);
|
|
440
|
+
}
|
|
441
|
+
#follow = null;
|
|
442
|
+
disconnectedCallback() {
|
|
443
|
+
if (this.#follow) document.removeEventListener("sy-tabs-sync", this.#follow);
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
var SySplit = class extends HTMLElement {
|
|
447
|
+
#undo = null;
|
|
448
|
+
connectedCallback() {
|
|
449
|
+
const root = this.querySelector(":scope > .sy-split");
|
|
450
|
+
if (!root || this.#undo) return;
|
|
451
|
+
const num = (n, d) => {
|
|
452
|
+
const v = Number(this.getAttribute(n));
|
|
453
|
+
return Number.isFinite(v) && this.hasAttribute(n) ? v : d;
|
|
454
|
+
};
|
|
455
|
+
const key = this.getAttribute("remember");
|
|
456
|
+
let size = num("size", 50);
|
|
457
|
+
if (key) {
|
|
458
|
+
try {
|
|
459
|
+
const v = Number(localStorage.getItem(`sy-split:${key}`));
|
|
460
|
+
if (v) size = v;
|
|
461
|
+
} catch {
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
this.#undo = attachSplit(root, {
|
|
465
|
+
size,
|
|
466
|
+
min: num("min", 15),
|
|
467
|
+
max: num("max", 85),
|
|
468
|
+
orientation: this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal",
|
|
469
|
+
onChange: (n) => {
|
|
470
|
+
if (key) {
|
|
471
|
+
try {
|
|
472
|
+
localStorage.setItem(`sy-split:${key}`, String(n));
|
|
473
|
+
} catch {
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
disconnectedCallback() {
|
|
480
|
+
this.#undo?.();
|
|
481
|
+
this.#undo = null;
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
var SyToolbar = class extends HTMLElement {
|
|
485
|
+
#wired = false;
|
|
486
|
+
connectedCallback() {
|
|
487
|
+
if (this.#wired) return;
|
|
488
|
+
this.#wired = true;
|
|
489
|
+
const bar = this.querySelector("[role=toolbar]") ?? this;
|
|
490
|
+
const items = () => [...bar.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"]), [data-roving]')].filter((el) => el !== bar);
|
|
491
|
+
const rove = (target) => {
|
|
492
|
+
for (const el of items()) {
|
|
493
|
+
el.tabIndex = el === target ? 0 : -1;
|
|
494
|
+
el.dataset.roving = "";
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
const first = items()[0];
|
|
498
|
+
if (first) rove(first);
|
|
499
|
+
bar.addEventListener("focusin", (e) => {
|
|
500
|
+
const t = e.target;
|
|
501
|
+
if (items().includes(t)) rove(t);
|
|
502
|
+
});
|
|
503
|
+
bar.addEventListener("keydown", (e) => {
|
|
504
|
+
const all = items(), i = all.indexOf(document.activeElement);
|
|
505
|
+
if (i < 0 || e.target.matches("input, select, textarea")) return;
|
|
506
|
+
const next = e.key === "ArrowRight" ? all[(i + 1) % all.length] : e.key === "ArrowLeft" ? all[(i - 1 + all.length) % all.length] : e.key === "Home" ? all[0] : e.key === "End" ? all[all.length - 1] : null;
|
|
507
|
+
if (next) {
|
|
508
|
+
e.preventDefault();
|
|
509
|
+
rove(next);
|
|
510
|
+
next.focus();
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
var SyFireflies = class extends HTMLElement {
|
|
516
|
+
#undo = null;
|
|
517
|
+
connectedCallback() {
|
|
518
|
+
const f = this.querySelector(".sy-flies");
|
|
519
|
+
if (f && !this.#undo) this.#undo = cullFireflies(f);
|
|
520
|
+
}
|
|
521
|
+
disconnectedCallback() {
|
|
522
|
+
this.#undo?.();
|
|
523
|
+
this.#undo = null;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
for (const [name, ctor] of [
|
|
527
|
+
["sy-copy", SyCopy],
|
|
528
|
+
["sy-tabs", SyTabs],
|
|
529
|
+
["sy-split", SySplit],
|
|
530
|
+
["sy-toolbar", SyToolbar],
|
|
531
|
+
["sy-docs", SyDocs],
|
|
532
|
+
["sy-toc", SyToc],
|
|
533
|
+
["sy-search", SySearch],
|
|
534
|
+
["sy-terms", SyTerms],
|
|
535
|
+
["sy-feedback", SyFeedback],
|
|
536
|
+
["sy-fireflies", SyFireflies]
|
|
537
|
+
]) {
|
|
538
|
+
if (typeof customElements !== "undefined" && !customElements.get(name)) customElements.define(name, ctor);
|
|
539
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Copies text and reports whether it worked. Falls back to a hidden textarea where the clipboard API is not allowed. */
|
|
2
|
+
declare function copyText(text: string): Promise<boolean>;
|
|
3
|
+
|
|
4
|
+
interface SplitOptions {
|
|
5
|
+
/** Size of the first pane, in percent. */
|
|
6
|
+
size: number;
|
|
7
|
+
/** Smallest and largest size of the first pane, in percent. */
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
/** 'horizontal': panes side by side (default). 'vertical': one above the other. */
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
onChange?: (size: number) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const clampSize: (n: number, min?: number, max?: number) => number;
|
|
15
|
+
/** The size after a key press, or null when the key does nothing. Arrows move 2%, with Shift 10%; Home and End go to the limits. */
|
|
16
|
+
declare function sizeForKey(key: string, size: number, { min, max, orientation, shift }?: {
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
orientation?: 'horizontal' | 'vertical';
|
|
20
|
+
shift?: boolean;
|
|
21
|
+
}): number | null;
|
|
22
|
+
/** Wires a .sy-split element: its handle, its keyboard and the --split variable. Returns a function that undoes it. */
|
|
23
|
+
declare function attachSplit(root: HTMLElement, opts: SplitOptions): () => void;
|
|
24
|
+
|
|
25
|
+
interface SearchEntry {
|
|
26
|
+
/** What the result says in bold: the page or section title. */
|
|
27
|
+
title: string;
|
|
28
|
+
url: string;
|
|
29
|
+
/** Where it lives: the section of the docs, the group of the gallery. Results are grouped by it. */
|
|
30
|
+
group?: string;
|
|
31
|
+
/** A line of text from the page, shown under the title. */
|
|
32
|
+
text?: string;
|
|
33
|
+
/** Other words people may type for it. */
|
|
34
|
+
keywords?: string[];
|
|
35
|
+
}
|
|
36
|
+
interface SearchHit extends SearchEntry {
|
|
37
|
+
score: number;
|
|
38
|
+
}
|
|
39
|
+
/** Lower case, without accents, so «configuración» is found by «configuracion». */
|
|
40
|
+
declare const fold: (s: string) => string;
|
|
41
|
+
declare const terms: (q: string) => string[];
|
|
42
|
+
declare function searchEntries(entries: SearchEntry[], query: string, limit?: number): SearchHit[];
|
|
43
|
+
/** The text as HTML with the typed words in <mark>, matched without regard to case or accents. */
|
|
44
|
+
declare function highlight(text: string, query: string): string;
|
|
45
|
+
|
|
46
|
+
/** Is this click a plain visit to another page of the same site, that we may announce with a skeleton? */
|
|
47
|
+
declare function isPlainVisit(e: MouseEvent, a: HTMLAnchorElement, here?: Location): boolean;
|
|
48
|
+
|
|
49
|
+
declare function cullFireflies(field: HTMLElement, pad?: number): () => void;
|
|
50
|
+
|
|
51
|
+
export { type SearchEntry, type SearchHit, type SplitOptions, attachSplit, clampSize, copyText, cullFireflies, fold, highlight, isPlainVisit, searchEntries, sizeForKey, terms };
|