@classytic/fluid 0.4.2 → 0.5.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 (51) hide show
  1. package/README.md +21 -1
  2. package/dist/client/calendar.d.mts +1 -2
  3. package/dist/client/calendar.mjs +4 -4
  4. package/dist/client/color-picker.d.mts +41 -25
  5. package/dist/client/color-picker.mjs +121 -73
  6. package/dist/client/core.d.mts +243 -557
  7. package/dist/client/core.mjs +351 -1462
  8. package/dist/client/error.d.mts +41 -41
  9. package/dist/client/error.mjs +35 -35
  10. package/dist/client/gallery.d.mts +33 -33
  11. package/dist/client/gallery.mjs +128 -127
  12. package/dist/client/hooks.d.mts +57 -39
  13. package/dist/client/hooks.mjs +29 -7
  14. package/dist/client/spreadsheet.d.mts +28 -28
  15. package/dist/client/spreadsheet.mjs +77 -77
  16. package/dist/client/table.d.mts +66 -33
  17. package/dist/client/table.mjs +87 -54
  18. package/dist/client/theme.mjs +1 -1
  19. package/dist/command.d.mts +6 -4
  20. package/dist/command.mjs +3 -3
  21. package/dist/compact.d.mts +97 -95
  22. package/dist/compact.mjs +336 -322
  23. package/dist/dashboard.d.mts +614 -422
  24. package/dist/dashboard.mjs +1051 -762
  25. package/dist/{dropdown-wrapper-B86u9Fri.mjs → dropdown-wrapper-B9nRDUlz.mjs} +25 -35
  26. package/dist/forms.d.mts +1037 -972
  27. package/dist/forms.mjs +2849 -2721
  28. package/dist/index.d.mts +218 -152
  29. package/dist/index.mjs +357 -264
  30. package/dist/layouts.d.mts +94 -94
  31. package/dist/layouts.mjs +115 -110
  32. package/dist/phone-input-B9_XPNvv.mjs +429 -0
  33. package/dist/phone-input-CLH_UjQZ.d.mts +31 -0
  34. package/dist/{search-context-DR7DBs7S.mjs → search-context-1g3ZmOvx.mjs} +1 -1
  35. package/dist/search.d.mts +168 -164
  36. package/dist/search.mjs +305 -301
  37. package/dist/{sheet-wrapper-C13Y-Q6w.mjs → sheet-wrapper-B2uxookb.mjs} +1 -1
  38. package/dist/timeline-Bgu1mIe9.d.mts +373 -0
  39. package/dist/timeline-HJtWf4Op.mjs +804 -0
  40. package/dist/{use-base-search-BGgWnWaF.d.mts → use-base-search-DFC4QKYU.d.mts} +1 -1
  41. package/dist/{use-media-query-BnVNIKT4.mjs → use-media-query-ChLfFChU.mjs} +6 -7
  42. package/package.json +2 -2
  43. /package/dist/{api-pagination-CJ0vR_w6.d.mts → api-pagination-C30ser2L.d.mts} +0 -0
  44. /package/dist/{filter-utils-DqMmy_v-.mjs → filter-utils-BGIvtq1R.mjs} +0 -0
  45. /package/dist/{filter-utils-IZ0GtuPo.d.mts → filter-utils-DOFTBWm1.d.mts} +0 -0
  46. /package/dist/{use-debounce-xmZucz5e.mjs → use-debounce-BNoNiEon.mjs} +0 -0
  47. /package/dist/{use-keyboard-shortcut-Bl6YM5Q7.mjs → use-keyboard-shortcut-C_Vk-36P.mjs} +0 -0
  48. /package/dist/{use-keyboard-shortcut-_mRCh3QO.d.mts → use-keyboard-shortcut-Q4CSPzSI.d.mts} +0 -0
  49. /package/dist/{use-mobile-BX3SQVo2.mjs → use-mobile-CnEmFiQx.mjs} +0 -0
  50. /package/dist/{use-scroll-detection-CsgsQYvy.mjs → use-scroll-detection-BKfqkmEC.mjs} +0 -0
  51. /package/dist/{utils-CDue7cEt.d.mts → utils-rqvYP1by.d.mts} +0 -0
@@ -1,8 +1,47 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import * as react from "react";
1
+ import * as React$1 from "react";
3
2
  import { ReactNode } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { LucideIcon } from "lucide-react";
5
5
 
