@sikka/hawa 0.24.4-next → 0.24.6-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 (154) hide show
  1. package/dist/accordion/index.d.mts +1 -2
  2. package/dist/accordion/index.d.ts +1 -2
  3. package/dist/accordion/index.mjs +219 -7
  4. package/dist/alert/index.d.mts +1 -1
  5. package/dist/alert/index.d.ts +1 -1
  6. package/dist/appLayout/index.d.mts +126 -0
  7. package/dist/appLayout/index.d.ts +126 -0
  8. package/dist/appLayout/index.js +1325 -0
  9. package/dist/appLayout/index.mjs +1285 -0
  10. package/dist/appMenubar/index.d.mts +33 -0
  11. package/dist/appMenubar/index.d.ts +33 -0
  12. package/dist/appMenubar/index.js +281 -0
  13. package/dist/appMenubar/index.mjs +224 -0
  14. package/dist/appTabs/index.d.mts +18 -0
  15. package/dist/appTabs/index.d.ts +18 -0
  16. package/dist/appTabs/index.js +92 -0
  17. package/dist/appTabs/index.mjs +50 -0
  18. package/dist/appTopbar/index.d.mts +44 -0
  19. package/dist/appTopbar/index.d.ts +44 -0
  20. package/dist/appTopbar/index.js +483 -0
  21. package/dist/appTopbar/index.mjs +441 -0
  22. package/dist/avatar/index.d.mts +5 -4
  23. package/dist/avatar/index.d.ts +5 -4
  24. package/dist/backToTop/index.mjs +353 -3
  25. package/dist/badge/index.d.mts +2 -2
  26. package/dist/badge/index.d.ts +2 -2
  27. package/dist/blocks/index.js +4 -3
  28. package/dist/blocks/index.mjs +4 -3
  29. package/dist/checkbox/index.d.mts +1 -2
  30. package/dist/checkbox/index.d.ts +1 -2
  31. package/dist/chip/index.d.mts +36 -2
  32. package/dist/chip/index.d.ts +36 -2
  33. package/dist/chip/index.mjs +83 -3
  34. package/dist/chunk-62GI5F2P.mjs +442 -0
  35. package/dist/chunk-7NCNPRCL.mjs +120 -0
  36. package/dist/{chunk-TNAHW35O.mjs → chunk-C2UYTGUD.mjs} +8 -4
  37. package/dist/{chunk-26FHSPJI.mjs → chunk-DGWAHQRX.mjs} +1 -101
  38. package/dist/chunk-LRLLDOQZ.mjs +178 -0
  39. package/dist/chunk-ND4BWUKH.mjs +34 -0
  40. package/dist/codeBlock/index.mjs +684 -310
  41. package/dist/colorPicker/index.d.mts +2 -1
  42. package/dist/colorPicker/index.d.ts +2 -1
  43. package/dist/colorPicker/index.mjs +2 -167
  44. package/dist/combobox/index.d.mts +9 -1
  45. package/dist/combobox/index.d.ts +9 -1
  46. package/dist/combobox/index.mjs +61 -393
  47. package/dist/command/index.mjs +10 -425
  48. package/dist/commonTypes-3J1E3b61.d.mts +6 -0
  49. package/dist/commonTypes-3J1E3b61.d.ts +6 -0
  50. package/dist/commonTypes-GhKAraJw.d.mts +4 -0
  51. package/dist/commonTypes-GhKAraJw.d.ts +4 -0
  52. package/dist/commonTypes-LrR8QrYP.d.mts +5 -0
  53. package/dist/commonTypes-LrR8QrYP.d.ts +5 -0
  54. package/dist/commonTypes-WPhcN3Vr.d.mts +5 -0
  55. package/dist/commonTypes-WPhcN3Vr.d.ts +5 -0
  56. package/dist/commonTypes-ko_NGEoT.d.mts +3 -0
  57. package/dist/commonTypes-ko_NGEoT.d.ts +3 -0
  58. package/dist/copyrights/index.d.mts +17 -0
  59. package/dist/copyrights/index.d.ts +17 -0
  60. package/dist/copyrights/index.js +45 -0
  61. package/dist/copyrights/index.mjs +8 -0
  62. package/dist/count/index.d.mts +11 -0
  63. package/dist/count/index.d.ts +11 -0
  64. package/dist/count/index.js +45 -0
  65. package/dist/count/index.mjs +8 -0
  66. package/dist/dataTable/index.d.mts +1 -1
  67. package/dist/dataTable/index.d.ts +1 -1
  68. package/dist/destroyableCard/index.d.mts +1 -1
  69. package/dist/destroyableCard/index.d.ts +1 -1
  70. package/dist/dialog/index.d.mts +1 -1
  71. package/dist/dialog/index.d.ts +1 -1
  72. package/dist/docsLayout/index.d.mts +37 -0
  73. package/dist/docsLayout/index.d.ts +37 -0
  74. package/dist/docsLayout/index.js +926 -0
  75. package/dist/docsLayout/index.mjs +886 -0
  76. package/dist/docsSidebar/index.d.mts +11 -0
  77. package/dist/docsSidebar/index.d.ts +11 -0
  78. package/dist/docsSidebar/index.js +111 -0
  79. package/dist/docsSidebar/index.mjs +69 -0
  80. package/dist/index.css +9 -3
  81. package/dist/index.d.mts +1 -0
  82. package/dist/index.d.ts +1 -0
  83. package/dist/index.js +54 -44
  84. package/dist/index.mjs +54 -44
  85. package/dist/input/index.d.mts +2 -9
  86. package/dist/input/index.d.ts +2 -9
  87. package/dist/input/index.mjs +14 -98
  88. package/dist/interfaceSettings/index.d.mts +1 -1
  89. package/dist/interfaceSettings/index.d.ts +1 -1
  90. package/dist/interfaceSettings/index.mjs +24 -110
  91. package/dist/label/index.d.mts +1 -1
  92. package/dist/label/index.d.ts +1 -1
  93. package/dist/label/index.mjs +2 -87
  94. package/dist/layout/index.d.mts +1 -0
  95. package/dist/layout/index.d.ts +1 -0
  96. package/dist/layout/index.js +53 -44
  97. package/dist/layout/index.mjs +50 -41
  98. package/dist/navbar/index.d.mts +17 -0
  99. package/dist/navbar/index.d.ts +17 -0
  100. package/dist/navbar/index.js +166 -0
  101. package/dist/navbar/index.mjs +126 -0
  102. package/dist/pagination/index.d.mts +1 -1
  103. package/dist/pagination/index.d.ts +1 -1
  104. package/dist/passwordInput/index.mjs +27 -137
  105. package/dist/phoneInput/index.mjs +19 -129
  106. package/dist/radio/index.d.mts +1 -4
  107. package/dist/radio/index.d.ts +1 -4
  108. package/dist/scrollArea/index.d.mts +1 -1
  109. package/dist/scrollArea/index.d.ts +1 -1
  110. package/dist/select/index.d.mts +1 -1
  111. package/dist/select/index.d.ts +1 -1
  112. package/dist/separator/index.d.mts +1 -1
  113. package/dist/separator/index.d.ts +1 -1
  114. package/dist/sidebar/index.d.mts +48 -0
  115. package/dist/sidebar/index.d.ts +48 -0
  116. package/dist/sidebar/index.js +341 -0
  117. package/dist/sidebar/index.mjs +298 -0
  118. package/dist/simpleTable/index.d.mts +4 -3
  119. package/dist/simpleTable/index.d.ts +4 -3
  120. package/dist/simpleTable/index.mjs +21 -45
  121. package/dist/skeleton/index.d.mts +3 -3
  122. package/dist/skeleton/index.d.ts +3 -3
  123. package/dist/skeleton/index.mjs +3 -29
  124. package/dist/sortButton/index.mjs +9 -260
  125. package/dist/splitButton/index.d.mts +4 -3
  126. package/dist/splitButton/index.d.ts +4 -3
  127. package/dist/splitButton/index.mjs +10 -259
  128. package/dist/stats/index.d.mts +19 -0
  129. package/dist/stats/index.d.ts +19 -0
  130. package/dist/stats/index.js +191 -0
  131. package/dist/stats/index.mjs +154 -0
  132. package/dist/stopPropagationWrapper/index.d.mts +2 -2
  133. package/dist/stopPropagationWrapper/index.d.ts +2 -2
  134. package/dist/switch/index.d.mts +2 -1
  135. package/dist/switch/index.d.ts +2 -1
  136. package/dist/tabs/index.d.mts +19 -1
  137. package/dist/tabs/index.d.ts +19 -1
  138. package/dist/tabs/index.mjs +94 -14
  139. package/dist/textarea/index.d.mts +8 -1
  140. package/dist/textarea/index.d.ts +8 -1
  141. package/dist/textarea/index.mjs +92 -8
  142. package/dist/toast/index.d.mts +1 -1
  143. package/dist/toast/index.d.ts +1 -1
  144. package/package.json +1 -1
  145. package/dist/Label-fkQ4ebuH.d.mts +0 -12
  146. package/dist/Label-fkQ4ebuH.d.ts +0 -12
  147. package/dist/chunk-72HYR6WB.mjs +0 -88
  148. package/dist/chunk-JYSC6GKM.mjs +0 -229
  149. package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
  150. package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
  151. package/dist/commonTypes-N7XOVCit.d.mts +0 -5
  152. package/dist/commonTypes-N7XOVCit.d.ts +0 -5
  153. package/dist/index-DUZFcPRO.d.mts +0 -38
  154. package/dist/index-DUZFcPRO.d.ts +0 -38
