@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.
- package/dist/{DropdownMenu-B3cTLPDi.d.mts → DropdownMenu-FVVDS2rX.d.mts} +6 -1
- package/dist/{DropdownMenu-BO1TNMm5.d.ts → DropdownMenu-SFJtRGAw.d.ts} +6 -1
- package/dist/{Radio-lgoClQrv.d.ts → Radio-DlPwVCG4.d.ts} +6 -0
- package/dist/{Radio-uQ7DtzcI.d.mts → Radio-Dyvlywnk.d.mts} +6 -0
- package/dist/alert/index.js +2 -2
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +2 -2
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.d.mts +2 -0
- package/dist/appLayout/index.d.ts +2 -0
- package/dist/appLayout/index.js +14 -3
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +14 -3
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +2 -2
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +2 -2
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +2 -2
- package/dist/blocks/auth/index.mjs +4 -4
- package/dist/blocks/feedback/index.js +162 -119
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +2 -2
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/index.js +442 -450
- package/dist/blocks/index.mjs +3 -3
- package/dist/blocks/misc/index.js +238 -289
- package/dist/blocks/misc/index.mjs +147 -200
- package/dist/blocks/pricing/index.js +162 -119
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.d.mts +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +2 -2
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +2 -2
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +2 -2
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +2 -2
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/{chunk-C2IX3SUD.mjs → chunk-27G5FKOP.mjs} +1 -1
- package/dist/{chunk-IC5WYNKN.mjs → chunk-AJTYKC5R.mjs} +1 -1
- package/dist/{chunk-UMOBOCED.mjs → chunk-CTNKKP2O.mjs} +2 -2
- package/dist/chunk-CTZRVSTI.mjs +346 -0
- package/dist/{chunk-XFSBC5VI.mjs → chunk-DYPGZ2IP.mjs} +1 -1
- package/dist/{chunk-UJ5SXC3M.mjs → chunk-GN7EIDTE.mjs} +1 -1
- package/dist/{chunk-VMVZM3QQ.mjs → chunk-GU2DOJ7Q.mjs} +31 -8
- package/dist/{chunk-RTK6REIK.mjs → chunk-QZIENYTE.mjs} +1 -1
- package/dist/{chunk-EZBHA2IL.mjs → chunk-RT2Q3SH7.mjs} +1 -1
- package/dist/{chunk-W3CF7BSC.mjs → chunk-UBUVHGW4.mjs} +238 -248
- package/dist/{chunk-ZBUBNKF6.mjs → chunk-XCW5YNMS.mjs} +34 -1
- package/dist/codeBlock/index.js +2 -2
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +2 -2
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/command/index.mjs.map +1 -1
- package/dist/commonTypes-189mW5eB.d.mts +8 -0
- package/dist/commonTypes-189mW5eB.d.ts +8 -0
- package/dist/commonTypes-DUY2LJm1.d.mts +3 -0
- package/dist/commonTypes-DUY2LJm1.d.ts +3 -0
- package/dist/commonTypes-D_7LV7Ri.d.mts +5 -0
- package/dist/commonTypes-D_7LV7Ri.d.ts +5 -0
- package/dist/dataTable/index.js +2 -2
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +2 -2
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +1 -1
- package/dist/datePicker/index.d.ts +1 -1
- package/dist/datePicker/index.js +3 -3
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +3 -3
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +2 -2
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +2 -2
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.d.mts +6 -1
- package/dist/dropdownMenu/index.d.ts +6 -1
- package/dist/dropdownMenu/index.js +29 -6
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +29 -6
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +7 -5
- package/dist/elements/index.d.ts +7 -5
- package/dist/elements/index.js +546 -531
- package/dist/elements/index.mjs +5 -5
- package/dist/fileDropzone/index.d.mts +2 -2
- package/dist/fileDropzone/index.d.ts +2 -2
- package/dist/fileDropzone/index.js +2 -2
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +2 -2
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/fileUploader/index.d.mts +2 -2
- package/dist/fileUploader/index.d.ts +2 -2
- package/dist/glow/index.d.mts +3 -3
- package/dist/glow/index.d.ts +3 -3
- package/dist/hooks/index.d.mts +8 -1
- package/dist/hooks/index.d.ts +8 -1
- package/dist/hooks/index.js +35 -0
- package/dist/hooks/index.mjs +5 -1
- package/dist/index.css +0 -91
- package/dist/index.d.mts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +1020 -959
- package/dist/index.mjs +971 -912
- package/dist/input/index.d.mts +2 -9
- package/dist/input/index.d.ts +2 -9
- package/dist/interfaceSettings/index.js +160 -117
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +160 -117
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.d.mts +1 -2
- package/dist/label/index.d.ts +1 -2
- package/dist/layout/index.d.mts +3 -1
- package/dist/layout/index.d.ts +3 -1
- package/dist/layout/index.js +14 -3
- package/dist/layout/index.mjs +14 -3
- package/dist/navigationMenu/index.d.mts +2 -1
- package/dist/navigationMenu/index.d.ts +2 -1
- package/dist/pagination/index.d.mts +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/phoneInput/index.d.mts +1 -1
- package/dist/phoneInput/index.d.ts +1 -1
- package/dist/progress/index.d.mts +8 -1
- package/dist/progress/index.d.ts +8 -1
- package/dist/radio/index.d.mts +15 -1
- package/dist/radio/index.d.ts +15 -1
- package/dist/radio/index.js +160 -117
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +160 -117
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/separator/index.d.mts +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/signature/index.d.mts +1 -2
- package/dist/signature/index.d.ts +1 -2
- package/dist/simpleTable/index.d.mts +1 -1
- package/dist/simpleTable/index.d.ts +1 -1
- package/dist/sonner/index.d.mts +1 -1
- package/dist/sonner/index.d.ts +1 -1
- package/dist/sortButton/index.js +2 -2
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +2 -2
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +3 -9
- package/dist/splitButton/index.d.ts +3 -9
- package/dist/splitButton/index.js +2 -2
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +2 -2
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/switch/index.d.mts +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/tabs/index.d.mts +4 -2
- package/dist/tabs/index.d.ts +4 -2
- package/dist/tabs/index.js +123 -174
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +118 -169
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toaster/index.d.mts +4 -22
- package/dist/toaster/index.d.ts +4 -22
- package/dist/tooltip/index.d.mts +4 -3
- package/dist/tooltip/index.d.ts +4 -3
- package/package.json +1 -1
- package/dist/Label-UbMDLtJF.d.mts +0 -14
- package/dist/Label-UbMDLtJF.d.ts +0 -14
- package/dist/chunk-WDCKXU54.mjs +0 -303
- package/dist/commonTypes-CgDwjGvU.d.mts +0 -5
- package/dist/commonTypes-CgDwjGvU.d.ts +0 -5
- package/dist/commonTypes-DZdITB5m.d.mts +0 -4
- package/dist/commonTypes-DZdITB5m.d.ts +0 -4
- package/dist/floatBox/index.d.mts +0 -15
- package/dist/floatBox/index.d.ts +0 -15
- package/dist/floatBox/index.js +0 -105
- package/dist/floatBox/index.js.map +0 -1
- package/dist/floatBox/index.mjs +0 -69
- package/dist/floatBox/index.mjs.map +0 -1
package/dist/tabs/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// elements/tabs/Tabs.tsx
|
4
|
-
import * as
|
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
|
191
|
+
import * as React10 from "react";
|
246
192
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
247
|
-
var ScrollArea =
|
248
|
-
const scrollAreaRef =
|
249
|
-
const isDragging =
|
250
|
-
const startPos =
|
251
|
-
const scrollPos =
|
252
|
-
const [showLeftFade, setShowLeftFade] =
|
253
|
-
const [showRightFade, setShowRightFade] =
|
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
|
-
|
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__ */
|
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__ */
|
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__ */
|
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__ */
|
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__ */
|
338
|
-
/* @__PURE__ */
|
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 =
|
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__ */
|
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 =
|
427
|
-
var Tabs =
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
)
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
);
|
445
|
-
|
446
|
-
|
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__ */
|
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 =
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
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,
|