| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx } from "react/jsx-runtime"; |
| 3 |
import { createContext, useRef } from 'react'; |
| 4 |
import styles from '@patternfly/react-styles/css/components/TextInputGroup/text-input-group.mjs'; |
| 5 |
import { css } from '@patternfly/react-styles'; |
| 6 |
export const TextInputGroupContext = createContext({ |
| 7 |
isDisabled: false |
| 8 |
}); |
| 9 |
export const TextInputGroup = (_a) => { |
| 10 |
var { children, className, isDisabled, isPlain, validated, innerRef } = _a, props = __rest(_a, ["children", "className", "isDisabled", "isPlain", "validated", "innerRef"]); |
| 11 |
const ref = useRef(null); |
| 12 |
const textInputGroupRef = innerRef || ref; |
| 13 |
const hasValidatedModifier = ['success', 'error', 'warning'].includes(validated); |
| 14 |
return (_jsx(TextInputGroupContext.Provider, { value: { isDisabled, validated }, children: _jsx("div", Object.assign({ ref: textInputGroupRef, className: css(styles.textInputGroup, isDisabled && styles.modifiers.disabled, isPlain && styles.modifiers.plain, hasValidatedModifier && styles.modifiers[validated], className) }, props, { children: children })) })); |
| 15 |
}; |
| 16 |
TextInputGroup.displayName = 'TextInputGroup'; |
| 17 |
//# sourceMappingURL=TextInputGroup.js.map |