UNPKG

@eslamdevui/ui

Version:

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.

87 lines (86 loc) 2.7 kB
import theme from '#build/ui/content/content-toc'; import type { CollapsibleRootProps, CollapsibleRootEmits } from 'reka-ui'; import type { TocLink } from '@nuxt/content'; import type { AppConfig } from '@nuxt/schema'; import type { ComponentConfig } from '../../types'; type ContentToc = ComponentConfig<typeof theme, AppConfig, 'contentToc'>; export type ContentTocLink = TocLink & { class?: any; ui?: Pick<ContentToc['slots'], 'item' | 'itemWithChildren' | 'link' | 'linkText'>; }; export interface ContentTocProps<T extends ContentTocLink = ContentTocLink> extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> { /** * The element or component this component should render as. * @defaultValue 'nav' */ as?: any; /** * The icon displayed to collapse the content. * @defaultValue appConfig.ui.icons.chevronDown * @IconifyIcon */ trailingIcon?: string; /** * The title of the table of contents. * @defaultValue t('contentToc.title') */ title?: string; /** * @defaultValue 'primary' */ color?: ContentToc['variants']['color']; /** * Display a line next to the active link. * @defaultValue false */ highlight?: boolean; /** * @defaultValue 'primary' */ highlightColor?: ContentToc['variants']['highlightColor']; links?: T[]; class?: any; ui?: ContentToc['slots']; } export type ContentTocEmits = CollapsibleRootEmits & { move: [id: string]; }; type SlotProps<T> = (props: { link: T; }) => any; export interface ContentTocSlots<T extends ContentTocLink = ContentTocLink> { leading(props: { open: boolean; }): any; default(props: { open: boolean; }): any; trailing(props: { open: boolean; }): any; content(props: { links: T[]; }): any; link: SlotProps<T>; top(props: { links?: T[]; }): any; bottom(props: { links?: T[]; }): any; } declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContentTocProps<ContentTocLink>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { "update:open": (value: boolean) => any; move: (id: string) => any; }, string, import("vue").PublicProps, Readonly<ContentTocProps<ContentTocLink>> & Readonly<{ "onUpdate:open"?: ((value: boolean) => any) | undefined; onMove?: ((id: string) => any) | undefined; }>, { as: any; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContentTocSlots<ContentTocLink>>; export default _default; type __VLS_WithSlots<T, S> = T & { new (): { $slots: S; }; };