import type React from 'react'; import type * as TabsPrimitive from '@radix-ui/react-tabs'; import { type BezierComponentProps, type ChildrenProps, type DisableProps, type FormFieldProps, type SideContentProps, type SizeProps } from "../../types/props"; export type SegmentedControlSize = 'xs' | 's' | 'm' | 'l'; export type SegmentedControlType = 'radiogroup' | 'tabs'; type SegmentedControlNonValueProps = { /** * The element type of segmented control. * It can be either `radiogroup` or `tabs` * @default 'radiogroup' */ type?: Type; width?: React.CSSProperties['width']; }; type SegmentedControlValueProps = { /** * The controlled value of the item to check. * It should be used in conjunction with `onValueChange`. */ value?: Value; /** * The value of the segmented control that should be checked when initially rendered. * Use when you do not need to control the state of the items. */ defaultValue?: Value; /** * Event handler called when the value changes. */ onValueChange?: (value: Value) => void; }; type SegmentedControlRadioGroupSpecificProps = FormFieldProps & { /** * The name of the group. * Submitted with its owning form as part of a name/value pair. */ name?: string; }; interface SegmentedControlItemOwnProps { /** * The value of the item. * * If the type of `SegmentedControl` is `radiogroup`, It is the value given as data when submitted with a `SegmentedControlProps.name`. * * If the type of `SegmentedControl` is `tabs`, It is the value that associates the item with a content. */ value: Value; } interface SegmentedControlTabContentOwnProps { /** * A unique value that associates the item with a content. */ value: Value; } type SegmentedControlOwnProps = (Type extends 'radiogroup' ? SegmentedControlRadioGroupSpecificProps : {}) & SegmentedControlNonValueProps & SegmentedControlValueProps; type RadixTabsPredefinedPropKeys = 'dir'; export type SegmentedControlProps = Omit, RadixTabsPredefinedPropKeys> & ChildrenProps & SizeProps & SegmentedControlOwnProps; export interface SegmentedControlRadioGroupProps extends Omit, keyof SegmentedControlNonValueProps<'radiogroup'>> { } export interface SegmentedControlTabsProps extends Omit, keyof SegmentedControlNonValueProps<'tabs'>> { } type RadixTabListPredefinedPropKeys = 'defaultValue'; export interface SegmentedControlTabListProps extends Omit, RadixTabListPredefinedPropKeys>, ChildrenProps { } export type SegmentedControlItemListProps = Type extends 'radiogroup' ? SegmentedControlRadioGroupProps : SegmentedControlTabListProps; export interface SegmentedControlItemProps extends Omit, keyof SegmentedControlItemOwnProps>, ChildrenProps, DisableProps, SideContentProps, SegmentedControlItemOwnProps { } export interface SegmentedControlTabContentProps extends BezierComponentProps<'div'>, ChildrenProps, Pick, SegmentedControlTabContentOwnProps { } export {}; //# sourceMappingURL=SegmentedControl.types.d.ts.map