@sikka/hawa 0.48.0-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 (303) 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.d.mts +1 -0
  40. package/dist/blocks/auth/index.d.ts +1 -0
  41. package/dist/blocks/auth/index.js +539 -792
  42. package/dist/blocks/auth/index.mjs +433 -604
  43. package/dist/blocks/feedback/index.js +214 -375
  44. package/dist/blocks/feedback/index.mjs +12 -25
  45. package/dist/blocks/index.d.mts +1 -0
  46. package/dist/blocks/index.d.ts +1 -0
  47. package/dist/blocks/index.js +940 -1445
  48. package/dist/blocks/index.mjs +469 -615
  49. package/dist/blocks/misc/index.js +136 -251
  50. package/dist/blocks/misc/index.mjs +29 -54
  51. package/dist/blocks/pricing/index.js +220 -397
  52. package/dist/blocks/pricing/index.mjs +63 -134
  53. package/dist/breadcrumb/index.js +1 -5
  54. package/dist/breadcrumb/index.js.map +1 -1
  55. package/dist/breadcrumb/index.mjs +1 -5
  56. package/dist/breadcrumb/index.mjs.map +1 -1
  57. package/dist/button/index.js +50 -82
  58. package/dist/button/index.js.map +1 -1
  59. package/dist/button/index.mjs +50 -82
  60. package/dist/button/index.mjs.map +1 -1
  61. package/dist/calendar/index.js +50 -82
  62. package/dist/calendar/index.js.map +1 -1
  63. package/dist/calendar/index.mjs +50 -82
  64. package/dist/calendar/index.mjs.map +1 -1
  65. package/dist/card/index.js +7 -35
  66. package/dist/card/index.js.map +1 -1
  67. package/dist/card/index.mjs +7 -35
  68. package/dist/card/index.mjs.map +1 -1
  69. package/dist/carousel/index.js +15 -27
  70. package/dist/carousel/index.js.map +1 -1
  71. package/dist/carousel/index.mjs +15 -27
  72. package/dist/carousel/index.mjs.map +1 -1
  73. package/dist/checkbox/index.js +2 -13
  74. package/dist/checkbox/index.js.map +1 -1
  75. package/dist/checkbox/index.mjs +2 -13
  76. package/dist/checkbox/index.mjs.map +1 -1
  77. package/dist/chip/index.js +2 -16
  78. package/dist/chip/index.js.map +1 -1
  79. package/dist/chip/index.mjs +2 -16
  80. package/dist/chip/index.mjs.map +1 -1
  81. package/dist/{chunk-WUMDFBEK.mjs → chunk-3CHFVHTW.mjs} +43 -54
  82. package/dist/{chunk-2LUXOXAL.mjs → chunk-5SQBJRWE.mjs} +3 -9
  83. package/dist/{chunk-C2UOOH4X.mjs → chunk-B53SP2WZ.mjs} +3 -17
  84. package/dist/chunk-GHGWQVTM.mjs +150 -0
  85. package/dist/{chunk-5S5DR7KF.mjs → chunk-I23ONEDJ.mjs} +2 -10
  86. package/dist/{chunk-JFWD2ICY.mjs → chunk-JT7R3L5O.mjs} +54 -62
  87. package/dist/{chunk-6SJUUJOV.mjs → chunk-KDGJZPWK.mjs} +295 -574
  88. package/dist/{chunk-AWJSHOYU.mjs → chunk-KSJGXQTE.mjs} +1 -1
  89. package/dist/{chunk-NMW4GM4G.mjs → chunk-SE2JMXYG.mjs} +104 -144
  90. package/dist/{chunk-GBLWUEYN.mjs → chunk-ULRL4WI6.mjs} +176 -256
  91. package/dist/{chunk-IFWYR5W2.mjs → chunk-VUELRPUL.mjs} +57 -117
  92. package/dist/{chunk-WL7C2A5D.mjs → chunk-WQR4XZGL.mjs} +8 -15
  93. package/dist/codeBlock/index.js +50 -82
  94. package/dist/codeBlock/index.js.map +1 -1
  95. package/dist/codeBlock/index.mjs +50 -82
  96. package/dist/codeBlock/index.mjs.map +1 -1
  97. package/dist/colorPicker/index.js +21 -33
  98. package/dist/colorPicker/index.js.map +1 -1
  99. package/dist/colorPicker/index.mjs +22 -37
  100. package/dist/colorPicker/index.mjs.map +1 -1
  101. package/dist/combobox/index.d.mts +1 -1
  102. package/dist/combobox/index.d.ts +1 -1
  103. package/dist/combobox/index.js +141 -223
  104. package/dist/combobox/index.js.map +1 -1
  105. package/dist/combobox/index.mjs +141 -223
  106. package/dist/combobox/index.mjs.map +1 -1
  107. package/dist/command/index.d.mts +1 -1
  108. package/dist/command/index.d.ts +1 -1
  109. package/dist/command/index.js +129 -212
  110. package/dist/command/index.js.map +1 -1
  111. package/dist/command/index.mjs +129 -212
  112. package/dist/command/index.mjs.map +1 -1
  113. package/dist/dataTable/index.js +254 -394
  114. package/dist/dataTable/index.js.map +1 -1
  115. package/dist/dataTable/index.mjs +254 -394
  116. package/dist/dataTable/index.mjs.map +1 -1
  117. package/dist/datePicker/index.js +64 -105
  118. package/dist/datePicker/index.js.map +1 -1
  119. package/dist/datePicker/index.mjs +64 -105
  120. package/dist/datePicker/index.mjs.map +1 -1
  121. package/dist/destroyableCard/index.js +8 -39
  122. package/dist/destroyableCard/index.js.map +1 -1
  123. package/dist/destroyableCard/index.mjs +8 -39
  124. package/dist/destroyableCard/index.mjs.map +1 -1
  125. package/dist/dialog/index.js +70 -122
  126. package/dist/dialog/index.js.map +1 -1
  127. package/dist/dialog/index.mjs +70 -122
  128. package/dist/dialog/index.mjs.map +1 -1
  129. package/dist/docsLayout/index.js +169 -358
  130. package/dist/docsLayout/index.js.map +1 -1
  131. package/dist/docsLayout/index.mjs +169 -358
  132. package/dist/docsLayout/index.mjs.map +1 -1
  133. package/dist/docsSidebar/index.js +9 -16
  134. package/dist/docsSidebar/index.js.map +1 -1
  135. package/dist/docsSidebar/index.mjs +9 -16
  136. package/dist/docsSidebar/index.mjs.map +1 -1
  137. package/dist/dropdownMenu/index.js +124 -164
  138. package/dist/dropdownMenu/index.js.map +1 -1
  139. package/dist/dropdownMenu/index.mjs +124 -164
  140. package/dist/dropdownMenu/index.mjs.map +1 -1
  141. package/dist/elements/index.d.mts +3 -3
  142. package/dist/elements/index.d.ts +3 -3
  143. package/dist/elements/index.js +841 -1505
  144. package/dist/elements/index.mjs +381 -718
  145. package/dist/fileDropzone/index.js +60 -159
  146. package/dist/fileDropzone/index.js.map +1 -1
  147. package/dist/fileDropzone/index.mjs +60 -159
  148. package/dist/fileDropzone/index.mjs.map +1 -1
  149. package/dist/glow/index.js +4 -16
  150. package/dist/glow/index.js.map +1 -1
  151. package/dist/glow/index.mjs +4 -16
  152. package/dist/glow/index.mjs.map +1 -1
  153. package/dist/hooks/index.d.mts +1 -5
  154. package/dist/hooks/index.d.ts +1 -5
  155. package/dist/hooks/index.js +11 -24
  156. package/dist/hooks/index.mjs +2 -2
  157. package/dist/{index-B0aJcA6d.d.ts → index-BgNycocQ.d.mts} +2 -2
  158. package/dist/{index-B0aJcA6d.d.mts → index-BgNycocQ.d.ts} +2 -2
  159. package/dist/index.css +1 -6
  160. package/dist/index.d.mts +7 -8
  161. package/dist/index.d.ts +7 -8
  162. package/dist/index.js +1549 -2512
  163. package/dist/index.mjs +1550 -2516
  164. package/dist/input/index.js +20 -29
  165. package/dist/input/index.js.map +1 -1
  166. package/dist/input/index.mjs +20 -29
  167. package/dist/input/index.mjs.map +1 -1
  168. package/dist/interfaceSettings/index.js +122 -163
  169. package/dist/interfaceSettings/index.js.map +1 -1
  170. package/dist/interfaceSettings/index.mjs +122 -163
  171. package/dist/interfaceSettings/index.mjs.map +1 -1
  172. package/dist/label/index.js +19 -26
  173. package/dist/label/index.js.map +1 -1
  174. package/dist/label/index.mjs +19 -26
  175. package/dist/label/index.mjs.map +1 -1
  176. package/dist/layout/index.d.mts +2 -0
  177. package/dist/layout/index.d.ts +2 -0
  178. package/dist/layout/index.js +434 -790
  179. package/dist/layout/index.mjs +143 -243
  180. package/dist/loading/index.js +30 -53
  181. package/dist/loading/index.js.map +1 -1
  182. package/dist/loading/index.mjs +30 -53
  183. package/dist/loading/index.mjs.map +1 -1
  184. package/dist/logos/index.js +66 -191
  185. package/dist/logos/index.js.map +1 -1
  186. package/dist/logos/index.mjs +66 -191
  187. package/dist/logos/index.mjs.map +1 -1
  188. package/dist/navbar/index.js +1 -4
  189. package/dist/navbar/index.js.map +1 -1
  190. package/dist/navbar/index.mjs +1 -4
  191. package/dist/navbar/index.mjs.map +1 -1
  192. package/dist/navigationMenu/index.js +14 -22
  193. package/dist/navigationMenu/index.js.map +1 -1
  194. package/dist/navigationMenu/index.mjs +14 -22
  195. package/dist/navigationMenu/index.mjs.map +1 -1
  196. package/dist/pagination/index.js +1 -5
  197. package/dist/pagination/index.js.map +1 -1
  198. package/dist/pagination/index.mjs +1 -5
  199. package/dist/pagination/index.mjs.map +1 -1
  200. package/dist/passwordInput/index.js +36 -65
  201. package/dist/passwordInput/index.js.map +1 -1
  202. package/dist/passwordInput/index.mjs +36 -65
  203. package/dist/passwordInput/index.mjs.map +1 -1
  204. package/dist/phoneInput/index.js +20 -29
  205. package/dist/phoneInput/index.js.map +1 -1
  206. package/dist/phoneInput/index.mjs +20 -29
  207. package/dist/phoneInput/index.mjs.map +1 -1
  208. package/dist/pinInput/index.js +14 -16
  209. package/dist/pinInput/index.js.map +1 -1
  210. package/dist/pinInput/index.mjs +14 -16
  211. package/dist/pinInput/index.mjs.map +1 -1
  212. package/dist/popover/index.js +14 -24
  213. package/dist/popover/index.js.map +1 -1
  214. package/dist/popover/index.mjs +14 -24
  215. package/dist/popover/index.mjs.map +1 -1
  216. package/dist/progress/index.js +19 -26
  217. package/dist/progress/index.js.map +1 -1
  218. package/dist/progress/index.mjs +19 -26
  219. package/dist/progress/index.mjs.map +1 -1
  220. package/dist/progressCircle/index.js +67 -71
  221. package/dist/progressCircle/index.js.map +1 -1
  222. package/dist/progressCircle/index.mjs +67 -71
  223. package/dist/progressCircle/index.mjs.map +1 -1
  224. package/dist/radio/index.js +122 -163
  225. package/dist/radio/index.js.map +1 -1
  226. package/dist/radio/index.mjs +122 -163
  227. package/dist/radio/index.mjs.map +1 -1
  228. package/dist/scrollArea/index.js.map +1 -1
  229. package/dist/scrollArea/index.mjs.map +1 -1
  230. package/dist/scrollIndicator/index.js +1 -4
  231. package/dist/scrollIndicator/index.js.map +1 -1
  232. package/dist/scrollIndicator/index.mjs +1 -4
  233. package/dist/scrollIndicator/index.mjs.map +1 -1
  234. package/dist/select/index.js +20 -29
  235. package/dist/select/index.js.map +1 -1
  236. package/dist/select/index.mjs +20 -29
  237. package/dist/select/index.mjs.map +1 -1
  238. package/dist/separator/index.js.map +1 -1
  239. package/dist/separator/index.mjs.map +1 -1
  240. package/dist/sheet/index.js +42 -53
  241. package/dist/sheet/index.js.map +1 -1
  242. package/dist/sheet/index.mjs +42 -53
  243. package/dist/sheet/index.mjs.map +1 -1
  244. package/dist/sidebar/index.js +66 -133
  245. package/dist/sidebar/index.js.map +1 -1
  246. package/dist/sidebar/index.mjs +66 -133
  247. package/dist/sidebar/index.mjs.map +1 -1
  248. package/dist/signature/index.js +19 -26
  249. package/dist/signature/index.js.map +1 -1
  250. package/dist/signature/index.mjs +19 -26
  251. package/dist/signature/index.mjs.map +1 -1
  252. package/dist/simpleTable/index.js +50 -81
  253. package/dist/simpleTable/index.js.map +1 -1
  254. package/dist/simpleTable/index.mjs +50 -81
  255. package/dist/simpleTable/index.mjs.map +1 -1
  256. package/dist/skeleton/index.js.map +1 -1
  257. package/dist/skeleton/index.mjs.map +1 -1
  258. package/dist/slider/index.js.map +1 -1
  259. package/dist/slider/index.mjs.map +1 -1
  260. package/dist/sonner/index.js.map +1 -1
  261. package/dist/sonner/index.mjs.map +1 -1
  262. package/dist/sortButton/index.js +50 -82
  263. package/dist/sortButton/index.js.map +1 -1
  264. package/dist/sortButton/index.mjs +50 -82
  265. package/dist/sortButton/index.mjs.map +1 -1
  266. package/dist/splitButton/index.js +214 -294
  267. package/dist/splitButton/index.js.map +1 -1
  268. package/dist/splitButton/index.mjs +214 -294
  269. package/dist/splitButton/index.mjs.map +1 -1
  270. package/dist/stats/index.js +7 -35
  271. package/dist/stats/index.js.map +1 -1
  272. package/dist/stats/index.mjs +7 -35
  273. package/dist/stats/index.mjs.map +1 -1
  274. package/dist/switch/index.js +24 -34
  275. package/dist/switch/index.js.map +1 -1
  276. package/dist/switch/index.mjs +24 -34
  277. package/dist/switch/index.mjs.map +1 -1
  278. package/dist/table/index.js +27 -29
  279. package/dist/table/index.js.map +1 -1
  280. package/dist/table/index.mjs +27 -29
  281. package/dist/table/index.mjs.map +1 -1
  282. package/dist/tabs/index.js +54 -76
  283. package/dist/tabs/index.js.map +1 -1
  284. package/dist/tabs/index.mjs +54 -76
  285. package/dist/tabs/index.mjs.map +1 -1
  286. package/dist/textarea/index.js +21 -38
  287. package/dist/textarea/index.js.map +1 -1
  288. package/dist/textarea/index.mjs +21 -38
  289. package/dist/textarea/index.mjs.map +1 -1
  290. package/dist/toast/index.js +2 -10
  291. package/dist/toast/index.js.map +1 -1
  292. package/dist/toast/index.mjs +2 -10
  293. package/dist/toast/index.mjs.map +1 -1
  294. package/dist/toaster/index.js +3 -16
  295. package/dist/toaster/index.js.map +1 -1
  296. package/dist/toaster/index.mjs +3 -16
  297. package/dist/toaster/index.mjs.map +1 -1
  298. package/dist/tooltip/index.js +19 -26
  299. package/dist/tooltip/index.js.map +1 -1
  300. package/dist/tooltip/index.mjs +19 -26
  301. package/dist/tooltip/index.mjs.map +1 -1
  302. package/package.json +12 -12
  303. package/dist/chunk-JP2N5WKD.mjs +0 -190
@@ -13,9 +13,7 @@ function cn(...inputs) {
13
13
 
14
14
  // elements/helperText/HelperText.tsx
15
15
  import React from "react";
16
- var HelperText = ({
17
- helperText
18
- }) => /* @__PURE__ */ React.createElement(
16
+ var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
19
17
  "p",
20
18
  {
21
19
  className: cn(
@@ -66,38 +64,31 @@ var Tooltip = ({
66
64
  delayDuration = 300,
67
65
  ...props
68
66
  }) => {
69
- return /* @__PURE__ */ React2.createElement(
70
- TooltipPrimitive.TooltipProvider,
67
+ return /* @__PURE__ */ React2.createElement(TooltipPrimitive.TooltipProvider, { delayDuration, ...providerProps }, /* @__PURE__ */ React2.createElement(
68
+ TooltipPrimitive.Root,
71
69
  {
72
- delayDuration,
73
- ...providerProps
70
+ open: !disabled && open,
71
+ defaultOpen,
72
+ onOpenChange,
73
+ ...props
74
74
  },
75
+ /* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
75
76
  /* @__PURE__ */ React2.createElement(
76
- TooltipPrimitive.Root,
77
+ TooltipContent,
77
78
  {
78
- open: !disabled && open,
79
- defaultOpen,
80
- onOpenChange,
81
- ...props
79
+ size,
80
+ side,
81
+ align: "center",
82
+ ...contentProps,
83
+ style: {
84
+ ...contentProps == null ? void 0 : contentProps.style,
85
+ maxWidth: "var(--radix-tooltip-content-available-width)",
86
+ maxHeight: "var(--radix-tooltip-content-available-height)"
87
+ }
82
88
  },
83
- /* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
84
- /* @__PURE__ */ React2.createElement(
85
- TooltipContent,
86
- {
87
- size,
88
- side,
89
- align: "center",
90
- ...contentProps,
91
- style: {
92
- ...contentProps == null ? void 0 : contentProps.style,
93
- maxWidth: "var(--radix-tooltip-content-available-width)",
94
- maxHeight: "var(--radix-tooltip-content-available-height)"
95
- }
96
- },
97
- content
98
- )
89
+ content
99
90
  )
100
- );
91
+ ));
101
92
  };
102
93
 
103
94
  // elements/label/Label.tsx
@@ -145,21 +136,19 @@ Label.displayName = "Label";
145
136
  // elements/popover/Popover.tsx
146
137
  import * as React4 from "react";
147
138
  import * as PopoverPrimitive from "@radix-ui/react-popover";
148
- var PopoverContent = React4.forwardRef(
149
- ({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ React4.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React4.createElement(
150
- PopoverPrimitive.Content,
151
- {
152
- ref,
153
- align,
154
- sideOffset,
155
- className: cn(
156
- "dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
157
- className
158
- ),
159
- ...props
160
- }
161
- ))
162
- );
139
+ var PopoverContent = React4.forwardRef(({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ React4.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React4.createElement(
140
+ PopoverPrimitive.Content,
141
+ {
142
+ ref,
143
+ align,
144
+ sideOffset,
145
+ className: cn(
146
+ "dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
147
+ className
148
+ ),
149
+ ...props
150
+ }
151
+ )));
163
152
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
164
153
  var PopoverTrigger = PopoverPrimitive.Trigger;
165
154
  var PopoverRoot = PopoverPrimitive.Root;
@@ -198,12 +187,8 @@ var Radio = forwardRef3(
198
187
  default: "hawa-max-w-fit",
199
188
  full: "hawa-w-full"
200
189
  };
201
- const [parentDirection, setParentDirection] = React5.useState(
202
- null
203
- );
204
- const [selectedOption, setSelectedOption] = useState(
205
- props.defaultValue || props.value
206
- );
190
+ const [parentDirection, setParentDirection] = React5.useState(null);
191
+ const [selectedOption, setSelectedOption] = useState(props.defaultValue || props.value);
207
192
  const [openTooltip, setOpenTooltip] = useState(null);
208
193
  const parentRef = useRef(null);
209
194
  useEffect(() => {
@@ -232,89 +217,78 @@ var Radio = forwardRef3(
232
217
  ];
233
218
  switch (design) {
234
219
  case "tabs":
235
- return /* @__PURE__ */ React5.createElement(
236
- "div",
220
+ return /* @__PURE__ */ React5.createElement("div", { className: cn("hawa-gap-2 hawa-flex hawa-flex-col", containerClassNames == null ? void 0 : containerClassNames.tabs) }, props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React5.createElement(Tabs, null, /* @__PURE__ */ React5.createElement(
221
+ TabsList,
237
222
  {
223
+ role: "tablist",
224
+ ref: parentRef,
238
225
  className: cn(
239
- "hawa-gap-2 hawa-flex hawa-flex-col",
240
- containerClassNames == null ? void 0 : containerClassNames.tabs
226
+ props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
227
+ "hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]",
228
+ orientationStyle[orientation],
229
+ widthStyle[width],
230
+ tabsContainerClassName,
231
+ props.direction === "rtl" ? "hawa-flex-row-reverse" : ""
241
232
  )
242
233
  },
243
- props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label),
244
- /* @__PURE__ */ React5.createElement(Tabs, null, /* @__PURE__ */ React5.createElement(
245
- TabsList,
246
- {
247
- role: "tablist",
248
- ref: parentRef,
249
- className: cn(
250
- props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
251
- "hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]",
252
- orientationStyle[orientation],
253
- widthStyle[width],
254
- tabsContainerClassName,
255
- props.direction === "rtl" ? "hawa-flex-row-reverse" : ""
256
- )
257
- },
258
- (_b = props.options) == null ? void 0 : _b.map((opt, o) => {
259
- return opt.tooltip ? /* @__PURE__ */ React5.createElement(
260
- PopoverRoot,
234
+ (_b = props.options) == null ? void 0 : _b.map((opt, o) => {
235
+ return opt.tooltip ? /* @__PURE__ */ React5.createElement(
236
+ PopoverRoot,
237
+ {
238
+ key: o,
239
+ open: o === openTooltip,
240
+ onOpenChange: (bool) => setOpenTooltip(bool ? o : null)
241
+ },
242
+ /* @__PURE__ */ React5.createElement(
243
+ PopoverTrigger,
261
244
  {
262
- key: o,
263
- open: o === openTooltip,
264
- onOpenChange: (bool) => setOpenTooltip(bool ? o : null)
245
+ onMouseEnter: () => setOpenTooltip(o),
246
+ onMouseLeave: () => setOpenTooltip(null),
247
+ asChild: true
265
248
  },
266
249
  /* @__PURE__ */ React5.createElement(
267
- PopoverTrigger,
250
+ TabsTrigger,
268
251
  {
269
- onMouseEnter: () => setOpenTooltip(o),
270
- onMouseLeave: () => setOpenTooltip(null),
271
- asChild: true
272
- },
273
- /* @__PURE__ */ React5.createElement(
274
- TabsTrigger,
275
- {
276
- "aria-current": selectedOption === opt.value ? "page" : void 0,
277
- value: opt.value,
278
- role: "tab",
279
- tabIndex: 0,
280
- onClick: () => {
281
- if (props.disabled || opt.disabled) return;
282
- handleChange(opt);
283
- },
284
- className: cn(
285
- ...radio_option_tabs_styling,
286
- selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
287
- )
252
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
253
+ value: opt.value,
254
+ role: "tab",
255
+ tabIndex: 0,
256
+ onClick: () => {
257
+ if (props.disabled || opt.disabled) return;
258
+ handleChange(opt);
288
259
  },
289
- opt.icon && opt.icon,
290
- opt.label
291
- )
292
- ),
293
- /* @__PURE__ */ React5.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
294
- ) : /* @__PURE__ */ React5.createElement(
295
- TabsTrigger,
296
- {
297
- key: o,
298
- role: "tab",
299
- tabIndex: 0,
300
- "aria-current": selectedOption === opt.value ? "page" : void 0,
301
- onClick: () => {
302
- if (props.disabled || opt.disabled) return;
303
- handleChange(opt);
260
+ className: cn(
261
+ ...radio_option_tabs_styling,
262
+ selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
263
+ )
304
264
  },
305
- className: cn(
306
- ...radio_option_tabs_styling,
307
- selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
308
- ),
309
- value: opt.value
265
+ opt.icon && opt.icon,
266
+ opt.label
267
+ )
268
+ ),
269
+ /* @__PURE__ */ React5.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
270
+ ) : /* @__PURE__ */ React5.createElement(
271
+ TabsTrigger,
272
+ {
273
+ key: o,
274
+ role: "tab",
275
+ tabIndex: 0,
276
+ "aria-current": selectedOption === opt.value ? "page" : void 0,
277
+ onClick: () => {
278
+ if (props.disabled || opt.disabled) return;
279
+ handleChange(opt);
310
280
  },
311
- opt.icon && opt.icon,
312
- opt.label
313
- );
314
- })
315
- )),
316
- !forceHideHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText })
317
- );
281
+ className: cn(
282
+ ...radio_option_tabs_styling,
283
+ selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
284
+ ),
285
+ value: opt.value
286
+ },
287
+ opt.icon && opt.icon,
288
+ opt.label
289
+ );
290
+ })
291
+ )), !forceHideHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
318
292
  case "bordered":
319
293
  return /* @__PURE__ */ React5.createElement(
320
294
  "div",
@@ -362,11 +336,7 @@ var Radio = forwardRef3(
362
336
  return /* @__PURE__ */ React5.createElement(
363
337
  "ul",
364
338
  {
365
- className: cn(
366
- orientationStyle[orientation],
367
- "hawa-gap-4",
368
- containerClassNames == null ? void 0 : containerClassNames.cards
369
- )
339
+ className: cn(orientationStyle[orientation], "hawa-gap-4", containerClassNames == null ? void 0 : containerClassNames.cards)
370
340
  },
371
341
  (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React5.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React5.createElement(
372
342
  "input",
@@ -392,49 +362,38 @@ var Radio = forwardRef3(
392
362
  )))
393
363
  );
394
364
  default:
395
- return /* @__PURE__ */ React5.createElement(
365
+ return /* @__PURE__ */ React5.createElement("div", { className: cn("hawa-flex hawa-flex-col hawa-gap-2", containerClassNames == null ? void 0 : containerClassNames.default) }, props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React5.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React5.createElement(
396
366
  "div",
397
367
  {
398
368
  className: cn(
399
- "hawa-flex hawa-flex-col hawa-gap-2",
400
- containerClassNames == null ? void 0 : containerClassNames.default
401
- )
369
+ "radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
370
+ props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
371
+ ),
372
+ key: i + 1
402
373
  },
403
- props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label),
404
- /* @__PURE__ */ React5.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React5.createElement(
405
- "div",
374
+ /* @__PURE__ */ React5.createElement(
375
+ "input",
406
376
  {
377
+ disabled: opt.disabled,
378
+ id: opt.value.toString(),
379
+ type: "radio",
380
+ value: opt.value,
381
+ name,
382
+ onChange: () => handleChange(opt)
383
+ }
384
+ ),
385
+ /* @__PURE__ */ React5.createElement(
386
+ "label",
387
+ {
388
+ htmlFor: opt.value.toString(),
407
389
  className: cn(
408
- "radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
409
- props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
410
- ),
411
- key: i + 1
390
+ "hawa-text-sm hawa-font-medium dark:hawa-text-white",
391
+ opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
392
+ )
412
393
  },
413
- /* @__PURE__ */ React5.createElement(
414
- "input",
415
- {
416
- disabled: opt.disabled,
417
- id: opt.value.toString(),
418
- type: "radio",
419
- value: opt.value,
420
- name,
421
- onChange: () => handleChange(opt)
422
- }
423
- ),
424
- /* @__PURE__ */ React5.createElement(
425
- "label",
426
- {
427
- htmlFor: opt.value.toString(),
428
- className: cn(
429
- "hawa-text-sm hawa-font-medium dark:hawa-text-white",
430
- opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
431
- )
432
- },
433
- opt.label
434
- )
435
- ))),
436
- /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText })
437
- );
394
+ opt.label
395
+ )
396
+ ))), /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
438
397
  }
439
398
  }
440
399
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/radio/Radio.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx"],"sourcesContent":["import React, { useState, FC, useRef, useEffect, forwardRef } from \"react\";\n\nimport { PopoverContentProps } from \"@radix-ui/react-popover\";\nimport { TabsList, TabsTrigger, Tabs } from \"@radix-ui/react-tabs\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, OrientationType } from \"../../types/commonTypes\";\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from \"../popover\";\n\nexport type RadioOptionsTypes = {\n value: any;\n label: any;\n disabled?: any;\n sublabel?: any;\n icon?: any;\n tooltip?: string;\n tooltipContentProps?: PopoverContentProps;\n};\n\ntype RadioTypes = {\n /** Required to enable selection and differentiate between different Radio instances. */\n name: string;\n disabled?: boolean;\n orientation?: OrientationType;\n design?: \"default\" | \"tabs\" | \"cards\" | \"bordered\";\n width?: \"default\" | \"full\" | \"none\";\n size?: \"default\" | \"lg\" | \"sm\" | \"xs\";\n options: RadioOptionsTypes[];\n onChange?: any;\n defaultValue?: any;\n value?: any;\n direction?: DirectionType;\n helperText?: any;\n labelProps?: LabelProps;\n label?: string;\n tabsContainerClassName?: string;\n forceHideHelperText?: boolean;\n containerClassNames?: {\n bordered?: string;\n tabs?: string;\n cards?: string;\n default?: string;\n };\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioTypes>(\n (\n {\n design = \"default\",\n width = \"default\",\n size = \"default\",\n orientation = \"horizontal\",\n name,\n labelProps,\n tabsContainerClassName,\n forceHideHelperText = false,\n onChange,\n containerClassNames,\n ...props\n },\n ref,\n ) => {\n let activeTabStyle =\n \"hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary\";\n let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white\n ${props.disabled ? \"\" : \"hover:hawa-bg-muted\"}`;\n let orientationStyle = {\n horizontal: \"hawa-flex hawa-flex-row\",\n vertical: \"hawa-flex hawa-flex-col\",\n };\n\n let tabSizeStyle = {\n default: \"hawa-py-2 hawa-px-4 hawa-text-sm\",\n lg: \"hawa-py-2 hawa-px-4\",\n sm: \"hawa-p-1.5 hawa-text-xs\",\n xs: \"hawa-p-1 hawa-text-[10px]\",\n };\n let widthStyle = {\n none: \"\",\n default: \"hawa-max-w-fit\",\n full: \"hawa-w-full\",\n };\n const [parentDirection, setParentDirection] = React.useState<string | null>(\n null,\n );\n const [selectedOption, setSelectedOption] = useState(\n props.defaultValue || props.value,\n );\n const [openTooltip, setOpenTooltip] = useState<number | null>(null);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const parentNode = parentRef.current?.parentNode as HTMLElement | null;\n if (parentNode) {\n const dir = window.getComputedStyle(parentNode).direction;\n setParentDirection(dir);\n }\n });\n\n const handleChange = (opt: RadioOptionsTypes) => {\n setSelectedOption(opt.value);\n if (onChange) {\n // use the more generic onChange prop\n onChange(opt.value); // You can pass the entire option or just the value\n } else {\n console.log(\"onChange was not provided\");\n }\n };\n\n const radio_option_tabs_styling = [\n \"hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 \",\n !props.disabled && \"hawa-cursor-pointer\",\n orientation === \"horizontal\" &&\n parentDirection === \"ltr\" &&\n \"hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r\",\n orientation === \"horizontal\" &&\n parentDirection === \"rtl\" &&\n \"hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l\",\n orientation === \"vertical\" &&\n \"hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b\",\n tabSizeStyle[size],\n ];\n\n switch (design) {\n case \"tabs\":\n return (\n <div\n className={cn(\n \"hawa-gap-2 hawa-flex hawa-flex-col\",\n containerClassNames?.tabs,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <Tabs>\n <TabsList\n role=\"tablist\"\n ref={parentRef}\n className={cn(\n props.options && props.options?.length > 2\n ? \"hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap\"\n : \"\",\n \"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]\",\n orientationStyle[orientation],\n widthStyle[width],\n tabsContainerClassName,\n props.direction === \"rtl\" ? \"hawa-flex-row-reverse\" : \"\",\n )}\n >\n {props.options?.map((opt, o) => {\n return opt.tooltip ? (\n <PopoverRoot\n key={o}\n open={o === openTooltip}\n onOpenChange={(bool) => setOpenTooltip(bool ? o : null)}\n >\n <PopoverTrigger\n onMouseEnter={() => setOpenTooltip(o)}\n onMouseLeave={() => setOpenTooltip(null)}\n asChild\n >\n <TabsTrigger\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n value={opt.value}\n role=\"tab\"\n tabIndex={0}\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n </PopoverTrigger>\n <PopoverContent {...opt.tooltipContentProps}>\n {opt.tooltip}\n </PopoverContent>\n </PopoverRoot>\n ) : (\n <TabsTrigger\n key={o}\n role=\"tab\"\n tabIndex={0}\n aria-current={\n selectedOption === opt.value ? \"page\" : undefined\n }\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value\n ? activeTabStyle\n : inactiveTabStyle,\n )}\n value={opt.value}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n );\n })}\n </TabsList>\n </Tabs>\n {!forceHideHelperText && (\n <HelperText helperText={props.helperText} />\n )}\n </div>\n );\n case \"bordered\":\n return (\n <div\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.bordered,\n )}\n >\n {props.options &&\n props.options.map((opt, i) => (\n <div key={i} className=\"hawa-w-full hawa-rounded hawa-border\">\n <div\n className={cn(\n \"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-19px\"\n : \"margin-right left-23px\",\n )}\n key={i + 1}\n >\n <input\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n </div>\n ))}\n </div>\n );\n case \"cards\":\n return (\n <ul\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.cards,\n )}\n >\n {props.options?.map((opt: any, o) => (\n <li key={o} onClick={() => handleChange(opt)}>\n <input\n type=\"radio\"\n id={opt.value.toString()}\n name={name}\n value={opt.value.toString()}\n className=\"hawa-peer hawa-hidden\"\n required\n disabled={opt.disabled}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300\",\n )}\n >\n <div className=\"hawa-block hawa-h-full hawa-w-full\">\n <div className=\"hawa-w-full hawa-text-lg hawa-font-semibold\">\n {opt.label}\n </div>\n <div className=\"hawa-w-full\">{opt.sublabel}</div>\n </div>\n </label>\n </li>\n ))}\n </ul>\n );\n\n default:\n return (\n <div\n className={cn(\n \"hawa-flex hawa-flex-col hawa-gap-2\",\n containerClassNames?.default,\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className={cn(orientationStyle[orientation], \"hawa-gap-2\")}>\n {props.options &&\n props.options.map((opt, i) => (\n <div\n className={cn(\n \"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-3px\"\n : \"margin-right left-3px\",\n )}\n key={i + 1}\n >\n <input\n // TODO: spread the usual radio props\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-text-sm hawa-font-medium dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-text-gray-400\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n ))}\n </div>\n <HelperText helperText={props.helperText} />\n </div>\n );\n }\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","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 * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(\n (\n { className, align = \"center\", sideOffset = 4, container, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n ),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps &\n React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\",\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger\n className=\"hawa-w-full\"\n disabled={disableTrigger}\n {...triggerProps}\n >\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\",\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverPortal = PopoverPrimitive.Portal;\nconst PopoverRoot = PopoverPrimitive.Root;\n\nexport { Popover, PopoverPortal, PopoverRoot, PopoverContent, PopoverTrigger };\n"],"mappings":";;;AAAA,OAAOA,UAAS,UAAc,QAAQ,WAAW,cAAAC,m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ACT;AAAA,kBACA,IAAI,WACA,uBACA;AAAA,gBACN;AAAA;AAAA,cAEC,IAAI;AAAA,YACP;AAAA,UACF,CACD,CACL;AAAA,UACA,gBAAAA,OAAA,cAAC,cAAW,YAAY,MAAM,YAAY;AAAA,QAC5C;AAAA,IAEN;AAAA,EACF;AACF;","names":["React","forwardRef","React","React","React","React","forwardRef","React","_a"]}
1
+ {"version":3,"sources":["../../elements/radio/Radio.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/popover/Popover.tsx"],"sourcesContent":["import React, { useState, FC, useRef, useEffect, forwardRef } from \"react\";\n\nimport { PopoverContentProps } from \"@radix-ui/react-popover\";\nimport { TabsList, TabsTrigger, Tabs } from \"@radix-ui/react-tabs\";\nimport { cn } from \"@util/index\";\n\nimport { DirectionType, OrientationType } from \"../../types/commonTypes\";\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from \"../popover\";\n\nexport type RadioOptionsTypes = {\n value: any;\n label: any;\n disabled?: any;\n sublabel?: any;\n icon?: any;\n tooltip?: string;\n tooltipContentProps?: PopoverContentProps;\n};\n\ntype RadioTypes = {\n /** Required to enable selection and differentiate between different Radio instances. */\n name: string;\n disabled?: boolean;\n orientation?: OrientationType;\n design?: \"default\" | \"tabs\" | \"cards\" | \"bordered\";\n width?: \"default\" | \"full\" | \"none\";\n size?: \"default\" | \"lg\" | \"sm\" | \"xs\";\n options: RadioOptionsTypes[];\n onChange?: any;\n defaultValue?: any;\n value?: any;\n direction?: DirectionType;\n helperText?: any;\n labelProps?: LabelProps;\n label?: string;\n tabsContainerClassName?: string;\n forceHideHelperText?: boolean;\n containerClassNames?: {\n bordered?: string;\n tabs?: string;\n cards?: string;\n default?: string;\n };\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioTypes>(\n (\n {\n design = \"default\",\n width = \"default\",\n size = \"default\",\n orientation = \"horizontal\",\n name,\n labelProps,\n tabsContainerClassName,\n forceHideHelperText = false,\n onChange,\n containerClassNames,\n ...props\n },\n ref,\n ) => {\n let activeTabStyle =\n \"hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary\";\n let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white\n ${props.disabled ? \"\" : \"hover:hawa-bg-muted\"}`;\n let orientationStyle = {\n horizontal: \"hawa-flex hawa-flex-row\",\n vertical: \"hawa-flex hawa-flex-col\",\n };\n\n let tabSizeStyle = {\n default: \"hawa-py-2 hawa-px-4 hawa-text-sm\",\n lg: \"hawa-py-2 hawa-px-4\",\n sm: \"hawa-p-1.5 hawa-text-xs\",\n xs: \"hawa-p-1 hawa-text-[10px]\",\n };\n let widthStyle = {\n none: \"\",\n default: \"hawa-max-w-fit\",\n full: \"hawa-w-full\",\n };\n const [parentDirection, setParentDirection] = React.useState<string | null>(null);\n const [selectedOption, setSelectedOption] = useState(props.defaultValue || props.value);\n const [openTooltip, setOpenTooltip] = useState<number | null>(null);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const parentNode = parentRef.current?.parentNode as HTMLElement | null;\n if (parentNode) {\n const dir = window.getComputedStyle(parentNode).direction;\n setParentDirection(dir);\n }\n });\n\n const handleChange = (opt: RadioOptionsTypes) => {\n setSelectedOption(opt.value);\n if (onChange) {\n // use the more generic onChange prop\n onChange(opt.value); // You can pass the entire option or just the value\n } else {\n console.log(\"onChange was not provided\");\n }\n };\n\n const radio_option_tabs_styling = [\n \"hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 \",\n !props.disabled && \"hawa-cursor-pointer\",\n orientation === \"horizontal\" &&\n parentDirection === \"ltr\" &&\n \"hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r\",\n orientation === \"horizontal\" &&\n parentDirection === \"rtl\" &&\n \"hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l\",\n orientation === \"vertical\" && \"hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b\",\n tabSizeStyle[size],\n ];\n\n switch (design) {\n case \"tabs\":\n return (\n <div className={cn(\"hawa-gap-2 hawa-flex hawa-flex-col\", containerClassNames?.tabs)}>\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <Tabs>\n <TabsList\n role=\"tablist\"\n ref={parentRef}\n className={cn(\n props.options && props.options?.length > 2\n ? \"hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap\"\n : \"\",\n \"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]\",\n orientationStyle[orientation],\n widthStyle[width],\n tabsContainerClassName,\n props.direction === \"rtl\" ? \"hawa-flex-row-reverse\" : \"\",\n )}\n >\n {props.options?.map((opt, o) => {\n return opt.tooltip ? (\n <PopoverRoot\n key={o}\n open={o === openTooltip}\n onOpenChange={(bool) => setOpenTooltip(bool ? o : null)}\n >\n <PopoverTrigger\n onMouseEnter={() => setOpenTooltip(o)}\n onMouseLeave={() => setOpenTooltip(null)}\n asChild\n >\n <TabsTrigger\n aria-current={selectedOption === opt.value ? \"page\" : undefined}\n value={opt.value}\n role=\"tab\"\n tabIndex={0}\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value ? activeTabStyle : inactiveTabStyle,\n )}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n </PopoverTrigger>\n <PopoverContent {...opt.tooltipContentProps}>{opt.tooltip}</PopoverContent>\n </PopoverRoot>\n ) : (\n <TabsTrigger\n key={o}\n role=\"tab\"\n tabIndex={0}\n aria-current={selectedOption === opt.value ? \"page\" : undefined}\n onClick={() => {\n if (props.disabled || opt.disabled) return;\n handleChange(opt);\n }}\n className={cn(\n ...radio_option_tabs_styling,\n selectedOption === opt.value ? activeTabStyle : inactiveTabStyle,\n )}\n value={opt.value}\n >\n {opt.icon && opt.icon}\n {opt.label}\n </TabsTrigger>\n );\n })}\n </TabsList>\n </Tabs>\n {!forceHideHelperText && <HelperText helperText={props.helperText} />}\n </div>\n );\n case \"bordered\":\n return (\n <div\n className={cn(\n orientationStyle[orientation],\n \"hawa-gap-4\",\n containerClassNames?.bordered,\n )}\n >\n {props.options &&\n props.options.map((opt, i) => (\n <div key={i} className=\"hawa-w-full hawa-rounded hawa-border\">\n <div\n className={cn(\n \"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\"\n ? \"margin-left right-19px\"\n : \"margin-right left-23px\",\n )}\n key={i + 1}\n >\n <input\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white\",\n opt.disabled ? \"hawa-opacity-50\" : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n </div>\n ))}\n </div>\n );\n case \"cards\":\n return (\n <ul\n className={cn(orientationStyle[orientation], \"hawa-gap-4\", containerClassNames?.cards)}\n >\n {props.options?.map((opt: any, o) => (\n <li key={o} onClick={() => handleChange(opt)}>\n <input\n type=\"radio\"\n id={opt.value.toString()}\n name={name}\n value={opt.value.toString()}\n className=\"hawa-peer hawa-hidden\"\n required\n disabled={opt.disabled}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary\",\n opt.disabled\n ? \"hawa-opacity-50\"\n : \"hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300\",\n )}\n >\n <div className=\"hawa-block hawa-h-full hawa-w-full\">\n <div className=\"hawa-w-full hawa-text-lg hawa-font-semibold\">{opt.label}</div>\n <div className=\"hawa-w-full\">{opt.sublabel}</div>\n </div>\n </label>\n </li>\n ))}\n </ul>\n );\n\n default:\n return (\n <div className={cn(\"hawa-flex hawa-flex-col hawa-gap-2\", containerClassNames?.default)}>\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className={cn(orientationStyle[orientation], \"hawa-gap-2\")}>\n {props.options &&\n props.options.map((opt, i) => (\n <div\n className={cn(\n \"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all\",\n props.direction === \"rtl\" ? \"margin-left right-3px\" : \"margin-right left-3px\",\n )}\n key={i + 1}\n >\n <input\n // TODO: spread the usual radio props\n disabled={opt.disabled}\n id={opt.value.toString()}\n type=\"radio\"\n value={opt.value}\n name={name}\n onChange={() => handleChange(opt)}\n />\n <label\n htmlFor={opt.value.toString()}\n className={cn(\n \"hawa-text-sm hawa-font-medium dark:hawa-text-white\",\n opt.disabled\n ? \"hawa-text-gray-400\"\n : \"hawa-cursor-pointer hawa-text-gray-900\",\n )}\n >\n {opt.label}\n </label>\n </div>\n ))}\n </div>\n <HelperText helperText={props.helperText} />\n </div>\n );\n }\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","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 * as React from \"react\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, align = \"center\", sideOffset = 4, container, ...props }, ref) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\ninterface PopoverProps {\n side?: PositionType;\n align?: \"start\" | \"center\" | \"end\";\n trigger?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n sideOffset?: number;\n disableTrigger?: any;\n width?: \"trigger\" | \"default\";\n open?: boolean;\n contentProps?: PopoverPrimitive.PopoverContentProps;\n triggerProps?: PopoverPrimitive.PopoverTriggerProps;\n}\n\ntype HawaPopoverTypes = PopoverProps & React.ComponentProps<typeof PopoverPrimitive.Root>;\n\nconst Popover: React.FC<HawaPopoverTypes> = ({\n trigger,\n children,\n className,\n align = \"center\",\n side,\n sideOffset = 4,\n open,\n width = \"default\",\n disableTrigger,\n contentProps,\n triggerProps,\n ...props\n}) => {\n let widthStyles = {\n trigger: \"var(--radix-popover-trigger-width)\",\n default: \"auto\",\n };\n\n return (\n <PopoverPrimitive.Root open={open} {...props}>\n <PopoverPrimitive.Trigger className=\"hawa-w-full\" disabled={disableTrigger} {...triggerProps}>\n {trigger}\n </PopoverPrimitive.Trigger>\n <PopoverContent\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n style={{\n width: widthStyles[width],\n maxWidth: \"var(--radix-popover-content-available-width)\",\n maxHeight: \"var(--radix-popover-content-available-height)\",\n }}\n {...contentProps}\n >\n {children}\n </PopoverContent>\n </PopoverPrimitive.Root>\n );\n};\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverPortal = PopoverPrimitive.Portal;\nconst PopoverRoot = PopoverPrimitive.Root;\n\nexport { Popover, PopoverPortal, PopoverRoot, PopoverContent, PopoverTrigger };\n"],"mappings":";;;AAAA,OAAOA,UAAS,UAAc,QAAQ,WAAW,cAAAC,mBAAkB;AAGnE,SAAS,UAAU,aAAa,YAAY;;;ACH5C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,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gBAAAA,OAAA,cAAC,SAAI,WAAU,wCACb,gBAAAA,OAAA,cAAC,SAAI,WAAU,iDAA+C,IAAI,KAAM,GACxE,gBAAAA,OAAA,cAAC,SAAI,WAAU,iBAAe,IAAI,QAAS,CAC7C;AAAA,UACF,CACF;AAAA,QAEJ;AAAA,MAGJ;AACE,eACE,gBAAAA,OAAA,cAAC,SAAI,WAAW,GAAG,sCAAsC,2DAAqB,OAAO,KAClF,MAAM,SAAS,gBAAAA,OAAA,cAAC,SAAO,GAAG,cAAa,MAAM,KAAM,GACpD,gBAAAA,OAAA,cAAC,SAAI,WAAW,GAAG,iBAAiB,WAAW,GAAG,YAAY,KAC3D,MAAM,WACL,MAAM,QAAQ,IAAI,CAAC,KAAK,MACtB,gBAAAA,OAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA,MAAM,cAAc,QAAQ,0BAA0B;AAAA,YACxD;AAAA,YACA,KAAK,IAAI;AAAA;AAAA,UAET,gBAAAA,OAAA;AAAA,YAAC;AAAA;AAAA,cAEC,UAAU,IAAI;AAAA,cACd,IAAI,IAAI,MAAM,SAAS;AAAA,cACvB,MAAK;AAAA,cACL,OAAO,IAAI;AAAA,cACX;AAAA,cACA,UAAU,MAAM,aAAa,GAAG;AAAA;AAAA,UAClC;AAAA,UACA,gBAAAA,OAAA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,IAAI,MAAM,SAAS;AAAA,cAC5B,WAAW;AAAA,gBACT;AAAA,gBACA,IAAI,WACA,uBACA;AAAA,cACN;AAAA;AAAA,YAEC,IAAI;AAAA,UACP;AAAA,QACF,CACD,CACL,GACA,gBAAAA,OAAA,cAAC,cAAW,YAAY,MAAM,YAAY,CAC5C;AAAA,IAEN;AAAA,EACF;AACF;","names":["React","forwardRef","React","React","React","React","forwardRef","React","_a"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../elements/scrollArea/index.ts","../../elements/scrollArea/ScrollArea.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./ScrollArea\";\n","import * as React from \"react\";\n\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport { cn } from \"@util/index\";\n\nimport { OrientationType } from \"@_types/commonTypes\";\n\ntype ScrollAreaProps = React.ComponentPropsWithoutRef<\n typeof ScrollAreaPrimitive.Root\n> & {\n orientation?: OrientationType;\n};\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n ScrollAreaProps\n>(({ className, children, orientation = \"vertical\", ...props }, ref) => {\n const scrollAreaRef = React.useRef<HTMLDivElement | null>(null);\n const isDragging = React.useRef(false);\n const startPos = React.useRef({ x: 0, y: 0 });\n const scrollPos = React.useRef({ top: 0, left: 0 });\n\n const [showLeftFade, setShowLeftFade] = React.useState(false);\n const [showRightFade, setShowRightFade] = React.useState(false);\n\n const checkOverflow = () => {\n if (scrollAreaRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;\n setShowLeftFade(scrollLeft > 0);\n setShowRightFade(scrollLeft + clientWidth < scrollWidth);\n }\n };\n\n const onMouseDown = (e: React.MouseEvent) => {\n isDragging.current = true;\n startPos.current = { x: e.clientX, y: e.clientY };\n if (scrollAreaRef.current) {\n scrollPos.current = {\n top: scrollAreaRef.current.scrollTop,\n left: scrollAreaRef.current.scrollLeft,\n };\n }\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n };\n\n const onMouseMove = (e: MouseEvent) => {\n if (!isDragging.current || !scrollAreaRef.current) return;\n const dx = e.clientX - startPos.current.x;\n const dy = e.clientY - startPos.current.y;\n if (orientation === \"vertical\") {\n scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;\n } else {\n scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;\n checkOverflow();\n }\n };\n\n const onMouseUp = () => {\n isDragging.current = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n\n React.useEffect(() => {\n checkOverflow();\n if (scrollAreaRef.current) {\n scrollAreaRef.current.addEventListener(\"scroll\", checkOverflow);\n window.addEventListener(\"resize\", checkOverflow);\n }\n return () => {\n if (scrollAreaRef.current) {\n scrollAreaRef.current.removeEventListener(\"scroll\", checkOverflow);\n }\n window.removeEventListener(\"resize\", checkOverflow);\n };\n }, []);\n\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"hawa-relative hawa-overflow-hidden\", className)}\n {...props}\n >\n <div\n className={cn(\n \"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right\",\n showLeftFade ? \"hawa-block\" : \"hawa-hidden\",\n )}\n />\n <div\n className={cn(\n \"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10\",\n showRightFade ? \"hawa-block\" : \"hawa-hidden\",\n )}\n />\n <ScrollAreaPrimitive.Viewport\n ref={scrollAreaRef}\n className=\"hawa-h-full hawa-w-full hawa-rounded-[inherit]\"\n onMouseDown={onMouseDown}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation={orientation} />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\n\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors\",\n orientation === \"vertical\" &&\n \"hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]\",\n orientation === \"horizontal\" &&\n \"hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]\",\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n className={cn(\n \"hawa-relative hawa-rounded-full hawa-bg-border\",\n orientation === \"vertical\" && \"hawa-flex-1\",\n )}\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\n\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\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;;;ACAA,YAAuB;AAEvB,0BAAqC;;;ACFrC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADQA,IAAM,aAAmB,iBAGvB,CAAC,EAAE,WAAW,UAAU,cAAc,YAAY,GAAG,MAAM,GAAG,QAAQ;AACtE,QAAM,gBAAsB,aAA8B,IAAI;AAC9D,QAAM,aAAmB,aAAO,KAAK;AACrC,QAAM,WAAiB,aAAO,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC;AAC5C,QAAM,YAAkB,aAAO,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;AAElD,QAAM,CAAC,cAAc,eAAe,IAAU,eAAS,KAAK;AAC5D,QAAM,CAAC,eAAe,gBAAgB,IAAU,eAAS,KAAK;AAE9D,QAAM,gBAAgB,MAAM;AAC1B,QAAI,cAAc,SAAS;AACzB,YAAM,EAAE,YAAY,aAAa,YAAY,IAAI,cAAc;AAC/D,sBAAgB,aAAa,CAAC;AAC9B,uBAAiB,aAAa,cAAc,WAAW;AAAA,IACzD;AAAA,EACF;AAEA,QAAM,cAAc,CAAC,MAAwB;AAC3C,eAAW,UAAU;AACrB,aAAS,UAAU,EAAE,GAAG,EAAE,SAAS,GAAG,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AC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,gBAAgB,eAAe;AAAA,QACjC;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAqB;AAAA,MAApB;AAAA,QACC,KAAK;AAAA,QACL,WAAU;AAAA,QACV;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,IACA,oCAAC,aAAU,aAA0B;AAAA,IACrC,oCAAqB,4BAApB,IAA2B;AAAA,EAC9B;AAEJ,CAAC;AAED,WAAW,cAAkC,yBAAK;AAElD,IAAM,YAAkB,iBAGtB,CAAC,EAAE,WAAW,cAAc,YAAY,GAAG,MAAM,GAAG,QACpD;AAAA,EAAqB;AAAA,EAApB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,gBAAgB,cACd;AAAA,MACF,gBAAgB,gBACd;AAAA,MACF;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AAAA,EAEJ;AAAA,IAAqB;AAAA,IAApB;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,gBAAgB,cAAc;AAAA,MAChC;AAAA;AAAA,EACF;AACF,CACD;AAED,UAAU,cAAkC,wCAAoB;","names":[]}
1
+ {"version":3,"sources":["../../elements/scrollArea/index.ts","../../elements/scrollArea/ScrollArea.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./ScrollArea\";\n","import * as React from \"react\";\n\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport { cn } from \"@util/index\";\n\nimport { OrientationType } from \"@_types/commonTypes\";\n\ntype ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {\n orientation?: OrientationType;\n};\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n ScrollAreaProps\n>(({ className, children, orientation = \"vertical\", ...props }, ref) => {\n const scrollAreaRef = React.useRef<HTMLDivElement | null>(null);\n const isDragging = React.useRef(false);\n const startPos = React.useRef({ x: 0, y: 0 });\n const scrollPos = React.useRef({ top: 0, left: 0 });\n\n const [showLeftFade, setShowLeftFade] = React.useState(false);\n const [showRightFade, setShowRightFade] = React.useState(false);\n\n const checkOverflow = () => {\n if (scrollAreaRef.current) {\n const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;\n setShowLeftFade(scrollLeft > 0);\n setShowRightFade(scrollLeft + clientWidth < scrollWidth);\n }\n };\n\n const onMouseDown = (e: React.MouseEvent) => {\n isDragging.current = true;\n startPos.current = { x: e.clientX, y: e.clientY };\n if (scrollAreaRef.current) {\n scrollPos.current = {\n top: scrollAreaRef.current.scrollTop,\n left: scrollAreaRef.current.scrollLeft,\n };\n }\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n };\n\n const onMouseMove = (e: MouseEvent) => {\n if (!isDragging.current || !scrollAreaRef.current) return;\n const dx = e.clientX - startPos.current.x;\n const dy = e.clientY - startPos.current.y;\n if (orientation === \"vertical\") {\n scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;\n } else {\n scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;\n checkOverflow();\n }\n };\n\n const onMouseUp = () => {\n isDragging.current = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n\n React.useEffect(() => {\n checkOverflow();\n if (scrollAreaRef.current) {\n scrollAreaRef.current.addEventListener(\"scroll\", checkOverflow);\n window.addEventListener(\"resize\", checkOverflow);\n }\n return () => {\n if (scrollAreaRef.current) {\n scrollAreaRef.current.removeEventListener(\"scroll\", checkOverflow);\n }\n window.removeEventListener(\"resize\", checkOverflow);\n };\n }, []);\n\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"hawa-relative hawa-overflow-hidden\", className)}\n {...props}\n >\n <div\n className={cn(\n \"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right\",\n showLeftFade ? \"hawa-block\" : \"hawa-hidden\",\n )}\n />\n <div\n className={cn(\n \"hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10\",\n showRightFade ? \"hawa-block\" : \"hawa-hidden\",\n )}\n />\n <ScrollAreaPrimitive.Viewport\n ref={scrollAreaRef}\n className=\"hawa-h-full hawa-w-full hawa-rounded-[inherit]\"\n onMouseDown={onMouseDown}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation={orientation} />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\n\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors\",\n orientation === \"vertical\" &&\n \"hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]\",\n orientation === \"horizontal\" &&\n \"hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]\",\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n className={cn(\n \"hawa-relative hawa-rounded-full hawa-bg-border\",\n orientation === \"vertical\" && \"hawa-flex-1\",\n )}\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\n\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\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;AAAA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