UNPKG

@youwen/ai-design-system

Version:

Enterprise AI-driven design system with comprehensive design tokens

63 lines (62 loc) 2.74 kB
/** * 企业级标签组件 * 基于 Radix Label 实现的可访问性标签 */ import * as React from 'react'; import type { EnterpriseLabelProps } from './types'; declare const EnterpriseLabel: React.ForwardRefExoticComponent<EnterpriseLabelProps & React.RefAttributes<HTMLLabelElement>>; declare const FormLabel: React.FC<{ htmlFor?: string; required?: boolean; error?: boolean; children: React.ReactNode; className?: string; }>; declare const FieldsetLabel: React.FC<{ legend?: string; required?: boolean; description?: string; children: React.ReactNode; className?: string; }>; declare const InlineLabel: React.FC<{ children: React.ReactNode; htmlFor?: string; className?: string; }>; declare const LabelGroup: React.FC<{ labels: Array<{ id: string; htmlFor?: string; text: string; required?: boolean; variant?: 'default' | 'muted' | 'error' | 'success'; }>; orientation?: 'horizontal' | 'vertical'; className?: string; }>; declare const LabelWithHelp: React.FC<{ label: string; helpText?: string; htmlFor?: string; required?: boolean; error?: boolean; className?: string; }>; declare const createLabel: (variant?: 'default' | 'muted' | 'error' | 'success', size?: 'sm' | 'default' | 'lg') => React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const MutedLabel: React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const ErrorLabel: React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const SuccessLabel: React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const SmallLabel: React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const LargeLabel: React.ForwardRefExoticComponent<Omit<EnterpriseLabelProps, "variant" | "size"> & React.RefAttributes<HTMLLabelElement>>; declare const useFormLabels: (fields: string[]) => { setFieldRequired: (field: string, required: boolean) => void; setFieldError: (field: string, hasError: boolean) => void; getLabelProps: (field: string) => { required: boolean; variant: "default" | "error"; }; requiredFields: Set<string>; errorFields: Set<string>; }; export { EnterpriseLabel, FormLabel, FieldsetLabel, InlineLabel, LabelGroup, LabelWithHelp, MutedLabel, ErrorLabel, SuccessLabel, SmallLabel, LargeLabel, createLabel, useFormLabels, };