@choice-ui/react 1.5.4 → 1.5.6

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.
Files changed (54) hide show
  1. package/dist/components/calendar/dist/index.js +2 -2
  2. package/dist/components/calendar/src/time-calendar/time-calendar.js +2 -2
  3. package/dist/components/code-block/dist/index.js +13 -13
  4. package/dist/components/code-block/src/code-block.js +11 -11
  5. package/dist/components/code-block/src/hooks/use-line-count.js +3 -3
  6. package/dist/components/command/src/components/command-group.js +2 -2
  7. package/dist/components/command/src/components/command-item.js +3 -3
  8. package/dist/components/command/src/hooks/index.js +2 -2
  9. package/dist/components/command/src/hooks/use-command-state.js +3 -3
  10. package/dist/components/command/src/hooks/use-command.js +2 -2
  11. package/dist/components/command/src/utils/helpers.js +4 -4
  12. package/dist/components/comments/src/comment-item/comment-item.js +2 -2
  13. package/dist/components/comments/src/comment-item/components/comment-item-reactions.js +2 -2
  14. package/dist/components/conditions/src/hooks/use-drag-and-drop.js +3 -3
  15. package/dist/components/context-input/src/components/copy-button.js +2 -2
  16. package/dist/components/context-input/src/components/mention.js +2 -2
  17. package/dist/components/context-input/src/components/slate-editor.js +3 -3
  18. package/dist/components/context-input/src/context-input.js +5 -5
  19. package/dist/components/context-menu/src/context-menu.js +6 -6
  20. package/dist/components/dialog/dist/index.js +2 -2
  21. package/dist/components/dialog/src/dialog.js +2 -2
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/md-input/src/components/toolbar/toolbar.js +2 -2
  24. package/dist/components/md-input/src/md-input.js +3 -3
  25. package/dist/components/menus/dist/index.js +2 -2
  26. package/dist/components/menus/src/menus.js +2 -2
  27. package/dist/components/multi-select/dist/index.js +2 -2
  28. package/dist/components/multi-select/src/utils/extract-options.js +2 -2
  29. package/dist/components/otp-input/dist/index.d.ts +30 -0
  30. package/dist/components/otp-input/src/index.d.ts +2 -0
  31. package/dist/components/otp-input/src/otp-input.d.ts +27 -0
  32. package/dist/components/otp-input/src/otp-input.js +115 -0
  33. package/dist/components/otp-input/src/otp-input.module.css +15 -0
  34. package/dist/components/otp-input/src/otp-input.module.css.js +8 -0
  35. package/dist/components/otp-input/src/tv.d.ts +121 -0
  36. package/dist/components/otp-input/src/tv.js +150 -0
  37. package/dist/components/otp-input/tsup.config.d.ts +2 -0
  38. package/dist/components/panel/src/components/panel-sortable.js +3 -3
  39. package/dist/components/rich-input/src/hooks/use-editor-config.js +3 -3
  40. package/dist/components/rich-input/src/utils/custom-options.js +15 -15
  41. package/dist/components/select/dist/index.js +19 -3
  42. package/dist/components/select/src/select.js +19 -3
  43. package/dist/components/slot/dist/index.d.ts +10 -10
  44. package/dist/components/slot/dist/index.js +7 -15
  45. package/dist/components/slot/src/slot.d.ts +12 -12
  46. package/dist/components/slot/src/slot.js +10 -18
  47. package/dist/components/textarea/dist/index.js +14 -14
  48. package/dist/components/textarea/src/components/autosize/hooks.js +5 -5
  49. package/dist/components/textarea/src/components/autosize/index.js +10 -10
  50. package/dist/components/tree-list/src/tree-list.js +3 -3
  51. package/dist/components/virtualized-grid/src/error-boundary.js +2 -2
  52. package/dist/index.js +2 -0
  53. package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-otp/dist/index.js +200 -0
  54. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Slot } from "../../slot/dist/index.js";
3
3
  import { MenuValue, MenuTrigger, MenuContextLabel, MenuContextItem, MenuEmpty, MenuDivider, MenuContextContent, useMenuScroll, MenuContext, MenuScrollArrow } from "../../menus/dist/index.js";
