UNPKG

@grafana/ui

Version:
29 lines (26 loc) 1.02 kB
import { jsx } from 'react/jsx-runtime'; import { cx, css } from '@emotion/css'; import { forwardRef } from 'react'; import { useStyles2 } from '../../themes/ThemeContext.mjs'; import { sharedInputStyle, getFocusStyle } from '../Forms/commonStyles.mjs'; "use strict"; const TextArea = forwardRef(({ invalid, className, ...props }, ref) => { const styles = useStyles2(getTextAreaStyle, invalid); return /* @__PURE__ */ jsx("textarea", { ...props, className: cx(styles.textarea, className), ref }); }); const getTextAreaStyle = (theme, invalid = false) => ({ textarea: cx( sharedInputStyle(theme), getFocusStyle(theme), css({ display: "block", borderRadius: theme.shape.radius.default, padding: `${theme.spacing.gridSize / 4}px ${theme.spacing.gridSize}px`, width: "100%", borderColor: invalid ? theme.colors.error.border : theme.components.input.borderColor }) ) }); TextArea.displayName = "TextArea"; export { TextArea }; //# sourceMappingURL=TextArea.mjs.map