@sikka/hawa 0.40.1-next → 0.41.1-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 (242) hide show
  1. package/dist/accordion/index.js.map +1 -1
  2. package/dist/accordion/index.mjs.map +1 -1
  3. package/dist/alert/index.js +1 -1
  4. package/dist/alert/index.js.map +1 -1
  5. package/dist/alert/index.mjs +1 -1
  6. package/dist/alert/index.mjs.map +1 -1
  7. package/dist/appLayout/index.js +15 -15
  8. package/dist/appLayout/index.js.map +1 -1
  9. package/dist/appLayout/index.mjs +15 -15
  10. package/dist/appLayout/index.mjs.map +1 -1
  11. package/dist/appMenubar/index.js.map +1 -1
  12. package/dist/appMenubar/index.mjs.map +1 -1
  13. package/dist/appTabs/index.js +2 -2
  14. package/dist/appTabs/index.js.map +1 -1
  15. package/dist/appTabs/index.mjs +2 -2
  16. package/dist/appTabs/index.mjs.map +1 -1
  17. package/dist/appTopbar/index.js +5 -5
  18. package/dist/appTopbar/index.js.map +1 -1
  19. package/dist/appTopbar/index.mjs +5 -5
  20. package/dist/appTopbar/index.mjs.map +1 -1
  21. package/dist/avatar/index.js +1 -1
  22. package/dist/avatar/index.js.map +1 -1
  23. package/dist/avatar/index.mjs +1 -1
  24. package/dist/avatar/index.mjs.map +1 -1
  25. package/dist/backToTop/index.js +1 -1
  26. package/dist/backToTop/index.js.map +1 -1
  27. package/dist/backToTop/index.mjs +1 -1
  28. package/dist/backToTop/index.mjs.map +1 -1
  29. package/dist/badge/index.d.mts +1 -1
  30. package/dist/badge/index.d.ts +1 -1
  31. package/dist/badge/index.js +1 -1
  32. package/dist/badge/index.js.map +1 -1
  33. package/dist/badge/index.mjs +1 -1
  34. package/dist/badge/index.mjs.map +1 -1
  35. package/dist/blocks/auth/index.js +102 -17
  36. package/dist/blocks/auth/index.mjs +100 -15
  37. package/dist/blocks/feedback/index.js +20 -21
  38. package/dist/blocks/feedback/index.mjs +18 -20
  39. package/dist/blocks/index.js +150 -66
  40. package/dist/blocks/index.mjs +47 -49
  41. package/dist/blocks/misc/index.js +17 -19
  42. package/dist/blocks/misc/index.mjs +11 -11
  43. package/dist/blocks/pricing/index.js +23 -23
  44. package/dist/blocks/pricing/index.mjs +21 -21
  45. package/dist/button/index.js.map +1 -1
  46. package/dist/button/index.mjs.map +1 -1
  47. package/dist/calendar/index.js.map +1 -1
  48. package/dist/calendar/index.mjs.map +1 -1
  49. package/dist/card/index.js +1 -1
  50. package/dist/card/index.js.map +1 -1
  51. package/dist/card/index.mjs +1 -1
  52. package/dist/card/index.mjs.map +1 -1
  53. package/dist/carousel/index.d.mts +1 -1
  54. package/dist/carousel/index.d.ts +1 -1
  55. package/dist/carousel/index.js +7 -7
  56. package/dist/carousel/index.js.map +1 -1
  57. package/dist/carousel/index.mjs +7 -7
  58. package/dist/carousel/index.mjs.map +1 -1
  59. package/dist/checkbox/index.js +2 -2
  60. package/dist/checkbox/index.js.map +1 -1
  61. package/dist/checkbox/index.mjs +2 -2
  62. package/dist/checkbox/index.mjs.map +1 -1
  63. package/dist/{chunk-27G5FKOP.mjs → chunk-2GEXJLRC.mjs} +1 -1
  64. package/dist/{chunk-QSEQS7DS.mjs → chunk-7R25FOBM.mjs} +17 -17
  65. package/dist/{chunk-AJTYKC5R.mjs → chunk-CQYG77SY.mjs} +1 -1
  66. package/dist/{chunk-QZIENYTE.mjs → chunk-D7HDVJFT.mjs} +3 -3
  67. package/dist/{chunk-DYPGZ2IP.mjs → chunk-EBZECS2Z.mjs} +4 -4
  68. package/dist/{chunk-CTNKKP2O.mjs → chunk-FLMCWOQQ.mjs} +62 -62
  69. package/dist/{chunk-GU2DOJ7Q.mjs → chunk-FP6763YO.mjs} +89 -4
  70. package/dist/{chunk-RT2Q3SH7.mjs → chunk-I3AK6DXN.mjs} +3 -3
  71. package/dist/{chunk-CTZRVSTI.mjs → chunk-K5S7P5ZO.mjs} +4 -4
  72. package/dist/{chunk-GN7EIDTE.mjs → chunk-QNLA5TSV.mjs} +2 -2
  73. package/dist/codeBlock/index.js +5 -5
  74. package/dist/codeBlock/index.js.map +1 -1
  75. package/dist/codeBlock/index.mjs +5 -5
  76. package/dist/codeBlock/index.mjs.map +1 -1
  77. package/dist/colorPicker/index.js.map +1 -1
  78. package/dist/colorPicker/index.mjs.map +1 -1
  79. package/dist/combobox/index.js +7 -7
  80. package/dist/combobox/index.js.map +1 -1
  81. package/dist/combobox/index.mjs +7 -7
  82. package/dist/combobox/index.mjs.map +1 -1
  83. package/dist/command/index.js +5 -5
  84. package/dist/command/index.js.map +1 -1
  85. package/dist/command/index.mjs +5 -5
  86. package/dist/command/index.mjs.map +1 -1
  87. package/dist/dataTable/index.d.mts +6 -1
  88. package/dist/dataTable/index.d.ts +6 -1
  89. package/dist/dataTable/index.js +459 -245
  90. package/dist/dataTable/index.js.map +1 -1
  91. package/dist/dataTable/index.mjs +476 -262
  92. package/dist/dataTable/index.mjs.map +1 -1
  93. package/dist/datePicker/index.js.map +1 -1
  94. package/dist/datePicker/index.mjs.map +1 -1
  95. package/dist/destroyableCard/index.js +1 -1
  96. package/dist/destroyableCard/index.js.map +1 -1
  97. package/dist/destroyableCard/index.mjs +1 -1
  98. package/dist/destroyableCard/index.mjs.map +1 -1
  99. package/dist/dialog/index.js +4 -4
  100. package/dist/dialog/index.js.map +1 -1
  101. package/dist/dialog/index.mjs +4 -4
  102. package/dist/dialog/index.mjs.map +1 -1
  103. package/dist/docsLayout/index.js +92 -9
  104. package/dist/docsLayout/index.js.map +1 -1
  105. package/dist/docsLayout/index.mjs +92 -9
  106. package/dist/docsLayout/index.mjs.map +1 -1
  107. package/dist/docsSidebar/index.js +1 -1
  108. package/dist/docsSidebar/index.js.map +1 -1
  109. package/dist/docsSidebar/index.mjs +1 -1
  110. package/dist/docsSidebar/index.mjs.map +1 -1
  111. package/dist/dropdownMenu/index.js +3 -3
  112. package/dist/dropdownMenu/index.js.map +1 -1
  113. package/dist/dropdownMenu/index.mjs +3 -3
  114. package/dist/dropdownMenu/index.mjs.map +1 -1
  115. package/dist/elements/index.d.mts +12 -2
  116. package/dist/elements/index.d.ts +12 -2
  117. package/dist/elements/index.js +656 -493
  118. package/dist/elements/index.mjs +288 -210
  119. package/dist/fileDropzone/index.js +5 -5
  120. package/dist/fileDropzone/index.js.map +1 -1
  121. package/dist/fileDropzone/index.mjs +5 -5
  122. package/dist/fileDropzone/index.mjs.map +1 -1
  123. package/dist/glow/index.js.map +1 -1
  124. package/dist/glow/index.mjs.map +1 -1
  125. package/dist/hooks/index.d.mts +1 -1
  126. package/dist/hooks/index.d.ts +1 -1
  127. package/dist/index.css +27 -127
  128. package/dist/index.d.mts +13 -3
  129. package/dist/index.d.ts +13 -3
  130. package/dist/index.js +732 -570
  131. package/dist/index.mjs +822 -660
  132. package/dist/input/index.js +3 -3
  133. package/dist/input/index.js.map +1 -1
  134. package/dist/input/index.mjs +3 -3
  135. package/dist/input/index.mjs.map +1 -1
  136. package/dist/interfaceSettings/index.js +4 -4
  137. package/dist/interfaceSettings/index.js.map +1 -1
  138. package/dist/interfaceSettings/index.mjs +4 -4
  139. package/dist/interfaceSettings/index.mjs.map +1 -1
  140. package/dist/label/index.js.map +1 -1
  141. package/dist/label/index.mjs.map +1 -1
  142. package/dist/layout/index.js +119 -36
  143. package/dist/layout/index.mjs +31 -31
  144. package/dist/loading/index.js.map +1 -1
  145. package/dist/loading/index.mjs.map +1 -1
  146. package/dist/logos/index.d.mts +5 -0
  147. package/dist/logos/index.d.ts +5 -0
  148. package/dist/logos/index.js +85 -0
  149. package/dist/logos/index.js.map +1 -1
  150. package/dist/logos/index.mjs +85 -0
  151. package/dist/logos/index.mjs.map +1 -1
  152. package/dist/navbar/index.js +12 -12
  153. package/dist/navbar/index.js.map +1 -1
  154. package/dist/navbar/index.mjs +12 -12
  155. package/dist/navbar/index.mjs.map +1 -1
  156. package/dist/navigationMenu/index.js +5 -5
  157. package/dist/navigationMenu/index.js.map +1 -1
  158. package/dist/navigationMenu/index.mjs +5 -5
  159. package/dist/navigationMenu/index.mjs.map +1 -1
  160. package/dist/pagination/index.js.map +1 -1
  161. package/dist/pagination/index.mjs.map +1 -1
  162. package/dist/passwordInput/index.js +3 -3
  163. package/dist/passwordInput/index.js.map +1 -1
  164. package/dist/passwordInput/index.mjs +3 -3
  165. package/dist/passwordInput/index.mjs.map +1 -1
  166. package/dist/phoneInput/index.js +4 -4
  167. package/dist/phoneInput/index.js.map +1 -1
  168. package/dist/phoneInput/index.mjs +4 -4
  169. package/dist/phoneInput/index.mjs.map +1 -1
  170. package/dist/progress/index.js.map +1 -1
  171. package/dist/progress/index.mjs.map +1 -1
  172. package/dist/progressCircle/index.js +1 -1
  173. package/dist/progressCircle/index.js.map +1 -1
  174. package/dist/progressCircle/index.mjs +1 -1
  175. package/dist/progressCircle/index.mjs.map +1 -1
  176. package/dist/radio/index.js +3 -3
  177. package/dist/radio/index.js.map +1 -1
  178. package/dist/radio/index.mjs +3 -3
  179. package/dist/radio/index.mjs.map +1 -1
  180. package/dist/scrollArea/index.js +2 -2
  181. package/dist/scrollArea/index.js.map +1 -1
  182. package/dist/scrollArea/index.mjs +2 -2
  183. package/dist/scrollArea/index.mjs.map +1 -1
  184. package/dist/scrollIndicator/index.js.map +1 -1
  185. package/dist/scrollIndicator/index.mjs.map +1 -1
  186. package/dist/select/index.js +2 -2
  187. package/dist/select/index.js.map +1 -1
  188. package/dist/select/index.mjs +2 -2
  189. package/dist/select/index.mjs.map +1 -1
  190. package/dist/separator/index.js.map +1 -1
  191. package/dist/separator/index.mjs.map +1 -1
  192. package/dist/sheet/index.js +1 -1
  193. package/dist/sheet/index.js.map +1 -1
  194. package/dist/sheet/index.mjs +1 -1
  195. package/dist/sheet/index.mjs.map +1 -1
  196. package/dist/sidebar/index.js +5 -5
  197. package/dist/sidebar/index.js.map +1 -1
  198. package/dist/sidebar/index.mjs +5 -5
  199. package/dist/sidebar/index.mjs.map +1 -1
  200. package/dist/signature/index.js.map +1 -1
  201. package/dist/signature/index.mjs.map +1 -1
  202. package/dist/simpleTable/index.js +5 -5
  203. package/dist/simpleTable/index.js.map +1 -1
  204. package/dist/simpleTable/index.mjs +5 -5
  205. package/dist/simpleTable/index.mjs.map +1 -1
  206. package/dist/slider/index.js.map +1 -1
  207. package/dist/slider/index.mjs.map +1 -1
  208. package/dist/sortButton/index.js.map +1 -1
  209. package/dist/sortButton/index.mjs.map +1 -1
  210. package/dist/splitButton/index.d.mts +27 -27
  211. package/dist/splitButton/index.d.ts +27 -27
  212. package/dist/splitButton/index.js +750 -750
  213. package/dist/splitButton/index.js.map +1 -1
  214. package/dist/splitButton/index.mjs +752 -752
  215. package/dist/splitButton/index.mjs.map +1 -1
  216. package/dist/stats/index.js +3 -5
  217. package/dist/stats/index.js.map +1 -1
  218. package/dist/stats/index.mjs +3 -5
  219. package/dist/stats/index.mjs.map +1 -1
  220. package/dist/switch/index.js +1 -1
  221. package/dist/switch/index.js.map +1 -1
  222. package/dist/switch/index.mjs +1 -1
  223. package/dist/switch/index.mjs.map +1 -1
  224. package/dist/table/index.js +4 -4
  225. package/dist/table/index.js.map +1 -1
  226. package/dist/table/index.mjs +4 -4
  227. package/dist/table/index.mjs.map +1 -1
  228. package/dist/tabs/index.js +2 -2
  229. package/dist/tabs/index.js.map +1 -1
  230. package/dist/tabs/index.mjs +2 -2
  231. package/dist/tabs/index.mjs.map +1 -1
  232. package/dist/textarea/index.js +1 -1
  233. package/dist/textarea/index.js.map +1 -1
  234. package/dist/textarea/index.mjs +1 -1
  235. package/dist/textarea/index.mjs.map +1 -1
  236. package/dist/toaster/index.js +1 -1
  237. package/dist/toaster/index.js.map +1 -1
  238. package/dist/toaster/index.mjs +1 -1
  239. package/dist/toaster/index.mjs.map +1 -1
  240. package/dist/tooltip/index.js.map +1 -1
  241. package/dist/tooltip/index.mjs.map +1 -1
  242. package/package.json +1 -1