6
+ //#region src/components/context-menu-wrapper.d.ts
7
+ interface ContextMenuAction {
8
+ type?: "item" | "separator" | "label" | "checkbox" | "radio-group" | "submenu";
9
+ key?: string;
10
+ label?: string;
11
+ icon?: LucideIcon;
12
+ onClick?: () => void;
13
+ disabled?: boolean;
14
+ hidden?: boolean;
15
+ variant?: "default" | "destructive";
16
+ shortcut?: string;
17
+ /** For checkbox items */
18
+ checked?: boolean;
19
+ onCheckedChange?: (checked: boolean) => void;
20
+ /** For radio groups */
21
+ radioValue?: string;
22
+ onRadioChange?: (value: string) => void;
23
+ radioOptions?: {
24
+ value: string;
25
+ label: string;
26
+ }[];
27
+ /** For submenus */
28
+ items?: ContextMenuAction[];
29
+ }
30
+ interface ContextMenuWrapperProps {
31
+ children: React$1.ReactNode;
32
+ items: ContextMenuAction[];
33
+ className?: string;
34
+ contentClassName?: string;
35
+ disabled?: boolean;
36
+ }
37
+ declare function ContextMenuWrapper({
38
+ children,
39
+ items,
40
+ className,
41
+ contentClassName,
42
+ disabled
43
+ }: ContextMenuWrapperProps): react_jsx_runtime0.JSX.Element;
44
+ //#endregion
6
45
  //#region src/components/drawer-wrapper.d.ts
