package.dist.components.pin-input.pin-input-root.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.
The newest version!
'use client';
import { jsx } from 'react/jsx-runtime';
import { mergeProps } from '@zag-js/react';
import { forwardRef } from 'react';
import { createSplitProps } from '../../utils/create-split-props.js';
import { ark } from '../factory.js';
import { usePinInput } from './use-pin-input.js';
import { PinInputProvider } from './use-pin-input-context.js';
const PinInputRoot = forwardRef((props, ref) => {
const [usePinInputProps, localProps] = createSplitProps()(props, [
"autoFocus",
"blurOnComplete",
"defaultValue",
"disabled",
"form",
"id",
"ids",
"invalid",
"mask",
"name",
"onValueChange",
"onValueComplete",
"onValueInvalid",
"otp",
"pattern",
"placeholder",
"readOnly",
"required",
"selectOnFocus",
"translations",
"type",
"value"
]);
const pinInput = usePinInput(usePinInputProps);
const mergedProps = mergeProps(pinInput.getRootProps(), localProps);
return /* @__PURE__ */ jsx(PinInputProvider, { value: pinInput, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
});
PinInputRoot.displayName = "PinInputRoot";
export { PinInputRoot };
© 2015 - 2025 Weber Informatics LLC | Privacy Policy