@react-types/shared 3.0.0-nightly.1779 → 3.0.0-nightly.1786

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/shared",
3
- "version": "3.0.0-nightly.1779+afb946c4a",
3
+ "version": "3.0.0-nightly.1786+892d41e82",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "afb946c4ab759b0dd19e024f8c0768d382134a7b"
17
+ "gitHead": "892d41e82dc781fb4651455d0e29c324376659ed"
18
18
  }
package/src/dnd.d.ts CHANGED
@@ -117,10 +117,7 @@ interface DroppableCollectionDropEvent extends DropEvent {
117
117
  interface DroppableCollectionInsertDropEvent {
118
118
  items: DropItem[],
119
119
  dropOperation: DropOperation,
120
- target: {
121
- key: Key,
122
- dropPosition: Omit<DropPosition, 'on'>
123
- }
120
+ target: ItemDropTarget
124
121
  }
125
122
 
126
123
  interface DroppableCollectionRootDropEvent {
@@ -131,24 +128,18 @@ interface DroppableCollectionRootDropEvent {
131
128
  interface DroppableCollectionOnItemDropEvent {
132
129
  items: DropItem[],
133
130
  dropOperation: DropOperation,
134
- isInternalDrop: boolean,
135
- target: {
136
- key: Key,
137
- dropPosition: 'on'
138
- }
131
+ isInternal: boolean,
132
+ target: ItemDropTarget
139
133
  }
140
134
 
141
135
  interface DroppableCollectionReorderEvent {
142
136
  keys: Set<Key>,
143
137
  dropOperation: DropOperation,
144
- target: {
145
- key: Key,
146
- dropPosition: Omit<DropPosition, 'on'>
147
- }
138
+ target: ItemDropTarget
148
139
  }
149
140
 
150
141
  export interface DragTypes {
151
- has(type: string): boolean
142
+ has(type: string | symbol): boolean
152
143
  }
153
144
 
154
145
  export interface DropTargetDelegate {
@@ -193,9 +184,10 @@ export interface DroppableCollectionProps {
193
184
  */
194
185
  onReorder?: (e: DroppableCollectionReorderEvent) => void,
195
186
  /**
196
- * The drag types that the droppable collection accepts. If your collection accepts directories, include 'directory' in your array of allowed types.
187
+ * The drag types that the droppable collection accepts. If directories are accepted, include the DIRECTORY_DRAG_TYPE from @react-aria/dnd in the array of allowed types.
188
+ * @default 'all'
197
189
  */
198
- acceptedDragTypes?: 'all' | Array<string>,
190
+ acceptedDragTypes?: 'all' | Array<string | symbol>,
199
191
  /**
200
192
  * A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
201
193
  */
@@ -212,7 +204,7 @@ interface DraggableCollectionMoveEvent extends DragMoveEvent {
212
204
 
213
205
  interface DraggableCollectionEndEvent extends DragEndEvent {
214
206
  keys: Set<Key>,
215
- isInternalDrop: boolean
207
+ isInternal: boolean
216
208
  }
217
209
 
218
210
  export type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement) => void) => void;
@@ -40,5 +40,9 @@ export interface SpectrumLabelableProps extends LabelableProps {
40
40
  /**
41
41
  * Whether the label is labeling a required field or group.
42
42
  */
43
- isRequired?: boolean
43
+ isRequired?: boolean,
44
+ /**
45
+ * A ContextualHelp element to place next to the label.
46
+ */
47
+ contextualHelp?: ReactNode
44
48
  }