@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
|
@@ -75,9 +75,9 @@ export const MenuRadioGroup = React.memo(function MenuRadioGroup(
|
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
|
-
<MenuGroupContext
|
|
79
|
-
<MenuRadioGroupContext
|
|
80
|
-
</MenuGroupContext
|
|
78
|
+
<MenuGroupContext value={setLabelId}>
|
|
79
|
+
<MenuRadioGroupContext value={context}>{element}</MenuRadioGroupContext>
|
|
80
|
+
</MenuGroupContext>
|
|
81
81
|
);
|
|
82
82
|
});
|
|
83
83
|
|
|
@@ -101,7 +101,7 @@ export const MenuRadioItem = function MenuRadioItem(
|
|
|
101
101
|
ref: [itemRef, forwardedRef, listItem.ref],
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
return <MenuRadioItemContext
|
|
104
|
+
return <MenuRadioItemContext value={state}>{element}</MenuRadioItemContext>;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
export interface MenuRadioItemState {
|
|
@@ -93,7 +93,7 @@ export const MenuRoot = fastComponent(function MenuRoot<Payload>(props: MenuRoot
|
|
|
93
93
|
|
|
94
94
|
// Ensure this is not a Menu nested inside ContextMenu.Trigger.
|
|
95
95
|
// ContextMenu parentContext is always undefined as ContextMenu.Root is instantiated with
|
|
96
|
-
// <MenuRootContext
|
|
96
|
+
// <MenuRootContext value={undefined}>
|
|
97
97
|
if (contextMenuContext && !parentMenuRootContext) {
|
|
98
98
|
return {
|
|
99
99
|
type: 'context-menu',
|
|
@@ -632,12 +632,12 @@ export const MenuRoot = fastComponent(function MenuRoot<Payload>(props: MenuRoot
|
|
|
632
632
|
);
|
|
633
633
|
|
|
634
634
|
const content = (
|
|
635
|
-
<MenuRootContext
|
|
635
|
+
<MenuRootContext value={context as MenuRootContext}>
|
|
636
636
|
{handle && <PopupHandleAttachment handle={handle} store={store} />}
|
|
637
637
|
{typeof children === 'function' && !React.isChildrenBlock(children)
|
|
638
638
|
? children({ payload })
|
|
639
639
|
: children}
|
|
640
|
-
</MenuRootContext
|
|
640
|
+
</MenuRootContext>
|
|
641
641
|
);
|
|
642
642
|
|
|
643
643
|
if (parent.type === undefined || parent.type === 'context-menu') {
|
|
@@ -18,9 +18,9 @@ export function MenuSubmenuRoot(props: MenuSubmenuRoot.Props) {
|
|
|
18
18
|
const contextValue = React.useMemo(() => ({ parentMenu }), [parentMenu]);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<MenuSubmenuRootContext
|
|
21
|
+
<MenuSubmenuRootContext value={contextValue}>
|
|
22
22
|
<MenuRoot {...props} />
|
|
23
|
-
</MenuSubmenuRootContext
|
|
23
|
+
</MenuSubmenuRootContext>
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
|
package/src/menubar/Menubar.tsrx
CHANGED
|
@@ -73,7 +73,7 @@ export const Menubar = function Menubar(
|
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
|
-
<MenubarContext
|
|
76
|
+
<MenubarContext value={context}>
|
|
77
77
|
<FloatingTree>
|
|
78
78
|
<MenubarContent>
|
|
79
79
|
<CompositeRoot
|
|
@@ -91,7 +91,7 @@ export const Menubar = function Menubar(
|
|
|
91
91
|
/>
|
|
92
92
|
</MenubarContent>
|
|
93
93
|
</FloatingTree>
|
|
94
|
-
</MenubarContext
|
|
94
|
+
</MenubarContext>
|
|
95
95
|
);
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -84,7 +84,7 @@ export const MeterRoot = function MeterRoot(
|
|
|
84
84
|
props: [defaultProps, elementProps],
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
return <MeterRootContext
|
|
87
|
+
return <MeterRootContext value={contextValue}>{element}</MeterRootContext>;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
export interface MeterRootState {}
|
|
@@ -32,11 +32,7 @@ export const NavigationMenuItem = function NavigationMenuItem(
|
|
|
32
32
|
|
|
33
33
|
const contextValue: NavigationMenuItemContextValue = React.useMemo(() => ({ value }), [value]);
|
|
34
34
|
|
|
35
|
-
return
|
|
36
|
-
<NavigationMenuItemContext.Provider value={contextValue}>
|
|
37
|
-
{element}
|
|
38
|
-
</NavigationMenuItemContext.Provider>
|
|
39
|
-
);
|
|
35
|
+
return <NavigationMenuItemContext value={contextValue}>{element}</NavigationMenuItemContext>;
|
|
40
36
|
};
|
|
41
37
|
|
|
42
38
|
export interface NavigationMenuItemState {}
|
|
@@ -103,14 +103,12 @@ export const NavigationMenuList = function NavigationMenuList(
|
|
|
103
103
|
|
|
104
104
|
if (nested) {
|
|
105
105
|
return (
|
|
106
|
-
<NavigationMenuDismissContext
|
|
107
|
-
{element}
|
|
108
|
-
</NavigationMenuDismissContext.Provider>
|
|
106
|
+
<NavigationMenuDismissContext value={dismissProps}>{element}</NavigationMenuDismissContext>
|
|
109
107
|
);
|
|
110
108
|
}
|
|
111
109
|
|
|
112
110
|
return (
|
|
113
|
-
<NavigationMenuDismissContext
|
|
111
|
+
<NavigationMenuDismissContext value={dismissProps}>
|
|
114
112
|
<CompositeRoot
|
|
115
113
|
render={render}
|
|
116
114
|
className={className}
|
|
@@ -122,7 +120,7 @@ export const NavigationMenuList = function NavigationMenuList(
|
|
|
122
120
|
orientation={orientation}
|
|
123
121
|
tag="ul"
|
|
124
122
|
/>
|
|
125
|
-
</NavigationMenuDismissContext
|
|
123
|
+
</NavigationMenuDismissContext>
|
|
126
124
|
);
|
|
127
125
|
};
|
|
128
126
|
|
|
@@ -28,9 +28,9 @@ export const NavigationMenuPortal = function NavigationMenuPortal(
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<NavigationMenuPortalContext
|
|
31
|
+
<NavigationMenuPortalContext value={keepMounted}>
|
|
32
32
|
<FloatingPortal ref={forwardedRef} {...portalProps} />
|
|
33
|
-
</NavigationMenuPortalContext
|
|
33
|
+
</NavigationMenuPortalContext>
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -179,9 +179,7 @@ export const NavigationMenuPositioner = function NavigationMenuPositioner(
|
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
return (
|
|
182
|
-
<NavigationMenuPositionerContext
|
|
183
|
-
{element}
|
|
184
|
-
</NavigationMenuPositionerContext.Provider>
|
|
182
|
+
<NavigationMenuPositionerContext value={positioning}>{element}</NavigationMenuPositionerContext>
|
|
185
183
|
);
|
|
186
184
|
};
|
|
187
185
|
|
|
@@ -295,11 +295,11 @@ export const NavigationMenuRoot = function NavigationMenuRoot<Value = any>(
|
|
|
295
295
|
);
|
|
296
296
|
|
|
297
297
|
const jsx = (
|
|
298
|
-
<NavigationMenuRootContext
|
|
298
|
+
<NavigationMenuRootContext value={contextValue}>
|
|
299
299
|
<TreeContext componentProps={componentProps} forwardedRef={forwardedRef}>
|
|
300
300
|
{componentProps.children}
|
|
301
301
|
</TreeContext>
|
|
302
|
-
</NavigationMenuRootContext
|
|
302
|
+
</NavigationMenuRootContext>
|
|
303
303
|
);
|
|
304
304
|
|
|
305
305
|
if (!nested) {
|
|
@@ -345,9 +345,9 @@ function TreeContext<Value>(props: {
|
|
|
345
345
|
});
|
|
346
346
|
|
|
347
347
|
return (
|
|
348
|
-
<NavigationMenuTreeContext
|
|
348
|
+
<NavigationMenuTreeContext value={nodeId}>
|
|
349
349
|
<FloatingNode id={nodeId}>{element}</FloatingNode>
|
|
350
|
-
</NavigationMenuTreeContext
|
|
350
|
+
</NavigationMenuTreeContext>
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
353
|
|
|
@@ -491,7 +491,7 @@ export const NumberFieldRoot = function NumberFieldRoot(
|
|
|
491
491
|
});
|
|
492
492
|
|
|
493
493
|
return (
|
|
494
|
-
<NumberFieldRootContext
|
|
494
|
+
<NumberFieldRootContext value={contextValue}>
|
|
495
495
|
{element}
|
|
496
496
|
<input
|
|
497
497
|
{...validation.getValidationProps(disabled, {
|
|
@@ -534,7 +534,7 @@ export const NumberFieldRoot = function NumberFieldRoot(
|
|
|
534
534
|
style={name ? visuallyHiddenInput : visuallyHidden}
|
|
535
535
|
suppressHydrationWarning
|
|
536
536
|
/>
|
|
537
|
-
</NumberFieldRootContext
|
|
537
|
+
</NumberFieldRootContext>
|
|
538
538
|
);
|
|
539
539
|
};
|
|
540
540
|
|
|
@@ -358,11 +358,7 @@ export const NumberFieldScrubArea = function NumberFieldScrubArea(
|
|
|
358
358
|
[isScrubbing, isTouchInput, isPointerLockDenied],
|
|
359
359
|
);
|
|
360
360
|
|
|
361
|
-
return
|
|
362
|
-
<NumberFieldScrubAreaContext.Provider value={contextValue}>
|
|
363
|
-
{element}
|
|
364
|
-
</NumberFieldScrubAreaContext.Provider>
|
|
365
|
-
);
|
|
361
|
+
return <NumberFieldScrubAreaContext value={contextValue}>{element}</NumberFieldScrubAreaContext>;
|
|
366
362
|
};
|
|
367
363
|
|
|
368
364
|
export interface NumberFieldScrubAreaState extends NumberFieldRootState {}
|
|
@@ -399,7 +399,7 @@ export const OTPFieldRoot = function OTPFieldRoot(
|
|
|
399
399
|
setInputCount(newMap.size);
|
|
400
400
|
}}
|
|
401
401
|
>
|
|
402
|
-
<OTPFieldRootContext
|
|
402
|
+
<OTPFieldRootContext value={contextValue}>
|
|
403
403
|
{element}
|
|
404
404
|
{hasValidLength && (
|
|
405
405
|
<input
|
|
@@ -456,7 +456,7 @@ export const OTPFieldRoot = function OTPFieldRoot(
|
|
|
456
456
|
style={name ? visuallyHiddenInput : visuallyHidden}
|
|
457
457
|
/>
|
|
458
458
|
)}
|
|
459
|
-
</OTPFieldRootContext
|
|
459
|
+
</OTPFieldRootContext>
|
|
460
460
|
</CompositeList>
|
|
461
461
|
);
|
|
462
462
|
};
|
|
@@ -121,7 +121,7 @@ export const PopoverPopup = function PopoverPopup(
|
|
|
121
121
|
nextFocusableElement={store.context.triggerFocusTargetRef}
|
|
122
122
|
beforeContentFocusGuardRef={store.context.beforeContentFocusGuardRef}
|
|
123
123
|
>
|
|
124
|
-
<ClosePartContext
|
|
124
|
+
<ClosePartContext value={closePartContext}>{element}</ClosePartContext>
|
|
125
125
|
</FloatingFocusManager>
|
|
126
126
|
);
|
|
127
127
|
};
|
|
@@ -27,9 +27,9 @@ export const PopoverPortal = function PopoverPortal(
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<PopoverPortalContext
|
|
30
|
+
<PopoverPortalContext value={keepMounted}>
|
|
31
31
|
<FloatingPortal ref={forwardedRef} {...portalProps} />
|
|
32
|
-
</PopoverPortalContext
|
|
32
|
+
</PopoverPortalContext>
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -153,12 +153,12 @@ export const PopoverPositioner = function PopoverPositioner(
|
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
return (
|
|
156
|
-
<PopoverPositionerContext
|
|
156
|
+
<PopoverPositionerContext value={positioning}>
|
|
157
157
|
{mounted && trueModalNonHover && (
|
|
158
158
|
<InternalBackdrop inert={inertValue(!open)} cutout={triggerElement} />
|
|
159
159
|
)}
|
|
160
160
|
<FloatingNode id={nodeId}>{element}</FloatingNode>
|
|
161
|
-
</PopoverPositionerContext
|
|
161
|
+
</PopoverPositionerContext>
|
|
162
162
|
);
|
|
163
163
|
};
|
|
164
164
|
|
|
@@ -83,13 +83,13 @@ const PopoverRootComponent = fastComponent(function PopoverRootComponent<Payload
|
|
|
83
83
|
const shouldRenderInteractions = open || mounted;
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<PopoverRootContext
|
|
86
|
+
<PopoverRootContext value={store as PopoverRootContext<unknown>}>
|
|
87
87
|
{handle && <PopupHandleAttachment handle={handle} store={store} />}
|
|
88
88
|
{shouldRenderInteractions && <PopoverInteractions store={store} modal={modal} />}
|
|
89
89
|
{typeof children === 'function' && !React.isChildrenBlock(children)
|
|
90
90
|
? children({ payload })
|
|
91
91
|
: children}
|
|
92
|
-
</PopoverRootContext
|
|
92
|
+
</PopoverRootContext>
|
|
93
93
|
);
|
|
94
94
|
});
|
|
95
95
|
|
|
@@ -29,9 +29,9 @@ export const PreviewCardPortal = function PreviewCardPortal(
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<PreviewCardPortalContext
|
|
32
|
+
<PreviewCardPortalContext value={keepMounted}>
|
|
33
33
|
<FloatingPortalLite ref={forwardedRef} {...portalProps} />
|
|
34
|
-
</PreviewCardPortalContext
|
|
34
|
+
</PreviewCardPortalContext>
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -105,9 +105,9 @@ export const PreviewCardPositioner = function PreviewCardPositioner(
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
|
-
<PreviewCardPositionerContext
|
|
108
|
+
<PreviewCardPositionerContext value={positioning}>
|
|
109
109
|
<FloatingNode id={nodeId}>{element}</FloatingNode>
|
|
110
|
-
</PreviewCardPositionerContext
|
|
110
|
+
</PreviewCardPositionerContext>
|
|
111
111
|
);
|
|
112
112
|
};
|
|
113
113
|
|
|
@@ -83,13 +83,13 @@ function PreviewCardRootComponent<Payload>(props: PreviewCardRoot.Props<Payload>
|
|
|
83
83
|
const shouldRenderInteractions = open || mounted;
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<PreviewCardRootContext
|
|
86
|
+
<PreviewCardRootContext value={store as PreviewCardRootContext}>
|
|
87
87
|
{handle && <PopupHandleAttachment handle={handle} store={store} />}
|
|
88
88
|
{shouldRenderInteractions && <PreviewCardInteractions store={store} />}
|
|
89
89
|
{typeof children === 'function' && !React.isChildrenBlock(children)
|
|
90
90
|
? children({ payload })
|
|
91
91
|
: children}
|
|
92
|
-
</PreviewCardRootContext
|
|
92
|
+
</PreviewCardRootContext>
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -100,9 +100,7 @@ export const ProgressRoot = function ProgressRoot(
|
|
|
100
100
|
stateAttributesMapping: progressStateAttributesMapping,
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
return
|
|
104
|
-
<ProgressRootContext.Provider value={contextValue}>{element}</ProgressRootContext.Provider>
|
|
105
|
-
);
|
|
103
|
+
return <ProgressRootContext value={contextValue}>{element}</ProgressRootContext>;
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
export type ProgressStatus = 'indeterminate' | 'progressing' | 'complete';
|
|
@@ -248,7 +248,7 @@ export const RadioRoot = function RadioRoot<Value>(
|
|
|
248
248
|
});
|
|
249
249
|
|
|
250
250
|
return (
|
|
251
|
-
<RadioRootContext
|
|
251
|
+
<RadioRootContext value={contextValue}>
|
|
252
252
|
{isRadioGroup ? (
|
|
253
253
|
<CompositeItem
|
|
254
254
|
tag="span"
|
|
@@ -264,7 +264,7 @@ export const RadioRoot = function RadioRoot<Value>(
|
|
|
264
264
|
element
|
|
265
265
|
)}
|
|
266
266
|
<input {...inputProps} suppressHydrationWarning />
|
|
267
|
-
</RadioRootContext
|
|
267
|
+
</RadioRootContext>
|
|
268
268
|
);
|
|
269
269
|
};
|
|
270
270
|
|
|
@@ -244,7 +244,7 @@ export const RadioGroup = function RadioGroup<Value>(
|
|
|
244
244
|
};
|
|
245
245
|
|
|
246
246
|
return (
|
|
247
|
-
<RadioGroupContext
|
|
247
|
+
<RadioGroupContext value={contextValue}>
|
|
248
248
|
<CompositeRoot
|
|
249
249
|
render={render}
|
|
250
250
|
className={className}
|
|
@@ -260,7 +260,7 @@ export const RadioGroup = function RadioGroup<Value>(
|
|
|
260
260
|
enableHomeAndEndKeys={false}
|
|
261
261
|
modifierKeys={MODIFIER_KEYS}
|
|
262
262
|
/>
|
|
263
|
-
</RadioGroupContext
|
|
263
|
+
</RadioGroupContext>
|
|
264
264
|
);
|
|
265
265
|
};
|
|
266
266
|
|
|
@@ -23,32 +23,18 @@ export const ScrollAreaContent = function ScrollAreaContent(
|
|
|
23
23
|
const { render, className, style, ...elementProps } = componentProps;
|
|
24
24
|
|
|
25
25
|
const { computeThumbPosition } = useScrollAreaViewportContext();
|
|
26
|
-
const {
|
|
26
|
+
const { viewportState } = useScrollAreaRootContext();
|
|
27
27
|
|
|
28
28
|
const contentWrapperRef = React.useRef<HTMLDivElement | null>(null);
|
|
29
|
-
const computeOnInitialResizeRef = React.useRef(hasMeasuredScrollbar);
|
|
30
29
|
|
|
31
30
|
useIsoLayoutEffect(() => {
|
|
32
31
|
if (typeof ResizeObserver === 'undefined') {
|
|
33
32
|
return undefined;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
hasInitialized = true;
|
|
40
|
-
|
|
41
|
-
// ResizeObserver fires once upon observing. Skip that initial call to avoid
|
|
42
|
-
// double-calculating the thumb position on mount, unless the content mounted
|
|
43
|
-
// after the viewport's initial measurement (in which case this fire is what
|
|
44
|
-
// brings the overflow state in sync).
|
|
45
|
-
if (!computeOnInitialResizeRef.current) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
computeThumbPosition();
|
|
51
|
-
});
|
|
35
|
+
// Deferred notifications can include a resize that happened after the mount
|
|
36
|
+
// measurement, so the first delivery must also recompute the current geometry.
|
|
37
|
+
const resizeObserver = React.createResizeObserver(computeThumbPosition);
|
|
52
38
|
|
|
53
39
|
if (contentWrapperRef.current) {
|
|
54
40
|
resizeObserver.observe(contentWrapperRef.current);
|
|
@@ -343,10 +343,10 @@ export const ScrollAreaRoot = function ScrollAreaRoot(
|
|
|
343
343
|
);
|
|
344
344
|
|
|
345
345
|
return (
|
|
346
|
-
<ScrollAreaRootContext
|
|
346
|
+
<ScrollAreaRootContext value={contextValue}>
|
|
347
347
|
{!disableStyleElements && styleDisableScrollbar.getElement(nonce)}
|
|
348
348
|
{element}
|
|
349
|
-
</ScrollAreaRootContext
|
|
349
|
+
</ScrollAreaRootContext>
|
|
350
350
|
);
|
|
351
351
|
};
|
|
352
352
|
|
|
@@ -231,11 +231,7 @@ export const ScrollAreaScrollbar = function ScrollAreaScrollbar(
|
|
|
231
231
|
return null;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
return
|
|
235
|
-
<ScrollAreaScrollbarContext.Provider value={orientation}>
|
|
236
|
-
{element}
|
|
237
|
-
</ScrollAreaScrollbarContext.Provider>
|
|
238
|
-
);
|
|
234
|
+
return <ScrollAreaScrollbarContext value={orientation}>{element}</ScrollAreaScrollbarContext>;
|
|
239
235
|
};
|
|
240
236
|
|
|
241
237
|
export interface ScrollAreaScrollbarState extends ScrollAreaRootState {
|
|
@@ -313,7 +313,7 @@ export const ScrollAreaViewport = function ScrollAreaViewport(
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
let hasInitialized = false;
|
|
316
|
-
const resizeObserver =
|
|
316
|
+
const resizeObserver = React.createResizeObserver(() => {
|
|
317
317
|
// Avoid duplicate mount-time recompute when observer data matches what the mount
|
|
318
318
|
// scheduling pass already measured. If dimensions changed before the first observer
|
|
319
319
|
// delivery, keep the recompute so overflow transitions stay in sync.
|
|
@@ -420,11 +420,7 @@ export const ScrollAreaViewport = function ScrollAreaViewport(
|
|
|
420
420
|
[computeThumbPosition],
|
|
421
421
|
);
|
|
422
422
|
|
|
423
|
-
return
|
|
424
|
-
<ScrollAreaViewportContext.Provider value={contextValue}>
|
|
425
|
-
{element}
|
|
426
|
-
</ScrollAreaViewportContext.Provider>
|
|
427
|
-
);
|
|
423
|
+
return <ScrollAreaViewportContext value={contextValue}>{element}</ScrollAreaViewportContext>;
|
|
428
424
|
};
|
|
429
425
|
|
|
430
426
|
export interface ScrollAreaViewportProps extends BaseUIComponentProps<
|
|
@@ -39,7 +39,7 @@ export const SelectGroup = function SelectGroup(
|
|
|
39
39
|
],
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
return <SelectGroupContext
|
|
42
|
+
return <SelectGroupContext value={contextValue}>{element}</SelectGroupContext>;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export interface SelectGroupState {}
|
|
@@ -246,7 +246,7 @@ export const SelectItem = React.memo(function SelectItem(
|
|
|
246
246
|
[selected, index, textRef, selectedByFocus],
|
|
247
247
|
);
|
|
248
248
|
|
|
249
|
-
return <SelectItemContext
|
|
249
|
+
return <SelectItemContext value={contextValue}>{element}</SelectItemContext>;
|
|
250
250
|
});
|
|
251
251
|
|
|
252
252
|
export interface SelectItemState {
|
|
@@ -226,10 +226,10 @@ export const SelectPositioner = function SelectPositioner(
|
|
|
226
226
|
labelsRef={store.context.labelsRef}
|
|
227
227
|
onMapChange={onMapChange}
|
|
228
228
|
>
|
|
229
|
-
<SelectPositionerContext
|
|
229
|
+
<SelectPositionerContext value={contextValue}>
|
|
230
230
|
{mounted && modal && <InternalBackdrop inert={inertValue(!open)} cutout={triggerElement} />}
|
|
231
231
|
{element}
|
|
232
|
-
</SelectPositionerContext
|
|
232
|
+
</SelectPositionerContext>
|
|
233
233
|
</CompositeList>
|
|
234
234
|
);
|
|
235
235
|
};
|
|
@@ -499,12 +499,10 @@ export function SelectRoot<Value, Multiple extends boolean | undefined = false>(
|
|
|
499
499
|
}, [multiple, value, form, name, itemToStringValue, disabled]);
|
|
500
500
|
|
|
501
501
|
return (
|
|
502
|
-
<SelectRootContext
|
|
503
|
-
<SelectRootPropsContext
|
|
504
|
-
<SelectFloatingContext
|
|
505
|
-
|
|
506
|
-
</SelectFloatingContext.Provider>
|
|
507
|
-
</SelectRootPropsContext.Provider>
|
|
502
|
+
<SelectRootContext value={store}>
|
|
503
|
+
<SelectRootPropsContext value={rootPropsContextValue}>
|
|
504
|
+
<SelectFloatingContext value={floatingContext}>{children}</SelectFloatingContext>
|
|
505
|
+
</SelectRootPropsContext>
|
|
508
506
|
<input
|
|
509
507
|
{...validation.getValidationProps(disabled, {
|
|
510
508
|
onFocus() {
|
|
@@ -574,7 +572,7 @@ export function SelectRoot<Value, Multiple extends boolean | undefined = false>(
|
|
|
574
572
|
suppressHydrationWarning
|
|
575
573
|
/>
|
|
576
574
|
{hiddenInputs}
|
|
577
|
-
</SelectRootContext
|
|
575
|
+
</SelectRootContext>
|
|
578
576
|
);
|
|
579
577
|
}
|
|
580
578
|
|
|
@@ -49,7 +49,7 @@ export const SelectValue = function SelectValue(
|
|
|
49
49
|
placeholder: !hasSelectedValue,
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
let children = null;
|
|
52
|
+
let children: React.OctaneNode = null;
|
|
53
53
|
if (typeof childrenProp === 'function' && !React.isChildrenBlock(childrenProp)) {
|
|
54
54
|
children = childrenProp(value);
|
|
55
55
|
} else if (childrenProp != null) {
|
|
@@ -390,11 +390,11 @@ export const SliderRoot = function SliderRoot<Value extends number | readonly nu
|
|
|
390
390
|
});
|
|
391
391
|
|
|
392
392
|
return (
|
|
393
|
-
<SliderRootContext
|
|
393
|
+
<SliderRootContext value={contextValue}>
|
|
394
394
|
<CompositeList elementsRef={thumbRefs} onMapChange={setThumbMap}>
|
|
395
395
|
{element}
|
|
396
396
|
</CompositeList>
|
|
397
|
-
</SliderRootContext
|
|
397
|
+
</SliderRootContext>
|
|
398
398
|
);
|
|
399
399
|
};
|
|
400
400
|
|
|
@@ -259,7 +259,7 @@ export const SliderThumb = function SliderThumb(
|
|
|
259
259
|
return undefined;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
const resizeObserver =
|
|
262
|
+
const resizeObserver = React.createResizeObserver(getInsetPosition, ResizeObserverCtor);
|
|
263
263
|
|
|
264
264
|
resizeObserver.observe(control);
|
|
265
265
|
resizeObserver.observe(thumb);
|
|
@@ -375,7 +375,7 @@ export const SliderThumb = function SliderThumb(
|
|
|
375
375
|
event.stopPropagation();
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
let newValue = null;
|
|
378
|
+
let newValue: number | null = null;
|
|
379
379
|
let direction = 0;
|
|
380
380
|
let increment = event.shiftKey ? largeStep : step;
|
|
381
381
|
const roundedValue = roundValueToStep(thumbValue, step, min);
|
|
@@ -229,13 +229,13 @@ export const SwitchRoot = function SwitchRoot(
|
|
|
229
229
|
});
|
|
230
230
|
|
|
231
231
|
return (
|
|
232
|
-
<SwitchRootContext
|
|
232
|
+
<SwitchRootContext value={state}>
|
|
233
233
|
{element}
|
|
234
234
|
{!checked && name && uncheckedValue !== undefined && (
|
|
235
235
|
<input type="hidden" form={form} name={name} value={uncheckedValue} disabled={disabled} />
|
|
236
236
|
)}
|
|
237
237
|
<input {...inputProps} suppressHydrationWarning />
|
|
238
|
-
</SwitchRootContext
|
|
238
|
+
</SwitchRootContext>
|
|
239
239
|
);
|
|
240
240
|
};
|
|
241
241
|
|
|
@@ -45,7 +45,7 @@ export const TabsList = function TabsList(
|
|
|
45
45
|
return undefined;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const resizeObserver =
|
|
48
|
+
const resizeObserver = React.createResizeObserver(() => {
|
|
49
49
|
indicatorUpdateListenersRef.current.forEach((listener) => {
|
|
50
50
|
listener();
|
|
51
51
|
});
|
|
@@ -109,7 +109,7 @@ export const TabsList = function TabsList(
|
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
return (
|
|
112
|
-
<TabsListContext
|
|
112
|
+
<TabsListContext value={tabsListContextValue}>
|
|
113
113
|
<CompositeRoot
|
|
114
114
|
render={render}
|
|
115
115
|
className={className}
|
|
@@ -126,7 +126,7 @@ export const TabsList = function TabsList(
|
|
|
126
126
|
onMapChange={setTabMap}
|
|
127
127
|
disabledIndices={EMPTY_ARRAY}
|
|
128
128
|
/>
|
|
129
|
-
</TabsListContext
|
|
129
|
+
</TabsListContext>
|
|
130
130
|
);
|
|
131
131
|
};
|
|
132
132
|
|
|
@@ -345,9 +345,9 @@ export const TabsRoot = function TabsRoot(
|
|
|
345
345
|
});
|
|
346
346
|
|
|
347
347
|
return (
|
|
348
|
-
<TabsRootContext
|
|
348
|
+
<TabsRootContext value={tabsContextValue}>
|
|
349
349
|
<CompositeList<TabsPanel.Metadata> elementsRef={tabPanelRefs}>{element}</CompositeList>
|
|
350
|
-
</TabsRootContext
|
|
350
|
+
</TabsRootContext>
|
|
351
351
|
);
|
|
352
352
|
};
|
|
353
353
|
|
|
@@ -31,7 +31,7 @@ export const ToastContent = function ToastContent(
|
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const resizeObserver =
|
|
34
|
+
const resizeObserver = React.createResizeObserver(() => recalculateHeight(true));
|
|
35
35
|
const mutationObserver = new MutationObserver(() => recalculateHeight(true));
|
|
36
36
|
|
|
37
37
|
resizeObserver.observe(node);
|