@react-types/tabs 3.3.21 → 3.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.d.ts +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/tabs",
3
- "version": "3.3.21",
3
+ "version": "3.3.22",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.33.0"
12
+ "@react-types/shared": "^3.33.1"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
20
+ "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
21
21
  }
package/src/index.d.ts CHANGED
@@ -30,12 +30,16 @@ export interface AriaTabProps extends AriaLabelingProps {
30
30
  shouldSelectOnPressUp?: boolean
31
31
  }
32
32
 
33
- export interface TabListProps<T> extends CollectionBase<T>, Omit<SingleSelection, 'disallowEmptySelection' | 'onSelectionChange'> {
33
+ export interface TabListProps<T> extends CollectionBase<T>, Omit<SingleSelection, 'disallowEmptySelection' | 'selectedKey' | 'defaultSelectedKeys' | 'onSelectionChange'> {
34
34
  /**
35
35
  * Whether the TabList is disabled.
36
36
  * Shows that a selection exists, but is not available in that circumstance.
37
37
  */
38
38
  isDisabled?: boolean,
39
+ /** The currently selected key in the collection (controlled). */
40
+ selectedKey?: Key,
41
+ /** The initial selected keys in the collection (uncontrolled). */
42
+ defaultSelectedKey?: Key,
39
43
  /** Handler that is called when the selection changes. */
40
44
  onSelectionChange?: (key: Key) => void
41
45
  }
@@ -60,7 +64,7 @@ export interface AriaTabPanelProps extends Omit<DOMProps, 'id'>, AriaLabelingPro
60
64
  id?: Key
61
65
  }
62
66
 
63
- export interface SpectrumTabsProps<T> extends AriaTabListBase, Omit<SingleSelection, 'onSelectionChange' | 'disallowEmptySelection'>, DOMProps, StyleProps {
67
+ export interface SpectrumTabsProps<T> extends AriaTabListBase, Omit<SingleSelection, 'disallowEmptySelection' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange'>, DOMProps, StyleProps {
64
68
  /** The children of the `<Tabs>` element. Should include `<TabList>` and `<TabPanels>` elements. */
65
69
  children: ReactNode,
66
70
  /** The item objects for each tab, for dynamic collections. */
@@ -75,6 +79,10 @@ export interface SpectrumTabsProps<T> extends AriaTabListBase, Omit<SingleSelect
75
79
  isEmphasized?: boolean,
76
80
  /** The amount of space between the tabs. */
77
81
  density?: 'compact' | 'regular',
82
+ /** The currently selected key in the collection (controlled). */
83
+ selectedKey?: Key,
84
+ /** The initial selected keys in the collection (uncontrolled). */
85
+ defaultSelectedKey?: Key,
78
86
  /** Handler that is called when the selection changes. */
79
87
  onSelectionChange?: (key: Key) => void
80
88
  }