Skip to content

Commit 2fa39c9

Browse files
authored
Add Key type to monopackages (#5362)
1 parent 571e87e commit 2fa39c9

File tree

12 files changed

+20
-12
lines changed

12 files changed

+20
-12
lines changed

packages/@adobe/react-spectrum/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ export type {VisuallyHiddenAria, VisuallyHiddenProps} from '@react-aria/visually
111111
export type {DateFormatter, DateFormatterOptions, Filter, FormatMessage, Locale, LocalizedStrings} from '@react-aria/i18n';
112112
export type {SSRProviderProps} from '@react-aria/ssr';
113113
export type {DirectoryDropItem, DragAndDropHooks, DragAndDropOptions, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem} from '@react-spectrum/dnd';
114-
export type {Selection} from '@react-types/shared';
114+
export type {Key, Selection} from '@react-types/shared';

packages/@react-spectrum/actiongroup/docs/ActionGroup.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ The `key` prop from the selected item will be passed into the callback.
213213

214214
To continue to capturing actions when `selectionMode` is `none`, utilize the `onAction` prop.
215215
```tsx example
216-
import {Key} from '@react-types/shared';
216+
import type {Key} from '@adobe/react-spectrum';
217+
217218
function Example() {
218219
let [actionKey, setActionKey] = React.useState<Key>('');
219220
return (

packages/@react-spectrum/combobox/docs/ComboBox.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ Setting a selected option can be done by using the `defaultSelectedKey` or `sele
260260
Additionally, see the `react-stately` [Selection docs](../react-stately/selection.html#selected-key-data-type) for caveats regarding selection prop typing.
261261

262262
```tsx example
263-
import {Key} from '@react-types/shared';
263+
import type {Key} from '@adobe/react-spectrum';
264+
264265
function Example() {
265266
let options = [
266267
{id: 1, name: 'Adobe Photoshop'},

packages/@react-spectrum/picker/docs/Picker.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ Setting a selected option can be done by using the `defaultSelectedKey` or `sele
119119
Additionally see the `react-stately` [Selection docs](../react-stately/selection.html#selected-key-data-type) for caveats regarding selection prop typing.
120120

121121
```tsx example
122-
import {Key} from '@react-types/shared';
122+
import type {Key} from '@adobe/react-spectrum';
123+
123124
function Example() {
124125
let options = [
125126
{name: 'Koala'},

packages/@react-spectrum/tabs/docs/Tabs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ Each item accepts a key prop, which is passed to the `onSelectionChange` handler
7575
See the [Events](#events) section for more detail on selection.
7676

7777
```tsx example
78-
import {Key} from '@react-types/shared';
78+
import type {Key} from '@adobe/react-spectrum';
79+
7980
function Example() {
8081
let tabs = [
8182
{id: 1, name: 'Founding of Rome', children: 'Arma virumque cano, Troiae qui primus ab oris.'},

packages/react-aria-components/docs/Breadcrumbs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ as shown below, can be used when the options come from an external data source s
179179
As seen below, an iterable list of options is passed to the Breadcrumbs using the `items` prop. A function provided as `children` of the `<Breadcrumbs>` is called to render each item. When a breadcrumb is pressed, the `onAction` event is triggered and the breadcrumbs array is updated.
180180

181181
```tsx example
182-
import {Key} from '@react-types/shared';
182+
import type {Key} from 'react-aria-components';
183+
183184
function Example() {
184185
let [breadcrumbs, setBreadcrumbs] = React.useState([
185186
{id: 1, label: 'Home'},

packages/react-aria-components/docs/ComboBox.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ is passed to the `onSelectionChange` handler to identify the selected item. Alte
414414
as shown in the example below, then this is used automatically and an `id` prop is not required.
415415

416416
```tsx example
417-
import {Key} from '@react-types/shared';
417+
import type {Key} from 'react-aria-components';
418+
418419
function Example() {
419420
let options = [
420421
{id: 1, name: 'Aerospace'},

packages/react-aria-components/docs/Select.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@ When `Select` is used with a dynamic collection as described above, the id of ea
445445
See the `react-stately` [Selection docs](../react-stately/selection.html) for more details.
446446

447447
```tsx example
448-
import {Key} from '@react-types/shared';
448+
import type {Key} from 'react-aria-components';
449+
449450
function Example() {
450451
let options = [
451452
{name: 'Koala'},

packages/react-aria-components/docs/Tabs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ See the `react-stately` [Selection docs](../react-stately/selection.html) for mo
240240
Selection can be controlled using the `selectedKey` prop, paired with the `onSelectionChange` event. The `id` prop from the selected tab will be passed into the callback when the tab is selected, allowing you to update state accordingly.
241241

242242
```tsx example
243-
import {Key} from '@react-types/shared';
243+
import type {Key} from 'react-aria-components';
244+
244245
function Example() {
245246
let [timePeriod, setTimePeriod] = React.useState<Key>('triassic');
246247

packages/react-aria-components/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,5 @@ export type {ContextValue, SlotProps} from './utils';
107107

108108
export type {DateValue, DateRange, TimeValue} from 'react-aria';
109109
export type {DirectoryDropItem, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem, PressEvent} from 'react-aria';
110-
export type {Selection, SortDescriptor, SortDirection, SelectionMode} from 'react-stately';
110+
export type {Key, Selection, SortDescriptor, SortDirection, SelectionMode} from 'react-stately';
111111
export type {ValidationResult} from '@react-types/shared';

0 commit comments

Comments
 (0)