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