refactor: apply all v1 changes
This commit is contained in:
parent
2f9845efcd
commit
fdce4d63c3
|
|
@ -96,9 +96,9 @@ const value = ref({})
|
||||||
|
|
||||||
<ComponentPreview name="ComboboxPopover" />
|
<ComponentPreview name="ComboboxPopover" />
|
||||||
|
|
||||||
<!-- ### Dropdown menu
|
### Dropdown menu
|
||||||
|
|
||||||
<ComponentPreview name="ComboboxDropdownMenu" /> -->
|
<ComponentPreview name="ComboboxDropdownMenu" />
|
||||||
|
|
||||||
### Form
|
### Form
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ const filterFunction = (list: typeof frameworks, search: string) => list.filter(
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent class="w-[200px] p-0">
|
<PopoverContent class="w-[200px] p-0">
|
||||||
<Command v-model="value" :filter-function="filterFunction">
|
<Command :filter-function="filterFunction">
|
||||||
<CommandInput placeholder="Search framework..." />
|
<CommandInput placeholder="Search framework..." />
|
||||||
<CommandEmpty>No framework found.</CommandEmpty>
|
<CommandEmpty>No framework found.</CommandEmpty>
|
||||||
<CommandGroup>
|
<CommandGroup>
|
||||||
|
|
@ -53,7 +53,10 @@ const filterFunction = (list: typeof frameworks, search: string) => list.filter(
|
||||||
v-for="framework in frameworks"
|
v-for="framework in frameworks"
|
||||||
:key="framework.value"
|
:key="framework.value"
|
||||||
:value="framework"
|
:value="framework"
|
||||||
@select="open = false"
|
@select="(ev) => {
|
||||||
|
value = ev.detail.value as typeof framework
|
||||||
|
open = false
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<Check
|
<Check
|
||||||
:class="cn(
|
:class="cn(
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ const open = ref(false)
|
||||||
</span>
|
</span>
|
||||||
<span class="text-muted-foreground">Create a new project</span>
|
<span class="text-muted-foreground">Create a new project</span>
|
||||||
</p>
|
</p>
|
||||||
<DropdownMenu :open="open">
|
<DropdownMenu v-model:open="open">
|
||||||
<DropdownMenuTrigger as-child>
|
<DropdownMenuTrigger as-child>
|
||||||
<Button variant="ghost" size="sm">
|
<Button variant="ghost" size="sm">
|
||||||
<MoreHorizontal />
|
<MoreHorizontal />
|
||||||
|
|
@ -83,8 +83,8 @@ const open = ref(false)
|
||||||
v-for="label in labels"
|
v-for="label in labels"
|
||||||
:key="label"
|
:key="label"
|
||||||
:value="label"
|
:value="label"
|
||||||
@select="(value) => {
|
@select="(ev) => {
|
||||||
labelRef = value as string
|
labelRef = ev.detail.value as string
|
||||||
open = false
|
open = false
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ import {
|
||||||
</ContextMenuCheckboxItem>
|
</ContextMenuCheckboxItem>
|
||||||
<ContextMenuCheckboxItem>Show Full URLs</ContextMenuCheckboxItem>
|
<ContextMenuCheckboxItem>Show Full URLs</ContextMenuCheckboxItem>
|
||||||
<ContextMenuSeparator />
|
<ContextMenuSeparator />
|
||||||
<ContextMenuRadioGroup value="pedro">
|
<ContextMenuRadioGroup model-value="pedro">
|
||||||
<ContextMenuLabel inset>
|
<ContextMenuLabel inset>
|
||||||
People
|
People
|
||||||
</ContextMenuLabel>
|
</ContextMenuLabel>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { Label } from '@/lib/registry/default/ui/label'
|
||||||
Edit Profile
|
Edit Profile
|
||||||
</Button>
|
</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent class="sm:max-w-[425px]" @escape-key-down.prevent>
|
<DialogContent class="sm:max-w-[425px]">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Edit profile</DialogTitle>
|
<DialogTitle>Edit profile</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const emits = defineEmits<AccordionRootEmits>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AccordionRoot v-bind="{ ...props, ...useEmitAsProps(emits) }" class="accordion">
|
<AccordionRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
||||||
<slot />
|
<slot />
|
||||||
</AccordionRoot>
|
</AccordionRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useEmitAsProps } from 'radix-vue'
|
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<AlertDialogProps>()
|
const props = defineProps<AlertDialogProps>()
|
||||||
const emits = defineEmits<AlertDialogEmits>()
|
const emits = defineEmits<AlertDialogEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AlertDialogRoot v-bind="{ ...props, ...emitsAsProps }">
|
<AlertDialogRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</AlertDialogRoot>
|
</AlertDialogRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<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, useEmitAsProps } from 'radix-vue'
|
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { Check } from 'lucide-vue-next'
|
import { Check } from 'lucide-vue-next'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<CheckboxRootProps>()
|
const props = defineProps<CheckboxRootProps>()
|
||||||
const emits = defineEmits<CheckboxRootEmits>()
|
const emits = defineEmits<CheckboxRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CheckboxRoot
|
<CheckboxRoot
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
||||||
$attrs.class ?? '')"
|
$attrs.class ?? '')"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const props = defineProps<CollapsibleContentProps>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CollapsibleContent v-bind="props">
|
<CollapsibleContent v-bind="props" class="overflow-hidden transition-all data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
|
||||||
<slot />
|
<slot />
|
||||||
</CollapsibleContent>
|
</CollapsibleContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
||||||
import { ComboboxRoot, useEmitAsProps } from 'radix-vue'
|
import { ComboboxRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxRootProps>()
|
const props = defineProps<ComboboxRootProps>()
|
||||||
const emits = defineEmits<ComboboxRootEmits>()
|
const emits = defineEmits<ComboboxRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ComboboxRoot
|
<ComboboxRoot
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="forwarded"
|
||||||
:open="true"
|
:open="true"
|
||||||
:model-value="''"
|
:model-value="''"
|
||||||
:class="cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', $attrs.class ?? '')"
|
:class="cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', $attrs.class ?? '')"
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const emitsAsProps = useEmitAsProps(emits)
|
||||||
<ComboboxItem
|
<ComboboxItem
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="{ ...props, ...emitsAsProps }"
|
||||||
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', $attrs.class ?? '')"
|
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', $attrs.class ?? '')"
|
||||||
|
@select.prevent
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</ComboboxItem>
|
</ComboboxItem>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContextMenuRoot, useEmitAsProps } from 'radix-vue'
|
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRootProps>()
|
const props = defineProps<ContextMenuRootProps>()
|
||||||
const emits = defineEmits<ContextMenuRootEmits>()
|
const emits = defineEmits<ContextMenuRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<ContextMenuRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuRoot>
|
</ContextMenuRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,17 @@ import {
|
||||||
ContextMenuRadioGroup,
|
ContextMenuRadioGroup,
|
||||||
type ContextMenuRadioGroupEmits,
|
type ContextMenuRadioGroupEmits,
|
||||||
type ContextMenuRadioGroupProps,
|
type ContextMenuRadioGroupProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioGroupProps>()
|
const props = defineProps<ContextMenuRadioGroupProps>()
|
||||||
|
|
||||||
const emits = defineEmits<ContextMenuRadioGroupEmits>()
|
const emits = defineEmits<ContextMenuRadioGroupEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRadioGroup
|
<ContextMenuRadioGroup v-bind="forwarded">
|
||||||
v-bind="props"
|
|
||||||
@update:model-value="emits('update:modelValue', $event)"
|
|
||||||
>
|
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuRadioGroup>
|
</ContextMenuRadioGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,20 @@ import {
|
||||||
ContextMenuRadioItem,
|
ContextMenuRadioItem,
|
||||||
type ContextMenuRadioItemEmits,
|
type ContextMenuRadioItemEmits,
|
||||||
type ContextMenuRadioItemProps,
|
type ContextMenuRadioItemProps,
|
||||||
useEmitAsProps,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { Circle } from 'lucide-vue-next'
|
import { Circle } from 'lucide-vue-next'
|
||||||
import { cn } 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>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRadioItem
|
<ContextMenuRadioItem
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="[
|
:class="[
|
||||||
cn(
|
cn(
|
||||||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,17 @@ import {
|
||||||
ContextMenuSub,
|
ContextMenuSub,
|
||||||
type ContextMenuSubEmits,
|
type ContextMenuSubEmits,
|
||||||
type ContextMenuSubProps,
|
type ContextMenuSubProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuSubProps>()
|
const props = defineProps<ContextMenuSubProps>()
|
||||||
|
|
||||||
const emits = defineEmits<ContextMenuSubEmits>()
|
const emits = defineEmits<ContextMenuSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuSub v-bind="props" @update:open="emits('update:open', $event)">
|
<ContextMenuSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuSub>
|
</ContextMenuSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps } from 'radix-vue'
|
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRootProps>()
|
const props = defineProps<DropdownMenuRootProps>()
|
||||||
const emits = defineEmits<DropdownMenuRootEmits>()
|
const emits = defineEmits<DropdownMenuRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<DropdownMenuRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuRoot>
|
</DropdownMenuRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,17 @@ import {
|
||||||
DropdownMenuSub,
|
DropdownMenuSub,
|
||||||
type DropdownMenuSubEmits,
|
type DropdownMenuSubEmits,
|
||||||
type DropdownMenuSubProps,
|
type DropdownMenuSubProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubProps>()
|
const props = defineProps<DropdownMenuSubProps>()
|
||||||
|
|
||||||
const emits = defineEmits<DropdownMenuSubEmits>()
|
const emits = defineEmits<DropdownMenuSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuSub v-bind="props" @update:open="emits('update:open', $event)">
|
<DropdownMenuSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuSub>
|
</DropdownMenuSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { HoverCardRoot, type HoverCardRootProps } from 'radix-vue'
|
import { HoverCardRoot, type HoverCardRootProps, useForwardProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<HoverCardRootProps>()
|
const props = defineProps<HoverCardRootProps>()
|
||||||
|
const forwarded = useForwardProps(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<HoverCardRoot v-bind="props">
|
<HoverCardRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</HoverCardRoot>
|
</HoverCardRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import { MenubarSub, type MenubarSubEmits, useForwardPropsEmits } from 'radix-vue'
|
||||||
MenubarSub,
|
|
||||||
type MenubarSubEmits,
|
|
||||||
} from 'radix-vue'
|
|
||||||
|
|
||||||
interface MenubarSubRootProps {
|
interface MenubarSubRootProps {
|
||||||
defaultOpen?: boolean
|
defaultOpen?: boolean
|
||||||
|
|
@ -10,12 +7,13 @@ interface MenubarSubRootProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<MenubarSubRootProps>()
|
const props = defineProps<MenubarSubRootProps>()
|
||||||
|
|
||||||
const emits = defineEmits<MenubarSubEmits>()
|
const emits = defineEmits<MenubarSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MenubarSub v-bind="props" @update:open="emits('update:open', $event)">
|
<MenubarSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</MenubarSub>
|
</MenubarSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { MenubarSubTrigger, type MenubarSubTriggerProps } from 'radix-vue'
|
import { MenubarSubTrigger, type MenubarSubTriggerProps } from 'radix-vue'
|
||||||
|
import { ChevronRight } from 'lucide-vue-next'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: string }>()
|
const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: string }>()
|
||||||
|
|
@ -17,5 +18,6 @@ const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: st
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
<ChevronRight class="ml-auto h-4 w-4" />
|
||||||
</MenubarSubTrigger>
|
</MenubarSubTrigger>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PopoverRoot, useEmitAsProps } from 'radix-vue'
|
import { PopoverRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<PopoverRootProps>()
|
const props = defineProps<PopoverRootProps>()
|
||||||
const emits = defineEmits<PopoverRootEmits>()
|
const emits = defineEmits<PopoverRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PopoverRoot v-bind="{ ...props, ...emitsAsProps }">
|
<PopoverRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</PopoverRoot>
|
</PopoverRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useEmitAsProps } from 'radix-vue'
|
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn } 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 forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RadioGroupRoot :class="cn('grid gap-2', props.class)" v-bind="{ ...props, ...emitsAsProps }">
|
<RadioGroupRoot :class="cn('grid gap-2', props.class)" v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</RadioGroupRoot>
|
</RadioGroupRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
||||||
import { SelectRoot, useEmitAsProps } from 'radix-vue'
|
import { SelectRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<SelectRootProps>()
|
const props = defineProps<SelectRootProps>()
|
||||||
const emits = defineEmits<SelectRootEmits>()
|
const emits = defineEmits<SelectRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SelectRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<SelectRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</SelectRoot>
|
</SelectRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,26 @@ import {
|
||||||
type SwitchRootEmits,
|
type SwitchRootEmits,
|
||||||
type SwitchRootProps,
|
type SwitchRootProps,
|
||||||
SwitchThumb,
|
SwitchThumb,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<SwitchRootProps & { class?: string }>()
|
const props = defineProps<SwitchRootProps & { class?: string }>()
|
||||||
|
|
||||||
const emits = defineEmits<SwitchRootEmits>()
|
const emits = defineEmits<SwitchRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
|
console.log(props, forwarded)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SwitchRoot
|
<SwitchRoot
|
||||||
v-bind="props"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
'peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
||||||
props.class,
|
props.class,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
@update:checked="emits('update:checked', $event)"
|
|
||||||
>
|
>
|
||||||
<SwitchThumb
|
<SwitchThumb
|
||||||
:class="
|
:class="
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
||||||
import { Toggle, useEmitAsProps } from 'radix-vue'
|
import { Toggle, useForwardPropsEmits } 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 '.'
|
||||||
|
|
@ -23,11 +23,13 @@ const toggleProps = computed(() => {
|
||||||
const { variant, size, ...otherProps } = props
|
const { variant, size, ...otherProps } = props
|
||||||
return otherProps
|
return otherProps
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(toggleProps, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Toggle
|
<Toggle
|
||||||
v-bind="{ ...toggleProps, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="cn(toggleVariants({ variant, size, class: $attrs.class ?? '' }))"
|
:class="cn(toggleVariants({ variant, size, class: $attrs.class ?? '' }))"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useEmitAsProps } from 'radix-vue'
|
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<TooltipRootProps>()
|
const props = defineProps<TooltipRootProps>()
|
||||||
const emits = defineEmits<TooltipRootEmits>()
|
const emits = defineEmits<TooltipRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TooltipRoot v-bind="{ ...props, ...emitsAsProps }">
|
<TooltipRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</TooltipRoot>
|
</TooltipRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,10 @@ const filterFunction = (list: typeof frameworks, search: string) => list.filter(
|
||||||
v-for="framework in frameworks"
|
v-for="framework in frameworks"
|
||||||
:key="framework.value"
|
:key="framework.value"
|
||||||
:value="framework"
|
:value="framework"
|
||||||
@select="open = false"
|
@select="(ev) => {
|
||||||
|
value = ev.detail.value as typeof framework
|
||||||
|
open = false
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
{{ framework.label }}
|
{{ framework.label }}
|
||||||
<CheckIcon
|
<CheckIcon
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ const open = ref(false)
|
||||||
</span>
|
</span>
|
||||||
<span class="text-muted-foreground">Create a new project</span>
|
<span class="text-muted-foreground">Create a new project</span>
|
||||||
</p>
|
</p>
|
||||||
<DropdownMenu :open="open">
|
<DropdownMenu v-model:open="open">
|
||||||
<DropdownMenuTrigger as-child>
|
<DropdownMenuTrigger as-child>
|
||||||
<Button variant="ghost" size="sm">
|
<Button variant="ghost" size="sm">
|
||||||
<DotsHorizontalIcon />
|
<DotsHorizontalIcon />
|
||||||
|
|
@ -80,8 +80,8 @@ const open = ref(false)
|
||||||
v-for="label in labels"
|
v-for="label in labels"
|
||||||
:key="label"
|
:key="label"
|
||||||
:value="label"
|
:value="label"
|
||||||
@select="(value) => {
|
@select="(ev) => {
|
||||||
labelRef = value as string
|
labelRef = ev.detail.value as string
|
||||||
open = false
|
open = false
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ import {
|
||||||
</ContextMenuCheckboxItem>
|
</ContextMenuCheckboxItem>
|
||||||
<ContextMenuCheckboxItem>Show Full URLs</ContextMenuCheckboxItem>
|
<ContextMenuCheckboxItem>Show Full URLs</ContextMenuCheckboxItem>
|
||||||
<ContextMenuSeparator />
|
<ContextMenuSeparator />
|
||||||
<ContextMenuRadioGroup value="pedro">
|
<ContextMenuRadioGroup model-value="pedro">
|
||||||
<ContextMenuLabel inset>
|
<ContextMenuLabel inset>
|
||||||
People
|
People
|
||||||
</ContextMenuLabel>
|
</ContextMenuLabel>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import { Label } from '@/lib/registry/new-york/ui/label'
|
||||||
Edit Profile
|
Edit Profile
|
||||||
</Button>
|
</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent class="sm:max-w-[425px]" @escape-key-down.prevent>
|
<DialogContent class="sm:max-w-[425px]">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Edit profile</DialogTitle>
|
<DialogTitle>Edit profile</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const emits = defineEmits<AccordionRootEmits>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AccordionRoot v-bind="{ ...props, ...useEmitAsProps(emits) }" class="accordion">
|
<AccordionRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
||||||
<slot />
|
<slot />
|
||||||
</AccordionRoot>
|
</AccordionRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useEmitAsProps } from 'radix-vue'
|
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<AlertDialogProps>()
|
const props = defineProps<AlertDialogProps>()
|
||||||
const emits = defineEmits<AlertDialogEmits>()
|
const emits = defineEmits<AlertDialogEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<AlertDialogRoot v-bind="{ ...props, ...emitsAsProps }">
|
<AlertDialogRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</AlertDialogRoot>
|
</AlertDialogRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
<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, useEmitAsProps } from 'radix-vue'
|
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { CheckIcon } from '@radix-icons/vue'
|
import { CheckIcon } from '@radix-icons/vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<CheckboxRootProps>()
|
const props = defineProps<CheckboxRootProps>()
|
||||||
const emits = defineEmits<CheckboxRootEmits>()
|
const emits = defineEmits<CheckboxRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CheckboxRoot
|
<CheckboxRoot
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
|
||||||
$attrs.class ?? '')"
|
$attrs.class ?? '')"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const props = defineProps<CollapsibleContentProps>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CollapsibleContent v-bind="props">
|
<CollapsibleContent v-bind="props" class="overflow-hidden transition-all data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down">
|
||||||
<slot />
|
<slot />
|
||||||
</CollapsibleContent>
|
</CollapsibleContent>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
import type { ComboboxRootEmits, ComboboxRootProps } from 'radix-vue'
|
||||||
import { ComboboxRoot, useEmitAsProps } from 'radix-vue'
|
import { ComboboxRoot, useEmitAsProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<ComboboxRootProps>()
|
const props = defineProps<ComboboxRootProps>()
|
||||||
const emits = defineEmits<ComboboxRootEmits>()
|
const emits = defineEmits<ComboboxRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ComboboxRoot
|
<ComboboxRoot
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="forwarded"
|
||||||
:open="true"
|
:open="true"
|
||||||
:class="cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', $attrs.class ?? '')"
|
:class="cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', $attrs.class ?? '')"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ const emitsAsProps = useEmitAsProps(emits)
|
||||||
<ComboboxItem
|
<ComboboxItem
|
||||||
v-bind="{ ...props, ...emitsAsProps }"
|
v-bind="{ ...props, ...emitsAsProps }"
|
||||||
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', $attrs.class ?? '')"
|
:class="cn('relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', $attrs.class ?? '')"
|
||||||
|
@select.prevent
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</ComboboxItem>
|
</ComboboxItem>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ContextMenuRoot, useEmitAsProps } from 'radix-vue'
|
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRootProps>()
|
const props = defineProps<ContextMenuRootProps>()
|
||||||
const emits = defineEmits<ContextMenuRootEmits>()
|
const emits = defineEmits<ContextMenuRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<ContextMenuRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuRoot>
|
</ContextMenuRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,17 @@ import {
|
||||||
ContextMenuRadioGroup,
|
ContextMenuRadioGroup,
|
||||||
type ContextMenuRadioGroupEmits,
|
type ContextMenuRadioGroupEmits,
|
||||||
type ContextMenuRadioGroupProps,
|
type ContextMenuRadioGroupProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuRadioGroupProps>()
|
const props = defineProps<ContextMenuRadioGroupProps>()
|
||||||
|
|
||||||
const emits = defineEmits<ContextMenuRadioGroupEmits>()
|
const emits = defineEmits<ContextMenuRadioGroupEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRadioGroup
|
<ContextMenuRadioGroup v-bind="forwarded">
|
||||||
v-bind="props"
|
|
||||||
@update:model-value="emits('update:modelValue', $event)"
|
|
||||||
>
|
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuRadioGroup>
|
</ContextMenuRadioGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,20 @@ import {
|
||||||
ContextMenuRadioItem,
|
ContextMenuRadioItem,
|
||||||
type ContextMenuRadioItemEmits,
|
type ContextMenuRadioItemEmits,
|
||||||
type ContextMenuRadioItemProps,
|
type ContextMenuRadioItemProps,
|
||||||
useEmitAsProps,
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { DotFilledIcon } from '@radix-icons/vue'
|
import { DotFilledIcon } from '@radix-icons/vue'
|
||||||
import { cn } 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>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuRadioItem
|
<ContextMenuRadioItem
|
||||||
v-bind="{ ...props, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="[
|
:class="[
|
||||||
cn(
|
cn(
|
||||||
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,17 @@ import {
|
||||||
ContextMenuSub,
|
ContextMenuSub,
|
||||||
type ContextMenuSubEmits,
|
type ContextMenuSubEmits,
|
||||||
type ContextMenuSubProps,
|
type ContextMenuSubProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<ContextMenuSubProps>()
|
const props = defineProps<ContextMenuSubProps>()
|
||||||
|
|
||||||
const emits = defineEmits<ContextMenuSubEmits>()
|
const emits = defineEmits<ContextMenuSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ContextMenuSub v-bind="props" @update:open="emits('update:open', $event)">
|
<ContextMenuSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</ContextMenuSub>
|
</ContextMenuSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps } from 'radix-vue'
|
import { DropdownMenuRoot, type DropdownMenuRootEmits, type DropdownMenuRootProps, useEmitAsProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuRootProps>()
|
const props = defineProps<DropdownMenuRootProps>()
|
||||||
const emits = defineEmits<DropdownMenuRootEmits>()
|
const emits = defineEmits<DropdownMenuRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<DropdownMenuRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuRoot>
|
</DropdownMenuRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,17 @@ import {
|
||||||
DropdownMenuSub,
|
DropdownMenuSub,
|
||||||
type DropdownMenuSubEmits,
|
type DropdownMenuSubEmits,
|
||||||
type DropdownMenuSubProps,
|
type DropdownMenuSubProps,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<DropdownMenuSubProps>()
|
const props = defineProps<DropdownMenuSubProps>()
|
||||||
|
|
||||||
const emits = defineEmits<DropdownMenuSubEmits>()
|
const emits = defineEmits<DropdownMenuSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DropdownMenuSub v-bind="props" @update:open="emits('update:open', $event)">
|
<DropdownMenuSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</DropdownMenuSub>
|
</DropdownMenuSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { HoverCardRoot, type HoverCardRootProps } from 'radix-vue'
|
import { HoverCardRoot, type HoverCardRootProps, useForwardProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<HoverCardRootProps>()
|
const props = defineProps<HoverCardRootProps>()
|
||||||
|
const forwarded = useForwardProps(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<HoverCardRoot v-bind="props">
|
<HoverCardRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</HoverCardRoot>
|
</HoverCardRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {
|
||||||
MenubarContent,
|
MenubarContent,
|
||||||
type MenubarContentProps,
|
type MenubarContentProps,
|
||||||
MenubarPortal,
|
MenubarPortal,
|
||||||
|
useForwardProps,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
|
@ -14,17 +15,13 @@ const props = withDefaults(
|
||||||
sideOffset: 8,
|
sideOffset: 8,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
const forwarded = useForwardProps(props)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MenubarPortal>
|
<MenubarPortal>
|
||||||
<MenubarContent
|
<MenubarContent
|
||||||
:loop="props.loop"
|
v-bind="forwarded"
|
||||||
: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-[12rem] 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',
|
'z-50 min-w-[12rem] 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',
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import { MenubarSub, type MenubarSubEmits, useForwardPropsEmits } from 'radix-vue'
|
||||||
MenubarSub,
|
|
||||||
type MenubarSubEmits,
|
|
||||||
} from 'radix-vue'
|
|
||||||
|
|
||||||
interface MenubarSubRootProps {
|
interface MenubarSubRootProps {
|
||||||
defaultOpen?: boolean
|
defaultOpen?: boolean
|
||||||
|
|
@ -10,12 +7,13 @@ interface MenubarSubRootProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<MenubarSubRootProps>()
|
const props = defineProps<MenubarSubRootProps>()
|
||||||
|
|
||||||
const emits = defineEmits<MenubarSubEmits>()
|
const emits = defineEmits<MenubarSubEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MenubarSub v-bind="props" @update:open="emits('update:open', $event)">
|
<MenubarSub v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</MenubarSub>
|
</MenubarSub>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { MenubarSubTrigger, type MenubarSubTriggerProps } from 'radix-vue'
|
import { MenubarSubTrigger, type MenubarSubTriggerProps } from 'radix-vue'
|
||||||
|
import { ChevronRightIcon } from '@radix-icons/vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: string }>()
|
const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: string }>()
|
||||||
|
|
@ -17,5 +18,6 @@ const props = defineProps<MenubarSubTriggerProps & { inset?: boolean; class?: st
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
<ChevronRightIcon class="ml-auto h-4 w-4" />
|
||||||
</MenubarSubTrigger>
|
</MenubarSubTrigger>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PopoverRoot, useEmitAsProps } from 'radix-vue'
|
import { PopoverRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<PopoverRootProps>()
|
const props = defineProps<PopoverRootProps>()
|
||||||
const emits = defineEmits<PopoverRootEmits>()
|
const emits = defineEmits<PopoverRootEmits>()
|
||||||
|
|
||||||
const emitsAsProps = useEmitAsProps(emits)
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PopoverRoot v-bind="{ ...props, ...emitsAsProps }">
|
<PopoverRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</PopoverRoot>
|
</PopoverRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useEmitAsProps } from 'radix-vue'
|
import { RadioGroupRoot, type RadioGroupRootEmits, type RadioGroupRootProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
import { cn } 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 forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RadioGroupRoot :class="cn('grid gap-2', props.class)" v-bind="{ ...props, ...emitsAsProps }">
|
<RadioGroupRoot :class="cn('grid gap-2', props.class)" v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</RadioGroupRoot>
|
</RadioGroupRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
import type { SelectRootEmits, SelectRootProps } from 'radix-vue'
|
||||||
import { SelectRoot, useEmitAsProps } from 'radix-vue'
|
import { SelectRoot, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<SelectRootProps>()
|
const props = defineProps<SelectRootProps>()
|
||||||
const emits = defineEmits<SelectRootEmits>()
|
const emits = defineEmits<SelectRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SelectRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<SelectRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</SelectRoot>
|
</SelectRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,25 @@ import {
|
||||||
type SwitchRootEmits,
|
type SwitchRootEmits,
|
||||||
type SwitchRootProps,
|
type SwitchRootProps,
|
||||||
SwitchThumb,
|
SwitchThumb,
|
||||||
|
useForwardPropsEmits,
|
||||||
} from 'radix-vue'
|
} from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const props = defineProps<SwitchRootProps & { class?: string }>()
|
const props = defineProps<SwitchRootProps & { class?: string }>()
|
||||||
|
|
||||||
const emits = defineEmits<SwitchRootEmits>()
|
const emits = defineEmits<SwitchRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SwitchRoot
|
<SwitchRoot
|
||||||
v-bind="props"
|
v-bind="forwarded"
|
||||||
:class="
|
:class="
|
||||||
cn(
|
cn(
|
||||||
'peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
'peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
||||||
props.class,
|
props.class,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
@update:checked="emits('update:checked', $event)"
|
|
||||||
>
|
>
|
||||||
<SwitchThumb
|
<SwitchThumb
|
||||||
:class="
|
:class="
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
import type { ToggleEmits, ToggleProps } from 'radix-vue'
|
||||||
import { Toggle, useEmitAsProps } from 'radix-vue'
|
import { Toggle, useForwardPropsEmits } 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 '.'
|
||||||
|
|
@ -23,11 +23,13 @@ const toggleProps = computed(() => {
|
||||||
const { variant, size, ...otherProps } = props
|
const { variant, size, ...otherProps } = props
|
||||||
return otherProps
|
return otherProps
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(toggleProps, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Toggle
|
<Toggle
|
||||||
v-bind="{ ...toggleProps, ...useEmitAsProps(emits) }"
|
v-bind="forwarded"
|
||||||
:class="cn(toggleVariants({ variant, size, class: $attrs.class ?? '' }))"
|
:class="cn(toggleVariants({ variant, size, class: $attrs.class ?? '' }))"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useEmitAsProps } from 'radix-vue'
|
import { TooltipRoot, type TooltipRootEmits, type TooltipRootProps, useForwardPropsEmits } from 'radix-vue'
|
||||||
|
|
||||||
const props = defineProps<TooltipRootProps>()
|
const props = defineProps<TooltipRootProps>()
|
||||||
const emits = defineEmits<TooltipRootEmits>()
|
const emits = defineEmits<TooltipRootEmits>()
|
||||||
|
|
||||||
|
const forwarded = useForwardPropsEmits(props, emits)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<TooltipRoot v-bind="{ ...props, ...useEmitAsProps(emits) }">
|
<TooltipRoot v-bind="forwarded">
|
||||||
<slot />
|
<slot />
|
||||||
</TooltipRoot>
|
</TooltipRoot>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
950
pnpm-lock.yaml
950
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user