UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

32 lines (27 loc) 1.06 kB
'use client'; 'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const startIndicator = require('./start-indicator.cjs'); const statusIndicator = require('./status-indicator.cjs'); const primitives = require('./primitives.cjs'); const index = require('../../utils/index.cjs'); function CerberusFieldInput(props) { const [{ startIcon, endIcon }, fieldProps] = index.splitProps(props, [ "startIcon", "endIcon" ]); const hasStartIcon = Boolean(startIcon); return /* @__PURE__ */ jsxRuntime.jsxs(primitives.FieldInputRoot, { children: [ /* @__PURE__ */ jsxRuntime.jsx(startIndicator.FieldStartIndicator, { children: startIcon }), /* @__PURE__ */ jsxRuntime.jsx( primitives.FieldInput, { ...fieldProps, ...hasStartIcon && { "data-has": "start-indicator" } } ), /* @__PURE__ */ jsxRuntime.jsx(statusIndicator.FieldStatusIndicator, { fallback: endIcon }) ] }); } exports.CerberusFieldInput = CerberusFieldInput;