@sikka/hawa 0.23.8-next → 0.23.10-next

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 (65) hide show
  1. package/dist/DropdownMenu-jh4puuXw.d.ts +95 -0
  2. package/dist/DropdownMenu-vm2kRAhL.d.mts +95 -0
  3. package/dist/Radio-2ZwcMDWt.d.ts +74 -0
  4. package/dist/Radio-5ZANA8Vh.d.mts +74 -0
  5. package/dist/SimpleTable-EE4ejgUR.d.mts +97 -0
  6. package/dist/SimpleTable-vY1ziD-2.d.ts +97 -0
  7. package/dist/Toast-jAb16JQg.d.mts +23 -0
  8. package/dist/Toast-xcELwcIX.d.ts +23 -0
  9. package/dist/blocks/auth/index.d.mts +202 -0
  10. package/dist/blocks/auth/index.d.ts +202 -0
  11. package/dist/blocks/auth/index.js +4182 -0
  12. package/dist/blocks/auth/index.mjs +1057 -0
  13. package/dist/blocks/feedback/index.d.mts +74 -0
  14. package/dist/blocks/feedback/index.d.ts +74 -0
  15. package/dist/blocks/feedback/index.js +1531 -0
  16. package/dist/blocks/feedback/index.mjs +493 -0
  17. package/dist/blocks/index.d.mts +480 -0
  18. package/dist/blocks/index.d.ts +480 -0
  19. package/dist/blocks/index.js +8119 -0
  20. package/dist/blocks/index.mjs +2535 -0
  21. package/dist/blocks/misc/index.d.mts +90 -0
  22. package/dist/blocks/misc/index.d.ts +90 -0
  23. package/dist/blocks/misc/index.js +1163 -0
  24. package/dist/blocks/misc/index.mjs +322 -0
  25. package/dist/blocks/pricing/index.d.mts +93 -0
  26. package/dist/blocks/pricing/index.d.ts +93 -0
  27. package/dist/blocks/pricing/index.js +3320 -0
  28. package/dist/blocks/pricing/index.mjs +2161 -0
  29. package/dist/chunk-2R2QPJT7.mjs +7519 -0
  30. package/dist/chunk-343SRWR4.mjs +146 -0
  31. package/dist/chunk-677VOLD4.mjs +464 -0
  32. package/dist/chunk-A25EXELT.mjs +131 -0
  33. package/dist/chunk-F6TKEDDP.mjs +57 -0
  34. package/dist/chunk-FNVYY7ND.mjs +22 -0
  35. package/dist/chunk-P2O6R3S6.mjs +268 -0
  36. package/dist/chunk-QGKW5R5F.mjs +196 -0
  37. package/dist/chunk-TR56G3NM.mjs +2350 -0
  38. package/dist/chunk-UAVBFK53.mjs +346 -0
  39. package/dist/commonTypes-CKtkuNFH.d.mts +11 -0
  40. package/dist/commonTypes-CKtkuNFH.d.ts +11 -0
  41. package/dist/commonTypes-MxCJyrHv.d.mts +8 -0
  42. package/dist/commonTypes-MxCJyrHv.d.ts +8 -0
  43. package/dist/elements/index.d.mts +715 -0
  44. package/dist/elements/index.d.ts +715 -0
  45. package/dist/elements/index.js +7719 -0
  46. package/dist/elements/index.mjs +285 -0
  47. package/dist/hooks/index.d.mts +107 -0
  48. package/dist/hooks/index.d.ts +107 -0
  49. package/dist/hooks/index.js +451 -0
  50. package/dist/hooks/index.mjs +254 -0
  51. package/dist/index.d.mts +1905 -0
  52. package/dist/index.d.ts +1905 -0
  53. package/dist/index.js +11987 -0
  54. package/dist/index.mjs +11760 -0
  55. package/dist/layout/index.d.mts +249 -0
  56. package/dist/layout/index.d.ts +249 -0
  57. package/dist/layout/index.js +4373 -0
  58. package/dist/layout/index.mjs +1381 -0
  59. package/dist/textTypes-559CaoOV.d.mts +88 -0
  60. package/dist/textTypes-559CaoOV.d.ts +88 -0
  61. package/dist/types/index.d.mts +115 -0
  62. package/dist/types/index.d.ts +115 -0
  63. package/dist/types/index.js +18 -0
  64. package/dist/types/index.mjs +0 -0
  65. package/package.json +1 -1
