@sikka/hawa 0.39.0-next → 0.40.0-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/{DropdownMenu-B3cTLPDi.d.mts → DropdownMenu-FVVDS2rX.d.mts} +6 -1
  2. package/dist/{DropdownMenu-BO1TNMm5.d.ts → DropdownMenu-SFJtRGAw.d.ts} +6 -1
  3. package/dist/{Radio-lgoClQrv.d.ts → Radio-DlPwVCG4.d.ts} +6 -0
  4. package/dist/{Radio-uQ7DtzcI.d.mts → Radio-Dyvlywnk.d.mts} +6 -0
  5. package/dist/alert/index.js +2 -2
  6. package/dist/alert/index.js.map +1 -1
  7. package/dist/alert/index.mjs +2 -2
  8. package/dist/alert/index.mjs.map +1 -1
  9. package/dist/appLayout/index.d.mts +2 -0
  10. package/dist/appLayout/index.d.ts +2 -0
  11. package/dist/appLayout/index.js +14 -3
  12. package/dist/appLayout/index.js.map +1 -1
  13. package/dist/appLayout/index.mjs +14 -3
  14. package/dist/appLayout/index.mjs.map +1 -1
  15. package/dist/appTopbar/index.js.map +1 -1
  16. package/dist/appTopbar/index.mjs.map +1 -1
  17. package/dist/backToTop/index.js +2 -2
  18. package/dist/backToTop/index.js.map +1 -1
  19. package/dist/backToTop/index.mjs +2 -2
  20. package/dist/backToTop/index.mjs.map +1 -1
  21. package/dist/blocks/auth/index.js +2 -2
  22. package/dist/blocks/auth/index.mjs +4 -4
  23. package/dist/blocks/feedback/index.js +162 -119
  24. package/dist/blocks/feedback/index.mjs +5 -5
  25. package/dist/blocks/index.d.mts +2 -2
  26. package/dist/blocks/index.d.ts +2 -2
  27. package/dist/blocks/index.js +442 -450
  28. package/dist/blocks/index.mjs +3 -3
  29. package/dist/blocks/misc/index.js +238 -289
  30. package/dist/blocks/misc/index.mjs +147 -200
  31. package/dist/blocks/pricing/index.js +162 -119
  32. package/dist/blocks/pricing/index.mjs +4 -4
  33. package/dist/button/index.d.mts +1 -1
  34. package/dist/button/index.d.ts +1 -1
  35. package/dist/button/index.js +2 -2
  36. package/dist/button/index.js.map +1 -1
  37. package/dist/button/index.mjs +2 -2
  38. package/dist/button/index.mjs.map +1 -1
  39. package/dist/calendar/index.js +2 -2
  40. package/dist/calendar/index.js.map +1 -1
  41. package/dist/calendar/index.mjs +2 -2
  42. package/dist/calendar/index.mjs.map +1 -1
  43. package/dist/{chunk-C2IX3SUD.mjs → chunk-27G5FKOP.mjs} +1 -1
  44. package/dist/{chunk-IC5WYNKN.mjs → chunk-AJTYKC5R.mjs} +1 -1
  45. package/dist/{chunk-UMOBOCED.mjs → chunk-CTNKKP2O.mjs} +2 -2
  46. package/dist/chunk-CTZRVSTI.mjs +346 -0
  47. package/dist/{chunk-XFSBC5VI.mjs → chunk-DYPGZ2IP.mjs} +1 -1
  48. package/dist/{chunk-UJ5SXC3M.mjs → chunk-GN7EIDTE.mjs} +1 -1
  49. package/dist/{chunk-VMVZM3QQ.mjs → chunk-GU2DOJ7Q.mjs} +31 -8
  50. package/dist/{chunk-RTK6REIK.mjs → chunk-QZIENYTE.mjs} +1 -1
  51. package/dist/{chunk-EZBHA2IL.mjs → chunk-RT2Q3SH7.mjs} +1 -1
  52. package/dist/{chunk-W3CF7BSC.mjs → chunk-UBUVHGW4.mjs} +238 -248
  53. package/dist/{chunk-ZBUBNKF6.mjs → chunk-XCW5YNMS.mjs} +34 -1
  54. package/dist/codeBlock/index.js +2 -2
  55. package/dist/codeBlock/index.js.map +1 -1
  56. package/dist/codeBlock/index.mjs +2 -2
  57. package/dist/codeBlock/index.mjs.map +1 -1
  58. package/dist/combobox/index.js +1 -1
  59. package/dist/combobox/index.js.map +1 -1
  60. package/dist/combobox/index.mjs +1 -1
  61. package/dist/combobox/index.mjs.map +1 -1
  62. package/dist/command/index.js +1 -1
  63. package/dist/command/index.js.map +1 -1
  64. package/dist/command/index.mjs +1 -1
  65. package/dist/command/index.mjs.map +1 -1
  66. package/dist/commonTypes-189mW5eB.d.mts +8 -0
  67. package/dist/commonTypes-189mW5eB.d.ts +8 -0
  68. package/dist/commonTypes-DUY2LJm1.d.mts +3 -0
  69. package/dist/commonTypes-DUY2LJm1.d.ts +3 -0
  70. package/dist/commonTypes-D_7LV7Ri.d.mts +5 -0
  71. package/dist/commonTypes-D_7LV7Ri.d.ts +5 -0
  72. package/dist/dataTable/index.js +2 -2
  73. package/dist/dataTable/index.js.map +1 -1
  74. package/dist/dataTable/index.mjs +2 -2
  75. package/dist/dataTable/index.mjs.map +1 -1
  76. package/dist/datePicker/index.d.mts +1 -1
  77. package/dist/datePicker/index.d.ts +1 -1
  78. package/dist/datePicker/index.js +3 -3
  79. package/dist/datePicker/index.js.map +1 -1
  80. package/dist/datePicker/index.mjs +3 -3
  81. package/dist/datePicker/index.mjs.map +1 -1
  82. package/dist/dialog/index.js +1 -1
  83. package/dist/dialog/index.js.map +1 -1
  84. package/dist/dialog/index.mjs +1 -1
  85. package/dist/dialog/index.mjs.map +1 -1
  86. package/dist/docsLayout/index.js +2 -2
  87. package/dist/docsLayout/index.js.map +1 -1
  88. package/dist/docsLayout/index.mjs +2 -2
  89. package/dist/docsLayout/index.mjs.map +1 -1
  90. package/dist/dropdownMenu/index.d.mts +6 -1
  91. package/dist/dropdownMenu/index.d.ts +6 -1
  92. package/dist/dropdownMenu/index.js +29 -6
  93. package/dist/dropdownMenu/index.js.map +1 -1
  94. package/dist/dropdownMenu/index.mjs +29 -6
  95. package/dist/dropdownMenu/index.mjs.map +1 -1
  96. package/dist/elements/index.d.mts +7 -5
  97. package/dist/elements/index.d.ts +7 -5
  98. package/dist/elements/index.js +546 -531
  99. package/dist/elements/index.mjs +5 -5
  100. package/dist/fileDropzone/index.d.mts +2 -2
  101. package/dist/fileDropzone/index.d.ts +2 -2
  102. package/dist/fileDropzone/index.js +2 -2
  103. package/dist/fileDropzone/index.js.map +1 -1
  104. package/dist/fileDropzone/index.mjs +2 -2
  105. package/dist/fileDropzone/index.mjs.map +1 -1
  106. package/dist/fileUploader/index.d.mts +2 -2
  107. package/dist/fileUploader/index.d.ts +2 -2
  108. package/dist/glow/index.d.mts +3 -3
  109. package/dist/glow/index.d.ts +3 -3
  110. package/dist/hooks/index.d.mts +8 -1
  111. package/dist/hooks/index.d.ts +8 -1
  112. package/dist/hooks/index.js +35 -0
  113. package/dist/hooks/index.mjs +5 -1
  114. package/dist/index.css +0 -91
  115. package/dist/index.d.mts +26 -4
  116. package/dist/index.d.ts +26 -4
  117. package/dist/index.js +1020 -959
  118. package/dist/index.mjs +971 -912
  119. package/dist/input/index.d.mts +2 -9
  120. package/dist/input/index.d.ts +2 -9
  121. package/dist/interfaceSettings/index.js +160 -117
  122. package/dist/interfaceSettings/index.js.map +1 -1
  123. package/dist/interfaceSettings/index.mjs +160 -117
  124. package/dist/interfaceSettings/index.mjs.map +1 -1
  125. package/dist/label/index.d.mts +1 -2
  126. package/dist/label/index.d.ts +1 -2
  127. package/dist/layout/index.d.mts +3 -1
  128. package/dist/layout/index.d.ts +3 -1
  129. package/dist/layout/index.js +14 -3
  130. package/dist/layout/index.mjs +14 -3
  131. package/dist/navigationMenu/index.d.mts +2 -1
  132. package/dist/navigationMenu/index.d.ts +2 -1
  133. package/dist/pagination/index.d.mts +1 -1
  134. package/dist/pagination/index.d.ts +1 -1
  135. package/dist/phoneInput/index.d.mts +1 -1
  136. package/dist/phoneInput/index.d.ts +1 -1
  137. package/dist/progress/index.d.mts +8 -1
  138. package/dist/progress/index.d.ts +8 -1
  139. package/dist/radio/index.d.mts +15 -1
  140. package/dist/radio/index.d.ts +15 -1
  141. package/dist/radio/index.js +160 -117
  142. package/dist/radio/index.js.map +1 -1
  143. package/dist/radio/index.mjs +160 -117
  144. package/dist/radio/index.mjs.map +1 -1
  145. package/dist/scrollArea/index.d.mts +1 -1
  146. package/dist/scrollArea/index.d.ts +1 -1
  147. package/dist/separator/index.d.mts +1 -1
  148. package/dist/separator/index.d.ts +1 -1
  149. package/dist/signature/index.d.mts +1 -2
  150. package/dist/signature/index.d.ts +1 -2
  151. package/dist/simpleTable/index.d.mts +1 -1
  152. package/dist/simpleTable/index.d.ts +1 -1
  153. package/dist/sonner/index.d.mts +1 -1
  154. package/dist/sonner/index.d.ts +1 -1
  155. package/dist/sortButton/index.js +2 -2
  156. package/dist/sortButton/index.js.map +1 -1
  157. package/dist/sortButton/index.mjs +2 -2
  158. package/dist/sortButton/index.mjs.map +1 -1
  159. package/dist/splitButton/index.d.mts +3 -9
  160. package/dist/splitButton/index.d.ts +3 -9
  161. package/dist/splitButton/index.js +2 -2
  162. package/dist/splitButton/index.js.map +1 -1
  163. package/dist/splitButton/index.mjs +2 -2
  164. package/dist/splitButton/index.mjs.map +1 -1
  165. package/dist/switch/index.d.mts +1 -1
  166. package/dist/switch/index.d.ts +1 -1
  167. package/dist/tabs/index.d.mts +4 -2
  168. package/dist/tabs/index.d.ts +4 -2
  169. package/dist/tabs/index.js +123 -174
  170. package/dist/tabs/index.js.map +1 -1
  171. package/dist/tabs/index.mjs +118 -169
  172. package/dist/tabs/index.mjs.map +1 -1
  173. package/dist/textarea/index.d.mts +1 -1
  174. package/dist/textarea/index.d.ts +1 -1
  175. package/dist/toast/index.d.mts +1 -1
  176. package/dist/toast/index.d.ts +1 -1
  177. package/dist/toaster/index.d.mts +4 -22
  178. package/dist/toaster/index.d.ts +4 -22
  179. package/dist/tooltip/index.d.mts +4 -3
  180. package/dist/tooltip/index.d.ts +4 -3
  181. package/package.json +1 -1
  182. package/dist/Label-UbMDLtJF.d.mts +0 -14
  183. package/dist/Label-UbMDLtJF.d.ts +0 -14
  184. package/dist/chunk-WDCKXU54.mjs +0 -303
  185. package/dist/commonTypes-CgDwjGvU.d.mts +0 -5
  186. package/dist/commonTypes-CgDwjGvU.d.ts +0 -5
  187. package/dist/commonTypes-DZdITB5m.d.mts +0 -4
  188. package/dist/commonTypes-DZdITB5m.d.ts +0 -4
  189. package/dist/floatBox/index.d.mts +0 -15
  190. package/dist/floatBox/index.d.ts +0 -15
  191. package/dist/floatBox/index.js +0 -105
  192. package/dist/floatBox/index.js.map +0 -1
  193. package/dist/floatBox/index.mjs +0 -69
  194. package/dist/floatBox/index.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  // elements/tabs/Tabs.tsx
