@choice-ui/react 1.5.3 → 1.5.5

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 (77) 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/combobox/dist/index.d.ts +2 -1
  7. package/dist/components/combobox/dist/index.js +7 -6
  8. package/dist/components/combobox/src/combobox.d.ts +2 -1
  9. package/dist/components/combobox/src/combobox.js +7 -6
  10. package/dist/components/command/src/components/command-group.js +2 -2
  11. package/dist/components/command/src/components/command-item.js +3 -3
  12. package/dist/components/command/src/hooks/index.js +2 -2
  13. package/dist/components/command/src/hooks/use-command-state.js +3 -3
  14. package/dist/components/command/src/hooks/use-command.js +2 -2
  15. package/dist/components/command/src/utils/helpers.js +4 -4
  16. package/dist/components/comments/src/comment-item/comment-item.js +2 -2
  17. package/dist/components/comments/src/comment-item/components/comment-item-reactions.js +2 -2
  18. package/dist/components/conditions/src/hooks/use-drag-and-drop.js +3 -3
  19. package/dist/components/context-input/src/components/copy-button.js +2 -2
  20. package/dist/components/context-input/src/components/mention.js +2 -2
  21. package/dist/components/context-input/src/components/slate-editor.js +3 -3
  22. package/dist/components/context-input/src/context-input.js +5 -5
  23. package/dist/components/context-menu/dist/index.d.ts +2 -1
  24. package/dist/components/context-menu/src/context-menu.d.ts +2 -1
  25. package/dist/components/context-menu/src/context-menu.js +14 -13
  26. package/dist/components/dialog/dist/index.js +2 -2
  27. package/dist/components/dialog/src/dialog.js +2 -2
  28. package/dist/components/dropdown/dist/index.d.ts +2 -1
  29. package/dist/components/dropdown/dist/index.js +8 -7
  30. package/dist/components/dropdown/src/dropdown.d.ts +2 -1
  31. package/dist/components/dropdown/src/dropdown.js +8 -7
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/md-input/src/components/toolbar/toolbar.js +2 -2
  34. package/dist/components/md-input/src/md-input.js +3 -3
  35. package/dist/components/menus/dist/index.d.ts +6 -1
  36. package/dist/components/menus/dist/index.js +26 -2
  37. package/dist/components/menus/src/components/index.d.ts +1 -0
  38. package/dist/components/menus/src/components/menu-empty.d.ts +4 -0
  39. package/dist/components/menus/src/components/menu-empty.js +20 -0
  40. package/dist/components/menus/src/index.d.ts +1 -1
  41. package/dist/components/menus/src/menus.js +2 -2
  42. package/dist/components/menus/src/tv.d.ts +25 -0
  43. package/dist/components/menus/src/tv.js +11 -0
  44. package/dist/components/multi-select/dist/index.d.ts +2 -1
  45. package/dist/components/multi-select/dist/index.js +15 -8
  46. package/dist/components/multi-select/src/multi-select.d.ts +2 -1
  47. package/dist/components/multi-select/src/multi-select.js +8 -4
  48. package/dist/components/multi-select/src/utils/extract-options.d.ts +16 -2
  49. package/dist/components/multi-select/src/utils/extract-options.js +8 -5
  50. package/dist/components/otp-input/dist/index.d.ts +30 -0
  51. package/dist/components/otp-input/src/index.d.ts +2 -0
  52. package/dist/components/otp-input/src/otp-input.d.ts +27 -0
  53. package/dist/components/otp-input/src/otp-input.js +115 -0
  54. package/dist/components/otp-input/src/otp-input.module.css +15 -0
  55. package/dist/components/otp-input/src/otp-input.module.css.js +8 -0
  56. package/dist/components/otp-input/src/tv.d.ts +121 -0
  57. package/dist/components/otp-input/src/tv.js +150 -0
  58. package/dist/components/otp-input/tsup.config.d.ts +2 -0
  59. package/dist/components/panel/src/components/panel-sortable.js +3 -3
  60. package/dist/components/rich-input/src/hooks/use-editor-config.js +3 -3
  61. package/dist/components/rich-input/src/utils/custom-options.js +15 -15
  62. package/dist/components/select/dist/index.d.ts +2 -1
  63. package/dist/components/select/dist/index.js +15 -8
  64. package/dist/components/select/src/select.d.ts +2 -1
  65. package/dist/components/select/src/select.js +15 -8
  66. package/dist/components/slot/dist/index.d.ts +10 -10
  67. package/dist/components/slot/dist/index.js +7 -15
  68. package/dist/components/slot/src/slot.d.ts +12 -12
  69. package/dist/components/slot/src/slot.js +10 -18
  70. package/dist/components/textarea/dist/index.js +14 -14
  71. package/dist/components/textarea/src/components/autosize/hooks.js +5 -5
  72. package/dist/components/textarea/src/components/autosize/index.js +10 -10
  73. package/dist/components/tree-list/src/tree-list.js +3 -3
  74. package/dist/components/virtualized-grid/src/error-boundary.js +2 -2
  75. package/dist/index.js +4 -0
  76. 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
  77. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Slot } from "../../slot/dist/index.js";
