UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

76 lines (73 loc) 2.68 kB
'use client'; import React, { forwardRef } from 'react'; import { getFontSize, getSize } from '../../core/utils/get-size/get-size.mjs'; import 'clsx'; import '@mantine/hooks'; import '../../core/MantineProvider/Mantine.context.mjs'; import '../../core/MantineProvider/default-theme.mjs'; import '../../core/MantineProvider/MantineProvider.mjs'; import '../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs'; import { useStyles } from '../../core/styles-api/use-styles/use-styles.mjs'; import { Box } from '../../core/Box/Box.mjs'; import '../../core/DirectionProvider/DirectionProvider.mjs'; import { Input } from '../Input/Input.mjs'; import '../Input/InputWrapper/InputWrapper.mjs'; import '../Input/InputDescription/InputDescription.mjs'; import '../Input/InputError/InputError.mjs'; import '../Input/InputLabel/InputLabel.mjs'; import '../Input/InputPlaceholder/InputPlaceholder.mjs'; import '../Input/InputWrapper.context.mjs'; import classes from './InlineInput.module.css.mjs'; const InlineInputClasses = classes; const InlineInput = forwardRef( ({ __staticSelector, __stylesApiProps, className, classNames, styles, unstyled, children, label, description, id, disabled, error, size, labelPosition = "left", variant, style, vars, ...others }, ref) => { const getStyles = useStyles({ name: __staticSelector, props: __stylesApiProps, className, style, classes, classNames, styles, unstyled }); return /* @__PURE__ */ React.createElement( Box, { ...getStyles("root"), ref, __vars: { "--label-fz": getFontSize(size), "--label-lh": getSize(size, "label-lh") }, mod: { "label-position": labelPosition }, variant, size, ...others }, /* @__PURE__ */ React.createElement("div", { ...getStyles("body") }, children, /* @__PURE__ */ React.createElement("div", { ...getStyles("labelWrapper"), "data-disabled": disabled || void 0 }, label && /* @__PURE__ */ React.createElement("label", { ...getStyles("label"), "data-disabled": disabled || void 0, htmlFor: id }, label), description && /* @__PURE__ */ React.createElement(Input.Description, { size, __inheritStyles: false, ...getStyles("description") }, description), error && error !== "boolean" && /* @__PURE__ */ React.createElement(Input.Error, { size, __inheritStyles: false, ...getStyles("error") }, error))) ); } ); InlineInput.displayName = "@mantine/core/InlineInput"; export { InlineInput, InlineInputClasses }; //# sourceMappingURL=InlineInput.mjs.map