@geekmidas/ui 9.0.2 → 10.0.0-alpha.0

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 (106) hide show
  1. package/dist/button-BB4n8b0z.mjs +46 -0
  2. package/dist/button-BB4n8b0z.mjs.map +1 -0
  3. package/dist/button-BSp9VyHi.cjs +58 -0
  4. package/dist/button-BSp9VyHi.cjs.map +1 -0
  5. package/dist/chunk-CUT6urMc.cjs +30 -0
  6. package/dist/components/data-display/index.cjs +27 -0
  7. package/dist/components/data-display/index.d.cts +2 -0
  8. package/dist/components/data-display/index.d.mts +2 -0
  9. package/dist/components/data-display/index.mjs +6 -0
  10. package/dist/components/feedback/index.cjs +26 -0
  11. package/dist/components/feedback/index.d.cts +2 -0
  12. package/dist/components/feedback/index.d.mts +2 -0
  13. package/dist/components/feedback/index.mjs +6 -0
  14. package/dist/components/layout/index.cjs +26 -0
  15. package/dist/components/layout/index.d.cts +2 -0
  16. package/dist/components/layout/index.d.mts +2 -0
  17. package/dist/components/layout/index.mjs +6 -0
  18. package/dist/components/ui/index.cjs +73 -0
  19. package/dist/components/ui/index.d.cts +2 -0
  20. package/dist/components/ui/index.d.mts +2 -0
  21. package/dist/components/ui/index.mjs +7 -0
  22. package/dist/data-display-BSUj4rIc.cjs +1318 -0
  23. package/dist/data-display-BSUj4rIc.cjs.map +1 -0
  24. package/dist/data-display-IcuThGEY.mjs +1186 -0
  25. package/dist/data-display-IcuThGEY.mjs.map +1 -0
  26. package/dist/feedback-B9rTsQdJ.cjs +505 -0
  27. package/dist/feedback-B9rTsQdJ.cjs.map +1 -0
  28. package/dist/feedback-DBLrs44v.mjs +379 -0
  29. package/dist/feedback-DBLrs44v.mjs.map +1 -0
  30. package/dist/hooks/index.cjs +1 -1
  31. package/dist/hooks/index.d.cts +1 -1
  32. package/dist/hooks/index.d.mts +1 -1
  33. package/dist/hooks/index.mjs +1 -1
  34. package/dist/{hooks-DuxmSO-h.cjs → hooks-C5O7RXTd.cjs} +3 -31
  35. package/dist/{hooks-DuxmSO-h.cjs.map → hooks-C5O7RXTd.cjs.map} +1 -1
  36. package/dist/{hooks-DBc-Cw9X.mjs → hooks-Dhkovxbo.mjs} +1 -1
  37. package/dist/{hooks-DBc-Cw9X.mjs.map → hooks-Dhkovxbo.mjs.map} +1 -1
  38. package/dist/index-B-vz6Li7.d.cts +102 -0
  39. package/dist/index-B-vz6Li7.d.cts.map +1 -0
  40. package/dist/index-CBBJ6vmK.d.cts +154 -0
  41. package/dist/index-CBBJ6vmK.d.cts.map +1 -0
  42. package/dist/index-CQFi0S-z.d.mts +154 -0
  43. package/dist/index-CQFi0S-z.d.mts.map +1 -0
  44. package/dist/index-D9EfJUyV.d.mts +102 -0
  45. package/dist/index-D9EfJUyV.d.mts.map +1 -0
  46. package/dist/{index-DmtSyJ1q.d.mts → index-DTIa7Ryw.d.cts} +1 -1
  47. package/dist/{index-DmtSyJ1q.d.mts.map → index-DTIa7Ryw.d.cts.map} +1 -1
  48. package/dist/{index-QNnnyGjB.d.cts → index-DvzSne29.d.mts} +1 -1
  49. package/dist/{index-QNnnyGjB.d.cts.map → index-DvzSne29.d.mts.map} +1 -1
  50. package/dist/index-H_bu5hU-.d.cts +329 -0
  51. package/dist/index-H_bu5hU-.d.cts.map +1 -0
  52. package/dist/index-MRiOaWmK.d.mts +329 -0
  53. package/dist/index-MRiOaWmK.d.mts.map +1 -0
  54. package/dist/index-X9DzrZ1v.d.cts +153 -0
  55. package/dist/index-X9DzrZ1v.d.cts.map +1 -0
  56. package/dist/index-jAsoga-e.d.mts +153 -0
  57. package/dist/index-jAsoga-e.d.mts.map +1 -0
  58. package/dist/index.cjs +144 -2560
  59. package/dist/index.d.cts +8 -727
  60. package/dist/index.d.mts +8 -727
  61. package/dist/index.mjs +12 -2428
  62. package/dist/layout-CIIQOb1x.mjs +387 -0
  63. package/dist/layout-CIIQOb1x.mjs.map +1 -0
  64. package/dist/layout-CcO0svmw.cjs +513 -0
  65. package/dist/layout-CcO0svmw.cjs.map +1 -0
  66. package/dist/lib/utils.cjs +3 -0
  67. package/dist/lib/utils.d.cts +2 -0
  68. package/dist/lib/utils.d.mts +2 -0
  69. package/dist/lib/utils.mjs +3 -0
  70. package/dist/styles/theme.cjs +1 -1
  71. package/dist/styles/theme.d.cts +1 -1
  72. package/dist/styles/theme.d.mts +1 -1
  73. package/dist/styles/theme.mjs +1 -1
  74. package/dist/table-CrFSBSDe.mjs +129 -0
  75. package/dist/table-CrFSBSDe.mjs.map +1 -0
  76. package/dist/table-DNX6iqH5.cjs +237 -0
  77. package/dist/table-DNX6iqH5.cjs.map +1 -0
  78. package/dist/{theme-BRGSS8qx.cjs → theme-BBoDSysS.cjs} +1 -1
  79. package/dist/{theme-BRGSS8qx.cjs.map → theme-BBoDSysS.cjs.map} +1 -1
  80. package/dist/{theme-vpDwDfcR.d.mts → theme-BsXPj5m4.d.cts} +1 -1
  81. package/dist/{theme-B5mGkTlU.d.cts.map → theme-BsXPj5m4.d.cts.map} +1 -1
  82. package/dist/{theme-DAiFBbyM.mjs → theme-DI0sgbjj.mjs} +1 -1
  83. package/dist/{theme-DAiFBbyM.mjs.map → theme-DI0sgbjj.mjs.map} +1 -1
  84. package/dist/{theme-B5mGkTlU.d.cts → theme-aIIK_kn9.d.mts} +1 -1
  85. package/dist/{theme-vpDwDfcR.d.mts.map → theme-aIIK_kn9.d.mts.map} +1 -1
  86. package/dist/tooltip-BuTZvLTX.cjs +82 -0
  87. package/dist/tooltip-BuTZvLTX.cjs.map +1 -0
  88. package/dist/tooltip-z8o59BXq.mjs +46 -0
  89. package/dist/tooltip-z8o59BXq.mjs.map +1 -0
  90. package/dist/ui-B6Pj_ZAW.mjs +296 -0
  91. package/dist/ui-B6Pj_ZAW.mjs.map +1 -0
  92. package/dist/ui-PFNfvwdv.cjs +542 -0
  93. package/dist/ui-PFNfvwdv.cjs.map +1 -0
  94. package/dist/utils-0J5jzmnT.mjs +11 -0
  95. package/dist/utils-0J5jzmnT.mjs.map +1 -0
  96. package/dist/utils-3XfDEz8-.d.cts +9 -0
  97. package/dist/utils-3XfDEz8-.d.cts.map +1 -0
  98. package/dist/utils-CgSGIxhd.d.mts +9 -0
  99. package/dist/utils-CgSGIxhd.d.mts.map +1 -0
  100. package/dist/utils-DTuzb7hO.cjs +17 -0
  101. package/dist/utils-DTuzb7hO.cjs.map +1 -0
  102. package/package.json +1 -1
  103. package/dist/index.cjs.map +0 -1
  104. package/dist/index.d.cts.map +0 -1
  105. package/dist/index.d.mts.map +0 -1
  106. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,387 @@
