@octanejs/aria 0.0.48 → 0.0.50

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 (154) hide show
  1. package/package.json +4 -4
  2. package/src/calendar/useCalendar.tsx +3 -3
  3. package/src/calendar/useCalendarBase.tsx +4 -4
  4. package/src/calendar/useCalendarCell.tsx +3 -3
  5. package/src/calendar/useCalendarGrid.tsx +3 -3
  6. package/src/calendar/useCalendarHeading.tsx +3 -3
  7. package/src/calendar/useCalendarMonthPicker.tsx +3 -3
  8. package/src/calendar/useCalendarYearPicker.tsx +3 -3
  9. package/src/calendar/useRangeCalendar.tsx +4 -4
  10. package/src/calendar/utils.tsx +2 -2
  11. package/src/collections/CollectionBuilder.ts +7 -7
  12. package/src/collections/Hidden.ts +1 -1
  13. package/src/color/useColorArea.tsx +5 -5
  14. package/src/color/useColorAreaGradient.tsx +3 -3
  15. package/src/color/useColorChannelField.tsx +3 -3
  16. package/src/color/useColorField.tsx +5 -5
  17. package/src/color/useColorSlider.tsx +3 -3
  18. package/src/color/useColorSwatch.tsx +3 -3
  19. package/src/color/useColorWheel.tsx +8 -3
  20. package/src/combobox/useComboBox.tsx +7 -7
  21. package/src/components/Breadcrumbs.ts +2 -2
  22. package/src/components/Button.ts +1 -1
  23. package/src/components/Calendar.tsx +27 -29
  24. package/src/components/Checkbox.ts +1 -1
  25. package/src/components/ColorArea.tsx +8 -8
  26. package/src/components/ColorField.tsx +14 -14
  27. package/src/components/ColorPicker.tsx +7 -7
  28. package/src/components/ColorSlider.tsx +9 -9
  29. package/src/components/ColorSwatch.tsx +8 -8
  30. package/src/components/ColorSwatchPicker.tsx +16 -11
  31. package/src/components/ColorThumb.tsx +6 -6
  32. package/src/components/ColorWheel.tsx +13 -10
  33. package/src/components/ComboBox.ts +1 -1
  34. package/src/components/DateField.tsx +19 -19
  35. package/src/components/DatePicker.tsx +17 -14
  36. package/src/components/Disclosure.ts +1 -1
  37. package/src/components/DropZone.tsx +7 -7
  38. package/src/components/FileTrigger.tsx +2 -2
  39. package/src/components/Form.ts +2 -2
  40. package/src/components/GridLayout.tsx +2 -2
  41. package/src/components/HiddenDateInput.tsx +3 -3
  42. package/src/components/ListBox.ts +1 -1
  43. package/src/components/Meter.ts +1 -1
  44. package/src/components/Popover.ts +3 -3
  45. package/src/components/PreviewTrigger.tsx +4 -4
  46. package/src/components/ProgressBar.ts +1 -1
  47. package/src/components/RadioGroup.ts +1 -1
  48. package/src/components/Select.ts +1 -1
  49. package/src/components/SharedElementTransition.ts +1 -1
  50. package/src/components/Table.ts +3 -3
  51. package/src/components/TableLayout.tsx +2 -2
  52. package/src/components/Tabs.ts +2 -2
  53. package/src/components/TagGroup.ts +1 -1
  54. package/src/components/Toast.tsx +17 -17
  55. package/src/components/ToggleButton.ts +1 -1
  56. package/src/components/ToggleButtonGroup.ts +1 -1
  57. package/src/components/TokenField.tsx +13 -13
  58. package/src/components/Tooltip.ts +1 -1
  59. package/src/components/Tree.ts +1 -1
  60. package/src/components/Virtualizer.tsx +18 -12
  61. package/src/components/useDragAndDrop.tsx +16 -16
  62. package/src/components/utils.ts +2 -2
  63. package/src/datepicker/useDateField.tsx +5 -5
  64. package/src/datepicker/useDatePicker.tsx +5 -5
  65. package/src/datepicker/useDatePickerGroup.tsx +4 -4
  66. package/src/datepicker/useDateRangePicker.tsx +6 -6
  67. package/src/datepicker/useDateSegment.tsx +6 -3
  68. package/src/dnd/DragManager.tsx +2 -2
  69. package/src/dnd/DragPreview.tsx +3 -3
  70. package/src/dnd/DropTargetKeyboardNavigation.tsx +1 -1
  71. package/src/dnd/ListDropTargetDelegate.tsx +1 -1
  72. package/src/dnd/constants.tsx +1 -1
  73. package/src/dnd/useAutoScroll.tsx +1 -1
  74. package/src/dnd/useClipboard.tsx +1 -1
  75. package/src/dnd/useDrag.tsx +7 -7
  76. package/src/dnd/useDraggableCollection.tsx +2 -2
  77. package/src/dnd/useDraggableItem.tsx +4 -4
  78. package/src/dnd/useDrop.tsx +3 -3
  79. package/src/dnd/useDropIndicator.tsx +3 -3
  80. package/src/dnd/useDroppableCollection.tsx +3 -3
  81. package/src/dnd/useDroppableItem.tsx +3 -3
  82. package/src/dnd/useVirtualDrop.tsx +2 -2
  83. package/src/dnd/utils.tsx +2 -2
  84. package/src/focus/FocusScope.ts +1 -1
  85. package/src/grid/useGridCell.tsx +4 -4
  86. package/src/gridlist/useGridListItem.tsx +13 -3
  87. package/src/i18n/I18nProvider.ts +2 -2
  88. package/src/interactions/PressResponder.ts +2 -2
  89. package/src/interactions/context.ts +1 -1
  90. package/src/interactions/useContextMenu.tsx +1 -1
  91. package/src/interactions/useFocusable.ts +1 -1
  92. package/src/landmark/useLandmark.tsx +6 -1
  93. package/src/menu/useMenuTrigger.tsx +5 -5
  94. package/src/menu/useSubmenuTrigger.tsx +9 -3
  95. package/src/numberfield/useNumberField.tsx +6 -6
  96. package/src/overlays/Overlay.ts +2 -2
  97. package/src/overlays/PortalProvider.ts +1 -1
  98. package/src/overlays/useModal.ts +1 -1
  99. package/src/overlays/useOverlay.tsx +1 -1
  100. package/src/radio/useRadioGroup.tsx +2 -2
  101. package/src/searchfield/useSearchField.tsx +5 -5
  102. package/src/selection/useSelectableCollection.tsx +3 -3
  103. package/src/slider/useSliderThumb.tsx +5 -5
  104. package/src/spinbutton/useSpinButton.tsx +2 -2
  105. package/src/stately/calendar/types.tsx +3 -3
  106. package/src/stately/calendar/useCalendarState.tsx +5 -5
  107. package/src/stately/calendar/useRangeCalendarState.tsx +5 -5
  108. package/src/stately/calendar/utils.tsx +2 -2
  109. package/src/stately/color/Color.tsx +1 -1
  110. package/src/stately/color/useColor.tsx +1 -1
  111. package/src/stately/color/useColorAreaState.tsx +2 -2
  112. package/src/stately/color/useColorChannelFieldState.tsx +3 -3
  113. package/src/stately/color/useColorFieldState.tsx +3 -3
  114. package/src/stately/color/useColorPickerState.tsx +2 -2
  115. package/src/stately/color/useColorSliderState.tsx +2 -2
  116. package/src/stately/color/useColorWheelState.tsx +2 -2
  117. package/src/stately/data/useAsyncList.tsx +2 -2
  118. package/src/stately/data/useListData.tsx +1 -1
  119. package/src/stately/data/useTreeData.tsx +1 -1
  120. package/src/stately/datepicker/IncompleteDate.tsx +8 -3
  121. package/src/stately/datepicker/types.tsx +3 -3
  122. package/src/stately/datepicker/useDateFieldState.tsx +7 -7
  123. package/src/stately/datepicker/useDatePickerState.tsx +9 -6
  124. package/src/stately/datepicker/useDateRangePickerState.tsx +9 -6
  125. package/src/stately/datepicker/useTimeFieldState.tsx +2 -2
  126. package/src/stately/datepicker/utils.tsx +3 -3
  127. package/src/stately/dnd/useDraggableCollectionState.tsx +2 -2
  128. package/src/stately/dnd/useDroppableCollectionState.tsx +2 -2
  129. package/src/stately/layout/GridLayout.tsx +8 -2
  130. package/src/stately/layout/ListLayout.tsx +2 -2
  131. package/src/stately/layout/TableLayout.tsx +5 -5
  132. package/src/stately/layout/WaterfallLayout.tsx +8 -2
  133. package/src/stately/tokenfield/useTokenFieldState.tsx +1 -1
  134. package/src/stately/virtualizer/Layout.tsx +2 -2
  135. package/src/stately/virtualizer/LayoutInfo.tsx +1 -1
  136. package/src/stately/virtualizer/ReusableView.tsx +1 -1
  137. package/src/stately/virtualizer/ScrollAnchor.tsx +2 -2
  138. package/src/stately/virtualizer/Virtualizer.tsx +3 -3
  139. package/src/stately/virtualizer/types.tsx +1 -1
  140. package/src/stately/virtualizer/useVirtualizerState.tsx +2 -2
  141. package/src/table/useTableColumnResize.tsx +5 -5
  142. package/src/toast/useToast.tsx +8 -3
  143. package/src/toast/useToastRegion.tsx +7 -2
  144. package/src/tokenfield/useToken.tsx +1 -1
  145. package/src/tokenfield/useTokenField.tsx +8 -8
  146. package/src/tooltip/usePreviewTrigger.tsx +3 -3
  147. package/src/tooltip/useSafeArea.tsx +1 -1
  148. package/src/utils/openLink.ts +1 -1
  149. package/src/utils/useLoadMore.tsx +1 -1
  150. package/src/virtualizer/ScrollView.tsx +5 -5
  151. package/src/virtualizer/Virtualizer.tsx +5 -5
  152. package/src/virtualizer/VirtualizerItem.tsx +3 -3
  153. package/src/virtualizer/useVirtualizerItem.tsx +1 -1
  154. package/src/virtualizer/utils.tsx +1 -1
@@ -12,9 +12,9 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { DraggableCollectionState } from '../upstream-exports/react-stately/useDraggableCollectionState';
15
+ import type { DraggableCollectionState } from '../upstream-exports/react-stately/useDraggableCollectionState';
16
16
  import { globalDndState, setDraggingCollectionRef } from './utils';
17
- import { RefObject } from '@react-types/shared';
17
+ import type { RefObject } from '@react-types/shared';
18
18
 
19
19
  export interface DraggableCollectionOptions {}
20
20
 
@@ -12,17 +12,17 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { AriaButtonProps } from '../button/useButton';
15
+ import type { AriaButtonProps } from '../button/useButton';
16
16
  import {
17
17
  clearGlobalDnDState,
18
18
  isInternalDropOperation,
19
19
  setDraggingKeys,
20
20
  useDragModality,
21
21
  } from './utils';
22
- import { DraggableCollectionState } from '../upstream-exports/react-stately/useDraggableCollectionState';
23
- import { HTMLAttributes, KeyboardEvent } from '../compat/react';
22
+ import type { DraggableCollectionState } from '../upstream-exports/react-stately/useDraggableCollectionState';
23
+ import type { HTMLAttributes, KeyboardEvent } from '../compat/react';
24
24
  import intlMessages from '../intl/dnd/index';
