@sikka/hawa 0.46.4-next → 0.48.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/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
- package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
- package/dist/blocks/auth/index.d.mts +34 -17
- package/dist/blocks/auth/index.d.ts +34 -17
- package/dist/blocks/auth/index.js +1008 -430
- package/dist/blocks/auth/index.mjs +427 -297
- package/dist/blocks/feedback/index.d.mts +1 -1
- package/dist/blocks/feedback/index.d.ts +1 -1
- package/dist/blocks/feedback/index.js +68 -79
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.d.mts +28 -11
- package/dist/blocks/index.d.ts +28 -11
- package/dist/blocks/index.js +2340 -2233
- package/dist/blocks/index.mjs +407 -269
- package/dist/blocks/misc/index.d.mts +1 -1
- package/dist/blocks/misc/index.d.ts +1 -1
- package/dist/blocks/misc/index.js +68 -79
- package/dist/blocks/misc/index.mjs +50 -367
- package/dist/blocks/pricing/index.d.mts +1 -1
- package/dist/blocks/pricing/index.d.ts +1 -1
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
- package/dist/{chunk-5CTMGPEF.mjs → chunk-GBLWUEYN.mjs} +650 -674
- package/dist/chunk-JFWD2ICY.mjs +511 -0
- package/dist/elements/index.d.mts +2 -2
- package/dist/elements/index.d.ts +2 -2
- package/dist/elements/index.js +81 -105
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +7 -0
- package/dist/index.d.mts +36 -17
- package/dist/index.d.ts +36 -17
- package/dist/index.js +482 -373
- package/dist/index.mjs +487 -373
- package/dist/phoneInput/index.d.mts +7 -7
- package/dist/phoneInput/index.d.ts +7 -7
- package/dist/phoneInput/index.js +78 -85
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +78 -85
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +3 -20
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +3 -20
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +68 -79
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +68 -79
- package/dist/select/index.mjs.map +1 -1
- package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
- package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -350,6 +350,7 @@ import clsx from "clsx";
|
|
350
350
|
var Select = ({
|
351
351
|
labelProps,
|
352
352
|
labelKey = "label",
|
353
|
+
valueKey = "value",
|
353
354
|
...props
|
354
355
|
}) => {
|
355
356
|
const NoOption = () => {
|
@@ -369,13 +370,7 @@ var Select = ({
|
|
369
370
|
children
|
370
371
|
);
|
371
372
|
};
|
372
|
-
const Option = ({
|
373
|
-
children,
|
374
|
-
innerProps,
|
375
|
-
innerRef,
|
376
|
-
isFocused,
|
377
|
-
isSelected
|
378
|
-
}) => {
|
373
|
+
const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
|
379
374
|
return /* @__PURE__ */ React3.createElement(
|
380
375
|
"div",
|
381
376
|
{
|
@@ -390,14 +385,7 @@ var Select = ({
|
|
390
385
|
children
|
391
386
|
);
|
392
387
|
};
|
393
|
-
const Menu = ({
|
394
|
-
cx,
|
395
|
-
children,
|
396
|
-
getStyles,
|
397
|
-
innerProps,
|
398
|
-
innerRef,
|
399
|
-
...menuProps
|
400
|
-
}) => {
|
388
|
+
const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
|
401
389
|
const menuOpen = menuProps.selectProps.menuIsOpen;
|
402
390
|
return /* @__PURE__ */ React3.createElement(
|
403
391
|
"div",
|
@@ -426,71 +414,72 @@ var Select = ({
|
|
426
414
|
)
|
427
415
|
},
|
428
416
|
props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
|
429
|
-
props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
{
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
456
|
-
props.disabled && "hawa-opacity-30"
|
457
|
-
)
|
458
|
-
},
|
459
|
-
unstyled: true,
|
460
|
-
autoFocus: false,
|
461
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
|
417
|
+
props.isLoading ? /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React3.createElement(
|
418
|
+
ReactSelect,
|
419
|
+
{
|
420
|
+
noOptionsMessage: NoOption,
|
421
|
+
classNames: {
|
422
|
+
control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
|
423
|
+
container: () => cn(
|
424
|
+
selectContainerStyles,
|
425
|
+
props.phoneCode && phoneCodeStyles,
|
426
|
+
props.isMulti && "hawa-ps-0 "
|
427
|
+
),
|
428
|
+
placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
|
429
|
+
valueContainer: () => "hawa-text-foreground hawa-px-1",
|
430
|
+
singleValue: () => cn(
|
431
|
+
props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
|
432
|
+
),
|
433
|
+
indicatorsContainer: () => cn(
|
434
|
+
selectIndicatorContainerStyles,
|
435
|
+
props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
|
436
|
+
props.disabled && "hawa-opacity-30"
|
437
|
+
)
|
438
|
+
},
|
439
|
+
unstyled: true,
|
440
|
+
autoFocus: false,
|
441
|
+
components: props.hideIndicator ? {
|
442
|
+
Option: (optionProps) => /* @__PURE__ */ React3.createElement(
|
462
443
|
Option,
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
className
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
444
|
+
{
|
445
|
+
...optionProps,
|
446
|
+
isSelected: optionProps.data[valueKey] === props.value[valueKey]
|
447
|
+
}
|
448
|
+
),
|
449
|
+
Menu,
|
450
|
+
IndicatorsContainer: () => null
|
451
|
+
} : {
|
452
|
+
Option,
|
453
|
+
Menu,
|
454
|
+
ValueContainer: (e) => /* @__PURE__ */ React3.createElement(
|
455
|
+
"div",
|
456
|
+
{
|
457
|
+
className: cn(
|
458
|
+
e.className,
|
459
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
|
460
|
+
),
|
461
|
+
...e
|
462
|
+
}
|
463
|
+
),
|
464
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React3.createElement(
|
465
|
+
"div",
|
466
|
+
{
|
467
|
+
className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
|
468
|
+
...e
|
469
|
+
}
|
470
|
+
)
|
471
|
+
},
|
472
|
+
onChange: (newValue, action) => props.onChange(newValue, action),
|
473
|
+
options: props.options,
|
474
|
+
getOptionLabel: props.getOptionLabel,
|
475
|
+
defaultValue: props.defaultValue,
|
476
|
+
value: props.value,
|
477
|
+
placeholder: props.placeholder,
|
478
|
+
isDisabled: props.disabled,
|
479
|
+
isClearable: props.isClearable,
|
480
|
+
isMulti: props.isMulti,
|
481
|
+
isSearchable: props.isSearchable
|
482
|
+
}
|
494
483
|
) : /* @__PURE__ */ React3.createElement(
|
495
484
|
CreatableSelect,
|
496
485
|
{
|
@@ -2228,11 +2217,13 @@ var PhoneInput = ({
|
|
2228
2217
|
countryCodes,
|
2229
2218
|
...props
|
2230
2219
|
}) => {
|
2220
|
+
var _a;
|
2231
2221
|
const [phoneNumber, setPhoneNumber] = useState3("");
|
2232
|
-
const [countryCode, setCountryCode] = useState3(
|
2222
|
+
const [countryCode, setCountryCode] = useState3(
|
2223
|
+
props.preferredCountry || { label: "+966" }
|
2224
|
+
);
|
2233
2225
|
const inputRef = useRef2(null);
|
2234
2226
|
const handleInputChange = (e) => {
|
2235
|
-
console.log("test e ", e.target.value);
|
2236
2227
|
const validChars = /^[0-9-()]+$/;
|
2237
2228
|
const input = e.target.value;
|
2238
2229
|
if (input === "" || validChars.test(input)) {
|
@@ -2254,11 +2245,13 @@ var PhoneInput = ({
|
|
2254
2245
|
isMulti: false,
|
2255
2246
|
isSearchable: true,
|
2256
2247
|
isClearable: false,
|
2257
|
-
placeholder:
|
2248
|
+
placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
|
2258
2249
|
options: countryCodes || countries_default,
|
2259
|
-
onChange: setCountryCode,
|
2260
|
-
|
2261
|
-
|
2250
|
+
onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
|
2251
|
+
valueKey: "label",
|
2252
|
+
labelKey: "label",
|
2253
|
+
value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
|
2254
|
+
defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
|
2262
2255
|
}
|
2263
2256
|
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
|
2264
2257
|
"input",
|
@@ -2422,160 +2415,437 @@ var StopPropagationWrapper = (props) => {
|
|
2422
2415
|
return /* @__PURE__ */ React6.createElement("div", { onClick: handleClick }, props.children);
|
2423
2416
|
};
|
2424
2417
|
|
2425
|
-
// elements/
|
2418
|
+
// elements/scrollArea/ScrollArea.tsx
|
2426
2419
|
import * as React7 from "react";
|
2427
|
-
import
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
2450
|
-
|
2451
|
-
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
2477
|
-
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
|
2486
|
-
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
2487
|
-
var createLucideIcon = (iconName, iconNode) => {
|
2488
|
-
const Component = forwardRef4(
|
2489
|
-
({ className, ...props }, ref) => createElement3(Icon, {
|
2420
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
2421
|
+
var ScrollArea = React7.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
2422
|
+
const scrollAreaRef = React7.useRef(null);
|
2423
|
+
const isDragging = React7.useRef(false);
|
2424
|
+
const startPos = React7.useRef({ x: 0, y: 0 });
|
2425
|
+
const scrollPos = React7.useRef({ top: 0, left: 0 });
|
2426
|
+
const [showLeftFade, setShowLeftFade] = React7.useState(false);
|
2427
|
+
const [showRightFade, setShowRightFade] = React7.useState(false);
|
2428
|
+
const checkOverflow = () => {
|
2429
|
+
if (scrollAreaRef.current) {
|
2430
|
+
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
2431
|
+
setShowLeftFade(scrollLeft > 0);
|
2432
|
+
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
2433
|
+
}
|
2434
|
+
};
|
2435
|
+
const onMouseDown = (e) => {
|
2436
|
+
isDragging.current = true;
|
2437
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
2438
|
+
if (scrollAreaRef.current) {
|
2439
|
+
scrollPos.current = {
|
2440
|
+
top: scrollAreaRef.current.scrollTop,
|
2441
|
+
left: scrollAreaRef.current.scrollLeft
|
2442
|
+
};
|
2443
|
+
}
|
2444
|
+
document.addEventListener("mousemove", onMouseMove);
|
2445
|
+
document.addEventListener("mouseup", onMouseUp);
|
2446
|
+
};
|
2447
|
+
const onMouseMove = (e) => {
|
2448
|
+
if (!isDragging.current || !scrollAreaRef.current) return;
|
2449
|
+
const dx = e.clientX - startPos.current.x;
|
2450
|
+
const dy = e.clientY - startPos.current.y;
|
2451
|
+
if (orientation === "vertical") {
|
2452
|
+
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
2453
|
+
} else {
|
2454
|
+
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
2455
|
+
checkOverflow();
|
2456
|
+
}
|
2457
|
+
};
|
2458
|
+
const onMouseUp = () => {
|
2459
|
+
isDragging.current = false;
|
2460
|
+
document.removeEventListener("mousemove", onMouseMove);
|
2461
|
+
document.removeEventListener("mouseup", onMouseUp);
|
2462
|
+
};
|
2463
|
+
React7.useEffect(() => {
|
2464
|
+
checkOverflow();
|
2465
|
+
if (scrollAreaRef.current) {
|
2466
|
+
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
2467
|
+
window.addEventListener("resize", checkOverflow);
|
2468
|
+
}
|
2469
|
+
return () => {
|
2470
|
+
if (scrollAreaRef.current) {
|
2471
|
+
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
2472
|
+
}
|
2473
|
+
window.removeEventListener("resize", checkOverflow);
|
2474
|
+
};
|
2475
|
+
}, []);
|
2476
|
+
return /* @__PURE__ */ React7.createElement(
|
2477
|
+
ScrollAreaPrimitive.Root,
|
2478
|
+
{
|
2490
2479
|
ref,
|
2491
|
-
|
2492
|
-
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
2480
|
+
className: cn("hawa-relative hawa-overflow-hidden", className),
|
2493
2481
|
...props
|
2494
|
-
}
|
2482
|
+
},
|
2483
|
+
/* @__PURE__ */ React7.createElement(
|
2484
|
+
"div",
|
2485
|
+
{
|
2486
|
+
className: cn(
|
2487
|
+
"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",
|
2488
|
+
showLeftFade ? "hawa-block" : "hawa-hidden"
|
2489
|
+
)
|
2490
|
+
}
|
2491
|
+
),
|
2492
|
+
/* @__PURE__ */ React7.createElement(
|
2493
|
+
"div",
|
2494
|
+
{
|
2495
|
+
className: cn(
|
2496
|
+
"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",
|
2497
|
+
showRightFade ? "hawa-block" : "hawa-hidden"
|
2498
|
+
)
|
2499
|
+
}
|
2500
|
+
),
|
2501
|
+
/* @__PURE__ */ React7.createElement(
|
2502
|
+
ScrollAreaPrimitive.Viewport,
|
2503
|
+
{
|
2504
|
+
ref: scrollAreaRef,
|
2505
|
+
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
2506
|
+
onMouseDown
|
2507
|
+
},
|
2508
|
+
children
|
2509
|
+
),
|
2510
|
+
/* @__PURE__ */ React7.createElement(ScrollBar, { orientation }),
|
2511
|
+
/* @__PURE__ */ React7.createElement(ScrollAreaPrimitive.Corner, null)
|
2495
2512
|
);
|
2496
|
-
|
2497
|
-
|
2498
|
-
}
|
2499
|
-
|
2500
|
-
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
2501
|
-
var Dot = createLucideIcon("Dot", [
|
2502
|
-
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
2503
|
-
]);
|
2504
|
-
|
2505
|
-
// elements/pinInput/PinInput.tsx
|
2506
|
-
var PinInputRoot = React7.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
2507
|
-
OTPInput,
|
2513
|
+
});
|
2514
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
2515
|
+
var ScrollBar = React7.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
2516
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
2508
2517
|
{
|
2509
2518
|
ref,
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2519
|
+
orientation,
|
2520
|
+
className: cn(
|
2521
|
+
"hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
|
2522
|
+
orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
|
2523
|
+
orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
|
2524
|
+
className
|
2513
2525
|
),
|
2514
|
-
className: cn("disabled:hawa-cursor-not-allowed", className),
|
2515
|
-
...props
|
2516
|
-
}
|
2517
|
-
));
|
2518
|
-
PinInputRoot.displayName = "PinInputRoot";
|
2519
|
-
var PinInputGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React7.createElement(
|
2520
|
-
"div",
|
2521
|
-
{
|
2522
|
-
ref,
|
2523
|
-
className: cn("hawa-flex hawa-items-center", className),
|
2524
2526
|
...props
|
2525
|
-
}
|
2526
|
-
|
2527
|
-
|
2528
|
-
var PinInputSlot = React7.forwardRef(({ index, className, ...props }, ref) => {
|
2529
|
-
const pinInputContext = React7.useContext(OTPInputContext);
|
2530
|
-
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
2531
|
-
return /* @__PURE__ */ React7.createElement(
|
2532
|
-
"div",
|
2527
|
+
},
|
2528
|
+
/* @__PURE__ */ React7.createElement(
|
2529
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
2533
2530
|
{
|
2534
|
-
ref,
|
2535
2531
|
className: cn(
|
2536
|
-
"hawa-
|
2537
|
-
|
2538
|
-
|
2539
|
-
),
|
2540
|
-
...props
|
2541
|
-
},
|
2542
|
-
char,
|
2543
|
-
hasFakeCaret && /* @__PURE__ */ React7.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React7.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
|
2544
|
-
);
|
2545
|
-
});
|
2546
|
-
PinInputSlot.displayName = "PinInputSlot";
|
2547
|
-
var PinInputSeperator = React7.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React7.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React7.createElement(Dot, null)));
|
2548
|
-
PinInputSeperator.displayName = "PinInputSeperator";
|
2549
|
-
var PinInput = ({
|
2550
|
-
separatorPosition = 0,
|
2551
|
-
...props
|
2552
|
-
}) => {
|
2553
|
-
const maxLength = props.maxLength || 6;
|
2554
|
-
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
2555
|
-
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
2556
|
-
const secondGroupLength = maxLength - firstGroupLength;
|
2557
|
-
return /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React7.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React7.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React7.createElement(
|
2558
|
-
PinInputSlot,
|
2559
|
-
{
|
2560
|
-
key: index,
|
2561
|
-
index,
|
2562
|
-
className: "hawa-w-full hawa-border"
|
2532
|
+
"hawa-relative hawa-rounded-full hawa-bg-border",
|
2533
|
+
orientation === "vertical" && "hawa-flex-1"
|
2534
|
+
)
|
2563
2535
|
}
|
2564
|
-
)
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2536
|
+
)
|
2537
|
+
));
|
2538
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
2539
|
+
|
2540
|
+
// elements/tabs/Tabs.tsx
|
2541
|
+
import * as React8 from "react";
|
2542
|
+
import * as Popover from "@radix-ui/react-popover";
|
2543
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
2544
|
+
import { tv } from "tailwind-variants";
|
2545
|
+
var tabsListVariant = tv({
|
2546
|
+
base: "",
|
2547
|
+
variants: {
|
2548
|
+
variant: {
|
2549
|
+
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",
|
2550
|
+
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",
|
2551
|
+
underlined_tabs: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-text-muted-foreground"
|
2552
|
+
},
|
2553
|
+
orientation: { horizontal: "", vertical: "" }
|
2554
|
+
},
|
2555
|
+
compoundVariants: [
|
2556
|
+
{
|
2557
|
+
variant: "underlined_tabs",
|
2558
|
+
orientation: "vertical",
|
2559
|
+
class: "hawa-border-e-2 hawa-border-e-primary"
|
2560
|
+
},
|
2561
|
+
{
|
2562
|
+
variant: "underlined_tabs",
|
2563
|
+
orientation: "horizontal",
|
2564
|
+
class: "hawa-border-b-2 hawa-border-b-primary"
|
2565
|
+
}
|
2566
|
+
],
|
2567
|
+
defaultVariants: { variant: "default", orientation: "horizontal" }
|
2568
|
+
});
|
2569
|
+
var tabsTriggerVariant = tv({
|
2570
|
+
base: "",
|
2571
|
+
variants: {
|
2572
|
+
variant: {
|
2573
|
+
default: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-border hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground data-[state=active]:hawa-shadow-sm dark:hawa-border-primary/10",
|
2574
|
+
underlined: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-rounded-none hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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",
|
2575
|
+
underlined_tabs: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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 hawa-bg-primary/10 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground dark:hawa-border-primary/10"
|
2576
|
+
},
|
2577
|
+
orientation: { horizontal: "", vertical: "" }
|
2578
|
+
},
|
2579
|
+
compoundVariants: [
|
2580
|
+
{
|
2581
|
+
variant: "underlined",
|
2582
|
+
orientation: "horizontal",
|
2583
|
+
class: "data-[state=active]:hawa-border-b-primary hawa-border-b hawa-border-b-2"
|
2584
|
+
},
|
2585
|
+
{
|
2586
|
+
variant: "underlined",
|
2587
|
+
orientation: "vertical",
|
2588
|
+
class: "data-[state=active]:hawa-border-e-primary hawa-border-e hawa-border-e-2"
|
2589
|
+
},
|
2590
|
+
{
|
2591
|
+
variant: "underlined_tabs",
|
2592
|
+
orientation: "horizontal",
|
2593
|
+
class: "hawa-rounded-b-none"
|
2594
|
+
},
|
2595
|
+
{
|
2596
|
+
variant: "underlined_tabs",
|
2597
|
+
orientation: "vertical",
|
2598
|
+
class: "hawa-rounded-e-none"
|
2599
|
+
}
|
2600
|
+
],
|
2601
|
+
defaultVariants: { variant: "default", orientation: "horizontal" }
|
2602
|
+
});
|
2603
|
+
var TabsContext = React8.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
|
2604
|
+
var Tabs = React8.forwardRef(
|
2605
|
+
({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React8.createElement(
|
2606
|
+
TabsPrimitive.Root,
|
2607
|
+
{
|
2608
|
+
ref,
|
2609
|
+
className: cn(
|
2610
|
+
"hawa-flex hawa-gap-2",
|
2611
|
+
orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
|
2612
|
+
className
|
2613
|
+
),
|
2614
|
+
...props
|
2615
|
+
},
|
2616
|
+
/* @__PURE__ */ React8.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
|
2617
|
+
)
|
2618
|
+
);
|
2619
|
+
var TabsList = React8.forwardRef(({ className, classNames, ...props }, ref) => {
|
2620
|
+
const { orientation, variant, scrollable } = React8.useContext(TabsContext);
|
2621
|
+
const { width } = useViewportSize();
|
2622
|
+
if (scrollable && width < 768 && orientation === "horizontal") {
|
2623
|
+
return /* @__PURE__ */ React8.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React8.createElement(
|
2624
|
+
TabsPrimitive.List,
|
2625
|
+
{
|
2626
|
+
ref,
|
2627
|
+
className: cn(
|
2628
|
+
tabsListVariant({ variant, orientation }),
|
2629
|
+
"hawa-flex-row hawa-flex-nowrap",
|
2630
|
+
className
|
2631
|
+
),
|
2632
|
+
...props
|
2633
|
+
}
|
2634
|
+
));
|
2635
|
+
} else {
|
2636
|
+
return /* @__PURE__ */ React8.createElement(
|
2637
|
+
TabsPrimitive.List,
|
2638
|
+
{
|
2639
|
+
ref,
|
2640
|
+
className: cn(
|
2641
|
+
tabsListVariant({ variant, orientation }),
|
2642
|
+
orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
|
2643
|
+
"hawa-flex-wrap",
|
2644
|
+
className
|
2645
|
+
),
|
2646
|
+
...props
|
2647
|
+
}
|
2648
|
+
);
|
2649
|
+
}
|
2650
|
+
});
|
2651
|
+
var TabsTrigger = React8.forwardRef(
|
2652
|
+
({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
|
2653
|
+
const { orientation, variant } = React8.useContext(TabsContext);
|
2654
|
+
if (withPopover) {
|
2655
|
+
return /* @__PURE__ */ React8.createElement(Popover.Root, { open: props.showPopover }, /* @__PURE__ */ React8.createElement(Popover.Anchor, { asChild: true }, /* @__PURE__ */ React8.createElement(
|
2656
|
+
TabsPrimitive.Trigger,
|
2657
|
+
{
|
2658
|
+
className: cn(
|
2659
|
+
tabsTriggerVariant({ variant, orientation }),
|
2660
|
+
"hawa-relative",
|
2661
|
+
className
|
2662
|
+
),
|
2663
|
+
...props
|
2664
|
+
},
|
2665
|
+
props.children,
|
2666
|
+
chipProps && /* @__PURE__ */ React8.createElement(Chip, { ...chipProps })
|
2667
|
+
)), /* @__PURE__ */ React8.createElement(
|
2668
|
+
Popover.Content,
|
2669
|
+
{
|
2670
|
+
onClick: onPopoverClick,
|
2671
|
+
asChild: true,
|
2672
|
+
className: cn(
|
2673
|
+
"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",
|
2674
|
+
"hawa-arrow-default-top hawa-mt-2"
|
2675
|
+
)
|
2676
|
+
},
|
2677
|
+
/* @__PURE__ */ React8.createElement("div", { className: "hawa-p-2" }, " ", props.popoverContent)
|
2678
|
+
));
|
2679
|
+
} else {
|
2680
|
+
return /* @__PURE__ */ React8.createElement(
|
2681
|
+
TabsPrimitive.Trigger,
|
2682
|
+
{
|
2683
|
+
className: cn(
|
2684
|
+
tabsTriggerVariant({ variant, orientation }),
|
2685
|
+
"hawa-relative",
|
2686
|
+
className
|
2687
|
+
),
|
2688
|
+
...props
|
2689
|
+
},
|
2690
|
+
props.children,
|
2691
|
+
chipProps && /* @__PURE__ */ React8.createElement(Chip, { ...chipProps })
|
2692
|
+
);
|
2693
|
+
}
|
2694
|
+
}
|
2695
|
+
);
|
2696
|
+
var TabsContent = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React8.createElement(
|
2697
|
+
TabsPrimitive.Content,
|
2698
|
+
{
|
2699
|
+
ref,
|
2700
|
+
className: cn(
|
2701
|
+
"hawa-ring-offset-hawa-background hawa-w-full focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2",
|
2702
|
+
className
|
2703
|
+
),
|
2704
|
+
...props
|
2705
|
+
}
|
2706
|
+
));
|
2707
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
2708
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
2709
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
2710
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
2711
|
+
|
2712
|
+
// elements/pinInput/PinInput.tsx
|
2713
|
+
import * as React9 from "react";
|
2714
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
2715
|
+
|
2716
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
2717
|
+
import { forwardRef as forwardRef6, createElement as createElement5 } from "react";
|
2718
|
+
|
2719
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
2720
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
2721
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
2722
|
+
return Boolean(className) && array.indexOf(className) === index;
|
2723
|
+
}).join(" ");
|
2724
|
+
|
2725
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
2726
|
+
import { forwardRef as forwardRef5, createElement as createElement4 } from "react";
|
2727
|
+
|
2728
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
2729
|
+
var defaultAttributes = {
|
2730
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2731
|
+
width: 24,
|
2732
|
+
height: 24,
|
2733
|
+
viewBox: "0 0 24 24",
|
2734
|
+
fill: "none",
|
2735
|
+
stroke: "currentColor",
|
2736
|
+
strokeWidth: 2,
|
2737
|
+
strokeLinecap: "round",
|
2738
|
+
strokeLinejoin: "round"
|
2739
|
+
};
|
2740
|
+
|
2741
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
2742
|
+
var Icon = forwardRef5(
|
2743
|
+
({
|
2744
|
+
color = "currentColor",
|
2745
|
+
size = 24,
|
2746
|
+
strokeWidth = 2,
|
2747
|
+
absoluteStrokeWidth,
|
2748
|
+
className = "",
|
2749
|
+
children,
|
2750
|
+
iconNode,
|
2751
|
+
...rest
|
2752
|
+
}, ref) => {
|
2753
|
+
return createElement4(
|
2754
|
+
"svg",
|
2755
|
+
{
|
2756
|
+
ref,
|
2757
|
+
...defaultAttributes,
|
2758
|
+
width: size,
|
2759
|
+
height: size,
|
2760
|
+
stroke: color,
|
2761
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
2762
|
+
className: mergeClasses("lucide", className),
|
2763
|
+
...rest
|
2764
|
+
},
|
2765
|
+
[
|
2766
|
+
...iconNode.map(([tag, attrs]) => createElement4(tag, attrs)),
|
2767
|
+
...Array.isArray(children) ? children : [children]
|
2768
|
+
]
|
2769
|
+
);
|
2770
|
+
}
|
2771
|
+
);
|
2772
|
+
|
2773
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
2774
|
+
var createLucideIcon = (iconName, iconNode) => {
|
2775
|
+
const Component = forwardRef6(
|
2776
|
+
({ className, ...props }, ref) => createElement5(Icon, {
|
2777
|
+
ref,
|
2778
|
+
iconNode,
|
2779
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
2780
|
+
...props
|
2781
|
+
})
|
2782
|
+
);
|
2783
|
+
Component.displayName = `${iconName}`;
|
2784
|
+
return Component;
|
2785
|
+
};
|
2786
|
+
|
2787
|
+
// ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
2788
|
+
var Dot = createLucideIcon("Dot", [
|
2789
|
+
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
2790
|
+
]);
|
2791
|
+
|
2792
|
+
// elements/pinInput/PinInput.tsx
|
2793
|
+
var PinInputRoot = React9.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
2794
|
+
OTPInput,
|
2795
|
+
{
|
2796
|
+
ref,
|
2797
|
+
containerClassName: cn(
|
2798
|
+
"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50",
|
2799
|
+
containerClassName
|
2800
|
+
),
|
2801
|
+
className: cn("disabled:hawa-cursor-not-allowed", className),
|
2802
|
+
...props
|
2803
|
+
}
|
2804
|
+
));
|
2805
|
+
PinInputRoot.displayName = "PinInputRoot";
|
2806
|
+
var PinInputGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
2807
|
+
PinInputGroup.displayName = "PinInputGroup";
|
2808
|
+
var PinInputSlot = React9.forwardRef(({ index, className, ...props }, ref) => {
|
2809
|
+
const pinInputContext = React9.useContext(OTPInputContext);
|
2810
|
+
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
2811
|
+
return /* @__PURE__ */ React9.createElement(
|
2812
|
+
"div",
|
2813
|
+
{
|
2814
|
+
ref,
|
2815
|
+
className: cn(
|
2816
|
+
"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md",
|
2817
|
+
isActive && "hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2",
|
2818
|
+
className
|
2819
|
+
),
|
2820
|
+
...props
|
2821
|
+
},
|
2822
|
+
char,
|
2823
|
+
hasFakeCaret && /* @__PURE__ */ React9.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React9.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
|
2824
|
+
);
|
2825
|
+
});
|
2826
|
+
PinInputSlot.displayName = "PinInputSlot";
|
2827
|
+
var PinInputSeperator = React9.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React9.createElement(Dot, null)));
|
2828
|
+
PinInputSeperator.displayName = "PinInputSeperator";
|
2829
|
+
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
2830
|
+
const maxLength = props.maxLength || 6;
|
2831
|
+
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
2832
|
+
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
2833
|
+
const secondGroupLength = maxLength - firstGroupLength;
|
2834
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React9.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React9.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React9.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React9.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React9.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React9.createElement(
|
2835
|
+
PinInputSlot,
|
2836
|
+
{
|
2837
|
+
key: index + firstGroupLength,
|
2838
|
+
index: index + firstGroupLength,
|
2839
|
+
className: "hawa-w-full hawa-border"
|
2570
2840
|
}
|
2571
|
-
)))), /* @__PURE__ */
|
2841
|
+
)))), /* @__PURE__ */ React9.createElement(HelperText, { helperText: props.helperText }));
|
2572
2842
|
};
|
2573
2843
|
|
2574
2844
|
// elements/popover/Popover.tsx
|
2575
|
-
import * as
|
2845
|
+
import * as React10 from "react";
|
2576
2846
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
2577
|
-
var PopoverContent =
|
2578
|
-
({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */
|
2847
|
+
var PopoverContent = React10.forwardRef(
|
2848
|
+
({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ React10.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React10.createElement(
|
2579
2849
|
PopoverPrimitive.Content,
|
2580
2850
|
{
|
2581
2851
|
ref,
|
@@ -2590,7 +2860,7 @@ var PopoverContent = React8.forwardRef(
|
|
2590
2860
|
))
|
2591
2861
|
);
|
2592
2862
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
2593
|
-
var
|
2863
|
+
var Popover2 = ({
|
2594
2864
|
trigger,
|
2595
2865
|
children,
|
2596
2866
|
className,
|
@@ -2608,7 +2878,7 @@ var Popover = ({
|
|
2608
2878
|
trigger: "var(--radix-popover-trigger-width)",
|
2609
2879
|
default: "auto"
|
2610
2880
|
};
|
2611
|
-
return /* @__PURE__ */
|
2881
|
+
return /* @__PURE__ */ React10.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React10.createElement(
|
2612
2882
|
PopoverPrimitive.Trigger,
|
2613
2883
|
{
|
2614
2884
|
className: "hawa-w-full",
|
@@ -2616,7 +2886,7 @@ var Popover = ({
|
|
2616
2886
|
...triggerProps
|
2617
2887
|
},
|
2618
2888
|
trigger
|
2619
|
-
), /* @__PURE__ */
|
2889
|
+
), /* @__PURE__ */ React10.createElement(
|
2620
2890
|
PopoverContent,
|
2621
2891
|
{
|
2622
2892
|
side,
|
@@ -2638,9 +2908,9 @@ var PopoverPortal = PopoverPrimitive.Portal;
|
|
2638
2908
|
var PopoverRoot = PopoverPrimitive.Root;
|
2639
2909
|
|
2640
2910
|
// elements/radio/Radio.tsx
|
2641
|
-
import
|
2642
|
-
import { TabsList, TabsTrigger, Tabs } from "@radix-ui/react-tabs";
|
2643
|
-
var Radio =
|
2911
|
+
import React11, { useState as useState5, useRef as useRef4, useEffect as useEffect4, forwardRef as forwardRef9 } from "react";
|
2912
|
+
import { TabsList as TabsList2, TabsTrigger as TabsTrigger2, Tabs as Tabs2 } from "@radix-ui/react-tabs";
|
2913
|
+
var Radio = forwardRef9(
|
2644
2914
|
({
|
2645
2915
|
design = "default",
|
2646
2916
|
width = "default",
|
@@ -2673,15 +2943,15 @@ var Radio = forwardRef7(
|
|
2673
2943
|
default: "hawa-max-w-fit",
|
2674
2944
|
full: "hawa-w-full"
|
2675
2945
|
};
|
2676
|
-
const [parentDirection, setParentDirection] =
|
2946
|
+
const [parentDirection, setParentDirection] = React11.useState(
|
2677
2947
|
null
|
2678
2948
|
);
|
2679
|
-
const [selectedOption, setSelectedOption] =
|
2949
|
+
const [selectedOption, setSelectedOption] = useState5(
|
2680
2950
|
props.defaultValue || props.value
|
2681
2951
|
);
|
2682
|
-
const [openTooltip, setOpenTooltip] =
|
2683
|
-
const parentRef =
|
2684
|
-
|
2952
|
+
const [openTooltip, setOpenTooltip] = useState5(null);
|
2953
|
+
const parentRef = useRef4(null);
|
2954
|
+
useEffect4(() => {
|
2685
2955
|
var _a2;
|
2686
2956
|
const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
|
2687
2957
|
if (parentNode) {
|
@@ -2707,7 +2977,7 @@ var Radio = forwardRef7(
|
|
2707
2977
|
];
|
2708
2978
|
switch (design) {
|
2709
2979
|
case "tabs":
|
2710
|
-
return /* @__PURE__ */
|
2980
|
+
return /* @__PURE__ */ React11.createElement(
|
2711
2981
|
"div",
|
2712
2982
|
{
|
2713
2983
|
className: cn(
|
@@ -2715,9 +2985,9 @@ var Radio = forwardRef7(
|
|
2715
2985
|
containerClassNames == null ? void 0 : containerClassNames.tabs
|
2716
2986
|
)
|
2717
2987
|
},
|
2718
|
-
props.label && /* @__PURE__ */
|
2719
|
-
/* @__PURE__ */
|
2720
|
-
|
2988
|
+
props.label && /* @__PURE__ */ React11.createElement(Label, { ...labelProps }, props.label),
|
2989
|
+
/* @__PURE__ */ React11.createElement(Tabs2, null, /* @__PURE__ */ React11.createElement(
|
2990
|
+
TabsList2,
|
2721
2991
|
{
|
2722
2992
|
role: "tablist",
|
2723
2993
|
ref: parentRef,
|
@@ -2731,22 +3001,22 @@ var Radio = forwardRef7(
|
|
2731
3001
|
)
|
2732
3002
|
},
|
2733
3003
|
(_b = props.options) == null ? void 0 : _b.map((opt, o) => {
|
2734
|
-
return opt.tooltip ? /* @__PURE__ */
|
3004
|
+
return opt.tooltip ? /* @__PURE__ */ React11.createElement(
|
2735
3005
|
PopoverRoot,
|
2736
3006
|
{
|
2737
3007
|
key: o,
|
2738
3008
|
open: o === openTooltip,
|
2739
3009
|
onOpenChange: (bool) => setOpenTooltip(bool ? o : null)
|
2740
3010
|
},
|
2741
|
-
/* @__PURE__ */
|
3011
|
+
/* @__PURE__ */ React11.createElement(
|
2742
3012
|
PopoverTrigger,
|
2743
3013
|
{
|
2744
3014
|
onMouseEnter: () => setOpenTooltip(o),
|
2745
3015
|
onMouseLeave: () => setOpenTooltip(null),
|
2746
3016
|
asChild: true
|
2747
3017
|
},
|
2748
|
-
/* @__PURE__ */
|
2749
|
-
|
3018
|
+
/* @__PURE__ */ React11.createElement(
|
3019
|
+
TabsTrigger2,
|
2750
3020
|
{
|
2751
3021
|
"aria-current": selectedOption === opt.value ? "page" : void 0,
|
2752
3022
|
value: opt.value,
|
@@ -2765,9 +3035,9 @@ var Radio = forwardRef7(
|
|
2765
3035
|
opt.label
|
2766
3036
|
)
|
2767
3037
|
),
|
2768
|
-
/* @__PURE__ */
|
2769
|
-
) : /* @__PURE__ */
|
2770
|
-
|
3038
|
+
/* @__PURE__ */ React11.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
|
3039
|
+
) : /* @__PURE__ */ React11.createElement(
|
3040
|
+
TabsTrigger2,
|
2771
3041
|
{
|
2772
3042
|
key: o,
|
2773
3043
|
role: "tab",
|
@@ -2788,10 +3058,10 @@ var Radio = forwardRef7(
|
|
2788
3058
|
);
|
2789
3059
|
})
|
2790
3060
|
)),
|
2791
|
-
!forceHideHelperText && /* @__PURE__ */
|
3061
|
+
!forceHideHelperText && /* @__PURE__ */ React11.createElement(HelperText, { helperText: props.helperText })
|
2792
3062
|
);
|
2793
3063
|
case "bordered":
|
2794
|
-
return /* @__PURE__ */
|
3064
|
+
return /* @__PURE__ */ React11.createElement(
|
2795
3065
|
"div",
|
2796
3066
|
{
|
2797
3067
|
className: cn(
|
@@ -2800,7 +3070,7 @@ var Radio = forwardRef7(
|
|
2800
3070
|
containerClassNames == null ? void 0 : containerClassNames.bordered
|
2801
3071
|
)
|
2802
3072
|
},
|
2803
|
-
props.options && props.options.map((opt, i) => /* @__PURE__ */
|
3073
|
+
props.options && props.options.map((opt, i) => /* @__PURE__ */ React11.createElement("div", { key: i, className: "hawa-w-full hawa-rounded hawa-border" }, /* @__PURE__ */ React11.createElement(
|
2804
3074
|
"div",
|
2805
3075
|
{
|
2806
3076
|
className: cn(
|
@@ -2809,7 +3079,7 @@ var Radio = forwardRef7(
|
|
2809
3079
|
),
|
2810
3080
|
key: i + 1
|
2811
3081
|
},
|
2812
|
-
/* @__PURE__ */
|
3082
|
+
/* @__PURE__ */ React11.createElement(
|
2813
3083
|
"input",
|
2814
3084
|
{
|
2815
3085
|
disabled: opt.disabled,
|
@@ -2820,442 +3090,148 @@ var Radio = forwardRef7(
|
|
2820
3090
|
onChange: () => handleChange(opt)
|
2821
3091
|
}
|
2822
3092
|
),
|
2823
|
-
/* @__PURE__ */
|
3093
|
+
/* @__PURE__ */ React11.createElement(
|
2824
3094
|
"label",
|
2825
3095
|
{
|
2826
3096
|
htmlFor: opt.value.toString(),
|
2827
3097
|
className: cn(
|
2828
|
-
"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white",
|
2829
|
-
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
2830
|
-
)
|
2831
|
-
},
|
2832
|
-
opt.label
|
2833
|
-
)
|
2834
|
-
)))
|
2835
|
-
);
|
2836
|
-
case "cards":
|
2837
|
-
return /* @__PURE__ */
|
2838
|
-
"ul",
|
2839
|
-
{
|
2840
|
-
className: cn(
|
2841
|
-
orientationStyle[orientation],
|
2842
|
-
"hawa-gap-4",
|
2843
|
-
containerClassNames == null ? void 0 : containerClassNames.cards
|
2844
|
-
)
|
2845
|
-
},
|
2846
|
-
(_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */
|
2847
|
-
"input",
|
2848
|
-
{
|
2849
|
-
type: "radio",
|
2850
|
-
id: opt.value.toString(),
|
2851
|
-
name,
|
2852
|
-
value: opt.value.toString(),
|
2853
|
-
className: "hawa-peer hawa-hidden",
|
2854
|
-
required: true,
|
2855
|
-
disabled: opt.disabled
|
2856
|
-
}
|
2857
|
-
), /* @__PURE__ */
|
2858
|
-
"label",
|
2859
|
-
{
|
2860
|
-
htmlFor: opt.value.toString(),
|
2861
|
-
className: cn(
|
2862
|
-
"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
2863
|
-
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
|
2864
|
-
)
|
2865
|
-
},
|
2866
|
-
/* @__PURE__ */
|
2867
|
-
)))
|
2868
|
-
);
|
2869
|
-
default:
|
2870
|
-
return /* @__PURE__ */
|
2871
|
-
"div",
|
2872
|
-
{
|
2873
|
-
className: cn(
|
2874
|
-
"hawa-flex hawa-flex-col hawa-gap-2",
|
2875
|
-
containerClassNames == null ? void 0 : containerClassNames.default
|
2876
|
-
)
|
2877
|
-
},
|
2878
|
-
props.label && /* @__PURE__ */
|
2879
|
-
/* @__PURE__ */
|
2880
|
-
"div",
|
2881
|
-
{
|
2882
|
-
className: cn(
|
2883
|
-
"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
2884
|
-
props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
|
2885
|
-
),
|
2886
|
-
key: i + 1
|
2887
|
-
},
|
2888
|
-
/* @__PURE__ */
|
2889
|
-
"input",
|
2890
|
-
{
|
2891
|
-
disabled: opt.disabled,
|
2892
|
-
id: opt.value.toString(),
|
2893
|
-
type: "radio",
|
2894
|
-
value: opt.value,
|
2895
|
-
name,
|
2896
|
-
onChange: () => handleChange(opt)
|
2897
|
-
}
|
2898
|
-
),
|
2899
|
-
/* @__PURE__ */
|
2900
|
-
"label",
|
2901
|
-
{
|
2902
|
-
htmlFor: opt.value.toString(),
|
2903
|
-
className: cn(
|
2904
|
-
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
2905
|
-
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
2906
|
-
)
|
2907
|
-
},
|
2908
|
-
opt.label
|
2909
|
-
)
|
2910
|
-
))),
|
2911
|
-
/* @__PURE__ */
|
2912
|
-
);
|
2913
|
-
}
|
2914
|
-
}
|
2915
|
-
);
|
2916
|
-
|
2917
|
-
// elements/textarea/Textarea.tsx
|
2918
|
-
import * as React10 from "react";
|
2919
|
-
var Textarea = React10.forwardRef(
|
2920
|
-
({
|
2921
|
-
className,
|
2922
|
-
classNames,
|
2923
|
-
labelProps,
|
2924
|
-
showCount,
|
2925
|
-
forceHideHelperText,
|
2926
|
-
textareaProps,
|
2927
|
-
countPosition = "bottom",
|
2928
|
-
isLoading,
|
2929
|
-
...props
|
2930
|
-
}, ref) => {
|
2931
|
-
return /* @__PURE__ */ React10.createElement(
|
2932
|
-
"div",
|
2933
|
-
{
|
2934
|
-
className: cn(
|
2935
|
-
"textarea-main hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col",
|
2936
|
-
!forceHideHelperText && "hawa-gap-2",
|
2937
|
-
className
|
2938
|
-
)
|
2939
|
-
},
|
2940
|
-
/* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React10.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React10.createElement(
|
2941
|
-
"div",
|
2942
|
-
{
|
2943
|
-
className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
|
2944
|
-
},
|
2945
|
-
(textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
|
2946
|
-
"/",
|
2947
|
-
textareaProps == null ? void 0 : textareaProps.maxLength
|
2948
|
-
)),
|
2949
|
-
isLoading ? /* @__PURE__ */ React10.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React10.createElement(
|
2950
|
-
"textarea",
|
2951
|
-
{
|
2952
|
-
...textareaProps,
|
2953
|
-
className: cn(
|
2954
|
-
"hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
|
2955
|
-
classNames == null ? void 0 : classNames.textarea
|
2956
|
-
),
|
2957
|
-
ref
|
2958
|
-
}
|
2959
|
-
),
|
2960
|
-
/* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React10.createElement(HelperText, { helperText: props.helperText }), showCount && countPosition === "bottom" && /* @__PURE__ */ React10.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
|
2961
|
-
);
|
2962
|
-
}
|
2963
|
-
);
|
2964
|
-
Textarea.displayName = "Textarea";
|
2965
|
-
|
2966
|
-
// elements/scrollArea/ScrollArea.tsx
|
2967
|
-
import * as React11 from "react";
|
2968
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
2969
|
-
var ScrollArea = React11.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
|
2970
|
-
const scrollAreaRef = React11.useRef(null);
|
2971
|
-
const isDragging = React11.useRef(false);
|
2972
|
-
const startPos = React11.useRef({ x: 0, y: 0 });
|
2973
|
-
const scrollPos = React11.useRef({ top: 0, left: 0 });
|
2974
|
-
const [showLeftFade, setShowLeftFade] = React11.useState(false);
|
2975
|
-
const [showRightFade, setShowRightFade] = React11.useState(false);
|
2976
|
-
const checkOverflow = () => {
|
2977
|
-
if (scrollAreaRef.current) {
|
2978
|
-
const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
|
2979
|
-
setShowLeftFade(scrollLeft > 0);
|
2980
|
-
setShowRightFade(scrollLeft + clientWidth < scrollWidth);
|
2981
|
-
}
|
2982
|
-
};
|
2983
|
-
const onMouseDown = (e) => {
|
2984
|
-
isDragging.current = true;
|
2985
|
-
startPos.current = { x: e.clientX, y: e.clientY };
|
2986
|
-
if (scrollAreaRef.current) {
|
2987
|
-
scrollPos.current = {
|
2988
|
-
top: scrollAreaRef.current.scrollTop,
|
2989
|
-
left: scrollAreaRef.current.scrollLeft
|
2990
|
-
};
|
2991
|
-
}
|
2992
|
-
document.addEventListener("mousemove", onMouseMove);
|
2993
|
-
document.addEventListener("mouseup", onMouseUp);
|
2994
|
-
};
|
2995
|
-
const onMouseMove = (e) => {
|
2996
|
-
if (!isDragging.current || !scrollAreaRef.current) return;
|
2997
|
-
const dx = e.clientX - startPos.current.x;
|
2998
|
-
const dy = e.clientY - startPos.current.y;
|
2999
|
-
if (orientation === "vertical") {
|
3000
|
-
scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
|
3001
|
-
} else {
|
3002
|
-
scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
|
3003
|
-
checkOverflow();
|
3004
|
-
}
|
3005
|
-
};
|
3006
|
-
const onMouseUp = () => {
|
3007
|
-
isDragging.current = false;
|
3008
|
-
document.removeEventListener("mousemove", onMouseMove);
|
3009
|
-
document.removeEventListener("mouseup", onMouseUp);
|
3010
|
-
};
|
3011
|
-
React11.useEffect(() => {
|
3012
|
-
checkOverflow();
|
3013
|
-
if (scrollAreaRef.current) {
|
3014
|
-
scrollAreaRef.current.addEventListener("scroll", checkOverflow);
|
3015
|
-
window.addEventListener("resize", checkOverflow);
|
3016
|
-
}
|
3017
|
-
return () => {
|
3018
|
-
if (scrollAreaRef.current) {
|
3019
|
-
scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
|
3020
|
-
}
|
3021
|
-
window.removeEventListener("resize", checkOverflow);
|
3022
|
-
};
|
3023
|
-
}, []);
|
3024
|
-
return /* @__PURE__ */ React11.createElement(
|
3025
|
-
ScrollAreaPrimitive.Root,
|
3026
|
-
{
|
3027
|
-
ref,
|
3028
|
-
className: cn("hawa-relative hawa-overflow-hidden", className),
|
3029
|
-
...props
|
3030
|
-
},
|
3031
|
-
/* @__PURE__ */ React11.createElement(
|
3032
|
-
"div",
|
3033
|
-
{
|
3034
|
-
className: cn(
|
3035
|
-
"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",
|
3036
|
-
showLeftFade ? "hawa-block" : "hawa-hidden"
|
3037
|
-
)
|
3038
|
-
}
|
3039
|
-
),
|
3040
|
-
/* @__PURE__ */ React11.createElement(
|
3041
|
-
"div",
|
3042
|
-
{
|
3043
|
-
className: cn(
|
3044
|
-
"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",
|
3045
|
-
showRightFade ? "hawa-block" : "hawa-hidden"
|
3046
|
-
)
|
3047
|
-
}
|
3048
|
-
),
|
3049
|
-
/* @__PURE__ */ React11.createElement(
|
3050
|
-
ScrollAreaPrimitive.Viewport,
|
3051
|
-
{
|
3052
|
-
ref: scrollAreaRef,
|
3053
|
-
className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
|
3054
|
-
onMouseDown
|
3055
|
-
},
|
3056
|
-
children
|
3057
|
-
),
|
3058
|
-
/* @__PURE__ */ React11.createElement(ScrollBar, { orientation }),
|
3059
|
-
/* @__PURE__ */ React11.createElement(ScrollAreaPrimitive.Corner, null)
|
3060
|
-
);
|
3061
|
-
});
|
3062
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
3063
|
-
var ScrollBar = React11.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React11.createElement(
|
3064
|
-
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
3065
|
-
{
|
3066
|
-
ref,
|
3067
|
-
orientation,
|
3068
|
-
className: cn(
|
3069
|
-
"hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
|
3070
|
-
orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
|
3071
|
-
orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
|
3072
|
-
className
|
3073
|
-
),
|
3074
|
-
...props
|
3075
|
-
},
|
3076
|
-
/* @__PURE__ */ React11.createElement(
|
3077
|
-
ScrollAreaPrimitive.ScrollAreaThumb,
|
3078
|
-
{
|
3079
|
-
className: cn(
|
3080
|
-
"hawa-relative hawa-rounded-full hawa-bg-border",
|
3081
|
-
orientation === "vertical" && "hawa-flex-1"
|
3082
|
-
)
|
3098
|
+
"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white",
|
3099
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
3100
|
+
)
|
3101
|
+
},
|
3102
|
+
opt.label
|
3103
|
+
)
|
3104
|
+
)))
|
3105
|
+
);
|
3106
|
+
case "cards":
|
3107
|
+
return /* @__PURE__ */ React11.createElement(
|
3108
|
+
"ul",
|
3109
|
+
{
|
3110
|
+
className: cn(
|
3111
|
+
orientationStyle[orientation],
|
3112
|
+
"hawa-gap-4",
|
3113
|
+
containerClassNames == null ? void 0 : containerClassNames.cards
|
3114
|
+
)
|
3115
|
+
},
|
3116
|
+
(_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React11.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React11.createElement(
|
3117
|
+
"input",
|
3118
|
+
{
|
3119
|
+
type: "radio",
|
3120
|
+
id: opt.value.toString(),
|
3121
|
+
name,
|
3122
|
+
value: opt.value.toString(),
|
3123
|
+
className: "hawa-peer hawa-hidden",
|
3124
|
+
required: true,
|
3125
|
+
disabled: opt.disabled
|
3126
|
+
}
|
3127
|
+
), /* @__PURE__ */ React11.createElement(
|
3128
|
+
"label",
|
3129
|
+
{
|
3130
|
+
htmlFor: opt.value.toString(),
|
3131
|
+
className: cn(
|
3132
|
+
"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
3133
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
|
3134
|
+
)
|
3135
|
+
},
|
3136
|
+
/* @__PURE__ */ React11.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React11.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
3137
|
+
)))
|
3138
|
+
);
|
3139
|
+
default:
|
3140
|
+
return /* @__PURE__ */ React11.createElement(
|
3141
|
+
"div",
|
3142
|
+
{
|
3143
|
+
className: cn(
|
3144
|
+
"hawa-flex hawa-flex-col hawa-gap-2",
|
3145
|
+
containerClassNames == null ? void 0 : containerClassNames.default
|
3146
|
+
)
|
3147
|
+
},
|
3148
|
+
props.label && /* @__PURE__ */ React11.createElement(Label, { ...labelProps }, props.label),
|
3149
|
+
/* @__PURE__ */ React11.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React11.createElement(
|
3150
|
+
"div",
|
3151
|
+
{
|
3152
|
+
className: cn(
|
3153
|
+
"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
3154
|
+
props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
|
3155
|
+
),
|
3156
|
+
key: i + 1
|
3157
|
+
},
|
3158
|
+
/* @__PURE__ */ React11.createElement(
|
3159
|
+
"input",
|
3160
|
+
{
|
3161
|
+
disabled: opt.disabled,
|
3162
|
+
id: opt.value.toString(),
|
3163
|
+
type: "radio",
|
3164
|
+
value: opt.value,
|
3165
|
+
name,
|
3166
|
+
onChange: () => handleChange(opt)
|
3167
|
+
}
|
3168
|
+
),
|
3169
|
+
/* @__PURE__ */ React11.createElement(
|
3170
|
+
"label",
|
3171
|
+
{
|
3172
|
+
htmlFor: opt.value.toString(),
|
3173
|
+
className: cn(
|
3174
|
+
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
3175
|
+
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
3176
|
+
)
|
3177
|
+
},
|
3178
|
+
opt.label
|
3179
|
+
)
|
3180
|
+
))),
|
3181
|
+
/* @__PURE__ */ React11.createElement(HelperText, { helperText: props.helperText })
|
3182
|
+
);
|
3083
3183
|
}
|
3084
|
-
|
3085
|
-
)
|
3086
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
3184
|
+
}
|
3185
|
+
);
|
3087
3186
|
|
3088
|
-
// elements/
|
3187
|
+
// elements/textarea/Textarea.tsx
|
3089
3188
|
import * as React12 from "react";
|
3090
|
-
|
3091
|
-
|
3092
|
-
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
},
|
3103
|
-
compoundVariants: [
|
3104
|
-
{
|
3105
|
-
variant: "underlined_tabs",
|
3106
|
-
orientation: "vertical",
|
3107
|
-
class: "hawa-border-e-2 hawa-border-e-primary"
|
3108
|
-
},
|
3109
|
-
{
|
3110
|
-
variant: "underlined_tabs",
|
3111
|
-
orientation: "horizontal",
|
3112
|
-
class: "hawa-border-b-2 hawa-border-b-primary"
|
3113
|
-
}
|
3114
|
-
],
|
3115
|
-
defaultVariants: { variant: "default", orientation: "horizontal" }
|
3116
|
-
});
|
3117
|
-
var tabsTriggerVariant = tv({
|
3118
|
-
base: "",
|
3119
|
-
variants: {
|
3120
|
-
variant: {
|
3121
|
-
default: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-border hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground data-[state=active]:hawa-shadow-sm dark:hawa-border-primary/10",
|
3122
|
-
underlined: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-rounded-none hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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",
|
3123
|
-
underlined_tabs: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all 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 hawa-bg-primary/10 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground dark:hawa-border-primary/10"
|
3124
|
-
},
|
3125
|
-
orientation: { horizontal: "", vertical: "" }
|
3126
|
-
},
|
3127
|
-
compoundVariants: [
|
3128
|
-
{
|
3129
|
-
variant: "underlined",
|
3130
|
-
orientation: "horizontal",
|
3131
|
-
class: "data-[state=active]:hawa-border-b-primary hawa-border-b hawa-border-b-2"
|
3132
|
-
},
|
3133
|
-
{
|
3134
|
-
variant: "underlined",
|
3135
|
-
orientation: "vertical",
|
3136
|
-
class: "data-[state=active]:hawa-border-e-primary hawa-border-e hawa-border-e-2"
|
3137
|
-
},
|
3138
|
-
{
|
3139
|
-
variant: "underlined_tabs",
|
3140
|
-
orientation: "horizontal",
|
3141
|
-
class: "hawa-rounded-b-none"
|
3142
|
-
},
|
3143
|
-
{
|
3144
|
-
variant: "underlined_tabs",
|
3145
|
-
orientation: "vertical",
|
3146
|
-
class: "hawa-rounded-e-none"
|
3147
|
-
}
|
3148
|
-
],
|
3149
|
-
defaultVariants: { variant: "default", orientation: "horizontal" }
|
3150
|
-
});
|
3151
|
-
var TabsContext = React12.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
|
3152
|
-
var Tabs2 = React12.forwardRef(
|
3153
|
-
({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
3154
|
-
TabsPrimitive.Root,
|
3155
|
-
{
|
3156
|
-
ref,
|
3157
|
-
className: cn(
|
3158
|
-
"hawa-flex hawa-gap-2",
|
3159
|
-
orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
|
3160
|
-
className
|
3161
|
-
),
|
3162
|
-
...props
|
3163
|
-
},
|
3164
|
-
/* @__PURE__ */ React12.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
|
3165
|
-
)
|
3166
|
-
);
|
3167
|
-
var TabsList2 = React12.forwardRef(({ className, classNames, ...props }, ref) => {
|
3168
|
-
const { orientation, variant, scrollable } = React12.useContext(TabsContext);
|
3169
|
-
const { width } = useViewportSize();
|
3170
|
-
if (scrollable && width < 768 && orientation === "horizontal") {
|
3171
|
-
return /* @__PURE__ */ React12.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React12.createElement(
|
3172
|
-
TabsPrimitive.List,
|
3173
|
-
{
|
3174
|
-
ref,
|
3175
|
-
className: cn(
|
3176
|
-
tabsListVariant({ variant, orientation }),
|
3177
|
-
"hawa-flex-row hawa-flex-nowrap",
|
3178
|
-
className
|
3179
|
-
),
|
3180
|
-
...props
|
3181
|
-
}
|
3182
|
-
));
|
3183
|
-
} else {
|
3189
|
+
var Textarea = React12.forwardRef(
|
3190
|
+
({
|
3191
|
+
className,
|
3192
|
+
classNames,
|
3193
|
+
labelProps,
|
3194
|
+
showCount,
|
3195
|
+
forceHideHelperText,
|
3196
|
+
textareaProps,
|
3197
|
+
countPosition = "bottom",
|
3198
|
+
isLoading,
|
3199
|
+
...props
|
3200
|
+
}, ref) => {
|
3184
3201
|
return /* @__PURE__ */ React12.createElement(
|
3185
|
-
|
3202
|
+
"div",
|
3186
3203
|
{
|
3187
|
-
ref,
|
3188
3204
|
className: cn(
|
3189
|
-
|
3190
|
-
|
3191
|
-
"hawa-flex-wrap",
|
3205
|
+
"textarea-main hawa-relative hawa-flex hawa-h-full hawa-w-full hawa-flex-col",
|
3206
|
+
!forceHideHelperText && "hawa-gap-2",
|
3192
3207
|
className
|
3193
|
-
)
|
3194
|
-
|
3195
|
-
}
|
3196
|
-
|
3197
|
-
}
|
3198
|
-
});
|
3199
|
-
var TabsTrigger2 = React12.forwardRef(
|
3200
|
-
({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
|
3201
|
-
const { orientation, variant } = React12.useContext(TabsContext);
|
3202
|
-
if (withPopover) {
|
3203
|
-
return /* @__PURE__ */ React12.createElement(Popover2.Root, { open: props.showPopover }, /* @__PURE__ */ React12.createElement(Popover2.Anchor, { asChild: true }, /* @__PURE__ */ React12.createElement(
|
3204
|
-
TabsPrimitive.Trigger,
|
3205
|
-
{
|
3206
|
-
className: cn(
|
3207
|
-
tabsTriggerVariant({ variant, orientation }),
|
3208
|
-
"hawa-relative",
|
3209
|
-
className
|
3210
|
-
),
|
3211
|
-
...props
|
3212
|
-
},
|
3213
|
-
props.children,
|
3214
|
-
chipProps && /* @__PURE__ */ React12.createElement(Chip, { ...chipProps })
|
3215
|
-
)), /* @__PURE__ */ React12.createElement(
|
3216
|
-
Popover2.Content,
|
3208
|
+
)
|
3209
|
+
},
|
3210
|
+
/* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, props.label && /* @__PURE__ */ React12.createElement(Label, { ...labelProps }, props.label), showCount && countPosition === "top" && /* @__PURE__ */ React12.createElement(
|
3211
|
+
"div",
|
3217
3212
|
{
|
3218
|
-
|
3219
|
-
asChild: true,
|
3220
|
-
className: cn(
|
3221
|
-
"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",
|
3222
|
-
"hawa-arrow-default-top hawa-mt-2"
|
3223
|
-
)
|
3213
|
+
className: "hawa-text-start hawa-text-xs hawa-transition-all hawa-leading-none"
|
3224
3214
|
},
|
3225
|
-
|
3226
|
-
|
3227
|
-
|
3228
|
-
|
3229
|
-
|
3215
|
+
(textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0,
|
3216
|
+
"/",
|
3217
|
+
textareaProps == null ? void 0 : textareaProps.maxLength
|
3218
|
+
)),
|
3219
|
+
isLoading ? /* @__PURE__ */ React12.createElement(Skeleton, { style: { height: 40 } }) : /* @__PURE__ */ React12.createElement(
|
3220
|
+
"textarea",
|
3230
3221
|
{
|
3222
|
+
...textareaProps,
|
3231
3223
|
className: cn(
|
3232
|
-
|
3233
|
-
|
3234
|
-
className
|
3224
|
+
"hawa-flex hawa-min-h-[40px] hawa-h-[40px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-gray-400 placeholder:hawa-text-muted-foreground focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50",
|
3225
|
+
classNames == null ? void 0 : classNames.textarea
|
3235
3226
|
),
|
3236
|
-
|
3237
|
-
}
|
3238
|
-
|
3239
|
-
|
3240
|
-
|
3241
|
-
}
|
3227
|
+
ref
|
3228
|
+
}
|
3229
|
+
),
|
3230
|
+
/* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, !forceHideHelperText && /* @__PURE__ */ React12.createElement(HelperText, { helperText: props.helperText }), showCount && countPosition === "bottom" && /* @__PURE__ */ React12.createElement("div", { className: "hawa-text-start hawa-text-xs hawa-transition-all" }, (textareaProps == null ? void 0 : textareaProps.value) ? String(textareaProps == null ? void 0 : textareaProps.value).length : 0, "/", textareaProps == null ? void 0 : textareaProps.maxLength))
|
3231
|
+
);
|
3242
3232
|
}
|
3243
3233
|
);
|
3244
|
-
|
3245
|
-
TabsPrimitive.Content,
|
3246
|
-
{
|
3247
|
-
ref,
|
3248
|
-
className: cn(
|
3249
|
-
"hawa-ring-offset-hawa-background hawa-w-full focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2",
|
3250
|
-
className
|
3251
|
-
),
|
3252
|
-
...props
|
3253
|
-
}
|
3254
|
-
));
|
3255
|
-
Tabs2.displayName = TabsPrimitive.Root.displayName;
|
3256
|
-
TabsList2.displayName = TabsPrimitive.List.displayName;
|
3257
|
-
TabsTrigger2.displayName = TabsPrimitive.Trigger.displayName;
|
3258
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
3234
|
+
Textarea.displayName = "Textarea";
|
3259
3235
|
|
3260
3236
|
// elements/separator/Separator.tsx
|
3261
3237
|
import * as React13 from "react";
|
@@ -3305,24 +3281,24 @@ export {
|
|
3305
3281
|
PhoneInput,
|
3306
3282
|
Checkbox,
|
3307
3283
|
StopPropagationWrapper,
|
3284
|
+
ScrollArea,
|
3285
|
+
ScrollBar,
|
3286
|
+
Tabs,
|
3287
|
+
TabsList,
|
3288
|
+
TabsTrigger,
|
3289
|
+
TabsContent,
|
3308
3290
|
PinInputRoot,
|
3309
3291
|
PinInputGroup,
|
3310
3292
|
PinInputSlot,
|
3311
3293
|
PinInputSeperator,
|
3312
3294
|
PinInput,
|
3313
3295
|
PopoverContent,
|
3314
|
-
Popover,
|
3296
|
+
Popover2 as Popover,
|
3315
3297
|
PopoverTrigger,
|
3316
3298
|
PopoverPortal,
|
3317
3299
|
PopoverRoot,
|
3318
3300
|
Radio,
|
3319
3301
|
Textarea,
|
3320
|
-
ScrollArea,
|
3321
|
-
ScrollBar,
|
3322
|
-
Tabs2 as Tabs,
|
3323
|
-
TabsList2 as TabsList,
|
3324
|
-
TabsTrigger2 as TabsTrigger,
|
3325
|
-
TabsContent,
|
3326
3302
|
Separator,
|
3327
3303
|
Progress
|
3328
3304
|
};
|