3
- import { MenuValue, MenuContextContent, MenuContextLabel, MenuDivider, MenuTrigger, MenuContextItem, useMenuScroll, MenuContext, MenuScrollArrow } from "../../menus/dist/index.js";
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";
@@ -45,9 +45,9 @@ const SelectComponent = memo(function SelectComponent2(props) {
45
45
  const result = [];
46
46
  children2.forEach((child) => {
47
47
  if (!isValidElement(child)) return;
48
- if (child.type === MenuContextItem || child.type === MenuDivider || child.type === MenuContextLabel) {
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
  }
@@ -67,6 +67,9 @@ const SelectComponent = memo(function SelectComponent2(props) {
67
67
  if (child.type === MenuContextLabel) {
68
68
  return { label: true, children: child.props.children };
69
69
  }
70
+ if (child.type === MenuEmpty) {
71
+ return { empty: true, children: child.props.children, element: child };
72
+ }
70
73
  const {
71
74
  value: itemValue,
72
75
  children: itemChildren,
@@ -82,7 +85,7 @@ const SelectComponent = memo(function SelectComponent2(props) {
82
85
  });
83
86
  }, [itemElements]);
84
87
  const selectableOptions = useMemo(() => {
85
- return options.filter((option) => !option.divider && !option.label);
88
+ return options.filter((option) => !option.divider && !option.label && !option.empty);
86
89
  }, [options]);
87
90
  const listRef = useRef([]);
88
91
  const listContentRef = useRef([]);
@@ -287,6 +290,9 @@ const SelectComponent = memo(function SelectComponent2(props) {
287
290
  if (option.label) {
288
291
  return /* @__PURE__ */ jsx(MenuContextLabel, { children: option.children }, `label-${index}`);
289
292
  }
293
+ if (option.empty) {
294
+ return /* @__PURE__ */ jsx(MenuEmpty, { children: option.children }, `empty-${index}`);
295
+ }
290
296
  const currentSelectableIndex = selectableIndex;
291
297
  selectableIndex++;
292
298
  const isSelected = currentSelectedIndex === currentSelectableIndex;
@@ -467,11 +473,12 @@ const BaseSelect = memo(function Select2(props) {
467
473
  return /* @__PURE__ */ jsx(SelectComponent, { ...props, children });
468
474
  });
469
475
  const Select = Object.assign(BaseSelect, {
470
- Item: MenuContextItem,
471
- Trigger: MenuTrigger,
476
+ Content: MenuContextContent,
472
477
  Divider: MenuDivider,
478
+ Empty: MenuEmpty,
479
+ Item: MenuContextItem,
473
480
  Label: MenuContextLabel,
474
- Content: MenuContextContent,
481
+ Trigger: MenuTrigger,
475
482
  Value: MenuValue
476
483
  });
477
484
  Select.displayName = "Select";
@@ -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
@@ -136,6 +136,7 @@ import { Menubar } from "./components/menubar/src/menubar.js";
136
136
  import { MenuButton } from "./components/menus/src/components/menu-button.js";
137
137
  import { MenuCheckbox } from "./components/menus/src/components/menu-checkbox.js";
138
138
  import { MenuDivider } from "./components/menus/src/components/menu-divider.js";
139
+ import { MenuEmpty } from "./components/menus/src/components/menu-empty.js";
139
140
  import { MenuInput } from "./components/menus/src/components/menu-input.js";
140
141
  import { MenuItem } from "./components/menus/src/components/menu-item.js";
141
142
  import { MenuLabel } from "./components/menus/src/components/menu-label.js";
@@ -173,6 +174,7 @@ import { NumericInput } from "./components/numeric-input/src/numeric-input.js";
173
174
  import { NumericInputElement } from "./components/numeric-input/src/components/numeric-input-element.js";
174
175
  import { NumericInputMenuTrigger } from "./components/numeric-input/src/components/numeric-input-menu-trigger.js";
175
176
  import { NumericInputVariable } from "./components/numeric-input/src/components/numeric-input-variable.js";
177
+ import { OtpInput } from "./components/otp-input/src/otp-input.js";
176
178
  import { Pagination } from "./components/pagination/src/pagination.js";
177
179
  import { Panel, PanelBase } from "./components/panel/src/panel.js";
178
180
  import { PanelRow } from "./components/panel/src/components/panel-row.js";
@@ -346,6 +348,7 @@ export {
346
348
  MenuContextLabel,
347
349
  MenuContextSubTrigger,
348
350
  MenuDivider,
351
+ MenuEmpty,
349
352
  MenuInput,
350
353
  MenuItem,
351
354
  MenuLabel,
@@ -377,6 +380,7 @@ export {
377
380
  NumericInputMenuTrigger,
378
381
  NumericInputVariable,
379
382
  OPERATOR_CONFIGS,
383
+ OtpInput,
380
384
  PRESET_EASINGS,
381
385
  PREVIEW_KEYFRAMES,
382
386
  Pagination,