Commit dcc1fcd5 by vben

chore: rename @vben-core -> @core

1 parent 1d6b1f49
Showing 546 changed files with 3979 additions and 4029 deletions
export { default as VbenIcon } from './icon.vue';
export { default as VbenInputPassword } from './input-password.vue';
export { default as VbenInput } from './input.vue';
export type * from './interface';
export { default as VbenLogo } from './logo.vue';
export { default as VbenMenuBadge } from './menu-badge.vue';
export { default as VbenPinInput } from './input.vue';
export type * from './interface';
import type { HTMLAttributes } from 'vue';
interface PinInputProps {
/**
* 发送验证码按钮loading
*/
btnLoading?: boolean;
/**
* 发送验证码按钮文本
*/
btnText?: string;
class?: HTMLAttributes['class'];
/**
* 验证码长度
*/
codeLength?: number;
/**
* 错误提示信息
*/
errorTip?: string;
/**
* 自定义验证码发送逻辑
* @returns
*/
handleSendCode?: () => Promise<void>;
/**
* 输入框的 label
*/
label: string;
/**
* 输入框的 name
*/
name: string;
/**
* 输入框的校验状态
*/
status?: 'default' | 'error';
}
export type { PinInputProps };
export { default as VbenPopover } from './popover.vue';
<script setup lang="ts">
import type {
PopoverContentProps,
PopoverRootEmits,
PopoverRootProps,
} from 'radix-vue';
import { HTMLAttributes, computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';
import {
PopoverContent,
Popover as PopoverRoot,
PopoverTrigger,
} from '#/components/ui/popover';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
contentClass?: HTMLAttributes['class'];
contentProps?: PopoverContentProps;
} & PopoverRootProps
>(),
{},
);
const emits = defineEmits<PopoverRootEmits>();
const delegatedProps = computed(() => {
const {
class: _cls,
contentClass: _,
contentProps: _cProps,
...delegated
} = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PopoverRoot v-bind="forwarded">
<PopoverTrigger>
<slot name="trigger"></slot>
<PopoverContent
:class="contentClass"
class="side-content z-[1000]"
v-bind="contentProps"
>
<slot></slot>
</PopoverContent>
</PopoverTrigger>
</PopoverRoot>
</template>
export type * from './interface';
export { default as VbenSegmented } from './segmented.vue';
interface SegmentedItem {
label: string;
value: string;
}
export type { SegmentedItem };
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
TabsIndicator,
type TabsIndicatorProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsIndicatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<TabsIndicator
v-bind="forwardedProps"
:class="
cn(
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-[--radix-tabs-indicator-position] rounded-full px-0 py-1 pr-1 transition-[width,transform] duration-300',
props.class,
)
"
>
<div
class="bg-background text-foreground inline-flex h-full w-full items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
>
<slot></slot>
</div>
</TabsIndicator>
</template>
export { default as VbenSheet } from './sheet.vue';
export { default as VbenTooltip } from './tooltip.vue';
<script setup lang="ts">
import { TooltipContentProps } from 'radix-vue';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '#/components/ui/tooltip';
interface Props {
delayDuration?: number;
side: TooltipContentProps['side'];
}
withDefaults(defineProps<Props>(), {
delayDuration: 0,
side: 'right',
});
</script>
<template>
<TooltipProvider :delay-duration="delayDuration">
<Tooltip>
<TooltipTrigger as-child tabindex="-1">
<slot name="trigger"></slot>
</TooltipTrigger>
<TooltipContent
:side="side"
class="side-content text-popover-foreground bg-popover"
>
<slot></slot>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</template>
<script setup lang="ts">
import {
type AlertDialogEmits,
type AlertDialogProps,
AlertDialogRoot,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<AlertDialogProps>();
const emits = defineEmits<AlertDialogEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<AlertDialogRoot v-bind="forwarded">
<slot></slot>
</AlertDialogRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
import { buttonVariants } from '#/components/ui/button';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogActionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogAction
v-bind="delegatedProps"
:class="cn(buttonVariants(), props.class)"
>
<slot></slot>
</AlertDialogAction>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
import { buttonVariants } from '#/components/ui/button';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogCancelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogCancel
v-bind="delegatedProps"
:class="
cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', props.class)
"
>
<slot></slot>
</AlertDialogCancel>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
AlertDialogDescription,
type AlertDialogDescriptionProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogDescription
v-bind="delegatedProps"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</AlertDialogDescription>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogTitle
v-bind="delegatedProps"
:class="cn('text-lg font-semibold', props.class)"
>
<slot></slot>
</AlertDialogTitle>
</template>
export { default as AlertDialog } from './AlertDialog.vue';
export { default as AlertDialogAction } from './AlertDialogAction.vue';
export { default as AlertDialogCancel } from './AlertDialogCancel.vue';
export { default as AlertDialogContent } from './AlertDialogContent.vue';
export { default as AlertDialogDescription } from './AlertDialogDescription.vue';
export { default as AlertDialogFooter } from './AlertDialogFooter.vue';
export { default as AlertDialogHeader } from './AlertDialogHeader.vue';
export { default as AlertDialogTitle } from './AlertDialogTitle.vue';
export { default as AlertDialogTrigger } from './AlertDialogTrigger.vue';
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { AvatarRoot } from 'radix-vue';
import { cn } from '#/lib/utils';
import { type AvatarVariants, avatarVariant } from './avatar';
const props = withDefaults(
defineProps<{
class?: HTMLAttributes['class'];
shape?: AvatarVariants['shape'];
size?: AvatarVariants['size'];
}>(),
{
shape: 'circle',
size: 'sm',
},
);
</script>
<template>
<AvatarRoot :class="cn(avatarVariant({ size, shape }), props.class)">
<slot></slot>
</AvatarRoot>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const avatarVariant = cva(
'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',
{
variants: {
shape: {
circle: 'rounded-full',
square: 'rounded-md',
},
size: {
base: 'h-16 w-16 text-2xl',
lg: 'h-32 w-32 text-5xl',
sm: 'h-10 w-10 text-xs',
},
},
},
);
export type AvatarVariants = VariantProps<typeof avatarVariant>;
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
import { type BadgeVariants, badgeVariants } from './badge';
const props = defineProps<{
class?: HTMLAttributes['class'];
variant?: BadgeVariants['variant'];
}>();
</script>
<template>
<div :class="cn(badgeVariants({ variant }), props.class)">
<slot></slot>
</div>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const badgeVariants = cva(
'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
{
defaultVariants: {
variant: 'default',
},
variants: {
variant: {
default:
'border-transparent bg-accent hover:bg-accent text-primary-foreground shadow',
destructive:
'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
outline: 'text-foreground',
secondary:
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
},
},
},
);
export type BadgeVariants = VariantProps<typeof badgeVariants>;
export { default as Badge } from './Badge.vue';
export * from './badge';
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { DotsHorizontalIcon } from '@radix-icons/vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
role="presentation"
aria-hidden="true"
:class="cn('flex h-9 w-9 items-center justify-center', props.class)"
>
<slot>
<DotsHorizontalIcon class="h-4 w-4" />
</slot>
<span class="sr-only">More</span>
</span>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<li
:class="
cn('hover:text-foreground inline-flex items-center gap-1.5', props.class)
"
>
<slot></slot>
</li>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & PrimitiveProps>(),
{
as: 'a',
},
);
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn('hover:text-foreground transition-colors', props.class)"
>
<slot></slot>
</Primitive>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<ol
:class="
cn(
'text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5',
props.class,
)
"
>
<slot></slot>
</ol>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
role="link"
aria-disabled="true"
aria-current="page"
:class="cn('text-foreground font-normal', props.class)"
>
<slot></slot>
</span>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<li
role="presentation"
aria-hidden="true"
:class="cn('[&>svg]:size-3.5', props.class)"
>
<slot>
<ChevronRightIcon />
</slot>
</li>
</template>
export { default as Breadcrumb } from './Breadcrumb.vue';
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue';
export { default as BreadcrumbItem } from './BreadcrumbItem.vue';
export { default as BreadcrumbLink } from './BreadcrumbLink.vue';
export { default as BreadcrumbList } from './BreadcrumbList.vue';
export { default as BreadcrumbPage } from './BreadcrumbPage.vue';
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue';
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { cn } from '#/lib/utils';
import { type ButtonVariants, buttonVariants } from './button';
interface Props extends PrimitiveProps {
class?: HTMLAttributes['class'];
size?: ButtonVariants['size'];
variant?: 'heavy' & ButtonVariants['variant'];
}
const props = withDefaults(defineProps<Props>(), {
as: 'button',
class: '',
});
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn(buttonVariants({ variant, size }), props.class)"
>
<slot></slot>
</Primitive>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
{
defaultVariants: {
size: 'default',
variant: 'default',
},
variants: {
size: {
default: 'h-9 px-4 py-2',
icon: 'h-8 w-8 rounded-sm px-1 text-lg',
lg: 'h-10 rounded-md px-8',
sm: 'h-8 rounded-md px-3 text-xs',
xs: 'h-8 w-8 rounded-sm px-1 text-xs',
},
variant: {
default:
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
destructive:
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
ghost: 'hover:bg-accent hover:text-accent-foreground',
heavy: 'hover:bg-heavy hover:text-heavy-foreground',
icon: 'hover:bg-accent hover:text-accent-foreground text-foreground/80',
link: 'text-primary underline-offset-4 hover:underline',
outline:
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
secondary:
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
},
},
},
);
export type ButtonVariants = VariantProps<typeof buttonVariants>;
export { default as Button } from './Button.vue';
export * from './button';
<script setup lang="ts">
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
CheckboxIndicator,
CheckboxRoot,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & CheckboxRootProps
>();
const emits = defineEmits<CheckboxRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<CheckboxRoot
v-bind="forwarded"
:class="
cn(
'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<CheckboxIndicator
class="flex h-full w-full items-center justify-center text-current"
>
<slot>
<CheckIcon class="h-4 w-4" />
</slot>
</CheckboxIndicator>
</CheckboxRoot>
</template>
export { default as Checkbox } from './Checkbox.vue';
<script setup lang="ts">
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue';
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<ContextMenuRootProps>();
const emits = defineEmits<ContextMenuRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuRoot v-bind="forwarded">
<slot></slot>
</ContextMenuRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
ContextMenuCheckboxItem,
type ContextMenuCheckboxItemEmits,
type ContextMenuCheckboxItemProps,
ContextMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuCheckboxItemProps
>();
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuCheckboxItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<ContextMenuItemIndicator>
<CheckIcon class="h-4 w-4" />
</ContextMenuItemIndicator>
</span>
<slot></slot>
</ContextMenuCheckboxItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuContent,
type ContextMenuContentEmits,
type ContextMenuContentProps,
ContextMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuContentProps
>();
const emits = defineEmits<ContextMenuContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuPortal>
<ContextMenuContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"
>
<slot></slot>
</ContextMenuContent>
</ContextMenuPortal>
</template>
<script setup lang="ts">
import { ContextMenuGroup, type ContextMenuGroupProps } from 'radix-vue';
const props = defineProps<ContextMenuGroupProps>();
</script>
<template>
<ContextMenuGroup v-bind="props">
<slot></slot>
</ContextMenuGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuItem,
type ContextMenuItemEmits,
type ContextMenuItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuItemProps
>();
const emits = defineEmits<ContextMenuItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</ContextMenuItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuLabelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ContextMenuLabel
v-bind="delegatedProps"
:class="
cn(
'text-foreground px-2 py-1.5 text-sm font-semibold',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</ContextMenuLabel>
</template>
<script setup lang="ts">
import { ContextMenuPortal, type ContextMenuPortalProps } from 'radix-vue';
const props = defineProps<ContextMenuPortalProps>();
</script>
<template>
<ContextMenuPortal v-bind="props">
<slot></slot>
</ContextMenuPortal>
</template>
<script setup lang="ts">
import {
ContextMenuRadioGroup,
type ContextMenuRadioGroupEmits,
type ContextMenuRadioGroupProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<ContextMenuRadioGroupProps>();
const emits = defineEmits<ContextMenuRadioGroupEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuRadioGroup v-bind="forwarded">
<slot></slot>
</ContextMenuRadioGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DotFilledIcon } from '@radix-icons/vue';
import {
ContextMenuItemIndicator,
ContextMenuRadioItem,
type ContextMenuRadioItemEmits,
type ContextMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuRadioItemProps
>();
const emits = defineEmits<ContextMenuRadioItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuRadioItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<ContextMenuItemIndicator>
<DotFilledIcon class="h-4 w-4 fill-current" />
</ContextMenuItemIndicator>
</span>
<slot></slot>
</ContextMenuRadioItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuSeparator,
type ContextMenuSeparatorProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ContextMenuSeparator
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
:class="
cn('text-muted-foreground ml-auto text-xs tracking-widest', props.class)
"
>
<slot></slot>
</span>
</template>
<script setup lang="ts">
import {
ContextMenuSub,
type ContextMenuSubEmits,
type ContextMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<ContextMenuSubProps>();
const emits = defineEmits<ContextMenuSubEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuSub v-bind="forwarded">
<slot></slot>
</ContextMenuSub>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuSubContent,
type DropdownMenuSubContentEmits,
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps
>();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuSubContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-32 overflow-hidden rounded-md border p-1 shadow-lg',
props.class,
)
"
>
<slot></slot>
</ContextMenuSubContent>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import {
ContextMenuSubTrigger,
type ContextMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{
class?: HTMLAttributes['class'];
inset?: boolean;
} & ContextMenuSubTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<ContextMenuSubTrigger
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
<ChevronRightIcon class="ml-auto h-4 w-4" />
</ContextMenuSubTrigger>
</template>
<script setup lang="ts">
import {
ContextMenuTrigger,
type ContextMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
const props = defineProps<ContextMenuTriggerProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<ContextMenuTrigger v-bind="forwardedProps">
<slot></slot>
</ContextMenuTrigger>
</template>
export { default as ContextMenu } from './ContextMenu.vue';
export { default as ContextMenuCheckboxItem } from './ContextMenuCheckboxItem.vue';
export { default as ContextMenuContent } from './ContextMenuContent.vue';
export { default as ContextMenuGroup } from './ContextMenuGroup.vue';
export { default as ContextMenuItem } from './ContextMenuItem.vue';
export { default as ContextMenuLabel } from './ContextMenuLabel.vue';
export { default as ContextMenuRadioGroup } from './ContextMenuRadioGroup.vue';
export { default as ContextMenuRadioItem } from './ContextMenuRadioItem.vue';
export { default as ContextMenuSeparator } from './ContextMenuSeparator.vue';
export { default as ContextMenuShortcut } from './ContextMenuShortcut.vue';
export { default as ContextMenuSub } from './ContextMenuSub.vue';
export { default as ContextMenuSubContent } from './ContextMenuSubContent.vue';
export { default as ContextMenuSubTrigger } from './ContextMenuSubTrigger.vue';
export { default as ContextMenuTrigger } from './ContextMenuTrigger.vue';
<script setup lang="ts">
import {
DialogRoot,
type DialogRootEmits,
type DialogRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DialogRootProps>();
const emits = defineEmits<DialogRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DialogRoot v-bind="forwarded">
<slot></slot>
</DialogRoot>
</template>
<script setup lang="ts">
import { DialogClose, type DialogCloseProps } from 'radix-vue';
const props = defineProps<DialogCloseProps>();
</script>
<template>
<DialogClose v-bind="props">
<slot></slot>
</DialogClose>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { Cross2Icon } from '@radix-icons/vue';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogContentProps
>();
const emits = defineEmits<{ close: [] } & DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-overlay fixed inset-0 z-[1000] backdrop-blur-sm"
@click="() => emits('close')"
/>
<DialogContent
v-bind="forwarded"
:class="
cn(
'bg-background 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-1/2 top-1/2 z-[1000] grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg outline-none duration-300 sm:rounded-lg',
props.class,
)
"
>
<slot></slot>
<DialogClose
class="data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:bg-accent hover:text-accent-foreground text-foreground/80 flex-center absolute right-3 top-3 h-6 w-6 rounded-full px-1 text-lg opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
@click="() => emits('close')"
>
<Cross2Icon class="h-4 w-4" />
</DialogClose>
</DialogContent>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogDescription,
type DialogDescriptionProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DialogDescription
v-bind="forwardedProps"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</DialogDescription>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot></slot>
</div>
</template>
...@@ -10,12 +10,7 @@ const props = defineProps<{ ...@@ -10,12 +10,7 @@ const props = defineProps<{
<template> <template>
<div <div
:class=" :class="cn('flex flex-col gap-y-1.5 text-center sm:text-left', props.class)"
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
> >
<slot></slot> <slot></slot>
</div> </div>
......
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogContentProps
>();
const emits = defineEmits<DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] grid place-items-center overflow-y-auto bg-black/80"
>
<DialogContent
:class="
cn(
'border-border bg-background relative z-50 my-8 grid w-full max-w-lg gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
props.class,
)
"
v-bind="forwarded"
@pointer-down-outside="
(event) => {
const originalEvent = event.detail.originalEvent;
const target = originalEvent.target as HTMLElement;
if (
originalEvent.offsetX > target.clientWidth ||
originalEvent.offsetY > target.clientHeight
) {
event.preventDefault();
}
}
"
>
<slot></slot>
<DialogClose
class="hover:bg-secondary absolute right-4 top-4 rounded-md p-0.5 transition-colors"
>
<Cross2Icon class="h-4 w-4" />
<span class="sr-only">Close</span>
</DialogClose>
</DialogContent>
</DialogOverlay>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DialogTitle
v-bind="forwardedProps"
:class="
cn('text-lg font-semibold leading-none tracking-tight', props.class)
"
>
<slot></slot>
</DialogTitle>
</template>
<script setup lang="ts">
import { DialogTrigger, type DialogTriggerProps } from 'radix-vue';
const props = defineProps<DialogTriggerProps>();
</script>
<template>
<DialogTrigger v-bind="props">
<slot></slot>
</DialogTrigger>
</template>
export { default as Dialog } from './Dialog.vue';
export { default as DialogClose } from './DialogClose.vue';
export { default as DialogContent } from './DialogContent.vue';
export { default as DialogDescription } from './DialogDescription.vue';
export { default as DialogFooter } from './DialogFooter.vue';
export { default as DialogHeader } from './DialogHeader.vue';
export { default as DialogScrollContent } from './DialogScrollContent.vue';
export { default as DialogTitle } from './DialogTitle.vue';
export { default as DialogTrigger } from './DialogTrigger.vue';
<script setup lang="ts">
import {
DropdownMenuRoot,
type DropdownMenuRootEmits,
type DropdownMenuRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuRootProps>();
const emits = defineEmits<DropdownMenuRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuRoot v-bind="forwarded">
<slot></slot>
</DropdownMenuRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
DropdownMenuCheckboxItem,
type DropdownMenuCheckboxItemEmits,
type DropdownMenuCheckboxItemProps,
DropdownMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuCheckboxItemProps
>();
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuCheckboxItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuItemIndicator>
<CheckIcon class="h-4 w-4" />
</DropdownMenuItemIndicator>
</span>
<slot></slot>
</DropdownMenuCheckboxItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuContent,
type DropdownMenuContentEmits,
type DropdownMenuContentProps,
DropdownMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & DropdownMenuContentProps>(),
{
sideOffset: 4,
},
);
const emits = defineEmits<DropdownMenuContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuPortal>
<DropdownMenuContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"
>
<slot></slot>
</DropdownMenuContent>
</DropdownMenuPortal>
</template>
<script setup lang="ts">
import { DropdownMenuGroup, type DropdownMenuGroupProps } from 'radix-vue';
const props = defineProps<DropdownMenuGroupProps>();
</script>
<template>
<DropdownMenuGroup v-bind="props">
<slot></slot>
</DropdownMenuGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuItem,
type DropdownMenuItemProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuItemProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuItem
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</DropdownMenuItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuLabel,
type DropdownMenuLabelProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuLabelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuLabel
v-bind="forwardedProps"
:class="
cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', props.class)
"
>
<slot></slot>
</DropdownMenuLabel>
</template>
<script setup lang="ts">
import {
DropdownMenuRadioGroup,
type DropdownMenuRadioGroupEmits,
type DropdownMenuRadioGroupProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuRadioGroupProps>();
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuRadioGroup v-bind="forwarded">
<slot></slot>
</DropdownMenuRadioGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DotFilledIcon } from '@radix-icons/vue';
import {
DropdownMenuItemIndicator,
DropdownMenuRadioItem,
type DropdownMenuRadioItemEmits,
type DropdownMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuRadioItemProps
>();
const emits = defineEmits<DropdownMenuRadioItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuRadioItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuItemIndicator>
<DotFilledIcon class="h-4 w-4 fill-current" />
</DropdownMenuItemIndicator>
</span>
<slot></slot>
</DropdownMenuRadioItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuSeparator,
type DropdownMenuSeparatorProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{
class?: HTMLAttributes['class'];
} & DropdownMenuSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DropdownMenuSeparator
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span :class="cn('ml-auto text-xs tracking-widest opacity-60', props.class)">
<slot></slot>
</span>
</template>
<script setup lang="ts">
import {
DropdownMenuSub,
type DropdownMenuSubEmits,
type DropdownMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuSubProps>();
const emits = defineEmits<DropdownMenuSubEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuSub v-bind="forwarded">
<slot></slot>
</DropdownMenuSub>
</template>
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
import { type HTMLAttributes, computed } from 'vue'; import { type HTMLAttributes, computed } from 'vue';
import { import {
TabsIndicator, DropdownMenuSubContent,
type TabsIndicatorProps, type DropdownMenuSubContentEmits,
useForwardProps, type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue'; } from 'radix-vue';
import { cn } from '#/lib/utils'; import { cn } from '#/lib/utils';
const props = defineProps< const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsIndicatorProps { class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps
>(); >();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props; const { class: _, ...delegated } = props;
...@@ -19,23 +21,19 @@ const delegatedProps = computed(() => { ...@@ -19,23 +21,19 @@ const delegatedProps = computed(() => {
return delegated; return delegated;
}); });
const forwardedProps = useForwardProps(delegatedProps); const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script> </script>
<template> <template>
<TabsIndicator <DropdownMenuSubContent
v-bind="forwardedProps" v-bind="forwarded"
:class=" :class="
cn( cn(
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-[--radix-tabs-indicator-position] rounded-full px-0 py-1 pr-1 transition-[width,transform] duration-300', 'bg-popover text-popover-foreground 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-32 overflow-hidden rounded-md border p-1 shadow-lg',
props.class, props.class,
) )
" "
> >
<div <slot></slot>
class="bg-background text-foreground inline-flex h-full w-full items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" </DropdownMenuSubContent>
>
<slot></slot>
</div>
</TabsIndicator>
</template> </template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import {
DropdownMenuSubTrigger,
type DropdownMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuSubTrigger
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
props.class,
)
"
>
<slot></slot>
<ChevronRightIcon class="ml-auto h-4 w-4" />
</DropdownMenuSubTrigger>
</template>
<script setup lang="ts">
import {
DropdownMenuTrigger,
type DropdownMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
const props = defineProps<DropdownMenuTriggerProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<DropdownMenuTrigger class="outline-none" v-bind="forwardedProps">
<slot></slot>
</DropdownMenuTrigger>
</template>
export { default as DropdownMenu } from './DropdownMenu.vue';
export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue';
export { default as DropdownMenuContent } from './DropdownMenuContent.vue';
export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue';
export { default as DropdownMenuItem } from './DropdownMenuItem.vue';
export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue';
export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue';
export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue';
export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue';
export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue';
export { default as DropdownMenuSub } from './DropdownMenuSub.vue';
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue';
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue';
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue';
export { DropdownMenuPortal } from 'radix-vue';
<script setup lang="ts">
import {
HoverCardRoot,
type HoverCardRootEmits,
type HoverCardRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<HoverCardRootProps>();
const emits = defineEmits<HoverCardRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<HoverCardRoot v-bind="forwarded">
<slot></slot>
</HoverCardRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
HoverCardContent,
type HoverCardContentProps,
HoverCardPortal,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & HoverCardContentProps>(),
{
sideOffset: 4,
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<HoverCardPortal>
<HoverCardContent
v-bind="forwardedProps"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] w-64 rounded-md border p-4 shadow-md outline-none',
props.class,
)
"
>
<slot></slot>
</HoverCardContent>
</HoverCardPortal>
</template>
<script setup lang="ts">
import { HoverCardTrigger, type HoverCardTriggerProps } from 'radix-vue';
const props = defineProps<HoverCardTriggerProps>();
</script>
<template>
<HoverCardTrigger v-bind="props">
<slot></slot>
</HoverCardTrigger>
</template>
export { default as HoverCard } from './HoverCard.vue';
export { default as HoverCardContent } from './HoverCardContent.vue';
export { default as HoverCardTrigger } from './HoverCardTrigger.vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputRoot,
type PinInputRootEmits,
type PinInputRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputRootProps
>();
const emits = defineEmits<PinInputRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PinInputRoot
v-bind="forwarded"
:class="cn('flex items-center gap-2', props.class)"
>
<slot></slot>
</PinInputRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PrimitiveProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<Primitive
v-bind="forwardedProps"
:class="cn('flex items-center', props.class)"
>
<slot></slot>
</Primitive>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputInput,
type PinInputInputProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputInputProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<PinInputInput
v-bind="forwardedProps"
:class="
cn(
'border-input bg-background relative flex h-10 w-10 items-center justify-center border-y border-r text-center text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md focus:relative focus:z-10 focus:outline-none focus:ring-2',
props.class,
)
"
/>
</template>
<script setup lang="ts">
import { DashIcon } from '@radix-icons/vue';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
const props = defineProps<PrimitiveProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<Primitive v-bind="forwardedProps">
<slot>
<DashIcon />
</slot>
</Primitive>
</template>
export { default as PinInput } from './PinInput.vue';
export { default as PinInputGroup } from './PinInputGroup.vue';
export { default as PinInputInput } from './PinInputInput.vue';
export { default as PinInputSeparator } from './PinInputSeparator.vue';
<script setup lang="ts">
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue';
import { PopoverRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<PopoverRootProps>();
const emits = defineEmits<PopoverRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<PopoverRoot v-bind="forwarded">
<slot></slot>
</PopoverRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PopoverContent,
type PopoverContentEmits,
type PopoverContentProps,
PopoverPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & PopoverContentProps>(),
{
align: 'center',
sideOffset: 4,
},
);
const emits = defineEmits<PopoverContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PopoverPortal>
<PopoverContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-popover text-popover-foreground 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 w-72 rounded-md border p-4 shadow-md outline-none',
props.class,
)
"
>
<slot></slot>
</PopoverContent>
</PopoverPortal>
</template>
<script setup lang="ts">
import { PopoverTrigger, type PopoverTriggerProps } from 'radix-vue';
const props = defineProps<PopoverTriggerProps>();
</script>
<template>
<PopoverTrigger v-bind="props">
<slot></slot>
</PopoverTrigger>
</template>
export { default as Popover } from './Popover.vue';
export { default as PopoverContent } from './PopoverContent.vue';
export { default as PopoverTrigger } from './PopoverTrigger.vue';
export { PopoverAnchor } from 'radix-vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaCorner,
ScrollAreaRoot,
type ScrollAreaRootProps,
ScrollAreaViewport,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import ScrollBar from './ScrollBar.vue';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
onScroll?: (event: Event) => void;
viewportProps?: { onScroll: (event: Event) => void };
} & ScrollAreaRootProps
>(),
{
onScroll: () => {},
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ScrollAreaRoot
v-bind="delegatedProps"
:class="cn('relative overflow-hidden', props.class)"
>
<ScrollAreaViewport
class="h-full w-full rounded-[inherit]"
as-child
@scroll="onScroll"
>
<slot></slot>
</ScrollAreaViewport>
<ScrollBar />
<ScrollAreaCorner />
</ScrollAreaRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaScrollbar,
type ScrollAreaScrollbarProps,
ScrollAreaThumb,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & ScrollAreaScrollbarProps>(),
{
orientation: 'vertical',
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ScrollAreaScrollbar
v-bind="delegatedProps"
:class="
cn(
'flex touch-none select-none transition-colors',
orientation === 'vertical' &&
'h-full w-2.5 border-l border-l-transparent p-px',
orientation === 'horizontal' &&
'h-2.5 flex-col border-t border-t-transparent p-px',
props.class,
)
"
>
<ScrollAreaThumb class="bg-border relative flex-1 rounded-full" />
</ScrollAreaScrollbar>
</template>
export { default as ScrollArea } from './ScrollArea.vue';
export { default as ScrollBar } from './ScrollBar.vue';
<script setup lang="ts">
import type { SelectRootEmits, SelectRootProps } from 'radix-vue';
import { SelectRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<SelectRootProps>();
const emits = defineEmits<SelectRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<SelectRoot v-bind="forwarded">
<slot></slot>
</SelectRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
SelectContent,
type SelectContentEmits,
type SelectContentProps,
SelectPortal,
SelectViewport,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { SelectScrollDownButton, SelectScrollUpButton } from '.';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & SelectContentProps>(),
{
position: 'popper',
},
);
const emits = defineEmits<SelectContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<SelectPortal>
<SelectContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',
position === 'popper' &&
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
props.class,
)
"
>
<SelectScrollUpButton />
<SelectViewport
:class="
cn(
'p-1',
position === 'popper' &&
'h-[--radix-select-trigger-height] w-full min-w-[--radix-select-trigger-width]',
)
"
>
<slot></slot>
</SelectViewport>
<SelectScrollDownButton />
</SelectContent>
</SelectPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { SelectGroup, type SelectGroupProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectGroupProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<SelectGroup :class="cn('w-full p-1', props.class)" v-bind="delegatedProps">
<slot></slot>
</SelectGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
SelectItem,
SelectItemIndicator,
type SelectItemProps,
SelectItemText,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectItemProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectItem
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectItemIndicator>
<CheckIcon class="h-4 w-4" />
</SelectItemIndicator>
</span>
<SelectItemText>
<slot></slot>
</SelectItemText>
</SelectItem>
</template>
<script setup lang="ts">
import { SelectItemText, type SelectItemTextProps } from 'radix-vue';
const props = defineProps<SelectItemTextProps>();
</script>
<template>
<SelectItemText v-bind="props">
<slot></slot>
</SelectItemText>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { SelectLabel, type SelectLabelProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectLabelProps
>();
</script>
<template>
<SelectLabel :class="cn('px-2 py-1.5 text-sm font-semibold', props.class)">
<slot></slot>
</SelectLabel>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronDownIcon } from '@radix-icons/vue';
import {
SelectScrollDownButton,
type SelectScrollDownButtonProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollDownButtonProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectScrollDownButton
v-bind="forwardedProps"
:class="
cn('flex cursor-default items-center justify-center py-1', props.class)
"
>
<slot>
<ChevronDownIcon />
</slot>
</SelectScrollDownButton>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronUpIcon } from '@radix-icons/vue';
import {
SelectScrollUpButton,
type SelectScrollUpButtonProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollUpButtonProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectScrollUpButton
v-bind="forwardedProps"
:class="
cn('flex cursor-default items-center justify-center py-1', props.class)
"
>
<slot>
<ChevronUpIcon />
</slot>
</SelectScrollUpButton>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { SelectSeparator, type SelectSeparatorProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<SelectSeparator
v-bind="delegatedProps"
:class="cn('bg-muted -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CaretSortIcon } from '@radix-icons/vue';
import {
SelectIcon,
SelectTrigger,
type SelectTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectTrigger
v-bind="forwardedProps"
:class="
cn(
'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
props.class,
)
"
>
<slot></slot>
<SelectIcon as-child>
<CaretSortIcon class="h-4 w-4 opacity-50" />
</SelectIcon>
</SelectTrigger>
</template>
<script setup lang="ts">
import { SelectValue, type SelectValueProps } from 'radix-vue';
const props = defineProps<SelectValueProps>();
</script>
<template>
<SelectValue v-bind="props">
<slot></slot>
</SelectValue>
</template>
export { default as Select } from './Select.vue';
export { default as SelectContent } from './SelectContent.vue';
export { default as SelectGroup } from './SelectGroup.vue';
export { default as SelectItem } from './SelectItem.vue';
export { default as SelectItemText } from './SelectItemText.vue';
export { default as SelectLabel } from './SelectLabel.vue';
export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue';
export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue';
export { default as SelectSeparator } from './SelectSeparator.vue';
export { default as SelectTrigger } from './SelectTrigger.vue';
export { default as SelectValue } from './SelectValue.vue';
<script setup lang="ts">
import {
DialogRoot,
type DialogRootEmits,
type DialogRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DialogRootProps>();
const emits = defineEmits<DialogRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DialogRoot v-bind="forwarded">
<slot></slot>
</DialogRoot>
</template>
<script setup lang="ts">
import { DialogClose, type DialogCloseProps } from 'radix-vue';
const props = defineProps<DialogCloseProps>();
</script>
<template>
<DialogClose v-bind="props">
<slot></slot>
</DialogClose>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { type SheetVariants, sheetVariants } from './sheet';
interface SheetContentProps extends DialogContentProps {
class?: HTMLAttributes['class'];
side?: SheetVariants['side'];
}
defineOptions({
inheritAttrs: false,
});
const props = defineProps<SheetContentProps>();
const emits = defineEmits<DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, side: _side, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000]"
/>
<DialogContent
:class="cn(sheetVariants({ side }), 'z-[1000]', props.class)"
v-bind="{ ...forwarded, ...$attrs }"
>
<slot></slot>
<!-- <DialogClose
class="data-[state=open]:bg-secondary absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
>
<Cross2Icon class="h-5 w-" />
</DialogClose> -->
</DialogContent>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogDescription, type DialogDescriptionProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DialogDescription
:class="cn('text-muted-foreground text-sm', props.class)"
v-bind="delegatedProps"
>
<slot></slot>
</DialogDescription>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div :class="cn('flex flex-col text-center sm:text-left', props.class)">
<slot></slot>
</div>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DialogTitle
:class="cn('text-foreground font-medium', props.class)"
v-bind="delegatedProps"
>
<slot></slot>
</DialogTitle>
</template>
<script setup lang="ts">
import { DialogTrigger, type DialogTriggerProps } from 'radix-vue';
const props = defineProps<DialogTriggerProps>();
</script>
<template>
<DialogTrigger v-bind="props">
<slot></slot>
</DialogTrigger>
</template>
export { default as Sheet } from './Sheet.vue';
export { default as SheetClose } from './SheetClose.vue';
export { default as SheetContent } from './SheetContent.vue';
export { default as SheetDescription } from './SheetDescription.vue';
export { default as SheetFooter } from './SheetFooter.vue';
export { default as SheetHeader } from './SheetHeader.vue';
export { default as SheetTitle } from './SheetTitle.vue';
export { default as SheetTrigger } from './SheetTrigger.vue';
export * from './sheet';
import { type VariantProps, cva } from 'class-variance-authority';
export const sheetVariants = cva(
'fixed z-50 gap-4 bg-background shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
{
defaultVariants: {
side: 'right',
},
variants: {
side: {
bottom:
'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
right:
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
},
},
},
);
export type SheetVariants = VariantProps<typeof sheetVariants>;
<script lang="ts" setup>
import { Toaster as Sonner, type ToasterProps } from 'vue-sonner';
const props = withDefaults(defineProps<ToasterProps>(), {
closeButton: true,
duration: 2500,
position: 'top-right',
richColors: true,
visibleToasts: 3,
});
</script>
<template>
<Sonner
class="toaster group"
v-bind="props"
:toast-options="{
classes: {
closeButton:
'!border-border group-[.toast]:bg-muted group-[.toast]:text-muted-foreground !bg-muted hover:!text-foreground',
toast:
'group toast group-[.toaster]:bg-background group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
description: 'group-[.toast]:text-muted-foreground',
actionButton:
'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
cancelButton:
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
},
}"
/>
</template>
<!-- <style scoped>
:deep([data-sonner-toaster][data-theme='dark']),
:deep([data-sonner-toaster][data-theme='light']) {
--normal-bg: hsl(var(--color-background));
--normal-border: theme('colors.border');
--normal-text: theme('colors.popover.foreground');
--border-radius: theme('borderRadius.md');
}
</style> -->
export { default as Toaster } from './Sonner.vue';
export { toast } from 'vue-sonner';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
SwitchRoot,
type SwitchRootEmits,
type SwitchRootProps,
SwitchThumb,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SwitchRootProps
>();
const emits = defineEmits<SwitchRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<SwitchRoot
v-bind="forwarded"
:class="
cn(
'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 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-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<SwitchThumb
:class="
cn(
'bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',
)
"
/>
</SwitchRoot>
</template>
export { default as Switch } from './Switch.vue';
<script setup lang="ts">
import type { TabsRootEmits, TabsRootProps } from 'radix-vue';
import { TabsRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<TabsRootProps>();
const emits = defineEmits<TabsRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<TabsRoot v-bind="forwarded">
<slot></slot>
</TabsRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsContent, type TabsContentProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsContentProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<TabsContent
:class="
cn(
'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
props.class,
)
"
v-bind="delegatedProps"
>
<slot></slot>
</TabsContent>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsList, type TabsListProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsListProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<TabsList
v-bind="delegatedProps"
:class="
cn(
'bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1',
props.class,
)
"
>
<slot></slot>
</TabsList>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<TabsTrigger
v-bind="forwardedProps"
:class="
cn(
'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow',
props.class,
)
"
>
<slot></slot>
</TabsTrigger>
</template>
export { default as Tabs } from './Tabs.vue';
export { default as TabsContent } from './TabsContent.vue';
export { default as TabsList } from './TabsList.vue';
export { default as TabsTrigger } from './TabsTrigger.vue';
export { TabsIndicator } from 'radix-vue';
<script setup lang="ts">
import type { VariantProps } from 'class-variance-authority';
import type { toggleVariants } from '#/components/ui/toggle';
import { type HTMLAttributes, computed, provide } from 'vue';
import {
ToggleGroupRoot,
type ToggleGroupRootEmits,
type ToggleGroupRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
type ToggleGroupVariants = VariantProps<typeof toggleVariants>;
const props = defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleGroupVariants['size'];
variant?: ToggleGroupVariants['variant'];
} & ToggleGroupRootProps
>();
const emits = defineEmits<ToggleGroupRootEmits>();
provide('toggleGroup', {
size: props.size,
variant: props.variant,
});
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ToggleGroupRoot
v-bind="forwarded"
:class="cn('flex items-center justify-center gap-1', props.class)"
>
<slot></slot>
</ToggleGroupRoot>
</template>
<script setup lang="ts">
import type { VariantProps } from 'class-variance-authority';
import { type HTMLAttributes, computed, inject } from 'vue';
import {
ToggleGroupItem,
type ToggleGroupItemProps,
useForwardProps,
} from 'radix-vue';
import { toggleVariants } from '#/components/ui/toggle';
import { cn } from '#/lib/utils';
type ToggleGroupVariants = VariantProps<typeof toggleVariants>;
const props = defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleGroupVariants['size'];
variant?: ToggleGroupVariants['variant'];
} & ToggleGroupItemProps
>();
const context = inject<ToggleGroupVariants>('toggleGroup');
const delegatedProps = computed(() => {
const { class: _, size: _size, variant: _variant, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<ToggleGroupItem
v-bind="forwardedProps"
:class="
cn(
toggleVariants({
variant: context?.variant || variant,
size: context?.size || size,
}),
props.class,
)
"
>
<slot></slot>
</ToggleGroupItem>
</template>
export { default as ToggleGroup } from './ToggleGroup.vue';
export { default as ToggleGroupItem } from './ToggleGroupItem.vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
Toggle,
type ToggleEmits,
type ToggleProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { type ToggleVariants, toggleVariants } from './toggle';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleVariants['size'];
variant?: ToggleVariants['variant'];
} & ToggleProps
>(),
{
disabled: false,
size: 'default',
variant: 'default',
},
);
const emits = defineEmits<ToggleEmits>();
const delegatedProps = computed(() => {
const { class: _, size: _size, variant: _variant, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<Toggle
v-bind="forwarded"
:class="cn(toggleVariants({ variant, size }), props.class)"
>
<slot></slot>
</Toggle>
</template>
export { default as Toggle } from './Toggle.vue';
export * from './toggle';
import { type VariantProps, cva } from 'class-variance-authority';
export const toggleVariants = cva(
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
{
defaultVariants: {
size: 'default',
variant: 'default',
},
variants: {
size: {
default: 'h-9 px-3',
lg: 'h-10 px-3',
sm: 'h-8 px-2',
},
variant: {
default: 'bg-transparent',
outline:
'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
},
},
},
);
export type ToggleVariants = VariantProps<typeof toggleVariants>;
<script setup lang="ts">
import {
TooltipRoot,
type TooltipRootEmits,
type TooltipRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<TooltipRootProps>();
const emits = defineEmits<TooltipRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<TooltipRoot v-bind="forwarded">
<slot></slot>
</TooltipRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
TooltipContent,
type TooltipContentEmits,
type TooltipContentProps,
TooltipPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & TooltipContentProps>(),
{
side: 'right',
sideOffset: 5,
},
);
const emits = defineEmits<TooltipContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<TooltipPortal>
<TooltipContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-accent text-accent-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 z-[1000] overflow-hidden rounded-sm px-4 py-2 text-xs shadow-md',
props.class,
)
"
>
<slot></slot>
</TooltipContent>
</TooltipPortal>
</template>
<script setup lang="ts">
import { TooltipProvider, type TooltipProviderProps } from 'radix-vue';
const props = defineProps<TooltipProviderProps>();
</script>
<template>
<TooltipProvider v-bind="props">
<slot></slot>
</TooltipProvider>
</template>
<script setup lang="ts">
import { TooltipTrigger, type TooltipTriggerProps } from 'radix-vue';
const props = defineProps<TooltipTriggerProps>();
</script>
<template>
<TooltipTrigger v-bind="props">
<slot></slot>
</TooltipTrigger>
</template>
export { default as Tooltip } from './Tooltip.vue';
export { default as TooltipContent } from './TooltipContent.vue';
export { default as TooltipProvider } from './TooltipProvider.vue';
export { default as TooltipTrigger } from './TooltipTrigger.vue';
import './styles/index.css';
export * from './components';
export {
useEmitAsProps,
useForwardExpose,
useForwardProps,
useForwardPropsEmits,
} from 'radix-vue';
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
.side-content {
animation-duration: 0.2s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
.side-content[data-side='top'] {
animation-name: slide-up;
}
.side-content[data-side='bottom'] {
animation-name: slide-down;
}
.side-content[data-side='left'] {
animation-name: slide-left;
}
.side-content[data-side='right'] {
animation-name: slide-right;
}
.breadcrumb-transition-enter-active {
transition:
transform 0.4s cubic-bezier(0.76, 0, 0.24, 1),
opacity 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}
.breadcrumb-transition-leave-active {
display: none;
}
.breadcrumb-transition-enter-from {
opacity: 0;
transform: translateX(30px) skewX(-30deg);
}
/*
.breadcrumb-transition-move,
.breadcrumb-transition-enter-active {
transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
.breadcrumb-transition-leave-active {
display: none;
}
.breadcrumb-transition-enter-from {
opacity: 0;
transform: translateX(-5px);
} */
@keyframes slide-down {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-left {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-right {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-up {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
export { default } from '@vben/tailwind-config';
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"#/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules"]
}
import { defineConfig } from '@vben/vite-config';
export default defineConfig();
{
"name": "@vben-core/tabs-ui",
"version": "1.0.0",
"type": "module",
"license": "MIT",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "packages/@vben-core/uikit/tabs-ui"
},
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"scripts": {
"build": "pnpm vite build",
"prepublishOnly": "npm run build"
},
"files": [
"dist"
],
"sideEffects": [
"**/*.css"
],
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"imports": {
"#*": "./src/*"
},
"exports": {
".": {
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
}
}
},
"dependencies": {
"@vben-core/design": "workspace:*",
"@vben-core/iconify": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/toolkit": "workspace:*",
"@vben-core/typings": "workspace:*",
"vue": "3.4.27"
}
}
export { default } from '@vben/tailwind-config/postcss';
@import '@vben-core/design/global';
@include b('chrome-tabs') {
--tabs-background: hsl(var(--color-background));
--tabs-gap: 7px;
--tabs-divider: hsl(var(--color-border));
--tabs-hover: hsl(var(--color-heavy));
--tabs-active-background: hsl(var(--color-primary) / 100%);
--tabs-active: hsl(var(--color-primary-foreground));
position: relative;
width: 100%;
height: 100%;
padding-top: 4px;
background-color: var(--tabs-background);
@include e('content') {
position: relative;
height: 32px;
overflow: hidden;
}
}
@include b('chrome-tab') {
position: absolute;
display: flex;
align-items: center;
height: 100%;
color: hsl(var(--color-muted-foreground));
cursor: pointer;
user-select: none;
@include is('active') {
z-index: 2;
color: var(--tabs-active);
.#{$namespace}-chrome-tab__extra:not(.is-pin) {
background-color: var(--tabs-active-background);
opacity: 1;
}
.#{$namespace}-chrome-tab-background__divider {
display: none;
}
.#{$namespace}-chrome-tab-background__content {
background-color: var(--tabs-active-background);
}
.#{$namespace}-chrome-tab-background__before,
.#{$namespace}-chrome-tab-background__after {
fill: var(--tabs-active-background);
}
}
@include e('content') {
position: absolute;
right: 0;
left: 0;
// z-index: 1;
display: flex;
align-items: center;
height: 100%;
padding-right: 10px;
margin: 0 calc(var(--tabs-gap) * 2);
overflow: hidden;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
@include e('extra') {
position: absolute;
top: 50%;
right: calc(var(--tabs-gap) * 2);
z-index: 1;
width: 14px;
height: 14px;
border-radius: 50%;
opacity: 0;
transition: 0.15s;
transform: translateY(-50%);
// &:hover {
// background-color: hsl(var(--color-accent));
// }
}
@include e('extra-icon') {
flex-shrink: 0;
width: 100%;
height: 100%;
font-size: 12px;
border-radius: 50%;
transition: all 0.15s ease;
&:hover {
color: hsl(var(--color-foreground));
transform: scale(1.05);
}
}
@include e('icon') {
display: flex;
align-items: center;
height: 16px;
margin-left: 3%;
overflow: hidden;
img {
height: 100%;
}
}
@include e('label') {
position: relative;
flex: 1;
margin-right: 8px;
margin-left: 5%;
overflow: hidden;
font-size: 14px;
white-space: nowrap;
mask-image: linear-gradient(
90deg,
#000 0%,
#000 calc(100% - 20px),
transparent
);
// &.no-close {
// margin-right: 0;
// }
// &.no-icon {
// margin-left: 0;
// }
}
@include is('hidden-icon') {
margin-left: 0;
}
&:hover {
.#{$namespace}-chrome-tab__extra.is-pin {
opacity: 1;
}
}
&:not(.is-active):hover {
z-index: 1;
.#{$namespace}-chrome-tab__extra {
opacity: 1;
}
.#{$namespace}-chrome-tab-background__divider {
display: none;
}
.#{$namespace}-chrome-tab-background__content {
background-color: var(--tabs-hover);
}
.#{$namespace}-chrome-tab-background__before,
.#{$namespace}-chrome-tab-background__after {
fill: var(--tabs-hover);
}
}
&:first-of-type {
.#{$namespace}-chrome-tab-background__divider::before {
display: none;
}
}
}
@include b('chrome-tab-background') {
position: absolute;
width: 100%;
height: 100%;
padding: 0 calc(var(--tabs-gap) + 0px);
@include e('divider') {
position: absolute;
left: 0;
width: calc(100% - 14px);
height: 100%;
margin: 0 7px;
&::before {
position: absolute;
top: 20%;
right: 100%;
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
&::after {
position: absolute;
top: 20%;
left: calc(100% - 1px);
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
}
@include e('content') {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
transition: background 0.15s ease;
}
@include e('before') {
position: absolute;
bottom: -1px;
left: -3px;
fill: transparent;
transition: 0.15s;
}
@include e('after') {
position: absolute;
right: -3px;
bottom: -1px;
fill: transparent;
transition: 0.15s;
}
}
<script setup lang="ts">
import { useNamespace } from '@vben-core/toolkit';
defineOptions({
name: 'ChromeTabBackground',
});
const { b, e } = useNamespace('chrome-tab-background');
</script>
<template>
<div :class="b()">
<div :class="e('divider')"></div>
<div :class="e('content')"></div>
<svg width="10" height="10" :class="e('before')">
<path d="M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z" />
</svg>
<svg width="10" height="10" :class="e('after')">
<path d="M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z" />
</svg>
</div>
</template>
<script setup lang="ts">
import type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { TabItem } from '@vben-core/typings';
import { IcRoundClose, MdiPin } from '@vben-core/iconify';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import TabBackground from './tab-background.vue';
interface Props {
affixTab?: boolean;
icon?: string;
menus: (data: any) => IContextMenuItem[];
onlyOne?: boolean;
showIcon?: boolean;
tab: TabItem;
title: string;
}
defineOptions({
name: 'ChromeTab',
});
withDefaults(defineProps<Props>(), {
icon: '',
});
const emit = defineEmits<{ close: []; unPushPin: [] }>();
const { b, e, is } = useNamespace('chrome-tab');
function handleClose() {
emit('close');
}
function handleUnPushPin() {
emit('unPushPin');
}
</script>
<template>
<div :class="[b()]">
<VbenContextMenu :menus="menus" :handler-data="tab" item-class="pr-4">
<div class="h-full">
<TabBackground />
<div :class="e('content')" :title="title">
<VbenIcon v-if="showIcon" :class="e('icon')" :icon="icon" fallback />
<span :class="[e('label'), is('hidden-icon', !icon)]">
{{ title }}
</span>
</div>
<div
v-show="!affixTab && !onlyOne"
:class="e('extra')"
@click.stop="handleClose"
>
<IcRoundClose :class="e('extra-icon')" />
</div>
<div
v-show="affixTab && !onlyOne"
:class="[e('extra'), is('pin', true)]"
@click.stop="handleUnPushPin"
>
<MdiPin :class="e('extra-icon')" />
</div>
</div>
</VbenContextMenu>
</div>
</template>
<script setup lang="ts">
import type { TabItem } from '@vben-core/typings';
import type { TabsProps } from '../../interface';
import { computed, nextTick, onMounted, ref, watch } from 'vue';
import { useNamespace } from '@vben-core/toolkit';
import Tab from './tab.vue';
interface Props extends TabsProps {}
defineOptions({
name: 'ChromeTabs',
});
const props = withDefaults(defineProps<Props>(), {
maxWidth: 150,
menus: () => [],
minWidth: 40,
tabs: () => [],
});
const emit = defineEmits<{ close: [string]; unPushPin: [TabItem] }>();
const gap = 7;
const active = defineModel<string>('active');
const { b, e, is } = useNamespace('chrome-tabs');
const contentRef = ref();
const tabWidth = ref<number>(0);
const layout = () => {
const { maxWidth, minWidth, tabs } = props;
if (!contentRef.value) {
return Math.max(maxWidth, minWidth);
}
const contentWidth = contentRef.value.clientWidth - gap * 3;
let width = contentWidth / tabs.length;
width += gap * 2;
if (width > maxWidth) {
width = maxWidth;
}
if (width < minWidth) {
width = minWidth;
}
tabWidth.value = width;
};
const tabsView = computed(() => {
return props.tabs.map((tab) => {
return {
...tab,
affixTab: !!tab.meta?.affixTab,
icon: tab.meta.icon as string,
key: tab.fullPath || tab.path,
title: (tab.meta?.title || tab.name) as string,
};
});
});
watch(
() => props.tabs,
() => {
nextTick(() => {
layout();
});
},
);
onMounted(() => {
layout();
});
function handleClose(key: string) {
emit('close', key);
}
function handleUnPushPin(tab: TabItem) {
emit('unPushPin', tab);
}
</script>
<template>
<div :class="b()">
<div ref="contentRef" :class="e('content')">
<TransitionGroup name="slide-down">
<Tab
v-for="(tab, i) in tabsView"
:key="tab.key"
:menus="menus"
:tab="tab"
:icon="tab.icon"
:title="tab.title"
:show-icon="showIcon"
:affix-tab="tab.affixTab"
:only-one="tabsView.length <= 1"
:class="[e('tab'), is('active', tab.key === active)]"
:style="{
width: `${tabWidth}px`,
left: `${(tabWidth - gap * 2) * i}px`,
}"
@click="active = tab.key"
@close="() => handleClose(tab.key)"
@un-push-pin="() => handleUnPushPin(tab)"
/>
</TransitionGroup>
</div>
</div>
</template>
<style lang="scss">
@import './chrome-tabs.scss';
</style>
export { default as ChromeTabs } from './chrome-tabs/tabs.vue';
export { default as TabsMore } from './tabs-more.vue';
export { default as TabsScreen } from './tabs-screen.vue';
<script lang="ts" setup>
import type { DropdownMenuProps } from '@vben-core/shadcn-ui';
import { IcRoundMoreVert } from '@vben-core/iconify';
import { VbenDropdownMenu } from '@vben-core/shadcn-ui';
defineProps<DropdownMenuProps>();
</script>
<template>
<VbenDropdownMenu :menus="menus">
<div
class="flex-center hover:bg-accent hover:text-foreground text-muted-foreground h-full cursor-pointer border-l px-2 text-lg font-semibold"
>
<IcRoundMoreVert />
</div>
</VbenDropdownMenu>
</template>
<script lang="ts" setup>
import { IcRoundFitScreen, IcTwotoneFitScreen } from '@vben-core/iconify';
const screen = defineModel<boolean>('screen');
function toggleScreen() {
screen.value = !screen.value;
}
</script>
<template>
<div
class="flex-center hover:bg-accent hover:text-foreground text-muted-foreground h-full cursor-pointer border-l px-2 text-lg font-semibold"
@click="toggleScreen"
>
<IcTwotoneFitScreen v-if="screen" />
<IcRoundFitScreen v-else />
</div>
</template>
<script lang="ts" setup></script>
<template>
<div></div>
</template>
export { TabsMore, TabsScreen } from './components';
export { default as TabsView } from './tabs-view.vue';
export type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { TabItem } from '@vben-core/typings';
interface TabsProps {
maxWidth?: number;
menus?: (data: any) => IContextMenuItem[];
minWidth?: number;
showIcon?: boolean;
tabs?: TabItem[];
}
export type { TabsProps };
<script setup lang="ts">
import type { TabItem } from '@vben-core/typings';
import { useForwardPropsEmits } from '@vben-core/shadcn-ui';
import { ChromeTabs } from './components';
import { TabsProps } from './interface';
interface Props extends TabsProps {}
defineOptions({
name: 'TabsView',
});
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{ close: [string]; unPushPin: [TabItem] }>();
const forward = useForwardPropsEmits(props, emit);
</script>
<template>
<ChromeTabs v-bind="forward" />
</template>
export { default } from '@vben/tailwind-config';
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json",
"include": ["src"],
"exclude": ["node_modules"]
}
import { defineConfig } from '@vben/vite-config';
export default defineConfig();
export { default as VbenIcon } from './icon.vue';
export { default as VbenInputPassword } from './input-password.vue';
export { default as VbenInput } from './input.vue';
export type * from './interface';
export { default as VbenLogo } from './logo.vue';
export { default as VbenMenuBadge } from './menu-badge.vue';
export { default as VbenPinInput } from './input.vue';
export type * from './interface';
import type { HTMLAttributes } from 'vue';
interface PinInputProps {
/**
* 发送验证码按钮loading
*/
btnLoading?: boolean;
/**
* 发送验证码按钮文本
*/
btnText?: string;
class?: HTMLAttributes['class'];
/**
* 验证码长度
*/
codeLength?: number;
/**
* 错误提示信息
*/
errorTip?: string;
/**
* 自定义验证码发送逻辑
* @returns
*/
handleSendCode?: () => Promise<void>;
/**
* 输入框的 label
*/
label: string;
/**
* 输入框的 name
*/
name: string;
/**
* 输入框的校验状态
*/
status?: 'default' | 'error';
}
export type { PinInputProps };
export { default as VbenPopover } from './popover.vue';
<script setup lang="ts">
import type {
PopoverContentProps,
PopoverRootEmits,
PopoverRootProps,
} from 'radix-vue';
import { HTMLAttributes, computed } from 'vue';
import { useForwardPropsEmits } from 'radix-vue';
import {
PopoverContent,
Popover as PopoverRoot,
PopoverTrigger,
} from '#/components/ui/popover';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
contentClass?: HTMLAttributes['class'];
contentProps?: PopoverContentProps;
} & PopoverRootProps
>(),
{},
);
const emits = defineEmits<PopoverRootEmits>();
const delegatedProps = computed(() => {
const {
class: _cls,
contentClass: _,
contentProps: _cProps,
...delegated
} = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PopoverRoot v-bind="forwarded">
<PopoverTrigger>
<slot name="trigger"></slot>
<PopoverContent
:class="contentClass"
class="side-content z-[1000]"
v-bind="contentProps"
>
<slot></slot>
</PopoverContent>
</PopoverTrigger>
</PopoverRoot>
</template>
export type * from './interface';
export { default as VbenSegmented } from './segmented.vue';
interface SegmentedItem {
label: string;
value: string;
}
export type { SegmentedItem };
export { default as VbenSheet } from './sheet.vue';
export { default as VbenTooltip } from './tooltip.vue';
<script setup lang="ts">
import { TooltipContentProps } from 'radix-vue';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from '#/components/ui/tooltip';
interface Props {
delayDuration?: number;
side: TooltipContentProps['side'];
}
withDefaults(defineProps<Props>(), {
delayDuration: 0,
side: 'right',
});
</script>
<template>
<TooltipProvider :delay-duration="delayDuration">
<Tooltip>
<TooltipTrigger as-child tabindex="-1">
<slot name="trigger"></slot>
</TooltipTrigger>
<TooltipContent
:side="side"
class="side-content text-popover-foreground bg-popover"
>
<slot></slot>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</template>
<script setup lang="ts">
import {
type AlertDialogEmits,
type AlertDialogProps,
AlertDialogRoot,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<AlertDialogProps>();
const emits = defineEmits<AlertDialogEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<AlertDialogRoot v-bind="forwarded">
<slot></slot>
</AlertDialogRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogAction, type AlertDialogActionProps } from 'radix-vue';
import { buttonVariants } from '#/components/ui/button';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogActionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogAction
v-bind="delegatedProps"
:class="cn(buttonVariants(), props.class)"
>
<slot></slot>
</AlertDialogAction>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogCancel, type AlertDialogCancelProps } from 'radix-vue';
import { buttonVariants } from '#/components/ui/button';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogCancelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogCancel
v-bind="delegatedProps"
:class="
cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', props.class)
"
>
<slot></slot>
</AlertDialogCancel>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
AlertDialogDescription,
type AlertDialogDescriptionProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogDescription
v-bind="delegatedProps"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</AlertDialogDescription>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { AlertDialogTitle, type AlertDialogTitleProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & AlertDialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<AlertDialogTitle
v-bind="delegatedProps"
:class="cn('text-lg font-semibold', props.class)"
>
<slot></slot>
</AlertDialogTitle>
</template>
export { default as AlertDialog } from './AlertDialog.vue';
export { default as AlertDialogAction } from './AlertDialogAction.vue';
export { default as AlertDialogCancel } from './AlertDialogCancel.vue';
export { default as AlertDialogContent } from './AlertDialogContent.vue';
export { default as AlertDialogDescription } from './AlertDialogDescription.vue';
export { default as AlertDialogFooter } from './AlertDialogFooter.vue';
export { default as AlertDialogHeader } from './AlertDialogHeader.vue';
export { default as AlertDialogTitle } from './AlertDialogTitle.vue';
export { default as AlertDialogTrigger } from './AlertDialogTrigger.vue';
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { AvatarRoot } from 'radix-vue';
import { cn } from '#/lib/utils';
import { type AvatarVariants, avatarVariant } from './avatar';
const props = withDefaults(
defineProps<{
class?: HTMLAttributes['class'];
shape?: AvatarVariants['shape'];
size?: AvatarVariants['size'];
}>(),
{
shape: 'circle',
size: 'sm',
},
);
</script>
<template>
<AvatarRoot :class="cn(avatarVariant({ size, shape }), props.class)">
<slot></slot>
</AvatarRoot>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const avatarVariant = cva(
'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',
{
variants: {
shape: {
circle: 'rounded-full',
square: 'rounded-md',
},
size: {
base: 'h-16 w-16 text-2xl',
lg: 'h-32 w-32 text-5xl',
sm: 'h-10 w-10 text-xs',
},
},
},
);
export type AvatarVariants = VariantProps<typeof avatarVariant>;
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
import { type BadgeVariants, badgeVariants } from './badge';
const props = defineProps<{
class?: HTMLAttributes['class'];
variant?: BadgeVariants['variant'];
}>();
</script>
<template>
<div :class="cn(badgeVariants({ variant }), props.class)">
<slot></slot>
</div>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const badgeVariants = cva(
'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
{
defaultVariants: {
variant: 'default',
},
variants: {
variant: {
default:
'border-transparent bg-accent hover:bg-accent text-primary-foreground shadow',
destructive:
'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
outline: 'text-foreground',
secondary:
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
},
},
},
);
export type BadgeVariants = VariantProps<typeof badgeVariants>;
export { default as Badge } from './Badge.vue';
export * from './badge';
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { DotsHorizontalIcon } from '@radix-icons/vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
role="presentation"
aria-hidden="true"
:class="cn('flex h-9 w-9 items-center justify-center', props.class)"
>
<slot>
<DotsHorizontalIcon class="h-4 w-4" />
</slot>
<span class="sr-only">More</span>
</span>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<li
:class="
cn('hover:text-foreground inline-flex items-center gap-1.5', props.class)
"
>
<slot></slot>
</li>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & PrimitiveProps>(),
{
as: 'a',
},
);
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn('hover:text-foreground transition-colors', props.class)"
>
<slot></slot>
</Primitive>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<ol
:class="
cn(
'text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5',
props.class,
)
"
>
<slot></slot>
</ol>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
role="link"
aria-disabled="true"
aria-current="page"
:class="cn('text-foreground font-normal', props.class)"
>
<slot></slot>
</span>
</template>
<script lang="ts" setup>
import type { HTMLAttributes } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<li
role="presentation"
aria-hidden="true"
:class="cn('[&>svg]:size-3.5', props.class)"
>
<slot>
<ChevronRightIcon />
</slot>
</li>
</template>
export { default as Breadcrumb } from './Breadcrumb.vue';
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue';
export { default as BreadcrumbItem } from './BreadcrumbItem.vue';
export { default as BreadcrumbLink } from './BreadcrumbLink.vue';
export { default as BreadcrumbList } from './BreadcrumbList.vue';
export { default as BreadcrumbPage } from './BreadcrumbPage.vue';
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue';
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { Primitive, type PrimitiveProps } from 'radix-vue';
import { cn } from '#/lib/utils';
import { type ButtonVariants, buttonVariants } from './button';
interface Props extends PrimitiveProps {
class?: HTMLAttributes['class'];
size?: ButtonVariants['size'];
variant?: 'heavy' & ButtonVariants['variant'];
}
const props = withDefaults(defineProps<Props>(), {
as: 'button',
class: '',
});
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn(buttonVariants({ variant, size }), props.class)"
>
<slot></slot>
</Primitive>
</template>
import { type VariantProps, cva } from 'class-variance-authority';
export const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
{
defaultVariants: {
size: 'default',
variant: 'default',
},
variants: {
size: {
default: 'h-9 px-4 py-2',
icon: 'h-8 w-8 rounded-sm px-1 text-lg',
lg: 'h-10 rounded-md px-8',
sm: 'h-8 rounded-md px-3 text-xs',
xs: 'h-8 w-8 rounded-sm px-1 text-xs',
},
variant: {
default:
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
destructive:
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
ghost: 'hover:bg-accent hover:text-accent-foreground',
heavy: 'hover:bg-heavy hover:text-heavy-foreground',
icon: 'hover:bg-accent hover:text-accent-foreground text-foreground/80',
link: 'text-primary underline-offset-4 hover:underline',
outline:
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
secondary:
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
},
},
},
);
export type ButtonVariants = VariantProps<typeof buttonVariants>;
export { default as Button } from './Button.vue';
export * from './button';
<script setup lang="ts">
import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
CheckboxIndicator,
CheckboxRoot,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & CheckboxRootProps
>();
const emits = defineEmits<CheckboxRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<CheckboxRoot
v-bind="forwarded"
:class="
cn(
'focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground border-border peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<CheckboxIndicator
class="flex h-full w-full items-center justify-center text-current"
>
<slot>
<CheckIcon class="h-4 w-4" />
</slot>
</CheckboxIndicator>
</CheckboxRoot>
</template>
export { default as Checkbox } from './Checkbox.vue';
<script setup lang="ts">
import type { ContextMenuRootEmits, ContextMenuRootProps } from 'radix-vue';
import { ContextMenuRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<ContextMenuRootProps>();
const emits = defineEmits<ContextMenuRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuRoot v-bind="forwarded">
<slot></slot>
</ContextMenuRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
ContextMenuCheckboxItem,
type ContextMenuCheckboxItemEmits,
type ContextMenuCheckboxItemProps,
ContextMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuCheckboxItemProps
>();
const emits = defineEmits<ContextMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuCheckboxItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<ContextMenuItemIndicator>
<CheckIcon class="h-4 w-4" />
</ContextMenuItemIndicator>
</span>
<slot></slot>
</ContextMenuCheckboxItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuContent,
type ContextMenuContentEmits,
type ContextMenuContentProps,
ContextMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuContentProps
>();
const emits = defineEmits<ContextMenuContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuPortal>
<ContextMenuContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"
>
<slot></slot>
</ContextMenuContent>
</ContextMenuPortal>
</template>
<script setup lang="ts">
import { ContextMenuGroup, type ContextMenuGroupProps } from 'radix-vue';
const props = defineProps<ContextMenuGroupProps>();
</script>
<template>
<ContextMenuGroup v-bind="props">
<slot></slot>
</ContextMenuGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuItem,
type ContextMenuItemEmits,
type ContextMenuItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuItemProps
>();
const emits = defineEmits<ContextMenuItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</ContextMenuItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ContextMenuLabel, type ContextMenuLabelProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & ContextMenuLabelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ContextMenuLabel
v-bind="delegatedProps"
:class="
cn(
'text-foreground px-2 py-1.5 text-sm font-semibold',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</ContextMenuLabel>
</template>
<script setup lang="ts">
import { ContextMenuPortal, type ContextMenuPortalProps } from 'radix-vue';
const props = defineProps<ContextMenuPortalProps>();
</script>
<template>
<ContextMenuPortal v-bind="props">
<slot></slot>
</ContextMenuPortal>
</template>
<script setup lang="ts">
import {
ContextMenuRadioGroup,
type ContextMenuRadioGroupEmits,
type ContextMenuRadioGroupProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<ContextMenuRadioGroupProps>();
const emits = defineEmits<ContextMenuRadioGroupEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuRadioGroup v-bind="forwarded">
<slot></slot>
</ContextMenuRadioGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DotFilledIcon } from '@radix-icons/vue';
import {
ContextMenuItemIndicator,
ContextMenuRadioItem,
type ContextMenuRadioItemEmits,
type ContextMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuRadioItemProps
>();
const emits = defineEmits<ContextMenuRadioItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuRadioItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<ContextMenuItemIndicator>
<DotFilledIcon class="h-4 w-4 fill-current" />
</ContextMenuItemIndicator>
</span>
<slot></slot>
</ContextMenuRadioItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuSeparator,
type ContextMenuSeparatorProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & ContextMenuSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ContextMenuSeparator
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span
:class="
cn('text-muted-foreground ml-auto text-xs tracking-widest', props.class)
"
>
<slot></slot>
</span>
</template>
<script setup lang="ts">
import {
ContextMenuSub,
type ContextMenuSubEmits,
type ContextMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<ContextMenuSubProps>();
const emits = defineEmits<ContextMenuSubEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<ContextMenuSub v-bind="forwarded">
<slot></slot>
</ContextMenuSub>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ContextMenuSubContent,
type DropdownMenuSubContentEmits,
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps
>();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ContextMenuSubContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-32 overflow-hidden rounded-md border p-1 shadow-lg',
props.class,
)
"
>
<slot></slot>
</ContextMenuSubContent>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import {
ContextMenuSubTrigger,
type ContextMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{
class?: HTMLAttributes['class'];
inset?: boolean;
} & ContextMenuSubTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<ContextMenuSubTrigger
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
<ChevronRightIcon class="ml-auto h-4 w-4" />
</ContextMenuSubTrigger>
</template>
<script setup lang="ts">
import {
ContextMenuTrigger,
type ContextMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
const props = defineProps<ContextMenuTriggerProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<ContextMenuTrigger v-bind="forwardedProps">
<slot></slot>
</ContextMenuTrigger>
</template>
export { default as ContextMenu } from './ContextMenu.vue';
export { default as ContextMenuCheckboxItem } from './ContextMenuCheckboxItem.vue';
export { default as ContextMenuContent } from './ContextMenuContent.vue';
export { default as ContextMenuGroup } from './ContextMenuGroup.vue';
export { default as ContextMenuItem } from './ContextMenuItem.vue';
export { default as ContextMenuLabel } from './ContextMenuLabel.vue';
export { default as ContextMenuRadioGroup } from './ContextMenuRadioGroup.vue';
export { default as ContextMenuRadioItem } from './ContextMenuRadioItem.vue';
export { default as ContextMenuSeparator } from './ContextMenuSeparator.vue';
export { default as ContextMenuShortcut } from './ContextMenuShortcut.vue';
export { default as ContextMenuSub } from './ContextMenuSub.vue';
export { default as ContextMenuSubContent } from './ContextMenuSubContent.vue';
export { default as ContextMenuSubTrigger } from './ContextMenuSubTrigger.vue';
export { default as ContextMenuTrigger } from './ContextMenuTrigger.vue';
<script setup lang="ts">
import {
DialogRoot,
type DialogRootEmits,
type DialogRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DialogRootProps>();
const emits = defineEmits<DialogRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DialogRoot v-bind="forwarded">
<slot></slot>
</DialogRoot>
</template>
<script setup lang="ts">
import { DialogClose, type DialogCloseProps } from 'radix-vue';
const props = defineProps<DialogCloseProps>();
</script>
<template>
<DialogClose v-bind="props">
<slot></slot>
</DialogClose>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { Cross2Icon } from '@radix-icons/vue';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogContentProps
>();
const emits = defineEmits<{ close: [] } & DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-overlay fixed inset-0 z-[1000] backdrop-blur-sm"
@click="() => emits('close')"
/>
<DialogContent
v-bind="forwarded"
:class="
cn(
'bg-background 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-1/2 top-1/2 z-[1000] grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg outline-none duration-300 sm:rounded-lg',
props.class,
)
"
>
<slot></slot>
<DialogClose
class="data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:bg-accent hover:text-accent-foreground text-foreground/80 flex-center absolute right-3 top-3 h-6 w-6 rounded-full px-1 text-lg opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
@click="() => emits('close')"
>
<Cross2Icon class="h-4 w-4" />
</DialogClose>
</DialogContent>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogDescription,
type DialogDescriptionProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DialogDescription
v-bind="forwardedProps"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</DialogDescription>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<div
:class="cn('flex flex-col gap-y-1.5 text-center sm:text-left', props.class)"
>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogClose,
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogContentProps
>();
const emits = defineEmits<DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] grid place-items-center overflow-y-auto bg-black/80"
>
<DialogContent
:class="
cn(
'border-border bg-background relative z-50 my-8 grid w-full max-w-lg gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
props.class,
)
"
v-bind="forwarded"
@pointer-down-outside="
(event) => {
const originalEvent = event.detail.originalEvent;
const target = originalEvent.target as HTMLElement;
if (
originalEvent.offsetX > target.clientWidth ||
originalEvent.offsetY > target.clientHeight
) {
event.preventDefault();
}
}
"
>
<slot></slot>
<DialogClose
class="hover:bg-secondary absolute right-4 top-4 rounded-md p-0.5 transition-colors"
>
<Cross2Icon class="h-4 w-4" />
<span class="sr-only">Close</span>
</DialogClose>
</DialogContent>
</DialogOverlay>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DialogTitle
v-bind="forwardedProps"
:class="
cn('text-lg font-semibold leading-none tracking-tight', props.class)
"
>
<slot></slot>
</DialogTitle>
</template>
<script setup lang="ts">
import { DialogTrigger, type DialogTriggerProps } from 'radix-vue';
const props = defineProps<DialogTriggerProps>();
</script>
<template>
<DialogTrigger v-bind="props">
<slot></slot>
</DialogTrigger>
</template>
export { default as Dialog } from './Dialog.vue';
export { default as DialogClose } from './DialogClose.vue';
export { default as DialogContent } from './DialogContent.vue';
export { default as DialogDescription } from './DialogDescription.vue';
export { default as DialogFooter } from './DialogFooter.vue';
export { default as DialogHeader } from './DialogHeader.vue';
export { default as DialogScrollContent } from './DialogScrollContent.vue';
export { default as DialogTitle } from './DialogTitle.vue';
export { default as DialogTrigger } from './DialogTrigger.vue';
<script setup lang="ts">
import {
DropdownMenuRoot,
type DropdownMenuRootEmits,
type DropdownMenuRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuRootProps>();
const emits = defineEmits<DropdownMenuRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuRoot v-bind="forwarded">
<slot></slot>
</DropdownMenuRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
DropdownMenuCheckboxItem,
type DropdownMenuCheckboxItemEmits,
type DropdownMenuCheckboxItemProps,
DropdownMenuItemIndicator,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuCheckboxItemProps
>();
const emits = defineEmits<DropdownMenuCheckboxItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuCheckboxItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuItemIndicator>
<CheckIcon class="h-4 w-4" />
</DropdownMenuItemIndicator>
</span>
<slot></slot>
</DropdownMenuCheckboxItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuContent,
type DropdownMenuContentEmits,
type DropdownMenuContentProps,
DropdownMenuPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & DropdownMenuContentProps>(),
{
sideOffset: 4,
},
);
const emits = defineEmits<DropdownMenuContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuPortal>
<DropdownMenuContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"
>
<slot></slot>
</DropdownMenuContent>
</DropdownMenuPortal>
</template>
<script setup lang="ts">
import { DropdownMenuGroup, type DropdownMenuGroupProps } from 'radix-vue';
const props = defineProps<DropdownMenuGroupProps>();
</script>
<template>
<DropdownMenuGroup v-bind="props">
<slot></slot>
</DropdownMenuGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuItem,
type DropdownMenuItemProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuItemProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuItem
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)
"
>
<slot></slot>
</DropdownMenuItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuLabel,
type DropdownMenuLabelProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class']; inset?: boolean } & DropdownMenuLabelProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuLabel
v-bind="forwardedProps"
:class="
cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', props.class)
"
>
<slot></slot>
</DropdownMenuLabel>
</template>
<script setup lang="ts">
import {
DropdownMenuRadioGroup,
type DropdownMenuRadioGroupEmits,
type DropdownMenuRadioGroupProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuRadioGroupProps>();
const emits = defineEmits<DropdownMenuRadioGroupEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuRadioGroup v-bind="forwarded">
<slot></slot>
</DropdownMenuRadioGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DotFilledIcon } from '@radix-icons/vue';
import {
DropdownMenuItemIndicator,
DropdownMenuRadioItem,
type DropdownMenuRadioItemEmits,
type DropdownMenuRadioItemProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuRadioItemProps
>();
const emits = defineEmits<DropdownMenuRadioItemEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuRadioItem
v-bind="forwarded"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<DropdownMenuItemIndicator>
<DotFilledIcon class="h-4 w-4 fill-current" />
</DropdownMenuItemIndicator>
</span>
<slot></slot>
</DropdownMenuRadioItem>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuSeparator,
type DropdownMenuSeparatorProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{
class?: HTMLAttributes['class'];
} & DropdownMenuSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DropdownMenuSeparator
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{
class?: HTMLAttributes['class'];
}>();
</script>
<template>
<span :class="cn('ml-auto text-xs tracking-widest opacity-60', props.class)">
<slot></slot>
</span>
</template>
<script setup lang="ts">
import {
DropdownMenuSub,
type DropdownMenuSubEmits,
type DropdownMenuSubProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DropdownMenuSubProps>();
const emits = defineEmits<DropdownMenuSubEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DropdownMenuSub v-bind="forwarded">
<slot></slot>
</DropdownMenuSub>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DropdownMenuSubContent,
type DropdownMenuSubContentEmits,
type DropdownMenuSubContentProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubContentProps
>();
const emits = defineEmits<DropdownMenuSubContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DropdownMenuSubContent
v-bind="forwarded"
:class="
cn(
'bg-popover text-popover-foreground 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-32 overflow-hidden rounded-md border p-1 shadow-lg',
props.class,
)
"
>
<slot></slot>
</DropdownMenuSubContent>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronRightIcon } from '@radix-icons/vue';
import {
DropdownMenuSubTrigger,
type DropdownMenuSubTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DropdownMenuSubTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<DropdownMenuSubTrigger
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
props.class,
)
"
>
<slot></slot>
<ChevronRightIcon class="ml-auto h-4 w-4" />
</DropdownMenuSubTrigger>
</template>
<script setup lang="ts">
import {
DropdownMenuTrigger,
type DropdownMenuTriggerProps,
useForwardProps,
} from 'radix-vue';
const props = defineProps<DropdownMenuTriggerProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<DropdownMenuTrigger class="outline-none" v-bind="forwardedProps">
<slot></slot>
</DropdownMenuTrigger>
</template>
export { default as DropdownMenu } from './DropdownMenu.vue';
export { default as DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem.vue';
export { default as DropdownMenuContent } from './DropdownMenuContent.vue';
export { default as DropdownMenuGroup } from './DropdownMenuGroup.vue';
export { default as DropdownMenuItem } from './DropdownMenuItem.vue';
export { default as DropdownMenuLabel } from './DropdownMenuLabel.vue';
export { default as DropdownMenuRadioGroup } from './DropdownMenuRadioGroup.vue';
export { default as DropdownMenuRadioItem } from './DropdownMenuRadioItem.vue';
export { default as DropdownMenuSeparator } from './DropdownMenuSeparator.vue';
export { default as DropdownMenuShortcut } from './DropdownMenuShortcut.vue';
export { default as DropdownMenuSub } from './DropdownMenuSub.vue';
export { default as DropdownMenuSubContent } from './DropdownMenuSubContent.vue';
export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger.vue';
export { default as DropdownMenuTrigger } from './DropdownMenuTrigger.vue';
export { DropdownMenuPortal } from 'radix-vue';
<script setup lang="ts">
import {
HoverCardRoot,
type HoverCardRootEmits,
type HoverCardRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<HoverCardRootProps>();
const emits = defineEmits<HoverCardRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<HoverCardRoot v-bind="forwarded">
<slot></slot>
</HoverCardRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
HoverCardContent,
type HoverCardContentProps,
HoverCardPortal,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & HoverCardContentProps>(),
{
sideOffset: 4,
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<HoverCardPortal>
<HoverCardContent
v-bind="forwardedProps"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] w-64 rounded-md border p-4 shadow-md outline-none',
props.class,
)
"
>
<slot></slot>
</HoverCardContent>
</HoverCardPortal>
</template>
<script setup lang="ts">
import { HoverCardTrigger, type HoverCardTriggerProps } from 'radix-vue';
const props = defineProps<HoverCardTriggerProps>();
</script>
<template>
<HoverCardTrigger v-bind="props">
<slot></slot>
</HoverCardTrigger>
</template>
export { default as HoverCard } from './HoverCard.vue';
export { default as HoverCardContent } from './HoverCardContent.vue';
export { default as HoverCardTrigger } from './HoverCardTrigger.vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputRoot,
type PinInputRootEmits,
type PinInputRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputRootProps
>();
const emits = defineEmits<PinInputRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PinInputRoot
v-bind="forwarded"
:class="cn('flex items-center gap-2', props.class)"
>
<slot></slot>
</PinInputRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PrimitiveProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<Primitive
v-bind="forwardedProps"
:class="cn('flex items-center', props.class)"
>
<slot></slot>
</Primitive>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PinInputInput,
type PinInputInputProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & PinInputInputProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<PinInputInput
v-bind="forwardedProps"
:class="
cn(
'border-input bg-background relative flex h-10 w-10 items-center justify-center border-y border-r text-center text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md focus:relative focus:z-10 focus:outline-none focus:ring-2',
props.class,
)
"
/>
</template>
<script setup lang="ts">
import { DashIcon } from '@radix-icons/vue';
import { Primitive, type PrimitiveProps, useForwardProps } from 'radix-vue';
const props = defineProps<PrimitiveProps>();
const forwardedProps = useForwardProps(props);
</script>
<template>
<Primitive v-bind="forwardedProps">
<slot>
<DashIcon />
</slot>
</Primitive>
</template>
export { default as PinInput } from './PinInput.vue';
export { default as PinInputGroup } from './PinInputGroup.vue';
export { default as PinInputInput } from './PinInputInput.vue';
export { default as PinInputSeparator } from './PinInputSeparator.vue';
<script setup lang="ts">
import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue';
import { PopoverRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<PopoverRootProps>();
const emits = defineEmits<PopoverRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<PopoverRoot v-bind="forwarded">
<slot></slot>
</PopoverRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
PopoverContent,
type PopoverContentEmits,
type PopoverContentProps,
PopoverPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & PopoverContentProps>(),
{
align: 'center',
sideOffset: 4,
},
);
const emits = defineEmits<PopoverContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PopoverPortal>
<PopoverContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-popover text-popover-foreground 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 w-72 rounded-md border p-4 shadow-md outline-none',
props.class,
)
"
>
<slot></slot>
</PopoverContent>
</PopoverPortal>
</template>
<script setup lang="ts">
import { PopoverTrigger, type PopoverTriggerProps } from 'radix-vue';
const props = defineProps<PopoverTriggerProps>();
</script>
<template>
<PopoverTrigger v-bind="props">
<slot></slot>
</PopoverTrigger>
</template>
export { default as Popover } from './Popover.vue';
export { default as PopoverContent } from './PopoverContent.vue';
export { default as PopoverTrigger } from './PopoverTrigger.vue';
export { PopoverAnchor } from 'radix-vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaCorner,
ScrollAreaRoot,
type ScrollAreaRootProps,
ScrollAreaViewport,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import ScrollBar from './ScrollBar.vue';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
onScroll?: (event: Event) => void;
viewportProps?: { onScroll: (event: Event) => void };
} & ScrollAreaRootProps
>(),
{
onScroll: () => {},
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ScrollAreaRoot
v-bind="delegatedProps"
:class="cn('relative overflow-hidden', props.class)"
>
<ScrollAreaViewport
class="h-full w-full rounded-[inherit]"
as-child
@scroll="onScroll"
>
<slot></slot>
</ScrollAreaViewport>
<ScrollBar />
<ScrollAreaCorner />
</ScrollAreaRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
ScrollAreaScrollbar,
type ScrollAreaScrollbarProps,
ScrollAreaThumb,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & ScrollAreaScrollbarProps>(),
{
orientation: 'vertical',
},
);
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<ScrollAreaScrollbar
v-bind="delegatedProps"
:class="
cn(
'flex touch-none select-none transition-colors',
orientation === 'vertical' &&
'h-full w-2.5 border-l border-l-transparent p-px',
orientation === 'horizontal' &&
'h-2.5 flex-col border-t border-t-transparent p-px',
props.class,
)
"
>
<ScrollAreaThumb class="bg-border relative flex-1 rounded-full" />
</ScrollAreaScrollbar>
</template>
export { default as ScrollArea } from './ScrollArea.vue';
export { default as ScrollBar } from './ScrollBar.vue';
<script setup lang="ts">
import type { SelectRootEmits, SelectRootProps } from 'radix-vue';
import { SelectRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<SelectRootProps>();
const emits = defineEmits<SelectRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<SelectRoot v-bind="forwarded">
<slot></slot>
</SelectRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
SelectContent,
type SelectContentEmits,
type SelectContentProps,
SelectPortal,
SelectViewport,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { SelectScrollDownButton, SelectScrollUpButton } from '.';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & SelectContentProps>(),
{
position: 'popper',
},
);
const emits = defineEmits<SelectContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<SelectPortal>
<SelectContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-popover text-popover-foreground 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-[1000] max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',
position === 'popper' &&
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
props.class,
)
"
>
<SelectScrollUpButton />
<SelectViewport
:class="
cn(
'p-1',
position === 'popper' &&
'h-[--radix-select-trigger-height] w-full min-w-[--radix-select-trigger-width]',
)
"
>
<slot></slot>
</SelectViewport>
<SelectScrollDownButton />
</SelectContent>
</SelectPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { SelectGroup, type SelectGroupProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectGroupProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<SelectGroup :class="cn('w-full p-1', props.class)" v-bind="delegatedProps">
<slot></slot>
</SelectGroup>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CheckIcon } from '@radix-icons/vue';
import {
SelectItem,
SelectItemIndicator,
type SelectItemProps,
SelectItemText,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectItemProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectItem
v-bind="forwardedProps"
:class="
cn(
'focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectItemIndicator>
<CheckIcon class="h-4 w-4" />
</SelectItemIndicator>
</span>
<SelectItemText>
<slot></slot>
</SelectItemText>
</SelectItem>
</template>
<script setup lang="ts">
import { SelectItemText, type SelectItemTextProps } from 'radix-vue';
const props = defineProps<SelectItemTextProps>();
</script>
<template>
<SelectItemText v-bind="props">
<slot></slot>
</SelectItemText>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { SelectLabel, type SelectLabelProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectLabelProps
>();
</script>
<template>
<SelectLabel :class="cn('px-2 py-1.5 text-sm font-semibold', props.class)">
<slot></slot>
</SelectLabel>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronDownIcon } from '@radix-icons/vue';
import {
SelectScrollDownButton,
type SelectScrollDownButtonProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollDownButtonProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectScrollDownButton
v-bind="forwardedProps"
:class="
cn('flex cursor-default items-center justify-center py-1', props.class)
"
>
<slot>
<ChevronDownIcon />
</slot>
</SelectScrollDownButton>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { ChevronUpIcon } from '@radix-icons/vue';
import {
SelectScrollUpButton,
type SelectScrollUpButtonProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectScrollUpButtonProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectScrollUpButton
v-bind="forwardedProps"
:class="
cn('flex cursor-default items-center justify-center py-1', props.class)
"
>
<slot>
<ChevronUpIcon />
</slot>
</SelectScrollUpButton>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { SelectSeparator, type SelectSeparatorProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectSeparatorProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<SelectSeparator
v-bind="delegatedProps"
:class="cn('bg-muted -mx-1 my-1 h-px', props.class)"
/>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { CaretSortIcon } from '@radix-icons/vue';
import {
SelectIcon,
SelectTrigger,
type SelectTriggerProps,
useForwardProps,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SelectTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<SelectTrigger
v-bind="forwardedProps"
:class="
cn(
'border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
props.class,
)
"
>
<slot></slot>
<SelectIcon as-child>
<CaretSortIcon class="h-4 w-4 opacity-50" />
</SelectIcon>
</SelectTrigger>
</template>
<script setup lang="ts">
import { SelectValue, type SelectValueProps } from 'radix-vue';
const props = defineProps<SelectValueProps>();
</script>
<template>
<SelectValue v-bind="props">
<slot></slot>
</SelectValue>
</template>
export { default as Select } from './Select.vue';
export { default as SelectContent } from './SelectContent.vue';
export { default as SelectGroup } from './SelectGroup.vue';
export { default as SelectItem } from './SelectItem.vue';
export { default as SelectItemText } from './SelectItemText.vue';
export { default as SelectLabel } from './SelectLabel.vue';
export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue';
export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue';
export { default as SelectSeparator } from './SelectSeparator.vue';
export { default as SelectTrigger } from './SelectTrigger.vue';
export { default as SelectValue } from './SelectValue.vue';
<script setup lang="ts">
import {
DialogRoot,
type DialogRootEmits,
type DialogRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<DialogRootProps>();
const emits = defineEmits<DialogRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<DialogRoot v-bind="forwarded">
<slot></slot>
</DialogRoot>
</template>
<script setup lang="ts">
import { DialogClose, type DialogCloseProps } from 'radix-vue';
const props = defineProps<DialogCloseProps>();
</script>
<template>
<DialogClose v-bind="props">
<slot></slot>
</DialogClose>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
DialogContent,
type DialogContentEmits,
type DialogContentProps,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { type SheetVariants, sheetVariants } from './sheet';
interface SheetContentProps extends DialogContentProps {
class?: HTMLAttributes['class'];
side?: SheetVariants['side'];
}
defineOptions({
inheritAttrs: false,
});
const props = defineProps<SheetContentProps>();
const emits = defineEmits<DialogContentEmits>();
const delegatedProps = computed(() => {
const { class: _, side: _side, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<DialogPortal>
<DialogOverlay
class="bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000]"
/>
<DialogContent
:class="cn(sheetVariants({ side }), 'z-[1000]', props.class)"
v-bind="{ ...forwarded, ...$attrs }"
>
<slot></slot>
<!-- <DialogClose
class="data-[state=open]:bg-secondary absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none"
>
<Cross2Icon class="h-5 w-" />
</DialogClose> -->
</DialogContent>
</DialogPortal>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogDescription, type DialogDescriptionProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogDescriptionProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DialogDescription
:class="cn('text-muted-foreground text-sm', props.class)"
v-bind="delegatedProps"
>
<slot></slot>
</DialogDescription>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot></slot>
</div>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '#/lib/utils';
const props = defineProps<{ class?: HTMLAttributes['class'] }>();
</script>
<template>
<div :class="cn('flex flex-col text-center sm:text-left', props.class)">
<slot></slot>
</div>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { DialogTitle, type DialogTitleProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & DialogTitleProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<DialogTitle
:class="cn('text-foreground font-medium', props.class)"
v-bind="delegatedProps"
>
<slot></slot>
</DialogTitle>
</template>
<script setup lang="ts">
import { DialogTrigger, type DialogTriggerProps } from 'radix-vue';
const props = defineProps<DialogTriggerProps>();
</script>
<template>
<DialogTrigger v-bind="props">
<slot></slot>
</DialogTrigger>
</template>
export { default as Sheet } from './Sheet.vue';
export { default as SheetClose } from './SheetClose.vue';
export { default as SheetContent } from './SheetContent.vue';
export { default as SheetDescription } from './SheetDescription.vue';
export { default as SheetFooter } from './SheetFooter.vue';
export { default as SheetHeader } from './SheetHeader.vue';
export { default as SheetTitle } from './SheetTitle.vue';
export { default as SheetTrigger } from './SheetTrigger.vue';
export * from './sheet';
import { type VariantProps, cva } from 'class-variance-authority';
export const sheetVariants = cva(
'fixed z-50 gap-4 bg-background shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
{
defaultVariants: {
side: 'right',
},
variants: {
side: {
bottom:
'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
right:
'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
},
},
},
);
export type SheetVariants = VariantProps<typeof sheetVariants>;
<script lang="ts" setup>
import { Toaster as Sonner, type ToasterProps } from 'vue-sonner';
const props = withDefaults(defineProps<ToasterProps>(), {
closeButton: true,
duration: 2500,
position: 'top-right',
richColors: true,
visibleToasts: 3,
});
</script>
<template>
<Sonner
class="toaster group"
v-bind="props"
:toast-options="{
classes: {
closeButton:
'!border-border group-[.toast]:bg-muted group-[.toast]:text-muted-foreground !bg-muted hover:!text-foreground',
toast:
'group toast group-[.toaster]:bg-background group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
description: 'group-[.toast]:text-muted-foreground',
actionButton:
'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
cancelButton:
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
},
}"
/>
</template>
<!-- <style scoped>
:deep([data-sonner-toaster][data-theme='dark']),
:deep([data-sonner-toaster][data-theme='light']) {
--normal-bg: hsl(var(--color-background));
--normal-border: theme('colors.border');
--normal-text: theme('colors.popover.foreground');
--border-radius: theme('borderRadius.md');
}
</style> -->
export { default as Toaster } from './Sonner.vue';
export { toast } from 'vue-sonner';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
SwitchRoot,
type SwitchRootEmits,
type SwitchRootProps,
SwitchThumb,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & SwitchRootProps
>();
const emits = defineEmits<SwitchRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<SwitchRoot
v-bind="forwarded"
:class="
cn(
'focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-5 w-9 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-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<SwitchThumb
:class="
cn(
'bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',
)
"
/>
</SwitchRoot>
</template>
<script setup lang="ts">
import type { TabsRootEmits, TabsRootProps } from 'radix-vue';
import { TabsRoot, useForwardPropsEmits } from 'radix-vue';
const props = defineProps<TabsRootProps>();
const emits = defineEmits<TabsRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<TabsRoot v-bind="forwarded">
<slot></slot>
</TabsRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsContent, type TabsContentProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsContentProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<TabsContent
:class="
cn(
'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
props.class,
)
"
v-bind="delegatedProps"
>
<slot></slot>
</TabsContent>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsList, type TabsListProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsListProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
</script>
<template>
<TabsList
v-bind="delegatedProps"
:class="
cn(
'bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1',
props.class,
)
"
>
<slot></slot>
</TabsList>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue';
import { cn } from '#/lib/utils';
const props = defineProps<
{ class?: HTMLAttributes['class'] } & TabsTriggerProps
>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<TabsTrigger
v-bind="forwardedProps"
:class="
cn(
'ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow',
props.class,
)
"
>
<slot></slot>
</TabsTrigger>
</template>
export { default as Tabs } from './Tabs.vue';
export { default as TabsContent } from './TabsContent.vue';
export { default as TabsList } from './TabsList.vue';
export { default as TabsTrigger } from './TabsTrigger.vue';
export { TabsIndicator } from 'radix-vue';
<script setup lang="ts">
import type { VariantProps } from 'class-variance-authority';
import type { toggleVariants } from '#/components/ui/toggle';
import { type HTMLAttributes, computed, provide } from 'vue';
import {
ToggleGroupRoot,
type ToggleGroupRootEmits,
type ToggleGroupRootProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
type ToggleGroupVariants = VariantProps<typeof toggleVariants>;
const props = defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleGroupVariants['size'];
variant?: ToggleGroupVariants['variant'];
} & ToggleGroupRootProps
>();
const emits = defineEmits<ToggleGroupRootEmits>();
provide('toggleGroup', {
size: props.size,
variant: props.variant,
});
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<ToggleGroupRoot
v-bind="forwarded"
:class="cn('flex items-center justify-center gap-1', props.class)"
>
<slot></slot>
</ToggleGroupRoot>
</template>
<script setup lang="ts">
import type { VariantProps } from 'class-variance-authority';
import { type HTMLAttributes, computed, inject } from 'vue';
import {
ToggleGroupItem,
type ToggleGroupItemProps,
useForwardProps,
} from 'radix-vue';
import { toggleVariants } from '#/components/ui/toggle';
import { cn } from '#/lib/utils';
type ToggleGroupVariants = VariantProps<typeof toggleVariants>;
const props = defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleGroupVariants['size'];
variant?: ToggleGroupVariants['variant'];
} & ToggleGroupItemProps
>();
const context = inject<ToggleGroupVariants>('toggleGroup');
const delegatedProps = computed(() => {
const { class: _, size: _size, variant: _variant, ...delegated } = props;
return delegated;
});
const forwardedProps = useForwardProps(delegatedProps);
</script>
<template>
<ToggleGroupItem
v-bind="forwardedProps"
:class="
cn(
toggleVariants({
variant: context?.variant || variant,
size: context?.size || size,
}),
props.class,
)
"
>
<slot></slot>
</ToggleGroupItem>
</template>
export { default as ToggleGroup } from './ToggleGroup.vue';
export { default as ToggleGroupItem } from './ToggleGroupItem.vue';
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
Toggle,
type ToggleEmits,
type ToggleProps,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
import { type ToggleVariants, toggleVariants } from './toggle';
const props = withDefaults(
defineProps<
{
class?: HTMLAttributes['class'];
size?: ToggleVariants['size'];
variant?: ToggleVariants['variant'];
} & ToggleProps
>(),
{
disabled: false,
size: 'default',
variant: 'default',
},
);
const emits = defineEmits<ToggleEmits>();
const delegatedProps = computed(() => {
const { class: _, size: _size, variant: _variant, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<Toggle
v-bind="forwarded"
:class="cn(toggleVariants({ variant, size }), props.class)"
>
<slot></slot>
</Toggle>
</template>
export { default as Toggle } from './Toggle.vue';
export * from './toggle';
import { type VariantProps, cva } from 'class-variance-authority';
export const toggleVariants = cva(
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
{
defaultVariants: {
size: 'default',
variant: 'default',
},
variants: {
size: {
default: 'h-9 px-3',
lg: 'h-10 px-3',
sm: 'h-8 px-2',
},
variant: {
default: 'bg-transparent',
outline:
'border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground',
},
},
},
);
export type ToggleVariants = VariantProps<typeof toggleVariants>;
<script setup lang="ts">
import {
TooltipRoot,
type TooltipRootEmits,
type TooltipRootProps,
useForwardPropsEmits,
} from 'radix-vue';
const props = defineProps<TooltipRootProps>();
const emits = defineEmits<TooltipRootEmits>();
const forwarded = useForwardPropsEmits(props, emits);
</script>
<template>
<TooltipRoot v-bind="forwarded">
<slot></slot>
</TooltipRoot>
</template>
<script setup lang="ts">
import { type HTMLAttributes, computed } from 'vue';
import {
TooltipContent,
type TooltipContentEmits,
type TooltipContentProps,
TooltipPortal,
useForwardPropsEmits,
} from 'radix-vue';
import { cn } from '#/lib/utils';
defineOptions({
inheritAttrs: false,
});
const props = withDefaults(
defineProps<{ class?: HTMLAttributes['class'] } & TooltipContentProps>(),
{
side: 'right',
sideOffset: 5,
},
);
const emits = defineEmits<TooltipContentEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<TooltipPortal>
<TooltipContent
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'bg-accent text-accent-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 z-[1000] overflow-hidden rounded-sm px-4 py-2 text-xs shadow-md',
props.class,
)
"
>
<slot></slot>
</TooltipContent>
</TooltipPortal>
</template>
<script setup lang="ts">
import { TooltipProvider, type TooltipProviderProps } from 'radix-vue';
const props = defineProps<TooltipProviderProps>();
</script>
<template>
<TooltipProvider v-bind="props">
<slot></slot>
</TooltipProvider>
</template>
<script setup lang="ts">
import { TooltipTrigger, type TooltipTriggerProps } from 'radix-vue';
const props = defineProps<TooltipTriggerProps>();
</script>
<template>
<TooltipTrigger v-bind="props">
<slot></slot>
</TooltipTrigger>
</template>
export { default as Tooltip } from './Tooltip.vue';
export { default as TooltipContent } from './TooltipContent.vue';
export { default as TooltipProvider } from './TooltipProvider.vue';
export { default as TooltipTrigger } from './TooltipTrigger.vue';
import './styles/index.css';
export * from './components';
export {
useEmitAsProps,
useForwardExpose,
useForwardProps,
useForwardPropsEmits,
} from 'radix-vue';
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
.side-content {
animation-duration: 0.2s;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
.side-content[data-side='top'] {
animation-name: slide-up;
}
.side-content[data-side='bottom'] {
animation-name: slide-down;
}
.side-content[data-side='left'] {
animation-name: slide-left;
}
.side-content[data-side='right'] {
animation-name: slide-right;
}
.breadcrumb-transition-enter-active {
transition:
transform 0.4s cubic-bezier(0.76, 0, 0.24, 1),
opacity 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}
.breadcrumb-transition-leave-active {
display: none;
}
.breadcrumb-transition-enter-from {
opacity: 0;
transform: translateX(30px) skewX(-30deg);
}
/*
.breadcrumb-transition-move,
.breadcrumb-transition-enter-active {
transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
.breadcrumb-transition-leave-active {
display: none;
}
.breadcrumb-transition-enter-from {
opacity: 0;
transform: translateX(-5px);
} */
@keyframes slide-down {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-left {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-right {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slide-up {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
export { default } from '@vben/tailwind-config';
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"#/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules"]
}
import { defineConfig } from '@vben/vite-config';
export default defineConfig();
{
"name": "@vben-core/tabs-ui",
"version": "1.0.0",
"type": "module",
"license": "MIT",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
"directory": "packages/@vben-core/uikit/tabs-ui"
},
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"scripts": {
"build": "pnpm vite build",
"prepublishOnly": "npm run build"
},
"files": [
"dist"
],
"sideEffects": [
"**/*.css"
],
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"imports": {
"#*": "./src/*"
},
"exports": {
".": {
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
}
}
},
"dependencies": {
"@vben-core/design": "workspace:*",
"@vben-core/iconify": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/toolkit": "workspace:*",
"@vben-core/typings": "workspace:*",
"vue": "3.4.27"
}
}
export { default } from '@vben/tailwind-config/postcss';
@import '@vben-core/design/global';
@include b('chrome-tabs') {
--tabs-background: hsl(var(--color-background));
--tabs-gap: 7px;
--tabs-divider: hsl(var(--color-border));
--tabs-hover: hsl(var(--color-heavy));
--tabs-active-background: hsl(var(--color-primary) / 100%);
--tabs-active: hsl(var(--color-primary-foreground));
position: relative;
width: 100%;
height: 100%;
padding-top: 4px;
background-color: var(--tabs-background);
@include e('content') {
position: relative;
height: 32px;
overflow: hidden;
}
}
@include b('chrome-tab') {
position: absolute;
display: flex;
align-items: center;
height: 100%;
color: hsl(var(--color-muted-foreground));
cursor: pointer;
user-select: none;
@include is('active') {
z-index: 2;
color: var(--tabs-active);
.#{$namespace}-chrome-tab__extra:not(.is-pin) {
background-color: var(--tabs-active-background);
opacity: 1;
}
.#{$namespace}-chrome-tab-background__divider {
display: none;
}
.#{$namespace}-chrome-tab-background__content {
background-color: var(--tabs-active-background);
}
.#{$namespace}-chrome-tab-background__before,
.#{$namespace}-chrome-tab-background__after {
fill: var(--tabs-active-background);
}
}
@include e('content') {
position: absolute;
right: 0;
left: 0;
// z-index: 1;
display: flex;
align-items: center;
height: 100%;
padding-right: 10px;
margin: 0 calc(var(--tabs-gap) * 2);
overflow: hidden;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
@include e('extra') {
position: absolute;
top: 50%;
right: calc(var(--tabs-gap) * 2);
z-index: 1;
width: 14px;
height: 14px;
border-radius: 50%;
opacity: 0;
transition: 0.15s;
transform: translateY(-50%);
// &:hover {
// background-color: hsl(var(--color-accent));
// }
}
@include e('extra-icon') {
flex-shrink: 0;
width: 100%;
height: 100%;
font-size: 12px;
border-radius: 50%;
transition: all 0.15s ease;
&:hover {
color: hsl(var(--color-foreground));
transform: scale(1.05);
}
}
@include e('icon') {
display: flex;
align-items: center;
height: 16px;
margin-left: 3%;
overflow: hidden;
img {
height: 100%;
}
}
@include e('label') {
position: relative;
flex: 1;
margin-right: 8px;
margin-left: 5%;
overflow: hidden;
font-size: 14px;
white-space: nowrap;
mask-image: linear-gradient(
90deg,
#000 0%,
#000 calc(100% - 20px),
transparent
);
// &.no-close {
// margin-right: 0;
// }
// &.no-icon {
// margin-left: 0;
// }
}
@include is('hidden-icon') {
margin-left: 0;
}
&:hover {
.#{$namespace}-chrome-tab__extra.is-pin {
opacity: 1;
}
}
&:not(.is-active):hover {
z-index: 1;
.#{$namespace}-chrome-tab__extra {
opacity: 1;
}
.#{$namespace}-chrome-tab-background__divider {
display: none;
}
.#{$namespace}-chrome-tab-background__content {
background-color: var(--tabs-hover);
}
.#{$namespace}-chrome-tab-background__before,
.#{$namespace}-chrome-tab-background__after {
fill: var(--tabs-hover);
}
}
&:first-of-type {
.#{$namespace}-chrome-tab-background__divider::before {
display: none;
}
}
}
@include b('chrome-tab-background') {
position: absolute;
width: 100%;
height: 100%;
padding: 0 calc(var(--tabs-gap) + 0px);
@include e('divider') {
position: absolute;
left: 0;
width: calc(100% - 14px);
height: 100%;
margin: 0 7px;
&::before {
position: absolute;
top: 20%;
right: 100%;
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
&::after {
position: absolute;
top: 20%;
left: calc(100% - 1px);
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
}
@include e('content') {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
transition: background 0.15s ease;
}
@include e('before') {
position: absolute;
bottom: -1px;
left: -3px;
fill: transparent;
transition: 0.15s;
}
@include e('after') {
position: absolute;
right: -3px;
bottom: -1px;
fill: transparent;
transition: 0.15s;
}
}
<script setup lang="ts">
import { useNamespace } from '@vben-core/toolkit';
defineOptions({
name: 'ChromeTabBackground',
});
const { b, e } = useNamespace('chrome-tab-background');
</script>
<template>
<div :class="b()">
<div :class="e('divider')"></div>
<div :class="e('content')"></div>
<svg width="10" height="10" :class="e('before')">
<path d="M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z" />
</svg>
<svg width="10" height="10" :class="e('after')">
<path d="M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z" />
</svg>
</div>
</template>
<script setup lang="ts">
import type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { TabItem } from '@vben-core/typings';
import { IcRoundClose, MdiPin } from '@vben-core/iconify';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
import { useNamespace } from '@vben-core/toolkit';
import TabBackground from './tab-background.vue';
interface Props {
affixTab?: boolean;
icon?: string;
menus: (data: any) => IContextMenuItem[];
onlyOne?: boolean;
showIcon?: boolean;
tab: TabItem;
title: string;
}
defineOptions({
name: 'ChromeTab',
});
withDefaults(defineProps<Props>(), {
icon: '',
});
const emit = defineEmits<{ close: []; unPushPin: [] }>();
const { b, e, is } = useNamespace('chrome-tab');
function handleClose() {
emit('close');
}
function handleUnPushPin() {
emit('unPushPin');
}
</script>
<template>
<div :class="[b()]">
<VbenContextMenu :menus="menus" :handler-data="tab" item-class="pr-4">
<div class="h-full">
<TabBackground />
<div :class="e('content')" :title="title">
<VbenIcon v-if="showIcon" :class="e('icon')" :icon="icon" fallback />
<span :class="[e('label'), is('hidden-icon', !icon)]">
{{ title }}
</span>
</div>
<div
v-show="!affixTab && !onlyOne"
:class="e('extra')"
@click.stop="handleClose"
>
<IcRoundClose :class="e('extra-icon')" />
</div>
<div
v-show="affixTab && !onlyOne"
:class="[e('extra'), is('pin', true)]"
@click.stop="handleUnPushPin"
>
<MdiPin :class="e('extra-icon')" />
</div>
</div>
</VbenContextMenu>
</div>
</template>
<script setup lang="ts">
import type { TabItem } from '@vben-core/typings';
import type { TabsProps } from '../../interface';
import { computed, nextTick, onMounted, ref, watch } from 'vue';
import { useNamespace } from '@vben-core/toolkit';
import Tab from './tab.vue';
interface Props extends TabsProps {}
defineOptions({
name: 'ChromeTabs',
});
const props = withDefaults(defineProps<Props>(), {
maxWidth: 150,
menus: () => [],
minWidth: 40,
tabs: () => [],
});
const emit = defineEmits<{ close: [string]; unPushPin: [TabItem] }>();
const gap = 7;
const active = defineModel<string>('active');
const { b, e, is } = useNamespace('chrome-tabs');
const contentRef = ref();
const tabWidth = ref<number>(0);
const layout = () => {
const { maxWidth, minWidth, tabs } = props;
if (!contentRef.value) {
return Math.max(maxWidth, minWidth);
}
const contentWidth = contentRef.value.clientWidth - gap * 3;
let width = contentWidth / tabs.length;
width += gap * 2;
if (width > maxWidth) {
width = maxWidth;
}
if (width < minWidth) {
width = minWidth;
}
tabWidth.value = width;
};
const tabsView = computed(() => {
return props.tabs.map((tab) => {
return {
...tab,
affixTab: !!tab.meta?.affixTab,
icon: tab.meta.icon as string,
key: tab.fullPath || tab.path,
title: (tab.meta?.title || tab.name) as string,
};
});
});
watch(
() => props.tabs,
() => {
nextTick(() => {
layout();
});
},
);
onMounted(() => {
layout();
});
function handleClose(key: string) {
emit('close', key);
}
function handleUnPushPin(tab: TabItem) {
emit('unPushPin', tab);
}
</script>
<template>
<div :class="b()">
<div ref="contentRef" :class="e('content')">
<TransitionGroup name="slide-down">
<Tab
v-for="(tab, i) in tabsView"
:key="tab.key"
:menus="menus"
:tab="tab"
:icon="tab.icon"
:title="tab.title"
:show-icon="showIcon"
:affix-tab="tab.affixTab"
:only-one="tabsView.length <= 1"
:class="[e('tab'), is('active', tab.key === active)]"
:style="{
width: `${tabWidth}px`,
left: `${(tabWidth - gap * 2) * i}px`,
}"
@click="active = tab.key"
@close="() => handleClose(tab.key)"
@un-push-pin="() => handleUnPushPin(tab)"
/>
</TransitionGroup>
</div>
</div>
</template>
<style lang="scss">
@import './chrome-tabs.scss';
</style>
export { default as ChromeTabs } from './chrome-tabs/tabs.vue';
export { default as TabsMore } from './tabs-more.vue';
export { default as TabsScreen } from './tabs-screen.vue';
<script lang="ts" setup>
import type { DropdownMenuProps } from '@vben-core/shadcn-ui';
import { IcRoundMoreVert } from '@vben-core/iconify';
import { VbenDropdownMenu } from '@vben-core/shadcn-ui';
defineProps<DropdownMenuProps>();
</script>
<template>
<VbenDropdownMenu :menus="menus">
<div
class="flex-center hover:bg-accent hover:text-foreground text-muted-foreground h-full cursor-pointer border-l px-2 text-lg font-semibold"
>
<IcRoundMoreVert />
</div>
</VbenDropdownMenu>
</template>
<script lang="ts" setup>
import { IcRoundFitScreen, IcTwotoneFitScreen } from '@vben-core/iconify';
const screen = defineModel<boolean>('screen');
function toggleScreen() {
screen.value = !screen.value;
}
</script>
<template>
<div
class="flex-center hover:bg-accent hover:text-foreground text-muted-foreground h-full cursor-pointer border-l px-2 text-lg font-semibold"
@click="toggleScreen"
>
<IcTwotoneFitScreen v-if="screen" />
<IcRoundFitScreen v-else />
</div>
</template>
<script lang="ts" setup></script>
<template>
<div></div>
</template>
export { TabsMore, TabsScreen } from './components';
export { default as TabsView } from './tabs-view.vue';
export type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { IContextMenuItem } from '@vben-core/shadcn-ui';
import type { TabItem } from '@vben-core/typings';
interface TabsProps {
maxWidth?: number;
menus?: (data: any) => IContextMenuItem[];
minWidth?: number;
showIcon?: boolean;
tabs?: TabItem[];
}
export type { TabsProps };
<script setup lang="ts">
import type { TabItem } from '@vben-core/typings';
import { useForwardPropsEmits } from '@vben-core/shadcn-ui';
import { ChromeTabs } from './components';
import { TabsProps } from './interface';
interface Props extends TabsProps {}
defineOptions({
name: 'TabsView',
});
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<{ close: [string]; unPushPin: [TabItem] }>();
const forward = useForwardPropsEmits(props, emit);
</script>
<template>
<ChromeTabs v-bind="forward" />
</template>
export { default } from '@vben/tailwind-config';
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json",
"include": ["src"],
"exclude": ["node_modules"]
}
import { defineConfig } from '@vben/vite-config';
export default defineConfig();
...@@ -84,7 +84,7 @@ function handleClick(item: NotificationItem) { ...@@ -84,7 +84,7 @@ function handleClick(item: NotificationItem) {
<div class="flex items-center justify-between border-b p-4 py-3"> <div class="flex items-center justify-between border-b p-4 py-3">
<div class="text-foreground">{{ $t('widgets.notifications') }}</div> <div class="text-foreground">{{ $t('widgets.notifications') }}</div>
<VbenIconButton <VbenIconButton
:tooltip="$t('widgets.make-all-notify')" :tooltip="$t('widgets.make-all-as-read')"
@click="handleMakeAll" @click="handleMakeAll"
> >
<IcRoundMarkEmailRead /> <IcRoundMarkEmailRead />
......
...@@ -29,7 +29,7 @@ widgets: ...@@ -29,7 +29,7 @@ widgets:
logout-tip: Do you want to log out? logout-tip: Do you want to log out?
view-all: View all messages view-all: View all messages
notifications: Notifications notifications: Notifications
make-all-notify: Make all as read make-all-as-read: Make all as read
clear-notifications: Clear clear-notifications: Clear
search: search:
......
...@@ -28,7 +28,7 @@ widgets: ...@@ -28,7 +28,7 @@ widgets:
logout-tip: 是否退出登录? logout-tip: 是否退出登录?
view-all: 查看所有消息 view-all: 查看所有消息
notifications: 通知 notifications: 通知
make-all-notify: 全部标记为已读 make-all-as-read: 全部标记为已读
clear-notifications: 清空 clear-notifications: 清空
search: search:
......
$max-child: 5;
@for $i from 1 through $max-child {
* > .enter-x:nth-child(#{$i}) {
transform: translateX(50px);
}
* > .-enter-x:nth-child(#{$i}) {
transform: translateX(-50px);
}
* > .enter-x:nth-child(#{$i}),
* > .-enter-x:nth-child(#{$i}) {
// z-index: 10 - $i;
opacity: 0;
animation: enter-x-animation 0.3s ease-in-out 0.2s;
animation-delay: 0.1s * $i;
animation-fill-mode: forwards;
}
* > .enter-y:nth-child(#{$i}) {
transform: translateY(50px);
}
* > .-enter-y:nth-child(#{$i}) {
transform: translateY(-50px);
}
* > .enter-y:nth-child(#{$i}),
* > .-enter-y:nth-child(#{$i}) {
// z-index: 10 - $i;
opacity: 0;
animation: enter-y-animation 0.3s ease-in-out 0.2s;
animation-delay: 0.1s * $i;
animation-fill-mode: forwards;
}
}
@keyframes enter-x-animation {
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes enter-y-animation {
to {
opacity: 1;
transform: translateY(0);
}
}
import './index.scss';
import '@vben-core/design/tailwind';
import '@vben-core/design'; import '@vben-core/design';
import '@vben-core/design-tokens'; import '@vben-core/design-tokens';
import '@vben-core/design/tailwind';
import './index.scss';
...@@ -96,16 +96,16 @@ importers: ...@@ -96,16 +96,16 @@ importers:
dependencies: dependencies:
'@vben-core/helpers': '@vben-core/helpers':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/@vben-core/forward/helpers version: link:../../packages/@core/forward/helpers
'@vben-core/preferences': '@vben-core/preferences':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/@vben-core/forward/preferences version: link:../../packages/@core/forward/preferences
'@vben-core/request': '@vben-core/request':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/@vben-core/forward/request version: link:../../packages/@core/forward/request
'@vben-core/stores': '@vben-core/stores':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/@vben-core/forward/stores version: link:../../packages/@core/forward/stores
'@vben/common-ui': '@vben/common-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../packages/business/common-ui version: link:../../packages/business/common-ui
...@@ -463,7 +463,7 @@ importers: ...@@ -463,7 +463,7 @@ importers:
specifier: ^3.0.2 specifier: ^3.0.2
version: 3.0.2(esbuild@0.20.2)(mockjs@1.1.0)(vite@6.0.0-alpha.17(@types/node@20.14.2)(sass@1.77.4)(terser@5.31.0)) version: 3.0.2(esbuild@0.20.2)(mockjs@1.1.0)(vite@6.0.0-alpha.17(@types/node@20.14.2)(sass@1.77.4)(terser@5.31.0))
packages/@vben-core/forward/helpers: packages/@core/forward/helpers:
dependencies: dependencies:
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
...@@ -475,7 +475,7 @@ importers: ...@@ -475,7 +475,7 @@ importers:
specifier: ^4.3.2 specifier: ^4.3.2
version: 4.3.2(vue@3.4.27(typescript@5.4.5)) version: 4.3.2(vue@3.4.27(typescript@5.4.5))
packages/@vben-core/forward/preferences: packages/@core/forward/preferences:
dependencies: dependencies:
'@vben-core/cache': '@vben-core/cache':
specifier: workspace:* specifier: workspace:*
...@@ -496,7 +496,7 @@ importers: ...@@ -496,7 +496,7 @@ importers:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
packages/@vben-core/forward/request: packages/@core/forward/request:
dependencies: dependencies:
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
...@@ -512,7 +512,7 @@ importers: ...@@ -512,7 +512,7 @@ importers:
specifier: ^1.22.0 specifier: ^1.22.0
version: 1.22.0(axios@1.7.2) version: 1.22.0(axios@1.7.2)
packages/@vben-core/forward/stores: packages/@core/forward/stores:
dependencies: dependencies:
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
...@@ -533,17 +533,17 @@ importers: ...@@ -533,17 +533,17 @@ importers:
specifier: ^4.3.2 specifier: ^4.3.2
version: 4.3.2(vue@3.4.27(typescript@5.4.5)) version: 4.3.2(vue@3.4.27(typescript@5.4.5))
packages/@vben-core/shared/chche: {} packages/@core/shared/chche: {}
packages/@vben-core/shared/design: packages/@core/shared/design:
dependencies: dependencies:
modern-normalize: modern-normalize:
specifier: ^2.0.0 specifier: ^2.0.0
version: 2.0.0 version: 2.0.0
packages/@vben-core/shared/design-tokens: {} packages/@core/shared/design-tokens: {}
packages/@vben-core/shared/iconify: packages/@core/shared/iconify:
dependencies: dependencies:
'@iconify/vue': '@iconify/vue':
specifier: ^4.1.2 specifier: ^4.1.2
...@@ -552,7 +552,7 @@ importers: ...@@ -552,7 +552,7 @@ importers:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
packages/@vben-core/shared/toolkit: packages/@core/shared/toolkit:
dependencies: dependencies:
'@ctrl/tinycolor': '@ctrl/tinycolor':
specifier: 4.1.0 specifier: 4.1.0
...@@ -574,7 +574,7 @@ importers: ...@@ -574,7 +574,7 @@ importers:
specifier: ^0.2.3 specifier: ^0.2.3
version: 0.2.3 version: 0.2.3
packages/@vben-core/shared/typings: packages/@core/shared/typings:
dependencies: dependencies:
vue: vue:
specifier: 3.4.27 specifier: 3.4.27
...@@ -583,7 +583,7 @@ importers: ...@@ -583,7 +583,7 @@ importers:
specifier: ^4.3.2 specifier: ^4.3.2
version: 4.3.2(vue@3.4.27(typescript@5.4.5)) version: 4.3.2(vue@3.4.27(typescript@5.4.5))
packages/@vben-core/uikit/layout-ui: packages/@core/uikit/layout-ui:
dependencies: dependencies:
'@vben-core/design': '@vben-core/design':
specifier: workspace:* specifier: workspace:*
...@@ -607,7 +607,7 @@ importers: ...@@ -607,7 +607,7 @@ importers:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
packages/@vben-core/uikit/menu-ui: packages/@core/uikit/menu-ui:
dependencies: dependencies:
'@vben-core/design': '@vben-core/design':
specifier: workspace:* specifier: workspace:*
...@@ -631,7 +631,7 @@ importers: ...@@ -631,7 +631,7 @@ importers:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
packages/@vben-core/uikit/shadcn-ui: packages/@core/uikit/shadcn-ui:
dependencies: dependencies:
'@radix-icons/vue': '@radix-icons/vue':
specifier: ^1.0.0 specifier: ^1.0.0
...@@ -667,7 +667,7 @@ importers: ...@@ -667,7 +667,7 @@ importers:
specifier: ^1.1.2 specifier: ^1.1.2
version: 1.1.2 version: 1.1.2
packages/@vben-core/uikit/tabs-ui: packages/@core/uikit/tabs-ui:
dependencies: dependencies:
'@vben-core/design': '@vben-core/design':
specifier: workspace:* specifier: workspace:*
...@@ -692,19 +692,19 @@ importers: ...@@ -692,19 +692,19 @@ importers:
dependencies: dependencies:
'@vben-core/design': '@vben-core/design':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/design version: link:../../@core/shared/design
'@vben-core/iconify': '@vben-core/iconify':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/iconify version: link:../../@core/shared/iconify
'@vben-core/preferences': '@vben-core/preferences':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/forward/preferences version: link:../../@core/forward/preferences
'@vben-core/shadcn-ui': '@vben-core/shadcn-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/uikit/shadcn-ui version: link:../../@core/uikit/shadcn-ui
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/toolkit version: link:../../@core/shared/toolkit
'@vben/locales': '@vben/locales':
specifier: workspace:* specifier: workspace:*
version: link:../../locales version: link:../../locales
...@@ -735,28 +735,28 @@ importers: ...@@ -735,28 +735,28 @@ importers:
dependencies: dependencies:
'@vben-core/iconify': '@vben-core/iconify':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/iconify version: link:../../@core/shared/iconify
'@vben-core/layout-ui': '@vben-core/layout-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/uikit/layout-ui version: link:../../@core/uikit/layout-ui
'@vben-core/menu-ui': '@vben-core/menu-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/uikit/menu-ui version: link:../../@core/uikit/menu-ui
'@vben-core/preferences': '@vben-core/preferences':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/forward/preferences version: link:../../@core/forward/preferences
'@vben-core/shadcn-ui': '@vben-core/shadcn-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/uikit/shadcn-ui version: link:../../@core/uikit/shadcn-ui
'@vben-core/stores': '@vben-core/stores':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/forward/stores version: link:../../@core/forward/stores
'@vben-core/tabs-ui': '@vben-core/tabs-ui':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/uikit/tabs-ui version: link:../../@core/uikit/tabs-ui
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/toolkit version: link:../../@core/shared/toolkit
'@vben/common-ui': '@vben/common-ui':
specifier: workspace:* specifier: workspace:*
version: link:../common-ui version: link:../common-ui
...@@ -772,7 +772,7 @@ importers: ...@@ -772,7 +772,7 @@ importers:
devDependencies: devDependencies:
'@vben-core/typings': '@vben-core/typings':
specifier: workspace:* specifier: workspace:*
version: link:../../@vben-core/shared/typings version: link:../../@core/shared/typings
packages/constants: {} packages/constants: {}
...@@ -786,7 +786,7 @@ importers: ...@@ -786,7 +786,7 @@ importers:
dependencies: dependencies:
'@vben-core/iconify': '@vben-core/iconify':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/iconify version: link:../@core/shared/iconify
packages/locales: packages/locales:
dependencies: dependencies:
...@@ -795,7 +795,7 @@ importers: ...@@ -795,7 +795,7 @@ importers:
version: 9.13.1 version: 9.13.1
'@vben-core/typings': '@vben-core/typings':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/typings version: link:../@core/shared/typings
vue: vue:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
...@@ -807,16 +807,16 @@ importers: ...@@ -807,16 +807,16 @@ importers:
dependencies: dependencies:
'@vben-core/design': '@vben-core/design':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/design version: link:../@core/shared/design
'@vben-core/design-tokens': '@vben-core/design-tokens':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/design-tokens version: link:../@core/shared/design-tokens
packages/types: packages/types:
dependencies: dependencies:
'@vben-core/typings': '@vben-core/typings':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/typings version: link:../@core/shared/typings
vue: vue:
specifier: 3.4.27 specifier: 3.4.27
version: 3.4.27(typescript@5.4.5) version: 3.4.27(typescript@5.4.5)
...@@ -828,7 +828,7 @@ importers: ...@@ -828,7 +828,7 @@ importers:
dependencies: dependencies:
'@vben-core/toolkit': '@vben-core/toolkit':
specifier: workspace:* specifier: workspace:*
version: link:../@vben-core/shared/toolkit version: link:../@core/shared/toolkit
scripts/vsh: scripts/vsh:
dependencies: dependencies:
......
...@@ -2,10 +2,10 @@ packages: ...@@ -2,10 +2,10 @@ packages:
- "internal/*" - "internal/*"
- "internal/lint-configs/*" - "internal/lint-configs/*"
- "packages/*" - "packages/*"
- "packages/@vben-core/shared/*" - "packages/@core/shared/*"
- "packages/@vben-core/uikit/*" - "packages/@core/uikit/*"
- "packages/@vben-core/forward/*" - "packages/@core/forward/*"
- "packages/@vben-core/helpers" - "packages/@core/helpers"
- "packages/business/*" - "packages/business/*"
- "apps/*" - "apps/*"
- "scripts/*" - "scripts/*"
......
...@@ -42,59 +42,59 @@ ...@@ -42,59 +42,59 @@
}, },
{ {
"name": "@vben-core/helpers", "name": "@vben-core/helpers",
"path": "packages/@vben-core/forward/helpers", "path": "packages/@core/forward/helpers",
}, },
{ {
"name": "@vben-core/preferences", "name": "@vben-core/preferences",
"path": "packages/@vben-core/forward/preferences", "path": "packages/@core/forward/preferences",
}, },
{ {
"name": "@vben-core/request", "name": "@vben-core/request",
"path": "packages/@vben-core/forward/request", "path": "packages/@core/forward/request",
}, },
{ {
"name": "@vben-core/stores", "name": "@vben-core/stores",
"path": "packages/@vben-core/forward/stores", "path": "packages/@core/forward/stores",
}, },
{ {
"name": "@vben-core/cache", "name": "@vben-core/cache",
"path": "packages/@vben-core/shared/chche", "path": "packages/@core/shared/chche",
}, },
{ {
"name": "@vben-core/design", "name": "@vben-core/design",
"path": "packages/@vben-core/shared/design", "path": "packages/@core/shared/design",
}, },
{ {
"name": "@vben-core/design-tokens", "name": "@vben-core/design-tokens",
"path": "packages/@vben-core/shared/design-tokens", "path": "packages/@core/shared/design-tokens",
}, },
{ {
"name": "@vben-core/iconify", "name": "@vben-core/iconify",
"path": "packages/@vben-core/shared/iconify", "path": "packages/@core/shared/iconify",
}, },
{ {
"name": "@vben-core/toolkit", "name": "@vben-core/toolkit",
"path": "packages/@vben-core/shared/toolkit", "path": "packages/@core/shared/toolkit",
}, },
{ {
"name": "@vben-core/typings", "name": "@vben-core/typings",
"path": "packages/@vben-core/shared/typings", "path": "packages/@core/shared/typings",
}, },
{ {
"name": "@vben-core/layout-ui", "name": "@vben-core/layout-ui",
"path": "packages/@vben-core/uikit/layout-ui", "path": "packages/@core/uikit/layout-ui",
}, },
{ {
"name": "@vben-core/menu-ui", "name": "@vben-core/menu-ui",
"path": "packages/@vben-core/uikit/menu-ui", "path": "packages/@core/uikit/menu-ui",
}, },
{ {
"name": "@vben-core/shadcn-ui", "name": "@vben-core/shadcn-ui",
"path": "packages/@vben-core/uikit/shadcn-ui", "path": "packages/@core/uikit/shadcn-ui",
}, },
{ {
"name": "@vben-core/tabs-ui", "name": "@vben-core/tabs-ui",
"path": "packages/@vben-core/uikit/tabs-ui", "path": "packages/@core/uikit/tabs-ui",
}, },
{ {
"name": "@vben/common-ui", "name": "@vben/common-ui",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!