@lupinum/ginko-docs 0.2.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/LICENSE +21 -0
- package/README.md +112 -0
- package/app/app.config.ts +49 -0
- package/app/app.vue +71 -0
- package/app/assets/css/prose.css +1154 -0
- package/app/assets/css/tailwind.css +365 -0
- package/app/components/OgImage/GinkoDocs.satori.vue +117 -0
- package/app/components/content/DocumentPageShell.vue +55 -0
- package/app/components/content/Feedback.vue +97 -0
- package/app/components/content/PageMarkdownCopy.vue +102 -0
- package/app/components/mdc/MdcAccordion.vue +64 -0
- package/app/components/mdc/MdcAccordionItem.vue +51 -0
- package/app/components/mdc/MdcAlert.vue +34 -0
- package/app/components/mdc/MdcAside.vue +27 -0
- package/app/components/mdc/MdcCallout.vue +62 -0
- package/app/components/mdc/MdcCard.vue +186 -0
- package/app/components/mdc/MdcCardGroup.vue +47 -0
- package/app/components/mdc/MdcCenter.vue +71 -0
- package/app/components/mdc/MdcCodeGroup.vue +193 -0
- package/app/components/mdc/MdcColumn.vue +70 -0
- package/app/components/mdc/MdcDocImg.vue +25 -0
- package/app/components/mdc/MdcDropcap.vue +84 -0
- package/app/components/mdc/MdcError.vue +16 -0
- package/app/components/mdc/MdcField.vue +62 -0
- package/app/components/mdc/MdcFieldGroup.vue +18 -0
- package/app/components/mdc/MdcFigure.vue +51 -0
- package/app/components/mdc/MdcIdea.vue +16 -0
- package/app/components/mdc/MdcInfo.vue +16 -0
- package/app/components/mdc/MdcLayout.vue +57 -0
- package/app/components/mdc/MdcNote.vue +16 -0
- package/app/components/mdc/MdcPassage.vue +32 -0
- package/app/components/mdc/MdcQuiz.vue +281 -0
- package/app/components/mdc/MdcQuizOption.vue +91 -0
- package/app/components/mdc/MdcQuizQuestion.vue +226 -0
- package/app/components/mdc/MdcReadMore.vue +90 -0
- package/app/components/mdc/MdcReadMoreGroup.vue +18 -0
- package/app/components/mdc/MdcShortcut.vue +46 -0
- package/app/components/mdc/MdcStep.vue +42 -0
- package/app/components/mdc/MdcSteps.vue +25 -0
- package/app/components/mdc/MdcSuccess.vue +16 -0
- package/app/components/mdc/MdcTab.vue +17 -0
- package/app/components/mdc/MdcTabs.vue +132 -0
- package/app/components/mdc/MdcTimeline.vue +14 -0
- package/app/components/mdc/MdcTimelineItem.vue +49 -0
- package/app/components/mdc/MdcWarning.vue +16 -0
- package/app/components/mdc/icons.ts +10 -0
- package/app/components/prose/ProseA.vue +27 -0
- package/app/components/prose/ProseBlockquote.vue +14 -0
- package/app/components/prose/ProseCode.vue +14 -0
- package/app/components/prose/ProseEm.vue +14 -0
- package/app/components/prose/ProseH1.vue +18 -0
- package/app/components/prose/ProseH2.vue +24 -0
- package/app/components/prose/ProseH3.vue +24 -0
- package/app/components/prose/ProseH4.vue +14 -0
- package/app/components/prose/ProseHr.vue +12 -0
- package/app/components/prose/ProseImg.vue +120 -0
- package/app/components/prose/ProseLi.vue +14 -0
- package/app/components/prose/ProseOl.vue +14 -0
- package/app/components/prose/ProseP.vue +14 -0
- package/app/components/prose/ProsePre.vue +217 -0
- package/app/components/prose/ProseStrong.vue +14 -0
- package/app/components/prose/ProseTable.vue +16 -0
- package/app/components/prose/ProseTbody.vue +14 -0
- package/app/components/prose/ProseTd.vue +14 -0
- package/app/components/prose/ProseTh.vue +14 -0
- package/app/components/prose/ProseThead.vue +14 -0
- package/app/components/prose/ProseTr.vue +14 -0
- package/app/components/prose/ProseUl.vue +14 -0
- package/app/components/site/ModeToggle.vue +123 -0
- package/app/components/site/SiteBanner.vue +56 -0
- package/app/components/site/SiteFooter.vue +80 -0
- package/app/components/site/SiteHeader.vue +250 -0
- package/app/components/site/SiteInteractionLayer.vue +35 -0
- package/app/components/site/SiteLocaleSwitcher.vue +268 -0
- package/app/components/site/SiteLogoMark.vue +12 -0
- package/app/components/site/SiteSkipLink.vue +14 -0
- package/app/components/ui/accordion/Accordion.vue +15 -0
- package/app/components/ui/accordion/AccordionContent.vue +23 -0
- package/app/components/ui/accordion/AccordionItem.vue +24 -0
- package/app/components/ui/accordion/AccordionTrigger.vue +35 -0
- package/app/components/ui/accordion/index.ts +4 -0
- package/app/components/ui/alert/Alert.vue +21 -0
- package/app/components/ui/alert/AlertDescription.vue +22 -0
- package/app/components/ui/alert/AlertTitle.vue +22 -0
- package/app/components/ui/alert/index.ts +34 -0
- package/app/components/ui/badge/Badge.vue +28 -0
- package/app/components/ui/badge/index.ts +24 -0
- package/app/components/ui/button/Button.vue +31 -0
- package/app/components/ui/button/index.ts +35 -0
- package/app/components/ui/card/Card.vue +16 -0
- package/app/components/ui/card/CardAction.vue +17 -0
- package/app/components/ui/card/CardContent.vue +14 -0
- package/app/components/ui/card/CardDescription.vue +14 -0
- package/app/components/ui/card/CardFooter.vue +14 -0
- package/app/components/ui/card/CardHeader.vue +22 -0
- package/app/components/ui/card/CardTitle.vue +14 -0
- package/app/components/ui/card/card-variants.ts +15 -0
- package/app/components/ui/card/index.ts +8 -0
- package/app/components/ui/checkbox/Checkbox.vue +35 -0
- package/app/components/ui/checkbox/index.ts +1 -0
- package/app/components/ui/collapsible/Collapsible.vue +15 -0
- package/app/components/ui/collapsible/CollapsibleContent.vue +25 -0
- package/app/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/app/components/ui/collapsible/index.ts +3 -0
- package/app/components/ui/dialog/Dialog.vue +15 -0
- package/app/components/ui/dialog/DialogClose.vue +12 -0
- package/app/components/ui/dialog/DialogContent.vue +69 -0
- package/app/components/ui/dialog/DialogDescription.vue +21 -0
- package/app/components/ui/dialog/DialogFooter.vue +15 -0
- package/app/components/ui/dialog/DialogHeader.vue +12 -0
- package/app/components/ui/dialog/DialogOverlay.vue +26 -0
- package/app/components/ui/dialog/DialogPortal.vue +12 -0
- package/app/components/ui/dialog/DialogTitle.vue +21 -0
- package/app/components/ui/dialog/DialogTrigger.vue +12 -0
- package/app/components/ui/dialog/index.ts +10 -0
- package/app/components/ui/dropdown-menu/DropdownMenu.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +36 -0
- package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +40 -0
- package/app/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
- package/app/components/ui/dropdown-menu/DropdownMenuLabel.vue +25 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +37 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/app/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSub.vue +15 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubContent.vue +29 -0
- package/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/app/components/ui/dropdown-menu/index.ts +16 -0
- package/app/components/ui/input/Input.vue +23 -0
- package/app/components/ui/input/index.ts +1 -0
- package/app/components/ui/kbd/Kbd.vue +23 -0
- package/app/components/ui/kbd/KbdGroup.vue +14 -0
- package/app/components/ui/kbd/index.ts +22 -0
- package/app/components/ui/label/Label.vue +14 -0
- package/app/components/ui/label/index.ts +1 -0
- package/app/components/ui/scroll-area/ScrollArea.vue +39 -0
- package/app/components/ui/scroll-area/ScrollBar.vue +33 -0
- package/app/components/ui/scroll-area/index.ts +2 -0
- package/app/components/ui/separator/Separator.vue +27 -0
- package/app/components/ui/separator/index.ts +1 -0
- package/app/components/ui/sheet/Sheet.vue +15 -0
- package/app/components/ui/sheet/SheetClose.vue +12 -0
- package/app/components/ui/sheet/SheetContent.vue +59 -0
- package/app/components/ui/sheet/SheetDescription.vue +21 -0
- package/app/components/ui/sheet/SheetFooter.vue +12 -0
- package/app/components/ui/sheet/SheetHeader.vue +12 -0
- package/app/components/ui/sheet/SheetOverlay.vue +26 -0
- package/app/components/ui/sheet/SheetTitle.vue +21 -0
- package/app/components/ui/sheet/SheetTrigger.vue +12 -0
- package/app/components/ui/sheet/index.ts +8 -0
- package/app/components/ui/switch/Switch.vue +39 -0
- package/app/components/ui/switch/index.ts +1 -0
- package/app/components/ui/tabs/Tabs.vue +24 -0
- package/app/components/ui/tabs/TabsContent.vue +21 -0
- package/app/components/ui/tabs/TabsList.vue +26 -0
- package/app/components/ui/tabs/TabsTrigger.vue +28 -0
- package/app/components/ui/tabs/index.ts +4 -0
- package/app/components/ui/textarea/Textarea.vue +31 -0
- package/app/components/ui/textarea/index.ts +1 -0
- package/app/composables/site-navigation.utils.ts +80 -0
- package/app/composables/useCanonicalUrl.ts +9 -0
- package/app/composables/useContentRouteAlternates.ts +43 -0
- package/app/composables/useGinkoAnalytics.ts +37 -0
- package/app/composables/useGinkoDocsConfig.ts +6 -0
- package/app/composables/useGinkoOgImage.ts +20 -0
- package/app/composables/useLocalizedPath.ts +12 -0
- package/app/composables/useLocalizedRouteSwitch.ts +31 -0
- package/app/composables/usePageMarkdownActions.ts +79 -0
- package/app/composables/useSchemaJsonLd.ts +25 -0
- package/app/composables/useSiteNavigation.ts +86 -0
- package/app/config/site.utils.ts +36 -0
- package/app/error.vue +125 -0
- package/app/features/docs/components/DocsContributeLinks.vue +65 -0
- package/app/features/docs/components/DocsMobileToc.vue +104 -0
- package/app/features/docs/components/DocsPageContent.vue +188 -0
- package/app/features/docs/components/DocsPageNav.vue +57 -0
- package/app/features/docs/components/DocsSidebar.vue +129 -0
- package/app/features/docs/components/DocsSidebarDropdown.vue +70 -0
- package/app/features/docs/components/DocsSidebarItem.vue +169 -0
- package/app/features/docs/components/DocsSidebarList.vue +35 -0
- package/app/features/docs/components/DocsSidebarTabs.vue +35 -0
- package/app/features/docs/components/DocsToc.vue +60 -0
- package/app/features/docs/composables/useDocsEntryPath.ts +13 -0
- package/app/features/docs/composables/useDocsNavigation.ts +29 -0
- package/app/features/docs/composables/useDocsNavigationData.ts +15 -0
- package/app/features/docs/composables/useScrollspy.ts +67 -0
- package/app/features/docs/docs-navigation.ts +170 -0
- package/app/features/search/command-center.ts +156 -0
- package/app/features/search/components/SiteCommandCenter.vue +323 -0
- package/app/features/search/components/SiteSearchPageHighlight.vue +124 -0
- package/app/features/search/useCommandCenter.ts +300 -0
- package/app/layouts/blog.vue +15 -0
- package/app/layouts/default.vue +12 -0
- package/app/layouts/docs.vue +20 -0
- package/app/lib/errors.ts +84 -0
- package/app/lib/schema-org.ts +38 -0
- package/app/lib/utils.ts +7 -0
- package/app/pages/blog/[slug].vue +211 -0
- package/app/pages/blog/index.vue +106 -0
- package/app/pages/docs/[...slug].vue +10 -0
- package/app/pages/docs/index.vue +23 -0
- package/app/pages/index.vue +140 -0
- package/app/plugins/ssr-width.ts +6 -0
- package/app/utils/content.ts +56 -0
- package/app/utils/index.ts +1 -0
- package/components.ts +9 -0
- package/content.js +175 -0
- package/content.ts +148 -0
- package/i18n/i18n.config.ts +10 -0
- package/i18n/locales.ts +81 -0
- package/i18n/messages/global/banner.ts +8 -0
- package/i18n/messages/global/blog.ts +14 -0
- package/i18n/messages/global/command.ts +44 -0
- package/i18n/messages/global/docs.ts +32 -0
- package/i18n/messages/global/errors.ts +36 -0
- package/i18n/messages/global/feedback.ts +11 -0
- package/i18n/messages/global/index.ts +21 -0
- package/i18n/messages/global/nav.ts +18 -0
- package/i18n/messages/global/site.ts +4 -0
- package/i18n/messages/global/theme.ts +7 -0
- package/i18n/messages/index.ts +20 -0
- package/i18n/messages/localize.ts +35 -0
- package/i18n/messages/source.ts +5 -0
- package/i18n/routes.ts +33 -0
- package/icon-bundle.ts +141 -0
- package/index.d.ts +13 -0
- package/modules/feature-routing.ts +32 -0
- package/nuxt.config.ts +194 -0
- package/package.json +91 -0
- package/runtime/markdown/inline-code-highlight.ts +155 -0
- package/runtime/server/agent-markdown.ts +21 -0
- package/runtime/utils.ts +7 -0
- package/server/mcp/tools/get-page.ts +14 -0
- package/server/mcp/tools/list-pages.ts +10 -0
- package/server/plugins/agent-markdown.ts +6 -0
- package/shared/route-slugs.ts +5 -0
- package/shared/types/app-config.ts +100 -0
- package/tags.ts +204 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogPortalProps } from "reka-ui";
|
|
3
|
+
import { DialogPortal } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogPortalProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogPortal data-slot="dialog-portal" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogPortal>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTitleProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DialogTitle } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DialogTitleProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<DialogTitle
|
|
15
|
+
data-slot="dialog-title"
|
|
16
|
+
:class="cn('text-lg leading-none font-semibold tracking-tight', props.class)"
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</DialogTitle>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTriggerProps } from "reka-ui";
|
|
3
|
+
import { DialogTrigger } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogTrigger data-slot="dialog-trigger" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
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 DialogOverlay } from "./DialogOverlay.vue";
|
|
8
|
+
export { default as DialogPortal } from "./DialogPortal.vue";
|
|
9
|
+
export { default as DialogTitle } from "./DialogTitle.vue";
|
|
10
|
+
export { default as DialogTrigger } from "./DialogTrigger.vue";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from "reka-ui";
|
|
3
|
+
import { DropdownMenuRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuRootProps>();
|
|
6
|
+
const emits = defineEmits<DropdownMenuRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRoot v-slot="slotProps" data-slot="dropdown-menu" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</DropdownMenuRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuCheckboxItemEmits, DropdownMenuCheckboxItemProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuCheckboxItem, DropdownMenuItemIndicator, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuCheckboxItem
|
|
18
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
19
|
+
v-bind="forwarded"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
23
|
+
props.class,
|
|
24
|
+
)
|
|
25
|
+
"
|
|
26
|
+
>
|
|
27
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
28
|
+
<DropdownMenuItemIndicator>
|
|
29
|
+
<slot name="indicator-icon">
|
|
30
|
+
<Icon name="lucide:check" class="size-4" aria-hidden="true" />
|
|
31
|
+
</slot>
|
|
32
|
+
</DropdownMenuItemIndicator>
|
|
33
|
+
</span>
|
|
34
|
+
<slot />
|
|
35
|
+
</DropdownMenuCheckboxItem>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuContentEmits, DropdownMenuContentProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuContent, DropdownMenuPortal, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes["class"] }>(),
|
|
14
|
+
{
|
|
15
|
+
sideOffset: 4,
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
const emits = defineEmits<DropdownMenuContentEmits>();
|
|
19
|
+
|
|
20
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
21
|
+
|
|
22
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<DropdownMenuPortal>
|
|
27
|
+
<DropdownMenuContent
|
|
28
|
+
data-slot="dropdown-menu-content"
|
|
29
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
30
|
+
:class="
|
|
31
|
+
cn(
|
|
32
|
+
'z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
33
|
+
props.class,
|
|
34
|
+
)
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
<slot />
|
|
38
|
+
</DropdownMenuContent>
|
|
39
|
+
</DropdownMenuPortal>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuGroupProps } from "reka-ui";
|
|
3
|
+
import { DropdownMenuGroup } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuGroupProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DropdownMenuGroup data-slot="dropdown-menu-group" v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DropdownMenuGroup>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuItemProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuItem, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<
|
|
10
|
+
DropdownMenuItemProps & {
|
|
11
|
+
class?: HTMLAttributes["class"];
|
|
12
|
+
inset?: boolean;
|
|
13
|
+
variant?: "default" | "destructive";
|
|
14
|
+
}
|
|
15
|
+
>(),
|
|
16
|
+
{
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const delegatedProps = reactiveOmit(props, "inset", "variant", "class");
|
|
22
|
+
|
|
23
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<DropdownMenuItem
|
|
28
|
+
data-slot="dropdown-menu-item"
|
|
29
|
+
:data-inset="inset ? '' : undefined"
|
|
30
|
+
:data-variant="variant"
|
|
31
|
+
v-bind="forwardedProps"
|
|
32
|
+
:class="
|
|
33
|
+
cn(
|
|
34
|
+
'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 [&_svg:not([class*=\'text-\'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive',
|
|
35
|
+
props.class,
|
|
36
|
+
)
|
|
37
|
+
"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</DropdownMenuItem>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuLabelProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuLabel, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
DropdownMenuLabelProps & { class?: HTMLAttributes["class"]; inset?: boolean }
|
|
10
|
+
>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class", "inset");
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuLabel
|
|
18
|
+
data-slot="dropdown-menu-label"
|
|
19
|
+
:data-inset="inset ? '' : undefined"
|
|
20
|
+
v-bind="forwardedProps"
|
|
21
|
+
:class="cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', props.class)"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</DropdownMenuLabel>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioGroupEmits, DropdownMenuRadioGroupProps } from "reka-ui";
|
|
3
|
+
import { DropdownMenuRadioGroup, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuRadioGroupProps>();
|
|
6
|
+
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRadioGroup data-slot="dropdown-menu-radio-group" v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DropdownMenuRadioGroup>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioItemEmits, DropdownMenuRadioItemProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuItemIndicator, DropdownMenuRadioItem, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
|
|
10
|
+
const emits = defineEmits<DropdownMenuRadioItemEmits>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
13
|
+
|
|
14
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<DropdownMenuRadioItem
|
|
19
|
+
data-slot="dropdown-menu-radio-item"
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
:class="
|
|
22
|
+
cn(
|
|
23
|
+
'relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4',
|
|
24
|
+
props.class,
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
29
|
+
<DropdownMenuItemIndicator>
|
|
30
|
+
<slot name="indicator-icon">
|
|
31
|
+
<Icon name="lucide:circle" class="size-2 fill-current" aria-hidden="true" />
|
|
32
|
+
</slot>
|
|
33
|
+
</DropdownMenuItemIndicator>
|
|
34
|
+
</span>
|
|
35
|
+
<slot />
|
|
36
|
+
</DropdownMenuRadioItem>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSeparatorProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuSeparator } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
DropdownMenuSeparatorProps & {
|
|
10
|
+
class?: HTMLAttributes["class"];
|
|
11
|
+
}
|
|
12
|
+
>();
|
|
13
|
+
|
|
14
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<DropdownMenuSeparator
|
|
19
|
+
data-slot="dropdown-menu-separator"
|
|
20
|
+
v-bind="delegatedProps"
|
|
21
|
+
:class="cn('-mx-1 my-1 h-px bg-border', props.class)"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span
|
|
12
|
+
data-slot="dropdown-menu-shortcut"
|
|
13
|
+
:class="cn('ml-auto text-xs tracking-widest text-muted-foreground', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</span>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubEmits, DropdownMenuSubProps } from "reka-ui";
|
|
3
|
+
import { DropdownMenuSub, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuSubProps>();
|
|
6
|
+
const emits = defineEmits<DropdownMenuSubEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuSub v-slot="slotProps" data-slot="dropdown-menu-sub" v-bind="forwarded">
|
|
13
|
+
<slot v-bind="slotProps" />
|
|
14
|
+
</DropdownMenuSub>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubContentEmits, DropdownMenuSubContentProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuSubContent, useForwardPropsEmits } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes["class"] }>();
|
|
9
|
+
const emits = defineEmits<DropdownMenuSubContentEmits>();
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuSubContent
|
|
18
|
+
data-slot="dropdown-menu-sub-content"
|
|
19
|
+
v-bind="forwarded"
|
|
20
|
+
:class="
|
|
21
|
+
cn(
|
|
22
|
+
'z-50 min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
|
23
|
+
props.class,
|
|
24
|
+
)
|
|
25
|
+
"
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</DropdownMenuSubContent>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuSubTriggerProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { DropdownMenuSubTrigger, useForwardProps } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
DropdownMenuSubTriggerProps & { class?: HTMLAttributes["class"]; inset?: boolean }
|
|
10
|
+
>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class", "inset");
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuSubTrigger
|
|
18
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
:data-inset="inset ? '' : undefined"
|
|
21
|
+
:class="
|
|
22
|
+
cn(
|
|
23
|
+
'relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 [&_svg:not([class*=\'text-\'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive',
|
|
24
|
+
props.class,
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
<Icon name="lucide:chevron-right" class="ml-auto size-4" aria-hidden="true" />
|
|
30
|
+
</DropdownMenuSubTrigger>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuTriggerProps } from "reka-ui";
|
|
3
|
+
import { DropdownMenuTrigger, useForwardProps } from "reka-ui";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuTriggerProps>();
|
|
6
|
+
|
|
7
|
+
const forwardedProps = useForwardProps(props);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<DropdownMenuTrigger data-slot="dropdown-menu-trigger" v-bind="forwardedProps">
|
|
12
|
+
<slot />
|
|
13
|
+
</DropdownMenuTrigger>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as DropdownMenu } from "./DropdownMenu.vue";
|
|
2
|
+
|
|
3
|
+
export { default as DropdownMenuCheckboxItem } from "./DropdownMenuCheckboxItem.vue";
|
|
4
|
+
export { default as DropdownMenuContent } from "./DropdownMenuContent.vue";
|
|
5
|
+
export { default as DropdownMenuGroup } from "./DropdownMenuGroup.vue";
|
|
6
|
+
export { default as DropdownMenuItem } from "./DropdownMenuItem.vue";
|
|
7
|
+
export { default as DropdownMenuLabel } from "./DropdownMenuLabel.vue";
|
|
8
|
+
export { default as DropdownMenuRadioGroup } from "./DropdownMenuRadioGroup.vue";
|
|
9
|
+
export { default as DropdownMenuRadioItem } from "./DropdownMenuRadioItem.vue";
|
|
10
|
+
export { default as DropdownMenuSeparator } from "./DropdownMenuSeparator.vue";
|
|
11
|
+
export { default as DropdownMenuShortcut } from "./DropdownMenuShortcut.vue";
|
|
12
|
+
export { default as DropdownMenuSub } from "./DropdownMenuSub.vue";
|
|
13
|
+
export { default as DropdownMenuSubContent } from "./DropdownMenuSubContent.vue";
|
|
14
|
+
export { default as DropdownMenuSubTrigger } from "./DropdownMenuSubTrigger.vue";
|
|
15
|
+
export { default as DropdownMenuTrigger } from "./DropdownMenuTrigger.vue";
|
|
16
|
+
export { DropdownMenuPortal } from "reka-ui";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
4
|
+
|
|
5
|
+
const model = defineModel<string | number>();
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes["class"];
|
|
9
|
+
}>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<input
|
|
14
|
+
v-model="model"
|
|
15
|
+
data-slot="input"
|
|
16
|
+
:class="
|
|
17
|
+
cn(
|
|
18
|
+
'min-h-11 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
|
|
19
|
+
props.class,
|
|
20
|
+
)
|
|
21
|
+
"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Input } from "./Input.vue";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<kbd
|
|
12
|
+
:class="
|
|
13
|
+
cn(
|
|
14
|
+
'pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none',
|
|
15
|
+
'[&_svg:not([class*=\'size-\'])]:size-3',
|
|
16
|
+
'[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10',
|
|
17
|
+
props.class,
|
|
18
|
+
)
|
|
19
|
+
"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</kbd>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<kbd data-slot="kbd-group" :class="cn('inline-flex items-center gap-1', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</kbd>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
export { default as Kbd } from "./Kbd.vue";
|
|
5
|
+
export { default as KbdGroup } from "./KbdGroup.vue";
|
|
6
|
+
|
|
7
|
+
export const kbdVariants = cva(
|
|
8
|
+
"bg-muted text-muted-foreground ring-1 ring-border pointer-events-none inline-flex w-fit items-center justify-center gap-1 rounded-sm font-sans font-medium select-none [&_svg:not([class*='size-'])]:size-3 [[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
sm: "h-5 min-w-5 px-1 text-xs",
|
|
13
|
+
md: "h-7 min-w-7 px-1.5 text-sm",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
size: "sm",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export type KbdVariants = VariantProps<typeof kbdVariants>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue";
|
|
3
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"];
|
|
7
|
+
}>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<label data-slot="label" :class="cn('text-sm font-medium text-foreground', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</label>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from "./Label.vue";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ScrollAreaRootProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
import ScrollBar from "./ScrollBar.vue";
|
|
8
|
+
|
|
9
|
+
const props = defineProps<
|
|
10
|
+
ScrollAreaRootProps & {
|
|
11
|
+
class?: HTMLAttributes["class"];
|
|
12
|
+
viewportClass?: HTMLAttributes["class"];
|
|
13
|
+
}
|
|
14
|
+
>();
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, "class", "viewportClass");
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<ScrollAreaRoot
|
|
21
|
+
data-slot="scroll-area"
|
|
22
|
+
v-bind="delegatedProps"
|
|
23
|
+
:class="cn('relative', props.class)"
|
|
24
|
+
>
|
|
25
|
+
<ScrollAreaViewport
|
|
26
|
+
data-slot="scroll-area-viewport"
|
|
27
|
+
:class="
|
|
28
|
+
cn(
|
|
29
|
+
'size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1',
|
|
30
|
+
props.viewportClass,
|
|
31
|
+
)
|
|
32
|
+
"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</ScrollAreaViewport>
|
|
36
|
+
<ScrollBar />
|
|
37
|
+
<ScrollAreaCorner />
|
|
38
|
+
</ScrollAreaRoot>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ScrollAreaScrollbarProps } from "reka-ui";
|
|
3
|
+
import type { HTMLAttributes } from "vue";
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
5
|
+
import { ScrollAreaScrollbar, ScrollAreaThumb } from "reka-ui";
|
|
6
|
+
import { cn } from "#ginko-docs/lib/utils";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes["class"] }>(),
|
|
10
|
+
{
|
|
11
|
+
orientation: "vertical",
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<ScrollAreaScrollbar
|
|
20
|
+
data-slot="scroll-area-scrollbar"
|
|
21
|
+
v-bind="delegatedProps"
|
|
22
|
+
:class="
|
|
23
|
+
cn(
|
|
24
|
+
'flex touch-none p-px transition-colors select-none',
|
|
25
|
+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
|
|
26
|
+
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',
|
|
27
|
+
props.class,
|
|
28
|
+
)
|
|
29
|
+
"
|
|
30
|
+
>
|
|
31
|
+
<ScrollAreaThumb data-slot="scroll-area-thumb" class="relative flex-1 rounded-full bg-border" />
|
|
32
|
+
</ScrollAreaScrollbar>
|
|
33
|
+
</template>
|