@@ -0,0 +1,1285 @@
1
+ import {
2
+ cn
3
+ } from "../chunk-TE3BKEXL.mjs";
4
+
5
+ // components/layout/appLayout/AppLayout.tsx
6
+ import React7, { useEffect, useRef, useState } from "react";
7
+
8
+ // components/elements/button/Button.tsx
9
+ import * as React2 from "react";
10
+ import { cva } from "class-variance-authority";
11
+
12
+ // components/elements/loading/Loading.tsx
13
+ import React from "react";
14
+ var Loading = ({
15
+ design = "spinner",
16
+ size = "sm",
17
+ themeMode = "light",
18
+ color,
19
+ ...props
20
+ }) => {
21
+ let sizeStyles = {
22
+ button: "hawa-h-4 hawa-w-4",
23
+ xs: "hawa-h-1 hawa-w-1",
24
+ sm: "hawa-h-6 hawa-w-6",
25
+ normal: "hawa-h-8 hawa-w-8",
26
+ lg: "hawa-h-14 hawa-w-14",
27
+ xl: "hawa-h-24 hawa-w-24"
28
+ };
29
+ let animationStyles = {
30
+ pulse: "hawa-animate-in hawa-fade-in hawa-duration-1000",
31
+ bounce: "hawa-animate-bounce"
32
+ };
33
+ switch (design.split("-")[0]) {
34
+ case "dots":
35
+ return /* @__PURE__ */ React.createElement(
36
+ "div",
37
+ {
38
+ className: cn("hawa-flex hawa-flex-row hawa-gap-2", props.className)
39
+ },
40
+ /* @__PURE__ */ React.createElement(
41
+ "div",
42
+ {
43
+ className: cn(
44
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
45
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
46
+ animationStyles[design.split("-")[1]],
47
+ color ? color : "hawa-bg-primary"
48
+ )
49
+ }
50
+ ),
51
+ /* @__PURE__ */ React.createElement(
52
+ "div",
53
+ {
54
+ className: cn(
55
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
56
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
57
+ animationStyles[design.split("-")[1]],
58
+ color ? color : "hawa-bg-primary"
59
+ )
60
+ }
61
+ ),
62
+ /* @__PURE__ */ React.createElement(
63
+ "div",
64
+ {
65
+ className: cn(
66
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
67
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
68
+ animationStyles[design.split("-")[1]],
69
+ color ? color : "hawa-bg-primary"
70
+ )
71
+ }
72
+ )
73
+ );
74
+ case "square":
75
+ return /* @__PURE__ */ React.createElement(
76
+ "svg",
77
+ {
78
+ className: cn("squircle-container", sizeStyles[size]),
79
+ viewBox: "0 0 35 35",
80
+ height: "35",
81
+ width: "35"
82
+ },
83
+ /* @__PURE__ */ React.createElement(
84
+ "rect",
85
+ {
86
+ className: "squircle-track",
87
+ x: "2.5",
88
+ y: "2.5",
89
+ fill: "none",
90
+ strokeWidth: "5px",
91
+ width: "32.5",
92
+ height: "32.5"
93
+ }
94
+ ),
95
+ /* @__PURE__ */ React.createElement(
96
+ "rect",
97
+ {
98
+ className: "square-car",
99
+ x: "2.5",
100
+ y: "2.5",
101
+ fill: "none",
102
+ strokeWidth: "5px",
103
+ width: "32.5",
104
+ height: "32.5",
105
+ pathLength: "100"
106
+ }
107
+ )
108
+ );
109
+ case "squircle":
110
+ return /* @__PURE__ */ React.createElement(
111
+ "svg",
112
+ {
113
+ className: cn("squircle-container", sizeStyles[size]),
114
+ x: "0px",
115
+ y: "0px",
116
+ viewBox: "0 0 37 37",
117
+ height: "37",
118
+ width: "37",
119
+ preserveAspectRatio: "xMidYMid meet"
120
+ },
121
+ /* @__PURE__ */ React.createElement(
122
+ "path",
123
+ {
124
+ className: "squircle-track",
125
+ fill: "none",
126
+ strokeWidth: "5",
127
+ pathLength: "100",
128
+ d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
129
+ }
130
+ ),
131
+ /* @__PURE__ */ React.createElement(
132
+ "path",
133
+ {
134
+ className: "squircle-car",
135
+ fill: "none",
136
+ strokeWidth: "5",
137
+ pathLength: "100",
138
+ d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
139
+ }
140
+ )
141
+ );
142
+ case "progress":
143
+ return /* @__PURE__ */ React.createElement("div", { className: "progress-loading" });
144
+ case "orbit":
145
+ return /* @__PURE__ */ React.createElement("div", { className: "orbit-container" });
146
+ default:
147
+ return /* @__PURE__ */ React.createElement(
148
+ "svg",
149
+ {
150
+ className: cn("circle-container", sizeStyles[size]),
151
+ viewBox: "0 0 40 40",
152
+ height: "40",
153
+ width: "40"
154
+ },
155
+ /* @__PURE__ */ React.createElement(
156
+ "circle",
157
+ {
158
+ className: cn("circle-track", {
159
+ "hawa-stroke-primary-foreground": themeMode === "dark",
160
+ "hawa-stroke-primary": themeMode === "light"
161
+ }),
162
+ cx: "20",
163
+ cy: "20",
164
+ r: "17.5",
165
+ pathLength: "100",
166
+ strokeWidth: "5px",
167
+ fill: "none"
168
+ }
169
+ ),
170
+ /* @__PURE__ */ React.createElement(
171
+ "circle",
172
+ {
173
+ className: cn("circle-car", {
174
+ "hawa-stroke-primary-foreground": themeMode === "dark",
175
+ "hawa-stroke-primary": themeMode === "light"
176
+ }),
177
+ cx: "20",
178
+ cy: "20",
179
+ r: "17.5",
180
+ pathLength: "100",
181
+ strokeWidth: "5px",
182
+ fill: "none"
183
+ }
184
+ )
185
+ );
186
+ }
187
+ };
188
+
189
+ // components/elements/button/Button.tsx
190
+ var buttonVariants = cva(
191
+ "hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
192
+ {
193
+ variants: {
194
+ variant: {
195
+ default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
196
+ light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
197
+ destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
198
+ outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
199
+ secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
200
+ ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
201
+ link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
202
+ combobox: "hawa-bg-background hawa-border",
203
+ neoBrutalism: "neo-brutalism"
204
+ // "hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active",
205
+ },
206
+ size: {
207
+ default: "hawa-h-10 hawa-px-4 hawa-py-2",
208
+ heightless: "hawa-px-4 hawa-py-4",
209
+ xs: "hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 ",
210
+ sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
211
+ lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
212
+ xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
213
+ icon: "hawa-h-10 hawa-w-10",
214
+ smallIcon: "hawa-h-7 hawa-w-7"
215
+ }
216
+ },
217
+ defaultVariants: {
218
+ variant: "default",
219
+ size: "default"
220
+ }
221
+ }
222
+ );
223
+ var Button = React2.forwardRef(
224
+ ({
225
+ className,
226
+ variant,
227
+ size,
228
+ asChild = false,
229
+ centered = true,
230
+ isLoading,
231
+ children,
232
+ ...props
233
+ }, ref) => {
234
+ const Comp = "button";
235
+ const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
236
+ return /* @__PURE__ */ React2.createElement(
237
+ Comp,
238
+ {
239
+ className: cn(
240
+ buttonVariants({ variant, size, className }),
241
+ centered && "hawa-justify-center"
242
+ ),
243
+ ref,
244
+ ...props
245
+ },
246
+ isLoading ? /* @__PURE__ */ React2.createElement(
247
+ Loading,
248
+ {
249
+ design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
250
+ themeMode: variant === "outline" ? "light" : "dark",
251
+ color: loadingColor,
252
+ size: size === "sm" || size === "xs" ? "xs" : "button"
253
+ }
254
+ ) : children
255
+ );
256
+ }
257
+ );
258
+ Button.displayName = "Button";
259
+
260
+ // components/elements/dropdownMenu/DropdownMenu.tsx
261
+ import * as React3 from "react";
262
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
263
+ var DropdownMenuRoot = DropdownMenuPrimitive.Root;
264
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
265
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
266
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
267
+ var DropdownMenuSubTrigger = React3.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React3.createElement(
268
+ DropdownMenuPrimitive.SubTrigger,
269
+ {
270
+ ref,
271
+ className: cn(
272
+ "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent",
273
+ inset && "hawa-pl-8",
274
+ className
275
+ ),
276
+ ...props
277
+ },
278
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
279
+ " ",
280
+ /* @__PURE__ */ React3.createElement(
281
+ "svg",
282
+ {
283
+ "aria-label": "Chevron Right Icon",
284
+ stroke: "currentColor",
285
+ fill: "currentColor",
286
+ strokeWidth: "0",
287
+ viewBox: "0 0 16 16",
288
+ height: "1em",
289
+ width: "1em",
290
+ className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
291
+ },
292
+ /* @__PURE__ */ React3.createElement(
293
+ "path",
294
+ {
295
+ fillRule: "evenodd",
296
+ 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"
297
+ }
298
+ )
299
+ )
300
+ ));
301
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
302
+ var DropdownMenuSubContent = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
303
+ DropdownMenuPrimitive.SubContent,
304
+ {
305
+ ref,
306
+ className: cn(
307
+ "hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg 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",
308
+ className
309
+ ),
310
+ ...props
311
+ }
312
+ ));
313
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
314
+ var DropdownMenuContent = React3.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React3.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React3.createElement(
315
+ DropdownMenuPrimitive.Content,
316
+ {
317
+ ref,
318
+ sideOffset,
319
+ className: cn(
320
+ "hawa-z-50 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-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",
321
+ className
322
+ ),
323
+ ...props
324
+ }
325
+ )));
326
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
327
+ var DropdownMenuItem = React3.forwardRef(({ className, inset, badged, slug, ...props }, ref) => {
328
+ return /* @__PURE__ */ React3.createElement("a", { href: slug }, /* @__PURE__ */ React3.createElement(
329
+ DropdownMenuPrimitive.Item,
330
+ {
331
+ disabled: props.disabled,
332
+ ref,
333
+ className: cn(
334
+ "hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
335
+ inset && "hawa-pl-8",
336
+ props.end && Array.isArray(props.children) && props.children[1] && "hawa-gap-6",
337
+ className
338
+ ),
339
+ ...props
340
+ },
341
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 " }, props.children),
342
+ props.end && props.end,
343
+ !props.end && props.shortcut && /* @__PURE__ */ React3.createElement(DropdownMenuShortcut, null, props.shortcut),
344
+ !props.end && badged && /* @__PURE__ */ React3.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
345
+ ));
346
+ });
347
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
348
+ var DropdownMenuCheckboxItem = React3.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React3.createElement(
349
+ DropdownMenuPrimitive.CheckboxItem,
350
+ {
351
+ ref,
352
+ className: cn(
353
+ "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 hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
354
+ className
355
+ ),
356
+ checked,
357
+ ...props
358
+ },
359
+ /* @__PURE__ */ React3.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__ */ React3.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React3.createElement(
360
+ "svg",
361
+ {
362
+ "aria-label": "Check Mark",
363
+ stroke: "currentColor",
364
+ fill: "currentColor",
365
+ strokeWidth: "0",
366
+ viewBox: "0 0 512 512",
367
+ height: "0.60em",
368
+ width: "0.60em"
369
+ },
370
+ /* @__PURE__ */ React3.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
371
+ ), " ")),
372
+ children
373
+ ));
374
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
375
+ var DropdownMenuRadioItem = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React3.createElement(
376
+ DropdownMenuPrimitive.RadioItem,
377
+ {
378
+ ref,
379
+ className: cn(
380
+ "hawa-relative hawa-flex hawa-cursor-pointer 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 hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
381
+ className
382
+ ),
383
+ ...props
384
+ },
385
+ /* @__PURE__ */ React3.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__ */ React3.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React3.createElement(
386
+ "svg",
387
+ {
388
+ xmlns: "http://www.w3.org/2000/svg",
389
+ width: "24",
390
+ "aria-label": "Circle",
391
+ height: "24",
392
+ viewBox: "0 0 24 24",
393
+ fill: "none",
394
+ stroke: "currentColor",
395
+ strokeWidth: "2",
396
+ strokeLinecap: "round",
397
+ strokeLinejoin: "round",
398
+ className: "hawa-h-2 hawa-w-2 hawa-fill-current"
399
+ },
400
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" })
401
+ ))),
402
+ children
403
+ ));
404
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
405
+ var DropdownMenuLabel = React3.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React3.createElement(
406
+ DropdownMenuPrimitive.Label,
407
+ {
408
+ ref,
409
+ className: cn(
410
+ "hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
411
+ inset && "hawa-pl-8",
412
+ className
413
+ ),
414
+ ...props
415
+ }
416
+ ));
417
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
418
+ var DropdownMenuSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
419
+ DropdownMenuPrimitive.Separator,
420
+ {
421
+ ref,
422
+ className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
423
+ ...props
424
+ }
425
+ ));
426
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
427
+ var DropdownMenuShortcut = ({
428
+ className,
429
+ ...props
430
+ }) => {
431
+ return /* @__PURE__ */ React3.createElement(
432
+ "span",
433
+ {
434
+ className: cn(
435
+ "hawa-text-xs hawa-tracking-widest hawa-opacity-60",
436
+ className
437
+ ),
438
+ ...props
439
+ }
440
+ );
441
+ };
442
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
443
+ var DropdownMenu = ({
444
+ trigger,
445
+ items,
446
+ direction,
447
+ sideOffset,
448
+ side,
449
+ className,
450
+ triggerClassname,
451
+ align,
452
+ alignOffset,
453
+ onItemSelect,
454
+ size = "default",
455
+ width = "default",
456
+ header,
457
+ onOpenChange,
458
+ open
459
+ }) => {
460
+ const widthStyles = {
461
+ default: "hawa-min-w-[8rem]",
462
+ sm: "hawa-w-fit",
463
+ lg: "hawa-w-[200px]",
464
+ parent: "ddm-w-parent"
465
+ };
466
+ const sizeStyles = {
467
+ default: "hawa-px-2 hawa-py-3 ",
468
+ sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
469
+ };
470
+ return /* @__PURE__ */ React3.createElement(
471
+ DropdownMenuRoot,
472
+ {
473
+ onOpenChange,
474
+ open,
475
+ modal: false,
476
+ dir: direction
477
+ },
478
+ /* @__PURE__ */ React3.createElement(DropdownMenuTrigger, { asChild: true, className: triggerClassname }, trigger),
479
+ /* @__PURE__ */ React3.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React3.createElement(
480
+ DropdownMenuContent,
481
+ {
482
+ side,
483
+ sideOffset,
484
+ className: cn(
485
+ className,
486
+ widthStyles[width],
487
+ "hawa-flex hawa-flex-col hawa-gap-1"
488
+ ),
489
+ align,
490
+ alignOffset
491
+ },
492
+ header && header,
493
+ items && items.map((item, index) => {
494
+ if (item.itemType === "separator") {
495
+ return /* @__PURE__ */ React3.createElement(DropdownMenuSeparator, { key: index });
496
+ } else if (item.itemType === "label") {
497
+ return /* @__PURE__ */ React3.createElement(DropdownMenuLabel, { key: index }, item.label);
498
+ } else if (item.itemType === "custom") {
499
+ return /* @__PURE__ */ React3.createElement("div", { key: index }, item.content);
500
+ } else {
501
+ return item.subitems ? /* @__PURE__ */ React3.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React3.createElement(
502
+ DropdownMenuSubTrigger,
503
+ {
504
+ className: cn(sizeStyles[size]),
505
+ dir: direction
506
+ },
507
+ item.icon && item.icon,
508
+ item.label && item.label
509
+ ), /* @__PURE__ */ React3.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React3.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React3.createElement(
510
+ DropdownMenuItem,
511
+ {
512
+ slug: subitem.slug,
513
+ onMouseDown: (event) => {
514
+ if (event.button === 1 || event.button === 0 && event.ctrlKey) {
515
+ event.preventDefault();
516
+ if (subitem.onMiddleClick) {
517
+ subitem.onMiddleClick(item.value);
518
+ }
519
+ }
520
+ },
521
+ key: subIndex,
522
+ className: cn(
523
+ sizeStyles[size],
524
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
525
+ ),
526
+ disabled: subitem.disabled,
527
+ onSelect: () => {
528
+ subitem.action && subitem.action();
529
+ if (onItemSelect) {
530
+ onItemSelect(subitem.value);
531
+ }
532
+ }
533
+ },
534
+ subitem.icon && subitem.icon,
535
+ subitem.label && subitem.label
536
+ ))))) : /* @__PURE__ */ React3.createElement(
537
+ DropdownMenuItem,
538
+ {
539
+ slug: item.slug,
540
+ key: index,
541
+ disabled: item.disabled,
542
+ onMouseDown: (event) => {
543
+ if (event.button === 1 || event.button === 0 && event.ctrlKey) {
544
+ event.preventDefault();
545
+ if (item.onMiddleClick) {
546
+ item.onMiddleClick(item.value);
547
+ }
548
+ }
549
+ },
550
+ onClick: (event) => {
551
+ if (item.onClick) {
552
+ item.onClick(item.value);
553
+ }
554
+ },
555
+ onSelect: (e) => {
556
+ if (item.presist) {
557
+ e.preventDefault();
558
+ }
559
+ if (item.action) {
560
+ item.action();
561
+ if (onItemSelect) {
562
+ onItemSelect(item.value);
563
+ }
564
+ } else {
565
+ if (onItemSelect) {
566
+ onItemSelect(item.value);
567
+ }
568
+ }
569
+ },
570
+ end: item.end,
571
+ shortcut: item.shortcut,
572
+ badged: item.badged,
573
+ className: cn(
574
+ sizeStyles[size],
575
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent " : "focus:hawa-bg-accent ",
576
+ item.presist && "focus:hawa-bg-transparent"
577
+ )
578
+ },
579
+ item.icon && item.icon,
580
+ item.label && item.label
581
+ );
582
+ }
583
+ })
584
+ ))
585
+ );
586
+ };
587
+
588
+ // components/elements/tooltip/Tooltip.tsx
589
+ import React4 from "react";
590
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
591
+ var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React4.createElement(
592
+ TooltipPrimitive.Content,
593
+ {
594
+ ref,
595
+ sideOffset,
596
+ className: cn(
597
+ "hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-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",
598
+ className
599
+ ),
600
+ ...props
601
+ }
602
+ ));
603
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
604
+ var TooltipArrow = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
605
+ TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
606
+ var Tooltip = ({
607
+ side,
608
+ open,
609
+ content,
610
+ children,
611
+ defaultOpen,
612
+ onOpenChange,
613
+ triggerProps,
614
+ contentProps,
615
+ providerProps,
616
+ delayDuration = 300,
617
+ ...props
618
+ }) => {
619
+ return /* @__PURE__ */ React4.createElement(
620
+ TooltipPrimitive.TooltipProvider,
621
+ {
622
+ delayDuration,
623
+ ...providerProps
624
+ },
625
+ /* @__PURE__ */ React4.createElement(
626
+ TooltipPrimitive.Root,
627
+ {
628
+ open,
629
+ defaultOpen,
630
+ onOpenChange,
631
+ ...props
632
+ },
633
+ /* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
634
+ /* @__PURE__ */ React4.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
635
+ )
636
+ );
637
+ };
638
+
639
+ // components/layout/sidebar/Sidebar.tsx
640
+ import * as React6 from "react";
641
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
642
+
643
+ // components/elements/chip/Chip.tsx
644
+ import React5 from "react";
645
+ var Chip = React5.forwardRef(
646
+ ({
647
+ label,
648
+ size = "normal",
649
+ icon,
650
+ color,
651
+ radius = "inherit",
652
+ dotType,
653
+ ...rest
654
+ }, ref) => {
655
+ let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
656
+ let radiusStyles = {
657
+ inherit: " hawa-rounded",
658
+ full: "hawa-rounded-full",
659
+ none: "hawa-rounded-none"
660
+ };
661
+ let sizeStyles = {
662
+ small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
663
+ normal: "hawa-h-fit hawa-text-xs",
664
+ large: "hawa-text-base"
665
+ };
666
+ let dotStyles = {
667
+ small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
668
+ normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
669
+ large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
670
+ };
671
+ let dotTypeStyles = {
672
+ available: "hawa-bg-green-500",
673
+ unavailable: "hawa-bg-red-500"
674
+ };
675
+ let colorStyles = {
676
+ green: "hawa-bg-green-100 hawa-text-green-500 dark:hawa-bg-green-400 dark:hawa-text-green-800",
677
+ blue: "hawa-bg-blue-100 hawa-text-blue-500 dark:hawa-bg-blue-400 dark:hawa-text-blue-100",
678
+ red: "hawa-bg-red-100 hawa-text-red-500 dark:hawa-bg-red-400 dark:hawa-text-red-100",
679
+ yellow: "hawa-bg-yellow-100 hawa-text-yellow-600 dark:hawa-bg-yellow-400 dark:hawa-text-yellow-800",
680
+ orange: "hawa-bg-orange-100 hawa-text-orange-500 dark:hawa-bg-orange-400 dark:hawa-text-orange-100",
681
+ purple: "hawa-bg-purple-100 hawa-text-purple-500 dark:hawa-bg-purple-400 dark:hawa-text-purple-100",
682
+ cyan: "hawa-bg-cyan-100 hawa-text-cyan-800 dark:hawa-bg-cyan-400 dark:hawa-text-cyan-800",
683
+ hyper: "hawa-text-white hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
684
+ oceanic: "hawa-text-white hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
685
+ };
686
+ if (label) {
687
+ return /* @__PURE__ */ React5.createElement(
688
+ "span",
689
+ {
690
+ ...rest,
691
+ ref,
692
+ className: cn(
693
+ defaultStyles,
694
+ sizeStyles[size],
695
+ radiusStyles[radius],
696
+ color ? colorStyles[color] : "hawa-border hawa-bg-none"
697
+ )
698
+ },
699
+ dotType && /* @__PURE__ */ React5.createElement(
700
+ "span",
701
+ {
702
+ className: cn(dotStyles[size], dotTypeStyles[dotType])
703
+ }
704
+ ),
705
+ icon && icon,
706
+ label
707
+ );
708
+ } else {
709
+ return /* @__PURE__ */ React5.createElement(
710
+ "span",
711
+ {
712
+ ...rest,
713
+ ref,
714
+ className: cn(
715
+ "hawa-h-2 hawa-w-2 hawa-rounded-full",
716
+ color ? colorStyles[color] : "hawa-border hawa-bg-none"
717
+ )
718
+ }
719
+ );
720
+ }
721
+ }
722
+ );
723
+
724
+ // components/layout/sidebar/Sidebar.tsx
725
+ var Accordion = AccordionPrimitive.Root;
726
+ 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";
727
+ var AccordionItem = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(AccordionPrimitive.Item, { ref, className: cn(className), ...props }));
728
+ AccordionItem.displayName = "AccordionItem";
729
+ var AccordionTrigger = React6.forwardRef(({ className, showArrow, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(AccordionPrimitive.Header, { className: "flex" }, /* @__PURE__ */ React6.createElement(
730
+ AccordionPrimitive.Trigger,
731
+ {
732
+ ref,
733
+ className: cn(triggerStyles, className),
734
+ ...props
735
+ },
736
+ children,
737
+ showArrow && /* @__PURE__ */ React6.createElement(
738
+ "svg",
739
+ {
740
+ "aria-label": "Chevron Right Icon",
741
+ stroke: "currentColor",
742
+ fill: "currentColor",
743
+ viewBox: "0 0 16 16",
744
+ height: "1em",
745
+ width: "1em",
746
+ className: "hawa-icon hawa-shrink-0 hawa-rotate-90 hawa-transition-transform hawa-duration-200"
747
+ },
748
+ /* @__PURE__ */ React6.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" })
749
+ )
750
+ )));
751
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
752
+ var AccordionContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
753
+ AccordionPrimitive.Content,
754
+ {
755
+ ref,
756
+ className: cn(
757
+ "hawa-overflow-hidden hawa-text-sm hawa-transition-all data-[state=closed]:hawa-animate-accordion-up data-[state=open]:hawa-animate-accordion-down",
758
+ className
759
+ ),
760
+ ...props
761
+ },
762
+ /* @__PURE__ */ React6.createElement("div", null, children)
763
+ ));
764
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
765
+ var SidebarGroup = ({
766
+ title,
767
+ items,
768
+ selectedItem,
769
+ openedItem,
770
+ setOpenedItem,
771
+ onItemClick,
772
+ onSubItemClick,
773
+ direction,
774
+ isOpen
775
+ }) => {
776
+ return /* @__PURE__ */ React6.createElement("div", { className: "hawa-m-2" }, title && /* @__PURE__ */ React6.createElement("h3", { className: "hawa-mb-1 hawa-font-bold" }, title), /* @__PURE__ */ React6.createElement("ul", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React6.createElement(
777
+ Accordion,
778
+ {
779
+ value: openedItem,
780
+ type: "single",
781
+ onValueChange: (e) => {
782
+ setOpenedItem(e);
783
+ },
784
+ collapsible: true,
785
+ className: "hawa-flex hawa-flex-col hawa-gap-1"
786
+ },
787
+ items.map((item, idx) => /* @__PURE__ */ React6.createElement(
788
+ SidebarItem,
789
+ {
790
+ isOpen,
791
+ selectedItem,
792
+ key: idx,
793
+ direction,
794
+ item,
795
+ onItemClick,
796
+ onSubItemClick
797
+ }
798
+ ))
799
+ )));
800
+ };
801
+ var SidebarItem = ({
802
+ item,
803
+ onItemClick,
804
+ onSubItemClick,
805
+ direction,
806
+ isOpen = true,
807
+ ...props
808
+ }) => {
809
+ const getSelectedStyle = (value) => {
810
+ return props.selectedItem === value ? "hawa-bg-primary/90 hawa-text-primary-foreground hawa-cursor-default" : "hover:hawa-bg-primary/10";
811
+ };
812
+ if (item.subitems) {
813
+ return /* @__PURE__ */ React6.createElement(
814
+ AccordionItem,
815
+ {
816
+ value: item.value,
817
+ className: "hawa-overflow-x-clip ",
818
+ dir: direction
819
+ },
820
+ /* @__PURE__ */ React6.createElement(
821
+ AccordionTrigger,
822
+ {
823
+ className: cn(
824
+ "hawa-w-full hawa-overflow-x-clip",
825
+ props.selectedItem === item.value ? "hawa-cursor-default hawa-bg-primary hawa-text-primary-foreground" : "hawa-h-10 hover:hawa-bg-primary/10",
826
+ item.subitems && item.subitems.some(
827
+ (subitem) => props.selectedItem === subitem.value
828
+ ) ? "hawa-bg-primary/80 hawa-text-primary-foreground hover:hawa-bg-primary/80" : ""
829
+ ),
830
+ showArrow: isOpen
831
+ },
832
+ /* @__PURE__ */ React6.createElement(
833
+ "div",
834
+ {
835
+ className: cn(
836
+ "hawa-flex hawa-h-fit hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2"
837
+ )
838
+ },
839
+ item.icon && item.icon,
840
+ /* @__PURE__ */ React6.createElement(
841
+ "span",
842
+ {
843
+ className: cn(
844
+ "hawa-transition-all ",
845
+ isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
846
+ )
847
+ },
848
+ item.label
849
+ )
850
+ )
851
+ ),
852
+ item.subitems && /* @__PURE__ */ React6.createElement(AccordionContent, { className: "hawa-mt-1 hawa-h-full hawa-rounded" }, /* @__PURE__ */ React6.createElement(
853
+ "div",
854
+ {
855
+ className: cn(
856
+ "hawa-flex hawa-h-full hawa-flex-col hawa-gap-2 hawa-bg-foreground/5 hawa-p-1"
857
+ )
858
+ },
859
+ item.subitems.map((subitem, idx) => /* @__PURE__ */ React6.createElement(
860
+ "a",
861
+ {
862
+ href: subitem.slug,
863
+ key: idx,
864
+ onMouseDown: (e) => {
865
+ if (subitem.onMouseDown) {
866
+ subitem.onMouseDown(e);
867
+ }
868
+ },
869
+ onClick: (e) => {
870
+ e.stopPropagation();
871
+ if (subitem.onClick) {
872
+ subitem.onClick(e);
873
+ }
874
+ if (onSubItemClick) {
875
+ onSubItemClick([item.value, subitem.value]);
876
+ }
877
+ },
878
+ className: cn(
879
+ "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",
880
+ // bg-foreground/10
881
+ getSelectedStyle(subitem.value)
882
+ )
883
+ },
884
+ subitem.icon && subitem.icon,
885
+ subitem.label
886
+ ))
887
+ ))
888
+ );
889
+ } else {
890
+ return /* @__PURE__ */ React6.createElement(
891
+ "a",
892
+ {
893
+ href: item.slug,
894
+ dir: direction,
895
+ onMouseDown: (e) => {
896
+ if (item.onMouseDown) {
897
+ item.onMouseDown(e);
898
+ }
899
+ },
900
+ onClick: (e) => {
901
+ if (item.onClick) {
902
+ item.onClick(e);
903
+ }
904
+ if (onItemClick) {
905
+ onItemClick([item.value]);
906
+ }
907
+ },
908
+ className: cn(
909
+ triggerStyles,
910
+ getSelectedStyle(item.value),
911
+ "hawa-overflow-x-clip "
912
+ )
913
+ },
914
+ /* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, item.icon && item.icon, /* @__PURE__ */ React6.createElement(
915
+ "span",
916
+ {
917
+ className: cn(
918
+ "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-transition-all",
919
+ isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
920
+ )
921
+ },
922
+ item.label,
923
+ " ",
924
+ item.badge && /* @__PURE__ */ React6.createElement(Chip, { label: item.badge.label, color: "hyper", size: "small" })
925
+ ))
926
+ );
927
+ }
928
+ };
929
+
930
+ // components/layout/appLayout/AppLayout.tsx
931
+ var AppLayout = ({
932
+ profileMenuWidth = "default",
933
+ DrawerFooterActions,
934
+ design = "default",
935
+ direction = "ltr",
936
+ drawerSize = "md",
937
+ currentPage,
938
+ clickedItem,
939
+ setKeepOpen,
940
+ keepOpen,
941
+ ...props
942
+ }) => {
943
+ var _a, _b;
944
+ let closeDrawerWidth = 56;
945
+ let openDrawerWidth = 200;
946
+ let drawerSizeStyle = {
947
+ opened: {
948
+ sm: "100",
949
+ md: openDrawerWidth,
950
+ lg: "250"
951
+ },
952
+ closed: {
953
+ sm: closeDrawerWidth,
954
+ md: closeDrawerWidth,
955
+ lg: closeDrawerWidth
956
+ }
957
+ };
958
+ const ref = useRef(null);
959
+ const isRTL = direction === "rtl";
960
+ const [openedSidebarItem, setOpenedSidebarItem] = useState("");
961
+ const [size, setSize] = useState(1200);
962
+ const [openSideMenu, setOpenSideMenu] = useState(true);
963
+ const drawerSizeCondition = size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0;
964
+ useEffect(() => {
965
+ if (typeof window !== "undefined") {
966
+ const resize = () => {
967
+ setSize(window.innerWidth);
968
+ };
969
+ resize();
970
+ window.addEventListener("resize", resize);
971
+ return () => {
972
+ window.removeEventListener("resize", resize);
973
+ };
974
+ }
975
+ }, []);
976
+ useEffect(() => {
977
+ if (size > 600) {
978
+ setOpenSideMenu(keepOpen);
979
+ } else {
980
+ setOpenSideMenu(false);
981
+ }
982
+ }, [size]);
983
+ useEffect(() => {
984
+ const handleClickOutside = (event) => {
985
+ if (ref.current && !ref.current.contains(event.target) && !keepOpen) {
986
+ setOpenSideMenu(false);
987
+ }
988
+ };
989
+ document.addEventListener("click", handleClickOutside, true);
990
+ return () => {
991
+ document.removeEventListener("click", handleClickOutside, true);
992
+ };
993
+ }, [keepOpen]);
994
+ return /* @__PURE__ */ React7.createElement("div", { className: "hawa-fixed hawa-left-0" }, props.topBar && /* @__PURE__ */ React7.createElement(
995
+ "div",
996
+ {
997
+ className: cn(
998
+ "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",
999
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
1000
+ )
1001
+ },
1002
+ size > 600 ? /* @__PURE__ */ React7.createElement(
1003
+ "div",
1004
+ {
1005
+ className: cn(
1006
+ "dark:hawa-text-white",
1007
+ isRTL ? [
1008
+ size > 600 ? "hawa-mr-14" : "hawa-mr-2",
1009
+ keepOpen ? "hawa-mr-40" : ""
1010
+ ] : [
1011
+ size > 600 ? "hawa-ml-14" : "hawa-ml-2",
1012
+ keepOpen ? "hawa-ml-40" : ""
1013
+ ]
1014
+ ),
1015
+ style: isRTL ? {
1016
+ marginRight: `${drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize]}px`
1017
+ } : {
1018
+ marginLeft: `${drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize]}px`
1019
+ }
1020
+ },
1021
+ props.pageTitle
1022
+ ) : (
1023
+ // Mobile Drawer Menu Button
1024
+ /* @__PURE__ */ React7.createElement(
1025
+ "div",
1026
+ {
1027
+ dir: direction,
1028
+ className: "hawa-flex hawa-items-center hawa-justify-center hawa-gap-0.5"
1029
+ },
1030
+ /* @__PURE__ */ React7.createElement(
1031
+ "div",
1032
+ {
1033
+ onClick: () => setOpenSideMenu(true),
1034
+ className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
1035
+ },
1036
+ /* @__PURE__ */ React7.createElement(MenuIcon, null)
1037
+ ),
1038
+ props.pageTitle ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-text-sm" }, props.pageTitle) : /* @__PURE__ */ React7.createElement("div", null)
1039
+ )
1040
+ ),
1041
+ /* @__PURE__ */ React7.createElement(
1042
+ "div",
1043
+ {
1044
+ className: cn(
1045
+ "hawa-flex hawa-gap-2 dark:hawa-text-white",
1046
+ isRTL ? "hawa-flex-row-reverse" : "hawa-flex-row"
1047
+ )
1048
+ },
1049
+ size > 600 ? /* @__PURE__ */ React7.createElement(
1050
+ "div",
1051
+ {
1052
+ className: isRTL ? "hawa-text-left hawa-text-xs" : "hawa-text-right hawa-text-xs"
1053
+ },
1054
+ /* @__PURE__ */ React7.createElement("div", { className: "hawa-font-bold" }, props.username),
1055
+ " ",
1056
+ /* @__PURE__ */ React7.createElement("div", null, props.email)
1057
+ ) : null,
1058
+ /* @__PURE__ */ React7.createElement(
1059
+ DropdownMenu,
1060
+ {
1061
+ triggerClassname: "hawa-mx-2",
1062
+ align: "end",
1063
+ alignOffset: 8,
1064
+ side: "bottom",
1065
+ sideOffset: 5,
1066
+ width: profileMenuWidth,
1067
+ direction: isRTL ? "rtl" : "ltr",
1068
+ items: props.profileMenuItems,
1069
+ onItemSelect: (e) => console.log("selecting item ", e),
1070
+ trigger: /* @__PURE__ */ React7.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__ */ React7.createElement("img", { src: props.avatarImage, alt: "User Avatar" }) : /* @__PURE__ */ React7.createElement(
1071
+ "svg",
1072
+ {
1073
+ "aria-label": "Avatar Icon",
1074
+ className: "hawa-absolute hawa--left-1 hawa-h-10 hawa-w-10 hawa-text-gray-400",
1075
+ fill: "currentColor",
1076
+ viewBox: "0 0 20 20"
1077
+ },
1078
+ /* @__PURE__ */ React7.createElement(
1079
+ "path",
1080
+ {
1081
+ fillRule: "evenodd",
1082
+ d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",
1083
+ clipRule: "evenodd"
1084
+ }
1085
+ )
1086
+ ))
1087
+ }
1088
+ )
1089
+ )
1090
+ ), /* @__PURE__ */ React7.createElement(
1091
+ "div",
1092
+ {
1093
+ className: cn(
1094
+ "hawa-fixed hawa-z-0 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all",
1095
+ isRTL ? "hawa-right-0 hawa-top-0 hawa-h-14" : "hawa-left-0 hawa-top-0 hawa-h-14",
1096
+ "hawa-h-[calc(100dvh)]"
1097
+ ),
1098
+ style: {
1099
+ width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
1100
+ },
1101
+ onMouseEnter: () => {
1102
+ setOpenSideMenu(true);
1103
+ },
1104
+ onMouseLeave: () => {
1105
+ if (size > 600) {
1106
+ if (keepOpen) {
1107
+ setOpenSideMenu(true);
1108
+ } else {
1109
+ setOpenedSidebarItem("");
1110
+ setOpenSideMenu(false);
1111
+ }
1112
+ } else {
1113
+ setOpenSideMenu(false);
1114
+ }
1115
+ },
1116
+ ref
1117
+ },
1118
+ /* @__PURE__ */ React7.createElement(
1119
+ "div",
1120
+ {
1121
+ onClick: props.onLogoClick,
1122
+ dir: direction,
1123
+ className: cn(
1124
+ "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",
1125
+ props.onLogoClick && "hawa-cursor-pointer"
1126
+ ),
1127
+ style: {
1128
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : 56}px` : `${openSideMenu ? openDrawerWidth : 0}px`
1129
+ }
1130
+ },
1131
+ openSideMenu && props.header && props.header,
1132
+ !props.header && /* @__PURE__ */ React7.createElement(
1133
+ "img",
1134
+ {
1135
+ className: cn(
1136
+ "hawa-h-9 hawa-opacity-0 hawa-transition-all",
1137
+ !openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100"
1138
+ ),
1139
+ src: props.logoLink
1140
+ }
1141
+ ),
1142
+ size > 600 ? /* @__PURE__ */ React7.createElement(
1143
+ "img",
1144
+ {
1145
+ className: cn(
1146
+ "hawa-fixed hawa-h-9 hawa-transition-all",
1147
+ isRTL ? "hawa-right-2.5 hawa-top-2.5" : "hawa-left-2.5 hawa-top-2.5",
1148
+ openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100"
1149
+ ),
1150
+ src: props.logoSymbol
1151
+ }
1152
+ ) : null
1153
+ ),
1154
+ /* @__PURE__ */ React7.createElement(
1155
+ "div",
1156
+ {
1157
+ className: cn(
1158
+ "hawa-fixed hawa-bottom-14 hawa-top-14 hawa-bg-primary-foreground hawa-p-0 hawa-py-2 hawa-transition-all",
1159
+ openSideMenu ? "hawa-overflow-auto" : "hawa-overflow-hidden"
1160
+ ),
1161
+ style: {
1162
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : drawerSizeCondition}px` : `${openSideMenu ? openDrawerWidth : 0}px`
1163
+ }
1164
+ },
1165
+ /* @__PURE__ */ React7.createElement(
1166
+ SidebarGroup,
1167
+ {
1168
+ direction,
1169
+ onItemClick: (values) => {
1170
+ if (clickedItem) {
1171
+ clickedItem(values);
1172
+ }
1173
+ },
1174
+ onSubItemClick: (values) => {
1175
+ if (clickedItem) {
1176
+ clickedItem(values);
1177
+ }
1178
+ },
1179
+ selectedItem: currentPage,
1180
+ openedItem: openedSidebarItem,
1181
+ setOpenedItem: (e) => setOpenedSidebarItem(e),
1182
+ isOpen: keepOpen || openSideMenu,
1183
+ items: props.drawerItems
1184
+ }
1185
+ )
1186
+ ),
1187
+ /* @__PURE__ */ React7.createElement(
1188
+ "div",
1189
+ {
1190
+ className: cn(
1191
+ "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",
1192
+ direction === "rtl" ? "hawa-flex-row-reverse" : "hawa-flex-row",
1193
+ "hawa-bottom-0"
1194
+ ),
1195
+ style: {
1196
+ width: size > 600 ? `${openSideMenu ? openDrawerWidth : 56}px` : `${openSideMenu ? openDrawerWidth : 0}px`
1197
+ }
1198
+ },
1199
+ DrawerFooterActions && openSideMenu ? /* @__PURE__ */ React7.createElement(React7.Fragment, null, DrawerFooterActions) : null,
1200
+ size > 600 && openSideMenu ? /* @__PURE__ */ React7.createElement(
1201
+ Tooltip,
1202
+ {
1203
+ side: "left",
1204
+ delayDuration: 500,
1205
+ content: keepOpen ? ((_a = props.texts) == null ? void 0 : _a.collapseSidebar) || "Collapse Sidebar" : ((_b = props.texts) == null ? void 0 : _b.expandSidebar) || "Expand Sidebar",
1206
+ triggerProps: { asChild: true }
1207
+ },
1208
+ /* @__PURE__ */ React7.createElement(
1209
+ Button,
1210
+ {
1211
+ variant: "outline",
1212
+ onClick: () => {
1213
+ const newKeepOpenState = !keepOpen;
1214
+ if (props.onDrawerExpand) {
1215
+ props.onDrawerExpand(newKeepOpenState);
1216
+ }
1217
+ setKeepOpen(newKeepOpenState);
1218
+ },
1219
+ size: "smallIcon"
1220
+ },
1221
+ /* @__PURE__ */ React7.createElement(
1222
+ "svg",
1223
+ {
1224
+ className: cn(
1225
+ "hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-text-primary hawa-transition-all disabled:hawa-bg-gray-200 ",
1226
+ keepOpen ? isRTL ? "hawa--rotate-90" : "hawa-rotate-90" : isRTL ? "hawa-rotate-90" : "hawa--rotate-90"
1227
+ ),
1228
+ fill: "currentColor",
1229
+ viewBox: "0 0 20 20"
1230
+ },
1231
+ /* @__PURE__ */ React7.createElement(
1232
+ "path",
1233
+ {
1234
+ fillRule: "evenodd",
1235
+ 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",
1236
+ clipRule: "evenodd"
1237
+ }
1238
+ )
1239
+ )
1240
+ )
1241
+ ) : null
1242
+ )
1243
+ ), /* @__PURE__ */ React7.createElement(
1244
+ "div",
1245
+ {
1246
+ className: "hawa-fixed -hawa-z-10 hawa-overflow-y-auto hawa-transition-all",
1247
+ style: isRTL ? {
1248
+ height: `calc(100% - ${props.topBar ? "56" : "0"}px)`,
1249
+ width: `calc(100% - ${drawerSizeCondition}px)`,
1250
+ left: "0px",
1251
+ top: props.topBar ? "56px" : "0px"
1252
+ } : {
1253
+ height: `calc(100% - ${props.topBar ? "56" : "0"}px)`,
1254
+ width: `calc(100% - ${drawerSizeCondition}px)`,
1255
+ left: `${drawerSizeCondition}px`,
1256
+ top: props.topBar ? "56px" : "0px"
1257
+ }
1258
+ },
1259
+ props.children
1260
+ ));
1261
+ };
1262
+ var MenuIcon = () => /* @__PURE__ */ React7.createElement(
1263
+ "svg",
1264
+ {
1265
+ "aria-label": "Menu Button",
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__ */ React7.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
+ export {
1284
+ AppLayout
1285
+ };