@sikka/hawa 0.36.1-next → 0.37.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/README.md +1 -5
- package/dist/appLayout/index.d.mts +0 -2
- package/dist/appLayout/index.d.ts +0 -2
- package/dist/appLayout/index.js +20 -7
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +21 -8
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +11 -14
- package/dist/blocks/auth/index.mjs +1 -1
- package/dist/blocks/feedback/index.js +11 -14
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.js +295 -181
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/misc/index.js +257 -143
- package/dist/blocks/misc/index.mjs +50 -16
- package/dist/blocks/pricing/index.js +94 -11
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/{chunk-CJ57JBYA.mjs → chunk-I5YX7N76.mjs} +94 -11
- package/dist/{chunk-T33FXOHA.mjs → chunk-PO5OW6SQ.mjs} +151 -40
- package/dist/{chunk-HLYAX77R.mjs → chunk-SE5A4R76.mjs} +11 -14
- package/dist/{chunk-OPYDG34F.mjs → chunk-ZBUBNKF6.mjs} +93 -1
- package/dist/combobox/index.d.mts +1 -4
- package/dist/combobox/index.d.ts +1 -4
- package/dist/combobox/index.js +3 -2
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +3 -2
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.d.mts +4 -36
- package/dist/command/index.d.ts +4 -36
- package/dist/command/index.js +44 -6
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +40 -4
- package/dist/command/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/elements/index.d.mts +28 -2
- package/dist/elements/index.d.ts +28 -2
- package/dist/elements/index.js +438 -285
- package/dist/elements/index.mjs +42 -5
- package/dist/hooks/index.d.mts +25 -1
- package/dist/hooks/index.d.ts +25 -1
- package/dist/hooks/index.js +96 -0
- package/dist/hooks/index.mjs +9 -1
- package/dist/index-CoPyqTu8.d.mts +63 -0
- package/dist/index-CoPyqTu8.d.ts +63 -0
- package/dist/index.css +23 -0
- package/dist/index.d.mts +52 -4
- package/dist/index.d.ts +52 -4
- package/dist/index.js +965 -708
- package/dist/index.mjs +496 -245
- package/dist/layout/index.d.mts +0 -2
- package/dist/layout/index.d.ts +0 -2
- package/dist/layout/index.js +20 -7
- package/dist/layout/index.mjs +19 -8
- package/dist/phoneInput/index.js +11 -14
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +11 -14
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +94 -11
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +94 -11
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/select/index.js +11 -14
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +11 -14
- package/dist/select/index.mjs.map +1 -1
- package/dist/tabs/index.d.mts +3 -1
- package/dist/tabs/index.d.ts +3 -1
- package/dist/tabs/index.js +189 -32
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +184 -27
- package/dist/tabs/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -5,13 +5,13 @@ import {
|
|
5
5
|
import {
|
6
6
|
Chip,
|
7
7
|
ScrollArea
|
8
|
-
} from "../../chunk-
|
8
|
+
} from "../../chunk-I5YX7N76.mjs";
|
9
9
|
import {
|
10
10
|
Textarea
|
11
11
|
} from "../../chunk-WABHQMUI.mjs";
|
12
12
|
import {
|
13
13
|
Select
|
14
|
-
} from "../../chunk-
|
14
|
+
} from "../../chunk-SE5A4R76.mjs";
|
15
15
|
import {
|
16
16
|
Button,
|
17
17
|
Card,
|
@@ -113,6 +113,9 @@ var useMeasureDirty = (ref) => {
|
|
113
113
|
// hooks/useClickOutside.ts
|
114
114
|
import { useEffect as useEffect14, useRef as useRef8 } from "react";
|
115
115
|
|
116
|
+
// hooks/useShortcuts.ts
|
117
|
+
import { useEffect as useEffect15 } from "react";
|
118
|
+
|
116
119
|
// elements/tabs/Tabs.tsx
|
117
120
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
118
121
|
import { tv } from "tailwind-variants";
|
@@ -177,9 +180,9 @@ var tabsListVariant = tv({
|
|
177
180
|
base: "",
|
178
181
|
variants: {
|
179
182
|
variant: {
|
180
|
-
default: "hawa-flex hawa-w-fit hawa-
|
181
|
-
underlined: "hawa-flex hawa-w-fit hawa-
|
182
|
-
underlined_tabs: "hawa-flex hawa-w-fit hawa-
|
183
|
+
default: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-border hawa-bg-muted hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
184
|
+
underlined: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
185
|
+
underlined_tabs: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-text-muted-foreground"
|
183
186
|
},
|
184
187
|
orientation: { horizontal: "", vertical: "" }
|
185
188
|
},
|
@@ -247,18 +250,49 @@ var Tabs = React10.forwardRef(({ className, orientation, variant = "default", ..
|
|
247
250
|
));
|
248
251
|
var TabsList = React10.forwardRef(({ className, ...props }, ref) => {
|
249
252
|
const { orientation, variant } = React10.useContext(TabsContext);
|
250
|
-
|
251
|
-
|
252
|
-
{
|
253
|
-
ref,
|
254
|
-
className: cn(
|
255
|
-
tabsListVariant({ variant, orientation }),
|
256
|
-
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
257
|
-
className
|
258
|
-
),
|
259
|
-
...props
|
260
|
-
}
|
253
|
+
const [size, setSize] = React10.useState(
|
254
|
+
typeof window !== "undefined" && window.innerWidth || 1200
|
261
255
|
);
|
256
|
+
React10.useEffect(() => {
|
257
|
+
if (typeof window !== "undefined") {
|
258
|
+
const resize = () => {
|
259
|
+
setSize(window.innerWidth);
|
260
|
+
};
|
261
|
+
resize();
|
262
|
+
window.addEventListener("resize", resize);
|
263
|
+
return () => {
|
264
|
+
window.removeEventListener("resize", resize);
|
265
|
+
};
|
266
|
+
}
|
267
|
+
}, []);
|
268
|
+
if ((props.scrollable || size < 768) && orientation === "horizontal") {
|
269
|
+
return /* @__PURE__ */ React10.createElement(ScrollArea, { orientation: "horizontal" }, /* @__PURE__ */ React10.createElement(
|
270
|
+
TabsPrimitive.List,
|
271
|
+
{
|
272
|
+
ref,
|
273
|
+
className: cn(
|
274
|
+
tabsListVariant({ variant, orientation }),
|
275
|
+
"hawa-flex-row hawa-flex-nowrap",
|
276
|
+
className
|
277
|
+
),
|
278
|
+
...props
|
279
|
+
}
|
280
|
+
));
|
281
|
+
} else {
|
282
|
+
return /* @__PURE__ */ React10.createElement(
|
283
|
+
TabsPrimitive.List,
|
284
|
+
{
|
285
|
+
ref,
|
286
|
+
className: cn(
|
287
|
+
tabsListVariant({ variant, orientation }),
|
288
|
+
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
289
|
+
"hawa-flex-wrap",
|
290
|
+
className
|
291
|
+
),
|
292
|
+
...props
|
293
|
+
}
|
294
|
+
);
|
295
|
+
}
|
262
296
|
});
|
263
297
|
var TabsTrigger = React10.forwardRef(({ className, chipProps, ...props }, ref) => {
|
264
298
|
const { orientation, variant } = React10.useContext(TabsContext);
|
@@ -1362,17 +1362,100 @@ var import_react18 = __toESM(require("react"));
|
|
1362
1362
|
// elements/scrollArea/ScrollArea.tsx
|
1363
1363
|
var React20 = __toESM(require("react"));
|
1364
1364
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
|
1365
|
-
var ScrollArea = React20.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) =>
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
)
|
1365
|
+
var ScrollArea = React20.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
1366
|
+
const scrollAreaRef = React20.useRef(null);
|
1367
|
+
const isDragging = React20.useRef(false);
|
1368
|
+
const startPos = React20.useRef({ x: 0, y: 0 });
|
1369
|
+
const scrollPos = React20.useRef({ top: 0, left: 0 });
|
1370
|
+
const [showLeftFade, setShowLeftFade] = React20.useState(false);
|
1371
|
+
const [showRightFade, setShowRightFade] = React20.useState(false);
|
1372
|
+
const checkOverflow = () => {
|
1373
|
+
if (scrollAreaRef.current) {
|
1374
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
1375
|
+
setShowLeftFade(scrollLeft > 0);
|
1376
|
+
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
1377
|
+
}
|
1378
|
+
};
|
1379
|
+
const onMouseDown = (e) => {
|
1380
|
+
isDragging.current = true;
|
1381
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
1382
|
+
if (scrollAreaRef.current) {
|
1383
|
+
scrollPos.current = {
|
1384
|
+
top: scrollAreaRef.current.scrollTop,
|
1385
|
+
left: scrollAreaRef.current.scrollLeft
|
1386
|
+
};
|
1387
|
+
}
|
1388
|
+
document.addEventListener("mousemove", onMouseMove);
|
1389
|
+
document.addEventListener("mouseup", onMouseUp);
|
1390
|
+
};
|
1391
|
+
const onMouseMove = (e) => {
|
1392
|
+
if (!isDragging.current || !scrollAreaRef.current)
|
1393
|
+
return;
|
1394
|
+
const dx = e.clientX - startPos.current.x;
|
1395
|
+
const dy = e.clientY - startPos.current.y;
|
1396
|
+
if (orientation === "vertical") {
|
1397
|
+
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
1398
|
+
} else {
|
1399
|
+
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
1400
|
+
checkOverflow();
|
1401
|
+
}
|
1402
|
+
};
|
1403
|
+
const onMouseUp = () => {
|
1404
|
+
isDragging.current = false;
|
1405
|
+
document.removeEventListener("mousemove", onMouseMove);
|
1406
|
+
document.removeEventListener("mouseup", onMouseUp);
|
1407
|
+
};
|
1408
|
+
React20.useEffect(() => {
|
1409
|
+
checkOverflow();
|
1410
|
+
if (scrollAreaRef.current) {
|
1411
|
+
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
1412
|
+
window.addEventListener("resize", checkOverflow);
|
1413
|
+
}
|
1414
|
+
return () => {
|
1415
|
+
if (scrollAreaRef.current) {
|
1416
|
+
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
1417
|
+
}
|
1418
|
+
window.removeEventListener("resize", checkOverflow);
|
1419
|
+
};
|
1420
|
+
}, []);
|
1421
|
+
return /* @__PURE__ */ React20.createElement(
|
1422
|
+
ScrollAreaPrimitive.Root,
|
1423
|
+
{
|
1424
|
+
ref,
|
1425
|
+
className: cn("hawa-relative hawa-overflow-hidden", className),
|
1426
|
+
...props
|
1427
|
+
},
|
1428
|
+
/* @__PURE__ */ React20.createElement(
|
1429
|
+
"div",
|
1430
|
+
{
|
1431
|
+
className: cn(
|
1432
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right",
|
1433
|
+
showLeftFade ? "hawa-block" : "hawa-hidden"
|
1434
|
+
)
|
1435
|
+
}
|
1436
|
+
),
|
1437
|
+
/* @__PURE__ */ React20.createElement(
|
1438
|
+
"div",
|
1439
|
+
{
|
1440
|
+
className: cn(
|
1441
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10 ",
|
1442
|
+
showRightFade ? "hawa-block" : "hawa-hidden"
|
1443
|
+
)
|
1444
|
+
}
|
1445
|
+
),
|
1446
|
+
/* @__PURE__ */ React20.createElement(
|
1447
|
+
ScrollAreaPrimitive.Viewport,
|
1448
|
+
{
|
1449
|
+
ref: scrollAreaRef,
|
1450
|
+
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
1451
|
+
onMouseDown
|
1452
|
+
},
|
1453
|
+
children
|
1454
|
+
),
|
1455
|
+
/* @__PURE__ */ React20.createElement(ScrollBar, { orientation }),
|
1456
|
+
/* @__PURE__ */ React20.createElement(ScrollAreaPrimitive.Corner, null)
|
1457
|
+
);
|
1458
|
+
});
|
1376
1459
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
1377
1460
|
var ScrollBar = React20.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React20.createElement(
|
1378
1461
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
@@ -6,17 +6,100 @@ import {
|
|
6
6
|
// elements/scrollArea/ScrollArea.tsx
|
7
7
|
import * as React from "react";
|
8
8
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
9
|
-
var ScrollArea = React.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) =>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
)
|
9
|
+
var ScrollArea = React.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
10
|
+
const scrollAreaRef = React.useRef(null);
|
11
|
+
const isDragging = React.useRef(false);
|
12
|
+
const startPos = React.useRef({ x: 0, y: 0 });
|
13
|
+
const scrollPos = React.useRef({ top: 0, left: 0 });
|
14
|
+
const [showLeftFade, setShowLeftFade] = React.useState(false);
|
15
|
+
const [showRightFade, setShowRightFade] = React.useState(false);
|
16
|
+
const checkOverflow = () => {
|
17
|
+
if (scrollAreaRef.current) {
|
18
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
19
|
+
setShowLeftFade(scrollLeft > 0);
|
20
|
+
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
21
|
+
}
|
22
|
+
};
|
23
|
+
const onMouseDown = (e) => {
|
24
|
+
isDragging.current = true;
|
25
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
26
|
+
if (scrollAreaRef.current) {
|
27
|
+
scrollPos.current = {
|
28
|
+
top: scrollAreaRef.current.scrollTop,
|
29
|
+
left: scrollAreaRef.current.scrollLeft
|
30
|
+
};
|
31
|
+
}
|
32
|
+
document.addEventListener("mousemove", onMouseMove);
|
33
|
+
document.addEventListener("mouseup", onMouseUp);
|
34
|
+
};
|
35
|
+
const onMouseMove = (e) => {
|
36
|
+
if (!isDragging.current || !scrollAreaRef.current)
|
37
|
+
return;
|
38
|
+
const dx = e.clientX - startPos.current.x;
|
39
|
+
const dy = e.clientY - startPos.current.y;
|
40
|
+
if (orientation === "vertical") {
|
41
|
+
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
42
|
+
} else {
|
43
|
+
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
44
|
+
checkOverflow();
|
45
|
+
}
|
46
|
+
};
|
47
|
+
const onMouseUp = () => {
|
48
|
+
isDragging.current = false;
|
49
|
+
document.removeEventListener("mousemove", onMouseMove);
|
50
|
+
document.removeEventListener("mouseup", onMouseUp);
|
51
|
+
};
|
52
|
+
React.useEffect(() => {
|
53
|
+
checkOverflow();
|
54
|
+
if (scrollAreaRef.current) {
|
55
|
+
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
56
|
+
window.addEventListener("resize", checkOverflow);
|
57
|
+
}
|
58
|
+
return () => {
|
59
|
+
if (scrollAreaRef.current) {
|
60
|
+
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
61
|
+
}
|
62
|
+
window.removeEventListener("resize", checkOverflow);
|
63
|
+
};
|
64
|
+
}, []);
|
65
|
+
return /* @__PURE__ */ React.createElement(
|
66
|
+
ScrollAreaPrimitive.Root,
|
67
|
+
{
|
68
|
+
ref,
|
69
|
+
className: cn("hawa-relative hawa-overflow-hidden", className),
|
70
|
+
...props
|
71
|
+
},
|
72
|
+
/* @__PURE__ */ React.createElement(
|
73
|
+
"div",
|
74
|
+
{
|
75
|
+
className: cn(
|
76
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right",
|
77
|
+
showLeftFade ? "hawa-block" : "hawa-hidden"
|
78
|
+
)
|
79
|
+
}
|
80
|
+
),
|
81
|
+
/* @__PURE__ */ React.createElement(
|
82
|
+
"div",
|
83
|
+
{
|
84
|
+
className: cn(
|
85
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10 ",
|
86
|
+
showRightFade ? "hawa-block" : "hawa-hidden"
|
87
|
+
)
|
88
|
+
}
|
89
|
+
),
|
90
|
+
/* @__PURE__ */ React.createElement(
|
91
|
+
ScrollAreaPrimitive.Viewport,
|
92
|
+
{
|
93
|
+
ref: scrollAreaRef,
|
94
|
+
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
95
|
+
onMouseDown
|
96
|
+
},
|
97
|
+
children
|
98
|
+
),
|
99
|
+
/* @__PURE__ */ React.createElement(ScrollBar, { orientation }),
|
100
|
+
/* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Corner, null)
|
101
|
+
);
|
102
|
+
});
|
20
103
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
21
104
|
var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
|
22
105
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
3
|
useMeasureDirty
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-ZBUBNKF6.mjs";
|
5
5
|
import {
|
6
6
|
Button,
|
7
7
|
Chip,
|
@@ -389,6 +389,10 @@ var Select = ({
|
|
389
389
|
children
|
390
390
|
);
|
391
391
|
};
|
392
|
+
let phoneCodeStyles = "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]";
|
393
|
+
let selectContainerStyles = "hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm";
|
394
|
+
let selectPlaceholderStyles = "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1";
|
395
|
+
let selectIndicatorContainerStyles = "hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ";
|
392
396
|
return /* @__PURE__ */ React3.createElement(
|
393
397
|
"div",
|
394
398
|
{
|
@@ -410,26 +414,22 @@ var Select = ({
|
|
410
414
|
props.controlClassNames
|
411
415
|
),
|
412
416
|
container: () => cn(
|
413
|
-
|
414
|
-
props.phoneCode &&
|
415
|
-
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
417
|
+
selectContainerStyles,
|
418
|
+
props.phoneCode && phoneCodeStyles,
|
416
419
|
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
417
420
|
props.isMulti && "hawa-ps-0 "
|
418
421
|
),
|
419
|
-
placeholder: () =>
|
422
|
+
placeholder: () => selectPlaceholderStyles,
|
420
423
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
421
424
|
singleValue: () => "hawa-text-foreground",
|
422
425
|
indicatorsContainer: () => cn(
|
423
|
-
|
426
|
+
selectIndicatorContainerStyles,
|
424
427
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
425
428
|
)
|
426
429
|
},
|
427
430
|
unstyled: true,
|
428
|
-
|
429
|
-
|
430
|
-
Menu,
|
431
|
-
IndicatorsContainer: () => null
|
432
|
-
} : {
|
431
|
+
autoFocus: false,
|
432
|
+
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
433
433
|
Option,
|
434
434
|
Menu,
|
435
435
|
// Control: (e) => (
|
@@ -451,10 +451,7 @@ var Select = ({
|
|
451
451
|
MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
|
452
452
|
"div",
|
453
453
|
{
|
454
|
-
className:
|
455
|
-
// e.className,
|
456
|
-
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
457
|
-
),
|
454
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
458
455
|
...e
|
459
456
|
}
|
460
457
|
)
|
@@ -2874,17 +2871,100 @@ Textarea.displayName = "Textarea";
|
|
2874
2871
|
// elements/scrollArea/ScrollArea.tsx
|
2875
2872
|
import * as React11 from "react";
|
2876
2873
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
2877
|
-
var ScrollArea = React11.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) =>
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2884
|
-
|
2885
|
-
|
2886
|
-
|
2887
|
-
)
|
2874
|
+
var ScrollArea = React11.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
2875
|
+
const scrollAreaRef = React11.useRef(null);
|
2876
|
+
const isDragging = React11.useRef(false);
|
2877
|
+
const startPos = React11.useRef({ x: 0, y: 0 });
|
2878
|
+
const scrollPos = React11.useRef({ top: 0, left: 0 });
|
2879
|
+
const [showLeftFade, setShowLeftFade] = React11.useState(false);
|
2880
|
+
const [showRightFade, setShowRightFade] = React11.useState(false);
|
2881
|
+
const checkOverflow = () => {
|
2882
|
+
if (scrollAreaRef.current) {
|
2883
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
2884
|
+
setShowLeftFade(scrollLeft > 0);
|
2885
|
+
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
2886
|
+
}
|
2887
|
+
};
|
2888
|
+
const onMouseDown = (e) => {
|
2889
|
+
isDragging.current = true;
|
2890
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
2891
|
+
if (scrollAreaRef.current) {
|
2892
|
+
scrollPos.current = {
|
2893
|
+
top: scrollAreaRef.current.scrollTop,
|
2894
|
+
left: scrollAreaRef.current.scrollLeft
|
2895
|
+
};
|
2896
|
+
}
|
2897
|
+
document.addEventListener("mousemove", onMouseMove);
|
2898
|
+
document.addEventListener("mouseup", onMouseUp);
|
2899
|
+
};
|
2900
|
+
const onMouseMove = (e) => {
|
2901
|
+
if (!isDragging.current || !scrollAreaRef.current)
|
2902
|
+
return;
|
2903
|
+
const dx = e.clientX - startPos.current.x;
|
2904
|
+
const dy = e.clientY - startPos.current.y;
|
2905
|
+
if (orientation === "vertical") {
|
2906
|
+
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
2907
|
+
} else {
|
2908
|
+
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
2909
|
+
checkOverflow();
|
2910
|
+
}
|
2911
|
+
};
|
2912
|
+
const onMouseUp = () => {
|
2913
|
+
isDragging.current = false;
|
2914
|
+
document.removeEventListener("mousemove", onMouseMove);
|
2915
|
+
document.removeEventListener("mouseup", onMouseUp);
|
2916
|
+
};
|
2917
|
+
React11.useEffect(() => {
|
2918
|
+
checkOverflow();
|
2919
|
+
if (scrollAreaRef.current) {
|
2920
|
+
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
2921
|
+
window.addEventListener("resize", checkOverflow);
|
2922
|
+
}
|
2923
|
+
return () => {
|
2924
|
+
if (scrollAreaRef.current) {
|
2925
|
+
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
2926
|
+
}
|
2927
|
+
window.removeEventListener("resize", checkOverflow);
|
2928
|
+
};
|
2929
|
+
}, []);
|
2930
|
+
return /* @__PURE__ */ React11.createElement(
|
2931
|
+
ScrollAreaPrimitive.Root,
|
2932
|
+
{
|
2933
|
+
ref,
|
2934
|
+
className: cn("hawa-relative hawa-overflow-hidden", className),
|
2935
|
+
...props
|
2936
|
+
},
|
2937
|
+
/* @__PURE__ */ React11.createElement(
|
2938
|
+
"div",
|
2939
|
+
{
|
2940
|
+
className: cn(
|
2941
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right",
|
2942
|
+
showLeftFade ? "hawa-block" : "hawa-hidden"
|
2943
|
+
)
|
2944
|
+
}
|
2945
|
+
),
|
2946
|
+
/* @__PURE__ */ React11.createElement(
|
2947
|
+
"div",
|
2948
|
+
{
|
2949
|
+
className: cn(
|
2950
|
+
"hawa-pointer-events-none hawa-absolute hawa-bg-background/ hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10 ",
|
2951
|
+
showRightFade ? "hawa-block" : "hawa-hidden"
|
2952
|
+
)
|
2953
|
+
}
|
2954
|
+
),
|
2955
|
+
/* @__PURE__ */ React11.createElement(
|
2956
|
+
ScrollAreaPrimitive.Viewport,
|
2957
|
+
{
|
2958
|
+
ref: scrollAreaRef,
|
2959
|
+
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
2960
|
+
onMouseDown
|
2961
|
+
},
|
2962
|
+
children
|
2963
|
+
),
|
2964
|
+
/* @__PURE__ */ React11.createElement(ScrollBar, { orientation }),
|
2965
|
+
/* @__PURE__ */ React11.createElement(ScrollAreaPrimitive.Corner, null)
|
2966
|
+
);
|
2967
|
+
});
|
2888
2968
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
2889
2969
|
var ScrollBar = React11.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React11.createElement(
|
2890
2970
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
@@ -2976,9 +3056,9 @@ var tabsListVariant = tv({
|
|
2976
3056
|
base: "",
|
2977
3057
|
variants: {
|
2978
3058
|
variant: {
|
2979
|
-
default: "hawa-flex hawa-w-fit hawa-
|
2980
|
-
underlined: "hawa-flex hawa-w-fit hawa-
|
2981
|
-
underlined_tabs: "hawa-flex hawa-w-fit hawa-
|
3059
|
+
default: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-border hawa-bg-muted hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
3060
|
+
underlined: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
|
3061
|
+
underlined_tabs: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-text-muted-foreground"
|
2982
3062
|
},
|
2983
3063
|
orientation: { horizontal: "", vertical: "" }
|
2984
3064
|
},
|
@@ -3046,18 +3126,49 @@ var Tabs = React13.forwardRef(({ className, orientation, variant = "default", ..
|
|
3046
3126
|
));
|
3047
3127
|
var TabsList = React13.forwardRef(({ className, ...props }, ref) => {
|
3048
3128
|
const { orientation, variant } = React13.useContext(TabsContext);
|
3049
|
-
|
3050
|
-
|
3051
|
-
{
|
3052
|
-
ref,
|
3053
|
-
className: cn(
|
3054
|
-
tabsListVariant({ variant, orientation }),
|
3055
|
-
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
3056
|
-
className
|
3057
|
-
),
|
3058
|
-
...props
|
3059
|
-
}
|
3129
|
+
const [size, setSize] = React13.useState(
|
3130
|
+
typeof window !== "undefined" && window.innerWidth || 1200
|
3060
3131
|
);
|
3132
|
+
React13.useEffect(() => {
|
3133
|
+
if (typeof window !== "undefined") {
|
3134
|
+
const resize = () => {
|
3135
|
+
setSize(window.innerWidth);
|
3136
|
+
};
|
3137
|
+
resize();
|
3138
|
+
window.addEventListener("resize", resize);
|
3139
|
+
return () => {
|
3140
|
+
window.removeEventListener("resize", resize);
|
3141
|
+
};
|
3142
|
+
}
|
3143
|
+
}, []);
|
3144
|
+
if ((props.scrollable || size < 768) && orientation === "horizontal") {
|
3145
|
+
return /* @__PURE__ */ React13.createElement(ScrollArea, { orientation: "horizontal" }, /* @__PURE__ */ React13.createElement(
|
3146
|
+
TabsPrimitive.List,
|
3147
|
+
{
|
3148
|
+
ref,
|
3149
|
+
className: cn(
|
3150
|
+
tabsListVariant({ variant, orientation }),
|
3151
|
+
"hawa-flex-row hawa-flex-nowrap",
|
3152
|
+
className
|
3153
|
+
),
|
3154
|
+
...props
|
3155
|
+
}
|
3156
|
+
));
|
3157
|
+
} else {
|
3158
|
+
return /* @__PURE__ */ React13.createElement(
|
3159
|
+
TabsPrimitive.List,
|
3160
|
+
{
|
3161
|
+
ref,
|
3162
|
+
className: cn(
|
3163
|
+
tabsListVariant({ variant, orientation }),
|
3164
|
+
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
3165
|
+
"hawa-flex-wrap",
|
3166
|
+
className
|
3167
|
+
),
|
3168
|
+
...props
|
3169
|
+
}
|
3170
|
+
);
|
3171
|
+
}
|
3061
3172
|
});
|
3062
3173
|
var TabsTrigger = React13.forwardRef(({ className, chipProps, ...props }, ref) => {
|
3063
3174
|
const { orientation, variant } = React13.useContext(TabsContext);
|
@@ -68,6 +68,10 @@ var Select = ({
|
|
68
68
|
children
|
69
69
|
);
|
70
70
|
};
|
71
|
+
let phoneCodeStyles = "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px]";
|
72
|
+
let selectContainerStyles = "hawa-rounded hawa-block hawa-w-full hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm";
|
73
|
+
let selectPlaceholderStyles = "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1";
|
74
|
+
let selectIndicatorContainerStyles = "hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ";
|
71
75
|
return /* @__PURE__ */ React.createElement(
|
72
76
|
"div",
|
73
77
|
{
|
@@ -89,26 +93,22 @@ var Select = ({
|
|
89
93
|
props.controlClassNames
|
90
94
|
),
|
91
95
|
container: () => cn(
|
92
|
-
|
93
|
-
props.phoneCode &&
|
94
|
-
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
96
|
+
selectContainerStyles,
|
97
|
+
props.phoneCode && phoneCodeStyles,
|
95
98
|
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
96
99
|
props.isMulti && "hawa-ps-0 "
|
97
100
|
),
|
98
|
-
placeholder: () =>
|
101
|
+
placeholder: () => selectPlaceholderStyles,
|
99
102
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
100
103
|
singleValue: () => "hawa-text-foreground",
|
101
104
|
indicatorsContainer: () => cn(
|
102
|
-
|
105
|
+
selectIndicatorContainerStyles,
|
103
106
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
104
107
|
)
|
105
108
|
},
|
106
109
|
unstyled: true,
|
107
|
-
|
108
|
-
|
109
|
-
Menu,
|
110
|
-
IndicatorsContainer: () => null
|
111
|
-
} : {
|
110
|
+
autoFocus: false,
|
111
|
+
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
112
112
|
Option,
|
113
113
|
Menu,
|
114
114
|
// Control: (e) => (
|
@@ -130,10 +130,7 @@ var Select = ({
|
|
130
130
|
MultiValueContainer: (e) => /* @__PURE__ */ React.createElement(
|
131
131
|
"div",
|
132
132
|
{
|
133
|
-
className:
|
134
|
-
// e.className,
|
135
|
-
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
136
|
-
),
|
133
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
137
134
|
...e
|
138
135
|
}
|
139
136
|
)
|