@@ -10,839 +10,839 @@ function cn(...inputs) {
10
10
  return twMerge(clsx(inputs));
11
11
  }
12
12
 
13
- // elements/dropdownMenu/DropdownMenu.tsx
14
- import * as React from "react";
15
- import { Portal } from "@headlessui/react";
16
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
17
- var DropdownMenuRoot = DropdownMenuPrimitive.Root;
18
- var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
19
- var DropdownMenuSub = DropdownMenuPrimitive.Sub;
20
- var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
21
- var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
22
- DropdownMenuPrimitive.SubTrigger,
13
+ // elements/button/Button.tsx
14
+ import * as React5 from "react";
15
+ import { cva } from "class-variance-authority";
16
+
17
+ // elements/helperText/HelperText.tsx
18
+ import React from "react";
19
+ var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
20
+ "p",
23
21
  {
24
- ref,
25
22
  className: cn(
26
- "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent",
27
- inset && "hawa-pl-8",
28
- className
29
- ),
30
- ...props
31
- },
32
- /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
33
- " ",
34
- /* @__PURE__ */ React.createElement(
35
- "svg",
36
- {
37
- "aria-label": "Chevron Right Icon",
38
- stroke: "currentColor",
39
- fill: "currentColor",
40
- strokeWidth: "0",
41
- viewBox: "0 0 16 16",
42
- height: "1em",
43
- width: "1em",
44
- className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
45
- },
46
- /* @__PURE__ */ React.createElement(
47
- "path",
48
- {
49
- fillRule: "evenodd",
50
- d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
51
- }
23
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
24
+ helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
52
25
  )
53
- )
54
- ));
55
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
56
- var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
57
- DropdownMenuPrimitive.SubContent,
58
- {
59
- ref,
60
- className: cn(
61
- "hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
62
- className
63
- ),
64
- ...props
65
- }
66
- ));
67
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
68
- var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(
69
- DropdownMenuPrimitive.Content,
26
+ },
27
+ helperText
28
+ );
29
+
30
+ // elements/label/Label.tsx
31
+ import * as React3 from "react";
32
+
33
+ // elements/tooltip/Tooltip.tsx
34
+ import React2 from "react";
35
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
36
+ var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
37
+ TooltipPrimitive.Content,
70
38
  {
71
39
  ref,
72
40
  sideOffset,
73
41
  className: cn(
74
- "hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
42
+ "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",
43
+ {
44
+ "hawa-text-xs": size === "small",
45
+ "hawa-text-xl": size === "large"
46
+ },
75
47
  className
76
48
  ),
77
49
  ...props
78
50
  }
