
package.dist.components.field.field-required-indicator.cjs 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';
'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const jsxRuntime = require('react/jsx-runtime');
const core = require('@zag-js/core');
const react = require('react');
const factory = require('../factory.cjs');
const useFieldContext = require('./use-field-context.cjs');
const FieldRequiredIndicator = react.forwardRef(
({ fallback, ...props }, ref) => {
const field = useFieldContext.useFieldContext();
if (!field.required) {
return fallback;
}
const mergedProps = core.mergeProps(field.getRequiredIndicatorProps(), props);
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: props.children ?? "*" });
}
);
FieldRequiredIndicator.displayName = "FieldRequiredIndicator";
exports.FieldRequiredIndicator = FieldRequiredIndicator;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy