react-aria-components 1.12.1 → 1.13.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 (162) hide show
  1. package/dist/Autocomplete.main.js +3 -3
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +3 -3
  4. package/dist/Autocomplete.module.js +3 -3
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Button.main.js +5 -11
  7. package/dist/Button.main.js.map +1 -1
  8. package/dist/Button.mjs +5 -11
  9. package/dist/Button.module.js +5 -11
  10. package/dist/Button.module.js.map +1 -1
  11. package/dist/DateField.main.js +12 -8
  12. package/dist/DateField.main.js.map +1 -1
  13. package/dist/DateField.mjs +12 -8
  14. package/dist/DateField.module.js +12 -8
  15. package/dist/DateField.module.js.map +1 -1
  16. package/dist/DatePicker.main.js +6 -2
  17. package/dist/DatePicker.main.js.map +1 -1
  18. package/dist/DatePicker.mjs +6 -2
  19. package/dist/DatePicker.module.js +6 -2
  20. package/dist/DatePicker.module.js.map +1 -1
  21. package/dist/GridList.main.js +24 -21
  22. package/dist/GridList.main.js.map +1 -1
  23. package/dist/GridList.mjs +25 -23
  24. package/dist/GridList.module.js +25 -23
  25. package/dist/GridList.module.js.map +1 -1
  26. package/dist/Group.main.js +3 -2
  27. package/dist/Group.main.js.map +1 -1
  28. package/dist/Group.mjs +3 -2
  29. package/dist/Group.module.js +3 -2
  30. package/dist/Group.module.js.map +1 -1
  31. package/dist/Input.main.js.map +1 -1
  32. package/dist/Input.module.js.map +1 -1
  33. package/dist/ListBox.main.js +14 -4
  34. package/dist/ListBox.main.js.map +1 -1
  35. package/dist/ListBox.mjs +14 -4
  36. package/dist/ListBox.module.js +14 -4
  37. package/dist/ListBox.module.js.map +1 -1
  38. package/dist/Menu.main.js +16 -6
  39. package/dist/Menu.main.js.map +1 -1
  40. package/dist/Menu.mjs +16 -6
  41. package/dist/Menu.module.js +16 -6
  42. package/dist/Menu.module.js.map +1 -1
  43. package/dist/Modal.main.js +9 -1
  44. package/dist/Modal.main.js.map +1 -1
  45. package/dist/Modal.mjs +10 -2
  46. package/dist/Modal.module.js +10 -2
  47. package/dist/Modal.module.js.map +1 -1
  48. package/dist/NumberField.main.js +2 -1
  49. package/dist/NumberField.main.js.map +1 -1
  50. package/dist/NumberField.mjs +2 -1
  51. package/dist/NumberField.module.js +2 -1
  52. package/dist/NumberField.module.js.map +1 -1
  53. package/dist/ProgressBar.main.js.map +1 -1
  54. package/dist/ProgressBar.module.js.map +1 -1
  55. package/dist/RSPContexts.main.js +4 -0
  56. package/dist/RSPContexts.main.js.map +1 -1
  57. package/dist/RSPContexts.mjs +3 -1
  58. package/dist/RSPContexts.module.js +3 -1
  59. package/dist/RSPContexts.module.js.map +1 -1
  60. package/dist/RadioGroup.main.js +10 -2
  61. package/dist/RadioGroup.main.js.map +1 -1
  62. package/dist/RadioGroup.mjs +10 -2
  63. package/dist/RadioGroup.module.js +10 -2
  64. package/dist/RadioGroup.module.js.map +1 -1
  65. package/dist/SearchField.main.js +2 -2
  66. package/dist/SearchField.main.js.map +1 -1
  67. package/dist/SearchField.mjs +2 -2
  68. package/dist/SearchField.module.js +2 -2
  69. package/dist/SearchField.module.js.map +1 -1
  70. package/dist/Select.main.js +62 -22
  71. package/dist/Select.main.js.map +1 -1
  72. package/dist/Select.mjs +65 -25
  73. package/dist/Select.module.js +65 -25
  74. package/dist/Select.module.js.map +1 -1
  75. package/dist/SelectionIndicator.main.js +45 -0
  76. package/dist/SelectionIndicator.main.js.map +1 -0
  77. package/dist/SelectionIndicator.mjs +35 -0
  78. package/dist/SelectionIndicator.module.js +35 -0
  79. package/dist/SelectionIndicator.module.js.map +1 -0
  80. package/dist/SharedElementTransition.main.js +139 -0
  81. package/dist/SharedElementTransition.main.js.map +1 -0
  82. package/dist/SharedElementTransition.mjs +129 -0
  83. package/dist/SharedElementTransition.module.js +129 -0
  84. package/dist/SharedElementTransition.module.js.map +1 -0
  85. package/dist/Table.main.js +16 -11
  86. package/dist/Table.main.js.map +1 -1
  87. package/dist/Table.mjs +17 -12
  88. package/dist/Table.module.js +17 -12
  89. package/dist/Table.module.js.map +1 -1
  90. package/dist/Tabs.main.js +11 -3
  91. package/dist/Tabs.main.js.map +1 -1
  92. package/dist/Tabs.mjs +11 -3
  93. package/dist/Tabs.module.js +11 -3
  94. package/dist/Tabs.module.js.map +1 -1
  95. package/dist/TagGroup.main.js +28 -16
  96. package/dist/TagGroup.main.js.map +1 -1
  97. package/dist/TagGroup.mjs +28 -16
  98. package/dist/TagGroup.module.js +28 -16
  99. package/dist/TagGroup.module.js.map +1 -1
  100. package/dist/TextField.main.js +2 -2
  101. package/dist/TextField.main.js.map +1 -1
  102. package/dist/TextField.mjs +2 -2
  103. package/dist/TextField.module.js +2 -2
  104. package/dist/TextField.module.js.map +1 -1
  105. package/dist/ToggleButton.main.js +7 -1
  106. package/dist/ToggleButton.main.js.map +1 -1
  107. package/dist/ToggleButton.mjs +7 -1
  108. package/dist/ToggleButton.module.js +7 -1
  109. package/dist/ToggleButton.module.js.map +1 -1
  110. package/dist/ToggleButtonGroup.main.js +3 -1
  111. package/dist/ToggleButtonGroup.main.js.map +1 -1
  112. package/dist/ToggleButtonGroup.mjs +3 -1
  113. package/dist/ToggleButtonGroup.module.js +3 -1
  114. package/dist/ToggleButtonGroup.module.js.map +1 -1
  115. package/dist/Tree.main.js +16 -4
  116. package/dist/Tree.main.js.map +1 -1
  117. package/dist/Tree.mjs +16 -4
  118. package/dist/Tree.module.js +16 -4
  119. package/dist/Tree.module.js.map +1 -1
  120. package/dist/import.mjs +10 -4
  121. package/dist/main.js +18 -3
  122. package/dist/main.js.map +1 -1
  123. package/dist/module.js +10 -4
  124. package/dist/module.js.map +1 -1
  125. package/dist/types.d.ts +99 -24
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/utils.main.js.map +1 -1
  128. package/dist/utils.module.js.map +1 -1
  129. package/package.json +23 -23
  130. package/src/Autocomplete.tsx +1 -1
  131. package/src/Button.tsx +9 -11
  132. package/src/DateField.tsx +21 -12
  133. package/src/DatePicker.tsx +11 -2
  134. package/src/GridList.tsx +32 -33
  135. package/src/Group.tsx +5 -2
  136. package/src/Input.tsx +7 -1
  137. package/src/ListBox.tsx +12 -7
  138. package/src/Menu.tsx +11 -6
  139. package/src/Modal.tsx +11 -2
  140. package/src/NumberField.tsx +1 -1
  141. package/src/ProgressBar.tsx +1 -1
  142. package/src/RSPContexts.ts +19 -0
  143. package/src/RadioGroup.tsx +8 -2
  144. package/src/SearchField.tsx +1 -1
  145. package/src/Select.tsx +75 -34
  146. package/src/SelectionIndicator.tsx +40 -0
  147. package/src/SharedElementTransition.tsx +185 -0
  148. package/src/Table.tsx +17 -16
  149. package/src/Tabs.tsx +8 -2
  150. package/src/TagGroup.tsx +31 -24
  151. package/src/TextField.tsx +1 -1
  152. package/src/ToggleButton.tsx +6 -1
  153. package/src/ToggleButtonGroup.tsx +4 -1
  154. package/src/Tree.tsx +16 -9
  155. package/src/index.ts +10 -3
  156. package/src/utils.tsx +1 -1
  157. package/dist/context.main.js +0 -25
  158. package/dist/context.main.js.map +0 -1
  159. package/dist/context.mjs +0 -19
  160. package/dist/context.module.js +0 -19
  161. package/dist/context.module.js.map +0 -1
  162. package/src/context.tsx +0 -34
package/src/TextField.tsx CHANGED
@@ -14,7 +14,7 @@ import {AriaTextFieldProps, useTextField} from 'react-aria';
14
14
  import {ContextValue, DOMProps, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';
15
15
  import {createHideableComponent} from '@react-aria/collections';
16
16
  import {FieldErrorContext} from './FieldError';
17
- import {FieldInputContext} from './context';
17
+ import {FieldInputContext} from './RSPContexts';
18
18
  import {filterDOMProps} from '@react-aria/utils';
19
19
  import {FormContext} from './Form';
20
20
  import {GlobalDOMAttributes} from '@react-types/shared';
@@ -16,6 +16,7 @@ import {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} f
16
16
  import {filterDOMProps} from '@react-aria/utils';
17
17
  import {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';
18
18
  import React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';
19
+ import {SelectionIndicatorContext} from './SelectionIndicator';
19
20
  import {ToggleGroupStateContext} from './ToggleButtonGroup';
20
21
  import {ToggleState, useToggleState} from 'react-stately';
21
22
 
@@ -80,6 +81,10 @@ export const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
80
81
  data-pressed={isPressed || undefined}
81
82
  data-selected={isSelected || undefined}
82
83
  data-hovered={isHovered || undefined}
83
- data-focus-visible={isFocusVisible || undefined} />
84
+ data-focus-visible={isFocusVisible || undefined}>
85
+ <SelectionIndicatorContext.Provider value={{isSelected}}>
86
+ {renderProps.children}
87
+ </SelectionIndicatorContext.Provider>
88
+ </button>
84
89
  );
85
90
  });
