@payfit/unity-components
Version:
31 lines (30 loc) • 1.44 kB
TypeScript
import { ReactElement } from 'react';
import { DataAttributes } from '../../../types/DataAttributes.js';
import { SubTaskProps } from './RawSubTask.js';
import { TaskProps } from './RawTask.js';
export interface TaskGroupProps extends Omit<TaskProps, 'href' | 'isExact' | 'isCurrent' | 'onPress' | 'isSelected'>, DataAttributes {
/**
* The subtasks that belong to this task group. Can be a single SubTask or an array of SubTask components.
*/
children?: ReactElement<SubTaskProps> | Array<ReactElement<SubTaskProps>>;
}
/**
* The `TaskGroup` component represents a collapsible group of subtasks in the task menu.
* It provides an organized way to group related subtasks together, with automatic expansion/collapse behavior and intelligent selection of the first incomplete subtask when opened.
*
* ```tsx
* <TaskGroup
* uniqueId="onboarding-group"
* label="Employee Onboarding"
* taskNumber={1}
* taskStatus="uncompleted"
* >
* <RawSubTask uniqueId="profile" label="Complete Profile" href="/profile" />
* <RawSubTask uniqueId="documents" label="Upload Documents" href="/documents" />
* <RawSubTask uniqueId="training" label="Complete Training" href="/training" />
* </TaskGroup>
* ```
* @see {@link TaskGroupProps} for all available props
*/
declare const TaskGroup: import('react').ForwardRefExoticComponent<TaskGroupProps & import('react').RefAttributes<HTMLLIElement>>;
export { TaskGroup };