freemium-ui
Version:
React Ui Components for Freemium Apps
1,599 lines (1,533 loc) • 67.5 kB
TypeScript
/// <reference types="react" />
import * as react from 'react';
import react__default, { ReactNode, CSSProperties } from 'react';
import { AccordionSingleProps } from '@radix-ui/react-accordion';
import { AxiosRequestConfig } from 'axios';
import * as Popover$1 from '@radix-ui/react-popover';
import { PortalProps, PopperContentProps } from '@radix-ui/react-popover';
import * as Select from '@radix-ui/react-select';
import { SelectProps, SelectContentProps, SelectPortalProps, SelectItemProps } from '@radix-ui/react-select';
export { Item as RadixSelectItem } from '@radix-ui/react-select';
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
import { RadioGroupProps as RadioGroupProps$1, RadioGroupContextValue } from '@radix-ui/react-radio-group';
import { CheckboxProps as CheckboxProps$1 } from '@radix-ui/react-checkbox';
import * as styled_components from 'styled-components';
export { StyleSheetManager } from 'styled-components';
import * as styled_components_dist_types from 'styled-components/dist/types';
import * as _radix_ui_react_label from '@radix-ui/react-label';
import { LabelProps } from '@radix-ui/react-label';
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
import { MenuItemProps as MenuItemProps$1 } from '@radix-ui/react-dropdown-menu';
export { Item as RadixMenuItem } from '@radix-ui/react-dropdown-menu';
import { DateInput3Props, DateRangeInput3Props, TimePrecision } from '@blueprintjs/datetime2';
import { DraggableSyntheticListeners } from '@dnd-kit/core';
import { CoreOptions, ColumnDef, Cell, RowSelectionState } from '@tanstack/react-table';
import * as Tabs$1 from '@radix-ui/react-tabs';
import { TabsProps as TabsProps$1 } from '@radix-ui/react-tabs';
import { TooltipProviderProps, TooltipPortalProps, TooltipProps as TooltipProps$1, TooltipArrowProps } from '@radix-ui/react-tooltip';
interface AccordionItemProps {
id: string;
name: string;
hide?: boolean;
disabled?: boolean;
[key: string]: any;
}
interface AccordionProps<T extends AccordionItemProps = AccordionItemProps> extends Omit<React.HtmlHTMLAttributes<HTMLElement>, 'onChange' | 'dir'> {
/**
* options for Tabs
*/
options?: Array<T>;
/**
* options for Tabs
*/
renderContent?: (accordianOption: T) => React.ReactNode;
/**
* options for Tabs
*/
renderTitle?: (accordianOption: T) => React.ReactNode;
/**
* Id accessor of tabes
*/
idAccessor?: string;
/**
* Id accessor of tabes
*/
hideIcon?: boolean;
/**
* Name accessor of tabes
*/
nameAccessor?: string;
/**
* value for tabs
*/
value?: AccordionSingleProps['value'];
/**
* default value of tabes
*/
defaultValue?: AccordionSingleProps['defaultValue'];
/**
* Function to be called when the selected item changes
*/
onChange?: AccordionSingleProps['onValueChange'];
}
/**
* Accordion component from the design system.
*/
declare const Accordion: <T extends AccordionItemProps>({ idAccessor, nameAccessor, renderContent, hideIcon, renderTitle, options, value, onChange, defaultValue, ...props }: AccordionProps<T>) => react__default.JSX.Element;
type LevelType = 'warning' | 'success' | 'error' | 'info';
type AlertData = {
message: string;
linkText?: string;
href?: string;
};
interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* data to be displayed in the alert
*/
data?: AlertData;
/**
* Level of the alert
*/
level: LevelType;
/**
* Whether the alert can be dismissed
*/
canDismiss?: boolean;
/**
* Timeout for the alert to disappear
*/
timeout?: number;
/**
* @deprecated
* Class name to be overriden
*/
overideClassName?: string;
/**
* Children to be displayed in the alert
*/
children?: React.ReactNode | string;
/**
* Function to be called when the alert is closed
*/
onClose?: () => any;
/**
* Function to be called when the alert is dismissed
*
*/
onDisappear?: () => any;
/**
* Icon to be displayed in the alert
* @default getAlertIcon(level)
**/
icon?: React.ReactNode;
/**
* Alignment of the content in the alert
*/
alignContent?: 'flex-start' | 'center' | 'flex-end';
/**
* Icon alignment in the alert
* @default 'center'
* */
iconAlignment?: 'flex-start' | 'center' | 'flex-end';
}
/**
* Alert displays an alert on the user interface and enables displaying additional information to the context of the page.
*/
declare const Alert: ({ onClose, children, level, onDisappear, data, icon, overideClassName, timeout, canDismiss, alignContent, iconAlignment, ...props }: AlertProps) => react__default.JSX.Element | null;
type DropdownTypes = 'button' | 'input';
type DefaultDropdownItem = {
[key: string]: any;
group?: string;
};
type StyledListItemType = {
readOnly?: boolean;
$isSelected?: boolean;
$isHilighted?: boolean;
};
type DropdownInputItemProps = React.LiHTMLAttributes<HTMLLIElement> & StyledListItemType & {
key: string;
};
type PickedSelectProps = Pick<SelectProps, 'name' | 'disabled' | 'value'>;
interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> extends PickedSelectProps {
/**
* The items to be displayed in the dropdown
*/
items?: Array<T>;
/**
* The identifier for the items
*/
itemIdentifier?: string;
isOpen?: SelectProps['open'];
defaultIsOpen?: SelectProps['defaultOpen'];
/**
* The selected item
*/
defaultSelectedItem?: T | null;
/**
* Function to be called when the selected item changes
*/
onChange?: (item: T | null) => void;
/**
* Fuction to give the string representation of the item
*/
itemToString: (item: T, type?: 'list-item' | 'display' | 'downshift') => string;
/**
* The type of the dropdown
*/
type?: DropdownTypes;
/**
* Is the dropdown read only
*/
readOnly?: boolean;
/**
* Is the dropdown read only
*/
showTick?: boolean;
/**
* The width of the dropdown
*/
width?: string;
/**
* The key to be used for filtering
*/
filterKey?: string;
/**
*
*/
getCustomMessage?: (inoutValue: string) => string;
/**
*
*/
emptyItemsText?: string;
/**
*
*/
hideClear?: boolean;
/**
*
*/
errorText?: string;
/**
*
*/
className?: string;
/**
*
*/
style?: React.CSSProperties;
/**
*
*/
isErrored?: boolean;
/**
*
*/
isRequired?: boolean;
/**
*
*/
isMenuLoading?: boolean;
/**
*
*/
matchButtonWidth?: boolean;
/**
*
*/
onCustomValueAdd?: (item: {
inputValue: string;
customValues: boolean;
}) => void;
/**
*
*/
customValues?: boolean;
/**
*
*/
id?: string;
/**
*
*/
label?: string | React.ReactNode;
/**
*
*/
placeholder?: string;
/**
*
*/
useComboboxProps?: UseComboboxProps<T>;
itemComponent?: (item: T, props?: DropdownItemProps | DropdownInputItemProps) => React.ReactNode | string;
selectedItemComponent?: (item: T) => React.ReactNode | string;
clearInputOnselect?: boolean;
buttonContentProps?: SelectContentProps;
portalContainer?: PortalProps['container'];
selectRootProps?: SelectProps;
selectPortalProps?: SelectPortalProps;
}
type DropdownButtonProps<T extends DefaultDropdownItem = DefaultDropdownItem> = DropdownProps<T>;
type DropdownInputProps<T extends DefaultDropdownItem = DefaultDropdownItem> = DropdownProps<T>;
type DropdownItemProps = SelectItemProps & {
showTick: boolean;
};
declare const ListItem: styled_components.IStyledComponent<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, StyledListItemType>>;
/**
* Dropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
*/
declare const Dropdown: <T extends DefaultDropdownItem>({ type, ...props }: DropdownProps<T>) => react__default.JSX.Element;
declare const Item: react__default.ForwardRefExoticComponent<Select.SelectItemProps & {
showTick: boolean;
} & react__default.RefAttributes<HTMLDivElement>>;
type DefaultAutoCompleteItem = DefaultDropdownItem;
type AutoCompleteInputItemProps = DropdownInputItemProps;
interface AutoCompleteProps<T extends DefaultAutoCompleteItem = DefaultAutoCompleteItem> {
/**
*
*/
id?: string;
/**
*
*/
url?: string;
/**
*
*/
label?: string;
/**
*
*/
disabled?: boolean;
/**
* Is the AutoComplete read only
*/
readOnly?: boolean;
/**
* The width of the AutoComplete
*/
width?: string;
/**
*
*/
placeholder?: string;
/**
*
*/
name?: string;
/**
* The items to be displayed in the AutoComplete
*/
items?: Array<T>;
/**
* The identifier for the items
*/
itemIdentifier?: string;
/**
* The selected item
*/
/**
* Function to be called when the selected item changes
*/
onChange?: (item: T | null) => void;
defaultSelectedItem?: T | null;
/**
* Fuction to give the string representation of the item
*/
itemToString: (item: T, type?: 'list-item' | 'display' | 'downshift') => string;
/**
*
*/
errorText?: string;
/**
*
*/
searchKey?: string;
/**
*
*/
style?: React.CSSProperties;
/**
*
*/
isErrored?: boolean;
/**
*
*/
isRequired?: boolean;
/**
*
*/
emptyItemsText?: string;
processFetchData?: (data: any[]) => T[];
processDisplayData?: (props: {
searchParam: string;
defaultSelectedItem?: T | null;
cacheItems?: T[];
data?: T[];
itemIdentifier?: string;
}) => T[];
itemComponent?: (item: T, props?: AutoCompleteInputItemProps) => React.ReactNode | string;
headers?: AxiosRequestConfig['headers'];
}
declare const AutoComplete: <T extends DefaultDropdownItem>(props: AutoCompleteProps<T>) => react__default.JSX.Element;
type ButtonSizeKey = 'mini' | 'normal' | 'large';
type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link';
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
/**
* The size of the button
*/
size?: ButtonSizeKey;
/**
* The variant of the button
*/
variant?: 'primary' | 'secondary' | 'danger' | 'link';
/**
* The children to be displayed in the button
*/
children?: React.ReactNode | string;
/**
* Whether the button is loading
*/
loading?: boolean;
/**
* Whether the button is inline
*/
inline?: boolean;
}
/**
* Button displays a button on the user interface and enables performing specific actions based on the button type. The button’s label can be a text, icon, or both.
*/
declare const Button: react__default.ForwardRefExoticComponent<ButtonProps & react__default.RefAttributes<HTMLButtonElement>>;
interface ButtonDropdownItemProps {
id: string;
name: string;
disabled?: boolean;
[key: string]: any;
}
interface ButtonDropdownProps<T extends ButtonDropdownItemProps = ButtonDropdownItemProps> {
side?: PopperContentProps['side'];
sideOffset?: PopperContentProps['sideOffset'];
align?: PopperContentProps['align'];
alignOffset?: PopperContentProps['alignOffset'];
arrowPadding?: PopperContentProps['arrowPadding'];
avoidCollisions?: PopperContentProps['avoidCollisions'];
/**
* value of menu
*/
defaultSelectedItem?: T;
/**
* options for menu button
*/
options?: Array<T>;
/**
* Called when a menu item is selected
*/
onClick?: (option?: T, event?: React.MouseEvent<HTMLButtonElement>) => void;
/**
* id Accessor of menu
*/
idAccessor?: string;
/**
* name Accessor of menu
*/
nameAccessor?: string;
/**
* name Accessor of menu
*/
id?: string;
/**
* name Accessor of menu
*/
name?: string;
disabled?: React.ButtonHTMLAttributes<HTMLButtonElement>['disabled'];
size?: ButtonProps['size'];
variant?: ButtonProps['variant'];
loading?: ButtonProps['loading'];
inline?: ButtonProps['inline'];
}
/**
* ButtonDropdown is a button with a dropdown menu. It is used to select an item from a list of items.
*/
declare const ButtonDropdown: ({ size, variant, loading, inline, defaultSelectedItem, idAccessor, nameAccessor, onClick, options, side, sideOffset, align, alignOffset, arrowPadding, avoidCollisions, disabled, id, name, }: ButtonDropdownProps) => react__default.JSX.Element;
interface BoxedRadioItemProps {
disabled?: boolean;
[key: string]: any;
}
type BoxedRadioProps<T extends BoxedRadioItemProps = BoxedRadioItemProps> = Omit<react__default.HtmlHTMLAttributes<HTMLDivElement>, 'onChange' | 'value' | 'defaultValue'> & {
dir?: RadioGroupProps$1['dir'];
/**
* Select options
*/
options?: Array<T>;
/**
* Select options
*/
disabled?: boolean;
/**
* Select options
*/
readOnly?: boolean;
/**
* Id accessor of radio button
*/
idAccessor?: string;
/**
* The default value
*/
defaultValue?: string;
/**
* Value of radio button
*/
value?: RadioGroupContextValue['value'];
/**
* Function to be called when the selected item changes
*/
onChange?: RadioGroupContextValue['onValueChange'];
/**
* The description of the content
*/
label?: string;
errorText?: string;
isRequired?: boolean;
isErrored?: boolean;
customIndicator?: ReactNode;
/**
* The description of the content
*/
getTextContent: (item: T, type: 'name' | 'description') => string;
/**
* The description of the content
*/
itemComponent?: (item: T) => react__default.ReactNode | string;
};
/**
* BoxedRadio displays a group of options with radio buttons and enables selection of one option from the list.
*/
declare const BoxedRadio: <T extends BoxedRadioItemProps>({ options, defaultValue, idAccessor, onChange, isErrored, errorText, disabled, getTextContent, className, id, isRequired, readOnly, itemComponent, label, value, customIndicator, ...props }: BoxedRadioProps<T>) => react__default.JSX.Element;
interface CheckboxProps extends CheckboxProps$1 {
/**
* Whether the checkbox is required
*/
isRequired?: boolean;
/**
* Whether the checkbox is errored
*/
isErrored?: boolean;
/**
* Whether the checkbox is readOnly
*/
readOnly?: boolean;
/**
* Label for the checkbox
*/
label?: string;
}
/**
* Checkbox displays a check box on the user interface and enables assigning a state (selected or deselected) to it. In the selected state, the check box displayed on the UI is highlighted and contains a check mark.
*/
declare const Checkbox: ({ isRequired, isErrored, className, readOnly, label, ...rest }: CheckboxProps) => react__default.JSX.Element;
interface ConfirmationProps {
/**
* Is the confirmation open
*/
isOpen?: boolean;
/**
* The children or label
*/
children?: React.ReactNode | string;
/**
* Is the confirm button disabled
*/
confirmButtonDisabled?: boolean;
/**
* Is the cancel button disabled
*/
cancelButtonDisabled?: boolean;
/**
* Should the confirmation close when clicking outside
*/
clickOutToClose?: boolean;
/**
* Title of the confirmation
*/
title?: string;
/**
* Description of the confirmation
*/
description?: React.ReactNode | string;
/**
* Width of the confirmation
*/
width?: string;
/**
* Function to be called when the confirmation is dismissed
*/
onDismiss?: (type: 'overlay' | 'button' | 'root', event?: React.MouseEvent<HTMLElement, MouseEvent>) => void;
/**
* Function to be called when the confirmation is confirmed
*/
onConfirm?: React.DOMAttributes<HTMLButtonElement>['onClick'];
/**
* Confirm button text
*/
confirmButtonText?: string;
/**
* Cancel button text
*/
cancelButtonText?: string;
/**
* Styles for the overlay
*/
bodyStyles?: React.CSSProperties;
/**
* Styles for the content
*/
contentStyles?: React.CSSProperties;
/**
* Styles for the footer
*/
footerStyles?: React.CSSProperties;
customFooter?: React.ReactElement | null;
}
/**
* Confirmation component is used to show a confirmation dialog to the user. It is used to confirm an action before it is executed.
*/
declare const Confirmation: ({ isOpen, title, description, onConfirm, onDismiss, cancelButtonText, children, cancelButtonDisabled, confirmButtonDisabled, confirmButtonText, clickOutToClose, bodyStyles, contentStyles, footerStyles, customFooter, width, }: ConfirmationProps) => react__default.JSX.Element;
type DrawerSizeType = 'default' | 'medium' | 'small' | 'large' | 'x-large';
type DrawerPlacement = 'left' | 'right';
interface DrawerProps {
/**
* The children to be displayed in the drawer
*/
children?: React.ReactNode | string;
/**
* Whether the drawer is open
*/
isOpen?: boolean;
/**
* The placement of the drawer
*/
placement?: DrawerPlacement;
/**
* The size of the drawer
*/
size?: DrawerSizeType;
/**
* Whether the drawer is full height
*/
isFullHeight?: boolean;
/**
* Should the drawer close when clicking outside
*/
clickOutToClose?: boolean;
/**
* Should we hide the dismiss icon
*/
hideDismissIcon?: boolean;
/**
* Custom class to be added to the drawer
*/
customClass?: string;
/**
* Function to be called when the drawer is dismissed
*/
onDismiss?: () => void;
}
/**
* Drawer component is used to show a drawer to the user. It is used to show additional information or actions. It can be used to show a menu, a form, or any other content.
*/
declare const Drawer: ({ isOpen, children, hideDismissIcon, customClass, size, isFullHeight, placement, clickOutToClose, onDismiss, }: DrawerProps) => react__default.JSX.Element;
declare const Checkmark: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const ChevronUp: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const Cross: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const ErrorIcon: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const Freddy: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const InfoIcon: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const Minus: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const MoreVertical: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const TickIcon: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
declare const Warning: react__default.ForwardRefExoticComponent<Omit<react__default.SVGProps<SVGSVGElement>, "ref"> & react__default.RefAttributes<SVGSVGElement>>;
interface CommonProps {
/**
* Is this a required field?
*/
isRequired?: boolean;
/**
* Is this a error field?
*/
isErrored?: boolean;
/**
* Error text to be shown
*/
errorText?: string;
/**
* Id of the button
*/
id?: string;
/**
* Id of the button
*/
label?: string | react__default.ReactNode;
/**
* Label of the button
*/
inline?: boolean;
/**
* The max length of the input
*/
maxLength?: number;
/**
* Whether to show character count
*/
showCount?: boolean;
inputStyle?: react__default.CSSProperties;
startLabel?: react__default.ReactNode | any;
startAdornment?: react__default.ReactNode | any;
endLabel?: react__default.ReactNode | any;
endAdornment?: react__default.ReactNode | any;
labelProps?: LabelProps;
containerProps?: react__default.HTMLAttributes<HTMLDivElement>;
forceInputDir?: 'ltr' | 'rtl';
}
interface InputProps extends CommonProps, react__default.InputHTMLAttributes<HTMLInputElement> {
ref?: react__default.Ref<HTMLInputElement>;
}
interface TextAreaProps extends CommonProps, react__default.TextareaHTMLAttributes<HTMLTextAreaElement> {
ref?: react__default.Ref<HTMLTextAreaElement>;
showLineNumbers?: boolean;
}
/**
* Input displays a single-line input box on the user interface and enables assigning a value to it. It is used to take user input for small text data.
*/
declare const Input: react__default.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react__default.RefAttributes<HTMLInputElement>>;
/**
* TextArea displays a multi-line input box on the user interface and enables assigning a value to it. It is used to take user input for large text data.
*/
declare const TextArea: react__default.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & react__default.RefAttributes<HTMLTextAreaElement>>;
type LoaderSizes = 'mini' | 'small' | 'medium' | 'big';
type LoaderSpeeds = 'slow' | 'medium' | 'fast';
type LoaderPropTypes = {
/**
* Size of Select input
*/
size?: LoaderSizes;
/**
* Speed of Select input
*/
speed?: LoaderSpeeds;
};
/**
* Loader Component can be used to indicate loading of a Page / Section of a page.
*/
declare const Loader: (props: LoaderPropTypes) => react__default.JSX.Element;
interface DefaultMenuItemProps {
disabled?: boolean;
[key: string]: any;
}
type MenuProps<T extends DefaultMenuItemProps = DefaultMenuItemProps> = {
side?: PopperContentProps['side'];
sideOffset?: PopperContentProps['sideOffset'];
align?: PopperContentProps['align'];
alignOffset?: PopperContentProps['alignOffset'];
arrowPadding?: PopperContentProps['arrowPadding'];
avoidCollisions?: PopperContentProps['avoidCollisions'];
/**
* value of menu
*/
value?: T;
/**
* Called when a menu item is selected
*/
onSelect?: (option: T) => void;
closeMenuCallback?: () => void;
itemComponent?: (item: T, props?: MenuItemProps) => React.ReactNode | string;
/**
* options for menu button
*/
options?: Array<T>;
/**
* The children or label
*/
trigger: React.ReactNode | string;
/**
* Is the button inline
* @deprecated
*/
highlightedIndex?: number | null;
/**
* id Accessor of menu
*/
idAccessor?: string;
/**
* name Accessor of menu
*/
nameAccessor?: string;
/**
* Is the button inline
*/
isOpen?: boolean;
/**
* should show the Arrow?
*/
showArrow?: boolean;
disableMenu?: boolean;
};
type MenuItemProps = MenuItemProps$1 & {
isSelected?: boolean;
};
/**
* Menu is a container for Menu Item components.
* Menu item is a component to define each row of a menu components. It takes in prefix, suffix and default slot to place content either at beginning or end or middle of the row respectively.
*/
declare const Menu: <T extends DefaultMenuItemProps>(props: MenuProps<T>) => react__default.JSX.Element;
declare const DropdownMenuItem: styled_components.IStyledComponent<"web", styled_components_dist_types.Substitute<Omit<DropdownMenu.DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
}, {
$isSelected?: boolean | undefined;
disabled?: boolean | undefined;
}>> & Omit<react.ForwardRefExoticComponent<DropdownMenu.DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
type ModalAlignType = 'top' | 'center' | 'bottom';
type ModalPositionType = 'left' | 'center' | 'right';
type ModalSizeType = 'default' | 'medium' | 'small' | 'large' | 'x-large';
interface ModalProps {
/**
* The children or label
*/
children?: React.ReactNode | string;
/**
* Is the button inline
*/
isOpen?: boolean;
/**
* Is the button inline
*/
fullWidth?: boolean;
/**
* Is the button inline
*/
align?: ModalAlignType;
/**
* Is the button inline
*/
position?: ModalPositionType;
/**
* Is the button inline
*/
size?: ModalSizeType;
/**
* How large should the button be?
*/
onDismiss?: () => void;
/**
* The children or label
*/
customClass?: string;
/**
* The children or label
*/
customModalContentStyles?: React.CSSProperties;
}
/**
* Modals are used as an overlay to display information. It can also be used as confirm boxes to take user inputs.
*/
declare const Modal: ({ isOpen, children, align, customClass, fullWidth, customModalContentStyles, onDismiss, position, size, }: ModalProps) => react__default.JSX.Element;
type DefaultMultiSelectDropdownItem = {
[key: string]: any;
};
interface MultiSelectDropdownProps<T extends DefaultMultiSelectDropdownItem = DefaultMultiSelectDropdownItem> {
/**
* dropdown item content
*/
items?: Array<T>;
/**
* Id of the item
*/
itemIdentifier?: string;
/**
* selected item of dropdown
*/
defaultSelectedItems?: T[];
/**
* Called when select an option or input value change
*/
onChange?: (item: T[]) => void;
itemToString?: (item: T, type?: 'list-item' | 'display' | 'downshift') => string;
/**
* Fuction to give the string representation of the item
*/
itemComponent?: (item: T) => React.ReactNode | string;
/**
* Is the dropdown readonly
*/
readOnly?: boolean;
/**
* Whether disabled select
*/
disabled?: boolean;
/**
* name of the drowpdown
*/
name?: string;
/**
* width of the multi select drowpdown
*/
width?: string;
filterKey?: string;
getCustomMessage?: (inoutValue: string) => string;
/**
* Empty items text box
*/
emptyItemsText?: string;
/**
* Whether to allow hide or clear when click
*/
hideClear?: boolean;
/**
* Whether to hide or show arrow
*/
hideArrow?: boolean;
/**
* Error text to be shown
*/
errorText?: string;
/**
* Is this a error field?
*/
isErrored?: boolean;
/**
* Is this a required field?
*/
isRequired?: boolean;
/**
* Is menu loading?
*/
isMenuLoading?: boolean;
inputValue?: string | null;
handleInputChange?: (inputValue: string) => void;
onCustomValueAdd?: (item: {
inputValue: string;
customValues: boolean;
}) => T;
removeSelectedItem?: (item: T, index: number) => void;
/**
* Is this custom value
*/
customValues?: boolean;
/**
* id of the drowpdown
*/
id?: string;
/**
* label for the drowpdown
*/
label?: string;
placeholder?: string;
useMultipleSelectionProps?: UseMultipleSelectionProps<T>;
useComboboxProps?: UseComboboxProps<T>;
InputProps?: React.InputHTMLAttributes<HTMLInputElement>;
onBackSpace?: () => void;
maxAllowedLength?: number;
isDynamicMenu?: boolean;
minAllowedLength?: number;
locale?: {
createText: string;
deleteText: string;
};
hideChips?: boolean;
hideSelectedItem?: boolean;
}
/**
* MultiSelectDropdown displays a list or drop-down box that enables selection of an option or multiple options from an available list of values.
*/
declare const MultiSelectDropdown: <T extends DefaultMultiSelectDropdownItem>({ itemIdentifier, label, id, items, onChange, placeholder, readOnly, disabled, isRequired, itemToString, name, filterKey, width, useComboboxProps, useMultipleSelectionProps, emptyItemsText, getCustomMessage, onCustomValueAdd, customValues, inputValue: iV, hideClear, hideArrow, removeSelectedItem: rSelectedItem, defaultSelectedItems, handleInputChange, isErrored, isMenuLoading, errorText, InputProps, itemComponent, isDynamicMenu, locale, maxAllowedLength, minAllowedLength, hideChips, hideSelectedItem, onBackSpace, }: MultiSelectDropdownProps<T>) => react__default.JSX.Element;
type DefaultProps = {
/**
* Is this a required field?
*/
isRequired?: boolean;
/**
* Is this a error field?
*/
isErrored?: boolean;
/**
* Error text to be shown
*/
errorText?: string;
/**
* Id of the date picker
*/
id?: string;
/**
* name of the date picker
*/
name?: string;
/**
* label for the picker
*/
label?: string;
language?: string;
placeholder?: string;
/**
* Today's date according to the user's timezone in the YYYY-MM-DD format
*/
dateToHilight?: string;
/**
* Whether disabled select
*/
disabled?: boolean;
portalContainer?: HTMLElement;
cancelButtonText?: string;
updateButtonText?: string;
};
type DatePickerProps = DefaultProps & Partial<DateInput3Props> & {
displayFormat?: string;
useTime?: boolean;
};
type DateRangePickerProps = DefaultProps & Partial<DateRangeInput3Props> & {
displayFormat?: string;
useTime?: boolean;
};
type DateTimePickerProps = DefaultProps & Partial<DateInput3Props> & {
displayFormat?: string;
};
type DateTimeRangePickerProps = DefaultProps & Partial<DateRangeInput3Props> & {
displayFormat?: string;
};
type TimePickerProps = DefaultProps & {
displayFormat?: string;
value?: string;
onChange?: (dateString: string | null) => void;
useAmPm?: boolean;
precision?: TimePrecision;
};
/**
* Datepicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
* All the date formats passed as attribute's values must be valid ISO Date format (opens new window).
*/
declare const DatePicker: (props: DatePickerProps) => react__default.JSX.Element;
/**
* DateTimePicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
* All the date formats passed as attribute's values must be valid ISO Date format (opens new window).
*/
declare const DateTimePicker: (props: DateTimePickerProps) => react__default.JSX.Element;
/**
* DateRangePicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
* All the date formats passed as attribute's values must be valid ISO Date format (opens new window).
*/
declare const DateRangePicker: (props: DateRangePickerProps) => react__default.JSX.Element;
/**
* DateTimeRangePicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
* All the date formats passed as attribute's values must be valid ISO Date format (opens new window).
*/
declare const DateTimeRangePicker: (props: DateTimeRangePickerProps) => react__default.JSX.Element;
/**
* TimePicker displays an input box with a calendar that enables selecting a date or date range. The values preselected in the input box and calendar are based on the fw-datepicker attribute values.
*/
declare const TimePicker: (props: TimePickerProps) => react__default.JSX.Element;
type Origin = {
vertical?: 'top' | 'center' | 'bottom';
horizontal?: 'left' | 'center' | 'right';
};
interface PopoverProps {
/**
* How large should the button be?
*/
onClose?: (event?: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
/**
* Which variant the button should be
*/
id?: string;
/**
* Which variant the button should be
*/
disabled?: boolean;
replaceTrigger?: boolean;
popoverContentProps?: Popover$1.PopoverContentProps;
popoverRootProps?: Popover$1.PopoverProps;
popoverPortalProps?: Popover$1.PopoverPortalProps;
/**
* The children or label
*/
trigger: React.ReactNode | string;
/**
* The children or label
*/
children?: React.ReactNode | string;
/**
* Is the button inline
*/
hoverOutToClose?: boolean;
/**
* Is the button inline
*/
hoverToOpen?: boolean;
/**
* Is the button inline
*/
arrow?: boolean;
/**
* Is the button inline
*/
avoidCollisions?: boolean;
/**
* Is the button inline
*/
side?: Popover$1.PopperContentProps['side'];
/**
* Is the button inline
*/
align?: Popover$1.PopperContentProps['align'];
/**
* Is the button inline
* @deprecated
*/
anchorOrigin?: Origin;
/**
* Is the button inline
* * @deprecated
*/
transformOrigin?: Origin;
/**
* Is the button inline
* * @deprecated
*/
clickOutToClose?: boolean;
/**
* Is the button inline
* * @deprecated
*/
autoCloseDuration?: number;
}
/**
* Popover need two slots popover-trigger and popover-content. By default on clicking the trigger the content will be displayed. The props can be used to change the position of the content, width of the component and the distance between the trigger and the content.
*/
declare const Popover: ({ children, trigger, arrow, hoverOutToClose, align, hoverToOpen, avoidCollisions, replaceTrigger, side: s, disabled, onClose, popoverContentProps, popoverRootProps, popoverPortalProps, anchorOrigin, }: PopoverProps) => react__default.JSX.Element;
declare const PopoverTrigger: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Popover$1.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Popover$1.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>, keyof react.Component<any, {}, any>>;
declare const PopoverClose: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Popover$1.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Popover$1.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>, keyof react.Component<any, {}, any>>;
type RadioProps = Pick<RadioGroupProps$1, 'name' | 'disabled' | 'dir'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue'> & {
/**
* Is the Radio button selected
*/
checked?: boolean;
/**
* Whether disabled select
*/
readOnly?: boolean;
/**
* Whether disabled select
*/
isRequired?: boolean;
/**
* label for the radio button
*/
label?: string;
};
interface RadioItemProps {
[key: string]: any;
}
type RadioGroupProps<T extends RadioItemProps = RadioItemProps> = Pick<RadioGroupProps$1, 'name' | 'disabled' | 'dir' | 'value' | 'defaultValue'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue'> & {
/**
* Select options
*/
options?: Array<T>;
/**
* Id accessor of radio button
*/
idAccessor?: string;
/**
* Name accesssor of radio button
*/
nameAccessor?: string;
/**
* Function to be called when the selected item changes
*/
onChange?: RadioGroupContextValue['onValueChange'];
/**
* Whether disabled select
*/
isRequired?: boolean;
/**
* Whether disabled select
*/
readOnly?: boolean;
/**
* The description of the content
*/
label?: string;
errorText?: string;
isErrored?: boolean;
};
/**
* Radio displays a radio button on the user interface and enables assigning a state (selected or deselected) to it. In the selected state, the button displayed is highlighted. fw-radio provides child elements for fw-radio-group, to populate the Radio Group component’s list.
*/
declare const Radio: ({ checked, className, disabled, id, isRequired, label, name, readOnly, ...htmlAttributes }: RadioProps) => react__default.JSX.Element;
/**
* RadioGroup displays a group of options with radio buttons and enables selection of one option from the list.
*/
declare const RadioGroup: ({ options, defaultValue, idAccessor, nameAccessor, onChange, className, id, isErrored, errorText, disabled, isRequired, label, readOnly, value, ...props }: RadioGroupProps) => react__default.JSX.Element;
type ReorderItemType = {
id: string | number;
[key: string]: any;
};
type ReorderProps<T extends ReorderItemType = ReorderItemType> = {
/**
* Items of reorder
*/
items: T[];
/**
* Class name of reorder
*/
className?: string;
/**
* Whether disabled select
*/
disabled?: boolean;
/**
* should show the Dragger?
*/
showDragger?: boolean;
customFilter?: (item: T) => boolean;
onReorder?: (items: T[]) => void;
customRender: (item: T, index: number, listeners?: DraggableSyntheticListeners) => React.ReactNode;
};
/**
* Reorder is a component that enables reordering of items in a list. It provides a drag handle to reorder the items.
*/
declare const Reorder: <T extends ReorderItemType = ReorderItemType>(props: ReorderProps<T>) => react__default.JSX.Element;
type RowDataType = {
[key in string]: any;
};
type SortingOptionsType = {
id: string;
name: string;
};
interface FuiTableColumnType$1<T extends RowDataType> {
id: string;
Header: string;
accessorFn: (row: T) => React.ReactNode | string | null;
disableSortBy?: boolean;
}
interface TableProps<T extends RowDataType> {
/**
* How large should the button be?
*/
data: CoreOptions<T>['data'];
columns: FuiTableColumnType$1<T>[];
count?: number;
pageSize?: number;
pageIndex?: number;
sortingHeading?: string;
enableSorting?: boolean;
sortingOptions?: SortingOptionsType[][];
sortingValues?: string[];
onSortingOptionSelect?: (option: string[]) => void;
enablePreviousPage?: boolean;
enableNextPage?: boolean;
isLoading?: boolean;
isFetching?: boolean;
showFooter?: boolean;
hideColumnSettings?: boolean;
hideTableOnEmpty?: boolean;
hideTopPagination?: boolean;
hideFilters?: boolean;
showTableOnLoading?: boolean;
isDisableActionMenu?: boolean;
hideLoaderOnTopPagination?: boolean;
hideActions?: boolean;
hidePageNavigation?: boolean;
showWorkspaceActions?: boolean;
hideSelectAllInTable?: boolean;
hideBottomPagination?: boolean;
disableRowSelect?: boolean;
infoComponent?: React.ReactElement;
filterComponent?: React.ReactElement;
isDisableSortDropdown?: boolean | null;
isFilterOpenByDefault?: boolean | null;
emptyComponent?: React.ReactElement;
actionComponent?: React.ReactElement;
loadingComponent?: React.ReactElement;
headerComponent?: React.ReactElement;
editColumnComponent?: React.ReactElement;
translationTexts?: Record<string, any> | null;
onNextPageClick?: () => void;
onPreviousPageClick?: () => void;
onSelectAllRows?: (checked: boolean) => void;
onRowSelect?: (row: T, checked: boolean) => void;
rowMenuOptions?: (RowDataType: T) => MenuItemProps[];
onMenuOptionSelect?: (optionId: string, row: T) => void;
onRowClick?: (row: T, column: ColumnDef<T, unknown>) => void;
dataKey?: string;
rowPropGetter?: (row: T) => React.HTMLAttributes<HTMLTableRowElement>;
cellPropGetter?: (cell: Cell<T, unknown>) => React.HTMLAttributes<HTMLTableCellElement>;
/**
* @deprecated
*/
tableOptions?: any;
/**
* @deprecated
*/
loaderStyles?: React.CSSProperties;
setPageIndex?: (pageIndex: number) => void | React.Dispatch<React.SetStateAction<number>>;
hiddenColumns?: string[];
setHiddenColumns?: (hiddenColumns: string[]) => void | React.Dispatch<React.SetStateAction<string[]>>;
columnOrder?: string[];
setColumnOrder?: (columnOrder: string[]) => void | React.Dispatch<React.SetStateAction<string[]>>;
selectedRowIds?: RowSelectionState;
setSelectedRowIds?: (selectedRowIds: RowSelectionState) => void | React.Dispatch<React.SetStateAction<RowSelectionState>>;
}
type TableSortingMenuProps<T extends DefaultMenuItemProps = DefaultMenuItemProps> = {
/**
* value of menu
*/
value?: string[];
/**
* Called when a menu item is selected
*/
onSelect?: (value?: string[]) => void;
/**
* options for menu button
*/
options?: T[][];
/**
* The children or label
*/
trigger: React.ReactNode | string;
/**
* Is the button inline
* @deprecated
*/
highlightedIndex?: number | null;
/**
* id Accessor of menu
*/
idAccessor?: string;
/**
* name Accessor of menu
*/
nameAccessor?: string;
isDisableSortDropdown?: boolean;
};
/**
* Table component is used to display data in a tabular format. It is used to show data in a structured manner. It can be used to show data in a grid format.
*/
declare const Table: <T extends RowDataType = RowDataType>(props: TableProps<T>) => react__default.JSX.Element;
declare const TabsRoot: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
declare const TabsContent: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsContentProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
declare const TabsList: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsListProps & react.RefAttributes<HTMLDivElement>>, keyof react.Component<any, {}, any>>;
declare const TabsTrigger: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<Omit<Tabs$1.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & {
ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
}, never>> & Omit<react.ForwardRefExoticComponent<Tabs$1.TabsTriggerProps & react.RefAttributes<HTMLButtonElement>>, keyof react.Component<any, {}, any>>;
interface TabsItemProps {
id: string;
name: string;
hide?: boolean;
disabled?: boolean;
[key: string]: any;
}
type TabsProps<T extends TabsItemProps = TabsItemProps> = {
/**
* options for Tabs
*/
options?: Array<T>;
renderTabsContent?: (tabOption: T) => React.ReactNode;
/**
* Id accessor of tabes
*/
idAccessor?: string;
label?: string;
/**
* Name accessor of tabs
*/
nameAccessor?: string;
/**
* Disabled accessor of tabs
*/
disabledAccessor?: string;
ref?: React.RefObject<HTMLDivElement>;
/**
* value for tabs
*/
value?: TabsProps$1['value'];
/**
* default value of tabes
*/
defaultValue?: TabsProps$1['defaultValue'];
/**
* Function to be called when the selected item changes
*/
onChange?: TabsProps$1['onValueChange'];
};
/**
* Tabs component is used to show a set of tabs to the user. It is used to show different sections of content in a single view. It can be used to show different categories of content.
*/
declare const Tabs: <T extends TabsItemProps>({ options, idAccessor, nameAccessor, disabledAccessor, onChange, defaultValue, label, renderTabsContent, value, }: TabsProps<T>) => react__default.JSX.Element;
interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
/**
* State of the tag
*/
state?: 'error' | 'default' | 'transparent';
/**
* Show border around the tag
*/
showBorder?: boolean;
/**
* Show border around the tag
*/
hideClose?: boolean;
/**
* Image source for the avatar
*/
avatarImgSrc?: string;
/**
* Image alt for the avatar
*/
avatarImgAlt?: string;
/**
* Text for the avatar
*/
avatarText?: string;
/**
* Function to be called when the tag is closed
*/
onClose?: React.MouseEventHandler<HTMLButtonElement>;
/**
* Children of the tag
*/
children?: React.ReactNode;
/**
* Props for the icon
*/
iconProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
iconSVGProps?: React.SVGProps<SVGSVGElement>;
style?: React.CSSProperties;
}
/**
* Tag component is used to show a tag to the user. It is used to show a label or a category
*/
declare const Tag: react__default.ForwardRefExoticComponent<TagProps & react__default.RefAttributes<HTMLSpanElement>>;
type TypographyWeightType = 'regular' | 'bold' | 'semi-bold';
type TypographyVariantType = 'primary' | 'secondary' | 'heading' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'caption';
interface TypographyProps extends React.HtmlHTMLAttributes<HTMLSpanElement> {
/**
* The children or label
*/
children?: React.ReactNode | string;
variant?: TypographyVariantType;
weight?: TypographyWeightType;
}
type BreakpointKeys = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type UiUnits = 'px' | 'rem' | 'em' | '%';
interface Breakpoints {
keys: BreakpointKeys[];
values: Record<BreakpointKeys, number>;
unit: UiUnits;
}
interface TextColorSemantics {
success: string;
warning: string;
error: string;
info: string;
}
interface TextColors {
primary: string;
link: string;
secondary: string;
disabled: string;
placeholder: string;
error: string;
inverse: string;
semantic: TextColorSemantics;
}
interface FillColors {
base: string;
medium: string;
dark: string;
surface: string;
inverse: string;
hover: string;
disabled: string;
hilight: string;
}
interface SemanticColorsType {
bg: string;
border: string;
}
interface SemanticColors {
error: SemanticColorsType;
warning: SemanticColorsType;
info: SemanticColorsType;
success: SemanticColorsType;
}
interface BorderColors {
light: string;
normal: string;
divider: string;
hover: string;
active: string;
disabled: string;
error: string;
}
interface CommonColors {
accent: string;
black: string;
white: string;
}
interface Colors {
common: CommonColors;
text: TextColors;
fill: FillColors;
semantic: SemanticColors;
border: BorderColors;
shadow: string;
scrim: string;
}
interface BaseTypography {
fontSize?: React.CSSProperties['fontSize'];
fontWeight?: React.CSSProperties['fontWeight'];
lineHeight?: React.CSSProperties['lineHeight'];
}
interface FuiTypography {
fontFamily: React.CSSProperties['fontFamily'];
fontWeight: Record<TypographyWeightType, React.CSSProperties['fontWeight']>;
primary: BaseTypography;
secondary: BaseTypography;
heading: BaseTypography;
heading4: BaseTypography;
heading3: BaseTypography;
heading2: BaseTypography;
heading1: BaseTypography;
caption: BaseTypography;
}
interface Easing {
easeInOut: string;
easeOut: string;
easeIn: string;
sharp: string;
}
interface Duration {
short: string;
standard: string;
complex: string;
}
interface Transitions {
easing: Easing;
duration: Duration;
}
interface ZIndex {
popover: number;
dropdown: number;
mobileStepper: number;
fab: number;
speedDial: number;
appBar: number;
dra