@nuxt/ui
Version:
A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
80 lines (79 loc) • 3.34 kB
TypeScript
import type { AppConfig } from '@nuxt/schema';
import theme from '#build/ui/dashboard-sidebar';
import type { UseResizableProps } from '../composables/useResizable';
import type { ButtonProps, DrawerProps, ModalProps, SlideoverProps, LinkPropsKeys } from '../types';
import type { ComponentConfig } from '../types/tv';
type DashboardSidebar = ComponentConfig<typeof theme, AppConfig, 'dashboardSidebar'>;
type DashboardSidebarMode = 'modal' | 'slideover' | 'drawer';
type DashboardSidebarMenu<T> = T extends 'modal' ? ModalProps : T extends 'slideover' ? SlideoverProps : T extends 'drawer' ? DrawerProps : never;
export interface DashboardSidebarProps<T extends DashboardSidebarMode = DashboardSidebarMode> extends Pick<UseResizableProps, 'id' | 'side' | 'minSize' | 'maxSize' | 'defaultSize' | 'resizable' | 'collapsible' | 'collapsedSize'> {
/**
* The mode of the sidebar menu.
* @defaultValue 'modal'
*/
mode?: T;
/**
* The props for the sidebar menu component.
*/
menu?: DashboardSidebarMenu<T>;
/**
* Customize the toggle button to open the sidebar.
* `{ color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
* @defaultValue true
*/
toggle?: boolean | Omit<ButtonProps, LinkPropsKeys>;
/**
* The side to render the toggle button on.
* @defaultValue 'left'
*/
toggleSide?: 'left' | 'right';
class?: any;
ui?: DashboardSidebar['slots'];
}
export interface DashboardSidebarSlots {
'header'(props: {
collapsed?: boolean;
collapse?: (value: boolean) => void;
}): any;
'default'(props: {
collapsed?: boolean;
collapse?: (value: boolean) => void;
}): any;
'footer'(props: {
collapsed?: boolean;
collapse?: (value: boolean) => void;
}): any;
'toggle'(props: {
open: boolean;
toggle: () => void;
ui: DashboardSidebar['ui'];
}): any;
'content'(props: {
close?: () => void;
}): any;
'resize-handle'(props: {
onMouseDown: (e: MouseEvent) => void;
onTouchStart: (e: TouchEvent) => void;
onDoubleClick: (e: MouseEvent) => void;
ui: DashboardSidebar['ui'];
}): any;
}
declare const __VLS_export: <T extends DashboardSidebarMode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
props: __VLS_PrettifyLocal<(DashboardSidebarProps<T> & {
open?: boolean;
collapsed?: boolean;
}) & __VLS_EmitsToProps<__VLS_NormalizeEmits<((evt: "update:open", value: boolean) => void) & ((evt: "update:collapsed", value: boolean) => void)>>> & import("vue").PublicProps & (typeof globalThis extends {
__VLS_PROPS_FALLBACK: infer P;
} ? P : {});
expose: (exposed: {}) => void;
attrs: any;
slots: DashboardSidebarSlots;
emit: ((evt: "update:open", value: boolean) => void) & ((evt: "update:collapsed", value: boolean) => void);
}>) => import("vue").VNode & {
__ctx?: Awaited<typeof __VLS_setup>;
};
declare const _default: typeof __VLS_export;
export default _default;
type __VLS_PrettifyLocal<T> = {
[K in keyof T as K]: T[K];
} & {};