@classytic/fluid 0.2.4 → 0.3.3

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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -62
  3. package/dist/api-pagination-CJ0vR_w6.d.mts +34 -0
  4. package/dist/api-pagination-DBTE0yk4.mjs +190 -0
  5. package/dist/chunk-DQk6qfdC.mjs +18 -0
  6. package/dist/client/calendar.d.mts +105 -0
  7. package/dist/client/calendar.mjs +202 -0
  8. package/dist/client/core.d.mts +1614 -0
  9. package/dist/client/core.mjs +2779 -0
  10. package/dist/client/error.d.mts +125 -0
  11. package/dist/client/error.mjs +166 -0
  12. package/dist/client/hooks.d.mts +162 -0
  13. package/dist/client/hooks.mjs +447 -0
  14. package/dist/client/table.d.mts +84 -0
  15. package/dist/client/table.mjs +373 -0
  16. package/dist/client/theme.d.mts +6 -0
  17. package/dist/client/theme.mjs +65 -0
  18. package/dist/command.d.mts +134 -0
  19. package/dist/command.mjs +132 -0
  20. package/dist/compact.d.mts +359 -0
  21. package/dist/compact.mjs +892 -0
  22. package/dist/dashboard.d.mts +778 -0
  23. package/dist/dashboard.mjs +1617 -0
  24. package/dist/filter-utils-DqMmy_v-.mjs +72 -0
  25. package/dist/filter-utils-IZ0GtuPo.d.mts +40 -0
  26. package/dist/forms.d.mts +1549 -0
  27. package/dist/forms.mjs +3740 -0
  28. package/dist/index.d.mts +296 -0
  29. package/dist/index.mjs +432 -0
  30. package/dist/layouts.d.mts +215 -0
  31. package/dist/layouts.mjs +460 -0
  32. package/dist/search-context-DR7DBs7S.mjs +19 -0
  33. package/dist/search.d.mts +254 -0
  34. package/dist/search.mjs +523 -0
  35. package/dist/sheet-wrapper-C13Y-Q6w.mjs +211 -0
  36. package/dist/use-base-search-BGgWnWaF.d.mts +35 -0
  37. package/dist/use-debounce-xmZucz5e.mjs +53 -0
  38. package/dist/use-keyboard-shortcut-Bl6YM5Q7.mjs +82 -0
  39. package/dist/use-keyboard-shortcut-_mRCh3QO.d.mts +24 -0
  40. package/dist/use-media-query-BnVNIKT4.mjs +17 -0
  41. package/dist/use-mobile-BX3SQVo2.mjs +20 -0
  42. package/dist/use-scroll-detection-CsgsQYvy.mjs +43 -0
  43. package/dist/utils-CDue7cEt.d.mts +6 -0
  44. package/dist/utils-DQ5SCVoW.mjs +10 -0
  45. package/package.json +85 -45
  46. package/styles.css +2 -2
  47. package/dist/chunk-GUHK2DTW.js +0 -15
  48. package/dist/chunk-GUHK2DTW.js.map +0 -1
  49. package/dist/chunk-H3NFL3GJ.js +0 -57
  50. package/dist/chunk-H3NFL3GJ.js.map +0 -1
  51. package/dist/chunk-J2YRTQE4.js +0 -293
  52. package/dist/chunk-J2YRTQE4.js.map +0 -1
  53. package/dist/compact.d.ts +0 -217
  54. package/dist/compact.js +0 -986
  55. package/dist/compact.js.map +0 -1
  56. package/dist/dashboard.d.ts +0 -387
  57. package/dist/dashboard.js +0 -1032
  58. package/dist/dashboard.js.map +0 -1
  59. package/dist/index.d.ts +0 -2140
  60. package/dist/index.js +0 -6422
  61. package/dist/index.js.map +0 -1
  62. package/dist/layout.d.ts +0 -25
  63. package/dist/layout.js +0 -4
  64. package/dist/layout.js.map +0 -1
  65. package/dist/search.d.ts +0 -172
  66. package/dist/search.js +0 -341
  67. package/dist/search.js.map +0 -1
  68. package/dist/use-base-search-AS5Z3SAy.d.ts +0 -64
  69. package/dist/utils-Cbsgs0XP.d.ts +0 -5
