@barqjs/aria 0.2.0-next.0 → 0.2.0-next.1
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/README.md +24 -13
- package/package.json +127 -37
- package/src/autocomplete.tsx +581 -0
- package/src/breadcrumbs.tsx +21 -20
- package/src/button.tsx +151 -25
- package/src/calendar.tsx +1019 -92
- package/src/checkbox.tsx +214 -52
- package/src/collections.ts +88 -5
- package/src/color.ts +1580 -23
- package/src/colorpicker.tsx +698 -153
- package/src/colorswatchpicker.tsx +240 -0
- package/src/combobox.tsx +635 -113
- package/src/command.tsx +78 -59
- package/src/date.ts +31 -9
- package/src/datefield.tsx +1451 -336
- package/src/datepicker.tsx +465 -114
- package/src/dialog.tsx +302 -115
- package/src/disclosure.tsx +81 -29
- package/src/dnd/clipboard.ts +125 -0
- package/src/dnd/collection.ts +1265 -0
- package/src/dnd/data.ts +409 -0
- package/src/dnd/drag-drop.ts +801 -0
- package/src/dnd/index.ts +133 -0
- package/src/dnd/manager.ts +639 -0
- package/src/dnd/strings.ts +1279 -0
- package/src/dnd/targets.ts +726 -0
- package/src/dnd/types.ts +212 -0
- package/src/dom.ts +3 -6
- package/src/drag-and-drop.tsx +669 -0
- package/src/dropzone.tsx +208 -0
- package/src/file-trigger.tsx +103 -0
- package/src/form.tsx +18 -18
- package/src/gridlist.tsx +912 -121
- package/src/group.tsx +146 -0
- package/src/index.ts +402 -0
- package/src/interactions/focus-events.ts +13 -5
- package/src/interactions/keyboard.ts +195 -2
- package/src/interactions/modality.ts +18 -6
- package/src/interactions/open-link.ts +46 -13
- package/src/interactions/press.ts +35 -18
- package/src/label.ts +18 -6
- package/src/link.tsx +146 -50
- package/src/listbox.tsx +615 -89
- package/src/live.ts +4 -0
- package/src/menu.tsx +182 -89
- package/src/menubar.tsx +21 -17
- package/src/navigation-tree.tsx +357 -0
- package/src/numberfield.tsx +164 -60
- package/src/overlay-arrow.tsx +157 -0
- package/src/overlays.ts +364 -62
- package/src/platform.ts +2 -1
- package/src/preview-trigger.tsx +582 -0
- package/src/progress-bar-context.ts +15 -0
- package/src/questionnaire.tsx +109 -104
- package/src/radio.tsx +101 -27
- package/src/select.tsx +225 -145
- package/src/selection-indicator.tsx +74 -0
- package/src/selection.ts +73 -16
- package/src/shared-element-transition.tsx +316 -0
- package/src/sheet.tsx +1461 -0
- package/src/slider.tsx +139 -44
- package/src/switch.tsx +47 -21
- package/src/table.tsx +0 -0
- package/src/tabs.tsx +198 -89
- package/src/tag.tsx +217 -32
- package/src/textarea.tsx +186 -0
- package/src/textfield.tsx +103 -37
- package/src/toast-components.tsx +589 -0
- package/src/toggle-button-group.tsx +175 -0
- package/src/toggle-input.tsx +38 -0
- package/src/toggle.ts +68 -5
- package/src/tokenfield.tsx +1673 -0
- package/src/toolbar.tsx +15 -10
- package/src/tooltip.tsx +46 -29
- package/src/tree.tsx +2075 -0
- package/src/utils.ts +30 -1
- package/src/validation.ts +79 -22
- package/src/virtualizer.tsx +186 -23
package/src/dnd/index.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag and drop, for a pointer and without one.
|
|
3
|
+
*
|
|
4
|
+
* The platform's drag and drop is a mouse-and-touch API: nothing in it can be
|
|
5
|
+
* operated from a keyboard or by a screen reader. So every drag here has two
|
|
6
|
+
* engines behind one set of events. A native drag runs on `dragstart`,
|
|
7
|
+
* `dragover` and `drop` with a `DataTransfer`; every other modality runs on the
|
|
8
|
+
* drag manager, which starts a session on Enter (or a screen reader's click),
|
|
9
|
+
* lets Tab walk between the registered drop targets, and drops on Enter. Both
|
|
10
|
+
* report the same `dragstart`, `dropenter`, `drop` and `dragend` events, so a
|
|
11
|
+
* caller writes its handlers once.
|
|
12
|
+
*
|
|
13
|
+
* A collection adds a layer on top: drop TARGETS inside it (before, on and
|
|
14
|
+
* after each item, and the collection itself), navigated with the arrow keys
|
|
15
|
+
* and resolved from a point by a delegate when the pointer is driving.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
DirectoryDropItem,
|
|
20
|
+
DragDropEvent,
|
|
21
|
+
DragEndEvent,
|
|
22
|
+
DraggableCollectionEndEvent,
|
|
23
|
+
DraggableCollectionMoveEvent,
|
|
24
|
+
DraggableCollectionProps,
|
|
25
|
+
DraggableCollectionStartEvent,
|
|
26
|
+
DragItem,
|
|
27
|
+
DragMoveEvent,
|
|
28
|
+
DragPreviewRenderer,
|
|
29
|
+
DragStartEvent,
|
|
30
|
+
DragType,
|
|
31
|
+
DragTypes,
|
|
32
|
+
DropActivateEvent,
|
|
33
|
+
DropEnterEvent,
|
|
34
|
+
DropEvent,
|
|
35
|
+
DropExitEvent,
|
|
36
|
+
DropItem,
|
|
37
|
+
DropMoveEvent,
|
|
38
|
+
DropOperation,
|
|
39
|
+
DropPosition,
|
|
40
|
+
DroppableCollectionActivateEvent,
|
|
41
|
+
DroppableCollectionBaseProps,
|
|
42
|
+
DroppableCollectionDropEvent,
|
|
43
|
+
DroppableCollectionEnterEvent,
|
|
44
|
+
DroppableCollectionExitEvent,
|
|
45
|
+
DroppableCollectionInsertDropEvent,
|
|
46
|
+
DroppableCollectionMoveEvent,
|
|
47
|
+
DroppableCollectionOnItemDropEvent,
|
|
48
|
+
DroppableCollectionProps,
|
|
49
|
+
DroppableCollectionReorderEvent,
|
|
50
|
+
DroppableCollectionRootDropEvent,
|
|
51
|
+
DroppableCollectionUtilityOptions,
|
|
52
|
+
DropTarget,
|
|
53
|
+
DropTargetDelegate,
|
|
54
|
+
FileDropItem,
|
|
55
|
+
ItemDropTarget,
|
|
56
|
+
RootDropTarget,
|
|
57
|
+
TextDropItem,
|
|
58
|
+
} from "./types.ts";
|
|
59
|
+
export {
|
|
60
|
+
CUSTOM_DRAG_TYPE,
|
|
61
|
+
DataTransferTypes,
|
|
62
|
+
DIRECTORY_DRAG_TYPE,
|
|
63
|
+
GENERIC_TYPE,
|
|
64
|
+
getTypes,
|
|
65
|
+
isDirectoryDropItem,
|
|
66
|
+
isFileDropItem,
|
|
67
|
+
isInternalDropOperation,
|
|
68
|
+
isTextDropItem,
|
|
69
|
+
readFromDataTransfer,
|
|
70
|
+
writeToDataTransfer,
|
|
71
|
+
} from "./data.ts";
|
|
72
|
+
export { dndStrings } from "./strings.ts";
|
|
73
|
+
export {
|
|
74
|
+
beginDragging,
|
|
75
|
+
type DragModality,
|
|
76
|
+
dragModality,
|
|
77
|
+
DragSession,
|
|
78
|
+
dragSession,
|
|
79
|
+
type DragTarget,
|
|
80
|
+
getDragModality,
|
|
81
|
+
isValidDropTarget,
|
|
82
|
+
isVirtualDragging,
|
|
83
|
+
type ManagedDropItem,
|
|
84
|
+
type ManagedDropTarget,
|
|
85
|
+
registerDropItem,
|
|
86
|
+
registerDropTarget,
|
|
87
|
+
} from "./manager.ts";
|
|
88
|
+
export {
|
|
89
|
+
type AutoScroll,
|
|
90
|
+
autoScroll,
|
|
91
|
+
drag,
|
|
92
|
+
type DragOptions,
|
|
93
|
+
type DragResult,
|
|
94
|
+
drop,
|
|
95
|
+
type DropOptions,
|
|
96
|
+
type DropResult,
|
|
97
|
+
} from "./drag-drop.ts";
|
|
98
|
+
export { clipboard, type ClipboardOptions, type ClipboardResult } from "./clipboard.ts";
|
|
99
|
+
export {
|
|
100
|
+
afterDropIndicatorTargets,
|
|
101
|
+
type DropNavigationDirection,
|
|
102
|
+
ListDropTargetDelegate,
|
|
103
|
+
type ListDropTargetDelegateOptions,
|
|
104
|
+
navigateDropTarget,
|
|
105
|
+
nextSiblingNode,
|
|
106
|
+
previousSiblingNode,
|
|
107
|
+
TreeDropTargetDelegate,
|
|
108
|
+
type TreeDropTargetState,
|
|
109
|
+
} from "./targets.ts";
|
|
110
|
+
export {
|
|
111
|
+
draggableCollection,
|
|
112
|
+
type DraggableCollectionOptions,
|
|
113
|
+
type DraggableCollectionState,
|
|
114
|
+
draggableCollectionState,
|
|
115
|
+
type DraggableCollectionStateOptions,
|
|
116
|
+
draggableItem,
|
|
117
|
+
type DraggableItemOptions,
|
|
118
|
+
type DraggableItemResult,
|
|
119
|
+
dropIndicator,
|
|
120
|
+
type DropIndicatorOptions,
|
|
121
|
+
type DropIndicatorResult,
|
|
122
|
+
type DropOperationEvent,
|
|
123
|
+
droppableCollection,
|
|
124
|
+
type DroppableCollectionOptions,
|
|
125
|
+
type DroppableCollectionResult,
|
|
126
|
+
type DroppableCollectionState,
|
|
127
|
+
droppableCollectionState,
|
|
128
|
+
type DroppableCollectionStateOptions,
|
|
129
|
+
droppableItem,
|
|
130
|
+
type DroppableItemOptions,
|
|
131
|
+
type DroppableItemResult,
|
|
132
|
+
isEqualDropTarget,
|
|
133
|
+
} from "./collection.ts";
|