@razorpay/blade
Version:
The Design System that powers Razorpay
30 lines (26 loc) • 894 B
JavaScript
import { useId } from '../../utils/useId.js';
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/**
* hook to generate unique ids for a form element
*
* @param prefix prefix to append before the id
*/
var useFormId = function useFormId(prefix) {
var baseId = useId(prefix);
var inputId = useId("".concat(baseId, "-input"));
var errorTextId = useId("".concat(baseId, "-errortext"));
var helpTextId = useId("".concat(baseId, "-helptext"));
var successTextId = useId("".concat(baseId, "-successtext"));
var labelId = useId("".concat(baseId, "-label"));
return {
baseId: baseId,
inputId: inputId,
errorTextId: errorTextId,
helpTextId: helpTextId,
successTextId: successTextId,
labelId: labelId
};
};
export { useFormId };
//# sourceMappingURL=useFormId.js.map