@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.
- package/package.json +4 -4
- package/src/calendar/useCalendar.tsx +3 -3
- package/src/calendar/useCalendarBase.tsx +4 -4
- package/src/calendar/useCalendarCell.tsx +3 -3
- package/src/calendar/useCalendarGrid.tsx +3 -3
- package/src/calendar/useCalendarHeading.tsx +3 -3
- package/src/calendar/useCalendarMonthPicker.tsx +3 -3
- package/src/calendar/useCalendarYearPicker.tsx +3 -3
- package/src/calendar/useRangeCalendar.tsx +4 -4
- package/src/calendar/utils.tsx +2 -2
- package/src/collections/CollectionBuilder.ts +7 -7
- package/src/collections/Hidden.ts +1 -1
- package/src/color/useColorArea.tsx +5 -5
- package/src/color/useColorAreaGradient.tsx +3 -3
- package/src/color/useColorChannelField.tsx +3 -3
- package/src/color/useColorField.tsx +5 -5
- package/src/color/useColorSlider.tsx +3 -3
- package/src/color/useColorSwatch.tsx +3 -3
- package/src/color/useColorWheel.tsx +8 -3
- package/src/combobox/useComboBox.tsx +7 -7
- package/src/components/Breadcrumbs.ts +2 -2
- package/src/components/Button.ts +1 -1
- package/src/components/Calendar.tsx +27 -29
- package/src/components/Checkbox.ts +1 -1
- package/src/components/ColorArea.tsx +8 -8
- package/src/components/ColorField.tsx +14 -14
- package/src/components/ColorPicker.tsx +7 -7
- package/src/components/ColorSlider.tsx +9 -9
- package/src/components/ColorSwatch.tsx +8 -8
- package/src/components/ColorSwatchPicker.tsx +16 -11
- package/src/components/ColorThumb.tsx +6 -6
- package/src/components/ColorWheel.tsx +13 -10
- package/src/components/ComboBox.ts +1 -1
- package/src/components/DateField.tsx +19 -19
- package/src/components/DatePicker.tsx +17 -14
- package/src/components/Disclosure.ts +1 -1
- package/src/components/DropZone.tsx +7 -7
- package/src/components/FileTrigger.tsx +2 -2
- package/src/components/Form.ts +2 -2
- package/src/components/GridLayout.tsx +2 -2
- package/src/components/HiddenDateInput.tsx +3 -3
- package/src/components/ListBox.ts +1 -1
- package/src/components/Meter.ts +1 -1
- package/src/components/Popover.ts +3 -3
- package/src/components/PreviewTrigger.tsx +4 -4
- package/src/components/ProgressBar.ts +1 -1
- package/src/components/RadioGroup.ts +1 -1
- package/src/components/Select.ts +1 -1
- package/src/components/SharedElementTransition.ts +1 -1
- package/src/components/Table.ts +3 -3
- package/src/components/TableLayout.tsx +2 -2
- package/src/components/Tabs.ts +2 -2
- package/src/components/TagGroup.ts +1 -1
- package/src/components/Toast.tsx +17 -17
- package/src/components/ToggleButton.ts +1 -1
- package/src/components/ToggleButtonGroup.ts +1 -1
- package/src/components/TokenField.tsx +13 -13
- package/src/components/Tooltip.ts +1 -1
- package/src/components/Tree.ts +1 -1
- package/src/components/Virtualizer.tsx +18 -12
- package/src/components/useDragAndDrop.tsx +16 -16
- package/src/components/utils.ts +2 -2
- package/src/datepicker/useDateField.tsx +5 -5
- package/src/datepicker/useDatePicker.tsx +5 -5
- package/src/datepicker/useDatePickerGroup.tsx +4 -4
- package/src/datepicker/useDateRangePicker.tsx +6 -6
- package/src/datepicker/useDateSegment.tsx +6 -3
- package/src/dnd/DragManager.tsx +2 -2
- package/src/dnd/DragPreview.tsx +3 -3
- package/src/dnd/DropTargetKeyboardNavigation.tsx +1 -1
- package/src/dnd/ListDropTargetDelegate.tsx +1 -1
- package/src/dnd/constants.tsx +1 -1
- package/src/dnd/useAutoScroll.tsx +1 -1
- package/src/dnd/useClipboard.tsx +1 -1
- package/src/dnd/useDrag.tsx +7 -7
- package/src/dnd/useDraggableCollection.tsx +2 -2
- package/src/dnd/useDraggableItem.tsx +4 -4
- package/src/dnd/useDrop.tsx +3 -3
- package/src/dnd/useDropIndicator.tsx +3 -3
- package/src/dnd/useDroppableCollection.tsx +3 -3
- package/src/dnd/useDroppableItem.tsx +3 -3
- package/src/dnd/useVirtualDrop.tsx +2 -2
- package/src/dnd/utils.tsx +2 -2
- package/src/focus/FocusScope.ts +1 -1
- package/src/grid/useGridCell.tsx +4 -4
- package/src/gridlist/useGridListItem.tsx +13 -3
- package/src/i18n/I18nProvider.ts +2 -2
- package/src/interactions/PressResponder.ts +2 -2
- package/src/interactions/context.ts +1 -1
- package/src/interactions/useContextMenu.tsx +1 -1
- package/src/interactions/useFocusable.ts +1 -1
- package/src/landmark/useLandmark.tsx +6 -1
- package/src/menu/useMenuTrigger.tsx +5 -5
- package/src/menu/useSubmenuTrigger.tsx +9 -3
- package/src/numberfield/useNumberField.tsx +6 -6
- package/src/overlays/Overlay.ts +2 -2
- package/src/overlays/PortalProvider.ts +1 -1
- package/src/overlays/useModal.ts +1 -1
- package/src/overlays/useOverlay.tsx +1 -1
- package/src/radio/useRadioGroup.tsx +2 -2
- package/src/searchfield/useSearchField.tsx +5 -5
- package/src/selection/useSelectableCollection.tsx +3 -3
- package/src/slider/useSliderThumb.tsx +5 -5
- package/src/spinbutton/useSpinButton.tsx +2 -2
- package/src/stately/calendar/types.tsx +3 -3
- package/src/stately/calendar/useCalendarState.tsx +5 -5
- package/src/stately/calendar/useRangeCalendarState.tsx +5 -5
- package/src/stately/calendar/utils.tsx +2 -2
- package/src/stately/color/Color.tsx +1 -1
- package/src/stately/color/useColor.tsx +1 -1
- package/src/stately/color/useColorAreaState.tsx +2 -2
- package/src/stately/color/useColorChannelFieldState.tsx +3 -3
- package/src/stately/color/useColorFieldState.tsx +3 -3
- package/src/stately/color/useColorPickerState.tsx +2 -2
- package/src/stately/color/useColorSliderState.tsx +2 -2
- package/src/stately/color/useColorWheelState.tsx +2 -2
- package/src/stately/data/useAsyncList.tsx +2 -2
- package/src/stately/data/useListData.tsx +1 -1
- package/src/stately/data/useTreeData.tsx +1 -1
- package/src/stately/datepicker/IncompleteDate.tsx +8 -3
- package/src/stately/datepicker/types.tsx +3 -3
- package/src/stately/datepicker/useDateFieldState.tsx +7 -7
- package/src/stately/datepicker/useDatePickerState.tsx +9 -6
- package/src/stately/datepicker/useDateRangePickerState.tsx +9 -6
- package/src/stately/datepicker/useTimeFieldState.tsx +2 -2
- package/src/stately/datepicker/utils.tsx +3 -3
- package/src/stately/dnd/useDraggableCollectionState.tsx +2 -2
- package/src/stately/dnd/useDroppableCollectionState.tsx +2 -2
- package/src/stately/layout/GridLayout.tsx +8 -2
- package/src/stately/layout/ListLayout.tsx +2 -2
- package/src/stately/layout/TableLayout.tsx +5 -5
- package/src/stately/layout/WaterfallLayout.tsx +8 -2
- package/src/stately/tokenfield/useTokenFieldState.tsx +1 -1
- package/src/stately/virtualizer/Layout.tsx +2 -2
- package/src/stately/virtualizer/LayoutInfo.tsx +1 -1
- package/src/stately/virtualizer/ReusableView.tsx +1 -1
- package/src/stately/virtualizer/ScrollAnchor.tsx +2 -2
- package/src/stately/virtualizer/Virtualizer.tsx +3 -3
- package/src/stately/virtualizer/types.tsx +1 -1
- package/src/stately/virtualizer/useVirtualizerState.tsx +2 -2
- package/src/table/useTableColumnResize.tsx +5 -5
- package/src/toast/useToast.tsx +8 -3
- package/src/toast/useToastRegion.tsx +7 -2
- package/src/tokenfield/useToken.tsx +1 -1
- package/src/tokenfield/useTokenField.tsx +8 -8
- package/src/tooltip/usePreviewTrigger.tsx +3 -3
- package/src/tooltip/useSafeArea.tsx +1 -1
- package/src/utils/openLink.ts +1 -1
- package/src/utils/useLoadMore.tsx +1 -1
- package/src/virtualizer/ScrollView.tsx +5 -5
- package/src/virtualizer/Virtualizer.tsx +5 -5
- package/src/virtualizer/VirtualizerItem.tsx +3 -3
- package/src/virtualizer/useVirtualizerItem.tsx +1 -1
- package/src/virtualizer/utils.tsx +1 -1
package/src/components/Select.ts
CHANGED
|
@@ -505,7 +505,7 @@ export const SelectValue: <T>(props: SelectValueProps<T> & { ref?: any }) => any
|
|
|
505
505
|
...renderProps,
|
|
506
506
|
'data-placeholder': state.selectedItems.length === 0 || undefined,
|
|
507
507
|
// clear description and error message slots
|
|
508
|
-
children: createElement(TextContext
|
|
508
|
+
children: createElement(TextContext, {
|
|
509
509
|
value: undefined,
|
|
510
510
|
children: renderProps.children,
|
|
511
511
|
}),
|
|
@@ -35,7 +35,7 @@ export interface SharedElementTransitionProps {
|
|
|
35
35
|
export function SharedElementTransition(props: SharedElementTransitionProps): any {
|
|
36
36
|
const slot = S('SharedElementTransition');
|
|
37
37
|
let ref = useRef<{ [name: string]: Snapshot }>({}, subSlot(slot, 'scope'));
|
|
38
|
-
return createElement(SharedElementContext
|
|
38
|
+
return createElement(SharedElementContext, { value: ref, children: props.children });
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export interface SharedElementRenderProps {
|
package/src/components/Table.ts
CHANGED
|
@@ -615,7 +615,7 @@ export function ResizableTableContainer(props: ResizableTableContainerProps & {
|
|
|
615
615
|
className: props.className || 'react-aria-ResizableTableContainer',
|
|
616
616
|
style: props.style,
|
|
617
617
|
onScroll: (props as any).onScroll,
|
|
618
|
-
children: createElement(ResizableTableContainerContext
|
|
618
|
+
children: createElement(ResizableTableContainerContext, {
|
|
619
619
|
value: ctx,
|
|
620
620
|
children: props.children,
|
|
621
621
|
}),
|
|
@@ -715,7 +715,7 @@ export function Table(props: TableProps): any {
|
|
|
715
715
|
subSlot(slot, 'options'),
|
|
716
716
|
);
|
|
717
717
|
|
|
718
|
-
let content = createElement(TableOptionsContext
|
|
718
|
+
let content = createElement(TableOptionsContext, {
|
|
719
719
|
value: ctx,
|
|
720
720
|
children: createElement(Collection, props as any),
|
|
721
721
|
});
|
|
@@ -2361,7 +2361,7 @@ export const Cell: (props: CellProps & { ref?: any }) => any = /*#__PURE__*/ cre
|
|
|
2361
2361
|
'data-level': row.level + 1,
|
|
2362
2362
|
'data-tree-column': cell.column!.key === state.treeColumn || undefined,
|
|
2363
2363
|
'data-disabled': isDisabled || undefined,
|
|
2364
|
-
children: createElement(CollectionRendererContext
|
|
2364
|
+
children: createElement(CollectionRendererContext, {
|
|
2365
2365
|
value: DefaultCollectionRenderer,
|
|
2366
2366
|
children: renderProps.children,
|
|
2367
2367
|
}),
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
16
|
TableLayout as BaseTableLayout,
|
|
17
|
-
TableLayoutProps,
|
|
17
|
+
type TableLayoutProps,
|
|
18
18
|
} from '../upstream-exports/react-stately/useVirtualizerState';
|
|
19
|
-
import { LayoutOptionsDelegate } from './Virtualizer';
|
|
19
|
+
import type { LayoutOptionsDelegate } from './Virtualizer';
|
|
20
20
|
import { TableColumnResizeStateContext } from './Table';
|
|
21
21
|
import { useContext, useMemo } from '../compat/react';
|
|
22
22
|
|
package/src/components/Tabs.ts
CHANGED
|
@@ -471,7 +471,7 @@ export const Tab: (props: TabProps & { ref?: any }) => any = createLeafComponent
|
|
|
471
471
|
'data-focus-visible': isFocusVisible || undefined,
|
|
472
472
|
'data-pressed': isPressed || undefined,
|
|
473
473
|
'data-hovered': isHovered || undefined,
|
|
474
|
-
children: createElement(SelectionIndicatorContext
|
|
474
|
+
children: createElement(SelectionIndicatorContext, {
|
|
475
475
|
value: { isSelected },
|
|
476
476
|
children: renderProps.children,
|
|
477
477
|
}),
|
|
@@ -679,7 +679,7 @@ function TabPanelInner(
|
|
|
679
679
|
[TabsContext, null],
|
|
680
680
|
[TabListStateContext, null],
|
|
681
681
|
] as any,
|
|
682
|
-
children: createElement(CollectionRendererContext
|
|
682
|
+
children: createElement(CollectionRendererContext, {
|
|
683
683
|
value: DefaultCollectionRenderer,
|
|
684
684
|
children: renderProps.children,
|
|
685
685
|
}),
|
|
@@ -134,7 +134,7 @@ export function TagGroup(props: TagGroupProps): any {
|
|
|
134
134
|
const slot = S('TagGroup');
|
|
135
135
|
let ref: any;
|
|
136
136
|
[props, ref] = useContextProps(props, (props as any).ref, TagGroupContext, subSlot(slot, 'ctx'));
|
|
137
|
-
return createElement(ListStateContext
|
|
137
|
+
return createElement(ListStateContext, {
|
|
138
138
|
value: null,
|
|
139
139
|
children: createElement(CollectionBuilder, {
|
|
140
140
|
content: props.children,
|
package/src/components/Toast.tsx
CHANGED
|
@@ -13,43 +13,43 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
-
AriaToastProps,
|
|
17
|
-
AriaToastRegionProps,
|
|
16
|
+
type AriaToastProps,
|
|
17
|
+
type AriaToastRegionProps,
|
|
18
18
|
useToast,
|
|
19
19
|
useToastRegion,
|
|
20
20
|
} from '../upstream-exports/react-aria/useToast';
|
|
21
21
|
|
|
22
22
|
import { ButtonContext } from './Button';
|
|
23
23
|
import {
|
|
24
|
-
ClassNameOrFunction,
|
|
25
|
-
ContextValue,
|
|
24
|
+
type ClassNameOrFunction,
|
|
25
|
+
type ContextValue,
|
|
26
26
|
DEFAULT_SLOT,
|
|
27
27
|
dom,
|
|
28
|
-
DOMRenderProps,
|
|
28
|
+
type DOMRenderProps,
|
|
29
29
|
Provider,
|
|
30
|
-
RenderProps,
|
|
31
|
-
StyleRenderProps,
|
|
30
|
+
type RenderProps,
|
|
31
|
+
type StyleRenderProps,
|
|
32
32
|
useContextProps,
|
|
33
33
|
useRenderProps,
|
|
34
34
|
} from './utils';
|
|
35
35
|
import { createPortal, isChildrenBlock } from 'octane';
|
|
36
36
|
import { filterDOMProps } from '../upstream-exports/react-aria/filterDOMProps';
|
|
37
|
-
import { forwardRefType, GlobalDOMAttributes } from '@react-types/shared';
|
|
37
|
+
import type { forwardRefType, GlobalDOMAttributes } from '@react-types/shared';
|
|
38
38
|
import { mergeProps } from '../upstream-exports/react-aria/mergeProps';
|
|
39
39
|
import {
|
|
40
|
-
QueuedToast,
|
|
40
|
+
type QueuedToast,
|
|
41
41
|
ToastQueue,
|
|
42
|
-
ToastState,
|
|
42
|
+
type ToastState,
|
|
43
43
|
useToastQueue,
|
|
44
44
|
} from '../upstream-exports/react-stately/useToastState';
|
|
45
45
|
import React, {
|
|
46
46
|
createContext,
|
|
47
|
-
ForwardedRef,
|
|
47
|
+
type ForwardedRef,
|
|
48
48
|
forwardRef,
|
|
49
|
-
HTMLAttributes,
|
|
50
|
-
JSX,
|
|
51
|
-
ReactElement,
|
|
52
|
-
ReactNode,
|
|
49
|
+
type HTMLAttributes,
|
|
50
|
+
type JSX,
|
|
51
|
+
type ReactElement,
|
|
52
|
+
type ReactNode,
|
|
53
53
|
useContext,
|
|
54
54
|
} from '../compat/react';
|
|
55
55
|
import { TextContext } from './Text';
|
|
@@ -142,7 +142,7 @@ const ToastRegion = /*#__PURE__*/ (forwardRef as any)(function ToastRegion<T>(
|
|
|
142
142
|
let DOMProps = filterDOMProps(props, { global: true });
|
|
143
143
|
|
|
144
144
|
let region = (
|
|
145
|
-
<ToastStateContext
|
|
145
|
+
<ToastStateContext value={state}>
|
|
146
146
|
<dom.div
|
|
147
147
|
{...mergeProps(DOMProps, renderProps, regionProps, focusProps, hoverProps)}
|
|
148
148
|
dir={direction}
|
|
@@ -164,7 +164,7 @@ const ToastRegion = /*#__PURE__*/ (forwardRef as any)(function ToastRegion<T>(
|
|
|
164
164
|
props.children
|
|
165
165
|
)}
|
|
166
166
|
</dom.div>
|
|
167
|
-
</ToastStateContext
|
|
167
|
+
</ToastStateContext>
|
|
168
168
|
);
|
|
169
169
|
|
|
170
170
|
return state.visibleToasts.length > 0 && portalContainer
|
|
@@ -139,7 +139,7 @@ export function ToggleButton(props: ToggleButtonProps): any {
|
|
|
139
139
|
'data-selected': isSelected || undefined,
|
|
140
140
|
'data-hovered': isHovered || undefined,
|
|
141
141
|
'data-focus-visible': isFocusVisible || undefined,
|
|
142
|
-
children: createElement(SelectionIndicatorContext
|
|
142
|
+
children: createElement(SelectionIndicatorContext, {
|
|
143
143
|
value: { isSelected },
|
|
144
144
|
children: renderProps.children,
|
|
145
145
|
}),
|
|
@@ -98,7 +98,7 @@ export function ToggleButtonGroup(props: ToggleButtonGroupProps): any {
|
|
|
98
98
|
slot: props.slot || undefined,
|
|
99
99
|
'data-orientation': props.orientation || 'horizontal',
|
|
100
100
|
'data-disabled': props.isDisabled || undefined,
|
|
101
|
-
children: createElement(ToggleGroupStateContext
|
|
101
|
+
children: createElement(ToggleGroupStateContext, {
|
|
102
102
|
value: state,
|
|
103
103
|
children: createElement(SharedElementTransition, { children: renderProps.children }),
|
|
104
104
|
}),
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { isChildrenBlock, type OctaneNode } from 'octane';
|
|
16
|
-
import { AriaTokenFieldProps } from '../upstream-exports/react-aria/useTokenField';
|
|
16
|
+
import type { AriaTokenFieldProps } from '../upstream-exports/react-aria/useTokenField';
|
|
17
17
|
import {
|
|
18
|
-
ClassNameOrFunction,
|
|
19
|
-
ContextValue,
|
|
18
|
+
type ClassNameOrFunction,
|
|
19
|
+
type ContextValue,
|
|
20
20
|
dom,
|
|
21
21
|
Provider,
|
|
22
|
-
RenderProps,
|
|
23
|
-
SlotProps,
|
|
24
|
-
StyleRenderProps,
|
|
22
|
+
type RenderProps,
|
|
23
|
+
type SlotProps,
|
|
24
|
+
type StyleRenderProps,
|
|
25
25
|
useContextProps,
|
|
26
26
|
useRenderProps,
|
|
27
27
|
useSlot,
|
|
@@ -30,26 +30,26 @@ import {
|
|
|
30
30
|
import { createHideableComponent } from '../collections/Hidden';
|
|
31
31
|
import { FieldInputContext } from './Autocomplete';
|
|
32
32
|
import { filterDOMProps } from '../upstream-exports/react-aria/filterDOMProps';
|
|
33
|
-
import { forwardRefType, GlobalDOMAttributes } from '@react-types/shared';
|
|
34
|
-
import { HoverProps, useHover } from '../upstream-exports/react-aria/useHover';
|
|
33
|
+
import type { forwardRefType, GlobalDOMAttributes } from '@react-types/shared';
|
|
34
|
+
import { type HoverProps, useHover } from '../upstream-exports/react-aria/useHover';
|
|
35
35
|
import { LabelContext } from './Label';
|
|
36
36
|
import { mergeProps } from '../upstream-exports/react-aria/mergeProps';
|
|
37
37
|
import { mergeRefs } from '../upstream-exports/react-aria/mergeRefs';
|
|
38
38
|
import React, {
|
|
39
39
|
createContext,
|
|
40
|
-
ForwardedRef,
|
|
40
|
+
type ForwardedRef,
|
|
41
41
|
forwardRef,
|
|
42
|
-
HTMLAttributes,
|
|
42
|
+
type HTMLAttributes,
|
|
43
43
|
memo,
|
|
44
|
-
RefObject,
|
|
44
|
+
type RefObject,
|
|
45
45
|
useContext,
|
|
46
46
|
useMemo,
|
|
47
47
|
} from '../compat/react';
|
|
48
48
|
import { TextContext } from './Text';
|
|
49
49
|
import {
|
|
50
|
-
TokenFieldState,
|
|
50
|
+
type TokenFieldState,
|
|
51
51
|
TokenFieldValue,
|
|
52
|
-
TokenSegment,
|
|
52
|
+
type TokenSegment,
|
|
53
53
|
useTokenFieldState,
|
|
54
54
|
} from '../upstream-exports/react-stately/useTokenFieldState';
|
|
55
55
|
import { useFocusRing } from '../upstream-exports/react-aria/useFocusRing';
|
|
@@ -239,7 +239,7 @@ function TooltipInner(
|
|
|
239
239
|
'data-placement': placement ?? undefined,
|
|
240
240
|
'data-entering': isEntering || undefined,
|
|
241
241
|
'data-exiting': props.isExiting || undefined,
|
|
242
|
-
children: createElement(OverlayArrowContext
|
|
242
|
+
children: createElement(OverlayArrowContext, {
|
|
243
243
|
value: { ...arrowProps, placement, ref: arrowRef } as any,
|
|
244
244
|
children: renderProps.children,
|
|
245
245
|
}),
|
package/src/components/Tree.ts
CHANGED
|
@@ -765,7 +765,7 @@ export const TreeItemContent: (props: TreeItemContentProps) => any =
|
|
|
765
765
|
} as any,
|
|
766
766
|
subSlot(slot, 'render'),
|
|
767
767
|
);
|
|
768
|
-
return createElement(CollectionRendererContext
|
|
768
|
+
return createElement(CollectionRendererContext, {
|
|
769
769
|
value: DefaultCollectionRenderer,
|
|
770
770
|
children: renderProps.children,
|
|
771
771
|
});
|
|
@@ -13,20 +13,26 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
-
CollectionBranchProps,
|
|
17
|
-
CollectionRenderer,
|
|
16
|
+
type CollectionBranchProps,
|
|
17
|
+
type CollectionRenderer,
|
|
18
18
|
CollectionRendererContext,
|
|
19
|
-
CollectionRootProps,
|
|
19
|
+
type CollectionRootProps,
|
|
20
20
|
renderAfterDropIndicators,
|
|
21
21
|
} from './Collection';
|
|
22
|
-
import { DropTargetDelegate, ItemDropTarget, Node } from '@react-types/shared';
|
|
22
|
+
import type { DropTargetDelegate, ItemDropTarget, Node } from '@react-types/shared';
|
|
23
23
|
import {
|
|
24
24
|
Layout,
|
|
25
25
|
ReusableView,
|
|
26
26
|
useVirtualizerState,
|
|
27
|
-
VirtualizerState,
|
|
27
|
+
type VirtualizerState,
|
|
28
28
|
} from '../upstream-exports/react-stately/useVirtualizerState';
|
|
29
|
-
import React, {
|
|
29
|
+
import React, {
|
|
30
|
+
createContext,
|
|
31
|
+
type JSX,
|
|
32
|
+
type ReactNode,
|
|
33
|
+
useContext,
|
|
34
|
+
useMemo,
|
|
35
|
+
} from '../compat/react';
|
|
30
36
|
import { useScrollView } from '../upstream-exports/react-aria/private/virtualizer/ScrollView';
|
|
31
37
|
import { VirtualizerItem } from '../upstream-exports/react-aria/private/virtualizer/VirtualizerItem';
|
|
32
38
|
|
|
@@ -87,11 +93,11 @@ export function Virtualizer<O>(props: VirtualizerProps<O>): JSX.Element {
|
|
|
87
93
|
);
|
|
88
94
|
|
|
89
95
|
return (
|
|
90
|
-
<CollectionRendererContext
|
|
91
|
-
<VirtualizerOptionsContext
|
|
96
|
+
<CollectionRendererContext value={renderer}>
|
|
97
|
+
<VirtualizerOptionsContext value={{ layout, layoutOptions, shouldObserveItemSize }}>
|
|
92
98
|
{children}
|
|
93
|
-
</VirtualizerOptionsContext
|
|
94
|
-
</CollectionRendererContext
|
|
99
|
+
</VirtualizerOptionsContext>
|
|
100
|
+
</CollectionRendererContext>
|
|
95
101
|
);
|
|
96
102
|
}
|
|
97
103
|
|
|
@@ -141,9 +147,9 @@ function CollectionRoot({
|
|
|
141
147
|
|
|
142
148
|
return (
|
|
143
149
|
<div {...contentProps}>
|
|
144
|
-
<VirtualizerContext
|
|
150
|
+
<VirtualizerContext value={state}>
|
|
145
151
|
{renderChildren(null, state.visibleViews, renderDropIndicator, shouldObserveItemSize)}
|
|
146
|
-
</VirtualizerContext
|
|
152
|
+
</VirtualizerContext>
|
|
147
153
|
</div>
|
|
148
154
|
);
|
|
149
155
|
}
|
|
@@ -13,43 +13,43 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
-
DropIndicatorProps as AriaDropIndicatorProps,
|
|
17
|
-
DropIndicatorAria,
|
|
18
|
-
DroppableCollectionOptions,
|
|
19
|
-
DroppableCollectionResult,
|
|
20
|
-
DroppableItemOptions,
|
|
21
|
-
DroppableItemResult,
|
|
16
|
+
type DropIndicatorProps as AriaDropIndicatorProps,
|
|
17
|
+
type DropIndicatorAria,
|
|
18
|
+
type DroppableCollectionOptions,
|
|
19
|
+
type DroppableCollectionResult,
|
|
20
|
+
type DroppableItemOptions,
|
|
21
|
+
type DroppableItemResult,
|
|
22
22
|
useDropIndicator,
|
|
23
23
|
useDroppableCollection,
|
|
24
24
|
useDroppableItem,
|
|
25
25
|
} from '../upstream-exports/react-aria/useDroppableCollection';
|
|
26
26
|
import {
|
|
27
|
-
DraggableCollectionOptions,
|
|
28
|
-
DraggableItemProps,
|
|
29
|
-
DraggableItemResult,
|
|
27
|
+
type DraggableCollectionOptions,
|
|
28
|
+
type DraggableItemProps,
|
|
29
|
+
type DraggableItemResult,
|
|
30
30
|
DragPreview,
|
|
31
31
|
useDraggableCollection,
|
|
32
32
|
useDraggableItem,
|
|
33
33
|
} from '../upstream-exports/react-aria/useDraggableCollection';
|
|
34
|
-
import {
|
|
34
|
+
import type {
|
|
35
35
|
DraggableCollectionProps,
|
|
36
36
|
DroppableCollectionProps,
|
|
37
37
|
Key,
|
|
38
38
|
RefObject,
|
|
39
39
|
} from '@react-types/shared';
|
|
40
40
|
import {
|
|
41
|
-
DraggableCollectionState,
|
|
42
|
-
DraggableCollectionStateOptions,
|
|
41
|
+
type DraggableCollectionState,
|
|
42
|
+
type DraggableCollectionStateOptions,
|
|
43
43
|
useDraggableCollectionState,
|
|
44
44
|
} from '../upstream-exports/react-stately/useDraggableCollectionState';
|
|
45
|
-
import { DragItem, DropTarget, DropTargetDelegate } from '@react-types/shared';
|
|
45
|
+
import type { DragItem, DropTarget, DropTargetDelegate } from '@react-types/shared';
|
|
46
46
|
import {
|
|
47
|
-
DroppableCollectionState,
|
|
48
|
-
DroppableCollectionStateOptions,
|
|
47
|
+
type DroppableCollectionState,
|
|
48
|
+
type DroppableCollectionStateOptions,
|
|
49
49
|
useDroppableCollectionState,
|
|
50
50
|
} from '../upstream-exports/react-stately/useDroppableCollectionState';
|
|
51
51
|
import { isVirtualDragging } from '../upstream-exports/react-aria/private/dnd/DragManager';
|
|
52
|
-
import { JSX, useMemo } from '../compat/react';
|
|
52
|
+
import { type JSX, useMemo } from '../compat/react';
|
|
53
53
|
import { ListDropTargetDelegate } from '../upstream-exports/react-aria/ListDropTargetDelegate';
|
|
54
54
|
|
|
55
55
|
// Compatibility exports consumed by the existing collection component ports.
|
package/src/components/utils.ts
CHANGED
|
@@ -50,7 +50,7 @@ interface ProviderProps<Contexts extends readonly Context<any>[]> {
|
|
|
50
50
|
children: ReactNode;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
// No hooks (Provider nests plain Context
|
|
53
|
+
// No hooks (Provider nests plain Context descriptors), so no slot threading. The
|
|
54
54
|
// descriptor `{ value, children }` shape stays stable per values entry (see aria memory
|
|
55
55
|
// octane-provider-children-shape-flip).
|
|
56
56
|
export function Provider<const Contexts extends readonly Context<any>[]>(
|
|
@@ -58,7 +58,7 @@ export function Provider<const Contexts extends readonly Context<any>[]>(
|
|
|
58
58
|
): any {
|
|
59
59
|
let { values, children } = props;
|
|
60
60
|
for (let [Context, value] of values) {
|
|
61
|
-
children = createElement(
|
|
61
|
+
children = createElement(Context, { value, children });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return children;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import type {
|
|
16
16
|
AriaLabelingProps,
|
|
17
17
|
DOMAttributes,
|
|
18
18
|
DOMProps,
|
|
@@ -21,17 +21,17 @@ import {
|
|
|
21
21
|
RefObject,
|
|
22
22
|
ValidationResult,
|
|
23
23
|
} from '@react-types/shared';
|
|
24
|
-
import { createFocusManager, FocusManager } from '../focus/FocusScope';
|
|
25
|
-
import {
|
|
24
|
+
import { createFocusManager, type FocusManager } from '../focus/FocusScope';
|
|
25
|
+
import type {
|
|
26
26
|
DateFieldProps,
|
|
27
27
|
DateFieldState,
|
|
28
28
|
DateValue,
|
|
29
29
|
} from '../upstream-exports/react-stately/useDateFieldState';
|
|
30
30
|
import { filterDOMProps } from '../utils/filterDOMProps';
|
|
31
|
-
import { InputHTMLAttributes, useEffect, useMemo, useRef } from '../compat/react';
|
|
31
|
+
import { type InputHTMLAttributes, useEffect, useMemo, useRef } from '../compat/react';
|
|
32
32
|
import intlMessages from '../intl/datepicker/index';
|
|
33
33
|
import { mergeProps } from '../utils/mergeProps';
|
|
34
|
-
import {
|
|
34
|
+
import type {
|
|
35
35
|
TimeFieldState,
|
|
36
36
|
TimePickerProps,
|
|
37
37
|
TimeValue,
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { AriaButtonProps } from '../button/useButton';
|
|
16
|
-
import { AriaDialogProps } from '../dialog/useDialog';
|
|
17
|
-
import {
|
|
15
|
+
import type { AriaButtonProps } from '../button/useButton';
|
|
16
|
+
import type { AriaDialogProps } from '../dialog/useDialog';
|
|
17
|
+
import type {
|
|
18
18
|
AriaLabelingProps,
|
|
19
19
|
DOMAttributes,
|
|
20
20
|
DOMProps,
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
RefObject,
|
|
25
25
|
ValidationResult,
|
|
26
26
|
} from '@react-types/shared';
|
|
27
|
-
import { CalendarProps } from '../upstream-exports/react-stately/useCalendarState';
|
|
27
|
+
import type { CalendarProps } from '../upstream-exports/react-stately/useCalendarState';
|
|
28
28
|
import { createFocusManager } from '../focus/FocusScope';
|
|
29
|
-
import {
|
|
29
|
+
import type {
|
|
30
30
|
DatePickerProps,
|
|
31
31
|
DatePickerState,
|
|
32
32
|
DateValue,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsxImportSource octane */
|
|
2
2
|
// Ported from adobe/react-spectrum@5ecb3333001313e83898cd07644227897e3bae1f (packages/react-aria/src/datepicker/useDatePickerGroup.ts).
|
|
3
3
|
import { createFocusManager, getFocusableTreeWalker } from '../focus/FocusScope';
|
|
4
|
-
import { DateFieldState } from '../upstream-exports/react-stately/useDateFieldState';
|
|
5
|
-
import { DatePickerState } from '../upstream-exports/react-stately/useDatePickerState';
|
|
6
|
-
import { DateRangePickerState } from '../upstream-exports/react-stately/useDateRangePickerState';
|
|
7
|
-
import { DOMAttributes, FocusableElement, RefObject } from '@react-types/shared';
|
|
4
|
+
import type { DateFieldState } from '../upstream-exports/react-stately/useDateFieldState';
|
|
5
|
+
import type { DatePickerState } from '../upstream-exports/react-stately/useDatePickerState';
|
|
6
|
+
import type { DateRangePickerState } from '../upstream-exports/react-stately/useDateRangePickerState';
|
|
7
|
+
import type { DOMAttributes, FocusableElement, RefObject } from '@react-types/shared';
|
|
8
8
|
import { getEventTarget } from '../utils/shadowdom/DOMFunctions';
|
|
9
9
|
import { mergeProps } from '../utils/mergeProps';
|
|
10
10
|
import { useKeyboard } from '../interactions/useKeyboard';
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { AriaButtonProps } from '../button/useButton';
|
|
16
|
-
import { AriaDatePickerProps } from './useDatePicker';
|
|
17
|
-
import { AriaDialogProps } from '../dialog/useDialog';
|
|
18
|
-
import {
|
|
15
|
+
import type { AriaButtonProps } from '../button/useButton';
|
|
16
|
+
import type { AriaDatePickerProps } from './useDatePicker';
|
|
17
|
+
import type { AriaDialogProps } from '../dialog/useDialog';
|
|
18
|
+
import type {
|
|
19
19
|
AriaLabelingProps,
|
|
20
20
|
DOMAttributes,
|
|
21
21
|
DOMProps,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
ValidationResult,
|
|
27
27
|
} from '@react-types/shared';
|
|
28
28
|
import { createFocusManager } from '../focus/FocusScope';
|
|
29
|
-
import {
|
|
29
|
+
import type {
|
|
30
30
|
DateRange,
|
|
31
31
|
DateRangePickerProps,
|
|
32
32
|
DateRangePickerState,
|
|
@@ -42,7 +42,7 @@ import { focusManagerSymbol, roleSymbol } from './useDateField';
|
|
|
42
42
|
import intlMessages from '../intl/datepicker/index';
|
|
43
43
|
import { mergeProps } from '../utils/mergeProps';
|
|
44
44
|
import { nodeContains } from '../utils/shadowdom/DOMFunctions';
|
|
45
|
-
import { RangeCalendarProps } from '../upstream-exports/react-stately/useRangeCalendarState';
|
|
45
|
+
import type { RangeCalendarProps } from '../upstream-exports/react-stately/useRangeCalendarState';
|
|
46
46
|
import { useDatePickerGroup } from './useDatePickerGroup';
|
|
47
47
|
import { useDescription } from '../utils/useDescription';
|
|
48
48
|
import { useField } from '../label/useField';
|
|
@@ -13,15 +13,18 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { CalendarDate, toCalendar } from '@internationalized/date';
|
|
16
|
-
import {
|
|
16
|
+
import type {
|
|
17
|
+
DateFieldState,
|
|
18
|
+
DateSegment,
|
|
19
|
+
} from '../upstream-exports/react-stately/useDateFieldState';
|
|
17
20
|
import { getActiveElement, nodeContains } from '../utils/shadowdom/DOMFunctions';
|
|
18
21
|
import { getScrollParent } from '../utils/getScrollParent';
|
|
19
22
|
import { hookData } from './useDateField';
|
|
20
23
|
import { isIOS } from '../utils/platform';
|
|
21
24
|
import { mergeProps } from '../utils/mergeProps';
|
|
22
25
|
import { NumberParser } from '@internationalized/number';
|
|
23
|
-
import React, { CSSProperties, useMemo, useRef } from '../compat/react';
|
|
24
|
-
import { RefObject } from '@react-types/shared';
|
|
26
|
+
import React, { type CSSProperties, useMemo, useRef } from '../compat/react';
|
|
27
|
+
import type { RefObject } from '@react-types/shared';
|
|
25
28
|
import { scrollIntoViewport } from '../utils/scrollIntoView';
|
|
26
29
|
import { useDateFormatter } from '../i18n/useDateFormatter';
|
|
27
30
|
import { useDisplayNames } from './useDisplayNames';
|
package/src/dnd/DragManager.tsx
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { announce } from '../live-announcer/LiveAnnouncer';
|
|
16
16
|
|
|
17
17
|
import { ariaHideOutside } from '../overlays/ariaHideOutside';
|
|
18
|
-
import {
|
|
18
|
+
import type {
|
|
19
19
|
DragEndEvent,
|
|
20
20
|
DragItem,
|
|
21
21
|
DropActivateEvent,
|
|
@@ -31,7 +31,7 @@ import { getActiveElement, getEventTarget, nodeContains } from '../utils/shadowd
|
|
|
31
31
|
import { getDragModality, getTypes } from './utils';
|
|
32
32
|
import { isVirtualClick, isVirtualPointerEvent } from '../utils/isVirtualEvent';
|
|
33
33
|
import type { LocalizedStringFormatter } from '@internationalized/string';
|
|
34
|
-
import { RefObject, useEffect, useState } from '../compat/react';
|
|
34
|
+
import { type RefObject, useEffect, useState } from '../compat/react';
|
|
35
35
|
|
|
36
36
|
let dropTargets = new Map<Element, DropTarget>();
|
|
37
37
|
let dropItems = new Map<Element, DroppableItem>();
|
package/src/dnd/DragPreview.tsx
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { DragItem, DragPreviewRenderer } from '@react-types/shared';
|
|
15
|
+
import type { DragItem, DragPreviewRenderer } from '@react-types/shared';
|
|
16
16
|
import { flushSync } from 'octane';
|
|
17
17
|
import React, {
|
|
18
|
-
ForwardedRef,
|
|
19
|
-
JSX,
|
|
18
|
+
type ForwardedRef,
|
|
19
|
+
type JSX,
|
|
20
20
|
useEffect,
|
|
21
21
|
useImperativeHandle,
|
|
22
22
|
useRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource octane */
|
|
2
2
|
// Ported from adobe/react-spectrum@1c84a49a1faf50b571c84e00bcf9c60b22ddd03e (packages/react-aria/src/dnd/DropTargetKeyboardNavigation.ts).
|
|
3
|
-
import { Collection, DropTarget, Key, KeyboardDelegate, Node } from '@react-types/shared';
|
|
3
|
+
import type { Collection, DropTarget, Key, KeyboardDelegate, Node } from '@react-types/shared';
|
|
4
4
|
|
|
5
5
|
export function navigate(
|
|
6
6
|
keyboardDelegate: KeyboardDelegate,
|
package/src/dnd/constants.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { getScrollParent } from '../utils/getScrollParent';
|
|
|
16
16
|
|
|
17
17
|
import { isIOS, isWebKit } from '../utils/platform';
|
|
18
18
|
import { isScrollable } from '../utils/isScrollable';
|
|
19
|
-
import { RefObject } from '@react-types/shared';
|
|
19
|
+
import type { RefObject } from '@react-types/shared';
|
|
20
20
|
import { useCallback, useEffect, useRef } from '../compat/react';
|
|
21
21
|
|
|
22
22
|
const AUTOSCROLL_AREA_SIZE = 20;
|
package/src/dnd/useClipboard.tsx
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { chain } from '../utils/chain';
|
|
16
16
|
|
|
17
|
-
import { DOMAttributes, DragItem, DropItem } from '@react-types/shared';
|
|
17
|
+
import type { DOMAttributes, DragItem, DropItem } from '@react-types/shared';
|
|
18
18
|
import { readFromDataTransfer, writeToDataTransfer } from './utils';
|
|
19
19
|
import { useEffect, useRef } from '../compat/react';
|
|
20
20
|
import { useEffectEvent } from '../utils/useEffectEvent';
|
package/src/dnd/useDrag.tsx
CHANGED
|
@@ -13,8 +13,8 @@ import { isIOS, isWebKit } from '../utils/platform';
|
|
|
13
13
|
* governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { AriaButtonProps } from '../button/useButton';
|
|
17
|
-
import {
|
|
16
|
+
import type { AriaButtonProps } from '../button/useButton';
|
|
17
|
+
import type {
|
|
18
18
|
DragEndEvent,
|
|
19
19
|
DragItem,
|
|
20
20
|
DragMoveEvent,
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
RefObject,
|
|
26
26
|
} from '@react-types/shared';
|
|
27
27
|
import {
|
|
28
|
-
DragEvent,
|
|
29
|
-
HTMLAttributes,
|
|
30
|
-
KeyboardEvent,
|
|
31
|
-
MouseEvent,
|
|
32
|
-
PointerEvent,
|
|
28
|
+
type DragEvent,
|
|
29
|
+
type HTMLAttributes,
|
|
30
|
+
type KeyboardEvent,
|
|
31
|
+
type MouseEvent,
|
|
32
|
+
type PointerEvent,
|
|
33
33
|
useEffect,
|
|
34
34
|
useRef,
|
|
35
35
|
useState,
|