79
- )));
80
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
81
- var DropdownMenuItem = React.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
82
- return /* @__PURE__ */ React.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React.createElement(
83
- DropdownMenuPrimitive.Item,
51
+ ));
52
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
53
+ var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
54
+ TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
55
+ var Tooltip = ({
56
+ side,
57
+ size,
58
+ open,
59
+ content,
60
+ children,
61
+ disabled,
62
+ defaultOpen,
63
+ onOpenChange,
64
+ triggerProps,
65
+ contentProps,
66
+ providerProps,
67
+ delayDuration = 300,
68
+ ...props
69
+ }) => {
70
+ return /* @__PURE__ */ React2.createElement(
71
+ TooltipPrimitive.TooltipProvider,
84
72
  {
85
- disabled: props.disabled,
86
- ref,
87
- className: cn(
88
- "hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
89
- inset && "hawa-pl-8",
90
- props.end && Array.isArray(props.children) && props.children[1] && "hawa-gap-6",
91
- className
92
- ),
93
- ...props
73
+ delayDuration,
74
+ ...providerProps
94
75
  },
95
- /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 " }, props.children),
96
- props.end && props.end,
97
- !props.end && props.shortcut && /* @__PURE__ */ React.createElement(DropdownMenuShortcut, null, props.shortcut),
98
- !props.end && badged && /* @__PURE__ */ React.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
99
- ));
100
- });
101
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
102
- var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React.createElement(
103
- DropdownMenuPrimitive.CheckboxItem,
76
+ /* @__PURE__ */ React2.createElement(
77
+ TooltipPrimitive.Root,
78
+ {
79
+ open: !disabled && open,
80
+ defaultOpen,
81
+ onOpenChange,
82
+ ...props
83
+ },
84
+ /* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
85
+ /* @__PURE__ */ React2.createElement(
86
+ TooltipContent,
87
+ {
88
+ size,
89
+ side,
90
+ align: "center",
91
+ ...contentProps,
92
+ style: {
93
+ ...contentProps == null ? void 0 : contentProps.style,
94
+ maxWidth: "var(--radix-tooltip-content-available-width)",
95
+ maxHeight: "var(--radix-tooltip-content-available-height)"
96
+ }
97
+ },
98
+ content
99
+ )
100
+ )
101
+ );
102
+ };
103
+
104
+ // elements/label/Label.tsx
105
+ var Label = React3.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React3.createElement(
106
+ "label",
104
107
  {
105
108
  ref,
106
109
  className: cn(
107
- "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
110
+ "hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
108
111
  className
109
112
  ),
110
- checked,
111
113
  ...props
112
114
  },
113
- /* @__PURE__ */ React.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement(
114
- "svg",
115
- {
116
- "aria-label": "Check Mark",
117
- stroke: "currentColor",
118
- fill: "currentColor",
119
- strokeWidth: "0",
120
- viewBox: "0 0 512 512",
121
- height: "0.60em",
122
- width: "0.60em"
123
- },
124
- /* @__PURE__ */ React.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
125
- ), " ")),
126
- children
127
- ));
128
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
129
- var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
130
- DropdownMenuPrimitive.RadioItem,
115
+ children,
116
+ required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
117
+ ), hint && /* @__PURE__ */ React3.createElement(
118
+ Tooltip,
131
119
  {
132
- ref,
133
- className: cn(
134
- "hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
135
- className
136
- ),
137
- ...props
120
+ content: hint,
121
+ side: hintSide,
122
+ triggerProps: {
123
+ tabIndex: -1,
124
+ onClick: (event) => event.preventDefault()
125
+ }
138
126
  },
139
- /* @__PURE__ */ React.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement(
127
+ /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
140
128
  "svg",
141
129
  {
142
130
  xmlns: "http://www.w3.org/2000/svg",
143
- width: "24",
144
- "aria-label": "Circle",
145
- height: "24",
131
+ className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
146
132
  viewBox: "0 0 24 24",
147
133
  fill: "none",
148
134
  stroke: "currentColor",
149
135
  strokeWidth: "2",
150
136
  strokeLinecap: "round",
151
- strokeLinejoin: "round",
152
- className: "hawa-h-2 hawa-w-2 hawa-fill-current"
137
+ strokeLinejoin: "round"
153
138
  },
154
- /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" })
155
- ))),
156
- children
157
- ));
158
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
159
- var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React.createElement(
160
- DropdownMenuPrimitive.Label,
161
- {
162
- ref,
163
- className: cn(
164
- "hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
165
- inset && "hawa-pl-8",
166
- className
167
- ),
168
- ...props
169
- }
170
- ));
171
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
172
- var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
173
- DropdownMenuPrimitive.Separator,
174
- {
175
- ref,
176
- className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
177
- ...props
178
- }
179
- ));
180
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
181
- var DropdownMenuShortcut = ({
182
- className,
183
- ...props
184
- }) => {
185
- return /* @__PURE__ */ React.createElement(
186
- "span",
187
- {
188
- className: cn(
189
- "hawa-text-xs hawa-tracking-widest hawa-opacity-60",
190
- className
191
- ),
192
- ...props
193
- }
194
- );
195
- };
196
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
197
- var DropdownMenu = ({
198
- trigger,
199
- items,
200
- direction,
201
- sideOffset,
202
- side,
203
- className,
139
+ /* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
140
+ /* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
141
+ /* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
142
+ ))
143
+ )));
144
+ Label.displayName = "Label";
145
+
146
+ // elements/loading/Loading.tsx
147
+ import React4 from "react";
148
+ var Loading = ({
149
+ design = "spinner",
150
+ size = "normal",
151
+ themeMode = "light",
204
152
  classNames,
205
- triggerClassname,
206
- triggerProps,
207
- align,
208
- alignOffset,
209
- onItemSelect,
210
- size = "default",
211
- width = "default",
212
- header,
213
- onOpenChange,
214
- open,
215
- LinkComponent
153
+ color,
154
+ ...props
216
155
  }) => {
217
- const widthStyles = {
218
- default: "hawa-min-w-[8rem]",
219
- sm: "hawa-w-fit",
220
- lg: "hawa-w-[200px]",
221
- parent: "ddm-w-parent"
222
- };
223
- const sizeStyles = {
224
- default: "hawa-px-2 hawa-py-3 ",
225
- sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
156
+ let sizeStyles = {
157
+ button: "hawa-h-4 hawa-w-4",
158
+ xs: "hawa-h-1 hawa-w-1",
159
+ sm: "hawa-h-6 hawa-w-6",
160
+ normal: "hawa-h-8 hawa-w-8",
161
+ lg: "hawa-h-14 hawa-w-14",
162
+ xl: "hawa-h-24 hawa-w-24"
226
163
  };
227
- let [values, setValues] = React.useState(
228
- items.map((item) => item.currentOption)
229
- );
230
- return /* @__PURE__ */ React.createElement(
231
- DropdownMenuRoot,
232
- {
233
- onOpenChange,
234
- open,
235
- modal: false,
236
- dir: direction
237
- },
238
- /* @__PURE__ */ React.createElement(
239
- DropdownMenuTrigger,
240
- {
241
- asChild: true,
242
- className: cn(classNames == null ? void 0 : classNames.trigger, triggerClassname),
243
- ...triggerProps
244
- },
245
- trigger
246
- ),
247
- /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(
248
- DropdownMenuContent,
249
- {
250
- side,
251
- sideOffset,
252
- align,
253
- alignOffset,
254
- className: cn(
255
- className,
256
- classNames == null ? void 0 : classNames.content,
257
- widthStyles[width],
258
- "hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto"
164
+ let progressSizes = {
165
+ button: "hawa-h-1",
166
+ xs: "hawa-h-1 hawa-w-1",
167
+ sm: "hawa-h-6 hawa-w-6",
168
+ normal: "",
169
+ lg: "hawa-h-6",
170
+ xl: "hawa-h-10 hawa-w-64"
171
+ };
172
+ let animationStyles = {
173
+ pulse: "hawa-animate-in hawa-fade-in hawa-duration-1000",
174
+ bounce: "hawa-animate-bounce"
175
+ };
176
+ switch (design.split("-")[0]) {
177
+ case "dots":
178
+ return /* @__PURE__ */ React4.createElement(
179
+ "div",
180
+ {
181
+ className: cn(
182
+ "hawa-flex hawa-flex-row hawa-gap-2",
183
+ classNames == null ? void 0 : classNames.container
184
+ )
185
+ },
186
+ /* @__PURE__ */ React4.createElement(
187
+ "div",
188
+ {
189
+ className: cn(
190
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
191
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
192
+ animationStyles[design.split("-")[1]],
193
+ color ? color : "hawa-bg-primary"
194
+ )
195
+ }
259
196
  ),
260
- style: {
261
- maxHeight: "var(--radix-dropdown-menu-content-available-height)"
197
+ /* @__PURE__ */ React4.createElement(
198
+ "div",
199
+ {
200
+ className: cn(
201
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
202
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
203
+ animationStyles[design.split("-")[1]],
204
+ color ? color : "hawa-bg-primary"
205
+ )
206
+ }
207
+ ),
208
+ /* @__PURE__ */ React4.createElement(
209
+ "div",
210
+ {
211
+ className: cn(
212
+ "hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
213
+ size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
214
+ animationStyles[design.split("-")[1]],
215
+ color ? color : "hawa-bg-primary"
216
+ )
217
+ }
218
+ )
219
+ );
220
+ case "square":
221
+ return /* @__PURE__ */ React4.createElement(
222
+ "svg",
223
+ {
224
+ className: cn(
225
+ "squircle-container",
226
+ sizeStyles[size],
227
+ classNames == null ? void 0 : classNames.container
228
+ ),
229
+ viewBox: "0 0 35 35",
230
+ height: "35",
231
+ width: "35"
232
+ },
233
+ /* @__PURE__ */ React4.createElement(
234
+ "rect",
235
+ {
236
+ className: "squircle-track",
237
+ x: "2.5",
238
+ y: "2.5",
239
+ fill: "none",
240
+ strokeWidth: "5px",
241
+ width: "32.5",
242
+ height: "32.5"
243
+ }
244
+ ),
245
+ /* @__PURE__ */ React4.createElement(
246
+ "rect",
247
+ {
248
+ className: "square-car",
249
+ x: "2.5",
250
+ y: "2.5",
251
+ fill: "none",
252
+ strokeWidth: "5px",
253
+ width: "32.5",
254
+ height: "32.5",
255
+ pathLength: "100"
256
+ }
257
+ )
258
+ );
259
+ case "squircle":
260
+ return /* @__PURE__ */ React4.createElement(
261
+ "svg",
262
+ {
263
+ x: "0px",
264
+ y: "0px",
265
+ viewBox: "0 0 37 37",
266
+ height: "37",
267
+ width: "37",
268
+ preserveAspectRatio: "xMidYMid meet",
269
+ className: cn(
270
+ "squircle-container",
271
+ sizeStyles[size],
272
+ classNames == null ? void 0 : classNames.container
273
+ )
274
+ },
275
+ /* @__PURE__ */ React4.createElement(
276
+ "path",
277
+ {
278
+ className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
279
+ fill: "none",
280
+ strokeWidth: "5",
281
+ pathLength: "100",
282
+ d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ React4.createElement(
286
+ "path",
287
+ {
288
+ className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
289
+ fill: "none",
290
+ strokeWidth: "5",
291
+ pathLength: "100",
292
+ d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
293
+ }
294
+ )
295
+ );
296
+ case "progress":
297
+ return /* @__PURE__ */ React4.createElement(
298
+ "div",
299
+ {
300
+ className: cn(
301
+ "progress-loading after:hawa-rounded hawa-rounded",
302
+ progressSizes[size],
303
+ classNames == null ? void 0 : classNames.container
304
+ )
262
305
  }
263
- },
264
- header && header,
265
- items && items.map((item, index) => {
266
- var _a;
267
- const ItemLinkComponent = item.slug ? LinkComponent : "a";
268
- if (item.itemType === "separator") {
269
- return /* @__PURE__ */ React.createElement(
270
- DropdownMenuSeparator,
271
- {
272
- key: index,
273
- className: classNames == null ? void 0 : classNames.separator
274
- }
275
- );
276
- } else if (item.itemType === "label") {
277
- return /* @__PURE__ */ React.createElement(DropdownMenuLabel, { key: index }, item.label);
278
- } else if (item.itemType === "radio") {
279
- let dd = item.currentOption;
280
- return /* @__PURE__ */ React.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React.createElement(
281
- DropdownMenuSubTrigger,
282
- {
283
- dir: direction,
284
- className: cn(sizeStyles[size])
285
- },
286
- item.icon && item.icon,
287
- item.label && item.label
288
- ), /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React.createElement(
289
- DropdownMenuRadioGroup,
290
- {
291
- value: values[index],
292
- onValueChange: (e) => {
293
- let newValues = [...values];
294
- newValues[index] = e;
295
- setValues(newValues);
296
- console.log("changing to ", e);
297
- if (item.onOptionChange) {
298
- item.onOptionChange(e);
299
- }
300
- }
301
- },
302
- (_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
303
- )));
304
- } else if (item.itemType === "custom") {
305
- return /* @__PURE__ */ React.createElement("div", { key: index }, item.content);
306
- } else {
307
- return item.subitems ? /* @__PURE__ */ React.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React.createElement(
308
- DropdownMenuSubTrigger,
309
- {
310
- dir: direction,
311
- className: cn(sizeStyles[size])
312
- },
313
- item.icon && item.icon,
314
- item.label && item.label
315
- ), /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => {
316
- const SubitemLinkComponent = subitem.slug ? LinkComponent : "a";
317
- return /* @__PURE__ */ React.createElement(
318
- DropdownMenuItem,
306
+ );
307
+ case "orbit":
308
+ return /* @__PURE__ */ React4.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
309
+ default:
310
+ return /* @__PURE__ */ React4.createElement(
311
+ "svg",
312
+ {
313
+ viewBox: "0 0 40 40",
314
+ height: "40",
315
+ width: "40",
316
+ className: cn(
317
+ "circle-container",
318
+ sizeStyles[size],
319
+ classNames == null ? void 0 : classNames.container
320
+ )
321
+ },
322
+ /* @__PURE__ */ React4.createElement(
323
+ "circle",
324
+ {
325
+ className: cn(
326
+ "circle-track",
319
327
  {
320
- key: subIndex,
321
- LinkComponent: SubitemLinkComponent,
322
- slug: subitem.slug,
323
- disabled: subitem.disabled,
324
- className: cn(
325
- sizeStyles[size],
326
- !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
327
- ),
328
- onMouseDown: (event) => {
329
- if (event.button === 1 || event.button === 0 && event.ctrlKey) {
330
- event.preventDefault();
331
- if (subitem.onMiddleClick) {
332
- subitem.onMiddleClick(item.value);
333
- }
334
- }
335
- },
336
- onSelect: () => {
337
- subitem.action && subitem.action();
338
- if (onItemSelect) {
339
- onItemSelect(subitem.value);
340
- }
341
- }
342
- },
343
- subitem.icon && subitem.icon,
344
- subitem.label && subitem.label
345
- );
346
- })))) : /* @__PURE__ */ React.createElement(
347
- DropdownMenuItem,
348
- {
349
- LinkComponent: ItemLinkComponent,
350
- slug: item.slug,
351
- key: index,
352
- disabled: item.disabled,
353
- onMouseDown: (event) => {
354
- if (event.button === 1 || event.button === 0 && event.ctrlKey) {
355
- event.preventDefault();
356
- if (item.onMiddleClick) {
357
- item.onMiddleClick(item.value);
358
- }
359
- }
360
- },
361
- onClick: (event) => {
362
- if (item.onClick) {
363
- item.onClick(item.value);
364
- }
328
+ "hawa-stroke-primary-foreground": themeMode === "dark",
329
+ "hawa-stroke-primary": themeMode === "light"
365
330
  },
366
- onSelect: (e) => {
367
- if (item.presist) {
368
- e.preventDefault();
369
- }
370
- if (item.action) {
371
- item.action();
372
- if (onItemSelect) {
373
- onItemSelect(item.value);
374
- }
375
- } else {
376
- if (onItemSelect) {
377
- onItemSelect(item.value);
378
- }
379
- }
331
+ classNames == null ? void 0 : classNames.track
332
+ ),
333
+ cx: "20",
334
+ cy: "20",
335
+ r: "17.5",
336
+ fill: "none",
337
+ strokeWidth: "5px",
338
+ pathLength: "100"
339
+ }
340
+ ),
341
+ /* @__PURE__ */ React4.createElement(
342
+ "circle",
343
+ {
344
+ className: cn(
345
+ "circle-car",
346
+ {
347
+ "hawa-stroke-primary-foreground": themeMode === "dark",
348
+ "hawa-stroke-primary": themeMode === "light"
380
349
  },
381
- end: item.end,
382
- shortcut: item.shortcut,
383
- badged: item.badged,
384
- className: cn(
385
- sizeStyles[size],
386
- !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent " : "focus:hawa-bg-accent ",
387
- item.presist && "focus:hawa-bg-transparent",
388
- classNames == null ? void 0 : classNames.item
389
- )
390
- },
391
- item.icon && item.icon,
392
- item.label && item.label
393
- );
394
- }
395
- })
396
- ))
397
- );
398
- };
399
-
400
- // elements/button/Button.tsx
401
- import * as React6 from "react";
402
- import { cva } from "class-variance-authority";
350
+ classNames == null ? void 0 : classNames.car
351
+ ),
352
+ cx: "20",
353
+ cy: "20",
354
+ r: "17.5",
355
+ fill: "none",
356
+ pathLength: "100",
357
+ strokeWidth: "5px"
358
+ }
359
+ )
360
+ );
361
+ }
362
+ };
403
363
 
