@elastic/eui
Version:
Elastic UI Component Library
52 lines (45 loc) • 2.21 kB
JavaScript
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/** Allowed flyout render types. */
export var FLYOUT_TYPES = ['push', 'overlay'];
/** Type representing a supported flyout render type. */
/** Allowed flyout attachment sides. */
export var FLYOUT_SIDES = ['left', 'right'];
/** Type representing a supported flyout side. */
/** Allowed named flyout sizes used by the manager. */
export var FLYOUT_SIZES = ['s', 'm', 'l', 'fill'];
/** Type representing a supported named flyout size. */
/** Menu display mode: always render menu when flyoutMenuProps is provided. */
export var MENU_DISPLAY_ALWAYS = 'always';
/** Menu display mode: only render menu when it has content (back button, history, title, or custom actions). */
export var MENU_DISPLAY_AUTO = 'auto';
/** Allowed flyout menu display modes. */
export var FLYOUT_MENU_DISPLAY_MODES = [MENU_DISPLAY_ALWAYS, MENU_DISPLAY_AUTO];
/** Type representing a supported flyout menu display mode. */
/** Allowed padding sizes for flyout content. */
export var FLYOUT_PADDING_SIZES = ['none', 's', 'm', 'l'];
/** Type representing a supported flyout padding size. */
/** Default minimum breakpoint at which push-type flyouts begin to push content. */
export var DEFAULT_PUSH_MIN_BREAKPOINT = 'l';
/** Default flyout type when none is provided. */
export var DEFAULT_TYPE = 'overlay';
/** Default side where flyouts anchor when none is provided. */
export var DEFAULT_SIDE = 'right';
/** Default named flyout size. */
export var DEFAULT_SIZE = 'm';
/** Default padding size inside flyouts. */
export var DEFAULT_PADDING_SIZE = 'l';
/** Default flyout menu display mode. */
export var DEFAULT_MENU_DISPLAY_MODE = MENU_DISPLAY_AUTO;
/**
* Custom type checker for named flyout sizes since the prop
* `size` can also be CSSProperties['width'] (string | number)
*/
export function isEuiFlyoutSizeNamed(value) {
return FLYOUT_SIZES.includes(value);
}