@wordup-md/nuxt-layer-shadcn-unocss 0.2.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/.cursor/rules/active-context-rule.mdc +8 -0
- package/.cursor/rules/memory-bank-overview.mdc +17 -0
- package/.cursor/rules/product-context-rule.mdc +8 -0
- package/.cursor/rules/progress-rule.mdc +8 -0
- package/.cursor/rules/projectbrief-rule.mdc +8 -0
- package/.cursor/rules/system-patterns-rule.mdc +8 -0
- package/.cursor/rules/tech-context-rule.mdc +8 -0
- package/.cursorrules +52 -0
- package/.editorconfig +12 -0
- package/.nuxtrc +1 -0
- package/.playground/app.config.ts +189 -0
- package/.playground/assets/style.css +15 -0
- package/.playground/components/content/MdcExample.vue +81 -0
- package/.playground/components/content/MdcReplay.vue +319 -0
- package/.playground/content/1.getting-started/1.introduction.md +8 -0
- package/.playground/content/1.getting-started/2.writing/1.markdown.md +56 -0
- package/.playground/content/1.getting-started/2.writing/2.pages.md +177 -0
- package/.playground/content/1.getting-started/2.writing/3.folders.md +56 -0
- package/.playground/content/1.getting-started/2.writing/_dir.yml +3 -0
- package/.playground/content/1.getting-started/_dir.yml +3 -0
- package/.playground/content/2.content-elements/1.text-formatting.md +60 -0
- package/.playground/content/2.content-elements/10.horizontal-rule.md +25 -0
- package/.playground/content/2.content-elements/11.tables.md +25 -0
- package/.playground/content/2.content-elements/12.overview.md +93 -0
- package/.playground/content/2.content-elements/13.text-components.md +36 -0
- package/.playground/content/2.content-elements/2.headings.md +32 -0
- package/.playground/content/2.content-elements/3.paragraphs.md +39 -0
- package/.playground/content/2.content-elements/4.lists.md +37 -0
- package/.playground/content/2.content-elements/5.links.md +17 -0
- package/.playground/content/2.content-elements/6.images.md +17 -0
- package/.playground/content/2.content-elements/7.blockquotes.md +17 -0
- package/.playground/content/2.content-elements/8.code-blocks.md +141 -0
- package/.playground/content/2.content-elements/9.inline-code.md +21 -0
- package/.playground/content/2.content-elements/_dir.yml +3 -0
- package/.playground/content/2.content-elements/index.md +8 -0
- package/.playground/content/3.components/1.index.md +187 -0
- package/.playground/content/3.components/2.docs/_dir.yml +3 -0
- package/.playground/content/3.components/2.docs/alert.md +152 -0
- package/.playground/content/3.components/2.docs/badge.md +131 -0
- package/.playground/content/3.components/2.docs/button-link.md +53 -0
- package/.playground/content/3.components/2.docs/callout.md +16 -0
- package/.playground/content/3.components/2.docs/code-group.md +77 -0
- package/.playground/content/3.components/2.docs/code-snippet.md +129 -0
- package/.playground/content/3.components/2.docs/field-group.md +62 -0
- package/.playground/content/3.components/2.docs/field.md +39 -0
- package/.playground/content/3.components/2.docs/file-tree.md +144 -0
- package/.playground/content/3.components/2.docs/icon.md +94 -0
- package/.playground/content/3.components/2.docs/pm.md +67 -0
- package/.playground/content/3.components/2.docs/read-more.md +44 -0
- package/.playground/content/3.components/2.docs/shortcut.md +36 -0
- package/.playground/content/3.components/2.docs/stack.md +81 -0
- package/.playground/content/3.components/2.docs/steps.md +148 -0
- package/.playground/content/3.components/2.docs/tabs.md +375 -0
- package/.playground/content/3.components/3.page/_dir.yml +2 -0
- package/.playground/content/3.components/3.page/accordion.md +74 -0
- package/.playground/content/3.components/3.page/card-group.md +115 -0
- package/.playground/content/3.components/3.page/card.md +142 -0
- package/.playground/content/3.components/3.page/collapsible.md +61 -0
- package/.playground/content/3.components/3.page/hero-alt.md +118 -0
- package/.playground/content/3.components/3.page/hero.md +60 -0
- package/.playground/content/3.components/3.page/team-card.md +82 -0
- package/.playground/content/3.components/_dir.yml +2 -0
- package/.playground/content/4.development/1.configuration/1.overview.md +297 -0
- package/.playground/content/4.development/1.configuration/2.nuxt-content.md +105 -0
- package/.playground/content/4.development/1.configuration/3.og-image.md +86 -0
- package/.playground/content/4.development/1.configuration/4.edit-link.md +63 -0
- package/.playground/content/4.development/1.configuration/5.banner.md +52 -0
- package/.playground/content/4.development/1.configuration/6.carbon-ads.md +65 -0
- package/.playground/content/4.development/1.configuration/7.umami.md +41 -0
- package/.playground/content/4.development/1.configuration/_dir.yml +3 -0
- package/.playground/content/4.development/2.advanced/1.override.md +49 -0
- package/.playground/content/4.development/2.advanced/2.math.md +89 -0
- package/.playground/content/4.development/2.advanced/_dir.yml +3 -0
- package/.playground/content/4.development/3.themes.md +9 -0
- package/.playground/content/4.development/4.composables.md +38 -0
- package/.playground/content/4.development/5.installation.md +36 -0
- package/.playground/content/4.development/_dir.yml +3 -0
- package/.playground/content/_menu-footer.md +5 -0
- package/.playground/content/index.md +67 -0
- package/.playground/content/test-card.md +187 -0
- package/.playground/content/test.md +88 -0
- package/.playground/content/test2.md +12 -0
- package/.playground/content/test3.md +187 -0
- package/.playground/nuxt.config.ts +52 -0
- package/.playground/public/banner-preview.png +0 -0
- package/.playground/public/favicon.ico +0 -0
- package/.playground/public/front-matter-showcase/authors.png +0 -0
- package/.playground/public/front-matter-showcase/badges.png +0 -0
- package/.playground/public/front-matter-showcase/nav-badges.png +0 -0
- package/.playground/public/hero.png +0 -0
- package/.playground/public/logo-dark.svg +12 -0
- package/.playground/public/logo.svg +12 -0
- package/.playground/public/og-nuxt-seo.png +0 -0
- package/.playground/public/og-nuxt.png +0 -0
- package/.playground/public/og-shadcn-docs-dark.png +0 -0
- package/.playground/public/og-shadcn-docs.png +0 -0
- package/.playground/public/sidebar-default.png +0 -0
- package/.playground/public/sidebar-group.png +0 -0
- package/.playground/public/sidebar-tree.png +0 -0
- package/.playground/uno.config.ts +16 -0
- package/README.md +93 -0
- package/app.vue +59 -0
- package/assets/css/a11y.css +48 -0
- package/assets/css/mdc-editor.css +91 -0
- package/components/A11yModeToggle.vue +23 -0
- package/components/DarkModeToggle.vue +26 -0
- package/components/LinkIcon.vue +32 -0
- package/components/OgImage/ShadcnDocs.vue +55 -0
- package/components/ThemeCustomizer.vue +156 -0
- package/components/ThemePopover.vue +27 -0
- package/components/content/Accordion.vue +18 -0
- package/components/content/AccordionItem.vue +32 -0
- package/components/content/Alert.vue +100 -0
- package/components/content/Badge.vue +52 -0
- package/components/content/ButtonLink.vue +38 -0
- package/components/content/Callout.vue +17 -0
- package/components/content/Card.vue +173 -0
- package/components/content/CardGroup.vue +38 -0
- package/components/content/CodeCopy.vue +52 -0
- package/components/content/CodeGroup._vue +27 -0
- package/components/content/CodeSnippet._vue +78 -0
- package/components/content/Collapsible.vue +80 -0
- package/components/content/Field.vue +53 -0
- package/components/content/FieldGroup.vue +5 -0
- package/components/content/FileTree.vue +110 -0
- package/components/content/FileTreeItem.vue +64 -0
- package/components/content/FileTreeRoot.vue +27 -0
- package/components/content/Hero.vue +154 -0
- package/components/content/HeroAlt.vue +116 -0
- package/components/content/Icon.vue +69 -0
- package/components/content/Kbd.vue +20 -0
- package/components/content/PmInstall.vue +35 -0
- package/components/content/PmRun.vue +31 -0
- package/components/content/PmX.vue +31 -0
- package/components/content/ProseA.vue +21 -0
- package/components/content/ProseBlockquote.vue +5 -0
- package/components/content/ProseCode.vue +121 -0
- package/components/content/ProseCodeInline.vue +24 -0
- package/components/content/ProseEm.vue +5 -0
- package/components/content/ProseH1.vue +27 -0
- package/components/content/ProseH2.vue +22 -0
- package/components/content/ProseH3.vue +21 -0
- package/components/content/ProseH4.vue +21 -0
- package/components/content/ProseH5.vue +21 -0
- package/components/content/ProseH6.vue +21 -0
- package/components/content/ProseHr.vue +3 -0
- package/components/content/ProseImg.vue +42 -0
- package/components/content/ProseLi.vue +5 -0
- package/components/content/ProseOl.vue +5 -0
- package/components/content/ProseP.vue +5 -0
- package/components/content/ProsePre.vue +56 -0
- package/components/content/ProseSection.vue +27 -0
- package/components/content/ProseStrong.vue +5 -0
- package/components/content/ProseTable.vue +7 -0
- package/components/content/ProseTbody.vue +5 -0
- package/components/content/ProseTd.vue +5 -0
- package/components/content/ProseTh.vue +5 -0
- package/components/content/ProseThead.vue +5 -0
- package/components/content/ProseTr.vue +5 -0
- package/components/content/ProseUl.vue +5 -0
- package/components/content/ReadMore.vue +41 -0
- package/components/content/Shortcut.vue +20 -0
- package/components/content/Stack.vue +17 -0
- package/components/content/Steps.vue +23 -0
- package/components/content/Tabs.vue +52 -0
- package/components/content/TabsInner.vue +263 -0
- package/components/content/TeamCard.vue +52 -0
- package/components/content/TeamCardGroup.vue +5 -0
- package/components/content/global/AlertEditor.vue +58 -0
- package/components/content/global/BadgeEditor.vue +56 -0
- package/components/content/global/BrEditor.vue +3 -0
- package/components/content/global/CardEditor.vue +142 -0
- package/components/content/global/CardGroupEditor.vue +50 -0
- package/components/content/global/CodeGroup.vue +13 -0
- package/components/content/global/CodeGroupEditor.vue +50 -0
- package/components/content/global/DivEditor.vue +22 -0
- package/components/content/global/FieldEditor.vue +38 -0
- package/components/content/global/FieldGroupEditor.vue +24 -0
- package/components/content/global/HeroEditor.vue +67 -0
- package/components/content/global/ProseSectionEditor.vue +180 -0
- package/components/content/global/ReadMoreEditor.vue +70 -0
- package/components/content/global/SectionEditor.vue +22 -0
- package/components/content/global/StackEditor.vue +35 -0
- package/components/content/global/StepsEditor.vue +55 -0
- package/components/content/global/Tabs._vue +97 -0
- package/components/content/global/TabsEditor.vue +38 -0
- package/components/layout/Aside.vue +83 -0
- package/components/layout/AsideTree.vue +25 -0
- package/components/layout/AsideTreeItem.vue +86 -0
- package/components/layout/AsideTreeItemButton.vue +32 -0
- package/components/layout/Banner.vue +77 -0
- package/components/layout/Breadcrumb.vue +34 -0
- package/components/layout/DocsFooter.vue +6 -0
- package/components/layout/EditLink.vue +23 -0
- package/components/layout/Footer.vue +80 -0
- package/components/layout/FooterItem.vue +50 -0
- package/components/layout/FooterSubmenuItem.vue +39 -0
- package/components/layout/Header/Logo.vue +30 -0
- package/components/layout/Header/MenuItem.vue +83 -0
- package/components/layout/Header/Nav.vue +112 -0
- package/components/layout/Header/NavMobile.vue +14 -0
- package/components/layout/Header/NavMobileItem.vue +79 -0
- package/components/layout/Header/SubmenuItem.vue +39 -0
- package/components/layout/Header.vue +160 -0
- package/components/layout/LangSwitcher.vue +90 -0
- package/components/layout/MobileNav.vue +44 -0
- package/components/layout/PrevNext.vue +24 -0
- package/components/layout/PrevNextButton.vue +50 -0
- package/components/layout/SearchButton.vue +46 -0
- package/components/layout/SearchDialog.vue +217 -0
- package/components/layout/Title.vue +98 -0
- package/components/layout/Toc.vue +99 -0
- package/components/layout/TocTree.vue +42 -0
- package/components/ui/accordion/Accordion.vue +19 -0
- package/components/ui/accordion/AccordionContent.vue +24 -0
- package/components/ui/accordion/AccordionItem.vue +24 -0
- package/components/ui/accordion/AccordionTrigger.vue +39 -0
- package/components/ui/accordion/index.ts +4 -0
- package/components/ui/alert/Alert.vue +19 -0
- package/components/ui/alert/AlertDescription.vue +14 -0
- package/components/ui/alert/AlertTitle.vue +14 -0
- package/components/ui/alert/index.ts +23 -0
- package/components/ui/avatar/Avatar.vue +25 -0
- package/components/ui/avatar/AvatarFallback.vue +11 -0
- package/components/ui/avatar/AvatarImage.vue +12 -0
- package/components/ui/avatar/index.ts +24 -0
- package/components/ui/badge/Badge.vue +17 -0
- package/components/ui/badge/index.ts +71 -0
- package/components/ui/breadcrumb/Breadcrumb.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbItem.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbLink.vue +23 -0
- package/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
- package/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
- package/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
- package/components/ui/breadcrumb/index.ts +6 -0
- package/components/ui/button/Button.vue +29 -0
- package/components/ui/button/index.ts +35 -0
- package/components/ui/card/Card.vue +21 -0
- package/components/ui/card/CardContent.vue +14 -0
- package/components/ui/card/CardDescription.vue +14 -0
- package/components/ui/card/CardFooter.vue +14 -0
- package/components/ui/card/CardHeader.vue +14 -0
- package/components/ui/card/CardTitle.vue +18 -0
- package/components/ui/card/index.ts +6 -0
- package/components/ui/collapsible/Collapsible.vue +18 -0
- package/components/ui/collapsible/CollapsibleContent.vue +14 -0
- package/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
- package/components/ui/collapsible/index.ts +3 -0
- package/components/ui/command/Command.vue +89 -0
- package/components/ui/command/CommandEmpty.vue +30 -0
- package/components/ui/command/CommandGroup.vue +50 -0
- package/components/ui/command/CommandInput.vue +44 -0
- package/components/ui/command/CommandInputOnly.vue +50 -0
- package/components/ui/command/CommandItem.vue +79 -0
- package/components/ui/command/CommandList.vue +28 -0
- package/components/ui/command/CommandSeparator.vue +24 -0
- package/components/ui/command/index.ts +24 -0
- package/components/ui/dialog/Dialog.vue +14 -0
- package/components/ui/dialog/DialogClose.vue +11 -0
- package/components/ui/dialog/DialogContent.vue +52 -0
- package/components/ui/dialog/DialogDescription.vue +24 -0
- package/components/ui/dialog/DialogFooter.vue +19 -0
- package/components/ui/dialog/DialogHeader.vue +16 -0
- package/components/ui/dialog/DialogScrollContent.vue +61 -0
- package/components/ui/dialog/DialogTitle.vue +29 -0
- package/components/ui/dialog/DialogTrigger.vue +11 -0
- package/components/ui/dialog/index.ts +9 -0
- package/components/ui/input/Input.vue +27 -0
- package/components/ui/input/index.ts +1 -0
- package/components/ui/label/Label.vue +27 -0
- package/components/ui/label/index.ts +1 -0
- package/components/ui/navigation-menu/NavigationMenu.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuContent.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuIndicator.vue +24 -0
- package/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
- package/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
- package/components/ui/navigation-menu/NavigationMenuList.vue +33 -0
- package/components/ui/navigation-menu/NavigationMenuTrigger.vue +34 -0
- package/components/ui/navigation-menu/NavigationMenuViewport.vue +33 -0
- package/components/ui/navigation-menu/index.ts +14 -0
- package/components/ui/popover/Popover.vue +15 -0
- package/components/ui/popover/PopoverContent.vue +49 -0
- package/components/ui/popover/PopoverTrigger.vue +11 -0
- package/components/ui/popover/index.ts +4 -0
- package/components/ui/scroll-area/ScrollArea.vue +32 -0
- package/components/ui/scroll-area/ScrollBar.vue +41 -0
- package/components/ui/scroll-area/index.ts +2 -0
- package/components/ui/separator/Separator.vue +20 -0
- package/components/ui/separator/index.ts +1 -0
- package/components/ui/sheet/Sheet.vue +14 -0
- package/components/ui/sheet/SheetClose.vue +11 -0
- package/components/ui/sheet/SheetContent.vue +58 -0
- package/components/ui/sheet/SheetDescription.vue +22 -0
- package/components/ui/sheet/SheetFooter.vue +19 -0
- package/components/ui/sheet/SheetHeader.vue +16 -0
- package/components/ui/sheet/SheetTitle.vue +22 -0
- package/components/ui/sheet/SheetTrigger.vue +11 -0
- package/components/ui/sheet/index.ts +31 -0
- package/components/ui/slider/Slider.vue +36 -0
- package/components/ui/slider/index.ts +1 -0
- package/components/ui/tabs/Tabs.vue +15 -0
- package/components/ui/tabs/TabsContent.vue +22 -0
- package/components/ui/tabs/TabsList.vue +25 -0
- package/components/ui/tabs/TabsTrigger.vue +27 -0
- package/components/ui/tabs/index.ts +4 -0
- package/components/ui/textarea/Textarea.vue +27 -0
- package/components/ui/textarea/index.ts +1 -0
- package/components/ui/toast/Toast.vue +28 -0
- package/components/ui/toast/ToastAction.vue +22 -0
- package/components/ui/toast/ToastClose.vue +27 -0
- package/components/ui/toast/ToastDescription.vue +22 -0
- package/components/ui/toast/ToastProvider.vue +11 -0
- package/components/ui/toast/ToastTitle.vue +22 -0
- package/components/ui/toast/ToastViewport.vue +20 -0
- package/components/ui/toast/Toaster.vue +34 -0
- package/components/ui/toast/index.ts +38 -0
- package/components/ui/toast/use-toast.ts +165 -0
- package/components.json +18 -0
- package/composables/useBreadcrumb.ts +47 -0
- package/composables/useCollapsedMap.ts +3 -0
- package/composables/useConfig.ts +227 -0
- package/composables/useEditLink.ts +27 -0
- package/composables/useI18nDocs.ts +114 -0
- package/composables/useMdcMenu.ts +204 -0
- package/composables/usePm.ts +58 -0
- package/composables/useScrollspy.ts +51 -0
- package/composables/useThemes.ts +46 -0
- package/composables/useToast.ts +1 -0
- package/content/index.md +45 -0
- package/eslint.config.js +3 -0
- package/i18n/i18n.config.ts +414 -0
- package/index.d.ts +610 -0
- package/layouts/blank.vue +5 -0
- package/layouts/default.vue +9 -0
- package/layouts/editorial.vue +83 -0
- package/lib/registry/themes.ts +636 -0
- package/lib/uno-preset.ts +143 -0
- package/memory-bank/activeContext.md +17 -0
- package/memory-bank/productContext.md +21 -0
- package/memory-bank/progress.md +16 -0
- package/memory-bank/projectbrief.md +20 -0
- package/memory-bank/systemPatterns.md +25 -0
- package/memory-bank/techContext.md +29 -0
- package/modules/inject-css.ts +40 -0
- package/nuxt.config.ts +124 -0
- package/package.json +71 -0
- package/pages/[...slug].vue +109 -0
- package/pages/admin/[...slug].vue +145 -0
- package/pages/index.vue +24 -0
- package/plugins/injectCssHmr.ts +26 -0
- package/plugins/wordup.ts +130 -0
- package/public/content-doc.json +792 -0
- package/public/iconesjs.svg +4 -0
- package/scripts/buildContentDoc-cli.ts +8 -0
- package/scripts/buildContentDoc.ts +165 -0
- package/tailwind.config.js +1 -0
- package/tsconfig.json +3 -0
- package/uno.config.mjs +58 -0
- package/utils/index.ts +12 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiNavigationMenu
|
|
3
|
+
v-if="!tree?.children.length"
|
|
4
|
+
class="app__header-menu"
|
|
5
|
+
>
|
|
6
|
+
<UiNavigationMenuList>
|
|
7
|
+
<UiNavigationMenuItem
|
|
8
|
+
v-for="(item, i) in nav"
|
|
9
|
+
:key="i"
|
|
10
|
+
class="relative"
|
|
11
|
+
>
|
|
12
|
+
<template v-if="item.links">
|
|
13
|
+
<UiNavigationMenuTrigger class="bg-transparent font-semibold">
|
|
14
|
+
{{ $t(item.title) }}
|
|
15
|
+
</UiNavigationMenuTrigger>
|
|
16
|
+
<UiNavigationMenuContent>
|
|
17
|
+
<ul class="w-[250px] p-2">
|
|
18
|
+
<li
|
|
19
|
+
v-for="link in item.links"
|
|
20
|
+
:key="link.title"
|
|
21
|
+
>
|
|
22
|
+
<NuxtLink
|
|
23
|
+
:to="link.to"
|
|
24
|
+
:target="link.target"
|
|
25
|
+
class="mb-1 flex w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
|
|
26
|
+
>
|
|
27
|
+
<Icon
|
|
28
|
+
v-if="link.icon"
|
|
29
|
+
:name="link.icon"
|
|
30
|
+
:size="16"
|
|
31
|
+
class="mt-1 min-w-5"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<div>
|
|
35
|
+
<div class="font-semibold">
|
|
36
|
+
{{ $t(link.title) }}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="text-sm opacity-80">
|
|
39
|
+
{{ $t(link.description) }}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</NuxtLink>
|
|
43
|
+
</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</UiNavigationMenuContent>
|
|
46
|
+
</template>
|
|
47
|
+
<NuxtLink
|
|
48
|
+
v-else
|
|
49
|
+
:to="item.to"
|
|
50
|
+
:target="item.target"
|
|
51
|
+
>
|
|
52
|
+
<NuxtIcon
|
|
53
|
+
v-if="item.showLinkIcon ?? false"
|
|
54
|
+
name="lucide:arrow-up-right"
|
|
55
|
+
class="absolute right-2 top-2 opacity-80"
|
|
56
|
+
size="13"
|
|
57
|
+
/>
|
|
58
|
+
<div
|
|
59
|
+
class="bg-transparent font-semibold"
|
|
60
|
+
:class="[
|
|
61
|
+
navigationMenuTriggerStyle(),
|
|
62
|
+
(item.showLinkIcon ?? false) && 'pr-6',
|
|
63
|
+
]"
|
|
64
|
+
>
|
|
65
|
+
{{ $t(item.title) }}
|
|
66
|
+
</div>
|
|
67
|
+
</NuxtLink>
|
|
68
|
+
</UiNavigationMenuItem>
|
|
69
|
+
</UiNavigationMenuList>
|
|
70
|
+
</UiNavigationMenu>
|
|
71
|
+
|
|
72
|
+
<UiNavigationMenu
|
|
73
|
+
v-else
|
|
74
|
+
disable-hover-trigger
|
|
75
|
+
class="header-menu"
|
|
76
|
+
>
|
|
77
|
+
<UiNavigationMenuList>
|
|
78
|
+
<MDCRenderer
|
|
79
|
+
:body="tree"
|
|
80
|
+
:tag="false"
|
|
81
|
+
:components="{
|
|
82
|
+
'header-menu-item': HeaderMenuItem,
|
|
83
|
+
'header-submenu-item': HeaderSubmenuItem,
|
|
84
|
+
}"
|
|
85
|
+
/>
|
|
86
|
+
</UiNavigationMenuList>
|
|
87
|
+
</UiNavigationMenu>
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script setup lang="ts">
|
|
91
|
+
import { navigationMenuTriggerStyle } from '../../ui/navigation-menu'
|
|
92
|
+
import HeaderMenuItem from './MenuItem.vue'
|
|
93
|
+
import HeaderSubmenuItem from './SubmenuItem.vue'
|
|
94
|
+
|
|
95
|
+
const { nav } = useConfig().value.header
|
|
96
|
+
|
|
97
|
+
const menu = '/_menu-header'
|
|
98
|
+
const { data: count } = await useAsyncData(menu + '-count', () =>
|
|
99
|
+
queryContent(menu).count(),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
let tree = undefined
|
|
103
|
+
if (count.value) {
|
|
104
|
+
const { data } = await useAsyncData(menu, () =>
|
|
105
|
+
queryContent(menu).findOne(),
|
|
106
|
+
)
|
|
107
|
+
tree = await useMdcMenu(data, {
|
|
108
|
+
menuComponentName: 'header-menu-item',
|
|
109
|
+
submenuComponentName: 'header-submenu-item',
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-if="item.links">
|
|
3
|
+
<UiCollapsible v-model:open="isOpen">
|
|
4
|
+
<UiCollapsibleTrigger class="w-full p-2 text-left">
|
|
5
|
+
<div class="flex w-full gap-1">
|
|
6
|
+
{{ item.title }}
|
|
7
|
+
<NuxtIcon
|
|
8
|
+
:name="
|
|
9
|
+
isOpen ? 'lucide:chevrons-down-up' : 'lucide:chevrons-up-down'
|
|
10
|
+
"
|
|
11
|
+
size="12"
|
|
12
|
+
class="ml-auto self-center"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</UiCollapsibleTrigger>
|
|
16
|
+
<UiCollapsibleContent>
|
|
17
|
+
<ul class="pl-2">
|
|
18
|
+
<li
|
|
19
|
+
v-for="link in item.links"
|
|
20
|
+
:key="link.title"
|
|
21
|
+
>
|
|
22
|
+
<NuxtLink
|
|
23
|
+
:to="link.to"
|
|
24
|
+
:target="link.to"
|
|
25
|
+
class="mb-1 flex w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
|
|
26
|
+
>
|
|
27
|
+
<Icon
|
|
28
|
+
v-if="link.icon"
|
|
29
|
+
:name="link.icon"
|
|
30
|
+
:size="16"
|
|
31
|
+
class="mt-1 min-w-5"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<div>
|
|
35
|
+
<div class="font-semibold">
|
|
36
|
+
{{ $t(link.title) }}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="text-sm text-muted-foreground">
|
|
39
|
+
{{ $t(link.description) }}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</NuxtLink>
|
|
43
|
+
</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</UiCollapsibleContent>
|
|
46
|
+
</UiCollapsible>
|
|
47
|
+
</template>
|
|
48
|
+
<NuxtLink
|
|
49
|
+
v-else
|
|
50
|
+
:to="item.to"
|
|
51
|
+
:target="item.target"
|
|
52
|
+
class="flex w-full p-2"
|
|
53
|
+
>
|
|
54
|
+
{{ item.title }}
|
|
55
|
+
<NuxtIcon
|
|
56
|
+
v-if="item.showLinkIcon ?? true"
|
|
57
|
+
name="lucide:arrow-up-right"
|
|
58
|
+
class="ml-1 text-muted-foreground"
|
|
59
|
+
size="12"
|
|
60
|
+
/>
|
|
61
|
+
</NuxtLink>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
import type { NuxtLink } from '#imports'
|
|
66
|
+
|
|
67
|
+
const props = defineProps<{
|
|
68
|
+
item: NuxtLink
|
|
69
|
+
index: number
|
|
70
|
+
}>()
|
|
71
|
+
|
|
72
|
+
const collapsed = useCollapsedMap()
|
|
73
|
+
const isOpen = ref(
|
|
74
|
+
collapsed.value.get(`mobile-header-nav${props.index}`) || false,
|
|
75
|
+
)
|
|
76
|
+
watch(isOpen, (v) => {
|
|
77
|
+
collapsed.value.set(`mobile-header-nav${props.index}`, v)
|
|
78
|
+
})
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
const { to, target, icon, title, description, tag } = defineProps<{
|
|
3
|
+
to?: string
|
|
4
|
+
target?: string
|
|
5
|
+
showLinkIcon?: boolean
|
|
6
|
+
icon?: string
|
|
7
|
+
title?: string
|
|
8
|
+
description?: string
|
|
9
|
+
tag?: string
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<component :is="tag || 'div'">
|
|
15
|
+
<NuxtLink
|
|
16
|
+
:to
|
|
17
|
+
:target
|
|
18
|
+
class="mb-1 flex w-full gap-2 rounded-md px-3 py-2 transition-all hover:bg-muted"
|
|
19
|
+
>
|
|
20
|
+
<Icon
|
|
21
|
+
v-if="icon"
|
|
22
|
+
:name="icon"
|
|
23
|
+
class="mt-1"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<div>
|
|
27
|
+
<div class="font-semibold text-base">
|
|
28
|
+
{{ title }}
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
v-if="description"
|
|
32
|
+
class="text-sm text-muted-foreground"
|
|
33
|
+
>
|
|
34
|
+
{{ description }}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</NuxtLink>
|
|
38
|
+
</component>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header
|
|
3
|
+
class="app__header"
|
|
4
|
+
:class="[
|
|
5
|
+
cn(
|
|
6
|
+
'sticky top-0 z-40 w-full bg-background/70 backdrop-blur',
|
|
7
|
+
config.header.border && 'lg:border-b mb-[-1px]',
|
|
8
|
+
config.header.position === 'floating' && 'floating top-4 w-min mx-auto rounded-full border-none',
|
|
9
|
+
config.header.class,
|
|
10
|
+
),
|
|
11
|
+
{
|
|
12
|
+
'hide-on-scroll': config.header.behavior === 'hide-on-scroll',
|
|
13
|
+
'scroll-up': scrollUp,
|
|
14
|
+
'scroll-down': !scrollUp,
|
|
15
|
+
'timeline-scroll-range-exceeded': timelineScrollRangeExceeded,
|
|
16
|
+
},
|
|
17
|
+
]"
|
|
18
|
+
>
|
|
19
|
+
<LayoutBanner v-if="config.banner.enable" />
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class="flex h-14 items-center justify-between gap-2 px-4 md:px-8"
|
|
23
|
+
:class="{
|
|
24
|
+
'border-b lg:border-none': config.header.border,
|
|
25
|
+
'container': config.main.padded,
|
|
26
|
+
}"
|
|
27
|
+
>
|
|
28
|
+
<LayoutHeaderLogo class="hidden md:flex w-max mr-4" />
|
|
29
|
+
|
|
30
|
+
<LayoutMobileNav />
|
|
31
|
+
|
|
32
|
+
<LayoutHeaderLogo
|
|
33
|
+
v-if="config.header.showTitleInMobile"
|
|
34
|
+
class="flex md:hidden"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<LayoutHeaderNav class="hidden lg:flex" />
|
|
38
|
+
|
|
39
|
+
<div class="flex justify-end gap-2">
|
|
40
|
+
<LayoutSearchButton
|
|
41
|
+
v-if="!config.search.inAside && config.search.style === 'input'"
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<div class="flex">
|
|
45
|
+
<LayoutSearchButton
|
|
46
|
+
v-if="!config.search.inAside && config.search.style === 'button'"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<ThemePopover v-if="config.theme.customizable" />
|
|
50
|
+
<DarkModeToggle v-if="config.header.darkModeToggle" />
|
|
51
|
+
<A11yModeToggle />
|
|
52
|
+
|
|
53
|
+
<NuxtLink
|
|
54
|
+
v-for="(link, i) in config.header.links"
|
|
55
|
+
:key="i"
|
|
56
|
+
:to="link?.to"
|
|
57
|
+
:target="link?.target"
|
|
58
|
+
>
|
|
59
|
+
<UiButton
|
|
60
|
+
variant="ghost"
|
|
61
|
+
size="icon"
|
|
62
|
+
class="flex gap-2"
|
|
63
|
+
>
|
|
64
|
+
<Icon
|
|
65
|
+
v-if="link?.icon"
|
|
66
|
+
:name="link.icon"
|
|
67
|
+
:size="18"
|
|
68
|
+
/>
|
|
69
|
+
</UiButton>
|
|
70
|
+
</NuxtLink>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div
|
|
76
|
+
v-if="config.toc.enable && config.toc.enableInMobile"
|
|
77
|
+
class="lg:hidden"
|
|
78
|
+
>
|
|
79
|
+
<LayoutToc is-small />
|
|
80
|
+
</div>
|
|
81
|
+
</header>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup lang="ts">
|
|
85
|
+
import { useWindowScroll } from '@vueuse/core'
|
|
86
|
+
import { cn } from '@/lib/utils'
|
|
87
|
+
|
|
88
|
+
const config = useConfig()
|
|
89
|
+
|
|
90
|
+
const { y } = useWindowScroll()
|
|
91
|
+
|
|
92
|
+
let lastScrollPosition = 0
|
|
93
|
+
let startingScrollUpPosition = 0
|
|
94
|
+
const timelineScrollRange = 680
|
|
95
|
+
const scrollUpOffset = 300
|
|
96
|
+
|
|
97
|
+
const timelineScrollRangeExceeded = computed(() => {
|
|
98
|
+
return y.value - timelineScrollRange > 0
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const scrollUp = computed(() => {
|
|
102
|
+
let isScrollingUp = false
|
|
103
|
+
|
|
104
|
+
if (y.value > lastScrollPosition) {
|
|
105
|
+
isScrollingUp = false
|
|
106
|
+
startingScrollUpPosition = 0
|
|
107
|
+
}
|
|
108
|
+
else if (y.value < lastScrollPosition) {
|
|
109
|
+
if (startingScrollUpPosition === 0) {
|
|
110
|
+
startingScrollUpPosition = y.value
|
|
111
|
+
}
|
|
112
|
+
if (startingScrollUpPosition - y.value > scrollUpOffset) {
|
|
113
|
+
console.log(timelineScrollRangeExceeded.value, isScrollingUp)
|
|
114
|
+
if (timelineScrollRangeExceeded.value || scrollUp.value) isScrollingUp = true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
lastScrollPosition = y.value
|
|
118
|
+
return isScrollingUp
|
|
119
|
+
})
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<style scoped>
|
|
123
|
+
@supports(animation-timeline: view()){
|
|
124
|
+
.app__header.hide-on-scroll {
|
|
125
|
+
--header-timeline-scroll-range-min: 200px;
|
|
126
|
+
--header-animation-duration: 0.3s;
|
|
127
|
+
--header-translate-y: -100%;
|
|
128
|
+
}
|
|
129
|
+
.app__header.hide-on-scroll.floating {
|
|
130
|
+
--header-translate-y: calc(-100% - 1rem);
|
|
131
|
+
}
|
|
132
|
+
.app__header:not(.timeline-scroll-range-exceeded) {
|
|
133
|
+
animation: disappearHeader linear both;
|
|
134
|
+
animation-timeline: scroll();
|
|
135
|
+
animation-range: var(--header-timeline-scroll-range-min) calc(v-bind(timelineScrollRange) * 1px);
|
|
136
|
+
}
|
|
137
|
+
.app__header.scroll-down.timeline-scroll-range-exceeded {
|
|
138
|
+
animation: disappearHeader var(--header-animation-duration) linear both;
|
|
139
|
+
}
|
|
140
|
+
.app__header.scroll-up {
|
|
141
|
+
animation: appearHeader var(--header-animation-duration) linear both;
|
|
142
|
+
animation-range: unset;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes disappearHeader {
|
|
146
|
+
100% {
|
|
147
|
+
transform: translateY(var(--header-translate-y));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@keyframes appearHeader {
|
|
152
|
+
0% {
|
|
153
|
+
transform: translateY(var(--header-translate-y));
|
|
154
|
+
}
|
|
155
|
+
100% {
|
|
156
|
+
transform: translateY(0);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UseTemplate>
|
|
3
|
+
<UiButton
|
|
4
|
+
variant="ghost"
|
|
5
|
+
size="icon"
|
|
6
|
+
class="uppercase"
|
|
7
|
+
>
|
|
8
|
+
<Icon
|
|
9
|
+
v-if="triggerType === 'icon'"
|
|
10
|
+
name="lucide:languages"
|
|
11
|
+
size="18"
|
|
12
|
+
/>
|
|
13
|
+
<span
|
|
14
|
+
v-else-if="triggerType === 'text'"
|
|
15
|
+
class="font-semibold"
|
|
16
|
+
>
|
|
17
|
+
{{ locale }}
|
|
18
|
+
</span>
|
|
19
|
+
</UiButton>
|
|
20
|
+
</UseTemplate>
|
|
21
|
+
|
|
22
|
+
<template v-if="enable && locales.length > 1">
|
|
23
|
+
<UiPopover v-if="dropdownType === 'popover'">
|
|
24
|
+
<UiPopoverTrigger as-child>
|
|
25
|
+
<Trigger />
|
|
26
|
+
</UiPopoverTrigger>
|
|
27
|
+
<UiPopoverContent
|
|
28
|
+
class="w-[23rem]"
|
|
29
|
+
:align="breakpoints.isGreaterOrEqual('md') ? 'end' : 'center'"
|
|
30
|
+
>
|
|
31
|
+
<div class="grid gap-6">
|
|
32
|
+
<div class="grid space-y-1">
|
|
33
|
+
<h1 class="text-foreground text-lg font-semibold">
|
|
34
|
+
{{ $t('Language') }}
|
|
35
|
+
</h1>
|
|
36
|
+
<p class="text-muted-foreground text-sm">
|
|
37
|
+
{{ $t('Choose your language') }}
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="space-y-1.5">
|
|
41
|
+
<div class="grid grid-cols-3 gap-2">
|
|
42
|
+
<template
|
|
43
|
+
v-for="l in locales"
|
|
44
|
+
:key="l.code"
|
|
45
|
+
>
|
|
46
|
+
<UiButton
|
|
47
|
+
class="justify-start gap-2"
|
|
48
|
+
variant="outline"
|
|
49
|
+
:class="{ 'border-primary border-2': locale === l.code }"
|
|
50
|
+
@click="navigateTo(switchLocalePath(l.code))"
|
|
51
|
+
>
|
|
52
|
+
<span class="text-xs capitalize">{{ l.name }}</span>
|
|
53
|
+
</UiButton>
|
|
54
|
+
</template>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</UiPopoverContent>
|
|
59
|
+
</UiPopover>
|
|
60
|
+
<UiDropdownMenu v-else-if="dropdownType === 'select'">
|
|
61
|
+
<UiDropdownMenuTrigger as-child>
|
|
62
|
+
<Trigger />
|
|
63
|
+
</UiDropdownMenuTrigger>
|
|
64
|
+
<UiDropdownMenuContent class="w-20">
|
|
65
|
+
<UiDropdownMenuRadioGroup v-model="selectedLocale">
|
|
66
|
+
<UiDropdownMenuRadioItem
|
|
67
|
+
v-for="l in locales"
|
|
68
|
+
:key="l.code"
|
|
69
|
+
:value="l.code"
|
|
70
|
+
@click="selectedLocale = l.code; navigateTo(switchLocalePath(l.code))"
|
|
71
|
+
>
|
|
72
|
+
{{ l.name }}
|
|
73
|
+
</UiDropdownMenuRadioItem>
|
|
74
|
+
</UiDropdownMenuRadioGroup>
|
|
75
|
+
</UiDropdownMenuContent>
|
|
76
|
+
</UiDropdownMenu>
|
|
77
|
+
</template>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script setup lang="ts">
|
|
81
|
+
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'
|
|
82
|
+
|
|
83
|
+
const { locale, locales, switchLocalePath } = useI18nDocs()
|
|
84
|
+
const selectedLocale = ref(locale.value)
|
|
85
|
+
const { enable, triggerType, dropdownType } = useConfig().value.header.languageSwitcher
|
|
86
|
+
|
|
87
|
+
const breakpoints = useBreakpoints(breakpointsTailwind)
|
|
88
|
+
|
|
89
|
+
const [UseTemplate, Trigger] = createReusableTemplate()
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiSheet v-model:open="open">
|
|
3
|
+
<UiSheetTrigger as-child>
|
|
4
|
+
<UiButton
|
|
5
|
+
variant="ghost"
|
|
6
|
+
size="icon"
|
|
7
|
+
class="md:hidden"
|
|
8
|
+
>
|
|
9
|
+
<NuxtIcon
|
|
10
|
+
name="lucide:menu"
|
|
11
|
+
size="24"
|
|
12
|
+
/>
|
|
13
|
+
</UiButton>
|
|
14
|
+
</UiSheetTrigger>
|
|
15
|
+
|
|
16
|
+
<UiSheetContent
|
|
17
|
+
side="left"
|
|
18
|
+
class="pr-0 unpress-padding"
|
|
19
|
+
>
|
|
20
|
+
<LayoutHeaderLogo class="mx-auto w-fit block pr-6" />
|
|
21
|
+
<LayoutAside is-mobile />
|
|
22
|
+
<UiDialogTitle class="sr-only" />
|
|
23
|
+
<UiDialogDescription class="sr-only" />
|
|
24
|
+
</UiSheetContent>
|
|
25
|
+
</UiSheet>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
const open = ref(false)
|
|
30
|
+
|
|
31
|
+
// Close sheet on navigation
|
|
32
|
+
watch(
|
|
33
|
+
() => useRoute().path,
|
|
34
|
+
() => {
|
|
35
|
+
open.value = false
|
|
36
|
+
},
|
|
37
|
+
)
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="css">
|
|
41
|
+
.unpress.left .unpress-padding {
|
|
42
|
+
left: auto;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="page.prevNext ?? true"
|
|
4
|
+
class="border-t pt-6 lg:grid lg:grid-cols-2 lg:gap-6"
|
|
5
|
+
>
|
|
6
|
+
<LayoutPrevNextButton
|
|
7
|
+
:prev-next="prev"
|
|
8
|
+
side="left"
|
|
9
|
+
/>
|
|
10
|
+
<span
|
|
11
|
+
v-if="!prev"
|
|
12
|
+
class="flex-1"
|
|
13
|
+
/>
|
|
14
|
+
<LayoutPrevNextButton
|
|
15
|
+
:prev-next="next"
|
|
16
|
+
side="right"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
const { page } = useContent()
|
|
23
|
+
const { prev, next } = useI18nDocs()
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NuxtLink
|
|
3
|
+
v-if="prevNext && prevNext._path"
|
|
4
|
+
:to="prevNext._path"
|
|
5
|
+
class="mb-4 space-y-2 rounded-lg border p-4 transition-all hover:bg-muted/50"
|
|
6
|
+
>
|
|
7
|
+
<div class="flex flex-row gap-3">
|
|
8
|
+
<div
|
|
9
|
+
v-if="side === 'left'"
|
|
10
|
+
class="flex size-6 min-w-6"
|
|
11
|
+
>
|
|
12
|
+
<NuxtIcon
|
|
13
|
+
name="lucide:arrow-left"
|
|
14
|
+
size="20"
|
|
15
|
+
class="mx-auto self-center"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<span class="space-y-2 self-center">
|
|
19
|
+
<div class="text-lg font-semibold">
|
|
20
|
+
{{ prevNext.title }}
|
|
21
|
+
</div>
|
|
22
|
+
<div
|
|
23
|
+
v-if="prevNext.description"
|
|
24
|
+
class="text-sm text-muted-foreground"
|
|
25
|
+
>
|
|
26
|
+
{{ prevNext.description }}
|
|
27
|
+
</div>
|
|
28
|
+
</span>
|
|
29
|
+
<div
|
|
30
|
+
v-if="side === 'right'"
|
|
31
|
+
class="ml-auto flex size-6 min-w-6"
|
|
32
|
+
>
|
|
33
|
+
<NuxtIcon
|
|
34
|
+
name="lucide:arrow-right"
|
|
35
|
+
size="20"
|
|
36
|
+
class="mx-auto self-center"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</NuxtLink>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import type { ContentNode } from '#imports'
|
|
45
|
+
|
|
46
|
+
defineProps<{
|
|
47
|
+
prevNext: ContentNode
|
|
48
|
+
side: 'left' | 'right'
|
|
49
|
+
}>()
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-if="enable">
|
|
3
|
+
<UiButton
|
|
4
|
+
v-if="style === 'input'"
|
|
5
|
+
variant="outline"
|
|
6
|
+
class="h-8 w-full self-center rounded-md px-1.5 font-normal bg-white/50 text-muted-foreground hover:text-accent-foreground"
|
|
7
|
+
:class="[inAside ? 'mb-4' : 'md:w-32 lg:w-40']"
|
|
8
|
+
@click="isOpen = true"
|
|
9
|
+
>
|
|
10
|
+
<span class="mr-auto overflow-hidden">
|
|
11
|
+
{{ $t(placeholder) }}
|
|
12
|
+
</span>
|
|
13
|
+
<Kbd
|
|
14
|
+
v-if="displayShortcut"
|
|
15
|
+
class="ml-auto hidden md:block"
|
|
16
|
+
>
|
|
17
|
+
<span class="text-xs">⌘</span>K
|
|
18
|
+
</Kbd>
|
|
19
|
+
</UiButton>
|
|
20
|
+
<UiButton
|
|
21
|
+
v-else
|
|
22
|
+
variant="ghost"
|
|
23
|
+
size="icon"
|
|
24
|
+
:class="displayShortcut && 'flex gap-2 w-[72px]'"
|
|
25
|
+
@click="isOpen = true"
|
|
26
|
+
>
|
|
27
|
+
<NuxtIcon
|
|
28
|
+
name="lucide:search"
|
|
29
|
+
size="18"
|
|
30
|
+
/>
|
|
31
|
+
<Kbd
|
|
32
|
+
v-if="displayShortcut"
|
|
33
|
+
class="hidden md:block"
|
|
34
|
+
>
|
|
35
|
+
<span class="text-xs">⌘</span>K
|
|
36
|
+
</Kbd>
|
|
37
|
+
</UiButton>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<LayoutSearchDialog v-model:open="isOpen" />
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
const isOpen = ref(false)
|
|
45
|
+
const { enable, inAside, style, placeholder, displayShortcut } = useConfig().value.search
|
|
46
|
+
</script>
|