@dnanpm/styleguide
Version:
DNA Styleguide repository provides the set of components and theme object used in various DNA projects.
47 lines (46 loc) • 1.56 kB
TypeScript
import type { ReactNode } from 'react';
import React from 'react';
type LabelTextStatus = 'info' | 'success' | 'warning' | 'error';
interface Props {
/**
* Unique ID for the component
*/
id?: string;
/**
* Content of LabelText component
*/
children?: ReactNode;
/**
* Allows to pass a custom 'for' attribute
*/
htmlFor?: string;
/**
* Styling of `label` element changes depending on the passed status
*
* @param {LabelTextStatus} undefined Default styling
* @param {LabelTextStatus} info Changes color to default color (this type will be deprecated in the future)
* @param {LabelTextStatus} success Changes color to default color (this type will be deprecated in the future)
* @param {LabelTextStatus} warning Changes color to default color (this type will be deprecated in the future)
* @param {LabelTextStatus} error Changes color to `theme.color.notification.error`
*
* @deprecated info, success and warning are deprecated, please switch to default or error status
*/
status?: LabelTextStatus;
/**
* Allows to set element as mandatory
*
* @default false
*/
isMandatory?: boolean;
/**
* Allows to pass a custom className
*/
className?: string;
/**
* Allows to pass testid string for testing purposes
*/
'data-testid'?: string;
}
/** @visibleName Label Text */
declare const LabelText: ({ "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
export default LabelText;