index.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import * as _radix_ui_react_context from '@radix-ui/react-context';
  2. import * as React from 'react';
  3. import { Primitive } from '@radix-ui/react-primitive';
  4. import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
  5. type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
  6. interface RadioProps$1 extends PrimitiveButtonProps {
  7. checked?: boolean;
  8. required?: boolean;
  9. onCheck?(): void;
  10. }
  11. declare const Radio: React.ForwardRefExoticComponent<RadioProps$1 & React.RefAttributes<HTMLButtonElement>>;
  12. type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
  13. interface RadioIndicatorProps$1 extends PrimitiveSpanProps {
  14. /**
  15. * Used to force mounting when more control is needed. Useful when
  16. * controlling animation with React animation libraries.
  17. */
  18. forceMount?: true;
  19. }
  20. declare const RadioIndicator: React.ForwardRefExoticComponent<RadioIndicatorProps$1 & React.RefAttributes<HTMLSpanElement>>;
  21. declare const createRadioGroupScope: _radix_ui_react_context.CreateScope;
  22. type RadioGroupContextValue = {
  23. name?: string;
  24. required: boolean;
  25. disabled: boolean;
  26. value: string | null;
  27. onValueChange(value: string): void;
  28. };
  29. type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
  30. type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
  31. interface RadioGroupProps extends PrimitiveDivProps {
  32. name?: RadioGroupContextValue['name'];
  33. required?: React.ComponentPropsWithoutRef<typeof Radio>['required'];
  34. disabled?: React.ComponentPropsWithoutRef<typeof Radio>['disabled'];
  35. dir?: RovingFocusGroupProps['dir'];
  36. orientation?: RovingFocusGroupProps['orientation'];
  37. loop?: RovingFocusGroupProps['loop'];
  38. defaultValue?: string;
  39. value?: string | null;
  40. onValueChange?: RadioGroupContextValue['onValueChange'];
  41. }
  42. declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
  43. type RadioProps = React.ComponentPropsWithoutRef<typeof Radio>;
  44. interface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {
  45. value: string;
  46. }
  47. declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  48. type RadioIndicatorProps = React.ComponentPropsWithoutRef<typeof RadioIndicator>;
  49. interface RadioGroupIndicatorProps extends RadioIndicatorProps {
  50. }
  51. declare const RadioGroupIndicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  52. declare const Root: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
  53. declare const Item: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  54. declare const Indicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  55. export { Indicator, Item, RadioGroup, RadioGroupIndicator, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, Root, createRadioGroupScope };