4
- import * as React12 from "react";
4
+ import * as React11 from "react";
5
5
 
6
6
  // hooks/useIsomorphicEffect.ts
7
7
  import { useEffect, useLayoutEffect } from "react";
@@ -52,37 +52,6 @@ import { useEffect as useEffect12, useState as useState14 } from "react";
52
52
 
53
53
  // hooks/useMeasureDirty.ts
54
54
  import { useEffect as useEffect13, useRef as useRef7, useState as useState15 } from "react";
55
- var useMeasureDirty = (ref) => {
56
- const frame = useRef7(0);
57
- const [rect, set] = useState15({
58
- width: 0,
59
- height: 0,
60
- top: 0,
61
- left: 0,
62
- bottom: 0,
63
- right: 0
64
- });
65
- const [observer] = useState15(
66
- () => new ResizeObserver((entries) => {
67
- const entry = entries[0];
68
- if (entry) {
69
- cancelAnimationFrame(frame.current);
70
- frame.current = requestAnimationFrame(() => {
71
- if (ref.current) {
72
- set(entry.contentRect);
73
- }
74
- });
75
- }
76
- })
77
- );
78
- useEffect13(() => {
79
- observer.disconnect();
80
- if (ref.current) {
81
- observer.observe(ref.current);
82
- }
83
- }, [ref]);
84
- return rect;
85
- };
86
55
 
