@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
13 lines (12 loc) • 788 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
/**
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
*/
import clsx from 'clsx';
import { forwardRef, useId } from 'react';
export const SearchFieldInput = forwardRef(({ className, dir, invalid, label = 'Zoeken', ...restProps }, ref) => {
const id = useId();
return (_jsxs(_Fragment, { children: [_jsx("label", { className: "ams-visually-hidden", htmlFor: id, children: label }), _jsx("input", { ...restProps, "aria-invalid": invalid || undefined, autoComplete: "off", className: clsx('ams-search-field__input', className), dir: dir ?? 'auto', enterKeyHint: "search", id: id, ref: ref, spellCheck: "false", type: "search" })] }));
});
SearchFieldInput.displayName = 'SearchField.Input';