@accelint/design-toolkit
Version:
An open-source component library to serve as part of the entire ecosystem of UX for Accelint.
30 lines (27 loc) • 1.09 kB
TypeScript
import { RefAttributes } from 'react';
import { Key, ListBoxProps, ListBoxItemProps, TextProps, ListBoxSectionProps } from 'react-aria-components';
import { IconProps } from '../icon/types.js';
type OptionsDataItem = {
id: Key;
name: string;
children?: OptionsDataItem[];
};
type OptionsItemProps<T extends OptionsDataItem> = Omit<ListBoxItemProps<T>, 'className'> & RefAttributes<T> & {
classNames?: {
item?: ListBoxItemProps['className'];
icon?: IconProps['className'];
};
color?: 'info' | 'serious';
};
type OptionsProps<T extends OptionsDataItem> = Omit<ListBoxProps<T>, 'orientation' | 'layout'> & RefAttributes<HTMLDivElement> & {
size?: 'small' | 'large';
};
type OptionsSectionProps<T extends OptionsDataItem> = Omit<ListBoxSectionProps<T>, 'className'> & {
classNames?: {
section?: ListBoxSectionProps<T>['className'];
header?: string;
};
header?: string;
};
type OptionsItemTextProps = TextProps;
export type { OptionsDataItem, OptionsItemProps, OptionsItemTextProps, OptionsProps, OptionsSectionProps };