87
56
  // hooks/useClickOutside.ts
88
57
  import { useEffect as useEffect14, useRef as useRef8 } from "react";
@@ -90,7 +59,39 @@ import { useEffect as useEffect14, useRef as useRef8 } from "react";
90
59
  // hooks/useShortcuts.ts
91
60
  import { useEffect as useEffect15 } from "react";
92
61
 
62
+ // hooks/useWindowEvent.ts
63
+ import { useEffect as useEffect16 } from "react";
64
+ function useWindowEvent(type, listener, options) {
65
+ useEffect16(() => {
66
+ window.addEventListener(type, listener, options);
67
+ return () => window.removeEventListener(type, listener, options);
68
+ }, [type, listener]);
69
+ }
70
+
71
+ // hooks/useViewportSize.ts
72
+ import { useCallback, useEffect as useEffect17, useState as useState16 } from "react";
73
+ var eventListerOptions = {
74
+ passive: true
75
+ };
76
+ function useViewportSize() {
77
+ const [windowSize, setWindowSize] = useState16({
78
+ width: 0,
79
+ height: 0
80
+ });
81
+ const setSize = useCallback(() => {
82
+ setWindowSize({
83
+ width: window.innerWidth || 0,
84
+ height: window.innerHeight || 0
85
+ });
86
+ }, []);
87
+ useWindowEvent("resize", setSize, eventListerOptions);
88
+ useWindowEvent("orientationchange", setSize, eventListerOptions);
89
+ useEffect17(setSize, []);
90
+ return windowSize;
91
+ }
92
+
93
93
  // elements/tabs/Tabs.tsx