@@ -0,0 +1,1381 @@
1
+ import {
2
+ useBreakpoint
3
+ } from "../chunk-FNVYY7ND.mjs";
4
+ import {
5
+ Button,
6
+ Card,
7
+ CardContent,
8
+ CardTitle,
9
+ Chip,
10
+ DropdownMenu,
11
+ Logos,
12
+ Sheet,
13
+ SheetContent,
14
+ SheetTrigger,
15
+ Skeleton,
16
+ Tooltip,
17
+ cn
18
+ } from "../chunk-2R2QPJT7.mjs";
19
+ import "../chunk-343SRWR4.mjs";
20
+
21
+ // components/layout/Stats.tsx
22
+ import React from "react";
23
+ var Stats = ({
24
+ label,
25
+ icon,
26
+ isLoading,
27
+ number,
28
+ helperText,
29
+ helperTextColor = "default",
30
+ chart,
31
+ variant = "default",
32
+ ...props
33
+ }) => {
34
+ let helperTextColorStyles = {
35
+ default: "",
36
+ positive: "hawa-text-green-600 dark:hawa-text-green-500",
37
+ negative: "hawa-text-red-600 dark:hawa-text-red-500",
38
+ muted: "hawa-text-muted-foreground"
39
+ };
40
+ return /* @__PURE__ */ React.createElement(Card, { ...props, clickable: Boolean(props.onClick) }, /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-between hawa-p-4" }, /* @__PURE__ */ React.createElement(CardTitle, { className: "hawa-text-sm hawa-font-medium" }, label), icon && /* @__PURE__ */ React.createElement("span", null, icon)), /* @__PURE__ */ React.createElement(CardContent, { className: "hawa-transition-all" }, isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-8 hawa-w-3/4" }) : /* @__PURE__ */ React.createElement("div", { className: "hawa-text-2xl hawa-font-bold" }, number), helperText && /* @__PURE__ */ React.createElement(
41
+ "div",
42
+ {
43
+ className: cn(
44
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-transition-all",
45
+ helperTextColorStyles[helperTextColor],
46
+ helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
47
+ )
48
+ },
49
+ isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-mt-2 hawa-h-4 hawa-w-1/2" }) : helperText
50
+ ), chart && (isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-mt-2 hawa-h-4 hawa-w-1/2" }) : chart)));
51
+ };
52
+
53
+ // components/layout/Sidebar.tsx
54
+ import * as React2 from "react";
55
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
56
+ var Accordion = AccordionPrimitive.Root;
57
+ var triggerStyles = "hawa-flex hawa-flex-1 hawa-items-center hawa-duration-75 hawa-select-none hawa-cursor-pointer hawa-rounded hawa-justify-between hawa-p-2 hawa-px-3 hawa-font-medium hawa-transition-all [&[data-state=open]>svg]:hawa--rotate-90";
58
+ var AccordionItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(AccordionPrimitive.Item, { ref, className: cn(className), ...props }));
59
+ AccordionItem.displayName = "AccordionItem";
60
+ var AccordionTrigger = React2.forwardRef(({ className, showArrow, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(AccordionPrimitive.Header, { className: "flex" }, /* @__PURE__ */ React2.createElement(
61
+ AccordionPrimitive.Trigger,
62
+ {
63
+ ref,
64
+ className: cn(triggerStyles, className),
65
+ ...props
66
+ },
67
+ children,
68
+ showArrow && /* @__PURE__ */ React2.createElement(
69
+ "svg",
70
+ {
71
+ "aria-label": "Chevron Right Icon",
72
+ stroke: "currentColor",
73
+ fill: "currentColor",
74
+ viewBox: "0 0 16 16",
75
+ height: "1em",
76
+ width: "1em",
77
+ className: "hawa-icon hawa-shrink-0 hawa-rotate-90 hawa-transition-transform hawa-duration-200"
78
+ },
79
+ /* @__PURE__ */ React2.createElement("path", { d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" })
80
+ )
81
+ )));
82
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
83
+ var AccordionContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(
84
+ AccordionPrimitive.Content,
85
+ {
86
+ ref,
87
+ className: cn(
88
+ "hawa-overflow-hidden hawa-text-sm hawa-transition-all data-[state=closed]:hawa-animate-accordion-up data-[state=open]:hawa-animate-accordion-down",
89
+ className
90
+ ),
91
+ ...props
92
+ },
93
+ /* @__PURE__ */ React2.createElement("div", null, children)
94
+ ));
95
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
96
+ var SidebarGroup = ({
97
+ title,
98
+ items,
99
+ selectedItem,
100
+ openedItem,
101
+ setOpenedItem,
102
+ onItemClick,
103
+ onSubItemClick,
104
+ direction,
105
+ isOpen
106
+ }) => {
107
+ return /* @__PURE__ */ React2.createElement("div", { className: "hawa-m-2" }, title && /* @__PURE__ */ React2.createElement("h3", { className: "hawa-mb-1 hawa-font-bold" }, title), /* @__PURE__ */ React2.createElement("ul", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React2.createElement(
108
+ Accordion,
109
+ {
110
+ value: openedItem,
111
+ type: "single",
112
+ onValueChange: (e) => {
113
+ setOpenedItem(e);
114
+ },
115
+ collapsible: true,
116
+ className: "hawa-flex hawa-flex-col hawa-gap-1"
117
+ },
118
+ items.map((item, idx) => /* @__PURE__ */ React2.createElement(
119
+ SidebarItem,
120
+ {
121
+ isOpen,
122
+ selectedItem,
123
+ key: idx,
124
+ direction,
125
+ item,
126
+ onItemClick,
127
+ onSubItemClick
128
+ }
129
+ ))
130
+ )));
131
+ };
132
+ var SidebarItem = ({
133
+ item,
134
+ onItemClick,
135
+ onSubItemClick,
136
+ direction,
137
+ isOpen = true,
138
+ ...props
139
+ }) => {
140
+ const getSelectedStyle = (value) => {
141
+ return props.selectedItem === value ? "hawa-bg-primary/90 hawa-text-primary-foreground hawa-cursor-default" : "hover:hawa-bg-primary/10";
142
+ };
143
+ if (item.subitems) {
144
+ return /* @__PURE__ */ React2.createElement(
145
+ AccordionItem,
146
+ {
147
+ value: item.value,
148
+ className: "hawa-overflow-x-clip ",
149
+ dir: direction
150
+ },
151
+ /* @__PURE__ */ React2.createElement(
152
+ AccordionTrigger,
153
+ {
154
+ className: cn(
155
+ "hawa-w-full hawa-overflow-x-clip",
156
+ props.selectedItem === item.value ? "hawa-cursor-default hawa-bg-primary hawa-text-primary-foreground" : "hawa-h-10 hover:hawa-bg-primary/10",
157
+ item.subitems && item.subitems.some(
158
+ (subitem) => props.selectedItem === subitem.value
159
+ ) ? "hawa-bg-primary/80 hawa-text-primary-foreground hover:hawa-bg-primary/80" : ""
160
+ ),
161
+ showArrow: isOpen
162
+ },
163
+ /* @__PURE__ */ React2.createElement(
164
+ "div",
165
+ {
166
+ className: cn(
167
+ "hawa-flex hawa-h-fit hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2"
168
+ )
169
+ },
170
+ item.icon && item.icon,
171
+ /* @__PURE__ */ React2.createElement(
172
+ "span",
173
+ {
174
+ className: cn(
175
+ "hawa-transition-all ",
176
+ isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
177
+ )
178
+ },
179
+ item.label
180
+ )
181
+ )
182
+ ),
183
+ item.subitems && /* @__PURE__ */ React2.createElement(AccordionContent, { className: "hawa-mt-1 hawa-h-full hawa-rounded" }, /* @__PURE__ */ React2.createElement(
184
+ "div",
185
+ {
186
+ className: cn(
187
+ "hawa-flex hawa-h-full hawa-flex-col hawa-gap-2 hawa-bg-foreground/5 hawa-p-1"
188
+ )
189
+ },
190
+ item.subitems.map((subitem, idx) => /* @__PURE__ */ React2.createElement(
191
+ "a",
192
+ {
193
+ href: subitem.slug,
194
+ key: idx,
195
+ onMouseDown: (e) => {
196
+ if (subitem.onMouseDown) {
197
+ subitem.onMouseDown(e);
198
+ }
199
+ },
200
+ onClick: (e) => {
201
+ e.stopPropagation();
202
+ if (subitem.onClick) {
203
+ subitem.onClick(e);
204
+ }
205
+ if (onSubItemClick) {
206
+ onSubItemClick([item.value, subitem.value]);
207
+ }
208
+ },
209
+ className: cn(
210
+ "hawa-flex hawa-h-full hawa-cursor-pointer hawa-flex-row hawa-items-center hawa-gap-2 hawa-overflow-x-clip hawa-whitespace-nowrap hawa-rounded hawa-p-2 hawa-transition-all",
211
+ // bg-foreground/10
212
+ getSelectedStyle(subitem.value)
213
+ )
214
+ },
215
+ subitem.icon && subitem.icon,
216
+ subitem.label
217
+ ))
218
+ ))
219
+ );
220
+ } else {
221
+ return /* @__PURE__ */ React2.createElement(
222
+ "a",
223
+ {
224
+ href: item.slug,
225
+ dir: direction,
226
+ onMouseDown: (e) => {
227
+ if (item.onMouseDown) {
228
+ item.onMouseDown(e);
229
+ }
230
+ },
231
+ onClick: (e) => {
232
+ if (item.onClick) {
233
+ item.onClick(e);
234
+ }
235
+ if (onItemClick) {
236
+ onItemClick([item.value]);
237
+ }
238
+ },
239
+ className: cn(
240
+ triggerStyles,
241
+ getSelectedStyle(item.value),
242
+ "hawa-overflow-x-clip "
243
+ )
244
+ },
245
+ /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, item.icon && item.icon, /* @__PURE__ */ React2.createElement(
246
+ "span",
247
+ {
248
+ className: cn(
249
+ "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-transition-all",
250
+ isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
251
+ )
252
+ },
253
+ item.label,
254
+ " ",
255
+ item.badge && /* @__PURE__ */ React2.createElement(Chip, { label: item.badge.label, color: "hyper", size: "small" })
256
+ ))
257
+ );
258
+ }
259
+ };
260
+
261
+ // components/layout/Copyrights.tsx
262
+ import React3 from "react";
263
+ var Copyrights = (props) => {
264
+ return /* @__PURE__ */ React3.createElement("div", { className: "hawa-my-2 hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-1 hawa-text-xs hawa-text-gray-400" }, props.withLogo ? /* @__PURE__ */ React3.createElement("a", { href: props.onLogoClicked }, /* @__PURE__ */ React3.createElement("div", { className: "hawa-cursor-pointer" }, /* @__PURE__ */ React3.createElement("image", { href: props.logoURL, width: 100, height: 50 }))) : null, /* @__PURE__ */ React3.createElement("div", null, props.version), props.credits ? props.credits : null);
265
+ };
266
+
267
+ // components/layout/Navbar.tsx
268
+ import React4, { useState } from "react";
269
+
270
+ // components/elements/Collapsible.tsx
271
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
272
+ var Collapsible = CollapsiblePrimitive.Root;
273
+ var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
274
+ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
275
+
276
+ // components/layout/Navbar.tsx
277
+ var Navbar = ({
278
+ backgroundColor,
279
+ logo,
280
+ handleLogoClick,
281
+ ...props
282
+ }) => {
283
+ var _a, _b;
284
+ const [isOpen, setIsOpen] = useState(false);
285
+ return /* @__PURE__ */ React4.createElement("nav", { className: " hawa-sticky hawa-top-2 hawa-transition-all" }, /* @__PURE__ */ React4.createElement(
286
+ Collapsible,
287
+ {
288
+ className: "hawa-relative hawa-m-2 hawa-rounded hawa-p-2",
289
+ style: { backgroundColor: backgroundColor || "#1f2937" }
290
+ },
291
+ /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between hawa-px-3 " }, /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-items-center" }, /* @__PURE__ */ React4.createElement(
292
+ "div",
293
+ {
294
+ className: "hawa-p-1.5 hawa-text-xl hawa-font-bold hawa-text-white",
295
+ onClick: () => {
296
+ if (handleLogoClick) {
297
+ handleLogoClick();
298
+ }
299
+ }
300
+ },
301
+ logo
302
+ )), /* @__PURE__ */ React4.createElement("div", { className: "hawa-hidden md:hawa-flex " }, (_a = props.menuItems) == null ? void 0 : _a.map((item, i) => /* @__PURE__ */ React4.createElement(
303
+ "div",
304
+ {
305
+ key: i,
306
+ onClick: item.action,
307
+ className: "hawa-cursor-pointer hawa-rounded hawa-p-1.5 hawa-px-2 hawa-text-center hawa-text-sm hawa-text-white hawa-transition-all hover:hawa-bg-gray-300 hover:hawa-text-black"
308
+ },
309
+ item.label
310
+ ))), /* @__PURE__ */ React4.createElement("div", { className: "hawa-m-0 hawa-flex hawa-h-fit hawa-p-0 md:hawa-hidden" }, /* @__PURE__ */ React4.createElement(
311
+ CollapsibleTrigger2,
312
+ {
313
+ onClick: () => setIsOpen(!isOpen),
314
+ className: "hawa-h-full hawa-text-white selection:hawa-p-0 ",
315
+ "aria-label": "Toggle menu"
316
+ },
317
+ /* @__PURE__ */ React4.createElement(
318
+ "svg",
319
+ {
320
+ xmlns: "http://www.w3.org/2000/svg",
321
+ width: "24",
322
+ height: "24",
323
+ viewBox: "0 0 24 24",
324
+ fill: "none",
325
+ stroke: "currentColor",
326
+ strokeWidth: "2",
327
+ strokeLinecap: "round",
328
+ strokeLinejoin: "round",
329
+ className: cn(
330
+ "hawa-fixed hawa-h-6 hawa-w-6",
331
+ isOpen ? "hawa-invisible" : "hawa-visible"
332
+ )
333
+ },
334
+ /* @__PURE__ */ React4.createElement("line", { x1: "4", x2: "20", y1: "12", y2: "12" }),
335
+ /* @__PURE__ */ React4.createElement("line", { x1: "4", x2: "20", y1: "6", y2: "6" }),
336
+ /* @__PURE__ */ React4.createElement("line", { x1: "4", x2: "20", y1: "18", y2: "18" })
337
+ ),
338
+ /* @__PURE__ */ React4.createElement(
339
+ "svg",
340
+ {
341
+ xmlns: "http://www.w3.org/2000/svg",
342
+ width: "24",
343
+ height: "24",
344
+ viewBox: "0 0 24 24",
345
+ fill: "none",
346
+ stroke: "currentColor",
347
+ strokeWidth: "2",
348
+ strokeLinecap: "round",
349
+ strokeLinejoin: "round",
350
+ className: cn(
351
+ "hawa-h-6 hawa-w-6",
352
+ !isOpen ? "hawa-invisible" : "hawa-visible"
353
+ )
354
+ },
355
+ /* @__PURE__ */ React4.createElement("path", { d: "M18 6 6 18" }),
356
+ /* @__PURE__ */ React4.createElement("path", { d: "m6 6 12 12" })
357
+ )
358
+ ))),
359
+ /* @__PURE__ */ React4.createElement(
360
+ CollapsibleContent2,
361
+ {
362
+ className: cn(
363
+ "data-[state=closed]:hawa-opacity-0",
364
+ "data-[state=open]:hawa-animate-in",
365
+ "data-[state=open]:hawa-fade-in-90",
366
+ "hawa-absolute hawa-left-0 hawa-top-[60px] hawa-flex hawa-flex-col hawa-rounded hawa-border hawa-bg-gray-200 hawa-p-1 hawa-transition-all"
367
+ // "hawa-transition-all hawa-bg-gray-400 hawa-fixed hawa-left-0 hawa-top-[72px] hawa-w-full hawa-flex hawa-flex-col"
368
+ ),
369
+ style: {
370
+ width: "calc(100%)",
371
+ zIndex: -100
372
+ }
373
+ },
374
+ (_b = props.menuItems) == null ? void 0 : _b.map((item, i) => /* @__PURE__ */ React4.createElement(
375
+ "div",
376
+ {
377
+ key: i,
378
+ onClick: item.action,
379
+ className: "hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-px-10 hawa-text-center hawa-text-black hawa-transition-all hover:hawa-bg-gray-300"
380
+ },
381
+ item.label
382
+ ))
383
+ )
384
+ ));
385
+ };
386
+
387
+ // components/layout/AppLayout.tsx
388
+ import React5, { useEffect, useRef, useState as useState2 } from "react";
389
+ var AppLayout = ({
390
+ profileMenuWidth = "default",
391
+ DrawerFooterActions,
392
+ design = "default",
393
+ direction = "ltr",
394
+ drawerSize = "md",
395
+ currentPage,
396
+ clickedItem,
397
+ setKeepOpen,
398
+ keepOpen,
399
+ ...props
400
+ }) => {
401
+ var _a, _b;
402
+ let closeDrawerWidth = 56;
403
+ let openDrawerWidth = 200;
404
+ let drawerSizeStyle = {
405
+ opened: {
406
+ sm: "100",
407
+ md: openDrawerWidth,
408
+ lg: "250"
409
+ },
410
+ closed: {
411
+ sm: closeDrawerWidth,
412
+ md: closeDrawerWidth,
413
+ lg: closeDrawerWidth
414
+ }
415
+ };
416
+ const ref = useRef(null);
417
+ const isRTL = direction === "rtl";
418
+ const [openedSidebarItem, setOpenedSidebarItem] = useState2("");
419
+ const [size, setSize] = useState2(1200);
420
+ const [openSideMenu, setOpenSideMenu] = useState2(true);
421
+ const drawerSizeCondition = size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0;
422
+ useEffect(() => {
423
+ if (typeof window !== "undefined") {
424
+ const resize = () => {
425
+ setSize(window.innerWidth);
426
+ };
427
+ resize();
428
+ window.addEventListener("resize", resize);
429
+ return () => {
430
+ window.removeEventListener("resize", resize);
431
+ };
432
+ }
433
+ }, []);
434
+ useEffect(() => {
435
+ if (size > 600) {
436
+ setOpenSideMenu(keepOpen);
437
+ } else {
438
+ setOpenSideMenu(false);
439
+ }
440
+ }, [size]);
441
+ useEffect(() => {
442
+ const handleClickOutside = (event) => {
443
+ if (ref.current && !ref.current.contains(event.target) && !keepOpen) {
444
+ setOpenSideMenu(false);
445
+ }
446
+ };
447
+ document.addEventListener("click", handleClickOutside, true);
448
+ return () => {
449
+ document.removeEventListener("click", handleClickOutside, true);
450
+ };
451
+ }, [keepOpen]);
452
+ return /* @__PURE__ */ React5.createElement("div", { className: "hawa-fixed hawa-left-0" }, props.topBar && /* @__PURE__ */ React5.createElement(
453
+ "div",
454
+ {
455
+ className: cn(
456
+ "hawa-fixed hawa-left-0 hawa-right-0 hawa-top-0 hawa-z-0 hawa-flex hawa-h-14 hawa-w-full hawa-items-center hawa-justify-between hawa-bg-primary-foreground hawa-p-2",
457
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
458
+ )
459
+ },
460
+ size > 600 ? /* @__PURE__ */ React5.createElement(
461
+ "div",
462
+ {
463
+ className: cn(
464
+ "dark:hawa-text-white",
465
+ isRTL ? [
466
+ size > 600 ? "hawa-mr-14" : "hawa-mr-2",
467
+ keepOpen ? "hawa-mr-40" : ""
468
+ ] : [
469
+ size > 600 ? "hawa-ml-14" : "hawa-ml-2",
470
+ keepOpen ? "hawa-ml-40" : ""
471
+ ]
472
+ ),
473
+ style: isRTL ? {
474
+ marginRight: `${drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize]}px`
475
+ } : {
476
+ marginLeft: `${drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize]}px`
477
+ }
478
+ },
479
+ props.pageTitle
480
+ ) : (
481
+ // Mobile Drawer Menu Button
482
+ /* @__PURE__ */ React5.createElement(
483
+ "div",
484
+ {
485
+ dir: direction,
486
+ className: "hawa-flex hawa-items-center hawa-justify-center hawa-gap-0.5"
487
+ },
488
+ /* @__PURE__ */ React5.createElement(
489
+ "div",
490
+ {
491
+ onClick: () => setOpenSideMenu(true),
492
+ className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
493
+ },
494
+ /* @__PURE__ */ React5.createElement(MenuIcon, null)
495
+ ),
496
+ props.pageTitle ? /* @__PURE__ */ React5.createElement("div", { className: "hawa-text-sm" }, props.pageTitle) : /* @__PURE__ */ React5.createElement("div", null)
497
+ )
498
+ ),
499
+ /* @__PURE__ */ React5.createElement(
500
+ "div",
501
+ {
502
+ className: cn(
503
+ "hawa-flex hawa-gap-2 dark:hawa-text-white",
504
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
505
+ )
506
+ },
507
+ size > 600 ? /* @__PURE__ */ React5.createElement(
508
+ "div",
509
+ {
510
+ className: isRTL ? "hawa-text-left hawa-text-xs" : "hawa-text-right hawa-text-xs"
511
+ },
512
+ /* @__PURE__ */ React5.createElement("div", { className: "hawa-font-bold" }, props.username),
513
+ " ",
514
+ /* @__PURE__ */ React5.createElement("div", null, props.email)
515
+ ) : null,
516
+ /* @__PURE__ */ React5.createElement(
517
+ DropdownMenu,
518
+ {
519
+ triggerClassname: "hawa-mx-2",
520
+ align: "end",
521
+ alignOffset: 8,
522
+ side: "bottom",
523
+ sideOffset: 5,
524
+ width: profileMenuWidth,
525
+ direction: isRTL ? "rtl" : "ltr",
526
+ items: props.profileMenuItems,
527
+ onItemSelect: (e) => console.log("selecting item ", e),
528
+ trigger: /* @__PURE__ */ React5.createElement("div", { className: "hawa-relative hawa-h-8 hawa-w-8 hawa-cursor-pointer hawa-overflow-clip hawa-rounded hawa-ring-1 hawa-ring-primary/30 dark:hawa-bg-gray-600" }, props.avatarImage ? /* @__PURE__ */ React5.createElement("img", { src: props.avatarImage, alt: "User Avatar" }) : /* @__PURE__ */ React5.createElement(
529
+ "svg",
530
+ {
531
+ "aria-label": "Avatar Icon",
532
+ className: "hawa-absolute hawa--left-1 hawa-h-10 hawa-w-10 hawa-text-gray-400",
533
+ fill: "currentColor",
534
+ viewBox: "0 0 20 20"
535
+ },
536
+ /* @__PURE__ */ React5.createElement(
537
+ "path",
538
+ {
539
+ fillRule: "evenodd",
540
+ d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
541
+ clipRule: "evenodd"
542
+ }
543
+ )
544
+ ))
545
+ }
546
+ )
547
+ )
548
+ ), /* @__PURE__ */ React5.createElement(
549
+ "div",
550
+ {
551
+ className: cn(
552
+ "hawa-fixed hawa-z-0 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all",
553
+ isRTL ? "hawa-right-0 hawa-top-0 hawa-h-14" : "hawa-left-0 hawa-top-0 hawa-h-14",
554
+ "hawa-h-[calc(100dvh)]"
555
+ ),
556
+ style: {
557
+ width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
558
+ },
559
+ onMouseEnter: () => {
560
+ setOpenSideMenu(true);
561
+ },
562
+ onMouseLeave: () => {
563
+ if (size > 600) {
564
+ if (keepOpen) {
565
+ setOpenSideMenu(true);
566
+ } else {
567
+ setOpenedSidebarItem("");
568
+ setOpenSideMenu(false);
569
+ }
570
+ } else {
571
+ setOpenSideMenu(false);
572
+ }
573
+ },
574
+ ref
575
+ },
576
+ /* @__PURE__ */ React5.createElement(
577
+ "div",
578
+ {
579
+ onClick: props.onLogoClick,
580
+ dir: direction,
581
+ className: cn(
582
+ "hawa-fixed hawa-z-50 hawa-mb-2 hawa-flex hawa-h-14 hawa-w-full hawa-flex-row hawa-items-center hawa-justify-center hawa-bg-primary-foreground hawa-transition-all",
583
+ props.onLogoClick && "hawa-cursor-pointer"
584
+ ),
585
+ style: {
586
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : 56}px` : `${openSideMenu ? openDrawerWidth : 0}px`
587
+ }
588
+ },
589
+ openSideMenu && props.header && props.header,
590
+ !props.header && /* @__PURE__ */ React5.createElement(
591
+ "img",
592
+ {
593
+ className: cn(
594
+ "hawa-h-9 hawa-opacity-0 hawa-transition-all",
595
+ !openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100"
596
+ ),
597
+ src: props.logoLink
598
+ }
599
+ ),
600
+ size > 600 ? /* @__PURE__ */ React5.createElement(
601
+ "img",
602
+ {
603
+ className: cn(
604
+ "hawa-fixed hawa-h-9 hawa-transition-all",
605
+ isRTL ? "hawa-right-2.5 hawa-top-2.5" : "hawa-left-2.5 hawa-top-2.5",
606
+ openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100"
607
+ ),
608
+ src: props.logoSymbol
609
+ }
610
+ ) : null
611
+ ),
612
+ /* @__PURE__ */ React5.createElement(
613
+ "div",
614
+ {
615
+ className: cn(
616
+ "hawa-fixed hawa-bottom-14 hawa-top-14 hawa-bg-primary-foreground hawa-p-0 hawa-py-2 hawa-transition-all",
617
+ openSideMenu ? "hawa-overflow-auto" : "hawa-overflow-hidden"
618
+ ),
619
+ style: {
620
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : drawerSizeCondition}px` : `${openSideMenu ? openDrawerWidth : 0}px`
621
+ }
622
+ },
623
+ /* @__PURE__ */ React5.createElement(
624
+ SidebarGroup,
625
+ {
626
+ direction,
627
+ onItemClick: (values) => {
628
+ if (clickedItem) {
629
+ clickedItem(values);
630
+ }
631
+ },
632
+ onSubItemClick: (values) => {
633
+ if (clickedItem) {
634
+ clickedItem(values);
635
+ }
636
+ },
637
+ selectedItem: currentPage,
638
+ openedItem: openedSidebarItem,
639
+ setOpenedItem: (e) => setOpenedSidebarItem(e),
640
+ isOpen: keepOpen || openSideMenu,
641
+ items: props.drawerItems
642
+ }
643
+ )
644
+ ),
645
+ /* @__PURE__ */ React5.createElement(
646
+ "div",
647
+ {
648
+ className: cn(
649
+ "hawa-fixed hawa-flex hawa-h-14 hawa-items-center hawa-justify-center hawa-gap-2 hawa-overflow-clip hawa-bg-primary-foreground hawa-transition-all",
650
+ direction === "rtl" ? "hawa-flex-row-reverse" : "hawa-flex-row",
651
+ "hawa-bottom-0"
652
+ ),
653
+ style: {
654
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : 56}px` : `${openSideMenu ? openDrawerWidth : 0}px`
655
+ }
656
+ },
657
+ DrawerFooterActions && openSideMenu ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, DrawerFooterActions) : null,
658
+ size > 600 && openSideMenu ? /* @__PURE__ */ React5.createElement(
659
+ Tooltip,
660
+ {
661
+ side: "left",
662
+ delayDuration: 500,
663
+ content: keepOpen ? ((_a = props.texts) == null ? void 0 : _a.collapseSidebar) || "Collapse Sidebar" : ((_b = props.texts) == null ? void 0 : _b.expandSidebar) || "Expand Sidebar",
664
+ triggerProps: { asChild: true }
665
+ },
666
+ /* @__PURE__ */ React5.createElement(
667
+ Button,
668
+ {
669
+ variant: "outline",
670
+ onClick: () => {
671
+ const newKeepOpenState = !keepOpen;
672
+ if (props.onDrawerExpand) {
673
+ props.onDrawerExpand(newKeepOpenState);
674
+ }
675
+ setKeepOpen(newKeepOpenState);
676
+ },
677
+ size: "smallIcon"
678
+ },
679
+ /* @__PURE__ */ React5.createElement(
680
+ "svg",
681
+ {
682
+ className: cn(
683
+ "hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-text-primary hawa-transition-all disabled:hawa-bg-gray-200 ",
684
+ keepOpen ? isRTL ? "hawa--rotate-90" : "hawa-rotate-90" : isRTL ? "hawa-rotate-90" : "hawa--rotate-90"
685
+ ),
686
+ fill: "currentColor",
687
+ viewBox: "0 0 20 20"
688
+ },
689
+ /* @__PURE__ */ React5.createElement(
690
+ "path",
691
+ {
692
+ fillRule: "evenodd",
693
+ d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
694
+ clipRule: "evenodd"
695
+ }
696
+ )
697
+ )
698
+ )
699
+ ) : null
700
+ )
701
+ ), /* @__PURE__ */ React5.createElement(
702
+ "div",
703
+ {
704
+ className: "hawa-fixed -hawa-z-10 hawa-overflow-y-auto hawa-transition-all",
705
+ style: isRTL ? {
706
+ height: `calc(100% - ${props.topBar ? "56" : "0"}px)`,
707
+ width: `calc(100% - ${drawerSizeCondition}px)`,
708
+ left: "0px",
709
+ top: props.topBar ? "56px" : "0px"
710
+ } : {
711
+ height: `calc(100% - ${props.topBar ? "56" : "0"}px)`,
712
+ width: `calc(100% - ${drawerSizeCondition}px)`,
713
+ left: `${drawerSizeCondition}px`,
714
+ top: props.topBar ? "56px" : "0px"
715
+ }
716
+ },
717
+ props.children
718
+ ));
719
+ };
720
+ var MenuIcon = () => /* @__PURE__ */ React5.createElement(
721
+ "svg",
722
+ {
723
+ "aria-label": "Menu Button",
724
+ stroke: "currentColor",
725
+ fill: "currentColor",
726
+ strokeWidth: 0,
727
+ viewBox: "0 0 20 20",
728
+ "aria-hidden": "true",
729
+ height: "1.6em",
730
+ width: "1.6em"
731
+ },
732
+ /* @__PURE__ */ React5.createElement(
733
+ "path",
734
+ {
735
+ fillRule: "evenodd",
736
+ clipRule: "evenodd",
737
+ d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
738
+ }
739
+ )
740
+ );
741
+
742
+ // components/layout/AppTopbar.tsx
743
+ import React6 from "react";
744
+ var AppTopbar = ({ ...props }) => {
745
+ const isRTL = props.direction === "ltr";
746
+ const size = 1200;
747
+ return /* @__PURE__ */ React6.createElement(
748
+ "div",
749
+ {
750
+ className: cn(
751
+ "hawa-fixed hawa-left-0 hawa-right-0 hawa-top-0 hawa-z-30 hawa-flex hawa-h-14 hawa-w-full hawa-items-center hawa-justify-between hawa-border-b hawa-bg-primary-foreground hawa-p-2",
752
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
753
+ )
754
+ },
755
+ size > 600 ? /* @__PURE__ */ React6.createElement(
756
+ "div",
757
+ null,
758
+ "page title"
759
+ ) : (
760
+ // Mobile Drawer Menu Button
761
+ /* @__PURE__ */ React6.createElement(
762
+ "div",
763
+ {
764
+ dir: props.direction,
765
+ className: "hawa-flex hawa-items-center hawa-justify-center hawa-gap-0.5"
766
+ },
767
+ /* @__PURE__ */ React6.createElement(
768
+ "div",
769
+ {
770
+ className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
771
+ },
772
+ /* @__PURE__ */ React6.createElement(
773
+ "svg",
774
+ {
775
+ stroke: "currentColor",
776
+ fill: "currentColor",
777
+ strokeWidth: 0,
778
+ viewBox: "0 0 20 20",
779
+ "aria-hidden": "true",
780
+ height: "1.6em",
781
+ width: "1.6em"
782
+ },
783
+ /* @__PURE__ */ React6.createElement(
784
+ "path",
785
+ {
786
+ fillRule: "evenodd",
787
+ clipRule: "evenodd",
788
+ d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
789
+ }
790
+ )
791
+ )
792
+ ),
793
+ "Mobile title"
794
+ )
795
+ ),
796
+ /* @__PURE__ */ React6.createElement(
797
+ "div",
798
+ {
799
+ className: cn(
800
+ "hawa-flex hawa-gap-2 dark:hawa-text-white",
801
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
802
+ )
803
+ },
804
+ size > 600 ? /* @__PURE__ */ React6.createElement(
805
+ "div",
806
+ {
807
+ className: isRTL ? "hawa-text-left hawa-text-xs" : "hawa-text-right hawa-text-xs"
808
+ },
809
+ /* @__PURE__ */ React6.createElement("div", { className: "hawa-font-bold" }, props.username),
810
+ " ",
811
+ /* @__PURE__ */ React6.createElement("div", null, props.email)
812
+ ) : null,
813
+ /* @__PURE__ */ React6.createElement(
814
+ DropdownMenu,
815
+ {
816
+ triggerClassname: "hawa-mx-2",
817
+ align: "end",
818
+ alignOffset: 8,
819
+ side: "bottom",
820
+ sideOffset: 5,
821
+ direction: isRTL ? "rtl" : "ltr",
822
+ items: props.profileMenuItems,
823
+ onItemSelect: (e) => console.log("selecting item ", e),
824
+ trigger: /* @__PURE__ */ React6.createElement("div", { className: "hawa-relative hawa-h-8 hawa-w-8 hawa-cursor-pointer hawa-overflow-clip hawa-rounded hawa-ring-1 hawa-ring-primary/30 dark:hawa-bg-gray-600" }, props.avatarImage ? /* @__PURE__ */ React6.createElement("img", { src: props.avatarImage, alt: "User Avatar" }) : /* @__PURE__ */ React6.createElement(
825
+ "svg",
826
+ {
827
+ "aria-label": "Avatar Icon",
828
+ className: "hawa-absolute hawa--left-1 hawa-h-10 hawa-w-10 hawa-text-gray-400",
829
+ fill: "currentColor",
830
+ viewBox: "0 0 20 20"
831
+ },
832
+ /* @__PURE__ */ React6.createElement(
833
+ "path",
834
+ {
835
+ fillRule: "evenodd",
836
+ d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
837
+ clipRule: "evenodd"
838
+ }
839
+ )
840
+ ))
841
+ }
842
+ )
843
+ )
844
+ );
845
+ };
846
+
847
+ // components/layout/AppMenubar.tsx
848
+ import * as React7 from "react";
849
+ import * as MenubarPrimitive from "@radix-ui/react-menubar";
850
+ var MenubarMenu = MenubarPrimitive.Menu;
851
+ var MenubarGroup = MenubarPrimitive.Group;
852
+ var MenubarPortal = MenubarPrimitive.Portal;
853
+ var MenubarSub = MenubarPrimitive.Sub;
854
+ var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
855
+ var Menubar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
856
+ MenubarPrimitive.Root,
857
+ {
858
+ ref,
859
+ className: cn(
860
+ "hawa-flex hawa-h-10 hawa-items-center hawa-space-x-1 hawa-rounded-md hawa-border hawa-bg-background hawa-p-1",
861
+ className
862
+ ),
863
+ ...props
864
+ }
865
+ ));
866
+ Menubar.displayName = MenubarPrimitive.Root.displayName;
867
+ var MenubarTrigger = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
868
+ MenubarPrimitive.Trigger,
869
+ {
870
+ ref,
871
+ className: cn(
872
+ "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground",
873
+ className
874
+ ),
875
+ ...props
876
+ }
877
+ ));
878
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
879
+ var MenubarSubTrigger = React7.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React7.createElement(
880
+ MenubarPrimitive.SubTrigger,
881
+ {
882
+ ref,
883
+ className: cn(
884
+ "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-accent-foreground",
885
+ inset && "pl-8",
886
+ className
887
+ ),
888
+ ...props
889
+ },
890
+ children,
891
+ /* @__PURE__ */ React7.createElement(
892
+ "svg",
893
+ {
894
+ "aria-label": "Chevron Right Icon",
895
+ xmlns: "http://www.w3.org/2000/svg",
896
+ width: "24",
897
+ height: "24",
898
+ viewBox: "0 0 24 24",
899
+ fill: "none",
900
+ stroke: "currentColor",
901
+ strokeWidth: "2",
902
+ strokeLinecap: "round",
903
+ strokeLinejoin: "round",
904
+ className: "hawa-icon hawa-ml-auto"
905
+ },
906
+ /* @__PURE__ */ React7.createElement("path", { d: "m9 18 6-6-6-6" })
907
+ )
908
+ ));
909
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
910
+ var MenubarSubContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
911
+ MenubarPrimitive.SubContent,
912
+ {
913
+ ref,
914
+ className: cn(
915
+ "hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
916
+ className
917
+ ),
918
+ ...props
919
+ }
920
+ ));
921
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
922
+ var MenubarContent = React7.forwardRef(
923
+ ({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ React7.createElement(MenubarPrimitive.Portal, null, /* @__PURE__ */ React7.createElement(
924
+ MenubarPrimitive.Content,
925
+ {
926
+ ref,
927
+ align,
928
+ alignOffset,
929
+ sideOffset,
930
+ className: cn(
931
+ "hawa-z-50 hawa-min-w-[12rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
932
+ className
933
+ ),
934
+ ...props
935
+ }
936
+ ))
937
+ );
938
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName;
939
+ var MenubarItem = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React7.createElement(
940
+ MenubarPrimitive.Item,
941
+ {
942
+ ref,
943
+ className: cn(
944
+ "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
945
+ inset && "pl-8",
946
+ className
947
+ ),
948
+ ...props
949
+ }
950
+ ));
951
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName;
952
+ var MenubarCheckboxItem = React7.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React7.createElement(
953
+ MenubarPrimitive.CheckboxItem,
954
+ {
955
+ ref,
956
+ className: cn(
957
+ "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
958
+ className
959
+ ),
960
+ checked,
961
+ ...props
962
+ },
963
+ /* @__PURE__ */ React7.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React7.createElement(MenubarPrimitive.ItemIndicator, null, /* @__PURE__ */ React7.createElement(
964
+ "svg",
965
+ {
966
+ xmlns: "http://www.w3.org/2000/svg",
967
+ width: "24",
968
+ height: "24",
969
+ viewBox: "0 0 24 24",
970
+ fill: "none",
971
+ stroke: "currentColor",
972
+ strokeWidth: "2",
973
+ strokeLinecap: "round",
974
+ strokeLinejoin: "round",
975
+ className: "hawa-icon"
976
+ },
977
+ /* @__PURE__ */ React7.createElement("path", { d: "M20 6 9 17l-5-5" })
978
+ ))),
979
+ children
980
+ ));
981
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
982
+ var MenubarRadioItem = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React7.createElement(
983
+ MenubarPrimitive.RadioItem,
984
+ {
985
+ ref,
986
+ className: cn(
987
+ "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
988
+ className
989
+ ),
990
+ ...props
991
+ },
992
+ /* @__PURE__ */ React7.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React7.createElement(MenubarPrimitive.ItemIndicator, null, /* @__PURE__ */ React7.createElement(
993
+ "svg",
994
+ {
995
+ xmlns: "http://www.w3.org/2000/svg",
996
+ width: "24",
997
+ height: "24",
998
+ viewBox: "0 0 24 24",
999
+ fill: "none",
1000
+ stroke: "currentColor",
1001
+ strokeWidth: "2",
1002
+ strokeLinecap: "round",
1003
+ strokeLinejoin: "round",
1004
+ className: "hawa-h-2 hawa-w-2 hawa-fill-current"
1005
+ },
1006
+ /* @__PURE__ */ React7.createElement("circle", { cx: "12", cy: "12", r: "10" })
1007
+ ))),
1008
+ children
1009
+ ));
1010
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
1011
+ var MenubarLabel = React7.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React7.createElement(
1012
+ MenubarPrimitive.Label,
1013
+ {
1014
+ ref,
1015
+ className: cn(
1016
+ "hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
1017
+ inset && "hawa-pl-8",
1018
+ className
1019
+ ),
1020
+ ...props
1021
+ }
1022
+ ));
1023
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
1024
+ var MenubarSeparator = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
1025
+ MenubarPrimitive.Separator,
1026
+ {
1027
+ ref,
1028
+ className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
1029
+ ...props
1030
+ }
1031
+ ));
1032
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
1033
+ var MenubarShortcut = ({
1034
+ className,
1035
+ ...props
1036
+ }) => {
1037
+ return /* @__PURE__ */ React7.createElement(
1038
+ "span",
1039
+ {
1040
+ className: cn(
1041
+ "hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-text-muted-foreground",
1042
+ className
1043
+ ),
1044
+ ...props
1045
+ }
1046
+ );
1047
+ };
1048
+ MenubarShortcut.displayname = "MenubarShortcut";
1049
+
1050
+ // components/layout/AppTabs.tsx
1051
+ import React8, { useState as useState3 } from "react";
1052
+ var AppTabs = ({ tabs, ...props }) => {
1053
+ const [selectedIndex, setSelectedIndex] = useState3(0);
1054
+ return /* @__PURE__ */ React8.createElement("div", { className: "hawa-w-full hawa-border-b hawa-bg-gray-100 hawa-p-6 hawa-pb-0 dark:hawa-bg-gray-900 " }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center " }, tabs.map((tab, index) => {
1055
+ const selected = index === selectedIndex;
1056
+ return /* @__PURE__ */ React8.createElement(
1057
+ AppSingleTab,
1058
+ {
1059
+ key: index,
1060
+ tab,
1061
+ onClick: () => setSelectedIndex(index),
1062
+ isSelected: selected
1063
+ }
1064
+ );
1065
+ })));
1066
+ };
1067
+ var AppSingleTab = ({ tab, ...props }) => {
1068
+ return /* @__PURE__ */ React8.createElement(
1069
+ "div",
1070
+ {
1071
+ key: props.key,
1072
+ onClick: props.onClick,
1073
+ className: cn(
1074
+ "hawa-z-10 hawa-flex hawa-translate-y-[1.1px] hawa-select-none hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-p-4 hawa-py-2 hawa-text-sm hawa-transition-all ",
1075
+ "hawa-border",
1076
+ // Always have a border but make it transparent
1077
+ props.isSelected ? "hawa-border hawa-border-b-transparent hawa-bg-background" : "hawa-cursor-pointer hawa-border-transparent hover:hawa-bg-gray-200 dark:hover:hawa-bg-gray-700"
1078
+ )
1079
+ },
1080
+ tab.icon && tab.icon,
1081
+ tab.label
1082
+ );
1083
+ };
1084
+
1085
+ // components/layout/DocsLayout.tsx
1086
+ import React10, { useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
1087
+
1088
+ // components/layout/DocsSidebar.tsx
1089
+ import React9 from "react";
1090
+ var DocsSidebar = ({
1091
+ currentPage: propCurrentPage,
1092
+ pages,
1093
+ direction
1094
+ }) => {
1095
+ const [activePage, setActivePage] = React9.useState(pages[0]);
1096
+ const handlePageClick = (page, event) => {
1097
+ event.preventDefault();
1098
+ setTimeout(() => {
1099
+ setActivePage(page);
1100
+ }, 50);
1101
+ const element = document.getElementById(page);
1102
+ element == null ? void 0 : element.scrollIntoView({ behavior: "smooth", block: "start" });
1103
+ };
1104
+ const getCurrentSection = () => {
1105
+ for (let i = pages.length - 1; i >= 0; i--) {
1106
+ const page = pages[i];
1107
+ const element = document.getElementById(page);
1108
+ const rect = element == null ? void 0 : element.getBoundingClientRect();
1109
+ if (rect) {
1110
+ if (rect.top < window.innerHeight && rect.bottom >= 0) {
1111
+ return page;
1112
+ }
1113
+ }
1114
+ }
1115
+ return pages[0];
1116
+ };
1117
+ React9.useEffect(() => {
1118
+ const handleScroll = () => {
1119
+ setActivePage(getCurrentSection());
1120
+ };
1121
+ window.addEventListener("scroll", handleScroll);
1122
+ return () => {
1123
+ window.removeEventListener("scroll", handleScroll);
1124
+ };
1125
+ }, []);
1126
+ let selectedStyles = {
1127
+ rtl: "hawa-border-r-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200",
1128
+ ltr: "hawa-border-l-4 hawa-border-primary hawa-border-collapse hawa-bg-gray-200"
1129
+ };
1130
+ return /* @__PURE__ */ React9.createElement(
1131
+ "div",
1132
+ {
1133
+ className: "hawa-flex hawa-flex-col hawa-overflow-x-clip",
1134
+ dir: direction
1135
+ },
1136
+ pages.map((page, index) => /* @__PURE__ */ React9.createElement(
1137
+ "div",
1138
+ {
1139
+ key: index,
1140
+ className: cn(
1141
+ "hawa-cursor-pointer hawa-whitespace-nowrap hawa-px-3 hawa-py-1 hawa-text-xs hawa-transition-all hover:hawa-bg-gray-100",
1142
+ (propCurrentPage || activePage) === page ? selectedStyles[direction || "rtl"] : ""
1143
+ ),
1144
+ onClick: (event) => handlePageClick(page, event)
1145
+ },
1146
+ page
1147
+ ))
1148
+ );
1149
+ };
1150
+
1151
+ // components/layout/DocsLayout.tsx
1152
+ var DocsLayout = ({
1153
+ direction = "ltr",
1154
+ drawerSize = "md",
1155
+ DrawerFooterActions,
1156
+ clickedItem,
1157
+ keepOpen,
1158
+ pages,
1159
+ setKeepOpen,
1160
+ ...props
1161
+ }) => {
1162
+ let closeDrawerWidth = 0;
1163
+ let openDrawerWidth = 200;
1164
+ let drawerSizeStyle = {
1165
+ opened: {
1166
+ sm: "100",
1167
+ md: openDrawerWidth,
1168
+ lg: "250"
1169
+ },
1170
+ closed: {
1171
+ sm: closeDrawerWidth,
1172
+ md: closeDrawerWidth,
1173
+ lg: closeDrawerWidth
1174
+ }
1175
+ };
1176
+ const ref = useRef2(null);
1177
+ const isRTL = direction === "rtl";
1178
+ let size = useBreakpoint();
1179
+ if (typeof window == "undefined") {
1180
+ size = 1200;
1181
+ }
1182
+ const [currentPage, setCurrentPage] = useState4("Introduction");
1183
+ const [openSideMenu, setOpenSideMenu] = useState4(true);
1184
+ useEffect2(() => {
1185
+ const handleClickOutside = (event) => {
1186
+ if (ref.current && !ref.current.contains(event.target) && !openSideMenu) {
1187
+ setOpenSideMenu(false);
1188
+ }
1189
+ };
1190
+ document.addEventListener("click", handleClickOutside, true);
1191
+ return () => {
1192
+ document.removeEventListener("click", handleClickOutside, true);
1193
+ };
1194
+ }, [openSideMenu]);
1195
+ useEffect2(() => {
1196
+ const handleResize = () => {
1197
+ setOpenSideMenu(window.innerWidth > 600 ? true : false);
1198
+ };
1199
+ handleResize();
1200
+ window.addEventListener("resize", handleResize);
1201
+ return () => {
1202
+ window.removeEventListener("resize", handleResize);
1203
+ };
1204
+ }, [keepOpen]);
1205
+ const observerRef = React10.useRef(null);
1206
+ const handleIntersection = (entries) => {
1207
+ const entry = entries.find((entry2) => entry2.isIntersecting);
1208
+ if (entry) {
1209
+ setCurrentPage(entry.target.id);
1210
+ }
1211
+ };
1212
+ useEffect2(() => {
1213
+ observerRef.current = new IntersectionObserver(handleIntersection, {
1214
+ threshold: 0.5
1215
+ // Adjust threshold as needed to determine when a section is in view
1216
+ });
1217
+ React10.Children.forEach(props.children, (child) => {
1218
+ if (child && child.props.id) {
1219
+ const element = document.getElementById(child.props.id);
1220
+ if (element && observerRef.current) {
1221
+ observerRef.current.observe(element);
1222
+ }
1223
+ }
1224
+ });
1225
+ return () => {
1226
+ if (observerRef.current) {
1227
+ observerRef.current.disconnect();
1228
+ }
1229
+ };
1230
+ }, [props.children]);
1231
+ let drawerSizeCondition = drawerSizeStyle[openSideMenu ? "opened" : "closed"][drawerSize];
1232
+ return /* @__PURE__ */ React10.createElement("div", { className: "hawa-fixed" }, /* @__PURE__ */ React10.createElement(
1233
+ "div",
1234
+ {
1235
+ className: cn(
1236
+ "hawa-fixed hawa-left-0 hawa-right-0 hawa-top-0 hawa-z-30 hawa-flex hawa-h-14 hawa-w-full hawa-items-center hawa-justify-between hawa-bg-primary-foreground hawa-p-2",
1237
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
1238
+ )
1239
+ },
1240
+ size > 600 ? /* @__PURE__ */ React10.createElement("div", { onClick: props.onLogoClick, dir: direction }, /* @__PURE__ */ React10.createElement(
1241
+ "img",
1242
+ {
1243
+ className: cn(
1244
+ "hawa-h-8 hawa-opacity-0 hawa-transition-all",
1245
+ !openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100"
1246
+ ),
1247
+ src: props.logoLink
1248
+ }
1249
+ )) : (
1250
+ // Mobile Drawer Menu Button
1251
+ /* @__PURE__ */ React10.createElement(
1252
+ "div",
1253
+ {
1254
+ dir: direction,
1255
+ className: "hawa-flex hawa-items-center hawa-justify-center hawa-gap-0.5"
1256
+ },
1257
+ /* @__PURE__ */ React10.createElement(Sheet, null, /* @__PURE__ */ React10.createElement(SheetTrigger, null, " ", /* @__PURE__ */ React10.createElement(
1258
+ "div",
1259
+ {
1260
+ className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
1261
+ },
1262
+ /* @__PURE__ */ React10.createElement(
1263
+ "svg",
1264
+ {
1265
+ "aria-label": "Menu Icon",
1266
+ stroke: "currentColor",
1267
+ fill: "currentColor",
1268
+ strokeWidth: 0,
1269
+ viewBox: "0 0 20 20",
1270
+ "aria-hidden": "true",
1271
+ height: "1.6em",
1272
+ width: "1.6em"
1273
+ },
1274
+ /* @__PURE__ */ React10.createElement(
1275
+ "path",
1276
+ {
1277
+ fillRule: "evenodd",
1278
+ clipRule: "evenodd",
1279
+ d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
1280
+ }
1281
+ )
1282
+ )
1283
+ )), /* @__PURE__ */ React10.createElement(
1284
+ SheetContent,
1285
+ {
1286
+ side: isRTL ? "right" : "left",
1287
+ className: "hawa-pt-10"
1288
+ },
1289
+ /* @__PURE__ */ React10.createElement(DocsSidebar, { direction, pages: pages || [] })
1290
+ ))
1291
+ )
1292
+ ),
1293
+ /* @__PURE__ */ React10.createElement(
1294
+ "div",
1295
+ {
1296
+ className: cn(
1297
+ "hawa-flex hawa-gap-2 dark:hawa-text-white",
1298
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
1299
+ )
1300
+ },
1301
+ /* @__PURE__ */ React10.createElement(Button, { variant: "ghost", size: "smallIcon" }, /* @__PURE__ */ React10.createElement(Logos.github, { className: "hawa-icon" }))
1302
+ )
1303
+ ), /* @__PURE__ */ React10.createElement(
1304
+ "div",
1305
+ {
1306
+ className: cn(
1307
+ "hawa-fixed hawa-z-40 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-bg-primary-foreground hawa-transition-all",
1308
+ isRTL ? "hawa-right-0 hawa-top-0 hawa-h-full" : "hawa-left-0 hawa-top-0 hawa-h-full",
1309
+ "hawa-fixed hawa-overflow-x-clip hawa-p-0 hawa-py-2 hawa-transition-all",
1310
+ "hawa-top-14",
1311
+ openSideMenu ? "hawa-overflow-auto" : "hawa-overflow-hidden"
1312
+ ),
1313
+ style: {
1314
+ width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
1315
+ },
1316
+ onMouseEnter: () => {
1317
+ setOpenSideMenu(true);
1318
+ },
1319
+ onMouseLeave: () => {
1320
+ if (size < 600) {
1321
+ setOpenSideMenu(!openSideMenu);
1322
+ }
1323
+ },
1324
+ ref
1325
+ },
1326
+ /* @__PURE__ */ React10.createElement(
1327
+ DocsSidebar,
1328
+ {
1329
+ direction,
1330
+ pages: pages || [],
1331
+ currentPage
1332
+ }
1333
+ )
1334
+ ), /* @__PURE__ */ React10.createElement(
1335
+ "div",
1336
+ {
1337
+ className: "hawa-fixed hawa-overflow-y-auto hawa-transition-all ",
1338
+ style: isRTL ? {
1339
+ height: "calc(100% - 56px)",
1340
+ width: `calc(100% - ${drawerSizeCondition}px)`,
1341
+ left: "0px",
1342
+ top: "56px"
1343
+ } : {
1344
+ height: "calc(100% - 56px)",
1345
+ width: `calc(100% - ${drawerSizeCondition}px)`,
1346
+ left: `${drawerSizeCondition}px`,
1347
+ right: `${drawerSizeCondition}px`,
1348
+ top: "56px"
1349
+ }
1350
+ },
1351
+ props.children
1352
+ ));
1353
+ };
1354
+ export {
1355
+ AppLayout,
1356
+ AppTabs,
1357
+ AppTopbar,
1358
+ Copyrights,
1359
+ DocsLayout,
1360
+ DocsSidebar,
1361
+ Menubar,
1362
+ MenubarCheckboxItem,
1363
+ MenubarContent,
1364
+ MenubarGroup,
1365
+ MenubarItem,
1366
+ MenubarLabel,
1367
+ MenubarMenu,
1368
+ MenubarPortal,
1369
+ MenubarRadioGroup,
1370
+ MenubarRadioItem,
1371
+ MenubarSeparator,
1372
+ MenubarShortcut,
1373
+ MenubarSub,
1374
+ MenubarSubContent,
1375
+ MenubarSubTrigger,
1376
+ MenubarTrigger,
1377
+ Navbar,
1378
+ SidebarGroup,
1379
+ SidebarItem,
1380
+ Stats
1381
+ };