dcl-ui-toolkit
Version:
A collection of UI helpers to make it easier to build a Decentraland scene using the SDK 7.
57 lines (56 loc) • 2.3 kB
TypeScript
import ReactEcs from '@dcl/sdk/react-ecs';
import { Callback } from '@dcl/react-ecs/dist/components/listeners/types';
import { UIObject, UIObjectConfig } from '../../UIObject';
import { PromptCloseIcon } from './components/CloseIcon';
import { PromptText, PromptTextConfig } from './components/Text';
import { PromptIcon, PromptIconConfig } from './components/Icon';
import { PromptButton, PromptButtonConfig } from './components/Button';
import { PromptCheckbox, PromptCheckboxConfig } from './components/Checkbox';
import { PromptSwitch, PromptSwitchConfig } from './components/Switch';
import { PromptInput, PromptInputConfig } from './components/Input';
import { IPrompt } from './IPrompt';
export declare enum PromptStyles {
LIGHT = "light",
DARK = "dark",
LIGHTLARGE = "lightlarge",
DARKLARGE = "darklarge",
LIGHTSLANTED = "lightslanted",
DARKSLANTED = "darkslanted"
}
export type PromptExternalConfig = UIObjectConfig & {
width?: number | 'auto';
height?: number | 'auto';
onClose?: Callback;
};
export type PromptConfig = PromptExternalConfig & {
style?: PromptStyles;
};
export declare class Prompt extends UIObject implements IPrompt {
closeIcon: PromptCloseIcon;
style: PromptStyles;
width: number | 'auto' | undefined;
height: number | 'auto' | undefined;
posWidth: number | undefined;
posHeight: number | undefined;
onClose: Callback;
private _texture;
private _section;
private _components;
private _btn;
private _closeIconBtn;
private readonly _closeIconData;
readonly isDarkTheme: boolean;
constructor({ startHidden, style, width, height, onClose, }: PromptConfig);
addTextBox(config: Omit<PromptInputConfig, 'parent'>): PromptInput;
addSwitch(config: Omit<PromptSwitchConfig, 'parent'>): PromptSwitch;
addCheckbox(config: Omit<PromptCheckboxConfig, 'parent'>): PromptCheckbox;
addButton(config: Omit<PromptButtonConfig, 'parent'>): PromptButton;
addText(config: Omit<PromptTextConfig, 'parent'>): PromptText;
addIcon(config: Omit<PromptIconConfig, 'parent'>): PromptIcon;
render(key?: string): ReactEcs.JSX.Element;
private _getPromptComponentCustomConfig;
realWidth(): number;
realHeight(): number;
private _setStyle;
private _close;
}