94
+ import * as Popover from "@radix-ui/react-popover";
94
95
  import * as TabsPrimitive from "@radix-ui/react-tabs";
95
96
 
96
97
  // util/index.ts
@@ -186,71 +187,16 @@ var Chip = React9.forwardRef(
186
187
  }
187
188
  );
188
189
 
189
- // elements/floatBox/FloatBox.tsx
190
- import * as React10 from "react";
191
- var FloatBox = ({
192
- className,
193
- open,
194
- side = "bottom",
195
- sideOffset = 40,
196
- align = "center",
197
- withArrow = false,
198
- ...props
199
- }) => {
200
- let stylesMap = {
201
- bottom: {
202
- start: { top: sideOffset, insetInlineStart: 0 },
203
- center: { top: sideOffset },
204
- end: { top: sideOffset, insetInlineEnd: 0 }
205
- },
206
- top: {
207
- start: { bottom: sideOffset, insetInlineStart: 0 },
208
- center: { bottom: sideOffset },
209
- end: { bottom: sideOffset, insetInlineEnd: 0 }
210
- },
211
- right: {
212
- start: { left: sideOffset, top: -5 },
213
- center: { left: sideOffset },
214
- end: { left: sideOffset, bottom: 0 }
215
- },
216
- left: {
217
- start: { right: sideOffset, top: 0 },
218
- center: { right: sideOffset },
219
- end: { right: sideOffset, bottom: 0 }
220
- }
221
- };
222
- const arrowDirection = {
223
- top: "hawa-arrow-default-bottom",
224
- bottom: "hawa-arrow-default-top",
225
- right: "hawa-arrow-default-left",
226
- left: "hawa-arrow-default-right"
227
- };
228
- return /* @__PURE__ */ React10.createElement(
229
- "div",
230
- {
231
- className: cn(
232
- "data-[floatbox-state=closed]:hawa-invisible data-[floatbox-state=open]:hawa-visible hawa-absolute dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[floatbox-state=open]:hawa-animate-in data-[floatbox-state=closed]:hawa-animate-out data-[floatbox-state=closed]:hawa-fade-out-0 data-[floatbox-state=open]:hawa-fade-in-0 data-[floatbox-state=closed]:hawa-zoom-out-95 data-[floatbox-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 hawa-bg-popover",
233
- className
234
- ),
235
- style: { ...stylesMap[side][align] },
236
- "data-side": side,
237
- "data-floatbox-state": open ? "open" : "closed"
238
- },
239
- withArrow && /* @__PURE__ */ React10.createElement("div", { className: cn(arrowDirection[side]) }),
240
- /* @__PURE__ */ React10.createElement("span", null, props.children)
241
- );
242
- };
243
-
244
190
  // elements/scrollArea/ScrollArea.tsx
