@bitrix24/b24ui-nuxt
Version:
Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE
328 lines (327 loc) • 7.51 kB
TypeScript
import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui';
import type { VariantProps } from 'tailwind-variants';
import type { ButtonProps, IconComponent } from '../types';
import type { EmitsToProps } from '../types/utils';
declare const modal: import("tailwind-variants").TVReturnType<{
overlayBlur: {
auto: {
overlay: string;
};
on: {
overlay: string;
};
off: {
overlay: string;
};
};
transition: {
true: {
overlay: string;
content: string;
};
};
fullscreen: {
true: {
content: string;
};
false: {
content: string;
};
};
scrollbarThin: {
true: {
body: string;
};
};
}, {
overlay: string;
content: string;
header: string;
wrapper: string;
body: string;
footer: string;
title: string;
description: string;
close: string;
}, undefined, {
overlayBlur: {
auto: {
overlay: string;
};
on: {
overlay: string;
};
off: {
overlay: string;
};
};
transition: {
true: {
overlay: string;
content: string;
};
};
fullscreen: {
true: {
content: string;
};
false: {
content: string;
};
};
scrollbarThin: {
true: {
body: string;
};
};
}, {
overlay: string;
content: string;
header: string;
wrapper: string;
body: string;
footer: string;
title: string;
description: string;
close: string;
}, import("tailwind-variants").TVReturnType<{
overlayBlur: {
auto: {
overlay: string;
};
on: {
overlay: string;
};
off: {
overlay: string;
};
};
transition: {
true: {
overlay: string;
content: string;
};
};
fullscreen: {
true: {
content: string;
};
false: {
content: string;
};
};
scrollbarThin: {
true: {
body: string;
};
};
}, {
overlay: string;
content: string;
header: string;
wrapper: string;
body: string;
footer: string;
title: string;
description: string;
close: string;
}, undefined, {
overlayBlur: {
auto: {
overlay: string;
};
on: {
overlay: string;
};
off: {
overlay: string;
};
};
transition: {
true: {
overlay: string;
content: string;
};
};
fullscreen: {
true: {
content: string;
};
false: {
content: string;
};
};
scrollbarThin: {
true: {
body: string;
};
};
}, {
overlay: string;
content: string;
header: string;
wrapper: string;
body: string;
footer: string;
title: string;
description: string;
close: string;
}, import("tailwind-variants").TVReturnType<{
overlayBlur: {
auto: {
overlay: string;
};
on: {
overlay: string;
};
off: {
overlay: string;
};
};
transition: {
true: {
overlay: string;
content: string;
};
};
fullscreen: {
true: {
content: string;
};
false: {
content: string;
};
};
scrollbarThin: {
true: {
body: string;
};
};
}, {
overlay: string;
content: string;
header: string;
wrapper: string;
body: string;
footer: string;
title: string;
description: string;
close: string;
}, undefined, unknown, unknown, undefined>>>;
type ModalVariants = VariantProps<typeof modal>;
export interface ModalProps extends DialogRootProps {
title?: string;
description?: string;
/**
* The content of the modal
*/
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>;
/**
* Render an overlay behind the modal.
* @defaultValue true
*/
overlay?: boolean;
/**
* Render an overlay blur behind the modal.
* `auto` use `motion-safe`.
* @defaultValue 'auto'
*/
overlayBlur?: ModalVariants['overlayBlur'];
/**
* Animate the modal when opening or closing.
* @defaultValue true
*/
transition?: boolean;
/**
* When `true`, the modal will take up the full screen.
* @defaultValue false
*/
fullscreen?: boolean;
/**
* Render the modal in a portal.
* @defaultValue true
*/
portal?: boolean;
/**
* Display a close button to dismiss the modal.
* `{ size: 'xs', color: 'link' }`{lang="ts"}
* @defaultValue true
*/
close?: boolean | Partial<ButtonProps>;
/**
* The icon displayed in the close button.
* @defaultValue icons.close
* @IconComponent
*/
closeIcon?: IconComponent;
/**
* When `false`, the modal will not close when clicking outside or pressing escape.
* @defaultValue false
*/
dismissible?: boolean;
/**
* @defaultValue true
*/
scrollbarThin?: boolean;
class?: any;
b24ui?: Partial<typeof modal.slots>;
}
export interface ModalEmits extends DialogRootEmits {
'after:leave': [];
}
export interface ModalSlots {
default(props: {
open: boolean;
}): any;
content(props?: {}): any;
header(props?: {}): any;
title(props?: {}): any;
description(props?: {}): any;
close(props: {
b24ui: ReturnType<typeof modal>;
}): any;
body(props?: {}): any;
footer(props?: {}): any;
}
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalProps>, {
close: boolean;
portal: boolean;
overlay: boolean;
transition: boolean;
modal: boolean;
dismissible: boolean;
scrollbarThin: boolean;
overlayBlur: string;
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
modal: boolean;
close: boolean | Partial<ButtonProps>;
portal: boolean;
overlay: boolean;
overlayBlur: "off" | "auto" | "on";
transition: boolean;
scrollbarThin: boolean;
dismissible: boolean;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<ModalSlots> & ModalSlots>;
export default _default;
type __VLS_WithDefaults<P, D> = {
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
default: D[K];
}> : P[K];
};
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
type __VLS_TypePropsToOption<T> = {
[K in keyof T]-?: {} extends Pick<T, K> ? {
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
} : {
type: import('vue').PropType<T[K]>;
required: true;
};
};
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};
type __VLS_PrettifyLocal<T> = {
[K in keyof T]: T[K];
} & {};