@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
40 lines (39 loc) • 1.25 kB
TypeScript
import React from 'react';
export interface SelectOption<Value> {
value: Value;
label: React.ReactNode;
disabled?: boolean;
ref: React.RefObject<HTMLElement>;
id?: string;
}
/** Support both upper and lower case, as SFx event data used upper case */
export type EventSeverity = 'Info' | 'Warning' | 'Error' | 'info' | 'warning' | 'error';
export type ActionLink = {
title: string;
onClick: (row: EventItemModel) => void;
};
export type EventItemModel = {
id: string;
icon: React.ReactElement;
title: string;
description: string;
timestamp: string;
severity: EventSeverity;
links?: ReadonlyArray<ActionLink>;
'data-testid'?: string;
[key: string]: any;
};
export type ISelectOption<T = string | number> = Omit<SelectOption<T>, 'ref'> & Partial<Pick<SelectOption<T>, 'ref'>>;
export type EventFilterOption<T = string | number> = {
label: string;
options: ReadonlyArray<ISelectOption<T>>;
multiple?: boolean;
startAdornment?: React.ReactNode;
suffix?: string;
renderValue?: (value: T | T[]) => React.ReactNode;
[key: string]: any;
};
export type EventFilterValue<T = string | number> = Record<string, {
value: T | T[];
[key: string]: any;
} | undefined>;