@vuer-ai/vuer-uikit 0.0.30 → 0.0.31

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/{chunk-GM6ZAFCM.mjs → chunk-2QJF6YMB.mjs} +5 -15
  2. package/dist/{chunk-OLIRY7YF.mjs → chunk-47WYS4WO.mjs} +107 -109
  3. package/dist/{chunk-MP3L7ZVI.mjs → chunk-ALTGL7MF.mjs} +57 -40
  4. package/dist/{chunk-AQWYFBXL.js → chunk-CCNGF3D2.js} +1 -4
  5. package/dist/{chunk-DNDWCHEB.js → chunk-CZBGKVGH.js} +93 -35
  6. package/dist/{chunk-MFQ3ZHFJ.mjs → chunk-D6KVE3E3.mjs} +28 -43
  7. package/dist/{chunk-FA7B4T24.mjs → chunk-EXM36UYZ.mjs} +2 -16
  8. package/dist/{chunk-WU66I4PW.mjs → chunk-HQX4LDOI.mjs} +71 -35
  9. package/dist/{chunk-EAZWH4U4.js → chunk-J2ZRCEKZ.js} +107 -109
  10. package/dist/{chunk-JBUN2HUK.mjs → chunk-JCUMV4F7.mjs} +1 -4
  11. package/dist/{chunk-OE5HF5A6.mjs → chunk-LD654LL2.mjs} +4 -4
  12. package/dist/{chunk-XSREJYEX.js → chunk-LKFZSASJ.js} +28 -43
  13. package/dist/{chunk-S7UWM46Z.mjs → chunk-MFXAWZIK.mjs} +15 -15
  14. package/dist/{chunk-F4BR4V3S.mjs → chunk-MGHV5V6D.mjs} +1 -1
  15. package/dist/{chunk-V2DDMNVD.js → chunk-NC6NIC5C.js} +16 -16
  16. package/dist/{chunk-Y4EFNE6Q.mjs → chunk-NKNUMZJL.mjs} +22 -14
  17. package/dist/{chunk-6CABRTQF.js → chunk-PBQSATSN.js} +71 -35
  18. package/dist/{chunk-B4C6WQKH.js → chunk-Q73WG234.js} +57 -40
  19. package/dist/{chunk-2EMN6VM2.js → chunk-QF5IKMHU.js} +5 -15
  20. package/dist/{chunk-IEA6DQ7J.js → chunk-R3SHGA4V.js} +22 -14
  21. package/dist/{chunk-F2S3PF25.mjs → chunk-SHQFIJDC.mjs} +11 -9
  22. package/dist/{chunk-OCNRBXK4.mjs → chunk-TZLILQLV.mjs} +73 -36
  23. package/dist/{chunk-6VRLWVXF.mjs → chunk-VN2N7EAO.mjs} +2 -2
  24. package/dist/{chunk-PKDNA72Q.js → chunk-W3AIC7FW.js} +2 -16
  25. package/dist/{chunk-HTU7SD4O.js → chunk-WCK3EIS2.js} +4 -4
  26. package/dist/{chunk-QPGCDLOI.js → chunk-X2LJ5T2W.js} +11 -9
  27. package/dist/{chunk-HUHNQPQH.js → chunk-X5JZF4L3.js} +1 -1
  28. package/dist/{chunk-XLIICBKP.js → chunk-XWC6N2UQ.js} +4 -4
  29. package/dist/highlight-cursor/enhanced-components.js +8 -8
  30. package/dist/highlight-cursor/enhanced-components.mjs +3 -3
  31. package/dist/highlight-cursor/index.js +8 -8
  32. package/dist/highlight-cursor/index.mjs +3 -3
  33. package/dist/index.js +163 -79
  34. package/dist/index.mjs +14 -14
  35. package/dist/ui/collapsible.js +4 -4
  36. package/dist/ui/collapsible.mjs +1 -1
  37. package/dist/ui/dropdown.js +16 -16
  38. package/dist/ui/dropdown.mjs +1 -1
  39. package/dist/ui/index.js +157 -73
  40. package/dist/ui/index.mjs +13 -13
  41. package/dist/ui/input-numbers.js +2 -2
  42. package/dist/ui/input-numbers.mjs +1 -1
  43. package/dist/ui/modal.js +11 -11
  44. package/dist/ui/modal.mjs +1 -1
  45. package/dist/ui/popover.js +5 -5
  46. package/dist/ui/popover.mjs +1 -1
  47. package/dist/ui/select.js +95 -11
  48. package/dist/ui/select.mjs +1 -1
  49. package/dist/ui/sheet.js +9 -9
  50. package/dist/ui/sheet.mjs +1 -1
  51. package/dist/ui/slider.js +2 -2
  52. package/dist/ui/slider.mjs +1 -1
  53. package/dist/ui/tabs.js +5 -5
  54. package/dist/ui/tabs.mjs +1 -1
  55. package/dist/ui/timeline.js +3 -3
  56. package/dist/ui/timeline.mjs +2 -2
  57. package/dist/ui/tree-view-v2.js +2 -2
  58. package/dist/ui/tree-view-v2.mjs +1 -1
  59. package/dist/ui/tree-view.js +2 -2
  60. package/dist/ui/tree-view.mjs +1 -1
  61. package/dist/ui/version-badge.js +2 -2
  62. package/dist/ui/version-badge.mjs +1 -1
  63. package/package.json +1 -1
  64. package/src/hooks/useDocument.tsx +3 -3
  65. package/src/hooks/useWindow.tsx +3 -3
  66. package/src/index.css +1 -1
  67. package/src/ui/collapsible.tsx +16 -7
  68. package/src/ui/dropdown.tsx +57 -39
  69. package/src/ui/input-numbers.tsx +84 -37
  70. package/src/ui/modal.tsx +2 -10
  71. package/src/ui/popover.tsx +1 -4
  72. package/src/ui/sheet.tsx +9 -20
  73. package/src/ui/slider.tsx +97 -98
  74. package/src/ui/tabs.tsx +2 -10
  75. package/src/ui/timeline.tsx +15 -15
  76. package/src/ui/tree-view-v2.tsx +4 -4
  77. package/src/ui/tree-view.tsx +8 -2
@@ -34,7 +34,10 @@ function SelectFallback({ ...props }) {
34
34
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "select", ...props });
35
35
  }
36
36
  var Select = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectRoot, SelectFallback);
37
- function SelectGroupRoot({ className, ...props }) {
37
+ function SelectGroupRoot({
38
+ className,
39
+ ...props
40
+ }) {
38
41
  return /* @__PURE__ */ jsxRuntime.jsx(
39
42
  SelectPrimitive__namespace.Group,
40
43
  {
@@ -45,14 +48,7 @@ function SelectGroupRoot({ className, ...props }) {
45
48
  );
46
49
  }
47
50
  function SelectGroupFallback({ className, ...props }) {
48
- return /* @__PURE__ */ jsxRuntime.jsx(
49
- "div",
50
- {
51
- "data-slot": "select-group",
52
- className: chunk7KYAICHB_js.cn("space-y-xs", className),
53
- ...props
54
- }
55
- );
51
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "select-group", className: chunk7KYAICHB_js.cn("space-y-xs", className), ...props });
56
52
  }
57
53
  var SelectGroup = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectGroupRoot, SelectGroupFallback);
58
54
  function SelectValueRoot({ ...props }) {
@@ -209,11 +205,7 @@ function SelectContentRoot({
209
205
  }
210
206
  ) });
211
207
  }
