@octanejs/base-ui 0.1.53 → 0.1.55
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/UPSTREAM.md +12 -0
- package/package.json +7 -7
- package/src/accordion/item/AccordionItem.tsrx +3 -5
- package/src/accordion/root/AccordionRoot.tsrx +2 -2
- package/src/avatar/root/AvatarRoot.tsrx +1 -1
- package/src/checkbox/root/CheckboxRoot.tsrx +2 -2
- package/src/checkbox-group/CheckboxGroup.tsrx +1 -3
- package/src/collapsible/root/CollapsibleRoot.tsrx +1 -5
- package/src/combobox/chip/ComboboxChip.tsrx +1 -3
- package/src/combobox/chips/ComboboxChips.tsrx +2 -2
- package/src/combobox/collection/GroupCollectionContext.tsrx +1 -5
- package/src/combobox/group/ComboboxGroup.tsrx +1 -1
- package/src/combobox/input/ComboboxInput.tsrx +1 -3
- package/src/combobox/item/ComboboxItem.tsrx +1 -3
- package/src/combobox/portal/ComboboxPortal.tsrx +2 -2
- package/src/combobox/positioner/ComboboxPositioner.tsrx +2 -2
- package/src/combobox/root/AriaCombobox.tsrx +9 -11
- package/src/combobox/row/ComboboxRow.tsrx +1 -1
- package/src/combobox/value/ComboboxValue.tsrx +1 -1
- package/src/context-menu/root/ContextMenuRoot.tsrx +4 -4
- package/src/csp-provider/CSPProvider.tsrx +1 -1
- package/src/dialog/portal/DialogPortal.tsrx +2 -2
- package/src/dialog/root/useRenderDialogRoot.tsrx +2 -2
- package/src/direction-provider/DirectionProvider.tsrx +1 -3
- package/src/drawer/popup/DrawerPopup.tsrx +1 -1
- package/src/drawer/provider/DrawerProvider.tsrx +1 -3
- package/src/drawer/root/DrawerRoot.tsrx +1 -1
- package/src/drawer/root/useDrawerSnapPoints.ts +1 -1
- package/src/drawer/viewport/DrawerViewport.tsrx +1 -3
- package/src/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.tsrx +1 -3
- package/src/field/item/FieldItem.tsrx +1 -1
- package/src/field/root/FieldRoot.tsrx +1 -1
- package/src/fieldset/root/FieldsetRoot.tsrx +1 -3
- package/src/floating-ui-react/components/FloatingDelayGroup.tsrx +2 -2
- package/src/floating-ui-react/components/FloatingPortal.tsrx +2 -2
- package/src/floating-ui-react/components/FloatingTree.tsrx +3 -3
- package/src/form/Form.tsrx +1 -1
- package/src/internals/composite/list/CompositeList.tsrx +1 -3
- package/src/internals/composite/root/CompositeRoot.tsrx +2 -2
- package/src/internals/labelable-provider/LabelableProvider.tsrx +1 -3
- package/src/menu/checkbox-item/MenuCheckboxItem.tsrx +1 -3
- package/src/menu/group/MenuGroup.tsrx +1 -1
- package/src/menu/portal/MenuPortal.tsrx +2 -2
- package/src/menu/positioner/MenuPositioner.tsrx +2 -2
- package/src/menu/radio-group/MenuRadioGroup.tsrx +3 -3
- package/src/menu/radio-item/MenuRadioItem.tsrx +1 -1
- package/src/menu/root/MenuRoot.tsrx +3 -3
- package/src/menu/submenu-root/MenuSubmenuRoot.tsrx +2 -2
- package/src/menubar/Menubar.tsrx +2 -2
- package/src/meter/root/MeterRoot.tsrx +1 -1
- package/src/navigation-menu/item/NavigationMenuItem.tsrx +1 -5
- package/src/navigation-menu/list/NavigationMenuList.tsrx +3 -5
- package/src/navigation-menu/portal/NavigationMenuPortal.tsrx +2 -2
- package/src/navigation-menu/positioner/NavigationMenuPositioner.tsrx +1 -3
- package/src/navigation-menu/root/NavigationMenuRoot.tsrx +4 -4
- package/src/number-field/root/NumberFieldRoot.tsrx +2 -2
- package/src/number-field/scrub-area/NumberFieldScrubArea.tsrx +1 -5
- package/src/otp-field/root/OTPFieldRoot.tsrx +2 -2
- package/src/popover/popup/PopoverPopup.tsrx +1 -1
- package/src/popover/portal/PopoverPortal.tsrx +2 -2
- package/src/popover/positioner/PopoverPositioner.tsrx +2 -2
- package/src/popover/root/PopoverRoot.tsrx +2 -2
- package/src/preview-card/portal/PreviewCardPortal.tsrx +2 -2
- package/src/preview-card/positioner/PreviewCardPositioner.tsrx +2 -2
- package/src/preview-card/root/PreviewCardRoot.tsrx +2 -2
- package/src/progress/root/ProgressRoot.tsrx +1 -3
- package/src/radio/root/RadioRoot.tsrx +2 -2
- package/src/radio-group/RadioGroup.tsrx +2 -2
- package/src/scroll-area/content/ScrollAreaContent.tsrx +4 -18
- package/src/scroll-area/root/ScrollAreaRoot.tsrx +2 -2
- package/src/scroll-area/scrollbar/ScrollAreaScrollbar.tsrx +1 -5
- package/src/scroll-area/viewport/ScrollAreaViewport.tsrx +2 -6
- package/src/select/group/SelectGroup.tsrx +1 -1
- package/src/select/item/SelectItem.tsrx +1 -1
- package/src/select/positioner/SelectPositioner.tsrx +2 -2
- package/src/select/root/SelectRoot.tsrx +5 -7
- package/src/select/value/SelectValue.tsrx +1 -1
- package/src/slider/root/SliderRoot.tsrx +2 -2
- package/src/slider/thumb/SliderThumb.tsrx +2 -2
- package/src/switch/root/SwitchRoot.tsrx +2 -2
- package/src/tabs/list/TabsList.tsrx +3 -3
- package/src/tabs/root/TabsRoot.tsrx +2 -2
- package/src/toast/content/ToastContent.tsrx +1 -1
- package/src/toast/positioner/ToastPositioner.tsrx +1 -3
- package/src/toast/provider/ToastProvider.tsrx +2 -2
- package/src/toast/root/ToastRoot.tsrx +1 -1
- package/src/toggle-group/ToggleGroup.tsrx +2 -2
- package/src/toolbar/group/ToolbarGroup.tsrx +1 -3
- package/src/toolbar/root/ToolbarRoot.tsrx +2 -2
- package/src/tooltip/portal/TooltipPortal.tsrx +2 -2
- package/src/tooltip/positioner/TooltipPositioner.tsrx +1 -5
- package/src/tooltip/provider/TooltipProvider.tsrx +2 -2
- package/src/tooltip/root/TooltipRoot.tsrx +2 -2
package/UPSTREAM.md
CHANGED
|
@@ -27,6 +27,18 @@ in CI and none otherwise. The byte-exact configuration is retained under
|
|
|
27
27
|
`audit/repository-fixtures/`. Test identities, assertions, skips, and todos remain
|
|
28
28
|
subject to the same strict report validation after retries.
|
|
29
29
|
|
|
30
|
+
The `#test-utils` facades scope the unchanged upstream `waitSingleFrame` helper
|
|
31
|
+
in the corresponding renderer's `act()`, so frame-driven transition updates
|
|
32
|
+
commit before focus and DOM assertions. The pristine runner uses a virtual
|
|
33
|
+
facade over its selected upstream root; pristine bytes, test identities,
|
|
34
|
+
assertions, and warning checks remain unchanged.
|
|
35
|
+
|
|
36
|
+
The adapted Accordion CSS-transition suite explicitly enables animation waiting
|
|
37
|
+
and restores the prior test flag afterward, matching neighboring upstream motion
|
|
38
|
+
tests. The pinned setup disables animation waiting globally; without the local
|
|
39
|
+
opt-in, the authored 300ms exit transition is bypassed. This fixture correction
|
|
40
|
+
preserves every assertion and registration and leaves the pristine suite unchanged.
|
|
41
|
+
|
|
30
42
|
Native source and adapted type tests pass strict `tsrx-tsc` checks with declaration
|
|
31
43
|
checking enabled. The formal public type gate also passes. All 79 Base UI public entries and 2,073 entry/export pairs have consumer assertions, including 31 retained Octane compatibility exports.
|
|
32
44
|
The gate verifies the npm tarball integrity and installed declaration bytes before
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/base-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -430,11 +430,11 @@
|
|
|
430
430
|
},
|
|
431
431
|
"dependencies": {
|
|
432
432
|
"@floating-ui/utils": "^0.2.12",
|
|
433
|
-
"@octanejs/base-ui-utils": "0.1.
|
|
434
|
-
"@octanejs/floating-ui": "0.1.
|
|
433
|
+
"@octanejs/base-ui-utils": "0.1.3",
|
|
434
|
+
"@octanejs/floating-ui": "0.1.55"
|
|
435
435
|
},
|
|
436
436
|
"peerDependencies": {
|
|
437
|
-
"octane": "^0.
|
|
437
|
+
"octane": "^0.4.0",
|
|
438
438
|
"date-fns": "^4.0.0",
|
|
439
439
|
"@date-fns/tz": "^1.2.0",
|
|
440
440
|
"luxon": "^3.7.2"
|
|
@@ -467,9 +467,9 @@
|
|
|
467
467
|
"typescript-pristine-native": "npm:typescript@7.0.2",
|
|
468
468
|
"jsdom": "27.4.0",
|
|
469
469
|
"semver": "7.8.5",
|
|
470
|
-
"octane": "0.2
|
|
471
|
-
"@octanejs/testing-library": "0.1.
|
|
472
|
-
"@octanejs/remix-router": "0.1.
|
|
470
|
+
"octane": "0.4.2",
|
|
471
|
+
"@octanejs/testing-library": "0.1.53",
|
|
472
|
+
"@octanejs/remix-router": "0.1.50"
|
|
473
473
|
},
|
|
474
474
|
"imports": {
|
|
475
475
|
"#prehydration/tabs/indicator": {
|
|
@@ -134,11 +134,9 @@ export const AccordionItem = function AccordionItem(
|
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
return (
|
|
137
|
-
<CollapsibleRootContext
|
|
138
|
-
<AccordionItemContext
|
|
139
|
-
|
|
140
|
-
</AccordionItemContext.Provider>
|
|
141
|
-
</CollapsibleRootContext.Provider>
|
|
137
|
+
<CollapsibleRootContext value={collapsibleContext}>
|
|
138
|
+
<AccordionItemContext value={accordionItemContext}>{element}</AccordionItemContext>
|
|
139
|
+
</CollapsibleRootContext>
|
|
142
140
|
);
|
|
143
141
|
};
|
|
144
142
|
|
|
@@ -127,9 +127,9 @@ export const AccordionRoot = function AccordionRoot<Value = any>(
|
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
return (
|
|
130
|
-
<AccordionRootContext
|
|
130
|
+
<AccordionRootContext value={contextValue}>
|
|
131
131
|
<CompositeList elementsRef={accordionItemRefs}>{element}</CompositeList>
|
|
132
|
-
</AccordionRootContext
|
|
132
|
+
</AccordionRootContext>
|
|
133
133
|
);
|
|
134
134
|
};
|
|
135
135
|
|
|
@@ -40,7 +40,7 @@ export const AvatarRoot = function AvatarRoot(
|
|
|
40
40
|
stateAttributesMapping: avatarStateAttributesMapping,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
return <AvatarRootContext
|
|
43
|
+
return <AvatarRootContext value={contextValue}>{element}</AvatarRootContext>;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
@@ -391,13 +391,13 @@ export const CheckboxRoot = function CheckboxRoot(
|
|
|
391
391
|
}, [registerChildId, parent, value, renderedId]);
|
|
392
392
|
|
|
393
393
|
return (
|
|
394
|
-
<CheckboxRootContext
|
|
394
|
+
<CheckboxRootContext value={state}>
|
|
395
395
|
{element}
|
|
396
396
|
{!checked && !groupContext && name && !parent && uncheckedValue !== undefined && (
|
|
397
397
|
<input type="hidden" form={form} name={name} value={uncheckedValue} disabled={disabled} />
|
|
398
398
|
)}
|
|
399
399
|
<input {...inputProps} suppressHydrationWarning />
|
|
400
|
-
</CheckboxRootContext
|
|
400
|
+
</CheckboxRootContext>
|
|
401
401
|
);
|
|
402
402
|
};
|
|
403
403
|
|
|
@@ -175,9 +175,7 @@ export const CheckboxGroup = function CheckboxGroup(
|
|
|
175
175
|
stateAttributesMapping: fieldValidityMapping,
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
return
|
|
179
|
-
<CheckboxGroupContext.Provider value={contextValue}>{element}</CheckboxGroupContext.Provider>
|
|
180
|
-
);
|
|
178
|
+
return <CheckboxGroupContext value={contextValue}>{element}</CheckboxGroupContext>;
|
|
181
179
|
};
|
|
182
180
|
|
|
183
181
|
export interface CheckboxGroupState extends FieldRootState {
|
|
@@ -66,11 +66,7 @@ export const CollapsibleRoot = function CollapsibleRoot(
|
|
|
66
66
|
stateAttributesMapping: collapsibleStateAttributesMapping,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
return
|
|
70
|
-
<CollapsibleRootContext.Provider value={contextValue}>
|
|
71
|
-
{element}
|
|
72
|
-
</CollapsibleRootContext.Provider>
|
|
73
|
-
);
|
|
69
|
+
return <CollapsibleRootContext value={contextValue}>{element}</CollapsibleRootContext>;
|
|
74
70
|
};
|
|
75
71
|
|
|
76
72
|
export interface CollapsibleRootState extends Pick<
|
|
@@ -130,9 +130,7 @@ export const ComboboxChip = function ComboboxChip(
|
|
|
130
130
|
[index],
|
|
131
131
|
);
|
|
132
132
|
|
|
133
|
-
return
|
|
134
|
-
<ComboboxChipContext.Provider value={contextValue}>{element}</ComboboxChipContext.Provider>
|
|
135
|
-
);
|
|
133
|
+
return <ComboboxChipContext value={contextValue}>{element}</ComboboxChipContext>;
|
|
136
134
|
};
|
|
137
135
|
|
|
138
136
|
export interface ComboboxChipState {
|
|
@@ -62,9 +62,9 @@ export const ComboboxChips = function ComboboxChips(
|
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
|
-
<ComboboxChipsContext
|
|
65
|
+
<ComboboxChipsContext value={contextValue}>
|
|
66
66
|
<CompositeList elementsRef={chipsRef}>{element}</CompositeList>
|
|
67
|
-
</ComboboxChipsContext
|
|
67
|
+
</ComboboxChipsContext>
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -16,11 +16,7 @@ export function GroupCollectionProvider(props: GroupCollectionProvider.Props) {
|
|
|
16
16
|
|
|
17
17
|
const contextValue = React.useMemo(() => ({ items }), [items]);
|
|
18
18
|
|
|
19
|
-
return
|
|
20
|
-
<GroupCollectionContext.Provider value={contextValue}>
|
|
21
|
-
{children}
|
|
22
|
-
</GroupCollectionContext.Provider>
|
|
23
|
-
);
|
|
19
|
+
return <GroupCollectionContext value={contextValue}>{children}</GroupCollectionContext>;
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
namespace GroupCollectionProvider {
|
|
@@ -48,7 +48,7 @@ export const ComboboxGroup = function ComboboxGroup(
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const wrappedElement = (
|
|
51
|
-
<ComboboxGroupContext
|
|
51
|
+
<ComboboxGroupContext value={contextValue}>{element}</ComboboxGroupContext>
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
if (items) {
|
|
@@ -457,9 +457,7 @@ export const ComboboxInput = function ComboboxInput(
|
|
|
457
457
|
});
|
|
458
458
|
|
|
459
459
|
const renderedInput = hasPositionerParent ? (
|
|
460
|
-
<FieldRootContext
|
|
461
|
-
{element}
|
|
462
|
-
</FieldRootContext.Provider>
|
|
460
|
+
<FieldRootContext value={DEFAULT_FIELD_ROOT_CONTEXT}>{element}</FieldRootContext>
|
|
463
461
|
) : (
|
|
464
462
|
element
|
|
465
463
|
);
|
|
@@ -213,9 +213,7 @@ function ComboboxItemInner(props: ComboboxItemInnerProps) {
|
|
|
213
213
|
[selected, textRef],
|
|
214
214
|
);
|
|
215
215
|
|
|
216
|
-
return
|
|
217
|
-
<ComboboxItemContext.Provider value={contextValue}>{element}</ComboboxItemContext.Provider>
|
|
218
|
-
);
|
|
216
|
+
return <ComboboxItemContext value={contextValue}>{element}</ComboboxItemContext>;
|
|
219
217
|
}
|
|
220
218
|
|
|
221
219
|
/**
|
|
@@ -29,9 +29,9 @@ export const ComboboxPortal = function ComboboxPortal(
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<ComboboxPortalContext
|
|
32
|
+
<ComboboxPortalContext value={keepMounted}>
|
|
33
33
|
<FloatingPortal ref={forwardedRef} {...portalProps} />
|
|
34
|
-
</ComboboxPortalContext
|
|
34
|
+
</ComboboxPortalContext>
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -126,7 +126,7 @@ export const ComboboxPositioner = function ComboboxPositioner(
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
return (
|
|
129
|
-
<ComboboxPositionerContext
|
|
129
|
+
<ComboboxPositionerContext value={positioning}>
|
|
130
130
|
{mounted && modal && (
|
|
131
131
|
<InternalBackdrop
|
|
132
132
|
inert={inertValue(!open)}
|
|
@@ -134,7 +134,7 @@ export const ComboboxPositioner = function ComboboxPositioner(
|
|
|
134
134
|
/>
|
|
135
135
|
)}
|
|
136
136
|
{element}
|
|
137
|
-
</ComboboxPositionerContext
|
|
137
|
+
</ComboboxPositionerContext>
|
|
138
138
|
);
|
|
139
139
|
};
|
|
140
140
|
|
|
@@ -1641,17 +1641,15 @@ export function AriaCombobox<Value = any, Mode extends SelectionMode = 'none', I
|
|
|
1641
1641
|
);
|
|
1642
1642
|
|
|
1643
1643
|
return (
|
|
1644
|
-
<ComboboxRootContext
|
|
1645
|
-
<ComboboxFloatingContext
|
|
1646
|
-
<ComboboxHasItemsContext
|
|
1647
|
-
<ComboboxDerivedItemsContext
|
|
1648
|
-
<ComboboxInputValueContext
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
</ComboboxFloatingContext.Provider>
|
|
1654
|
-
</ComboboxRootContext.Provider>
|
|
1644
|
+
<ComboboxRootContext value={store}>
|
|
1645
|
+
<ComboboxFloatingContext value={floatingRootContext}>
|
|
1646
|
+
<ComboboxHasItemsContext value={hasItems}>
|
|
1647
|
+
<ComboboxDerivedItemsContext value={itemsContextValue}>
|
|
1648
|
+
<ComboboxInputValueContext value={inputValue}>{children}</ComboboxInputValueContext>
|
|
1649
|
+
</ComboboxDerivedItemsContext>
|
|
1650
|
+
</ComboboxHasItemsContext>
|
|
1651
|
+
</ComboboxFloatingContext>
|
|
1652
|
+
</ComboboxRootContext>
|
|
1655
1653
|
);
|
|
1656
1654
|
}
|
|
1657
1655
|
|
|
@@ -24,7 +24,7 @@ export const ComboboxRow = function ComboboxRow(
|
|
|
24
24
|
props: [{ role: 'row' }, elementProps],
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
return <ComboboxRowContext
|
|
27
|
+
return <ComboboxRowContext value>{element}</ComboboxRowContext>;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export interface ComboboxRowState {}
|
|
@@ -26,7 +26,7 @@ export function ComboboxValue(props: ComboboxValue.Props): React.ReactElement {
|
|
|
26
26
|
const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;
|
|
27
27
|
const hasNullLabel = store.useState('hasNullItemLabel', shouldCheckNullItemLabel);
|
|
28
28
|
|
|
29
|
-
let children = null;
|
|
29
|
+
let children: React.OctaneNode = null;
|
|
30
30
|
if (typeof childrenProp === 'function' && !React.isChildrenBlock(childrenProp)) {
|
|
31
31
|
children = childrenProp(selectedValue);
|
|
32
32
|
} else if (childrenProp != null) {
|
|
@@ -44,11 +44,11 @@ export function ContextMenuRoot(props: ContextMenuRoot.Props) {
|
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<ContextMenuRootContext
|
|
48
|
-
<MenuRootContext
|
|
47
|
+
<ContextMenuRootContext value={contextValue}>
|
|
48
|
+
<MenuRootContext value={undefined}>
|
|
49
49
|
<Menu.Root {...props} />
|
|
50
|
-
</MenuRootContext
|
|
51
|
-
</ContextMenuRootContext
|
|
50
|
+
</MenuRootContext>
|
|
51
|
+
</ContextMenuRootContext>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -19,7 +19,7 @@ export function CSPProvider(props: CSPProvider.Props) {
|
|
|
19
19
|
[nonce, disableStyleElements],
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
return <CSPContext
|
|
22
|
+
return <CSPContext value={contextValue}>{children}</CSPContext>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface CSPProviderState {}
|
|
@@ -31,14 +31,14 @@ export const DialogPortal = function DialogPortal(
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<DialogPortalContext
|
|
34
|
+
<DialogPortalContext value={keepMounted}>
|
|
35
35
|
<FloatingPortal ref={forwardedRef} {...portalProps}>
|
|
36
36
|
{mounted && modal === true && (
|
|
37
37
|
<InternalBackdrop ref={store.context.internalBackdropRef} inert={inertValue(!open)} />
|
|
38
38
|
)}
|
|
39
39
|
{props.children}
|
|
40
40
|
</FloatingPortal>
|
|
41
|
-
</DialogPortalContext
|
|
41
|
+
</DialogPortalContext>
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -89,7 +89,7 @@ export function useRenderDialogRoot<Payload>(
|
|
|
89
89
|
const shouldRenderInteractions = open || mounted;
|
|
90
90
|
|
|
91
91
|
return (
|
|
92
|
-
<DialogRootContext
|
|
92
|
+
<DialogRootContext value={store as DialogStore<unknown>}>
|
|
93
93
|
{handle && <PopupHandleAttachment handle={handle} store={store} />}
|
|
94
94
|
{shouldRenderInteractions && (
|
|
95
95
|
<DialogInteractions
|
|
@@ -101,7 +101,7 @@ export function useRenderDialogRoot<Payload>(
|
|
|
101
101
|
{typeof children === 'function' && !React.isChildrenBlock(children)
|
|
102
102
|
? children({ payload })
|
|
103
103
|
: children}
|
|
104
|
-
</DialogRootContext
|
|
104
|
+
</DialogRootContext>
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -15,9 +15,7 @@ export const DirectionProvider: React.FC<DirectionProvider.Props> = function Dir
|
|
|
15
15
|
) {
|
|
16
16
|
const { direction = 'ltr' } = props;
|
|
17
17
|
const contextValue = React.useMemo(() => ({ direction }), [direction]);
|
|
18
|
-
return
|
|
19
|
-
<DirectionContext.Provider value={contextValue}>{props.children}</DirectionContext.Provider>
|
|
20
|
-
);
|
|
18
|
+
return <DirectionContext value={contextValue}>{props.children}</DirectionContext>;
|
|
21
19
|
};
|
|
22
20
|
|
|
23
21
|
export interface DirectionProviderState {}
|
|
@@ -234,7 +234,7 @@ export const DrawerPopup = function DrawerPopup(
|
|
|
234
234
|
return undefined;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
const resizeObserver =
|
|
237
|
+
const resizeObserver = React.createResizeObserver(measureHeight);
|
|
238
238
|
|
|
239
239
|
resizeObserver.observe(popupElement);
|
|
240
240
|
return () => {
|
|
@@ -51,9 +51,7 @@ export function DrawerProvider(props: DrawerProvider.Props) {
|
|
|
51
51
|
[active, removeDrawer, setDrawerOpen, visualStateStore],
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
return
|
|
55
|
-
<DrawerProviderContext.Provider value={contextValue}>{children}</DrawerProviderContext.Provider>
|
|
56
|
-
);
|
|
54
|
+
return <DrawerProviderContext value={contextValue}>{children}</DrawerProviderContext>;
|
|
57
55
|
}
|
|
58
56
|
|
|
59
57
|
export interface DrawerProviderState {}
|
|
@@ -247,7 +247,7 @@ export function DrawerRoot<Payload = unknown>(props: DrawerRoot.Props<Payload>)
|
|
|
247
247
|
children: resolvedChildren,
|
|
248
248
|
});
|
|
249
249
|
|
|
250
|
-
return <DrawerRootContext
|
|
250
|
+
return <DrawerRootContext value={contextValue}>{dialog}</DrawerRootContext>;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
export interface DrawerRootState {}
|
|
@@ -109,7 +109,7 @@ export function useDrawerSnapPoints() {
|
|
|
109
109
|
return undefined;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const resizeObserver =
|
|
112
|
+
const resizeObserver = React.createResizeObserver(measureViewportHeight);
|
|
113
113
|
resizeObserver.observe(viewportElement);
|
|
114
114
|
return () => {
|
|
115
115
|
resizeObserver.disconnect();
|
|
@@ -1022,9 +1022,7 @@ export const DrawerViewport = function DrawerViewport(
|
|
|
1022
1022
|
className={className}
|
|
1023
1023
|
style={style}
|
|
1024
1024
|
>
|
|
1025
|
-
<DrawerViewportContext
|
|
1026
|
-
{children}
|
|
1027
|
-
</DrawerViewportContext.Provider>
|
|
1025
|
+
<DrawerViewportContext value={swipeProviderValue}>{children}</DrawerViewportContext>
|
|
1028
1026
|
</DialogViewport>
|
|
1029
1027
|
);
|
|
1030
1028
|
};
|
|
@@ -648,9 +648,7 @@ export function DrawerVirtualKeyboardProvider(props: DrawerVirtualKeyboardProvid
|
|
|
648
648
|
);
|
|
649
649
|
|
|
650
650
|
return (
|
|
651
|
-
<DrawerVirtualKeyboardContext
|
|
652
|
-
{children}
|
|
653
|
-
</DrawerVirtualKeyboardContext.Provider>
|
|
651
|
+
<DrawerVirtualKeyboardContext value={contextValue}>{children}</DrawerVirtualKeyboardContext>
|
|
654
652
|
);
|
|
655
653
|
}
|
|
656
654
|
|
|
@@ -44,7 +44,7 @@ export const FieldItem = function FieldItem(
|
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<LabelableProvider>
|
|
47
|
-
<FieldItemContext
|
|
47
|
+
<FieldItemContext value={fieldItemContext}>{element}</FieldItemContext>
|
|
48
48
|
</LabelableProvider>
|
|
49
49
|
);
|
|
50
50
|
};
|
|
@@ -192,7 +192,7 @@ const FieldRootInner = function FieldRootInner(
|
|
|
192
192
|
stateAttributesMapping: fieldValidityMapping,
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
return <FieldRootContext
|
|
195
|
+
return <FieldRootContext value={contextValue}>{element}</FieldRootContext>;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
198
|
/**
|
|
@@ -54,9 +54,7 @@ export const FieldsetRoot = function FieldsetRoot(
|
|
|
54
54
|
[legendId, setLegendId, disabled],
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
return
|
|
58
|
-
<FieldsetRootContext.Provider value={contextValue}>{element}</FieldsetRootContext.Provider>
|
|
59
|
-
);
|
|
57
|
+
return <FieldsetRootContext value={contextValue}>{element}</FieldsetRootContext>;
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
export interface FieldsetRootState {
|
|
@@ -87,7 +87,7 @@ export function FloatingDelayGroup(props: FloatingDelayGroupProps): React.ReactE
|
|
|
87
87
|
}, [delay, currentIdRef, delayRef, initialDelayRef]);
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
|
-
<FloatingDelayGroupContext
|
|
90
|
+
<FloatingDelayGroupContext
|
|
91
91
|
value={React.useMemo(
|
|
92
92
|
() => ({
|
|
93
93
|
hasProvider: true,
|
|
@@ -102,7 +102,7 @@ export function FloatingDelayGroup(props: FloatingDelayGroupProps): React.ReactE
|
|
|
102
102
|
)}
|
|
103
103
|
>
|
|
104
104
|
{children}
|
|
105
|
-
</FloatingDelayGroupContext
|
|
105
|
+
</FloatingDelayGroupContext>
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -254,7 +254,7 @@ export const FloatingPortal = function FloatingPortal(
|
|
|
254
254
|
return (
|
|
255
255
|
<React.Fragment>
|
|
256
256
|
{portalSubtree}
|
|
257
|
-
<PortalContext
|
|
257
|
+
<PortalContext value={portalContextValue}>
|
|
258
258
|
{shouldRenderGuards && portalNode && (
|
|
259
259
|
<FocusGuard
|
|
260
260
|
data-type="outside"
|
|
@@ -296,7 +296,7 @@ export const FloatingPortal = function FloatingPortal(
|
|
|
296
296
|
}}
|
|
297
297
|
/>
|
|
298
298
|
)}
|
|
299
|
-
</PortalContext
|
|
299
|
+
</PortalContext>
|
|
300
300
|
</React.Fragment>
|
|
301
301
|
);
|
|
302
302
|
};
|
|
@@ -65,9 +65,9 @@ export function FloatingNode(props: FloatingNodeProps): React.ReactElement {
|
|
|
65
65
|
const parentId = useFloatingParentNodeId();
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
|
-
<FloatingNodeContext
|
|
68
|
+
<FloatingNodeContext value={React.useMemo(() => ({ id, parentId }), [id, parentId])}>
|
|
69
69
|
{children}
|
|
70
|
-
</FloatingNodeContext
|
|
70
|
+
</FloatingNodeContext>
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -91,5 +91,5 @@ export function FloatingTree(props: FloatingTreeProps): React.ReactElement {
|
|
|
91
91
|
const { children, externalTree } = props;
|
|
92
92
|
|
|
93
93
|
const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;
|
|
94
|
-
return <FloatingTreeContext
|
|
94
|
+
return <FloatingTreeContext value={tree}>{children}</FloatingTreeContext>;
|
|
95
95
|
}
|
package/src/form/Form.tsrx
CHANGED
|
@@ -171,7 +171,7 @@ export const Form = function Form<FormValues extends Record<string, any> = Recor
|
|
|
171
171
|
[formRef, validationMode, errors, clearErrors],
|
|
172
172
|
);
|
|
173
173
|
|
|
174
|
-
return <FormContext
|
|
174
|
+
return <FormContext value={contextValue}>{element}</FormContext>;
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
export type FormSubmitEventReason = typeof REASONS.none;
|
|
@@ -211,9 +211,7 @@ export function CompositeList<Metadata>(props: CompositeList.Props<Metadata>) {
|
|
|
211
211
|
[register, unregister, subscribeMapChange, nextIndexRef],
|
|
212
212
|
);
|
|
213
213
|
|
|
214
|
-
return
|
|
215
|
-
<CompositeListContext.Provider value={contextValue}>{children}</CompositeListContext.Provider>
|
|
216
|
-
);
|
|
214
|
+
return <CompositeListContext value={contextValue}>{children}</CompositeListContext>;
|
|
217
215
|
}
|
|
218
216
|
|
|
219
217
|
function createMap<Metadata>() {
|
|
@@ -81,7 +81,7 @@ export function CompositeRoot<Metadata extends {}, State extends Record<string,
|
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
<CompositeRootContext
|
|
84
|
+
<CompositeRootContext value={contextValue}>
|
|
85
85
|
<CompositeList<Metadata>
|
|
86
86
|
elementsRef={elementsRef}
|
|
87
87
|
onMapChange={(newMap) => {
|
|
@@ -91,7 +91,7 @@ export function CompositeRoot<Metadata extends {}, State extends Record<string,
|
|
|
91
91
|
>
|
|
92
92
|
{element}
|
|
93
93
|
</CompositeList>
|
|
94
|
-
</CompositeRootContext
|
|
94
|
+
</CompositeRootContext>
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -103,9 +103,7 @@ export const LabelableProvider: React.FC<LabelableProvider.Props> = function Lab
|
|
|
103
103
|
],
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
return
|
|
107
|
-
<LabelableContext.Provider value={contextValue}>{props.children}</LabelableContext.Provider>
|
|
108
|
-
);
|
|
106
|
+
return <LabelableContext value={contextValue}>{props.children}</LabelableContext>;
|
|
109
107
|
};
|
|
110
108
|
|
|
111
109
|
export interface LabelableProviderState {}
|
|
@@ -109,9 +109,7 @@ export const MenuCheckboxItem = function MenuCheckboxItem(
|
|
|
109
109
|
ref: [itemRef, forwardedRef, listItem.ref],
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
return
|
|
113
|
-
<MenuCheckboxItemContext.Provider value={state}>{element}</MenuCheckboxItemContext.Provider>
|
|
114
|
-
);
|
|
112
|
+
return <MenuCheckboxItemContext value={state}>{element}</MenuCheckboxItemContext>;
|
|
115
113
|
};
|
|
116
114
|
|
|
117
115
|
export interface MenuCheckboxItemState {
|
|
@@ -29,7 +29,7 @@ export const MenuGroup = function MenuGroup(
|
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
return <MenuGroupContext
|
|
32
|
+
return <MenuGroupContext value={setLabelId}>{element}</MenuGroupContext>;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export interface MenuGroupProps extends BaseUIComponentProps<'div', MenuGroupState> {
|
|
@@ -32,10 +32,10 @@ export const MenuPortal = function MenuPortal(
|
|
|
32
32
|
const portalOwnerRole = parent.type === 'menu' || parent.type === 'menubar' ? 'group' : undefined;
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<MenuPortalContext
|
|
35
|
+
<MenuPortalContext value={keepMounted}>
|
|
36
36
|
{/* The hidden `aria-owns` owner needs `group` only under role-constrained parents. */}
|
|
37
37
|
<FloatingPortal ref={forwardedRef} {...portalProps} portalOwnerRole={portalOwnerRole} />
|
|
38
|
-
</MenuPortalContext
|
|
38
|
+
</MenuPortalContext>
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -300,7 +300,7 @@ export const MenuPositioner = function MenuPositioner(
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
return (
|
|
303
|
-
<MenuPositionerContext
|
|
303
|
+
<MenuPositionerContext value={positioner}>
|
|
304
304
|
{shouldRenderBackdrop && (
|
|
305
305
|
<InternalBackdrop
|
|
306
306
|
ref={
|
|
@@ -320,7 +320,7 @@ export const MenuPositioner = function MenuPositioner(
|
|
|
320
320
|
{element}
|
|
321
321
|
</CompositeList>
|
|
322
322
|
</FloatingNode>
|
|
323
|
-
</MenuPositionerContext
|
|
323
|
+
</MenuPositionerContext>
|
|
324
324
|
);
|
|
325
325
|
};
|
|
326
326
|
|