"use client"; import cx from "classnames"; import React from "react"; import { useStatic } from "../../../utils/hooks"; import { TextInput } from "../TextInput/TextInput"; import InputStepperStatic from "./InputStepper.static"; const CLASS_ROOT = "input-stepper"; export interface InputStepperConfig { min?: number; max?: number; defaultValue?: number; nonEditableInput?: boolean; } export interface InputStepperProps { config?: InputStepperConfig; id: string; inputClassName?: string; isDisabled?: boolean; /** Invalid state */ isInvalid?: boolean; name?: string; nonEditableInput?: boolean; className?: string; [key: string]: any; } const InputStepper: React.FC = ({ className, inputClassName, id, config, isDisabled, isInvalid, nonEditableInput = false, ...other }) => { const [elementRef] = useStatic(InputStepperStatic, { nonEditableInput, }); const { name = id, ...props } = other; const classes = cx(`${CLASS_ROOT}__field`, inputClassName); return (
{nonEditableInput || config?.nonEditableInput ? (

) : ( )}
); }; InputStepper.displayName = "InputStepper"; export { InputStepper };