404
- // elements/helperText/HelperText.tsx
405
- import React2 from "react";
406
- var HelperText = ({ helperText }) => /* @__PURE__ */ React2.createElement(
407
- "p",
364
+ // elements/button/Button.tsx
365
+ var buttonVariants = cva(
366
+ "hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
408
367
  {
409
- className: cn(
410
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
411
- helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
412
- )
413
- },
414
- helperText
368
+ variants: {
369
+ variant: {
370
+ default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
371
+ light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
372
+ destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
373
+ outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
374
+ secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
375
+ ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
376
+ link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
377
+ combobox: "hawa-bg-background hawa-border",
378
+ neoBrutalism: "neo-brutalism"
379
+ // "hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active",
380
+ },
381
+ size: {
382
+ default: "hawa-h-10 hawa-px-4 hawa-py-2",
383
+ heightless: "hawa-px-4 hawa-py-4",
384
+ xs: "hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 ",
385
+ sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
386
+ lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
387
+ xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
388
+ icon: "hawa-h-10 hawa-w-10",
389
+ smallIcon: "hawa-h-7 hawa-w-7"
390
+ }
391
+ },
392
+ defaultVariants: { variant: "default", size: "default" }
393
+ }
415
394
  );
395
+ var Button = React5.forwardRef(
396
+ ({
397
+ className,
398
+ label,
399
+ variant,
400
+ size,
401
+ asChild = false,
402
+ centered = true,
403
+ isLoading,
404
+ children,
405
+ labelProps,
406
+ showHelperText = false,
407
+ asInput = false,
408
+ ...props
409
+ }, ref) => {
410
+ const Comp = "button";
411
+ const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
412
+ if (asInput) {
413
+ return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
414
+ Comp,
415
+ {
416
+ className: cn(
417
+ buttonVariants({ variant, size, className }),
418
+ centered && "hawa-justify-center"
419
+ ),
420
+ ref,
421
+ ...props
422
+ },
423
+ isLoading ? /* @__PURE__ */ React5.createElement(
424
+ Loading,
425
+ {
426
+ design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
427
+ themeMode: variant === "outline" ? "light" : "dark",
428
+ color: loadingColor,
429
+ size: size === "sm" || size === "xs" ? "xs" : "button"
430
+ }
431
+ ) : children
432
+ ), showHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
433
+ } else {
434
+ return /* @__PURE__ */ React5.createElement(
435
+ Comp,
436
+ {
437
+ className: cn(
438
+ buttonVariants({ variant, size, className }),
439
+ centered && "hawa-justify-center"
440
+ ),
441
+ ref,
442
+ ...props
443
+ },
444
+ isLoading ? /* @__PURE__ */ React5.createElement(
445
+ Loading,
446
+ {
447
+ design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
448
+ themeMode: variant === "outline" ? "light" : "dark",
449
+ color: loadingColor,
450
+ size: size === "sm" || size === "xs" ? "xs" : "button"
451
+ }
452
+ ) : children
453
+ );
454
+ }
455
+ }
456
+ );
457
+ Button.displayName = "Button";
416
458
 
