UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

68 lines (67 loc) 1.62 kB
"use client"; import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs"; import { extractStyleProps } from "../../core/Box/style-props/extract-style-props/extract-style-props.mjs"; //#region packages/@mantine/core/src/components/Input/use-input-props.ts function useInputProps(component, defaultProps, _props) { const props = useProps([ "Input", "InputWrapper", component ], defaultProps, _props); const { label, description, error, success, required, classNames, styles, className, unstyled, __staticSelector, __stylesApiProps, errorProps, successProps, labelProps, descriptionProps, wrapperProps: _wrapperProps, id, size, style, inputContainer, inputWrapperOrder, withAsterisk, variant, vars, mod, attributes, ...others } = props; const { styleProps, rest } = extractStyleProps(others); const wrapperProps = { label, description, error, success, required, classNames, className, __staticSelector, __stylesApiProps: __stylesApiProps || props, errorProps, successProps, labelProps, descriptionProps, unstyled, styles, size, style, inputContainer, inputWrapperOrder, withAsterisk, variant, id, mod, attributes, ..._wrapperProps }; return { ...rest, classNames, styles, unstyled, wrapperProps: { ...wrapperProps, ...styleProps }, inputProps: { required, classNames, styles, unstyled, size, __staticSelector, __stylesApiProps: __stylesApiProps || props, error, success, variant, id, attributes } }; } //#endregion export { useInputProps }; //# sourceMappingURL=use-input-props.mjs.map