@@ -14,6 +14,7 @@ import {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} f
14
14
  import {filterDOMProps, mergeProps} from '@react-aria/utils';
15
15
  import {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';
16
16
  import React, {createContext, ForwardedRef, forwardRef} from 'react';
17
+ import {SharedElementTransition} from './SharedElementTransition';
17
18
  import {ToggleGroupState, useToggleGroupState} from 'react-stately';
18
19
 
19
20
  export interface ToggleButtonGroupRenderProps {
@@ -60,7 +61,9 @@ export const ToggleButtonGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(fu
60
61
  data-orientation={props.orientation || 'horizontal'}
61
62
  data-disabled={props.isDisabled || undefined}>
62
63
  <ToggleGroupStateContext.Provider value={state}>
63
- {renderProps.children}
64
+ <SharedElementTransition>
65
+ {renderProps.children}
66
+ </SharedElementTransition>
64
67
  </ToggleGroupStateContext.Provider>
65
68
  </div>
66
69
  );
package/src/Tree.tsx CHANGED
@@ -13,15 +13,17 @@
13
13
  import {AriaTreeItemOptions, AriaTreeProps, DraggableItemResult, DropIndicatorAria, DropIndicatorProps, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridListSelectionCheckbox, useHover, useId, useLocale, useTree, useTreeItem, useVisuallyHidden} from 'react-aria';
14
14
  import {ButtonContext} from './Button';
15
15
  import {CheckboxContext} from './RSPContexts';
16
+ import {ChildrenOrFunction, ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';
16
17
  import {Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, LoaderNode, useCachedChildren} from '@react-aria/collections';
17
18
  import {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';
18
- import {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';
19
19
  import {DisabledBehavior, DragPreviewRenderer, Expandable, forwardRefType, GlobalDOMAttributes, HoverEvents, Key, LinkDOMProps, MultipleSelection, PressEvents, RefObject, SelectionMode} from '@react-types/shared';
20
20
  import {DragAndDropContext, DropIndicatorContext, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';
21
21
  import {DragAndDropHooks} from './useDragAndDrop';
22
22
  import {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, Node, SelectionBehavior, TreeState, useTreeState} from 'react-stately';
23
23
  import {filterDOMProps, inertValue, LoadMoreSentinelProps, useLoadMoreSentinel, useObjectRef} from '@react-aria/utils';
24
24
  import React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';
25
+ import {SelectionIndicatorContext} from './SelectionIndicator';
26
+ import {SharedElementTransition} from './SharedElementTransition';
25
27
  import {TreeDropTargetDelegate} from './TreeDropTargetDelegate';
26
28
  import {useControlledState} from '@react-stately/utils';
27
29
 
@@ -400,11 +402,13 @@ function TreeInner<T extends object>({props, collection, treeRef: ref}: TreeInne
400
402
  [DropIndicatorContext, {render: TreeDropIndicatorWrapper}]
401
403
  ]}>
402
404
  {hasDropHooks && <RootDropIndicator />}
403
- <CollectionRoot
404
- collection={state.collection}
405
- persistedKeys={useDndPersistedKeys(state.selectionManager, dragAndDropHooks, dropState)}
406
- scrollRef={ref}
407
- renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />
405
+ <SharedElementTransition>
406
+ <CollectionRoot
407
+ collection={state.collection}
408
+ persistedKeys={useDndPersistedKeys(state.selectionManager, dragAndDropHooks, dropState)}
409
+ scrollRef={ref}
410
+ renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />
411
+ </SharedElementTransition>
408
412
  </Provider>
409
413
  {emptyState}
410
414
  </div>
@@ -698,7 +702,8 @@ export const TreeItem = /*#__PURE__*/ createBranchComponent(TreeItemNode, <T ext
698
702
  }],
699
703
  [TreeItemContentContext, {
700
704
  ...renderPropValues
701
- }]
705
+ }],
706
+ [SelectionIndicatorContext, {isSelected: states.isSelected}]
702
707
  ]}>