417
- // elements/label/Label.tsx
418
- import * as React4 from "react";
419
-
420
- // elements/tooltip/Tooltip.tsx
421
- import React3 from "react";
422
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
423
- var TooltipContent = React3.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React3.createElement(
424
- TooltipPrimitive.Content,
459
+ // elements/dropdownMenu/DropdownMenu.tsx
460
+ import * as React6 from "react";
461
+ import { Portal } from "@headlessui/react";
462
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
463
+ var DropdownMenuRoot = DropdownMenuPrimitive.Root;
464
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
465
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
466
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
467
+ var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
468
+ DropdownMenuPrimitive.SubTrigger,
425
469
  {
426
470
  ref,
427
- sideOffset,
428
471
  className: cn(
429
- "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",
472
+ "hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent",
473
+ inset && "hawa-pl-8",
474
+ className
475
+ ),
476
+ ...props
477
+ },
478
+ /* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
479
+ " ",
480
+ /* @__PURE__ */ React6.createElement(
481
+ "svg",
482
+ {
483
+ "aria-label": "Chevron Right Icon",
484
+ stroke: "currentColor",
485
+ fill: "currentColor",
486
+ strokeWidth: "0",
487
+ viewBox: "0 0 16 16",
488
+ height: "1em",
489
+ width: "1em",
490
+ className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
491
+ },
492
+ /* @__PURE__ */ React6.createElement(
493
+ "path",
430
494
  {
431
- "hawa-text-xs": size === "small",
432
- "hawa-text-xl": size === "large"
433
- },
495
+ fillRule: "evenodd",
496
+ d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
497
+ }
498
+ )
499
+ )
500
+ ));
501
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
502
+ var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
503
+ DropdownMenuPrimitive.SubContent,
504
+ {
505
+ ref,
506
+ className: cn(
507
+ "hawa-z-50 hawa-min-w-[8rem] hawa-gap-1 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
434
508
  className
435
509
  ),
436
510
  ...props
437
511
  }
438
512
  ));
439
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
440
- var TooltipArrow = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
441
- TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
442
- var Tooltip = ({
443
- side,
444
- size,
445
- open,
446
- content,
447
- children,
448
- disabled,
449
- defaultOpen,
450
- onOpenChange,
451
- triggerProps,
452
- contentProps,
453
- providerProps,
454
- delayDuration = 300,
455
- ...props
456
- }) => {
457
- return /* @__PURE__ */ React3.createElement(
458
- TooltipPrimitive.TooltipProvider,
513
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
514
+ var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(
515
+ DropdownMenuPrimitive.Content,
516
+ {
517
+ ref,
518
+ sideOffset,
519
+ className: cn(
520
+ "hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
521
+ className
522
+ ),
523
+ ...props
524
+ }
525
+ )));
526
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
527
+ var DropdownMenuItem = React6.forwardRef(({ className, inset, badged, slug, LinkComponent = "a", ...props }, ref) => {
528
+ return /* @__PURE__ */ React6.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React6.createElement(
529
+ DropdownMenuPrimitive.Item,
459
530
  {
460
- delayDuration,
461
- ...providerProps
531
+ disabled: props.disabled,
532
+ ref,
533
+ className: cn(
534
+ "hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
535
+ inset && "hawa-pl-8",
536
+ props.end && Array.isArray(props.children) && props.children[1] && "hawa-gap-6",
537
+ className
538
+ ),
539
+ ...props
462
540
  },
463
- /* @__PURE__ */ React3.createElement(
464
- TooltipPrimitive.Root,
465
- {
466
- open: !disabled && open,
467
- defaultOpen,
468
- onOpenChange,
469
- ...props
470
- },
471
- /* @__PURE__ */ React3.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
472
- /* @__PURE__ */ React3.createElement(
473
- TooltipContent,
474
- {
475
- size,
476
- side,
477
- align: "center",
478
- ...contentProps,
479
- style: {
480
- ...contentProps == null ? void 0 : contentProps.style,
481
- maxWidth: "var(--radix-tooltip-content-available-width)",
482
- maxHeight: "var(--radix-tooltip-content-available-height)"
483
- }
484
- },
485
- content
486
- )
487
- )
488
- );
489
- };
490
-
491
- // elements/label/Label.tsx
492
- var Label2 = React4.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React4.createElement(
493
- "label",
541
+ /* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, props.children),
542
+ props.end && props.end,
543
+ !props.end && props.shortcut && /* @__PURE__ */ React6.createElement(DropdownMenuShortcut, null, props.shortcut),
544
+ !props.end && badged && /* @__PURE__ */ React6.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
545
+ ));
546
+ });
547
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
548
+ var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React6.createElement(
549
+ DropdownMenuPrimitive.CheckboxItem,
494
550
  {
495
551
  ref,
496
552
  className: cn(
497
- "hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
553
+ "hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
498
554
  className
499
555
  ),
556
+ checked,
500
557
  ...props
501
558
  },
502
- children,
503
- required && /* @__PURE__ */ React4.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
504
- ), hint && /* @__PURE__ */ React4.createElement(
505
- Tooltip,
559
+ /* @__PURE__ */ React6.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React6.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React6.createElement(
560
+ "svg",
561
+ {
562
+ "aria-label": "Check Mark",
563
+ stroke: "currentColor",
564
+ fill: "currentColor",
565
+ strokeWidth: "0",
566
+ viewBox: "0 0 512 512",
567
+ height: "0.60em",
568
+ width: "0.60em"
569
+ },
570
+ /* @__PURE__ */ React6.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
571
+ ), " ")),
572
+ children
573
+ ));
574
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
575
+ var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
576
+ DropdownMenuPrimitive.RadioItem,
506
577
  {
507
- content: hint,
508
- side: hintSide,
509
- triggerProps: {
510
- tabIndex: -1,
511
- onClick: (event) => event.preventDefault()
512
- }
578
+ ref,
579
+ className: cn(
580
+ "hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
581
+ className
582
+ ),
583
+ ...props
513
584
  },
514
- /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(
585
+ /* @__PURE__ */ React6.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React6.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React6.createElement(
515
586
  "svg",
516
587
  {
517
588
  xmlns: "http://www.w3.org/2000/svg",
518
- className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
589
+ width: "24",
590
+ "aria-label": "Circle",
591
+ height: "24",
519
592
  viewBox: "0 0 24 24",
520
593
  fill: "none",
521
594
  stroke: "currentColor",
522
595
  strokeWidth: "2",
523
596
  strokeLinecap: "round",
524
- strokeLinejoin: "round"
597
+ strokeLinejoin: "round",
598
+ className: "hawa-h-2 hawa-w-2 hawa-fill-current"
525
599
  },
526
- /* @__PURE__ */ React4.createElement("circle", { cx: "12", cy: "12", r: "10" }),
527
- /* @__PURE__ */ React4.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
528
- /* @__PURE__ */ React4.createElement("path", { d: "M12 17h.01" })
529
- ))
530
- )));
531
- Label2.displayName = "Label";
532
-
533
- // elements/loading/Loading.tsx
534
- import React5 from "react";
535
- var Loading = ({
536
- design = "spinner",
537
- size = "normal",
538
- themeMode = "light",
539
- classNames,
540
- color,
600
+ /* @__PURE__ */ React6.createElement("circle", { cx: "12", cy: "12", r: "10" })
601
+ ))),
602
+ children
603
+ ));
604
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
605
+ var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React6.createElement(
606
+ DropdownMenuPrimitive.Label,
607
+ {
608
+ ref,
609
+ className: cn(
610
+ "hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
611
+ inset && "hawa-pl-8",
612
+ className
613
+ ),
614
+ ...props
615
+ }
616
+ ));
617
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
618
+ var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
619
+ DropdownMenuPrimitive.Separator,
620
+ {
621
+ ref,
622
+ className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
623
+ ...props
624
+ }
625
+ ));
626
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
627
+ var DropdownMenuShortcut = ({
628
+ className,
541
629
  ...props
542
630
  }) => {
543
- let sizeStyles = {
544
- button: "hawa-h-4 hawa-w-4",
545
- xs: "hawa-h-1 hawa-w-1",
546
- sm: "hawa-h-6 hawa-w-6",
547
- normal: "hawa-h-8 hawa-w-8",
548
- lg: "hawa-h-14 hawa-w-14",
549
- xl: "hawa-h-24 hawa-w-24"
550
- };
551
- let progressSizes = {
552
- button: "hawa-h-1",
553
- xs: "hawa-h-1 hawa-w-1",
554
- sm: "hawa-h-6 hawa-w-6",
555
- normal: "",
556
- lg: "hawa-h-6",
557
- xl: "hawa-h-10 hawa-w-64"
631
+ return /* @__PURE__ */ React6.createElement(
632
+ "span",
633
+ {
634
+ className: cn(
635
+ "hawa-text-xs hawa-tracking-widest hawa-opacity-60",
636
+ className
637
+ ),
638
+ ...props
639
+ }
640
+ );
641
+ };
642
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
643
+ var DropdownMenu = ({
644
+ trigger,
645
+ items,
646
+ direction,
647
+ sideOffset,
648
+ side,
649
+ className,
650
+ classNames,
651
+ triggerClassname,
652
+ triggerProps,
653
+ align,
654
+ alignOffset,
655
+ onItemSelect,
656
+ size = "default",
657
+ width = "default",
658
+ header,
659
+ onOpenChange,
660
+ open,
661
+ LinkComponent
662
+ }) => {
663
+ const widthStyles = {
664
+ default: "hawa-min-w-[8rem]",
665
+ sm: "hawa-w-fit",
666
+ lg: "hawa-w-[200px]",
667
+ parent: "ddm-w-parent"
558
668
  };
559
- let animationStyles = {
560
- pulse: "hawa-animate-in hawa-fade-in hawa-duration-1000",
561
- bounce: "hawa-animate-bounce"
669
+ const sizeStyles = {
670
+ default: "hawa-px-2 hawa-py-3 ",
671
+ sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
562
672
  };
563
- switch (design.split("-")[0]) {
564
- case "dots":
565
- return /* @__PURE__ */ React5.createElement(
566
- "div",
567
- {
568
- className: cn(
569
- "hawa-flex hawa-flex-row hawa-gap-2",
570
- classNames == null ? void 0 : classNames.container
571
- )
572
- },
573
- /* @__PURE__ */ React5.createElement(
574
- "div",
575
- {
576
- className: cn(
577
- "hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
578
- size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
579
- animationStyles[design.split("-")[1]],
580
- color ? color : "hawa-bg-primary"
581
- )
582
- }
583
- ),
584
- /* @__PURE__ */ React5.createElement(
585
- "div",
586
- {
587
- className: cn(
588
- "hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
589
- size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
590
- animationStyles[design.split("-")[1]],
591
- color ? color : "hawa-bg-primary"
592
- )
593
- }
594
- ),
595
- /* @__PURE__ */ React5.createElement(
596
- "div",
597
- {
598
- className: cn(
599
- "hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
600
- size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
601
- animationStyles[design.split("-")[1]],
602
- color ? color : "hawa-bg-primary"
603
- )
604
- }
605
- )
606
- );
607
- case "square":
608
- return /* @__PURE__ */ React5.createElement(
609
- "svg",
610
- {
611
- className: cn(
612
- "squircle-container",
613
- sizeStyles[size],
614
- classNames == null ? void 0 : classNames.container
615
- ),
616
- viewBox: "0 0 35 35",
617
- height: "35",
618
- width: "35"
619
- },
620
- /* @__PURE__ */ React5.createElement(
621
- "rect",
622
- {
623
- className: "squircle-track",
624
- x: "2.5",
625
- y: "2.5",
626
- fill: "none",
627
- strokeWidth: "5px",
628
- width: "32.5",
629
- height: "32.5"
630
- }
631
- ),
632
- /* @__PURE__ */ React5.createElement(
633
- "rect",
634
- {
635
- className: "square-car",
636
- x: "2.5",
637
- y: "2.5",
638
- fill: "none",
639
- strokeWidth: "5px",
640
- width: "32.5",
641
- height: "32.5",
642
- pathLength: "100"
643
- }
644
- )
645
- );
646
- case "squircle":
647
- return /* @__PURE__ */ React5.createElement(
648
- "svg",
649
- {
650
- x: "0px",
651
- y: "0px",
652
- viewBox: "0 0 37 37",
653
- height: "37",
654
- width: "37",
655
- preserveAspectRatio: "xMidYMid meet",
656
- className: cn(
657
- "squircle-container",
658
- sizeStyles[size],
659
- classNames == null ? void 0 : classNames.container
660
- )
661
- },
662
- /* @__PURE__ */ React5.createElement(
663
- "path",
664
- {
665
- className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
666
- fill: "none",
667
- strokeWidth: "5",
668
- pathLength: "100",
669
- d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
670
- }
671
- ),
672
- /* @__PURE__ */ React5.createElement(
673
- "path",
674
- {
675
- className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
676
- fill: "none",
677
- strokeWidth: "5",
678
- pathLength: "100",
679
- d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
680
- }
681
- )
682
- );
683
- case "progress":
684
- return /* @__PURE__ */ React5.createElement(
685
- "div",
686
- {
687
- className: cn(
688
- "progress-loading after:hawa-rounded hawa-rounded",
689
- progressSizes[size],
690
- classNames == null ? void 0 : classNames.container
691
- )
692
- }
693
- );
694
- case "orbit":
695
- return /* @__PURE__ */ React5.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
696
- default:
697
- return /* @__PURE__ */ React5.createElement(
698
- "svg",
699
- {
700
- viewBox: "0 0 40 40",
701
- height: "40",
702
- width: "40",
703
- className: cn(
704
- "circle-container",
705
- sizeStyles[size],
706
- classNames == null ? void 0 : classNames.container
707
- )
708
- },
709
- /* @__PURE__ */ React5.createElement(
710
- "circle",
711
- {
712
- className: cn(
713
- "circle-track",
714
- {
715
- "hawa-stroke-primary-foreground": themeMode === "dark",
716
- "hawa-stroke-primary": themeMode === "light"
717
- },
718
- classNames == null ? void 0 : classNames.track
719
- ),
720
- cx: "20",
721
- cy: "20",
722
- r: "17.5",
723
- fill: "none",
724
- strokeWidth: "5px",
725
- pathLength: "100"
726
- }
673
+ let [values, setValues] = React6.useState(
674
+ items.map((item) => item.currentOption)
675
+ );
676
+ return /* @__PURE__ */ React6.createElement(
677
+ DropdownMenuRoot,
678
+ {
679
+ onOpenChange,
680
+ open,
681
+ modal: false,
682
+ dir: direction
683
+ },
684
+ /* @__PURE__ */ React6.createElement(
685
+ DropdownMenuTrigger,
686
+ {
687
+ asChild: true,
688
+ className: cn(classNames == null ? void 0 : classNames.trigger, triggerClassname),
689
+ ...triggerProps
690
+ },
691
+ trigger
692
+ ),
693
+ /* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(
694
+ DropdownMenuContent,
695
+ {
696
+ side,
697
+ sideOffset,
698
+ align,
699
+ alignOffset,
700
+ className: cn(
701
+ className,
702
+ classNames == null ? void 0 : classNames.content,
703
+ widthStyles[width],
704
+ "hawa-flex hawa-flex-col hawa-gap-1 hawa-overflow-y-auto"
727
705
  ),
728
- /* @__PURE__ */ React5.createElement(
729
- "circle",
730
- {
731
- className: cn(
732
- "circle-car",
706
+ style: {
707
+ maxHeight: "var(--radix-dropdown-menu-content-available-height)"
708
+ }
709
+ },
710
+ header && header,
711
+ items && items.map((item, index) => {
712
+ var _a;
713
+ const ItemLinkComponent = item.slug ? LinkComponent : "a";
714
+ if (item.itemType === "separator") {
715
+ return /* @__PURE__ */ React6.createElement(
716
+ DropdownMenuSeparator,
717
+ {
718
+ key: index,
719
+ className: classNames == null ? void 0 : classNames.separator
720
+ }
721
+ );
722
+ } else if (item.itemType === "label") {
723
+ return /* @__PURE__ */ React6.createElement(DropdownMenuLabel, { key: index }, item.label);
724
+ } else if (item.itemType === "radio") {
725
+ let dd = item.currentOption;
726
+ return /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
727
+ DropdownMenuSubTrigger,
728
+ {
729
+ dir: direction,
730
+ className: cn(sizeStyles[size])
731
+ },
732
+ item.icon && item.icon,
733
+ item.label && item.label
734
+ ), /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React6.createElement(
735
+ DropdownMenuRadioGroup,
736
+ {
737
+ value: values[index],
738
+ onValueChange: (e) => {
739
+ let newValues = [...values];
740
+ newValues[index] = e;
741
+ setValues(newValues);
742
+ console.log("changing to ", e);
743
+ if (item.onOptionChange) {
744
+ item.onOptionChange(e);
745
+ }
746
+ }
747
+ },
748
+ (_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React6.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
749
+ )));
750
+ } else if (item.itemType === "custom") {
751
+ return /* @__PURE__ */ React6.createElement("div", { key: index }, item.content);
752
+ } else {
753
+ return item.subitems ? /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
754
+ DropdownMenuSubTrigger,
755
+ {
756
+ dir: direction,
757
+ className: cn(sizeStyles[size])
758
+ },
759
+ item.icon && item.icon,
760
+ item.label && item.label
761
+ ), /* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => {
762
+ const SubitemLinkComponent = subitem.slug ? LinkComponent : "a";
763
+ return /* @__PURE__ */ React6.createElement(
764
+ DropdownMenuItem,
733
765
  {
734
- "hawa-stroke-primary-foreground": themeMode === "dark",
735
- "hawa-stroke-primary": themeMode === "light"
766
+ key: subIndex,
767
+ LinkComponent: SubitemLinkComponent,
768
+ slug: subitem.slug,
769
+ disabled: subitem.disabled,
770
+ className: cn(
771
+ sizeStyles[size],
772
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
773
+ ),
774
+ onMouseDown: (event) => {
775
+ if (event.button === 1 || event.button === 0 && event.ctrlKey) {
776
+ event.preventDefault();
777
+ if (subitem.onMiddleClick) {
778
+ subitem.onMiddleClick(item.value);
779
+ }
780
+ }
781
+ },
782
+ onSelect: () => {
783
+ subitem.action && subitem.action();
784
+ if (onItemSelect) {
785
+ onItemSelect(subitem.value);
786
+ }
787
+ }
736
788
  },
737
- classNames == null ? void 0 : classNames.car
738
- ),
739
- cx: "20",
740
- cy: "20",
741
- r: "17.5",
742
- fill: "none",
743
- pathLength: "100",
744
- strokeWidth: "5px"
745
- }
746
- )
747
- );
748
- }
789
+ subitem.icon && subitem.icon,
790
+ subitem.label && subitem.label
791
+ );
792
+ })))) : /* @__PURE__ */ React6.createElement(
793
+ DropdownMenuItem,
794
+ {
795
+ LinkComponent: ItemLinkComponent,
796
+ slug: item.slug,
797
+ key: index,
798
+ disabled: item.disabled,
799
+ onMouseDown: (event) => {
800
+ if (event.button === 1 || event.button === 0 && event.ctrlKey) {
801
+ event.preventDefault();
802
+ if (item.onMiddleClick) {
803
+ item.onMiddleClick(item.value);
804
+ }
805
+ }
806
+ },
807
+ onClick: (event) => {
808
+ if (item.onClick) {
809
+ item.onClick(item.value);
810
+ }
811
+ },
812
+ onSelect: (e) => {
813
+ if (item.presist) {
814
+ e.preventDefault();
815
+ }
816
+ if (item.action) {
817
+ item.action();
818
+ if (onItemSelect) {
819
+ onItemSelect(item.value);
820
+ }
821
+ } else {
822
+ if (onItemSelect) {
823
+ onItemSelect(item.value);
824
+ }
825
+ }
826
+ },
827
+ end: item.end,
828
+ shortcut: item.shortcut,
829
+ badged: item.badged,
830
+ className: cn(
831
+ sizeStyles[size],
832
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent",
833
+ item.presist && "focus:hawa-bg-transparent",
834
+ classNames == null ? void 0 : classNames.item
835
+ )
836
+ },
837
+ item.icon && item.icon,
838
+ item.label && item.label
839
+ );
840
+ }
841
+ })
842
+ ))
843
+ );
749
844
  };
