@octanejs/aria 0.0.48 → 0.0.49
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/collections/CollectionBuilder.ts +7 -7
- package/src/collections/Hidden.ts +1 -1
- package/src/components/Breadcrumbs.ts +2 -2
- package/src/components/Button.ts +1 -1
- package/src/components/Calendar.tsx +2 -4
- package/src/components/Checkbox.ts +1 -1
- package/src/components/ColorSwatchPicker.tsx +2 -2
- package/src/components/ComboBox.ts +1 -1
- package/src/components/Disclosure.ts +1 -1
- package/src/components/Form.ts +2 -2
- package/src/components/ListBox.ts +1 -1
- package/src/components/Meter.ts +1 -1
- package/src/components/Popover.ts +3 -3
- 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/Tabs.ts +2 -2
- package/src/components/TagGroup.ts +1 -1
- package/src/components/Toast.tsx +2 -2
- package/src/components/ToggleButton.ts +1 -1
- package/src/components/ToggleButtonGroup.ts +1 -1
- package/src/components/Tooltip.ts +1 -1
- package/src/components/Tree.ts +1 -1
- package/src/components/Virtualizer.tsx +6 -6
- package/src/components/utils.ts +2 -2
- package/src/focus/FocusScope.ts +1 -1
- package/src/i18n/I18nProvider.ts +2 -2
- package/src/interactions/PressResponder.ts +2 -2
- package/src/interactions/context.ts +1 -1
- package/src/interactions/useFocusable.ts +1 -1
- package/src/overlays/Overlay.ts +2 -2
- package/src/overlays/PortalProvider.ts +1 -1
- package/src/overlays/useModal.ts +1 -1
- package/src/utils/openLink.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"license": "MIT AND Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"clsx": "^2.1.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"octane": "^0.1.51 || ^0.2.0"
|
|
56
|
+
"octane": "^0.1.51 || ^0.2.0 || ^0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@tsrx/react": "^0.
|
|
59
|
+
"@tsrx/react": "^0.3.0",
|
|
60
60
|
"esbuild": "^0.28.1",
|
|
61
61
|
"react": "19.2.7",
|
|
62
62
|
"react-aria": "3.51.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-stately": "3.49.0",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
67
|
"vitest": "^4.1.10",
|
|
68
|
-
"octane": "0.
|
|
68
|
+
"octane": "0.3.0"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"exports:check": "node scripts/check-react-aria-components-exports.mjs",
|
|
@@ -80,7 +80,7 @@ export function CollectionBuilder<C extends BaseCollection<any>>(
|
|
|
80
80
|
null,
|
|
81
81
|
createElement(Hidden, {
|
|
82
82
|
target: document.getRootElement(),
|
|
83
|
-
children: createElement(CollectionDocumentContext
|
|
83
|
+
children: createElement(CollectionDocumentContext, {
|
|
84
84
|
value: document,
|
|
85
85
|
children: props.content,
|
|
86
86
|
}),
|
|
@@ -207,7 +207,7 @@ function useSSRCollectionNode<T extends Element>(
|
|
|
207
207
|
parentNode.ownerDocument.nodesByProps.set(props, element);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
return children ? createElement(SSRContext
|
|
210
|
+
return children ? createElement(SSRContext, { value: element, children }) : null;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// The placeholder tag is the node type (`<item>`/`<section>`-style) — a valid
|
|
@@ -240,7 +240,7 @@ export function createLeafComponent<T, P extends object, E extends Element>(
|
|
|
240
240
|
null,
|
|
241
241
|
(node) =>
|
|
242
242
|
// Forward FocusableContext to real DOM tree so tooltips work.
|
|
243
|
-
createElement(FocusableContext
|
|
243
|
+
createElement(FocusableContext, {
|
|
244
244
|
value: focusableProps,
|
|
245
245
|
children: createElement(Component, { node }),
|
|
246
246
|
}),
|
|
@@ -312,7 +312,7 @@ export function Collection<T>(props: CollectionProps<T>): any {
|
|
|
312
312
|
subSlot(slot, 'ctx'),
|
|
313
313
|
);
|
|
314
314
|
|
|
315
|
-
return createElement(CollectionContext
|
|
315
|
+
return createElement(CollectionContext, { value: ctx, children });
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
function CollectionRoot(props: { children: any }): any {
|
|
@@ -320,9 +320,9 @@ function CollectionRoot(props: { children: any }): any {
|
|
|
320
320
|
let doc = useContext(CollectionDocumentContext);
|
|
321
321
|
let wrappedChildren = useMemo(
|
|
322
322
|
() =>
|
|
323
|
-
createElement(CollectionDocumentContext
|
|
323
|
+
createElement(CollectionDocumentContext, {
|
|
324
324
|
value: null,
|
|
325
|
-
children: createElement(ShallowRenderContext
|
|
325
|
+
children: createElement(ShallowRenderContext, {
|
|
326
326
|
value: doc,
|
|
327
327
|
children: props.children,
|
|
328
328
|
}),
|
|
@@ -338,6 +338,6 @@ function CollectionRoot(props: { children: any }): any {
|
|
|
338
338
|
// container, so the placeholders land in the walked tree directly.
|
|
339
339
|
let isSSR = useIsSSR(subSlot(slot, 'ssr'));
|
|
340
340
|
return isSSR
|
|
341
|
-
? createElement(SSRContext
|
|
341
|
+
? createElement(SSRContext, { value: doc, children: wrappedChildren })
|
|
342
342
|
: wrappedChildren;
|
|
343
343
|
}
|
|
@@ -35,7 +35,7 @@ export function Hidden(props: { children: any; target?: Element | null }): any {
|
|
|
35
35
|
return props.children;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
let children = createElement(HiddenContext
|
|
38
|
+
let children = createElement(HiddenContext, {
|
|
39
39
|
value: true,
|
|
40
40
|
children: props.children,
|
|
41
41
|
});
|
|
@@ -80,7 +80,7 @@ export function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>): any {
|
|
|
80
80
|
slot: props.slot || undefined,
|
|
81
81
|
style: props.style,
|
|
82
82
|
className: props.className ?? 'react-aria-Breadcrumbs',
|
|
83
|
-
children: createElement(BreadcrumbsContext
|
|
83
|
+
children: createElement(BreadcrumbsContext, {
|
|
84
84
|
value: props,
|
|
85
85
|
children: createElement(CollectionRoot, { collection }),
|
|
86
86
|
}),
|
|
@@ -161,7 +161,7 @@ export const Breadcrumb: (props: BreadcrumbProps & { ref?: any }) => any = creat
|
|
|
161
161
|
ref,
|
|
162
162
|
'data-disabled': isDisabled || isCurrent || undefined,
|
|
163
163
|
'data-current': isCurrent || undefined,
|
|
164
|
-
children: createElement(LinkContext
|
|
164
|
+
children: createElement(LinkContext, {
|
|
165
165
|
value: linkProps as any,
|
|
166
166
|
children: renderProps.children,
|
|
167
167
|
}),
|
package/src/components/Button.ts
CHANGED
|
@@ -183,7 +183,7 @@ export const Button = /*#__PURE__*/ createHideableComponent(function Button(
|
|
|
183
183
|
'data-focused': isFocused || undefined,
|
|
184
184
|
'data-pending': isPending || undefined,
|
|
185
185
|
'data-focus-visible': isFocusVisible || undefined,
|
|
186
|
-
children: createElement(ProgressBarContext
|
|
186
|
+
children: createElement(ProgressBarContext, {
|
|
187
187
|
value: { id: progressId },
|
|
188
188
|
children: renderProps.children,
|
|
189
189
|
}),
|
|
@@ -523,9 +523,7 @@ export const CalendarGrid = /*#__PURE__*/ (forwardRef as any)(function CalendarG
|
|
|
523
523
|
let DOMProps = filterDOMProps(props, { global: true });
|
|
524
524
|
|
|
525
525
|
return (
|
|
526
|
-
<InternalCalendarGridContext
|
|
527
|
-
value={{ headerProps, weekDays, startDate, weeksInMonth }}
|
|
528
|
-
>
|
|
526
|
+
<InternalCalendarGridContext value={{ headerProps, weekDays, startDate, weeksInMonth }}>
|
|
529
527
|
<dom.table
|
|
530
528
|
render={props.render}
|
|
531
529
|
{...mergeProps(DOMProps, gridProps)}
|
|
@@ -545,7 +543,7 @@ export const CalendarGrid = /*#__PURE__*/ (forwardRef as any)(function CalendarG
|
|
|
545
543
|
</>
|
|
546
544
|
)}
|
|
547
545
|
</dom.table>
|
|
548
|
-
</InternalCalendarGridContext
|
|
546
|
+
</InternalCalendarGridContext>
|
|
549
547
|
);
|
|
550
548
|
});
|
|
551
549
|
|
|
@@ -496,7 +496,7 @@ export function Checkbox(props: CheckboxProps): any {
|
|
|
496
496
|
);
|
|
497
497
|
let [aria, inputRef] = useCheckboxAria(props, userProvidedInputRef, subSlot(slot, 'aria'));
|
|
498
498
|
|
|
499
|
-
return createElement(InternalCheckboxContext
|
|
499
|
+
return createElement(InternalCheckboxContext, {
|
|
500
500
|
value: {
|
|
501
501
|
...aria,
|
|
502
502
|
inputRef,
|
|
@@ -96,7 +96,7 @@ export const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(
|
|
|
96
96
|
}}
|
|
97
97
|
disallowEmptySelection
|
|
98
98
|
>
|
|
99
|
-
<ColorMapContext
|
|
99
|
+
<ColorMapContext value={colorMap}>{props.children}</ColorMapContext>
|
|
100
100
|
</ListBox>
|
|
101
101
|
);
|
|
102
102
|
});
|
|
@@ -169,7 +169,7 @@ export const ColorSwatchPickerItem = forwardRef(function ColorSwatchPickerItem(
|
|
|
169
169
|
style={wrap(props.style)}
|
|
170
170
|
>
|
|
171
171
|
{composeRenderProps(wrap(props.children), (children) => (
|
|
172
|
-
<ColorSwatchContext
|
|
172
|
+
<ColorSwatchContext value={{ color }}>{children}</ColorSwatchContext>
|
|
173
173
|
))}
|
|
174
174
|
</ListBoxItem>
|
|
175
175
|
);
|
|
@@ -162,7 +162,7 @@ export const ComboBox: <T, M extends SelectionMode = 'single'>(
|
|
|
162
162
|
} = props;
|
|
163
163
|
let content = useMemo(
|
|
164
164
|
() =>
|
|
165
|
-
createElement(ListBoxContext
|
|
165
|
+
createElement(ListBoxContext, {
|
|
166
166
|
value: { items: props.items ?? props.defaultItems },
|
|
167
167
|
children:
|
|
168
168
|
typeof children === 'function' && !isChildrenBlock(children)
|
|
@@ -99,7 +99,7 @@ export function DisclosureGroup(props: DisclosureGroupProps): any {
|
|
|
99
99
|
...renderProps,
|
|
100
100
|
ref,
|
|
101
101
|
'data-disabled': props.isDisabled || undefined,
|
|
102
|
-
children: createElement(DisclosureGroupStateContext
|
|
102
|
+
children: createElement(DisclosureGroupStateContext, {
|
|
103
103
|
value: state,
|
|
104
104
|
children: renderProps.children,
|
|
105
105
|
}),
|
package/src/components/Form.ts
CHANGED
|
@@ -54,9 +54,9 @@ export function Form(props: FormProps): any {
|
|
|
54
54
|
...domProps,
|
|
55
55
|
ref,
|
|
56
56
|
className: className || 'react-aria-Form',
|
|
57
|
-
children: createElement(FormContext
|
|
57
|
+
children: createElement(FormContext, {
|
|
58
58
|
value: { ...props, validationBehavior },
|
|
59
|
-
children: createElement(FormValidationContext
|
|
59
|
+
children: createElement(FormValidationContext, {
|
|
60
60
|
value: validationErrors ?? {},
|
|
61
61
|
children,
|
|
62
62
|
}),
|
|
@@ -530,7 +530,7 @@ function ListBoxSectionInner<T>(
|
|
|
530
530
|
return createElement(dom.section, {
|
|
531
531
|
...mergeProps(DOMProps, renderProps, groupProps),
|
|
532
532
|
ref,
|
|
533
|
-
children: createElement(HeaderContext
|
|
533
|
+
children: createElement(HeaderContext, {
|
|
534
534
|
value: { ...headingProps, ref: headingRef },
|
|
535
535
|
children: createElement(CollectionBranch, {
|
|
536
536
|
collection: state.collection,
|
package/src/components/Meter.ts
CHANGED
|
@@ -94,7 +94,7 @@ export function Meter(props: MeterProps): any {
|
|
|
94
94
|
...mergeProps(DOMProps, renderProps, meterProps),
|
|
95
95
|
ref,
|
|
96
96
|
slot: props.slot || undefined,
|
|
97
|
-
children: createElement(LabelContext
|
|
97
|
+
children: createElement(LabelContext, {
|
|
98
98
|
value: { ...labelProps, ref: labelRef, elementType: 'span' },
|
|
99
99
|
children: renderProps.children,
|
|
100
100
|
}),
|
|
@@ -292,7 +292,7 @@ function PopoverInner(allProps: PopoverInnerProps): any {
|
|
|
292
292
|
let children = renderProps.children;
|
|
293
293
|
if (clearContexts) {
|
|
294
294
|
for (let Context of clearContexts) {
|
|
295
|
-
children = createElement(
|
|
295
|
+
children = createElement(Context as any, { value: null, children });
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
return children;
|
|
@@ -353,7 +353,7 @@ function PopoverInner(allProps: PopoverInnerProps): any {
|
|
|
353
353
|
'data-exiting': isExiting || undefined,
|
|
354
354
|
},
|
|
355
355
|
!props.isNonModal ? createElement(DismissButton, { onDismiss: state.close }) : null,
|
|
356
|
-
createElement(OverlayArrowContext
|
|
356
|
+
createElement(OverlayArrowContext, {
|
|
357
357
|
value: { ...arrowProps, placement, ref: arrowRef } as any,
|
|
358
358
|
children,
|
|
359
359
|
}),
|
|
@@ -381,7 +381,7 @@ function PopoverInner(allProps: PopoverInnerProps): any {
|
|
|
381
381
|
createElement('div', {
|
|
382
382
|
ref: containerRef,
|
|
383
383
|
style: { display: 'contents' },
|
|
384
|
-
children: createElement(PopoverGroupContext
|
|
384
|
+
children: createElement(PopoverGroupContext, {
|
|
385
385
|
value: containerRef,
|
|
386
386
|
children: overlay,
|
|
387
387
|
}),
|
|
@@ -112,7 +112,7 @@ export function ProgressBar(props: ProgressBarProps): any {
|
|
|
112
112
|
...mergeProps(DOMProps, renderProps, progressBarProps),
|
|
113
113
|
ref,
|
|
114
114
|
slot: props.slot || undefined,
|
|
115
|
-
children: createElement(LabelContext
|
|
115
|
+
children: createElement(LabelContext, {
|
|
116
116
|
value: { ...labelProps, ref: labelRef, elementType: 'span' },
|
|
117
117
|
children: renderProps.children,
|
|
118
118
|
}),
|
|
@@ -370,7 +370,7 @@ export function Radio(props: RadioProps): any {
|
|
|
370
370
|
subSlot(slot, 'radio'),
|
|
371
371
|
);
|
|
372
372
|
|
|
373
|
-
return createElement(InternalRadioContext
|
|
373
|
+
return createElement(InternalRadioContext, {
|
|
374
374
|
value: { ...aria, inputRef, defaultClassName: 'react-aria-Radio' },
|
|
375
375
|
children: createElement(RadioButton, { ...props, ref } as any),
|
|
376
376
|
});
|
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
|
}),
|
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
|
@@ -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
|
}),
|
|
@@ -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
|
});
|
|
@@ -87,11 +87,11 @@ export function Virtualizer<O>(props: VirtualizerProps<O>): JSX.Element {
|
|
|
87
87
|
);
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
|
-
<CollectionRendererContext
|
|
91
|
-
<VirtualizerOptionsContext
|
|
90
|
+
<CollectionRendererContext value={renderer}>
|
|
91
|
+
<VirtualizerOptionsContext value={{ layout, layoutOptions, shouldObserveItemSize }}>
|
|
92
92
|
{children}
|
|
93
|
-
</VirtualizerOptionsContext
|
|
94
|
-
</CollectionRendererContext
|
|
93
|
+
</VirtualizerOptionsContext>
|
|
94
|
+
</CollectionRendererContext>
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -141,9 +141,9 @@ function CollectionRoot({
|
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
143
|
<div {...contentProps}>
|
|
144
|
-
<VirtualizerContext
|
|
144
|
+
<VirtualizerContext value={state}>
|
|
145
145
|
{renderChildren(null, state.visibleViews, renderDropIndicator, shouldObserveItemSize)}
|
|
146
|
-
</VirtualizerContext
|
|
146
|
+
</VirtualizerContext>
|
|
147
147
|
</div>
|
|
148
148
|
);
|
|
149
149
|
}
|
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;
|
package/src/focus/FocusScope.ts
CHANGED
|
@@ -238,7 +238,7 @@ export function FocusScope(props: FocusScopeProps): any {
|
|
|
238
238
|
);
|
|
239
239
|
|
|
240
240
|
return createElement(
|
|
241
|
-
FocusContext
|
|
241
|
+
FocusContext,
|
|
242
242
|
{ value },
|
|
243
243
|
createElement('span', { 'data-focus-scope-start': true, hidden: true, ref: startRef }),
|
|
244
244
|
children,
|
package/src/i18n/I18nProvider.ts
CHANGED
|
@@ -48,7 +48,7 @@ function I18nProviderWithLocale(props: I18nProviderWithLocaleProps): any {
|
|
|
48
48
|
subSlot(slot, 'value'),
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
return createElement(I18nContext
|
|
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
|
|
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
|
|
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
|
|
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
|
-
//
|
|
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';
|
package/src/overlays/Overlay.ts
CHANGED
|
@@ -80,9 +80,9 @@ export function Overlay(props: OverlayProps): any {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
contents = createElement(OverlayContext
|
|
83
|
+
contents = createElement(OverlayContext, {
|
|
84
84
|
value: contextValue as OverlayContextValue,
|
|
85
|
-
children: createElement(FocusableContext
|
|
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
|
|
27
|
+
return createElement(PortalContext, {
|
|
28
28
|
value: {
|
|
29
29
|
getContainer: getContainer === null ? undefined : (getContainer ?? ctxGetContainer),
|
|
30
30
|
},
|
package/src/overlays/useModal.ts
CHANGED
|
@@ -71,7 +71,7 @@ export function ModalProvider(props: ModalProviderProps): any {
|
|
|
71
71
|
subSlot(slot, 'context'),
|
|
72
72
|
);
|
|
73
73
|
|
|
74
|
-
return createElement(Context
|
|
74
|
+
return createElement(Context, { value: context, children });
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export interface ModalProviderAria {
|
package/src/utils/openLink.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function RouterProvider(props: RouterProviderProps): any {
|
|
|
65
65
|
S('RouterProvider:ctx'),
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
return createElement(RouterContext
|
|
68
|
+
return createElement(RouterContext, { value: ctx, children });
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export function useRouter(): Router {
|