Blame view

天文台pc/tianwentai-ui/node_modules/@radix-ui/react-toggle-group/dist/index.d.ts 3.21 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  import * as _radix_ui_react_context from '@radix-ui/react-context';
  import React from 'react';
  import { Primitive } from '@radix-ui/react-primitive';
  import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
  import { Toggle } from '@radix-ui/react-toggle';
  
  declare const createToggleGroupScope: _radix_ui_react_context.CreateScope;
  interface ToggleGroupSingleProps extends ToggleGroupImplSingleProps {
      type: 'single';
  }
  interface ToggleGroupMultipleProps extends ToggleGroupImplMultipleProps {
      type: 'multiple';
  }
  declare const ToggleGroup: React.ForwardRefExoticComponent<(ToggleGroupSingleProps | ToggleGroupMultipleProps) & React.RefAttributes<HTMLDivElement>>;
  interface ToggleGroupImplSingleProps extends ToggleGroupImplProps {
      /**
       * The controlled stateful value of the item that is pressed.
       */
      value?: string;
      /**
       * The value of the item that is pressed when initially rendered. Use
       * `defaultValue` if you do not need to control the state of a toggle group.
       */
      defaultValue?: string;
      /**
       * The callback that fires when the value of the toggle group changes.
       */
      onValueChange?(value: string): void;
  }
  interface ToggleGroupImplMultipleProps extends ToggleGroupImplProps {
      /**
       * The controlled stateful value of the items that are pressed.
       */
      value?: string[];
      /**
       * The value of the items that are pressed when initially rendered. Use
       * `defaultValue` if you do not need to control the state of a toggle group.
       */
      defaultValue?: string[];
      /**
       * The callback that fires when the state of the toggle group changes.
       */
      onValueChange?(value: string[]): void;
  }
  type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
  type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
  interface ToggleGroupImplProps extends PrimitiveDivProps {
      /**
       * Whether the group is disabled from user interaction.
       * @defaultValue false
       */
      disabled?: boolean;
      /**
       * Whether the group should maintain roving focus of its buttons.
       * @defaultValue true
       */
      rovingFocus?: boolean;
      loop?: RovingFocusGroupProps['loop'];
      orientation?: RovingFocusGroupProps['orientation'];
      dir?: RovingFocusGroupProps['dir'];
  }
  interface ToggleGroupItemProps extends Omit<ToggleGroupItemImplProps, 'pressed'> {
  }
  declare const ToggleGroupItem: React.ForwardRefExoticComponent<ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  type ToggleProps = React.ComponentPropsWithoutRef<typeof Toggle>;
  interface ToggleGroupItemImplProps extends Omit<ToggleProps, 'defaultPressed' | 'onPressedChange'> {
      /**
       * A string value for the toggle group item. All items within a toggle group should use a unique value.
       */
      value: string;
  }
  declare const Root: React.ForwardRefExoticComponent<(ToggleGroupSingleProps | ToggleGroupMultipleProps) & React.RefAttributes<HTMLDivElement>>;
  declare const Item: React.ForwardRefExoticComponent<ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
  
  export { Item, Root, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupMultipleProps, type ToggleGroupSingleProps, createToggleGroupScope };