@cbinsights/fds
Version:
Form: A design system by CB Insights
25 lines (24 loc) • 988 B
TypeScript
import React from 'react';
export declare type FlexType = 'shrink' | 'grow';
/**
* Returns an array InputGroup can use to set grow/shrink on flex items
*
* @param {Number} childCount - number of react children passed to InputGroup
* @param {Array} userSettings - `flexSettings` prop optionally set by user
* @returns {Array} e.g. ['shrink', 'grow', 'shrink']
*/
export declare const getFlexSettings: (childCount: number, userSettings?: FlexType[] | undefined) => FlexType[];
export interface InputGroupProps {
/** `input` or `select` elements */
children: React.ReactNode;
/**
* Controls how the input segments should grow or shrink to fill remaining space.
*
* `shrink` - segment to shrink to natural width of the input element
*
* `grow` - grow the input element to fill remaining space
*/
flexSettings?: FlexType[];
}
declare const InputGroup: ({ children, flexSettings }: InputGroupProps) => JSX.Element;
export default InputGroup;