@sikka/hawa 0.26.28 → 0.26.29

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