212
- function SelectContentFallback({
213
- className,
214
- children,
215
- ...props
216
- }) {
208
+ function SelectContentFallback({ className, children, ...props }) {
217
209
  return /* @__PURE__ */ jsxRuntime.jsx(
218
210
  "div",
219
211
  {
@@ -238,7 +230,10 @@ function SelectContentFallback({
238
230
  );
239
231
  }
240
232
  var SelectContent = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectContentRoot, SelectContentFallback);
241
- function SelectLabelRoot({ className, ...props }) {
233
+ function SelectLabelRoot({
234
+ className,
235
+ ...props
236
+ }) {
242
237
  return /* @__PURE__ */ jsxRuntime.jsx(
243
238
  SelectPrimitive__namespace.Label,
244
239
  {
@@ -259,7 +254,14 @@ function SelectLabelFallback({ className, ...props }) {
259
254
  );
260
255
  }
261
256
  var SelectLabel = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectLabelRoot, SelectLabelFallback);
262
- function SelectItemRoot({ className, children, prefix, suffix, disabled, ...props }) {
257
+ function SelectItemRoot({
258
+ className,
259
+ children,
260
+ prefix,
261
+ suffix,
262
+ disabled,
263
+ ...props
264
+ }) {
263
265
  return /* @__PURE__ */ jsxRuntime.jsxs(
264
266
  SelectPrimitive__namespace.Item,
265
267
  {
@@ -332,7 +334,16 @@ function SelectItemRoot({ className, children, prefix, suffix, disabled, ...prop
332
334
  }
333
335
  );
334
336
  }
335
- function SelectItemFallback({ className, children, prefix, suffix, disabled, ...props }) {
337
+ function SelectItemFallback({
338
+ className,
339
+ children,
340
+ prefix,
341
+ suffix,
342
+ disabled,
343
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
344
+ value,
345
+ ...props
346
+ }) {
336
347
  return /* @__PURE__ */ jsxRuntime.jsxs(
337
348
  "div",
338
349
  {
@@ -352,15 +363,41 @@ function SelectItemFallback({ className, children, prefix, suffix, disabled, ...
352
363
  "text-uk-xs",
353
364
  "outline-hidden",
354
365
  "select-none",
355
- "focus:bg-bg-secondary"
366
+ "focus:bg-bg-secondary",
367
+ disabled && "text-bg-quaternary pointer-events-none"
356
368
  ],
357
369
  className
358
370
  ),
359
371
  ...props,
360
372
  children: [
361
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunk7KYAICHB_js.cn(["text-text-tertiary", "flex", "shrink-0", "gap-0.5"]), children: prefix }),
373
+ /* @__PURE__ */ jsxRuntime.jsx(
374
+ "p",
375
+ {
376
+ className: chunk7KYAICHB_js.cn([
377
+ "text-text-tertiary",
378
+ "flex",
379
+ "shrink-0",
380
+ "gap-0.5",
381
+ disabled && "text-bg-quaternary"
382
+ ]),
383
+ children: prefix
384
+ }
385
+ ),
362
386
  /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
363
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunk7KYAICHB_js.cn("text-text-tertiary", "ml-auto", "flex", "shrink-0", "gap-0.5"), children: suffix })
387
+ /* @__PURE__ */ jsxRuntime.jsx(
388
+ "p",
389
+ {
390
+ className: chunk7KYAICHB_js.cn(
391
+ "text-text-tertiary",
392
+ "ml-auto",
393
+ "flex",
394
+ "shrink-0",
395
+ "gap-0.5",
396
+ disabled && "text-bg-quaternary"
397
+ ),
398
+ children: suffix
399
+ }
400
+ )
364
401
  ]
365
402
  }
366
403
  );
@@ -379,10 +416,7 @@ function SelectSeparatorRoot({
379
416
  }
380
417
  );
381
418
  }
382
- function SelectSeparatorFallback({
383
- className,
384
- ...props
385
- }) {
419
+ function SelectSeparatorFallback({ className, ...props }) {
386
420
  return /* @__PURE__ */ jsxRuntime.jsx(
387
421
  "div",
388
422
  {
@@ -392,7 +426,10 @@ function SelectSeparatorFallback({
392
426
  }
393
427
  );
394
428
  }
395
- var SelectSeparator = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectSeparatorRoot, SelectSeparatorFallback);
429
+ var SelectSeparator = chunkQG7ZF6TO_js.createClientOnlyComponent(
430
+ SelectSeparatorRoot,
431
+ SelectSeparatorFallback
432
+ );
396
433
  function SelectScrollUpButtonRoot({
397
434
  className,
398
435
  ...props
@@ -407,10 +444,7 @@ function SelectScrollUpButtonRoot({
407
444
  }
408
445
  );
409
446
  }
410
- function SelectScrollUpButtonFallback({
411
- className,
412
- ...props
413
- }) {
447
+ function SelectScrollUpButtonFallback({ className, ...props }) {
414
448
  return /* @__PURE__ */ jsxRuntime.jsx(
415
449
  "div",
416
450
  {
@@ -421,7 +455,10 @@ function SelectScrollUpButtonFallback({
421
455
  }
422
456
  );
423
457
  }
424
- var SelectScrollUpButton = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectScrollUpButtonRoot, SelectScrollUpButtonFallback);
458
+ var SelectScrollUpButton = chunkQG7ZF6TO_js.createClientOnlyComponent(
459
+ SelectScrollUpButtonRoot,
460
+ SelectScrollUpButtonFallback
461
+ );
425
462
  function SelectScrollDownButtonRoot({
426
463
  className,
427
464
  ...props
@@ -436,10 +473,7 @@ function SelectScrollDownButtonRoot({
436
473
  }
437
474
  );
438
475
  }
439
- function SelectScrollDownButtonFallback({
440
- className,
441
- ...props
442
- }) {
476
+ function SelectScrollDownButtonFallback({ className, ...props }) {
443
477
  return /* @__PURE__ */ jsxRuntime.jsx(
444
478
  "div",
445
479
  {
@@ -450,15 +484,39 @@ function SelectScrollDownButtonFallback({
450
484
  }
451
485
  );
452
486
  }
453
- var SelectScrollDownButton = chunkQG7ZF6TO_js.createClientOnlyComponent(SelectScrollDownButtonRoot, SelectScrollDownButtonFallback);
487
+ var SelectScrollDownButton = chunkQG7ZF6TO_js.createClientOnlyComponent(
488
+ SelectScrollDownButtonRoot,
489
+ SelectScrollDownButtonFallback
490
+ );
454
491
 
455
492
  exports.Select = Select;
456
493
  exports.SelectContent = SelectContent;
494
+ exports.SelectContentFallback = SelectContentFallback;
495
+ exports.SelectContentRoot = SelectContentRoot;
496
+ exports.SelectFallback = SelectFallback;
457
497
  exports.SelectGroup = SelectGroup;
498
+ exports.SelectGroupFallback = SelectGroupFallback;
499
+ exports.SelectGroupRoot = SelectGroupRoot;
458
500
  exports.SelectItem = SelectItem;
501
+ exports.SelectItemFallback = SelectItemFallback;
502
+ exports.SelectItemRoot = SelectItemRoot;
459
503
  exports.SelectLabel = SelectLabel;
504
+ exports.SelectLabelFallback = SelectLabelFallback;
505
+ exports.SelectLabelRoot = SelectLabelRoot;
506
+ exports.SelectRoot = SelectRoot;
460
507
  exports.SelectScrollDownButton = SelectScrollDownButton;
508
+ exports.SelectScrollDownButtonFallback = SelectScrollDownButtonFallback;
509
+ exports.SelectScrollDownButtonRoot = SelectScrollDownButtonRoot;
461
510
  exports.SelectScrollUpButton = SelectScrollUpButton;
511
+ exports.SelectScrollUpButtonFallback = SelectScrollUpButtonFallback;
512
+ exports.SelectScrollUpButtonRoot = SelectScrollUpButtonRoot;
462
513
  exports.SelectSeparator = SelectSeparator;
514
+ exports.SelectSeparatorFallback = SelectSeparatorFallback;
515
+ exports.SelectSeparatorRoot = SelectSeparatorRoot;
463
516
  exports.SelectTrigger = SelectTrigger;
517
+ exports.SelectTriggerFallback = SelectTriggerFallback;
518
+ exports.SelectTriggerRoot = SelectTriggerRoot;
464
519
  exports.SelectValue = SelectValue;
520
+ exports.SelectValueFallback = SelectValueFallback;
521
+ exports.SelectValueRoot = SelectValueRoot;
522
+ exports.selectTriggerVariants = selectTriggerVariants;
@@ -48,14 +48,7 @@ function ModalOverlayRoot({ className, ...props }) {
48
48
  );
49
49
  }
50
50
  function ModalOverlayFallback({ className, ...props }) {
51
- return /* @__PURE__ */ jsx(
52
- "div",
53
- {
54
- "data-slot": "modal-overlay",
55
- className: cn(modalOverlayVariants(), className),
56
- ...props
57
- }
58
- );
51
+ return /* @__PURE__ */ jsx("div", { "data-slot": "modal-overlay", className: cn(modalOverlayVariants(), className), ...props });
59
52
  }
60
53
  var ModalOverlay = createClientOnlyComponent(ModalOverlayRoot, ModalOverlayFallback);
61
54
  var modalContentVariants = cva([
@@ -133,41 +126,33 @@ function ModalContentFallback({
133
126
  showCloseButton = true,
134
127
  ...props
135
128
  }) {
136
- return /* @__PURE__ */ jsxs(
137
- "div",
138
- {
139
- "data-slot": "modal-content",
140
- className: cn(modalContentVariants(), className),
141
- ...props,
142
- children: [
143
- children,
144
- showCloseButton && /* @__PURE__ */ jsxs(
145
- "button",
146
- {
147
- "data-slot": "modal-close",
148
- className: cn(
149
- "absolute",
150
- "right-[16px]",
151
- "top-[16px]",
152
- "w-[16px]",
153
- "h-[16px]",
154
- "rounded-uk-sm",
155
- "cursor-pointer",
156
- "hover:text-icon-highlight",
157
- "text-icon-primary",
158
- "flex",
159
- "items-center",
160
- "justify-center"
161
- ),
162
- children: [
163
- /* @__PURE__ */ jsx(XIcon, {}),
164
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
165
- ]
166
- }
167
- )
168
- ]
169
- }
170
- );
129
+ return /* @__PURE__ */ jsxs("div", { "data-slot": "modal-content", className: cn(modalContentVariants(), className), ...props, children: [
130
+ children,
131
+ showCloseButton && /* @__PURE__ */ jsxs(
132
+ "button",
133
+ {
134
+ "data-slot": "modal-close",
135
+ className: cn(
136
+ "absolute",
137
+ "right-[16px]",
138
+ "top-[16px]",
139
+ "w-[16px]",
140
+ "h-[16px]",
141
+ "rounded-uk-sm",
142
+ "cursor-pointer",
143
+ "hover:text-icon-highlight",
144
+ "text-icon-primary",
145
+ "flex",
146
+ "items-center",
147
+ "justify-center"
148
+ ),
149
+ children: [
150
+ /* @__PURE__ */ jsx(XIcon, {}),
151
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
152
+ ]
153
+ }
154
+ )
155
+ ] });
171
156
  }
172
157
  var ModalContent = createClientOnlyComponent(ModalContentRoot, ModalContentFallback);
173
158
  function ModalHeader({ className, ...props }) {
@@ -25,14 +25,7 @@ function TabsRoot({ className, size = "base", ...props }) {
25
25
  ) });
26
26
  }
27
27
  function TabsFallback({ className, size = "base", ...props }) {
28
- return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx(
29
- "div",
30
- {
31
- "data-slot": "tabs",
32
- className: cn("flex w-full flex-col", className),
33
- ...props
34
- }
35
- ) });
28
+ return /* @__PURE__ */ jsx(TabsContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx("div", { "data-slot": "tabs", className: cn("flex w-full flex-col", className), ...props }) });
36
29
  }
37
30
  var Tabs = createClientOnlyComponent(TabsRoot, TabsFallback);
38
31
  var tabsListVariants = cva(["inline-flex", "items-center", "justify-center"], {
@@ -142,14 +135,7 @@ function TabsContentRoot({ className, ...props }) {
142
135
  );
143
136
  }
144
137
  function TabsContentFallback({ className, ...props }) {
145
- return /* @__PURE__ */ jsx(
146
- "div",
147
- {
148
- "data-slot": "tabs-content",
149
- className: cn("flex-1 outline-none", className),
150
- ...props
151
- }
152
- );
138
+ return /* @__PURE__ */ jsx("div", { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props });
153
139
  }
154
140
  var TabsContent = createClientOnlyComponent(TabsContentRoot, TabsContentFallback);
155
141
 
@@ -28,7 +28,12 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
28
28
  const selectRange = useRef([null, null]);
29
29
  const inputChange = useRef(false);
30
30
  const [isDragging, setIsDragging] = useState(false);
31
+ const [cursorState, setCursorState] = useState(
32
+ "default"
33
+ );
34
+ const dragDirection = useRef("none");
31
35
  const dragStart = useRef({ x: 0, y: 0 });
36
+ const initialDragStart = useRef({ x: 0, y: 0 });
32
37
  const accumulatedDelta = useRef(0);
33
38
  const stopClick = useCallback(() => {
34
39
  const stopClick2 = (e) => {
@@ -43,9 +48,12 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
43
48
  e.preventDefault();
44
49
  e.stopPropagation();
45
50
  setIsDragging(true);
51
+ setCursorState("dragging-y");
46
52
  dragStart.current = { x: e.clientX, y: e.clientY };
53
+ initialDragStart.current = { x: e.clientX, y: e.clientY };
47
54
  accumulatedDelta.current = 0;
48
55
  inputChange.current = false;
56
+ dragDirection.current = "none";
49
57
  selectRange.current[0] = getHoverElementAndIndex(
50
58
  document.elementFromPoint(e.clientX, e.clientY),
51
59
  inputs.current
@@ -57,36 +65,55 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
57
65
  e.preventDefault();
58
66
  e.stopPropagation();
59
67
  const deltaX = e.clientX - dragStart.current.x;
60
- const deltaY = e.clientY - dragStart.current.y;
61
- accumulatedDelta.current += deltaX / 2;
62
- dragStart.current = { x: e.clientX, y: e.clientY };
63
- if (Math.abs(accumulatedDelta.current) >= (inputChange.current ? 1 : 5)) {
64
- const multiplyStep = e.shiftKey ? 5 : e.altKey ? 1 / 5 : 1;
65
- const newValue = value.map((v, i) => {
66
- const [first, last] = selectRange.current;
67
- if (first === null || last === null) {
68
- return v;
69
- } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
70
- return Number(
71
- ((v || 0) + Math.floor(accumulatedDelta.current) * step * multiplyStep).toPrecision(
72
- 6
73
- )
74
- );
75
- } else {
76
- return v;
77
- }
78
- });
79
- onValuesChange == null ? void 0 : onValuesChange(newValue);
80
- accumulatedDelta.current = 0;
81
- inputChange.current = true;
68
+ e.clientY - dragStart.current.y;
69
+ const totalDeltaX = e.clientX - initialDragStart.current.x;
70
+ const totalDeltaY = e.clientY - initialDragStart.current.y;
71
+ if (dragDirection.current === "none") {
72
+ if (Math.abs(totalDeltaY) > 2 || Math.abs(totalDeltaX) > 2) {
73
+ dragDirection.current = "y";
74
+ setCursorState("dragging-y");
75
+ }
76
+ } else if (dragDirection.current === "y" && Math.abs(totalDeltaX) > 5) {
77
+ dragDirection.current = "x";
78
+ setCursorState("dragging-x");
79
+ }
80
+ if (dragDirection.current === "x") {
81
+ accumulatedDelta.current += deltaX / 2;
82
+ dragStart.current = { x: e.clientX, y: e.clientY };
83
+ if (selectRange.current[1] === null) {
84
+ selectRange.current[1] = selectRange.current[0];
85
+ }
86
+ if (Math.abs(accumulatedDelta.current) >= (inputChange.current ? 1 : 5)) {
87
+ const multiplyStep = e.shiftKey ? 5 : e.altKey ? 1 / 5 : 1;
88
+ const newValue = value.map((v, i) => {
89
+ const [first, last] = selectRange.current;
90
+ if (first === null || last === null) {
91
+ return v;
92
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
93
+ return Number(
94
+ ((v || 0) + Math.floor(accumulatedDelta.current) * step * multiplyStep).toPrecision(
95
+ 6
96
+ )
97
+ );
98
+ } else {
99
+ return v;
100
+ }
101
+ });
102
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
103
+ accumulatedDelta.current = 0;
104
+ inputChange.current = true;
105
+ }
82
106
  changeElementsHoverState(inputs.current, selectRange.current, "x");
83
107
  stopClick();
84
- }
85
- if (!inputChange.current) {
108
+ } else if (dragDirection.current === "y") {
86
109
  const currentElement = document.elementFromPoint(e.clientX, e.clientY);
87
110
  const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
88
111
  selectRange.current[1] = currentIndex ?? selectRange.current[1];
89
- changeElementsHoverState(inputs.current, selectRange.current, deltaY !== 0 ? "y" : "none");
112
+ changeElementsHoverState(inputs.current, selectRange.current, "y");
113
+ stopClick();
114
+ } else {
115
+ dragStart.current = { x: e.clientX, y: e.clientY };
116
+ changeElementsHoverState(inputs.current, selectRange.current, "y");
90
117
  stopClick();
91
118
  }
92
119
  },
@@ -95,8 +122,10 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
95
122
  const handleMouseUp = useCallback(() => {
96
123
  if (!isDragging) return;
97
124
  setIsDragging(false);
125
+ setCursorState("default");
98
126
  selectRange.current = [null, null];
99
127
  inputChange.current = false;
128
+ dragDirection.current = "none";
100
129
  changeElementsHoverState(inputs.current, selectRange.current, "none");
101
130
  }, [isDragging]);
102
131
  React.useEffect(() => {
@@ -140,7 +169,17 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
140
169
  {
141
170
  ref,
142
171
  onMouseDown: handleMouseDown,
143
- className: cn("gap-xs flex cursor-crosshair touch-none flex-col select-none"),
172
+ className: cn([
173
+ "gap-xs flex touch-none flex-col select-none",
174
+ cursorState === "default" && "cursor-crosshair",
175
+ cursorState === "dragging-y" && "cursor-ns-resize",
176
+ cursorState === "dragging-x" && "cursor-col-resize",
177
+ "data-[hover=down]:bg-bg-tertiary",
178
+ "data-[hover=x]:bg-bg-tertiary",
179
+ "data-[hover=y]:bg-bg-tertiary",
180
+ "data-[hover=x]:cursor-col-resize",
181
+ "data-[hover=y]:cursor-ns-resize"
182
+ ]),
144
183
  children: value.map((item, index) => /* @__PURE__ */ jsx(
145
184
  InputRoot,
146
185
  {
@@ -160,28 +199,25 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
160
199
  "data-hover": "none",
161
200
  className: cn([
162
201
  "group/number-input",
163
- "cursor-crosshair",
202
+ "cursor-text",
164
203
  "data-[hover=down]:bg-bg-tertiary",
165
204
  "data-[hover=x]:bg-bg-tertiary",
166
205
  "data-[hover=y]:bg-bg-tertiary",
167
- "data-[hover=down]:cursor-move",
168
206
  "data-[hover=x]:cursor-col-resize",
169
- "data-[hover=y]:cursor-row-resize"
207
+ "data-[hover=y]:cursor-ns-resize"
170
208
  ]),
171
209
  inputClassName: cn([
172
- "cursor-crosshair",
173
- "group-data-[hover=down]/number-input:cursor-move",
210
+ "cursor-text",
174
211
  "group-data-[hover=x]/number-input:cursor-col-resize",
175
- "group-data-[hover=y]/number-input:cursor-row-resize"
212
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
176
213
  ]),
177
214
  children: /* @__PURE__ */ jsx(
178
215
  InputSlot,
179
216
  {
180
217
  className: cn(
181
- "cursor-crosshair",
182
- "group-data-[hover=down]/number-input:cursor-move",
218
+ "cursor-text",
183
219
  "group-data-[hover=x]/number-input:cursor-col-resize",
184
- "group-data-[hover=y]/number-input:cursor-row-resize"
220
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
185
221
  ),
186
222
  children: prefix == null ? void 0 : prefix[index]
187
223
  }