@reinvented/design 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -0
- package/docs/components/alert-dialog.md +32 -0
- package/docs/components/avatar.md +14 -0
- package/docs/components/badge.md +24 -0
- package/docs/components/button.md +69 -0
- package/docs/components/card.md +49 -0
- package/docs/components/dialog.md +46 -0
- package/docs/components/dropdown-menu.md +32 -0
- package/docs/components/index.md +69 -50
- package/docs/components/input.md +34 -0
- package/docs/components/remaining-components.md +253 -0
- package/docs/components/scroll-area.md +17 -0
- package/docs/components/select.md +31 -0
- package/docs/components/separator.md +14 -0
- package/docs/components/sheet.md +32 -0
- package/docs/components/skeleton.md +20 -0
- package/docs/components/table.md +33 -0
- package/docs/components/tabs.md +23 -0
- package/docs/layouts/dashboard.md +70 -0
- package/docs/layouts/detail-page.md +83 -0
- package/docs/layouts/index.md +37 -24
- package/docs/layouts/list-page.md +107 -0
- package/docs/layouts/settings-page.md +79 -0
- package/docs/layouts/step-wizard.md +73 -0
- package/package.json +7 -3
- package/src/components/ui/accordion/Accordion.vue +13 -0
- package/src/components/ui/accordion/AccordionContent.vue +20 -0
- package/src/components/ui/accordion/AccordionItem.vue +15 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +25 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/alert/Alert.vue +38 -0
- package/src/components/ui/alert/AlertDescription.vue +12 -0
- package/src/components/ui/alert/AlertTitle.vue +12 -0
- package/src/components/ui/alert/index.ts +3 -0
- package/src/components/ui/alert-dialog/AlertDialog.vue +13 -0
- package/src/components/ui/alert-dialog/AlertDialogAction.vue +21 -0
- package/src/components/ui/alert-dialog/AlertDialogCancel.vue +21 -0
- package/src/components/ui/alert-dialog/AlertDialogContent.vue +39 -0
- package/src/components/ui/alert-dialog/AlertDialogDescription.vue +15 -0
- package/src/components/ui/alert-dialog/AlertDialogFooter.vue +12 -0
- package/src/components/ui/alert-dialog/AlertDialogHeader.vue +12 -0
- package/src/components/ui/alert-dialog/AlertDialogTitle.vue +15 -0
- package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/components/ui/alert-dialog/index.ts +9 -0
- package/src/components/ui/breadcrumb/Breadcrumb.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +12 -0
- package/src/components/ui/breadcrumb/BreadcrumbItem.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbLink.vue +20 -0
- package/src/components/ui/breadcrumb/BreadcrumbList.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbPage.vue +6 -0
- package/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +11 -0
- package/src/components/ui/breadcrumb/index.ts +7 -0
- package/src/components/ui/button/Button.vue +0 -1
- package/src/components/ui/checkbox/Checkbox.vue +25 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/collapsible/Collapsible.vue +13 -0
- package/src/components/ui/collapsible/index.ts +2 -0
- package/src/components/ui/command/Command.vue +16 -0
- package/src/components/ui/command/CommandEmpty.vue +5 -0
- package/src/components/ui/command/CommandGroup.vue +22 -0
- package/src/components/ui/command/CommandInput.vue +21 -0
- package/src/components/ui/command/CommandItem.vue +22 -0
- package/src/components/ui/command/CommandList.vue +17 -0
- package/src/components/ui/command/CommandSeparator.vue +5 -0
- package/src/components/ui/command/index.ts +7 -0
- package/src/components/ui/context-menu/ContextMenuContent.vue +24 -0
- package/src/components/ui/context-menu/ContextMenuItem.vue +16 -0
- package/src/components/ui/context-menu/ContextMenuLabel.vue +9 -0
- package/src/components/ui/context-menu/ContextMenuSeparator.vue +9 -0
- package/src/components/ui/context-menu/ContextMenuSubContent.vue +14 -0
- package/src/components/ui/context-menu/index.ts +9 -0
- package/src/components/ui/dialog/Dialog.vue +14 -0
- package/src/components/ui/dialog/DialogClose.vue +12 -0
- package/src/components/ui/dialog/DialogContent.vue +48 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +12 -0
- package/src/components/ui/dialog/DialogHeader.vue +12 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +47 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/src/components/ui/dialog/index.ts +9 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +28 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +33 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +12 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +13 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +11 -0
- package/src/components/ui/dropdown-menu/index.ts +14 -0
- package/src/components/ui/form/FormControl.vue +3 -0
- package/src/components/ui/form/FormDescription.vue +6 -0
- package/src/components/ui/form/FormItem.vue +6 -0
- package/src/components/ui/form/FormLabel.vue +10 -0
- package/src/components/ui/form/FormMessage.vue +10 -0
- package/src/components/ui/form/index.ts +9 -0
- package/src/components/ui/hover-card/HoverCard.vue +13 -0
- package/src/components/ui/hover-card/HoverCardContent.vue +26 -0
- package/src/components/ui/hover-card/HoverCardTrigger.vue +11 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/label/Label.vue +18 -0
- package/src/components/ui/label/index.ts +1 -0
- package/src/components/ui/menubar/MenubarContent.vue +15 -0
- package/src/components/ui/menubar/MenubarItem.vue +13 -0
- package/src/components/ui/menubar/MenubarTrigger.vue +13 -0
- package/src/components/ui/menubar/index.ts +5 -0
- package/src/components/ui/navigation-menu/NavigationMenuContent.vue +14 -0
- package/src/components/ui/navigation-menu/NavigationMenuTrigger.vue +15 -0
- package/src/components/ui/navigation-menu/index.ts +4 -0
- package/src/components/ui/pagination/PaginationContent.vue +13 -0
- package/src/components/ui/pagination/PaginationEllipsis.vue +12 -0
- package/src/components/ui/pagination/PaginationNext.vue +14 -0
- package/src/components/ui/pagination/PaginationPrev.vue +14 -0
- package/src/components/ui/pagination/index.ts +6 -0
- package/src/components/ui/popover/Popover.vue +13 -0
- package/src/components/ui/popover/PopoverContent.vue +27 -0
- package/src/components/ui/popover/PopoverTrigger.vue +11 -0
- package/src/components/ui/popover/index.ts +3 -0
- package/src/components/ui/progress/Progress.vue +21 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/radio-group/RadioGroup.vue +16 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +24 -0
- package/src/components/ui/radio-group/index.ts +2 -0
- package/src/components/ui/select/Select.vue +13 -0
- package/src/components/ui/select/SelectContent.vue +40 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +30 -0
- package/src/components/ui/select/SelectLabel.vue +15 -0
- package/src/components/ui/select/SelectSeparator.vue +13 -0
- package/src/components/ui/select/SelectTrigger.vue +23 -0
- package/src/components/ui/select/SelectValue.vue +11 -0
- package/src/components/ui/select/index.ts +8 -0
- package/src/components/ui/sheet/Sheet.vue +13 -0
- package/src/components/ui/sheet/SheetClose.vue +11 -0
- package/src/components/ui/sheet/SheetContent.vue +65 -0
- package/src/components/ui/sheet/SheetDescription.vue +15 -0
- package/src/components/ui/sheet/SheetFooter.vue +12 -0
- package/src/components/ui/sheet/SheetHeader.vue +12 -0
- package/src/components/ui/sheet/SheetTitle.vue +15 -0
- package/src/components/ui/sheet/SheetTrigger.vue +11 -0
- package/src/components/ui/sheet/index.ts +8 -0
- package/src/components/ui/slider/Slider.vue +26 -0
- package/src/components/ui/slider/index.ts +1 -0
- package/src/components/ui/switch/Switch.vue +24 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +13 -0
- package/src/components/ui/table/TableBody.vue +6 -0
- package/src/components/ui/table/TableCaption.vue +6 -0
- package/src/components/ui/table/TableCell.vue +6 -0
- package/src/components/ui/table/TableFooter.vue +6 -0
- package/src/components/ui/table/TableHead.vue +6 -0
- package/src/components/ui/table/TableHeader.vue +6 -0
- package/src/components/ui/table/TableRow.vue +6 -0
- package/src/components/ui/table/index.ts +8 -0
- package/src/components/ui/tabs/Tabs.vue +13 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +21 -0
- package/src/components/ui/tabs/TabsTrigger.vue +21 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/textarea/Textarea.vue +29 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/toggle/Toggle.vue +40 -0
- package/src/components/ui/toggle/index.ts +1 -0
- package/src/components/ui/toggle-group/ToggleGroup.vue +16 -0
- package/src/components/ui/toggle-group/ToggleGroupItem.vue +21 -0
- package/src/components/ui/toggle-group/index.ts +2 -0
- package/src/components/ui/tooltip/Tooltip.vue +13 -0
- package/src/components/ui/tooltip/TooltipContent.vue +27 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +12 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +11 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/eslint/index.js +192 -0
- package/src/eslint/recommended.js +64 -0
- package/src/index.ts +46 -192
- package/src/patterns/DetailView.vue +2 -2
- package/src/patterns/EmptyState.vue +2 -2
- package/src/patterns/FormView.vue +2 -2
- package/src/patterns/ListView.vue +2 -2
- package/tsconfig.json +17 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
type DropdownMenuContentEmits,
|
|
6
|
+
type DropdownMenuContentProps,
|
|
7
|
+
DropdownMenuPortal,
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from 'radix-vue'
|
|
10
|
+
import { cn } from '../lib/utils'
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
14
|
+
{ sideOffset: 4 },
|
|
15
|
+
)
|
|
16
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
17
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
18
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<DropdownMenuPortal>
|
|
23
|
+
<DropdownMenuContent
|
|
24
|
+
v-bind="forwarded"
|
|
25
|
+
:class="cn(
|
|
26
|
+
'z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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',
|
|
27
|
+
props.class,
|
|
28
|
+
)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</DropdownMenuContent>
|
|
32
|
+
</DropdownMenuPortal>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuGroup, type DropdownMenuGroupProps } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<DropdownMenuGroupProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<DropdownMenuGroup v-bind="props">
|
|
9
|
+
<slot />
|
|
10
|
+
</DropdownMenuGroup>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DropdownMenuItem, type DropdownMenuItemProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
interface Props extends DropdownMenuItemProps {
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
inset?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
12
|
+
const delegatedProps = computed(() => { const { class: _, inset: _i, ...d } = props; return d })
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuItem
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
21
|
+
inset && 'pl-8',
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</DropdownMenuItem>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DropdownMenuLabel, type DropdownMenuLabelProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
interface Props extends DropdownMenuLabelProps {
|
|
7
|
+
class?: HTMLAttributes['class']
|
|
8
|
+
inset?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
12
|
+
const delegatedProps = computed(() => { const { class: _, inset: _i, ...d } = props; return d })
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<DropdownMenuLabel
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:class="cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', props.class)"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</DropdownMenuLabel>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuRadioGroup, type DropdownMenuRadioGroupEmits, type DropdownMenuRadioGroupProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<DropdownMenuRadioGroupProps>()
|
|
5
|
+
const emits = defineEmits<DropdownMenuRadioGroupEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DropdownMenuRadioGroup v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</DropdownMenuRadioGroup>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DropdownMenuItemIndicator, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { Circle } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<DropdownMenuRadioItemProps & { class?: HTMLAttributes['class'] }>()
|
|
8
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
9
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DropdownMenuRadioItem
|
|
14
|
+
v-bind="forwardedProps"
|
|
15
|
+
:class="cn(
|
|
16
|
+
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
|
+
>
|
|
20
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
21
|
+
<DropdownMenuItemIndicator>
|
|
22
|
+
<Circle class="h-2 w-2 fill-current" />
|
|
23
|
+
</DropdownMenuItemIndicator>
|
|
24
|
+
</span>
|
|
25
|
+
<slot />
|
|
26
|
+
</DropdownMenuRadioItem>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DropdownMenuSeparator, type DropdownMenuSeparatorProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<DropdownMenuSeparatorProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuSeparator v-bind="forwardedProps" :class="cn('-mx-1 my-1 h-px bg-muted', props.class)" />
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<kbd :class="cn('ml-auto text-xs tracking-widest opacity-60', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</kbd>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuSub, type DropdownMenuSubEmits, type DropdownMenuSubProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<DropdownMenuSubProps>()
|
|
5
|
+
const emits = defineEmits<DropdownMenuSubEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DropdownMenuSub v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</DropdownMenuSub>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenuSubContent,
|
|
5
|
+
type DropdownMenuSubContentEmits,
|
|
6
|
+
type DropdownMenuSubContentProps,
|
|
7
|
+
useForwardPropsEmits,
|
|
8
|
+
} from 'radix-vue'
|
|
9
|
+
import { cn } from '../lib/utils'
|
|
10
|
+
|
|
11
|
+
const props = defineProps<DropdownMenuSubContentProps & { class?: HTMLAttributes['class'] }>()
|
|
12
|
+
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
|
13
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
14
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<DropdownMenuSubContent
|
|
19
|
+
v-bind="forwarded"
|
|
20
|
+
:class="cn(
|
|
21
|
+
'z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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',
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</DropdownMenuSubContent>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { ChevronRight } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<DropdownMenuSubTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
8
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
9
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DropdownMenuSubTrigger
|
|
14
|
+
v-bind="forwardedProps"
|
|
15
|
+
:class="cn(
|
|
16
|
+
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
<ChevronRight class="ml-auto h-4 w-4" />
|
|
22
|
+
</DropdownMenuSubTrigger>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DropdownMenuTrigger, type DropdownMenuTriggerProps } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<DropdownMenuTriggerProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<DropdownMenuTrigger v-bind="props">
|
|
9
|
+
<slot />
|
|
10
|
+
</DropdownMenuTrigger>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as DropdownMenu } from './DropdownMenu.vue'
|
|
2
|
+
export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue'
|
|
3
|
+
export { default as DropdownMenuContent } from './DropdownMenuContent.vue'
|
|
4
|
+
export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue'
|
|
5
|
+
export { default as DropdownMenuItem } from './DropdownMenuItem.vue'
|
|
6
|
+
export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue'
|
|
7
|
+
export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue'
|
|
8
|
+
export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue'
|
|
9
|
+
export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue'
|
|
10
|
+
export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue'
|
|
11
|
+
export { default as DropdownMenuSub } from './DropdownMenuSub.vue'
|
|
12
|
+
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue'
|
|
13
|
+
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue'
|
|
14
|
+
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template><p :class="cn('text-[0.8rem] text-muted-foreground', props.class)"><slot /></p></template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class']; error?: boolean }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template>
|
|
7
|
+
<label :class="cn('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70', error && 'text-destructive', props.class)">
|
|
8
|
+
<slot />
|
|
9
|
+
</label>
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { cn } from '../lib/utils'
|
|
4
|
+
const props = defineProps<{ class?: HTMLAttributes['class']; message?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
<template>
|
|
7
|
+
<p v-if="message" :class="cn('text-[0.8rem] font-medium text-destructive', props.class)">
|
|
8
|
+
{{ message }}
|
|
9
|
+
</p>
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Form components using vee-validate
|
|
2
|
+
// Re-export vee-validate primitives with standard naming
|
|
3
|
+
export { Form, Field as FormField } from 'vee-validate'
|
|
4
|
+
|
|
5
|
+
export { default as FormItem } from './FormItem.vue'
|
|
6
|
+
export { default as FormLabel } from './FormLabel.vue'
|
|
7
|
+
export { default as FormControl } from './FormControl.vue'
|
|
8
|
+
export { default as FormDescription } from './FormDescription.vue'
|
|
9
|
+
export { default as FormMessage } from './FormMessage.vue'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { HoverCardRoot, type HoverCardRootEmits, type HoverCardRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<HoverCardRootProps>()
|
|
5
|
+
const emits = defineEmits<HoverCardRootEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<HoverCardRoot v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</HoverCardRoot>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { HoverCardContent, type HoverCardContentProps, HoverCardPortal, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<HoverCardContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
8
|
+
{ sideOffset: 4, align: 'center' },
|
|
9
|
+
)
|
|
10
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
11
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<HoverCardPortal>
|
|
16
|
+
<HoverCardContent
|
|
17
|
+
v-bind="forwardedProps"
|
|
18
|
+
:class="cn(
|
|
19
|
+
'z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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',
|
|
20
|
+
props.class,
|
|
21
|
+
)"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</HoverCardContent>
|
|
25
|
+
</HoverCardPortal>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { HoverCardTrigger, type HoverCardTriggerProps } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<HoverCardTriggerProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<HoverCardTrigger v-bind="props">
|
|
9
|
+
<slot />
|
|
10
|
+
</HoverCardTrigger>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { Label as LabelRoot, type LabelProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<LabelRoot
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
:class="cn('text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70', props.class)"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</LabelRoot>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Label } from './Label.vue'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { MenubarContent, type MenubarContentProps, MenubarPortal, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
const props = withDefaults(defineProps<MenubarContentProps & { class?: HTMLAttributes['class'] }>(), { sideOffset: 5, alignOffset: -4 })
|
|
6
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
7
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
8
|
+
</script>
|
|
9
|
+
<template>
|
|
10
|
+
<MenubarPortal>
|
|
11
|
+
<MenubarContent v-bind="forwardedProps" :class="cn('z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</MenubarContent>
|
|
14
|
+
</MenubarPortal>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { MenubarItem, type MenubarItemProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
const props = defineProps<MenubarItemProps & { class?: HTMLAttributes['class']; inset?: boolean }>()
|
|
6
|
+
const delegatedProps = computed(() => { const { class: _, inset: _i, ...d } = props; return d })
|
|
7
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
8
|
+
</script>
|
|
9
|
+
<template>
|
|
10
|
+
<MenubarItem v-bind="forwardedProps" :class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', props.class)">
|
|
11
|
+
<slot />
|
|
12
|
+
</MenubarItem>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { MenubarTrigger, type MenubarTriggerProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
const props = defineProps<MenubarTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
6
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
7
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
8
|
+
</script>
|
|
9
|
+
<template>
|
|
10
|
+
<MenubarTrigger v-bind="forwardedProps" :class="cn('flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', props.class)">
|
|
11
|
+
<slot />
|
|
12
|
+
</MenubarTrigger>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Menubar — styled wrappers around radix-vue Menubar primitives
|
|
2
|
+
export { MenubarRoot as Menubar, MenubarMenu, MenubarSeparator, MenubarPortal } from 'radix-vue'
|
|
3
|
+
export { default as MenubarContent } from './MenubarContent.vue'
|
|
4
|
+
export { default as MenubarItem } from './MenubarItem.vue'
|
|
5
|
+
export { default as MenubarTrigger } from './MenubarTrigger.vue'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { NavigationMenuContent, type NavigationMenuContentEmits, type NavigationMenuContentProps, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
const props = defineProps<NavigationMenuContentProps & { class?: HTMLAttributes['class'] }>()
|
|
6
|
+
const emits = defineEmits<NavigationMenuContentEmits>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
9
|
+
</script>
|
|
10
|
+
<template>
|
|
11
|
+
<NavigationMenuContent v-bind="forwarded" :class="cn('left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</NavigationMenuContent>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { NavigationMenuTrigger, type NavigationMenuTriggerProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { ChevronDown } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
const props = defineProps<NavigationMenuTriggerProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
<template>
|
|
11
|
+
<NavigationMenuTrigger v-bind="forwardedProps" :class="cn('group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
<ChevronDown class="relative top-px ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180" aria-hidden="true" />
|
|
14
|
+
</NavigationMenuTrigger>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// NavigationMenu — styled wrappers around radix-vue NavigationMenu primitives
|
|
2
|
+
export { NavigationMenuRoot as NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuLink, NavigationMenuViewport, NavigationMenuIndicator } from 'radix-vue'
|
|
3
|
+
export { default as NavigationMenuContent } from './NavigationMenuContent.vue'
|
|
4
|
+
export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { PaginationList, type PaginationListProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
const props = defineProps<PaginationListProps & { class?: HTMLAttributes['class'] }>()
|
|
6
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
7
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
8
|
+
</script>
|
|
9
|
+
<template>
|
|
10
|
+
<PaginationList v-bind="forwardedProps" :class="cn('flex flex-row items-center gap-1', props.class)">
|
|
11
|
+
<slot />
|
|
12
|
+
</PaginationList>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue'
|
|
3
|
+
import { PaginationEllipsis, type PaginationEllipsisProps } from 'radix-vue'
|
|
4
|
+
import { MoreHorizontal } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
const props = defineProps<PaginationEllipsisProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
</script>
|
|
8
|
+
<template>
|
|
9
|
+
<PaginationEllipsis v-bind="props" :class="cn('flex h-9 w-9 items-center justify-center', props.class)">
|
|
10
|
+
<slot><MoreHorizontal class="h-4 w-4" /></slot>
|
|
11
|
+
</PaginationEllipsis>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { PaginationNext, type PaginationNextProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { ChevronRight } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
const props = defineProps<PaginationNextProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
<template>
|
|
11
|
+
<PaginationNext v-bind="forwardedProps" :class="cn('flex items-center gap-1 pr-2.5', props.class)">
|
|
12
|
+
<slot><span>Next</span><ChevronRight class="h-4 w-4" /></slot>
|
|
13
|
+
</PaginationNext>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { PaginationPrev, type PaginationPrevProps, useForwardProps } from 'radix-vue'
|
|
4
|
+
import { ChevronLeft } from 'lucide-vue-next'
|
|
5
|
+
import { cn } from '../lib/utils'
|
|
6
|
+
const props = defineProps<PaginationPrevProps & { class?: HTMLAttributes['class'] }>()
|
|
7
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
8
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
9
|
+
</script>
|
|
10
|
+
<template>
|
|
11
|
+
<PaginationPrev v-bind="forwardedProps" :class="cn('flex items-center gap-1 pl-2.5', props.class)">
|
|
12
|
+
<slot><ChevronLeft class="h-4 w-4" /><span>Previous</span></slot>
|
|
13
|
+
</PaginationPrev>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Pagination — styled wrappers
|
|
2
|
+
export { PaginationRoot as Pagination, PaginationFirst, PaginationLast, PaginationListItem } from 'radix-vue'
|
|
3
|
+
export { default as PaginationContent } from './PaginationContent.vue'
|
|
4
|
+
export { default as PaginationEllipsis } from './PaginationEllipsis.vue'
|
|
5
|
+
export { default as PaginationNext } from './PaginationNext.vue'
|
|
6
|
+
export { default as PaginationPrev } from './PaginationPrev.vue'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PopoverRoot, type PopoverRootEmits, type PopoverRootProps, useForwardPropsEmits } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<PopoverRootProps>()
|
|
5
|
+
const emits = defineEmits<PopoverRootEmits>()
|
|
6
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<PopoverRoot v-bind="forwarded">
|
|
11
|
+
<slot />
|
|
12
|
+
</PopoverRoot>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type HTMLAttributes, computed } from 'vue'
|
|
3
|
+
import { PopoverContent, type PopoverContentEmits, type PopoverContentProps, PopoverPortal, useForwardPropsEmits } from 'radix-vue'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<PopoverContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
8
|
+
{ sideOffset: 4, align: 'center' },
|
|
9
|
+
)
|
|
10
|
+
const emits = defineEmits<PopoverContentEmits>()
|
|
11
|
+
const delegatedProps = computed(() => { const { class: _, ...d } = props; return d })
|
|
12
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<PopoverPortal>
|
|
17
|
+
<PopoverContent
|
|
18
|
+
v-bind="forwarded"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[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',
|
|
21
|
+
props.class,
|
|
22
|
+
)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</PopoverContent>
|
|
26
|
+
</PopoverPortal>
|
|
27
|
+
</template>
|