import type { AriaLabelingProps } from '../../../core/types/a11y-props.js'; import type { BehaviorTrackingProps } from '../../../core/types/behavior-tracking-props.js'; import type { DataTestId } from '../../../core/types/data-props.js'; import type { MaskingProps } from '../../../core/types/masking-props.js'; import type { StylingProps } from '../../../core/types/styling-props.js'; import type { WithChildren } from '../../../core/types/with-children.js'; /** * Size of the empty state component. * @public */ export type EmptyStateSize = 'small' | 'default' | 'large' | 'auto'; /** * Props shared by every `size` of the `EmptyState` component. * @public */ export interface EmptyStateBaseProps extends WithChildren, AriaLabelingProps, StylingProps, DataTestId, MaskingProps, BehaviorTrackingProps { /** * Predefined visual, title, and details for a common reason the state is * empty. Slots you pass replace the matching default. */ preset?: EmptyStatePreset; } /** * Props for the `EmptyState` component with `size="auto"`. * @public */ export type EmptyStateAutoSizeProps = { /** * Size of the empty state component. `'auto'` adapts the size to the width * of the parent element. */ size: 'auto'; /** * Largest size that `size="auto"` resolves to. * @defaultValue 'large' */ maxSize?: Exclude; }; /** * Props for the `EmptyState` component with a fixed `size`. * @public */ export type EmptyStateFixedSizeProps = { /** * Size of the empty state component. * @defaultValue 'default' */ size?: Exclude; /** * Only allowed with `size="auto"`. */ maxSize?: never; }; /** * @public */ export type EmptyStateProps = EmptyStateBaseProps & (EmptyStateAutoSizeProps | EmptyStateFixedSizeProps); /** * @public */ export interface EmptyStateVisualPresetProps extends StylingProps, DataTestId { /** * The visual context of the illustration. */ context: 'chart' | 'document' | 'generic' | 'table' | 'query'; /** * A visual cue added to the illustration hinting at the reason the state is empty. */ type: 'something-missing' | 'no-result' | 'something-wrong' | 'create-new' | 'no-permission'; } /** * The reason an empty state with a preset is empty. * @public */ export type EmptyStatePresetReason = 'something-missing' | 'no-result' | 'something-wrong' | 'create-new' | 'no-permission' | 'cancelled'; /** * The reason of a preset with further options. * @public */ export type EmptyStatePresetOptions = { /** * The visual context of the illustration. * @defaultValue 'generic' */ context?: EmptyStateVisualPresetProps['context']; /** * Whether to show the illustration of the preset. * @defaultValue true */ showVisual?: boolean; } & ({ /** * The reason the state is empty. */ reason: Exclude; } | { /** * The user lacks permissions to access the app. */ reason: 'no-permission'; /** * The permissions the user needs to access the app. When set, the * details list them with the user and environment to share with * an admin. Ignored with a custom Details slot. */ missingPermissions?: readonly string[]; /** * Whether the details end with a link to the app in Playground. * Ignored with a custom Details slot. * @defaultValue true */ showPlaygroundLink?: boolean; }); /** * A preset reason, or a preset reason with further options. * @public */ export type EmptyStatePreset = EmptyStatePresetReason | EmptyStatePresetOptions; /** * @internal */ type _AssetTheme = { dark: string; light: string; }; /** * @internal */ type _AssetType = { 'create-new': _AssetTheme; 'no-result': _AssetTheme; 'no-permission': _AssetTheme; 'something-missing': _AssetTheme; 'something-wrong': _AssetTheme; }; /** * @internal */ export type _AssetMap = { chart: _AssetType; document: _AssetType; generic: _AssetType; query: _AssetType; table: _AssetType; }; export {}; //# sourceMappingURL=empty-state-types.d.ts.map