index.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import * as React from "react";
  2. import * as Radix from "@radix-ui/react-primitive";
  3. import { Primitive } from "@radix-ui/react-primitive";
  4. export const createRovingFocusGroupScope: import("@radix-ui/react-context").CreateScope;
  5. type Orientation = React.AriaAttributes['aria-orientation'];
  6. type Direction = 'ltr' | 'rtl';
  7. interface RovingFocusGroupOptions {
  8. /**
  9. * The orientation of the group.
  10. * Mainly so arrow navigation is done accordingly (left & right vs. up & down)
  11. */
  12. orientation?: Orientation;
  13. /**
  14. * The direction of navigation between items.
  15. */
  16. dir?: Direction;
  17. /**
  18. * Whether keyboard navigation should loop around
  19. * @defaultValue false
  20. */
  21. loop?: boolean;
  22. }
  23. export interface RovingFocusGroupProps extends RovingFocusGroupImplProps {
  24. }
  25. export const RovingFocusGroup: React.ForwardRefExoticComponent<RovingFocusGroupProps & React.RefAttributes<HTMLDivElement>>;
  26. type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
  27. interface RovingFocusGroupImplProps extends Omit<PrimitiveDivProps, 'dir'>, RovingFocusGroupOptions {
  28. currentTabStopId?: string | null;
  29. defaultCurrentTabStopId?: string;
  30. onCurrentTabStopIdChange?: (tabStopId: string | null) => void;
  31. onEntryFocus?: (event: Event) => void;
  32. }
  33. type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
  34. export interface RovingFocusItemProps extends PrimitiveSpanProps {
  35. tabStopId?: string;
  36. focusable?: boolean;
  37. active?: boolean;
  38. }
  39. export const RovingFocusGroupItem: React.ForwardRefExoticComponent<RovingFocusItemProps & React.RefAttributes<HTMLSpanElement>>;
  40. export const Root: React.ForwardRefExoticComponent<RovingFocusGroupProps & React.RefAttributes<HTMLDivElement>>;
  41. export const Item: React.ForwardRefExoticComponent<RovingFocusItemProps & React.RefAttributes<HTMLSpanElement>>;
  42. //# sourceMappingURL=index.d.ts.map