index.d.ts 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as React from "react";
  2. import * as Radix from "@radix-ui/react-primitive";
  3. import { Primitive } from "@radix-ui/react-primitive";
  4. import * as RovingFocusGroup from "@radix-ui/react-roving-focus";
  5. type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
  6. interface RadioProps extends PrimitiveButtonProps {
  7. checked?: boolean;
  8. required?: boolean;
  9. onCheck?(): void;
  10. }
  11. declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLButtonElement>>;
  12. type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
  13. interface RadioIndicatorProps 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 & React.RefAttributes<HTMLSpanElement>>;
  21. export const createRadioGroupScope: import("@radix-ui/react-context").CreateScope;
  22. type RadioGroupContextValue = {
  23. name?: string;
  24. required: boolean;
  25. disabled: boolean;
  26. value?: string;
  27. onValueChange(value: string): void;
  28. };
  29. type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
  30. type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
  31. export interface RadioGroupProps extends PrimitiveDivProps {
  32. name?: RadioGroupContextValue['name'];
  33. required?: Radix.ComponentPropsWithoutRef<typeof Radio>['required'];
  34. disabled?: Radix.ComponentPropsWithoutRef<typeof Radio>['disabled'];
  35. dir?: RovingFocusGroupProps['dir'];
  36. orientation?: RovingFocusGroupProps['orientation'];
  37. loop?: RovingFocusGroupProps['loop'];
  38. defaultValue?: string;
  39. value?: RadioGroupContextValue['value'];
  40. onValueChange?: RadioGroupContextValue['onValueChange'];
  41. }
  42. export const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
  43. type _RadioProps1 = Radix.ComponentPropsWithoutRef<typeof Radio>;
  44. export interface RadioGroupItemProps extends Omit<_RadioProps1, 'onCheck' | 'name'> {
  45. value: string;
  46. }
  47. export const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  48. type _RadioIndicatorProps1 = Radix.ComponentPropsWithoutRef<typeof RadioIndicator>;
  49. export interface RadioGroupIndicatorProps extends _RadioIndicatorProps1 {
  50. }
  51. export const RadioGroupIndicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  52. export const Root: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
  53. export const Item: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  54. export const Indicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  55. //# sourceMappingURL=index.d.ts.map