25
- import { Key } from '@react-types/shared';
25
+ import type { Key } from '@react-types/shared';
26
26
  import { useDescription } from '../utils/useDescription';
27
27
  import { useDrag } from './useDrag';
28
28
  import { useLocalizedStringFormatter } from '../i18n/useLocalizedStringFormatter';
@@ -12,9 +12,9 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { AriaButtonProps } from '../button/useButton';
15
+ import type { AriaButtonProps } from '../button/useButton';
16
16
 
17
- import {
17
+ import type {
18
18
  DOMAttributes,
19
19
  DropActivateEvent,
20
20
  DropEnterEvent,
@@ -26,7 +26,7 @@ import {
26
26
  DragTypes as IDragTypes,
27
27
  RefObject,
28
28
  } from '@react-types/shared';
29
- import { DragEvent, useRef, useState } from '../compat/react';
29
+ import { type DragEvent, useRef, useState } from '../compat/react';
30
30
  import * as DragManager from './DragManager';
31
31
  import {
32
32
  DragTypes,
@@ -13,10 +13,10 @@
13
13
  */
14
14
 
15
15
  import * as DragManager from './DragManager';
16
- import { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
17
- import { DropTarget, FocusableElement, Key, RefObject } from '@react-types/shared';
16
+ import type { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
17
+ import type { DropTarget, FocusableElement, Key, RefObject } from '@react-types/shared';
18
18
  import { getDroppableCollectionId } from './utils';
19
- import { HTMLAttributes } from '../compat/react';
19
+ import type { HTMLAttributes } from '../compat/react';
20
20
  import intlMessages from '../intl/dnd/index';
21
21
  import { useDroppableItem } from './useDroppableItem';
22
22
  import { useId } from '../utils/useId';
@@ -21,7 +21,7 @@ import {
21
21
  isInternalDropOperation,
22
22
  setDropCollectionRef,
23
23
  } from './utils';
24
- import {
24
+ import type {
25
25
  Collection,
26
26
  DropEvent,
27
27
  DropOperation,
@@ -36,8 +36,8 @@ import {
36
36
  RefObject,
37
37
  } from '@react-types/shared';
38
38
  import * as DragManager from './DragManager';
39
- import { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
40
- import { HTMLAttributes, useCallback, useEffect, useRef } from '../compat/react';
39
+ import type { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
40
+ import { type HTMLAttributes, useCallback, useEffect, useRef } from '../compat/react';
41
41
  import { mergeProps } from '../utils/mergeProps';
42
42
  import { navigate } from './DropTargetKeyboardNavigation';
43
43
  import { setInteractionModality } from '../interactions/useFocusVisible';
@@ -13,15 +13,15 @@
13
13
  */
14
14
 
15
15
  import * as DragManager from './DragManager';
16
- import { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
17
- import { DropTarget, FocusableElement, RefObject } from '@react-types/shared';
16
+ import type { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
17
+ import type { DropTarget, FocusableElement, RefObject } from '@react-types/shared';
18
18
  import {
19
19
  getDroppableCollectionRef,
20
20
  getTypes,
21
21
  globalDndState,
22
22
  isInternalDropOperation,
23
23
  } from './utils';
24
- import { HTMLAttributes, useEffect } from '../compat/react';
24
+ import { type HTMLAttributes, useEffect } from '../compat/react';
25
25
  import { useVirtualDrop } from './useVirtualDrop';
26
26
 
27
27
  export interface DroppableItemOptions {
@@ -12,8 +12,8 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { AriaButtonProps } from '../button/useButton';
16
- import { DOMAttributes } from '../compat/react';
15
+ import type { AriaButtonProps } from '../button/useButton';
16
+ import type { DOMAttributes } from '../compat/react';
17
17
  import * as DragManager from './DragManager';
18
18
  import intlMessages from '../intl/dnd/index';
19
19
  import { useDescription } from '../utils/useDescription';
package/src/dnd/utils.tsx CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import { CUSTOM_DRAG_TYPE, DROP_OPERATION, GENERIC_TYPE, NATIVE_DRAG_TYPES } from './constants';
16
- import {
16
+ import type {
17
17
  DirectoryDropItem,
18
18
  DragItem,
19
19
  DragType,
@@ -24,7 +24,7 @@ import {
24
24
  RefObject,
25
25
  TextDropItem,
26
26
  } from '@react-types/shared';
27
- import { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
27
+ import type { DroppableCollectionState } from '../upstream-exports/react-stately/useDroppableCollectionState';
28
28
  import { getInteractionModality, useInteractionModality } from '../interactions/useFocusVisible';
29
29
 
30
30
  interface DroppableCollectionMap {
@@ -238,7 +238,7 @@ export function FocusScope(props: FocusScopeProps): any {
238
238
  );
239
239
 
240
240
  return createElement(
241
- FocusContext.Provider,
241
+ FocusContext,
242
242
  { value },
243
243
  createElement('span', { 'data-focus-scope-start': true, hidden: true, ref: startRef }),
244
244
  children,
@@ -13,7 +13,7 @@ type DOMAttributes = Record<string, any>;
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- import { FocusableElement, Key, RefObject } from '@react-types/shared';
16
+ import type { FocusableElement, Key, RefObject } from '@react-types/shared';
17
17
  import { withSlot } from 'octane';
18
18
  import { focusSafely } from '../interactions/focusSafely';
19
19
  import {
@@ -25,15 +25,15 @@ import {
25
25
  import { getFocusableTreeWalker } from '../focus/FocusScope';
26
26
  import { getOwnerDocument } from '../utils/domHelpers';
27
27
  import { getScrollParent } from '../utils/getScrollParent';
28
- import {
28
+ import type {
29
29
  IGridCollection as GridCollection,
30
30
  GridNode,
31
31
  } from '../upstream-exports/react-stately/private/grid/GridCollection';
32
32
  import { gridMap } from './utils';
33
- import { GridState } from '../upstream-exports/react-stately/private/grid/useGridState';
33
+ import type { GridState } from '../upstream-exports/react-stately/private/grid/useGridState';
34
34
  import { isFocusVisible } from '../interactions/useFocusVisible';
35
35
  import { mergeProps } from '../utils/mergeProps';
36
- import { KeyboardEvent as ReactKeyboardEvent, useRef } from '../compat/react';
36
+ import { type KeyboardEvent as ReactKeyboardEvent, useRef } from '../compat/react';
37
37
  import { scrollIntoViewport } from '../utils/scrollIntoView';
38
38
  import { useLocale } from '../i18n/I18nProvider';
39
39
  import { useSelectableItem } from '../selection/useSelectableItem';
@@ -14,7 +14,13 @@ type DOMAttributes = Record<string, any>;
14
14
  */
15
15
 
16
16
  import { chain } from '../utils/chain';
17
- import { Collection, FocusableElement, Key, RefObject, Node as RSNode } from '@react-types/shared';
17
+ import type {
18
+ Collection,
19
+ FocusableElement,
20
+ Key,
21
+ RefObject,
22
+ Node as RSNode,
23
+ } from '@react-types/shared';
18
24
  import { focusSafely } from '../interactions/focusSafely';
19
25
  import {
20
26
  getActiveElement,
@@ -26,13 +32,17 @@ import { getFocusableTreeWalker } from '../focus/FocusScope';
26
32
  import { getOwnerDocument } from '../utils/domHelpers';
27
33
  import { getRowId, listMap } from './utils';
28
34
  import { getScrollParent } from '../utils/getScrollParent';
29
- import { HTMLAttributes, KeyboardEvent as ReactKeyboardEvent, useRef } from '../compat/react';
35
+ import {
36
+ type HTMLAttributes,
37
+ type KeyboardEvent as ReactKeyboardEvent,
38
+ useRef,
39
+ } from '../compat/react';
30
40
  import { withSlot } from 'octane';
31
41
  import { isFocusVisible } from '../interactions/useFocusVisible';
32
42
  import type { ListState } from '../upstream-exports/react-stately/useListState';
33
43
  import { mergeProps } from '../utils/mergeProps';
34
44
  import { scrollIntoViewport } from '../utils/scrollIntoView';
35
- import { SelectableItemStates, useSelectableItem } from '../selection/useSelectableItem';
45
+ import { type SelectableItemStates, useSelectableItem } from '../selection/useSelectableItem';
36
46
  import type { TreeState } from '../upstream-exports/react-stately/useTreeState';
37
47
  import { useLocale } from '../i18n/I18nProvider';
38
48
  import { useSlotId } from '../utils/useId';
@@ -48,7 +48,7 @@ function I18nProviderWithLocale(props: I18nProviderWithLocaleProps): any {
48
48
  subSlot(slot, 'value'),
49
49
  );
50
50
 
51
- return createElement(I18nContext.Provider, { value, children });
51
+ return createElement(I18nContext, { value, children });
52
52
  }
53
53
 
54
54
  interface I18nProviderWithDefaultLocaleProps {
@@ -63,7 +63,7 @@ function I18nProviderWithDefaultLocale(props: I18nProviderWithDefaultLocaleProps
63
63
  let { children } = props;
64
64
  let defaultLocale = useDefaultLocale(subSlot(slot, 'default'));
65
65
 
66
- return createElement(I18nContext.Provider, { value: defaultLocale, children });
66
+ return createElement(I18nContext, { value: defaultLocale, children });
67
67
  }
68
68
 
69
69
  /**
@@ -44,11 +44,11 @@ export function PressResponder(allProps: PressResponderProps): any {
44
44
  context.ref = useObjectRef(ref || prevContext?.ref, subSlot(slot, 'ref'));
45
45
  useSyncRef(prevContext, context.ref, subSlot(slot, 'sync'));
46
46
 
47
- return createElement(PressResponderContext.Provider, { value: context, children });
47
+ return createElement(PressResponderContext, { value: context, children });
48
48
  }
49
49
 
50
50
  export function ClearPressResponder({ children }: { children: any }): any {
51
51
  const slot = S('ClearPressResponder');
52
52
  let context = useMemo(() => ({ register: () => {} }), [], subSlot(slot, 'context'));
53
- return createElement(PressResponderContext.Provider, { value: context as any, children });
53
+ return createElement(PressResponderContext, { value: context as any, children });
54
54
  }
@@ -1,6 +1,6 @@
1
1
  // Ported from react-aria (source: .react-spectrum/packages/react-aria/src/interactions/context.ts).
2
2
  // octane adaptations: React.createContext → octane createContext (octane's Context is
3
- // callable-as-Provider, `.Provider` stays as an identity alias, so consumers are unchanged);
3
+ // is itself the provider component);
4
4
  // React's MutableRefObject type → a local structural alias; `displayName` is stamped through
5
5
  // a cast (octane's Context type doesn't declare it, but the runtime reads it for diagnostics).
6
6
  import type { FocusableElement } from '@react-types/shared';
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { HTMLAttributes, useRef } from '../compat/react';
15
+ import { type HTMLAttributes, useRef } from '../compat/react';
16
16
  import { isIOS, isMac } from '../utils/platform';
17
17
  import { mergeProps } from '../utils/mergeProps';
18
18
  import { useLongPress } from './useLongPress';
@@ -90,7 +90,7 @@ export function FocusableProvider(
90
90
  ref: objRef,
91
91
  };
92
92
 
93
- return createElement(FocusableContext.Provider, { value: context, children });
93
+ return createElement(FocusableContext, { value: context, children });
94
94
  }
95
95
 
96
96
  export interface FocusableAria {
@@ -12,7 +12,12 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { AriaLabelingProps, DOMAttributes, FocusableElement, RefObject } from '@react-types/shared';
15
+ import type {
16
+ AriaLabelingProps,
17
+ DOMAttributes,
18
+ FocusableElement,
19
+ RefObject,
20
+ } from '@react-types/shared';
16
21
  import { getEventTarget, nodeContains } from '../utils/shadowdom/DOMFunctions';
17
22
  import { useCallback, useEffect, useState } from '../compat/react';
18
23
  import { useLayoutEffect } from '../utils/useLayoutEffect';
@@ -14,18 +14,18 @@ type KeyboardEvent = BaseEvent<globalThis.KeyboardEvent>;
14
14
  * governing permissions and limitations under the License.
15
15
  */
16
16
 
17
- import { AriaButtonProps } from '../button/useButton';
17
+ import type { AriaButtonProps } from '../button/useButton';
18
18
  import { withSlot } from 'octane';
19
- import { AriaMenuOptions } from './useMenu';
20
- import { FocusableElement, FocusStrategy, RefObject } from '@react-types/shared';
19
+ import type { AriaMenuOptions } from './useMenu';
20
+ import type { FocusableElement, FocusStrategy, RefObject } from '@react-types/shared';
21
21
  import { focusWithoutScrolling } from '../utils/focusWithoutScrolling';
22
22
  import { getEventTarget } from '../utils/shadowdom/DOMFunctions';
23
23
  import intlMessages from '../intl/menu/index';
24
- import {
24
+ import type {
25
25
  MenuTriggerState,
26
26
  MenuTriggerType,
27
27
  } from '../upstream-exports/react-stately/useMenuTriggerState';
28
- import { PressProps } from '../interactions/usePress';
28
+ import type { PressProps } from '../interactions/usePress';
29
29
  import { useContextMenu } from '../interactions/useContextMenu';
30
30
  import { useEffect } from '../compat/react';
31
31
  import { useId } from '../utils/useId';
@@ -12,11 +12,17 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { AriaMenuItemProps } from './useMenuItem';
15
+ import type { AriaMenuItemProps } from './useMenuItem';
16
16
  import { withSlot } from 'octane';
17
- import { AriaMenuOptions } from './useMenu';
17
+ import type { AriaMenuOptions } from './useMenu';
18
18
  import type { AriaPopoverProps } from '../overlays/usePopover';
19
- import { FocusableElement, FocusStrategy, Node, PressEvent, RefObject } from '@react-types/shared';
19
+ import type {
20
+ FocusableElement,
21
+ FocusStrategy,
22
+ Node,
23
+ PressEvent,
24
+ RefObject,
25
+ } from '@react-types/shared';
20
26
  import { focusWithoutScrolling } from '../utils/focusWithoutScrolling';
21
27
  import {
22
28
  getActiveElement,
@@ -25,8 +25,8 @@ type DOMAttributes = Record<string, any>;
25
25
  */
26
26
 
27
27
  import { announce } from '../live-announcer/LiveAnnouncer';
28
- import { AriaButtonProps } from '../button/useButton';
29
- import {
28
+ import type { AriaButtonProps } from '../button/useButton';
29
+ import type {
30
30
  AriaLabelingProps,
31
31
  DOMProps,
32
32
  GroupDOMAttributes,
@@ -34,9 +34,9 @@ import {
34
34
  ValidationResult,
35
35
  } from '@react-types/shared';
36
36
  import {
37
- InputHTMLAttributes,
38
- LabelHTMLAttributes,
39
- RefObject,
37
+ type InputHTMLAttributes,
38
+ type LabelHTMLAttributes,
39
+ type RefObject,
40
40
  useCallback,
41
41
  useMemo,
42
42
  useState,
@@ -47,7 +47,7 @@ import { getActiveElement, getEventTarget } from '../utils/shadowdom/DOMFunction
47
47
  import intlMessages from '../intl/numberfield/index';
48
48
  import { isAndroid, isIOS, isIPhone } from '../utils/platform';
49
49
  import { mergeProps } from '../utils/mergeProps';
50
- import {
50
+ import type {
51
51
  NumberFieldProps,
52
52
  NumberFieldState,
53
53
  } from '../upstream-exports/react-stately/useNumberFieldState';
@@ -80,9 +80,9 @@ export function Overlay(props: OverlayProps): any {
80
80
  });
81
81
  }
82
82
 
83
- contents = createElement(OverlayContext.Provider, {
83
+ contents = createElement(OverlayContext, {
84
84
  value: contextValue as OverlayContextValue,
85
- children: createElement(FocusableContext.Provider, {
85
+ children: createElement(FocusableContext, {
86
86
  value: null,
87
87
  children: createElement(ClearPressResponder, { children: contents }),
88
88
  }),
@@ -24,7 +24,7 @@ export const PortalContext = createContext<PortalProviderContextValue>({});
24
24
  export function UNSAFE_PortalProvider(props: PortalProviderProps): any {
25
25
  let { getContainer } = props;
26
26
  let { getContainer: ctxGetContainer } = useUNSAFE_PortalContext();
27
- return createElement(PortalContext.Provider, {
27
+ return createElement(PortalContext, {
28
28
  value: {
29
29
  getContainer: getContainer === null ? undefined : (getContainer ?? ctxGetContainer),
30
30
  },
@@ -71,7 +71,7 @@ export function ModalProvider(props: ModalProviderProps): any {
71
71
  subSlot(slot, 'context'),
72
72
  );
73
73
 
74
- return createElement(Context.Provider, { value: context, children });
74
+ return createElement(Context, { value: context, children });
75
75
  }
76
76
 
77
77
  export interface ModalProviderAria {
@@ -13,7 +13,7 @@ type DOMAttributes = Record<string, any>;
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- import { RefObject } from '@react-types/shared';
16
+ import type { RefObject } from '@react-types/shared';
17
17
  import { withSlot } from 'octane';
18
18
  import { getEventTarget } from '../utils/shadowdom/DOMFunctions';
19
19
  import { isElementInChildOfActiveScope } from '../focus/FocusScope';
@@ -13,7 +13,7 @@ type DOMAttributes = Record<string, any>;
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- import {
16
+ import type {
17
17
  AriaLabelingProps,
18
18
  AriaValidationProps,
19
19
  DOMProps,
@@ -27,7 +27,7 @@ import { getFocusableTreeWalker } from '../focus/FocusScope';
27
27
  import { getOwnerWindow } from '../utils/domHelpers';
28
28
  import { mergeProps } from '../utils/mergeProps';
29
29
  import { radioGroupData } from './utils';
30
- import {
30
+ import type {
31
31
  RadioGroupProps,
32
32
  RadioGroupState,
33
33
  } from '../upstream-exports/react-stately/useRadioGroupState';
@@ -13,15 +13,15 @@ type DOMAttributes = Record<string, any>;
13
13
  * governing permissions and limitations under the License.
14
14
  */
15
15
 
16
- import { AriaButtonProps } from '../button/useButton';
16
+ import type { AriaButtonProps } from '../button/useButton';
17
17
  import { withSlot } from 'octane';
18
- import { AriaTextFieldProps, useTextField } from '../textfield/useTextField';
19
- import { RefObject, ValidationResult } from '@react-types/shared';
20
- import { InputHTMLAttributes, LabelHTMLAttributes } from '../compat/react';
18
+ import { type AriaTextFieldProps, useTextField } from '../textfield/useTextField';
19
+ import type { RefObject, ValidationResult } from '@react-types/shared';
20
+ import type { InputHTMLAttributes, LabelHTMLAttributes } from '../compat/react';
21
21
  import intlMessages from '../intl/searchfield/index';
22
22
  // @ts-ignore
23
23
  import { mergeProps } from '../utils/mergeProps';
24
- import {
24
+ import type {
25
25
  SearchFieldProps,
26
26
  SearchFieldState,
27
27
  } from '../upstream-exports/react-stately/useSearchFieldState';
@@ -18,7 +18,7 @@ type DOMAttributes = Record<string, any>;
18
18
  import { CLEAR_FOCUS_EVENT, FOCUS_EVENT } from '../utils/constants';
19
19
 
20
20
  import { dispatchVirtualFocus, moveVirtualFocus } from '../focus/virtualFocus';
21
- import {
21
+ import type {
22
22
  FocusableElement,
23
23
  FocusStrategy,
24
24
  Key,
@@ -26,7 +26,7 @@ import {
26
26
  RefObject,
27
27
  } from '@react-types/shared';
28
28
  import { flushSync, withSlot } from 'octane';
29
- import { FocusEvent, useEffect, useRef } from '../compat/react';
29
+ import { type FocusEvent, useEffect, useRef } from '../compat/react';
30
30
  import { focusSafely } from '../interactions/focusSafely';
31
31
  import { focusWithoutScrolling } from '../utils/focusWithoutScrolling';
32
32
  import {
@@ -42,7 +42,7 @@ import { isCtrlKeyPressed } from '../utils/keyboard';
42
42
  import { isMac } from '../utils/platform';
43
43
  import { isTabbable } from '../utils/isFocusable';
44
44
  import { mergeProps } from '../utils/mergeProps';
45
- import { MultipleSelectionManager } from '../upstream-exports/react-stately/useMultipleSelectionState';
45
+ import type { MultipleSelectionManager } from '../upstream-exports/react-stately/useMultipleSelectionState';
46
46
  import { scrollIntoView, scrollIntoViewport } from '../utils/scrollIntoView';
47
47
  import { useEvent } from '../utils/useEvent';
48
48
  import { useKeyboard } from '../interactions/useKeyboard';
@@ -1,7 +1,7 @@
1
1
  /** @jsxImportSource octane */
2
2
  type DOMAttributes = Record<string, any>;
3
3
  // Ported from adobe/react-spectrum@5ecb3333001313e83898cd07644227897e3bae1f (packages/react-aria/src/slider/useSliderThumb.ts).
4
- import {
4
+ import type {
5
5
  AriaLabelingProps,
6
6
  AriaValidationProps,
7
7
  DOMProps,
@@ -20,14 +20,14 @@ import { getSliderThumbId, sliderData } from './utils';
20
20
  import { mergeProps } from '../utils/mergeProps';
21
21
  import { withSlot } from 'octane';
22
22
  import React, {
23
- ChangeEvent,
24
- InputHTMLAttributes,
25
- LabelHTMLAttributes,
23
+ type ChangeEvent,
24
+ type InputHTMLAttributes,
25
+ type LabelHTMLAttributes,
26
26
  useCallback,
27
27
  useEffect,
28
28
  useRef,
29
29
  } from '../compat/react';
30
- import { SliderState } from '../upstream-exports/react-stately/useSliderState';
30
+ import type { SliderState } from '../upstream-exports/react-stately/useSliderState';
31
31
  import { useFocusable } from '../interactions/useFocusable';
32
32
  import { useFormReset } from '../utils/useFormReset';
33
33
  import { useGlobalListeners } from '../utils/useGlobalListeners';
@@ -16,8 +16,8 @@ type DOMAttributes = Record<string, any>;
16
16
  import { announce, clearAnnouncer } from '../live-announcer/LiveAnnouncer';
17
17
  import { withSlot } from 'octane';
18
18
 
19
- import { AriaButtonProps } from '../button/useButton';
20
- import { InputBase, RangeInputBase, Validation, ValueBase } from '@react-types/shared';
19
+ import type { AriaButtonProps } from '../button/useButton';
20
+ import type { InputBase, RangeInputBase, Validation, ValueBase } from '@react-types/shared';
21
21
  import intlMessages from '../intl/spinbutton/index';
22
22
  import { useCallback, useEffect, useRef, useState } from '../compat/react';
23
23
  import { useEffectEvent } from '../utils/useEffectEvent';
@@ -15,11 +15,11 @@
15
15
  import {
16
16
  CalendarDate,
17
17
  CalendarDateTime,
18
- DateDuration,
18
+ type DateDuration,
19
19
  ZonedDateTime,
20
20
  } from '@internationalized/date';
21
- import { RangeValue, ValidationState } from '@react-types/shared';
22
- import { ReactNode } from '../../compat/react';
21
+ import type { RangeValue, ValidationState } from '@react-types/shared';
22
+ import type { ReactNode } from '../../compat/react';
23
23
 
24
24
  export type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;
25
25
  export type MappedDateValue<T> = T extends ZonedDateTime
@@ -23,10 +23,10 @@ import {
23
23
  previousAvailableDate,
24
24
  } from './utils';
25
25
  import {
26
- Calendar,
26
+ type Calendar,
27
27
  CalendarDate,
28
- CalendarIdentifier,
29
- DateDuration,
28
+ type CalendarIdentifier,
29
+ type DateDuration,
30
30
  DateFormatter,
31
31
  endOfMonth,
32
32
  endOfWeek,
@@ -41,7 +41,7 @@ import {
41
41
  toCalendarDate,
42
42
  today,
43
43
  } from '@internationalized/date';
44
- import {
44
+ import type {
45
45
  CalendarPropsBase,
46
46
  CalendarSelectionMode,
47
47
  CalendarState,
@@ -51,7 +51,7 @@ import {
51
51
  } from './types';
52
52
  import { useControlledState } from '../utils/useControlledState';
53
53
  import { useMemo, useState } from '../../compat/react';
54
- import { ValidationState, ValueBase } from '@react-types/shared';
54
+ import type { ValidationState, ValueBase } from '@react-types/shared';
55
55
 
56
56
  export interface CalendarProps<T extends DateValue, M extends CalendarSelectionMode = 'single'>
57
57
  extends
@@ -14,18 +14,18 @@
14
14
 
15
15
  import { alignCenter, constrainValue, isInvalid, previousAvailableDate } from './utils';
16
16
  import {
17
- Calendar,
17
+ type Calendar,
18
18
  CalendarDate,
19
- CalendarIdentifier,
20
- DateDuration,
19
+ type CalendarIdentifier,
20
+ type DateDuration,
21
21
  GregorianCalendar,
22
22
  maxDate,
23
23
  minDate,
24
24
  toCalendar,
25
25
  toCalendarDate,
26
26
  } from '@internationalized/date';
27
- import { CalendarPropsBase, DateValue, MappedDateValue, RangeCalendarState } from './types';
28
- import { RangeValue, ValidationState, ValueBase } from '@react-types/shared';
27
+ import type { CalendarPropsBase, DateValue, MappedDateValue, RangeCalendarState } from './types';
28
+ import type { RangeValue, ValidationState, ValueBase } from '@react-types/shared';
29
29
  import { useCalendarState } from './useCalendarState';
30
30
  import { useCallback, useMemo, useState } from '../../compat/react';
31
31
  import { useControlledState } from '../utils/useControlledState';
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import {
15
15
  CalendarDate,
16
- DateDuration,
16
+ type DateDuration,
17
17
  maxDate,
18
18
  minDate,
19
19
  startOfMonth,
@@ -21,7 +21,7 @@ import {
21
21
  startOfYear,
22
22
  toCalendarDate,
23
23
  } from '@internationalized/date';
24
- import { DateValue } from './types';
24
+ import type { DateValue } from './types';
25
25
 
26
26
  export function isInvalid(
27
27
  date: DateValue,
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import { clamp, toFixedNumber } from '../utils/number';
16
- import {
16
+ import type {
17
17
  ColorAxes,
18
18
  ColorChannel,
19
19
  ColorChannelRange,
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { Color } from './types';
15
+ import type { Color } from './types';
16
16
  import { parseColor } from './Color';
17
17
  import { useMemo } from '../../compat/react';
18
18