245
- import * as React11 from "react";
191
+ import * as React10 from "react";
246
192
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
247
- var ScrollArea = React11.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
248
- const scrollAreaRef = React11.useRef(null);
249
- const isDragging = React11.useRef(false);
250
- const startPos = React11.useRef({ x: 0, y: 0 });
251
- const scrollPos = React11.useRef({ top: 0, left: 0 });
252
- const [showLeftFade, setShowLeftFade] = React11.useState(false);
253
- const [showRightFade, setShowRightFade] = React11.useState(false);
193
+ var ScrollArea = React10.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
194
+ const scrollAreaRef = React10.useRef(null);
195
+ const isDragging = React10.useRef(false);
196
+ const startPos = React10.useRef({ x: 0, y: 0 });
197
+ const scrollPos = React10.useRef({ top: 0, left: 0 });
198
+ const [showLeftFade, setShowLeftFade] = React10.useState(false);
199
+ const [showRightFade, setShowRightFade] = React10.useState(false);
254
200
  const checkOverflow = () => {
255
201
  if (scrollAreaRef.current) {
256
202
  const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
@@ -287,7 +233,7 @@ var ScrollArea = React11.forwardRef(({ className, children, orientation = "verti
287
233
  document.removeEventListener("mousemove", onMouseMove);
288
234
  document.removeEventListener("mouseup", onMouseUp);
289
235
  };
290
- React11.useEffect(() => {
236
+ React10.useEffect(() => {
291
237
  checkOverflow();
292
238
  if (scrollAreaRef.current) {
293
239
  scrollAreaRef.current.addEventListener("scroll", checkOverflow);
@@ -300,14 +246,14 @@ var ScrollArea = React11.forwardRef(({ className, children, orientation = "verti
300
246
  window.removeEventListener("resize", checkOverflow);
301
247
  };
302
248
  }, []);
303
- return /* @__PURE__ */ React11.createElement(
249
+ return /* @__PURE__ */ React10.createElement(
304
250
  ScrollAreaPrimitive.Root,
305
251
  {
306
252
  ref,
307
253
  className: cn("hawa-relative hawa-overflow-hidden", className),
308
254
  ...props
309
255
  },
310
- /* @__PURE__ */ React11.createElement(
256
+ /* @__PURE__ */ React10.createElement(
311
257
  "div",
312
258
  {
313
259
  className: cn(
@@ -316,7 +262,7 @@ var ScrollArea = React11.forwardRef(({ className, children, orientation = "verti
316
262
  )
317
263
  }
318
264
  ),
319
- /* @__PURE__ */ React11.createElement(
265
+ /* @__PURE__ */ React10.createElement(
320
266
  "div",
321
267
  {
322
268
  className: cn(
@@ -325,7 +271,7 @@ var ScrollArea = React11.forwardRef(({ className, children, orientation = "verti
325
271
  )
326
272
  }
327
273
  ),
328
- /* @__PURE__ */ React11.createElement(
274
+ /* @__PURE__ */ React10.createElement(
329
275
  ScrollAreaPrimitive.Viewport,
330
276
  {
331
277
  ref: scrollAreaRef,
@@ -334,12 +280,12 @@ var ScrollArea = React11.forwardRef(({ className, children, orientation = "verti
334
280
  },
335
281
  children
336
282
  ),
337
- /* @__PURE__ */ React11.createElement(ScrollBar, { orientation }),
338
- /* @__PURE__ */ React11.createElement(ScrollAreaPrimitive.Corner, null)
283
+ /* @__PURE__ */ React10.createElement(ScrollBar, { orientation }),
284
+ /* @__PURE__ */ React10.createElement(ScrollAreaPrimitive.Corner, null)
339
285
  );
340
286
  });
341
287
  ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
342
- var ScrollBar = React11.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React11.createElement(
288
+ var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React10.createElement(
343
289
  ScrollAreaPrimitive.ScrollAreaScrollbar,
344
290
  {
345
291
  ref,
@@ -352,7 +298,7 @@ var ScrollBar = React11.forwardRef(({ className, orientation = "vertical", ...pr
352
298
  ),
353
299
  ...props
354
300
  },
355
- /* @__PURE__ */ React11.createElement(
301
+ /* @__PURE__ */ React10.createElement(
356
302
  ScrollAreaPrimitive.ScrollAreaThumb,
357
303
  {
358
304
  className: cn(
@@ -423,39 +369,27 @@ var tabsTriggerVariant = tv({
423
369
  ],
424
370
  defaultVariants: { variant: "default", orientation: "horizontal" }
425
371
  });
426
- var TabsContext = React12.createContext({ orientation: "horizontal", variant: "default" });
427
- var Tabs = React12.forwardRef(({ className, orientation, variant = "default", ...props }, ref) => /* @__PURE__ */ React12.createElement(
428
- TabsPrimitive.Root,
429
- {
430
- ref,
431
- className: cn(
432
- "hawa-flex hawa-gap-2",
433
- orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
434
- className
435
- ),
436
- ...props
437
- },
438
- /* @__PURE__ */ React12.createElement(TabsContext.Provider, { value: { orientation, variant } }, props.children)
439
- ));
440
- var TabsList = React12.forwardRef(({ className, classNames, ...props }, ref) => {
441
- const { orientation, variant } = React12.useContext(TabsContext);
442
- const [size, setSize] = React12.useState(
443
- typeof window !== "undefined" && window.innerWidth || 1200
444
- );
445
- React12.useEffect(() => {
446
- if (typeof window !== "undefined") {
447
- const resize = () => {
448
- setSize(window.innerWidth);
449
- };
450
- resize();
451
- window.addEventListener("resize", resize);
452
- return () => {
453
- window.removeEventListener("resize", resize);
454
- };
455
- }
456
- }, []);
457
- if (props.scrollable && size < 768 && orientation === "horizontal") {
458
- return /* @__PURE__ */ React12.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React12.createElement(
372
+ var TabsContext = React11.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
373
+ var Tabs = React11.forwardRef(
374
+ ({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React11.createElement(
375
+ TabsPrimitive.Root,
376
+ {
377
+ ref,
378
+ className: cn(
379
+ "hawa-flex hawa-gap-2",
380
+ orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
381
+ className
382
+ ),
383
+ ...props
384
+ },
385
+ /* @__PURE__ */ React11.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
386
+ )
387
+ );
388
+ var TabsList = React11.forwardRef(({ className, classNames, ...props }, ref) => {
389
+ const { orientation, variant, scrollable } = React11.useContext(TabsContext);
390
+ const { width } = useViewportSize();
391
+ if (scrollable && width < 768 && orientation === "horizontal") {
392
+ return /* @__PURE__ */ React11.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React11.createElement(
459
393
  TabsPrimitive.List,
460
394
  {
461
395
  ref,
@@ -468,7 +402,7 @@ var TabsList = React12.forwardRef(({ className, classNames, ...props }, ref) =>
468
402
  }
469
403
  ));
470
404
  } else {
471
- return /* @__PURE__ */ React12.createElement(
405
+ return /* @__PURE__ */ React11.createElement(
472
406
  TabsPrimitive.List,
473
407
  {
474
408
  ref,
@@ -483,37 +417,52 @@ var TabsList = React12.forwardRef(({ className, classNames, ...props }, ref) =>
483
417
  );
484
418
  }
485
419
  });
486
- var TabsTrigger = React12.forwardRef(({ className, chipProps, ...props }, ref) => {
487
- const { orientation, variant } = React12.useContext(TabsContext);
488
- const tabTriggerRef = React12.useRef(null);
489
- const { width } = useMeasureDirty(tabTriggerRef);
490
- return /* @__PURE__ */ React12.createElement(
491
- TabsPrimitive.Trigger,
492
- {
493
- ref: tabTriggerRef,
494
- className: cn(
495
- tabsTriggerVariant({ variant, orientation }),
496
- "hawa-relative",
497
- className
498
- ),
499
- ...props
500
- },
501
- props.children,
502
- chipProps && /* @__PURE__ */ React12.createElement(Chip, { ...chipProps }),
503
- /* @__PURE__ */ React12.createElement(
504
- FloatBox,
505
- {
506
- withArrow: true,
507
- align: orientation === "vertical" ? "start" : "start",
508
- side: orientation === "vertical" ? "right" : "bottom",
509
- sideOffset: orientation === "vertical" ? width + 30 : 45,
510
- open: props.showPopover
511
- },
512
- props.popoverContent
513
- )
514
- );
515
- });
516
- var TabsContent = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
420
+ var TabsTrigger = React11.forwardRef(
421
+ ({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
422
+ const { orientation, variant } = React11.useContext(TabsContext);
423
+ if (withPopover) {
424
+ return /* @__PURE__ */ React11.createElement(Popover.Root, { open: props.showPopover }, /* @__PURE__ */ React11.createElement(Popover.Anchor, { asChild: true }, /* @__PURE__ */ React11.createElement(
425
+ TabsPrimitive.Trigger,
426
+ {
427
+ className: cn(
428
+ tabsTriggerVariant({ variant, orientation }),
429
+ "hawa-relative",
430
+ className
431
+ ),
432
+ ...props
433
+ },
434
+ props.children,
435
+ chipProps && /* @__PURE__ */ React11.createElement(Chip, { ...chipProps })
436
+ )), /* @__PURE__ */ React11.createElement(
437
+ Popover.Content,
438
+ {
439
+ onClick: onPopoverClick,
440
+ asChild: true,
441
+ className: cn(
442
+ "dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
443
+ "hawa-arrow-default-top hawa-mt-2"
444
+ )
445
+ },
446
+ /* @__PURE__ */ React11.createElement("div", { className: "hawa-p-2" }, " ", props.popoverContent)
447
+ ));
448
+ } else {
449
+ return /* @__PURE__ */ React11.createElement(
450
+ TabsPrimitive.Trigger,
451
+ {
452
+ className: cn(
453
+ tabsTriggerVariant({ variant, orientation }),
454
+ "hawa-relative",
455
+ className
456
+ ),
457
+ ...props
458
+ },
459
+ props.children,
460
+ chipProps && /* @__PURE__ */ React11.createElement(Chip, { ...chipProps })
461
+ );
462
+ }
463
+ }
464
+ );
465
+ var TabsContent = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React11.createElement(
517
466
  TabsPrimitive.Content,
518
467
  {
519
468
  ref,