UNPKG

@smart-react-components/ui

Version:
33 lines (32 loc) 1.63 kB
import { JSXElementProps, SizeProp, Value } from '@smart-react-components/core/types'; import { OrderPosition } from '../types'; /** * Apply the given prop to each breakpoint which has a corresponding size prop. * * @param sizeProps - Object that holds size props. * @param sizePropKey - Name of the size prop. * @param responsivePropKey - Name of the applied prop. * @param valueCallback - It is invoked with the given size prop value to return the responsive prop value. */ export declare const applyResponsiveStyledProp: (sizeProps: JSXElementProps, sizePropKey: string, responsivePropKey: string, valueCallback: (size: SizeProp) => Value) => JSXElementProps; /** * Apply the given props to each breakpoint which has a corresponding size prop. * * @param sizeProps - Object that holds size props. * @param sizePropKey - Name of the size prop. * @param responsiveProps - Object key indicates name of the applied prop, and its value is invoked with the given size prop value to return the responsive prop value. */ export declare const applyResponsiveStyledProps: (sizeProps: JSXElementProps, sizePropKey: string, responsiveProps: { [key: string]: (size: SizeProp) => Value; }) => JSXElementProps; /** * Returns reverse value of the order position. * If value is left, returns right. * If value is right, returns left. */ export declare const getReverseOrderPosition: (value: OrderPosition) => number; /** * Checks if the item is clickable. * If onClick, onMouseDown, or onMouseUp are defined; isDisabled and isReadOnly are not, returns true. */ export declare const isItemClickable: (props: any) => boolean;