@octanejs/base-ui 0.1.11 → 0.1.15
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 +5 -5
- package/src/alert-dialog.ts +2 -0
- package/src/button.ts +63 -0
- package/src/csp-provider.ts +37 -0
- package/src/dialog.ts +89 -22
- package/src/direction-provider.ts +32 -0
- package/src/index.ts +7 -0
- package/src/popover.ts +92 -22
- package/src/preview-card.ts +812 -0
- package/src/slider.ts +4 -2
- package/src/tooltip.ts +1053 -0
- package/src/unstable-use-media-query.ts +101 -0
- package/src/utils/CSPContext.ts +21 -0
- package/src/utils/FloatingPortalLite.ts +29 -0
- package/src/utils/createChangeEventDetails.ts +1 -0
- package/src/utils/floating/FloatingDelayGroup.ts +280 -0
- package/src/utils/floating/element.ts +36 -2
- package/src/utils/floating/safePolygon.ts +448 -0
- package/src/utils/floating/useClientPoint.ts +276 -0
- package/src/utils/floating/useFocus.ts +248 -0
- package/src/utils/floating/useHoverFloatingInteraction.ts +301 -11
- package/src/utils/floating/useHoverInteractionSharedState.ts +139 -0
- package/src/utils/floating/useHoverReferenceInteraction.ts +507 -14
- package/src/utils/floating/useHoverShared.ts +78 -0
- package/src/utils/getCssDimensions.ts +28 -0
- package/src/utils/platform.ts +10 -0
- package/src/utils/popups/index.ts +6 -0
- package/src/utils/popups/inlineRect.ts +289 -0
- package/src/utils/useIsHydrating.ts +24 -7
- package/src/utils/usePopupAutoResize.ts +250 -0
- package/src/utils/usePopupViewport.ts +375 -0
- package/src/utils/usePreviousValue.ts +25 -0
package/src/slider.ts
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
// React hydration-warning no-op). With the default `center` alignment, thumb/indicator positions
|
|
13
13
|
// are pure math (`valueToPercent`), so mount and keyboard interaction render identically without
|
|
14
14
|
// layout (pointer drag needs real layout — inert in jsdom, so not differential-covered).
|
|
15
|
+
// Edge-aligned visibility uses octane's real server/hydration snapshot; the
|
|
16
|
+
// React-specific pre-hydration script is not needed for that snapshot contract.
|
|
15
17
|
import {
|
|
16
18
|
createContext,
|
|
17
19
|
createElement,
|
|
@@ -1016,7 +1018,7 @@ function SliderIndicator(componentProps: any): any {
|
|
|
1016
1018
|
const { render, className, style: styleProp, ref, ...elementProps } = componentProps;
|
|
1017
1019
|
const { indicatorPosition, inset, max, min, orientation, renderBeforeHydration, state, values } =
|
|
1018
1020
|
useSliderRootContext();
|
|
1019
|
-
const isHydrating = useIsHydrating();
|
|
1021
|
+
const isHydrating = useIsHydrating(subSlot(slot, 'hydrating'));
|
|
1020
1022
|
const vertical = orientation === 'vertical';
|
|
1021
1023
|
const range = values.length > 1;
|
|
1022
1024
|
|
|
@@ -1180,7 +1182,7 @@ function SliderThumb(componentProps: any): any {
|
|
|
1180
1182
|
undefined,
|
|
1181
1183
|
subSlot(slot, 'posPct'),
|
|
1182
1184
|
);
|
|
1183
|
-
const isHydrating = useIsHydrating();
|
|
1185
|
+
const isHydrating = useIsHydrating(subSlot(slot, 'hydrating'));
|
|
1184
1186
|
|
|
1185
1187
|
const safeLastUsedThumbIndex =
|
|
1186
1188
|
lastUsedThumbIndex >= 0 && lastUsedThumbIndex < sliderValues.length ? lastUsedThumbIndex : -1;
|