import * as React from 'react'; import { forwardRef } from 'react'; import { Box, BoxProps } from '../box/box.js'; import { Text } from '../Text/Text.js'; /** * The label element of the input. This should be placed * directly above the Input component. */ export interface InputLabelProps extends Omit { /** * A helpful description that can be displayed under the input. */ description?: string | React.ReactNode; /** * The label string that is rendered above the Input. */ label?: string | React.ReactNode; } export const InputLabel = forwardRef((props, ref) => { const { children, description, label, paddingHorizontal = 'x3', ...rest } = props; if (!label && !children && !description) { return null; } return ( {label && ( {label} )} {children && ( {children} )} {description && ( {description} )} ); });