@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,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex items-center border-b px-3"
|
|
4
|
+
cmdk-input-wrapper
|
|
5
|
+
>
|
|
6
|
+
<NuxtIcon
|
|
7
|
+
name="lucide:search"
|
|
8
|
+
class="mr-2 size-4 shrink-0 opacity-50"
|
|
9
|
+
/>
|
|
10
|
+
<ListboxFilter
|
|
11
|
+
v-bind="{ ...forwardedProps, ...$attrs }"
|
|
12
|
+
v-model="filterState.search"
|
|
13
|
+
auto-focus
|
|
14
|
+
:class="cn('flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', props.class)"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import type { ListboxFilterProps } from 'reka-ui'
|
|
21
|
+
import type { HTMLAttributes } from 'vue'
|
|
22
|
+
import { ListboxFilter, useForwardProps } from 'reka-ui'
|
|
23
|
+
import { computed } from 'vue'
|
|
24
|
+
import { useCommand } from '.'
|
|
25
|
+
import { cn } from '@/lib/utils'
|
|
26
|
+
|
|
27
|
+
defineOptions({
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const props = defineProps<ListboxFilterProps & {
|
|
32
|
+
class?: HTMLAttributes['class']
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const delegatedProps = computed(() => {
|
|
36
|
+
const { class: _, ...delegated } = props
|
|
37
|
+
|
|
38
|
+
return delegated
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
42
|
+
|
|
43
|
+
const { filterState } = useCommand()
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex items-center border-b px-3"
|
|
4
|
+
cmdk-input-wrapper
|
|
5
|
+
>
|
|
6
|
+
<Icon
|
|
7
|
+
v-if="!loading"
|
|
8
|
+
name="lucide:search"
|
|
9
|
+
class="mr-2 size-4 shrink-0 opacity-50"
|
|
10
|
+
/>
|
|
11
|
+
<Icon
|
|
12
|
+
v-else
|
|
13
|
+
name="lucide:loader"
|
|
14
|
+
class="mr-2 size-4 shrink-0 animate-spin opacity-50"
|
|
15
|
+
/>
|
|
16
|
+
<ListboxFilter
|
|
17
|
+
v-bind="{ ...forwardedProps, ...$attrs }"
|
|
18
|
+
v-model="model"
|
|
19
|
+
auto-focus
|
|
20
|
+
:class="cn('flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', props.class)"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import type { ListboxFilterProps } from 'reka-ui'
|
|
27
|
+
import type { HTMLAttributes } from 'vue'
|
|
28
|
+
import { ListboxFilter, useForwardProps } from 'reka-ui'
|
|
29
|
+
import { computed } from 'vue'
|
|
30
|
+
import { cn } from '@/lib/utils'
|
|
31
|
+
|
|
32
|
+
defineOptions({
|
|
33
|
+
inheritAttrs: false,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const props = defineProps<ListboxFilterProps & {
|
|
37
|
+
class?: HTMLAttributes['class']
|
|
38
|
+
loading?: boolean
|
|
39
|
+
}>()
|
|
40
|
+
|
|
41
|
+
const model = defineModel<string>()
|
|
42
|
+
|
|
43
|
+
const delegatedProps = computed(() => {
|
|
44
|
+
const { class: _, ...delegated } = props
|
|
45
|
+
|
|
46
|
+
return delegated
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ListboxItem
|
|
3
|
+
v-if="isRender"
|
|
4
|
+
v-bind="forwarded"
|
|
5
|
+
:id="id"
|
|
6
|
+
ref="itemRef"
|
|
7
|
+
:class="cn('relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0', props.class)"
|
|
8
|
+
@select="() => {
|
|
9
|
+
filterState.search = ''
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
12
|
+
<slot />
|
|
13
|
+
</ListboxItem>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import type { ListboxItemEmits, ListboxItemProps } from 'reka-ui'
|
|
18
|
+
import type { HTMLAttributes } from 'vue'
|
|
19
|
+
import { useCurrentElement } from '@vueuse/core'
|
|
20
|
+
import { ListboxItem, useForwardPropsEmits, useId } from 'reka-ui'
|
|
21
|
+
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
22
|
+
import { useCommand, useCommandGroup } from '.'
|
|
23
|
+
import { cn } from '@/lib/utils'
|
|
24
|
+
|
|
25
|
+
const props = defineProps<ListboxItemProps & { class?: HTMLAttributes['class'] }>()
|
|
26
|
+
const emits = defineEmits<ListboxItemEmits>()
|
|
27
|
+
|
|
28
|
+
const delegatedProps = computed(() => {
|
|
29
|
+
const { class: _, ...delegated } = props
|
|
30
|
+
|
|
31
|
+
return delegated
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
35
|
+
|
|
36
|
+
const id = useId()
|
|
37
|
+
const { filterState, allItems, allGroups } = useCommand()
|
|
38
|
+
const groupContext = useCommandGroup()
|
|
39
|
+
|
|
40
|
+
const isRender = computed(() => {
|
|
41
|
+
if (!filterState.search) {
|
|
42
|
+
return true
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const filteredCurrentItem = filterState.filtered.items.get(id)
|
|
46
|
+
// If the filtered items is undefined means not in the all times map yet
|
|
47
|
+
// Do the first render to add into the map
|
|
48
|
+
if (filteredCurrentItem === undefined) {
|
|
49
|
+
return true
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Check with filter
|
|
53
|
+
return filteredCurrentItem > 0
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const itemRef = ref()
|
|
58
|
+
const currentElement = useCurrentElement(itemRef)
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
if (!(currentElement.value instanceof HTMLElement))
|
|
61
|
+
return
|
|
62
|
+
|
|
63
|
+
// textValue to perform filter
|
|
64
|
+
allItems.value.set(id, currentElement.value.textContent ?? props.value!.toString())
|
|
65
|
+
|
|
66
|
+
const groupId = groupContext?.id
|
|
67
|
+
if (groupId) {
|
|
68
|
+
if (!allGroups.value.has(groupId)) {
|
|
69
|
+
allGroups.value.set(groupId, new Set([id]))
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
allGroups.value.get(groupId)?.add(id)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
onUnmounted(() => {
|
|
77
|
+
allItems.value.delete(id)
|
|
78
|
+
})
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ListboxContent
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
:class="cn('overflow-y-auto overflow-x-hidden', props.class)"
|
|
5
|
+
>
|
|
6
|
+
<div role="presentation">
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
|
+
</ListboxContent>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import type { ListboxContentProps } from 'reka-ui'
|
|
14
|
+
import type { HTMLAttributes } from 'vue'
|
|
15
|
+
import { ListboxContent, useForwardProps } from 'reka-ui'
|
|
16
|
+
import { computed } from 'vue'
|
|
17
|
+
import { cn } from '@/lib/utils'
|
|
18
|
+
|
|
19
|
+
const props = defineProps<ListboxContentProps & { class?: HTMLAttributes['class'] }>()
|
|
20
|
+
|
|
21
|
+
const delegatedProps = computed(() => {
|
|
22
|
+
const { class: _, ...delegated } = props
|
|
23
|
+
|
|
24
|
+
return delegated
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const forwarded = useForwardProps(delegatedProps)
|
|
28
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Separator
|
|
3
|
+
v-bind="delegatedProps"
|
|
4
|
+
:class="cn('-mx-1 h-px bg-border', props.class)"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</Separator>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import type { SeparatorProps } from 'reka-ui'
|
|
12
|
+
import type { HTMLAttributes } from 'vue'
|
|
13
|
+
import { Separator } from 'reka-ui'
|
|
14
|
+
import { computed } from 'vue'
|
|
15
|
+
import { cn } from '@/lib/utils'
|
|
16
|
+
|
|
17
|
+
const props = defineProps<SeparatorProps & { class?: HTMLAttributes['class'] }>()
|
|
18
|
+
|
|
19
|
+
const delegatedProps = computed(() => {
|
|
20
|
+
const { class: _, ...delegated } = props
|
|
21
|
+
|
|
22
|
+
return delegated
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import { createContext } from 'reka-ui'
|
|
3
|
+
|
|
4
|
+
export { default as Command } from './Command.vue'
|
|
5
|
+
export { default as CommandEmpty } from './CommandEmpty.vue'
|
|
6
|
+
export { default as CommandGroup } from './CommandGroup.vue'
|
|
7
|
+
export { default as CommandInput } from './CommandInput.vue'
|
|
8
|
+
export { default as CommandInputOnly } from './CommandInputOnly.vue'
|
|
9
|
+
export { default as CommandItem } from './CommandItem.vue'
|
|
10
|
+
export { default as CommandList } from './CommandList.vue'
|
|
11
|
+
export { default as CommandSeparator } from './CommandSeparator.vue'
|
|
12
|
+
|
|
13
|
+
export const [useCommand, provideCommandContext] = createContext<{
|
|
14
|
+
allItems: Ref<Map<string, string>>
|
|
15
|
+
allGroups: Ref<Map<string, Set<string>>>
|
|
16
|
+
filterState: {
|
|
17
|
+
search: string
|
|
18
|
+
filtered: { count: number, items: Map<string, number>, groups: Set<string> }
|
|
19
|
+
}
|
|
20
|
+
}>('Command')
|
|
21
|
+
|
|
22
|
+
export const [useCommandGroup, provideCommandGroupContext] = createContext<{
|
|
23
|
+
id?: string
|
|
24
|
+
}>('CommandGroup')
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogRoot v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</DialogRoot>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { DialogRoot, type DialogRootEmits, type DialogRootProps, useForwardPropsEmits } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<DialogRootProps>()
|
|
11
|
+
const emits = defineEmits<DialogRootEmits>()
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogPortal>
|
|
3
|
+
<DialogOverlay
|
|
4
|
+
class="fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
5
|
+
/>
|
|
6
|
+
<DialogContent
|
|
7
|
+
v-bind="forwarded"
|
|
8
|
+
:class="
|
|
9
|
+
cn(
|
|
10
|
+
'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
11
|
+
props.class,
|
|
12
|
+
)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
|
|
16
|
+
<DialogClose
|
|
17
|
+
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
|
|
18
|
+
>
|
|
19
|
+
<NuxtIcon
|
|
20
|
+
name="lucide:x"
|
|
21
|
+
class="block size-4"
|
|
22
|
+
/>
|
|
23
|
+
<span class="sr-only">Close</span>
|
|
24
|
+
</DialogClose>
|
|
25
|
+
</DialogContent>
|
|
26
|
+
</DialogPortal>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import {
|
|
31
|
+
DialogClose,
|
|
32
|
+
DialogContent,
|
|
33
|
+
type DialogContentEmits,
|
|
34
|
+
type DialogContentProps,
|
|
35
|
+
DialogOverlay,
|
|
36
|
+
DialogPortal,
|
|
37
|
+
useForwardPropsEmits,
|
|
38
|
+
} from 'reka-ui'
|
|
39
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
40
|
+
import { cn } from '@/lib/utils'
|
|
41
|
+
|
|
42
|
+
const props = defineProps<DialogContentProps & { class?: HTMLAttributes['class'] }>()
|
|
43
|
+
const emits = defineEmits<DialogContentEmits>()
|
|
44
|
+
|
|
45
|
+
const delegatedProps = computed(() => {
|
|
46
|
+
const { class: _, ...delegated } = props
|
|
47
|
+
|
|
48
|
+
return delegated
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogDescription
|
|
3
|
+
v-bind="forwardedProps"
|
|
4
|
+
:class="cn('text-sm text-muted-foreground', props.class)"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</DialogDescription>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { DialogDescription, type DialogDescriptionProps, useForwardProps } from 'reka-ui'
|
|
12
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
13
|
+
import { cn } from '@/lib/utils'
|
|
14
|
+
|
|
15
|
+
const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes['class'] }>()
|
|
16
|
+
|
|
17
|
+
const delegatedProps = computed(() => {
|
|
18
|
+
const { class: _, ...delegated } = props
|
|
19
|
+
|
|
20
|
+
return delegated
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="
|
|
4
|
+
cn(
|
|
5
|
+
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
|
|
6
|
+
props.class,
|
|
7
|
+
)
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { HTMLAttributes } from 'vue'
|
|
16
|
+
import { cn } from '@/lib/utils'
|
|
17
|
+
|
|
18
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="cn('flex flex-col gap-y-1.5 text-center sm:text-left', props.class)"
|
|
4
|
+
>
|
|
5
|
+
<slot />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { HTMLAttributes } from 'vue'
|
|
11
|
+
import { cn } from '@/lib/utils'
|
|
12
|
+
|
|
13
|
+
const props = defineProps<{
|
|
14
|
+
class?: HTMLAttributes['class']
|
|
15
|
+
}>()
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogPortal>
|
|
3
|
+
<DialogOverlay
|
|
4
|
+
class="fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
5
|
+
>
|
|
6
|
+
<DialogContent
|
|
7
|
+
:class="
|
|
8
|
+
cn(
|
|
9
|
+
'relative z-50 grid w-full max-w-lg my-8 gap-4 border border-border bg-background p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
|
|
10
|
+
props.class,
|
|
11
|
+
)
|
|
12
|
+
"
|
|
13
|
+
v-bind="forwarded"
|
|
14
|
+
@pointer-down-outside="(event) => {
|
|
15
|
+
const originalEvent = event.detail.originalEvent;
|
|
16
|
+
const target = originalEvent.target as HTMLElement;
|
|
17
|
+
if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
}
|
|
20
|
+
}"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
|
|
24
|
+
<DialogClose
|
|
25
|
+
class="absolute right-3 top-3 rounded-md p-0.5 transition-colors hover:bg-secondary"
|
|
26
|
+
>
|
|
27
|
+
<NuxtIcon
|
|
28
|
+
name="lucide:x"
|
|
29
|
+
class="block size-4"
|
|
30
|
+
/>
|
|
31
|
+
<span class="sr-only">Close</span>
|
|
32
|
+
</DialogClose>
|
|
33
|
+
</DialogContent>
|
|
34
|
+
</DialogOverlay>
|
|
35
|
+
</DialogPortal>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import {
|
|
40
|
+
DialogClose,
|
|
41
|
+
DialogContent,
|
|
42
|
+
type DialogContentEmits,
|
|
43
|
+
type DialogContentProps,
|
|
44
|
+
DialogOverlay,
|
|
45
|
+
DialogPortal,
|
|
46
|
+
useForwardPropsEmits,
|
|
47
|
+
} from 'reka-ui'
|
|
48
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
49
|
+
import { cn } from '@/lib/utils'
|
|
50
|
+
|
|
51
|
+
const props = defineProps<DialogContentProps & { class?: HTMLAttributes['class'] }>()
|
|
52
|
+
const emits = defineEmits<DialogContentEmits>()
|
|
53
|
+
|
|
54
|
+
const delegatedProps = computed(() => {
|
|
55
|
+
const { class: _, ...delegated } = props
|
|
56
|
+
|
|
57
|
+
return delegated
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogTitle
|
|
3
|
+
v-bind="forwardedProps"
|
|
4
|
+
:class="
|
|
5
|
+
cn(
|
|
6
|
+
'text-lg font-semibold leading-none tracking-tight',
|
|
7
|
+
props.class,
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
</DialogTitle>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'reka-ui'
|
|
17
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
18
|
+
import { cn } from '@/lib/utils'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<DialogTitleProps & { class?: HTMLAttributes['class'] }>()
|
|
21
|
+
|
|
22
|
+
const delegatedProps = computed(() => {
|
|
23
|
+
const { class: _, ...delegated } = props
|
|
24
|
+
|
|
25
|
+
return delegated
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Dialog } from './Dialog.vue'
|
|
2
|
+
export { default as DialogClose } from './DialogClose.vue'
|
|
3
|
+
export { default as DialogContent } from './DialogContent.vue'
|
|
4
|
+
export { default as DialogDescription } from './DialogDescription.vue'
|
|
5
|
+
export { default as DialogFooter } from './DialogFooter.vue'
|
|
6
|
+
export { default as DialogHeader } from './DialogHeader.vue'
|
|
7
|
+
export { default as DialogScrollContent } from './DialogScrollContent.vue'
|
|
8
|
+
export { default as DialogTitle } from './DialogTitle.vue'
|
|
9
|
+
export { default as DialogTrigger } from './DialogTrigger.vue'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { useVModel } from '@vueuse/core'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
defaultValue?: string | number
|
|
8
|
+
modelValue?: string | number
|
|
9
|
+
class?: HTMLAttributes['class']
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(e: 'update:modelValue', payload: string | number): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const modelValue = useVModel(props, 'modelValue', emits, {
|
|
17
|
+
passive: true,
|
|
18
|
+
defaultValue: props.defaultValue,
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<input
|
|
24
|
+
v-model="modelValue"
|
|
25
|
+
:class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)"
|
|
26
|
+
>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from './Input.vue'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Label
|
|
3
|
+
v-bind="delegatedProps"
|
|
4
|
+
:class="
|
|
5
|
+
cn(
|
|
6
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
7
|
+
props.class,
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
</Label>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { Label, type LabelProps } from 'reka-ui'
|
|
17
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
18
|
+
import { cn } from '@/lib/utils'
|
|
19
|
+
|
|
20
|
+
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
|
|
21
|
+
|
|
22
|
+
const delegatedProps = computed(() => {
|
|
23
|
+
const { class: _, ...delegated } = props
|
|
24
|
+
|
|
25
|
+
return delegated
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from './Label.vue'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NavigationMenuRoot
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
:class="cn('relative z-10 flex max-w-max flex-1 items-center justify-center', props.class)"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
<NavigationMenuViewport />
|
|
8
|
+
</NavigationMenuRoot>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import {
|
|
13
|
+
NavigationMenuRoot,
|
|
14
|
+
type NavigationMenuRootEmits,
|
|
15
|
+
type NavigationMenuRootProps,
|
|
16
|
+
useForwardPropsEmits,
|
|
17
|
+
} from 'reka-ui'
|
|
18
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
19
|
+
import NavigationMenuViewport from './NavigationMenuViewport.vue'
|
|
20
|
+
import { cn } from '@/lib/utils'
|
|
21
|
+
|
|
22
|
+
const props = defineProps<NavigationMenuRootProps & { class?: HTMLAttributes['class'] }>()
|
|
23
|
+
|
|
24
|
+
const emits = defineEmits<NavigationMenuRootEmits>()
|
|
25
|
+
|
|
26
|
+
const delegatedProps = computed(() => {
|
|
27
|
+
const { class: _, ...delegated } = props
|
|
28
|
+
|
|
29
|
+
return delegated
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NavigationMenuContent
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
:class="cn(
|
|
5
|
+
'left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto',
|
|
6
|
+
props.class,
|
|
7
|
+
)"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</NavigationMenuContent>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import {
|
|
15
|
+
NavigationMenuContent,
|
|
16
|
+
type NavigationMenuContentEmits,
|
|
17
|
+
type NavigationMenuContentProps,
|
|
18
|
+
useForwardPropsEmits,
|
|
19
|
+
} from 'reka-ui'
|
|
20
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
21
|
+
import { cn } from '@/lib/utils'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<NavigationMenuContentProps & { class?: HTMLAttributes['class'] }>()
|
|
24
|
+
|
|
25
|
+
const emits = defineEmits<NavigationMenuContentEmits>()
|
|
26
|
+
|
|
27
|
+
const delegatedProps = computed(() => {
|
|
28
|
+
const { class: _, ...delegated } = props
|
|
29
|
+
|
|
30
|
+
return delegated
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { NavigationMenuIndicator, type NavigationMenuIndicatorProps, useForwardProps } from 'reka-ui'
|
|
3
|
+
import { computed, type HTMLAttributes } from 'vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<NavigationMenuIndicatorProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
|
|
8
|
+
const delegatedProps = computed(() => {
|
|
9
|
+
const { class: _, ...delegated } = props
|
|
10
|
+
|
|
11
|
+
return delegated
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<NavigationMenuIndicator
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
:class="cn('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', props.class)"
|
|
21
|
+
>
|
|
22
|
+
<div class="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
23
|
+
</NavigationMenuIndicator>
|
|
24
|
+
</template>
|