703
708
  {children}
704
709
  </Provider>
@@ -720,7 +725,7 @@ export interface TreeLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'coll
720
725
  /**
721
726
  * The load more spinner to render when loading additional items.
722
727
  */
723
- children?: ReactNode | ((values: TreeLoadMoreItemRenderProps & {defaultChildren: ReactNode | undefined}) => ReactNode),
728
+ children?: ChildrenOrFunction<TreeLoadMoreItemRenderProps>,
724
729
  /**
725
730
  * Whether or not the loading spinner should be rendered or not.
726
731
  */
@@ -818,6 +823,7 @@ function flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionO
818
823
  let flattenedRows: Node<T>[] = [];
819
824
  // Need to count the items here because BaseCollection will return the full item count regardless if items are hidden via collapsed rows
820
825
  let itemCount = 0;
826
+ let parentLookup: Map<Key, boolean> = new Map();
821
827
 
822
828
  let visitNode = (node: Node<T>) => {
823
829
  if (node.type === 'item' || node.type === 'loader') {
@@ -844,12 +850,13 @@ function flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionO
844
850
 
845
851
  // Grab the modified node from the key map so our flattened list and modified key map point to the same nodes
846
852
  let modifiedNode = keyMap.get(node.key) || node;
847
- if (modifiedNode.level === 0 || (modifiedNode.parentKey != null && expandedKeys.has(modifiedNode.parentKey) && flattenedRows.find(row => row.key === modifiedNode.parentKey))) {
853
+ if (modifiedNode.level === 0 || (modifiedNode.parentKey != null && expandedKeys.has(modifiedNode.parentKey) && parentLookup.get(modifiedNode.parentKey))) {
848
854
  if (modifiedNode.type === 'item') {
849
855
  itemCount++;
850
856
  }
851
857
 
852
858
  flattenedRows.push(modifiedNode);
859
+ parentLookup.set(modifiedNode.key, true);
853
860
  }
854
861
  } else if (node.type !== null) {
855
862
  keyMap.set(node.key, node as CollectionNode<T>);
package/src/index.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  // to import it from a React Server Component in a framework like Next.js.
15
15
  import 'client-only';
16
16
 
17
- export {CheckboxContext, ColorAreaContext, ColorFieldContext, ColorSliderContext, ColorWheelContext, HeadingContext} from './RSPContexts';
17
+ export {CheckboxContext, ColorAreaContext, ColorFieldContext, ColorSliderContext, ColorWheelContext, HeadingContext, SelectableCollectionContext, FieldInputContext} from './RSPContexts';
18
18
 
19
19
  export {Autocomplete, AutocompleteContext, AutocompleteStateContext} from './Autocomplete';
20
20
  export {Breadcrumbs, BreadcrumbsContext, Breadcrumb} from './Breadcrumbs';
@@ -39,13 +39,13 @@ export {DropZone, DropZoneContext} from './DropZone';
39
39
  export {FieldError, FieldErrorContext} from './FieldError';
40
40
  export {FileTrigger} from './FileTrigger';
41
41
  export {Form, FormContext} from './Form';
42
- export {GridListLoadMoreItem, GridList, GridListItem, GridListContext, GridListHeader, GridListSection} from './GridList';
42
+ export {GridListLoadMoreItem, GridList, GridListItem, GridListContext, GridListHeader, GridListHeaderContext, GridListSection} from './GridList';
43
43
  export {Group, GroupContext} from './Group';
44
44
  export {Header, HeaderContext} from './Header';
45
45
  export {Heading} from './Heading';
46
46
  export {Input, InputContext} from './Input';
47
47
  export {Section, CollectionRendererContext, DefaultCollectionRenderer} from './Collection';
48
- export {Collection, createLeafComponent as UNSTABLE_createLeafComponent, createBranchComponent as UNSTABLE_createBranchComponent, CollectionBuilder as UNSTABLE_CollectionBuilder} from '@react-aria/collections';
48
+ export {Collection, createLeafComponent, createBranchComponent, CollectionBuilder} from '@react-aria/collections';
49
49
  export {Keyboard, KeyboardContext} from './Keyboard';
50
50
  export {Label, LabelContext} from './Label';
51
51
  export {Link, LinkContext} from './Link';
@@ -60,7 +60,9 @@ export {ProgressBar, ProgressBarContext} from './ProgressBar';
60
60
  export {RadioGroup, Radio, RadioGroupContext, RadioContext, RadioGroupStateContext} from './RadioGroup';
61
61
  export {SearchField, SearchFieldContext} from './SearchField';
62
62
  export {Select, SelectValue, SelectContext, SelectValueContext, SelectStateContext} from './Select';
63
+ export {SelectionIndicator, SelectionIndicatorContext} from './SelectionIndicator';
63
64
  export {Separator, SeparatorContext} from './Separator';
65
+ export {SharedElementTransition, SharedElement} from './SharedElementTransition';
64
66
  export {Slider, SliderOutput, SliderTrack, SliderThumb, SliderContext, SliderOutputContext, SliderTrackContext, SliderStateContext} from './Slider';
65
67
  export {Switch, SwitchContext} from './Switch';
66
68
  export {TableLoadMoreItem, Table, Row, Cell, Column, ColumnResizer, TableHeader, TableBody, TableContext, ResizableTableContainer, useTableOptions, TableStateContext, TableColumnResizeStateContext} from './Table';
@@ -76,6 +78,7 @@ export {ToggleButtonGroup, ToggleButtonGroupContext, ToggleGroupStateContext} fr
76
78
  export {Toolbar, ToolbarContext} from './Toolbar';
77
79
  export {TooltipTrigger, Tooltip, TooltipTriggerStateContext, TooltipContext} from './Tooltip';
78
80
  export {TreeLoadMoreItem, Tree, TreeItem, TreeContext, TreeItemContent, TreeStateContext} from './Tree';
81
+ export {useDrag, useDrop} from '@react-aria/dnd';
79
82
  export {useDragAndDrop} from './useDragAndDrop';
80
83
  export {DropIndicator, DropIndicatorContext, DragAndDropContext} from './DragAndDrop';
81
84
  export {Virtualizer} from './Virtualizer';
@@ -124,6 +127,8 @@ export type {ProgressBarProps, ProgressBarRenderProps} from './ProgressBar';
124
127
  export type {RadioGroupProps, RadioGroupRenderProps, RadioProps, RadioRenderProps} from './RadioGroup';
125
128
  export type {SearchFieldProps, SearchFieldRenderProps} from './SearchField';
126
129
  export type {SelectProps, SelectValueProps, SelectValueRenderProps, SelectRenderProps} from './Select';
130
+ export type {SelectionIndicatorProps} from './SelectionIndicator';
131
+ export type {SharedElementTransitionProps, SharedElementProps, SharedElementRenderProps} from './SharedElementTransition';
127
132
  export type {SeparatorProps} from './Separator';
128
133
  export type {SliderOutputProps, SliderProps, SliderRenderProps, SliderThumbProps, SliderTrackProps, SliderTrackRenderProps, SliderThumbRenderProps} from './Slider';
129
134
  export type {SwitchProps, SwitchRenderProps} from './Switch';
@@ -139,6 +144,7 @@ export type {ToggleButtonGroupProps, ToggleButtonGroupRenderProps} from './Toggl
139
144
  export type {ToolbarProps, ToolbarRenderProps} from './Toolbar';
140
145
  export type {TooltipProps, TooltipRenderProps, TooltipTriggerComponentProps} from './Tooltip';
141
146
  export type {TreeProps, TreeRenderProps, TreeItemProps, TreeItemRenderProps, TreeItemContentProps, TreeItemContentRenderProps, TreeLoadMoreItemProps, TreeLoadMoreItemRenderProps} from './Tree';
147
+ export type {DragOptions, DragResult} from '@react-aria/dnd';
142
148
  export type {DragAndDropHooks, DragAndDropOptions} from './useDragAndDrop';
143
149
  export type {DropIndicatorProps, DropIndicatorRenderProps} from './DragAndDrop';
144
150
  export type {ContextValue, RenderProps, SlotProps, StyleRenderProps} from './utils';
@@ -150,3 +156,4 @@ export type {CalendarState, CheckboxGroupState, Color, ColorAreaState, ColorFiel
150
156
  export type {AutocompleteState} from '@react-stately/autocomplete';
151
157
  export type {ListLayoutOptions, GridLayoutOptions, WaterfallLayoutOptions} from '@react-stately/layout';
152
158
  export type {ValidationResult, RouterConfig} from '@react-types/shared';
159
+ export type {SelectableCollectionContextValue} from './RSPContexts';
package/src/utils.tsx CHANGED
@@ -73,7 +73,7 @@ export interface StyleRenderProps<T> {
73
73
  style?: StyleOrFunction<T>
74
74
  }
75
75
 
76
- type ChildrenOrFunction<T> = ReactNode | ((values: T & {defaultChildren: ReactNode | undefined}) => ReactNode);
76
+ export type ChildrenOrFunction<T> = ReactNode | ((values: T & {defaultChildren: ReactNode | undefined}) => ReactNode);
77
77
 
78
78
  export interface RenderProps<T> extends StyleRenderProps<T> {
79
79
  /** The children of the component. A function may be provided to alter the children based on component state. */
@@ -1,25 +0,0 @@
1
- var $486gT$react = require("react");
2
-
3
-
4
- function $parcel$export(e, n, v, s) {
5
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
- }
7
-
8
- $parcel$export(module.exports, "SelectableCollectionContext", () => $09cb5ee89bb327e1$export$b0d3ecf7112093a7);
9
- $parcel$export(module.exports, "FieldInputContext", () => $09cb5ee89bb327e1$export$698f465ec27e93df);
10
- /*
11
- * Copyright 2025 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
- const $09cb5ee89bb327e1$export$b0d3ecf7112093a7 = /*#__PURE__*/ (0, $486gT$react.createContext)(null);
22
- const $09cb5ee89bb327e1$export$698f465ec27e93df = /*#__PURE__*/ (0, $486gT$react.createContext)(null);
23
-
24
-
25
- //# sourceMappingURL=context.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAsBM,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAAoE;AACpH,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAA0D","sources":["packages/react-aria-components/src/context.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, FocusableElement, FocusEvents, KeyboardEvents, Node, ValueBase} from '@react-types/shared';\nimport {AriaTextFieldProps} from '@react-aria/textfield';\nimport {ContextValue} from './utils';\nimport {createContext} from 'react';\n\nexport interface SelectableCollectionContextValue<T> extends DOMProps, AriaLabelingProps {\n filter?: (nodeTextValue: string, node: Node<T>) => boolean,\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus?: boolean,\n /** Whether typeahead is disabled. */\n disallowTypeAhead?: boolean\n}\n\ninterface FieldInputContextValue<T = FocusableElement> extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<AriaTextFieldProps, 'enterKeyHint' | 'aria-controls' | 'aria-autocomplete' | 'aria-activedescendant' | 'spellCheck' | 'autoCorrect' | 'autoComplete'> {}\n\nexport const SelectableCollectionContext = createContext<ContextValue<SelectableCollectionContextValue<any>, HTMLElement>>(null);\nexport const FieldInputContext = createContext<ContextValue<FieldInputContextValue, FocusableElement>>(null);\n"],"names":[],"version":3,"file":"context.main.js.map"}
package/dist/context.mjs DELETED
@@ -1,19 +0,0 @@
1
- import {createContext as $8m4bF$createContext} from "react";
2
-
3
- /*
4
- * Copyright 2025 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- const $8e6cc465cc68f603$export$b0d3ecf7112093a7 = /*#__PURE__*/ (0, $8m4bF$createContext)(null);
15
- const $8e6cc465cc68f603$export$698f465ec27e93df = /*#__PURE__*/ (0, $8m4bF$createContext)(null);
16
-
17
-
18
- export {$8e6cc465cc68f603$export$b0d3ecf7112093a7 as SelectableCollectionContext, $8e6cc465cc68f603$export$698f465ec27e93df as FieldInputContext};
19
- //# sourceMappingURL=context.module.js.map
@@ -1,19 +0,0 @@
1
- import {createContext as $8m4bF$createContext} from "react";
2
-
3
- /*
4
- * Copyright 2025 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- const $8e6cc465cc68f603$export$b0d3ecf7112093a7 = /*#__PURE__*/ (0, $8m4bF$createContext)(null);
15
- const $8e6cc465cc68f603$export$698f465ec27e93df = /*#__PURE__*/ (0, $8m4bF$createContext)(null);
16
-
17
-
18
- export {$8e6cc465cc68f603$export$b0d3ecf7112093a7 as SelectableCollectionContext, $8e6cc465cc68f603$export$698f465ec27e93df as FieldInputContext};
19
- //# sourceMappingURL=context.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAsBM,MAAM,0DAA8B,CAAA,GAAA,oBAAY,EAAoE;AACpH,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA0D","sources":["packages/react-aria-components/src/context.tsx"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, FocusableElement, FocusEvents, KeyboardEvents, Node, ValueBase} from '@react-types/shared';\nimport {AriaTextFieldProps} from '@react-aria/textfield';\nimport {ContextValue} from './utils';\nimport {createContext} from 'react';\n\nexport interface SelectableCollectionContextValue<T> extends DOMProps, AriaLabelingProps {\n filter?: (nodeTextValue: string, node: Node<T>) => boolean,\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus?: boolean,\n /** Whether typeahead is disabled. */\n disallowTypeAhead?: boolean\n}\n\ninterface FieldInputContextValue<T = FocusableElement> extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<AriaTextFieldProps, 'enterKeyHint' | 'aria-controls' | 'aria-autocomplete' | 'aria-activedescendant' | 'spellCheck' | 'autoCorrect' | 'autoComplete'> {}\n\nexport const SelectableCollectionContext = createContext<ContextValue<SelectableCollectionContextValue<any>, HTMLElement>>(null);\nexport const FieldInputContext = createContext<ContextValue<FieldInputContextValue, FocusableElement>>(null);\n"],"names":[],"version":3,"file":"context.module.js.map"}
package/src/context.tsx DELETED
@@ -1,34 +0,0 @@
1
- /*
2
- * Copyright 2025 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {AriaLabelingProps, DOMProps, FocusableElement, FocusEvents, KeyboardEvents, Node, ValueBase} from '@react-types/shared';
14
- import {AriaTextFieldProps} from '@react-aria/textfield';
15
- import {ContextValue} from './utils';
16
- import {createContext} from 'react';
17
-
18
- export interface SelectableCollectionContextValue<T> extends DOMProps, AriaLabelingProps {
19
- filter?: (nodeTextValue: string, node: Node<T>) => boolean,
20
- /** Whether the collection items should use virtual focus instead of being focused directly. */
21
- shouldUseVirtualFocus?: boolean,
22
- /** Whether typeahead is disabled. */
23
- disallowTypeAhead?: boolean
24
- }
25
-
26
- interface FieldInputContextValue<T = FocusableElement> extends
27
- DOMProps,
28
- FocusEvents<T>,
29
- KeyboardEvents,
30
- Pick<ValueBase<string>, 'onChange' | 'value'>,
31
- Pick<AriaTextFieldProps, 'enterKeyHint' | 'aria-controls' | 'aria-autocomplete' | 'aria-activedescendant' | 'spellCheck' | 'autoCorrect' | 'autoComplete'> {}
32
-
33
- export const SelectableCollectionContext = createContext<ContextValue<SelectableCollectionContextValue<any>, HTMLElement>>(null);
34
- export const FieldInputContext = createContext<ContextValue<FieldInputContextValue, FocusableElement>>(null);