@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,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="elementType"
|
|
4
|
+
:class="
|
|
5
|
+
buttonStyles({
|
|
6
|
+
hasIcon: !!icon,
|
|
7
|
+
disabled: disabled || loading,
|
|
8
|
+
variant: variant,
|
|
9
|
+
size: size,
|
|
10
|
+
class: normalizeClass(props.class) || undefined,
|
|
11
|
+
effect: props.effect,
|
|
12
|
+
})
|
|
13
|
+
"
|
|
14
|
+
:disabled="disabled || loading"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot name="iconLeft">
|
|
18
|
+
<div
|
|
19
|
+
v-if="icon && iconPlacement == 'left'"
|
|
20
|
+
class="flex w-0 translate-x-[0%] pr-0 opacity-0 transition-all duration-200 group-hover:w-5 group-hover:translate-x-[0%] group-hover:pr-2 group-hover:opacity-100"
|
|
21
|
+
>
|
|
22
|
+
<Icon :name="icon" class="size-4" />
|
|
23
|
+
</div>
|
|
24
|
+
</slot>
|
|
25
|
+
<slot name="loading">
|
|
26
|
+
<Icon v-if="loading" class="size-4 shrink-0" :name="loadingIcon" />
|
|
27
|
+
</slot>
|
|
28
|
+
<slot>
|
|
29
|
+
<span v-if="text">{{ text }}</span>
|
|
30
|
+
</slot>
|
|
31
|
+
<slot name="iconRight">
|
|
32
|
+
<div
|
|
33
|
+
v-if="icon && iconPlacement == 'right'"
|
|
34
|
+
class="flex w-0 translate-x-full pl-0 opacity-0 transition-all duration-200 group-hover:w-5 group-hover:translate-x-0 group-hover:pl-2 group-hover:opacity-100"
|
|
35
|
+
>
|
|
36
|
+
<Icon :name="icon" class="size-4" />
|
|
37
|
+
</div>
|
|
38
|
+
</slot>
|
|
39
|
+
</component>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
44
|
+
import { useForwardProps } from "reka-ui";
|
|
45
|
+
import { normalizeClass } from "vue";
|
|
46
|
+
import type { HtmlHTMLAttributes } from "vue";
|
|
47
|
+
|
|
48
|
+
import type { NuxtLinkProps } from "#app/components";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Exported button styles that can be used by other components
|
|
52
|
+
*/
|
|
53
|
+
export const buttonStyles = tv({
|
|
54
|
+
base: "group inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
58
|
+
destructive:
|
|
59
|
+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
60
|
+
outline:
|
|
61
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
62
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
63
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
64
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
65
|
+
},
|
|
66
|
+
effect: {
|
|
67
|
+
expandIcon: "group relative gap-0",
|
|
68
|
+
ringHover: "transition-all duration-300 hover:ring-3 hover:ring-ring/50",
|
|
69
|
+
shine:
|
|
70
|
+
"relative overflow-hidden bg-position-[0s_ease] before:absolute before:inset-0 before:animate-shine before:rounded-[inherit] before:bg-[linear-gradient(45deg,transparent_25%,rgba(255,255,255,0.5)_50%,transparent_75%,transparent_100%)] before:bg-size-[250%_250%,100%_100%] before:bg-no-repeat",
|
|
71
|
+
shineHover:
|
|
72
|
+
"relative overflow-hidden before:absolute before:inset-0 before:rounded-[inherit] before:bg-[linear-gradient(45deg,transparent_25%,rgba(255,255,255,0.5)_50%,transparent_75%,transparent_100%)] before:bg-size-[250%_250%,100%_100%] before:bg-position-[200%_0,0_0] before:bg-no-repeat before:transition-[background-position_0s_ease] before:duration-1000 hover:before:bg-position-[-100%_0,0_0]",
|
|
73
|
+
gooeyRight:
|
|
74
|
+
"relative z-0 overflow-hidden duration-500 before:absolute before:inset-0 before:-z-10 before:translate-x-[150%] before:translate-y-[150%] before:scale-[2.5] before:rounded-[100%] before:bg-linear-to-r before:from-white/40 before:transition-transform before:duration-1000 hover:before:translate-x-[0%] hover:before:translate-y-[0%]",
|
|
75
|
+
gooeyLeft:
|
|
76
|
+
"relative z-0 overflow-hidden duration-500 after:absolute after:inset-0 after:-z-10 after:translate-x-[-150%] after:translate-y-[150%] after:scale-[2.5] after:rounded-[100%] after:bg-linear-to-l after:from-white/40 after:transition-transform after:duration-1000 hover:after:translate-x-[0%] hover:after:translate-y-[0%]",
|
|
77
|
+
underline:
|
|
78
|
+
"relative no-underline! after:absolute after:bottom-2 after:h-px after:w-2/3 after:origin-bottom-left after:scale-x-100 after:bg-primary after:transition-transform after:duration-300 after:ease-in-out hover:after:origin-bottom-right hover:after:scale-x-0",
|
|
79
|
+
hoverUnderline:
|
|
80
|
+
"relative no-underline! after:absolute after:bottom-2 after:h-px after:w-2/3 after:origin-bottom-right after:scale-x-0 after:bg-primary after:transition-transform after:duration-300 after:ease-in-out hover:after:origin-bottom-left hover:after:scale-x-100",
|
|
81
|
+
gradientSlideShow:
|
|
82
|
+
"animate-gradient-flow bg-[linear-gradient(-45deg,var(--gradient-lime),var(--gradient-ocean),var(--gradient-wine),var(--gradient-rust))] bg-size-[400%] text-white",
|
|
83
|
+
},
|
|
84
|
+
size: {
|
|
85
|
+
xs: "h-7 gap-1 px-2.5 text-xs has-[>svg]:px-2",
|
|
86
|
+
sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
87
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
88
|
+
lg: "h-10 px-6 has-[>svg]:px-4",
|
|
89
|
+
"icon-xs": "size-7",
|
|
90
|
+
"icon-sm": "size-8",
|
|
91
|
+
icon: "size-9",
|
|
92
|
+
"icon-lg": "size-10",
|
|
93
|
+
},
|
|
94
|
+
disabled: {
|
|
95
|
+
true: "pointer-events-none opacity-50",
|
|
96
|
+
},
|
|
97
|
+
hasIcon: {
|
|
98
|
+
false: "gap-2",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
variant: "default",
|
|
103
|
+
size: "default",
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
export type ButtonVariants = VariantProps<typeof buttonStyles>;
|
|
107
|
+
export type ButtonProps = NuxtLinkProps & {
|
|
108
|
+
/** The type for the button */
|
|
109
|
+
type?: "button" | "submit" | "reset";
|
|
110
|
+
/** Whether the button is disabled */
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
/** Whether the button is loading */
|
|
113
|
+
loading?: boolean;
|
|
114
|
+
/** The action to perform when the button is clicked */
|
|
115
|
+
onClick?: any;
|
|
116
|
+
/** The element to render the button as */
|
|
117
|
+
as?: string;
|
|
118
|
+
/** Custom class(es) to add to parent element */
|
|
119
|
+
class?: HtmlHTMLAttributes["class"];
|
|
120
|
+
/** The variant of the button */
|
|
121
|
+
variant?: ButtonVariants["variant"];
|
|
122
|
+
/** The size of the button */
|
|
123
|
+
size?: ButtonVariants["size"];
|
|
124
|
+
/**
|
|
125
|
+
* The effect to apply to the button.
|
|
126
|
+
*/
|
|
127
|
+
effect?: ButtonVariants["effect"];
|
|
128
|
+
/** The text to display in the button */
|
|
129
|
+
text?: string;
|
|
130
|
+
/** Should the icon be displayed on the `left` or the `right`? */
|
|
131
|
+
iconPlacement?: "left" | "right";
|
|
132
|
+
/** The icon to display in the button */
|
|
133
|
+
icon?: string;
|
|
134
|
+
/** The icon to display when the button is loading */
|
|
135
|
+
loadingIcon?: string;
|
|
136
|
+
};
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<script setup lang="ts">
|
|
140
|
+
const props = withDefaults(defineProps<ButtonProps>(), {
|
|
141
|
+
type: "button",
|
|
142
|
+
loadingIcon: "line-md:loading-loop",
|
|
143
|
+
iconPlacement: "left",
|
|
144
|
+
loading: false,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const elementType = computed(() => {
|
|
148
|
+
if (props.as) return props.as;
|
|
149
|
+
if (props.href || props.to || props.target) return resolveComponent("NuxtLink");
|
|
150
|
+
return "button";
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const forwarded = useForwardProps(
|
|
154
|
+
reactiveOmit(
|
|
155
|
+
props,
|
|
156
|
+
"class",
|
|
157
|
+
"text",
|
|
158
|
+
"icon",
|
|
159
|
+
"iconPlacement",
|
|
160
|
+
"size",
|
|
161
|
+
"variant",
|
|
162
|
+
"as",
|
|
163
|
+
"loading",
|
|
164
|
+
"disabled",
|
|
165
|
+
"loadingIcon",
|
|
166
|
+
"effect"
|
|
167
|
+
)
|
|
168
|
+
);
|
|
169
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
role="group"
|
|
5
|
+
data-slot="button-group"
|
|
6
|
+
:data-orientation="orientation"
|
|
7
|
+
:class="buttonGroupVariants({ orientation, class: normalizeClass(props.class) || undefined })"
|
|
8
|
+
>
|
|
9
|
+
<slot />
|
|
10
|
+
</Primitive>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { Primitive } from "reka-ui";
|
|
15
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
16
|
+
import type { VariantProps } from "tailwind-variants";
|
|
17
|
+
import { normalizeClass } from "vue";
|
|
18
|
+
import type { HTMLAttributes } from "vue";
|
|
19
|
+
|
|
20
|
+
export const buttonGroupVariants = tv({
|
|
21
|
+
base: "flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
22
|
+
variants: {
|
|
23
|
+
orientation: {
|
|
24
|
+
horizontal:
|
|
25
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
26
|
+
vertical:
|
|
27
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
orientation: "horizontal",
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type ButtonGroupProps = PrimitiveProps & {
|
|
36
|
+
/**
|
|
37
|
+
* The orientation of the button group.
|
|
38
|
+
* @default 'horizontal'
|
|
39
|
+
*/
|
|
40
|
+
orientation?: VariantProps<typeof buttonGroupVariants>["orientation"];
|
|
41
|
+
/**
|
|
42
|
+
* Additional classes to apply to the button group.
|
|
43
|
+
*/
|
|
44
|
+
class?: HTMLAttributes["class"];
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<script lang="ts" setup>
|
|
49
|
+
const props = withDefaults(defineProps<ButtonGroupProps>(), {
|
|
50
|
+
orientation: "horizontal",
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const forwarded = reactiveOmit(props, ["orientation", "class"]);
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UiSeparator
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
data-slot="button-group-separator"
|
|
5
|
+
:orientation="orientation"
|
|
6
|
+
:class="buttonGroupSeparatorStyles({ class: normalizeClass(props.class) || undefined })"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</UiSeparator>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { normalizeClass } from "vue";
|
|
14
|
+
import type { HTMLAttributes } from "vue";
|
|
15
|
+
|
|
16
|
+
export const buttonGroupSeparatorStyles = tv({
|
|
17
|
+
base: "relative m-0! self-stretch bg-input data-[orientation=vertical]:h-auto",
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type ButtonGroupSeparatorProps = {
|
|
21
|
+
/**
|
|
22
|
+
* The orientation of the separator.
|
|
23
|
+
*/
|
|
24
|
+
orientation?: "horizontal" | "vertical";
|
|
25
|
+
/**
|
|
26
|
+
* Additional classes to apply to the button group text.
|
|
27
|
+
*/
|
|
28
|
+
class?: HTMLAttributes["class"];
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
const props = withDefaults(defineProps<ButtonGroupSeparatorProps>(), {
|
|
34
|
+
orientation: "vertical",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const forwarded = reactiveOmit(props, ["class"]);
|
|
38
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
v-bind="forwarded"
|
|
4
|
+
data-slot="button-group-text"
|
|
5
|
+
:class="buttonGroupTextStyles({ class: normalizeClass(props.class) || undefined })"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</Primitive>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { Primitive } from "reka-ui";
|
|
13
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
14
|
+
import { normalizeClass } from "vue";
|
|
15
|
+
import type { HTMLAttributes } from "vue";
|
|
16
|
+
|
|
17
|
+
export const buttonGroupTextStyles = tv({
|
|
18
|
+
base: "flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type ButtonGroupTextProps = PrimitiveProps & {
|
|
22
|
+
/**
|
|
23
|
+
* Additional classes to apply to the button group text.
|
|
24
|
+
*/
|
|
25
|
+
class?: HTMLAttributes["class"];
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
const props = defineProps<ButtonGroupTextProps>();
|
|
31
|
+
|
|
32
|
+
const forwarded = reactiveOmit(props, ["class"]);
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-action"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
:as="as"
|
|
6
|
+
:as-child="asChild"
|
|
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 = withDefaults(
|
|
19
|
+
defineProps<
|
|
20
|
+
PrimitiveProps & {
|
|
21
|
+
/** Custom class(es) to add to the element */
|
|
22
|
+
class?: HTMLAttributes["class"];
|
|
23
|
+
}
|
|
24
|
+
>(),
|
|
25
|
+
{ as: "div" }
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const styles = tv({
|
|
29
|
+
base: "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card"
|
|
4
|
+
:as="as"
|
|
5
|
+
:as-child="asChild"
|
|
6
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
<slot name="header">
|
|
10
|
+
<UiCardHeader>
|
|
11
|
+
<slot name="title">
|
|
12
|
+
<UiCardTitle v-if="title || $slots.title" :title="title" />
|
|
13
|
+
</slot>
|
|
14
|
+
<slot name="action" />
|
|
15
|
+
<slot name="description">
|
|
16
|
+
<UiCardDescription
|
|
17
|
+
v-if="description || $slots.description"
|
|
18
|
+
:description="description"
|
|
19
|
+
/>
|
|
20
|
+
</slot>
|
|
21
|
+
</UiCardHeader>
|
|
22
|
+
</slot>
|
|
23
|
+
<slot v-if="content || $slots.content" name="content">
|
|
24
|
+
<UiCardContent>
|
|
25
|
+
<div v-html="content" />
|
|
26
|
+
</UiCardContent>
|
|
27
|
+
</slot>
|
|
28
|
+
<slot name="footer" />
|
|
29
|
+
</slot>
|
|
30
|
+
</Primitive>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import { Primitive } from "reka-ui";
|
|
35
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
36
|
+
import { normalizeClass } from "vue";
|
|
37
|
+
import type { HTMLAttributes } from "vue";
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(
|
|
40
|
+
defineProps<
|
|
41
|
+
PrimitiveProps & {
|
|
42
|
+
/** Title that should be displayed. Passed to the `CardTitle` component */
|
|
43
|
+
title?: string;
|
|
44
|
+
/** Description that should be displayed. Passed to the `CardDescription` component */
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Content that should be displayed. Passed to the `CardContent` component */
|
|
47
|
+
content?: string;
|
|
48
|
+
/** Custom class(es) to add to the element */
|
|
49
|
+
class?: HTMLAttributes["class"];
|
|
50
|
+
}
|
|
51
|
+
>(),
|
|
52
|
+
{ as: "div" }
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const styles = tv({
|
|
56
|
+
base: "flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-content"
|
|
4
|
+
:as="as"
|
|
5
|
+
:as-child="asChild"
|
|
6
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
{{ content }}
|
|
10
|
+
</slot>
|
|
11
|
+
</Primitive>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { Primitive } from "reka-ui";
|
|
16
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
17
|
+
import { normalizeClass } from "vue";
|
|
18
|
+
import type { HTMLAttributes } from "vue";
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(
|
|
21
|
+
defineProps<
|
|
22
|
+
PrimitiveProps & {
|
|
23
|
+
/** Content to display in the card */
|
|
24
|
+
content?: string;
|
|
25
|
+
/** Custom class(es) to add to the element */
|
|
26
|
+
class?: HTMLAttributes["class"];
|
|
27
|
+
}
|
|
28
|
+
>(),
|
|
29
|
+
{ as: "div" }
|
|
30
|
+
);
|
|
31
|
+
const styles = tv({
|
|
32
|
+
base: "px-6",
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-description"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
:as="as"
|
|
6
|
+
:as-child="asChild"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
{{ description }}
|
|
10
|
+
</slot>
|
|
11
|
+
</Primitive>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { Primitive } from "reka-ui";
|
|
16
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
17
|
+
import { normalizeClass } from "vue";
|
|
18
|
+
import type { HTMLAttributes } from "vue";
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(
|
|
21
|
+
defineProps<
|
|
22
|
+
PrimitiveProps & {
|
|
23
|
+
/** Description to display in the card */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Custom class(es) to add to the element */
|
|
26
|
+
class?: HTMLAttributes["class"];
|
|
27
|
+
}
|
|
28
|
+
>(),
|
|
29
|
+
{
|
|
30
|
+
as: "div",
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
const styles = tv({
|
|
34
|
+
base: "text-sm text-muted-foreground",
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-footer"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
:as="as"
|
|
6
|
+
:as-child="asChild"
|
|
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 = withDefaults(
|
|
19
|
+
defineProps<
|
|
20
|
+
PrimitiveProps & {
|
|
21
|
+
/** Custom class(es) to add to the element */
|
|
22
|
+
class?: HTMLAttributes["class"];
|
|
23
|
+
}
|
|
24
|
+
>(),
|
|
25
|
+
{ as: "div" }
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const styles = tv({
|
|
29
|
+
base: "flex items-center px-6 [.border-t]:pt-6",
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-header"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
:as="as"
|
|
6
|
+
:as-child="asChild"
|
|
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 = withDefaults(
|
|
19
|
+
defineProps<
|
|
20
|
+
PrimitiveProps & {
|
|
21
|
+
/** Custom class(es) to add to the element */
|
|
22
|
+
class?: HTMLAttributes["class"];
|
|
23
|
+
}
|
|
24
|
+
>(),
|
|
25
|
+
{ as: "div" }
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const styles = tv({
|
|
29
|
+
base: "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive
|
|
3
|
+
data-slot="card-title"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
:as="as"
|
|
6
|
+
:as-child="asChild"
|
|
7
|
+
>
|
|
8
|
+
<slot>
|
|
9
|
+
{{ title }}
|
|
10
|
+
</slot>
|
|
11
|
+
</Primitive>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import { Primitive } from "reka-ui";
|
|
16
|
+
import type { PrimitiveProps } from "reka-ui";
|
|
17
|
+
import { normalizeClass } from "vue";
|
|
18
|
+
import type { HTMLAttributes } from "vue";
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(
|
|
21
|
+
defineProps<
|
|
22
|
+
PrimitiveProps & {
|
|
23
|
+
/** Title to display in the card */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Custom class(es) to add to the element */
|
|
26
|
+
class?: HTMLAttributes["class"];
|
|
27
|
+
}
|
|
28
|
+
>(),
|
|
29
|
+
{
|
|
30
|
+
as: "h3",
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const styles = tv({
|
|
35
|
+
base: "leading-none font-semibold",
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CollapsibleRoot v-slot="slotProps" data-slot="collapsible" v-bind="forwarded">
|
|
3
|
+
<slot v-bind="slotProps" />
|
|
4
|
+
</CollapsibleRoot>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { CollapsibleRoot, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import type { CollapsibleRootEmits, CollapsibleRootProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<CollapsibleRootProps>();
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits<CollapsibleRootEmits>();
|
|
14
|
+
|
|
15
|
+
const forwarded = useForwardPropsEmits(props, emit);
|
|
16
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CollapsibleContent
|
|
3
|
+
data-slot="collapsible-content"
|
|
4
|
+
:class="styles({ class: normalizeClass(props.class) || undefined })"
|
|
5
|
+
v-bind="forwarded"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</CollapsibleContent>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
import { CollapsibleContent } from "reka-ui";
|
|
13
|
+
import type { CollapsibleContentProps } from "reka-ui";
|
|
14
|
+
import { normalizeClass } from "vue";
|
|
15
|
+
import type { HTMLAttributes } from "vue";
|
|
16
|
+
|
|
17
|
+
const props = defineProps<
|
|
18
|
+
CollapsibleContentProps & {
|
|
19
|
+
/** Customer class(es) to add to the element */
|
|
20
|
+
class?: HTMLAttributes["class"];
|
|
21
|
+
}
|
|
22
|
+
>();
|
|
23
|
+
const forwarded = reactiveOmit(props, "class");
|
|
24
|
+
const styles = tv({
|
|
25
|
+
base: "overflow-hidden transition duration-200 will-change-auto data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CollapsibleTrigger data-slot="collapsible-trigger" v-bind="forwarded">
|
|
3
|
+
<slot />
|
|
4
|
+
</CollapsibleTrigger>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { CollapsibleTrigger, useForwardProps } from "reka-ui";
|
|
9
|
+
import type { CollapsibleTriggerProps } from "reka-ui";
|
|
10
|
+
|
|
11
|
+
const props = defineProps<CollapsibleTriggerProps>();
|
|
12
|
+
const forwarded = useForwardProps(props);
|
|
13
|
+
</script>
|