UNPKG

@talend/react-components

Version:
41 lines 1.11 kB
import PropTypes from 'prop-types'; import Inject from '../../Inject'; import Typeahead from '../../Typeahead'; import { getTheme } from '../../theme'; import headerBarCssModule from '../HeaderBar.module.scss'; import { jsx as _jsx } from "react/jsx-runtime"; const theme = getTheme(headerBarCssModule); export function Search({ getComponent, icon, ...props }) { const className = theme('tc-header-bar-action', 'tc-header-bar-search', 'separated'); const Renderers = Inject.getAll(getComponent, { Typeahead }); const a11yIcon = icon && { ...icon, role: 'search' }; return /*#__PURE__*/_jsx("li", { role: "presentation", className: className, children: /*#__PURE__*/_jsx("form", { className: "navbar-form navbar-right", children: /*#__PURE__*/_jsx(Renderers.Typeahead, { ...props, role: "searchbox", icon: a11yIcon }) }) }); } Search.propTypes = { getComponent: PropTypes.func, icon: PropTypes.object, renderers: PropTypes.shape({ Typeahead: PropTypes.func }) }; //# sourceMappingURL=Search.component.js.map