import React from 'react';
import type { Label } from '../services/types.js';
import type { AsChildChildren, AsChildRenderFunction } from '@wix/headless-utils/react';
export interface LabelRootProps {
label?: Label;
children: React.ReactNode;
}
/**
* Root component that provides label context to its children.
*
* @warning Do not use this component directly if it's inside a repeater.
* Use the repeater component (e.g., Item.LabelsRepeater) instead, which will
* automatically render this Root component for each label.
*/
export declare const Root: (props: LabelRootProps) => import("react/jsx-runtime").JSX.Element | null;
export interface LabelNameProps {
/** Whether to render as a child component */
asChild?: boolean;
/** Custom render function when using asChild */
children?: AsChildChildren<{
name: string;
}>;
/** CSS classes to apply to the default element */
className?: string;
}
/**
* Displays the label name with customizable rendering following the documented API.
*
* @component
* @example
* ```tsx
* // Default usage
*
*
* // asChild with primitive
*
*
*
*
* // asChild with react component
*
* {React.forwardRef(({name, ...props}, ref) => (
*
* {name}
*
* ))}
*
* ```
*/
export declare const Name: React.ForwardRefExoticComponent>;
export interface LabelIconProps {
/** Whether to render as a child component */
asChild?: boolean;
/**
* Custom render function when using asChild.
* Receives an object with:
* - hasIcon: boolean - whether the label has an icon
* - icon: string | null - the icon URL
* - altText: string - the alt text for the icon
*/
children?: AsChildRenderFunction<{
hasIcon: boolean;
icon: string | null;
altText: string;
}>;
/** CSS classes to apply to the default element */
className?: string;
}
/**
* Displays the label icon with customizable rendering following the documented API.
* Provides the actual icon element when available.
*
* @component
* @example
* ```tsx
* // Default usage
*
*
* // asChild with primitive
*
*
*
*
* // asChild with custom component
*
* {React.forwardRef(({hasIcon, icon, altText, ...props}, ref) => (
*
* {hasIcon &&

}
*
* ))}
*
*
* // Custom render function
*
* {({ hasIcon, icon, altText }) => (
*
* {hasIcon && (
*
* )}
*
* )}
*
* ```
*/
export declare const Icon: React.ForwardRefExoticComponent>;
/**
* Label namespace containing all label components
* following the compound component pattern: LabelComponent.Root, LabelComponent.Name, LabelComponent.Icon
*/
export declare const LabelComponent: {
/** Label root component */
readonly Root: (props: LabelRootProps) => import("react/jsx-runtime").JSX.Element | null;
/** Label name component */
readonly Name: React.ForwardRefExoticComponent>;
/** Label icon component */
readonly Icon: React.ForwardRefExoticComponent>;
};