@react-types/tabs 3.3.22 → 3.4.0

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 +8 -4
  2. package/src/index.d.ts +3 -86
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/tabs",
3
- "version": "3.3.22",
3
+ "version": "3.4.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,13 +9,17 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-types/shared": "^3.33.1"
12
+ "@react-aria/tabs": "^3.12.0",
13
+ "@react-spectrum/tabs": "^3.9.0",
14
+ "@react-stately/tabs": "^3.9.0"
13
15
  },
14
16
  "peerDependencies": {
15
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
17
+ "@react-spectrum/provider": "^3.0.0",
18
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
19
+ "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
16
20
  },
17
21
  "publishConfig": {
18
22
  "access": "public"
19
23
  },
20
- "gitHead": "8df187370053aa35f553cb388ad670f65e1ab371"
24
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
21
25
  }
package/src/index.d.ts CHANGED
@@ -10,89 +10,6 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {
14
- AriaLabelingProps, CollectionBase,
15
- CollectionChildren,
16
- DOMProps,
17
- Key,
18
- Orientation,
19
- SingleSelection,
20
- StyleProps
21
- } from '@react-types/shared';
22
- import {ReactNode} from 'react';
23
-
24
- export interface AriaTabProps extends AriaLabelingProps {
25
- /** The key of the tab. */
26
- key: Key,
27
- /** Whether the tab should be disabled. */
28
- isDisabled?: boolean,
29
- /** Whether the tab selection should occur on press up instead of press down. */
30
- shouldSelectOnPressUp?: boolean
31
- }
32
-
33
- export interface TabListProps<T> extends CollectionBase<T>, Omit<SingleSelection, 'disallowEmptySelection' | 'selectedKey' | 'defaultSelectedKeys' | 'onSelectionChange'> {
34
- /**
35
- * Whether the TabList is disabled.
36
- * Shows that a selection exists, but is not available in that circumstance.
37
- */
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,
43
- /** Handler that is called when the selection changes. */
44
- onSelectionChange?: (key: Key) => void
45
- }
46
-
47
- interface AriaTabListBase extends AriaLabelingProps {
48
- /**
49
- * Whether tabs are activated automatically on focus or manually.
50
- * @default 'automatic'
51
- */
52
- keyboardActivation?: 'automatic' | 'manual',
53
- /**
54
- * The orientation of the tabs.
55
- * @default 'horizontal'
56
- */
57
- orientation?: Orientation
58
- }
59
-
60
- export interface AriaTabListProps<T> extends TabListProps<T>, AriaTabListBase, DOMProps, AriaLabelingProps {}
61
-
62
- export interface AriaTabPanelProps extends Omit<DOMProps, 'id'>, AriaLabelingProps {
63
- /** The unique id of the tab. */
64
- id?: Key
65
- }
66
-
67
- export interface SpectrumTabsProps<T> extends AriaTabListBase, Omit<SingleSelection, 'disallowEmptySelection' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange'>, DOMProps, StyleProps {
68
- /** The children of the `<Tabs>` element. Should include `<TabList>` and `<TabPanels>` elements. */
69
- children: ReactNode,
70
- /** The item objects for each tab, for dynamic collections. */
71
- items?: Iterable<T>,
72
- /** The keys of the tabs that are disabled. These tabs cannot be selected, focused, or otherwise interacted with. */
73
- disabledKeys?: Iterable<Key>,
74
- /** Whether the Tabs are disabled. */
75
- isDisabled?: boolean,
76
- /** Whether the tabs are displayed in a quiet style. */
77
- isQuiet?: boolean,
78
- /** Whether the tabs are displayed in an emphasized style. */
79
- isEmphasized?: boolean,
80
- /** The amount of space between the tabs. */
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,
86
- /** Handler that is called when the selection changes. */
87
- onSelectionChange?: (key: Key) => void
88
- }
89
-
90
- export interface SpectrumTabListProps<T> extends DOMProps, StyleProps {
91
- /** The tab items to display. Item keys should match the key of the corresponding `<Item>` within the `<TabPanels>` element. */
92
- children: CollectionChildren<T>
93
- }
94
-
95
- export interface SpectrumTabPanelsProps<T> extends DOMProps, StyleProps {
96
- /** The contents of each tab. Item keys should match the key of the corresponding `<Item>` within the `<TabList>` element. */
97
- children: CollectionChildren<T>
98
- }
13
+ export {TabListProps} from '@react-stately/tabs';
14
+ export {AriaTabListProps, AriaTabProps, AriaTabPanelProps} from '@react-aria/tabs';
15
+ export {SpectrumTabsProps, SpectrumTabListProps, SpectrumTabPanelsProps} from '@react-spectrum/tabs';