saha-ui 1.22.3 → 1.22.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.
- package/dist/components/DragDrop/DebugOverlay.d.ts +10 -0
- package/dist/components/DragDrop/DebugOverlay.d.ts.map +1 -0
- package/dist/components/DragDrop/DebugOverlay.js +286 -0
- package/dist/components/DragDrop/DragDrop.styles.d.ts +46 -0
- package/dist/components/DragDrop/DragDrop.styles.d.ts.map +1 -0
- package/dist/components/DragDrop/DragDrop.styles.js +168 -0
- package/dist/components/DragDrop/DragDrop.types.d.ts +324 -0
- package/dist/components/DragDrop/DragDrop.types.d.ts.map +1 -0
- package/dist/components/DragDrop/DragDrop.utils.d.ts +82 -0
- package/dist/components/DragDrop/DragDrop.utils.d.ts.map +1 -0
- package/dist/components/DragDrop/DragDrop.utils.js +294 -0
- package/dist/components/DragDrop/DragDropContext.d.ts +5 -0
- package/dist/components/DragDrop/DragDropContext.d.ts.map +1 -0
- package/dist/components/DragDrop/DragDropContext.js +292 -0
- package/dist/components/DragDrop/DragHandle.d.ts +4 -0
- package/dist/components/DragDrop/DragHandle.d.ts.map +1 -0
- package/dist/components/DragDrop/DragHandle.js +23 -0
- package/dist/components/DragDrop/DragOverlay.d.ts +4 -0
- package/dist/components/DragDrop/DragOverlay.d.ts.map +1 -0
- package/dist/components/DragDrop/DragOverlay.js +74 -0
- package/dist/components/DragDrop/DraggableItem.d.ts +8 -0
- package/dist/components/DragDrop/DraggableItem.d.ts.map +1 -0
- package/dist/components/DragDrop/DraggableItem.js +219 -0
- package/dist/components/DragDrop/DroppableContainer.d.ts +8 -0
- package/dist/components/DragDrop/DroppableContainer.d.ts.map +1 -0
- package/dist/components/DragDrop/DroppableContainer.js +156 -0
- package/dist/components/DragDrop/SelectionManager.d.ts +19 -0
- package/dist/components/DragDrop/SelectionManager.d.ts.map +1 -0
- package/dist/components/DragDrop/SelectionManager.js +139 -0
- package/dist/components/DragDrop/TreeView.d.ts +18 -0
- package/dist/components/DragDrop/TreeView.d.ts.map +1 -0
- package/dist/components/DragDrop/TreeView.js +147 -0
- package/dist/components/DragDrop/VirtualList.d.ts +36 -0
- package/dist/components/DragDrop/VirtualList.d.ts.map +1 -0
- package/dist/components/DragDrop/VirtualList.js +162 -0
- package/dist/components/DragDrop/index.d.ts +12 -0
- package/dist/components/DragDrop/index.d.ts.map +1 -0
- package/dist/components/DragDrop/index.js +60 -0
- package/dist/components/Select/index.d.ts +55 -3
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +429 -221
- package/dist/components/VideoPlayer/Controls.d.ts +2 -1
- package/dist/components/VideoPlayer/Controls.d.ts.map +1 -1
- package/dist/components/VideoPlayer/Controls.js +66 -63
- package/dist/components/VideoPlayer/VideoPlayer.types.d.ts +17 -1
- package/dist/components/VideoPlayer/VideoPlayer.types.d.ts.map +1 -1
- package/dist/components/VideoPlayer/index.d.ts.map +1 -1
- package/dist/components/VideoPlayer/index.js +298 -167
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +612 -584
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface DebugOverlayProps {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
5
|
+
showCollisionRects?: boolean;
|
|
6
|
+
showDragPath?: boolean;
|
|
7
|
+
showPerformanceMetrics?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const DebugOverlay: React.FC<DebugOverlayProps>;
|
|
10
|
+
//# sourceMappingURL=DebugOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DebugOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DebugOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAS3D,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAMD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwWpD,CAAC"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { jsxs as t, Fragment as v, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as w, useEffect as p } from "react";
|
|
3
|
+
import { useDragDropContext as P } from "./DragDropContext.js";
|
|
4
|
+
import { cn as C } from "../../lib/utils.js";
|
|
5
|
+
import { ChevronUp as z, ChevronDown as G } from "lucide-react";
|
|
6
|
+
const T = ({
|
|
7
|
+
enabled: u = !0,
|
|
8
|
+
position: I = "top-right",
|
|
9
|
+
showCollisionRects: E = !0,
|
|
10
|
+
showDragPath: g = !0,
|
|
11
|
+
showPerformanceMetrics: h = !0
|
|
12
|
+
}) => {
|
|
13
|
+
const j = P(), [i, D] = f(!0), [d, y] = f([]), [x, O] = f(0), [S, k] = f(0), n = w({ frames: 0, lastTime: performance.now() }), N = w(0), {
|
|
14
|
+
activeId: R,
|
|
15
|
+
activeItem: b,
|
|
16
|
+
activeIndex: F,
|
|
17
|
+
sourceContainerId: A,
|
|
18
|
+
dragPosition: a,
|
|
19
|
+
isDragging: r,
|
|
20
|
+
selectionState: l,
|
|
21
|
+
historyState: c
|
|
22
|
+
} = j;
|
|
23
|
+
return p(() => {
|
|
24
|
+
y(r && a ? (s) => [
|
|
25
|
+
...s.slice(-50),
|
|
26
|
+
// Keep last 50 points
|
|
27
|
+
{ x: a.x, y: a.y, timestamp: Date.now() }
|
|
28
|
+
] : []);
|
|
29
|
+
}, [r, a]), p(() => {
|
|
30
|
+
if (!u || !h) return;
|
|
31
|
+
const s = () => {
|
|
32
|
+
const o = performance.now();
|
|
33
|
+
n.current.frames++, o >= n.current.lastTime + 1e3 && (O(
|
|
34
|
+
Math.round(
|
|
35
|
+
n.current.frames * 1e3 / (o - n.current.lastTime)
|
|
36
|
+
)
|
|
37
|
+
), n.current.frames = 0, n.current.lastTime = o), requestAnimationFrame(s);
|
|
38
|
+
}, m = requestAnimationFrame(s);
|
|
39
|
+
return () => cancelAnimationFrame(m);
|
|
40
|
+
}, [u, h]), p(() => {
|
|
41
|
+
N.current = performance.now();
|
|
42
|
+
}), p(() => {
|
|
43
|
+
k(performance.now() - N.current);
|
|
44
|
+
}), u ? /* @__PURE__ */ t(v, { children: [
|
|
45
|
+
/* @__PURE__ */ t(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: C(
|
|
49
|
+
"fixed z-[9999] bg-background border rounded-lg shadow-lg",
|
|
50
|
+
"max-w-md transition-all duration-200",
|
|
51
|
+
{
|
|
52
|
+
"top-left": "top-4 left-4",
|
|
53
|
+
"top-right": "top-4 right-4",
|
|
54
|
+
"bottom-left": "bottom-4 left-4",
|
|
55
|
+
"bottom-right": "bottom-4 right-4"
|
|
56
|
+
}[I],
|
|
57
|
+
!i && "w-auto"
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-between px-3 py-2 border-b bg-muted/50", children: [
|
|
61
|
+
/* @__PURE__ */ t("h3", { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
62
|
+
/* @__PURE__ */ e("span", { className: "w-2 h-2 rounded-full bg-green-500 animate-pulse" }),
|
|
63
|
+
"Drag & Drop Debug"
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ e(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
onClick: () => D(!i),
|
|
69
|
+
className: "p-1 hover:bg-background rounded transition-colors",
|
|
70
|
+
children: i ? /* @__PURE__ */ e(z, { className: "w-4 h-4" }) : /* @__PURE__ */ e(G, { className: "w-4 h-4" })
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
] }),
|
|
74
|
+
i && /* @__PURE__ */ t("div", { className: "p-3 space-y-3 text-xs max-h-[500px] overflow-auto", children: [
|
|
75
|
+
h && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
76
|
+
/* @__PURE__ */ e("h4", { className: "font-semibold text-foreground mb-2", children: "Performance" }),
|
|
77
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
78
|
+
/* @__PURE__ */ t("div", { className: "bg-muted/50 rounded px-2 py-1", children: [
|
|
79
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "FPS:" }),
|
|
80
|
+
/* @__PURE__ */ e(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: C(
|
|
84
|
+
"ml-2 font-mono font-medium",
|
|
85
|
+
x >= 50 ? "text-green-500" : x >= 30 ? "text-yellow-500" : "text-red-500"
|
|
86
|
+
),
|
|
87
|
+
children: x
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ t("div", { className: "bg-muted/50 rounded px-2 py-1", children: [
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Render:" }),
|
|
93
|
+
/* @__PURE__ */ t("span", { className: "ml-2 font-mono font-medium", children: [
|
|
94
|
+
S.toFixed(2),
|
|
95
|
+
"ms"
|
|
96
|
+
] })
|
|
97
|
+
] })
|
|
98
|
+
] })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
101
|
+
/* @__PURE__ */ e("h4", { className: "font-semibold text-foreground mb-2", children: "Drag State" }),
|
|
102
|
+
/* @__PURE__ */ t("div", { className: "bg-muted/50 rounded px-2 py-1 space-y-1", children: [
|
|
103
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Is Dragging:" }),
|
|
105
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: r ? "Yes" : "No" })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
108
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Active ID:" }),
|
|
109
|
+
/* @__PURE__ */ e("span", { className: "font-mono font-medium truncate max-w-[120px]", children: R || "—" })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
112
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Active Index:" }),
|
|
113
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: F ?? "—" })
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Container:" }),
|
|
117
|
+
/* @__PURE__ */ e("span", { className: "font-mono font-medium truncate max-w-[120px]", children: A || "—" })
|
|
118
|
+
] }),
|
|
119
|
+
a && /* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
120
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Position:" }),
|
|
121
|
+
/* @__PURE__ */ t("span", { className: "font-mono font-medium", children: [
|
|
122
|
+
"x: ",
|
|
123
|
+
Math.round(a.x),
|
|
124
|
+
", y:",
|
|
125
|
+
" ",
|
|
126
|
+
Math.round(a.y)
|
|
127
|
+
] })
|
|
128
|
+
] })
|
|
129
|
+
] })
|
|
130
|
+
] }),
|
|
131
|
+
l && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
132
|
+
/* @__PURE__ */ e("h4", { className: "font-semibold text-foreground mb-2", children: "Multi-Selection" }),
|
|
133
|
+
/* @__PURE__ */ t("div", { className: "bg-muted/50 rounded px-2 py-1 space-y-1", children: [
|
|
134
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
135
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Selected:" }),
|
|
136
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: [
|
|
137
|
+
l.selectedIds.size,
|
|
138
|
+
" items"
|
|
139
|
+
] })
|
|
140
|
+
] }),
|
|
141
|
+
l.selectedIds.size > 0 && /* @__PURE__ */ t("div", { className: "mt-1 pt-1 border-t border-border", children: [
|
|
142
|
+
/* @__PURE__ */ e("div", { className: "text-muted-foreground mb-1", children: "IDs:" }),
|
|
143
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: Array.from(l.selectedIds).map((s) => /* @__PURE__ */ e(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
className: "px-1.5 py-0.5 bg-primary/20 text-primary rounded text-[10px] font-mono",
|
|
147
|
+
children: s
|
|
148
|
+
},
|
|
149
|
+
s
|
|
150
|
+
)) })
|
|
151
|
+
] })
|
|
152
|
+
] })
|
|
153
|
+
] }),
|
|
154
|
+
c && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
155
|
+
/* @__PURE__ */ e("h4", { className: "font-semibold text-foreground mb-2", children: "Undo/Redo" }),
|
|
156
|
+
/* @__PURE__ */ t("div", { className: "bg-muted/50 rounded px-2 py-1 space-y-1", children: [
|
|
157
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
158
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Can Undo:" }),
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: c.past.length > 0 ? "Yes" : "No" })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
162
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "Can Redo:" }),
|
|
163
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: c.future.length > 0 ? "Yes" : "No" })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between", children: [
|
|
166
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: "History Size:" }),
|
|
167
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: c.past.length })
|
|
168
|
+
] })
|
|
169
|
+
] })
|
|
170
|
+
] }),
|
|
171
|
+
b && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
172
|
+
/* @__PURE__ */ e("h4", { className: "font-semibold text-foreground mb-2", children: "Active Item" }),
|
|
173
|
+
/* @__PURE__ */ e("pre", { className: "bg-muted/50 rounded px-2 py-1 overflow-auto max-h-32 text-[10px] font-mono", children: JSON.stringify(b, null, 2) })
|
|
174
|
+
] })
|
|
175
|
+
] })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
g && r && d.length > 1 && /* @__PURE__ */ t(
|
|
180
|
+
"svg",
|
|
181
|
+
{
|
|
182
|
+
className: "fixed inset-0 pointer-events-none z-[9998]",
|
|
183
|
+
style: { width: "100vw", height: "100vh" },
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ t("defs", { children: [
|
|
186
|
+
/* @__PURE__ */ t("linearGradient", { id: "dragPathGrad", x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
187
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#6366f1", stopOpacity: "0.6" }),
|
|
188
|
+
/* @__PURE__ */ e("stop", { offset: "50%", stopColor: "#8b5cf6", stopOpacity: "0.9" }),
|
|
189
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#6366f1", stopOpacity: "1" })
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ t("radialGradient", { id: "dotGrad", cx: "30%", cy: "30%", r: "70%", children: [
|
|
192
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "1" }),
|
|
193
|
+
/* @__PURE__ */ e("stop", { offset: "30%", stopColor: "#6366f1", stopOpacity: "1" }),
|
|
194
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#8b5cf6", stopOpacity: "0.6" })
|
|
195
|
+
] })
|
|
196
|
+
] }),
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
"polyline",
|
|
199
|
+
{
|
|
200
|
+
points: d.map((s) => `${s.x},${s.y}`).join(" "),
|
|
201
|
+
fill: "none",
|
|
202
|
+
stroke: "url(#dragPathGrad)",
|
|
203
|
+
strokeWidth: 2,
|
|
204
|
+
strokeOpacity: 0.95,
|
|
205
|
+
strokeLinecap: "round",
|
|
206
|
+
strokeLinejoin: "round"
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
d.map((s, m) => {
|
|
210
|
+
const o = 0.18 + m / d.length * 0.82;
|
|
211
|
+
return /* @__PURE__ */ e(
|
|
212
|
+
"circle",
|
|
213
|
+
{
|
|
214
|
+
cx: s.x,
|
|
215
|
+
cy: s.y,
|
|
216
|
+
r: 2.25,
|
|
217
|
+
fill: "url(#dotGrad)",
|
|
218
|
+
fillOpacity: o
|
|
219
|
+
},
|
|
220
|
+
m
|
|
221
|
+
);
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
g && r && a && /* @__PURE__ */ t(v, { children: [
|
|
227
|
+
/* @__PURE__ */ e("style", { children: "@keyframes sahaPulse { 0% { transform: scale(1); opacity: 0.95 } 50% { transform: scale(1.12); opacity: 0.75 } 100% { transform: scale(1); opacity: 0.95 } }" }),
|
|
228
|
+
/* @__PURE__ */ t(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
"aria-hidden": !0,
|
|
232
|
+
style: {
|
|
233
|
+
position: "fixed",
|
|
234
|
+
left: a.x,
|
|
235
|
+
top: a.y,
|
|
236
|
+
transform: "translate(-50%, -50%)",
|
|
237
|
+
pointerEvents: "none",
|
|
238
|
+
zIndex: 1e4,
|
|
239
|
+
width: 40,
|
|
240
|
+
height: 40,
|
|
241
|
+
display: "flex",
|
|
242
|
+
alignItems: "center",
|
|
243
|
+
justifyContent: "center"
|
|
244
|
+
},
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ e(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
style: {
|
|
250
|
+
width: 40,
|
|
251
|
+
height: 40,
|
|
252
|
+
borderRadius: 9999,
|
|
253
|
+
background: "radial-gradient(circle at 35% 30%, rgba(139,92,246,0.20), rgba(99,102,241,0.06))",
|
|
254
|
+
border: "1px solid rgba(99,102,241,0.18)",
|
|
255
|
+
boxShadow: "0 8px 22px rgba(15,23,42,0.14)",
|
|
256
|
+
animation: "sahaPulse 1.6s ease-in-out infinite",
|
|
257
|
+
transformOrigin: "center"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ e(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
style: {
|
|
265
|
+
position: "absolute",
|
|
266
|
+
left: "50%",
|
|
267
|
+
top: "50%",
|
|
268
|
+
transform: "translate(-50%, -50%)",
|
|
269
|
+
width: 10,
|
|
270
|
+
height: 10,
|
|
271
|
+
borderRadius: 9999,
|
|
272
|
+
background: "linear-gradient(135deg,#8b5cf6,#6366f1)",
|
|
273
|
+
boxShadow: "0 6px 18px rgba(139,92,246,0.24)"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
] })
|
|
281
|
+
] }) : null;
|
|
282
|
+
};
|
|
283
|
+
T.displayName = "DebugOverlay";
|
|
284
|
+
export {
|
|
285
|
+
T as DebugOverlay
|
|
286
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const draggableItemVariants: (props?: ({
|
|
2
|
+
isDragging?: boolean | null | undefined;
|
|
3
|
+
isOver?: boolean | null | undefined;
|
|
4
|
+
disabled?: boolean | null | undefined;
|
|
5
|
+
axis?: "x" | "y" | "both" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export declare const droppableContainerVariants: (props?: ({
|
|
8
|
+
direction?: "grid" | "horizontal" | "vertical" | null | undefined;
|
|
9
|
+
isOver?: boolean | null | undefined;
|
|
10
|
+
isEmpty?: boolean | null | undefined;
|
|
11
|
+
disabled?: boolean | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
+
export declare const dragHandleVariants: (props?: ({
|
|
14
|
+
variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
15
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
+
disabled?: boolean | null | undefined;
|
|
17
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
18
|
+
export declare const dragOverlayVariants: (props?: ({
|
|
19
|
+
animation?: "smooth" | "spring" | "instant" | null | undefined;
|
|
20
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
21
|
+
export declare const dropIndicatorVariants: (props?: ({
|
|
22
|
+
position?: "top" | "bottom" | "after" | "before" | null | undefined;
|
|
23
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
24
|
+
visible?: boolean | null | undefined;
|
|
25
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
26
|
+
export declare const placeholderVariants: (props?: ({
|
|
27
|
+
size?: "sm" | "md" | "lg" | "auto" | null | undefined;
|
|
28
|
+
visible?: boolean | null | undefined;
|
|
29
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
30
|
+
export declare const animations: {
|
|
31
|
+
dragStart: string;
|
|
32
|
+
dragEnd: string;
|
|
33
|
+
dropSuccess: string;
|
|
34
|
+
dropCancel: string;
|
|
35
|
+
reorder: string;
|
|
36
|
+
pulse: string;
|
|
37
|
+
bounce: string;
|
|
38
|
+
};
|
|
39
|
+
export declare const cursors: {
|
|
40
|
+
grab: string;
|
|
41
|
+
grabbing: string;
|
|
42
|
+
notAllowed: string;
|
|
43
|
+
move: string;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=DragDrop.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragDrop.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DragDrop.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;;;;8EA8BjC,CAAC;AAMF,eAAO,MAAM,0BAA0B;;;;;8EA6BtC,CAAC;AAMF,eAAO,MAAM,kBAAkB;;;;8EA0B9B,CAAC;AAMF,eAAO,MAAM,mBAAmB;;8EAc/B,CAAC;AAMF,eAAO,MAAM,qBAAqB;;;;8EAyBjC,CAAC;AAMF,eAAO,MAAM,mBAAmB;;;8EAoB/B,CAAC;AAMF,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAC;AAMF,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { cva as r } from "class-variance-authority";
|
|
2
|
+
const e = r(
|
|
3
|
+
"relative touch-none transition-all duration-150 ease-out",
|
|
4
|
+
{
|
|
5
|
+
variants: {
|
|
6
|
+
isDragging: {
|
|
7
|
+
true: "cursor-grabbing z-50 opacity-50",
|
|
8
|
+
false: "cursor-grab hover:shadow-lg hover:scale-[1.01] focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"
|
|
9
|
+
},
|
|
10
|
+
isOver: {
|
|
11
|
+
true: "ring-2 ring-primary ring-offset-2",
|
|
12
|
+
false: ""
|
|
13
|
+
},
|
|
14
|
+
disabled: {
|
|
15
|
+
true: "opacity-40 cursor-not-allowed hover:shadow-none hover:scale-100",
|
|
16
|
+
false: ""
|
|
17
|
+
},
|
|
18
|
+
axis: {
|
|
19
|
+
x: "",
|
|
20
|
+
y: "",
|
|
21
|
+
both: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
isDragging: !1,
|
|
26
|
+
isOver: !1,
|
|
27
|
+
disabled: !1,
|
|
28
|
+
axis: "y"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
), o = r(
|
|
32
|
+
"relative transition-all duration-150 ease-out",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
direction: {
|
|
36
|
+
vertical: "flex flex-col gap-2",
|
|
37
|
+
horizontal: "flex flex-row gap-2 overflow-x-auto",
|
|
38
|
+
grid: "grid gap-2"
|
|
39
|
+
},
|
|
40
|
+
isOver: {
|
|
41
|
+
true: "bg-primary/5 border-2 border-primary border-dashed rounded-lg shadow-inner scale-[1.01]",
|
|
42
|
+
false: "border-2 border-transparent"
|
|
43
|
+
},
|
|
44
|
+
isEmpty: {
|
|
45
|
+
true: "min-h-[200px] border-2 border-dashed border-border rounded-lg flex items-center justify-center hover:border-primary/30 hover:bg-primary/5",
|
|
46
|
+
false: ""
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
true: "opacity-50 cursor-not-allowed hover:border-border",
|
|
50
|
+
false: ""
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
direction: "vertical",
|
|
55
|
+
isOver: !1,
|
|
56
|
+
isEmpty: !1,
|
|
57
|
+
disabled: !1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
), t = r(
|
|
61
|
+
"inline-flex items-center justify-center cursor-grab active:cursor-grabbing transition-colors",
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
variant: {
|
|
65
|
+
default: "text-muted-foreground hover:text-foreground hover:bg-accent rounded p-1",
|
|
66
|
+
ghost: "text-muted-foreground hover:text-foreground",
|
|
67
|
+
outline: "border-2 border-border hover:border-primary rounded p-1"
|
|
68
|
+
},
|
|
69
|
+
size: {
|
|
70
|
+
sm: "w-4 h-4",
|
|
71
|
+
md: "w-6 h-6",
|
|
72
|
+
lg: "w-8 h-8"
|
|
73
|
+
},
|
|
74
|
+
disabled: {
|
|
75
|
+
true: "opacity-40 cursor-not-allowed",
|
|
76
|
+
false: ""
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
variant: "default",
|
|
81
|
+
size: "md",
|
|
82
|
+
disabled: !1
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
), i = r(
|
|
86
|
+
"fixed pointer-events-none z-[9999] will-change-transform",
|
|
87
|
+
{
|
|
88
|
+
variants: {
|
|
89
|
+
animation: {
|
|
90
|
+
smooth: "transition-transform duration-150 ease-out",
|
|
91
|
+
instant: "",
|
|
92
|
+
spring: "transition-transform duration-300 ease-spring"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
animation: "smooth"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
), n = r(
|
|
100
|
+
"absolute left-0 right-0 h-0.5 bg-primary transition-all duration-150",
|
|
101
|
+
{
|
|
102
|
+
variants: {
|
|
103
|
+
position: {
|
|
104
|
+
top: "top-0 -translate-y-1",
|
|
105
|
+
bottom: "bottom-0 translate-y-1",
|
|
106
|
+
before: "-translate-y-1",
|
|
107
|
+
after: "translate-y-1"
|
|
108
|
+
},
|
|
109
|
+
orientation: {
|
|
110
|
+
horizontal: "h-0.5 w-full",
|
|
111
|
+
vertical: "w-0.5 h-full"
|
|
112
|
+
},
|
|
113
|
+
visible: {
|
|
114
|
+
true: "opacity-100 scale-100",
|
|
115
|
+
false: "opacity-0 scale-0"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
defaultVariants: {
|
|
119
|
+
position: "top",
|
|
120
|
+
orientation: "horizontal",
|
|
121
|
+
visible: !1
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
), s = r(
|
|
125
|
+
"bg-accent/50 border-2 border-dashed border-primary rounded transition-all duration-200",
|
|
126
|
+
{
|
|
127
|
+
variants: {
|
|
128
|
+
size: {
|
|
129
|
+
sm: "h-8",
|
|
130
|
+
md: "h-12",
|
|
131
|
+
lg: "h-16",
|
|
132
|
+
auto: "h-auto"
|
|
133
|
+
},
|
|
134
|
+
visible: {
|
|
135
|
+
true: "opacity-100 scale-100",
|
|
136
|
+
false: "opacity-0 scale-95"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
size: "auto",
|
|
141
|
+
visible: !1
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
), l = {
|
|
145
|
+
dragStart: "animate-in fade-in zoom-in duration-150",
|
|
146
|
+
dragEnd: "animate-out fade-out zoom-out duration-150",
|
|
147
|
+
dropSuccess: "animate-in slide-in-from-top-2 duration-200",
|
|
148
|
+
dropCancel: "animate-out slide-out-to-top-2 duration-200",
|
|
149
|
+
reorder: "transition-all duration-200 ease-out",
|
|
150
|
+
pulse: "animate-pulse",
|
|
151
|
+
bounce: "animate-bounce"
|
|
152
|
+
}, d = {
|
|
153
|
+
grab: "cursor-grab",
|
|
154
|
+
grabbing: "cursor-grabbing",
|
|
155
|
+
notAllowed: "cursor-not-allowed",
|
|
156
|
+
move: "cursor-move",
|
|
157
|
+
default: "cursor-default"
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
l as animations,
|
|
161
|
+
d as cursors,
|
|
162
|
+
t as dragHandleVariants,
|
|
163
|
+
i as dragOverlayVariants,
|
|
164
|
+
e as draggableItemVariants,
|
|
165
|
+
n as dropIndicatorVariants,
|
|
166
|
+
o as droppableContainerVariants,
|
|
167
|
+
s as placeholderVariants
|
|
168
|
+
};
|