@vuer-ai/vuer-uikit 0.0.26 → 0.0.27

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 (83) hide show
  1. package/dist/chunk-2TRYGIGT.mjs +76 -0
  2. package/dist/chunk-2YCL2ET2.js +431 -0
  3. package/dist/chunk-5SR53QBZ.js +143 -0
  4. package/dist/chunk-6N5422RT.js +110 -0
  5. package/dist/chunk-6RTJSAVW.js +202 -0
  6. package/dist/chunk-ALTUOIWV.mjs +15 -0
  7. package/dist/chunk-AOUGWGQR.js +609 -0
  8. package/dist/chunk-B2E7AY66.mjs +86 -0
  9. package/dist/chunk-DZ4J7I7I.mjs +114 -0
  10. package/dist/chunk-E33MW663.js +179 -0
  11. package/dist/chunk-EOFYA6CS.js +53 -0
  12. package/dist/chunk-EUY74AXP.mjs +341 -0
  13. package/dist/chunk-EYIFKSU2.mjs +259 -0
  14. package/dist/chunk-F56ZKT7B.mjs +1 -0
  15. package/dist/chunk-F776EMXP.mjs +82 -0
  16. package/dist/chunk-FEYQ2OWB.mjs +39 -0
  17. package/dist/chunk-FP26SRGL.js +377 -0
  18. package/dist/chunk-H5C3BWSK.mjs +196 -0
  19. package/dist/chunk-HLJ7PQA7.mjs +15 -0
  20. package/dist/chunk-IXHMIR5P.js +131 -0
  21. package/dist/chunk-JMPVDU2C.mjs +110 -0
  22. package/dist/chunk-LEPXSM36.mjs +46 -0
  23. package/dist/chunk-LKAGJL2E.mjs +15 -0
  24. package/dist/chunk-MRVMXKZO.mjs +106 -0
  25. package/dist/chunk-MZ4POL3U.js +301 -0
  26. package/dist/chunk-N7CINZS2.js +2 -0
  27. package/dist/chunk-OO7LYJQL.js +41 -0
  28. package/dist/chunk-OQ237S4Z.js +94 -0
  29. package/dist/chunk-PIJM7ZII.js +21 -0
  30. package/dist/chunk-PVRQNCSJ.js +49 -0
  31. package/dist/chunk-Q5KEB4UK.mjs +51 -0
  32. package/dist/chunk-QVUX6LLD.mjs +270 -0
  33. package/dist/chunk-QYRRQ65X.mjs +115 -0
  34. package/dist/chunk-SKO72K64.js +118 -0
  35. package/dist/chunk-TMBKCIVQ.mjs +148 -0
  36. package/dist/chunk-U2ZLDPOE.js +261 -0
  37. package/dist/chunk-U7SNLMJR.js +110 -0
  38. package/dist/chunk-UKFVRXAR.mjs +409 -0
  39. package/dist/chunk-V4KNORQN.js +21 -0
  40. package/dist/chunk-VXHM7V6F.mjs +92 -0
  41. package/dist/chunk-W7D57QE6.js +21 -0
  42. package/dist/chunk-WDUTW7HS.mjs +87 -0
  43. package/dist/chunk-WJ7T7FAH.js +135 -0
  44. package/dist/chunk-X55EAYE2.js +94 -0
  45. package/dist/chunk-YXDJPCAF.js +99 -0
  46. package/dist/chunk-ZVG2UKKC.mjs +603 -0
  47. package/dist/highlight-cursor/enhanced-components.js +9 -9
  48. package/dist/highlight-cursor/enhanced-components.mjs +4 -4
  49. package/dist/highlight-cursor/index.js +9 -9
  50. package/dist/highlight-cursor/index.mjs +4 -4
  51. package/dist/index.css +1 -1
  52. package/dist/index.d.mts +2 -5
  53. package/dist/index.d.ts +2 -5
  54. package/dist/index.js +109 -109
  55. package/dist/index.mjs +13 -13
  56. package/dist/ui/badge.d.mts +2 -2
  57. package/dist/ui/badge.d.ts +2 -2
  58. package/dist/ui/index.d.mts +2 -5
  59. package/dist/ui/index.d.ts +2 -5
  60. package/dist/ui/index.js +93 -93
  61. package/dist/ui/index.mjs +11 -11
  62. package/dist/ui/input.d.mts +1 -1
  63. package/dist/ui/input.d.ts +1 -1
  64. package/dist/ui/select.d.mts +1 -1
  65. package/dist/ui/select.d.ts +1 -1
  66. package/dist/ui/theme-context.d.mts +17 -0
  67. package/dist/ui/theme-context.d.ts +17 -0
  68. package/dist/ui/theme-context.js +17 -0
  69. package/dist/ui/theme-context.mjs +4 -0
  70. package/dist/ui/timeline.d.mts +10 -23
  71. package/dist/ui/timeline.d.ts +10 -23
  72. package/package.json +1 -1
  73. package/src/ui/theme-context/theme-context.tsx +2 -2
  74. package/dist/ui/drawer.d.mts +0 -16
  75. package/dist/ui/drawer.d.ts +0 -16
  76. package/dist/ui/theme-context/index.d.mts +0 -4
  77. package/dist/ui/theme-context/index.d.ts +0 -4
  78. package/dist/ui/theme-context/theme-context.d.mts +0 -8
  79. package/dist/ui/theme-context/theme-context.d.ts +0 -8
  80. package/dist/ui/theme-context/theme-script.d.mts +0 -13
  81. package/dist/ui/theme-context/theme-script.d.ts +0 -13
  82. package/dist/ui/theme-context/theme-types.d.mts +0 -47
  83. package/dist/ui/theme-context/theme-types.d.ts +0 -47
