@baybreezy/docd 0.0.1
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/app/app.config.ts +239 -0
- package/app/app.vue +19 -0
- package/app/assets/css/tailwind.css +335 -0
- package/app/assets/css/theme.css +1171 -0
- package/app/components/OgImage/Docs.takumi.vue +69 -0
- package/app/components/OgImage/Landing.takumi.vue +64 -0
- package/app/components/OgImage/Site.takumi.vue +32 -0
- package/app/components/Ui/Avatar/Avatar.vue +75 -0
- package/app/components/Ui/Avatar/Badge.vue +34 -0
- package/app/components/Ui/Avatar/Fallback.vue +30 -0
- package/app/components/Ui/Avatar/Group.vue +29 -0
- package/app/components/Ui/Avatar/GroupCount.vue +29 -0
- package/app/components/Ui/Avatar/Image.vue +29 -0
- package/app/components/Ui/Badge.vue +86 -0
- package/app/components/Ui/BadgeGroup.vue +314 -0
- package/app/components/Ui/BgPattern/Grid.vue +137 -0
- package/app/components/Ui/BorderBeam.vue +97 -0
- package/app/components/Ui/Breadcrumbs.vue +103 -0
- package/app/components/Ui/Button.vue +169 -0
- package/app/components/Ui/ButtonGroup/ButtonGroup.vue +54 -0
- package/app/components/Ui/ButtonGroup/Separator.vue +38 -0
- package/app/components/Ui/ButtonGroup/Text.vue +33 -0
- package/app/components/Ui/Card/Action.vue +31 -0
- package/app/components/Ui/Card/Card.vue +58 -0
- package/app/components/Ui/Card/Content.vue +34 -0
- package/app/components/Ui/Card/Description.vue +36 -0
- package/app/components/Ui/Card/Footer.vue +31 -0
- package/app/components/Ui/Card/Header.vue +31 -0
- package/app/components/Ui/Card/Title.vue +37 -0
- package/app/components/Ui/Collapsible/Collapsible.vue +16 -0
- package/app/components/Ui/Collapsible/Content.vue +27 -0
- package/app/components/Ui/Collapsible/Trigger.vue +13 -0
- package/app/components/Ui/Command/Command.vue +115 -0
- package/app/components/Ui/Command/Dialog.vue +65 -0
- package/app/components/Ui/Command/Empty.vue +32 -0
- package/app/components/Ui/Command/Footer.vue +40 -0
- package/app/components/Ui/Command/Group.vue +58 -0
- package/app/components/Ui/Command/Input.vue +57 -0
- package/app/components/Ui/Command/Item.vue +102 -0
- package/app/components/Ui/Command/List.vue +33 -0
- package/app/components/Ui/Command/Separator.vue +30 -0
- package/app/components/Ui/Command/Shortcut.vue +28 -0
- package/app/components/Ui/Container.vue +46 -0
- package/app/components/Ui/ContextMenu/Arrow.vue +43 -0
- package/app/components/Ui/ContextMenu/CheckboxItem.vue +42 -0
- package/app/components/Ui/ContextMenu/Content.vue +53 -0
- package/app/components/Ui/ContextMenu/ContextMenu.vue +14 -0
- package/app/components/Ui/ContextMenu/Group.vue +12 -0
- package/app/components/Ui/ContextMenu/Item.vue +65 -0
- package/app/components/Ui/ContextMenu/ItemIndicator.vue +30 -0
- package/app/components/Ui/ContextMenu/Label.vue +35 -0
- package/app/components/Ui/ContextMenu/Portal.vue +12 -0
- package/app/components/Ui/ContextMenu/RadioGroup.vue +16 -0
- package/app/components/Ui/ContextMenu/RadioItem.vue +40 -0
- package/app/components/Ui/ContextMenu/Separator.vue +25 -0
- package/app/components/Ui/ContextMenu/Shortcut.vue +30 -0
- package/app/components/Ui/ContextMenu/Sub.vue +15 -0
- package/app/components/Ui/ContextMenu/SubContent.vue +55 -0
- package/app/components/Ui/ContextMenu/SubTrigger.vue +42 -0
- package/app/components/Ui/ContextMenu/Trigger.vue +12 -0
- package/app/components/Ui/Dialog/Close.vue +12 -0
- package/app/components/Ui/Dialog/Content.vue +79 -0
- package/app/components/Ui/Dialog/Description.vue +29 -0
- package/app/components/Ui/Dialog/Dialog.vue +14 -0
- package/app/components/Ui/Dialog/Footer.vue +32 -0
- package/app/components/Ui/Dialog/Header.vue +32 -0
- package/app/components/Ui/Dialog/Overlay.vue +25 -0
- package/app/components/Ui/Dialog/Portal.vue +12 -0
- package/app/components/Ui/Dialog/Title.vue +29 -0
- package/app/components/Ui/Dialog/Trigger.vue +12 -0
- package/app/components/Ui/Divider.vue +102 -0
- package/app/components/Ui/Drawer/Close.vue +12 -0
- package/app/components/Ui/Drawer/Content.vue +67 -0
- package/app/components/Ui/Drawer/Description.vue +33 -0
- package/app/components/Ui/Drawer/Drawer.vue +17 -0
- package/app/components/Ui/Drawer/Footer.vue +35 -0
- package/app/components/Ui/Drawer/Header.vue +34 -0
- package/app/components/Ui/Drawer/Overlay.vue +20 -0
- package/app/components/Ui/Drawer/Portal.vue +12 -0
- package/app/components/Ui/Drawer/Title.vue +35 -0
- package/app/components/Ui/Drawer/Trigger.vue +12 -0
- package/app/components/Ui/DropdownMenu/Arrow.vue +43 -0
- package/app/components/Ui/DropdownMenu/CheckboxItem.vue +41 -0
- package/app/components/Ui/DropdownMenu/Content.vue +56 -0
- package/app/components/Ui/DropdownMenu/DropdownMenu.vue +15 -0
- package/app/components/Ui/DropdownMenu/Group.vue +12 -0
- package/app/components/Ui/DropdownMenu/Item.vue +64 -0
- package/app/components/Ui/DropdownMenu/ItemIndicator.vue +32 -0
- package/app/components/Ui/DropdownMenu/Label.vue +34 -0
- package/app/components/Ui/DropdownMenu/Portal.vue +12 -0
- package/app/components/Ui/DropdownMenu/RadioGroup.vue +16 -0
- package/app/components/Ui/DropdownMenu/RadioItem.vue +40 -0
- package/app/components/Ui/DropdownMenu/Separator.vue +25 -0
- package/app/components/Ui/DropdownMenu/Shortcut.vue +44 -0
- package/app/components/Ui/DropdownMenu/Sub.vue +14 -0
- package/app/components/Ui/DropdownMenu/SubContent.vue +56 -0
- package/app/components/Ui/DropdownMenu/SubTrigger.vue +47 -0
- package/app/components/Ui/DropdownMenu/Trigger.vue +12 -0
- package/app/components/Ui/FancyIcon.vue +243 -0
- package/app/components/Ui/GradientDivider.vue +26 -0
- package/app/components/Ui/IframeLazy.vue +97 -0
- package/app/components/Ui/Input.vue +97 -0
- package/app/components/Ui/InputGroup/Addon.vue +66 -0
- package/app/components/Ui/InputGroup/Button.vue +50 -0
- package/app/components/Ui/InputGroup/Input.vue +25 -0
- package/app/components/Ui/InputGroup/InputGroup.vue +44 -0
- package/app/components/Ui/InputGroup/Text.vue +33 -0
- package/app/components/Ui/InputGroup/Textarea.vue +25 -0
- package/app/components/Ui/Kbd/Group.vue +32 -0
- package/app/components/Ui/Kbd/Kbd.vue +62 -0
- package/app/components/Ui/Label.vue +40 -0
- package/app/components/Ui/Popover/Anchor.vue +13 -0
- package/app/components/Ui/Popover/Arrow.vue +42 -0
- package/app/components/Ui/Popover/Close.vue +13 -0
- package/app/components/Ui/Popover/Content.vue +55 -0
- package/app/components/Ui/Popover/Popover.vue +15 -0
- package/app/components/Ui/Popover/Portal.vue +13 -0
- package/app/components/Ui/Popover/Trigger.vue +12 -0
- package/app/components/Ui/Popover/X.vue +38 -0
- package/app/components/Ui/ScrollArea/Corner.vue +12 -0
- package/app/components/Ui/ScrollArea/ScrollArea.vue +38 -0
- package/app/components/Ui/ScrollArea/Scrollbar.vue +39 -0
- package/app/components/Ui/ScrollArea/Thumb.vue +39 -0
- package/app/components/Ui/ScrollArea/Viewport.vue +27 -0
- package/app/components/Ui/Scrollspy.vue +61 -0
- package/app/components/Ui/Separator.vue +40 -0
- package/app/components/Ui/Skeleton.vue +39 -0
- package/app/components/Ui/Sonner.vue +25 -0
- package/app/components/Ui/Tabs/Content.vue +27 -0
- package/app/components/Ui/Tabs/Indicator.vue +37 -0
- package/app/components/Ui/Tabs/List.vue +37 -0
- package/app/components/Ui/Tabs/Tabs.vue +25 -0
- package/app/components/Ui/Tabs/Trigger.vue +41 -0
- package/app/components/Ui/Textarea.vue +81 -0
- package/app/components/Ui/Tooltip/Arrow.vue +30 -0
- package/app/components/Ui/Tooltip/Content.vue +50 -0
- package/app/components/Ui/Tooltip/Portal.vue +12 -0
- package/app/components/Ui/Tooltip/Provider.vue +14 -0
- package/app/components/Ui/Tooltip/Tooltip.vue +25 -0
- package/app/components/Ui/Tooltip/Trigger.vue +12 -0
- package/app/components/Ui/Tree/Item.vue +15 -0
- package/app/components/Ui/Tree/Tree.vue +15 -0
- package/app/components/Ui/Tree/Virtualizer.vue +13 -0
- package/app/components/component-api/ComponentApiSection.vue +135 -0
- package/app/components/content/docs/Callout/DocsCallout.vue +99 -0
- package/app/components/content/prose/ProseA.global.vue +31 -0
- package/app/components/content/prose/ProseBlockquote.global.vue +28 -0
- package/app/components/content/prose/ProseCallout.global.vue +306 -0
- package/app/components/content/prose/ProseCard.global.vue +100 -0
- package/app/components/content/prose/ProseCodeCollapse.global.vue +125 -0
- package/app/components/content/prose/ProseCodeCopy.global.vue +67 -0
- package/app/components/content/prose/ProseCodeGroup.global.vue +104 -0
- package/app/components/content/prose/ProseCodeTree.global.vue +277 -0
- package/app/components/content/prose/ProseCollapsible.global.vue +64 -0
- package/app/components/content/prose/ProseColorModeImage.global.vue +58 -0
- package/app/components/content/prose/ProseComponentApi.global.vue +104 -0
- package/app/components/content/prose/ProseComponentEvents.global.vue +27 -0
- package/app/components/content/prose/ProseComponentExposed.global.vue +27 -0
- package/app/components/content/prose/ProseComponentProps.global.vue +27 -0
- package/app/components/content/prose/ProseComponentSlots.global.vue +27 -0
- package/app/components/content/prose/ProseEm.global.vue +5 -0
- package/app/components/content/prose/ProseField.global.vue +118 -0
- package/app/components/content/prose/ProseFieldGroup.global.vue +62 -0
- package/app/components/content/prose/ProseH1.global.vue +58 -0
- package/app/components/content/prose/ProseH2.global.vue +58 -0
- package/app/components/content/prose/ProseH3.global.vue +58 -0
- package/app/components/content/prose/ProseH4.global.vue +58 -0
- package/app/components/content/prose/ProseH5.global.vue +47 -0
- package/app/components/content/prose/ProseH6.global.vue +47 -0
- package/app/components/content/prose/ProseHr.global.vue +33 -0
- package/app/components/content/prose/ProseIconList.global.vue +113 -0
- package/app/components/content/prose/ProseImg.global.vue +119 -0
- package/app/components/content/prose/ProseLead.global.vue +28 -0
- package/app/components/content/prose/ProseLi.global.vue +25 -0
- package/app/components/content/prose/ProseMermaid.global.vue +127 -0
- package/app/components/content/prose/ProseOl.global.vue +25 -0
- package/app/components/content/prose/ProseP.global.vue +25 -0
- package/app/components/content/prose/ProsePmInstall.global.vue +60 -0
- package/app/components/content/prose/ProsePmRun.global.vue +51 -0
- package/app/components/content/prose/ProsePmX.global.vue +56 -0
- package/app/components/content/prose/ProsePre.global.vue +181 -0
- package/app/components/content/prose/ProseShowCase.global.vue +56 -0
- package/app/components/content/prose/ProseSmartIcon.global.vue +54 -0
- package/app/components/content/prose/ProseStep.global.vue +22 -0
- package/app/components/content/prose/ProseSteps.global.vue +22 -0
- package/app/components/content/prose/ProseStrong.global.vue +34 -0
- package/app/components/content/prose/ProseTable.global.vue +34 -0
- package/app/components/content/prose/ProseTabs.global.vue +104 -0
- package/app/components/content/prose/ProseTabsInner.global.vue +274 -0
- package/app/components/content/prose/ProseTbody.global.vue +5 -0
- package/app/components/content/prose/ProseTd.global.vue +25 -0
- package/app/components/content/prose/ProseTh.global.vue +25 -0
- package/app/components/content/prose/ProseThead.global.vue +9 -0
- package/app/components/content/prose/ProseTr.global.vue +35 -0
- package/app/components/content/prose/ProseUl.global.vue +25 -0
- package/app/components/docs/DocsExtraStuff.vue +39 -0
- package/app/components/docs/DocsGithubLink.vue +11 -0
- package/app/components/docs/DocsHeader.vue +3 -0
- package/app/components/docs/DocsLogo.vue +74 -0
- package/app/components/docs/DocsMobileBar.vue +26 -0
- package/app/components/docs/DocsMobileNav.vue +49 -0
- package/app/components/docs/DocsNav.vue +161 -0
- package/app/components/docs/DocsPageTransition.vue +32 -0
- package/app/components/docs/DocsSearch.vue +220 -0
- package/app/components/docs/DocsSearchButton.vue +20 -0
- package/app/components/docs/DocsThemeCustomizer.vue +229 -0
- package/app/components/docs/DocsThemeToggler.vue +98 -0
- package/app/components/docs/DocsTocRail.vue +162 -0
- package/app/components/docs/DocsToclink.vue +52 -0
- package/app/components/docs/DocsZigZagRail.vue +70 -0
- package/app/components/landing/Hero.vue +222 -0
- package/app/components/page/PageFooter.vue +49 -0
- package/app/components/page/PageHeader.vue +68 -0
- package/app/components/page/PageHeaderLinks.vue +138 -0
- package/app/components/page/PageMobileToc.vue +162 -0
- package/app/components/page/PageToc.vue +33 -0
- package/app/composables/useDefaultSlotItems.ts +90 -0
- package/app/composables/useDocPage.ts +66 -0
- package/app/composables/useDocSearch.ts +23 -0
- package/app/composables/useDocd.ts +107 -0
- package/app/composables/useLogoAssets.ts +319 -0
- package/app/composables/usePm.ts +73 -0
- package/app/composables/useProseComponentMeta.ts +30 -0
- package/app/composables/useScrollspy.ts +327 -0
- package/app/composables/useSeo.ts +240 -0
- package/app/composables/useUIConfig.ts +36 -0
- package/app/layouts/default.vue +5 -0
- package/app/layouts/docs.vue +64 -0
- package/app/middleware/colorMode.global.ts +8 -0
- package/app/middleware/doc-page-layout.ts +11 -0
- package/app/middleware/landing-page-layout.ts +11 -0
- package/app/pages/[...slug].vue +63 -0
- package/app/plugins/mermaid.client.ts +35 -0
- package/app/plugins/navigation-direction.client.ts +15 -0
- package/app/plugins/theme-restore.client.ts +7 -0
- package/app/templates/landing.vue +40 -0
- package/app/transitions/presets.ts +71 -0
- package/app/types/prose-component-meta.d.ts +4 -0
- package/app/utils/og.ts +26 -0
- package/app/utils/prerender.ts +9 -0
- package/app/utils/translucent.ts +56 -0
- package/app/utils/tw-helper.ts +4 -0
- package/content.config.ts +81 -0
- package/index.d.ts +25 -0
- package/modules/config.ts +89 -0
- package/modules/custom-icons.ts +17 -0
- package/modules/markdown-rewrite.ts +96 -0
- package/modules/prose-component-meta.ts +150 -0
- package/modules/routing.ts +22 -0
- package/modules/skills/index.ts +167 -0
- package/modules/skills/runtime/server/routes/skills-files.ts +49 -0
- package/modules/skills/runtime/server/routes/skills-index.ts +8 -0
- package/nuxt.config.ts +96 -0
- package/nuxt.schema.ts +288 -0
- package/package.json +95 -0
- package/server/mcp/tools/get-page.ts +66 -0
- package/server/mcp/tools/list-pages.ts +61 -0
- package/server/routes/sitemap.xml.ts +73 -0
- package/server/utils/content.ts +3 -0
- package/tailwind.config.cjs +55 -0
- package/utils/component-api-content.ts +467 -0
- package/utils/component-api-discovery.ts +165 -0
- package/utils/component-api-schema.ts +28 -0
- package/utils/component-api.ts +243 -0
- package/utils/generate-prose-component-meta.ts +303 -0
- package/utils/git.ts +123 -0
- package/utils/meta.ts +40 -0
- package/utils/pages.ts +21 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuCheckboxItem
|
|
3
|
+
data-slot="context-menu-checkbox-item"
|
|
4
|
+
v-bind="forwarded"
|
|
5
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
6
|
+
>
|
|
7
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
8
|
+
<UiContextMenuItemIndicator icon="lucide:check" />
|
|
9
|
+
</span>
|
|
10
|
+
<slot>
|
|
11
|
+
<span v-if="title">{{ title }}</span>
|
|
12
|
+
</slot>
|
|
13
|
+
<slot name="shortcut">
|
|
14
|
+
<UiContextMenuShortcut v-if="shortcut">{{ shortcut }}</UiContextMenuShortcut>
|
|
15
|
+
</slot>
|
|
16
|
+
</ContextMenuCheckboxItem>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" setup>
|
|
20
|
+
import { ContextMenuCheckboxItem, useForwardPropsEmits } from "reka-ui";
|
|
21
|
+
import type { ContextMenuCheckboxItemEmits, ContextMenuCheckboxItemProps } from "reka-ui";
|
|
22
|
+
import { normalizeClass } from "vue";
|
|
23
|
+
import type { HTMLAttributes } from "vue";
|
|
24
|
+
|
|
25
|
+
const props = defineProps<
|
|
26
|
+
ContextMenuCheckboxItemProps & {
|
|
27
|
+
/**Custom class(es) to add to the element */
|
|
28
|
+
class?: HTMLAttributes["class"];
|
|
29
|
+
/**The shortcut for the item */
|
|
30
|
+
shortcut?: string;
|
|
31
|
+
/**The title for the item */
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
>();
|
|
35
|
+
|
|
36
|
+
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
|
|
37
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class", "shortcut", "title"), emits);
|
|
38
|
+
|
|
39
|
+
const styles = tv({
|
|
40
|
+
base: "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",
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiContextMenuPortal>
|
|
3
|
+
<ContextMenuContent
|
|
4
|
+
data-slot="context-menu-content"
|
|
5
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
6
|
+
:class="
|
|
7
|
+
styles({
|
|
8
|
+
translucent: props.translucent,
|
|
9
|
+
class: normalizeClass(props.class) || undefined,
|
|
10
|
+
})
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</ContextMenuContent>
|
|
15
|
+
</UiContextMenuPortal>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ContextMenuContent, useForwardPropsEmits } from "reka-ui";
|
|
20
|
+
import type { ContextMenuContentEmits, ContextMenuContentProps } from "reka-ui";
|
|
21
|
+
import { normalizeClass } from "vue";
|
|
22
|
+
import type { HTMLAttributes } from "vue";
|
|
23
|
+
|
|
24
|
+
defineOptions({ inheritAttrs: false });
|
|
25
|
+
const props = withDefaults(
|
|
26
|
+
defineProps<
|
|
27
|
+
ContextMenuContentProps & {
|
|
28
|
+
/** Custom class(es) to add to the element */
|
|
29
|
+
class?: HTMLAttributes["class"];
|
|
30
|
+
/** Whether to render the content with a translucent surface */
|
|
31
|
+
translucent?: boolean;
|
|
32
|
+
}
|
|
33
|
+
>(),
|
|
34
|
+
{
|
|
35
|
+
loop: true,
|
|
36
|
+
avoidCollisions: true,
|
|
37
|
+
collisionPadding: 5,
|
|
38
|
+
sticky: "partial",
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const emits = defineEmits<ContextMenuContentEmits>();
|
|
43
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class", "translucent"), emits);
|
|
44
|
+
|
|
45
|
+
const styles = tv({
|
|
46
|
+
base: "z-50 max-h-(--reka-context-menu-content-available-height) min-w-[8rem] origin-(--reka-context-menu-content-transform-origin) overflow-visible 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",
|
|
47
|
+
variants: {
|
|
48
|
+
translucent: {
|
|
49
|
+
true: getTranslucentFloatingPanelClasses("popover"),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuRoot data-slot="context-menu" v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuRoot>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuRoot, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import type { ContextMenuRootEmits, ContextMenuRootProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuRootProps>();
|
|
12
|
+
const emit = defineEmits<ContextMenuRootEmits>();
|
|
13
|
+
const forwarded = useForwardPropsEmits(props, emit);
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuGroup data-slot="context-menu-group" v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuGroup>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuGroup } from "reka-ui";
|
|
9
|
+
import type { ContextMenuGroupProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuGroupProps>();
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuItem
|
|
3
|
+
data-slot="context-menu-item"
|
|
4
|
+
v-bind="forwarded"
|
|
5
|
+
:data-inset="inset"
|
|
6
|
+
:data-variant="variant"
|
|
7
|
+
:class="styles({ inset, class: normalizeClass(props.class) || undefined, variant })"
|
|
8
|
+
>
|
|
9
|
+
<slot>
|
|
10
|
+
<span v-if="title">{{ title }}</span>
|
|
11
|
+
</slot>
|
|
12
|
+
<slot name="shortcut">
|
|
13
|
+
<UiContextMenuShortcut v-if="shortcut">{{ shortcut }}</UiContextMenuShortcut>
|
|
14
|
+
</slot>
|
|
15
|
+
</ContextMenuItem>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ContextMenuItem, useForwardPropsEmits } from "reka-ui";
|
|
20
|
+
import type { ContextMenuItemEmits, ContextMenuItemProps } from "reka-ui";
|
|
21
|
+
import { normalizeClass } from "vue";
|
|
22
|
+
import type { HTMLAttributes } from "vue";
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(
|
|
25
|
+
defineProps<
|
|
26
|
+
ContextMenuItemProps & {
|
|
27
|
+
/**Custom class(es) to add to the element */
|
|
28
|
+
class?: HTMLAttributes["class"];
|
|
29
|
+
/** Wether an indentation should be added to the item or not */
|
|
30
|
+
inset?: boolean;
|
|
31
|
+
/** The shortcut for the item */
|
|
32
|
+
shortcut?: string;
|
|
33
|
+
/** The title for the item */
|
|
34
|
+
title?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The variant of the item.
|
|
37
|
+
*/
|
|
38
|
+
variant?: "default" | "destructive";
|
|
39
|
+
}
|
|
40
|
+
>(),
|
|
41
|
+
{
|
|
42
|
+
variant: "default",
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const emits = defineEmits<ContextMenuItemEmits>();
|
|
47
|
+
const forwarded = useForwardPropsEmits(
|
|
48
|
+
reactiveOmit(props, "class", "inset", "shortcut", "title"),
|
|
49
|
+
emits
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const styles = tv({
|
|
53
|
+
base: "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=true]: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!",
|
|
54
|
+
variants: {
|
|
55
|
+
inset: {
|
|
56
|
+
true: "pl-8",
|
|
57
|
+
},
|
|
58
|
+
variant: {
|
|
59
|
+
default: "",
|
|
60
|
+
destructive:
|
|
61
|
+
"text-destructive focus:bg-destructive/10 focus:text-destructive dark:focus:bg-destructive/20",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuItemIndicator
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
>
|
|
6
|
+
<slot>
|
|
7
|
+
<Icon v-if="icon" :name="icon" class="size-4" />
|
|
8
|
+
</slot>
|
|
9
|
+
</ContextMenuItemIndicator>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ContextMenuItemIndicator } from "reka-ui";
|
|
14
|
+
import type { ContextMenuItemIndicatorProps } from "reka-ui";
|
|
15
|
+
import { normalizeClass } from "vue";
|
|
16
|
+
import type { HTMLAttributes } from "vue";
|
|
17
|
+
|
|
18
|
+
const props = defineProps<
|
|
19
|
+
ContextMenuItemIndicatorProps & {
|
|
20
|
+
/** The icon to display */
|
|
21
|
+
icon?: string;
|
|
22
|
+
class?: HTMLAttributes["class"];
|
|
23
|
+
}
|
|
24
|
+
>();
|
|
25
|
+
const forwarded = reactiveOmit(props, "icon");
|
|
26
|
+
|
|
27
|
+
const styles = tv({
|
|
28
|
+
base: "flex items-center justify-center",
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuLabel
|
|
3
|
+
data-slot="context-menu-label"
|
|
4
|
+
:data-inset="inset"
|
|
5
|
+
:class="styles({ inset, class: normalizeClass(props.class) || undefined })"
|
|
6
|
+
v-bind="forwarded"
|
|
7
|
+
>
|
|
8
|
+
<slot>{{ label }}</slot>
|
|
9
|
+
</ContextMenuLabel>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { ContextMenuLabel } from "reka-ui";
|
|
14
|
+
import type { ContextMenuLabelProps } from "reka-ui";
|
|
15
|
+
import { normalizeClass } from "vue";
|
|
16
|
+
import type { HTMLAttributes } from "vue";
|
|
17
|
+
|
|
18
|
+
const props = defineProps<
|
|
19
|
+
ContextMenuLabelProps & {
|
|
20
|
+
/**Custom class(es) to add to the element */
|
|
21
|
+
class?: HTMLAttributes["class"];
|
|
22
|
+
/** Wether an indentation should be added to the item or not */
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
/** The label for the item */
|
|
25
|
+
label?: string;
|
|
26
|
+
}
|
|
27
|
+
>();
|
|
28
|
+
const forwarded = reactiveOmit(props, "class", "inset", "label");
|
|
29
|
+
const styles = tv({
|
|
30
|
+
base: "px-2 py-1.5 text-sm font-medium text-foreground data-[inset=true]:pl-8",
|
|
31
|
+
variants: {
|
|
32
|
+
inset: { true: "pl-8" },
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuPortal data-slot="context-menu-portal" v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuPortal>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuPortal } from "reka-ui";
|
|
9
|
+
import type { ContextMenuPortalProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuPortalProps>();
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuRadioGroup data-slot="context-menu-radio-group" v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuRadioGroup>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuRadioGroup, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import type { ContextMenuRadioGroupEmits, ContextMenuRadioGroupProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuRadioGroupProps>();
|
|
12
|
+
|
|
13
|
+
const emits = defineEmits<ContextMenuRadioGroupEmits>();
|
|
14
|
+
|
|
15
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuRadioItem
|
|
3
|
+
data-slot="context-menu-radio-item"
|
|
4
|
+
v-bind="forwarded"
|
|
5
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
6
|
+
>
|
|
7
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
8
|
+
<UiContextMenuItemIndicator>
|
|
9
|
+
<Icon v-if="icon" :name="icon" class="size-4" />
|
|
10
|
+
<Icon v-else name="ph:circle-fill" class="size-2" />
|
|
11
|
+
</UiContextMenuItemIndicator>
|
|
12
|
+
</span>
|
|
13
|
+
<slot>{{ title }}</slot>
|
|
14
|
+
</ContextMenuRadioItem>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { ContextMenuRadioItem, useForwardPropsEmits } from "reka-ui";
|
|
19
|
+
import type { ContextMenuRadioItemEmits, ContextMenuRadioItemProps } from "reka-ui";
|
|
20
|
+
import { normalizeClass } from "vue";
|
|
21
|
+
import type { HTMLAttributes } from "vue";
|
|
22
|
+
|
|
23
|
+
const props = defineProps<
|
|
24
|
+
ContextMenuRadioItemProps & {
|
|
25
|
+
/**Custom class(es) to add to the element */
|
|
26
|
+
class?: HTMLAttributes["class"];
|
|
27
|
+
/**The icon to display */
|
|
28
|
+
icon?: string;
|
|
29
|
+
/**The title for the item */
|
|
30
|
+
title?: string;
|
|
31
|
+
}
|
|
32
|
+
>();
|
|
33
|
+
|
|
34
|
+
const emits = defineEmits<ContextMenuRadioItemEmits>();
|
|
35
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class", "icon", "title"), emits);
|
|
36
|
+
|
|
37
|
+
const styles = tv({
|
|
38
|
+
base: "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",
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuSeparator
|
|
3
|
+
data-slot="context-menu-separator"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
v-bind="props"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { ContextMenuSeparator } from "reka-ui";
|
|
11
|
+
import type { ContextMenuSeparatorProps } from "reka-ui";
|
|
12
|
+
import { normalizeClass } from "vue";
|
|
13
|
+
import type { HTMLAttributes } from "vue";
|
|
14
|
+
|
|
15
|
+
const props = defineProps<
|
|
16
|
+
ContextMenuSeparatorProps & {
|
|
17
|
+
/**Custom class(es) to add to the element */
|
|
18
|
+
class?: HTMLAttributes["class"];
|
|
19
|
+
}
|
|
20
|
+
>();
|
|
21
|
+
|
|
22
|
+
const styles = tv({
|
|
23
|
+
base: "-mx-1 my-1 h-px bg-border",
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="context-menu-shortcut"
|
|
4
|
+
:as="as || 'span'"
|
|
5
|
+
:as-child="asChild"
|
|
6
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</Primitive>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { Primitive } from "reka-ui";
|
|
14
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
15
|
+
import { normalizeClass } from "vue";
|
|
16
|
+
import type { HTMLAttributes } from "vue";
|
|
17
|
+
|
|
18
|
+
const props = defineProps<
|
|
19
|
+
PrimitiveProps & {
|
|
20
|
+
/**
|
|
21
|
+
* The custom class(es) to add to the element
|
|
22
|
+
*/
|
|
23
|
+
class?: HTMLAttributes["class"];
|
|
24
|
+
}
|
|
25
|
+
>();
|
|
26
|
+
|
|
27
|
+
const styles = tv({
|
|
28
|
+
base: "ml-auto text-xs tracking-widest text-muted-foreground",
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuSub data-slot="context-menu-sub" v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuSub>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuSub, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import type { ContextMenuSubEmits, ContextMenuSubProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuSubProps>();
|
|
12
|
+
const emits = defineEmits<ContextMenuSubEmits>();
|
|
13
|
+
|
|
14
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiContextMenuPortal>
|
|
3
|
+
<ContextMenuSubContent
|
|
4
|
+
data-slot="context-menu-sub-content"
|
|
5
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
6
|
+
:class="
|
|
7
|
+
styles({
|
|
8
|
+
translucent: props.translucent,
|
|
9
|
+
class: normalizeClass(props.class) || undefined,
|
|
10
|
+
})
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</ContextMenuSubContent>
|
|
15
|
+
</UiContextMenuPortal>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { ContextMenuSubContent, useForwardPropsEmits } from "reka-ui";
|
|
20
|
+
import type { ContextMenuSubContentEmits, ContextMenuSubContentProps } from "reka-ui";
|
|
21
|
+
import { normalizeClass } from "vue";
|
|
22
|
+
import type { HTMLAttributes } from "vue";
|
|
23
|
+
|
|
24
|
+
defineOptions({ inheritAttrs: false });
|
|
25
|
+
|
|
26
|
+
const props = withDefaults(
|
|
27
|
+
defineProps<
|
|
28
|
+
ContextMenuSubContentProps & {
|
|
29
|
+
/**Custom class(es) to add to the element */
|
|
30
|
+
class?: HTMLAttributes["class"];
|
|
31
|
+
/** Whether to render the content with a translucent surface */
|
|
32
|
+
translucent?: boolean;
|
|
33
|
+
}
|
|
34
|
+
>(),
|
|
35
|
+
{
|
|
36
|
+
loop: true,
|
|
37
|
+
avoidCollisions: true,
|
|
38
|
+
collisionPadding: 8,
|
|
39
|
+
sticky: "partial",
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const emits = defineEmits<ContextMenuSubContentEmits>();
|
|
44
|
+
|
|
45
|
+
const styles = tv({
|
|
46
|
+
base: "z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-visible 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",
|
|
47
|
+
variants: {
|
|
48
|
+
translucent: {
|
|
49
|
+
true: getTranslucentFloatingPanelClasses("popover"),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const forwarded = useForwardPropsEmits(reactiveOmit(props, "class", "translucent"), emits);
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuSubTrigger
|
|
3
|
+
data-slot="context-menu-sub-trigger"
|
|
4
|
+
:data-inset="inset"
|
|
5
|
+
v-bind="forwarded"
|
|
6
|
+
:class="styles({ inset, class: normalizeClass(props.class) || undefined })"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
<span v-if="title">{{ title }}</span>
|
|
10
|
+
</slot>
|
|
11
|
+
<Icon class="ml-auto size-4" :name="icon || 'lucide:chevron-right'" />
|
|
12
|
+
</ContextMenuSubTrigger>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { ContextMenuSubTrigger } from "reka-ui";
|
|
17
|
+
import type { ContextMenuSubTriggerProps } from "reka-ui";
|
|
18
|
+
import { normalizeClass } from "vue";
|
|
19
|
+
import type { HTMLAttributes } from "vue";
|
|
20
|
+
|
|
21
|
+
const props = defineProps<
|
|
22
|
+
ContextMenuSubTriggerProps & {
|
|
23
|
+
/**Custom class(es) to add to the element */
|
|
24
|
+
class?: HTMLAttributes["class"];
|
|
25
|
+
/** Wether an indentation should be added to the item or not */
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
/** The icon to display */
|
|
28
|
+
icon?: string;
|
|
29
|
+
/** The title for the item */
|
|
30
|
+
title?: string;
|
|
31
|
+
}
|
|
32
|
+
>();
|
|
33
|
+
const forwarded = reactiveOmit(props, "class", "inset", "icon", "title");
|
|
34
|
+
const styles = tv({
|
|
35
|
+
base: "flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset=true]: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",
|
|
36
|
+
variants: {
|
|
37
|
+
inset: {
|
|
38
|
+
true: "pl-8",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContextMenuTrigger data-slot="context-menu-trigger" v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</ContextMenuTrigger>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { ContextMenuTrigger } from "reka-ui";
|
|
9
|
+
import type { ContextMenuTriggerProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<ContextMenuTriggerProps>();
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogClose data-slot="dialog-close" v-bind="props">
|
|
3
|
+
<slot />
|
|
4
|
+
</DialogClose>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { DialogClose } from "reka-ui";
|
|
9
|
+
import type { DialogCloseProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DialogCloseProps>();
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiDialogPortal :to="to">
|
|
3
|
+
<UiDialogOverlay />
|
|
4
|
+
<DialogContent
|
|
5
|
+
data-slot="dialog-content"
|
|
6
|
+
:class="
|
|
7
|
+
styles({
|
|
8
|
+
translucent: props.translucent,
|
|
9
|
+
class: normalizeClass(props.class) || undefined,
|
|
10
|
+
})
|
|
11
|
+
"
|
|
12
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
13
|
+
>
|
|
14
|
+
<slot>
|
|
15
|
+
<slot name="header">
|
|
16
|
+
<UiDialogHeader>
|
|
17
|
+
<slot name="title">
|
|
18
|
+
<UiDialogTitle v-if="title" :title="title" />
|
|
19
|
+
</slot>
|
|
20
|
+
<slot name="description">
|
|
21
|
+
<UiDialogDescription v-if="description" :description="description" />
|
|
22
|
+
</slot>
|
|
23
|
+
</UiDialogHeader>
|
|
24
|
+
</slot>
|
|
25
|
+
<slot name="content" />
|
|
26
|
+
<slot name="footer" />
|
|
27
|
+
</slot>
|
|
28
|
+
<slot name="close" />
|
|
29
|
+
<UiDialogClose
|
|
30
|
+
v-if="!hideClose"
|
|
31
|
+
class="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
32
|
+
>
|
|
33
|
+
<Icon name="lucide:x" class="size-4" />
|
|
34
|
+
<span class="sr-only">Close</span>
|
|
35
|
+
</UiDialogClose>
|
|
36
|
+
</DialogContent>
|
|
37
|
+
</UiDialogPortal>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script lang="ts" setup>
|
|
41
|
+
import { DialogContent, useForwardPropsEmits } from "reka-ui";
|
|
42
|
+
import type { DialogContentEmits, DialogContentProps } from "reka-ui";
|
|
43
|
+
import { normalizeClass } from "vue";
|
|
44
|
+
import type { HTMLAttributes } from "vue";
|
|
45
|
+
|
|
46
|
+
defineOptions({ inheritAttrs: false });
|
|
47
|
+
const props = defineProps<
|
|
48
|
+
DialogContentProps & {
|
|
49
|
+
/** Icon to display in the close button */
|
|
50
|
+
icon?: string;
|
|
51
|
+
/** Title text */
|
|
52
|
+
title?: string;
|
|
53
|
+
/** Description text */
|
|
54
|
+
description?: string;
|
|
55
|
+
/** Custom class(es) to add to the parent */
|
|
56
|
+
class?: HTMLAttributes["class"];
|
|
57
|
+
/** Whether to hide the close button */
|
|
58
|
+
hideClose?: boolean;
|
|
59
|
+
/** Where to render the dialog */
|
|
60
|
+
to?: string | HTMLElement;
|
|
61
|
+
/** Whether to render the content with a translucent surface */
|
|
62
|
+
translucent?: boolean;
|
|
63
|
+
}
|
|
64
|
+
>();
|
|
65
|
+
const emits = defineEmits<DialogContentEmits>();
|
|
66
|
+
const forwarded = useForwardPropsEmits(
|
|
67
|
+
reactiveOmit(props, "icon", "title", "description", "class", "hideClose", "to", "translucent"),
|
|
68
|
+
emits
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const styles = tv({
|
|
72
|
+
base: "fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border bg-background p-6 shadow-lg duration-200 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 sm:max-w-100",
|
|
73
|
+
variants: {
|
|
74
|
+
translucent: {
|
|
75
|
+
true: getTranslucentFloatingPanelClasses("background"),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogDescription
|
|
3
|
+
data-slot="dialog-description"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
v-bind="forwarded"
|
|
6
|
+
>
|
|
7
|
+
<slot>{{ description }}</slot>
|
|
8
|
+
</DialogDescription>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { DialogDescription } from "reka-ui";
|
|
13
|
+
import type { DialogDescriptionProps } from "reka-ui";
|
|
14
|
+
import { normalizeClass } from "vue";
|
|
15
|
+
import type { HTMLAttributes } from "vue";
|
|
16
|
+
|
|
17
|
+
const props = defineProps<
|
|
18
|
+
DialogDescriptionProps & {
|
|
19
|
+
/** Custom class(es) to add to the parent */
|
|
20
|
+
class?: HTMLAttributes["class"];
|
|
21
|
+
/** The description text */
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
>();
|
|
25
|
+
const forwarded = reactiveOmit(props, "class", "description");
|
|
26
|
+
const styles = tv({
|
|
27
|
+
base: "text-sm text-muted-foreground",
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogRoot data-slot="dialog" v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</DialogRoot>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { DialogRoot, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import type { DialogRootEmits, DialogRootProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DialogRootProps>();
|
|
12
|
+
const emit = defineEmits<DialogRootEmits>();
|
|
13
|
+
const forwarded = useForwardPropsEmits(props, emit);
|
|
14
|
+
</script>
|