Merge branch 'dev' of https://github.com/radix-vue/shadcn-vue into feat/vee-validate
This commit is contained in:
commit
76be3fb332
|
|
@ -43,7 +43,7 @@
|
||||||
"@vue/compiler-dom": "^3.3.4",
|
"@vue/compiler-dom": "^3.3.4",
|
||||||
"autoprefixer": "^10.4.16",
|
"autoprefixer": "^10.4.16",
|
||||||
"lodash.template": "^4.5.0",
|
"lodash.template": "^4.5.0",
|
||||||
"radix-vue": "^0.3.2",
|
"radix-vue": "^0.4.0",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"tailwind-merge": "^1.14.0",
|
"tailwind-merge": "^1.14.0",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.3.3",
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {
|
||||||
AccordionRoot,
|
AccordionRoot,
|
||||||
type AccordionRootEmits,
|
type AccordionRootEmits,
|
||||||
type AccordionRootProps,
|
type AccordionRootProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<AccordionRootProps>()
|
const props = defineProps<AccordionRootProps>()
|
||||||
const emits = defineEmits<AccordionRootEmits>()
|
const emits = defineEmits<AccordionRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot } from 'radix-vue'
|
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<AlertDialogProps>()
|
const props = defineProps<AlertDialogProps>()
|
||||||
|
|
||||||
const emits = defineEmits<AlertDialogEmits>()
|
const emits = defineEmits<AlertDialogEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const emitsAsProps = useEmitAsProps(emits)
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ import {
|
||||||
type AlertDialogContentProps,
|
type AlertDialogContentProps,
|
||||||
AlertDialogOverlay,
|
AlertDialogOverlay,
|
||||||
AlertDialogPortal,
|
AlertDialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<AlertDialogContentProps & { class?: string }>()
|
const props = defineProps<AlertDialogContentProps & { class?: string }>()
|
||||||
|
|
||||||
const emits = defineEmits<AlertDialogContentEmits>()
|
const emits = defineEmits<AlertDialogContentEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const emitsAsProps = useEmitAsProps(emits)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue'
|
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue'
|
||||||
import { CheckboxIndicator, CheckboxRoot } from 'radix-vue'
|
import { CheckboxIndicator, CheckboxRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { Check } from 'lucide-vue-next'
|
import { Check } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<CheckboxRootProps>()
|
const props = defineProps<CheckboxRootProps>()
|
||||||
const emits = defineEmits<CheckboxRootEmits>()
|
const emits = defineEmits<CheckboxRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { CollapsibleRoot } from 'radix-vue'
|
import { CollapsibleRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { CollapsibleRootEmits, CollapsibleRootProps } from 'radix-vue'
|
import type { CollapsibleRootEmits, CollapsibleRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<CollapsibleRootProps>()
|
const props = defineProps<CollapsibleRootProps>()
|
||||||
const emits = defineEmits<CollapsibleRootEmits>()
|
const emits = defineEmits<CollapsibleRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
||||||
import { ComboboxRoot } from 'radix-vue'
|
import { ComboboxRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxRootProps>()
|
const props = defineProps<ComboboxRootProps>()
|
||||||
const emits = defineEmits<ComboboxRootEmits>()
|
const emits = defineEmits<ComboboxRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useEmitAsProps } from 'radix-vue'
|
||||||
import type { DialogRootEmits, DialogRootProps } from 'radix-vue'
|
import type { DialogRootEmits, DialogRootProps } from 'radix-vue'
|
||||||
import Command from './Command.vue'
|
import Command from './Command.vue'
|
||||||
import { Dialog, DialogContent } from '@/lib/registry/default/ui/dialog'
|
import { Dialog, DialogContent } from '@/lib/registry/default/ui/dialog'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<DialogRootProps>()
|
const props = defineProps<DialogRootProps>()
|
||||||
const emits = defineEmits<DialogRootEmits>()
|
const emits = defineEmits<DialogRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue'
|
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue'
|
||||||
import { ComboboxItem } from 'radix-vue'
|
import { ComboboxItem, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxItemProps>()
|
const props = defineProps<ComboboxItemProps>()
|
||||||
const emits = defineEmits<ComboboxItemEmits>()
|
const emits = defineEmits<ComboboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue'
|
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue'
|
||||||
import { ComboboxContent, ComboboxViewport } from 'radix-vue'
|
import { ComboboxContent, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxContentProps>()
|
const props = defineProps<ComboboxContentProps>()
|
||||||
const emits = defineEmits<ComboboxContentEmits>()
|
const emits = defineEmits<ComboboxContentEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ComboboxContent v-bind="{ ...props, ...emitsAsProps }" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', $attrs.class ?? '')">
|
<ComboboxContent v-bind="forwarded" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', $attrs.class ?? '')">
|
||||||
<div role="presentation">
|
<div role="presentation">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContextMenuRoot } from 'radix-vue'
|
import { ContextMenuRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRootProps>()
|
const props = defineProps<ContextMenuRootProps>()
|
||||||
const emits = defineEmits<ContextMenuRootEmits>()
|
const emits = defineEmits<ContextMenuRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
type ContextMenuCheckboxItemEmits,
|
type ContextMenuCheckboxItemEmits,
|
||||||
type ContextMenuCheckboxItemProps,
|
type ContextMenuCheckboxItemProps,
|
||||||
ContextMenuItemIndicator,
|
ContextMenuItemIndicator,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Check } from 'lucide-vue-next'
|
import { Check } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuCheckboxItemProps & { class?: string }>()
|
const props = defineProps<ContextMenuCheckboxItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuCheckboxItemEmits>()
|
const emits = defineEmits<ContextMenuCheckboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,14 @@ import {
|
||||||
type ContextMenuContentEmits,
|
type ContextMenuContentEmits,
|
||||||
type ContextMenuContentProps,
|
type ContextMenuContentProps,
|
||||||
ContextMenuPortal,
|
ContextMenuPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuContentProps & { class?: string }>()
|
const props = defineProps<ContextMenuContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuContentEmits>()
|
const emits = defineEmits<ContextMenuContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -21,7 +24,7 @@ const emits = defineEmits<ContextMenuContentEmits>()
|
||||||
props.class,
|
props.class,
|
||||||
),
|
),
|
||||||
]"
|
]"
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuContent>
|
</ContextMenuContent>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import {
|
||||||
ContextMenuItem,
|
ContextMenuItem,
|
||||||
type ContextMenuItemEmits,
|
type ContextMenuItemEmits,
|
||||||
type ContextMenuItemProps,
|
type ContextMenuItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuItemProps & { class?: string; inset?: boolean }>()
|
const props = defineProps<ContextMenuItemProps & { class?: string; inset?: boolean }>()
|
||||||
const emits = defineEmits<ContextMenuItemEmits>()
|
const emits = defineEmits<ContextMenuItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
ContextMenuRadioItem,
|
ContextMenuRadioItem,
|
||||||
type ContextMenuRadioItemEmits,
|
type ContextMenuRadioItemEmits,
|
||||||
type ContextMenuRadioItemProps,
|
type ContextMenuRadioItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Circle } from 'lucide-vue-next'
|
import { Circle } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioItemProps & { class?: string }>()
|
const props = defineProps<ContextMenuRadioItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuRadioItemEmits>()
|
const emits = defineEmits<ContextMenuRadioItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ import {
|
||||||
ContextMenuSubContent,
|
ContextMenuSubContent,
|
||||||
type DropdownMenuSubContentEmits,
|
type DropdownMenuSubContentEmits,
|
||||||
type DropdownMenuSubContentProps,
|
type DropdownMenuSubContentProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubContentProps & { class?: string }>()
|
const props = defineProps<DropdownMenuSubContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuSubContent
|
<ContextMenuSubContent
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'z-50 min-w-[8rem] 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',
|
'z-50 min-w-[8rem] 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',
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@ import {
|
||||||
type DialogContentProps,
|
type DialogContentProps,
|
||||||
DialogOverlay,
|
DialogOverlay,
|
||||||
DialogPortal,
|
DialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { X } from 'lucide-vue-next'
|
import { X } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DialogContentProps & { class?: string }>()
|
const props = defineProps<DialogContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<DialogContentEmits>()
|
const emits = defineEmits<DialogContentEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps } from 'radix-vue'
|
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRootProps>()
|
const props = defineProps<DropdownMenuRootProps>()
|
||||||
const emits = defineEmits<DropdownMenuRootEmits>()
|
const emits = defineEmits<DropdownMenuRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
type DropdownMenuCheckboxItemEmits,
|
type DropdownMenuCheckboxItemEmits,
|
||||||
type DropdownMenuCheckboxItemProps,
|
type DropdownMenuCheckboxItemProps,
|
||||||
DropdownMenuItemIndicator,
|
DropdownMenuItemIndicator,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Check } from 'lucide-vue-next'
|
import { Check } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: string }>()
|
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
|
type DropdownMenuContentEmits,
|
||||||
type DropdownMenuContentProps,
|
type DropdownMenuContentProps,
|
||||||
DropdownMenuPortal,
|
DropdownMenuPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
|
@ -12,23 +14,21 @@ const props = withDefaults(
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
const emits = defineEmits<DropdownMenuContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuPortal>
|
<DropdownMenuPortal>
|
||||||
<DropdownMenuContent
|
<DropdownMenuContent
|
||||||
:loop="props.loop"
|
|
||||||
:as-child="props.asChild"
|
|
||||||
:side-offset="props.sideOffset"
|
|
||||||
:side="props.side"
|
|
||||||
:align="props.align"
|
|
||||||
:align-offset="props.alignOffset"
|
|
||||||
:class="[
|
:class="[
|
||||||
cn(
|
cn(
|
||||||
'z-50 min-w-[8rem] 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',
|
'z-50 min-w-[8rem] 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',
|
||||||
props.class,
|
props.class,
|
||||||
),
|
),
|
||||||
]"
|
]"
|
||||||
|
v-bind="forwarded"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
DropdownMenuRadioItem,
|
DropdownMenuRadioItem,
|
||||||
type DropdownMenuRadioItemEmits,
|
type DropdownMenuRadioItemEmits,
|
||||||
type DropdownMenuRadioItemProps,
|
type DropdownMenuRadioItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Circle } from 'lucide-vue-next'
|
import { Circle } from 'lucide-vue-next'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRadioItemProps & { class?: string }>()
|
const props = defineProps<DropdownMenuRadioItemProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ import {
|
||||||
DropdownMenuSubContent,
|
DropdownMenuSubContent,
|
||||||
type DropdownMenuSubContentEmits,
|
type DropdownMenuSubContentEmits,
|
||||||
type DropdownMenuSubContentProps,
|
type DropdownMenuSubContentProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubContentProps>()
|
const props = defineProps<DropdownMenuSubContentProps>()
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuSubContent
|
<DropdownMenuSubContent
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="cn('z-50 min-w-[8rem] 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', $attrs.class ?? '')"
|
:class="cn('z-50 min-w-[8rem] 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', $attrs.class ?? '')"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {
|
||||||
HoverCardContent,
|
HoverCardContent,
|
||||||
type HoverCardContentProps,
|
type HoverCardContentProps,
|
||||||
HoverCardPortal,
|
HoverCardPortal,
|
||||||
|
useForwardProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
|
@ -12,12 +13,14 @@ const props = withDefaults(
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const forwarded = useForwardProps(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<HoverCardPortal>
|
<HoverCardPortal>
|
||||||
<HoverCardContent
|
<HoverCardContent
|
||||||
v-bind="props"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'z-50 w-64 rounded-md bg-background border border-border p-4 text-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',
|
'z-50 w-64 rounded-md bg-background border border-border p-4 text-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',
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import {
|
||||||
NavigationMenuContent,
|
NavigationMenuContent,
|
||||||
type NavigationMenuContentEmits,
|
type NavigationMenuContentEmits,
|
||||||
type NavigationMenuContentProps,
|
type NavigationMenuContentProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<NavigationMenuContentProps & { class?: string }>()
|
const props = defineProps<NavigationMenuContentProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {
|
||||||
NavigationMenuLink,
|
NavigationMenuLink,
|
||||||
type NavigationMenuLinkEmits,
|
type NavigationMenuLinkEmits,
|
||||||
type NavigationMenuLinkProps,
|
type NavigationMenuLinkProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<NavigationMenuLinkProps>()
|
const props = defineProps<NavigationMenuLinkProps>()
|
||||||
const emits = defineEmits<NavigationMenuLinkEmits>()
|
const emits = defineEmits<NavigationMenuLinkEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PopoverRoot } from 'radix-vue'
|
import { PopoverRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<PopoverRootProps>()
|
const props = defineProps<PopoverRootProps>()
|
||||||
const emits = defineEmits<PopoverRootEmits>()
|
const emits = defineEmits<PopoverRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import {
|
||||||
type PopoverContentEmits,
|
type PopoverContentEmits,
|
||||||
type PopoverContentProps,
|
type PopoverContentProps,
|
||||||
PopoverPortal,
|
PopoverPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<PopoverContentProps & { class?: string }>(),
|
defineProps<PopoverContentProps & { class?: string }>(),
|
||||||
|
|
@ -14,13 +15,14 @@ const props = withDefaults(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const emits = defineEmits<PopoverContentEmits>()
|
const emits = defineEmits<PopoverContentEmits>()
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PopoverPortal>
|
<PopoverPortal>
|
||||||
<PopoverContent
|
<PopoverContent
|
||||||
v-bind="{ ...props, ...emitsAsProps, $attrs }"
|
v-bind="{ ...forwarded, ...$attrs }"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'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',
|
'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',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps } from 'radix-vue'
|
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<RadioGroupRootProps & { class?: string }>()
|
const props = defineProps<RadioGroupRootProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
||||||
import { SelectRoot } from 'radix-vue'
|
import { SelectRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<SelectRootProps>()
|
const props = defineProps<SelectRootProps>()
|
||||||
const emits = defineEmits<SelectRootEmits>()
|
const emits = defineEmits<SelectRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@ import {
|
||||||
type SelectContentProps,
|
type SelectContentProps,
|
||||||
SelectPortal,
|
SelectPortal,
|
||||||
SelectViewport,
|
SelectViewport,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<SelectContentProps & { class?: string }>(), {
|
defineProps<SelectContentProps & { class?: string }>(), {
|
||||||
|
|
@ -15,13 +16,14 @@ const props = withDefaults(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const emits = defineEmits<SelectContentEmits>()
|
const emits = defineEmits<SelectContentEmits>()
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SelectPortal>
|
<SelectPortal>
|
||||||
<SelectContent
|
<SelectContent
|
||||||
v-bind="{ ...props, ...emitsAsProps, ...$attrs }"
|
v-bind="{ ...forwarded, ...$attrs }"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'relative z-50 min-w-[10rem] overflow-hidden rounded-md bg-background border border-border text-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',
|
'relative z-50 min-w-[10rem] overflow-hidden rounded-md bg-background border border-border text-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',
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,11 @@ import {
|
||||||
type DialogContentProps,
|
type DialogContentProps,
|
||||||
DialogOverlay,
|
DialogOverlay,
|
||||||
DialogPortal,
|
DialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { X } from 'lucide-vue-next'
|
import { X } from 'lucide-vue-next'
|
||||||
import { cva } from 'class-variance-authority'
|
import { cva } from 'class-variance-authority'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
interface SheetContentProps extends DialogContentProps {
|
interface SheetContentProps extends DialogContentProps {
|
||||||
side?: 'left' | 'right' | 'top' | 'bottom'
|
side?: 'left' | 'right' | 'top' | 'bottom'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SliderRootEmits, SliderRootProps } from 'radix-vue'
|
import type { SliderRootEmits, SliderRootProps } from 'radix-vue'
|
||||||
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'radix-vue'
|
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<SliderRootProps>()
|
const props = defineProps<SliderRootProps>()
|
||||||
const emits = defineEmits<SliderRootEmits>()
|
const emits = defineEmits<SliderRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
||||||
import { Toggle } from 'radix-vue'
|
import { Toggle, useEmitAsProps } from 'radix-vue'
|
||||||
import type { VariantProps } from 'class-variance-authority'
|
import type { VariantProps } from 'class-variance-authority'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { toggleVariants } from '.'
|
import { toggleVariants } from '.'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
interface ToggleVariantProps extends VariantProps<typeof toggleVariants> {}
|
interface ToggleVariantProps extends VariantProps<typeof toggleVariants> {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps } from 'radix-vue'
|
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<TooltipRootProps>()
|
const props = defineProps<TooltipRootProps>()
|
||||||
const emits = defineEmits<TooltipRootEmits>()
|
const emits = defineEmits<TooltipRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal } from 'radix-vue'
|
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<TooltipContentProps>(), {
|
const props = withDefaults(defineProps<TooltipContentProps>(), {
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
})
|
})
|
||||||
const emits = defineEmits<TooltipContentEmits>()
|
const emits = defineEmits<TooltipContentEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TooltipPortal>
|
<TooltipPortal>
|
||||||
<TooltipContent v-bind="{ ...props, ...emitsAsProps, ...$attrs }" :class="cn('z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', $attrs.class ?? '')">
|
<TooltipContent v-bind="{ ...forwarded, ...$attrs }" :class="cn('z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', $attrs.class ?? '')">
|
||||||
<slot />
|
<slot />
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</TooltipPortal>
|
</TooltipPortal>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {
|
||||||
AccordionRoot,
|
AccordionRoot,
|
||||||
type AccordionRootEmits,
|
type AccordionRootEmits,
|
||||||
type AccordionRootProps,
|
type AccordionRootProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<AccordionRootProps>()
|
const props = defineProps<AccordionRootProps>()
|
||||||
const emits = defineEmits<AccordionRootEmits>()
|
const emits = defineEmits<AccordionRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot } from 'radix-vue'
|
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<AlertDialogProps>()
|
const props = defineProps<AlertDialogProps>()
|
||||||
|
|
||||||
const emits = defineEmits<AlertDialogEmits>()
|
const emits = defineEmits<AlertDialogEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const emitsAsProps = useEmitAsProps(emits)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@ import {
|
||||||
type AlertDialogContentProps,
|
type AlertDialogContentProps,
|
||||||
AlertDialogOverlay,
|
AlertDialogOverlay,
|
||||||
AlertDialogPortal,
|
AlertDialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<AlertDialogContentProps & { class?: string }>()
|
const props = defineProps<AlertDialogContentProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue'
|
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue'
|
||||||
import { CheckboxIndicator, CheckboxRoot } from 'radix-vue'
|
import { CheckboxIndicator, CheckboxRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { CheckIcon } from '@radix-icons/vue'
|
import { CheckIcon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<CheckboxRootProps>()
|
const props = defineProps<CheckboxRootProps>()
|
||||||
const emits = defineEmits<CheckboxRootEmits>()
|
const emits = defineEmits<CheckboxRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { CollapsibleRoot } from 'radix-vue'
|
import { CollapsibleRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { CollapsibleRootEmits, CollapsibleRootProps } from 'radix-vue'
|
import type { CollapsibleRootEmits, CollapsibleRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<CollapsibleRootProps>()
|
const props = defineProps<CollapsibleRootProps>()
|
||||||
const emits = defineEmits<CollapsibleRootEmits>()
|
const emits = defineEmits<CollapsibleRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
||||||
import { ComboboxRoot } from 'radix-vue'
|
import { ComboboxRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxRootProps>()
|
const props = defineProps<ComboboxRootProps>()
|
||||||
const emits = defineEmits<ComboboxRootEmits>()
|
const emits = defineEmits<ComboboxRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { DialogRootEmits, DialogRootProps } from 'radix-vue'
|
import type { DialogRootEmits, DialogRootProps } from 'radix-vue'
|
||||||
|
import { useEmitAsProps } from 'radix-vue'
|
||||||
import Command from './Command.vue'
|
import Command from './Command.vue'
|
||||||
import { Dialog, DialogContent } from '@/lib/registry/new-york/ui/dialog'
|
import { Dialog, DialogContent } from '@/lib/registry/new-york/ui/dialog'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<DialogRootProps>()
|
const props = defineProps<DialogRootProps>()
|
||||||
const emits = defineEmits<DialogRootEmits>()
|
const emits = defineEmits<DialogRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue'
|
import type { ComboboxItemEmits, ComboboxItemProps } from 'radix-vue'
|
||||||
import { ComboboxItem } from 'radix-vue'
|
import { ComboboxItem, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxItemProps>()
|
const props = defineProps<ComboboxItemProps>()
|
||||||
const emits = defineEmits<ComboboxItemEmits>()
|
const emits = defineEmits<ComboboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue'
|
import type { ComboboxContentEmits, ComboboxContentProps } from 'radix-vue'
|
||||||
import { ComboboxContent } from 'radix-vue'
|
import { ComboboxContent, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxContentProps>()
|
const props = defineProps<ComboboxContentProps>()
|
||||||
const emits = defineEmits<ComboboxContentEmits>()
|
const emits = defineEmits<ComboboxContentEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ComboboxContent v-bind="{ ...props, ...emitsAsProps }" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', $attrs.class ?? '')">
|
<ComboboxContent v-bind="forwarded" :class="cn('max-h-[300px] overflow-y-auto overflow-x-hidden', $attrs.class ?? '')">
|
||||||
<slot />
|
<slot />
|
||||||
</ComboboxContent>
|
</ComboboxContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContextMenuRoot } from 'radix-vue'
|
import { ContextMenuRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRootProps>()
|
const props = defineProps<ContextMenuRootProps>()
|
||||||
const emits = defineEmits<ContextMenuRootEmits>()
|
const emits = defineEmits<ContextMenuRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
type ContextMenuCheckboxItemEmits,
|
type ContextMenuCheckboxItemEmits,
|
||||||
type ContextMenuCheckboxItemProps,
|
type ContextMenuCheckboxItemProps,
|
||||||
ContextMenuItemIndicator,
|
ContextMenuItemIndicator,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { CheckIcon } from '@radix-icons/vue'
|
import { CheckIcon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuCheckboxItemProps & { class?: string }>()
|
const props = defineProps<ContextMenuCheckboxItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuCheckboxItemEmits>()
|
const emits = defineEmits<ContextMenuCheckboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,14 @@ import {
|
||||||
type ContextMenuContentEmits,
|
type ContextMenuContentEmits,
|
||||||
type ContextMenuContentProps,
|
type ContextMenuContentProps,
|
||||||
ContextMenuPortal,
|
ContextMenuPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuContentProps & { class?: string }>()
|
const props = defineProps<ContextMenuContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuContentEmits>()
|
const emits = defineEmits<ContextMenuContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -21,7 +24,7 @@ const emits = defineEmits<ContextMenuContentEmits>()
|
||||||
props.class,
|
props.class,
|
||||||
),
|
),
|
||||||
]"
|
]"
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuContent>
|
</ContextMenuContent>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import {
|
||||||
ContextMenuItem,
|
ContextMenuItem,
|
||||||
type ContextMenuItemEmits,
|
type ContextMenuItemEmits,
|
||||||
type ContextMenuItemProps,
|
type ContextMenuItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuItemProps & { class?: string; inset?: boolean }>()
|
const props = defineProps<ContextMenuItemProps & { class?: string; inset?: boolean }>()
|
||||||
const emits = defineEmits<ContextMenuItemEmits>()
|
const emits = defineEmits<ContextMenuItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
ContextMenuRadioItem,
|
ContextMenuRadioItem,
|
||||||
type ContextMenuRadioItemEmits,
|
type ContextMenuRadioItemEmits,
|
||||||
type ContextMenuRadioItemProps,
|
type ContextMenuRadioItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { DotFilledIcon } from '@radix-icons/vue'
|
import { DotFilledIcon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioItemProps & { class?: string }>()
|
const props = defineProps<ContextMenuRadioItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<ContextMenuRadioItemEmits>()
|
const emits = defineEmits<ContextMenuRadioItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ import {
|
||||||
ContextMenuSubContent,
|
ContextMenuSubContent,
|
||||||
type DropdownMenuSubContentEmits,
|
type DropdownMenuSubContentEmits,
|
||||||
type DropdownMenuSubContentProps,
|
type DropdownMenuSubContentProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubContentProps & { class?: string }>()
|
const props = defineProps<DropdownMenuSubContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuSubContent
|
<ContextMenuSubContent
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'z-50 min-w-[8rem] 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',
|
'z-50 min-w-[8rem] 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',
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@ import {
|
||||||
type DialogContentProps,
|
type DialogContentProps,
|
||||||
DialogOverlay,
|
DialogOverlay,
|
||||||
DialogPortal,
|
DialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Cross2Icon } from '@radix-icons/vue'
|
import { Cross2Icon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DialogContentProps & { class?: string }>()
|
const props = defineProps<DialogContentProps & { class?: string }>()
|
||||||
const emits = defineEmits<DialogContentEmits>()
|
const emits = defineEmits<DialogContentEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps } from 'radix-vue'
|
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRootProps>()
|
const props = defineProps<DropdownMenuRootProps>()
|
||||||
const emits = defineEmits<DropdownMenuRootEmits>()
|
const emits = defineEmits<DropdownMenuRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
type DropdownMenuCheckboxItemEmits,
|
type DropdownMenuCheckboxItemEmits,
|
||||||
type DropdownMenuCheckboxItemProps,
|
type DropdownMenuCheckboxItemProps,
|
||||||
DropdownMenuItemIndicator,
|
DropdownMenuItemIndicator,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { CheckIcon } from '@radix-icons/vue'
|
import { CheckIcon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: string }>()
|
const props = defineProps<DropdownMenuCheckboxItemProps & { class?: string }>()
|
||||||
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
|
type DropdownMenuContentEmits,
|
||||||
type DropdownMenuContentProps,
|
type DropdownMenuContentProps,
|
||||||
DropdownMenuPortal,
|
DropdownMenuPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
|
@ -12,23 +14,21 @@ const props = withDefaults(
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
const emits = defineEmits<DropdownMenuContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuPortal>
|
<DropdownMenuPortal>
|
||||||
<DropdownMenuContent
|
<DropdownMenuContent
|
||||||
:loop="props.loop"
|
|
||||||
:as-child="props.asChild"
|
|
||||||
:side-offset="props.sideOffset"
|
|
||||||
:side="props.side"
|
|
||||||
:align="props.align"
|
|
||||||
:align-offset="props.alignOffset"
|
|
||||||
:class="[
|
:class="[
|
||||||
cn(
|
cn(
|
||||||
'z-50 min-w-[8rem] 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',
|
'z-50 min-w-[8rem] 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',
|
||||||
props.class,
|
props.class,
|
||||||
),
|
),
|
||||||
]"
|
]"
|
||||||
|
v-bind="forwarded"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import {
|
||||||
DropdownMenuRadioItem,
|
DropdownMenuRadioItem,
|
||||||
type DropdownMenuRadioItemEmits,
|
type DropdownMenuRadioItemEmits,
|
||||||
type DropdownMenuRadioItemProps,
|
type DropdownMenuRadioItemProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { DotFilledIcon } from '@radix-icons/vue'
|
import { DotFilledIcon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRadioItemProps & { class?: string }>()
|
const props = defineProps<DropdownMenuRadioItemProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ import {
|
||||||
DropdownMenuSubContent,
|
DropdownMenuSubContent,
|
||||||
type DropdownMenuSubContentEmits,
|
type DropdownMenuSubContentEmits,
|
||||||
type DropdownMenuSubContentProps,
|
type DropdownMenuSubContentProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubContentProps>()
|
const props = defineProps<DropdownMenuSubContentProps>()
|
||||||
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
const emits = defineEmits<DropdownMenuSubContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuSubContent
|
<DropdownMenuSubContent
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="cn('z-50 min-w-[8rem] 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', $attrs.class ?? '')"
|
:class="cn('z-50 min-w-[8rem] 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', $attrs.class ?? '')"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {
|
||||||
HoverCardContent,
|
HoverCardContent,
|
||||||
type HoverCardContentProps,
|
type HoverCardContentProps,
|
||||||
HoverCardPortal,
|
HoverCardPortal,
|
||||||
|
useForwardProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
|
@ -12,12 +13,14 @@ const props = withDefaults(
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const forwarded = useForwardProps(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<HoverCardPortal>
|
<HoverCardPortal>
|
||||||
<HoverCardContent
|
<HoverCardContent
|
||||||
v-bind="props"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'z-50 w-64 rounded-md bg-background border border-border p-4 text-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',
|
'z-50 w-64 rounded-md bg-background border border-border p-4 text-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',
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@ import {
|
||||||
NavigationMenuContent,
|
NavigationMenuContent,
|
||||||
type NavigationMenuContentEmits,
|
type NavigationMenuContentEmits,
|
||||||
type NavigationMenuContentProps,
|
type NavigationMenuContentProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<NavigationMenuContentProps & { class?: string }>()
|
const props = defineProps<NavigationMenuContentProps & { class?: string }>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {
|
||||||
NavigationMenuLink,
|
NavigationMenuLink,
|
||||||
type NavigationMenuLinkEmits,
|
type NavigationMenuLinkEmits,
|
||||||
type NavigationMenuLinkProps,
|
type NavigationMenuLinkProps,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<NavigationMenuLinkProps>()
|
const props = defineProps<NavigationMenuLinkProps>()
|
||||||
const emits = defineEmits<NavigationMenuLinkEmits>()
|
const emits = defineEmits<NavigationMenuLinkEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PopoverRoot } from 'radix-vue'
|
import { PopoverRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<PopoverRootProps>()
|
const props = defineProps<PopoverRootProps>()
|
||||||
const emits = defineEmits<PopoverRootEmits>()
|
const emits = defineEmits<PopoverRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import {
|
||||||
type PopoverContentEmits,
|
type PopoverContentEmits,
|
||||||
type PopoverContentProps,
|
type PopoverContentProps,
|
||||||
PopoverPortal,
|
PopoverPortal,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<PopoverContentProps & { class?: string }>(),
|
defineProps<PopoverContentProps & { class?: string }>(),
|
||||||
|
|
@ -14,13 +15,14 @@ const props = withDefaults(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const emits = defineEmits<PopoverContentEmits>()
|
const emits = defineEmits<PopoverContentEmits>()
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PopoverPortal>
|
<PopoverPortal>
|
||||||
<PopoverContent
|
<PopoverContent
|
||||||
v-bind="{ ...props, ...emitsAsProps, $attrs }"
|
v-bind="{ ...forwarded, ...$attrs }"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'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',
|
'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',
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps } from 'radix-vue'
|
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<RadioGroupRootProps & { class?: string }>()
|
const props = defineProps<RadioGroupRootProps & { class?: string }>()
|
||||||
|
|
||||||
const emits = defineEmits<RadioGroupRootEmits>()
|
const emits = defineEmits<RadioGroupRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const emitsAsProps = useEmitAsProps(emits)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
||||||
import { SelectRoot } from 'radix-vue'
|
import { SelectRoot, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<SelectRootProps>()
|
const props = defineProps<SelectRootProps>()
|
||||||
const emits = defineEmits<SelectRootEmits>()
|
const emits = defineEmits<SelectRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@ import {
|
||||||
type SelectContentProps,
|
type SelectContentProps,
|
||||||
SelectPortal,
|
SelectPortal,
|
||||||
SelectViewport,
|
SelectViewport,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<SelectContentProps & { class?: string }>(), {
|
defineProps<SelectContentProps & { class?: string }>(), {
|
||||||
|
|
@ -15,13 +16,14 @@ const props = withDefaults(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
const emits = defineEmits<SelectContentEmits>()
|
const emits = defineEmits<SelectContentEmits>()
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SelectPortal>
|
<SelectPortal>
|
||||||
<SelectContent
|
<SelectContent
|
||||||
v-bind="{ ...props, ...emitsAsProps, ...$attrs }"
|
v-bind="{ ...forwarded, ...$attrs }"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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',
|
'relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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',
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,11 @@ import {
|
||||||
type DialogContentProps,
|
type DialogContentProps,
|
||||||
DialogOverlay,
|
DialogOverlay,
|
||||||
DialogPortal,
|
DialogPortal,
|
||||||
|
useEmitAsProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cva } from 'class-variance-authority'
|
import { cva } from 'class-variance-authority'
|
||||||
import { Cross2Icon } from '@radix-icons/vue'
|
import { Cross2Icon } from '@radix-icons/vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
interface SheetContentProps extends DialogContentProps {
|
interface SheetContentProps extends DialogContentProps {
|
||||||
side?: 'left' | 'right' | 'top' | 'bottom'
|
side?: 'left' | 'right' | 'top' | 'bottom'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SliderRootEmits, SliderRootProps } from 'radix-vue'
|
import type { SliderRootEmits, SliderRootProps } from 'radix-vue'
|
||||||
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'radix-vue'
|
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useEmitAsProps } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<SliderRootProps>()
|
const props = defineProps<SliderRootProps>()
|
||||||
const emits = defineEmits<SliderRootEmits>()
|
const emits = defineEmits<SliderRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
||||||
import { Toggle } from 'radix-vue'
|
import { Toggle, useEmitAsProps } from 'radix-vue'
|
||||||
import type { VariantProps } from 'class-variance-authority'
|
import type { VariantProps } from 'class-variance-authority'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { toggleVariants } from '.'
|
import { toggleVariants } from '.'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
interface ToggleVariantProps extends VariantProps<typeof toggleVariants> {}
|
interface ToggleVariantProps extends VariantProps<typeof toggleVariants> {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps } from 'radix-vue'
|
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useEmitAsProps } from 'radix-vue'
|
||||||
import { useEmitAsProps } from '@/lib/utils'
|
|
||||||
|
|
||||||
const props = defineProps<TooltipRootProps>()
|
const props = defineProps<TooltipRootProps>()
|
||||||
const emits = defineEmits<TooltipRootEmits>()
|
const emits = defineEmits<TooltipRootEmits>()
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps } from 'radix-vue'
|
import { TooltipContent, type TooltipContentEmits, type TooltipContentProps, TooltipPortal, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn, useEmitAsProps } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<TooltipContentProps>(), {
|
const props = withDefaults(defineProps<TooltipContentProps>(), {
|
||||||
sideOffset: 4,
|
sideOffset: 4,
|
||||||
})
|
})
|
||||||
const emits = defineEmits<TooltipContentEmits>()
|
const emits = defineEmits<TooltipContentEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TooltipContent v-bind="{ ...props, ...useEmitAsProps(emits) }" :class="cn('z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', $attrs.class ?? '')">
|
<TooltipPortal>
|
||||||
|
<TooltipContent v-bind="{ ...forwarded, ...$attrs }" :class="cn('z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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', $attrs.class ?? '')">
|
||||||
<slot />
|
<slot />
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
|
</TooltipPortal>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -7,40 +7,9 @@ export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vue doesn't have emits forwarding, in order to bind the emits we have to convert events into `onXXX` handlers
|
|
||||||
// issue: https://github.com/vuejs/core/issues/5917
|
|
||||||
export function useEmitAsProps<Name extends string>(
|
|
||||||
emit: (name: Name, ...args: any[]) => void,
|
|
||||||
) {
|
|
||||||
const vm = getCurrentInstance()
|
|
||||||
|
|
||||||
const events = vm?.type.emits as Name[]
|
|
||||||
const result: Record<string, any> = {}
|
|
||||||
if (!events?.length) {
|
|
||||||
console.warn(
|
|
||||||
`No emitted event found. Please check component: ${vm?.type.__name}`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
events?.forEach((ev) => {
|
|
||||||
result[toHandlerKey(camelize(ev))] = (...arg: any) => emit(ev, ...arg)
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
|
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
|
||||||
ref.value
|
ref.value
|
||||||
= typeof updaterOrValue === 'function'
|
= typeof updaterOrValue === 'function'
|
||||||
? updaterOrValue(ref.value)
|
? updaterOrValue(ref.value)
|
||||||
: updaterOrValue
|
: updaterOrValue
|
||||||
}
|
}
|
||||||
|
|
||||||
// export type ParseEmits<T extends Record<string, any>> = {
|
|
||||||
// [K in keyof T]: (...args: T[K]) => void;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export function convertToComponent(component: FunctionalComponent) {
|
|
||||||
// return defineComponent({
|
|
||||||
// setup() { return () => h(component) },
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.3.2",
|
||||||
"ora": "^7.0.1",
|
"ora": "^7.0.1",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"radix-vue": "^0.3.2",
|
"radix-vue": "^0.4.0",
|
||||||
"recast": "^0.23.4",
|
"recast": "^0.23.4",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"ts-morph": "^19.0.0",
|
"ts-morph": "^19.0.0",
|
||||||
|
|
|
||||||
|
|
@ -5,25 +5,7 @@ import { camelize, getCurrentInstance, toHandlerKey } from 'vue'
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
`
|
||||||
export function useEmitAsProps<Name extends string>(
|
|
||||||
emit: (name: Name, ...args: any[]) => void,
|
|
||||||
) {
|
|
||||||
const vm = getCurrentInstance()
|
|
||||||
|
|
||||||
const events = vm?.type.emits as Name[]
|
|
||||||
const result: Record<string, any> = {}
|
|
||||||
if (!events?.length) {
|
|
||||||
console.warn(
|
|
||||||
\`No emitted event found. Please check component: \${vm?.type.__name}\`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
events?.forEach((ev) => {
|
|
||||||
result[toHandlerKey(camelize(ev))] = (...arg: any) => emit(ev, ...arg)
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}`
|
|
||||||
|
|
||||||
export const TAILWIND_CONFIG = `/** @type {import('tailwindcss').Config} */
|
export const TAILWIND_CONFIG = `/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
||||||
19
packages/cli/test/fixtures/nuxt/lib/utils.ts
vendored
19
packages/cli/test/fixtures/nuxt/lib/utils.ts
vendored
|
|
@ -5,22 +5,3 @@ import { camelize, getCurrentInstance, toHandlerKey } from 'vue'
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useEmitAsProps<Name extends string>(
|
|
||||||
emit: (name: Name, ...args: any[]) => void,
|
|
||||||
) {
|
|
||||||
const vm = getCurrentInstance()
|
|
||||||
|
|
||||||
const events = vm?.type.emits as Name[]
|
|
||||||
const result: Record<string, any> = {}
|
|
||||||
if (!events?.length) {
|
|
||||||
console.warn(
|
|
||||||
`No emitted event found. Please check component: ${vm?.type.__name}`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
events?.forEach((ev) => {
|
|
||||||
result[toHandlerKey(camelize(ev))] = (...arg: any) => emit(ev, ...arg)
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
|
||||||
2
packages/cli/test/fixtures/nuxt/package.json
vendored
2
packages/cli/test/fixtures/nuxt/package.json
vendored
|
|
@ -13,7 +13,7 @@
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"lucide-vue-next": "^0.276.0",
|
"lucide-vue-next": "^0.276.0",
|
||||||
"radix-vue": "^0.3.2",
|
"radix-vue": "^0.4.0",
|
||||||
"tailwind-merge": "^1.14.0",
|
"tailwind-merge": "^1.14.0",
|
||||||
"tailwindcss-animate": "^1.0.7"
|
"tailwindcss-animate": "^1.0.7"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,8 @@ importers:
|
||||||
specifier: ^4.5.0
|
specifier: ^4.5.0
|
||||||
version: 4.5.0
|
version: 4.5.0
|
||||||
radix-vue:
|
radix-vue:
|
||||||
specifier: ^0.3.2
|
specifier: ^0.4.0
|
||||||
version: 0.3.2(vue@3.3.4)
|
version: 0.4.0(vue@3.3.4)
|
||||||
rimraf:
|
rimraf:
|
||||||
specifier: ^5.0.1
|
specifier: ^5.0.1
|
||||||
version: 5.0.5
|
version: 5.0.5
|
||||||
|
|
@ -223,8 +223,8 @@ importers:
|
||||||
specifier: ^2.4.2
|
specifier: ^2.4.2
|
||||||
version: 2.4.2
|
version: 2.4.2
|
||||||
radix-vue:
|
radix-vue:
|
||||||
specifier: ^0.3.2
|
specifier: ^0.4.0
|
||||||
version: 0.3.2(vue@3.3.4)
|
version: 0.4.0(vue@3.3.4)
|
||||||
recast:
|
recast:
|
||||||
specifier: ^0.23.4
|
specifier: ^0.23.4
|
||||||
version: 0.23.4
|
version: 0.23.4
|
||||||
|
|
@ -6921,8 +6921,8 @@ packages:
|
||||||
resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==}
|
resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/radix-vue@0.3.2(vue@3.3.4):
|
/radix-vue@0.4.0(vue@3.3.4):
|
||||||
resolution: {integrity: sha512-u7ldJ01C1YRF3dtNAKhr3P3i9rLK0zzRHBPx9SaWqyjV3mgV2bLjkDEf2UvLZel+HABdtXO4x1NW2DltdFYatQ==}
|
resolution: {integrity: sha512-CRyXAS70i5Ps0Md9+Mj9F5proA7N6I4waYg8JR+5pnbfuzrNhYESSEmJCLreETK0Qi2newMISQZgBuuHDTbe+A==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@floating-ui/dom': 1.5.3
|
'@floating-ui/dom': 1.5.3
|
||||||
'@floating-ui/vue': 1.0.2(vue@3.3.4)
|
'@floating-ui/vue': 1.0.2(vue@3.3.4)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user