@@ -0,0 +1,110 @@
1
+ 'use strict';
2
+
3
+ var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
4
+ var AvatarPrimitive = require('@radix-ui/react-avatar');
5
+ var React = require('react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
29
+ var React__default = /*#__PURE__*/_interopDefault(React);
30
+
31
+ function Avatar({ className, ...props }) {
32
+ return /* @__PURE__ */ jsxRuntime.jsx(
33
+ AvatarPrimitive__namespace.Root,
34
+ {
35
+ "data-slot": "avatar",
36
+ className: chunkXXWQ4RVP_js.cn("relative flex size-[24px] shrink-0 overflow-hidden rounded-full", className),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ function AvatarImage({ className, ...props }) {
42
+ return /* @__PURE__ */ jsxRuntime.jsx(
43
+ AvatarPrimitive__namespace.Image,
44
+ {
45
+ "data-slot": "avatar-image",
46
+ className: chunkXXWQ4RVP_js.cn("aspect-square size-full", className),
47
+ ...props
48
+ }
49
+ );
50
+ }
51
+ function AvatarFallback({ className, ...props }) {
52
+ return /* @__PURE__ */ jsxRuntime.jsx(
53
+ AvatarPrimitive__namespace.Fallback,
54
+ {
55
+ "data-slot": "avatar-fallback",
56
+ className: chunkXXWQ4RVP_js.cn(
57
+ "bg-bg-tertiary flex size-full items-center justify-center rounded-full",
58
+ className
59
+ ),
60
+ ...props
61
+ }
62
+ );
63
+ }
64
+ function AvatarGroup({ children, className, spacing = "normal", max }) {
65
+ const spacingClasses = {
66
+ tight: "-space-x-1.5",
67
+ normal: "-space-x-1",
68
+ loose: "-space-x-0.45"
69
+ };
70
+ const childrenArray = React__default.default.Children.toArray(children);
71
+ const displayChildren = max ? childrenArray.slice(0, max) : childrenArray;
72
+ const remainingCount = max && childrenArray.length > max ? childrenArray.length - max : 0;
73
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkXXWQ4RVP_js.cn("flex", spacingClasses[spacing], className), children: [
74
+ displayChildren.map((child, index) => {
75
+ var _a;
76
+ const zIndex = 30 - index;
77
+ if (React__default.default.isValidElement(child)) {
78
+ return React__default.default.cloneElement(
79
+ child,
80
+ {
81
+ key: index,
82
+ className: chunkXXWQ4RVP_js.cn(
83
+ `ring-background relative ring-2 z-[${zIndex}] transition-all duration-200 ease-in-out hover:z-[100] hover:scale-120`,
84
+ (_a = child.props) == null ? void 0 : _a.className
85
+ )
86
+ }
87
+ );
88
+ }
89
+ return child;
90
+ }),
91
+ remainingCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(
92
+ Avatar,
93
+ {
94
+ className: chunkXXWQ4RVP_js.cn(
95
+ "ring-background relative cursor-default ring-2 transition-all duration-200 ease-in-out hover:z-[100] hover:scale-120",
96
+ `z-[${30 - displayChildren.length}]`
97
+ ),
98
+ children: /* @__PURE__ */ jsxRuntime.jsxs(AvatarFallback, { children: [
99
+ "+",
100
+ remainingCount
101
+ ] })
102
+ }
103
+ )
104
+ ] });
105
+ }
106
+
107
+ exports.Avatar = Avatar;
108
+ exports.AvatarFallback = AvatarFallback;
109
+ exports.AvatarGroup = AvatarGroup;
110
+ exports.AvatarImage = AvatarImage;
@@ -0,0 +1,202 @@
1
+ 'use strict';
2
+
3
+ var chunkSKO72K64_js = require('./chunk-SKO72K64.js');
4
+ var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
5
+ var React = require('react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefault(React);
11
+
12
+ var getHoverElementAndIndex = (element, inputs) => {
13
+ if (!element) return null;
14
+ const container = element == null ? void 0 : element.closest("[data-input]");
15
+ const currentInput = container == null ? void 0 : container.querySelector("input");
16
+ if (!currentInput) return null;
17
+ return Array.from(inputs.values()).indexOf(currentInput);
18
+ };
19
+ var changeElementsHoverState = (inputs, range, changed) => {
20
+ const [first, last] = range;
21
+ Array.from(inputs.values()).forEach((input, i) => {
22
+ const container = input == null ? void 0 : input.closest("[data-input]");
23
+ if (first === null || last === null) {
24
+ container == null ? void 0 : container.setAttribute("data-hover", "none");
25
+ } else if (i >= Math.min(first, last) && i <= Math.max(first, last)) {
26
+ container == null ? void 0 : container.setAttribute("data-hover", changed !== "none" ? changed : "down");
27
+ } else {
28
+ container == null ? void 0 : container.setAttribute("data-hover", "none");
29
+ }
30
+ });
31
+ };
32
+ var InputNumbers = React.forwardRef(function InputNumbers2({ size, value, onValuesChange, prefix, step = 0.1 }, ref) {
33
+ const inputs = React.useRef(/* @__PURE__ */ new Map());
34
+ const selectRange = React.useRef([null, null]);
35
+ const inputChange = React.useRef(false);
36
+ const [isDragging, setIsDragging] = React.useState(false);
37
+ const dragStart = React.useRef({ x: 0, y: 0 });
38
+ const accumulatedDelta = React.useRef(0);
39
+ const stopClick = React.useCallback(() => {
40
+ const stopClick2 = (e) => {
41
+ e.stopPropagation();
42
+ e.preventDefault();
43
+ document.removeEventListener("click", stopClick2, true);
44
+ };
45
+ document.addEventListener("click", stopClick2, true);
46
+ }, []);
47
+ const handleMouseDown = React.useCallback((e) => {
48
+ if (e.button !== 0) return;
49
+ e.preventDefault();
50
+ e.stopPropagation();
51
+ setIsDragging(true);
52
+ dragStart.current = { x: e.clientX, y: e.clientY };
53
+ accumulatedDelta.current = 0;
54
+ inputChange.current = false;
55
+ selectRange.current[0] = getHoverElementAndIndex(
56
+ document.elementFromPoint(e.clientX, e.clientY),
57
+ inputs.current
58
+ );
59
+ }, []);
60
+ const handleMouseMove = React.useCallback(
61
+ (e) => {
62
+ if (!isDragging) return;
63
+ e.preventDefault();
64
+ e.stopPropagation();
65
+ const deltaX = e.clientX - dragStart.current.x;
66
+ const deltaY = e.clientY - dragStart.current.y;
67
+ accumulatedDelta.current += deltaX / 2;
68
+ dragStart.current = { x: e.clientX, y: e.clientY };
69
+ if (Math.abs(accumulatedDelta.current) >= (inputChange.current ? 1 : 5)) {
70
+ const multiplyStep = e.shiftKey ? 5 : e.altKey ? 1 / 5 : 1;
71
+ const newValue = value.map((v, i) => {
72
+ const [first, last] = selectRange.current;
73
+ if (first === null || last === null) {
74
+ return v;
75
+ } else if (i <= Math.max(first, last) && i >= Math.min(first, last)) {
76
+ return Number(
77
+ ((v || 0) + Math.floor(accumulatedDelta.current) * step * multiplyStep).toPrecision(
78
+ 6
79
+ )
80
+ );
81
+ } else {
82
+ return v;
83
+ }
84
+ });
85
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
86
+ accumulatedDelta.current = 0;
87
+ inputChange.current = true;
88
+ changeElementsHoverState(inputs.current, selectRange.current, "x");
89
+ stopClick();
90
+ }
91
+ if (!inputChange.current) {
92
+ const currentElement = document.elementFromPoint(e.clientX, e.clientY);
93
+ const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
94
+ selectRange.current[1] = currentIndex ?? selectRange.current[1];
95
+ changeElementsHoverState(inputs.current, selectRange.current, deltaY !== 0 ? "y" : "none");
96
+ stopClick();
97
+ }
98
+ },
99
+ [isDragging, value, onValuesChange, step, stopClick]
100
+ );
101
+ const handleMouseUp = React.useCallback(() => {
102
+ if (!isDragging) return;
103
+ setIsDragging(false);
104
+ selectRange.current = [null, null];
105
+ inputChange.current = false;
106
+ changeElementsHoverState(inputs.current, selectRange.current, "none");
107
+ }, [isDragging]);
108
+ React__default.default.useEffect(() => {
109
+ if (isDragging) {
110
+ const handleGlobalMouseMove = (e) => {
111
+ handleMouseMove(e);
112
+ };
113
+ const handleGlobalMouseUp = () => {
114
+ handleMouseUp();
115
+ };
116
+ document.addEventListener("mousemove", handleGlobalMouseMove);
117
+ document.addEventListener("mouseup", handleGlobalMouseUp);
118
+ return () => {
119
+ document.removeEventListener("mousemove", handleGlobalMouseMove);
120
+ document.removeEventListener("mouseup", handleGlobalMouseUp);
121
+ };
122
+ }
123
+ }, [isDragging, handleMouseMove, handleMouseUp]);
124
+ const valueChangeHandler = React.useCallback(
125
+ (index) => {
126
+ return (e) => {
127
+ const inputValue = e.target.value;
128
+ if (inputValue === "" || !isNaN(Number(inputValue))) {
129
+ const newValue = value.map((v, i) => {
130
+ if (inputValue === "") {
131
+ return "";
132
+ }
133
+ return i === index ? Number(inputValue) : v;
134
+ });
135
+ onValuesChange == null ? void 0 : onValuesChange(newValue);
136
+ }
137
+ };
138
+ },
139
+ [onValuesChange, value]
140
+ );
141
+ if ((value == null ? void 0 : value.length) === 0) {
142
+ throw new Error("`value` cannot be an empty array");
143
+ }
144
+ return /* @__PURE__ */ jsxRuntime.jsx(
145
+ "div",
146
+ {
147
+ ref,
148
+ onMouseDown: handleMouseDown,
149
+ className: chunkXXWQ4RVP_js.cn("gap-xs flex cursor-crosshair touch-none flex-col select-none"),
150
+ children: value.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
151
+ chunkSKO72K64_js.InputRoot,
152
+ {
153
+ ref: (r) => {
154
+ inputs.current.set(index.toString(), r);
155
+ return () => {
156
+ inputs.current.delete(index.toString());
157
+ };
158
+ },
159
+ size,
160
+ value: item,
161
+ onClick: () => {
162
+ var _a;
163
+ (_a = inputs.current.get(index.toString())) == null ? void 0 : _a.focus();
164
+ },
165
+ onChange: valueChangeHandler(index),
166
+ "data-hover": "none",
167
+ className: chunkXXWQ4RVP_js.cn([
168
+ "group/number-input",
169
+ "cursor-crosshair",
170
+ "data-[hover=down]:bg-bg-tertiary",
171
+ "data-[hover=x]:bg-bg-tertiary",
172
+ "data-[hover=y]:bg-bg-tertiary",
173
+ "data-[hover=down]:cursor-move",
174
+ "data-[hover=x]:cursor-col-resize",
175
+ "data-[hover=y]:cursor-row-resize"
176
+ ]),
177
+ inputClassName: chunkXXWQ4RVP_js.cn([
178
+ "cursor-crosshair",
179
+ "group-data-[hover=down]/number-input:cursor-move",
180
+ "group-data-[hover=x]/number-input:cursor-col-resize",
181
+ "group-data-[hover=y]/number-input:cursor-row-resize"
182
+ ]),
183
+ children: /* @__PURE__ */ jsxRuntime.jsx(
184
+ chunkSKO72K64_js.InputSlot,
185
+ {
186
+ className: chunkXXWQ4RVP_js.cn(
187
+ "cursor-crosshair",
188
+ "group-data-[hover=down]/number-input:cursor-move",
189
+ "group-data-[hover=x]/number-input:cursor-col-resize",
190
+ "group-data-[hover=y]/number-input:cursor-row-resize"
191
+ ),
192
+ children: prefix == null ? void 0 : prefix[index]
193
+ }
194
+ )
195
+ },
196
+ index
197
+ ))
198
+ }
199
+ );
200
+ });
201
+
202
+ exports.InputNumbers = InputNumbers;
@@ -0,0 +1,15 @@
1
+ import { Tabs } from './chunk-MRVMXKZO.mjs';
2
+ import { Textarea } from './chunk-DDOX4EEM.mjs';
3
+ import { SelectTrigger } from './chunk-QVUX6LLD.mjs';
4
+ import { Button } from './chunk-VXHM7V6F.mjs';
5
+ import { InputRoot } from './chunk-QYRRQ65X.mjs';
6
+ import { withCursor } from './chunk-44KW6PTD.mjs';
7
+
8
+ // src/highlight-cursor/enhanced-components.tsx
9
+ var CursorButton = withCursor(Button);
10
+ var CursorTabs = withCursor(Tabs);
11
+ var CursorInputRoot = withCursor(InputRoot);
12
+ var CursorSelectTrigger = withCursor(SelectTrigger);
13
+ var CursorTextarea = withCursor(Textarea);
14
+
15
+ export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea };