mirror of
https://github.com/versia-pub/frontend.git
synced 2026-06-14 15:39:15 +02:00
chore: ⬆️ Upgrade to Nuxt 4
Some checks failed
Some checks failed
This commit is contained in:
parent
8debe97f63
commit
7f7cf20311
386 changed files with 2376 additions and 2332 deletions
42
app/components/ui/toggle/Toggle.vue
Normal file
42
app/components/ui/toggle/Toggle.vue
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<script setup lang="ts">
|
||||
import { reactiveOmit } from "@vueuse/core";
|
||||
import {
|
||||
Toggle,
|
||||
type ToggleEmits,
|
||||
type ToggleProps,
|
||||
useForwardPropsEmits,
|
||||
} from "reka-ui";
|
||||
import type { HTMLAttributes } from "vue";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type ToggleVariants, toggleVariants } from ".";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<
|
||||
ToggleProps & {
|
||||
class?: HTMLAttributes["class"];
|
||||
variant?: ToggleVariants["variant"];
|
||||
size?: ToggleVariants["size"];
|
||||
}
|
||||
>(),
|
||||
{
|
||||
variant: "default",
|
||||
size: "default",
|
||||
disabled: false,
|
||||
},
|
||||
);
|
||||
|
||||
const emits = defineEmits<ToggleEmits>();
|
||||
|
||||
const delegatedProps = reactiveOmit(props, "class", "size", "variant");
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Toggle
|
||||
data-slot="toggle"
|
||||
v-bind="forwarded"
|
||||
:class="cn(toggleVariants({ variant, size }), props.class)"
|
||||
>
|
||||
<slot />
|
||||
</Toggle>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue