@sikka/hawa 0.48.1-next → 0.49.0-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 (299) hide show
  1. package/dist/accordion/index.js +3 -28
  2. package/dist/accordion/index.js.map +1 -1
  3. package/dist/accordion/index.mjs +3 -28
  4. package/dist/accordion/index.mjs.map +1 -1
  5. package/dist/alert/index.js +53 -98
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/alert/index.mjs +53 -98
  8. package/dist/alert/index.mjs.map +1 -1
  9. package/dist/appLayout/index.d.mts +2 -0
  10. package/dist/appLayout/index.d.ts +2 -0
  11. package/dist/appLayout/index.js +263 -409
  12. package/dist/appLayout/index.js.map +1 -1
  13. package/dist/appLayout/index.mjs +263 -409
  14. package/dist/appLayout/index.mjs.map +1 -1
  15. package/dist/appMenubar/index.js +15 -20
  16. package/dist/appMenubar/index.js.map +1 -1
  17. package/dist/appMenubar/index.mjs +15 -20
  18. package/dist/appMenubar/index.mjs.map +1 -1
  19. package/dist/appTabs/index.js +28 -37
  20. package/dist/appTabs/index.js.map +1 -1
  21. package/dist/appTabs/index.mjs +28 -37
  22. package/dist/appTabs/index.mjs.map +1 -1
  23. package/dist/appTopbar/index.js +125 -173
  24. package/dist/appTopbar/index.js.map +1 -1
  25. package/dist/appTopbar/index.mjs +125 -173
  26. package/dist/appTopbar/index.mjs.map +1 -1
  27. package/dist/avatar/index.js.map +1 -1
  28. package/dist/avatar/index.mjs.map +1 -1
  29. package/dist/backToTop/index.js +50 -82
  30. package/dist/backToTop/index.js.map +1 -1
  31. package/dist/backToTop/index.mjs +50 -82
  32. package/dist/backToTop/index.mjs.map +1 -1
  33. package/dist/badge/index.d.mts +1 -1
  34. package/dist/badge/index.d.ts +1 -1
  35. package/dist/badge/index.js +2 -18
  36. package/dist/badge/index.js.map +1 -1
  37. package/dist/badge/index.mjs +2 -18
  38. package/dist/badge/index.mjs.map +1 -1
  39. package/dist/blocks/auth/index.js +202 -468
  40. package/dist/blocks/auth/index.mjs +96 -280
  41. package/dist/blocks/feedback/index.js +214 -375
  42. package/dist/blocks/feedback/index.mjs +12 -25
  43. package/dist/blocks/index.js +604 -1122
  44. package/dist/blocks/index.mjs +132 -291
  45. package/dist/blocks/misc/index.js +136 -251
  46. package/dist/blocks/misc/index.mjs +29 -54
  47. package/dist/blocks/pricing/index.js +220 -397
  48. package/dist/blocks/pricing/index.mjs +63 -134
  49. package/dist/breadcrumb/index.js +1 -5
  50. package/dist/breadcrumb/index.js.map +1 -1
  51. package/dist/breadcrumb/index.mjs +1 -5
  52. package/dist/breadcrumb/index.mjs.map +1 -1
  53. package/dist/button/index.js +50 -82
  54. package/dist/button/index.js.map +1 -1
  55. package/dist/button/index.mjs +50 -82
  56. package/dist/button/index.mjs.map +1 -1
  57. package/dist/calendar/index.js +50 -82
  58. package/dist/calendar/index.js.map +1 -1
  59. package/dist/calendar/index.mjs +50 -82
  60. package/dist/calendar/index.mjs.map +1 -1
  61. package/dist/card/index.js +7 -35
  62. package/dist/card/index.js.map +1 -1
  63. package/dist/card/index.mjs +7 -35
  64. package/dist/card/index.mjs.map +1 -1
  65. package/dist/carousel/index.js +15 -27
  66. package/dist/carousel/index.js.map +1 -1
  67. package/dist/carousel/index.mjs +15 -27
  68. package/dist/carousel/index.mjs.map +1 -1
  69. package/dist/checkbox/index.js +2 -13
  70. package/dist/checkbox/index.js.map +1 -1
  71. package/dist/checkbox/index.mjs +2 -13
  72. package/dist/checkbox/index.mjs.map +1 -1
  73. package/dist/chip/index.js +2 -16
  74. package/dist/chip/index.js.map +1 -1
  75. package/dist/chip/index.mjs +2 -16
  76. package/dist/chip/index.mjs.map +1 -1
  77. package/dist/{chunk-WUMDFBEK.mjs → chunk-3CHFVHTW.mjs} +43 -54
  78. package/dist/{chunk-2LUXOXAL.mjs → chunk-5SQBJRWE.mjs} +3 -9
  79. package/dist/{chunk-C2UOOH4X.mjs → chunk-B53SP2WZ.mjs} +3 -17
  80. package/dist/chunk-GHGWQVTM.mjs +150 -0
  81. package/dist/{chunk-5S5DR7KF.mjs → chunk-I23ONEDJ.mjs} +2 -10
  82. package/dist/{chunk-JFWD2ICY.mjs → chunk-JT7R3L5O.mjs} +54 -62
  83. package/dist/{chunk-6SJUUJOV.mjs → chunk-KDGJZPWK.mjs} +295 -574
  84. package/dist/{chunk-AWJSHOYU.mjs → chunk-KSJGXQTE.mjs} +1 -1
  85. package/dist/{chunk-NMW4GM4G.mjs → chunk-SE2JMXYG.mjs} +104 -144
  86. package/dist/{chunk-GBLWUEYN.mjs → chunk-ULRL4WI6.mjs} +176 -256
  87. package/dist/{chunk-IFWYR5W2.mjs → chunk-VUELRPUL.mjs} +57 -117
  88. package/dist/{chunk-WL7C2A5D.mjs → chunk-WQR4XZGL.mjs} +8 -15
  89. package/dist/codeBlock/index.js +50 -82
  90. package/dist/codeBlock/index.js.map +1 -1
  91. package/dist/codeBlock/index.mjs +50 -82
  92. package/dist/codeBlock/index.mjs.map +1 -1
  93. package/dist/colorPicker/index.js +21 -33
  94. package/dist/colorPicker/index.js.map +1 -1
  95. package/dist/colorPicker/index.mjs +22 -37
  96. package/dist/colorPicker/index.mjs.map +1 -1
  97. package/dist/combobox/index.d.mts +1 -1
  98. package/dist/combobox/index.d.ts +1 -1
  99. package/dist/combobox/index.js +141 -223
  100. package/dist/combobox/index.js.map +1 -1
  101. package/dist/combobox/index.mjs +141 -223
  102. package/dist/combobox/index.mjs.map +1 -1
  103. package/dist/command/index.d.mts +1 -1
  104. package/dist/command/index.d.ts +1 -1
  105. package/dist/command/index.js +129 -212
  106. package/dist/command/index.js.map +1 -1
  107. package/dist/command/index.mjs +129 -212
  108. package/dist/command/index.mjs.map +1 -1
  109. package/dist/dataTable/index.js +254 -394
  110. package/dist/dataTable/index.js.map +1 -1
  111. package/dist/dataTable/index.mjs +254 -394
  112. package/dist/dataTable/index.mjs.map +1 -1
  113. package/dist/datePicker/index.js +64 -105
  114. package/dist/datePicker/index.js.map +1 -1
  115. package/dist/datePicker/index.mjs +64 -105
  116. package/dist/datePicker/index.mjs.map +1 -1
  117. package/dist/destroyableCard/index.js +8 -39
  118. package/dist/destroyableCard/index.js.map +1 -1
  119. package/dist/destroyableCard/index.mjs +8 -39
  120. package/dist/destroyableCard/index.mjs.map +1 -1
  121. package/dist/dialog/index.js +70 -122
  122. package/dist/dialog/index.js.map +1 -1
  123. package/dist/dialog/index.mjs +70 -122
  124. package/dist/dialog/index.mjs.map +1 -1
  125. package/dist/docsLayout/index.js +169 -358
  126. package/dist/docsLayout/index.js.map +1 -1
  127. package/dist/docsLayout/index.mjs +169 -358
  128. package/dist/docsLayout/index.mjs.map +1 -1
  129. package/dist/docsSidebar/index.js +9 -16
  130. package/dist/docsSidebar/index.js.map +1 -1
  131. package/dist/docsSidebar/index.mjs +9 -16
  132. package/dist/docsSidebar/index.mjs.map +1 -1
  133. package/dist/dropdownMenu/index.js +124 -164
  134. package/dist/dropdownMenu/index.js.map +1 -1
  135. package/dist/dropdownMenu/index.mjs +124 -164
  136. package/dist/dropdownMenu/index.mjs.map +1 -1
  137. package/dist/elements/index.d.mts +3 -3
  138. package/dist/elements/index.d.ts +3 -3
  139. package/dist/elements/index.js +841 -1505
  140. package/dist/elements/index.mjs +381 -718
  141. package/dist/fileDropzone/index.js +60 -159
  142. package/dist/fileDropzone/index.js.map +1 -1
  143. package/dist/fileDropzone/index.mjs +60 -159
  144. package/dist/fileDropzone/index.mjs.map +1 -1
  145. package/dist/glow/index.js +4 -16
  146. package/dist/glow/index.js.map +1 -1
  147. package/dist/glow/index.mjs +4 -16
  148. package/dist/glow/index.mjs.map +1 -1
  149. package/dist/hooks/index.d.mts +1 -5
  150. package/dist/hooks/index.d.ts +1 -5
  151. package/dist/hooks/index.js +11 -24
  152. package/dist/hooks/index.mjs +2 -2
  153. package/dist/{index-B0aJcA6d.d.ts → index-BgNycocQ.d.mts} +2 -2
  154. package/dist/{index-B0aJcA6d.d.mts → index-BgNycocQ.d.ts} +2 -2
  155. package/dist/index.css +1 -2
  156. package/dist/index.d.mts +6 -8
  157. package/dist/index.d.ts +6 -8
  158. package/dist/index.js +1194 -2170
  159. package/dist/index.mjs +1195 -2174
  160. package/dist/input/index.js +20 -29
  161. package/dist/input/index.js.map +1 -1
  162. package/dist/input/index.mjs +20 -29
  163. package/dist/input/index.mjs.map +1 -1
  164. package/dist/interfaceSettings/index.js +122 -163
  165. package/dist/interfaceSettings/index.js.map +1 -1
  166. package/dist/interfaceSettings/index.mjs +122 -163
  167. package/dist/interfaceSettings/index.mjs.map +1 -1
  168. package/dist/label/index.js +19 -26
  169. package/dist/label/index.js.map +1 -1
  170. package/dist/label/index.mjs +19 -26
  171. package/dist/label/index.mjs.map +1 -1
  172. package/dist/layout/index.d.mts +2 -0
  173. package/dist/layout/index.d.ts +2 -0
  174. package/dist/layout/index.js +434 -790
  175. package/dist/layout/index.mjs +143 -243
  176. package/dist/loading/index.js +30 -53
  177. package/dist/loading/index.js.map +1 -1
  178. package/dist/loading/index.mjs +30 -53
  179. package/dist/loading/index.mjs.map +1 -1
  180. package/dist/logos/index.js +66 -191
  181. package/dist/logos/index.js.map +1 -1
  182. package/dist/logos/index.mjs +66 -191
  183. package/dist/logos/index.mjs.map +1 -1
  184. package/dist/navbar/index.js +1 -4
  185. package/dist/navbar/index.js.map +1 -1
  186. package/dist/navbar/index.mjs +1 -4
  187. package/dist/navbar/index.mjs.map +1 -1
  188. package/dist/navigationMenu/index.js +14 -22
  189. package/dist/navigationMenu/index.js.map +1 -1
  190. package/dist/navigationMenu/index.mjs +14 -22
  191. package/dist/navigationMenu/index.mjs.map +1 -1
  192. package/dist/pagination/index.js +1 -5
  193. package/dist/pagination/index.js.map +1 -1
  194. package/dist/pagination/index.mjs +1 -5
  195. package/dist/pagination/index.mjs.map +1 -1
  196. package/dist/passwordInput/index.js +36 -65
  197. package/dist/passwordInput/index.js.map +1 -1
  198. package/dist/passwordInput/index.mjs +36 -65
  199. package/dist/passwordInput/index.mjs.map +1 -1
  200. package/dist/phoneInput/index.js +20 -29
  201. package/dist/phoneInput/index.js.map +1 -1
  202. package/dist/phoneInput/index.mjs +20 -29
  203. package/dist/phoneInput/index.mjs.map +1 -1
  204. package/dist/pinInput/index.js +14 -16
  205. package/dist/pinInput/index.js.map +1 -1
  206. package/dist/pinInput/index.mjs +14 -16
  207. package/dist/pinInput/index.mjs.map +1 -1
  208. package/dist/popover/index.js +14 -24
  209. package/dist/popover/index.js.map +1 -1
  210. package/dist/popover/index.mjs +14 -24
  211. package/dist/popover/index.mjs.map +1 -1
  212. package/dist/progress/index.js +19 -26
  213. package/dist/progress/index.js.map +1 -1
  214. package/dist/progress/index.mjs +19 -26
  215. package/dist/progress/index.mjs.map +1 -1
  216. package/dist/progressCircle/index.js +67 -71
  217. package/dist/progressCircle/index.js.map +1 -1
  218. package/dist/progressCircle/index.mjs +67 -71
  219. package/dist/progressCircle/index.mjs.map +1 -1
  220. package/dist/radio/index.js +122 -163
  221. package/dist/radio/index.js.map +1 -1
  222. package/dist/radio/index.mjs +122 -163
  223. package/dist/radio/index.mjs.map +1 -1
  224. package/dist/scrollArea/index.js.map +1 -1
  225. package/dist/scrollArea/index.mjs.map +1 -1
  226. package/dist/scrollIndicator/index.js +1 -4
  227. package/dist/scrollIndicator/index.js.map +1 -1
  228. package/dist/scrollIndicator/index.mjs +1 -4
  229. package/dist/scrollIndicator/index.mjs.map +1 -1
  230. package/dist/select/index.js +20 -29
  231. package/dist/select/index.js.map +1 -1
  232. package/dist/select/index.mjs +20 -29
  233. package/dist/select/index.mjs.map +1 -1
  234. package/dist/separator/index.js.map +1 -1
  235. package/dist/separator/index.mjs.map +1 -1
  236. package/dist/sheet/index.js +42 -53
  237. package/dist/sheet/index.js.map +1 -1
  238. package/dist/sheet/index.mjs +42 -53
  239. package/dist/sheet/index.mjs.map +1 -1
  240. package/dist/sidebar/index.js +66 -133
  241. package/dist/sidebar/index.js.map +1 -1
  242. package/dist/sidebar/index.mjs +66 -133
  243. package/dist/sidebar/index.mjs.map +1 -1
  244. package/dist/signature/index.js +19 -26
  245. package/dist/signature/index.js.map +1 -1
  246. package/dist/signature/index.mjs +19 -26
  247. package/dist/signature/index.mjs.map +1 -1
  248. package/dist/simpleTable/index.js +50 -81
  249. package/dist/simpleTable/index.js.map +1 -1
  250. package/dist/simpleTable/index.mjs +50 -81
  251. package/dist/simpleTable/index.mjs.map +1 -1
  252. package/dist/skeleton/index.js.map +1 -1
  253. package/dist/skeleton/index.mjs.map +1 -1
  254. package/dist/slider/index.js.map +1 -1
  255. package/dist/slider/index.mjs.map +1 -1
  256. package/dist/sonner/index.js.map +1 -1
  257. package/dist/sonner/index.mjs.map +1 -1
  258. package/dist/sortButton/index.js +50 -82
  259. package/dist/sortButton/index.js.map +1 -1
  260. package/dist/sortButton/index.mjs +50 -82
  261. package/dist/sortButton/index.mjs.map +1 -1
  262. package/dist/splitButton/index.js +214 -294
  263. package/dist/splitButton/index.js.map +1 -1
  264. package/dist/splitButton/index.mjs +214 -294
  265. package/dist/splitButton/index.mjs.map +1 -1
  266. package/dist/stats/index.js +7 -35
  267. package/dist/stats/index.js.map +1 -1
  268. package/dist/stats/index.mjs +7 -35
  269. package/dist/stats/index.mjs.map +1 -1
  270. package/dist/switch/index.js +24 -34
  271. package/dist/switch/index.js.map +1 -1
  272. package/dist/switch/index.mjs +24 -34
  273. package/dist/switch/index.mjs.map +1 -1
  274. package/dist/table/index.js +27 -29
  275. package/dist/table/index.js.map +1 -1
  276. package/dist/table/index.mjs +27 -29
  277. package/dist/table/index.mjs.map +1 -1
  278. package/dist/tabs/index.js +54 -76
  279. package/dist/tabs/index.js.map +1 -1
  280. package/dist/tabs/index.mjs +54 -76
  281. package/dist/tabs/index.mjs.map +1 -1
  282. package/dist/textarea/index.js +21 -38
  283. package/dist/textarea/index.js.map +1 -1
  284. package/dist/textarea/index.mjs +21 -38
  285. package/dist/textarea/index.mjs.map +1 -1
  286. package/dist/toast/index.js +2 -10
  287. package/dist/toast/index.js.map +1 -1
  288. package/dist/toast/index.mjs +2 -10
  289. package/dist/toast/index.mjs.map +1 -1
  290. package/dist/toaster/index.js +3 -16
  291. package/dist/toaster/index.js.map +1 -1
  292. package/dist/toaster/index.mjs +3 -16
  293. package/dist/toaster/index.mjs.map +1 -1
  294. package/dist/tooltip/index.js +19 -26
  295. package/dist/tooltip/index.js.map +1 -1
  296. package/dist/tooltip/index.mjs +19 -26
  297. package/dist/tooltip/index.mjs.map +1 -1
  298. package/package.json +12 -12
  299. package/dist/chunk-JP2N5WKD.mjs +0 -190
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/calendar/Calendar.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DateRange, DayPicker, type DayPickerProps } from \"react-day-picker\";\n\nimport { cn } from \"@util/index\";\n\nimport { Button, buttonVariants } from \"../button\";\nimport { HelperText } from \"../helperText\";\n\nexport type CalendarProps = DayPickerProps & {\n allowPastDates?: boolean;\n helperText?: string;\n};\nexport type CalendarValueType = {\n single: Date;\n multiple: Date[];\n range: DateRange;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n dir = \"ltr\",\n allowPastDates = false,\n ...restProps\n}: CalendarProps) {\n return (\n <div>\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"hawa-p-0\", className)}\n classNames={{\n root: \"hawa-w-fit hawa-relative hawa-p-3 \",\n months: \"hawa-flex hawa-flex-col sm:hawa-flex-row sm:hawa-space-y-0\",\n month: \"hawa-space-y-4\",\n month_caption:\n \"hawa-flex hawa-justify-center hawa-py-1 hawa-relative hawa-items-center\",\n caption_label: \"hawa-text-sm hawa-font-medium\",\n nav: \"hawa-z-50 hawa-flex hawa-items-start\",\n\n button_previous: buttonVariants({\n variant: \"outline\",\n className: cn(\n \"hawa-absolute hawa-start-3 hawa-flex hawa-items-center !hawa-size-7 !hawa-p-0 hawa-justify-center\",\n ),\n }),\n\n button_next: buttonVariants({\n variant: \"outline\",\n className: cn(\n \"hawa-absolute hawa-end-3 !hawa-size-7 !hawa-p-0 hawa-justify-center hawa-flex hawa-items-center\",\n ),\n }),\n\n month_grid: \"hawa-w-full hawa-border-collapse hawa-space-y-1 \",\n weekdays: \"hawa-flex\",\n weekday:\n \"hawa-text-muted-foreground hawa-rounded-md hawa-w-9 hawa-font-normal hawa-text-[0.8rem]\",\n week: \"hawa-flex hawa-w-full hawa-mt-2\",\n\n range_end: \"day-range-end\",\n\n today: \"hawa-bg-accent hawa-text-accent-foreground hawa-rounded\",\n outside:\n \"day-outside hawa-text-muted-foreground hawa-opacity-50 aria-selected:hawa-bg-accent/50 aria-selected:hawa-text-muted-foreground aria-selected:hawa-opacity-30\",\n disabled: \"hawa-text-muted-foreground hawa-opacity-50\",\n range_middle:\n \"aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground\",\n hidden: \"hawa-invisible\",\n ...classNames,\n }}\n components={{\n DayButton: (props) => {\n let selectedDate = new Date(props.day.date);\n return (\n <Button\n {...props}\n onClick={(e) => {\n if (\n (allowPastDates ||\n selectedDate >= new Date() ||\n props.modifiers.today) &&\n props.onClick\n ) {\n props.onClick(e);\n }\n // restProps.onDayClick?.(e);\n }}\n variant={props.modifiers.selected ? \"default\" : \"ghost\"}\n className=\"hawa-h-9 hawa-w-9 hawa-text-center hawa-text-sm hawa-p-0 hawa-relative [&:has([aria-selected].range-end)]:hawa-rounded-r-md [&:has([aria-selected].outside)]:hawa-bg-accent/50 [&:has([aria-selected])]:hawa-bg-accent first:[&:has([aria-selected])]:hawa-rounded-l-md last:[&:has([aria-selected])]:hawa-rounded-r-md focus-within:hawa-relative focus-within:hawa-z-20\"\n >\n {props.children}\n </Button>\n );\n },\n\n Chevron: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n aria-label={\n props.orientation === \"left\" ? \"Previous Month\" : \"Next Month\"\n }\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\"hawa-opacity-80\", {\n \"ltr:hawa-rotate-180\":\n (dir === \"ltr\" && props.orientation === \"right\") ||\n (dir === \"rtl\" && props.orientation === \"right\"),\n \"rtl:hawa-rotate-180\":\n (dir === \"rtl\" && props.orientation === \"left\") ||\n (dir === \"ltr\" && props.orientation === \"left\"),\n \"hawa-rotate-180 rtl:hawa-rotate-0\":\n props.orientation === \"right\",\n \"hawa-rotate-0\": props.orientation === \"left\",\n })}\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n ),\n }}\n {...restProps}\n />\n {restProps.helperText && (\n <div className=\"hawa-py-0 hawa-flex hawa-flex-col hawa-justify-center hawa-items-center\">\n <HelperText helperText={restProps.helperText} />\n </div>\n )}\n </div>\n );\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary:\n \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"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\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={\n size === \"icon\" || size === \"smallIcon\"\n ? \"spinner\"\n : \"dots-pulse\"\n }\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"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\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\",\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\",\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\",\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-row hawa-gap-2\",\n classNames?.container,\n )}\n >\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\n \"squircle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n 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\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n 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\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container,\n )}\n ></div>\n );\n case \"orbit\":\n return (\n <div className={cn(\"orbit-container\", classNames?.container)}></div>\n );\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\n \"circle-container\",\n sizeStyles[size],\n classNames?.container,\n )}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.track,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.car,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"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../../elements/calendar/Calendar.tsx","../../util/index.ts","../../elements/button/Button.tsx","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/loading/Loading.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DateRange, DayPicker, type DayPickerProps } from \"react-day-picker\";\n\nimport { cn } from \"@util/index\";\n\nimport { Button, buttonVariants } from \"../button\";\nimport { HelperText } from \"../helperText\";\n\nexport type CalendarProps = DayPickerProps & {\n allowPastDates?: boolean;\n helperText?: string;\n};\nexport type CalendarValueType = {\n single: Date;\n multiple: Date[];\n range: DateRange;\n};\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n dir = \"ltr\",\n allowPastDates = false,\n ...restProps\n}: CalendarProps) {\n return (\n <div>\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"hawa-p-0\", className)}\n classNames={{\n root: \"hawa-w-fit hawa-relative hawa-p-3 \",\n months: \"hawa-flex hawa-flex-col sm:hawa-flex-row sm:hawa-space-y-0\",\n month: \"hawa-space-y-4\",\n month_caption: \"hawa-flex hawa-justify-center hawa-py-1 hawa-relative hawa-items-center\",\n caption_label: \"hawa-text-sm hawa-font-medium\",\n nav: \"hawa-z-50 hawa-flex hawa-items-start\",\n\n button_previous: buttonVariants({\n variant: \"outline\",\n className: cn(\n \"hawa-absolute hawa-start-3 hawa-flex hawa-items-center !hawa-size-7 !hawa-p-0 hawa-justify-center\",\n ),\n }),\n\n button_next: buttonVariants({\n variant: \"outline\",\n className: cn(\n \"hawa-absolute hawa-end-3 !hawa-size-7 !hawa-p-0 hawa-justify-center hawa-flex hawa-items-center\",\n ),\n }),\n\n month_grid: \"hawa-w-full hawa-border-collapse hawa-space-y-1 \",\n weekdays: \"hawa-flex\",\n weekday:\n \"hawa-text-muted-foreground hawa-rounded-md hawa-w-9 hawa-font-normal hawa-text-[0.8rem]\",\n week: \"hawa-flex hawa-w-full hawa-mt-2\",\n\n range_end: \"day-range-end\",\n\n today: \"hawa-bg-accent hawa-text-accent-foreground hawa-rounded\",\n outside:\n \"day-outside hawa-text-muted-foreground hawa-opacity-50 aria-selected:hawa-bg-accent/50 aria-selected:hawa-text-muted-foreground aria-selected:hawa-opacity-30\",\n disabled: \"hawa-text-muted-foreground hawa-opacity-50\",\n range_middle: \"aria-selected:hawa-bg-accent aria-selected:hawa-text-accent-foreground\",\n hidden: \"hawa-invisible\",\n ...classNames,\n }}\n components={{\n DayButton: (props) => {\n let selectedDate = new Date(props.day.date);\n return (\n <Button\n {...props}\n onClick={(e) => {\n if (\n (allowPastDates || selectedDate >= new Date() || props.modifiers.today) &&\n props.onClick\n ) {\n props.onClick(e);\n }\n // restProps.onDayClick?.(e);\n }}\n variant={props.modifiers.selected ? \"default\" : \"ghost\"}\n className=\"hawa-h-9 hawa-w-9 hawa-text-center hawa-text-sm hawa-p-0 hawa-relative [&:has([aria-selected].range-end)]:hawa-rounded-r-md [&:has([aria-selected].outside)]:hawa-bg-accent/50 [&:has([aria-selected])]:hawa-bg-accent first:[&:has([aria-selected])]:hawa-rounded-l-md last:[&:has([aria-selected])]:hawa-rounded-r-md focus-within:hawa-relative focus-within:hawa-z-20\"\n >\n {props.children}\n </Button>\n );\n },\n\n Chevron: (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n aria-label={props.orientation === \"left\" ? \"Previous Month\" : \"Next Month\"}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\"hawa-opacity-80\", {\n \"ltr:hawa-rotate-180\":\n (dir === \"ltr\" && props.orientation === \"right\") ||\n (dir === \"rtl\" && props.orientation === \"right\"),\n \"rtl:hawa-rotate-180\":\n (dir === \"rtl\" && props.orientation === \"left\") ||\n (dir === \"ltr\" && props.orientation === \"left\"),\n \"hawa-rotate-180 rtl:hawa-rotate-0\": props.orientation === \"right\",\n \"hawa-rotate-0\": props.orientation === \"left\",\n })}\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n ),\n }}\n {...restProps}\n />\n {restProps.helperText && (\n <div className=\"hawa-py-0 hawa-flex hawa-flex-col hawa-justify-center hawa-items-center\">\n <HelperText helperText={restProps.helperText} />\n </div>\n )}\n </div>\n );\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label\";\nimport { Loading } from \"../loading/Loading\";\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default: \"hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90\",\n light: \"hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40\",\n destructive:\n \"hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90\",\n outline:\n \"hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n secondary: \"hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80\",\n ghost: \"hover:hawa-bg-accent hover:hawa-text-accent-foreground\",\n link: \"hawa-text-primary hawa-underline-offset-4 hover:hawa-underline\",\n combobox: \"hawa-bg-background hawa-border\",\n neoBrutalism: \"neo-brutalism\",\n // \"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\",\n },\n size: {\n default: \"hawa-h-10 hawa-px-4 hawa-py-2\",\n heightless: \"hawa-px-4 hawa-py-4\",\n xs: \"hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 \",\n sm: \"hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3\",\n lg: \"hawa-h-11 hawa-rounded-md hawa-px-8\",\n xl: \"hawa-h-14 hawa-rounded-md hawa-px-10\",\n icon: \"hawa-h-10 hawa-w-10\",\n smallIcon: \"hawa-h-7 hawa-w-7\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"default\" },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n centered?: boolean;\n isLoading?: boolean;\n label?: string;\n labelProps?: LabelProps;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n showHelperText?: boolean;\n /**\n * If true, the button will include a label and helper text. This is useful for forms where the button is part of the form.\n */\n asInput?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n label,\n variant,\n size,\n asChild = false,\n centered = true,\n isLoading,\n children,\n labelProps,\n showHelperText = false,\n asInput = false,\n ...props\n },\n ref,\n ) => {\n const Comp = \"button\";\n\n // Determine the color for the Loading component based on the variant\n const loadingColor =\n variant === \"outline\" || variant === \"ghost\" || variant === \"neoBrutalism\"\n ? \"hawa-bg-primary\"\n : \"hawa-bg-primary-foreground\";\n\n if (asInput) {\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n {label && <Label {...labelProps}>{label}</Label>}\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={size === \"icon\" || size === \"smallIcon\" ? \"spinner\" : \"dots-pulse\"}\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n {showHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n } else {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, className }),\n centered && \"hawa-justify-center\",\n )}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Loading\n design={size === \"icon\" || size === \"smallIcon\" ? \"spinner\" : \"dots-pulse\"}\n themeMode={variant === \"outline\" ? \"light\" : \"dark\"}\n color={loadingColor}\n size={size === \"sm\" || size === \"xs\" ? \"xs\" : \"button\"}\n />\n ) : (\n children\n )}\n </Comp>\n );\n }\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: string | React.ReactNode }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"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\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider delayDuration={delayDuration} {...providerProps}>\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>{children}</TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React, { FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype LoadingTypes = {\n /** Specifies the size of the loading component.*/\n size?: \"button\" | \"xs\" | \"sm\" | \"normal\" | \"lg\" | \"xl\";\n /** Determines the design of the loading animation.*/\n design?:\n | \"spinner\"\n | \"dots-bounce\"\n | \"dots-pulse\"\n | \"pulse\"\n | \"spinner-dots\"\n | \"squircle\"\n | \"square\"\n | \"progress\"\n | \"orbit\";\n /** Specifies the color of the loading component. By default it will inherit the value of --primary global CSS variable*/\n color?: string;\n classNames?: {\n container?: string;\n track?: string;\n car?: string;\n };\n themeMode?: \"dark\" | \"light\";\n};\n\nexport const Loading: FC<LoadingTypes> = ({\n design = \"spinner\",\n size = \"normal\",\n themeMode = \"light\",\n classNames,\n color,\n ...props\n}) => {\n let sizeStyles = {\n button: \"hawa-h-4 hawa-w-4\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"hawa-h-8 hawa-w-8\",\n lg: \"hawa-h-14 hawa-w-14\",\n xl: \"hawa-h-24 hawa-w-24\",\n };\n let progressSizes = {\n button: \"hawa-h-1\",\n xs: \"hawa-h-1 hawa-w-1\",\n sm: \"hawa-h-6 hawa-w-6\",\n normal: \"\",\n lg: \"hawa-h-6\",\n xl: \"hawa-h-10 hawa-w-64\",\n };\n\n let animationStyles: any = {\n pulse: \"hawa-animate-in hawa-fade-in hawa-duration-1000\",\n bounce: \"hawa-animate-bounce\",\n };\n switch (design.split(\"-\")[0]) {\n case \"dots\":\n return (\n <div className={cn(\"hawa-flex hawa-flex-row hawa-gap-2\", classNames?.container)}>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n <div\n className={cn(\n \"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite\",\n size === \"button\" ? \"hawa-h-2 hawa-w-2\" : sizeStyles[size],\n animationStyles[design.split(\"-\")[1]],\n color ? color : \"hawa-bg-primary\",\n )}\n ></div>\n </div>\n );\n case \"square\":\n return (\n <svg\n className={cn(\"squircle-container\", sizeStyles[size], classNames?.container)}\n viewBox=\"0 0 35 35\"\n height=\"35\"\n width=\"35\"\n >\n <rect\n className=\"squircle-track\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n />\n <rect\n className=\"square-car\"\n x=\"2.5\"\n y=\"2.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n width=\"32.5\"\n height=\"32.5\"\n pathLength=\"100\"\n />\n </svg>\n );\n case \"squircle\":\n return (\n <svg\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 37 37\"\n height=\"37\"\n width=\"37\"\n preserveAspectRatio=\"xMidYMid meet\"\n className={cn(\"squircle-container\", sizeStyles[size], classNames?.container)}\n >\n <path\n className={cn(\"squircle-track\", classNames?.track)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n 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\"\n ></path>\n <path\n className={cn(\"squircle-car\", classNames?.car)}\n fill=\"none\"\n strokeWidth=\"5\"\n pathLength=\"100\"\n 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\"\n ></path>\n </svg>\n );\n case \"progress\":\n return (\n <div\n className={cn(\n \"progress-loading after:hawa-rounded hawa-rounded\",\n progressSizes[size],\n classNames?.container,\n )}\n ></div>\n );\n case \"orbit\":\n return <div className={cn(\"orbit-container\", classNames?.container)}></div>;\n\n default:\n return (\n <svg\n viewBox=\"0 0 40 40\"\n height=\"40\"\n width=\"40\"\n className={cn(\"circle-container\", sizeStyles[size], classNames?.container)}\n >\n <circle\n className={cn(\n \"circle-track\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.track,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n strokeWidth=\"5px\"\n pathLength=\"100\"\n />\n <circle\n className={cn(\n \"circle-car\",\n {\n \"hawa-stroke-primary-foreground\": themeMode === \"dark\",\n \"hawa-stroke-primary\": themeMode === \"light\",\n },\n classNames?.car,\n )}\n cx=\"20\"\n cy=\"20\"\n r=\"17.5\"\n fill=\"none\"\n pathLength=\"100\"\n strokeWidth=\"5px\"\n />\n </svg>\n );\n }\n};\n"],"mappings":";;;AAAA,YAAYA,YAAW;AACvB,SAAoB,iBAAsC;;;ACD1D,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,YAAYC,YAAW;AAGvB,SAAS,WAA8B;;;ACHvC,OAAO,WAAW;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,YAAYC,YAAW;;;ACAvB,OAAOC,YAAW;AAElB,YAAY,sBAAsB;AAKlC,IAAM,iBAAi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AAA,YACR,MAAK;AAAA,YACL,QAAO;AAAA,YACP,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,gBAAe;AAAA,YACf,WAAW,GAAG,mBAAmB;AAAA,cAC/B,uBACG,QAAQ,SAAS,MAAM,gBAAgB,WACvC,QAAQ,SAAS,MAAM,gBAAgB;AAAA,cAC1C,uBACG,QAAQ,SAAS,MAAM,gBAAgB,UACvC,QAAQ,SAAS,MAAM,gBAAgB;AAAA,cAC1C,qCAAqC,MAAM,gBAAgB;AAAA,cAC3D,iBAAiB,MAAM,gBAAgB;AAAA,YACzC,CAAC;AAAA;AAAA,UAED,qCAAC,UAAK,GAAE,kBAAiB;AAAA,QAC3B;AAAA,MAEJ;AAAA,MACC,GAAG;AAAA;AAAA,EACN,GACC,UAAU,cACT,qCAAC,SAAI,WAAU,6EACb,qCAAC,cAAW,YAAY,UAAU,YAAY,CAChD,CAEJ;AAEJ;AACA,SAAS,cAAc;","names":["React","React","React","React","React","React","React"]}
@@ -52,13 +52,7 @@ function cn(...inputs) {
52
52
 
53
53
  // elements/card/Card.tsx
54
54
  var Card = React.forwardRef(
55
- ({
56
- className,
57
- variant = "default",
58
- clickable = false,
59
- asContainer = false,
60
- ...props
61
- }, ref) => {
55
+ ({ className, variant = "default", clickable = false, asContainer = false, ...props }, ref) => {
62
56
  let variantStyles = {
63
57
  default: cn(
64
58
  "hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm",
@@ -70,14 +64,7 @@ var Card = React.forwardRef(
70
64
  clickable && "hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active"
71
65
  )
72
66
  };
73
- return /* @__PURE__ */ React.createElement(
74
- "div",
75
- {
76
- ref,
77
- className: cn(!asContainer && variantStyles[variant], className),
78
- ...props
79
- }
80
- );
67
+ return /* @__PURE__ */ React.createElement("div", { ref, className: cn(!asContainer && variantStyles[variant], className), ...props });
81
68
  }
82
69
  );
83
70
  var CardHeader = React.forwardRef(
@@ -85,30 +72,15 @@ var CardHeader = React.forwardRef(
85
72
  "div",
86
73
  {
87
74
  ref,
88
- className: cn(
89
- "hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6",
90
- className
91
- ),
75
+ className: cn("hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6", className),
92
76
  ...props
93
77
  }
94
78
  ), props.actions && /* @__PURE__ */ React.createElement("div", { className: "hawa-p-6" }, props.actions))
95
79
  );
96
- var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
97
- "h3",
98
- {
99
- ref,
100
- className: cn("hawa-text-2xl hawa-font-semibold", className),
101
- ...props
102
- }
103
- ));
104
- var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
105
- "p",
106
- {
107
- ref,
108
- className: cn("hawa-text-sm hawa-text-muted-foreground", className),
109
- ...props
110
- }
111
- ));
80
+ var CardTitle = React.forwardRef(
81
+ ({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("h3", { ref, className: cn("hawa-text-2xl hawa-font-semibold", className), ...props })
82
+ );
83
+ var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("p", { ref, className: cn("hawa-text-sm hawa-text-muted-foreground", className), ...props }));
112
84
  var CardContent = React.forwardRef(
113
85
  ({ headless, noPadding, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
114
86
  "div",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/card/index.ts","../../elements/card/Card.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Card\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n clickable?: boolean;\n variant?: \"default\" | \"neoBrutalism\";\n asContainer?: boolean;\n}\n\ntype CardContentProps = {\n headless?: boolean;\n noPadding?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n variant = \"default\",\n clickable = false,\n asContainer = false,\n ...props\n },\n ref,\n ) => {\n let variantStyles = {\n default: cn(\n \"hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm\",\n clickable &&\n \"hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:dark-shadow\",\n ),\n neoBrutalism: cn(\n \"neo-brutalism\",\n // \"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] transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms]\",\n clickable &&\n \"hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active\",\n ),\n };\n return (\n <div\n ref={ref}\n className={cn(!asContainer && variantStyles[variant], className)}\n {...props}\n />\n );\n },\n);\n\ntype CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n};\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n <div\n ref={ref}\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6\",\n className,\n )}\n {...props}\n />\n {props.actions && <div className=\"hawa-p-6\">{props.actions}</div>}\n </div>\n ),\n);\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"hawa-text-2xl hawa-font-semibold\", className)}\n {...props}\n />\n));\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"hawa-text-sm hawa-text-muted-foreground\", className)}\n {...props}\n />\n));\nconst CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(\n ({ headless, noPadding, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n headless ? \"hawa-pt-6\" : \"hawa-pt-0\",\n className,\n )}\n {...props}\n />\n ),\n);\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { noPadding?: boolean }\n>(({ className, noPadding, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n \"hawa-flex hawa-items-center hawa-pt-0\",\n className,\n )}\n {...props}\n />\n));\n\nCardDescription.displayName = \"CardDescription\";\nCardContent.displayName = \"CardContent\";\nCardHeader.displayName = \"CardHeader\";\nCardFooter.displayName = \"CardFooter\";\nCardTitle.displayName = \"CardTitle\";\nCard.displayName = \"Card\";\n\nexport {\n CardDescription,\n CardContent,\n CardHeader,\n CardFooter,\n CardTitle,\n Card,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADUA,IAAM,OAAa;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,GAAG;AAAA,EACL,GACA,QACG;AACH,QAAI,gBAAgB;AAAA,MAClB,SAAS;AAAA,QACP;AAAA,QACA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A,MACT,YAAY,aAAa;AAAA,MACzB;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,gBAAgB,cAAc;AAC9B,YAAY,cAAc;AAC1B,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,UAAU,cAAc;AACxB,KAAK,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../elements/card/index.ts","../../elements/card/Card.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Card\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n clickable?: boolean;\n variant?: \"default\" | \"neoBrutalism\";\n asContainer?: boolean;\n}\n\ntype CardContentProps = {\n headless?: boolean;\n noPadding?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant = \"default\", clickable = false, asContainer = false, ...props }, ref) => {\n let variantStyles = {\n default: cn(\n \"hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm\",\n clickable &&\n \"hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:dark-shadow\",\n ),\n neoBrutalism: cn(\n \"neo-brutalism\",\n // \"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] transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms]\",\n clickable &&\n \"hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active\",\n ),\n };\n return (\n <div ref={ref} className={cn(!asContainer && variantStyles[variant], className)} {...props} />\n );\n },\n);\n\ntype CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n};\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n <div\n ref={ref}\n className={cn(\"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6\", className)}\n {...props}\n />\n {props.actions && <div className=\"hawa-p-6\">{props.actions}</div>}\n </div>\n ),\n);\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3 ref={ref} className={cn(\"hawa-text-2xl hawa-font-semibold\", className)} {...props} />\n ),\n);\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"hawa-text-sm hawa-text-muted-foreground\", className)} {...props} />\n));\nconst CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(\n ({ headless, noPadding, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n headless ? \"hawa-pt-6\" : \"hawa-pt-0\",\n className,\n )}\n {...props}\n />\n ),\n);\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { noPadding?: boolean }\n>(({ className, noPadding, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n \"hawa-flex hawa-items-center hawa-pt-0\",\n className,\n )}\n {...props}\n />\n));\n\nCardDescription.displayName = \"CardDescription\";\nCardContent.displayName = \"CardContent\";\nCardHeader.displayName = \"CardHeader\";\nCardFooter.displayName = \"CardFooter\";\nCardTitle.displayName = \"CardTitle\";\nCard.displayName = \"Card\";\n\nexport { CardDescription, CardContent, CardHeader, CardFooter, CardTitle, Card };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;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C7C;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,YAAY,aAAa;AAAA,QACzB,WAAW,cAAc;AAAA,QACzB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,IAAM,aAAmB,iBAGvB,CAAC,EAAE,WAAW,WAAW,GAAG,MAAM,GAAG,QACrC;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT,YAAY,aAAa;AAAA,MACzB;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AAED,gBAAgB,cAAc;AAC9B,YAAY,cAAc;AAC1B,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,UAAU,cAAc;AACxB,KAAK,cAAc;","names":[]}
@@ -12,13 +12,7 @@ function cn(...inputs) {
12
12
 
13
13
  // elements/card/Card.tsx
14
14
  var Card = React.forwardRef(
15
- ({
16
- className,
17
- variant = "default",
18
- clickable = false,
19
- asContainer = false,
20
- ...props
21
- }, ref) => {
15
+ ({ className, variant = "default", clickable = false, asContainer = false, ...props }, ref) => {
22
16
  let variantStyles = {
23
17
  default: cn(
24
18
  "hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm",
@@ -30,14 +24,7 @@ var Card = React.forwardRef(
30
24
  clickable && "hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active"
31
25
  )
32
26
  };
33
- return /* @__PURE__ */ React.createElement(
34
- "div",
35
- {
36
- ref,
37
- className: cn(!asContainer && variantStyles[variant], className),
38
- ...props
39
- }
40
- );
27
+ return /* @__PURE__ */ React.createElement("div", { ref, className: cn(!asContainer && variantStyles[variant], className), ...props });
41
28
  }
42
29
  );
43
30
  var CardHeader = React.forwardRef(
@@ -45,30 +32,15 @@ var CardHeader = React.forwardRef(
45
32
  "div",
46
33
  {
47
34
  ref,
48
- className: cn(
49
- "hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6",
50
- className
51
- ),
35
+ className: cn("hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6", className),
52
36
  ...props
53
37
  }
54
38
  ), props.actions && /* @__PURE__ */ React.createElement("div", { className: "hawa-p-6" }, props.actions))
55
39
  );
56
- var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
57
- "h3",
58
- {
59
- ref,
60
- className: cn("hawa-text-2xl hawa-font-semibold", className),
61
- ...props
62
- }
63
- ));
64
- var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
65
- "p",
66
- {
67
- ref,
68
- className: cn("hawa-text-sm hawa-text-muted-foreground", className),
69
- ...props
70
- }
71
- ));
40
+ var CardTitle = React.forwardRef(
41
+ ({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("h3", { ref, className: cn("hawa-text-2xl hawa-font-semibold", className), ...props })
42
+ );
43
+ var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("p", { ref, className: cn("hawa-text-sm hawa-text-muted-foreground", className), ...props }));
72
44
  var CardContent = React.forwardRef(
73
45
  ({ headless, noPadding, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
74
46
  "div",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/card/Card.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n clickable?: boolean;\n variant?: \"default\" | \"neoBrutalism\";\n asContainer?: boolean;\n}\n\ntype CardContentProps = {\n headless?: boolean;\n noPadding?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n variant = \"default\",\n clickable = false,\n asContainer = false,\n ...props\n },\n ref,\n ) => {\n let variantStyles = {\n default: cn(\n \"hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm\",\n clickable &&\n \"hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:dark-shadow\",\n ),\n neoBrutalism: cn(\n \"neo-brutalism\",\n // \"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] transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms]\",\n clickable &&\n \"hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active\",\n ),\n };\n return (\n <div\n ref={ref}\n className={cn(!asContainer && variantStyles[variant], className)}\n {...props}\n />\n );\n },\n);\n\ntype CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n};\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n <div\n ref={ref}\n className={cn(\n \"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6\",\n className,\n )}\n {...props}\n />\n {props.actions && <div className=\"hawa-p-6\">{props.actions}</div>}\n </div>\n ),\n);\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"hawa-text-2xl hawa-font-semibold\", className)}\n {...props}\n />\n));\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"hawa-text-sm hawa-text-muted-foreground\", className)}\n {...props}\n />\n));\nconst CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(\n ({ headless, noPadding, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n headless ? \"hawa-pt-6\" : \"hawa-pt-0\",\n className,\n )}\n {...props}\n />\n ),\n);\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { noPadding?: boolean }\n>(({ className, noPadding, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n \"hawa-flex hawa-items-center hawa-pt-0\",\n className,\n )}\n {...props}\n />\n));\n\nCardDescription.displayName = \"CardDescription\";\nCardContent.displayName = \"CardContent\";\nCardHeader.displayName = \"CardHeader\";\nCardFooter.displayName = \"CardFooter\";\nCardTitle.displayName = \"CardTitle\";\nCard.displayName = \"Card\";\n\nexport {\n CardDescription,\n CardContent,\n CardHeader,\n CardFooter,\n CardTitle,\n Card,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADUA,IAAM,OAAa;AAAA,EACjB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,GAAG;AAAA,EACL,GACA,QACG;AACH,QAAI,gBAAgB;AAAA,MAClB,SAAS;AAAA,QACP;AAAA,QACA,aACE;AAAA,MACJ;AAAA,MACA,cAAc;AAAA,QACZ;AAAA;AAAA,QAEA,aACE;AAAA,MACJ;AAAA,IACF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,CAAC,eAAe,cAAc,OAAO,GAAG,SAAS;AAAA,QAC9D,GAAG;AAAA;AAAA,IACN;AAAA,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Card.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n clickable?: boolean;\n variant?: \"default\" | \"neoBrutalism\";\n asContainer?: boolean;\n}\n\ntype CardContentProps = {\n headless?: boolean;\n noPadding?: boolean;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ className, variant = \"default\", clickable = false, asContainer = false, ...props }, ref) => {\n let variantStyles = {\n default: cn(\n \"hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm\",\n clickable &&\n \"hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:dark-shadow\",\n ),\n neoBrutalism: cn(\n \"neo-brutalism\",\n // \"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] transition-all uppercase font-mono dark:bg-black font-bold py-2 px-4 rounded border-2 border-primary shadow-color-primary transition-[transform_50ms, box-shadow_50ms]\",\n clickable &&\n \"hawa-cursor-pointer active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active active:translate-x-0.5 active:translate-y-0.5 active:shadow-color-primary-active\",\n ),\n };\n return (\n <div ref={ref} className={cn(!asContainer && variantStyles[variant], className)} {...props} />\n );\n },\n);\n\ntype CardHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n};\nconst CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(\n ({ className, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-justify-between\">\n <div\n ref={ref}\n className={cn(\"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6\", className)}\n {...props}\n />\n {props.actions && <div className=\"hawa-p-6\">{props.actions}</div>}\n </div>\n ),\n);\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3 ref={ref} className={cn(\"hawa-text-2xl hawa-font-semibold\", className)} {...props} />\n ),\n);\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"hawa-text-sm hawa-text-muted-foreground\", className)} {...props} />\n));\nconst CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(\n ({ headless, noPadding, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n headless ? \"hawa-pt-6\" : \"hawa-pt-0\",\n className,\n )}\n {...props}\n />\n ),\n);\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { noPadding?: boolean }\n>(({ className, noPadding, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n noPadding ? \"hawa-p-0\" : \"hawa-p-6\",\n \"hawa-flex hawa-items-center hawa-pt-0\",\n className,\n )}\n {...props}\n />\n));\n\nCardDescription.displayName = \"CardDescription\";\nCardContent.displayName = \"CardContent\";\nCardHeader.displayName = \"CardHeader\";\nCardFooter.displayName = \"CardFooter\";\nCardTitle.displayName = \"CardTitle\";\nCard.displayName = \"Card\";\n\nexport { CardDescription, CardContent, CardHeader, CardFooter, CardTitle, Card };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADUA,IAAM,OAAa;AAAA,EACjB,CAAC,EAAE,WAAW,UAAU,WAAW,YAAY,OAAO,cAAc,OAAO,GAAG,MAAM,GAAG,QAAQ;AAC7F,QAAI,gBAA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,GAAG;AAAA;AACN,CACD;AAED,gBAAgB,cAAc;AAC9B,YAAY,cAAc;AAC1B,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,UAAU,cAAc;AACxB,KAAK,cAAc;","names":[]}
@@ -111,34 +111,22 @@ var Carousel = ({
111
111
  }
112
112
  ));
113
113
  };
114
- var Dots = ({
115
- onDotClick,
116
- itemsLength,
117
- selectedIndex,
118
- direction
119
- }) => {
114
+ var Dots = ({ onDotClick, itemsLength, selectedIndex, direction }) => {
120
115
  const arr = new Array(itemsLength).fill(0);
121
- return /* @__PURE__ */ import_react.default.createElement(
122
- "div",
123
- {
124
- dir: direction,
125
- className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
126
- },
127
- arr.map((_, index) => {
128
- const selected = index === selectedIndex;
129
- return /* @__PURE__ */ import_react.default.createElement(
130
- "div",
131
- {
132
- key: index,
133
- onClick: () => onDotClick(index),
134
- className: cn(
135
- "hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
136
- !selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
137
- )
138
- }
139
- );
140
- })
141
- );
116
+ return /* @__PURE__ */ import_react.default.createElement("div", { dir: direction, className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1" }, arr.map((_, index) => {
117
+ const selected = index === selectedIndex;
118
+ return /* @__PURE__ */ import_react.default.createElement(
119
+ "div",
120
+ {
121
+ key: index,
122
+ onClick: () => onDotClick(index),
123
+ className: cn(
124
+ "hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
125
+ !selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
126
+ )
127
+ }
128
+ );
129
+ }));
142
130
  };
143
131
  var CarouselControls = (props) => {
144
132
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2" }, /* @__PURE__ */ import_react.default.createElement(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/carousel/index.ts","../../elements/carousel/Carousel.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Carousel\";\n","import React, { useEffect, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { EmblaOptionsType } from \"embla-carousel\";\nimport useEmblaCarousel from \"embla-carousel-react\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\ntype CarouselProps = {\n items: React.ReactNode[];\n showArrows?: boolean;\n autoplay?: boolean;\n autoplayInterval?: number;\n options?: EmblaOptionsType;\n direction?: DirectionType;\n};\ntype DotsProps = {\n itemsLength: number;\n selectedIndex: number;\n direction: DirectionType;\n onDotClick: (index: number) => void;\n};\ntype ControlsProps = {\n canScrollPrev: boolean;\n canScrollNext: boolean;\n onPrev(): void;\n onNext(): void;\n};\n\nexport const Carousel: React.FC<CarouselProps> = ({\n items,\n showArrows,\n options,\n autoplay,\n direction = \"ltr\",\n autoplayInterval = 3000,\n ...props\n}) => {\n const [emblaRef, emblaApi] = useEmblaCarousel({\n ...options,\n direction,\n loop: autoplay ? true : options?.loop || false,\n });\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n useEffect(() => {\n function selectHandler() {\n const index = emblaApi?.selectedScrollSnap();\n setSelectedIndex(index || 0);\n }\n\n emblaApi?.on(\"select\", selectHandler);\n return () => {\n emblaApi?.off(\"select\", selectHandler);\n };\n }, [emblaApi]);\n\n useEffect(() => {\n let autoplayTimer: ReturnType<typeof setTimeout>;\n if (autoplay && emblaApi) {\n autoplayTimer = setInterval(() => {\n emblaApi.scrollNext();\n }, autoplayInterval);\n }\n\n return () => {\n if (autoplayTimer) clearInterval(autoplayTimer);\n };\n }, [emblaApi, autoplay, autoplayInterval]);\n\n const length = React.Children.count(items);\n const canScrollNext = !!emblaApi?.canScrollNext();\n const canScrollPrev = !!emblaApi?.canScrollPrev();\n return (\n <div className=\"hawa-relative hawa-h-full\">\n <div className=\"hawa-h-full hawa-overflow-hidden\">\n <div className=\"hawa-h-full\" ref={emblaRef}>\n <div className=\"hawa-flex hawa-h-full\">\n {items?.map((item: any, i: any) => (\n <div\n key={i}\n className=\"hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\"\n >\n {item}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n <Dots\n direction={direction}\n itemsLength={length}\n selectedIndex={selectedIndex}\n onDotClick={(index) => emblaApi?.scrollTo(index)}\n />\n\n {showArrows && (\n <CarouselControls\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n onNext={() => emblaApi?.scrollNext()}\n onPrev={() => emblaApi?.scrollPrev()}\n />\n )}\n </div>\n );\n};\n\nconst Dots = ({\n onDotClick,\n itemsLength,\n selectedIndex,\n direction,\n}: DotsProps) => {\n const arr = new Array(itemsLength).fill(0);\n return (\n <div\n dir={direction}\n className=\"hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1\"\n >\n {arr.map((_, index) => {\n const selected = index === selectedIndex;\n return (\n <div\n key={index}\n onClick={() => onDotClick(index)}\n className={cn(\n \"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer\",\n !selected\n ? \"hawa-w-2 hawa-opacity-50\"\n : \"hawa-w-6 hawa-opacity-100\",\n )}\n ></div>\n );\n })}\n </div>\n );\n};\n\nconst CarouselControls = (props: ControlsProps) => {\n return (\n <div className=\"hawa-flex hawa-justify-end hawa-gap-2\">\n <button\n onClick={() => props.canScrollPrev && props.onPrev()}\n disabled={!props.canScrollPrev}\n className={cn(\n \"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white\",\n !props.canScrollPrev && \"hawa-bg-primary/50\",\n props.canScrollPrev && \"hawa-bg-primary\",\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200\"\n >\n <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\"></path>\n </svg>\n </button>\n <button\n onClick={() => props.canScrollNext && props.onNext()}\n disabled={!props.canScrollNext}\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white\",\n !props.canScrollNext && \"hawa-bg-primary/50\",\n props.canScrollNext && \"hawa-bg-primary\",\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200\"\n >\n <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\"></path>\n </svg>\n </button>\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2C;;;ACA3C,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADDA,kCAA6B;AAyBtB,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,GAAG;AACL,MAAM;AACJ,QAAM,CAAC,UAAU,QAAQ,QAAI,4BAAAA,SAAiB;AAAA,IAC5C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U,CAAC,MAAM;AAAA,MACjB,WAAW;AAAA,QACT;AAAA,QACA,CAAC,MAAM,iBAAiB;AAAA,QACxB,MAAM,iBAAiB;AAAA,MACzB;AAAA;AAAA,IAEA,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,QAAO;AAAA,QACP,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAU;AAAA;AAAA,MAEV,6BAAAA,QAAA,cAAC,UAAK,GAAE,0HAAyH;AAAA,IACnI;AAAA,EACF,CACF;AAEJ;","names":["useEmblaCarousel","React"]}
1
+ {"version":3,"sources":["../../elements/carousel/index.ts","../../elements/carousel/Carousel.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Carousel\";\n","import React, { useEffect, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { EmblaOptionsType } from \"embla-carousel\";\nimport useEmblaCarousel from \"embla-carousel-react\";\n\nimport { DirectionType } from \"@_types/commonTypes\";\n\ntype CarouselProps = {\n items: React.ReactNode[];\n showArrows?: boolean;\n autoplay?: boolean;\n autoplayInterval?: number;\n options?: EmblaOptionsType;\n direction?: DirectionType;\n};\ntype DotsProps = {\n itemsLength: number;\n selectedIndex: number;\n direction: DirectionType;\n onDotClick: (index: number) => void;\n};\ntype ControlsProps = {\n canScrollPrev: boolean;\n canScrollNext: boolean;\n onPrev(): void;\n onNext(): void;\n};\n\nexport const Carousel: React.FC<CarouselProps> = ({\n items,\n showArrows,\n options,\n autoplay,\n direction = \"ltr\",\n autoplayInterval = 3000,\n ...props\n}) => {\n const [emblaRef, emblaApi] = useEmblaCarousel({\n ...options,\n direction,\n loop: autoplay ? true : options?.loop || false,\n });\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n useEffect(() => {\n function selectHandler() {\n const index = emblaApi?.selectedScrollSnap();\n setSelectedIndex(index || 0);\n }\n\n emblaApi?.on(\"select\", selectHandler);\n return () => {\n emblaApi?.off(\"select\", selectHandler);\n };\n }, [emblaApi]);\n\n useEffect(() => {\n let autoplayTimer: ReturnType<typeof setTimeout>;\n if (autoplay && emblaApi) {\n autoplayTimer = setInterval(() => {\n emblaApi.scrollNext();\n }, autoplayInterval);\n }\n\n return () => {\n if (autoplayTimer) clearInterval(autoplayTimer);\n };\n }, [emblaApi, autoplay, autoplayInterval]);\n\n const length = React.Children.count(items);\n const canScrollNext = !!emblaApi?.canScrollNext();\n const canScrollPrev = !!emblaApi?.canScrollPrev();\n return (\n <div className=\"hawa-relative hawa-h-full\">\n <div className=\"hawa-h-full hawa-overflow-hidden\">\n <div className=\"hawa-h-full\" ref={emblaRef}>\n <div className=\"hawa-flex hawa-h-full\">\n {items?.map((item: any, i: any) => (\n <div\n key={i}\n className=\"hawa-flex hawa-h-full hawa-min-w-0 hawa-flex-[0_0_100%] hawa-items-center hawa-justify-center\"\n >\n {item}\n </div>\n ))}\n </div>\n </div>\n </div>\n\n <Dots\n direction={direction}\n itemsLength={length}\n selectedIndex={selectedIndex}\n onDotClick={(index) => emblaApi?.scrollTo(index)}\n />\n\n {showArrows && (\n <CarouselControls\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n onNext={() => emblaApi?.scrollNext()}\n onPrev={() => emblaApi?.scrollPrev()}\n />\n )}\n </div>\n );\n};\n\nconst Dots = ({ onDotClick, itemsLength, selectedIndex, direction }: DotsProps) => {\n const arr = new Array(itemsLength).fill(0);\n return (\n <div dir={direction} className=\"hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1\">\n {arr.map((_, index) => {\n const selected = index === selectedIndex;\n return (\n <div\n key={index}\n onClick={() => onDotClick(index)}\n className={cn(\n \"hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer\",\n !selected ? \"hawa-w-2 hawa-opacity-50\" : \"hawa-w-6 hawa-opacity-100\",\n )}\n ></div>\n );\n })}\n </div>\n );\n};\n\nconst CarouselControls = (props: ControlsProps) => {\n return (\n <div className=\"hawa-flex hawa-justify-end hawa-gap-2\">\n <button\n onClick={() => props.canScrollPrev && props.onPrev()}\n disabled={!props.canScrollPrev}\n className={cn(\n \"hawa-absolute hawa-start-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white\",\n !props.canScrollPrev && \"hawa-bg-primary/50\",\n props.canScrollPrev && \"hawa-bg-primary\",\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-rotate-180 hawa-transition-transform hawa-duration-200\"\n >\n <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\"></path>\n </svg>\n </button>\n <button\n onClick={() => props.canScrollNext && props.onNext()}\n disabled={!props.canScrollNext}\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-1/2 -hawa-translate-y-2 hawa-rounded-full hawa-p-2 hawa-text-white\",\n !props.canScrollNext && \"hawa-bg-primary/50\",\n props.canScrollNext && \"hawa-bg-primary\",\n )}\n >\n <svg\n aria-label=\"Chevron Right Icon\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"hawa-h-2 hawa-w-2 hawa-shrink-0 hawa-transition-transform hawa-duration-200\"\n >\n <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\"></path>\n </svg>\n </button>\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA2C;;;ACA3C,kBAAsC;AACtC,4BAAwB;AAEjB,SA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;AAAA,QACP,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAU;AAAA;AAAA,MAEV,6BAAAA,QAAA,cAAC,UAAK,GAAE,0HAAyH;AAAA,IACnI;AAAA,EACF,GACA,6BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,MAAM,MAAM,iBAAiB,MAAM,OAAO;AAAA,MACnD,UAAU,CAAC,MAAM;AAAA,MACjB,WAAW;AAAA,QACT;AAAA,QACA,CAAC,MAAM,iBAAiB;AAAA,QACxB,MAAM,iBAAiB;AAAA,MACzB;AAAA;AAAA,IAEA,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,QAAO;AAAA,QACP,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAU;AAAA;AAAA,MAEV,6BAAAA,QAAA,cAAC,UAAK,GAAE,0HAAyH;AAAA,IACnI;AAAA,EACF,CACF;AAEJ;","names":["useEmblaCarousel","React"]}
@@ -76,34 +76,22 @@ var Carousel = ({
76
76
  }
77
77
  ));
78
78
  };
79
- var Dots = ({
80
- onDotClick,
81
- itemsLength,
82
- selectedIndex,
83
- direction
84
- }) => {
79
+ var Dots = ({ onDotClick, itemsLength, selectedIndex, direction }) => {
85
80
  const arr = new Array(itemsLength).fill(0);
86
- return /* @__PURE__ */ React.createElement(
87
- "div",
88
- {
89
- dir: direction,
90
- className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1"
91
- },
92
- arr.map((_, index) => {
93
- const selected = index === selectedIndex;
94
- return /* @__PURE__ */ React.createElement(
95
- "div",
96
- {
97
- key: index,
98
- onClick: () => onDotClick(index),
99
- className: cn(
100
- "hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
101
- !selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
102
- )
103
- }
104
- );
105
- })
106
- );
81
+ return /* @__PURE__ */ React.createElement("div", { dir: direction, className: "hawa-z-50 hawa-my-2 hawa-flex hawa-justify-center hawa-gap-1" }, arr.map((_, index) => {
82
+ const selected = index === selectedIndex;
83
+ return /* @__PURE__ */ React.createElement(
84
+ "div",
85
+ {
86
+ key: index,
87
+ onClick: () => onDotClick(index),
88
+ className: cn(
89
+ "hawa-h-2 hawa-rounded-full hawa-bg-primary hawa-transition-all hawa-duration-300 hover:hawa-cursor-pointer",
90
+ !selected ? "hawa-w-2 hawa-opacity-50" : "hawa-w-6 hawa-opacity-100"
91
+ )
92
+ }
93
+ );
94
+ }));
107
95
  };
108
96
  var CarouselControls = (props) => {
109
97
  return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-justify-end hawa-gap-2" }, /* @__PURE__ */ React.createElement(