@@ -0,0 +1,460 @@
1
+ "use client";
2
+
3
+ import { t as cn } from "./utils-DQ5SCVoW.mjs";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import * as React$1 from "react";
6
+ import { memo, useCallback, useMemo } from "react";
7
+ import { Menu, XIcon } from "lucide-react";
8
+ import { Button } from "@/components/ui/button";
9
+ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
10
+ import { Sheet, SheetContent, SheetDescription, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
11
+ import Link from "next/link";
12
+ import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@/components/ui/drawer";
13
+ import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu";
14
+ import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "@/components/ui/context-menu";
15
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";
16
+
17
+ //#region src/components/drawer-wrapper.tsx
18
+ const DRAWER_SIZE_CLASSES = {
19
+ horizontal: {
20
+ sm: "data-[vaul-drawer-direction=right]:sm:max-w-xs data-[vaul-drawer-direction=left]:sm:max-w-xs",
21
+ default: "data-[vaul-drawer-direction=right]:sm:max-w-sm data-[vaul-drawer-direction=left]:sm:max-w-sm",
22
+ md: "data-[vaul-drawer-direction=right]:sm:max-w-md data-[vaul-drawer-direction=left]:sm:max-w-md",
23
+ lg: "data-[vaul-drawer-direction=right]:w-full data-[vaul-drawer-direction=right]:sm:max-w-lg data-[vaul-drawer-direction=right]:md:max-w-2xl data-[vaul-drawer-direction=left]:w-full data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=left]:md:max-w-2xl",
24
+ xl: "data-[vaul-drawer-direction=right]:w-full data-[vaul-drawer-direction=right]:sm:max-w-2xl data-[vaul-drawer-direction=right]:md:max-w-4xl data-[vaul-drawer-direction=left]:w-full data-[vaul-drawer-direction=left]:sm:max-w-2xl data-[vaul-drawer-direction=left]:md:max-w-4xl",
25
+ full: "data-[vaul-drawer-direction=right]:w-full data-[vaul-drawer-direction=right]:max-w-full data-[vaul-drawer-direction=right]:sm:max-w-full data-[vaul-drawer-direction=left]:w-full data-[vaul-drawer-direction=left]:max-w-full data-[vaul-drawer-direction=left]:sm:max-w-full"
26
+ },
27
+ vertical: {
28
+ sm: "max-h-[40vh]",
29
+ default: "max-h-[80vh]",
30
+ md: "max-h-[60vh]",
31
+ lg: "max-h-[80vh]",
32
+ xl: "max-h-[90vh]",
33
+ full: "max-h-screen h-screen"
34
+ }
35
+ };
36
+ function getDrawerSizeClasses(size, direction) {
37
+ return DRAWER_SIZE_CLASSES[direction === "left" || direction === "right" ? "horizontal" : "vertical"][size];
38
+ }
39
+ const DrawerWrapper = memo(function DrawerWrapper({ open, onOpenChange, title, description, children, footer, trigger, direction = "bottom", size, className, headerClassName, contentClassName, footerClassName, hideHeader = false, hideTitle = false, hideDescription = false, showCloseButton = false, showHandle = true, snapPoints, shouldScaleBackground = true }) {
40
+ return /* @__PURE__ */ jsxs(Drawer, {
41
+ open,
42
+ onOpenChange,
43
+ direction,
44
+ snapPoints,
45
+ shouldScaleBackground,
46
+ children: [trigger && /* @__PURE__ */ jsx(DrawerTrigger, { children: trigger }), /* @__PURE__ */ jsxs(DrawerContent, {
47
+ className: cn(size && getDrawerSizeClasses(size, direction), contentClassName, className),
48
+ children: [
49
+ showCloseButton && /* @__PURE__ */ jsx(DrawerClose, {
50
+ asChild: true,
51
+ children: /* @__PURE__ */ jsxs(Button, {
52
+ variant: "ghost",
53
+ size: "icon-sm",
54
+ className: "absolute top-3 right-3 z-10",
55
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
56
+ className: "sr-only",
57
+ children: "Close"
58
+ })]
59
+ })
60
+ }),
61
+ !hideHeader && /* @__PURE__ */ jsxs(DrawerHeader, {
62
+ className: cn(headerClassName),
63
+ children: [hideTitle ? /* @__PURE__ */ jsx(DrawerTitle, {
64
+ className: "sr-only",
65
+ children: title || "Drawer"
66
+ }) : /* @__PURE__ */ jsx(DrawerTitle, { children: title }), description && (hideDescription ? /* @__PURE__ */ jsx(DrawerDescription, {
67
+ className: "sr-only",
68
+ children: description
69
+ }) : /* @__PURE__ */ jsx(DrawerDescription, { children: description }))]
70
+ }),
71
+ /* @__PURE__ */ jsx("div", {
72
+ className: "px-4 pb-2 overflow-y-auto flex-1",
73
+ children
74
+ }),
75
+ footer && /* @__PURE__ */ jsx(DrawerFooter, {
76
+ className: cn(footerClassName),
77
+ children: footer
78
+ })
79
+ ]
80
+ })]
81
+ });
82
+ });
83
+ const FormDrawer = memo(function FormDrawer({ open, onOpenChange, title, description, children, onSubmit, onCancel, submitLabel = "Save", cancelLabel = "Cancel", submitDisabled = false, submitLoading = false, ...props }) {
84
+ const handleCancel = useCallback(() => {
85
+ onCancel?.();
86
+ onOpenChange?.(false);
87
+ }, [onCancel, onOpenChange]);
88
+ return /* @__PURE__ */ jsx(DrawerWrapper, {
89
+ open,
90
+ onOpenChange,
91
+ title,
92
+ description,
93
+ footer: useMemo(() => /* @__PURE__ */ jsxs("div", {
94
+ className: "flex flex-col gap-2 w-full",
95
+ children: [/* @__PURE__ */ jsx(Button, {
96
+ onClick: onSubmit,
97
+ disabled: submitDisabled || submitLoading,
98
+ children: submitLoading ? "Saving..." : submitLabel
99
+ }), /* @__PURE__ */ jsx(Button, {
100
+ variant: "outline",
101
+ onClick: handleCancel,
102
+ children: cancelLabel
103
+ })]
104
+ }), [
105
+ submitLabel,
106
+ cancelLabel,
107
+ submitDisabled,
108
+ submitLoading,
109
+ onSubmit,
110
+ handleCancel
111
+ ]),
112
+ ...props,
113
+ children
114
+ });
115
+ });
116
+ const ConfirmDrawer = memo(function ConfirmDrawer({ open, onOpenChange, title = "Confirm Action", description, children, onConfirm, onCancel, confirmLabel = "Confirm", cancelLabel = "Cancel", confirmVariant = "default", confirmDisabled = false, confirmLoading = false, ...props }) {
117
+ const handleCancel = useCallback(() => {
118
+ onCancel?.();
119
+ onOpenChange?.(false);
120
+ }, [onCancel, onOpenChange]);
121
+ return /* @__PURE__ */ jsx(DrawerWrapper, {
122
+ open,
123
+ onOpenChange,
124
+ title,
125
+ description,
126
+ footer: useMemo(() => /* @__PURE__ */ jsxs("div", {
127
+ className: "flex flex-col gap-2 w-full",
128
+ children: [/* @__PURE__ */ jsx(Button, {
129
+ variant: confirmVariant,
130
+ onClick: onConfirm,
131
+ disabled: confirmDisabled || confirmLoading,
132
+ children: confirmLoading ? "Loading..." : confirmLabel
133
+ }), /* @__PURE__ */ jsx(Button, {
134
+ variant: "outline",
135
+ onClick: handleCancel,
136
+ children: cancelLabel
137
+ })]
138
+ }), [
139
+ confirmLabel,
140
+ cancelLabel,
141
+ confirmVariant,
142
+ confirmDisabled,
143
+ confirmLoading,
144
+ onConfirm,
145
+ handleCancel
146
+ ]),
147
+ ...props,
148
+ children
149
+ });
150
+ });
151
+
152
+ //#endregion
153
+ //#region src/components/navigation-bar.tsx
154
+ function isDropdown(item) {
155
+ return "items" in item;
156
+ }
157
+ function DropdownContent({ item }) {
158
+ const cols = item.columns ?? (item.items.length > 4 ? 2 : 1);
159
+ const hasDescriptions = item.items.some((l) => l.description);
160
+ const widthClass = item.featured ? "w-[540px]" : cols >= 2 ? hasDescriptions ? "w-[520px]" : "w-[380px]" : hasDescriptions ? "w-[300px]" : "w-[220px]";
161
+ const gridClass = cols === 3 ? "grid-cols-3" : cols === 2 ? "grid-cols-2" : "grid-cols-1";
162
+ return /* @__PURE__ */ jsxs("div", {
163
+ className: cn("flex gap-3 p-3", widthClass),
164
+ children: [item.featured && /* @__PURE__ */ jsx("div", {
165
+ className: "w-[180px] shrink-0",
166
+ children: /* @__PURE__ */ jsxs(NavigationMenuLink, {
167
+ href: item.featured.href,
168
+ className: "flex h-full flex-col justify-end rounded-lg bg-gradient-to-b from-muted/50 to-muted p-4",
169
+ children: [
170
+ item.featured.icon && /* @__PURE__ */ jsx("div", {
171
+ className: "mb-2 h-6 w-6",
172
+ children: item.featured.icon
173
+ }),
174
+ /* @__PURE__ */ jsx("div", {
175
+ className: "mb-1 text-sm font-medium",
176
+ children: item.featured.title
177
+ }),
178
+ /* @__PURE__ */ jsx("p", {
179
+ className: "text-xs text-muted-foreground leading-snug",
180
+ children: item.featured.description
181
+ })
182
+ ]
183
+ })
184
+ }), /* @__PURE__ */ jsx("div", {
185
+ className: cn("grid gap-1 flex-1", gridClass),
186
+ children: item.items.map((link) => {
187
+ const Icon = link.icon;
188
+ return /* @__PURE__ */ jsxs(NavigationMenuLink, {
189
+ href: link.href,
190
+ className: cn("block select-none rounded-md p-2.5", link.isActive && "bg-accent/50"),
191
+ children: [/* @__PURE__ */ jsxs("div", {
192
+ className: "flex items-center gap-2",
193
+ children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
194
+ className: "text-sm font-medium",
195
+ children: link.title
196
+ })]
197
+ }), link.description && /* @__PURE__ */ jsx("p", {
198
+ className: cn("mt-1 text-xs leading-relaxed text-muted-foreground", Icon && "pl-6"),
199
+ children: link.description
200
+ })]
201
+ }, link.href);
202
+ })
203
+ })]
204
+ });
205
+ }
206
+ function MobileNav({ brand, items, actions }) {
207
+ const [open, setOpen] = React$1.useState(false);
208
+ return /* @__PURE__ */ jsxs(Sheet, {
209
+ open,
210
+ onOpenChange: setOpen,
211
+ children: [/* @__PURE__ */ jsx(SheetTrigger, {
212
+ render: /* @__PURE__ */ jsx(Button, {
213
+ variant: "ghost",
214
+ size: "icon",
215
+ "aria-label": "Open navigation menu"
216
+ }),
217
+ children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
218
+ }), /* @__PURE__ */ jsxs(SheetContent, {
219
+ side: "left",
220
+ className: "w-72 p-0",
221
+ children: [
222
+ /* @__PURE__ */ jsx(SheetTitle, {
223
+ className: "sr-only",
224
+ children: "Navigation"
225
+ }),
226
+ /* @__PURE__ */ jsx(SheetDescription, {
227
+ className: "sr-only",
228
+ children: "Main navigation menu"
229
+ }),
230
+ /* @__PURE__ */ jsxs("div", {
231
+ className: "flex flex-col h-full",
232
+ children: [
233
+ /* @__PURE__ */ jsx("div", {
234
+ className: "flex items-center justify-between border-b px-4 py-3",
235
+ children: /* @__PURE__ */ jsxs(Link, {
236
+ href: brand.href || "/",
237
+ className: "flex items-center gap-2",
238
+ onClick: () => setOpen(false),
239
+ children: [brand.icon && /* @__PURE__ */ jsx("div", {
240
+ className: "h-7 w-7 flex items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm",
241
+ children: brand.icon
242
+ }), /* @__PURE__ */ jsx("span", {
243
+ className: "font-semibold",
244
+ children: brand.title
245
+ })]
246
+ })
247
+ }),
248
+ /* @__PURE__ */ jsx("div", {
249
+ className: "flex-1 overflow-y-auto px-3 py-2",
250
+ children: items.map((item, idx) => {
251
+ if (isDropdown(item)) return /* @__PURE__ */ jsxs("div", {
252
+ className: "mb-2",
253
+ children: [/* @__PURE__ */ jsx("div", {
254
+ className: "px-2 py-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",
255
+ children: item.title
256
+ }), item.items.map((link) => {
257
+ const Icon = link.icon;
258
+ return /* @__PURE__ */ jsxs(Link, {
259
+ href: link.href,
260
+ className: cn("flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-accent", link.isActive && "bg-accent text-accent-foreground"),
261
+ onClick: () => setOpen(false),
262
+ ...link.external ? {
263
+ target: "_blank",
264
+ rel: "noopener noreferrer"
265
+ } : {},
266
+ children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 text-muted-foreground" }), link.title]
267
+ }, link.href);
268
+ })]
269
+ }, `mobile-dropdown-${idx}`);
270
+ const Icon = item.icon;
271
+ return /* @__PURE__ */ jsxs(Link, {
272
+ href: item.href,
273
+ className: cn("flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors hover:bg-accent", item.isActive && "bg-accent text-accent-foreground"),
274
+ onClick: () => setOpen(false),
275
+ ...item.external ? {
276
+ target: "_blank",
277
+ rel: "noopener noreferrer"
278
+ } : {},
279
+ children: [Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 text-muted-foreground" }), item.title]
280
+ }, item.href);
281
+ })
282
+ }),
283
+ actions && /* @__PURE__ */ jsx("div", {
284
+ className: "border-t p-4",
285
+ children: actions
286
+ })
287
+ ]
288
+ })
289
+ ]
290
+ })]
291
+ });
292
+ }
293
+ const BREAKPOINT_CLASSES = {
294
+ sm: {
295
+ hide: "sm:hidden",
296
+ show: "hidden sm:flex"
297
+ },
298
+ md: {
299
+ hide: "md:hidden",
300
+ show: "hidden md:flex"
301
+ },
302
+ lg: {
303
+ hide: "lg:hidden",
304
+ show: "hidden lg:flex"
305
+ }
306
+ };
307
+ function NavigationBar({ brand, items, actions, sticky = true, bordered = true, className, mobileBreakpoint = "md" }) {
308
+ const bp = BREAKPOINT_CLASSES[mobileBreakpoint];
309
+ return /* @__PURE__ */ jsx("header", {
310
+ className: cn("w-full bg-background/95 backdrop-blur-sm supports-backdrop-filter:bg-background/60 z-50", sticky && "sticky top-0", bordered && "border-b", className),
311
+ children: /* @__PURE__ */ jsxs("div", {
312
+ className: "flex h-14 items-center px-4 lg:px-6",
313
+ children: [
314
+ /* @__PURE__ */ jsxs(Link, {
315
+ href: brand.href || "/",
316
+ className: "flex items-center gap-2 mr-6",
317
+ children: [brand.icon && /* @__PURE__ */ jsx("div", {
318
+ className: "h-7 w-7 flex items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm",
319
+ children: brand.icon
320
+ }), /* @__PURE__ */ jsx("span", {
321
+ className: "font-semibold tracking-tight",
322
+ children: brand.title
323
+ })]
324
+ }),
325
+ /* @__PURE__ */ jsx(NavigationMenu, {
326
+ className: cn(bp.show, "flex-1"),
327
+ children: /* @__PURE__ */ jsx(NavigationMenuList, { children: items.map((item, idx) => {
328
+ if (isDropdown(item)) return /* @__PURE__ */ jsxs(NavigationMenuItem, { children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, { children: item.title }), /* @__PURE__ */ jsx(NavigationMenuContent, { children: /* @__PURE__ */ jsx(DropdownContent, { item }) })] }, `nav-dropdown-${idx}`);
329
+ return /* @__PURE__ */ jsx(NavigationMenuItem, { children: /* @__PURE__ */ jsx(NavigationMenuLink, {
330
+ href: item.href,
331
+ className: cn(navigationMenuTriggerStyle(), item.isActive && "bg-accent/50"),
332
+ ...item.external ? {
333
+ target: "_blank",
334
+ rel: "noopener noreferrer"
335
+ } : {},
336
+ children: item.title
337
+ }) }, item.href);
338
+ }) })
339
+ }),
340
+ /* @__PURE__ */ jsx("div", { className: cn("flex-1", bp.show.replace("flex", "hidden")) }),
341
+ actions && /* @__PURE__ */ jsx("div", {
342
+ className: cn("items-center gap-2 ml-auto", bp.show),
343
+ children: actions
344
+ }),
345
+ /* @__PURE__ */ jsx("div", {
346
+ className: cn("ml-auto", bp.hide),
347
+ children: /* @__PURE__ */ jsx(MobileNav, {
348
+ brand,
349
+ items,
350
+ actions
351
+ })
352
+ })
353
+ ]
354
+ })
355
+ });
356
+ }
357
+
358
+ //#endregion
359
+ //#region src/components/context-menu-wrapper.tsx
360
+ function ContextMenuWrapper({ children, items, className, contentClassName, disabled = false }) {
361
+ if (disabled) return /* @__PURE__ */ jsx(Fragment, { children });
362
+ return /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenuTrigger, {
363
+ className,
364
+ children
365
+ }), /* @__PURE__ */ jsx(ContextMenuContent, {
366
+ className: cn("min-w-[180px]", contentClassName),
367
+ children: items.map((item, index) => renderContextItem(item, index))
368
+ })] });
369
+ }
370
+ function renderContextItem(item, index) {
371
+ if (item.hidden) return null;
372
+ const key = item.key || `ctx-${index}`;
373
+ if (item.type === "separator") return /* @__PURE__ */ jsx(ContextMenuSeparator, {}, key);
374
+ if (item.type === "label") return /* @__PURE__ */ jsx(ContextMenuGroup, { children: /* @__PURE__ */ jsx(ContextMenuLabel, { children: item.label }) }, key);
375
+ if (item.type === "checkbox") return /* @__PURE__ */ jsxs(ContextMenuCheckboxItem, {
376
+ checked: item.checked,
377
+ onCheckedChange: item.onCheckedChange,
378
+ disabled: item.disabled,
379
+ children: [item.label, item.shortcut && /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut })]
380
+ }, key);
381
+ if (item.type === "radio-group" && item.radioOptions) return /* @__PURE__ */ jsxs(ContextMenuRadioGroup, {
382
+ value: item.radioValue,
383
+ onValueChange: item.onRadioChange,
384
+ children: [item.label && /* @__PURE__ */ jsx(ContextMenuLabel, { children: item.label }), item.radioOptions.map((opt) => /* @__PURE__ */ jsx(ContextMenuRadioItem, {
385
+ value: opt.value,
386
+ children: opt.label
387
+ }, opt.value))]
388
+ }, key);
389
+ if (item.type === "submenu" && item.items) return /* @__PURE__ */ jsxs(ContextMenuSub, { children: [/* @__PURE__ */ jsxs(ContextMenuSubTrigger, { children: [item.icon && /* @__PURE__ */ jsx(item.icon, { className: "h-4 w-4" }), item.label] }), /* @__PURE__ */ jsx(ContextMenuSubContent, { children: item.items.map((subItem, subIdx) => renderContextItem(subItem, subIdx)) })] }, key);
390
+ const Icon = item.icon;
391
+ return /* @__PURE__ */ jsxs(ContextMenuItem, {
392
+ onClick: item.onClick,
393
+ disabled: item.disabled,
394
+ variant: item.variant,
395
+ children: [
396
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
397
+ /* @__PURE__ */ jsx("span", { children: item.label }),
398
+ item.shortcut && /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut })
399
+ ]
400
+ }, key);
401
+ }
402
+
403
+ //#endregion
404
+ //#region src/components/hover-card-wrapper.tsx
405
+ function HoverCardWrapper({ trigger, children, side = "bottom", align = "center", sideOffset = 4, className, contentClassName, openDelay, closeDelay }) {
406
+ return /* @__PURE__ */ jsxs(HoverCard, {
407
+ openDelay,
408
+ closeDelay,
409
+ children: [/* @__PURE__ */ jsx(HoverCardTrigger, {
410
+ className,
411
+ children: trigger
412
+ }), /* @__PURE__ */ jsx(HoverCardContent, {
413
+ side,
414
+ align,
415
+ sideOffset,
416
+ className: cn("w-80", contentClassName),
417
+ children
418
+ })]
419
+ });
420
+ }
421
+ function UserHoverCard({ trigger, user, footer, side = "bottom", className }) {
422
+ const initials = user.initials || user.name.split(" ").map((n) => n[0]).join("").slice(0, 2).toUpperCase();
423
+ return /* @__PURE__ */ jsxs(HoverCardWrapper, {
424
+ trigger,
425
+ side,
426
+ className,
427
+ children: [/* @__PURE__ */ jsxs("div", {
428
+ className: "flex gap-3",
429
+ children: [/* @__PURE__ */ jsxs(Avatar, {
430
+ className: "h-10 w-10 shrink-0",
431
+ children: [user.avatar && /* @__PURE__ */ jsx(AvatarImage, {
432
+ src: user.avatar,
433
+ alt: user.name
434
+ }), /* @__PURE__ */ jsx(AvatarFallback, { children: initials })]
435
+ }), /* @__PURE__ */ jsxs("div", {
436
+ className: "space-y-1 min-w-0",
437
+ children: [
438
+ /* @__PURE__ */ jsx("h4", {
439
+ className: "text-sm font-semibold truncate",
440
+ children: user.name
441
+ }),
442
+ user.username && /* @__PURE__ */ jsxs("p", {
443
+ className: "text-xs text-muted-foreground",
444
+ children: ["@", user.username]
445
+ }),
446
+ user.bio && /* @__PURE__ */ jsx("p", {
447
+ className: "text-sm text-muted-foreground line-clamp-2",
448
+ children: user.bio
449
+ })
450
+ ]
451
+ })]
452
+ }), footer && /* @__PURE__ */ jsx("div", {
453
+ className: "mt-3 pt-3 border-t",
454
+ children: footer
455
+ })]
456
+ });
457
+ }
458
+
459
+ //#endregion
460
+ export { ConfirmDrawer, ContextMenuWrapper, DrawerWrapper, FormDrawer, HoverCardWrapper, NavigationBar, UserHoverCard };
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+
4
+ //#region src/components/search/search-context.tsx
5
+ const SearchContext = createContext(void 0);
6
+ function SearchProvider({ children, value }) {
7
+ return /* @__PURE__ */ jsx(SearchContext.Provider, {
8
+ value,
9
+ children
10
+ });
11
+ }
12
+ function useSearch() {
13
+ const context = useContext(SearchContext);
14
+ if (!context) throw new Error("useSearch must be used within SearchProvider");
15
+ return context;
16
+ }
17
+
18
+ //#endregion
19
+ export { useSearch as n, SearchProvider as t };