1
+ import { cn } from "./utils-0J5jzmnT.mjs";
2
+ import { Button } from "./button-BB4n8b0z.mjs";
3
+ import { ScrollArea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip-z8o59BXq.mjs";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ChevronRight, PanelLeftClose, PanelLeftOpen } from "lucide-react";
6
+ import * as React from "react";
7
+ import { cva } from "class-variance-authority";
8
+
9
+ //#region src/components/layout/header.tsx
10
+ const Header = React.forwardRef(({ className, sticky = false, children,...props }, ref) => {
11
+ return /* @__PURE__ */ jsx("header", {
12
+ ref,
13
+ className: cn("flex h-14 items-center gap-4 border-b border-border bg-surface px-4", sticky && "sticky top-0 z-10", className),
14
+ ...props,
15
+ children
16
+ });
17
+ });
18
+ Header.displayName = "Header";
19
+ const HeaderTitle = React.forwardRef(({ className, children,...props }, ref) => {
20
+ return /* @__PURE__ */ jsx("h1", {
21
+ ref,
22
+ className: cn("text-lg font-semibold text-foreground", className),
23
+ ...props,
24
+ children
25
+ });
26
+ });
27
+ HeaderTitle.displayName = "HeaderTitle";
28
+ const HeaderDescription = React.forwardRef(({ className, children,...props }, ref) => {
29
+ return /* @__PURE__ */ jsx("p", {
30
+ ref,
31
+ className: cn("text-sm text-muted-foreground", className),
32
+ ...props,
33
+ children
34
+ });
35
+ });
36
+ HeaderDescription.displayName = "HeaderDescription";
37
+ const HeaderActions = React.forwardRef(({ className, children,...props }, ref) => {
38
+ return /* @__PURE__ */ jsx("div", {
39
+ ref,
40
+ className: cn("ml-auto flex items-center gap-2", className),
41
+ ...props,
42
+ children
43
+ });
44
+ });
45
+ HeaderActions.displayName = "HeaderActions";
46
+ const HeaderBreadcrumbs = React.forwardRef(({ className, items, separator,...props }, ref) => {
47
+ return /* @__PURE__ */ jsx("nav", {
48
+ ref,
49
+ "aria-label": "Breadcrumb",
50
+ className: cn("flex items-center gap-1 text-sm", className),
51
+ ...props,
52
+ children: /* @__PURE__ */ jsx("ol", {
53
+ className: "flex items-center gap-1",
54
+ children: items.map((item, index) => /* @__PURE__ */ jsxs("li", {
55
+ className: "flex items-center gap-1",
56
+ children: [index > 0 && /* @__PURE__ */ jsx("span", {
57
+ className: "text-muted-foreground",
58
+ children: separator ?? /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" })
59
+ }), item.href && !item.current ? /* @__PURE__ */ jsx("a", {
60
+ href: item.href,
61
+ className: "text-muted-foreground hover:text-foreground transition-colors",
62
+ children: item.label
63
+ }) : /* @__PURE__ */ jsx("span", {
64
+ className: cn(item.current ? "text-foreground font-medium" : "text-muted-foreground"),
65
+ "aria-current": item.current ? "page" : void 0,
66
+ children: item.label
67
+ })]
68
+ }, item.label))
69
+ })
70
+ });
71
+ });
72
+ HeaderBreadcrumbs.displayName = "HeaderBreadcrumbs";
73
+ const HeaderGroup = React.forwardRef(({ className, align = "start", children,...props }, ref) => {
74
+ return /* @__PURE__ */ jsx("div", {
75
+ ref,
76
+ className: cn("flex items-center gap-3", align === "center" && "justify-center", align === "end" && "justify-end ml-auto", className),
77
+ ...props,
78
+ children
79
+ });
80
+ });
81
+ HeaderGroup.displayName = "HeaderGroup";
82
+
83
+ //#endregion
84
+ //#region src/components/layout/shell.tsx
85
+ const Shell = React.forwardRef(({ className, children,...props }, ref) => {
86
+ return /* @__PURE__ */ jsx("div", {
87
+ ref,
88
+ className: cn("flex h-screen w-full bg-background", className),
89
+ ...props,
90
+ children
91
+ });
92
+ });
93
+ Shell.displayName = "Shell";
94
+ const ShellSidebar = React.forwardRef(({ className, children,...props }, ref) => {
95
+ return /* @__PURE__ */ jsx("div", {
96
+ ref,
97
+ className: cn("shrink-0", className),
98
+ ...props,
99
+ children
100
+ });
101
+ });
102
+ ShellSidebar.displayName = "ShellSidebar";
103
+ const ShellMain = React.forwardRef(({ className, children,...props }, ref) => {
104
+ return /* @__PURE__ */ jsx("div", {
105
+ ref,
106
+ className: cn("flex flex-1 flex-col overflow-hidden", className),
107
+ ...props,
108
+ children
109
+ });
110
+ });
111
+ ShellMain.displayName = "ShellMain";
112
+ const ShellHeader = React.forwardRef(({ className, children,...props }, ref) => {
113
+ return /* @__PURE__ */ jsx("div", {
114
+ ref,
115
+ className: cn("shrink-0", className),
116
+ ...props,
117
+ children
118
+ });
119
+ });
120
+ ShellHeader.displayName = "ShellHeader";
121
+ const ShellContent = React.forwardRef(({ className, scrollable = true, children,...props }, ref) => {
122
+ return /* @__PURE__ */ jsx("div", {
123
+ ref,
124
+ className: cn("flex-1", scrollable && "overflow-auto", className),
125
+ ...props,
126
+ children
127
+ });
128
+ });
129
+ ShellContent.displayName = "ShellContent";
130
+ const ShellFooter = React.forwardRef(({ className, children,...props }, ref) => {
131
+ return /* @__PURE__ */ jsx("div", {
132
+ ref,
133
+ className: cn("shrink-0 border-t border-border bg-surface", className),
134
+ ...props,
135
+ children
136
+ });
137
+ });
138
+ ShellFooter.displayName = "ShellFooter";
139
+
140
+ //#endregion
141
+ //#region src/components/layout/sidebar.tsx
142
+ const sidebarVariants = cva("flex flex-col border-r border-border bg-surface transition-all duration-200", {
143
+ variants: { collapsed: {
144
+ true: "w-16",
145
+ false: "w-64"
146
+ } },
147
+ defaultVariants: { collapsed: false }
148
+ });
149
+ const SidebarContext = React.createContext({
150
+ collapsed: false,
151
+ setCollapsed: () => {}
152
+ });
153
+ function useSidebar() {
154
+ const context = React.useContext(SidebarContext);
155
+ if (!context) throw new Error("useSidebar must be used within a Sidebar");
156
+ return context;
157
+ }
158
+ const Sidebar = React.forwardRef(({ className, collapsed: controlledCollapsed, onCollapsedChange, header, footer, children,...props }, ref) => {
159
+ const [internalCollapsed, setInternalCollapsed] = React.useState(false);
160
+ const collapsed = controlledCollapsed ?? internalCollapsed;
161
+ const setCollapsed = React.useCallback((value) => {
162
+ setInternalCollapsed(value);
163
+ onCollapsedChange?.(value);
164
+ }, [onCollapsedChange]);
165
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, {
166
+ value: {
167
+ collapsed,
168
+ setCollapsed
169
+ },
170
+ children: /* @__PURE__ */ jsx(TooltipProvider, {
171
+ delayDuration: 0,
172
+ children: /* @__PURE__ */ jsxs("div", {
173
+ ref,
174
+ className: cn(sidebarVariants({
175
+ collapsed,
176
+ className
177
+ })),
178
+ ...props,
179
+ children: [
180
+ header && /* @__PURE__ */ jsx("div", {
181
+ className: "flex h-14 items-center border-b border-border px-4",
182
+ children: header
183
+ }),
184
+ /* @__PURE__ */ jsx(ScrollArea, {
185
+ className: "flex-1",
186
+ children: /* @__PURE__ */ jsx("div", {
187
+ className: "flex flex-col gap-1 p-2",
188
+ children
189
+ })
190
+ }),
191
+ footer && /* @__PURE__ */ jsx("div", {
192
+ className: "border-t border-border p-2",
193
+ children: footer
194
+ })
195
+ ]
196
+ })
197
+ })
198
+ });
199
+ });
200
+ Sidebar.displayName = "Sidebar";
201
+ const SidebarToggle = React.forwardRef(({ className,...props }, ref) => {
202
+ const { collapsed, setCollapsed } = useSidebar();
203
+ return /* @__PURE__ */ jsxs(Button, {
204
+ ref,
205
+ variant: "ghost",
206
+ size: "icon",
207
+ className: cn("h-8 w-8", className),
208
+ onClick: () => setCollapsed(!collapsed),
209
+ ...props,
210
+ children: [collapsed ? /* @__PURE__ */ jsx(PanelLeftOpen, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(PanelLeftClose, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
211
+ className: "sr-only",
212
+ children: collapsed ? "Expand sidebar" : "Collapse sidebar"
213
+ })]
214
+ });
215
+ });
216
+ SidebarToggle.displayName = "SidebarToggle";
217
+ const SidebarSection = React.forwardRef(({ className, title, children,...props }, ref) => {
218
+ const { collapsed } = useSidebar();
219
+ return /* @__PURE__ */ jsxs("div", {
220
+ ref,
221
+ className: cn("flex flex-col gap-1", className),
222
+ ...props,
223
+ children: [
224
+ title && !collapsed && /* @__PURE__ */ jsx("div", {
225
+ className: "px-2 py-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",
226
+ children: title
227
+ }),
228
+ title && collapsed && /* @__PURE__ */ jsx("div", { className: "mx-auto my-1 h-px w-6 bg-border" }),
229
+ children
230
+ ]
231
+ });
232
+ });
233
+ SidebarSection.displayName = "SidebarSection";
234
+ const SidebarItem = React.forwardRef(({ className, icon: Icon, active, badge, children,...props }, ref) => {
235
+ const { collapsed } = useSidebar();
236
+ const button = /* @__PURE__ */ jsxs("button", {
237
+ ref,
238
+ className: cn("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors", "text-muted-foreground hover:bg-surface-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", active && "bg-surface-hover text-foreground", collapsed && "justify-center px-0", className),
239
+ ...props,
240
+ children: [
241
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 shrink-0" }),
242
+ !collapsed && /* @__PURE__ */ jsx("span", {
243
+ className: "flex-1 truncate",
244
+ children
245
+ }),
246
+ !collapsed && badge && /* @__PURE__ */ jsx("span", { children: badge })
247
+ ]
248
+ });
249
+ if (collapsed) return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
250
+ asChild: true,
251
+ children: button
252
+ }), /* @__PURE__ */ jsxs(TooltipContent, {
253
+ side: "right",
254
+ className: "flex items-center gap-2",
255
+ children: [children, badge]
256
+ })] });
257
+ return button;
258
+ });
259
+ SidebarItem.displayName = "SidebarItem";
260
+ const SidebarLink = React.forwardRef(({ className, icon: Icon, active, badge, children,...props }, ref) => {
261
+ const { collapsed } = useSidebar();
262
+ const link = /* @__PURE__ */ jsxs("a", {
263
+ ref,
264
+ className: cn("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors", "text-muted-foreground hover:bg-surface-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", active && "bg-surface-hover text-foreground", collapsed && "justify-center px-0", className),
265
+ ...props,
266
+ children: [
267
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 shrink-0" }),
268
+ !collapsed && /* @__PURE__ */ jsx("span", {
269
+ className: "flex-1 truncate",
270
+ children
271
+ }),
272
+ !collapsed && badge && /* @__PURE__ */ jsx("span", { children: badge })
273
+ ]
274
+ });
275
+ if (collapsed) return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
276
+ asChild: true,
277
+ children: link
278
+ }), /* @__PURE__ */ jsxs(TooltipContent, {
279
+ side: "right",
280
+ className: "flex items-center gap-2",
281
+ children: [children, badge]
282
+ })] });
283
+ return link;
284
+ });
285
+ SidebarLink.displayName = "SidebarLink";
286
+
287
+ //#endregion
288
+ //#region src/components/layout/split-pane.tsx
289
+ const SplitPane = React.forwardRef(({ className, direction = "horizontal", defaultSize = "50%", minSize = 100, maxSize, onSizeChange, resizable = true, children,...props }, ref) => {
290
+ const containerRef = React.useRef(null);
291
+ const [size, setSize] = React.useState(null);
292
+ const [isDragging, setIsDragging] = React.useState(false);
293
+ const childArray = React.Children.toArray(children);
294
+ const firstPane = childArray[0];
295
+ const secondPane = childArray[1];
296
+ const isHorizontal = direction === "horizontal";
297
+ React.useEffect(() => {
298
+ if (size !== null || !containerRef.current) return;
299
+ const containerSize = isHorizontal ? containerRef.current.offsetWidth : containerRef.current.offsetHeight;
300
+ if (typeof defaultSize === "string" && defaultSize.endsWith("%")) {
301
+ const percent = parseFloat(defaultSize) / 100;
302
+ setSize(Math.round(containerSize * percent));
303
+ } else if (typeof defaultSize === "number") setSize(defaultSize);
304
+ else setSize(Math.round(containerSize / 2));
305
+ }, [
306
+ defaultSize,
307
+ isHorizontal,
308
+ size
309
+ ]);
310
+ const handleMouseDown = React.useCallback((e) => {
311
+ if (!resizable) return;
312
+ e.preventDefault();
313
+ setIsDragging(true);
314
+ }, [resizable]);
315
+ React.useEffect(() => {
316
+ if (!isDragging) return;
317
+ const handleMouseMove = (e) => {
318
+ if (!containerRef.current) return;
319
+ const containerRect = containerRef.current.getBoundingClientRect();
320
+ const containerSize = isHorizontal ? containerRect.width : containerRect.height;
321
+ let newSize = isHorizontal ? e.clientX - containerRect.left : e.clientY - containerRect.top;
322
+ newSize = Math.max(minSize, newSize);
323
+ if (maxSize) newSize = Math.min(maxSize, newSize);
324
+ newSize = Math.min(containerSize - minSize, newSize);
325
+ setSize(newSize);
326
+ onSizeChange?.(newSize);
327
+ };
328
+ const handleMouseUp = () => {
329
+ setIsDragging(false);
330
+ };
331
+ document.addEventListener("mousemove", handleMouseMove);
332
+ document.addEventListener("mouseup", handleMouseUp);
333
+ return () => {
334
+ document.removeEventListener("mousemove", handleMouseMove);
335
+ document.removeEventListener("mouseup", handleMouseUp);
336
+ };
337
+ }, [
338
+ isDragging,
339
+ isHorizontal,
340
+ minSize,
341
+ maxSize,
342
+ onSizeChange
343
+ ]);
344
+ const firstPaneStyle = {
345
+ [isHorizontal ? "width" : "height"]: size !== null ? `${size}px` : defaultSize,
346
+ flexShrink: 0
347
+ };
348
+ return /* @__PURE__ */ jsxs("div", {
349
+ ref: (node) => {
350
+ containerRef.current = node;
351
+ if (typeof ref === "function") ref(node);
352
+ else if (ref) ref.current = node;
353
+ },
354
+ className: cn("flex overflow-hidden", isHorizontal ? "flex-row" : "flex-col", isDragging && "cursor-col-resize select-none", className),
355
+ ...props,
356
+ children: [
357
+ /* @__PURE__ */ jsx("div", {
358
+ className: cn("overflow-auto", isHorizontal ? "min-w-0" : "min-h-0"),
359
+ style: firstPaneStyle,
360
+ children: firstPane
361
+ }),
362
+ resizable && /* @__PURE__ */ jsx("div", {
363
+ className: cn("flex shrink-0 items-center justify-center bg-border transition-colors", isHorizontal ? "w-1 cursor-col-resize hover:bg-border-hover active:bg-accent" : "h-1 cursor-row-resize hover:bg-border-hover active:bg-accent", isDragging && "bg-accent"),
364
+ onMouseDown: handleMouseDown,
365
+ children: /* @__PURE__ */ jsx("div", { className: cn("rounded-full bg-muted-foreground/50", isHorizontal ? "h-8 w-1" : "h-1 w-8") })
366
+ }),
367
+ /* @__PURE__ */ jsx("div", {
368
+ className: cn("flex-1 overflow-auto", isHorizontal ? "min-w-0" : "min-h-0"),
369
+ children: secondPane
370
+ })
371
+ ]
372
+ });
373
+ });
374
+ SplitPane.displayName = "SplitPane";
375
+ const SplitPanePanel = React.forwardRef(({ className, children,...props }, ref) => {
376
+ return /* @__PURE__ */ jsx("div", {
377
+ ref,
378
+ className: cn("h-full w-full", className),
379
+ ...props,
380
+ children
381
+ });
382
+ });
383
+ SplitPanePanel.displayName = "SplitPanePanel";
384
+
385
+ //#endregion
386
+ export { Header, HeaderActions, HeaderBreadcrumbs, HeaderDescription, HeaderGroup, HeaderTitle, Shell, ShellContent, ShellFooter, ShellHeader, ShellMain, ShellSidebar, Sidebar, SidebarItem, SidebarLink, SidebarSection, SidebarToggle, SplitPane, SplitPanePanel, sidebarVariants, useSidebar };
387
+ //# sourceMappingURL=layout-CIIQOb1x.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-CIIQOb1x.mjs","names":["value: boolean","e: React.MouseEvent","e: MouseEvent","firstPaneStyle: React.CSSProperties"],"sources":["../src/components/layout/header.tsx","../src/components/layout/shell.tsx","../src/components/layout/sidebar.tsx","../src/components/layout/split-pane.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronRight } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nexport interface HeaderProps extends React.HTMLAttributes<HTMLElement> {\n\tsticky?: boolean;\n}\n\nconst Header = React.forwardRef<HTMLElement, HeaderProps>(\n\t({ className, sticky = false, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<header\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex h-14 items-center gap-4 border-b border-border bg-surface px-4',\n\t\t\t\t\tsticky && 'sticky top-0 z-10',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</header>\n\t\t);\n\t},\n);\nHeader.displayName = 'Header';\n\nexport interface HeaderTitleProps\n\textends React.HTMLAttributes<HTMLHeadingElement> {}\n\nconst HeaderTitle = React.forwardRef<HTMLHeadingElement, HeaderTitleProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<h1\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('text-lg font-semibold text-foreground', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</h1>\n\t\t);\n\t},\n);\nHeaderTitle.displayName = 'HeaderTitle';\n\nexport interface HeaderDescriptionProps\n\textends React.HTMLAttributes<HTMLParagraphElement> {}\n\nconst HeaderDescription = React.forwardRef<\n\tHTMLParagraphElement,\n\tHeaderDescriptionProps\n>(({ className, children, ...props }, ref) => {\n\treturn (\n\t\t<p\n\t\t\tref={ref}\n\t\t\tclassName={cn('text-sm text-muted-foreground', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</p>\n\t);\n});\nHeaderDescription.displayName = 'HeaderDescription';\n\nexport interface HeaderActionsProps\n\textends React.HTMLAttributes<HTMLDivElement> {}\n\nconst HeaderActions = React.forwardRef<HTMLDivElement, HeaderActionsProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('ml-auto flex items-center gap-2', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nHeaderActions.displayName = 'HeaderActions';\n\nexport interface BreadcrumbItem {\n\tlabel: string;\n\thref?: string;\n\tcurrent?: boolean;\n}\n\nexport interface HeaderBreadcrumbsProps\n\textends React.HTMLAttributes<HTMLElement> {\n\titems: BreadcrumbItem[];\n\tseparator?: React.ReactNode;\n}\n\nconst HeaderBreadcrumbs = React.forwardRef<HTMLElement, HeaderBreadcrumbsProps>(\n\t({ className, items, separator, ...props }, ref) => {\n\t\treturn (\n\t\t\t<nav\n\t\t\t\tref={ref}\n\t\t\t\taria-label=\"Breadcrumb\"\n\t\t\t\tclassName={cn('flex items-center gap-1 text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<ol className=\"flex items-center gap-1\">\n\t\t\t\t\t{items.map((item, index) => (\n\t\t\t\t\t\t<li key={item.label} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t{index > 0 && (\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{separator ?? <ChevronRight className=\"h-3.5 w-3.5\" />}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{item.href && !item.current ? (\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref={item.href}\n\t\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground hover:text-foreground transition-colors\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\titem.current\n\t\t\t\t\t\t\t\t\t\t\t? 'text-foreground font-medium'\n\t\t\t\t\t\t\t\t\t\t\t: 'text-muted-foreground',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\taria-current={item.current ? 'page' : undefined}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t);\n\t},\n);\nHeaderBreadcrumbs.displayName = 'HeaderBreadcrumbs';\n\nexport interface HeaderGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n\talign?: 'start' | 'center' | 'end';\n}\n\nconst HeaderGroup = React.forwardRef<HTMLDivElement, HeaderGroupProps>(\n\t({ className, align = 'start', children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex items-center gap-3',\n\t\t\t\t\talign === 'center' && 'justify-center',\n\t\t\t\t\talign === 'end' && 'justify-end ml-auto',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nHeaderGroup.displayName = 'HeaderGroup';\n\nexport {\n\tHeader,\n\tHeaderTitle,\n\tHeaderDescription,\n\tHeaderActions,\n\tHeaderBreadcrumbs,\n\tHeaderGroup,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nexport interface ShellProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst Shell = React.forwardRef<HTMLDivElement, ShellProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('flex h-screen w-full bg-background', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShell.displayName = 'Shell';\n\nexport interface ShellSidebarProps\n\textends React.HTMLAttributes<HTMLDivElement> {}\n\nconst ShellSidebar = React.forwardRef<HTMLDivElement, ShellSidebarProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div ref={ref} className={cn('shrink-0', className)} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShellSidebar.displayName = 'ShellSidebar';\n\nexport interface ShellMainProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst ShellMain = React.forwardRef<HTMLDivElement, ShellMainProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('flex flex-1 flex-col overflow-hidden', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShellMain.displayName = 'ShellMain';\n\nexport interface ShellHeaderProps\n\textends React.HTMLAttributes<HTMLDivElement> {}\n\nconst ShellHeader = React.forwardRef<HTMLDivElement, ShellHeaderProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div ref={ref} className={cn('shrink-0', className)} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShellHeader.displayName = 'ShellHeader';\n\nexport interface ShellContentProps\n\textends React.HTMLAttributes<HTMLDivElement> {\n\tscrollable?: boolean;\n}\n\nconst ShellContent = React.forwardRef<HTMLDivElement, ShellContentProps>(\n\t({ className, scrollable = true, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('flex-1', scrollable && 'overflow-auto', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShellContent.displayName = 'ShellContent';\n\nexport interface ShellFooterProps\n\textends React.HTMLAttributes<HTMLDivElement> {}\n\nconst ShellFooter = React.forwardRef<HTMLDivElement, ShellFooterProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('shrink-0 border-t border-border bg-surface', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nShellFooter.displayName = 'ShellFooter';\n\nexport {\n\tShell,\n\tShellSidebar,\n\tShellMain,\n\tShellHeader,\n\tShellContent,\n\tShellFooter,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { type LucideIcon, PanelLeftClose, PanelLeftOpen } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../ui/button';\nimport { ScrollArea } from '../ui/scroll-area';\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from '../ui/tooltip';\n\nconst sidebarVariants = cva(\n\t'flex flex-col border-r border-border bg-surface transition-all duration-200',\n\t{\n\t\tvariants: {\n\t\t\tcollapsed: {\n\t\t\t\ttrue: 'w-16',\n\t\t\t\tfalse: 'w-64',\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tcollapsed: false,\n\t\t},\n\t},\n);\n\nexport interface SidebarProps\n\textends React.HTMLAttributes<HTMLDivElement>,\n\t\tVariantProps<typeof sidebarVariants> {\n\tcollapsed?: boolean;\n\tonCollapsedChange?: (collapsed: boolean) => void;\n\theader?: React.ReactNode;\n\tfooter?: React.ReactNode;\n}\n\nconst SidebarContext = React.createContext<{\n\tcollapsed: boolean;\n\tsetCollapsed: (collapsed: boolean) => void;\n}>({\n\tcollapsed: false,\n\tsetCollapsed: () => {},\n});\n\nexport function useSidebar() {\n\tconst context = React.useContext(SidebarContext);\n\tif (!context) {\n\t\tthrow new Error('useSidebar must be used within a Sidebar');\n\t}\n\treturn context;\n}\n\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tcollapsed: controlledCollapsed,\n\t\t\tonCollapsedChange,\n\t\t\theader,\n\t\t\tfooter,\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst [internalCollapsed, setInternalCollapsed] = React.useState(false);\n\t\tconst collapsed = controlledCollapsed ?? internalCollapsed;\n\n\t\tconst setCollapsed = React.useCallback(\n\t\t\t(value: boolean) => {\n\t\t\t\tsetInternalCollapsed(value);\n\t\t\t\tonCollapsedChange?.(value);\n\t\t\t},\n\t\t\t[onCollapsedChange],\n\t\t);\n\n\t\treturn (\n\t\t\t<SidebarContext.Provider value={{ collapsed, setCollapsed }}>\n\t\t\t\t<TooltipProvider delayDuration={0}>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tclassName={cn(sidebarVariants({ collapsed, className }))}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t>\n\t\t\t\t\t\t{header && (\n\t\t\t\t\t\t\t<div className=\"flex h-14 items-center border-b border-border px-4\">\n\t\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<ScrollArea className=\"flex-1\">\n\t\t\t\t\t\t\t<div className=\"flex flex-col gap-1 p-2\">{children}</div>\n\t\t\t\t\t\t</ScrollArea>\n\t\t\t\t\t\t{footer && (\n\t\t\t\t\t\t\t<div className=\"border-t border-border p-2\">{footer}</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipProvider>\n\t\t\t</SidebarContext.Provider>\n\t\t);\n\t},\n);\nSidebar.displayName = 'Sidebar';\n\nexport interface SidebarToggleProps\n\textends React.ButtonHTMLAttributes<HTMLButtonElement> {}\n\nconst SidebarToggle = React.forwardRef<HTMLButtonElement, SidebarToggleProps>(\n\t({ className, ...props }, ref) => {\n\t\tconst { collapsed, setCollapsed } = useSidebar();\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tref={ref}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName={cn('h-8 w-8', className)}\n\t\t\t\tonClick={() => setCollapsed(!collapsed)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{collapsed ? (\n\t\t\t\t\t<PanelLeftOpen className=\"h-4 w-4\" />\n\t\t\t\t) : (\n\t\t\t\t\t<PanelLeftClose className=\"h-4 w-4\" />\n\t\t\t\t)}\n\t\t\t\t<span className=\"sr-only\">\n\t\t\t\t\t{collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n\t\t\t\t</span>\n\t\t\t</Button>\n\t\t);\n\t},\n);\nSidebarToggle.displayName = 'SidebarToggle';\n\nexport interface SidebarSectionProps\n\textends React.HTMLAttributes<HTMLDivElement> {\n\ttitle?: string;\n}\n\nconst SidebarSection = React.forwardRef<HTMLDivElement, SidebarSectionProps>(\n\t({ className, title, children, ...props }, ref) => {\n\t\tconst { collapsed } = useSidebar();\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn('flex flex-col gap-1', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{title && !collapsed && (\n\t\t\t\t\t<div className=\"px-2 py-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{title && collapsed && (\n\t\t\t\t\t<div className=\"mx-auto my-1 h-px w-6 bg-border\" />\n\t\t\t\t)}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nSidebarSection.displayName = 'SidebarSection';\n\nexport interface SidebarItemProps\n\textends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\ticon?: LucideIcon;\n\tactive?: boolean;\n\tbadge?: React.ReactNode;\n}\n\nconst SidebarItem = React.forwardRef<HTMLButtonElement, SidebarItemProps>(\n\t({ className, icon: Icon, active, badge, children, ...props }, ref) => {\n\t\tconst { collapsed } = useSidebar();\n\n\t\tconst button = (\n\t\t\t<button\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors',\n\t\t\t\t\t'text-muted-foreground hover:bg-surface-hover hover:text-foreground',\n\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n\t\t\t\t\tactive && 'bg-surface-hover text-foreground',\n\t\t\t\t\tcollapsed && 'justify-center px-0',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{Icon && <Icon className=\"h-4 w-4 shrink-0\" />}\n\t\t\t\t{!collapsed && <span className=\"flex-1 truncate\">{children}</span>}\n\t\t\t\t{!collapsed && badge && <span>{badge}</span>}\n\t\t\t</button>\n\t\t);\n\n\t\tif (collapsed) {\n\t\t\treturn (\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger asChild>{button}</TooltipTrigger>\n\t\t\t\t\t<TooltipContent side=\"right\" className=\"flex items-center gap-2\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\t{badge}\n\t\t\t\t\t</TooltipContent>\n\t\t\t\t</Tooltip>\n\t\t\t);\n\t\t}\n\n\t\treturn button;\n\t},\n);\nSidebarItem.displayName = 'SidebarItem';\n\nexport interface SidebarLinkProps\n\textends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n\ticon?: LucideIcon;\n\tactive?: boolean;\n\tbadge?: React.ReactNode;\n}\n\nconst SidebarLink = React.forwardRef<HTMLAnchorElement, SidebarLinkProps>(\n\t({ className, icon: Icon, active, badge, children, ...props }, ref) => {\n\t\tconst { collapsed } = useSidebar();\n\n\t\tconst link = (\n\t\t\t<a\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors',\n\t\t\t\t\t'text-muted-foreground hover:bg-surface-hover hover:text-foreground',\n\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n\t\t\t\t\tactive && 'bg-surface-hover text-foreground',\n\t\t\t\t\tcollapsed && 'justify-center px-0',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{Icon && <Icon className=\"h-4 w-4 shrink-0\" />}\n\t\t\t\t{!collapsed && <span className=\"flex-1 truncate\">{children}</span>}\n\t\t\t\t{!collapsed && badge && <span>{badge}</span>}\n\t\t\t</a>\n\t\t);\n\n\t\tif (collapsed) {\n\t\t\treturn (\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger asChild>{link}</TooltipTrigger>\n\t\t\t\t\t<TooltipContent side=\"right\" className=\"flex items-center gap-2\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\t{badge}\n\t\t\t\t\t</TooltipContent>\n\t\t\t\t</Tooltip>\n\t\t\t);\n\t\t}\n\n\t\treturn link;\n\t},\n);\nSidebarLink.displayName = 'SidebarLink';\n\nexport {\n\tSidebar,\n\tSidebarToggle,\n\tSidebarSection,\n\tSidebarItem,\n\tSidebarLink,\n\tsidebarVariants,\n};\n","'use client';\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nexport interface SplitPaneProps extends React.HTMLAttributes<HTMLDivElement> {\n\t/** Direction of the split */\n\tdirection?: 'horizontal' | 'vertical';\n\t/** Initial size of the first pane (in pixels or percentage) */\n\tdefaultSize?: number | string;\n\t/** Minimum size of the first pane in pixels */\n\tminSize?: number;\n\t/** Maximum size of the first pane in pixels */\n\tmaxSize?: number;\n\t/** Called when the pane size changes */\n\tonSizeChange?: (size: number) => void;\n\t/** Whether to show the resize handle */\n\tresizable?: boolean;\n}\n\nconst SplitPane = React.forwardRef<HTMLDivElement, SplitPaneProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tdirection = 'horizontal',\n\t\t\tdefaultSize = '50%',\n\t\t\tminSize = 100,\n\t\t\tmaxSize,\n\t\t\tonSizeChange,\n\t\t\tresizable = true,\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst containerRef = React.useRef<HTMLDivElement>(null);\n\t\tconst [size, setSize] = React.useState<number | null>(null);\n\t\tconst [isDragging, setIsDragging] = React.useState(false);\n\n\t\tconst childArray = React.Children.toArray(children);\n\t\tconst firstPane = childArray[0];\n\t\tconst secondPane = childArray[1];\n\n\t\tconst isHorizontal = direction === 'horizontal';\n\n\t\t// Initialize size from defaultSize\n\t\tReact.useEffect(() => {\n\t\t\tif (size !== null || !containerRef.current) return;\n\n\t\t\tconst containerSize = isHorizontal\n\t\t\t\t? containerRef.current.offsetWidth\n\t\t\t\t: containerRef.current.offsetHeight;\n\n\t\t\tif (typeof defaultSize === 'string' && defaultSize.endsWith('%')) {\n\t\t\t\tconst percent = parseFloat(defaultSize) / 100;\n\t\t\t\tsetSize(Math.round(containerSize * percent));\n\t\t\t} else if (typeof defaultSize === 'number') {\n\t\t\t\tsetSize(defaultSize);\n\t\t\t} else {\n\t\t\t\tsetSize(Math.round(containerSize / 2));\n\t\t\t}\n\t\t}, [defaultSize, isHorizontal, size]);\n\n\t\tconst handleMouseDown = React.useCallback(\n\t\t\t(e: React.MouseEvent) => {\n\t\t\t\tif (!resizable) return;\n\t\t\t\te.preventDefault();\n\t\t\t\tsetIsDragging(true);\n\t\t\t},\n\t\t\t[resizable],\n\t\t);\n\n\t\tReact.useEffect(() => {\n\t\t\tif (!isDragging) return;\n\n\t\t\tconst handleMouseMove = (e: MouseEvent) => {\n\t\t\t\tif (!containerRef.current) return;\n\n\t\t\t\tconst containerRect = containerRef.current.getBoundingClientRect();\n\t\t\t\tconst containerSize = isHorizontal\n\t\t\t\t\t? containerRect.width\n\t\t\t\t\t: containerRect.height;\n\n\t\t\t\tlet newSize = isHorizontal\n\t\t\t\t\t? e.clientX - containerRect.left\n\t\t\t\t\t: e.clientY - containerRect.top;\n\n\t\t\t\t// Apply constraints\n\t\t\t\tnewSize = Math.max(minSize, newSize);\n\t\t\t\tif (maxSize) {\n\t\t\t\t\tnewSize = Math.min(maxSize, newSize);\n\t\t\t\t}\n\t\t\t\tnewSize = Math.min(containerSize - minSize, newSize);\n\n\t\t\t\tsetSize(newSize);\n\t\t\t\tonSizeChange?.(newSize);\n\t\t\t};\n\n\t\t\tconst handleMouseUp = () => {\n\t\t\t\tsetIsDragging(false);\n\t\t\t};\n\n\t\t\tdocument.addEventListener('mousemove', handleMouseMove);\n\t\t\tdocument.addEventListener('mouseup', handleMouseUp);\n\n\t\t\treturn () => {\n\t\t\t\tdocument.removeEventListener('mousemove', handleMouseMove);\n\t\t\t\tdocument.removeEventListener('mouseup', handleMouseUp);\n\t\t\t};\n\t\t}, [isDragging, isHorizontal, minSize, maxSize, onSizeChange]);\n\n\t\tconst firstPaneStyle: React.CSSProperties = {\n\t\t\t[isHorizontal ? 'width' : 'height']:\n\t\t\t\tsize !== null ? `${size}px` : defaultSize,\n\t\t\tflexShrink: 0,\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={(node) => {\n\t\t\t\t\t(\n\t\t\t\t\t\tcontainerRef as React.MutableRefObject<HTMLDivElement | null>\n\t\t\t\t\t).current = node;\n\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex overflow-hidden',\n\t\t\t\t\tisHorizontal ? 'flex-row' : 'flex-col',\n\t\t\t\t\tisDragging && 'cursor-col-resize select-none',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn('overflow-auto', isHorizontal ? 'min-w-0' : 'min-h-0')}\n\t\t\t\t\tstyle={firstPaneStyle}\n\t\t\t\t>\n\t\t\t\t\t{firstPane}\n\t\t\t\t</div>\n\n\t\t\t\t{resizable && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex shrink-0 items-center justify-center bg-border transition-colors',\n\t\t\t\t\t\t\tisHorizontal\n\t\t\t\t\t\t\t\t? 'w-1 cursor-col-resize hover:bg-border-hover active:bg-accent'\n\t\t\t\t\t\t\t\t: 'h-1 cursor-row-resize hover:bg-border-hover active:bg-accent',\n\t\t\t\t\t\t\tisDragging && 'bg-accent',\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'rounded-full bg-muted-foreground/50',\n\t\t\t\t\t\t\t\tisHorizontal ? 'h-8 w-1' : 'h-1 w-8',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'flex-1 overflow-auto',\n\t\t\t\t\t\tisHorizontal ? 'min-w-0' : 'min-h-0',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{secondPane}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t},\n);\nSplitPane.displayName = 'SplitPane';\n\nexport interface SplitPanePanelProps\n\textends React.HTMLAttributes<HTMLDivElement> {}\n\nconst SplitPanePanel = React.forwardRef<HTMLDivElement, SplitPanePanelProps>(\n\t({ className, children, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div ref={ref} className={cn('h-full w-full', className)} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nSplitPanePanel.displayName = 'SplitPanePanel';\n\nexport { SplitPane, SplitPanePanel };\n"],"mappings":";;;;;;;;;AAUA,MAAM,SAAS,MAAM,WACpB,CAAC,EAAE,WAAW,SAAS,OAAO,SAAU,GAAG,OAAO,EAAE,QAAQ;AAC3D,wBACC,IAAC;EACK;EACL,WAAW,GACV,uE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