UNPKG

@bitrix24/b24ui-nuxt

Version:

Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE

825 lines (824 loc) 20.9 kB
import type { VariantProps } from 'tailwind-variants'; import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui'; import type { AvatarProps, BadgeProps, LinkProps, IconComponent } from '../types'; import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, PartialString, EmitsToProps } from '../types/utils'; declare const navigationMenu: import("tailwind-variants").TVReturnType<{ color: { default: { link: string; childLink: string; }; danger: { link: string; childLink: string; }; success: { link: string; childLink: string; }; warning: { link: string; childLink: string; }; primary: { link: string; childLink: string; }; secondary: { link: string; childLink: string; }; collab: { link: string; childLink: string; }; ai: { link: string; childLink: string; }; }; highlightColor: { default: string; danger: string; success: string; warning: string; primary: string; secondary: string; collab: string; ai: string; }; variant: { pill: { link: string; viewport: string; }; link: string; }; orientation: { horizontal: { root: string; list: string; item: string; link: string; childList: string; }; vertical: { root: string; link: string; }; }; contentOrientation: { horizontal: { viewportWrapper: string; content: string; childLinkLabelExternalIcon: string; }; vertical: { viewport: string; childLinkLabel: string; childLinkLabelExternalIcon: string; }; }; active: { true: { childLink: string; childLinkIcon: string; }; false: { link: string; linkLeadingIcon: string; childLink: string; childLinkIcon: string; }; }; disabled: { true: { link: string; }; }; highlight: { true: string; }; level: { true: string; }; collapsed: { true: string; }; }, { root: string; list: string; label: string; item: string; link: string; linkLeadingIcon: string; linkLeadingAvatar: string; linkLeadingAvatarSize: string; linkTrailing: string; linkTrailingBadge: string; linkTrailingBadgeSize: string; linkTrailingIcon: string; linkLabel: string; linkLabelWrapper: string; linkLabelExternalIcon: string; childList: string; childItem: string; childLink: string; childLinkWrapper: string; childLinkIcon: string; childLinkLabel: string; childLinkLabelExternalIcon: string; childLinkDescription: string; separator: string; viewportWrapper: string; viewport: string; content: string; indicator: string; arrow: string; }, undefined, { color: { default: { link: string; childLink: string; }; danger: { link: string; childLink: string; }; success: { link: string; childLink: string; }; warning: { link: string; childLink: string; }; primary: { link: string; childLink: string; }; secondary: { link: string; childLink: string; }; collab: { link: string; childLink: string; }; ai: { link: string; childLink: string; }; }; highlightColor: { default: string; danger: string; success: string; warning: string; primary: string; secondary: string; collab: string; ai: string; }; variant: { pill: { link: string; viewport: string; }; link: string; }; orientation: { horizontal: { root: string; list: string; item: string; link: string; childList: string; }; vertical: { root: string; link: string; }; }; contentOrientation: { horizontal: { viewportWrapper: string; content: string; childLinkLabelExternalIcon: string; }; vertical: { viewport: string; childLinkLabel: string; childLinkLabelExternalIcon: string; }; }; active: { true: { childLink: string; childLinkIcon: string; }; false: { link: string; linkLeadingIcon: string; childLink: string; childLinkIcon: string; }; }; disabled: { true: { link: string; }; }; highlight: { true: string; }; level: { true: string; }; collapsed: { true: string; }; }, { root: string; list: string; label: string; item: string; link: string; linkLeadingIcon: string; linkLeadingAvatar: string; linkLeadingAvatarSize: string; linkTrailing: string; linkTrailingBadge: string; linkTrailingBadgeSize: string; linkTrailingIcon: string; linkLabel: string; linkLabelWrapper: string; linkLabelExternalIcon: string; childList: string; childItem: string; childLink: string; childLinkWrapper: string; childLinkIcon: string; childLinkLabel: string; childLinkLabelExternalIcon: string; childLinkDescription: string; separator: string; viewportWrapper: string; viewport: string; content: string; indicator: string; arrow: string; }, import("tailwind-variants").TVReturnType<{ color: { default: { link: string; childLink: string; }; danger: { link: string; childLink: string; }; success: { link: string; childLink: string; }; warning: { link: string; childLink: string; }; primary: { link: string; childLink: string; }; secondary: { link: string; childLink: string; }; collab: { link: string; childLink: string; }; ai: { link: string; childLink: string; }; }; highlightColor: { default: string; danger: string; success: string; warning: string; primary: string; secondary: string; collab: string; ai: string; }; variant: { pill: { link: string; viewport: string; }; link: string; }; orientation: { horizontal: { root: string; list: string; item: string; link: string; childList: string; }; vertical: { root: string; link: string; }; }; contentOrientation: { horizontal: { viewportWrapper: string; content: string; childLinkLabelExternalIcon: string; }; vertical: { viewport: string; childLinkLabel: string; childLinkLabelExternalIcon: string; }; }; active: { true: { childLink: string; childLinkIcon: string; }; false: { link: string; linkLeadingIcon: string; childLink: string; childLinkIcon: string; }; }; disabled: { true: { link: string; }; }; highlight: { true: string; }; level: { true: string; }; collapsed: { true: string; }; }, { root: string; list: string; label: string; item: string; link: string; linkLeadingIcon: string; linkLeadingAvatar: string; linkLeadingAvatarSize: string; linkTrailing: string; linkTrailingBadge: string; linkTrailingBadgeSize: string; linkTrailingIcon: string; linkLabel: string; linkLabelWrapper: string; linkLabelExternalIcon: string; childList: string; childItem: string; childLink: string; childLinkWrapper: string; childLinkIcon: string; childLinkLabel: string; childLinkLabelExternalIcon: string; childLinkDescription: string; separator: string; viewportWrapper: string; viewport: string; content: string; indicator: string; arrow: string; }, undefined, { color: { default: { link: string; childLink: string; }; danger: { link: string; childLink: string; }; success: { link: string; childLink: string; }; warning: { link: string; childLink: string; }; primary: { link: string; childLink: string; }; secondary: { link: string; childLink: string; }; collab: { link: string; childLink: string; }; ai: { link: string; childLink: string; }; }; highlightColor: { default: string; danger: string; success: string; warning: string; primary: string; secondary: string; collab: string; ai: string; }; variant: { pill: { link: string; viewport: string; }; link: string; }; orientation: { horizontal: { root: string; list: string; item: string; link: string; childList: string; }; vertical: { root: string; link: string; }; }; contentOrientation: { horizontal: { viewportWrapper: string; content: string; childLinkLabelExternalIcon: string; }; vertical: { viewport: string; childLinkLabel: string; childLinkLabelExternalIcon: string; }; }; active: { true: { childLink: string; childLinkIcon: string; }; false: { link: string; linkLeadingIcon: string; childLink: string; childLinkIcon: string; }; }; disabled: { true: { link: string; }; }; highlight: { true: string; }; level: { true: string; }; collapsed: { true: string; }; }, { root: string; list: string; label: string; item: string; link: string; linkLeadingIcon: string; linkLeadingAvatar: string; linkLeadingAvatarSize: string; linkTrailing: string; linkTrailingBadge: string; linkTrailingBadgeSize: string; linkTrailingIcon: string; linkLabel: string; linkLabelWrapper: string; linkLabelExternalIcon: string; childList: string; childItem: string; childLink: string; childLinkWrapper: string; childLinkIcon: string; childLinkLabel: string; childLinkLabelExternalIcon: string; childLinkDescription: string; separator: string; viewportWrapper: string; viewport: string; content: string; indicator: string; arrow: string; }, import("tailwind-variants").TVReturnType<{ color: { default: { link: string; childLink: string; }; danger: { link: string; childLink: string; }; success: { link: string; childLink: string; }; warning: { link: string; childLink: string; }; primary: { link: string; childLink: string; }; secondary: { link: string; childLink: string; }; collab: { link: string; childLink: string; }; ai: { link: string; childLink: string; }; }; highlightColor: { default: string; danger: string; success: string; warning: string; primary: string; secondary: string; collab: string; ai: string; }; variant: { pill: { link: string; viewport: string; }; link: string; }; orientation: { horizontal: { root: string; list: string; item: string; link: string; childList: string; }; vertical: { root: string; link: string; }; }; contentOrientation: { horizontal: { viewportWrapper: string; content: string; childLinkLabelExternalIcon: string; }; vertical: { viewport: string; childLinkLabel: string; childLinkLabelExternalIcon: string; }; }; active: { true: { childLink: string; childLinkIcon: string; }; false: { link: string; linkLeadingIcon: string; childLink: string; childLinkIcon: string; }; }; disabled: { true: { link: string; }; }; highlight: { true: string; }; level: { true: string; }; collapsed: { true: string; }; }, { root: string; list: string; label: string; item: string; link: string; linkLeadingIcon: string; linkLeadingAvatar: string; linkLeadingAvatarSize: string; linkTrailing: string; linkTrailingBadge: string; linkTrailingBadgeSize: string; linkTrailingIcon: string; linkLabel: string; linkLabelWrapper: string; linkLabelExternalIcon: string; childList: string; childItem: string; childLink: string; childLinkWrapper: string; childLinkIcon: string; childLinkLabel: string; childLinkLabelExternalIcon: string; childLinkDescription: string; separator: string; viewportWrapper: string; viewport: string; content: string; indicator: string; arrow: string; }, undefined, unknown, unknown, undefined>>>; export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type'> { /** Description is only used when `orientation` is `horizontal`. */ description?: string; [key: string]: any; } export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> { label?: string; /** * @IconComponent */ icon?: IconComponent; avatar?: AvatarProps; /** * Display a badge on the item. * `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"} */ badge?: string | number | BadgeProps; /** * @IconComponent */ trailingIcon?: IconComponent; /** * The type of the item. * The `label` type only works on `vertical` orientation. * @defaultValue 'link' */ type?: 'label' | 'link'; slot?: string; value?: string; children?: NavigationMenuChildItem[]; /** * With orientation=`horizontal` if `true` it will position the dropdown menu correctly */ viewportRtl?: boolean; onSelect?(e: Event): void; [key: string]: any; } type NavigationMenuVariants = VariantProps<typeof navigationMenu>; export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> { /** * The element or component this component should render as. * @defaultValue 'div' */ as?: any; /** * The icon displayed to open the menu. * @defaultValue icons.chevronDown * @IconComponent */ trailingIcon?: IconComponent; /** * The icon displayed when the item is an external link. * Set to `false` to hide the external icon. * @defaultValue icons.external * @IconComponent */ externalIcon?: boolean | IconComponent; items?: T; /** * @defaultValue 'primary' */ color?: NavigationMenuVariants['color']; /** * @defaultValue 'pill' */ variant?: NavigationMenuVariants['variant']; /** * The orientation of the menu. * @defaultValue 'horizontal' */ orientation?: NavigationMenuRootProps['orientation']; /** * Collapse the navigation menu to only show icons. * Only works when `orientation` is `vertical`. * @defaultValue false */ collapsed?: boolean; /** Display a line next to the active item. */ highlight?: boolean; /** * @defaultValue 'primary' */ highlightColor?: NavigationMenuVariants['highlightColor']; /** * The content of the menu. */ content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>; /** * The orientation of the content. * Only works when `orientation` is `horizontal`. * @defaultValue 'vertical' */ contentOrientation?: NavigationMenuVariants['contentOrientation']; /** * Display an arrow alongside the menu. * @defaultValue false */ arrow?: boolean; /** * The key used to get the label from the item. * @defaultValue 'label' */ labelKey?: keyof NestedItem<T>; class?: any; b24ui?: PartialString<typeof navigationMenu.slots>; } export interface NavigationMenuEmits extends NavigationMenuRootEmits { } type SlotProps<T extends NavigationMenuItem> = (props: { item: T; index: number; active?: boolean; }) => any; export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>, T extends NestedItem<A> = NestedItem<A>> = { 'item': SlotProps<T>; 'item-leading': SlotProps<T>; 'item-label': SlotProps<T>; 'item-trailing': SlotProps<T>; 'item-content': SlotProps<T>; } & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing' | 'content', { index: number; active?: boolean; }>; declare const _default: <T extends ArrayOrNested<NavigationMenuItem>>(__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<any & NavigationMenuProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps); expose(exposed: import("vue").ShallowUnwrapRef<{}>): void; attrs: any; slots: Readonly<{ item: SlotProps<NestedItem<T>>; 'item-leading': SlotProps<NestedItem<T>>; 'item-label': SlotProps<NestedItem<T>>; 'item-trailing': SlotProps<NestedItem<T>>; 'item-content': SlotProps<NestedItem<T>>; } & DynamicSlots<MergeTypes<NestedItem<T>>, "label" | "trailing" | "leading" | "content", { index: number; active?: boolean; }>> & { item: SlotProps<NestedItem<T>>; 'item-leading': SlotProps<NestedItem<T>>; 'item-label': SlotProps<NestedItem<T>>; 'item-trailing': SlotProps<NestedItem<T>>; 'item-content': SlotProps<NestedItem<T>>; } & DynamicSlots<MergeTypes<NestedItem<T>>, "label" | "trailing" | "leading" | "content", { index: number; active?: boolean; }>; emit: (evt: "update:modelValue", value: string) => void; }>) => import("vue").VNode & { __ctx?: Awaited<typeof __VLS_setup>; }; export default _default; type __VLS_PrettifyLocal<T> = { [K in keyof T]: T[K]; } & {};