@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
17 lines • 1.13 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { Text } from '../../components/text/text';
import { useId } from '../../hooks/useId/useId';
import { TextComponentType } from '../text/types/component';
export const LabelStandAloneComponent = ({ children, inputId, required, requiredSymbol, textVariant, weight, color, cursor, asteriskVariant, asteriskWeight, asteriskColor, dataTestId = 'label', id, }, ref) => {
const uniqueId = useId('label');
const labelId = id ?? uniqueId;
return (_jsxs(Text, { ref: ref, color: color, component: TextComponentType.LABEL, cursor: cursor, dataTestId: dataTestId, htmlFor: inputId, id: labelId, variant: textVariant, weight: weight, children: [children, required && (_jsx(Text, { "aria-hidden": true, color: asteriskColor, component: TextComponentType.SPAN, variant: asteriskVariant, weight: asteriskWeight, children: requiredSymbol }))] }));
};
/**
* @description
* Label component to show labels
* @internal
*/
export const LabelStandAlone = React.forwardRef(LabelStandAloneComponent);
//# sourceMappingURL=labelStandAlone.js.map