| 1 |
import styles from '@patternfly/react-styles/css/components/InputGroup/input-group'; |
| 2 |
import { css } from '@patternfly/react-styles'; |
| 3 |
|
| 4 |
export interface InputGroupItemProps extends React.HTMLProps<HTMLDivElement> { |
| 5 |
/** Additional classes added to the input group item. */ |
| 6 |
className?: string; |
| 7 |
/** Content rendered inside the input group item. */ |
| 8 |
children: React.ReactNode; |
| 9 |
/** Enables box styling to the input group item */ |
| 10 |
isBox?: boolean; |
| 11 |
/** Flag to indicate if the input group item is plain. */ |
| 12 |
isPlain?: boolean; |
| 13 |
/** Flag to indicate if the input group item should fill the available horizontal space */ |
| 14 |
isFill?: boolean; |
| 15 |
/** Flag to indicate if the input group item is disabled. */ |
| 16 |
isDisabled?: boolean; |
| 17 |
} |
| 18 |
|
| 19 |
export const InputGroupItem: React.FunctionComponent<InputGroupItemProps> = ({ |
| 20 |
className, |
| 21 |
children, |
| 22 |
isFill = false, |
| 23 |
isBox = false, |
| 24 |
isPlain, |
| 25 |
isDisabled, |
| 26 |
...props |
| 27 |
}: InputGroupItemProps) => ( |
| 28 |
<div |
| 29 |
className={css( |
| 30 |
styles.inputGroupItem, |
| 31 |
isFill && styles.modifiers.fill, |
| 32 |
isBox && styles.modifiers.box, |
| 33 |
isPlain && styles.modifiers.plain, |
| 34 |
isDisabled && styles.modifiers.disabled, |
| 35 |
className |
| 36 |
)} |
| 37 |
{...props} |
| 38 |
> |
| 39 |
{children} |
| 40 |
</div> |
| 41 |
); |
| 42 |
InputGroupItem.displayName = 'InputGroupItem'; |