import React from 'react'; import { categories } from '@wix/categories'; import { AsChildChildren } from '@wix/headless-utils/react'; export type Category = categories.Category; /** * Props for the `Category.Root` component. */ export interface CategoryRootProps { /** * The category data to display. */ category: Category; /** * Child components to render within the category context. * * Use any of `Category.Trigger`, `Category.Label`, `Category.ID`, and `Category.Raw` * to display the category data. These children have access to the category * context and can render the category in different ways. */ children: React.ReactNode; } /** * Props for the `Category.Trigger` component. */ export interface CategoryTriggerProps { /** * When `true`, replaces the default ` * ))} * * * // asChild with render object - Shows product count and selection indicator * * {{ * render: ({ category, isSelected, onSelect, ...props }, ref) => ( * * ) * }} * * ``` */ export declare const Trigger: React.ForwardRefExoticComponent>; /** * Displays the category name or label. * Provides category name and full category data to custom render functions. * * By default, renders a `` element containing the category name. * * @component * @example Basic usage * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.Label must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // Default styling * * * // Custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.Label must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Shows product count * * {React.forwardRef(({ name, category, ...props }, ref) => ( * * {name} ({category.numberOfProducts} products) * * ))} * * * // asChild with render object - Shows product count * * {{ * render: ({ name, category, ...props }, ref) => ( * * {name} ({category.numberOfProducts} products) * * ) * }} * * ``` */ export declare const Label: React.ForwardRefExoticComponent>; /** * Provides access to the category ID for advanced use cases. * Typically used for tracking, analytics, or hidden form fields. * * By default, renders a visually hidden `` element (using the`sr-only` class) * to keep the ID accessible to screen readers without affecting the visual layout. * * @component * @example Basic usage * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.ID must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // For this component, default styling is the sr-only class * * * // Custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.ID must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Adds data attribute for tracking * * {React.forwardRef(({ id, category, ...props }, ref) => ( * * Category ID: {id} * * ))} * * * // asChild with render object - Adds data attribute for tracking * * {{ * render: ({ id, category, ...props }, ref) => ( * * Category ID: {id} * * ) * }} * * ``` */ export declare const ID: React.ForwardRefExoticComponent>; /** * Provides access to the full category data for advanced use cases. * Useful for custom implementations that need access to all category properties * such as slug, description, image, or metadata. * * By default, renders a visually hidden `` with the category JSON. * * @component * @example Basic usage * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.Raw must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // For this component, default styling is the sr-only class * * * // Custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Category } from '@wix/stores/components'; * // * // Category.Raw must be wrapped in CategoryList.CategoryRepeater or Category.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Formats category as JSON with data attribute * * {React.forwardRef(({ category, isSelected, ...props }, ref) => ( *
*
{JSON.stringify(category, null, 2)}
*
* ))} *
* * // asChild with render object - Formats category as JSON with data attribute * * {{ * render: ({ category, isSelected, ...props}, ref) => ( *
*
{JSON.stringify(category, null, 2)}
*
* ) * }} *
* ``` */ export declare const Raw: React.ForwardRefExoticComponent>; /** * Displays the currently selected category and allows clearing the selection. * Selecting a category filters the product list to show only products in that category. * * By default, renders a `
` showing the selected category name with a * configurable label. * * @component * @example Basic usage * ```tsx * // import { CategoryFilter } from '@wix/stores/components'; * // * // CategoryFilter must be wrapped in ProductList.Root * * // Default styling * * * // Custom styling and data attributes * * ``` * * @example With custom label * ```tsx * // import { CategoryFilter } from '@wix/stores/components'; * // * // CategoryFilter must be wrapped in ProductList.Root * * // With custom label * * * // With custom label and custom styling * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { CategoryFilter } from '@wix/stores/components'; * // * // CategoryFilter must be wrapped in ProductList.Root * * // asChild with React element - Syntax demonstration for alternative element type * *
* * * // asChild with render function - Shows clear button when category selected * * {React.forwardRef(({ selectedCategory, setSelectedCategory, ...props }, ref) => ( *
* {selectedCategory && ( * <> * Selected: {selectedCategory.name} * * * )} *
* ))} *
* * // asChild with render object - Shows clear button when category selected * * {{ * render: ({ selectedCategory, setSelectedCategory, ...props }, ref) => ( *
* {selectedCategory && ( * <> * Selected: {selectedCategory.name} * * * )} *
* ) * }} *
* ``` */ export declare const CategoryFilter: React.ForwardRefExoticComponent>;