@octanejs/base-ui 0.1.54 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/base-ui",
3
- "version": "0.1.54",
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.2",
434
- "@octanejs/floating-ui": "0.1.54"
433
+ "@octanejs/base-ui-utils": "0.1.3",
434
+ "@octanejs/floating-ui": "0.1.55"
435
435
  },
436
436
  "peerDependencies": {
437
- "octane": "^0.2.5 || ^0.3.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.3.0",
471
- "@octanejs/testing-library": "0.1.52",
472
- "@octanejs/remix-router": "0.1.49"
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": {
@@ -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) {
@@ -234,7 +234,7 @@ export const DrawerPopup = function DrawerPopup(
234
234
  return undefined;
235
235
  }
236
236
 
237
- const resizeObserver = new ResizeObserver(measureHeight);
237
+ const resizeObserver = React.createResizeObserver(measureHeight);
238
238
 
239
239
  resizeObserver.observe(popupElement);
240
240
  return () => {
@@ -109,7 +109,7 @@ export function useDrawerSnapPoints() {
109
109
  return undefined;
110
110
  }
111
111
 
112
- const resizeObserver = new ResizeObserver(measureViewportHeight);
112
+ const resizeObserver = React.createResizeObserver(measureViewportHeight);
113
113
  resizeObserver.observe(viewportElement);
114
114
  return () => {
115
115
  resizeObserver.disconnect();
@@ -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 { hasMeasuredScrollbar, viewportState } = useScrollAreaRootContext();
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
- let hasInitialized = false;
37
- const resizeObserver = new ResizeObserver(() => {
38
- if (!hasInitialized) {
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);
@@ -313,7 +313,7 @@ export const ScrollAreaViewport = function ScrollAreaViewport(
313
313
  }
314
314
 
315
315
  let hasInitialized = false;
316
- const resizeObserver = new 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.
@@ -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) {
@@ -259,7 +259,7 @@ export const SliderThumb = function SliderThumb(
259
259
  return undefined;
260
260
  }
261
261
 
262
- const resizeObserver = new ResizeObserverCtor(getInsetPosition);
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);
@@ -45,7 +45,7 @@ export const TabsList = function TabsList(
45
45
  return undefined;
46
46
  }
47
47
 
48
- const resizeObserver = new ResizeObserver(() => {
48
+ const resizeObserver = React.createResizeObserver(() => {
49
49
  indicatorUpdateListenersRef.current.forEach((listener) => {
50
50
  listener();
51
51
  });
@@ -31,7 +31,7 @@ export const ToastContent = function ToastContent(
31
31
  return undefined;
32
32
  }
33
33
 
34
- const resizeObserver = new ResizeObserver(() => recalculateHeight(true));
34
+ const resizeObserver = React.createResizeObserver(() => recalculateHeight(true));
35
35
  const mutationObserver = new MutationObserver(() => recalculateHeight(true));
36
36
 
37
37
  resizeObserver.observe(node);