4
4
  import { useFloatingParentNodeId, FloatingTree, useFloatingNodeId, useFloating, offset, shift, flip, size, inner, autoUpdate, useClick, useDismiss, useRole, useInnerOffset, useListNavigation, useTypeahead, useInteractions, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList } from "@floating-ui/react";
5
- import React, { memo, useMemo, Children, isValidElement, useRef, useState, useId, useEffect, cloneElement } from "react";
5
+ import React__default, { memo, useMemo, Children, isValidElement, useRef, useState, useId, useEffect, cloneElement } from "react";
6
6
  import { useEventCallback } from "usehooks-ts";
7
7
  import { tcx } from "../../../shared/utils/tcx/tcx.js";
8
8
  const PORTAL_ROOT_ID = "floating-menu-root";
@@ -47,7 +47,7 @@ const SelectComponent = memo(function SelectComponent2(props) {
47
47
  if (!isValidElement(child)) return;
48
48
  if (child.type === MenuContextItem || child.type === MenuDivider || child.type === MenuContextLabel || child.type === MenuEmpty) {
49
49
  result.push(child);
50
- } else if (child.type === React.Fragment && child.props.children) {
50
+ } else if (child.type === React__default.Fragment && child.props.children) {
51
51
  const fragmentChildren = Children.toArray(child.props.children);
52
52
  result.push(...extractSelectItems(fragmentChildren));
53
53
  }
@@ -94,6 +94,7 @@ const SelectComponent = memo(function SelectComponent2(props) {
94
94
  const allowMouseUpRef = useRef(true);
95
95
  const selectTimeoutRef = useRef();
96
96
  const scrollRef = useRef(null);
97
+ const isMouseDownFromTriggerRef = useRef(false);
97
98
  const refs = useMemo(
98
99
  () => ({
99
100
  list: listRef,
@@ -102,7 +103,8 @@ const SelectComponent = memo(function SelectComponent2(props) {
102
103
  allowSelect: allowSelectRef,
103
104
  allowMouseUp: allowMouseUpRef,
104
105
  selectTimeout: selectTimeoutRef,
105
- scroll: scrollRef
106
+ scroll: scrollRef,
107
+ isMouseDownFromTrigger: isMouseDownFromTriggerRef
106
108
  }),
107
109
  []
108
110
  // refs are stable references, no dependencies needed
@@ -232,6 +234,7 @@ const SelectComponent = memo(function SelectComponent2(props) {
232
234
  } else {
233
235
  refs.allowSelect.current = false;
234
236
  refs.allowMouseUp.current = true;
237
+ refs.isMouseDownFromTrigger.current = false;
235
238
  }
236
239
  }, [isControlledOpen]);
237
240
  const { handleArrowScroll, handleArrowHide, scrollProps } = useMenuScroll({
@@ -319,6 +322,13 @@ const SelectComponent = memo(function SelectComponent2(props) {
319
322
  },
320
323
  onMouseUp: () => {
321
324
  if (!refs.allowMouseUp.current || customActive) return;
325
+ if (refs.isMouseDownFromTrigger.current) {
326
+ refs.isMouseDownFromTrigger.current = false;
327
+ if (!isDisabled) {
328
+ handleSelect(currentSelectableIndex);
329
+ }
330
+ return;
331
+ }
322
332
  if (refs.allowSelect.current) {
323
333
  handleSelect(currentSelectableIndex);
324
334
  }
@@ -380,6 +390,9 @@ const SelectComponent = memo(function SelectComponent2(props) {
380
390
  onTouchStart() {
381
391
  setTouch(true);
382
392
  },
393
+ onMouseDown() {
394
+ refs.isMouseDownFromTrigger.current = true;
395
+ },
383
396
  onPointerMove({ pointerType }) {
384
397
  if (pointerType !== "touch") {
385
398
  setTouch(false);
@@ -399,6 +412,9 @@ const SelectComponent = memo(function SelectComponent2(props) {
399
412
  {
400
413
  lockScroll: !touch,
401
414
  className: tcx("z-menu", focusManagerProps.modal ? "" : "pointer-events-none"),
415
+ onMouseUp: () => {
416
+ refs.isMouseDownFromTrigger.current = false;
417
+ },
402
418
  children: /* @__PURE__ */ jsx(
403
419
  FloatingFocusManager,
404
420
  {
@@ -3,23 +3,23 @@ interface SlotProps extends React.HTMLAttributes<HTMLElement> {
3
3
  children?: React.ReactNode;
4
4
  }
5
5
  /**
6
- * Optimized Slot component implementation
6
+ * 优化的 Slot 组件实现
7
7
  *
8
- * Compared to performance optimization of @radix-ui/react-slot:
9
- * 1. Use useMemo to cache children processing results
10
- * 2. Simplify props merging logic
11
- * 3. Avoid unnecessary deep traversal
12
- * 4. Better type safety
8
+ * 相比 @radix-ui/react-slot 的性能优化:
9
+ * 1. 使用 useMemo 缓存 children 处理结果
10
+ * 2. 简化 props 合并逻辑
11
+ * 3. 避免不必要的深度遍历
12
+ * 4. 更好的类型安全
13
13
  */
14
14
  declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
15
15
  /**
16
- * Hook version of Slot logic
17
- * Used for scenarios that require more granular control
16
+ * Hook 版本的 Slot 逻辑
17
+ * 用于需要更细粒度控制的场景
18
18
  */
19
19
  declare function useSlot(children: React.ReactNode, slotProps: Record<string, unknown>, forwardedRef?: React.Ref<unknown>): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
20
20
  /**
21
- * Performance optimized asChild mode Hook
22
- * Used to replace `const Component = asChild ? Slot : "button"` mode
21
+ * 性能优化的 asChild 模式 Hook
22
+ * 用于替代 `const Component = asChild ? Slot : "button"` 模式
23
23
  */
24
24
  declare function useAsChild<T extends React.ElementType = "button">(asChild: boolean | undefined, defaultElement: T): T | typeof Slot;
25
25
 
@@ -1,22 +1,14 @@
1
- import React, { forwardRef, useMemo } from "react";
1
+ import React__default, { forwardRef, useMemo } from "react";
2
2
  import { jsx, Fragment } from "react/jsx-runtime";
3
- var REACT_MAJOR = parseInt(React.version.split(".")[0], 10);
4
- var IS_REACT_19 = REACT_MAJOR >= 19;
5
- function getChildRef(children) {
6
- if (IS_REACT_19) {
7
- return children.props.ref;
8
- }
9
- return void 0;
10
- }
11
3
  var Slot = forwardRef(
12
4
  ({ children, ...slotProps }, forwardedRef) => {
13
5
  const slottedChild = useMemo(() => {
14
- if (!React.isValidElement(children)) {
6
+ if (!React__default.isValidElement(children)) {
15
7
  return children;
16
8
  }
17
- const childRef = getChildRef(children);
9
+ const childRef = children.ref;
18
10
  const mergedProps = mergeProps(slotProps, children.props);
19
- return React.cloneElement(children, {
11
+ return React__default.cloneElement(children, {
20
12
  ...mergedProps,
21
13
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
22
14
  });
@@ -28,12 +20,12 @@ Slot.displayName = "Slot";
28
20
  var SlotClone = forwardRef(
29
21
  ({ children, ...slotProps }, forwardedRef) => {
30
22
  const slottedChild = useMemo(() => {
31
- if (!React.isValidElement(children)) {
23
+ if (!React__default.isValidElement(children)) {
32
24
  return children;
33
25
  }
34
- const childRef = getChildRef(children);
26
+ const childRef = children.ref;
35
27
  const mergedProps = mergeProps(slotProps, children.props);
36
- return React.cloneElement(children, {
28
+ return React__default.cloneElement(children, {
37
29
  ...mergedProps,
38
30
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
39
31
  });
@@ -6,28 +6,28 @@ interface SlotCloneProps {
6
6
  children: React.ReactNode;
7
7
  }
8
8
  /**
9
- * Optimized Slot component implementation
9
+ * 优化的 Slot 组件实现
10
10
  *
11
- * Compared to performance optimization of @radix-ui/react-slot:
12
- * 1. Use useMemo to cache children processing results
13
- * 2. Simplify props merging logic
14
- * 3. Avoid unnecessary deep traversal
15
- * 4. Better type safety
11
+ * 相比 @radix-ui/react-slot 的性能优化:
12
+ * 1. 使用 useMemo 缓存 children 处理结果
13
+ * 2. 简化 props 合并逻辑
14
+ * 3. 避免不必要的深度遍历
15
+ * 4. 更好的类型安全
16
16
  */
17
17
  export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
18
18
  /**
19
- * SlotClone component - used for deep cloning
20
- * When nested structures need to be processed
19
+ * SlotClone 组件 - 用于深度克隆
20
+ * 当需要处理嵌套结构时使用
21
21
  */
22
22
  export declare const SlotClone: React.ForwardRefExoticComponent<SlotCloneProps & React.RefAttributes<HTMLElement>>;
23
23
  /**
24
- * Hook version of Slot logic
25
- * Used for scenarios that require more granular control
24
+ * Hook 版本的 Slot 逻辑
25
+ * 用于需要更细粒度控制的场景
26
26
  */
27
27
  export declare function useSlot(children: React.ReactNode, slotProps: Record<string, unknown>, forwardedRef?: React.Ref<unknown>): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
28
28
  /**
29
- * Performance optimized asChild mode Hook
30
- * Used to replace `const Component = asChild ? Slot : "button"` mode
29
+ * 性能优化的 asChild 模式 Hook
30
+ * 用于替代 `const Component = asChild ? Slot : "button"` 模式
31
31
  */
32
32
  export declare function useAsChild<T extends React.ElementType = "button">(asChild: boolean | undefined, defaultElement: T): T | typeof Slot;
33
33
  export {};
@@ -1,22 +1,14 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
- import React, { forwardRef, useMemo } from "react";
3
- const REACT_MAJOR = parseInt(React.version.split(".")[0], 10);
4
- const IS_REACT_19 = REACT_MAJOR >= 19;
5
- function getChildRef(children) {
6
- if (IS_REACT_19) {
7
- return children.props.ref;
8
- }
9
- return void 0;
10
- }
2
+ import React__default, { forwardRef, useMemo } from "react";
11
3
  const Slot = forwardRef(
12
4
  ({ children, ...slotProps }, forwardedRef) => {
13
5
  const slottedChild = useMemo(() => {
14
- if (!React.isValidElement(children)) {
6
+ if (!React__default.isValidElement(children)) {
15
7
  return children;
16
8
  }
17
- const childRef = getChildRef(children);
9
+ const childRef = children.ref;
18
10
  const mergedProps = mergeProps(slotProps, children.props);
19
- return React.cloneElement(children, {
11
+ return React__default.cloneElement(children, {
20
12
  ...mergedProps,
21
13
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
22
14
  });
@@ -28,12 +20,12 @@ Slot.displayName = "Slot";
28
20
  const SlotClone = forwardRef(
29
21
  ({ children, ...slotProps }, forwardedRef) => {
30
22
  const slottedChild = useMemo(() => {
31
- if (!React.isValidElement(children)) {
23
+ if (!React__default.isValidElement(children)) {
32
24
  return children;
33
25
  }
34
- const childRef = getChildRef(children);
26
+ const childRef = children.ref;
35
27
  const mergedProps = mergeProps(slotProps, children.props);
36
- return React.cloneElement(children, {
28
+ return React__default.cloneElement(children, {
37
29
  ...mergedProps,
38
30
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
39
31
  });
@@ -86,12 +78,12 @@ function composeRefs(...refs) {
86
78
  }
87
79
  function useSlot(children, slotProps, forwardedRef) {
88
80
  return useMemo(() => {
89
- if (!React.isValidElement(children)) {
81
+ if (!React__default.isValidElement(children)) {
90
82
  return children;
91
83
  }
92
- const childRef = getChildRef(children);
84
+ const childRef = children.ref;
93
85
  const mergedProps = mergeProps(slotProps, children.props);
94
- return React.cloneElement(children, {
86
+ return React__default.cloneElement(children, {
95
87
  ...mergedProps,
96
88
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
97
89
  });
@@ -1,5 +1,5 @@
1
1
  import { ScrollArea } from "../../scroll-area/dist/index.js";
2
- import React, { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect, Children, isValidElement, memo } from "react";
2
+ import React__default, { forwardRef, useRef, useState, useImperativeHandle, useMemo, useEffect, Children, isValidElement, memo } from "react";
3
3
  import { useUnmount, useEventCallback, useIsomorphicLayoutEffect } from "usehooks-ts";
4
4
  import { jsxs, jsx } from "react/jsx-runtime";
5
5
  import { mergeRefs } from "../../../shared/utils/merge-refs/merge-refs.js";
@@ -217,12 +217,12 @@ var getSizingData = (node) => {
217
217
  };
218
218
  var get_sizing_data_default = getSizingData;
219
219
  function useLatest(value) {
220
- const ref = React.useRef(value);
220
+ const ref = React__default.useRef(value);
221
221
  ref.current = value;
222
222
  return ref;
223
223
  }
224
224
  function useComposedRef(libRef, userRef) {
225
- return React.useCallback(
225
+ return React__default.useCallback(
226
226
  (node) => {
227
227
  libRef.current = node;
228
228
  if (typeof userRef === "function") {
@@ -256,7 +256,7 @@ function useListener(target, type, listener) {
256
256
  }, [target, type, latestListener]);
257
257
  }
258
258
  var useFormResetListener = (libRef, listener) => {
259
- const stableListener = React.useCallback(
259
+ const stableListener = React__default.useCallback(
260
260
  (ev) => {
261
261
  var _a;
262
262
  if (((_a = libRef.current) == null ? void 0 : _a.form) === ev.target) {
@@ -271,7 +271,7 @@ var useWindowResizeListener = (listener) => {
271
271
  useListener(isBrowser ? window : null, "resize", listener);
272
272
  };
273
273
  var useFontsLoadedListener = (listener) => {
274
- const safeListener = React.useCallback(
274
+ const safeListener = React__default.useCallback(
275
275
  (event) => {
276
276
  try {
277
277
  listener(event);
@@ -334,14 +334,14 @@ var TextareaAutosize = forwardRef(
334
334
  ...props
335
335
  }, userRef) {
336
336
  const isControlled = props.value !== void 0;
337
- const libRef = React.useRef(null);
337
+ const libRef = React__default.useRef(null);
338
338
  const ref = useComposedRef(libRef, userRef);
339
- const heightRef = React.useRef(0);
340
- const measurementsCacheRef = React.useRef();
341
- const lastValueRef = React.useRef("");
339
+ const heightRef = React__default.useRef(0);
340
+ const measurementsCacheRef = React__default.useRef();
341
+ const lastValueRef = React__default.useRef("");
342
342
  const normalizedMinRows = Math.max(minRows, 1);
343
343
  const normalizedMaxRows = maxRows && maxRows >= normalizedMinRows ? maxRows : void 0;
344
- const resizeTextarea = React.useCallback(() => {
344
+ const resizeTextarea = React__default.useCallback(() => {
345
345
  const node = libRef.current;
346
346
  if (!node || !isBrowser) return;
347
347
  const currentValue = node.value || node.placeholder || "";
@@ -388,7 +388,7 @@ var TextareaAutosize = forwardRef(
388
388
  }
389
389
  }, [cacheMeasurements, normalizedMinRows, normalizedMaxRows, onHeightChange]);
390
390
  const debouncedResize = useDebounce(resizeTextarea, debounceMs);
391
- const handleChange = React.useCallback(
391
+ const handleChange = React__default.useCallback(
392
392
  (event) => {
393
393
  if (!isControlled) {
394
394
  if (debounceMs > 0) {
@@ -401,7 +401,7 @@ var TextareaAutosize = forwardRef(
401
401
  },
402
402
  [isControlled, debounceMs, debouncedResize, resizeTextarea, onChange]
403
403
  );
404
- const formResetCallback = React.useCallback(() => {
404
+ const formResetCallback = React__default.useCallback(() => {
405
405
  var _a;
406
406
  if (!isControlled) {
407
407
  const currentValue = ((_a = libRef.current) == null ? void 0 : _a.value) || "";
@@ -417,7 +417,7 @@ var TextareaAutosize = forwardRef(
417
417
  useFormResetListener(libRef, formResetCallback);
418
418
  useWindowResizeListener(resizeTextarea);
419
419
  useFontsLoadedListener(resizeTextarea);
420
- React.useEffect(() => {
420
+ React__default.useEffect(() => {
421
421
  const node = libRef.current;
422
422
  if (!node || !isBrowser || typeof IntersectionObserver === "undefined") {
423
423
  return;
@@ -439,7 +439,7 @@ var TextareaAutosize = forwardRef(
439
439
  observer.disconnect();
440
440
  };
441
441
  }, [resizeTextarea]);
442
- React.useEffect(() => {
442
+ React__default.useEffect(() => {
443
443
  resizeTextarea();
444
444
  }, [style == null ? void 0 : style.lineHeight, style == null ? void 0 : style.padding, resizeTextarea]);
445
445
  const mergedStyle = useMemo(() => {
@@ -1,13 +1,13 @@
1
- import React from "react";
1
+ import React__default from "react";
2
2
  import { isBrowser } from "./utils.js";
3
3
  import { useIsomorphicLayoutEffect } from "usehooks-ts";
4
4
  function useLatest(value) {
5
- const ref = React.useRef(value);
5
+ const ref = React__default.useRef(value);
6
6
  ref.current = value;
7
7
  return ref;
8
8
  }
9
9
  function useComposedRef(libRef, userRef) {
10
- return React.useCallback(
10
+ return React__default.useCallback(
11
11
  (node) => {
12
12
  libRef.current = node;
13
13
  if (typeof userRef === "function") {
@@ -41,7 +41,7 @@ function useListener(target, type, listener) {
41
41
  }, [target, type, latestListener]);
42
42
  }
43
43
  const useFormResetListener = (libRef, listener) => {
44
- const stableListener = React.useCallback(
44
+ const stableListener = React__default.useCallback(
45
45
  (ev) => {
46
46
  var _a;
47
47
  if (((_a = libRef.current) == null ? void 0 : _a.form) === ev.target) {
@@ -56,7 +56,7 @@ const useWindowResizeListener = (listener) => {
56
56
  useListener(isBrowser ? window : null, "resize", listener);
57
57
  };
58
58
  const useFontsLoadedListener = (listener) => {
59
- const safeListener = React.useCallback(
59
+ const safeListener = React__default.useCallback(
60
60
  (event) => {
61
61
  try {
62
62
  listener(event);
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { forwardRef, useMemo, useRef } from "react";
2
+ import React__default, { forwardRef, useMemo, useRef } from "react";
3
3
  import { isBrowser, noop } from "./utils.js";
4
4
  import calculateNodeHeight from "./calculate-node-height.js";
5
5
  import getSizingData from "./get-sizing-data.js";
@@ -53,14 +53,14 @@ const TextareaAutosize = forwardRef(
53
53
  ...props
54
54
  }, userRef) {
55
55
  const isControlled = props.value !== void 0;
56
- const libRef = React.useRef(null);
56
+ const libRef = React__default.useRef(null);
57
57
  const ref = useComposedRef(libRef, userRef);
58
- const heightRef = React.useRef(0);
59
- const measurementsCacheRef = React.useRef();
60
- const lastValueRef = React.useRef("");
58
+ const heightRef = React__default.useRef(0);
59
+ const measurementsCacheRef = React__default.useRef();
60
+ const lastValueRef = React__default.useRef("");
61
61
  const normalizedMinRows = Math.max(minRows, 1);
62
62
  const normalizedMaxRows = maxRows && maxRows >= normalizedMinRows ? maxRows : void 0;
63
- const resizeTextarea = React.useCallback(() => {
63
+ const resizeTextarea = React__default.useCallback(() => {
64
64
  const node = libRef.current;
65
65
  if (!node || !isBrowser) return;
66
66
  const currentValue = node.value || node.placeholder || "";
@@ -107,7 +107,7 @@ const TextareaAutosize = forwardRef(
107
107
  }
108
108
  }, [cacheMeasurements, normalizedMinRows, normalizedMaxRows, onHeightChange]);
109
109
  const debouncedResize = useDebounce(resizeTextarea, debounceMs);
110
- const handleChange = React.useCallback(
110
+ const handleChange = React__default.useCallback(
111
111
  (event) => {
112
112
  if (!isControlled) {
113
113
  if (debounceMs > 0) {
@@ -120,7 +120,7 @@ const TextareaAutosize = forwardRef(
120
120
  },
121
121
  [isControlled, debounceMs, debouncedResize, resizeTextarea, onChange]
122
122
  );
123
- const formResetCallback = React.useCallback(() => {
123
+ const formResetCallback = React__default.useCallback(() => {
124
124
  var _a;
125
125
  if (!isControlled) {
126
126
  const currentValue = ((_a = libRef.current) == null ? void 0 : _a.value) || "";
@@ -136,7 +136,7 @@ const TextareaAutosize = forwardRef(
136
136
  useFormResetListener(libRef, formResetCallback);
137
137
  useWindowResizeListener(resizeTextarea);
138
138
  useFontsLoadedListener(resizeTextarea);
139
- React.useEffect(() => {
139
+ React__default.useEffect(() => {
140
140
  const node = libRef.current;
141
141
  if (!node || !isBrowser || typeof IntersectionObserver === "undefined") {
142
142
  return;
@@ -158,7 +158,7 @@ const TextareaAutosize = forwardRef(
158
158
  observer.disconnect();
159
159
  };
160
160
  }, [resizeTextarea]);
161
- React.useEffect(() => {
161
+ React__default.useEffect(() => {
162
162
  resizeTextarea();
163
163
  }, [style == null ? void 0 : style.lineHeight, style == null ? void 0 : style.padding, resizeTextarea]);
164
164
  const mergedStyle = useMemo(() => {
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { ScrollArea } from "../../scroll-area/dist/index.js";
3
3
  import { useVirtualizer } from "@tanstack/react-virtual";
4
- import React, { useState, useRef, useCallback, useEffect, useImperativeHandle, useMemo, createContext } from "react";
4
+ import React__default, { useState, useRef, useCallback, useEffect, useImperativeHandle, useMemo, createContext } from "react";
5
5
  import { flattenTree, findNodePathById } from "./utils/tree.js";
6
6
  import { useSelection } from "./hooks/use-selection.js";
7
7
  import { useRenaming } from "./hooks/use-renaming.js";
@@ -11,14 +11,14 @@ import { TreeNodeWrapper } from "./components/tree-node-wrapper.js";
11
11
  import { tcx } from "../../../shared/utils/tcx/tcx.js";
12
12
  const TreeContext = createContext(null);
13
13
  const useTreeContext = () => {
14
- const context = React.useContext(TreeContext);
14
+ const context = React__default.useContext(TreeContext);
15
15
  if (!context) {
16
16
  throw new Error("useTreeContext must be used within a TreeList");
17
17
  }
18
18
  return context;
19
19
  };
20
20
  const DEFAULT_NODE_HEIGHT = 32;
21
- const TreeList = React.forwardRef((props, ref) => {
21
+ const TreeList = React__default.forwardRef((props, ref) => {
22
22
  const {
23
23
  data,
24
24
  selectedNodeIds,
@@ -3,8 +3,8 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Button } from "../../button/dist/index.js";
6
- import React from "react";
7
- class VirtualizedGridErrorBoundary extends React.Component {
6
+ import React__default from "react";
7
+ class VirtualizedGridErrorBoundary extends React__default.Component {
8
8
  constructor(props) {
9
9
  super(props);
10
10
  __publicField(this, "retry", () => {
package/dist/index.js CHANGED
@@ -174,6 +174,7 @@ import { NumericInput } from "./components/numeric-input/src/numeric-input.js";
174
174
  import { NumericInputElement } from "./components/numeric-input/src/components/numeric-input-element.js";
175
175
  import { NumericInputMenuTrigger } from "./components/numeric-input/src/components/numeric-input-menu-trigger.js";
176
176
  import { NumericInputVariable } from "./components/numeric-input/src/components/numeric-input-variable.js";
177
+ import { OtpInput } from "./components/otp-input/src/otp-input.js";
177
178
  import { Pagination } from "./components/pagination/src/pagination.js";
178
179
  import { Panel, PanelBase } from "./components/panel/src/panel.js";
179
180
  import { PanelRow } from "./components/panel/src/components/panel-row.js";
@@ -379,6 +380,7 @@ export {
379
380
  NumericInputMenuTrigger,
380
381
  NumericInputVariable,
381
382
  OPERATOR_CONFIGS,
383
+ OtpInput,
382
384
  PRESET_EASINGS,
383
385
  PREVIEW_KEYFRAMES,
384
386
  Pagination,