7
46
  declare const DRAWER_SIZE_CLASSES: {
8
47
  readonly horizontal: {
@@ -50,7 +89,7 @@ interface DrawerWrapperProps {
50
89
  /** Whether drawer should scale background */
51
90
  shouldScaleBackground?: boolean;
52
91
  }
53
- declare const DrawerWrapper: react.NamedExoticComponent<DrawerWrapperProps>;
92
+ declare const DrawerWrapper: React$1.NamedExoticComponent<DrawerWrapperProps>;
54
93
  interface FormDrawerProps extends Omit<DrawerWrapperProps, "footer"> {
55
94
  onSubmit?: () => void;
56
95
  onCancel?: () => void;
@@ -59,7 +98,7 @@ interface FormDrawerProps extends Omit<DrawerWrapperProps, "footer"> {
59
98
  submitDisabled?: boolean;
60
99
  submitLoading?: boolean;
61
100
  }
62
- declare const FormDrawer: react.NamedExoticComponent<FormDrawerProps>;
101
+ declare const FormDrawer: React$1.NamedExoticComponent<FormDrawerProps>;
63
102
  interface ConfirmDrawerProps extends Omit<DrawerWrapperProps, "footer"> {
64
103
  onConfirm?: () => void;
65
104
  onCancel?: () => void;
@@ -69,7 +108,54 @@ interface ConfirmDrawerProps extends Omit<DrawerWrapperProps, "footer"> {
69
108
  confirmDisabled?: boolean;
70
109
  confirmLoading?: boolean;
71
110
  }
72
- declare const ConfirmDrawer: react.NamedExoticComponent<ConfirmDrawerProps>;
111
+ declare const ConfirmDrawer: React$1.NamedExoticComponent<ConfirmDrawerProps>;
112
+ //#endregion
113
+ //#region src/components/hover-card-wrapper.d.ts
114
+ interface HoverCardWrapperProps {
115
+ trigger: React$1.ReactNode;
116
+ children: React$1.ReactNode;
117
+ side?: "top" | "bottom" | "left" | "right";
118
+ align?: "start" | "center" | "end";
119
+ sideOffset?: number;
120
+ className?: string;
121
+ contentClassName?: string;
122
+ /** Delay before opening (ms) */
123
+ openDelay?: number;
124
+ /** Delay before closing (ms) */
125
+ closeDelay?: number;
126
+ }
127
+ declare function HoverCardWrapper({
128
+ trigger,
129
+ children,
130
+ side,
131
+ align,
132
+ sideOffset,
133
+ className,
134
+ contentClassName,
135
+ openDelay,
136
+ closeDelay
137
+ }: HoverCardWrapperProps): react_jsx_runtime0.JSX.Element;
138
+ interface UserHoverCardProps {
139
+ trigger: React$1.ReactNode;
140
+ user: {
141
+ name: string;
142
+ username?: string;
143
+ avatar?: string;
144
+ bio?: string;
145
+ initials?: string;
146
+ };
147
+ /** Extra content below bio */
148
+ footer?: React$1.ReactNode;
149
+ side?: "top" | "bottom" | "left" | "right";
150
+ className?: string;
151
+ }
152
+ declare function UserHoverCard({
153
+ trigger,
154
+ user,
155
+ footer,
156
+ side,
157
+ className
158
+ }: UserHoverCardProps): react_jsx_runtime0.JSX.Element;
73
159
  //#endregion
74
160
  //#region src/components/navigation-bar.d.ts
75
161
  interface NavBarLink {
@@ -91,13 +177,13 @@ interface NavBarDropdown {
91
177
  title: string;
92
178
  description: string;
93
179
  href: string;
94
- icon?: react.ReactNode;
180
+ icon?: React$1.ReactNode;
95
181
  };
96
182
  }
97
183
  type NavBarItem = NavBarLink | NavBarDropdown;
98
184
  interface NavBarBrand {
99
185
  title: string;
100
- icon?: react.ReactNode;
186
+ icon?: React$1.ReactNode;
101
187
  href?: string;
102
188
  }
103
189
  interface NavigationBarProps {
@@ -106,7 +192,7 @@ interface NavigationBarProps {
106
192
  /** Navigation items */
107
193
  items: NavBarItem[];
108
194
  /** Right-side content (e.g., auth buttons, avatar) */
109
- actions?: react.ReactNode;
195
+ actions?: React$1.ReactNode;
110
196
  /** Sticky positioning */
111
197
  sticky?: boolean;
112
198
  /** Show border at bottom */
@@ -126,90 +212,4 @@ declare function NavigationBar({
126
212
  mobileBreakpoint
127
213
  }: NavigationBarProps): react_jsx_runtime0.JSX.Element;
128
214
  //#endregion
129
- //#region src/components/context-menu-wrapper.d.ts
130
- interface ContextMenuAction {
131
- type?: "item" | "separator" | "label" | "checkbox" | "radio-group" | "submenu";
132
- key?: string;
133
- label?: string;
134
- icon?: LucideIcon;
135
- onClick?: () => void;
136
- disabled?: boolean;
137
- hidden?: boolean;
138
- variant?: "default" | "destructive";
139
- shortcut?: string;
140
- /** For checkbox items */
141
- checked?: boolean;
142
- onCheckedChange?: (checked: boolean) => void;
143
- /** For radio groups */
144
- radioValue?: string;
145
- onRadioChange?: (value: string) => void;
146
- radioOptions?: {
147
- value: string;
148
- label: string;
149
- }[];
150
- /** For submenus */
151
- items?: ContextMenuAction[];
152
- }
153
- interface ContextMenuWrapperProps {
154
- children: react.ReactNode;
155
- items: ContextMenuAction[];
156
- className?: string;
157
- contentClassName?: string;
158
- disabled?: boolean;
159
- }
160
- declare function ContextMenuWrapper({
161
- children,
162
- items,
163
- className,
164
- contentClassName,
165
- disabled
166
- }: ContextMenuWrapperProps): react_jsx_runtime0.JSX.Element;
167
- //#endregion
168
- //#region src/components/hover-card-wrapper.d.ts
169
- interface HoverCardWrapperProps {
170
- trigger: react.ReactNode;
171
- children: react.ReactNode;
172
- side?: "top" | "bottom" | "left" | "right";
173
- align?: "start" | "center" | "end";
174
- sideOffset?: number;
175
- className?: string;
176
- contentClassName?: string;
177
- /** Delay before opening (ms) */
178
- openDelay?: number;
179
- /** Delay before closing (ms) */
180
- closeDelay?: number;
181
- }
182
- declare function HoverCardWrapper({
183
- trigger,
184
- children,
185
- side,
186
- align,
187
- sideOffset,
188
- className,
189
- contentClassName,
190
- openDelay,
191
- closeDelay
192
- }: HoverCardWrapperProps): react_jsx_runtime0.JSX.Element;
193
- interface UserHoverCardProps {
194
- trigger: react.ReactNode;
195
- user: {
196
- name: string;
197
- username?: string;
198
- avatar?: string;
199
- bio?: string;
200
- initials?: string;
201
- };
202
- /** Extra content below bio */
203
- footer?: react.ReactNode;
204
- side?: "top" | "bottom" | "left" | "right";
205
- className?: string;
206
- }
207
- declare function UserHoverCard({
208
- trigger,
209
- user,
210
- footer,
211
- side,
212
- className
213
- }: UserHoverCardProps): react_jsx_runtime0.JSX.Element;
214
- //#endregion
215
215
  export { ConfirmDrawer, type ConfirmDrawerProps, type ContextMenuAction, ContextMenuWrapper, type ContextMenuWrapperProps, DrawerWrapper, type DrawerWrapperProps, FormDrawer, type FormDrawerProps, HoverCardWrapper, type HoverCardWrapperProps, type NavBarBrand, type NavBarDropdown, type NavBarItem, type NavBarLink, NavigationBar, type NavigationBarProps, UserHoverCard, type UserHoverCardProps };
package/dist/layouts.mjs CHANGED
@@ -1,19 +1,64 @@
1
1
  "use client";
2
2
 
3
3
  import { t as cn } from "./utils-DQ5SCVoW.mjs";
4
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
4
  import * as React$1 from "react";
6
5
  import { memo, useCallback, useMemo } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Menu, XIcon } from "lucide-react";
8
8
  import { Button } from "@/components/ui/button";
9
9
  import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
10
10
  import { Sheet, SheetContent, SheetDescription, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
11
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
12
  import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "@/components/ui/context-menu";
13
+ import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@/components/ui/drawer";
15
14
  import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";
15
+ import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu";
16
+
17
+ //#region src/components/context-menu-wrapper.tsx
18
+ function ContextMenuWrapper({ children, items, className, contentClassName, disabled = false }) {
19
+ if (disabled) return /* @__PURE__ */ jsx(Fragment$1, { children });
20
+ return /* @__PURE__ */ jsxs(ContextMenu, { children: [/* @__PURE__ */ jsx(ContextMenuTrigger, {
21
+ className,
22
+ children
23
+ }), /* @__PURE__ */ jsx(ContextMenuContent, {
24
+ className: cn("min-w-[180px]", contentClassName),
25
+ children: items.map((item, index) => renderContextItem(item, index))
26
+ })] });
27
+ }
28
+ function renderContextItem(item, index) {
29
+ if (item.hidden) return null;
30
+ const key = item.key || `ctx-${index}`;
31
+ if (item.type === "separator") return /* @__PURE__ */ jsx(ContextMenuSeparator, {}, key);
32
+ if (item.type === "label") return /* @__PURE__ */ jsx(ContextMenuGroup, { children: /* @__PURE__ */ jsx(ContextMenuLabel, { children: item.label }) }, key);
33
+ if (item.type === "checkbox") return /* @__PURE__ */ jsxs(ContextMenuCheckboxItem, {
34
+ checked: item.checked,
35
+ onCheckedChange: item.onCheckedChange,
36
+ disabled: item.disabled,
37
+ children: [item.label, item.shortcut && /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut })]
38
+ }, key);
39
+ if (item.type === "radio-group" && item.radioOptions) return /* @__PURE__ */ jsxs(ContextMenuRadioGroup, {
40
+ value: item.radioValue,
41
+ onValueChange: item.onRadioChange,
42
+ children: [item.label && /* @__PURE__ */ jsx(ContextMenuLabel, { children: item.label }), item.radioOptions.map((opt) => /* @__PURE__ */ jsx(ContextMenuRadioItem, {
43
+ value: opt.value,
44
+ children: opt.label
45
+ }, opt.value))]
46
+ }, key);
47
+ 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);
48
+ const Icon = item.icon;
49
+ return /* @__PURE__ */ jsxs(ContextMenuItem, {
50
+ onClick: item.onClick,
51
+ disabled: item.disabled,
52
+ variant: item.variant,
53
+ children: [
54
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
55
+ /* @__PURE__ */ jsx("span", { children: item.label }),
56
+ item.shortcut && /* @__PURE__ */ jsx(ContextMenuShortcut, { children: item.shortcut })
57
+ ]
58
+ }, key);
59
+ }
16
60
 
61
+ //#endregion
17
62
  //#region src/components/drawer-wrapper.tsx
18
63
  const DRAWER_SIZE_CLASSES = {
19
64
  horizontal: {
@@ -149,6 +194,62 @@ const ConfirmDrawer = memo(function ConfirmDrawer({ open, onOpenChange, title =
149
194
  });
150
195
  });
151
196
 
197
+ //#endregion
198
+ //#region src/components/hover-card-wrapper.tsx
199
+ function HoverCardWrapper({ trigger, children, side = "bottom", align = "center", sideOffset = 4, className, contentClassName, openDelay, closeDelay }) {
200
+ return /* @__PURE__ */ jsxs(HoverCard, {
201
+ openDelay,
202
+ closeDelay,
203
+ children: [/* @__PURE__ */ jsx(HoverCardTrigger, {
204
+ className,
205
+ children: trigger
206
+ }), /* @__PURE__ */ jsx(HoverCardContent, {
207
+ side,
208
+ align,
209
+ sideOffset,
210
+ className: cn("w-80", contentClassName),
211
+ children
212
+ })]
213
+ });
214
+ }
215
+ function UserHoverCard({ trigger, user, footer, side = "bottom", className }) {
216
+ const initials = user.initials || user.name.split(" ").map((n) => n[0]).join("").slice(0, 2).toUpperCase();
217
+ return /* @__PURE__ */ jsxs(HoverCardWrapper, {
218
+ trigger,
219
+ side,
220
+ className,
221
+ children: [/* @__PURE__ */ jsxs("div", {
222
+ className: "flex gap-3",
223
+ children: [/* @__PURE__ */ jsxs(Avatar, {
224
+ className: "h-10 w-10 shrink-0",
225
+ children: [user.avatar && /* @__PURE__ */ jsx(AvatarImage, {
226
+ src: user.avatar,
227
+ alt: user.name
228
+ }), /* @__PURE__ */ jsx(AvatarFallback, { children: initials })]
229
+ }), /* @__PURE__ */ jsxs("div", {
230
+ className: "space-y-1 min-w-0",
231
+ children: [
232
+ /* @__PURE__ */ jsx("h4", {
233
+ className: "text-sm font-semibold truncate",
234
+ children: user.name
235
+ }),
236
+ user.username && /* @__PURE__ */ jsxs("p", {
237
+ className: "text-xs text-muted-foreground",
238
+ children: ["@", user.username]
239
+ }),
240
+ user.bio && /* @__PURE__ */ jsx("p", {
241
+ className: "text-sm text-muted-foreground line-clamp-2",
242
+ children: user.bio
243
+ })
244
+ ]
245
+ })]
246
+ }), footer && /* @__PURE__ */ jsx("div", {
247
+ className: "mt-3 pt-3 border-t",
248
+ children: footer
249
+ })]
250
+ });
251
+ }
252
+
152
253
  //#endregion
153
254
  //#region src/components/navigation-bar.tsx
154
255
  function isDropdown(item) {
@@ -164,7 +265,7 @@ function DropdownContent({ item }) {
164
265
  children: [item.featured && /* @__PURE__ */ jsx("div", {
165
266
  className: "w-[180px] shrink-0",
166
267
  children: /* @__PURE__ */ jsxs(NavigationMenuLink, {
167
- href: item.featured.href,
268
+ render: /* @__PURE__ */ jsx(Link, { href: item.featured.href }),
168
269
  className: "flex h-full flex-col justify-end rounded-lg bg-gradient-to-b from-muted/50 to-muted p-4",
169
270
  children: [
170
271
  item.featured.icon && /* @__PURE__ */ jsx("div", {
@@ -186,7 +287,11 @@ function DropdownContent({ item }) {
186
287
  children: item.items.map((link) => {
187
288
  const Icon = link.icon;
188
289
  return /* @__PURE__ */ jsxs(NavigationMenuLink, {
189
- href: link.href,
290
+ render: link.external ? /* @__PURE__ */ jsx("a", {
291
+ href: link.href,
292
+ target: "_blank",
293
+ rel: "noopener noreferrer"
294
+ }) : /* @__PURE__ */ jsx(Link, { href: link.href }),
190
295
  className: cn("block select-none rounded-md p-2.5", link.isActive && "bg-accent/50"),
191
296
  children: [/* @__PURE__ */ jsxs("div", {
192
297
  className: "flex items-center gap-2",
@@ -327,12 +432,13 @@ function NavigationBar({ brand, items, actions, sticky = true, bordered = true,
327
432
  children: /* @__PURE__ */ jsx(NavigationMenuList, { children: items.map((item, idx) => {
328
433
  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
434
  return /* @__PURE__ */ jsx(NavigationMenuItem, { children: /* @__PURE__ */ jsx(NavigationMenuLink, {
330
- href: item.href,
331
- className: cn(navigationMenuTriggerStyle(), item.isActive && "bg-accent/50"),
332
- ...item.external ? {
435
+ render: item.external ? /* @__PURE__ */ jsx("a", {
436
+ href: item.href,
333
437
  target: "_blank",
334
438
  rel: "noopener noreferrer"
335
- } : {},
439
+ }) : /* @__PURE__ */ jsx(Link, { href: item.href }),
440
+ className: cn(navigationMenuTriggerStyle(), item.isActive && "bg-accent/50"),
441
+ "aria-current": item.isActive ? "page" : void 0,
336
442
  children: item.title
337
443
  }) }, item.href);
338
444
  }) })
@@ -355,106 +461,5 @@ function NavigationBar({ brand, items, actions, sticky = true, bordered = true,
355
461
  });
356
462
  }
357
463
 
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
464
  //#endregion
460
465
  export { ConfirmDrawer, ContextMenuWrapper, DrawerWrapper, FormDrawer, HoverCardWrapper, NavigationBar, UserHoverCard };