fromsrc 0.0.0 → 0.0.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 +49 -0
- package/dist/access.d.ts +23 -0
- package/dist/access.js +54 -0
- package/dist/adapter.d.ts +31 -0
- package/dist/adapter.js +59 -0
- package/dist/adapterastro.d.ts +6 -0
- package/dist/adapterastro.js +6 -0
- package/dist/adapterbrowser.d.ts +6 -0
- package/dist/adapterbrowser.js +38 -0
- package/dist/adapternext.d.ts +6 -0
- package/dist/adapternext.js +49 -0
- package/dist/adapterreactrouter.d.ts +6 -0
- package/dist/adapterreactrouter.js +37 -0
- package/dist/adapterremix.d.ts +6 -0
- package/dist/adapterremix.js +41 -0
- package/dist/adaptertanstack.d.ts +6 -0
- package/dist/adaptertanstack.js +38 -0
- package/dist/adaptervite.d.ts +6 -0
- package/dist/adaptervite.js +6 -0
- package/dist/algolia.d.ts +16 -0
- package/dist/algolia.js +83 -0
- package/dist/analytics.d.ts +31 -0
- package/dist/analytics.js +61 -0
- package/dist/ansi.d.ts +5 -0
- package/dist/ansi.js +192 -0
- package/dist/api.d.ts +30 -0
- package/dist/api.js +75 -0
- package/dist/astro.d.ts +3 -0
- package/dist/astro.js +3 -0
- package/dist/audit.d.ts +19 -0
- package/dist/audit.js +78 -0
- package/dist/autotype.d.ts +17 -0
- package/dist/autotype.js +73 -0
- package/dist/batch.d.ts +22 -0
- package/dist/batch.js +68 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.js +53 -0
- package/dist/changelog.d.ts +27 -0
- package/dist/changelog.js +87 -0
- package/dist/changelogutil.d.ts +20 -0
- package/dist/changelogutil.js +84 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.js +76 -0
- package/dist/client.d.ts +212 -0
- package/dist/client.js +202 -0
- package/dist/codesample.d.ts +20 -0
- package/dist/codesample.js +115 -0
- package/dist/collapse.d.ts +5 -0
- package/dist/collapse.js +101 -0
- package/dist/collections.d.ts +32 -0
- package/dist/collections.js +82 -0
- package/dist/components/accordion.d.ts +22 -0
- package/dist/components/accordion.js +54 -0
- package/dist/components/alert.d.ts +18 -0
- package/dist/components/alert.js +30 -0
- package/dist/components/announce.d.ts +11 -0
- package/dist/components/announce.js +38 -0
- package/dist/components/autofill.d.ts +27 -0
- package/dist/components/autofill.js +152 -0
- package/dist/components/avatar.d.ts +42 -0
- package/dist/components/avatar.js +67 -0
- package/dist/components/avatarstack.d.ts +23 -0
- package/dist/components/avatarstack.js +54 -0
- package/dist/components/backtotop.d.ts +20 -0
- package/dist/components/backtotop.js +42 -0
- package/dist/components/badge.d.ts +17 -0
- package/dist/components/badge.js +25 -0
- package/dist/components/banner.d.ts +21 -0
- package/dist/components/banner.js +63 -0
- package/dist/components/breadcrumb.d.ts +25 -0
- package/dist/components/breadcrumb.js +35 -0
- package/dist/components/breadcrumbnav.d.ts +15 -0
- package/dist/components/breadcrumbnav.js +60 -0
- package/dist/components/button.d.ts +22 -0
- package/dist/components/button.js +47 -0
- package/dist/components/callout.d.ts +26 -0
- package/dist/components/callout.js +91 -0
- package/dist/components/cards.d.ts +34 -0
- package/dist/components/cards.js +24 -0
- package/dist/components/changelog.d.ts +34 -0
- package/dist/components/changelog.js +50 -0
- package/dist/components/checkbox.d.ts +26 -0
- package/dist/components/checkbox.js +80 -0
- package/dist/components/code.d.ts +27 -0
- package/dist/components/code.js +36 -0
- package/dist/components/codeblock.d.ts +12 -0
- package/dist/components/codeblock.js +102 -0
- package/dist/components/codecopy.d.ts +12 -0
- package/dist/components/codecopy.js +56 -0
- package/dist/components/codegroup.d.ts +22 -0
- package/dist/components/codegroup.js +134 -0
- package/dist/components/collapsible.d.ts +29 -0
- package/dist/components/collapsible.js +64 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +138 -0
- package/dist/components/compare.d.ts +54 -0
- package/dist/components/compare.js +88 -0
- package/dist/components/content.d.ts +12 -0
- package/dist/components/content.js +232 -0
- package/dist/components/copyable.d.ts +25 -0
- package/dist/components/copyable.js +51 -0
- package/dist/components/copybutton.d.ts +11 -0
- package/dist/components/copybutton.js +50 -0
- package/dist/components/countdown.d.ts +18 -0
- package/dist/components/countdown.js +112 -0
- package/dist/components/create.d.ts +10 -0
- package/dist/components/create.js +149 -0
- package/dist/components/definition.d.ts +43 -0
- package/dist/components/definition.js +46 -0
- package/dist/components/diffview.d.ts +12 -0
- package/dist/components/diffview.js +129 -0
- package/dist/components/divider.d.ts +19 -0
- package/dist/components/divider.js +24 -0
- package/dist/components/docheader.d.ts +17 -0
- package/dist/components/docheader.js +24 -0
- package/dist/components/doclinkcard.d.ts +19 -0
- package/dist/components/doclinkcard.js +37 -0
- package/dist/components/docslayout.d.ts +14 -0
- package/dist/components/docslayout.js +24 -0
- package/dist/components/dropdown.d.ts +23 -0
- package/dist/components/dropdown.js +134 -0
- package/dist/components/dynamiccode.d.ts +12 -0
- package/dist/components/dynamiccode.js +40 -0
- package/dist/components/editlink.d.ts +15 -0
- package/dist/components/editlink.js +45 -0
- package/dist/components/embed.d.ts +45 -0
- package/dist/components/embed.js +85 -0
- package/dist/components/endpoint.d.ts +58 -0
- package/dist/components/endpoint.js +100 -0
- package/dist/components/errormessage.d.ts +11 -0
- package/dist/components/errormessage.js +10 -0
- package/dist/components/expandcode.d.ts +13 -0
- package/dist/components/expandcode.js +58 -0
- package/dist/components/feature.d.ts +31 -0
- package/dist/components/feature.js +58 -0
- package/dist/components/featuregrid.d.ts +17 -0
- package/dist/components/featuregrid.js +36 -0
- package/dist/components/feedback.d.ts +14 -0
- package/dist/components/feedback.js +62 -0
- package/dist/components/feedbackwidget.d.ts +14 -0
- package/dist/components/feedbackwidget.js +106 -0
- package/dist/components/files.d.ts +21 -0
- package/dist/components/files.js +133 -0
- package/dist/components/folder.d.ts +15 -0
- package/dist/components/folder.js +102 -0
- package/dist/components/footer.d.ts +16 -0
- package/dist/components/footer.js +28 -0
- package/dist/components/formlabel.d.ts +24 -0
- package/dist/components/formlabel.js +27 -0
- package/dist/components/github.d.ts +14 -0
- package/dist/components/github.js +99 -0
- package/dist/components/graph.d.ts +36 -0
- package/dist/components/graph.js +210 -0
- package/dist/components/heading.d.ts +25 -0
- package/dist/components/heading.js +82 -0
- package/dist/components/headingcopy.d.ts +3 -0
- package/dist/components/headingcopy.js +31 -0
- package/dist/components/hero.d.ts +16 -0
- package/dist/components/hero.js +28 -0
- package/dist/components/highlight.d.ts +41 -0
- package/dist/components/highlight.js +42 -0
- package/dist/components/hover.d.ts +23 -0
- package/dist/components/hover.js +79 -0
- package/dist/components/icons.d.ts +30 -0
- package/dist/components/icons.js +419 -0
- package/dist/components/inlinetoc.d.ts +19 -0
- package/dist/components/inlinetoc.js +28 -0
- package/dist/components/input.d.ts +25 -0
- package/dist/components/input.js +42 -0
- package/dist/components/install.d.ts +10 -0
- package/dist/components/install.js +149 -0
- package/dist/components/kbd.d.ts +22 -0
- package/dist/components/kbd.js +30 -0
- package/dist/components/langicon.d.ts +8 -0
- package/dist/components/langicon.js +48 -0
- package/dist/components/language.d.ts +17 -0
- package/dist/components/language.js +123 -0
- package/dist/components/lastupdated.d.ts +12 -0
- package/dist/components/lastupdated.js +44 -0
- package/dist/components/link.d.ts +14 -0
- package/dist/components/link.js +53 -0
- package/dist/components/linkcard.d.ts +33 -0
- package/dist/components/linkcard.js +50 -0
- package/dist/components/list.d.ts +50 -0
- package/dist/components/list.js +55 -0
- package/dist/components/math.d.ts +34 -0
- package/dist/components/math.js +63 -0
- package/dist/components/mermaid.d.ts +19 -0
- package/dist/components/mermaid.js +79 -0
- package/dist/components/mobilenav.d.ts +17 -0
- package/dist/components/mobilenav.js +263 -0
- package/dist/components/modal.d.ts +18 -0
- package/dist/components/modal.js +69 -0
- package/dist/components/navbar.d.ts +19 -0
- package/dist/components/navbar.js +45 -0
- package/dist/components/navlink.d.ts +14 -0
- package/dist/components/navlink.js +77 -0
- package/dist/components/note.d.ts +28 -0
- package/dist/components/note.js +60 -0
- package/dist/components/openapi.d.ts +14 -0
- package/dist/components/openapi.js +145 -0
- package/dist/components/openapischema.d.ts +13 -0
- package/dist/components/openapischema.js +51 -0
- package/dist/components/openapitags.d.ts +13 -0
- package/dist/components/openapitags.js +20 -0
- package/dist/components/pagetransition.d.ts +13 -0
- package/dist/components/pagetransition.js +37 -0
- package/dist/components/pagination.d.ts +26 -0
- package/dist/components/pagination.js +68 -0
- package/dist/components/panel.d.ts +25 -0
- package/dist/components/panel.js +75 -0
- package/dist/components/playground.d.ts +14 -0
- package/dist/components/playground.js +89 -0
- package/dist/components/popover.d.ts +18 -0
- package/dist/components/popover.js +109 -0
- package/dist/components/prelink.d.ts +10 -0
- package/dist/components/prelink.js +46 -0
- package/dist/components/prevnext.d.ts +17 -0
- package/dist/components/prevnext.js +43 -0
- package/dist/components/progress.d.ts +30 -0
- package/dist/components/progress.js +74 -0
- package/dist/components/property.d.ts +24 -0
- package/dist/components/property.js +44 -0
- package/dist/components/quote.d.ts +44 -0
- package/dist/components/quote.js +41 -0
- package/dist/components/radio.d.ts +48 -0
- package/dist/components/radio.js +140 -0
- package/dist/components/rating.d.ts +22 -0
- package/dist/components/rating.js +100 -0
- package/dist/components/readtime.d.ts +17 -0
- package/dist/components/readtime.js +26 -0
- package/dist/components/recent.d.ts +12 -0
- package/dist/components/recent.js +23 -0
- package/dist/components/responsive.d.ts +35 -0
- package/dist/components/responsive.js +73 -0
- package/dist/components/results.d.ts +20 -0
- package/dist/components/results.js +72 -0
- package/dist/components/screenshot.d.ts +33 -0
- package/dist/components/screenshot.js +52 -0
- package/dist/components/scrollprogress.d.ts +12 -0
- package/dist/components/scrollprogress.js +56 -0
- package/dist/components/scrollspy.d.ts +18 -0
- package/dist/components/scrollspy.js +51 -0
- package/dist/components/search.d.ts +19 -0
- package/dist/components/search.js +228 -0
- package/dist/components/searchbutton.d.ts +10 -0
- package/dist/components/searchbutton.js +51 -0
- package/dist/components/searchdialog.d.ts +19 -0
- package/dist/components/searchdialog.js +108 -0
- package/dist/components/searcher.d.ts +12 -0
- package/dist/components/searcher.js +121 -0
- package/dist/components/select.d.ts +39 -0
- package/dist/components/select.js +162 -0
- package/dist/components/shortcuts.d.ts +17 -0
- package/dist/components/shortcuts.js +62 -0
- package/dist/components/sidebar.d.ts +35 -0
- package/dist/components/sidebar.js +215 -0
- package/dist/components/sidebarfilter.d.ts +13 -0
- package/dist/components/sidebarfilter.js +50 -0
- package/dist/components/skeleton.d.ts +40 -0
- package/dist/components/skeleton.js +59 -0
- package/dist/components/skiplink.d.ts +12 -0
- package/dist/components/skiplink.js +21 -0
- package/dist/components/spinner.d.ts +34 -0
- package/dist/components/spinner.js +56 -0
- package/dist/components/status.d.ts +27 -0
- package/dist/components/status.js +63 -0
- package/dist/components/steps.d.ts +30 -0
- package/dist/components/steps.js +15 -0
- package/dist/components/switch.d.ts +26 -0
- package/dist/components/switch.js +79 -0
- package/dist/components/table.d.ts +36 -0
- package/dist/components/table.js +138 -0
- package/dist/components/tabnav.d.ts +30 -0
- package/dist/components/tabnav.js +199 -0
- package/dist/components/tabs.d.ts +15 -0
- package/dist/components/tabs.js +96 -0
- package/dist/components/tag.d.ts +32 -0
- package/dist/components/tag.js +38 -0
- package/dist/components/terminal.d.ts +48 -0
- package/dist/components/terminal.js +62 -0
- package/dist/components/textarea.d.ts +30 -0
- package/dist/components/textarea.js +100 -0
- package/dist/components/theme.d.ts +11 -0
- package/dist/components/theme.js +66 -0
- package/dist/components/themeprovider.d.ts +19 -0
- package/dist/components/themeprovider.js +58 -0
- package/dist/components/toast.d.ts +31 -0
- package/dist/components/toast.js +107 -0
- package/dist/components/toc/default.d.ts +21 -0
- package/dist/components/toc/default.js +100 -0
- package/dist/components/toc/hook.d.ts +13 -0
- package/dist/components/toc/hook.js +125 -0
- package/dist/components/toc/index.d.ts +15 -0
- package/dist/components/toc/index.js +44 -0
- package/dist/components/toc/inline.d.ts +20 -0
- package/dist/components/toc/inline.js +75 -0
- package/dist/components/toc/minimal.d.ts +22 -0
- package/dist/components/toc/minimal.js +136 -0
- package/dist/components/toc/zigzag.d.ts +18 -0
- package/dist/components/toc/zigzag.js +57 -0
- package/dist/components/tocprogress.d.ts +17 -0
- package/dist/components/tocprogress.js +67 -0
- package/dist/components/tooltip.d.ts +19 -0
- package/dist/components/tooltip.js +76 -0
- package/dist/components/trigger.d.ts +8 -0
- package/dist/components/trigger.js +13 -0
- package/dist/components/twoslash.d.ts +9 -0
- package/dist/components/twoslash.js +52 -0
- package/dist/components/typetable.d.ts +21 -0
- package/dist/components/typetable.js +68 -0
- package/dist/components/typewriter.d.ts +20 -0
- package/dist/components/typewriter.js +50 -0
- package/dist/components/version.d.ts +29 -0
- package/dist/components/version.js +181 -0
- package/dist/components/video.d.ts +33 -0
- package/dist/components/video.js +147 -0
- package/dist/components/zoom.d.ts +9 -0
- package/dist/components/zoom.js +110 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.js +102 -0
- package/dist/content.d.ts +83 -0
- package/dist/content.js +464 -0
- package/dist/contentcache.d.ts +28 -0
- package/dist/contentcache.js +76 -0
- package/dist/contentdiff.d.ts +19 -0
- package/dist/contentdiff.js +48 -0
- package/dist/contributors.d.ts +22 -0
- package/dist/contributors.js +64 -0
- package/dist/diff.d.ts +25 -0
- package/dist/diff.js +117 -0
- package/dist/draft.d.ts +33 -0
- package/dist/draft.js +62 -0
- package/dist/env.d.ts +12 -0
- package/dist/env.js +50 -0
- package/dist/export.d.ts +9 -0
- package/dist/export.js +32 -0
- package/dist/frontmatter.d.ts +19 -0
- package/dist/frontmatter.js +65 -0
- package/dist/github.d.ts +15 -0
- package/dist/github.js +254 -0
- package/dist/gitsource.d.ts +23 -0
- package/dist/gitsource.js +50 -0
- package/dist/hash.d.ts +21 -0
- package/dist/hash.js +65 -0
- package/dist/highlight.d.ts +18 -0
- package/dist/highlight.js +90 -0
- package/dist/hooks/anchor.d.ts +7 -0
- package/dist/hooks/anchor.js +44 -0
- package/dist/hooks/arrownav.d.ts +11 -0
- package/dist/hooks/arrownav.js +49 -0
- package/dist/hooks/async.d.ts +9 -0
- package/dist/hooks/async.js +28 -0
- package/dist/hooks/battery.d.ts +8 -0
- package/dist/hooks/battery.js +34 -0
- package/dist/hooks/breakpoint.d.ts +6 -0
- package/dist/hooks/breakpoint.js +34 -0
- package/dist/hooks/clickoutside.d.ts +11 -0
- package/dist/hooks/clickoutside.js +19 -0
- package/dist/hooks/clipboard-paste.d.ts +8 -0
- package/dist/hooks/clipboard-paste.js +18 -0
- package/dist/hooks/clipboard.d.ts +9 -0
- package/dist/hooks/clipboard.js +24 -0
- package/dist/hooks/colorscheme.d.ts +4 -0
- package/dist/hooks/colorscheme.js +18 -0
- package/dist/hooks/copy.d.ts +12 -0
- package/dist/hooks/copy.js +28 -0
- package/dist/hooks/countdown.d.ts +10 -0
- package/dist/hooks/countdown.js +41 -0
- package/dist/hooks/counter.d.ts +10 -0
- package/dist/hooks/counter.js +12 -0
- package/dist/hooks/debounce.d.ts +9 -0
- package/dist/hooks/debounce.js +16 -0
- package/dist/hooks/documenttitle.d.ts +3 -0
- package/dist/hooks/documenttitle.js +20 -0
- package/dist/hooks/documentvisibility.d.ts +4 -0
- package/dist/hooks/documentvisibility.js +19 -0
- package/dist/hooks/escapekey.d.ts +8 -0
- package/dist/hooks/escapekey.js +18 -0
- package/dist/hooks/eventlistener.d.ts +13 -0
- package/dist/hooks/eventlistener.js +15 -0
- package/dist/hooks/eventsource.d.ts +10 -0
- package/dist/hooks/eventsource.js +31 -0
- package/dist/hooks/eyedropper.d.ts +8 -0
- package/dist/hooks/eyedropper.js +23 -0
- package/dist/hooks/favicon.d.ts +3 -0
- package/dist/hooks/favicon.js +14 -0
- package/dist/hooks/fetch.d.ts +8 -0
- package/dist/hooks/fetch.js +29 -0
- package/dist/hooks/focustrap.d.ts +12 -0
- package/dist/hooks/focustrap.js +62 -0
- package/dist/hooks/focuswithin.d.ts +6 -0
- package/dist/hooks/focuswithin.js +24 -0
- package/dist/hooks/form.d.ts +20 -0
- package/dist/hooks/form.js +42 -0
- package/dist/hooks/fullscreen.d.ts +10 -0
- package/dist/hooks/fullscreen.js +34 -0
- package/dist/hooks/geolocation.d.ts +10 -0
- package/dist/hooks/geolocation.js +38 -0
- package/dist/hooks/hash.d.ts +3 -0
- package/dist/hooks/hash.js +21 -0
- package/dist/hooks/hotkeys.d.ts +11 -0
- package/dist/hooks/hotkeys.js +35 -0
- package/dist/hooks/hover.d.ts +3 -0
- package/dist/hooks/hover.js +22 -0
- package/dist/hooks/idle.d.ts +3 -0
- package/dist/hooks/idle.js +28 -0
- package/dist/hooks/infinitescroll.d.ts +9 -0
- package/dist/hooks/infinitescroll.js +31 -0
- package/dist/hooks/interval.d.ts +3 -0
- package/dist/hooks/interval.js +16 -0
- package/dist/hooks/inview.d.ts +10 -0
- package/dist/hooks/inview.js +28 -0
- package/dist/hooks/keyboard.d.ts +14 -0
- package/dist/hooks/keyboard.js +82 -0
- package/dist/hooks/keypress.d.ts +3 -0
- package/dist/hooks/keypress.js +23 -0
- package/dist/hooks/list.d.ts +14 -0
- package/dist/hooks/list.js +28 -0
- package/dist/hooks/longpress.d.ts +10 -0
- package/dist/hooks/longpress.js +24 -0
- package/dist/hooks/map.d.ts +12 -0
- package/dist/hooks/map.js +23 -0
- package/dist/hooks/measure.d.ts +16 -0
- package/dist/hooks/measure.js +34 -0
- package/dist/hooks/media.d.ts +33 -0
- package/dist/hooks/media.js +35 -0
- package/dist/hooks/mediarecorder.d.ts +11 -0
- package/dist/hooks/mediarecorder.js +37 -0
- package/dist/hooks/mounted.d.ts +3 -0
- package/dist/hooks/mounted.js +12 -0
- package/dist/hooks/mouseposition.d.ts +7 -0
- package/dist/hooks/mouseposition.js +16 -0
- package/dist/hooks/networkstate.d.ts +10 -0
- package/dist/hooks/networkstate.js +34 -0
- package/dist/hooks/online.d.ts +3 -0
- package/dist/hooks/online.js +20 -0
- package/dist/hooks/orientation.d.ts +8 -0
- package/dist/hooks/orientation.js +20 -0
- package/dist/hooks/os.d.ts +4 -0
- package/dist/hooks/os.js +15 -0
- package/dist/hooks/pageleave.d.ts +3 -0
- package/dist/hooks/pageleave.js +18 -0
- package/dist/hooks/pagination.d.ts +26 -0
- package/dist/hooks/pagination.js +49 -0
- package/dist/hooks/permission.d.ts +5 -0
- package/dist/hooks/permission.js +29 -0
- package/dist/hooks/preferredlanguage.d.ts +3 -0
- package/dist/hooks/preferredlanguage.js +17 -0
- package/dist/hooks/previous.d.ts +3 -0
- package/dist/hooks/previous.js +12 -0
- package/dist/hooks/queue.d.ts +11 -0
- package/dist/hooks/queue.js +23 -0
- package/dist/hooks/readprogress.d.ts +6 -0
- package/dist/hooks/readprogress.js +32 -0
- package/dist/hooks/resizeobserver.d.ts +10 -0
- package/dist/hooks/resizeobserver.js +25 -0
- package/dist/hooks/script.d.ts +4 -0
- package/dist/hooks/script.js +30 -0
- package/dist/hooks/scrolldirection.d.ts +4 -0
- package/dist/hooks/scrolldirection.js +33 -0
- package/dist/hooks/scrolllock.d.ts +3 -0
- package/dist/hooks/scrolllock.js +38 -0
- package/dist/hooks/scrollspy.d.ts +7 -0
- package/dist/hooks/scrollspy.js +28 -0
- package/dist/hooks/scrolltop.d.ts +7 -0
- package/dist/hooks/scrolltop.js +19 -0
- package/dist/hooks/selection.d.ts +12 -0
- package/dist/hooks/selection.js +32 -0
- package/dist/hooks/share.d.ts +13 -0
- package/dist/hooks/share.js +37 -0
- package/dist/hooks/speechrecognition.d.ts +10 -0
- package/dist/hooks/speechrecognition.js +34 -0
- package/dist/hooks/stepper.d.ts +13 -0
- package/dist/hooks/stepper.js +31 -0
- package/dist/hooks/storage.d.ts +5 -0
- package/dist/hooks/storage.js +57 -0
- package/dist/hooks/stylesheet.d.ts +4 -0
- package/dist/hooks/stylesheet.js +30 -0
- package/dist/hooks/textselection.d.ts +7 -0
- package/dist/hooks/textselection.js +24 -0
- package/dist/hooks/throttle.d.ts +3 -0
- package/dist/hooks/throttle.js +28 -0
- package/dist/hooks/toggle.d.ts +13 -0
- package/dist/hooks/toggle.js +10 -0
- package/dist/hooks/undoredo.d.ts +12 -0
- package/dist/hooks/undoredo.js +50 -0
- package/dist/hooks/vibrate.d.ts +7 -0
- package/dist/hooks/vibrate.js +15 -0
- package/dist/hooks/viewtransition.d.ts +9 -0
- package/dist/hooks/viewtransition.js +38 -0
- package/dist/hooks/wakelock.d.ts +9 -0
- package/dist/hooks/wakelock.js +32 -0
- package/dist/hooks/websocket.d.ts +10 -0
- package/dist/hooks/websocket.js +30 -0
- package/dist/hooks/windowsize.d.ts +7 -0
- package/dist/hooks/windowsize.js +17 -0
- package/dist/i18n.d.ts +30 -0
- package/dist/i18n.js +73 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +107 -0
- package/dist/lastmodified.d.ts +4 -0
- package/dist/lastmodified.js +24 -0
- package/dist/linkcheck.d.ts +26 -0
- package/dist/linkcheck.js +113 -0
- package/dist/llms.d.ts +14 -0
- package/dist/llms.js +39 -0
- package/dist/manifest.d.ts +24 -0
- package/dist/manifest.js +31 -0
- package/dist/mcp.d.ts +56 -0
- package/dist/mcp.js +74 -0
- package/dist/mdtoc.d.ts +16 -0
- package/dist/mdtoc.js +59 -0
- package/dist/mdxscope.d.ts +17 -0
- package/dist/mdxscope.js +58 -0
- package/dist/meta.d.ts +19 -0
- package/dist/meta.js +71 -0
- package/dist/migrate.d.ts +17 -0
- package/dist/migrate.js +108 -0
- package/dist/navgen.d.ts +31 -0
- package/dist/navgen.js +147 -0
- package/dist/navtree.d.ts +28 -0
- package/dist/navtree.js +93 -0
- package/dist/next.d.ts +3 -0
- package/dist/next.js +3 -0
- package/dist/oembed.d.ts +20 -0
- package/dist/oembed.js +62 -0
- package/dist/ogimage.d.ts +45 -0
- package/dist/ogimage.js +62 -0
- package/dist/openapi.d.ts +6 -0
- package/dist/openapi.js +141 -0
- package/dist/openapiguard.d.ts +22 -0
- package/dist/openapiguard.js +87 -0
- package/dist/openapiutil.d.ts +72 -0
- package/dist/openapiutil.js +61 -0
- package/dist/orama.d.ts +16 -0
- package/dist/orama.js +100 -0
- package/dist/pipeline.d.ts +19 -0
- package/dist/pipeline.js +40 -0
- package/dist/preload.d.ts +15 -0
- package/dist/preload.js +19 -0
- package/dist/ranking.d.ts +28 -0
- package/dist/ranking.js +95 -0
- package/dist/reactrouter.d.ts +3 -0
- package/dist/reactrouter.js +3 -0
- package/dist/readtime.d.ts +3 -0
- package/dist/readtime.js +8 -0
- package/dist/redirects.d.ts +27 -0
- package/dist/redirects.js +74 -0
- package/dist/rehype.d.ts +5 -0
- package/dist/rehype.js +30 -0
- package/dist/rehypeautolink.d.ts +11 -0
- package/dist/rehypeautolink.js +43 -0
- package/dist/rehypecode.d.ts +6 -0
- package/dist/rehypecode.js +68 -0
- package/dist/rehypecopy.d.ts +6 -0
- package/dist/rehypecopy.js +29 -0
- package/dist/rehypeinline.d.ts +6 -0
- package/dist/rehypeinline.js +32 -0
- package/dist/rehypelinks.d.ts +10 -0
- package/dist/rehypelinks.js +49 -0
- package/dist/rehyperaw.d.ts +6 -0
- package/dist/rehyperaw.js +27 -0
- package/dist/rehypeslug.d.ts +7 -0
- package/dist/rehypeslug.js +39 -0
- package/dist/rehypetablewrap.d.ts +9 -0
- package/dist/rehypetablewrap.js +24 -0
- package/dist/rehypetoc.d.ts +16 -0
- package/dist/rehypetoc.js +61 -0
- package/dist/remark.d.ts +6 -0
- package/dist/remark.js +48 -0
- package/dist/remarkadmonition.d.ts +6 -0
- package/dist/remarkadmonition.js +78 -0
- package/dist/remarkannotation.d.ts +10 -0
- package/dist/remarkannotation.js +65 -0
- package/dist/remarkbadge.d.ts +6 -0
- package/dist/remarkbadge.js +40 -0
- package/dist/remarkblockmath.d.ts +6 -0
- package/dist/remarkblockmath.js +57 -0
- package/dist/remarkcallout.d.ts +6 -0
- package/dist/remarkcallout.js +65 -0
- package/dist/remarkcaption.d.ts +6 -0
- package/dist/remarkcaption.js +48 -0
- package/dist/remarkcodetitle.d.ts +6 -0
- package/dist/remarkcodetitle.js +39 -0
- package/dist/remarkcolumns.d.ts +6 -0
- package/dist/remarkcolumns.js +67 -0
- package/dist/remarkdetails.d.ts +6 -0
- package/dist/remarkdetails.js +61 -0
- package/dist/remarkdirective.d.ts +7 -0
- package/dist/remarkdirective.js +98 -0
- package/dist/remarkembed.d.ts +6 -0
- package/dist/remarkembed.js +72 -0
- package/dist/remarkfiletree.d.ts +6 -0
- package/dist/remarkfiletree.js +67 -0
- package/dist/remarkfootnote.d.ts +6 -0
- package/dist/remarkfootnote.js +63 -0
- package/dist/remarkgfm.d.ts +6 -0
- package/dist/remarkgfm.js +60 -0
- package/dist/remarkheadingid.d.ts +6 -0
- package/dist/remarkheadingid.js +40 -0
- package/dist/remarkimage.d.ts +11 -0
- package/dist/remarkimage.js +91 -0
- package/dist/remarkinclude.d.ts +10 -0
- package/dist/remarkinclude.js +49 -0
- package/dist/remarkinstall.d.ts +6 -0
- package/dist/remarkinstall.js +52 -0
- package/dist/remarklinkcard.d.ts +6 -0
- package/dist/remarklinkcard.js +38 -0
- package/dist/remarkmath.d.ts +6 -0
- package/dist/remarkmath.js +69 -0
- package/dist/remarkmermaid.d.ts +6 -0
- package/dist/remarkmermaid.js +21 -0
- package/dist/remarkmeta.d.ts +15 -0
- package/dist/remarkmeta.js +63 -0
- package/dist/remarkreadingtime.d.ts +11 -0
- package/dist/remarkreadingtime.js +44 -0
- package/dist/remarksteps.d.ts +6 -0
- package/dist/remarksteps.js +56 -0
- package/dist/remarkstructure.d.ts +18 -0
- package/dist/remarkstructure.js +53 -0
- package/dist/remarktabs.d.ts +6 -0
- package/dist/remarktabs.js +42 -0
- package/dist/remarktoc.d.ts +6 -0
- package/dist/remarktoc.js +47 -0
- package/dist/remarkts2js.d.ts +6 -0
- package/dist/remarkts2js.js +88 -0
- package/dist/remarktwoslash.d.ts +20 -0
- package/dist/remarktwoslash.js +86 -0
- package/dist/remarkvideo.d.ts +16 -0
- package/dist/remarkvideo.js +59 -0
- package/dist/remix.d.ts +3 -0
- package/dist/remix.js +3 -0
- package/dist/schema.d.ts +54 -0
- package/dist/schema.js +17 -0
- package/dist/search.d.ts +24 -0
- package/dist/search.js +155 -0
- package/dist/searchindex.d.ts +28 -0
- package/dist/searchindex.js +184 -0
- package/dist/searchpolicy.d.ts +5 -0
- package/dist/searchpolicy.js +9 -0
- package/dist/searchscore.d.ts +30 -0
- package/dist/searchscore.js +54 -0
- package/dist/searchtypo.d.ts +3 -0
- package/dist/searchtypo.js +47 -0
- package/dist/seo.d.ts +26 -0
- package/dist/seo.js +69 -0
- package/dist/shortcodes.d.ts +13 -0
- package/dist/shortcodes.js +61 -0
- package/dist/sitemap.d.ts +25 -0
- package/dist/sitemap.js +69 -0
- package/dist/snippets.d.ts +18 -0
- package/dist/snippets.js +89 -0
- package/dist/source.d.ts +23 -0
- package/dist/source.js +188 -0
- package/dist/stats.d.ts +25 -0
- package/dist/stats.js +81 -0
- package/dist/tanstack.d.ts +3 -0
- package/dist/tanstack.js +3 -0
- package/dist/testing.d.ts +35 -0
- package/dist/testing.js +134 -0
- package/dist/themeutil.d.ts +31 -0
- package/dist/themeutil.js +92 -0
- package/dist/typegen.d.ts +10 -0
- package/dist/typegen.js +74 -0
- package/dist/types.d.ts +267 -0
- package/dist/types.js +1 -0
- package/dist/validate.d.ts +13 -0
- package/dist/validate.js +78 -0
- package/dist/validator.d.ts +35 -0
- package/dist/validator.js +53 -0
- package/dist/versioning.d.ts +32 -0
- package/dist/versioning.js +62 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +3 -0
- package/dist/watcher.d.ts +19 -0
- package/dist/watcher.js +82 -0
- package/dist/webhook.d.ts +25 -0
- package/dist/webhook.js +67 -0
- package/dist/workspace.d.ts +26 -0
- package/dist/workspace.js +81 -0
- package/package.json +138 -11
- package/styles/reset.css +3 -0
- package/index.js +0 -3
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo, useState, useId, useRef, useCallback } from 'react';
|
|
4
|
+
import { CopyButton } from './copybutton';
|
|
5
|
+
|
|
6
|
+
const managers = ["npm", "pnpm", "yarn", "bun"];
|
|
7
|
+
const commands = {
|
|
8
|
+
npm: "npm i",
|
|
9
|
+
pnpm: "pnpm add",
|
|
10
|
+
yarn: "yarn add",
|
|
11
|
+
bun: "bun add"
|
|
12
|
+
};
|
|
13
|
+
function InstallBase({ package: pkg }) {
|
|
14
|
+
const [active, setActive] = useState("npm");
|
|
15
|
+
const command = `${commands[active]} ${pkg}`;
|
|
16
|
+
const id = useId();
|
|
17
|
+
const tablistRef = useRef(null);
|
|
18
|
+
const mapRef = useRef(/* @__PURE__ */ new Map());
|
|
19
|
+
for (const manager of managers) {
|
|
20
|
+
if (!mapRef.current.has(manager)) {
|
|
21
|
+
mapRef.current.set(manager, mapRef.current.size);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const getTabId = useCallback((value) => `${id}-tab-${mapRef.current.get(value) ?? 0}`, [id]);
|
|
25
|
+
const handleKeyDown = useCallback(
|
|
26
|
+
(e) => {
|
|
27
|
+
const currentIndex = managers.indexOf(active);
|
|
28
|
+
let nextIndex = currentIndex;
|
|
29
|
+
switch (e.key) {
|
|
30
|
+
case "ArrowLeft":
|
|
31
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : managers.length - 1;
|
|
32
|
+
break;
|
|
33
|
+
case "ArrowRight":
|
|
34
|
+
nextIndex = currentIndex < managers.length - 1 ? currentIndex + 1 : 0;
|
|
35
|
+
break;
|
|
36
|
+
case "Home":
|
|
37
|
+
nextIndex = 0;
|
|
38
|
+
break;
|
|
39
|
+
case "End":
|
|
40
|
+
nextIndex = managers.length - 1;
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
const next = managers[nextIndex];
|
|
47
|
+
if (next) setActive(next);
|
|
48
|
+
const tabs = tablistRef.current?.querySelectorAll('[role="tab"]');
|
|
49
|
+
tabs?.[nextIndex]?.focus();
|
|
50
|
+
},
|
|
51
|
+
[active]
|
|
52
|
+
);
|
|
53
|
+
const handleTabClick = useCallback((manager) => {
|
|
54
|
+
setActive(manager);
|
|
55
|
+
}, []);
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"figure",
|
|
58
|
+
{
|
|
59
|
+
role: "group",
|
|
60
|
+
"aria-label": `Install ${pkg} package`,
|
|
61
|
+
style: {
|
|
62
|
+
position: "relative",
|
|
63
|
+
margin: "24px 0",
|
|
64
|
+
borderRadius: "8px",
|
|
65
|
+
backgroundColor: "#0d0d0d",
|
|
66
|
+
border: "1px solid #1c1c1c",
|
|
67
|
+
overflow: "hidden"
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsxs(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
style: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
justifyContent: "space-between",
|
|
77
|
+
padding: "0 12px",
|
|
78
|
+
height: "40px",
|
|
79
|
+
borderBottom: "1px solid #1c1c1c"
|
|
80
|
+
},
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref: tablistRef,
|
|
86
|
+
role: "tablist",
|
|
87
|
+
"aria-label": "Package managers",
|
|
88
|
+
onKeyDown: handleKeyDown,
|
|
89
|
+
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
90
|
+
children: managers.map((m, index) => /* @__PURE__ */ jsx(
|
|
91
|
+
"button",
|
|
92
|
+
{
|
|
93
|
+
id: getTabId(m),
|
|
94
|
+
type: "button",
|
|
95
|
+
role: "tab",
|
|
96
|
+
"aria-selected": active === m,
|
|
97
|
+
"aria-controls": `${id}-panel`,
|
|
98
|
+
tabIndex: active === m ? 0 : -1,
|
|
99
|
+
onClick: () => handleTabClick(m),
|
|
100
|
+
style: {
|
|
101
|
+
padding: "4px 10px",
|
|
102
|
+
fontSize: "13px",
|
|
103
|
+
color: active === m ? "#fafafa" : "#737373",
|
|
104
|
+
background: "transparent",
|
|
105
|
+
border: "none",
|
|
106
|
+
cursor: "pointer",
|
|
107
|
+
borderBottom: active === m ? "2px solid #fafafa" : "2px solid transparent",
|
|
108
|
+
marginBottom: "-1px",
|
|
109
|
+
transition: "color 0.15s"
|
|
110
|
+
},
|
|
111
|
+
children: m
|
|
112
|
+
},
|
|
113
|
+
m
|
|
114
|
+
))
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ jsx(CopyButton, { text: command })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
id: `${id}-panel`,
|
|
125
|
+
role: "tabpanel",
|
|
126
|
+
"aria-labelledby": getTabId(active),
|
|
127
|
+
tabIndex: 0,
|
|
128
|
+
style: {
|
|
129
|
+
padding: "14px 16px",
|
|
130
|
+
fontSize: "13px",
|
|
131
|
+
lineHeight: "1.6",
|
|
132
|
+
fontFamily: "var(--font-mono), ui-monospace, monospace"
|
|
133
|
+
},
|
|
134
|
+
children: /* @__PURE__ */ jsxs("code", { "aria-label": `Command: ${command}`, children: [
|
|
135
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#7ee787" }, children: commands[active] }),
|
|
136
|
+
/* @__PURE__ */ jsxs("span", { style: { color: "#fafafa" }, children: [
|
|
137
|
+
" ",
|
|
138
|
+
pkg
|
|
139
|
+
] })
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
const Install = memo(InstallBase);
|
|
148
|
+
|
|
149
|
+
export { Install };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* props for a single keyboard key display
|
|
6
|
+
*/
|
|
7
|
+
interface KbdProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function KbdBase({ children, className }: KbdProps): JSX.Element;
|
|
12
|
+
declare const Kbd: react.MemoExoticComponent<typeof KbdBase>;
|
|
13
|
+
/**
|
|
14
|
+
* props for a keyboard shortcut with multiple keys
|
|
15
|
+
*/
|
|
16
|
+
interface ShortcutProps {
|
|
17
|
+
keys: string[];
|
|
18
|
+
}
|
|
19
|
+
declare function ShortcutBase({ keys }: ShortcutProps): JSX.Element;
|
|
20
|
+
declare const Shortcut: react.MemoExoticComponent<typeof ShortcutBase>;
|
|
21
|
+
|
|
22
|
+
export { Kbd, type KbdProps, Shortcut, type ShortcutProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
|
|
4
|
+
function KbdBase({ children, className = "" }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"kbd",
|
|
7
|
+
{
|
|
8
|
+
className: `inline-flex items-center justify-center min-w-[1.5rem] h-6 px-1.5 text-xs font-mono bg-surface border border-line rounded shadow-sm text-muted ${className}`,
|
|
9
|
+
children
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
const Kbd = memo(KbdBase);
|
|
14
|
+
function ShortcutBase({ keys }) {
|
|
15
|
+
const label = keys.join(" + ");
|
|
16
|
+
return /* @__PURE__ */ jsx("kbd", { className: "inline-flex items-center gap-0.5", "aria-label": label, role: "group", children: keys.map((key, i) => /* @__PURE__ */ jsxs("span", { className: "contents", children: [
|
|
17
|
+
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-muted/50 mx-0.5", "aria-hidden": "true", children: "+" }),
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"kbd",
|
|
20
|
+
{
|
|
21
|
+
className: "inline-flex items-center justify-center min-w-[1.5rem] h-6 px-1.5 text-xs font-mono bg-surface border border-line rounded shadow-sm text-muted",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: key
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] }, `${i}-${key}`)) });
|
|
27
|
+
}
|
|
28
|
+
const Shortcut = memo(ShortcutBase);
|
|
29
|
+
|
|
30
|
+
export { Kbd, Shortcut };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
const icons = {
|
|
4
|
+
typescript: "M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z",
|
|
5
|
+
javascript: "M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z",
|
|
6
|
+
python: "M12 0C5.5 0 5.9 2.6 5.9 2.6l.1 2.7h6.2v.8H3.9S0 5.7 0 12c0 6.3 3.4 6.1 3.4 6.1h2V15s-.1-3.4 3.4-3.4h5.8s3.2.1 3.2-3.1V3.1S18.3 0 12 0zM8.8 1.8c.6 0 1 .5 1 1s-.5 1-1 1-1-.5-1-1 .5-1 1-1z",
|
|
7
|
+
rust: "M23.8 12l-1.2-.7.3-.4c.1-.2.1-.5-.1-.7l-.6-.6.2-.5c.1-.3 0-.5-.2-.7l-.7-.5.1-.5c0-.3-.1-.5-.3-.6l-.8-.4v-.5c0-.3-.2-.5-.4-.6l-.9-.2-.1-.5c-.1-.3-.3-.5-.6-.5l-.9-.1-.2-.5c-.1-.2-.4-.4-.6-.4h-1l-.3-.4c-.2-.2-.5-.3-.7-.2l-1 .1-.4-.3c-.2-.2-.5-.2-.7-.1l-1 .3-.4-.2c-.3-.1-.5 0-.7.1l-.9.5-.5-.1c-.3-.1-.5 0-.7.2l-.8.6-.5-.1c-.3 0-.5.1-.7.3l-.6.7-.5.1c-.3.1-.5.3-.5.5l-.4.9-.4.2c-.3.1-.4.3-.4.6l-.2 1-.4.3c-.2.2-.3.4-.2.7l.1 1-.3.4c-.2.2-.2.5-.1.7l.3 1-.2.5c-.1.2 0 .5.1.7l.5.9-.1.5c0 .3.1.5.3.7l.6.8v.5c.1.3.3.5.5.5l.8.5.1.5c.1.3.3.5.6.5l.9.3.2.5c.2.2.4.4.7.3l1 .1.3.4c.2.2.5.3.7.2l1-.2.4.3c.2.2.5.2.7.1l1-.4.5.2c.3.1.5 0 .7-.2l.8-.6.5.1c.3 0 .5-.2.7-.4l.6-.8.5-.1c.3-.1.5-.3.5-.6l.3-.9.4-.2c.3-.1.4-.4.4-.7l.1-1 .4-.3c.2-.2.3-.5.1-.7l-.2-1 .3-.4c.1-.3.1-.5-.1-.7l-.4-.9.2-.5zM12 18c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6z",
|
|
8
|
+
go: "M1.8 8.4c-.1 0-.1 0-.2-.1 0 0 0-.1.1-.2l.6-.5h2.1l.6.5c.1 0 .1.1 0 .2l-.1.1H1.8zm-.8 1.3c-.1 0-.2 0-.2-.1 0 0 0-.1.1-.2l.6-.5h3.4l.5.5c.1.1.1.1 0 .2 0 0-.1.1-.2.1H1zm2.5 1.3c-.1 0-.1 0-.2-.1 0-.1 0-.1.1-.2l.4-.5h2l.6.5c.1.1.1.1.1.2l-.2.1H3.5zm15.1-.9c-.6 1.4-2 2.4-3.6 2.4-1.3 0-2.5-.6-3.2-1.6-.7.9-1.8 1.5-3.1 1.5-2.2 0-4-1.8-4-4s1.8-4 4-4c1.3 0 2.4.6 3.1 1.5.8-1 2-1.6 3.3-1.6 2.2 0 4 1.8 4 4 0 .6-.2 1.2-.4 1.8h-.1z",
|
|
9
|
+
json: "M5 3h2v2H5v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5h2v2H5c-1.1 0-2-.9-2-2v-4a2 2 0 0 0-2-2H0v-2h1a2 2 0 0 0 2-2V5a2 2 0 0 1 2-2m14 0a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h1v2h-1a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2v-2h2v-5a2 2 0 0 1 2-2 2 2 0 0 1-2-2V5h-2V3h2z",
|
|
10
|
+
css: "M1.5 0h21l-1.91 21.563L11.977 24l-8.565-2.438L1.5 0zm17.09 4.413L5.41 4.41l.213 2.622 10.125.002-.255 2.716h-6.64l.24 2.573h6.182l-.366 3.523-2.91.804-2.956-.81-.188-2.11h-2.61l.29 3.855L12 19.288l5.373-1.53L18.59 4.414z",
|
|
11
|
+
html: "M1.5 0h21l-1.9 21.6L12 24l-8.6-2.4L1.5 0zM20 4H4l.7 7.3h11.4l-.4 4-3.7 1-3.7-1-.2-2.7H5l.5 5.4 6.5 1.8 6.5-1.8.8-9H7.6l-.3-3h13.4L20 4z",
|
|
12
|
+
yaml: "M2.6 6l3.8 5.6v6.4h2.7v-6.4L12.9 6h-3l-2 3.8L5.6 6H2.6zm9.9 12h9.5v-2.5h-6.8v-2.3h5.5V11h-5.5V8.5h6.8V6h-9.5v12z",
|
|
13
|
+
bash: "M4 20h4v-4H4v4zm6-16v4h4V4h-4zm0 12h4v-4h-4v4zm6-12v4h4V4h-4zm0 12h4v-4h-4v4zM4 4h4v4H4V4zm0 6h4v4H4v-4zm6 0h4v4h-4v-4zm6 0h4v4h-4v-4z",
|
|
14
|
+
sql: "M12 3C7 3 3 4.8 3 7v10c0 2.2 4 4 9 4s9-1.8 9-4V7c0-2.2-4-4-9-4zm0 2c4.4 0 7 1.3 7 2s-2.6 2-7 2-7-1.3-7-2 2.6-2 7-2zM5 9.3c1.5.8 3.9 1.4 7 1.4s5.5-.6 7-1.4V12c0 .7-2.6 2-7 2s-7-1.3-7-2V9.3zm0 5c1.5.8 3.9 1.4 7 1.4s5.5-.6 7-1.4V17c0 .7-2.6 2-7 2s-7-1.3-7-2v-2.7z",
|
|
15
|
+
markdown: "M2 4v16h20V4H2zm3 12v-5.5L7.5 13 10 10.5V16h2v-8h-2l-2.5 3L5 8H3v8h2zm11-1.5L13 11h2V8h3v3h2l-3 3.5z",
|
|
16
|
+
kotlin: "M0 24L12 12L24 24H0zM0 0h24L12 12L0 24V0zm12 12L24 0H12L0 12h12z",
|
|
17
|
+
swift: "M24 18.5c0 .7-.2 1.5-.6 2.2-.5 1-1.4 2-2.6 2.8-.8.5-1.6.7-2.4.7-1.3 0-2.3-.5-3.2-1-.8-.5-1.6-.8-2.6-.8-.8 0-1.6.2-2.3.6-.7.3-1.4.7-2.2 1.2-.8.5-1.6.8-2.7.8-.9 0-1.7-.2-2.5-.7-1.1-.7-2-1.7-2.5-2.7-.4-.8-.6-1.5-.6-2.3 0-1.5.6-2.9 1.8-4.2 1.4-1.6 3.3-2.4 5.6-2.4.4 0 .8 0 1.2.1-.8-.8-1.4-1.7-1.8-2.6-.5-1-.7-2-.7-3 0-.3 0-.6.1-.9C6 8 5.3 9.7 5.3 11.5c0 .5 0 1 .1 1.5-.6-.3-1.1-.6-1.6-1.1C2.6 10.8 2 9.4 2 7.8c0-.3 0-.5.1-.7 1.7 2.3 4.2 4.2 7.2 5.6.2.1.5.2.7.3-.1-.4-.3-.9-.6-1.3-1.5-2.5-3.5-4.7-5.8-6.6l-.2-.2c-.1-.1-.1-.1 0-.2.1-.1.1-.1.2 0l.2.2c2.4 1.8 4.5 4 6.1 6.4.4.6.7 1.2.9 1.8 1.5.5 3 .8 4.5.8.9 0 1.8-.1 2.7-.3-.9.9-2 1.7-3.4 2.3-.2.1-.4.1-.6.2 1 .2 1.8.6 2.5 1.1.9.6 1.4 1.4 1.7 2.3.2-.5.3-1 .3-1.6 0-1-.3-1.9-.9-2.6-.6-.8-1.5-1.4-2.6-1.7l-.3-.1c.5-.2 1-.3 1.6-.5 1.7-.6 3.2-1.4 4.5-2.5.1 1.4.6 2.6 1.4 3.6.8 1 1.9 1.7 3.1 2 0 .1 0 .3 0 .4z"
|
|
18
|
+
};
|
|
19
|
+
const aliases = {
|
|
20
|
+
ts: "typescript",
|
|
21
|
+
js: "javascript",
|
|
22
|
+
jsx: "javascript",
|
|
23
|
+
tsx: "typescript",
|
|
24
|
+
py: "python",
|
|
25
|
+
rb: "ruby",
|
|
26
|
+
sh: "bash",
|
|
27
|
+
shell: "bash",
|
|
28
|
+
zsh: "bash",
|
|
29
|
+
yml: "yaml",
|
|
30
|
+
md: "markdown"
|
|
31
|
+
};
|
|
32
|
+
function LangIcon({ lang, size = 14 }) {
|
|
33
|
+
const normalized = aliases[lang.toLowerCase()] || lang.toLowerCase();
|
|
34
|
+
const path = icons[normalized];
|
|
35
|
+
if (!path) return null;
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
"svg",
|
|
38
|
+
{
|
|
39
|
+
viewBox: "0 0 24 24",
|
|
40
|
+
fill: "currentColor",
|
|
41
|
+
style: { width: size, height: size, flexShrink: 0 },
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
children: /* @__PURE__ */ jsx("path", { d: path })
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { LangIcon };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Locale {
|
|
5
|
+
code: string;
|
|
6
|
+
name: string;
|
|
7
|
+
flag?: string;
|
|
8
|
+
}
|
|
9
|
+
interface LanguageSwitchProps {
|
|
10
|
+
current: string;
|
|
11
|
+
locales: Locale[];
|
|
12
|
+
onChange?: (code: string) => void;
|
|
13
|
+
}
|
|
14
|
+
declare function LanguageSwitchBase({ current, locales, onChange }: LanguageSwitchProps): JSX.Element;
|
|
15
|
+
declare const LanguageSwitch: react.MemoExoticComponent<typeof LanguageSwitchBase>;
|
|
16
|
+
|
|
17
|
+
export { LanguageSwitch, type LanguageSwitchProps, type Locale };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo, useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { getNextIndex } from '../hooks/arrownav';
|
|
5
|
+
import { IconLanguages, IconCheck } from './icons';
|
|
6
|
+
|
|
7
|
+
function isnode(value) {
|
|
8
|
+
return value instanceof Node;
|
|
9
|
+
}
|
|
10
|
+
function LanguageSwitchBase({ current, locales, onChange }) {
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const [index, setIndex] = useState(0);
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const listboxId = "language-listbox";
|
|
15
|
+
const active = locales[index];
|
|
16
|
+
const currentLocale = locales.find((l) => l.code === current);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
function handleClick(e) {
|
|
19
|
+
if (ref.current && isnode(e.target) && !ref.current.contains(e.target)) {
|
|
20
|
+
setOpen(false);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
document.addEventListener("click", handleClick);
|
|
24
|
+
return () => document.removeEventListener("click", handleClick);
|
|
25
|
+
}, []);
|
|
26
|
+
const handleToggle = useCallback(() => {
|
|
27
|
+
setOpen((prev) => !prev);
|
|
28
|
+
}, []);
|
|
29
|
+
const handleKeyDown = useCallback(
|
|
30
|
+
(e) => {
|
|
31
|
+
if (!open) {
|
|
32
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
33
|
+
setOpen(true);
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
switch (e.key) {
|
|
39
|
+
case "Escape":
|
|
40
|
+
setOpen(false);
|
|
41
|
+
break;
|
|
42
|
+
case "ArrowDown":
|
|
43
|
+
case "ArrowUp":
|
|
44
|
+
case "Home":
|
|
45
|
+
case "End": {
|
|
46
|
+
const next = getNextIndex(e.key, {
|
|
47
|
+
count: locales.length,
|
|
48
|
+
current: index,
|
|
49
|
+
wrap: false
|
|
50
|
+
});
|
|
51
|
+
if (next !== index) setIndex(next);
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case "Enter":
|
|
56
|
+
onChange?.(locales[index]?.code ?? current);
|
|
57
|
+
setOpen(false);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
[open, locales, index, onChange]
|
|
62
|
+
);
|
|
63
|
+
const handleSelect = useCallback(
|
|
64
|
+
(code) => {
|
|
65
|
+
onChange?.(code);
|
|
66
|
+
setOpen(false);
|
|
67
|
+
},
|
|
68
|
+
[onChange]
|
|
69
|
+
);
|
|
70
|
+
const handleMouseEnter = useCallback((i) => {
|
|
71
|
+
setIndex(i);
|
|
72
|
+
}, []);
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: "relative", children: [
|
|
74
|
+
/* @__PURE__ */ jsxs(
|
|
75
|
+
"button",
|
|
76
|
+
{
|
|
77
|
+
type: "button",
|
|
78
|
+
onClick: handleToggle,
|
|
79
|
+
onKeyDown: handleKeyDown,
|
|
80
|
+
"aria-expanded": open,
|
|
81
|
+
"aria-haspopup": "listbox",
|
|
82
|
+
"aria-controls": open ? listboxId : void 0,
|
|
83
|
+
"aria-label": `Select language, current: ${currentLocale?.name ?? current}`,
|
|
84
|
+
className: "flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-muted hover:bg-surface hover:text-fg transition-colors",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(IconLanguages, { size: 16, "aria-hidden": "true" }),
|
|
87
|
+
/* @__PURE__ */ jsx("span", { children: currentLocale?.name ?? current })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
open && /* @__PURE__ */ jsx(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
id: listboxId,
|
|
95
|
+
role: "listbox",
|
|
96
|
+
"aria-label": "Available languages",
|
|
97
|
+
"aria-activedescendant": active ? `language-option-${active.code}` : void 0,
|
|
98
|
+
className: "absolute right-0 top-full mt-1 min-w-[140px] rounded-md border border-line bg-bg p-1 shadow-lg",
|
|
99
|
+
children: locales.map((locale, i) => /* @__PURE__ */ jsxs(
|
|
100
|
+
"button",
|
|
101
|
+
{
|
|
102
|
+
id: `language-option-${locale.code}`,
|
|
103
|
+
type: "button",
|
|
104
|
+
role: "option",
|
|
105
|
+
"aria-selected": locale.code === current,
|
|
106
|
+
onClick: () => handleSelect(locale.code),
|
|
107
|
+
onMouseEnter: () => handleMouseEnter(i),
|
|
108
|
+
className: `flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm transition-colors ${i === index ? "bg-surface text-fg" : "text-muted hover:bg-surface hover:text-fg"}`,
|
|
109
|
+
children: [
|
|
110
|
+
locale.flag && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: locale.flag }),
|
|
111
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 text-left", children: locale.name }),
|
|
112
|
+
locale.code === current && /* @__PURE__ */ jsx(IconCheck, { size: 16, "aria-hidden": "true" })
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
locale.code
|
|
116
|
+
))
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
const LanguageSwitch = memo(LanguageSwitchBase);
|
|
122
|
+
|
|
123
|
+
export { LanguageSwitch };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type LastUpdatedProps = {
|
|
4
|
+
date: string | Date;
|
|
5
|
+
format?: "relative" | "absolute" | "both";
|
|
6
|
+
className?: string;
|
|
7
|
+
prefix?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
declare const LastUpdated: react.NamedExoticComponent<LastUpdatedProps>;
|
|
11
|
+
|
|
12
|
+
export { LastUpdated, type LastUpdatedProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { memo, useMemo, useState, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
function relative(d) {
|
|
6
|
+
const s = Math.floor((Date.now() - d.getTime()) / 1e3);
|
|
7
|
+
if (s < 60) return "just now";
|
|
8
|
+
const m = Math.floor(s / 60);
|
|
9
|
+
if (m < 60) return `${m} minute${m === 1 ? "" : "s"} ago`;
|
|
10
|
+
const h = Math.floor(m / 60);
|
|
11
|
+
if (h < 24) return `${h} hour${h === 1 ? "" : "s"} ago`;
|
|
12
|
+
const days = Math.floor(h / 24);
|
|
13
|
+
if (days < 30) return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
14
|
+
const months = Math.floor(days / 30);
|
|
15
|
+
if (days < 365) return `${months} month${months === 1 ? "" : "s"} ago`;
|
|
16
|
+
const years = Math.floor(days / 365);
|
|
17
|
+
return `${years} year${years === 1 ? "" : "s"} ago`;
|
|
18
|
+
}
|
|
19
|
+
const LastUpdated = memo(function LastUpdated2({
|
|
20
|
+
date,
|
|
21
|
+
format = "relative",
|
|
22
|
+
className,
|
|
23
|
+
prefix = "Last updated"
|
|
24
|
+
}) {
|
|
25
|
+
const parsed = useMemo(() => typeof date === "string" ? new Date(date) : date, [date]);
|
|
26
|
+
const iso = parsed.toISOString();
|
|
27
|
+
const abs = useMemo(() => parsed.toLocaleDateString(), [parsed]);
|
|
28
|
+
const [rel, setRel] = useState("");
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (format === "absolute") return;
|
|
31
|
+
setRel(relative(parsed));
|
|
32
|
+
const timer = setInterval(() => setRel(relative(parsed)), 6e4);
|
|
33
|
+
return () => clearInterval(timer);
|
|
34
|
+
}, [format, parsed]);
|
|
35
|
+
const label = format === "absolute" ? abs : rel || abs;
|
|
36
|
+
const title = format === "both" ? abs : void 0;
|
|
37
|
+
return /* @__PURE__ */ jsxs("time", { dateTime: iso, className, title, suppressHydrationWarning: true, children: [
|
|
38
|
+
prefix,
|
|
39
|
+
" ",
|
|
40
|
+
label
|
|
41
|
+
] });
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { LastUpdated };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode, JSX } from 'react';
|
|
3
|
+
import { UrlObject } from 'url';
|
|
4
|
+
|
|
5
|
+
type Href = string | UrlObject;
|
|
6
|
+
interface LinkProps extends Omit<ComponentPropsWithoutRef<"a">, "href"> {
|
|
7
|
+
href: Href;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
external?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function LinkComponent({ href, children, external, className, "aria-label": ariaLabel, ...rest }: LinkProps): JSX.Element;
|
|
12
|
+
declare const Link: react.MemoExoticComponent<typeof LinkComponent>;
|
|
13
|
+
|
|
14
|
+
export { Link, type LinkProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import NextLink from 'next/link';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
|
|
6
|
+
function LinkComponent({
|
|
7
|
+
href,
|
|
8
|
+
children,
|
|
9
|
+
external,
|
|
10
|
+
className,
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
...rest
|
|
13
|
+
}) {
|
|
14
|
+
const hrefString = typeof href === "string" ? href : href.href ?? "";
|
|
15
|
+
const isExternal = external ?? hrefString.startsWith("http");
|
|
16
|
+
const baseClass = "rounded-sm text-fg underline decoration-line underline-offset-4 hover:decoration-fg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent transition-colors";
|
|
17
|
+
const classes = className ? `${baseClass} ${className}` : baseClass;
|
|
18
|
+
if (isExternal) {
|
|
19
|
+
const label = ariaLabel ?? `${typeof children === "string" ? children : ""} (opens in new tab)`;
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"a",
|
|
22
|
+
{
|
|
23
|
+
href: hrefString,
|
|
24
|
+
target: "_blank",
|
|
25
|
+
rel: "noopener noreferrer",
|
|
26
|
+
className: `inline-flex items-center gap-1 ${classes}`,
|
|
27
|
+
"aria-label": label.trim() || void 0,
|
|
28
|
+
...rest,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
/* @__PURE__ */ jsxs(
|
|
32
|
+
"svg",
|
|
33
|
+
{
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
viewBox: "0 0 16 16",
|
|
36
|
+
fill: "currentColor",
|
|
37
|
+
className: "size-3 text-muted",
|
|
38
|
+
role: "img",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx("path", { d: "M3.75 2h3.5a.75.75 0 010 1.5h-2.69l5.72 5.72a.75.75 0 11-1.06 1.06L3.5 4.56v2.69a.75.75 0 01-1.5 0v-3.5A.75.75 0 012.75 3h1z" }),
|
|
41
|
+
/* @__PURE__ */ jsx("path", { d: "M6.25 7.75a.75.75 0 000 1.5h5.69l-5.72 5.72a.75.75 0 101.06 1.06l5.72-5.72v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5z" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsx(NextLink, { href, className: classes, "aria-label": ariaLabel, ...rest, children });
|
|
50
|
+
}
|
|
51
|
+
const Link = memo(LinkComponent);
|
|
52
|
+
|
|
53
|
+
export { Link };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the LinkCard component
|
|
6
|
+
*/
|
|
7
|
+
interface LinkCardProps {
|
|
8
|
+
/** URL to navigate to */
|
|
9
|
+
href: string;
|
|
10
|
+
/** Card title text */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Optional description text */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Optional icon element */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A card component that renders a styled link with optional icon and description
|
|
19
|
+
*/
|
|
20
|
+
declare const LinkCard: react.NamedExoticComponent<LinkCardProps>;
|
|
21
|
+
/**
|
|
22
|
+
* Props for the LinkCards container component
|
|
23
|
+
*/
|
|
24
|
+
interface LinkCardsProps {
|
|
25
|
+
/** LinkCard children to render in grid */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A container component that renders LinkCard children in a responsive grid
|
|
30
|
+
*/
|
|
31
|
+
declare const LinkCards: react.NamedExoticComponent<LinkCardsProps>;
|
|
32
|
+
|
|
33
|
+
export { LinkCard, type LinkCardProps, LinkCards, type LinkCardsProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { IconExternalLink } from './icons';
|
|
5
|
+
|
|
6
|
+
const LinkCard = memo(function LinkCard2({
|
|
7
|
+
href,
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
icon
|
|
11
|
+
}) {
|
|
12
|
+
const isExternal = href.startsWith("http");
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"a",
|
|
15
|
+
{
|
|
16
|
+
href,
|
|
17
|
+
target: isExternal ? "_blank" : void 0,
|
|
18
|
+
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
19
|
+
"aria-label": isExternal ? `${title} (opens in new tab)` : title,
|
|
20
|
+
className: "my-4 flex items-center gap-4 p-4 rounded-xl border border-line bg-surface/30 hover:bg-surface/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-fg/20 transition-colors group",
|
|
21
|
+
children: [
|
|
22
|
+
icon && /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: "shrink-0 w-10 h-10 rounded-lg bg-bg border border-line flex items-center justify-center text-muted group-hover:text-fg transition-colors",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: icon
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-fg truncate", children: title }),
|
|
32
|
+
description && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted truncate", children: description })
|
|
33
|
+
] }),
|
|
34
|
+
isExternal && /* @__PURE__ */ jsx(
|
|
35
|
+
IconExternalLink,
|
|
36
|
+
{
|
|
37
|
+
size: 16,
|
|
38
|
+
className: "shrink-0 text-muted group-hover:text-fg transition-colors",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
const LinkCards = memo(function LinkCards2({ children }) {
|
|
47
|
+
return /* @__PURE__ */ jsx("nav", { className: "my-6 grid gap-3 md:grid-cols-2", "aria-label": "Related links", children });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { LinkCard, LinkCards };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, JSX } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for list container components
|
|
6
|
+
*/
|
|
7
|
+
interface ListProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Props for check list items
|
|
12
|
+
*/
|
|
13
|
+
interface CheckItemProps {
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props for bullet list items
|
|
19
|
+
*/
|
|
20
|
+
interface BulletItemProps {
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Props for numbered list containers
|
|
25
|
+
*/
|
|
26
|
+
interface NumberListProps {
|
|
27
|
+
start?: number;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Props for numbered list items
|
|
32
|
+
*/
|
|
33
|
+
interface NumberItemProps {
|
|
34
|
+
number: number;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function CheckListBase({ children }: ListProps): JSX.Element;
|
|
38
|
+
declare const CheckList: react.MemoExoticComponent<typeof CheckListBase>;
|
|
39
|
+
declare function CheckItemBase({ checked, children }: CheckItemProps): JSX.Element;
|
|
40
|
+
declare const CheckItem: react.MemoExoticComponent<typeof CheckItemBase>;
|
|
41
|
+
declare function BulletListBase({ children }: ListProps): JSX.Element;
|
|
42
|
+
declare const BulletList: react.MemoExoticComponent<typeof BulletListBase>;
|
|
43
|
+
declare function BulletItemBase({ children }: BulletItemProps): JSX.Element;
|
|
44
|
+
declare const BulletItem: react.MemoExoticComponent<typeof BulletItemBase>;
|
|
45
|
+
declare function NumberListBase({ start, children }: NumberListProps): JSX.Element;
|
|
46
|
+
declare const NumberList: react.MemoExoticComponent<typeof NumberListBase>;
|
|
47
|
+
declare function NumberItemBase({ number, children }: NumberItemProps): JSX.Element;
|
|
48
|
+
declare const NumberItem: react.MemoExoticComponent<typeof NumberItemBase>;
|
|
49
|
+
|
|
50
|
+
export { BulletItem, type BulletItemProps, BulletList, CheckItem, type CheckItemProps, CheckList, NumberItem, type NumberItemProps, NumberList, type NumberListProps };
|