UNPKG

@massds/mayflower-react

Version:

React versions of Mayflower design system UI components

36 lines (31 loc) 1.66 kB
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** * GenTeaserSearchBar module. * @module @massds/mayflower-react/GenTeaserSearchBar * @requires module:@massds/mayflower-assets/scss/03-organisms/gen-teaser */ import React from "react"; import PropTypes from "prop-types"; import TeaserSearch from "../GenTeaserSearch/index.mjs"; /** * Search bar */ const GenTeaserSearchBar = props => { const search = props.search, rest = _objectWithoutPropertiesLoose(props, ["search"]); return /*#__PURE__*/React.createElement("div", _extends({ className: "ma__gen-teaser__search" }, rest), /*#__PURE__*/React.createElement(TeaserSearch, search)); }; GenTeaserSearchBar.propTypes = process.env.NODE_ENV !== "production" ? { /** search: target: target url of the search bar id: id of the search bar queryInput: query input variable to replace in the target url with the user entered term placeholder: Placeholder text of the search bar. */ search: PropTypes.shape(TeaserSearch.propTypes).isRequired } : {}; export default GenTeaserSearchBar;