750
845
 
751
- // elements/button/Button.tsx
752
- var buttonVariants = cva(
753
- "hawa-inline-flex hawa-items-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
754
- {
755
- variants: {
756
- variant: {
757
- default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
758
- light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
759
- destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
760
- outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
761
- secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
762
- ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
763
- link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
764
- combobox: "hawa-bg-background hawa-border",
765
- neoBrutalism: "neo-brutalism"
766
- // "hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active shadow-color-primary active:shadow-color-primary-active",
767
- },
768
- size: {
769
- default: "hawa-h-10 hawa-px-4 hawa-py-2",
770
- heightless: "hawa-px-4 hawa-py-4",
771
- xs: "hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 ",
772
- sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
773
- lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
774
- xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
775
- icon: "hawa-h-10 hawa-w-10",
776
- smallIcon: "hawa-h-7 hawa-w-7"
777
- }
778
- },
779
- defaultVariants: { variant: "default", size: "default" }
780
- }
781
- );
782
- var Button = React6.forwardRef(
783
- ({
784
- className,
785
- label,
786
- variant,
787
- size,
788
- asChild = false,
789
- centered = true,
790
- isLoading,
791
- children,
792
- labelProps,
793
- showHelperText = false,
794
- asInput = false,
795
- ...props
796
- }, ref) => {
797
- const Comp = "button";
798
- const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
799
- if (asInput) {
800
- return /* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React6.createElement(Label2, { ...labelProps }, label), /* @__PURE__ */ React6.createElement(
801
- Comp,
802
- {
803
- className: cn(
804
- buttonVariants({ variant, size, className }),
805
- centered && "hawa-justify-center"
806
- ),
807
- ref,
808
- ...props
809
- },
810
- isLoading ? /* @__PURE__ */ React6.createElement(
811
- Loading,
812
- {
813
- design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
814
- themeMode: variant === "outline" ? "light" : "dark",
815
- color: loadingColor,
816
- size: size === "sm" || size === "xs" ? "xs" : "button"
817
- }
818
- ) : children
819
- ), showHelperText && /* @__PURE__ */ React6.createElement(HelperText, { helperText: props.helperText }));
820
- } else {
821
- return /* @__PURE__ */ React6.createElement(
822
- Comp,
823
- {
824
- className: cn(
825
- buttonVariants({ variant, size, className }),
826
- centered && "hawa-justify-center"
827
- ),
828
- ref,
829
- ...props
830
- },
831
- isLoading ? /* @__PURE__ */ React6.createElement(
832
- Loading,
833
- {
834
- design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
835
- themeMode: variant === "outline" ? "light" : "dark",
836
- color: loadingColor,
837
- size: size === "sm" || size === "xs" ? "xs" : "button"
838
- }
839
- ) : children
840
- );
841
- }
842
- }
843
- );
844
- Button.displayName = "Button";
845
-
846
846
  // elements/splitButton/SplitButton.tsx
847
847
  var SplitButton = ({
848
848
  variant,